termbridge 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +56 -0
- package/dist/bin.js +2819 -0
- package/dist/bin.js.map +1 -0
- package/package.json +79 -0
- package/ui/dist/assets/index-B5s06ZPI.css +1 -0
- package/ui/dist/assets/index-BH9gzDdw.js +103 -0
- package/ui/dist/index.html +13 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
function h2(t,e){for(var i=0;i<e.length;i++){const n=e[i];if(typeof n!="string"&&!Array.isArray(n)){for(const a in n)if(a!=="default"&&!(a in t)){const l=Object.getOwnPropertyDescriptor(n,a);l&&Object.defineProperty(t,a,l.get?l:{enumerable:!0,get:()=>n[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&n(u)}).observe(document,{childList:!0,subtree:!0});function i(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerPolicy&&(l.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?l.credentials="include":a.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function n(a){if(a.ep)return;a.ep=!0;const l=i(a);fetch(a.href,l)}})();function G1(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var b_={exports:{}},Kc={};var py;function d2(){if(py)return Kc;py=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function i(n,a,l){var u=null;if(l!==void 0&&(u=""+l),a.key!==void 0&&(u=""+a.key),"key"in a){l={};for(var h in a)h!=="key"&&(l[h]=a[h])}else l=a;return a=l.ref,{$$typeof:t,type:n,key:u,ref:a!==void 0?a:null,props:l}}return Kc.Fragment=e,Kc.jsx=i,Kc.jsxs=i,Kc}var gy;function f2(){return gy||(gy=1,b_.exports=d2()),b_.exports}var j=f2(),w_={exports:{}},Xc={},C_={exports:{}},x_={};var vy;function m2(){return vy||(vy=1,(function(t){function e(T,L){var H=T.length;T.push(L);e:for(;0<H;){var Y=H-1>>>1,X=T[Y];if(0<a(X,L))T[Y]=L,T[H]=X,H=Y;else break e}}function i(T){return T.length===0?null:T[0]}function n(T){if(T.length===0)return null;var L=T[0],H=T.pop();if(H!==L){T[0]=H;e:for(var Y=0,X=T.length,D=X>>>1;Y<D;){var G=2*(Y+1)-1,ie=T[G],ae=G+1,de=T[ae];if(0>a(ie,H))ae<X&&0>a(de,ie)?(T[Y]=de,T[ae]=H,Y=ae):(T[Y]=ie,T[G]=H,Y=G);else if(ae<X&&0>a(de,H))T[Y]=de,T[ae]=H,Y=ae;else break e}}return L}function a(T,L){var H=T.sortIndex-L.sortIndex;return H!==0?H:T.id-L.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;t.unstable_now=function(){return l.now()}}else{var u=Date,h=u.now();t.unstable_now=function(){return u.now()-h}}var f=[],d=[],p=1,v=null,g=3,S=!1,b=!1,C=!1,x=!1,E=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,B=typeof setImmediate<"u"?setImmediate:null;function R(T){for(var L=i(d);L!==null;){if(L.callback===null)n(d);else if(L.startTime<=T)n(d),L.sortIndex=L.expirationTime,e(f,L);else break;L=i(d)}}function $(T){if(C=!1,R(T),!b)if(i(f)!==null)b=!0,F||(F=!0,M());else{var L=i(d);L!==null&&P($,L.startTime-T)}}var F=!1,U=-1,z=5,V=-1;function se(){return x?!0:!(t.unstable_now()-V<z)}function ee(){if(x=!1,F){var T=t.unstable_now();V=T;var L=!0;try{e:{b=!1,C&&(C=!1,A(U),U=-1),S=!0;var H=g;try{t:{for(R(T),v=i(f);v!==null&&!(v.expirationTime>T&&se());){var Y=v.callback;if(typeof Y=="function"){v.callback=null,g=v.priorityLevel;var X=Y(v.expirationTime<=T);if(T=t.unstable_now(),typeof X=="function"){v.callback=X,R(T),L=!0;break t}v===i(f)&&n(f),R(T)}else n(f);v=i(f)}if(v!==null)L=!0;else{var D=i(d);D!==null&&P($,D.startTime-T),L=!1}}break e}finally{v=null,g=H,S=!1}L=void 0}}finally{L?M():F=!1}}}var M;if(typeof B=="function")M=function(){B(ee)};else if(typeof MessageChannel<"u"){var O=new MessageChannel,N=O.port2;O.port1.onmessage=ee,M=function(){N.postMessage(null)}}else M=function(){E(ee,0)};function P(T,L){U=E(function(){T(t.unstable_now())},L)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(T){T.callback=null},t.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<T?Math.floor(1e3/T):5},t.unstable_getCurrentPriorityLevel=function(){return g},t.unstable_next=function(T){switch(g){case 1:case 2:case 3:var L=3;break;default:L=g}var H=g;g=L;try{return T()}finally{g=H}},t.unstable_requestPaint=function(){x=!0},t.unstable_runWithPriority=function(T,L){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var H=g;g=T;try{return L()}finally{g=H}},t.unstable_scheduleCallback=function(T,L,H){var Y=t.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?Y+H:Y):H=Y,T){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=H+X,T={id:p++,callback:L,priorityLevel:T,startTime:H,expirationTime:X,sortIndex:-1},H>Y?(T.sortIndex=H,e(d,T),i(f)===null&&T===i(d)&&(C?(A(U),U=-1):C=!0,P($,H-Y))):(T.sortIndex=X,e(f,T),b||S||(b=!0,F||(F=!0,M()))),T},t.unstable_shouldYield=se,t.unstable_wrapCallback=function(T){var L=g;return function(){var H=g;g=L;try{return T.apply(this,arguments)}finally{g=H}}}})(x_)),x_}var Sy;function _2(){return Sy||(Sy=1,C_.exports=m2()),C_.exports}var k_={exports:{}},Ge={};var yy;function p2(){if(yy)return Ge;yy=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),g=Symbol.iterator;function S(D){return D===null||typeof D!="object"?null:(D=g&&D[g]||D["@@iterator"],typeof D=="function"?D:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,x={};function E(D,G,ie){this.props=D,this.context=G,this.refs=x,this.updater=ie||b}E.prototype.isReactComponent={},E.prototype.setState=function(D,G){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,G,"setState")},E.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function A(){}A.prototype=E.prototype;function B(D,G,ie){this.props=D,this.context=G,this.refs=x,this.updater=ie||b}var R=B.prototype=new A;R.constructor=B,C(R,E.prototype),R.isPureReactComponent=!0;var $=Array.isArray;function F(){}var U={H:null,A:null,T:null,S:null},z=Object.prototype.hasOwnProperty;function V(D,G,ie){var ae=ie.ref;return{$$typeof:t,type:D,key:G,ref:ae!==void 0?ae:null,props:ie}}function se(D,G){return V(D.type,G,D.props)}function ee(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function M(D){var G={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(ie){return G[ie]})}var O=/\/+/g;function N(D,G){return typeof D=="object"&&D!==null&&D.key!=null?M(""+D.key):G.toString(36)}function P(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(F,F):(D.status="pending",D.then(function(G){D.status==="pending"&&(D.status="fulfilled",D.value=G)},function(G){D.status==="pending"&&(D.status="rejected",D.reason=G)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function T(D,G,ie,ae,de){var ue=typeof D;(ue==="undefined"||ue==="boolean")&&(D=null);var he=!1;if(D===null)he=!0;else switch(ue){case"bigint":case"string":case"number":he=!0;break;case"object":switch(D.$$typeof){case t:case e:he=!0;break;case p:return he=D._init,T(he(D._payload),G,ie,ae,de)}}if(he)return de=de(D),he=ae===""?"."+N(D,0):ae,$(de)?(ie="",he!=null&&(ie=he.replace(O,"$&/")+"/"),T(de,G,ie,"",function(Ae){return Ae})):de!=null&&(ee(de)&&(de=se(de,ie+(de.key==null||D&&D.key===de.key?"":(""+de.key).replace(O,"$&/")+"/")+he)),G.push(de)),1;he=0;var ve=ae===""?".":ae+":";if($(D))for(var ye=0;ye<D.length;ye++)ae=D[ye],ue=ve+N(ae,ye),he+=T(ae,G,ie,ue,de);else if(ye=S(D),typeof ye=="function")for(D=ye.call(D),ye=0;!(ae=D.next()).done;)ae=ae.value,ue=ve+N(ae,ye++),he+=T(ae,G,ie,ue,de);else if(ue==="object"){if(typeof D.then=="function")return T(P(D),G,ie,ae,de);throw G=String(D),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return he}function L(D,G,ie){if(D==null)return D;var ae=[],de=0;return T(D,ae,"","",function(ue){return G.call(ie,ue,de++)}),ae}function H(D){if(D._status===-1){var G=D._result;G=G(),G.then(function(ie){(D._status===0||D._status===-1)&&(D._status=1,D._result=ie)},function(ie){(D._status===0||D._status===-1)&&(D._status=2,D._result=ie)}),D._status===-1&&(D._status=0,D._result=G)}if(D._status===1)return D._result.default;throw D._result}var Y=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=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(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},X={map:L,forEach:function(D,G,ie){L(D,function(){G.apply(this,arguments)},ie)},count:function(D){var G=0;return L(D,function(){G++}),G},toArray:function(D){return L(D,function(G){return G})||[]},only:function(D){if(!ee(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return Ge.Activity=v,Ge.Children=X,Ge.Component=E,Ge.Fragment=i,Ge.Profiler=a,Ge.PureComponent=B,Ge.StrictMode=n,Ge.Suspense=f,Ge.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=U,Ge.__COMPILER_RUNTIME={__proto__:null,c:function(D){return U.H.useMemoCache(D)}},Ge.cache=function(D){return function(){return D.apply(null,arguments)}},Ge.cacheSignal=function(){return null},Ge.cloneElement=function(D,G,ie){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var ae=C({},D.props),de=D.key;if(G!=null)for(ue in G.key!==void 0&&(de=""+G.key),G)!z.call(G,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&G.ref===void 0||(ae[ue]=G[ue]);var ue=arguments.length-2;if(ue===1)ae.children=ie;else if(1<ue){for(var he=Array(ue),ve=0;ve<ue;ve++)he[ve]=arguments[ve+2];ae.children=he}return V(D.type,de,ae)},Ge.createContext=function(D){return D={$$typeof:u,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:l,_context:D},D},Ge.createElement=function(D,G,ie){var ae,de={},ue=null;if(G!=null)for(ae in G.key!==void 0&&(ue=""+G.key),G)z.call(G,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(de[ae]=G[ae]);var he=arguments.length-2;if(he===1)de.children=ie;else if(1<he){for(var ve=Array(he),ye=0;ye<he;ye++)ve[ye]=arguments[ye+2];de.children=ve}if(D&&D.defaultProps)for(ae in he=D.defaultProps,he)de[ae]===void 0&&(de[ae]=he[ae]);return V(D,ue,de)},Ge.createRef=function(){return{current:null}},Ge.forwardRef=function(D){return{$$typeof:h,render:D}},Ge.isValidElement=ee,Ge.lazy=function(D){return{$$typeof:p,_payload:{_status:-1,_result:D},_init:H}},Ge.memo=function(D,G){return{$$typeof:d,type:D,compare:G===void 0?null:G}},Ge.startTransition=function(D){var G=U.T,ie={};U.T=ie;try{var ae=D(),de=U.S;de!==null&&de(ie,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(F,Y)}catch(ue){Y(ue)}finally{G!==null&&ie.types!==null&&(G.types=ie.types),U.T=G}},Ge.unstable_useCacheRefresh=function(){return U.H.useCacheRefresh()},Ge.use=function(D){return U.H.use(D)},Ge.useActionState=function(D,G,ie){return U.H.useActionState(D,G,ie)},Ge.useCallback=function(D,G){return U.H.useCallback(D,G)},Ge.useContext=function(D){return U.H.useContext(D)},Ge.useDebugValue=function(){},Ge.useDeferredValue=function(D,G){return U.H.useDeferredValue(D,G)},Ge.useEffect=function(D,G){return U.H.useEffect(D,G)},Ge.useEffectEvent=function(D){return U.H.useEffectEvent(D)},Ge.useId=function(){return U.H.useId()},Ge.useImperativeHandle=function(D,G,ie){return U.H.useImperativeHandle(D,G,ie)},Ge.useInsertionEffect=function(D,G){return U.H.useInsertionEffect(D,G)},Ge.useLayoutEffect=function(D,G){return U.H.useLayoutEffect(D,G)},Ge.useMemo=function(D,G){return U.H.useMemo(D,G)},Ge.useOptimistic=function(D,G){return U.H.useOptimistic(D,G)},Ge.useReducer=function(D,G,ie){return U.H.useReducer(D,G,ie)},Ge.useRef=function(D){return U.H.useRef(D)},Ge.useState=function(D){return U.H.useState(D)},Ge.useSyncExternalStore=function(D,G,ie){return U.H.useSyncExternalStore(D,G,ie)},Ge.useTransition=function(){return U.H.useTransition()},Ge.version="19.2.3",Ge}var by;function Du(){return by||(by=1,k_.exports=p2()),k_.exports}var E_={exports:{}},es={};var wy;function g2(){if(wy)return es;wy=1;var t=Du();function e(f){var d="https://react.dev/errors/"+f;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)d+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+f+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var n={d:{f:i,r:function(){throw Error(e(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},a=Symbol.for("react.portal");function l(f,d,p){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:v==null?null:""+v,children:f,containerInfo:d,implementation:p}}var u=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(f,d){if(f==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return es.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,es.createPortal=function(f,d){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(e(299));return l(f,d,null,p)},es.flushSync=function(f){var d=u.T,p=n.p;try{if(u.T=null,n.p=2,f)return f()}finally{u.T=d,n.p=p,n.d.f()}},es.preconnect=function(f,d){typeof f=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,n.d.C(f,d))},es.prefetchDNS=function(f){typeof f=="string"&&n.d.D(f)},es.preinit=function(f,d){if(typeof f=="string"&&d&&typeof d.as=="string"){var p=d.as,v=h(p,d.crossOrigin),g=typeof d.integrity=="string"?d.integrity:void 0,S=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;p==="style"?n.d.S(f,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:v,integrity:g,fetchPriority:S}):p==="script"&&n.d.X(f,{crossOrigin:v,integrity:g,fetchPriority:S,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},es.preinitModule=function(f,d){if(typeof f=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var p=h(d.as,d.crossOrigin);n.d.M(f,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&n.d.M(f)},es.preload=function(f,d){if(typeof f=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var p=d.as,v=h(p,d.crossOrigin);n.d.L(f,p,{crossOrigin:v,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},es.preloadModule=function(f,d){if(typeof f=="string")if(d){var p=h(d.as,d.crossOrigin);n.d.m(f,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else n.d.m(f)},es.requestFormReset=function(f){n.d.r(f)},es.unstable_batchedUpdates=function(f,d){return f(d)},es.useFormState=function(f,d,p){return u.H.useFormState(f,d,p)},es.useFormStatus=function(){return u.H.useHostTransitionStatus()},es.version="19.2.3",es}var Cy;function K1(){if(Cy)return E_.exports;Cy=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),E_.exports=g2(),E_.exports}var xy;function v2(){if(xy)return Xc;xy=1;var t=_2(),e=Du(),i=K1();function n(s){var r="https://react.dev/errors/"+s;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)r+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+s+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function l(s){var r=s,o=s;if(s.alternate)for(;r.return;)r=r.return;else{s=r;do r=s,(r.flags&4098)!==0&&(o=r.return),s=r.return;while(s)}return r.tag===3?o:null}function u(s){if(s.tag===13){var r=s.memoizedState;if(r===null&&(s=s.alternate,s!==null&&(r=s.memoizedState)),r!==null)return r.dehydrated}return null}function h(s){if(s.tag===31){var r=s.memoizedState;if(r===null&&(s=s.alternate,s!==null&&(r=s.memoizedState)),r!==null)return r.dehydrated}return null}function f(s){if(l(s)!==s)throw Error(n(188))}function d(s){var r=s.alternate;if(!r){if(r=l(s),r===null)throw Error(n(188));return r!==s?null:s}for(var o=s,c=r;;){var m=o.return;if(m===null)break;var _=m.alternate;if(_===null){if(c=m.return,c!==null){o=c;continue}break}if(m.child===_.child){for(_=m.child;_;){if(_===o)return f(m),s;if(_===c)return f(m),r;_=_.sibling}throw Error(n(188))}if(o.return!==c.return)o=m,c=_;else{for(var y=!1,k=m.child;k;){if(k===o){y=!0,o=m,c=_;break}if(k===c){y=!0,c=m,o=_;break}k=k.sibling}if(!y){for(k=_.child;k;){if(k===o){y=!0,o=_,c=m;break}if(k===c){y=!0,c=_,o=m;break}k=k.sibling}if(!y)throw Error(n(189))}}if(o.alternate!==c)throw Error(n(190))}if(o.tag!==3)throw Error(n(188));return o.stateNode.current===o?s:r}function p(s){var r=s.tag;if(r===5||r===26||r===27||r===6)return s;for(s=s.child;s!==null;){if(r=p(s),r!==null)return r;s=s.sibling}return null}var v=Object.assign,g=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),B=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),U=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),se=Symbol.for("react.memo_cache_sentinel"),ee=Symbol.iterator;function M(s){return s===null||typeof s!="object"?null:(s=ee&&s[ee]||s["@@iterator"],typeof s=="function"?s:null)}var O=Symbol.for("react.client.reference");function N(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===O?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case C:return"Fragment";case E:return"Profiler";case x:return"StrictMode";case $:return"Suspense";case F:return"SuspenseList";case V:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case b:return"Portal";case B:return s.displayName||"Context";case A:return(s._context.displayName||"Context")+".Consumer";case R:var r=s.render;return s=s.displayName,s||(s=r.displayName||r.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case U:return r=s.displayName||null,r!==null?r:N(s.type)||"Memo";case z:r=s._payload,s=s._init;try{return N(s(r))}catch{}}return null}var P=Array.isArray,T=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H={pending:!1,data:null,method:null,action:null},Y=[],X=-1;function D(s){return{current:s}}function G(s){0>X||(s.current=Y[X],Y[X]=null,X--)}function ie(s,r){X++,Y[X]=s.current,s.current=r}var ae=D(null),de=D(null),ue=D(null),he=D(null);function ve(s,r){switch(ie(ue,r),ie(de,s),ie(ae,null),r.nodeType){case 9:case 11:s=(s=r.documentElement)&&(s=s.namespaceURI)?IS(s):0;break;default:if(s=r.tagName,r=r.namespaceURI)r=IS(r),s=US(r,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}G(ae),ie(ae,s)}function ye(){G(ae),G(de),G(ue)}function Ae(s){s.memoizedState!==null&&ie(he,s);var r=ae.current,o=US(r,s.type);r!==o&&(ie(de,s),ie(ae,o))}function De(s){de.current===s&&(G(ae),G(de)),he.current===s&&(G(he),Vc._currentValue=H)}var rt,Ze;function xe(s){if(rt===void 0)try{throw Error()}catch(o){var r=o.stack.trim().match(/\n( *(at )?)/);rt=r&&r[1]||"",Ze=-1<o.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+rt+s+Ze}var ze=!1;function pe(s,r){if(!s||ze)return"";ze=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(r){var oe=function(){throw Error()};if(Object.defineProperty(oe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(oe,[])}catch(te){var J=te}Reflect.construct(s,[],oe)}else{try{oe.call()}catch(te){J=te}s.call(oe.prototype)}}else{try{throw Error()}catch(te){J=te}(oe=s())&&typeof oe.catch=="function"&&oe.catch(function(){})}}catch(te){if(te&&J&&typeof te.stack=="string")return[te.stack,J.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var _=c.DetermineComponentFrameRoot(),y=_[0],k=_[1];if(y&&k){var I=y.split(`
|
|
4
|
+
`),Z=k.split(`
|
|
5
|
+
`);for(m=c=0;c<I.length&&!I[c].includes("DetermineComponentFrameRoot");)c++;for(;m<Z.length&&!Z[m].includes("DetermineComponentFrameRoot");)m++;if(c===I.length||m===Z.length)for(c=I.length-1,m=Z.length-1;1<=c&&0<=m&&I[c]!==Z[m];)m--;for(;1<=c&&0<=m;c--,m--)if(I[c]!==Z[m]){if(c!==1||m!==1)do if(c--,m--,0>m||I[c]!==Z[m]){var re=`
|
|
6
|
+
`+I[c].replace(" at new "," at ");return s.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",s.displayName)),re}while(1<=c&&0<=m);break}}}finally{ze=!1,Error.prepareStackTrace=o}return(o=s?s.displayName||s.name:"")?xe(o):""}function _t(s,r){switch(s.tag){case 26:case 27:case 5:return xe(s.type);case 16:return xe("Lazy");case 13:return s.child!==r&&r!==null?xe("Suspense Fallback"):xe("Suspense");case 19:return xe("SuspenseList");case 0:case 15:return pe(s.type,!1);case 11:return pe(s.type.render,!1);case 1:return pe(s.type,!0);case 31:return xe("Activity");default:return""}}function yt(s){try{var r="",o=null;do r+=_t(s,o),o=s,s=s.return;while(s);return r}catch(c){return`
|
|
7
|
+
Error generating stack: `+c.message+`
|
|
8
|
+
`+c.stack}}var dt=Object.prototype.hasOwnProperty,Ce=t.unstable_scheduleCallback,_e=t.unstable_cancelCallback,Kt=t.unstable_shouldYield,Be=t.unstable_requestPaint,Qe=t.unstable_now,Ye=t.unstable_getCurrentPriorityLevel,xt=t.unstable_ImmediatePriority,je=t.unstable_UserBlockingPriority,Ts=t.unstable_NormalPriority,ss=t.unstable_LowPriority,Kn=t.unstable_IdlePriority,Xn=t.log,Fr=t.unstable_setDisableYieldValue,Ys=null,ri=null;function $i(s){if(typeof Xn=="function"&&Fr(s),ri&&typeof ri.setStrictMode=="function")try{ri.setStrictMode(Ys,s)}catch{}}var Mt=Math.clz32?Math.clz32:cn,ni=Math.log,Gs=Math.LN2;function cn(s){return s>>>=0,s===0?32:31-(ni(s)/Gs|0)|0}var Ks=256,kt=262144,kr=4194304;function Wi(s){var r=s&42;if(r!==0)return r;switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Rs(s,r,o){var c=s.pendingLanes;if(c===0)return 0;var m=0,_=s.suspendedLanes,y=s.pingedLanes;s=s.warmLanes;var k=c&134217727;return k!==0?(c=k&~_,c!==0?m=Wi(c):(y&=k,y!==0?m=Wi(y):o||(o=k&~s,o!==0&&(m=Wi(o))))):(k=c&~_,k!==0?m=Wi(k):y!==0?m=Wi(y):o||(o=c&~s,o!==0&&(m=Wi(o)))),m===0?0:r!==0&&r!==m&&(r&_)===0&&(_=m&-m,o=r&-r,_>=o||_===32&&(o&4194048)!==0)?r:m}function Er(s,r){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&r)===0}function Zn(s,r){switch(s){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Qi(){var s=kr;return kr<<=1,(kr&62914560)===0&&(kr=4194304),s}function Xs(s){for(var r=[],o=0;31>o;o++)r.push(s);return r}function Ut(s,r){s.pendingLanes|=r,r!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function Pe(s,r,o,c,m,_){var y=s.pendingLanes;s.pendingLanes=o,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=o,s.entangledLanes&=o,s.errorRecoveryDisabledLanes&=o,s.shellSuspendCounter=0;var k=s.entanglements,I=s.expirationTimes,Z=s.hiddenUpdates;for(o=y&~o;0<o;){var re=31-Mt(o),oe=1<<re;k[re]=0,I[re]=-1;var J=Z[re];if(J!==null)for(Z[re]=null,re=0;re<J.length;re++){var te=J[re];te!==null&&(te.lane&=-536870913)}o&=~oe}c!==0&&Lt(s,c,0),_!==0&&m===0&&s.tag!==0&&(s.suspendedLanes|=_&~(y&~r))}function Lt(s,r,o){s.pendingLanes|=r,s.suspendedLanes&=~r;var c=31-Mt(r);s.entangledLanes|=r,s.entanglements[c]=s.entanglements[c]|1073741824|o&261930}function Vo(s,r){var o=s.entangledLanes|=r;for(s=s.entanglements;o;){var c=31-Mt(o),m=1<<c;m&r|s[c]&r&&(s[c]|=r),o&=~m}}function Zs(s,r){var o=r&-r;return o=(o&42)!==0?1:ji(o),(o&(s.suspendedLanes|r))!==0?0:o}function ji(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function Se(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function ft(){var s=L.p;return s!==0?s:(s=window.event,s===void 0?32:cy(s.type))}function Ke(s,r){var o=L.p;try{return L.p=s,r()}finally{L.p=o}}var Fe=Math.random().toString(36).slice(2),Ee="__reactFiber$"+Fe,Ie="__reactProps$"+Fe,Ft="__reactContainer$"+Fe,Bt="__reactEvents$"+Fe,Qs="__reactListeners$"+Fe,Js="__reactHandles$"+Fe,Tr="__reactResources$"+Fe,As="__reactMarker$"+Fe;function Rr(s){delete s[Ee],delete s[Ie],delete s[Bt],delete s[Qs],delete s[Js]}function ci(s){var r=s[Ee];if(r)return r;for(var o=s.parentNode;o;){if(r=o[Ft]||o[Ee]){if(o=r.alternate,r.child!==null||o!==null&&o.child!==null)for(s=YS(s);s!==null;){if(o=s[Ee])return o;s=YS(s)}return r}s=o,o=s.parentNode}return null}function fs(s){if(s=s[Ee]||s[Ft]){var r=s.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return s}return null}function ui(s){var r=s.tag;if(r===5||r===26||r===27||r===6)return s.stateNode;throw Error(n(33))}function Ei(s){var r=s[Tr];return r||(r=s[Tr]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function be(s){s[As]=!0}var un=new Set,Iu={};function ms(s,r){er(s,r),er(s+"Capture",r)}function er(s,r){for(Iu[s]=r,s=0;s<r.length;s++)un.add(r[s])}var Ar=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]*$"),Qn={},tc={};function qo(s){return dt.call(tc,s)?!0:dt.call(Qn,s)?!1:Ar.test(s)?tc[s]=!0:(Qn[s]=!0,!1)}function $r(s,r,o){if(qo(r))if(o===null)s.removeAttribute(r);else{switch(typeof o){case"undefined":case"function":case"symbol":s.removeAttribute(r);return;case"boolean":var c=r.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){s.removeAttribute(r);return}}s.setAttribute(r,""+o)}}function hn(s,r,o){if(o===null)s.removeAttribute(r);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(r);return}s.setAttribute(r,""+o)}}function tr(s,r,o,c){if(c===null)s.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(o);return}s.setAttributeNS(r,o,""+c)}}function nt(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function ic(s){var r=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Sf(s,r,o){var c=Object.getOwnPropertyDescriptor(s.constructor.prototype,r);if(!s.hasOwnProperty(r)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var m=c.get,_=c.set;return Object.defineProperty(s,r,{configurable:!0,get:function(){return m.call(this)},set:function(y){o=""+y,_.call(this,y)}}),Object.defineProperty(s,r,{enumerable:c.enumerable}),{getValue:function(){return o},setValue:function(y){o=""+y},stopTracking:function(){s._valueTracker=null,delete s[r]}}}}function sc(s){if(!s._valueTracker){var r=ic(s)?"checked":"value";s._valueTracker=Sf(s,r,""+s[r])}}function Uu(s){if(!s)return!1;var r=s._valueTracker;if(!r)return!0;var o=r.getValue(),c="";return s&&(c=ic(s)?s.checked?"true":"false":s.value),s=c,s!==o?(r.setValue(s),!0):!1}function Jn(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var mt=/[\n"\\]/g;function Vi(s){return s.replace(mt,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function jt(s,r,o,c,m,_,y,k){s.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?s.type=y:s.removeAttribute("type"),r!=null?y==="number"?(r===0&&s.value===""||s.value!=r)&&(s.value=""+nt(r)):s.value!==""+nt(r)&&(s.value=""+nt(r)):y!=="submit"&&y!=="reset"||s.removeAttribute("value"),r!=null?ea(s,y,nt(r)):o!=null?ea(s,y,nt(o)):c!=null&&s.removeAttribute("value"),m==null&&_!=null&&(s.defaultChecked=!!_),m!=null&&(s.checked=m&&typeof m!="function"&&typeof m!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?s.name=""+nt(k):s.removeAttribute("name")}function Yo(s,r,o,c,m,_,y,k){if(_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(s.type=_),r!=null||o!=null){if(!(_!=="submit"&&_!=="reset"||r!=null)){sc(s);return}o=o!=null?""+nt(o):"",r=r!=null?""+nt(r):o,k||r===s.value||(s.value=r),s.defaultValue=r}c=c??m,c=typeof c!="function"&&typeof c!="symbol"&&!!c,s.checked=k?s.checked:!!c,s.defaultChecked=!!c,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(s.name=y),sc(s)}function ea(s,r,o){r==="number"&&Jn(s.ownerDocument)===s||s.defaultValue===""+o||(s.defaultValue=""+o)}function dn(s,r,o,c){if(s=s.options,r){r={};for(var m=0;m<o.length;m++)r["$"+o[m]]=!0;for(o=0;o<s.length;o++)m=r.hasOwnProperty("$"+s[o].value),s[o].selected!==m&&(s[o].selected=m),m&&c&&(s[o].defaultSelected=!0)}else{for(o=""+nt(o),r=null,m=0;m<s.length;m++){if(s[m].value===o){s[m].selected=!0,c&&(s[m].defaultSelected=!0);return}r!==null||s[m].disabled||(r=s[m])}r!==null&&(r.selected=!0)}}function Go(s,r,o){if(r!=null&&(r=""+nt(r),r!==s.value&&(s.value=r),o==null)){s.defaultValue!==r&&(s.defaultValue=r);return}s.defaultValue=o!=null?""+nt(o):""}function Ti(s,r,o,c){if(r==null){if(c!=null){if(o!=null)throw Error(n(92));if(P(c)){if(1<c.length)throw Error(n(93));c=c[0]}o=c}o==null&&(o=""),r=o}o=nt(r),s.defaultValue=o,c=s.textContent,c===o&&c!==""&&c!==null&&(s.value=c),sc(s)}function ta(s,r){if(r){var o=s.firstChild;if(o&&o===s.lastChild&&o.nodeType===3){o.nodeValue=r;return}}s.textContent=r}var yf=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 rc(s,r,o){var c=r.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?c?s.setProperty(r,""):r==="float"?s.cssFloat="":s[r]="":c?s.setProperty(r,o):typeof o!="number"||o===0||yf.has(r)?r==="float"?s.cssFloat=o:s[r]=(""+o).trim():s[r]=o+"px"}function nc(s,r,o){if(r!=null&&typeof r!="object")throw Error(n(62));if(s=s.style,o!=null){for(var c in o)!o.hasOwnProperty(c)||r!=null&&r.hasOwnProperty(c)||(c.indexOf("--")===0?s.setProperty(c,""):c==="float"?s.cssFloat="":s[c]="");for(var m in r)c=r[m],r.hasOwnProperty(m)&&o[m]!==c&&rc(s,m,c)}else for(var _ in r)r.hasOwnProperty(_)&&rc(s,_,r[_])}function ac(s){if(s.indexOf("-")===-1)return!1;switch(s){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Fu=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"]]),bf=/^[\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 Mr(s){return bf.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function Ri(){}var ia=null;function Wr(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var rs=null,Ms=null;function ir(s){var r=fs(s);if(r&&(s=r.stateNode)){var o=s[Ie]||null;e:switch(s=r.stateNode,r.type){case"input":if(jt(s,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),r=o.name,o.type==="radio"&&r!=null){for(o=s;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+Vi(""+r)+'"][type="radio"]'),r=0;r<o.length;r++){var c=o[r];if(c!==s&&c.form===s.form){var m=c[Ie]||null;if(!m)throw Error(n(90));jt(c,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(r=0;r<o.length;r++)c=o[r],c.form===s.form&&Uu(c)}break e;case"textarea":Go(s,o.value,o.defaultValue);break e;case"select":r=o.value,r!=null&&dn(s,!!o.multiple,r,!1)}}}var fn=!1;function sr(s,r,o){if(fn)return s(r,o);fn=!0;try{var c=s(r);return c}finally{if(fn=!1,(rs!==null||Ms!==null)&&(Ah(),rs&&(r=rs,s=Ms,Ms=rs=null,ir(r),s)))for(r=0;r<s.length;r++)ir(s[r])}}function Ls(s,r){var o=s.stateNode;if(o===null)return null;var c=o[Ie]||null;if(c===null)return null;o=c[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(s=s.type,c=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!c;break e;default:s=!1}if(s)return null;if(o&&typeof o!="function")throw Error(n(231,r,typeof o));return o}var rr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ko=!1;if(rr)try{var sa={};Object.defineProperty(sa,"passive",{get:function(){Ko=!0}}),window.addEventListener("test",sa,sa),window.removeEventListener("test",sa,sa)}catch{Ko=!1}var Lr=null,Xo=null,Zo=null;function oc(){if(Zo)return Zo;var s,r=Xo,o=r.length,c,m="value"in Lr?Lr.value:Lr.textContent,_=m.length;for(s=0;s<o&&r[s]===m[s];s++);var y=o-s;for(c=1;c<=y&&r[o-c]===m[_-c];c++);return Zo=m.slice(s,1<c?1-c:void 0)}function Xa(s){var r=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&r===13&&(s=13)):s=r,s===10&&(s=13),32<=s||s===13?s:0}function mn(){return!0}function $u(){return!1}function Vt(s){function r(o,c,m,_,y){this._reactName=o,this._targetInst=m,this.type=c,this.nativeEvent=_,this.target=y,this.currentTarget=null;for(var k in s)s.hasOwnProperty(k)&&(o=s[k],this[k]=o?o(_):_[k]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?mn:$u,this.isPropagationStopped=$u,this}return v(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=mn)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=mn)},persist:function(){},isPersistent:mn}),r}var _n={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Za=Vt(_n),Qa=v({},_n,{view:0,detail:0}),wf=Vt(Qa),lc,cc,Ja,Ai=v({},Qa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:el,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==Ja&&(Ja&&s.type==="mousemove"?(lc=s.screenX-Ja.screenX,cc=s.screenY-Ja.screenY):cc=lc=0,Ja=s),lc)},movementY:function(s){return"movementY"in s?s.movementY:cc}}),St=Vt(Ai),Ds=v({},Ai,{dataTransfer:0}),uc=Vt(Ds),Qo=v({},Qa,{relatedTarget:0}),eo=Vt(Qo),to=v({},_n,{animationName:0,elapsedTime:0,pseudoElement:0}),ra=Vt(to),hc=v({},_n,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),dc=Vt(hc),fc=v({},_n,{data:0}),Jo=Vt(fc),Wu={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Cf={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"},xf={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function kf(s){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(s):(s=xf[s])?!!r[s]:!1}function el(){return kf}var Ef=v({},Qa,{key:function(s){if(s.key){var r=Wu[s.key]||s.key;if(r!=="Unidentified")return r}return s.type==="keypress"?(s=Xa(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?Cf[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:el,charCode:function(s){return s.type==="keypress"?Xa(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Xa(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),ju=Vt(Ef),Vu=v({},Ai,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),io=Vt(Vu),tl=v({},Qa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:el}),Tf=Vt(tl),qu=v({},_n,{propertyName:0,elapsedTime:0,pseudoElement:0}),Rf=Vt(qu),Af=v({},Ai,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),Q=Vt(Af),ce=v({},_n,{newState:0,oldState:0}),fe=Vt(ce),me=[9,13,27,32],Me=rr&&"CompositionEvent"in window,Oe=null;rr&&"documentMode"in document&&(Oe=document.documentMode);var Je=rr&&"TextEvent"in window&&!Oe,Xt=rr&&(!Me||Oe&&8<Oe&&11>=Oe),Si=" ",jr=!1;function Dr(s,r){switch(s){case"keyup":return me.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ns(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var as=!1;function pn(s,r){switch(s){case"compositionend":return ns(r);case"keypress":return r.which!==32?null:(jr=!0,Si);case"textInput":return s=r.data,s===Si&&jr?null:s;default:return null}}function Zt(s,r){if(as)return s==="compositionend"||!Me&&Dr(s,r)?(s=oc(),Zo=Xo=Lr=null,as=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Xt&&r.locale!=="ko"?null:r.data;default:return null}}var Dt={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function nr(s){var r=s&&s.nodeName&&s.nodeName.toLowerCase();return r==="input"?!!Dt[s.type]:r==="textarea"}function Vr(s,r,o,c){rs?Ms?Ms.push(c):Ms=[c]:rs=c,r=Ph(r,"onChange"),0<r.length&&(o=new Za("onChange","change",null,o,c),s.push({event:o,listeners:r}))}var ar=null,Ji=null;function $e(s){OS(s,0)}function Or(s){var r=ui(s);if(Uu(r))return s}function Yu(s,r){if(s==="change")return r}var so=!1;if(rr){var ro;if(rr){var na="oninput"in document;if(!na){var gn=document.createElement("div");gn.setAttribute("oninput","return;"),na=typeof gn.oninput=="function"}ro=na}else ro=!1;so=ro&&(!document.documentMode||9<document.documentMode)}function mc(){ar&&(ar.detachEvent("onpropertychange",_c),Ji=ar=null)}function _c(s){if(s.propertyName==="value"&&Or(Ji)){var r=[];Vr(r,Ji,s,Wr(s)),sr($e,r)}}function Gu(s,r,o){s==="focusin"?(mc(),ar=r,Ji=o,ar.attachEvent("onpropertychange",_c)):s==="focusout"&&mc()}function bt(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return Or(Ji)}function _s(s,r){if(s==="click")return Or(r)}function Os(s,r){if(s==="input"||s==="change")return Or(r)}function qr(s,r){return s===r&&(s!==0||1/s===1/r)||s!==s&&r!==r}var yi=typeof Object.is=="function"?Object.is:qr;function aa(s,r){if(yi(s,r))return!0;if(typeof s!="object"||s===null||typeof r!="object"||r===null)return!1;var o=Object.keys(s),c=Object.keys(r);if(o.length!==c.length)return!1;for(c=0;c<o.length;c++){var m=o[c];if(!dt.call(r,m)||!yi(s[m],r[m]))return!1}return!0}function no(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function ao(s,r){var o=no(s);s=0;for(var c;o;){if(o.nodeType===3){if(c=s+o.textContent.length,s<=r&&c>=r)return{node:o,offset:r-s};s=c}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=no(o)}}function nv(s,r){return s&&r?s===r?!0:s&&s.nodeType===3?!1:r&&r.nodeType===3?nv(s,r.parentNode):"contains"in s?s.contains(r):s.compareDocumentPosition?!!(s.compareDocumentPosition(r)&16):!1:!1}function av(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var r=Jn(s.document);r instanceof s.HTMLIFrameElement;){try{var o=typeof r.contentWindow.location.href=="string"}catch{o=!1}if(o)s=r.contentWindow;else break;r=Jn(s.document)}return r}function Mf(s){var r=s&&s.nodeName&&s.nodeName.toLowerCase();return r&&(r==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||r==="textarea"||s.contentEditable==="true")}var jx=rr&&"documentMode"in document&&11>=document.documentMode,il=null,Lf=null,pc=null,Df=!1;function ov(s,r,o){var c=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Df||il==null||il!==Jn(c)||(c=il,"selectionStart"in c&&Mf(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),pc&&aa(pc,c)||(pc=c,c=Ph(Lf,"onSelect"),0<c.length&&(r=new Za("onSelect","select",null,r,o),s.push({event:r,listeners:c}),r.target=il)))}function oo(s,r){var o={};return o[s.toLowerCase()]=r.toLowerCase(),o["Webkit"+s]="webkit"+r,o["Moz"+s]="moz"+r,o}var sl={animationend:oo("Animation","AnimationEnd"),animationiteration:oo("Animation","AnimationIteration"),animationstart:oo("Animation","AnimationStart"),transitionrun:oo("Transition","TransitionRun"),transitionstart:oo("Transition","TransitionStart"),transitioncancel:oo("Transition","TransitionCancel"),transitionend:oo("Transition","TransitionEnd")},Of={},lv={};rr&&(lv=document.createElement("div").style,"AnimationEvent"in window||(delete sl.animationend.animation,delete sl.animationiteration.animation,delete sl.animationstart.animation),"TransitionEvent"in window||delete sl.transitionend.transition);function lo(s){if(Of[s])return Of[s];if(!sl[s])return s;var r=sl[s],o;for(o in r)if(r.hasOwnProperty(o)&&o in lv)return Of[s]=r[o];return s}var cv=lo("animationend"),uv=lo("animationiteration"),hv=lo("animationstart"),Vx=lo("transitionrun"),qx=lo("transitionstart"),Yx=lo("transitioncancel"),dv=lo("transitionend"),fv=new Map,Bf="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(" ");Bf.push("scrollEnd");function Br(s,r){fv.set(s,r),ms(r,[s])}var Ku=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},or=[],rl=0,Nf=0;function Xu(){for(var s=rl,r=Nf=rl=0;r<s;){var o=or[r];or[r++]=null;var c=or[r];or[r++]=null;var m=or[r];or[r++]=null;var _=or[r];if(or[r++]=null,c!==null&&m!==null){var y=c.pending;y===null?m.next=m:(m.next=y.next,y.next=m),c.pending=m}_!==0&&mv(o,m,_)}}function Zu(s,r,o,c){or[rl++]=s,or[rl++]=r,or[rl++]=o,or[rl++]=c,Nf|=c,s.lanes|=c,s=s.alternate,s!==null&&(s.lanes|=c)}function Pf(s,r,o,c){return Zu(s,r,o,c),Qu(s)}function co(s,r){return Zu(s,null,null,r),Qu(s)}function mv(s,r,o){s.lanes|=o;var c=s.alternate;c!==null&&(c.lanes|=o);for(var m=!1,_=s.return;_!==null;)_.childLanes|=o,c=_.alternate,c!==null&&(c.childLanes|=o),_.tag===22&&(s=_.stateNode,s===null||s._visibility&1||(m=!0)),s=_,_=_.return;return s.tag===3?(_=s.stateNode,m&&r!==null&&(m=31-Mt(o),s=_.hiddenUpdates,c=s[m],c===null?s[m]=[r]:c.push(r),r.lane=o|536870912),_):null}function Qu(s){if(50<Hc)throw Hc=0,Vm=null,Error(n(185));for(var r=s.return;r!==null;)s=r,r=s.return;return s.tag===3?s.stateNode:null}var nl={};function Gx(s,r,o,c){this.tag=s,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bs(s,r,o,c){return new Gx(s,r,o,c)}function zf(s){return s=s.prototype,!(!s||!s.isReactComponent)}function vn(s,r){var o=s.alternate;return o===null?(o=Bs(s.tag,r,s.key,s.mode),o.elementType=s.elementType,o.type=s.type,o.stateNode=s.stateNode,o.alternate=s,s.alternate=o):(o.pendingProps=r,o.type=s.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=s.flags&65011712,o.childLanes=s.childLanes,o.lanes=s.lanes,o.child=s.child,o.memoizedProps=s.memoizedProps,o.memoizedState=s.memoizedState,o.updateQueue=s.updateQueue,r=s.dependencies,o.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},o.sibling=s.sibling,o.index=s.index,o.ref=s.ref,o.refCleanup=s.refCleanup,o}function _v(s,r){s.flags&=65011714;var o=s.alternate;return o===null?(s.childLanes=0,s.lanes=r,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,r=o.dependencies,s.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),s}function Ju(s,r,o,c,m,_){var y=0;if(c=s,typeof s=="function")zf(s)&&(y=1);else if(typeof s=="string")y=J5(s,o,ae.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case V:return s=Bs(31,o,r,m),s.elementType=V,s.lanes=_,s;case C:return uo(o.children,m,_,r);case x:y=8,m|=24;break;case E:return s=Bs(12,o,r,m|2),s.elementType=E,s.lanes=_,s;case $:return s=Bs(13,o,r,m),s.elementType=$,s.lanes=_,s;case F:return s=Bs(19,o,r,m),s.elementType=F,s.lanes=_,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case B:y=10;break e;case A:y=9;break e;case R:y=11;break e;case U:y=14;break e;case z:y=16,c=null;break e}y=29,o=Error(n(130,s===null?"null":typeof s,"")),c=null}return r=Bs(y,o,r,m),r.elementType=s,r.type=c,r.lanes=_,r}function uo(s,r,o,c){return s=Bs(7,s,c,r),s.lanes=o,s}function Hf(s,r,o){return s=Bs(6,s,null,r),s.lanes=o,s}function pv(s){var r=Bs(18,null,null,0);return r.stateNode=s,r}function If(s,r,o){return r=Bs(4,s.children!==null?s.children:[],s.key,r),r.lanes=o,r.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},r}var gv=new WeakMap;function lr(s,r){if(typeof s=="object"&&s!==null){var o=gv.get(s);return o!==void 0?o:(r={value:s,source:r,stack:yt(r)},gv.set(s,r),r)}return{value:s,source:r,stack:yt(r)}}var al=[],ol=0,eh=null,gc=0,cr=[],ur=0,oa=null,Yr=1,Gr="";function Sn(s,r){al[ol++]=gc,al[ol++]=eh,eh=s,gc=r}function vv(s,r,o){cr[ur++]=Yr,cr[ur++]=Gr,cr[ur++]=oa,oa=s;var c=Yr;s=Gr;var m=32-Mt(c)-1;c&=~(1<<m),o+=1;var _=32-Mt(r)+m;if(30<_){var y=m-m%5;_=(c&(1<<y)-1).toString(32),c>>=y,m-=y,Yr=1<<32-Mt(r)+m|o<<m|c,Gr=_+s}else Yr=1<<_|o<<m|c,Gr=s}function Uf(s){s.return!==null&&(Sn(s,1),vv(s,1,0))}function Ff(s){for(;s===eh;)eh=al[--ol],al[ol]=null,gc=al[--ol],al[ol]=null;for(;s===oa;)oa=cr[--ur],cr[ur]=null,Gr=cr[--ur],cr[ur]=null,Yr=cr[--ur],cr[ur]=null}function Sv(s,r){cr[ur++]=Yr,cr[ur++]=Gr,cr[ur++]=oa,Yr=r.id,Gr=r.overflow,oa=s}var qi=null,Nt=null,ht=!1,la=null,hr=!1,$f=Error(n(519));function ca(s){var r=Error(n(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw vc(lr(r,s)),$f}function yv(s){var r=s.stateNode,o=s.type,c=s.memoizedProps;switch(r[Ee]=s,r[Ie]=c,o){case"dialog":lt("cancel",r),lt("close",r);break;case"iframe":case"object":case"embed":lt("load",r);break;case"video":case"audio":for(o=0;o<Uc.length;o++)lt(Uc[o],r);break;case"source":lt("error",r);break;case"img":case"image":case"link":lt("error",r),lt("load",r);break;case"details":lt("toggle",r);break;case"input":lt("invalid",r),Yo(r,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":lt("invalid",r);break;case"textarea":lt("invalid",r),Ti(r,c.value,c.defaultValue,c.children)}o=c.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||r.textContent===""+o||c.suppressHydrationWarning===!0||zS(r.textContent,o)?(c.popover!=null&&(lt("beforetoggle",r),lt("toggle",r)),c.onScroll!=null&<("scroll",r),c.onScrollEnd!=null&<("scrollend",r),c.onClick!=null&&(r.onclick=Ri),r=!0):r=!1,r||ca(s,!0)}function bv(s){for(qi=s.return;qi;)switch(qi.tag){case 5:case 31:case 13:hr=!1;return;case 27:case 3:hr=!0;return;default:qi=qi.return}}function ll(s){if(s!==qi)return!1;if(!ht)return bv(s),ht=!0,!1;var r=s.tag,o;if((o=r!==3&&r!==27)&&((o=r===5)&&(o=s.type,o=!(o!=="form"&&o!=="button")||a_(s.type,s.memoizedProps)),o=!o),o&&Nt&&ca(s),bv(s),r===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(n(317));Nt=qS(s)}else if(r===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(n(317));Nt=qS(s)}else r===27?(r=Nt,Ca(s.type)?(s=h_,h_=null,Nt=s):Nt=r):Nt=qi?fr(s.stateNode.nextSibling):null;return!0}function ho(){Nt=qi=null,ht=!1}function Wf(){var s=la;return s!==null&&(Ss===null?Ss=s:Ss.push.apply(Ss,s),la=null),s}function vc(s){la===null?la=[s]:la.push(s)}var jf=D(null),fo=null,yn=null;function ua(s,r,o){ie(jf,r._currentValue),r._currentValue=o}function bn(s){s._currentValue=jf.current,G(jf)}function Vf(s,r,o){for(;s!==null;){var c=s.alternate;if((s.childLanes&r)!==r?(s.childLanes|=r,c!==null&&(c.childLanes|=r)):c!==null&&(c.childLanes&r)!==r&&(c.childLanes|=r),s===o)break;s=s.return}}function qf(s,r,o,c){var m=s.child;for(m!==null&&(m.return=s);m!==null;){var _=m.dependencies;if(_!==null){var y=m.child;_=_.firstContext;e:for(;_!==null;){var k=_;_=m;for(var I=0;I<r.length;I++)if(k.context===r[I]){_.lanes|=o,k=_.alternate,k!==null&&(k.lanes|=o),Vf(_.return,o,s),c||(y=null);break e}_=k.next}}else if(m.tag===18){if(y=m.return,y===null)throw Error(n(341));y.lanes|=o,_=y.alternate,_!==null&&(_.lanes|=o),Vf(y,o,s),y=null}else y=m.child;if(y!==null)y.return=m;else for(y=m;y!==null;){if(y===s){y=null;break}if(m=y.sibling,m!==null){m.return=y.return,y=m;break}y=y.return}m=y}}function cl(s,r,o,c){s=null;for(var m=r,_=!1;m!==null;){if(!_){if((m.flags&524288)!==0)_=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var y=m.alternate;if(y===null)throw Error(n(387));if(y=y.memoizedProps,y!==null){var k=m.type;yi(m.pendingProps.value,y.value)||(s!==null?s.push(k):s=[k])}}else if(m===he.current){if(y=m.alternate,y===null)throw Error(n(387));y.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(s!==null?s.push(Vc):s=[Vc])}m=m.return}s!==null&&qf(r,s,o,c),r.flags|=262144}function th(s){for(s=s.firstContext;s!==null;){if(!yi(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function mo(s){fo=s,yn=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function Yi(s){return wv(fo,s)}function ih(s,r){return fo===null&&mo(s),wv(s,r)}function wv(s,r){var o=r._currentValue;if(r={context:r,memoizedValue:o,next:null},yn===null){if(s===null)throw Error(n(308));yn=r,s.dependencies={lanes:0,firstContext:r},s.flags|=524288}else yn=yn.next=r;return o}var Kx=typeof AbortController<"u"?AbortController:function(){var s=[],r=this.signal={aborted:!1,addEventListener:function(o,c){s.push(c)}};this.abort=function(){r.aborted=!0,s.forEach(function(o){return o()})}},Xx=t.unstable_scheduleCallback,Zx=t.unstable_NormalPriority,hi={$$typeof:B,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Yf(){return{controller:new Kx,data:new Map,refCount:0}}function Sc(s){s.refCount--,s.refCount===0&&Xx(Zx,function(){s.controller.abort()})}var yc=null,Gf=0,ul=0,hl=null;function Qx(s,r){if(yc===null){var o=yc=[];Gf=0,ul=Zm(),hl={status:"pending",value:void 0,then:function(c){o.push(c)}}}return Gf++,r.then(Cv,Cv),r}function Cv(){if(--Gf===0&&yc!==null){hl!==null&&(hl.status="fulfilled");var s=yc;yc=null,ul=0,hl=null;for(var r=0;r<s.length;r++)(0,s[r])()}}function Jx(s,r){var o=[],c={status:"pending",value:null,reason:null,then:function(m){o.push(m)}};return s.then(function(){c.status="fulfilled",c.value=r;for(var m=0;m<o.length;m++)(0,o[m])(r)},function(m){for(c.status="rejected",c.reason=m,m=0;m<o.length;m++)(0,o[m])(void 0)}),c}var xv=T.S;T.S=function(s,r){oS=Qe(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&Qx(s,r),xv!==null&&xv(s,r)};var _o=D(null);function Kf(){var s=_o.current;return s!==null?s:Ot.pooledCache}function sh(s,r){r===null?ie(_o,_o.current):ie(_o,r.pool)}function kv(){var s=Kf();return s===null?null:{parent:hi._currentValue,pool:s}}var dl=Error(n(460)),Xf=Error(n(474)),rh=Error(n(542)),nh={then:function(){}};function Ev(s){return s=s.status,s==="fulfilled"||s==="rejected"}function Tv(s,r,o){switch(o=s[o],o===void 0?s.push(r):o!==r&&(r.then(Ri,Ri),r=o),r.status){case"fulfilled":return r.value;case"rejected":throw s=r.reason,Av(s),s;default:if(typeof r.status=="string")r.then(Ri,Ri);else{if(s=Ot,s!==null&&100<s.shellSuspendCounter)throw Error(n(482));s=r,s.status="pending",s.then(function(c){if(r.status==="pending"){var m=r;m.status="fulfilled",m.value=c}},function(c){if(r.status==="pending"){var m=r;m.status="rejected",m.reason=c}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw s=r.reason,Av(s),s}throw go=r,dl}}function po(s){try{var r=s._init;return r(s._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(go=o,dl):o}}var go=null;function Rv(){if(go===null)throw Error(n(459));var s=go;return go=null,s}function Av(s){if(s===dl||s===rh)throw Error(n(483))}var fl=null,bc=0;function ah(s){var r=bc;return bc+=1,fl===null&&(fl=[]),Tv(fl,s,r)}function wc(s,r){r=r.props.ref,s.ref=r!==void 0?r:null}function oh(s,r){throw r.$$typeof===g?Error(n(525)):(s=Object.prototype.toString.call(r),Error(n(31,s==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":s)))}function Mv(s){function r(q,W){if(s){var K=q.deletions;K===null?(q.deletions=[W],q.flags|=16):K.push(W)}}function o(q,W){if(!s)return null;for(;W!==null;)r(q,W),W=W.sibling;return null}function c(q){for(var W=new Map;q!==null;)q.key!==null?W.set(q.key,q):W.set(q.index,q),q=q.sibling;return W}function m(q,W){return q=vn(q,W),q.index=0,q.sibling=null,q}function _(q,W,K){return q.index=K,s?(K=q.alternate,K!==null?(K=K.index,K<W?(q.flags|=67108866,W):K):(q.flags|=67108866,W)):(q.flags|=1048576,W)}function y(q){return s&&q.alternate===null&&(q.flags|=67108866),q}function k(q,W,K,ne){return W===null||W.tag!==6?(W=Hf(K,q.mode,ne),W.return=q,W):(W=m(W,K),W.return=q,W)}function I(q,W,K,ne){var He=K.type;return He===C?re(q,W,K.props.children,ne,K.key):W!==null&&(W.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===z&&po(He)===W.type)?(W=m(W,K.props),wc(W,K),W.return=q,W):(W=Ju(K.type,K.key,K.props,null,q.mode,ne),wc(W,K),W.return=q,W)}function Z(q,W,K,ne){return W===null||W.tag!==4||W.stateNode.containerInfo!==K.containerInfo||W.stateNode.implementation!==K.implementation?(W=If(K,q.mode,ne),W.return=q,W):(W=m(W,K.children||[]),W.return=q,W)}function re(q,W,K,ne,He){return W===null||W.tag!==7?(W=uo(K,q.mode,ne,He),W.return=q,W):(W=m(W,K),W.return=q,W)}function oe(q,W,K){if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return W=Hf(""+W,q.mode,K),W.return=q,W;if(typeof W=="object"&&W!==null){switch(W.$$typeof){case S:return K=Ju(W.type,W.key,W.props,null,q.mode,K),wc(K,W),K.return=q,K;case b:return W=If(W,q.mode,K),W.return=q,W;case z:return W=po(W),oe(q,W,K)}if(P(W)||M(W))return W=uo(W,q.mode,K,null),W.return=q,W;if(typeof W.then=="function")return oe(q,ah(W),K);if(W.$$typeof===B)return oe(q,ih(q,W),K);oh(q,W)}return null}function J(q,W,K,ne){var He=W!==null?W.key:null;if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return He!==null?null:k(q,W,""+K,ne);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case S:return K.key===He?I(q,W,K,ne):null;case b:return K.key===He?Z(q,W,K,ne):null;case z:return K=po(K),J(q,W,K,ne)}if(P(K)||M(K))return He!==null?null:re(q,W,K,ne,null);if(typeof K.then=="function")return J(q,W,ah(K),ne);if(K.$$typeof===B)return J(q,W,ih(q,K),ne);oh(q,K)}return null}function te(q,W,K,ne,He){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return q=q.get(K)||null,k(W,q,""+ne,He);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case S:return q=q.get(ne.key===null?K:ne.key)||null,I(W,q,ne,He);case b:return q=q.get(ne.key===null?K:ne.key)||null,Z(W,q,ne,He);case z:return ne=po(ne),te(q,W,K,ne,He)}if(P(ne)||M(ne))return q=q.get(K)||null,re(W,q,ne,He,null);if(typeof ne.then=="function")return te(q,W,K,ah(ne),He);if(ne.$$typeof===B)return te(q,W,K,ih(W,ne),He);oh(W,ne)}return null}function ke(q,W,K,ne){for(var He=null,pt=null,Le=W,et=W=0,ut=null;Le!==null&&et<K.length;et++){Le.index>et?(ut=Le,Le=null):ut=Le.sibling;var gt=J(q,Le,K[et],ne);if(gt===null){Le===null&&(Le=ut);break}s&&Le&>.alternate===null&&r(q,Le),W=_(gt,W,et),pt===null?He=gt:pt.sibling=gt,pt=gt,Le=ut}if(et===K.length)return o(q,Le),ht&&Sn(q,et),He;if(Le===null){for(;et<K.length;et++)Le=oe(q,K[et],ne),Le!==null&&(W=_(Le,W,et),pt===null?He=Le:pt.sibling=Le,pt=Le);return ht&&Sn(q,et),He}for(Le=c(Le);et<K.length;et++)ut=te(Le,q,et,K[et],ne),ut!==null&&(s&&ut.alternate!==null&&Le.delete(ut.key===null?et:ut.key),W=_(ut,W,et),pt===null?He=ut:pt.sibling=ut,pt=ut);return s&&Le.forEach(function(Ra){return r(q,Ra)}),ht&&Sn(q,et),He}function Ue(q,W,K,ne){if(K==null)throw Error(n(151));for(var He=null,pt=null,Le=W,et=W=0,ut=null,gt=K.next();Le!==null&&!gt.done;et++,gt=K.next()){Le.index>et?(ut=Le,Le=null):ut=Le.sibling;var Ra=J(q,Le,gt.value,ne);if(Ra===null){Le===null&&(Le=ut);break}s&&Le&&Ra.alternate===null&&r(q,Le),W=_(Ra,W,et),pt===null?He=Ra:pt.sibling=Ra,pt=Ra,Le=ut}if(gt.done)return o(q,Le),ht&&Sn(q,et),He;if(Le===null){for(;!gt.done;et++,gt=K.next())gt=oe(q,gt.value,ne),gt!==null&&(W=_(gt,W,et),pt===null?He=gt:pt.sibling=gt,pt=gt);return ht&&Sn(q,et),He}for(Le=c(Le);!gt.done;et++,gt=K.next())gt=te(Le,q,et,gt.value,ne),gt!==null&&(s&>.alternate!==null&&Le.delete(gt.key===null?et:gt.key),W=_(gt,W,et),pt===null?He=gt:pt.sibling=gt,pt=gt);return s&&Le.forEach(function(u2){return r(q,u2)}),ht&&Sn(q,et),He}function Rt(q,W,K,ne){if(typeof K=="object"&&K!==null&&K.type===C&&K.key===null&&(K=K.props.children),typeof K=="object"&&K!==null){switch(K.$$typeof){case S:e:{for(var He=K.key;W!==null;){if(W.key===He){if(He=K.type,He===C){if(W.tag===7){o(q,W.sibling),ne=m(W,K.props.children),ne.return=q,q=ne;break e}}else if(W.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===z&&po(He)===W.type){o(q,W.sibling),ne=m(W,K.props),wc(ne,K),ne.return=q,q=ne;break e}o(q,W);break}else r(q,W);W=W.sibling}K.type===C?(ne=uo(K.props.children,q.mode,ne,K.key),ne.return=q,q=ne):(ne=Ju(K.type,K.key,K.props,null,q.mode,ne),wc(ne,K),ne.return=q,q=ne)}return y(q);case b:e:{for(He=K.key;W!==null;){if(W.key===He)if(W.tag===4&&W.stateNode.containerInfo===K.containerInfo&&W.stateNode.implementation===K.implementation){o(q,W.sibling),ne=m(W,K.children||[]),ne.return=q,q=ne;break e}else{o(q,W);break}else r(q,W);W=W.sibling}ne=If(K,q.mode,ne),ne.return=q,q=ne}return y(q);case z:return K=po(K),Rt(q,W,K,ne)}if(P(K))return ke(q,W,K,ne);if(M(K)){if(He=M(K),typeof He!="function")throw Error(n(150));return K=He.call(K),Ue(q,W,K,ne)}if(typeof K.then=="function")return Rt(q,W,ah(K),ne);if(K.$$typeof===B)return Rt(q,W,ih(q,K),ne);oh(q,K)}return typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint"?(K=""+K,W!==null&&W.tag===6?(o(q,W.sibling),ne=m(W,K),ne.return=q,q=ne):(o(q,W),ne=Hf(K,q.mode,ne),ne.return=q,q=ne),y(q)):o(q,W)}return function(q,W,K,ne){try{bc=0;var He=Rt(q,W,K,ne);return fl=null,He}catch(Le){if(Le===dl||Le===rh)throw Le;var pt=Bs(29,Le,null,q.mode);return pt.lanes=ne,pt.return=q,pt}}}var vo=Mv(!0),Lv=Mv(!1),ha=!1;function Zf(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Qf(s,r){s=s.updateQueue,r.updateQueue===s&&(r.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function da(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function fa(s,r,o){var c=s.updateQueue;if(c===null)return null;if(c=c.shared,(vt&2)!==0){var m=c.pending;return m===null?r.next=r:(r.next=m.next,m.next=r),c.pending=r,r=Qu(s),mv(s,null,o),r}return Zu(s,c,r,o),Qu(s)}function Cc(s,r,o){if(r=r.updateQueue,r!==null&&(r=r.shared,(o&4194048)!==0)){var c=r.lanes;c&=s.pendingLanes,o|=c,r.lanes=o,Vo(s,o)}}function Jf(s,r){var o=s.updateQueue,c=s.alternate;if(c!==null&&(c=c.updateQueue,o===c)){var m=null,_=null;if(o=o.firstBaseUpdate,o!==null){do{var y={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};_===null?m=_=y:_=_.next=y,o=o.next}while(o!==null);_===null?m=_=r:_=_.next=r}else m=_=r;o={baseState:c.baseState,firstBaseUpdate:m,lastBaseUpdate:_,shared:c.shared,callbacks:c.callbacks},s.updateQueue=o;return}s=o.lastBaseUpdate,s===null?o.firstBaseUpdate=r:s.next=r,o.lastBaseUpdate=r}var em=!1;function xc(){if(em){var s=hl;if(s!==null)throw s}}function kc(s,r,o,c){em=!1;var m=s.updateQueue;ha=!1;var _=m.firstBaseUpdate,y=m.lastBaseUpdate,k=m.shared.pending;if(k!==null){m.shared.pending=null;var I=k,Z=I.next;I.next=null,y===null?_=Z:y.next=Z,y=I;var re=s.alternate;re!==null&&(re=re.updateQueue,k=re.lastBaseUpdate,k!==y&&(k===null?re.firstBaseUpdate=Z:k.next=Z,re.lastBaseUpdate=I))}if(_!==null){var oe=m.baseState;y=0,re=Z=I=null,k=_;do{var J=k.lane&-536870913,te=J!==k.lane;if(te?(ct&J)===J:(c&J)===J){J!==0&&J===ul&&(em=!0),re!==null&&(re=re.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var ke=s,Ue=k;J=r;var Rt=o;switch(Ue.tag){case 1:if(ke=Ue.payload,typeof ke=="function"){oe=ke.call(Rt,oe,J);break e}oe=ke;break e;case 3:ke.flags=ke.flags&-65537|128;case 0:if(ke=Ue.payload,J=typeof ke=="function"?ke.call(Rt,oe,J):ke,J==null)break e;oe=v({},oe,J);break e;case 2:ha=!0}}J=k.callback,J!==null&&(s.flags|=64,te&&(s.flags|=8192),te=m.callbacks,te===null?m.callbacks=[J]:te.push(J))}else te={lane:J,tag:k.tag,payload:k.payload,callback:k.callback,next:null},re===null?(Z=re=te,I=oe):re=re.next=te,y|=J;if(k=k.next,k===null){if(k=m.shared.pending,k===null)break;te=k,k=te.next,te.next=null,m.lastBaseUpdate=te,m.shared.pending=null}}while(!0);re===null&&(I=oe),m.baseState=I,m.firstBaseUpdate=Z,m.lastBaseUpdate=re,_===null&&(m.shared.lanes=0),va|=y,s.lanes=y,s.memoizedState=oe}}function Dv(s,r){if(typeof s!="function")throw Error(n(191,s));s.call(r)}function Ov(s,r){var o=s.callbacks;if(o!==null)for(s.callbacks=null,s=0;s<o.length;s++)Dv(o[s],r)}var ml=D(null),lh=D(0);function Bv(s,r){s=Mn,ie(lh,s),ie(ml,r),Mn=s|r.baseLanes}function tm(){ie(lh,Mn),ie(ml,ml.current)}function im(){Mn=lh.current,G(ml),G(lh)}var Ns=D(null),dr=null;function ma(s){var r=s.alternate;ie(ai,ai.current&1),ie(Ns,s),dr===null&&(r===null||ml.current!==null||r.memoizedState!==null)&&(dr=s)}function sm(s){ie(ai,ai.current),ie(Ns,s),dr===null&&(dr=s)}function Nv(s){s.tag===22?(ie(ai,ai.current),ie(Ns,s),dr===null&&(dr=s)):_a()}function _a(){ie(ai,ai.current),ie(Ns,Ns.current)}function Ps(s){G(Ns),dr===s&&(dr=null),G(ai)}var ai=D(0);function ch(s){for(var r=s;r!==null;){if(r.tag===13){var o=r.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||c_(o)||u_(o)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===s)break;for(;r.sibling===null;){if(r.return===null||r.return===s)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var wn=0,Xe=null,Et=null,di=null,uh=!1,_l=!1,So=!1,hh=0,Ec=0,pl=null,e5=0;function Qt(){throw Error(n(321))}function rm(s,r){if(r===null)return!1;for(var o=0;o<r.length&&o<s.length;o++)if(!yi(s[o],r[o]))return!1;return!0}function nm(s,r,o,c,m,_){return wn=_,Xe=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,T.H=s===null||s.memoizedState===null?v0:ym,So=!1,_=o(c,m),So=!1,_l&&(_=zv(r,o,c,m)),Pv(s),_}function Pv(s){T.H=Ac;var r=Et!==null&&Et.next!==null;if(wn=0,di=Et=Xe=null,uh=!1,Ec=0,pl=null,r)throw Error(n(300));s===null||fi||(s=s.dependencies,s!==null&&th(s)&&(fi=!0))}function zv(s,r,o,c){Xe=s;var m=0;do{if(_l&&(pl=null),Ec=0,_l=!1,25<=m)throw Error(n(301));if(m+=1,di=Et=null,s.updateQueue!=null){var _=s.updateQueue;_.lastEffect=null,_.events=null,_.stores=null,_.memoCache!=null&&(_.memoCache.index=0)}T.H=S0,_=r(o,c)}while(_l);return _}function t5(){var s=T.H,r=s.useState()[0];return r=typeof r.then=="function"?Tc(r):r,s=s.useState()[0],(Et!==null?Et.memoizedState:null)!==s&&(Xe.flags|=1024),r}function am(){var s=hh!==0;return hh=0,s}function om(s,r,o){r.updateQueue=s.updateQueue,r.flags&=-2053,s.lanes&=~o}function lm(s){if(uh){for(s=s.memoizedState;s!==null;){var r=s.queue;r!==null&&(r.pending=null),s=s.next}uh=!1}wn=0,di=Et=Xe=null,_l=!1,Ec=hh=0,pl=null}function os(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return di===null?Xe.memoizedState=di=s:di=di.next=s,di}function oi(){if(Et===null){var s=Xe.alternate;s=s!==null?s.memoizedState:null}else s=Et.next;var r=di===null?Xe.memoizedState:di.next;if(r!==null)di=r,Et=s;else{if(s===null)throw Xe.alternate===null?Error(n(467)):Error(n(310));Et=s,s={memoizedState:Et.memoizedState,baseState:Et.baseState,baseQueue:Et.baseQueue,queue:Et.queue,next:null},di===null?Xe.memoizedState=di=s:di=di.next=s}return di}function dh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Tc(s){var r=Ec;return Ec+=1,pl===null&&(pl=[]),s=Tv(pl,s,r),r=Xe,(di===null?r.memoizedState:di.next)===null&&(r=r.alternate,T.H=r===null||r.memoizedState===null?v0:ym),s}function fh(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return Tc(s);if(s.$$typeof===B)return Yi(s)}throw Error(n(438,String(s)))}function cm(s){var r=null,o=Xe.updateQueue;if(o!==null&&(r=o.memoCache),r==null){var c=Xe.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(r={data:c.data.map(function(m){return m.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),o===null&&(o=dh(),Xe.updateQueue=o),o.memoCache=r,o=r.data[r.index],o===void 0)for(o=r.data[r.index]=Array(s),c=0;c<s;c++)o[c]=se;return r.index++,o}function Cn(s,r){return typeof r=="function"?r(s):r}function mh(s){var r=oi();return um(r,Et,s)}function um(s,r,o){var c=s.queue;if(c===null)throw Error(n(311));c.lastRenderedReducer=o;var m=s.baseQueue,_=c.pending;if(_!==null){if(m!==null){var y=m.next;m.next=_.next,_.next=y}r.baseQueue=m=_,c.pending=null}if(_=s.baseState,m===null)s.memoizedState=_;else{r=m.next;var k=y=null,I=null,Z=r,re=!1;do{var oe=Z.lane&-536870913;if(oe!==Z.lane?(ct&oe)===oe:(wn&oe)===oe){var J=Z.revertLane;if(J===0)I!==null&&(I=I.next={lane:0,revertLane:0,gesture:null,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null}),oe===ul&&(re=!0);else if((wn&J)===J){Z=Z.next,J===ul&&(re=!0);continue}else oe={lane:0,revertLane:Z.revertLane,gesture:null,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null},I===null?(k=I=oe,y=_):I=I.next=oe,Xe.lanes|=J,va|=J;oe=Z.action,So&&o(_,oe),_=Z.hasEagerState?Z.eagerState:o(_,oe)}else J={lane:oe,revertLane:Z.revertLane,gesture:Z.gesture,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null},I===null?(k=I=J,y=_):I=I.next=J,Xe.lanes|=oe,va|=oe;Z=Z.next}while(Z!==null&&Z!==r);if(I===null?y=_:I.next=k,!yi(_,s.memoizedState)&&(fi=!0,re&&(o=hl,o!==null)))throw o;s.memoizedState=_,s.baseState=y,s.baseQueue=I,c.lastRenderedState=_}return m===null&&(c.lanes=0),[s.memoizedState,c.dispatch]}function hm(s){var r=oi(),o=r.queue;if(o===null)throw Error(n(311));o.lastRenderedReducer=s;var c=o.dispatch,m=o.pending,_=r.memoizedState;if(m!==null){o.pending=null;var y=m=m.next;do _=s(_,y.action),y=y.next;while(y!==m);yi(_,r.memoizedState)||(fi=!0),r.memoizedState=_,r.baseQueue===null&&(r.baseState=_),o.lastRenderedState=_}return[_,c]}function Hv(s,r,o){var c=Xe,m=oi(),_=ht;if(_){if(o===void 0)throw Error(n(407));o=o()}else o=r();var y=!yi((Et||m).memoizedState,o);if(y&&(m.memoizedState=o,fi=!0),m=m.queue,mm(Fv.bind(null,c,m,s),[s]),m.getSnapshot!==r||y||di!==null&&di.memoizedState.tag&1){if(c.flags|=2048,gl(9,{destroy:void 0},Uv.bind(null,c,m,o,r),null),Ot===null)throw Error(n(349));_||(wn&127)!==0||Iv(c,r,o)}return o}function Iv(s,r,o){s.flags|=16384,s={getSnapshot:r,value:o},r=Xe.updateQueue,r===null?(r=dh(),Xe.updateQueue=r,r.stores=[s]):(o=r.stores,o===null?r.stores=[s]:o.push(s))}function Uv(s,r,o,c){r.value=o,r.getSnapshot=c,$v(r)&&Wv(s)}function Fv(s,r,o){return o(function(){$v(r)&&Wv(s)})}function $v(s){var r=s.getSnapshot;s=s.value;try{var o=r();return!yi(s,o)}catch{return!0}}function Wv(s){var r=co(s,2);r!==null&&ys(r,s,2)}function dm(s){var r=os();if(typeof s=="function"){var o=s;if(s=o(),So){$i(!0);try{o()}finally{$i(!1)}}}return r.memoizedState=r.baseState=s,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cn,lastRenderedState:s},r}function jv(s,r,o,c){return s.baseState=o,um(s,Et,typeof c=="function"?c:Cn)}function i5(s,r,o,c,m){if(gh(s))throw Error(n(485));if(s=r.action,s!==null){var _={payload:m,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(y){_.listeners.push(y)}};T.T!==null?o(!0):_.isTransition=!1,c(_),o=r.pending,o===null?(_.next=r.pending=_,Vv(r,_)):(_.next=o.next,r.pending=o.next=_)}}function Vv(s,r){var o=r.action,c=r.payload,m=s.state;if(r.isTransition){var _=T.T,y={};T.T=y;try{var k=o(m,c),I=T.S;I!==null&&I(y,k),qv(s,r,k)}catch(Z){fm(s,r,Z)}finally{_!==null&&y.types!==null&&(_.types=y.types),T.T=_}}else try{_=o(m,c),qv(s,r,_)}catch(Z){fm(s,r,Z)}}function qv(s,r,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(c){Yv(s,r,c)},function(c){return fm(s,r,c)}):Yv(s,r,o)}function Yv(s,r,o){r.status="fulfilled",r.value=o,Gv(r),s.state=o,r=s.pending,r!==null&&(o=r.next,o===r?s.pending=null:(o=o.next,r.next=o,Vv(s,o)))}function fm(s,r,o){var c=s.pending;if(s.pending=null,c!==null){c=c.next;do r.status="rejected",r.reason=o,Gv(r),r=r.next;while(r!==c)}s.action=null}function Gv(s){s=s.listeners;for(var r=0;r<s.length;r++)(0,s[r])()}function Kv(s,r){return r}function Xv(s,r){if(ht){var o=Ot.formState;if(o!==null){e:{var c=Xe;if(ht){if(Nt){t:{for(var m=Nt,_=hr;m.nodeType!==8;){if(!_){m=null;break t}if(m=fr(m.nextSibling),m===null){m=null;break t}}_=m.data,m=_==="F!"||_==="F"?m:null}if(m){Nt=fr(m.nextSibling),c=m.data==="F!";break e}}ca(c)}c=!1}c&&(r=o[0])}}return o=os(),o.memoizedState=o.baseState=r,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kv,lastRenderedState:r},o.queue=c,o=_0.bind(null,Xe,c),c.dispatch=o,c=dm(!1),_=Sm.bind(null,Xe,!1,c.queue),c=os(),m={state:r,dispatch:null,action:s,pending:null},c.queue=m,o=i5.bind(null,Xe,m,_,o),m.dispatch=o,c.memoizedState=s,[r,o,!1]}function Zv(s){var r=oi();return Qv(r,Et,s)}function Qv(s,r,o){if(r=um(s,r,Kv)[0],s=mh(Cn)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var c=Tc(r)}catch(y){throw y===dl?rh:y}else c=r;r=oi();var m=r.queue,_=m.dispatch;return o!==r.memoizedState&&(Xe.flags|=2048,gl(9,{destroy:void 0},s5.bind(null,m,o),null)),[c,_,s]}function s5(s,r){s.action=r}function Jv(s){var r=oi(),o=Et;if(o!==null)return Qv(r,o,s);oi(),r=r.memoizedState,o=oi();var c=o.queue.dispatch;return o.memoizedState=s,[r,c,!1]}function gl(s,r,o,c){return s={tag:s,create:o,deps:c,inst:r,next:null},r=Xe.updateQueue,r===null&&(r=dh(),Xe.updateQueue=r),o=r.lastEffect,o===null?r.lastEffect=s.next=s:(c=o.next,o.next=s,s.next=c,r.lastEffect=s),s}function e0(){return oi().memoizedState}function _h(s,r,o,c){var m=os();Xe.flags|=s,m.memoizedState=gl(1|r,{destroy:void 0},o,c===void 0?null:c)}function ph(s,r,o,c){var m=oi();c=c===void 0?null:c;var _=m.memoizedState.inst;Et!==null&&c!==null&&rm(c,Et.memoizedState.deps)?m.memoizedState=gl(r,_,o,c):(Xe.flags|=s,m.memoizedState=gl(1|r,_,o,c))}function t0(s,r){_h(8390656,8,s,r)}function mm(s,r){ph(2048,8,s,r)}function r5(s){Xe.flags|=4;var r=Xe.updateQueue;if(r===null)r=dh(),Xe.updateQueue=r,r.events=[s];else{var o=r.events;o===null?r.events=[s]:o.push(s)}}function i0(s){var r=oi().memoizedState;return r5({ref:r,nextImpl:s}),function(){if((vt&2)!==0)throw Error(n(440));return r.impl.apply(void 0,arguments)}}function s0(s,r){return ph(4,2,s,r)}function r0(s,r){return ph(4,4,s,r)}function n0(s,r){if(typeof r=="function"){s=s();var o=r(s);return function(){typeof o=="function"?o():r(null)}}if(r!=null)return s=s(),r.current=s,function(){r.current=null}}function a0(s,r,o){o=o!=null?o.concat([s]):null,ph(4,4,n0.bind(null,r,s),o)}function _m(){}function o0(s,r){var o=oi();r=r===void 0?null:r;var c=o.memoizedState;return r!==null&&rm(r,c[1])?c[0]:(o.memoizedState=[s,r],s)}function l0(s,r){var o=oi();r=r===void 0?null:r;var c=o.memoizedState;if(r!==null&&rm(r,c[1]))return c[0];if(c=s(),So){$i(!0);try{s()}finally{$i(!1)}}return o.memoizedState=[c,r],c}function pm(s,r,o){return o===void 0||(wn&1073741824)!==0&&(ct&261930)===0?s.memoizedState=r:(s.memoizedState=o,s=cS(),Xe.lanes|=s,va|=s,o)}function c0(s,r,o,c){return yi(o,r)?o:ml.current!==null?(s=pm(s,o,c),yi(s,r)||(fi=!0),s):(wn&42)===0||(wn&1073741824)!==0&&(ct&261930)===0?(fi=!0,s.memoizedState=o):(s=cS(),Xe.lanes|=s,va|=s,r)}function u0(s,r,o,c,m){var _=L.p;L.p=_!==0&&8>_?_:8;var y=T.T,k={};T.T=k,Sm(s,!1,r,o);try{var I=m(),Z=T.S;if(Z!==null&&Z(k,I),I!==null&&typeof I=="object"&&typeof I.then=="function"){var re=Jx(I,c);Rc(s,r,re,Is(s))}else Rc(s,r,c,Is(s))}catch(oe){Rc(s,r,{then:function(){},status:"rejected",reason:oe},Is())}finally{L.p=_,y!==null&&k.types!==null&&(y.types=k.types),T.T=y}}function n5(){}function gm(s,r,o,c){if(s.tag!==5)throw Error(n(476));var m=h0(s).queue;u0(s,m,r,H,o===null?n5:function(){return d0(s),o(c)})}function h0(s){var r=s.memoizedState;if(r!==null)return r;r={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cn,lastRenderedState:H},next:null};var o={};return r.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cn,lastRenderedState:o},next:null},s.memoizedState=r,s=s.alternate,s!==null&&(s.memoizedState=r),r}function d0(s){var r=h0(s);r.next===null&&(r=s.alternate.memoizedState),Rc(s,r.next.queue,{},Is())}function vm(){return Yi(Vc)}function f0(){return oi().memoizedState}function m0(){return oi().memoizedState}function a5(s){for(var r=s.return;r!==null;){switch(r.tag){case 24:case 3:var o=Is();s=da(o);var c=fa(r,s,o);c!==null&&(ys(c,r,o),Cc(c,r,o)),r={cache:Yf()},s.payload=r;return}r=r.return}}function o5(s,r,o){var c=Is();o={lane:c,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},gh(s)?p0(r,o):(o=Pf(s,r,o,c),o!==null&&(ys(o,s,c),g0(o,r,c)))}function _0(s,r,o){var c=Is();Rc(s,r,o,c)}function Rc(s,r,o,c){var m={lane:c,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(gh(s))p0(r,m);else{var _=s.alternate;if(s.lanes===0&&(_===null||_.lanes===0)&&(_=r.lastRenderedReducer,_!==null))try{var y=r.lastRenderedState,k=_(y,o);if(m.hasEagerState=!0,m.eagerState=k,yi(k,y))return Zu(s,r,m,0),Ot===null&&Xu(),!1}catch{}if(o=Pf(s,r,m,c),o!==null)return ys(o,s,c),g0(o,r,c),!0}return!1}function Sm(s,r,o,c){if(c={lane:2,revertLane:Zm(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},gh(s)){if(r)throw Error(n(479))}else r=Pf(s,o,c,2),r!==null&&ys(r,s,2)}function gh(s){var r=s.alternate;return s===Xe||r!==null&&r===Xe}function p0(s,r){_l=uh=!0;var o=s.pending;o===null?r.next=r:(r.next=o.next,o.next=r),s.pending=r}function g0(s,r,o){if((o&4194048)!==0){var c=r.lanes;c&=s.pendingLanes,o|=c,r.lanes=o,Vo(s,o)}}var Ac={readContext:Yi,use:fh,useCallback:Qt,useContext:Qt,useEffect:Qt,useImperativeHandle:Qt,useLayoutEffect:Qt,useInsertionEffect:Qt,useMemo:Qt,useReducer:Qt,useRef:Qt,useState:Qt,useDebugValue:Qt,useDeferredValue:Qt,useTransition:Qt,useSyncExternalStore:Qt,useId:Qt,useHostTransitionStatus:Qt,useFormState:Qt,useActionState:Qt,useOptimistic:Qt,useMemoCache:Qt,useCacheRefresh:Qt};Ac.useEffectEvent=Qt;var v0={readContext:Yi,use:fh,useCallback:function(s,r){return os().memoizedState=[s,r===void 0?null:r],s},useContext:Yi,useEffect:t0,useImperativeHandle:function(s,r,o){o=o!=null?o.concat([s]):null,_h(4194308,4,n0.bind(null,r,s),o)},useLayoutEffect:function(s,r){return _h(4194308,4,s,r)},useInsertionEffect:function(s,r){_h(4,2,s,r)},useMemo:function(s,r){var o=os();r=r===void 0?null:r;var c=s();if(So){$i(!0);try{s()}finally{$i(!1)}}return o.memoizedState=[c,r],c},useReducer:function(s,r,o){var c=os();if(o!==void 0){var m=o(r);if(So){$i(!0);try{o(r)}finally{$i(!1)}}}else m=r;return c.memoizedState=c.baseState=m,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:m},c.queue=s,s=s.dispatch=o5.bind(null,Xe,s),[c.memoizedState,s]},useRef:function(s){var r=os();return s={current:s},r.memoizedState=s},useState:function(s){s=dm(s);var r=s.queue,o=_0.bind(null,Xe,r);return r.dispatch=o,[s.memoizedState,o]},useDebugValue:_m,useDeferredValue:function(s,r){var o=os();return pm(o,s,r)},useTransition:function(){var s=dm(!1);return s=u0.bind(null,Xe,s.queue,!0,!1),os().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,r,o){var c=Xe,m=os();if(ht){if(o===void 0)throw Error(n(407));o=o()}else{if(o=r(),Ot===null)throw Error(n(349));(ct&127)!==0||Iv(c,r,o)}m.memoizedState=o;var _={value:o,getSnapshot:r};return m.queue=_,t0(Fv.bind(null,c,_,s),[s]),c.flags|=2048,gl(9,{destroy:void 0},Uv.bind(null,c,_,o,r),null),o},useId:function(){var s=os(),r=Ot.identifierPrefix;if(ht){var o=Gr,c=Yr;o=(c&~(1<<32-Mt(c)-1)).toString(32)+o,r="_"+r+"R_"+o,o=hh++,0<o&&(r+="H"+o.toString(32)),r+="_"}else o=e5++,r="_"+r+"r_"+o.toString(32)+"_";return s.memoizedState=r},useHostTransitionStatus:vm,useFormState:Xv,useActionState:Xv,useOptimistic:function(s){var r=os();r.memoizedState=r.baseState=s;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=o,r=Sm.bind(null,Xe,!0,o),o.dispatch=r,[s,r]},useMemoCache:cm,useCacheRefresh:function(){return os().memoizedState=a5.bind(null,Xe)},useEffectEvent:function(s){var r=os(),o={impl:s};return r.memoizedState=o,function(){if((vt&2)!==0)throw Error(n(440));return o.impl.apply(void 0,arguments)}}},ym={readContext:Yi,use:fh,useCallback:o0,useContext:Yi,useEffect:mm,useImperativeHandle:a0,useInsertionEffect:s0,useLayoutEffect:r0,useMemo:l0,useReducer:mh,useRef:e0,useState:function(){return mh(Cn)},useDebugValue:_m,useDeferredValue:function(s,r){var o=oi();return c0(o,Et.memoizedState,s,r)},useTransition:function(){var s=mh(Cn)[0],r=oi().memoizedState;return[typeof s=="boolean"?s:Tc(s),r]},useSyncExternalStore:Hv,useId:f0,useHostTransitionStatus:vm,useFormState:Zv,useActionState:Zv,useOptimistic:function(s,r){var o=oi();return jv(o,Et,s,r)},useMemoCache:cm,useCacheRefresh:m0};ym.useEffectEvent=i0;var S0={readContext:Yi,use:fh,useCallback:o0,useContext:Yi,useEffect:mm,useImperativeHandle:a0,useInsertionEffect:s0,useLayoutEffect:r0,useMemo:l0,useReducer:hm,useRef:e0,useState:function(){return hm(Cn)},useDebugValue:_m,useDeferredValue:function(s,r){var o=oi();return Et===null?pm(o,s,r):c0(o,Et.memoizedState,s,r)},useTransition:function(){var s=hm(Cn)[0],r=oi().memoizedState;return[typeof s=="boolean"?s:Tc(s),r]},useSyncExternalStore:Hv,useId:f0,useHostTransitionStatus:vm,useFormState:Jv,useActionState:Jv,useOptimistic:function(s,r){var o=oi();return Et!==null?jv(o,Et,s,r):(o.baseState=s,[s,o.queue.dispatch])},useMemoCache:cm,useCacheRefresh:m0};S0.useEffectEvent=i0;function bm(s,r,o,c){r=s.memoizedState,o=o(c,r),o=o==null?r:v({},r,o),s.memoizedState=o,s.lanes===0&&(s.updateQueue.baseState=o)}var wm={enqueueSetState:function(s,r,o){s=s._reactInternals;var c=Is(),m=da(c);m.payload=r,o!=null&&(m.callback=o),r=fa(s,m,c),r!==null&&(ys(r,s,c),Cc(r,s,c))},enqueueReplaceState:function(s,r,o){s=s._reactInternals;var c=Is(),m=da(c);m.tag=1,m.payload=r,o!=null&&(m.callback=o),r=fa(s,m,c),r!==null&&(ys(r,s,c),Cc(r,s,c))},enqueueForceUpdate:function(s,r){s=s._reactInternals;var o=Is(),c=da(o);c.tag=2,r!=null&&(c.callback=r),r=fa(s,c,o),r!==null&&(ys(r,s,o),Cc(r,s,o))}};function y0(s,r,o,c,m,_,y){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(c,_,y):r.prototype&&r.prototype.isPureReactComponent?!aa(o,c)||!aa(m,_):!0}function b0(s,r,o,c){s=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(o,c),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(o,c),r.state!==s&&wm.enqueueReplaceState(r,r.state,null)}function yo(s,r){var o=r;if("ref"in r){o={};for(var c in r)c!=="ref"&&(o[c]=r[c])}if(s=s.defaultProps){o===r&&(o=v({},o));for(var m in s)o[m]===void 0&&(o[m]=s[m])}return o}function w0(s){Ku(s)}function C0(s){console.error(s)}function x0(s){Ku(s)}function vh(s,r){try{var o=s.onUncaughtError;o(r.value,{componentStack:r.stack})}catch(c){setTimeout(function(){throw c})}}function k0(s,r,o){try{var c=s.onCaughtError;c(o.value,{componentStack:o.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function Cm(s,r,o){return o=da(o),o.tag=3,o.payload={element:null},o.callback=function(){vh(s,r)},o}function E0(s){return s=da(s),s.tag=3,s}function T0(s,r,o,c){var m=o.type.getDerivedStateFromError;if(typeof m=="function"){var _=c.value;s.payload=function(){return m(_)},s.callback=function(){k0(r,o,c)}}var y=o.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(s.callback=function(){k0(r,o,c),typeof m!="function"&&(Sa===null?Sa=new Set([this]):Sa.add(this));var k=c.stack;this.componentDidCatch(c.value,{componentStack:k!==null?k:""})})}function l5(s,r,o,c,m){if(o.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(r=o.alternate,r!==null&&cl(r,o,m,!0),o=Ns.current,o!==null){switch(o.tag){case 31:case 13:return dr===null?Mh():o.alternate===null&&Jt===0&&(Jt=3),o.flags&=-257,o.flags|=65536,o.lanes=m,c===nh?o.flags|=16384:(r=o.updateQueue,r===null?o.updateQueue=new Set([c]):r.add(c),Gm(s,c,m)),!1;case 22:return o.flags|=65536,c===nh?o.flags|=16384:(r=o.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([c])},o.updateQueue=r):(o=r.retryQueue,o===null?r.retryQueue=new Set([c]):o.add(c)),Gm(s,c,m)),!1}throw Error(n(435,o.tag))}return Gm(s,c,m),Mh(),!1}if(ht)return r=Ns.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=m,c!==$f&&(s=Error(n(422),{cause:c}),vc(lr(s,o)))):(c!==$f&&(r=Error(n(423),{cause:c}),vc(lr(r,o))),s=s.current.alternate,s.flags|=65536,m&=-m,s.lanes|=m,c=lr(c,o),m=Cm(s.stateNode,c,m),Jf(s,m),Jt!==4&&(Jt=2)),!1;var _=Error(n(520),{cause:c});if(_=lr(_,o),zc===null?zc=[_]:zc.push(_),Jt!==4&&(Jt=2),r===null)return!0;c=lr(c,o),o=r;do{switch(o.tag){case 3:return o.flags|=65536,s=m&-m,o.lanes|=s,s=Cm(o.stateNode,c,s),Jf(o,s),!1;case 1:if(r=o.type,_=o.stateNode,(o.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(Sa===null||!Sa.has(_))))return o.flags|=65536,m&=-m,o.lanes|=m,m=E0(m),T0(m,s,o,c),Jf(o,m),!1}o=o.return}while(o!==null);return!1}var xm=Error(n(461)),fi=!1;function Gi(s,r,o,c){r.child=s===null?Lv(r,null,o,c):vo(r,s.child,o,c)}function R0(s,r,o,c,m){o=o.render;var _=r.ref;if("ref"in c){var y={};for(var k in c)k!=="ref"&&(y[k]=c[k])}else y=c;return mo(r),c=nm(s,r,o,y,_,m),k=am(),s!==null&&!fi?(om(s,r,m),xn(s,r,m)):(ht&&k&&Uf(r),r.flags|=1,Gi(s,r,c,m),r.child)}function A0(s,r,o,c,m){if(s===null){var _=o.type;return typeof _=="function"&&!zf(_)&&_.defaultProps===void 0&&o.compare===null?(r.tag=15,r.type=_,M0(s,r,_,c,m)):(s=Ju(o.type,null,c,r,r.mode,m),s.ref=r.ref,s.return=r,r.child=s)}if(_=s.child,!Dm(s,m)){var y=_.memoizedProps;if(o=o.compare,o=o!==null?o:aa,o(y,c)&&s.ref===r.ref)return xn(s,r,m)}return r.flags|=1,s=vn(_,c),s.ref=r.ref,s.return=r,r.child=s}function M0(s,r,o,c,m){if(s!==null){var _=s.memoizedProps;if(aa(_,c)&&s.ref===r.ref)if(fi=!1,r.pendingProps=c=_,Dm(s,m))(s.flags&131072)!==0&&(fi=!0);else return r.lanes=s.lanes,xn(s,r,m)}return km(s,r,o,c,m)}function L0(s,r,o,c){var m=c.children,_=s!==null?s.memoizedState:null;if(s===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((r.flags&128)!==0){if(_=_!==null?_.baseLanes|o:o,s!==null){for(c=r.child=s.child,m=0;c!==null;)m=m|c.lanes|c.childLanes,c=c.sibling;c=m&~_}else c=0,r.child=null;return D0(s,r,_,o,c)}if((o&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},s!==null&&sh(r,_!==null?_.cachePool:null),_!==null?Bv(r,_):tm(),Nv(r);else return c=r.lanes=536870912,D0(s,r,_!==null?_.baseLanes|o:o,o,c)}else _!==null?(sh(r,_.cachePool),Bv(r,_),_a(),r.memoizedState=null):(s!==null&&sh(r,null),tm(),_a());return Gi(s,r,m,o),r.child}function Mc(s,r){return s!==null&&s.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function D0(s,r,o,c,m){var _=Kf();return _=_===null?null:{parent:hi._currentValue,pool:_},r.memoizedState={baseLanes:o,cachePool:_},s!==null&&sh(r,null),tm(),Nv(r),s!==null&&cl(s,r,c,!0),r.childLanes=m,null}function Sh(s,r){return r=bh({mode:r.mode,children:r.children},s.mode),r.ref=s.ref,s.child=r,r.return=s,r}function O0(s,r,o){return vo(r,s.child,null,o),s=Sh(r,r.pendingProps),s.flags|=2,Ps(r),r.memoizedState=null,s}function c5(s,r,o){var c=r.pendingProps,m=(r.flags&128)!==0;if(r.flags&=-129,s===null){if(ht){if(c.mode==="hidden")return s=Sh(r,c),r.lanes=536870912,Mc(null,s);if(sm(r),(s=Nt)?(s=VS(s,hr),s=s!==null&&s.data==="&"?s:null,s!==null&&(r.memoizedState={dehydrated:s,treeContext:oa!==null?{id:Yr,overflow:Gr}:null,retryLane:536870912,hydrationErrors:null},o=pv(s),o.return=r,r.child=o,qi=r,Nt=null)):s=null,s===null)throw ca(r);return r.lanes=536870912,null}return Sh(r,c)}var _=s.memoizedState;if(_!==null){var y=_.dehydrated;if(sm(r),m)if(r.flags&256)r.flags&=-257,r=O0(s,r,o);else if(r.memoizedState!==null)r.child=s.child,r.flags|=128,r=null;else throw Error(n(558));else if(fi||cl(s,r,o,!1),m=(o&s.childLanes)!==0,fi||m){if(c=Ot,c!==null&&(y=Zs(c,o),y!==0&&y!==_.retryLane))throw _.retryLane=y,co(s,y),ys(c,s,y),xm;Mh(),r=O0(s,r,o)}else s=_.treeContext,Nt=fr(y.nextSibling),qi=r,ht=!0,la=null,hr=!1,s!==null&&Sv(r,s),r=Sh(r,c),r.flags|=4096;return r}return s=vn(s.child,{mode:c.mode,children:c.children}),s.ref=r.ref,r.child=s,s.return=r,s}function yh(s,r){var o=r.ref;if(o===null)s!==null&&s.ref!==null&&(r.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(n(284));(s===null||s.ref!==o)&&(r.flags|=4194816)}}function km(s,r,o,c,m){return mo(r),o=nm(s,r,o,c,void 0,m),c=am(),s!==null&&!fi?(om(s,r,m),xn(s,r,m)):(ht&&c&&Uf(r),r.flags|=1,Gi(s,r,o,m),r.child)}function B0(s,r,o,c,m,_){return mo(r),r.updateQueue=null,o=zv(r,c,o,m),Pv(s),c=am(),s!==null&&!fi?(om(s,r,_),xn(s,r,_)):(ht&&c&&Uf(r),r.flags|=1,Gi(s,r,o,_),r.child)}function N0(s,r,o,c,m){if(mo(r),r.stateNode===null){var _=nl,y=o.contextType;typeof y=="object"&&y!==null&&(_=Yi(y)),_=new o(c,_),r.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,_.updater=wm,r.stateNode=_,_._reactInternals=r,_=r.stateNode,_.props=c,_.state=r.memoizedState,_.refs={},Zf(r),y=o.contextType,_.context=typeof y=="object"&&y!==null?Yi(y):nl,_.state=r.memoizedState,y=o.getDerivedStateFromProps,typeof y=="function"&&(bm(r,o,y,c),_.state=r.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(y=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),y!==_.state&&wm.enqueueReplaceState(_,_.state,null),kc(r,c,_,m),xc(),_.state=r.memoizedState),typeof _.componentDidMount=="function"&&(r.flags|=4194308),c=!0}else if(s===null){_=r.stateNode;var k=r.memoizedProps,I=yo(o,k);_.props=I;var Z=_.context,re=o.contextType;y=nl,typeof re=="object"&&re!==null&&(y=Yi(re));var oe=o.getDerivedStateFromProps;re=typeof oe=="function"||typeof _.getSnapshotBeforeUpdate=="function",k=r.pendingProps!==k,re||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(k||Z!==y)&&b0(r,_,c,y),ha=!1;var J=r.memoizedState;_.state=J,kc(r,c,_,m),xc(),Z=r.memoizedState,k||J!==Z||ha?(typeof oe=="function"&&(bm(r,o,oe,c),Z=r.memoizedState),(I=ha||y0(r,o,I,c,J,Z,y))?(re||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(r.flags|=4194308)):(typeof _.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=c,r.memoizedState=Z),_.props=c,_.state=Z,_.context=y,c=I):(typeof _.componentDidMount=="function"&&(r.flags|=4194308),c=!1)}else{_=r.stateNode,Qf(s,r),y=r.memoizedProps,re=yo(o,y),_.props=re,oe=r.pendingProps,J=_.context,Z=o.contextType,I=nl,typeof Z=="object"&&Z!==null&&(I=Yi(Z)),k=o.getDerivedStateFromProps,(Z=typeof k=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(y!==oe||J!==I)&&b0(r,_,c,I),ha=!1,J=r.memoizedState,_.state=J,kc(r,c,_,m),xc();var te=r.memoizedState;y!==oe||J!==te||ha||s!==null&&s.dependencies!==null&&th(s.dependencies)?(typeof k=="function"&&(bm(r,o,k,c),te=r.memoizedState),(re=ha||y0(r,o,re,c,J,te,I)||s!==null&&s.dependencies!==null&&th(s.dependencies))?(Z||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(c,te,I),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(c,te,I)),typeof _.componentDidUpdate=="function"&&(r.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof _.componentDidUpdate!="function"||y===s.memoizedProps&&J===s.memoizedState||(r.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||y===s.memoizedProps&&J===s.memoizedState||(r.flags|=1024),r.memoizedProps=c,r.memoizedState=te),_.props=c,_.state=te,_.context=I,c=re):(typeof _.componentDidUpdate!="function"||y===s.memoizedProps&&J===s.memoizedState||(r.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||y===s.memoizedProps&&J===s.memoizedState||(r.flags|=1024),c=!1)}return _=c,yh(s,r),c=(r.flags&128)!==0,_||c?(_=r.stateNode,o=c&&typeof o.getDerivedStateFromError!="function"?null:_.render(),r.flags|=1,s!==null&&c?(r.child=vo(r,s.child,null,m),r.child=vo(r,null,o,m)):Gi(s,r,o,m),r.memoizedState=_.state,s=r.child):s=xn(s,r,m),s}function P0(s,r,o,c){return ho(),r.flags|=256,Gi(s,r,o,c),r.child}var Em={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Tm(s){return{baseLanes:s,cachePool:kv()}}function Rm(s,r,o){return s=s!==null?s.childLanes&~o:0,r&&(s|=Hs),s}function z0(s,r,o){var c=r.pendingProps,m=!1,_=(r.flags&128)!==0,y;if((y=_)||(y=s!==null&&s.memoizedState===null?!1:(ai.current&2)!==0),y&&(m=!0,r.flags&=-129),y=(r.flags&32)!==0,r.flags&=-33,s===null){if(ht){if(m?ma(r):_a(),(s=Nt)?(s=VS(s,hr),s=s!==null&&s.data!=="&"?s:null,s!==null&&(r.memoizedState={dehydrated:s,treeContext:oa!==null?{id:Yr,overflow:Gr}:null,retryLane:536870912,hydrationErrors:null},o=pv(s),o.return=r,r.child=o,qi=r,Nt=null)):s=null,s===null)throw ca(r);return u_(s)?r.lanes=32:r.lanes=536870912,null}var k=c.children;return c=c.fallback,m?(_a(),m=r.mode,k=bh({mode:"hidden",children:k},m),c=uo(c,m,o,null),k.return=r,c.return=r,k.sibling=c,r.child=k,c=r.child,c.memoizedState=Tm(o),c.childLanes=Rm(s,y,o),r.memoizedState=Em,Mc(null,c)):(ma(r),Am(r,k))}var I=s.memoizedState;if(I!==null&&(k=I.dehydrated,k!==null)){if(_)r.flags&256?(ma(r),r.flags&=-257,r=Mm(s,r,o)):r.memoizedState!==null?(_a(),r.child=s.child,r.flags|=128,r=null):(_a(),k=c.fallback,m=r.mode,c=bh({mode:"visible",children:c.children},m),k=uo(k,m,o,null),k.flags|=2,c.return=r,k.return=r,c.sibling=k,r.child=c,vo(r,s.child,null,o),c=r.child,c.memoizedState=Tm(o),c.childLanes=Rm(s,y,o),r.memoizedState=Em,r=Mc(null,c));else if(ma(r),u_(k)){if(y=k.nextSibling&&k.nextSibling.dataset,y)var Z=y.dgst;y=Z,c=Error(n(419)),c.stack="",c.digest=y,vc({value:c,source:null,stack:null}),r=Mm(s,r,o)}else if(fi||cl(s,r,o,!1),y=(o&s.childLanes)!==0,fi||y){if(y=Ot,y!==null&&(c=Zs(y,o),c!==0&&c!==I.retryLane))throw I.retryLane=c,co(s,c),ys(y,s,c),xm;c_(k)||Mh(),r=Mm(s,r,o)}else c_(k)?(r.flags|=192,r.child=s.child,r=null):(s=I.treeContext,Nt=fr(k.nextSibling),qi=r,ht=!0,la=null,hr=!1,s!==null&&Sv(r,s),r=Am(r,c.children),r.flags|=4096);return r}return m?(_a(),k=c.fallback,m=r.mode,I=s.child,Z=I.sibling,c=vn(I,{mode:"hidden",children:c.children}),c.subtreeFlags=I.subtreeFlags&65011712,Z!==null?k=vn(Z,k):(k=uo(k,m,o,null),k.flags|=2),k.return=r,c.return=r,c.sibling=k,r.child=c,Mc(null,c),c=r.child,k=s.child.memoizedState,k===null?k=Tm(o):(m=k.cachePool,m!==null?(I=hi._currentValue,m=m.parent!==I?{parent:I,pool:I}:m):m=kv(),k={baseLanes:k.baseLanes|o,cachePool:m}),c.memoizedState=k,c.childLanes=Rm(s,y,o),r.memoizedState=Em,Mc(s.child,c)):(ma(r),o=s.child,s=o.sibling,o=vn(o,{mode:"visible",children:c.children}),o.return=r,o.sibling=null,s!==null&&(y=r.deletions,y===null?(r.deletions=[s],r.flags|=16):y.push(s)),r.child=o,r.memoizedState=null,o)}function Am(s,r){return r=bh({mode:"visible",children:r},s.mode),r.return=s,s.child=r}function bh(s,r){return s=Bs(22,s,null,r),s.lanes=0,s}function Mm(s,r,o){return vo(r,s.child,null,o),s=Am(r,r.pendingProps.children),s.flags|=2,r.memoizedState=null,s}function H0(s,r,o){s.lanes|=r;var c=s.alternate;c!==null&&(c.lanes|=r),Vf(s.return,r,o)}function Lm(s,r,o,c,m,_){var y=s.memoizedState;y===null?s.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:c,tail:o,tailMode:m,treeForkCount:_}:(y.isBackwards=r,y.rendering=null,y.renderingStartTime=0,y.last=c,y.tail=o,y.tailMode=m,y.treeForkCount=_)}function I0(s,r,o){var c=r.pendingProps,m=c.revealOrder,_=c.tail;c=c.children;var y=ai.current,k=(y&2)!==0;if(k?(y=y&1|2,r.flags|=128):y&=1,ie(ai,y),Gi(s,r,c,o),c=ht?gc:0,!k&&s!==null&&(s.flags&128)!==0)e:for(s=r.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&H0(s,o,r);else if(s.tag===19)H0(s,o,r);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break e;for(;s.sibling===null;){if(s.return===null||s.return===r)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(m){case"forwards":for(o=r.child,m=null;o!==null;)s=o.alternate,s!==null&&ch(s)===null&&(m=o),o=o.sibling;o=m,o===null?(m=r.child,r.child=null):(m=o.sibling,o.sibling=null),Lm(r,!1,m,o,_,c);break;case"backwards":case"unstable_legacy-backwards":for(o=null,m=r.child,r.child=null;m!==null;){if(s=m.alternate,s!==null&&ch(s)===null){r.child=m;break}s=m.sibling,m.sibling=o,o=m,m=s}Lm(r,!0,o,null,_,c);break;case"together":Lm(r,!1,null,null,void 0,c);break;default:r.memoizedState=null}return r.child}function xn(s,r,o){if(s!==null&&(r.dependencies=s.dependencies),va|=r.lanes,(o&r.childLanes)===0)if(s!==null){if(cl(s,r,o,!1),(o&r.childLanes)===0)return null}else return null;if(s!==null&&r.child!==s.child)throw Error(n(153));if(r.child!==null){for(s=r.child,o=vn(s,s.pendingProps),r.child=o,o.return=r;s.sibling!==null;)s=s.sibling,o=o.sibling=vn(s,s.pendingProps),o.return=r;o.sibling=null}return r.child}function Dm(s,r){return(s.lanes&r)!==0?!0:(s=s.dependencies,!!(s!==null&&th(s)))}function u5(s,r,o){switch(r.tag){case 3:ve(r,r.stateNode.containerInfo),ua(r,hi,s.memoizedState.cache),ho();break;case 27:case 5:Ae(r);break;case 4:ve(r,r.stateNode.containerInfo);break;case 10:ua(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,sm(r),null;break;case 13:var c=r.memoizedState;if(c!==null)return c.dehydrated!==null?(ma(r),r.flags|=128,null):(o&r.child.childLanes)!==0?z0(s,r,o):(ma(r),s=xn(s,r,o),s!==null?s.sibling:null);ma(r);break;case 19:var m=(s.flags&128)!==0;if(c=(o&r.childLanes)!==0,c||(cl(s,r,o,!1),c=(o&r.childLanes)!==0),m){if(c)return I0(s,r,o);r.flags|=128}if(m=r.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),ie(ai,ai.current),c)break;return null;case 22:return r.lanes=0,L0(s,r,o,r.pendingProps);case 24:ua(r,hi,s.memoizedState.cache)}return xn(s,r,o)}function U0(s,r,o){if(s!==null)if(s.memoizedProps!==r.pendingProps)fi=!0;else{if(!Dm(s,o)&&(r.flags&128)===0)return fi=!1,u5(s,r,o);fi=(s.flags&131072)!==0}else fi=!1,ht&&(r.flags&1048576)!==0&&vv(r,gc,r.index);switch(r.lanes=0,r.tag){case 16:e:{var c=r.pendingProps;if(s=po(r.elementType),r.type=s,typeof s=="function")zf(s)?(c=yo(s,c),r.tag=1,r=N0(null,r,s,c,o)):(r.tag=0,r=km(null,r,s,c,o));else{if(s!=null){var m=s.$$typeof;if(m===R){r.tag=11,r=R0(null,r,s,c,o);break e}else if(m===U){r.tag=14,r=A0(null,r,s,c,o);break e}}throw r=N(s)||s,Error(n(306,r,""))}}return r;case 0:return km(s,r,r.type,r.pendingProps,o);case 1:return c=r.type,m=yo(c,r.pendingProps),N0(s,r,c,m,o);case 3:e:{if(ve(r,r.stateNode.containerInfo),s===null)throw Error(n(387));c=r.pendingProps;var _=r.memoizedState;m=_.element,Qf(s,r),kc(r,c,null,o);var y=r.memoizedState;if(c=y.cache,ua(r,hi,c),c!==_.cache&&qf(r,[hi],o,!0),xc(),c=y.element,_.isDehydrated)if(_={element:c,isDehydrated:!1,cache:y.cache},r.updateQueue.baseState=_,r.memoizedState=_,r.flags&256){r=P0(s,r,c,o);break e}else if(c!==m){m=lr(Error(n(424)),r),vc(m),r=P0(s,r,c,o);break e}else for(s=r.stateNode.containerInfo,s.nodeType===9?s=s.body:s=s.nodeName==="HTML"?s.ownerDocument.body:s,Nt=fr(s.firstChild),qi=r,ht=!0,la=null,hr=!0,o=Lv(r,null,c,o),r.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(ho(),c===m){r=xn(s,r,o);break e}Gi(s,r,c,o)}r=r.child}return r;case 26:return yh(s,r),s===null?(o=ZS(r.type,null,r.pendingProps,null))?r.memoizedState=o:ht||(o=r.type,s=r.pendingProps,c=zh(ue.current).createElement(o),c[Ee]=r,c[Ie]=s,Ki(c,o,s),be(c),r.stateNode=c):r.memoizedState=ZS(r.type,s.memoizedProps,r.pendingProps,s.memoizedState),null;case 27:return Ae(r),s===null&&ht&&(c=r.stateNode=GS(r.type,r.pendingProps,ue.current),qi=r,hr=!0,m=Nt,Ca(r.type)?(h_=m,Nt=fr(c.firstChild)):Nt=m),Gi(s,r,r.pendingProps.children,o),yh(s,r),s===null&&(r.flags|=4194304),r.child;case 5:return s===null&&ht&&((m=c=Nt)&&(c=U5(c,r.type,r.pendingProps,hr),c!==null?(r.stateNode=c,qi=r,Nt=fr(c.firstChild),hr=!1,m=!0):m=!1),m||ca(r)),Ae(r),m=r.type,_=r.pendingProps,y=s!==null?s.memoizedProps:null,c=_.children,a_(m,_)?c=null:y!==null&&a_(m,y)&&(r.flags|=32),r.memoizedState!==null&&(m=nm(s,r,t5,null,null,o),Vc._currentValue=m),yh(s,r),Gi(s,r,c,o),r.child;case 6:return s===null&&ht&&((s=o=Nt)&&(o=F5(o,r.pendingProps,hr),o!==null?(r.stateNode=o,qi=r,Nt=null,s=!0):s=!1),s||ca(r)),null;case 13:return z0(s,r,o);case 4:return ve(r,r.stateNode.containerInfo),c=r.pendingProps,s===null?r.child=vo(r,null,c,o):Gi(s,r,c,o),r.child;case 11:return R0(s,r,r.type,r.pendingProps,o);case 7:return Gi(s,r,r.pendingProps,o),r.child;case 8:return Gi(s,r,r.pendingProps.children,o),r.child;case 12:return Gi(s,r,r.pendingProps.children,o),r.child;case 10:return c=r.pendingProps,ua(r,r.type,c.value),Gi(s,r,c.children,o),r.child;case 9:return m=r.type._context,c=r.pendingProps.children,mo(r),m=Yi(m),c=c(m),r.flags|=1,Gi(s,r,c,o),r.child;case 14:return A0(s,r,r.type,r.pendingProps,o);case 15:return M0(s,r,r.type,r.pendingProps,o);case 19:return I0(s,r,o);case 31:return c5(s,r,o);case 22:return L0(s,r,o,r.pendingProps);case 24:return mo(r),c=Yi(hi),s===null?(m=Kf(),m===null&&(m=Ot,_=Yf(),m.pooledCache=_,_.refCount++,_!==null&&(m.pooledCacheLanes|=o),m=_),r.memoizedState={parent:c,cache:m},Zf(r),ua(r,hi,m)):((s.lanes&o)!==0&&(Qf(s,r),kc(r,null,null,o),xc()),m=s.memoizedState,_=r.memoizedState,m.parent!==c?(m={parent:c,cache:c},r.memoizedState=m,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=m),ua(r,hi,c)):(c=_.cache,ua(r,hi,c),c!==m.cache&&qf(r,[hi],o,!0))),Gi(s,r,r.pendingProps.children,o),r.child;case 29:throw r.pendingProps}throw Error(n(156,r.tag))}function kn(s){s.flags|=4}function Om(s,r,o,c,m){if((r=(s.mode&32)!==0)&&(r=!1),r){if(s.flags|=16777216,(m&335544128)===m)if(s.stateNode.complete)s.flags|=8192;else if(fS())s.flags|=8192;else throw go=nh,Xf}else s.flags&=-16777217}function F0(s,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!iy(r))if(fS())s.flags|=8192;else throw go=nh,Xf}function wh(s,r){r!==null&&(s.flags|=4),s.flags&16384&&(r=s.tag!==22?Qi():536870912,s.lanes|=r,bl|=r)}function Lc(s,r){if(!ht)switch(s.tailMode){case"hidden":r=s.tail;for(var o=null;r!==null;)r.alternate!==null&&(o=r),r=r.sibling;o===null?s.tail=null:o.sibling=null;break;case"collapsed":o=s.tail;for(var c=null;o!==null;)o.alternate!==null&&(c=o),o=o.sibling;c===null?r||s.tail===null?s.tail=null:s.tail.sibling=null:c.sibling=null}}function Pt(s){var r=s.alternate!==null&&s.alternate.child===s.child,o=0,c=0;if(r)for(var m=s.child;m!==null;)o|=m.lanes|m.childLanes,c|=m.subtreeFlags&65011712,c|=m.flags&65011712,m.return=s,m=m.sibling;else for(m=s.child;m!==null;)o|=m.lanes|m.childLanes,c|=m.subtreeFlags,c|=m.flags,m.return=s,m=m.sibling;return s.subtreeFlags|=c,s.childLanes=o,r}function h5(s,r,o){var c=r.pendingProps;switch(Ff(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pt(r),null;case 1:return Pt(r),null;case 3:return o=r.stateNode,c=null,s!==null&&(c=s.memoizedState.cache),r.memoizedState.cache!==c&&(r.flags|=2048),bn(hi),ye(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(s===null||s.child===null)&&(ll(r)?kn(r):s===null||s.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,Wf())),Pt(r),null;case 26:var m=r.type,_=r.memoizedState;return s===null?(kn(r),_!==null?(Pt(r),F0(r,_)):(Pt(r),Om(r,m,null,c,o))):_?_!==s.memoizedState?(kn(r),Pt(r),F0(r,_)):(Pt(r),r.flags&=-16777217):(s=s.memoizedProps,s!==c&&kn(r),Pt(r),Om(r,m,s,c,o)),null;case 27:if(De(r),o=ue.current,m=r.type,s!==null&&r.stateNode!=null)s.memoizedProps!==c&&kn(r);else{if(!c){if(r.stateNode===null)throw Error(n(166));return Pt(r),null}s=ae.current,ll(r)?yv(r):(s=GS(m,c,o),r.stateNode=s,kn(r))}return Pt(r),null;case 5:if(De(r),m=r.type,s!==null&&r.stateNode!=null)s.memoizedProps!==c&&kn(r);else{if(!c){if(r.stateNode===null)throw Error(n(166));return Pt(r),null}if(_=ae.current,ll(r))yv(r);else{var y=zh(ue.current);switch(_){case 1:_=y.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:_=y.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":_=y.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":_=y.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":_=y.createElement("div"),_.innerHTML="<script><\/script>",_=_.removeChild(_.firstChild);break;case"select":_=typeof c.is=="string"?y.createElement("select",{is:c.is}):y.createElement("select"),c.multiple?_.multiple=!0:c.size&&(_.size=c.size);break;default:_=typeof c.is=="string"?y.createElement(m,{is:c.is}):y.createElement(m)}}_[Ee]=r,_[Ie]=c;e:for(y=r.child;y!==null;){if(y.tag===5||y.tag===6)_.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===r)break e;for(;y.sibling===null;){if(y.return===null||y.return===r)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}r.stateNode=_;e:switch(Ki(_,m,c),m){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&kn(r)}}return Pt(r),Om(r,r.type,s===null?null:s.memoizedProps,r.pendingProps,o),null;case 6:if(s&&r.stateNode!=null)s.memoizedProps!==c&&kn(r);else{if(typeof c!="string"&&r.stateNode===null)throw Error(n(166));if(s=ue.current,ll(r)){if(s=r.stateNode,o=r.memoizedProps,c=null,m=qi,m!==null)switch(m.tag){case 27:case 5:c=m.memoizedProps}s[Ee]=r,s=!!(s.nodeValue===o||c!==null&&c.suppressHydrationWarning===!0||zS(s.nodeValue,o)),s||ca(r,!0)}else s=zh(s).createTextNode(c),s[Ee]=r,r.stateNode=s}return Pt(r),null;case 31:if(o=r.memoizedState,s===null||s.memoizedState!==null){if(c=ll(r),o!==null){if(s===null){if(!c)throw Error(n(318));if(s=r.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(n(557));s[Ee]=r}else ho(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Pt(r),s=!1}else o=Wf(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=o),s=!0;if(!s)return r.flags&256?(Ps(r),r):(Ps(r),null);if((r.flags&128)!==0)throw Error(n(558))}return Pt(r),null;case 13:if(c=r.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(m=ll(r),c!==null&&c.dehydrated!==null){if(s===null){if(!m)throw Error(n(318));if(m=r.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(n(317));m[Ee]=r}else ho(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Pt(r),m=!1}else m=Wf(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=m),m=!0;if(!m)return r.flags&256?(Ps(r),r):(Ps(r),null)}return Ps(r),(r.flags&128)!==0?(r.lanes=o,r):(o=c!==null,s=s!==null&&s.memoizedState!==null,o&&(c=r.child,m=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(m=c.alternate.memoizedState.cachePool.pool),_=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(_=c.memoizedState.cachePool.pool),_!==m&&(c.flags|=2048)),o!==s&&o&&(r.child.flags|=8192),wh(r,r.updateQueue),Pt(r),null);case 4:return ye(),s===null&&t_(r.stateNode.containerInfo),Pt(r),null;case 10:return bn(r.type),Pt(r),null;case 19:if(G(ai),c=r.memoizedState,c===null)return Pt(r),null;if(m=(r.flags&128)!==0,_=c.rendering,_===null)if(m)Lc(c,!1);else{if(Jt!==0||s!==null&&(s.flags&128)!==0)for(s=r.child;s!==null;){if(_=ch(s),_!==null){for(r.flags|=128,Lc(c,!1),s=_.updateQueue,r.updateQueue=s,wh(r,s),r.subtreeFlags=0,s=o,o=r.child;o!==null;)_v(o,s),o=o.sibling;return ie(ai,ai.current&1|2),ht&&Sn(r,c.treeForkCount),r.child}s=s.sibling}c.tail!==null&&Qe()>Th&&(r.flags|=128,m=!0,Lc(c,!1),r.lanes=4194304)}else{if(!m)if(s=ch(_),s!==null){if(r.flags|=128,m=!0,s=s.updateQueue,r.updateQueue=s,wh(r,s),Lc(c,!0),c.tail===null&&c.tailMode==="hidden"&&!_.alternate&&!ht)return Pt(r),null}else 2*Qe()-c.renderingStartTime>Th&&o!==536870912&&(r.flags|=128,m=!0,Lc(c,!1),r.lanes=4194304);c.isBackwards?(_.sibling=r.child,r.child=_):(s=c.last,s!==null?s.sibling=_:r.child=_,c.last=_)}return c.tail!==null?(s=c.tail,c.rendering=s,c.tail=s.sibling,c.renderingStartTime=Qe(),s.sibling=null,o=ai.current,ie(ai,m?o&1|2:o&1),ht&&Sn(r,c.treeForkCount),s):(Pt(r),null);case 22:case 23:return Ps(r),im(),c=r.memoizedState!==null,s!==null?s.memoizedState!==null!==c&&(r.flags|=8192):c&&(r.flags|=8192),c?(o&536870912)!==0&&(r.flags&128)===0&&(Pt(r),r.subtreeFlags&6&&(r.flags|=8192)):Pt(r),o=r.updateQueue,o!==null&&wh(r,o.retryQueue),o=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(o=s.memoizedState.cachePool.pool),c=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(c=r.memoizedState.cachePool.pool),c!==o&&(r.flags|=2048),s!==null&&G(_o),null;case 24:return o=null,s!==null&&(o=s.memoizedState.cache),r.memoizedState.cache!==o&&(r.flags|=2048),bn(hi),Pt(r),null;case 25:return null;case 30:return null}throw Error(n(156,r.tag))}function d5(s,r){switch(Ff(r),r.tag){case 1:return s=r.flags,s&65536?(r.flags=s&-65537|128,r):null;case 3:return bn(hi),ye(),s=r.flags,(s&65536)!==0&&(s&128)===0?(r.flags=s&-65537|128,r):null;case 26:case 27:case 5:return De(r),null;case 31:if(r.memoizedState!==null){if(Ps(r),r.alternate===null)throw Error(n(340));ho()}return s=r.flags,s&65536?(r.flags=s&-65537|128,r):null;case 13:if(Ps(r),s=r.memoizedState,s!==null&&s.dehydrated!==null){if(r.alternate===null)throw Error(n(340));ho()}return s=r.flags,s&65536?(r.flags=s&-65537|128,r):null;case 19:return G(ai),null;case 4:return ye(),null;case 10:return bn(r.type),null;case 22:case 23:return Ps(r),im(),s!==null&&G(_o),s=r.flags,s&65536?(r.flags=s&-65537|128,r):null;case 24:return bn(hi),null;case 25:return null;default:return null}}function $0(s,r){switch(Ff(r),r.tag){case 3:bn(hi),ye();break;case 26:case 27:case 5:De(r);break;case 4:ye();break;case 31:r.memoizedState!==null&&Ps(r);break;case 13:Ps(r);break;case 19:G(ai);break;case 10:bn(r.type);break;case 22:case 23:Ps(r),im(),s!==null&&G(_o);break;case 24:bn(hi)}}function Dc(s,r){try{var o=r.updateQueue,c=o!==null?o.lastEffect:null;if(c!==null){var m=c.next;o=m;do{if((o.tag&s)===s){c=void 0;var _=o.create,y=o.inst;c=_(),y.destroy=c}o=o.next}while(o!==m)}}catch(k){Ct(r,r.return,k)}}function pa(s,r,o){try{var c=r.updateQueue,m=c!==null?c.lastEffect:null;if(m!==null){var _=m.next;c=_;do{if((c.tag&s)===s){var y=c.inst,k=y.destroy;if(k!==void 0){y.destroy=void 0,m=r;var I=o,Z=k;try{Z()}catch(re){Ct(m,I,re)}}}c=c.next}while(c!==_)}}catch(re){Ct(r,r.return,re)}}function W0(s){var r=s.updateQueue;if(r!==null){var o=s.stateNode;try{Ov(r,o)}catch(c){Ct(s,s.return,c)}}}function j0(s,r,o){o.props=yo(s.type,s.memoizedProps),o.state=s.memoizedState;try{o.componentWillUnmount()}catch(c){Ct(s,r,c)}}function Oc(s,r){try{var o=s.ref;if(o!==null){switch(s.tag){case 26:case 27:case 5:var c=s.stateNode;break;case 30:c=s.stateNode;break;default:c=s.stateNode}typeof o=="function"?s.refCleanup=o(c):o.current=c}}catch(m){Ct(s,r,m)}}function Kr(s,r){var o=s.ref,c=s.refCleanup;if(o!==null)if(typeof c=="function")try{c()}catch(m){Ct(s,r,m)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(m){Ct(s,r,m)}else o.current=null}function V0(s){var r=s.type,o=s.memoizedProps,c=s.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":o.autoFocus&&c.focus();break e;case"img":o.src?c.src=o.src:o.srcSet&&(c.srcset=o.srcSet)}}catch(m){Ct(s,s.return,m)}}function Bm(s,r,o){try{var c=s.stateNode;B5(c,s.type,o,r),c[Ie]=r}catch(m){Ct(s,s.return,m)}}function q0(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&Ca(s.type)||s.tag===4}function Nm(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||q0(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&Ca(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function Pm(s,r,o){var c=s.tag;if(c===5||c===6)s=s.stateNode,r?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(s,r):(r=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,r.appendChild(s),o=o._reactRootContainer,o!=null||r.onclick!==null||(r.onclick=Ri));else if(c!==4&&(c===27&&Ca(s.type)&&(o=s.stateNode,r=null),s=s.child,s!==null))for(Pm(s,r,o),s=s.sibling;s!==null;)Pm(s,r,o),s=s.sibling}function Ch(s,r,o){var c=s.tag;if(c===5||c===6)s=s.stateNode,r?o.insertBefore(s,r):o.appendChild(s);else if(c!==4&&(c===27&&Ca(s.type)&&(o=s.stateNode),s=s.child,s!==null))for(Ch(s,r,o),s=s.sibling;s!==null;)Ch(s,r,o),s=s.sibling}function Y0(s){var r=s.stateNode,o=s.memoizedProps;try{for(var c=s.type,m=r.attributes;m.length;)r.removeAttributeNode(m[0]);Ki(r,c,o),r[Ee]=s,r[Ie]=o}catch(_){Ct(s,s.return,_)}}var En=!1,mi=!1,zm=!1,G0=typeof WeakSet=="function"?WeakSet:Set,Mi=null;function f5(s,r){if(s=s.containerInfo,r_=jh,s=av(s),Mf(s)){if("selectionStart"in s)var o={start:s.selectionStart,end:s.selectionEnd};else e:{o=(o=s.ownerDocument)&&o.defaultView||window;var c=o.getSelection&&o.getSelection();if(c&&c.rangeCount!==0){o=c.anchorNode;var m=c.anchorOffset,_=c.focusNode;c=c.focusOffset;try{o.nodeType,_.nodeType}catch{o=null;break e}var y=0,k=-1,I=-1,Z=0,re=0,oe=s,J=null;t:for(;;){for(var te;oe!==o||m!==0&&oe.nodeType!==3||(k=y+m),oe!==_||c!==0&&oe.nodeType!==3||(I=y+c),oe.nodeType===3&&(y+=oe.nodeValue.length),(te=oe.firstChild)!==null;)J=oe,oe=te;for(;;){if(oe===s)break t;if(J===o&&++Z===m&&(k=y),J===_&&++re===c&&(I=y),(te=oe.nextSibling)!==null)break;oe=J,J=oe.parentNode}oe=te}o=k===-1||I===-1?null:{start:k,end:I}}else o=null}o=o||{start:0,end:0}}else o=null;for(n_={focusedElem:s,selectionRange:o},jh=!1,Mi=r;Mi!==null;)if(r=Mi,s=r.child,(r.subtreeFlags&1028)!==0&&s!==null)s.return=r,Mi=s;else for(;Mi!==null;){switch(r=Mi,_=r.alternate,s=r.flags,r.tag){case 0:if((s&4)!==0&&(s=r.updateQueue,s=s!==null?s.events:null,s!==null))for(o=0;o<s.length;o++)m=s[o],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&_!==null){s=void 0,o=r,m=_.memoizedProps,_=_.memoizedState,c=o.stateNode;try{var ke=yo(o.type,m);s=c.getSnapshotBeforeUpdate(ke,_),c.__reactInternalSnapshotBeforeUpdate=s}catch(Ue){Ct(o,o.return,Ue)}}break;case 3:if((s&1024)!==0){if(s=r.stateNode.containerInfo,o=s.nodeType,o===9)l_(s);else if(o===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":l_(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(n(163))}if(s=r.sibling,s!==null){s.return=r.return,Mi=s;break}Mi=r.return}}function K0(s,r,o){var c=o.flags;switch(o.tag){case 0:case 11:case 15:Rn(s,o),c&4&&Dc(5,o);break;case 1:if(Rn(s,o),c&4)if(s=o.stateNode,r===null)try{s.componentDidMount()}catch(y){Ct(o,o.return,y)}else{var m=yo(o.type,r.memoizedProps);r=r.memoizedState;try{s.componentDidUpdate(m,r,s.__reactInternalSnapshotBeforeUpdate)}catch(y){Ct(o,o.return,y)}}c&64&&W0(o),c&512&&Oc(o,o.return);break;case 3:if(Rn(s,o),c&64&&(s=o.updateQueue,s!==null)){if(r=null,o.child!==null)switch(o.child.tag){case 27:case 5:r=o.child.stateNode;break;case 1:r=o.child.stateNode}try{Ov(s,r)}catch(y){Ct(o,o.return,y)}}break;case 27:r===null&&c&4&&Y0(o);case 26:case 5:Rn(s,o),r===null&&c&4&&V0(o),c&512&&Oc(o,o.return);break;case 12:Rn(s,o);break;case 31:Rn(s,o),c&4&&Q0(s,o);break;case 13:Rn(s,o),c&4&&J0(s,o),c&64&&(s=o.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(o=w5.bind(null,o),$5(s,o))));break;case 22:if(c=o.memoizedState!==null||En,!c){r=r!==null&&r.memoizedState!==null||mi,m=En;var _=mi;En=c,(mi=r)&&!_?An(s,o,(o.subtreeFlags&8772)!==0):Rn(s,o),En=m,mi=_}break;case 30:break;default:Rn(s,o)}}function X0(s){var r=s.alternate;r!==null&&(s.alternate=null,X0(r)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(r=s.stateNode,r!==null&&Rr(r)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var $t=null,ps=!1;function Tn(s,r,o){for(o=o.child;o!==null;)Z0(s,r,o),o=o.sibling}function Z0(s,r,o){if(ri&&typeof ri.onCommitFiberUnmount=="function")try{ri.onCommitFiberUnmount(Ys,o)}catch{}switch(o.tag){case 26:mi||Kr(o,r),Tn(s,r,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:mi||Kr(o,r);var c=$t,m=ps;Ca(o.type)&&($t=o.stateNode,ps=!1),Tn(s,r,o),$c(o.stateNode),$t=c,ps=m;break;case 5:mi||Kr(o,r);case 6:if(c=$t,m=ps,$t=null,Tn(s,r,o),$t=c,ps=m,$t!==null)if(ps)try{($t.nodeType===9?$t.body:$t.nodeName==="HTML"?$t.ownerDocument.body:$t).removeChild(o.stateNode)}catch(_){Ct(o,r,_)}else try{$t.removeChild(o.stateNode)}catch(_){Ct(o,r,_)}break;case 18:$t!==null&&(ps?(s=$t,WS(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,o.stateNode),Al(s)):WS($t,o.stateNode));break;case 4:c=$t,m=ps,$t=o.stateNode.containerInfo,ps=!0,Tn(s,r,o),$t=c,ps=m;break;case 0:case 11:case 14:case 15:pa(2,o,r),mi||pa(4,o,r),Tn(s,r,o);break;case 1:mi||(Kr(o,r),c=o.stateNode,typeof c.componentWillUnmount=="function"&&j0(o,r,c)),Tn(s,r,o);break;case 21:Tn(s,r,o);break;case 22:mi=(c=mi)||o.memoizedState!==null,Tn(s,r,o),mi=c;break;default:Tn(s,r,o)}}function Q0(s,r){if(r.memoizedState===null&&(s=r.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{Al(s)}catch(o){Ct(r,r.return,o)}}}function J0(s,r){if(r.memoizedState===null&&(s=r.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{Al(s)}catch(o){Ct(r,r.return,o)}}function m5(s){switch(s.tag){case 31:case 13:case 19:var r=s.stateNode;return r===null&&(r=s.stateNode=new G0),r;case 22:return s=s.stateNode,r=s._retryCache,r===null&&(r=s._retryCache=new G0),r;default:throw Error(n(435,s.tag))}}function xh(s,r){var o=m5(s);r.forEach(function(c){if(!o.has(c)){o.add(c);var m=C5.bind(null,s,c);c.then(m,m)}})}function gs(s,r){var o=r.deletions;if(o!==null)for(var c=0;c<o.length;c++){var m=o[c],_=s,y=r,k=y;e:for(;k!==null;){switch(k.tag){case 27:if(Ca(k.type)){$t=k.stateNode,ps=!1;break e}break;case 5:$t=k.stateNode,ps=!1;break e;case 3:case 4:$t=k.stateNode.containerInfo,ps=!0;break e}k=k.return}if($t===null)throw Error(n(160));Z0(_,y,m),$t=null,ps=!1,_=m.alternate,_!==null&&(_.return=null),m.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)eS(r,s),r=r.sibling}var Nr=null;function eS(s,r){var o=s.alternate,c=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:gs(r,s),vs(s),c&4&&(pa(3,s,s.return),Dc(3,s),pa(5,s,s.return));break;case 1:gs(r,s),vs(s),c&512&&(mi||o===null||Kr(o,o.return)),c&64&&En&&(s=s.updateQueue,s!==null&&(c=s.callbacks,c!==null&&(o=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=o===null?c:o.concat(c))));break;case 26:var m=Nr;if(gs(r,s),vs(s),c&512&&(mi||o===null||Kr(o,o.return)),c&4){var _=o!==null?o.memoizedState:null;if(c=s.memoizedState,o===null)if(c===null)if(s.stateNode===null){e:{c=s.type,o=s.memoizedProps,m=m.ownerDocument||m;t:switch(c){case"title":_=m.getElementsByTagName("title")[0],(!_||_[As]||_[Ee]||_.namespaceURI==="http://www.w3.org/2000/svg"||_.hasAttribute("itemprop"))&&(_=m.createElement(c),m.head.insertBefore(_,m.querySelector("head > title"))),Ki(_,c,o),_[Ee]=s,be(_),c=_;break e;case"link":var y=ey("link","href",m).get(c+(o.href||""));if(y){for(var k=0;k<y.length;k++)if(_=y[k],_.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&_.getAttribute("rel")===(o.rel==null?null:o.rel)&&_.getAttribute("title")===(o.title==null?null:o.title)&&_.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){y.splice(k,1);break t}}_=m.createElement(c),Ki(_,c,o),m.head.appendChild(_);break;case"meta":if(y=ey("meta","content",m).get(c+(o.content||""))){for(k=0;k<y.length;k++)if(_=y[k],_.getAttribute("content")===(o.content==null?null:""+o.content)&&_.getAttribute("name")===(o.name==null?null:o.name)&&_.getAttribute("property")===(o.property==null?null:o.property)&&_.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&_.getAttribute("charset")===(o.charSet==null?null:o.charSet)){y.splice(k,1);break t}}_=m.createElement(c),Ki(_,c,o),m.head.appendChild(_);break;default:throw Error(n(468,c))}_[Ee]=s,be(_),c=_}s.stateNode=c}else ty(m,s.type,s.stateNode);else s.stateNode=JS(m,c,s.memoizedProps);else _!==c?(_===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):_.count--,c===null?ty(m,s.type,s.stateNode):JS(m,c,s.memoizedProps)):c===null&&s.stateNode!==null&&Bm(s,s.memoizedProps,o.memoizedProps)}break;case 27:gs(r,s),vs(s),c&512&&(mi||o===null||Kr(o,o.return)),o!==null&&c&4&&Bm(s,s.memoizedProps,o.memoizedProps);break;case 5:if(gs(r,s),vs(s),c&512&&(mi||o===null||Kr(o,o.return)),s.flags&32){m=s.stateNode;try{ta(m,"")}catch(ke){Ct(s,s.return,ke)}}c&4&&s.stateNode!=null&&(m=s.memoizedProps,Bm(s,m,o!==null?o.memoizedProps:m)),c&1024&&(zm=!0);break;case 6:if(gs(r,s),vs(s),c&4){if(s.stateNode===null)throw Error(n(162));c=s.memoizedProps,o=s.stateNode;try{o.nodeValue=c}catch(ke){Ct(s,s.return,ke)}}break;case 3:if(Uh=null,m=Nr,Nr=Hh(r.containerInfo),gs(r,s),Nr=m,vs(s),c&4&&o!==null&&o.memoizedState.isDehydrated)try{Al(r.containerInfo)}catch(ke){Ct(s,s.return,ke)}zm&&(zm=!1,tS(s));break;case 4:c=Nr,Nr=Hh(s.stateNode.containerInfo),gs(r,s),vs(s),Nr=c;break;case 12:gs(r,s),vs(s);break;case 31:gs(r,s),vs(s),c&4&&(c=s.updateQueue,c!==null&&(s.updateQueue=null,xh(s,c)));break;case 13:gs(r,s),vs(s),s.child.flags&8192&&s.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(Eh=Qe()),c&4&&(c=s.updateQueue,c!==null&&(s.updateQueue=null,xh(s,c)));break;case 22:m=s.memoizedState!==null;var I=o!==null&&o.memoizedState!==null,Z=En,re=mi;if(En=Z||m,mi=re||I,gs(r,s),mi=re,En=Z,vs(s),c&8192)e:for(r=s.stateNode,r._visibility=m?r._visibility&-2:r._visibility|1,m&&(o===null||I||En||mi||bo(s)),o=null,r=s;;){if(r.tag===5||r.tag===26){if(o===null){I=o=r;try{if(_=I.stateNode,m)y=_.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none";else{k=I.stateNode;var oe=I.memoizedProps.style,J=oe!=null&&oe.hasOwnProperty("display")?oe.display:null;k.style.display=J==null||typeof J=="boolean"?"":(""+J).trim()}}catch(ke){Ct(I,I.return,ke)}}}else if(r.tag===6){if(o===null){I=r;try{I.stateNode.nodeValue=m?"":I.memoizedProps}catch(ke){Ct(I,I.return,ke)}}}else if(r.tag===18){if(o===null){I=r;try{var te=I.stateNode;m?jS(te,!0):jS(I.stateNode,!1)}catch(ke){Ct(I,I.return,ke)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===s)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===s)break e;for(;r.sibling===null;){if(r.return===null||r.return===s)break e;o===r&&(o=null),r=r.return}o===r&&(o=null),r.sibling.return=r.return,r=r.sibling}c&4&&(c=s.updateQueue,c!==null&&(o=c.retryQueue,o!==null&&(c.retryQueue=null,xh(s,o))));break;case 19:gs(r,s),vs(s),c&4&&(c=s.updateQueue,c!==null&&(s.updateQueue=null,xh(s,c)));break;case 30:break;case 21:break;default:gs(r,s),vs(s)}}function vs(s){var r=s.flags;if(r&2){try{for(var o,c=s.return;c!==null;){if(q0(c)){o=c;break}c=c.return}if(o==null)throw Error(n(160));switch(o.tag){case 27:var m=o.stateNode,_=Nm(s);Ch(s,_,m);break;case 5:var y=o.stateNode;o.flags&32&&(ta(y,""),o.flags&=-33);var k=Nm(s);Ch(s,k,y);break;case 3:case 4:var I=o.stateNode.containerInfo,Z=Nm(s);Pm(s,Z,I);break;default:throw Error(n(161))}}catch(re){Ct(s,s.return,re)}s.flags&=-3}r&4096&&(s.flags&=-4097)}function tS(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var r=s;tS(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),s=s.sibling}}function Rn(s,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)K0(s,r.alternate,r),r=r.sibling}function bo(s){for(s=s.child;s!==null;){var r=s;switch(r.tag){case 0:case 11:case 14:case 15:pa(4,r,r.return),bo(r);break;case 1:Kr(r,r.return);var o=r.stateNode;typeof o.componentWillUnmount=="function"&&j0(r,r.return,o),bo(r);break;case 27:$c(r.stateNode);case 26:case 5:Kr(r,r.return),bo(r);break;case 22:r.memoizedState===null&&bo(r);break;case 30:bo(r);break;default:bo(r)}s=s.sibling}}function An(s,r,o){for(o=o&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var c=r.alternate,m=s,_=r,y=_.flags;switch(_.tag){case 0:case 11:case 15:An(m,_,o),Dc(4,_);break;case 1:if(An(m,_,o),c=_,m=c.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(Z){Ct(c,c.return,Z)}if(c=_,m=c.updateQueue,m!==null){var k=c.stateNode;try{var I=m.shared.hiddenCallbacks;if(I!==null)for(m.shared.hiddenCallbacks=null,m=0;m<I.length;m++)Dv(I[m],k)}catch(Z){Ct(c,c.return,Z)}}o&&y&64&&W0(_),Oc(_,_.return);break;case 27:Y0(_);case 26:case 5:An(m,_,o),o&&c===null&&y&4&&V0(_),Oc(_,_.return);break;case 12:An(m,_,o);break;case 31:An(m,_,o),o&&y&4&&Q0(m,_);break;case 13:An(m,_,o),o&&y&4&&J0(m,_);break;case 22:_.memoizedState===null&&An(m,_,o),Oc(_,_.return);break;case 30:break;default:An(m,_,o)}r=r.sibling}}function Hm(s,r){var o=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(o=s.memoizedState.cachePool.pool),s=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),s!==o&&(s!=null&&s.refCount++,o!=null&&Sc(o))}function Im(s,r){s=null,r.alternate!==null&&(s=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==s&&(r.refCount++,s!=null&&Sc(s))}function Pr(s,r,o,c){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)iS(s,r,o,c),r=r.sibling}function iS(s,r,o,c){var m=r.flags;switch(r.tag){case 0:case 11:case 15:Pr(s,r,o,c),m&2048&&Dc(9,r);break;case 1:Pr(s,r,o,c);break;case 3:Pr(s,r,o,c),m&2048&&(s=null,r.alternate!==null&&(s=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==s&&(r.refCount++,s!=null&&Sc(s)));break;case 12:if(m&2048){Pr(s,r,o,c),s=r.stateNode;try{var _=r.memoizedProps,y=_.id,k=_.onPostCommit;typeof k=="function"&&k(y,r.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(I){Ct(r,r.return,I)}}else Pr(s,r,o,c);break;case 31:Pr(s,r,o,c);break;case 13:Pr(s,r,o,c);break;case 23:break;case 22:_=r.stateNode,y=r.alternate,r.memoizedState!==null?_._visibility&2?Pr(s,r,o,c):Bc(s,r):_._visibility&2?Pr(s,r,o,c):(_._visibility|=2,vl(s,r,o,c,(r.subtreeFlags&10256)!==0||!1)),m&2048&&Hm(y,r);break;case 24:Pr(s,r,o,c),m&2048&&Im(r.alternate,r);break;default:Pr(s,r,o,c)}}function vl(s,r,o,c,m){for(m=m&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var _=s,y=r,k=o,I=c,Z=y.flags;switch(y.tag){case 0:case 11:case 15:vl(_,y,k,I,m),Dc(8,y);break;case 23:break;case 22:var re=y.stateNode;y.memoizedState!==null?re._visibility&2?vl(_,y,k,I,m):Bc(_,y):(re._visibility|=2,vl(_,y,k,I,m)),m&&Z&2048&&Hm(y.alternate,y);break;case 24:vl(_,y,k,I,m),m&&Z&2048&&Im(y.alternate,y);break;default:vl(_,y,k,I,m)}r=r.sibling}}function Bc(s,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var o=s,c=r,m=c.flags;switch(c.tag){case 22:Bc(o,c),m&2048&&Hm(c.alternate,c);break;case 24:Bc(o,c),m&2048&&Im(c.alternate,c);break;default:Bc(o,c)}r=r.sibling}}var Nc=8192;function Sl(s,r,o){if(s.subtreeFlags&Nc)for(s=s.child;s!==null;)sS(s,r,o),s=s.sibling}function sS(s,r,o){switch(s.tag){case 26:Sl(s,r,o),s.flags&Nc&&s.memoizedState!==null&&e2(o,Nr,s.memoizedState,s.memoizedProps);break;case 5:Sl(s,r,o);break;case 3:case 4:var c=Nr;Nr=Hh(s.stateNode.containerInfo),Sl(s,r,o),Nr=c;break;case 22:s.memoizedState===null&&(c=s.alternate,c!==null&&c.memoizedState!==null?(c=Nc,Nc=16777216,Sl(s,r,o),Nc=c):Sl(s,r,o));break;default:Sl(s,r,o)}}function rS(s){var r=s.alternate;if(r!==null&&(s=r.child,s!==null)){r.child=null;do r=s.sibling,s.sibling=null,s=r;while(s!==null)}}function Pc(s){var r=s.deletions;if((s.flags&16)!==0){if(r!==null)for(var o=0;o<r.length;o++){var c=r[o];Mi=c,aS(c,s)}rS(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)nS(s),s=s.sibling}function nS(s){switch(s.tag){case 0:case 11:case 15:Pc(s),s.flags&2048&&pa(9,s,s.return);break;case 3:Pc(s);break;case 12:Pc(s);break;case 22:var r=s.stateNode;s.memoizedState!==null&&r._visibility&2&&(s.return===null||s.return.tag!==13)?(r._visibility&=-3,kh(s)):Pc(s);break;default:Pc(s)}}function kh(s){var r=s.deletions;if((s.flags&16)!==0){if(r!==null)for(var o=0;o<r.length;o++){var c=r[o];Mi=c,aS(c,s)}rS(s)}for(s=s.child;s!==null;){switch(r=s,r.tag){case 0:case 11:case 15:pa(8,r,r.return),kh(r);break;case 22:o=r.stateNode,o._visibility&2&&(o._visibility&=-3,kh(r));break;default:kh(r)}s=s.sibling}}function aS(s,r){for(;Mi!==null;){var o=Mi;switch(o.tag){case 0:case 11:case 15:pa(8,o,r);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var c=o.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Sc(o.memoizedState.cache)}if(c=o.child,c!==null)c.return=o,Mi=c;else e:for(o=s;Mi!==null;){c=Mi;var m=c.sibling,_=c.return;if(X0(c),c===o){Mi=null;break e}if(m!==null){m.return=_,Mi=m;break e}Mi=_}}}var _5={getCacheForType:function(s){var r=Yi(hi),o=r.data.get(s);return o===void 0&&(o=s(),r.data.set(s,o)),o},cacheSignal:function(){return Yi(hi).controller.signal}},p5=typeof WeakMap=="function"?WeakMap:Map,vt=0,Ot=null,ot=null,ct=0,wt=0,zs=null,ga=!1,yl=!1,Um=!1,Mn=0,Jt=0,va=0,wo=0,Fm=0,Hs=0,bl=0,zc=null,Ss=null,$m=!1,Eh=0,oS=0,Th=1/0,Rh=null,Sa=null,bi=0,ya=null,wl=null,Ln=0,Wm=0,jm=null,lS=null,Hc=0,Vm=null;function Is(){return(vt&2)!==0&&ct!==0?ct&-ct:T.T!==null?Zm():ft()}function cS(){if(Hs===0)if((ct&536870912)===0||ht){var s=kt;kt<<=1,(kt&3932160)===0&&(kt=262144),Hs=s}else Hs=536870912;return s=Ns.current,s!==null&&(s.flags|=32),Hs}function ys(s,r,o){(s===Ot&&(wt===2||wt===9)||s.cancelPendingCommit!==null)&&(Cl(s,0),ba(s,ct,Hs,!1)),Ut(s,o),((vt&2)===0||s!==Ot)&&(s===Ot&&((vt&2)===0&&(wo|=o),Jt===4&&ba(s,ct,Hs,!1)),Xr(s))}function uS(s,r,o){if((vt&6)!==0)throw Error(n(327));var c=!o&&(r&127)===0&&(r&s.expiredLanes)===0||Er(s,r),m=c?S5(s,r):Ym(s,r,!0),_=c;do{if(m===0){yl&&!c&&ba(s,r,0,!1);break}else{if(o=s.current.alternate,_&&!g5(o)){m=Ym(s,r,!1),_=!1;continue}if(m===2){if(_=r,s.errorRecoveryDisabledLanes&_)var y=0;else y=s.pendingLanes&-536870913,y=y!==0?y:y&536870912?536870912:0;if(y!==0){r=y;e:{var k=s;m=zc;var I=k.current.memoizedState.isDehydrated;if(I&&(Cl(k,y).flags|=256),y=Ym(k,y,!1),y!==2){if(Um&&!I){k.errorRecoveryDisabledLanes|=_,wo|=_,m=4;break e}_=Ss,Ss=m,_!==null&&(Ss===null?Ss=_:Ss.push.apply(Ss,_))}m=y}if(_=!1,m!==2)continue}}if(m===1){Cl(s,0),ba(s,r,0,!0);break}e:{switch(c=s,_=m,_){case 0:case 1:throw Error(n(345));case 4:if((r&4194048)!==r)break;case 6:ba(c,r,Hs,!ga);break e;case 2:Ss=null;break;case 3:case 5:break;default:throw Error(n(329))}if((r&62914560)===r&&(m=Eh+300-Qe(),10<m)){if(ba(c,r,Hs,!ga),Rs(c,0,!0)!==0)break e;Ln=r,c.timeoutHandle=FS(hS.bind(null,c,o,Ss,Rh,$m,r,Hs,wo,bl,ga,_,"Throttled",-0,0),m);break e}hS(c,o,Ss,Rh,$m,r,Hs,wo,bl,ga,_,null,-0,0)}}break}while(!0);Xr(s)}function hS(s,r,o,c,m,_,y,k,I,Z,re,oe,J,te){if(s.timeoutHandle=-1,oe=r.subtreeFlags,oe&8192||(oe&16785408)===16785408){oe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ri},sS(r,_,oe);var ke=(_&62914560)===_?Eh-Qe():(_&4194048)===_?oS-Qe():0;if(ke=t2(oe,ke),ke!==null){Ln=_,s.cancelPendingCommit=ke(SS.bind(null,s,r,_,o,c,m,y,k,I,re,oe,null,J,te)),ba(s,_,y,!Z);return}}SS(s,r,_,o,c,m,y,k,I)}function g5(s){for(var r=s;;){var o=r.tag;if((o===0||o===11||o===15)&&r.flags&16384&&(o=r.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var c=0;c<o.length;c++){var m=o[c],_=m.getSnapshot;m=m.value;try{if(!yi(_(),m))return!1}catch{return!1}}if(o=r.child,r.subtreeFlags&16384&&o!==null)o.return=r,r=o;else{if(r===s)break;for(;r.sibling===null;){if(r.return===null||r.return===s)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function ba(s,r,o,c){r&=~Fm,r&=~wo,s.suspendedLanes|=r,s.pingedLanes&=~r,c&&(s.warmLanes|=r),c=s.expirationTimes;for(var m=r;0<m;){var _=31-Mt(m),y=1<<_;c[_]=-1,m&=~y}o!==0&&Lt(s,o,r)}function Ah(){return(vt&6)===0?(Ic(0),!1):!0}function qm(){if(ot!==null){if(wt===0)var s=ot.return;else s=ot,yn=fo=null,lm(s),fl=null,bc=0,s=ot;for(;s!==null;)$0(s.alternate,s),s=s.return;ot=null}}function Cl(s,r){var o=s.timeoutHandle;o!==-1&&(s.timeoutHandle=-1,z5(o)),o=s.cancelPendingCommit,o!==null&&(s.cancelPendingCommit=null,o()),Ln=0,qm(),Ot=s,ot=o=vn(s.current,null),ct=r,wt=0,zs=null,ga=!1,yl=Er(s,r),Um=!1,bl=Hs=Fm=wo=va=Jt=0,Ss=zc=null,$m=!1,(r&8)!==0&&(r|=r&32);var c=s.entangledLanes;if(c!==0)for(s=s.entanglements,c&=r;0<c;){var m=31-Mt(c),_=1<<m;r|=s[m],c&=~_}return Mn=r,Xu(),o}function dS(s,r){Xe=null,T.H=Ac,r===dl||r===rh?(r=Rv(),wt=3):r===Xf?(r=Rv(),wt=4):wt=r===xm?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,zs=r,ot===null&&(Jt=1,vh(s,lr(r,s.current)))}function fS(){var s=Ns.current;return s===null?!0:(ct&4194048)===ct?dr===null:(ct&62914560)===ct||(ct&536870912)!==0?s===dr:!1}function mS(){var s=T.H;return T.H=Ac,s===null?Ac:s}function _S(){var s=T.A;return T.A=_5,s}function Mh(){Jt=4,ga||(ct&4194048)!==ct&&Ns.current!==null||(yl=!0),(va&134217727)===0&&(wo&134217727)===0||Ot===null||ba(Ot,ct,Hs,!1)}function Ym(s,r,o){var c=vt;vt|=2;var m=mS(),_=_S();(Ot!==s||ct!==r)&&(Rh=null,Cl(s,r)),r=!1;var y=Jt;e:do try{if(wt!==0&&ot!==null){var k=ot,I=zs;switch(wt){case 8:qm(),y=6;break e;case 3:case 2:case 9:case 6:Ns.current===null&&(r=!0);var Z=wt;if(wt=0,zs=null,xl(s,k,I,Z),o&&yl){y=0;break e}break;default:Z=wt,wt=0,zs=null,xl(s,k,I,Z)}}v5(),y=Jt;break}catch(re){dS(s,re)}while(!0);return r&&s.shellSuspendCounter++,yn=fo=null,vt=c,T.H=m,T.A=_,ot===null&&(Ot=null,ct=0,Xu()),y}function v5(){for(;ot!==null;)pS(ot)}function S5(s,r){var o=vt;vt|=2;var c=mS(),m=_S();Ot!==s||ct!==r?(Rh=null,Th=Qe()+500,Cl(s,r)):yl=Er(s,r);e:do try{if(wt!==0&&ot!==null){r=ot;var _=zs;t:switch(wt){case 1:wt=0,zs=null,xl(s,r,_,1);break;case 2:case 9:if(Ev(_)){wt=0,zs=null,gS(r);break}r=function(){wt!==2&&wt!==9||Ot!==s||(wt=7),Xr(s)},_.then(r,r);break e;case 3:wt=7;break e;case 4:wt=5;break e;case 7:Ev(_)?(wt=0,zs=null,gS(r)):(wt=0,zs=null,xl(s,r,_,7));break;case 5:var y=null;switch(ot.tag){case 26:y=ot.memoizedState;case 5:case 27:var k=ot;if(y?iy(y):k.stateNode.complete){wt=0,zs=null;var I=k.sibling;if(I!==null)ot=I;else{var Z=k.return;Z!==null?(ot=Z,Lh(Z)):ot=null}break t}}wt=0,zs=null,xl(s,r,_,5);break;case 6:wt=0,zs=null,xl(s,r,_,6);break;case 8:qm(),Jt=6;break e;default:throw Error(n(462))}}y5();break}catch(re){dS(s,re)}while(!0);return yn=fo=null,T.H=c,T.A=m,vt=o,ot!==null?0:(Ot=null,ct=0,Xu(),Jt)}function y5(){for(;ot!==null&&!Kt();)pS(ot)}function pS(s){var r=U0(s.alternate,s,Mn);s.memoizedProps=s.pendingProps,r===null?Lh(s):ot=r}function gS(s){var r=s,o=r.alternate;switch(r.tag){case 15:case 0:r=B0(o,r,r.pendingProps,r.type,void 0,ct);break;case 11:r=B0(o,r,r.pendingProps,r.type.render,r.ref,ct);break;case 5:lm(r);default:$0(o,r),r=ot=_v(r,Mn),r=U0(o,r,Mn)}s.memoizedProps=s.pendingProps,r===null?Lh(s):ot=r}function xl(s,r,o,c){yn=fo=null,lm(r),fl=null,bc=0;var m=r.return;try{if(l5(s,m,r,o,ct)){Jt=1,vh(s,lr(o,s.current)),ot=null;return}}catch(_){if(m!==null)throw ot=m,_;Jt=1,vh(s,lr(o,s.current)),ot=null;return}r.flags&32768?(ht||c===1?s=!0:yl||(ct&536870912)!==0?s=!1:(ga=s=!0,(c===2||c===9||c===3||c===6)&&(c=Ns.current,c!==null&&c.tag===13&&(c.flags|=16384))),vS(r,s)):Lh(r)}function Lh(s){var r=s;do{if((r.flags&32768)!==0){vS(r,ga);return}s=r.return;var o=h5(r.alternate,r,Mn);if(o!==null){ot=o;return}if(r=r.sibling,r!==null){ot=r;return}ot=r=s}while(r!==null);Jt===0&&(Jt=5)}function vS(s,r){do{var o=d5(s.alternate,s);if(o!==null){o.flags&=32767,ot=o;return}if(o=s.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!r&&(s=s.sibling,s!==null)){ot=s;return}ot=s=o}while(s!==null);Jt=6,ot=null}function SS(s,r,o,c,m,_,y,k,I){s.cancelPendingCommit=null;do Dh();while(bi!==0);if((vt&6)!==0)throw Error(n(327));if(r!==null){if(r===s.current)throw Error(n(177));if(_=r.lanes|r.childLanes,_|=Nf,Pe(s,o,_,y,k,I),s===Ot&&(ot=Ot=null,ct=0),wl=r,ya=s,Ln=o,Wm=_,jm=m,lS=c,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,x5(Ts,function(){return xS(),null})):(s.callbackNode=null,s.callbackPriority=0),c=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||c){c=T.T,T.T=null,m=L.p,L.p=2,y=vt,vt|=4;try{f5(s,r,o)}finally{vt=y,L.p=m,T.T=c}}bi=1,yS(),bS(),wS()}}function yS(){if(bi===1){bi=0;var s=ya,r=wl,o=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||o){o=T.T,T.T=null;var c=L.p;L.p=2;var m=vt;vt|=4;try{eS(r,s);var _=n_,y=av(s.containerInfo),k=_.focusedElem,I=_.selectionRange;if(y!==k&&k&&k.ownerDocument&&nv(k.ownerDocument.documentElement,k)){if(I!==null&&Mf(k)){var Z=I.start,re=I.end;if(re===void 0&&(re=Z),"selectionStart"in k)k.selectionStart=Z,k.selectionEnd=Math.min(re,k.value.length);else{var oe=k.ownerDocument||document,J=oe&&oe.defaultView||window;if(J.getSelection){var te=J.getSelection(),ke=k.textContent.length,Ue=Math.min(I.start,ke),Rt=I.end===void 0?Ue:Math.min(I.end,ke);!te.extend&&Ue>Rt&&(y=Rt,Rt=Ue,Ue=y);var q=ao(k,Ue),W=ao(k,Rt);if(q&&W&&(te.rangeCount!==1||te.anchorNode!==q.node||te.anchorOffset!==q.offset||te.focusNode!==W.node||te.focusOffset!==W.offset)){var K=oe.createRange();K.setStart(q.node,q.offset),te.removeAllRanges(),Ue>Rt?(te.addRange(K),te.extend(W.node,W.offset)):(K.setEnd(W.node,W.offset),te.addRange(K))}}}}for(oe=[],te=k;te=te.parentNode;)te.nodeType===1&&oe.push({element:te,left:te.scrollLeft,top:te.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<oe.length;k++){var ne=oe[k];ne.element.scrollLeft=ne.left,ne.element.scrollTop=ne.top}}jh=!!r_,n_=r_=null}finally{vt=m,L.p=c,T.T=o}}s.current=r,bi=2}}function bS(){if(bi===2){bi=0;var s=ya,r=wl,o=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||o){o=T.T,T.T=null;var c=L.p;L.p=2;var m=vt;vt|=4;try{K0(s,r.alternate,r)}finally{vt=m,L.p=c,T.T=o}}bi=3}}function wS(){if(bi===4||bi===3){bi=0,Be();var s=ya,r=wl,o=Ln,c=lS;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?bi=5:(bi=0,wl=ya=null,CS(s,s.pendingLanes));var m=s.pendingLanes;if(m===0&&(Sa=null),Se(o),r=r.stateNode,ri&&typeof ri.onCommitFiberRoot=="function")try{ri.onCommitFiberRoot(Ys,r,void 0,(r.current.flags&128)===128)}catch{}if(c!==null){r=T.T,m=L.p,L.p=2,T.T=null;try{for(var _=s.onRecoverableError,y=0;y<c.length;y++){var k=c[y];_(k.value,{componentStack:k.stack})}}finally{T.T=r,L.p=m}}(Ln&3)!==0&&Dh(),Xr(s),m=s.pendingLanes,(o&261930)!==0&&(m&42)!==0?s===Vm?Hc++:(Hc=0,Vm=s):Hc=0,Ic(0)}}function CS(s,r){(s.pooledCacheLanes&=r)===0&&(r=s.pooledCache,r!=null&&(s.pooledCache=null,Sc(r)))}function Dh(){return yS(),bS(),wS(),xS()}function xS(){if(bi!==5)return!1;var s=ya,r=Wm;Wm=0;var o=Se(Ln),c=T.T,m=L.p;try{L.p=32>o?32:o,T.T=null,o=jm,jm=null;var _=ya,y=Ln;if(bi=0,wl=ya=null,Ln=0,(vt&6)!==0)throw Error(n(331));var k=vt;if(vt|=4,nS(_.current),iS(_,_.current,y,o),vt=k,Ic(0,!1),ri&&typeof ri.onPostCommitFiberRoot=="function")try{ri.onPostCommitFiberRoot(Ys,_)}catch{}return!0}finally{L.p=m,T.T=c,CS(s,r)}}function kS(s,r,o){r=lr(o,r),r=Cm(s.stateNode,r,2),s=fa(s,r,2),s!==null&&(Ut(s,2),Xr(s))}function Ct(s,r,o){if(s.tag===3)kS(s,s,o);else for(;r!==null;){if(r.tag===3){kS(r,s,o);break}else if(r.tag===1){var c=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Sa===null||!Sa.has(c))){s=lr(o,s),o=E0(2),c=fa(r,o,2),c!==null&&(T0(o,c,r,s),Ut(c,2),Xr(c));break}}r=r.return}}function Gm(s,r,o){var c=s.pingCache;if(c===null){c=s.pingCache=new p5;var m=new Set;c.set(r,m)}else m=c.get(r),m===void 0&&(m=new Set,c.set(r,m));m.has(o)||(Um=!0,m.add(o),s=b5.bind(null,s,r,o),r.then(s,s))}function b5(s,r,o){var c=s.pingCache;c!==null&&c.delete(r),s.pingedLanes|=s.suspendedLanes&o,s.warmLanes&=~o,Ot===s&&(ct&o)===o&&(Jt===4||Jt===3&&(ct&62914560)===ct&&300>Qe()-Eh?(vt&2)===0&&Cl(s,0):Fm|=o,bl===ct&&(bl=0)),Xr(s)}function ES(s,r){r===0&&(r=Qi()),s=co(s,r),s!==null&&(Ut(s,r),Xr(s))}function w5(s){var r=s.memoizedState,o=0;r!==null&&(o=r.retryLane),ES(s,o)}function C5(s,r){var o=0;switch(s.tag){case 31:case 13:var c=s.stateNode,m=s.memoizedState;m!==null&&(o=m.retryLane);break;case 19:c=s.stateNode;break;case 22:c=s.stateNode._retryCache;break;default:throw Error(n(314))}c!==null&&c.delete(r),ES(s,o)}function x5(s,r){return Ce(s,r)}var Oh=null,kl=null,Km=!1,Bh=!1,Xm=!1,wa=0;function Xr(s){s!==kl&&s.next===null&&(kl===null?Oh=kl=s:kl=kl.next=s),Bh=!0,Km||(Km=!0,E5())}function Ic(s,r){if(!Xm&&Bh){Xm=!0;do for(var o=!1,c=Oh;c!==null;){if(s!==0){var m=c.pendingLanes;if(m===0)var _=0;else{var y=c.suspendedLanes,k=c.pingedLanes;_=(1<<31-Mt(42|s)+1)-1,_&=m&~(y&~k),_=_&201326741?_&201326741|1:_?_|2:0}_!==0&&(o=!0,MS(c,_))}else _=ct,_=Rs(c,c===Ot?_:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(_&3)===0||Er(c,_)||(o=!0,MS(c,_));c=c.next}while(o);Xm=!1}}function k5(){TS()}function TS(){Bh=Km=!1;var s=0;wa!==0&&P5()&&(s=wa);for(var r=Qe(),o=null,c=Oh;c!==null;){var m=c.next,_=RS(c,r);_===0?(c.next=null,o===null?Oh=m:o.next=m,m===null&&(kl=o)):(o=c,(s!==0||(_&3)!==0)&&(Bh=!0)),c=m}bi!==0&&bi!==5||Ic(s),wa!==0&&(wa=0)}function RS(s,r){for(var o=s.suspendedLanes,c=s.pingedLanes,m=s.expirationTimes,_=s.pendingLanes&-62914561;0<_;){var y=31-Mt(_),k=1<<y,I=m[y];I===-1?((k&o)===0||(k&c)!==0)&&(m[y]=Zn(k,r)):I<=r&&(s.expiredLanes|=k),_&=~k}if(r=Ot,o=ct,o=Rs(s,s===r?o:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),c=s.callbackNode,o===0||s===r&&(wt===2||wt===9)||s.cancelPendingCommit!==null)return c!==null&&c!==null&&_e(c),s.callbackNode=null,s.callbackPriority=0;if((o&3)===0||Er(s,o)){if(r=o&-o,r===s.callbackPriority)return r;switch(c!==null&&_e(c),Se(o)){case 2:case 8:o=je;break;case 32:o=Ts;break;case 268435456:o=Kn;break;default:o=Ts}return c=AS.bind(null,s),o=Ce(o,c),s.callbackPriority=r,s.callbackNode=o,r}return c!==null&&c!==null&&_e(c),s.callbackPriority=2,s.callbackNode=null,2}function AS(s,r){if(bi!==0&&bi!==5)return s.callbackNode=null,s.callbackPriority=0,null;var o=s.callbackNode;if(Dh()&&s.callbackNode!==o)return null;var c=ct;return c=Rs(s,s===Ot?c:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),c===0?null:(uS(s,c,r),RS(s,Qe()),s.callbackNode!=null&&s.callbackNode===o?AS.bind(null,s):null)}function MS(s,r){if(Dh())return null;uS(s,r,!0)}function E5(){H5(function(){(vt&6)!==0?Ce(xt,k5):TS()})}function Zm(){if(wa===0){var s=ul;s===0&&(s=Ks,Ks<<=1,(Ks&261888)===0&&(Ks=256)),wa=s}return wa}function LS(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:Mr(""+s)}function DS(s,r){var o=r.ownerDocument.createElement("input");return o.name=r.name,o.value=r.value,s.id&&o.setAttribute("form",s.id),r.parentNode.insertBefore(o,r),s=new FormData(s),o.parentNode.removeChild(o),s}function T5(s,r,o,c,m){if(r==="submit"&&o&&o.stateNode===m){var _=LS((m[Ie]||null).action),y=c.submitter;y&&(r=(r=y[Ie]||null)?LS(r.formAction):y.getAttribute("formAction"),r!==null&&(_=r,y=null));var k=new Za("action","action",null,c,m);s.push({event:k,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(wa!==0){var I=y?DS(m,y):new FormData(m);gm(o,{pending:!0,data:I,method:m.method,action:_},null,I)}}else typeof _=="function"&&(k.preventDefault(),I=y?DS(m,y):new FormData(m),gm(o,{pending:!0,data:I,method:m.method,action:_},_,I))},currentTarget:m}]})}}for(var Qm=0;Qm<Bf.length;Qm++){var Jm=Bf[Qm],R5=Jm.toLowerCase(),A5=Jm[0].toUpperCase()+Jm.slice(1);Br(R5,"on"+A5)}Br(cv,"onAnimationEnd"),Br(uv,"onAnimationIteration"),Br(hv,"onAnimationStart"),Br("dblclick","onDoubleClick"),Br("focusin","onFocus"),Br("focusout","onBlur"),Br(Vx,"onTransitionRun"),Br(qx,"onTransitionStart"),Br(Yx,"onTransitionCancel"),Br(dv,"onTransitionEnd"),er("onMouseEnter",["mouseout","mouseover"]),er("onMouseLeave",["mouseout","mouseover"]),er("onPointerEnter",["pointerout","pointerover"]),er("onPointerLeave",["pointerout","pointerover"]),ms("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ms("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ms("onBeforeInput",["compositionend","keypress","textInput","paste"]),ms("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ms("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ms("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Uc="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(" "),M5=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Uc));function OS(s,r){r=(r&4)!==0;for(var o=0;o<s.length;o++){var c=s[o],m=c.event;c=c.listeners;e:{var _=void 0;if(r)for(var y=c.length-1;0<=y;y--){var k=c[y],I=k.instance,Z=k.currentTarget;if(k=k.listener,I!==_&&m.isPropagationStopped())break e;_=k,m.currentTarget=Z;try{_(m)}catch(re){Ku(re)}m.currentTarget=null,_=I}else for(y=0;y<c.length;y++){if(k=c[y],I=k.instance,Z=k.currentTarget,k=k.listener,I!==_&&m.isPropagationStopped())break e;_=k,m.currentTarget=Z;try{_(m)}catch(re){Ku(re)}m.currentTarget=null,_=I}}}}function lt(s,r){var o=r[Bt];o===void 0&&(o=r[Bt]=new Set);var c=s+"__bubble";o.has(c)||(BS(r,s,2,!1),o.add(c))}function e_(s,r,o){var c=0;r&&(c|=4),BS(o,s,c,r)}var Nh="_reactListening"+Math.random().toString(36).slice(2);function t_(s){if(!s[Nh]){s[Nh]=!0,un.forEach(function(o){o!=="selectionchange"&&(M5.has(o)||e_(o,!1,s),e_(o,!0,s))});var r=s.nodeType===9?s:s.ownerDocument;r===null||r[Nh]||(r[Nh]=!0,e_("selectionchange",!1,r))}}function BS(s,r,o,c){switch(cy(r)){case 2:var m=r2;break;case 8:m=n2;break;default:m=p_}o=m.bind(null,r,o,s),m=void 0,!Ko||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(m=!0),c?m!==void 0?s.addEventListener(r,o,{capture:!0,passive:m}):s.addEventListener(r,o,!0):m!==void 0?s.addEventListener(r,o,{passive:m}):s.addEventListener(r,o,!1)}function i_(s,r,o,c,m){var _=c;if((r&1)===0&&(r&2)===0&&c!==null)e:for(;;){if(c===null)return;var y=c.tag;if(y===3||y===4){var k=c.stateNode.containerInfo;if(k===m)break;if(y===4)for(y=c.return;y!==null;){var I=y.tag;if((I===3||I===4)&&y.stateNode.containerInfo===m)return;y=y.return}for(;k!==null;){if(y=ci(k),y===null)return;if(I=y.tag,I===5||I===6||I===26||I===27){c=_=y;continue e}k=k.parentNode}}c=c.return}sr(function(){var Z=_,re=Wr(o),oe=[];e:{var J=fv.get(s);if(J!==void 0){var te=Za,ke=s;switch(s){case"keypress":if(Xa(o)===0)break e;case"keydown":case"keyup":te=ju;break;case"focusin":ke="focus",te=eo;break;case"focusout":ke="blur",te=eo;break;case"beforeblur":case"afterblur":te=eo;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":te=St;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":te=uc;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":te=Tf;break;case cv:case uv:case hv:te=ra;break;case dv:te=Rf;break;case"scroll":case"scrollend":te=wf;break;case"wheel":te=Q;break;case"copy":case"cut":case"paste":te=dc;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":te=io;break;case"toggle":case"beforetoggle":te=fe}var Ue=(r&4)!==0,Rt=!Ue&&(s==="scroll"||s==="scrollend"),q=Ue?J!==null?J+"Capture":null:J;Ue=[];for(var W=Z,K;W!==null;){var ne=W;if(K=ne.stateNode,ne=ne.tag,ne!==5&&ne!==26&&ne!==27||K===null||q===null||(ne=Ls(W,q),ne!=null&&Ue.push(Fc(W,ne,K))),Rt)break;W=W.return}0<Ue.length&&(J=new te(J,ke,null,o,re),oe.push({event:J,listeners:Ue}))}}if((r&7)===0){e:{if(J=s==="mouseover"||s==="pointerover",te=s==="mouseout"||s==="pointerout",J&&o!==ia&&(ke=o.relatedTarget||o.fromElement)&&(ci(ke)||ke[Ft]))break e;if((te||J)&&(J=re.window===re?re:(J=re.ownerDocument)?J.defaultView||J.parentWindow:window,te?(ke=o.relatedTarget||o.toElement,te=Z,ke=ke?ci(ke):null,ke!==null&&(Rt=l(ke),Ue=ke.tag,ke!==Rt||Ue!==5&&Ue!==27&&Ue!==6)&&(ke=null)):(te=null,ke=Z),te!==ke)){if(Ue=St,ne="onMouseLeave",q="onMouseEnter",W="mouse",(s==="pointerout"||s==="pointerover")&&(Ue=io,ne="onPointerLeave",q="onPointerEnter",W="pointer"),Rt=te==null?J:ui(te),K=ke==null?J:ui(ke),J=new Ue(ne,W+"leave",te,o,re),J.target=Rt,J.relatedTarget=K,ne=null,ci(re)===Z&&(Ue=new Ue(q,W+"enter",ke,o,re),Ue.target=K,Ue.relatedTarget=Rt,ne=Ue),Rt=ne,te&&ke)t:{for(Ue=L5,q=te,W=ke,K=0,ne=q;ne;ne=Ue(ne))K++;ne=0;for(var He=W;He;He=Ue(He))ne++;for(;0<K-ne;)q=Ue(q),K--;for(;0<ne-K;)W=Ue(W),ne--;for(;K--;){if(q===W||W!==null&&q===W.alternate){Ue=q;break t}q=Ue(q),W=Ue(W)}Ue=null}else Ue=null;te!==null&&NS(oe,J,te,Ue,!1),ke!==null&&Rt!==null&&NS(oe,Rt,ke,Ue,!0)}}e:{if(J=Z?ui(Z):window,te=J.nodeName&&J.nodeName.toLowerCase(),te==="select"||te==="input"&&J.type==="file")var pt=Yu;else if(nr(J))if(so)pt=Os;else{pt=bt;var Le=Gu}else te=J.nodeName,!te||te.toLowerCase()!=="input"||J.type!=="checkbox"&&J.type!=="radio"?Z&&ac(Z.elementType)&&(pt=Yu):pt=_s;if(pt&&(pt=pt(s,Z))){Vr(oe,pt,o,re);break e}Le&&Le(s,J,Z),s==="focusout"&&Z&&J.type==="number"&&Z.memoizedProps.value!=null&&ea(J,"number",J.value)}switch(Le=Z?ui(Z):window,s){case"focusin":(nr(Le)||Le.contentEditable==="true")&&(il=Le,Lf=Z,pc=null);break;case"focusout":pc=Lf=il=null;break;case"mousedown":Df=!0;break;case"contextmenu":case"mouseup":case"dragend":Df=!1,ov(oe,o,re);break;case"selectionchange":if(jx)break;case"keydown":case"keyup":ov(oe,o,re)}var et;if(Me)e:{switch(s){case"compositionstart":var ut="onCompositionStart";break e;case"compositionend":ut="onCompositionEnd";break e;case"compositionupdate":ut="onCompositionUpdate";break e}ut=void 0}else as?Dr(s,o)&&(ut="onCompositionEnd"):s==="keydown"&&o.keyCode===229&&(ut="onCompositionStart");ut&&(Xt&&o.locale!=="ko"&&(as||ut!=="onCompositionStart"?ut==="onCompositionEnd"&&as&&(et=oc()):(Lr=re,Xo="value"in Lr?Lr.value:Lr.textContent,as=!0)),Le=Ph(Z,ut),0<Le.length&&(ut=new Jo(ut,s,null,o,re),oe.push({event:ut,listeners:Le}),et?ut.data=et:(et=ns(o),et!==null&&(ut.data=et)))),(et=Je?pn(s,o):Zt(s,o))&&(ut=Ph(Z,"onBeforeInput"),0<ut.length&&(Le=new Jo("onBeforeInput","beforeinput",null,o,re),oe.push({event:Le,listeners:ut}),Le.data=et)),T5(oe,s,Z,o,re)}OS(oe,r)})}function Fc(s,r,o){return{instance:s,listener:r,currentTarget:o}}function Ph(s,r){for(var o=r+"Capture",c=[];s!==null;){var m=s,_=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||_===null||(m=Ls(s,o),m!=null&&c.unshift(Fc(s,m,_)),m=Ls(s,r),m!=null&&c.push(Fc(s,m,_))),s.tag===3)return c;s=s.return}return[]}function L5(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function NS(s,r,o,c,m){for(var _=r._reactName,y=[];o!==null&&o!==c;){var k=o,I=k.alternate,Z=k.stateNode;if(k=k.tag,I!==null&&I===c)break;k!==5&&k!==26&&k!==27||Z===null||(I=Z,m?(Z=Ls(o,_),Z!=null&&y.unshift(Fc(o,Z,I))):m||(Z=Ls(o,_),Z!=null&&y.push(Fc(o,Z,I)))),o=o.return}y.length!==0&&s.push({event:r,listeners:y})}var D5=/\r\n?/g,O5=/\u0000|\uFFFD/g;function PS(s){return(typeof s=="string"?s:""+s).replace(D5,`
|
|
9
|
+
`).replace(O5,"")}function zS(s,r){return r=PS(r),PS(s)===r}function Tt(s,r,o,c,m,_){switch(o){case"children":typeof c=="string"?r==="body"||r==="textarea"&&c===""||ta(s,c):(typeof c=="number"||typeof c=="bigint")&&r!=="body"&&ta(s,""+c);break;case"className":hn(s,"class",c);break;case"tabIndex":hn(s,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":hn(s,o,c);break;case"style":nc(s,c,_);break;case"data":if(r!=="object"){hn(s,"data",c);break}case"src":case"href":if(c===""&&(r!=="a"||o!=="href")){s.removeAttribute(o);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){s.removeAttribute(o);break}c=Mr(""+c),s.setAttribute(o,c);break;case"action":case"formAction":if(typeof c=="function"){s.setAttribute(o,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof _=="function"&&(o==="formAction"?(r!=="input"&&Tt(s,r,"name",m.name,m,null),Tt(s,r,"formEncType",m.formEncType,m,null),Tt(s,r,"formMethod",m.formMethod,m,null),Tt(s,r,"formTarget",m.formTarget,m,null)):(Tt(s,r,"encType",m.encType,m,null),Tt(s,r,"method",m.method,m,null),Tt(s,r,"target",m.target,m,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){s.removeAttribute(o);break}c=Mr(""+c),s.setAttribute(o,c);break;case"onClick":c!=null&&(s.onclick=Ri);break;case"onScroll":c!=null&<("scroll",s);break;case"onScrollEnd":c!=null&<("scrollend",s);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(n(61));if(o=c.__html,o!=null){if(m.children!=null)throw Error(n(60));s.innerHTML=o}}break;case"multiple":s.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":s.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){s.removeAttribute("xlink:href");break}o=Mr(""+c),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?s.setAttribute(o,""+c):s.removeAttribute(o);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?s.setAttribute(o,""):s.removeAttribute(o);break;case"capture":case"download":c===!0?s.setAttribute(o,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?s.setAttribute(o,c):s.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?s.setAttribute(o,c):s.removeAttribute(o);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?s.removeAttribute(o):s.setAttribute(o,c);break;case"popover":lt("beforetoggle",s),lt("toggle",s),$r(s,"popover",c);break;case"xlinkActuate":tr(s,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":tr(s,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":tr(s,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":tr(s,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":tr(s,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":tr(s,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":tr(s,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":tr(s,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":tr(s,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":$r(s,"is",c);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=Fu.get(o)||o,$r(s,o,c))}}function s_(s,r,o,c,m,_){switch(o){case"style":nc(s,c,_);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(n(61));if(o=c.__html,o!=null){if(m.children!=null)throw Error(n(60));s.innerHTML=o}}break;case"children":typeof c=="string"?ta(s,c):(typeof c=="number"||typeof c=="bigint")&&ta(s,""+c);break;case"onScroll":c!=null&<("scroll",s);break;case"onScrollEnd":c!=null&<("scrollend",s);break;case"onClick":c!=null&&(s.onclick=Ri);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Iu.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(m=o.endsWith("Capture"),r=o.slice(2,m?o.length-7:void 0),_=s[Ie]||null,_=_!=null?_[o]:null,typeof _=="function"&&s.removeEventListener(r,_,m),typeof c=="function")){typeof _!="function"&&_!==null&&(o in s?s[o]=null:s.hasAttribute(o)&&s.removeAttribute(o)),s.addEventListener(r,c,m);break e}o in s?s[o]=c:c===!0?s.setAttribute(o,""):$r(s,o,c)}}}function Ki(s,r,o){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":lt("error",s),lt("load",s);var c=!1,m=!1,_;for(_ in o)if(o.hasOwnProperty(_)){var y=o[_];if(y!=null)switch(_){case"src":c=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(n(137,r));default:Tt(s,r,_,y,o,null)}}m&&Tt(s,r,"srcSet",o.srcSet,o,null),c&&Tt(s,r,"src",o.src,o,null);return;case"input":lt("invalid",s);var k=_=y=m=null,I=null,Z=null;for(c in o)if(o.hasOwnProperty(c)){var re=o[c];if(re!=null)switch(c){case"name":m=re;break;case"type":y=re;break;case"checked":I=re;break;case"defaultChecked":Z=re;break;case"value":_=re;break;case"defaultValue":k=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(n(137,r));break;default:Tt(s,r,c,re,o,null)}}Yo(s,_,k,I,Z,y,m,!1);return;case"select":lt("invalid",s),c=y=_=null;for(m in o)if(o.hasOwnProperty(m)&&(k=o[m],k!=null))switch(m){case"value":_=k;break;case"defaultValue":y=k;break;case"multiple":c=k;default:Tt(s,r,m,k,o,null)}r=_,o=y,s.multiple=!!c,r!=null?dn(s,!!c,r,!1):o!=null&&dn(s,!!c,o,!0);return;case"textarea":lt("invalid",s),_=m=c=null;for(y in o)if(o.hasOwnProperty(y)&&(k=o[y],k!=null))switch(y){case"value":c=k;break;case"defaultValue":m=k;break;case"children":_=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(n(91));break;default:Tt(s,r,y,k,o,null)}Ti(s,c,m,_);return;case"option":for(I in o)o.hasOwnProperty(I)&&(c=o[I],c!=null)&&(I==="selected"?s.selected=c&&typeof c!="function"&&typeof c!="symbol":Tt(s,r,I,c,o,null));return;case"dialog":lt("beforetoggle",s),lt("toggle",s),lt("cancel",s),lt("close",s);break;case"iframe":case"object":lt("load",s);break;case"video":case"audio":for(c=0;c<Uc.length;c++)lt(Uc[c],s);break;case"image":lt("error",s),lt("load",s);break;case"details":lt("toggle",s);break;case"embed":case"source":case"link":lt("error",s),lt("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Z in o)if(o.hasOwnProperty(Z)&&(c=o[Z],c!=null))switch(Z){case"children":case"dangerouslySetInnerHTML":throw Error(n(137,r));default:Tt(s,r,Z,c,o,null)}return;default:if(ac(r)){for(re in o)o.hasOwnProperty(re)&&(c=o[re],c!==void 0&&s_(s,r,re,c,o,void 0));return}}for(k in o)o.hasOwnProperty(k)&&(c=o[k],c!=null&&Tt(s,r,k,c,o,null))}function B5(s,r,o,c){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,_=null,y=null,k=null,I=null,Z=null,re=null;for(te in o){var oe=o[te];if(o.hasOwnProperty(te)&&oe!=null)switch(te){case"checked":break;case"value":break;case"defaultValue":I=oe;default:c.hasOwnProperty(te)||Tt(s,r,te,null,c,oe)}}for(var J in c){var te=c[J];if(oe=o[J],c.hasOwnProperty(J)&&(te!=null||oe!=null))switch(J){case"type":_=te;break;case"name":m=te;break;case"checked":Z=te;break;case"defaultChecked":re=te;break;case"value":y=te;break;case"defaultValue":k=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(n(137,r));break;default:te!==oe&&Tt(s,r,J,te,c,oe)}}jt(s,y,k,I,Z,re,_,m);return;case"select":te=y=k=J=null;for(_ in o)if(I=o[_],o.hasOwnProperty(_)&&I!=null)switch(_){case"value":break;case"multiple":te=I;default:c.hasOwnProperty(_)||Tt(s,r,_,null,c,I)}for(m in c)if(_=c[m],I=o[m],c.hasOwnProperty(m)&&(_!=null||I!=null))switch(m){case"value":J=_;break;case"defaultValue":k=_;break;case"multiple":y=_;default:_!==I&&Tt(s,r,m,_,c,I)}r=k,o=y,c=te,J!=null?dn(s,!!o,J,!1):!!c!=!!o&&(r!=null?dn(s,!!o,r,!0):dn(s,!!o,o?[]:"",!1));return;case"textarea":te=J=null;for(k in o)if(m=o[k],o.hasOwnProperty(k)&&m!=null&&!c.hasOwnProperty(k))switch(k){case"value":break;case"children":break;default:Tt(s,r,k,null,c,m)}for(y in c)if(m=c[y],_=o[y],c.hasOwnProperty(y)&&(m!=null||_!=null))switch(y){case"value":J=m;break;case"defaultValue":te=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(n(91));break;default:m!==_&&Tt(s,r,y,m,c,_)}Go(s,J,te);return;case"option":for(var ke in o)J=o[ke],o.hasOwnProperty(ke)&&J!=null&&!c.hasOwnProperty(ke)&&(ke==="selected"?s.selected=!1:Tt(s,r,ke,null,c,J));for(I in c)J=c[I],te=o[I],c.hasOwnProperty(I)&&J!==te&&(J!=null||te!=null)&&(I==="selected"?s.selected=J&&typeof J!="function"&&typeof J!="symbol":Tt(s,r,I,J,c,te));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ue in o)J=o[Ue],o.hasOwnProperty(Ue)&&J!=null&&!c.hasOwnProperty(Ue)&&Tt(s,r,Ue,null,c,J);for(Z in c)if(J=c[Z],te=o[Z],c.hasOwnProperty(Z)&&J!==te&&(J!=null||te!=null))switch(Z){case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(n(137,r));break;default:Tt(s,r,Z,J,c,te)}return;default:if(ac(r)){for(var Rt in o)J=o[Rt],o.hasOwnProperty(Rt)&&J!==void 0&&!c.hasOwnProperty(Rt)&&s_(s,r,Rt,void 0,c,J);for(re in c)J=c[re],te=o[re],!c.hasOwnProperty(re)||J===te||J===void 0&&te===void 0||s_(s,r,re,J,c,te);return}}for(var q in o)J=o[q],o.hasOwnProperty(q)&&J!=null&&!c.hasOwnProperty(q)&&Tt(s,r,q,null,c,J);for(oe in c)J=c[oe],te=o[oe],!c.hasOwnProperty(oe)||J===te||J==null&&te==null||Tt(s,r,oe,J,c,te)}function HS(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function N5(){if(typeof performance.getEntriesByType=="function"){for(var s=0,r=0,o=performance.getEntriesByType("resource"),c=0;c<o.length;c++){var m=o[c],_=m.transferSize,y=m.initiatorType,k=m.duration;if(_&&k&&HS(y)){for(y=0,k=m.responseEnd,c+=1;c<o.length;c++){var I=o[c],Z=I.startTime;if(Z>k)break;var re=I.transferSize,oe=I.initiatorType;re&&HS(oe)&&(I=I.responseEnd,y+=re*(I<k?1:(k-Z)/(I-Z)))}if(--c,r+=8*(_+y)/(m.duration/1e3),s++,10<s)break}}if(0<s)return r/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var r_=null,n_=null;function zh(s){return s.nodeType===9?s:s.ownerDocument}function IS(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function US(s,r){if(s===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&r==="foreignObject"?0:s}function a_(s,r){return s==="textarea"||s==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var o_=null;function P5(){var s=window.event;return s&&s.type==="popstate"?s===o_?!1:(o_=s,!0):(o_=null,!1)}var FS=typeof setTimeout=="function"?setTimeout:void 0,z5=typeof clearTimeout=="function"?clearTimeout:void 0,$S=typeof Promise=="function"?Promise:void 0,H5=typeof queueMicrotask=="function"?queueMicrotask:typeof $S<"u"?function(s){return $S.resolve(null).then(s).catch(I5)}:FS;function I5(s){setTimeout(function(){throw s})}function Ca(s){return s==="head"}function WS(s,r){var o=r,c=0;do{var m=o.nextSibling;if(s.removeChild(o),m&&m.nodeType===8)if(o=m.data,o==="/$"||o==="/&"){if(c===0){s.removeChild(m),Al(r);return}c--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")c++;else if(o==="html")$c(s.ownerDocument.documentElement);else if(o==="head"){o=s.ownerDocument.head,$c(o);for(var _=o.firstChild;_;){var y=_.nextSibling,k=_.nodeName;_[As]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&_.rel.toLowerCase()==="stylesheet"||o.removeChild(_),_=y}}else o==="body"&&$c(s.ownerDocument.body);o=m}while(o);Al(r)}function jS(s,r){var o=s;s=0;do{var c=o.nextSibling;if(o.nodeType===1?r?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(r?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),c&&c.nodeType===8)if(o=c.data,o==="/$"){if(s===0)break;s--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||s++;o=c}while(o)}function l_(s){var r=s.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var o=r;switch(r=r.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":l_(o),Rr(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}s.removeChild(o)}}function U5(s,r,o,c){for(;s.nodeType===1;){var m=o;if(s.nodeName.toLowerCase()!==r.toLowerCase()){if(!c&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(c){if(!s[As])switch(r){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(_=s.getAttribute("rel"),_==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(_!==m.rel||s.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||s.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||s.getAttribute("title")!==(m.title==null?null:m.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(_=s.getAttribute("src"),(_!==(m.src==null?null:m.src)||s.getAttribute("type")!==(m.type==null?null:m.type)||s.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&_&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(r==="input"&&s.type==="hidden"){var _=m.name==null?null:""+m.name;if(m.type==="hidden"&&s.getAttribute("name")===_)return s}else return s;if(s=fr(s.nextSibling),s===null)break}return null}function F5(s,r,o){if(r==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!o||(s=fr(s.nextSibling),s===null))return null;return s}function VS(s,r){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!r||(s=fr(s.nextSibling),s===null))return null;return s}function c_(s){return s.data==="$?"||s.data==="$~"}function u_(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function $5(s,r){var o=s.ownerDocument;if(s.data==="$~")s._reactRetry=r;else if(s.data!=="$?"||o.readyState!=="loading")r();else{var c=function(){r(),o.removeEventListener("DOMContentLoaded",c)};o.addEventListener("DOMContentLoaded",c),s._reactRetry=c}}function fr(s){for(;s!=null;s=s.nextSibling){var r=s.nodeType;if(r===1||r===3)break;if(r===8){if(r=s.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return s}var h_=null;function qS(s){s=s.nextSibling;for(var r=0;s;){if(s.nodeType===8){var o=s.data;if(o==="/$"||o==="/&"){if(r===0)return fr(s.nextSibling);r--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||r++}s=s.nextSibling}return null}function YS(s){s=s.previousSibling;for(var r=0;s;){if(s.nodeType===8){var o=s.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(r===0)return s;r--}else o!=="/$"&&o!=="/&"||r++}s=s.previousSibling}return null}function GS(s,r,o){switch(r=zh(o),s){case"html":if(s=r.documentElement,!s)throw Error(n(452));return s;case"head":if(s=r.head,!s)throw Error(n(453));return s;case"body":if(s=r.body,!s)throw Error(n(454));return s;default:throw Error(n(451))}}function $c(s){for(var r=s.attributes;r.length;)s.removeAttributeNode(r[0]);Rr(s)}var mr=new Map,KS=new Set;function Hh(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var Dn=L.d;L.d={f:W5,r:j5,D:V5,C:q5,L:Y5,m:G5,X:X5,S:K5,M:Z5};function W5(){var s=Dn.f(),r=Ah();return s||r}function j5(s){var r=fs(s);r!==null&&r.tag===5&&r.type==="form"?d0(r):Dn.r(s)}var El=typeof document>"u"?null:document;function XS(s,r,o){var c=El;if(c&&typeof r=="string"&&r){var m=Vi(r);m='link[rel="'+s+'"][href="'+m+'"]',typeof o=="string"&&(m+='[crossorigin="'+o+'"]'),KS.has(m)||(KS.add(m),s={rel:s,crossOrigin:o,href:r},c.querySelector(m)===null&&(r=c.createElement("link"),Ki(r,"link",s),be(r),c.head.appendChild(r)))}}function V5(s){Dn.D(s),XS("dns-prefetch",s,null)}function q5(s,r){Dn.C(s,r),XS("preconnect",s,r)}function Y5(s,r,o){Dn.L(s,r,o);var c=El;if(c&&s&&r){var m='link[rel="preload"][as="'+Vi(r)+'"]';r==="image"&&o&&o.imageSrcSet?(m+='[imagesrcset="'+Vi(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(m+='[imagesizes="'+Vi(o.imageSizes)+'"]')):m+='[href="'+Vi(s)+'"]';var _=m;switch(r){case"style":_=Tl(s);break;case"script":_=Rl(s)}mr.has(_)||(s=v({rel:"preload",href:r==="image"&&o&&o.imageSrcSet?void 0:s,as:r},o),mr.set(_,s),c.querySelector(m)!==null||r==="style"&&c.querySelector(Wc(_))||r==="script"&&c.querySelector(jc(_))||(r=c.createElement("link"),Ki(r,"link",s),be(r),c.head.appendChild(r)))}}function G5(s,r){Dn.m(s,r);var o=El;if(o&&s){var c=r&&typeof r.as=="string"?r.as:"script",m='link[rel="modulepreload"][as="'+Vi(c)+'"][href="'+Vi(s)+'"]',_=m;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":_=Rl(s)}if(!mr.has(_)&&(s=v({rel:"modulepreload",href:s},r),mr.set(_,s),o.querySelector(m)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(jc(_)))return}c=o.createElement("link"),Ki(c,"link",s),be(c),o.head.appendChild(c)}}}function K5(s,r,o){Dn.S(s,r,o);var c=El;if(c&&s){var m=Ei(c).hoistableStyles,_=Tl(s);r=r||"default";var y=m.get(_);if(!y){var k={loading:0,preload:null};if(y=c.querySelector(Wc(_)))k.loading=5;else{s=v({rel:"stylesheet",href:s,"data-precedence":r},o),(o=mr.get(_))&&d_(s,o);var I=y=c.createElement("link");be(I),Ki(I,"link",s),I._p=new Promise(function(Z,re){I.onload=Z,I.onerror=re}),I.addEventListener("load",function(){k.loading|=1}),I.addEventListener("error",function(){k.loading|=2}),k.loading|=4,Ih(y,r,c)}y={type:"stylesheet",instance:y,count:1,state:k},m.set(_,y)}}}function X5(s,r){Dn.X(s,r);var o=El;if(o&&s){var c=Ei(o).hoistableScripts,m=Rl(s),_=c.get(m);_||(_=o.querySelector(jc(m)),_||(s=v({src:s,async:!0},r),(r=mr.get(m))&&f_(s,r),_=o.createElement("script"),be(_),Ki(_,"link",s),o.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},c.set(m,_))}}function Z5(s,r){Dn.M(s,r);var o=El;if(o&&s){var c=Ei(o).hoistableScripts,m=Rl(s),_=c.get(m);_||(_=o.querySelector(jc(m)),_||(s=v({src:s,async:!0,type:"module"},r),(r=mr.get(m))&&f_(s,r),_=o.createElement("script"),be(_),Ki(_,"link",s),o.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},c.set(m,_))}}function ZS(s,r,o,c){var m=(m=ue.current)?Hh(m):null;if(!m)throw Error(n(446));switch(s){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(r=Tl(o.href),o=Ei(m).hoistableStyles,c=o.get(r),c||(c={type:"style",instance:null,count:0,state:null},o.set(r,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){s=Tl(o.href);var _=Ei(m).hoistableStyles,y=_.get(s);if(y||(m=m.ownerDocument||m,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},_.set(s,y),(_=m.querySelector(Wc(s)))&&!_._p&&(y.instance=_,y.state.loading=5),mr.has(s)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},mr.set(s,o),_||Q5(m,s,o,y.state))),r&&c===null)throw Error(n(528,""));return y}if(r&&c!==null)throw Error(n(529,""));return null;case"script":return r=o.async,o=o.src,typeof o=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Rl(o),o=Ei(m).hoistableScripts,c=o.get(r),c||(c={type:"script",instance:null,count:0,state:null},o.set(r,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(n(444,s))}}function Tl(s){return'href="'+Vi(s)+'"'}function Wc(s){return'link[rel="stylesheet"]['+s+"]"}function QS(s){return v({},s,{"data-precedence":s.precedence,precedence:null})}function Q5(s,r,o,c){s.querySelector('link[rel="preload"][as="style"]['+r+"]")?c.loading=1:(r=s.createElement("link"),c.preload=r,r.addEventListener("load",function(){return c.loading|=1}),r.addEventListener("error",function(){return c.loading|=2}),Ki(r,"link",o),be(r),s.head.appendChild(r))}function Rl(s){return'[src="'+Vi(s)+'"]'}function jc(s){return"script[async]"+s}function JS(s,r,o){if(r.count++,r.instance===null)switch(r.type){case"style":var c=s.querySelector('style[data-href~="'+Vi(o.href)+'"]');if(c)return r.instance=c,be(c),c;var m=v({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return c=(s.ownerDocument||s).createElement("style"),be(c),Ki(c,"style",m),Ih(c,o.precedence,s),r.instance=c;case"stylesheet":m=Tl(o.href);var _=s.querySelector(Wc(m));if(_)return r.state.loading|=4,r.instance=_,be(_),_;c=QS(o),(m=mr.get(m))&&d_(c,m),_=(s.ownerDocument||s).createElement("link"),be(_);var y=_;return y._p=new Promise(function(k,I){y.onload=k,y.onerror=I}),Ki(_,"link",c),r.state.loading|=4,Ih(_,o.precedence,s),r.instance=_;case"script":return _=Rl(o.src),(m=s.querySelector(jc(_)))?(r.instance=m,be(m),m):(c=o,(m=mr.get(_))&&(c=v({},o),f_(c,m)),s=s.ownerDocument||s,m=s.createElement("script"),be(m),Ki(m,"link",c),s.head.appendChild(m),r.instance=m);case"void":return null;default:throw Error(n(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(c=r.instance,r.state.loading|=4,Ih(c,o.precedence,s));return r.instance}function Ih(s,r,o){for(var c=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=c.length?c[c.length-1]:null,_=m,y=0;y<c.length;y++){var k=c[y];if(k.dataset.precedence===r)_=k;else if(_!==m)break}_?_.parentNode.insertBefore(s,_.nextSibling):(r=o.nodeType===9?o.head:o,r.insertBefore(s,r.firstChild))}function d_(s,r){s.crossOrigin==null&&(s.crossOrigin=r.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=r.referrerPolicy),s.title==null&&(s.title=r.title)}function f_(s,r){s.crossOrigin==null&&(s.crossOrigin=r.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=r.referrerPolicy),s.integrity==null&&(s.integrity=r.integrity)}var Uh=null;function ey(s,r,o){if(Uh===null){var c=new Map,m=Uh=new Map;m.set(o,c)}else m=Uh,c=m.get(o),c||(c=new Map,m.set(o,c));if(c.has(s))return c;for(c.set(s,null),o=o.getElementsByTagName(s),m=0;m<o.length;m++){var _=o[m];if(!(_[As]||_[Ee]||s==="link"&&_.getAttribute("rel")==="stylesheet")&&_.namespaceURI!=="http://www.w3.org/2000/svg"){var y=_.getAttribute(r)||"";y=s+y;var k=c.get(y);k?k.push(_):c.set(y,[_])}}return c}function ty(s,r,o){s=s.ownerDocument||s,s.head.insertBefore(o,r==="title"?s.querySelector("head > title"):null)}function J5(s,r,o){if(o===1||r.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;return r.rel==="stylesheet"?(s=r.disabled,typeof r.precedence=="string"&&s==null):!0;case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function iy(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function e2(s,r,o,c){if(o.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var m=Tl(c.href),_=r.querySelector(Wc(m));if(_){r=_._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(s.count++,s=Fh.bind(s),r.then(s,s)),o.state.loading|=4,o.instance=_,be(_);return}_=r.ownerDocument||r,c=QS(c),(m=mr.get(m))&&d_(c,m),_=_.createElement("link"),be(_);var y=_;y._p=new Promise(function(k,I){y.onload=k,y.onerror=I}),Ki(_,"link",c),o.instance=_}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(o,r),(r=o.state.preload)&&(o.state.loading&3)===0&&(s.count++,o=Fh.bind(s),r.addEventListener("load",o),r.addEventListener("error",o))}}var m_=0;function t2(s,r){return s.stylesheets&&s.count===0&&Wh(s,s.stylesheets),0<s.count||0<s.imgCount?function(o){var c=setTimeout(function(){if(s.stylesheets&&Wh(s,s.stylesheets),s.unsuspend){var _=s.unsuspend;s.unsuspend=null,_()}},6e4+r);0<s.imgBytes&&m_===0&&(m_=62500*N5());var m=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&Wh(s,s.stylesheets),s.unsuspend)){var _=s.unsuspend;s.unsuspend=null,_()}},(s.imgBytes>m_?50:800)+r);return s.unsuspend=o,function(){s.unsuspend=null,clearTimeout(c),clearTimeout(m)}}:null}function Fh(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Wh(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var $h=null;function Wh(s,r){s.stylesheets=null,s.unsuspend!==null&&(s.count++,$h=new Map,r.forEach(i2,s),$h=null,Fh.call(s))}function i2(s,r){if(!(r.state.loading&4)){var o=$h.get(s);if(o)var c=o.get(null);else{o=new Map,$h.set(s,o);for(var m=s.querySelectorAll("link[data-precedence],style[data-precedence]"),_=0;_<m.length;_++){var y=m[_];(y.nodeName==="LINK"||y.getAttribute("media")!=="not all")&&(o.set(y.dataset.precedence,y),c=y)}c&&o.set(null,c)}m=r.instance,y=m.getAttribute("data-precedence"),_=o.get(y)||c,_===c&&o.set(null,m),o.set(y,m),this.count++,c=Fh.bind(this),m.addEventListener("load",c),m.addEventListener("error",c),_?_.parentNode.insertBefore(m,_.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(m,s.firstChild)),r.state.loading|=4}}var Vc={$$typeof:B,Provider:null,Consumer:null,_currentValue:H,_currentValue2:H,_threadCount:0};function s2(s,r,o,c,m,_,y,k,I){this.tag=1,this.containerInfo=s,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Xs(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xs(0),this.hiddenUpdates=Xs(null),this.identifierPrefix=c,this.onUncaughtError=m,this.onCaughtError=_,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=I,this.incompleteTransitions=new Map}function sy(s,r,o,c,m,_,y,k,I,Z,re,oe){return s=new s2(s,r,o,y,I,Z,re,oe,k),r=1,_===!0&&(r|=24),_=Bs(3,null,null,r),s.current=_,_.stateNode=s,r=Yf(),r.refCount++,s.pooledCache=r,r.refCount++,_.memoizedState={element:c,isDehydrated:o,cache:r},Zf(_),s}function ry(s){return s?(s=nl,s):nl}function ny(s,r,o,c,m,_){m=ry(m),c.context===null?c.context=m:c.pendingContext=m,c=da(r),c.payload={element:o},_=_===void 0?null:_,_!==null&&(c.callback=_),o=fa(s,c,r),o!==null&&(ys(o,s,r),Cc(o,s,r))}function ay(s,r){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var o=s.retryLane;s.retryLane=o!==0&&o<r?o:r}}function __(s,r){ay(s,r),(s=s.alternate)&&ay(s,r)}function oy(s){if(s.tag===13||s.tag===31){var r=co(s,67108864);r!==null&&ys(r,s,67108864),__(s,67108864)}}function ly(s){if(s.tag===13||s.tag===31){var r=Is();r=ji(r);var o=co(s,r);o!==null&&ys(o,s,r),__(s,r)}}var jh=!0;function r2(s,r,o,c){var m=T.T;T.T=null;var _=L.p;try{L.p=2,p_(s,r,o,c)}finally{L.p=_,T.T=m}}function n2(s,r,o,c){var m=T.T;T.T=null;var _=L.p;try{L.p=8,p_(s,r,o,c)}finally{L.p=_,T.T=m}}function p_(s,r,o,c){if(jh){var m=g_(c);if(m===null)i_(s,r,c,Vh,o),uy(s,c);else if(o2(m,s,r,o,c))c.stopPropagation();else if(uy(s,c),r&4&&-1<a2.indexOf(s)){for(;m!==null;){var _=fs(m);if(_!==null)switch(_.tag){case 3:if(_=_.stateNode,_.current.memoizedState.isDehydrated){var y=Wi(_.pendingLanes);if(y!==0){var k=_;for(k.pendingLanes|=2,k.entangledLanes|=2;y;){var I=1<<31-Mt(y);k.entanglements[1]|=I,y&=~I}Xr(_),(vt&6)===0&&(Th=Qe()+500,Ic(0))}}break;case 31:case 13:k=co(_,2),k!==null&&ys(k,_,2),Ah(),__(_,2)}if(_=g_(c),_===null&&i_(s,r,c,Vh,o),_===m)break;m=_}m!==null&&c.stopPropagation()}else i_(s,r,c,null,o)}}function g_(s){return s=Wr(s),v_(s)}var Vh=null;function v_(s){if(Vh=null,s=ci(s),s!==null){var r=l(s);if(r===null)s=null;else{var o=r.tag;if(o===13){if(s=u(r),s!==null)return s;s=null}else if(o===31){if(s=h(r),s!==null)return s;s=null}else if(o===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;s=null}else r!==s&&(s=null)}}return Vh=s,null}function cy(s){switch(s){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ye()){case xt:return 2;case je:return 8;case Ts:case ss:return 32;case Kn:return 268435456;default:return 32}default:return 32}}var S_=!1,xa=null,ka=null,Ea=null,qc=new Map,Yc=new Map,Ta=[],a2="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 uy(s,r){switch(s){case"focusin":case"focusout":xa=null;break;case"dragenter":case"dragleave":ka=null;break;case"mouseover":case"mouseout":Ea=null;break;case"pointerover":case"pointerout":qc.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Yc.delete(r.pointerId)}}function Gc(s,r,o,c,m,_){return s===null||s.nativeEvent!==_?(s={blockedOn:r,domEventName:o,eventSystemFlags:c,nativeEvent:_,targetContainers:[m]},r!==null&&(r=fs(r),r!==null&&oy(r)),s):(s.eventSystemFlags|=c,r=s.targetContainers,m!==null&&r.indexOf(m)===-1&&r.push(m),s)}function o2(s,r,o,c,m){switch(r){case"focusin":return xa=Gc(xa,s,r,o,c,m),!0;case"dragenter":return ka=Gc(ka,s,r,o,c,m),!0;case"mouseover":return Ea=Gc(Ea,s,r,o,c,m),!0;case"pointerover":var _=m.pointerId;return qc.set(_,Gc(qc.get(_)||null,s,r,o,c,m)),!0;case"gotpointercapture":return _=m.pointerId,Yc.set(_,Gc(Yc.get(_)||null,s,r,o,c,m)),!0}return!1}function hy(s){var r=ci(s.target);if(r!==null){var o=l(r);if(o!==null){if(r=o.tag,r===13){if(r=u(o),r!==null){s.blockedOn=r,Ke(s.priority,function(){ly(o)});return}}else if(r===31){if(r=h(o),r!==null){s.blockedOn=r,Ke(s.priority,function(){ly(o)});return}}else if(r===3&&o.stateNode.current.memoizedState.isDehydrated){s.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}s.blockedOn=null}function qh(s){if(s.blockedOn!==null)return!1;for(var r=s.targetContainers;0<r.length;){var o=g_(s.nativeEvent);if(o===null){o=s.nativeEvent;var c=new o.constructor(o.type,o);ia=c,o.target.dispatchEvent(c),ia=null}else return r=fs(o),r!==null&&oy(r),s.blockedOn=o,!1;r.shift()}return!0}function dy(s,r,o){qh(s)&&o.delete(r)}function l2(){S_=!1,xa!==null&&qh(xa)&&(xa=null),ka!==null&&qh(ka)&&(ka=null),Ea!==null&&qh(Ea)&&(Ea=null),qc.forEach(dy),Yc.forEach(dy)}function Yh(s,r){s.blockedOn===r&&(s.blockedOn=null,S_||(S_=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,l2)))}var Gh=null;function fy(s){Gh!==s&&(Gh=s,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Gh===s&&(Gh=null);for(var r=0;r<s.length;r+=3){var o=s[r],c=s[r+1],m=s[r+2];if(typeof c!="function"){if(v_(c||o)===null)continue;break}var _=fs(o);_!==null&&(s.splice(r,3),r-=3,gm(_,{pending:!0,data:m,method:o.method,action:c},c,m))}}))}function Al(s){function r(I){return Yh(I,s)}xa!==null&&Yh(xa,s),ka!==null&&Yh(ka,s),Ea!==null&&Yh(Ea,s),qc.forEach(r),Yc.forEach(r);for(var o=0;o<Ta.length;o++){var c=Ta[o];c.blockedOn===s&&(c.blockedOn=null)}for(;0<Ta.length&&(o=Ta[0],o.blockedOn===null);)hy(o),o.blockedOn===null&&Ta.shift();if(o=(s.ownerDocument||s).$$reactFormReplay,o!=null)for(c=0;c<o.length;c+=3){var m=o[c],_=o[c+1],y=m[Ie]||null;if(typeof _=="function")y||fy(o);else if(y){var k=null;if(_&&_.hasAttribute("formAction")){if(m=_,y=_[Ie]||null)k=y.formAction;else if(v_(m)!==null)continue}else k=y.action;typeof k=="function"?o[c+1]=k:(o.splice(c,3),c-=3),fy(o)}}}function my(){function s(_){_.canIntercept&&_.info==="react-transition"&&_.intercept({handler:function(){return new Promise(function(y){return m=y})},focusReset:"manual",scroll:"manual"})}function r(){m!==null&&(m(),m=null),c||setTimeout(o,20)}function o(){if(!c&&!navigation.transition){var _=navigation.currentEntry;_&&_.url!=null&&navigation.navigate(_.url,{state:_.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,m=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(o,100),function(){c=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),m!==null&&(m(),m=null)}}}function y_(s){this._internalRoot=s}Kh.prototype.render=y_.prototype.render=function(s){var r=this._internalRoot;if(r===null)throw Error(n(409));var o=r.current,c=Is();ny(o,c,s,r,null,null)},Kh.prototype.unmount=y_.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var r=s.containerInfo;ny(s.current,2,null,s,null,null),Ah(),r[Ft]=null}};function Kh(s){this._internalRoot=s}Kh.prototype.unstable_scheduleHydration=function(s){if(s){var r=ft();s={blockedOn:null,target:s,priority:r};for(var o=0;o<Ta.length&&r!==0&&r<Ta[o].priority;o++);Ta.splice(o,0,s),o===0&&hy(s)}};var _y=e.version;if(_y!=="19.2.3")throw Error(n(527,_y,"19.2.3"));L.findDOMNode=function(s){var r=s._reactInternals;if(r===void 0)throw typeof s.render=="function"?Error(n(188)):(s=Object.keys(s).join(","),Error(n(268,s)));return s=d(r),s=s!==null?p(s):null,s=s===null?null:s.stateNode,s};var c2={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:T,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Xh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xh.isDisabled&&Xh.supportsFiber)try{Ys=Xh.inject(c2),ri=Xh}catch{}}return Xc.createRoot=function(s,r){if(!a(s))throw Error(n(299));var o=!1,c="",m=w0,_=C0,y=x0;return r!=null&&(r.unstable_strictMode===!0&&(o=!0),r.identifierPrefix!==void 0&&(c=r.identifierPrefix),r.onUncaughtError!==void 0&&(m=r.onUncaughtError),r.onCaughtError!==void 0&&(_=r.onCaughtError),r.onRecoverableError!==void 0&&(y=r.onRecoverableError)),r=sy(s,1,!1,null,null,o,c,null,m,_,y,my),s[Ft]=r.current,t_(s),new y_(r)},Xc.hydrateRoot=function(s,r,o){if(!a(s))throw Error(n(299));var c=!1,m="",_=w0,y=C0,k=x0,I=null;return o!=null&&(o.unstable_strictMode===!0&&(c=!0),o.identifierPrefix!==void 0&&(m=o.identifierPrefix),o.onUncaughtError!==void 0&&(_=o.onUncaughtError),o.onCaughtError!==void 0&&(y=o.onCaughtError),o.onRecoverableError!==void 0&&(k=o.onRecoverableError),o.formState!==void 0&&(I=o.formState)),r=sy(s,1,!0,r,o??null,c,m,I,_,y,k,my),r.context=ry(null),o=r.current,c=Is(),c=ji(c),m=da(c),m.callback=null,fa(o,m,c),o=c,r.current.lanes=o,Ut(r,o),Xr(r),s[Ft]=r.current,t_(s),new Kh(r)},Xc.version="19.2.3",Xc}var ky;function S2(){if(ky)return w_.exports;ky=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),w_.exports=v2(),w_.exports}var y2=S2();const wp=new WeakMap,b2=new WeakMap,Bd={current:[]};let T_=!1,bu=0;const mu=new Set,Zh=new Map;function X1(t){for(const e of t){if(Bd.current.includes(e))continue;Bd.current.push(e),e.recompute();const i=b2.get(e);if(i)for(const n of i){const a=wp.get(n);a?.length&&X1(a)}}}function w2(t){const e={prevVal:t.prevState,currentVal:t.state};for(const i of t.listeners)i(e)}function C2(t){const e={prevVal:t.prevState,currentVal:t.state};for(const i of t.listeners)i(e)}function Z1(t){if(bu>0&&!Zh.has(t)&&Zh.set(t,t.prevState),mu.add(t),!(bu>0)&&!T_)try{for(T_=!0;mu.size>0;){const e=Array.from(mu);mu.clear();for(const i of e){const n=Zh.get(i)??i.prevState;i.prevState=n,w2(i)}for(const i of e){const n=wp.get(i);n&&(Bd.current.push(i),X1(n))}for(const i of e){const n=wp.get(i);if(n)for(const a of n)C2(a)}}}finally{T_=!1,Bd.current=[],Zh.clear()}}function wu(t){bu++;try{t()}finally{if(bu--,bu===0){const e=mu.values().next().value;e&&Z1(e)}}}function x2(t){return typeof t=="function"}class k2{constructor(e,i){this.listeners=new Set,this.subscribe=n=>{var a,l;this.listeners.add(n);const u=(l=(a=this.options)==null?void 0:a.onSubscribe)==null?void 0:l.call(a,n,this);return()=>{this.listeners.delete(n),u?.()}},this.prevState=e,this.state=e,this.options=i}setState(e){var i,n,a;this.prevState=this.state,(i=this.options)!=null&&i.updateFn?this.state=this.options.updateFn(this.prevState)(e):x2(e)?this.state=e(this.prevState):this.state=e,(a=(n=this.options)==null?void 0:n.onUpdate)==null||a.call(n),Z1(this)}}const ja="__TSR_index",Ey="popstate",Ty="beforeunload";function E2(t){let e=t.getLocation();const i=new Set,n=u=>{e=t.getLocation(),i.forEach(h=>h({location:e,action:u}))},a=u=>{t.notifyOnIndexChange??!0?n(u):e=t.getLocation()},l=async({task:u,navigateOpts:h,...f})=>{if(h?.ignoreBlocker??!1){u();return}const p=t.getBlockers?.()??[],v=f.type==="PUSH"||f.type==="REPLACE";if(typeof document<"u"&&p.length&&v)for(const g of p){const S=Nd(f.path,f.state);if(await g.blockerFn({currentLocation:e,nextLocation:S,action:f.type})){t.onBlocked?.();return}}u()};return{get location(){return e},get length(){return t.getLength()},subscribers:i,subscribe:u=>(i.add(u),()=>{i.delete(u)}),push:(u,h,f)=>{const d=e.state[ja];h=Ry(d+1,h),l({task:()=>{t.pushState(u,h),n({type:"PUSH"})},navigateOpts:f,type:"PUSH",path:u,state:h})},replace:(u,h,f)=>{const d=e.state[ja];h=Ry(d,h),l({task:()=>{t.replaceState(u,h),n({type:"REPLACE"})},navigateOpts:f,type:"REPLACE",path:u,state:h})},go:(u,h)=>{l({task:()=>{t.go(u),a({type:"GO",index:u})},navigateOpts:h,type:"GO"})},back:u=>{l({task:()=>{t.back(u?.ignoreBlocker??!1),a({type:"BACK"})},navigateOpts:u,type:"BACK"})},forward:u=>{l({task:()=>{t.forward(u?.ignoreBlocker??!1),a({type:"FORWARD"})},navigateOpts:u,type:"FORWARD"})},canGoBack:()=>e.state[ja]!==0,createHref:u=>t.createHref(u),block:u=>{if(!t.setBlockers)return()=>{};const h=t.getBlockers?.()??[];return t.setBlockers([...h,u]),()=>{const f=t.getBlockers?.()??[];t.setBlockers?.(f.filter(d=>d!==u))}},flush:()=>t.flush?.(),destroy:()=>t.destroy?.(),notify:n}}function Ry(t,e){e||(e={});const i=Tg();return{...e,key:i,__TSR_key:i,[ja]:t}}function T2(t){const e=typeof document<"u"?window:void 0,i=e.history.pushState,n=e.history.replaceState;let a=[];const l=()=>a,u=z=>a=z,h=(z=>z),f=(()=>Nd(`${e.location.pathname}${e.location.search}${e.location.hash}`,e.history.state));if(!e.history.state?.__TSR_key&&!e.history.state?.key){const z=Tg();e.history.replaceState({[ja]:0,key:z,__TSR_key:z},"")}let d=f(),p,v=!1,g=!1,S=!1,b=!1;const C=()=>d;let x,E;const A=()=>{x&&(U._ignoreSubscribers=!0,(x.isPush?e.history.pushState:e.history.replaceState)(x.state,"",x.href),U._ignoreSubscribers=!1,x=void 0,E=void 0,p=void 0)},B=(z,V,se)=>{const ee=h(V);E||(p=d),d=Nd(V,se),x={href:ee,state:se,isPush:x?.isPush||z==="push"},E||(E=Promise.resolve().then(()=>A()))},R=z=>{d=f(),U.notify({type:z})},$=async()=>{if(g){g=!1;return}const z=f(),V=z.state[ja]-d.state[ja],se=V===1,ee=V===-1,M=!se&&!ee||v;v=!1;const O=M?"GO":ee?"BACK":"FORWARD",N=M?{type:"GO",index:V}:{type:ee?"BACK":"FORWARD"};if(S)S=!1;else{const P=l();if(typeof document<"u"&&P.length){for(const T of P)if(await T.blockerFn({currentLocation:d,nextLocation:z,action:O})){g=!0,e.history.go(1),U.notify(N);return}}}d=f(),U.notify(N)},F=z=>{if(b){b=!1;return}let V=!1;const se=l();if(typeof document<"u"&&se.length)for(const ee of se){const M=ee.enableBeforeUnload??!0;if(M===!0){V=!0;break}if(typeof M=="function"&&M()===!0){V=!0;break}}if(V)return z.preventDefault(),z.returnValue=""},U=E2({getLocation:C,getLength:()=>e.history.length,pushState:(z,V)=>B("push",z,V),replaceState:(z,V)=>B("replace",z,V),back:z=>(z&&(S=!0),b=!0,e.history.back()),forward:z=>{z&&(S=!0),b=!0,e.history.forward()},go:z=>{v=!0,e.history.go(z)},createHref:z=>h(z),flush:A,destroy:()=>{e.history.pushState=i,e.history.replaceState=n,e.removeEventListener(Ty,F,{capture:!0}),e.removeEventListener(Ey,$)},onBlocked:()=>{p&&d!==p&&(d=p)},getBlockers:l,setBlockers:u,notifyOnIndexChange:!1});return e.addEventListener(Ty,F,{capture:!0}),e.addEventListener(Ey,$),e.history.pushState=function(...z){const V=i.apply(e.history,z);return U._ignoreSubscribers||R("PUSH"),V},e.history.replaceState=function(...z){const V=n.apply(e.history,z);return U._ignoreSubscribers||R("REPLACE"),V},U}function R2(t){let e=t.replace(/[\x00-\x1f\x7f]/g,"");return e.startsWith("//")&&(e="/"+e.replace(/^\/+/,"")),e}function Nd(t,e){const i=R2(t),n=i.indexOf("#"),a=i.indexOf("?"),l=Tg();return{href:i,pathname:i.substring(0,n>0?a>0?Math.min(n,a):n:a>0?a:i.length),hash:n>-1?i.substring(n):"",search:a>-1?i.slice(a,n===-1?void 0:n):"",state:e||{[ja]:0,key:l,__TSR_key:l}}}function Tg(){return(Math.random()+1).toString(36).substring(7)}function Pd(t){return t[t.length-1]}function A2(t){return typeof t=="function"}function Ua(t,e){return A2(t)?t(e):t}const M2=Object.prototype.hasOwnProperty;function Sr(t,e,i=0){if(t===e)return t;if(i>500)return e;const n=e,a=Ly(t)&&Ly(n);if(!a&&!(zd(t)&&zd(n)))return n;const l=a?t:Ay(t);if(!l)return n;const u=a?n:Ay(n);if(!u)return n;const h=l.length,f=u.length,d=a?new Array(f):{};let p=0;for(let v=0;v<f;v++){const g=a?v:u[v],S=t[g],b=n[g];if(S===b){d[g]=S,(a?v<h:M2.call(t,g))&&p++;continue}if(S===null||b===null||typeof S!="object"||typeof b!="object"){d[g]=b;continue}const C=Sr(S,b,i+1);d[g]=C,C===S&&p++}return h===f&&p===h?t:d}function Ay(t){const e=[],i=Object.getOwnPropertyNames(t);for(const a of i){if(!Object.prototype.propertyIsEnumerable.call(t,a))return!1;e.push(a)}const n=Object.getOwnPropertySymbols(t);for(const a of n){if(!Object.prototype.propertyIsEnumerable.call(t,a))return!1;e.push(a)}return e}function zd(t){if(!My(t))return!1;const e=t.constructor;if(typeof e>"u")return!0;const i=e.prototype;return!(!My(i)||!i.hasOwnProperty("isPrototypeOf"))}function My(t){return Object.prototype.toString.call(t)==="[object Object]"}function Ly(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Do(t,e,i){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let n=0,a=t.length;n<a;n++)if(!Do(t[n],e[n],i))return!1;return!0}if(zd(t)&&zd(e)){const n=i?.ignoreUndefined??!0;if(i?.partial){for(const u in e)if((!n||e[u]!==void 0)&&!Do(t[u],e[u],i))return!1;return!0}let a=0;if(!n)a=Object.keys(t).length;else for(const u in t)t[u]!==void 0&&a++;let l=0;for(const u in e)if((!n||e[u]!==void 0)&&(l++,l>a||!Do(t[u],e[u],i)))return!1;return a===l}return!1}function ql(t){let e,i;const n=new Promise((a,l)=>{e=a,i=l});return n.status="pending",n.resolve=a=>{n.status="resolved",n.value=a,e(a),t?.(a)},n.reject=a=>{n.status="rejected",i(a)},n}function Va(t){return!!(t&&typeof t=="object"&&typeof t.then=="function")}function L2(t){return t.replace(/[\x00-\x1f\x7f]/g,"")}function Dy(t){let e;try{e=decodeURI(t)}catch{e=t.replaceAll(/%[0-9A-F]{2}/gi,i=>{try{return decodeURI(i)}catch{return i}})}return L2(e)}const Q1=["http:","https:","mailto:","tel:"];function Hd(t){if(!t)return!1;try{const e=new URL(t);return!Q1.includes(e.protocol)}catch{return!1}}const D2={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},O2=/[&><\u2028\u2029]/g;function B2(t){return t.replace(O2,e=>D2[e])}function Oy(t,e){if(!t)return t;const i=/%25|%5C/gi;let n=0,a="",l;for(;(l=i.exec(t))!==null;)a+=Dy(t.slice(n,l.index))+l[0],n=i.lastIndex;return a=a+Dy(n?t.slice(n):t),a.startsWith("//")&&(a="/"+a.replace(/^\/+/,"")),a}var N2="Invariant failed";function qn(t,e){if(!t)throw new Error(N2)}function Id(t){const e=new Map;let i,n;const a=l=>{l.next&&(l.prev?(l.prev.next=l.next,l.next.prev=l.prev,l.next=void 0,n&&(n.next=l,l.prev=n)):(l.next.prev=void 0,i=l.next,l.next=void 0,n&&(l.prev=n,n.next=l)),n=l)};return{get(l){const u=e.get(l);if(u)return a(u),u.value},set(l,u){if(e.size>=t&&i){const f=i;e.delete(f.key),f.next&&(i=f.next,f.next.prev=void 0),f===n&&(n=void 0)}const h=e.get(l);if(h)h.value=u,a(h);else{const f={key:l,value:u,prev:n};n&&(n.next=f),n=f,i||(i=f),e.set(l,f)}},clear(){e.clear(),i=void 0,n=void 0}}}const Yl=0,Ho=1,Io=2,Tu=3,zl=4,P2=5,z2=/^([^{]*)\{\$([a-zA-Z_$][a-zA-Z0-9_$]*)\}([^}]*)$/,H2=/^([^{]*)\{-\$([a-zA-Z_$][a-zA-Z0-9_$]*)\}([^}]*)$/,I2=/^([^{]*)\{\$\}([^}]*)$/;function Rg(t,e,i=new Uint16Array(6)){const n=t.indexOf("/",e),a=n===-1?t.length:n,l=t.substring(e,a);if(!l||!l.includes("$"))return i[0]=Yl,i[1]=e,i[2]=e,i[3]=a,i[4]=a,i[5]=a,i;if(l==="$"){const d=t.length;return i[0]=Io,i[1]=e,i[2]=e,i[3]=d,i[4]=d,i[5]=d,i}if(l.charCodeAt(0)===36)return i[0]=Ho,i[1]=e,i[2]=e+1,i[3]=a,i[4]=a,i[5]=a,i;const u=l.match(I2);if(u){const p=u[1].length;return i[0]=Io,i[1]=e+p,i[2]=e+p+1,i[3]=e+p+2,i[4]=e+p+3,i[5]=t.length,i}const h=l.match(H2);if(h){const d=h[1],p=h[2],v=h[3],g=d.length;return i[0]=Tu,i[1]=e+g,i[2]=e+g+3,i[3]=e+g+3+p.length,i[4]=a-v.length,i[5]=a,i}const f=l.match(z2);if(f){const d=f[1],p=f[2],v=f[3],g=d.length;return i[0]=Ho,i[1]=e+g,i[2]=e+g+2,i[3]=e+g+2+p.length,i[4]=a-v.length,i[5]=a,i}return i[0]=Yl,i[1]=e,i[2]=e,i[3]=a,i[4]=a,i[5]=a,i}function sf(t,e,i,n,a,l,u){u?.(i);let h=n;{const f=i.fullPath??i.from,d=f.length,p=i.options?.caseSensitive??t,v=!!(i.options?.params?.parse&&i.options?.skipRouteOnParseError?.params);for(;h<d;){const S=Rg(f,h,e);let b;const C=h,x=S[5];switch(h=x+1,l++,S[0]){case Yl:{const A=f.substring(S[2],S[3]);if(p){const B=a.static?.get(A);if(B)b=B;else{a.static??=new Map;const R=Ro(i.fullPath??i.from);R.parent=a,R.depth=l,b=R,a.static.set(A,R)}}else{const B=A.toLowerCase(),R=a.staticInsensitive?.get(B);if(R)b=R;else{a.staticInsensitive??=new Map;const $=Ro(i.fullPath??i.from);$.parent=a,$.depth=l,b=$,a.staticInsensitive.set(B,$)}}break}case Ho:{const A=f.substring(C,S[1]),B=f.substring(S[4],x),R=p&&!!(A||B),$=A?R?A:A.toLowerCase():void 0,F=B?R?B:B.toLowerCase():void 0,U=!v&&a.dynamic?.find(z=>!z.skipOnParamError&&z.caseSensitive===R&&z.prefix===$&&z.suffix===F);if(U)b=U;else{const z=A_(Ho,i.fullPath??i.from,R,$,F);b=z,z.depth=l,z.parent=a,a.dynamic??=[],a.dynamic.push(z)}break}case Tu:{const A=f.substring(C,S[1]),B=f.substring(S[4],x),R=p&&!!(A||B),$=A?R?A:A.toLowerCase():void 0,F=B?R?B:B.toLowerCase():void 0,U=!v&&a.optional?.find(z=>!z.skipOnParamError&&z.caseSensitive===R&&z.prefix===$&&z.suffix===F);if(U)b=U;else{const z=A_(Tu,i.fullPath??i.from,R,$,F);b=z,z.parent=a,z.depth=l,a.optional??=[],a.optional.push(z)}break}case Io:{const A=f.substring(C,S[1]),B=f.substring(S[4],x),R=p&&!!(A||B),$=A?R?A:A.toLowerCase():void 0,F=B?R?B:B.toLowerCase():void 0,U=A_(Io,i.fullPath??i.from,R,$,F);b=U,U.parent=a,U.depth=l,a.wildcard??=[],a.wildcard.push(U)}}a=b}if(v&&i.children&&!i.isRoot&&i.id&&i.id.charCodeAt(i.id.lastIndexOf("/")+1)===95){const S=Ro(i.fullPath??i.from);S.kind=P2,S.parent=a,l++,S.depth=l,a.pathless??=[],a.pathless.push(S),a=S}const g=(i.path||!i.children)&&!i.isRoot;if(g&&f.endsWith("/")){const S=Ro(i.fullPath??i.from);S.kind=zl,S.parent=a,l++,S.depth=l,a.index=S,a=S}a.parse=i.options?.params?.parse??null,a.skipOnParamError=v,a.parsingPriority=i.options?.skipRouteOnParseError?.priority??0,g&&!a.route&&(a.route=i,a.fullPath=i.fullPath??i.from)}if(i.children)for(const f of i.children)sf(t,e,f,h,a,l,u)}function R_(t,e){if(t.skipOnParamError&&!e.skipOnParamError)return-1;if(!t.skipOnParamError&&e.skipOnParamError)return 1;if(t.skipOnParamError&&e.skipOnParamError&&(t.parsingPriority||e.parsingPriority))return e.parsingPriority-t.parsingPriority;if(t.prefix&&e.prefix&&t.prefix!==e.prefix){if(t.prefix.startsWith(e.prefix))return-1;if(e.prefix.startsWith(t.prefix))return 1}if(t.suffix&&e.suffix&&t.suffix!==e.suffix){if(t.suffix.endsWith(e.suffix))return-1;if(e.suffix.endsWith(t.suffix))return 1}return t.prefix&&!e.prefix?-1:!t.prefix&&e.prefix?1:t.suffix&&!e.suffix?-1:!t.suffix&&e.suffix?1:t.caseSensitive&&!e.caseSensitive?-1:!t.caseSensitive&&e.caseSensitive?1:0}function Ha(t){if(t.pathless)for(const e of t.pathless)Ha(e);if(t.static)for(const e of t.static.values())Ha(e);if(t.staticInsensitive)for(const e of t.staticInsensitive.values())Ha(e);if(t.dynamic?.length){t.dynamic.sort(R_);for(const e of t.dynamic)Ha(e)}if(t.optional?.length){t.optional.sort(R_);for(const e of t.optional)Ha(e)}if(t.wildcard?.length){t.wildcard.sort(R_);for(const e of t.wildcard)Ha(e)}}function Ro(t){return{kind:Yl,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function A_(t,e,i,n,a){return{kind:t,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:i,prefix:n,suffix:a}}function U2(t,e){const i=Ro("/"),n=new Uint16Array(6);for(const a of t)sf(!1,n,a,1,i,0);Ha(i),e.masksTree=i,e.flatCache=Id(1e3)}function F2(t,e){t||="/";const i=e.flatCache.get(t);if(i)return i;const n=Ag(t,e.masksTree);return e.flatCache.set(t,n),n}function $2(t,e,i,n,a){t||="/",n||="/";const l=e?`case\0${t}`:t;let u=a.singleCache.get(l);if(!u){u=Ro("/");const h=new Uint16Array(6);sf(e,h,{from:t},1,u,0),a.singleCache.set(l,u)}return Ag(n,u,i)}function W2(t,e,i=!1){const n=i?t:`nofuzz\0${t}`,a=e.matchCache.get(n);if(a!==void 0)return a;t||="/";let l;try{l=Ag(t,e.segmentTree,i)}catch(u){if(u instanceof URIError)l=null;else throw u}return l&&(l.branch=q2(l.route)),e.matchCache.set(n,l),l}function j2(t){return t==="/"?t:t.replace(/\/{1,}$/,"")}function V2(t,e=!1,i){const n=Ro(t.fullPath),a=new Uint16Array(6),l={},u={};let h=0;return sf(e,a,t,1,n,0,d=>{if(i?.(d,h),qn(!(d.id in l),`Duplicate routes found with id: ${String(d.id)}`),l[d.id]=d,h!==0&&d.path){const p=j2(d.fullPath);(!u[p]||d.fullPath.endsWith("/"))&&(u[p]=d)}h++}),Ha(n),{processedTree:{segmentTree:n,singleCache:Id(1e3),matchCache:Id(1e3),flatCache:null,masksTree:null},routesById:l,routesByPath:u}}function Ag(t,e,i=!1){const n=t.split("/"),a=G2(t,n,e,i);if(!a)return null;const[l]=J1(t,n,a);return{route:a.node.route,rawParams:l,parsedParams:a.parsedParams}}function J1(t,e,i){const n=Y2(i.node);let a=null;const l={};let u=i.extract?.part??0,h=i.extract?.node??0,f=i.extract?.path??0;for(;h<n.length;u++,h++,f++){const d=n[h],p=e[u],v=f;if(p&&(f+=p.length),d.kind===Ho){a??=i.node.fullPath.split("/");const g=a[h],S=d.prefix?.length??0;if(g.charCodeAt(S)===123){const C=d.suffix?.length??0,x=g.substring(S+2,g.length-C-1),E=p.substring(S,p.length-C);l[x]=decodeURIComponent(E)}else{const C=g.substring(1);l[C]=decodeURIComponent(p)}}else if(d.kind===Tu){if(i.skipped&1<<h){u--;continue}a??=i.node.fullPath.split("/");const g=a[h],S=d.prefix?.length??0,b=d.suffix?.length??0,C=g.substring(S+3,g.length-b-1),x=d.suffix||d.prefix?p.substring(S,p.length-b):p;x&&(l[C]=decodeURIComponent(x))}else if(d.kind===Io){const g=d,S=t.substring(v+(g.prefix?.length??0),t.length-(g.suffix?.length??0)),b=decodeURIComponent(S);l["*"]=b,l._splat=b;break}}return i.rawParams&&Object.assign(l,i.rawParams),[l,{part:u,node:h,path:f}]}function q2(t){const e=[t];for(;t.parentRoute;)t=t.parentRoute,e.push(t);return e.reverse(),e}function Y2(t){const e=Array(t.depth+1);do e[t.depth]=t,t=t.parent;while(t);return e}function G2(t,e,i,n){if(t==="/"&&i.index)return{node:i.index,skipped:0};const a=!Pd(e),l=a&&t!=="/",u=e.length-(a?1:0),h=[{node:i,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let f=null,d=null,p=null;for(;h.length;){const v=h.pop(),{node:g,index:S,skipped:b,depth:C,statics:x,dynamics:E,optionals:A}=v;let{extract:B,rawParams:R,parsedParams:$}=v;if(g.skipOnParamError){if(!M_(t,e,v))continue;R=v.rawParams,B=v.extract,$=v.parsedParams}n&&g.route&&g.kind!==zl&&Zc(d,v)&&(d=v);const F=S===u;if(F&&(g.route&&!l&&Zc(p,v)&&(p=v),!g.optional&&!g.wildcard&&!g.index&&!g.pathless))continue;const U=F?void 0:e[S];let z;if(F&&g.index){const V={node:g.index,index:S,skipped:b,depth:C+1,statics:x,dynamics:E,optionals:A,extract:B,rawParams:R,parsedParams:$};if(g.index.skipOnParamError&&!M_(t,e,V))continue;if(x===u&&!E&&!A&&!b)return V;Zc(p,V)&&(p=V)}if(g.wildcard&&Zc(f,v))for(const V of g.wildcard){const{prefix:se,suffix:ee}=V;if(se&&(F||!(V.caseSensitive?U:z??=U.toLowerCase()).startsWith(se)))continue;if(ee){if(F)continue;const O=e.slice(S).join("/").slice(-ee.length);if((V.caseSensitive?O:O.toLowerCase())!==ee)continue}const M={node:V,index:u,skipped:b,depth:C,statics:x,dynamics:E,optionals:A,extract:B,rawParams:R,parsedParams:$};if(!(V.skipOnParamError&&!M_(t,e,M))){f=M;break}}if(g.optional){const V=b|1<<C,se=C+1;for(let ee=g.optional.length-1;ee>=0;ee--){const M=g.optional[ee];h.push({node:M,index:S,skipped:V,depth:se,statics:x,dynamics:E,optionals:A,extract:B,rawParams:R,parsedParams:$})}if(!F)for(let ee=g.optional.length-1;ee>=0;ee--){const M=g.optional[ee],{prefix:O,suffix:N}=M;if(O||N){const P=M.caseSensitive?U:z??=U.toLowerCase();if(O&&!P.startsWith(O)||N&&!P.endsWith(N))continue}h.push({node:M,index:S+1,skipped:b,depth:se,statics:x,dynamics:E,optionals:A+1,extract:B,rawParams:R,parsedParams:$})}}if(!F&&g.dynamic&&U)for(let V=g.dynamic.length-1;V>=0;V--){const se=g.dynamic[V],{prefix:ee,suffix:M}=se;if(ee||M){const O=se.caseSensitive?U:z??=U.toLowerCase();if(ee&&!O.startsWith(ee)||M&&!O.endsWith(M))continue}h.push({node:se,index:S+1,skipped:b,depth:C+1,statics:x,dynamics:E+1,optionals:A,extract:B,rawParams:R,parsedParams:$})}if(!F&&g.staticInsensitive){const V=g.staticInsensitive.get(z??=U.toLowerCase());V&&h.push({node:V,index:S+1,skipped:b,depth:C+1,statics:x+1,dynamics:E,optionals:A,extract:B,rawParams:R,parsedParams:$})}if(!F&&g.static){const V=g.static.get(U);V&&h.push({node:V,index:S+1,skipped:b,depth:C+1,statics:x+1,dynamics:E,optionals:A,extract:B,rawParams:R,parsedParams:$})}if(g.pathless){const V=C+1;for(let se=g.pathless.length-1;se>=0;se--){const ee=g.pathless[se];h.push({node:ee,index:S,skipped:b,depth:V,statics:x,dynamics:E,optionals:A,extract:B,rawParams:R,parsedParams:$})}}}if(p&&f)return Zc(f,p)?p:f;if(p)return p;if(f)return f;if(n&&d){let v=d.index;for(let S=0;S<d.index;S++)v+=e[S].length;const g=v===t.length?"/":t.slice(v);return d.rawParams??={},d.rawParams["**"]=decodeURIComponent(g),d}return null}function M_(t,e,i){try{const[n,a]=J1(t,e,i);i.rawParams=n,i.extract=a;const l=i.node.parse(n);return i.parsedParams=Object.assign({},i.parsedParams,l),!0}catch{return null}}function Zc(t,e){return t?e.statics>t.statics||e.statics===t.statics&&(e.dynamics>t.dynamics||e.dynamics===t.dynamics&&(e.optionals>t.optionals||e.optionals===t.optionals&&((e.node.kind===zl)>(t.node.kind===zl)||e.node.kind===zl==(t.node.kind===zl)&&e.depth>t.depth))):!0}function gd(t){return Mg(t.filter(e=>e!==void 0).join("/"))}function Mg(t){return t.replace(/\/{2,}/g,"/")}function ew(t){return t==="/"?t:t.replace(/^\/{1,}/,"")}function qa(t){const e=t.length;return e>1&&t[e-1]==="/"?t.replace(/\/{1,}$/,""):t}function tw(t){return qa(ew(t))}function Ud(t,e){return t?.endsWith("/")&&t!=="/"&&t!==`${e}/`?t.slice(0,-1):t}function K2(t,e,i){return Ud(t,i)===Ud(e,i)}function X2({base:t,to:e,trailingSlash:i="never",cache:n}){const a=e.startsWith("/"),l=!a&&e===".";let u;if(n){u=a?e:l?t:t+"\0"+e;const v=n.get(u);if(v)return v}let h;if(l)h=t.split("/");else if(a)h=e.split("/");else{for(h=t.split("/");h.length>1&&Pd(h)==="";)h.pop();const v=e.split("/");for(let g=0,S=v.length;g<S;g++){const b=v[g];b===""?g?g===S-1&&h.push(b):h=[b]:b===".."?h.pop():b==="."||h.push(b)}}h.length>1&&(Pd(h)===""?i==="never"&&h.pop():i==="always"&&h.push(""));let f,d="";for(let v=0;v<h.length;v++){v>0&&(d+="/");const g=h[v];if(!g)continue;f=Rg(g,0,f);const S=f[0];if(S===Yl){d+=g;continue}const b=f[5],C=g.substring(0,f[1]),x=g.substring(f[4],b),E=g.substring(f[2],f[3]);S===Ho?d+=C||x?`${C}{$${E}}${x}`:`$${E}`:S===Io?d+=C||x?`${C}{$}${x}`:"$":d+=`${C}{-$${E}}${x}`}d=Mg(d);const p=d||"/";return u&&n&&n.set(u,p),p}function L_(t,e,i){const n=e[t];return typeof n!="string"?n:t==="_splat"?encodeURI(n):Z2(n,i)}function D_({path:t,params:e,decodeCharMap:i}){let n=!1;const a={};if(!t||t==="/")return{interpolatedPath:"/",usedParams:a,isMissingParams:n};if(!t.includes("$"))return{interpolatedPath:t,usedParams:a,isMissingParams:n};const l=t.length;let u=0,h,f="";for(;u<l;){const p=u;h=Rg(t,p,h);const v=h[5];if(u=v+1,p===v)continue;const g=h[0];if(g===Yl){f+="/"+t.substring(p,v);continue}if(g===Io){const S=e._splat;a._splat=S,a["*"]=S;const b=t.substring(p,h[1]),C=t.substring(h[4],v);if(!S){n=!0,(b||C)&&(f+="/"+b+C);continue}const x=L_("_splat",e,i);f+="/"+b+x+C;continue}if(g===Ho){const S=t.substring(h[2],h[3]);!n&&!(S in e)&&(n=!0),a[S]=e[S];const b=t.substring(p,h[1]),C=t.substring(h[4],v),x=L_(S,e,i)??"undefined";f+="/"+b+x+C;continue}if(g===Tu){const S=t.substring(h[2],h[3]),b=e[S];if(b==null)continue;a[S]=b;const C=t.substring(p,h[1]),x=t.substring(h[4],v),E=L_(S,e,i)??"";f+="/"+C+E+x;continue}}return t.endsWith("/")&&(f+="/"),{usedParams:a,interpolatedPath:f||"/",isMissingParams:n}}function Z2(t,e){let i=encodeURIComponent(t);if(e)for(const[n,a]of e)i=i.replaceAll(n,a);return i}function Vs(t){return!!t?.isNotFound}function Q2(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const Fd="tsr-scroll-restoration-v1_3",J2=(t,e)=>{let i;return(...n)=>{i||(i=setTimeout(()=>{t(...n),i=null},e))}};function ek(){const t=Q2();if(!t)return null;const e=t.getItem(Fd);let i=e?JSON.parse(e):{};return{state:i,set:n=>{i=Ua(n,i)||i;try{t.setItem(Fd,JSON.stringify(i))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Qh=ek(),Cp=t=>t.state.__TSR_key||t.href;function tk(t){const e=[];let i;for(;i=t.parentNode;)e.push(`${t.tagName}:nth-child(${Array.prototype.indexOf.call(i.children,t)+1})`),t=i;return`${e.reverse().join(" > ")}`.toLowerCase()}let $d=!1;function iw({storageKey:t,key:e,behavior:i,shouldScrollRestoration:n,scrollToTopSelectors:a,location:l}){let u;try{u=JSON.parse(sessionStorage.getItem(t)||"{}")}catch(d){console.error(d);return}const h=e||window.history.state?.__TSR_key,f=u[h];$d=!0;e:{if(n&&f&&Object.keys(f).length>0){for(const v in f){const g=f[v];if(v==="window")window.scrollTo({top:g.scrollY,left:g.scrollX,behavior:i});else if(v){const S=document.querySelector(v);S&&(S.scrollLeft=g.scrollX,S.scrollTop=g.scrollY)}}break e}const d=(l??window.location).hash.split("#",2)[1];if(d){const v=window.history.state?.__hashScrollIntoViewOptions??!0;if(v){const g=document.getElementById(d);g&&g.scrollIntoView(v)}break e}const p={top:0,left:0,behavior:i};if(window.scrollTo(p),a)for(const v of a){if(v==="window")continue;const g=typeof v=="function"?v():document.querySelector(v);g&&g.scrollTo(p)}}$d=!1}function ik(t,e){if(!Qh&&!t.isServer||((t.options.scrollRestoration??!1)&&(t.isScrollRestoring=!0),t.isServer||t.isScrollRestorationSetup||!Qh))return;t.isScrollRestorationSetup=!0,$d=!1;const n=t.options.getScrollRestorationKey||Cp;window.history.scrollRestoration="manual";const a=l=>{if($d||!t.isScrollRestoring)return;let u="";if(l.target===document||l.target===window)u="window";else{const f=l.target.getAttribute("data-scroll-restoration-id");f?u=`[data-scroll-restoration-id="${f}"]`:u=tk(l.target)}const h=n(t.state.location);Qh.set(f=>{const d=f[h]||={},p=d[u]||={};if(u==="window")p.scrollX=window.scrollX||0,p.scrollY=window.scrollY||0;else if(u){const v=document.querySelector(u);v&&(p.scrollX=v.scrollLeft||0,p.scrollY=v.scrollTop||0)}return f})};typeof document<"u"&&document.addEventListener("scroll",J2(a,100),!0),t.subscribe("onRendered",l=>{const u=n(l.toLocation);if(!t.resetNextScroll){t.resetNextScroll=!0;return}typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation})||(iw({storageKey:Fd,key:u,behavior:t.options.scrollRestorationBehavior,shouldScrollRestoration:t.isScrollRestoring,scrollToTopSelectors:t.options.scrollToTopSelectors,location:t.history.location}),t.isScrollRestoring&&Qh.set(h=>(h[u]||={},h)))})}function sk(t){if(typeof document<"u"&&document.querySelector){const e=t.state.location.state.__hashScrollIntoViewOptions??!0;if(e&&t.state.location.hash!==""){const i=document.getElementById(t.state.location.hash);i&&i.scrollIntoView(e)}}}function rk(t,e=String){const i=new URLSearchParams;for(const n in t){const a=t[n];a!==void 0&&i.set(n,e(a))}return i.toString()}function O_(t){return t?t==="false"?!1:t==="true"?!0:+t*0===0&&+t+""===t?+t:t:""}function nk(t){const e=new URLSearchParams(t),i={};for(const[n,a]of e.entries()){const l=i[n];l==null?i[n]=O_(a):Array.isArray(l)?l.push(O_(a)):i[n]=[l,O_(a)]}return i}const ak=lk(JSON.parse),ok=ck(JSON.stringify,JSON.parse);function lk(t){return e=>{e[0]==="?"&&(e=e.substring(1));const i=nk(e);for(const n in i){const a=i[n];if(typeof a=="string")try{i[n]=t(a)}catch{}}return i}}function ck(t,e){const i=typeof e=="function";function n(a){if(typeof a=="object"&&a!==null)try{return t(a)}catch{}else if(i&&typeof a=="string")try{return e(a),t(a)}catch{}return a}return a=>{const l=rk(a,n);return l?`?${l}`:""}}const js="__root__";function sw(t){if(t.statusCode=t.statusCode||t.code||307,typeof t.href=="string"&&Hd(t.href))throw new Error(`Redirect blocked: unsafe protocol in href "${t.href}". Only ${Q1.join(", ")} protocols are allowed.`);if(!t.reloadDocument&&typeof t.href=="string")try{new URL(t.href),t.reloadDocument=!0}catch{}const e=new Headers(t.headers);t.href&&e.get("Location")===null&&e.set("Location",t.href);const i=new Response(null,{status:t.statusCode,headers:e});if(i.options=t,t.throw)throw i;return i}function wr(t){return t instanceof Response&&!!t.options}const vd=t=>{if(!t.rendered)return t.rendered=!0,t.onReady?.()},rf=(t,e)=>!!(t.preload&&!t.router.state.matches.some(i=>i.id===e)),$l=(t,e,i=!0)=>{const n={...t.router.options.context??{}},a=i?e:e-1;for(let l=0;l<=a;l++){const u=t.matches[l];if(!u)continue;const h=t.router.getMatch(u.id);h&&Object.assign(n,h.__routeContext,h.__beforeLoadContext)}return n},rw=(t,e)=>{const i=t.router.routesById[e.routeId??""]??t.router.routeTree;!i.options.notFoundComponent&&t.router.options?.defaultNotFoundComponent&&(i.options.notFoundComponent=t.router.options.defaultNotFoundComponent),qn(i.options.notFoundComponent);const n=t.matches.find(a=>a.routeId===i.id);qn(n,"Could not find match for route: "+i.id),t.updateMatch(n.id,a=>({...a,status:"notFound",error:e,isFetching:!1})),e.routerCode==="BEFORE_LOAD"&&i.parentRoute&&(e.routeId=i.parentRoute.id,rw(t,e))},Fa=(t,e,i)=>{if(!(!wr(i)&&!Vs(i))){if(wr(i)&&i.redirectHandled&&!i.options.reloadDocument)throw i;if(e){e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.loaderPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loaderPromise=void 0;const n=wr(i)?"redirected":"notFound";e._nonReactive.error=i,t.updateMatch(e.id,a=>({...a,status:n,context:$l(t,e.index),isFetching:!1,error:i})),Vs(i)&&!i.routeId&&(i.routeId=e.routeId),e._nonReactive.loadPromise?.resolve()}throw wr(i)?(t.rendered=!0,i.options._fromLocation=t.location,i.redirectHandled=!0,i=t.router.resolveRedirect(i),i):(rw(t,i),i)}},nw=(t,e)=>{const i=t.router.getMatch(e);return!!(!t.router.isServer&&i._nonReactive.dehydrated||t.router.isServer&&i.ssr===!1)},Qc=(t,e,i,n)=>{const{id:a,routeId:l}=t.matches[e],u=t.router.looseRoutesById[l];if(i instanceof Promise)throw i;i.routerCode=n,t.firstBadMatchIndex??=e,Fa(t,t.router.getMatch(a),i);try{u.options.onError?.(i)}catch(h){i=h,Fa(t,t.router.getMatch(a),i)}t.updateMatch(a,h=>(h._nonReactive.beforeLoadPromise?.resolve(),h._nonReactive.beforeLoadPromise=void 0,h._nonReactive.loadPromise?.resolve(),{...h,error:i,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},uk=(t,e,i,n)=>{const a=t.router.getMatch(e),l=t.matches[i-1]?.id,u=l?t.router.getMatch(l):void 0;if(t.router.isShell()){a.ssr=n.id===js;return}if(u?.ssr===!1){a.ssr=!1;return}const h=S=>S===!0&&u?.ssr==="data-only"?"data-only":S,f=t.router.options.defaultSsr??!0;if(n.options.ssr===void 0){a.ssr=h(f);return}if(typeof n.options.ssr!="function"){a.ssr=h(n.options.ssr);return}const{search:d,params:p}=a,v={search:Jh(d,a.searchError),params:Jh(p,a.paramsError),location:t.location,matches:t.matches.map(S=>({index:S.index,pathname:S.pathname,fullPath:S.fullPath,staticData:S.staticData,id:S.id,routeId:S.routeId,search:Jh(S.search,S.searchError),params:Jh(S.params,S.paramsError),ssr:S.ssr}))},g=n.options.ssr(v);if(Va(g))return g.then(S=>{a.ssr=h(S??f)});a.ssr=h(g??f)},aw=(t,e,i,n)=>{if(n._nonReactive.pendingTimeout!==void 0)return;const a=i.options.pendingMs??t.router.options.defaultPendingMs;if(!!(t.onReady&&!t.router.isServer&&!rf(t,e)&&(i.options.loader||i.options.beforeLoad||cw(i))&&typeof a=="number"&&a!==1/0&&(i.options.pendingComponent??t.router.options?.defaultPendingComponent))){const u=setTimeout(()=>{vd(t)},a);n._nonReactive.pendingTimeout=u}},hk=(t,e,i)=>{const n=t.router.getMatch(e);if(!n._nonReactive.beforeLoadPromise&&!n._nonReactive.loaderPromise)return;aw(t,e,i,n);const a=()=>{const l=t.router.getMatch(e);l.preload&&(l.status==="redirected"||l.status==="notFound")&&Fa(t,l,l.error)};return n._nonReactive.beforeLoadPromise?n._nonReactive.beforeLoadPromise.then(a):a()},dk=(t,e,i,n)=>{const a=t.router.getMatch(e),l=a._nonReactive.loadPromise;a._nonReactive.loadPromise=ql(()=>{l?.resolve()});const{paramsError:u,searchError:h}=a;u&&Qc(t,i,u,"PARSE_PARAMS"),h&&Qc(t,i,h,"VALIDATE_SEARCH"),aw(t,e,n,a);const f=new AbortController,d=t.matches[i-1]?.id;(d?t.router.getMatch(d):void 0)?.context??t.router.options.context;let v=!1;const g=()=>{v||(v=!0,t.updateMatch(e,F=>({...F,isFetching:"beforeLoad",fetchCount:F.fetchCount+1,abortController:f})))},S=()=>{a._nonReactive.beforeLoadPromise?.resolve(),a._nonReactive.beforeLoadPromise=void 0,t.updateMatch(e,F=>({...F,isFetching:!1}))};if(!n.options.beforeLoad){wu(()=>{g(),S()});return}a._nonReactive.beforeLoadPromise=ql();const b={...$l(t,i,!1),...a.__routeContext},{search:C,params:x,cause:E}=a,A=rf(t,e),B={search:C,abortController:f,params:x,preload:A,context:b,location:t.location,navigate:F=>t.router.navigate({...F,_fromLocation:t.location}),buildLocation:t.router.buildLocation,cause:A?"preload":E,matches:t.matches,...t.router.options.additionalContext},R=F=>{if(F===void 0){wu(()=>{g(),S()});return}(wr(F)||Vs(F))&&(g(),Qc(t,i,F,"BEFORE_LOAD")),wu(()=>{g(),t.updateMatch(e,U=>({...U,__beforeLoadContext:F})),S()})};let $;try{if($=n.options.beforeLoad(B),Va($))return g(),$.catch(F=>{Qc(t,i,F,"BEFORE_LOAD")}).then(R)}catch(F){g(),Qc(t,i,F,"BEFORE_LOAD")}R($)},fk=(t,e)=>{const{id:i,routeId:n}=t.matches[e],a=t.router.looseRoutesById[n],l=()=>{if(t.router.isServer){const f=uk(t,i,e,a);if(Va(f))return f.then(h)}return h()},u=()=>dk(t,i,e,a),h=()=>{if(nw(t,i))return;const f=hk(t,i,a);return Va(f)?f.then(u):u()};return l()},mk=(t,e,i)=>{const n=t.router.getMatch(e);if(!n||!i.options.head&&!i.options.scripts&&!i.options.headers)return;const a={ssr:t.router.options.ssr,matches:t.matches,match:n,params:n.params,loaderData:n.loaderData};return Promise.all([i.options.head?.(a),i.options.scripts?.(a),i.options.headers?.(a)]).then(([l,u,h])=>{const f=l?.meta,d=l?.links,p=l?.scripts,v=l?.styles;return{meta:f,links:d,headScripts:p,headers:h,scripts:u,styles:v}})},ow=(t,e,i,n)=>{const a=t.matchPromises[i-1],{params:l,loaderDeps:u,abortController:h,cause:f}=t.router.getMatch(e),d=$l(t,i),p=rf(t,e);return{params:l,deps:u,preload:!!p,parentMatchPromise:a,abortController:h,context:d,location:t.location,navigate:v=>t.router.navigate({...v,_fromLocation:t.location}),cause:p?"preload":f,route:n,...t.router.options.additionalContext}},By=async(t,e,i,n)=>{try{const a=t.router.getMatch(e);try{(!t.router.isServer||a.ssr===!0)&&lw(n);const l=n.options.loader?.(ow(t,e,i,n)),u=n.options.loader&&Va(l);if((u||n._lazyPromise||n._componentsPromise||n.options.head||n.options.scripts||n.options.headers||a._nonReactive.minPendingPromise)&&t.updateMatch(e,d=>({...d,isFetching:"loader"})),n.options.loader){const d=u?await l:l;Fa(t,t.router.getMatch(e),d),d!==void 0&&t.updateMatch(e,p=>({...p,loaderData:d}))}n._lazyPromise&&await n._lazyPromise;const f=a._nonReactive.minPendingPromise;f&&await f,n._componentsPromise&&await n._componentsPromise,t.updateMatch(e,d=>({...d,error:void 0,context:$l(t,i),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(l){let u=l;if(u?.name==="AbortError"){t.updateMatch(e,f=>({...f,status:f.status==="pending"?"success":f.status,isFetching:!1,context:$l(t,i)}));return}const h=a._nonReactive.minPendingPromise;h&&await h,Vs(l)&&await n.options.notFoundComponent?.preload?.(),Fa(t,t.router.getMatch(e),l);try{n.options.onError?.(l)}catch(f){u=f,Fa(t,t.router.getMatch(e),f)}t.updateMatch(e,f=>({...f,error:u,context:$l(t,i),status:"error",isFetching:!1}))}}catch(a){const l=t.router.getMatch(e);l&&(l._nonReactive.loaderPromise=void 0),Fa(t,l,a)}},_k=async(t,e)=>{const{id:i,routeId:n}=t.matches[e];let a=!1,l=!1;const u=t.router.looseRoutesById[n];if(nw(t,i)){if(t.router.isServer)return t.router.getMatch(i)}else{const d=t.router.getMatch(i);if(d._nonReactive.loaderPromise){if(d.status==="success"&&!t.sync&&!d.preload)return d;await d._nonReactive.loaderPromise;const p=t.router.getMatch(i),v=p._nonReactive.error||p.error;v&&Fa(t,p,v)}else{const p=Date.now()-d.updatedAt,v=rf(t,i),g=v?u.options.preloadStaleTime??t.router.options.defaultPreloadStaleTime??3e4:u.options.staleTime??t.router.options.defaultStaleTime??0,S=u.options.shouldReload,b=typeof S=="function"?S(ow(t,i,e,u)):S,C=!!v&&!t.router.state.matches.some(B=>B.id===i),x=t.router.getMatch(i);x._nonReactive.loaderPromise=ql(),C!==x.preload&&t.updateMatch(i,B=>({...B,preload:C}));const{status:E,invalid:A}=x;a=E==="success"&&(A||(b??p>g)),v&&u.options.preload===!1||(a&&!t.sync?(l=!0,(async()=>{try{await By(t,i,e,u);const B=t.router.getMatch(i);B._nonReactive.loaderPromise?.resolve(),B._nonReactive.loadPromise?.resolve(),B._nonReactive.loaderPromise=void 0}catch(B){wr(B)&&await t.router.navigate(B.options)}})()):(E!=="success"||a&&t.sync)&&await By(t,i,e,u))}}const h=t.router.getMatch(i);l||(h._nonReactive.loaderPromise?.resolve(),h._nonReactive.loadPromise?.resolve()),clearTimeout(h._nonReactive.pendingTimeout),h._nonReactive.pendingTimeout=void 0,l||(h._nonReactive.loaderPromise=void 0),h._nonReactive.dehydrated=void 0;const f=l?h.isFetching:!1;return f!==h.isFetching||h.invalid!==!1?(t.updateMatch(i,d=>({...d,isFetching:f,invalid:!1})),t.router.getMatch(i)):h};async function Ny(t){const e=Object.assign(t,{matchPromises:[]});!e.router.isServer&&e.router.state.matches.some(i=>i._forcePending)&&vd(e);try{for(let h=0;h<e.matches.length;h++){const f=fk(e,h);Va(f)&&await f}const i=e.firstBadMatchIndex??e.matches.length;for(let h=0;h<i;h++)e.matchPromises.push(_k(e,h));const a=(await Promise.allSettled(e.matchPromises)).filter(h=>h.status==="rejected").map(h=>h.reason);let l;for(const h of a){if(wr(h))throw h;!l&&Vs(h)&&(l=h)}for(const h of e.matches){const{id:f,routeId:d}=h,p=e.router.looseRoutesById[d];try{const v=mk(e,f,p);if(v){const g=await v;e.updateMatch(f,S=>({...S,...g}))}}catch(v){console.error(`Error executing head for route ${d}:`,v)}}if(l)throw l;const u=vd(e);Va(u)&&await u}catch(i){if(Vs(i)&&!e.preload){const n=vd(e);throw Va(n)&&await n,i}if(wr(i))throw i}return e.matches}async function lw(t){if(!t._lazyLoaded&&t._lazyPromise===void 0&&(t.lazyFn?t._lazyPromise=t.lazyFn().then(e=>{const{id:i,...n}=e.options;Object.assign(t.options,n),t._lazyLoaded=!0,t._lazyPromise=void 0}):t._lazyLoaded=!0),!t._componentsLoaded&&t._componentsPromise===void 0){const e=()=>{const i=[];for(const n of uw){const a=t.options[n]?.preload;a&&i.push(a())}if(i.length)return Promise.all(i).then(()=>{t._componentsLoaded=!0,t._componentsPromise=void 0});t._componentsLoaded=!0,t._componentsPromise=void 0};t._componentsPromise=t._lazyPromise?t._lazyPromise.then(e):e()}return t._componentsPromise}function Jh(t,e){return e?{status:"error",error:e}:{status:"success",value:t}}function cw(t){for(const e of uw)if(t.options[e]?.preload)return!0;return!1}const uw=["component","errorComponent","pendingComponent","notFoundComponent"];function pk(t){return{input:({url:e})=>{for(const i of t)e=xp(i,e);return e},output:({url:e})=>{for(let i=t.length-1;i>=0;i--)e=hw(t[i],e);return e}}}function gk(t){const e=tw(t.basepath),i=`/${e}`,n=`${i}/`,a=t.caseSensitive?i:i.toLowerCase(),l=t.caseSensitive?n:n.toLowerCase();return{input:({url:u})=>{const h=t.caseSensitive?u.pathname:u.pathname.toLowerCase();return h===a?u.pathname="/":h.startsWith(l)&&(u.pathname=u.pathname.slice(i.length)),u},output:({url:u})=>(u.pathname=gd(["/",e,u.pathname]),u)}}function xp(t,e){const i=t?.input?.({url:e});if(i){if(typeof i=="string")return new URL(i);if(i instanceof URL)return i}return e}function hw(t,e){const i=t?.output?.({url:e});if(i){if(typeof i=="string")return new URL(i);if(i instanceof URL)return i}return e}function Oo(t){const e=t.resolvedLocation,i=t.location,n=e?.pathname!==i.pathname,a=e?.href!==i.href,l=e?.hash!==i.hash;return{fromLocation:e,toLocation:i,pathChanged:n,hrefChanged:a,hashChanged:l}}class vk{constructor(e){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=i=>i(),this.update=i=>{i.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const n=this.options,a=this.basepath??n?.basepath??"/",l=this.basepath===void 0,u=n?.rewrite;this.options={...n,...i},this.isServer=this.options.isServer??typeof document>"u",this.pathParamsDecodeCharMap=this.options.pathParamsAllowedCharacters?new Map(this.options.pathParamsAllowedCharacters.map(g=>[encodeURIComponent(g),g])):void 0,(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.isServer||(this.history=T2())),this.origin=this.options.origin,this.origin||(!this.isServer&&window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree&&(this.routeTree=this.options.routeTree,this.buildRouteTree()),!this.__store&&this.latestLocation&&(this.__store=new k2(yk(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(g=>!["redirected"].includes(g.status))}}}),ik(this));let h=!1;const f=this.options.basepath??"/",d=this.options.rewrite;if(l||a!==f||u!==d){this.basepath=f;const g=[];tw(f)!==""&&g.push(gk({basepath:f})),d&&g.push(d),this.rewrite=g.length===0?void 0:g.length===1?g[0]:pk(g),this.history&&this.updateLatestLocation(),h=!0}h&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const{routesById:i,routesByPath:n,processedTree:a}=V2(this.routeTree,this.options.caseSensitive,(u,h)=>{u.init({originalIndex:h})});this.options.routeMasks&&U2(this.options.routeMasks,a),this.routesById=i,this.routesByPath=n,this.processedTree=a;const l=this.options.notFoundRoute;l&&(l.init({originalIndex:99999999999}),this.routesById[l.id]=l)},this.subscribe=(i,n)=>{const a={eventType:i,fn:n};return this.subscribers.add(a),()=>{this.subscribers.delete(a)}},this.emit=i=>{this.subscribers.forEach(n=>{n.eventType===i.type&&n.fn(i)})},this.parseLocation=(i,n)=>{const a=({href:f,state:d})=>{const p=new URL(f,this.origin),v=xp(this.rewrite,p),g=this.options.parseSearch(v.search),S=this.options.stringifySearch(g);return v.search=S,{href:v.href.replace(v.origin,""),publicHref:f,url:v,pathname:Oy(v.pathname),searchStr:S,search:Sr(n?.search,g),hash:v.hash.split("#").reverse()[0]??"",state:Sr(n?.state,d)}},l=a(i),{__tempLocation:u,__tempKey:h}=l.state;if(u&&(!h||h===this.tempLocationKey)){const f=a(u);return f.state.key=l.state.key,f.state.__TSR_key=l.state.__TSR_key,delete f.state.__tempLocation,{...f,maskedLocation:l}}return l},this.resolvePathCache=Id(1e3),this.resolvePathWithBase=(i,n)=>X2({base:i,to:Mg(n),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(i,n,a)=>typeof i=="string"?this.matchRoutesInternal({pathname:i,search:n},a):this.matchRoutesInternal(i,n),this.getMatchedRoutes=i=>bk({pathname:i,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=i=>{const n=this.getMatch(i);n&&(n.abortController.abort(),clearTimeout(n._nonReactive.pendingTimeout),n._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const i=this.state.matches.filter(l=>l.status==="pending"),n=this.state.matches.filter(l=>l.isFetching==="loader");new Set([...this.state.pendingMatches??[],...i,...n]).forEach(l=>{this.cancelMatch(l.id)})},this.buildLocation=i=>{const n=(l={})=>{const u=l._fromLocation||this.pendingBuiltLocation||this.latestLocation,h=this.matchRoutes(u,{_buildLocation:!0}),f=Pd(h);l.from;const d=l.unsafeRelative==="path"?u.pathname:l.from??f.fullPath,p=this.resolvePathWithBase(d,"."),v=f.search,g={...f.params},S=l.to?this.resolvePathWithBase(p,`${l.to}`):this.resolvePathWithBase(p,"."),b=l.params===!1||l.params===null?{}:(l.params??!0)===!0?g:Object.assign(g,Ua(l.params,g)),C=D_({path:S,params:b}).interpolatedPath,x=this.matchRoutes(C,void 0,{_buildLocation:!0}).map(se=>this.looseRoutesById[se.routeId]);if(Object.keys(b).length>0)for(const se of x){const ee=se.options.params?.stringify??se.options.stringifyParams;ee&&Object.assign(b,ee(b))}const E=i.leaveParams?S:Oy(D_({path:S,params:b,decodeCharMap:this.pathParamsDecodeCharMap}).interpolatedPath);let A=v;if(i._includeValidateSearch&&this.options.search?.strict){const se={};x.forEach(ee=>{if(ee.options.validateSearch)try{Object.assign(se,kp(ee.options.validateSearch,{...se,...A}))}catch{}}),A=se}A=wk({search:A,dest:l,destRoutes:x,_includeValidateSearch:i._includeValidateSearch}),A=Sr(v,A);const B=this.options.stringifySearch(A),R=l.hash===!0?u.hash:l.hash?Ua(l.hash,u.hash):void 0,$=R?`#${R}`:"";let F=l.state===!0?u.state:l.state?Ua(l.state,u.state):{};F=Sr(u.state,F);const U=`${E}${B}${$}`,z=new URL(U,this.origin),V=hw(this.rewrite,z);return{publicHref:V.pathname+V.search+V.hash,href:U,url:V,pathname:E,search:A,searchStr:B,state:F,hash:R??"",unmaskOnReload:l.unmaskOnReload}},a=(l={},u)=>{const h=n(l);let f=u?n(u):void 0;if(!f){const d={};if(this.options.routeMasks){const p=F2(h.pathname,this.processedTree);if(p){Object.assign(d,p.rawParams);const{from:v,params:g,...S}=p.route,b=g===!1||g===null?{}:(g??!0)===!0?d:Object.assign(d,Ua(g,d));u={from:i.from,...S,params:b},f=n(u)}}}return f&&(h.maskedLocation=f),h};return i.mask?a(i,{from:i.from,...i.mask}):a(i)},this.commitLocation=({viewTransition:i,ignoreBlocker:n,...a})=>{const l=()=>{const f=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];f.forEach(p=>{a.state[p]=this.latestLocation.state[p]});const d=Do(a.state,this.latestLocation.state);return f.forEach(p=>{delete a.state[p]}),d},u=qa(this.latestLocation.href)===qa(a.href),h=this.commitLocationPromise;if(this.commitLocationPromise=ql(()=>{h?.resolve()}),u&&l())this.load();else{let{maskedLocation:f,hashScrollIntoView:d,url:p,...v}=a;f&&(v={...f,state:{...f.state,__tempKey:void 0,__tempLocation:{...v,search:v.searchStr,state:{...v.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(v.unmaskOnReload??this.options.unmaskOnReload??!1)&&(v.state.__tempKey=this.tempLocationKey)),v.state.__hashScrollIntoViewOptions=d??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=i,this.history[a.replace?"replace":"push"](v.publicHref,v.state,{ignoreBlocker:n})}return this.resetNextScroll=a.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:i,resetScroll:n,hashScrollIntoView:a,viewTransition:l,ignoreBlocker:u,href:h,...f}={})=>{if(h){const v=this.history.location.state.__TSR_index,g=Nd(h,{__TSR_index:i?v:v+1}),S=new URL(g.pathname,this.origin),b=xp(this.rewrite,S);f.to=b.pathname,f.search=this.options.parseSearch(g.search),f.hash=g.hash.slice(1)}const d=this.buildLocation({...f,_includeValidateSearch:!0});this.pendingBuiltLocation=d;const p=this.commitLocation({...d,viewTransition:l,replace:i,resetScroll:n,hashScrollIntoView:a,ignoreBlocker:u});return Promise.resolve().then(()=>{this.pendingBuiltLocation===d&&(this.pendingBuiltLocation=void 0)}),p},this.navigate=async({to:i,reloadDocument:n,href:a,publicHref:l,...u})=>{let h=!1;if(a)try{new URL(`${a}`),h=!0}catch{}if(h&&!n&&(n=!0),n){if(i!==void 0||!a){const d=this.buildLocation({to:i,...u});a=a??d.url.href,l=l??d.url.href}const f=!h&&l?l:a;if(Hd(f))return Promise.resolve();if(!u.ignoreBlocker){const p=this.history.getBlockers?.()??[];for(const v of p)if(v?.blockerFn&&await v.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return u.replace?window.location.replace(f):window.location.href=f,Promise.resolve()}return this.buildAndCommitLocation({...u,href:a,to:i,_isNavigate:!0})},this.beforeLoad=()=>{if(this.cancelMatches(),this.updateLatestLocation(),this.isServer){const n=this.buildLocation({to:this.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(this.latestLocation.publicHref!==n.publicHref||n.url.origin!==this.origin){const a=this.getParsedLocationHref(n);throw sw({href:a})}}const i=this.matchRoutes(this.latestLocation);this.__store.setState(n=>({...n,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:i,cachedMatches:n.cachedMatches.filter(a=>!i.some(l=>l.id===a.id))}))},this.load=async i=>{let n,a,l;for(l=new Promise(h=>{this.startTransition(async()=>{try{this.beforeLoad();const f=this.latestLocation,d=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...Oo({resolvedLocation:d,location:f})}),this.emit({type:"onBeforeLoad",...Oo({resolvedLocation:d,location:f})}),await Ny({router:this,sync:i?.sync,matches:this.state.pendingMatches,location:f,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let p=[],v=[],g=[];wu(()=>{this.__store.setState(S=>{const b=S.matches,C=S.pendingMatches||S.matches;return p=b.filter(x=>!C.some(E=>E.id===x.id)),v=C.filter(x=>!b.some(E=>E.id===x.id)),g=C.filter(x=>b.some(E=>E.id===x.id)),{...S,isLoading:!1,loadedAt:Date.now(),matches:C,pendingMatches:void 0,cachedMatches:[...S.cachedMatches,...p.filter(x=>x.status!=="error"&&x.status!=="notFound")]}}),this.clearExpiredCache()}),[[p,"onLeave"],[v,"onEnter"],[g,"onStay"]].forEach(([S,b])=>{S.forEach(C=>{this.looseRoutesById[C.routeId].options[b]?.(C)})})})})}})}catch(f){wr(f)?(n=f,this.isServer||this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):Vs(f)&&(a=f),this.__store.setState(d=>({...d,statusCode:n?n.status:a?404:d.matches.some(p=>p.status==="error")?500:200,redirect:n}))}this.latestLoadPromise===l&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),h()})}),this.latestLoadPromise=l,await l;this.latestLoadPromise&&l!==this.latestLoadPromise;)await this.latestLoadPromise;let u;this.hasNotFoundMatch()?u=404:this.__store.state.matches.some(h=>h.status==="error")&&(u=500),u!==void 0&&this.__store.setState(h=>({...h,statusCode:u}))},this.startViewTransition=i=>{const n=this.shouldViewTransition??this.options.defaultViewTransition;if(delete this.shouldViewTransition,n&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let a;if(typeof n=="object"&&this.isViewTransitionTypesSupported){const l=this.latestLocation,u=this.state.resolvedLocation,h=typeof n.types=="function"?n.types(Oo({resolvedLocation:u,location:l})):n.types;if(h===!1){i();return}a={update:i,types:h}}else a=i;document.startViewTransition(a)}else i()},this.updateMatch=(i,n)=>{this.startTransition(()=>{const a=this.state.pendingMatches?.some(l=>l.id===i)?"pendingMatches":this.state.matches.some(l=>l.id===i)?"matches":this.state.cachedMatches.some(l=>l.id===i)?"cachedMatches":"";a&&this.__store.setState(l=>({...l,[a]:l[a]?.map(u=>u.id===i?n(u):u)}))})},this.getMatch=i=>{const n=a=>a.id===i;return this.state.cachedMatches.find(n)??this.state.pendingMatches?.find(n)??this.state.matches.find(n)},this.invalidate=i=>{const n=a=>i?.filter?.(a)??!0?{...a,invalid:!0,...i?.forcePending||a.status==="error"||a.status==="notFound"?{status:"pending",error:void 0}:void 0}:a;return this.__store.setState(a=>({...a,matches:a.matches.map(n),cachedMatches:a.cachedMatches.map(n),pendingMatches:a.pendingMatches?.map(n)})),this.shouldViewTransition=!1,this.load({sync:i?.sync})},this.getParsedLocationHref=i=>{let n=i.url.href;return this.origin&&i.url.origin===this.origin&&(n=n.replace(this.origin,"")||"/"),n},this.resolveRedirect=i=>{const n=i.headers.get("Location");if(i.options.href){if(n)try{const a=new URL(n);if(this.origin&&a.origin===this.origin){const l=a.pathname+a.search+a.hash;i.options.href=l,i.headers.set("Location",l)}}catch{}}else{const a=this.buildLocation(i.options),l=this.getParsedLocationHref(a);i.options.href=l,i.headers.set("Location",l)}return i.headers.get("Location")||i.headers.set("Location",i.options.href),i},this.clearCache=i=>{const n=i?.filter;n!==void 0?this.__store.setState(a=>({...a,cachedMatches:a.cachedMatches.filter(l=>!n(l))})):this.__store.setState(a=>({...a,cachedMatches:[]}))},this.clearExpiredCache=()=>{const i=n=>{const a=this.looseRoutesById[n.routeId];if(!a.options.loader)return!0;const l=(n.preload?a.options.preloadGcTime??this.options.defaultPreloadGcTime:a.options.gcTime??this.options.defaultGcTime)??300*1e3;return n.status==="error"?!0:Date.now()-n.updatedAt>=l};this.clearCache({filter:i})},this.loadRouteChunk=lw,this.preloadRoute=async i=>{const n=this.buildLocation(i);let a=this.matchRoutes(n,{throwOnError:!0,preload:!0,dest:i});const l=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(h=>h.id)),u=new Set([...l,...this.state.cachedMatches.map(h=>h.id)]);wu(()=>{a.forEach(h=>{u.has(h.id)||this.__store.setState(f=>({...f,cachedMatches:[...f.cachedMatches,h]}))})});try{return a=await Ny({router:this,matches:a,location:n,preload:!0,updateMatch:(h,f)=>{l.has(h)?a=a.map(d=>d.id===h?f(d):d):this.updateMatch(h,f)}}),a}catch(h){if(wr(h))return h.options.reloadDocument?void 0:await this.preloadRoute({...h.options,_fromLocation:n});Vs(h)||console.error(h);return}},this.matchRoute=(i,n)=>{const a={...i,to:i.to?this.resolvePathWithBase(i.from||"",i.to):void 0,params:i.params||{},leaveParams:!0},l=this.buildLocation(a);if(n?.pending&&this.state.status!=="pending")return!1;const h=(n?.pending===void 0?!this.state.isLoading:n.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,f=$2(l.pathname,n?.caseSensitive??!1,n?.fuzzy??!1,h.pathname,this.processedTree);return!f||i.params&&!Do(f.rawParams,i.params,{partial:!0})?!1:n?.includeSearch??!0?Do(h.search,l.search,{partial:!0})?f.rawParams:!1:f.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(i=>i.status==="notFound"||i.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??ok,parseSearch:e.parseSearch??ak}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}get looseRoutesById(){return this.routesById}matchRoutesInternal(e,i){const n=this.getMatchedRoutes(e.pathname),{foundRoute:a,routeParams:l,parsedParams:u}=n;let{matchedRoutes:h}=n,f=!1;(a?a.path!=="/"&&l["**"]:qa(e.pathname))&&(this.options.notFoundRoute?h=[...h,this.options.notFoundRoute]:f=!0);const d=(()=>{if(f){if(this.options.notFoundMode!=="root")for(let g=h.length-1;g>=0;g--){const S=h[g];if(S.children)return S.id}return js}})(),p=[],v=g=>g?.id?g.context??this.options.context??void 0:this.options.context??void 0;return h.forEach((g,S)=>{const b=p[S-1],[C,x,E]=(()=>{const N=b?.search??e.search,P=b?._strictSearch??void 0;try{const T=kp(g.options.validateSearch,{...N})??void 0;return[{...N,...T},{...P,...T},void 0]}catch(T){let L=T;if(T instanceof Wd||(L=new Wd(T.message,{cause:T})),i?.throwOnError)throw L;return[N,{},L]}})(),A=g.options.loaderDeps?.({search:C})??"",B=A?JSON.stringify(A):"",{interpolatedPath:R,usedParams:$}=D_({path:g.fullPath,params:l,decodeCharMap:this.pathParamsDecodeCharMap}),F=g.id+R+B,U=this.getMatch(F),z=this.state.matches.find(N=>N.routeId===g.id),V=U?._strictParams??$;let se;if(!U)if(g.options.skipRouteOnParseError)for(const N in $)N in u&&(V[N]=u[N]);else{const N=g.options.params?.parse??g.options.parseParams;if(N)try{Object.assign(V,N(V))}catch(P){if(Vs(P)||wr(P)?se=P:se=new Sk(P.message,{cause:P}),i?.throwOnError)throw se}}Object.assign(l,V);const ee=z?"stay":"enter";let M;if(U)M={...U,cause:ee,params:z?Sr(z.params,l):l,_strictParams:V,search:Sr(z?z.search:U.search,C),_strictSearch:x};else{const N=g.options.loader||g.options.beforeLoad||g.lazyFn||cw(g)?"pending":"success";M={id:F,ssr:this.isServer?void 0:g.options.ssr,index:S,routeId:g.id,params:z?Sr(z.params,l):l,_strictParams:V,pathname:R,updatedAt:Date.now(),search:z?Sr(z.search,C):C,_strictSearch:x,searchError:void 0,status:N,isFetching:!1,error:void 0,paramsError:se,__routeContext:void 0,_nonReactive:{loadPromise:ql()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:ee,loaderDeps:z?Sr(z.loaderDeps,A):A,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:g.options.staticData||{},fullPath:g.fullPath}}i?.preload||(M.globalNotFound=d===g.id),M.searchError=E;const O=v(b);M.context={...O,...M.__routeContext,...M.__beforeLoadContext},p.push(M)}),p.forEach((g,S)=>{const b=this.looseRoutesById[g.routeId];if(!this.getMatch(g.id)&&i?._buildLocation!==!0){const x=p[S-1],E=v(x);if(b.options.context){const A={deps:g.loaderDeps,params:g.params,context:E??{},location:e,navigate:B=>this.navigate({...B,_fromLocation:e}),buildLocation:this.buildLocation,cause:g.cause,abortController:g.abortController,preload:!!g.preload,matches:p};g.__routeContext=b.options.context(A)??void 0}g.context={...E,...g.__routeContext,...g.__beforeLoadContext}}}),p}}class Wd extends Error{}class Sk extends Error{}function yk(t){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:t,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function kp(t,e){if(t==null)return{};if("~standard"in t){const i=t["~standard"].validate(e);if(i instanceof Promise)throw new Wd("Async validation not supported");if(i.issues)throw new Wd(JSON.stringify(i.issues,void 0,2),{cause:i});return i.value}return"parse"in t?t.parse(e):typeof t=="function"?t(e):{}}function bk({pathname:t,routesById:e,processedTree:i}){const n={},a=qa(t);let l,u;const h=W2(a,i,!0);return h&&(l=h.route,Object.assign(n,h.rawParams),u=Object.assign({},h.parsedParams)),{matchedRoutes:h?.branch||[e[js]],routeParams:n,foundRoute:l,parsedParams:u}}function wk({search:t,dest:e,destRoutes:i,_includeValidateSearch:n}){const a=i.reduce((h,f)=>{const d=[];if("search"in f.options)f.options.search?.middlewares&&d.push(...f.options.search.middlewares);else if(f.options.preSearchFilters||f.options.postSearchFilters){const p=({search:v,next:g})=>{let S=v;"preSearchFilters"in f.options&&f.options.preSearchFilters&&(S=f.options.preSearchFilters.reduce((C,x)=>x(C),v));const b=g(S);return"postSearchFilters"in f.options&&f.options.postSearchFilters?f.options.postSearchFilters.reduce((C,x)=>x(C),b):b};d.push(p)}if(n&&f.options.validateSearch){const p=({search:v,next:g})=>{const S=g(v);try{return{...S,...kp(f.options.validateSearch,S)??void 0}}catch{return S}};d.push(p)}return h.concat(d)},[])??[],l=({search:h})=>e.search?e.search===!0?h:Ua(e.search,h):{};a.push(l);const u=(h,f)=>{if(h>=a.length)return f;const d=a[h];return d({search:f,next:v=>u(h+1,v)})};return u(0,t)}const Ck="Error preloading route! ☝️";class dw{constructor(e){if(this.init=i=>{this.originalIndex=i.originalIndex;const n=this.options,a=!n?.path&&!n?.id;this.parentRoute=this.options.getParentRoute?.(),a?this._path=js:this.parentRoute||qn(!1);let l=a?js:n?.path;l&&l!=="/"&&(l=ew(l));const u=n?.id||l;let h=a?js:gd([this.parentRoute.id===js?"":this.parentRoute.id,u]);l===js&&(l="/"),h!==js&&(h=gd(["/",h]));const f=h===js?"/":gd([this.parentRoute.fullPath,l]);this._path=l,this._id=h,this._fullPath=f,this._to=qa(f)},this.addChildren=i=>this._addFileChildren(i),this._addFileChildren=i=>(Array.isArray(i)&&(this.children=i),typeof i=="object"&&i!==null&&(this.children=Object.values(i)),this),this._addFileTypes=()=>this,this.updateLoader=i=>(Object.assign(this.options,i),this),this.update=i=>(Object.assign(this.options,i),this),this.lazy=i=>(this.lazyFn=i,this),this.redirect=i=>sw({from:this.fullPath,...i}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class xk extends dw{constructor(e){super(e)}}var w=Du();const We=G1(w),fw=h2({__proto__:null,default:We},[w]),ed=typeof window<"u"?w.useLayoutEffect:w.useEffect;function B_(t){const e=w.useRef({value:t,prev:null}),i=e.current.value;return t!==i&&(e.current={value:t,prev:i}),e.current.prev}function kk(t,e,i={},n={}){w.useEffect(()=>{if(!t.current||n.disabled||typeof IntersectionObserver!="function")return;const a=new IntersectionObserver(([l])=>{e(l)},i);return a.observe(t.current),()=>{a.disconnect()}},[e,i,n.disabled,t])}function Ek(t){const e=w.useRef(null);return w.useImperativeHandle(t,()=>e.current,[]),e}function Lg(t){const e=t.errorComponent??nf;return j.jsx(Tk,{getResetKey:t.getResetKey,onCatch:t.onCatch,children:({error:i,reset:n})=>i?w.createElement(e,{error:i,reset:n}):t.children})}class Tk extends w.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(e){return{resetKey:e.getResetKey()}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidUpdate(e,i){i.error&&i.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(e,i){this.props.onCatch&&this.props.onCatch(e,i)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function nf({error:t}){const[e,i]=w.useState(!1);return j.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[j.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[j.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),j.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>i(n=>!n),children:e?"Hide Error":"Show Error"})]}),j.jsx("div",{style:{height:".25rem"}}),e?j.jsx("div",{children:j.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:t.message?j.jsx("code",{children:t.message}):null})}):null]})}function Rk({children:t,fallback:e=null}){return Ak()?j.jsx(We.Fragment,{children:t}):j.jsx(We.Fragment,{children:e})}function Ak(){return We.useSyncExternalStore(Mk,()=>!0,()=>!1)}function Mk(){return()=>{}}var N_={exports:{}},P_={},z_={exports:{}},H_={};var Py;function Lk(){if(Py)return H_;Py=1;var t=Du();function e(v,g){return v===g&&(v!==0||1/v===1/g)||v!==v&&g!==g}var i=typeof Object.is=="function"?Object.is:e,n=t.useState,a=t.useEffect,l=t.useLayoutEffect,u=t.useDebugValue;function h(v,g){var S=g(),b=n({inst:{value:S,getSnapshot:g}}),C=b[0].inst,x=b[1];return l(function(){C.value=S,C.getSnapshot=g,f(C)&&x({inst:C})},[v,S,g]),a(function(){return f(C)&&x({inst:C}),v(function(){f(C)&&x({inst:C})})},[v]),u(S),S}function f(v){var g=v.getSnapshot;v=v.value;try{var S=g();return!i(v,S)}catch{return!0}}function d(v,g){return g()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:h;return H_.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:p,H_}var zy;function Dk(){return zy||(zy=1,z_.exports=Lk()),z_.exports}var Hy;function Ok(){if(Hy)return P_;Hy=1;var t=Du(),e=Dk();function i(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var n=typeof Object.is=="function"?Object.is:i,a=e.useSyncExternalStore,l=t.useRef,u=t.useEffect,h=t.useMemo,f=t.useDebugValue;return P_.useSyncExternalStoreWithSelector=function(d,p,v,g,S){var b=l(null);if(b.current===null){var C={hasValue:!1,value:null};b.current=C}else C=b.current;b=h(function(){function E(F){if(!A){if(A=!0,B=F,F=g(F),S!==void 0&&C.hasValue){var U=C.value;if(S(U,F))return R=U}return R=F}if(U=R,n(B,F))return U;var z=g(F);return S!==void 0&&S(U,z)?(B=F,U):(B=F,R=z)}var A=!1,B,R,$=v===void 0?null:v;return[function(){return E(p())},$===null?void 0:function(){return E($())}]},[p,v,g,S]);var x=a(d,b[0],b[1]);return u(function(){C.hasValue=!0,C.value=x},[x]),f(x),x},P_}var Iy;function Bk(){return Iy||(Iy=1,N_.exports=Ok()),N_.exports}var Nk=Bk();function Pk(t,e=n=>n,i={}){const n=i.equal??zk;return Nk.useSyncExternalStoreWithSelector(t.subscribe,()=>t.state,()=>t.state,e,n)}function zk(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[n,a]of t)if(!e.has(n)||!Object.is(a,e.get(n)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();const i=Uy(t);if(i.length!==Uy(e).length)return!1;for(let n=0;n<i.length;n++)if(!Object.prototype.hasOwnProperty.call(e,i[n])||!Object.is(t[i[n]],e[i[n]]))return!1;return!0}function Uy(t){return Object.keys(t).concat(Object.getOwnPropertySymbols(t))}const I_=w.createContext(null);function mw(){return typeof document>"u"?I_:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=I_,I_)}function qs(t){const e=w.useContext(mw());return t?.warn,e}function ks(t){const e=qs({warn:t?.router===void 0}),i=t?.router||e,n=w.useRef(void 0);return Pk(i.__store,a=>{if(t?.select){if(t.structuralSharing??i.options.defaultStructuralSharing){const l=Sr(n.current,t.select(a));return n.current=l,l}return t.select(a)}return a})}const af=w.createContext(void 0),Hk=w.createContext(void 0);function nn(t){const e=w.useContext(t.from?Hk:af);return ks({select:n=>{const a=n.matches.find(l=>t.from?t.from===l.routeId:l.id===e);if(qn(!((t.shouldThrow??!0)&&!a),`Could not find ${t.from?`an active match from "${t.from}"`:"a nearest match!"}`),a!==void 0)return t.select?t.select(a):a},structuralSharing:t.structuralSharing})}function Dg(t){return nn({from:t.from,strict:t.strict,structuralSharing:t.structuralSharing,select:e=>t.select?t.select(e.loaderData):e.loaderData})}function Og(t){const{select:e,...i}=t;return nn({...i,select:n=>e?e(n.loaderDeps):n.loaderDeps})}function of(t){return nn({from:t.from,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,strict:t.strict,select:e=>{const i=t.strict===!1?e.params:e._strictParams;return t.select?t.select(i):i}})}function Bg(t){return nn({from:t.from,strict:t.strict,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,select:e=>t.select?t.select(e.search):e.search})}function Ou(t){const e=qs();return w.useCallback(i=>e.navigate({...i,from:i.from??t?.from}),[t?.from,e])}var Ng=K1();const _w=G1(Ng);function Ik(t,e){const i=qs(),[n,a]=w.useState(!1),l=w.useRef(!1),u=Ek(e),{activeProps:h,inactiveProps:f,activeOptions:d,to:p,preload:v,preloadDelay:g,hashScrollIntoView:S,replace:b,startTransition:C,resetScroll:x,viewTransition:E,children:A,target:B,disabled:R,style:$,className:F,onClick:U,onFocus:z,onMouseEnter:V,onMouseLeave:se,onTouchStart:ee,ignoreBlocker:M,params:O,search:N,hash:P,state:T,mask:L,reloadDocument:H,unsafeRelative:Y,from:X,_fromLocation:D,...G}=t,ie=ks({select:Be=>Be.location.search,structuralSharing:!0}),ae=t.from,de=w.useMemo(()=>({...t,from:ae}),[i,ie,ae,t._fromLocation,t.hash,t.to,t.search,t.params,t.state,t.mask,t.unsafeRelative]),ue=w.useMemo(()=>i.buildLocation({...de}),[i,de]),he=w.useMemo(()=>{if(R)return;let Be=ue.maskedLocation?ue.maskedLocation.url.href:ue.url.href,Qe=!1;return i.origin&&(Be.startsWith(i.origin)?Be=i.history.createHref(Be.replace(i.origin,""))||"/":Qe=!0),{href:Be,external:Qe}},[R,ue.maskedLocation,ue.url,i.origin,i.history]),ve=w.useMemo(()=>{if(he?.external)return Hd(he.href)?void 0:he.href;try{return new URL(p),Hd(p)?void 0:p}catch{}},[p,he]),ye=t.reloadDocument||ve?!1:v??i.options.defaultPreload,Ae=g??i.options.defaultPreloadDelay??0,De=ks({select:Be=>{if(ve)return!1;if(d?.exact){if(!K2(Be.location.pathname,ue.pathname,i.basepath))return!1}else{const Qe=Ud(Be.location.pathname,i.basepath),Ye=Ud(ue.pathname,i.basepath);if(!(Qe.startsWith(Ye)&&(Qe.length===Ye.length||Qe[Ye.length]==="/")))return!1}return(d?.includeSearch??!0)&&!Do(Be.location.search,ue.search,{partial:!d?.exact,ignoreUndefined:!d?.explicitUndefined})?!1:d?.includeHash?Be.location.hash===ue.hash:!0}}),rt=w.useCallback(()=>{i.preloadRoute({...de}).catch(Be=>{console.warn(Be),console.warn(Ck)})},[i,de]),Ze=w.useCallback(Be=>{Be?.isIntersecting&&rt()},[rt]);kk(u,Ze,jk,{disabled:!!R||ye!=="viewport"}),w.useEffect(()=>{l.current||!R&&ye==="render"&&(rt(),l.current=!0)},[R,rt,ye]);const xe=Be=>{const Qe=Be.currentTarget.getAttribute("target"),Ye=B!==void 0?B:Qe;if(!R&&!Vk(Be)&&!Be.defaultPrevented&&(!Ye||Ye==="_self")&&Be.button===0){Be.preventDefault(),Ng.flushSync(()=>{a(!0)});const xt=i.subscribe("onResolved",()=>{xt(),a(!1)});i.navigate({...de,replace:b,resetScroll:x,hashScrollIntoView:S,startTransition:C,viewTransition:E,ignoreBlocker:M})}};if(ve)return{...G,ref:u,href:ve,...A&&{children:A},...B&&{target:B},...R&&{disabled:R},...$&&{style:$},...F&&{className:F},...U&&{onClick:U},...z&&{onFocus:z},...V&&{onMouseEnter:V},...se&&{onMouseLeave:se},...ee&&{onTouchStart:ee}};const ze=Be=>{R||ye&&rt()},pe=ze,_t=Be=>{if(!(R||!ye))if(!Ae)rt();else{const Qe=Be.target;if(Jc.has(Qe))return;const Ye=setTimeout(()=>{Jc.delete(Qe),rt()},Ae);Jc.set(Qe,Ye)}},yt=Be=>{if(R||!ye||!Ae)return;const Qe=Be.target,Ye=Jc.get(Qe);Ye&&(clearTimeout(Ye),Jc.delete(Qe))},dt=De?Ua(h,{})??Uk:U_,Ce=De?U_:Ua(f,{})??U_,_e=[F,dt.className,Ce.className].filter(Boolean).join(" "),Kt=($||dt.style||Ce.style)&&{...$,...dt.style,...Ce.style};return{...G,...dt,...Ce,href:he?.href,ref:u,onClick:eu([U,xe]),onFocus:eu([z,ze]),onMouseEnter:eu([V,_t]),onMouseLeave:eu([se,yt]),onTouchStart:eu([ee,pe]),disabled:!!R,target:B,...Kt&&{style:Kt},..._e&&{className:_e},...R&&Fk,...De&&$k,...n&&Wk}}const U_={},Uk={className:"active"},Fk={role:"link","aria-disabled":!0},$k={"data-status":"active","aria-current":"page"},Wk={"data-transitioning":"transitioning"},Jc=new WeakMap,jk={rootMargin:"100px"},eu=t=>e=>{for(const i of t)if(i){if(e.defaultPrevented)return;i(e)}},pw=w.forwardRef((t,e)=>{const{_asChild:i,...n}=t,{type:a,ref:l,...u}=Ik(n,e),h=typeof n.children=="function"?n.children({isActive:u["data-status"]==="active"}):n.children;return i===void 0&&delete u.disabled,w.createElement(i||"a",{...u,ref:l},h)});function Vk(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}class qk extends dw{constructor(e){super(e),this.useMatch=i=>nn({select:i?.select,from:this.id,structuralSharing:i?.structuralSharing}),this.useRouteContext=i=>nn({...i,from:this.id,select:n=>i?.select?i.select(n.context):n.context}),this.useSearch=i=>Bg({select:i?.select,structuralSharing:i?.structuralSharing,from:this.id}),this.useParams=i=>of({select:i?.select,structuralSharing:i?.structuralSharing,from:this.id}),this.useLoaderDeps=i=>Og({...i,from:this.id}),this.useLoaderData=i=>Dg({...i,from:this.id}),this.useNavigate=()=>Ou({from:this.fullPath}),this.Link=We.forwardRef((i,n)=>j.jsx(pw,{ref:n,from:this.fullPath,...i})),this.$$typeof=Symbol.for("react.memo")}}function Pg(t){return new qk(t)}class Yk extends xk{constructor(e){super(e),this.useMatch=i=>nn({select:i?.select,from:this.id,structuralSharing:i?.structuralSharing}),this.useRouteContext=i=>nn({...i,from:this.id,select:n=>i?.select?i.select(n.context):n.context}),this.useSearch=i=>Bg({select:i?.select,structuralSharing:i?.structuralSharing,from:this.id}),this.useParams=i=>of({select:i?.select,structuralSharing:i?.structuralSharing,from:this.id}),this.useLoaderDeps=i=>Og({...i,from:this.id}),this.useLoaderData=i=>Dg({...i,from:this.id}),this.useNavigate=()=>Ou({from:this.fullPath}),this.Link=We.forwardRef((i,n)=>j.jsx(pw,{ref:n,from:this.fullPath,...i})),this.$$typeof=Symbol.for("react.memo")}}function Gk(t){return new Yk(t)}function Fy(t){return typeof t=="object"?new $y(t,{silent:!0}).createRoute(t):new $y(t,{silent:!0}).createRoute}class $y{constructor(e,i){this.path=e,this.createRoute=n=>{this.silent;const a=Pg(n);return a.isRoot=!1,a},this.silent=i?.silent}}class Wy{constructor(e){this.useMatch=i=>nn({select:i?.select,from:this.options.id,structuralSharing:i?.structuralSharing}),this.useRouteContext=i=>nn({from:this.options.id,select:n=>i?.select?i.select(n.context):n.context}),this.useSearch=i=>Bg({select:i?.select,structuralSharing:i?.structuralSharing,from:this.options.id}),this.useParams=i=>of({select:i?.select,structuralSharing:i?.structuralSharing,from:this.options.id}),this.useLoaderDeps=i=>Og({...i,from:this.options.id}),this.useLoaderData=i=>Dg({...i,from:this.options.id}),this.useNavigate=()=>{const i=qs();return Ou({from:i.routesById[this.options.id].fullPath})},this.options=e,this.$$typeof=Symbol.for("react.memo")}}function jy(t){return typeof t=="object"?new Wy(t):e=>new Wy({id:t,...e})}function Kk(){const t=qs(),e=w.useRef({router:t,mounted:!1}),[i,n]=w.useState(!1),{hasPendingMatches:a,isLoading:l}=ks({select:v=>({isLoading:v.isLoading,hasPendingMatches:v.matches.some(g=>g.status==="pending")}),structuralSharing:!0}),u=B_(l),h=l||i||a,f=B_(h),d=l||a,p=B_(d);return t.startTransition=v=>{n(!0),w.startTransition(()=>{v(),n(!1)})},w.useEffect(()=>{const v=t.history.subscribe(t.load),g=t.buildLocation({to:t.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return qa(t.latestLocation.publicHref)!==qa(g.publicHref)&&t.commitLocation({...g,replace:!0}),()=>{v()}},[t,t.history]),ed(()=>{if(typeof window<"u"&&t.ssr||e.current.router===t&&e.current.mounted)return;e.current={router:t,mounted:!0},(async()=>{try{await t.load()}catch(g){console.error(g)}})()},[t]),ed(()=>{u&&!l&&t.emit({type:"onLoad",...Oo(t.state)})},[u,t,l]),ed(()=>{p&&!d&&t.emit({type:"onBeforeRouteMount",...Oo(t.state)})},[d,p,t]),ed(()=>{if(f&&!h){const v=Oo(t.state);t.emit({type:"onResolved",...v}),t.__store.setState(g=>({...g,status:"idle",resolvedLocation:g.location})),v.hrefChanged&&sk(t)}},[h,f,t]),null}function Xk(t){const e=ks({select:i=>`not-found-${i.location.pathname}-${i.status}`});return j.jsx(Lg,{getResetKey:()=>e,onCatch:(i,n)=>{if(Vs(i))t.onCatch?.(i,n);else throw i},errorComponent:({error:i})=>{if(Vs(i))return t.fallback?.(i);throw i},children:t.children})}function Zk(){return j.jsx("p",{children:"Not Found"})}function Nl(t){return j.jsx(j.Fragment,{children:t.children})}function gw(t,e,i){return e.options.notFoundComponent?j.jsx(e.options.notFoundComponent,{...i}):t.options.defaultNotFoundComponent?j.jsx(t.options.defaultNotFoundComponent,{...i}):j.jsx(Zk,{})}function Qk({children:t}){const e=qs();return e.isServer?j.jsx("script",{nonce:e.options.ssr?.nonce,dangerouslySetInnerHTML:{__html:t+";document.currentScript.remove()"}}):null}function Jk(){const t=qs();if(!t.isScrollRestoring||!t.isServer||typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation}))return null;const i=(t.options.getScrollRestorationKey||Cp)(t.latestLocation),n=i!==Cp(t.latestLocation)?i:void 0,a={storageKey:Fd,shouldScrollRestoration:!0};return n&&(a.key=n),j.jsx(Qk,{children:`(${iw.toString()})(${B2(JSON.stringify(a))})`})}const vw=w.memo(function({matchId:e}){const i=qs(),n=ks({select:E=>{const A=E.matches.find(B=>B.id===e);return qn(A),{routeId:A.routeId,ssr:A.ssr,_displayPending:A._displayPending}},structuralSharing:!0}),a=i.routesById[n.routeId],l=a.options.pendingComponent??i.options.defaultPendingComponent,u=l?j.jsx(l,{}):null,h=a.options.errorComponent??i.options.defaultErrorComponent,f=a.options.onCatch??i.options.defaultOnCatch,d=a.isRoot?a.options.notFoundComponent??i.options.notFoundRoute?.options.component:a.options.notFoundComponent,p=n.ssr===!1||n.ssr==="data-only",v=(!a.isRoot||a.options.wrapInSuspense||p)&&(a.options.wrapInSuspense??l??(a.options.errorComponent?.preload||p))?w.Suspense:Nl,g=h?Lg:Nl,S=d?Xk:Nl,b=ks({select:E=>E.loadedAt}),C=ks({select:E=>{const A=E.matches.findIndex(B=>B.id===e);return E.matches[A-1]?.routeId}}),x=a.isRoot?a.options.shellComponent??Nl:Nl;return j.jsxs(x,{children:[j.jsx(af.Provider,{value:e,children:j.jsx(v,{fallback:u,children:j.jsx(g,{getResetKey:()=>b,errorComponent:h||nf,onCatch:(E,A)=>{if(Vs(E))throw E;f?.(E,A)},children:j.jsx(S,{fallback:E=>{if(!d||E.routeId&&E.routeId!==n.routeId||!E.routeId&&!a.isRoot)throw E;return w.createElement(d,E)},children:p||n._displayPending?j.jsx(Rk,{fallback:u,children:j.jsx(Vy,{matchId:e})}):j.jsx(Vy,{matchId:e})})})})}),C===js&&i.options.scrollRestoration?j.jsxs(j.Fragment,{children:[j.jsx(eE,{}),j.jsx(Jk,{})]}):null]})});function eE(){const t=qs(),e=w.useRef(void 0);return j.jsx("script",{suppressHydrationWarning:!0,ref:i=>{i&&(e.current===void 0||e.current.href!==t.latestLocation.href)&&(t.emit({type:"onRendered",...Oo(t.state)}),e.current=t.latestLocation)}},t.latestLocation.state.__TSR_key)}const Vy=w.memo(function({matchId:e}){const i=qs(),{match:n,key:a,routeId:l}=ks({select:f=>{const d=f.matches.find(b=>b.id===e),p=d.routeId,g=(i.routesById[p].options.remountDeps??i.options.defaultRemountDeps)?.({routeId:p,loaderDeps:d.loaderDeps,params:d._strictParams,search:d._strictSearch});return{key:g?JSON.stringify(g):void 0,routeId:p,match:{id:d.id,status:d.status,error:d.error,invalid:d.invalid,_forcePending:d._forcePending,_displayPending:d._displayPending}}},structuralSharing:!0}),u=i.routesById[l],h=w.useMemo(()=>{const f=u.options.component??i.options.defaultComponent;return f?j.jsx(f,{},a):j.jsx(Sw,{})},[a,u.options.component,i.options.defaultComponent]);if(n._displayPending)throw i.getMatch(n.id)?._nonReactive.displayPendingPromise;if(n._forcePending)throw i.getMatch(n.id)?._nonReactive.minPendingPromise;if(n.status==="pending"){const f=u.options.pendingMinMs??i.options.defaultPendingMinMs;if(f){const d=i.getMatch(n.id);if(d&&!d._nonReactive.minPendingPromise&&!i.isServer){const p=ql();d._nonReactive.minPendingPromise=p,setTimeout(()=>{p.resolve(),d._nonReactive.minPendingPromise=void 0},f)}}throw i.getMatch(n.id)?._nonReactive.loadPromise}if(n.status==="notFound")return qn(Vs(n.error)),gw(i,u,n.error);if(n.status==="redirected")throw qn(wr(n.error)),i.getMatch(n.id)?._nonReactive.loadPromise;if(n.status==="error"){if(i.isServer){const f=(u.options.errorComponent??i.options.defaultErrorComponent)||nf;return j.jsx(f,{error:n.error,reset:void 0,info:{componentStack:""}})}throw n.error}return h}),Sw=w.memo(function(){const e=qs(),i=w.useContext(af),n=ks({select:d=>d.matches.find(p=>p.id===i)?.routeId}),a=e.routesById[n],l=ks({select:d=>{const v=d.matches.find(g=>g.id===i);return qn(v),v.globalNotFound}}),u=ks({select:d=>{const p=d.matches,v=p.findIndex(g=>g.id===i);return p[v+1]?.id}}),h=e.options.defaultPendingComponent?j.jsx(e.options.defaultPendingComponent,{}):null;if(l)return gw(e,a,void 0);if(!u)return null;const f=j.jsx(vw,{matchId:u});return n===js?j.jsx(w.Suspense,{fallback:h,children:f}):f});function tE(){const t=qs(),i=t.routesById[js].options.pendingComponent??t.options.defaultPendingComponent,n=i?j.jsx(i,{}):null,a=t.isServer||typeof document<"u"&&t.ssr?Nl:w.Suspense,l=j.jsxs(a,{fallback:n,children:[!t.isServer&&j.jsx(Kk,{}),j.jsx(iE,{})]});return t.options.InnerWrap?j.jsx(t.options.InnerWrap,{children:l}):l}function iE(){const t=qs(),e=ks({select:a=>a.matches[0]?.id}),i=ks({select:a=>a.loadedAt}),n=e?j.jsx(vw,{matchId:e}):null;return j.jsx(af.Provider,{value:e,children:t.options.disableGlobalCatchBoundary?n:j.jsx(Lg,{getResetKey:()=>i,errorComponent:nf,onCatch:a=>{a.message||a.toString()},children:n})})}const sE=t=>new rE(t);class rE extends vk{constructor(e){super(e)}}typeof globalThis<"u"?(globalThis.createFileRoute=Fy,globalThis.createLazyFileRoute=jy):typeof window<"u"&&(window.createFileRoute=Fy,window.createLazyFileRoute=jy);function nE({router:t,children:e,...i}){Object.keys(i).length>0&&t.update({...t.options,...i,context:{...t.options.context,...i.context}});const n=mw(),a=j.jsx(n.Provider,{value:t,children:e});return t.options.Wrap?j.jsx(t.options.Wrap,{children:a}):a}function aE({router:t,...e}){return j.jsx(nE,{router:t,...e,children:j.jsx(tE,{})})}function yw(){return typeof window<"u"}function bw(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function oE(t){return yw()?t instanceof Element||t instanceof bw(t).Element:!1}function lE(t){return yw()?t instanceof HTMLElement||t instanceof bw(t).HTMLElement:!1}const qy={};function zg(t,e){const i=w.useRef(qy);return i.current===qy&&(i.current=t(e)),i}const F_=fw[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],cE=F_&&F_!==w.useLayoutEffect?F_:t=>t();function jd(t){const e=zg(uE).current;return e.next=t,cE(e.effect),e.trampoline}function uE(){const t={next:void 0,callback:hE,trampoline:(...e)=>t.callback?.(...e),effect:()=>{t.callback=t.next}};return t}function hE(){}const dE=()=>{},Wl=typeof document<"u"?w.useLayoutEffect:dE;function Ep(t,e){if(t&&!e)return t;if(!t&&e)return e;if(t||e)return{...t,...e}}const Cu={};function ww(t,e,i,n,a){let l={...Tp(t,Cu)};return e&&(l=Sd(l,e)),i&&(l=Sd(l,i)),n&&(l=Sd(l,n)),l}function fE(t){if(t.length===0)return Cu;if(t.length===1)return Tp(t[0],Cu);let e={...Tp(t[0],Cu)};for(let i=1;i<t.length;i+=1)e=Sd(e,t[i]);return e}function Sd(t,e){return Cw(e)?e(t):mE(t,e)}function mE(t,e){if(!e)return t;for(const i in e){const n=e[i];switch(i){case"style":{t[i]=Ep(t.style,n);break}case"className":{t[i]=xw(t.className,n);break}default:_E(i,n)?t[i]=pE(t[i],n):t[i]=n}}return t}function _E(t,e){const i=t.charCodeAt(0),n=t.charCodeAt(1),a=t.charCodeAt(2);return i===111&&n===110&&a>=65&&a<=90&&(typeof e=="function"||typeof e>"u")}function Cw(t){return typeof t=="function"}function Tp(t,e){return Cw(t)?t(e):t??Cu}function pE(t,e){return e?t?i=>{if(gE(i)){const a=i;Rp(a);const l=e(a);return a.baseUIHandlerPrevented||t?.(a),l}const n=e(i);return t?.(i),n}:e:t}function Rp(t){return t.preventBaseUIHandler=()=>{t.baseUIHandlerPrevented=!0},t}function xw(t,e){return e?t?e+" "+t:e:t}function gE(t){return t!=null&&typeof t=="object"&&"nativeEvent"in t}function Hg(t,...e){const i=new URL("https://base-ui.com/production-error");return i.searchParams.set("code",t.toString()),e.forEach(n=>i.searchParams.append("args[]",n)),`Base UI error #${t}; visit ${i} for the full message.`}const vE=w.createContext(void 0);function SE(t=!1){const e=w.useContext(vE);if(e===void 0&&!t)throw new Error(Hg(16));return e}function yE(t){const{focusableWhenDisabled:e,disabled:i,composite:n=!1,tabIndex:a=0,isNativeButton:l}=t,u=n&&e!==!1,h=n&&e===!1;return{props:w.useMemo(()=>{const d={onKeyDown(p){i&&e&&p.key!=="Tab"&&p.preventDefault()}};return n||(d.tabIndex=a,!l&&i&&(d.tabIndex=e?a:-1)),(l&&(e||u)||!l&&i)&&(d["aria-disabled"]=i),l&&(!e||h)&&(d.disabled=i),d},[n,i,e,u,h,l,a])}}function bE(t={}){const{disabled:e=!1,focusableWhenDisabled:i,tabIndex:n=0,native:a=!0}=t,l=w.useRef(null),u=SE(!0)!==void 0,h=jd(()=>{const g=l.current;return!!(g?.tagName==="A"&&g?.href)}),{props:f}=yE({focusableWhenDisabled:i,disabled:e,composite:u,tabIndex:n,isNativeButton:a}),d=w.useCallback(()=>{const g=l.current;wE(g)&&u&&e&&f.disabled===void 0&&g.disabled&&(g.disabled=!1)},[e,f.disabled,u]);Wl(d,[d]);const p=w.useCallback((g={})=>{const{onClick:S,onMouseDown:b,onKeyUp:C,onKeyDown:x,onPointerDown:E,...A}=g;return ww({type:a?"button":void 0,onClick(R){if(e){R.preventDefault();return}S?.(R)},onMouseDown(R){e||b?.(R)},onKeyDown(R){if(e||(Rp(R),x?.(R)),R.baseUIHandlerPrevented)return;const $=R.target===R.currentTarget&&!a&&!h()&&!e,F=R.key==="Enter",U=R.key===" ";$&&((U||F)&&R.preventDefault(),F&&S?.(R))},onKeyUp(R){e||(Rp(R),C?.(R)),!R.baseUIHandlerPrevented&&R.target===R.currentTarget&&!a&&!e&&R.key===" "&&S?.(R)},onPointerDown(R){if(e){R.preventDefault();return}E?.(R)}},a?void 0:{role:"button"},f,A)},[e,f,a,h]),v=jd(g=>{l.current=g,d()});return{getButtonProps:p,buttonRef:v}}function wE(t){return lE(t)&&t.tagName==="BUTTON"}function Yy(t,e,i,n){const a=zg(kw).current;return xE(a,t,e,i,n)&&Ew(a,[t,e,i,n]),a.callback}function CE(t){const e=zg(kw).current;return kE(e,t)&&Ew(e,t),e.callback}function kw(){return{callback:null,cleanup:null,refs:[]}}function xE(t,e,i,n,a){return t.refs[0]!==e||t.refs[1]!==i||t.refs[2]!==n||t.refs[3]!==a}function kE(t,e){return t.refs.length!==e.length||t.refs.some((i,n)=>i!==e[n])}function Ew(t,e){if(t.refs=e,e.every(i=>i==null)){t.callback=null;return}t.callback=i=>{if(t.cleanup&&(t.cleanup(),t.cleanup=null),i!=null){const n=Array(e.length).fill(null);for(let a=0;a<e.length;a+=1){const l=e[a];if(l!=null)switch(typeof l){case"function":{const u=l(i);typeof u=="function"&&(n[a]=u);break}case"object":{l.current=i;break}}}t.cleanup=()=>{for(let a=0;a<e.length;a+=1){const l=e[a];if(l!=null)switch(typeof l){case"function":{const u=n[a];typeof u=="function"?u():l(null);break}case"object":{l.current=null;break}}}}}}}const EE=parseInt(w.version,10);function TE(t){return EE>=t}function Gy(t){if(!w.isValidElement(t))return null;const e=t,i=e.props;return(TE(19)?i?.ref:e.ref)??null}function RE(t,e){const i={};for(const n in t){const a=t[n];if(e?.hasOwnProperty(n)){const l=e[n](a);l!=null&&Object.assign(i,l);continue}a===!0?i[`data-${n.toLowerCase()}`]="":a&&(i[`data-${n.toLowerCase()}`]=a.toString())}return i}function AE(t,e){return typeof t=="function"?t(e):t}function ME(t,e){return typeof t=="function"?t(e):t}function Hr(){}const Fn=Object.freeze({});function Tw(t,e,i={}){const n=e.render,a=LE(e,i);if(i.enabled===!1)return null;const l=i.state??Fn;return DE(t,n,a,l)}function LE(t,e={}){const{className:i,style:n,render:a}=t,{state:l=Fn,ref:u,props:h,stateAttributesMapping:f,enabled:d=!0}=e,p=d?AE(i,l):void 0,v=d?ME(n,l):void 0,g=d?RE(l,f):Fn,S=d?Ep(g,Array.isArray(h)?fE(h):h)??Fn:Fn;return typeof document<"u"&&(d?Array.isArray(u)?S.ref=CE([S.ref,Gy(a),...u]):S.ref=Yy(S.ref,Gy(a),u):Yy(null,null)),d?(p!==void 0&&(S.className=xw(S.className,p)),v!==void 0&&(S.style=Ep(S.style,v)),S):Fn}function DE(t,e,i,n){if(e){if(typeof e=="function")return e(i,n);const a=ww(i,e.props);return a.ref=i.ref,w.cloneElement(e,a)}if(t&&typeof t=="string")return OE(t,i);throw new Error(Hg(8))}function OE(t,e){return t==="button"?w.createElement("button",{type:"button",...e,key:e.key}):t==="img"?w.createElement("img",{alt:"",...e,key:e.key}):w.createElement(t,e)}const BE=w.forwardRef(function(e,i){const{render:n,className:a,disabled:l=!1,focusableWhenDisabled:u=!1,nativeButton:h=!0,...f}=e,{getButtonProps:d,buttonRef:p}=bE({disabled:l,focusableWhenDisabled:u,native:h}),v=w.useMemo(()=>({disabled:l}),[l]);return Tw("button",e,{state:v,ref:[i,p],props:[f,d]})});function Rw(t){var e,i,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(e=0;e<a;e++)t[e]&&(i=Rw(t[e]))&&(n&&(n+=" "),n+=i)}else for(i in t)t[i]&&(n&&(n+=" "),n+=i);return n}function Aw(){for(var t,e,i=0,n="",a=arguments.length;i<a;i++)(t=arguments[i])&&(e=Rw(t))&&(n&&(n+=" "),n+=e);return n}const Ky=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Xy=Aw,NE=(t,e)=>i=>{var n;if(e?.variants==null)return Xy(t,i?.class,i?.className);const{variants:a,defaultVariants:l}=e,u=Object.keys(a).map(d=>{const p=i?.[d],v=l?.[d];if(p===null)return null;const g=Ky(p)||Ky(v);return a[d][g]}),h=i&&Object.entries(i).reduce((d,p)=>{let[v,g]=p;return g===void 0||(d[v]=g),d},{}),f=e==null||(n=e.compoundVariants)===null||n===void 0?void 0:n.reduce((d,p)=>{let{class:v,className:g,...S}=p;return Object.entries(S).every(b=>{let[C,x]=b;return Array.isArray(x)?x.includes({...l,...h}[C]):{...l,...h}[C]===x})?[...d,v,g]:d},[]);return Xy(t,u,f,i?.class,i?.className)},PE=(t,e)=>{const i=new Array(t.length+e.length);for(let n=0;n<t.length;n++)i[n]=t[n];for(let n=0;n<e.length;n++)i[t.length+n]=e[n];return i},zE=(t,e)=>({classGroupId:t,validator:e}),Mw=(t=new Map,e=null,i)=>({nextPart:t,validators:e,classGroupId:i}),Vd="-",Zy=[],HE="arbitrary..",IE=t=>{const e=FE(t),{conflictingClassGroups:i,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return UE(u);const h=u.split(Vd),f=h[0]===""&&h.length>1?1:0;return Lw(h,f,e)},getConflictingClassGroupIds:(u,h)=>{if(h){const f=n[u],d=i[u];return f?d?PE(d,f):f:d||Zy}return i[u]||Zy}}},Lw=(t,e,i)=>{if(t.length-e===0)return i.classGroupId;const a=t[e],l=i.nextPart.get(a);if(l){const d=Lw(t,e+1,l);if(d)return d}const u=i.validators;if(u===null)return;const h=e===0?t.join(Vd):t.slice(e).join(Vd),f=u.length;for(let d=0;d<f;d++){const p=u[d];if(p.validator(h))return p.classGroupId}},UE=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),i=e.indexOf(":"),n=e.slice(0,i);return n?HE+n:void 0})(),FE=t=>{const{theme:e,classGroups:i}=t;return $E(i,e)},$E=(t,e)=>{const i=Mw();for(const n in t){const a=t[n];Ig(a,i,n,e)}return i},Ig=(t,e,i,n)=>{const a=t.length;for(let l=0;l<a;l++){const u=t[l];WE(u,e,i,n)}},WE=(t,e,i,n)=>{if(typeof t=="string"){jE(t,e,i);return}if(typeof t=="function"){VE(t,e,i,n);return}qE(t,e,i,n)},jE=(t,e,i)=>{const n=t===""?e:Dw(e,t);n.classGroupId=i},VE=(t,e,i,n)=>{if(YE(t)){Ig(t(n),e,i,n);return}e.validators===null&&(e.validators=[]),e.validators.push(zE(i,t))},qE=(t,e,i,n)=>{const a=Object.entries(t),l=a.length;for(let u=0;u<l;u++){const[h,f]=a[u];Ig(f,Dw(e,h),i,n)}},Dw=(t,e)=>{let i=t;const n=e.split(Vd),a=n.length;for(let l=0;l<a;l++){const u=n[l];let h=i.nextPart.get(u);h||(h=Mw(),i.nextPart.set(u,h)),i=h}return i},YE=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,GE=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,i=Object.create(null),n=Object.create(null);const a=(l,u)=>{i[l]=u,e++,e>t&&(e=0,n=i,i=Object.create(null))};return{get(l){let u=i[l];if(u!==void 0)return u;if((u=n[l])!==void 0)return a(l,u),u},set(l,u){l in i?i[l]=u:a(l,u)}}},Ap="!",Qy=":",KE=[],Jy=(t,e,i,n,a)=>({modifiers:t,hasImportantModifier:e,baseClassName:i,maybePostfixModifierPosition:n,isExternal:a}),XE=t=>{const{prefix:e,experimentalParseClassName:i}=t;let n=a=>{const l=[];let u=0,h=0,f=0,d;const p=a.length;for(let C=0;C<p;C++){const x=a[C];if(u===0&&h===0){if(x===Qy){l.push(a.slice(f,C)),f=C+1;continue}if(x==="/"){d=C;continue}}x==="["?u++:x==="]"?u--:x==="("?h++:x===")"&&h--}const v=l.length===0?a:a.slice(f);let g=v,S=!1;v.endsWith(Ap)?(g=v.slice(0,-1),S=!0):v.startsWith(Ap)&&(g=v.slice(1),S=!0);const b=d&&d>f?d-f:void 0;return Jy(l,S,g,b)};if(e){const a=e+Qy,l=n;n=u=>u.startsWith(a)?l(u.slice(a.length)):Jy(KE,!1,u,void 0,!0)}if(i){const a=n;n=l=>i({className:l,parseClassName:a})}return n},ZE=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((i,n)=>{e.set(i,1e6+n)}),i=>{const n=[];let a=[];for(let l=0;l<i.length;l++){const u=i[l],h=u[0]==="[",f=e.has(u);h||f?(a.length>0&&(a.sort(),n.push(...a),a=[]),n.push(u)):a.push(u)}return a.length>0&&(a.sort(),n.push(...a)),n}},QE=t=>({cache:GE(t.cacheSize),parseClassName:XE(t),sortModifiers:ZE(t),...IE(t)}),JE=/\s+/,eT=(t,e)=>{const{parseClassName:i,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:l}=e,u=[],h=t.trim().split(JE);let f="";for(let d=h.length-1;d>=0;d-=1){const p=h[d],{isExternal:v,modifiers:g,hasImportantModifier:S,baseClassName:b,maybePostfixModifierPosition:C}=i(p);if(v){f=p+(f.length>0?" "+f:f);continue}let x=!!C,E=n(x?b.substring(0,C):b);if(!E){if(!x){f=p+(f.length>0?" "+f:f);continue}if(E=n(b),!E){f=p+(f.length>0?" "+f:f);continue}x=!1}const A=g.length===0?"":g.length===1?g[0]:l(g).join(":"),B=S?A+Ap:A,R=B+E;if(u.indexOf(R)>-1)continue;u.push(R);const $=a(E,x);for(let F=0;F<$.length;++F){const U=$[F];u.push(B+U)}f=p+(f.length>0?" "+f:f)}return f},tT=(...t)=>{let e=0,i,n,a="";for(;e<t.length;)(i=t[e++])&&(n=Ow(i))&&(a&&(a+=" "),a+=n);return a},Ow=t=>{if(typeof t=="string")return t;let e,i="";for(let n=0;n<t.length;n++)t[n]&&(e=Ow(t[n]))&&(i&&(i+=" "),i+=e);return i},iT=(t,...e)=>{let i,n,a,l;const u=f=>{const d=e.reduce((p,v)=>v(p),t());return i=QE(d),n=i.cache.get,a=i.cache.set,l=h,h(f)},h=f=>{const d=n(f);if(d)return d;const p=eT(f,i);return a(f,p),p};return l=u,(...f)=>l(tT(...f))},sT=[],wi=t=>{const e=i=>i[t]||sT;return e.isThemeGetter=!0,e},Bw=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Nw=/^\((?:(\w[\w-]*):)?(.+)\)$/i,rT=/^\d+\/\d+$/,nT=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,aT=/\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$/,oT=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,lT=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,cT=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ml=t=>rT.test(t),it=t=>!!t&&!Number.isNaN(Number(t)),Aa=t=>!!t&&Number.isInteger(Number(t)),$_=t=>t.endsWith("%")&&it(t.slice(0,-1)),On=t=>nT.test(t),uT=()=>!0,hT=t=>aT.test(t)&&!oT.test(t),Pw=()=>!1,dT=t=>lT.test(t),fT=t=>cT.test(t),mT=t=>!Te(t)&&!Re(t),_T=t=>Kl(t,Iw,Pw),Te=t=>Bw.test(t),Co=t=>Kl(t,Uw,hT),W_=t=>Kl(t,yT,it),eb=t=>Kl(t,zw,Pw),pT=t=>Kl(t,Hw,fT),td=t=>Kl(t,Fw,dT),Re=t=>Nw.test(t),tu=t=>Xl(t,Uw),gT=t=>Xl(t,bT),tb=t=>Xl(t,zw),vT=t=>Xl(t,Iw),ST=t=>Xl(t,Hw),id=t=>Xl(t,Fw,!0),Kl=(t,e,i)=>{const n=Bw.exec(t);return n?n[1]?e(n[1]):i(n[2]):!1},Xl=(t,e,i=!1)=>{const n=Nw.exec(t);return n?n[1]?e(n[1]):i:!1},zw=t=>t==="position"||t==="percentage",Hw=t=>t==="image"||t==="url",Iw=t=>t==="length"||t==="size"||t==="bg-size",Uw=t=>t==="length",yT=t=>t==="number",bT=t=>t==="family-name",Fw=t=>t==="shadow",wT=()=>{const t=wi("color"),e=wi("font"),i=wi("text"),n=wi("font-weight"),a=wi("tracking"),l=wi("leading"),u=wi("breakpoint"),h=wi("container"),f=wi("spacing"),d=wi("radius"),p=wi("shadow"),v=wi("inset-shadow"),g=wi("text-shadow"),S=wi("drop-shadow"),b=wi("blur"),C=wi("perspective"),x=wi("aspect"),E=wi("ease"),A=wi("animate"),B=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],$=()=>[...R(),Re,Te],F=()=>["auto","hidden","clip","visible","scroll"],U=()=>["auto","contain","none"],z=()=>[Re,Te,f],V=()=>[Ml,"full","auto",...z()],se=()=>[Aa,"none","subgrid",Re,Te],ee=()=>["auto",{span:["full",Aa,Re,Te]},Aa,Re,Te],M=()=>[Aa,"auto",Re,Te],O=()=>["auto","min","max","fr",Re,Te],N=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],P=()=>["start","end","center","stretch","center-safe","end-safe"],T=()=>["auto",...z()],L=()=>[Ml,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...z()],H=()=>[t,Re,Te],Y=()=>[...R(),tb,eb,{position:[Re,Te]}],X=()=>["no-repeat",{repeat:["","x","y","space","round"]}],D=()=>["auto","cover","contain",vT,_T,{size:[Re,Te]}],G=()=>[$_,tu,Co],ie=()=>["","none","full",d,Re,Te],ae=()=>["",it,tu,Co],de=()=>["solid","dashed","dotted","double"],ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],he=()=>[it,$_,tb,eb],ve=()=>["","none",b,Re,Te],ye=()=>["none",it,Re,Te],Ae=()=>["none",it,Re,Te],De=()=>[it,Re,Te],rt=()=>[Ml,"full",...z()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[On],breakpoint:[On],color:[uT],container:[On],"drop-shadow":[On],ease:["in","out","in-out"],font:[mT],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[On],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[On],shadow:[On],spacing:["px",it],text:[On],"text-shadow":[On],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ml,Te,Re,x]}],container:["container"],columns:[{columns:[it,Te,Re,h]}],"break-after":[{"break-after":B()}],"break-before":[{"break-before":B()}],"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:$()}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:U()}],"overscroll-x":[{"overscroll-x":U()}],"overscroll-y":[{"overscroll-y":U()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:V()}],"inset-x":[{"inset-x":V()}],"inset-y":[{"inset-y":V()}],start:[{start:V()}],end:[{end:V()}],top:[{top:V()}],right:[{right:V()}],bottom:[{bottom:V()}],left:[{left:V()}],visibility:["visible","invisible","collapse"],z:[{z:[Aa,"auto",Re,Te]}],basis:[{basis:[Ml,"full","auto",h,...z()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[it,Ml,"auto","initial","none",Te]}],grow:[{grow:["",it,Re,Te]}],shrink:[{shrink:["",it,Re,Te]}],order:[{order:[Aa,"first","last","none",Re,Te]}],"grid-cols":[{"grid-cols":se()}],"col-start-end":[{col:ee()}],"col-start":[{"col-start":M()}],"col-end":[{"col-end":M()}],"grid-rows":[{"grid-rows":se()}],"row-start-end":[{row:ee()}],"row-start":[{"row-start":M()}],"row-end":[{"row-end":M()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":O()}],"auto-rows":[{"auto-rows":O()}],gap:[{gap:z()}],"gap-x":[{"gap-x":z()}],"gap-y":[{"gap-y":z()}],"justify-content":[{justify:[...N(),"normal"]}],"justify-items":[{"justify-items":[...P(),"normal"]}],"justify-self":[{"justify-self":["auto",...P()]}],"align-content":[{content:["normal",...N()]}],"align-items":[{items:[...P(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...P(),{baseline:["","last"]}]}],"place-content":[{"place-content":N()}],"place-items":[{"place-items":[...P(),"baseline"]}],"place-self":[{"place-self":["auto",...P()]}],p:[{p:z()}],px:[{px:z()}],py:[{py:z()}],ps:[{ps:z()}],pe:[{pe:z()}],pt:[{pt:z()}],pr:[{pr:z()}],pb:[{pb:z()}],pl:[{pl:z()}],m:[{m:T()}],mx:[{mx:T()}],my:[{my:T()}],ms:[{ms:T()}],me:[{me:T()}],mt:[{mt:T()}],mr:[{mr:T()}],mb:[{mb:T()}],ml:[{ml:T()}],"space-x":[{"space-x":z()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":z()}],"space-y-reverse":["space-y-reverse"],size:[{size:L()}],w:[{w:[h,"screen",...L()]}],"min-w":[{"min-w":[h,"screen","none",...L()]}],"max-w":[{"max-w":[h,"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",i,tu,Co]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,Re,W_]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",$_,Te]}],"font-family":[{font:[gT,Te,e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,Re,Te]}],"line-clamp":[{"line-clamp":[it,"none",Re,W_]}],leading:[{leading:[l,...z()]}],"list-image":[{"list-image":["none",Re,Te]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Re,Te]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:H()}],"text-color":[{text:H()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...de(),"wavy"]}],"text-decoration-thickness":[{decoration:[it,"from-font","auto",Re,Co]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[it,"auto",Re,Te]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Re,Te]}],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",Re,Te]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Y()}],"bg-repeat":[{bg:X()}],"bg-size":[{bg:D()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Aa,Re,Te],radial:["",Re,Te],conic:[Aa,Re,Te]},ST,pT]}],"bg-color":[{bg:H()}],"gradient-from-pos":[{from:G()}],"gradient-via-pos":[{via:G()}],"gradient-to-pos":[{to:G()}],"gradient-from":[{from:H()}],"gradient-via":[{via:H()}],"gradient-to":[{to:H()}],rounded:[{rounded:ie()}],"rounded-s":[{"rounded-s":ie()}],"rounded-e":[{"rounded-e":ie()}],"rounded-t":[{"rounded-t":ie()}],"rounded-r":[{"rounded-r":ie()}],"rounded-b":[{"rounded-b":ie()}],"rounded-l":[{"rounded-l":ie()}],"rounded-ss":[{"rounded-ss":ie()}],"rounded-se":[{"rounded-se":ie()}],"rounded-ee":[{"rounded-ee":ie()}],"rounded-es":[{"rounded-es":ie()}],"rounded-tl":[{"rounded-tl":ie()}],"rounded-tr":[{"rounded-tr":ie()}],"rounded-br":[{"rounded-br":ie()}],"rounded-bl":[{"rounded-bl":ie()}],"border-w":[{border: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-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:H()}],"border-color-x":[{"border-x":H()}],"border-color-y":[{"border-y":H()}],"border-color-s":[{"border-s":H()}],"border-color-e":[{"border-e":H()}],"border-color-t":[{"border-t":H()}],"border-color-r":[{"border-r":H()}],"border-color-b":[{"border-b":H()}],"border-color-l":[{"border-l":H()}],"divide-color":[{divide:H()}],"outline-style":[{outline:[...de(),"none","hidden"]}],"outline-offset":[{"outline-offset":[it,Re,Te]}],"outline-w":[{outline:["",it,tu,Co]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",p,id,td]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",v,id,td]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[it,Co]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":ae()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",g,id,td]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[it,Re,Te]}],"mix-blend":[{"mix-blend":[...ue(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ue()}],"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":[it]}],"mask-image-linear-from-pos":[{"mask-linear-from":he()}],"mask-image-linear-to-pos":[{"mask-linear-to":he()}],"mask-image-linear-from-color":[{"mask-linear-from":H()}],"mask-image-linear-to-color":[{"mask-linear-to":H()}],"mask-image-t-from-pos":[{"mask-t-from":he()}],"mask-image-t-to-pos":[{"mask-t-to":he()}],"mask-image-t-from-color":[{"mask-t-from":H()}],"mask-image-t-to-color":[{"mask-t-to":H()}],"mask-image-r-from-pos":[{"mask-r-from":he()}],"mask-image-r-to-pos":[{"mask-r-to":he()}],"mask-image-r-from-color":[{"mask-r-from":H()}],"mask-image-r-to-color":[{"mask-r-to":H()}],"mask-image-b-from-pos":[{"mask-b-from":he()}],"mask-image-b-to-pos":[{"mask-b-to":he()}],"mask-image-b-from-color":[{"mask-b-from":H()}],"mask-image-b-to-color":[{"mask-b-to":H()}],"mask-image-l-from-pos":[{"mask-l-from":he()}],"mask-image-l-to-pos":[{"mask-l-to":he()}],"mask-image-l-from-color":[{"mask-l-from":H()}],"mask-image-l-to-color":[{"mask-l-to":H()}],"mask-image-x-from-pos":[{"mask-x-from":he()}],"mask-image-x-to-pos":[{"mask-x-to":he()}],"mask-image-x-from-color":[{"mask-x-from":H()}],"mask-image-x-to-color":[{"mask-x-to":H()}],"mask-image-y-from-pos":[{"mask-y-from":he()}],"mask-image-y-to-pos":[{"mask-y-to":he()}],"mask-image-y-from-color":[{"mask-y-from":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[Re,Te]}],"mask-image-radial-from-pos":[{"mask-radial-from":he()}],"mask-image-radial-to-pos":[{"mask-radial-to":he()}],"mask-image-radial-from-color":[{"mask-radial-from":H()}],"mask-image-radial-to-color":[{"mask-radial-to":H()}],"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":R()}],"mask-image-conic-pos":[{"mask-conic":[it]}],"mask-image-conic-from-pos":[{"mask-conic-from":he()}],"mask-image-conic-to-pos":[{"mask-conic-to":he()}],"mask-image-conic-from-color":[{"mask-conic-from":H()}],"mask-image-conic-to-color":[{"mask-conic-to":H()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Y()}],"mask-repeat":[{mask:X()}],"mask-size":[{mask:D()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Re,Te]}],filter:[{filter:["","none",Re,Te]}],blur:[{blur:ve()}],brightness:[{brightness:[it,Re,Te]}],contrast:[{contrast:[it,Re,Te]}],"drop-shadow":[{"drop-shadow":["","none",S,id,td]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",it,Re,Te]}],"hue-rotate":[{"hue-rotate":[it,Re,Te]}],invert:[{invert:["",it,Re,Te]}],saturate:[{saturate:[it,Re,Te]}],sepia:[{sepia:["",it,Re,Te]}],"backdrop-filter":[{"backdrop-filter":["","none",Re,Te]}],"backdrop-blur":[{"backdrop-blur":ve()}],"backdrop-brightness":[{"backdrop-brightness":[it,Re,Te]}],"backdrop-contrast":[{"backdrop-contrast":[it,Re,Te]}],"backdrop-grayscale":[{"backdrop-grayscale":["",it,Re,Te]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[it,Re,Te]}],"backdrop-invert":[{"backdrop-invert":["",it,Re,Te]}],"backdrop-opacity":[{"backdrop-opacity":[it,Re,Te]}],"backdrop-saturate":[{"backdrop-saturate":[it,Re,Te]}],"backdrop-sepia":[{"backdrop-sepia":["",it,Re,Te]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":z()}],"border-spacing-x":[{"border-spacing-x":z()}],"border-spacing-y":[{"border-spacing-y":z()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Re,Te]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[it,"initial",Re,Te]}],ease:[{ease:["linear","initial",E,Re,Te]}],delay:[{delay:[it,Re,Te]}],animate:[{animate:["none",A,Re,Te]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,Re,Te]}],"perspective-origin":[{"perspective-origin":$()}],rotate:[{rotate:ye()}],"rotate-x":[{"rotate-x":ye()}],"rotate-y":[{"rotate-y":ye()}],"rotate-z":[{"rotate-z":ye()}],scale:[{scale:Ae()}],"scale-x":[{"scale-x":Ae()}],"scale-y":[{"scale-y":Ae()}],"scale-z":[{"scale-z":Ae()}],"scale-3d":["scale-3d"],skew:[{skew:De()}],"skew-x":[{"skew-x":De()}],"skew-y":[{"skew-y":De()}],transform:[{transform:[Re,Te,"","none","gpu","cpu"]}],"transform-origin":[{origin:$()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:rt()}],"translate-x":[{"translate-x":rt()}],"translate-y":[{"translate-y":rt()}],"translate-z":[{"translate-z":rt()}],"translate-none":["translate-none"],accent:[{accent:H()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:H()}],"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",Re,Te]}],"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":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"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",Re,Te]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[it,tu,Co,W_]}],stroke:[{stroke:["none",...H()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},CT=iT(wT);function $w(...t){return CT(Aw(t))}const xT=NE("focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-md border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-[3px] aria-invalid:ring-[3px] [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground shadow-xs",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground",toolbar:"hover:bg-input hover:text-foreground aria-expanded:bg-input aria-expanded:text-foreground",destructive:"bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30",link:"text-primary underline-offset-4 hover:underline",headless:"border-0 bg-transparent rounded-none font-normal text-[inherit] whitespace-normal transition-none justify-start"},size:{default:"h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-md px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1 rounded-md px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5",lg:"h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",icon:"size-9","icon-xs":"size-6 rounded-md in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8 rounded-md in-data-[slot=button-group]:rounded-md","icon-lg":"size-10",headless:"h-auto w-auto gap-0 p-0"}},defaultVariants:{variant:"default",size:"default"}});function yd({className:t,variant:e="default",size:i="default",...n}){return j.jsx(BE,{"data-slot":"button",className:$w(xT({variant:e,size:i,className:t})),...n})}let ib=(function(t){return t.disabled="data-disabled",t.valid="data-valid",t.invalid="data-invalid",t.touched="data-touched",t.dirty="data-dirty",t.filled="data-filled",t.focused="data-focused",t})({});const kT={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},ET={valid(t){return t===null?null:t?{[ib.valid]:""}:{[ib.invalid]:""}}},TT=w.createContext({invalid:void 0,name:void 0,validityData:{state:kT,errors:[],error:"",value:"",initialValue:null},setValidityData:Hr,disabled:void 0,touched:!1,setTouched:Hr,dirty:!1,setDirty:Hr,filled:!1,setFilled:Hr,focused:!1,setFocused:Hr,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(t=Fn)=>t,getInputValidationProps:(t=Fn)=>t,inputRef:{current:null},commit:async()=>{}}});function Mp(t=!0){const e=w.useContext(TT);if(e.setValidityData===Hr&&!t)throw new Error(Hg(28));return e}const RT=w.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Hr,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function AT(){return w.useContext(RT)}const MT={...fw};let sb=0;function LT(t,e="mui"){const[i,n]=w.useState(t),a=t||i;return w.useEffect(()=>{i==null&&(sb+=1,n(`${e}-${sb}`))},[i,e]),a}const rb=MT.useId;function DT(t,e){if(rb!==void 0){const i=rb();return t??(e?`${e}-${i}`:i)}return LT(t,e)}function OT(t){return DT(t,"base-ui")}const BT=w.createContext({controlId:void 0,setControlId:Hr,labelId:void 0,setLabelId:Hr,messageIds:[],setMessageIds:Hr,getDescriptionProps:t=>t});function Ww(){return w.useContext(BT)}function NT(t,e){return{...t,state:{...t.state,valid:!e&&t.state.valid}}}function PT({controlled:t,default:e,name:i,state:n="value"}){const{current:a}=w.useRef(t!==void 0),[l,u]=w.useState(e),h=a?t:l,f=w.useCallback(d=>{a||u(d)},[]);return[h,f]}function zT(t={}){const{id:e,implicit:i=!1,controlRef:n}=t,{controlId:a,setControlId:l}=Ww(),u=OT(e);return Wl(()=>{if(!(!i&&!e||l===Hr)){if(i){const h=n?.current;oE(h)&&h.closest("label")!=null?l(e??null):l(a??u)}else e&&l(e);return()=>{e&&l(void 0)}}},[e,n,a,l,i,u]),a??u}function HT(t){const{enabled:e=!0,value:i,id:n,name:a,controlRef:l,commit:u}=t,{formRef:h}=AT(),{invalid:f,markedDirtyRef:d,validityData:p,setValidityData:v}=Mp(),g=jd(t.getValue);Wl(()=>{if(!e)return;let S=i;S===void 0&&(S=g()),p.initialValue===null&&S!==null&&v(b=>({...b,initialValue:S}))},[e,v,i,p.initialValue,g]),Wl(()=>{!e||!n||h.current.fields.set(n,{getValue:g,name:a,controlRef:l,validityData:NT(p,f),validate(S=!0){let b=i;b===void 0&&(b=g()),d.current=!0,S?Ng.flushSync(()=>u(b)):u(b)}})},[u,l,e,h,g,n,f,d,a,p,i]),Wl(()=>{const S=h.current.fields;return()=>{n&&S.delete(n)}},[h,n])}const IT="none";function UT(t,e,i,n){let a=!1,l=!1;const u=Fn;return{reason:t,event:e??new Event("base-ui"),cancel(){a=!0},allowPropagation(){l=!0},get isCanceled(){return a},get isPropagationAllowed(){return l},trigger:i,...u}}const FT=w.forwardRef(function(e,i){const{render:n,className:a,id:l,name:u,value:h,disabled:f=!1,onValueChange:d,defaultValue:p,...v}=e,{state:g,name:S,disabled:b}=Mp(),C=b||f,x=S??u,E=w.useMemo(()=>({...g,disabled:C}),[g,C]),{setTouched:A,setDirty:B,validityData:R,setFocused:$,setFilled:F,validationMode:U,validation:z}=Mp(),{labelId:V}=Ww(),se=zT({id:l});Wl(()=>{const T=h!=null;z.inputRef.current?.value||T&&h!==""?F(!0):T&&h===""&&F(!1)},[z.inputRef,F,h]);const[ee,M]=PT({controlled:h,default:p,name:"FieldControl",state:"value"}),O=h!==void 0,N=jd((T,L)=>{d?.(T,L),!L.isCanceled&&M(T)});return HT({id:se,name:x,commit:z.commit,value:ee,getValue:()=>z.inputRef.current?.value,controlRef:z.inputRef}),Tw("input",e,{ref:i,state:E,props:[{id:se,disabled:C,name:x,ref:z.inputRef,"aria-labelledby":V,...O?{value:ee}:{defaultValue:p},onChange(T){const L=T.currentTarget.value;N(L,UT(IT,T.nativeEvent)),B(L!==R.initialValue),F(L!=="")},onFocus(){$(!0)},onBlur(T){A(!0),$(!1),U==="onBlur"&&z.commit(T.currentTarget.value)},onKeyDown(T){T.currentTarget.tagName==="INPUT"&&T.key==="Enter"&&(A(!0),z.commit(T.currentTarget.value))}},z.getInputValidationProps(),v],stateAttributesMapping:ET})}),$T=w.forwardRef(function(e,i){return j.jsx(FT,{ref:i,...e})});function WT({className:t,type:e,...i}){return j.jsx($T,{type:e,"data-slot":"input",className:$w("dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 h-9 rounded-md border bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] file:h-7 file:text-sm file:font-medium focus-visible:ring-[3px] aria-invalid:ring-[3px] file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",t),...i})}function nb(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function jT({getStoredTheme:t,setStoredTheme:e}){const[i,n]=w.useState("system"),[a,l]=w.useState(!0),u=w.useRef(null);w.useEffect(()=>{Promise.resolve(t()).then(d=>{(d==="light"||d==="dark"||d==="system")&&n(d),l(!1)})},[t]);const h=i==="system"?nb():i;w.useEffect(()=>{if(a||u.current===h)return;u.current=h;const d=document.documentElement;d.classList.remove("light","dark"),d.classList.add(h)},[h,a]),w.useEffect(()=>{if(i!=="system")return;const d=window.matchMedia("(prefers-color-scheme: dark)"),p=()=>{const v=nb();if(u.current===v)return;u.current=v;const g=document.documentElement;g.classList.remove("light","dark"),g.classList.add(v)};return d.addEventListener("change",p),()=>d.removeEventListener("change",p)},[i]);const f=w.useCallback(async d=>{n(d),await e(d)},[e]);return w.useMemo(()=>({theme:i,setTheme:f,resolvedTheme:h,isLoading:a}),[i,f,h,a])}var jw=Object.defineProperty,VT=Object.getOwnPropertyDescriptor,qT=(t,e)=>{for(var i in e)jw(t,i,{get:e[i],enumerable:!0})},si=(t,e,i,n)=>{for(var a=n>1?void 0:n?VT(e,i):e,l=t.length-1,u;l>=0;l--)(u=t[l])&&(a=(n?u(e,i,a):u(a))||a);return n&&a&&jw(e,i,a),a},we=(t,e)=>(i,n)=>e(i,n,t),ab="Terminal input",Lp={get:()=>ab,set:t=>ab=t},ob="Too much output to announce, navigate to rows manually to read",Dp={get:()=>ob,set:t=>ob=t};function YT(t){return t.replace(/\r?\n/g,"\r")}function GT(t,e){return e?"\x1B[200~"+t+"\x1B[201~":t}function KT(t,e){t.clipboardData&&t.clipboardData.setData("text/plain",e.selectionText),t.preventDefault()}function XT(t,e,i,n){if(t.stopPropagation(),t.clipboardData){let a=t.clipboardData.getData("text/plain");Vw(a,e,i,n)}}function Vw(t,e,i,n){t=YT(t),t=GT(t,i.decPrivateModes.bracketedPasteMode&&n.rawOptions.ignoreBracketedPasteMode!==!0),i.triggerDataEvent(t,!0),e.value=""}function qw(t,e,i){let n=i.getBoundingClientRect(),a=t.clientX-n.left-10,l=t.clientY-n.top-10;e.style.width="20px",e.style.height="20px",e.style.left=`${a}px`,e.style.top=`${l}px`,e.style.zIndex="1000",e.focus()}function lb(t,e,i,n,a){qw(t,e,i),a&&n.rightClickSelect(t),e.value=n.selectionText,e.select()}function Ia(t){return t>65535?(t-=65536,String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):String.fromCharCode(t)}function lf(t,e=0,i=t.length){let n="";for(let a=e;a<i;++a){let l=t[a];l>65535?(l-=65536,n+=String.fromCharCode((l>>10)+55296)+String.fromCharCode(l%1024+56320)):n+=String.fromCharCode(l)}return n}var ZT=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,i){let n=e.length;if(!n)return 0;let a=0,l=0;if(this._interim){let u=e.charCodeAt(l++);56320<=u&&u<=57343?i[a++]=(this._interim-55296)*1024+u-56320+65536:(i[a++]=this._interim,i[a++]=u),this._interim=0}for(let u=l;u<n;++u){let h=e.charCodeAt(u);if(55296<=h&&h<=56319){if(++u>=n)return this._interim=h,a;let f=e.charCodeAt(u);56320<=f&&f<=57343?i[a++]=(h-55296)*1024+f-56320+65536:(i[a++]=h,i[a++]=f);continue}h!==65279&&(i[a++]=h)}return a}},QT=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,i){let n=e.length;if(!n)return 0;let a=0,l,u,h,f,d=0,p=0;if(this.interim[0]){let S=!1,b=this.interim[0];b&=(b&224)===192?31:(b&240)===224?15:7;let C=0,x;for(;(x=this.interim[++C]&63)&&C<4;)b<<=6,b|=x;let E=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,A=E-C;for(;p<A;){if(p>=n)return 0;if(x=e[p++],(x&192)!==128){p--,S=!0;break}else this.interim[C++]=x,b<<=6,b|=x&63}S||(E===2?b<128?p--:i[a++]=b:E===3?b<2048||b>=55296&&b<=57343||b===65279||(i[a++]=b):b<65536||b>1114111||(i[a++]=b)),this.interim.fill(0)}let v=n-4,g=p;for(;g<n;){for(;g<v&&!((l=e[g])&128)&&!((u=e[g+1])&128)&&!((h=e[g+2])&128)&&!((f=e[g+3])&128);)i[a++]=l,i[a++]=u,i[a++]=h,i[a++]=f,g+=4;if(l=e[g++],l<128)i[a++]=l;else if((l&224)===192){if(g>=n)return this.interim[0]=l,a;if(u=e[g++],(u&192)!==128){g--;continue}if(d=(l&31)<<6|u&63,d<128){g--;continue}i[a++]=d}else if((l&240)===224){if(g>=n)return this.interim[0]=l,a;if(u=e[g++],(u&192)!==128){g--;continue}if(g>=n)return this.interim[0]=l,this.interim[1]=u,a;if(h=e[g++],(h&192)!==128){g--;continue}if(d=(l&15)<<12|(u&63)<<6|h&63,d<2048||d>=55296&&d<=57343||d===65279)continue;i[a++]=d}else if((l&248)===240){if(g>=n)return this.interim[0]=l,a;if(u=e[g++],(u&192)!==128){g--;continue}if(g>=n)return this.interim[0]=l,this.interim[1]=u,a;if(h=e[g++],(h&192)!==128){g--;continue}if(g>=n)return this.interim[0]=l,this.interim[1]=u,this.interim[2]=h,a;if(f=e[g++],(f&192)!==128){g--;continue}if(d=(l&7)<<18|(u&63)<<12|(h&63)<<6|f&63,d<65536||d>1114111)continue;i[a++]=d}}return a}},Yw="",$a=" ",Bu=class Gw{constructor(){this.fg=0,this.bg=0,this.extended=new qd}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let e=new Gw;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},qd=class Kw{constructor(e=0,i=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=i}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new Kw(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Cr=class Xw extends Bu{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new qd,this.combinedData=""}static fromCharData(e){let i=new Xw;return i.setFromCharData(e),i}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Ia(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let i=!1;if(e[1].length>2)i=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let a=e[1].charCodeAt(1);56320<=a&&a<=57343?this.content=(n-55296)*1024+a-56320+65536|e[2]<<22:i=!0}else i=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;i&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},cb="di$target",Op="di$dependencies",j_=new Map;function JT(t){return t[Op]||[]}function Ii(t){if(j_.has(t))return j_.get(t);let e=function(i,n,a){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");eR(e,i,a)};return e._id=t,j_.set(t,e),e}function eR(t,e,i){e[cb]===e?e[Op].push({id:t,index:i}):(e[Op]=[{id:t,index:i}],e[cb]=e)}var hs=Ii("BufferService"),Zw=Ii("CoreMouseService"),Wo=Ii("CoreService"),tR=Ii("CharsetService"),Ug=Ii("InstantiationService"),Qw=Ii("LogService"),ds=Ii("OptionsService"),Jw=Ii("OscLinkService"),iR=Ii("UnicodeService"),Nu=Ii("DecorationService"),Bp=class{constructor(e,i,n){this._bufferService=e,this._optionsService=i,this._oscLinkService=n}provideLinks(e,i){let n=this._bufferService.buffer.lines.get(e-1);if(!n){i(void 0);return}let a=[],l=this._optionsService.rawOptions.linkHandler,u=new Cr,h=n.getTrimmedLength(),f=-1,d=-1,p=!1;for(let v=0;v<h;v++)if(!(d===-1&&!n.hasContent(v))){if(n.loadCell(v,u),u.hasExtendedAttrs()&&u.extended.urlId)if(d===-1){d=v,f=u.extended.urlId;continue}else p=u.extended.urlId!==f;else d!==-1&&(p=!0);if(p||d!==-1&&v===h-1){let g=this._oscLinkService.getLinkData(f)?.uri;if(g){let S={start:{x:d+1,y:e},end:{x:v+(!p&&v===h-1?1:0),y:e}},b=!1;if(!l?.allowNonHttpProtocols)try{let C=new URL(g);["http:","https:"].includes(C.protocol)||(b=!0)}catch{b=!0}b||a.push({text:g,range:S,activate:(C,x)=>l?l.activate(C,x,S):sR(C,x),hover:(C,x)=>l?.hover?.(C,x,S),leave:(C,x)=>l?.leave?.(C,x,S)})}p=!1,u.hasExtendedAttrs()&&u.extended.urlId?(d=v,f=u.extended.urlId):(d=-1,f=-1)}}i(a)}};Bp=si([we(0,hs),we(1,ds),we(2,Jw)],Bp);function sR(t,e){if(confirm(`Do you want to navigate to ${e}?
|
|
10
|
+
|
|
11
|
+
WARNING: This link could potentially be dangerous`)){let i=window.open();if(i){try{i.opener=null}catch{}i.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}}var cf=Ii("CharSizeService"),Yn=Ii("CoreBrowserService"),Fg=Ii("MouseService"),Gn=Ii("RenderService"),rR=Ii("SelectionService"),eC=Ii("CharacterJoinerService"),Zl=Ii("ThemeService"),tC=Ii("LinkProviderService"),nR=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?ub.isErrorNoTelemetry(e)?new ub(e.message+`
|
|
12
|
+
|
|
13
|
+
`+e.stack):new Error(e.message+`
|
|
14
|
+
|
|
15
|
+
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(i=>{i(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},aR=new nR;function bd(t){oR(t)||aR.onUnexpectedError(t)}var Np="Canceled";function oR(t){return t instanceof lR?!0:t instanceof Error&&t.name===Np&&t.message===Np}var lR=class extends Error{constructor(){super(Np),this.name=this.message}};function cR(t){return new Error(`Illegal argument: ${t}`)}var ub=class Pp extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof Pp)return e;let i=new Pp;return i.message=e.message,i.stack=e.stack,i}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}},zp=class iC extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,iC.prototype)}};function Us(t,e=0){return t[t.length-(1+e)]}var uR;(t=>{function e(l){return l<0}t.isLessThan=e;function i(l){return l<=0}t.isLessThanOrEqual=i;function n(l){return l>0}t.isGreaterThan=n;function a(l){return l===0}t.isNeitherLessOrGreaterThan=a,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(uR||={});function hR(t,e){let i=this,n=!1,a;return function(){return n||(n=!0,e||(a=t.apply(i,arguments))),a}}var sC;(t=>{function e(R){return R&&typeof R=="object"&&typeof R[Symbol.iterator]=="function"}t.is=e;let i=Object.freeze([]);function n(){return i}t.empty=n;function*a(R){yield R}t.single=a;function l(R){return e(R)?R:a(R)}t.wrap=l;function u(R){return R||i}t.from=u;function*h(R){for(let $=R.length-1;$>=0;$--)yield R[$]}t.reverse=h;function f(R){return!R||R[Symbol.iterator]().next().done===!0}t.isEmpty=f;function d(R){return R[Symbol.iterator]().next().value}t.first=d;function p(R,$){let F=0;for(let U of R)if($(U,F++))return!0;return!1}t.some=p;function v(R,$){for(let F of R)if($(F))return F}t.find=v;function*g(R,$){for(let F of R)$(F)&&(yield F)}t.filter=g;function*S(R,$){let F=0;for(let U of R)yield $(U,F++)}t.map=S;function*b(R,$){let F=0;for(let U of R)yield*$(U,F++)}t.flatMap=b;function*C(...R){for(let $ of R)yield*$}t.concat=C;function x(R,$,F){let U=F;for(let z of R)U=$(U,z);return U}t.reduce=x;function*E(R,$,F=R.length){for($<0&&($+=R.length),F<0?F+=R.length:F>R.length&&(F=R.length);$<F;$++)yield R[$]}t.slice=E;function A(R,$=Number.POSITIVE_INFINITY){let F=[];if($===0)return[F,R];let U=R[Symbol.iterator]();for(let z=0;z<$;z++){let V=U.next();if(V.done)return[F,t.empty()];F.push(V.value)}return[F,{[Symbol.iterator](){return U}}]}t.consume=A;async function B(R){let $=[];for await(let F of R)$.push(F);return Promise.resolve($)}t.asyncToArray=B})(sC||={});function Uo(t){if(sC.is(t)){let e=[];for(let i of t)if(i)try{i.dispose()}catch(n){e.push(n)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function dR(...t){return Wt(()=>Uo(t))}function Wt(t){return{dispose:hR(()=>{t()})}}var rC=class nC{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{Uo(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?nC.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),void 0)}};rC.DISABLE_DISPOSED_WARNING=!1;var Ya=rC,st=class{constructor(){this._store=new Ya,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};st.None=Object.freeze({dispose(){}});var Gl=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},Wn=typeof window=="object"?window:globalThis,Hp=class Ip{constructor(e){this.element=e,this.next=Ip.Undefined,this.prev=Ip.Undefined}};Hp.Undefined=new Hp(void 0);var qt=Hp,hb=class{constructor(){this._first=qt.Undefined,this._last=qt.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===qt.Undefined}clear(){let e=this._first;for(;e!==qt.Undefined;){let i=e.next;e.prev=qt.Undefined,e.next=qt.Undefined,e=i}this._first=qt.Undefined,this._last=qt.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,i){let n=new qt(e);if(this._first===qt.Undefined)this._first=n,this._last=n;else if(i){let l=this._last;this._last=n,n.prev=l,l.next=n}else{let l=this._first;this._first=n,n.next=l,l.prev=n}this._size+=1;let a=!1;return()=>{a||(a=!0,this._remove(n))}}shift(){if(this._first!==qt.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==qt.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==qt.Undefined&&e.next!==qt.Undefined){let i=e.prev;i.next=e.next,e.next.prev=i}else e.prev===qt.Undefined&&e.next===qt.Undefined?(this._first=qt.Undefined,this._last=qt.Undefined):e.next===qt.Undefined?(this._last=this._last.prev,this._last.next=qt.Undefined):e.prev===qt.Undefined&&(this._first=this._first.next,this._first.prev=qt.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==qt.Undefined;)yield e.element,e=e.next}},fR=globalThis.performance&&typeof globalThis.performance.now=="function",mR=class aC{static create(e){return new aC(e)}constructor(e){this._now=fR&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},Zi;(t=>{t.None=()=>st.None;function e(M,O){return v(M,()=>{},0,void 0,!0,void 0,O)}t.defer=e;function i(M){return(O,N=null,P)=>{let T=!1,L;return L=M(H=>{if(!T)return L?L.dispose():T=!0,O.call(N,H)},null,P),T&&L.dispose(),L}}t.once=i;function n(M,O,N){return d((P,T=null,L)=>M(H=>P.call(T,O(H)),null,L),N)}t.map=n;function a(M,O,N){return d((P,T=null,L)=>M(H=>{O(H),P.call(T,H)},null,L),N)}t.forEach=a;function l(M,O,N){return d((P,T=null,L)=>M(H=>O(H)&&P.call(T,H),null,L),N)}t.filter=l;function u(M){return M}t.signal=u;function h(...M){return(O,N=null,P)=>{let T=dR(...M.map(L=>L(H=>O.call(N,H))));return p(T,P)}}t.any=h;function f(M,O,N,P){let T=N;return n(M,L=>(T=O(T,L),T),P)}t.reduce=f;function d(M,O){let N,P={onWillAddFirstListener(){N=M(T.fire,T)},onDidRemoveLastListener(){N?.dispose()}},T=new ge(P);return O?.add(T),T.event}function p(M,O){return O instanceof Array?O.push(M):O&&O.add(M),M}function v(M,O,N=100,P=!1,T=!1,L,H){let Y,X,D,G=0,ie,ae={leakWarningThreshold:L,onWillAddFirstListener(){Y=M(ue=>{G++,X=O(X,ue),P&&!D&&(de.fire(X),X=void 0),ie=()=>{let he=X;X=void 0,D=void 0,(!P||G>1)&&de.fire(he),G=0},typeof N=="number"?(clearTimeout(D),D=setTimeout(ie,N)):D===void 0&&(D=0,queueMicrotask(ie))})},onWillRemoveListener(){T&&G>0&&ie?.()},onDidRemoveLastListener(){ie=void 0,Y.dispose()}},de=new ge(ae);return H?.add(de),de.event}t.debounce=v;function g(M,O=0,N){return t.debounce(M,(P,T)=>P?(P.push(T),P):[T],O,void 0,!0,void 0,N)}t.accumulate=g;function S(M,O=(P,T)=>P===T,N){let P=!0,T;return l(M,L=>{let H=P||!O(L,T);return P=!1,T=L,H},N)}t.latch=S;function b(M,O,N){return[t.filter(M,O,N),t.filter(M,P=>!O(P),N)]}t.split=b;function C(M,O=!1,N=[],P){let T=N.slice(),L=M(X=>{T?T.push(X):Y.fire(X)});P&&P.add(L);let H=()=>{T?.forEach(X=>Y.fire(X)),T=null},Y=new ge({onWillAddFirstListener(){L||(L=M(X=>Y.fire(X)),P&&P.add(L))},onDidAddFirstListener(){T&&(O?setTimeout(H):H())},onDidRemoveLastListener(){L&&L.dispose(),L=null}});return P&&P.add(Y),Y.event}t.buffer=C;function x(M,O){return(N,P,T)=>{let L=O(new A);return M(function(H){let Y=L.evaluate(H);Y!==E&&N.call(P,Y)},void 0,T)}}t.chain=x;let E=Symbol("HaltChainable");class A{constructor(){this.steps=[]}map(O){return this.steps.push(O),this}forEach(O){return this.steps.push(N=>(O(N),N)),this}filter(O){return this.steps.push(N=>O(N)?N:E),this}reduce(O,N){let P=N;return this.steps.push(T=>(P=O(P,T),P)),this}latch(O=(N,P)=>N===P){let N=!0,P;return this.steps.push(T=>{let L=N||!O(T,P);return N=!1,P=T,L?T:E}),this}evaluate(O){for(let N of this.steps)if(O=N(O),O===E)break;return O}}function B(M,O,N=P=>P){let P=(...Y)=>H.fire(N(...Y)),T=()=>M.on(O,P),L=()=>M.removeListener(O,P),H=new ge({onWillAddFirstListener:T,onDidRemoveLastListener:L});return H.event}t.fromNodeEventEmitter=B;function R(M,O,N=P=>P){let P=(...Y)=>H.fire(N(...Y)),T=()=>M.addEventListener(O,P),L=()=>M.removeEventListener(O,P),H=new ge({onWillAddFirstListener:T,onDidRemoveLastListener:L});return H.event}t.fromDOMEventEmitter=R;function $(M){return new Promise(O=>i(M)(O))}t.toPromise=$;function F(M){let O=new ge;return M.then(N=>{O.fire(N)},()=>{O.fire(void 0)}).finally(()=>{O.dispose()}),O.event}t.fromPromise=F;function U(M,O){return M(N=>O.fire(N))}t.forward=U;function z(M,O,N){return O(N),M(P=>O(P))}t.runAndSubscribe=z;class V{constructor(O,N){this._observable=O,this._counter=0,this._hasChanged=!1;let P={onWillAddFirstListener:()=>{O.addObserver(this)},onDidRemoveLastListener:()=>{O.removeObserver(this)}};this.emitter=new ge(P),N&&N.add(this.emitter)}beginUpdate(O){this._counter++}handlePossibleChange(O){}handleChange(O,N){this._hasChanged=!0}endUpdate(O){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function se(M,O){return new V(M,O).emitter.event}t.fromObservable=se;function ee(M){return(O,N,P)=>{let T=0,L=!1,H={beginUpdate(){T++},endUpdate(){T--,T===0&&(M.reportChanges(),L&&(L=!1,O.call(N)))},handlePossibleChange(){},handleChange(){L=!0}};M.addObserver(H),M.reportChanges();let Y={dispose(){M.removeObserver(H)}};return P instanceof Ya?P.add(Y):Array.isArray(P)&&P.push(Y),Y}}t.fromObservableLight=ee})(Zi||={});var Up=class Fp{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${Fp._idPool++}`,Fp.all.add(this)}start(e){this._stopWatch=new mR,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};Up.all=new Set,Up._idPool=0;var _R=Up,pR=-1,oC=class lC{constructor(e,i,n=(lC._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=i,this.name=n,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,i){let n=this.threshold;if(n<=0||i<n)return;this._stacks||(this._stacks=new Map);let a=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,a+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=n*.5;let[l,u]=this.getMostFrequentStack(),h=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${u}):`;console.warn(h),console.warn(l);let f=new SR(h,l);this._errorHandler(f)}return()=>{let l=this._stacks.get(e.value)||0;this._stacks.set(e.value,l-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,i=0;for(let[n,a]of this._stacks)(!e||i<a)&&(e=[n,a],i=a);return e}};oC._idPool=1;var gR=oC,vR=class cC{constructor(e){this.value=e}static create(){let e=new Error;return new cC(e.stack??"")}print(){console.warn(this.value.split(`
|
|
16
|
+
`).slice(2).join(`
|
|
17
|
+
`))}},SR=class extends Error{constructor(t,e){super(t),this.name="ListenerLeakError",this.stack=e}},yR=class extends Error{constructor(t,e){super(t),this.name="ListenerRefusalError",this.stack=e}},bR=0,V_=class{constructor(e){this.value=e,this.id=bR++}},wR=2,CR,ge=class{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new gR(e?.onListenerError??bd,this._options?.leakWarningThreshold??pR):void 0,this._perfMon=this._options?._profName?new _R(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,i,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let h=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(h);let f=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],d=new yR(`${h}. HINT: Stack shows most frequent listener (${f[1]}-times)`,f[0]);return(this._options?.onListenerError||bd)(d),st.None}if(this._disposed)return st.None;i&&(e=e.bind(i));let a=new V_(e),l;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(a.stack=vR.create(),l=this._leakageMon.check(a.stack,this._size+1)),this._listeners?this._listeners instanceof V_?(this._deliveryQueue??=new xR,this._listeners=[this._listeners,a]):this._listeners.push(a):(this._options?.onWillAddFirstListener?.(this),this._listeners=a,this._options?.onDidAddFirstListener?.(this)),this._size++;let u=Wt(()=>{l?.(),this._removeListener(a)});return n instanceof Ya?n.add(u):Array.isArray(n)&&n.push(u),u},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let i=this._listeners,n=i.indexOf(e);if(n===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,i[n]=void 0;let a=this._deliveryQueue.current===this;if(this._size*wR<=i.length){let l=0;for(let u=0;u<i.length;u++)i[u]?i[l++]=i[u]:a&&(this._deliveryQueue.end--,l<this._deliveryQueue.i&&this._deliveryQueue.i--);i.length=l}}_deliver(e,i){if(!e)return;let n=this._options?.onListenerError||bd;if(!n){e.value(i);return}try{e.value(i)}catch(a){n(a)}}_deliverQueue(e){let i=e.current._listeners;for(;e.i<e.end;)this._deliver(i[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof V_)this._deliver(this._listeners,e);else{let i=this._deliveryQueue;i.enqueue(this,e,this._listeners.length),this._deliverQueue(i)}this._perfMon?.stop()}hasListeners(){return this._size>0}},xR=class{constructor(){this.i=-1,this.end=0}enqueue(e,i,n){this.i=0,this.end=n,this.current=e,this.value=i}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},$p=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new ge,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new ge,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,i){if(this.getZoomLevel(i)===e)return;let n=this.getWindowId(i);this.mapWindowIdToZoomLevel.set(n,e),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,i){this.mapWindowIdToZoomFactor.set(this.getWindowId(i),e)}setFullscreen(e,i){if(this.isFullscreen(i)===e)return;let n=this.getWindowId(i);this.mapWindowIdToFullScreen.set(n,e),this._onDidChangeFullscreen.fire(n)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};$p.INSTANCE=new $p;var $g=$p;function kR(t,e,i){typeof e=="string"&&(e=t.matchMedia(e)),e.addEventListener("change",i)}$g.INSTANCE.onDidChangeZoomLevel;function ER(t){return $g.INSTANCE.getZoomFactor(t)}$g.INSTANCE.onDidChangeFullscreen;var Ql=typeof navigator=="object"?navigator.userAgent:"",Wp=Ql.indexOf("Firefox")>=0,TR=Ql.indexOf("AppleWebKit")>=0,Wg=Ql.indexOf("Chrome")>=0,RR=!Wg&&Ql.indexOf("Safari")>=0;Ql.indexOf("Electron/")>=0;Ql.indexOf("Android")>=0;var q_=!1;if(typeof Wn.matchMedia=="function"){let t=Wn.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=Wn.matchMedia("(display-mode: fullscreen)");q_=t.matches,kR(Wn,t,({matches:i})=>{q_&&e.matches||(q_=i)})}var Hl="en",jp=!1,Vp=!1,wd=!1,uC=!1,sd,Cd=Hl,db=Hl,AR,Hn,Bo=globalThis,$s;typeof Bo.vscode<"u"&&typeof Bo.vscode.process<"u"?$s=Bo.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&($s=process);var MR=typeof $s?.versions?.electron=="string",LR=MR&&$s?.type==="renderer";if(typeof $s=="object"){jp=$s.platform==="win32",Vp=$s.platform==="darwin",wd=$s.platform==="linux",wd&&$s.env.SNAP&&$s.env.SNAP_REVISION,$s.env.CI||$s.env.BUILD_ARTIFACTSTAGINGDIRECTORY,sd=Hl,Cd=Hl;let t=$s.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t);sd=e.userLocale,db=e.osLocale,Cd=e.resolvedLanguage||Hl,AR=e.languagePack?.translationsConfigFile}catch{}uC=!0}else typeof navigator=="object"&&!LR?(Hn=navigator.userAgent,jp=Hn.indexOf("Windows")>=0,Vp=Hn.indexOf("Macintosh")>=0,(Hn.indexOf("Macintosh")>=0||Hn.indexOf("iPad")>=0||Hn.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,wd=Hn.indexOf("Linux")>=0,Hn?.indexOf("Mobi")>=0,Cd=globalThis._VSCODE_NLS_LANGUAGE||Hl,sd=navigator.language.toLowerCase(),db=sd):console.error("Unable to resolve platform.");var hC=jp,sn=Vp,DR=wd,fb=uC,an=Hn,Ma=Cd,OR;(t=>{function e(){return Ma}t.value=e;function i(){return Ma.length===2?Ma==="en":Ma.length>=3?Ma[0]==="e"&&Ma[1]==="n"&&Ma[2]==="-":!1}t.isDefaultVariant=i;function n(){return Ma==="en"}t.isDefault=n})(OR||={});var BR=typeof Bo.postMessage=="function"&&!Bo.importScripts;(()=>{if(BR){let t=[];Bo.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let n=0,a=t.length;n<a;n++){let l=t[n];if(l.id===i.data.vscodeScheduleAsyncWork){t.splice(n,1),l.callback();return}}});let e=0;return i=>{let n=++e;t.push({id:n,callback:i}),Bo.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();var NR=!!(an&&an.indexOf("Chrome")>=0);an&&an.indexOf("Firefox")>=0;!NR&&an&&an.indexOf("Safari")>=0;an&&an.indexOf("Edg/")>=0;an&&an.indexOf("Android")>=0;var Ll=typeof navigator=="object"?navigator:{};fb||document.queryCommandSupported&&document.queryCommandSupported("copy")||Ll&&Ll.clipboard&&Ll.clipboard.writeText,fb||Ll&&Ll.clipboard&&Ll.clipboard.readText;var jg=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,i){this._keyCodeToStr[e]=i,this._strToKeyCode[i.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},Y_=new jg,mb=new jg,_b=new jg,PR=new Array(230),dC;(t=>{function e(h){return Y_.keyCodeToStr(h)}t.toString=e;function i(h){return Y_.strToKeyCode(h)}t.fromString=i;function n(h){return mb.keyCodeToStr(h)}t.toUserSettingsUS=n;function a(h){return _b.keyCodeToStr(h)}t.toUserSettingsGeneral=a;function l(h){return mb.strToKeyCode(h)||_b.strToKeyCode(h)}t.fromUserSettings=l;function u(h){if(h>=98&&h<=113)return null;switch(h){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Y_.keyCodeToStr(h)}t.toElectronAccelerator=u})(dC||={});var zR=class fC{constructor(e,i,n,a,l){this.ctrlKey=e,this.shiftKey=i,this.altKey=n,this.metaKey=a,this.keyCode=l}equals(e){return e instanceof fC&&this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.metaKey===e.metaKey&&this.keyCode===e.keyCode}getHashCode(){let e=this.ctrlKey?"1":"0",i=this.shiftKey?"1":"0",n=this.altKey?"1":"0",a=this.metaKey?"1":"0";return`K${e}${i}${n}${a}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new HR([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},HR=class{constructor(e){if(e.length===0)throw cR("chords");this.chords=e}getHashCode(){let e="";for(let i=0,n=this.chords.length;i<n;i++)i!==0&&(e+=";"),e+=this.chords[i].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let i=0;i<this.chords.length;i++)if(!this.chords[i].equals(e.chords[i]))return!1;return!0}};function IR(t){if(t.charCode){let i=String.fromCharCode(t.charCode).toUpperCase();return dC.fromString(i)}let e=t.keyCode;if(e===3)return 7;if(Wp)switch(e){case 59:return 85;case 60:if(DR)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(sn)return 57;break}else if(TR&&(sn&&e===93||!sn&&e===92))return 57;return PR[e]||0}var UR=sn?256:2048,FR=512,$R=1024,WR=sn?2048:256,pb=class{constructor(t){this._standardKeyboardEventBrand=!0;let e=t;this.browserEvent=e,this.target=e.target,this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey,this.altGraphKey=e.getModifierState?.("AltGraph"),this.keyCode=IR(e),this.code=e.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(t){return this._asKeybinding===t}_computeKeybinding(){let t=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(t=this.keyCode);let e=0;return this.ctrlKey&&(e|=UR),this.altKey&&(e|=FR),this.shiftKey&&(e|=$R),this.metaKey&&(e|=WR),e|=t,e}_computeKeyCodeChord(){let t=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(t=this.keyCode),new zR(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,t)}},gb=new WeakMap;function jR(t){if(!t.parent||t.parent===t)return null;try{let e=t.location,i=t.parent.location;if(e.origin!=="null"&&i.origin!=="null"&&e.origin!==i.origin)return null}catch{return null}return t.parent}var VR=class{static getSameOriginWindowChain(t){let e=gb.get(t);if(!e){e=[],gb.set(t,e);let i=t,n;do n=jR(i),n?e.push({window:new WeakRef(i),iframeElement:i.frameElement||null}):e.push({window:new WeakRef(i),iframeElement:null}),i=n;while(i)}return e.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(t,e){if(!e||t===e)return{top:0,left:0};let i=0,n=0,a=this.getSameOriginWindowChain(t);for(let l of a){let u=l.window.deref();if(i+=u?.scrollY??0,n+=u?.scrollX??0,u===e||!l.iframeElement)break;let h=l.iframeElement.getBoundingClientRect();i+=h.top,n+=h.left}return{top:i,left:n}}},rd=class{constructor(e,i){this.timestamp=Date.now(),this.browserEvent=i,this.leftButton=i.button===0,this.middleButton=i.button===1,this.rightButton=i.button===2,this.buttons=i.buttons,this.target=i.target,this.detail=i.detail||1,i.type==="dblclick"&&(this.detail=2),this.ctrlKey=i.ctrlKey,this.shiftKey=i.shiftKey,this.altKey=i.altKey,this.metaKey=i.metaKey,typeof i.pageX=="number"?(this.posx=i.pageX,this.posy=i.pageY):(this.posx=i.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=i.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let n=VR.getPositionOfChildWindowRelativeToAncestorWindow(e,i.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},vb=class{constructor(e,i=0,n=0){this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=i;let a=!1;if(Wg){let l=navigator.userAgent.match(/Chrome\/(\d+)/);a=(l?parseInt(l[1]):123)<=122}if(e){let l=e,u=e,h=e.view?.devicePixelRatio||1;if(typeof l.wheelDeltaY<"u")a?this.deltaY=l.wheelDeltaY/(120*h):this.deltaY=l.wheelDeltaY/120;else if(typeof u.VERTICAL_AXIS<"u"&&u.axis===u.VERTICAL_AXIS)this.deltaY=-u.detail/3;else if(e.type==="wheel"){let f=e;f.deltaMode===f.DOM_DELTA_LINE?Wp&&!sn?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof l.wheelDeltaX<"u")RR&&hC?this.deltaX=-(l.wheelDeltaX/120):a?this.deltaX=l.wheelDeltaX/(120*h):this.deltaX=l.wheelDeltaX/120;else if(typeof u.HORIZONTAL_AXIS<"u"&&u.axis===u.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let f=e;f.deltaMode===f.DOM_DELTA_LINE?Wp&&!sn?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(a?this.deltaY=e.wheelDelta/(120*h):this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}},mC=Object.freeze(function(t,e){let i=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(i)}}}),qR;(t=>{function e(i){return i===t.None||i===t.Cancelled||i instanceof YR?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}t.isCancellationToken=e,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Zi.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:mC})})(qR||={});var YR=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?mC:(this._emitter||(this._emitter=new ge),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},Vg=class{constructor(e,i){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof i=="number"&&this.setIfNotSet(e,i)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,i){if(this._isDisposed)throw new zp("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},i)}setIfNotSet(e,i){if(this._isDisposed)throw new zp("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},i))}},GR=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,i,n=globalThis){if(this.isDisposed)throw new zp("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let a=n.setInterval(()=>{e()},i);this.disposable=Wt(()=>{n.clearInterval(a),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},KR;(t=>{async function e(n){let a,l=await Promise.all(n.map(u=>u.then(h=>h,h=>{a||(a=h)})));if(typeof a<"u")throw a;return l}t.settled=e;function i(n){return new Promise(async(a,l)=>{try{await n(a,l)}catch(u){l(u)}})}t.withAsyncBody=i})(KR||={});var Sb=class pr{static fromArray(e){return new pr(i=>{i.emitMany(e)})}static fromPromise(e){return new pr(async i=>{i.emitMany(await e)})}static fromPromises(e){return new pr(async i=>{await Promise.all(e.map(async n=>i.emitOne(await n)))})}static merge(e){return new pr(async i=>{await Promise.all(e.map(async n=>{for await(let a of n)i.emitOne(a)}))})}constructor(e,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new ge,queueMicrotask(async()=>{let n={emitOne:a=>this.emitOne(a),emitMany:a=>this.emitMany(a),reject:a=>this.reject(a)};try{await Promise.resolve(e(n)),this.resolve()}catch(a){this.reject(a)}finally{n.emitOne=void 0,n.emitMany=void 0,n.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===1)return{done:!0,value:void 0};await Zi.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(e,i){return new pr(async n=>{for await(let a of e)n.emitOne(i(a))})}map(e){return pr.map(this,e)}static filter(e,i){return new pr(async n=>{for await(let a of e)i(a)&&n.emitOne(a)})}filter(e){return pr.filter(this,e)}static coalesce(e){return pr.filter(e,i=>!!i)}coalesce(){return pr.coalesce(this)}static async toPromise(e){let i=[];for await(let n of e)i.push(n);return i}toPromise(){return pr.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};Sb.EMPTY=Sb.fromArray([]);var{getWindow:tn,getWindowId:XR,onDidRegisterWindow:ZR}=(function(){let t=new Map,e={window:Wn,disposables:new Ya};t.set(Wn.vscodeWindowId,e);let i=new ge,n=new ge,a=new ge;function l(u,h){return(typeof u=="number"?t.get(u):void 0)??(h?e:void 0)}return{onDidRegisterWindow:i.event,onWillUnregisterWindow:a.event,onDidUnregisterWindow:n.event,registerWindow(u){if(t.has(u.vscodeWindowId))return st.None;let h=new Ya,f={window:u,disposables:h.add(new Ya)};return t.set(u.vscodeWindowId,f),h.add(Wt(()=>{t.delete(u.vscodeWindowId),n.fire(u)})),h.add(Ve(u,Di.BEFORE_UNLOAD,()=>{a.fire(u)})),i.fire(f),h},getWindows(){return t.values()},getWindowsCount(){return t.size},getWindowId(u){return u.vscodeWindowId},hasWindow(u){return t.has(u)},getWindowById:l,getWindow(u){let h=u;if(h?.ownerDocument?.defaultView)return h.ownerDocument.defaultView.window;let f=u;return f?.view?f.view.window:Wn},getDocument(u){return tn(u).document}}})(),QR=class{constructor(e,i,n,a){this._node=e,this._type=i,this._handler=n,this._options=a||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function Ve(t,e,i,n){return new QR(t,e,i,n)}var yb=function(t,e,i,n){return Ve(t,e,i,n)},qg,JR=class extends GR{constructor(t){super(),this.defaultTarget=t&&tn(t)}cancelAndSet(t,e,i){return super.cancelAndSet(t,e,i??this.defaultTarget)}},bb=class{constructor(e,i=0){this._runner=e,this.priority=i,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){bd(e)}}static sort(e,i){return i.priority-e.priority}};(function(){let t=new Map,e=new Map,i=new Map,n=new Map,a=l=>{i.set(l,!1);let u=t.get(l)??[];for(e.set(l,u),t.set(l,[]),n.set(l,!0);u.length>0;)u.sort(bb.sort),u.shift().execute();n.set(l,!1)};qg=(l,u,h=0)=>{let f=XR(l),d=new bb(u,h),p=t.get(f);return p||(p=[],t.set(f,p)),p.push(d),i.get(f)||(i.set(f,!0),l.requestAnimationFrame(()=>a(f))),d}})();function eA(t){let e=t.getBoundingClientRect(),i=tn(t);return{left:e.left+i.scrollX,top:e.top+i.scrollY,width:e.width,height:e.height}}var Di={CLICK:"click",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",CHANGE:"change",FOCUS:"focus",BLUR:"blur",INPUT:"input"},tA=class{constructor(t){this.domNode=t,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(t){let e=bs(t);this._maxWidth!==e&&(this._maxWidth=e,this.domNode.style.maxWidth=this._maxWidth)}setWidth(t){let e=bs(t);this._width!==e&&(this._width=e,this.domNode.style.width=this._width)}setHeight(t){let e=bs(t);this._height!==e&&(this._height=e,this.domNode.style.height=this._height)}setTop(t){let e=bs(t);this._top!==e&&(this._top=e,this.domNode.style.top=this._top)}setLeft(t){let e=bs(t);this._left!==e&&(this._left=e,this.domNode.style.left=this._left)}setBottom(t){let e=bs(t);this._bottom!==e&&(this._bottom=e,this.domNode.style.bottom=this._bottom)}setRight(t){let e=bs(t);this._right!==e&&(this._right=e,this.domNode.style.right=this._right)}setPaddingTop(t){let e=bs(t);this._paddingTop!==e&&(this._paddingTop=e,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(t){let e=bs(t);this._paddingLeft!==e&&(this._paddingLeft=e,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(t){let e=bs(t);this._paddingBottom!==e&&(this._paddingBottom=e,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(t){let e=bs(t);this._paddingRight!==e&&(this._paddingRight=e,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(t){this._fontFamily!==t&&(this._fontFamily=t,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(t){this._fontWeight!==t&&(this._fontWeight=t,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(t){let e=bs(t);this._fontSize!==e&&(this._fontSize=e,this.domNode.style.fontSize=this._fontSize)}setFontStyle(t){this._fontStyle!==t&&(this._fontStyle=t,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(t){this._fontFeatureSettings!==t&&(this._fontFeatureSettings=t,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(t){this._fontVariationSettings!==t&&(this._fontVariationSettings=t,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(t){this._textDecoration!==t&&(this._textDecoration=t,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(t){let e=bs(t);this._lineHeight!==e&&(this._lineHeight=e,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(t){let e=bs(t);this._letterSpacing!==e&&(this._letterSpacing=e,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(t){this._className!==t&&(this._className=t,this.domNode.className=this._className)}toggleClassName(t,e){this.domNode.classList.toggle(t,e),this._className=this.domNode.className}setDisplay(t){this._display!==t&&(this._display=t,this.domNode.style.display=this._display)}setPosition(t){this._position!==t&&(this._position=t,this.domNode.style.position=this._position)}setVisibility(t){this._visibility!==t&&(this._visibility=t,this.domNode.style.visibility=this._visibility)}setColor(t){this._color!==t&&(this._color=t,this.domNode.style.color=this._color)}setBackgroundColor(t){this._backgroundColor!==t&&(this._backgroundColor=t,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(t){this._layerHint!==t&&(this._layerHint=t,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(t){this._boxShadow!==t&&(this._boxShadow=t,this.domNode.style.boxShadow=t)}setContain(t){this._contain!==t&&(this._contain=t,this.domNode.style.contain=this._contain)}setAttribute(t,e){this.domNode.setAttribute(t,e)}removeAttribute(t){this.domNode.removeAttribute(t)}appendChild(t){this.domNode.appendChild(t.domNode)}removeChild(t){this.domNode.removeChild(t.domNode)}};function bs(t){return typeof t=="number"?`${t}px`:t}function xu(t){return new tA(t)}var _C=class{constructor(){this._hooks=new Ya,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,i){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(i)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,i,n,a,l){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=a,this._onStopCallback=l;let u=e;try{e.setPointerCapture(i),this._hooks.add(Wt(()=>{try{e.releasePointerCapture(i)}catch{}}))}catch{u=tn(e)}this._hooks.add(Ve(u,Di.POINTER_MOVE,h=>{if(h.buttons!==n){this.stopMonitoring(!0);return}h.preventDefault(),this._pointerMoveCallback(h)})),this._hooks.add(Ve(u,Di.POINTER_UP,h=>this.stopMonitoring(!0)))}};function iA(t,e,i){let n=null,a=null;if(typeof i.value=="function"?(n="value",a=i.value,a.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof i.get=="function"&&(n="get",a=i.get),!a)throw new Error("not supported");let l=`$memoize$${e}`;i[n]=function(...u){return this.hasOwnProperty(l)||Object.defineProperty(this,l,{configurable:!1,enumerable:!1,writable:!1,value:a.apply(this,u)}),this[l]}}var en;(t=>(t.Tap="-xterm-gesturetap",t.Change="-xterm-gesturechange",t.Start="-xterm-gesturestart",t.End="-xterm-gesturesend",t.Contextmenu="-xterm-gesturecontextmenu"))(en||={});var _u=class ts extends st{constructor(){super(),this.dispatched=!1,this.targets=new hb,this.ignoreTargets=new hb,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Zi.runAndSubscribe(ZR,({window:e,disposables:i})=>{i.add(Ve(e.document,"touchstart",n=>this.onTouchStart(n),{passive:!1})),i.add(Ve(e.document,"touchend",n=>this.onTouchEnd(e,n))),i.add(Ve(e.document,"touchmove",n=>this.onTouchMove(n),{passive:!1}))},{window:Wn,disposables:this._store}))}static addTarget(e){if(!ts.isTouchDevice())return st.None;ts.INSTANCE||(ts.INSTANCE=new ts);let i=ts.INSTANCE.targets.push(e);return Wt(i)}static ignoreTarget(e){if(!ts.isTouchDevice())return st.None;ts.INSTANCE||(ts.INSTANCE=new ts);let i=ts.INSTANCE.ignoreTargets.push(e);return Wt(i)}static isTouchDevice(){return"ontouchstart"in Wn||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){let i=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let n=0,a=e.targetTouches.length;n<a;n++){let l=e.targetTouches.item(n);this.activeTouches[l.identifier]={id:l.identifier,initialTarget:l.target,initialTimeStamp:i,initialPageX:l.pageX,initialPageY:l.pageY,rollingTimestamps:[i],rollingPageX:[l.pageX],rollingPageY:[l.pageY]};let u=this.newGestureEvent(en.Start,l.target);u.pageX=l.pageX,u.pageY=l.pageY,this.dispatchEvent(u)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}onTouchEnd(e,i){let n=Date.now(),a=Object.keys(this.activeTouches).length;for(let l=0,u=i.changedTouches.length;l<u;l++){let h=i.changedTouches.item(l);if(!this.activeTouches.hasOwnProperty(String(h.identifier))){console.warn("move of an UNKNOWN touch",h);continue}let f=this.activeTouches[h.identifier],d=Date.now()-f.initialTimeStamp;if(d<ts.HOLD_DELAY&&Math.abs(f.initialPageX-Us(f.rollingPageX))<30&&Math.abs(f.initialPageY-Us(f.rollingPageY))<30){let p=this.newGestureEvent(en.Tap,f.initialTarget);p.pageX=Us(f.rollingPageX),p.pageY=Us(f.rollingPageY),this.dispatchEvent(p)}else if(d>=ts.HOLD_DELAY&&Math.abs(f.initialPageX-Us(f.rollingPageX))<30&&Math.abs(f.initialPageY-Us(f.rollingPageY))<30){let p=this.newGestureEvent(en.Contextmenu,f.initialTarget);p.pageX=Us(f.rollingPageX),p.pageY=Us(f.rollingPageY),this.dispatchEvent(p)}else if(a===1){let p=Us(f.rollingPageX),v=Us(f.rollingPageY),g=Us(f.rollingTimestamps)-f.rollingTimestamps[0],S=p-f.rollingPageX[0],b=v-f.rollingPageY[0],C=[...this.targets].filter(x=>f.initialTarget instanceof Node&&x.contains(f.initialTarget));this.inertia(e,C,n,Math.abs(S)/g,S>0?1:-1,p,Math.abs(b)/g,b>0?1:-1,v)}this.dispatchEvent(this.newGestureEvent(en.End,f.initialTarget)),delete this.activeTouches[h.identifier]}this.dispatched&&(i.preventDefault(),i.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,i){let n=document.createEvent("CustomEvent");return n.initEvent(e,!1,!0),n.initialTarget=i,n.tapCount=0,n}dispatchEvent(e){if(e.type===en.Tap){let i=new Date().getTime(),n=0;i-this._lastSetTapCountTime>ts.CLEAR_TAP_COUNT_TIME?n=1:n=2,this._lastSetTapCountTime=i,e.tapCount=n}else(e.type===en.Change||e.type===en.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(let n of this.ignoreTargets)if(n.contains(e.initialTarget))return;let i=[];for(let n of this.targets)if(n.contains(e.initialTarget)){let a=0,l=e.initialTarget;for(;l&&l!==n;)a++,l=l.parentElement;i.push([a,n])}i.sort((n,a)=>n[0]-a[0]);for(let[n,a]of i)a.dispatchEvent(e),this.dispatched=!0}}inertia(e,i,n,a,l,u,h,f,d){this.handle=qg(e,()=>{let p=Date.now(),v=p-n,g=0,S=0,b=!0;a+=ts.SCROLL_FRICTION*v,h+=ts.SCROLL_FRICTION*v,a>0&&(b=!1,g=l*a*v),h>0&&(b=!1,S=f*h*v);let C=this.newGestureEvent(en.Change);C.translationX=g,C.translationY=S,i.forEach(x=>x.dispatchEvent(C)),b||this.inertia(e,i,p,a,l,u+g,h,f,d+S)})}onTouchMove(e){let i=Date.now();for(let n=0,a=e.changedTouches.length;n<a;n++){let l=e.changedTouches.item(n);if(!this.activeTouches.hasOwnProperty(String(l.identifier))){console.warn("end of an UNKNOWN touch",l);continue}let u=this.activeTouches[l.identifier],h=this.newGestureEvent(en.Change,u.initialTarget);h.translationX=l.pageX-Us(u.rollingPageX),h.translationY=l.pageY-Us(u.rollingPageY),h.pageX=l.pageX,h.pageY=l.pageY,this.dispatchEvent(h),u.rollingPageX.length>3&&(u.rollingPageX.shift(),u.rollingPageY.shift(),u.rollingTimestamps.shift()),u.rollingPageX.push(l.pageX),u.rollingPageY.push(l.pageY),u.rollingTimestamps.push(i)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}};_u.SCROLL_FRICTION=-.005,_u.HOLD_DELAY=700,_u.CLEAR_TAP_COUNT_TIME=400,si([iA],_u,"isTouchDevice",1);var sA=_u,Yg=class extends st{onclick(e,i){this._register(Ve(e,Di.CLICK,n=>i(new rd(tn(e),n))))}onmousedown(e,i){this._register(Ve(e,Di.MOUSE_DOWN,n=>i(new rd(tn(e),n))))}onmouseover(e,i){this._register(Ve(e,Di.MOUSE_OVER,n=>i(new rd(tn(e),n))))}onmouseleave(e,i){this._register(Ve(e,Di.MOUSE_LEAVE,n=>i(new rd(tn(e),n))))}onkeydown(e,i){this._register(Ve(e,Di.KEY_DOWN,n=>i(new pb(n))))}onkeyup(e,i){this._register(Ve(e,Di.KEY_UP,n=>i(new pb(n))))}oninput(e,i){this._register(Ve(e,Di.INPUT,i))}onblur(e,i){this._register(Ve(e,Di.BLUR,i))}onfocus(e,i){this._register(Ve(e,Di.FOCUS,i))}onchange(e,i){this._register(Ve(e,Di.CHANGE,i))}ignoreGesture(e){return sA.ignoreTarget(e)}},wb=11,rA=class extends Yg{constructor(t){super(),this._onActivate=t.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=t.bgWidth+"px",this.bgDomNode.style.height=t.bgHeight+"px",typeof t.top<"u"&&(this.bgDomNode.style.top="0px"),typeof t.left<"u"&&(this.bgDomNode.style.left="0px"),typeof t.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof t.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=t.className,this.domNode.style.position="absolute",this.domNode.style.width=wb+"px",this.domNode.style.height=wb+"px",typeof t.top<"u"&&(this.domNode.style.top=t.top+"px"),typeof t.left<"u"&&(this.domNode.style.left=t.left+"px"),typeof t.bottom<"u"&&(this.domNode.style.bottom=t.bottom+"px"),typeof t.right<"u"&&(this.domNode.style.right=t.right+"px"),this._pointerMoveMonitor=this._register(new _C),this._register(yb(this.bgDomNode,Di.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._register(yb(this.domNode,Di.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._pointerdownRepeatTimer=this._register(new JR),this._pointerdownScheduleRepeatTimer=this._register(new Vg)}_arrowPointerDown(t){if(!t.target||!(t.target instanceof Element))return;let e=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,tn(t))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(e,200),this._pointerMoveMonitor.startMonitoring(t.target,t.pointerId,t.buttons,i=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),t.preventDefault()}},nA=class qp{constructor(e,i,n,a,l,u,h){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(i=i|0,n=n|0,a=a|0,l=l|0,u=u|0,h=h|0),this.rawScrollLeft=a,this.rawScrollTop=h,i<0&&(i=0),a+i>n&&(a=n-i),a<0&&(a=0),l<0&&(l=0),h+l>u&&(h=u-l),h<0&&(h=0),this.width=i,this.scrollWidth=n,this.scrollLeft=a,this.height=l,this.scrollHeight=u,this.scrollTop=h}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,i){return new qp(this._forceIntegerValues,typeof e.width<"u"?e.width:this.width,typeof e.scrollWidth<"u"?e.scrollWidth:this.scrollWidth,i?this.rawScrollLeft:this.scrollLeft,typeof e.height<"u"?e.height:this.height,typeof e.scrollHeight<"u"?e.scrollHeight:this.scrollHeight,i?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new qp(this._forceIntegerValues,this.width,this.scrollWidth,typeof e.scrollLeft<"u"?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof e.scrollTop<"u"?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,i){let n=this.width!==e.width,a=this.scrollWidth!==e.scrollWidth,l=this.scrollLeft!==e.scrollLeft,u=this.height!==e.height,h=this.scrollHeight!==e.scrollHeight,f=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:i,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:n,scrollWidthChanged:a,scrollLeftChanged:l,heightChanged:u,scrollHeightChanged:h,scrollTopChanged:f}}},aA=class extends st{constructor(t){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new ge),this.onScroll=this._onScroll.event,this._smoothScrollDuration=t.smoothScrollDuration,this._scheduleAtNextAnimationFrame=t.scheduleAtNextAnimationFrame,this._state=new nA(t.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(t){this._smoothScrollDuration=t}validateScrollPosition(t){return this._state.withScrollPosition(t)}getScrollDimensions(){return this._state}setScrollDimensions(t,e){let i=this._state.withScrollDimensions(t,e);this._setState(i,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(t){let e=this._state.withScrollPosition(t);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(e,!1)}setScrollPositionSmooth(t,e){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(t);if(this._smoothScrolling){t={scrollLeft:typeof t.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:t.scrollLeft,scrollTop:typeof t.scrollTop>"u"?this._smoothScrolling.to.scrollTop:t.scrollTop};let i=this._state.withScrollPosition(t);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let n;e?n=new xb(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):n=this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=n}else{let i=this._state.withScrollPosition(t);this._smoothScrolling=xb.start(this._state,i,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let t=this._smoothScrolling.tick(),e=this._state.withScrollPosition(t);if(this._setState(e,!0),!!this._smoothScrolling){if(t.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(t,e){let i=this._state;i.equals(t)||(this._state=t,this._onScroll.fire(this._state.createScrollEvent(i,e)))}},Cb=class{constructor(e,i,n){this.scrollLeft=e,this.scrollTop=i,this.isDone=n}};function G_(t,e){let i=e-t;return function(n){return t+i*cA(n)}}function oA(t,e,i){return function(n){return n<i?t(n/i):e((n-i)/(1-i))}}var xb=class Yp{constructor(e,i,n,a){this.from=e,this.to=i,this.duration=a,this.startTime=n,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(e,i,n){if(Math.abs(e-i)>2.5*n){let a,l;return e<i?(a=e+.75*n,l=i-.75*n):(a=e-.75*n,l=i+.75*n),oA(G_(e,a),G_(l,i),.33)}return G_(e,i)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(e){this.to=e.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(e){let i=(e-this.startTime)/this.duration;if(i<1){let n=this.scrollLeft(i),a=this.scrollTop(i);return new Cb(n,a,!1)}return new Cb(this.to.scrollLeft,this.to.scrollTop,!0)}combine(e,i,n){return Yp.start(e,i,n)}static start(e,i,n){n=n+10;let a=Date.now()-10;return new Yp(e,i,a,n)}};function lA(t){return Math.pow(t,3)}function cA(t){return 1-lA(1-t)}var uA=class extends st{constructor(e,i,n){super(),this._visibility=e,this._visibleClassName=i,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new Vg)}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":"")))}},hA=140,pC=class extends Yg{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 uA(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new _C),this._shouldRender=!0,this.domNode=xu(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(Ve(this.domNode.domNode,Di.POINTER_DOWN,i=>this._domNodePointerDown(i)))}_createArrow(e){let i=this._register(new rA(e));this.domNode.domNode.appendChild(i.bgDomNode),this.domNode.domNode.appendChild(i.domNode)}_createSlider(e,i,n,a){this.slider=xu(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(i),typeof n=="number"&&this.slider.setWidth(n),typeof a=="number"&&this.slider.setHeight(a),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Ve(this.slider.domNode,Di.POINTER_DOWN,l=>{l.button===0&&(l.preventDefault(),this._sliderPointerDown(l))})),this.onclick(this.slider.domNode,l=>{l.leftButton&&l.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let i=this.domNode.domNode.getClientRects()[0].top,n=i+this._scrollbarState.getSliderPosition(),a=i+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),l=this._sliderPointerPosition(e);n<=l&&l<=a?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let i,n;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")i=e.offsetX,n=e.offsetY;else{let l=eA(this.domNode.domNode);i=e.pageX-l.left,n=e.pageY-l.top}let a=this._pointerDownRelativePosition(i,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(a):this._scrollbarState.getDesiredScrollPositionFromOffset(a)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let i=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),a=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,l=>{let u=this._sliderOrthogonalPointerPosition(l),h=Math.abs(u-n);if(hC&&h>hA){this._setDesiredScrollPositionNow(a.getScrollPosition());return}let f=this._sliderPointerPosition(l)-i;this._setDesiredScrollPositionNow(a.getDesiredScrollPositionFromDelta(f))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let i={};this.writeScrollPosition(i,e),this._scrollable.setScrollPositionNow(i)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},gC=class Gp{constructor(e,i,n,a,l,u){this._scrollbarSize=Math.round(i),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(e),this._visibleSize=a,this._scrollSize=l,this._scrollPosition=u,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new Gp(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){let i=Math.round(e);return this._visibleSize!==i?(this._visibleSize=i,this._refreshComputedValues(),!0):!1}setScrollSize(e){let i=Math.round(e);return this._scrollSize!==i?(this._scrollSize=i,this._refreshComputedValues(),!0):!1}setScrollPosition(e){let i=Math.round(e);return this._scrollPosition!==i?(this._scrollPosition=i,this._refreshComputedValues(),!0):!1}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,i,n,a,l){let u=Math.max(0,n-e),h=Math.max(0,u-2*i),f=a>0&&a>n;if(!f)return{computedAvailableSize:Math.round(u),computedIsNeeded:f,computedSliderSize:Math.round(h),computedSliderRatio:0,computedSliderPosition:0};let d=Math.round(Math.max(20,Math.floor(n*h/a))),p=(h-d)/(a-n),v=l*p;return{computedAvailableSize:Math.round(u),computedIsNeeded:f,computedSliderSize:Math.round(d),computedSliderRatio:p,computedSliderPosition:Math.round(v)}}_refreshComputedValues(){let e=Gp._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;let i=e-this._arrowSize-this._computedSliderSize/2;return Math.round(i/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;let i=e-this._arrowSize,n=this._scrollPosition;return i<this._computedSliderPosition?n-=this._visibleSize:n+=this._visibleSize,n}getDesiredScrollPositionFromDelta(e){if(!this._computedIsNeeded)return 0;let i=this._computedSliderPosition+e;return Math.round(i/this._computedSliderRatio)}},dA=class extends pC{constructor(e,i,n){let a=e.getScrollDimensions(),l=e.getCurrentScrollPosition();if(super({lazyRender:i.lazyRender,host:n,scrollbarState:new gC(i.horizontalHasArrows?i.arrowSize:0,i.horizontal===2?0:i.horizontalScrollbarSize,i.vertical===2?0:i.verticalScrollbarSize,a.width,a.scrollWidth,l.scrollLeft),visibility:i.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:i.scrollByPage}),i.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((i.horizontalScrollbarSize-i.horizontalSliderSize)/2),0,void 0,i.horizontalSliderSize)}_updateSlider(e,i){this.slider.setWidth(e),this.slider.setLeft(i)}_renderDomNode(e,i){this.domNode.setWidth(e),this.domNode.setHeight(i),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,i){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,i){e.scrollLeft=i}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},fA=class extends pC{constructor(t,e,i){let n=t.getScrollDimensions(),a=t.getCurrentScrollPosition();if(super({lazyRender:e.lazyRender,host:i,scrollbarState:new gC(e.verticalHasArrows?e.arrowSize:0,e.vertical===2?0:e.verticalScrollbarSize,0,n.height,n.scrollHeight,a.scrollTop),visibility:e.vertical,extraScrollbarClassName:"vertical",scrollable:t,scrollByPage:e.scrollByPage}),e.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((e.verticalScrollbarSize-e.verticalSliderSize)/2),e.verticalSliderSize,void 0)}_updateSlider(t,e){this.slider.setHeight(t),this.slider.setTop(e)}_renderDomNode(t,e){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(t){return this._shouldRender=this._onElementScrollSize(t.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(t.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(t.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(t,e){return e}_sliderPointerPosition(t){return t.pageY}_sliderOrthogonalPointerPosition(t){return t.pageX}_updateScrollbarSize(t){this.slider.setWidth(t)}writeScrollPosition(t,e){t.scrollTop=e}updateOptions(t){this.updateScrollbarSize(t.vertical===2?0:t.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(t.vertical),this._scrollByPage=t.scrollByPage}},mA=500,kb=50,_A=class{constructor(e,i,n){this.timestamp=e,this.deltaX=i,this.deltaY=n,this.score=0}},Kp=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let e=1,i=0,n=1,a=this._rear;do{let l=a===this._front?e:Math.pow(2,-n);if(e-=l,i+=this._memory[a].score*l,a===this._front)break;a=(this._capacity+a-1)%this._capacity,n++}while(!0);return i<=.5}acceptStandardWheelEvent(e){if(Wg){let i=tn(e.browserEvent),n=ER(i);this.accept(Date.now(),e.deltaX*n,e.deltaY*n)}else this.accept(Date.now(),e.deltaX,e.deltaY)}accept(e,i,n){let a=null,l=new _A(e,i,n);this._front===-1&&this._rear===-1?(this._memory[0]=l,this._front=0,this._rear=0):(a=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=l),l.score=this._computeScore(l,a)}_computeScore(e,i){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let n=.5;if((!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(n+=.25),i){let a=Math.abs(e.deltaX),l=Math.abs(e.deltaY),u=Math.abs(i.deltaX),h=Math.abs(i.deltaY),f=Math.max(Math.min(a,u),1),d=Math.max(Math.min(l,h),1),p=Math.max(a,u),v=Math.max(l,h);p%f===0&&v%d===0&&(n-=.5)}return Math.min(Math.max(n,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}};Kp.INSTANCE=new Kp;var pA=Kp,gA=class extends Yg{constructor(t,e,i){super(),this._onScroll=this._register(new ge),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new ge),this.onWillScroll=this._onWillScroll.event,this._options=SA(e),this._scrollable=i,this._register(this._scrollable.onScroll(a=>{this._onWillScroll.fire(a),this._onDidScroll(a),this._onScroll.fire(a)}));let n={onMouseWheel:a=>this._onMouseWheel(a),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new fA(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new dA(this._scrollable,this._options,n)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(t),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=xu(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=xu(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=xu(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 Vg),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=Uo(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(t){this._verticalScrollbar.delegatePointerDown(t)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(t){this._scrollable.setScrollDimensions(t,!1)}updateClassName(t){this._options.className=t,sn&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(t){typeof t.handleMouseWheel<"u"&&(this._options.handleMouseWheel=t.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof t.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=t.mouseWheelScrollSensitivity),typeof t.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=t.fastScrollSensitivity),typeof t.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=t.scrollPredominantAxis),typeof t.horizontal<"u"&&(this._options.horizontal=t.horizontal),typeof t.vertical<"u"&&(this._options.vertical=t.vertical),typeof t.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=t.horizontalScrollbarSize),typeof t.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=t.verticalScrollbarSize),typeof t.scrollByPage<"u"&&(this._options.scrollByPage=t.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(t){this._revealOnScroll=t}delegateScrollFromMouseWheelEvent(t){this._onMouseWheel(new vb(t))}_setListeningToMouseWheel(t){if(this._mouseWheelToDispose.length>0!==t&&(this._mouseWheelToDispose=Uo(this._mouseWheelToDispose),t)){let e=i=>{this._onMouseWheel(new vb(i))};this._mouseWheelToDispose.push(Ve(this._listenOnDomNode,Di.MOUSE_WHEEL,e,{passive:!1}))}}_onMouseWheel(t){if(t.browserEvent?.defaultPrevented)return;let e=pA.INSTANCE;e.acceptStandardWheelEvent(t);let i=!1;if(t.deltaY||t.deltaX){let a=t.deltaY*this._options.mouseWheelScrollSensitivity,l=t.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&l+a===0?l=a=0:Math.abs(a)>=Math.abs(l)?l=0:a=0),this._options.flipAxes&&([a,l]=[l,a]);let u=!sn&&t.browserEvent&&t.browserEvent.shiftKey;(this._options.scrollYToX||u)&&!l&&(l=a,a=0),t.browserEvent&&t.browserEvent.altKey&&(l=l*this._options.fastScrollSensitivity,a=a*this._options.fastScrollSensitivity);let h=this._scrollable.getFutureScrollPosition(),f={};if(a){let d=kb*a,p=h.scrollTop-(d<0?Math.floor(d):Math.ceil(d));this._verticalScrollbar.writeScrollPosition(f,p)}if(l){let d=kb*l,p=h.scrollLeft-(d<0?Math.floor(d):Math.ceil(d));this._horizontalScrollbar.writeScrollPosition(f,p)}f=this._scrollable.validateScrollPosition(f),(h.scrollLeft!==f.scrollLeft||h.scrollTop!==f.scrollTop)&&(this._options.mouseWheelSmoothScroll&&e.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(f):this._scrollable.setScrollPositionNow(f),i=!0)}let n=i;!n&&this._options.alwaysConsumeMouseWheel&&(n=!0),!n&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(n=!0),n&&(t.preventDefault(),t.stopPropagation())}_onDidScroll(t){this._shouldRender=this._horizontalScrollbar.onDidScroll(t)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(t)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let t=this._scrollable.getCurrentScrollPosition(),e=t.scrollTop>0,i=t.scrollLeft>0,n=i?" left":"",a=e?" top":"",l=i||e?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${a}`),this._topLeftShadowDomNode.setClassName(`shadow${l}${a}${n}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(t){this._mouseIsOver=!1,this._hide()}_onMouseOver(t){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),mA)}},vA=class extends gA{constructor(e,i,n){super(e,i,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function SA(t){let e={lazyRender:typeof t.lazyRender<"u"?t.lazyRender:!1,className:typeof t.className<"u"?t.className:"",useShadows:typeof t.useShadows<"u"?t.useShadows:!0,handleMouseWheel:typeof t.handleMouseWheel<"u"?t.handleMouseWheel:!0,flipAxes:typeof t.flipAxes<"u"?t.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof t.consumeMouseWheelIfScrollbarIsNeeded<"u"?t.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof t.alwaysConsumeMouseWheel<"u"?t.alwaysConsumeMouseWheel:!1,scrollYToX:typeof t.scrollYToX<"u"?t.scrollYToX:!1,mouseWheelScrollSensitivity:typeof t.mouseWheelScrollSensitivity<"u"?t.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof t.fastScrollSensitivity<"u"?t.fastScrollSensitivity:5,scrollPredominantAxis:typeof t.scrollPredominantAxis<"u"?t.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof t.mouseWheelSmoothScroll<"u"?t.mouseWheelSmoothScroll:!0,arrowSize:typeof t.arrowSize<"u"?t.arrowSize:11,listenOnDomNode:typeof t.listenOnDomNode<"u"?t.listenOnDomNode:null,horizontal:typeof t.horizontal<"u"?t.horizontal:1,horizontalScrollbarSize:typeof t.horizontalScrollbarSize<"u"?t.horizontalScrollbarSize:10,horizontalSliderSize:typeof t.horizontalSliderSize<"u"?t.horizontalSliderSize:0,horizontalHasArrows:typeof t.horizontalHasArrows<"u"?t.horizontalHasArrows:!1,vertical:typeof t.vertical<"u"?t.vertical:1,verticalScrollbarSize:typeof t.verticalScrollbarSize<"u"?t.verticalScrollbarSize:10,verticalHasArrows:typeof t.verticalHasArrows<"u"?t.verticalHasArrows:!1,verticalSliderSize:typeof t.verticalSliderSize<"u"?t.verticalSliderSize:0,scrollByPage:typeof t.scrollByPage<"u"?t.scrollByPage:!1};return e.horizontalSliderSize=typeof t.horizontalSliderSize<"u"?t.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof t.verticalSliderSize<"u"?t.verticalSliderSize:e.verticalScrollbarSize,sn&&(e.className+=" mac"),e}var Xp=class extends st{constructor(e,i,n,a,l,u,h,f){super(),this._bufferService=n,this._optionsService=h,this._renderService=f,this._onRequestScrollLines=this._register(new ge),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let d=this._register(new aA({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:p=>qg(a.window,p)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{d.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new vA(i,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},d)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(l.onProtocolChange(p=>{this._scrollableElement.updateOptions({handleMouseWheel:!(p&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(Zi.runAndSubscribe(u.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=u.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(Wt(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=a.mainDocument.createElement("style"),i.appendChild(this._styleElement),this._register(Wt(()=>this._styleElement.remove())),this._register(Zi.runAndSubscribe(u.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${u.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${u.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${u.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
|
|
18
|
+
`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(p=>this._handleScroll(p)))}scrollLines(e){let i=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:i.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,i){i&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!i,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let i=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),n=i-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=i,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}};Xp=si([we(2,hs),we(3,Yn),we(4,Zw),we(5,Zl),we(6,ds),we(7,Gn)],Xp);var Zp=class extends st{constructor(e,i,n,a,l){super(),this._screenElement=e,this._bufferService=i,this._coreBrowserService=n,this._decorationService=a,this._renderService=l,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(u=>this._removeDecoration(u))),this._register(Wt(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let i=this._coreBrowserService.mainDocument.createElement("div");i.classList.add("xterm-decoration"),i.classList.toggle("xterm-decoration-top-layer",e?.options?.layer==="top"),i.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,i.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,i.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,i.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(i.style.display="none"),this._refreshXPosition(e,i),i}_refreshStyle(e){let i=e.marker.line-this._bufferService.buffers.active.ydisp;if(i<0||i>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose(()=>{this._decorationElements.delete(e),n.remove()})),n.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(n.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,n.style.top=`${i*this._renderService.dimensions.css.cell.height}px`,n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(n)}}_refreshXPosition(e,i=e.element){if(!i)return;let n=e.options.x??0;(e.options.anchor||"left")==="right"?i.style.right=n?`${n*this._renderService.dimensions.css.cell.width}px`:"":i.style.left=n?`${n*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};Zp=si([we(1,hs),we(2,Yn),we(3,Nu),we(4,Gn)],Zp);var yA=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let i of this._zones)if(i.color===e.options.overviewRulerOptions.color&&i.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(i,e.marker.line))return;if(this._lineAdjacentToZone(i,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(i,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,i){return i>=e.startBufferLine&&i<=e.endBufferLine}_lineAdjacentToZone(e,i,n){return i>=e.startBufferLine-this._linePadding[n||"full"]&&i<=e.endBufferLine+this._linePadding[n||"full"]}_addLineToZone(e,i){e.startBufferLine=Math.min(e.startBufferLine,i),e.endBufferLine=Math.max(e.endBufferLine,i)}},Zr={full:0,left:0,center:0,right:0},La={full:0,left:0,center:0,right:0},iu={full:0,left:0,center:0,right:0},Yd=class extends st{constructor(e,i,n,a,l,u,h,f){super(),this._viewportElement=e,this._screenElement=i,this._bufferService=n,this._decorationService=a,this._renderService=l,this._optionsService=u,this._themeService=h,this._coreBrowserService=f,this._colorZoneStore=new yA,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement),this._register(Wt(()=>this._canvas?.remove()));let d=this._canvas.getContext("2d");if(d)this._ctx=d;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),this._register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this._register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){return this._optionsService.options.overviewRuler?.width||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),i=Math.ceil((this._canvas.width-1)/3);La.full=this._canvas.width,La.left=e,La.center=i,La.right=e,this._refreshDrawHeightConstants(),iu.full=1,iu.left=1,iu.center=1+La.left,iu.right=1+La.left+La.center}_refreshDrawHeightConstants(){Zr.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,i=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);Zr.left=i,Zr.center=i,Zr.right=i}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Zr.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Zr.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Zr.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Zr.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let i of this._decorationService.decorations)this._colorZoneStore.addDecoration(i);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let i of e)i.position!=="full"&&this._renderColorZone(i);for(let i of e)i.position==="full"&&this._renderColorZone(i);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(iu[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-Zr[e.position||"full"]/2),La[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+Zr[e.position||"full"]))}_queueRefresh(e,i){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=i||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};Yd=si([we(2,hs),we(3,Nu),we(4,Gn),we(5,ds),we(6,Zl),we(7,Yn)],Yd);var le;(t=>(t.NUL="\0",t.SOH="",t.STX="",t.ETX="",t.EOT="",t.ENQ="",t.ACK="",t.BEL="\x07",t.BS="\b",t.HT=" ",t.LF=`
|
|
19
|
+
`,t.VT="\v",t.FF="\f",t.CR="\r",t.SO="",t.SI="",t.DLE="",t.DC1="",t.DC2="",t.DC3="",t.DC4="",t.NAK="",t.SYN="",t.ETB="",t.CAN="",t.EM="",t.SUB="",t.ESC="\x1B",t.FS="",t.GS="",t.RS="",t.US="",t.SP=" ",t.DEL=""))(le||={});var xd;(t=>(t.PAD="",t.HOP="",t.BPH="",t.NBH="",t.IND="",t.NEL="
",t.SSA="",t.ESA="",t.HTS="",t.HTJ="",t.VTS="",t.PLD="",t.PLU="",t.RI="",t.SS2="",t.SS3="",t.DCS="",t.PU1="",t.PU2="",t.STS="",t.CCH="",t.MW="",t.SPA="",t.EPA="",t.SOS="",t.SGCI="",t.SCI="",t.CSI="",t.ST="",t.OSC="",t.PM="",t.APC=""))(xd||={});var vC;(t=>t.ST=`${le.ESC}\\`)(vC||={});var Qp=class{constructor(e,i,n,a,l,u){this._textarea=e,this._compositionView=i,this._bufferService=n,this._optionsService=a,this._coreService=l,this._renderService=u,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let i={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let n;i.start+=this._dataAlreadySent.length,this._isComposing?n=this._textarea.value.substring(i.start,this._compositionPosition.start):n=this._textarea.value.substring(i.start),n.length>0&&this._coreService.triggerDataEvent(n,!0)}},0)}else{this._isSendingComposition=!1;let i=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(i,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let i=this._textarea.value,n=i.replace(e,"");this._dataAlreadySent=n,i.length>e.length?this._coreService.triggerDataEvent(n,!0):i.length<e.length?this._coreService.triggerDataEvent(`${le.DEL}`,!0):i.length===e.length&&i!==e&&this._coreService.triggerDataEvent(i,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let i=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),n=this._renderService.dimensions.css.cell.height,a=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,l=i*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=l+"px",this._compositionView.style.top=a+"px",this._compositionView.style.height=n+"px",this._compositionView.style.lineHeight=n+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let u=this._compositionView.getBoundingClientRect();this._textarea.style.left=l+"px",this._textarea.style.top=a+"px",this._textarea.style.width=Math.max(u.width,1)+"px",this._textarea.style.height=Math.max(u.height,1)+"px",this._textarea.style.lineHeight=u.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};Qp=si([we(2,hs),we(3,ds),we(4,Wo),we(5,Gn)],Qp);var Oi=0,Bi=0,Ni=0,ti=0,Eb={css:"#00000000",rgba:0},gi;(t=>{function e(a,l,u,h){return h!==void 0?`#${xo(a)}${xo(l)}${xo(u)}${xo(h)}`:`#${xo(a)}${xo(l)}${xo(u)}`}t.toCss=e;function i(a,l,u,h=255){return(a<<24|l<<16|u<<8|h)>>>0}t.toRgba=i;function n(a,l,u,h){return{css:t.toCss(a,l,u,h),rgba:t.toRgba(a,l,u,h)}}t.toColor=n})(gi||={});var Ht;(t=>{function e(f,d){if(ti=(d.rgba&255)/255,ti===1)return{css:d.css,rgba:d.rgba};let p=d.rgba>>24&255,v=d.rgba>>16&255,g=d.rgba>>8&255,S=f.rgba>>24&255,b=f.rgba>>16&255,C=f.rgba>>8&255;Oi=S+Math.round((p-S)*ti),Bi=b+Math.round((v-b)*ti),Ni=C+Math.round((g-C)*ti);let x=gi.toCss(Oi,Bi,Ni),E=gi.toRgba(Oi,Bi,Ni);return{css:x,rgba:E}}t.blend=e;function i(f){return(f.rgba&255)===255}t.isOpaque=i;function n(f,d,p){let v=kd.ensureContrastRatio(f.rgba,d.rgba,p);if(v)return gi.toColor(v>>24&255,v>>16&255,v>>8&255)}t.ensureContrastRatio=n;function a(f){let d=(f.rgba|255)>>>0;return[Oi,Bi,Ni]=kd.toChannels(d),{css:gi.toCss(Oi,Bi,Ni),rgba:d}}t.opaque=a;function l(f,d){return ti=Math.round(d*255),[Oi,Bi,Ni]=kd.toChannels(f.rgba),{css:gi.toCss(Oi,Bi,Ni,ti),rgba:gi.toRgba(Oi,Bi,Ni,ti)}}t.opacity=l;function u(f,d){return ti=f.rgba&255,l(f,ti*d/255)}t.multiplyOpacity=u;function h(f){return[f.rgba>>24&255,f.rgba>>16&255,f.rgba>>8&255]}t.toColorRGB=h})(Ht||={});var Yt;(t=>{let e,i;try{let a=document.createElement("canvas");a.width=1,a.height=1;let l=a.getContext("2d",{willReadFrequently:!0});l&&(e=l,e.globalCompositeOperation="copy",i=e.createLinearGradient(0,0,1,1))}catch{}function n(a){if(a.match(/#[\da-f]{3,8}/i))switch(a.length){case 4:return Oi=parseInt(a.slice(1,2).repeat(2),16),Bi=parseInt(a.slice(2,3).repeat(2),16),Ni=parseInt(a.slice(3,4).repeat(2),16),gi.toColor(Oi,Bi,Ni);case 5:return Oi=parseInt(a.slice(1,2).repeat(2),16),Bi=parseInt(a.slice(2,3).repeat(2),16),Ni=parseInt(a.slice(3,4).repeat(2),16),ti=parseInt(a.slice(4,5).repeat(2),16),gi.toColor(Oi,Bi,Ni,ti);case 7:return{css:a,rgba:(parseInt(a.slice(1),16)<<8|255)>>>0};case 9:return{css:a,rgba:parseInt(a.slice(1),16)>>>0}}let l=a.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(l)return Oi=parseInt(l[1]),Bi=parseInt(l[2]),Ni=parseInt(l[3]),ti=Math.round((l[5]===void 0?1:parseFloat(l[5]))*255),gi.toColor(Oi,Bi,Ni,ti);if(!e||!i)throw new Error("css.toColor: Unsupported css format");if(e.fillStyle=i,e.fillStyle=a,typeof e.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(e.fillRect(0,0,1,1),[Oi,Bi,Ni,ti]=e.getImageData(0,0,1,1).data,ti!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:gi.toRgba(Oi,Bi,Ni,ti),css:a}}t.toColor=n})(Yt||={});var ls;(t=>{function e(n){return i(n>>16&255,n>>8&255,n&255)}t.relativeLuminance=e;function i(n,a,l){let u=n/255,h=a/255,f=l/255,d=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4),p=h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4),v=f<=.03928?f/12.92:Math.pow((f+.055)/1.055,2.4);return d*.2126+p*.7152+v*.0722}t.relativeLuminance2=i})(ls||={});var kd;(t=>{function e(u,h){if(ti=(h&255)/255,ti===1)return h;let f=h>>24&255,d=h>>16&255,p=h>>8&255,v=u>>24&255,g=u>>16&255,S=u>>8&255;return Oi=v+Math.round((f-v)*ti),Bi=g+Math.round((d-g)*ti),Ni=S+Math.round((p-S)*ti),gi.toRgba(Oi,Bi,Ni)}t.blend=e;function i(u,h,f){let d=ls.relativeLuminance(u>>8),p=ls.relativeLuminance(h>>8);if(Bn(d,p)<f){if(p<d){let S=n(u,h,f),b=Bn(d,ls.relativeLuminance(S>>8));if(b<f){let C=a(u,h,f),x=Bn(d,ls.relativeLuminance(C>>8));return b>x?S:C}return S}let v=a(u,h,f),g=Bn(d,ls.relativeLuminance(v>>8));if(g<f){let S=n(u,h,f),b=Bn(d,ls.relativeLuminance(S>>8));return g>b?v:S}return v}}t.ensureContrastRatio=i;function n(u,h,f){let d=u>>24&255,p=u>>16&255,v=u>>8&255,g=h>>24&255,S=h>>16&255,b=h>>8&255,C=Bn(ls.relativeLuminance2(g,S,b),ls.relativeLuminance2(d,p,v));for(;C<f&&(g>0||S>0||b>0);)g-=Math.max(0,Math.ceil(g*.1)),S-=Math.max(0,Math.ceil(S*.1)),b-=Math.max(0,Math.ceil(b*.1)),C=Bn(ls.relativeLuminance2(g,S,b),ls.relativeLuminance2(d,p,v));return(g<<24|S<<16|b<<8|255)>>>0}t.reduceLuminance=n;function a(u,h,f){let d=u>>24&255,p=u>>16&255,v=u>>8&255,g=h>>24&255,S=h>>16&255,b=h>>8&255,C=Bn(ls.relativeLuminance2(g,S,b),ls.relativeLuminance2(d,p,v));for(;C<f&&(g<255||S<255||b<255);)g=Math.min(255,g+Math.ceil((255-g)*.1)),S=Math.min(255,S+Math.ceil((255-S)*.1)),b=Math.min(255,b+Math.ceil((255-b)*.1)),C=Bn(ls.relativeLuminance2(g,S,b),ls.relativeLuminance2(d,p,v));return(g<<24|S<<16|b<<8|255)>>>0}t.increaseLuminance=a;function l(u){return[u>>24&255,u>>16&255,u>>8&255,u&255]}t.toChannels=l})(kd||={});function xo(t){let e=t.toString(16);return e.length<2?"0"+e:e}function Bn(t,e){return t<e?(e+.05)/(t+.05):(t+.05)/(e+.05)}var bA=class extends Bu{constructor(e,i,n){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=i,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Gd=class{constructor(t){this._bufferService=t,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new Cr}register(t){let e={id:this._nextCharacterJoinerId++,handler:t};return this._characterJoiners.push(e),e.id}deregister(t){for(let e=0;e<this._characterJoiners.length;e++)if(this._characterJoiners[e].id===t)return this._characterJoiners.splice(e,1),!0;return!1}getJoinedCharacters(t){if(this._characterJoiners.length===0)return[];let e=this._bufferService.buffer.lines.get(t);if(!e||e.length===0)return[];let i=[],n=e.translateToString(!0),a=0,l=0,u=0,h=e.getFg(0),f=e.getBg(0);for(let d=0;d<e.getTrimmedLength();d++)if(e.loadCell(d,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==h||this._workCell.bg!==f){if(d-a>1){let p=this._getJoinedRanges(n,u,l,e,a);for(let v=0;v<p.length;v++)i.push(p[v])}a=d,u=l,h=this._workCell.fg,f=this._workCell.bg}l+=this._workCell.getChars().length||$a.length}if(this._bufferService.cols-a>1){let d=this._getJoinedRanges(n,u,l,e,a);for(let p=0;p<d.length;p++)i.push(d[p])}return i}_getJoinedRanges(t,e,i,n,a){let l=t.substring(e,i),u=[];try{u=this._characterJoiners[0].handler(l)}catch(h){console.error(h)}for(let h=1;h<this._characterJoiners.length;h++)try{let f=this._characterJoiners[h].handler(l);for(let d=0;d<f.length;d++)Gd._mergeRanges(u,f[d])}catch(f){console.error(f)}return this._stringRangesToCellRanges(u,n,a),u}_stringRangesToCellRanges(t,e,i){let n=0,a=!1,l=0,u=t[n];if(u){for(let h=i;h<this._bufferService.cols;h++){let f=e.getWidth(h),d=e.getString(h).length||$a.length;if(f!==0){if(!a&&u[0]<=l&&(u[0]=h,a=!0),u[1]<=l){if(u[1]=h,u=t[++n],!u)break;u[0]<=l?(u[0]=h,a=!0):a=!1}l+=d}}u&&(u[1]=this._bufferService.cols)}}static _mergeRanges(t,e){let i=!1;for(let n=0;n<t.length;n++){let a=t[n];if(i){if(e[1]<=a[0])return t[n-1][1]=e[1],t;if(e[1]<=a[1])return t[n-1][1]=Math.max(e[1],a[1]),t.splice(n,1),t;t.splice(n,1),n--}else{if(e[1]<=a[0])return t.splice(n,0,e),t;if(e[1]<=a[1])return a[0]=Math.min(e[0],a[0]),t;e[0]<a[1]&&(a[0]=Math.min(e[0],a[0]),i=!0);continue}}return i?t[t.length-1][1]=e[1]:t.push(e),t}};Gd=si([we(0,hs)],Gd);function wA(t){return 57508<=t&&t<=57558}function CA(t){return 9472<=t&&t<=9631}function xA(t){return wA(t)||CA(t)}function kA(){return{css:{canvas:nd(),cell:nd()},device:{canvas:nd(),cell:nd(),char:{width:0,height:0,left:0,top:0}}}}function nd(){return{width:0,height:0}}var Jp=class{constructor(e,i,n,a,l,u,h){this._document=e,this._characterJoinerService=i,this._optionsService=n,this._coreBrowserService=a,this._coreService=l,this._decorationService=u,this._themeService=h,this._workCell=new Cr,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,i,n){this._selectionStart=e,this._selectionEnd=i,this._columnSelectMode=n}createRow(e,i,n,a,l,u,h,f,d,p,v){let g=[],S=this._characterJoinerService.getJoinedCharacters(i),b=this._themeService.colors,C=e.getNoBgTrimmedLength();n&&C<u+1&&(C=u+1);let x,E=0,A="",B=0,R=0,$=0,F=0,U=!1,z=0,V=!1,se=0,ee=0,M=[],O=p!==-1&&v!==-1;for(let N=0;N<C;N++){e.loadCell(N,this._workCell);let P=this._workCell.getWidth();if(P===0)continue;let T=!1,L=N>=ee,H=N,Y=this._workCell;if(S.length>0&&N===S[0][0]&&L){let xe=S.shift(),ze=this._isCellInSelection(xe[0],i);for(B=xe[0]+1;B<xe[1];B++)L&&=ze===this._isCellInSelection(B,i);L&&=!n||u<xe[0]||u>=xe[1],L?(T=!0,Y=new bA(this._workCell,e.translateToString(!0,xe[0],xe[1]),xe[1]-xe[0]),H=xe[1]-1,P=Y.getWidth()):ee=xe[1]}let X=this._isCellInSelection(N,i),D=n&&N===u,G=O&&N>=p&&N<=v,ie=!1;this._decorationService.forEachDecorationAtCell(N,i,void 0,xe=>{ie=!0});let ae=Y.getChars()||$a;if(ae===" "&&(Y.isUnderline()||Y.isOverline())&&(ae=" "),se=P*f-d.get(ae,Y.isBold(),Y.isItalic()),!x)x=this._document.createElement("span");else if(E&&(X&&V||!X&&!V&&Y.bg===R)&&(X&&V&&b.selectionForeground||Y.fg===$)&&Y.extended.ext===F&&G===U&&se===z&&!D&&!T&&!ie&&L){Y.isInvisible()?A+=$a:A+=ae,E++;continue}else E&&(x.textContent=A),x=this._document.createElement("span"),E=0,A="";if(R=Y.bg,$=Y.fg,F=Y.extended.ext,U=G,z=se,V=X,T&&u>=N&&u<=H&&(u=N),!this._coreService.isCursorHidden&&D&&this._coreService.isCursorInitialized){if(M.push("xterm-cursor"),this._coreBrowserService.isFocused)h&&M.push("xterm-cursor-blink"),M.push(a==="bar"?"xterm-cursor-bar":a==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(l)switch(l){case"outline":M.push("xterm-cursor-outline");break;case"block":M.push("xterm-cursor-block");break;case"bar":M.push("xterm-cursor-bar");break;case"underline":M.push("xterm-cursor-underline");break}}if(Y.isBold()&&M.push("xterm-bold"),Y.isItalic()&&M.push("xterm-italic"),Y.isDim()&&M.push("xterm-dim"),Y.isInvisible()?A=$a:A=Y.getChars()||$a,Y.isUnderline()&&(M.push(`xterm-underline-${Y.extended.underlineStyle}`),A===" "&&(A=" "),!Y.isUnderlineColorDefault()))if(Y.isUnderlineColorRGB())x.style.textDecorationColor=`rgb(${Bu.toColorRGB(Y.getUnderlineColor()).join(",")})`;else{let xe=Y.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Y.isBold()&&xe<8&&(xe+=8),x.style.textDecorationColor=b.ansi[xe].css}Y.isOverline()&&(M.push("xterm-overline"),A===" "&&(A=" ")),Y.isStrikethrough()&&M.push("xterm-strikethrough"),G&&(x.style.textDecoration="underline");let de=Y.getFgColor(),ue=Y.getFgColorMode(),he=Y.getBgColor(),ve=Y.getBgColorMode(),ye=!!Y.isInverse();if(ye){let xe=de;de=he,he=xe;let ze=ue;ue=ve,ve=ze}let Ae,De,rt=!1;this._decorationService.forEachDecorationAtCell(N,i,void 0,xe=>{xe.options.layer!=="top"&&rt||(xe.backgroundColorRGB&&(ve=50331648,he=xe.backgroundColorRGB.rgba>>8&16777215,Ae=xe.backgroundColorRGB),xe.foregroundColorRGB&&(ue=50331648,de=xe.foregroundColorRGB.rgba>>8&16777215,De=xe.foregroundColorRGB),rt=xe.options.layer==="top")}),!rt&&X&&(Ae=this._coreBrowserService.isFocused?b.selectionBackgroundOpaque:b.selectionInactiveBackgroundOpaque,he=Ae.rgba>>8&16777215,ve=50331648,rt=!0,b.selectionForeground&&(ue=50331648,de=b.selectionForeground.rgba>>8&16777215,De=b.selectionForeground)),rt&&M.push("xterm-decoration-top");let Ze;switch(ve){case 16777216:case 33554432:Ze=b.ansi[he],M.push(`xterm-bg-${he}`);break;case 50331648:Ze=gi.toColor(he>>16,he>>8&255,he&255),this._addStyle(x,`background-color:#${Tb((he>>>0).toString(16),"0",6)}`);break;default:ye?(Ze=b.foreground,M.push("xterm-bg-257")):Ze=b.background}switch(Ae||Y.isDim()&&(Ae=Ht.multiplyOpacity(Ze,.5)),ue){case 16777216:case 33554432:Y.isBold()&&de<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(de+=8),this._applyMinimumContrast(x,Ze,b.ansi[de],Y,Ae,void 0)||M.push(`xterm-fg-${de}`);break;case 50331648:let xe=gi.toColor(de>>16&255,de>>8&255,de&255);this._applyMinimumContrast(x,Ze,xe,Y,Ae,De)||this._addStyle(x,`color:#${Tb(de.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(x,Ze,b.foreground,Y,Ae,De)||ye&&M.push("xterm-fg-257")}M.length&&(x.className=M.join(" "),M.length=0),!D&&!T&&!ie&&L?E++:x.textContent=A,se!==this.defaultSpacing&&(x.style.letterSpacing=`${se}px`),g.push(x),N=H}return x&&E&&(x.textContent=A),g}_applyMinimumContrast(e,i,n,a,l,u){if(this._optionsService.rawOptions.minimumContrastRatio===1||xA(a.getCode()))return!1;let h=this._getContrastCache(a),f;if(!l&&!u&&(f=h.getColor(i.rgba,n.rgba)),f===void 0){let d=this._optionsService.rawOptions.minimumContrastRatio/(a.isDim()?2:1);f=Ht.ensureContrastRatio(l||i,u||n,d),h.setColor((l||i).rgba,(u||n).rgba,f??null)}return f?(this._addStyle(e,`color:${f.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,i){e.setAttribute("style",`${e.getAttribute("style")||""}${i};`)}_isCellInSelection(e,i){let n=this._selectionStart,a=this._selectionEnd;return!n||!a?!1:this._columnSelectMode?n[0]<=a[0]?e>=n[0]&&i>=n[1]&&e<a[0]&&i<=a[1]:e<n[0]&&i>=n[1]&&e>=a[0]&&i<=a[1]:i>n[1]&&i<a[1]||n[1]===a[1]&&i===n[1]&&e>=n[0]&&e<a[0]||n[1]<a[1]&&i===a[1]&&e<a[0]||n[1]<a[1]&&i===n[1]&&e>=n[0]}};Jp=si([we(1,eC),we(2,ds),we(3,Yn),we(4,Wo),we(5,Nu),we(6,Zl)],Jp);function Tb(t,e,i){for(;t.length<i;)t=e+t;return t}var EA=class{constructor(e,i){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=e.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";let n=e.createElement("span");n.classList.add("xterm-char-measure-element");let a=e.createElement("span");a.classList.add("xterm-char-measure-element"),a.style.fontWeight="bold";let l=e.createElement("span");l.classList.add("xterm-char-measure-element"),l.style.fontStyle="italic";let u=e.createElement("span");u.classList.add("xterm-char-measure-element"),u.style.fontWeight="bold",u.style.fontStyle="italic",this._measureElements=[n,a,l,u],this._container.appendChild(n),this._container.appendChild(a),this._container.appendChild(l),this._container.appendChild(u),i.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(e,i,n,a){e===this._font&&i===this._fontSize&&n===this._weight&&a===this._weightBold||(this._font=e,this._fontSize=i,this._weight=n,this._weightBold=a,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${a}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${a}`,this.clear())}get(e,i,n){let a=0;if(!i&&!n&&e.length===1&&(a=e.charCodeAt(0))<256){if(this._flat[a]!==-9999)return this._flat[a];let h=this._measure(e,0);return h>0&&(this._flat[a]=h),h}let l=e;i&&(l+="B"),n&&(l+="I");let u=this._holey.get(l);if(u===void 0){let h=0;i&&(h|=1),n&&(h|=2),u=this._measure(e,h),u>0&&this._holey.set(l,u)}return u}_measure(e,i){let n=this._measureElements[i];return n.textContent=e.repeat(32),n.offsetWidth/32}},TA=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,i,n,a=!1){if(this.selectionStart=i,this.selectionEnd=n,!i||!n||i[0]===n[0]&&i[1]===n[1]){this.clear();return}let l=e.buffers.active.ydisp,u=i[1]-l,h=n[1]-l,f=Math.max(u,0),d=Math.min(h,e.rows-1);if(f>=e.rows||d<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=a,this.viewportStartRow=u,this.viewportEndRow=h,this.viewportCappedStartRow=f,this.viewportCappedEndRow=d,this.startCol=i[0],this.endCol=n[0]}isCellSelected(e,i,n){return this.hasSelection?(n-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?i>=this.startCol&&n>=this.viewportCappedStartRow&&i<this.endCol&&n<=this.viewportCappedEndRow:i<this.startCol&&n>=this.viewportCappedStartRow&&i>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&n===this.viewportStartRow&&i>=this.startCol&&i<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportEndRow&&i<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportStartRow&&i>=this.startCol):!1}};function RA(){return new TA}var K_="xterm-dom-renderer-owner-",_r="xterm-rows",ad="xterm-fg-",Rb="xterm-bg-",su="xterm-focus",od="xterm-selection",AA=1,eg=class extends st{constructor(e,i,n,a,l,u,h,f,d,p,v,g,S,b){super(),this._terminal=e,this._document=i,this._element=n,this._screenElement=a,this._viewportElement=l,this._helperContainer=u,this._linkifier2=h,this._charSizeService=d,this._optionsService=p,this._bufferService=v,this._coreService=g,this._coreBrowserService=S,this._themeService=b,this._terminalClass=AA++,this._rowElements=[],this._selectionRenderModel=RA(),this.onRequestRedraw=this._register(new ge).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(_r),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(od),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=kA(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(C=>this._injectCss(C))),this._injectCss(this._themeService.colors),this._rowFactory=f.createInstance(Jp,document),this._element.classList.add(K_+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(C=>this._handleLinkHover(C))),this._register(this._linkifier2.onHideLinkUnderline(C=>this._handleLinkLeave(C))),this._register(Wt(()=>{this._element.classList.remove(K_+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new EA(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let n of this._rowElements)n.style.width=`${this.dimensions.css.canvas.width}px`,n.style.height=`${this.dimensions.css.cell.height}px`,n.style.lineHeight=`${this.dimensions.css.cell.height}px`,n.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let i=`${this._terminalSelector} .${_r} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=i,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let i=`${this._terminalSelector} .${_r} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;i+=`${this._terminalSelector} .${_r} .xterm-dim { color: ${Ht.multiplyOpacity(e.foreground,.5).css};}`,i+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let n=`blink_underline_${this._terminalClass}`,a=`blink_bar_${this._terminalClass}`,l=`blink_block_${this._terminalClass}`;i+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,i+=`@keyframes ${a} { 50% { box-shadow: none; }}`,i+=`@keyframes ${l} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,i+=`${this._terminalSelector} .${_r}.${su} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${_r}.${su} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${a} 1s step-end infinite;}${this._terminalSelector} .${_r}.${su} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${l} 1s step-end infinite;}${this._terminalSelector} .${_r} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${_r} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${_r} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${_r} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${_r} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,i+=`${this._terminalSelector} .${od} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${od} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${od} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[u,h]of e.ansi.entries())i+=`${this._terminalSelector} .${ad}${u} { color: ${h.css}; }${this._terminalSelector} .${ad}${u}.xterm-dim { color: ${Ht.multiplyOpacity(h,.5).css}; }${this._terminalSelector} .${Rb}${u} { background-color: ${h.css}; }`;i+=`${this._terminalSelector} .${ad}257 { color: ${Ht.opaque(e.background).css}; }${this._terminalSelector} .${ad}257.xterm-dim { color: ${Ht.multiplyOpacity(Ht.opaque(e.background),.5).css}; }${this._terminalSelector} .${Rb}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=i}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,i){for(let n=this._rowElements.length;n<=i;n++){let a=this._document.createElement("div");this._rowContainer.appendChild(a),this._rowElements.push(a)}for(;this._rowElements.length>i;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,i){this._refreshRowElements(e,i),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(su),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(su),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,i,n){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,i,n),this.renderRows(0,this._bufferService.rows-1),!e||!i||(this._selectionRenderModel.update(this._terminal,e,i,n),!this._selectionRenderModel.hasSelection))return;let a=this._selectionRenderModel.viewportStartRow,l=this._selectionRenderModel.viewportEndRow,u=this._selectionRenderModel.viewportCappedStartRow,h=this._selectionRenderModel.viewportCappedEndRow,f=this._document.createDocumentFragment();if(n){let d=e[0]>i[0];f.appendChild(this._createSelectionElement(u,d?i[0]:e[0],d?e[0]:i[0],h-u+1))}else{let d=a===u?e[0]:0,p=u===l?i[0]:this._bufferService.cols;f.appendChild(this._createSelectionElement(u,d,p));let v=h-u-1;if(f.appendChild(this._createSelectionElement(u+1,0,this._bufferService.cols,v)),u!==h){let g=l===h?i[0]:this._bufferService.cols;f.appendChild(this._createSelectionElement(h,0,g))}}this._selectionContainer.appendChild(f)}_createSelectionElement(e,i,n,a=1){let l=this._document.createElement("div"),u=i*this.dimensions.css.cell.width,h=this.dimensions.css.cell.width*(n-i);return u+h>this.dimensions.css.canvas.width&&(h=this.dimensions.css.canvas.width-u),l.style.height=`${a*this.dimensions.css.cell.height}px`,l.style.top=`${e*this.dimensions.css.cell.height}px`,l.style.left=`${u}px`,l.style.width=`${h}px`,l}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,i){let n=this._bufferService.buffer,a=n.ybase+n.y,l=Math.min(n.x,this._bufferService.cols-1),u=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,h=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,f=this._optionsService.rawOptions.cursorInactiveStyle;for(let d=e;d<=i;d++){let p=d+n.ydisp,v=this._rowElements[d],g=n.lines.get(p);if(!v||!g)break;v.replaceChildren(...this._rowFactory.createRow(g,p,p===a,h,f,l,u,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${K_}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,i,n,a,l,u){n<0&&(e=0),a<0&&(i=0);let h=this._bufferService.rows-1;n=Math.max(Math.min(n,h),0),a=Math.max(Math.min(a,h),0),l=Math.min(l,this._bufferService.cols);let f=this._bufferService.buffer,d=f.ybase+f.y,p=Math.min(f.x,l-1),v=this._optionsService.rawOptions.cursorBlink,g=this._optionsService.rawOptions.cursorStyle,S=this._optionsService.rawOptions.cursorInactiveStyle;for(let b=n;b<=a;++b){let C=b+f.ydisp,x=this._rowElements[b],E=f.lines.get(C);if(!x||!E)break;x.replaceChildren(...this._rowFactory.createRow(E,C,C===d,g,S,p,v,this.dimensions.css.cell.width,this._widthCache,u?b===n?e:0:-1,u?(b===a?i:l)-1:-1))}}};eg=si([we(7,Ug),we(8,cf),we(9,ds),we(10,hs),we(11,Wo),we(12,Yn),we(13,Zl)],eg);var tg=class extends st{constructor(e,i,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new ge),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new LA(this._optionsService))}catch{this._measureStrategy=this._register(new MA(e,i,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};tg=si([we(2,ds)],tg);var SC=class extends st{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(t,e){t!==void 0&&t>0&&e!==void 0&&e>0&&(this._result.width=t,this._result.height=e)}},MA=class extends SC{constructor(t,e,i){super(),this._document=t,this._parentElement=e,this._optionsService=i,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},LA=class extends SC{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let i=this._ctx.measureText("W");if(!("width"in i&&"fontBoundingBoxAscent"in i&&"fontBoundingBoxDescent"in i))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},DA=class extends st{constructor(e,i,n){super(),this._textarea=e,this._window=i,this.mainDocument=n,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new OA(this._window)),this._onDprChange=this._register(new ge),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new ge),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(a=>this._screenDprMonitor.setWindow(a))),this._register(Zi.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Ve(this._textarea,"focus",()=>this._isFocused=!0)),this._register(Ve(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},OA=class extends st{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new Gl),this._onDprChange=this._register(new ge),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(Wt(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Ve(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},BA=class extends st{constructor(){super(),this.linkProviders=[],this._register(Wt(()=>this.linkProviders.length=0))}registerLinkProvider(t){return this.linkProviders.push(t),{dispose:()=>{let e=this.linkProviders.indexOf(t);e!==-1&&this.linkProviders.splice(e,1)}}}};function Gg(t,e,i){let n=i.getBoundingClientRect(),a=t.getComputedStyle(i),l=parseInt(a.getPropertyValue("padding-left")),u=parseInt(a.getPropertyValue("padding-top"));return[e.clientX-n.left-l,e.clientY-n.top-u]}function NA(t,e,i,n,a,l,u,h,f){if(!l)return;let d=Gg(t,e,i);if(d)return d[0]=Math.ceil((d[0]+(f?u/2:0))/u),d[1]=Math.ceil(d[1]/h),d[0]=Math.min(Math.max(d[0],1),n+(f?1:0)),d[1]=Math.min(Math.max(d[1],1),a),d}var ig=class{constructor(e,i){this._renderService=e,this._charSizeService=i}getCoords(e,i,n,a,l){return NA(window,e,i,n,a,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,l)}getMouseReportCoords(e,i){let n=Gg(window,e,i);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};ig=si([we(0,Gn),we(1,cf)],ig);var PA=class{constructor(e,i){this._renderCallback=e,this._coreBrowserService=i,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,i,n){this._rowCount=n,e=e!==void 0?e:0,i=i!==void 0?i:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,i):i,!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),i=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,i),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},yC={};qT(yC,{getSafariVersion:()=>HA,isChromeOS:()=>xC,isFirefox:()=>bC,isIpad:()=>IA,isIphone:()=>UA,isLegacyEdge:()=>zA,isLinux:()=>Kg,isMac:()=>Kd,isNode:()=>uf,isSafari:()=>wC,isWindows:()=>CC});var uf=typeof process<"u"&&"title"in process,Pu=uf?"node":navigator.userAgent,zu=uf?"node":navigator.platform,bC=Pu.includes("Firefox"),zA=Pu.includes("Edge"),wC=/^((?!chrome|android).)*safari/i.test(Pu);function HA(){if(!wC)return 0;let t=Pu.match(/Version\/(\d+)/);return t===null||t.length<2?0:parseInt(t[1])}var Kd=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(zu),IA=zu==="iPad",UA=zu==="iPhone",CC=["Windows","Win16","Win32","WinCE"].includes(zu),Kg=zu.indexOf("Linux")>=0,xC=/\bCrOS\b/.test(Pu),kC=class{constructor(){this._tasks=[],this._i=0}enqueue(t){this._tasks.push(t),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(t){this._idleCallback=void 0;let e=0,i=0,n=t.timeRemaining(),a=0;for(;this._i<this._tasks.length;){if(e=performance.now(),this._tasks[this._i]()||this._i++,e=Math.max(1,performance.now()-e),i=Math.max(e,i),a=t.timeRemaining(),i*1.5>a){n-e<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-e))}ms`),this._start();return}n=a}this.clear()}},FA=class extends kC{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let i=performance.now()+e;return{timeRemaining:()=>Math.max(0,i-performance.now())}}},$A=class extends kC{_requestCallback(t){return requestIdleCallback(t)}_cancelCallback(t){cancelIdleCallback(t)}},Xd=!uf&&"requestIdleCallback"in window?$A:FA,WA=class{constructor(){this._queue=new Xd}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},sg=class extends st{constructor(e,i,n,a,l,u,h,f,d){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=a,this._coreService=l,this._coreBrowserService=f,this._renderer=this._register(new Gl),this._pausedResizeTask=new WA,this._observerDisposable=this._register(new Gl),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 ge),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new ge),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new ge),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new ge),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new PA((p,v)=>this._renderRows(p,v),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new jA(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(Wt(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(h.onResize(()=>this._fullRefresh())),this._register(h.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(u.onDecorationRegistered(()=>this._fullRefresh())),this._register(u.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(h.cols,h.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(h.buffer.y,h.buffer.y,!0))),this._register(d.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,i),this._register(this._coreBrowserService.onWindowChange(p=>this._registerIntersectionObserver(p,i)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,i){if("IntersectionObserver"in e){let n=new e.IntersectionObserver(a=>this._handleIntersectionChange(a[a.length-1]),{threshold:0});n.observe(i),this._observerDisposable.value=Wt(()=>n.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,i,n=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,i);return}let a=this._syncOutputHandler.flush();a&&(e=Math.min(e,a.start),i=Math.max(i,a.end)),n||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,i,this._rowCount)}_renderRows(e,i){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,i);return}e=Math.min(e,this._rowCount-1),i=Math.min(i,this._rowCount-1),this._renderer.value.renderRows(e,i),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:i}),this._onRender.fire({start:e,end:i}),this._isNextRenderRedrawOnly=!0}}resize(e,i){this._rowCount=i,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(i=>this.refreshRows(i.start,i.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,i){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(e,i)):this._renderer.value.handleResize(e,i),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,i,n){this._selectionState.start=e,this._selectionState.end=i,this._selectionState.columnSelectMode=n,this._renderer.value?.handleSelectionChanged(e,i,n)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};sg=si([we(2,ds),we(3,cf),we(4,Wo),we(5,Nu),we(6,hs),we(7,Yn),we(8,Zl)],sg);var jA=class{constructor(t,e,i){this._coreBrowserService=t,this._coreService=e,this._onTimeout=i,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(t,e){this._isBuffering?(this._start=Math.min(this._start,t),this._end=Math.max(this._end,e)):(this._start=t,this._end=e,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let t={start:this._start,end:this._end};return this._isBuffering=!1,t}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function VA(t,e,i,n){let a=i.buffer.x,l=i.buffer.y;if(!i.buffer.hasScrollback)return GA(a,l,t,e,i,n)+hf(l,e,i,n)+KA(a,l,t,e,i,n);let u;if(l===e)return u=a>t?"D":"C",Au(Math.abs(a-t),Ru(u,n));u=l>e?"D":"C";let h=Math.abs(l-e),f=YA(l>e?t:a,i)+(h-1)*i.cols+1+qA(l>e?a:t);return Au(f,Ru(u,n))}function qA(t,e){return t-1}function YA(t,e){return e.cols-t}function GA(t,e,i,n,a,l){return hf(e,n,a,l).length===0?"":Au(TC(t,e,t,e-Fo(e,a),!1,a).length,Ru("D",l))}function hf(t,e,i,n){let a=t-Fo(t,i),l=e-Fo(e,i),u=Math.abs(a-l)-XA(t,e,i);return Au(u,Ru(EC(t,e),n))}function KA(t,e,i,n,a,l){let u;hf(e,n,a,l).length>0?u=n-Fo(n,a):u=e;let h=n,f=ZA(t,e,i,n,a,l);return Au(TC(t,u,i,h,f==="C",a).length,Ru(f,l))}function XA(t,e,i){let n=0,a=t-Fo(t,i),l=e-Fo(e,i);for(let u=0;u<Math.abs(a-l);u++){let h=EC(t,e)==="A"?-1:1;i.buffer.lines.get(a+h*u)?.isWrapped&&n++}return n}function Fo(t,e){let i=0,n=e.buffer.lines.get(t),a=n?.isWrapped;for(;a&&t>=0&&t<e.rows;)i++,n=e.buffer.lines.get(--t),a=n?.isWrapped;return i}function ZA(t,e,i,n,a,l){let u;return hf(i,n,a,l).length>0?u=n-Fo(n,a):u=e,t<i&&u<=n||t>=i&&u<n?"C":"D"}function EC(t,e){return t>e?"A":"B"}function TC(t,e,i,n,a,l){let u=t,h=e,f="";for(;(u!==i||h!==n)&&h>=0&&h<l.buffer.lines.length;)u+=a?1:-1,a&&u>l.cols-1?(f+=l.buffer.translateBufferLineToString(h,!1,t,u),u=0,t=0,h++):!a&&u<0&&(f+=l.buffer.translateBufferLineToString(h,!1,0,t+1),u=l.cols-1,t=u,h--);return f+l.buffer.translateBufferLineToString(h,!1,t,u)}function Ru(t,e){let i=e?"O":"[";return le.ESC+i+t}function Au(t,e){t=Math.floor(t);let i="";for(let n=0;n<t;n++)i+=e;return i}var QA=class{constructor(t){this._bufferService=t,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:!this.selectionEnd||!this.selectionStart?this.selectionStart:this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){let t=this.selectionStart[0]+this.selectionStartLength;return t>this._bufferService.cols?t%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)-1]:[t%this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)]:[t,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let t=this.selectionStart[0]+this.selectionStartLength;return t>this._bufferService.cols?[t%this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)]:[Math.max(t,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let t=this.selectionStart,e=this.selectionEnd;return!t||!e?!1:t[1]>e[1]||t[1]===e[1]&&t[0]>e[0]}handleTrim(t){return this.selectionStart&&(this.selectionStart[1]-=t),this.selectionEnd&&(this.selectionEnd[1]-=t),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function Ab(t,e){if(t.start.y>t.end.y)throw new Error(`Buffer range end (${t.end.x}, ${t.end.y}) cannot be before start (${t.start.x}, ${t.start.y})`);return e*(t.end.y-t.start.y)+(t.end.x-t.start.x+1)}var X_=50,JA=15,eM=50,tM=500,iM=" ",sM=new RegExp(iM,"g"),rg=class extends st{constructor(e,i,n,a,l,u,h,f,d){super(),this._element=e,this._screenElement=i,this._linkifier=n,this._bufferService=a,this._coreService=l,this._mouseService=u,this._optionsService=h,this._renderService=f,this._coreBrowserService=d,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Cr,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new ge),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new ge),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new ge),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new ge),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=p=>this._handleMouseMove(p),this._mouseUpListener=p=>this._handleMouseUp(p),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(p=>this._handleTrim(p)),this._register(this._bufferService.buffers.onBufferActivate(p=>this._handleBufferActivate(p))),this.enable(),this._model=new QA(this._bufferService),this._activeSelectionMode=0,this._register(Wt(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(p=>{p.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;return!e||!i?!1:e[0]!==i[0]||e[1]!==i[1]}get selectionText(){let e=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;if(!e||!i)return"";let n=this._bufferService.buffer,a=[];if(this._activeSelectionMode===3){if(e[0]===i[0])return"";let l=e[0]<i[0]?e[0]:i[0],u=e[0]<i[0]?i[0]:e[0];for(let h=e[1];h<=i[1];h++){let f=n.translateBufferLineToString(h,!0,l,u);a.push(f)}}else{let l=e[1]===i[1]?i[0]:void 0;a.push(n.translateBufferLineToString(e[1],!0,e[0],l));for(let u=e[1]+1;u<=i[1]-1;u++){let h=n.lines.get(u),f=n.translateBufferLineToString(u,!0);h?.isWrapped?a[a.length-1]+=f:a.push(f)}if(e[1]!==i[1]){let u=n.lines.get(i[1]),h=n.translateBufferLineToString(i[1],!0,0,i[0]);u&&u.isWrapped?a[a.length-1]+=h:a.push(h)}}return a.map(l=>l.replace(sM," ")).join(CC?`\r
|
|
20
|
+
`:`
|
|
21
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),Kg&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let i=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,a=this._model.finalSelectionEnd;return!n||!a||!i?!1:this._areCoordsInSelection(i,n,a)}isCellInSelection(e,i){let n=this._model.finalSelectionStart,a=this._model.finalSelectionEnd;return!n||!a?!1:this._areCoordsInSelection([e,i],n,a)}_areCoordsInSelection(e,i,n){return e[1]>i[1]&&e[1]<n[1]||i[1]===n[1]&&e[1]===i[1]&&e[0]>=i[0]&&e[0]<n[0]||i[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||i[1]<n[1]&&e[1]===i[1]&&e[0]>=i[0]}_selectWordAtCursor(e,i){let n=this._linkifier.currentLink?.link?.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=Ab(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let a=this._getMouseBufferCoords(e);return a?(this._selectWordAt(a,i),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,i){this._model.clearSelection(),e=Math.max(e,0),i=Math.min(i,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,i],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let i=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(i)return i[0]--,i[1]--,i[1]+=this._bufferService.buffer.ydisp,i}_getMouseEventScrollAmount(e){let i=Gg(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return i>=0&&i<=n?0:(i>n&&(i-=n),i=Math.min(Math.max(i,-X_),X_),i/=X_,i/Math.abs(i)+Math.round(i*(JA-1)))}shouldForceSelection(e){return Kd?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(),eM)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let i=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);i&&i.length!==this._model.selectionStart[0]&&i.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let i=this._getMouseBufferCoords(e);i&&(this._activeSelectionMode=2,this._selectLineAt(i[1]))}shouldColumnSelect(e){return e.altKey&&!(Kd&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let i=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let n=this._bufferService.buffer;if(this._model.selectionEnd[1]<n.lines.length){let a=n.lines.get(this._model.selectionEnd[1]);a&&a.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!i||i[0]!==this._model.selectionEnd[0]||i[1]!==this._model.selectionEnd[1])&&this.refresh(!0)}_dragScroll(){if(!(!this._model.selectionEnd||!this._model.selectionStart)&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let i=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&i<tM&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let n=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(n&&n[0]!==void 0&&n[1]!==void 0){let a=VA(n[0]-1,n[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(a,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,i=this._model.finalSelectionEnd,n=!!e&&!!i&&(e[0]!==i[0]||e[1]!==i[1]);if(!n){this._oldHasSelection&&this._fireOnSelectionChange(e,i,n);return}!e||!i||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||i[0]!==this._oldSelectionEnd[0]||i[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,i,n)}_fireOnSelectionChange(e,i,n){this._oldSelectionStart=e,this._oldSelectionEnd=i,this._oldHasSelection=n,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(i=>this._handleTrim(i))}_convertViewportColToCharacterIndex(e,i){let n=i;for(let a=0;i>=a;a++){let l=e.loadCell(a,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:l>1&&i!==a&&(n+=l-1)}return n}setSelection(e,i,n){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,i],this._model.selectionStartLength=n,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,i,n=!0,a=!0){if(e[0]>=this._bufferService.cols)return;let l=this._bufferService.buffer,u=l.lines.get(e[1]);if(!u)return;let h=l.translateBufferLineToString(e[1],!1),f=this._convertViewportColToCharacterIndex(u,e[0]),d=f,p=e[0]-f,v=0,g=0,S=0,b=0;if(h.charAt(f)===" "){for(;f>0&&h.charAt(f-1)===" ";)f--;for(;d<h.length&&h.charAt(d+1)===" ";)d++}else{let E=e[0],A=e[0];u.getWidth(E)===0&&(v++,E--),u.getWidth(A)===2&&(g++,A++);let B=u.getString(A).length;for(B>1&&(b+=B-1,d+=B-1);E>0&&f>0&&!this._isCharWordSeparator(u.loadCell(E-1,this._workCell));){u.loadCell(E-1,this._workCell);let R=this._workCell.getChars().length;this._workCell.getWidth()===0?(v++,E--):R>1&&(S+=R-1,f-=R-1),f--,E--}for(;A<u.length&&d+1<h.length&&!this._isCharWordSeparator(u.loadCell(A+1,this._workCell));){u.loadCell(A+1,this._workCell);let R=this._workCell.getChars().length;this._workCell.getWidth()===2?(g++,A++):R>1&&(b+=R-1,d+=R-1),d++,A++}}d++;let C=f+p-v+S,x=Math.min(this._bufferService.cols,d-f+v+g-S-b);if(!(!i&&h.slice(f,d).trim()==="")){if(n&&C===0&&u.getCodePoint(0)!==32){let E=l.lines.get(e[1]-1);if(E&&u.isWrapped&&E.getCodePoint(this._bufferService.cols-1)!==32){let A=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(A){let B=this._bufferService.cols-A.start;C-=B,x+=B}}}if(a&&C+x===this._bufferService.cols&&u.getCodePoint(this._bufferService.cols-1)!==32){let E=l.lines.get(e[1]+1);if(E?.isWrapped&&E.getCodePoint(0)!==32){let A=this._getWordAt([0,e[1]+1],!1,!1,!0);A&&(x+=A.length)}}return{start:C,length:x}}}_selectWordAt(e,i){let n=this._getWordAt(e,i);if(n){for(;n.start<0;)n.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[n.start,e[1]],this._model.selectionStartLength=n.length}}_selectToWordAt(e){let i=this._getWordAt(e,!0);if(i){let n=e[1];for(;i.start<0;)i.start+=this._bufferService.cols,n--;if(!this._model.areSelectionValuesReversed())for(;i.start+i.length>this._bufferService.cols;)i.length-=this._bufferService.cols,n++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?i.start:i.start+i.length,n]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let i=this._bufferService.buffer.getWrappedRangeForLine(e),n={start:{x:0,y:i.first},end:{x:this._bufferService.cols-1,y:i.last}};this._model.selectionStart=[0,i.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=Ab(n,this._bufferService.cols)}};rg=si([we(3,hs),we(4,Wo),we(5,Fg),we(6,ds),we(7,Gn),we(8,Yn)],rg);var Mb=class{constructor(){this._data={}}set(e,i,n){this._data[e]||(this._data[e]={}),this._data[e][i]=n}get(e,i){return this._data[e]?this._data[e][i]:void 0}clear(){this._data={}}},Lb=class{constructor(){this._color=new Mb,this._css=new Mb}setCss(e,i,n){this._css.set(e,i,n)}getCss(e,i){return this._css.get(e,i)}setColor(e,i,n){this._color.set(e,i,n)}getColor(e,i){return this._color.get(e,i)}clear(){this._color.clear(),this._css.clear()}},Ci=Object.freeze((()=>{let t=[Yt.toColor("#2e3436"),Yt.toColor("#cc0000"),Yt.toColor("#4e9a06"),Yt.toColor("#c4a000"),Yt.toColor("#3465a4"),Yt.toColor("#75507b"),Yt.toColor("#06989a"),Yt.toColor("#d3d7cf"),Yt.toColor("#555753"),Yt.toColor("#ef2929"),Yt.toColor("#8ae234"),Yt.toColor("#fce94f"),Yt.toColor("#729fcf"),Yt.toColor("#ad7fa8"),Yt.toColor("#34e2e2"),Yt.toColor("#eeeeec")],e=[0,95,135,175,215,255];for(let i=0;i<216;i++){let n=e[i/36%6|0],a=e[i/6%6|0],l=e[i%6];t.push({css:gi.toCss(n,a,l),rgba:gi.toRgba(n,a,l)})}for(let i=0;i<24;i++){let n=8+i*10;t.push({css:gi.toCss(n,n,n),rgba:gi.toRgba(n,n,n)})}return t})()),Eo=Yt.toColor("#ffffff"),pu=Yt.toColor("#000000"),Db=Yt.toColor("#ffffff"),Ob=pu,ru={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},rM=Eo,ng=class extends st{constructor(e){super(),this._optionsService=e,this._contrastCache=new Lb,this._halfContrastCache=new Lb,this._onChangeColors=this._register(new ge),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:Eo,background:pu,cursor:Db,cursorAccent:Ob,selectionForeground:void 0,selectionBackgroundTransparent:ru,selectionBackgroundOpaque:Ht.blend(pu,ru),selectionInactiveBackgroundTransparent:ru,selectionInactiveBackgroundOpaque:Ht.blend(pu,ru),scrollbarSliderBackground:Ht.opacity(Eo,.2),scrollbarSliderHoverBackground:Ht.opacity(Eo,.4),scrollbarSliderActiveBackground:Ht.opacity(Eo,.5),overviewRulerBorder:Eo,ansi:Ci.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this._register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(e={}){let i=this._colors;if(i.foreground=At(e.foreground,Eo),i.background=At(e.background,pu),i.cursor=Ht.blend(i.background,At(e.cursor,Db)),i.cursorAccent=Ht.blend(i.background,At(e.cursorAccent,Ob)),i.selectionBackgroundTransparent=At(e.selectionBackground,ru),i.selectionBackgroundOpaque=Ht.blend(i.background,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundTransparent=At(e.selectionInactiveBackground,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundOpaque=Ht.blend(i.background,i.selectionInactiveBackgroundTransparent),i.selectionForeground=e.selectionForeground?At(e.selectionForeground,Eb):void 0,i.selectionForeground===Eb&&(i.selectionForeground=void 0),Ht.isOpaque(i.selectionBackgroundTransparent)&&(i.selectionBackgroundTransparent=Ht.opacity(i.selectionBackgroundTransparent,.3)),Ht.isOpaque(i.selectionInactiveBackgroundTransparent)&&(i.selectionInactiveBackgroundTransparent=Ht.opacity(i.selectionInactiveBackgroundTransparent,.3)),i.scrollbarSliderBackground=At(e.scrollbarSliderBackground,Ht.opacity(i.foreground,.2)),i.scrollbarSliderHoverBackground=At(e.scrollbarSliderHoverBackground,Ht.opacity(i.foreground,.4)),i.scrollbarSliderActiveBackground=At(e.scrollbarSliderActiveBackground,Ht.opacity(i.foreground,.5)),i.overviewRulerBorder=At(e.overviewRulerBorder,rM),i.ansi=Ci.slice(),i.ansi[0]=At(e.black,Ci[0]),i.ansi[1]=At(e.red,Ci[1]),i.ansi[2]=At(e.green,Ci[2]),i.ansi[3]=At(e.yellow,Ci[3]),i.ansi[4]=At(e.blue,Ci[4]),i.ansi[5]=At(e.magenta,Ci[5]),i.ansi[6]=At(e.cyan,Ci[6]),i.ansi[7]=At(e.white,Ci[7]),i.ansi[8]=At(e.brightBlack,Ci[8]),i.ansi[9]=At(e.brightRed,Ci[9]),i.ansi[10]=At(e.brightGreen,Ci[10]),i.ansi[11]=At(e.brightYellow,Ci[11]),i.ansi[12]=At(e.brightBlue,Ci[12]),i.ansi[13]=At(e.brightMagenta,Ci[13]),i.ansi[14]=At(e.brightCyan,Ci[14]),i.ansi[15]=At(e.brightWhite,Ci[15]),e.extendedAnsi){let n=Math.min(i.ansi.length-16,e.extendedAnsi.length);for(let a=0;a<n;a++)i.ansi[a+16]=At(e.extendedAnsi[a],Ci[a+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e===void 0){for(let i=0;i<this._restoreColors.ansi.length;++i)this._colors.ansi[i]=this._restoreColors.ansi[i];return}switch(e){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};ng=si([we(0,ds)],ng);function At(t,e){if(t!==void 0)try{return Yt.toColor(t)}catch{}return e}var nM=class{constructor(...e){this._entries=new Map;for(let[i,n]of e)this.set(i,n)}set(e,i){let n=this._entries.get(e);return this._entries.set(e,i),n}forEach(e){for(let[i,n]of this._entries.entries())e(i,n)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},aM=class{constructor(){this._services=new nM,this._services.set(Ug,this)}setService(t,e){this._services.set(t,e)}getService(t){return this._services.get(t)}createInstance(t,...e){let i=JT(t).sort((l,u)=>l.index-u.index),n=[];for(let l of i){let u=this._services.get(l.id);if(!u)throw new Error(`[createInstance] ${t.name} depends on UNKNOWN service ${l.id._id}.`);n.push(u)}let a=i.length>0?i[0].index:e.length;if(e.length!==a)throw new Error(`[createInstance] First service dependency of ${t.name} at position ${a+1} conflicts with ${e.length} static arguments`);return new t(...e,...n)}},oM={trace:0,debug:1,info:2,warn:3,error:4,off:5},lM="xterm.js: ",ag=class extends st{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=oM[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let i=0;i<e.length;i++)typeof e[i]=="function"&&(e[i]=e[i]())}_log(e,i,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?"":lM)+i,...n)}trace(e,...i){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,i)}debug(e,...i){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,i)}info(e,...i){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,i)}warn(e,...i){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,i)}error(e,...i){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,i)}};ag=si([we(0,ds)],ag);var Bb=class extends st{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new ge),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new ge),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new ge),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let i=new Array(e);for(let n=0;n<Math.min(e,this.length);n++)i[n]=this._array[this._getCyclicIndex(n)];this._array=i,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let i=this._length;i<e;i++)this._array[i]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,i){this._array[this._getCyclicIndex(e)]=i}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,i,...n){if(i){for(let a=e;a<this._length-i;a++)this._array[this._getCyclicIndex(a)]=this._array[this._getCyclicIndex(a+i)];this._length-=i,this.onDeleteEmitter.fire({index:e,amount:i})}for(let a=this._length-1;a>=e;a--)this._array[this._getCyclicIndex(a+n.length)]=this._array[this._getCyclicIndex(a)];for(let a=0;a<n.length;a++)this._array[this._getCyclicIndex(e+a)]=n[a];if(n.length&&this.onInsertEmitter.fire({index:e,amount:n.length}),this._length+n.length>this._maxLength){let a=this._length+n.length-this._maxLength;this._startIndex+=a,this._length=this._maxLength,this.onTrimEmitter.fire(a)}else this._length+=n.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,i,n){if(!(i<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+n<0)throw new Error("Cannot shift elements in list beyond index 0");if(n>0){for(let l=i-1;l>=0;l--)this.set(e+l+n,this.get(e+l));let a=e+i+n-this._length;if(a>0)for(this._length+=a;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let a=0;a<i;a++)this.set(e+a+n,this.get(e+a))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},tt=3,_i=Object.freeze(new Bu),ld=0,Z_=2,gu=class RC{constructor(e,i,n=!1){this.isWrapped=n,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(e*tt);let a=i||Cr.fromCharData([0,Yw,1,0]);for(let l=0;l<e;++l)this.setCell(l,a);this.length=e}get(e){let i=this._data[e*tt+0],n=i&2097151;return[this._data[e*tt+1],i&2097152?this._combined[e]:n?Ia(n):"",i>>22,i&2097152?this._combined[e].charCodeAt(this._combined[e].length-1):n]}set(e,i){this._data[e*tt+1]=i[0],i[1].length>1?(this._combined[e]=i[1],this._data[e*tt+0]=e|2097152|i[2]<<22):this._data[e*tt+0]=i[1].charCodeAt(0)|i[2]<<22}getWidth(e){return this._data[e*tt+0]>>22}hasWidth(e){return this._data[e*tt+0]&12582912}getFg(e){return this._data[e*tt+1]}getBg(e){return this._data[e*tt+2]}hasContent(e){return this._data[e*tt+0]&4194303}getCodePoint(e){let i=this._data[e*tt+0];return i&2097152?this._combined[e].charCodeAt(this._combined[e].length-1):i&2097151}isCombined(e){return this._data[e*tt+0]&2097152}getString(e){let i=this._data[e*tt+0];return i&2097152?this._combined[e]:i&2097151?Ia(i&2097151):""}isProtected(e){return this._data[e*tt+2]&536870912}loadCell(e,i){return ld=e*tt,i.content=this._data[ld+0],i.fg=this._data[ld+1],i.bg=this._data[ld+2],i.content&2097152&&(i.combinedData=this._combined[e]),i.bg&268435456&&(i.extended=this._extendedAttrs[e]),i}setCell(e,i){i.content&2097152&&(this._combined[e]=i.combinedData),i.bg&268435456&&(this._extendedAttrs[e]=i.extended),this._data[e*tt+0]=i.content,this._data[e*tt+1]=i.fg,this._data[e*tt+2]=i.bg}setCellFromCodepoint(e,i,n,a){a.bg&268435456&&(this._extendedAttrs[e]=a.extended),this._data[e*tt+0]=i|n<<22,this._data[e*tt+1]=a.fg,this._data[e*tt+2]=a.bg}addCodepointToCell(e,i,n){let a=this._data[e*tt+0];a&2097152?this._combined[e]+=Ia(i):a&2097151?(this._combined[e]=Ia(a&2097151)+Ia(i),a&=-2097152,a|=2097152):a=i|1<<22,n&&(a&=-12582913,a|=n<<22),this._data[e*tt+0]=a}insertCells(e,i,n){if(e%=this.length,e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),i<this.length-e){let a=new Cr;for(let l=this.length-e-i-1;l>=0;--l)this.setCell(e+i+l,this.loadCell(e+l,a));for(let l=0;l<i;++l)this.setCell(e+l,n)}else for(let a=e;a<this.length;++a)this.setCell(a,n);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,n)}deleteCells(e,i,n){if(e%=this.length,i<this.length-e){let a=new Cr;for(let l=0;l<this.length-e-i;++l)this.setCell(e+l,this.loadCell(e+i+l,a));for(let l=this.length-i;l<this.length;++l)this.setCell(l,n)}else for(let a=e;a<this.length;++a)this.setCell(a,n);e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),this.getWidth(e)===0&&!this.hasContent(e)&&this.setCellFromCodepoint(e,0,1,n)}replaceCells(e,i,n,a=!1){if(a){for(e&&this.getWidth(e-1)===2&&!this.isProtected(e-1)&&this.setCellFromCodepoint(e-1,0,1,n),i<this.length&&this.getWidth(i-1)===2&&!this.isProtected(i)&&this.setCellFromCodepoint(i,0,1,n);e<i&&e<this.length;)this.isProtected(e)||this.setCell(e,n),e++;return}for(e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),i<this.length&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i,0,1,n);e<i&&e<this.length;)this.setCell(e++,n)}resize(e,i){if(e===this.length)return this._data.length*4*Z_<this._data.buffer.byteLength;let n=e*tt;if(e>this.length){if(this._data.buffer.byteLength>=n*4)this._data=new Uint32Array(this._data.buffer,0,n);else{let a=new Uint32Array(n);a.set(this._data),this._data=a}for(let a=this.length;a<e;++a)this.setCell(a,i)}else{this._data=this._data.subarray(0,n);let a=Object.keys(this._combined);for(let u=0;u<a.length;u++){let h=parseInt(a[u],10);h>=e&&delete this._combined[h]}let l=Object.keys(this._extendedAttrs);for(let u=0;u<l.length;u++){let h=parseInt(l[u],10);h>=e&&delete this._extendedAttrs[h]}}return this.length=e,n*4*Z_<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*Z_<this._data.buffer.byteLength){let e=new Uint32Array(this._data.length);return e.set(this._data),this._data=e,1}return 0}fill(e,i=!1){if(i){for(let n=0;n<this.length;++n)this.isProtected(n)||this.setCell(n,e);return}this._combined={},this._extendedAttrs={};for(let n=0;n<this.length;++n)this.setCell(n,e)}copyFrom(e){this.length!==e.length?this._data=new Uint32Array(e._data):this._data.set(e._data),this.length=e.length,this._combined={};for(let i in e._combined)this._combined[i]=e._combined[i];this._extendedAttrs={};for(let i in e._extendedAttrs)this._extendedAttrs[i]=e._extendedAttrs[i];this.isWrapped=e.isWrapped}clone(){let e=new RC(0);e._data=new Uint32Array(this._data),e.length=this.length;for(let i in this._combined)e._combined[i]=this._combined[i];for(let i in this._extendedAttrs)e._extendedAttrs[i]=this._extendedAttrs[i];return e.isWrapped=this.isWrapped,e}getTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(this._data[e*tt+0]&4194303)return e+(this._data[e*tt+0]>>22);return 0}getNoBgTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(this._data[e*tt+0]&4194303||this._data[e*tt+2]&50331648)return e+(this._data[e*tt+0]>>22);return 0}copyCellsFrom(e,i,n,a,l){let u=e._data;if(l)for(let f=a-1;f>=0;f--){for(let d=0;d<tt;d++)this._data[(n+f)*tt+d]=u[(i+f)*tt+d];u[(i+f)*tt+2]&268435456&&(this._extendedAttrs[n+f]=e._extendedAttrs[i+f])}else for(let f=0;f<a;f++){for(let d=0;d<tt;d++)this._data[(n+f)*tt+d]=u[(i+f)*tt+d];u[(i+f)*tt+2]&268435456&&(this._extendedAttrs[n+f]=e._extendedAttrs[i+f])}let h=Object.keys(e._combined);for(let f=0;f<h.length;f++){let d=parseInt(h[f],10);d>=i&&(this._combined[d-i+n]=e._combined[d])}}translateToString(e,i,n,a){i=i??0,n=n??this.length,e&&(n=Math.min(n,this.getTrimmedLength())),a&&(a.length=0);let l="";for(;i<n;){let u=this._data[i*tt+0],h=u&2097151,f=u&2097152?this._combined[i]:h?Ia(h):$a;if(l+=f,a)for(let d=0;d<f.length;++d)a.push(i);i+=u>>22||1}return a&&a.push(i),l}};function cM(t,e,i,n,a,l){let u=[];for(let h=0;h<t.length-1;h++){let f=h,d=t.get(++f);if(!d.isWrapped)continue;let p=[t.get(h)];for(;f<t.length&&d.isWrapped;)p.push(d),d=t.get(++f);if(!l&&n>=h&&n<f){h+=p.length-1;continue}let v=0,g=Mu(p,v,e),S=1,b=0;for(;S<p.length;){let x=Mu(p,S,e),E=x-b,A=i-g,B=Math.min(E,A);p[v].copyCellsFrom(p[S],b,g,B,!1),g+=B,g===i&&(v++,g=0),b+=B,b===x&&(S++,b=0),g===0&&v!==0&&p[v-1].getWidth(i-1)===2&&(p[v].copyCellsFrom(p[v-1],i-1,g++,1,!1),p[v-1].setCell(i-1,a))}p[v].replaceCells(g,i,a);let C=0;for(let x=p.length-1;x>0&&(x>v||p[x].getTrimmedLength()===0);x--)C++;C>0&&(u.push(h+p.length-C),u.push(C)),h+=p.length-1}return u}function uM(t,e){let i=[],n=0,a=e[n],l=0;for(let u=0;u<t.length;u++)if(a===u){let h=e[++n];t.onDeleteEmitter.fire({index:u-l,amount:h}),u+=h-1,l+=h,a=e[++n]}else i.push(u);return{layout:i,countRemoved:l}}function hM(t,e){let i=[];for(let n=0;n<e.length;n++)i.push(t.get(e[n]));for(let n=0;n<i.length;n++)t.set(n,i[n]);t.length=e.length}function dM(t,e,i){let n=[],a=t.map((f,d)=>Mu(t,d,e)).reduce((f,d)=>f+d),l=0,u=0,h=0;for(;h<a;){if(a-h<i){n.push(a-h);break}l+=i;let f=Mu(t,u,e);l>f&&(l-=f,u++);let d=t[u].getWidth(l-1)===2;d&&l--;let p=d?i-1:i;n.push(p),h+=p}return n}function Mu(t,e,i){if(e===t.length-1)return t[e].getTrimmedLength();let n=!t[e].hasContent(i-1)&&t[e].getWidth(i-1)===1,a=t[e+1].getWidth(0)===2;return n&&a?i-1:i}var AC=class MC{constructor(e){this.line=e,this.isDisposed=!1,this._disposables=[],this._id=MC._nextId++,this._onDispose=this.register(new ge),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),Uo(this._disposables),this._disposables.length=0)}register(e){return this._disposables.push(e),e}};AC._nextId=1;var fM=AC,ki={},To=ki.B;ki[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"};ki.A={"#":"£"};ki.B=void 0;ki[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};ki.C=ki[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};ki.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};ki.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};ki.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};ki.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};ki.E=ki[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};ki.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};ki.H=ki[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};ki["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var Nb=4294967295,Pb=class{constructor(t,e,i){this._hasScrollback=t,this._optionsService=e,this._bufferService=i,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=_i.clone(),this.savedCharset=To,this.markers=[],this._nullCell=Cr.fromCharData([0,Yw,1,0]),this._whitespaceCell=Cr.fromCharData([0,$a,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new Xd,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new Bb(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(t){return t?(this._nullCell.fg=t.fg,this._nullCell.bg=t.bg,this._nullCell.extended=t.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new qd),this._nullCell}getWhitespaceCell(t){return t?(this._whitespaceCell.fg=t.fg,this._whitespaceCell.bg=t.bg,this._whitespaceCell.extended=t.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new qd),this._whitespaceCell}getBlankLine(t,e){return new gu(this._bufferService.cols,this.getNullCell(t),e)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let t=this.ybase+this.y-this.ydisp;return t>=0&&t<this._rows}_getCorrectBufferLength(t){if(!this._hasScrollback)return t;let e=t+this._optionsService.rawOptions.scrollback;return e>Nb?Nb:e}fillViewportRows(t){if(this.lines.length===0){t===void 0&&(t=_i);let e=this._rows;for(;e--;)this.lines.push(this.getBlankLine(t))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new Bb(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(t,e){let i=this.getNullCell(_i),n=0,a=this._getCorrectBufferLength(e);if(a>this.lines.maxLength&&(this.lines.maxLength=a),this.lines.length>0){if(this._cols<t)for(let u=0;u<this.lines.length;u++)n+=+this.lines.get(u).resize(t,i);let l=0;if(this._rows<e)for(let u=this._rows;u<e;u++)this.lines.length<e+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new gu(t,i)):this.ybase>0&&this.lines.length<=this.ybase+this.y+l+1?(this.ybase--,l++,this.ydisp>0&&this.ydisp--):this.lines.push(new gu(t,i)));else for(let u=this._rows;u>e;u--)this.lines.length>e+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(a<this.lines.maxLength){let u=this.lines.length-a;u>0&&(this.lines.trimStart(u),this.ybase=Math.max(this.ybase-u,0),this.ydisp=Math.max(this.ydisp-u,0),this.savedY=Math.max(this.savedY-u,0)),this.lines.maxLength=a}this.x=Math.min(this.x,t-1),this.y=Math.min(this.y,e-1),l&&(this.y+=l),this.savedX=Math.min(this.savedX,t-1),this.scrollTop=0}if(this.scrollBottom=e-1,this._isReflowEnabled&&(this._reflow(t,e),this._cols>t))for(let l=0;l<this.lines.length;l++)n+=+this.lines.get(l).resize(t,i);this._cols=t,this._rows=e,this._memoryCleanupQueue.clear(),n>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let t=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,t=!1);let e=0;for(;this._memoryCleanupPosition<this.lines.length;)if(e+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),e>100)return!0;return t}get _isReflowEnabled(){let t=this._optionsService.rawOptions.windowsPty;return t&&t.buildNumber?this._hasScrollback&&t.backend==="conpty"&&t.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(t,e){this._cols!==t&&(t>this._cols?this._reflowLarger(t,e):this._reflowSmaller(t,e))}_reflowLarger(t,e){let i=this._optionsService.rawOptions.reflowCursorLine,n=cM(this.lines,this._cols,t,this.ybase+this.y,this.getNullCell(_i),i);if(n.length>0){let a=uM(this.lines,n);hM(this.lines,a.layout),this._reflowLargerAdjustViewport(t,e,a.countRemoved)}}_reflowLargerAdjustViewport(t,e,i){let n=this.getNullCell(_i),a=i;for(;a-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<e&&this.lines.push(new gu(t,n))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-i,0)}_reflowSmaller(t,e){let i=this._optionsService.rawOptions.reflowCursorLine,n=this.getNullCell(_i),a=[],l=0;for(let u=this.lines.length-1;u>=0;u--){let h=this.lines.get(u);if(!h||!h.isWrapped&&h.getTrimmedLength()<=t)continue;let f=[h];for(;h.isWrapped&&u>0;)h=this.lines.get(--u),f.unshift(h);if(!i){let B=this.ybase+this.y;if(B>=u&&B<u+f.length)continue}let d=f[f.length-1].getTrimmedLength(),p=dM(f,this._cols,t),v=p.length-f.length,g;this.ybase===0&&this.y!==this.lines.length-1?g=Math.max(0,this.y-this.lines.maxLength+v):g=Math.max(0,this.lines.length-this.lines.maxLength+v);let S=[];for(let B=0;B<v;B++){let R=this.getBlankLine(_i,!0);S.push(R)}S.length>0&&(a.push({start:u+f.length+l,newLines:S}),l+=S.length),f.push(...S);let b=p.length-1,C=p[b];C===0&&(b--,C=p[b]);let x=f.length-v-1,E=d;for(;x>=0;){let B=Math.min(E,C);if(f[b]===void 0)break;if(f[b].copyCellsFrom(f[x],E-B,C-B,B,!0),C-=B,C===0&&(b--,C=p[b]),E-=B,E===0){x--;let R=Math.max(x,0);E=Mu(f,R,this._cols)}}for(let B=0;B<f.length;B++)p[B]<t&&f[B].setCell(p[B],n);let A=v-g;for(;A-- >0;)this.ybase===0?this.y<e-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+l)-e&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+v,this.ybase+e-1)}if(a.length>0){let u=[],h=[];for(let C=0;C<this.lines.length;C++)h.push(this.lines.get(C));let f=this.lines.length,d=f-1,p=0,v=a[p];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+l);let g=0;for(let C=Math.min(this.lines.maxLength-1,f+l-1);C>=0;C--)if(v&&v.start>d+g){for(let x=v.newLines.length-1;x>=0;x--)this.lines.set(C--,v.newLines[x]);C++,u.push({index:d+1,amount:v.newLines.length}),g+=v.newLines.length,v=a[++p]}else this.lines.set(C,h[d--]);let S=0;for(let C=u.length-1;C>=0;C--)u[C].index+=S,this.lines.onInsertEmitter.fire(u[C]),S+=u[C].amount;let b=Math.max(0,f+l-this.lines.maxLength);b>0&&this.lines.onTrimEmitter.fire(b)}}translateBufferLineToString(t,e,i=0,n){let a=this.lines.get(t);return a?a.translateToString(e,i,n):""}getWrappedRangeForLine(t){let e=t,i=t;for(;e>0&&this.lines.get(e).isWrapped;)e--;for(;i+1<this.lines.length&&this.lines.get(i+1).isWrapped;)i++;return{first:e,last:i}}setupTabStops(t){for(t!=null?this.tabs[t]||(t=this.prevStop(t)):(this.tabs={},t=0);t<this._cols;t+=this._optionsService.rawOptions.tabStopWidth)this.tabs[t]=!0}prevStop(t){for(t==null&&(t=this.x);!this.tabs[--t]&&t>0;);return t>=this._cols?this._cols-1:t<0?0:t}nextStop(t){for(t==null&&(t=this.x);!this.tabs[++t]&&t<this._cols;);return t>=this._cols?this._cols-1:t<0?0:t}clearMarkers(t){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].line===t&&(this.markers[e].dispose(),this.markers.splice(e--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].dispose();this.markers.length=0,this._isClearing=!1}addMarker(t){let e=new fM(t);return this.markers.push(e),e.register(this.lines.onTrim(i=>{e.line-=i,e.line<0&&e.dispose()})),e.register(this.lines.onInsert(i=>{e.line>=i.index&&(e.line+=i.amount)})),e.register(this.lines.onDelete(i=>{e.line>=i.index&&e.line<i.index+i.amount&&e.dispose(),e.line>i.index&&(e.line-=i.amount)})),e.register(e.onDispose(()=>this._removeMarker(e))),e}_removeMarker(t){this._isClearing||this.markers.splice(this.markers.indexOf(t),1)}},mM=class extends st{constructor(e,i){super(),this._optionsService=e,this._bufferService=i,this._onBufferActivate=this._register(new ge),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 Pb(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new Pb(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,i){this._normal.resize(e,i),this._alt.resize(e,i),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},LC=2,DC=1,og=class extends st{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new ge),this.onResize=this._onResize.event,this._onScroll=this._register(new ge),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,LC),this.rows=Math.max(e.rawOptions.rows||0,DC),this.buffers=this._register(new mM(e,this)),this._register(this.buffers.onBufferActivate(i=>{this._onScroll.fire(i.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,i){let n=this.cols!==e,a=this.rows!==i;this.cols=e,this.rows=i,this.buffers.resize(e,i),this._onResize.fire({cols:e,rows:i,colsChanged:n,rowsChanged:a})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,i=!1){let n=this.buffer,a;a=this._cachedBlankLine,(!a||a.length!==this.cols||a.getFg(0)!==e.fg||a.getBg(0)!==e.bg)&&(a=n.getBlankLine(e,i),this._cachedBlankLine=a),a.isWrapped=i;let l=n.ybase+n.scrollTop,u=n.ybase+n.scrollBottom;if(n.scrollTop===0){let h=n.lines.isFull;u===n.lines.length-1?h?n.lines.recycle().copyFrom(a):n.lines.push(a.clone()):n.lines.splice(u+1,0,a.clone()),h?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{let h=u-l+1;n.lines.shiftElements(l+1,h-1,-1),n.lines.set(u,a.clone())}this.isUserScrolling||(n.ydisp=n.ybase),this._onScroll.fire(n.ydisp)}scrollLines(e,i){let n=this.buffer;if(e<0){if(n.ydisp===0)return;this.isUserScrolling=!0}else e+n.ydisp>=n.ybase&&(this.isUserScrolling=!1);let a=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+e,n.ybase),0),a!==n.ydisp&&(i||this._onScroll.fire(n.ydisp))}};og=si([we(0,ds)],og);var Dl={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:Kd,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},_M=["normal","bold","100","200","300","400","500","600","700","800","900"],pM=class extends st{constructor(e){super(),this._onOptionChange=this._register(new ge),this.onOptionChange=this._onOptionChange.event;let i={...Dl};for(let n in e)if(n in i)try{let a=e[n];i[n]=this._sanitizeAndValidateOption(n,a)}catch(a){console.error(a)}this.rawOptions=i,this.options={...i},this._setupOptions(),this._register(Wt(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,i){return this.onOptionChange(n=>{n===e&&i(this.rawOptions[e])})}onMultipleOptionChange(e,i){return this.onOptionChange(n=>{e.indexOf(n)!==-1&&i()})}_setupOptions(){let e=n=>{if(!(n in Dl))throw new Error(`No option with key "${n}"`);return this.rawOptions[n]},i=(n,a)=>{if(!(n in Dl))throw new Error(`No option with key "${n}"`);a=this._sanitizeAndValidateOption(n,a),this.rawOptions[n]!==a&&(this.rawOptions[n]=a,this._onOptionChange.fire(n))};for(let n in this.rawOptions){let a={get:e.bind(this,n),set:i.bind(this,n)};Object.defineProperty(this.options,n,a)}}_sanitizeAndValidateOption(e,i){switch(e){case"cursorStyle":if(i||(i=Dl[e]),!gM(i))throw new Error(`"${i}" is not a valid value for ${e}`);break;case"wordSeparator":i||(i=Dl[e]);break;case"fontWeight":case"fontWeightBold":if(typeof i=="number"&&1<=i&&i<=1e3)break;i=_M.includes(i)?i:Dl[e];break;case"cursorWidth":i=Math.floor(i);case"lineHeight":case"tabStopWidth":if(i<1)throw new Error(`${e} cannot be less than 1, value: ${i}`);break;case"minimumContrastRatio":i=Math.max(1,Math.min(21,Math.round(i*10)/10));break;case"scrollback":if(i=Math.min(i,4294967295),i<0)throw new Error(`${e} cannot be less than 0, value: ${i}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(i<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${i}`);break;case"rows":case"cols":if(!i&&i!==0)throw new Error(`${e} must be numeric, value: ${i}`);break;case"windowsPty":i=i??{};break}return i}};function gM(t){return t==="block"||t==="underline"||t==="bar"}function vu(t,e=5){if(typeof t!="object")return t;let i=Array.isArray(t)?[]:{};for(let n in t)i[n]=e<=1?t[n]:t[n]&&vu(t[n],e-1);return i}var zb=Object.freeze({insertMode:!1}),Hb=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),lg=class extends st{constructor(e,i,n){super(),this._bufferService=e,this._logService=i,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new ge),this.onData=this._onData.event,this._onUserInput=this._register(new ge),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new ge),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new ge),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=vu(zb),this.decPrivateModes=vu(Hb)}reset(){this.modes=vu(zb),this.decPrivateModes=vu(Hb)}triggerDataEvent(e,i=!1){if(this._optionsService.rawOptions.disableStdin)return;let n=this._bufferService.buffer;i&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),i&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(a=>a.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(i=>i.charCodeAt(0))),this._onBinary.fire(e))}};lg=si([we(0,hs),we(1,Qw),we(2,ds)],lg);var Ib={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:t=>t.button===4||t.action!==1?!1:(t.ctrl=!1,t.alt=!1,t.shift=!1,!0)},VT200:{events:19,restrict:t=>t.action!==32},DRAG:{events:23,restrict:t=>!(t.action===32&&t.button===3)},ANY:{events:31,restrict:t=>!0}};function Q_(t,e){let i=(t.ctrl?16:0)|(t.shift?4:0)|(t.alt?8:0);return t.button===4?(i|=64,i|=t.action):(i|=t.button&3,t.button&4&&(i|=64),t.button&8&&(i|=128),t.action===32?i|=32:t.action===0&&!e&&(i|=3)),i}var J_=String.fromCharCode,Ub={DEFAULT:t=>{let e=[Q_(t,!1)+32,t.col+32,t.row+32];return e[0]>255||e[1]>255||e[2]>255?"":`\x1B[M${J_(e[0])}${J_(e[1])}${J_(e[2])}`},SGR:t=>{let e=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${Q_(t,!0)};${t.col};${t.row}${e}`},SGR_PIXELS:t=>{let e=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${Q_(t,!0)};${t.x};${t.y}${e}`}},cg=class extends st{constructor(t,e,i){super(),this._bufferService=t,this._coreService=e,this._optionsService=i,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new ge),this.onProtocolChange=this._onProtocolChange.event;for(let n of Object.keys(Ib))this.addProtocol(n,Ib[n]);for(let n of Object.keys(Ub))this.addEncoding(n,Ub[n]);this.reset()}addProtocol(t,e){this._protocols[t]=e}addEncoding(t,e){this._encodings[t]=e}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(t){if(!this._protocols[t])throw new Error(`unknown protocol "${t}"`);this._activeProtocol=t,this._onProtocolChange.fire(this._protocols[t].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(t){if(!this._encodings[t])throw new Error(`unknown encoding "${t}"`);this._activeEncoding=t}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(t,e,i){if(t.deltaY===0||t.shiftKey||e===void 0||i===void 0)return 0;let n=e/i,a=this._applyScrollModifier(t.deltaY,t);return t.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(a/=n+0,Math.abs(t.deltaY)<50&&(a*=.3),this._wheelPartialScroll+=a,a=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):t.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(a*=this._bufferService.rows),a}_applyScrollModifier(t,e){return e.altKey||e.ctrlKey||e.shiftKey?t*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:t*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(t){if(t.col<0||t.col>=this._bufferService.cols||t.row<0||t.row>=this._bufferService.rows||t.button===4&&t.action===32||t.button===3&&t.action!==32||t.button!==4&&(t.action===2||t.action===3)||(t.col++,t.row++,t.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,t,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(t))return!1;let e=this._encodings[this._activeEncoding](t);return e&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(e):this._coreService.triggerDataEvent(e,!0)),this._lastEvent=t,!0}explainEvents(t){return{down:!!(t&1),up:!!(t&2),drag:!!(t&4),move:!!(t&8),wheel:!!(t&16)}}_equalEvents(t,e,i){if(i){if(t.x!==e.x||t.y!==e.y)return!1}else if(t.col!==e.col||t.row!==e.row)return!1;return!(t.button!==e.button||t.action!==e.action||t.ctrl!==e.ctrl||t.alt!==e.alt||t.shift!==e.shift)}};cg=si([we(0,hs),we(1,Wo),we(2,ds)],cg);var ep=[[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]],vM=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],xi;function SM(t,e){let i=0,n=e.length-1,a;if(t<e[0][0]||t>e[n][1])return!1;for(;n>=i;)if(a=i+n>>1,t>e[a][1])i=a+1;else if(t<e[a][0])n=a-1;else return!0;return!1}var yM=class{constructor(){if(this.version="6",!xi){xi=new Uint8Array(65536),xi.fill(1),xi[0]=0,xi.fill(0,1,32),xi.fill(0,127,160),xi.fill(2,4352,4448),xi[9001]=2,xi[9002]=2,xi.fill(2,11904,42192),xi[12351]=1,xi.fill(2,44032,55204),xi.fill(2,63744,64256),xi.fill(2,65040,65050),xi.fill(2,65072,65136),xi.fill(2,65280,65377),xi.fill(2,65504,65511);for(let e=0;e<ep.length;++e)xi.fill(0,ep[e][0],ep[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?xi[e]:SM(e,vM)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,i){let n=this.wcwidth(e),a=n===0&&i!==0;if(a){let l=Ao.extractWidth(i);l===0?a=!1:l>n&&(n=l)}return Ao.createPropertyValue(0,n,a)}},Ao=class Ed{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new ge,this.onChange=this._onChange.event;let e=new yM;this.register(e),this._active=e.version,this._activeProvider=e}static extractShouldJoin(e){return(e&1)!==0}static extractWidth(e){return e>>1&3}static extractCharKind(e){return e>>3}static createPropertyValue(e,i,n=!1){return(e&16777215)<<3|(i&3)<<1|(n?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw new Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(e){let i=0,n=0,a=e.length;for(let l=0;l<a;++l){let u=e.charCodeAt(l);if(55296<=u&&u<=56319){if(++l>=a)return i+this.wcwidth(u);let d=e.charCodeAt(l);56320<=d&&d<=57343?u=(u-55296)*1024+d-56320+65536:i+=this.wcwidth(d)}let h=this.charProperties(u,n),f=Ed.extractWidth(h);Ed.extractShouldJoin(h)&&(f-=Ed.extractWidth(n)),i+=f,n=h}return i}charProperties(e,i){return this._activeProvider.charProperties(e,i)}},bM=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,i){this._charsets[e]=i,this.glevel===e&&(this.charset=i)}};function Fb(t){let e=t.buffer.lines.get(t.buffer.ybase+t.buffer.y-1)?.get(t.cols-1),i=t.buffer.lines.get(t.buffer.ybase+t.buffer.y);i&&e&&(i.isWrapped=e[3]!==0&&e[3]!==32)}var nu=2147483647,wM=256,OC=class ug{constructor(e=32,i=32){if(this.maxLength=e,this.maxSubParamsLength=i,i>wM)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(i),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(e){let i=new ug;if(!e.length)return i;for(let n=Array.isArray(e[0])?1:0;n<e.length;++n){let a=e[n];if(Array.isArray(a))for(let l=0;l<a.length;++l)i.addSubParam(a[l]);else i.addParam(a)}return i}clone(){let e=new ug(this.maxLength,this.maxSubParamsLength);return e.params.set(this.params),e.length=this.length,e._subParams.set(this._subParams),e._subParamsLength=this._subParamsLength,e._subParamsIdx.set(this._subParamsIdx),e._rejectDigits=this._rejectDigits,e._rejectSubDigits=this._rejectSubDigits,e._digitIsSub=this._digitIsSub,e}toArray(){let e=[];for(let i=0;i<this.length;++i){e.push(this.params[i]);let n=this._subParamsIdx[i]>>8,a=this._subParamsIdx[i]&255;a-n>0&&e.push(Array.prototype.slice.call(this._subParams,n,a))}return e}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(e){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>nu?nu:e}addSubParam(e){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=e>nu?nu:e,this._subParamsIdx[this.length-1]++}}hasSubParams(e){return(this._subParamsIdx[e]&255)-(this._subParamsIdx[e]>>8)>0}getSubParams(e){let i=this._subParamsIdx[e]>>8,n=this._subParamsIdx[e]&255;return n-i>0?this._subParams.subarray(i,n):null}getSubParamsAll(){let e={};for(let i=0;i<this.length;++i){let n=this._subParamsIdx[i]>>8,a=this._subParamsIdx[i]&255;a-n>0&&(e[i]=this._subParams.slice(n,a))}return e}addDigit(e){let i;if(this._rejectDigits||!(i=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let n=this._digitIsSub?this._subParams:this.params,a=n[i-1];n[i-1]=~a?Math.min(a*10+e,nu):e}},au=[],CM=class{constructor(){this._state=0,this._active=au,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,i){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(i),{dispose:()=>{let a=n.indexOf(i);a!==-1&&n.splice(a,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=au}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=au,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||au,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,i,n){if(!this._active.length)this._handlerFb(this._id,"PUT",lf(e,i,n));else for(let a=this._active.length-1;a>=0;a--)this._active[a].put(e,i,n)}start(){this.reset(),this._state=1}put(e,i,n){if(this._state!==3){if(this._state===1)for(;i<n;){let a=e[i++];if(a===59){this._state=2,this._start();break}if(a<48||57<a){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+a-48}this._state===2&&n-i>0&&this._put(e,i,n)}}end(e,i=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let n=!1,a=this._active.length-1,l=!1;if(this._stack.paused&&(a=this._stack.loopPosition-1,n=i,l=this._stack.fallThrough,this._stack.paused=!1),!l&&n===!1){for(;a>=0&&(n=this._active[a].end(e),n!==!0);a--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=a,this._stack.fallThrough=!1,n;a--}for(;a>=0;a--)if(n=this._active[a].end(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=a,this._stack.fallThrough=!0,n}this._active=au,this._id=-1,this._state=0}}},Fs=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,i,n){this._hitLimit||(this._data+=lf(e,i,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let i=!1;if(this._hitLimit)i=!1;else if(e&&(i=this._handler(this._data),i instanceof Promise))return i.then(n=>(this._data="",this._hitLimit=!1,n));return this._data="",this._hitLimit=!1,i}},ou=[],xM=class{constructor(){this._handlers=Object.create(null),this._active=ou,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=ou}registerHandler(e,i){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(i),{dispose:()=>{let a=n.indexOf(i);a!==-1&&n.splice(a,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=ou,this._ident=0}hook(e,i){if(this.reset(),this._ident=e,this._active=this._handlers[e]||ou,!this._active.length)this._handlerFb(this._ident,"HOOK",i);else for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(i)}put(e,i,n){if(!this._active.length)this._handlerFb(this._ident,"PUT",lf(e,i,n));else for(let a=this._active.length-1;a>=0;a--)this._active[a].put(e,i,n)}unhook(e,i=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let n=!1,a=this._active.length-1,l=!1;if(this._stack.paused&&(a=this._stack.loopPosition-1,n=i,l=this._stack.fallThrough,this._stack.paused=!1),!l&&n===!1){for(;a>=0&&(n=this._active[a].unhook(e),n!==!0);a--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=a,this._stack.fallThrough=!1,n;a--}for(;a>=0;a--)if(n=this._active[a].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=a,this._stack.fallThrough=!0,n}this._active=ou,this._ident=0}},Su=new OC;Su.addParam(0);var $b=class{constructor(t){this._handler=t,this._data="",this._params=Su,this._hitLimit=!1}hook(t){this._params=t.length>1||t.params[0]?t.clone():Su,this._data="",this._hitLimit=!1}put(t,e,i){this._hitLimit||(this._data+=lf(t,e,i),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(t){let e=!1;if(this._hitLimit)e=!1;else if(t&&(e=this._handler(this._data,this._params),e instanceof Promise))return e.then(i=>(this._params=Su,this._data="",this._hitLimit=!1,i));return this._params=Su,this._data="",this._hitLimit=!1,e}},kM=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,i){this.table.fill(e<<4|i)}add(e,i,n,a){this.table[i<<8|e]=n<<4|a}addMany(e,i,n,a){for(let l=0;l<e.length;l++)this.table[i<<8|e[l]]=n<<4|a}},yr=160,EM=(function(){let t=new kM(4095),e=Array.apply(null,Array(256)).map((h,f)=>f),i=(h,f)=>e.slice(h,f),n=i(32,127),a=i(0,24);a.push(25),a.push.apply(a,i(28,32));let l=i(0,14),u;t.setDefault(1,0),t.addMany(n,0,2,0);for(u in l)t.addMany([24,26,153,154],u,3,0),t.addMany(i(128,144),u,3,0),t.addMany(i(144,152),u,3,0),t.add(156,u,0,0),t.add(27,u,11,1),t.add(157,u,4,8),t.addMany([152,158,159],u,0,7),t.add(155,u,11,3),t.add(144,u,11,9);return t.addMany(a,0,3,0),t.addMany(a,1,3,1),t.add(127,1,0,1),t.addMany(a,8,0,8),t.addMany(a,3,3,3),t.add(127,3,0,3),t.addMany(a,4,3,4),t.add(127,4,0,4),t.addMany(a,6,3,6),t.addMany(a,5,3,5),t.add(127,5,0,5),t.addMany(a,2,3,2),t.add(127,2,0,2),t.add(93,1,4,8),t.addMany(n,8,5,8),t.add(127,8,5,8),t.addMany([156,27,24,26,7],8,6,0),t.addMany(i(28,32),8,0,8),t.addMany([88,94,95],1,0,7),t.addMany(n,7,0,7),t.addMany(a,7,0,7),t.add(156,7,0,0),t.add(127,7,0,7),t.add(91,1,11,3),t.addMany(i(64,127),3,7,0),t.addMany(i(48,60),3,8,4),t.addMany([60,61,62,63],3,9,4),t.addMany(i(48,60),4,8,4),t.addMany(i(64,127),4,7,0),t.addMany([60,61,62,63],4,0,6),t.addMany(i(32,64),6,0,6),t.add(127,6,0,6),t.addMany(i(64,127),6,0,0),t.addMany(i(32,48),3,9,5),t.addMany(i(32,48),5,9,5),t.addMany(i(48,64),5,0,6),t.addMany(i(64,127),5,7,0),t.addMany(i(32,48),4,9,5),t.addMany(i(32,48),1,9,2),t.addMany(i(32,48),2,9,2),t.addMany(i(48,127),2,10,0),t.addMany(i(48,80),1,10,0),t.addMany(i(81,88),1,10,0),t.addMany([89,90,92],1,10,0),t.addMany(i(96,127),1,10,0),t.add(80,1,11,9),t.addMany(a,9,0,9),t.add(127,9,0,9),t.addMany(i(28,32),9,0,9),t.addMany(i(32,48),9,9,12),t.addMany(i(48,60),9,8,10),t.addMany([60,61,62,63],9,9,10),t.addMany(a,11,0,11),t.addMany(i(32,128),11,0,11),t.addMany(i(28,32),11,0,11),t.addMany(a,10,0,10),t.add(127,10,0,10),t.addMany(i(28,32),10,0,10),t.addMany(i(48,60),10,8,10),t.addMany([60,61,62,63],10,0,11),t.addMany(i(32,48),10,9,12),t.addMany(a,12,0,12),t.add(127,12,0,12),t.addMany(i(28,32),12,0,12),t.addMany(i(32,48),12,9,12),t.addMany(i(48,64),12,0,11),t.addMany(i(64,127),12,12,13),t.addMany(i(64,127),10,12,13),t.addMany(i(64,127),9,12,13),t.addMany(a,13,13,13),t.addMany(n,13,13,13),t.add(127,13,0,13),t.addMany([27,156,24,26],13,14,0),t.add(yr,0,2,0),t.add(yr,8,5,8),t.add(yr,6,0,6),t.add(yr,11,0,11),t.add(yr,13,13,13),t})(),TM=class extends st{constructor(e=EM){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 OC,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(i,n,a)=>{},this._executeHandlerFb=i=>{},this._csiHandlerFb=(i,n)=>{},this._escHandlerFb=i=>{},this._errorHandlerFb=i=>i,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(Wt(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new CM),this._dcsParser=this._register(new xM),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,i=[64,126]){let n=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(n=e.prefix.charCodeAt(0),n&&60>n||n>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let l=0;l<e.intermediates.length;++l){let u=e.intermediates.charCodeAt(l);if(32>u||u>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");n<<=8,n|=u}}if(e.final.length!==1)throw new Error("final must be a single byte");let a=e.final.charCodeAt(0);if(i[0]>a||a>i[1])throw new Error(`final must be in range ${i[0]} .. ${i[1]}`);return n<<=8,n|=a,n}identToString(e){let i=[];for(;e;)i.push(String.fromCharCode(e&255)),e>>=8;return i.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,i){let n=this._identifier(e,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);let a=this._escHandlers[n];return a.push(i),{dispose:()=>{let l=a.indexOf(i);l!==-1&&a.splice(l,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,i){this._executeHandlers[e.charCodeAt(0)]=i}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,i){let n=this._identifier(e);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);let a=this._csiHandlers[n];return a.push(i),{dispose:()=>{let l=a.indexOf(i);l!==-1&&a.splice(l,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,i){return this._dcsParser.registerHandler(this._identifier(e),i)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,i){return this._oscParser.registerHandler(e,i)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,i,n,a,l){this._parseStack.state=e,this._parseStack.handlers=i,this._parseStack.handlerPos=n,this._parseStack.transition=a,this._parseStack.chunkPos=l}parse(e,i,n){let a=0,l=0,u=0,h;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,u=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let f=this._parseStack.handlers,d=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&d>-1){for(;d>=0&&(h=f[d](this._params),h!==!0);d--)if(h instanceof Promise)return this._parseStack.handlerPos=d,h}this._parseStack.handlers=[];break;case 4:if(n===!1&&d>-1){for(;d>=0&&(h=f[d](),h!==!0);d--)if(h instanceof Promise)return this._parseStack.handlerPos=d,h}this._parseStack.handlers=[];break;case 6:if(a=e[this._parseStack.chunkPos],h=this._dcsParser.unhook(a!==24&&a!==26,n),h)return h;a===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(a=e[this._parseStack.chunkPos],h=this._oscParser.end(a!==24&&a!==26,n),h)return h;a===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,u=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let f=u;f<i;++f){switch(a=e[f],l=this._transitions.table[this.currentState<<8|(a<160?a:yr)],l>>4){case 2:for(let S=f+1;;++S){if(S>=i||(a=e[S])<32||a>126&&a<yr){this._printHandler(e,f,S),f=S-1;break}if(++S>=i||(a=e[S])<32||a>126&&a<yr){this._printHandler(e,f,S),f=S-1;break}if(++S>=i||(a=e[S])<32||a>126&&a<yr){this._printHandler(e,f,S),f=S-1;break}if(++S>=i||(a=e[S])<32||a>126&&a<yr){this._printHandler(e,f,S),f=S-1;break}}break;case 3:this._executeHandlers[a]?this._executeHandlers[a]():this._executeHandlerFb(a),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:f,code:a,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let d=this._csiHandlers[this._collect<<8|a],p=d?d.length-1:-1;for(;p>=0&&(h=d[p](this._params),h!==!0);p--)if(h instanceof Promise)return this._preserveStack(3,d,p,l,f),h;p<0&&this._csiHandlerFb(this._collect<<8|a,this._params),this.precedingJoinState=0;break;case 8:do switch(a){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(a-48)}while(++f<i&&(a=e[f])>47&&a<60);f--;break;case 9:this._collect<<=8,this._collect|=a;break;case 10:let v=this._escHandlers[this._collect<<8|a],g=v?v.length-1:-1;for(;g>=0&&(h=v[g](),h!==!0);g--)if(h instanceof Promise)return this._preserveStack(4,v,g,l,f),h;g<0&&this._escHandlerFb(this._collect<<8|a),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|a,this._params);break;case 13:for(let S=f+1;;++S)if(S>=i||(a=e[S])===24||a===26||a===27||a>127&&a<yr){this._dcsParser.put(e,f,S),f=S-1;break}break;case 14:if(h=this._dcsParser.unhook(a!==24&&a!==26),h)return this._preserveStack(6,[],0,l,f),h;a===27&&(l|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let S=f+1;;S++)if(S>=i||(a=e[S])<32||a>127&&a<yr){this._oscParser.put(e,f,S),f=S-1;break}break;case 6:if(h=this._oscParser.end(a!==24&&a!==26),h)return this._preserveStack(5,[],0,l,f),h;a===27&&(l|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=l&15}}},RM=/^([\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})$/,AM=/^[\da-f]+$/;function Wb(t){if(!t)return;let e=t.toLowerCase();if(e.indexOf("rgb:")===0){e=e.slice(4);let i=RM.exec(e);if(i){let n=i[1]?15:i[4]?255:i[7]?4095:65535;return[Math.round(parseInt(i[1]||i[4]||i[7]||i[10],16)/n*255),Math.round(parseInt(i[2]||i[5]||i[8]||i[11],16)/n*255),Math.round(parseInt(i[3]||i[6]||i[9]||i[12],16)/n*255)]}}else if(e.indexOf("#")===0&&(e=e.slice(1),AM.exec(e)&&[3,6,9,12].includes(e.length))){let i=e.length/3,n=[0,0,0];for(let a=0;a<3;++a){let l=parseInt(e.slice(i*a,i*a+i),16);n[a]=i===1?l<<4:i===2?l:i===3?l>>4:l>>8}return n}}function tp(t,e){let i=t.toString(16),n=i.length<2?"0"+i:i;switch(e){case 4:return i[0];case 8:return n;case 12:return(n+n).slice(0,3);default:return n+n}}function MM(t,e=16){let[i,n,a]=t;return`rgb:${tp(i,e)}/${tp(n,e)}/${tp(a,e)}`}var LM={"(":0,")":1,"*":2,"+":3,"-":1,".":2},Da=131072,jb=10;function Vb(t,e){if(t>24)return e.setWinLines||!1;switch(t){case 1:return!!e.restoreWin;case 2:return!!e.minimizeWin;case 3:return!!e.setWinPosition;case 4:return!!e.setWinSizePixels;case 5:return!!e.raiseWin;case 6:return!!e.lowerWin;case 7:return!!e.refreshWin;case 8:return!!e.setWinSizeChars;case 9:return!!e.maximizeWin;case 10:return!!e.fullscreenWin;case 11:return!!e.getWinState;case 13:return!!e.getWinPosition;case 14:return!!e.getWinSizePixels;case 15:return!!e.getScreenSizePixels;case 16:return!!e.getCellSizePixels;case 18:return!!e.getWinSizeChars;case 19:return!!e.getScreenSizeChars;case 20:return!!e.getIconTitle;case 21:return!!e.getWinTitle;case 22:return!!e.pushTitle;case 23:return!!e.popTitle;case 24:return!!e.setWinLines}return!1}var qb=5e3,Yb=0,DM=class extends st{constructor(t,e,i,n,a,l,u,h,f=new TM){super(),this._bufferService=t,this._charsetService=e,this._coreService=i,this._logService=n,this._optionsService=a,this._oscLinkService=l,this._coreMouseService=u,this._unicodeService=h,this._parser=f,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new ZT,this._utf8Decoder=new QT,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=_i.clone(),this._eraseAttrDataInternal=_i.clone(),this._onRequestBell=this._register(new ge),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new ge),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new ge),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new ge),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new ge),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new ge),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new ge),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new ge),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new ge),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new ge),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new ge),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new ge),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new ge),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 hg(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(d=>this._activeBuffer=d.activeBuffer)),this._parser.setCsiHandlerFallback((d,p)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(d),params:p.toArray()})}),this._parser.setEscHandlerFallback(d=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(d)})}),this._parser.setExecuteHandlerFallback(d=>{this._logService.debug("Unknown EXECUTE code: ",{code:d})}),this._parser.setOscHandlerFallback((d,p,v)=>{this._logService.debug("Unknown OSC code: ",{identifier:d,action:p,data:v})}),this._parser.setDcsHandlerFallback((d,p,v)=>{p==="HOOK"&&(v=v.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(d),action:p,payload:v})}),this._parser.setPrintHandler((d,p,v)=>this.print(d,p,v)),this._parser.registerCsiHandler({final:"@"},d=>this.insertChars(d)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},d=>this.scrollLeft(d)),this._parser.registerCsiHandler({final:"A"},d=>this.cursorUp(d)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},d=>this.scrollRight(d)),this._parser.registerCsiHandler({final:"B"},d=>this.cursorDown(d)),this._parser.registerCsiHandler({final:"C"},d=>this.cursorForward(d)),this._parser.registerCsiHandler({final:"D"},d=>this.cursorBackward(d)),this._parser.registerCsiHandler({final:"E"},d=>this.cursorNextLine(d)),this._parser.registerCsiHandler({final:"F"},d=>this.cursorPrecedingLine(d)),this._parser.registerCsiHandler({final:"G"},d=>this.cursorCharAbsolute(d)),this._parser.registerCsiHandler({final:"H"},d=>this.cursorPosition(d)),this._parser.registerCsiHandler({final:"I"},d=>this.cursorForwardTab(d)),this._parser.registerCsiHandler({final:"J"},d=>this.eraseInDisplay(d,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},d=>this.eraseInDisplay(d,!0)),this._parser.registerCsiHandler({final:"K"},d=>this.eraseInLine(d,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},d=>this.eraseInLine(d,!0)),this._parser.registerCsiHandler({final:"L"},d=>this.insertLines(d)),this._parser.registerCsiHandler({final:"M"},d=>this.deleteLines(d)),this._parser.registerCsiHandler({final:"P"},d=>this.deleteChars(d)),this._parser.registerCsiHandler({final:"S"},d=>this.scrollUp(d)),this._parser.registerCsiHandler({final:"T"},d=>this.scrollDown(d)),this._parser.registerCsiHandler({final:"X"},d=>this.eraseChars(d)),this._parser.registerCsiHandler({final:"Z"},d=>this.cursorBackwardTab(d)),this._parser.registerCsiHandler({final:"`"},d=>this.charPosAbsolute(d)),this._parser.registerCsiHandler({final:"a"},d=>this.hPositionRelative(d)),this._parser.registerCsiHandler({final:"b"},d=>this.repeatPrecedingCharacter(d)),this._parser.registerCsiHandler({final:"c"},d=>this.sendDeviceAttributesPrimary(d)),this._parser.registerCsiHandler({prefix:">",final:"c"},d=>this.sendDeviceAttributesSecondary(d)),this._parser.registerCsiHandler({final:"d"},d=>this.linePosAbsolute(d)),this._parser.registerCsiHandler({final:"e"},d=>this.vPositionRelative(d)),this._parser.registerCsiHandler({final:"f"},d=>this.hVPosition(d)),this._parser.registerCsiHandler({final:"g"},d=>this.tabClear(d)),this._parser.registerCsiHandler({final:"h"},d=>this.setMode(d)),this._parser.registerCsiHandler({prefix:"?",final:"h"},d=>this.setModePrivate(d)),this._parser.registerCsiHandler({final:"l"},d=>this.resetMode(d)),this._parser.registerCsiHandler({prefix:"?",final:"l"},d=>this.resetModePrivate(d)),this._parser.registerCsiHandler({final:"m"},d=>this.charAttributes(d)),this._parser.registerCsiHandler({final:"n"},d=>this.deviceStatus(d)),this._parser.registerCsiHandler({prefix:"?",final:"n"},d=>this.deviceStatusPrivate(d)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},d=>this.softReset(d)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},d=>this.setCursorStyle(d)),this._parser.registerCsiHandler({final:"r"},d=>this.setScrollRegion(d)),this._parser.registerCsiHandler({final:"s"},d=>this.saveCursor(d)),this._parser.registerCsiHandler({final:"t"},d=>this.windowOptions(d)),this._parser.registerCsiHandler({final:"u"},d=>this.restoreCursor(d)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},d=>this.insertColumns(d)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},d=>this.deleteColumns(d)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},d=>this.selectProtected(d)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},d=>this.requestMode(d,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},d=>this.requestMode(d,!1)),this._parser.setExecuteHandler(le.BEL,()=>this.bell()),this._parser.setExecuteHandler(le.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(le.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(le.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(le.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(le.BS,()=>this.backspace()),this._parser.setExecuteHandler(le.HT,()=>this.tab()),this._parser.setExecuteHandler(le.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(le.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(xd.IND,()=>this.index()),this._parser.setExecuteHandler(xd.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(xd.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new Fs(d=>(this.setTitle(d),this.setIconName(d),!0))),this._parser.registerOscHandler(1,new Fs(d=>this.setIconName(d))),this._parser.registerOscHandler(2,new Fs(d=>this.setTitle(d))),this._parser.registerOscHandler(4,new Fs(d=>this.setOrReportIndexedColor(d))),this._parser.registerOscHandler(8,new Fs(d=>this.setHyperlink(d))),this._parser.registerOscHandler(10,new Fs(d=>this.setOrReportFgColor(d))),this._parser.registerOscHandler(11,new Fs(d=>this.setOrReportBgColor(d))),this._parser.registerOscHandler(12,new Fs(d=>this.setOrReportCursorColor(d))),this._parser.registerOscHandler(104,new Fs(d=>this.restoreIndexedColor(d))),this._parser.registerOscHandler(110,new Fs(d=>this.restoreFgColor(d))),this._parser.registerOscHandler(111,new Fs(d=>this.restoreBgColor(d))),this._parser.registerOscHandler(112,new Fs(d=>this.restoreCursorColor(d))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let d in ki)this._parser.registerEscHandler({intermediates:"(",final:d},()=>this.selectCharset("("+d)),this._parser.registerEscHandler({intermediates:")",final:d},()=>this.selectCharset(")"+d)),this._parser.registerEscHandler({intermediates:"*",final:d},()=>this.selectCharset("*"+d)),this._parser.registerEscHandler({intermediates:"+",final:d},()=>this.selectCharset("+"+d)),this._parser.registerEscHandler({intermediates:"-",final:d},()=>this.selectCharset("-"+d)),this._parser.registerEscHandler({intermediates:".",final:d},()=>this.selectCharset("."+d)),this._parser.registerEscHandler({intermediates:"/",final:d},()=>this.selectCharset("/"+d));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(d=>(this._logService.error("Parsing error: ",d),d)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new $b((d,p)=>this.requestStatusString(d,p)))}getAttrData(){return this._curAttrData}_preserveStack(t,e,i,n){this._parseStack.paused=!0,this._parseStack.cursorStartX=t,this._parseStack.cursorStartY=e,this._parseStack.decodedLength=i,this._parseStack.position=n}_logSlowResolvingAsync(t){this._logService.logLevel<=3&&Promise.race([t,new Promise((e,i)=>setTimeout(()=>i("#SLOW_TIMEOUT"),qb))]).catch(e=>{if(e!=="#SLOW_TIMEOUT")throw e;console.warn(`async parser handler taking longer than ${qb} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(t,e){let i,n=this._activeBuffer.x,a=this._activeBuffer.y,l=0,u=this._parseStack.paused;if(u){if(i=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,e))return this._logSlowResolvingAsync(i),i;n=this._parseStack.cursorStartX,a=this._parseStack.cursorStartY,this._parseStack.paused=!1,t.length>Da&&(l=this._parseStack.position+Da)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof t=="string"?` "${t}"`:` "${Array.prototype.map.call(t,d=>String.fromCharCode(d)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof t=="string"?t.split("").map(d=>d.charCodeAt(0)):t),this._parseBuffer.length<t.length&&this._parseBuffer.length<Da&&(this._parseBuffer=new Uint32Array(Math.min(t.length,Da))),u||this._dirtyRowTracker.clearRange(),t.length>Da)for(let d=l;d<t.length;d+=Da){let p=d+Da<t.length?d+Da:t.length,v=typeof t=="string"?this._stringDecoder.decode(t.substring(d,p),this._parseBuffer):this._utf8Decoder.decode(t.subarray(d,p),this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,v))return this._preserveStack(n,a,v,d),this._logSlowResolvingAsync(i),i}else if(!u){let d=typeof t=="string"?this._stringDecoder.decode(t,this._parseBuffer):this._utf8Decoder.decode(t,this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,d))return this._preserveStack(n,a,d,0),this._logSlowResolvingAsync(i),i}(this._activeBuffer.x!==n||this._activeBuffer.y!==a)&&this._onCursorMove.fire();let h=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),f=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);f<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(f,this._bufferService.rows-1),end:Math.min(h,this._bufferService.rows-1)})}print(t,e,i){let n,a,l=this._charsetService.charset,u=this._optionsService.rawOptions.screenReaderMode,h=this._bufferService.cols,f=this._coreService.decPrivateModes.wraparound,d=this._coreService.modes.insertMode,p=this._curAttrData,v=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&i-e>0&&v.getWidth(this._activeBuffer.x-1)===2&&v.setCellFromCodepoint(this._activeBuffer.x-1,0,1,p);let g=this._parser.precedingJoinState;for(let S=e;S<i;++S){if(n=t[S],n<127&&l){let E=l[String.fromCharCode(n)];E&&(n=E.charCodeAt(0))}let b=this._unicodeService.charProperties(n,g);a=Ao.extractWidth(b);let C=Ao.extractShouldJoin(b),x=C?Ao.extractWidth(g):0;if(g=b,u&&this._onA11yChar.fire(Ia(n)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+a-x>h){if(f){let E=v,A=this._activeBuffer.x-x;for(this._activeBuffer.x=x,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),v=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),x>0&&v instanceof gu&&v.copyCellsFrom(E,A,0,x,!1);A<h;)E.setCellFromCodepoint(A++,0,1,p)}else if(this._activeBuffer.x=h-1,a===2)continue}if(C&&this._activeBuffer.x){let E=v.getWidth(this._activeBuffer.x-1)?1:2;v.addCodepointToCell(this._activeBuffer.x-E,n,a);for(let A=a-x;--A>=0;)v.setCellFromCodepoint(this._activeBuffer.x++,0,0,p);continue}if(d&&(v.insertCells(this._activeBuffer.x,a-x,this._activeBuffer.getNullCell(p)),v.getWidth(h-1)===2&&v.setCellFromCodepoint(h-1,0,1,p)),v.setCellFromCodepoint(this._activeBuffer.x++,n,a,p),a>0)for(;--a;)v.setCellFromCodepoint(this._activeBuffer.x++,0,0,p)}this._parser.precedingJoinState=g,this._activeBuffer.x<h&&i-e>0&&v.getWidth(this._activeBuffer.x)===0&&!v.hasContent(this._activeBuffer.x)&&v.setCellFromCodepoint(this._activeBuffer.x,0,1,p),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(t,e){return t.final==="t"&&!t.prefix&&!t.intermediates?this._parser.registerCsiHandler(t,i=>Vb(i.params[0],this._optionsService.rawOptions.windowOptions)?e(i):!0):this._parser.registerCsiHandler(t,e)}registerDcsHandler(t,e){return this._parser.registerDcsHandler(t,new $b(e))}registerEscHandler(t,e){return this._parser.registerEscHandler(t,e)}registerOscHandler(t,e){return this._parser.registerOscHandler(t,new Fs(e))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);t.hasWidth(this._activeBuffer.x)&&!t.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-t),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(t=this._bufferService.cols-1){this._activeBuffer.x=Math.min(t,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(t,e){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=t,this._activeBuffer.y=this._activeBuffer.scrollTop+e):(this._activeBuffer.x=t,this._activeBuffer.y=e),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(t,e){this._restrictCursor(),this._setCursor(this._activeBuffer.x+t,this._activeBuffer.y+e)}cursorUp(t){let e=this._activeBuffer.y-this._activeBuffer.scrollTop;return e>=0?this._moveCursor(0,-Math.min(e,t.params[0]||1)):this._moveCursor(0,-(t.params[0]||1)),!0}cursorDown(t){let e=this._activeBuffer.scrollBottom-this._activeBuffer.y;return e>=0?this._moveCursor(0,Math.min(e,t.params[0]||1)):this._moveCursor(0,t.params[0]||1),!0}cursorForward(t){return this._moveCursor(t.params[0]||1,0),!0}cursorBackward(t){return this._moveCursor(-(t.params[0]||1),0),!0}cursorNextLine(t){return this.cursorDown(t),this._activeBuffer.x=0,!0}cursorPrecedingLine(t){return this.cursorUp(t),this._activeBuffer.x=0,!0}cursorCharAbsolute(t){return this._setCursor((t.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(t){return this._setCursor(t.length>=2?(t.params[1]||1)-1:0,(t.params[0]||1)-1),!0}charPosAbsolute(t){return this._setCursor((t.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(t){return this._moveCursor(t.params[0]||1,0),!0}linePosAbsolute(t){return this._setCursor(this._activeBuffer.x,(t.params[0]||1)-1),!0}vPositionRelative(t){return this._moveCursor(0,t.params[0]||1),!0}hVPosition(t){return this.cursorPosition(t),!0}tabClear(t){let e=t.params[0];return e===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:e===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(t){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=t.params[0]||1;for(;e--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(t){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=t.params[0]||1;for(;e--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(t){let e=t.params[0];return e===1&&(this._curAttrData.bg|=536870912),(e===2||e===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(t,e,i,n=!1,a=!1){let l=this._activeBuffer.lines.get(this._activeBuffer.ybase+t);l.replaceCells(e,i,this._activeBuffer.getNullCell(this._eraseAttrData()),a),n&&(l.isWrapped=!1)}_resetBufferLine(t,e=!1){let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+t);i&&(i.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),e),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+t),i.isWrapped=!1)}eraseInDisplay(t,e=!1){this._restrictCursor(this._bufferService.cols);let i;switch(t.params[0]){case 0:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,e);i<this._bufferService.rows;i++)this._resetBufferLine(i,e);this._dirtyRowTracker.markDirty(i);break;case 1:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i,0,this._activeBuffer.x+1,!0,e),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(i+1).isWrapped=!1);i--;)this._resetBufferLine(i,e);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(i=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,i-1);i--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+i)?.getTrimmedLength(););for(;i>=0;i--)this._bufferService.scroll(this._eraseAttrData())}else{for(i=this._bufferService.rows,this._dirtyRowTracker.markDirty(i-1);i--;)this._resetBufferLine(i,e);this._dirtyRowTracker.markDirty(0)}break;case 3:let n=this._activeBuffer.lines.length-this._bufferService.rows;n>0&&(this._activeBuffer.lines.trimStart(n),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-n,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-n,0),this._onScroll.fire(0));break}return!0}eraseInLine(t,e=!1){switch(this._restrictCursor(this._bufferService.cols),t.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,e);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,e);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,e);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(t){this._restrictCursor();let e=t.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=this._activeBuffer.ybase+this._activeBuffer.y,n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,a=this._bufferService.rows-1+this._activeBuffer.ybase-n+1;for(;e--;)this._activeBuffer.lines.splice(a-1,1),this._activeBuffer.lines.splice(i,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(t){this._restrictCursor();let e=t.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=this._activeBuffer.ybase+this._activeBuffer.y,n;for(n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,n=this._bufferService.rows-1+this._activeBuffer.ybase-n;e--;)this._activeBuffer.lines.splice(i,1),this._activeBuffer.lines.splice(n,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(t){this._restrictCursor();let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return e&&(e.insertCells(this._activeBuffer.x,t.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(t){this._restrictCursor();let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return e&&(e.deleteCells(this._activeBuffer.x,t.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(t){let e=t.params[0]||1;for(;e--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(t){let e=t.params[0]||1;for(;e--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(_i));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(t){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let e=t.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);n.deleteCells(0,e,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(t){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let e=t.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);n.insertCells(0,e,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(t){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let e=t.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);n.insertCells(this._activeBuffer.x,e,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(t){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let e=t.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);n.deleteCells(this._activeBuffer.x,e,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(t){this._restrictCursor();let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return e&&(e.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(t.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(t){let e=this._parser.precedingJoinState;if(!e)return!0;let i=t.params[0]||1,n=Ao.extractWidth(e),a=this._activeBuffer.x-n,l=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(a),u=new Uint32Array(l.length*i),h=0;for(let d=0;d<l.length;){let p=l.codePointAt(d)||0;u[h++]=p,d+=p>65535?2:1}let f=h;for(let d=1;d<i;++d)u.copyWithin(f,0,h),f+=h;return this.print(u,0,f),!0}sendDeviceAttributesPrimary(t){return t.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(le.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(le.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(t){return t.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(le.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(le.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(t.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(le.ESC+"[>83;40003;0c")),!0}_is(t){return(this._optionsService.rawOptions.termName+"").indexOf(t)===0}setMode(t){for(let e=0;e<t.length;e++)switch(t.params[e]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(t){for(let e=0;e<t.length;e++)switch(t.params[e]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,To),this._charsetService.setgCharset(1,To),this._charsetService.setgCharset(2,To),this._charsetService.setgCharset(3,To);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0;break}return!0}resetMode(t){for(let e=0;e<t.length;e++)switch(t.params[e]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(t){for(let e=0;e<t.length;e++)switch(t.params[e]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),t.params[e]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0);break}return!0}requestMode(t,e){let i;(C=>(C[C.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",C[C.SET=1]="SET",C[C.RESET=2]="RESET",C[C.PERMANENTLY_SET=3]="PERMANENTLY_SET",C[C.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(i||={});let n=this._coreService.decPrivateModes,{activeProtocol:a,activeEncoding:l}=this._coreMouseService,u=this._coreService,{buffers:h,cols:f}=this._bufferService,{active:d,alt:p}=h,v=this._optionsService.rawOptions,g=(C,x)=>(u.triggerDataEvent(`${le.ESC}[${e?"":"?"}${C};${x}$y`),!0),S=C=>C?1:2,b=t.params[0];return e?b===2?g(b,4):b===4?g(b,S(u.modes.insertMode)):b===12?g(b,3):b===20?g(b,S(v.convertEol)):g(b,0):b===1?g(b,S(n.applicationCursorKeys)):b===3?g(b,v.windowOptions.setWinLines?f===80?2:f===132?1:0:0):b===6?g(b,S(n.origin)):b===7?g(b,S(n.wraparound)):b===8?g(b,3):b===9?g(b,S(a==="X10")):b===12?g(b,S(v.cursorBlink)):b===25?g(b,S(!u.isCursorHidden)):b===45?g(b,S(n.reverseWraparound)):b===66?g(b,S(n.applicationKeypad)):b===67?g(b,4):b===1e3?g(b,S(a==="VT200")):b===1002?g(b,S(a==="DRAG")):b===1003?g(b,S(a==="ANY")):b===1004?g(b,S(n.sendFocus)):b===1005?g(b,4):b===1006?g(b,S(l==="SGR")):b===1015?g(b,4):b===1016?g(b,S(l==="SGR_PIXELS")):b===1048?g(b,1):b===47||b===1047||b===1049?g(b,S(d===p)):b===2004?g(b,S(n.bracketedPasteMode)):b===2026?g(b,S(n.synchronizedOutput)):g(b,0)}_updateAttrColor(t,e,i,n,a){return e===2?(t|=50331648,t&=-16777216,t|=Bu.fromColorRGB([i,n,a])):e===5&&(t&=-50331904,t|=33554432|i&255),t}_extractColor(t,e,i){let n=[0,0,-1,0,0,0],a=0,l=0;do{if(n[l+a]=t.params[e+l],t.hasSubParams(e+l)){let u=t.getSubParams(e+l),h=0;do n[1]===5&&(a=1),n[l+h+1+a]=u[h];while(++h<u.length&&h+l+1+a<n.length);break}if(n[1]===5&&l+a>=2||n[1]===2&&l+a>=5)break;n[1]&&(a=1)}while(++l+e<t.length&&l+a<n.length);for(let u=2;u<n.length;++u)n[u]===-1&&(n[u]=0);switch(n[0]){case 38:i.fg=this._updateAttrColor(i.fg,n[1],n[3],n[4],n[5]);break;case 48:i.bg=this._updateAttrColor(i.bg,n[1],n[3],n[4],n[5]);break;case 58:i.extended=i.extended.clone(),i.extended.underlineColor=this._updateAttrColor(i.extended.underlineColor,n[1],n[3],n[4],n[5])}return l}_processUnderline(t,e){e.extended=e.extended.clone(),(!~t||t>5)&&(t=1),e.extended.underlineStyle=t,e.fg|=268435456,t===0&&(e.fg&=-268435457),e.updateExtended()}_processSGR0(t){t.fg=_i.fg,t.bg=_i.bg,t.extended=t.extended.clone(),t.extended.underlineStyle=0,t.extended.underlineColor&=-67108864,t.updateExtended()}charAttributes(t){if(t.length===1&&t.params[0]===0)return this._processSGR0(this._curAttrData),!0;let e=t.length,i,n=this._curAttrData;for(let a=0;a<e;a++)i=t.params[a],i>=30&&i<=37?(n.fg&=-50331904,n.fg|=16777216|i-30):i>=40&&i<=47?(n.bg&=-50331904,n.bg|=16777216|i-40):i>=90&&i<=97?(n.fg&=-50331904,n.fg|=16777216|i-90|8):i>=100&&i<=107?(n.bg&=-50331904,n.bg|=16777216|i-100|8):i===0?this._processSGR0(n):i===1?n.fg|=134217728:i===3?n.bg|=67108864:i===4?(n.fg|=268435456,this._processUnderline(t.hasSubParams(a)?t.getSubParams(a)[0]:1,n)):i===5?n.fg|=536870912:i===7?n.fg|=67108864:i===8?n.fg|=1073741824:i===9?n.fg|=2147483648:i===2?n.bg|=134217728:i===21?this._processUnderline(2,n):i===22?(n.fg&=-134217729,n.bg&=-134217729):i===23?n.bg&=-67108865:i===24?(n.fg&=-268435457,this._processUnderline(0,n)):i===25?n.fg&=-536870913:i===27?n.fg&=-67108865:i===28?n.fg&=-1073741825:i===29?n.fg&=2147483647:i===39?(n.fg&=-67108864,n.fg|=_i.fg&16777215):i===49?(n.bg&=-67108864,n.bg|=_i.bg&16777215):i===38||i===48||i===58?a+=this._extractColor(t,a,n):i===53?n.bg|=1073741824:i===55?n.bg&=-1073741825:i===59?(n.extended=n.extended.clone(),n.extended.underlineColor=-1,n.updateExtended()):i===100?(n.fg&=-67108864,n.fg|=_i.fg&16777215,n.bg&=-67108864,n.bg|=_i.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",i);return!0}deviceStatus(t){switch(t.params[0]){case 5:this._coreService.triggerDataEvent(`${le.ESC}[0n`);break;case 6:let e=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${le.ESC}[${e};${i}R`);break}return!0}deviceStatusPrivate(t){if(t.params[0]===6){let e=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${le.ESC}[?${e};${i}R`)}return!0}softReset(t){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=_i.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(t){let e=t.length===0?1:t.params[0];if(e===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(e){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let i=e%2===1;this._coreService.decPrivateModes.cursorBlink=i}return!0}setScrollRegion(t){let e=t.params[0]||1,i;return(t.length<2||(i=t.params[1])>this._bufferService.rows||i===0)&&(i=this._bufferService.rows),i>e&&(this._activeBuffer.scrollTop=e-1,this._activeBuffer.scrollBottom=i-1,this._setCursor(0,0)),!0}windowOptions(t){if(!Vb(t.params[0],this._optionsService.rawOptions.windowOptions))return!0;let e=t.length>1?t.params[1]:0;switch(t.params[0]){case 14:e!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${le.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(e===0||e===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>jb&&this._windowTitleStack.shift()),(e===0||e===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>jb&&this._iconNameStack.shift());break;case 23:(e===0||e===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(e===0||e===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(t){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(t){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(t){return this._windowTitle=t,this._onTitleChange.fire(t),!0}setIconName(t){return this._iconName=t,!0}setOrReportIndexedColor(t){let e=[],i=t.split(";");for(;i.length>1;){let n=i.shift(),a=i.shift();if(/^\d+$/.exec(n)){let l=parseInt(n);if(Gb(l))if(a==="?")e.push({type:0,index:l});else{let u=Wb(a);u&&e.push({type:1,index:l,color:u})}}}return e.length&&this._onColor.fire(e),!0}setHyperlink(t){let e=t.indexOf(";");if(e===-1)return!0;let i=t.slice(0,e).trim(),n=t.slice(e+1);return n?this._createHyperlink(i,n):i.trim()?!1:this._finishHyperlink()}_createHyperlink(t,e){this._getCurrentLinkId()&&this._finishHyperlink();let i=t.split(":"),n,a=i.findIndex(l=>l.startsWith("id="));return a!==-1&&(n=i[a].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:n,uri:e}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(t,e){let i=t.split(";");for(let n=0;n<i.length&&!(e>=this._specialColors.length);++n,++e)if(i[n]==="?")this._onColor.fire([{type:0,index:this._specialColors[e]}]);else{let a=Wb(i[n]);a&&this._onColor.fire([{type:1,index:this._specialColors[e],color:a}])}return!0}setOrReportFgColor(t){return this._setOrReportSpecialColor(t,0)}setOrReportBgColor(t){return this._setOrReportSpecialColor(t,1)}setOrReportCursorColor(t){return this._setOrReportSpecialColor(t,2)}restoreIndexedColor(t){if(!t)return this._onColor.fire([{type:2}]),!0;let e=[],i=t.split(";");for(let n=0;n<i.length;++n)if(/^\d+$/.exec(i[n])){let a=parseInt(i[n]);Gb(a)&&e.push({type:2,index:a})}return e.length&&this._onColor.fire(e),!0}restoreFgColor(t){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(t){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(t){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,To),!0}selectCharset(t){return t.length!==2?(this.selectDefaultCharset(),!0):(t[0]==="/"||this._charsetService.setgCharset(LM[t[0]],ki[t[1]]||To),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let t=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,t,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=_i.clone(),this._eraseAttrDataInternal=_i.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(t){return this._charsetService.setgLevel(t),!0}screenAlignmentPattern(){let t=new Cr;t.content=1<<22|69,t.fg=this._curAttrData.fg,t.bg=this._curAttrData.bg,this._setCursor(0,0);for(let e=0;e<this._bufferService.rows;++e){let i=this._activeBuffer.ybase+this._activeBuffer.y+e,n=this._activeBuffer.lines.get(i);n&&(n.fill(t),n.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(t,e){let i=u=>(this._coreService.triggerDataEvent(`${le.ESC}${u}${le.ESC}\\`),!0),n=this._bufferService.buffer,a=this._optionsService.rawOptions;return i(t==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:t==='"p'?'P1$r61;1"p':t==="r"?`P1$r${n.scrollTop+1};${n.scrollBottom+1}r`:t==="m"?"P1$r0m":t===" q"?`P1$r${{block:2,underline:4,bar:6}[a.cursorStyle]-(a.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(t,e){this._dirtyRowTracker.markRangeDirty(t,e)}},hg=class{constructor(t){this._bufferService=t,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(t){t<this.start?this.start=t:t>this.end&&(this.end=t)}markRangeDirty(t,e){t>e&&(Yb=t,t=e,e=Yb),t<this.start&&(this.start=t),e>this.end&&(this.end=e)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};hg=si([we(0,hs)],hg);function Gb(t){return 0<=t&&t<256}var OM=5e7,Kb=12,BM=50,NM=class extends st{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 ge),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,i){if(i!==void 0&&this._syncCalls>i){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let n;for(;n=this._writeBuffer.shift();){this._action(n);let a=this._callbacks.shift();a&&a()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,i){if(this._pendingData>OM)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(i),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(i)}_innerWrite(e=0,i=!0){let n=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let a=this._writeBuffer[this._bufferOffset],l=this._action(a,i);if(l){let h=f=>performance.now()-n>=Kb?setTimeout(()=>this._innerWrite(0,f)):this._innerWrite(n,f);l.catch(f=>(queueMicrotask(()=>{throw f}),Promise.resolve(!1))).then(h);return}let u=this._callbacks[this._bufferOffset];if(u&&u(),this._bufferOffset++,this._pendingData-=a.length,performance.now()-n>=Kb)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>BM&&(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()}},dg=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let i=this._bufferService.buffer;if(e.id===void 0){let f=i.addMarker(i.ybase+i.y),d={data:e,id:this._nextId++,lines:[f]};return f.onDispose(()=>this._removeMarkerFromLink(d,f)),this._dataByLinkId.set(d.id,d),d.id}let n=e,a=this._getEntryIdKey(n),l=this._entriesWithId.get(a);if(l)return this.addLineToLink(l.id,i.ybase+i.y),l.id;let u=i.addMarker(i.ybase+i.y),h={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[u]};return u.onDispose(()=>this._removeMarkerFromLink(h,u)),this._entriesWithId.set(h.key,h),this._dataByLinkId.set(h.id,h),h.id}addLineToLink(e,i){let n=this._dataByLinkId.get(e);if(n&&n.lines.every(a=>a.line!==i)){let a=this._bufferService.buffer.addMarker(i);n.lines.push(a),a.onDispose(()=>this._removeMarkerFromLink(n,a))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,i){let n=e.lines.indexOf(i);n!==-1&&(e.lines.splice(n,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};dg=si([we(0,hs)],dg);var Xb=!1,PM=class extends st{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new Gl),this._onBinary=this._register(new ge),this.onBinary=this._onBinary.event,this._onData=this._register(new ge),this.onData=this._onData.event,this._onLineFeed=this._register(new ge),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new ge),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new ge),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new ge),this._instantiationService=new aM,this.optionsService=this._register(new pM(e)),this._instantiationService.setService(ds,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(og)),this._instantiationService.setService(hs,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(ag)),this._instantiationService.setService(Qw,this._logService),this.coreService=this._register(this._instantiationService.createInstance(lg)),this._instantiationService.setService(Wo,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(cg)),this._instantiationService.setService(Zw,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Ao)),this._instantiationService.setService(iR,this.unicodeService),this._charsetService=this._instantiationService.createInstance(bM),this._instantiationService.setService(tR,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(dg),this._instantiationService.setService(Jw,this._oscLinkService),this._inputHandler=this._register(new DM(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(Zi.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(Zi.forward(this._bufferService.onResize,this._onResize)),this._register(Zi.forward(this.coreService.onData,this._onData)),this._register(Zi.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new NM((i,n)=>this._inputHandler.parse(i,n))),this._register(Zi.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new ge),this._onScroll.event(e=>{this._onScrollApi?.fire(e.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let i in e)this.optionsService.options[i]=e[i]}write(e,i){this._writeBuffer.write(e,i)}writeSync(e,i){this._logService.logLevel<=3&&!Xb&&(this._logService.warn("writeSync is unreliable and will be removed soon."),Xb=!0),this._writeBuffer.writeSync(e,i)}input(e,i=!0){this.coreService.triggerDataEvent(e,i)}resize(e,i){isNaN(e)||isNaN(i)||(e=Math.max(e,LC),i=Math.max(i,DC),this._bufferService.resize(e,i))}scroll(e,i=!1){this._bufferService.scroll(e,i)}scrollLines(e,i){this._bufferService.scrollLines(e,i)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let i=e-this._bufferService.buffer.ydisp;i!==0&&this.scrollLines(i)}registerEscHandler(e,i){return this._inputHandler.registerEscHandler(e,i)}registerDcsHandler(e,i){return this._inputHandler.registerDcsHandler(e,i)}registerCsiHandler(e,i){return this._inputHandler.registerCsiHandler(e,i)}registerOscHandler(e,i){return this._inputHandler.registerOscHandler(e,i)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,i=this.optionsService.rawOptions.windowsPty;i&&i.buildNumber!==void 0&&i.buildNumber!==void 0?e=i.backend==="conpty"&&i.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(Fb.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(Fb(this._bufferService),!1))),this._windowsWrappingHeuristics.value=Wt(()=>{for(let i of e)i.dispose()})}}},zM={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 HM(t,e,i,n){let a={type:0,cancel:!1,key:void 0},l=(t.shiftKey?1:0)|(t.altKey?2:0)|(t.ctrlKey?4:0)|(t.metaKey?8:0);switch(t.keyCode){case 0:t.key==="UIKeyInputUpArrow"?e?a.key=le.ESC+"OA":a.key=le.ESC+"[A":t.key==="UIKeyInputLeftArrow"?e?a.key=le.ESC+"OD":a.key=le.ESC+"[D":t.key==="UIKeyInputRightArrow"?e?a.key=le.ESC+"OC":a.key=le.ESC+"[C":t.key==="UIKeyInputDownArrow"&&(e?a.key=le.ESC+"OB":a.key=le.ESC+"[B");break;case 8:a.key=t.ctrlKey?"\b":le.DEL,t.altKey&&(a.key=le.ESC+a.key);break;case 9:if(t.shiftKey){a.key=le.ESC+"[Z";break}a.key=le.HT,a.cancel=!0;break;case 13:a.key=t.altKey?le.ESC+le.CR:le.CR,a.cancel=!0;break;case 27:a.key=le.ESC,t.altKey&&(a.key=le.ESC+le.ESC),a.cancel=!0;break;case 37:if(t.metaKey)break;l?a.key=le.ESC+"[1;"+(l+1)+"D":e?a.key=le.ESC+"OD":a.key=le.ESC+"[D";break;case 39:if(t.metaKey)break;l?a.key=le.ESC+"[1;"+(l+1)+"C":e?a.key=le.ESC+"OC":a.key=le.ESC+"[C";break;case 38:if(t.metaKey)break;l?a.key=le.ESC+"[1;"+(l+1)+"A":e?a.key=le.ESC+"OA":a.key=le.ESC+"[A";break;case 40:if(t.metaKey)break;l?a.key=le.ESC+"[1;"+(l+1)+"B":e?a.key=le.ESC+"OB":a.key=le.ESC+"[B";break;case 45:!t.shiftKey&&!t.ctrlKey&&(a.key=le.ESC+"[2~");break;case 46:l?a.key=le.ESC+"[3;"+(l+1)+"~":a.key=le.ESC+"[3~";break;case 36:l?a.key=le.ESC+"[1;"+(l+1)+"H":e?a.key=le.ESC+"OH":a.key=le.ESC+"[H";break;case 35:l?a.key=le.ESC+"[1;"+(l+1)+"F":e?a.key=le.ESC+"OF":a.key=le.ESC+"[F";break;case 33:t.shiftKey?a.type=2:t.ctrlKey?a.key=le.ESC+"[5;"+(l+1)+"~":a.key=le.ESC+"[5~";break;case 34:t.shiftKey?a.type=3:t.ctrlKey?a.key=le.ESC+"[6;"+(l+1)+"~":a.key=le.ESC+"[6~";break;case 112:l?a.key=le.ESC+"[1;"+(l+1)+"P":a.key=le.ESC+"OP";break;case 113:l?a.key=le.ESC+"[1;"+(l+1)+"Q":a.key=le.ESC+"OQ";break;case 114:l?a.key=le.ESC+"[1;"+(l+1)+"R":a.key=le.ESC+"OR";break;case 115:l?a.key=le.ESC+"[1;"+(l+1)+"S":a.key=le.ESC+"OS";break;case 116:l?a.key=le.ESC+"[15;"+(l+1)+"~":a.key=le.ESC+"[15~";break;case 117:l?a.key=le.ESC+"[17;"+(l+1)+"~":a.key=le.ESC+"[17~";break;case 118:l?a.key=le.ESC+"[18;"+(l+1)+"~":a.key=le.ESC+"[18~";break;case 119:l?a.key=le.ESC+"[19;"+(l+1)+"~":a.key=le.ESC+"[19~";break;case 120:l?a.key=le.ESC+"[20;"+(l+1)+"~":a.key=le.ESC+"[20~";break;case 121:l?a.key=le.ESC+"[21;"+(l+1)+"~":a.key=le.ESC+"[21~";break;case 122:l?a.key=le.ESC+"[23;"+(l+1)+"~":a.key=le.ESC+"[23~";break;case 123:l?a.key=le.ESC+"[24;"+(l+1)+"~":a.key=le.ESC+"[24~";break;default:if(t.ctrlKey&&!t.shiftKey&&!t.altKey&&!t.metaKey)t.keyCode>=65&&t.keyCode<=90?a.key=String.fromCharCode(t.keyCode-64):t.keyCode===32?a.key=le.NUL:t.keyCode>=51&&t.keyCode<=55?a.key=String.fromCharCode(t.keyCode-51+27):t.keyCode===56?a.key=le.DEL:t.keyCode===219?a.key=le.ESC:t.keyCode===220?a.key=le.FS:t.keyCode===221&&(a.key=le.GS);else if((!i||n)&&t.altKey&&!t.metaKey){let u=zM[t.keyCode]?.[t.shiftKey?1:0];if(u)a.key=le.ESC+u;else if(t.keyCode>=65&&t.keyCode<=90){let h=t.ctrlKey?t.keyCode-64:t.keyCode+32,f=String.fromCharCode(h);t.shiftKey&&(f=f.toUpperCase()),a.key=le.ESC+f}else if(t.keyCode===32)a.key=le.ESC+(t.ctrlKey?le.NUL:" ");else if(t.key==="Dead"&&t.code.startsWith("Key")){let h=t.code.slice(3,4);t.shiftKey||(h=h.toLowerCase()),a.key=le.ESC+h,a.cancel=!0}}else i&&!t.altKey&&!t.ctrlKey&&!t.shiftKey&&t.metaKey?t.keyCode===65&&(a.type=1):t.key&&!t.ctrlKey&&!t.altKey&&!t.metaKey&&t.keyCode>=48&&t.key.length===1?a.key=t.key:t.key&&t.ctrlKey&&(t.key==="_"&&(a.key=le.US),t.key==="@"&&(a.key=le.NUL));break}return a}var li=0,IM=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new Xd,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new Xd,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((l,u)=>this._getKey(l)-this._getKey(u)),i=0,n=0,a=new Array(this._array.length+this._insertedValues.length);for(let l=0;l<a.length;l++)n>=this._array.length||this._getKey(e[i])<=this._getKey(this._array[n])?(a[l]=e[i],i++):a[l]=this._array[n++];this._array=a,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let i=this._getKey(e);if(i===void 0||(li=this._search(i),li===-1)||this._getKey(this._array[li])!==i)return!1;do if(this._array[li]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(li),!0;while(++li<this._array.length&&this._getKey(this._array[li])===i);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((l,u)=>l-u),i=0,n=new Array(this._array.length-e.length),a=0;for(let l=0;l<this._array.length;l++)e[i]===l?i++:n[a++]=this._array[l];this._array=n,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(li=this._search(e),!(li<0||li>=this._array.length)&&this._getKey(this._array[li])===e))do yield this._array[li];while(++li<this._array.length&&this._getKey(this._array[li])===e)}forEachByKey(e,i){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(li=this._search(e),!(li<0||li>=this._array.length)&&this._getKey(this._array[li])===e))do i(this._array[li]);while(++li<this._array.length&&this._getKey(this._array[li])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let i=0,n=this._array.length-1;for(;n>=i;){let a=i+n>>1,l=this._getKey(this._array[a]);if(l>e)n=a-1;else if(l<e)i=a+1;else{for(;a>0&&this._getKey(this._array[a-1])===e;)a--;return a}}return i}},ip=0,Zb=0,UM=class extends st{constructor(){super(),this._decorations=new IM(t=>t?.marker.line),this._onDecorationRegistered=this._register(new ge),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new ge),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(Wt(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(t){if(t.marker.isDisposed)return;let e=new FM(t);if(e){let i=e.marker.onDispose(()=>e.dispose()),n=e.onDispose(()=>{n.dispose(),e&&(this._decorations.delete(e)&&this._onDecorationRemoved.fire(e),i.dispose())});this._decorations.insert(e),this._onDecorationRegistered.fire(e)}return e}reset(){for(let t of this._decorations.values())t.dispose();this._decorations.clear()}*getDecorationsAtCell(t,e,i){let n=0,a=0;for(let l of this._decorations.getKeyIterator(e))n=l.options.x??0,a=n+(l.options.width??1),t>=n&&t<a&&(!i||(l.options.layer??"bottom")===i)&&(yield l)}forEachDecorationAtCell(t,e,i,n){this._decorations.forEachByKey(e,a=>{ip=a.options.x??0,Zb=ip+(a.options.width??1),t>=ip&&t<Zb&&(!i||(a.options.layer??"bottom")===i)&&n(a)})}},FM=class extends Ya{constructor(t){super(),this.options=t,this.onRenderEmitter=this.add(new ge),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new ge),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=t.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=Yt.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=Yt.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},$M=1e3,WM=class{constructor(e,i=$M){this._renderCallback=e,this._debounceThresholdMS=i,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,i,n){this._rowCount=n,e=e!==void 0?e:0,i=i!==void 0?i:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,i):i;let a=performance.now();if(a-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=a,this._innerRefresh();else if(!this._additionalRefreshRequested){let l=a-this._lastRefreshMs,u=this._debounceThresholdMS-l;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},u)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),i=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,i)}},Qb=20,Zd=class extends st{constructor(t,e,i,n){super(),this._terminal=t,this._coreBrowserService=i,this._renderService=n,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let a=this._coreBrowserService.mainDocument;this._accessibilityContainer=a.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=a.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let l=0;l<this._terminal.rows;l++)this._rowElements[l]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[l]);if(this._topBoundaryFocusListener=l=>this._handleBoundaryFocus(l,0),this._bottomBoundaryFocusListener=l=>this._handleBoundaryFocus(l,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=a.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new WM(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this._register(this._terminal.onResize(l=>this._handleResize(l.rows))),this._register(this._terminal.onRender(l=>this._refreshRows(l.start,l.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(l=>this._handleChar(l))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
22
|
+
`))),this._register(this._terminal.onA11yTab(l=>this._handleTab(l))),this._register(this._terminal.onKey(l=>this._handleKey(l.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(Ve(a,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(Wt(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(t){for(let e=0;e<t;e++)this._handleChar(" ")}_handleChar(t){this._liveRegionLineCount<Qb+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==t&&(this._charsToAnnounce+=t):this._charsToAnnounce+=t,t===`
|
|
23
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===Qb+1&&(this._liveRegion.textContent+=Dp.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(t){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(t)||this._charsToConsume.push(t)}_refreshRows(t,e){this._liveRegionDebouncer.refresh(t,e,this._terminal.rows)}_renderRows(t,e){let i=this._terminal.buffer,n=i.lines.length.toString();for(let a=t;a<=e;a++){let l=i.lines.get(i.ydisp+a),u=[],h=l?.translateToString(!0,void 0,void 0,u)||"",f=(i.ydisp+a+1).toString(),d=this._rowElements[a];d&&(h.length===0?(d.textContent=" ",this._rowColumns.set(d,[0,1])):(d.textContent=h,this._rowColumns.set(d,u)),d.setAttribute("aria-posinset",f),d.setAttribute("aria-setsize",n),this._alignRowWidth(d))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(t,e){let i=t.target,n=this._rowElements[e===0?1:this._rowElements.length-2],a=i.getAttribute("aria-posinset"),l=e===0?"1":`${this._terminal.buffer.lines.length}`;if(a===l||t.relatedTarget!==n)return;let u,h;if(e===0?(u=i,h=this._rowElements.pop(),this._rowContainer.removeChild(h)):(u=this._rowElements.shift(),h=i,this._rowContainer.removeChild(u)),u.removeEventListener("focus",this._topBoundaryFocusListener),h.removeEventListener("focus",this._bottomBoundaryFocusListener),e===0){let f=this._createAccessibilityTreeNode();this._rowElements.unshift(f),this._rowContainer.insertAdjacentElement("afterbegin",f)}else{let f=this._createAccessibilityTreeNode();this._rowElements.push(f),this._rowContainer.appendChild(f)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(e===0?-1:1),this._rowElements[e===0?1:this._rowElements.length-2].focus(),t.preventDefault(),t.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let t=this._coreBrowserService.mainDocument.getSelection();if(!t)return;if(t.isCollapsed){this._rowContainer.contains(t.anchorNode)&&this._terminal.clearSelection();return}if(!t.anchorNode||!t.focusNode){console.error("anchorNode and/or focusNode are null");return}let e={node:t.anchorNode,offset:t.anchorOffset},i={node:t.focusNode,offset:t.focusOffset};if((e.node.compareDocumentPosition(i.node)&Node.DOCUMENT_POSITION_PRECEDING||e.node===i.node&&e.offset>i.offset)&&([e,i]=[i,e]),e.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(e={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(e.node))return;let n=this._rowElements.slice(-1)[0];if(i.node.compareDocumentPosition(n)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(i={node:n,offset:n.textContent?.length??0}),!this._rowContainer.contains(i.node))return;let a=({node:h,offset:f})=>{let d=h instanceof Text?h.parentNode:h,p=parseInt(d?.getAttribute("aria-posinset"),10)-1;if(isNaN(p))return console.warn("row is invalid. Race condition?"),null;let v=this._rowColumns.get(d);if(!v)return console.warn("columns is null. Race condition?"),null;let g=f<v.length?v[f]:v.slice(-1)[0]+1;return g>=this._terminal.cols&&(++p,g=0),{row:p,column:g}},l=a(e),u=a(i);if(!(!l||!u)){if(l.row>u.row||l.row===u.row&&l.column>=u.column)throw new Error("invalid range");this._terminal.select(l.column,l.row,(u.row-l.row)*this._terminal.cols-l.column+u.column)}}_handleResize(t){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let t=this._coreBrowserService.mainDocument.createElement("div");return t.setAttribute("role","listitem"),t.tabIndex=-1,this._refreshRowDimensions(t),t}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let t=0;t<this._terminal.rows;t++)this._refreshRowDimensions(this._rowElements[t]),this._alignRowWidth(this._rowElements[t])}}_refreshRowDimensions(t){t.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(t){t.style.transform="";let e=t.getBoundingClientRect().width,i=this._rowColumns.get(t)?.slice(-1)?.[0];if(!i)return;let n=i*this._renderService.dimensions.css.cell.width;t.style.transform=`scaleX(${n/e})`}};Zd=si([we(1,Ug),we(2,Yn),we(3,Gn)],Zd);var fg=class extends st{constructor(t,e,i,n,a){super(),this._element=t,this._mouseService=e,this._renderService=i,this._bufferService=n,this._linkProviderService=a,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new ge),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new ge),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(Wt(()=>{Uo(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(Ve(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Ve(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(Ve(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(Ve(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(t){this._lastMouseEvent=t;let e=this._positionFromMouseEvent(t,this._element,this._mouseService);if(!e)return;this._isMouseOut=!1;let i=t.composedPath();for(let n=0;n<i.length;n++){let a=i[n];if(a.classList.contains("xterm"))break;if(a.classList.contains("xterm-hover"))return}(!this._lastBufferCell||e.x!==this._lastBufferCell.x||e.y!==this._lastBufferCell.y)&&(this._handleHover(e),this._lastBufferCell=e)}_handleHover(t){if(this._activeLine!==t.y||this._wasResized){this._clearCurrentLink(),this._askForLink(t,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,t)||(this._clearCurrentLink(),this._askForLink(t,!0))}_askForLink(t,e){(!this._activeProviderReplies||!e)&&(this._activeProviderReplies?.forEach(n=>{n?.forEach(a=>{a.link.dispose&&a.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=t.y);let i=!1;for(let[n,a]of this._linkProviderService.linkProviders.entries())e?this._activeProviderReplies?.get(n)&&(i=this._checkLinkProviderResult(n,t,i)):a.provideLinks(t.y,l=>{if(this._isMouseOut)return;let u=l?.map(h=>({link:h}));this._activeProviderReplies?.set(n,u),i=this._checkLinkProviderResult(n,t,i),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(t.y,this._activeProviderReplies)})}_removeIntersectingLinks(t,e){let i=new Set;for(let n=0;n<e.size;n++){let a=e.get(n);if(a)for(let l=0;l<a.length;l++){let u=a[l],h=u.link.range.start.y<t?0:u.link.range.start.x,f=u.link.range.end.y>t?this._bufferService.cols:u.link.range.end.x;for(let d=h;d<=f;d++){if(i.has(d)){a.splice(l--,1);break}i.add(d)}}}}_checkLinkProviderResult(t,e,i){if(!this._activeProviderReplies)return i;let n=this._activeProviderReplies.get(t),a=!1;for(let l=0;l<t;l++)(!this._activeProviderReplies.has(l)||this._activeProviderReplies.get(l))&&(a=!0);if(!a&&n){let l=n.find(u=>this._linkAtPosition(u.link,e));l&&(i=!0,this._handleNewLink(l))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!i)for(let l=0;l<this._activeProviderReplies.size;l++){let u=this._activeProviderReplies.get(l)?.find(h=>this._linkAtPosition(h.link,e));if(u){i=!0,this._handleNewLink(u);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(t){if(!this._currentLink)return;let e=this._positionFromMouseEvent(t,this._element,this._mouseService);e&&this._mouseDownLink&&jM(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,e)&&this._currentLink.link.activate(t,this._currentLink.link.text)}_clearCurrentLink(t,e){!this._currentLink||!this._lastMouseEvent||(!t||!e||this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=e)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,Uo(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(t){if(!this._lastMouseEvent)return;let e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._linkAtPosition(t.link,e)&&(this._currentLink=t,this._currentLink.state={decorations:{underline:t.link.decorations===void 0?!0:t.link.decorations.underline,pointerCursor:t.link.decorations===void 0?!0:t.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,t.link,this._lastMouseEvent),t.link.decorations={},Object.defineProperties(t.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:i=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==i&&(this._currentLink.state.decorations.pointerCursor=i,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",i))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:i=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==i&&(this._currentLink.state.decorations.underline=i,this._currentLink.state.isHovered&&this._fireUnderlineEvent(t.link,i))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(i=>{if(!this._currentLink)return;let n=i.start===0?0:i.start+1+this._bufferService.buffer.ydisp,a=this._bufferService.buffer.ydisp+1+i.end;if(this._currentLink.link.range.start.y>=n&&this._currentLink.link.range.end.y<=a&&(this._clearCurrentLink(n,a),this._lastMouseEvent)){let l=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);l&&this._askForLink(l,!1)}})))}_linkHover(t,e,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!0),this._currentLink.state.decorations.pointerCursor&&t.classList.add("xterm-cursor-pointer")),e.hover&&e.hover(i,e.text)}_fireUnderlineEvent(t,e){let i=t.range,n=this._bufferService.buffer.ydisp,a=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-n-1,i.end.x,i.end.y-n-1,void 0);(e?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(a)}_linkLeave(t,e,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!1),this._currentLink.state.decorations.pointerCursor&&t.classList.remove("xterm-cursor-pointer")),e.leave&&e.leave(i,e.text)}_linkAtPosition(t,e){let i=t.range.start.y*this._bufferService.cols+t.range.start.x,n=t.range.end.y*this._bufferService.cols+t.range.end.x,a=e.y*this._bufferService.cols+e.x;return i<=a&&a<=n}_positionFromMouseEvent(t,e,i){let n=i.getCoords(t,e,this._bufferService.cols,this._bufferService.rows);if(n)return{x:n[0],y:n[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(t,e,i,n,a){return{x1:t,y1:e,x2:i,y2:n,cols:this._bufferService.cols,fg:a}}};fg=si([we(1,Fg),we(2,Gn),we(3,hs),we(4,tC)],fg);function jM(t,e){return t.text===e.text&&t.range.start.x===e.range.start.x&&t.range.start.y===e.range.start.y&&t.range.end.x===e.range.end.x&&t.range.end.y===e.range.end.y}var VM=class extends PM{constructor(e={}){super(e),this._linkifier=this._register(new Gl),this.browser=yC,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new Gl),this._onCursorMove=this._register(new ge),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new ge),this.onKey=this._onKey.event,this._onRender=this._register(new ge),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new ge),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new ge),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new ge),this.onBell=this._onBell.event,this._onFocus=this._register(new ge),this._onBlur=this._register(new ge),this._onA11yCharEmitter=this._register(new ge),this._onA11yTabEmitter=this._register(new ge),this._onWillOpen=this._register(new ge),this._setup(),this._decorationService=this._instantiationService.createInstance(UM),this._instantiationService.setService(Nu,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(BA),this._instantiationService.setService(tC,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(Bp)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(i=>this.refresh(i?.start??0,i?.end??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(i=>this._reportWindowsOptions(i))),this._register(this._inputHandler.onColor(i=>this._handleColorEvent(i))),this._register(Zi.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(Zi.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(Zi.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(Zi.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(i=>this._afterResize(i.cols,i.rows))),this._register(Wt(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let i of e){let n,a="";switch(i.index){case 256:n="foreground",a="10";break;case 257:n="background",a="11";break;case 258:n="cursor",a="12";break;default:n="ansi",a="4;"+i.index}switch(i.type){case 0:let l=Ht.toColorRGB(n==="ansi"?this._themeService.colors.ansi[i.index]:this._themeService.colors[n]);this.coreService.triggerDataEvent(`${le.ESC}]${a};${MM(l)}${vC.ST}`);break;case 1:if(n==="ansi")this._themeService.modifyColors(u=>u.ansi[i.index]=gi.toColor(...i.color));else{let u=n;this._themeService.modifyColors(h=>h[u]=gi.toColor(...i.color))}break;case 2:this._themeService.restoreColor(i.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Zd,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(le.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(le.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,i=this.buffer.lines.get(e);if(!i)return;let n=Math.min(this.buffer.x,this.cols-1),a=this._renderService.dimensions.css.cell.height,l=i.getWidth(n),u=this._renderService.dimensions.css.cell.width*l,h=this.buffer.y*this._renderService.dimensions.css.cell.height,f=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=f+"px",this.textarea.style.top=h+"px",this.textarea.style.width=u+"px",this.textarea.style.height=a+"px",this.textarea.style.lineHeight=a+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(Ve(this.element,"copy",i=>{this.hasSelection()&&KT(i,this._selectionService)}));let e=i=>XT(i,this.textarea,this.coreService,this.optionsService);this._register(Ve(this.textarea,"paste",e)),this._register(Ve(this.element,"paste",e)),bC?this._register(Ve(this.element,"mousedown",i=>{i.button===2&&lb(i,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Ve(this.element,"contextmenu",i=>{lb(i,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),Kg&&this._register(Ve(this.element,"auxclick",i=>{i.button===1&&qw(i,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Ve(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(Ve(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(Ve(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(Ve(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(Ve(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(Ve(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(Ve(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),e.appendChild(this.element);let i=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),i.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(Ve(this.screenElement,"mousemove",l=>this.updateCursorStyle(l))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),i.appendChild(this.screenElement);let n=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",Lp.get()),xC||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>n.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(DA,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(Yn,this._coreBrowserService),this._register(Ve(this.textarea,"focus",l=>this._handleTextAreaFocus(l))),this._register(Ve(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(tg,this._document,this._helperContainer),this._instantiationService.setService(cf,this._charSizeService),this._themeService=this._instantiationService.createInstance(ng),this._instantiationService.setService(Zl,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(Gd),this._instantiationService.setService(eC,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(sg,this.rows,this.screenElement)),this._instantiationService.setService(Gn,this._renderService),this._register(this._renderService.onRenderedViewportChange(l=>this._onRender.fire(l))),this.onResize(l=>this._renderService.resize(l.cols,l.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(Qp,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(ig),this._instantiationService.setService(Fg,this._mouseService);let a=this._linkifier.value=this._register(this._instantiationService.createInstance(fg,this.screenElement));this.element.appendChild(i);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(Xp,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(l=>{super.scrollLines(l,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(rg,this.element,this.screenElement,a)),this._instantiationService.setService(rR,this._selectionService),this._register(this._selectionService.onRequestScrollLines(l=>this.scrollLines(l.amount,l.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(l=>this._renderService.handleSelectionChanged(l.start,l.end,l.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(l=>{this.textarea.value=l,this.textarea.focus(),this.textarea.select()})),this._register(Zi.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(Zp,this.screenElement)),this._register(Ve(this.element,"mousedown",l=>this._selectionService.handleMouseDown(l))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(Zd,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",l=>this._handleScreenReaderModeOptionChange(l))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Yd,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",l=>{!this._overviewRulerRenderer&&l&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Yd,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(eg,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,i=this.element;function n(u){let h=e._mouseService.getMouseReportCoords(u,e.screenElement);if(!h)return!1;let f,d;switch(u.overrideType||u.type){case"mousemove":d=32,u.buttons===void 0?(f=3,u.button!==void 0&&(f=u.button<3?u.button:3)):f=u.buttons&1?0:u.buttons&4?1:u.buttons&2?2:3;break;case"mouseup":d=0,f=u.button<3?u.button:3;break;case"mousedown":d=1,f=u.button<3?u.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(u)===!1)return!1;let p=u.deltaY;if(p===0||e.coreMouseService.consumeWheelEvent(u,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;d=p<0?0:1,f=4;break;default:return!1}return d===void 0||f===void 0||f>4?!1:e.coreMouseService.triggerMouseEvent({col:h.col,row:h.row,x:h.x,y:h.y,button:f,action:d,ctrl:u.ctrlKey,alt:u.altKey,shift:u.shiftKey})}let a={mouseup:null,wheel:null,mousedrag:null,mousemove:null},l={mouseup:u=>(n(u),u.buttons||(this._document.removeEventListener("mouseup",a.mouseup),a.mousedrag&&this._document.removeEventListener("mousemove",a.mousedrag)),this.cancel(u)),wheel:u=>(n(u),this.cancel(u,!0)),mousedrag:u=>{u.buttons&&n(u)},mousemove:u=>{u.buttons||n(u)}};this._register(this.coreMouseService.onProtocolChange(u=>{u?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(u)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),u&8?a.mousemove||(i.addEventListener("mousemove",l.mousemove),a.mousemove=l.mousemove):(i.removeEventListener("mousemove",a.mousemove),a.mousemove=null),u&16?a.wheel||(i.addEventListener("wheel",l.wheel,{passive:!1}),a.wheel=l.wheel):(i.removeEventListener("wheel",a.wheel),a.wheel=null),u&2?a.mouseup||(a.mouseup=l.mouseup):(this._document.removeEventListener("mouseup",a.mouseup),a.mouseup=null),u&4?a.mousedrag||(a.mousedrag=l.mousedrag):(this._document.removeEventListener("mousemove",a.mousedrag),a.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Ve(i,"mousedown",u=>{if(u.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(u)))return n(u),a.mouseup&&this._document.addEventListener("mouseup",a.mouseup),a.mousedrag&&this._document.addEventListener("mousemove",a.mousedrag),this.cancel(u)})),this._register(Ve(i,"wheel",u=>{if(!a.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(u)===!1)return!1;if(!this.buffer.hasScrollback){if(u.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(u,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(u,!0);let h=le.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(u.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(h,!0),this.cancel(u,!0)}}},{passive:!1}))}refresh(e,i){this._renderService?.refreshRows(e,i)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,i){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,i),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let i=e-this._bufferService.buffer.ydisp;i!==0&&this.scrollLines(i)}paste(e){Vw(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let i=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),i}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,i,n){this._selectionService.setSelection(e,i,n)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,i){this._selectionService?.selectLines(e,i)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let i=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!i&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!i&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let n=HM(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),n.type===3||n.type===2){let a=this.rows-1;return this.scrollLines(n.type===2?-a:a),this.cancel(e,!0)}if(n.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(n.cancel&&this.cancel(e,!0),!n.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((n.key===le.ETX||n.key===le.CR)&&(this.textarea.value=""),this._onKey.fire({key:n.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(n.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,i){let n=e.isMac&&!this.options.macOptionIsMeta&&i.altKey&&!i.ctrlKey&&!i.metaKey||e.isWindows&&i.altKey&&i.ctrlKey&&!i.metaKey||e.isWindows&&i.getModifierState("AltGraph");return i.type==="keypress"?n:n&&(!i.keyCode||i.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(qM(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let i;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)i=e.charCode;else if(e.which===null||e.which===void 0)i=e.keyCode;else if(e.which!==0&&e.charCode!==0)i=e.which;else return!1;return!i||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(i=String.fromCharCode(i),this._onKey.fire({key:i,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(i,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let i=e.data;return this.coreService.triggerDataEvent(i,!0),this.cancel(e),!0}return!1}resize(e,i){if(e===this.cols&&i===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,i)}_afterResize(e,i){this._charSizeService?.measure()}clear(){if(!(this.buffer.ybase===0&&this.buffer.y===0)){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(_i));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(le.ESC+"[I"):this.coreService.triggerDataEvent(le.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let i=this._renderService.dimensions.css.canvas.width.toFixed(0),n=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${le.ESC}[4;${n};${i}t`);break;case 1:let a=this._renderService.dimensions.css.cell.width.toFixed(0),l=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${le.ESC}[6;${l};${a}t`);break}}cancel(e,i){if(!(!this.options.cancelEvents&&!i))return e.preventDefault(),e.stopPropagation(),!1}};function qM(t){return t.keyCode===16||t.keyCode===17||t.keyCode===18}var YM=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,i){let n={instance:i,dispose:i.dispose,isDisposed:!1};this._addons.push(n),i.dispose=()=>this._wrappedAddonDispose(n),i.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let i=-1;for(let n=0;n<this._addons.length;n++)if(this._addons[n]===e){i=n;break}if(i===-1)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(i,1)}},GM=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,i){if(!(e<0||e>=this._line.length))return i?(this._line.loadCell(e,i),i):this._line.loadCell(e,new Cr)}translateToString(e,i,n){return this._line.translateToString(e,i,n)}},Jb=class{constructor(t,e){this._buffer=t,this.type=e}init(t){return this._buffer=t,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(t){let e=this._buffer.lines.get(t);if(e)return new GM(e)}getNullCell(){return new Cr}},KM=class extends st{constructor(t){super(),this._core=t,this._onBufferChange=this._register(new ge),this.onBufferChange=this._onBufferChange.event,this._normal=new Jb(this._core.buffers.normal,"normal"),this._alternate=new Jb(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)}},XM=class{constructor(t){this._core=t}registerCsiHandler(t,e){return this._core.registerCsiHandler(t,i=>e(i.toArray()))}addCsiHandler(t,e){return this.registerCsiHandler(t,e)}registerDcsHandler(t,e){return this._core.registerDcsHandler(t,(i,n)=>e(i,n.toArray()))}addDcsHandler(t,e){return this.registerDcsHandler(t,e)}registerEscHandler(t,e){return this._core.registerEscHandler(t,e)}addEscHandler(t,e){return this.registerEscHandler(t,e)}registerOscHandler(t,e){return this._core.registerOscHandler(t,e)}addOscHandler(t,e){return this.registerOscHandler(t,e)}},ZM=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}},QM=["cols","rows"],Qr=0,JM=class extends st{constructor(t){super(),this._core=this._register(new VM(t)),this._addonManager=this._register(new YM),this._publicOptions={...this._core.options};let e=n=>this._core.options[n],i=(n,a)=>{this._checkReadonlyOptions(n),this._core.options[n]=a};for(let n in this._core.options){let a={get:e.bind(this,n),set:i.bind(this,n)};Object.defineProperty(this._publicOptions,n,a)}}_checkReadonlyOptions(t){if(QM.includes(t))throw new Error(`Option "${t}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new XM(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new ZM(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 KM(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let t=this._core.coreService.decPrivateModes,e="none";switch(this._core.coreMouseService.activeProtocol){case"X10":e="x10";break;case"VT200":e="vt200";break;case"DRAG":e="drag";break;case"ANY":e="any";break}return{applicationCursorKeysMode:t.applicationCursorKeys,applicationKeypadMode:t.applicationKeypad,bracketedPasteMode:t.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:e,originMode:t.origin,reverseWraparoundMode:t.reverseWraparound,sendFocusMode:t.sendFocus,synchronizedOutputMode:t.synchronizedOutput,wraparoundMode:t.wraparound}}get options(){return this._publicOptions}set options(t){for(let e in t)this._publicOptions[e]=t[e]}blur(){this._core.blur()}focus(){this._core.focus()}input(t,e=!0){this._core.input(t,e)}resize(t,e){this._verifyIntegers(t,e),this._core.resize(t,e)}open(t){this._core.open(t)}attachCustomKeyEventHandler(t){this._core.attachCustomKeyEventHandler(t)}attachCustomWheelEventHandler(t){this._core.attachCustomWheelEventHandler(t)}registerLinkProvider(t){return this._core.registerLinkProvider(t)}registerCharacterJoiner(t){return this._checkProposedApi(),this._core.registerCharacterJoiner(t)}deregisterCharacterJoiner(t){this._checkProposedApi(),this._core.deregisterCharacterJoiner(t)}registerMarker(t=0){return this._verifyIntegers(t),this._core.registerMarker(t)}registerDecoration(t){return this._checkProposedApi(),this._verifyPositiveIntegers(t.x??0,t.width??0,t.height??0),this._core.registerDecoration(t)}hasSelection(){return this._core.hasSelection()}select(t,e,i){this._verifyIntegers(t,e,i),this._core.select(t,e,i)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(t,e){this._verifyIntegers(t,e),this._core.selectLines(t,e)}dispose(){super.dispose()}scrollLines(t){this._verifyIntegers(t),this._core.scrollLines(t)}scrollPages(t){this._verifyIntegers(t),this._core.scrollPages(t)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(t){this._verifyIntegers(t),this._core.scrollToLine(t)}clear(){this._core.clear()}write(t,e){this._core.write(t,e)}writeln(t,e){this._core.write(t),this._core.write(`\r
|
|
24
|
+
`,e)}paste(t){this._core.paste(t)}refresh(t,e){this._verifyIntegers(t,e),this._core.refresh(t,e)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(t){this._addonManager.loadAddon(this,t)}static get strings(){return{get promptLabel(){return Lp.get()},set promptLabel(t){Lp.set(t)},get tooMuchOutput(){return Dp.get()},set tooMuchOutput(t){Dp.set(t)}}}_verifyIntegers(...t){for(Qr of t)if(Qr===1/0||isNaN(Qr)||Qr%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...t){for(Qr of t)if(Qr&&(Qr===1/0||isNaN(Qr)||Qr%1!==0||Qr<0))throw new Error("This API only accepts positive integers")}};var eL=2,tL=1,iL=class{activate(t){this._terminal=t}dispose(){}fit(){let t=this.proposeDimensions();if(!t||!this._terminal||isNaN(t.cols)||isNaN(t.rows))return;let e=this._terminal._core;(this._terminal.rows!==t.rows||this._terminal.cols!==t.cols)&&(e._renderService.clear(),this._terminal.resize(t.cols,t.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let t=this._terminal._core._renderService.dimensions;if(t.css.cell.width===0||t.css.cell.height===0)return;let e=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,i=window.getComputedStyle(this._terminal.element.parentElement),n=parseInt(i.getPropertyValue("height")),a=Math.max(0,parseInt(i.getPropertyValue("width"))),l=window.getComputedStyle(this._terminal.element),u={top:parseInt(l.getPropertyValue("padding-top")),bottom:parseInt(l.getPropertyValue("padding-bottom")),right:parseInt(l.getPropertyValue("padding-right")),left:parseInt(l.getPropertyValue("padding-left"))},h=u.top+u.bottom,f=u.right+u.left,d=n-h,p=a-f-e;return{cols:Math.max(eL,Math.floor(p/t.css.cell.width)),rows:Math.max(tL,Math.floor(d/t.css.cell.height))}}};var sL=class{constructor(t,e,i,n={}){this._terminal=t,this._regex=e,this._handler=i,this._options=n}provideLinks(t,e){let i=nL.computeLink(t,this._regex,this._terminal,this._handler);e(this._addCallbacks(i))}_addCallbacks(t){return t.map(e=>(e.leave=this._options.leave,e.hover=(i,n)=>{if(this._options.hover){let{range:a}=e;this._options.hover(i,n,a)}},e))}};function rL(t){try{let e=new URL(t),i=e.password&&e.username?`${e.protocol}//${e.username}:${e.password}@${e.host}`:e.username?`${e.protocol}//${e.username}@${e.host}`:`${e.protocol}//${e.host}`;return t.toLocaleLowerCase().startsWith(i.toLocaleLowerCase())}catch{return!1}}var nL=class Td{static computeLink(e,i,n,a){let l=new RegExp(i.source,(i.flags||"")+"g"),[u,h]=Td._getWindowedLineStrings(e-1,n),f=u.join(""),d,p=[];for(;d=l.exec(f);){let v=d[0];if(!rL(v))continue;let[g,S]=Td._mapStrIdx(n,h,0,d.index),[b,C]=Td._mapStrIdx(n,g,S,v.length);if(g===-1||S===-1||b===-1||C===-1)continue;let x={start:{x:S+1,y:g+1},end:{x:C,y:b+1}};p.push({range:x,text:v,activate:a})}return p}static _getWindowedLineStrings(e,i){let n,a=e,l=e,u=0,h="",f=[];if(n=i.buffer.active.getLine(e)){let d=n.translateToString(!0);if(n.isWrapped&&d[0]!==" "){for(u=0;(n=i.buffer.active.getLine(--a))&&u<2048&&(h=n.translateToString(!0),u+=h.length,f.push(h),!(!n.isWrapped||h.indexOf(" ")!==-1)););f.reverse()}for(f.push(d),u=0;(n=i.buffer.active.getLine(++l))&&n.isWrapped&&u<2048&&(h=n.translateToString(!0),u+=h.length,f.push(h),h.indexOf(" ")===-1););}return[f,a]}static _mapStrIdx(e,i,n,a){let l=e.buffer.active,u=l.getNullCell(),h=n;for(;a;){let f=l.getLine(i);if(!f)return[-1,-1];for(let d=h;d<f.length;++d){f.getCell(d,u);let p=u.getChars();if(u.getWidth()&&(a-=p.length||1,d===f.length-1&&p==="")){let v=l.getLine(i+1);v&&v.isWrapped&&(v.getCell(0,u),u.getWidth()===2&&(a+=1))}if(a<0)return[i,d]}i++,h=0}return[i,h]}},aL=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function oL(t,e){let i=window.open();if(i){try{i.opener=null}catch{}i.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}var lL=class{constructor(e=oL,i={}){this._handler=e,this._options=i}activate(e){this._terminal=e;let i=this._options,n=i.urlRegex||aL;this._linkProvider=this._terminal.registerLinkProvider(new sL(this._terminal,n,this._handler,i))}dispose(){this._linkProvider?.dispose()}};var cL=(t,e,i,n)=>{for(var a=e,l=t.length-1,u;l>=0;l--)(u=t[l])&&(a=u(a)||a);return a},uL=(t,e)=>(i,n)=>e(i,n,t),hL=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?e1.isErrorNoTelemetry(t)?new e1(t.message+`
|
|
25
|
+
|
|
26
|
+
`+t.stack):new Error(t.message+`
|
|
27
|
+
|
|
28
|
+
`+t.stack):t},0)}}addListener(t){return this.listeners.push(t),()=>{this._removeListener(t)}}emit(t){this.listeners.forEach(e=>{e(t)})}_removeListener(t){this.listeners.splice(this.listeners.indexOf(t),1)}setUnexpectedErrorHandler(t){this.unexpectedErrorHandler=t}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}},dL=new hL;function sp(t){fL(t)||dL.onUnexpectedError(t)}var mg="Canceled";function fL(t){return t instanceof mL?!0:t instanceof Error&&t.name===mg&&t.message===mg}var mL=class extends Error{constructor(){super(mg),this.name=this.message}},e1=class _g extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof _g)return e;let i=new _g;return i.message=e.message,i.stack=e.stack,i}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}},_L;(t=>{function e(l){return l<0}t.isLessThan=e;function i(l){return l<=0}t.isLessThanOrEqual=i;function n(l){return l>0}t.isGreaterThan=n;function a(l){return l===0}t.isNeitherLessOrGreaterThan=a,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(_L||={});function pL(t,e){let i=this,n=!1,a;return function(){return n||(n=!0,e||(a=t.apply(i,arguments))),a}}var BC;(t=>{function e(R){return R&&typeof R=="object"&&typeof R[Symbol.iterator]=="function"}t.is=e;let i=Object.freeze([]);function n(){return i}t.empty=n;function*a(R){yield R}t.single=a;function l(R){return e(R)?R:a(R)}t.wrap=l;function u(R){return R||i}t.from=u;function*h(R){for(let $=R.length-1;$>=0;$--)yield R[$]}t.reverse=h;function f(R){return!R||R[Symbol.iterator]().next().done===!0}t.isEmpty=f;function d(R){return R[Symbol.iterator]().next().value}t.first=d;function p(R,$){let F=0;for(let U of R)if($(U,F++))return!0;return!1}t.some=p;function v(R,$){for(let F of R)if($(F))return F}t.find=v;function*g(R,$){for(let F of R)$(F)&&(yield F)}t.filter=g;function*S(R,$){let F=0;for(let U of R)yield $(U,F++)}t.map=S;function*b(R,$){let F=0;for(let U of R)yield*$(U,F++)}t.flatMap=b;function*C(...R){for(let $ of R)yield*$}t.concat=C;function x(R,$,F){let U=F;for(let z of R)U=$(U,z);return U}t.reduce=x;function*E(R,$,F=R.length){for($<0&&($+=R.length),F<0?F+=R.length:F>R.length&&(F=R.length);$<F;$++)yield R[$]}t.slice=E;function A(R,$=Number.POSITIVE_INFINITY){let F=[];if($===0)return[F,R];let U=R[Symbol.iterator]();for(let z=0;z<$;z++){let V=U.next();if(V.done)return[F,t.empty()];F.push(V.value)}return[F,{[Symbol.iterator](){return U}}]}t.consume=A;async function B(R){let $=[];for await(let F of R)$.push(F);return Promise.resolve($)}t.asyncToArray=B})(BC||={});function NC(t){if(BC.is(t)){let e=[];for(let i of t)if(i)try{i.dispose()}catch(n){e.push(n)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function PC(...t){return is(()=>NC(t))}function is(t){return{dispose:pL(()=>{t()})}}var zC=class HC{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{NC(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?HC.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),void 0)}};zC.DISABLE_DISPOSED_WARNING=!1;var jl=zC,Ir=class{constructor(){this._store=new jl,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};Ir.None=Object.freeze({dispose(){}});var lu=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}},Xg=typeof process<"u"&&"title"in process,df=Xg?"node":navigator.userAgent,gL=Xg?"node":navigator.platform,vL=df.includes("Firefox"),SL=df.includes("Edge"),IC=/^((?!chrome|android).)*safari/i.test(df);function yL(){if(!IC)return 0;let t=df.match(/Version\/(\d+)/);return t===null||t.length<2?0:parseInt(t[1])}gL.indexOf("Linux")>=0;var bL="",Pi=0,zi=0,Hi=0,ii=0,gr={css:"#00000000",rgba:0},us;(t=>{function e(a,l,u,h){return h!==void 0?`#${ko(a)}${ko(l)}${ko(u)}${ko(h)}`:`#${ko(a)}${ko(l)}${ko(u)}`}t.toCss=e;function i(a,l,u,h=255){return(a<<24|l<<16|u<<8|h)>>>0}t.toRgba=i;function n(a,l,u,h){return{css:t.toCss(a,l,u,h),rgba:t.toRgba(a,l,u,h)}}t.toColor=n})(us||={});var yu;(t=>{function e(f,d){if(ii=(d.rgba&255)/255,ii===1)return{css:d.css,rgba:d.rgba};let p=d.rgba>>24&255,v=d.rgba>>16&255,g=d.rgba>>8&255,S=f.rgba>>24&255,b=f.rgba>>16&255,C=f.rgba>>8&255;Pi=S+Math.round((p-S)*ii),zi=b+Math.round((v-b)*ii),Hi=C+Math.round((g-C)*ii);let x=us.toCss(Pi,zi,Hi),E=us.toRgba(Pi,zi,Hi);return{css:x,rgba:E}}t.blend=e;function i(f){return(f.rgba&255)===255}t.isOpaque=i;function n(f,d,p){let v=No.ensureContrastRatio(f.rgba,d.rgba,p);if(v)return us.toColor(v>>24&255,v>>16&255,v>>8&255)}t.ensureContrastRatio=n;function a(f){let d=(f.rgba|255)>>>0;return[Pi,zi,Hi]=No.toChannels(d),{css:us.toCss(Pi,zi,Hi),rgba:d}}t.opaque=a;function l(f,d){return ii=Math.round(d*255),[Pi,zi,Hi]=No.toChannels(f.rgba),{css:us.toCss(Pi,zi,Hi,ii),rgba:us.toRgba(Pi,zi,Hi,ii)}}t.opacity=l;function u(f,d){return ii=f.rgba&255,l(f,ii*d/255)}t.multiplyOpacity=u;function h(f){return[f.rgba>>24&255,f.rgba>>16&255,f.rgba>>8&255]}t.toColorRGB=h})(yu||={});var wL;(t=>{let e,i;try{let a=document.createElement("canvas");a.width=1,a.height=1;let l=a.getContext("2d",{willReadFrequently:!0});l&&(e=l,e.globalCompositeOperation="copy",i=e.createLinearGradient(0,0,1,1))}catch{}function n(a){if(a.match(/#[\da-f]{3,8}/i))switch(a.length){case 4:return Pi=parseInt(a.slice(1,2).repeat(2),16),zi=parseInt(a.slice(2,3).repeat(2),16),Hi=parseInt(a.slice(3,4).repeat(2),16),us.toColor(Pi,zi,Hi);case 5:return Pi=parseInt(a.slice(1,2).repeat(2),16),zi=parseInt(a.slice(2,3).repeat(2),16),Hi=parseInt(a.slice(3,4).repeat(2),16),ii=parseInt(a.slice(4,5).repeat(2),16),us.toColor(Pi,zi,Hi,ii);case 7:return{css:a,rgba:(parseInt(a.slice(1),16)<<8|255)>>>0};case 9:return{css:a,rgba:parseInt(a.slice(1),16)>>>0}}let l=a.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(l)return Pi=parseInt(l[1]),zi=parseInt(l[2]),Hi=parseInt(l[3]),ii=Math.round((l[5]===void 0?1:parseFloat(l[5]))*255),us.toColor(Pi,zi,Hi,ii);if(!e||!i)throw new Error("css.toColor: Unsupported css format");if(e.fillStyle=i,e.fillStyle=a,typeof e.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(e.fillRect(0,0,1,1),[Pi,zi,Hi,ii]=e.getImageData(0,0,1,1).data,ii!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:us.toRgba(Pi,zi,Hi,ii),css:a}}t.toColor=n})(wL||={});var cs;(t=>{function e(n){return i(n>>16&255,n>>8&255,n&255)}t.relativeLuminance=e;function i(n,a,l){let u=n/255,h=a/255,f=l/255,d=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4),p=h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4),v=f<=.03928?f/12.92:Math.pow((f+.055)/1.055,2.4);return d*.2126+p*.7152+v*.0722}t.relativeLuminance2=i})(cs||={});var No;(t=>{function e(u,h){if(ii=(h&255)/255,ii===1)return h;let f=h>>24&255,d=h>>16&255,p=h>>8&255,v=u>>24&255,g=u>>16&255,S=u>>8&255;return Pi=v+Math.round((f-v)*ii),zi=g+Math.round((d-g)*ii),Hi=S+Math.round((p-S)*ii),us.toRgba(Pi,zi,Hi)}t.blend=e;function i(u,h,f){let d=cs.relativeLuminance(u>>8),p=cs.relativeLuminance(h>>8);if(Nn(d,p)<f){if(p<d){let S=n(u,h,f),b=Nn(d,cs.relativeLuminance(S>>8));if(b<f){let C=a(u,h,f),x=Nn(d,cs.relativeLuminance(C>>8));return b>x?S:C}return S}let v=a(u,h,f),g=Nn(d,cs.relativeLuminance(v>>8));if(g<f){let S=n(u,h,f),b=Nn(d,cs.relativeLuminance(S>>8));return g>b?v:S}return v}}t.ensureContrastRatio=i;function n(u,h,f){let d=u>>24&255,p=u>>16&255,v=u>>8&255,g=h>>24&255,S=h>>16&255,b=h>>8&255,C=Nn(cs.relativeLuminance2(g,S,b),cs.relativeLuminance2(d,p,v));for(;C<f&&(g>0||S>0||b>0);)g-=Math.max(0,Math.ceil(g*.1)),S-=Math.max(0,Math.ceil(S*.1)),b-=Math.max(0,Math.ceil(b*.1)),C=Nn(cs.relativeLuminance2(g,S,b),cs.relativeLuminance2(d,p,v));return(g<<24|S<<16|b<<8|255)>>>0}t.reduceLuminance=n;function a(u,h,f){let d=u>>24&255,p=u>>16&255,v=u>>8&255,g=h>>24&255,S=h>>16&255,b=h>>8&255,C=Nn(cs.relativeLuminance2(g,S,b),cs.relativeLuminance2(d,p,v));for(;C<f&&(g<255||S<255||b<255);)g=Math.min(255,g+Math.ceil((255-g)*.1)),S=Math.min(255,S+Math.ceil((255-S)*.1)),b=Math.min(255,b+Math.ceil((255-b)*.1)),C=Nn(cs.relativeLuminance2(g,S,b),cs.relativeLuminance2(d,p,v));return(g<<24|S<<16|b<<8|255)>>>0}t.increaseLuminance=a;function l(u){return[u>>24&255,u>>16&255,u>>8&255,u&255]}t.toChannels=l})(No||={});function ko(t){let e=t.toString(16);return e.length<2?"0"+e:e}function Nn(t,e){return t<e?(e+.05)/(t+.05):(t+.05)/(e+.05)}function pi(t){if(!t)throw new Error("value must not be falsy");return t}function Zg(t){return 57508<=t&&t<=57558}function CL(t){return 57520<=t&&t<=57527}function xL(t){return 57344<=t&&t<=63743}function kL(t){return 9472<=t&&t<=9631}function EL(t){return t>=128512&&t<=128591||t>=127744&&t<=128511||t>=128640&&t<=128767||t>=9728&&t<=9983||t>=9984&&t<=10175||t>=65024&&t<=65039||t>=129280&&t<=129535||t>=127462&&t<=127487}function TL(t,e,i,n){return e===1&&i>Math.ceil(n*1.5)&&t!==void 0&&t>255&&!EL(t)&&!Zg(t)&&!xL(t)}function UC(t){return Zg(t)||kL(t)}function RL(){return{css:{canvas:cd(),cell:cd()},device:{canvas:cd(),cell:cd(),char:{width:0,height:0,left:0,top:0}}}}function cd(){return{width:0,height:0}}function AL(t,e,i=0){return(t-(Math.round(e)*2-i))%(Math.round(e)*2)}var Xi=0,Li=0,Jr=!1,Pn=!1,ud=!1,ws,rp=0,ML=class{constructor(t,e,i,n,a,l){this._terminal=t,this._optionService=e,this._selectionRenderModel=i,this._decorationService=n,this._coreBrowserService=a,this._themeService=l,this.result={fg:0,bg:0,ext:0}}resolve(t,e,i,n){if(this.result.bg=t.bg,this.result.fg=t.fg,this.result.ext=t.bg&268435456?t.extended.ext:0,Li=0,Xi=0,Pn=!1,Jr=!1,ud=!1,ws=this._themeService.colors,rp=0,t.getCode()!==0&&t.extended.underlineStyle===4){let a=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));rp=e*n%(Math.round(a)*2)}if(this._decorationService.forEachDecorationAtCell(e,i,"bottom",a=>{a.backgroundColorRGB&&(Li=a.backgroundColorRGB.rgba>>8&16777215,Pn=!0),a.foregroundColorRGB&&(Xi=a.foregroundColorRGB.rgba>>8&16777215,Jr=!0)}),ud=this._selectionRenderModel.isCellSelected(this._terminal,e,i),ud){if(this.result.fg&67108864||(this.result.bg&50331648)!==0){if(this.result.fg&67108864)switch(this.result.fg&50331648){case 16777216:case 33554432:Li=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:Li=(this.result.fg&16777215)<<8|255;break;default:Li=this._themeService.colors.foreground.rgba}else switch(this.result.bg&50331648){case 16777216:case 33554432:Li=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:Li=(this.result.bg&16777215)<<8|255;break}Li=No.blend(Li,(this._coreBrowserService.isFocused?ws.selectionBackgroundOpaque:ws.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}else Li=(this._coreBrowserService.isFocused?ws.selectionBackgroundOpaque:ws.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(Pn=!0,ws.selectionForeground&&(Xi=ws.selectionForeground.rgba>>8&16777215,Jr=!0),UC(t.getCode())){if(this.result.fg&67108864&&(this.result.bg&50331648)===0)Xi=(this._coreBrowserService.isFocused?ws.selectionBackgroundOpaque:ws.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(this.result.fg&67108864)switch(this.result.bg&50331648){case 16777216:case 33554432:Xi=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:Xi=(this.result.bg&16777215)<<8|255;break}else switch(this.result.fg&50331648){case 16777216:case 33554432:Xi=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:Xi=(this.result.fg&16777215)<<8|255;break;default:Xi=this._themeService.colors.foreground.rgba}Xi=No.blend(Xi,(this._coreBrowserService.isFocused?ws.selectionBackgroundOpaque:ws.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}Jr=!0}}this._decorationService.forEachDecorationAtCell(e,i,"top",a=>{a.backgroundColorRGB&&(Li=a.backgroundColorRGB.rgba>>8&16777215,Pn=!0),a.foregroundColorRGB&&(Xi=a.foregroundColorRGB.rgba>>8&16777215,Jr=!0)}),Pn&&(ud?Li=t.bg&-16777216&-134217729|Li|50331648:Li=t.bg&-16777216|Li|50331648),Jr&&(Xi=t.fg&-16777216&-67108865|Xi|50331648),this.result.fg&67108864&&(Pn&&!Jr&&((this.result.bg&50331648)===0?Xi=this.result.fg&-134217728|ws.background.rgba>>8&16777215&16777215|50331648:Xi=this.result.fg&-134217728|this.result.bg&67108863,Jr=!0),!Pn&&Jr&&((this.result.fg&50331648)===0?Li=this.result.bg&-67108864|ws.foreground.rgba>>8&16777215&16777215|50331648:Li=this.result.bg&-67108864|this.result.fg&67108863,Pn=!0)),ws=void 0,this.result.bg=Pn?Li:this.result.bg,this.result.fg=Jr?Xi:this.result.fg,this.result.ext&=536870911,this.result.ext|=rp<<29&3758096384}},LL=.5,FC=vL||SL?"bottom":"ideographic",DL={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]},OL={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]},BL={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(t,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"║":{1:(t,e)=>`M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1`},"╒":{1:(t,e)=>`M.5,1 L.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"╓":{1:(t,e)=>`M${.5-t},1 L${.5-t},.5 L1,.5 M${.5+t},.5 L${.5+t},1`},"╔":{1:(t,e)=>`M1,${.5-e} L${.5-t},${.5-e} L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1`},"╕":{1:(t,e)=>`M0,${.5-e} L.5,${.5-e} L.5,1 M0,${.5+e} L.5,${.5+e}`},"╖":{1:(t,e)=>`M${.5+t},1 L${.5+t},.5 L0,.5 M${.5-t},.5 L${.5-t},1`},"╗":{1:(t,e)=>`M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M0,${.5-e} L${.5+t},${.5-e} L${.5+t},1`},"╘":{1:(t,e)=>`M.5,0 L.5,${.5+e} L1,${.5+e} M.5,${.5-e} L1,${.5-e}`},"╙":{1:(t,e)=>`M1,.5 L${.5-t},.5 L${.5-t},0 M${.5+t},.5 L${.5+t},0`},"╚":{1:(t,e)=>`M1,${.5-e} L${.5+t},${.5-e} L${.5+t},0 M1,${.5+e} L${.5-t},${.5+e} L${.5-t},0`},"╛":{1:(t,e)=>`M0,${.5+e} L.5,${.5+e} L.5,0 M0,${.5-e} L.5,${.5-e}`},"╜":{1:(t,e)=>`M0,.5 L${.5+t},.5 L${.5+t},0 M${.5-t},.5 L${.5-t},0`},"╝":{1:(t,e)=>`M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0 M0,${.5+e} L${.5+t},${.5+e} L${.5+t},0`},"╞":{1:(t,e)=>`M.5,0 L.5,1 M.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"╟":{1:(t,e)=>`M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1 M${.5+t},.5 L1,.5`},"╠":{1:(t,e)=>`M${.5-t},0 L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1 M1,${.5-e} L${.5+t},${.5-e} L${.5+t},0`},"╡":{1:(t,e)=>`M.5,0 L.5,1 M0,${.5-e} L.5,${.5-e} M0,${.5+e} L.5,${.5+e}`},"╢":{1:(t,e)=>`M0,.5 L${.5-t},.5 M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1`},"╣":{1:(t,e)=>`M${.5+t},0 L${.5+t},1 M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0`},"╤":{1:(t,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e} M.5,${.5+e} L.5,1`},"╥":{1:(t,e)=>`M0,.5 L1,.5 M${.5-t},.5 L${.5-t},1 M${.5+t},.5 L${.5+t},1`},"╦":{1:(t,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1`},"╧":{1:(t,e)=>`M.5,0 L.5,${.5-e} M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"╨":{1:(t,e)=>`M0,.5 L1,.5 M${.5-t},.5 L${.5-t},0 M${.5+t},.5 L${.5+t},0`},"╩":{1:(t,e)=>`M0,${.5+e} L1,${.5+e} M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0 M1,${.5-e} L${.5+t},${.5-e} L${.5+t},0`},"╪":{1:(t,e)=>`M.5,0 L.5,1 M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"╫":{1:(t,e)=>`M0,.5 L1,.5 M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1`},"╬":{1:(t,e)=>`M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1 M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0 M1,${.5-e} L${.5+t},${.5-e} L${.5+t},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(t,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,1,.5`},"╮":{1:(t,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,0,.5`},"╯":{1:(t,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,0,.5`},"╰":{1:(t,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,1,.5`}},Lu={"":{d:"M.3,1 L.03,1 L.03,.88 C.03,.82,.06,.78,.11,.73 C.15,.7,.2,.68,.28,.65 L.43,.6 C.49,.58,.53,.56,.56,.53 C.59,.5,.6,.47,.6,.43 L.6,.27 L.4,.27 L.69,.1 L.98,.27 L.78,.27 L.78,.46 C.78,.52,.76,.56,.72,.61 C.68,.66,.63,.67,.56,.7 L.48,.72 C.42,.74,.38,.76,.35,.78 C.32,.8,.31,.84,.31,.88 L.31,1 M.3,.5 L.03,.59 L.03,.09 L.3,.09 L.3,.655",type:0},"":{d:"M.7,.4 L.7,.47 L.2,.47 L.2,.03 L.355,.03 L.355,.4 L.705,.4 M.7,.5 L.86,.5 L.86,.95 L.69,.95 L.44,.66 L.46,.86 L.46,.95 L.3,.95 L.3,.49 L.46,.49 L.71,.78 L.69,.565 L.69,.5",type:0},"":{d:"M.25,.94 C.16,.94,.11,.92,.11,.87 L.11,.53 C.11,.48,.15,.455,.23,.45 L.23,.3 C.23,.25,.26,.22,.31,.19 C.36,.16,.43,.15,.51,.15 C.59,.15,.66,.16,.71,.19 C.77,.22,.79,.26,.79,.3 L.79,.45 C.87,.45,.91,.48,.91,.53 L.91,.87 C.91,.92,.86,.94,.77,.94 L.24,.94 M.53,.2 C.49,.2,.45,.21,.42,.23 C.39,.25,.38,.27,.38,.3 L.38,.45 L.68,.45 L.68,.3 C.68,.27,.67,.25,.64,.23 C.61,.21,.58,.2,.53,.2 M.58,.82 L.58,.66 C.63,.65,.65,.63,.65,.6 C.65,.58,.64,.57,.61,.56 C.58,.55,.56,.54,.52,.54 C.48,.54,.46,.55,.43,.56 C.4,.57,.39,.59,.39,.6 C.39,.63,.41,.64,.46,.66 L.46,.82 L.57,.82",type:0},"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}};Lu[""]=Lu[""];Lu[""]=Lu[""];function NL(t,e,i,n,a,l,u,h){let f=DL[e];if(f)return PL(t,f,i,n,a,l),!0;let d=OL[e];if(d)return zL(t,d,i,n,a,l),!0;let p=BL[e];if(p)return HL(t,p,i,n,a,l,h),!0;let v=Lu[e];return v?(IL(t,v,i,n,a,l,u,h),!0):!1}function PL(t,e,i,n,a,l){for(let u=0;u<e.length;u++){let h=e[u],f=a/8,d=l/8;t.fillRect(i+h.x*f,n+h.y*d,h.w*f,h.h*d)}}var t1=new Map;function zL(t,e,i,n,a,l){let u=t1.get(e);u||(u=new Map,t1.set(e,u));let h=t.fillStyle;if(typeof h!="string")throw new Error(`Unexpected fillStyle type "${h}"`);let f=u.get(h);if(!f){let d=e[0].length,p=e.length,v=t.canvas.ownerDocument.createElement("canvas");v.width=d,v.height=p;let g=pi(v.getContext("2d")),S=new ImageData(d,p),b,C,x,E;if(h.startsWith("#"))b=parseInt(h.slice(1,3),16),C=parseInt(h.slice(3,5),16),x=parseInt(h.slice(5,7),16),E=h.length>7&&parseInt(h.slice(7,9),16)||1;else if(h.startsWith("rgba"))[b,C,x,E]=h.substring(5,h.length-1).split(",").map(A=>parseFloat(A));else throw new Error(`Unexpected fillStyle color format "${h}" when drawing pattern glyph`);for(let A=0;A<p;A++)for(let B=0;B<d;B++)S.data[(A*d+B)*4]=b,S.data[(A*d+B)*4+1]=C,S.data[(A*d+B)*4+2]=x,S.data[(A*d+B)*4+3]=e[A][B]*(E*255);g.putImageData(S,0,0),f=pi(t.createPattern(v,null)),u.set(h,f)}t.fillStyle=f,t.fillRect(i,n,a,l)}function HL(t,e,i,n,a,l,u){t.strokeStyle=t.fillStyle;for(let[h,f]of Object.entries(e)){t.beginPath(),t.lineWidth=u*Number.parseInt(h);let d;if(typeof f=="function"){let p=.15/l*a;d=f(.15,p)}else d=f;for(let p of d.split(" ")){let v=p[0],g=$C[v];if(!g){console.error(`Could not find drawing instructions for "${v}"`);continue}let S=p.substring(1).split(",");!S[0]||!S[1]||g(t,WC(S,a,l,i,n,!0,u))}t.stroke(),t.closePath()}}function IL(t,e,i,n,a,l,u,h){let f=new Path2D;f.rect(i,n,a,l),t.clip(f),t.beginPath();let d=u/12;t.lineWidth=h*d;for(let p of e.d.split(" ")){let v=p[0],g=$C[v];if(!g){console.error(`Could not find drawing instructions for "${v}"`);continue}let S=p.substring(1).split(",");!S[0]||!S[1]||g(t,WC(S,a,l,i,n,!1,h,(e.leftPadding??0)*(d/2),(e.rightPadding??0)*(d/2)))}e.type===1?(t.strokeStyle=t.fillStyle,t.stroke()):t.fill(),t.closePath()}function i1(t,e,i=0){return Math.max(Math.min(t,e),i)}var $C={C:(t,e)=>t.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]),L:(t,e)=>t.lineTo(e[0],e[1]),M:(t,e)=>t.moveTo(e[0],e[1])};function WC(t,e,i,n,a,l,u,h=0,f=0){let d=t.map(p=>parseFloat(p)||parseInt(p));if(d.length<2)throw new Error("Too few arguments for instruction");for(let p=0;p<d.length;p+=2)d[p]*=e-h*u-f*u,l&&d[p]!==0&&(d[p]=i1(Math.round(d[p]+.5)-.5,e,0)),d[p]+=n+h*u;for(let p=1;p<d.length;p+=2)d[p]*=i,l&&d[p]!==0&&(d[p]=i1(Math.round(d[p]+.5)-.5,i,0)),d[p]+=a;return d}var s1=class{constructor(){this._data={}}set(t,e,i){this._data[t]||(this._data[t]={}),this._data[t][e]=i}get(t,e){return this._data[t]?this._data[t][e]:void 0}clear(){this._data={}}},r1=class{constructor(){this._data=new s1}set(e,i,n,a,l){this._data.get(e,i)||this._data.set(e,i,new s1),this._data.get(e,i).set(n,a,l)}get(e,i,n,a){return this._data.get(e,i)?.get(n,a)}clear(){this._data.clear()}},jC=class{constructor(){this._tasks=[],this._i=0}enqueue(t){this._tasks.push(t),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(t){this._idleCallback=void 0;let e=0,i=0,n=t.timeRemaining(),a=0;for(;this._i<this._tasks.length;){if(e=performance.now(),this._tasks[this._i]()||this._i++,e=Math.max(1,performance.now()-e),i=Math.max(e,i),a=t.timeRemaining(),i*1.5>a){n-e<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-e))}ms`),this._start();return}n=a}this.clear()}},UL=class extends jC{_requestCallback(t){return setTimeout(()=>t(this._createDeadline(16)))}_cancelCallback(t){clearTimeout(t)}_createDeadline(t){let e=performance.now()+t;return{timeRemaining:()=>Math.max(0,e-performance.now())}}},FL=class extends jC{_requestCallback(t){return requestIdleCallback(t)}_cancelCallback(t){cancelIdleCallback(t)}},$L=!Xg&&"requestIdleCallback"in window?FL:UL,Il=class VC{constructor(){this.fg=0,this.bg=0,this.extended=new qC}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let e=new VC;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},qC=class YC{constructor(e=0,i=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=i}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new YC(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},WL=globalThis.performance&&typeof globalThis.performance.now=="function",jL=class GC{static create(e){return new GC(e)}constructor(e){this._now=WL&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},jn;(t=>{t.None=()=>Ir.None;function e(M,O){return v(M,()=>{},0,void 0,!0,void 0,O)}t.defer=e;function i(M){return(O,N=null,P)=>{let T=!1,L;return L=M(H=>{if(!T)return L?L.dispose():T=!0,O.call(N,H)},null,P),T&&L.dispose(),L}}t.once=i;function n(M,O,N){return d((P,T=null,L)=>M(H=>P.call(T,O(H)),null,L),N)}t.map=n;function a(M,O,N){return d((P,T=null,L)=>M(H=>{O(H),P.call(T,H)},null,L),N)}t.forEach=a;function l(M,O,N){return d((P,T=null,L)=>M(H=>O(H)&&P.call(T,H),null,L),N)}t.filter=l;function u(M){return M}t.signal=u;function h(...M){return(O,N=null,P)=>{let T=PC(...M.map(L=>L(H=>O.call(N,H))));return p(T,P)}}t.any=h;function f(M,O,N,P){let T=N;return n(M,L=>(T=O(T,L),T),P)}t.reduce=f;function d(M,O){let N,P={onWillAddFirstListener(){N=M(T.fire,T)},onDidRemoveLastListener(){N?.dispose()}},T=new It(P);return O?.add(T),T.event}function p(M,O){return O instanceof Array?O.push(M):O&&O.add(M),M}function v(M,O,N=100,P=!1,T=!1,L,H){let Y,X,D,G=0,ie,ae={leakWarningThreshold:L,onWillAddFirstListener(){Y=M(ue=>{G++,X=O(X,ue),P&&!D&&(de.fire(X),X=void 0),ie=()=>{let he=X;X=void 0,D=void 0,(!P||G>1)&&de.fire(he),G=0},typeof N=="number"?(clearTimeout(D),D=setTimeout(ie,N)):D===void 0&&(D=0,queueMicrotask(ie))})},onWillRemoveListener(){T&&G>0&&ie?.()},onDidRemoveLastListener(){ie=void 0,Y.dispose()}},de=new It(ae);return H?.add(de),de.event}t.debounce=v;function g(M,O=0,N){return t.debounce(M,(P,T)=>P?(P.push(T),P):[T],O,void 0,!0,void 0,N)}t.accumulate=g;function S(M,O=(P,T)=>P===T,N){let P=!0,T;return l(M,L=>{let H=P||!O(L,T);return P=!1,T=L,H},N)}t.latch=S;function b(M,O,N){return[t.filter(M,O,N),t.filter(M,P=>!O(P),N)]}t.split=b;function C(M,O=!1,N=[],P){let T=N.slice(),L=M(X=>{T?T.push(X):Y.fire(X)});P&&P.add(L);let H=()=>{T?.forEach(X=>Y.fire(X)),T=null},Y=new It({onWillAddFirstListener(){L||(L=M(X=>Y.fire(X)),P&&P.add(L))},onDidAddFirstListener(){T&&(O?setTimeout(H):H())},onDidRemoveLastListener(){L&&L.dispose(),L=null}});return P&&P.add(Y),Y.event}t.buffer=C;function x(M,O){return(N,P,T)=>{let L=O(new A);return M(function(H){let Y=L.evaluate(H);Y!==E&&N.call(P,Y)},void 0,T)}}t.chain=x;let E=Symbol("HaltChainable");class A{constructor(){this.steps=[]}map(O){return this.steps.push(O),this}forEach(O){return this.steps.push(N=>(O(N),N)),this}filter(O){return this.steps.push(N=>O(N)?N:E),this}reduce(O,N){let P=N;return this.steps.push(T=>(P=O(P,T),P)),this}latch(O=(N,P)=>N===P){let N=!0,P;return this.steps.push(T=>{let L=N||!O(T,P);return N=!1,P=T,L?T:E}),this}evaluate(O){for(let N of this.steps)if(O=N(O),O===E)break;return O}}function B(M,O,N=P=>P){let P=(...Y)=>H.fire(N(...Y)),T=()=>M.on(O,P),L=()=>M.removeListener(O,P),H=new It({onWillAddFirstListener:T,onDidRemoveLastListener:L});return H.event}t.fromNodeEventEmitter=B;function R(M,O,N=P=>P){let P=(...Y)=>H.fire(N(...Y)),T=()=>M.addEventListener(O,P),L=()=>M.removeEventListener(O,P),H=new It({onWillAddFirstListener:T,onDidRemoveLastListener:L});return H.event}t.fromDOMEventEmitter=R;function $(M){return new Promise(O=>i(M)(O))}t.toPromise=$;function F(M){let O=new It;return M.then(N=>{O.fire(N)},()=>{O.fire(void 0)}).finally(()=>{O.dispose()}),O.event}t.fromPromise=F;function U(M,O){return M(N=>O.fire(N))}t.forward=U;function z(M,O,N){return O(N),M(P=>O(P))}t.runAndSubscribe=z;class V{constructor(O,N){this._observable=O,this._counter=0,this._hasChanged=!1;let P={onWillAddFirstListener:()=>{O.addObserver(this)},onDidRemoveLastListener:()=>{O.removeObserver(this)}};this.emitter=new It(P),N&&N.add(this.emitter)}beginUpdate(O){this._counter++}handlePossibleChange(O){}handleChange(O,N){this._hasChanged=!0}endUpdate(O){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function se(M,O){return new V(M,O).emitter.event}t.fromObservable=se;function ee(M){return(O,N,P)=>{let T=0,L=!1,H={beginUpdate(){T++},endUpdate(){T--,T===0&&(M.reportChanges(),L&&(L=!1,O.call(N)))},handlePossibleChange(){},handleChange(){L=!0}};M.addObserver(H),M.reportChanges();let Y={dispose(){M.removeObserver(H)}};return P instanceof jl?P.add(Y):Array.isArray(P)&&P.push(Y),Y}}t.fromObservableLight=ee})(jn||={});var pg=class gg{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${gg._idPool++}`,gg.all.add(this)}start(e){this._stopWatch=new jL,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};pg.all=new Set,pg._idPool=0;var VL=pg,qL=-1,KC=class XC{constructor(e,i,n=(XC._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=i,this.name=n,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,i){let n=this.threshold;if(n<=0||i<n)return;this._stacks||(this._stacks=new Map);let a=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,a+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=n*.5;let[l,u]=this.getMostFrequentStack(),h=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${u}):`;console.warn(h),console.warn(l);let f=new KL(h,l);this._errorHandler(f)}return()=>{let l=this._stacks.get(e.value)||0;this._stacks.set(e.value,l-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,i=0;for(let[n,a]of this._stacks)(!e||i<a)&&(e=[n,a],i=a);return e}};KC._idPool=1;var YL=KC,GL=class ZC{constructor(e){this.value=e}static create(){let e=new Error;return new ZC(e.stack??"")}print(){console.warn(this.value.split(`
|
|
29
|
+
`).slice(2).join(`
|
|
30
|
+
`))}},KL=class extends Error{constructor(t,e){super(t),this.name="ListenerLeakError",this.stack=e}},XL=class extends Error{constructor(t,e){super(t),this.name="ListenerRefusalError",this.stack=e}},ZL=0,np=class{constructor(t){this.value=t,this.id=ZL++}},QL=2,JL,It=class{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new YL(e?.onListenerError??sp,this._options?.leakWarningThreshold??qL):void 0,this._perfMon=this._options?._profName?new VL(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,i,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let h=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(h);let f=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],d=new XL(`${h}. HINT: Stack shows most frequent listener (${f[1]}-times)`,f[0]);return(this._options?.onListenerError||sp)(d),Ir.None}if(this._disposed)return Ir.None;i&&(e=e.bind(i));let a=new np(e),l;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(a.stack=GL.create(),l=this._leakageMon.check(a.stack,this._size+1)),this._listeners?this._listeners instanceof np?(this._deliveryQueue??=new e3,this._listeners=[this._listeners,a]):this._listeners.push(a):(this._options?.onWillAddFirstListener?.(this),this._listeners=a,this._options?.onDidAddFirstListener?.(this)),this._size++;let u=is(()=>{l?.(),this._removeListener(a)});return n instanceof jl?n.add(u):Array.isArray(n)&&n.push(u),u},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let i=this._listeners,n=i.indexOf(e);if(n===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,i[n]=void 0;let a=this._deliveryQueue.current===this;if(this._size*QL<=i.length){let l=0;for(let u=0;u<i.length;u++)i[u]?i[l++]=i[u]:a&&(this._deliveryQueue.end--,l<this._deliveryQueue.i&&this._deliveryQueue.i--);i.length=l}}_deliver(e,i){if(!e)return;let n=this._options?.onListenerError||sp;if(!n){e.value(i);return}try{e.value(i)}catch(a){n(a)}}_deliverQueue(e){let i=e.current._listeners;for(;e.i<e.end;)this._deliver(i[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof np)this._deliver(this._listeners,e);else{let i=this._deliveryQueue;i.enqueue(this,e,this._listeners.length),this._deliverQueue(i)}this._perfMon?.stop()}hasListeners(){return this._size>0}},e3=class{constructor(){this.i=-1,this.end=0}enqueue(t,e,i){this.i=0,this.end=i,this.current=t,this.value=e}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},n1={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}},cu=2,uu,Pa=class Pl{constructor(e,i,n){this._document=e,this._config=i,this._unicodeService=n,this._didWarmUp=!1,this._cacheMap=new r1,this._cacheMapCombined=new r1,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new Il,this._textureSize=512,this._onAddTextureAtlasCanvas=new It,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new It,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=QC(e,this._config.deviceCellWidth*4+cu*2,this._config.deviceCellHeight+cu*2),this._tmpCtx=pi(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}get pages(){return this._pages}dispose(){this._tmpCanvas.remove();for(let e of this.pages)e.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){let e=new $L;for(let i=33;i<126;i++)e.enqueue(()=>{if(!this._cacheMap.get(i,0,0,0)){let n=this._drawToCache(i,0,0,0,!1,void 0);this._cacheMap.set(i,0,0,0,n)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(!(this._pages[0].currentRow.x===0&&this._pages[0].currentRow.y===0)){for(let e of this._pages)e.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(Pl.maxAtlasPages&&this._pages.length>=Math.max(4,Pl.maxAtlasPages)){let i=this._pages.filter(d=>d.canvas.width*2<=(Pl.maxTextureSize||4096)).sort((d,p)=>p.canvas.width!==d.canvas.width?p.canvas.width-d.canvas.width:p.percentageUsed-d.percentageUsed),n=-1,a=0;for(let d=0;d<i.length;d++)if(i[d].canvas.width!==a)n=d,a=i[d].canvas.width;else if(d-n===3)break;let l=i.slice(n,n+4),u=l.map(d=>d.glyphs[0].texturePage).sort((d,p)=>d>p?1:-1),h=this.pages.length-l.length,f=this._mergePages(l,h);f.version++;for(let d=u.length-1;d>=0;d--)this._deletePage(u[d]);this.pages.push(f),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(f.canvas)}let e=new ap(this._document,this._textureSize);return this._pages.push(e),this._activePages.push(e),this._onAddTextureAtlasCanvas.fire(e.canvas),e}_mergePages(e,i){let n=e[0].canvas.width*2,a=new ap(this._document,n,e);for(let[l,u]of e.entries()){let h=l*u.canvas.width%n,f=Math.floor(l/2)*u.canvas.height;a.ctx.drawImage(u.canvas,h,f);for(let p of u.glyphs)p.texturePage=i,p.sizeClipSpace.x=p.size.x/n,p.sizeClipSpace.y=p.size.y/n,p.texturePosition.x+=h,p.texturePosition.y+=f,p.texturePositionClipSpace.x=p.texturePosition.x/n,p.texturePositionClipSpace.y=p.texturePosition.y/n;this._onRemoveTextureAtlasCanvas.fire(u.canvas);let d=this._activePages.indexOf(u);d!==-1&&this._activePages.splice(d,1)}return a}_deletePage(e){this._pages.splice(e,1);for(let i=e;i<this._pages.length;i++){let n=this._pages[i];for(let a of n.glyphs)a.texturePage--;n.version++}}getRasterizedGlyphCombinedChar(e,i,n,a,l,u){return this._getFromCacheMap(this._cacheMapCombined,e,i,n,a,l,u)}getRasterizedGlyph(e,i,n,a,l,u){return this._getFromCacheMap(this._cacheMap,e,i,n,a,l,u)}_getFromCacheMap(e,i,n,a,l,u,h){return uu=e.get(i,n,a,l),uu||(uu=this._drawToCache(i,n,a,l,u,h),e.set(i,n,a,l,uu)),uu}_getColorFromAnsiIndex(e){if(e>=this._config.colors.ansi.length)throw new Error("No color found for idx "+e);return this._config.colors.ansi[e]}_getBackgroundColor(e,i,n,a){if(this._config.allowTransparency)return gr;let l;switch(e){case 16777216:case 33554432:l=this._getColorFromAnsiIndex(i);break;case 50331648:let u=Il.toColorRGB(i);l=us.toColor(u[0],u[1],u[2]);break;default:n?l=yu.opaque(this._config.colors.foreground):l=this._config.colors.background;break}return this._config.allowTransparency||(l=yu.opaque(l)),l}_getForegroundColor(e,i,n,a,l,u,h,f,d,p){let v=this._getMinimumContrastColor(e,i,n,a,l,u,h,d,f,p);if(v)return v;let g;switch(l){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&d&&u<8&&(u+=8),g=this._getColorFromAnsiIndex(u);break;case 50331648:let S=Il.toColorRGB(u);g=us.toColor(S[0],S[1],S[2]);break;default:h?g=this._config.colors.background:g=this._config.colors.foreground}return this._config.allowTransparency&&(g=yu.opaque(g)),f&&(g=yu.multiplyOpacity(g,LL)),g}_resolveBackgroundRgba(e,i,n){switch(e){case 16777216:case 33554432:return this._getColorFromAnsiIndex(i).rgba;case 50331648:return i<<8;default:return n?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(e,i,n,a){switch(e){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&a&&i<8&&(i+=8),this._getColorFromAnsiIndex(i).rgba;case 50331648:return i<<8;default:return n?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(e,i,n,a,l,u,h,f,d,p){if(this._config.minimumContrastRatio===1||p)return;let v=this._getContrastCache(d),g=v.getColor(e,a);if(g!==void 0)return g||void 0;let S=this._resolveBackgroundRgba(i,n,h),b=this._resolveForegroundRgba(l,u,h,f),C=No.ensureContrastRatio(S,b,this._config.minimumContrastRatio/(d?2:1));if(!C){v.setColor(e,a,null);return}let x=us.toColor(C>>24&255,C>>16&255,C>>8&255);return v.setColor(e,a,x),x}_getContrastCache(e){return e?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(e,i,n,a,l,u){let h=typeof e=="number"?String.fromCharCode(e):e;u&&this._tmpCanvas.parentElement!==u&&(this._tmpCanvas.style.display="none",u.append(this._tmpCanvas));let f=Math.min(this._config.deviceCellWidth*Math.max(h.length,2)+cu*2,this._config.deviceMaxTextureSize);this._tmpCanvas.width<f&&(this._tmpCanvas.width=f);let d=Math.min(this._config.deviceCellHeight+cu*4,this._textureSize);if(this._tmpCanvas.height<d&&(this._tmpCanvas.height=d),this._tmpCtx.save(),this._workAttributeData.fg=n,this._workAttributeData.bg=i,this._workAttributeData.extended.ext=a,!!this._workAttributeData.isInvisible())return n1;let p=!!this._workAttributeData.isBold(),v=!!this._workAttributeData.isInverse(),g=!!this._workAttributeData.isDim(),S=!!this._workAttributeData.isItalic(),b=!!this._workAttributeData.isUnderline(),C=!!this._workAttributeData.isStrikethrough(),x=!!this._workAttributeData.isOverline(),E=this._workAttributeData.getFgColor(),A=this._workAttributeData.getFgColorMode(),B=this._workAttributeData.getBgColor(),R=this._workAttributeData.getBgColorMode();if(v){let X=E;E=B,B=X;let D=A;A=R,R=D}let $=this._getBackgroundColor(R,B,v,g);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=$.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";let F=p?this._config.fontWeightBold:this._config.fontWeight,U=S?"italic":"";this._tmpCtx.font=`${U} ${F} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=FC;let z=h.length===1&&Zg(h.charCodeAt(0)),V=h.length===1&&CL(h.charCodeAt(0)),se=this._getForegroundColor(i,R,B,n,A,E,v,g,p,UC(h.charCodeAt(0)));this._tmpCtx.fillStyle=se.css;let ee=V?0:cu*2,M=!1;this._config.customGlyphs!==!1&&(M=NL(this._tmpCtx,h,ee,ee,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let O=!z,N;if(typeof e=="number"?N=this._unicodeService.wcwidth(e):N=this._unicodeService.getStringCellWidth(e),b){this._tmpCtx.save();let X=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),D=X%2===1?.5:0;if(this._tmpCtx.lineWidth=X,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())O=!1,this._tmpCtx.strokeStyle=`rgb(${Il.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{O=!1;let he=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&he<8&&(he+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(he).css}this._tmpCtx.beginPath();let G=ee,ie=Math.ceil(ee+this._config.deviceCharHeight)-D-(l?X*2:0),ae=ie+X,de=ie+X*2,ue=this._workAttributeData.getUnderlineVariantOffset();for(let he=0;he<N;he++){this._tmpCtx.save();let ve=G+he*this._config.deviceCellWidth,ye=G+(he+1)*this._config.deviceCellWidth,Ae=ve+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(ve,ie),this._tmpCtx.lineTo(ye,ie),this._tmpCtx.moveTo(ve,de),this._tmpCtx.lineTo(ye,de);break;case 3:let De=X<=1?de:Math.ceil(ee+this._config.deviceCharHeight-X/2)-D,rt=X<=1?ie:Math.ceil(ee+this._config.deviceCharHeight+X/2)-D,Ze=new Path2D;Ze.rect(ve,ie,this._config.deviceCellWidth,de-ie),this._tmpCtx.clip(Ze),this._tmpCtx.moveTo(ve-this._config.deviceCellWidth/2,ae),this._tmpCtx.bezierCurveTo(ve-this._config.deviceCellWidth/2,rt,ve,rt,ve,ae),this._tmpCtx.bezierCurveTo(ve,De,Ae,De,Ae,ae),this._tmpCtx.bezierCurveTo(Ae,rt,ye,rt,ye,ae),this._tmpCtx.bezierCurveTo(ye,De,ye+this._config.deviceCellWidth/2,De,ye+this._config.deviceCellWidth/2,ae);break;case 4:let xe=ue===0?0:ue>=X?X*2-ue:X-ue;ue>=X||xe===0?(this._tmpCtx.setLineDash([Math.round(X),Math.round(X)]),this._tmpCtx.moveTo(ve+xe,ie),this._tmpCtx.lineTo(ye,ie)):(this._tmpCtx.setLineDash([Math.round(X),Math.round(X)]),this._tmpCtx.moveTo(ve,ie),this._tmpCtx.lineTo(ve+xe,ie),this._tmpCtx.moveTo(ve+xe+X,ie),this._tmpCtx.lineTo(ye,ie)),ue=AL(ye-ve,X,ue);break;case 5:let ze=.6,pe=.3,_t=ye-ve,yt=Math.floor(ze*_t),dt=Math.floor(pe*_t),Ce=_t-yt-dt;this._tmpCtx.setLineDash([yt,dt,Ce]),this._tmpCtx.moveTo(ve,ie),this._tmpCtx.lineTo(ye,ie);break;default:this._tmpCtx.moveTo(ve,ie),this._tmpCtx.lineTo(ye,ie);break}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!M&&this._config.fontSize>=12&&!this._config.allowTransparency&&h!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";let he=this._tmpCtx.measureText(h);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in he&&he.actualBoundingBoxDescent>0){this._tmpCtx.save();let ve=new Path2D;ve.rect(G,ie-Math.ceil(X/2),this._config.deviceCellWidth*N,de-ie+Math.ceil(X/2)),this._tmpCtx.clip(ve),this._tmpCtx.lineWidth=this._config.devicePixelRatio*3,this._tmpCtx.strokeStyle=$.css,this._tmpCtx.strokeText(h,ee,ee+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(x){let X=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),D=X%2===1?.5:0;this._tmpCtx.lineWidth=X,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(ee,ee+D),this._tmpCtx.lineTo(ee+this._config.deviceCharWidth*N,ee+D),this._tmpCtx.stroke()}if(M||this._tmpCtx.fillText(h,ee,ee+this._config.deviceCharHeight),h==="_"&&!this._config.allowTransparency){let X=op(this._tmpCtx.getImageData(ee,ee,this._config.deviceCellWidth,this._config.deviceCellHeight),$,se,O);if(X)for(let D=1;D<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=$.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(h,ee,ee+this._config.deviceCharHeight-D),X=op(this._tmpCtx.getImageData(ee,ee,this._config.deviceCellWidth,this._config.deviceCellHeight),$,se,O),!!X);D++);}if(C){let X=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),D=this._tmpCtx.lineWidth%2===1?.5:0;this._tmpCtx.lineWidth=X,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(ee,ee+Math.floor(this._config.deviceCharHeight/2)-D),this._tmpCtx.lineTo(ee+this._config.deviceCharWidth*N,ee+Math.floor(this._config.deviceCharHeight/2)-D),this._tmpCtx.stroke()}this._tmpCtx.restore();let P=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height),T;if(this._config.allowTransparency?T=t3(P):T=op(P,$,se,O),T)return n1;let L=this._findGlyphBoundingBox(P,this._workBoundingBox,f,V,M,ee),H,Y;for(;;){if(this._activePages.length===0){let X=this._createNewPage();H=X,Y=X.currentRow,Y.height=L.size.y;break}H=this._activePages[this._activePages.length-1],Y=H.currentRow;for(let X of this._activePages)L.size.y<=X.currentRow.height&&(H=X,Y=X.currentRow);for(let X=this._activePages.length-1;X>=0;X--)for(let D of this._activePages[X].fixedRows)D.height<=Y.height&&L.size.y<=D.height&&(H=this._activePages[X],Y=D);if(L.size.x>this._textureSize){this._overflowSizePage||(this._overflowSizePage=new ap(this._document,this._config.deviceMaxTextureSize),this.pages.push(this._overflowSizePage),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas)),H=this._overflowSizePage,Y=this._overflowSizePage.currentRow,Y.x+L.size.x>=H.canvas.width&&(Y.x=0,Y.y+=Y.height,Y.height=0);break}if(Y.y+L.size.y>=H.canvas.height||Y.height>L.size.y+2){let X=!1;if(H.currentRow.y+H.currentRow.height+L.size.y>=H.canvas.height){let D;for(let G of this._activePages)if(G.currentRow.y+G.currentRow.height+L.size.y<G.canvas.height){D=G;break}if(D)H=D;else if(Pl.maxAtlasPages&&this._pages.length>=Pl.maxAtlasPages&&Y.y+L.size.y<=H.canvas.height&&Y.height>=L.size.y&&Y.x+L.size.x<=H.canvas.width)X=!0;else{let G=this._createNewPage();H=G,Y=G.currentRow,Y.height=L.size.y,X=!0}}X||(H.currentRow.height>0&&H.fixedRows.push(H.currentRow),Y={x:0,y:H.currentRow.y+H.currentRow.height,height:L.size.y},H.fixedRows.push(Y),H.currentRow={x:0,y:Y.y+Y.height,height:0})}if(Y.x+L.size.x<=H.canvas.width)break;Y===H.currentRow?(Y.x=0,Y.y+=Y.height,Y.height=0):H.fixedRows.splice(H.fixedRows.indexOf(Y),1)}return L.texturePage=this._pages.indexOf(H),L.texturePosition.x=Y.x,L.texturePosition.y=Y.y,L.texturePositionClipSpace.x=Y.x/H.canvas.width,L.texturePositionClipSpace.y=Y.y/H.canvas.height,L.sizeClipSpace.x/=H.canvas.width,L.sizeClipSpace.y/=H.canvas.height,Y.height=Math.max(Y.height,L.size.y),Y.x+=L.size.x,H.ctx.putImageData(P,L.texturePosition.x-this._workBoundingBox.left,L.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,L.size.x,L.size.y),H.addGlyph(L),H.version++,L}_findGlyphBoundingBox(e,i,n,a,l,u){i.top=0;let h=a?this._config.deviceCellHeight:this._tmpCanvas.height,f=a?this._config.deviceCellWidth:n,d=!1;for(let p=0;p<h;p++){for(let v=0;v<f;v++){let g=p*this._tmpCanvas.width*4+v*4+3;if(e.data[g]!==0){i.top=p,d=!0;break}}if(d)break}i.left=0,d=!1;for(let p=0;p<u+f;p++){for(let v=0;v<h;v++){let g=v*this._tmpCanvas.width*4+p*4+3;if(e.data[g]!==0){i.left=p,d=!0;break}}if(d)break}i.right=f,d=!1;for(let p=u+f-1;p>=u;p--){for(let v=0;v<h;v++){let g=v*this._tmpCanvas.width*4+p*4+3;if(e.data[g]!==0){i.right=p,d=!0;break}}if(d)break}i.bottom=h,d=!1;for(let p=h-1;p>=0;p--){for(let v=0;v<f;v++){let g=p*this._tmpCanvas.width*4+v*4+3;if(e.data[g]!==0){i.bottom=p,d=!0;break}}if(d)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:i.right-i.left+1,y:i.bottom-i.top+1},sizeClipSpace:{x:i.right-i.left+1,y:i.bottom-i.top+1},offset:{x:-i.left+u+(a||l?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-i.top+u+(a||l?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}},ap=class{constructor(t,e,i){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],i)for(let n of i)this._glyphs.push(...n.glyphs),this._usedPixels+=n._usedPixels;this.canvas=QC(t,e,e),this.ctx=pi(this.canvas.getContext("2d",{alpha:!0}))}get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(t){this._glyphs.push(t),this._usedPixels+=t.size.x*t.size.y}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}};function op(t,e,i,n){let a=e.rgba>>>24,l=e.rgba>>>16&255,u=e.rgba>>>8&255,h=i.rgba>>>24,f=i.rgba>>>16&255,d=i.rgba>>>8&255,p=Math.floor((Math.abs(a-h)+Math.abs(l-f)+Math.abs(u-d))/12),v=!0;for(let g=0;g<t.data.length;g+=4)t.data[g]===a&&t.data[g+1]===l&&t.data[g+2]===u||n&&Math.abs(t.data[g]-a)+Math.abs(t.data[g+1]-l)+Math.abs(t.data[g+2]-u)<p?t.data[g+3]=0:v=!1;return v}function t3(t){for(let e=0;e<t.data.length;e+=4)if(t.data[e+3]>0)return!1;return!0}function QC(t,e,i){let n=t.createElement("canvas");return n.width=e,n.height=i,n}function i3(t,e,i,n,a,l,u,h){let f={foreground:l.foreground,background:l.background,cursor:gr,cursorAccent:gr,selectionForeground:gr,selectionBackgroundTransparent:gr,selectionBackgroundOpaque:gr,selectionInactiveBackgroundTransparent:gr,selectionInactiveBackgroundOpaque:gr,overviewRulerBorder:gr,scrollbarSliderBackground:gr,scrollbarSliderHoverBackground:gr,scrollbarSliderActiveBackground:gr,ansi:l.ansi.slice(),contrastCache:l.contrastCache,halfContrastCache:l.halfContrastCache};return{customGlyphs:a.customGlyphs,devicePixelRatio:u,deviceMaxTextureSize:h,letterSpacing:a.letterSpacing,lineHeight:a.lineHeight,deviceCellWidth:t,deviceCellHeight:e,deviceCharWidth:i,deviceCharHeight:n,fontFamily:a.fontFamily,fontSize:a.fontSize,fontWeight:a.fontWeight,fontWeightBold:a.fontWeightBold,allowTransparency:a.allowTransparency,drawBoldTextInBrightColors:a.drawBoldTextInBrightColors,minimumContrastRatio:a.minimumContrastRatio,colors:f}}function a1(t,e){for(let i=0;i<t.colors.ansi.length;i++)if(t.colors.ansi[i].rgba!==e.colors.ansi[i].rgba)return!1;return t.devicePixelRatio===e.devicePixelRatio&&t.customGlyphs===e.customGlyphs&&t.lineHeight===e.lineHeight&&t.letterSpacing===e.letterSpacing&&t.fontFamily===e.fontFamily&&t.fontSize===e.fontSize&&t.fontWeight===e.fontWeight&&t.fontWeightBold===e.fontWeightBold&&t.allowTransparency===e.allowTransparency&&t.deviceCharWidth===e.deviceCharWidth&&t.deviceCharHeight===e.deviceCharHeight&&t.drawBoldTextInBrightColors===e.drawBoldTextInBrightColors&&t.minimumContrastRatio===e.minimumContrastRatio&&t.colors.foreground.rgba===e.colors.foreground.rgba&&t.colors.background.rgba===e.colors.background.rgba}function s3(t){return(t&50331648)===16777216||(t&50331648)===33554432}var br=[];function JC(t,e,i,n,a,l,u,h,f){let d=i3(n,a,l,u,e,i,h,f);for(let g=0;g<br.length;g++){let S=br[g],b=S.ownedBy.indexOf(t);if(b>=0){if(a1(S.config,d))return S.atlas;S.ownedBy.length===1?(S.atlas.dispose(),br.splice(g,1)):S.ownedBy.splice(b,1);break}}for(let g=0;g<br.length;g++){let S=br[g];if(a1(S.config,d))return S.ownedBy.push(t),S.atlas}let p=t._core,v={atlas:new Pa(document,d,p.unicodeService),config:d,ownedBy:[t]};return br.push(v),v.atlas}function o1(t){for(let e=0;e<br.length;e++){let i=br[e].ownedBy.indexOf(t);if(i!==-1){br[e].ownedBy.length===1?(br[e].atlas.dispose(),br.splice(e,1)):br[e].ownedBy.splice(i,1);break}}}var hd=600,r3=class{constructor(t,e){this._renderCallback=t,this._coreBrowserService=e,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(t=hd){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){let e=hd-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,e>0){this._restartInterval(e);return}}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){let e=hd-(Date.now()-this._animationTimeRestarted);this._animationTimeRestarted=void 0,this._restartInterval(e);return}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},hd)},t)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}};function l1(t,e,i){let n=new e.ResizeObserver(a=>{let l=a.find(f=>f.target===t);if(!l)return;if(!("devicePixelContentBoxSize"in l)){n?.disconnect(),n=void 0;return}let u=l.devicePixelContentBoxSize[0].inlineSize,h=l.devicePixelContentBoxSize[0].blockSize;u>0&&h>0&&i(u,h)});try{n.observe(t,{box:["device-pixel-content-box"]})}catch{n.disconnect(),n=void 0}return is(()=>n?.disconnect())}function n3(t){return t>65535?(t-=65536,String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):String.fromCharCode(t)}var c1=class ex extends Il{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new qC,this.combinedData=""}static fromCharData(e){let i=new ex;return i.setFromCharData(e),i}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?n3(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let i=!1;if(e[1].length>2)i=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let a=e[1].charCodeAt(1);56320<=a&&a<=57343?this.content=(n-55296)*1024+a-56320+65536|e[2]<<22:i=!0}else i=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;i&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},tx=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]);function ix(t,e,i){let n=pi(t.createProgram());if(t.attachShader(n,pi(u1(t,t.VERTEX_SHADER,e))),t.attachShader(n,pi(u1(t,t.FRAGMENT_SHADER,i))),t.linkProgram(n),t.getProgramParameter(n,t.LINK_STATUS))return n;console.error(t.getProgramInfoLog(n)),t.deleteProgram(n)}function u1(t,e,i){let n=pi(t.createShader(e));if(t.shaderSource(n,i),t.compileShader(n),t.getShaderParameter(n,t.COMPILE_STATUS))return n;console.error(t.getShaderInfoLog(n)),t.deleteShader(n)}function a3(t,e){let i=Math.min(t.length*2,e),n=new Float32Array(i);for(let a=0;a<t.length;a++)n[a]=t[a];return n}var o3=class{constructor(t){this.texture=t,this.version=-1}},l3=`#version 300 es
|
|
31
|
+
layout (location = 0) in vec2 a_unitquad;
|
|
32
|
+
layout (location = 1) in vec2 a_cellpos;
|
|
33
|
+
layout (location = 2) in vec2 a_offset;
|
|
34
|
+
layout (location = 3) in vec2 a_size;
|
|
35
|
+
layout (location = 4) in float a_texpage;
|
|
36
|
+
layout (location = 5) in vec2 a_texcoord;
|
|
37
|
+
layout (location = 6) in vec2 a_texsize;
|
|
38
|
+
|
|
39
|
+
uniform mat4 u_projection;
|
|
40
|
+
uniform vec2 u_resolution;
|
|
41
|
+
|
|
42
|
+
out vec2 v_texcoord;
|
|
43
|
+
flat out int v_texpage;
|
|
44
|
+
|
|
45
|
+
void main() {
|
|
46
|
+
vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
|
|
47
|
+
gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
|
|
48
|
+
v_texpage = int(a_texpage);
|
|
49
|
+
v_texcoord = a_texcoord + a_unitquad * a_texsize;
|
|
50
|
+
}`;function c3(t){let e="";for(let i=1;i<t;i++)e+=` else if (v_texpage == ${i}) { outColor = texture(u_texture[${i}], v_texcoord); }`;return`#version 300 es
|
|
51
|
+
precision lowp float;
|
|
52
|
+
|
|
53
|
+
in vec2 v_texcoord;
|
|
54
|
+
flat in int v_texpage;
|
|
55
|
+
|
|
56
|
+
uniform sampler2D u_texture[${t}];
|
|
57
|
+
|
|
58
|
+
out vec4 outColor;
|
|
59
|
+
|
|
60
|
+
void main() {
|
|
61
|
+
if (v_texpage == 0) {
|
|
62
|
+
outColor = texture(u_texture[0], v_texcoord);
|
|
63
|
+
} ${e}
|
|
64
|
+
}`}var za=11,Ol=za*Float32Array.BYTES_PER_ELEMENT,u3=2,ei=0,zt,lp=0,hu=0,h3=class extends Ir{constructor(t,e,i,n){super(),this._terminal=t,this._gl=e,this._dimensions=i,this._optionsService=n,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};let a=this._gl;Pa.maxAtlasPages===void 0&&(Pa.maxAtlasPages=Math.min(32,pi(a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS))),Pa.maxTextureSize=pi(a.getParameter(a.MAX_TEXTURE_SIZE))),this._program=pi(ix(a,l3,c3(Pa.maxAtlasPages))),this._register(is(()=>a.deleteProgram(this._program))),this._projectionLocation=pi(a.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=pi(a.getUniformLocation(this._program,"u_resolution")),this._textureLocation=pi(a.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=a.createVertexArray(),a.bindVertexArray(this._vertexArrayObject);let l=new Float32Array([0,0,1,0,0,1,1,1]),u=a.createBuffer();this._register(is(()=>a.deleteBuffer(u))),a.bindBuffer(a.ARRAY_BUFFER,u),a.bufferData(a.ARRAY_BUFFER,l,a.STATIC_DRAW),a.enableVertexAttribArray(0),a.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);let h=new Uint8Array([0,1,2,3]),f=a.createBuffer();this._register(is(()=>a.deleteBuffer(f))),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,f),a.bufferData(a.ELEMENT_ARRAY_BUFFER,h,a.STATIC_DRAW),this._attributesBuffer=pi(a.createBuffer()),this._register(is(()=>a.deleteBuffer(this._attributesBuffer))),a.bindBuffer(a.ARRAY_BUFFER,this._attributesBuffer),a.enableVertexAttribArray(2),a.vertexAttribPointer(2,2,a.FLOAT,!1,Ol,0),a.vertexAttribDivisor(2,1),a.enableVertexAttribArray(3),a.vertexAttribPointer(3,2,a.FLOAT,!1,Ol,2*Float32Array.BYTES_PER_ELEMENT),a.vertexAttribDivisor(3,1),a.enableVertexAttribArray(4),a.vertexAttribPointer(4,1,a.FLOAT,!1,Ol,4*Float32Array.BYTES_PER_ELEMENT),a.vertexAttribDivisor(4,1),a.enableVertexAttribArray(5),a.vertexAttribPointer(5,2,a.FLOAT,!1,Ol,5*Float32Array.BYTES_PER_ELEMENT),a.vertexAttribDivisor(5,1),a.enableVertexAttribArray(6),a.vertexAttribPointer(6,2,a.FLOAT,!1,Ol,7*Float32Array.BYTES_PER_ELEMENT),a.vertexAttribDivisor(6,1),a.enableVertexAttribArray(1),a.vertexAttribPointer(1,2,a.FLOAT,!1,Ol,9*Float32Array.BYTES_PER_ELEMENT),a.vertexAttribDivisor(1,1),a.useProgram(this._program);let d=new Int32Array(Pa.maxAtlasPages);for(let p=0;p<Pa.maxAtlasPages;p++)d[p]=p;a.uniform1iv(this._textureLocation,d),a.uniformMatrix4fv(this._projectionLocation,!1,tx),this._atlasTextures=[];for(let p=0;p<Pa.maxAtlasPages;p++){let v=new o3(pi(a.createTexture()));this._register(is(()=>a.deleteTexture(v.texture))),a.activeTexture(a.TEXTURE0+p),a.bindTexture(a.TEXTURE_2D,v.texture),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,1,1,0,a.RGBA,a.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[p]=v}a.enable(a.BLEND),a.blendFunc(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return this._atlas?this._atlas.beginFrame():!0}updateCell(t,e,i,n,a,l,u,h,f){this._updateCell(this._vertices.attributes,t,e,i,n,a,l,u,h,f)}_updateCell(t,e,i,n,a,l,u,h,f,d){if(ei=(i*this._terminal.cols+e)*za,n===0||n===void 0){t.fill(0,ei,ei+za-1-u3);return}this._atlas&&(h&&h.length>1?zt=this._atlas.getRasterizedGlyphCombinedChar(h,a,l,u,!1,this._terminal.element):zt=this._atlas.getRasterizedGlyph(n,a,l,u,!1,this._terminal.element),lp=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),a!==d&&zt.offset.x>lp?(hu=zt.offset.x-lp,t[ei]=-(zt.offset.x-hu)+this._dimensions.device.char.left,t[ei+1]=-zt.offset.y+this._dimensions.device.char.top,t[ei+2]=(zt.size.x-hu)/this._dimensions.device.canvas.width,t[ei+3]=zt.size.y/this._dimensions.device.canvas.height,t[ei+4]=zt.texturePage,t[ei+5]=zt.texturePositionClipSpace.x+hu/this._atlas.pages[zt.texturePage].canvas.width,t[ei+6]=zt.texturePositionClipSpace.y,t[ei+7]=zt.sizeClipSpace.x-hu/this._atlas.pages[zt.texturePage].canvas.width,t[ei+8]=zt.sizeClipSpace.y):(t[ei]=-zt.offset.x+this._dimensions.device.char.left,t[ei+1]=-zt.offset.y+this._dimensions.device.char.top,t[ei+2]=zt.size.x/this._dimensions.device.canvas.width,t[ei+3]=zt.size.y/this._dimensions.device.canvas.height,t[ei+4]=zt.texturePage,t[ei+5]=zt.texturePositionClipSpace.x,t[ei+6]=zt.texturePositionClipSpace.y,t[ei+7]=zt.sizeClipSpace.x,t[ei+8]=zt.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&TL(n,f,zt.size.x,this._dimensions.device.cell.width)&&(t[ei+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width))}clear(){let t=this._terminal,e=t.cols*t.rows*za;this._vertices.count!==e?this._vertices.attributes=new Float32Array(e):this._vertices.attributes.fill(0);let i=0;for(;i<this._vertices.attributesBuffers.length;i++)this._vertices.count!==e?this._vertices.attributesBuffers[i]=new Float32Array(e):this._vertices.attributesBuffers[i].fill(0);this._vertices.count=e,i=0;for(let n=0;n<t.rows;n++)for(let a=0;a<t.cols;a++)this._vertices.attributes[i+9]=a/t.cols,this._vertices.attributes[i+10]=n/t.rows,i+=za}handleResize(){let t=this._gl;t.useProgram(this._program),t.viewport(0,0,t.canvas.width,t.canvas.height),t.uniform2f(this._resolutionLocation,t.canvas.width,t.canvas.height),this.clear()}render(t){if(!this._atlas)return;let e=this._gl;e.useProgram(this._program),e.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;let i=this._vertices.attributesBuffers[this._activeBuffer],n=0;for(let a=0;a<t.lineLengths.length;a++){let l=a*this._terminal.cols*za,u=this._vertices.attributes.subarray(l,l+t.lineLengths[a]*za);i.set(u,n),n+=u.length}e.bindBuffer(e.ARRAY_BUFFER,this._attributesBuffer),e.bufferData(e.ARRAY_BUFFER,i.subarray(0,n),e.STREAM_DRAW);for(let a=0;a<this._atlas.pages.length;a++)this._atlas.pages[a].version!==this._atlasTextures[a].version&&this._bindAtlasPageTexture(e,this._atlas,a);e.drawElementsInstanced(e.TRIANGLE_STRIP,4,e.UNSIGNED_BYTE,0,n/za)}setAtlas(t){this._atlas=t;for(let e of this._atlasTextures)e.version=-1}_bindAtlasPageTexture(t,e,i){t.activeTexture(t.TEXTURE0+i),t.bindTexture(t.TEXTURE_2D,this._atlasTextures[i].texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e.pages[i].canvas),t.generateMipmap(t.TEXTURE_2D),this._atlasTextures[i].version=e.pages[i].version}setDimensions(t){this._dimensions=t}},d3=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(t,e,i,n=!1){if(this.selectionStart=e,this.selectionEnd=i,!e||!i||e[0]===i[0]&&e[1]===i[1]){this.clear();return}let a=t.buffers.active.ydisp,l=e[1]-a,u=i[1]-a,h=Math.max(l,0),f=Math.min(u,t.rows-1);if(h>=t.rows||f<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=n,this.viewportStartRow=l,this.viewportEndRow=u,this.viewportCappedStartRow=h,this.viewportCappedEndRow=f,this.startCol=e[0],this.endCol=i[0]}isCellSelected(t,e,i){return this.hasSelection?(i-=t.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?e>=this.startCol&&i>=this.viewportCappedStartRow&&e<this.endCol&&i<=this.viewportCappedEndRow:e<this.startCol&&i>=this.viewportCappedStartRow&&e>=this.endCol&&i<=this.viewportCappedEndRow:i>this.viewportStartRow&&i<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&i===this.viewportStartRow&&e>=this.startCol&&e<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportEndRow&&e<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportStartRow&&e>=this.startCol):!1}};function f3(){return new d3}var Qd=4,Rd=1,Ad=2,cp=3,m3=2147483648,_3=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=f3()}resize(t,e){let i=t*e*Qd;i!==this.cells.length&&(this.cells=new Uint32Array(i),this.lineLengths=new Uint32Array(e))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}},p3=`#version 300 es
|
|
65
|
+
layout (location = 0) in vec2 a_position;
|
|
66
|
+
layout (location = 1) in vec2 a_size;
|
|
67
|
+
layout (location = 2) in vec4 a_color;
|
|
68
|
+
layout (location = 3) in vec2 a_unitquad;
|
|
69
|
+
|
|
70
|
+
uniform mat4 u_projection;
|
|
71
|
+
|
|
72
|
+
out vec4 v_color;
|
|
73
|
+
|
|
74
|
+
void main() {
|
|
75
|
+
vec2 zeroToOne = a_position + (a_unitquad * a_size);
|
|
76
|
+
gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
|
|
77
|
+
v_color = a_color;
|
|
78
|
+
}`,g3=`#version 300 es
|
|
79
|
+
precision lowp float;
|
|
80
|
+
|
|
81
|
+
in vec4 v_color;
|
|
82
|
+
|
|
83
|
+
out vec4 outColor;
|
|
84
|
+
|
|
85
|
+
void main() {
|
|
86
|
+
outColor = v_color;
|
|
87
|
+
}`,Un=8,up=Un*Float32Array.BYTES_PER_ELEMENT,v3=20*Un,h1=class{constructor(){this.attributes=new Float32Array(v3),this.count=0}},zn=0,d1=0,f1=0,m1=0,_1=0,p1=0,g1=0,S3=class extends Ir{constructor(t,e,i,n){super(),this._terminal=t,this._gl=e,this._dimensions=i,this._themeService=n,this._vertices=new h1,this._verticesCursor=new h1;let a=this._gl;this._program=pi(ix(a,p3,g3)),this._register(is(()=>a.deleteProgram(this._program))),this._projectionLocation=pi(a.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=a.createVertexArray(),a.bindVertexArray(this._vertexArrayObject);let l=new Float32Array([0,0,1,0,0,1,1,1]),u=a.createBuffer();this._register(is(()=>a.deleteBuffer(u))),a.bindBuffer(a.ARRAY_BUFFER,u),a.bufferData(a.ARRAY_BUFFER,l,a.STATIC_DRAW),a.enableVertexAttribArray(3),a.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let h=new Uint8Array([0,1,2,3]),f=a.createBuffer();this._register(is(()=>a.deleteBuffer(f))),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,f),a.bufferData(a.ELEMENT_ARRAY_BUFFER,h,a.STATIC_DRAW),this._attributesBuffer=pi(a.createBuffer()),this._register(is(()=>a.deleteBuffer(this._attributesBuffer))),a.bindBuffer(a.ARRAY_BUFFER,this._attributesBuffer),a.enableVertexAttribArray(0),a.vertexAttribPointer(0,2,a.FLOAT,!1,up,0),a.vertexAttribDivisor(0,1),a.enableVertexAttribArray(1),a.vertexAttribPointer(1,2,a.FLOAT,!1,up,2*Float32Array.BYTES_PER_ELEMENT),a.vertexAttribDivisor(1,1),a.enableVertexAttribArray(2),a.vertexAttribPointer(2,4,a.FLOAT,!1,up,4*Float32Array.BYTES_PER_ELEMENT),a.vertexAttribDivisor(2,1),this._updateCachedColors(n.colors),this._register(this._themeService.onChangeColors(d=>{this._updateCachedColors(d),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(t){let e=this._gl;e.useProgram(this._program),e.bindVertexArray(this._vertexArrayObject),e.uniformMatrix4fv(this._projectionLocation,!1,tx),e.bindBuffer(e.ARRAY_BUFFER,this._attributesBuffer),e.bufferData(e.ARRAY_BUFFER,t.attributes,e.DYNAMIC_DRAW),e.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,e.UNSIGNED_BYTE,0,t.count)}handleResize(){this._updateViewportRectangle()}setDimensions(t){this._dimensions=t}_updateCachedColors(t){this._bgFloat=this._colorToFloat32Array(t.background),this._cursorFloat=this._colorToFloat32Array(t.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(t){let e=this._terminal,i=this._vertices,n=1,a,l,u,h,f,d,p,v,g,S,b;for(a=0;a<e.rows;a++){for(u=-1,h=0,f=0,d=!1,l=0;l<e.cols;l++)p=(a*e.cols+l)*Qd,v=t.cells[p+Rd],g=t.cells[p+Ad],S=!!(g&67108864),(v!==h||g!==f&&(d||S))&&((h!==0||d&&f!==0)&&(b=n++*Un,this._updateRectangle(i,b,f,h,u,l,a)),u=l,h=v,f=g,d=S);(h!==0||d&&f!==0)&&(b=n++*Un,this._updateRectangle(i,b,f,h,u,e.cols,a))}i.count=n}updateCursor(t){let e=this._verticesCursor,i=t.cursor;if(!i||i.style==="block"){e.count=0;return}let n,a=0;(i.style==="bar"||i.style==="outline")&&(n=a++*Un,this._addRectangleFloat(e.attributes,n,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,i.style==="bar"?i.dpr*i.cursorWidth:i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),(i.style==="underline"||i.style==="outline")&&(n=a++*Un,this._addRectangleFloat(e.attributes,n,i.x*this._dimensions.device.cell.width,(i.y+1)*this._dimensions.device.cell.height-i.dpr,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat)),i.style==="outline"&&(n=a++*Un,this._addRectangleFloat(e.attributes,n,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat),n=a++*Un,this._addRectangleFloat(e.attributes,n,(i.x+i.width)*this._dimensions.device.cell.width-i.dpr,i.y*this._dimensions.device.cell.height,i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),e.count=a}_updateRectangle(t,e,i,n,a,l,u){if(i&67108864)switch(i&50331648){case 16777216:case 33554432:zn=this._themeService.colors.ansi[i&255].rgba;break;case 50331648:zn=(i&16777215)<<8;break;default:zn=this._themeService.colors.foreground.rgba}else switch(n&50331648){case 16777216:case 33554432:zn=this._themeService.colors.ansi[n&255].rgba;break;case 50331648:zn=(n&16777215)<<8;break;default:zn=this._themeService.colors.background.rgba}t.attributes.length<e+4&&(t.attributes=a3(t.attributes,this._terminal.rows*this._terminal.cols*Un)),d1=a*this._dimensions.device.cell.width,f1=u*this._dimensions.device.cell.height,m1=(zn>>24&255)/255,_1=(zn>>16&255)/255,p1=(zn>>8&255)/255,g1=1,this._addRectangle(t.attributes,e,d1,f1,(l-a)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,m1,_1,p1,g1)}_addRectangle(t,e,i,n,a,l,u,h,f,d){t[e]=i/this._dimensions.device.canvas.width,t[e+1]=n/this._dimensions.device.canvas.height,t[e+2]=a/this._dimensions.device.canvas.width,t[e+3]=l/this._dimensions.device.canvas.height,t[e+4]=u,t[e+5]=h,t[e+6]=f,t[e+7]=d}_addRectangleFloat(t,e,i,n,a,l,u){t[e]=i/this._dimensions.device.canvas.width,t[e+1]=n/this._dimensions.device.canvas.height,t[e+2]=a/this._dimensions.device.canvas.width,t[e+3]=l/this._dimensions.device.canvas.height,t[e+4]=u[0],t[e+5]=u[1],t[e+6]=u[2],t[e+7]=u[3]}_colorToFloat32Array(t){return new Float32Array([(t.rgba>>24&255)/255,(t.rgba>>16&255)/255,(t.rgba>>8&255)/255,(t.rgba&255)/255])}},y3=class extends Ir{constructor(t,e,i,n,a,l,u,h){super(),this._container=e,this._alpha=a,this._coreBrowserService=l,this._optionsService=u,this._themeService=h,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${i}-layer`),this._canvas.style.zIndex=n.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(f=>{this._refreshCharAtlas(t,f),this.reset(t)})),this._register(is(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=pi(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(t){}handleFocus(t){}handleCursorMove(t){}handleGridChanged(t,e,i){}handleSelectionChanged(t,e,i,n=!1){}_setTransparency(t,e){if(e===this._alpha)return;let i=this._canvas;this._alpha=e,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,i),this._refreshCharAtlas(t,this._themeService.colors),this.handleGridChanged(t,0,t.rows-1)}_refreshCharAtlas(t,e){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=JC(t,this._optionsService.rawOptions,e,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(t,e){this._deviceCellWidth=e.device.cell.width,this._deviceCellHeight=e.device.cell.height,this._deviceCharWidth=e.device.char.width,this._deviceCharHeight=e.device.char.height,this._deviceCharLeft=e.device.char.left,this._deviceCharTop=e.device.char.top,this._canvas.width=e.device.canvas.width,this._canvas.height=e.device.canvas.height,this._canvas.style.width=`${e.css.canvas.width}px`,this._canvas.style.height=`${e.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(t,this._themeService.colors)}_fillBottomLineAtCells(t,e,i=1){this._ctx.fillRect(t*this._deviceCellWidth,(e+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,i*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(t,e,i,n){this._alpha?this._ctx.clearRect(t*this._deviceCellWidth,e*this._deviceCellHeight,i*this._deviceCellWidth,n*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(t*this._deviceCellWidth,e*this._deviceCellHeight,i*this._deviceCellWidth,n*this._deviceCellHeight))}_fillCharTrueColor(t,e,i,n){this._ctx.font=this._getFont(t,!1,!1),this._ctx.textBaseline=FC,this._clipCell(i,n,e.getWidth()),this._ctx.fillText(e.getChars(),i*this._deviceCellWidth+this._deviceCharLeft,n*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(t,e,i){this._ctx.beginPath(),this._ctx.rect(t*this._deviceCellWidth,e*this._deviceCellHeight,i*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(t,e,i){let n=e?t.options.fontWeightBold:t.options.fontWeight;return`${i?"italic":""} ${n} ${t.options.fontSize*this._coreBrowserService.dpr}px ${t.options.fontFamily}`}},b3=class extends y3{constructor(t,e,i,n,a,l,u){super(i,t,"link",e,!0,a,l,u),this._register(n.onShowLinkUnderline(h=>this._handleShowLinkUnderline(h))),this._register(n.onHideLinkUnderline(h=>this._handleHideLinkUnderline(h)))}resize(t,e){super.resize(t,e),this._state=void 0}reset(t){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let t=this._state.y2-this._state.y1-1;t>0&&this._clearCells(0,this._state.y1+1,this._state.cols,t),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(t){if(t.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:t.fg!==void 0&&s3(t.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[t.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,t.y1===t.y2)this._fillBottomLineAtCells(t.x1,t.y1,t.x2-t.x1);else{this._fillBottomLineAtCells(t.x1,t.y1,t.cols-t.x1);for(let e=t.y1+1;e<t.y2;e++)this._fillBottomLineAtCells(0,e,t.cols);this._fillBottomLineAtCells(0,t.y2,t.x2)}this._state=t}_handleHideLinkUnderline(t){this._clearCurrentLink()}},Mo=typeof window=="object"?window:globalThis,vg=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new It,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new It,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,i){if(this.getZoomLevel(i)===e)return;let n=this.getWindowId(i);this.mapWindowIdToZoomLevel.set(n,e),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,i){this.mapWindowIdToZoomFactor.set(this.getWindowId(i),e)}setFullscreen(e,i){if(this.isFullscreen(i)===e)return;let n=this.getWindowId(i);this.mapWindowIdToFullScreen.set(n,e),this._onDidChangeFullscreen.fire(n)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};vg.INSTANCE=new vg;var sx=vg;function w3(t,e,i){typeof e=="string"&&(e=t.matchMedia(e)),e.addEventListener("change",i)}sx.INSTANCE.onDidChangeZoomLevel;sx.INSTANCE.onDidChangeFullscreen;var Jl=typeof navigator=="object"?navigator.userAgent:"";Jl.indexOf("Firefox")>=0;Jl.indexOf("AppleWebKit")>=0;var C3=Jl.indexOf("Chrome")>=0;!C3&&Jl.indexOf("Safari")>=0;Jl.indexOf("Electron/")>=0;Jl.indexOf("Android")>=0;var hp=!1;if(typeof Mo.matchMedia=="function"){let t=Mo.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=Mo.matchMedia("(display-mode: fullscreen)");hp=t.matches,w3(Mo,t,({matches:i})=>{hp&&e.matches||(hp=i)})}var Ul="en",dp=!1,rx=!1,dd,Md=Ul,v1=Ul,x3,In,Po=globalThis,Ws;typeof Po.vscode<"u"&&typeof Po.vscode.process<"u"?Ws=Po.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(Ws=process);var k3=typeof Ws?.versions?.electron=="string",E3=k3&&Ws?.type==="renderer";if(typeof Ws=="object"){Ws.platform,Ws.platform,dp=Ws.platform==="linux",dp&&Ws.env.SNAP&&Ws.env.SNAP_REVISION,Ws.env.CI||Ws.env.BUILD_ARTIFACTSTAGINGDIRECTORY,dd=Ul,Md=Ul;let t=Ws.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t);dd=e.userLocale,v1=e.osLocale,Md=e.resolvedLanguage||Ul,x3=e.languagePack?.translationsConfigFile}catch{}rx=!0}else typeof navigator=="object"&&!E3?(In=navigator.userAgent,In.indexOf("Windows")>=0,In.indexOf("Macintosh")>=0,(In.indexOf("Macintosh")>=0||In.indexOf("iPad")>=0||In.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,dp=In.indexOf("Linux")>=0,In?.indexOf("Mobi")>=0,Md=globalThis._VSCODE_NLS_LANGUAGE||Ul,dd=navigator.language.toLowerCase(),v1=dd):console.error("Unable to resolve platform.");var S1=rx,on=In,Oa=Md,T3;(t=>{function e(){return Oa}t.value=e;function i(){return Oa.length===2?Oa==="en":Oa.length>=3?Oa[0]==="e"&&Oa[1]==="n"&&Oa[2]==="-":!1}t.isDefaultVariant=i;function n(){return Oa==="en"}t.isDefault=n})(T3||={});var R3=typeof Po.postMessage=="function"&&!Po.importScripts;(()=>{if(R3){let t=[];Po.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let n=0,a=t.length;n<a;n++){let l=t[n];if(l.id===i.data.vscodeScheduleAsyncWork){t.splice(n,1),l.callback();return}}});let e=0;return i=>{let n=++e;t.push({id:n,callback:i}),Po.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();var A3=!!(on&&on.indexOf("Chrome")>=0);on&&on.indexOf("Firefox")>=0;!A3&&on&&on.indexOf("Safari")>=0;on&&on.indexOf("Edg/")>=0;on&&on.indexOf("Android")>=0;var Bl=typeof navigator=="object"?navigator:{};S1||document.queryCommandSupported&&document.queryCommandSupported("copy")||Bl&&Bl.clipboard&&Bl.clipboard.writeText,S1||Bl&&Bl.clipboard&&Bl.clipboard.readText;var Qg=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(t,e){this._keyCodeToStr[t]=e,this._strToKeyCode[e.toLowerCase()]=t}keyCodeToStr(t){return this._keyCodeToStr[t]}strToKeyCode(t){return this._strToKeyCode[t.toLowerCase()]||0}},fp=new Qg,y1=new Qg,b1=new Qg;new Array(230);var M3;(t=>{function e(h){return fp.keyCodeToStr(h)}t.toString=e;function i(h){return fp.strToKeyCode(h)}t.fromString=i;function n(h){return y1.keyCodeToStr(h)}t.toUserSettingsUS=n;function a(h){return b1.keyCodeToStr(h)}t.toUserSettingsGeneral=a;function l(h){return y1.strToKeyCode(h)||b1.strToKeyCode(h)}t.fromUserSettings=l;function u(h){if(h>=98&&h<=113)return null;switch(h){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return fp.keyCodeToStr(h)}t.toElectronAccelerator=u})(M3||={});var nx=Object.freeze(function(t,e){let i=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(i)}}}),L3;(t=>{function e(i){return i===t.None||i===t.Cancelled||i instanceof D3?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}t.isCancellationToken=e,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:jn.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:nx})})(L3||={});var D3=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?nx:(this._emitter||(this._emitter=new It),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},O3;(t=>{async function e(n){let a,l=await Promise.all(n.map(u=>u.then(h=>h,h=>{a||(a=h)})));if(typeof a<"u")throw a;return l}t.settled=e;function i(n){return new Promise(async(a,l)=>{try{await n(a,l)}catch(u){l(u)}})}t.withAsyncBody=i})(O3||={});var w1=class vr{static fromArray(e){return new vr(i=>{i.emitMany(e)})}static fromPromise(e){return new vr(async i=>{i.emitMany(await e)})}static fromPromises(e){return new vr(async i=>{await Promise.all(e.map(async n=>i.emitOne(await n)))})}static merge(e){return new vr(async i=>{await Promise.all(e.map(async n=>{for await(let a of n)i.emitOne(a)}))})}constructor(e,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new It,queueMicrotask(async()=>{let n={emitOne:a=>this.emitOne(a),emitMany:a=>this.emitMany(a),reject:a=>this.reject(a)};try{await Promise.resolve(e(n)),this.resolve()}catch(a){this.reject(a)}finally{n.emitOne=void 0,n.emitMany=void 0,n.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===1)return{done:!0,value:void 0};await jn.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(e,i){return new vr(async n=>{for await(let a of e)n.emitOne(i(a))})}map(e){return vr.map(this,e)}static filter(e,i){return new vr(async n=>{for await(let a of e)i(a)&&n.emitOne(a)})}filter(e){return vr.filter(this,e)}static coalesce(e){return vr.filter(e,i=>!!i)}coalesce(){return vr.coalesce(this)}static async toPromise(e){let i=[];for await(let n of e)i.push(n);return i}toPromise(){return vr.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};w1.EMPTY=w1.fromArray([]);var{getWindow:B3}=(function(){let t=new Map,e={window:Mo,disposables:new jl};t.set(Mo.vscodeWindowId,e);let i=new It,n=new It,a=new It;function l(u,h){return(typeof u=="number"?t.get(u):void 0)??(h?e:void 0)}return{onDidRegisterWindow:i.event,onWillUnregisterWindow:a.event,onDidUnregisterWindow:n.event,registerWindow(u){if(t.has(u.vscodeWindowId))return Ir.None;let h=new jl,f={window:u,disposables:h.add(new jl)};return t.set(u.vscodeWindowId,f),h.add(is(()=>{t.delete(u.vscodeWindowId),n.fire(u)})),h.add(Sg(u,P3.BEFORE_UNLOAD,()=>{a.fire(u)})),i.fire(f),h},getWindows(){return t.values()},getWindowsCount(){return t.size},getWindowId(u){return u.vscodeWindowId},hasWindow(u){return t.has(u)},getWindowById:l,getWindow(u){let h=u;if(h?.ownerDocument?.defaultView)return h.ownerDocument.defaultView.window;let f=u;return f?.view?f.view.window:Mo},getDocument(u){return B3(u).document}}})(),N3=class{constructor(t,e,i,n){this._node=t,this._type=e,this._handler=i,this._options=n||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function Sg(t,e,i,n){return new N3(t,e,i,n)}var P3={BEFORE_UNLOAD:"beforeunload"},z3=class extends Ir{constructor(t,e,i,n,a,l,u,h,f){super(),this._terminal=t,this._characterJoinerService=e,this._charSizeService=i,this._coreBrowserService=n,this._coreService=a,this._decorationService=l,this._optionsService=u,this._themeService=h,this._cursorBlinkStateManager=new lu,this._charAtlasDisposable=this._register(new lu),this._observerDisposable=this._register(new lu),this._model=new _3,this._workCell=new c1,this._workCell2=new c1,this._rectangleRenderer=this._register(new lu),this._glyphRenderer=this._register(new lu),this._onChangeTextureAtlas=this._register(new It),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new It),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new It),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new It),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new It),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");let d={antialias:!1,depth:!1,preserveDrawingBuffer:f};if(this._gl=this._canvas.getContext("webgl2",d),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new ML(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new b3(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,u,this._themeService)],this.dimensions=RL(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(u.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(Sg(this._canvas,"webglcontextlost",p=>{console.log("webglcontextlost event received"),p.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(p)},3e3)})),this._register(Sg(this._canvas,"webglcontextrestored",p=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,o1(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=l1(this._canvas,this._coreBrowserService.window,(p,v)=>this._setCanvasDevicePixelDimensions(p,v)),this._register(this._coreBrowserService.onWindowChange(p=>{this._observerDisposable.value=l1(this._canvas,p,(v,g)=>this._setCanvasDevicePixelDimensions(v,g))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(is(()=>{for(let p of this._renderLayers)p.dispose();this._canvas.parentElement?.removeChild(this._canvas),o1(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(t,e){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let i of this._renderLayers)i.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(let t of this._renderLayers)t.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let t of this._renderLayers)t.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(t,e,i){for(let n of this._renderLayers)n.handleSelectionChanged(this._terminal,t,e,i);this._model.selection.update(this._core,t,e,i),this._requestRedrawViewport()}handleCursorMove(){for(let t of this._renderLayers)t.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new S3(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new h3(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let t=JC(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr,this._deviceMaxTextureSize);this._charAtlas!==t&&(this._onChangeTextureAtlas.fire(t.pages[0].canvas),this._charAtlasDisposable.value=PC(jn.forward(t.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),jn.forward(t.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=t,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(t){this._model.clear(),t&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(let t of this._renderLayers)t.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(t,e){if(!this._isAttached)if(this._core.screenElement?.isConnected&&this._charSizeService.width&&this._charSizeService.height)this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;else return;for(let i of this._renderLayers)i.handleGridChanged(this._terminal,t,e);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(t,e),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new r3(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(t,e){let i=this._core,n=this._workCell,a,l,u,h,f,d,p=0,v=!0,g,S,b,C,x,E,A,B,R;t=C1(t,i.rows-1,0),e=C1(e,i.rows-1,0);let $=this._coreService.decPrivateModes.cursorStyle??i.options.cursorStyle??"block",F=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,U=F-i.buffer.ydisp,z=Math.min(this._terminal.buffer.active.cursorX,i.cols-1),V=-1,se=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let ee=!1;for(l=t;l<=e;l++)for(u=l+i.buffer.ydisp,h=i.buffer.lines.get(u),this._model.lineLengths[l]=0,b=F===u,p=0,f=this._characterJoinerService.getJoinedCharacters(u),B=0;B<i.cols;B++){if(a=this._cellColorResolver.result.bg,h.loadCell(B,n),B===0&&(a=this._cellColorResolver.result.bg),d=!1,v=B>=p,g=B,f.length>0&&B===f[0][0]&&v){S=f.shift();let M=this._model.selection.isCellSelected(this._terminal,S[0],u);for(A=S[0]+1;A<S[1];A++)v&&=M===this._model.selection.isCellSelected(this._terminal,A,u);v&&=!b||z<S[0]||z>=S[1],v?(d=!0,n=new H3(n,h.translateToString(!0,S[0],S[1]),S[1]-S[0]),g=S[1]-1):p=S[1]}if(C=n.getChars(),x=n.getCode(),A=(l*i.cols+B)*Qd,this._cellColorResolver.resolve(n,B,u,this.dimensions.device.cell.width),se&&u===F&&(B===z&&(this._model.cursor={x:z,y:U,width:n.getWidth(),style:this._coreBrowserService.isFocused?$:i.options.cursorInactiveStyle,cursorWidth:i.options.cursorWidth,dpr:this._devicePixelRatio},V=z+n.getWidth()-1),B>=z&&B<=V&&(this._coreBrowserService.isFocused&&$==="block"||this._coreBrowserService.isFocused===!1&&i.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),x!==0&&(this._model.lineLengths[l]=B+1),!(this._model.cells[A]===x&&this._model.cells[A+Rd]===this._cellColorResolver.result.bg&&this._model.cells[A+Ad]===this._cellColorResolver.result.fg&&this._model.cells[A+cp]===this._cellColorResolver.result.ext)&&(ee=!0,C.length>1&&(x|=m3),this._model.cells[A]=x,this._model.cells[A+Rd]=this._cellColorResolver.result.bg,this._model.cells[A+Ad]=this._cellColorResolver.result.fg,this._model.cells[A+cp]=this._cellColorResolver.result.ext,E=n.getWidth(),this._glyphRenderer.value.updateCell(B,l,x,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,C,E,a),d)){for(n=this._workCell,B++;B<=g;B++)R=(l*i.cols+B)*Qd,this._glyphRenderer.value.updateCell(B,l,0,0,0,0,bL,0,0),this._model.cells[R]=0,this._model.cells[R+Rd]=this._cellColorResolver.result.bg,this._model.cells[R+Ad]=this._cellColorResolver.result.fg,this._model.cells[R+cp]=this._cellColorResolver.result.ext;B--}}ee&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){!this._charSizeService.width||!this._charSizeService.height||(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(t,e){this._canvas.width===t&&this._canvas.height===e||(this._canvas.width=t,this._canvas.height=e,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let t=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:t,end:t})}},H3=class extends Il{constructor(t,e,i){super(),this.content=0,this.combinedData="",this.fg=t.fg,this.bg=t.bg,this.combinedData=e,this._width=i}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(t){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function C1(t,e,i=0){return Math.max(Math.min(t,e),i)}var x1="di$target",k1="di$dependencies",mp=new Map;function ln(t){if(mp.has(t))return mp.get(t);let e=function(i,n,a){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");I3(e,i,a)};return e._id=t,mp.set(t,e),e}function I3(t,e,i){e[x1]===e?e[k1].push({id:t,index:i}):(e[k1]=[{id:t,index:i}],e[x1]=e)}ln("BufferService");ln("CoreMouseService");ln("CoreService");ln("CharsetService");ln("InstantiationService");ln("LogService");var U3=ln("OptionsService");ln("OscLinkService");ln("UnicodeService");ln("DecorationService");var F3={trace:0,debug:1,info:2,warn:3,error:4,off:5},$3="xterm.js: ",E1=class extends Ir{constructor(t){super(),this._optionsService=t,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=F3[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(t){for(let e=0;e<t.length;e++)typeof t[e]=="function"&&(t[e]=t[e]())}_log(t,e,i){this._evalLazyOptionalParams(i),t.call(console,(this._optionsService.options.logger?"":$3)+e,...i)}trace(t,...e){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,t,e)}debug(t,...e){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,t,e)}info(t,...e){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,t,e)}warn(t,...e){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,t,e)}error(t,...e){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,t,e)}};E1=cL([uL(0,U3)],E1);var W3=class extends Ir{constructor(t){if(IC&&yL()<16){let e={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",e))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=t,this._onChangeTextureAtlas=this._register(new It),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new It),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new It),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new It),this.onContextLoss=this._onContextLoss.event}activate(t){let e=t._core;if(!t.element){this._register(e.onWillOpen(()=>this.activate(t)));return}this._terminal=t;let i=e.coreService,n=e.optionsService,a=e,l=a._renderService,u=a._characterJoinerService,h=a._charSizeService,f=a._coreBrowserService,d=a._decorationService;a._logService;let p=a._themeService;this._renderer=this._register(new z3(t,u,h,f,i,d,n,p,this._preserveDrawingBuffer)),this._register(jn.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(jn.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(jn.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(jn.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),l.setRenderer(this._renderer),this._register(is(()=>{if(this._terminal._core._store._isDisposed)return;let v=this._terminal._core._renderService;v.setRenderer(this._terminal._core._createRenderer()),v.handleResize(t.cols,t.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}};const j3=(t,e)=>`${e.location.protocol==="https:"?"wss":"ws"}://${e.location.host}/ws/terminal/${t}`,V3={background:"#09090b",foreground:"#e4e4e7",cursor:"#e4e4e7",cursorAccent:"#09090b",selectionBackground:"#3f3f46",black:"#18181b",red:"#ef4444",green:"#22c55e",yellow:"#eab308",blue:"#3b82f6",magenta:"#a855f7",cyan:"#06b6d4",white:"#e4e4e7",brightBlack:"#52525b",brightRed:"#f87171",brightGreen:"#4ade80",brightYellow:"#facc15",brightBlue:"#60a5fa",brightMagenta:"#c084fc",brightCyan:"#22d3ee",brightWhite:"#fafafa"},q3=t=>{const e=t.element?.querySelector(".xterm-viewport");if(!e)return 0;const i=e.offsetWidth-e.clientWidth;return i>0?i:0},Y3=t=>{if(typeof t!="string")return null;try{return JSON.parse(t)}catch{return null}},G3=(t,e,i={})=>{const n=i.createTerminal??(()=>new JM({allowProposedApi:!0,cursorBlink:!0,fontFamily:"Menlo, Monaco, 'Courier New', monospace",fontSize:12,lineHeight:1.2,theme:V3})),a=i.createFitAddon??(()=>new iL),l=i.WebSocketImpl??WebSocket,u=i.windowRef??window,h=u,f=n(),d=a(),p=new lL;let v=null,g=null,S=null,b=null,C=0;const x=6;let E=!1,A=!1,B=null;f.loadAddon(d),f.loadAddon(p),f.open(t),h.__TERMbridgeExposeTerminal&&(h.__TERMbridgeTerminal=f);const R=new l(j3(e,u)),$=P=>{A&&R.send(JSON.stringify(P))},F=()=>{const P=d.proposeDimensions(),T=t.clientWidth||f.element?.clientWidth||0,L=t.clientHeight||f.element?.clientHeight||0;if(!P||P.cols<1||P.rows<1||T<1||L<1){V();return}const H=q3(f),Y=T/P.cols,X=Math.ceil(H/Y),D=Math.max(1,P.cols-X),G=P.rows;B&&B.cols===D&&B.rows===G||(B={cols:D,rows:G},C=0,f.resize(D,G),f.scrollToBottom(),$({type:"resize",cols:D,rows:G}))},U=()=>{if(b!==null&&(clearTimeout(b),b=null),S===null){E=!1;return}E?clearTimeout(S):u.cancelAnimationFrame?.(S),S=null,E=!1},z=()=>{U();const P=u.requestAnimationFrame;if(typeof P=="function"){E=!1,S=P(()=>{S=null,F()});return}E=!0,S=window.setTimeout(()=>{S=null,E=!1,F()},16)},V=()=>{C>=x||(C+=1,b=window.setTimeout(()=>{b=null,z()},50))};f.onData(P=>{$({type:"input",data:P})}),R.addEventListener("open",()=>{A=!0,B=null,z()}),R.addEventListener("message",P=>{const T=Y3(P.data);T&&T.type==="output"&&f.write(T.data)}),u.addEventListener("resize",z);const se=u.ResizeObserver;if(typeof se=="function"){const P=new se(()=>{z()});g=P,P.observe(t)}if(typeof u.WebGLRenderingContext<"u")try{v=new W3,v.onContextLoss(()=>{v?.dispose(),v=null}),f.loadAddon(v)}catch{}z();const ee=u.document?.fonts?.ready;return ee&&ee.then(()=>z()).catch(()=>{}),{sendControl:P=>{$({type:"control",key:P})},sendInput:P=>{P&&$({type:"input",data:P})},destroy:()=>{if(u.removeEventListener("resize",z),g?.disconnect(),g=null,U(),R.close(),v){try{v.dispose()}catch{}v=null}f.dispose()}}};const K3=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),X3=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,i,n)=>n?n.toUpperCase():i.toLowerCase()),T1=t=>{const e=X3(t);return e.charAt(0).toUpperCase()+e.slice(1)},ax=(...t)=>t.filter((e,i,n)=>!!e&&e.trim()!==""&&n.indexOf(e)===i).join(" ").trim(),Z3=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};var Q3={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 J3=w.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:i=2,absoluteStrokeWidth:n,className:a="",children:l,iconNode:u,...h},f)=>w.createElement("svg",{ref:f,...Q3,width:e,height:e,stroke:t,strokeWidth:n?Number(i)*24/Number(e):i,className:ax("lucide",a),...!l&&!Z3(h)&&{"aria-hidden":"true"},...h},[...u.map(([d,p])=>w.createElement(d,p)),...Array.isArray(l)?l:[l]]));const xr=(t,e)=>{const i=w.forwardRef(({className:n,...a},l)=>w.createElement(J3,{ref:l,iconNode:e,className:ax(`lucide-${K3(T1(t))}`,`lucide-${t}`,n),...a}));return i.displayName=T1(t),i};const eD=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],tD=xr("arrow-down",eD);const iD=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],sD=xr("arrow-left",iD);const rD=[["path",{d:"M17 12H3",key:"8awo09"}],["path",{d:"m11 18 6-6-6-6",key:"8c2y43"}],["path",{d:"M21 5v14",key:"nzette"}]],nD=xr("arrow-right-to-line",rD);const aD=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],oD=xr("arrow-right",aD);const lD=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],cD=xr("arrow-up",lD);const uD=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],hD=xr("check",uD);const dD=[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]],fD=xr("command",dD);const mD=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],_D=xr("corner-down-left",mD);const pD=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],gD=xr("plus",pD);const vD=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],SD=xr("send",vD);const yD=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],bD=xr("terminal",yD);const wD=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],CD=xr("x",wD);let R1,ku,vi=typeof window<"u"&&window.document&&window.document.createElement?w.useLayoutEffect:w.useEffect,Fl=t=>(e,i)=>"calc("+e+" + ("+i+" - "+e+") * "+t+")",Cs=typeof window<"u"?window.navigator.userAgent:null,$n="unknown",Gt="unknown";if(typeof window<"u"&&navigator.userAgentData){var _p;!((_p=navigator.userAgentData.brands)===null||_p===void 0)&&_p.some(t=>t.brand==="Chromium")&&($n="chromium"),navigator.userAgentData.platform==="Android"&&(Gt="android")}if(Gt==="unknown"&&Cs?.match(/android/i)&&(Gt="android"),$n==="unknown"&&(Cs?.match(/Chrome/i)?$n="chromium":Cs?.match(/Firefox/i)?$n="gecko":Cs?.match(/Safari|iPhone/i)&&($n="webkit")),$n==="webkit"){if(Cs?.match(/iPhone/i))Gt="ios";else if(Cs?.match(/iPad/i))Gt="ipados";else if(Cs?.match(/Macintosh/i))try{document?.createEvent("TouchEvent"),Gt="ipados"}catch{Gt="macos"}}var ox={};ox={mapping:{Sheet:{componentName:"a",elementNames:{root:0,view:1,backdrop:2,backdropTrap:3,primaryScrollTrapRoot:4,secondaryScrollTrapRoot:5,scrollContainer:6,frontSpacer:7,backSpacer:8,detentMarker:9,contentWrapper:10,content:11,bleedingBackground:12,stickyContainer:13,sticky:14,leftEdge:15,trigger:16,handle:17,outlet:18},variationSetsNames:{openness:"A",staging:"B",opennessClosedStatus:"C",position:"D",positionCoveredStatus:"E",placement:"F",track:"G",swipeDisabled:"H",swipeOutDisabledWithDetent:"I",swipeOvershootDisabled:"J",bleedDisabled:"K",inertOutside:"L",backdropSwipeable:"M",scrollContainerShouldBePassThrough:"N",swipeTrap:"M"},variationValuesNames:{open:"a",opening:"b",closed:"c",closing:"d",none:"e",top:"f",bottom:"g",left:"h",right:"i",horizontal:"j",vertical:"k",front:"l",covered:"m",true:"o",false:"p",auto:"q",center:"r",pending:"s","flushing-to-preparing-open":"t","flushing-to-preparing-opening":"u","preparing-open":"v","preparing-opening":"x","safe-to-unmount":"y",content:"z",root:"aa","going-down":"ab","going-up":"ac",indeterminate:"ad",idle:"ae","come-back":"af",out:"ag",stepping:"ah",both:"ai",none:"aj"}},ScrollTrap:{componentName:"b",elementNames:{root:0,stabiliser:1},variationSetsNames:{active:"A",axis:"B",automaticallyDisabledForOptimisation:"C"},variationValuesNames:{true:"a",false:"b",horizontal:"e",vertical:"f",both:"g",none:"h"}},Scroll:{componentName:"c",elementNames:{root:0,view:1,scrollContainer:2,content:3,UAScrollbarMeasurer:4,spy:5,startSpacer:6,endSpacer:7},variationSetsNames:{axis:"A",contentPlacement:"B",scrollTrapX:"C",scrollTrapY:"D",scrollGestureOvershoot:"E",scrollDisabled:"F",side:"G",pageScroll:"H",overflowX:"I",overflowY:"J",skipScrollAnimation:"K",scrollAnchoring:"L",scrollSnapType:"M",scrollPadding:"N",scrollTimelineName:"O",nativeScrollbar:"P",scrollOngoing:"Q"},variationValuesNames:{true:"a",false:"b",x:"c",y:"d",both:"e",unset:"f",contain:"g",start:"h",end:"i",center:"j",auto:"k",default:"l",none:"m",mandatoryX:"n",mandatoryY:"o",proximityX:"p",proximityY:"q"}},SlideShow:{componentName:"d",elementNames:{},variationSetsNames:{},variationValuesNames:{}},VisuallyHidden:{componentName:"e",elementNames:{root:0},variationSetsNames:{},variationValuesNames:{}},SpecialWrapper:{componentName:"f",elementNames:{root:0,content:1},variationSetsNames:{},variationValuesNames:{}},Fixed:{componentName:"g",elementNames:{root:0},variationSetsNames:{},variationValuesNames:{}},SheetStack:{componentName:"h",elementNames:{root:0,outlet:1},variationSetsNames:{},variationValuesNames:{}},AutoFocusTarget:{componentName:"i",elementNames:{root:0},variationSetsNames:{},variationValuesNames:{}}}};let ff=ox.mapping,xD=t=>{var e;return(e=ff[t].componentName)!==null&&e!==void 0?e:null},kD=(t,e)=>{var i;return(i=ff[t].elementNames[e])!==null&&i!==void 0?i:null},ED=(t,e)=>{var i;return(i=ff[t].variationSetsNames[e])!==null&&i!==void 0?i:null},TD=(t,e)=>{var i;return(i=ff[t].variationValuesNames[e])!==null&&i!==void 0?i:null},Ui=(t,e)=>w.useCallback((i,n=[],a)=>{var l,u;let h,f,d=(u=a==null||(l=a.dataSilk)===null||l===void 0?void 0:l.filter(Boolean).join(" "))!==null&&u!==void 0?u:"";{let p=xD(t);if(h=p+kD(t,i),e)for(let v=0;v<n.length;v++){let g=n[v],S=e[g],b=ED(t,g),C=TD(t,S);h+=S!=null?" "+p+b+C:""}f={className:a?.className,"data-silk":h+" "+d}}return f},[t,...e?Object.values(e):[]]),du=new WeakMap;var RD=typeof Float32Array=="function";function fd(t,e,i){return(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t}function A1(t,e,i){return 3*(1-3*i+3*e)*t*t+2*(3*i-6*e)*t+3*e}function AD(t){return t}var MD=function(t,e,i,n){if(!(0<=t&&t<=1&&0<=i&&i<=1))throw Error("bezier x values must be in [0, 1] range");if(t===e&&i===n)return AD;for(var a=RD?new Float32Array(11):Array(11),l=0;l<11;++l)a[l]=fd(.1*l,t,i);return function(u){return u===0||u===1?u:fd((function(h){for(var f=0,d=1;d!==10&&a[d]<=h;++d)f+=.1;var p=f+(h-a[--d])/(a[d+1]-a[d])*.1,v=A1(p,t,i);return v>=.001?(function(g,S,b,C){for(var x=0;x<4;++x){var E=A1(S,b,C);if(E===0)break;var A=fd(S,b,C)-g;S-=A/E}return S})(h,p,t,i):v===0?p:(function(g,S,b,C,x){var E,A,B=0;do(E=fd(A=S+(b-S)/2,C,x)-g)>0?b=A:S=A;while(Math.abs(E)>1e-7&&++B<10);return A})(h,f,f+.1,t,i)})(u),e,n)}};let Jd=t=>typeof t=="string"?document.querySelector(t):t?.(),lx=(t,e)=>Array.isArray(t)?t.includes(e):t===e,yg=t=>t?.getAttribute("data-silk-clone")==="true",LD=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]),Lo=t=>t instanceof HTMLInputElement&&!LD.has(t.type)||t instanceof HTMLTextAreaElement||t instanceof HTMLElement&&t.isContentEditable,M1=t=>t instanceof HTMLInputElement&&t.type==="color"||t instanceof HTMLSelectElement,Jg=typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,ef=()=>{var t;return window.innerHeight-200>((t=window.visualViewport)===null||t===void 0?void 0:t.height)};function rn({nativeEvent:t,defaultBehavior:e,handler:i}){let n=e;if(i)if(typeof i=="function"){let a={...e,nativeEvent:t,changeDefault:function(l){n={...e,...l},Object.assign(this,l)}};a.changeDefault=a.changeDefault.bind(a),i(a)}else n={...e,...i};return n}function cx(t){return(t.startsWith("rgb(")||t.startsWith("rgba("))&&t.endsWith(")")?t.substring(t.indexOf("(")+1,t.indexOf(")")).split(",").map(n=>n.trim()).slice(0,3).map(n=>parseFloat(n)):null}let L1=t=>{let e=null;return t.startsWith("rgb(")||t.startsWith("rgba(")?e=cx(t):t.startsWith("#")&&(e=(function(i){let n=i.replace(/^#/,""),a=n.length===3?n.split("").map(f=>f+f).join(""):n;if(!/^[0-9A-Fa-f]{6}$/.test(a))return null;let l=parseInt(a.slice(0,2),16),u=parseInt(a.slice(2,4),16),h=parseInt(a.slice(4,6),16);return[l,u,h]})(t)),e},DD=({color:t,overlays:e})=>{let i=[...t],n=e.length;for(let a=0;a<n;a++){let l=e[a],u=l.alpha;for(let h=0;h<3;h++)i[h]=(1-u)*i[h]+u*l.color[h]}return"rgb("+i.join(",")+")"},OD=t=>{w.useEffect(()=>{let e=()=>{ef()?t(!0):t(!1)};return e(),visualViewport.addEventListener("resize",e),()=>{visualViewport.removeEventListener("resize",e)}},[t])},BD=t=>t.matches('[data-silk~="0ad"]:not([data-silk~="0ai"]) *, [data-silk~="0ab"] *'),ux=t=>{let[e,i]=w.useState(!1),n=w.useCallback(a=>{t.current&&i(!!a&&!BD(t.current))},[t]);return OD(n),e},hx=()=>Gt==="android"&&$n==="chromium"&&typeof window<"u"&&!window.matchMedia("(display-mode: standalone), (display-mode: minimal-ui), (display-mode: fullscreen)").matches,ND=()=>{var t,e,i;return typeof window<"u"&&window.navigator.standalone&&((t=document.querySelector("meta[name='viewport']"))===null||t===void 0?void 0:t.content.includes("viewport-fit=cover"))&&((e=document.querySelector("meta[name='apple-mobile-web-app-capable']"))===null||e===void 0?void 0:e.content)==="yes"&&((i=document.querySelector("meta[name='apple-mobile-web-app-status-bar-style']"))===null||i===void 0?void 0:i.content)==="black-translucent"},Wa=()=>$n==="webkit",PD=()=>typeof document<"u"?document.querySelector('meta[name="theme-color"]'):null,Hu=({genericContext:t,customContext:e,value:i,children:n})=>e?j.jsx(e.Provider,{value:i,children:j.jsx(t.Provider,{value:i,children:n})}):j.jsx(t.Provider,{value:i,children:n});Hu.displayName="CustomisableContext";function bg(t){for(let e=0;e<t.length;e++)if(!t[e].matches('[data-silk~="0ad"]'))return t[e];return t[0]}let dx=(t,e)=>{var i;let{safelyFocusableElements:n,safelyTabbableElements:a}=mf(e,["[data-silk~='0ac']"]),l=qe.autoFocusTargets.filter(v=>v.layerId==="any"||v.layerId===t),u=l.filter(v=>lx(v.timing,"present")),h=n.filter(v=>u.map(g=>g.element).includes(v)),f=bg(h),d=bg(a);((i=f??d)!==null&&i!==void 0?i:e).focus({preventScroll:!0})},D1=(t,e,i)=>{let{focus:n}=rn({nativeEvent:null,defaultBehavior:{focus:!0},handler:i});n&&dx(t,e)},zD=(t,e,i,n)=>{if(!e.contains(document.activeElement)&&document.contains(document.activeElement))return;let{focus:a}=rn({nativeEvent:null,defaultBehavior:{focus:!0},handler:i});if(a){var l;let u=qe.autoFocusTargets.filter(g=>g.layerId==="any"||g.layerId===t),h=u.filter(g=>lx(g.timing,"dismiss")&&!e.contains(g.element)),{safelyFocusableElements:f}=mf(document.body),d=f.filter(g=>h.map(S=>S.element).includes(g)),p=bg(d);((l=p??n)!==null&&l!==void 0?l:document.body).focus({preventScroll:!0})}},O1=t=>{t.parentNode!=null&&t.parentNode.removeChild(t)},B1=()=>{let t=document.createElement("div");return t.tabIndex=0,t.style.position="fixed",t.setAttribute("aria-hidden","true"),t.setAttribute("data-silk","0aa"),t},HD=t=>{let e=B1(),i=B1();return t.insertAdjacentElement("beforebegin",e),t.insertAdjacentElement("afterend",i),()=>{O1(e),O1(i)}},ID=t=>!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length),mf=(t,e=[])=>{let i=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]","[tabindex]:not([disabled])",...e],n=i.join(","),a=t?[...t.matches(n)?[t]:[],...t.querySelectorAll(n)]:[],l=[...e,"[aria-hidden='true']","[aria-hidden='true'] *","[inert]","[inert] *"],u=a.map(g=>({element:g,tabbable:g.matches(':not([hidden]):not([tabindex^="-"])'),skippable:g.matches(l.join(","))||!ID(g)})),h=u.filter(g=>!g.skippable),f=h.map(g=>g.element),d=u.filter(g=>g.tabbable),p=d.filter(g=>!g.skippable),v=p.map(g=>g.element);return{allFocusableElementsWithData:u,safelyFocusableElements:f,allTabbableElementsWithData:d,safelyTabbableElements:v}},fx=(t,e)=>{let{safelyTabbableElements:i,allTabbableElementsWithData:n,allFocusableElementsWithData:a}=mf(t,["[data-silk~='0ac']"]),l=[...n],u=[...a];return e&&[l,u].forEach(h=>{h.unshift({element:t.previousElementSibling,tabbable:!0,skippable:!0}),h.push({element:t.nextElementSibling,tabbable:!0,skippable:!0})}),{safelyTabbableElements:i,allTabbableElementsWithGuardsWithData:l,allFocusableElementsWithGuardsWithData:u}},UD=(t,e)=>{let i;return(i=e.slice(0,t).reverse().find(n=>n.skippable===!1))||(i=e.slice(t+1-e.length).reverse().find(n=>n.skippable===!1)),i},N1=(t,e)=>{let i;return(i=e.slice(t+1).find(n=>n.skippable===!1))||(i=e.slice(0,t).find(n=>n.skippable===!1)),i},FD=({rootElements:t,e,fromElement:i,toElement:n,fallbackElement:a})=>{if(!n)return;let l=[],u=[],h=[];t.forEach(x=>{let{safelyTabbableElements:E,allTabbableElementsWithGuardsWithData:A,allFocusableElementsWithGuardsWithData:B}=fx(x,!0);l=[...l,...E],u=[...u,...A],h=[...h,...B]});let f=u.findIndex(x=>x.element===i),d=u.findIndex(x=>x.element===n),p=u[d],v=h.findIndex(x=>x.element===n),g=!!n&&t.includes(n)&&n.getAttribute("tabindex")==="-1";if(v===-1&&!g){let x=t.find(E=>E.getAttribute("tabindex")==="-1");x?.focus()}if(p?.skippable){var S,b,C;l.length?l.length===1?i===l[0]?(e.preventDefault(),e.stopPropagation(),requestAnimationFrame(()=>i.focus())):l[0].focus():f?d<f?(b=UD(d,u))===null||b===void 0||b.element.focus():(C=N1(d,u))===null||C===void 0||C.element.focus():(S=N1(d,u))===null||S===void 0||S.element.focus():a?.focus()}},mx=(t,e,i,n,a)=>{var l;if(!((l=t.target)===null||l===void 0)&&l.matches("[data-silk-clone]"))return;let u=[],h=[];i.forEach(f=>{let{safelyFocusableElements:d,safelyTabbableElements:p}=mf(f);u=[...u,...d],h=[...h,...p]}),i.includes(t.target)||u.includes(t.target)?t.target&&a(t.target):n?n.focus():h.length?h[0].focus():e.focus()},$D=(t,e)=>{var i;if(!((i=t.relatedTarget)===null||i===void 0)&&i.matches("[data-silk-clone]"))return;let n=Ld??t.target,a=Vl??t.relatedTarget;FD({rootElements:e,e:t,fromElement:n,toElement:a}),Ld=null,Vl=null},WD=(t,e,i,n,a)=>{let l=i.find(u=>u.contains(t.target));t.key!=="Tab"||l||(t.preventDefault(),t.stopPropagation(),mx(t,e,i,n,a))},Ld=null,Vl=null,jD=({rootElements:t,viewElement:e,elementFocusedLast:i,setElementFocusedLast:n})=>{let a=[];t.forEach(d=>{a.push(HD(d))});let l=(function(d,p=document){let v=new Set(d),g=new Set,S=document.createTreeWalker(p,NodeFilter.SHOW_ELEMENT,{acceptNode:E=>(E instanceof HTMLElement&&E.dataset.liveAnnouncer==="true"&&v.add(E),E.tagName==="HEAD"||E.tagName==="SCRIPT"||v.has(E)||E.parentElement&&g.has(E.parentElement)?NodeFilter.FILTER_REJECT:E instanceof HTMLElement&&E.getAttribute("role")==="row"||d.some(A=>E.contains(A))?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT)}),b=E=>{var A;let B=(A=du.get(E))!==null&&A!==void 0?A:0;(E.getAttribute("aria-hidden")!=="true"||B!==0)&&(B===0&&E.setAttribute("aria-hidden","true"),g.add(E),du.set(E,B+1))},C=S.nextNode();for(;C!=null;)b(C),C=S.nextNode();let x=new MutationObserver(E=>{for(let A of E)if(A.type==="childList"&&A.addedNodes.length!==0&&![...v,...g].some(B=>B.contains(A.target)))for(let B of A.addedNodes)B instanceof HTMLElement&&B.dataset.liveAnnouncer==="true"?v.add(B):B instanceof Element&&b(B)});return x.observe(p,{childList:!0,subtree:!0}),()=>{for(let E of(x.disconnect(),g)){let A=du.get(E);A===1?(E.removeAttribute("aria-hidden"),du.delete(E)):A!==void 0&&du.set(E,A-1)}}})(t,document),u=d=>$D(d,t),h=d=>mx(d,e,t,i,n),f=d=>WD(d,e,t,i,n);return document.addEventListener("keydown",f),document.addEventListener("focusout",u),document.addEventListener("focusin",h),()=>{document.removeEventListener("focusout",u),document.removeEventListener("focusin",h),document.removeEventListener("keydown",f),l(),a.forEach(d=>d())}},_f=new Set,VD=t=>{_f.add(t)},qD=t=>{_f.delete(t)},_x=(t,e,i,n)=>{let a=t[e],l=a.onClickOutside,u=a.dismissOverlayIfNotAlertDialog,h=a.viewElement,f=a.scrollContainerElement,d=a.backdropElement;if(f===n.target||d===n.target||!h?.contains(n.target)&&!i.find(p=>p.element.contains(n.target))&&(function(p){for(let v of qe.automaticLayerElements)if(v.contains(p))return!1;return!0})(n.target)){let p=!0,v=!0;if(l){let{dismiss:g,stopOverlayPropagation:S}=rn({nativeEvent:n,defaultBehavior:{dismiss:!0,stopOverlayPropagation:!0},handler:l});p=g,v=S}p&&u&&u(),e>0&&!v&&_x(t,e-1,i,n)}},wg=null,YD=(t,e,i)=>{var n;if(_f.size||!((n=t.target)===null||n===void 0)&&n.matches('[data-silk~="0ak"] *')||t.target===document.body&&wg!==document.body||!t.target||!t.target.isConnected)return;let a=e.length;_x(e,a-1,i,t),wg=null},GD=(t,e)=>{let i=a=>wg=a.target,n=a=>YD(a,t,e);return document.addEventListener("pointerdown",i,{capture:!0}),document.addEventListener("click",n,{capture:!0}),()=>{document.removeEventListener("pointerdown",i,{capture:!0}),document.removeEventListener("click",n,{capture:!0})}},px=(t,e,i)=>{let n=t[e],a=n.onEscapeKeyDown,l=n.dismissOverlayIfNotAlertDialog,u=!0,h=!0,f=!0;if(a){let{dismiss:d,nativePreventDefault:p,stopOverlayPropagation:v}=rn({nativeEvent:i,defaultBehavior:{nativePreventDefault:!0,dismiss:!0,stopOverlayPropagation:!0},handler:a});u=p,h=d,f=v}u&&i.preventDefault(),h&&l&&l(),e>0&&!f&&px(t,e-1,i)},KD=(t,e)=>{if(t.key!=="Escape"||_f.size)return;let i=e.length;px(e,i-1,t)},XD=t=>{let e=i=>KD(i,t);return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},ZD=t=>(t.setAttribute("aria-hidden","true"),()=>t.removeAttribute("aria-hidden")),QD=t=>{let{allTabbableElementsWithGuardsWithData:e}=fx(t);e.forEach(i=>{i.element.tabIndex=-1})},JD=t=>{var e;return t instanceof HTMLInputElement&&(!!(t.type==="password"||t.type==="text"&&t.autocomplete==="username"||!((e=t.closest("form"))===null||e===void 0)&&e.querySelector('input[type="password"]'))||void 0)},eO=t=>{var e,i;let n=t.getBoundingClientRect(),a=n.height,l=(i=(e=window.visualViewport)===null||e===void 0?void 0:e.height)!==null&&i!==void 0?i:0,u=l-n.bottom;return u>-a/2&&u<a+32},pp=t=>{var e;return(e=t?.closest('[data-silk~="0ab"], [data-silk~="0ad"]'))===null||e===void 0?void 0:e.matches('[data-silk~="0ah"]')},tO=()=>{let t=a=>{let l=a.target;if(pp(l)){var u;(u=l?.closest('[data-silk~="0ah"]'))===null||u===void 0||u.focus({preventScroll:!0}),document.removeEventListener("touchstart",t,{capture:!0})}},e=a=>{let l=a.target,u=a.relatedTarget;if(!u)return document.addEventListener("touchstart",t,{capture:!0,passive:!1});if(pp(u)&&(M1(u)&&document.addEventListener("touchstart",t,{capture:!0,passive:!1}),!(!Lo(u)&&!M1(u)||yg(l))))if(!JD(u)&&Lo(l)&&eO(l)){let h=l.cloneNode(!1);h.removeAttribute("id"),h.setAttribute("data-silk-clone","true"),h.style.setProperty("position","fixed"),h.style.setProperty("left","0"),h.style.setProperty("top","0"),h.style.setProperty("transform","translateY(-3000px) scale(0)"),document.documentElement.appendChild(h),Vl=u,h?.focus({preventScroll:!0}),setTimeout(()=>{Ld=l,Vl=u,u?.focus({preventScroll:!0}),h.remove()},32)}else Vl=u,u?.focus({preventScroll:!0})},i=a=>{var l;let u=a.target;!(u!==document.activeElement||!Lo(u)||ef())&&pp(u)&&((l=u?.closest('[data-silk~="0ab"], [data-silk~="0ad"]'))===null||l===void 0||l.focus({preventScroll:!0}))},n=a=>{var l;let u=a.target;if(!u||!("setSelectionRange"in u)||!(["password","search","tel","text","url"].includes(u.type)||u instanceof HTMLTextAreaElement)||u._silk_focusedBefore===!0)return;let h=u.value.length;(l=u.setSelectionRange)===null||l===void 0||l.call(u,h,h),u._silk_focusedBefore=!0};return document.addEventListener("blur",e,{capture:!0,passive:!1}),document.addEventListener("touchstart",t,{capture:!0,passive:!0}),document.addEventListener("touchend",i,{capture:!0,passive:!0}),document.addEventListener("focusin",n),()=>{document.removeEventListener("blur",e,{capture:!0}),document.removeEventListener("touchend",i,{capture:!0}),document.removeEventListener("touchstart",t,{capture:!0}),document.removeEventListener("focusin",n)}},gx=["translate","translateX","translateY","translateZ","scale","scaleX","scaleY","scaleZ","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],vx=null,Sx=t=>{vx=t},iO={sheets:[],addSheet:function(t){let e;if(!t.id)return;let i=this.findSheet(t.id);return i?(t.stackId&&(i.stackId=t.stackId),t.sendToOpennessMachine&&(i.sendToOpennessMachine=t.sendToOpennessMachine),e=i):(e={stackingIndex:-1,travelAnimations:[],aggregatedTravelCallback:function(n,a){let l=this.travelAnimations;for(let u=0,h=l.length;u<h;u++)l[u].callback(n,a)},stackingAnimations:[],aggregatedStackingCallback:function(n,a){let l=this.stackingAnimations;for(let u=0,h=l.length;u<h;u++)l[u].callback(n,a)},belowSheetsInStack:[],outlets:new Set,...t},this.sheets.push(e)),this.updateBelowSheetsInStackOfAllSheets(),e},attemptToRemoveSheet:function(t,e){let i=this.findSheet(t);if(i)if(i.outlets.size===0){var n;let a=(n=this.findSheet(t))===null||n===void 0?void 0:n.stackId;this.sheets=this.sheets.filter(l=>l.id!==t),a&&this.updateSelfAndAboveTravelProgressSumInStack(a)}else e&&e(i)},attemptToRemoveSheetOrCleanup:function(t){this.attemptToRemoveSheet(t,e=>{e.sendToOpennessMachine=null})},findSheet:function(t){return this.sheets.find(e=>e.id===t)},addOutletToSheet:function(t,e){let i=this.findSheet(t);i?i.outlets.add(e):this.addSheet({id:t,outlets:new Set([e])})},removeOutletFromSheet:function(t,e){let i=this.findSheet(t);i?.outlets.delete(e),this.attemptToRemoveSheet(t)},sheetStacks:[],addSheetStack:function(t){let e;return this.findSheetStack(t.id)||(e={stackingAnimations:[],aggregatedStackingCallback:function(n,a){let l=this.stackingAnimations;for(let u=0,h=l.length;u<h;u++)l[u].callback(n,a)},...t},this.sheetStacks.push(e)),this.updateBelowSheetsInStackOfAllSheets(),e},removeSheetStack:function(t){t&&(this.sheetStacks=this.sheetStacks.filter(e=>e.id!==t),this.removeAllOutletPersistedStylesFromStack(t))},findSheetStack:function(t){return this.sheetStacks.find(e=>e.id===t)},updateBelowSheetsInStackOfAllSheets:function(){this.sheets.forEach(t=>{let e,i=t.stackId;if(i){e=this.findSheetStack(i);let n=this.sheets.filter(l=>l.stackId===t.stackId),a=n.filter(l=>l.stackId===t.stackId&&l.stackingIndex>t.stackingIndex);e&&(a.unshift(e),e.stackingIndex=n.length-1),t.belowSheetsInStack=a,this.updateSelfAndAboveTravelProgressSumInStack(i)}})},updateSheetStackingIndex:function(t,e){let i=this.findSheet(t);i&&(i.stackingIndex=e),this.updateBelowSheetsInStackOfAllSheets()},updateSheetTravelProgress:function(t,e){let i=this.findSheet(t);i&&i.stackId&&(i.travelProgress=e,this.updateSelfAndAboveTravelProgressSumInStack(i.stackId))},updateSelfAndAboveTravelProgressSumInStack:function(t){let e=this.sheets.filter(a=>a.stackId===t).sort((a,l)=>l.stackingIndex-a.stackingIndex),i=this.findSheetStack(t);i&&e.unshift(i);let n=e.length;for(let a=0;a<n;a++){let l=e[a];l.selfAndAboveTravelProgressSum=[];for(let u=0;u<n;u++)u<=a?l.selfAndAboveTravelProgressSum[u]=0:l.selfAndAboveTravelProgressSum[u]=e.slice(a+1,u+1).reduce((h,f)=>h+f.travelProgress,0)}},addAnimationToSheetOrStack:function({type:t,sheetId:e,stackId:i,element:n,config:a}){let l=a.hasOwnProperty("properties")?a.properties:a,u=[];Object.entries(l).forEach(([v,g])=>{if(g!=="ignore"&&g&&typeof g!="string")if(typeof g=="function")if(gx.includes(v)){let S=u.findIndex(C=>C[0]==="transform"),b=C=>v+"("+g(C)+")";if(S!==-1){let C=u[S][1];u[S][1]=x=>C(x)+" "+b(x)}else u.push(["transform",b])}else if(v==="transform"){let S=u.findIndex(b=>b[0]==="transform");if(S!==-1){let b=u[S][1];u[S][1]=C=>b(C)+" "+g(C)}else u.push(["transform",g])}else u.push([v,g]);else if(v==="opacity"){let S=["opacity",({tween:b})=>b(g[0],g[1])];u.push(S)}else{if(!v.startsWith("scale")&&(!isNaN(g[0])||!isNaN(g[1])))throw Error("Keyframe values used with a 'transform' property require a unit (e.g. 'px', 'em' or '%').");let S=u.findIndex(C=>C[0]==="transform"),b=({tween:C})=>v+"("+C(g[0],g[1])+")";if(S!==-1){let C=u[S][1];u[S][1]=x=>C(x)+" "+b(x)}else u.push(["transform",b])}});let h=u.map(v=>[(v[0].startsWith("webkit")||v[0].startsWith("moz")?"-":"")+v[0].replace(/[A-Z]/g,"-$&").toLowerCase(),v[1]]),f=h.length,d={target:n,config:u,dashedPropertiesAsArray:h,callback:(v,g)=>{for(let S=0;S<f;S++){let[b,C]=h[S];n.style.setProperty(b,C({progress:v,tween:g}))}}},p=i?this.findSheetStack(i):this.findSheet(e);p&&(t==="travel"?p.travelAnimations.push(d):p.stackingAnimations.push(d))},removeAnimationFromSheetOrStack:function({sheetId:t,stackId:e,type:i,element:n}){let a=e?this.findSheetStack(e):this.findSheet(t);if(a)if(i==="travel"){let l=a.travelAnimations.filter(u=>u.target!==n);a.travelAnimations=l}else{let l=a.stackingAnimations.filter(u=>u.target!==n);a.stackingAnimations=l}},removeAllOutletPersistedStylesFromSheet:function(t){let e=this.findSheet(t);e&&[...e.travelAnimations,...e.stackingAnimations].forEach(i=>{i.dashedPropertiesAsArray.forEach(([n])=>{i.target.style.removeProperty(n)})})},removeAllOutletPersistedStylesFromStack:function(t){let e=this.findSheetStack(t);e&&e.stackingAnimations.forEach(i=>{i.dashedPropertiesAsArray.forEach(([n])=>{i.target.style.removeProperty(n)})})},getAggregatedStackingCallbackForSheetsBelow:function(t){let e,i=this.findSheet(t);return i&&(e=n=>{let a=i.belowSheetsInStack,l=a.length;for(let u=0;u<l;u++){let h=a[u],f=h.selfAndAboveTravelProgressSum[l-1]+n,d=Fl(f);h.aggregatedStackingCallback(f,d)}}),e},automaticIslandElements:new Set([]),automaticLayerElements:new Set([]),automaticLayerAndIslandDetectionCleanup:null,focusContainmentRootElements:[],focusContainmentCleanup:()=>{},escapeKeyDownListenerCleanup:null,clickOutsideListenerCleanup:null,processLayersAndIslandsChangesTimeout:null,setupAutomaticLayerAndIslandDetection:function(t){let e=document.documentElement,i=document.body,n=()=>{let l,u=new Set([]),h=new Set([]),f=(function(x){let E=x.parentElement;for(;E&&E!==document.body;){if(E.parentElement===document.body)return E;E=E.parentElement}return x.parentElement===document.body?x:null})(t);l=f?f.nextElementSibling:i.firstElementChild;let d=x=>x.matches('[data-silk~="0ag"], [data-silk~="0ab"], [data-silk~="0aa"], [data-silk-clone]'),p=x=>x.tagName!=="SCRIPT";for(;l;)!d(l)&&p(l)&&u.add(l),l=l.nextElementSibling;let v=e.children;for(let x=0;x<v.length;x++){let E=v[x];E.tagName==="HEAD"||E.tagName==="BODY"||d(E)||h.add(E)}let g=new Set([...u].filter(x=>!this.automaticLayerElements.has(x))),S=new Set([...this.automaticLayerElements].filter(x=>!u.has(x)));this.automaticLayerElements=u;let b=new Set([...h].filter(x=>!this.automaticIslandElements.has(x))),C=new Set([...this.automaticIslandElements].filter(x=>!h.has(x)));this.automaticIslandElements=h,g.forEach(x=>{this.updateLayer({automatic:!0,layerId:null,viewElement:x,inertOutside:!1,onPresentAutoFocus:{focus:!1},onDismissAutoFocus:{focus:!1},dismissOverlayIfNotAlertDialog:()=>{},onClickOutside:{stopOverlayPropagation:!1},onEscapeKeyDown:{stopOverlayPropagation:!1}})}),S.forEach(x=>this.removeLayer(null,x)),b.forEach(x=>this.addIsland({element:x,automatic:!0})),C.forEach(x=>this.removeIsland(null,x))};n();let a=new MutationObserver(()=>{n()});a.observe(e,{childList:!0}),a.observe(i,{childList:!0}),this.automaticLayerAndIslandDetectionCleanup=function(){a.disconnect(),this.layers.forEach(l=>{l.automatic&&this.removeLayer(null,l.viewElement)}),this.automaticLayerElements=new Set([]),this.islands.forEach(l=>{l.automatic&&this.removeIsland(null,l.element)}),this.automaticIslandElements=new Set([]),this.automaticLayerAndIslandDetectionCleanup=null}},moveFocusIfNecessary:function(t,e,i,n,a,l){let u=!1;for(let h=0;h<e.length;h++)if(e[h].contains(document.activeElement)){u=!0;break}if(i.length){let h=i.filter(f=>!f.automatic&&!f.external);if(h.length){let f=h[h.length-1];return D1(f.layerId,f.viewElement,f.onPresentAutoFocus)}}if(a.length&&!u){let h=t[t.length-1];if(!h.external)return D1(h.layerId,h.viewElement,h.onPresentAutoFocus)}if(n.length&&n.find(f=>f.focusWasInside)){let f=n[0];if(!f.external)return zD(f.layerId,f.viewElement,f.onDismissAutoFocus,f.elementFocusedLastBeforeShowing)}if(l.length&&l.find(f=>f.focusWasInside)){let f=t[t.length-1];if(f)return dx(f.layerId,f.viewElement)}},processLayersAndIslandsChanges:function(){var t;clearTimeout(this.processLayersAndIslandsChangesTimeout);let e=()=>{let n=this.layers.length,a=new Set([]),l;if(this.layers.some(v=>v.inertOutside)){this.islands.filter(g=>!g.componentId||g.componentId.length===0).forEach(g=>a.add(g.element));for(let g=n-1;g>=0;g--){let S=this.layers[g];if(S.external&&S.inertOutside){a=new Set([]);break}a.add(S.viewElement);let b=this.islands.filter(x=>x.componentId&&S.layerContextId&&x.componentId.includes(S.layerContextId)),C=this.islands.filter(x=>x.componentId&&S.layerStackContextId&&x.componentId.includes(S.layerStackContextId));if([...b,...C].forEach(x=>{a.add(x.element)}),S.inertOutside){l=S;break}l=S}}let h=[...a],f=!(function(v,g){if(v.length!==g.length)return!1;let S=new Set;for(let b of v)S.add(b);for(let b of g)if(!S.has(b))return!1;return!0})(this.focusContainmentRootElements,h);if(this.focusContainmentRootElements=h,f){var d;this.focusContainmentCleanup(),this.focusContainmentCleanup=()=>{},(d=this.automaticLayerAndIslandDetectionCleanup)===null||d===void 0||d.call(this),l&&(this.setupAutomaticLayerAndIslandDetection(l?.viewElement),this.focusContainmentCleanup=jD({rootElements:this.focusContainmentRootElements,viewElement:l?.viewElement,elementFocusedLast:vx,setElementFocusedLast:Sx}))}this.moveFocusIfNecessary(this.layers,this.focusContainmentRootElements,this.layersJustAdded,this.layersJustRemoved,this.layersJustWentToInertOutsideTrue,this.islandsJustRemoved),this.escapeKeyDownListenerCleanup&&(this.escapeKeyDownListenerCleanup(),this.escapeKeyDownListenerCleanup=null),this.clickOutsideListenerCleanup&&(this.clickOutsideListenerCleanup(),this.clickOutsideListenerCleanup=null),n>0&&(this.escapeKeyDownListenerCleanup=XD(this.layers),this.clickOutsideListenerCleanup=GD(this.layers,this.islands));let p=this.layersJustRemoved.length;if(p)for(let v=0;v<p;v++){let g=this.layersJustRemoved[v],S=g.viewElement,b=g.automatic;S&&!b&&(ZD(S),QD(S))}this.islandsJustRemoved=[],this.layersJustAdded=[],this.layersJustRemoved=[],this.layersJustWentToInertOutsideTrue=[]};((t=this.layersJustAdded[this.layersJustAdded.length-1])===null||t===void 0?void 0:t.external)?e():this.processLayersAndIslandsChangesTimeout=setTimeout(e,16)},autoFocusTargets:[],addAutoFocusTarget:function({layerId:t,element:e,timing:i}){this.autoFocusTargets.push({layerId:t,element:e,timing:i})},removeAutoFocusTarget:function(t){this.autoFocusTargets=this.autoFocusTargets.filter(e=>e.element!==t)},islands:[],islandsJustRemoved:[],addIsland:function(t){var e;let i=this.islands[this.islands.length-1],n=((e=t.id)!==null&&e!==void 0?e:i)?i.id+1:0;return this.islands.push({...t,id:n}),this.processLayersAndIslandsChanges(),n},removeIsland:function(t,e){this.islands=this.islands.filter(i=>{if(t&&i.id&&i.id!==t||e&&i.element&&i.element!==e)return!0;{let n=i.element.contains(document.activeElement);return this.islandsJustRemoved.push({...i,focusWasInside:n}),!1}}),this.processLayersAndIslandsChanges()},layers:[],layersJustAdded:[],layersJustRemoved:[],layersJustWentToInertOutsideTrue:[],updateLayer:function(t){let e=t.layerId,i=t.viewElement,n=!1,a=this.layers;for(let u=0;u<a.length;u++){let h=a[u];if(e!==null?h.layerId===e:h.viewElement===i){let d={...h,...t};!h.inertOutside&&t.inertOutside&&this.layersJustWentToInertOutsideTrue.push(d),a[u]=d,n=!0;break}}if(!n){var l;let u={...t,elementFocusedLastBeforeShowing:(l=t.elementFocusedLastBeforeShowing)!==null&&l!==void 0?l:document.activeElement};a.push(u),this.layersJustAdded.push(u)}this.processLayersAndIslandsChanges()},removeLayer:function(t,e){var i;this.layers=this.layers.filter(n=>{if(t&&n.layerId&&n.layerId!==t||e&&n.viewElement&&n.viewElement!==e)return!0;{var a;let l=(a=n.viewElement)===null||a===void 0?void 0:a.contains(document.activeElement);return this.layersJustRemoved.push({...n,focusWasInside:l}),!1}}),this.layers.filter(n=>!n.automatic).length===0&&((i=this.automaticLayerAndIslandDetectionCleanup)===null||i===void 0||i.call(this)),this.processLayersAndIslandsChanges()},nativeFocusScrollPreventers:[],nativeFocusScrollPreventionCleanup:null,addNativeFocusScrollPreventer:function(t){this.nativeFocusScrollPreventers.push({id:t}),this.processNativeFocusScrollPreventersChanges()},removeNativeFocusScrollPreventer:function(t){this.nativeFocusScrollPreventers=this.nativeFocusScrollPreventers.filter(e=>e.id!==t),this.processNativeFocusScrollPreventersChanges()},processNativeFocusScrollPreventersChanges:function(){let t=this.nativeFocusScrollPreventers.length;if(Wa()&&(Gt==="ios"||Gt==="ipados"))if(t)this.nativeFocusScrollPreventionCleanup||(this.nativeFocusScrollPreventionCleanup=tO());else{var e;(e=this.nativeFocusScrollPreventionCleanup)===null||e===void 0||e.call(this),this.nativeFocusScrollPreventionCleanup=null}},fixedComponents:[],addFixedComponent:function(t){this.fixedComponents.push(t)},updateFixedComponent:function(t){let e=this.fixedComponents.find(i=>i.id===t.id);e&&(t.element&&(e.element=t.element),t.initialInlineCSSTransform&&(e.initialInlineCSSTransform=t.initialInlineCSSTransform),typeof t.compensated=="boolean"&&(e.compensated=t.compensated))},removeFixedComponent:function(t){this.fixedComponents=this.fixedComponents.filter(e=>e.id!==t)},findActualFixedComponentsInsideOutlet:function(t){return this.fixedComponents.filter(e=>{if(e.element&&t)return t.contains(e.element)&&window.getComputedStyle(e.element).getPropertyValue("position")==="fixed"})},themeColorMetaTag:null,underlyingThemeColor:null,themeColorDimmingOverlays:[],storeThemeColorMetaTag:function(){if(this.themeColorMetaTag=PD(),!this.themeColorMetaTag){let t=document.createElement("meta");t.name="theme-color",t.content=window.getComputedStyle(document.body).backgroundColor,document.head.appendChild(t),this.themeColorMetaTag=t}},getAndStoreUnderlyingThemeColorAsRGBArray:function(){let t;if(this.themeColorDimmingOverlays.length>0)t=this.underlyingThemeColor;else{var e;this.themeColorMetaTag||this.storeThemeColorMetaTag();let i=(e=this.themeColorMetaTag)===null||e===void 0?void 0:e.content;(t=L1(i))||(console.warn("`themeColorDimming` prop ignored: Only `theme-color` meta tag with a value in `rgb()`, `rgba()`, or hexadecimal format is supported."),t=[0,0,0]),this.underlyingThemeColor=t}return t},updateUnderlyingThemeColor:function(t){let e=L1(t);if(!e)throw Error("The color provided to `updateThemeColor` doesn't match `rgb()`, `rgba()`, or hexadecimal format.");this.underlyingThemeColor=e,this.setActualThemeColor()},setActualThemeColor:function(){var t;this.themeColorMetaTag||this.storeThemeColorMetaTag(),(t=this.themeColorMetaTag)===null||t===void 0||t.setAttribute("content",DD({color:this.underlyingThemeColor,overlays:this.themeColorDimmingOverlays}))},findThemeColorDimmingOverlay:function(t){return this.themeColorDimmingOverlays.find(e=>e.dimmingOverlayId===t)},findIndexThemeColorDimmingOverlay:function(t){return this.themeColorDimmingOverlays.findIndex(e=>e.dimmingOverlayId===t)},updateThemeColorDimmingOverlay:function(t){let e=t;e.color&&(e={...e,color:cx(e.color)});let i=this.findThemeColorDimmingOverlay(e.dimmingOverlayId);return i?Object.assign(i,e):(i=e,this.themeColorDimmingOverlays.push(e)),this.setActualThemeColor(),i},updateThemeColorDimmingOverlayAlphaValue:function(t,e){t.alpha=e,this.setActualThemeColor()},removeThemeColorDimmingOverlay:function(t){let e=this.findThemeColorDimmingOverlay(t);e&&(e.abortRemoval=!1,setTimeout(()=>{e?.abortRemoval||(this.themeColorDimmingOverlays=this.themeColorDimmingOverlays.filter(i=>i.dimmingOverlayId!==t),this.setActualThemeColor(),this.themeColorDimmingOverlays.length!==0||(this.underlyingThemeColor=null,this.themeColorMetaTag=null))},20))}};var qe=iO;let yx=t=>{let e=w.useRef(null);return vi(()=>{e.current=t}),w.useCallback((...i)=>{let n=e.current;return n(...i)},[])},ev=t=>t==="layout"?vi:w.useEffect,Cg=t=>{var e=t?.lastIndexOf(":");return e===-1?"":t?.substring(e+1)},sO=t=>{let e=[],i=[],n=(a,l,{partOfInitial:u})=>{Array.isArray(a)?a.forEach(h=>n(h,l,{partOfInitial:u})):(l+=(l?".":"")+a.name,u&&i.push(l+":"+a.initial),Object.entries(a.states).forEach(([h,f])=>{let d=l+":"+h;f.machine=l,f.path=d,f.reactive=!a.silentOnly,e.push(f),f.machines&&n(f.machines,d,{partOfInitial:u&&a.initial===h})}))};return n(t,"",{partOfInitial:!0}),[i,e]},P1=(t,e)=>t.includes(":")?t:e.substring(0,e.lastIndexOf(":")+1)+t,z1=t=>{let e=t.split("."),i=[];return e.forEach((n,a)=>{let l=i[a-1],u=(l?l.full+".":"")+n,h=u.substring(0,u.lastIndexOf(":")),f=u.substring(u.lastIndexOf(":")+1);i.push({full:u,withoutState:h,state:f})}),i},rO=({checkedPoolOfStates:t,referencePoolOfStates:e,callbackOnExclusion:i,callbackOnPresent:n})=>t.filter(l=>{let u=!0;return l.forEach(h=>{e.forEach(f=>{f.forEach(d=>{h.withoutState===d.withoutState&&(h.state!==d.state?(u=!1,i?.({decomposedCheckedState:l,checkedStatePiece:h,decomposedReferenceState:f,referenceStatePiece:d})):n({decomposedCheckedState:l,checkedStatePiece:h,decomposedReferenceState:f,referenceStatePiece:d}))})})}),u}),nO=t=>{let[e,i]=sO(t);return[e,(n,a)=>{let l,u=typeof a=="string"?a:a.type,h=[];i.forEach(R=>{n.includes(R.path)&&(!a.machine||a.machine===R.machine)&&R.messages&&Object.entries(R.messages).forEach(([$,F])=>{if($===u){if(typeof F=="string")l=$,h.push(P1(F,R.path));else for(let U of F)if(!U.guard||U.guard(n,a)){l=$,h.push(P1(U.target,R.path));break}}})});let f=n.map(R=>z1(R)),d=h.map(R=>z1(R)),p=[],v=rO({checkedPoolOfStates:f,referencePoolOfStates:d,callbackOnExclusion:({decomposedCheckedState:R})=>{p.push(R[R.length-1].full)},callbackOnPresent:({referenceStatePiece:R})=>{R.unchanged=!0}}),g=v.map(R=>R[R.length-1].full),S=[],b=[];d.forEach(R=>{R.forEach(($,F)=>{if(!$.unchanged){var U,z;F<R.length-1&&S.push($.full);let V=i.find(se=>se.path===$.full);(U=V.machines)===null||U===void 0||(z=U.forEach)===null||z===void 0||z.call(U,se=>{let ee=()=>{d.find(O=>O.find(N=>N.withoutState===`${V.path}.${se.name}`))||b.push(`${V.path}.${se.name}:${se.initial}`)};F<R.length-1?V.path+se.name!==R[F+1].withoutState&&ee():ee();let M=O=>{var N,P;(N=i.find(L=>L.path===O).machines)===null||N===void 0||(P=N.forEach)===null||P===void 0||P.call(N,L=>{d.find(H=>H.find(Y=>Y.withoutState===`${V.path}.${L.name}`))||b.push(`${O}.${L.name}:${L.initial}`),M(`${O}.${L.name}:${L.initial}`)})};M(`${V.path}.${se.name}:${se.initial}`)})}})});let C=[...h,...S,...b],x=[...g,...C],E=[...p,...C],A=i.filter(R=>E.includes(R.path)),B=A.some(R=>R.reactive);return{exitedStates:p,transitionTaken:l,enteredStates:C,nextStates:x,reactive:B}}]},Dd=(t,e)=>t?.toStrings().filter(i=>i?.startsWith(e)).filter(i=>{var n;return!(!((n=i?.slice(e.length))===null||n===void 0)&&n.includes("."))})[0],H1=t=>{let[e,i]=w.useMemo(()=>nO(t),[t]),n=w.useRef(),a=w.useRef([]),l=w.useRef([]),u=w.useRef([]),h=w.useRef([]),f=w.useRef(e),d=w.useRef({toStrings:()=>e,matches:b=>zo(e,b),lastMessageTreatedRef:n,exitActionsRef:a,transitionActionsRef:l,entryActionsRef:u,selectorsRef:h}),[p,v]=w.useState({...d.current,silent:d.current}),g=w.useRef([]),S=w.useCallback(b=>{g.current.push(b);let C=x=>{let{nextStates:E,exitedStates:A,transitionTaken:B,enteredStates:R,reactive:$}=i(f.current,g.current[0]),F=f.current;if(f.current=E,a.current.forEach(U=>{A.includes(U.state)&&(typeof U.guard=="function"?U.guard(F,g.current[0]):U.guard)&&U.callback(g.current[0],U.params)}),l.current.forEach(U=>{A.includes(U.state)&&U.transition===B&&(typeof U.guard=="function"?U.guard(F,g.current[0]):U.guard)&&U.callback(g.current[0],U.params)}),u.current.forEach(U=>{R.includes(U.state)&&(typeof U.guard=="function"?U.guard(F,g.current[0]):U.guard)&&U.callback(g.current[0],U.params)}),n.current=typeof g.current[0]=="string"?{type:g.current[0]}:g.current[0],g.current.shift(),g.current.length)C($||x);else{let U=E.slice();d.current.toStrings=()=>U,d.current.matches=z=>zo(U,z),d.current.getValues=()=>[Cg(U.toStrings)],h.current.forEach(z=>{let V=z.current.selection;z.current.toStrings=()=>[Dd(d.current,V)],z.current.matches=se=>zo([Dd(d.current,V)],se),z.current.getValues=()=>[Cg(Dd(d.current,V))]}),(x||$)&&v({...d.current,silent:d.current})}};g.current.length===1&&C()},[i]);return[p,S]},aO=(t,e,i,{message:n="",delay:a=null,...l}={delay:null})=>{w.useEffect(()=>{let u;return e.matches(i)&&(u=setTimeout(()=>t({type:"",...l}),a??0)),()=>{u&&clearTimeout(u)}},[e,i,a,t,n,l])},zr=(t,e,{shallow:i=!0}={})=>{let n=w.useMemo(()=>Dd(t,e),[t,e]),a=w.useRef({lastMessageTreatedRef:t?.lastMessageTreatedRef,exitActionsRef:t?.exitActionsRef,transitionActionsRef:t?.transitionActionsRef,entryActionsRef:t?.entryActionsRef,toStrings:()=>[n],matches:u=>zo([n],u),selection:e,getValues:()=>[Cg(n)]}),l=w.useRef(Symbol());return vi(()=>{t.selectorsRef.current.find(h=>h.id===l.current)||t.selectorsRef.current.push(a)},[]),w.useMemo(()=>({...a.current,silent:a.current}),[n])},zo=(t,e)=>Array.isArray(e)?e.some(i=>t.includes(i))||t.some(i=>e.some(n=>i?.startsWith(n)&&i?.charAt(n.length)===".")):t.includes(e)||t.some(i=>i?.startsWith(e)&&i?.charAt(e.length)==="."),Ne=(t,e,i)=>{let{state:n,callback:a,params:l,empty:u=!1}=i,h=!i.hasOwnProperty("guard")||i.guard,f=w.useMemo(()=>l?Object.values(l):[],[l]),d=w.useMemo(()=>e.entryActionsRef,[e]),p=ev(t==="before-paint"?"layout":"normal"),v=yx(S=>{(S?.matches&&S?.matches(n)||!S?.matches&&zo(S,n))&&(typeof h=="function"&&h()||typeof h!="function"&&h)&&a(S.lastMessageTreatedRef.current,l)}),g=w.useRef(Symbol());p(()=>{if(!u)if(t==="immediate"){let S={id:g.current,state:n,guard:h,callback:a,params:l},b=d.current.findIndex(C=>C.id===g.current);b===-1?d.current.push(S):d.current[b]=S}else v(e)},t==="immediate"?[t,n,h,a,d,...f]:[t,v,e]),w.useEffect(()=>()=>{d.current=d.current.filter(S=>S.id!==g.current)},[])},at=(t,e)=>{let{state:i,transition:n,callback:a,params:l}=e,u=!e.hasOwnProperty("guard")||e.guard,h=w.useMemo(()=>l?Object.values(l):[],[l]),f=w.useMemo(()=>t.transitionActionsRef,[t]),d=w.useRef(Symbol());w.useEffect(()=>{let p={id:d.current,state:i,transition:n,guard:u,callback:a,params:l},v=f.current.findIndex(g=>g.id===d.current);v===-1?f.current.push(p):f.current[v]=p},[i,n,u,a,f,...h]),w.useEffect(()=>()=>{f.current=f.current.filter(p=>p.id!==d.current)},[])},Ba=(t,e,i)=>{let{state:n,callback:a,params:l}=i,u=!i.hasOwnProperty("guard")||i.guard,h=w.useMemo(()=>l?Object.values(l):[],[l]),f=w.useMemo(()=>e.exitActionsRef,[e]),d=ev("normal");yx(v=>{(v?.matches&&v?.matches(n)||!v?.matches&&zo(v,n))&&(typeof u=="function"&&u()||typeof u!="function"&&u)&&a(v.lastMessageTreatedRef.current,l)});let p=w.useRef(Symbol());d(()=>{{let v={id:p.current,state:n,guard:u,callback:a,params:l},g=f.current.findIndex(S=>S.id===p.current);g===-1?f.current.push(v):f.current[g]=v}return()=>{}},[t,n,u,a,f,...h]),w.useEffect(()=>()=>{f.current=f.current.filter(v=>v.id!==p.current)},[])},xs=(t,e,i)=>{let{state:n,callback:a,params:l,name:u}=i,h=!i.hasOwnProperty("guard")||i.guard,f=l?Object.values(l):[],d=typeof t=="string"?t:t.start,p=typeof t=="string"?t:t.update,v=w.useRef(null);Ne("immediate",e,{state:n,guard:h,callback:w.useCallback(()=>{v.current=a(null,l)},[a,l]),params:l,empty:d!=="immediate"});let g=ev(p==="before-paint"?"layout":"normal"),S=w.useRef(!1);g(()=>{let b,C=e?.matches&&e?.matches(n)||!e?.matches&&zo(e,n)||n==="",x=typeof h=="function"&&h()||typeof h!="function"&&h;return C&&x&&(b=d==="immediate"?S.current?a(null,l):v.current:a(null,l)),C&&!S.current&&(S.current=!0),()=>{var E;!((E=e.silent)===null||E===void 0)&&E.matches(n)||(S.current=!1,v.current=null),b?.()}},[n!==""?e:null,n,h,a,...f])},oO=t=>{let e=w.useRef({value:t}),[i,n]=w.useState({value:t,silent:e.current}),a=w.useCallback(l=>{let u=typeof l=="function"?l(e.current.value):l;e.current.value=u,n({value:u,silent:e.current})},[]);return[i,a]};function bx(...t){return e=>t.forEach(i=>{typeof i=="function"?i(e):i!=null&&(i.current=e)})}function Es(...t){return w.useCallback(bx(...t),t)}var lO=(t,e)=>{let i=()=>{e?.()},n=l=>{l.preventDefault(),window.addEventListener("touchend",i,{once:!0})},a=t.current;return a.addEventListener("touchstart",n,{passive:!1}),()=>{a&&(a.removeEventListener("touchstart",n,{passive:!1}),window.removeEventListener("touchend",i))}};let gp=!1,I1=0;function $o(t){var e;if(w.useId!==void 0)return w.useId();let[i,n]=w.useState(gp?++I1:null);return vi(()=>{i===null&&n(++I1)},[]),w.useEffect(()=>{gp===!1&&(gp=!0)},[]),(e=i)!==null&&e!==void 0?e:void 0}let Fi=w.forwardRef((t,e)=>{let{children:i,...n}=t,a=w.Children.toArray(i),l=a.find(uO);if(l){let u=l.props.children,h=a.map(f=>f!==l?f:w.Children.count(u)>1?w.Children.only(null):w.isValidElement(u)?u.props.children:null);return j.jsx(xg,{...n,ref:e,children:w.isValidElement(u)?w.cloneElement(u,void 0,h):null})}return j.jsx(xg,{...n,ref:e,children:i})});Fi.displayName="Slot.Root";let xg=w.forwardRef((t,e)=>{let{children:i,...n}=t,a=(function(l){var u,h;let f=(u=Object.getOwnPropertyDescriptor(l.props,"ref"))===null||u===void 0?void 0:u.get,d=f&&"isReactWarning"in f&&f.isReactWarning;return d?l.ref:(d=(f=(h=Object.getOwnPropertyDescriptor(l,"ref"))===null||h===void 0?void 0:h.get)&&"isReactWarning"in f&&f.isReactWarning)?l.props.ref:l.props.ref||l.ref})(i);return w.isValidElement(i)?w.cloneElement(i,{...(function(l,u){let h={...u};for(let f in u){let d=l[f],p=u[f];/^on[A-Z]/.test(f)?d&&p?h[f]=(...g)=>{p(...g),d(...g)}:d&&(h[f]=d):f==="style"?h[f]={...d,...p}:f==="className"&&(h[f]=[d,p].filter(Boolean).join(" "))}return{...l,...h}})(n,i.props),ref:e?bx(e,a):a}):w.Children.count(i)>1?w.Children.only(null):null});xg.displayName="Slot.Anonymous";let cO=({children:t})=>j.jsx(j.Fragment,{children:t});function uO(t){return w.isValidElement(t)&&t.type===cO}let md=0,wx=[0,0],kg=!1,U1=()=>{clearTimeout(R1),kg=!0,R1=setTimeout(()=>kg=!1,50)},F1=()=>{kg||window.scrollTo(...wx)},Cx=We.forwardRef((t,e)=>{let{asChild:i,active:n=!0,automaticallyDisabledForOptimisation:a=!0,axis:l="both",preventBodyScroll:u,children:h,"data-silk":f,className:d,...p}=t,v=f?.includes("0ae"),g=w.useRef(null),S=Es(g,e);vi(()=>{if(wx=[window.screenX,window.scrollY],n&&u)if(md===0){let E=window.innerWidth,A=document.documentElement.clientWidth,B=window.innerHeight,R=document.documentElement.clientHeight;document.body.style.setProperty("overflow","hidden");let $=`${E-A}px`,F=`${B-R}px`;document.querySelectorAll("[data-silk~='0al']").forEach(z=>{z.style.setProperty("--x-collapsed-scrollbar-thickness",$),z.style.setProperty("--y-collapsed-scrollbar-thickness",F)}),document.body.style.setProperty("padding-right",$),document.body.style.setProperty("padding-bottom",F),window.addEventListener("resize",U1),window.addEventListener("scroll",F1,{passive:!1}),md++}else md++;return()=>{if(n&&u&&--md==0){let E=document.querySelectorAll("[data-silk~='0al']");document.body.style.removeProperty("overflow"),E.forEach(A=>{A.style.removeProperty("--x-collapsed-scrollbar-thickness"),A.style.removeProperty("--y-collapsed-scrollbar-thickness")}),document.body.style.removeProperty("padding-right"),document.body.style.removeProperty("padding-bottom"),window.removeEventListener("scroll",F1),window.removeEventListener("resize",U1)}}},[u,n]),w.useEffect(()=>{let E,A=g.current;return!v&&n&&A&&(E=new ResizeObserver(B=>{B.forEach(()=>{A.scrollTo(300,300)})})).observe(A,{box:"border-box"}),()=>{!v&&n&&A&&E&&(E.unobserve(A),E.disconnect())}},[n,v]);let b=w.useCallback(E=>{let A=E.currentTarget;A.scrollTo(300,300),Gt!=="ios"&&Gt!=="ipados"||CSS.supports("overscroll-behavior: contain")||(A.style.setProperty("overflow","hidden"),setTimeout(()=>{A.style.setProperty("overflow","auto")},10))},[]),C=i?Fi:"div",x=Ui("ScrollTrap",{active:n,automaticallyDisabledForOptimisation:a,axis:l});return j.jsx(C,{...x("root",["active","automaticallyDisabledForOptimisation","axis"],{className:d,dataSilk:[f,"0ac","0ae"]}),onScroll:v?void 0:b,...p,ref:S,children:h})});Cx.displayName="Sheet.Anonymous";let xx=We.forwardRef((t,e)=>{let{asChild:i,className:n,dataSilk:a,children:l,...u}=t,h=i?Fi:"div",f=Ui("ScrollTrap",{});return j.jsx(h,{...f("stabiliser",[],{className:n,dataSilk:[a]}),...u,ref:e,children:l})});xx.displayName="Sheet.DDD";let Vn={Root:Cx,Stabiliser:xx},kx=()=>{let t=$o();return w.useCallback(i=>{i?qe.addFixedComponent({id:t,element:i}):qe.removeFixedComponent(t)},[t])},hO=We.forwardRef((t,e)=>{let{asChild:i,children:n,className:a,"data-silk":l,...u}=t,h=kx(),f=Es(h,e),d=Ui("Fixed",{});return j.jsx(Vn.Root,{...d("root",[],{className:a,dataSilk:[l,"0al"]}),asChild:i,...u,ref:f,children:n})});hO.displayName="Fixed.Root";let dO=We.forwardRef((t,e)=>{let{asChild:i,children:n,...a}=t;return j.jsx(Vn.Stabiliser,{asChild:i,...a,ref:e,children:n})});dO.displayName="Fixed.Content";let Ga=We.createContext(null);Ga.displayName="Sheet.GenericContext";let Ur=We.createContext(null);Ur.displayName="Sheet.Anonymous";var fO=function(t){let e="cubic-bezier(";if(!t.startsWith(e))return null;let i=t.slice(e.length,-1),n=i.split(",").map(a=>parseFloat(a.trim()));return n.length!==4||n.some(isNaN)?null:n},mO=({mass:t,stiffness:e,damping:i,initialVelocity:n=0,fromPosition:a,toPosition:l,precision:u})=>{let h=[],f=0,d=Math.abs(l-a),p=0,v=n,g=!1,S=!1,b=-(1e-6*e),C=-(.001*i),x=u/22,E=10*u;for(;!(g&&S);){let B=b*(p-d),R=C*v,$=(B+R)/t;v+=$,p+=v,g=Math.abs(v)<=x,S=Math.abs(d-p)<=E;let F=p/d;h.push(F),f++}return{progressValuesArray:h,duration:f}};let Od=()=>CSS.supports("transition-timing-function","linear(0, 1)")&&!Wa(),_O=({origin:t=0,destination:e=1,animationConfig:i})=>{var n,a,l,u,h,f,d,p,v;let g=[],S;if(i&&i.easing&&i.easing!=="spring")if(i.easing==="linear"){S=(f=i.duration)!==null&&f!==void 0?f:250;let b=S,C=1/(b-1);for(let x=0;x<b;x++){let E=x*C;g.push(isNaN(E)?0:E)}}else{let b;S=(d=i.duration)!==null&&d!==void 0?d:250;let C=S;b=i.easing==="ease"?[.25,.1,.25,1]:i.easing==="ease-in"?[.42,0,1,1]:i.easing==="ease-out"?[0,0,.58,1]:i.easing==="ease-in-out"?[.42,0,.58,1]:i.easing.startsWith("cubic-bezier")&&(p=fO(i.easing))!==null&&p!==void 0?p:[.25,.1,.25,1];let x=MD(...b);for(let E=0;E<=C;E++)g.push(x(E/C))}else{let b=mO({stiffness:(n=i?.stiffness)!==null&&n!==void 0?n:300,damping:(a=i?.damping)!==null&&a!==void 0?a:34,mass:(l=i?.mass)!==null&&l!==void 0?l:1,initialVelocity:(u=i?.initialVelocity)!==null&&u!==void 0?u:0,precision:(h=i?.precision)!==null&&h!==void 0?h:.1,fromPosition:t,toPosition:e});g=b.progressValuesArray,S=b.duration}return{progressValuesArray:g,easing:"linear",duration:S,delay:(v=i?.delay)!==null&&v!==void 0?v:0}},vp=(t,e)=>{let i={};return t.forEach(([n,a])=>{let l=Fl(e);i[n]=a({progress:e,tween:l})}),i},$1=({type:t,progressValuesArray:e,target:i,templatesPerProperty:n,reversedStackingIndex:a,selfAndAboveTravelProgressSum:l})=>{let u=a!=null,h=f=>t==="travel"?f:u&&l?l?.[a]+f:0;return{target:i,keyframes:Od()?[vp(n,h(e[0])),vp(n,h(e[e.length-1]))]:e.map(f=>vp(n,h(f)))}},pO=({sheetId:t,destinationDetent:e,setSegment:i,viewElement:n,scrollContainer:a,travellingElement:l,contentPlacement:u,positionToScrollTo:h,scrollAxis:f,animationConfig:d,onTravel:p,onTravelStart:v,onTravelEnd:g,runOnTravelStart:S,rAFLoopEndCallback:b,dimensions:C,trackToTravelOn:x})=>{let E,A,B=qe.findSheet(t);if(!B)return;let R=[],$=[];R=B.travelAnimations,B.belowSheetsInStack.forEach(pe=>{$.push(...pe.stackingAnimations.map(_t=>({..._t,reversedStackingIndex:B.belowSheetsInStack.length-1,selfAndAboveTravelProgressSum:pe.selfAndAboveTravelProgressSum})))}),S&&v?.();let F=!(d.hasOwnProperty("contentMove")&&!d.contentMove),U=C.current.view.travelAxis.unitless,z=C.current.content.travelAxis.unitless,V=n.getBoundingClientRect(),se=l.getBoundingClientRect(),ee=u!=="center"?z:z+(U-z)/2,M=se.top-V.top,O=se.left-V.left,N=0;switch(x){case"top":N=M+ee;break;case"bottom":N=M-ee;break;case"left":N=O+ee;break;case"right":N=O-ee}let P=Math.max(Math.abs(N)/ee,0),T=C.current.progressValueAtDetents[e].exact,L=T*ee,H=x==="left"||x==="top"?L:-L,{progressValuesArray:Y,easing:X,duration:D,delay:G}=_O({origin:N,destination:H,animationConfig:d}),ie=T-P,ae=(function(pe,_t){let yt=[];for(let dt=0;dt<pe.length-1;dt+=_t)yt.push(pe[dt]);return pe.length%_t!=0&&yt.push(pe[pe.length-1]),yt})(Y,8),de=ae.map(pe=>P+ie*pe),ue=[];R.length&&ue?.push(...R.map(pe=>$1({type:"travel",progressValuesArray:de,target:pe.target,templatesPerProperty:pe.config}))),$.length&&ue?.push(...$.map(pe=>$1({type:"stacking",progressValuesArray:de,target:pe.target,templatesPerProperty:pe.config,reversedStackingIndex:pe.reversedStackingIndex,selfAndAboveTravelProgressSum:pe.selfAndAboveTravelProgressSum}))),E=f==="x"?"X":"Y";let he=pe=>({transform:"translate"+E+"("+(N-H)*(1-pe)+"px)"});A=Od()?[he(ae[0]),he(ae[ae.length-1])]:ae.map(pe=>({transform:"translate"+E+"("+(N-H)*(1-pe)+"px)"}));let ve=()=>{a.scrollTo({left:f==="x"?h:0,top:f==="y"?h:0})},ye=pe=>{let _t;if(!F)return pe();_t=Od()?l.animate(A,{easing:"linear("+ae.join(",")+")",duration:D,delay:G}):l.animate(A,{easing:X,duration:D,delay:G});let yt=()=>{pe(),_t.removeEventListener("finish",yt)};_t.addEventListener("finish",yt)},Ae=pe=>{if(!ue.length)return pe();let _t=[],yt=Od();ue?.forEach(({target:dt,keyframes:Ce})=>{let _e;_e=yt?dt.animate(Ce,{easing:"linear("+ae.join(",")+")",duration:D,delay:G}):dt.animate(Ce,{easing:X,duration:D,delay:G});let Kt=new Promise(Be=>{let Qe=()=>{Object.entries(Ce[Ce.length-1]).forEach(([Ye,xt])=>{dt.style.setProperty((Ye.startsWith("webkit")||Ye.startsWith("moz")?"-":"")+Ye.replace(/[A-Z]/g,"-$&").toLowerCase(),xt)}),_e.removeEventListener("finish",Qe),Be()};_e.addEventListener("finish",Qe)});_t.push(Kt)}),Promise.all(_t).then(()=>{pe()})},De=null,rt=pe=>{(function _t(yt,dt,Ce){let _e=C.current.progressValueAtDetents,Kt=_e.length;De||(De=yt);let Be=yt-De,Qe=Math.floor(Be);if(Qe<Y.length){let Ye=P+ie*Y[Qe];if(Ye<0)dt(Ye,[0,0]);else if(Ye>1)dt(Ye,[1,1]);else for(let xt=0;xt<Kt;xt++){let je=_e[xt],Ts=je.after;Ye>Ts&&xt+1<Kt&&Ye<_e[xt+1].before?dt(Ye,[xt,xt+1]):Ye>je.before&&Ye<Ts&&dt(Ye,[xt,xt])}requestAnimationFrame(()=>_t(document.timeline.currentTime,dt,Ce))}else{let Ye=Math.min(Kt-1,e);dt(T,[Ye,Ye]),F||ue?.length||b==null||b(),Ce()}})(document.timeline.currentTime,(_t,yt)=>{p?.({progress:_t,range:{start:yt[0],end:yt[1]},progressAtDetents:C.current.exactProgressValueAtDetents}),i(yt)},pe)},Ze=pe=>new Promise(_t=>{pe(()=>_t())}),xe=()=>{g?.()},ze=async()=>{await Promise.all([Ze(ye),Ze(Ae),Ze(rt)]),xe()};requestAnimationFrame(()=>{requestAnimationFrame(()=>{(F||e!==0)&&ve(),ze()})})},gO=({desiredDestinationDetent:t,currentDetent:e})=>typeof t=="number"?t:e,vO=({trackToTravelOn:t,destinationDetent:e,detentCountExcludingZero:i,actualSwipeOutDisabledWithDetent:n,hasOppositeTracks:a,contentPlacement:l,elementsDimensions:u,snapBackAcceleratorTravelAxisSize:h})=>{var f;if(((f=u.detentMarkers)===null||f===void 0?void 0:f.length)<=e-1)return{positionToScrollTo:null,scrollAxis:null};let d=e===0,p=e===1,v=e===i,g=t==="right"||t==="bottom",S=u.view.travelAxis.unitless,b=u.content.travelAxis.unitless,C=u.snapOutAccelerator.travelAxis.unitless,x=u.detentMarkers,E=d?0:x[e-1].accumulatedOffsets.travelAxis.unitless,A=0;if(a)v?A=S-(S-b)/2+u.snapOutAccelerator.travelAxis.unitless:d&&(A=g?0:1e4);else if(g)v?A=1e4:n&&p||d?A=0:v||n&&p||d||(A=n?x[e-1].accumulatedOffsets.travelAxis.unitless-x[0].travelAxis.unitless:E+C);else if(t==="left"||t==="top"){let B;B=n?p?2*h:v?0:h:d?C:v?h:0,A=l==="center"?e===0?b+(S-b)/2-E+B:0:b-E+B}return{positionToScrollTo:A,scrollAxis:t==="left"||t==="right"||t==="horizontal"?"x":"y"}};var SO=({destinationDetent:t,behavior:e="instant",runTravelCallbacksAndAnimations:i=!0,runOnTravelStart:n,animationConfig:a,rAFLoopEndCallback:l,trackToTravelOn:u,contentPlacement:h,onTravel:f,onTravelStart:d,onTravelEnd:p,fullTravelCallback:v,setProgrammaticScrollOngoing:g,currentDetent:S,segment:b,setSegment:C,lastProgressValue:x,dimensions:E,viewRef:A,scrollContainerRef:B,contentWrapperRef:R,sheetId:$,stackId:F,actualSwipeOutDisabledWithDetent:U,hasOppositeTracks:z,snapBackAcceleratorTravelAxisSize:V})=>{if(t===void 0&&S===null)return;let se=E.current,ee=B.current;if(ee&&se.content){let M=gO({desiredDestinationDetent:t,currentDetent:S}),O=E.current.detentMarkers.length,{positionToScrollTo:N,scrollAxis:P}=vO({destinationDetent:M,detentCountExcludingZero:O,trackToTravelOn:u,actualSwipeOutDisabledWithDetent:U,hasOppositeTracks:z,contentPlacement:h,snapBackAcceleratorTravelAxisSize:V,elementsDimensions:se});if(N!==null&&P!==null){if(g(!0),e==="smooth")pO({sheetId:$,destinationDetent:M,setSegment:C,viewElement:A.current,scrollContainer:ee,travellingElement:R.current,positionToScrollTo:N,contentPlacement:h,scrollAxis:P,animationConfig:a,onTravel:f,onTravelStart:d,onTravelEnd:p,runOnTravelStart:n,rAFLoopEndCallback:l,dimensions:E,trackToTravelOn:u});else if(i&&n&&d?.(),P==="x"?(ee.scrollTo(N,0),ee.scrollLeft=N):(ee.scrollTo(0,N),ee.scrollTop=N),C([M,M]),i){let T=E.current.progressValueAtDetents[M].exact;v?.(T,b),p?.()}}}};let fu=t=>{let e=w.useRef(null);return vi(()=>{e.current=t}),w.useCallback((...i)=>{let n=e.current;return n(...i)},[])},yO=t=>{let e,i=()=>{t(),e=requestAnimationFrame(i)};return i(),()=>{cancelAnimationFrame(e)}},bO=(()=>{let t=!0;typeof window>"u"||CSS.supports("scroll-snap-align: start")||(t=!1);let e=!0;return typeof window>"u"||"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype||(e=!1),t&&e})(),tf={gentle:{stiffness:560,damping:68,mass:1.85},smooth:{stiffness:580,damping:60,mass:1.35},snappy:{stiffness:350,damping:34,mass:.9},brisk:{stiffness:350,damping:28,mass:.65},bouncy:{stiffness:240,damping:19,mass:.7},elastic:{stiffness:260,damping:20,mass:1}},Sp=(t,e)=>{var i;let n=typeof t=="string",a=n?tf[t]:(i=tf[t?.preset])!==null&&i!==void 0?i:null,l=a||t?.easing==="spring"||["ease","ease-in","ease-out","ease-in-out","linear"].includes(t?.easing);return{skip:Jg,easing:"spring",...n?{}:t,...a??{},...l?{}:e}},wO=(t,e)=>t.includes("skipOpening:true")||e.skipOpening,W1=(t,e)=>!t.includes("skipOpening:true")&&!e.skipOpening,CO=(t,e)=>t.includes("skipClosing:true")||e.skipClosing,xO=(t,e)=>!t.includes("skipClosing:true")&&!e.skipClosing,j1=t=>t.includes("openness:closed.status:safe-to-unmount"),kO=()=>{let t="false",[e,i]=H1(w.useMemo(()=>[{name:"staging",initial:"none",states:{none:{messages:{OPEN:[{guard:(b,C)=>j1(b)&&W1(b,C),target:"opening"},{guard:j1,target:"open"}],OPEN_PREPARED:[{guard:W1,target:"opening"},{target:"open"}],ACTUALLY_CLOSE:[{guard:xO,target:"closing"}],ACTUALLY_STEP:"stepping",GO_DOWN:[{guard:(b,C)=>!C.skipOpening,target:"going-down"},{target:"go-down"}],GO_UP:"going-up"}},open:{messages:{NEXT:"none"}},opening:{messages:{NEXT:"none"}},stepping:{messages:{NEXT:"none"}},closing:{messages:{NEXT:"none"}},"go-down":{messages:{NEXT:"none"}},"going-down":{messages:{NEXT:"none"}},"going-up":{messages:{NEXT:"none"}}}},{name:"longRunning",initial:t,states:{false:{messages:{TO_TRUE:"true"}},true:{messages:{TO_FALSE:"false"}}}},{name:"openness",initial:"closed",states:{closed:{messages:{READY_TO_OPEN:[{guard:(b,C)=>!C.skipOpening,target:"opening"},{target:"open"}]},machines:{name:"status",initial:"safe-to-unmount",states:{pending:{messages:{OPEN:[{guard:wO,target:"openness:closed.status:flushing-to-preparing-open"},{target:"openness:closed.status:flushing-to-preparing-opening"}],"":"safe-to-unmount"}},"flushing-to-preparing-open":{messages:{"":"preparing-open"}},"flushing-to-preparing-opening":{messages:{"":"preparing-opening"}},"preparing-open":{},"preparing-opening":{},"safe-to-unmount":{}}}},opening:{messages:{NEXT:"open"}},open:{messages:{ACTUALLY_CLOSE:[{guard:CO,target:"openness:closed.status:pending"}],SWIPED_OUT:"openness:closed.status:pending",READY_TO_CLOSE:[{guard:(b,C)=>!C.skipClosing,target:"closing"}]},machines:[{name:"scroll",initial:"ended",states:{ended:{messages:{SCROLL_START:"ongoing"},machines:[{name:"afterPaintEffectsRun",initial:"false",states:{false:{messages:{OCCURRED:"true"}},true:{}}}]},ongoing:{messages:{SCROLL_END:"ended"}}}},{name:"move",initial:"ended",states:{ended:{messages:{MOVE_START:"ongoing"}},ongoing:{messages:{MOVE_END:"ended"}}}},{name:"swipe",silentOnly:!0,initial:"unstarted",states:{unstarted:{messages:{SWIPE_START:"ongoing"}},ongoing:{messages:{SWIPE_END:"ended"}},ended:{messages:{SWIPE_START:"ongoing",SWIPE_RESET:"unstarted"}}}},{name:"evaluateCloseMessage",silentOnly:!0,initial:"false",states:{false:{messages:{CLOSE:"true"}},true:{messages:{CLOSE:"false"}}}},{name:"evaluateStepMessage",silentOnly:!0,initial:"false",states:{false:{messages:{STEP:"true"}},true:{messages:{STEP:"false"}}}}]},closing:{messages:{NEXT:"openness:closed.status:pending"}}}},{name:"skipOpening",initial:"false",states:{true:{messages:{TO_FALSE:"false"}},false:{messages:{TO_TRUE:"true"}}}},{name:"skipClosing",initial:"false",states:{true:{messages:{TO_FALSE:"false"}},false:{messages:{TO_TRUE:"true"}}}},{name:"scrollContainerTouch",silentOnly:!0,initial:"ended",states:{ended:{messages:{TOUCH_START:"ongoing"}},ongoing:{messages:{TOUCH_END:"ended"}}}},{name:"backStuck",silentOnly:!0,initial:"false",states:{false:{messages:{STUCK_START:"true"}},true:{messages:{STUCK_END:"false"}}}},{name:"frontStuck",silentOnly:!0,initial:"false",states:{false:{messages:{STUCK_START:"true"}},true:{messages:{STUCK_END:"false"}}}}],[t])),[n,a]=H1(w.useMemo(()=>[{name:"active",initial:"false",states:{false:{messages:{TO_TRUE:"true"}},true:{messages:{TO_FALSE:"false"}}}},{name:"position",initial:"out",states:{out:{messages:{READY_TO_GO_FRONT:[{guard:(b,C)=>C.skipOpening,target:"position:front.status:idle"},{target:"position:front.status:opening"}]}},front:{machines:[{name:"status",initial:"opening",states:{opening:{messages:{NEXT:"idle"}},closing:{messages:{NEXT:"position:out"}},idle:{messages:{READY_TO_GO_DOWN:[{guard:(b,C)=>C.skipOpening,target:"position:covered.status:idle"},{target:"position:covered.status:going-down"}],READY_TO_GO_OUT:"closing",GO_OUT:"position:out"}}}}]},covered:{machines:[{name:"status",initial:"going-down",states:{"going-down":{messages:{NEXT:"idle"}},"going-up":{messages:{NEXT:"indeterminate"}},indeterminate:{messages:{GOTO_idle:"idle",GOTO_front:"position:front.status:idle"}},idle:{messages:{READY_TO_GO_DOWN:[{guard:(b,C)=>C.skipOpening,target:"come-back"},{target:"going-down"}],READY_TO_GO_UP:"going-up",GO_UP:"indeterminate"}},"come-back":{messages:{"":"idle"}}}}]}}}],[])),l=w.useMemo(()=>n.matches("position:out")?"out":n.matches("position:front")?"front":n.matches("position:covered")?"covered":void 0,[n]),u=w.useMemo(()=>n.matches("position:covered.status:idle")?"idle":n.matches("position:covered.status:going-down")?"going-down":n.matches("position:covered.status:going-up")?"going-up":null,[n]),h=zr(e,"staging"),f=w.useMemo(()=>h.getValues()[0],[h]),[d,p]=oO(-1),v=$o(),g=$o();return w.useMemo(()=>({titleId:v,descriptionId:g,staging:f,opennessState:e,sendToOpennessMachine:i,positionState:n,sendToPositionMachine:a,layerPosition:l,layerCovered:u,stackingIndex:d,assignStackingIndex:p}),[v,g,f,e,i,n,a,l,u,d,p])},Ex=We.forwardRef((t,e)=>{let i,{forComponent:n,as:a,children:l,className:u,"data-silk":h,initialState:f,onPresentAutoFocus:d,onDismissAutoFocus:p,onTravelStatusChange:v,onTravelRangeChange:g,swipeDismissal:S=!0,swipe:b=!0,snapOutAcceleration:C="auto",snapToEndDetentsAcceleration:x="auto",onTravel:E,onTravelStart:A,onTravelEnd:B,detents:R,inertOutside:$=!0,nativeEdgeSwipePrevention:F=!1,onSwipeFromEdgeToGoBackAttempt:U,onClickOutside:z,onEscapeKeyDown:V,onFocusInside:se,nativeFocusScrollPrevention:ee=!0,contentPlacement:M=null,tracks:O,swipeOvershoot:N=!0,swipeTrap:P,enteringAnimationSettings:T,exitingAnimationSettings:L,steppingAnimationSettings:H,id:Y,...X}=t,D=n??Ga,G=w.useContext(D)||{},{license:ie,StackContext:ae,CustomSheetContext:de,sheetRole:ue,open:he,onOpenChange:ve,elementFocusedLastBeforeShowing:ye,onSafeToUnmountChange:Ae,setLongRunning:De,setStaging:rt,defaultActiveDetent:Ze,activeDetent:xe,onActiveDetentChange:ze,sheetId:pe}=G,{titleId:_t,descriptionId:yt,staging:dt,opennessState:Ce,sendToOpennessMachine:_e,positionState:Kt,sendToPositionMachine:Be,layerCovered:Qe,stackingIndex:Ye,assignStackingIndex:xt}=kO(),je=zr(Ce,"staging"),{stackId:Ts,setSheetsCount:ss,updateSheetStagingDataInStack:Kn,removeSheetStagingDataInStack:Xn,updateSheetDataInStack:Fr,removeSheetDataFromStack:Ys,getPreviousSheetDataInStack:ri}=ae?w.useContext(ae):{},{ancestorPrimarySwipeTrapActiveOnYAxis:$i}=w.useContext(Ur)||{},Mt=kx(),ni=w.useRef(null),Gs=Es(ni,Mt,e),cn=w.useRef(null),Ks=w.useRef(null),kt=w.useRef(null),kr=w.useRef(null),Wi=w.useRef(null),Rs=w.useRef(null),Er=w.useRef(null),Zn=w.useRef([]),Qi=w.useMemo(()=>R?typeof R=="string"?[R,"var(--silk-aF)"]:[...R,"var(--silk-aF)"]:["var(--silk-aF)"],[R]),Xs=w.useRef(null);w.useEffect(()=>{Xs.current===null&&Number.isInteger(xe)&&xe>0&&(Xs.current=xe)},[]);let Ut=w.useMemo(()=>Number.isInteger(Ze)?Ze:Number.isInteger(xe)&&xe>0?xe:Xs.current?Xs.current:1,[xe,Ze]),{actualTrack:Pe,actualPlacement:Lt}=w.useMemo(()=>{let Q={actualPlacement:null,actualTrack:null};return M&&!O?(Q.actualPlacement=M,M!=="center"?Q.actualTrack=M:Q.actualTrack="bottom"):O&&!M?Array.isArray(O)?(Q.actualPlacement="center",Q.actualTrack=O.includes("left")?"horizontal":"vertical"):(Q.actualPlacement=O,Q.actualTrack=O):O||M?O&&M&&(Q.actualPlacement=M,Array.isArray(O)?Q.actualTrack=O.includes("left")?"horizontal":"vertical":Q.actualTrack=O):(Q.actualPlacement="bottom",Q.actualTrack="bottom"),[{state:"staging:opening",configTrack:T?.track},{state:"staging:closing",configTrack:L?.track}].forEach(({state:fe,configTrack:me})=>{Ce.matches(fe)&&me&&(me==="top"&&Q.actualTrack==="bottom"||me==="bottom"&&Q.actualTrack==="top"?Q.actualTrack="vertical":(me==="left"&&Q.actualTrack==="right"||me==="right"&&Q.actualTrack==="left")&&(Q.actualTrack="horizontal"))}),Q},[M,O,T?.track,L?.track,Ce]);w.useMemo(()=>Pe==="horizontal",[Pe]);let Vo=w.useMemo(()=>Pe==="vertical",[Pe]);w.useEffect(()=>{if(M?.includes("top")&&O&&O!=="top"||M?.includes("bottom")&&O&&O!=="bottom"||!M?.includes("center")&&O&&O.includes("top")&&O.includes("bottom")||M?.includes("left")&&O&&O!=="left"||M?.includes("right")&&O&&O!=="right"||!M?.includes("center")&&O&&O.includes("left")&&O.includes("right"))throw Error(`'placement' prop value '${M}' cannot be used with 'tracks' prop value '${O}'.`)},[M,O]);let Zs=w.useMemo(()=>T?.track||(Pe==="horizontal"?"right":Pe==="vertical"?"bottom":Pe),[T?.track,Pe]),ji=w.useMemo(()=>Sp(T,tf.smooth),[T]),Se=w.useMemo(()=>Sp(L,{easing:"spring",stiffness:520,damping:44,mass:1}),[L]),ft=w.useMemo(()=>Sp(H??T,tf.smooth),[H,T]),Ke=w.useMemo(()=>ue==="alertdialog"||!S,[S,ue]),Fe=(Pe!=="horizontal"&&Pe!=="vertical"||!!Ke)&&!N,[Ee,Ie,Ft,Bt]=w.useMemo(()=>{let Q=!1,ce=!1,fe=!1,me=!1;return b&&bO?Ke&&(R?(fe=!0,Ce.matches("openness:open")&&!Ce.matches("staging:closing")&&(ce=!0)):Ce.matches("openness:open")&&!Ce.matches("staging:closing")&&(Fe===!1&&Wa()?me=!0:Q=!0)):Ce.matches("openness:closed")||(Q=!0),[Q,ce,fe,me]},[b,Ce,Ke,R,Fe]),Qs=w.useMemo(()=>je.getValues()[0]!=="none",[je]),Js=["right","left","horizontal"].includes(Pe)?"horizontal":"vertical",[Tr,As]=w.useState(!1),[Rr,ci]=w.useState(!1),fs=w.useMemo(()=>!$&&($?void 0:Tr!==!0),[$,Tr]),ui=w.useMemo(()=>Fe===!0?x==="auto"?10:1:0,[Fe,x]),Ei=w.useRef(null);w.useEffect(()=>(pe&&(Ei.current=qe.addSheet({id:pe,stackId:Ts,stackingIndex:-1,sendToOpennessMachine:_e})),()=>{pe&&qe.attemptToRemoveSheetOrCleanup(pe)}),[_e,pe,Ts]),w.useEffect(()=>(ee&&qe.addNativeFocusScrollPreventer(pe),()=>{ee&&qe.removeNativeFocusScrollPreventer(pe)}),[ee,pe]);let be=w.useMemo(()=>ri?.(pe),[ri,pe]),[un,Iu]=w.useState(null),ms=w.useMemo(()=>E&&un?Q=>{un(Q),E(Q)}:E&&!un?E:!E&&un?un:null,[E,un]),er=w.useCallback(()=>{B?.();let Q=nt.current.exactProgressValueAtDetents[mt.current[0]];Vt.current=Q,qe.updateSheetTravelProgress(pe,Q)},[B,pe]),Ar=w.useMemo(()=>{let Q;if(Ye.value>0)Q=ms?(ce,fe)=>{ms({progress:ce,range:fe,progressAtDetents:nt.current.exactProgressValueAtDetents});let me=Fl(ce);Ei.current.aggregatedTravelCallback(ce,me)}:ce=>{let fe=Fl(ce);Ei.current.aggregatedTravelCallback(ce,fe)};else{let ce=qe.getAggregatedStackingCallbackForSheetsBelow(pe);Q=ce?ms?(fe,me)=>{ms({progress:fe,range:me,progressAtDetents:nt.current.exactProgressValueAtDetents});let Me=Fl(fe);Ei.current.aggregatedTravelCallback(fe,Me),ce(fe,Me)}:fe=>{let me=Fl(fe);Ei.current.aggregatedTravelCallback(fe,me),ce(fe,me)}:()=>{}}return Q},[Ye.value,ms,pe]),Qn=w.useRef(!1),tc=w.useMemo(()=>{let Q;return Pe==="bottom"||Pe==="vertical"?Q="translateY(-2px)":Pe==="top"?Q="translateY(2px)":Pe==="right"||Pe==="horizontal"?Q="translateX(-2px)":Pe==="left"&&(Q="translateX(2px)"),ce=>{ce>0&&ce<1&&!Qn.current?(Wi.current.style.setProperty("transform",Q),Qn.current=!0):(ce>1||ce<=0)&&Qn.current&&(Wi.current.style.removeProperty("transform"),Qn.current=!1)}},[Pe]),qo=w.useMemo(()=>Bt?Q=>tc(Q):Ar,[tc,Bt,Ar]),[$r,hn]=w.useState("both"),tr=ux(ni);w.useEffect(()=>{var Q,ce;let fe,me,Me;if(typeof P=="boolean")fe={x:P,y:P};else{let{x:Xt,y:Si}=P||{};fe={x:Xt,y:Si}}let Oe=(Gt==="ios"||Gt==="ipados")&&$&&!$i,Je=hx();Js==="vertical"&&(me=fe.x,Me=!!Oe||!Je&&((Q=fe.y)===null||Q===void 0||Q)),Js==="horizontal"&&(Me=!!Oe||fe.y,me=(ce=fe.x)===null||ce===void 0||ce),Me=!!Me||tr,hn(me&&!Me?"horizontal":!me&&Me?"vertical":me&&Me?"both":"none")},[$i,$,P,tr,Js]);let nt=w.useRef({}),[ic,Sf]=w.useState(0),[sc,Uu]=w.useState(()=>()=>({top:null,bottom:null})),Jn=w.useRef([]),mt=w.useRef([0,0]),Vi=w.useRef(0),jt=w.useRef(null),Yo=w.useRef(()=>{}),ea=w.useRef(!1),dn=w.useRef(!1),Go=w.useCallback(Q=>dn.current=Q,[]),Ti=fu(({destinationDetent:Q,trackToTravelOn:ce=Pe==="vertical"?"bottom":Pe==="horizontal"?"right":Pe,behavior:fe="instant",runTravelCallbacksAndAnimations:me=!0,runOnTravelStart:Me=!0,animationConfig:Oe,rAFLoopEndCallback:Je,travelEndCallback:Xt})=>{SO({destinationDetent:Q,behavior:fe,runTravelCallbacksAndAnimations:me,runOnTravelStart:Me,trackToTravelOn:ce,animationConfig:Oe,rAFLoopEndCallback:Je,onTravel:ms,onTravelStart:A,onTravelEnd:()=>{Xt?.(),er()},segment:mt,fullTravelCallback:Ar,sheetId:pe,stackId:Ts,dimensions:nt,snapBackAcceleratorTravelAxisSize:ui,actualSwipeOutDisabledWithDetent:Ie,lastProgressValue:Vt,viewRef:ni,scrollContainerRef:kt,contentWrapperRef:Wi,currentDetent:mt.current[0]===mt.current[1]?mt.current[0]:null,setSegment:sr,setProgrammaticScrollOngoing:Go,contentPlacement:Lt,hasOppositeTracks:Pe==="horizontal"||Pe==="vertical"})}),ta=w.useCallback(()=>{mt.current[0]===mt.current[1]&&Ti({runTravelCallbacksAndAnimations:!1,destinationDetent:mt.current[0]})},[pe,Pe,Ie,Bt,ui]),yf=w.useCallback(Q=>{Fr?.({sheetId:pe,sendToOpennessMachine:_e,sendToPositionMachine:Be})},[Fr,pe,_e,Be]),rc=w.useCallback(()=>{Ys?.(pe)},[Ys,pe]),nc=w.useMemo(()=>ue==="alertdialog"?()=>{}:()=>_e({type:"CLOSE"}),[_e,ue]),ac=w.useCallback(()=>{qe.updateLayer({layerId:pe,layerContextId:de,layerStackContextId:ae,inertOutside:$,onPresentAutoFocus:d,onDismissAutoFocus:p,dismissOverlayIfNotAlertDialog:nc,onClickOutside:z,onEscapeKeyDown:V,viewElement:ni.current,backdropElement:Ks.current,scrollContainerElement:kt.current,elementFocusedLastBeforeShowing:ye.current})},[pe,de,ae,$,d,p,nc,z,V,ye]),Fu=w.useCallback(()=>{qe.removeLayer(pe)},[pe]),bf=w.useCallback(()=>{let Q=me=>["ArrowDown","ArrowUp","PageDown","PageUp","End","Home"," "].includes(me.key),ce=me=>{if(Q(me)){var Me,Oe;(Me=kt.current)===null||Me===void 0||Me.style.setProperty("overflow","hidden"),(Oe=kt.current)===null||Oe===void 0||Oe.style.setProperty("scroll-snap-type","none")}},fe=me=>{if(Q(me)){var Me,Oe;(Me=kt.current)===null||Me===void 0||Me.style.removeProperty("overflow"),(Oe=kt.current)===null||Oe===void 0||Oe.style.removeProperty("scroll-snap-type")}};return document.addEventListener("keydown",ce),document.addEventListener("keyup",fe),()=>{document.removeEventListener("keydown",ce),document.removeEventListener("keyup",fe)}},[]),Mr=w.useCallback(()=>{xt(Q=>Q+1),qe.updateSheetStackingIndex(pe,Ye.silent.value)},[xt,Ye.silent,pe]),Ri=w.useCallback(()=>{xt(Q=>Q-1),qe.updateSheetStackingIndex(pe,Ye.silent.value)},[xt,Ye.silent,pe]),ia=zr(Kt,"active");xs("after-paint",ia,{state:"active:true",callback:ac}),xs("after-paint",ia,{state:"active:true",callback:bf}),Ne("after-paint",ia,{state:"active:false",callback:Fu});let Wr=zr(Kt,"position"),rs=zr(Kt,"position:covered.status");at(Wr,{state:"position:out",transition:"READY_TO_GO_FRONT",callback:w.useCallback(Q=>{be?.sendToPositionMachine({type:"READY_TO_GO_DOWN",skipOpening:Q.skipOpening}),Mr()},[Mr,be])}),at(Kt,{state:"position:front.status:opening",transition:"NEXT",callback:w.useCallback(()=>{be?.sendToPositionMachine("NEXT")},[be])}),at(Kt,{state:"position:front.status:idle",transition:"READY_TO_GO_OUT",callback:w.useCallback(()=>{be?.sendToPositionMachine("READY_TO_GO_UP")},[be])}),at(Kt,{state:"position:front.status:idle",transition:"GO_OUT",callback:w.useCallback(()=>{Ar?.(0,{start:0,end:0}),er(),be?.sendToPositionMachine("GO_UP"),Ri()},[Ar,er,be,Ri])}),at(Kt,{state:"position:front.status:idle",transition:"READY_TO_GO_DOWN",callback:w.useCallback(Q=>{be?.sendToPositionMachine({type:"READY_TO_GO_DOWN",skipOpening:Q.skipOpening}),Mr()},[Mr,be])}),at(Kt,{state:"position:front.status:closing",transition:"NEXT",callback:w.useCallback(()=>{be?.sendToPositionMachine("NEXT"),Ri()},[be,Ri])}),at(rs,{state:"position:covered.status:going-down",transition:"NEXT",callback:w.useCallback(()=>{be?.sendToPositionMachine("NEXT")},[be])}),at(rs,{state:"position:covered.status:idle",transition:"READY_TO_GO_DOWN",callback:w.useCallback(Q=>{be?.sendToPositionMachine({type:"READY_TO_GO_DOWN",skipOpening:Q.skipOpening}),Mr()},[Mr,be])}),at(rs,{state:"position:covered.status:idle",transition:"READY_TO_GO_UP",callback:w.useCallback(()=>{be?.sendToPositionMachine("READY_TO_GO_UP")},[be])}),at(rs,{state:"position:covered.status:idle",transition:"GO_UP",callback:w.useCallback(()=>{be?.sendToPositionMachine("GO_UP"),Ri()},[Ri,be])}),Ne("immediate",rs,{state:"position:covered.status:come-back",callback:w.useCallback(()=>Be(""),[Be])}),at(rs,{state:"position:covered.status:going-up",transition:"NEXT",callback:w.useCallback(()=>{be?.sendToPositionMachine("NEXT"),Ri()},[be,Ri])}),Ne("immediate",rs,{state:"position:covered.status:indeterminate",callback:w.useCallback(()=>{Ye.silent.value===0?Be("GOTO_front"):Be("GOTO_idle")},[Ye.silent,Be])});let Ms=w.useCallback(()=>be?.sendToOpennessMachine({machine:"staging",type:"NEXT"}),[be]),ir=w.useCallback((Q,{newState:ce})=>{rt(ce),Kn?.({sheetId:pe,staging:ce})},[i,rt,Kn,pe]),fn=w.useCallback((Q,{newState:ce})=>{v?.(ce)},[v]),sr=w.useMemo(()=>{let Q=ce=>{Vi.current=ce[1],queueMicrotask(()=>{let fe=ce[0],me=ce[1];(fe!==mt.current[0]||me!==mt.current[1])&&(mt.current=ce,fe===me&&(jt.current===null&&ze?ze(me):fe===jt.current&&(jt.current=null)))})};return g&&Fe===!1?Q=ce=>{Vi.current=ce[1],queueMicrotask(()=>{let fe=ce[0],me=ce[1];(fe!==mt.current[0]||me!==mt.current[1])&&(mt.current=ce,g({start:fe,end:me}),fe===me&&(jt.current===null&&ze?ze(me):fe===jt.current&&(jt.current=null)))})}:Fe===!0&&(Q=Ft?ce=>{Vi.current=ce[1],queueMicrotask(()=>{let fe=ce[0],me=ce[1];if(fe!==mt.current[0]||me!==mt.current[1]){let Me=Qi.length;Ie&&fe===1&&me===1?_e({machine:"backStuck",type:"STUCK_START"}):fe===Me&&me===Me?_e({machine:"frontStuck",type:"STUCK_START"}):to.current?_e({machine:"frontStuck",type:"STUCK_END"}):Qo.current&&_e({machine:"backStuck",type:"STUCK_END"}),mt.current=ce,g?.({start:fe,end:me}),fe===me&&(jt.current===null&&ze?ze(me):fe===jt.current&&(jt.current=null))}})}:ce=>{Vi.current=ce[1],queueMicrotask(()=>{let fe=ce[0],me=ce[1];if(fe!==mt.current[0]||me!==mt.current[1]){let Me=Qi.length;fe===Me&&me===Me?_e({machine:"frontStuck",type:"STUCK_START"}):to.current&&_e({machine:"frontStuck",type:"STUCK_END"}),mt.current=ce,g?.({start:fe,end:me}),fe===me&&(jt.current===null&&ze?ze(me):fe===jt.current&&(jt.current=null))}})}),Q},[g,Fe,ze,Ft,Ie,Qi.length,_e]),Ls=w.useCallback(Q=>{let ce={destinationDetent:Q==="front"?nt.current.detentMarkers.length:1,runTravelCallbacksAndAnimations:!1};if(Ti(ce),Wa()){var fe;(fe=kt.current)===null||fe===void 0||fe.style.setProperty("overflow","hidden"),setTimeout(()=>{var me;(me=kt.current)===null||me===void 0||me.style.removeProperty("overflow")},CSS.supports("overscroll-behavior","none")?1:10)}ea.current=!1},[Ti]),rr=w.useCallback((Q,ce)=>{let fe=mt.current[0],me=ce??null;if(me===null){var Me,Oe;me=(Q??"up")==="up"?(Me=mt.current[0])<Qi.length?Me+1:1:(Oe=mt.current[0])>1?Oe-1:Qi.length}return me===0||me===fe?null:me},[Qi]),Ko=w.useCallback(({direction:Q,detent:ce,behavior:fe})=>{let me=()=>{let Me=rr(Q,ce);Me&&_e({type:"ACTUALLY_STEP",detent:Me,behavior:fe})};Ce.silent.matches("openness:open.scroll:ended.afterPaintEffectsRun:true")?me():dc.current=me},[Ce.silent,rr,_e]),sa=w.useCallback((Q,ce)=>{jt.current=Q,ze?.(Q),Ti({destinationDetent:Q,behavior:ce??(ft.skip?"instant":"smooth"),animationConfig:ft,travelEndCallback:()=>_e({machine:"staging",type:"NEXT"})})},[ze,Ti,ft,_e]),Lr=w.useCallback((Q,ce,fe,me)=>{let Me;if(Q==="auto"){let Oe=me==="center"?fe+(ce-fe)/2:fe;Me=$n==="chromium"?Oe<=1440?70+.25*Oe:.3*Oe:Wa()?Gt==="ios"||Gt==="ipados"?Oe<=716?15+.1*Oe:.12*Oe:.5*Oe:10}else if(typeof Q=="function"){let Oe=parseInt(Q(fe),10);Me=Oe<1?1:Oe>fe/2?fe/2:Oe}else Q==="initial"&&(Me=1);return Me},[]),Xo=w.useCallback(()=>{if(ni.current){let Q=(ce,fe)=>ni.current.style.setProperty(ce,fe);Q("--silk-aD",nt.current.view.travelAxis.px),Q("--silk-aE",nt.current.view.crossAxis.px),Q("--silk-aF",nt.current.content.travelAxis.px),Q("--silk-aG",nt.current.content.crossAxis.px),Q("--silk-aH",nt.current.frontSpacer.travelAxis.px),Q("--silk-aI",nt.current.backSpacer.travelAxis.px),Q("--silk-aJ",nt.current.snapOutAccelerator.travelAxis.px),Q("--silk-aK",nt.current.detentMarkers[0].travelAxis.px)}},[]),Zo=w.useCallback(Q=>{let ce=ni.current,fe=Rs.current,me=[];Zn.current.forEach(Dt=>{me.push(window.getComputedStyle(Dt))});let Me=Dt=>parseFloat(Dt),Oe=Dt=>parseInt(Dt,10),Je=Dt=>Pe==="right"||Pe==="left"||Pe==="horizontal"?Dt==="travelAxis"?"width":"height":Dt==="travelAxis"?"height":"width",Xt=Dt=>{let nr,Vr,ar,Ji,$e,Or;return Vr=Me(nr=Dt.getPropertyValue(Je("travelAxis"))),ar=Oe(nr),$e=Oe(Ji=Dt.getPropertyValue(Je("crossAxis"))),Or=Oe(Ji),{travelAxis:{px:nr,unitless:Vr,unitlessRoundedDown:ar},crossAxis:{px:Ji,unitless:$e,unitlessRoundedDown:Or}}},Si=()=>{let Dt,nr,Vr=window.getComputedStyle(ni.current),ar=window.getComputedStyle(Rs.current),Ji=0;Sf(bt=>bt+1),nt.current={view:{...Xt(Vr)},scroll:{},snapOutAccelerator:{travelAxis:{}},frontSpacer:{travelAxis:{}},backSpacer:{travelAxis:{}},content:{...Xt(ar)},detentMarkers:[...me.map((bt,_s)=>{let Os=Xt(bt);return _s!==me.length-1&&(Ji+=Os.travelAxis.unitless),{...Os,accumulatedOffsets:{travelAxis:{px:Ji+"px",unitless:Ji,unitlessRoundedDown:null}}}})],progressValueAtDetents:[]};let $e=nt.current;$e.scroll=$e.view;let Or=Lr(C,$e.view.travelAxis.unitless,$e.content.travelAxis.unitless,Lt);$e.snapOutAccelerator.travelAxis.px=Or+"px",$e.snapOutAccelerator.travelAxis.unitless=Or,$e.snapOutAccelerator.travelAxis.unitlessRoundedDown=Oe(Or);let Yu=$e.detentMarkers.length,so=$e.content.travelAxis.unitless-Ji;$e.detentMarkers[Yu-1]={travelAxis:{px:so+"px",unitless:so,unitlessRoundedDown:null},crossAxis:{px:"1px",unitless:1,unitlessRoundedDown:1},accumulatedOffsets:{travelAxis:{px:Ji+so+"px",unitless:Ji+so,unitlessRoundedDown:null}}};let ro=bt=>({before:bt(-2.1),exact:bt(0),after:bt(2.1)}),na=$e.content.travelAxis.unitless,gn=[ro(bt=>bt/na)],mc;$e.detentMarkers.slice(0,-1).forEach(bt=>{let _s=bt.accumulatedOffsets.travelAxis.unitless;gn.push(ro(Os=>(_s+Os)/na))}),gn.push(ro(bt=>(na+bt)/na)),mc=gn[Ut];let _c=Jn.current.length>0?Jn.current[mt.current[1]]:0,Gu=(function(bt,_s){let Os=0;for(let qr=1;qr<_s.length;qr++){let yi=_s[qr];Math.abs(yi-bt)<Math.abs(_s[Os]-bt)&&(Os=qr)}return Os})(_c??1,gn.map(bt=>bt.exact));sr([Gu,Gu]),$e.progressValueAtDetents=gn,$e.exactProgressValueAtDetents=gn.map(bt=>bt.exact),Jn.current=$e.progressValueAtDetents.map(bt=>bt.exact),$e.progressValueAtInitialDetent=mc,Dt=Bt?Pe==="horizontal"||Pe==="vertical"?$e.view.travelAxis.unitless/2+1:1:Ie?$e.content.travelAxis.unitless-nt.current.detentMarkers[0].travelAxis.unitless+ui:Pe==="horizontal"||Pe==="vertical"?$e.view.travelAxis.unitless/2+$e.view.travelAxis.unitless-($e.view.travelAxis.unitless-$e.content.travelAxis.unitless)/2+$e.snapOutAccelerator.travelAxis.unitless:Lt==="center"?$e.view.travelAxis.unitless-($e.view.travelAxis.unitless-$e.content.travelAxis.unitless)/2+$e.snapOutAccelerator.travelAxis.unitless:$e.view.travelAxis.unitless-($e.view.travelAxis.unitless-$e.content.travelAxis.unitless)+$e.snapOutAccelerator.travelAxis.unitless,$e.frontSpacer.travelAxis.unitless=Dt,$e.frontSpacer.travelAxis.px=Dt+"px",nr=Fe===!0&&x==="auto"?$e.view.travelAxis.unitless+ui:Pe==="horizontal"||Pe==="vertical"?Bt?$e.view.travelAxis.unitless/2:$e.view.travelAxis.unitless/2+$e.view.travelAxis.unitless-($e.view.travelAxis.unitless-$e.content.travelAxis.unitless)/2+$e.snapOutAccelerator.travelAxis.unitless:$e.view.travelAxis.unitless,$e.backSpacer.travelAxis.unitless=nr,$e.backSpacer.travelAxis.px=nr+"px",Xo(),Uu(()=>()=>{let bt,_s;if(!ni.current)return{top:null,bottom:null};let Os=ni.current.getBoundingClientRect(),qr=Os.top,yi=Os.bottom,aa=Vo||Pe==="top"||Pe==="bottom",no=$e.view[aa?"travelAxis":"crossAxis"].unitless,ao=$e.content[aa?"travelAxis":"crossAxis"].unitless;return Lt==="left"||Lt==="right"||Lt==="center"?(bt=qr+(no-ao)/2,_s=yi-(no-ao)/2):Lt==="top"?(bt=qr,_s=yi-(no-ao)):Lt==="bottom"&&(bt=qr+(no-ao),_s=yi),{top:bt,bottom:_s}})};Si();let jr=(Dt,nr)=>{let Vr=new ResizeObserver(ar=>{ar.forEach(()=>nr())});return Vr.observe(Dt,{box:"border-box"}),Vr},Dr=()=>{Si(),Ti({runTravelCallbacksAndAnimations:!1})},ns=!0,as=jr(ce,()=>{ns?ns=!1:Dr()}),pn=!0,Zt=jr(fe,()=>{pn?(Si(),pn=!1):Dr()});return()=>{as&&ce&&(as.unobserve(ce),as.disconnect()),Zt&&fe&&(Zt.unobserve(fe),Zt.disconnect())}},[Pe,Lr,C,Ut,Fe,Xo,ui,x,Ti,sr,Lt,Ie,Bt,Qi]),oc=w.useCallback(Q=>{let ce,fe=0,me=Q,Me=0;return Oe=>{ce=Oe;let Je=me-Oe;return fe=Je,(Je===0||Math.abs(Je)<Math.abs(Me/2))&&Ce.silent.matches("scrollContainerTouch:ongoing")&&(ce=me-Me/2,fe=me-ce),Math.abs(fe)>=.1&&.35>Math.abs(fe)&&(ce=fe>=0?me-.1:me+.1,fe=fe>=0?.1:-.1),Oe<=0&&(ce=0),me=ce,Me=fe,ce}},[Ce.silent]),Xa=w.useCallback(()=>{var Q;let ce,fe,me=Pe==="right"||Pe==="left"||Pe==="horizontal"?"scrollLeft":"scrollTop",Me=kt.current,Oe=nt.current.snapOutAccelerator.travelAxis.unitless,Je=nt.current.content.travelAxis.unitless,Xt=nt.current.scroll.travelAxis.unitless,Si=oc((Q=Vt.current)!==null&&Q!==void 0?Q:nt.current.progressValueAtDetents[mt.current[1]].exact),jr=Pe==="right"||Pe==="bottom",Dr=Pe==="left"||Pe==="top";if(jr||Dr){let ns;if(Bt)ns=Dr?Zt=>1-Zt/Je:Zt=>1+Zt/Je;else if(jr)if(Lt!=="center"){let Zt=Ie?nt.current.detentMarkers[0].travelAxis.unitless-ui:-Oe;ns=Dt=>(Dt+Zt)/Je}else{let Zt=Je+(Xt-Je)/2;ns=Dt=>(Dt-Oe)/Zt}else if(Dr)if(Lt!=="center")ns=Zt=>(Je+ui-Zt)/Je;else{let Zt=Je+(Xt-Je)/2;ns=Dt=>(Zt+ui-Dt)/Zt}let as=Fe===!0?1:10,pn=Fe===!0&&Ie?nt.current.progressValueAtDetents[1].exact:0;fe=()=>{ce=Me[me];let Zt=Math.min(Math.max(ns(ce),pn),as);return Math.min(Math.max(Si(Zt),pn),as)}}else if(Pe==="horizontal"||Pe==="vertical"){let ns=(Xt-Je)/2,as=Bt?0:Oe+Xt-ns,pn=Je+ns;fe=()=>{ce=Me[me];let Zt=1-Math.abs(ce-as)/pn;return Math.max(Si(Math.max(Zt,0)),0)}}return fe},[Pe,oc,Fe,Bt,Lt,Ie,ui,ic]),mn=w.useRef(),$u=w.useCallback(()=>{let Q=kt.current,ce=()=>{_e({machine:"openness:open.move",type:"MOVE_END"});for(let me=0;me<nt.current.progressValueAtDetents.length;me++){let Me=nt.current.progressValueAtDetents[me].exact;Vt.current>Me-.01&&Vt.current<Me+.01&&(_e({machine:"openness:open.scroll",type:"SCROLL_END"}),_e({machine:"openness:open.swipe",type:"SWIPE_END"}))}},fe=()=>{dn.current?Go(!1):(hc.current||_e({machine:"openness:open.scroll",type:"SCROLL_START"}),to.current||Qo.current||(Jo.current||_e({machine:"openness:open.swipe",type:"SWIPE_START"}),fc.current||_e({machine:"openness:open.move",type:"MOVE_START"}))),clearTimeout(mn.current),mn.current=setTimeout(ce,200)};return Q.addEventListener("scroll",fe),()=>{Q.removeEventListener("scroll",fe),clearTimeout(mn.current)}},[_e,Go]),Vt=w.useRef(null),_n=w.useCallback(()=>{let Q;if(qo){let ce=nt.current.progressValueAtDetents,fe=ce.length,me=Xa();Q=yO(()=>{let Me,Oe=me();if(Vt.current!==Oe){for(let Je=0;Je<fe;Je++){let Xt=ce[Je],Si=Xt.after;Oe>Si&&Je+1<fe&&Oe<ce[Je+1].before?(Me={start:Je,end:Je+1},sr([Je,Je+1])):Oe>Xt.before&&Oe<Si?(Me={start:Je,end:Je},sr([Je,Je])):Oe<=0&&(Me={start:0,end:0},sr([0,0]))}Yo.current(Oe,Me),Vt.current=Oe}})}return()=>{Q?.()}},[sr,qo,Xa]),Za=w.useCallback(Q=>{let ce=1e5,fe=me=>{ce<Math.abs(me.deltaY)?window.removeEventListener("wheel",fe,{passive:!1}):me.preventDefault(),ce=Math.abs(me.deltaY)};return window.addEventListener("wheel",fe,{passive:!1}),setTimeout(()=>{Q("SWIPED_OUT")},100),()=>window.removeEventListener("wheel",fe,{passive:!1})},[]),Qa=w.useCallback((Q,{send:ce})=>{let fe,me=ni.current,Me=Rs.current,Oe=kt.current,Je=!1,Xt=()=>Je=!0;window.addEventListener("wheel",Xt,{passive:!0,once:!0});let Si=new IntersectionObserver(function(jr){for(let Dr of jr)Dr.isIntersecting||(me.style.setProperty("pointer-events","none","important"),me.style.setProperty("opacity","0","important"),me.style.setProperty("position","fixed","important"),me.style.setProperty("top","-100px","important"),me.style.setProperty("left","-100px","important"),Me.style.setProperty("pointer-events","none","important"),Oe.style.setProperty("width","1px","important"),Oe.style.setProperty("height","1px","important"),Oe.style.setProperty("clip-path","inset(0)","important"),requestAnimationFrame(()=>{Je?fe=Za(ce):ce("SWIPED_OUT")}))},{root:me,threshold:[0]});return Si.observe(Me),()=>{fe?.(),window.removeEventListener("wheel",Xt,{passive:!0,once:!0}),Si&&(Si.unobserve(Me),Si.disconnect())}},[Za]),wf=w.useRef(()=>0),lc=w.useCallback(()=>{let Q=ni.current,ce=fe=>{rn({nativeEvent:fe,defaultBehavior:{},handler:se})};return Q?.addEventListener("focus",ce,{capture:!0}),()=>{Q?.removeEventListener("focus",ce,{capture:!0})}},[se]),cc=w.useCallback(Q=>{kt.current.contains(Q.target)&&_e({machine:"scrollContainerTouch",type:"TOUCH_START"})},[_e]),Ja=w.useCallback(Q=>{kt.current.contains(Q.target)&&_e({machine:"scrollContainerTouch",type:"TOUCH_END"})},[_e]);Ne("immediate",je,{state:"staging:none",callback:ir,params:{newState:"none"}}),at(je,{state:"staging:none",transition:"OPEN",callback:w.useCallback(()=>be?.sendToOpennessMachine({machine:"staging",type:"GO_DOWN",skipOpening:ji?.skip}),[be,ji?.skip])}),at(je,{state:"staging:none",transition:"OPEN_PREPARED",callback:w.useCallback(Q=>be?.sendToOpennessMachine({machine:"staging",type:"GO_DOWN",skipOpening:Q.skipOpening}),[be])}),at(je,{state:"staging:none",transition:"GO_DOWN",callback:w.useCallback(Q=>be?.sendToOpennessMachine({machine:"staging",type:"GO_DOWN",skipOpening:Q.skipOpening}),[be])}),at(je,{state:"staging:none",transition:"ACTUALLY_CLOSE",callback:w.useCallback(()=>be?.sendToOpennessMachine({machine:"staging",type:"GO_UP"}),[be])}),at(je,{state:"staging:none",transition:"GO_UP",callback:w.useCallback(Q=>be?.sendToOpennessMachine({machine:"staging",type:"GO_UP",skipClosing:Q.skipClosing}),[be])}),Ne("immediate",je,{state:"staging:open",callback:ir,params:{newState:"open"}}),Ne("immediate",je,{state:"staging:open",callback:w.useCallback(()=>{_e({machine:"longRunning",type:"TO_TRUE"})},[_e])}),Ne("immediate",je,{state:"staging:open",callback:w.useCallback(()=>{he||ve==null||ve(!0)},[he,ve])}),Ne("after-paint",je,{state:"staging:open",callback:w.useCallback(()=>{requestAnimationFrame(()=>{_e({machine:"openness",type:"READY_TO_OPEN",skipOpening:!0}),_e({machine:"staging",type:"NEXT"})})},[_e])}),at(je,{state:"staging:open",transition:"NEXT",callback:Ms}),Ne("immediate",je,{state:"staging:opening",callback:ir,params:{newState:"opening"}}),Ne("immediate",je,{state:"staging:opening",callback:w.useCallback(()=>{_e({machine:"longRunning",type:"TO_TRUE"})},[_e])}),Ne("immediate",je,{state:"staging:opening",callback:w.useCallback(()=>{he||ve==null||ve(!0)},[he,ve])}),Ne("before-paint",je,{state:"staging:opening",callback:w.useCallback(()=>{A?.(),Ar(0,{start:0,end:0})},[Ar,A])}),Ne("after-paint",je,{state:"staging:opening",callback:w.useCallback(()=>{requestAnimationFrame(()=>{_e({machine:"openness",type:"READY_TO_OPEN",skipOpening:!1})})},[_e])}),xs("after-paint",je,{state:"staging:opening",callback:w.useCallback(()=>(VD(pe),()=>qD(pe)),[pe])}),at(je,{state:"staging:opening",transition:"NEXT",callback:Ms}),Ne("immediate",je,{state:"staging:stepping",callback:ir,params:{newState:"stepping"}}),Ne("after-paint",je,{state:"staging:stepping",callback:w.useCallback(({detent:Q,behavior:ce})=>{v?.("stepping"),sa(Q,ce)},[v,sa])}),Ba("immediate",je,{state:"staging:stepping",callback:w.useCallback(()=>{v?.("idleInside")},[v])}),Ne("immediate",je,{state:"staging:closing",callback:ir,params:{newState:"closing"}}),Ne("immediate",je,{state:"staging:closing",callback:w.useCallback(()=>{he&&ve?.(!1)},[he,ve])}),Ne("after-paint",je,{state:"staging:closing",callback:w.useCallback(()=>{_e({machine:"openness",type:"READY_TO_CLOSE"})},[_e])}),at(je,{state:"staging:closing",transition:"NEXT",callback:Ms}),Ne("immediate",je,{state:"staging:go-down",callback:ir,params:{newState:"go-down"}}),at(je,{state:"staging:go-down",transition:"NEXT",callback:Ms}),Ne("immediate",je,{state:"staging:going-down",callback:ir,params:{newState:"going-down"}}),at(je,{state:"staging:going-down",transition:"NEXT",callback:Ms}),Ne("immediate",je,{state:"staging:going-up",callback:ir,params:{newState:"going-up"}}),at(je,{state:"staging:going-up",transition:"NEXT",callback:Ms});let Ai=zr(Ce,"longRunning");Ne("immediate",Ai,{state:"longRunning:true",callback:w.useCallback(()=>{ye.current===null&&(ye.current=document.activeElement)},[ye])}),Ne("immediate",Ai,{state:"longRunning:true",callback:w.useCallback(()=>{De(!0),ss?.(Q=>Q+1)},[De,ss])}),xs("before-paint",Ai,{state:"longRunning:true",callback:Zo}),Ne("before-paint",Ai,{state:"longRunning:true",guard:!ji.skip,callback:w.useCallback(()=>{Ti({trackToTravelOn:Zs,runTravelCallbacksAndAnimations:!1,destinationDetent:0})},[Ti,Zs])}),xs("after-paint",Ai,{state:"longRunning:true",guard:F,callback:w.useCallback(()=>lO(cn,U),[U])}),xs("after-paint",Ai,{state:"longRunning:true",callback:yf}),Ne("immediate",Ai,{state:"longRunning:false",callback:w.useCallback(()=>{De(!1),ss?.(Q=>Q-1)},[De,ss])}),Ne("immediate",Ai,{state:"longRunning:false",callback:w.useCallback(()=>{ye.current=null},[ye])}),Ne("before-paint",Ai,{state:"longRunning:false",callback:w.useCallback(()=>{qe.removeAllOutletPersistedStylesFromSheet(pe)},[pe])}),Ne("after-paint",Ai,{state:"longRunning:false",callback:rc}),xs("before-paint",ia,{state:"active:true",callback:ta});let St=zr(Ce,"openness"),Ds=zr(Ce,"openness:closed.status");Ne("immediate",St,{state:"openness:closed",callback:fn,params:{newState:"idleOutside"}}),Ne("immediate",St,{state:"openness:closed",callback:w.useCallback(()=>{_e({machine:"longRunning",type:"TO_FALSE"})},[_e])}),Ne("immediate",St,{state:"openness:closed",callback:w.useCallback(()=>{he&&ve?.(!1)},[he,ve])}),Ne("immediate",St,{state:"openness:closed",callback:w.useCallback(()=>{Be({machine:"active",type:"TO_FALSE"})},[Be])}),Ne("after-paint",St,{state:"openness:closed",callback:w.useCallback(()=>{clearTimeout(mn.current),Vt.current=null,sr([0,0]),Qn.current=!1,xt(-1),ea.current=!1},[xt,sr])}),at(St,{state:"openness:closed",transition:"READY_TO_OPEN",callback:w.useCallback(Q=>{Be({machine:"position",type:"READY_TO_GO_FRONT",skipOpening:Q.skipOpening})},[Be])}),aO(_e,Ds,"openness:closed.status:pending",{delay:3e3}),Ba("immediate",Ds,{state:"openness:closed.status:pending",callback:w.useCallback(()=>{_e("SWIPE_RESET")},[_e])}),Ne("before-paint",Ds,{state:"openness:closed.status:flushing-to-preparing-opening",callback:w.useCallback(()=>{_e({machine:"openness:closed.status",type:""})},[_e])}),Ne("before-paint",Ds,{state:"openness:closed.status:flushing-to-preparing-open",callback:w.useCallback(()=>{_e({machine:"openness:closed.status",type:""})},[_e])}),Ne("after-paint",Ds,{state:"openness:closed.status:preparing-opening",callback:w.useCallback(()=>{_e({machine:"staging",type:"OPEN_PREPARED",skipOpening:!1})},[_e])}),Ne("after-paint",Ds,{state:"openness:closed.status:preparing-open",callback:w.useCallback(()=>{_e({machine:"staging",type:"OPEN_PREPARED",skipOpening:!0})},[_e])}),Ne("immediate",Ds,{state:"openness:closed.status:safe-to-unmount",callback:w.useCallback(()=>{Ae?.(!0)},[Ae])}),Ba("immediate",Ds,{state:"openness:closed.status:safe-to-unmount",callback:w.useCallback(()=>{Ae?.(!1)},[Ae])}),Ne("immediate",St,{state:"openness:opening",callback:fn,params:{newState:"entering"}}),Ne("before-paint",St,{state:"openness:opening",callback:w.useCallback(()=>{jt.current=Ut,ze?.(Ut),Ti({trackToTravelOn:Zs,destinationDetent:Ut,behavior:"smooth",animationConfig:ji,travelEndCallback:()=>_e("NEXT"),runOnTravelStart:!1})},[Zs,ze,Ti,Ut,ji,_e])}),at(St,{state:"openness:opening",transition:"NEXT",callback:w.useCallback(()=>{Be("NEXT"),_e({machine:"staging",type:"NEXT"})},[Be,_e])}),Ne("immediate",St,{state:"openness:open",callback:fn,params:{newState:"idleInside"}}),Ne("immediate",St,{state:"openness:open",callback:w.useCallback(()=>{Be({machine:"active",type:"TO_TRUE"})},[Be])}),Ne("before-paint",St,{state:"openness:open",guard:ji.skip,callback:w.useCallback(()=>{jt.current=Ut,ze?.(Ut),Ti({trackToTravelOn:Zs,destinationDetent:Ut})},[Ut,ze,Ti,Zs])}),xs("before-paint",St,{state:"openness:open",callback:w.useCallback(()=>{if(Wa()&&Ke){var Q;(Q=kt.current)===null||Q===void 0||Q.style.setProperty("will-change","transform"),requestAnimationFrame(()=>{var ce;return(ce=kt.current)===null||ce===void 0?void 0:ce.style.removeProperty("will-change","transform")})}},[Ke]),params:{unusedDep:ic}}),xs("before-paint",St,{state:"openness:open",guard:!Ee,callback:$u}),Ne("after-paint",je,{state:"staging:open",guard:Fe===!0&&x==="auto",callback:w.useCallback(()=>{Ut===Qi.length?_e({machine:"frontStuck",type:"STUCK_START"}):Ke&&Ut===1&&_e({machine:"backStuck",type:"STUCK_START"})},[_e,Ut,Qi,Ke])}),xs("after-paint",St,{state:"openness:open",guard:!Ee&&!Bt&&!Ie,callback:Qa,params:{send:_e}}),xs("after-paint",St,{state:"openness:open",callback:lc}),at(St,{state:"openness:open",transition:"READY_TO_CLOSE",callback:w.useCallback(()=>Be("READY_TO_GO_OUT"),[Be])}),at(St,{state:"openness:open",transition:"ACTUALLY_CLOSE",callback:w.useCallback(()=>{jt.current=null,ze?.(0),A?.(),Be("GO_OUT")},[ze,A,Be])}),at(St,{state:"openness:open",transition:"SWIPED_OUT",callback:w.useCallback(()=>{var Q;(Q=kt.current)===null||Q===void 0||Q.style.setProperty("scroll-snap-type","none","important"),jt.current=null,ze?.(0),Be("GO_OUT")},[ze,Be])}),Ba("immediate",St,{state:"openness:open",callback:w.useCallback(()=>{_e("SWIPE_END")},[_e])});let uc=zr(Ce,"backStuck"),Qo=w.useRef(!1);at(uc,{state:"backStuck:false",transition:"STUCK_START",callback:w.useCallback(()=>Qo.current=!0,[])}),at(uc,{state:"backStuck:true",transition:"STUCK_END",callback:w.useCallback(()=>Qo.current=!1,[])}),at(uc,{state:"backStuck:false",transition:"STUCK_START",guard:Fe===!0&&x==="auto",callback:w.useCallback(()=>{Ce.silent.matches("scrollContainerTouch:ended")&&Ls("back")},[Ce.silent,Ls])});let eo=zr(Ce,"frontStuck"),to=w.useRef(!1);at(eo,{state:"frontStuck:false",transition:"STUCK_START",callback:w.useCallback(()=>to.current=!0,[])}),at(eo,{state:"frontStuck:true",transition:"STUCK_END",callback:w.useCallback(()=>to.current=!1,[])}),at(eo,{state:"frontStuck:false",transition:"STUCK_START",guard:Fe===!0&&x==="auto",callback:w.useCallback(()=>{Ce.silent.matches("openness:open")&&Ce.silent.matches("scrollContainerTouch:ended")&&Ls("front")},[Ce.silent,Ls])}),Ne("immediate",Ce,{state:"scrollContainerTouch:ended",guard:Fe===!0&&x==="auto",callback:w.useCallback(()=>{ea.current&&setTimeout(()=>{requestAnimationFrame(()=>{Ce.silent.matches("openness:open")&&(Ce.silent.matches("backStuck:true")?Ls("back"):Ce.silent.matches("frontStuck:true")&&Ls("front"))})},80)},[Ce.silent,Ls])});let ra=zr(Ce,"openness:open.scroll"),hc=w.useRef(!1);Ne("immediate",ra,{state:"openness:open.scroll:ongoing",callback:w.useCallback(()=>hc.current=!0,[])}),Ba("immediate",ra,{state:"openness:open.scroll:ongoing",callback:w.useCallback(()=>hc.current=!1,[])}),Ne("immediate",ra,{state:"openness:open.scroll:ongoing",callback:w.useCallback(()=>{ea.current=!0},[])}),xs({start:"immediate",update:"before-paint"},ra,{state:"openness:open.scroll:ongoing",callback:_n});let dc=w.useRef(()=>{});Ne("after-paint",ra,{state:"openness:open.scroll:ended",callback:w.useCallback(()=>{_e({machine:"openness:open.scroll:ended.afterPaintEffectsRun",type:"OCCURRED"}),dc.current(),dc.current=()=>{}},[_e])}),Ba("immediate",ra,{state:"openness:open.scroll:ended",callback:w.useCallback(()=>{_e({machine:"openness:open.scroll:ended.afterPaintEffectsRun",type:"RESET"})},[_e])});let fc=w.useRef(!1);Ne("immediate",Ce,{state:"openness:open.move:ongoing",callback:w.useCallback(()=>{fc.current=!0,Yo.current=qo},[qo])}),Ba("immediate",Ce,{state:"openness:open.move:ongoing",callback:w.useCallback(()=>{fc.current=!1,Yo.current=()=>{}},[])});let Jo=w.useRef(!1);Ne("immediate",Ce,{state:"openness:open.swipe:ongoing",callback:w.useCallback(()=>Jo.current=!0,[])}),Ba("immediate",Ce,{state:"openness:open.swipe:ongoing",callback:w.useCallback(()=>Jo.current=!1,[])}),Ne("immediate",Ce,{state:"openness:open.swipe:ongoing",callback:w.useCallback(()=>A?.(),[A])}),Ne("immediate",Ce,{state:"openness:open.swipe:ongoing",callback:fn,params:{newState:"stepping"}}),Ne("immediate",Ce,{state:"openness:open.swipe:ended",callback:w.useCallback(()=>er(),[er])}),Ne("immediate",Ce,{state:"openness:open.swipe:ended",guard:typeof v=="function",callback:w.useCallback(()=>{Ce.silent.matches("openness:open")&&v("idleInside")},[Ce.silent,v])});let Wu=w.useCallback(()=>{!Wr.matches("position:front")||mt.current[0]===0&&mt.current[1]===0||Ke&&mt.current[0]!==mt.current[1]?he===!1&&ve?.(!0):_e("ACTUALLY_CLOSE")},[Wr,_e,he,ve,Ke]);at(Ce,{state:"openness:open.evaluateCloseMessage:true",transition:"CLOSE",callback:Wu}),at(Ce,{state:"openness:open.evaluateCloseMessage:false",transition:"CLOSE",callback:Wu}),at(Ce,{state:"openness:open.evaluateStepMessage:true",transition:"STEP",callback:Ko}),at(Ce,{state:"openness:open.evaluateStepMessage:false",transition:"STEP",callback:Ko}),Ne("immediate",St,{state:"openness:closing",callback:fn,params:{newState:"exiting"}}),Ne("before-paint",St,{state:"openness:closing",callback:w.useCallback(()=>{jt.current=0,ze?.(0),Ti({trackToTravelOn:Se.track,destinationDetent:0,behavior:"smooth",animationConfig:Se,travelEndCallback:()=>_e("NEXT")})},[ze,Ti,Se,_e])}),at(St,{state:"openness:closing",transition:"NEXT",callback:w.useCallback(()=>{Be("NEXT"),_e({machine:"staging",type:"NEXT"})},[Be,_e])});let Cf=w.useCallback(()=>_e({machine:"skipOpening",type:ji.skip?"TO_TRUE":"TO_FALSE"}),[_e,ji.skip]);xs("after-paint",Ce,{state:"",callback:Cf});let xf=w.useCallback(()=>_e({machine:"skipClosing",type:Se.skip?"TO_TRUE":"TO_FALSE"}),[_e,Se.skip]);xs("after-paint",Ce,{state:"",callback:xf}),w.useEffect(()=>{he!==void 0&&_e(he?"OPEN":"CLOSE")},[he,_e]);let kf=fu(()=>{rc(),Xn?.(pe),qe.removeAllOutletPersistedStylesFromSheet(pe)}),el=w.useRef(!0),Ef=fu(()=>{he&&ve?.(!1)});w.useEffect(()=>()=>{!el.current&&(Ef(),ir(null,{newState:"none"}),kf(),De(!1),Ai.silent.matches("longRunning:true")&&ss?.(Q=>Q-1))},[]),w.useEffect(()=>()=>el.current=!1),w.useEffect(()=>{xe!==void 0&&mt.current[0]!==xe&&mt.current[1]!==xe&&jt.current!==xe&&_e({type:"STEP",activeDetent:xe})},[xe,_e]),w.useEffect(()=>{let Q=()=>{var ce;return(ce=kt.current)===null||ce===void 0?void 0:ce.scrollTo(0,0)};return window.addEventListener("unload",Q),()=>window.removeEventListener("unload",Q)},[]);let ju=fu((Q,ce)=>{Ei.current&&!St.matches("openness:closed")&&Ar(Q,ce)}),Vu=fu(Fu);w.useEffect(()=>()=>{ju(0,{start:0,end:0}),Ei.current&&Vu(),Sx(null)},[Ai.silent,ss,ju,Vu]);let io=Ui("Sheet",{staging:je.getValues()[0],openness:St.getValues()[0],opennessClosedStatus:Ds.getValues()[0],position:Wr.getValues()[0],positionCoveredStatus:rs.getValues()[0],placement:Lt,track:Pe,swipeDisabled:Ee,swipeOutDisabledWithDetent:Ie,swipeOvershootDisabled:Fe,swipeTrap:$r,scrollContainerShouldBePassThrough:fs}),tl=w.useMemo(()=>!Ds.matches(["openness:closed.status:flushing-to-preparing-open","openness:closed.status:flushing-to-preparing-opening","openness:closed.status:safe-to-unmount"]),[Ds]),Tf=w.useMemo(()=>St.matches("openness:closed")&&tl,[tl,St]),qu=w.useMemo(()=>je.matches(["staging:opening","staging:open"]),[je]),Rf=w.useMemo(()=>tl||qu,[tl,qu]),Af=w.useMemo(()=>$&&(Wr.matches(["position:front","position:covered"])||dt!=="none"),[$,Wr,dt]);return j.jsx(Hu,{genericContext:Ga,customContext:de,value:G,children:j.jsx(Ur.Provider,{value:{sheetContext:D,titleId:_t,descriptionId:yt,styleAttributes:io,backdropRef:Ks,scrollContainerRef:kt,frontSpacerRef:kr,contentWrapperRef:Wi,contentRef:Rs,backSpacerRef:Er,detentMarkersRefs:Zn,leftEdgeRef:cn,setBackdropSwipeable:As,setBleedingBackgroundPresent:ci,detents:Qi,longRunningState:Ai,staging:dt,layerCovered:Qe,placement:Lt,track:Pe,travelAxis:Js,nativeEdgeSwipePrevention:F,bleedingBackgroundPresent:Rr,setBackdropTravelHandler:Iu,ancestorPrimarySwipeTrapActiveOnYAxis:$r==="vertical"||$r==="both",scrollContainerTouchStartHandler:cc,scrollContainerTouchEndHandler:Ja,getContentCoordinatesWhenRestingOnLastDetent:sc,getOffsetFromCurrentToNextDetent:wf},children:Rf&&j.jsxs("div",{id:pe,...io("view",["track","staging","openness","opennessClosedStatus","scrollContainerShouldBePassThrough"],{className:u,dataSilk:[h,"0ab",ee&&"0ah",Qs&&"0aj",Tf&&"0ak","0al"]}),ref:Gs,"aria-labelledby":_t,"aria-describedby":yt,...X,role:ue,tabIndex:-1,children:[j.jsx(Vn.Root,{...io("primaryScrollTrapRoot",["track","scrollContainerShouldBePassThrough"]),active:$r!=="none",axis:$r,children:j.jsx(Vn.Stabiliser,{children:l})}),j.jsx(Vn.Root,{...io("secondaryScrollTrapRoot",["scrollContainerShouldBePassThrough"]),automaticallyDisabledForOptimisation:!1,preventBodyScroll:Af})]})})})});Ex.displayName="Sheet.Anonymous";class ec extends We.Component{static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e){console.error(e)}render(){return this.state.hasError?j.jsx("h1",{children:"Something went wrong."}):this.props.children}constructor(e){super(e),this.state={hasError:!1}}}let Tx=We.forwardRef((t,e)=>{let{asChild:i,children:n,className:a,"data-silk":l,...u}=t,h=i?Fi:"span",f=Ui("VisuallyHidden",{});return j.jsx(h,{...f("root",[],{className:a,dataSilk:[l]}),...u,ref:e,children:n})});Tx.displayName="VisuallyHidden.Root";let EO={Root:Tx},pf=We.createContext(null);pf.displayName="SheetStack.GenericContext";let Eu=[],TO=(t,e)=>{let i=()=>{let[n,a]=(function(h){let f=0,d=0;for(;h;)f+=h.offsetLeft,d+=h.offsetTop,h=h.offsetParent;return[f,d]})(t),l={top:a+scrollY,bottom:Math.max(t.offsetHeight-(a+scrollY+innerHeight),0),left:n+scrollX,right:Math.max(t.offsetWidth-(n+scrollX+innerWidth),0),height:innerHeight,width:innerWidth},u=l.top<=0&&l.bottom<=0&&l.left<=0&&l.right<=0?null:l;e(u)};Eu.push({element:t,callback:i}),i(),Eu.length===1&&(ku=(function(n,a){let l;return function(){clearTimeout(l),l=window.setTimeout(()=>{clearTimeout(l),n()},100)}})(()=>{Eu.forEach(n=>n.callback())}),window.addEventListener("scroll",ku),window.addEventListener("resize",ku))},RO=t=>{(Eu=Eu.filter(e=>e.element!==t)).length||(window.removeEventListener("scroll",ku),window.removeEventListener("resize",ku))},tv=(t,e)=>{let i=w.useId(),n=w.useRef(null),a=Es(n,e),{sheetId:l,stackId:u,sheetsCount:h,travelAnimation:f,stackingAnimation:d,style:p}=t,{sheetId:v,longRunning:g}=gf(l),[S,b]=w.useState(null),{willChangesValuesString:C,outletTransformedOnAnimation:x,nonAnimatedTravelStyles:E,nonAnimatedStackingStyles:A,clippedToViewport:B}=w.useMemo(()=>{let V=[],se={},ee={},M=!1,O=!1;return[f,d].forEach((N,P)=>{if(N){let T=N.hasOwnProperty("properties")?N.properties:N;Object.entries(T).forEach(([L,H])=>{!H||(L==="clipBoundary"&&(O=!0),typeof H=="string"&&(P===0?se[L]=H:ee[L]=H),gx.includes(L)||L==="transform"?V.includes("transform")||(V.push("transform"),M=!0):L!=="opacity"||V.includes("opacity")||V.push("opacity"))})}}),{willChangesValuesString:V.join(", "),outletTransformedOnAnimation:M,nonAnimatedTravelStyles:se,nonAnimatedStackingStyles:ee,clippedToViewport:O}},[d,f]),{modifiedTravelAnimation:R,modifiedNonAnimatedTravelStyles:$,modifiedStackingAnimation:F,modifiedNonAnimatedStackingStyles:U}=w.useMemo(()=>{let V;if(S){let{top:P,bottom:T,left:L,right:H}=S;V=`${P-.1}px ${H}px ${T}px ${L}px`}let se=(P,T)=>{let L,H,Y;if(!P)return[];let{top:X,left:D,height:G,width:ie}=S||{},ae=P.hasOwnProperty("properties")?P.properties:P,de=ae.clipBoundary,ue=ae.clipBorderRadius,he=ae.clipTransformOrigin;if(de&&(he||(he="50% 50% 0"),Y=he.split(" ").map(Ze=>Ze==="top"||Ze==="left"?"0%":Ze==="bottom"||Ze==="right"?"100%":Ze).map((Ze,xe)=>{if(xe===0){let ze=Ze;return Ze.includes("%")?ze=Ze.replace(/\b\d+%/,pe=>parseFloat(pe)/100*ie+"px"):Ze==="0"&&(ze="0px"),"calc("+D+"px + "+ze+")"}if(xe===1){let ze=Ze;return Ze.includes("%")?ze=Ze.replace(/\b\d+%/,pe=>parseFloat(pe)/100*G+"px"):Ze==="0"&&(ze="0px"),"calc("+X+"px + "+ze+")"}}).join(" ")),de)if(de==="layout-viewport")if(V){if(typeof ue=="string")L=`inset(${V} round ${ue})`;else if(Array.isArray(ue)){let Ae=`inset(${V} round `;L=({tween:De})=>Ae+De(...ue)+")"}else if(typeof ue=="function"){let Ae=`inset(${V} round `;L=De=>Ae+ue(De)+")"}else L=`inset(${V})`;H="0.001px"}else H=ue??null;else if(typeof de=="function")if(V){if(typeof ue=="string")L=Ae=>de(Ae)!=="none"?`inset(${V} round ${ue})`:"none";else if(Array.isArray(ue)){let Ae=`inset(${V} round `;L=De=>de(De)!=="none"?Ae+De.tween(...ue)+")":"none"}else if(typeof ue=="function"){let Ae=`inset(${V} round `;L=De=>de(De)!=="none"?Ae+ue(De)+")":"none"}else L=Ae=>de(Ae)!=="none"?`inset(${V})`:"none";H="0.001px"}else ue&&(H=Ae=>{if(de(Ae)==="layout-viewport")return ue});else de==="none"&&(L="none",H=ue??null);else{let Ae={...ae},De={...T};return delete Ae.clipBoundary,delete Ae.clipBorderRadius,delete Ae.clipTransformOrigin,delete De.clipBoundary,delete De.clipBorderRadius,delete De.clipTransformOrigin,[Ae,De]}let ve={...ae},ye={...T};return delete ve.clipBoundary,delete ve.clipBorderRadius,delete ve.clipTransformOrigin,delete ye.clipBoundary,delete ye.clipBorderRadius,delete ye.clipTransformOrigin,typeof L=="string"?ye.clipPath=L:ve.clipPath=L,typeof H=="string"?ye.borderRadius=H:ve.borderRadius=H,typeof Y=="string"&&(ye.transformOrigin=Y),[ve,ye]},[ee,M]=se(f,E),[O,N]=se(d,A);return{modifiedTravelAnimation:ee,modifiedNonAnimatedTravelStyles:M,modifiedStackingAnimation:O,modifiedNonAnimatedStackingStyles:N}},[S,A,E,d,f]);vi(()=>{let V=n.current,se=i&&B&&(!u&&g||u&&h>=1);if(se)return TO(V,b),()=>{se&&RO(V)}},[i,B,g,u,h]);let z=w.useMemo(()=>u?{...p,...h>=1?U:{},willChange:h>=1?C+(p?.willChange?", "+p?.willChange:""):p?.willChange}:{...p,...g?$:{},...h>=1?U:{},willChange:g?C+(p?.willChange?", "+p?.willChange:""):p?.willChange},[u,p,$,U,g,h,C]);return vi(()=>{let V,se=qe.findActualFixedComponentsInsideOutlet(n.current);if(se.length)return x&&(V=(ee=>{let M=()=>{se.forEach(N=>{if(!N.element||N.compensated)return;let P=0,T=0,L=N.element.style.transform,H=window.getComputedStyle(N.element),Y=H.getPropertyValue("--silk-fixed-side"),X=H.getPropertyValue("transform");qe.updateFixedComponent({id:N.id,initialInlineCSSTransform:L,compensated:!0}),P=Y.includes("bottom")?-1*(n.current.offsetHeight-(scrollY+window.innerHeight)):scrollY,T=Y.includes("right")?-1*(n.current.offsetWidth-(scrollX+window.innerWidth)):scrollX,(Math.abs(P)!==0||Math.abs(T)!==0)&&N.element.style.setProperty("transform",(X!=="none"?X+" ":"")+"translateX("+T+"px) translateY("+P+"px)")})},O=()=>{window.removeEventListener("resize",M),window.removeEventListener("scroll",M),se.forEach(N=>{N.element&&N.compensated&&(N.initialInlineCSSTransform?(N.element.style.setProperty("transform",N.initialInlineCSSTransform),qe.updateFixedComponent({id:N.id,initialInlineCSSTransform:void 0,compensated:!1})):(N.element.style.removeProperty("transform"),qe.updateFixedComponent({id:N.id,compensated:!1})))})};return ee?(M(),window.addEventListener("resize",M),window.addEventListener("scroll",M)):O(),O})(u?h>0:g)),V},[g,i,x,h,u]),vi(()=>(qe.addOutletToSheet(v,i),()=>qe.removeOutletFromSheet(v,i)),[i,v]),vi(()=>{let V=n.current;return R&&qe.addAnimationToSheetOrStack({sheetId:v,type:"travel",element:V,config:R}),F&&qe.addAnimationToSheetOrStack({sheetId:u?null:v,stackId:u,type:"stacking",element:V,config:F}),()=>{R&&qe.removeAnimationFromSheetOrStack({sheetId:v,type:"travel",element:V}),F&&qe.removeAnimationFromSheetOrStack({sheetId:u?null:v,stackId:u,type:"stacking",element:V})}},[v,u,R,F]),{ref:n,outletId:i,styleValue:z,composedRef:a}},gf=t=>w.useContext(t??Ga)||{};ec.displayName="Sheet.ErrorBoundary",Fi.displayName="Sheet.Slot.Root";let jo=We.forwardRef((t,e)=>{let{asChild:i,forComponent:n,travelAnimation:a,stackingAnimation:l,style:u,className:h,...f}=t,{staging:d,StackContext:p}=gf(n),v=p??We.createContext(null),{sheetsCount:g}=w.useContext(v)||{},{styleValue:S,composedRef:b}=tv({sheetId:n,sheetsCount:g,travelAnimation:a,stackingAnimation:l,style:u},e),C=w.useMemo(()=>d!=="none",[d]),x=i?Fi:"div",E=Ui("Sheet",{});return j.jsx(x,{style:S,...E("outlet",[],{className:h,dataSilk:[C&&"0aj"]}),...f,ref:b})});jo.displayName="Sheet.Outlet";let iv=We.forwardRef(({asChild:t,...e},i)=>{let n=t?Fi:"button",{forComponent:a,className:l,"data-silk":u,onPress:h,onClick:f,children:d,action:p="present",travelAnimation:v,stackingAnimation:g,...S}=e,{sheetRole:b,sheetId:C,open:x,onOpenChange:E,elementFocusedLastBeforeShowing:A}=gf(a),B=qe.findSheet(C),R=w.useRef(null),$=Es(R,i),F=w.useMemo(()=>(b==="dialog"||b==="alertdialog")&&p==="present"?"dialog":void 0,[p,b]),U=w.useMemo(()=>p==="present"||p==="dismiss"?x:void 0,[p,x]),z=Ui("Sheet",{});return j.jsx(jo,{forComponent:a,asChild:!0,travelAnimation:v,stackingAnimation:g,children:j.jsx(n,{...z("trigger",[],{className:l,dataSilk:[u]}),onClick:V=>{var se,ee;let{forceFocus:M,runAction:O}=rn({nativeEvent:V,defaultBehavior:{forceFocus:!0,runAction:!0},handler:h});M&&((se=R.current)===null||se===void 0||se.focus({preventScroll:!0})),O&&(p==="present"?(A.current=R.current,E(!0)):p==="dismiss"?E(!1):(p==="step"||p.type==="step")&&(B==null||(ee=B.sendToOpennessMachine)===null||ee===void 0||ee.call(B,{type:"STEP",direction:p==="step"?"up":p.direction,detent:p==="step"?null:p.detent}))),f?.(V)},"aria-haspopup":F,"aria-controls":C,"aria-expanded":U,ref:$,...S,children:d})})});iv.displayName="Sheet.Trigger";let Rx=We.forwardRef((t,e)=>{let{children:i,className:n,action:a="step",...l}=t,{detents:u}=w.useContext(Ur)||{},h=u.length===1&&a!=="dismiss",f=Ui("Sheet",{});return j.jsx(iv,{...f("handle",[],{className:n}),action:a,disabled:h,...l,ref:e,children:j.jsx(EO.Root,{children:i??(a==="dismiss"?"Dismiss":"Cycle")})})});Rx.displayName="Sheet.Handle";let Ax=t=>{var e;let[i,n]=w.useState(!1);return w.useEffect(()=>(n(!0),()=>n(!1)),[]),i?_w.createPortal(t.children,(e=t.container)!==null&&e!==void 0?e:document.body):null};Ax.displayName="Sheet.Portal";let AO=({rootRef:t})=>(w.useEffect(()=>{let e=t.current;if(!e)return;getComputedStyle(e).getPropertyValue("--silk-aY").trim()!=="1"&&console.warn("The CSS styles for Silk are not found. Please refer to the documentation on how to import them.")},[t]),null),Mx=We.forwardRef((t,e)=>{let{className:i,"data-silk":n,license:a,sheetRole:l,componentId:u,forComponent:h,defaultPresented:f,presented:d,onPresentedChange:p,defaultActiveDetent:v,activeDetent:g,onActiveDetentChange:S,onSafeToUnmountChange:b,...C}=t,x=w.useRef(null),E=Es(x,e),A=f!=null&&f,[B,R]=w.useState(A),$=d!==void 0&&p!==void 0,F=w.useMemo(()=>$?d:B,[$,d,B]),U=w.useMemo(()=>$?p:R,[$,p,R]),z=w.useRef(null),[V,se]=w.useState(!A),ee=w.useCallback(X=>{b?.(X),se(X)},[b]),[M,O]=w.useState(F),[N,P]=w.useState("none"),T=h==="closest"?pf:h,L=$o(),H={license:a,StackContext:T,CustomSheetContext:u,sheetId:L,sheetRole:l,open:F,onOpenChange:U,onSafeToUnmountChange:ee,defaultActiveDetent:v,activeDetent:g,onActiveDetentChange:S,safeToUnmount:V,longRunning:M,setLongRunning:O,staging:N,setStaging:P,elementFocusedLastBeforeShowing:z,...C},Y=Ui("Sheet");return j.jsxs(ec,{children:[j.jsx(AO,{rootRef:x}),j.jsx(Hu,{genericContext:Ga,customContext:u,value:H,children:j.jsx(jo,{...Y("root",[],{className:i,dataSilk:[n]}),ref:E,...C})})]})});Mx.displayName="Sheet.Root";let Lx=We.forwardRef((t,e)=>{let{forComponent:i}=t,{open:n,safeToUnmount:a}=gf(i);return(n||!a)&&j.jsx(Ex,{...t,ref:e})});Lx.displayName="Sheet.View";let Dx=We.forwardRef(({asChild:t,swipeable:e=!0,...i},n)=>{let{longRunningState:a,backdropRef:l,styleAttributes:u,setBackdropSwipeable:h,setBackdropTravelHandler:f}=w.useContext(Ur)||{},{className:d,"data-silk":p,children:v,travelAnimation:g,stackingAnimation:S,themeColorDimming:b=!1,...C}=i,x=Es(l,n);w.useEffect(()=>(h(e),()=>{h(!1)}),[h,e]);let E=w.useMemo(()=>({opacity:({progress:F})=>Math.min(.33*F,.33),...g}),[g]),[A,B]=w.useState(E),R=$o(),$=w.useRef(0);return vi(()=>{let F=!1,U=()=>{F&&qe.removeThemeColorDimmingOverlay(R)};if(a.matches("longRunning:true")){let z;if(!(F=!!(Wa()&&!ND()&&b==="auto"&&E.opacity&&qe.getAndStoreUnderlyingThemeColorAsRGBArray())))return;let{opacity:V,...se}=E;if(B({opacity:"ignore",...se}),Array.isArray(V)){let[ee,M]=V;z=({progress:O})=>ee+(M-ee)*O}else typeof V=="function"&&(z=V,B({opacity:"ignore",...se}));if(z&&l&&f){let ee=window.getComputedStyle(l.current).backgroundColor,M=qe.updateThemeColorDimmingOverlay({abortRemoval:!0,dimmingOverlayId:R,color:ee,alpha:$.current}),O=N=>{var P;let T=z(N);qe.updateThemeColorDimmingOverlayAlphaValue(M,T),(P=l.current)===null||P===void 0||P.style.setProperty("opacity",T),$.current=T};f(()=>O)}}return a.matches("longRunning:false")&&U(),()=>{U()}},[a,R,l,f,b,g,E]),j.jsx(jo,{...u("backdrop",["scrollContainerShouldBePassThrough"],{className:d,dataSilk:[p]}),travelAnimation:A,stackingAnimation:S,...C,ref:x,asChild:t,children:v})});Dx.displayName="Sheet.Backdrop";let Ox=We.forwardRef((t,e)=>{var i;let{asChild:n,children:a,className:l,"data-silk":u,travelAnimation:h,stackingAnimation:f,style:d,...p}=t,v=n?Fi:"div",{StackContext:g}=w.useContext(Ga)||{},S=g??We.createContext(null),{sheetsCount:b}=w.useContext(S)||{},{styleValue:C,composedRef:x}=tv({sheetId:Ga,sheetsCount:b,travelAnimation:h,stackingAnimation:f,style:d},e),{scrollContainerRef:E,frontSpacerRef:A,contentWrapperRef:B,contentRef:R,backSpacerRef:$,detentMarkersRefs:F,leftEdgeRef:U,nativeEdgeSwipePrevention:z,scrollContainerTouchStartHandler:V,scrollContainerTouchEndHandler:se,styleAttributes:ee,detents:M,bleedingBackgroundPresent:O}=w.useContext(Ur)||{},N=Es(R,x);return j.jsxs("div",{...ee("scrollContainer",["track","swipeDisabled","swipeOvershootDisabled","staging","positionCoveredStatus","scrollContainerShouldBePassThrough","swipeTrap"],{dataSilk:["0ac"]}),ref:E,onTouchStart:V,onTouchEnd:se,children:[j.jsx("div",{...ee("frontSpacer",["track"]),ref:A}),j.jsxs("div",{...ee("contentWrapper",["placement","track","swipeOvershootDisabled","swipeOutDisabledWithDetent","staging","position"]),ref:B,children:[j.jsx(v,{...ee("content",["track","placement","scrollContainerShouldBePassThrough"],{className:l,dataSilk:[u,O&&"0af"]}),style:C,...p,ref:N,children:a}),z&&j.jsx("div",{...ee("leftEdge",["track"]),ref:U})]}),j.jsx("div",{...ee("backSpacer",["track"]),ref:$,children:M.map((P,T)=>j.jsx("div",{ref:L=>{F.current.length>M.length&&(F.current=F.current.slice(0,M.length)),F.current[T]=L},...ee("detentMarker",["track","swipeOutDisabledWithDetent"]),style:{"--silk-aA":(i=M[T-1])!==null&&i!==void 0?i:"0px","--silk-aB":P,"--silk-aC":T}},T))})]})});Ox.displayName="Sheet.Content";let Bx=We.forwardRef(({asChild:t,...e},i)=>{let{className:n,"data-silk":a,...l}=e,{staging:u,placement:h,track:f,setBleedingBackgroundPresent:d}=w.useContext(Ur)||{};w.useEffect(()=>(d(!0),()=>{d(!1)}),[d]);let p=f==="horizontal"||f==="vertical",v=Ui("Sheet",{staging:u,placement:h,track:f,bleedDisabled:p});return j.jsx(jo,{asChild:t,...v("bleedingBackground",["staging","placement","track","bleedDisabled"],{className:n,dataSilk:[a]}),...l,ref:i})});Bx.displayName="Sheet.BleedingBackground";let MO=We.forwardRef((t,e)=>{let{className:i,"data-silk":n,...a}=t,{travelAxis:l}=w.useContext(Ur)||{},u=w.useMemo(()=>l==="vertical"?"horizontal":"vertical",[l]),[h,f]=w.useState(!1);w.useEffect(()=>f(Wa()),[]);let d=Ui("SpecialWrapper");return j.jsx(Vn.Root,{...d("root",[],{className:i,dataSilk:[n]}),active:h,axis:u,...a,ref:e})});MO.displayName="Sheet.SpecialWrapper.Root";let LO=We.forwardRef((t,e)=>j.jsx(Vn.Stabiliser,{...t,ref:e}));LO.displayName="Sheet.SpecialWrapper.Content";let DO=We.forwardRef((t,e)=>{let{asChild:i,travelAnimation:n,stackingAnimation:a,...l}=t,u=i?Fi:"h2",{titleId:h}=w.useContext(Ur);return j.jsx(jo,{asChild:!0,travelAnimation:n,stackingAnimation:a,children:j.jsx(u,{id:h,ref:e,...l})})});DO.displayName="Sheet.Title";let OO=We.forwardRef((t,e)=>{let{asChild:i,travelAnimation:n,stackingAnimation:a,...l}=t,{descriptionId:u}=w.useContext(Ur),h=i?Fi:"p";return j.jsx(jo,{asChild:!0,travelAnimation:n,stackingAnimation:a,children:j.jsx(h,{id:u,...l,ref:e})})});OO.displayName="Sheet.Description";let Ka={Root:Mx,Trigger:iv,View:Lx,Backdrop:Dx,Content:Ox,BleedingBackground:Bx,Handle:Rx,Portal:Ax};ec.displayName="SheetStack.ErrorBoundary";let BO=We.forwardRef((t,e)=>{let{componentId:i,className:n,"data-silk":a,asChild:l,...u}=t,h=w.useId();vi(()=>(qe.addSheetStack({id:h}),()=>qe.removeSheetStack(h)),[h]);let[f,d]=w.useState([]),p=w.useCallback(U=>{d(z=>{let V,se=z.findIndex(ee=>ee.sheetId===U.sheetId);return se!==-1?(V=[...z])[se]=U:V=[...z,U],V})},[]),v=w.useCallback(U=>{d(z=>z.filter(V=>V.sheetId!==U))},[]),g=w.useCallback(U=>{let z=f.findIndex(V=>V.sheetId===U);return z===-1?f[f.length-1]:f[z-1]},[f]),[S,b]=w.useState(0);vi(()=>{S===0&&qe.removeAllOutletPersistedStylesFromStack(h)},[S,h]);let[C,x]=w.useState([]),E=w.useCallback(U=>{x(z=>{let V=z.findIndex(se=>se.sheetId===U.sheetId);if(V===-1)return[...z,U];{let se=[...z];return se[V]=U,se}})},[]),A=w.useCallback(U=>{x(z=>z.filter(V=>V.sheetId!==U))},[]),B=w.useMemo(()=>C.some(U=>U.staging!=="none")?"not-none":"none",[C]),R=w.useMemo(()=>({stackId:h,sheetsCount:S,setSheetsCount:b,updateSheetStagingDataInStack:E,removeSheetStagingDataInStack:A,sheetsInStackMergedStaging:B,updateSheetDataInStack:p,removeSheetDataFromStack:v,getPreviousSheetDataInStack:g}),[h,S,E,A,B,p,v,g]),$=l?Fi:"div",F=Ui("SheetStack");return j.jsx(ec,{children:j.jsx(Hu,{genericContext:pf,customContext:i,value:R,children:j.jsx($,{...F("root",[],{className:n,dataSilk:[a]}),ref:e,...u})})})});BO.displayName="SheetStack.Root";let NO=We.forwardRef((t,e)=>{let{forComponent:i="closest",asChild:n,stackingAnimation:a,style:l,className:u,...h}=t,f=i==="closest"?pf:i,{stackId:d,sheetsCount:p,sheetsInStackMergedStaging:v}=w.useContext(f);vi(()=>{qe.addSheetStack({id:d})},[d]);let{styleValue:g,composedRef:S}=tv({sheetsCount:p,stackId:d,stackingAnimation:a,style:l},e),b=w.useMemo(()=>v!=="none",[v]),C=Ui("SheetStack",{}),x=n?Fi:"div";return j.jsx(x,{style:g,...C("outlet",[],{className:u,dataSilk:[b&&"0aj"]}),...h,ref:S})});NO.displayName="SheetStack.Outlet";let sv=We.createContext(null);sv.displayName="Scroll.GenericContext";let vf=We.createContext({contentRef:null});vf.displayName="Scroll.Anonymous";let Nx=t=>w.useContext(t??sv)||{},PO=Gt==="android"?102:54,yp=Jg||Gt==="android"?"instant":"smooth",zO=(t,e,i=300)=>{let n,a=t.scrollTop,l=()=>{clearTimeout(n),t.removeEventListener("scroll",u),e()},u=()=>{let h=t.scrollTop;if(h>a){l();return}a=h,clearTimeout(n),n=setTimeout(l,i)};n=setTimeout(l,i),t.addEventListener("scroll",u)},bp=t=>{if(!t)return{top:0,bottom:0};let e=t.getBoundingClientRect(),i=window.getComputedStyle(t),n=e.top+parseFloat(i.borderTopWidth),a=e.bottom-parseFloat(i.borderBottomWidth);return{top:n,bottom:a}},V1=()=>{let t=window.visualViewport.height,e=window.visualViewport.offsetTop;return{top:e,bottom:e+t}},HO=(t,e)=>Math.abs(Math.min(t+e,0)),IO=(t,e)=>Math.max(t-e,0),q1=(t,e,i)=>{t.style.setProperty("height",e+"px"),i.current=e},UO=({scrollContainer:t,elementTop:e,elementBottom:i,behavior:n,scrollMarginTop:a,scrollMarginBottom:l,scrollPortTop:u,scrollPortBottom:h,visualViewportTop:f,visualViewportBottom:d,beforeScrollCallback:p})=>{if(!t)return;let v=e-Math.max(u,f),g=Math.min(h,d)-i;if(v<a){let S=Math.max(-t.scrollTop,v-a);S!==0&&(p(),t.scrollBy({top:S,behavior:n}))}else if(g<l){let S=t.scrollHeight-t.clientHeight-t.scrollTop,b=Math.min(S,l-g);b!==0&&(p(),t.scrollBy({top:b,behavior:n}))}};ec.displayName="Scroll.ErrorBoundary";let FO=We.forwardRef((t,e)=>{let{asChild:i,className:n,componentId:a,componentRef:l,"data-silk":u,...h}=t,f=i?Fi:"div",d=w.useRef(()=>{}),p=w.useCallback((...C)=>{let x=d.current;return x(...C)},[]),v=w.useRef(()=>{}),g=w.useCallback((...C)=>{let x=v.current;return x(...C)},[]),S=w.useMemo(()=>({componentRef:l,scrollToRef:d,scrollTo:p,scrollByRef:v,scrollBy:g}),[l,g,p]),b=Ui("Scroll",{});return j.jsx(ec,{children:j.jsx(Hu,{genericContext:sv,customContext:a,value:S,children:j.jsx(f,{...b("root",[],{className:n,dataSilk:[u]}),...h,ref:e})})})});FO.displayName="Scroll.Root";let _d=null,Px=()=>{let t=w.useRef(null);vi(()=>{_d===null&&t.current&&(_d=t.current.offsetWidth-t.current.clientWidth,document.body.style.setProperty("--ua-scrollbar-thickness",_d+"px"))},[]);let e=Ui("Scroll"),i=j.jsx("div",{...e("UAScrollbarMeasurer"),ref:t});return _d===null?typeof window<"u"?_w.createPortal(i,document.body):j.jsx(j.Fragment,{children:i}):null};Px.displayName="Scroll.Anonymous";let pd=(t,e,i,n=!1)=>typeof t=="boolean"?t:typeof t?.[e]=="boolean"?t[e]:typeof t?.[i]=="boolean"?t[i]:n,$O=We.forwardRef((t,e)=>{let{asChild:i,children:n,className:a,"data-silk":l,forComponent:u,axis:h="y",pageScroll:f=!1,nativePageScrollReplacement:d=!1,safeArea:p="visual-viewport",scrollGestureTrap:v=!1,scrollGestureOvershoot:g=!0,scrollGesture:S="auto",onScrollStart:b,onScroll:C,onScrollEnd:x,onFocusInside:E,nativeFocusScrollPrevention:A=!0,scrollAnimationSettings:B={skip:"auto"},scrollAnchoring:R=!0,scrollSnapType:$="none",scrollPadding:F="auto",scrollTimelineName:U="none",nativeScrollbar:z=!0,...V}=t,[se,ee,M,O]=w.useMemo(()=>{let Se=pd(v,"xStart","x"),ft=pd(v,"xEnd","x"),Ke=pd(v,"yStart","y"),Fe=pd(v,"yEnd","y"),Ee=Se,Ie=ft,Ft=Ke,Bt=Fe;return h==="y"?Ie=Ee=Se!==ft||Se:Bt=Ft=Ke!==Fe||Ke,[Ee,Ie,Ft,Bt]},[v,h]),N=w.useMemo(()=>se!==ee,[ee,se]),P=w.useMemo(()=>M!==O,[O,M]),T=w.useMemo(()=>{if($==="proximity"){if(h==="y")return"proximityY";if(h==="x")return"proximityX"}else{if($!=="mandatory")return"none";if(h==="y")return"mandatoryY";if(h==="x")return"mandatoryX"}},[h,$]),L=i?Fi:"div",H=w.useRef(null),Y=Es(H,e),X=w.useRef(null),D=w.useRef(null),G=w.useRef(null),ie=w.useRef(null),ae=w.useRef(null),de=w.useRef(null),ue=$o(),{componentRef:he,scrollToRef:ve,scrollByRef:ye}=Nx(u)||{},{getContentCoordinatesWhenRestingOnLastDetent:Ae,contentRef:De}=w.useContext(Ur)||{},rt=w.useMemo(()=>S===!1||S!=="auto",[S]),[Ze,xe]=w.useState(!1),[ze,pe]=w.useState(!1);vi(()=>{f&&(Se=>{let ft="data-silk-native-page-scroll-replaced",Ke=document.documentElement.getAttribute(ft);if(!f&&Ke!=="true")return;let Fe=window.matchMedia("(display-mode: standalone)").matches||window.navigator.standalone;if(Se!==!0&&(Se!=="auto"||(Gt==="android"||Gt==="ios"||Gt==="ipados")&&!Fe)){var Ie,Ft;pe(!1);let Bt=new Event("silk-page-scroll-data-change");if(document.dispatchEvent(Bt),Ke==="false")return;let Qs=(Ft=(Ie=X.current)===null||Ie===void 0?void 0:Ie.scrollTop)!==null&&Ft!==void 0?Ft:0;document.documentElement.setAttribute(ft,"false"),Ke==="true"&&window.scrollTo(0,Qs)}else{pe(!0),X.current;let Bt=new Event("silk-page-scroll-data-change");if(document.dispatchEvent(Bt),Ke==="true")return;let Qs=window.pageYOffset;if(document.documentElement.setAttribute(ft,"true"),!X.current)return;X.current.scrollTop=Qs}})(d)},[f,d]);let[_t,yt]=w.useState(!0),[dt,Ce]=w.useState(!0);vi(()=>{let Se=X.current,ft=D.current,Ke=G.current,Fe=ie.current,Ee=new ResizeObserver(()=>{Se&&(h==="y"&&Se.scrollHeight>Se.clientHeight?yt(!0):yt(!1),h==="x"&&Se.scrollWidth>Se.clientWidth?Ce(!0):Ce(!1))});return Se&&ft&&Ke&&Fe&&(Ee.observe(Se,{box:"border-box"}),Ee.observe(ft,{box:"border-box"}),Ee.observe(Ke,{box:"border-box"}),Ee.observe(Fe,{box:"border-box"})),()=>{Ee&&Ee.disconnect()}},[h,rt]);let[_e,Kt]=w.useState(!1);vi(()=>{Kt(_t||dt?!0:()=>!1)},[_t,dt]);let[Be,Qe]=w.useState(!1);w.useEffect(()=>{Qe(hx())},[]);let Ye=w.useRef(!1),xt=w.useRef(!1),je=N||P,[Ts,ss]=w.useState(se),[Kn,Xn]=w.useState(M);w.useEffect(()=>{let Se;if(je){let ft=ae.current,Ke=de.current;if(!ft||!Ke)return;(Se=new IntersectionObserver(Fe=>{for(let Ee of Fe)Ee.target===ft?Ee.isIntersecting?(Ye.current=!0,h==="x"?ss(se):Xn(M)):Ye.current=!1:Ee.target===Ke&&(Ee.isIntersecting?(xt.current=!0,h==="x"?ss(ee):Xn(O)):xt.current=!1),Ye.current&&xt.current&&(h==="x"?ss(!1):Xn(!1))},{root:X.current,rootMargin:"0px",threshold:[1]})).observe(ft),Se.observe(Ke)}return()=>{Se&&Se.disconnect()}},[ee,se,O,M,h,je]);let Fr=w.useRef(!1),Ys=w.useRef(),ri=w.useRef(""),$i=w.useRef(void 0);w.useEffect(()=>{let Se=X.current;if(!Se)return;let ft=Fe=>{Ut.current=!1,rn({nativeEvent:Fe,defaultBehavior:{},handler:x});let Ee=document.activeElement;(Gt=="ios"||Gt=="ipados")&&Ee&&Lo(Ee)&&($i.current===void 0&&(ri.current=Ee.style.getPropertyValue("opacity"),Ee.style.setProperty("opacity","0.9999","important")),clearTimeout($i.current),$i.current=void 0,$i.current=setTimeout(()=>{ri.current===""?Ee.style.removeProperty("opacity"):Ee.style.setProperty("opacity",ri.current),$i.current=void 0},55))},Ke=Fe=>{if(!Fr.current){let{dismissKeyboard:Ee}=rn({nativeEvent:Fe,defaultBehavior:{dismissKeyboard:!1},handler:b});Ee&&!Fr.current&&!Ut.current&&ef()&&Se.focus({preventScroll:!0})}clearTimeout(Ys.current),Ys.current=setTimeout(()=>{Fr.current=!1,xe(!1),"onscrollend"in window||ft(null)},90),Fr.current=!0,xe(!0)};return Se.addEventListener("scroll",Ke),"onscrollend"in window&&Se.addEventListener("scrollend",ft),()=>{Se.removeEventListener("scroll",Ke),"onscrollend"in window&&Se.removeEventListener("scrollend",ft)}},[x,b]),w.useEffect(()=>(A&&qe.addNativeFocusScrollPreventer(ue),()=>{A&&qe.removeNativeFocusScrollPreventer(ue)}),[A,ue]);let Mt=w.useMemo(()=>f&&!ze,[ze,f]),ni=w.useMemo(()=>h==="y"?Mt?()=>window.scrollY:()=>{var Se;return(Se=X.current)===null||Se===void 0?void 0:Se.scrollTop}:Mt?()=>window.scrollX:()=>{var Se;return(Se=X.current)===null||Se===void 0?void 0:Se.scrollLeft},[h,Mt]),Gs=w.useMemo(()=>h==="y"?Mt?()=>document.body.scrollHeight-window.innerHeight:()=>{let Se=X.current;return Se?.scrollHeight-Se?.offsetHeight}:Mt?()=>document.body.scrollWidth-window.innerWidth:()=>{let Se=X.current;return Se?.scrollWidth-Se?.offsetWidth},[h,Mt]),cn=w.useCallback(()=>ni()/Gs(),[ni,Gs]),Ks=w.useCallback(Se=>{C?.({progress:cn(),distance:ni(),availableDistance:Gs(),nativeEvent:Se})},[cn,ni,Gs,C]);w.useEffect(()=>(Mt&&C&&document.addEventListener("scroll",Ks),()=>{Mt&&C&&document.removeEventListener("scroll",Ks)}),[Mt,C,Ks]);let kt=w.useCallback((Se,{progress:ft,distance:Ke,animationSettings:Fe={skip:"default"}})=>{let Ee=Ke??(ft??NaN)*Gs();if(isNaN(Ee))return;let Ie=Fe?.skip,Ft=Mt?window:X.current;Ft?.[Se==="to"?"scrollTo":"scrollBy"]({[h==="y"?"top":"left"]:Ee,behavior:Ie===!0?"instant":Ie===!1?"smooth":Ie==="default"?"auto":Jg?"instant":"smooth"})},[h,Gs,Mt]),kr=w.useCallback(Se=>kt("to",Se),[kt]),Wi=w.useCallback(Se=>kt("by",Se),[kt]);w.useEffect(()=>{ve.current=kr,ye.current=Wi},[Wi,ye,kr,ve]),w.useImperativeHandle(he,()=>({getProgress:cn,getDistance:ni,getAvailableDistance:Gs,scrollTo:kr,scrollBy:Wi}),[Gs,ni,cn,kr,Wi]);let Rs=w.useRef(!1),Er=w.useRef(),Zn=w.useRef(),Qi=w.useRef(0),Xs=w.useRef(0),Ut=w.useRef(!1),Pe=w.useCallback(({scrollIntoPlace:Se=!0,scrollBehavior:ft,safeViewport:Ke="visual-viewport"})=>{let Fe,Ee;if(!X.current||!D.current||!ie.current||!G.current||h!=="y"||Ke==="none"||De?.current&&Ae().top===null||!De?.current&&Ae)return;if(De?.current){let{top:ci,bottom:fs}=bp(X.current),ui=De.current.getBoundingClientRect(),Ei=ui.top,be=ui.bottom;Fe=Ae().top+(ci-Ei),Ee=Ae().bottom-(be-fs)}else{let{top:ci,bottom:fs}=bp(X.current);Fe=ci,Ee=fs}let{top:Ie,bottom:Ft}=V1(),Bt=Math.min(Ee,Ke==="visual-viewport"?Ft:window.innerHeight),Qs=HO(Fe,Ke==="visual-viewport"?Ie:0),Js=IO(Ee,Ke==="visual-viewport"?Ft:window.innerHeight);if(1>Math.abs(Qi.current-Qs)&&1>Math.abs(Xs.current-Js))return;let Tr=-1*(Bt-ie.current.getBoundingClientRect().top),As=X.current.offsetHeight-D.current.offsetHeight>=0,Rr=()=>{q1(G.current,Qs,Qi),q1(ie.current,Js,Xs)};if(ft==="smooth"&&(Tr<0||As)?Se&&(Ut.current=!0,As?X.current.scrollTo({top:0,behavior:ft}):X.current.scrollBy({top:Tr,behavior:ft}),Xs.current=Js,zO(X.current,()=>{X.current&&As&&X.current.scrollTo({top:0,behavior:"instant"}),Rr()})):Rr(),!Se)return{spacersHeightSetter:Rr,verticalScrollOffsetRequired:Tr}},[h,Ae,De]),Lt=w.useCallback(()=>Pe({scrollBehavior:yp,safeViewport:p}),[p,Pe]);vi(()=>{Lt()},[Lt]),w.useEffect(()=>{let Se=X.current,ft=Ee=>{clearTimeout(Er.current),clearTimeout(Zn.current);let Ie=Ee.target;if(Ie===Se)return;let{scrollIntoView:Ft}=rn({nativeEvent:Ee,defaultBehavior:{scrollIntoView:!0},handler:E});if(!Lo(Ie)||yg(Ie))return;let Bt=Ie.getBoundingClientRect().top-0,Qs=Ie.getBoundingClientRect().bottom-0,{top:Js,bottom:Tr}=bp(X.current),As=Js-0,Rr=Tr-0,ci=()=>{if(clearTimeout(Er.current),clearTimeout(Zn.current),!ef())return;Rs.current=!0;let{top:fs,bottom:ui}=V1(),{spacersHeightSetter:Ei=()=>{}}=Pe({scrollIntoPlace:!1,scrollBehavior:"smooth",safeViewport:p})||{};Ei(),Ft&&UO({scrollContainer:X.current,behavior:yp,scrollMarginTop:64,scrollMarginBottom:PO,elementTop:Bt,elementBottom:Qs,scrollPortTop:As,scrollPortBottom:Rr,visualViewportTop:fs,visualViewportBottom:ui,beforeScrollCallback:()=>Ut.current=!0}),visualViewport.removeEventListener("resize",ci)};Rs.current?(ci(),visualViewport.addEventListener("resize",ci),Er.current=setTimeout(()=>{visualViewport.removeEventListener("resize",ci)},900)):(visualViewport.addEventListener("resize",ci),Zn.current=setTimeout(()=>{visualViewport.removeEventListener("resize",ci),ci()},900))},Ke=Ee=>{let Ie=Ee.target;!Lo(Ie)||yg(Ie)||Lo(Ee.relatedTarget)||(Rs.current=!1,Pe({scrollBehavior:yp,safeViewport:p==="none"?"none":"layout-viewport"}))},Fe=()=>{var Ee;(Ee=X.current)===null||Ee===void 0||Ee.removeEventListener("scroll",Lt),setTimeout(()=>{Lt(),setTimeout(()=>{var Ie;(Ie=X.current)===null||Ie===void 0||Ie.addEventListener("scroll",Lt,{once:!0})},200)},1),setTimeout(()=>Lt,350)};return Se?.addEventListener("focus",ft,{capture:!0}),Se?.addEventListener("blur",Ke,{capture:!0}),visualViewport.addEventListener("resize",Fe),Se?.addEventListener("scroll",Lt,{once:!0}),()=>{Se?.removeEventListener("focus",ft,{capture:!0}),Se?.removeEventListener("blur",Ke,{capture:!0}),visualViewport.removeEventListener("resize",Fe),Se?.removeEventListener("scroll",Lt)}},[E,p,Pe,Lt]);let Vo=ux(X),Zs=w.useMemo(()=>f&&!ze,[ze,f]),ji=Ui("Scroll",{axis:h,scrollTrapX:Ts,scrollTrapY:!Be&&Kn||Vo&&!Zs,scrollGestureOvershoot:g,scrollDisabled:rt,pageScroll:f,nativePageScrollReplacement:d,overflowX:dt,overflowY:_t,skipScrollAnimation:B?.skip,scrollAnchoring:R,scrollSnapType:T,nativeScrollbar:z,scrollOngoing:Ze});return j.jsxs(vf.Provider,{value:{contentRef:D,axis:h,styleAttributes:ji,nativeFocusScrollPrevention:A,swipeTrapIncapable:Zs,focusable:_e,pageScroll:f,nativePageScrollReplacement:d,scrollContainerRef:X,swipeTrapObserverRequired:je,startScrollSpyRef:ae,endScrollSpyRef:de,startSpacerRef:G,endSpacerRef:ie,scrollHandler:Ks,scrollPadding:F,scrollTimelineName:U},children:[f&&d!==!0&&j.jsx("style",{dangerouslySetInnerHTML:{__html:`
|
|
88
|
+
html[data-silk-native-page-scroll-replaced="false"] > body {
|
|
89
|
+
scroll-padding: ${F};
|
|
90
|
+
scroll-timeline-axis: ${U} ${h};
|
|
91
|
+
}
|
|
92
|
+
`}}),f&&d===!0&&j.jsx("script",{id:"silk-scroll-nativePageScrollReplacement-true",dangerouslySetInnerHTML:{__html:`
|
|
93
|
+
document.documentElement.setAttribute("data-silk-native-page-scroll-replaced", "true");
|
|
94
|
+
`}}),f&&d===!1&&j.jsx("script",{id:"silk-scroll-nativePageScrollReplacement-false",dangerouslySetInnerHTML:{__html:`
|
|
95
|
+
document.documentElement.setAttribute("data-silk-native-page-scroll-replaced", "false");
|
|
96
|
+
`}}),f&&d==="auto"&&j.jsx("script",{id:"silk-scroll-nativePageScrollReplacement-auto",dangerouslySetInnerHTML:{__html:`
|
|
97
|
+
const standalone =
|
|
98
|
+
window.matchMedia('(display-mode: standalone)').matches || window.navigator.standalone;
|
|
99
|
+
const mobile = window.navigator.userAgent?.match(/android|iPhone|iPad/i);
|
|
100
|
+
|
|
101
|
+
document.documentElement.setAttribute("data-standalone", !!standalone);
|
|
102
|
+
document.documentElement.setAttribute("data-silk-native-page-scroll-replaced", !(mobile && !standalone));
|
|
103
|
+
`}}),j.jsx(Px,{}),j.jsx(L,{...ji("view",["axis","pageScroll","skipScrollAnimation","scrollOngoing"],{className:a,dataSilk:[l]}),...V,ref:Y,children:n})]})});$O.displayName="Scroll.View";let Eg=We.forwardRef(({side:t,...e},i)=>{let{axis:n}=w.useContext(vf)||{},a=Ui("Scroll",{side:t,axis:n});return j.jsx("div",{...a("spy",["side","axis"]),ref:i,...e})});Eg.displayName="Scroll.Anonymous";let WO=We.forwardRef((t,e)=>{let{asChild:i,className:n,"data-silk":a,...l}=t,u=i?Fi:"div",{contentRef:h,styleAttributes:f,nativeFocusScrollPrevention:d,swipeTrapIncapable:p,focusable:v,axis:g,pageScroll:S,nativePageScrollReplacement:b,scrollContainerRef:C,swipeTrapObserverRequired:x,startScrollSpyRef:E,endScrollSpyRef:A,startSpacerRef:B,endSpacerRef:R,scrollHandler:$,scrollPadding:F,scrollTimelineName:U}=w.useContext(vf)||{},z=Es(h,e);return j.jsxs("div",{...f("scrollContainer",["axis","pageScroll","scrollTrapX","scrollTrapY","scrollGestureOvershoot","scrollDisabled","overflowX","overflowY","skipScrollAnimation","scrollAnchoring","scrollSnapType","nativeScrollbar"],{dataSilk:[a,"0ad",d&&"0ah",p&&"0ai"]}),style:{scrollPadding:F,scrollTimeline:U+" "+g},tabIndex:v?0:d?-1:void 0,role:S&&!b?void 0:"region",onScroll:$,ref:C,children:[x&&j.jsx(Eg,{side:"start",ref:E}),g==="y"&&j.jsx("div",{ref:B,...f("startSpacer",["axis","pageScroll"])}),j.jsx(u,{...f("content",["axis","scrollTrapX","scrollTrapY","overflowX","overflowY"],{className:n,dataSilk:[a]}),...l,ref:z}),g==="y"&&j.jsx("div",{ref:R,...f("endSpacer",["axis","pageScroll"])}),x&&j.jsx(Eg,{side:"end",ref:A})]})});WO.displayName="Scroll.Content";let jO=We.forwardRef(({asChild:t,...e},i)=>{let n=t?Fi:"button",{forComponent:a,onPress:l,onClick:u,children:h,action:f,...d}=e,{type:p,...v}=f||{},{scrollTo:g,scrollBy:S}=Nx(a),b=w.useRef(null),C=Es(b,i);return j.jsx(n,{onClick:x=>{var E;let{forceFocus:A,runAction:B}=rn({nativeEvent:x,defaultBehavior:{forceFocus:!0,runAction:!0},handler:l});if(A&&((E=b.current)===null||E===void 0||E.focus({preventScroll:!0})),B){if(p==="scroll-to")return g(v);if(p==="scroll-by")return S(v)}u?.(x)},ref:C,...d,children:h})});jO.displayName="Sheet.Trigger";let VO=t=>w.useContext(t??Ga)||{},qO=We.forwardRef((t,e)=>{let{asChild:i,className:n,"data-silk":a,timing:l,forComponent:u,tabIndex:h,...f}=t,d=i?Fi:"div",{sheetId:p}=u?VO(u):{},v=p??"any",g=w.useCallback(B=>{qe.addAutoFocusTarget({layerId:v,element:B,timing:l})},[v,l]),S=w.useCallback(B=>{qe.removeAutoFocusTarget(B)},[]),b=w.useRef(null),C=w.useCallback(B=>{B?g(B):S(b.current),b.current=B},[g,S]),x=w.useRef(!0);w.useEffect(()=>(b.current&&!x.current&&g(b.current),x.current=!1,()=>{b.current&&S(b.current)}),[g,S]);let E=Es(C,e),A=Ui("AutoFocusTarget",{});return j.jsx(d,{...A("root",[],{className:n,dataSilk:[a]}),...i||Number.isInteger(h)?{}:{tabIndex:-1},...f,ref:E})});qO.displayName="AutoFocusTarget.Root";let YO=We.forwardRef((t,e)=>{let{asChild:i,disabled:n=!1,children:a,contentGetter:l,forComponent:u,...h}=t,f=w.useRef(null),d=Es(f,e),p=w.useMemo(()=>!!a,[a]);return w.useEffect(()=>{let v,g;if(!n){let S,b=!1;if(p&&f.current?S=f.current:l&&(S=Jd(l))&&(b=!0),S){let C=Array.isArray(u)?u:u?[u]:[];v=qe.addIsland({componentId:C,element:S}),b&&(g=new MutationObserver(()=>{Jd(l)||(qe.removeIsland(v),g.disconnect())})).observe(S.parentElement,{childList:!0})}}return()=>{n||(qe.removeIsland(v),g?.disconnect())}},[e,n,p,l,u]),a?j.jsx(Vn.Root,{active:!n,asChild:i,"data-silk":"0ag",...h,ref:d,children:a}):null});YO.displayName="Island.Root";let GO=We.forwardRef((t,e)=>{let{asChild:i,children:n,...a}=t;return j.jsx(Vn.Stabiliser,{asChild:i,...a,ref:e,children:n})});GO.displayName="Island.Content";let KO=We.forwardRef(({asChild:t,children:e,contentGetter:i,disabled:n=!1,selfManagedInertOutside:a=!0,...l},u)=>{let h=$o(),f=w.useRef(null),d=Es(f,u),p=t?Fi:"div",v=w.useMemo(()=>!!e,[e]);return vi(()=>{let g;if(!n&&h){let S,b=!1;v&&f.current?S=f.current:i&&(S=Jd(i))&&(b=!0),S&&(qe.updateLayer({external:!0,layerId:h,viewElement:S,inertOutside:a,onPresentAutoFocus:{focus:!1},onDismissAutoFocus:{focus:!1},defaultClickOutsideAction:()=>{},defaultEscapeKeyDownAction:()=>{}}),b&&(g=new MutationObserver(()=>{Jd(i)||(qe.removeLayer(h),g.disconnect())})).observe(S.parentElement,{childList:!0}))}return()=>{!n&&h&&(qe.removeLayer(h),g?.disconnect())}},[v,i,n,h,a]),j.jsx(p,{ref:d,...l,children:e})});KO.displayName="ExternalOverlay.Root";const zx=We.forwardRef(({children:t,license:e="commercial",...i},n)=>j.jsx(Ka.Root,{license:e,...i,ref:n,children:t}));zx.displayName="BottomSheet.Root";const Hx=We.forwardRef(({children:t,className:e,...i},n)=>j.jsx(Ka.View,{className:`BottomSheet-view ${e??""}`.trim(),nativeEdgeSwipePrevention:!0,...i,ref:n,children:t}));Hx.displayName="BottomSheet.View";const Ix=We.forwardRef(({className:t,...e},i)=>j.jsx(Ka.Backdrop,{className:`BottomSheet-backdrop ${t??""}`.trim(),themeColorDimming:!1,...e,ref:i}));Ix.displayName="BottomSheet.Backdrop";const Ux=We.forwardRef(({children:t,className:e,...i},n)=>j.jsxs(Ka.Content,{className:`BottomSheet-content ${e??""}`.trim(),...i,ref:n,children:[j.jsx(Ka.BleedingBackground,{className:"BottomSheet-bleedingBackground"}),t]}));Ux.displayName="BottomSheet.Content";const Fx=We.forwardRef(({className:t,...e},i)=>j.jsx(Ka.Handle,{className:`BottomSheet-handle ${t??""}`.trim(),action:"dismiss",...e,ref:i}));Fx.displayName="BottomSheet.Handle";const XO=Ka.Portal,ZO=Ka.Trigger,Na={Root:zx,Portal:XO,View:Hx,Backdrop:Ix,Content:Ux,Trigger:ZO,Handle:Fx},QO=t=>{const e=t.status==="running"?"Running":"Closed",i=t.source==="tmux"?"Tmux":"Mock";return`${e} - ${i}`},JO=({terminals:t,activeTerminalId:e,listState:i,onSelectTerminal:n})=>{const a=i==="loading"?"Loading terminals":i==="error"?"Unable to load terminals":i==="empty"?"No terminals available":null;return j.jsxs(Na.Root,{children:[j.jsx(Na.Trigger,{asChild:!0,children:j.jsx(yd,{type:"button",variant:"secondary",size:"icon","aria-label":"Terminals",className:"h-10 w-10 rounded-full bg-input/50",children:j.jsx(bD,{className:"size-4","aria-hidden":"true"})})}),j.jsx(Na.Portal,{children:j.jsxs(Na.View,{children:[j.jsx(Na.Backdrop,{}),j.jsxs(Na.Content,{className:"px-4 pb-[calc(env(safe-area-inset-bottom,0px)+16px)] pt-3",children:[j.jsx("div",{className:"flex items-center justify-center pb-3",children:j.jsx(Na.Handle,{})}),j.jsxs("div",{className:"flex items-center justify-between px-1 pb-4",children:[j.jsxs("div",{className:"space-y-1",children:[j.jsx("p",{className:"text-xs font-semibold text-muted-foreground",children:"Terminals"}),j.jsx("p",{className:"text-sm font-medium text-foreground",children:"Select a session"})]}),i==="ready"?j.jsxs("span",{className:"text-xs text-muted-foreground",children:[t.length," total"]}):null]}),j.jsx("div",{className:"no-scrollbar max-h-[min(55vh,360px)] space-y-2 overflow-y-auto px-1",children:a?j.jsx("div",{className:"rounded-2xl border border-border/60 bg-background/70 px-4 py-5 text-sm text-muted-foreground",children:a}):t.map(l=>{const u=l.id===e,h=l.label||l.id;return j.jsx(Na.Trigger,{asChild:!0,action:"dismiss",children:j.jsx("button",{type:"button","aria-label":`Open ${h}`,"aria-current":u?"page":void 0,className:`w-full rounded-2xl border px-4 py-3 text-left transition ${u?"border-primary/60 bg-primary/10 text-foreground":"border-border/60 bg-background/70 text-foreground hover:bg-background/90"}`,onClick:()=>n(l.id),children:j.jsxs("div",{className:"flex items-center justify-between gap-3",children:[j.jsxs("div",{className:"min-w-0",children:[j.jsx("span",{className:"text-sm font-medium",children:h}),j.jsx("div",{className:"pt-1 text-xs text-muted-foreground",children:QO(l)})]}),u?j.jsx("span",{className:"flex h-8 w-8 items-center justify-center text-primary",children:j.jsx(hD,{className:"size-6","aria-hidden":"true"})}):null]})})},l.id)})})]})]})})]})},eB=({clientRef:t,terminals:e,activeTerminalId:i,listState:n,onSelectTerminal:a})=>{const l=w.useRef(null),[u,h]=w.useState(""),[f,d]=w.useState(!1),[p,v]=w.useState(!1),[g,S]=w.useState(!1);w.useEffect(()=>{if(!f){v(!1),S(!1);return}const E=l.current,A=()=>{const F=E.scrollWidth-E.clientWidth,U=E.scrollLeft>0,z=E.scrollLeft<F-1;v(U),S(F>0&&z)};A();const B=()=>A();E.addEventListener("scroll",B,{passive:!0});const R=window.ResizeObserver,$=typeof R=="function"?new R(A):null;return $?.observe(E),window.addEventListener("resize",A),()=>{E.removeEventListener("scroll",B),$?.disconnect(),window.removeEventListener("resize",A)}},[f]);const b=w.useMemo(()=>[{id:"enter",label:"Enter",kind:"input",data:"\r",icon:_D},{id:"up",label:"Up",kind:"control",key:"up",icon:cD},{id:"down",label:"Down",kind:"control",key:"down",icon:tD},{id:"left",label:"Left",kind:"control",key:"left",icon:sD},{id:"right",label:"Right",kind:"control",key:"right",icon:oD},{id:"tab",label:"Tab",kind:"control",key:"tab",icon:nD},{id:"esc",label:"Esc",kind:"control",key:"esc",icon:CD},{id:"ctrl-c",label:"Ctrl+C",kind:"control",key:"ctrl_c",icon:fD}],[]),C=()=>{const E=t.current;E&&(u&&E.sendInput(u),E.sendInput("\r"),h(""))},x=E=>{const A=t.current;if(A){if(E.kind==="input"){A.sendInput(E.data);return}A.sendControl(E.key)}};return j.jsxs("div",{className:"min-w-0",children:[f?j.jsx("div",{className:"pt-3",children:j.jsxs("div",{className:"relative",children:[j.jsx("div",{className:"h-11",children:j.jsx("div",{ref:l,id:"terminal-actions","data-testid":"terminal-actions-scroll",className:"no-scrollbar flex h-full w-full items-center gap-2 overflow-x-auto px-3 snap-x snap-mandatory scroll-px-3",children:b.map(E=>{const A=E.icon;return j.jsxs(yd,{type:"button",variant:"secondary",size:"sm","aria-label":E.label,className:"bg-input/50 snap-start whitespace-nowrap px-3 py-2",onClick:()=>x(E),children:[j.jsx(A,{className:"size-4","aria-hidden":"true"}),j.jsx("span",{children:E.label})]},E.id)})})}),p?j.jsx("div",{"data-testid":"terminal-actions-gradient-left",className:"pointer-events-none absolute inset-y-0 left-0 z-10 w-16 bg-gradient-to-r from-background to-transparent"}):null,g?j.jsx("div",{"data-testid":"terminal-actions-gradient-right",className:"pointer-events-none absolute inset-y-0 right-0 z-10 w-16 bg-gradient-to-l from-background to-transparent"}):null]})}):null,j.jsx("div",{className:"px-3 py-3",children:j.jsxs("div",{className:"flex w-full min-w-0 items-center gap-3",children:[j.jsx(yd,{type:"button",variant:"secondary",size:"icon","aria-label":"Add","aria-expanded":f,"aria-controls":"terminal-actions",className:"h-10 w-10 rounded-full bg-input/50",onClick:()=>d(E=>!E),children:j.jsx(gD,{className:`size-4 transition-transform duration-200 ${f?"rotate-45":""}`})}),j.jsxs("div",{className:"relative flex-1 min-w-0",children:[j.jsx(WT,{placeholder:"Message","aria-label":"Message",className:"h-11 rounded-full border-none bg-input/50 pl-4 pr-8",value:u,onChange:E=>h(E.target.value),onKeyDown:E=>{E.key==="Enter"&&(E.preventDefault(),C())}}),j.jsx(yd,{type:"button",variant:"default",size:"sm","aria-label":"Send",className:"absolute right-1 top-1/2 h-9 w-9 -translate-y-1/2 rounded-full",onClick:C,children:j.jsx(SD,{className:"size-4"})})]}),j.jsx("div",{className:"-ml-1 flex-shrink-0",children:j.jsx(JO,{terminals:e,activeTerminalId:i,listState:n,onSelectTerminal:a})})]})})]})},$x=({terminalId:t,onSelectTerminal:e})=>{const i=w.useRef(null),n=w.useRef(null),[a,l]=w.useState("loading"),[u,h]=w.useState([]);w.useEffect(()=>{let p=!0;return(async()=>{try{const g=await fetch("/api/terminals");if(!g.ok)throw new Error("terminal list request failed");const b=(await g.json()).terminals;if(!p)return;if(h(b),b.length===0){l("empty");return}l("ready")}catch{p&&l("error")}})(),()=>{p=!1}},[]);const f=w.useMemo(()=>a!=="ready"||!t?null:u.some(p=>p.id===t)?t:null,[a,t,u]);w.useEffect(()=>{if(a!=="ready"||u.length===0||(t?u.some(g=>g.id===t):!1))return;const v=u[0]?.id;v&&e&&e(v)},[a,u,t,e]),w.useEffect(()=>{if(a!=="ready"||!f||!i.current)return;const p=G3(i.current,f);return n.current=p,()=>{n.current=null,p.destroy()}},[a,f]);const d=a==="loading"?"Loading terminal":a==="empty"?"No terminals available":a==="error"?"Unable to load terminals":f?null:"Loading terminal";return j.jsxs("div",{className:"relative grid h-full w-full grid-cols-1 grid-rows-[minmax(0,1fr)_auto] bg-background text-foreground",children:[d?j.jsx("div",{className:"terminal-status absolute inset-0 z-20 flex items-center justify-center bg-background/85 text-xs font-medium text-muted-foreground",role:"status",children:d}):null,j.jsx("div",{className:"min-h-0 min-w-0",children:j.jsx("div",{ref:i,className:"terminal-host h-full w-full","data-testid":"terminal-host"})}),j.jsx(eB,{clientRef:n,terminals:u,activeTerminalId:f,listState:a,onSelectTerminal:e??(()=>{})})]})},tB=()=>{const t=Ou(),e=w.useCallback(i=>{t({to:"/terminal/$terminalId",params:{terminalId:i}})},[t]);return j.jsx($x,{terminalId:null,onSelectTerminal:e})},iB=()=>{const t=Ou(),{terminalId:e}=of({from:"/terminal/$terminalId"}),i=w.useCallback(n=>{t({to:"/terminal/$terminalId",params:{terminalId:n}})},[t]);return j.jsx($x,{terminalId:e,onSelectTerminal:i})},rv=Gk({component:()=>j.jsx(Sw,{})}),sB=Pg({getParentRoute:()=>rv,path:"/",component:tB}),rB=Pg({getParentRoute:()=>rv,path:"/terminal/$terminalId",component:iB}),nB=rv.addChildren([sB,rB]),aB=sE({routeTree:nB,basepath:"/app"}),Wx="termbridge.theme",oB=()=>{if(typeof window>"u")return null;const t=window.localStorage.getItem(Wx);return t==="light"||t==="dark"||t==="system"?t:null},lB=t=>{typeof window>"u"||window.localStorage.setItem(Wx,t)},cB=()=>(jT({getStoredTheme:oB,setStoredTheme:lB}),j.jsx(aE,{router:aB})),uB=t=>{y2.createRoot(t).render(j.jsx(cB,{}))},Y1=document.getElementById("root");Y1&&uB(Y1);
|