nomoreide 0.1.33 → 0.1.35
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/dist/core/db/driver.d.ts +6 -1
- package/dist/core/db/driver.js +6 -0
- package/dist/core/db/driver.js.map +1 -1
- package/dist/core/db/mysql-driver.d.ts +1 -1
- package/dist/core/db/mysql-driver.js +6 -3
- package/dist/core/db/mysql-driver.js.map +1 -1
- package/dist/core/db/postgres-driver.d.ts +1 -1
- package/dist/core/db/postgres-driver.js +6 -3
- package/dist/core/db/postgres-driver.js.map +1 -1
- package/dist/core/db/sqlite-driver.d.ts +1 -1
- package/dist/core/db/sqlite-driver.js +7 -4
- package/dist/core/db/sqlite-driver.js.map +1 -1
- package/dist/core/db-peek.d.ts +8 -1
- package/dist/core/db-peek.js +25 -2
- package/dist/core/db-peek.js.map +1 -1
- package/dist/core/git-manager.d.ts +20 -0
- package/dist/core/git-manager.js +59 -1
- package/dist/core/git-manager.js.map +1 -1
- package/dist/web/client/assets/index--4CtgHEa.js +139 -0
- package/dist/web/client/assets/index-5mE4nOR3.css +1 -0
- package/dist/web/client/index.html +2 -2
- package/dist/web/routes/database-routes.js +14 -7
- package/dist/web/routes/database-routes.js.map +1 -1
- package/dist/web/routes/git-routes.js +10 -0
- package/dist/web/routes/git-routes.js.map +1 -1
- package/package.json +4 -1
- package/dist/web/client/assets/index-DHmbWLCJ.js +0 -45
- package/dist/web/client/assets/index-Duh8SZvs.css +0 -1
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const d of l.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&r(d)}).observe(document,{childList:!0,subtree:!0});function s(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(o){if(o.ep)return;o.ep=!0;const l=s(o);fetch(o.href,l)}})();function cN(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Uf={exports:{}},Sl={};var Kb;function uN(){if(Kb)return Sl;Kb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function s(r,o,l){var d=null;if(l!==void 0&&(d=""+l),o.key!==void 0&&(d=""+o.key),"key"in o){l={};for(var f in o)f!=="key"&&(l[f]=o[f])}else l=o;return o=l.ref,{$$typeof:e,type:r,key:d,ref:o!==void 0?o:null,props:l}}return Sl.Fragment=t,Sl.jsx=s,Sl.jsxs=s,Sl}var Gb;function dN(){return Gb||(Gb=1,Uf.exports=uN()),Uf.exports}var u=dN(),Hf={exports:{}},Ie={};var Wb;function hN(){if(Wb)return Ie;Wb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),b=Symbol.iterator;function y(D){return D===null||typeof D!="object"?null:(D=b&&D[b]||D["@@iterator"],typeof D=="function"?D:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,N={};function A(D,ie,ce){this.props=D,this.context=ie,this.refs=N,this.updater=ce||x}A.prototype.isReactComponent={},A.prototype.setState=function(D,ie){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,ie,"setState")},A.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function R(){}R.prototype=A.prototype;function T(D,ie,ce){this.props=D,this.context=ie,this.refs=N,this.updater=ce||x}var M=T.prototype=new R;M.constructor=T,w(M,A.prototype),M.isPureReactComponent=!0;var z=Array.isArray;function U(){}var j={H:null,A:null,T:null,S:null},O=Object.prototype.hasOwnProperty;function K(D,ie,ce){var le=ce.ref;return{$$typeof:e,type:D,key:ie,ref:le!==void 0?le:null,props:ce}}function H(D,ie){return K(D.type,ie,D.props)}function G(D){return typeof D=="object"&&D!==null&&D.$$typeof===e}function J(D){var ie={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(ce){return ie[ce]})}var I=/\/+/g;function ee(D,ie){return typeof D=="object"&&D!==null&&D.key!=null?J(""+D.key):ie.toString(36)}function q(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(U,U):(D.status="pending",D.then(function(ie){D.status==="pending"&&(D.status="fulfilled",D.value=ie)},function(ie){D.status==="pending"&&(D.status="rejected",D.reason=ie)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function k(D,ie,ce,le,de){var ge=typeof D;(ge==="undefined"||ge==="boolean")&&(D=null);var Se=!1;if(D===null)Se=!0;else switch(ge){case"bigint":case"string":case"number":Se=!0;break;case"object":switch(D.$$typeof){case e:case t:Se=!0;break;case _:return Se=D._init,k(Se(D._payload),ie,ce,le,de)}}if(Se)return de=de(D),Se=le===""?"."+ee(D,0):le,z(de)?(ce="",Se!=null&&(ce=Se.replace(I,"$&/")+"/"),k(de,ie,ce,"",function(it){return it})):de!=null&&(G(de)&&(de=H(de,ce+(de.key==null||D&&D.key===de.key?"":(""+de.key).replace(I,"$&/")+"/")+Se)),ie.push(de)),1;Se=0;var Be=le===""?".":le+":";if(z(D))for(var Ee=0;Ee<D.length;Ee++)le=D[Ee],ge=Be+ee(le,Ee),Se+=k(le,ie,ce,ge,de);else if(Ee=y(D),typeof Ee=="function")for(D=Ee.call(D),Ee=0;!(le=D.next()).done;)le=le.value,ge=Be+ee(le,Ee++),Se+=k(le,ie,ce,ge,de);else if(ge==="object"){if(typeof D.then=="function")return k(q(D),ie,ce,le,de);throw ie=String(D),Error("Objects are not valid as a React child (found: "+(ie==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":ie)+"). If you meant to render a collection of children, use an array instead.")}return Se}function F(D,ie,ce){if(D==null)return D;var le=[],de=0;return k(D,le,"","",function(ge){return ie.call(ce,ge,de++)}),le}function V(D){if(D._status===-1){var ie=D._result;ie=ie(),ie.then(function(ce){(D._status===0||D._status===-1)&&(D._status=1,D._result=ce)},function(ce){(D._status===0||D._status===-1)&&(D._status=2,D._result=ce)}),D._status===-1&&(D._status=0,D._result=ie)}if(D._status===1)return D._result.default;throw D._result}var Z=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ie=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(ie))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},W={map:F,forEach:function(D,ie,ce){F(D,function(){ie.apply(this,arguments)},ce)},count:function(D){var ie=0;return F(D,function(){ie++}),ie},toArray:function(D){return F(D,function(ie){return ie})||[]},only:function(D){if(!G(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return Ie.Activity=v,Ie.Children=W,Ie.Component=A,Ie.Fragment=s,Ie.Profiler=o,Ie.PureComponent=T,Ie.StrictMode=r,Ie.Suspense=m,Ie.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,Ie.__COMPILER_RUNTIME={__proto__:null,c:function(D){return j.H.useMemoCache(D)}},Ie.cache=function(D){return function(){return D.apply(null,arguments)}},Ie.cacheSignal=function(){return null},Ie.cloneElement=function(D,ie,ce){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var le=w({},D.props),de=D.key;if(ie!=null)for(ge in ie.key!==void 0&&(de=""+ie.key),ie)!O.call(ie,ge)||ge==="key"||ge==="__self"||ge==="__source"||ge==="ref"&&ie.ref===void 0||(le[ge]=ie[ge]);var ge=arguments.length-2;if(ge===1)le.children=ce;else if(1<ge){for(var Se=Array(ge),Be=0;Be<ge;Be++)Se[Be]=arguments[Be+2];le.children=Se}return K(D.type,de,le)},Ie.createContext=function(D){return D={$$typeof:d,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:l,_context:D},D},Ie.createElement=function(D,ie,ce){var le,de={},ge=null;if(ie!=null)for(le in ie.key!==void 0&&(ge=""+ie.key),ie)O.call(ie,le)&&le!=="key"&&le!=="__self"&&le!=="__source"&&(de[le]=ie[le]);var Se=arguments.length-2;if(Se===1)de.children=ce;else if(1<Se){for(var Be=Array(Se),Ee=0;Ee<Se;Ee++)Be[Ee]=arguments[Ee+2];de.children=Be}if(D&&D.defaultProps)for(le in Se=D.defaultProps,Se)de[le]===void 0&&(de[le]=Se[le]);return K(D,ge,de)},Ie.createRef=function(){return{current:null}},Ie.forwardRef=function(D){return{$$typeof:f,render:D}},Ie.isValidElement=G,Ie.lazy=function(D){return{$$typeof:_,_payload:{_status:-1,_result:D},_init:V}},Ie.memo=function(D,ie){return{$$typeof:h,type:D,compare:ie===void 0?null:ie}},Ie.startTransition=function(D){var ie=j.T,ce={};j.T=ce;try{var le=D(),de=j.S;de!==null&&de(ce,le),typeof le=="object"&&le!==null&&typeof le.then=="function"&&le.then(U,Z)}catch(ge){Z(ge)}finally{ie!==null&&ce.types!==null&&(ie.types=ce.types),j.T=ie}},Ie.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},Ie.use=function(D){return j.H.use(D)},Ie.useActionState=function(D,ie,ce){return j.H.useActionState(D,ie,ce)},Ie.useCallback=function(D,ie){return j.H.useCallback(D,ie)},Ie.useContext=function(D){return j.H.useContext(D)},Ie.useDebugValue=function(){},Ie.useDeferredValue=function(D,ie){return j.H.useDeferredValue(D,ie)},Ie.useEffect=function(D,ie){return j.H.useEffect(D,ie)},Ie.useEffectEvent=function(D){return j.H.useEffectEvent(D)},Ie.useId=function(){return j.H.useId()},Ie.useImperativeHandle=function(D,ie,ce){return j.H.useImperativeHandle(D,ie,ce)},Ie.useInsertionEffect=function(D,ie){return j.H.useInsertionEffect(D,ie)},Ie.useLayoutEffect=function(D,ie){return j.H.useLayoutEffect(D,ie)},Ie.useMemo=function(D,ie){return j.H.useMemo(D,ie)},Ie.useOptimistic=function(D,ie){return j.H.useOptimistic(D,ie)},Ie.useReducer=function(D,ie,ce){return j.H.useReducer(D,ie,ce)},Ie.useRef=function(D){return j.H.useRef(D)},Ie.useState=function(D){return j.H.useState(D)},Ie.useSyncExternalStore=function(D,ie,ce){return j.H.useSyncExternalStore(D,ie,ce)},Ie.useTransition=function(){return j.H.useTransition()},Ie.version="19.2.6",Ie}var Yb;function Eg(){return Yb||(Yb=1,Hf.exports=hN()),Hf.exports}var E=Eg(),Ff={exports:{}},wl={},Vf={exports:{}},$f={};var Xb;function fN(){return Xb||(Xb=1,(function(e){function t(k,F){var V=k.length;k.push(F);e:for(;0<V;){var Z=V-1>>>1,W=k[Z];if(0<o(W,F))k[Z]=F,k[V]=W,V=Z;else break e}}function s(k){return k.length===0?null:k[0]}function r(k){if(k.length===0)return null;var F=k[0],V=k.pop();if(V!==F){k[0]=V;e:for(var Z=0,W=k.length,D=W>>>1;Z<D;){var ie=2*(Z+1)-1,ce=k[ie],le=ie+1,de=k[le];if(0>o(ce,V))le<W&&0>o(de,ce)?(k[Z]=de,k[le]=V,Z=le):(k[Z]=ce,k[ie]=V,Z=ie);else if(le<W&&0>o(de,V))k[Z]=de,k[le]=V,Z=le;else break e}}return F}function o(k,F){var V=k.sortIndex-F.sortIndex;return V!==0?V:k.id-F.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var d=Date,f=d.now();e.unstable_now=function(){return d.now()-f}}var m=[],h=[],_=1,v=null,b=3,y=!1,x=!1,w=!1,N=!1,A=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function M(k){for(var F=s(h);F!==null;){if(F.callback===null)r(h);else if(F.startTime<=k)r(h),F.sortIndex=F.expirationTime,t(m,F);else break;F=s(h)}}function z(k){if(w=!1,M(k),!x)if(s(m)!==null)x=!0,U||(U=!0,J());else{var F=s(h);F!==null&&q(z,F.startTime-k)}}var U=!1,j=-1,O=5,K=-1;function H(){return N?!0:!(e.unstable_now()-K<O)}function G(){if(N=!1,U){var k=e.unstable_now();K=k;var F=!0;try{e:{x=!1,w&&(w=!1,R(j),j=-1),y=!0;var V=b;try{t:{for(M(k),v=s(m);v!==null&&!(v.expirationTime>k&&H());){var Z=v.callback;if(typeof Z=="function"){v.callback=null,b=v.priorityLevel;var W=Z(v.expirationTime<=k);if(k=e.unstable_now(),typeof W=="function"){v.callback=W,M(k),F=!0;break t}v===s(m)&&r(m),M(k)}else r(m);v=s(m)}if(v!==null)F=!0;else{var D=s(h);D!==null&&q(z,D.startTime-k),F=!1}}break e}finally{v=null,b=V,y=!1}F=void 0}}finally{F?J():U=!1}}}var J;if(typeof T=="function")J=function(){T(G)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,ee=I.port2;I.port1.onmessage=G,J=function(){ee.postMessage(null)}}else J=function(){A(G,0)};function q(k,F){j=A(function(){k(e.unstable_now())},F)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(k){k.callback=null},e.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<k?Math.floor(1e3/k):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(k){switch(b){case 1:case 2:case 3:var F=3;break;default:F=b}var V=b;b=F;try{return k()}finally{b=V}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(k,F){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var V=b;b=k;try{return F()}finally{b=V}},e.unstable_scheduleCallback=function(k,F,V){var Z=e.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?Z+V:Z):V=Z,k){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=V+W,k={id:_++,callback:F,priorityLevel:k,startTime:V,expirationTime:W,sortIndex:-1},V>Z?(k.sortIndex=V,t(h,k),s(m)===null&&k===s(h)&&(w?(R(j),j=-1):w=!0,q(z,V-Z))):(k.sortIndex=W,t(m,k),x||y||(x=!0,U||(U=!0,J()))),k},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(k){var F=b;return function(){var V=b;b=F;try{return k.apply(this,arguments)}finally{b=V}}}})($f)),$f}var Zb;function mN(){return Zb||(Zb=1,Vf.exports=fN()),Vf.exports}var qf={exports:{}},Ti={};var Qb;function pN(){if(Qb)return Ti;Qb=1;var e=Eg();function t(m){var h="https://react.dev/errors/"+m;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var _=2;_<arguments.length;_++)h+="&args[]="+encodeURIComponent(arguments[_])}return"Minified React error #"+m+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var r={d:{f:s,r:function(){throw Error(t(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},o=Symbol.for("react.portal");function l(m,h,_){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:v==null?null:""+v,children:m,containerInfo:h,implementation:_}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(m,h){if(m==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Ti.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Ti.createPortal=function(m,h){var _=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return l(m,h,null,_)},Ti.flushSync=function(m){var h=d.T,_=r.p;try{if(d.T=null,r.p=2,m)return m()}finally{d.T=h,r.p=_,r.d.f()}},Ti.preconnect=function(m,h){typeof m=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(m,h))},Ti.prefetchDNS=function(m){typeof m=="string"&&r.d.D(m)},Ti.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var _=h.as,v=f(_,h.crossOrigin),b=typeof h.integrity=="string"?h.integrity:void 0,y=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;_==="style"?r.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:v,integrity:b,fetchPriority:y}):_==="script"&&r.d.X(m,{crossOrigin:v,integrity:b,fetchPriority:y,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Ti.preinitModule=function(m,h){if(typeof m=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var _=f(h.as,h.crossOrigin);r.d.M(m,{crossOrigin:_,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(m)},Ti.preload=function(m,h){if(typeof m=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var _=h.as,v=f(_,h.crossOrigin);r.d.L(m,_,{crossOrigin:v,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Ti.preloadModule=function(m,h){if(typeof m=="string")if(h){var _=f(h.as,h.crossOrigin);r.d.m(m,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:_,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(m)},Ti.requestFormReset=function(m){r.d.r(m)},Ti.unstable_batchedUpdates=function(m,h){return m(h)},Ti.useFormState=function(m,h,_){return d.H.useFormState(m,h,_)},Ti.useFormStatus=function(){return d.H.useHostTransitionStatus()},Ti.version="19.2.6",Ti}var Jb;function DS(){if(Jb)return qf.exports;Jb=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),qf.exports=pN(),qf.exports}var e1;function gN(){if(e1)return wl;e1=1;var e=mN(),t=Eg(),s=DS();function r(i){var n="https://react.dev/errors/"+i;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)n+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+i+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function l(i){var n=i,a=i;if(i.alternate)for(;n.return;)n=n.return;else{i=n;do n=i,(n.flags&4098)!==0&&(a=n.return),i=n.return;while(i)}return n.tag===3?a:null}function d(i){if(i.tag===13){var n=i.memoizedState;if(n===null&&(i=i.alternate,i!==null&&(n=i.memoizedState)),n!==null)return n.dehydrated}return null}function f(i){if(i.tag===31){var n=i.memoizedState;if(n===null&&(i=i.alternate,i!==null&&(n=i.memoizedState)),n!==null)return n.dehydrated}return null}function m(i){if(l(i)!==i)throw Error(r(188))}function h(i){var n=i.alternate;if(!n){if(n=l(i),n===null)throw Error(r(188));return n!==i?null:i}for(var a=i,c=n;;){var p=a.return;if(p===null)break;var g=p.alternate;if(g===null){if(c=p.return,c!==null){a=c;continue}break}if(p.child===g.child){for(g=p.child;g;){if(g===a)return m(p),i;if(g===c)return m(p),n;g=g.sibling}throw Error(r(188))}if(a.return!==c.return)a=p,c=g;else{for(var S=!1,C=p.child;C;){if(C===a){S=!0,a=p,c=g;break}if(C===c){S=!0,c=p,a=g;break}C=C.sibling}if(!S){for(C=g.child;C;){if(C===a){S=!0,a=g,c=p;break}if(C===c){S=!0,c=g,a=p;break}C=C.sibling}if(!S)throw Error(r(189))}}if(a.alternate!==c)throw Error(r(190))}if(a.tag!==3)throw Error(r(188));return a.stateNode.current===a?i:n}function _(i){var n=i.tag;if(n===5||n===26||n===27||n===6)return i;for(i=i.child;i!==null;){if(n=_(i),n!==null)return n;i=i.sibling}return null}var v=Object.assign,b=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),T=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),K=Symbol.for("react.activity"),H=Symbol.for("react.memo_cache_sentinel"),G=Symbol.iterator;function J(i){return i===null||typeof i!="object"?null:(i=G&&i[G]||i["@@iterator"],typeof i=="function"?i:null)}var I=Symbol.for("react.client.reference");function ee(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===I?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case w:return"Fragment";case A:return"Profiler";case N:return"StrictMode";case z:return"Suspense";case U:return"SuspenseList";case K:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case x:return"Portal";case T:return i.displayName||"Context";case R:return(i._context.displayName||"Context")+".Consumer";case M:var n=i.render;return i=i.displayName,i||(i=n.displayName||n.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case j:return n=i.displayName||null,n!==null?n:ee(i.type)||"Memo";case O:n=i._payload,i=i._init;try{return ee(i(n))}catch{}}return null}var q=Array.isArray,k=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V={pending:!1,data:null,method:null,action:null},Z=[],W=-1;function D(i){return{current:i}}function ie(i){0>W||(i.current=Z[W],Z[W]=null,W--)}function ce(i,n){W++,Z[W]=i.current,i.current=n}var le=D(null),de=D(null),ge=D(null),Se=D(null);function Be(i,n){switch(ce(ge,n),ce(de,i),ce(le,null),n.nodeType){case 9:case 11:i=(i=n.documentElement)&&(i=i.namespaceURI)?pb(i):0;break;default:if(i=n.tagName,n=n.namespaceURI)n=pb(n),i=gb(n,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}ie(le),ce(le,i)}function Ee(){ie(le),ie(de),ie(ge)}function it(i){i.memoizedState!==null&&ce(Se,i);var n=le.current,a=gb(n,i.type);n!==a&&(ce(de,i),ce(le,a))}function rt(i){de.current===i&&(ie(le),ie(de)),Se.current===i&&(ie(Se),vl._currentValue=V)}var at,je;function It(i){if(at===void 0)try{throw Error()}catch(a){var n=a.stack.trim().match(/\n( *(at )?)/);at=n&&n[1]||"",je=-1<a.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+at+i+je}var Or=!1;function an(i,n){if(!i||Or)return"";Or=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(n){var ae=function(){throw Error()};if(Object.defineProperty(ae.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ae,[])}catch(te){var Q=te}Reflect.construct(i,[],ae)}else{try{ae.call()}catch(te){Q=te}i.call(ae.prototype)}}else{try{throw Error()}catch(te){Q=te}(ae=i())&&typeof ae.catch=="function"&&ae.catch(function(){})}}catch(te){if(te&&Q&&typeof te.stack=="string")return[te.stack,Q.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=c.DetermineComponentFrameRoot(),S=g[0],C=g[1];if(S&&C){var L=S.split(`
|
|
4
|
-
`),X=C.split(`
|
|
5
|
-
`);for(p=c=0;c<L.length&&!L[c].includes("DetermineComponentFrameRoot");)c++;for(;p<X.length&&!X[p].includes("DetermineComponentFrameRoot");)p++;if(c===L.length||p===X.length)for(c=L.length-1,p=X.length-1;1<=c&&0<=p&&L[c]!==X[p];)p--;for(;1<=c&&0<=p;c--,p--)if(L[c]!==X[p]){if(c!==1||p!==1)do if(c--,p--,0>p||L[c]!==X[p]){var se=`
|
|
6
|
-
`+L[c].replace(" at new "," at ");return i.displayName&&se.includes("<anonymous>")&&(se=se.replace("<anonymous>",i.displayName)),se}while(1<=c&&0<=p);break}}}finally{Or=!1,Error.prepareStackTrace=a}return(a=i?i.displayName||i.name:"")?It(a):""}function ya(i,n){switch(i.tag){case 26:case 27:case 5:return It(i.type);case 16:return It("Lazy");case 13:return i.child!==n&&n!==null?It("Suspense Fallback"):It("Suspense");case 19:return It("SuspenseList");case 0:case 15:return an(i.type,!1);case 11:return an(i.type.render,!1);case 1:return an(i.type,!0);case 31:return It("Activity");default:return""}}function Lr(i){try{var n="",a=null;do n+=ya(i,a),a=i,i=i.return;while(i);return n}catch(c){return`
|
|
7
|
-
Error generating stack: `+c.message+`
|
|
8
|
-
`+c.stack}}var jr=Object.prototype.hasOwnProperty,Hn=e.unstable_scheduleCallback,on=e.unstable_cancelCallback,No=e.unstable_shouldYield,xa=e.unstable_requestPaint,At=e.unstable_now,ln=e.unstable_getCurrentPriorityLevel,pi=e.unstable_ImmediatePriority,cn=e.unstable_UserBlockingPriority,un=e.unstable_NormalPriority,Sa=e.unstable_LowPriority,Fn=e.unstable_IdlePriority,ko=e.log,wa=e.unstable_setDisableYieldValue,dn=null,li=null;function cs(i){if(typeof ko=="function"&&wa(i),li&&typeof li.setStrictMode=="function")try{li.setStrictMode(dn,i)}catch{}}var gi=Math.clz32?Math.clz32:Ea,To=Math.log,Br=Math.LN2;function Ea(i){return i>>>=0,i===0?32:31-(To(i)/Br|0)|0}var et=256,As=262144,Wi=4194304;function Ci(i){var n=i&42;if(n!==0)return n;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function B(i,n,a){var c=i.pendingLanes;if(c===0)return 0;var p=0,g=i.suspendedLanes,S=i.pingedLanes;i=i.warmLanes;var C=c&134217727;return C!==0?(c=C&~g,c!==0?p=Ci(c):(S&=C,S!==0?p=Ci(S):a||(a=C&~i,a!==0&&(p=Ci(a))))):(C=c&~g,C!==0?p=Ci(C):S!==0?p=Ci(S):a||(a=c&~i,a!==0&&(p=Ci(a)))),p===0?0:n!==0&&n!==p&&(n&g)===0&&(g=p&-p,a=n&-n,g>=a||g===32&&(a&4194048)!==0)?n:p}function ne(i,n){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&n)===0}function _e(i,n){switch(i){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 ze(){var i=Wi;return Wi<<=1,(Wi&62914560)===0&&(Wi=4194304),i}function St(i){for(var n=[],a=0;31>a;a++)n.push(i);return n}function _t(i,n){i.pendingLanes|=n,n!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function ke(i,n,a,c,p,g){var S=i.pendingLanes;i.pendingLanes=a,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=a,i.entangledLanes&=a,i.errorRecoveryDisabledLanes&=a,i.shellSuspendCounter=0;var C=i.entanglements,L=i.expirationTimes,X=i.hiddenUpdates;for(a=S&~a;0<a;){var se=31-gi(a),ae=1<<se;C[se]=0,L[se]=-1;var Q=X[se];if(Q!==null)for(X[se]=null,se=0;se<Q.length;se++){var te=Q[se];te!==null&&(te.lane&=-536870913)}a&=~ae}c!==0&&ye(i,c,0),g!==0&&p===0&&i.tag!==0&&(i.suspendedLanes|=g&~(S&~n))}function ye(i,n,a){i.pendingLanes|=n,i.suspendedLanes&=~n;var c=31-gi(n);i.entangledLanes|=n,i.entanglements[c]=i.entanglements[c]|1073741824|a&261930}function Le(i,n){var a=i.entangledLanes|=n;for(i=i.entanglements;a;){var c=31-gi(a),p=1<<c;p&n|i[c]&n&&(i[c]|=n),a&=~p}}function Ut(i,n){var a=n&-n;return a=(a&42)!==0?1:kt(a),(a&(i.suspendedLanes|n))!==0?0:a}function kt(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function hn(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function Ca(){var i=F.p;return i!==0?i:(i=window.event,i===void 0?32:Ib(i.type))}function Na(i,n){var a=F.p;try{return F.p=i,n()}finally{F.p=a}}var zs=Math.random().toString(36).slice(2),Ht="__reactFiber$"+zs,Ni="__reactProps$"+zs,Vn="__reactContainer$"+zs,Mo="__reactEvents$"+zs,vc="__reactListeners$"+zs,ka="__reactHandles$"+zs,bc="__reactResources$"+zs,zr="__reactMarker$"+zs;function Ao(i){delete i[Ht],delete i[Ni],delete i[Mo],delete i[vc],delete i[ka]}function Ai(i){var n=i[Ht];if(n)return n;for(var a=i.parentNode;a;){if(n=a[Vn]||a[Ht]){if(a=n.alternate,n.child!==null||a!==null&&a.child!==null)for(i=wb(i);i!==null;){if(a=i[Ht])return a;i=wb(i)}return n}i=a,a=i.parentNode}return null}function fn(i){if(i=i[Ht]||i[Vn]){var n=i.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return i}return null}function $n(i){var n=i.tag;if(n===5||n===26||n===27||n===6)return i.stateNode;throw Error(r(33))}function qn(i){var n=i[bc];return n||(n=i[bc]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Kt(i){i[zr]=!0}var yc=new Set,Pr={};function mn(i,n){ue(i,n),ue(i+"Capture",n)}function ue(i,n){for(Pr[i]=n,i=0;i<n.length;i++)yc.add(n[i])}var Ae=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]*$"),Ge={},lt={};function Ft(i){return jr.call(lt,i)?!0:jr.call(Ge,i)?!1:Ae.test(i)?lt[i]=!0:(Ge[i]=!0,!1)}function ki(i,n,a){if(Ft(n))if(a===null)i.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":i.removeAttribute(n);return;case"boolean":var c=n.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){i.removeAttribute(n);return}}i.setAttribute(n,""+a)}}function Yi(i,n,a){if(a===null)i.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(n);return}i.setAttribute(n,""+a)}}function zi(i,n,a,c){if(c===null)i.removeAttribute(a);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(a);return}i.setAttributeNS(n,a,""+c)}}function xt(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Xi(i){var n=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function xc(i,n,a){var c=Object.getOwnPropertyDescriptor(i.constructor.prototype,n);if(!i.hasOwnProperty(n)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var p=c.get,g=c.set;return Object.defineProperty(i,n,{configurable:!0,get:function(){return p.call(this)},set:function(S){a=""+S,g.call(this,S)}}),Object.defineProperty(i,n,{enumerable:c.enumerable}),{getValue:function(){return a},setValue:function(S){a=""+S},stopTracking:function(){i._valueTracker=null,delete i[n]}}}}function Ta(i){if(!i._valueTracker){var n=Xi(i)?"checked":"value";i._valueTracker=xc(i,n,""+i[n])}}function Ro(i){if(!i)return!1;var n=i._valueTracker;if(!n)return!0;var a=n.getValue(),c="";return i&&(c=Xi(i)?i.checked?"true":"false":i.value),i=c,i!==a?(n.setValue(i),!0):!1}function Ma(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var Pd=/[\n"\\]/g;function Pi(i){return i.replace(Pd,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Do(i,n,a,c,p,g,S,C){i.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?i.type=S:i.removeAttribute("type"),n!=null?S==="number"?(n===0&&i.value===""||i.value!=n)&&(i.value=""+xt(n)):i.value!==""+xt(n)&&(i.value=""+xt(n)):S!=="submit"&&S!=="reset"||i.removeAttribute("value"),n!=null?Aa(i,S,xt(n)):a!=null?Aa(i,S,xt(a)):c!=null&&i.removeAttribute("value"),p==null&&g!=null&&(i.defaultChecked=!!g),p!=null&&(i.checked=p&&typeof p!="function"&&typeof p!="symbol"),C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?i.name=""+xt(C):i.removeAttribute("name")}function Ir(i,n,a,c,p,g,S,C){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(i.type=g),n!=null||a!=null){if(!(g!=="submit"&&g!=="reset"||n!=null)){Ta(i);return}a=a!=null?""+xt(a):"",n=n!=null?""+xt(n):a,C||n===i.value||(i.value=n),i.defaultValue=n}c=c??p,c=typeof c!="function"&&typeof c!="symbol"&&!!c,i.checked=C?i.checked:!!c,i.defaultChecked=!!c,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(i.name=S),Ta(i)}function Aa(i,n,a){n==="number"&&Ma(i.ownerDocument)===i||i.defaultValue===""+a||(i.defaultValue=""+a)}function _i(i,n,a,c){if(i=i.options,n){n={};for(var p=0;p<a.length;p++)n["$"+a[p]]=!0;for(a=0;a<i.length;a++)p=n.hasOwnProperty("$"+i[a].value),i[a].selected!==p&&(i[a].selected=p),p&&c&&(i[a].defaultSelected=!0)}else{for(a=""+xt(a),n=null,p=0;p<i.length;p++){if(i[p].value===a){i[p].selected=!0,c&&(i[p].defaultSelected=!0);return}n!==null||i[p].disabled||(n=i[p])}n!==null&&(n.selected=!0)}}function Sc(i,n,a){if(n!=null&&(n=""+xt(n),n!==i.value&&(i.value=n),a==null)){i.defaultValue!==n&&(i.defaultValue=n);return}i.defaultValue=a!=null?""+xt(a):""}function Ra(i,n,a,c){if(n==null){if(c!=null){if(a!=null)throw Error(r(92));if(q(c)){if(1<c.length)throw Error(r(93));c=c[0]}a=c}a==null&&(a=""),n=a}a=xt(n),i.defaultValue=a,c=i.textContent,c===a&&c!==""&&c!==null&&(i.value=c),Ta(i)}function Oe(i,n){if(n){var a=i.firstChild;if(a&&a===i.lastChild&&a.nodeType===3){a.nodeValue=n;return}}i.textContent=n}var wc=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 Gt(i,n,a){var c=n.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?c?i.setProperty(n,""):n==="float"?i.cssFloat="":i[n]="":c?i.setProperty(n,a):typeof a!="number"||a===0||wc.has(n)?n==="float"?i.cssFloat=a:i[n]=(""+a).trim():i[n]=a+"px"}function ct(i,n,a){if(n!=null&&typeof n!="object")throw Error(r(62));if(i=i.style,a!=null){for(var c in a)!a.hasOwnProperty(c)||n!=null&&n.hasOwnProperty(c)||(c.indexOf("--")===0?i.setProperty(c,""):c==="float"?i.cssFloat="":i[c]="");for(var p in n)c=n[p],n.hasOwnProperty(p)&&a[p]!==c&&Gt(i,p,c)}else for(var g in n)n.hasOwnProperty(g)&&Gt(i,g,n[g])}function Kn(i){if(i.indexOf("-")===-1)return!1;switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var pn=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"]]),Oo=/^[\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 Gn(i){return Oo.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function me(){}var Te=null;function Ue(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Xe=null,Rt=null;function us(i){var n=fn(i);if(n&&(i=n.stateNode)){var a=i[Ni]||null;e:switch(i=n.stateNode,n.type){case"input":if(Do(i,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),n=a.name,a.type==="radio"&&n!=null){for(a=i;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Pi(""+n)+'"][type="radio"]'),n=0;n<a.length;n++){var c=a[n];if(c!==i&&c.form===i.form){var p=c[Ni]||null;if(!p)throw Error(r(90));Do(c,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(n=0;n<a.length;n++)c=a[n],c.form===i.form&&Ro(c)}break e;case"textarea":Sc(i,a.value,a.defaultValue);break e;case"select":n=a.value,n!=null&&_i(i,!!a.multiple,n,!1)}}}var Lo=!1;function Ec(i,n,a){if(Lo)return i(n,a);Lo=!0;try{var c=i(n);return c}finally{if(Lo=!1,(Xe!==null||Rt!==null)&&(du(),Xe&&(n=Xe,i=Rt,Rt=Xe=null,us(n),i)))for(n=0;n<i.length;n++)us(i[n])}}function jo(i,n){var a=i.stateNode;if(a===null)return null;var c=a[Ni]||null;if(c===null)return null;a=c[n];e:switch(n){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)||(i=i.type,c=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!c;break e;default:i=!1}if(i)return null;if(a&&typeof a!="function")throw Error(r(231,n,typeof a));return a}var gn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Id=!1;if(gn)try{var Bo={};Object.defineProperty(Bo,"passive",{get:function(){Id=!0}}),window.addEventListener("test",Bo,Bo),window.removeEventListener("test",Bo,Bo)}catch{Id=!1}var Wn=null,Ud=null,Cc=null;function g0(){if(Cc)return Cc;var i,n=Ud,a=n.length,c,p="value"in Wn?Wn.value:Wn.textContent,g=p.length;for(i=0;i<a&&n[i]===p[i];i++);var S=a-i;for(c=1;c<=S&&n[a-c]===p[g-c];c++);return Cc=p.slice(i,1<c?1-c:void 0)}function Nc(i){var n=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&n===13&&(i=13)):i=n,i===10&&(i=13),32<=i||i===13?i:0}function kc(){return!0}function _0(){return!1}function Ii(i){function n(a,c,p,g,S){this._reactName=a,this._targetInst=p,this.type=c,this.nativeEvent=g,this.target=S,this.currentTarget=null;for(var C in i)i.hasOwnProperty(C)&&(a=i[C],this[C]=a?a(g):g[C]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?kc:_0,this.isPropagationStopped=_0,this}return v(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=kc)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=kc)},persist:function(){},isPersistent:kc}),n}var Ur={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Tc=Ii(Ur),zo=v({},Ur,{view:0,detail:0}),oC=Ii(zo),Hd,Fd,Po,Mc=v({},zo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$d,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Po&&(Po&&i.type==="mousemove"?(Hd=i.screenX-Po.screenX,Fd=i.screenY-Po.screenY):Fd=Hd=0,Po=i),Hd)},movementY:function(i){return"movementY"in i?i.movementY:Fd}}),v0=Ii(Mc),lC=v({},Mc,{dataTransfer:0}),cC=Ii(lC),uC=v({},zo,{relatedTarget:0}),Vd=Ii(uC),dC=v({},Ur,{animationName:0,elapsedTime:0,pseudoElement:0}),hC=Ii(dC),fC=v({},Ur,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),mC=Ii(fC),pC=v({},Ur,{data:0}),b0=Ii(pC),gC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},_C={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},vC={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function bC(i){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(i):(i=vC[i])?!!n[i]:!1}function $d(){return bC}var yC=v({},zo,{key:function(i){if(i.key){var n=gC[i.key]||i.key;if(n!=="Unidentified")return n}return i.type==="keypress"?(i=Nc(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?_C[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$d,charCode:function(i){return i.type==="keypress"?Nc(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Nc(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),xC=Ii(yC),SC=v({},Mc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),y0=Ii(SC),wC=v({},zo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$d}),EC=Ii(wC),CC=v({},Ur,{propertyName:0,elapsedTime:0,pseudoElement:0}),NC=Ii(CC),kC=v({},Mc,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),TC=Ii(kC),MC=v({},Ur,{newState:0,oldState:0}),AC=Ii(MC),RC=[9,13,27,32],qd=gn&&"CompositionEvent"in window,Io=null;gn&&"documentMode"in document&&(Io=document.documentMode);var DC=gn&&"TextEvent"in window&&!Io,x0=gn&&(!qd||Io&&8<Io&&11>=Io),S0=" ",w0=!1;function E0(i,n){switch(i){case"keyup":return RC.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function C0(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Da=!1;function OC(i,n){switch(i){case"compositionend":return C0(n);case"keypress":return n.which!==32?null:(w0=!0,S0);case"textInput":return i=n.data,i===S0&&w0?null:i;default:return null}}function LC(i,n){if(Da)return i==="compositionend"||!qd&&E0(i,n)?(i=g0(),Cc=Ud=Wn=null,Da=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return x0&&n.locale!=="ko"?null:n.data;default:return null}}var jC={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 N0(i){var n=i&&i.nodeName&&i.nodeName.toLowerCase();return n==="input"?!!jC[i.type]:n==="textarea"}function k0(i,n,a,c){Xe?Rt?Rt.push(c):Rt=[c]:Xe=c,n=vu(n,"onChange"),0<n.length&&(a=new Tc("onChange","change",null,a,c),i.push({event:a,listeners:n}))}var Uo=null,Ho=null;function BC(i){cb(i,0)}function Ac(i){var n=$n(i);if(Ro(n))return i}function T0(i,n){if(i==="change")return n}var M0=!1;if(gn){var Kd;if(gn){var Gd="oninput"in document;if(!Gd){var A0=document.createElement("div");A0.setAttribute("oninput","return;"),Gd=typeof A0.oninput=="function"}Kd=Gd}else Kd=!1;M0=Kd&&(!document.documentMode||9<document.documentMode)}function R0(){Uo&&(Uo.detachEvent("onpropertychange",D0),Ho=Uo=null)}function D0(i){if(i.propertyName==="value"&&Ac(Ho)){var n=[];k0(n,Ho,i,Ue(i)),Ec(BC,n)}}function zC(i,n,a){i==="focusin"?(R0(),Uo=n,Ho=a,Uo.attachEvent("onpropertychange",D0)):i==="focusout"&&R0()}function PC(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Ac(Ho)}function IC(i,n){if(i==="click")return Ac(n)}function UC(i,n){if(i==="input"||i==="change")return Ac(n)}function HC(i,n){return i===n&&(i!==0||1/i===1/n)||i!==i&&n!==n}var Zi=typeof Object.is=="function"?Object.is:HC;function Fo(i,n){if(Zi(i,n))return!0;if(typeof i!="object"||i===null||typeof n!="object"||n===null)return!1;var a=Object.keys(i),c=Object.keys(n);if(a.length!==c.length)return!1;for(c=0;c<a.length;c++){var p=a[c];if(!jr.call(n,p)||!Zi(i[p],n[p]))return!1}return!0}function O0(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function L0(i,n){var a=O0(i);i=0;for(var c;a;){if(a.nodeType===3){if(c=i+a.textContent.length,i<=n&&c>=n)return{node:a,offset:n-i};i=c}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=O0(a)}}function j0(i,n){return i&&n?i===n?!0:i&&i.nodeType===3?!1:n&&n.nodeType===3?j0(i,n.parentNode):"contains"in i?i.contains(n):i.compareDocumentPosition?!!(i.compareDocumentPosition(n)&16):!1:!1}function B0(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var n=Ma(i.document);n instanceof i.HTMLIFrameElement;){try{var a=typeof n.contentWindow.location.href=="string"}catch{a=!1}if(a)i=n.contentWindow;else break;n=Ma(i.document)}return n}function Wd(i){var n=i&&i.nodeName&&i.nodeName.toLowerCase();return n&&(n==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||n==="textarea"||i.contentEditable==="true")}var FC=gn&&"documentMode"in document&&11>=document.documentMode,Oa=null,Yd=null,Vo=null,Xd=!1;function z0(i,n,a){var c=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Xd||Oa==null||Oa!==Ma(c)||(c=Oa,"selectionStart"in c&&Wd(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}),Vo&&Fo(Vo,c)||(Vo=c,c=vu(Yd,"onSelect"),0<c.length&&(n=new Tc("onSelect","select",null,n,a),i.push({event:n,listeners:c}),n.target=Oa)))}function Hr(i,n){var a={};return a[i.toLowerCase()]=n.toLowerCase(),a["Webkit"+i]="webkit"+n,a["Moz"+i]="moz"+n,a}var La={animationend:Hr("Animation","AnimationEnd"),animationiteration:Hr("Animation","AnimationIteration"),animationstart:Hr("Animation","AnimationStart"),transitionrun:Hr("Transition","TransitionRun"),transitionstart:Hr("Transition","TransitionStart"),transitioncancel:Hr("Transition","TransitionCancel"),transitionend:Hr("Transition","TransitionEnd")},Zd={},P0={};gn&&(P0=document.createElement("div").style,"AnimationEvent"in window||(delete La.animationend.animation,delete La.animationiteration.animation,delete La.animationstart.animation),"TransitionEvent"in window||delete La.transitionend.transition);function Fr(i){if(Zd[i])return Zd[i];if(!La[i])return i;var n=La[i],a;for(a in n)if(n.hasOwnProperty(a)&&a in P0)return Zd[i]=n[a];return i}var I0=Fr("animationend"),U0=Fr("animationiteration"),H0=Fr("animationstart"),VC=Fr("transitionrun"),$C=Fr("transitionstart"),qC=Fr("transitioncancel"),F0=Fr("transitionend"),V0=new Map,Qd="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(" ");Qd.push("scrollEnd");function Rs(i,n){V0.set(i,n),mn(n,[i])}var Rc=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},ds=[],ja=0,Jd=0;function Dc(){for(var i=ja,n=Jd=ja=0;n<i;){var a=ds[n];ds[n++]=null;var c=ds[n];ds[n++]=null;var p=ds[n];ds[n++]=null;var g=ds[n];if(ds[n++]=null,c!==null&&p!==null){var S=c.pending;S===null?p.next=p:(p.next=S.next,S.next=p),c.pending=p}g!==0&&$0(a,p,g)}}function Oc(i,n,a,c){ds[ja++]=i,ds[ja++]=n,ds[ja++]=a,ds[ja++]=c,Jd|=c,i.lanes|=c,i=i.alternate,i!==null&&(i.lanes|=c)}function eh(i,n,a,c){return Oc(i,n,a,c),Lc(i)}function Vr(i,n){return Oc(i,null,null,n),Lc(i)}function $0(i,n,a){i.lanes|=a;var c=i.alternate;c!==null&&(c.lanes|=a);for(var p=!1,g=i.return;g!==null;)g.childLanes|=a,c=g.alternate,c!==null&&(c.childLanes|=a),g.tag===22&&(i=g.stateNode,i===null||i._visibility&1||(p=!0)),i=g,g=g.return;return i.tag===3?(g=i.stateNode,p&&n!==null&&(p=31-gi(a),i=g.hiddenUpdates,c=i[p],c===null?i[p]=[n]:c.push(n),n.lane=a|536870912),g):null}function Lc(i){if(50<dl)throw dl=0,uf=null,Error(r(185));for(var n=i.return;n!==null;)i=n,n=i.return;return i.tag===3?i.stateNode:null}var Ba={};function KC(i,n,a,c){this.tag=i,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,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 Qi(i,n,a,c){return new KC(i,n,a,c)}function th(i){return i=i.prototype,!(!i||!i.isReactComponent)}function _n(i,n){var a=i.alternate;return a===null?(a=Qi(i.tag,n,i.key,i.mode),a.elementType=i.elementType,a.type=i.type,a.stateNode=i.stateNode,a.alternate=i,i.alternate=a):(a.pendingProps=n,a.type=i.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=i.flags&65011712,a.childLanes=i.childLanes,a.lanes=i.lanes,a.child=i.child,a.memoizedProps=i.memoizedProps,a.memoizedState=i.memoizedState,a.updateQueue=i.updateQueue,n=i.dependencies,a.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},a.sibling=i.sibling,a.index=i.index,a.ref=i.ref,a.refCleanup=i.refCleanup,a}function q0(i,n){i.flags&=65011714;var a=i.alternate;return a===null?(i.childLanes=0,i.lanes=n,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=a.childLanes,i.lanes=a.lanes,i.child=a.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=a.memoizedProps,i.memoizedState=a.memoizedState,i.updateQueue=a.updateQueue,i.type=a.type,n=a.dependencies,i.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),i}function jc(i,n,a,c,p,g){var S=0;if(c=i,typeof i=="function")th(i)&&(S=1);else if(typeof i=="string")S=Z3(i,a,le.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case K:return i=Qi(31,a,n,p),i.elementType=K,i.lanes=g,i;case w:return $r(a.children,p,g,n);case N:S=8,p|=24;break;case A:return i=Qi(12,a,n,p|2),i.elementType=A,i.lanes=g,i;case z:return i=Qi(13,a,n,p),i.elementType=z,i.lanes=g,i;case U:return i=Qi(19,a,n,p),i.elementType=U,i.lanes=g,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case T:S=10;break e;case R:S=9;break e;case M:S=11;break e;case j:S=14;break e;case O:S=16,c=null;break e}S=29,a=Error(r(130,i===null?"null":typeof i,"")),c=null}return n=Qi(S,a,n,p),n.elementType=i,n.type=c,n.lanes=g,n}function $r(i,n,a,c){return i=Qi(7,i,c,n),i.lanes=a,i}function ih(i,n,a){return i=Qi(6,i,null,n),i.lanes=a,i}function K0(i){var n=Qi(18,null,null,0);return n.stateNode=i,n}function sh(i,n,a){return n=Qi(4,i.children!==null?i.children:[],i.key,n),n.lanes=a,n.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},n}var G0=new WeakMap;function hs(i,n){if(typeof i=="object"&&i!==null){var a=G0.get(i);return a!==void 0?a:(n={value:i,source:n,stack:Lr(n)},G0.set(i,n),n)}return{value:i,source:n,stack:Lr(n)}}var za=[],Pa=0,Bc=null,$o=0,fs=[],ms=0,Yn=null,Ps=1,Is="";function vn(i,n){za[Pa++]=$o,za[Pa++]=Bc,Bc=i,$o=n}function W0(i,n,a){fs[ms++]=Ps,fs[ms++]=Is,fs[ms++]=Yn,Yn=i;var c=Ps;i=Is;var p=32-gi(c)-1;c&=~(1<<p),a+=1;var g=32-gi(n)+p;if(30<g){var S=p-p%5;g=(c&(1<<S)-1).toString(32),c>>=S,p-=S,Ps=1<<32-gi(n)+p|a<<p|c,Is=g+i}else Ps=1<<g|a<<p|c,Is=i}function nh(i){i.return!==null&&(vn(i,1),W0(i,1,0))}function rh(i){for(;i===Bc;)Bc=za[--Pa],za[Pa]=null,$o=za[--Pa],za[Pa]=null;for(;i===Yn;)Yn=fs[--ms],fs[ms]=null,Is=fs[--ms],fs[ms]=null,Ps=fs[--ms],fs[ms]=null}function Y0(i,n){fs[ms++]=Ps,fs[ms++]=Is,fs[ms++]=Yn,Ps=n.id,Is=n.overflow,Yn=i}var vi=null,wt=null,Je=!1,Xn=null,ps=!1,ah=Error(r(519));function Zn(i){var n=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw qo(hs(n,i)),ah}function X0(i){var n=i.stateNode,a=i.type,c=i.memoizedProps;switch(n[Ht]=i,n[Ni]=c,a){case"dialog":Ye("cancel",n),Ye("close",n);break;case"iframe":case"object":case"embed":Ye("load",n);break;case"video":case"audio":for(a=0;a<fl.length;a++)Ye(fl[a],n);break;case"source":Ye("error",n);break;case"img":case"image":case"link":Ye("error",n),Ye("load",n);break;case"details":Ye("toggle",n);break;case"input":Ye("invalid",n),Ir(n,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":Ye("invalid",n);break;case"textarea":Ye("invalid",n),Ra(n,c.value,c.defaultValue,c.children)}a=c.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||n.textContent===""+a||c.suppressHydrationWarning===!0||fb(n.textContent,a)?(c.popover!=null&&(Ye("beforetoggle",n),Ye("toggle",n)),c.onScroll!=null&&Ye("scroll",n),c.onScrollEnd!=null&&Ye("scrollend",n),c.onClick!=null&&(n.onclick=me),n=!0):n=!1,n||Zn(i,!0)}function Z0(i){for(vi=i.return;vi;)switch(vi.tag){case 5:case 31:case 13:ps=!1;return;case 27:case 3:ps=!0;return;default:vi=vi.return}}function Ia(i){if(i!==vi)return!1;if(!Je)return Z0(i),Je=!0,!1;var n=i.tag,a;if((a=n!==3&&n!==27)&&((a=n===5)&&(a=i.type,a=!(a!=="form"&&a!=="button")||Cf(i.type,i.memoizedProps)),a=!a),a&&wt&&Zn(i),Z0(i),n===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));wt=Sb(i)}else if(n===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));wt=Sb(i)}else n===27?(n=wt,dr(i.type)?(i=Af,Af=null,wt=i):wt=n):wt=vi?_s(i.stateNode.nextSibling):null;return!0}function qr(){wt=vi=null,Je=!1}function oh(){var i=Xn;return i!==null&&(Vi===null?Vi=i:Vi.push.apply(Vi,i),Xn=null),i}function qo(i){Xn===null?Xn=[i]:Xn.push(i)}var lh=D(null),Kr=null,bn=null;function Qn(i,n,a){ce(lh,n._currentValue),n._currentValue=a}function yn(i){i._currentValue=lh.current,ie(lh)}function ch(i,n,a){for(;i!==null;){var c=i.alternate;if((i.childLanes&n)!==n?(i.childLanes|=n,c!==null&&(c.childLanes|=n)):c!==null&&(c.childLanes&n)!==n&&(c.childLanes|=n),i===a)break;i=i.return}}function uh(i,n,a,c){var p=i.child;for(p!==null&&(p.return=i);p!==null;){var g=p.dependencies;if(g!==null){var S=p.child;g=g.firstContext;e:for(;g!==null;){var C=g;g=p;for(var L=0;L<n.length;L++)if(C.context===n[L]){g.lanes|=a,C=g.alternate,C!==null&&(C.lanes|=a),ch(g.return,a,i),c||(S=null);break e}g=C.next}}else if(p.tag===18){if(S=p.return,S===null)throw Error(r(341));S.lanes|=a,g=S.alternate,g!==null&&(g.lanes|=a),ch(S,a,i),S=null}else S=p.child;if(S!==null)S.return=p;else for(S=p;S!==null;){if(S===i){S=null;break}if(p=S.sibling,p!==null){p.return=S.return,S=p;break}S=S.return}p=S}}function Ua(i,n,a,c){i=null;for(var p=n,g=!1;p!==null;){if(!g){if((p.flags&524288)!==0)g=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var S=p.alternate;if(S===null)throw Error(r(387));if(S=S.memoizedProps,S!==null){var C=p.type;Zi(p.pendingProps.value,S.value)||(i!==null?i.push(C):i=[C])}}else if(p===Se.current){if(S=p.alternate,S===null)throw Error(r(387));S.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(i!==null?i.push(vl):i=[vl])}p=p.return}i!==null&&uh(n,i,a,c),n.flags|=262144}function zc(i){for(i=i.firstContext;i!==null;){if(!Zi(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Gr(i){Kr=i,bn=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function bi(i){return Q0(Kr,i)}function Pc(i,n){return Kr===null&&Gr(i),Q0(i,n)}function Q0(i,n){var a=n._currentValue;if(n={context:n,memoizedValue:a,next:null},bn===null){if(i===null)throw Error(r(308));bn=n,i.dependencies={lanes:0,firstContext:n},i.flags|=524288}else bn=bn.next=n;return a}var GC=typeof AbortController<"u"?AbortController:function(){var i=[],n=this.signal={aborted:!1,addEventListener:function(a,c){i.push(c)}};this.abort=function(){n.aborted=!0,i.forEach(function(a){return a()})}},WC=e.unstable_scheduleCallback,YC=e.unstable_NormalPriority,Wt={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function dh(){return{controller:new GC,data:new Map,refCount:0}}function Ko(i){i.refCount--,i.refCount===0&&WC(YC,function(){i.controller.abort()})}var Go=null,hh=0,Ha=0,Fa=null;function XC(i,n){if(Go===null){var a=Go=[];hh=0,Ha=gf(),Fa={status:"pending",value:void 0,then:function(c){a.push(c)}}}return hh++,n.then(J0,J0),n}function J0(){if(--hh===0&&Go!==null){Fa!==null&&(Fa.status="fulfilled");var i=Go;Go=null,Ha=0,Fa=null;for(var n=0;n<i.length;n++)(0,i[n])()}}function ZC(i,n){var a=[],c={status:"pending",value:null,reason:null,then:function(p){a.push(p)}};return i.then(function(){c.status="fulfilled",c.value=n;for(var p=0;p<a.length;p++)(0,a[p])(n)},function(p){for(c.status="rejected",c.reason=p,p=0;p<a.length;p++)(0,a[p])(void 0)}),c}var e_=k.S;k.S=function(i,n){zv=At(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&XC(i,n),e_!==null&&e_(i,n)};var Wr=D(null);function fh(){var i=Wr.current;return i!==null?i:vt.pooledCache}function Ic(i,n){n===null?ce(Wr,Wr.current):ce(Wr,n.pool)}function t_(){var i=fh();return i===null?null:{parent:Wt._currentValue,pool:i}}var Va=Error(r(460)),mh=Error(r(474)),Uc=Error(r(542)),Hc={then:function(){}};function i_(i){return i=i.status,i==="fulfilled"||i==="rejected"}function s_(i,n,a){switch(a=i[a],a===void 0?i.push(n):a!==n&&(n.then(me,me),n=a),n.status){case"fulfilled":return n.value;case"rejected":throw i=n.reason,r_(i),i;default:if(typeof n.status=="string")n.then(me,me);else{if(i=vt,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=n,i.status="pending",i.then(function(c){if(n.status==="pending"){var p=n;p.status="fulfilled",p.value=c}},function(c){if(n.status==="pending"){var p=n;p.status="rejected",p.reason=c}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw i=n.reason,r_(i),i}throw Xr=n,Va}}function Yr(i){try{var n=i._init;return n(i._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Xr=a,Va):a}}var Xr=null;function n_(){if(Xr===null)throw Error(r(459));var i=Xr;return Xr=null,i}function r_(i){if(i===Va||i===Uc)throw Error(r(483))}var $a=null,Wo=0;function Fc(i){var n=Wo;return Wo+=1,$a===null&&($a=[]),s_($a,i,n)}function Yo(i,n){n=n.props.ref,i.ref=n!==void 0?n:null}function Vc(i,n){throw n.$$typeof===b?Error(r(525)):(i=Object.prototype.toString.call(n),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":i)))}function a_(i){function n($,P){if(i){var Y=$.deletions;Y===null?($.deletions=[P],$.flags|=16):Y.push(P)}}function a($,P){if(!i)return null;for(;P!==null;)n($,P),P=P.sibling;return null}function c($){for(var P=new Map;$!==null;)$.key!==null?P.set($.key,$):P.set($.index,$),$=$.sibling;return P}function p($,P){return $=_n($,P),$.index=0,$.sibling=null,$}function g($,P,Y){return $.index=Y,i?(Y=$.alternate,Y!==null?(Y=Y.index,Y<P?($.flags|=67108866,P):Y):($.flags|=67108866,P)):($.flags|=1048576,P)}function S($){return i&&$.alternate===null&&($.flags|=67108866),$}function C($,P,Y,re){return P===null||P.tag!==6?(P=ih(Y,$.mode,re),P.return=$,P):(P=p(P,Y),P.return=$,P)}function L($,P,Y,re){var Re=Y.type;return Re===w?se($,P,Y.props.children,re,Y.key):P!==null&&(P.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===O&&Yr(Re)===P.type)?(P=p(P,Y.props),Yo(P,Y),P.return=$,P):(P=jc(Y.type,Y.key,Y.props,null,$.mode,re),Yo(P,Y),P.return=$,P)}function X($,P,Y,re){return P===null||P.tag!==4||P.stateNode.containerInfo!==Y.containerInfo||P.stateNode.implementation!==Y.implementation?(P=sh(Y,$.mode,re),P.return=$,P):(P=p(P,Y.children||[]),P.return=$,P)}function se($,P,Y,re,Re){return P===null||P.tag!==7?(P=$r(Y,$.mode,re,Re),P.return=$,P):(P=p(P,Y),P.return=$,P)}function ae($,P,Y){if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return P=ih(""+P,$.mode,Y),P.return=$,P;if(typeof P=="object"&&P!==null){switch(P.$$typeof){case y:return Y=jc(P.type,P.key,P.props,null,$.mode,Y),Yo(Y,P),Y.return=$,Y;case x:return P=sh(P,$.mode,Y),P.return=$,P;case O:return P=Yr(P),ae($,P,Y)}if(q(P)||J(P))return P=$r(P,$.mode,Y,null),P.return=$,P;if(typeof P.then=="function")return ae($,Fc(P),Y);if(P.$$typeof===T)return ae($,Pc($,P),Y);Vc($,P)}return null}function Q($,P,Y,re){var Re=P!==null?P.key:null;if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Re!==null?null:C($,P,""+Y,re);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case y:return Y.key===Re?L($,P,Y,re):null;case x:return Y.key===Re?X($,P,Y,re):null;case O:return Y=Yr(Y),Q($,P,Y,re)}if(q(Y)||J(Y))return Re!==null?null:se($,P,Y,re,null);if(typeof Y.then=="function")return Q($,P,Fc(Y),re);if(Y.$$typeof===T)return Q($,P,Pc($,Y),re);Vc($,Y)}return null}function te($,P,Y,re,Re){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return $=$.get(Y)||null,C(P,$,""+re,Re);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case y:return $=$.get(re.key===null?Y:re.key)||null,L(P,$,re,Re);case x:return $=$.get(re.key===null?Y:re.key)||null,X(P,$,re,Re);case O:return re=Yr(re),te($,P,Y,re,Re)}if(q(re)||J(re))return $=$.get(Y)||null,se(P,$,re,Re,null);if(typeof re.then=="function")return te($,P,Y,Fc(re),Re);if(re.$$typeof===T)return te($,P,Y,Pc(P,re),Re);Vc(P,re)}return null}function Ce($,P,Y,re){for(var Re=null,st=null,Me=P,Fe=P=0,Qe=null;Me!==null&&Fe<Y.length;Fe++){Me.index>Fe?(Qe=Me,Me=null):Qe=Me.sibling;var nt=Q($,Me,Y[Fe],re);if(nt===null){Me===null&&(Me=Qe);break}i&&Me&&nt.alternate===null&&n($,Me),P=g(nt,P,Fe),st===null?Re=nt:st.sibling=nt,st=nt,Me=Qe}if(Fe===Y.length)return a($,Me),Je&&vn($,Fe),Re;if(Me===null){for(;Fe<Y.length;Fe++)Me=ae($,Y[Fe],re),Me!==null&&(P=g(Me,P,Fe),st===null?Re=Me:st.sibling=Me,st=Me);return Je&&vn($,Fe),Re}for(Me=c(Me);Fe<Y.length;Fe++)Qe=te(Me,$,Fe,Y[Fe],re),Qe!==null&&(i&&Qe.alternate!==null&&Me.delete(Qe.key===null?Fe:Qe.key),P=g(Qe,P,Fe),st===null?Re=Qe:st.sibling=Qe,st=Qe);return i&&Me.forEach(function(gr){return n($,gr)}),Je&&vn($,Fe),Re}function De($,P,Y,re){if(Y==null)throw Error(r(151));for(var Re=null,st=null,Me=P,Fe=P=0,Qe=null,nt=Y.next();Me!==null&&!nt.done;Fe++,nt=Y.next()){Me.index>Fe?(Qe=Me,Me=null):Qe=Me.sibling;var gr=Q($,Me,nt.value,re);if(gr===null){Me===null&&(Me=Qe);break}i&&Me&&gr.alternate===null&&n($,Me),P=g(gr,P,Fe),st===null?Re=gr:st.sibling=gr,st=gr,Me=Qe}if(nt.done)return a($,Me),Je&&vn($,Fe),Re;if(Me===null){for(;!nt.done;Fe++,nt=Y.next())nt=ae($,nt.value,re),nt!==null&&(P=g(nt,P,Fe),st===null?Re=nt:st.sibling=nt,st=nt);return Je&&vn($,Fe),Re}for(Me=c(Me);!nt.done;Fe++,nt=Y.next())nt=te(Me,$,Fe,nt.value,re),nt!==null&&(i&&nt.alternate!==null&&Me.delete(nt.key===null?Fe:nt.key),P=g(nt,P,Fe),st===null?Re=nt:st.sibling=nt,st=nt);return i&&Me.forEach(function(lN){return n($,lN)}),Je&&vn($,Fe),Re}function pt($,P,Y,re){if(typeof Y=="object"&&Y!==null&&Y.type===w&&Y.key===null&&(Y=Y.props.children),typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case y:e:{for(var Re=Y.key;P!==null;){if(P.key===Re){if(Re=Y.type,Re===w){if(P.tag===7){a($,P.sibling),re=p(P,Y.props.children),re.return=$,$=re;break e}}else if(P.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===O&&Yr(Re)===P.type){a($,P.sibling),re=p(P,Y.props),Yo(re,Y),re.return=$,$=re;break e}a($,P);break}else n($,P);P=P.sibling}Y.type===w?(re=$r(Y.props.children,$.mode,re,Y.key),re.return=$,$=re):(re=jc(Y.type,Y.key,Y.props,null,$.mode,re),Yo(re,Y),re.return=$,$=re)}return S($);case x:e:{for(Re=Y.key;P!==null;){if(P.key===Re)if(P.tag===4&&P.stateNode.containerInfo===Y.containerInfo&&P.stateNode.implementation===Y.implementation){a($,P.sibling),re=p(P,Y.children||[]),re.return=$,$=re;break e}else{a($,P);break}else n($,P);P=P.sibling}re=sh(Y,$.mode,re),re.return=$,$=re}return S($);case O:return Y=Yr(Y),pt($,P,Y,re)}if(q(Y))return Ce($,P,Y,re);if(J(Y)){if(Re=J(Y),typeof Re!="function")throw Error(r(150));return Y=Re.call(Y),De($,P,Y,re)}if(typeof Y.then=="function")return pt($,P,Fc(Y),re);if(Y.$$typeof===T)return pt($,P,Pc($,Y),re);Vc($,Y)}return typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint"?(Y=""+Y,P!==null&&P.tag===6?(a($,P.sibling),re=p(P,Y),re.return=$,$=re):(a($,P),re=ih(Y,$.mode,re),re.return=$,$=re),S($)):a($,P)}return function($,P,Y,re){try{Wo=0;var Re=pt($,P,Y,re);return $a=null,Re}catch(Me){if(Me===Va||Me===Uc)throw Me;var st=Qi(29,Me,null,$.mode);return st.lanes=re,st.return=$,st}}}var Zr=a_(!0),o_=a_(!1),Jn=!1;function ph(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function gh(i,n){i=i.updateQueue,n.updateQueue===i&&(n.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function er(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function tr(i,n,a){var c=i.updateQueue;if(c===null)return null;if(c=c.shared,(ot&2)!==0){var p=c.pending;return p===null?n.next=n:(n.next=p.next,p.next=n),c.pending=n,n=Lc(i),$0(i,null,a),n}return Oc(i,c,n,a),Lc(i)}function Xo(i,n,a){if(n=n.updateQueue,n!==null&&(n=n.shared,(a&4194048)!==0)){var c=n.lanes;c&=i.pendingLanes,a|=c,n.lanes=a,Le(i,a)}}function _h(i,n){var a=i.updateQueue,c=i.alternate;if(c!==null&&(c=c.updateQueue,a===c)){var p=null,g=null;if(a=a.firstBaseUpdate,a!==null){do{var S={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};g===null?p=g=S:g=g.next=S,a=a.next}while(a!==null);g===null?p=g=n:g=g.next=n}else p=g=n;a={baseState:c.baseState,firstBaseUpdate:p,lastBaseUpdate:g,shared:c.shared,callbacks:c.callbacks},i.updateQueue=a;return}i=a.lastBaseUpdate,i===null?a.firstBaseUpdate=n:i.next=n,a.lastBaseUpdate=n}var vh=!1;function Zo(){if(vh){var i=Fa;if(i!==null)throw i}}function Qo(i,n,a,c){vh=!1;var p=i.updateQueue;Jn=!1;var g=p.firstBaseUpdate,S=p.lastBaseUpdate,C=p.shared.pending;if(C!==null){p.shared.pending=null;var L=C,X=L.next;L.next=null,S===null?g=X:S.next=X,S=L;var se=i.alternate;se!==null&&(se=se.updateQueue,C=se.lastBaseUpdate,C!==S&&(C===null?se.firstBaseUpdate=X:C.next=X,se.lastBaseUpdate=L))}if(g!==null){var ae=p.baseState;S=0,se=X=L=null,C=g;do{var Q=C.lane&-536870913,te=Q!==C.lane;if(te?(Ze&Q)===Q:(c&Q)===Q){Q!==0&&Q===Ha&&(vh=!0),se!==null&&(se=se.next={lane:0,tag:C.tag,payload:C.payload,callback:null,next:null});e:{var Ce=i,De=C;Q=n;var pt=a;switch(De.tag){case 1:if(Ce=De.payload,typeof Ce=="function"){ae=Ce.call(pt,ae,Q);break e}ae=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=De.payload,Q=typeof Ce=="function"?Ce.call(pt,ae,Q):Ce,Q==null)break e;ae=v({},ae,Q);break e;case 2:Jn=!0}}Q=C.callback,Q!==null&&(i.flags|=64,te&&(i.flags|=8192),te=p.callbacks,te===null?p.callbacks=[Q]:te.push(Q))}else te={lane:Q,tag:C.tag,payload:C.payload,callback:C.callback,next:null},se===null?(X=se=te,L=ae):se=se.next=te,S|=Q;if(C=C.next,C===null){if(C=p.shared.pending,C===null)break;te=C,C=te.next,te.next=null,p.lastBaseUpdate=te,p.shared.pending=null}}while(!0);se===null&&(L=ae),p.baseState=L,p.firstBaseUpdate=X,p.lastBaseUpdate=se,g===null&&(p.shared.lanes=0),ar|=S,i.lanes=S,i.memoizedState=ae}}function l_(i,n){if(typeof i!="function")throw Error(r(191,i));i.call(n)}function c_(i,n){var a=i.callbacks;if(a!==null)for(i.callbacks=null,i=0;i<a.length;i++)l_(a[i],n)}var qa=D(null),$c=D(0);function u_(i,n){i=Mn,ce($c,i),ce(qa,n),Mn=i|n.baseLanes}function bh(){ce($c,Mn),ce(qa,qa.current)}function yh(){Mn=$c.current,ie(qa),ie($c)}var Ji=D(null),gs=null;function ir(i){var n=i.alternate;ce(Vt,Vt.current&1),ce(Ji,i),gs===null&&(n===null||qa.current!==null||n.memoizedState!==null)&&(gs=i)}function xh(i){ce(Vt,Vt.current),ce(Ji,i),gs===null&&(gs=i)}function d_(i){i.tag===22?(ce(Vt,Vt.current),ce(Ji,i),gs===null&&(gs=i)):sr()}function sr(){ce(Vt,Vt.current),ce(Ji,Ji.current)}function es(i){ie(Ji),gs===i&&(gs=null),ie(Vt)}var Vt=D(0);function qc(i){for(var n=i;n!==null;){if(n.tag===13){var a=n.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Tf(a)||Mf(a)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===i)break;for(;n.sibling===null;){if(n.return===null||n.return===i)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var xn=0,He=null,ft=null,Yt=null,Kc=!1,Ka=!1,Qr=!1,Gc=0,Jo=0,Ga=null,QC=0;function Lt(){throw Error(r(321))}function Sh(i,n){if(n===null)return!1;for(var a=0;a<n.length&&a<i.length;a++)if(!Zi(i[a],n[a]))return!1;return!0}function wh(i,n,a,c,p,g){return xn=g,He=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,k.H=i===null||i.memoizedState===null?W_:Ph,Qr=!1,g=a(c,p),Qr=!1,Ka&&(g=f_(n,a,c,p)),h_(i),g}function h_(i){k.H=il;var n=ft!==null&&ft.next!==null;if(xn=0,Yt=ft=He=null,Kc=!1,Jo=0,Ga=null,n)throw Error(r(300));i===null||Xt||(i=i.dependencies,i!==null&&zc(i)&&(Xt=!0))}function f_(i,n,a,c){He=i;var p=0;do{if(Ka&&(Ga=null),Jo=0,Ka=!1,25<=p)throw Error(r(301));if(p+=1,Yt=ft=null,i.updateQueue!=null){var g=i.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}k.H=Y_,g=n(a,c)}while(Ka);return g}function JC(){var i=k.H,n=i.useState()[0];return n=typeof n.then=="function"?el(n):n,i=i.useState()[0],(ft!==null?ft.memoizedState:null)!==i&&(He.flags|=1024),n}function Eh(){var i=Gc!==0;return Gc=0,i}function Ch(i,n,a){n.updateQueue=i.updateQueue,n.flags&=-2053,i.lanes&=~a}function Nh(i){if(Kc){for(i=i.memoizedState;i!==null;){var n=i.queue;n!==null&&(n.pending=null),i=i.next}Kc=!1}xn=0,Yt=ft=He=null,Ka=!1,Jo=Gc=0,Ga=null}function Ri(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Yt===null?He.memoizedState=Yt=i:Yt=Yt.next=i,Yt}function $t(){if(ft===null){var i=He.alternate;i=i!==null?i.memoizedState:null}else i=ft.next;var n=Yt===null?He.memoizedState:Yt.next;if(n!==null)Yt=n,ft=i;else{if(i===null)throw He.alternate===null?Error(r(467)):Error(r(310));ft=i,i={memoizedState:ft.memoizedState,baseState:ft.baseState,baseQueue:ft.baseQueue,queue:ft.queue,next:null},Yt===null?He.memoizedState=Yt=i:Yt=Yt.next=i}return Yt}function Wc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function el(i){var n=Jo;return Jo+=1,Ga===null&&(Ga=[]),i=s_(Ga,i,n),n=He,(Yt===null?n.memoizedState:Yt.next)===null&&(n=n.alternate,k.H=n===null||n.memoizedState===null?W_:Ph),i}function Yc(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return el(i);if(i.$$typeof===T)return bi(i)}throw Error(r(438,String(i)))}function kh(i){var n=null,a=He.updateQueue;if(a!==null&&(n=a.memoCache),n==null){var c=He.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(n={data:c.data.map(function(p){return p.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),a===null&&(a=Wc(),He.updateQueue=a),a.memoCache=n,a=n.data[n.index],a===void 0)for(a=n.data[n.index]=Array(i),c=0;c<i;c++)a[c]=H;return n.index++,a}function Sn(i,n){return typeof n=="function"?n(i):n}function Xc(i){var n=$t();return Th(n,ft,i)}function Th(i,n,a){var c=i.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=a;var p=i.baseQueue,g=c.pending;if(g!==null){if(p!==null){var S=p.next;p.next=g.next,g.next=S}n.baseQueue=p=g,c.pending=null}if(g=i.baseState,p===null)i.memoizedState=g;else{n=p.next;var C=S=null,L=null,X=n,se=!1;do{var ae=X.lane&-536870913;if(ae!==X.lane?(Ze&ae)===ae:(xn&ae)===ae){var Q=X.revertLane;if(Q===0)L!==null&&(L=L.next={lane:0,revertLane:0,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null}),ae===Ha&&(se=!0);else if((xn&Q)===Q){X=X.next,Q===Ha&&(se=!0);continue}else ae={lane:0,revertLane:X.revertLane,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},L===null?(C=L=ae,S=g):L=L.next=ae,He.lanes|=Q,ar|=Q;ae=X.action,Qr&&a(g,ae),g=X.hasEagerState?X.eagerState:a(g,ae)}else Q={lane:ae,revertLane:X.revertLane,gesture:X.gesture,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},L===null?(C=L=Q,S=g):L=L.next=Q,He.lanes|=ae,ar|=ae;X=X.next}while(X!==null&&X!==n);if(L===null?S=g:L.next=C,!Zi(g,i.memoizedState)&&(Xt=!0,se&&(a=Fa,a!==null)))throw a;i.memoizedState=g,i.baseState=S,i.baseQueue=L,c.lastRenderedState=g}return p===null&&(c.lanes=0),[i.memoizedState,c.dispatch]}function Mh(i){var n=$t(),a=n.queue;if(a===null)throw Error(r(311));a.lastRenderedReducer=i;var c=a.dispatch,p=a.pending,g=n.memoizedState;if(p!==null){a.pending=null;var S=p=p.next;do g=i(g,S.action),S=S.next;while(S!==p);Zi(g,n.memoizedState)||(Xt=!0),n.memoizedState=g,n.baseQueue===null&&(n.baseState=g),a.lastRenderedState=g}return[g,c]}function m_(i,n,a){var c=He,p=$t(),g=Je;if(g){if(a===void 0)throw Error(r(407));a=a()}else a=n();var S=!Zi((ft||p).memoizedState,a);if(S&&(p.memoizedState=a,Xt=!0),p=p.queue,Dh(__.bind(null,c,p,i),[i]),p.getSnapshot!==n||S||Yt!==null&&Yt.memoizedState.tag&1){if(c.flags|=2048,Wa(9,{destroy:void 0},g_.bind(null,c,p,a,n),null),vt===null)throw Error(r(349));g||(xn&127)!==0||p_(c,n,a)}return a}function p_(i,n,a){i.flags|=16384,i={getSnapshot:n,value:a},n=He.updateQueue,n===null?(n=Wc(),He.updateQueue=n,n.stores=[i]):(a=n.stores,a===null?n.stores=[i]:a.push(i))}function g_(i,n,a,c){n.value=a,n.getSnapshot=c,v_(n)&&b_(i)}function __(i,n,a){return a(function(){v_(n)&&b_(i)})}function v_(i){var n=i.getSnapshot;i=i.value;try{var a=n();return!Zi(i,a)}catch{return!0}}function b_(i){var n=Vr(i,2);n!==null&&$i(n,i,2)}function Ah(i){var n=Ri();if(typeof i=="function"){var a=i;if(i=a(),Qr){cs(!0);try{a()}finally{cs(!1)}}}return n.memoizedState=n.baseState=i,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sn,lastRenderedState:i},n}function y_(i,n,a,c){return i.baseState=a,Th(i,ft,typeof c=="function"?c:Sn)}function e3(i,n,a,c,p){if(Jc(i))throw Error(r(485));if(i=n.action,i!==null){var g={payload:p,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){g.listeners.push(S)}};k.T!==null?a(!0):g.isTransition=!1,c(g),a=n.pending,a===null?(g.next=n.pending=g,x_(n,g)):(g.next=a.next,n.pending=a.next=g)}}function x_(i,n){var a=n.action,c=n.payload,p=i.state;if(n.isTransition){var g=k.T,S={};k.T=S;try{var C=a(p,c),L=k.S;L!==null&&L(S,C),S_(i,n,C)}catch(X){Rh(i,n,X)}finally{g!==null&&S.types!==null&&(g.types=S.types),k.T=g}}else try{g=a(p,c),S_(i,n,g)}catch(X){Rh(i,n,X)}}function S_(i,n,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(c){w_(i,n,c)},function(c){return Rh(i,n,c)}):w_(i,n,a)}function w_(i,n,a){n.status="fulfilled",n.value=a,E_(n),i.state=a,n=i.pending,n!==null&&(a=n.next,a===n?i.pending=null:(a=a.next,n.next=a,x_(i,a)))}function Rh(i,n,a){var c=i.pending;if(i.pending=null,c!==null){c=c.next;do n.status="rejected",n.reason=a,E_(n),n=n.next;while(n!==c)}i.action=null}function E_(i){i=i.listeners;for(var n=0;n<i.length;n++)(0,i[n])()}function C_(i,n){return n}function N_(i,n){if(Je){var a=vt.formState;if(a!==null){e:{var c=He;if(Je){if(wt){t:{for(var p=wt,g=ps;p.nodeType!==8;){if(!g){p=null;break t}if(p=_s(p.nextSibling),p===null){p=null;break t}}g=p.data,p=g==="F!"||g==="F"?p:null}if(p){wt=_s(p.nextSibling),c=p.data==="F!";break e}}Zn(c)}c=!1}c&&(n=a[0])}}return a=Ri(),a.memoizedState=a.baseState=n,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:C_,lastRenderedState:n},a.queue=c,a=q_.bind(null,He,c),c.dispatch=a,c=Ah(!1),g=zh.bind(null,He,!1,c.queue),c=Ri(),p={state:n,dispatch:null,action:i,pending:null},c.queue=p,a=e3.bind(null,He,p,g,a),p.dispatch=a,c.memoizedState=i,[n,a,!1]}function k_(i){var n=$t();return T_(n,ft,i)}function T_(i,n,a){if(n=Th(i,n,C_)[0],i=Xc(Sn)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var c=el(n)}catch(S){throw S===Va?Uc:S}else c=n;n=$t();var p=n.queue,g=p.dispatch;return a!==n.memoizedState&&(He.flags|=2048,Wa(9,{destroy:void 0},t3.bind(null,p,a),null)),[c,g,i]}function t3(i,n){i.action=n}function M_(i){var n=$t(),a=ft;if(a!==null)return T_(n,a,i);$t(),n=n.memoizedState,a=$t();var c=a.queue.dispatch;return a.memoizedState=i,[n,c,!1]}function Wa(i,n,a,c){return i={tag:i,create:a,deps:c,inst:n,next:null},n=He.updateQueue,n===null&&(n=Wc(),He.updateQueue=n),a=n.lastEffect,a===null?n.lastEffect=i.next=i:(c=a.next,a.next=i,i.next=c,n.lastEffect=i),i}function A_(){return $t().memoizedState}function Zc(i,n,a,c){var p=Ri();He.flags|=i,p.memoizedState=Wa(1|n,{destroy:void 0},a,c===void 0?null:c)}function Qc(i,n,a,c){var p=$t();c=c===void 0?null:c;var g=p.memoizedState.inst;ft!==null&&c!==null&&Sh(c,ft.memoizedState.deps)?p.memoizedState=Wa(n,g,a,c):(He.flags|=i,p.memoizedState=Wa(1|n,g,a,c))}function R_(i,n){Zc(8390656,8,i,n)}function Dh(i,n){Qc(2048,8,i,n)}function i3(i){He.flags|=4;var n=He.updateQueue;if(n===null)n=Wc(),He.updateQueue=n,n.events=[i];else{var a=n.events;a===null?n.events=[i]:a.push(i)}}function D_(i){var n=$t().memoizedState;return i3({ref:n,nextImpl:i}),function(){if((ot&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}function O_(i,n){return Qc(4,2,i,n)}function L_(i,n){return Qc(4,4,i,n)}function j_(i,n){if(typeof n=="function"){i=i();var a=n(i);return function(){typeof a=="function"?a():n(null)}}if(n!=null)return i=i(),n.current=i,function(){n.current=null}}function B_(i,n,a){a=a!=null?a.concat([i]):null,Qc(4,4,j_.bind(null,n,i),a)}function Oh(){}function z_(i,n){var a=$t();n=n===void 0?null:n;var c=a.memoizedState;return n!==null&&Sh(n,c[1])?c[0]:(a.memoizedState=[i,n],i)}function P_(i,n){var a=$t();n=n===void 0?null:n;var c=a.memoizedState;if(n!==null&&Sh(n,c[1]))return c[0];if(c=i(),Qr){cs(!0);try{i()}finally{cs(!1)}}return a.memoizedState=[c,n],c}function Lh(i,n,a){return a===void 0||(xn&1073741824)!==0&&(Ze&261930)===0?i.memoizedState=n:(i.memoizedState=a,i=Iv(),He.lanes|=i,ar|=i,a)}function I_(i,n,a,c){return Zi(a,n)?a:qa.current!==null?(i=Lh(i,a,c),Zi(i,n)||(Xt=!0),i):(xn&42)===0||(xn&1073741824)!==0&&(Ze&261930)===0?(Xt=!0,i.memoizedState=a):(i=Iv(),He.lanes|=i,ar|=i,n)}function U_(i,n,a,c,p){var g=F.p;F.p=g!==0&&8>g?g:8;var S=k.T,C={};k.T=C,zh(i,!1,n,a);try{var L=p(),X=k.S;if(X!==null&&X(C,L),L!==null&&typeof L=="object"&&typeof L.then=="function"){var se=ZC(L,c);tl(i,n,se,ss(i))}else tl(i,n,c,ss(i))}catch(ae){tl(i,n,{then:function(){},status:"rejected",reason:ae},ss())}finally{F.p=g,S!==null&&C.types!==null&&(S.types=C.types),k.T=S}}function s3(){}function jh(i,n,a,c){if(i.tag!==5)throw Error(r(476));var p=H_(i).queue;U_(i,p,n,V,a===null?s3:function(){return F_(i),a(c)})}function H_(i){var n=i.memoizedState;if(n!==null)return n;n={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sn,lastRenderedState:V},next:null};var a={};return n.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sn,lastRenderedState:a},next:null},i.memoizedState=n,i=i.alternate,i!==null&&(i.memoizedState=n),n}function F_(i){var n=H_(i);n.next===null&&(n=i.alternate.memoizedState),tl(i,n.next.queue,{},ss())}function Bh(){return bi(vl)}function V_(){return $t().memoizedState}function $_(){return $t().memoizedState}function n3(i){for(var n=i.return;n!==null;){switch(n.tag){case 24:case 3:var a=ss();i=er(a);var c=tr(n,i,a);c!==null&&($i(c,n,a),Xo(c,n,a)),n={cache:dh()},i.payload=n;return}n=n.return}}function r3(i,n,a){var c=ss();a={lane:c,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Jc(i)?K_(n,a):(a=eh(i,n,a,c),a!==null&&($i(a,i,c),G_(a,n,c)))}function q_(i,n,a){var c=ss();tl(i,n,a,c)}function tl(i,n,a,c){var p={lane:c,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Jc(i))K_(n,p);else{var g=i.alternate;if(i.lanes===0&&(g===null||g.lanes===0)&&(g=n.lastRenderedReducer,g!==null))try{var S=n.lastRenderedState,C=g(S,a);if(p.hasEagerState=!0,p.eagerState=C,Zi(C,S))return Oc(i,n,p,0),vt===null&&Dc(),!1}catch{}if(a=eh(i,n,p,c),a!==null)return $i(a,i,c),G_(a,n,c),!0}return!1}function zh(i,n,a,c){if(c={lane:2,revertLane:gf(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Jc(i)){if(n)throw Error(r(479))}else n=eh(i,a,c,2),n!==null&&$i(n,i,2)}function Jc(i){var n=i.alternate;return i===He||n!==null&&n===He}function K_(i,n){Ka=Kc=!0;var a=i.pending;a===null?n.next=n:(n.next=a.next,a.next=n),i.pending=n}function G_(i,n,a){if((a&4194048)!==0){var c=n.lanes;c&=i.pendingLanes,a|=c,n.lanes=a,Le(i,a)}}var il={readContext:bi,use:Yc,useCallback:Lt,useContext:Lt,useEffect:Lt,useImperativeHandle:Lt,useLayoutEffect:Lt,useInsertionEffect:Lt,useMemo:Lt,useReducer:Lt,useRef:Lt,useState:Lt,useDebugValue:Lt,useDeferredValue:Lt,useTransition:Lt,useSyncExternalStore:Lt,useId:Lt,useHostTransitionStatus:Lt,useFormState:Lt,useActionState:Lt,useOptimistic:Lt,useMemoCache:Lt,useCacheRefresh:Lt};il.useEffectEvent=Lt;var W_={readContext:bi,use:Yc,useCallback:function(i,n){return Ri().memoizedState=[i,n===void 0?null:n],i},useContext:bi,useEffect:R_,useImperativeHandle:function(i,n,a){a=a!=null?a.concat([i]):null,Zc(4194308,4,j_.bind(null,n,i),a)},useLayoutEffect:function(i,n){return Zc(4194308,4,i,n)},useInsertionEffect:function(i,n){Zc(4,2,i,n)},useMemo:function(i,n){var a=Ri();n=n===void 0?null:n;var c=i();if(Qr){cs(!0);try{i()}finally{cs(!1)}}return a.memoizedState=[c,n],c},useReducer:function(i,n,a){var c=Ri();if(a!==void 0){var p=a(n);if(Qr){cs(!0);try{a(n)}finally{cs(!1)}}}else p=n;return c.memoizedState=c.baseState=p,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:p},c.queue=i,i=i.dispatch=r3.bind(null,He,i),[c.memoizedState,i]},useRef:function(i){var n=Ri();return i={current:i},n.memoizedState=i},useState:function(i){i=Ah(i);var n=i.queue,a=q_.bind(null,He,n);return n.dispatch=a,[i.memoizedState,a]},useDebugValue:Oh,useDeferredValue:function(i,n){var a=Ri();return Lh(a,i,n)},useTransition:function(){var i=Ah(!1);return i=U_.bind(null,He,i.queue,!0,!1),Ri().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,n,a){var c=He,p=Ri();if(Je){if(a===void 0)throw Error(r(407));a=a()}else{if(a=n(),vt===null)throw Error(r(349));(Ze&127)!==0||p_(c,n,a)}p.memoizedState=a;var g={value:a,getSnapshot:n};return p.queue=g,R_(__.bind(null,c,g,i),[i]),c.flags|=2048,Wa(9,{destroy:void 0},g_.bind(null,c,g,a,n),null),a},useId:function(){var i=Ri(),n=vt.identifierPrefix;if(Je){var a=Is,c=Ps;a=(c&~(1<<32-gi(c)-1)).toString(32)+a,n="_"+n+"R_"+a,a=Gc++,0<a&&(n+="H"+a.toString(32)),n+="_"}else a=QC++,n="_"+n+"r_"+a.toString(32)+"_";return i.memoizedState=n},useHostTransitionStatus:Bh,useFormState:N_,useActionState:N_,useOptimistic:function(i){var n=Ri();n.memoizedState=n.baseState=i;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=a,n=zh.bind(null,He,!0,a),a.dispatch=n,[i,n]},useMemoCache:kh,useCacheRefresh:function(){return Ri().memoizedState=n3.bind(null,He)},useEffectEvent:function(i){var n=Ri(),a={impl:i};return n.memoizedState=a,function(){if((ot&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}},Ph={readContext:bi,use:Yc,useCallback:z_,useContext:bi,useEffect:Dh,useImperativeHandle:B_,useInsertionEffect:O_,useLayoutEffect:L_,useMemo:P_,useReducer:Xc,useRef:A_,useState:function(){return Xc(Sn)},useDebugValue:Oh,useDeferredValue:function(i,n){var a=$t();return I_(a,ft.memoizedState,i,n)},useTransition:function(){var i=Xc(Sn)[0],n=$t().memoizedState;return[typeof i=="boolean"?i:el(i),n]},useSyncExternalStore:m_,useId:V_,useHostTransitionStatus:Bh,useFormState:k_,useActionState:k_,useOptimistic:function(i,n){var a=$t();return y_(a,ft,i,n)},useMemoCache:kh,useCacheRefresh:$_};Ph.useEffectEvent=D_;var Y_={readContext:bi,use:Yc,useCallback:z_,useContext:bi,useEffect:Dh,useImperativeHandle:B_,useInsertionEffect:O_,useLayoutEffect:L_,useMemo:P_,useReducer:Mh,useRef:A_,useState:function(){return Mh(Sn)},useDebugValue:Oh,useDeferredValue:function(i,n){var a=$t();return ft===null?Lh(a,i,n):I_(a,ft.memoizedState,i,n)},useTransition:function(){var i=Mh(Sn)[0],n=$t().memoizedState;return[typeof i=="boolean"?i:el(i),n]},useSyncExternalStore:m_,useId:V_,useHostTransitionStatus:Bh,useFormState:M_,useActionState:M_,useOptimistic:function(i,n){var a=$t();return ft!==null?y_(a,ft,i,n):(a.baseState=i,[i,a.queue.dispatch])},useMemoCache:kh,useCacheRefresh:$_};Y_.useEffectEvent=D_;function Ih(i,n,a,c){n=i.memoizedState,a=a(c,n),a=a==null?n:v({},n,a),i.memoizedState=a,i.lanes===0&&(i.updateQueue.baseState=a)}var Uh={enqueueSetState:function(i,n,a){i=i._reactInternals;var c=ss(),p=er(c);p.payload=n,a!=null&&(p.callback=a),n=tr(i,p,c),n!==null&&($i(n,i,c),Xo(n,i,c))},enqueueReplaceState:function(i,n,a){i=i._reactInternals;var c=ss(),p=er(c);p.tag=1,p.payload=n,a!=null&&(p.callback=a),n=tr(i,p,c),n!==null&&($i(n,i,c),Xo(n,i,c))},enqueueForceUpdate:function(i,n){i=i._reactInternals;var a=ss(),c=er(a);c.tag=2,n!=null&&(c.callback=n),n=tr(i,c,a),n!==null&&($i(n,i,a),Xo(n,i,a))}};function X_(i,n,a,c,p,g,S){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(c,g,S):n.prototype&&n.prototype.isPureReactComponent?!Fo(a,c)||!Fo(p,g):!0}function Z_(i,n,a,c){i=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(a,c),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(a,c),n.state!==i&&Uh.enqueueReplaceState(n,n.state,null)}function Jr(i,n){var a=n;if("ref"in n){a={};for(var c in n)c!=="ref"&&(a[c]=n[c])}if(i=i.defaultProps){a===n&&(a=v({},a));for(var p in i)a[p]===void 0&&(a[p]=i[p])}return a}function Q_(i){Rc(i)}function J_(i){console.error(i)}function ev(i){Rc(i)}function eu(i,n){try{var a=i.onUncaughtError;a(n.value,{componentStack:n.stack})}catch(c){setTimeout(function(){throw c})}}function tv(i,n,a){try{var c=i.onCaughtError;c(a.value,{componentStack:a.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Hh(i,n,a){return a=er(a),a.tag=3,a.payload={element:null},a.callback=function(){eu(i,n)},a}function iv(i){return i=er(i),i.tag=3,i}function sv(i,n,a,c){var p=a.type.getDerivedStateFromError;if(typeof p=="function"){var g=c.value;i.payload=function(){return p(g)},i.callback=function(){tv(n,a,c)}}var S=a.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(i.callback=function(){tv(n,a,c),typeof p!="function"&&(or===null?or=new Set([this]):or.add(this));var C=c.stack;this.componentDidCatch(c.value,{componentStack:C!==null?C:""})})}function a3(i,n,a,c,p){if(a.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(n=a.alternate,n!==null&&Ua(n,a,p,!0),a=Ji.current,a!==null){switch(a.tag){case 31:case 13:return gs===null?hu():a.alternate===null&&jt===0&&(jt=3),a.flags&=-257,a.flags|=65536,a.lanes=p,c===Hc?a.flags|=16384:(n=a.updateQueue,n===null?a.updateQueue=new Set([c]):n.add(c),ff(i,c,p)),!1;case 22:return a.flags|=65536,c===Hc?a.flags|=16384:(n=a.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([c])},a.updateQueue=n):(a=n.retryQueue,a===null?n.retryQueue=new Set([c]):a.add(c)),ff(i,c,p)),!1}throw Error(r(435,a.tag))}return ff(i,c,p),hu(),!1}if(Je)return n=Ji.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=p,c!==ah&&(i=Error(r(422),{cause:c}),qo(hs(i,a)))):(c!==ah&&(n=Error(r(423),{cause:c}),qo(hs(n,a))),i=i.current.alternate,i.flags|=65536,p&=-p,i.lanes|=p,c=hs(c,a),p=Hh(i.stateNode,c,p),_h(i,p),jt!==4&&(jt=2)),!1;var g=Error(r(520),{cause:c});if(g=hs(g,a),ul===null?ul=[g]:ul.push(g),jt!==4&&(jt=2),n===null)return!0;c=hs(c,a),a=n;do{switch(a.tag){case 3:return a.flags|=65536,i=p&-p,a.lanes|=i,i=Hh(a.stateNode,c,i),_h(a,i),!1;case 1:if(n=a.type,g=a.stateNode,(a.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(or===null||!or.has(g))))return a.flags|=65536,p&=-p,a.lanes|=p,p=iv(p),sv(p,i,a,c),_h(a,p),!1}a=a.return}while(a!==null);return!1}var Fh=Error(r(461)),Xt=!1;function yi(i,n,a,c){n.child=i===null?o_(n,null,a,c):Zr(n,i.child,a,c)}function nv(i,n,a,c,p){a=a.render;var g=n.ref;if("ref"in c){var S={};for(var C in c)C!=="ref"&&(S[C]=c[C])}else S=c;return Gr(n),c=wh(i,n,a,S,g,p),C=Eh(),i!==null&&!Xt?(Ch(i,n,p),wn(i,n,p)):(Je&&C&&nh(n),n.flags|=1,yi(i,n,c,p),n.child)}function rv(i,n,a,c,p){if(i===null){var g=a.type;return typeof g=="function"&&!th(g)&&g.defaultProps===void 0&&a.compare===null?(n.tag=15,n.type=g,av(i,n,g,c,p)):(i=jc(a.type,null,c,n,n.mode,p),i.ref=n.ref,i.return=n,n.child=i)}if(g=i.child,!Xh(i,p)){var S=g.memoizedProps;if(a=a.compare,a=a!==null?a:Fo,a(S,c)&&i.ref===n.ref)return wn(i,n,p)}return n.flags|=1,i=_n(g,c),i.ref=n.ref,i.return=n,n.child=i}function av(i,n,a,c,p){if(i!==null){var g=i.memoizedProps;if(Fo(g,c)&&i.ref===n.ref)if(Xt=!1,n.pendingProps=c=g,Xh(i,p))(i.flags&131072)!==0&&(Xt=!0);else return n.lanes=i.lanes,wn(i,n,p)}return Vh(i,n,a,c,p)}function ov(i,n,a,c){var p=c.children,g=i!==null?i.memoizedState:null;if(i===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((n.flags&128)!==0){if(g=g!==null?g.baseLanes|a:a,i!==null){for(c=n.child=i.child,p=0;c!==null;)p=p|c.lanes|c.childLanes,c=c.sibling;c=p&~g}else c=0,n.child=null;return lv(i,n,g,a,c)}if((a&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},i!==null&&Ic(n,g!==null?g.cachePool:null),g!==null?u_(n,g):bh(),d_(n);else return c=n.lanes=536870912,lv(i,n,g!==null?g.baseLanes|a:a,a,c)}else g!==null?(Ic(n,g.cachePool),u_(n,g),sr(),n.memoizedState=null):(i!==null&&Ic(n,null),bh(),sr());return yi(i,n,p,a),n.child}function sl(i,n){return i!==null&&i.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function lv(i,n,a,c,p){var g=fh();return g=g===null?null:{parent:Wt._currentValue,pool:g},n.memoizedState={baseLanes:a,cachePool:g},i!==null&&Ic(n,null),bh(),d_(n),i!==null&&Ua(i,n,c,!0),n.childLanes=p,null}function tu(i,n){return n=su({mode:n.mode,children:n.children},i.mode),n.ref=i.ref,i.child=n,n.return=i,n}function cv(i,n,a){return Zr(n,i.child,null,a),i=tu(n,n.pendingProps),i.flags|=2,es(n),n.memoizedState=null,i}function o3(i,n,a){var c=n.pendingProps,p=(n.flags&128)!==0;if(n.flags&=-129,i===null){if(Je){if(c.mode==="hidden")return i=tu(n,c),n.lanes=536870912,sl(null,i);if(xh(n),(i=wt)?(i=xb(i,ps),i=i!==null&&i.data==="&"?i:null,i!==null&&(n.memoizedState={dehydrated:i,treeContext:Yn!==null?{id:Ps,overflow:Is}:null,retryLane:536870912,hydrationErrors:null},a=K0(i),a.return=n,n.child=a,vi=n,wt=null)):i=null,i===null)throw Zn(n);return n.lanes=536870912,null}return tu(n,c)}var g=i.memoizedState;if(g!==null){var S=g.dehydrated;if(xh(n),p)if(n.flags&256)n.flags&=-257,n=cv(i,n,a);else if(n.memoizedState!==null)n.child=i.child,n.flags|=128,n=null;else throw Error(r(558));else if(Xt||Ua(i,n,a,!1),p=(a&i.childLanes)!==0,Xt||p){if(c=vt,c!==null&&(S=Ut(c,a),S!==0&&S!==g.retryLane))throw g.retryLane=S,Vr(i,S),$i(c,i,S),Fh;hu(),n=cv(i,n,a)}else i=g.treeContext,wt=_s(S.nextSibling),vi=n,Je=!0,Xn=null,ps=!1,i!==null&&Y0(n,i),n=tu(n,c),n.flags|=4096;return n}return i=_n(i.child,{mode:c.mode,children:c.children}),i.ref=n.ref,n.child=i,i.return=n,i}function iu(i,n){var a=n.ref;if(a===null)i!==null&&i.ref!==null&&(n.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(r(284));(i===null||i.ref!==a)&&(n.flags|=4194816)}}function Vh(i,n,a,c,p){return Gr(n),a=wh(i,n,a,c,void 0,p),c=Eh(),i!==null&&!Xt?(Ch(i,n,p),wn(i,n,p)):(Je&&c&&nh(n),n.flags|=1,yi(i,n,a,p),n.child)}function uv(i,n,a,c,p,g){return Gr(n),n.updateQueue=null,a=f_(n,c,a,p),h_(i),c=Eh(),i!==null&&!Xt?(Ch(i,n,g),wn(i,n,g)):(Je&&c&&nh(n),n.flags|=1,yi(i,n,a,g),n.child)}function dv(i,n,a,c,p){if(Gr(n),n.stateNode===null){var g=Ba,S=a.contextType;typeof S=="object"&&S!==null&&(g=bi(S)),g=new a(c,g),n.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=Uh,n.stateNode=g,g._reactInternals=n,g=n.stateNode,g.props=c,g.state=n.memoizedState,g.refs={},ph(n),S=a.contextType,g.context=typeof S=="object"&&S!==null?bi(S):Ba,g.state=n.memoizedState,S=a.getDerivedStateFromProps,typeof S=="function"&&(Ih(n,a,S,c),g.state=n.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(S=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),S!==g.state&&Uh.enqueueReplaceState(g,g.state,null),Qo(n,c,g,p),Zo(),g.state=n.memoizedState),typeof g.componentDidMount=="function"&&(n.flags|=4194308),c=!0}else if(i===null){g=n.stateNode;var C=n.memoizedProps,L=Jr(a,C);g.props=L;var X=g.context,se=a.contextType;S=Ba,typeof se=="object"&&se!==null&&(S=bi(se));var ae=a.getDerivedStateFromProps;se=typeof ae=="function"||typeof g.getSnapshotBeforeUpdate=="function",C=n.pendingProps!==C,se||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(C||X!==S)&&Z_(n,g,c,S),Jn=!1;var Q=n.memoizedState;g.state=Q,Qo(n,c,g,p),Zo(),X=n.memoizedState,C||Q!==X||Jn?(typeof ae=="function"&&(Ih(n,a,ae,c),X=n.memoizedState),(L=Jn||X_(n,a,L,c,Q,X,S))?(se||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(n.flags|=4194308)):(typeof g.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=c,n.memoizedState=X),g.props=c,g.state=X,g.context=S,c=L):(typeof g.componentDidMount=="function"&&(n.flags|=4194308),c=!1)}else{g=n.stateNode,gh(i,n),S=n.memoizedProps,se=Jr(a,S),g.props=se,ae=n.pendingProps,Q=g.context,X=a.contextType,L=Ba,typeof X=="object"&&X!==null&&(L=bi(X)),C=a.getDerivedStateFromProps,(X=typeof C=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(S!==ae||Q!==L)&&Z_(n,g,c,L),Jn=!1,Q=n.memoizedState,g.state=Q,Qo(n,c,g,p),Zo();var te=n.memoizedState;S!==ae||Q!==te||Jn||i!==null&&i.dependencies!==null&&zc(i.dependencies)?(typeof C=="function"&&(Ih(n,a,C,c),te=n.memoizedState),(se=Jn||X_(n,a,se,c,Q,te,L)||i!==null&&i.dependencies!==null&&zc(i.dependencies))?(X||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(c,te,L),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(c,te,L)),typeof g.componentDidUpdate=="function"&&(n.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof g.componentDidUpdate!="function"||S===i.memoizedProps&&Q===i.memoizedState||(n.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||S===i.memoizedProps&&Q===i.memoizedState||(n.flags|=1024),n.memoizedProps=c,n.memoizedState=te),g.props=c,g.state=te,g.context=L,c=se):(typeof g.componentDidUpdate!="function"||S===i.memoizedProps&&Q===i.memoizedState||(n.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||S===i.memoizedProps&&Q===i.memoizedState||(n.flags|=1024),c=!1)}return g=c,iu(i,n),c=(n.flags&128)!==0,g||c?(g=n.stateNode,a=c&&typeof a.getDerivedStateFromError!="function"?null:g.render(),n.flags|=1,i!==null&&c?(n.child=Zr(n,i.child,null,p),n.child=Zr(n,null,a,p)):yi(i,n,a,p),n.memoizedState=g.state,i=n.child):i=wn(i,n,p),i}function hv(i,n,a,c){return qr(),n.flags|=256,yi(i,n,a,c),n.child}var $h={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function qh(i){return{baseLanes:i,cachePool:t_()}}function Kh(i,n,a){return i=i!==null?i.childLanes&~a:0,n&&(i|=is),i}function fv(i,n,a){var c=n.pendingProps,p=!1,g=(n.flags&128)!==0,S;if((S=g)||(S=i!==null&&i.memoizedState===null?!1:(Vt.current&2)!==0),S&&(p=!0,n.flags&=-129),S=(n.flags&32)!==0,n.flags&=-33,i===null){if(Je){if(p?ir(n):sr(),(i=wt)?(i=xb(i,ps),i=i!==null&&i.data!=="&"?i:null,i!==null&&(n.memoizedState={dehydrated:i,treeContext:Yn!==null?{id:Ps,overflow:Is}:null,retryLane:536870912,hydrationErrors:null},a=K0(i),a.return=n,n.child=a,vi=n,wt=null)):i=null,i===null)throw Zn(n);return Mf(i)?n.lanes=32:n.lanes=536870912,null}var C=c.children;return c=c.fallback,p?(sr(),p=n.mode,C=su({mode:"hidden",children:C},p),c=$r(c,p,a,null),C.return=n,c.return=n,C.sibling=c,n.child=C,c=n.child,c.memoizedState=qh(a),c.childLanes=Kh(i,S,a),n.memoizedState=$h,sl(null,c)):(ir(n),Gh(n,C))}var L=i.memoizedState;if(L!==null&&(C=L.dehydrated,C!==null)){if(g)n.flags&256?(ir(n),n.flags&=-257,n=Wh(i,n,a)):n.memoizedState!==null?(sr(),n.child=i.child,n.flags|=128,n=null):(sr(),C=c.fallback,p=n.mode,c=su({mode:"visible",children:c.children},p),C=$r(C,p,a,null),C.flags|=2,c.return=n,C.return=n,c.sibling=C,n.child=c,Zr(n,i.child,null,a),c=n.child,c.memoizedState=qh(a),c.childLanes=Kh(i,S,a),n.memoizedState=$h,n=sl(null,c));else if(ir(n),Mf(C)){if(S=C.nextSibling&&C.nextSibling.dataset,S)var X=S.dgst;S=X,c=Error(r(419)),c.stack="",c.digest=S,qo({value:c,source:null,stack:null}),n=Wh(i,n,a)}else if(Xt||Ua(i,n,a,!1),S=(a&i.childLanes)!==0,Xt||S){if(S=vt,S!==null&&(c=Ut(S,a),c!==0&&c!==L.retryLane))throw L.retryLane=c,Vr(i,c),$i(S,i,c),Fh;Tf(C)||hu(),n=Wh(i,n,a)}else Tf(C)?(n.flags|=192,n.child=i.child,n=null):(i=L.treeContext,wt=_s(C.nextSibling),vi=n,Je=!0,Xn=null,ps=!1,i!==null&&Y0(n,i),n=Gh(n,c.children),n.flags|=4096);return n}return p?(sr(),C=c.fallback,p=n.mode,L=i.child,X=L.sibling,c=_n(L,{mode:"hidden",children:c.children}),c.subtreeFlags=L.subtreeFlags&65011712,X!==null?C=_n(X,C):(C=$r(C,p,a,null),C.flags|=2),C.return=n,c.return=n,c.sibling=C,n.child=c,sl(null,c),c=n.child,C=i.child.memoizedState,C===null?C=qh(a):(p=C.cachePool,p!==null?(L=Wt._currentValue,p=p.parent!==L?{parent:L,pool:L}:p):p=t_(),C={baseLanes:C.baseLanes|a,cachePool:p}),c.memoizedState=C,c.childLanes=Kh(i,S,a),n.memoizedState=$h,sl(i.child,c)):(ir(n),a=i.child,i=a.sibling,a=_n(a,{mode:"visible",children:c.children}),a.return=n,a.sibling=null,i!==null&&(S=n.deletions,S===null?(n.deletions=[i],n.flags|=16):S.push(i)),n.child=a,n.memoizedState=null,a)}function Gh(i,n){return n=su({mode:"visible",children:n},i.mode),n.return=i,i.child=n}function su(i,n){return i=Qi(22,i,null,n),i.lanes=0,i}function Wh(i,n,a){return Zr(n,i.child,null,a),i=Gh(n,n.pendingProps.children),i.flags|=2,n.memoizedState=null,i}function mv(i,n,a){i.lanes|=n;var c=i.alternate;c!==null&&(c.lanes|=n),ch(i.return,n,a)}function Yh(i,n,a,c,p,g){var S=i.memoizedState;S===null?i.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:c,tail:a,tailMode:p,treeForkCount:g}:(S.isBackwards=n,S.rendering=null,S.renderingStartTime=0,S.last=c,S.tail=a,S.tailMode=p,S.treeForkCount=g)}function pv(i,n,a){var c=n.pendingProps,p=c.revealOrder,g=c.tail;c=c.children;var S=Vt.current,C=(S&2)!==0;if(C?(S=S&1|2,n.flags|=128):S&=1,ce(Vt,S),yi(i,n,c,a),c=Je?$o:0,!C&&i!==null&&(i.flags&128)!==0)e:for(i=n.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&mv(i,a,n);else if(i.tag===19)mv(i,a,n);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break e;for(;i.sibling===null;){if(i.return===null||i.return===n)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(p){case"forwards":for(a=n.child,p=null;a!==null;)i=a.alternate,i!==null&&qc(i)===null&&(p=a),a=a.sibling;a=p,a===null?(p=n.child,n.child=null):(p=a.sibling,a.sibling=null),Yh(n,!1,p,a,g,c);break;case"backwards":case"unstable_legacy-backwards":for(a=null,p=n.child,n.child=null;p!==null;){if(i=p.alternate,i!==null&&qc(i)===null){n.child=p;break}i=p.sibling,p.sibling=a,a=p,p=i}Yh(n,!0,a,null,g,c);break;case"together":Yh(n,!1,null,null,void 0,c);break;default:n.memoizedState=null}return n.child}function wn(i,n,a){if(i!==null&&(n.dependencies=i.dependencies),ar|=n.lanes,(a&n.childLanes)===0)if(i!==null){if(Ua(i,n,a,!1),(a&n.childLanes)===0)return null}else return null;if(i!==null&&n.child!==i.child)throw Error(r(153));if(n.child!==null){for(i=n.child,a=_n(i,i.pendingProps),n.child=a,a.return=n;i.sibling!==null;)i=i.sibling,a=a.sibling=_n(i,i.pendingProps),a.return=n;a.sibling=null}return n.child}function Xh(i,n){return(i.lanes&n)!==0?!0:(i=i.dependencies,!!(i!==null&&zc(i)))}function l3(i,n,a){switch(n.tag){case 3:Be(n,n.stateNode.containerInfo),Qn(n,Wt,i.memoizedState.cache),qr();break;case 27:case 5:it(n);break;case 4:Be(n,n.stateNode.containerInfo);break;case 10:Qn(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,xh(n),null;break;case 13:var c=n.memoizedState;if(c!==null)return c.dehydrated!==null?(ir(n),n.flags|=128,null):(a&n.child.childLanes)!==0?fv(i,n,a):(ir(n),i=wn(i,n,a),i!==null?i.sibling:null);ir(n);break;case 19:var p=(i.flags&128)!==0;if(c=(a&n.childLanes)!==0,c||(Ua(i,n,a,!1),c=(a&n.childLanes)!==0),p){if(c)return pv(i,n,a);n.flags|=128}if(p=n.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),ce(Vt,Vt.current),c)break;return null;case 22:return n.lanes=0,ov(i,n,a,n.pendingProps);case 24:Qn(n,Wt,i.memoizedState.cache)}return wn(i,n,a)}function gv(i,n,a){if(i!==null)if(i.memoizedProps!==n.pendingProps)Xt=!0;else{if(!Xh(i,a)&&(n.flags&128)===0)return Xt=!1,l3(i,n,a);Xt=(i.flags&131072)!==0}else Xt=!1,Je&&(n.flags&1048576)!==0&&W0(n,$o,n.index);switch(n.lanes=0,n.tag){case 16:e:{var c=n.pendingProps;if(i=Yr(n.elementType),n.type=i,typeof i=="function")th(i)?(c=Jr(i,c),n.tag=1,n=dv(null,n,i,c,a)):(n.tag=0,n=Vh(null,n,i,c,a));else{if(i!=null){var p=i.$$typeof;if(p===M){n.tag=11,n=nv(null,n,i,c,a);break e}else if(p===j){n.tag=14,n=rv(null,n,i,c,a);break e}}throw n=ee(i)||i,Error(r(306,n,""))}}return n;case 0:return Vh(i,n,n.type,n.pendingProps,a);case 1:return c=n.type,p=Jr(c,n.pendingProps),dv(i,n,c,p,a);case 3:e:{if(Be(n,n.stateNode.containerInfo),i===null)throw Error(r(387));c=n.pendingProps;var g=n.memoizedState;p=g.element,gh(i,n),Qo(n,c,null,a);var S=n.memoizedState;if(c=S.cache,Qn(n,Wt,c),c!==g.cache&&uh(n,[Wt],a,!0),Zo(),c=S.element,g.isDehydrated)if(g={element:c,isDehydrated:!1,cache:S.cache},n.updateQueue.baseState=g,n.memoizedState=g,n.flags&256){n=hv(i,n,c,a);break e}else if(c!==p){p=hs(Error(r(424)),n),qo(p),n=hv(i,n,c,a);break e}else for(i=n.stateNode.containerInfo,i.nodeType===9?i=i.body:i=i.nodeName==="HTML"?i.ownerDocument.body:i,wt=_s(i.firstChild),vi=n,Je=!0,Xn=null,ps=!0,a=o_(n,null,c,a),n.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(qr(),c===p){n=wn(i,n,a);break e}yi(i,n,c,a)}n=n.child}return n;case 26:return iu(i,n),i===null?(a=kb(n.type,null,n.pendingProps,null))?n.memoizedState=a:Je||(a=n.type,i=n.pendingProps,c=bu(ge.current).createElement(a),c[Ht]=n,c[Ni]=i,xi(c,a,i),Kt(c),n.stateNode=c):n.memoizedState=kb(n.type,i.memoizedProps,n.pendingProps,i.memoizedState),null;case 27:return it(n),i===null&&Je&&(c=n.stateNode=Eb(n.type,n.pendingProps,ge.current),vi=n,ps=!0,p=wt,dr(n.type)?(Af=p,wt=_s(c.firstChild)):wt=p),yi(i,n,n.pendingProps.children,a),iu(i,n),i===null&&(n.flags|=4194304),n.child;case 5:return i===null&&Je&&((p=c=wt)&&(c=P3(c,n.type,n.pendingProps,ps),c!==null?(n.stateNode=c,vi=n,wt=_s(c.firstChild),ps=!1,p=!0):p=!1),p||Zn(n)),it(n),p=n.type,g=n.pendingProps,S=i!==null?i.memoizedProps:null,c=g.children,Cf(p,g)?c=null:S!==null&&Cf(p,S)&&(n.flags|=32),n.memoizedState!==null&&(p=wh(i,n,JC,null,null,a),vl._currentValue=p),iu(i,n),yi(i,n,c,a),n.child;case 6:return i===null&&Je&&((i=a=wt)&&(a=I3(a,n.pendingProps,ps),a!==null?(n.stateNode=a,vi=n,wt=null,i=!0):i=!1),i||Zn(n)),null;case 13:return fv(i,n,a);case 4:return Be(n,n.stateNode.containerInfo),c=n.pendingProps,i===null?n.child=Zr(n,null,c,a):yi(i,n,c,a),n.child;case 11:return nv(i,n,n.type,n.pendingProps,a);case 7:return yi(i,n,n.pendingProps,a),n.child;case 8:return yi(i,n,n.pendingProps.children,a),n.child;case 12:return yi(i,n,n.pendingProps.children,a),n.child;case 10:return c=n.pendingProps,Qn(n,n.type,c.value),yi(i,n,c.children,a),n.child;case 9:return p=n.type._context,c=n.pendingProps.children,Gr(n),p=bi(p),c=c(p),n.flags|=1,yi(i,n,c,a),n.child;case 14:return rv(i,n,n.type,n.pendingProps,a);case 15:return av(i,n,n.type,n.pendingProps,a);case 19:return pv(i,n,a);case 31:return o3(i,n,a);case 22:return ov(i,n,a,n.pendingProps);case 24:return Gr(n),c=bi(Wt),i===null?(p=fh(),p===null&&(p=vt,g=dh(),p.pooledCache=g,g.refCount++,g!==null&&(p.pooledCacheLanes|=a),p=g),n.memoizedState={parent:c,cache:p},ph(n),Qn(n,Wt,p)):((i.lanes&a)!==0&&(gh(i,n),Qo(n,null,null,a),Zo()),p=i.memoizedState,g=n.memoizedState,p.parent!==c?(p={parent:c,cache:c},n.memoizedState=p,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=p),Qn(n,Wt,c)):(c=g.cache,Qn(n,Wt,c),c!==p.cache&&uh(n,[Wt],a,!0))),yi(i,n,n.pendingProps.children,a),n.child;case 29:throw n.pendingProps}throw Error(r(156,n.tag))}function En(i){i.flags|=4}function Zh(i,n,a,c,p){if((n=(i.mode&32)!==0)&&(n=!1),n){if(i.flags|=16777216,(p&335544128)===p)if(i.stateNode.complete)i.flags|=8192;else if(Vv())i.flags|=8192;else throw Xr=Hc,mh}else i.flags&=-16777217}function _v(i,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!Db(n))if(Vv())i.flags|=8192;else throw Xr=Hc,mh}function nu(i,n){n!==null&&(i.flags|=4),i.flags&16384&&(n=i.tag!==22?ze():536870912,i.lanes|=n,Qa|=n)}function nl(i,n){if(!Je)switch(i.tailMode){case"hidden":n=i.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?i.tail=null:a.sibling=null;break;case"collapsed":a=i.tail;for(var c=null;a!==null;)a.alternate!==null&&(c=a),a=a.sibling;c===null?n||i.tail===null?i.tail=null:i.tail.sibling=null:c.sibling=null}}function Et(i){var n=i.alternate!==null&&i.alternate.child===i.child,a=0,c=0;if(n)for(var p=i.child;p!==null;)a|=p.lanes|p.childLanes,c|=p.subtreeFlags&65011712,c|=p.flags&65011712,p.return=i,p=p.sibling;else for(p=i.child;p!==null;)a|=p.lanes|p.childLanes,c|=p.subtreeFlags,c|=p.flags,p.return=i,p=p.sibling;return i.subtreeFlags|=c,i.childLanes=a,n}function c3(i,n,a){var c=n.pendingProps;switch(rh(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Et(n),null;case 1:return Et(n),null;case 3:return a=n.stateNode,c=null,i!==null&&(c=i.memoizedState.cache),n.memoizedState.cache!==c&&(n.flags|=2048),yn(Wt),Ee(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(i===null||i.child===null)&&(Ia(n)?En(n):i===null||i.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,oh())),Et(n),null;case 26:var p=n.type,g=n.memoizedState;return i===null?(En(n),g!==null?(Et(n),_v(n,g)):(Et(n),Zh(n,p,null,c,a))):g?g!==i.memoizedState?(En(n),Et(n),_v(n,g)):(Et(n),n.flags&=-16777217):(i=i.memoizedProps,i!==c&&En(n),Et(n),Zh(n,p,i,c,a)),null;case 27:if(rt(n),a=ge.current,p=n.type,i!==null&&n.stateNode!=null)i.memoizedProps!==c&&En(n);else{if(!c){if(n.stateNode===null)throw Error(r(166));return Et(n),null}i=le.current,Ia(n)?X0(n):(i=Eb(p,c,a),n.stateNode=i,En(n))}return Et(n),null;case 5:if(rt(n),p=n.type,i!==null&&n.stateNode!=null)i.memoizedProps!==c&&En(n);else{if(!c){if(n.stateNode===null)throw Error(r(166));return Et(n),null}if(g=le.current,Ia(n))X0(n);else{var S=bu(ge.current);switch(g){case 1:g=S.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:g=S.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":g=S.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":g=S.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":g=S.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof c.is=="string"?S.createElement("select",{is:c.is}):S.createElement("select"),c.multiple?g.multiple=!0:c.size&&(g.size=c.size);break;default:g=typeof c.is=="string"?S.createElement(p,{is:c.is}):S.createElement(p)}}g[Ht]=n,g[Ni]=c;e:for(S=n.child;S!==null;){if(S.tag===5||S.tag===6)g.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===n)break e;for(;S.sibling===null;){if(S.return===null||S.return===n)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}n.stateNode=g;e:switch(xi(g,p,c),p){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&En(n)}}return Et(n),Zh(n,n.type,i===null?null:i.memoizedProps,n.pendingProps,a),null;case 6:if(i&&n.stateNode!=null)i.memoizedProps!==c&&En(n);else{if(typeof c!="string"&&n.stateNode===null)throw Error(r(166));if(i=ge.current,Ia(n)){if(i=n.stateNode,a=n.memoizedProps,c=null,p=vi,p!==null)switch(p.tag){case 27:case 5:c=p.memoizedProps}i[Ht]=n,i=!!(i.nodeValue===a||c!==null&&c.suppressHydrationWarning===!0||fb(i.nodeValue,a)),i||Zn(n,!0)}else i=bu(i).createTextNode(c),i[Ht]=n,n.stateNode=i}return Et(n),null;case 31:if(a=n.memoizedState,i===null||i.memoizedState!==null){if(c=Ia(n),a!==null){if(i===null){if(!c)throw Error(r(318));if(i=n.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[Ht]=n}else qr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Et(n),i=!1}else a=oh(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=a),i=!0;if(!i)return n.flags&256?(es(n),n):(es(n),null);if((n.flags&128)!==0)throw Error(r(558))}return Et(n),null;case 13:if(c=n.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(p=Ia(n),c!==null&&c.dehydrated!==null){if(i===null){if(!p)throw Error(r(318));if(p=n.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(r(317));p[Ht]=n}else qr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Et(n),p=!1}else p=oh(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=p),p=!0;if(!p)return n.flags&256?(es(n),n):(es(n),null)}return es(n),(n.flags&128)!==0?(n.lanes=a,n):(a=c!==null,i=i!==null&&i.memoizedState!==null,a&&(c=n.child,p=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(p=c.alternate.memoizedState.cachePool.pool),g=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),g!==p&&(c.flags|=2048)),a!==i&&a&&(n.child.flags|=8192),nu(n,n.updateQueue),Et(n),null);case 4:return Ee(),i===null&&yf(n.stateNode.containerInfo),Et(n),null;case 10:return yn(n.type),Et(n),null;case 19:if(ie(Vt),c=n.memoizedState,c===null)return Et(n),null;if(p=(n.flags&128)!==0,g=c.rendering,g===null)if(p)nl(c,!1);else{if(jt!==0||i!==null&&(i.flags&128)!==0)for(i=n.child;i!==null;){if(g=qc(i),g!==null){for(n.flags|=128,nl(c,!1),i=g.updateQueue,n.updateQueue=i,nu(n,i),n.subtreeFlags=0,i=a,a=n.child;a!==null;)q0(a,i),a=a.sibling;return ce(Vt,Vt.current&1|2),Je&&vn(n,c.treeForkCount),n.child}i=i.sibling}c.tail!==null&&At()>cu&&(n.flags|=128,p=!0,nl(c,!1),n.lanes=4194304)}else{if(!p)if(i=qc(g),i!==null){if(n.flags|=128,p=!0,i=i.updateQueue,n.updateQueue=i,nu(n,i),nl(c,!0),c.tail===null&&c.tailMode==="hidden"&&!g.alternate&&!Je)return Et(n),null}else 2*At()-c.renderingStartTime>cu&&a!==536870912&&(n.flags|=128,p=!0,nl(c,!1),n.lanes=4194304);c.isBackwards?(g.sibling=n.child,n.child=g):(i=c.last,i!==null?i.sibling=g:n.child=g,c.last=g)}return c.tail!==null?(i=c.tail,c.rendering=i,c.tail=i.sibling,c.renderingStartTime=At(),i.sibling=null,a=Vt.current,ce(Vt,p?a&1|2:a&1),Je&&vn(n,c.treeForkCount),i):(Et(n),null);case 22:case 23:return es(n),yh(),c=n.memoizedState!==null,i!==null?i.memoizedState!==null!==c&&(n.flags|=8192):c&&(n.flags|=8192),c?(a&536870912)!==0&&(n.flags&128)===0&&(Et(n),n.subtreeFlags&6&&(n.flags|=8192)):Et(n),a=n.updateQueue,a!==null&&nu(n,a.retryQueue),a=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),c=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(c=n.memoizedState.cachePool.pool),c!==a&&(n.flags|=2048),i!==null&&ie(Wr),null;case 24:return a=null,i!==null&&(a=i.memoizedState.cache),n.memoizedState.cache!==a&&(n.flags|=2048),yn(Wt),Et(n),null;case 25:return null;case 30:return null}throw Error(r(156,n.tag))}function u3(i,n){switch(rh(n),n.tag){case 1:return i=n.flags,i&65536?(n.flags=i&-65537|128,n):null;case 3:return yn(Wt),Ee(),i=n.flags,(i&65536)!==0&&(i&128)===0?(n.flags=i&-65537|128,n):null;case 26:case 27:case 5:return rt(n),null;case 31:if(n.memoizedState!==null){if(es(n),n.alternate===null)throw Error(r(340));qr()}return i=n.flags,i&65536?(n.flags=i&-65537|128,n):null;case 13:if(es(n),i=n.memoizedState,i!==null&&i.dehydrated!==null){if(n.alternate===null)throw Error(r(340));qr()}return i=n.flags,i&65536?(n.flags=i&-65537|128,n):null;case 19:return ie(Vt),null;case 4:return Ee(),null;case 10:return yn(n.type),null;case 22:case 23:return es(n),yh(),i!==null&&ie(Wr),i=n.flags,i&65536?(n.flags=i&-65537|128,n):null;case 24:return yn(Wt),null;case 25:return null;default:return null}}function vv(i,n){switch(rh(n),n.tag){case 3:yn(Wt),Ee();break;case 26:case 27:case 5:rt(n);break;case 4:Ee();break;case 31:n.memoizedState!==null&&es(n);break;case 13:es(n);break;case 19:ie(Vt);break;case 10:yn(n.type);break;case 22:case 23:es(n),yh(),i!==null&&ie(Wr);break;case 24:yn(Wt)}}function rl(i,n){try{var a=n.updateQueue,c=a!==null?a.lastEffect:null;if(c!==null){var p=c.next;a=p;do{if((a.tag&i)===i){c=void 0;var g=a.create,S=a.inst;c=g(),S.destroy=c}a=a.next}while(a!==p)}}catch(C){dt(n,n.return,C)}}function nr(i,n,a){try{var c=n.updateQueue,p=c!==null?c.lastEffect:null;if(p!==null){var g=p.next;c=g;do{if((c.tag&i)===i){var S=c.inst,C=S.destroy;if(C!==void 0){S.destroy=void 0,p=n;var L=a,X=C;try{X()}catch(se){dt(p,L,se)}}}c=c.next}while(c!==g)}}catch(se){dt(n,n.return,se)}}function bv(i){var n=i.updateQueue;if(n!==null){var a=i.stateNode;try{c_(n,a)}catch(c){dt(i,i.return,c)}}}function yv(i,n,a){a.props=Jr(i.type,i.memoizedProps),a.state=i.memoizedState;try{a.componentWillUnmount()}catch(c){dt(i,n,c)}}function al(i,n){try{var a=i.ref;if(a!==null){switch(i.tag){case 26:case 27:case 5:var c=i.stateNode;break;case 30:c=i.stateNode;break;default:c=i.stateNode}typeof a=="function"?i.refCleanup=a(c):a.current=c}}catch(p){dt(i,n,p)}}function Us(i,n){var a=i.ref,c=i.refCleanup;if(a!==null)if(typeof c=="function")try{c()}catch(p){dt(i,n,p)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(p){dt(i,n,p)}else a.current=null}function xv(i){var n=i.type,a=i.memoizedProps,c=i.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":a.autoFocus&&c.focus();break e;case"img":a.src?c.src=a.src:a.srcSet&&(c.srcset=a.srcSet)}}catch(p){dt(i,i.return,p)}}function Qh(i,n,a){try{var c=i.stateNode;D3(c,i.type,a,n),c[Ni]=n}catch(p){dt(i,i.return,p)}}function Sv(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&dr(i.type)||i.tag===4}function Jh(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Sv(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&dr(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function ef(i,n,a){var c=i.tag;if(c===5||c===6)i=i.stateNode,n?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(i,n):(n=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,n.appendChild(i),a=a._reactRootContainer,a!=null||n.onclick!==null||(n.onclick=me));else if(c!==4&&(c===27&&dr(i.type)&&(a=i.stateNode,n=null),i=i.child,i!==null))for(ef(i,n,a),i=i.sibling;i!==null;)ef(i,n,a),i=i.sibling}function ru(i,n,a){var c=i.tag;if(c===5||c===6)i=i.stateNode,n?a.insertBefore(i,n):a.appendChild(i);else if(c!==4&&(c===27&&dr(i.type)&&(a=i.stateNode),i=i.child,i!==null))for(ru(i,n,a),i=i.sibling;i!==null;)ru(i,n,a),i=i.sibling}function wv(i){var n=i.stateNode,a=i.memoizedProps;try{for(var c=i.type,p=n.attributes;p.length;)n.removeAttributeNode(p[0]);xi(n,c,a),n[Ht]=i,n[Ni]=a}catch(g){dt(i,i.return,g)}}var Cn=!1,Zt=!1,tf=!1,Ev=typeof WeakSet=="function"?WeakSet:Set,ci=null;function d3(i,n){if(i=i.containerInfo,wf=Nu,i=B0(i),Wd(i)){if("selectionStart"in i)var a={start:i.selectionStart,end:i.selectionEnd};else e:{a=(a=i.ownerDocument)&&a.defaultView||window;var c=a.getSelection&&a.getSelection();if(c&&c.rangeCount!==0){a=c.anchorNode;var p=c.anchorOffset,g=c.focusNode;c=c.focusOffset;try{a.nodeType,g.nodeType}catch{a=null;break e}var S=0,C=-1,L=-1,X=0,se=0,ae=i,Q=null;t:for(;;){for(var te;ae!==a||p!==0&&ae.nodeType!==3||(C=S+p),ae!==g||c!==0&&ae.nodeType!==3||(L=S+c),ae.nodeType===3&&(S+=ae.nodeValue.length),(te=ae.firstChild)!==null;)Q=ae,ae=te;for(;;){if(ae===i)break t;if(Q===a&&++X===p&&(C=S),Q===g&&++se===c&&(L=S),(te=ae.nextSibling)!==null)break;ae=Q,Q=ae.parentNode}ae=te}a=C===-1||L===-1?null:{start:C,end:L}}else a=null}a=a||{start:0,end:0}}else a=null;for(Ef={focusedElem:i,selectionRange:a},Nu=!1,ci=n;ci!==null;)if(n=ci,i=n.child,(n.subtreeFlags&1028)!==0&&i!==null)i.return=n,ci=i;else for(;ci!==null;){switch(n=ci,g=n.alternate,i=n.flags,n.tag){case 0:if((i&4)!==0&&(i=n.updateQueue,i=i!==null?i.events:null,i!==null))for(a=0;a<i.length;a++)p=i[a],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&g!==null){i=void 0,a=n,p=g.memoizedProps,g=g.memoizedState,c=a.stateNode;try{var Ce=Jr(a.type,p);i=c.getSnapshotBeforeUpdate(Ce,g),c.__reactInternalSnapshotBeforeUpdate=i}catch(De){dt(a,a.return,De)}}break;case 3:if((i&1024)!==0){if(i=n.stateNode.containerInfo,a=i.nodeType,a===9)kf(i);else if(a===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":kf(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=n.sibling,i!==null){i.return=n.return,ci=i;break}ci=n.return}}function Cv(i,n,a){var c=a.flags;switch(a.tag){case 0:case 11:case 15:kn(i,a),c&4&&rl(5,a);break;case 1:if(kn(i,a),c&4)if(i=a.stateNode,n===null)try{i.componentDidMount()}catch(S){dt(a,a.return,S)}else{var p=Jr(a.type,n.memoizedProps);n=n.memoizedState;try{i.componentDidUpdate(p,n,i.__reactInternalSnapshotBeforeUpdate)}catch(S){dt(a,a.return,S)}}c&64&&bv(a),c&512&&al(a,a.return);break;case 3:if(kn(i,a),c&64&&(i=a.updateQueue,i!==null)){if(n=null,a.child!==null)switch(a.child.tag){case 27:case 5:n=a.child.stateNode;break;case 1:n=a.child.stateNode}try{c_(i,n)}catch(S){dt(a,a.return,S)}}break;case 27:n===null&&c&4&&wv(a);case 26:case 5:kn(i,a),n===null&&c&4&&xv(a),c&512&&al(a,a.return);break;case 12:kn(i,a);break;case 31:kn(i,a),c&4&&Tv(i,a);break;case 13:kn(i,a),c&4&&Mv(i,a),c&64&&(i=a.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(a=y3.bind(null,a),U3(i,a))));break;case 22:if(c=a.memoizedState!==null||Cn,!c){n=n!==null&&n.memoizedState!==null||Zt,p=Cn;var g=Zt;Cn=c,(Zt=n)&&!g?Tn(i,a,(a.subtreeFlags&8772)!==0):kn(i,a),Cn=p,Zt=g}break;case 30:break;default:kn(i,a)}}function Nv(i){var n=i.alternate;n!==null&&(i.alternate=null,Nv(n)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(n=i.stateNode,n!==null&&Ao(n)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var Tt=null,Ui=!1;function Nn(i,n,a){for(a=a.child;a!==null;)kv(i,n,a),a=a.sibling}function kv(i,n,a){if(li&&typeof li.onCommitFiberUnmount=="function")try{li.onCommitFiberUnmount(dn,a)}catch{}switch(a.tag){case 26:Zt||Us(a,n),Nn(i,n,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Zt||Us(a,n);var c=Tt,p=Ui;dr(a.type)&&(Tt=a.stateNode,Ui=!1),Nn(i,n,a),pl(a.stateNode),Tt=c,Ui=p;break;case 5:Zt||Us(a,n);case 6:if(c=Tt,p=Ui,Tt=null,Nn(i,n,a),Tt=c,Ui=p,Tt!==null)if(Ui)try{(Tt.nodeType===9?Tt.body:Tt.nodeName==="HTML"?Tt.ownerDocument.body:Tt).removeChild(a.stateNode)}catch(g){dt(a,n,g)}else try{Tt.removeChild(a.stateNode)}catch(g){dt(a,n,g)}break;case 18:Tt!==null&&(Ui?(i=Tt,bb(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,a.stateNode),ao(i)):bb(Tt,a.stateNode));break;case 4:c=Tt,p=Ui,Tt=a.stateNode.containerInfo,Ui=!0,Nn(i,n,a),Tt=c,Ui=p;break;case 0:case 11:case 14:case 15:nr(2,a,n),Zt||nr(4,a,n),Nn(i,n,a);break;case 1:Zt||(Us(a,n),c=a.stateNode,typeof c.componentWillUnmount=="function"&&yv(a,n,c)),Nn(i,n,a);break;case 21:Nn(i,n,a);break;case 22:Zt=(c=Zt)||a.memoizedState!==null,Nn(i,n,a),Zt=c;break;default:Nn(i,n,a)}}function Tv(i,n){if(n.memoizedState===null&&(i=n.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{ao(i)}catch(a){dt(n,n.return,a)}}}function Mv(i,n){if(n.memoizedState===null&&(i=n.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{ao(i)}catch(a){dt(n,n.return,a)}}function h3(i){switch(i.tag){case 31:case 13:case 19:var n=i.stateNode;return n===null&&(n=i.stateNode=new Ev),n;case 22:return i=i.stateNode,n=i._retryCache,n===null&&(n=i._retryCache=new Ev),n;default:throw Error(r(435,i.tag))}}function au(i,n){var a=h3(i);n.forEach(function(c){if(!a.has(c)){a.add(c);var p=x3.bind(null,i,c);c.then(p,p)}})}function Hi(i,n){var a=n.deletions;if(a!==null)for(var c=0;c<a.length;c++){var p=a[c],g=i,S=n,C=S;e:for(;C!==null;){switch(C.tag){case 27:if(dr(C.type)){Tt=C.stateNode,Ui=!1;break e}break;case 5:Tt=C.stateNode,Ui=!1;break e;case 3:case 4:Tt=C.stateNode.containerInfo,Ui=!0;break e}C=C.return}if(Tt===null)throw Error(r(160));kv(g,S,p),Tt=null,Ui=!1,g=p.alternate,g!==null&&(g.return=null),p.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Av(n,i),n=n.sibling}var Ds=null;function Av(i,n){var a=i.alternate,c=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:Hi(n,i),Fi(i),c&4&&(nr(3,i,i.return),rl(3,i),nr(5,i,i.return));break;case 1:Hi(n,i),Fi(i),c&512&&(Zt||a===null||Us(a,a.return)),c&64&&Cn&&(i=i.updateQueue,i!==null&&(c=i.callbacks,c!==null&&(a=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=a===null?c:a.concat(c))));break;case 26:var p=Ds;if(Hi(n,i),Fi(i),c&512&&(Zt||a===null||Us(a,a.return)),c&4){var g=a!==null?a.memoizedState:null;if(c=i.memoizedState,a===null)if(c===null)if(i.stateNode===null){e:{c=i.type,a=i.memoizedProps,p=p.ownerDocument||p;t:switch(c){case"title":g=p.getElementsByTagName("title")[0],(!g||g[zr]||g[Ht]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=p.createElement(c),p.head.insertBefore(g,p.querySelector("head > title"))),xi(g,c,a),g[Ht]=i,Kt(g),c=g;break e;case"link":var S=Ab("link","href",p).get(c+(a.href||""));if(S){for(var C=0;C<S.length;C++)if(g=S[C],g.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&g.getAttribute("rel")===(a.rel==null?null:a.rel)&&g.getAttribute("title")===(a.title==null?null:a.title)&&g.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){S.splice(C,1);break t}}g=p.createElement(c),xi(g,c,a),p.head.appendChild(g);break;case"meta":if(S=Ab("meta","content",p).get(c+(a.content||""))){for(C=0;C<S.length;C++)if(g=S[C],g.getAttribute("content")===(a.content==null?null:""+a.content)&&g.getAttribute("name")===(a.name==null?null:a.name)&&g.getAttribute("property")===(a.property==null?null:a.property)&&g.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&g.getAttribute("charset")===(a.charSet==null?null:a.charSet)){S.splice(C,1);break t}}g=p.createElement(c),xi(g,c,a),p.head.appendChild(g);break;default:throw Error(r(468,c))}g[Ht]=i,Kt(g),c=g}i.stateNode=c}else Rb(p,i.type,i.stateNode);else i.stateNode=Mb(p,c,i.memoizedProps);else g!==c?(g===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):g.count--,c===null?Rb(p,i.type,i.stateNode):Mb(p,c,i.memoizedProps)):c===null&&i.stateNode!==null&&Qh(i,i.memoizedProps,a.memoizedProps)}break;case 27:Hi(n,i),Fi(i),c&512&&(Zt||a===null||Us(a,a.return)),a!==null&&c&4&&Qh(i,i.memoizedProps,a.memoizedProps);break;case 5:if(Hi(n,i),Fi(i),c&512&&(Zt||a===null||Us(a,a.return)),i.flags&32){p=i.stateNode;try{Oe(p,"")}catch(Ce){dt(i,i.return,Ce)}}c&4&&i.stateNode!=null&&(p=i.memoizedProps,Qh(i,p,a!==null?a.memoizedProps:p)),c&1024&&(tf=!0);break;case 6:if(Hi(n,i),Fi(i),c&4){if(i.stateNode===null)throw Error(r(162));c=i.memoizedProps,a=i.stateNode;try{a.nodeValue=c}catch(Ce){dt(i,i.return,Ce)}}break;case 3:if(Su=null,p=Ds,Ds=yu(n.containerInfo),Hi(n,i),Ds=p,Fi(i),c&4&&a!==null&&a.memoizedState.isDehydrated)try{ao(n.containerInfo)}catch(Ce){dt(i,i.return,Ce)}tf&&(tf=!1,Rv(i));break;case 4:c=Ds,Ds=yu(i.stateNode.containerInfo),Hi(n,i),Fi(i),Ds=c;break;case 12:Hi(n,i),Fi(i);break;case 31:Hi(n,i),Fi(i),c&4&&(c=i.updateQueue,c!==null&&(i.updateQueue=null,au(i,c)));break;case 13:Hi(n,i),Fi(i),i.child.flags&8192&&i.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(lu=At()),c&4&&(c=i.updateQueue,c!==null&&(i.updateQueue=null,au(i,c)));break;case 22:p=i.memoizedState!==null;var L=a!==null&&a.memoizedState!==null,X=Cn,se=Zt;if(Cn=X||p,Zt=se||L,Hi(n,i),Zt=se,Cn=X,Fi(i),c&8192)e:for(n=i.stateNode,n._visibility=p?n._visibility&-2:n._visibility|1,p&&(a===null||L||Cn||Zt||ea(i)),a=null,n=i;;){if(n.tag===5||n.tag===26){if(a===null){L=a=n;try{if(g=L.stateNode,p)S=g.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{C=L.stateNode;var ae=L.memoizedProps.style,Q=ae!=null&&ae.hasOwnProperty("display")?ae.display:null;C.style.display=Q==null||typeof Q=="boolean"?"":(""+Q).trim()}}catch(Ce){dt(L,L.return,Ce)}}}else if(n.tag===6){if(a===null){L=n;try{L.stateNode.nodeValue=p?"":L.memoizedProps}catch(Ce){dt(L,L.return,Ce)}}}else if(n.tag===18){if(a===null){L=n;try{var te=L.stateNode;p?yb(te,!0):yb(L.stateNode,!1)}catch(Ce){dt(L,L.return,Ce)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===i)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===i)break e;for(;n.sibling===null;){if(n.return===null||n.return===i)break e;a===n&&(a=null),n=n.return}a===n&&(a=null),n.sibling.return=n.return,n=n.sibling}c&4&&(c=i.updateQueue,c!==null&&(a=c.retryQueue,a!==null&&(c.retryQueue=null,au(i,a))));break;case 19:Hi(n,i),Fi(i),c&4&&(c=i.updateQueue,c!==null&&(i.updateQueue=null,au(i,c)));break;case 30:break;case 21:break;default:Hi(n,i),Fi(i)}}function Fi(i){var n=i.flags;if(n&2){try{for(var a,c=i.return;c!==null;){if(Sv(c)){a=c;break}c=c.return}if(a==null)throw Error(r(160));switch(a.tag){case 27:var p=a.stateNode,g=Jh(i);ru(i,g,p);break;case 5:var S=a.stateNode;a.flags&32&&(Oe(S,""),a.flags&=-33);var C=Jh(i);ru(i,C,S);break;case 3:case 4:var L=a.stateNode.containerInfo,X=Jh(i);ef(i,X,L);break;default:throw Error(r(161))}}catch(se){dt(i,i.return,se)}i.flags&=-3}n&4096&&(i.flags&=-4097)}function Rv(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var n=i;Rv(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),i=i.sibling}}function kn(i,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Cv(i,n.alternate,n),n=n.sibling}function ea(i){for(i=i.child;i!==null;){var n=i;switch(n.tag){case 0:case 11:case 14:case 15:nr(4,n,n.return),ea(n);break;case 1:Us(n,n.return);var a=n.stateNode;typeof a.componentWillUnmount=="function"&&yv(n,n.return,a),ea(n);break;case 27:pl(n.stateNode);case 26:case 5:Us(n,n.return),ea(n);break;case 22:n.memoizedState===null&&ea(n);break;case 30:ea(n);break;default:ea(n)}i=i.sibling}}function Tn(i,n,a){for(a=a&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var c=n.alternate,p=i,g=n,S=g.flags;switch(g.tag){case 0:case 11:case 15:Tn(p,g,a),rl(4,g);break;case 1:if(Tn(p,g,a),c=g,p=c.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(X){dt(c,c.return,X)}if(c=g,p=c.updateQueue,p!==null){var C=c.stateNode;try{var L=p.shared.hiddenCallbacks;if(L!==null)for(p.shared.hiddenCallbacks=null,p=0;p<L.length;p++)l_(L[p],C)}catch(X){dt(c,c.return,X)}}a&&S&64&&bv(g),al(g,g.return);break;case 27:wv(g);case 26:case 5:Tn(p,g,a),a&&c===null&&S&4&&xv(g),al(g,g.return);break;case 12:Tn(p,g,a);break;case 31:Tn(p,g,a),a&&S&4&&Tv(p,g);break;case 13:Tn(p,g,a),a&&S&4&&Mv(p,g);break;case 22:g.memoizedState===null&&Tn(p,g,a),al(g,g.return);break;case 30:break;default:Tn(p,g,a)}n=n.sibling}}function sf(i,n){var a=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),i=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),i!==a&&(i!=null&&i.refCount++,a!=null&&Ko(a))}function nf(i,n){i=null,n.alternate!==null&&(i=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==i&&(n.refCount++,i!=null&&Ko(i))}function Os(i,n,a,c){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Dv(i,n,a,c),n=n.sibling}function Dv(i,n,a,c){var p=n.flags;switch(n.tag){case 0:case 11:case 15:Os(i,n,a,c),p&2048&&rl(9,n);break;case 1:Os(i,n,a,c);break;case 3:Os(i,n,a,c),p&2048&&(i=null,n.alternate!==null&&(i=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==i&&(n.refCount++,i!=null&&Ko(i)));break;case 12:if(p&2048){Os(i,n,a,c),i=n.stateNode;try{var g=n.memoizedProps,S=g.id,C=g.onPostCommit;typeof C=="function"&&C(S,n.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(L){dt(n,n.return,L)}}else Os(i,n,a,c);break;case 31:Os(i,n,a,c);break;case 13:Os(i,n,a,c);break;case 23:break;case 22:g=n.stateNode,S=n.alternate,n.memoizedState!==null?g._visibility&2?Os(i,n,a,c):ol(i,n):g._visibility&2?Os(i,n,a,c):(g._visibility|=2,Ya(i,n,a,c,(n.subtreeFlags&10256)!==0||!1)),p&2048&&sf(S,n);break;case 24:Os(i,n,a,c),p&2048&&nf(n.alternate,n);break;default:Os(i,n,a,c)}}function Ya(i,n,a,c,p){for(p=p&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var g=i,S=n,C=a,L=c,X=S.flags;switch(S.tag){case 0:case 11:case 15:Ya(g,S,C,L,p),rl(8,S);break;case 23:break;case 22:var se=S.stateNode;S.memoizedState!==null?se._visibility&2?Ya(g,S,C,L,p):ol(g,S):(se._visibility|=2,Ya(g,S,C,L,p)),p&&X&2048&&sf(S.alternate,S);break;case 24:Ya(g,S,C,L,p),p&&X&2048&&nf(S.alternate,S);break;default:Ya(g,S,C,L,p)}n=n.sibling}}function ol(i,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var a=i,c=n,p=c.flags;switch(c.tag){case 22:ol(a,c),p&2048&&sf(c.alternate,c);break;case 24:ol(a,c),p&2048&&nf(c.alternate,c);break;default:ol(a,c)}n=n.sibling}}var ll=8192;function Xa(i,n,a){if(i.subtreeFlags&ll)for(i=i.child;i!==null;)Ov(i,n,a),i=i.sibling}function Ov(i,n,a){switch(i.tag){case 26:Xa(i,n,a),i.flags&ll&&i.memoizedState!==null&&Q3(a,Ds,i.memoizedState,i.memoizedProps);break;case 5:Xa(i,n,a);break;case 3:case 4:var c=Ds;Ds=yu(i.stateNode.containerInfo),Xa(i,n,a),Ds=c;break;case 22:i.memoizedState===null&&(c=i.alternate,c!==null&&c.memoizedState!==null?(c=ll,ll=16777216,Xa(i,n,a),ll=c):Xa(i,n,a));break;default:Xa(i,n,a)}}function Lv(i){var n=i.alternate;if(n!==null&&(i=n.child,i!==null)){n.child=null;do n=i.sibling,i.sibling=null,i=n;while(i!==null)}}function cl(i){var n=i.deletions;if((i.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var c=n[a];ci=c,Bv(c,i)}Lv(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)jv(i),i=i.sibling}function jv(i){switch(i.tag){case 0:case 11:case 15:cl(i),i.flags&2048&&nr(9,i,i.return);break;case 3:cl(i);break;case 12:cl(i);break;case 22:var n=i.stateNode;i.memoizedState!==null&&n._visibility&2&&(i.return===null||i.return.tag!==13)?(n._visibility&=-3,ou(i)):cl(i);break;default:cl(i)}}function ou(i){var n=i.deletions;if((i.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var c=n[a];ci=c,Bv(c,i)}Lv(i)}for(i=i.child;i!==null;){switch(n=i,n.tag){case 0:case 11:case 15:nr(8,n,n.return),ou(n);break;case 22:a=n.stateNode,a._visibility&2&&(a._visibility&=-3,ou(n));break;default:ou(n)}i=i.sibling}}function Bv(i,n){for(;ci!==null;){var a=ci;switch(a.tag){case 0:case 11:case 15:nr(8,a,n);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var c=a.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Ko(a.memoizedState.cache)}if(c=a.child,c!==null)c.return=a,ci=c;else e:for(a=i;ci!==null;){c=ci;var p=c.sibling,g=c.return;if(Nv(c),c===a){ci=null;break e}if(p!==null){p.return=g,ci=p;break e}ci=g}}}var f3={getCacheForType:function(i){var n=bi(Wt),a=n.data.get(i);return a===void 0&&(a=i(),n.data.set(i,a)),a},cacheSignal:function(){return bi(Wt).controller.signal}},m3=typeof WeakMap=="function"?WeakMap:Map,ot=0,vt=null,We=null,Ze=0,ut=0,ts=null,rr=!1,Za=!1,rf=!1,Mn=0,jt=0,ar=0,ta=0,af=0,is=0,Qa=0,ul=null,Vi=null,of=!1,lu=0,zv=0,cu=1/0,uu=null,or=null,ii=0,lr=null,Ja=null,An=0,lf=0,cf=null,Pv=null,dl=0,uf=null;function ss(){return(ot&2)!==0&&Ze!==0?Ze&-Ze:k.T!==null?gf():Ca()}function Iv(){if(is===0)if((Ze&536870912)===0||Je){var i=As;As<<=1,(As&3932160)===0&&(As=262144),is=i}else is=536870912;return i=Ji.current,i!==null&&(i.flags|=32),is}function $i(i,n,a){(i===vt&&(ut===2||ut===9)||i.cancelPendingCommit!==null)&&(eo(i,0),cr(i,Ze,is,!1)),_t(i,a),((ot&2)===0||i!==vt)&&(i===vt&&((ot&2)===0&&(ta|=a),jt===4&&cr(i,Ze,is,!1)),Hs(i))}function Uv(i,n,a){if((ot&6)!==0)throw Error(r(327));var c=!a&&(n&127)===0&&(n&i.expiredLanes)===0||ne(i,n),p=c?_3(i,n):hf(i,n,!0),g=c;do{if(p===0){Za&&!c&&cr(i,n,0,!1);break}else{if(a=i.current.alternate,g&&!p3(a)){p=hf(i,n,!1),g=!1;continue}if(p===2){if(g=n,i.errorRecoveryDisabledLanes&g)var S=0;else S=i.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){n=S;e:{var C=i;p=ul;var L=C.current.memoizedState.isDehydrated;if(L&&(eo(C,S).flags|=256),S=hf(C,S,!1),S!==2){if(rf&&!L){C.errorRecoveryDisabledLanes|=g,ta|=g,p=4;break e}g=Vi,Vi=p,g!==null&&(Vi===null?Vi=g:Vi.push.apply(Vi,g))}p=S}if(g=!1,p!==2)continue}}if(p===1){eo(i,0),cr(i,n,0,!0);break}e:{switch(c=i,g=p,g){case 0:case 1:throw Error(r(345));case 4:if((n&4194048)!==n)break;case 6:cr(c,n,is,!rr);break e;case 2:Vi=null;break;case 3:case 5:break;default:throw Error(r(329))}if((n&62914560)===n&&(p=lu+300-At(),10<p)){if(cr(c,n,is,!rr),B(c,0,!0)!==0)break e;An=n,c.timeoutHandle=_b(Hv.bind(null,c,a,Vi,uu,of,n,is,ta,Qa,rr,g,"Throttled",-0,0),p);break e}Hv(c,a,Vi,uu,of,n,is,ta,Qa,rr,g,null,-0,0)}}break}while(!0);Hs(i)}function Hv(i,n,a,c,p,g,S,C,L,X,se,ae,Q,te){if(i.timeoutHandle=-1,ae=n.subtreeFlags,ae&8192||(ae&16785408)===16785408){ae={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:me},Ov(n,g,ae);var Ce=(g&62914560)===g?lu-At():(g&4194048)===g?zv-At():0;if(Ce=J3(ae,Ce),Ce!==null){An=g,i.cancelPendingCommit=Ce(Yv.bind(null,i,n,g,a,c,p,S,C,L,se,ae,null,Q,te)),cr(i,g,S,!X);return}}Yv(i,n,g,a,c,p,S,C,L)}function p3(i){for(var n=i;;){var a=n.tag;if((a===0||a===11||a===15)&&n.flags&16384&&(a=n.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var c=0;c<a.length;c++){var p=a[c],g=p.getSnapshot;p=p.value;try{if(!Zi(g(),p))return!1}catch{return!1}}if(a=n.child,n.subtreeFlags&16384&&a!==null)a.return=n,n=a;else{if(n===i)break;for(;n.sibling===null;){if(n.return===null||n.return===i)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function cr(i,n,a,c){n&=~af,n&=~ta,i.suspendedLanes|=n,i.pingedLanes&=~n,c&&(i.warmLanes|=n),c=i.expirationTimes;for(var p=n;0<p;){var g=31-gi(p),S=1<<g;c[g]=-1,p&=~S}a!==0&&ye(i,a,n)}function du(){return(ot&6)===0?(hl(0),!1):!0}function df(){if(We!==null){if(ut===0)var i=We.return;else i=We,bn=Kr=null,Nh(i),$a=null,Wo=0,i=We;for(;i!==null;)vv(i.alternate,i),i=i.return;We=null}}function eo(i,n){var a=i.timeoutHandle;a!==-1&&(i.timeoutHandle=-1,j3(a)),a=i.cancelPendingCommit,a!==null&&(i.cancelPendingCommit=null,a()),An=0,df(),vt=i,We=a=_n(i.current,null),Ze=n,ut=0,ts=null,rr=!1,Za=ne(i,n),rf=!1,Qa=is=af=ta=ar=jt=0,Vi=ul=null,of=!1,(n&8)!==0&&(n|=n&32);var c=i.entangledLanes;if(c!==0)for(i=i.entanglements,c&=n;0<c;){var p=31-gi(c),g=1<<p;n|=i[p],c&=~g}return Mn=n,Dc(),a}function Fv(i,n){He=null,k.H=il,n===Va||n===Uc?(n=n_(),ut=3):n===mh?(n=n_(),ut=4):ut=n===Fh?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,ts=n,We===null&&(jt=1,eu(i,hs(n,i.current)))}function Vv(){var i=Ji.current;return i===null?!0:(Ze&4194048)===Ze?gs===null:(Ze&62914560)===Ze||(Ze&536870912)!==0?i===gs:!1}function $v(){var i=k.H;return k.H=il,i===null?il:i}function qv(){var i=k.A;return k.A=f3,i}function hu(){jt=4,rr||(Ze&4194048)!==Ze&&Ji.current!==null||(Za=!0),(ar&134217727)===0&&(ta&134217727)===0||vt===null||cr(vt,Ze,is,!1)}function hf(i,n,a){var c=ot;ot|=2;var p=$v(),g=qv();(vt!==i||Ze!==n)&&(uu=null,eo(i,n)),n=!1;var S=jt;e:do try{if(ut!==0&&We!==null){var C=We,L=ts;switch(ut){case 8:df(),S=6;break e;case 3:case 2:case 9:case 6:Ji.current===null&&(n=!0);var X=ut;if(ut=0,ts=null,to(i,C,L,X),a&&Za){S=0;break e}break;default:X=ut,ut=0,ts=null,to(i,C,L,X)}}g3(),S=jt;break}catch(se){Fv(i,se)}while(!0);return n&&i.shellSuspendCounter++,bn=Kr=null,ot=c,k.H=p,k.A=g,We===null&&(vt=null,Ze=0,Dc()),S}function g3(){for(;We!==null;)Kv(We)}function _3(i,n){var a=ot;ot|=2;var c=$v(),p=qv();vt!==i||Ze!==n?(uu=null,cu=At()+500,eo(i,n)):Za=ne(i,n);e:do try{if(ut!==0&&We!==null){n=We;var g=ts;t:switch(ut){case 1:ut=0,ts=null,to(i,n,g,1);break;case 2:case 9:if(i_(g)){ut=0,ts=null,Gv(n);break}n=function(){ut!==2&&ut!==9||vt!==i||(ut=7),Hs(i)},g.then(n,n);break e;case 3:ut=7;break e;case 4:ut=5;break e;case 7:i_(g)?(ut=0,ts=null,Gv(n)):(ut=0,ts=null,to(i,n,g,7));break;case 5:var S=null;switch(We.tag){case 26:S=We.memoizedState;case 5:case 27:var C=We;if(S?Db(S):C.stateNode.complete){ut=0,ts=null;var L=C.sibling;if(L!==null)We=L;else{var X=C.return;X!==null?(We=X,fu(X)):We=null}break t}}ut=0,ts=null,to(i,n,g,5);break;case 6:ut=0,ts=null,to(i,n,g,6);break;case 8:df(),jt=6;break e;default:throw Error(r(462))}}v3();break}catch(se){Fv(i,se)}while(!0);return bn=Kr=null,k.H=c,k.A=p,ot=a,We!==null?0:(vt=null,Ze=0,Dc(),jt)}function v3(){for(;We!==null&&!No();)Kv(We)}function Kv(i){var n=gv(i.alternate,i,Mn);i.memoizedProps=i.pendingProps,n===null?fu(i):We=n}function Gv(i){var n=i,a=n.alternate;switch(n.tag){case 15:case 0:n=uv(a,n,n.pendingProps,n.type,void 0,Ze);break;case 11:n=uv(a,n,n.pendingProps,n.type.render,n.ref,Ze);break;case 5:Nh(n);default:vv(a,n),n=We=q0(n,Mn),n=gv(a,n,Mn)}i.memoizedProps=i.pendingProps,n===null?fu(i):We=n}function to(i,n,a,c){bn=Kr=null,Nh(n),$a=null,Wo=0;var p=n.return;try{if(a3(i,p,n,a,Ze)){jt=1,eu(i,hs(a,i.current)),We=null;return}}catch(g){if(p!==null)throw We=p,g;jt=1,eu(i,hs(a,i.current)),We=null;return}n.flags&32768?(Je||c===1?i=!0:Za||(Ze&536870912)!==0?i=!1:(rr=i=!0,(c===2||c===9||c===3||c===6)&&(c=Ji.current,c!==null&&c.tag===13&&(c.flags|=16384))),Wv(n,i)):fu(n)}function fu(i){var n=i;do{if((n.flags&32768)!==0){Wv(n,rr);return}i=n.return;var a=c3(n.alternate,n,Mn);if(a!==null){We=a;return}if(n=n.sibling,n!==null){We=n;return}We=n=i}while(n!==null);jt===0&&(jt=5)}function Wv(i,n){do{var a=u3(i.alternate,i);if(a!==null){a.flags&=32767,We=a;return}if(a=i.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!n&&(i=i.sibling,i!==null)){We=i;return}We=i=a}while(i!==null);jt=6,We=null}function Yv(i,n,a,c,p,g,S,C,L){i.cancelPendingCommit=null;do mu();while(ii!==0);if((ot&6)!==0)throw Error(r(327));if(n!==null){if(n===i.current)throw Error(r(177));if(g=n.lanes|n.childLanes,g|=Jd,ke(i,a,g,S,C,L),i===vt&&(We=vt=null,Ze=0),Ja=n,lr=i,An=a,lf=g,cf=p,Pv=c,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,S3(un,function(){return eb(),null})):(i.callbackNode=null,i.callbackPriority=0),c=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||c){c=k.T,k.T=null,p=F.p,F.p=2,S=ot,ot|=4;try{d3(i,n,a)}finally{ot=S,F.p=p,k.T=c}}ii=1,Xv(),Zv(),Qv()}}function Xv(){if(ii===1){ii=0;var i=lr,n=Ja,a=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||a){a=k.T,k.T=null;var c=F.p;F.p=2;var p=ot;ot|=4;try{Av(n,i);var g=Ef,S=B0(i.containerInfo),C=g.focusedElem,L=g.selectionRange;if(S!==C&&C&&C.ownerDocument&&j0(C.ownerDocument.documentElement,C)){if(L!==null&&Wd(C)){var X=L.start,se=L.end;if(se===void 0&&(se=X),"selectionStart"in C)C.selectionStart=X,C.selectionEnd=Math.min(se,C.value.length);else{var ae=C.ownerDocument||document,Q=ae&&ae.defaultView||window;if(Q.getSelection){var te=Q.getSelection(),Ce=C.textContent.length,De=Math.min(L.start,Ce),pt=L.end===void 0?De:Math.min(L.end,Ce);!te.extend&&De>pt&&(S=pt,pt=De,De=S);var $=L0(C,De),P=L0(C,pt);if($&&P&&(te.rangeCount!==1||te.anchorNode!==$.node||te.anchorOffset!==$.offset||te.focusNode!==P.node||te.focusOffset!==P.offset)){var Y=ae.createRange();Y.setStart($.node,$.offset),te.removeAllRanges(),De>pt?(te.addRange(Y),te.extend(P.node,P.offset)):(Y.setEnd(P.node,P.offset),te.addRange(Y))}}}}for(ae=[],te=C;te=te.parentNode;)te.nodeType===1&&ae.push({element:te,left:te.scrollLeft,top:te.scrollTop});for(typeof C.focus=="function"&&C.focus(),C=0;C<ae.length;C++){var re=ae[C];re.element.scrollLeft=re.left,re.element.scrollTop=re.top}}Nu=!!wf,Ef=wf=null}finally{ot=p,F.p=c,k.T=a}}i.current=n,ii=2}}function Zv(){if(ii===2){ii=0;var i=lr,n=Ja,a=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||a){a=k.T,k.T=null;var c=F.p;F.p=2;var p=ot;ot|=4;try{Cv(i,n.alternate,n)}finally{ot=p,F.p=c,k.T=a}}ii=3}}function Qv(){if(ii===4||ii===3){ii=0,xa();var i=lr,n=Ja,a=An,c=Pv;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?ii=5:(ii=0,Ja=lr=null,Jv(i,i.pendingLanes));var p=i.pendingLanes;if(p===0&&(or=null),hn(a),n=n.stateNode,li&&typeof li.onCommitFiberRoot=="function")try{li.onCommitFiberRoot(dn,n,void 0,(n.current.flags&128)===128)}catch{}if(c!==null){n=k.T,p=F.p,F.p=2,k.T=null;try{for(var g=i.onRecoverableError,S=0;S<c.length;S++){var C=c[S];g(C.value,{componentStack:C.stack})}}finally{k.T=n,F.p=p}}(An&3)!==0&&mu(),Hs(i),p=i.pendingLanes,(a&261930)!==0&&(p&42)!==0?i===uf?dl++:(dl=0,uf=i):dl=0,hl(0)}}function Jv(i,n){(i.pooledCacheLanes&=n)===0&&(n=i.pooledCache,n!=null&&(i.pooledCache=null,Ko(n)))}function mu(){return Xv(),Zv(),Qv(),eb()}function eb(){if(ii!==5)return!1;var i=lr,n=lf;lf=0;var a=hn(An),c=k.T,p=F.p;try{F.p=32>a?32:a,k.T=null,a=cf,cf=null;var g=lr,S=An;if(ii=0,Ja=lr=null,An=0,(ot&6)!==0)throw Error(r(331));var C=ot;if(ot|=4,jv(g.current),Dv(g,g.current,S,a),ot=C,hl(0,!1),li&&typeof li.onPostCommitFiberRoot=="function")try{li.onPostCommitFiberRoot(dn,g)}catch{}return!0}finally{F.p=p,k.T=c,Jv(i,n)}}function tb(i,n,a){n=hs(a,n),n=Hh(i.stateNode,n,2),i=tr(i,n,2),i!==null&&(_t(i,2),Hs(i))}function dt(i,n,a){if(i.tag===3)tb(i,i,a);else for(;n!==null;){if(n.tag===3){tb(n,i,a);break}else if(n.tag===1){var c=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(or===null||!or.has(c))){i=hs(a,i),a=iv(2),c=tr(n,a,2),c!==null&&(sv(a,c,n,i),_t(c,2),Hs(c));break}}n=n.return}}function ff(i,n,a){var c=i.pingCache;if(c===null){c=i.pingCache=new m3;var p=new Set;c.set(n,p)}else p=c.get(n),p===void 0&&(p=new Set,c.set(n,p));p.has(a)||(rf=!0,p.add(a),i=b3.bind(null,i,n,a),n.then(i,i))}function b3(i,n,a){var c=i.pingCache;c!==null&&c.delete(n),i.pingedLanes|=i.suspendedLanes&a,i.warmLanes&=~a,vt===i&&(Ze&a)===a&&(jt===4||jt===3&&(Ze&62914560)===Ze&&300>At()-lu?(ot&2)===0&&eo(i,0):af|=a,Qa===Ze&&(Qa=0)),Hs(i)}function ib(i,n){n===0&&(n=ze()),i=Vr(i,n),i!==null&&(_t(i,n),Hs(i))}function y3(i){var n=i.memoizedState,a=0;n!==null&&(a=n.retryLane),ib(i,a)}function x3(i,n){var a=0;switch(i.tag){case 31:case 13:var c=i.stateNode,p=i.memoizedState;p!==null&&(a=p.retryLane);break;case 19:c=i.stateNode;break;case 22:c=i.stateNode._retryCache;break;default:throw Error(r(314))}c!==null&&c.delete(n),ib(i,a)}function S3(i,n){return Hn(i,n)}var pu=null,io=null,mf=!1,gu=!1,pf=!1,ur=0;function Hs(i){i!==io&&i.next===null&&(io===null?pu=io=i:io=io.next=i),gu=!0,mf||(mf=!0,E3())}function hl(i,n){if(!pf&&gu){pf=!0;do for(var a=!1,c=pu;c!==null;){if(i!==0){var p=c.pendingLanes;if(p===0)var g=0;else{var S=c.suspendedLanes,C=c.pingedLanes;g=(1<<31-gi(42|i)+1)-1,g&=p&~(S&~C),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(a=!0,ab(c,g))}else g=Ze,g=B(c,c===vt?g:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(g&3)===0||ne(c,g)||(a=!0,ab(c,g));c=c.next}while(a);pf=!1}}function w3(){sb()}function sb(){gu=mf=!1;var i=0;ur!==0&&L3()&&(i=ur);for(var n=At(),a=null,c=pu;c!==null;){var p=c.next,g=nb(c,n);g===0?(c.next=null,a===null?pu=p:a.next=p,p===null&&(io=a)):(a=c,(i!==0||(g&3)!==0)&&(gu=!0)),c=p}ii!==0&&ii!==5||hl(i),ur!==0&&(ur=0)}function nb(i,n){for(var a=i.suspendedLanes,c=i.pingedLanes,p=i.expirationTimes,g=i.pendingLanes&-62914561;0<g;){var S=31-gi(g),C=1<<S,L=p[S];L===-1?((C&a)===0||(C&c)!==0)&&(p[S]=_e(C,n)):L<=n&&(i.expiredLanes|=C),g&=~C}if(n=vt,a=Ze,a=B(i,i===n?a:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),c=i.callbackNode,a===0||i===n&&(ut===2||ut===9)||i.cancelPendingCommit!==null)return c!==null&&c!==null&&on(c),i.callbackNode=null,i.callbackPriority=0;if((a&3)===0||ne(i,a)){if(n=a&-a,n===i.callbackPriority)return n;switch(c!==null&&on(c),hn(a)){case 2:case 8:a=cn;break;case 32:a=un;break;case 268435456:a=Fn;break;default:a=un}return c=rb.bind(null,i),a=Hn(a,c),i.callbackPriority=n,i.callbackNode=a,n}return c!==null&&c!==null&&on(c),i.callbackPriority=2,i.callbackNode=null,2}function rb(i,n){if(ii!==0&&ii!==5)return i.callbackNode=null,i.callbackPriority=0,null;var a=i.callbackNode;if(mu()&&i.callbackNode!==a)return null;var c=Ze;return c=B(i,i===vt?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),c===0?null:(Uv(i,c,n),nb(i,At()),i.callbackNode!=null&&i.callbackNode===a?rb.bind(null,i):null)}function ab(i,n){if(mu())return null;Uv(i,n,!0)}function E3(){B3(function(){(ot&6)!==0?Hn(pi,w3):sb()})}function gf(){if(ur===0){var i=Ha;i===0&&(i=et,et<<=1,(et&261888)===0&&(et=256)),ur=i}return ur}function ob(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Gn(""+i)}function lb(i,n){var a=n.ownerDocument.createElement("input");return a.name=n.name,a.value=n.value,i.id&&a.setAttribute("form",i.id),n.parentNode.insertBefore(a,n),i=new FormData(i),a.parentNode.removeChild(a),i}function C3(i,n,a,c,p){if(n==="submit"&&a&&a.stateNode===p){var g=ob((p[Ni]||null).action),S=c.submitter;S&&(n=(n=S[Ni]||null)?ob(n.formAction):S.getAttribute("formAction"),n!==null&&(g=n,S=null));var C=new Tc("action","action",null,c,p);i.push({event:C,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(ur!==0){var L=S?lb(p,S):new FormData(p);jh(a,{pending:!0,data:L,method:p.method,action:g},null,L)}}else typeof g=="function"&&(C.preventDefault(),L=S?lb(p,S):new FormData(p),jh(a,{pending:!0,data:L,method:p.method,action:g},g,L))},currentTarget:p}]})}}for(var _f=0;_f<Qd.length;_f++){var vf=Qd[_f],N3=vf.toLowerCase(),k3=vf[0].toUpperCase()+vf.slice(1);Rs(N3,"on"+k3)}Rs(I0,"onAnimationEnd"),Rs(U0,"onAnimationIteration"),Rs(H0,"onAnimationStart"),Rs("dblclick","onDoubleClick"),Rs("focusin","onFocus"),Rs("focusout","onBlur"),Rs(VC,"onTransitionRun"),Rs($C,"onTransitionStart"),Rs(qC,"onTransitionCancel"),Rs(F0,"onTransitionEnd"),ue("onMouseEnter",["mouseout","mouseover"]),ue("onMouseLeave",["mouseout","mouseover"]),ue("onPointerEnter",["pointerout","pointerover"]),ue("onPointerLeave",["pointerout","pointerover"]),mn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),mn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),mn("onBeforeInput",["compositionend","keypress","textInput","paste"]),mn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),mn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),mn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var fl="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(" "),T3=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(fl));function cb(i,n){n=(n&4)!==0;for(var a=0;a<i.length;a++){var c=i[a],p=c.event;c=c.listeners;e:{var g=void 0;if(n)for(var S=c.length-1;0<=S;S--){var C=c[S],L=C.instance,X=C.currentTarget;if(C=C.listener,L!==g&&p.isPropagationStopped())break e;g=C,p.currentTarget=X;try{g(p)}catch(se){Rc(se)}p.currentTarget=null,g=L}else for(S=0;S<c.length;S++){if(C=c[S],L=C.instance,X=C.currentTarget,C=C.listener,L!==g&&p.isPropagationStopped())break e;g=C,p.currentTarget=X;try{g(p)}catch(se){Rc(se)}p.currentTarget=null,g=L}}}}function Ye(i,n){var a=n[Mo];a===void 0&&(a=n[Mo]=new Set);var c=i+"__bubble";a.has(c)||(ub(n,i,2,!1),a.add(c))}function bf(i,n,a){var c=0;n&&(c|=4),ub(a,i,c,n)}var _u="_reactListening"+Math.random().toString(36).slice(2);function yf(i){if(!i[_u]){i[_u]=!0,yc.forEach(function(a){a!=="selectionchange"&&(T3.has(a)||bf(a,!1,i),bf(a,!0,i))});var n=i.nodeType===9?i:i.ownerDocument;n===null||n[_u]||(n[_u]=!0,bf("selectionchange",!1,n))}}function ub(i,n,a,c){switch(Ib(n)){case 2:var p=iN;break;case 8:p=sN;break;default:p=jf}a=p.bind(null,n,a,i),p=void 0,!Id||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(p=!0),c?p!==void 0?i.addEventListener(n,a,{capture:!0,passive:p}):i.addEventListener(n,a,!0):p!==void 0?i.addEventListener(n,a,{passive:p}):i.addEventListener(n,a,!1)}function xf(i,n,a,c,p){var g=c;if((n&1)===0&&(n&2)===0&&c!==null)e:for(;;){if(c===null)return;var S=c.tag;if(S===3||S===4){var C=c.stateNode.containerInfo;if(C===p)break;if(S===4)for(S=c.return;S!==null;){var L=S.tag;if((L===3||L===4)&&S.stateNode.containerInfo===p)return;S=S.return}for(;C!==null;){if(S=Ai(C),S===null)return;if(L=S.tag,L===5||L===6||L===26||L===27){c=g=S;continue e}C=C.parentNode}}c=c.return}Ec(function(){var X=g,se=Ue(a),ae=[];e:{var Q=V0.get(i);if(Q!==void 0){var te=Tc,Ce=i;switch(i){case"keypress":if(Nc(a)===0)break e;case"keydown":case"keyup":te=xC;break;case"focusin":Ce="focus",te=Vd;break;case"focusout":Ce="blur",te=Vd;break;case"beforeblur":case"afterblur":te=Vd;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":te=v0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":te=cC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":te=EC;break;case I0:case U0:case H0:te=hC;break;case F0:te=NC;break;case"scroll":case"scrollend":te=oC;break;case"wheel":te=TC;break;case"copy":case"cut":case"paste":te=mC;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":te=y0;break;case"toggle":case"beforetoggle":te=AC}var De=(n&4)!==0,pt=!De&&(i==="scroll"||i==="scrollend"),$=De?Q!==null?Q+"Capture":null:Q;De=[];for(var P=X,Y;P!==null;){var re=P;if(Y=re.stateNode,re=re.tag,re!==5&&re!==26&&re!==27||Y===null||$===null||(re=jo(P,$),re!=null&&De.push(ml(P,re,Y))),pt)break;P=P.return}0<De.length&&(Q=new te(Q,Ce,null,a,se),ae.push({event:Q,listeners:De}))}}if((n&7)===0){e:{if(Q=i==="mouseover"||i==="pointerover",te=i==="mouseout"||i==="pointerout",Q&&a!==Te&&(Ce=a.relatedTarget||a.fromElement)&&(Ai(Ce)||Ce[Vn]))break e;if((te||Q)&&(Q=se.window===se?se:(Q=se.ownerDocument)?Q.defaultView||Q.parentWindow:window,te?(Ce=a.relatedTarget||a.toElement,te=X,Ce=Ce?Ai(Ce):null,Ce!==null&&(pt=l(Ce),De=Ce.tag,Ce!==pt||De!==5&&De!==27&&De!==6)&&(Ce=null)):(te=null,Ce=X),te!==Ce)){if(De=v0,re="onMouseLeave",$="onMouseEnter",P="mouse",(i==="pointerout"||i==="pointerover")&&(De=y0,re="onPointerLeave",$="onPointerEnter",P="pointer"),pt=te==null?Q:$n(te),Y=Ce==null?Q:$n(Ce),Q=new De(re,P+"leave",te,a,se),Q.target=pt,Q.relatedTarget=Y,re=null,Ai(se)===X&&(De=new De($,P+"enter",Ce,a,se),De.target=Y,De.relatedTarget=pt,re=De),pt=re,te&&Ce)t:{for(De=M3,$=te,P=Ce,Y=0,re=$;re;re=De(re))Y++;re=0;for(var Re=P;Re;Re=De(Re))re++;for(;0<Y-re;)$=De($),Y--;for(;0<re-Y;)P=De(P),re--;for(;Y--;){if($===P||P!==null&&$===P.alternate){De=$;break t}$=De($),P=De(P)}De=null}else De=null;te!==null&&db(ae,Q,te,De,!1),Ce!==null&&pt!==null&&db(ae,pt,Ce,De,!0)}}e:{if(Q=X?$n(X):window,te=Q.nodeName&&Q.nodeName.toLowerCase(),te==="select"||te==="input"&&Q.type==="file")var st=T0;else if(N0(Q))if(M0)st=UC;else{st=PC;var Me=zC}else te=Q.nodeName,!te||te.toLowerCase()!=="input"||Q.type!=="checkbox"&&Q.type!=="radio"?X&&Kn(X.elementType)&&(st=T0):st=IC;if(st&&(st=st(i,X))){k0(ae,st,a,se);break e}Me&&Me(i,Q,X),i==="focusout"&&X&&Q.type==="number"&&X.memoizedProps.value!=null&&Aa(Q,"number",Q.value)}switch(Me=X?$n(X):window,i){case"focusin":(N0(Me)||Me.contentEditable==="true")&&(Oa=Me,Yd=X,Vo=null);break;case"focusout":Vo=Yd=Oa=null;break;case"mousedown":Xd=!0;break;case"contextmenu":case"mouseup":case"dragend":Xd=!1,z0(ae,a,se);break;case"selectionchange":if(FC)break;case"keydown":case"keyup":z0(ae,a,se)}var Fe;if(qd)e:{switch(i){case"compositionstart":var Qe="onCompositionStart";break e;case"compositionend":Qe="onCompositionEnd";break e;case"compositionupdate":Qe="onCompositionUpdate";break e}Qe=void 0}else Da?E0(i,a)&&(Qe="onCompositionEnd"):i==="keydown"&&a.keyCode===229&&(Qe="onCompositionStart");Qe&&(x0&&a.locale!=="ko"&&(Da||Qe!=="onCompositionStart"?Qe==="onCompositionEnd"&&Da&&(Fe=g0()):(Wn=se,Ud="value"in Wn?Wn.value:Wn.textContent,Da=!0)),Me=vu(X,Qe),0<Me.length&&(Qe=new b0(Qe,i,null,a,se),ae.push({event:Qe,listeners:Me}),Fe?Qe.data=Fe:(Fe=C0(a),Fe!==null&&(Qe.data=Fe)))),(Fe=DC?OC(i,a):LC(i,a))&&(Qe=vu(X,"onBeforeInput"),0<Qe.length&&(Me=new b0("onBeforeInput","beforeinput",null,a,se),ae.push({event:Me,listeners:Qe}),Me.data=Fe)),C3(ae,i,X,a,se)}cb(ae,n)})}function ml(i,n,a){return{instance:i,listener:n,currentTarget:a}}function vu(i,n){for(var a=n+"Capture",c=[];i!==null;){var p=i,g=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||g===null||(p=jo(i,a),p!=null&&c.unshift(ml(i,p,g)),p=jo(i,n),p!=null&&c.push(ml(i,p,g))),i.tag===3)return c;i=i.return}return[]}function M3(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function db(i,n,a,c,p){for(var g=n._reactName,S=[];a!==null&&a!==c;){var C=a,L=C.alternate,X=C.stateNode;if(C=C.tag,L!==null&&L===c)break;C!==5&&C!==26&&C!==27||X===null||(L=X,p?(X=jo(a,g),X!=null&&S.unshift(ml(a,X,L))):p||(X=jo(a,g),X!=null&&S.push(ml(a,X,L)))),a=a.return}S.length!==0&&i.push({event:n,listeners:S})}var A3=/\r\n?/g,R3=/\u0000|\uFFFD/g;function hb(i){return(typeof i=="string"?i:""+i).replace(A3,`
|
|
9
|
-
`).replace(R3,"")}function fb(i,n){return n=hb(n),hb(i)===n}function mt(i,n,a,c,p,g){switch(a){case"children":typeof c=="string"?n==="body"||n==="textarea"&&c===""||Oe(i,c):(typeof c=="number"||typeof c=="bigint")&&n!=="body"&&Oe(i,""+c);break;case"className":Yi(i,"class",c);break;case"tabIndex":Yi(i,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":Yi(i,a,c);break;case"style":ct(i,c,g);break;case"data":if(n!=="object"){Yi(i,"data",c);break}case"src":case"href":if(c===""&&(n!=="a"||a!=="href")){i.removeAttribute(a);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){i.removeAttribute(a);break}c=Gn(""+c),i.setAttribute(a,c);break;case"action":case"formAction":if(typeof c=="function"){i.setAttribute(a,"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 g=="function"&&(a==="formAction"?(n!=="input"&&mt(i,n,"name",p.name,p,null),mt(i,n,"formEncType",p.formEncType,p,null),mt(i,n,"formMethod",p.formMethod,p,null),mt(i,n,"formTarget",p.formTarget,p,null)):(mt(i,n,"encType",p.encType,p,null),mt(i,n,"method",p.method,p,null),mt(i,n,"target",p.target,p,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){i.removeAttribute(a);break}c=Gn(""+c),i.setAttribute(a,c);break;case"onClick":c!=null&&(i.onclick=me);break;case"onScroll":c!=null&&Ye("scroll",i);break;case"onScrollEnd":c!=null&&Ye("scrollend",i);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(r(61));if(a=c.__html,a!=null){if(p.children!=null)throw Error(r(60));i.innerHTML=a}}break;case"multiple":i.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":i.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"){i.removeAttribute("xlink:href");break}a=Gn(""+c),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);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"?i.setAttribute(a,""+c):i.removeAttribute(a);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"?i.setAttribute(a,""):i.removeAttribute(a);break;case"capture":case"download":c===!0?i.setAttribute(a,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?i.setAttribute(a,c):i.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?i.setAttribute(a,c):i.removeAttribute(a);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?i.removeAttribute(a):i.setAttribute(a,c);break;case"popover":Ye("beforetoggle",i),Ye("toggle",i),ki(i,"popover",c);break;case"xlinkActuate":zi(i,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":zi(i,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":zi(i,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":zi(i,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":zi(i,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":zi(i,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":zi(i,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":zi(i,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":zi(i,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":ki(i,"is",c);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=pn.get(a)||a,ki(i,a,c))}}function Sf(i,n,a,c,p,g){switch(a){case"style":ct(i,c,g);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(r(61));if(a=c.__html,a!=null){if(p.children!=null)throw Error(r(60));i.innerHTML=a}}break;case"children":typeof c=="string"?Oe(i,c):(typeof c=="number"||typeof c=="bigint")&&Oe(i,""+c);break;case"onScroll":c!=null&&Ye("scroll",i);break;case"onScrollEnd":c!=null&&Ye("scrollend",i);break;case"onClick":c!=null&&(i.onclick=me);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Pr.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(p=a.endsWith("Capture"),n=a.slice(2,p?a.length-7:void 0),g=i[Ni]||null,g=g!=null?g[a]:null,typeof g=="function"&&i.removeEventListener(n,g,p),typeof c=="function")){typeof g!="function"&&g!==null&&(a in i?i[a]=null:i.hasAttribute(a)&&i.removeAttribute(a)),i.addEventListener(n,c,p);break e}a in i?i[a]=c:c===!0?i.setAttribute(a,""):ki(i,a,c)}}}function xi(i,n,a){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ye("error",i),Ye("load",i);var c=!1,p=!1,g;for(g in a)if(a.hasOwnProperty(g)){var S=a[g];if(S!=null)switch(g){case"src":c=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:mt(i,n,g,S,a,null)}}p&&mt(i,n,"srcSet",a.srcSet,a,null),c&&mt(i,n,"src",a.src,a,null);return;case"input":Ye("invalid",i);var C=g=S=p=null,L=null,X=null;for(c in a)if(a.hasOwnProperty(c)){var se=a[c];if(se!=null)switch(c){case"name":p=se;break;case"type":S=se;break;case"checked":L=se;break;case"defaultChecked":X=se;break;case"value":g=se;break;case"defaultValue":C=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(r(137,n));break;default:mt(i,n,c,se,a,null)}}Ir(i,g,C,L,X,S,p,!1);return;case"select":Ye("invalid",i),c=S=g=null;for(p in a)if(a.hasOwnProperty(p)&&(C=a[p],C!=null))switch(p){case"value":g=C;break;case"defaultValue":S=C;break;case"multiple":c=C;default:mt(i,n,p,C,a,null)}n=g,a=S,i.multiple=!!c,n!=null?_i(i,!!c,n,!1):a!=null&&_i(i,!!c,a,!0);return;case"textarea":Ye("invalid",i),g=p=c=null;for(S in a)if(a.hasOwnProperty(S)&&(C=a[S],C!=null))switch(S){case"value":c=C;break;case"defaultValue":p=C;break;case"children":g=C;break;case"dangerouslySetInnerHTML":if(C!=null)throw Error(r(91));break;default:mt(i,n,S,C,a,null)}Ra(i,c,p,g);return;case"option":for(L in a)a.hasOwnProperty(L)&&(c=a[L],c!=null)&&(L==="selected"?i.selected=c&&typeof c!="function"&&typeof c!="symbol":mt(i,n,L,c,a,null));return;case"dialog":Ye("beforetoggle",i),Ye("toggle",i),Ye("cancel",i),Ye("close",i);break;case"iframe":case"object":Ye("load",i);break;case"video":case"audio":for(c=0;c<fl.length;c++)Ye(fl[c],i);break;case"image":Ye("error",i),Ye("load",i);break;case"details":Ye("toggle",i);break;case"embed":case"source":case"link":Ye("error",i),Ye("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(X in a)if(a.hasOwnProperty(X)&&(c=a[X],c!=null))switch(X){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:mt(i,n,X,c,a,null)}return;default:if(Kn(n)){for(se in a)a.hasOwnProperty(se)&&(c=a[se],c!==void 0&&Sf(i,n,se,c,a,void 0));return}}for(C in a)a.hasOwnProperty(C)&&(c=a[C],c!=null&&mt(i,n,C,c,a,null))}function D3(i,n,a,c){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,g=null,S=null,C=null,L=null,X=null,se=null;for(te in a){var ae=a[te];if(a.hasOwnProperty(te)&&ae!=null)switch(te){case"checked":break;case"value":break;case"defaultValue":L=ae;default:c.hasOwnProperty(te)||mt(i,n,te,null,c,ae)}}for(var Q in c){var te=c[Q];if(ae=a[Q],c.hasOwnProperty(Q)&&(te!=null||ae!=null))switch(Q){case"type":g=te;break;case"name":p=te;break;case"checked":X=te;break;case"defaultChecked":se=te;break;case"value":S=te;break;case"defaultValue":C=te;break;case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(r(137,n));break;default:te!==ae&&mt(i,n,Q,te,c,ae)}}Do(i,S,C,L,X,se,g,p);return;case"select":te=S=C=Q=null;for(g in a)if(L=a[g],a.hasOwnProperty(g)&&L!=null)switch(g){case"value":break;case"multiple":te=L;default:c.hasOwnProperty(g)||mt(i,n,g,null,c,L)}for(p in c)if(g=c[p],L=a[p],c.hasOwnProperty(p)&&(g!=null||L!=null))switch(p){case"value":Q=g;break;case"defaultValue":C=g;break;case"multiple":S=g;default:g!==L&&mt(i,n,p,g,c,L)}n=C,a=S,c=te,Q!=null?_i(i,!!a,Q,!1):!!c!=!!a&&(n!=null?_i(i,!!a,n,!0):_i(i,!!a,a?[]:"",!1));return;case"textarea":te=Q=null;for(C in a)if(p=a[C],a.hasOwnProperty(C)&&p!=null&&!c.hasOwnProperty(C))switch(C){case"value":break;case"children":break;default:mt(i,n,C,null,c,p)}for(S in c)if(p=c[S],g=a[S],c.hasOwnProperty(S)&&(p!=null||g!=null))switch(S){case"value":Q=p;break;case"defaultValue":te=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(r(91));break;default:p!==g&&mt(i,n,S,p,c,g)}Sc(i,Q,te);return;case"option":for(var Ce in a)Q=a[Ce],a.hasOwnProperty(Ce)&&Q!=null&&!c.hasOwnProperty(Ce)&&(Ce==="selected"?i.selected=!1:mt(i,n,Ce,null,c,Q));for(L in c)Q=c[L],te=a[L],c.hasOwnProperty(L)&&Q!==te&&(Q!=null||te!=null)&&(L==="selected"?i.selected=Q&&typeof Q!="function"&&typeof Q!="symbol":mt(i,n,L,Q,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 De in a)Q=a[De],a.hasOwnProperty(De)&&Q!=null&&!c.hasOwnProperty(De)&&mt(i,n,De,null,c,Q);for(X in c)if(Q=c[X],te=a[X],c.hasOwnProperty(X)&&Q!==te&&(Q!=null||te!=null))switch(X){case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(r(137,n));break;default:mt(i,n,X,Q,c,te)}return;default:if(Kn(n)){for(var pt in a)Q=a[pt],a.hasOwnProperty(pt)&&Q!==void 0&&!c.hasOwnProperty(pt)&&Sf(i,n,pt,void 0,c,Q);for(se in c)Q=c[se],te=a[se],!c.hasOwnProperty(se)||Q===te||Q===void 0&&te===void 0||Sf(i,n,se,Q,c,te);return}}for(var $ in a)Q=a[$],a.hasOwnProperty($)&&Q!=null&&!c.hasOwnProperty($)&&mt(i,n,$,null,c,Q);for(ae in c)Q=c[ae],te=a[ae],!c.hasOwnProperty(ae)||Q===te||Q==null&&te==null||mt(i,n,ae,Q,c,te)}function mb(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function O3(){if(typeof performance.getEntriesByType=="function"){for(var i=0,n=0,a=performance.getEntriesByType("resource"),c=0;c<a.length;c++){var p=a[c],g=p.transferSize,S=p.initiatorType,C=p.duration;if(g&&C&&mb(S)){for(S=0,C=p.responseEnd,c+=1;c<a.length;c++){var L=a[c],X=L.startTime;if(X>C)break;var se=L.transferSize,ae=L.initiatorType;se&&mb(ae)&&(L=L.responseEnd,S+=se*(L<C?1:(C-X)/(L-X)))}if(--c,n+=8*(g+S)/(p.duration/1e3),i++,10<i)break}}if(0<i)return n/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var wf=null,Ef=null;function bu(i){return i.nodeType===9?i:i.ownerDocument}function pb(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function gb(i,n){if(i===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&n==="foreignObject"?0:i}function Cf(i,n){return i==="textarea"||i==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Nf=null;function L3(){var i=window.event;return i&&i.type==="popstate"?i===Nf?!1:(Nf=i,!0):(Nf=null,!1)}var _b=typeof setTimeout=="function"?setTimeout:void 0,j3=typeof clearTimeout=="function"?clearTimeout:void 0,vb=typeof Promise=="function"?Promise:void 0,B3=typeof queueMicrotask=="function"?queueMicrotask:typeof vb<"u"?function(i){return vb.resolve(null).then(i).catch(z3)}:_b;function z3(i){setTimeout(function(){throw i})}function dr(i){return i==="head"}function bb(i,n){var a=n,c=0;do{var p=a.nextSibling;if(i.removeChild(a),p&&p.nodeType===8)if(a=p.data,a==="/$"||a==="/&"){if(c===0){i.removeChild(p),ao(n);return}c--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")c++;else if(a==="html")pl(i.ownerDocument.documentElement);else if(a==="head"){a=i.ownerDocument.head,pl(a);for(var g=a.firstChild;g;){var S=g.nextSibling,C=g.nodeName;g[zr]||C==="SCRIPT"||C==="STYLE"||C==="LINK"&&g.rel.toLowerCase()==="stylesheet"||a.removeChild(g),g=S}}else a==="body"&&pl(i.ownerDocument.body);a=p}while(a);ao(n)}function yb(i,n){var a=i;i=0;do{var c=a.nextSibling;if(a.nodeType===1?n?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(n?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),c&&c.nodeType===8)if(a=c.data,a==="/$"){if(i===0)break;i--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||i++;a=c}while(a)}function kf(i){var n=i.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var a=n;switch(n=n.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":kf(a),Ao(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}i.removeChild(a)}}function P3(i,n,a,c){for(;i.nodeType===1;){var p=a;if(i.nodeName.toLowerCase()!==n.toLowerCase()){if(!c&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(c){if(!i[zr])switch(n){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(g=i.getAttribute("rel"),g==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(g!==p.rel||i.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||i.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||i.getAttribute("title")!==(p.title==null?null:p.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(g=i.getAttribute("src"),(g!==(p.src==null?null:p.src)||i.getAttribute("type")!==(p.type==null?null:p.type)||i.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&g&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(n==="input"&&i.type==="hidden"){var g=p.name==null?null:""+p.name;if(p.type==="hidden"&&i.getAttribute("name")===g)return i}else return i;if(i=_s(i.nextSibling),i===null)break}return null}function I3(i,n,a){if(n==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!a||(i=_s(i.nextSibling),i===null))return null;return i}function xb(i,n){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!n||(i=_s(i.nextSibling),i===null))return null;return i}function Tf(i){return i.data==="$?"||i.data==="$~"}function Mf(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function U3(i,n){var a=i.ownerDocument;if(i.data==="$~")i._reactRetry=n;else if(i.data!=="$?"||a.readyState!=="loading")n();else{var c=function(){n(),a.removeEventListener("DOMContentLoaded",c)};a.addEventListener("DOMContentLoaded",c),i._reactRetry=c}}function _s(i){for(;i!=null;i=i.nextSibling){var n=i.nodeType;if(n===1||n===3)break;if(n===8){if(n=i.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return i}var Af=null;function Sb(i){i=i.nextSibling;for(var n=0;i;){if(i.nodeType===8){var a=i.data;if(a==="/$"||a==="/&"){if(n===0)return _s(i.nextSibling);n--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||n++}i=i.nextSibling}return null}function wb(i){i=i.previousSibling;for(var n=0;i;){if(i.nodeType===8){var a=i.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(n===0)return i;n--}else a!=="/$"&&a!=="/&"||n++}i=i.previousSibling}return null}function Eb(i,n,a){switch(n=bu(a),i){case"html":if(i=n.documentElement,!i)throw Error(r(452));return i;case"head":if(i=n.head,!i)throw Error(r(453));return i;case"body":if(i=n.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function pl(i){for(var n=i.attributes;n.length;)i.removeAttributeNode(n[0]);Ao(i)}var vs=new Map,Cb=new Set;function yu(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Rn=F.d;F.d={f:H3,r:F3,D:V3,C:$3,L:q3,m:K3,X:W3,S:G3,M:Y3};function H3(){var i=Rn.f(),n=du();return i||n}function F3(i){var n=fn(i);n!==null&&n.tag===5&&n.type==="form"?F_(n):Rn.r(i)}var so=typeof document>"u"?null:document;function Nb(i,n,a){var c=so;if(c&&typeof n=="string"&&n){var p=Pi(n);p='link[rel="'+i+'"][href="'+p+'"]',typeof a=="string"&&(p+='[crossorigin="'+a+'"]'),Cb.has(p)||(Cb.add(p),i={rel:i,crossOrigin:a,href:n},c.querySelector(p)===null&&(n=c.createElement("link"),xi(n,"link",i),Kt(n),c.head.appendChild(n)))}}function V3(i){Rn.D(i),Nb("dns-prefetch",i,null)}function $3(i,n){Rn.C(i,n),Nb("preconnect",i,n)}function q3(i,n,a){Rn.L(i,n,a);var c=so;if(c&&i&&n){var p='link[rel="preload"][as="'+Pi(n)+'"]';n==="image"&&a&&a.imageSrcSet?(p+='[imagesrcset="'+Pi(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(p+='[imagesizes="'+Pi(a.imageSizes)+'"]')):p+='[href="'+Pi(i)+'"]';var g=p;switch(n){case"style":g=no(i);break;case"script":g=ro(i)}vs.has(g)||(i=v({rel:"preload",href:n==="image"&&a&&a.imageSrcSet?void 0:i,as:n},a),vs.set(g,i),c.querySelector(p)!==null||n==="style"&&c.querySelector(gl(g))||n==="script"&&c.querySelector(_l(g))||(n=c.createElement("link"),xi(n,"link",i),Kt(n),c.head.appendChild(n)))}}function K3(i,n){Rn.m(i,n);var a=so;if(a&&i){var c=n&&typeof n.as=="string"?n.as:"script",p='link[rel="modulepreload"][as="'+Pi(c)+'"][href="'+Pi(i)+'"]',g=p;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=ro(i)}if(!vs.has(g)&&(i=v({rel:"modulepreload",href:i},n),vs.set(g,i),a.querySelector(p)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(_l(g)))return}c=a.createElement("link"),xi(c,"link",i),Kt(c),a.head.appendChild(c)}}}function G3(i,n,a){Rn.S(i,n,a);var c=so;if(c&&i){var p=qn(c).hoistableStyles,g=no(i);n=n||"default";var S=p.get(g);if(!S){var C={loading:0,preload:null};if(S=c.querySelector(gl(g)))C.loading=5;else{i=v({rel:"stylesheet",href:i,"data-precedence":n},a),(a=vs.get(g))&&Rf(i,a);var L=S=c.createElement("link");Kt(L),xi(L,"link",i),L._p=new Promise(function(X,se){L.onload=X,L.onerror=se}),L.addEventListener("load",function(){C.loading|=1}),L.addEventListener("error",function(){C.loading|=2}),C.loading|=4,xu(S,n,c)}S={type:"stylesheet",instance:S,count:1,state:C},p.set(g,S)}}}function W3(i,n){Rn.X(i,n);var a=so;if(a&&i){var c=qn(a).hoistableScripts,p=ro(i),g=c.get(p);g||(g=a.querySelector(_l(p)),g||(i=v({src:i,async:!0},n),(n=vs.get(p))&&Df(i,n),g=a.createElement("script"),Kt(g),xi(g,"link",i),a.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},c.set(p,g))}}function Y3(i,n){Rn.M(i,n);var a=so;if(a&&i){var c=qn(a).hoistableScripts,p=ro(i),g=c.get(p);g||(g=a.querySelector(_l(p)),g||(i=v({src:i,async:!0,type:"module"},n),(n=vs.get(p))&&Df(i,n),g=a.createElement("script"),Kt(g),xi(g,"link",i),a.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},c.set(p,g))}}function kb(i,n,a,c){var p=(p=ge.current)?yu(p):null;if(!p)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(n=no(a.href),a=qn(p).hoistableStyles,c=a.get(n),c||(c={type:"style",instance:null,count:0,state:null},a.set(n,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){i=no(a.href);var g=qn(p).hoistableStyles,S=g.get(i);if(S||(p=p.ownerDocument||p,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(i,S),(g=p.querySelector(gl(i)))&&!g._p&&(S.instance=g,S.state.loading=5),vs.has(i)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},vs.set(i,a),g||X3(p,i,a,S.state))),n&&c===null)throw Error(r(528,""));return S}if(n&&c!==null)throw Error(r(529,""));return null;case"script":return n=a.async,a=a.src,typeof a=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=ro(a),a=qn(p).hoistableScripts,c=a.get(n),c||(c={type:"script",instance:null,count:0,state:null},a.set(n,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function no(i){return'href="'+Pi(i)+'"'}function gl(i){return'link[rel="stylesheet"]['+i+"]"}function Tb(i){return v({},i,{"data-precedence":i.precedence,precedence:null})}function X3(i,n,a,c){i.querySelector('link[rel="preload"][as="style"]['+n+"]")?c.loading=1:(n=i.createElement("link"),c.preload=n,n.addEventListener("load",function(){return c.loading|=1}),n.addEventListener("error",function(){return c.loading|=2}),xi(n,"link",a),Kt(n),i.head.appendChild(n))}function ro(i){return'[src="'+Pi(i)+'"]'}function _l(i){return"script[async]"+i}function Mb(i,n,a){if(n.count++,n.instance===null)switch(n.type){case"style":var c=i.querySelector('style[data-href~="'+Pi(a.href)+'"]');if(c)return n.instance=c,Kt(c),c;var p=v({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return c=(i.ownerDocument||i).createElement("style"),Kt(c),xi(c,"style",p),xu(c,a.precedence,i),n.instance=c;case"stylesheet":p=no(a.href);var g=i.querySelector(gl(p));if(g)return n.state.loading|=4,n.instance=g,Kt(g),g;c=Tb(a),(p=vs.get(p))&&Rf(c,p),g=(i.ownerDocument||i).createElement("link"),Kt(g);var S=g;return S._p=new Promise(function(C,L){S.onload=C,S.onerror=L}),xi(g,"link",c),n.state.loading|=4,xu(g,a.precedence,i),n.instance=g;case"script":return g=ro(a.src),(p=i.querySelector(_l(g)))?(n.instance=p,Kt(p),p):(c=a,(p=vs.get(g))&&(c=v({},a),Df(c,p)),i=i.ownerDocument||i,p=i.createElement("script"),Kt(p),xi(p,"link",c),i.head.appendChild(p),n.instance=p);case"void":return null;default:throw Error(r(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(c=n.instance,n.state.loading|=4,xu(c,a.precedence,i));return n.instance}function xu(i,n,a){for(var c=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=c.length?c[c.length-1]:null,g=p,S=0;S<c.length;S++){var C=c[S];if(C.dataset.precedence===n)g=C;else if(g!==p)break}g?g.parentNode.insertBefore(i,g.nextSibling):(n=a.nodeType===9?a.head:a,n.insertBefore(i,n.firstChild))}function Rf(i,n){i.crossOrigin==null&&(i.crossOrigin=n.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=n.referrerPolicy),i.title==null&&(i.title=n.title)}function Df(i,n){i.crossOrigin==null&&(i.crossOrigin=n.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=n.referrerPolicy),i.integrity==null&&(i.integrity=n.integrity)}var Su=null;function Ab(i,n,a){if(Su===null){var c=new Map,p=Su=new Map;p.set(a,c)}else p=Su,c=p.get(a),c||(c=new Map,p.set(a,c));if(c.has(i))return c;for(c.set(i,null),a=a.getElementsByTagName(i),p=0;p<a.length;p++){var g=a[p];if(!(g[zr]||g[Ht]||i==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var S=g.getAttribute(n)||"";S=i+S;var C=c.get(S);C?C.push(g):c.set(S,[g])}}return c}function Rb(i,n,a){i=i.ownerDocument||i,i.head.insertBefore(a,n==="title"?i.querySelector("head > title"):null)}function Z3(i,n,a){if(a===1||n.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(i=n.disabled,typeof n.precedence=="string"&&i==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function Db(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function Q3(i,n,a,c){if(a.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var p=no(c.href),g=n.querySelector(gl(p));if(g){n=g._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(i.count++,i=wu.bind(i),n.then(i,i)),a.state.loading|=4,a.instance=g,Kt(g);return}g=n.ownerDocument||n,c=Tb(c),(p=vs.get(p))&&Rf(c,p),g=g.createElement("link"),Kt(g);var S=g;S._p=new Promise(function(C,L){S.onload=C,S.onerror=L}),xi(g,"link",c),a.instance=g}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(a,n),(n=a.state.preload)&&(a.state.loading&3)===0&&(i.count++,a=wu.bind(i),n.addEventListener("load",a),n.addEventListener("error",a))}}var Of=0;function J3(i,n){return i.stylesheets&&i.count===0&&Cu(i,i.stylesheets),0<i.count||0<i.imgCount?function(a){var c=setTimeout(function(){if(i.stylesheets&&Cu(i,i.stylesheets),i.unsuspend){var g=i.unsuspend;i.unsuspend=null,g()}},6e4+n);0<i.imgBytes&&Of===0&&(Of=62500*O3());var p=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Cu(i,i.stylesheets),i.unsuspend)){var g=i.unsuspend;i.unsuspend=null,g()}},(i.imgBytes>Of?50:800)+n);return i.unsuspend=a,function(){i.unsuspend=null,clearTimeout(c),clearTimeout(p)}}:null}function wu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Cu(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Eu=null;function Cu(i,n){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Eu=new Map,n.forEach(eN,i),Eu=null,wu.call(i))}function eN(i,n){if(!(n.state.loading&4)){var a=Eu.get(i);if(a)var c=a.get(null);else{a=new Map,Eu.set(i,a);for(var p=i.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<p.length;g++){var S=p[g];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(a.set(S.dataset.precedence,S),c=S)}c&&a.set(null,c)}p=n.instance,S=p.getAttribute("data-precedence"),g=a.get(S)||c,g===c&&a.set(null,p),a.set(S,p),this.count++,c=wu.bind(this),p.addEventListener("load",c),p.addEventListener("error",c),g?g.parentNode.insertBefore(p,g.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(p,i.firstChild)),n.state.loading|=4}}var vl={$$typeof:T,Provider:null,Consumer:null,_currentValue:V,_currentValue2:V,_threadCount:0};function tN(i,n,a,c,p,g,S,C,L){this.tag=1,this.containerInfo=i,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=St(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=St(0),this.hiddenUpdates=St(null),this.identifierPrefix=c,this.onUncaughtError=p,this.onCaughtError=g,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=L,this.incompleteTransitions=new Map}function Ob(i,n,a,c,p,g,S,C,L,X,se,ae){return i=new tN(i,n,a,S,L,X,se,ae,C),n=1,g===!0&&(n|=24),g=Qi(3,null,null,n),i.current=g,g.stateNode=i,n=dh(),n.refCount++,i.pooledCache=n,n.refCount++,g.memoizedState={element:c,isDehydrated:a,cache:n},ph(g),i}function Lb(i){return i?(i=Ba,i):Ba}function jb(i,n,a,c,p,g){p=Lb(p),c.context===null?c.context=p:c.pendingContext=p,c=er(n),c.payload={element:a},g=g===void 0?null:g,g!==null&&(c.callback=g),a=tr(i,c,n),a!==null&&($i(a,i,n),Xo(a,i,n))}function Bb(i,n){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var a=i.retryLane;i.retryLane=a!==0&&a<n?a:n}}function Lf(i,n){Bb(i,n),(i=i.alternate)&&Bb(i,n)}function zb(i){if(i.tag===13||i.tag===31){var n=Vr(i,67108864);n!==null&&$i(n,i,67108864),Lf(i,67108864)}}function Pb(i){if(i.tag===13||i.tag===31){var n=ss();n=kt(n);var a=Vr(i,n);a!==null&&$i(a,i,n),Lf(i,n)}}var Nu=!0;function iN(i,n,a,c){var p=k.T;k.T=null;var g=F.p;try{F.p=2,jf(i,n,a,c)}finally{F.p=g,k.T=p}}function sN(i,n,a,c){var p=k.T;k.T=null;var g=F.p;try{F.p=8,jf(i,n,a,c)}finally{F.p=g,k.T=p}}function jf(i,n,a,c){if(Nu){var p=Bf(c);if(p===null)xf(i,n,c,ku,a),Ub(i,c);else if(rN(p,i,n,a,c))c.stopPropagation();else if(Ub(i,c),n&4&&-1<nN.indexOf(i)){for(;p!==null;){var g=fn(p);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var S=Ci(g.pendingLanes);if(S!==0){var C=g;for(C.pendingLanes|=2,C.entangledLanes|=2;S;){var L=1<<31-gi(S);C.entanglements[1]|=L,S&=~L}Hs(g),(ot&6)===0&&(cu=At()+500,hl(0))}}break;case 31:case 13:C=Vr(g,2),C!==null&&$i(C,g,2),du(),Lf(g,2)}if(g=Bf(c),g===null&&xf(i,n,c,ku,a),g===p)break;p=g}p!==null&&c.stopPropagation()}else xf(i,n,c,null,a)}}function Bf(i){return i=Ue(i),zf(i)}var ku=null;function zf(i){if(ku=null,i=Ai(i),i!==null){var n=l(i);if(n===null)i=null;else{var a=n.tag;if(a===13){if(i=d(n),i!==null)return i;i=null}else if(a===31){if(i=f(n),i!==null)return i;i=null}else if(a===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;i=null}else n!==i&&(i=null)}}return ku=i,null}function Ib(i){switch(i){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ln()){case pi:return 2;case cn:return 8;case un:case Sa:return 32;case Fn:return 268435456;default:return 32}default:return 32}}var Pf=!1,hr=null,fr=null,mr=null,bl=new Map,yl=new Map,pr=[],nN="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 Ub(i,n){switch(i){case"focusin":case"focusout":hr=null;break;case"dragenter":case"dragleave":fr=null;break;case"mouseover":case"mouseout":mr=null;break;case"pointerover":case"pointerout":bl.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":yl.delete(n.pointerId)}}function xl(i,n,a,c,p,g){return i===null||i.nativeEvent!==g?(i={blockedOn:n,domEventName:a,eventSystemFlags:c,nativeEvent:g,targetContainers:[p]},n!==null&&(n=fn(n),n!==null&&zb(n)),i):(i.eventSystemFlags|=c,n=i.targetContainers,p!==null&&n.indexOf(p)===-1&&n.push(p),i)}function rN(i,n,a,c,p){switch(n){case"focusin":return hr=xl(hr,i,n,a,c,p),!0;case"dragenter":return fr=xl(fr,i,n,a,c,p),!0;case"mouseover":return mr=xl(mr,i,n,a,c,p),!0;case"pointerover":var g=p.pointerId;return bl.set(g,xl(bl.get(g)||null,i,n,a,c,p)),!0;case"gotpointercapture":return g=p.pointerId,yl.set(g,xl(yl.get(g)||null,i,n,a,c,p)),!0}return!1}function Hb(i){var n=Ai(i.target);if(n!==null){var a=l(n);if(a!==null){if(n=a.tag,n===13){if(n=d(a),n!==null){i.blockedOn=n,Na(i.priority,function(){Pb(a)});return}}else if(n===31){if(n=f(a),n!==null){i.blockedOn=n,Na(i.priority,function(){Pb(a)});return}}else if(n===3&&a.stateNode.current.memoizedState.isDehydrated){i.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Tu(i){if(i.blockedOn!==null)return!1;for(var n=i.targetContainers;0<n.length;){var a=Bf(i.nativeEvent);if(a===null){a=i.nativeEvent;var c=new a.constructor(a.type,a);Te=c,a.target.dispatchEvent(c),Te=null}else return n=fn(a),n!==null&&zb(n),i.blockedOn=a,!1;n.shift()}return!0}function Fb(i,n,a){Tu(i)&&a.delete(n)}function aN(){Pf=!1,hr!==null&&Tu(hr)&&(hr=null),fr!==null&&Tu(fr)&&(fr=null),mr!==null&&Tu(mr)&&(mr=null),bl.forEach(Fb),yl.forEach(Fb)}function Mu(i,n){i.blockedOn===n&&(i.blockedOn=null,Pf||(Pf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,aN)))}var Au=null;function Vb(i){Au!==i&&(Au=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Au===i&&(Au=null);for(var n=0;n<i.length;n+=3){var a=i[n],c=i[n+1],p=i[n+2];if(typeof c!="function"){if(zf(c||a)===null)continue;break}var g=fn(a);g!==null&&(i.splice(n,3),n-=3,jh(g,{pending:!0,data:p,method:a.method,action:c},c,p))}}))}function ao(i){function n(L){return Mu(L,i)}hr!==null&&Mu(hr,i),fr!==null&&Mu(fr,i),mr!==null&&Mu(mr,i),bl.forEach(n),yl.forEach(n);for(var a=0;a<pr.length;a++){var c=pr[a];c.blockedOn===i&&(c.blockedOn=null)}for(;0<pr.length&&(a=pr[0],a.blockedOn===null);)Hb(a),a.blockedOn===null&&pr.shift();if(a=(i.ownerDocument||i).$$reactFormReplay,a!=null)for(c=0;c<a.length;c+=3){var p=a[c],g=a[c+1],S=p[Ni]||null;if(typeof g=="function")S||Vb(a);else if(S){var C=null;if(g&&g.hasAttribute("formAction")){if(p=g,S=g[Ni]||null)C=S.formAction;else if(zf(p)!==null)continue}else C=S.action;typeof C=="function"?a[c+1]=C:(a.splice(c,3),c-=3),Vb(a)}}}function $b(){function i(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(S){return p=S})},focusReset:"manual",scroll:"manual"})}function n(){p!==null&&(p(),p=null),c||setTimeout(a,20)}function a(){if(!c&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,p=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(a,100),function(){c=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),p!==null&&(p(),p=null)}}}function If(i){this._internalRoot=i}Ru.prototype.render=If.prototype.render=function(i){var n=this._internalRoot;if(n===null)throw Error(r(409));var a=n.current,c=ss();jb(a,c,i,n,null,null)},Ru.prototype.unmount=If.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var n=i.containerInfo;jb(i.current,2,null,i,null,null),du(),n[Vn]=null}};function Ru(i){this._internalRoot=i}Ru.prototype.unstable_scheduleHydration=function(i){if(i){var n=Ca();i={blockedOn:null,target:i,priority:n};for(var a=0;a<pr.length&&n!==0&&n<pr[a].priority;a++);pr.splice(a,0,i),a===0&&Hb(i)}};var qb=t.version;if(qb!=="19.2.6")throw Error(r(527,qb,"19.2.6"));F.findDOMNode=function(i){var n=i._reactInternals;if(n===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=h(n),i=i!==null?_(i):null,i=i===null?null:i.stateNode,i};var oN={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Du=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Du.isDisabled&&Du.supportsFiber)try{dn=Du.inject(oN),li=Du}catch{}}return wl.createRoot=function(i,n){if(!o(i))throw Error(r(299));var a=!1,c="",p=Q_,g=J_,S=ev;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(c=n.identifierPrefix),n.onUncaughtError!==void 0&&(p=n.onUncaughtError),n.onCaughtError!==void 0&&(g=n.onCaughtError),n.onRecoverableError!==void 0&&(S=n.onRecoverableError)),n=Ob(i,1,!1,null,null,a,c,null,p,g,S,$b),i[Vn]=n.current,yf(i),new If(n)},wl.hydrateRoot=function(i,n,a){if(!o(i))throw Error(r(299));var c=!1,p="",g=Q_,S=J_,C=ev,L=null;return a!=null&&(a.unstable_strictMode===!0&&(c=!0),a.identifierPrefix!==void 0&&(p=a.identifierPrefix),a.onUncaughtError!==void 0&&(g=a.onUncaughtError),a.onCaughtError!==void 0&&(S=a.onCaughtError),a.onRecoverableError!==void 0&&(C=a.onRecoverableError),a.formState!==void 0&&(L=a.formState)),n=Ob(i,1,!0,n,a??null,c,p,L,g,S,C,$b),n.context=Lb(null),a=n.current,c=ss(),c=kt(c),p=er(c),p.callback=null,tr(a,p,c),a=c,n.current.lanes=a,_t(n,a),Hs(n),i[Vn]=n.current,yf(i),new Ru(n)},wl.version="19.2.6",wl}var t1;function _N(){if(t1)return Ff.exports;t1=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Ff.exports=gN(),Ff.exports}var OS=_N();const LS=(...e)=>e.filter((t,s,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===s).join(" ").trim();const vN=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const bN=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,s,r)=>r?r.toUpperCase():s.toLowerCase());const i1=e=>{const t=bN(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Kf={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 yN=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},xN=E.createContext({}),SN=()=>E.useContext(xN),wN=E.forwardRef(({color:e,size:t,strokeWidth:s,absoluteStrokeWidth:r,className:o="",children:l,iconNode:d,...f},m)=>{const{size:h=24,strokeWidth:_=2,absoluteStrokeWidth:v=!1,color:b="currentColor",className:y=""}=SN()??{},x=r??v?Number(s??_)*24/Number(t??h):s??_;return E.createElement("svg",{ref:m,...Kf,width:t??h??Kf.width,height:t??h??Kf.height,stroke:e??b,strokeWidth:x,className:LS("lucide",y,o),...!l&&!yN(f)&&{"aria-hidden":"true"},...f},[...d.map(([w,N])=>E.createElement(w,N)),...Array.isArray(l)?l:[l]])});const ve=(e,t)=>{const s=E.forwardRef(({className:r,...o},l)=>E.createElement(wN,{ref:l,iconNode:t,className:LS(`lucide-${vN(i1(e))}`,`lucide-${e}`,r),...o}));return s.displayName=i1(e),s};const EN=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],_o=ve("activity",EN);const CN=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],NN=ve("arrow-down",CN);const kN=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],TN=ve("arrow-up",kN);const MN=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Wl=ve("bot",MN);const AN=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],jS=ve("box",AN);const RN=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],hp=ve("brain",RN);const DN=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ac=ve("check",DN);const ON=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Pn=ve("chevron-down",ON);const LN=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],jN=ve("chevron-left",LN);const BN=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ga=ve("chevron-right",BN);const zN=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Cg=ve("chevron-up",zN);const PN=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2",key:"4jdomd"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4",key:"3hqy98"}],["path",{d:"M21 14H11",key:"1bme5i"}],["path",{d:"m15 10-4 4 4 4",key:"5dvupr"}]],IN=ve("clipboard-copy",PN);const UN=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],BS=ve("copy",UN);const HN=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],FN=ve("corner-down-left",HN);const VN=[["path",{d:"m15 10 5 5-5 5",key:"qqa56n"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]],$N=ve("corner-down-right",VN);const qN=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],KN=ve("cpu",qN);const GN=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],oc=ve("database",GN);const WN=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],YN=ve("download",WN);const XN=[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ZN=ve("earth",XN);const QN=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],zS=ve("external-link",QN);const JN=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],PS=ve("eye-off",JN);const ek=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],IS=ve("eye",ek);const tk=[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]],ik=ve("file-code-corner",tk);const sk=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],nk=ve("file-exclamation-point",sk);const rk=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],ak=ve("file-text",rk);const ok=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],US=ve("file",ok);const lk=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],ck=ve("flask-conical",lk);const uk=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Nd=ve("folder-open",uk);const dk=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],hk=ve("folder-plus",dk);const fk=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],_a=ve("folder",fk);const mk=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],pk=ve("funnel",mk);const gk=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],HS=ve("gauge",gk);const _k=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],Yl=ve("git-branch",_k);const vk=[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 9v12",key:"1sc30k"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v3",key:"1jb6z3"}],["path",{d:"M18 15v6",key:"9wciyi"}],["path",{d:"M21 18h-6",key:"139f0c"}]],bk=ve("git-pull-request-create",vk);const yk=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],xk=ve("heart",yk);const Sk=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],wk=ve("image",Sk);const Ek=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],fp=ve("inbox",Ek);const Ck=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],Nk=ve("key-round",Ck);const kk=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Zs=ve("loader-circle",kk);const Tk=[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]],Mk=ve("lock-keyhole",Tk);const Ak=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],Rk=ve("maximize-2",Ak);const Dk=[["path",{d:"M12 12v-2",key:"fwoke6"}],["path",{d:"M12 18v-2",key:"qj6yno"}],["path",{d:"M16 12v-2",key:"heuere"}],["path",{d:"M16 18v-2",key:"s1ct0w"}],["path",{d:"M2 11h1.5",key:"15p63e"}],["path",{d:"M20 18v-2",key:"12ehxp"}],["path",{d:"M20.5 11H22",key:"khsy7a"}],["path",{d:"M4 18v-2",key:"1c3oqr"}],["path",{d:"M8 12v-2",key:"1mwtfd"}],["path",{d:"M8 18v-2",key:"qcmpov"}],["rect",{x:"2",y:"6",width:"20",height:"10",rx:"2",key:"1qcswk"}]],Ok=ve("memory-stick",Dk);const Lk=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],jk=ve("minimize-2",Lk);const Bk=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],zk=ve("network",Bk);const Pk=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Ik=ve("package",Pk);const Uk=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],Hk=ve("palette",Uk);const Fk=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],Vk=ve("panel-left-close",Fk);const $k=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],qk=ve("panel-left-open",$k);const Kk=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],Gk=ve("panel-left",Kk);const Wk=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}]],Yk=ve("panel-top",Wk);const Xk=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],Zk=ve("paperclip",Xk);const Qk=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],mp=ve("pencil",Qk);const Jk=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],FS=ve("play",Jk);const e5=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],pp=ve("plug",e5);const t5=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Es=ve("plus",t5);const i5=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],s5=ve("radio",i5);const n5=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],VS=ve("refresh-cw",n5);const r5=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],$S=ve("rotate-ccw",r5);const a5=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],qS=ve("save",a5);const o5=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],KS=ve("scroll-text",o5);const l5=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],c5=ve("search",l5);const u5=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],d5=ve("server",u5);const h5=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],f5=ve("settings-2",h5);const m5=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],p5=ve("shield-alert",m5);const g5=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],GS=ve("sparkles",g5);const _5=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],v5=ve("square-terminal",_5);const b5=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],kd=ve("square",b5);const y5=[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]],x5=ve("table-2",y5);const S5=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],WS=ve("terminal",S5);const w5=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],lc=ve("trash-2",w5);const E5=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],C5=ve("triangle-alert",E5);const N5=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],k5=ve("wand-sparkles",N5);const T5=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],M5=ve("wrench",T5);const A5=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],rn=ve("x",A5);const R5=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],D5=ve("zap",R5),O5="/assets/nomoreide-logo-B2E14b65.png";class YS extends Error{conflict;constructor(t,s){super(t),this.name="PortConflictResponseError",this.conflict=s}}async function tt(e,t){const s=await fetch(e,t),r=await s.json().catch(()=>{});if(!s.ok)throw s.status===409&&r?.conflict?.code==="PORT_IN_USE"?new YS(r?.error||"Port already in use",r.conflict):new Error(r?.error||s.statusText);return r}async function Gi(e,t){const s=new URLSearchParams;for(const[r,o]of Object.entries(t))o!==void 0&&String(o).trim()&&s.set(r,String(o));await tt(e,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:s})}async function cc(e,t){const s=new URLSearchParams;for(const[r,o]of Object.entries(t))o!==void 0&&String(o).trim()&&s.set(r,String(o));return tt(e,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:s})}async function L5(){return(await tt("/api/agent")).agent}async function j5(){return(await tt("/api/agent/usage")).usage}async function B5(){const e=await tt("/api/agent/chat/status");return{configured:e.configured,approvals:e.approvals,provider:e.provider}}async function z5(e,t,s){await tt("/api/agent/chat/approve",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:e,requestId:t,decision:s})})}async function P5(e,t,s,r){const o=await fetch("/api/agent/chat",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({message:e,resumeSessionId:t}),signal:r});if(!o.ok||!o.body){const m=await o.json().catch(()=>{});throw new Error(m?.error||o.statusText||"Agent request failed")}const l=o.body.getReader(),d=new TextDecoder;let f="";for(;;){const{done:m,value:h}=await l.read();if(m)break;f+=d.decode(h,{stream:!0});let _=f.indexOf(`
|
|
10
|
-
|
|
11
|
-
`);for(;_!==-1;){const v=f.slice(0,_);f=f.slice(_+2);const b=v.split(`
|
|
12
|
-
`).find(y=>y.startsWith("data:"));if(b){const y=b.slice(5).trim();if(y)try{s(JSON.parse(y))}catch{}}_=f.indexOf(`
|
|
13
|
-
|
|
14
|
-
`)}}}async function I5(){return(await tt("/api/databases")).connections}async function U5(){return(await tt("/api/databases/detect")).detected}async function H5(e){await cc("/api/databases",e)}async function F5(e){return cc("/api/databases/test",e)}async function V5(e){await tt(`/api/databases/${encodeURIComponent(e)}`,{method:"DELETE"})}async function $5(e){return(await tt(`/api/databases/${encodeURIComponent(e)}/tables`)).tables}async function q5(e,t,s=100){return tt(`/api/databases/${encodeURIComponent(e)}/rows?table=${encodeURIComponent(t)}&limit=${s}`)}function K5(e,t,s,r,o){const l=r.map(d=>`- ${d.name}: ${d.dataType}${d.primaryKey?" (PK)":""}${d.nullable?"":" NOT NULL"}`).join(`
|
|
15
|
-
`);return[`I'm looking at a row in my ${t} database (connection "${e}", table \`${s.qualifiedName}\`).`,"","## Table schema",l,"","## Row","```json",JSON.stringify(o,null,2),"```","","Explain what this row represents and anything notable about its values."].join(`
|
|
16
|
-
`)}async function G5(e=100){return(await tt(`/api/errors?limit=${e}`)).incidents}async function W5(e){return tt(`/api/errors/${e}/prompt`)}async function Y5(e,t=!1){return tt(`/api/errors/${e}/bundle${t?"?save=1":""}`)}async function X5(e=200){return(await tt(`/api/git/graph?limit=${e}`)).commits}async function Z5(e,t){const s=new URLSearchParams({hash:e});t&&s.set("file",t);const r=await fetch(`/api/git/commit?${s.toString()}`);if(!r.ok){const o=await r.json().catch(()=>({error:r.statusText}));throw new Error(o.error||"Unable to load commit diff")}return r.text()}async function Q5(e){return(await tt(`/api/git/commit/files?hash=${encodeURIComponent(e)}`)).files}async function J5(){return(await tt("/api/git/files")).files}async function eT(e){const t=await tt(`/api/git/file?path=${encodeURIComponent(e)}`);return{content:t.content,truncated:t.truncated,binary:t.binary,size:t.size}}async function tT(e){const t=await fetch(`/api/git/diff?file=${encodeURIComponent(e)}`);if(!t.ok){const s=await t.json().catch(()=>({error:t.statusText}));throw new Error(s.error||"Unable to load diff")}return t.text()}async function iT(e){await tt(`/api/git/repositories/${encodeURIComponent(e)}`,{method:"DELETE"})}async function sT(){return(await tt("/api/log-sources")).sources}async function nT(e){return(await cc("/api/log-sources",e)).sources}async function XS(e,t={}){const s=new URLSearchParams;return s.set("lines",String(t.lines??500)),t.since&&s.set("since",t.since),t.until&&s.set("until",t.until),t.grep&&s.set("grep",t.grep),t.level&&s.set("level",t.level),t.cursor&&s.set("cursor",t.cursor),t.before&&s.set("before",t.before),(await tt(`/api/log-sources/${encodeURIComponent(e)}/logs?${s.toString()}`)).logs}async function rT(){return tt("/api/dashboard")}async function aT(e){await tt(`/api/services/${encodeURIComponent(e)}`,{method:"DELETE"})}async function oT(e,t,s){t.includes(s)||await Gi("/api/bundles",{name:e,originalName:e,services:[...t,s].join(",")})}async function lT(e,t,s){t.includes(s)&&await Gi("/api/bundles",{name:e,originalName:e,services:t.filter(r=>r!==s).join(",")})}async function ZS(e,{files:t=!1}={}){const s=new URLSearchParams({path:e});return t&&s.set("files","1"),tt(`/api/fs/directories?${s.toString()}`)}async function QS(e,t={}){const s=new URLSearchParams;s.set("lines",String(t.lines??500)),t.since&&s.set("since",t.since),t.until&&s.set("until",t.until),t.grep&&s.set("grep",t.grep),t.level&&s.set("level",t.level),t.cursor&&s.set("cursor",t.cursor),t.before&&s.set("before",t.before);const r=await tt(`/api/services/${encodeURIComponent(e)}/logs?${s.toString()}`);return{logs:r.logs,queryable:!!r.queryable}}async function cT(e,t){const s=t?`?path=${encodeURIComponent(t)}`:"";return tt(`/api/services/${encodeURIComponent(e)}/config-browse${s}`)}async function uT(e){const t=await tt(`/api/services/${encodeURIComponent(e)}/config-files`);return{cwd:t.cwd,files:t.files}}async function s1(e,t){return tt(`/api/services/${encodeURIComponent(e)}/config-file?path=${encodeURIComponent(t)}`)}async function dT(e,t,s){return tt(`/api/services/${encodeURIComponent(e)}/config-file?path=${encodeURIComponent(t)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({entries:s})})}async function hT(e,t,s){return tt(`/api/services/${encodeURIComponent(e)}/config-file?path=${encodeURIComponent(t)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({content:s})})}async function fT(e){return cc("/api/services/test",e)}async function mT(e,t){return cc(`/api/services/${encodeURIComponent(e)}/test`,t?{pattern:t}:{})}async function pT(){return(await tt("/api/terminal/sessions")).sessions}async function Gf(){return(await tt("/api/terminal/sessions",{method:"POST"})).session}async function gT(e){await tt(`/api/terminal/sessions/${encodeURIComponent(e)}`,{method:"DELETE"})}function JS(e){var t,s,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(s=JS(e[t]))&&(r&&(r+=" "),r+=s)}else for(s in e)e[s]&&(r&&(r+=" "),r+=s);return r}function Xl(){for(var e,t,s=0,r="",o=arguments.length;s<o;s++)(e=arguments[s])&&(t=JS(e))&&(r&&(r+=" "),r+=t);return r}const n1=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,r1=Xl,e2=(e,t)=>s=>{var r;if(t?.variants==null)return r1(e,s?.class,s?.className);const{variants:o,defaultVariants:l}=t,d=Object.keys(o).map(h=>{const _=s?.[h],v=l?.[h];if(_===null)return null;const b=n1(_)||n1(v);return o[h][b]}),f=s&&Object.entries(s).reduce((h,_)=>{let[v,b]=_;return b===void 0||(h[v]=b),h},{}),m=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((h,_)=>{let{class:v,className:b,...y}=_;return Object.entries(y).every(x=>{let[w,N]=x;return Array.isArray(N)?N.includes({...l,...f}[w]):{...l,...f}[w]===N})?[...h,v,b]:h},[]);return r1(e,d,m,s?.class,s?.className)},_T=(e,t)=>{const s=new Array(e.length+t.length);for(let r=0;r<e.length;r++)s[r]=e[r];for(let r=0;r<t.length;r++)s[e.length+r]=t[r];return s},vT=(e,t)=>({classGroupId:e,validator:t}),t2=(e=new Map,t=null,s)=>({nextPart:e,validators:t,classGroupId:s}),od="-",a1=[],bT="arbitrary..",yT=e=>{const t=ST(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return xT(d);const f=d.split(od),m=f[0]===""&&f.length>1?1:0;return i2(f,m,t)},getConflictingClassGroupIds:(d,f)=>{if(f){const m=r[d],h=s[d];return m?h?_T(h,m):m:h||a1}return s[d]||a1}}},i2=(e,t,s)=>{if(e.length-t===0)return s.classGroupId;const o=e[t],l=s.nextPart.get(o);if(l){const h=i2(e,t+1,l);if(h)return h}const d=s.validators;if(d===null)return;const f=t===0?e.join(od):e.slice(t).join(od),m=d.length;for(let h=0;h<m;h++){const _=d[h];if(_.validator(f))return _.classGroupId}},xT=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),s=t.indexOf(":"),r=t.slice(0,s);return r?bT+r:void 0})(),ST=e=>{const{theme:t,classGroups:s}=e;return wT(s,t)},wT=(e,t)=>{const s=t2();for(const r in e){const o=e[r];Ng(o,s,r,t)}return s},Ng=(e,t,s,r)=>{const o=e.length;for(let l=0;l<o;l++){const d=e[l];ET(d,t,s,r)}},ET=(e,t,s,r)=>{if(typeof e=="string"){CT(e,t,s);return}if(typeof e=="function"){NT(e,t,s,r);return}kT(e,t,s,r)},CT=(e,t,s)=>{const r=e===""?t:s2(t,e);r.classGroupId=s},NT=(e,t,s,r)=>{if(TT(e)){Ng(e(r),t,s,r);return}t.validators===null&&(t.validators=[]),t.validators.push(vT(s,e))},kT=(e,t,s,r)=>{const o=Object.entries(e),l=o.length;for(let d=0;d<l;d++){const[f,m]=o[d];Ng(m,s2(t,f),s,r)}},s2=(e,t)=>{let s=e;const r=t.split(od),o=r.length;for(let l=0;l<o;l++){const d=r[l];let f=s.nextPart.get(d);f||(f=t2(),s.nextPart.set(d,f)),s=f}return s},TT=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,MT=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,s=Object.create(null),r=Object.create(null);const o=(l,d)=>{s[l]=d,t++,t>e&&(t=0,r=s,s=Object.create(null))};return{get(l){let d=s[l];if(d!==void 0)return d;if((d=r[l])!==void 0)return o(l,d),d},set(l,d){l in s?s[l]=d:o(l,d)}}},gp="!",o1=":",AT=[],l1=(e,t,s,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:s,maybePostfixModifierPosition:r,isExternal:o}),RT=e=>{const{prefix:t,experimentalParseClassName:s}=e;let r=o=>{const l=[];let d=0,f=0,m=0,h;const _=o.length;for(let w=0;w<_;w++){const N=o[w];if(d===0&&f===0){if(N===o1){l.push(o.slice(m,w)),m=w+1;continue}if(N==="/"){h=w;continue}}N==="["?d++:N==="]"?d--:N==="("?f++:N===")"&&f--}const v=l.length===0?o:o.slice(m);let b=v,y=!1;v.endsWith(gp)?(b=v.slice(0,-1),y=!0):v.startsWith(gp)&&(b=v.slice(1),y=!0);const x=h&&h>m?h-m:void 0;return l1(l,y,b,x)};if(t){const o=t+o1,l=r;r=d=>d.startsWith(o)?l(d.slice(o.length)):l1(AT,!1,d,void 0,!0)}if(s){const o=r;r=l=>s({className:l,parseClassName:o})}return r},DT=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((s,r)=>{t.set(s,1e6+r)}),s=>{const r=[];let o=[];for(let l=0;l<s.length;l++){const d=s[l],f=d[0]==="[",m=t.has(d);f||m?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(d)):o.push(d)}return o.length>0&&(o.sort(),r.push(...o)),r}},OT=e=>({cache:MT(e.cacheSize),parseClassName:RT(e),sortModifiers:DT(e),postfixLookupClassGroupIds:LT(e),...yT(e)}),LT=e=>{const t=Object.create(null),s=e.postfixLookupClassGroups;if(s)for(let r=0;r<s.length;r++)t[s[r]]=!0;return t},jT=/\s+/,BT=(e,t)=>{const{parseClassName:s,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:l,postfixLookupClassGroupIds:d}=t,f=[],m=e.trim().split(jT);let h="";for(let _=m.length-1;_>=0;_-=1){const v=m[_],{isExternal:b,modifiers:y,hasImportantModifier:x,baseClassName:w,maybePostfixModifierPosition:N}=s(v);if(b){h=v+(h.length>0?" "+h:h);continue}let A=!!N,R;if(A){const j=w.substring(0,N);R=r(j);const O=R&&d[R]?r(w):void 0;O&&O!==R&&(R=O,A=!1)}else R=r(w);if(!R){if(!A){h=v+(h.length>0?" "+h:h);continue}if(R=r(w),!R){h=v+(h.length>0?" "+h:h);continue}A=!1}const T=y.length===0?"":y.length===1?y[0]:l(y).join(":"),M=x?T+gp:T,z=M+R;if(f.indexOf(z)>-1)continue;f.push(z);const U=o(R,A);for(let j=0;j<U.length;++j){const O=U[j];f.push(M+O)}h=v+(h.length>0?" "+h:h)}return h},zT=(...e)=>{let t=0,s,r,o="";for(;t<e.length;)(s=e[t++])&&(r=n2(s))&&(o&&(o+=" "),o+=r);return o},n2=e=>{if(typeof e=="string")return e;let t,s="";for(let r=0;r<e.length;r++)e[r]&&(t=n2(e[r]))&&(s&&(s+=" "),s+=t);return s},PT=(e,...t)=>{let s,r,o,l;const d=m=>{const h=t.reduce((_,v)=>v(_),e());return s=OT(h),r=s.cache.get,o=s.cache.set,l=f,f(m)},f=m=>{const h=r(m);if(h)return h;const _=BT(m,s);return o(m,_),_};return l=d,(...m)=>l(zT(...m))},IT=[],si=e=>{const t=s=>s[e]||IT;return t.isThemeGetter=!0,t},r2=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,a2=/^\((?:(\w[\w-]*):)?(.+)\)$/i,UT=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,HT=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,FT=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,VT=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,$T=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,qT=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,_r=e=>UT.test(e),qe=e=>!!e&&!Number.isNaN(Number(e)),Fs=e=>!!e&&Number.isInteger(Number(e)),Wf=e=>e.endsWith("%")&&qe(e.slice(0,-1)),Dn=e=>HT.test(e),o2=()=>!0,KT=e=>FT.test(e)&&!VT.test(e),kg=()=>!1,GT=e=>$T.test(e),WT=e=>qT.test(e),YT=e=>!xe(e)&&!we(e),XT=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),ZT=e=>Rr(e,u2,kg),xe=e=>r2.test(e),ia=e=>Rr(e,d2,KT),c1=e=>Rr(e,r4,qe),QT=e=>Rr(e,f2,o2),JT=e=>Rr(e,h2,kg),u1=e=>Rr(e,l2,kg),e4=e=>Rr(e,c2,WT),Ou=e=>Rr(e,m2,GT),we=e=>a2.test(e),El=e=>va(e,d2),t4=e=>va(e,h2),d1=e=>va(e,l2),i4=e=>va(e,u2),s4=e=>va(e,c2),Lu=e=>va(e,m2,!0),n4=e=>va(e,f2,!0),Rr=(e,t,s)=>{const r=r2.exec(e);return r?r[1]?t(r[1]):s(r[2]):!1},va=(e,t,s=!1)=>{const r=a2.exec(e);return r?r[1]?t(r[1]):s:!1},l2=e=>e==="position"||e==="percentage",c2=e=>e==="image"||e==="url",u2=e=>e==="length"||e==="size"||e==="bg-size",d2=e=>e==="length",r4=e=>e==="number",h2=e=>e==="family-name",f2=e=>e==="number"||e==="weight",m2=e=>e==="shadow",a4=()=>{const e=si("color"),t=si("font"),s=si("text"),r=si("font-weight"),o=si("tracking"),l=si("leading"),d=si("breakpoint"),f=si("container"),m=si("spacing"),h=si("radius"),_=si("shadow"),v=si("inset-shadow"),b=si("text-shadow"),y=si("drop-shadow"),x=si("blur"),w=si("perspective"),N=si("aspect"),A=si("ease"),R=si("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],z=()=>[...M(),we,xe],U=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],O=()=>[we,xe,m],K=()=>[_r,"full","auto",...O()],H=()=>[Fs,"none","subgrid",we,xe],G=()=>["auto",{span:["full",Fs,we,xe]},Fs,we,xe],J=()=>[Fs,"auto",we,xe],I=()=>["auto","min","max","fr",we,xe],ee=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],k=()=>["auto",...O()],F=()=>[_r,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...O()],V=()=>[_r,"screen","full","dvw","lvw","svw","min","max","fit",...O()],Z=()=>[_r,"screen","full","lh","dvh","lvh","svh","min","max","fit",...O()],W=()=>[e,we,xe],D=()=>[...M(),d1,u1,{position:[we,xe]}],ie=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ce=()=>["auto","cover","contain",i4,ZT,{size:[we,xe]}],le=()=>[Wf,El,ia],de=()=>["","none","full",h,we,xe],ge=()=>["",qe,El,ia],Se=()=>["solid","dashed","dotted","double"],Be=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ee=()=>[qe,Wf,d1,u1],it=()=>["","none",x,we,xe],rt=()=>["none",qe,we,xe],at=()=>["none",qe,we,xe],je=()=>[qe,we,xe],It=()=>[_r,"full",...O()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Dn],breakpoint:[Dn],color:[o2],container:[Dn],"drop-shadow":[Dn],ease:["in","out","in-out"],font:[YT],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Dn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Dn],shadow:[Dn],spacing:["px",qe],text:[Dn],"text-shadow":[Dn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",_r,xe,we,N]}],container:["container"],"container-type":[{"@container":["","normal","size",we,xe]}],"container-named":[XT],columns:[{columns:[qe,xe,we,f]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"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:z()}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:K()}],"inset-x":[{"inset-x":K()}],"inset-y":[{"inset-y":K()}],start:[{"inset-s":K(),start:K()}],end:[{"inset-e":K(),end:K()}],"inset-bs":[{"inset-bs":K()}],"inset-be":[{"inset-be":K()}],top:[{top:K()}],right:[{right:K()}],bottom:[{bottom:K()}],left:[{left:K()}],visibility:["visible","invisible","collapse"],z:[{z:[Fs,"auto",we,xe]}],basis:[{basis:[_r,"full","auto",f,...O()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[qe,_r,"auto","initial","none",xe]}],grow:[{grow:["",qe,we,xe]}],shrink:[{shrink:["",qe,we,xe]}],order:[{order:[Fs,"first","last","none",we,xe]}],"grid-cols":[{"grid-cols":H()}],"col-start-end":[{col:G()}],"col-start":[{"col-start":J()}],"col-end":[{"col-end":J()}],"grid-rows":[{"grid-rows":H()}],"row-start-end":[{row:G()}],"row-start":[{"row-start":J()}],"row-end":[{"row-end":J()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":I()}],"auto-rows":[{"auto-rows":I()}],gap:[{gap:O()}],"gap-x":[{"gap-x":O()}],"gap-y":[{"gap-y":O()}],"justify-content":[{justify:[...ee(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...ee()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":ee()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:O()}],px:[{px:O()}],py:[{py:O()}],ps:[{ps:O()}],pe:[{pe:O()}],pbs:[{pbs:O()}],pbe:[{pbe:O()}],pt:[{pt:O()}],pr:[{pr:O()}],pb:[{pb:O()}],pl:[{pl:O()}],m:[{m:k()}],mx:[{mx:k()}],my:[{my:k()}],ms:[{ms:k()}],me:[{me:k()}],mbs:[{mbs:k()}],mbe:[{mbe:k()}],mt:[{mt:k()}],mr:[{mr:k()}],mb:[{mb:k()}],ml:[{ml:k()}],"space-x":[{"space-x":O()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":O()}],"space-y-reverse":["space-y-reverse"],size:[{size:F()}],"inline-size":[{inline:["auto",...V()]}],"min-inline-size":[{"min-inline":["auto",...V()]}],"max-inline-size":[{"max-inline":["none",...V()]}],"block-size":[{block:["auto",...Z()]}],"min-block-size":[{"min-block":["auto",...Z()]}],"max-block-size":[{"max-block":["none",...Z()]}],w:[{w:[f,"screen",...F()]}],"min-w":[{"min-w":[f,"screen","none",...F()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[d]},...F()]}],h:[{h:["screen","lh",...F()]}],"min-h":[{"min-h":["screen","lh","none",...F()]}],"max-h":[{"max-h":["screen","lh",...F()]}],"font-size":[{text:["base",s,El,ia]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,n4,QT]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Wf,xe]}],"font-family":[{font:[t4,JT,t]}],"font-features":[{"font-features":[xe]}],"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:[o,we,xe]}],"line-clamp":[{"line-clamp":[qe,"none",we,c1]}],leading:[{leading:[l,...O()]}],"list-image":[{"list-image":["none",we,xe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",we,xe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:W()}],"text-color":[{text:W()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Se(),"wavy"]}],"text-decoration-thickness":[{decoration:[qe,"from-font","auto",we,ia]}],"text-decoration-color":[{decoration:W()}],"underline-offset":[{"underline-offset":[qe,"auto",we,xe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"tab-size":[{tab:[Fs,we,xe]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",we,xe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",we,xe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:D()}],"bg-repeat":[{bg:ie()}],"bg-size":[{bg:ce()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Fs,we,xe],radial:["",we,xe],conic:[Fs,we,xe]},s4,e4]}],"bg-color":[{bg:W()}],"gradient-from-pos":[{from:le()}],"gradient-via-pos":[{via:le()}],"gradient-to-pos":[{to:le()}],"gradient-from":[{from:W()}],"gradient-via":[{via:W()}],"gradient-to":[{to:W()}],rounded:[{rounded:de()}],"rounded-s":[{"rounded-s":de()}],"rounded-e":[{"rounded-e":de()}],"rounded-t":[{"rounded-t":de()}],"rounded-r":[{"rounded-r":de()}],"rounded-b":[{"rounded-b":de()}],"rounded-l":[{"rounded-l":de()}],"rounded-ss":[{"rounded-ss":de()}],"rounded-se":[{"rounded-se":de()}],"rounded-ee":[{"rounded-ee":de()}],"rounded-es":[{"rounded-es":de()}],"rounded-tl":[{"rounded-tl":de()}],"rounded-tr":[{"rounded-tr":de()}],"rounded-br":[{"rounded-br":de()}],"rounded-bl":[{"rounded-bl":de()}],"border-w":[{border:ge()}],"border-w-x":[{"border-x":ge()}],"border-w-y":[{"border-y":ge()}],"border-w-s":[{"border-s":ge()}],"border-w-e":[{"border-e":ge()}],"border-w-bs":[{"border-bs":ge()}],"border-w-be":[{"border-be":ge()}],"border-w-t":[{"border-t":ge()}],"border-w-r":[{"border-r":ge()}],"border-w-b":[{"border-b":ge()}],"border-w-l":[{"border-l":ge()}],"divide-x":[{"divide-x":ge()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ge()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Se(),"hidden","none"]}],"divide-style":[{divide:[...Se(),"hidden","none"]}],"border-color":[{border:W()}],"border-color-x":[{"border-x":W()}],"border-color-y":[{"border-y":W()}],"border-color-s":[{"border-s":W()}],"border-color-e":[{"border-e":W()}],"border-color-bs":[{"border-bs":W()}],"border-color-be":[{"border-be":W()}],"border-color-t":[{"border-t":W()}],"border-color-r":[{"border-r":W()}],"border-color-b":[{"border-b":W()}],"border-color-l":[{"border-l":W()}],"divide-color":[{divide:W()}],"outline-style":[{outline:[...Se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[qe,we,xe]}],"outline-w":[{outline:["",qe,El,ia]}],"outline-color":[{outline:W()}],shadow:[{shadow:["","none",_,Lu,Ou]}],"shadow-color":[{shadow:W()}],"inset-shadow":[{"inset-shadow":["none",v,Lu,Ou]}],"inset-shadow-color":[{"inset-shadow":W()}],"ring-w":[{ring:ge()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:W()}],"ring-offset-w":[{"ring-offset":[qe,ia]}],"ring-offset-color":[{"ring-offset":W()}],"inset-ring-w":[{"inset-ring":ge()}],"inset-ring-color":[{"inset-ring":W()}],"text-shadow":[{"text-shadow":["none",b,Lu,Ou]}],"text-shadow-color":[{"text-shadow":W()}],opacity:[{opacity:[qe,we,xe]}],"mix-blend":[{"mix-blend":[...Be(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Be()}],"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":[qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ee()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ee()}],"mask-image-linear-from-color":[{"mask-linear-from":W()}],"mask-image-linear-to-color":[{"mask-linear-to":W()}],"mask-image-t-from-pos":[{"mask-t-from":Ee()}],"mask-image-t-to-pos":[{"mask-t-to":Ee()}],"mask-image-t-from-color":[{"mask-t-from":W()}],"mask-image-t-to-color":[{"mask-t-to":W()}],"mask-image-r-from-pos":[{"mask-r-from":Ee()}],"mask-image-r-to-pos":[{"mask-r-to":Ee()}],"mask-image-r-from-color":[{"mask-r-from":W()}],"mask-image-r-to-color":[{"mask-r-to":W()}],"mask-image-b-from-pos":[{"mask-b-from":Ee()}],"mask-image-b-to-pos":[{"mask-b-to":Ee()}],"mask-image-b-from-color":[{"mask-b-from":W()}],"mask-image-b-to-color":[{"mask-b-to":W()}],"mask-image-l-from-pos":[{"mask-l-from":Ee()}],"mask-image-l-to-pos":[{"mask-l-to":Ee()}],"mask-image-l-from-color":[{"mask-l-from":W()}],"mask-image-l-to-color":[{"mask-l-to":W()}],"mask-image-x-from-pos":[{"mask-x-from":Ee()}],"mask-image-x-to-pos":[{"mask-x-to":Ee()}],"mask-image-x-from-color":[{"mask-x-from":W()}],"mask-image-x-to-color":[{"mask-x-to":W()}],"mask-image-y-from-pos":[{"mask-y-from":Ee()}],"mask-image-y-to-pos":[{"mask-y-to":Ee()}],"mask-image-y-from-color":[{"mask-y-from":W()}],"mask-image-y-to-color":[{"mask-y-to":W()}],"mask-image-radial":[{"mask-radial":[we,xe]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ee()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ee()}],"mask-image-radial-from-color":[{"mask-radial-from":W()}],"mask-image-radial-to-color":[{"mask-radial-to":W()}],"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":M()}],"mask-image-conic-pos":[{"mask-conic":[qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ee()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ee()}],"mask-image-conic-from-color":[{"mask-conic-from":W()}],"mask-image-conic-to-color":[{"mask-conic-to":W()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:D()}],"mask-repeat":[{mask:ie()}],"mask-size":[{mask:ce()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",we,xe]}],filter:[{filter:["","none",we,xe]}],blur:[{blur:it()}],brightness:[{brightness:[qe,we,xe]}],contrast:[{contrast:[qe,we,xe]}],"drop-shadow":[{"drop-shadow":["","none",y,Lu,Ou]}],"drop-shadow-color":[{"drop-shadow":W()}],grayscale:[{grayscale:["",qe,we,xe]}],"hue-rotate":[{"hue-rotate":[qe,we,xe]}],invert:[{invert:["",qe,we,xe]}],saturate:[{saturate:[qe,we,xe]}],sepia:[{sepia:["",qe,we,xe]}],"backdrop-filter":[{"backdrop-filter":["","none",we,xe]}],"backdrop-blur":[{"backdrop-blur":it()}],"backdrop-brightness":[{"backdrop-brightness":[qe,we,xe]}],"backdrop-contrast":[{"backdrop-contrast":[qe,we,xe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",qe,we,xe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[qe,we,xe]}],"backdrop-invert":[{"backdrop-invert":["",qe,we,xe]}],"backdrop-opacity":[{"backdrop-opacity":[qe,we,xe]}],"backdrop-saturate":[{"backdrop-saturate":[qe,we,xe]}],"backdrop-sepia":[{"backdrop-sepia":["",qe,we,xe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":O()}],"border-spacing-x":[{"border-spacing-x":O()}],"border-spacing-y":[{"border-spacing-y":O()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",we,xe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[qe,"initial",we,xe]}],ease:[{ease:["linear","initial",A,we,xe]}],delay:[{delay:[qe,we,xe]}],animate:[{animate:["none",R,we,xe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,we,xe]}],"perspective-origin":[{"perspective-origin":z()}],rotate:[{rotate:rt()}],"rotate-x":[{"rotate-x":rt()}],"rotate-y":[{"rotate-y":rt()}],"rotate-z":[{"rotate-z":rt()}],scale:[{scale:at()}],"scale-x":[{"scale-x":at()}],"scale-y":[{"scale-y":at()}],"scale-z":[{"scale-z":at()}],"scale-3d":["scale-3d"],skew:[{skew:je()}],"skew-x":[{"skew-x":je()}],"skew-y":[{"skew-y":je()}],transform:[{transform:[we,xe,"","none","gpu","cpu"]}],"transform-origin":[{origin:z()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:It()}],"translate-x":[{"translate-x":It()}],"translate-y":[{"translate-y":It()}],"translate-z":[{"translate-z":It()}],"translate-none":["translate-none"],zoom:[{zoom:[Fs,we,xe]}],accent:[{accent:W()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:W()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",we,xe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":W()}],"scrollbar-track-color":[{"scrollbar-track":W()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mbs":[{"scroll-mbs":O()}],"scroll-mbe":[{"scroll-mbe":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pbs":[{"scroll-pbs":O()}],"scroll-pbe":[{"scroll-pbe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",we,xe]}],fill:[{fill:["none",...W()]}],"stroke-w":[{stroke:[qe,El,ia,c1]}],stroke:[{stroke:["none",...W()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},o4=PT(a4);function pe(...e){return o4(Xl(e))}const l4=e2("inline-flex h-9 shrink-0 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-md border border-transparent px-3 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",outline:"border-border bg-background hover:bg-muted",ghost:"hover:bg-muted",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90"},size:{default:"h-9 px-3",sm:"h-8 px-2.5 text-xs",icon:"size-9 p-0"}},defaultVariants:{variant:"default",size:"default"}});function fe({className:e,variant:t,size:s,...r}){return u.jsx("button",{className:pe(l4({variant:t,size:s,className:e})),...r})}const p2=E.createContext({});function c4(e){const t=E.useRef(null);return t.current===null&&(t.current=e()),t.current}const u4=typeof window<"u",d4=u4?E.useLayoutEffect:E.useEffect,Tg=E.createContext(null);function Mg(e,t){e.indexOf(t)===-1&&e.push(t)}function ld(e,t){const s=e.indexOf(t);s>-1&&e.splice(s,1)}const Qs=(e,t,s)=>s>t?t:s<e?e:s;let Ag=()=>{};const Tr={},g2=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function _2(e){return typeof e=="object"&&e!==null}const v2=e=>/^0[^.\s]+$/u.test(e);function b2(e){let t;return()=>(t===void 0&&(t=e()),t)}const Cs=e=>e,h4=(e,t)=>s=>t(e(s)),uc=(...e)=>e.reduce(h4),Zl=(e,t,s)=>{const r=t-e;return r===0?1:(s-e)/r};class Rg{constructor(){this.subscriptions=[]}add(t){return Mg(this.subscriptions,t),()=>ld(this.subscriptions,t)}notify(t,s,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,s,r);else for(let l=0;l<o;l++){const d=this.subscriptions[l];d&&d(t,s,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const os=e=>e*1e3,ws=e=>e/1e3;function y2(e,t){return t?e*(1e3/t):0}const x2=(e,t,s)=>(((1-3*s+3*t)*e+(3*s-6*t))*e+3*t)*e,f4=1e-7,m4=12;function p4(e,t,s,r,o){let l,d,f=0;do d=t+(s-t)/2,l=x2(d,r,o)-e,l>0?s=d:t=d;while(Math.abs(l)>f4&&++f<m4);return d}function dc(e,t,s,r){if(e===t&&s===r)return Cs;const o=l=>p4(l,0,1,e,s);return l=>l===0||l===1?l:x2(o(l),t,r)}const S2=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,w2=e=>t=>1-e(1-t),E2=dc(.33,1.53,.69,.99),Dg=w2(E2),C2=S2(Dg),N2=e=>e>=1?1:(e*=2)<1?.5*Dg(e):.5*(2-Math.pow(2,-10*(e-1))),Og=e=>1-Math.sin(Math.acos(e)),k2=w2(Og),T2=S2(Og),g4=dc(.42,0,1,1),_4=dc(0,0,.58,1),M2=dc(.42,0,.58,1),v4=e=>Array.isArray(e)&&typeof e[0]!="number",A2=e=>Array.isArray(e)&&typeof e[0]=="number",b4={linear:Cs,easeIn:g4,easeInOut:M2,easeOut:_4,circIn:Og,circInOut:T2,circOut:k2,backIn:Dg,backInOut:C2,backOut:E2,anticipate:N2},y4=e=>typeof e=="string",h1=e=>{if(A2(e)){Ag(e.length===4);const[t,s,r,o]=e;return dc(t,s,r,o)}else if(y4(e))return b4[e];return e},ju=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function x4(e,t){let s=new Set,r=new Set,o=!1,l=!1;const d=new WeakSet;let f={delta:0,timestamp:0,isProcessing:!1};function m(_){d.has(_)&&(h.schedule(_),e()),_(f)}const h={schedule:(_,v=!1,b=!1)=>{const x=b&&o?s:r;return v&&d.add(_),x.add(_),_},cancel:_=>{r.delete(_),d.delete(_)},process:_=>{if(f=_,o){l=!0;return}o=!0;const v=s;s=r,r=v,s.forEach(m),s.clear(),o=!1,l&&(l=!1,h.process(_))}};return h}const S4=40;function R2(e,t){let s=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},l=()=>s=!0,d=ju.reduce((T,M)=>(T[M]=x4(l),T),{}),{setup:f,read:m,resolveKeyframes:h,preUpdate:_,update:v,preRender:b,render:y,postRender:x}=d,w=()=>{const T=Tr.useManualTiming,M=T?o.timestamp:performance.now();s=!1,T||(o.delta=r?1e3/60:Math.max(Math.min(M-o.timestamp,S4),1)),o.timestamp=M,o.isProcessing=!0,f.process(o),m.process(o),h.process(o),_.process(o),v.process(o),b.process(o),y.process(o),x.process(o),o.isProcessing=!1,s&&t&&(r=!1,e(w))},N=()=>{s=!0,r=!0,o.isProcessing||e(w)};return{schedule:ju.reduce((T,M)=>{const z=d[M];return T[M]=(U,j=!1,O=!1)=>(s||N(),z.schedule(U,j,O)),T},{}),cancel:T=>{for(let M=0;M<ju.length;M++)d[ju[M]].cancel(T)},state:o,steps:d}}const{schedule:yt,cancel:Mr,state:Si,steps:Yf}=R2(typeof requestAnimationFrame<"u"?requestAnimationFrame:Cs,!0);let Gu;function w4(){Gu=void 0}const Oi={now:()=>(Gu===void 0&&Oi.set(Si.isProcessing||Tr.useManualTiming?Si.timestamp:performance.now()),Gu),set:e=>{Gu=e,queueMicrotask(w4)}},D2=e=>t=>typeof t=="string"&&t.startsWith(e),O2=D2("--"),E4=D2("var(--"),Lg=e=>E4(e)?C4.test(e.split("/*")[0].trim()):!1,C4=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function f1(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const xo={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Ql={...xo,transform:e=>Qs(0,1,e)},Bu={...xo,default:1},Vl=e=>Math.round(e*1e5)/1e5,jg=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function N4(e){return e==null}const k4=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Bg=(e,t)=>s=>!!(typeof s=="string"&&k4.test(s)&&s.startsWith(e)||t&&!N4(s)&&Object.prototype.hasOwnProperty.call(s,t)),L2=(e,t,s)=>r=>{if(typeof r!="string")return r;const[o,l,d,f]=r.match(jg);return{[e]:parseFloat(o),[t]:parseFloat(l),[s]:parseFloat(d),alpha:f!==void 0?parseFloat(f):1}},T4=e=>Qs(0,255,e),Xf={...xo,transform:e=>Math.round(T4(e))},la={test:Bg("rgb","red"),parse:L2("red","green","blue"),transform:({red:e,green:t,blue:s,alpha:r=1})=>"rgba("+Xf.transform(e)+", "+Xf.transform(t)+", "+Xf.transform(s)+", "+Vl(Ql.transform(r))+")"};function M4(e){let t="",s="",r="",o="";return e.length>5?(t=e.substring(1,3),s=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),s=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,s+=s,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(s,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const _p={test:Bg("#"),parse:M4,transform:la.transform},hc=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Sr=hc("deg"),Ys=hc("%"),Ne=hc("px"),A4=hc("vh"),R4=hc("vw"),m1={...Ys,parse:e=>Ys.parse(e)/100,transform:e=>Ys.transform(e*100)},ho={test:Bg("hsl","hue"),parse:L2("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:s,alpha:r=1})=>"hsla("+Math.round(e)+", "+Ys.transform(Vl(t))+", "+Ys.transform(Vl(s))+", "+Vl(Ql.transform(r))+")"},Jt={test:e=>la.test(e)||_p.test(e)||ho.test(e),parse:e=>la.test(e)?la.parse(e):ho.test(e)?ho.parse(e):_p.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?la.transform(e):ho.transform(e),getAnimatableNone:e=>{const t=Jt.parse(e);return t.alpha=0,Jt.transform(t)}},D4=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function O4(e){return isNaN(e)&&typeof e=="string"&&(e.match(jg)?.length||0)+(e.match(D4)?.length||0)>0}const j2="number",B2="color",L4="var",j4="var(",p1="${}",B4=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function vo(e){const t=e.toString(),s=[],r={color:[],number:[],var:[]},o=[];let l=0;const f=t.replace(B4,m=>(Jt.test(m)?(r.color.push(l),o.push(B2),s.push(Jt.parse(m))):m.startsWith(j4)?(r.var.push(l),o.push(L4),s.push(m)):(r.number.push(l),o.push(j2),s.push(parseFloat(m))),++l,p1)).split(p1);return{values:s,split:f,indexes:r,types:o}}function z4(e){return vo(e).values}function z2({split:e,types:t}){const s=e.length;return r=>{let o="";for(let l=0;l<s;l++)if(o+=e[l],r[l]!==void 0){const d=t[l];d===j2?o+=Vl(r[l]):d===B2?o+=Jt.transform(r[l]):o+=r[l]}return o}}function P4(e){return z2(vo(e))}const I4=e=>typeof e=="number"?0:Jt.test(e)?Jt.getAnimatableNone(e):e,U4=(e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:I4(e);function H4(e){const t=vo(e);return z2(t)(t.values.map((r,o)=>U4(r,t.split[o])))}const Bs={test:O4,parse:z4,createTransformer:P4,getAnimatableNone:H4};function Zf(e,t,s){return s<0&&(s+=1),s>1&&(s-=1),s<1/6?e+(t-e)*6*s:s<1/2?t:s<2/3?e+(t-e)*(2/3-s)*6:e}function F4({hue:e,saturation:t,lightness:s,alpha:r}){e/=360,t/=100,s/=100;let o=0,l=0,d=0;if(!t)o=l=d=s;else{const f=s<.5?s*(1+t):s+t-s*t,m=2*s-f;o=Zf(m,f,e+1/3),l=Zf(m,f,e),d=Zf(m,f,e-1/3)}return{red:Math.round(o*255),green:Math.round(l*255),blue:Math.round(d*255),alpha:r}}function cd(e,t){return s=>s>0?t:e}const Nt=(e,t,s)=>e+(t-e)*s,Qf=(e,t,s)=>{const r=e*e,o=s*(t*t-r)+r;return o<0?0:Math.sqrt(o)},V4=[_p,la,ho],$4=e=>V4.find(t=>t.test(e));function g1(e){const t=$4(e);if(!t)return!1;let s=t.parse(e);return t===ho&&(s=F4(s)),s}const _1=(e,t)=>{const s=g1(e),r=g1(t);if(!s||!r)return cd(e,t);const o={...s};return l=>(o.red=Qf(s.red,r.red,l),o.green=Qf(s.green,r.green,l),o.blue=Qf(s.blue,r.blue,l),o.alpha=Nt(s.alpha,r.alpha,l),la.transform(o))},vp=new Set(["none","hidden"]);function q4(e,t){return vp.has(e)?s=>s<=0?e:t:s=>s>=1?t:e}function K4(e,t){return s=>Nt(e,t,s)}function zg(e){return typeof e=="number"?K4:typeof e=="string"?Lg(e)?cd:Jt.test(e)?_1:Y4:Array.isArray(e)?P2:typeof e=="object"?Jt.test(e)?_1:G4:cd}function P2(e,t){const s=[...e],r=s.length,o=e.map((l,d)=>zg(l)(l,t[d]));return l=>{for(let d=0;d<r;d++)s[d]=o[d](l);return s}}function G4(e,t){const s={...e,...t},r={};for(const o in s)e[o]!==void 0&&t[o]!==void 0&&(r[o]=zg(e[o])(e[o],t[o]));return o=>{for(const l in r)s[l]=r[l](o);return s}}function W4(e,t){const s=[],r={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const l=t.types[o],d=e.indexes[l][r[l]],f=e.values[d]??0;s[o]=f,r[l]++}return s}const Y4=(e,t)=>{const s=Bs.createTransformer(t),r=vo(e),o=vo(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?vp.has(e)&&!o.values.length||vp.has(t)&&!r.values.length?q4(e,t):uc(P2(W4(r,o),o.values),s):cd(e,t)};function I2(e,t,s){return typeof e=="number"&&typeof t=="number"&&typeof s=="number"?Nt(e,t,s):zg(e)(e,t)}const X4=e=>{const t=({timestamp:s})=>e(s);return{start:(s=!0)=>yt.update(t,s),stop:()=>Mr(t),now:()=>Si.isProcessing?Si.timestamp:Oi.now()}},U2=(e,t,s=10)=>{let r="";const o=Math.max(Math.round(t/s),2);for(let l=0;l<o;l++)r+=Math.round(e(l/(o-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},ud=2e4;function Pg(e){let t=0;const s=50;let r=e.next(t);for(;!r.done&&t<ud;)t+=s,r=e.next(t);return t>=ud?1/0:t}function Z4(e,t=100,s){const r=s({...e,keyframes:[0,t]}),o=Math.min(Pg(r),ud);return{type:"keyframes",ease:l=>r.next(o*l).value/t,duration:ws(o)}}const Bt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function bp(e,t){return e*Math.sqrt(1-t*t)}const Q4=12;function J4(e,t,s){let r=s;for(let o=1;o<Q4;o++)r=r-e(r)/t(r);return r}const Jf=.001;function eM({duration:e=Bt.duration,bounce:t=Bt.bounce,velocity:s=Bt.velocity,mass:r=Bt.mass}){let o,l,d=1-t;d=Qs(Bt.minDamping,Bt.maxDamping,d),e=Qs(Bt.minDuration,Bt.maxDuration,ws(e)),d<1?(o=h=>{const _=h*d,v=_*e,b=_-s,y=bp(h,d),x=Math.exp(-v);return Jf-b/y*x},l=h=>{const v=h*d*e,b=v*s+s,y=Math.pow(d,2)*Math.pow(h,2)*e,x=Math.exp(-v),w=bp(Math.pow(h,2),d);return(-o(h)+Jf>0?-1:1)*((b-y)*x)/w}):(o=h=>{const _=Math.exp(-h*e),v=(h-s)*e+1;return-Jf+_*v},l=h=>{const _=Math.exp(-h*e),v=(s-h)*(e*e);return _*v});const f=5/e,m=J4(o,l,f);if(e=os(e),isNaN(m))return{stiffness:Bt.stiffness,damping:Bt.damping,duration:e};{const h=Math.pow(m,2)*r;return{stiffness:h,damping:d*2*Math.sqrt(r*h),duration:e}}}const tM=["duration","bounce"],iM=["stiffness","damping","mass"];function v1(e,t){return t.some(s=>e[s]!==void 0)}function sM(e){let t={velocity:Bt.velocity,stiffness:Bt.stiffness,damping:Bt.damping,mass:Bt.mass,isResolvedFromDuration:!1,...e};if(!v1(e,iM)&&v1(e,tM))if(t.velocity=0,e.visualDuration){const s=e.visualDuration,r=2*Math.PI/(s*1.2),o=r*r,l=2*Qs(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Bt.mass,stiffness:o,damping:l}}else{const s=eM({...e,velocity:0});t={...t,...s,mass:Bt.mass},t.isResolvedFromDuration=!0}return t}function dd(e=Bt.visualDuration,t=Bt.bounce){const s=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=s;const l=s.keyframes[0],d=s.keyframes[s.keyframes.length-1],f={done:!1,value:l},{stiffness:m,damping:h,mass:_,duration:v,velocity:b,isResolvedFromDuration:y}=sM({...s,velocity:-ws(s.velocity||0)}),x=b||0,w=h/(2*Math.sqrt(m*_)),N=d-l,A=ws(Math.sqrt(m/_)),R=Math.abs(N)<5;r||(r=R?Bt.restSpeed.granular:Bt.restSpeed.default),o||(o=R?Bt.restDelta.granular:Bt.restDelta.default);let T,M,z,U,j,O;if(w<1)z=bp(A,w),U=(x+w*A*N)/z,T=H=>{const G=Math.exp(-w*A*H);return d-G*(U*Math.sin(z*H)+N*Math.cos(z*H))},j=w*A*U+N*z,O=w*A*N-U*z,M=H=>Math.exp(-w*A*H)*(j*Math.sin(z*H)+O*Math.cos(z*H));else if(w===1){T=G=>d-Math.exp(-A*G)*(N+(x+A*N)*G);const H=x+A*N;M=G=>Math.exp(-A*G)*(A*H*G-x)}else{const H=A*Math.sqrt(w*w-1);T=ee=>{const q=Math.exp(-w*A*ee),k=Math.min(H*ee,300);return d-q*((x+w*A*N)*Math.sinh(k)+H*N*Math.cosh(k))/H};const G=(x+w*A*N)/H,J=w*A*G-N*H,I=w*A*N-G*H;M=ee=>{const q=Math.exp(-w*A*ee),k=Math.min(H*ee,300);return q*(J*Math.sinh(k)+I*Math.cosh(k))}}const K={calculatedDuration:y&&v||null,velocity:H=>os(M(H)),next:H=>{if(!y&&w<1){const J=Math.exp(-w*A*H),I=Math.sin(z*H),ee=Math.cos(z*H),q=d-J*(U*I+N*ee),k=os(J*(j*I+O*ee));return f.done=Math.abs(k)<=r&&Math.abs(d-q)<=o,f.value=f.done?d:q,f}const G=T(H);if(y)f.done=H>=v;else{const J=os(M(H));f.done=Math.abs(J)<=r&&Math.abs(d-G)<=o}return f.value=f.done?d:G,f},toString:()=>{const H=Math.min(Pg(K),ud),G=U2(J=>K.next(H*J).value,H,30);return H+"ms "+G},toTransition:()=>{}};return K}dd.applyToOptions=e=>{const t=Z4(e,100,dd);return e.ease=t.ease,e.duration=os(t.duration),e.type="keyframes",e};const nM=5;function H2(e,t,s){const r=Math.max(t-nM,0);return y2(s-e(r),t-r)}function yp({keyframes:e,velocity:t=0,power:s=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:l=500,modifyTarget:d,min:f,max:m,restDelta:h=.5,restSpeed:_}){const v=e[0],b={done:!1,value:v},y=O=>f!==void 0&&O<f||m!==void 0&&O>m,x=O=>f===void 0?m:m===void 0||Math.abs(f-O)<Math.abs(m-O)?f:m;let w=s*t;const N=v+w,A=d===void 0?N:d(N);A!==N&&(w=A-v);const R=O=>-w*Math.exp(-O/r),T=O=>A+R(O),M=O=>{const K=R(O),H=T(O);b.done=Math.abs(K)<=h,b.value=b.done?A:H};let z,U;const j=O=>{y(b.value)&&(z=O,U=dd({keyframes:[b.value,x(b.value)],velocity:H2(T,O,b.value),damping:o,stiffness:l,restDelta:h,restSpeed:_}))};return j(0),{calculatedDuration:null,next:O=>{let K=!1;return!U&&z===void 0&&(K=!0,M(O),j(O)),z!==void 0&&O>=z?U.next(O-z):(!K&&M(O),b)}}}function rM(e,t,s){const r=[],o=s||Tr.mix||I2,l=e.length-1;for(let d=0;d<l;d++){let f=o(e[d],e[d+1]);if(t){const m=Array.isArray(t)?t[d]||Cs:t;f=uc(m,f)}r.push(f)}return r}function aM(e,t,{clamp:s=!0,ease:r,mixer:o}={}){const l=e.length;if(Ag(l===t.length),l===1)return()=>t[0];if(l===2&&t[0]===t[1])return()=>t[1];const d=e[0]===e[1];e[0]>e[l-1]&&(e=[...e].reverse(),t=[...t].reverse());const f=rM(t,r,o),m=f.length,h=_=>{if(d&&_<e[0])return t[0];let v=0;if(m>1)for(;v<e.length-2&&!(_<e[v+1]);v++);const b=Zl(e[v],e[v+1],_);return f[v](b)};return s?_=>h(Qs(e[0],e[l-1],_)):h}function oM(e,t){const s=e[e.length-1];for(let r=1;r<=t;r++){const o=Zl(0,t,r);e.push(Nt(s,1,o))}}function lM(e){const t=[0];return oM(t,e.length-1),t}function cM(e,t){return e.map(s=>s*t)}function uM(e,t){return e.map(()=>t||M2).splice(0,e.length-1)}function $l({duration:e=300,keyframes:t,times:s,ease:r="easeInOut"}){const o=v4(r)?r.map(h1):h1(r),l={done:!1,value:t[0]},d=cM(s&&s.length===t.length?s:lM(t),e),f=aM(d,t,{ease:Array.isArray(o)?o:uM(t,o)});return{calculatedDuration:e,next:m=>(l.value=f(m),l.done=m>=e,l)}}const dM=e=>e!==null;function Td(e,{repeat:t,repeatType:s="loop"},r,o=1){const l=e.filter(dM),f=o<0||t&&s!=="loop"&&t%2===1?0:l.length-1;return!f||r===void 0?l[f]:r}const hM={decay:yp,inertia:yp,tween:$l,keyframes:$l,spring:dd};function F2(e){typeof e.type=="string"&&(e.type=hM[e.type])}class Ig{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,s){return this.finished.then(t,s)}}const fM=e=>e/100;class hd extends Ig{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:s}=this.options;s&&s.updatedAt!==Oi.now()&&this.tick(Oi.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;F2(t);const{type:s=$l,repeat:r=0,repeatDelay:o=0,repeatType:l,velocity:d=0}=t;let{keyframes:f}=t;const m=s||$l;m!==$l&&typeof f[0]!="number"&&(this.mixKeyframes=uc(fM,I2(f[0],f[1])),f=[0,100]);const h=m({...t,keyframes:f});l==="mirror"&&(this.mirroredGenerator=m({...t,keyframes:[...f].reverse(),velocity:-d})),h.calculatedDuration===null&&(h.calculatedDuration=Pg(h));const{calculatedDuration:_}=h;this.calculatedDuration=_,this.resolvedDuration=_+o,this.totalDuration=this.resolvedDuration*(r+1)-o,this.generator=h}updateTime(t){const s=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=s}tick(t,s=!1){const{generator:r,totalDuration:o,mixKeyframes:l,mirroredGenerator:d,resolvedDuration:f,calculatedDuration:m}=this;if(this.startTime===null)return r.next(0);const{delay:h=0,keyframes:_,repeat:v,repeatType:b,repeatDelay:y,type:x,onUpdate:w,finalKeyframe:N}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),s?this.currentTime=t:this.updateTime(t);const A=this.currentTime-h*(this.playbackSpeed>=0?1:-1),R=this.playbackSpeed>=0?A<0:A>o;this.currentTime=Math.max(A,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let T=this.currentTime,M=r;if(v){const O=Math.min(this.currentTime,o)/f;let K=Math.floor(O),H=O%1;!H&&O>=1&&(H=1),H===1&&K--,K=Math.min(K,v+1),K%2&&(b==="reverse"?(H=1-H,y&&(H-=y/f)):b==="mirror"&&(M=d)),T=Qs(0,1,H)*f}let z;R?(this.delayState.value=_[0],z=this.delayState):z=M.next(T),l&&!R&&(z.value=l(z.value));let{done:U}=z;!R&&m!==null&&(U=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const j=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&U);return j&&x!==yp&&(z.value=Td(_,this.options,N,this.speed)),w&&w(z.value),j&&this.finish(),z}then(t,s){return this.finished.then(t,s)}get duration(){return ws(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+ws(t)}get time(){return ws(this.currentTime)}set time(t){t=os(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const s=this.generator.next(t).value;return H2(r=>this.generator.next(r).value,t,s)}get speed(){return this.playbackSpeed}set speed(t){const s=this.playbackSpeed!==t;s&&this.driver&&this.updateTime(Oi.now()),this.playbackSpeed=t,s&&this.driver&&(this.time=ws(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=X4,startTime:s}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=s??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Oi.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function mM(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const ca=e=>e*180/Math.PI,xp=e=>{const t=ca(Math.atan2(e[1],e[0]));return Sp(t)},pM={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:xp,rotateZ:xp,skewX:e=>ca(Math.atan(e[1])),skewY:e=>ca(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Sp=e=>(e=e%360,e<0&&(e+=360),e),b1=xp,y1=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),x1=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),gM={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:y1,scaleY:x1,scale:e=>(y1(e)+x1(e))/2,rotateX:e=>Sp(ca(Math.atan2(e[6],e[5]))),rotateY:e=>Sp(ca(Math.atan2(-e[2],e[0]))),rotateZ:b1,rotate:b1,skewX:e=>ca(Math.atan(e[4])),skewY:e=>ca(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function wp(e){return e.includes("scale")?1:0}function Ep(e,t){if(!e||e==="none")return wp(t);const s=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(s)r=gM,o=s;else{const f=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=pM,o=f}if(!o)return wp(t);const l=r[t],d=o[1].split(",").map(vM);return typeof l=="function"?l(d):d[l]}const _M=(e,t)=>{const{transform:s="none"}=getComputedStyle(e);return Ep(s,t)};function vM(e){return parseFloat(e.trim())}const So=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],wo=new Set(So),S1=e=>e===xo||e===Ne,bM=new Set(["x","y","z"]),yM=So.filter(e=>!bM.has(e));function xM(e){const t=[];return yM.forEach(s=>{const r=e.getValue(s);r!==void 0&&(t.push([s,r.get()]),r.set(s.startsWith("scale")?1:0))}),t}const Cr={width:({x:e},{paddingLeft:t="0",paddingRight:s="0",boxSizing:r})=>{const o=e.max-e.min;return r==="border-box"?o:o-parseFloat(t)-parseFloat(s)},height:({y:e},{paddingTop:t="0",paddingBottom:s="0",boxSizing:r})=>{const o=e.max-e.min;return r==="border-box"?o:o-parseFloat(t)-parseFloat(s)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Ep(t,"x"),y:(e,{transform:t})=>Ep(t,"y")};Cr.translateX=Cr.x;Cr.translateY=Cr.y;const da=new Set;let Cp=!1,Np=!1,kp=!1;function V2(){if(Np){const e=Array.from(da).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),s=new Map;t.forEach(r=>{const o=xM(r);o.length&&(s.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const o=s.get(r);o&&o.forEach(([l,d])=>{r.getValue(l)?.set(d)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Np=!1,Cp=!1,da.forEach(e=>e.complete(kp)),da.clear()}function $2(){da.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Np=!0)})}function SM(){kp=!0,$2(),V2(),kp=!1}class Ug{constructor(t,s,r,o,l,d=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=s,this.name=r,this.motionValue=o,this.element=l,this.isAsync=d}scheduleResolve(){this.state="scheduled",this.isAsync?(da.add(this),Cp||(Cp=!0,yt.read($2),yt.resolveKeyframes(V2))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:s,element:r,motionValue:o}=this;if(t[0]===null){const l=o?.get(),d=t[t.length-1];if(l!==void 0)t[0]=l;else if(r&&s){const f=r.readValue(s,d);f!=null&&(t[0]=f)}t[0]===void 0&&(t[0]=d),o&&l===void 0&&o.set(t[0])}mM(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),da.delete(this)}cancel(){this.state==="scheduled"&&(da.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const wM=e=>e.startsWith("--");function q2(e,t,s){wM(t)?e.style.setProperty(t,s):e.style[t]=s}const EM={};function K2(e,t){const s=b2(e);return()=>EM[t]??s()}const CM=K2(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),G2=K2(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Bl=([e,t,s,r])=>`cubic-bezier(${e}, ${t}, ${s}, ${r})`,w1={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Bl([0,.65,.55,1]),circOut:Bl([.55,0,1,.45]),backIn:Bl([.31,.01,.66,-.59]),backOut:Bl([.33,1.53,.69,.99])};function W2(e,t){if(e)return typeof e=="function"?G2()?U2(e,t):"ease-out":A2(e)?Bl(e):Array.isArray(e)?e.map(s=>W2(s,t)||w1.easeOut):w1[e]}function NM(e,t,s,{delay:r=0,duration:o=300,repeat:l=0,repeatType:d="loop",ease:f="easeOut",times:m}={},h=void 0){const _={[t]:s};m&&(_.offset=m);const v=W2(f,o);Array.isArray(v)&&(_.easing=v);const b={delay:r,duration:o,easing:Array.isArray(v)?"linear":v,fill:"both",iterations:l+1,direction:d==="reverse"?"alternate":"normal"};return h&&(b.pseudoElement=h),e.animate(_,b)}function Y2(e){return typeof e=="function"&&"applyToOptions"in e}function kM({type:e,...t}){return Y2(e)&&G2()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class X2 extends Ig{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:s,name:r,keyframes:o,pseudoElement:l,allowFlatten:d=!1,finalKeyframe:f,onComplete:m}=t;this.isPseudoElement=!!l,this.allowFlatten=d,this.options=t,Ag(typeof t.type!="string");const h=kM(t);this.animation=NM(s,r,o,h,l),h.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!l){const _=Td(o,this.options,f,this.speed);this.updateMotionValue&&this.updateMotionValue(_),q2(s,r,_),this.animation.cancel()}m?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return ws(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+ws(t)}get time(){return ws(Number(this.animation.currentTime)||0)}set time(t){const s=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=os(t),s&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:s,rangeEnd:r,observe:o}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&CM()?(this.animation.timeline=t,s&&(this.animation.rangeStart=s),r&&(this.animation.rangeEnd=r),Cs):o(this)}}const Z2={anticipate:N2,backInOut:C2,circInOut:T2};function TM(e){return e in Z2}function MM(e){typeof e.ease=="string"&&TM(e.ease)&&(e.ease=Z2[e.ease])}const em=10;class AM extends X2{constructor(t){MM(t),F2(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:s,onUpdate:r,onComplete:o,element:l,...d}=this.options;if(!s)return;if(t!==void 0){s.set(t);return}const f=new hd({...d,autoplay:!1}),m=Math.max(em,Oi.now()-this.startTime),h=Qs(0,em,m-em),_=f.sample(m).value,{name:v}=this.options;l&&v&&q2(l,v,_),s.setWithVelocity(f.sample(Math.max(0,m-h)).value,_,h),f.stop()}}const E1=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Bs.test(e)||e==="0")&&!e.startsWith("url("));function RM(e){const t=e[0];if(e.length===1)return!0;for(let s=0;s<e.length;s++)if(e[s]!==t)return!0}function DM(e,t,s,r){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const l=e[e.length-1],d=E1(o,t),f=E1(l,t);return!d||!f?!1:RM(e)||(s==="spring"||Y2(s))&&r}function Tp(e){e.duration=0,e.type="keyframes"}const Q2=new Set(["opacity","clipPath","filter","transform"]),OM=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function LM(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&OM.test(e[t]))return!0;return!1}const jM=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),BM=b2(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function zM(e){const{motionValue:t,name:s,repeatDelay:r,repeatType:o,damping:l,type:d,keyframes:f}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:h,transformTemplate:_}=t.owner.getProps();return BM()&&s&&(Q2.has(s)||jM.has(s)&&LM(f))&&(s!=="transform"||!_)&&!h&&!r&&o!=="mirror"&&l!==0&&d!=="inertia"}const PM=40;class IM extends Ig{constructor({autoplay:t=!0,delay:s=0,type:r="keyframes",repeat:o=0,repeatDelay:l=0,repeatType:d="loop",keyframes:f,name:m,motionValue:h,element:_,...v}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Oi.now();const b={autoplay:t,delay:s,type:r,repeat:o,repeatDelay:l,repeatType:d,name:m,motionValue:h,element:_,...v},y=_?.KeyframeResolver||Ug;this.keyframeResolver=new y(f,(x,w,N)=>this.onKeyframesResolved(x,w,b,!N),m,h,_),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,s,r,o){this.keyframeResolver=void 0;const{name:l,type:d,velocity:f,delay:m,isHandoff:h,onUpdate:_}=r;this.resolvedAt=Oi.now();let v=!0;DM(t,l,d,f)||(v=!1,(Tr.instantAnimations||!m)&&_?.(Td(t,r,s)),t[0]=t[t.length-1],Tp(r),r.repeat=0);const y={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>PM?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:s,...r,keyframes:t},x=v&&!h&&zM(y),w=y.motionValue?.owner?.current;let N;if(x)try{N=new AM({...y,element:w})}catch{N=new hd(y)}else N=new hd(y);N.finished.then(()=>{this.notifyFinished()}).catch(Cs),this.pendingTimeline&&(this.stopTimeline=N.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=N}get finished(){return this._animation?this.animation.finished:this._finished}then(t,s){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),SM()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function J2(e,t,s,r=0,o=1){const l=Array.from(e).sort((h,_)=>h.sortNodePosition(_)).indexOf(t),d=e.size,f=(d-1)*r;return typeof s=="function"?s(l,d):o===1?l*r:f-l*r}const UM=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function HM(e){const t=UM.exec(e);if(!t)return[,];const[,s,r,o]=t;return[`--${s??r}`,o]}function ew(e,t,s=1){const[r,o]=HM(e);if(!r)return;const l=window.getComputedStyle(t).getPropertyValue(r);if(l){const d=l.trim();return g2(d)?parseFloat(d):d}return Lg(o)?ew(o,t,s+1):o}const FM={type:"spring",stiffness:500,damping:25,restSpeed:10},VM=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),$M={type:"keyframes",duration:.8},qM={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},KM=(e,{keyframes:t})=>t.length>2?$M:wo.has(e)?e.startsWith("scale")?VM(t[1]):FM:qM;function tw(e,t){if(e?.inherit&&t){const{inherit:s,...r}=e;return{...t,...r}}return e}function Hg(e,t){const s=e?.[t]??e?.default??e;return s!==e?tw(s,e):s}const GM=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function WM(e){for(const t in e)if(!GM.has(t))return!0;return!1}const Fg=(e,t,s,r={},o,l)=>d=>{const f=Hg(r,e)||{},m=f.delay||r.delay||0;let{elapsed:h=0}=r;h=h-os(m);const _={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:t.getVelocity(),...f,delay:-h,onUpdate:b=>{t.set(b),f.onUpdate&&f.onUpdate(b)},onComplete:()=>{d(),f.onComplete&&f.onComplete()},name:e,motionValue:t,element:l?void 0:o};WM(f)||Object.assign(_,KM(e,_)),_.duration&&(_.duration=os(_.duration)),_.repeatDelay&&(_.repeatDelay=os(_.repeatDelay)),_.from!==void 0&&(_.keyframes[0]=_.from);let v=!1;if((_.type===!1||_.duration===0&&!_.repeatDelay)&&(Tp(_),_.delay===0&&(v=!0)),(Tr.instantAnimations||Tr.skipAnimations||o?.shouldSkipAnimations)&&(v=!0,Tp(_),_.delay=0),_.allowFlatten=!f.type&&!f.ease,v&&!l&&t.get()!==void 0){const b=Td(_.keyframes,f);if(b!==void 0){yt.update(()=>{_.onUpdate(b),_.onComplete()});return}}return f.isSync?new hd(_):new IM(_)};function C1(e){const t=[{},{}];return e?.values.forEach((s,r)=>{t[0][r]=s.get(),t[1][r]=s.getVelocity()}),t}function Vg(e,t,s,r){if(typeof t=="function"){const[o,l]=C1(r);t=t(s!==void 0?s:e.custom,o,l)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,l]=C1(r);t=t(s!==void 0?s:e.custom,o,l)}return t}function ha(e,t,s){const r=e.getProps();return Vg(r,t,s!==void 0?s:r.custom,e)}const iw=new Set(["width","height","top","left","right","bottom",...So]),N1=30,YM=e=>!isNaN(parseFloat(e));class XM{constructor(t,s={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const o=Oi.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const l of this.dependents)l.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=s.owner}setCurrent(t){this.current=t,this.updatedAt=Oi.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=YM(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,s){this.events[t]||(this.events[t]=new Rg);const r=this.events[t].add(s);return t==="change"?()=>{r(),yt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,s){this.passiveEffect=t,this.stopPassiveEffect=s}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,s,r){this.set(s),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,s=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,s&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Oi.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>N1)return 0;const s=Math.min(this.updatedAt-this.prevUpdatedAt,N1);return y2(parseFloat(this.current)-parseFloat(this.prevFrameValue),s)}start(t){return this.stop(),new Promise(s=>{this.hasAnimated=!0,this.animation=t(s),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function bo(e,t){return new XM(e,t)}const Mp=e=>Array.isArray(e);function ZM(e,t,s){e.hasValue(t)?e.getValue(t).set(s):e.addValue(t,bo(s))}function QM(e){return Mp(e)?e[e.length-1]||0:e}function JM(e,t){const s=ha(e,t);let{transitionEnd:r={},transition:o={},...l}=s||{};l={...l,...r};for(const d in l){const f=QM(l[d]);ZM(e,d,f)}}const Ei=e=>!!(e&&e.getVelocity);function e6(e){return!!(Ei(e)&&e.add)}function Ap(e,t){const s=e.getValue("willChange");if(e6(s))return s.add(t);if(!s&&Tr.WillChange){const r=new Tr.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function $g(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const t6="framerAppearId",sw="data-"+$g(t6);function nw(e){return e.props[sw]}function i6({protectedKeys:e,needsAnimating:t},s){const r=e.hasOwnProperty(s)&&t[s]!==!0;return t[s]=!1,r}function rw(e,t,{delay:s=0,transitionOverride:r,type:o}={}){let{transition:l,transitionEnd:d,...f}=t;const m=e.getDefaultTransition();l=l?tw(l,m):m;const h=l?.reduceMotion;r&&(l=r);const _=[],v=o&&e.animationState&&e.animationState.getState()[o];for(const b in f){const y=e.getValue(b,e.latestValues[b]??null),x=f[b];if(x===void 0||v&&i6(v,b))continue;const w={delay:s,...Hg(l||{},b)},N=y.get();if(N!==void 0&&!y.isAnimating()&&!Array.isArray(x)&&x===N&&!w.velocity){yt.update(()=>y.set(x));continue}let A=!1;if(window.MotionHandoffAnimation){const M=nw(e);if(M){const z=window.MotionHandoffAnimation(M,b,yt);z!==null&&(w.startTime=z,A=!0)}}Ap(e,b);const R=h??e.shouldReduceMotion;y.start(Fg(b,y,x,R&&iw.has(b)?{type:!1}:w,e,A));const T=y.animation;T&&_.push(T)}if(d){const b=()=>yt.update(()=>{d&&JM(e,d)});_.length?Promise.all(_).then(b):b()}return _}function Rp(e,t,s={}){const r=ha(e,t,s.type==="exit"?e.presenceContext?.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};s.transitionOverride&&(o=s.transitionOverride);const l=r?()=>Promise.all(rw(e,r,s)):()=>Promise.resolve(),d=e.variantChildren&&e.variantChildren.size?(m=0)=>{const{delayChildren:h=0,staggerChildren:_,staggerDirection:v}=o;return s6(e,t,m,h,_,v,s)}:()=>Promise.resolve(),{when:f}=o;if(f){const[m,h]=f==="beforeChildren"?[l,d]:[d,l];return m().then(()=>h())}else return Promise.all([l(),d(s.delay)])}function s6(e,t,s=0,r=0,o=0,l=1,d){const f=[];for(const m of e.variantChildren)m.notify("AnimationStart",t),f.push(Rp(m,t,{...d,delay:s+(typeof r=="function"?0:r)+J2(e.variantChildren,m,r,o,l)}).then(()=>m.notify("AnimationComplete",t)));return Promise.all(f)}function n6(e,t,s={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(l=>Rp(e,l,s));r=Promise.all(o)}else if(typeof t=="string")r=Rp(e,t,s);else{const o=typeof t=="function"?ha(e,t,s.custom):t;r=Promise.all(rw(e,o,s))}return r.then(()=>{e.notify("AnimationComplete",t)})}const r6={test:e=>e==="auto",parse:e=>e},aw=e=>t=>t.test(e),ow=[xo,Ne,Ys,Sr,R4,A4,r6],k1=e=>ow.find(aw(e));function a6(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||v2(e):!0}const o6=new Set(["brightness","contrast","saturate","opacity"]);function l6(e){const[t,s]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=s.match(jg)||[];if(!r)return e;const o=s.replace(r,"");let l=o6.has(t)?1:0;return r!==s&&(l*=100),t+"("+l+o+")"}const c6=/\b([a-z-]*)\(.*?\)/gu,Dp={...Bs,getAnimatableNone:e=>{const t=e.match(c6);return t?t.map(l6).join(" "):e}},Op={...Bs,getAnimatableNone:e=>{const t=Bs.parse(e);return Bs.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},T1={...xo,transform:Math.round},u6={rotate:Sr,rotateX:Sr,rotateY:Sr,rotateZ:Sr,scale:Bu,scaleX:Bu,scaleY:Bu,scaleZ:Bu,skew:Sr,skewX:Sr,skewY:Sr,distance:Ne,translateX:Ne,translateY:Ne,translateZ:Ne,x:Ne,y:Ne,z:Ne,perspective:Ne,transformPerspective:Ne,opacity:Ql,originX:m1,originY:m1,originZ:Ne},qg={borderWidth:Ne,borderTopWidth:Ne,borderRightWidth:Ne,borderBottomWidth:Ne,borderLeftWidth:Ne,borderRadius:Ne,borderTopLeftRadius:Ne,borderTopRightRadius:Ne,borderBottomRightRadius:Ne,borderBottomLeftRadius:Ne,width:Ne,maxWidth:Ne,height:Ne,maxHeight:Ne,top:Ne,right:Ne,bottom:Ne,left:Ne,inset:Ne,insetBlock:Ne,insetBlockStart:Ne,insetBlockEnd:Ne,insetInline:Ne,insetInlineStart:Ne,insetInlineEnd:Ne,padding:Ne,paddingTop:Ne,paddingRight:Ne,paddingBottom:Ne,paddingLeft:Ne,paddingBlock:Ne,paddingBlockStart:Ne,paddingBlockEnd:Ne,paddingInline:Ne,paddingInlineStart:Ne,paddingInlineEnd:Ne,margin:Ne,marginTop:Ne,marginRight:Ne,marginBottom:Ne,marginLeft:Ne,marginBlock:Ne,marginBlockStart:Ne,marginBlockEnd:Ne,marginInline:Ne,marginInlineStart:Ne,marginInlineEnd:Ne,fontSize:Ne,backgroundPositionX:Ne,backgroundPositionY:Ne,...u6,zIndex:T1,fillOpacity:Ql,strokeOpacity:Ql,numOctaves:T1},d6={...qg,color:Jt,backgroundColor:Jt,outlineColor:Jt,fill:Jt,stroke:Jt,borderColor:Jt,borderTopColor:Jt,borderRightColor:Jt,borderBottomColor:Jt,borderLeftColor:Jt,filter:Dp,WebkitFilter:Dp,mask:Op,WebkitMask:Op},lw=e=>d6[e],h6=new Set([Dp,Op]);function cw(e,t){let s=lw(e);return h6.has(s)||(s=Bs),s.getAnimatableNone?s.getAnimatableNone(t):void 0}const f6=new Set(["auto","none","0"]);function m6(e,t,s){let r=0,o;for(;r<e.length&&!o;){const l=e[r];typeof l=="string"&&!f6.has(l)&&vo(l).values.length&&(o=e[r]),r++}if(o&&s)for(const l of t)e[l]=cw(s,o)}class p6 extends Ug{constructor(t,s,r,o,l){super(t,s,r,o,l,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:s,name:r}=this;if(!s||!s.current)return;super.readKeyframes();for(let _=0;_<t.length;_++){let v=t[_];if(typeof v=="string"&&(v=v.trim(),Lg(v))){const b=ew(v,s.current);b!==void 0&&(t[_]=b),_===t.length-1&&(this.finalKeyframe=v)}}if(this.resolveNoneKeyframes(),!iw.has(r)||t.length!==2)return;const[o,l]=t,d=k1(o),f=k1(l),m=f1(o),h=f1(l);if(m!==h&&Cr[r]){this.needsMeasurement=!0;return}if(d!==f)if(S1(d)&&S1(f))for(let _=0;_<t.length;_++){const v=t[_];typeof v=="string"&&(t[_]=parseFloat(v))}else Cr[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:s}=this,r=[];for(let o=0;o<t.length;o++)(t[o]===null||a6(t[o]))&&r.push(o);r.length&&m6(t,r,s)}measureInitialState(){const{element:t,unresolvedKeyframes:s,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Cr[r](t.measureViewportBox(),window.getComputedStyle(t.current)),s[0]=this.measuredOrigin;const o=s[s.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){const{element:t,name:s,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const o=t.getValue(s);o&&o.jump(this.measuredOrigin,!1);const l=r.length-1,d=r[l];r[l]=Cr[s](t.measureViewportBox(),window.getComputedStyle(t.current)),d!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=d),this.removedTransforms?.length&&this.removedTransforms.forEach(([f,m])=>{t.getValue(f).set(m)}),this.resolveNoneKeyframes()}}function uw(e,t,s){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const o=s?.[e]??r.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e).filter(r=>r!=null)}const dw=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function g6(e){return _2(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Kg}=R2(queueMicrotask,!1),js={x:!1,y:!1};function hw(){return js.x||js.y}function _6(e){return e==="x"||e==="y"?js[e]?null:(js[e]=!0,()=>{js[e]=!1}):js.x||js.y?null:(js.x=js.y=!0,()=>{js.x=js.y=!1})}function fw(e,t){const s=uw(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[s,o,()=>r.abort()]}function v6(e){return!(e.pointerType==="touch"||hw())}function b6(e,t,s={}){const[r,o,l]=fw(e,s);return r.forEach(d=>{let f=!1,m=!1,h;const _=()=>{d.removeEventListener("pointerleave",x)},v=N=>{h&&(h(N),h=void 0),_()},b=N=>{f=!1,window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",b),m&&(m=!1,v(N))},y=()=>{f=!0,window.addEventListener("pointerup",b,o),window.addEventListener("pointercancel",b,o)},x=N=>{if(N.pointerType!=="touch"){if(f){m=!0;return}v(N)}},w=N=>{if(!v6(N))return;m=!1;const A=t(d,N);typeof A=="function"&&(h=A,d.addEventListener("pointerleave",x,o))};d.addEventListener("pointerenter",w,o),d.addEventListener("pointerdown",y,o)}),l}const mw=(e,t)=>t?e===t?!0:mw(e,t.parentElement):!1,Gg=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,y6=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function x6(e){return y6.has(e.tagName)||e.isContentEditable===!0}const S6=new Set(["INPUT","SELECT","TEXTAREA"]);function w6(e){return S6.has(e.tagName)||e.isContentEditable===!0}const Wu=new WeakSet;function M1(e){return t=>{t.key==="Enter"&&e(t)}}function tm(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const E6=(e,t)=>{const s=e.currentTarget;if(!s)return;const r=M1(()=>{if(Wu.has(s))return;tm(s,"down");const o=M1(()=>{tm(s,"up")}),l=()=>tm(s,"cancel");s.addEventListener("keyup",o,t),s.addEventListener("blur",l,t)});s.addEventListener("keydown",r,t),s.addEventListener("blur",()=>s.removeEventListener("keydown",r),t)};function A1(e){return Gg(e)&&!hw()}const R1=new WeakSet;function C6(e,t,s={}){const[r,o,l]=fw(e,s),d=f=>{const m=f.currentTarget;if(!A1(f)||R1.has(f))return;Wu.add(m),s.stopPropagation&&R1.add(f);const h=t(m,f),_=(y,x)=>{window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",b),Wu.has(m)&&Wu.delete(m),A1(y)&&typeof h=="function"&&h(y,{success:x})},v=y=>{_(y,m===window||m===document||s.useGlobalTarget||mw(m,y.target))},b=y=>{_(y,!1)};window.addEventListener("pointerup",v,o),window.addEventListener("pointercancel",b,o)};return r.forEach(f=>{(s.useGlobalTarget?window:f).addEventListener("pointerdown",d,o),g6(f)&&(f.addEventListener("focus",h=>E6(h,o)),!x6(f)&&!f.hasAttribute("tabindex")&&(f.tabIndex=0))}),l}function Wg(e){return _2(e)&&"ownerSVGElement"in e}const Yu=new WeakMap;let Xu;const pw=(e,t,s)=>(r,o)=>o&&o[0]?o[0][e+"Size"]:Wg(r)&&"getBBox"in r?r.getBBox()[t]:r[s],N6=pw("inline","width","offsetWidth"),k6=pw("block","height","offsetHeight");function T6({target:e,borderBoxSize:t}){Yu.get(e)?.forEach(s=>{s(e,{get width(){return N6(e,t)},get height(){return k6(e,t)}})})}function M6(e){e.forEach(T6)}function A6(){typeof ResizeObserver>"u"||(Xu=new ResizeObserver(M6))}function R6(e,t){Xu||A6();const s=uw(e);return s.forEach(r=>{let o=Yu.get(r);o||(o=new Set,Yu.set(r,o)),o.add(t),Xu?.observe(r)}),()=>{s.forEach(r=>{const o=Yu.get(r);o?.delete(t),o?.size||Xu?.unobserve(r)})}}const Zu=new Set;let fo;function D6(){fo=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Zu.forEach(t=>t(e))},window.addEventListener("resize",fo)}function O6(e){return Zu.add(e),fo||D6(),()=>{Zu.delete(e),!Zu.size&&typeof fo=="function"&&(window.removeEventListener("resize",fo),fo=void 0)}}function D1(e,t){return typeof e=="function"?O6(e):R6(e,t)}function L6(e){return Wg(e)&&e.tagName==="svg"}const j6=[...ow,Jt,Bs],B6=e=>j6.find(aw(e)),O1=()=>({translate:0,scale:1,origin:0,originPoint:0}),mo=()=>({x:O1(),y:O1()}),L1=()=>({min:0,max:0}),ai=()=>({x:L1(),y:L1()}),z6=new WeakMap;function Md(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Jl(e){return typeof e=="string"||Array.isArray(e)}const Yg=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Xg=["initial",...Yg];function Ad(e){return Md(e.animate)||Xg.some(t=>Jl(e[t]))}function gw(e){return!!(Ad(e)||e.variants)}function P6(e,t,s){for(const r in t){const o=t[r],l=s[r];if(Ei(o))e.addValue(r,o);else if(Ei(l))e.addValue(r,bo(o,{owner:e}));else if(l!==o)if(e.hasValue(r)){const d=e.getValue(r);d.liveStyle===!0?d.jump(o):d.hasAnimated||d.set(o)}else{const d=e.getStaticValue(r);e.addValue(r,bo(d!==void 0?d:o,{owner:e}))}}for(const r in s)t[r]===void 0&&e.removeValue(r);return t}const Lp={current:null},_w={current:!1},I6=typeof window<"u";function U6(){if(_w.current=!0,!!I6)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Lp.current=e.matches;e.addEventListener("change",t),t()}else Lp.current=!1}const j1=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let fd={};function vw(e){fd=e}function H6(){return fd}class F6{scrapeMotionValuesFromProps(t,s,r){return{}}constructor({parent:t,props:s,presenceContext:r,reducedMotionConfig:o,skipAnimations:l,blockInitialAnimation:d,visualState:f},m={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Ug,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const y=Oi.now();this.renderScheduledAt<y&&(this.renderScheduledAt=y,yt.render(this.render,!1,!0))};const{latestValues:h,renderState:_}=f;this.latestValues=h,this.baseTarget={...h},this.initialValues=s.initial?{...h}:{},this.renderState=_,this.parent=t,this.props=s,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.skipAnimationsConfig=l,this.options=m,this.blockInitialAnimation=!!d,this.isControllingVariants=Ad(s),this.isVariantNode=gw(s),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:v,...b}=this.scrapeMotionValuesFromProps(s,{},this);for(const y in b){const x=b[y];h[y]!==void 0&&Ei(x)&&x.set(h[y])}}mount(t){if(this.hasBeenMounted)for(const s in this.initialValues)this.values.get(s)?.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=t,z6.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,r)=>this.bindToMotionValue(r,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(_w.current||U6(),this.shouldReduceMotion=Lp.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Mr(this.notifyUpdate),Mr(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const s=this.features[t];s&&(s.unmount(),s.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,s){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),s.accelerate&&Q2.has(t)&&this.current instanceof HTMLElement){const{factory:d,keyframes:f,times:m,ease:h,duration:_}=s.accelerate,v=new X2({element:this.current,name:t,keyframes:f,times:m,ease:h,duration:os(_)}),b=d(v);this.valueSubscriptions.set(t,()=>{b(),v.cancel()});return}const r=wo.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=s.on("change",d=>{this.latestValues[t]=d,this.props.onUpdate&&yt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let l;typeof window<"u"&&window.MotionCheckAppearSync&&(l=window.MotionCheckAppearSync(this,t,s)),this.valueSubscriptions.set(t,()=>{o(),l&&l(),s.owner&&s.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in fd){const s=fd[t];if(!s)continue;const{isEnabled:r,Feature:o}=s;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const l=this.features[t];l.isMounted?l.update():(l.mount(),l.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ai()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,s){this.latestValues[t]=s}update(t,s){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=s;for(let r=0;r<j1.length;r++){const o=j1[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const l="on"+o,d=t[l];d&&(this.propEventSubscriptions[o]=this.on(o,d))}this.prevMotionValues=P6(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const s=this.getClosestVariantNode();if(s)return s.variantChildren&&s.variantChildren.add(t),()=>s.variantChildren.delete(t)}addValue(t,s){const r=this.values.get(t);s!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,s),this.values.set(t,s),this.latestValues[t]=s.get())}removeValue(t){this.values.delete(t);const s=this.valueSubscriptions.get(t);s&&(s(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,s){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&s!==void 0&&(r=bo(s===null?void 0:s,{owner:this}),this.addValue(t,r)),r}readValue(t,s){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(g2(r)||v2(r))?r=parseFloat(r):!B6(r)&&Bs.test(s)&&(r=cw(t,s)),this.setBaseTarget(t,Ei(r)?r.get():r)),Ei(r)?r.get():r}setBaseTarget(t,s){this.baseTarget[t]=s}getBaseTarget(t){const{initial:s}=this.props;let r;if(typeof s=="string"||typeof s=="object"){const l=Vg(this.props,s,this.presenceContext?.custom);l&&(r=l[t])}if(s&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!Ei(o)?o:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,s){return this.events[t]||(this.events[t]=new Rg),this.events[t].add(s)}notify(t,...s){this.events[t]&&this.events[t].notify(...s)}scheduleRenderMicrotask(){Kg.render(this.render)}}class bw extends F6{constructor(){super(...arguments),this.KeyframeResolver=p6}sortInstanceNodePosition(t,s){return t.compareDocumentPosition(s)&2?1:-1}getBaseTargetFromProps(t,s){const r=t.style;return r?r[s]:void 0}removeValueFromRenderState(t,{vars:s,style:r}){delete s[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ei(t)&&(this.childSubscription=t.on("change",s=>{this.current&&(this.current.textContent=`${s}`)}))}}class Dr{constructor(t){this.isMounted=!1,this.node=t}update(){}}function yw({top:e,left:t,right:s,bottom:r}){return{x:{min:t,max:s},y:{min:e,max:r}}}function V6({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function $6(e,t){if(!t)return e;const s=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:s.y,left:s.x,bottom:r.y,right:r.x}}function im(e){return e===void 0||e===1}function jp({scale:e,scaleX:t,scaleY:s}){return!im(e)||!im(t)||!im(s)}function ra(e){return jp(e)||xw(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function xw(e){return B1(e.x)||B1(e.y)}function B1(e){return e&&e!=="0%"}function md(e,t,s){const r=e-s,o=t*r;return s+o}function z1(e,t,s,r,o){return o!==void 0&&(e=md(e,o,r)),md(e,s,r)+t}function Bp(e,t=0,s=1,r,o){e.min=z1(e.min,t,s,r,o),e.max=z1(e.max,t,s,r,o)}function Sw(e,{x:t,y:s}){Bp(e.x,t.translate,t.scale,t.originPoint),Bp(e.y,s.translate,s.scale,s.originPoint)}const P1=.999999999999,I1=1.0000000000001;function q6(e,t,s,r=!1){const o=s.length;if(!o)return;t.x=t.y=1;let l,d;for(let f=0;f<o;f++){l=s[f],d=l.projectionDelta;const{visualElement:m}=l.options;m&&m.props.style&&m.props.style.display==="contents"||(r&&l.options.layoutScroll&&l.scroll&&l!==l.root&&(Gs(e.x,-l.scroll.offset.x),Gs(e.y,-l.scroll.offset.y)),d&&(t.x*=d.x.scale,t.y*=d.y.scale,Sw(e,d)),r&&ra(l.latestValues)&&Qu(e,l.latestValues,l.layout?.layoutBox))}t.x<I1&&t.x>P1&&(t.x=1),t.y<I1&&t.y>P1&&(t.y=1)}function Gs(e,t){e.min+=t,e.max+=t}function U1(e,t,s,r,o=.5){const l=Nt(e.min,e.max,o);Bp(e,t,s,l,r)}function H1(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Qu(e,t,s){const r=s??e;U1(e.x,H1(t.x,r.x),t.scaleX,t.scale,t.originX),U1(e.y,H1(t.y,r.y),t.scaleY,t.scale,t.originY)}function ww(e,t){return yw($6(e.getBoundingClientRect(),t))}function K6(e,t,s){const r=ww(e,s),{scroll:o}=t;return o&&(Gs(r.x,o.offset.x),Gs(r.y,o.offset.y)),r}const G6={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},W6=So.length;function Y6(e,t,s){let r="",o=!0;for(let l=0;l<W6;l++){const d=So[l],f=e[d];if(f===void 0)continue;let m=!0;if(typeof f=="number")m=f===(d.startsWith("scale")?1:0);else{const h=parseFloat(f);m=d.startsWith("scale")?h===1:h===0}if(!m||s){const h=dw(f,qg[d]);if(!m){o=!1;const _=G6[d]||d;r+=`${_}(${h}) `}s&&(t[d]=h)}}return r=r.trim(),s?r=s(t,o?"":r):o&&(r="none"),r}function Zg(e,t,s){const{style:r,vars:o,transformOrigin:l}=e;let d=!1,f=!1;for(const m in t){const h=t[m];if(wo.has(m)){d=!0;continue}else if(O2(m)){o[m]=h;continue}else{const _=dw(h,qg[m]);m.startsWith("origin")?(f=!0,l[m]=_):r[m]=_}}if(t.transform||(d||s?r.transform=Y6(t,e.transform,s):r.transform&&(r.transform="none")),f){const{originX:m="50%",originY:h="50%",originZ:_=0}=l;r.transformOrigin=`${m} ${h} ${_}`}}function Ew(e,{style:t,vars:s},r,o){const l=e.style;let d;for(d in t)l[d]=t[d];o?.applyProjectionStyles(l,r);for(d in s)l.setProperty(d,s[d])}function F1(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Cl={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Ne.test(e))e=parseFloat(e);else return e;const s=F1(e,t.target.x),r=F1(e,t.target.y);return`${s}% ${r}%`}},X6={correct:(e,{treeScale:t,projectionDelta:s})=>{const r=e,o=Bs.parse(e);if(o.length>5)return r;const l=Bs.createTransformer(e),d=typeof o[0]!="number"?1:0,f=s.x.scale*t.x,m=s.y.scale*t.y;o[0+d]/=f,o[1+d]/=m;const h=Nt(f,m,.5);return typeof o[2+d]=="number"&&(o[2+d]/=h),typeof o[3+d]=="number"&&(o[3+d]/=h),l(o)}},zp={borderRadius:{...Cl,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Cl,borderTopRightRadius:Cl,borderBottomLeftRadius:Cl,borderBottomRightRadius:Cl,boxShadow:X6};function Cw(e,{layout:t,layoutId:s}){return wo.has(e)||e.startsWith("origin")||(t||s!==void 0)&&(!!zp[e]||e==="opacity")}function Qg(e,t,s){const r=e.style,o=t?.style,l={};if(!r)return l;for(const d in r)(Ei(r[d])||o&&Ei(o[d])||Cw(d,e)||s?.getValue(d)?.liveStyle!==void 0)&&(l[d]=r[d]);return l}function Z6(e){return window.getComputedStyle(e)}class Q6 extends bw{constructor(){super(...arguments),this.type="html",this.renderInstance=Ew}readValueFromInstance(t,s){if(wo.has(s))return this.projection?.isProjecting?wp(s):_M(t,s);{const r=Z6(t),o=(O2(s)?r.getPropertyValue(s):r[s])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:s}){return ww(t,s)}build(t,s,r){Zg(t,s,r.transformTemplate)}scrapeMotionValuesFromProps(t,s,r){return Qg(t,s,r)}}const J6={offset:"stroke-dashoffset",array:"stroke-dasharray"},eA={offset:"strokeDashoffset",array:"strokeDasharray"};function tA(e,t,s=1,r=0,o=!0){e.pathLength=1;const l=o?J6:eA;e[l.offset]=`${-r}`,e[l.array]=`${t} ${s}`}const iA=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Nw(e,{attrX:t,attrY:s,attrScale:r,pathLength:o,pathSpacing:l=1,pathOffset:d=0,...f},m,h,_){if(Zg(e,f,h),m){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:v,style:b}=e;v.transform&&(b.transform=v.transform,delete v.transform),(b.transform||v.transformOrigin)&&(b.transformOrigin=v.transformOrigin??"50% 50%",delete v.transformOrigin),b.transform&&(b.transformBox=_?.transformBox??"fill-box",delete v.transformBox);for(const y of iA)v[y]!==void 0&&(b[y]=v[y],delete v[y]);t!==void 0&&(v.x=t),s!==void 0&&(v.y=s),r!==void 0&&(v.scale=r),o!==void 0&&tA(v,o,l,d,!1)}const kw=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Tw=e=>typeof e=="string"&&e.toLowerCase()==="svg";function sA(e,t,s,r){Ew(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(kw.has(o)?o:$g(o),t.attrs[o])}function Mw(e,t,s){const r=Qg(e,t,s);for(const o in e)if(Ei(e[o])||Ei(t[o])){const l=So.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[l]=e[o]}return r}class nA extends bw{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ai}getBaseTargetFromProps(t,s){return t[s]}readValueFromInstance(t,s){if(wo.has(s)){const r=lw(s);return r&&r.default||0}return s=kw.has(s)?s:$g(s),t.getAttribute(s)}scrapeMotionValuesFromProps(t,s,r){return Mw(t,s,r)}build(t,s,r){Nw(t,s,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,s,r,o){sA(t,s,r,o)}mount(t){this.isSVGTag=Tw(t.tagName),super.mount(t)}}const rA=Xg.length;function Aw(e){if(!e)return;if(!e.isControllingVariants){const s=e.parent?Aw(e.parent)||{}:{};return e.props.initial!==void 0&&(s.initial=e.props.initial),s}const t={};for(let s=0;s<rA;s++){const r=Xg[s],o=e.props[r];(Jl(o)||o===!1)&&(t[r]=o)}return t}function Rw(e,t){if(!Array.isArray(t))return!1;const s=t.length;if(s!==e.length)return!1;for(let r=0;r<s;r++)if(t[r]!==e[r])return!1;return!0}const aA=[...Yg].reverse(),oA=Yg.length;function lA(e){return t=>Promise.all(t.map(({animation:s,options:r})=>n6(e,s,r)))}function cA(e){let t=lA(e),s=V1(),r=!0,o=!1;const l=h=>(_,v)=>{const b=ha(e,v,h==="exit"?e.presenceContext?.custom:void 0);if(b){const{transition:y,transitionEnd:x,...w}=b;_={..._,...w,...x}}return _};function d(h){t=h(e)}function f(h){const{props:_}=e,v=Aw(e.parent)||{},b=[],y=new Set;let x={},w=1/0;for(let A=0;A<oA;A++){const R=aA[A],T=s[R],M=_[R]!==void 0?_[R]:v[R],z=Jl(M),U=R===h?T.isActive:null;U===!1&&(w=A);let j=M===v[R]&&M!==_[R]&&z;if(j&&(r||o)&&e.manuallyAnimateOnMount&&(j=!1),T.protectedKeys={...x},!T.isActive&&U===null||!M&&!T.prevProp||Md(M)||typeof M=="boolean")continue;if(R==="exit"&&T.isActive&&U!==!0){T.prevResolvedValues&&(x={...x,...T.prevResolvedValues});continue}const O=uA(T.prevProp,M);let K=O||R===h&&T.isActive&&!j&&z||A>w&&z,H=!1;const G=Array.isArray(M)?M:[M];let J=G.reduce(l(R),{});U===!1&&(J={});const{prevResolvedValues:I={}}=T,ee={...I,...J},q=V=>{K=!0,y.has(V)&&(H=!0,y.delete(V)),T.needsAnimating[V]=!0;const Z=e.getValue(V);Z&&(Z.liveStyle=!1)};for(const V in ee){const Z=J[V],W=I[V];if(x.hasOwnProperty(V))continue;let D=!1;Mp(Z)&&Mp(W)?D=!Rw(Z,W):D=Z!==W,D?Z!=null?q(V):y.add(V):Z!==void 0&&y.has(V)?q(V):T.protectedKeys[V]=!0}T.prevProp=M,T.prevResolvedValues=J,T.isActive&&(x={...x,...J}),(r||o)&&e.blockInitialAnimation&&(K=!1);const k=j&&O;K&&(!k||H)&&b.push(...G.map(V=>{const Z={type:R};if(typeof V=="string"&&(r||o)&&!k&&e.manuallyAnimateOnMount&&e.parent){const{parent:W}=e,D=ha(W,V);if(W.enteringChildren&&D){const{delayChildren:ie}=D.transition||{};Z.delay=J2(W.enteringChildren,e,ie)}}return{animation:V,options:Z}}))}if(y.size){const A={};if(typeof _.initial!="boolean"){const R=ha(e,Array.isArray(_.initial)?_.initial[0]:_.initial);R&&R.transition&&(A.transition=R.transition)}y.forEach(R=>{const T=e.getBaseTarget(R),M=e.getValue(R);M&&(M.liveStyle=!0),A[R]=T??null}),b.push({animation:A})}let N=!!b.length;return r&&(_.initial===!1||_.initial===_.animate)&&!e.manuallyAnimateOnMount&&(N=!1),r=!1,o=!1,N?t(b):Promise.resolve()}function m(h,_){if(s[h].isActive===_)return Promise.resolve();e.variantChildren?.forEach(b=>b.animationState?.setActive(h,_)),s[h].isActive=_;const v=f(h);for(const b in s)s[b].protectedKeys={};return v}return{animateChanges:f,setActive:m,setAnimateFunction:d,getState:()=>s,reset:()=>{s=V1(),o=!0}}}function uA(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Rw(t,e):!1}function sa(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function V1(){return{animate:sa(!0),whileInView:sa(),whileHover:sa(),whileTap:sa(),whileDrag:sa(),whileFocus:sa(),exit:sa()}}function Pp(e,t){e.min=t.min,e.max=t.max}function Ls(e,t){Pp(e.x,t.x),Pp(e.y,t.y)}function $1(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const Dw=1e-4,dA=1-Dw,hA=1+Dw,Ow=.01,fA=0-Ow,mA=0+Ow;function Li(e){return e.max-e.min}function pA(e,t,s){return Math.abs(e-t)<=s}function q1(e,t,s,r=.5){e.origin=r,e.originPoint=Nt(t.min,t.max,e.origin),e.scale=Li(s)/Li(t),e.translate=Nt(s.min,s.max,e.origin)-e.originPoint,(e.scale>=dA&&e.scale<=hA||isNaN(e.scale))&&(e.scale=1),(e.translate>=fA&&e.translate<=mA||isNaN(e.translate))&&(e.translate=0)}function ql(e,t,s,r){q1(e.x,t.x,s.x,r?r.originX:void 0),q1(e.y,t.y,s.y,r?r.originY:void 0)}function K1(e,t,s,r=0){const o=r?Nt(s.min,s.max,r):s.min;e.min=o+t.min,e.max=e.min+Li(t)}function gA(e,t,s,r){K1(e.x,t.x,s.x,r?.x),K1(e.y,t.y,s.y,r?.y)}function G1(e,t,s,r=0){const o=r?Nt(s.min,s.max,r):s.min;e.min=t.min-o,e.max=e.min+Li(t)}function pd(e,t,s,r){G1(e.x,t.x,s.x,r?.x),G1(e.y,t.y,s.y,r?.y)}function W1(e,t,s,r,o){return e-=t,e=md(e,1/s,r),o!==void 0&&(e=md(e,1/o,r)),e}function _A(e,t=0,s=1,r=.5,o,l=e,d=e){if(Ys.test(t)&&(t=parseFloat(t),t=Nt(d.min,d.max,t/100)-d.min),typeof t!="number")return;let f=Nt(l.min,l.max,r);e===l&&(f-=t),e.min=W1(e.min,t,s,f,o),e.max=W1(e.max,t,s,f,o)}function Y1(e,t,[s,r,o],l,d){_A(e,t[s],t[r],t[o],t.scale,l,d)}const vA=["x","scaleX","originX"],bA=["y","scaleY","originY"];function X1(e,t,s,r){Y1(e.x,t,vA,s?s.x:void 0,r?r.x:void 0),Y1(e.y,t,bA,s?s.y:void 0,r?r.y:void 0)}function Z1(e){return e.translate===0&&e.scale===1}function Lw(e){return Z1(e.x)&&Z1(e.y)}function Q1(e,t){return e.min===t.min&&e.max===t.max}function yA(e,t){return Q1(e.x,t.x)&&Q1(e.y,t.y)}function J1(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function jw(e,t){return J1(e.x,t.x)&&J1(e.y,t.y)}function ey(e){return Li(e.x)/Li(e.y)}function ty(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Ks(e){return[e("x"),e("y")]}function xA(e,t,s){let r="";const o=e.x.translate/t.x,l=e.y.translate/t.y,d=s?.z||0;if((o||l||d)&&(r=`translate3d(${o}px, ${l}px, ${d}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),s){const{transformPerspective:h,rotate:_,rotateX:v,rotateY:b,skewX:y,skewY:x}=s;h&&(r=`perspective(${h}px) ${r}`),_&&(r+=`rotate(${_}deg) `),v&&(r+=`rotateX(${v}deg) `),b&&(r+=`rotateY(${b}deg) `),y&&(r+=`skewX(${y}deg) `),x&&(r+=`skewY(${x}deg) `)}const f=e.x.scale*t.x,m=e.y.scale*t.y;return(f!==1||m!==1)&&(r+=`scale(${f}, ${m})`),r||"none"}const Bw=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],SA=Bw.length,iy=e=>typeof e=="string"?parseFloat(e):e,sy=e=>typeof e=="number"||Ne.test(e);function wA(e,t,s,r,o,l){o?(e.opacity=Nt(0,s.opacity??1,EA(r)),e.opacityExit=Nt(t.opacity??1,0,CA(r))):l&&(e.opacity=Nt(t.opacity??1,s.opacity??1,r));for(let d=0;d<SA;d++){const f=Bw[d];let m=ny(t,f),h=ny(s,f);if(m===void 0&&h===void 0)continue;m||(m=0),h||(h=0),m===0||h===0||sy(m)===sy(h)?(e[f]=Math.max(Nt(iy(m),iy(h),r),0),(Ys.test(h)||Ys.test(m))&&(e[f]+="%")):e[f]=h}(t.rotate||s.rotate)&&(e.rotate=Nt(t.rotate||0,s.rotate||0,r))}function ny(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const EA=zw(0,.5,k2),CA=zw(.5,.95,Cs);function zw(e,t,s){return r=>r<e?0:r>t?1:s(Zl(e,t,r))}function NA(e,t,s){const r=Ei(e)?e:bo(e);return r.start(Fg("",r,t,s)),r.animation}function ec(e,t,s,r={passive:!0}){return e.addEventListener(t,s,r),()=>e.removeEventListener(t,s)}const kA=(e,t)=>e.depth-t.depth;class TA{constructor(){this.children=[],this.isDirty=!1}add(t){Mg(this.children,t),this.isDirty=!0}remove(t){ld(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(kA),this.isDirty=!1,this.children.forEach(t)}}function MA(e,t){const s=Oi.now(),r=({timestamp:o})=>{const l=o-s;l>=t&&(Mr(r),e(l-t))};return yt.setup(r,!0),()=>Mr(r)}function Ju(e){return Ei(e)?e.get():e}class AA{constructor(){this.members=[]}add(t){Mg(this.members,t);for(let s=this.members.length-1;s>=0;s--){const r=this.members[s];if(r===t||r===this.lead||r===this.prevLead)continue;const o=r.instance;(!o||o.isConnected===!1)&&!r.snapshot&&(ld(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(ld(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const s=this.members[this.members.length-1];s&&this.promote(s)}}relegate(t){for(let s=this.members.indexOf(t)-1;s>=0;s--){const r=this.members[s];if(r.isPresent!==!1&&r.instance?.isConnected!==!1)return this.promote(r),!0}return!1}promote(t,s){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.updateSnapshot(),t.scheduleRender();const{layoutDependency:o}=r.options,{layoutDependency:l}=t.options;(o===void 0||o!==l)&&(t.resumeFrom=r,s&&(r.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const ed={hasAnimatedSinceResize:!0,hasEverUpdated:!1},sm=["","X","Y","Z"],RA=1e3;let DA=0;function nm(e,t,s,r){const{latestValues:o}=t;o[e]&&(s[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Pw(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const s=nw(t);if(window.MotionHasOptimisedAnimation(s,"transform")){const{layout:o,layoutId:l}=e.options;window.MotionCancelOptimisedAnimation(s,"transform",yt,!(o||l))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Pw(r)}function Iw({attachResizeListener:e,defaultParent:t,measureScroll:s,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(d={},f=t?.()){this.id=DA++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(jA),this.nodes.forEach(HA),this.nodes.forEach(FA),this.nodes.forEach(BA)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=d,this.root=f?f.root||f:this,this.path=f?[...f.path,f]:[],this.parent=f,this.depth=f?f.depth+1:0;for(let m=0;m<this.path.length;m++)this.path[m].shouldResetTransform=!0;this.root===this&&(this.nodes=new TA)}addEventListener(d,f){return this.eventHandlers.has(d)||this.eventHandlers.set(d,new Rg),this.eventHandlers.get(d).add(f)}notifyListeners(d,...f){const m=this.eventHandlers.get(d);m&&m.notify(...f)}hasListeners(d){return this.eventHandlers.has(d)}mount(d){if(this.instance)return;this.isSVG=Wg(d)&&!L6(d),this.instance=d;const{layoutId:f,layout:m,visualElement:h}=this.options;if(h&&!h.current&&h.mount(d),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(m||f)&&(this.isLayoutDirty=!0),e){let _,v=0;const b=()=>this.root.updateBlockedByResize=!1;yt.read(()=>{v=window.innerWidth}),e(d,()=>{const y=window.innerWidth;y!==v&&(v=y,this.root.updateBlockedByResize=!0,_&&_(),_=MA(b,250),ed.hasAnimatedSinceResize&&(ed.hasAnimatedSinceResize=!1,this.nodes.forEach(oy)))})}f&&this.root.registerSharedNode(f,this),this.options.animate!==!1&&h&&(f||m)&&this.addEventListener("didUpdate",({delta:_,hasLayoutChanged:v,hasRelativeLayoutChanged:b,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||h.getDefaultTransition()||GA,{onLayoutAnimationStart:w,onLayoutAnimationComplete:N}=h.getProps(),A=!this.targetLayout||!jw(this.targetLayout,y),R=!v&&b;if(this.options.layoutRoot||this.resumeFrom||R||v&&(A||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const T={...Hg(x,"layout"),onPlay:w,onComplete:N};(h.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T),this.setAnimationOrigin(_,R)}else v||oy(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const d=this.getStack();d&&d.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Mr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(VA),this.animationId++)}getTransformTemplate(){const{visualElement:d}=this.options;return d&&d.getProps().transformTemplate}willUpdate(d=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Pw(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let _=0;_<this.path.length;_++){const v=this.path[_];v.shouldResetTransform=!0,(typeof v.latestValues.x=="string"||typeof v.latestValues.y=="string")&&(v.isLayoutDirty=!0),v.updateScroll("snapshot"),v.options.layoutRoot&&v.willUpdate(!1)}const{layoutId:f,layout:m}=this.options;if(f===void 0&&!m)return;const h=this.getTransformTemplate();this.prevTransformTemplateValue=h?h(this.latestValues,""):void 0,this.updateSnapshot(),d&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const m=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),m&&this.nodes.forEach(PA),this.nodes.forEach(ry);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(ay);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(IA),this.nodes.forEach(UA),this.nodes.forEach(OA),this.nodes.forEach(LA)):this.nodes.forEach(ay),this.clearAllSnapshots();const f=Oi.now();Si.delta=Qs(0,1e3/60,f-Si.timestamp),Si.timestamp=f,Si.isProcessing=!0,Yf.update.process(Si),Yf.preRender.process(Si),Yf.render.process(Si),Si.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Kg.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(zA),this.sharedNodes.forEach($A)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,yt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){yt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Li(this.snapshot.measuredBox.x)&&!Li(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let m=0;m<this.path.length;m++)this.path[m].updateScroll();const d=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=ai()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:f}=this.options;f&&f.notify("LayoutMeasure",this.layout.layoutBox,d?d.layoutBox:void 0)}updateScroll(d="measure"){let f=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===d&&(f=!1),f&&this.instance){const m=r(this.instance);this.scroll={animationId:this.root.animationId,phase:d,isRoot:m,offset:s(this.instance),wasRoot:this.scroll?this.scroll.isRoot:m}}}resetTransform(){if(!o)return;const d=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,f=this.projectionDelta&&!Lw(this.projectionDelta),m=this.getTransformTemplate(),h=m?m(this.latestValues,""):void 0,_=h!==this.prevTransformTemplateValue;d&&this.instance&&(f||ra(this.latestValues)||_)&&(o(this.instance,h),this.shouldResetTransform=!1,this.scheduleRender())}measure(d=!0){const f=this.measurePageBox();let m=this.removeElementScroll(f);return d&&(m=this.removeTransform(m)),WA(m),{animationId:this.root.animationId,measuredBox:f,layoutBox:m,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:d}=this.options;if(!d)return ai();const f=d.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(YA))){const{scroll:h}=this.root;h&&(Gs(f.x,h.offset.x),Gs(f.y,h.offset.y))}return f}removeElementScroll(d){const f=ai();if(Ls(f,d),this.scroll?.wasRoot)return f;for(let m=0;m<this.path.length;m++){const h=this.path[m],{scroll:_,options:v}=h;h!==this.root&&_&&v.layoutScroll&&(_.wasRoot&&Ls(f,d),Gs(f.x,_.offset.x),Gs(f.y,_.offset.y))}return f}applyTransform(d,f=!1,m){const h=m||ai();Ls(h,d);for(let _=0;_<this.path.length;_++){const v=this.path[_];!f&&v.options.layoutScroll&&v.scroll&&v!==v.root&&(Gs(h.x,-v.scroll.offset.x),Gs(h.y,-v.scroll.offset.y)),ra(v.latestValues)&&Qu(h,v.latestValues,v.layout?.layoutBox)}return ra(this.latestValues)&&Qu(h,this.latestValues,this.layout?.layoutBox),h}removeTransform(d){const f=ai();Ls(f,d);for(let m=0;m<this.path.length;m++){const h=this.path[m];if(!ra(h.latestValues))continue;let _;h.instance&&(jp(h.latestValues)&&h.updateSnapshot(),_=ai(),Ls(_,h.measurePageBox())),X1(f,h.latestValues,h.snapshot?.layoutBox,_)}return ra(this.latestValues)&&X1(f,this.latestValues),f}setTargetDelta(d){this.targetDelta=d,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(d){this.options={...this.options,...d,crossfade:d.crossfade!==void 0?d.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Si.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(d=!1){const f=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=f.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=f.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=f.isSharedProjectionDirty);const m=!!this.resumingFrom||this!==f;if(!(d||m&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:_,layoutId:v}=this.options;if(!this.layout||!(_||v))return;this.resolvedRelativeTargetAt=Si.timestamp;const b=this.getClosestProjectingParent();b&&this.linkedParentVersion!==b.layoutVersion&&!b.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&b&&b.layout?this.createRelativeTarget(b,this.layout.layoutBox,b.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=ai(),this.targetWithTransforms=ai()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),gA(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Ls(this.target,this.layout.layoutBox),Sw(this.target,this.targetDelta)):Ls(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&b&&!!b.resumingFrom==!!this.resumingFrom&&!b.options.layoutScroll&&b.target&&this.animationProgress!==1?this.createRelativeTarget(b,this.target,b.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||jp(this.parent.latestValues)||xw(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(d,f,m){this.relativeParent=d,this.linkedParentVersion=d.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ai(),this.relativeTargetOrigin=ai(),pd(this.relativeTargetOrigin,f,m,this.options.layoutAnchor||void 0),Ls(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const d=this.getLead(),f=!!this.resumingFrom||this!==d;let m=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(m=!1),f&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(m=!1),this.resolvedRelativeTargetAt===Si.timestamp&&(m=!1),m)return;const{layout:h,layoutId:_}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(h||_))return;Ls(this.layoutCorrected,this.layout.layoutBox);const v=this.treeScale.x,b=this.treeScale.y;q6(this.layoutCorrected,this.treeScale,this.path,f),d.layout&&!d.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(d.target=d.layout.layoutBox,d.targetWithTransforms=ai());const{target:y}=d;if(!y){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():($1(this.prevProjectionDelta.x,this.projectionDelta.x),$1(this.prevProjectionDelta.y,this.projectionDelta.y)),ql(this.projectionDelta,this.layoutCorrected,y,this.latestValues),(this.treeScale.x!==v||this.treeScale.y!==b||!ty(this.projectionDelta.x,this.prevProjectionDelta.x)||!ty(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",y))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(d=!0){if(this.options.visualElement?.scheduleRender(),d){const f=this.getStack();f&&f.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=mo(),this.projectionDelta=mo(),this.projectionDeltaWithTransform=mo()}setAnimationOrigin(d,f=!1){const m=this.snapshot,h=m?m.latestValues:{},_={...this.latestValues},v=mo();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!f;const b=ai(),y=m?m.source:void 0,x=this.layout?this.layout.source:void 0,w=y!==x,N=this.getStack(),A=!N||N.members.length<=1,R=!!(w&&!A&&this.options.crossfade===!0&&!this.path.some(KA));this.animationProgress=0;let T;this.mixTargetDelta=M=>{const z=M/1e3;ly(v.x,d.x,z),ly(v.y,d.y,z),this.setTargetDelta(v),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(pd(b,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),qA(this.relativeTarget,this.relativeTargetOrigin,b,z),T&&yA(this.relativeTarget,T)&&(this.isProjectionDirty=!1),T||(T=ai()),Ls(T,this.relativeTarget)),w&&(this.animationValues=_,wA(_,h,this.latestValues,z,R,A)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=z},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(d){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Mr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=yt.update(()=>{ed.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=bo(0)),this.motionValue.jump(0,!1),this.currentAnimation=NA(this.motionValue,[0,1e3],{...d,velocity:0,isSync:!0,onUpdate:f=>{this.mixTargetDelta(f),d.onUpdate&&d.onUpdate(f)},onStop:()=>{},onComplete:()=>{d.onComplete&&d.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const d=this.getStack();d&&d.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(RA),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const d=this.getLead();let{targetWithTransforms:f,target:m,layout:h,latestValues:_}=d;if(!(!f||!m||!h)){if(this!==d&&this.layout&&h&&Uw(this.options.animationType,this.layout.layoutBox,h.layoutBox)){m=this.target||ai();const v=Li(this.layout.layoutBox.x);m.x.min=d.target.x.min,m.x.max=m.x.min+v;const b=Li(this.layout.layoutBox.y);m.y.min=d.target.y.min,m.y.max=m.y.min+b}Ls(f,m),Qu(f,_),ql(this.projectionDeltaWithTransform,this.layoutCorrected,f,_)}}registerSharedNode(d,f){this.sharedNodes.has(d)||this.sharedNodes.set(d,new AA),this.sharedNodes.get(d).add(f);const h=f.options.initialPromotionConfig;f.promote({transition:h?h.transition:void 0,preserveFollowOpacity:h&&h.shouldPreserveFollowOpacity?h.shouldPreserveFollowOpacity(f):void 0})}isLead(){const d=this.getStack();return d?d.lead===this:!0}getLead(){const{layoutId:d}=this.options;return d?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:d}=this.options;return d?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:d}=this.options;if(d)return this.root.sharedNodes.get(d)}promote({needsReset:d,transition:f,preserveFollowOpacity:m}={}){const h=this.getStack();h&&h.promote(this,m),d&&(this.projectionDelta=void 0,this.needsReset=!0),f&&this.setOptions({transition:f})}relegate(){const d=this.getStack();return d?d.relegate(this):!1}resetSkewAndRotation(){const{visualElement:d}=this.options;if(!d)return;let f=!1;const{latestValues:m}=d;if((m.z||m.rotate||m.rotateX||m.rotateY||m.rotateZ||m.skewX||m.skewY)&&(f=!0),!f)return;const h={};m.z&&nm("z",d,h,this.animationValues);for(let _=0;_<sm.length;_++)nm(`rotate${sm[_]}`,d,h,this.animationValues),nm(`skew${sm[_]}`,d,h,this.animationValues);d.render();for(const _ in h)d.setStaticValue(_,h[_]),this.animationValues&&(this.animationValues[_]=h[_]);d.scheduleRender()}applyProjectionStyles(d,f){if(!this.instance||this.isSVG)return;if(!this.isVisible){d.visibility="hidden";return}const m=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,d.visibility="",d.opacity="",d.pointerEvents=Ju(f?.pointerEvents)||"",d.transform=m?m(this.latestValues,""):"none";return}const h=this.getLead();if(!this.projectionDelta||!this.layout||!h.target){this.options.layoutId&&(d.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,d.pointerEvents=Ju(f?.pointerEvents)||""),this.hasProjected&&!ra(this.latestValues)&&(d.transform=m?m({},""):"none",this.hasProjected=!1);return}d.visibility="";const _=h.animationValues||h.latestValues;this.applyTransformsToTarget();let v=xA(this.projectionDeltaWithTransform,this.treeScale,_);m&&(v=m(_,v)),d.transform=v;const{x:b,y}=this.projectionDelta;d.transformOrigin=`${b.origin*100}% ${y.origin*100}% 0`,h.animationValues?d.opacity=h===this?_.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:_.opacityExit:d.opacity=h===this?_.opacity!==void 0?_.opacity:"":_.opacityExit!==void 0?_.opacityExit:0;for(const x in zp){if(_[x]===void 0)continue;const{correct:w,applyTo:N,isCSSVariable:A}=zp[x],R=v==="none"?_[x]:w(_[x],h);if(N){const T=N.length;for(let M=0;M<T;M++)d[N[M]]=R}else A?this.options.visualElement.renderState.vars[x]=R:d[x]=R}this.options.layoutId&&(d.pointerEvents=h===this?Ju(f?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(d=>d.currentAnimation?.stop()),this.root.nodes.forEach(ry),this.root.sharedNodes.clear()}}}function OA(e){e.updateLayout()}function LA(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:r}=e.layout,{animationType:o}=e.options,l=t.source!==e.layout.source;if(o==="size")Ks(_=>{const v=l?t.measuredBox[_]:t.layoutBox[_],b=Li(v);v.min=s[_].min,v.max=v.min+b});else if(o==="x"||o==="y"){const _=o==="x"?"y":"x";Pp(l?t.measuredBox[_]:t.layoutBox[_],s[_])}else Uw(o,t.layoutBox,s)&&Ks(_=>{const v=l?t.measuredBox[_]:t.layoutBox[_],b=Li(s[_]);v.max=v.min+b,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[_].max=e.relativeTarget[_].min+b)});const d=mo();ql(d,s,t.layoutBox);const f=mo();l?ql(f,e.applyTransform(r,!0),t.measuredBox):ql(f,s,t.layoutBox);const m=!Lw(d);let h=!1;if(!e.resumeFrom){const _=e.getClosestProjectingParent();if(_&&!_.resumeFrom){const{snapshot:v,layout:b}=_;if(v&&b){const y=e.options.layoutAnchor||void 0,x=ai();pd(x,t.layoutBox,v.layoutBox,y);const w=ai();pd(w,s,b.layoutBox,y),jw(x,w)||(h=!0),_.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=x,e.relativeParent=_)}}}e.notifyListeners("didUpdate",{layout:s,snapshot:t,delta:f,layoutDelta:d,hasLayoutChanged:m,hasRelativeLayoutChanged:h})}else if(e.isLead()){const{onExitComplete:s}=e.options;s&&s()}e.options.transition=void 0}function jA(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function BA(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function zA(e){e.clearSnapshot()}function ry(e){e.clearMeasurements()}function PA(e){e.isLayoutDirty=!0,e.updateLayout()}function ay(e){e.isLayoutDirty=!1}function IA(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function UA(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function oy(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function HA(e){e.resolveTargetDelta()}function FA(e){e.calcProjection()}function VA(e){e.resetSkewAndRotation()}function $A(e){e.removeLeadSnapshot()}function ly(e,t,s){e.translate=Nt(t.translate,0,s),e.scale=Nt(t.scale,1,s),e.origin=t.origin,e.originPoint=t.originPoint}function cy(e,t,s,r){e.min=Nt(t.min,s.min,r),e.max=Nt(t.max,s.max,r)}function qA(e,t,s,r){cy(e.x,t.x,s.x,r),cy(e.y,t.y,s.y,r)}function KA(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const GA={duration:.45,ease:[.4,0,.1,1]},uy=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),dy=uy("applewebkit/")&&!uy("chrome/")?Math.round:Cs;function hy(e){e.min=dy(e.min),e.max=dy(e.max)}function WA(e){hy(e.x),hy(e.y)}function Uw(e,t,s){return e==="position"||e==="preserve-aspect"&&!pA(ey(t),ey(s),.2)}function YA(e){return e!==e.root&&e.scroll?.wasRoot}const XA=Iw({attachResizeListener:(e,t)=>ec(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),rm={current:void 0},Hw=Iw({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!rm.current){const e=new XA({});e.mount(window),e.setOptions({layoutScroll:!0}),rm.current=e}return rm.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Fw=E.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function ZA(e=!0){const t=E.useContext(Tg);if(t===null)return[!0,null];const{isPresent:s,onExitComplete:r,register:o}=t,l=E.useId();E.useEffect(()=>{if(e)return o(l)},[e]);const d=E.useCallback(()=>e&&r&&r(l),[l,r,e]);return!s&&r?[!1,d]:[!0]}const Vw=E.createContext({strict:!1}),fy={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let my=!1;function QA(){if(my)return;const e={};for(const t in fy)e[t]={isEnabled:s=>fy[t].some(r=>!!s[r])};vw(e),my=!0}function $w(){return QA(),H6()}function JA(e){const t=$w();for(const s in e)t[s]={...t[s],...e[s]};vw(t)}const eR=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function gd(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||eR.has(e)}let qw=e=>!gd(e);function tR(e){typeof e=="function"&&(qw=t=>t.startsWith("on")?!gd(t):e(t))}try{tR(require("@emotion/is-prop-valid").default)}catch{}function iR(e,t,s){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||Ei(e[o])||(qw(o)||s===!0&&gd(o)||!t&&!gd(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}const Rd=E.createContext({});function sR(e,t){if(Ad(e)){const{initial:s,animate:r}=e;return{initial:s===!1||Jl(s)?s:void 0,animate:Jl(r)?r:void 0}}return e.inherit!==!1?t:{}}function nR(e){const{initial:t,animate:s}=sR(e,E.useContext(Rd));return E.useMemo(()=>({initial:t,animate:s}),[py(t),py(s)])}function py(e){return Array.isArray(e)?e.join(" "):e}const Jg=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Kw(e,t,s){for(const r in t)!Ei(t[r])&&!Cw(r,s)&&(e[r]=t[r])}function rR({transformTemplate:e},t){return E.useMemo(()=>{const s=Jg();return Zg(s,t,e),Object.assign({},s.vars,s.style)},[t])}function aR(e,t){const s=e.style||{},r={};return Kw(r,s,e),Object.assign(r,rR(e,t)),r}function oR(e,t){const s={},r=aR(e,t);return e.drag&&e.dragListener!==!1&&(s.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(s.tabIndex=0),s.style=r,s}const Gw=()=>({...Jg(),attrs:{}});function lR(e,t,s,r){const o=E.useMemo(()=>{const l=Gw();return Nw(l,t,Tw(r),e.transformTemplate,e.style),{...l.attrs,style:{...l.style}}},[t]);if(e.style){const l={};Kw(l,e.style,e),o.style={...l,...o.style}}return o}const cR=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function e0(e){return typeof e!="string"||e.includes("-")?!1:!!(cR.indexOf(e)>-1||/[A-Z]/u.test(e))}function uR(e,t,s,{latestValues:r},o,l=!1,d){const m=(d??e0(e)?lR:oR)(t,r,o,e),h=iR(t,typeof e=="string",l),_=e!==E.Fragment?{...h,...m,ref:s}:{},{children:v}=t,b=E.useMemo(()=>Ei(v)?v.get():v,[v]);return E.createElement(e,{..._,children:b})}function dR({scrapeMotionValuesFromProps:e,createRenderState:t},s,r,o){return{latestValues:hR(s,r,o,e),renderState:t()}}function hR(e,t,s,r){const o={},l=r(e,{});for(const b in l)o[b]=Ju(l[b]);let{initial:d,animate:f}=e;const m=Ad(e),h=gw(e);t&&h&&!m&&e.inherit!==!1&&(d===void 0&&(d=t.initial),f===void 0&&(f=t.animate));let _=s?s.initial===!1:!1;_=_||d===!1;const v=_?f:d;if(v&&typeof v!="boolean"&&!Md(v)){const b=Array.isArray(v)?v:[v];for(let y=0;y<b.length;y++){const x=Vg(e,b[y]);if(x){const{transitionEnd:w,transition:N,...A}=x;for(const R in A){let T=A[R];if(Array.isArray(T)){const M=_?T.length-1:0;T=T[M]}T!==null&&(o[R]=T)}for(const R in w)o[R]=w[R]}}}return o}const Ww=e=>(t,s)=>{const r=E.useContext(Rd),o=E.useContext(Tg),l=()=>dR(e,t,r,o);return s?l():c4(l)},fR=Ww({scrapeMotionValuesFromProps:Qg,createRenderState:Jg}),mR=Ww({scrapeMotionValuesFromProps:Mw,createRenderState:Gw}),pR=Symbol.for("motionComponentSymbol");function gR(e,t,s){const r=E.useRef(s);E.useInsertionEffect(()=>{r.current=s});const o=E.useRef(null);return E.useCallback(l=>{l&&e.onMount?.(l);const d=r.current;if(typeof d=="function")if(l){const f=d(l);typeof f=="function"&&(o.current=f)}else o.current?(o.current(),o.current=null):d(l);else d&&(d.current=l);t&&(l?t.mount(l):t.unmount())},[t])}const Yw=E.createContext({});function uo(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function _R(e,t,s,r,o,l){const{visualElement:d}=E.useContext(Rd),f=E.useContext(Vw),m=E.useContext(Tg),h=E.useContext(Fw),_=h.reducedMotion,v=h.skipAnimations,b=E.useRef(null),y=E.useRef(!1);r=r||f.renderer,!b.current&&r&&(b.current=r(e,{visualState:t,parent:d,props:s,presenceContext:m,blockInitialAnimation:m?m.initial===!1:!1,reducedMotionConfig:_,skipAnimations:v,isSVG:l}),y.current&&b.current&&(b.current.manuallyAnimateOnMount=!0));const x=b.current,w=E.useContext(Yw);x&&!x.projection&&o&&(x.type==="html"||x.type==="svg")&&vR(b.current,s,o,w);const N=E.useRef(!1);E.useInsertionEffect(()=>{x&&N.current&&x.update(s,m)});const A=s[sw],R=E.useRef(!!A&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(A)&&window.MotionHasOptimisedAnimation?.(A));return d4(()=>{y.current=!0,x&&(N.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),x.scheduleRenderMicrotask(),R.current&&x.animationState&&x.animationState.animateChanges())}),E.useEffect(()=>{x&&(!R.current&&x.animationState&&x.animationState.animateChanges(),R.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(A)}),R.current=!1),x.enteringChildren=void 0)}),x}function vR(e,t,s,r){const{layoutId:o,layout:l,drag:d,dragConstraints:f,layoutScroll:m,layoutRoot:h,layoutAnchor:_,layoutCrossfade:v}=t;e.projection=new s(e.latestValues,t["data-framer-portal-id"]?void 0:Xw(e.parent)),e.projection.setOptions({layoutId:o,layout:l,alwaysMeasureLayout:!!d||f&&uo(f),visualElement:e,animationType:typeof l=="string"?l:"both",initialPromotionConfig:r,crossfade:v,layoutScroll:m,layoutRoot:h,layoutAnchor:_})}function Xw(e){if(e)return e.options.allowProjection!==!1?e.projection:Xw(e.parent)}function am(e,{forwardMotionProps:t=!1,type:s}={},r,o){r&&JA(r);const l=s?s==="svg":e0(e),d=l?mR:fR;function f(h,_){let v;const b={...E.useContext(Fw),...h,layoutId:bR(h)},{isStatic:y}=b,x=nR(h),w=d(h,y);if(!y&&typeof window<"u"){yR();const N=xR(b);v=N.MeasureLayout,x.visualElement=_R(e,w,b,o,N.ProjectionNode,l)}return u.jsxs(Rd.Provider,{value:x,children:[v&&x.visualElement?u.jsx(v,{visualElement:x.visualElement,...b}):null,uR(e,h,gR(w,x.visualElement,_),w,y,t,l)]})}f.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const m=E.forwardRef(f);return m[pR]=e,m}function bR({layoutId:e}){const t=E.useContext(p2).id;return t&&e!==void 0?t+"-"+e:e}function yR(e,t){E.useContext(Vw).strict}function xR(e){const t=$w(),{drag:s,layout:r}=t;if(!s&&!r)return{};const o={...s,...r};return{MeasureLayout:s?.isEnabled(e)||r?.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function SR(e,t){if(typeof Proxy>"u")return am;const s=new Map,r=(l,d)=>am(l,d,e,t),o=(l,d)=>r(l,d);return new Proxy(o,{get:(l,d)=>d==="create"?r:(s.has(d)||s.set(d,am(d,void 0,e,t)),s.get(d))})}const wR=(e,t)=>t.isSVG??e0(e)?new nA(t):new Q6(t,{allowProjection:e!==E.Fragment});class ER extends Dr{constructor(t){super(t),t.animationState||(t.animationState=cA(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Md(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:s}=this.node.prevProps||{};t!==s&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let CR=0;class NR extends Dr{constructor(){super(...arguments),this.id=CR++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:s}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;if(t&&r===!1){if(this.isExitComplete){const{initial:l,custom:d}=this.node.getProps();if(typeof l=="string"){const f=ha(this.node,l,d);if(f){const{transition:m,transitionEnd:h,..._}=f;for(const v in _)this.node.getValue(v)?.jump(_[v])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const o=this.node.animationState.setActive("exit",!t);s&&!t&&o.then(()=>{this.isExitComplete=!0,s(this.id)})}mount(){const{register:t,onExitComplete:s}=this.node.presenceContext||{};s&&s(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const kR={animation:{Feature:ER},exit:{Feature:NR}};function fc(e){return{point:{x:e.pageX,y:e.pageY}}}const TR=e=>t=>Gg(t)&&e(t,fc(t));function Kl(e,t,s,r){return ec(e,t,TR(s),r)}const Zw=({current:e})=>e?e.ownerDocument.defaultView:null,gy=(e,t)=>Math.abs(e-t);function MR(e,t){const s=gy(e.x,t.x),r=gy(e.y,t.y);return Math.sqrt(s**2+r**2)}const _y=new Set(["auto","scroll"]);class Qw{constructor(t,s,{transformPagePoint:r,contextWindow:o=window,dragSnapToOrigin:l=!1,distanceThreshold:d=3,element:f}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=y=>{this.handleScroll(y.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=zu(this.lastRawMoveEventInfo,this.transformPagePoint));const y=om(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,w=MR(y.offset,{x:0,y:0})>=this.distanceThreshold;if(!x&&!w)return;const{point:N}=y,{timestamp:A}=Si;this.history.push({...N,timestamp:A});const{onStart:R,onMove:T}=this.handlers;x||(R&&R(this.lastMoveEvent,y),this.startEvent=this.lastMoveEvent),T&&T(this.lastMoveEvent,y)},this.handlePointerMove=(y,x)=>{this.lastMoveEvent=y,this.lastRawMoveEventInfo=x,this.lastMoveEventInfo=zu(x,this.transformPagePoint),yt.update(this.updatePoint,!0)},this.handlePointerUp=(y,x)=>{this.end();const{onEnd:w,onSessionEnd:N,resumeAnimation:A}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&A&&A(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const R=om(y.type==="pointercancel"?this.lastMoveEventInfo:zu(x,this.transformPagePoint),this.history);this.startEvent&&w&&w(y,R),N&&N(y,R)},!Gg(t))return;this.dragSnapToOrigin=l,this.handlers=s,this.transformPagePoint=r,this.distanceThreshold=d,this.contextWindow=o||window;const m=fc(t),h=zu(m,this.transformPagePoint),{point:_}=h,{timestamp:v}=Si;this.history=[{..._,timestamp:v}];const{onSessionStart:b}=s;b&&b(t,om(h,this.history)),this.removeListeners=uc(Kl(this.contextWindow,"pointermove",this.handlePointerMove),Kl(this.contextWindow,"pointerup",this.handlePointerUp),Kl(this.contextWindow,"pointercancel",this.handlePointerUp)),f&&this.startScrollTracking(f)}startScrollTracking(t){let s=t.parentElement;for(;s;){const r=getComputedStyle(s);(_y.has(r.overflowX)||_y.has(r.overflowY))&&this.scrollPositions.set(s,{x:s.scrollLeft,y:s.scrollTop}),s=s.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const s=this.scrollPositions.get(t);if(!s)return;const r=t===window,o=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},l={x:o.x-s.x,y:o.y-s.y};l.x===0&&l.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=l.x,this.lastMoveEventInfo.point.y+=l.y):this.history.length>0&&(this.history[0].x-=l.x,this.history[0].y-=l.y),this.scrollPositions.set(t,o),yt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Mr(this.updatePoint)}}function zu(e,t){return t?{point:t(e.point)}:e}function vy(e,t){return{x:e.x-t.x,y:e.y-t.y}}function om({point:e},t){return{point:e,delta:vy(e,Jw(t)),offset:vy(e,AR(t)),velocity:RR(t,.1)}}function AR(e){return e[0]}function Jw(e){return e[e.length-1]}function RR(e,t){if(e.length<2)return{x:0,y:0};let s=e.length-1,r=null;const o=Jw(e);for(;s>=0&&(r=e[s],!(o.timestamp-r.timestamp>os(t)));)s--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&o.timestamp-r.timestamp>os(t)*2&&(r=e[1]);const l=ws(o.timestamp-r.timestamp);if(l===0)return{x:0,y:0};const d={x:(o.x-r.x)/l,y:(o.y-r.y)/l};return d.x===1/0&&(d.x=0),d.y===1/0&&(d.y=0),d}function DR(e,{min:t,max:s},r){return t!==void 0&&e<t?e=r?Nt(t,e,r.min):Math.max(e,t):s!==void 0&&e>s&&(e=r?Nt(s,e,r.max):Math.min(e,s)),e}function by(e,t,s){return{min:t!==void 0?e.min+t:void 0,max:s!==void 0?e.max+s-(e.max-e.min):void 0}}function OR(e,{top:t,left:s,bottom:r,right:o}){return{x:by(e.x,s,o),y:by(e.y,t,r)}}function yy(e,t){let s=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([s,r]=[r,s]),{min:s,max:r}}function LR(e,t){return{x:yy(e.x,t.x),y:yy(e.y,t.y)}}function jR(e,t){let s=.5;const r=Li(e),o=Li(t);return o>r?s=Zl(t.min,t.max-r,e.min):r>o&&(s=Zl(e.min,e.max-o,t.min)),Qs(0,1,s)}function BR(e,t){const s={};return t.min!==void 0&&(s.min=t.min-e.min),t.max!==void 0&&(s.max=t.max-e.min),s}const Ip=.35;function zR(e=Ip){return e===!1?e=0:e===!0&&(e=Ip),{x:xy(e,"left","right"),y:xy(e,"top","bottom")}}function xy(e,t,s){return{min:Sy(e,t),max:Sy(e,s)}}function Sy(e,t){return typeof e=="number"?e:e[t]||0}const PR=new WeakMap;class IR{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ai(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:s=!1,distanceThreshold:r}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const l=v=>{s&&this.snapToCursor(fc(v).point),this.stopAnimation()},d=(v,b)=>{const{drag:y,dragPropagation:x,onDragStart:w}=this.getProps();if(y&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=_6(y),!this.openDragLock))return;this.latestPointerEvent=v,this.latestPanInfo=b,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ks(A=>{let R=this.getAxisMotionValue(A).get()||0;if(Ys.test(R)){const{projection:T}=this.visualElement;if(T&&T.layout){const M=T.layout.layoutBox[A];M&&(R=Li(M)*(parseFloat(R)/100))}}this.originPoint[A]=R}),w&&yt.update(()=>w(v,b),!1,!0),Ap(this.visualElement,"transform");const{animationState:N}=this.visualElement;N&&N.setActive("whileDrag",!0)},f=(v,b)=>{this.latestPointerEvent=v,this.latestPanInfo=b;const{dragPropagation:y,dragDirectionLock:x,onDirectionLock:w,onDrag:N}=this.getProps();if(!y&&!this.openDragLock)return;const{offset:A}=b;if(x&&this.currentDirection===null){this.currentDirection=HR(A),this.currentDirection!==null&&w&&w(this.currentDirection);return}this.updateAxis("x",b.point,A),this.updateAxis("y",b.point,A),this.visualElement.render(),N&&yt.update(()=>N(v,b),!1,!0)},m=(v,b)=>{this.latestPointerEvent=v,this.latestPanInfo=b,this.stop(v,b),this.latestPointerEvent=null,this.latestPanInfo=null},h=()=>{const{dragSnapToOrigin:v}=this.getProps();(v||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:_}=this.getProps();this.panSession=new Qw(t,{onSessionStart:l,onStart:d,onMove:f,onSessionEnd:m,resumeAnimation:h},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:_,distanceThreshold:r,contextWindow:Zw(this.visualElement),element:this.visualElement.current})}stop(t,s){const r=t||this.latestPointerEvent,o=s||this.latestPanInfo,l=this.isDragging;if(this.cancel(),!l||!o||!r)return;const{velocity:d}=o;this.startAnimation(d);const{onDragEnd:f}=this.getProps();f&&yt.postRender(()=>f(r,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:s}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),s&&s.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,s,r){const{drag:o}=this.getProps();if(!r||!Pu(t,o,this.currentDirection))return;const l=this.getAxisMotionValue(t);let d=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(d=DR(d,this.constraints[t],this.elastic[t])),l.set(d)}resolveConstraints(){const{dragConstraints:t,dragElastic:s}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,o=this.constraints;t&&uo(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=OR(r.layoutBox,t):this.constraints=!1,this.elastic=zR(s),o!==this.constraints&&!uo(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&Ks(l=>{this.constraints!==!1&&this.getAxisMotionValue(l)&&(this.constraints[l]=BR(r.layoutBox[l],this.constraints[l]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:s}=this.getProps();if(!t||!uo(t))return!1;const r=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const l=K6(r,o.root,this.visualElement.getTransformPagePoint());let d=LR(o.layout.layoutBox,l);if(s){const f=s(V6(d));this.hasMutatedConstraints=!!f,f&&(d=yw(f))}return d}startAnimation(t){const{drag:s,dragMomentum:r,dragElastic:o,dragTransition:l,dragSnapToOrigin:d,onDragTransitionEnd:f}=this.getProps(),m=this.constraints||{},h=Ks(_=>{if(!Pu(_,s,this.currentDirection))return;let v=m&&m[_]||{};(d===!0||d===_)&&(v={min:0,max:0});const b=o?200:1e6,y=o?40:1e7,x={type:"inertia",velocity:r?t[_]:0,bounceStiffness:b,bounceDamping:y,timeConstant:750,restDelta:1,restSpeed:10,...l,...v};return this.startAxisValueAnimation(_,x)});return Promise.all(h).then(f)}startAxisValueAnimation(t,s){const r=this.getAxisMotionValue(t);return Ap(this.visualElement,t),r.start(Fg(t,r,0,s,this.visualElement,!1))}stopAnimation(){Ks(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const s=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[s];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Ks(s=>{const{drag:r}=this.getProps();if(!Pu(s,r,this.currentDirection))return;const{projection:o}=this.visualElement,l=this.getAxisMotionValue(s);if(o&&o.layout){const{min:d,max:f}=o.layout.layoutBox[s],m=l.get()||0;l.set(t[s]-Nt(d,f,.5)+m)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:s}=this.getProps(),{projection:r}=this.visualElement;if(!uo(s)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Ks(d=>{const f=this.getAxisMotionValue(d);if(f&&this.constraints!==!1){const m=f.get();o[d]=jR({min:m,max:m},this.constraints[d])}});const{transformTemplate:l}=this.visualElement.getProps();this.visualElement.current.style.transform=l?l({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),Ks(d=>{if(!Pu(d,t,null))return;const f=this.getAxisMotionValue(d),{min:m,max:h}=this.constraints[d];f.set(Nt(m,h,o[d]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;PR.set(this.visualElement,this);const t=this.visualElement.current,s=Kl(t,"pointerdown",h=>{const{drag:_,dragListener:v=!0}=this.getProps(),b=h.target,y=b!==t&&w6(b);_&&v&&!y&&this.start(h)});let r;const o=()=>{const{dragConstraints:h}=this.getProps();uo(h)&&h.current&&(this.constraints=this.resolveRefConstraints(),r||(r=UR(t,h.current,()=>this.scalePositionWithinConstraints())))},{projection:l}=this.visualElement,d=l.addEventListener("measure",o);l&&!l.layout&&(l.root&&l.root.updateScroll(),l.updateLayout()),yt.read(o);const f=ec(window,"resize",()=>this.scalePositionWithinConstraints()),m=l.addEventListener("didUpdate",(({delta:h,hasLayoutChanged:_})=>{this.isDragging&&_&&(Ks(v=>{const b=this.getAxisMotionValue(v);b&&(this.originPoint[v]+=h[v].translate,b.set(b.get()+h[v].translate))}),this.visualElement.render())}));return()=>{f(),s(),d(),m&&m(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:s=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:l=!1,dragElastic:d=Ip,dragMomentum:f=!0}=t;return{...t,drag:s,dragDirectionLock:r,dragPropagation:o,dragConstraints:l,dragElastic:d,dragMomentum:f}}}function wy(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function UR(e,t,s){const r=D1(e,wy(s)),o=D1(t,wy(s));return()=>{r(),o()}}function Pu(e,t,s){return(t===!0||t===e)&&(s===null||s===e)}function HR(e,t=10){let s=null;return Math.abs(e.y)>t?s="y":Math.abs(e.x)>t&&(s="x"),s}class FR extends Dr{constructor(t){super(t),this.removeGroupControls=Cs,this.removeListeners=Cs,this.controls=new IR(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Cs}update(){const{dragControls:t}=this.node.getProps(),{dragControls:s}=this.node.prevProps||{};t!==s&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const lm=e=>(t,s)=>{e&&yt.update(()=>e(t,s),!1,!0)};class VR extends Dr{constructor(){super(...arguments),this.removePointerDownListener=Cs}onPointerDown(t){this.session=new Qw(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Zw(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:s,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:lm(t),onStart:lm(s),onMove:lm(r),onEnd:(l,d)=>{delete this.session,o&&yt.postRender(()=>o(l,d))}}}mount(){this.removePointerDownListener=Kl(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let cm=!1;class $R extends E.Component{componentDidMount(){const{visualElement:t,layoutGroup:s,switchLayoutGroup:r,layoutId:o}=this.props,{projection:l}=t;l&&(s.group&&s.group.add(l),r&&r.register&&o&&r.register(l),cm&&l.root.didUpdate(),l.addEventListener("animationComplete",()=>{this.safeToRemove()}),l.setOptions({...l.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),ed.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:s,visualElement:r,drag:o,isPresent:l}=this.props,{projection:d}=r;return d&&(d.isPresent=l,t.layoutDependency!==s&&d.setOptions({...d.options,layoutDependency:s}),cm=!0,o||t.layoutDependency!==s||s===void 0||t.isPresent!==l?d.willUpdate():this.safeToRemove(),t.isPresent!==l&&(l?d.promote():d.relegate()||yt.postRender(()=>{const f=d.getStack();(!f||!f.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:s}=this.props,{projection:r}=t;r&&(r.options.layoutAnchor=s,r.root.didUpdate(),Kg.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:s,switchLayoutGroup:r}=this.props,{projection:o}=t;cm=!0,o&&(o.scheduleCheckAfterUnmount(),s&&s.group&&s.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function eE(e){const[t,s]=ZA(),r=E.useContext(p2);return u.jsx($R,{...e,layoutGroup:r,switchLayoutGroup:E.useContext(Yw),isPresent:t,safeToRemove:s})}const qR={pan:{Feature:VR},drag:{Feature:FR,ProjectionNode:Hw,MeasureLayout:eE}};function Ey(e,t,s){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",s==="Start");const o="onHover"+s,l=r[o];l&&yt.postRender(()=>l(t,fc(t)))}class KR extends Dr{mount(){const{current:t}=this.node;t&&(this.unmount=b6(t,(s,r)=>(Ey(this.node,r,"Start"),o=>Ey(this.node,o,"End"))))}unmount(){}}class GR extends Dr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=uc(ec(this.node.current,"focus",()=>this.onFocus()),ec(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Cy(e,t,s){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",s==="Start");const o="onTap"+(s==="End"?"":s),l=r[o];l&&yt.postRender(()=>l(t,fc(t)))}class WR extends Dr{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:s,propagate:r}=this.node.props;this.unmount=C6(t,(o,l)=>(Cy(this.node,l,"Start"),(d,{success:f})=>Cy(this.node,d,f?"End":"Cancel")),{useGlobalTarget:s,stopPropagation:r?.tap===!1})}unmount(){}}const Up=new WeakMap,um=new WeakMap,YR=e=>{const t=Up.get(e.target);t&&t(e)},XR=e=>{e.forEach(YR)};function ZR({root:e,...t}){const s=e||document;um.has(s)||um.set(s,{});const r=um.get(s),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(XR,{root:e,...t})),r[o]}function QR(e,t,s){const r=ZR(t);return Up.set(e,s),r.observe(e),()=>{Up.delete(e),r.unobserve(e)}}const JR={some:0,all:1};class e8 extends Dr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:s,margin:r,amount:o="some",once:l}=t,d={root:s?s.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:JR[o]},f=m=>{const{isIntersecting:h}=m;if(this.isInView===h||(this.isInView=h,l&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:_,onViewportLeave:v}=this.node.getProps(),b=h?_:v;b&&b(m)};this.stopObserver=QR(this.node.current,d,f)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:s}=this.node;["amount","margin","root"].some(t8(t,s))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function t8({viewport:e={}},{viewport:t={}}={}){return s=>e[s]!==t[s]}const i8={inView:{Feature:e8},tap:{Feature:WR},focus:{Feature:GR},hover:{Feature:KR}},s8={layout:{ProjectionNode:Hw,MeasureLayout:eE}},n8={...kR,...i8,...qR,...s8},dm=SR(n8,wR),Ve=({label:e,children:t,variant:s="primary",size:r="medium",icon:o,onClick:l,removable:d=!1,className:f,maxWidth:m,appearance:h,onRemove:_,isLoading:v=!1})=>{const b=r8(s),y=h??(s==="outline"?"outline":"solid"),x=e??t,w=!!l,N={primary:{solid:"bg-[#11111198] text-white border border-transparent",outline:"border-2 border-[#11111198] text-[#11111198]",subtle:"bg-[#11111140] text-[#11111198] border border-transparent"},secondary:{solid:"bg-zinc-700 text-white border border-transparent",outline:"border-2 border-zinc-400 text-zinc-800 bg-white",subtle:"bg-zinc-100 text-zinc-800 border border-zinc-300"},success:{solid:"bg-emerald-600 text-white border border-transparent",outline:"border-2 border-emerald-600 text-emerald-700",subtle:"bg-emerald-100 text-emerald-700 border border-transparent"},warning:{solid:"bg-amber-500 text-white border border-transparent",outline:"border-2 border-amber-500 text-amber-700",subtle:"bg-amber-100 text-amber-700 border border-transparent"},error:{solid:"bg-destructive text-destructive-foreground border border-transparent",outline:"border-2 border-destructive text-destructive",subtle:"bg-destructive/20 text-destructive border border-transparent"}},A={small:"text-xs px-2 py-1",medium:"text-xs px-2.5 py-1",large:"text-sm px-3 py-1.5"},R=M=>{M.stopPropagation(),l?.()},T=M=>{M.stopPropagation(),_?.()};return u.jsxs(dm.div,{initial:{opacity:0,scale:.95,y:8,filter:"blur(8px)"},animate:{opacity:1,scale:1,y:0,filter:"blur(0px)"},transition:{duration:.32,ease:"easeInOut",type:"spring"},whileHover:{scale:w?1.04:1,backgroundColor:w&&b==="primary"?"#111111d1":void 0,transition:{duration:.2,ease:"easeInOut",type:"spring"}},onClick:R,style:{maxWidth:m},className:pe("inline-flex max-w-full items-center gap-1.5 rounded-lg font-medium shadow-[0_0_16px_rgba(0,0,0,0.14)] backdrop-blur-sm",N[b][y],A[r],w&&"cursor-pointer",f),children:[v?u.jsx(dm.div,{animate:{rotate:360},transition:{duration:1,ease:"linear",repeat:1/0},className:"flex-shrink-0",children:u.jsx(Zs,{className:"size-3.5"})}):o&&u.jsx("span",{className:"flex-shrink-0",children:o}),u.jsx("span",{className:"min-w-0 truncate",children:x}),d&&u.jsx(dm.button,{initial:{opacity:0,scale:.95,filter:"blur(8px)"},animate:{opacity:1,scale:1,filter:"blur(0px)"},whileHover:{scale:1.1,opacity:1,transition:{duration:.2,ease:"easeInOut",type:"spring"}},className:"flex items-center justify-center rounded-md bg-[#11111198] p-1 opacity-70 hover:opacity-100",onClick:T,type:"button",children:u.jsx(rn,{className:"size-3.5"})})]})};function r8(e){return e==="danger"?"error":e==="default"||e==="outline"?"primary":e}const a8=e2("rounded-lg border p-4 text-sm",{variants:{variant:{default:"border-border bg-card text-card-foreground",muted:"border-border bg-muted text-muted-foreground",destructive:"border-red-200 bg-red-50 text-red-700"}},defaultVariants:{variant:"default"}});function ht({className:e,variant:t,...s}){return u.jsx("div",{className:pe(a8({variant:t,className:e})),...s})}function Js({className:e,...t}){return u.jsx("div",{className:pe("rounded-lg border border-border bg-card text-card-foreground",e),...t})}function en({className:e,...t}){return u.jsx("div",{className:pe("grid gap-1.5 p-4",e),...t})}function tn({className:e,...t}){return u.jsx("h3",{className:pe("text-sm font-semibold tracking-tight",e),...t})}function Ar({className:e,...t}){return u.jsx("p",{className:pe("text-sm text-muted-foreground",e),...t})}function sn({className:e,...t}){return u.jsx("div",{className:pe("p-4 pt-0",e),...t})}const Ny=100;function o8(){const[e,t]=E.useState([]),[s,r]=E.useState(!1),o=E.useRef(new Set);E.useEffect(()=>{const d=new EventSource("/api/agent/tool-calls/stream");return d.addEventListener("open",()=>r(!0)),d.addEventListener("error",()=>r(!1)),d.addEventListener("tool-call",f=>{try{const m=JSON.parse(f.data);t(h=>{if(o.current.has(m.id))return h;o.current.add(m.id);const _=[...h,m];return _.length>Ny&&_.splice(0,_.length-Ny),_})}catch{}}),()=>{d.close()}},[]);const l=[...e].reverse();return u.jsxs(Js,{className:"min-w-0 rounded-none border-0 border-b border-border bg-transparent",children:[u.jsxs(en,{className:"border-b border-border px-3 py-2",children:[u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(_o,{className:"size-4 text-muted-foreground"}),u.jsx(tn,{children:"Live MCP Tool Calls"}),u.jsx(Ve,{variant:"outline",size:"small",children:e.length})]}),u.jsx(Ve,{variant:"outline",size:"small",icon:u.jsx("span",{className:pe("inline-block size-1.5 rounded-full",s?"animate-pulse bg-emerald-500":"bg-muted-foreground/60")}),children:s?"live":"reconnecting…"})]}),u.jsx(Ar,{className:"text-xs",children:"Streamed from this NoMoreIDE MCP server. Newest at the top."})]}),u.jsx(sn,{className:"p-0",children:l.length?u.jsx("ul",{className:"max-h-96 divide-y divide-border overflow-auto",children:l.map(d=>u.jsxs("li",{className:"px-3 py-2",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:d.tool}),u.jsxs("div",{className:"flex shrink-0 items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[u.jsxs("span",{children:[d.durationMs," ms"]}),u.jsx(Ve,{variant:d.status==="ok"?"success":"error",appearance:"outline",size:"small",children:d.status})]})]}),d.args?u.jsx("div",{className:"mt-0.5 truncate font-mono text-[11px] text-muted-foreground",children:d.args}):null,d.error?u.jsx("div",{className:"mt-0.5 font-mono text-[11px] text-destructive",children:d.error}):null,u.jsx("div",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground/80",children:new Date(d.startedAt).toLocaleTimeString()})]},d.id))}):u.jsx("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"No tool calls yet. Invoke a NoMoreIDE MCP tool from your agent and it will appear here."})})]})}function l8({agent:e,agentId:t}){return u.jsxs(u.Fragment,{children:[u.jsx(o8,{}),t!=="claude-code"?null:u.jsxs(Js,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[u.jsxs(en,{className:"border-b border-border px-3 py-2",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Nd,{className:"size-4 text-muted-foreground"}),u.jsx(tn,{children:"Recent Projects"})]}),u.jsx(Ve,{variant:"outline",size:"small",children:e.projects.length})]}),u.jsx(Ar,{className:"text-xs",children:"Most recently active projects known to the agent."})]}),u.jsx(sn,{className:"p-0",children:e.projects.length?u.jsx("ul",{className:"divide-y divide-border",children:e.projects.map(s=>u.jsxs("li",{className:pe("flex items-start justify-between gap-3 px-3 py-2",s.current&&"bg-primary/5"),children:[u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:s.path}),s.current?u.jsx(Ve,{variant:"outline",size:"small",children:"current"}):null]}),s.lastSessionFirstPrompt?u.jsx("p",{className:"mt-0.5 truncate text-[11px] text-muted-foreground",children:s.lastSessionFirstPrompt}):null]}),u.jsxs("div",{className:"shrink-0 text-right font-mono text-[10px] text-muted-foreground",children:[s.mcpServerCount?u.jsxs("div",{children:[s.mcpServerCount," mcp"]}):null,s.lastSessionModified?u.jsx("div",{children:c8(s.lastSessionModified)}):null]})]},s.path))}):u.jsx("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"No known projects."})})]})]})}function c8(e){const t=Date.parse(e);return Number.isNaN(t)?e:new Date(t).toLocaleString()}function Dd({className:e}){return u.jsx("svg",{className:pe("size-3.5",e),viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:u.jsx("path",{d:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"})})}function Od({className:e}){return u.jsx("svg",{className:pe("size-3.5",e),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":!0,children:u.jsx("path",{d:"M11.248 18.25q-.825 0-1.568-.314a4.3 4.3 0 0 1-1.32-.874 4 4 0 0 1-1.304.214 4 4 0 0 1-2.046-.544 4.27 4.27 0 0 1-1.518-1.485 4 4 0 0 1-.56-2.095q0-.48.131-1.04A4.4 4.4 0 0 1 2.04 10.71a4.07 4.07 0 0 1 .017-3.4 4.2 4.2 0 0 1 1.056-1.418 3.8 3.8 0 0 1 1.6-.842 3.9 3.9 0 0 1 .76-1.683q.593-.759 1.451-1.188a4.04 4.04 0 0 1 1.832-.429q.825 0 1.567.313.742.314 1.32.875a4 4 0 0 1 1.304-.215q1.106 0 2.046.545a4.14 4.14 0 0 1 1.501 1.485q.578.941.578 2.095 0 .48-.132 1.04.66.61 1.023 1.419.363.792.363 1.666 0 .892-.38 1.717a4.3 4.3 0 0 1-1.072 1.435 3.8 3.8 0 0 1-1.584.825 3.8 3.8 0 0 1-.775 1.683 4.06 4.06 0 0 1-1.436 1.188 4.04 4.04 0 0 1-1.832.429m-4.076-2.062q.825 0 1.435-.347l3.103-1.782a.36.36 0 0 0 .164-.313v-1.42L7.881 14.62a.67.67 0 0 1-.726 0l-3.118-1.798a.5.5 0 0 1-.017.115v.198q0 .841.396 1.551.413.693 1.139 1.089a3.2 3.2 0 0 0 1.617.412m.165-2.69a.4.4 0 0 0 .181.05q.083 0 .165-.05l1.238-.71-3.977-2.31a.7.7 0 0 1-.363-.643v-3.58q-.825.362-1.32 1.122a2.9 2.9 0 0 0-.495 1.65q0 .809.413 1.55.412.743 1.072 1.123zm3.91 3.663q.875 0 1.585-.396a2.96 2.96 0 0 0 1.534-2.64v-3.564a.32.32 0 0 0-.165-.297l-1.254-.726v4.604a.7.7 0 0 1-.363.643l-3.119 1.799a3 3 0 0 0 1.783.577m.627-6.039V8.878L10.01 7.822 8.129 8.878v2.244l1.881 1.056zM7.057 5.859a.7.7 0 0 1 .363-.644l3.119-1.798a3 3 0 0 0-1.782-.578q-.874 0-1.584.396A2.96 2.96 0 0 0 6.05 4.324a3.07 3.07 0 0 0-.396 1.551v3.547q0 .199.165.314l1.237.726zm8.383 7.887q.825-.364 1.303-1.123.495-.758.495-1.65a3.15 3.15 0 0 0-.412-1.55q-.413-.743-1.073-1.123l-3.086-1.782q-.099-.065-.181-.049a.3.3 0 0 0-.165.05l-1.238.692 3.993 2.327a.6.6 0 0 1 .264.264.64.64 0 0 1 .1.363zm-3.317-8.382a.63.63 0 0 1 .726 0l3.135 1.831v-.297q0-.792-.396-1.501a2.86 2.86 0 0 0-1.105-1.155q-.71-.43-1.65-.43-.825 0-1.436.347L8.294 5.941a.36.36 0 0 0-.165.314v1.418z"})})}function tE({icon:e,title:t,children:s}){return u.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 px-4 py-16 text-center",children:[u.jsx("div",{className:"text-muted-foreground/70",children:e}),u.jsx("p",{className:"text-sm font-medium text-foreground",children:t}),s?u.jsx("p",{className:"max-w-sm text-xs text-muted-foreground",children:s}):null]})}function u8({agent:e,agentId:t}){return t==="codex"?u.jsxs(tE,{icon:u.jsx(hp,{className:"size-8"}),title:"No memory introspection for Codex yet",children:["Project memory and ",u.jsx("code",{className:"font-mono",children:"CLAUDE.md"})," reading are Claude-specific. Codex memory support isn't wired up."]}):u.jsxs(Js,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[u.jsxs(en,{className:"border-b border-border px-3 py-2",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(hp,{className:"size-4 text-muted-foreground"}),u.jsx(tn,{children:"Project Memory"})]}),u.jsx(Ve,{variant:"outline",size:"small",children:e.project.memoryFiles.length+(e.project.claudeMdPath?1:0)})]}),u.jsx(Ar,{className:"truncate text-xs",children:e.project.memoryDir??"No memory directory found for this project."})]}),u.jsxs(sn,{className:"space-y-2 p-3",children:[e.project.claudeMdPath?u.jsx(ky,{title:"CLAUDE.md",preview:e.project.claudeMdPreview,defaultOpen:!0}):null,e.project.memoryFiles.length?e.project.memoryFiles.map(s=>u.jsx(ky,{title:s.name,subtitle:`${s.size} B`,preview:s.preview,defaultOpen:s.name==="MEMORY.md"},s.path)):e.project.claudeMdPath?null:u.jsx("p",{className:"text-xs text-muted-foreground",children:"No memory files persisted yet for this project."})]})]})}function ky({title:e,subtitle:t,preview:s,defaultOpen:r=!1}){const[o,l]=E.useState(r);return u.jsxs("div",{className:"rounded-md border border-border bg-background/40",children:[u.jsxs("button",{type:"button",onClick:()=>l(!o),className:"flex w-full items-center gap-2 px-2.5 py-1.5 text-left text-xs font-semibold",children:[u.jsx(ga,{className:pe("size-3.5 text-muted-foreground transition-transform",o&&"rotate-90")}),u.jsx("span",{children:e}),t?u.jsx("span",{className:"font-mono text-[10px] font-normal text-muted-foreground",children:t}):null]}),o&&s?u.jsx("pre",{className:"max-h-64 overflow-auto whitespace-pre-wrap border-t border-border px-2.5 py-2 font-mono text-[11px] leading-relaxed text-muted-foreground",children:s}):null]})}function d8({usage:e}){const t=e.inputTokens+e.cacheCreationInputTokens+e.cacheReadInputTokens,s=t>0?e.cacheReadInputTokens/t*100:0;return u.jsxs("div",{className:"rounded-md border border-border",children:[u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-border px-3 py-1.5",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Dd,{className:"size-3.5 text-amber-700"}),u.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Claude Code · last session"}),e.sessionId?u.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:e.sessionId.slice(0,8)}):null]}),u.jsxs("span",{className:"font-mono text-sm font-semibold text-emerald-700",children:["$",e.costUSD.toFixed(4)]})]}),u.jsxs("div",{className:"grid grid-cols-2 gap-x-3 gap-y-1.5 px-3 py-2 text-[11px] sm:grid-cols-4",children:[u.jsx(vr,{label:"Input",value:Nl(e.inputTokens)}),u.jsx(vr,{label:"Output",value:Nl(e.outputTokens)}),u.jsx(vr,{label:"Cache read",value:Nl(e.cacheReadInputTokens)}),u.jsx(vr,{label:"Cache create",value:Nl(e.cacheCreationInputTokens)}),u.jsx(vr,{label:"Lines +",value:String(e.linesAdded)}),u.jsx(vr,{label:"Lines −",value:String(e.linesRemoved)}),u.jsx(vr,{label:"Wall",value:Ty(e.durationMs)}),u.jsx(vr,{label:"API",value:Ty(e.apiDurationMs)})]}),u.jsxs("div",{className:"border-t border-border px-3 py-2",children:[u.jsxs("div",{className:"flex items-center justify-between text-[11px] text-muted-foreground",children:[u.jsx("span",{children:"Cache read share of input"}),u.jsxs("span",{className:"font-mono",children:[s.toFixed(1),"%"]})]}),u.jsx("div",{className:"mt-1 h-1.5 overflow-hidden rounded-full bg-muted",children:u.jsx("div",{className:"h-full bg-emerald-500",style:{width:`${Math.min(100,s).toFixed(2)}%`}})})]}),e.fiveHour||e.weekly?u.jsxs("div",{className:"space-y-2 border-t border-border px-3 py-2",children:[u.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Rate limits"}),e.fiveHour?u.jsx(_d,{label:"5h block",window:e.fiveHour}):null,e.weekly?u.jsx(_d,{label:"This week",window:e.weekly}):null]}):null,e.models.length?u.jsxs("div",{className:"space-y-1 border-t border-border px-3 py-2",children:[u.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"By model"}),e.models.map(r=>u.jsxs("div",{className:"flex items-center justify-between gap-2 font-mono text-[11px]",children:[u.jsx("span",{className:"truncate",children:r.model}),u.jsxs("span",{className:"shrink-0 text-muted-foreground",children:[Nl(r.inputTokens+r.outputTokens)," tok ·"," ",u.jsxs("span",{className:"text-emerald-700",children:["$",r.costUSD.toFixed(4)]})]})]},r.model))]}):null]})}function h8({usage:e}){return u.jsxs("div",{className:"rounded-md border border-border",children:[u.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3 py-1.5",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Od,{className:"size-3.5 text-foreground"}),u.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Codex · rate limits"})]}),e.timestamp?u.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:new Date(e.timestamp).toLocaleString()}):null]}),u.jsxs("div",{className:"space-y-2 px-3 py-2",children:[e.primary?u.jsx(_d,{label:"5h window",window:e.primary}):null,e.secondary?u.jsx(_d,{label:"Weekly window",window:e.secondary}):null]})]})}function _d({label:e,window:t}){const s=Math.min(100,Math.max(0,t.usedPercent)),r=t.resetsAtUnix?new Date(t.resetsAtUnix*1e3).toLocaleString():null,o=s>=90?"bg-red-500":s>=70?"bg-amber-500":"bg-emerald-500";return u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center justify-between text-[11px]",children:[u.jsx("span",{className:"text-muted-foreground",children:e}),u.jsxs("span",{className:"font-mono",children:[s.toFixed(1),"%"]})]}),u.jsx("div",{className:"mt-1 h-1.5 overflow-hidden rounded-full bg-muted",children:u.jsx("div",{className:pe("h-full",o),style:{width:`${s.toFixed(2)}%`}})}),r?u.jsxs("div",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground",children:["resets ",r]}):null]})}function vr({label:e,value:t}){return u.jsxs("div",{children:[u.jsx("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:e}),u.jsx("div",{className:"font-mono text-xs font-semibold",children:t})]})}function Nl(e){return e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Ty(e){if(!e)return"0s";if(e<1e3)return`${e}ms`;const t=e/1e3;if(t<60)return`${t.toFixed(1)}s`;const s=Math.floor(t/60),r=Math.round(t-s*60);return`${s}m ${r}s`}function f8(e=1e4){const[t,s]=E.useState(null),[r,o]=E.useState(null);return E.useEffect(()=>{let l=!0;const d=()=>{j5().then(m=>{l&&(s(m),o(null))}).catch(m=>{l&&o(m instanceof Error?m.message:String(m))})};d();const f=window.setInterval(d,e);return()=>{l=!1,window.clearInterval(f)}},[e]),{usage:t,error:r}}const m8={"claude-code":{label:"Claude Code",icon:u.jsx(Dd,{})},codex:{label:"Codex",icon:u.jsx(Od,{})}};function p8({agent:e,agentId:t}){const{usage:s,error:r}=f8(),o=e.detected.name===t,l=m8[t],d=t==="codex";return u.jsxs(Js,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[u.jsxs(en,{className:"border-b border-border px-3 py-2",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(HS,{className:"size-4 text-muted-foreground"}),u.jsx(tn,{children:d?"Rate Limits":"Token & Cost Usage"}),u.jsx(Ve,{variant:"outline",size:"small",icon:l.icon,children:l.label}),o?u.jsx(Ve,{variant:"outline",size:"small",children:"active session"}):u.jsx("span",{className:"text-[11px] text-muted-foreground",children:"Not the active agent in this session"})]}),u.jsxs(Ar,{className:"truncate text-xs",children:[d?u.jsxs(u.Fragment,{children:["Rate-limit windows from ",u.jsx("code",{className:"font-mono",children:"~/.codex/sessions"})]}):u.jsxs(u.Fragment,{children:["Last-session metrics from ",u.jsx("code",{className:"font-mono",children:"~/.claude.json"})]})," · ",u.jsx("span",{className:"font-mono",children:e.project.cwd})]})]}),u.jsxs(sn,{className:"p-3",children:[r?u.jsx("p",{className:"text-xs text-destructive",children:r}):null,d?s?.codex?u.jsx(h8,{usage:s.codex}):r?null:u.jsx(My,{agent:"Codex CLI"}):s?.claude?u.jsx(d8,{usage:s.claude}):r?null:u.jsx(My,{agent:"Claude Code"})]})]})}function My({agent:e}){return u.jsxs("p",{className:"text-xs text-muted-foreground",children:["No usage data yet. Run a session with ",e," in this project."]})}function g8({agent:e,agentId:t}){return t==="codex"?u.jsxs(tE,{icon:u.jsx(pp,{className:"size-8"}),title:"No skill/MCP discovery for Codex yet",children:["Skills and MCP servers are read from ",u.jsx("code",{className:"font-mono",children:"~/.claude.json"}),". Codex config introspection isn't wired up."]}):u.jsxs("div",{className:"grid grid-cols-1 divide-y divide-border xl:grid-cols-2 xl:divide-x xl:divide-y-0",children:[u.jsxs(Js,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[u.jsxs(en,{className:"border-b border-border px-3 py-2",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(GS,{className:"size-4 text-muted-foreground"}),u.jsx(tn,{children:"Skills"})]}),u.jsx(Ve,{variant:"outline",size:"small",children:e.skills.length})]}),u.jsx(Ar,{className:"text-xs",children:"User, project, and plugin skills discovered for the active agent."})]}),u.jsx(sn,{className:"p-0",children:e.skills.length?u.jsx("ul",{className:"divide-y divide-border",children:e.skills.map(s=>u.jsxs("li",{className:"px-3 py-2",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:s.name}),u.jsx(Ve,{variant:"outline",size:"small",children:s.scope})]}),s.description?u.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:s.description}):null]},`${s.scope}:${s.name}`))}):u.jsx("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"No skills found."})})]}),u.jsxs(Js,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[u.jsxs(en,{className:"border-b border-border px-3 py-2",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(pp,{className:"size-4 text-muted-foreground"}),u.jsx(tn,{children:"MCP Servers"})]}),u.jsx(Ve,{variant:"outline",size:"small",children:e.mcpServers.length})]}),u.jsxs(Ar,{className:"text-xs",children:["From ",u.jsx("code",{className:"font-mono",children:"~/.claude.json"})," (user + project scopes)."]})]}),u.jsx(sn,{className:"p-0",children:e.mcpServers.length?u.jsx("ul",{className:"divide-y divide-border",children:e.mcpServers.map(s=>u.jsxs("li",{className:"px-3 py-2",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:s.name}),u.jsx(Ve,{variant:"outline",size:"small",children:s.scope})]}),u.jsx("div",{className:"mt-1 truncate font-mono text-[11px] text-muted-foreground",children:s.command??s.url??s.type??"—"})]},`${s.scope}:${s.name}`))}):u.jsx("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"No MCP servers configured."})})]})]})}const _8=[{id:"claude-code",label:"Claude Code",icon:u.jsx(Dd,{className:"size-4"})},{id:"codex",label:"Codex",icon:u.jsx(Od,{className:"size-4"})}],v8=[{id:"overview",label:"Overview",icon:u.jsx(HS,{className:"size-3.5"})},{id:"memory",label:"Memory",icon:u.jsx(hp,{className:"size-3.5"})},{id:"tools",label:"Skills & MCPs",icon:u.jsx(pp,{className:"size-3.5"})},{id:"activity",label:"Activity",icon:u.jsx(_o,{className:"size-3.5"})}];function b8(){const[e,t]=E.useState(null),[s,r]=E.useState(null),[o,l]=E.useState("claude-code"),[d,f]=E.useState("overview");return E.useEffect(()=>{let m=!0;return L5().then(h=>{m&&(t(h),h.detected.name==="codex"&&l("codex"))}).catch(h=>{m&&r(h instanceof Error?h.message:String(h))}),()=>{m=!1}},[]),s?u.jsx("div",{className:"h-full overflow-auto bg-card/85 p-4",children:u.jsxs(ht,{variant:"muted",className:"border-destructive/40 text-destructive",children:["Failed to load agent info: ",s]})}):e?u.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-card/85",children:[u.jsx("div",{className:"flex shrink-0 items-center gap-2 border-b border-border bg-card/90 px-3 py-2",children:_8.map(m=>{const h=o===m.id,_=e.detected.name===m.id;return u.jsxs("button",{type:"button",onClick:()=>l(m.id),className:pe("flex items-center gap-2 rounded-lg border px-3 py-1.5 text-xs font-medium transition-colors",h?"border-border bg-background text-foreground shadow-sm":"border-transparent text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[m.icon,m.label,_?u.jsx("span",{className:"size-1.5 rounded-full bg-emerald-500","aria-label":"active session"}):null]},m.id)})}),u.jsx("div",{className:"flex shrink-0 items-center gap-1 border-b border-border bg-card/90 px-3",children:v8.map(m=>u.jsxs("button",{type:"button",onClick:()=>f(m.id),className:pe("relative flex items-center gap-1.5 px-2.5 py-2 text-xs font-medium transition-colors",d===m.id?"text-foreground":"text-muted-foreground hover:text-foreground"),children:[m.icon,m.label,d===m.id?u.jsx("span",{className:"absolute inset-x-1 -bottom-px h-0.5 bg-primary"}):null]},m.id))}),u.jsxs("div",{className:"min-h-0 flex-1 overflow-auto",children:[d==="overview"?u.jsx(p8,{agent:e,agentId:o}):null,d==="memory"?u.jsx(u8,{agent:e,agentId:o}):null,d==="tools"?u.jsx(g8,{agent:e,agentId:o}):null,d==="activity"?u.jsx(l8,{agent:e,agentId:o}):null]})]}):u.jsx("div",{className:"h-full overflow-auto bg-card/85 p-4",children:u.jsx(ht,{variant:"muted",children:"Loading agent info…"})})}const t0="application/x-nomoreide-path";function iE(e,t){return`${e.replace(/\/+$/,"")}/${t.replace(/^\/+/,"")}`}function sE(e,t){e.setData(t0,t)}function Ay(e){return e.types.includes(t0)}function y8(e){return e.getData(t0)||null}function nE(e){return{draggable:!0,onDragStart:t=>{sE(t.dataTransfer,e),t.dataTransfer.effectAllowed="copy"}}}const x8=new Set(["c","cpp","cs","go","java","js","jsx","kt","mjs","py","rs","swift","ts","tsx"]),S8=new Set([".env",".gitignore","components.json","dockerfile","package.json","tsconfig.json","vite.config.ts"]),w8=new Set(["conf","config","ini","toml","yaml","yml"]),E8=new Set(["csv","json","sql","xml"]),C8=new Set(["md","mdx","rst","txt"]),N8=new Set(["gif","jpeg","jpg","png","svg","webp"]),k8=new Set(["package-lock.json","pnpm-lock.yaml","yarn.lock"]),T8=new Set(["css","less","sass","scss"]);function M8(e){const t=e.split("/").pop()?.toLowerCase()??e.toLowerCase(),s=t.includes(".")?t.split(".").pop()??"":"";return k8.has(t)||t.endsWith(".lock")?"lock":A8(t)?"test":S8.has(t)||w8.has(s)?"config":T8.has(s)?"style":N8.has(s)?"image":C8.has(s)?"document":E8.has(s)?"data":x8.has(s)?"code":"generic"}function A8(e){return e.includes(".test.")||e.includes(".spec.")||e.endsWith("_test.go")}function i0({path:e,className:t}){const s=M8(e),r=R8[s];return u.jsx(r,{"aria-label":`${s} file`,className:pe("size-3.5 shrink-0",D8[s],t)})}const R8={code:ik,config:f5,data:oc,document:ak,generic:US,image:wk,lock:Mk,style:Hk,test:ck},D8={code:"text-sky-600",config:"text-zinc-600",data:"text-emerald-700",document:"text-blue-700",generic:"text-muted-foreground",image:"text-fuchsia-700",lock:"text-amber-700",style:"text-rose-700",test:"text-violet-700"};function O8(e){const t=e.lastIndexOf(".");return t>0?e.slice(t):""}function L8({onPick:e,onClose:t}){const[s,r]=E.useState(""),[o,l]=E.useState(null),[d,f]=E.useState(null),[m,h]=E.useState(!1),_=E.useRef(null),v=o?o.parent!==o.path:!1;return E.useEffect(()=>{function b(y){_.current&&!_.current.contains(y.target)&&t()}return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[t]),E.useEffect(()=>{let b=!0;return h(!0),f(null),ZS(s,{files:!0}).then(y=>b&&l(y)).catch(y=>b&&f(y instanceof Error?y.message:String(y))).finally(()=>b&&h(!1)),()=>{b=!1}},[s]),u.jsxs("div",{ref:_,className:"absolute bottom-full left-2 z-10 mb-2 w-[22rem] max-w-[calc(100vw-1rem)] overflow-hidden rounded-md border border-border bg-card shadow-lg",children:[u.jsxs("div",{className:"flex items-center gap-1 border-b border-border px-2 py-1.5",children:[u.jsx(fe,{"aria-label":"Parent folder",className:"size-7",disabled:!v,onClick:()=>o&&r(o.parent),size:"icon",type:"button",variant:"ghost",children:u.jsx(Cg,{})}),u.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-muted-foreground",title:o?.path,children:o?.path??"…"}),m?u.jsx(Zs,{className:"size-3.5 animate-spin text-muted-foreground"}):null,o?u.jsxs(fe,{className:"h-7 px-2 text-[11px]",onClick:()=>e(o.path),size:"sm",title:"Attach this folder",type:"button",variant:"outline",children:[u.jsx($N,{})," This folder"]}):null,u.jsx(fe,{"aria-label":"Close",className:"size-7",onClick:t,size:"icon",type:"button",variant:"ghost",children:u.jsx(rn,{})})]}),u.jsx("div",{className:"max-h-64 overflow-auto p-1",children:d?u.jsx(ht,{variant:"destructive",className:"m-1",children:d}):o&&o.entries.length===0?u.jsx(ht,{variant:"muted",className:"m-1 text-center",children:"Empty folder."}):o?.entries.map(b=>{const y=b.isDir?"":O8(b.name);return u.jsxs("button",{className:"flex w-full items-center gap-1.5 rounded-sm px-2 py-1 text-left text-[12px] hover:bg-muted",onClick:()=>b.isDir?r(b.path):e(b.path),title:b.path,type:"button",children:[b.isDir?u.jsx(_a,{className:"size-3.5 shrink-0 text-amber-600"}):u.jsx(i0,{path:b.path}),u.jsx("span",{className:"min-w-0 flex-1 truncate",children:b.name}),y?u.jsx("span",{className:"shrink-0 rounded bg-muted px-1 font-mono text-[10px] text-muted-foreground",children:y}):null]},b.path)})})]})}let Ry=0;const Dy=()=>(Ry+=1,`t${Date.now()}-${Ry}`);function j8(){const[e,t]=E.useState([]),[s,r]=E.useState(!1),[o,l]=E.useState(null),[d,f]=E.useState(null),[m,h]=E.useState(null),[_,v]=E.useState([]),b=E.useRef(null),y=E.useRef(void 0);E.useEffect(()=>{B5().then(R=>{f(R.configured),h(R.provider)}).catch(()=>f(!1))},[]);const x=E.useCallback(async(R,T)=>{v(z=>z.filter(U=>U.requestId!==R));const M=y.current;if(M)try{await z5(M,R,T)}catch{}},[]),w=E.useCallback(()=>{b.current?.abort(),b.current=null,r(!1)},[]),N=E.useCallback(async R=>{const T=R.trim();if(!T||s)return;l(null);const M={id:Dy(),role:"user",text:T,tools:[]},z=Dy(),U={id:z,role:"assistant",text:"",tools:[]};t(K=>[...K,M,U]);const j=K=>t(H=>H.map(G=>G.id===z?K(G):G)),O=new AbortController;b.current=O,r(!0);try{await P5(T,y.current,K=>{switch(K.type){case"session":y.current=K.sessionId;break;case"text":j(H=>({...H,text:H.text+K.text}));break;case"tool_use":j(H=>({...H,tools:[...H.tools,{id:K.id,name:K.name,input:K.input,status:"running"}]}));break;case"tool_result":j(H=>({...H,tools:H.tools.map(G=>G.id===K.id?{...G,preview:K.preview,isError:K.isError,status:"done"}:G)}));break;case"approval_request":v(H=>[...H,{requestId:K.requestId,name:K.name,input:K.input}]);break;case"error":l(K.message);break;case"done":break}},O.signal)}catch(K){O.signal.aborted||l(K instanceof Error?K.message:String(K))}finally{b.current=null,r(!1)}},[s]),A=E.useCallback(()=>{w(),y.current=void 0,t([]),v([]),l(null)},[w]);return{turns:e,streaming:s,error:o,configured:d,provider:m,approvals:_,send:N,stop:w,clear:A,respond:x}}function B8({onOpenAgentPage:e}){const[t,s]=E.useState(!1),{turns:r,streaming:o,error:l,configured:d,provider:f,approvals:m,send:h,stop:_,clear:v,respond:b}=j8(),[y,x]=E.useState(""),[w,N]=E.useState(!1),[A,R]=E.useState(!1),[T,M]=E.useState(!1),z=E.useRef(null),U=E.useRef(null);function j(I){s(!0),x(ee=>ee.trim()?`${ee.replace(/\s*$/,"")} ${I} `:`${I} `),requestAnimationFrame(()=>U.current?.focus())}E.useEffect(()=>{t&&U.current?.focus()},[t]),E.useEffect(()=>{const I=q=>{q.dataTransfer&&Ay(q.dataTransfer)&&N(!0)},ee=()=>{N(!1),R(!1)};return document.addEventListener("dragstart",I),document.addEventListener("dragend",ee),document.addEventListener("drop",ee),()=>{document.removeEventListener("dragstart",I),document.removeEventListener("dragend",ee),document.removeEventListener("drop",ee)}},[]),E.useEffect(()=>{const I=z.current;I&&(I.scrollTop=I.scrollHeight)},[r,t]);async function O(){const I=y;x(""),await h(I)}function K(I){I.key==="Enter"&&!I.shiftKey&&(I.preventDefault(),O())}function H(I){Ay(I.dataTransfer)&&(I.preventDefault(),I.dataTransfer.dropEffect="copy",t||s(!0),R(!0))}function G(I){I.currentTarget.contains(I.relatedTarget)||R(!1)}function J(I){R(!1);const ee=y8(I.dataTransfer);ee&&(I.preventDefault(),j(ee))}return u.jsx("div",{className:pe("fixed inset-x-0 bottom-0 z-50 flex flex-col border-t border-border bg-card/95 shadow-[0_-8px_24px_-12px_rgba(0,0,0,0.25)] backdrop-blur transition-[height] duration-200",t?"h-[50vh]":w?"h-12":"h-9",w&&!A&&"border-primary/60 bg-primary/5",A&&"outline-dashed outline-2 -outline-offset-2 outline-primary/70"),onDragOver:H,onDragLeave:G,onDrop:J,children:t?u.jsxs(u.Fragment,{children:[u.jsxs("header",{className:"flex h-9 shrink-0 items-center gap-2 border-b border-border px-3",children:[u.jsx(Oy,{provider:f,className:"size-4 text-primary"}),u.jsx("span",{className:"text-sm font-medium",children:f?.label??"Agent"}),o?u.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[u.jsx(Zs,{className:"size-3 animate-spin"})," thinking…"]}):null,u.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[e?u.jsx(fe,{"aria-label":"Open agent page",className:"size-7",onClick:e,size:"icon",title:"Open the full agent page",type:"button",variant:"ghost",children:u.jsx(Yk,{})}):null,u.jsx(fe,{"aria-label":"Clear conversation",className:"size-7",disabled:r.length===0,onClick:v,size:"icon",title:"Clear conversation",type:"button",variant:"ghost",children:u.jsx(lc,{})}),u.jsx(fe,{"aria-label":"Collapse agent",className:"size-7",onClick:()=>s(!1),size:"icon",title:"Collapse",type:"button",variant:"ghost",children:u.jsx(Pn,{})})]})]}),u.jsxs("div",{ref:z,className:"min-h-0 flex-1 space-y-3 overflow-auto px-3 py-3",children:[r.length===0?u.jsx(z8,{configured:d,provider:f}):r.map(I=>u.jsx(P8,{turn:I},I.id)),l?u.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:[u.jsx(C5,{className:"mt-px size-3.5 shrink-0"}),u.jsx("span",{className:"min-w-0 break-words",children:l})]}):null]}),m.length>0?u.jsx("div",{className:"shrink-0 space-y-1.5 border-t border-amber-400/40 bg-amber-50/60 px-3 py-2",children:m.map(I=>u.jsx(U8,{prompt:I,onRespond:b},I.requestId))}):null,u.jsxs("div",{className:pe("relative shrink-0 border-t border-border p-2 transition-colors",w&&"bg-primary/5"),children:[T?u.jsx(L8,{onClose:()=>M(!1),onPick:I=>{M(!1),j(I)}}):null,u.jsxs("div",{className:"flex items-end gap-2",children:[u.jsx(fe,{"aria-label":"Attach a file or folder",className:"size-9 shrink-0",disabled:d===!1,onClick:()=>M(!0),size:"icon",title:"Attach a file or folder",type:"button",variant:T?"secondary":"outline",children:u.jsx(Zk,{})}),u.jsx("textarea",{ref:U,className:"max-h-32 min-h-9 flex-1 resize-none rounded-md border border-border bg-background px-3 py-2 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring",disabled:d===!1,onChange:I=>x(I.target.value),onKeyDown:K,placeholder:d===!1?`${f?.label??"Agent"} (\`${f?.commandName??"agent"}\`) is not installed`:`Ask ${f?.label??"the agent"} anything about this project...`,rows:1,value:y}),o?u.jsxs(fe,{onClick:_,size:"sm",type:"button",variant:"outline",children:[u.jsx(kd,{})," Stop"]}):u.jsxs(fe,{disabled:!y.trim()||d===!1,onClick:()=>{O()},size:"sm",type:"button",children:["Send ",u.jsx(FN,{})]})]})]})]}):u.jsx("button",{className:pe("flex h-full w-full items-center gap-2 px-3 text-left text-sm hover:bg-muted/50",w?"font-medium text-primary":"text-muted-foreground"),onClick:()=>s(!0),type:"button",children:w?u.jsxs(u.Fragment,{children:[u.jsx(YN,{className:"size-4 animate-bounce text-primary"}),u.jsx("span",{children:"Drop here to add it to your message"})]}):u.jsxs(u.Fragment,{children:[u.jsx(Oy,{provider:f,className:"size-4 text-primary"}),u.jsxs("span",{children:["Ask ",f?.label??"the agent","..."]}),o?u.jsx(Zs,{className:"size-3.5 animate-spin"}):null,u.jsx("span",{className:"ml-auto text-xs text-muted-foreground/70",children:"click to expand"})]})})})}function Oy({provider:e,className:t}){return e?.id==="claude"?u.jsx(Dd,{className:t}):e?.id==="codex"?u.jsx(Od,{className:t}):u.jsx(GS,{className:t})}function z8({configured:e,provider:t}){return e===!1?u.jsxs("div",{className:"rounded-md border border-border bg-muted/30 px-3 py-2 text-xs text-muted-foreground",children:["This dock runs the ",u.jsx("code",{className:"font-mono",children:t?.commandName??"agent"})," ","CLI. ",t?.installHint??"Install the active agent CLI, then reload."]}):u.jsx("div",{className:"text-xs text-muted-foreground",children:t?.intro??'This is the active agent, running in your workspace with full tools - e.g. "restart the api and tail its logs", "what changed in git and why?", "fix the failing test".'})}function P8({turn:e}){return e.role==="user"?u.jsx("div",{className:"flex justify-end",children:u.jsx("div",{className:"max-w-[85%] whitespace-pre-wrap break-words rounded-2xl rounded-br-sm bg-primary px-3 py-1.5 text-sm text-primary-foreground",children:e.text})}):u.jsxs("div",{className:"space-y-1.5",children:[e.tools.map(t=>u.jsx(I8,{tool:t},t.id)),e.text?u.jsx("div",{className:"max-w-[85%] whitespace-pre-wrap break-words rounded-2xl rounded-bl-sm bg-muted px-3 py-1.5 text-sm",children:e.text}):null]})}function I8({tool:e}){const t=rE(e.input);return u.jsxs("div",{className:pe("inline-flex max-w-[85%] items-center gap-1.5 rounded-md border px-2 py-1 font-mono text-[11px]",e.isError?"border-destructive/40 bg-destructive/5 text-destructive":"border-border bg-background text-muted-foreground"),children:[e.status==="running"?u.jsx(Zs,{className:"size-3 animate-spin"}):u.jsx(M5,{className:"size-3"}),u.jsx("span",{className:"font-semibold",children:e.name}),t?u.jsx("span",{className:"truncate",children:t}):null]})}function U8({prompt:e,onRespond:t}){const s=rE(e.input).slice(0,140);return u.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-amber-400/50 bg-background/80 px-2 py-1.5 text-xs",children:[u.jsx(p5,{className:"size-4 shrink-0 text-amber-600"}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("span",{className:"font-mono font-semibold",children:e.name}),s?u.jsx("span",{className:"ml-1 truncate font-mono text-muted-foreground",children:s}):null]}),u.jsxs(fe,{className:"h-7",onClick:()=>t(e.requestId,"deny"),size:"sm",type:"button",variant:"outline",children:[u.jsx(rn,{})," Deny"]}),u.jsxs(fe,{className:"h-7",onClick:()=>t(e.requestId,"allow"),size:"sm",type:"button",children:[u.jsx(ac,{})," Allow"]})]})}function rE(e){return!e||typeof e!="object"?"":Object.values(e).filter(s=>s!==void 0&&s!=="").map(s=>String(s)).join(" ")}const H8=[{animationDelay:"-1.2s",transform:"rotate(.0001deg) translate(146%)"},{animationDelay:"-1.1s",transform:"rotate(30deg) translate(146%)"},{animationDelay:"-1.0s",transform:"rotate(60deg) translate(146%)"},{animationDelay:"-0.9s",transform:"rotate(90deg) translate(146%)"},{animationDelay:"-0.8s",transform:"rotate(120deg) translate(146%)"},{animationDelay:"-0.7s",transform:"rotate(150deg) translate(146%)"},{animationDelay:"-0.6s",transform:"rotate(180deg) translate(146%)"},{animationDelay:"-0.5s",transform:"rotate(210deg) translate(146%)"},{animationDelay:"-0.4s",transform:"rotate(240deg) translate(146%)"},{animationDelay:"-0.3s",transform:"rotate(270deg) translate(146%)"},{animationDelay:"-0.2s",transform:"rotate(300deg) translate(146%)"},{animationDelay:"-0.1s",transform:"rotate(330deg) translate(146%)"}],F8=({size:e=20,color:t="#8f8f8f"})=>u.jsx("div",{style:{width:e,height:e},children:u.jsx("div",{className:"relative left-1/2 top-1/2",style:{width:e,height:e},children:H8.map(s=>u.jsx("div",{className:"absolute -left-[10%] -top-[3.9%] h-[8%] w-[24%] animate-fade-spin rounded-[5px]",style:{backgroundColor:t,...s}},s.transform))})}),V8=[{tiny:"px-1.5 h-6 text-sm",small:"px-1.5 h-8 text-sm",medium:"px-2.5 h-10 text-sm",large:"px-3.5 h-12 text-base"},{tiny:"w-6 h-6 text-sm",small:"w-8 h-8 text-sm",medium:"w-10 h-10 text-sm",large:"w-12 h-12 text-base"}],$8={primary:"bg-gray-1000 hover:bg-gray-1000-h text-background-100 fill-background-100",secondary:"bg-background-100 hover:bg-gray-alpha-200 text-gray-1000 fill-gray-1000 border border-gray-alpha-400",tertiary:"bg-none hover:bg-gray-alpha-200 text-gray-1000 fill-gray-1000",error:"bg-red-800 hover:bg-red-900 text-white fill-white",warning:"bg-amber-800 hover:bg-amber-850 text-black fill-black"},q8={square:{tiny:"rounded",small:"rounded-md",medium:"rounded-md",large:"rounded-lg"},circle:{tiny:"rounded-[100%]",small:"rounded-[100%]",medium:"rounded-[100%]",large:"rounded-[100%]"},rounded:{tiny:"rounded-[100px]",small:"rounded-[100px]",medium:"rounded-[100px]",large:"rounded-[100px]"}},Iu=({size:e="medium",type:t="primary",variant:s="styled",shape:r="square",svgOnly:o=!1,children:l,prefix:d,suffix:f,shadow:m=!1,loading:h=!1,disabled:_=!1,fullWidth:v=!1,className:b,...y})=>u.jsxs("button",{disabled:_,tabIndex:0,className:Xl("flex items-center justify-center gap-0.5 duration-150",V8[+o][e],_||h?"cursor-not-allowed border border-gray-400 bg-gray-100 text-gray-700":$8[t],q8[r][e],m&&"shadow-border-small border-none",v&&"w-full",s==="unstyled"?"h-fit bg-transparent px-0 text-gray-1000 outline-none hover:bg-transparent":"focus:shadow-focus-ring focus:outline-0",b),type:"button",...y,children:[h?u.jsx(F8,{size:e==="large"?24:16}):d,u.jsx("span",{className:Xl("relative overflow-hidden overflow-ellipsis whitespace-nowrap font-sans",e!=="tiny"&&s!=="unstyled"&&"px-1.5"),children:l}),!h&&f]}),K8=({className:e})=>u.jsx("svg",{height:"16",strokeLinejoin:"round",viewBox:"0 0 16 16",width:"16",className:e,children:u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.4697 13.5303L13 14.0607L14.0607 13L13.5303 12.4697L9.06065 7.99999L13.5303 3.53032L14.0607 2.99999L13 1.93933L12.4697 2.46966L7.99999 6.93933L3.53032 2.46966L2.99999 1.93933L1.93933 2.99999L2.46966 3.53032L6.93933 7.99999L2.46966 12.4697L1.93933 13L2.99999 14.0607L3.53032 13.5303L7.99999 9.06065L12.4697 13.5303Z"})}),G8=()=>u.jsx("svg",{height:"16",strokeLinejoin:"round",viewBox:"0 0 16 16",width:"16",className:"fill-gray-1000",children:u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.5 8C13.5 4.96643 11.0257 2.5 7.96452 2.5C5.42843 2.5 3.29365 4.19393 2.63724 6.5H5.25H6V8H5.25H0.75C0.335787 8 0 7.66421 0 7.25V2.75V2H1.5V2.75V5.23347C2.57851 2.74164 5.06835 1 7.96452 1C11.8461 1 15 4.13001 15 8C15 11.87 11.8461 15 7.96452 15C5.62368 15 3.54872 13.8617 2.27046 12.1122L1.828 11.5066L3.03915 10.6217L3.48161 11.2273C4.48831 12.6051 6.12055 13.5 7.96452 13.5C11.0257 13.5 13.5 11.0336 13.5 8Z"})});let hm=null,W8=0;const ei={toasts:[],listeners:new Set,add(e,t,s,r,o,l){const d=W8++,f={id:d,text:e,preserve:s,action:r,onAction:o,onUndoAction:l,type:t};if(!f.preserve){f.remaining=3e3,f.start=Date.now();const m=()=>{this.toasts=this.toasts.filter(h=>h.id!==d),this.notify()};f.timeout=setTimeout(m,f.remaining),f.pause=()=>{f.timeout&&(clearTimeout(f.timeout),f.timeout=void 0,f.remaining-=Date.now()-f.start)},f.resume=()=>{f.timeout||(f.start=Date.now(),f.timeout=setTimeout(m,f.remaining))}}this.toasts.push(f),this.notify()},remove(e){ei.toasts=ei.toasts.filter(t=>t.id!==e),ei.notify()},subscribe(e){return ei.listeners.add(e),()=>{ei.listeners.delete(e)}},notify(){ei.listeners.forEach(e=>{e()})}},Y8=()=>{const[e,t]=E.useState([]),[s,r]=E.useState([]),[o,l]=E.useState(!1),d=x=>w=>{w&&x.measuredHeight==null&&(x.measuredHeight=w.getBoundingClientRect().height,ei.notify())};E.useEffect(()=>(t([...ei.toasts]),ei.subscribe(()=>{t([...ei.toasts])})),[]),E.useEffect(()=>{const x=e.filter(w=>!s.includes(w.id)).map(w=>w.id);x.length>0&&requestAnimationFrame(()=>{r(w=>[...w,...x])})},[s,e]);const m=Math.max(0,e.length-3),h=(x,w)=>{if(x===w-1)return"none";const N=w-1-x;let A=e[w-1]?.measuredHeight||63;for(let M=w-1;M>x;M--)o?A+=(e[M-1]?.measuredHeight||63)+10:A+=20;const R=-N,T=o?1:1-.05*N;return`translate3d(0, calc(100% - ${A}px), ${R}px) scale(${T})`},_=()=>{l(!0),ei.toasts.forEach(x=>{x.pause?.()})},v=()=>{l(!1),ei.toasts.forEach(x=>{x.resume?.()})},y=e.slice(m).reduce((x,w)=>x+(w.measuredHeight??63),0);return u.jsx("div",{className:"pointer-events-none fixed bottom-4 right-4 z-[9999] w-[min(420px,calc(100vw-2rem))]",style:{height:y},children:u.jsx("div",{className:"pointer-events-auto relative w-full",style:{height:y},onMouseEnter:_,onMouseLeave:v,children:e.map((x,w)=>{const N=w>=m;return u.jsx("div",{ref:d(x),className:Xl("absolute bottom-0 right-0 h-fit rounded-xl p-4 leading-[21px] shadow-menu",{message:"bg-geist-background text-gray-1000",success:"bg-blue-700 text-contrast-fg",warning:"bg-amber-800 text-gray-1000 dark:text-gray-100",error:"bg-red-800 text-contrast-fg"}[x.type],N?"opacity-100":"opacity-0",w<m&&"pointer-events-none"),style:{width:"100%",transition:"all .35s cubic-bezier(.25,.75,.6,.98)",transform:s.includes(x.id)?h(w,e.length):"translate3d(0, 100%, 150px) scale(1)"},children:u.jsxs("div",{className:"flex flex-col items-center justify-between text-[.875rem]",children:[u.jsxs("div",{className:"flex h-full w-full items-center justify-between gap-4",children:[u.jsx("span",{children:x.text}),!x.action&&u.jsxs("div",{className:"flex gap-1",children:[x.onUndoAction&&u.jsx(Iu,{type:"tertiary",svgOnly:!0,size:"small",onClick:()=>{x.onUndoAction?.(),ei.remove(x.id)},children:u.jsx(G8,{})}),u.jsx(Iu,{type:"tertiary",svgOnly:!0,size:"small",onClick:()=>ei.remove(x.id),children:u.jsx(K8,{className:{message:"fill-gray-1000",success:"fill-contrast-fg",warning:"fill-gray-1000 dark:fill-gray-100",error:"fill-contrast-fg"}[x.type]})})]})]}),x.action&&u.jsxs("div",{className:"flex w-full items-center justify-end gap-2",children:[u.jsx(Iu,{type:"tertiary",size:"small",onClick:()=>ei.remove(x.id),children:"Dismiss"}),u.jsx(Iu,{type:"primary",size:"small",onClick:()=>{x.onAction?.(),ei.remove(x.id)},children:x.action})]})]})},x.id)})})})},Uu=()=>{if(hm)return;const e=document.createElement("div");e.className="fixed bottom-4 right-4 z-[9999]",document.body.appendChild(e),hm=OS.createRoot(e),hm.render(u.jsx(Y8,{}))},ls=()=>({message:E.useCallback(({text:e,preserve:t,action:s,onAction:r,onUndoAction:o})=>{Uu(),ei.add(e,"message",t,s,r,o)},[]),success:E.useCallback(e=>{Uu(),ei.add(e,"success")},[]),warning:E.useCallback(e=>{Uu(),ei.add(e,"warning")},[]),error:E.useCallback(e=>{Uu(),ei.add(e,"error")},[])});function bt({className:e,type:t,...s}){return u.jsx("input",{type:t,className:pe("flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),...s})}var s0=DS();function zn({children:e,icon:t,onClose:s,title:r,size:o="md"}){return E.useEffect(()=>{function l(d){d.key==="Escape"&&s()}return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[s]),s0.createPortal(u.jsx("div",{className:"fixed inset-0 z-[1000] grid place-items-center bg-black/35 px-4",onMouseDown:s,children:u.jsxs("div",{"aria-modal":"true",className:`flex max-h-[min(760px,calc(100vh-2rem))] w-full flex-col overflow-hidden rounded-lg border border-border bg-card shadow-xl ${o==="lg"?"max-w-3xl":"max-w-lg"}`,onMouseDown:l=>l.stopPropagation(),role:"dialog",children:[u.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-3",children:[u.jsx("div",{className:"flex size-8 items-center justify-center rounded-md border border-border bg-background text-foreground [&_svg]:size-4",children:t}),u.jsx("h2",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:r}),u.jsx(fe,{"aria-label":"Close dialog",onClick:s,size:"icon",type:"button",variant:"ghost",children:u.jsx(rn,{})})]}),u.jsx("div",{className:"min-h-0 overflow-auto p-4",children:e})]})}),document.body)}const X8=[{value:"postgres",label:"Postgres"},{value:"mysql",label:"MySQL"},{value:"sqlite",label:"SQLite"}];function Z8({onClose:e,onSaved:t}){const{error:s,success:r}=ls(),[o,l]=E.useState("postgres"),[d,f]=E.useState(""),[m,h]=E.useState(""),[_,v]=E.useState([]),[b,y]=E.useState({status:"idle"}),[x,w]=E.useState(!1),[N,A]=E.useState(!1);E.useEffect(()=>{U5().then(v).catch(()=>v([]))},[]);function R(U){l(U.engine),h(U.url),y({status:"idle"}),d.trim()||f(Q8(U))}async function T(){if(m.trim()){w(!0),y({status:"idle"});try{const U=await F5({engine:o,url:m.trim()});y(U.ok?{status:"ok",message:"Connected"}:{status:"fail",message:U.error??"Connection failed"})}catch(U){y({status:"fail",message:U instanceof Error?U.message:String(U)})}finally{w(!1)}}}async function M(){if(!d.trim()||!m.trim()){s("Name and connection are both required.");return}A(!0);try{await H5({name:d.trim(),engine:o,url:m.trim()}),r(`Saved connection "${d.trim()}".`),t(),e()}catch(U){s(U instanceof Error?U.message:String(U))}finally{A(!1)}}const z=o==="sqlite";return u.jsx(zn,{icon:u.jsx(oc,{}),onClose:e,title:"Add database connection",children:u.jsxs("div",{className:"flex flex-col gap-4",children:[_.length>0?u.jsxs("section",{children:[u.jsxs("p",{className:"mb-1.5 flex items-center gap-1.5 text-xs font-medium text-muted-foreground",children:[u.jsx(k5,{className:"size-3.5"}),"Found in your services"]}),u.jsx("div",{className:"flex flex-wrap gap-1.5",children:_.map(U=>u.jsxs("button",{type:"button",onClick:()=>R(U),className:"group flex items-center gap-1.5 rounded-md border border-border bg-background px-2 py-1 text-left text-xs transition-colors hover:border-primary hover:bg-muted",title:U.maskedUrl,children:[u.jsx(Ve,{variant:"outline",size:"small",children:U.engine}),u.jsx("span",{className:"font-mono",children:U.service}),u.jsxs("span",{className:"font-mono text-muted-foreground",children:["·",U.key]})]},`${U.service}:${U.key}`))})]}):null,u.jsxs("section",{children:[u.jsx("p",{className:"mb-1.5 text-xs font-medium text-muted-foreground",children:"Engine"}),u.jsx("div",{className:"flex gap-1.5",children:X8.map(U=>u.jsx(fe,{size:"sm",variant:o===U.value?"default":"outline",onClick:()=>{l(U.value),y({status:"idle"})},type:"button",children:U.label},U.value))})]}),u.jsxs("label",{className:"flex flex-col gap-1.5",children:[u.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Name"}),u.jsx(bt,{value:d,onChange:U=>f(U.target.value),placeholder:"e.g. shop-db"})]}),u.jsxs("label",{className:"flex flex-col gap-1.5",children:[u.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:z?"Database file path":"Connection URL"}),u.jsx(bt,{value:m,onChange:U=>{h(U.target.value),y({status:"idle"})},placeholder:z?"/abs/path/to/app.db":o==="mysql"?"mysql://user:pass@host:3306/db":"postgres://user:pass@host:5432/db",className:"font-mono text-xs"}),u.jsx("span",{className:"text-[11px] text-muted-foreground",children:"Read-only. The connection string is stored like a secret and masked in the UI and API."})]}),b.status!=="idle"?u.jsxs("div",{className:`flex items-center gap-1.5 rounded-md border px-2.5 py-1.5 text-xs ${b.status==="ok"?"border-emerald-500/40 text-emerald-600 dark:text-emerald-400":"border-destructive/40 text-destructive"}`,children:[b.status==="ok"?u.jsx(ac,{className:"size-3.5"}):u.jsx(rn,{className:"size-3.5"}),u.jsx("span",{className:"break-all font-mono",children:b.message})]}):null,u.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-border pt-3",children:[u.jsxs(fe,{variant:"outline",size:"sm",onClick:()=>{T()},disabled:x||!m.trim(),type:"button",children:[x?u.jsx(Zs,{className:"animate-spin"}):null,"Test connection"]}),u.jsxs(fe,{size:"sm",onClick:()=>{M()},disabled:N,type:"button",children:[N?u.jsx(Zs,{className:"animate-spin"}):null,"Save"]})]})]})})}function Q8(e){try{const s=new URL(e.url).pathname.replace(/^\//,"");if(s)return`${e.service}-${s}`}catch{}return`${e.service}-${e.engine}`}function J8({connection:e,sample:t}){const{success:s,error:r}=ls();async function o(l){try{const d=K5(e,t.engine,t.table,t.columns,l);await navigator.clipboard.writeText(d),s("Copied row + schema prompt to clipboard.")}catch(d){r(d instanceof Error?d.message:String(d))}}return t.columns.length===0?u.jsx("div",{className:"p-6 text-sm text-muted-foreground",children:"This table has no columns."}):u.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:u.jsxs("table",{className:"w-full border-collapse text-left font-mono text-[11px]",children:[u.jsx("thead",{className:"sticky top-0 z-10 bg-card",children:u.jsxs("tr",{className:"border-b border-border",children:[u.jsx("th",{className:"w-10 px-2 py-2"}),t.columns.map(l=>u.jsxs("th",{className:"whitespace-nowrap px-3 py-2 font-semibold text-foreground",children:[u.jsxs("span",{className:"flex items-center gap-1",children:[l.primaryKey?u.jsx(Nk,{className:"size-3 text-amber-500"}):null,l.name]}),u.jsx("span",{className:"block text-[10px] font-normal text-muted-foreground",children:l.dataType})]},l.name))]})}),u.jsxs("tbody",{children:[t.rows.map((l,d)=>u.jsxs("tr",{className:"group border-b border-border/60 hover:bg-muted/40",children:[u.jsx("td",{className:"px-2 py-1 align-top",children:u.jsx(fe,{size:"icon",variant:"ghost",className:"size-6 opacity-0 transition-opacity group-hover:opacity-100",title:"Explain this row to the agent",onClick:()=>{o(l)},type:"button",children:u.jsx(Wl,{className:"size-3.5"})})}),t.columns.map(f=>u.jsx("td",{className:"max-w-[320px] truncate px-3 py-1 align-top text-muted-foreground",title:Ly(l[f.name]),children:Ly(l[f.name])},f.name))]},d)),t.rows.length===0?u.jsx("tr",{children:u.jsx("td",{colSpan:t.columns.length+1,className:"px-3 py-6 text-center text-muted-foreground",children:"No rows."})}):null]})]})})}function Ly(e){return e==null?"NULL":typeof e=="object"?JSON.stringify(e):String(e)}function eD(){const[e,t]=E.useState([]),[s,r]=E.useState(!0),[o,l]=E.useState(null),d=E.useCallback(async()=>{r(!0),l(null);try{t(await I5())}catch(f){l(f instanceof Error?f.message:String(f))}finally{r(!1)}},[]);return E.useEffect(()=>{d()},[d]),{connections:e,loading:s,error:o,refresh:d}}function tD(e){const[t,s]=E.useState([]),[r,o]=E.useState(null),[l,d]=E.useState(null),[f,m]=E.useState(null),[h,_]=E.useState(null),[v,b]=E.useState(!1),[y,x]=E.useState(!1);return E.useEffect(()=>{if(s([]),o(null),d(null),m(null),_(null),!e)return;let w=!1;return b(!0),$5(e).then(N=>{w||(s(N),o(N[0]?.qualifiedName??null))}).catch(N=>{w||m(N instanceof Error?N.message:String(N))}).finally(()=>{w||b(!1)}),()=>{w=!0}},[e]),E.useEffect(()=>{if(d(null),_(null),!e||!r)return;let w=!1;return x(!0),q5(e,r,100).then(N=>{w||d(N)}).catch(N=>{w||_(N instanceof Error?N.message:String(N))}).finally(()=>{w||x(!1)}),()=>{w=!0}},[e,r]),{tables:t,selectedTable:r,setSelectedTable:o,sample:l,tablesError:f,rowsError:h,loadingTables:v,loadingRows:y}}function iD(){const{connections:e,loading:t,error:s,refresh:r}=eD(),{error:o,success:l}=ls(),[d,f]=E.useState(null),[m,h]=E.useState(!1);E.useEffect(()=>{if(e.length===0){f(null);return}f(v=>v&&e.some(b=>b.name===v)?v:e[0].name)},[e]);async function _(v){try{await V5(v),l(`Removed connection "${v}".`),await r()}catch(b){o(b instanceof Error?b.message:String(b))}}return u.jsxs("div",{className:"flex h-full min-h-0 bg-card/85",children:[u.jsxs("div",{className:"flex w-64 shrink-0 flex-col border-r border-border",children:[u.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(oc,{className:"size-4 text-muted-foreground"}),u.jsx("span",{className:"text-sm font-semibold",children:"Connections"}),u.jsx(Ve,{variant:"outline",size:"small",children:e.length})]}),u.jsxs(fe,{size:"sm",variant:"outline",onClick:()=>h(!0),type:"button",children:[u.jsx(Es,{}),"Add"]})]}),u.jsx("ul",{className:"min-h-0 flex-1 overflow-auto",children:e.map(v=>u.jsx("li",{children:u.jsxs("div",{className:pe("group flex w-full items-center gap-2 px-3 py-2 transition-colors hover:bg-muted/50",v.name===d&&"bg-muted/70"),children:[u.jsxs("button",{type:"button",onClick:()=>f(v.name),className:"flex min-w-0 flex-1 flex-col text-left",children:[u.jsx("span",{className:"truncate text-xs font-semibold",children:v.name}),u.jsx("span",{className:"truncate font-mono text-[10px] text-muted-foreground",children:v.url})]}),u.jsx(Ve,{variant:"outline",size:"small",children:v.engine}),u.jsx(fe,{size:"icon",variant:"ghost",className:"size-6 opacity-0 transition-opacity group-hover:opacity-100",title:`Remove ${v.name}`,onClick:()=>{_(v.name)},type:"button",children:u.jsx(lc,{className:"size-3.5 text-destructive"})})]})},v.name))}),t&&e.length===0?u.jsx("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:"Loading…"}):null]}),u.jsx("div",{className:"min-h-0 flex-1",children:s?u.jsx("div",{className:"p-4",children:u.jsx(ht,{variant:"muted",className:"border-destructive/40 text-destructive",children:s})}):d?u.jsx(sD,{connection:d}):u.jsx(nD,{onAdd:()=>h(!0)})}),m?u.jsx(Z8,{onClose:()=>h(!1),onSaved:r}):null]})}function sD({connection:e}){const{tables:t,selectedTable:s,setSelectedTable:r,sample:o,tablesError:l,rowsError:d,loadingTables:f,loadingRows:m}=tD(e);return u.jsxs("div",{className:"flex h-full min-h-0",children:[u.jsxs("div",{className:"flex w-56 shrink-0 flex-col border-r border-border",children:[u.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-2",children:[u.jsx(x5,{className:"size-4 text-muted-foreground"}),u.jsx("span",{className:"text-sm font-semibold",children:"Tables"}),u.jsx(Ve,{variant:"outline",size:"small",children:t.length}),f?u.jsx(Zs,{className:"size-3.5 animate-spin"}):null]}),l?u.jsx("div",{className:"p-3",children:u.jsx(ht,{variant:"muted",className:"border-destructive/40 text-destructive",children:l})}):u.jsxs("ul",{className:"min-h-0 flex-1 overflow-auto",children:[t.map(h=>u.jsx("li",{children:u.jsx("button",{type:"button",onClick:()=>r(h.qualifiedName),className:pe("w-full truncate px-3 py-1.5 text-left font-mono text-[11px] transition-colors hover:bg-muted/50",h.qualifiedName===s&&"bg-muted/70 font-semibold"),children:h.qualifiedName})},h.qualifiedName)),!f&&t.length===0?u.jsx("li",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No tables."}):null]})]}),u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[u.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-2",children:[u.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:s??"Select a table"}),o?u.jsxs(Ve,{variant:"outline",size:"small",children:[o.rowCount," rows"]}):null]}),d?u.jsx("div",{className:"p-4",children:u.jsx(ht,{variant:"muted",className:"border-destructive/40 text-destructive",children:d})}):m?u.jsxs("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:[u.jsx(Zs,{className:"mr-2 size-4 animate-spin"}),"Loading rows…"]}):o?u.jsx(J8,{connection:e,sample:o}):u.jsx("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:"Pick a table to sample its rows."})]})]})}function nD({onAdd:e}){return u.jsx("div",{className:"flex h-full items-center justify-center p-8 text-center",children:u.jsxs("div",{className:"max-w-sm",children:[u.jsx(oc,{className:"mx-auto size-8 text-muted-foreground/50"}),u.jsx("p",{className:"mt-3 text-sm font-medium",children:"No connections yet"}),u.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["Add a read-only Postgres, MySQL, or SQLite connection to browse tables and sample rows. NoMoreIDE can auto-detect connection strings from your services' ",u.jsx("code",{children:".env"})," files."]}),u.jsxs(fe,{className:"mt-4",size:"sm",onClick:e,type:"button",children:[u.jsx(Es,{}),"Add connection"]})]})})}function rD({incident:e}){const{error:t,success:s}=ls(),[r,o]=E.useState(!1),[l,d]=E.useState(!1),[f,m]=E.useState(!1);async function h(){o(!0);try{const{prompt:v}=await W5(e.id);await navigator.clipboard.writeText(v),d(!0),s("Copied debugging prompt to clipboard."),window.setTimeout(()=>d(!1),2e3)}catch(v){t(v instanceof Error?v.message:String(v))}finally{o(!1)}}async function _(){m(!0);try{const{markdown:v}=await Y5(e.id);await navigator.clipboard.writeText(v),s("Copied repro bundle to clipboard.")}catch(v){t(v instanceof Error?v.message:String(v))}finally{m(!1)}}return u.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[u.jsxs("div",{className:"shrink-0 border-b border-border px-4 py-3",children:[u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[u.jsx(Ve,{variant:e.level==="error"?"danger":"secondary",appearance:"subtle",size:"small",children:e.level}),u.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:e.service}),e.count>1?u.jsxs(Ve,{variant:"outline",size:"small",children:["×",e.count]}):null]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs(fe,{onClick:()=>{_()},disabled:f,size:"sm",variant:"outline",children:[u.jsx(Ik,{}),f?"Bundling…":"Copy repro bundle"]}),u.jsxs(fe,{onClick:()=>{h()},disabled:r,size:"sm",children:[l?u.jsx(ac,{}):u.jsx(IN,{}),l?"Copied":"Copy to agent"]})]})]}),u.jsx("p",{className:"mt-1.5 break-words font-mono text-xs text-foreground",children:e.title}),e.file?u.jsxs("p",{className:"mt-1 flex items-center gap-1.5 font-mono text-[11px] text-muted-foreground",children:[u.jsx(nk,{className:"size-3.5"}),e.file,e.line?`:${e.line}`:""]}):null,u.jsxs("p",{className:"mt-1 font-mono text-[10px] text-muted-foreground/80",children:["first ",new Date(e.firstSeen).toLocaleString()," · last"," ",new Date(e.lastSeen).toLocaleTimeString()]})]}),u.jsxs("div",{className:"min-h-0 flex-1 overflow-auto p-4",children:[u.jsx("p",{className:"mb-1.5 text-xs font-medium text-muted-foreground",children:"Log excerpt"}),u.jsx("pre",{className:"overflow-x-auto rounded-md border border-border bg-muted/40 p-3 font-mono text-[11px] leading-relaxed",children:e.logExcerpt.join(`
|
|
17
|
-
`)}),u.jsx("p",{className:"mt-3 text-[11px] text-muted-foreground",children:'"Copy to agent" bundles this excerpt with the affected file\'s diff and the last 40 log lines. "Copy repro bundle" adds the service\'s runtime state and masked `.env` for sharing.'})]})]})}function jy(e){return[...e].sort((t,s)=>t.lastSeen<s.lastSeen?1:t.lastSeen>s.lastSeen?-1:s.id-t.id)}function aD(){const[e,t]=E.useState([]),[s,r]=E.useState(!1),[o,l]=E.useState(null),d=E.useCallback(f=>{t(m=>jy([...m.filter(h=>h.id!==f.id),f]))},[]);return E.useEffect(()=>{let f=!0;G5().then(h=>{f&&t(jy(h))}).catch(h=>{f&&l(h instanceof Error?h.message:String(h))});const m=new EventSource("/api/errors/stream");return m.addEventListener("open",()=>r(!0)),m.addEventListener("error",()=>r(!1)),m.addEventListener("incident",h=>{try{const _=JSON.parse(h.data);d(_)}catch{}}),()=>{f=!1,m.close()}},[d]),{incidents:e,connected:s,error:o}}function oD(){const{incidents:e,connected:t,error:s}=aD(),[r,o]=E.useState(null);E.useEffect(()=>{if(e.length===0){o(null);return}o(d=>d!==null&&e.some(f=>f.id===d)?d:e[0].id)},[e]);const l=E.useMemo(()=>e.find(d=>d.id===r)??null,[e,r]);return u.jsxs("div",{className:"flex h-full min-h-0 bg-card/85",children:[u.jsxs("div",{className:"flex w-72 shrink-0 flex-col border-r border-border",children:[u.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(fp,{className:"size-4 text-muted-foreground"}),u.jsx("span",{className:"text-sm font-semibold",children:"Incidents"}),u.jsx(Ve,{variant:"outline",size:"small",children:e.length})]}),u.jsx(Ve,{variant:"outline",size:"small",icon:u.jsx("span",{className:pe("inline-block size-1.5 rounded-full",t?"animate-pulse bg-emerald-500":"bg-muted-foreground/60")}),children:t?"live":"reconnecting…"})]}),u.jsx("ul",{className:"min-h-0 flex-1 divide-y divide-border overflow-auto",children:e.map(d=>u.jsx("li",{children:u.jsxs("button",{type:"button",onClick:()=>o(d.id),className:pe("flex w-full flex-col gap-1 px-3 py-2 text-left transition-colors hover:bg-muted/50",d.id===r&&"bg-muted/70"),children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx("span",{className:"truncate font-mono text-[11px] font-semibold",children:d.service}),u.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[d.count>1?u.jsxs(Ve,{variant:"outline",size:"small",children:["×",d.count]}):null,u.jsx(Ve,{variant:d.level==="error"?"danger":"secondary",appearance:"subtle",size:"small",children:d.level})]})]}),u.jsx("span",{className:"truncate font-mono text-[11px] text-muted-foreground",children:d.title}),u.jsx("span",{className:"font-mono text-[10px] text-muted-foreground/70",children:new Date(d.lastSeen).toLocaleTimeString()})]})},d.id))})]}),u.jsx("div",{className:"min-h-0 flex-1",children:s?u.jsx("div",{className:"p-4",children:u.jsxs(ht,{variant:"muted",className:"border-destructive/40 text-destructive",children:["Failed to load incidents: ",s]})}):l?u.jsx(rD,{incident:l}):u.jsx("div",{className:"flex h-full items-center justify-center p-8 text-center",children:u.jsxs("div",{className:"max-w-sm",children:[u.jsx(fp,{className:"mx-auto size-8 text-muted-foreground/50"}),u.jsx("p",{className:"mt-3 text-sm font-medium",children:"No incidents yet"}),u.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Errors and stack traces from your running services land here automatically. Each one becomes a one-click prompt for your agent."})]})})})]})}const lD={top:"bottom-full left-1/2 mb-1.5 -translate-x-1/2",bottom:"top-full left-1/2 mt-1.5 -translate-x-1/2",left:"right-full top-1/2 mr-1.5 -translate-y-1/2",right:"left-full top-1/2 ml-1.5 -translate-y-1/2"};function Er({label:e,children:t,side:s="bottom",className:r}){return u.jsxs("span",{className:pe("group/tt relative inline-flex",r),children:[t,u.jsx("span",{role:"tooltip",className:pe("pointer-events-none absolute z-[1100] whitespace-nowrap rounded-md bg-foreground px-2 py-1 text-xs font-medium text-background shadow-md","opacity-0 transition-opacity duration-150 group-hover/tt:opacity-100",lD[s]),children:e})]})}function cD({context:e}){const[t,s]=E.useState(!1);if(!e)return u.jsx("div",{className:"rounded-md border border-border bg-muted/30 p-3 text-xs text-muted-foreground",children:"No agent context available yet."});async function r(){try{await navigator.clipboard.writeText(e),s(!0),window.setTimeout(()=>s(!1),1500)}catch{s(!1)}}return u.jsxs("section",{"aria-label":"Agent context",className:"rounded-md border border-border bg-muted/30 p-3","data-testid":"agent-context-panel",children:[u.jsxs("div",{className:"flex items-center justify-between gap-3",children:[u.jsxs("h3",{className:"flex items-center gap-1.5 text-xs font-medium",children:[u.jsx(Wl,{className:"size-3.5"}),"Agent context"]}),u.jsxs(fe,{onClick:r,size:"sm",type:"button",variant:"outline",children:[t?u.jsx(ac,{className:"size-3.5"}):u.jsx(BS,{className:"size-3.5"}),t?"Copied":"Copy"]})]}),u.jsx("pre",{className:"mt-2 max-h-72 overflow-auto whitespace-pre-wrap rounded bg-background p-3 font-mono text-[11px] leading-relaxed",children:e})]})}function ys({className:e,...t}){return u.jsx("label",{className:pe("grid gap-1.5 text-xs font-medium text-muted-foreground",e),...t})}const ks='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>',Ts='</title><path d="',Ms='"/></svg>',uD={title:".NET",slug:"dotnet",get svg(){return ks+".NET"+Ts+this.path+Ms},path:"M24 8.77h-2.468v7.565h-1.425V8.77h-2.462V7.53H24zm-6.852 7.565h-4.821V7.53h4.63v1.24h-3.205v2.494h2.953v1.234h-2.953v2.604h3.396zm-6.708 0H8.882L4.78 9.863a2.896 2.896 0 0 1-.258-.51h-.036c.032.189.048.592.048 1.21v5.772H3.157V7.53h1.659l3.965 6.32c.167.261.275.442.323.54h.024c-.04-.233-.06-.629-.06-1.185V7.529h1.372zm-8.703-.693a.868.829 0 0 1-.869.829.868.829 0 0 1-.868-.83.868.829 0 0 1 .868-.828.868.829 0 0 1 .869.829Z",source:"https://github.com/dotnet/brand/blob/c7d0f51b8ec59531332d05fb27a5b758a7a3d689/logo/dotnet-logo.svg",hex:"512BD4",guidelines:"https://github.com/dotnet/brand/blob/c7d0f51b8ec59531332d05fb27a5b758a7a3d689/dotnet-styleGuide-2024.pdf",license:{type:"CC0-1.0",url:"https://spdx.org/licenses/CC0-1.0"}},dD={title:"Bun",slug:"bun",get svg(){return ks+"Bun"+Ts+this.path+Ms},path:"M12 22.596c6.628 0 12-4.338 12-9.688 0-3.318-2.057-6.248-5.219-7.986-1.286-.715-2.297-1.357-3.139-1.89C14.058 2.025 13.08 1.404 12 1.404c-1.097 0-2.334.785-3.966 1.821a49.92 49.92 0 0 1-2.816 1.697C2.057 6.66 0 9.59 0 12.908c0 5.35 5.372 9.687 12 9.687v.001ZM10.599 4.715c.334-.759.503-1.58.498-2.409 0-.145.202-.187.23-.029.658 2.783-.902 4.162-2.057 4.624-.124.048-.199-.121-.103-.209a5.763 5.763 0 0 0 1.432-1.977Zm2.058-.102a5.82 5.82 0 0 0-.782-2.306v-.016c-.069-.123.086-.263.185-.172 1.962 2.111 1.307 4.067.556 5.051-.082.103-.23-.003-.189-.126a5.85 5.85 0 0 0 .23-2.431Zm1.776-.561a5.727 5.727 0 0 0-1.612-1.806v-.014c-.112-.085-.024-.274.114-.218 2.595 1.087 2.774 3.18 2.459 4.407a.116.116 0 0 1-.049.071.11.11 0 0 1-.153-.026.122.122 0 0 1-.022-.083 5.891 5.891 0 0 0-.737-2.331Zm-5.087.561c-.617.546-1.282.76-2.063 1-.117 0-.195-.078-.156-.181 1.752-.909 2.376-1.649 2.999-2.778 0 0 .155-.118.188.085 0 .304-.349 1.329-.968 1.874Zm4.945 11.237a2.957 2.957 0 0 1-.937 1.553c-.346.346-.8.565-1.286.62a2.178 2.178 0 0 1-1.327-.62 2.955 2.955 0 0 1-.925-1.553.244.244 0 0 1 .064-.198.234.234 0 0 1 .193-.069h3.965a.226.226 0 0 1 .19.07c.05.053.073.125.063.197Zm-5.458-2.176a1.862 1.862 0 0 1-2.384-.245 1.98 1.98 0 0 1-.233-2.447c.207-.319.503-.566.848-.713a1.84 1.84 0 0 1 1.092-.11c.366.075.703.261.967.531a1.98 1.98 0 0 1 .408 2.114 1.931 1.931 0 0 1-.698.869v.001Zm8.495.005a1.86 1.86 0 0 1-2.381-.253 1.964 1.964 0 0 1-.547-1.366c0-.384.11-.76.32-1.079.207-.319.503-.567.849-.713a1.844 1.844 0 0 1 1.093-.108c.367.076.704.262.968.534a1.98 1.98 0 0 1 .4 2.117 1.932 1.932 0 0 1-.702.868Z",source:"https://bun.sh/press-kit",hex:"000000"},hD={title:"Deno",slug:"deno",get svg(){return ks+"Deno"+Ts+this.path+Ms},path:"M1.105 18.02A11.9 11.9 0 0 1 0 12.985q0-.698.078-1.376a12 12 0 0 1 .231-1.34A12 12 0 0 1 4.025 4.02a12 12 0 0 1 5.46-2.771 12 12 0 0 1 3.428-.23c1.452.112 2.825.477 4.077 1.05a12 12 0 0 1 2.78 1.774 12.02 12.02 0 0 1 4.053 7.078A12 12 0 0 1 24 12.985q0 .454-.036.914a12 12 0 0 1-.728 3.305 12 12 0 0 1-2.38 3.875c-1.33 1.357-3.02 1.962-4.43 1.936a4.4 4.4 0 0 1-2.724-1.024c-.99-.853-1.391-1.83-1.53-2.919a5 5 0 0 1 .128-1.518c.105-.38.37-1.116.76-1.437-.455-.197-1.04-.624-1.226-.829-.045-.05-.04-.13 0-.183a.155.155 0 0 1 .177-.053c.392.134.869.267 1.372.35.66.111 1.484.25 2.317.292 2.03.1 4.153-.813 4.812-2.627s.403-3.609-1.96-4.685-3.454-2.356-5.363-3.128c-1.247-.505-2.636-.205-4.06.582-3.838 2.121-7.277 8.822-5.69 15.032a.191.191 0 0 1-.315.19 12 12 0 0 1-1.25-1.634 12 12 0 0 1-.769-1.404M11.57 6.087c.649-.051 1.214.501 1.31 1.236.13.979-.228 1.99-1.41 2.013-1.01.02-1.315-.997-1.248-1.614.066-.616.574-1.575 1.35-1.635",source:"https://github.com/denoland/docs/blob/5dee713844c7447f80acd4093caa9d350d80bf36/static/img/logo.svg",hex:"000000",guidelines:"https://deno.com/brand",license:{type:"MIT",url:"https://spdx.org/licenses/MIT"}},fD={title:"Docker",slug:"docker",get svg(){return ks+"Docker"+Ts+this.path+Ms},path:"M13.983 11.078h2.119a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.119a.185.185 0 00-.185.185v1.888c0 .102.083.185.185.185m-2.954-5.43h2.118a.186.186 0 00.186-.186V3.574a.186.186 0 00-.186-.185h-2.118a.185.185 0 00-.185.185v1.888c0 .102.082.185.185.185m0 2.716h2.118a.187.187 0 00.186-.186V6.29a.186.186 0 00-.186-.185h-2.118a.185.185 0 00-.185.185v1.887c0 .102.082.185.185.186m-2.93 0h2.12a.186.186 0 00.184-.186V6.29a.185.185 0 00-.185-.185H8.1a.185.185 0 00-.185.185v1.887c0 .102.083.185.185.186m-2.964 0h2.119a.186.186 0 00.185-.186V6.29a.185.185 0 00-.185-.185H5.136a.186.186 0 00-.186.185v1.887c0 .102.084.185.186.186m5.893 2.715h2.118a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.118a.185.185 0 00-.185.185v1.888c0 .102.082.185.185.185m-2.93 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.185.185 0 00-.184.185v1.888c0 .102.083.185.185.185m-2.964 0h2.119a.185.185 0 00.185-.185V9.006a.185.185 0 00-.184-.186h-2.12a.186.186 0 00-.186.186v1.887c0 .102.084.185.186.185m-2.92 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.185.185 0 00-.184.185v1.888c0 .102.082.185.185.185M23.763 9.89c-.065-.051-.672-.51-1.954-.51-.338.001-.676.03-1.01.087-.248-1.7-1.653-2.53-1.716-2.566l-.344-.199-.226.327c-.284.438-.49.922-.612 1.43-.23.97-.09 1.882.403 2.661-.595.332-1.55.413-1.744.42H.751a.751.751 0 00-.75.748 11.376 11.376 0 00.692 4.062c.545 1.428 1.355 2.48 2.41 3.124 1.18.723 3.1 1.137 5.275 1.137.983.003 1.963-.086 2.93-.266a12.248 12.248 0 003.823-1.389c.98-.567 1.86-1.288 2.61-2.136 1.252-1.418 1.998-2.997 2.553-4.4h.221c1.372 0 2.215-.549 2.68-1.009.309-.293.55-.65.707-1.046l.098-.288Z",source:"https://www.docker.com/company/newsroom/media-resources",hex:"2496ED"},mD={title:"Go",slug:"go",get svg(){return ks+"Go"+Ts+this.path+Ms},path:"M1.811 10.231c-.047 0-.058-.023-.035-.059l.246-.315c.023-.035.081-.058.128-.058h4.172c.046 0 .058.035.035.07l-.199.303c-.023.036-.082.07-.117.07zM.047 11.306c-.047 0-.059-.023-.035-.058l.245-.316c.023-.035.082-.058.129-.058h5.328c.047 0 .07.035.058.07l-.093.28c-.012.047-.058.07-.105.07zm2.828 1.075c-.047 0-.059-.035-.035-.07l.163-.292c.023-.035.07-.07.117-.07h2.337c.047 0 .07.035.07.082l-.023.28c0 .047-.047.082-.082.082zm12.129-2.36c-.736.187-1.239.327-1.963.514-.176.046-.187.058-.34-.117-.174-.199-.303-.327-.548-.444-.737-.362-1.45-.257-2.115.175-.795.514-1.204 1.274-1.192 2.22.011.935.654 1.706 1.577 1.835.795.105 1.46-.175 1.987-.77.105-.13.198-.27.315-.434H10.47c-.245 0-.304-.152-.222-.35.152-.362.432-.97.596-1.274a.315.315 0 01.292-.187h4.253c-.023.316-.023.631-.07.947a4.983 4.983 0 01-.958 2.29c-.841 1.11-1.94 1.8-3.33 1.986-1.145.152-2.209-.07-3.143-.77-.865-.655-1.356-1.52-1.484-2.595-.152-1.274.222-2.419.993-3.424.83-1.086 1.928-1.776 3.272-2.02 1.098-.2 2.15-.07 3.096.571.62.41 1.063.97 1.356 1.648.07.105.023.164-.117.2m3.868 6.461c-1.064-.024-2.034-.328-2.852-1.029a3.665 3.665 0 01-1.262-2.255c-.21-1.32.152-2.489.947-3.529.853-1.122 1.881-1.706 3.272-1.95 1.192-.21 2.314-.095 3.33.595.923.63 1.496 1.484 1.648 2.605.198 1.578-.257 2.863-1.344 3.962-.771.783-1.718 1.273-2.805 1.495-.315.06-.63.07-.934.106zm2.78-4.72c-.011-.153-.011-.27-.034-.387-.21-1.157-1.274-1.81-2.384-1.554-1.087.245-1.788.935-2.045 2.033-.21.912.234 1.835 1.075 2.21.643.28 1.285.244 1.905-.07.923-.48 1.425-1.228 1.484-2.233z",source:"https://blog.golang.org/go-brand",hex:"00ADD8",guidelines:"https://blog.golang.org/go-brand"},pD={title:"Node.js",slug:"nodedotjs",get svg(){return ks+"Node.js"+Ts+this.path+Ms},path:"M11.998,24c-0.321,0-0.641-0.084-0.922-0.247l-2.936-1.737c-0.438-0.245-0.224-0.332-0.08-0.383 c0.585-0.203,0.703-0.25,1.328-0.604c0.065-0.037,0.151-0.023,0.218,0.017l2.256,1.339c0.082,0.045,0.197,0.045,0.272,0l8.795-5.076 c0.082-0.047,0.134-0.141,0.134-0.238V6.921c0-0.099-0.053-0.192-0.137-0.242l-8.791-5.072c-0.081-0.047-0.189-0.047-0.271,0 L3.075,6.68C2.99,6.729,2.936,6.825,2.936,6.921v10.15c0,0.097,0.054,0.189,0.139,0.235l2.409,1.392 c1.307,0.654,2.108-0.116,2.108-0.89V7.787c0-0.142,0.114-0.253,0.256-0.253h1.115c0.139,0,0.255,0.112,0.255,0.253v10.021 c0,1.745-0.95,2.745-2.604,2.745c-0.508,0-0.909,0-2.026-0.551L2.28,18.675c-0.57-0.329-0.922-0.945-0.922-1.604V6.921 c0-0.659,0.353-1.275,0.922-1.603l8.795-5.082c0.557-0.315,1.296-0.315,1.848,0l8.794,5.082c0.57,0.329,0.924,0.944,0.924,1.603 v10.15c0,0.659-0.354,1.273-0.924,1.604l-8.794,5.078C12.643,23.916,12.324,24,11.998,24z M19.099,13.993 c0-1.9-1.284-2.406-3.987-2.763c-2.731-0.361-3.009-0.548-3.009-1.187c0-0.528,0.235-1.233,2.258-1.233 c1.807,0,2.473,0.389,2.747,1.607c0.024,0.115,0.129,0.199,0.247,0.199h1.141c0.071,0,0.138-0.031,0.186-0.081 c0.048-0.054,0.074-0.123,0.067-0.196c-0.177-2.098-1.571-3.076-4.388-3.076c-2.508,0-4.004,1.058-4.004,2.833 c0,1.925,1.488,2.457,3.895,2.695c2.88,0.282,3.103,0.703,3.103,1.269c0,0.983-0.789,1.402-2.642,1.402 c-2.327,0-2.839-0.584-3.011-1.742c-0.02-0.124-0.126-0.215-0.253-0.215h-1.137c-0.141,0-0.254,0.112-0.254,0.253 c0,1.482,0.806,3.248,4.655,3.248C17.501,17.007,19.099,15.91,19.099,13.993z",source:"https://nodejs.org/en/about/branding",hex:"5FA04E",guidelines:"https://nodejs.org/en/about/branding"},gD={title:"npm",slug:"npm",get svg(){return ks+"npm"+Ts+this.path+Ms},path:"M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113z",source:"https://www.npmjs.com",hex:"CB3837",guidelines:"https://docs.npmjs.com/policies/logos-and-usage"},_D={title:"pnpm",slug:"pnpm",get svg(){return ks+"pnpm"+Ts+this.path+Ms},path:"M0 0v7.5h7.5V0zm8.25 0v7.5h7.498V0zm8.25 0v7.5H24V0zM2 2h3.5v3.5H2zm8.25 0h3.498v3.5H10.25zm8.25 0H22v3.5h-3.5zM8.25 8.25v7.5h7.498v-7.5zm8.25 0v7.5H24v-7.5zm2 2H22v3.5h-3.5zM0 16.5V24h7.5v-7.5zm8.25 0V24h7.498v-7.5zm8.25 0V24H24v-7.5z",source:"https://pnpm.io/logos",hex:"F69220"},vD={title:"Python",slug:"python",get svg(){return ks+"Python"+Ts+this.path+Ms},path:"M14.25.18l.9.2.73.26.59.3.45.32.34.34.25.34.16.33.1.3.04.26.02.2-.01.13V8.5l-.05.63-.13.55-.21.46-.26.38-.3.31-.33.25-.35.19-.35.14-.33.1-.3.07-.26.04-.21.02H8.77l-.69.05-.59.14-.5.22-.41.27-.33.32-.27.35-.2.36-.15.37-.1.35-.07.32-.04.27-.02.21v3.06H3.17l-.21-.03-.28-.07-.32-.12-.35-.18-.36-.26-.36-.36-.35-.46-.32-.59-.28-.73-.21-.88-.14-1.05-.05-1.23.06-1.22.16-1.04.24-.87.32-.71.36-.57.4-.44.42-.33.42-.24.4-.16.36-.1.32-.05.24-.01h.16l.06.01h8.16v-.83H6.18l-.01-2.75-.02-.37.05-.34.11-.31.17-.28.25-.26.31-.23.38-.2.44-.18.51-.15.58-.12.64-.1.71-.06.77-.04.84-.02 1.27.05zm-6.3 1.98l-.23.33-.08.41.08.41.23.34.33.22.41.09.41-.09.33-.22.23-.34.08-.41-.08-.41-.23-.33-.33-.22-.41-.09-.41.09zm13.09 3.95l.28.06.32.12.35.18.36.27.36.35.35.47.32.59.28.73.21.88.14 1.04.05 1.23-.06 1.23-.16 1.04-.24.86-.32.71-.36.57-.4.45-.42.33-.42.24-.4.16-.36.09-.32.05-.24.02-.16-.01h-8.22v.82h5.84l.01 2.76.02.36-.05.34-.11.31-.17.29-.25.25-.31.24-.38.2-.44.17-.51.15-.58.13-.64.09-.71.07-.77.04-.84.01-1.27-.04-1.07-.14-.9-.2-.73-.25-.59-.3-.45-.33-.34-.34-.25-.34-.16-.33-.1-.3-.04-.25-.02-.2.01-.13v-5.34l.05-.64.13-.54.21-.46.26-.38.3-.32.33-.24.35-.2.35-.14.33-.1.3-.06.26-.04.21-.02.13-.01h5.84l.69-.05.59-.14.5-.21.41-.28.33-.32.27-.35.2-.36.15-.36.1-.35.07-.32.04-.28.02-.21V6.07h2.09l.14.01zm-6.47 14.25l-.23.33-.08.41.08.41.23.33.33.23.41.08.41-.08.33-.23.23-.33.08-.41-.08-.41-.23-.33-.33-.23-.41-.08-.41.08z",source:"https://www.python.org/community/logos/",hex:"3776AB",guidelines:"https://www.python.org/community/logos/"},By={title:"Rust",slug:"rust",get svg(){return ks+"Rust"+Ts+this.path+Ms},path:"M23.8346 11.7033l-1.0073-.6236a13.7268 13.7268 0 00-.0283-.2936l.8656-.8069a.3483.3483 0 00-.1154-.578l-1.1066-.414a8.4958 8.4958 0 00-.087-.2856l.6904-.9587a.3462.3462 0 00-.2257-.5446l-1.1663-.1894a9.3574 9.3574 0 00-.1407-.2622l.49-1.0761a.3437.3437 0 00-.0274-.3361.3486.3486 0 00-.3006-.154l-1.1845.0416a6.7444 6.7444 0 00-.1873-.2268l.2723-1.153a.3472.3472 0 00-.417-.4172l-1.1532.2724a14.0183 14.0183 0 00-.2278-.1873l.0415-1.1845a.3442.3442 0 00-.49-.328l-1.076.491c-.0872-.0476-.1742-.0952-.2623-.1407l-.1903-1.1673A.3483.3483 0 0016.256.955l-.9597.6905a8.4867 8.4867 0 00-.2855-.086l-.414-1.1066a.3483.3483 0 00-.5781-.1154l-.8069.8666a9.2936 9.2936 0 00-.2936-.0284L12.2946.1683a.3462.3462 0 00-.5892 0l-.6236 1.0073a13.7383 13.7383 0 00-.2936.0284L9.9803.3374a.3462.3462 0 00-.578.1154l-.4141 1.1065c-.0962.0274-.1903.0567-.2855.086L7.744.955a.3483.3483 0 00-.5447.2258L7.009 2.348a9.3574 9.3574 0 00-.2622.1407l-1.0762-.491a.3462.3462 0 00-.49.328l.0416 1.1845a7.9826 7.9826 0 00-.2278.1873L3.8413 3.425a.3472.3472 0 00-.4171.4171l.2713 1.1531c-.0628.075-.1255.1509-.1863.2268l-1.1845-.0415a.3462.3462 0 00-.328.49l.491 1.0761a9.167 9.167 0 00-.1407.2622l-1.1662.1894a.3483.3483 0 00-.2258.5446l.6904.9587a13.303 13.303 0 00-.087.2855l-1.1065.414a.3483.3483 0 00-.1155.5781l.8656.807a9.2936 9.2936 0 00-.0283.2935l-1.0073.6236a.3442.3442 0 000 .5892l1.0073.6236c.008.0982.0182.1964.0283.2936l-.8656.8079a.3462.3462 0 00.1155.578l1.1065.4141c.0273.0962.0567.1914.087.2855l-.6904.9587a.3452.3452 0 00.2268.5447l1.1662.1893c.0456.088.0922.1751.1408.2622l-.491 1.0762a.3462.3462 0 00.328.49l1.1834-.0415c.0618.0769.1235.1528.1873.2277l-.2713 1.1541a.3462.3462 0 00.4171.4161l1.153-.2713c.075.0638.151.1255.2279.1863l-.0415 1.1845a.3442.3442 0 00.49.327l1.0761-.49c.087.0486.1741.0951.2622.1407l.1903 1.1662a.3483.3483 0 00.5447.2268l.9587-.6904a9.299 9.299 0 00.2855.087l.414 1.1066a.3452.3452 0 00.5781.1154l.8079-.8656c.0972.0111.1954.0203.2936.0294l.6236 1.0073a.3472.3472 0 00.5892 0l.6236-1.0073c.0982-.0091.1964-.0183.2936-.0294l.8069.8656a.3483.3483 0 00.578-.1154l.4141-1.1066a8.4626 8.4626 0 00.2855-.087l.9587.6904a.3452.3452 0 00.5447-.2268l.1903-1.1662c.088-.0456.1751-.0931.2622-.1407l1.0762.49a.3472.3472 0 00.49-.327l-.0415-1.1845a6.7267 6.7267 0 00.2267-.1863l1.1531.2713a.3472.3472 0 00.4171-.416l-.2713-1.1542c.0628-.0749.1255-.1508.1863-.2278l1.1845.0415a.3442.3442 0 00.328-.49l-.49-1.076c.0475-.0872.0951-.1742.1407-.2623l1.1662-.1893a.3483.3483 0 00.2258-.5447l-.6904-.9587.087-.2855 1.1066-.414a.3462.3462 0 00.1154-.5781l-.8656-.8079c.0101-.0972.0202-.1954.0283-.2936l1.0073-.6236a.3442.3442 0 000-.5892zm-6.7413 8.3551a.7138.7138 0 01.2986-1.396.714.714 0 11-.2997 1.396zm-.3422-2.3142a.649.649 0 00-.7715.5l-.3573 1.6685c-1.1035.501-2.3285.7795-3.6193.7795a8.7368 8.7368 0 01-3.6951-.814l-.3574-1.6684a.648.648 0 00-.7714-.499l-1.473.3158a8.7216 8.7216 0 01-.7613-.898h7.1676c.081 0 .1356-.0141.1356-.088v-2.536c0-.074-.0536-.0881-.1356-.0881h-2.0966v-1.6077h2.2677c.2065 0 1.1065.0587 1.394 1.2088.0901.3533.2875 1.5044.4232 1.8729.1346.413.6833 1.2381 1.2685 1.2381h3.5716a.7492.7492 0 00.1296-.0131 8.7874 8.7874 0 01-.8119.9526zM6.8369 20.024a.714.714 0 11-.2997-1.396.714.714 0 01.2997 1.396zM4.1177 8.9972a.7137.7137 0 11-1.304.5791.7137.7137 0 011.304-.579zm-.8352 1.9813l1.5347-.6824a.65.65 0 00.33-.8585l-.3158-.7147h1.2432v5.6025H3.5669a8.7753 8.7753 0 01-.2834-3.348zm6.7343-.5437V8.7836h2.9601c.153 0 1.0792.1772 1.0792.8697 0 .575-.7107.7815-1.2948.7815zm10.7574 1.4862c0 .2187-.008.4363-.0243.651h-.9c-.09 0-.1265.0586-.1265.1477v.413c0 .973-.5487 1.1846-1.0296 1.2382-.4576.0517-.9648-.1913-1.0275-.4717-.2704-1.5186-.7198-1.8436-1.4305-2.4034.8817-.5599 1.799-1.386 1.799-2.4915 0-1.1936-.819-1.9458-1.3769-2.3153-.7825-.5163-1.6491-.6195-1.883-.6195H5.4682a8.7651 8.7651 0 014.907-2.7699l1.0974 1.151a.648.648 0 00.9182.0213l1.227-1.1743a8.7753 8.7753 0 016.0044 4.2762l-.8403 1.8982a.652.652 0 00.33.8585l1.6178.7188c.0283.2875.0425.577.0425.8717zm-9.3006-9.5993a.7128.7128 0 11.984 1.0316.7137.7137 0 01-.984-1.0316zm8.3389 6.71a.7107.7107 0 01.9395-.3625.7137.7137 0 11-.9405.3635z",source:"https://www.rust-lang.org",hex:"000000",guidelines:"https://www.rust-lang.org/policies/media-guide",license:{type:"CC-BY-SA-4.0",url:"https://spdx.org/licenses/CC-BY-SA-4.0"}},bD={title:"Vite",slug:"vite",get svg(){return ks+"Vite"+Ts+this.path+Ms},path:"M13.056 23.238a.57.57 0 0 1-1.02-.355v-5.202c0-.63-.512-1.143-1.144-1.143H5.148a.57.57 0 0 1-.464-.903l3.777-5.29c.54-.753 0-1.804-.93-1.804H.57a.574.574 0 0 1-.543-.746.6.6 0 0 1 .08-.157L5.008.78a.57.57 0 0 1 .467-.24h14.589a.57.57 0 0 1 .466.903l-3.778 5.29c-.54.755 0 1.806.93 1.806h5.745c.238 0 .424.138.513.322a.56.56 0 0 1-.063.603z",source:"https://github.com/voidzero-dev/community-design-resources/blob/55902097229cf01cf2a4ceb376f992f5cf306756/brand-assets/vite/vite-icon-color-bracketless.svg",hex:"9135FF"},yD={title:"Yarn",slug:"yarn",get svg(){return ks+"Yarn"+Ts+this.path+Ms},path:"M12 0C5.375 0 0 5.375 0 12s5.375 12 12 12 12-5.375 12-12S18.625 0 12 0zm.768 4.105c.183 0 .363.053.525.157.125.083.287.185.755 1.154.31-.088.468-.042.551-.019.204.056.366.19.463.375.477.917.542 2.553.334 3.605-.241 1.232-.755 2.029-1.131 2.576.324.329.778.899 1.117 1.825.278.774.31 1.478.273 2.015a5.51 5.51 0 0 0 .602-.329c.593-.366 1.487-.917 2.553-.931.714-.009 1.269.445 1.353 1.103a1.23 1.23 0 0 1-.945 1.362c-.649.158-.95.278-1.821.843-1.232.797-2.539 1.242-3.012 1.39a1.686 1.686 0 0 1-.704.343c-.737.181-3.266.315-3.466.315h-.046c-.783 0-1.214-.241-1.45-.491-.658.329-1.51.19-2.122-.134a1.078 1.078 0 0 1-.58-1.153 1.243 1.243 0 0 1-.153-.195c-.162-.25-.528-.936-.454-1.946.056-.723.556-1.367.88-1.71a5.522 5.522 0 0 1 .408-2.256c.306-.727.885-1.348 1.32-1.737-.32-.537-.644-1.367-.329-2.21.227-.602.412-.936.82-1.08h-.005c.199-.074.389-.153.486-.259a3.418 3.418 0 0 1 2.298-1.103c.037-.093.079-.185.125-.283.31-.658.639-1.029 1.024-1.168a.94.94 0 0 1 .328-.06zm.006.7c-.507.016-1.001 1.519-1.001 1.519s-1.27-.204-2.266.871c-.199.218-.468.334-.746.44-.079.028-.176.023-.417.672-.371.991.625 2.094.625 2.094s-1.186.839-1.626 1.881c-.486 1.144-.338 2.261-.338 2.261s-.843.732-.899 1.487c-.051.663.139 1.2.343 1.515.227.343.51.176.51.176s-.561.653-.037.931c.477.25 1.283.394 1.71-.037.31-.31.371-1.001.486-1.283.028-.065.12.111.209.199.097.093.264.195.264.195s-.755.324-.445 1.066c.102.246.468.403 1.066.398.222-.005 2.664-.139 3.313-.296.375-.088.505-.283.505-.283s1.566-.431 2.998-1.357c.917-.598 1.293-.76 2.034-.936.612-.148.57-1.098-.241-1.084-.839.009-1.575.44-2.196.825-1.163.718-1.742.672-1.742.672l-.018-.032c-.079-.13.371-1.293-.134-2.678-.547-1.515-1.413-1.881-1.344-1.997.297-.5 1.038-1.297 1.334-2.78.176-.899.13-2.377-.269-3.151-.074-.144-.732.241-.732.241s-.616-1.371-.788-1.483a.271.271 0 0 0-.157-.046z",source:"https://github.com/yarnpkg/assets/blob/76d30ca2aebed5b73ea8131d972218fb860bd32d/yarn-kitten-circle.svg",hex:"2C8EBB",guidelines:"https://github.com/yarnpkg/assets/tree/76d30ca2aebed5b73ea8131d972218fb860bd32d",license:{type:"CC-BY-4.0",url:"https://spdx.org/licenses/CC-BY-4.0"}};function xD(e){const t=e.toLowerCase();return/\bvite\b/.test(t)?qi.vite:/\bcargo\s+/.test(t)?qi.cargo:/\brustc\b/.test(t)?qi.rust:/\bdotnet\b/.test(t)?qi.dotnet:/\bdocker(?:\s+compose|-compose|\s+)/.test(t)?qi.docker:/\bpython3?\b|\buvicorn\b|\bfastapi\b/.test(t)?qi.python:/\bgo\s+(run|test|build)\b|\bair\b/.test(t)?qi.go:/\bbun\b/.test(t)?qi.bun:/\bdeno\b/.test(t)?qi.deno:/\bpnpm\b/.test(t)?qi.pnpm:/\byarn\b/.test(t)?qi.yarn:/\bnpm\b/.test(t)?qi.npm:/\bnode\b/.test(t)?qi.node:qi.generic}const qi={bun:{kind:"bun",label:"Bun"},cargo:{kind:"cargo",label:"Cargo"},deno:{kind:"deno",label:"Deno"},dotnet:{kind:"dotnet",label:".NET"},docker:{kind:"docker",label:"Docker"},generic:{kind:"generic",label:"Process"},go:{kind:"go",label:"Go"},node:{kind:"node",label:"Node"},npm:{kind:"npm",label:"npm"},pnpm:{kind:"pnpm",label:"pnpm"},python:{kind:"python",label:"Python"},rust:{kind:"rust",label:"Rust"},vite:{kind:"vite",label:"Vite"},yarn:{kind:"yarn",label:"Yarn"}};function n0({command:e,compact:t}){const s=xD(e),r=SD[s.kind];return u.jsx("span",{"aria-label":`${s.label} process`,className:pe("inline-flex shrink-0 items-center justify-center rounded-md border bg-white shadow-sm",t?"size-6":"size-7",r?"border-zinc-200":"border-zinc-300 bg-zinc-100 text-zinc-700"),style:r?{color:`#${r.hex}`}:void 0,title:s.label,children:r?u.jsx("svg",{"aria-hidden":"true",className:t?"size-3.5":"size-4",fill:"currentColor",role:"img",viewBox:"0 0 24 24",children:u.jsx("path",{d:r.path})}):u.jsx(WS,{className:t?"size-3.5":"size-4"})})}const SD={bun:dD,cargo:By,deno:hD,dotnet:uD,docker:fD,generic:null,go:mD,node:pD,npm:gD,pnpm:_D,python:vD,rust:By,vite:bD,yarn:yD},wD=[{label:"npm",command:"npm run dev",description:"Node dev server"},{label:"pnpm",command:"pnpm dev",description:"pnpm dev server"},{label:"yarn",command:"yarn dev",description:"Yarn dev server"},{label:"bun",command:"bun dev",description:"Bun dev server"},{label:"Deno",command:"deno task dev",description:"Deno dev task"},{label:"Vite",badgeCommand:"vite",command:"npm run dev -- --host 127.0.0.1",description:"Vite app"},{label:"Go",command:"go run .",description:"Go app"},{label:"Rust",command:"cargo run",description:"Rust app"},{label:".NET",command:"dotnet watch run",description:".NET app"},{label:"Python",command:"python manage.py runserver",description:"Python app"},{label:"Docker",command:"docker compose up",description:"Docker Compose stack"}],zy=[{value:"local",label:"Local",hint:"Run a command in a local working directory."},{value:"docker-compose",label:"Docker Compose",hint:"Bring up a service defined in a docker-compose.yml file."},{value:"ssh",label:"SSH (remote)",hint:"Run a command on a remote host using your local ~/.ssh/config + ssh-agent."}];function ED({result:e}){const t=[...e.stdout,...e.stderr].slice(0,4);return u.jsxs(ht,{variant:e.ok?"default":"destructive",children:[u.jsx("div",{className:"font-medium",children:e.ok?"Command test passed":"Command test failed"}),u.jsx("div",{className:"mt-1 text-xs",children:e.message}),t.length?u.jsx("pre",{className:"mt-2 max-h-24 overflow-auto rounded-md bg-background/80 p-2 font-mono text-[11px] leading-4",children:t.join(`
|
|
18
|
-
`)}):null]})}function r0({active:e,baseUrl:t,compact:s=!1,onRefresh:r,onStarted:o,restartAction:l,solidStart:d=!1,targetLabel:f}){return e?u.jsxs(u.Fragment,{children:[u.jsx(fm,{compact:s,intent:"restart",icon:u.jsx($S,{}),label:"Restart",action:l,targetLabel:f,url:`${t}/restart`,onRefresh:r}),u.jsx(fm,{compact:s,intent:"stop",icon:u.jsx(kd,{}),label:"Stop",targetLabel:f,url:`${t}/stop`,onRefresh:r})]}):u.jsx(fm,{compact:s,intent:d?"startSolid":"start",icon:u.jsx(FS,{}),label:"Start",targetLabel:f,url:`${t}/start`,onRefresh:r,onSuccess:o})}function tc(e,t,s){const r=s instanceof Error?s.message:String(s);return`${e} failed for ${t}: ${r}`}function fm({action:e,compact:t=!1,intent:s="neutral",icon:r,label:o,targetLabel:l,url:d,onRefresh:f,onSuccess:m}){const[h,_]=E.useState(!1),[v,b]=E.useState(null),{error:y,success:x}=ls();async function w(A={}){_(!0);try{e?await e():await Gi(d,A),x(`${o} requested for ${l}.`),await f(),b(null),m?.()}catch(R){R instanceof YS?b(R.conflict):y(tc(o,l,R))}finally{_(!1)}}const N=u.jsxs(fe,{"aria-label":o,className:`${ND[s]} ${t?"size-7":""}`.trim(),disabled:h,onClick:()=>w(),size:t?"icon":"sm",variant:"outline",children:[r,t?null:o]});return u.jsxs(u.Fragment,{children:[t?u.jsx(Er,{label:o,children:N}):N,v?u.jsx(CD,{busy:h,conflict:v,onCancel:()=>b(null),onKillAndStart:()=>w({strategy:"killHolder"}),targetLabel:l}):null]})}function CD({busy:e,conflict:t,onCancel:s,onKillAndStart:r,targetLabel:o}){const l=t.holder,d=`http://localhost:${t.port}/`;return u.jsx(zn,{icon:u.jsx(D5,{}),onClose:e?()=>{}:s,title:`Port ${t.port} is already in use`,children:u.jsxs("div",{className:"space-y-3 p-4 text-sm",children:[u.jsxs("p",{children:[u.jsx("span",{className:"font-medium",children:o})," wants port"," ",u.jsx("span",{className:"font-mono",children:t.port}),", but it's already held by:"]}),u.jsx("pre",{className:"overflow-auto whitespace-pre-wrap rounded border border-border bg-background p-3 font-mono text-xs",children:l?`pid ${l.pid}${l.pgid?` (pgid ${l.pgid})`:""}
|
|
19
|
-
${l.command}`:"unknown process"}),u.jsxs("div",{className:"flex flex-wrap justify-end gap-2 pt-2",children:[u.jsx(fe,{onClick:s,size:"sm",type:"button",variant:"outline",disabled:e,children:"Cancel"}),u.jsxs(fe,{onClick:()=>window.open(d,"_blank","noopener,noreferrer"),size:"sm",type:"button",variant:"outline",disabled:e,children:[u.jsx(zS,{}),"Open in browser"]}),u.jsx(fe,{className:"border-red-600 bg-red-600 text-white hover:bg-red-700",disabled:e||!l,onClick:r,size:"sm",type:"button",children:"Stop holder & start"})]})]})})}const ND={neutral:"",restart:"border-amber-600 bg-amber-600 text-white hover:bg-amber-700",start:"",startSolid:"border-emerald-600 bg-emerald-600 text-white hover:bg-emerald-700",stop:"border-red-600 bg-red-600 text-white hover:bg-red-700"};function kD({cwd:e,onRefresh:t,onSaved:s,initialService:r}){const{error:o,success:l}=ls(),d=!!r,[f,m]=E.useState(r?.kind??"local"),[h,_]=E.useState(r?.name??""),[v,b]=E.useState(r?.command??""),[y,x]=E.useState(r?.cwd??e),[w,N]=E.useState(r?.port?String(r.port):""),[A,R]=E.useState(r?.description??""),[T,M]=E.useState(r?.composeFile??""),[z,U]=E.useState(r?.composeService??""),[j,O]=E.useState(r?.host??""),[K,H]=E.useState(null),[G,J]=E.useState(!1);E.useEffect(()=>{H(null)},[v,y,w,f]);function I(){_(""),b(""),x(e),N(""),R(""),M(""),U(""),O(""),H(null)}async function ee(k){k.preventDefault();try{const F={name:h,kind:f,cwd:y,port:w,description:A};(f==="local"||f==="ssh")&&(F.command=v),f==="docker-compose"&&(F.composeFile=T,F.composeService=z),f==="ssh"&&(F.host=j),await Gi("/api/services",F),d||I(),l(d?`${h} updated.`:`${h} added.`),await t(),s?.()}catch(F){o(tc(d?"Update service":"Add service",h||"service",F))}}async function q(){if(!v.trim()){o("Test command failed for service: command is required.");return}J(!0);try{H(await fT({command:v,cwd:y,port:w}))}catch(k){o(tc("Test command",h||"service",k))}finally{J(!1)}}return{editing:d,kind:f,setKind:m,name:h,setName:_,command:v,setCommand:b,formCwd:y,setFormCwd:x,port:w,setPort:N,description:A,setDescription:R,composeFile:T,setComposeFile:M,composeService:z,setComposeService:U,host:j,setHost:O,testResult:K,testing:G,submit:ee,testCommand:q}}function Py({cwd:e,onRefresh:t,onSaved:s,initialService:r}){const{editing:o,kind:l,setKind:d,name:f,setName:m,command:h,setCommand:_,formCwd:v,setFormCwd:b,port:y,setPort:x,description:w,setDescription:N,composeFile:A,setComposeFile:R,composeService:T,setComposeService:M,host:z,setHost:U,testResult:j,testing:O,submit:K,testCommand:H}=kD({cwd:e,onRefresh:t,onSaved:s,initialService:r}),G=zy.find(q=>q.value===l),J=l==="local"&&h.trim().length>0&&v.trim().length>0,I="grid gap-2 rounded-md border border-border bg-muted/30 p-3",ee="px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground";return u.jsxs("form",{className:"grid gap-3",onSubmit:K,children:[u.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[u.jsxs("fieldset",{className:`${I} sm:col-span-2`,children:[u.jsx("legend",{className:ee,children:"Step 1 · Service kind"}),u.jsx("div",{className:"grid grid-cols-3 gap-1.5",children:zy.map(q=>u.jsx(fe,{className:"justify-center",disabled:o,onClick:()=>d(q.value),size:"sm",type:"button",variant:l===q.value?"default":"outline",children:q.label},q.value))}),u.jsx("p",{className:"text-[11px] text-muted-foreground",children:G.hint})]}),u.jsxs("div",{className:"grid gap-3 sm:col-start-1 sm:row-start-2 sm:self-start",children:[u.jsxs("fieldset",{className:I,children:[u.jsx("legend",{className:ee,children:"Step 2 · Identity"}),u.jsxs(ys,{children:["Name",u.jsx(bt,{className:"h-8 text-sm",name:"name",onChange:q=>m(q.target.value),placeholder:"backend",readOnly:o,required:!0,value:f}),o?u.jsx("span",{className:"text-[11px] text-muted-foreground",children:"Name is the service key and can't be changed here."}):null]}),u.jsxs(ys,{children:["Description",u.jsx(bt,{className:"h-8 text-sm",name:"description",onChange:q=>N(q.target.value),placeholder:"API server",value:w})]})]}),u.jsxs("fieldset",{className:I,children:[u.jsx("legend",{className:ee,children:"Step 4 · Networking (optional)"}),u.jsxs(ys,{children:["Port",u.jsx(bt,{className:"h-8 text-sm",inputMode:"numeric",name:"port",onChange:q=>x(q.target.value),placeholder:"3001",value:y})]})]})]}),l==="local"?u.jsxs("fieldset",{className:`${I} sm:col-start-2 sm:row-start-2 sm:self-start`,children:[u.jsx("legend",{className:ee,children:"Step 3 · Local command"}),u.jsx("div",{className:"grid grid-cols-2 gap-1.5 sm:grid-cols-4",children:wD.map(q=>u.jsxs(fe,{className:"justify-start gap-1.5",onClick:()=>{_(q.command),N(q.description)},size:"sm",type:"button",variant:"outline",children:[u.jsx(n0,{command:q.badgeCommand??q.command,compact:!0}),u.jsx("span",{className:"truncate",children:q.label})]},q.label))}),u.jsxs(ys,{children:["Command",u.jsx(bt,{className:"h-8 font-mono text-sm",name:"command",onChange:q=>_(q.target.value),placeholder:"npm run dev",required:!0,value:h})]}),u.jsxs(ys,{children:["Working Directory",u.jsx(bt,{className:"h-8 font-mono text-sm",name:"cwd",onChange:q=>b(q.target.value),required:!0,value:v})]})]}):null,l==="docker-compose"?u.jsxs("fieldset",{className:`${I} sm:col-start-2 sm:row-start-2 sm:self-start`,children:[u.jsx("legend",{className:ee,children:"Step 3 · Docker Compose target"}),u.jsxs(ys,{children:["Compose Service",u.jsx(bt,{className:"h-8 font-mono text-sm",name:"composeService",onChange:q=>M(q.target.value),placeholder:"api",required:!0,value:T})]}),u.jsxs(ys,{children:["Compose File (optional)",u.jsx(bt,{className:"h-8 font-mono text-sm",name:"composeFile",onChange:q=>R(q.target.value),placeholder:"docker-compose.yml",value:A})]}),u.jsxs(ys,{children:["Working Directory (where compose file lives)",u.jsx(bt,{className:"h-8 font-mono text-sm",name:"cwd",onChange:q=>b(q.target.value),required:!0,value:v})]})]}):null,l==="ssh"?u.jsxs("fieldset",{className:`${I} sm:col-start-2 sm:row-start-2 sm:self-start`,children:[u.jsx("legend",{className:ee,children:"Step 3 · SSH connection"}),u.jsxs(ys,{children:["SSH Host (alias from ~/.ssh/config)",u.jsx(bt,{className:"h-8 font-mono text-sm",name:"host",onChange:q=>U(q.target.value),placeholder:"devbox",required:!0,value:z})]}),u.jsxs(ys,{children:["Remote Command",u.jsx(bt,{className:"h-8 font-mono text-sm",name:"command",onChange:q=>_(q.target.value),placeholder:"npm run dev",required:!0,value:h})]}),u.jsxs(ys,{children:["Remote Working Directory",u.jsx(bt,{className:"h-8 font-mono text-sm",name:"cwd",onChange:q=>b(q.target.value),placeholder:"/srv/app",required:!0,value:v})]}),u.jsxs(ht,{variant:"muted",children:[u.jsx("div",{className:"font-medium",children:"SSH key handling"}),u.jsxs("div",{className:"mt-1 text-xs",children:["NoMoreIDE never stores key files. Add a ",u.jsxs("code",{children:["Host ",z||"<alias>"]})," entry to",u.jsx("code",{children:" ~/.ssh/config"})," with ",u.jsx("code",{children:"HostName"}),", ",u.jsx("code",{children:"User"}),", and"," ",u.jsx("code",{children:"IdentityFile ~/.ssh/your-key.pem"})," (chmod 0600). Make sure"," ",u.jsx("code",{children:"ssh-agent"})," is running or your key is loaded (",u.jsx("code",{children:"ssh-add ~/.ssh/your-key.pem"}),"). NoMoreIDE will run"," ",u.jsxs("code",{children:["ssh ",z||"<alias>"]})," using that config."]})]})]}):null]}),j?u.jsx(ED,{result:j}):null,u.jsxs("div",{className:"flex flex-wrap justify-end gap-2",children:[l==="local"?u.jsxs(fe,{disabled:O||!J,onClick:H,type:"button",variant:"outline",children:[u.jsx(WS,{}),O?"Testing...":"Test Command"]}):null,u.jsx(fe,{type:"submit",children:o?"Save Service":"Add Service"})]})]})}function aE({initialName:e="",initialServices:t=[],onSaved:s,onRefresh:r,originalName:o,services:l,submitLabel:d="Save Group"}){const{error:f,success:m}=ls();async function h(_){_.preventDefault();const v=_.currentTarget,b=new FormData(v),y=String(b.get("name")??""),x=b.getAll("services").map(w=>String(w)).filter(Boolean);try{await Gi("/api/bundles",{name:y,originalName:o,services:x.join(",")}),v.reset(),m(`${y} group saved.`),await r(),s?.()}catch(w){f(tc("Save group",y||"group",w))}}return u.jsxs("form",{className:"grid gap-2.5",onSubmit:h,children:[u.jsxs(ys,{children:["Group name",u.jsx(bt,{className:"h-8 text-sm",defaultValue:e,name:"name",placeholder:"full-stack",required:!0})]}),u.jsxs("fieldset",{className:"grid gap-1.5",children:[u.jsx("legend",{className:"text-xs font-medium",children:"Services"}),l.length?l.map(_=>u.jsxs("label",{className:"flex items-center gap-2 overflow-hidden rounded-md border border-border px-2.5 py-1.5 text-sm",children:[u.jsx("input",{className:"size-4 shrink-0 accent-primary",defaultChecked:t.includes(_.name),name:"services",type:"checkbox",value:_.name}),u.jsx(n0,{command:_.command??"",compact:!0}),u.jsxs("span",{className:"min-w-0 flex-1",children:[u.jsx("span",{className:"block truncate text-sm font-medium",children:_.name}),u.jsx("span",{className:"block truncate font-mono text-[11px] text-muted-foreground",children:_.command??_.kind??""})]})]},_.name)):u.jsx(ht,{variant:"muted",children:"All services are already grouped, or none registered."})]}),u.jsx(fe,{className:"h-8",disabled:!l.length,type:"submit",children:d})]})}function vd({label:e}){return u.jsx(ht,{variant:"muted",className:"m-4 text-center",children:e})}const TD=900*1e3,zl=12,mm=200;function MD({events:e}){const[t,s]=E.useState(null),[r,o]=E.useState(null),{rows:l,windowStart:d,windowEnd:f}=E.useMemo(()=>AD(e),[e]),m=t?l.find(h=>h.service===t)??null:null;return u.jsxs(u.Fragment,{children:[u.jsxs(Js,{className:"rounded-none border-0 border-b border-border bg-transparent",children:[u.jsxs(en,{className:"border-b border-border px-3 py-2",children:[u.jsxs(tn,{className:"flex items-center gap-2",children:[u.jsx(_o,{className:"size-3.5"}),"Runtime Monitor"]}),u.jsx(Ar,{className:"text-xs",children:e.length===0?"No events yet":`${e.length} event${e.length===1?"":"s"} · last 15 min`})]}),u.jsx(sn,{className:"p-0",children:l.length===0?u.jsx(vd,{label:"No runtime timeline events yet."}):u.jsxs("div",{className:"divide-y divide-border",children:[l.map(h=>u.jsx(DD,{onClick:()=>s(h.service),row:h,windowEnd:f,windowStart:d},h.service)),u.jsxs("div",{className:"flex justify-between px-3 py-1.5 font-mono text-[10px] text-muted-foreground",children:[u.jsx("span",{children:bd(d)}),u.jsx("span",{children:"now"})]})]})})]}),m?u.jsx(zn,{icon:u.jsx(_o,{}),onClose:()=>s(null),title:m.service,children:u.jsx(LD,{onSelect:o,row:m})}):null,r?u.jsx(zn,{icon:u.jsx(_o,{}),onClose:()=>o(null),title:r.title,children:u.jsx(jD,{event:r})}):null]})}function AD(e){const t=Date.now(),s=t,r=t-TD;let o=e.filter(m=>{if(m.kind==="service.http")return!1;const h=new Date(m.timestamp).getTime();return!Number.isNaN(h)&&h>=r});o.length===0&&e.length>0?o=e.slice(-mm):o.length>mm&&(o=o.slice(-mm));const l=new Map;for(const m of o){const h=m.service||"·system",_=l.get(h)??[];_.push(m),l.set(h,_)}const d=Math.max(s-r,1);return{rows:Array.from(l.entries()).map(([m,h])=>{const _=[...h].sort((R,T)=>R.timestamp.localeCompare(T.timestamp)),v=new Array(zl).fill(0),b=new Array(zl).fill(null);for(const R of _){const T=new Date(R.timestamp).getTime(),M=Math.max(r,Math.min(s,T)),z=Math.min(zl-1,Math.floor((M-r)/d*zl));v[z]+=1;const U=b[z];b[z]=RD(U,R.severity)}const y=_.filter(R=>R.severity==="error").length,x=_.filter(R=>R.severity==="warning").length,w=_.length-y-x,N=[..._].reverse().find(R=>R.severity!=="info")??null,A=y>0?"error":x>0?"warning":"info";return{service:m,events:_,errors:y,warnings:x,infos:w,buckets:v,bucketSeverity:b,lastNotable:N,worstSeverity:A}}).sort((m,h)=>{const _=b=>b.errors*1e3+b.warnings,v=_(h)-_(m);return v!==0?v:m.service.localeCompare(h.service)}),windowStart:r,windowEnd:s}}function RD(e,t){return e==="error"||t==="error"?"error":e==="warning"||t==="warning"?"warning":"info"}function DD({onClick:e,row:t,windowEnd:s,windowStart:r}){const o=Math.max(1,...t.buckets);return u.jsxs("button",{className:"timeline-service-row block w-full px-3 py-2 text-left transition-colors hover:bg-muted/40 focus:outline-none focus-visible:bg-muted/40","data-testid":"timeline-service-row",onClick:e,type:"button",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[u.jsx("span",{className:pe("size-2 shrink-0 rounded-full",oE(t.worstSeverity))}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium text-foreground",dir:"rtl",children:u.jsx("bdi",{children:t.service})}),t.errors>0?u.jsxs("span",{className:"rounded bg-red-500/15 px-1 font-mono text-[10px] text-red-500",children:[t.errors,"E"]}):null,t.warnings>0?u.jsxs("span",{className:"rounded bg-amber-500/15 px-1 font-mono text-[10px] text-amber-500",children:[t.warnings,"W"]}):null,u.jsx(ga,{className:"size-3 text-muted-foreground"})]}),u.jsx("div",{className:"timeline-density mt-1.5 grid h-3 gap-px","data-testid":"timeline-density",style:{gridTemplateColumns:`repeat(${zl}, minmax(0, 1fr))`},children:t.buckets.map((l,d)=>u.jsx(OD,{count:l,max:o,severity:t.bucketSeverity[d]},d))}),t.lastNotable?u.jsx("div",{className:"mt-1 truncate font-mono text-[10px] text-muted-foreground",children:t.lastNotable.detail??t.lastNotable.title}):u.jsxs("div",{className:"mt-1 truncate text-[10px] text-muted-foreground",children:[t.infos," info ",t.infos===1?"event":"events"]}),u.jsxs("div",{className:"mt-0.5 flex justify-between font-mono text-[9px] text-muted-foreground/60",children:[u.jsx("span",{children:bd(r)}),u.jsx("span",{children:bd(s)})]})]})}function OD({count:e,max:t,severity:s}){if(e===0)return u.jsx("span",{className:"rounded-sm bg-border/60"});const r=Math.min(1,.35+e/t*.65);return u.jsx("span",{className:pe("rounded-sm",BD(s)),style:{opacity:r},title:`${e} event${e===1?"":"s"}`})}function LD({onSelect:e,row:t}){const s=[...t.events].sort((r,o)=>o.timestamp.localeCompare(r.timestamp));return u.jsxs("div",{className:"flex max-h-[480px] flex-col overflow-hidden",children:[u.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-4 py-2 text-xs text-muted-foreground",children:[u.jsxs("span",{children:[t.events.length," events"]}),u.jsx("span",{children:"·"}),u.jsxs("span",{children:[t.errors," error",t.errors===1?"":"s"]}),u.jsx("span",{children:"·"}),u.jsxs("span",{children:[t.warnings," warning",t.warnings===1?"":"s"]})]}),u.jsx("ul",{className:"min-h-0 divide-y divide-border overflow-auto",children:s.map(r=>u.jsx("li",{children:u.jsxs("button",{className:"block w-full px-4 py-2 text-left hover:bg-muted/40 focus:outline-none focus-visible:bg-muted/40",onClick:()=>e(r),type:"button",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:pe("size-2 shrink-0 rounded-full",oE(r.severity))}),u.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium text-foreground",children:r.title}),u.jsx("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground",children:bd(r.timestamp)})]}),r.detail?u.jsx("div",{className:"mt-1 truncate font-mono text-[10px] text-muted-foreground",children:r.detail}):null]})},r.id))})]})}function jD({event:e}){const t=new Date(e.timestamp);return u.jsxs("div",{className:"space-y-3 p-4 text-sm",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx("span",{className:pe("rounded px-1.5 py-0.5 font-mono text-[10px] uppercase text-white",zD(e.severity)),children:e.severity}),u.jsx("span",{className:"rounded border border-border bg-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:e.kind}),e.service?u.jsx("span",{className:"rounded border border-border bg-background px-1.5 py-0.5 font-mono text-[10px] text-foreground",children:e.service}):null]}),u.jsxs("div",{children:[u.jsx("div",{className:"text-xs text-muted-foreground",children:"When"}),u.jsx("div",{className:"font-mono text-xs",children:Number.isNaN(t.getTime())?e.timestamp:t.toLocaleString()})]}),e.detail?u.jsxs("div",{children:[u.jsx("div",{className:"text-xs text-muted-foreground",children:"Detail"}),u.jsx("pre",{className:"mt-1 max-h-72 overflow-auto whitespace-pre-wrap rounded border border-border bg-background p-3 font-mono text-xs",children:e.detail})]}):null]})}function oE(e){return e==="error"?"bg-red-500":e==="warning"?"bg-amber-500":"bg-zinc-400"}function BD(e){return e==="error"?"bg-red-500":e==="warning"?"bg-amber-500":"bg-zinc-500"}function zD(e){return e==="error"?"bg-red-600":e==="warning"?"bg-amber-600":"bg-zinc-700"}function bd(e){const t=typeof e=="number"?new Date(e):new Date(e);return Number.isNaN(t.getTime())?"--:--:--":t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function PD({health:e}){if(!e)return null;const t=e.processTree,s=e.status==="healthy"||e.status==="unknown"?void 0:FD(e.summary);return u.jsxs("div",{className:"mt-1.5 grid min-w-0 gap-2 text-[11px] text-muted-foreground sm:grid-cols-[minmax(0,1fr)_auto] sm:items-center",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[u.jsxs("span",{className:pe("inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md px-2.5 font-medium",ID(e.status)),children:[u.jsx("span",{className:"inline-flex shrink-0",children:u.jsx(_o,{className:"size-3"})}),u.jsx("span",{className:"whitespace-nowrap",children:e.status})]}),s?u.jsx("span",{className:"min-w-0 truncate",children:s}):null]}),t?u.jsxs("div",{className:"health-metrics flex min-w-max items-center gap-2 font-mono sm:justify-end",children:[u.jsxs("span",{className:"inline-flex items-center gap-1 font-mono",children:[u.jsx(KN,{className:"size-3"}),t.processCount," ",t.processCount===1?"process":"processes"]}),u.jsxs("span",{children:[HD(t.cpuPercent)," CPU"]}),u.jsxs("span",{className:"inline-flex items-center gap-1 font-mono",children:[u.jsx(Ok,{className:"size-3"}),UD(t.rssMb)," RAM"]})]}):null]})}function ID(e){return e==="healthy"?"bg-emerald-600 text-white":e==="warning"?"bg-amber-600 text-white":e==="unhealthy"?"bg-red-600 text-white":"bg-zinc-700 text-white"}function UD(e){return Number.isInteger(e)?`${e} MB`:`${e.toFixed(1)} MB`}function HD(e){return`${e.toFixed(1)}%`}function FD(e){return e.replace(/^Recent error log:\s*/i,"Recent stderr: ").replace(/:\s*\d+(?:\.\d+)? MB RSS\.?$/i,"").replace(/\s+RSS\.?$/i,"")}function VD({ports:e}){const t=e.filter(r=>r.state==="occupied").length,s=e.filter(r=>r.state==="managed").length;return u.jsxs(Js,{className:"rounded-none border-0 border-b border-border bg-transparent",children:[u.jsxs(en,{className:"border-b border-border px-3 py-2",children:[u.jsxs(tn,{className:"flex items-center gap-2",children:[u.jsx(zk,{className:"size-3.5"}),"Ports"]}),u.jsxs(Ar,{className:"text-xs",children:[s," managed, ",t," occupied by other"]})]}),u.jsx(sn,{className:"p-0",children:e.length?u.jsx("div",{className:"divide-y divide-border",children:e.map(r=>u.jsxs("div",{className:"grid grid-cols-[1fr_auto] items-center gap-2 px-3 py-2",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"font-mono text-xs",children:[":",r.port]}),u.jsx("div",{className:"truncate text-[11px] text-muted-foreground",children:r.services.join(", ")||"Unassigned"}),r.urls[0]?u.jsx("div",{className:"truncate font-mono text-[10px] text-muted-foreground",children:r.urls[0]}):null]}),u.jsx($D,{port:r})]},r.port))}):u.jsx(vd,{label:"No configured ports yet."})})]})}function $D({compact:e,port:t}){const s=t.state==="managed"?"managed":t.state==="occupied"?"occupied by other":"available",r=t.state==="managed"?"success":t.state==="occupied"?"warning":"outline";return u.jsx(Ve,{className:pe(e&&"max-w-36 truncate"),variant:r,children:s})}function qD({onChange:e,value:t}){return u.jsxs("label",{className:"relative block",children:[u.jsx(c5,{className:"pointer-events-none absolute left-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground"}),u.jsx(bt,{"aria-label":"Search logs",className:"h-8 w-44 pl-7 text-xs",onChange:s=>e(s.target.value),placeholder:"Search logs",value:t})]})}function KD({className:e,containerRef:t,emptyText:s,logs:r,query:o}){return u.jsx("div",{className:pe("h-full max-w-full overflow-auto font-mono text-[11px] leading-5",e),ref:t,role:"log",children:r.length?r.map((l,d)=>u.jsxs("div",{className:pe("grid min-w-max grid-cols-[168px_minmax(420px,1fr)] gap-2 border-b border-border/45 px-3 py-0.5",l.stream==="stderr"?"bg-red-50/70 text-red-800":"bg-emerald-50/35 text-zinc-800"),children:[u.jsx("span",{className:"text-muted-foreground",children:l.timestamp}),u.jsxs("span",{className:"whitespace-pre-wrap break-words",children:[l.stream==="stderr"?u.jsx("span",{className:"mr-2 rounded bg-red-100 px-1 font-semibold uppercase text-red-700",children:"stderr"}):null,WD(l.text,o)]})]},`${l.timestamp}-${l.stream}-${d}`)):u.jsx("div",{className:"p-3 text-muted-foreground",children:s})})}function GD(e){return`${e.timestamp} ${e.stream} ${e.text}`}function WD(e,t){const s=t.trim();if(!s)return e;const r=e.toLowerCase(),o=s.toLowerCase(),l=[];let d=0,f=r.indexOf(o);for(;f!==-1;){f>d&&l.push(e.slice(d,f));const m=f+s.length;l.push(u.jsx("mark",{className:"rounded bg-amber-200 px-0.5 text-amber-950",children:e.slice(f,m)},`${f}-${m}`)),d=m,f=r.indexOf(o,d)}return d<e.length&&l.push(e.slice(d)),l}function Iy(e){return`${e.kind}:${e.name}`}function YD(e,t=!1,s={}){const[r,o]=E.useState(),[l,d]=E.useState(),[f,m]=E.useState(e.kind==="source"),h=JSON.stringify(s);return E.useEffect(()=>{o(void 0),d(void 0);let _=!1;const v=async()=>{try{if(e.kind==="service"){const y=await QS(e.name,s);_||(o(y.logs),m(y.queryable),d(void 0))}else{const y=await XS(e.name,s);_||(o(y),m(!0),d(void 0))}}catch(y){_||d(y instanceof Error?y.message:String(y))}};v();const b=window.setInterval(v,t?1e3:2e3);return()=>{_=!0,window.clearInterval(b)}},[e.kind,e.name,t,h]),{logs:r,error:l,queryable:f}}const XD=[{label:"Live tail",value:""},{label:"Last 15 min",value:"15 min ago"},{label:"Last hour",value:"1 hour ago"},{label:"Today",value:"today"},{label:"Last 24h",value:"1 day ago"},{label:"Last 7 days",value:"7 days ago"}];function lE({target:e,query:t,setQuery:s,streaming:r,setStreaming:o,hideStdout:l,setHideStdout:d,fill:f=!1,leading:m,trailing:h}){const _=e.kind==="source",[v,b]=E.useState(""),[y,x]=E.useState(""),[w,N]=E.useState(t);E.useEffect(()=>{const Z=window.setTimeout(()=>N(t),300);return()=>window.clearTimeout(Z)},[t]);const A=E.useMemo(()=>{const Z={};v&&(Z.since=v),y&&(Z.level=y);const W=w.trim();return W&&(Z.grep=W),Z},[v,y,w]),{logs:R,error:T,queryable:M}=YD(e,r,A),z=_||M,U=E.useRef(null),j=E.useRef(!0),[O,K]=E.useState([]),[H,G]=E.useState(!1),J=JSON.stringify(A);E.useEffect(()=>{K([])},[J,e.kind,e.name]);const I=E.useMemo(()=>{const Z=R??[];if(O.length===0)return Z;const W=new Set(O.map(D=>D.cursor).filter(Boolean));return[...O,...Z.filter(D=>!D.cursor||!W.has(D.cursor))]},[R,O]),ee=(O[0]??(R??[])[0])?.cursor;async function q(){if(!(!z||!ee||H)){G(!0),j.current=!1;try{const Z={...A,before:ee,lines:200},W=e.kind==="source"?await XS(e.name,Z):(await QS(e.name,Z)).logs;W.length&&K(D=>{const ie=new Set(D.map(le=>le.cursor).filter(Boolean));return[...W.filter(le=>!le.cursor||!ie.has(le.cursor)),...D]})}finally{G(!1)}}}const k=t.trim().toLowerCase(),F=E.useMemo(()=>{let Z=I;return l&&(Z=Z.filter(W=>W.stream==="stderr")),k&&(Z=Z.filter(W=>GD(W).toLowerCase().includes(k))),Z},[I,l,k]);E.useEffect(()=>{const Z=U.current;if(!Z)return;const W=()=>{const D=Z.scrollHeight-Z.scrollTop-Z.clientHeight;j.current=D<40};return W(),Z.addEventListener("scroll",W,{passive:!0}),()=>Z.removeEventListener("scroll",W)},[]),E.useEffect(()=>{if(!r||!j.current||F.length===0)return;const Z=U.current;Z&&(Z.scrollTop=Z.scrollHeight)},[r,F]);const V=R?k?`No log lines match "${t.trim()}".`:l?"No stderr output captured.":"No log entries.":"Loading…";return u.jsxs("div",{className:f?"flex h-full min-h-0 flex-col gap-2":"flex flex-col gap-2",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[m,u.jsx(qD,{onChange:s,value:t}),z?u.jsxs(u.Fragment,{children:[u.jsx("select",{"aria-label":"Time range",className:"h-8 rounded-md border border-border bg-background px-2 text-xs",onChange:Z=>b(Z.target.value),value:v,children:XD.map(Z=>u.jsx("option",{value:Z.value,children:Z.label},Z.label))}),u.jsxs("select",{"aria-label":"Level",className:"h-8 rounded-md border border-border bg-background px-2 text-xs",onChange:Z=>x(Z.target.value),value:y,children:[u.jsx("option",{value:"",children:"All levels"}),u.jsx("option",{value:"warn",children:"Warnings+"}),u.jsx("option",{value:"error",children:"Errors"})]})]}):u.jsxs(Uy,{active:l,activeClassName:"border-amber-600 bg-amber-50 text-amber-700",onClick:()=>d(!l),children:[u.jsx(pk,{}),"Errors only"]}),u.jsxs(Uy,{active:r,activeClassName:"border-emerald-600 bg-emerald-50 text-emerald-700",onClick:()=>o(!r),children:[u.jsx(s5,{}),r?"Streaming":"Stream"]}),z&&ee?u.jsxs(fe,{disabled:H,onClick:()=>{q()},size:"sm",type:"button",variant:"outline",children:[u.jsx(Cg,{}),H?"Loading…":"Load older"]}):null,h?u.jsx("div",{className:"ml-auto flex items-center gap-2",children:h}):null]}),T?u.jsx("div",{className:"text-red-600",children:T}):null,u.jsx(KD,{className:pe("rounded border border-border/60",f?"min-h-0 flex-1":"max-h-80"),containerRef:U,emptyText:V,logs:F,query:t})]})}function Uy({active:e,activeClassName:t,children:s,onClick:r}){return u.jsx(fe,{"aria-pressed":e,className:e?t:void 0,onClick:r,size:"sm",type:"button",variant:"outline",children:s})}function ZD(e,t){return e.kind===t.kind&&e.name===t.name}function QD({options:e,target:t,onChange:s,className:r}){const o=e.findIndex(d=>ZD(d.target,t)),l=[...new Set(e.map(d=>d.group))];return u.jsx("select",{"aria-label":"Log source",className:r??"h-8 max-w-44 rounded-md border border-border bg-background px-2 text-xs",onChange:d=>s(e[Number(d.target.value)].target),value:String(o),children:l.map(d=>u.jsx("optgroup",{label:d,children:e.map((f,m)=>f.group===d?u.jsx("option",{value:String(m),children:f.label},`${f.group}:${f.label}`):null)},d))})}function JD({serviceName:e}){const[t,s]=E.useState(""),[r,o]=E.useState(!1),[l,d]=E.useState(!1),[f,m]=E.useState(!1),h=u.jsx(lE,{fill:!0,hideStdout:l,query:t,setHideStdout:d,setQuery:s,setStreaming:o,streaming:r,target:{kind:"service",name:e},trailing:u.jsxs(fe,{onClick:()=>m(_=>!_),size:"sm",type:"button",variant:"outline",children:[f?u.jsx(jk,{}):u.jsx(Rk,{}),f?"Exit":"Expand"]})});return f?u.jsx(cE,{onClose:()=>m(!1),title:`Logs — ${e}`,children:h}):u.jsx("div",{className:"h-[60vh] min-h-[24rem]",children:h})}function cE({title:e,onClose:t,children:s,maxWidthClass:r="max-w-6xl"}){return E.useEffect(()=>{function o(l){l.key==="Escape"&&t()}return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[t]),s0.createPortal(u.jsx("div",{className:"fixed inset-0 z-[1000] bg-black/40 p-4 sm:p-8",onMouseDown:t,children:u.jsxs("div",{"aria-modal":"true",className:`mx-auto flex h-full ${r} flex-col overflow-hidden rounded-lg border border-border bg-card text-xs shadow-xl`,onMouseDown:o=>o.stopPropagation(),role:"dialog",children:[u.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-2",children:[u.jsx("h2",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:e}),u.jsx(fe,{"aria-label":"Close logs",onClick:t,size:"icon",type:"button",variant:"ghost",children:u.jsx(rn,{})})]}),u.jsx("div",{className:"min-h-0 flex-1 p-3",children:s})]})}),document.body)}const e7={journald:"Queries `journalctl -u <unit>` — time range, text, and level filter server-side. Add a host to run it over SSH.",docker:"Queries `docker logs <container>` — time window server-side. Add a host to run it over SSH.",ssh:"Reads via `ssh <host> tail -n 500 <path>` using your ~/.ssh/config + ssh-agent.",file:"Tails an absolute file path on this machine.",command:"Runs the command and treats its output as the log (kubectl logs, …)."};function t7({onClose:e,onAdded:t}){const[s,r]=E.useState(""),[o,l]=E.useState("journald"),[d,f]=E.useState(""),[m,h]=E.useState(""),[_,v]=E.useState(""),[b,y]=E.useState(""),[x,w]=E.useState(""),[N,A]=E.useState(""),[R,T]=E.useState(),[M,z]=E.useState(!1);async function U(){z(!0),T(void 0);try{const j={name:s.trim(),kind:"command"};o==="file"?(j.kind="file",j.path=m.trim()):o==="ssh"?(j.kind="ssh",j.host=d.trim(),j.path=m.trim()):o==="command"?(j.kind="command",j.command=_.trim(),b.trim()&&(j.cwd=b.trim())):o==="journald"?(j.driver="journald",j.unit=x.trim(),d.trim()&&(j.host=d.trim())):o==="docker"&&(j.driver="docker",j.container=N.trim(),d.trim()&&(j.host=d.trim()));const O=await nT(j);t(O,j.name),e()}catch(j){T(j instanceof Error?j.message:String(j))}finally{z(!1)}}return u.jsx(zn,{icon:u.jsx(KS,{}),onClose:e,size:"md",title:"Add log source",children:u.jsxs("form",{className:"flex flex-col gap-3 p-4 text-xs",onSubmit:j=>{j.preventDefault(),U()},children:[u.jsx(On,{label:"Name",children:u.jsx(bt,{autoFocus:!0,onChange:j=>r(j.target.value),placeholder:"PROD",value:s})}),u.jsxs(On,{label:"Type",children:[u.jsxs("select",{className:"h-9 w-full rounded-md border border-border bg-background px-2 text-xs",onChange:j=>l(j.target.value),value:o,children:[u.jsx("option",{value:"journald",children:"systemd journal (journald)"}),u.jsx("option",{value:"docker",children:"Docker container"}),u.jsx("option",{value:"ssh",children:"Remote file (SSH)"}),u.jsx("option",{value:"file",children:"Local file"}),u.jsx("option",{value:"command",children:"Command"})]}),u.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:e7[o]})]}),o==="journald"||o==="docker"?u.jsx(On,{label:"Host (optional — leave blank to run locally)",children:u.jsx(bt,{onChange:j=>f(j.target.value),placeholder:"jobjourney-prod (an alias from ~/.ssh/config)",value:d})}):null,o==="journald"?u.jsx(On,{label:"Unit",children:u.jsx(bt,{onChange:j=>w(j.target.value),placeholder:"jobjourney",value:x})}):null,o==="docker"?u.jsx(On,{label:"Container",children:u.jsx(bt,{onChange:j=>A(j.target.value),placeholder:"brainctl-api",value:N})}):null,o==="ssh"?u.jsx(On,{label:"Host",children:u.jsx(bt,{onChange:j=>f(j.target.value),placeholder:"prod (an alias from ~/.ssh/config)",value:d})}):null,o==="file"||o==="ssh"?u.jsx(On,{label:o==="ssh"?"Remote path":"File path",children:u.jsx(bt,{onChange:j=>h(j.target.value),placeholder:"/var/log/app/out.log",value:m})}):null,o==="command"?u.jsxs(u.Fragment,{children:[u.jsx(On,{label:"Command",children:u.jsx(bt,{onChange:j=>v(j.target.value),placeholder:"kubectl logs -l app=myapp --tail 500",value:_})}),u.jsx(On,{label:"Working directory (optional)",children:u.jsx(bt,{onChange:j=>y(j.target.value),placeholder:"/srv/app",value:b})})]}):null,R?u.jsx("div",{className:"text-red-600",children:R}):null,u.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[u.jsx(fe,{onClick:e,size:"sm",type:"button",variant:"outline",children:"Cancel"}),u.jsx(fe,{disabled:M||!s.trim(),size:"sm",type:"submit",children:M?"Saving…":"Add source"})]})]})})}function On({label:e,children:t}){return u.jsxs("label",{className:"flex flex-col gap-1",children:[u.jsx("span",{className:"font-medium text-muted-foreground",children:e}),t]})}const Hy=4;function i7({services:e,initialService:t,onClose:s}){const[r,o]=E.useState([]),[l,d]=E.useState(!1),[f,m]=E.useState(()=>[0]),[h,_]=E.useState(()=>{const T=t?{kind:"service",name:t}:e[0]?{kind:"service",name:e[0]}:void 0;return T?{0:T}:{}}),v=E.useRef(1);E.useEffect(()=>{let T=!1;return sT().then(M=>{T||o(M)}),()=>{T=!0}},[]);const b=[...e.map(T=>({target:{kind:"service",name:T},label:T,group:"Services"})),...r.map(T=>({target:{kind:"source",name:T.name},label:T.name,group:"Log sources"}))],y=b.map(T=>T.target);function x(){if(f.length>=Hy||y.length===0)return;const T=v.current++,M=new Set(Object.values(h).map(Iy)),z=y.find(U=>!M.has(Iy(U)))??y[0];m(U=>[...U,T]),_(U=>({...U,[T]:z}))}function w(T){m(M=>M.filter(z=>z!==T)),_(M=>{const z={...M};return delete z[T],z})}function N(T,M){_(z=>({...z,[T]:M}))}function A(T,M){o(T);const z=f[0];z!==void 0&&N(z,{kind:"source",name:M})}const R=u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("span",{children:"Logs"}),u.jsxs(fe,{onClick:()=>d(!0),size:"sm",type:"button",variant:"outline",children:[u.jsx(Es,{}),"Add source"]}),u.jsxs(fe,{disabled:f.length>=Hy||y.length===0,onClick:x,size:"sm",type:"button",variant:"outline",children:[u.jsx(Es,{}),"Add pane"]})]});return u.jsxs(u.Fragment,{children:[u.jsx(cE,{maxWidthClass:"max-w-[1500px]",onClose:s,title:R,children:y.length===0?u.jsx("div",{className:"grid h-full place-items-center text-center text-muted-foreground",children:u.jsxs("div",{children:[u.jsx("p",{children:"No services or log sources yet."}),u.jsxs(fe,{className:"mt-2",onClick:()=>d(!0),size:"sm",type:"button",children:[u.jsx(Es,{}),"Add a log source"]})]})}):u.jsx("div",{className:pe("grid h-full min-h-0 gap-3",f.length>1?"lg:grid-cols-2":"grid-cols-1",f.length>2?"lg:grid-rows-2":"grid-rows-1"),children:f.map(T=>u.jsx(s7,{onChangeTarget:M=>N(T,M),onRemove:f.length>1?()=>w(T):void 0,options:b,target:h[T]??y[0]},T))})}),l?u.jsx(t7,{onAdded:A,onClose:()=>d(!1)}):null]})}function s7({options:e,target:t,onChangeTarget:s,onRemove:r}){const[o,l]=E.useState(""),[d,f]=E.useState(!0),[m,h]=E.useState(!1);return u.jsx("div",{className:"flex min-h-0 min-w-0 flex-col rounded-lg border border-border bg-background/60 p-2",children:u.jsx(lE,{fill:!0,hideStdout:m,leading:u.jsx(QD,{onChange:s,options:e,target:t}),query:o,setHideStdout:h,setQuery:l,setStreaming:f,streaming:d,target:t,trailing:r?u.jsx(fe,{"aria-label":"Remove pane",onClick:r,size:"icon",type:"button",variant:"ghost",children:u.jsx(rn,{})}):void 0})})}function n7({rows:e,revealAll:t,onAdd:s,onRemove:r,onUpdate:o}){return e.length===0?u.jsxs("div",{className:"text-muted-foreground",children:["No variables yet."," ",u.jsx("button",{className:"underline",onClick:s,type:"button",children:"Add one"}),"."]}):u.jsx("div",{className:"overflow-x-auto",children:u.jsxs("table",{className:"w-full font-mono text-[11px]",children:[u.jsx("thead",{className:"text-left text-muted-foreground",children:u.jsxs("tr",{children:[u.jsx("th",{className:"py-1 pr-3",children:"Key"}),u.jsx("th",{className:"py-1 pr-3",children:"Value"}),u.jsx("th",{className:"py-1 w-8"})]})}),u.jsx("tbody",{children:e.map((l,d)=>{const f=!l.reveal&&!t;return u.jsxs("tr",{className:"border-t border-border/40",children:[u.jsx("td",{className:"py-1 pr-3 align-top",children:u.jsx("input",{className:"w-full rounded border border-border/60 bg-background px-1.5 py-0.5 font-mono",onChange:m=>o(d,{key:m.target.value}),placeholder:"KEY",spellCheck:!1,value:l.key})}),u.jsx("td",{className:"py-1 pr-3 align-top",children:u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx("input",{className:"w-full rounded border border-border/60 bg-background px-1.5 py-0.5 font-mono",onChange:m=>o(d,{value:m.target.value}),spellCheck:!1,type:f?"password":"text",value:l.value}),u.jsx("button",{className:"text-muted-foreground hover:text-foreground",onClick:()=>o(d,{reveal:!l.reveal}),title:l.reveal||t?"Hide":"Reveal",type:"button",children:l.reveal||t?u.jsx(PS,{size:14}):u.jsx(IS,{size:14})})]})}),u.jsx("td",{className:"py-1 align-top",children:u.jsx("button",{className:"text-muted-foreground hover:text-red-600",onClick:()=>r(d),type:"button",children:u.jsx(lc,{size:14})})})]},d)})})]})})}function r7({serviceName:e,onClose:t,onPick:s}){const[r,o]=E.useState(),[l,d]=E.useState(),[f,m]=E.useState(!0),[h,_]=E.useState();E.useEffect(()=>{let y=!1;return m(!0),d(void 0),(async()=>{try{const x=await cT(e,h);y||o(x)}catch(x){y||d(x instanceof Error?x.message:String(x))}finally{y||m(!1)}})(),()=>{y=!0}},[e,h]);function v(y){if(y.kind==="directory"){_(y.relativePath);return}y.supported&&s(y.relativePath)}function b(){if(!r||r.isRoot)return;const y=r.relativePath,x=y.includes("/")?y.slice(0,y.lastIndexOf("/")):"";_(x||void 0)}return u.jsx(zn,{icon:u.jsx(Nd,{}),onClose:t,size:"lg",title:"Pick a config file",children:u.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[u.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[u.jsxs(fe,{disabled:!r||r.isRoot,onClick:b,size:"sm",type:"button",variant:"outline",children:[u.jsx(Cg,{})," Up"]}),u.jsx("code",{className:"truncate rounded bg-muted px-2 py-1 font-mono",children:r?.relativePath||"./"})]}),l?u.jsx("div",{className:"text-red-600",children:l}):f?u.jsx("div",{className:"text-muted-foreground",children:"Loading…"}):!r||r.entries.length===0?u.jsx("div",{className:"text-muted-foreground",children:"Empty directory."}):u.jsx("div",{className:"max-h-[50vh] overflow-auto rounded border border-border/60",children:u.jsx("ul",{className:"divide-y divide-border/40",children:r.entries.map(y=>{const x=y.kind==="directory",w=x||y.supported;return u.jsx("li",{children:u.jsxs("button",{className:pe("flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs",w?"hover:bg-muted":"cursor-not-allowed text-muted-foreground"),disabled:!w,onClick:()=>v(y),type:"button",children:[x?u.jsx(_a,{size:14}):u.jsx(US,{size:14}),u.jsx("span",{className:"flex-1 truncate font-mono",children:y.name}),!x&&y.format?u.jsx(Ve,{size:"small",variant:"secondary",children:y.format}):null]})},y.relativePath)})})}),u.jsxs("p",{className:"text-xs text-muted-foreground",children:["Only ",u.jsx("code",{children:".env*"}),", ",u.jsx("code",{children:"appsettings*.json"}),", and"," ",u.jsx("code",{children:"application*.yml"})," can be selected. Other files are shown disabled."]})]})})}function uE(e){if(!e.trim())return e;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function a7(e){const{error:t,success:s}=ls(),[r,o]=E.useState([]),[l,d]=E.useState(),[f,m]=E.useState(),[h,_]=E.useState(!0),[v,b]=E.useState(!1),[y,x]=E.useState(!1),[w,N]=E.useState(!1),[A,R]=E.useState();E.useEffect(()=>{let H=!1;return _(!0),R(void 0),(async()=>{try{const G=await uT(e);if(H)return;o(G.files),G.files.length>0?d(J=>J??G.files[0].path):(d(void 0),m(void 0))}catch(G){H||R(G instanceof Error?G.message:String(G))}finally{H||_(!1)}})(),()=>{H=!0}},[e]);const T=E.useCallback(async H=>{b(!0),R(void 0);try{const G=await s1(e,H),J={path:G.path,relativePath:G.relativePath,format:G.format};G.format==="env"?m({info:J,exists:G.exists,rows:G.entries.map(I=>({...I,reveal:!1}))}):m({info:J,exists:G.exists,text:G.format==="json"?uE(G.content):G.content}),N(!1)}catch(G){R(G instanceof Error?G.message:String(G))}finally{b(!1)}},[e]);E.useEffect(()=>{l&&T(l)},[l,T]);function M(H,G){m(J=>{if(!J?.rows)return J;const I=J.rows.map((ee,q)=>q===H?{...ee,...G}:ee);return{...J,rows:I}}),N(!0)}function z(){m(H=>H?.rows?{...H,rows:[...H.rows,{key:"",value:"",secret:!1,reveal:!0}]}:H),N(!0)}function U(H){m(G=>G?.rows?{...G,rows:G.rows.filter((J,I)=>I!==H)}:G),N(!0)}function j(H){m(G=>G&&{...G,text:H}),N(!0)}async function O(){if(f){x(!0);try{if(f.info.format==="env"&&f.rows){const H=await dT(e,f.info.path,f.rows.map(G=>({key:G.key.trim(),value:G.value})));m({info:{path:H.path,relativePath:H.relativePath,format:H.format},exists:H.exists,rows:H.entries.map(G=>({...G,reveal:!1}))}),s(`Saved ${H.entries.length} entries to ${H.relativePath}.`)}else if(f.text!==void 0){const H=await hT(e,f.info.path,f.text);m({info:{path:H.path,relativePath:H.relativePath,format:H.format},exists:H.exists,text:H.content}),s(`Saved ${H.relativePath}.`)}N(!1)}catch(H){t(H instanceof Error?H.message:String(H))}finally{x(!1)}}}async function K(H){try{const G=await s1(e,H),J={path:G.path,relativePath:G.relativePath,format:G.format};return o(I=>I.some(ee=>ee.path===J.path)?I:[...I,J]),d(J.path),s(`Loaded ${J.relativePath}.`),!0}catch(G){return t(G instanceof Error?G.message:String(G)),!1}}return{files:r,selectedPath:l,setSelectedPath:d,loaded:f,loadingList:h,loadingFile:v,saving:y,dirty:w,error:A,addRow:z,removeRow:U,updateRow:M,updateText:j,save:O,pickFile:K}}function o7({serviceName:e}){const{files:t,selectedPath:s,setSelectedPath:r,loaded:o,loadingList:l,loadingFile:d,saving:f,dirty:m,error:h,addRow:_,removeRow:v,updateRow:b,updateText:y,save:x,pickFile:w}=a7(e),[N,A]=E.useState(!1),[R,T]=E.useState(!1);return l?u.jsx("div",{className:"text-muted-foreground",children:"Loading…"}):h&&!o?u.jsx("div",{className:"text-red-600",children:h}):u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx("span",{className:"text-muted-foreground",children:"File:"}),t.length>0?u.jsx("select",{className:"rounded border border-border/60 bg-background px-1.5 py-0.5 font-mono text-xs",onChange:M=>r(M.target.value),value:s??"",children:t.map(M=>u.jsxs("option",{value:M.path,children:[M.relativePath," [",M.format,"]"]},M.path))}):u.jsx("span",{className:"text-muted-foreground",children:"none detected"}),u.jsxs(fe,{onClick:()=>T(!0),size:"sm",type:"button",variant:"outline",children:[u.jsx(Nd,{})," Browse files"]}),o?u.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 font-mono text-muted-foreground",children:o.info.path}):null]}),u.jsxs("div",{className:"flex items-center gap-1",children:[o?.info.format==="env"?u.jsxs(u.Fragment,{children:[u.jsxs(fe,{onClick:()=>A(M=>!M),size:"sm",type:"button",variant:"outline",children:[N?u.jsx(PS,{}):u.jsx(IS,{}),N?"Hide secrets":"Reveal secrets"]}),u.jsxs(fe,{onClick:_,size:"sm",type:"button",variant:"outline",children:[u.jsx(Es,{})," Add"]})]}):null,u.jsxs(fe,{disabled:!m||f||!o,onClick:x,size:"sm",type:"button",children:[u.jsx(qS,{})," ",f?"Saving…":"Save"]})]})]}),h&&!o?u.jsx("div",{className:"text-red-600",children:h}):o?.info.format==="env"&&o.rows?u.jsx("div",{className:pe(d&&"opacity-60 transition-opacity"),children:u.jsx(n7,{revealAll:N,rows:o.rows,onAdd:_,onRemove:v,onUpdate:b})}):o?.text!==void 0?u.jsxs("div",{className:pe("space-y-1",d&&"opacity-60 transition-opacity"),children:[o.info.format==="json"?u.jsx("div",{className:"flex justify-end",children:u.jsx(fe,{onClick:()=>y(uE(o.text??"")),size:"sm",type:"button",variant:"outline",children:"Format JSON"})}):null,u.jsx("textarea",{className:"min-h-[300px] w-full rounded border border-border/60 bg-background p-2 font-mono text-[11px] leading-relaxed",onChange:M=>y(M.target.value),spellCheck:!1,value:o.text})]}):d?u.jsx("div",{className:"text-muted-foreground",children:"Loading file…"}):null,o?u.jsxs("p",{className:"text-muted-foreground",children:[o.info.format==="env"?"Comments and blank lines are preserved.":o.info.format==="json"?"JSON is validated on save.":"YAML is saved as raw text."," ","The running process won't see changes until you restart it."]}):null,R?u.jsx(r7,{onClose:()=>T(!1),onPick:M=>{w(M).then(z=>{z&&T(!1)})},serviceName:e}):null]})}function l7({serviceName:e,status:t,timeline:s,onRefresh:r}){const{error:o,success:l}=ls(),[d,f]=E.useState(!1),m=t?.inspector,h=t?.state==="running",_=E.useMemo(()=>s.filter(y=>y.kind==="service.http"&&y.service===e).map(y=>{const x=y.data??{};return{id:x.id??y.id,startedAt:y.timestamp,method:x.method??"?",path:x.path??"?",status:x.status??0,durationMs:x.durationMs??0,reqBytes:x.reqBytes??0,resBytes:x.resBytes??0}}).slice(-500).reverse(),[s,e]);async function v(y){f(!0);try{await Gi(`/api/services/${encodeURIComponent(e)}/inspector`,{enabled:y?"true":"false"}),await r(),l(y?`HTTP inspector started for ${e}.`:`HTTP inspector stopped for ${e}.`)}catch(x){o(x instanceof Error?x.message:String(x))}finally{f(!1)}}if(!h)return u.jsx("div",{className:"text-muted-foreground",children:"Service is not running."});if(!m?.enabled)return u.jsxs("div",{className:"space-y-2",children:[u.jsx("p",{className:"text-muted-foreground",children:"The HTTP inspector starts a local proxy that forwards traffic to this service and records every request. Hit the inspect URL instead of the original port to see requests appear here. The service itself is not touched."}),u.jsxs(fe,{disabled:d,onClick:()=>v(!0),size:"sm",type:"button",children:[u.jsx(FS,{})," Start HTTP inspector"]})]});const b=m.port?`http://127.0.0.1:${m.port}`:void 0;return u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx("span",{className:"text-muted-foreground",children:"Inspect URL:"}),b?u.jsxs(u.Fragment,{children:[u.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 font-mono",children:b}),u.jsxs(fe,{onClick:()=>{navigator.clipboard.writeText(b),l("Copied inspect URL.")},size:"sm",type:"button",variant:"outline",children:[u.jsx(BS,{})," Copy"]}),u.jsx(fe,{onClick:()=>window.open(b,"_blank","noopener,noreferrer"),size:"sm",type:"button",variant:"outline",children:"Open"})]}):u.jsx("span",{className:"text-muted-foreground",children:"starting…"}),u.jsxs("span",{className:"text-muted-foreground",children:["→ upstream :",m.upstreamPort??"?"]}),u.jsxs(fe,{disabled:d,onClick:()=>v(!1),size:"sm",type:"button",variant:"outline",children:[u.jsx(kd,{})," Stop"]})]}),_.length===0?u.jsx("div",{className:"text-muted-foreground",children:"No requests captured yet. Hit the inspect URL in your browser to see traffic."}):u.jsx("div",{className:"max-h-80 overflow-auto",children:u.jsxs("table",{className:"w-full font-mono text-[11px]",children:[u.jsx("thead",{className:"sticky top-0 bg-muted/60 text-left text-muted-foreground",children:u.jsxs("tr",{children:[u.jsx("th",{className:"py-1 pr-3",children:"Time"}),u.jsx("th",{className:"py-1 pr-3",children:"Method"}),u.jsx("th",{className:"py-1 pr-3",children:"Path"}),u.jsx("th",{className:"py-1 pr-3 text-right",children:"Status"}),u.jsx("th",{className:"py-1 pr-3 text-right",children:"Size"}),u.jsx("th",{className:"py-1 pr-3 text-right",children:"ms"})]})}),u.jsx("tbody",{children:_.map(y=>u.jsxs("tr",{className:"border-t border-border/40",children:[u.jsx("td",{className:"py-1 pr-3 text-muted-foreground",children:new Date(y.startedAt).toLocaleTimeString()}),u.jsx("td",{className:"py-1 pr-3",children:y.method}),u.jsx("td",{className:"py-1 pr-3 truncate max-w-[40ch]",children:y.path}),u.jsx("td",{className:pe("py-1 pr-3 text-right",c7(y.status)),children:y.status}),u.jsx("td",{className:"py-1 pr-3 text-right text-muted-foreground",children:u7(y.resBytes)}),u.jsx("td",{className:"py-1 pr-3 text-right",children:y.durationMs.toFixed(1)})]},y.id))})]})})]})}function c7(e){return e>=500?"text-red-600 dark:text-red-400":e>=400?"text-amber-600 dark:text-amber-400":e>=300?"text-zinc-500":e>=200?"text-emerald-600 dark:text-emerald-400":"text-muted-foreground"}function u7(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function d7({rows:e}){if(e.length===0)return u.jsx("div",{className:"text-muted-foreground",children:"No process tree (service not running)."});const t=[...e].sort((r,o)=>o.cpuPercent-r.cpuPercent),s=new Set(e.map(r=>r.pid));return u.jsx("div",{className:"overflow-x-auto",children:u.jsxs("table",{className:"w-full font-mono text-[11px]",children:[u.jsx("thead",{className:"text-left text-muted-foreground",children:u.jsxs("tr",{children:[u.jsx("th",{className:"py-1 pr-3",children:"PID"}),u.jsx("th",{className:"py-1 pr-3",children:"PPID"}),u.jsx("th",{className:"py-1 pr-3 text-right",children:"CPU%"}),u.jsx("th",{className:"py-1 pr-3 text-right",children:"RSS MB"}),u.jsx("th",{className:"py-1",children:"Command"})]})}),u.jsx("tbody",{children:t.map(r=>{const o=s.has(r.ppid);return u.jsxs("tr",{className:"border-t border-border/40",children:[u.jsx("td",{className:"py-1 pr-3",children:r.pid}),u.jsx("td",{className:"py-1 pr-3 text-muted-foreground",children:r.ppid}),u.jsx("td",{className:"py-1 pr-3 text-right",children:r.cpuPercent.toFixed(1)}),u.jsx("td",{className:"py-1 pr-3 text-right",children:r.rssMb.toFixed(1)}),u.jsx("td",{className:pe("py-1 truncate max-w-[60ch]",o&&"pl-4"),children:r.command})]},r.pid)})})]})})}const h7=500;function f7(e){const[t,s]=E.useState(),[r,o]=E.useState([]),[l,d]=E.useState(),[f,m]=E.useState(!1),h=E.useRef();E.useEffect(()=>{h.current=void 0,s(void 0),o([]);const v=new EventSource(`/api/services/${encodeURIComponent(e)}/test/stream`),b=y=>{try{const x=JSON.parse(y.data);x.run.id!==h.current&&(h.current=x.run.id,o([])),s(x.run),x.line&&o(w=>[...w,x.line].slice(-h7))}catch{}};return v.addEventListener("status",b),v.addEventListener("output",b),()=>v.close()},[e]);const _=E.useCallback(async v=>{m(!0),d(void 0);try{await mT(e,v)}catch(b){d(b instanceof Error?b.message:String(b))}finally{m(!1)}},[e]);return{run:t,lines:r,error:l,starting:f,start:_}}const m7={running:"secondary",passed:"success",failed:"error",error:"error"},p7={running:"Running",passed:"Passed",failed:"Failed",error:"Error"};function g7({serviceName:e}){const{run:t,lines:s,error:r,starting:o,start:l}=f7(e),[d,f]=E.useState(""),m=t?.status==="running"||o,h=t?.status==="failed"||t?.status==="error";return u.jsxs("div",{className:"space-y-2",children:[u.jsxs("form",{className:"flex items-center gap-2",onSubmit:_=>{_.preventDefault(),m||l(d.trim()||void 0)},children:[u.jsx(bt,{className:"h-7 flex-1 text-[11px]",disabled:m,onChange:_=>f(_.target.value),placeholder:"Optional test pattern (e.g. config-store)",value:d}),u.jsx(fe,{disabled:m,size:"sm",type:"submit",children:m?"Running…":"Run tests"})]}),r?u.jsx("div",{className:"text-red-600",children:r}):null,t?u.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-muted-foreground",children:[u.jsx(Ve,{size:"small",variant:m7[t.status],children:p7[t.status]}),u.jsx("code",{className:"font-mono text-[11px]",children:t.command}),t.failingCount>0?u.jsxs("span",{children:["· ",t.failingCount," failing"]}):null,t.exitCode!=null?u.jsxs("span",{children:["· exit ",t.exitCode]}):null]}):u.jsx("div",{className:"text-muted-foreground",children:"No test runs yet."}),s.length>0?u.jsx("pre",{className:"max-h-72 overflow-auto whitespace-pre-wrap break-all rounded bg-background p-2 font-mono text-[11px]",children:s.map((_,v)=>u.jsx("div",{className:pe(_.stream==="stderr"&&"text-red-500"),children:_.text},v))}):null,h?u.jsxs("div",{className:"rounded border border-border bg-muted/40 p-2",children:["Failures were piped into the"," ",u.jsx("a",{className:"font-medium underline",href:"/errors",children:"Error Inbox"})," ","— open an incident there to copy a debugging prompt for your agent."]}):null]})}function _7({serviceName:e,status:t,health:s,timeline:r,onRefresh:o}){const[l,d]=E.useState("processes"),f=s?.processTree?.processes??[];return u.jsxs("div",{className:"border-t border-border bg-muted/30 px-3 py-2 text-xs",children:[u.jsxs("div",{className:"mb-2 flex gap-1",children:[u.jsxs(kl,{active:l==="processes",onClick:()=>d("processes"),children:["Processes ",f.length?u.jsx(Ve,{variant:"secondary",size:"small",children:f.length}):null]}),u.jsxs(kl,{active:l==="http",onClick:()=>d("http"),children:["HTTP",t?.inspector?.enabled?u.jsx(Ve,{variant:"success",size:"small",children:"on"}):null]}),u.jsx(kl,{active:l==="env",onClick:()=>d("env"),children:"Env"}),u.jsx(kl,{active:l==="tests",onClick:()=>d("tests"),children:"Tests"}),u.jsx(kl,{active:l==="logs",onClick:()=>d("logs"),children:"Logs"})]}),l==="processes"?u.jsx(d7,{rows:f}):null,l==="http"?u.jsx(l7,{serviceName:e,status:t,timeline:r,onRefresh:o}):null,l==="env"?u.jsx(o7,{serviceName:e}):null,l==="tests"?u.jsx(g7,{serviceName:e}):null,l==="logs"?u.jsx(JD,{serviceName:e}):null]})}function kl({active:e,onClick:t,children:s}){return u.jsx("button",{className:pe("inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-colors",e?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),onClick:t,type:"button",children:s})}function v7({allServices:e,group:t,onRefresh:s,ports:r,services:o,health:l,statuses:d,timeline:f,selectedService:m,onSelectService:h,onDropService:_}){const[v,b]=E.useState(!1),[y,x]=E.useState(!1),[w,N]=E.useState(!1),A=o.some(M=>po(d[M.name]?.state));function R(M){!_||!M.dataTransfer.types.includes(ic)||(M.preventDefault(),M.dataTransfer.dropEffect="copy",N(!0))}function T(M){if(!_)return;M.preventDefault(),N(!1);const z=M.dataTransfer.getData(ic);z&&_(z)}return u.jsxs("section",{className:pe("transition-colors",w&&"bg-primary/5 outline-dashed outline-2 -outline-offset-2 outline-primary/60"),onDragOver:R,onDragLeave:()=>N(!1),onDrop:T,children:[u.jsxs("div",{className:"flex items-center gap-1.5 bg-muted/35 px-3 py-1.5",children:[u.jsxs("button",{"aria-expanded":!y,className:"flex min-w-0 flex-1 cursor-pointer items-center gap-1.5 text-left",onClick:()=>x(M=>!M),type:"button",children:[u.jsx(Pn,{className:pe("size-3.5 shrink-0 text-muted-foreground transition-transform",y&&"-rotate-90")}),u.jsx("span",{className:"truncate text-sm font-medium",children:t.name}),u.jsx(Ve,{size:"small",variant:"secondary",children:t.services.length})]}),u.jsx(Er,{label:"Edit group",children:u.jsx(fe,{"aria-expanded":v,"aria-label":`Edit ${t.name}`,className:"size-7",onClick:()=>b(M=>!M),size:"icon",type:"button",variant:"ghost",children:u.jsx(mp,{})})}),u.jsx(r0,{active:A,baseUrl:`/api/bundles/${encodeURIComponent(t.name)}`,compact:!0,restartAction:async()=>{await Gi(`/api/bundles/${encodeURIComponent(t.name)}/stop`,{}),await Gi(`/api/bundles/${encodeURIComponent(t.name)}/start`,{})},solidStart:!0,targetLabel:`group ${t.name}`,onRefresh:s,onStarted:()=>{const M=o[0];M&&h(M.name)}})]}),v?u.jsx("div",{className:"border-t border-border bg-background/65 p-3",children:u.jsx(aE,{initialName:t.name,initialServices:t.services,onRefresh:s,onSaved:()=>b(!1),originalName:t.name,services:e,submitLabel:"Save Group"})}):null,y?null:u.jsx("div",{className:"divide-y divide-border border-t border-border bg-background/45",children:o.length?o.map(M=>u.jsx(dE,{service:M,status:d[M.name],health:l[M.name],ports:r,onRefresh:s,timeline:f,selected:m===M.name,onSelect:()=>h(M.name)},M.name)):u.jsx(ht,{variant:"muted",className:"m-4",children:"This group does not match any registered services."})})]})}function dE({service:e,status:t,onRefresh:s,selected:r=!1,onSelect:o}){const l=t?.state??"stopped",d=po(l),[f,m]=E.useState(!1);return u.jsxs("div",{"aria-selected":r,draggable:!0,onDragStart:h=>{h.dataTransfer.setData(ic,e.name),e.cwd&&sE(h.dataTransfer,e.cwd),h.dataTransfer.effectAllowed="copyMove",m(!0)},onDragEnd:()=>m(!1),className:pe("group flex cursor-pointer items-center gap-2 border-l-2 px-3 py-1.5 transition-colors",f&&"opacity-50",r?"border-l-primary bg-primary/10":"border-l-transparent hover:bg-muted"),onClick:o,role:"option",children:[u.jsx(n0,{command:e.command??""}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("div",{className:"truncate text-sm font-medium",children:e.name}),u.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[u.jsx(hE,{kind:e.kind}),e.port?u.jsxs("span",{children:[":",e.port]}):null]})]}),u.jsx(fE,{state:l}),u.jsx("span",{className:"flex items-center gap-1",onClick:h=>h.stopPropagation(),children:u.jsx(r0,{active:d,baseUrl:`/api/services/${encodeURIComponent(e.name)}`,compact:!0,targetLabel:e.name,onRefresh:s,onStarted:o})})]})}const ic="application/x-nomoreide-service",Fy={local:{label:"local",className:"border-zinc-300 bg-zinc-100 text-zinc-600"},"docker-compose":{label:"docker",className:"border-sky-300 bg-sky-50 text-sky-700"},ssh:{label:"ssh",className:"border-violet-300 bg-violet-50 text-violet-700"}};function hE({kind:e}){const t=Fy[e??"local"]??Fy.local;return u.jsx("span",{className:pe("rounded border px-1 py-px text-[9px] font-semibold uppercase leading-none tracking-wide",t.className),children:t.label})}function po(e){return e==="running"||e==="starting"}function b7({service:e,onRefresh:t}){const[s,r]=E.useState(e.port?String(e.port):""),[o,l]=E.useState(!1),{error:d,success:f}=ls(),m=s.trim()!==(e.port?String(e.port):"");E.useEffect(()=>{r(e.port?String(e.port):"")},[e.port]);async function h(_){_.preventDefault(),l(!0);try{await Gi("/api/services",{name:e.name,command:e.command??"",cwd:e.cwd??"",port:s,description:e.description}),f(`Port saved for ${e.name}.`),await t()}catch(v){d(tc("Save port",e.name,v))}finally{l(!1)}}return u.jsxs("form",{className:"flex items-center gap-1.5",onSubmit:h,children:[u.jsx(bt,{"aria-label":`Port for ${e.name}`,className:"h-8 w-20 font-mono text-xs",inputMode:"numeric",min:1,max:65535,onChange:_=>r(_.target.value),placeholder:"port",type:"number",value:s}),u.jsx(fe,{"aria-label":`Save port for ${e.name}`,disabled:o||!m,className:"size-8",size:"icon",title:"Save port",type:"submit",variant:"outline",children:u.jsx(qS,{})})]})}function y7(e){return`http://127.0.0.1:${e}`}function fE({state:e}){return u.jsx(Ve,{variant:e==="running"?"success":e==="exited"?"danger":e==="starting"?"warning":"outline",className:pe(e==="running"&&"font-mono"),children:e})}function x7({data:e,onRefresh:t}){const s=e.config.services[0]?.name??"",[r,o]=E.useState(s),[l,d]=E.useState(null),[f,m]=E.useState(!1),[h,_]=E.useState(!0),[v,b]=E.useState(!1),[y,x]=E.useState(!1),[w,N]=E.useState(!1),A=E.useRef({}),{error:R,message:T,success:M}=ls(),z=E.useMemo(()=>new Set(e.config.bundles.flatMap(k=>k.services)),[e.config.bundles]),U=E.useMemo(()=>{const k=new Map;for(const F of e.config.bundles)for(const V of F.services)k.has(V)||k.set(V,F.name);return k},[e.config.bundles]),j=E.useMemo(()=>e.config.services.filter(k=>!z.has(k.name)),[e.config.services,z]),O=e.health??{},K=e.config.bundles.length>0||j.length>0;E.useEffect(()=>{!e.config.services.some(F=>F.name===r)&&s&&o(s)},[e.config.services,s,r]);const H=E.useMemo(()=>e.config.services.find(k=>k.name===r),[e.config.services,r]),G=r?e.runtime.services[r]:void 0,J=r?O[r]:void 0;async function I(k,F){if(!k.services.includes(F))try{await oT(k.name,k.services,F),M(`Added ${F} to ${k.name}.`),await t()}catch(V){R(V instanceof Error?V.message:String(V))}}async function ee(){if(H){if(po(G?.state)){R(`Stop ${H.name} before deleting it.`);return}if(window.confirm(`Delete service "${H.name}"? This removes it from your config.`))try{await aT(H.name),M(`Deleted ${H.name}.`),await t()}catch(k){R(k instanceof Error?k.message:String(k))}}}async function q(k){const F=e.config.bundles.filter(V=>V.services.includes(k));if(F.length!==0)try{for(const V of F)await lT(V.name,V.services,k);T({text:`Removed ${k} from ${F.map(V=>V.name).join(", ")}.`}),await t()}catch(V){R(V instanceof Error?V.message:String(V))}}return E.useEffect(()=>{const k=Object.fromEntries(e.config.services.map(V=>[V.name,e.runtime.services[V.name]?.state??"stopped"])),F=A.current;if(Object.keys(F).length){const V=new Map,Z=new Map;for(const W of e.config.services){const D=k[W.name],ie=F[W.name];if(!ie||ie===D)continue;const ce=e.runtime.services[W.name],le=U.get(W.name);if(le){const de=V.get(le)??new Map;if(de.set(D,(de.get(D)??0)+1),V.set(le,de),D==="exited"){const ge=Z.get(le)??[];ge.push(ce?.exitCode),Z.set(le,ge)}continue}if(D==="running")M(`${W.name} is running.`);else if(D==="stopped")T({text:`${W.name} stopped.`});else if(D==="starting")T({text:`${W.name} is starting.`});else if(D==="exited"){const de=ce?.exitCode===void 0||ce.exitCode===null?"":` with code ${ce.exitCode}`;R(`${W.name} exited${de}.`)}}for(const[W,D]of V)w7({exitCodes:Z.get(W)??[],groupName:W,showErrorToast:R,showMessageToast:T,showSuccessToast:M,transitions:D})}A.current=k},[e.config.services,e.runtime.services,U,R,T,M]),u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:pe("grid h-full min-h-0 overflow-hidden bg-card/85",h?"lg:grid-cols-[320px_minmax(0,1fr)]":"lg:grid-cols-[320px_minmax(0,1fr)_340px]"),children:[u.jsx("div",{className:"min-h-0 min-w-0 overflow-auto border-r border-border",children:u.jsxs(Js,{className:"min-w-0 rounded-none border-0 border-b border-border bg-transparent",children:[u.jsx(en,{className:"border-b border-border px-3 py-2",children:u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx(tn,{className:"text-sm",children:"Services"}),u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsxs(fe,{"aria-haspopup":"dialog",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>m(!0),size:"sm",type:"button",variant:"outline",children:[u.jsx(KS,{className:"size-3.5"}),"Logs"]}),u.jsx(S7,{onCreateGroup:()=>d("group"),onCreateService:()=>d("service")})]})]})}),u.jsx(sn,{className:"p-0",children:K?u.jsxs("div",{className:"divide-y divide-border",children:[e.config.bundles.map(k=>u.jsx(v7,{group:k,onRefresh:t,ports:e.ports,allServices:e.config.services,health:O,services:e.config.services.filter(F=>k.services.includes(F.name)),statuses:e.runtime.services,timeline:e.timeline,selectedService:r,onSelectService:o,onDropService:F=>{I(k,F)}},k.name)),j.length?u.jsxs("div",{className:pe("transition-colors",w&&"bg-primary/5 outline-dashed outline-2 -outline-offset-2 outline-primary/60"),onDragOver:k=>{k.dataTransfer.types.includes(ic)&&(k.preventDefault(),k.dataTransfer.dropEffect="move",N(!0))},onDragLeave:()=>N(!1),onDrop:k=>{k.preventDefault(),N(!1);const F=k.dataTransfer.getData(ic);F&&q(F)},children:[u.jsxs("div",{className:"flex items-center justify-between gap-2 bg-muted/55 px-3 py-1 text-[10px] font-semibold uppercase text-muted-foreground",children:[u.jsx("span",{children:"Ungrouped"}),u.jsx("span",{className:"text-muted-foreground/80",children:j.length})]}),u.jsx("div",{className:"divide-y divide-border",children:j.map(k=>u.jsx(dE,{service:k,status:e.runtime.services[k.name],health:O[k.name],ports:e.ports,onRefresh:t,timeline:e.timeline,selected:r===k.name,onSelect:()=>o(k.name)},k.name))})]}):null]}):u.jsx(vd,{label:"No services registered yet."})})]})}),u.jsx("div",{className:"min-h-0 min-w-0 overflow-auto",children:H?u.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[u.jsxs("div",{className:"shrink-0 space-y-2 border-b border-border bg-background/60 px-4 py-3",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[u.jsx("h2",{className:"min-w-0 truncate text-base font-semibold",children:H.name}),u.jsx(fE,{state:G?.state??"stopped"}),u.jsx(hE,{kind:H.kind}),u.jsxs("div",{className:"ml-auto flex flex-wrap items-center gap-1.5",children:[u.jsx(b7,{service:H,onRefresh:t}),(()=>{const k=G?.url??(H.port?y7(H.port):void 0);return k?u.jsx(Er,{label:`Open ${k}`,children:u.jsx(fe,{"aria-label":"Open in browser",className:"size-7",onClick:()=>window.open(k,"_blank","noopener,noreferrer"),size:"icon",type:"button",variant:"outline",children:u.jsx(zS,{})})}):null})(),J?.agentContext?u.jsx(Er,{label:"Copy debug context for an AI agent",children:u.jsx(fe,{"aria-label":"Copy agent debug context",className:"size-7",onClick:()=>b(!0),size:"icon",type:"button",variant:"outline",children:u.jsx(Wl,{})})}):null,u.jsx(r0,{active:po(G?.state),baseUrl:`/api/services/${encodeURIComponent(H.name)}`,compact:!0,targetLabel:H.name,onRefresh:t}),u.jsx(Er,{label:"Edit service",children:u.jsx(fe,{"aria-label":`Edit ${H.name}`,className:"size-7",onClick:()=>x(!0),size:"icon",type:"button",variant:"outline",children:u.jsx(mp,{})})}),u.jsx(Er,{label:po(G?.state)?"Stop before deleting":"Delete service",children:u.jsx(fe,{"aria-label":`Delete ${H.name}`,className:"size-7",disabled:po(G?.state),onClick:()=>{ee()},size:"icon",type:"button",variant:"outline",children:u.jsx(lc,{className:"text-destructive"})})}),u.jsx(Er,{label:h?"Show Ports & Timeline":"Hide Ports & Timeline",side:"left",children:u.jsx(fe,{"aria-label":h?"Show Ports & Timeline":"Hide Ports & Timeline",className:"size-7",onClick:()=>_(k=>!k),size:"icon",type:"button",variant:"ghost",children:h?u.jsx(jN,{}):u.jsx(ga,{})})})]})]}),H.command?u.jsxs("div",{className:"truncate font-mono text-[11px] text-muted-foreground",title:H.command,children:["$ ",H.command]}):null,H.cwd?u.jsx("div",{className:"truncate font-mono text-[11px] text-muted-foreground",title:H.cwd,children:H.cwd}):null,u.jsx(PD,{health:J})]}),u.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:u.jsx(_7,{serviceName:H.name,status:G,health:J,timeline:e.timeline??[],onRefresh:t})})]}):u.jsx(vd,{label:"Select a service to see details."})}),h?null:u.jsxs("div",{className:"min-h-0 overflow-auto border-l border-border",children:[u.jsx(VD,{ports:e.ports}),u.jsx(MD,{events:e.timeline??[]})]})]}),v&&H&&J?.agentContext?u.jsx(zn,{icon:u.jsx(Wl,{}),onClose:()=>b(!1),title:`Agent context — ${H.name}`,children:u.jsx("div",{className:"p-4",children:u.jsx(cD,{context:J.agentContext})})}):null,y&&H?u.jsx(zn,{icon:u.jsx(mp,{}),onClose:()=>x(!1),size:"lg",title:`Edit Service — ${H.name}`,children:u.jsx(Py,{cwd:e.cwd,initialService:H,onRefresh:t,onSaved:()=>x(!1)})}):null,l?u.jsx(zn,{icon:l==="service"?u.jsx(Es,{}):u.jsx(jS,{}),onClose:()=>d(null),size:l==="service"?"lg":"md",title:l==="service"?"Add Service":"Create Group",children:l==="service"?u.jsx(Py,{cwd:e.cwd,onRefresh:t,onSaved:()=>d(null)}):u.jsx(aE,{services:j,onRefresh:t,onSaved:()=>d(null)})}):null,f?u.jsx(i7,{initialService:r||void 0,onClose:()=>m(!1),services:e.config.services.map(k=>k.name)}):null]})}function S7({onCreateService:e,onCreateGroup:t}){const[s,r]=E.useState(!1);function o(l){r(!1),l()}return u.jsxs("div",{className:"relative",children:[u.jsx(Er,{label:"Add",side:"bottom",children:u.jsx(fe,{"aria-expanded":s,"aria-haspopup":"menu","aria-label":"Add service or group",className:"size-7",onClick:()=>r(l=>!l),size:"icon",type:"button",variant:"ghost",children:u.jsx(Es,{})})}),s?u.jsxs(u.Fragment,{children:[u.jsx("button",{"aria-hidden":!0,className:"fixed inset-0 z-[40] cursor-default",onClick:()=>r(!1),tabIndex:-1,type:"button"}),u.jsxs("div",{className:"absolute right-0 z-[50] mt-1 w-44 overflow-hidden rounded-md border border-border bg-card py-1 shadow-lg",role:"menu",children:[u.jsxs("button",{className:"flex w-full items-center gap-2 px-3 py-2 text-left text-sm hover:bg-muted/60 [&_svg]:size-4",onClick:()=>o(e),role:"menuitem",type:"button",children:[u.jsx(Es,{}),"Create Service"]}),u.jsxs("button",{className:"flex w-full items-center gap-2 px-3 py-2 text-left text-sm hover:bg-muted/60 [&_svg]:size-4",onClick:()=>o(t),role:"menuitem",type:"button",children:[u.jsx(jS,{}),"Create Group"]})]})]}):null]})}function w7({exitCodes:e,groupName:t,showErrorToast:s,showMessageToast:r,showSuccessToast:o,transitions:l}){if(l.size===1){const[m]=l.keys();if(m==="running")o(`${t} group is running.`);else if(m==="stopped")r({text:`${t} group stopped.`});else if(m==="starting")r({text:`${t} group is starting.`});else if(m==="exited"){const h=e.filter(v=>v!=null),_=h.length?` with code ${h.join(", ")}`:"";s(`${t} group exited${_}.`)}return}const d=[...l.entries()].map(([m,h])=>`${h} ${m}`).join(", "),f=`${t} group updated: ${d}.`;l.has("exited")?s(f):r({text:f})}var E7=2,C7=1,N7=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,s=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(s.getPropertyValue("height")),o=Math.max(0,parseInt(s.getPropertyValue("width"))),l=window.getComputedStyle(this._terminal.element),d={top:parseInt(l.getPropertyValue("padding-top")),bottom:parseInt(l.getPropertyValue("padding-bottom")),right:parseInt(l.getPropertyValue("padding-right")),left:parseInt(l.getPropertyValue("padding-left"))},f=d.top+d.bottom,m=d.right+d.left,h=r-f,_=o-m-t;return{cols:Math.max(E7,Math.floor(_/e.css.cell.width)),rows:Math.max(C7,Math.floor(h/e.css.cell.height))}}};var mE=Object.defineProperty,k7=Object.getOwnPropertyDescriptor,T7=(e,t)=>{for(var s in t)mE(e,s,{get:t[s],enumerable:!0})},Pt=(e,t,s,r)=>{for(var o=r>1?void 0:r?k7(t,s):t,l=e.length-1,d;l>=0;l--)(d=e[l])&&(o=(r?d(t,s,o):d(o))||o);return r&&o&&mE(t,s,o),o},be=(e,t)=>(s,r)=>t(s,r,e),Vy="Terminal input",Hp={get:()=>Vy,set:e=>Vy=e},$y="Too much output to announce, navigate to rows manually to read",Fp={get:()=>$y,set:e=>$y=e};function M7(e){return e.replace(/\r?\n/g,"\r")}function A7(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function R7(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function D7(e,t,s,r){if(e.stopPropagation(),e.clipboardData){let o=e.clipboardData.getData("text/plain");pE(o,t,s,r)}}function pE(e,t,s,r){e=M7(e),e=A7(e,s.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),s.triggerDataEvent(e,!0),t.value=""}function gE(e,t,s){let r=s.getBoundingClientRect(),o=e.clientX-r.left-10,l=e.clientY-r.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${o}px`,t.style.top=`${l}px`,t.style.zIndex="1000",t.focus()}function qy(e,t,s,r,o){gE(e,t,s),o&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function wr(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function Ld(e,t=0,s=e.length){let r="";for(let o=t;o<s;++o){let l=e[o];l>65535?(l-=65536,r+=String.fromCharCode((l>>10)+55296)+String.fromCharCode(l%1024+56320)):r+=String.fromCharCode(l)}return r}var O7=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let s=e.length;if(!s)return 0;let r=0,o=0;if(this._interim){let l=e.charCodeAt(o++);56320<=l&&l<=57343?t[r++]=(this._interim-55296)*1024+l-56320+65536:(t[r++]=this._interim,t[r++]=l),this._interim=0}for(let l=o;l<s;++l){let d=e.charCodeAt(l);if(55296<=d&&d<=56319){if(++l>=s)return this._interim=d,r;let f=e.charCodeAt(l);56320<=f&&f<=57343?t[r++]=(d-55296)*1024+f-56320+65536:(t[r++]=d,t[r++]=f);continue}d!==65279&&(t[r++]=d)}return r}},L7=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let s=e.length;if(!s)return 0;let r=0,o,l,d,f,m=0,h=0;if(this.interim[0]){let b=!1,y=this.interim[0];y&=(y&224)===192?31:(y&240)===224?15:7;let x=0,w;for(;(w=this.interim[++x]&63)&&x<4;)y<<=6,y|=w;let N=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,A=N-x;for(;h<A;){if(h>=s)return 0;if(w=e[h++],(w&192)!==128){h--,b=!0;break}else this.interim[x++]=w,y<<=6,y|=w&63}b||(N===2?y<128?h--:t[r++]=y:N===3?y<2048||y>=55296&&y<=57343||y===65279||(t[r++]=y):y<65536||y>1114111||(t[r++]=y)),this.interim.fill(0)}let _=s-4,v=h;for(;v<s;){for(;v<_&&!((o=e[v])&128)&&!((l=e[v+1])&128)&&!((d=e[v+2])&128)&&!((f=e[v+3])&128);)t[r++]=o,t[r++]=l,t[r++]=d,t[r++]=f,v+=4;if(o=e[v++],o<128)t[r++]=o;else if((o&224)===192){if(v>=s)return this.interim[0]=o,r;if(l=e[v++],(l&192)!==128){v--;continue}if(m=(o&31)<<6|l&63,m<128){v--;continue}t[r++]=m}else if((o&240)===224){if(v>=s)return this.interim[0]=o,r;if(l=e[v++],(l&192)!==128){v--;continue}if(v>=s)return this.interim[0]=o,this.interim[1]=l,r;if(d=e[v++],(d&192)!==128){v--;continue}if(m=(o&15)<<12|(l&63)<<6|d&63,m<2048||m>=55296&&m<=57343||m===65279)continue;t[r++]=m}else if((o&248)===240){if(v>=s)return this.interim[0]=o,r;if(l=e[v++],(l&192)!==128){v--;continue}if(v>=s)return this.interim[0]=o,this.interim[1]=l,r;if(d=e[v++],(d&192)!==128){v--;continue}if(v>=s)return this.interim[0]=o,this.interim[1]=l,this.interim[2]=d,r;if(f=e[v++],(f&192)!==128){v--;continue}if(m=(o&7)<<18|(l&63)<<12|(d&63)<<6|f&63,m<65536||m>1114111)continue;t[r++]=m}}return r}},_E="",Nr=" ",mc=class vE{constructor(){this.fg=0,this.bg=0,this.extended=new yd}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new vE;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},yd=class bE{constructor(t=0,s=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=s}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new bE(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Ns=class yE extends mc{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new yd,this.combinedData=""}static fromCharData(t){let s=new yE;return s.setFromCharData(t),s}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?wr(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let s=!1;if(t[1].length>2)s=!0;else if(t[1].length===2){let r=t[1].charCodeAt(0);if(55296<=r&&r<=56319){let o=t[1].charCodeAt(1);56320<=o&&o<=57343?this.content=(r-55296)*1024+o-56320+65536|t[2]<<22:s=!0}else s=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;s&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Ky="di$target",Vp="di$dependencies",pm=new Map;function j7(e){return e[Vp]||[]}function mi(e){if(pm.has(e))return pm.get(e);let t=function(s,r,o){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");B7(t,s,o)};return t._id=e,pm.set(e,t),t}function B7(e,t,s){t[Ky]===t?t[Vp].push({id:e,index:s}):(t[Vp]=[{id:e,index:s}],t[Ky]=t)}var ji=mi("BufferService"),xE=mi("CoreMouseService"),ba=mi("CoreService"),z7=mi("CharsetService"),a0=mi("InstantiationService"),SE=mi("LogService"),Bi=mi("OptionsService"),wE=mi("OscLinkService"),P7=mi("UnicodeService"),pc=mi("DecorationService"),$p=class{constructor(e,t,s){this._bufferService=e,this._optionsService=t,this._oscLinkService=s}provideLinks(e,t){let s=this._bufferService.buffer.lines.get(e-1);if(!s){t(void 0);return}let r=[],o=this._optionsService.rawOptions.linkHandler,l=new Ns,d=s.getTrimmedLength(),f=-1,m=-1,h=!1;for(let _=0;_<d;_++)if(!(m===-1&&!s.hasContent(_))){if(s.loadCell(_,l),l.hasExtendedAttrs()&&l.extended.urlId)if(m===-1){m=_,f=l.extended.urlId;continue}else h=l.extended.urlId!==f;else m!==-1&&(h=!0);if(h||m!==-1&&_===d-1){let v=this._oscLinkService.getLinkData(f)?.uri;if(v){let b={start:{x:m+1,y:e},end:{x:_+(!h&&_===d-1?1:0),y:e}},y=!1;if(!o?.allowNonHttpProtocols)try{let x=new URL(v);["http:","https:"].includes(x.protocol)||(y=!0)}catch{y=!0}y||r.push({text:v,range:b,activate:(x,w)=>o?o.activate(x,w,b):I7(x,w),hover:(x,w)=>o?.hover?.(x,w,b),leave:(x,w)=>o?.leave?.(x,w,b)})}h=!1,l.hasExtendedAttrs()&&l.extended.urlId?(m=_,f=l.extended.urlId):(m=-1,f=-1)}}t(r)}};$p=Pt([be(0,ji),be(1,Bi),be(2,wE)],$p);function I7(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
20
|
-
|
|
21
|
-
WARNING: This link could potentially be dangerous`)){let s=window.open();if(s){try{s.opener=null}catch{}s.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var jd=mi("CharSizeService"),In=mi("CoreBrowserService"),o0=mi("MouseService"),Un=mi("RenderService"),U7=mi("SelectionService"),EE=mi("CharacterJoinerService"),Eo=mi("ThemeService"),CE=mi("LinkProviderService"),H7=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Gy.isErrorNoTelemetry(e)?new Gy(e.message+`
|
|
22
|
-
|
|
23
|
-
`+e.stack):new Error(e.message+`
|
|
24
|
-
|
|
25
|
-
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},F7=new H7;function td(e){V7(e)||F7.onUnexpectedError(e)}var qp="Canceled";function V7(e){return e instanceof $7?!0:e instanceof Error&&e.name===qp&&e.message===qp}var $7=class extends Error{constructor(){super(qp),this.name=this.message}};function q7(e){return new Error(`Illegal argument: ${e}`)}var Gy=class Kp extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof Kp)return t;let s=new Kp;return s.message=t.message,s.stack=t.stack,s}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},Gp=class NE extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,NE.prototype)}};function ns(e,t=0){return e[e.length-(1+t)]}var K7;(e=>{function t(l){return l<0}e.isLessThan=t;function s(l){return l<=0}e.isLessThanOrEqual=s;function r(l){return l>0}e.isGreaterThan=r;function o(l){return l===0}e.isNeitherLessOrGreaterThan=o,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(K7||={});function G7(e,t){let s=this,r=!1,o;return function(){return r||(r=!0,t||(o=e.apply(s,arguments))),o}}var kE;(e=>{function t(M){return M&&typeof M=="object"&&typeof M[Symbol.iterator]=="function"}e.is=t;let s=Object.freeze([]);function r(){return s}e.empty=r;function*o(M){yield M}e.single=o;function l(M){return t(M)?M:o(M)}e.wrap=l;function d(M){return M||s}e.from=d;function*f(M){for(let z=M.length-1;z>=0;z--)yield M[z]}e.reverse=f;function m(M){return!M||M[Symbol.iterator]().next().done===!0}e.isEmpty=m;function h(M){return M[Symbol.iterator]().next().value}e.first=h;function _(M,z){let U=0;for(let j of M)if(z(j,U++))return!0;return!1}e.some=_;function v(M,z){for(let U of M)if(z(U))return U}e.find=v;function*b(M,z){for(let U of M)z(U)&&(yield U)}e.filter=b;function*y(M,z){let U=0;for(let j of M)yield z(j,U++)}e.map=y;function*x(M,z){let U=0;for(let j of M)yield*z(j,U++)}e.flatMap=x;function*w(...M){for(let z of M)yield*z}e.concat=w;function N(M,z,U){let j=U;for(let O of M)j=z(j,O);return j}e.reduce=N;function*A(M,z,U=M.length){for(z<0&&(z+=M.length),U<0?U+=M.length:U>M.length&&(U=M.length);z<U;z++)yield M[z]}e.slice=A;function R(M,z=Number.POSITIVE_INFINITY){let U=[];if(z===0)return[U,M];let j=M[Symbol.iterator]();for(let O=0;O<z;O++){let K=j.next();if(K.done)return[U,e.empty()];U.push(K.value)}return[U,{[Symbol.iterator](){return j}}]}e.consume=R;async function T(M){let z=[];for await(let U of M)z.push(U);return Promise.resolve(z)}e.asyncToArray=T})(kE||={});function ma(e){if(kE.is(e)){let t=[];for(let s of e)if(s)try{s.dispose()}catch(r){t.push(r)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function W7(...e){return Mt(()=>ma(e))}function Mt(e){return{dispose:G7(()=>{e()})}}var TE=class ME{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{ma(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?ME.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};TE.DISABLE_DISPOSED_WARNING=!1;var kr=TE,Ke=class{constructor(){this._store=new kr,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)}};Ke.None=Object.freeze({dispose(){}});var yo=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}},Bn=typeof window=="object"?window:globalThis,Wp=class Yp{constructor(t){this.element=t,this.next=Yp.Undefined,this.prev=Yp.Undefined}};Wp.Undefined=new Wp(void 0);var Dt=Wp,Wy=class{constructor(){this._first=Dt.Undefined,this._last=Dt.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Dt.Undefined}clear(){let e=this._first;for(;e!==Dt.Undefined;){let t=e.next;e.prev=Dt.Undefined,e.next=Dt.Undefined,e=t}this._first=Dt.Undefined,this._last=Dt.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let s=new Dt(e);if(this._first===Dt.Undefined)this._first=s,this._last=s;else if(t){let o=this._last;this._last=s,s.prev=o,o.next=s}else{let o=this._first;this._first=s,s.next=o,o.prev=s}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(s))}}shift(){if(this._first!==Dt.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Dt.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Dt.Undefined&&e.next!==Dt.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Dt.Undefined&&e.next===Dt.Undefined?(this._first=Dt.Undefined,this._last=Dt.Undefined):e.next===Dt.Undefined?(this._last=this._last.prev,this._last.next=Dt.Undefined):e.prev===Dt.Undefined&&(this._first=this._first.next,this._first.prev=Dt.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Dt.Undefined;)yield e.element,e=e.next}},Y7=globalThis.performance&&typeof globalThis.performance.now=="function",X7=class AE{static create(t){return new AE(t)}constructor(t){this._now=Y7&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},wi;(e=>{e.None=()=>Ke.None;function t(J,I){return v(J,()=>{},0,void 0,!0,void 0,I)}e.defer=t;function s(J){return(I,ee=null,q)=>{let k=!1,F;return F=J(V=>{if(!k)return F?F.dispose():k=!0,I.call(ee,V)},null,q),k&&F.dispose(),F}}e.once=s;function r(J,I,ee){return h((q,k=null,F)=>J(V=>q.call(k,I(V)),null,F),ee)}e.map=r;function o(J,I,ee){return h((q,k=null,F)=>J(V=>{I(V),q.call(k,V)},null,F),ee)}e.forEach=o;function l(J,I,ee){return h((q,k=null,F)=>J(V=>I(V)&&q.call(k,V),null,F),ee)}e.filter=l;function d(J){return J}e.signal=d;function f(...J){return(I,ee=null,q)=>{let k=W7(...J.map(F=>F(V=>I.call(ee,V))));return _(k,q)}}e.any=f;function m(J,I,ee,q){let k=ee;return r(J,F=>(k=I(k,F),k),q)}e.reduce=m;function h(J,I){let ee,q={onWillAddFirstListener(){ee=J(k.fire,k)},onDidRemoveLastListener(){ee?.dispose()}},k=new he(q);return I?.add(k),k.event}function _(J,I){return I instanceof Array?I.push(J):I&&I.add(J),J}function v(J,I,ee=100,q=!1,k=!1,F,V){let Z,W,D,ie=0,ce,le={leakWarningThreshold:F,onWillAddFirstListener(){Z=J(ge=>{ie++,W=I(W,ge),q&&!D&&(de.fire(W),W=void 0),ce=()=>{let Se=W;W=void 0,D=void 0,(!q||ie>1)&&de.fire(Se),ie=0},typeof ee=="number"?(clearTimeout(D),D=setTimeout(ce,ee)):D===void 0&&(D=0,queueMicrotask(ce))})},onWillRemoveListener(){k&&ie>0&&ce?.()},onDidRemoveLastListener(){ce=void 0,Z.dispose()}},de=new he(le);return V?.add(de),de.event}e.debounce=v;function b(J,I=0,ee){return e.debounce(J,(q,k)=>q?(q.push(k),q):[k],I,void 0,!0,void 0,ee)}e.accumulate=b;function y(J,I=(q,k)=>q===k,ee){let q=!0,k;return l(J,F=>{let V=q||!I(F,k);return q=!1,k=F,V},ee)}e.latch=y;function x(J,I,ee){return[e.filter(J,I,ee),e.filter(J,q=>!I(q),ee)]}e.split=x;function w(J,I=!1,ee=[],q){let k=ee.slice(),F=J(W=>{k?k.push(W):Z.fire(W)});q&&q.add(F);let V=()=>{k?.forEach(W=>Z.fire(W)),k=null},Z=new he({onWillAddFirstListener(){F||(F=J(W=>Z.fire(W)),q&&q.add(F))},onDidAddFirstListener(){k&&(I?setTimeout(V):V())},onDidRemoveLastListener(){F&&F.dispose(),F=null}});return q&&q.add(Z),Z.event}e.buffer=w;function N(J,I){return(ee,q,k)=>{let F=I(new R);return J(function(V){let Z=F.evaluate(V);Z!==A&&ee.call(q,Z)},void 0,k)}}e.chain=N;let A=Symbol("HaltChainable");class R{constructor(){this.steps=[]}map(I){return this.steps.push(I),this}forEach(I){return this.steps.push(ee=>(I(ee),ee)),this}filter(I){return this.steps.push(ee=>I(ee)?ee:A),this}reduce(I,ee){let q=ee;return this.steps.push(k=>(q=I(q,k),q)),this}latch(I=(ee,q)=>ee===q){let ee=!0,q;return this.steps.push(k=>{let F=ee||!I(k,q);return ee=!1,q=k,F?k:A}),this}evaluate(I){for(let ee of this.steps)if(I=ee(I),I===A)break;return I}}function T(J,I,ee=q=>q){let q=(...Z)=>V.fire(ee(...Z)),k=()=>J.on(I,q),F=()=>J.removeListener(I,q),V=new he({onWillAddFirstListener:k,onDidRemoveLastListener:F});return V.event}e.fromNodeEventEmitter=T;function M(J,I,ee=q=>q){let q=(...Z)=>V.fire(ee(...Z)),k=()=>J.addEventListener(I,q),F=()=>J.removeEventListener(I,q),V=new he({onWillAddFirstListener:k,onDidRemoveLastListener:F});return V.event}e.fromDOMEventEmitter=M;function z(J){return new Promise(I=>s(J)(I))}e.toPromise=z;function U(J){let I=new he;return J.then(ee=>{I.fire(ee)},()=>{I.fire(void 0)}).finally(()=>{I.dispose()}),I.event}e.fromPromise=U;function j(J,I){return J(ee=>I.fire(ee))}e.forward=j;function O(J,I,ee){return I(ee),J(q=>I(q))}e.runAndSubscribe=O;class K{constructor(I,ee){this._observable=I,this._counter=0,this._hasChanged=!1;let q={onWillAddFirstListener:()=>{I.addObserver(this)},onDidRemoveLastListener:()=>{I.removeObserver(this)}};this.emitter=new he(q),ee&&ee.add(this.emitter)}beginUpdate(I){this._counter++}handlePossibleChange(I){}handleChange(I,ee){this._hasChanged=!0}endUpdate(I){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function H(J,I){return new K(J,I).emitter.event}e.fromObservable=H;function G(J){return(I,ee,q)=>{let k=0,F=!1,V={beginUpdate(){k++},endUpdate(){k--,k===0&&(J.reportChanges(),F&&(F=!1,I.call(ee)))},handlePossibleChange(){},handleChange(){F=!0}};J.addObserver(V),J.reportChanges();let Z={dispose(){J.removeObserver(V)}};return q instanceof kr?q.add(Z):Array.isArray(q)&&q.push(Z),Z}}e.fromObservableLight=G})(wi||={});var Xp=class Zp{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${Zp._idPool++}`,Zp.all.add(this)}start(t){this._stopWatch=new X7,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};Xp.all=new Set,Xp._idPool=0;var Z7=Xp,Q7=-1,RE=class DE{constructor(t,s,r=(DE._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=s,this.name=r,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(t,s){let r=this.threshold;if(r<=0||s<r)return;this._stacks||(this._stacks=new Map);let o=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,o+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=r*.5;let[l,d]=this.getMostFrequentStack(),f=`[${this.name}] potential listener LEAK detected, having ${s} listeners already. MOST frequent listener (${d}):`;console.warn(f),console.warn(l);let m=new tO(f,l);this._errorHandler(m)}return()=>{let l=this._stacks.get(t.value)||0;this._stacks.set(t.value,l-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,s=0;for(let[r,o]of this._stacks)(!t||s<o)&&(t=[r,o],s=o);return t}};RE._idPool=1;var J7=RE,eO=class OE{constructor(t){this.value=t}static create(){let t=new Error;return new OE(t.stack??"")}print(){console.warn(this.value.split(`
|
|
26
|
-
`).slice(2).join(`
|
|
27
|
-
`))}},tO=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},iO=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},sO=0,gm=class{constructor(e){this.value=e,this.id=sO++}},nO=2,rO,he=class{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new J7(e?.onListenerError??td,this._options?.leakWarningThreshold??Q7):void 0,this._perfMon=this._options?._profName?new Z7(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,t,s)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let d=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(d);let f=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],m=new iO(`${d}. HINT: Stack shows most frequent listener (${f[1]}-times)`,f[0]);return(this._options?.onListenerError||td)(m),Ke.None}if(this._disposed)return Ke.None;t&&(e=e.bind(t));let r=new gm(e),o;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=eO.create(),o=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof gm?(this._deliveryQueue??=new aO,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let l=Mt(()=>{o?.(),this._removeListener(r)});return s instanceof kr?s.add(l):Array.isArray(s)&&s.push(l),l},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,s=t.indexOf(e);if(s===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[s]=void 0;let r=this._deliveryQueue.current===this;if(this._size*nO<=t.length){let o=0;for(let l=0;l<t.length;l++)t[l]?t[o++]=t[l]:r&&(this._deliveryQueue.end--,o<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=o}}_deliver(e,t){if(!e)return;let s=this._options?.onListenerError||td;if(!s){e.value(t);return}try{e.value(t)}catch(r){s(r)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof gm)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}this._perfMon?.stop()}hasListeners(){return this._size>0}},aO=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,s){this.i=0,this.end=s,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Qp=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new he,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new he,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,s){if(this.getZoomLevel(s)===t)return;let r=this.getWindowId(s);this.mapWindowIdToZoomLevel.set(r,t),this._onDidChangeZoomLevel.fire(r)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,s){this.mapWindowIdToZoomFactor.set(this.getWindowId(s),t)}setFullscreen(t,s){if(this.isFullscreen(s)===t)return;let r=this.getWindowId(s);this.mapWindowIdToFullScreen.set(r,t),this._onDidChangeFullscreen.fire(r)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};Qp.INSTANCE=new Qp;var l0=Qp;function oO(e,t,s){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",s)}l0.INSTANCE.onDidChangeZoomLevel;function lO(e){return l0.INSTANCE.getZoomFactor(e)}l0.INSTANCE.onDidChangeFullscreen;var Co=typeof navigator=="object"?navigator.userAgent:"",Jp=Co.indexOf("Firefox")>=0,cO=Co.indexOf("AppleWebKit")>=0,c0=Co.indexOf("Chrome")>=0,uO=!c0&&Co.indexOf("Safari")>=0;Co.indexOf("Electron/")>=0;Co.indexOf("Android")>=0;var _m=!1;if(typeof Bn.matchMedia=="function"){let e=Bn.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=Bn.matchMedia("(display-mode: fullscreen)");_m=e.matches,oO(Bn,e,({matches:s})=>{_m&&t.matches||(_m=s)})}var go="en",eg=!1,tg=!1,id=!1,LE=!1,Hu,sd=go,Yy=go,dO,jn,fa=globalThis,as;typeof fa.vscode<"u"&&typeof fa.vscode.process<"u"?as=fa.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(as=process);var hO=typeof as?.versions?.electron=="string",fO=hO&&as?.type==="renderer";if(typeof as=="object"){eg=as.platform==="win32",tg=as.platform==="darwin",id=as.platform==="linux",id&&as.env.SNAP&&as.env.SNAP_REVISION,as.env.CI||as.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Hu=go,sd=go;let e=as.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);Hu=t.userLocale,Yy=t.osLocale,sd=t.resolvedLanguage||go,dO=t.languagePack?.translationsConfigFile}catch{}LE=!0}else typeof navigator=="object"&&!fO?(jn=navigator.userAgent,eg=jn.indexOf("Windows")>=0,tg=jn.indexOf("Macintosh")>=0,(jn.indexOf("Macintosh")>=0||jn.indexOf("iPad")>=0||jn.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,id=jn.indexOf("Linux")>=0,jn?.indexOf("Mobi")>=0,sd=globalThis._VSCODE_NLS_LANGUAGE||go,Hu=navigator.language.toLowerCase(),Yy=Hu):console.error("Unable to resolve platform.");var jE=eg,Xs=tg,mO=id,Xy=LE,nn=jn,br=sd,pO;(e=>{function t(){return br}e.value=t;function s(){return br.length===2?br==="en":br.length>=3?br[0]==="e"&&br[1]==="n"&&br[2]==="-":!1}e.isDefaultVariant=s;function r(){return br==="en"}e.isDefault=r})(pO||={});var gO=typeof fa.postMessage=="function"&&!fa.importScripts;(()=>{if(gO){let e=[];fa.addEventListener("message",s=>{if(s.data&&s.data.vscodeScheduleAsyncWork)for(let r=0,o=e.length;r<o;r++){let l=e[r];if(l.id===s.data.vscodeScheduleAsyncWork){e.splice(r,1),l.callback();return}}});let t=0;return s=>{let r=++t;e.push({id:r,callback:s}),fa.postMessage({vscodeScheduleAsyncWork:r},"*")}}return e=>setTimeout(e)})();var _O=!!(nn&&nn.indexOf("Chrome")>=0);nn&&nn.indexOf("Firefox")>=0;!_O&&nn&&nn.indexOf("Safari")>=0;nn&&nn.indexOf("Edg/")>=0;nn&&nn.indexOf("Android")>=0;var oo=typeof navigator=="object"?navigator:{};Xy||document.queryCommandSupported&&document.queryCommandSupported("copy")||oo&&oo.clipboard&&oo.clipboard.writeText,Xy||oo&&oo.clipboard&&oo.clipboard.readText;var u0=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},vm=new u0,Zy=new u0,Qy=new u0,vO=new Array(230),BE;(e=>{function t(f){return vm.keyCodeToStr(f)}e.toString=t;function s(f){return vm.strToKeyCode(f)}e.fromString=s;function r(f){return Zy.keyCodeToStr(f)}e.toUserSettingsUS=r;function o(f){return Qy.keyCodeToStr(f)}e.toUserSettingsGeneral=o;function l(f){return Zy.strToKeyCode(f)||Qy.strToKeyCode(f)}e.fromUserSettings=l;function d(f){if(f>=98&&f<=113)return null;switch(f){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return vm.keyCodeToStr(f)}e.toElectronAccelerator=d})(BE||={});var bO=class zE{constructor(t,s,r,o,l){this.ctrlKey=t,this.shiftKey=s,this.altKey=r,this.metaKey=o,this.keyCode=l}equals(t){return t instanceof zE&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",s=this.shiftKey?"1":"0",r=this.altKey?"1":"0",o=this.metaKey?"1":"0";return`K${t}${s}${r}${o}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new yO([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},yO=class{constructor(e){if(e.length===0)throw q7("chords");this.chords=e}getHashCode(){let e="";for(let t=0,s=this.chords.length;t<s;t++)t!==0&&(e+=";"),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};function xO(e){if(e.charCode){let s=String.fromCharCode(e.charCode).toUpperCase();return BE.fromString(s)}let t=e.keyCode;if(t===3)return 7;if(Jp)switch(t){case 59:return 85;case 60:if(mO)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Xs)return 57;break}else if(cO&&(Xs&&t===93||!Xs&&t===92))return 57;return vO[t]||0}var SO=Xs?256:2048,wO=512,EO=1024,CO=Xs?2048:256,Jy=class{constructor(e){this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=t.getModifierState?.("AltGraph"),this.keyCode=xO(t),this.code=t.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(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=SO),this.altKey&&(t|=wO),this.shiftKey&&(t|=EO),this.metaKey&&(t|=CO),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new bO(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},ex=new WeakMap;function NO(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,s=e.parent.location;if(t.origin!=="null"&&s.origin!=="null"&&t.origin!==s.origin)return null}catch{return null}return e.parent}var kO=class{static getSameOriginWindowChain(e){let t=ex.get(e);if(!t){t=[],ex.set(e,t);let s=e,r;do r=NO(s),r?t.push({window:new WeakRef(s),iframeElement:s.frameElement||null}):t.push({window:new WeakRef(s),iframeElement:null}),s=r;while(s)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let s=0,r=0,o=this.getSameOriginWindowChain(e);for(let l of o){let d=l.window.deref();if(s+=d?.scrollY??0,r+=d?.scrollX??0,d===t||!l.iframeElement)break;let f=l.iframeElement.getBoundingClientRect();s+=f.top,r+=f.left}return{top:s,left:r}}},Fu=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type==="dblclick"&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX=="number"?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let s=kO.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=s.left,this.posy-=s.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},tx=class{constructor(e,t=0,s=0){this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=s,this.deltaX=t;let r=!1;if(c0){let o=navigator.userAgent.match(/Chrome\/(\d+)/);r=(o?parseInt(o[1]):123)<=122}if(e){let o=e,l=e,d=e.view?.devicePixelRatio||1;if(typeof o.wheelDeltaY<"u")r?this.deltaY=o.wheelDeltaY/(120*d):this.deltaY=o.wheelDeltaY/120;else if(typeof l.VERTICAL_AXIS<"u"&&l.axis===l.VERTICAL_AXIS)this.deltaY=-l.detail/3;else if(e.type==="wheel"){let f=e;f.deltaMode===f.DOM_DELTA_LINE?Jp&&!Xs?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof o.wheelDeltaX<"u")uO&&jE?this.deltaX=-(o.wheelDeltaX/120):r?this.deltaX=o.wheelDeltaX/(120*d):this.deltaX=o.wheelDeltaX/120;else if(typeof l.HORIZONTAL_AXIS<"u"&&l.axis===l.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let f=e;f.deltaMode===f.DOM_DELTA_LINE?Jp&&!Xs?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(r?this.deltaY=e.wheelDelta/(120*d):this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}},PE=Object.freeze(function(e,t){let s=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(s)}}}),TO;(e=>{function t(s){return s===e.None||s===e.Cancelled||s instanceof MO?!0:!s||typeof s!="object"?!1:typeof s.isCancellationRequested=="boolean"&&typeof s.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:wi.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:PE})})(TO||={});var MO=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?PE:(this._emitter||(this._emitter=new he),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},d0=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new Gp("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new Gp("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},AO=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,s=globalThis){if(this.isDisposed)throw new Gp("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let r=s.setInterval(()=>{e()},t);this.disposable=Mt(()=>{s.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},RO;(e=>{async function t(r){let o,l=await Promise.all(r.map(d=>d.then(f=>f,f=>{o||(o=f)})));if(typeof o<"u")throw o;return l}e.settled=t;function s(r){return new Promise(async(o,l)=>{try{await r(o,l)}catch(d){l(d)}})}e.withAsyncBody=s})(RO||={});var ix=class xs{static fromArray(t){return new xs(s=>{s.emitMany(t)})}static fromPromise(t){return new xs(async s=>{s.emitMany(await t)})}static fromPromises(t){return new xs(async s=>{await Promise.all(t.map(async r=>s.emitOne(await r)))})}static merge(t){return new xs(async s=>{await Promise.all(t.map(async r=>{for await(let o of r)s.emitOne(o)}))})}constructor(t,s){this._state=0,this._results=[],this._error=null,this._onReturn=s,this._onStateChanged=new he,queueMicrotask(async()=>{let r={emitOne:o=>this.emitOne(o),emitMany:o=>this.emitMany(o),reject:o=>this.reject(o)};try{await Promise.resolve(t(r)),this.resolve()}catch(o){this.reject(o)}finally{r.emitOne=void 0,r.emitMany=void 0,r.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await wi.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,s){return new xs(async r=>{for await(let o of t)r.emitOne(s(o))})}map(t){return xs.map(this,t)}static filter(t,s){return new xs(async r=>{for await(let o of t)s(o)&&r.emitOne(o)})}filter(t){return xs.filter(this,t)}static coalesce(t){return xs.filter(t,s=>!!s)}coalesce(){return xs.coalesce(this)}static async toPromise(t){let s=[];for await(let r of t)s.push(r);return s}toPromise(){return xs.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};ix.EMPTY=ix.fromArray([]);var{getWindow:Ws,getWindowId:DO,onDidRegisterWindow:OO}=(function(){let e=new Map,t={window:Bn,disposables:new kr};e.set(Bn.vscodeWindowId,t);let s=new he,r=new he,o=new he;function l(d,f){return(typeof d=="number"?e.get(d):void 0)??(f?t:void 0)}return{onDidRegisterWindow:s.event,onWillUnregisterWindow:o.event,onDidUnregisterWindow:r.event,registerWindow(d){if(e.has(d.vscodeWindowId))return Ke.None;let f=new kr,m={window:d,disposables:f.add(new kr)};return e.set(d.vscodeWindowId,m),f.add(Mt(()=>{e.delete(d.vscodeWindowId),r.fire(d)})),f.add(Pe(d,ui.BEFORE_UNLOAD,()=>{o.fire(d)})),s.fire(m),f},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(d){return d.vscodeWindowId},hasWindow(d){return e.has(d)},getWindowById:l,getWindow(d){let f=d;if(f?.ownerDocument?.defaultView)return f.ownerDocument.defaultView.window;let m=d;return m?.view?m.view.window:Bn},getDocument(d){return Ws(d).document}}})(),LO=class{constructor(e,t,s,r){this._node=e,this._type=t,this._handler=s,this._options=r||!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 Pe(e,t,s,r){return new LO(e,t,s,r)}var sx=function(e,t,s,r){return Pe(e,t,s,r)},h0,jO=class extends AO{constructor(e){super(),this.defaultTarget=e&&Ws(e)}cancelAndSet(e,t,s){return super.cancelAndSet(e,t,s??this.defaultTarget)}},nx=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){td(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,s=new Map,r=new Map,o=l=>{s.set(l,!1);let d=e.get(l)??[];for(t.set(l,d),e.set(l,[]),r.set(l,!0);d.length>0;)d.sort(nx.sort),d.shift().execute();r.set(l,!1)};h0=(l,d,f=0)=>{let m=DO(l),h=new nx(d,f),_=e.get(m);return _||(_=[],e.set(m,_)),_.push(h),s.get(m)||(s.set(m,!0),l.requestAnimationFrame(()=>o(m))),h}})();function BO(e){let t=e.getBoundingClientRect(),s=Ws(e);return{left:t.left+s.scrollX,top:t.top+s.scrollY,width:t.width,height:t.height}}var ui={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"},zO=class{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){let t=Ki(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=Ki(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=Ki(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=Ki(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=Ki(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=Ki(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=Ki(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=Ki(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=Ki(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=Ki(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=Ki(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=Ki(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=Ki(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=Ki(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function Ki(e){return typeof e=="number"?`${e}px`:e}function Gl(e){return new zO(e)}var IE=class{constructor(){this._hooks=new kr,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let s=this._onStopCallback;this._onStopCallback=null,e&&s&&s(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,s,r,o){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=o;let l=e;try{e.setPointerCapture(t),this._hooks.add(Mt(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{l=Ws(e)}this._hooks.add(Pe(l,ui.POINTER_MOVE,d=>{if(d.buttons!==s){this.stopMonitoring(!0);return}d.preventDefault(),this._pointerMoveCallback(d)})),this._hooks.add(Pe(l,ui.POINTER_UP,d=>this.stopMonitoring(!0)))}};function PO(e,t,s){let r=null,o=null;if(typeof s.value=="function"?(r="value",o=s.value,o.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof s.get=="function"&&(r="get",o=s.get),!o)throw new Error("not supported");let l=`$memoize$${t}`;s[r]=function(...d){return this.hasOwnProperty(l)||Object.defineProperty(this,l,{configurable:!1,enumerable:!1,writable:!1,value:o.apply(this,d)}),this[l]}}var qs;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(qs||={});var Pl=class Mi extends Ke{constructor(){super(),this.dispatched=!1,this.targets=new Wy,this.ignoreTargets=new Wy,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(wi.runAndSubscribe(OO,({window:t,disposables:s})=>{s.add(Pe(t.document,"touchstart",r=>this.onTouchStart(r),{passive:!1})),s.add(Pe(t.document,"touchend",r=>this.onTouchEnd(t,r))),s.add(Pe(t.document,"touchmove",r=>this.onTouchMove(r),{passive:!1}))},{window:Bn,disposables:this._store}))}static addTarget(t){if(!Mi.isTouchDevice())return Ke.None;Mi.INSTANCE||(Mi.INSTANCE=new Mi);let s=Mi.INSTANCE.targets.push(t);return Mt(s)}static ignoreTarget(t){if(!Mi.isTouchDevice())return Ke.None;Mi.INSTANCE||(Mi.INSTANCE=new Mi);let s=Mi.INSTANCE.ignoreTargets.push(t);return Mt(s)}static isTouchDevice(){return"ontouchstart"in Bn||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let s=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let r=0,o=t.targetTouches.length;r<o;r++){let l=t.targetTouches.item(r);this.activeTouches[l.identifier]={id:l.identifier,initialTarget:l.target,initialTimeStamp:s,initialPageX:l.pageX,initialPageY:l.pageY,rollingTimestamps:[s],rollingPageX:[l.pageX],rollingPageY:[l.pageY]};let d=this.newGestureEvent(qs.Start,l.target);d.pageX=l.pageX,d.pageY=l.pageY,this.dispatchEvent(d)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,s){let r=Date.now(),o=Object.keys(this.activeTouches).length;for(let l=0,d=s.changedTouches.length;l<d;l++){let f=s.changedTouches.item(l);if(!this.activeTouches.hasOwnProperty(String(f.identifier))){console.warn("move of an UNKNOWN touch",f);continue}let m=this.activeTouches[f.identifier],h=Date.now()-m.initialTimeStamp;if(h<Mi.HOLD_DELAY&&Math.abs(m.initialPageX-ns(m.rollingPageX))<30&&Math.abs(m.initialPageY-ns(m.rollingPageY))<30){let _=this.newGestureEvent(qs.Tap,m.initialTarget);_.pageX=ns(m.rollingPageX),_.pageY=ns(m.rollingPageY),this.dispatchEvent(_)}else if(h>=Mi.HOLD_DELAY&&Math.abs(m.initialPageX-ns(m.rollingPageX))<30&&Math.abs(m.initialPageY-ns(m.rollingPageY))<30){let _=this.newGestureEvent(qs.Contextmenu,m.initialTarget);_.pageX=ns(m.rollingPageX),_.pageY=ns(m.rollingPageY),this.dispatchEvent(_)}else if(o===1){let _=ns(m.rollingPageX),v=ns(m.rollingPageY),b=ns(m.rollingTimestamps)-m.rollingTimestamps[0],y=_-m.rollingPageX[0],x=v-m.rollingPageY[0],w=[...this.targets].filter(N=>m.initialTarget instanceof Node&&N.contains(m.initialTarget));this.inertia(t,w,r,Math.abs(y)/b,y>0?1:-1,_,Math.abs(x)/b,x>0?1:-1,v)}this.dispatchEvent(this.newGestureEvent(qs.End,m.initialTarget)),delete this.activeTouches[f.identifier]}this.dispatched&&(s.preventDefault(),s.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,s){let r=document.createEvent("CustomEvent");return r.initEvent(t,!1,!0),r.initialTarget=s,r.tapCount=0,r}dispatchEvent(t){if(t.type===qs.Tap){let s=new Date().getTime(),r=0;s-this._lastSetTapCountTime>Mi.CLEAR_TAP_COUNT_TIME?r=1:r=2,this._lastSetTapCountTime=s,t.tapCount=r}else(t.type===qs.Change||t.type===qs.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let r of this.ignoreTargets)if(r.contains(t.initialTarget))return;let s=[];for(let r of this.targets)if(r.contains(t.initialTarget)){let o=0,l=t.initialTarget;for(;l&&l!==r;)o++,l=l.parentElement;s.push([o,r])}s.sort((r,o)=>r[0]-o[0]);for(let[r,o]of s)o.dispatchEvent(t),this.dispatched=!0}}inertia(t,s,r,o,l,d,f,m,h){this.handle=h0(t,()=>{let _=Date.now(),v=_-r,b=0,y=0,x=!0;o+=Mi.SCROLL_FRICTION*v,f+=Mi.SCROLL_FRICTION*v,o>0&&(x=!1,b=l*o*v),f>0&&(x=!1,y=m*f*v);let w=this.newGestureEvent(qs.Change);w.translationX=b,w.translationY=y,s.forEach(N=>N.dispatchEvent(w)),x||this.inertia(t,s,_,o,l,d+b,f,m,h+y)})}onTouchMove(t){let s=Date.now();for(let r=0,o=t.changedTouches.length;r<o;r++){let l=t.changedTouches.item(r);if(!this.activeTouches.hasOwnProperty(String(l.identifier))){console.warn("end of an UNKNOWN touch",l);continue}let d=this.activeTouches[l.identifier],f=this.newGestureEvent(qs.Change,d.initialTarget);f.translationX=l.pageX-ns(d.rollingPageX),f.translationY=l.pageY-ns(d.rollingPageY),f.pageX=l.pageX,f.pageY=l.pageY,this.dispatchEvent(f),d.rollingPageX.length>3&&(d.rollingPageX.shift(),d.rollingPageY.shift(),d.rollingTimestamps.shift()),d.rollingPageX.push(l.pageX),d.rollingPageY.push(l.pageY),d.rollingTimestamps.push(s)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};Pl.SCROLL_FRICTION=-.005,Pl.HOLD_DELAY=700,Pl.CLEAR_TAP_COUNT_TIME=400,Pt([PO],Pl,"isTouchDevice",1);var IO=Pl,f0=class extends Ke{onclick(e,t){this._register(Pe(e,ui.CLICK,s=>t(new Fu(Ws(e),s))))}onmousedown(e,t){this._register(Pe(e,ui.MOUSE_DOWN,s=>t(new Fu(Ws(e),s))))}onmouseover(e,t){this._register(Pe(e,ui.MOUSE_OVER,s=>t(new Fu(Ws(e),s))))}onmouseleave(e,t){this._register(Pe(e,ui.MOUSE_LEAVE,s=>t(new Fu(Ws(e),s))))}onkeydown(e,t){this._register(Pe(e,ui.KEY_DOWN,s=>t(new Jy(s))))}onkeyup(e,t){this._register(Pe(e,ui.KEY_UP,s=>t(new Jy(s))))}oninput(e,t){this._register(Pe(e,ui.INPUT,t))}onblur(e,t){this._register(Pe(e,ui.BLUR,t))}onfocus(e,t){this._register(Pe(e,ui.FOCUS,t))}onchange(e,t){this._register(Pe(e,ui.CHANGE,t))}ignoreGesture(e){return IO.ignoreTarget(e)}},rx=11,UO=class extends f0{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width=rx+"px",this.domNode.style.height=rx+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new IE),this._register(sx(this.bgDomNode,ui.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(sx(this.domNode,ui.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new jO),this._pointerdownScheduleRepeatTimer=this._register(new d0)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Ws(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,s=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},HO=class ig{constructor(t,s,r,o,l,d,f){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(s=s|0,r=r|0,o=o|0,l=l|0,d=d|0,f=f|0),this.rawScrollLeft=o,this.rawScrollTop=f,s<0&&(s=0),o+s>r&&(o=r-s),o<0&&(o=0),l<0&&(l=0),f+l>d&&(f=d-l),f<0&&(f=0),this.width=s,this.scrollWidth=r,this.scrollLeft=o,this.height=l,this.scrollHeight=d,this.scrollTop=f}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,s){return new ig(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,s?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,s?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new ig(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,s){let r=this.width!==t.width,o=this.scrollWidth!==t.scrollWidth,l=this.scrollLeft!==t.scrollLeft,d=this.height!==t.height,f=this.scrollHeight!==t.scrollHeight,m=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:s,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:r,scrollWidthChanged:o,scrollLeftChanged:l,heightChanged:d,scrollHeightChanged:f,scrollTopChanged:m}}},FO=class extends Ke{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new he),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new HO(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){let s=this._state.withScrollDimensions(e,t);this._setState(s,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let s=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===s.scrollLeft&&this._smoothScrolling.to.scrollTop===s.scrollTop)return;let r;t?r=new ox(this._smoothScrolling.from,s,this._smoothScrolling.startTime,this._smoothScrolling.duration):r=this._smoothScrolling.combine(this._state,s,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=r}else{let s=this._state.withScrollPosition(e);this._smoothScrolling=ox.start(this._state,s,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let s=this._state;s.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(s,t)))}},ax=class{constructor(e,t,s){this.scrollLeft=e,this.scrollTop=t,this.isDone=s}};function bm(e,t){let s=t-e;return function(r){return e+s*qO(r)}}function VO(e,t,s){return function(r){return r<s?e(r/s):t((r-s)/(1-s))}}var ox=class sg{constructor(t,s,r,o){this.from=t,this.to=s,this.duration=o,this.startTime=r,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(t,s,r){if(Math.abs(t-s)>2.5*r){let o,l;return t<s?(o=t+.75*r,l=s-.75*r):(o=t-.75*r,l=s+.75*r),VO(bm(t,o),bm(l,s),.33)}return bm(t,s)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(t){this.to=t.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(t){let s=(t-this.startTime)/this.duration;if(s<1){let r=this.scrollLeft(s),o=this.scrollTop(s);return new ax(r,o,!1)}return new ax(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,s,r){return sg.start(t,s,r)}static start(t,s,r){r=r+10;let o=Date.now()-10;return new sg(t,s,o,r)}};function $O(e){return Math.pow(e,3)}function qO(e){return 1-$O(1-e)}var KO=class extends Ke{constructor(e,t,s){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=s,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new d0)}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":"")))}},GO=140,UE=class extends f0{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 KO(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new IE),this._shouldRender=!0,this.domNode=Gl(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(Pe(this.domNode.domNode,ui.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new UO(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,s,r){this.slider=Gl(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof s=="number"&&this.slider.setWidth(s),typeof r=="number"&&this.slider.setHeight(r),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Pe(this.slider.domNode,ui.POINTER_DOWN,o=>{o.button===0&&(o.preventDefault(),this._sliderPointerDown(o))})),this.onclick(this.slider.domNode,o=>{o.leftButton&&o.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,s=t+this._scrollbarState.getSliderPosition(),r=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderPointerPosition(e);s<=o&&o<=r?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,s;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,s=e.offsetY;else{let o=BO(this.domNode.domNode);t=e.pageX-o.left,s=e.pageY-o.top}let r=this._pointerDownRelativePosition(t,s);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(r):this._scrollbarState.getDesiredScrollPositionFromOffset(r)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),s=this._sliderOrthogonalPointerPosition(e),r=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>{let l=this._sliderOrthogonalPointerPosition(o),d=Math.abs(l-s);if(jE&&d>GO){this._setDesiredScrollPositionNow(r.getScrollPosition());return}let f=this._sliderPointerPosition(o)-t;this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(f))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},HE=class ng{constructor(t,s,r,o,l,d){this._scrollbarSize=Math.round(s),this._oppositeScrollbarSize=Math.round(r),this._arrowSize=Math.round(t),this._visibleSize=o,this._scrollSize=l,this._scrollPosition=d,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new ng(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let s=Math.round(t);return this._visibleSize!==s?(this._visibleSize=s,this._refreshComputedValues(),!0):!1}setScrollSize(t){let s=Math.round(t);return this._scrollSize!==s?(this._scrollSize=s,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let s=Math.round(t);return this._scrollPosition!==s?(this._scrollPosition=s,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,s,r,o,l){let d=Math.max(0,r-t),f=Math.max(0,d-2*s),m=o>0&&o>r;if(!m)return{computedAvailableSize:Math.round(d),computedIsNeeded:m,computedSliderSize:Math.round(f),computedSliderRatio:0,computedSliderPosition:0};let h=Math.round(Math.max(20,Math.floor(r*f/o))),_=(f-h)/(o-r),v=l*_;return{computedAvailableSize:Math.round(d),computedIsNeeded:m,computedSliderSize:Math.round(h),computedSliderRatio:_,computedSliderPosition:Math.round(v)}}_refreshComputedValues(){let t=ng._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(t){if(!this._computedIsNeeded)return 0;let s=t-this._arrowSize-this._computedSliderSize/2;return Math.round(s/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let s=t-this._arrowSize,r=this._scrollPosition;return s<this._computedSliderPosition?r-=this._visibleSize:r+=this._visibleSize,r}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let s=this._computedSliderPosition+t;return Math.round(s/this._computedSliderRatio)}},WO=class extends UE{constructor(e,t,s){let r=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:s,scrollbarState:new HE(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,r.width,r.scrollWidth,o.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},YO=class extends UE{constructor(e,t,s){let r=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:s,scrollbarState:new HE(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,r.height,r.scrollHeight,o.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},XO=500,lx=50,ZO=class{constructor(e,t,s){this.timestamp=e,this.deltaX=t,this.deltaY=s,this.score=0}},rg=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let t=1,s=0,r=1,o=this._rear;do{let l=o===this._front?t:Math.pow(2,-r);if(t-=l,s+=this._memory[o].score*l,o===this._front)break;o=(this._capacity+o-1)%this._capacity,r++}while(!0);return s<=.5}acceptStandardWheelEvent(t){if(c0){let s=Ws(t.browserEvent),r=lO(s);this.accept(Date.now(),t.deltaX*r,t.deltaY*r)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,s,r){let o=null,l=new ZO(t,s,r);this._front===-1&&this._rear===-1?(this._memory[0]=l,this._front=0,this._rear=0):(o=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,o)}_computeScore(t,s){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let r=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(r+=.25),s){let o=Math.abs(t.deltaX),l=Math.abs(t.deltaY),d=Math.abs(s.deltaX),f=Math.abs(s.deltaY),m=Math.max(Math.min(o,d),1),h=Math.max(Math.min(l,f),1),_=Math.max(o,d),v=Math.max(l,f);_%m===0&&v%h===0&&(r-=.5)}return Math.min(Math.max(r,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};rg.INSTANCE=new rg;var QO=rg,JO=class extends f0{constructor(e,t,s){super(),this._onScroll=this._register(new he),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new he),this.onWillScroll=this._onWillScroll.event,this._options=tL(t),this._scrollable=s,this._register(this._scrollable.onScroll(o=>{this._onWillScroll.fire(o),this._onDidScroll(o),this._onScroll.fire(o)}));let r={onMouseWheel:o=>this._onMouseWheel(o),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new YO(this._scrollable,this._options,r)),this._horizontalScrollbar=this._register(new WO(this._scrollable,this._options,r)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=Gl(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Gl(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Gl(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,o=>this._onMouseOver(o)),this.onmouseleave(this._listenOnDomNode,o=>this._onMouseLeave(o)),this._hideTimeout=this._register(new d0),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=ma(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,Xs&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new tx(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=ma(this._mouseWheelToDispose),e)){let t=s=>{this._onMouseWheel(new tx(s))};this._mouseWheelToDispose.push(Pe(this._listenOnDomNode,ui.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=QO.INSTANCE;t.acceptStandardWheelEvent(e);let s=!1;if(e.deltaY||e.deltaX){let o=e.deltaY*this._options.mouseWheelScrollSensitivity,l=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&l+o===0?l=o=0:Math.abs(o)>=Math.abs(l)?l=0:o=0),this._options.flipAxes&&([o,l]=[l,o]);let d=!Xs&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||d)&&!l&&(l=o,o=0),e.browserEvent&&e.browserEvent.altKey&&(l=l*this._options.fastScrollSensitivity,o=o*this._options.fastScrollSensitivity);let f=this._scrollable.getFutureScrollPosition(),m={};if(o){let h=lx*o,_=f.scrollTop-(h<0?Math.floor(h):Math.ceil(h));this._verticalScrollbar.writeScrollPosition(m,_)}if(l){let h=lx*l,_=f.scrollLeft-(h<0?Math.floor(h):Math.ceil(h));this._horizontalScrollbar.writeScrollPosition(m,_)}m=this._scrollable.validateScrollPosition(m),(f.scrollLeft!==m.scrollLeft||f.scrollTop!==m.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(m):this._scrollable.setScrollPositionNow(m),s=!0)}let r=s;!r&&this._options.alwaysConsumeMouseWheel&&(r=!0),!r&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(r=!0),r&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,s=e.scrollLeft>0,r=s?" left":"",o=t?" top":"",l=s||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${r}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${l}${o}${r}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),XO)}},eL=class extends JO{constructor(e,t,s){super(e,t,s)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function tL(e){let t={lazyRender:typeof e.lazyRender<"u"?e.lazyRender:!1,className:typeof e.className<"u"?e.className:"",useShadows:typeof e.useShadows<"u"?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<"u"?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<"u"?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<"u"?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<"u"?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<"u"?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<"u"?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<"u"?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<"u"?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<"u"?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<"u"?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<"u"?e.listenOnDomNode:null,horizontal:typeof e.horizontal<"u"?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<"u"?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<"u"?e.horizontalHasArrows:!1,vertical:typeof e.vertical<"u"?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<"u"?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<"u"?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<"u"?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<"u"?e.scrollByPage:!1};return t.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:t.verticalScrollbarSize,Xs&&(t.className+=" mac"),t}var ag=class extends Ke{constructor(e,t,s,r,o,l,d,f){super(),this._bufferService=s,this._optionsService=d,this._renderService=f,this._onRequestScrollLines=this._register(new he),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let m=this._register(new FO({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:h=>h0(r.window,h)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{m.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new eL(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},m)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(o.onProtocolChange(h=>{this._scrollableElement.updateOptions({handleMouseWheel:!(h&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(wi.runAndSubscribe(l.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=l.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(Mt(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=r.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(Mt(()=>this._styleElement.remove())),this._register(wi.runAndSubscribe(l.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${l.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${l.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${l.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
|
|
28
|
-
`)})),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(h=>this._handleScroll(h)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),s=t-this._bufferService.buffer.ydisp;s!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(s)),this._isHandlingScroll=!1}};ag=Pt([be(2,ji),be(3,In),be(4,xE),be(5,Eo),be(6,Bi),be(7,Un)],ag);var og=class extends Ke{constructor(e,t,s,r,o){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=s,this._decorationService=r,this._renderService=o,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(l=>this._removeDecoration(l))),this._register(Mt(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",e?.options?.layer==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let s=e.options.x??0;return s&&s>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let s=this._decorationElements.get(e);s||(s=this._createElement(e),e.element=s,this._decorationElements.set(e,s),this._container.appendChild(s),e.onDispose(()=>{this._decorationElements.delete(e),s.remove()})),s.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(s.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,s.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,s.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,s.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(s)}}_refreshXPosition(e,t=e.element){if(!t)return;let s=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=s?`${s*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=s?`${s*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};og=Pt([be(1,ji),be(2,In),be(3,pc),be(4,Un)],og);var iL=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,s){return t>=e.startBufferLine-this._linePadding[s||"full"]&&t<=e.endBufferLine+this._linePadding[s||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},Vs={full:0,left:0,center:0,right:0},yr={full:0,left:0,center:0,right:0},Tl={full:0,left:0,center:0,right:0},xd=class extends Ke{constructor(e,t,s,r,o,l,d,f){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=s,this._decorationService=r,this._renderService=o,this._optionsService=l,this._themeService=d,this._coreBrowserService=f,this._colorZoneStore=new iL,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(Mt(()=>this._canvas?.remove()));let m=this._canvas.getContext("2d");if(m)this._ctx=m;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),this._register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this._register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){return this._optionsService.options.overviewRuler?.width||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);yr.full=this._canvas.width,yr.left=e,yr.center=t,yr.right=e,this._refreshDrawHeightConstants(),Tl.full=1,Tl.left=1,Tl.center=1+yr.left,Tl.right=1+yr.left+yr.center}_refreshDrawHeightConstants(){Vs.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);Vs.left=t,Vs.center=t,Vs.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Vs.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Vs.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Vs.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Vs.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let t of this._decorationService.decorations)this._colorZoneStore.addDecoration(t);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!=="full"&&this._renderColorZone(t);for(let t of e)t.position==="full"&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(Tl[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-Vs[e.position||"full"]/2),yr[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+Vs[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};xd=Pt([be(2,ji),be(3,pc),be(4,Un),be(5,Bi),be(6,Eo),be(7,In)],xd);var oe;(e=>(e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="\x07",e.BS="\b",e.HT=" ",e.LF=`
|
|
29
|
-
`,e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="\x1B",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""))(oe||={});var nd;(e=>(e.PAD="",e.HOP="",e.BPH="",e.NBH="",e.IND="",e.NEL="
",e.SSA="",e.ESA="",e.HTS="",e.HTJ="",e.VTS="",e.PLD="",e.PLU="",e.RI="",e.SS2="",e.SS3="",e.DCS="",e.PU1="",e.PU2="",e.STS="",e.CCH="",e.MW="",e.SPA="",e.EPA="",e.SOS="",e.SGCI="",e.SCI="",e.CSI="",e.ST="",e.OSC="",e.PM="",e.APC=""))(nd||={});var FE;(e=>e.ST=`${oe.ESC}\\`)(FE||={});var lg=class{constructor(e,t,s,r,o,l){this._textarea=e,this._compositionView=t,this._bufferService=s,this._optionsService=r,this._coreService=o,this._renderService=l,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let s;t.start+=this._dataAlreadySent.length,this._isComposing?s=this._textarea.value.substring(t.start,this._compositionPosition.start):s=this._textarea.value.substring(t.start),s.length>0&&this._coreService.triggerDataEvent(s,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,s=t.replace(e,"");this._dataAlreadySent=s,t.length>e.length?this._coreService.triggerDataEvent(s,!0):t.length<e.length?this._coreService.triggerDataEvent(`${oe.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),s=this._renderService.dimensions.css.cell.height,r=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,o=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=o+"px",this._compositionView.style.top=r+"px",this._compositionView.style.height=s+"px",this._compositionView.style.lineHeight=s+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let l=this._compositionView.getBoundingClientRect();this._textarea.style.left=o+"px",this._textarea.style.top=r+"px",this._textarea.style.width=Math.max(l.width,1)+"px",this._textarea.style.height=Math.max(l.height,1)+"px",this._textarea.style.lineHeight=l.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};lg=Pt([be(2,ji),be(3,Bi),be(4,ba),be(5,Un)],lg);var di=0,hi=0,fi=0,zt=0,cx={css:"#00000000",rgba:0},ti;(e=>{function t(o,l,d,f){return f!==void 0?`#${na(o)}${na(l)}${na(d)}${na(f)}`:`#${na(o)}${na(l)}${na(d)}`}e.toCss=t;function s(o,l,d,f=255){return(o<<24|l<<16|d<<8|f)>>>0}e.toRgba=s;function r(o,l,d,f){return{css:e.toCss(o,l,d,f),rgba:e.toRgba(o,l,d,f)}}e.toColor=r})(ti||={});var Ct;(e=>{function t(m,h){if(zt=(h.rgba&255)/255,zt===1)return{css:h.css,rgba:h.rgba};let _=h.rgba>>24&255,v=h.rgba>>16&255,b=h.rgba>>8&255,y=m.rgba>>24&255,x=m.rgba>>16&255,w=m.rgba>>8&255;di=y+Math.round((_-y)*zt),hi=x+Math.round((v-x)*zt),fi=w+Math.round((b-w)*zt);let N=ti.toCss(di,hi,fi),A=ti.toRgba(di,hi,fi);return{css:N,rgba:A}}e.blend=t;function s(m){return(m.rgba&255)===255}e.isOpaque=s;function r(m,h,_){let v=rd.ensureContrastRatio(m.rgba,h.rgba,_);if(v)return ti.toColor(v>>24&255,v>>16&255,v>>8&255)}e.ensureContrastRatio=r;function o(m){let h=(m.rgba|255)>>>0;return[di,hi,fi]=rd.toChannels(h),{css:ti.toCss(di,hi,fi),rgba:h}}e.opaque=o;function l(m,h){return zt=Math.round(h*255),[di,hi,fi]=rd.toChannels(m.rgba),{css:ti.toCss(di,hi,fi,zt),rgba:ti.toRgba(di,hi,fi,zt)}}e.opacity=l;function d(m,h){return zt=m.rgba&255,l(m,zt*h/255)}e.multiplyOpacity=d;function f(m){return[m.rgba>>24&255,m.rgba>>16&255,m.rgba>>8&255]}e.toColorRGB=f})(Ct||={});var Ot;(e=>{let t,s;try{let o=document.createElement("canvas");o.width=1,o.height=1;let l=o.getContext("2d",{willReadFrequently:!0});l&&(t=l,t.globalCompositeOperation="copy",s=t.createLinearGradient(0,0,1,1))}catch{}function r(o){if(o.match(/#[\da-f]{3,8}/i))switch(o.length){case 4:return di=parseInt(o.slice(1,2).repeat(2),16),hi=parseInt(o.slice(2,3).repeat(2),16),fi=parseInt(o.slice(3,4).repeat(2),16),ti.toColor(di,hi,fi);case 5:return di=parseInt(o.slice(1,2).repeat(2),16),hi=parseInt(o.slice(2,3).repeat(2),16),fi=parseInt(o.slice(3,4).repeat(2),16),zt=parseInt(o.slice(4,5).repeat(2),16),ti.toColor(di,hi,fi,zt);case 7:return{css:o,rgba:(parseInt(o.slice(1),16)<<8|255)>>>0};case 9:return{css:o,rgba:parseInt(o.slice(1),16)>>>0}}let l=o.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 di=parseInt(l[1]),hi=parseInt(l[2]),fi=parseInt(l[3]),zt=Math.round((l[5]===void 0?1:parseFloat(l[5]))*255),ti.toColor(di,hi,fi,zt);if(!t||!s)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=s,t.fillStyle=o,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[di,hi,fi,zt]=t.getImageData(0,0,1,1).data,zt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:ti.toRgba(di,hi,fi,zt),css:o}}e.toColor=r})(Ot||={});var Di;(e=>{function t(r){return s(r>>16&255,r>>8&255,r&255)}e.relativeLuminance=t;function s(r,o,l){let d=r/255,f=o/255,m=l/255,h=d<=.03928?d/12.92:Math.pow((d+.055)/1.055,2.4),_=f<=.03928?f/12.92:Math.pow((f+.055)/1.055,2.4),v=m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4);return h*.2126+_*.7152+v*.0722}e.relativeLuminance2=s})(Di||={});var rd;(e=>{function t(d,f){if(zt=(f&255)/255,zt===1)return f;let m=f>>24&255,h=f>>16&255,_=f>>8&255,v=d>>24&255,b=d>>16&255,y=d>>8&255;return di=v+Math.round((m-v)*zt),hi=b+Math.round((h-b)*zt),fi=y+Math.round((_-y)*zt),ti.toRgba(di,hi,fi)}e.blend=t;function s(d,f,m){let h=Di.relativeLuminance(d>>8),_=Di.relativeLuminance(f>>8);if(Ln(h,_)<m){if(_<h){let y=r(d,f,m),x=Ln(h,Di.relativeLuminance(y>>8));if(x<m){let w=o(d,f,m),N=Ln(h,Di.relativeLuminance(w>>8));return x>N?y:w}return y}let v=o(d,f,m),b=Ln(h,Di.relativeLuminance(v>>8));if(b<m){let y=r(d,f,m),x=Ln(h,Di.relativeLuminance(y>>8));return b>x?v:y}return v}}e.ensureContrastRatio=s;function r(d,f,m){let h=d>>24&255,_=d>>16&255,v=d>>8&255,b=f>>24&255,y=f>>16&255,x=f>>8&255,w=Ln(Di.relativeLuminance2(b,y,x),Di.relativeLuminance2(h,_,v));for(;w<m&&(b>0||y>0||x>0);)b-=Math.max(0,Math.ceil(b*.1)),y-=Math.max(0,Math.ceil(y*.1)),x-=Math.max(0,Math.ceil(x*.1)),w=Ln(Di.relativeLuminance2(b,y,x),Di.relativeLuminance2(h,_,v));return(b<<24|y<<16|x<<8|255)>>>0}e.reduceLuminance=r;function o(d,f,m){let h=d>>24&255,_=d>>16&255,v=d>>8&255,b=f>>24&255,y=f>>16&255,x=f>>8&255,w=Ln(Di.relativeLuminance2(b,y,x),Di.relativeLuminance2(h,_,v));for(;w<m&&(b<255||y<255||x<255);)b=Math.min(255,b+Math.ceil((255-b)*.1)),y=Math.min(255,y+Math.ceil((255-y)*.1)),x=Math.min(255,x+Math.ceil((255-x)*.1)),w=Ln(Di.relativeLuminance2(b,y,x),Di.relativeLuminance2(h,_,v));return(b<<24|y<<16|x<<8|255)>>>0}e.increaseLuminance=o;function l(d){return[d>>24&255,d>>16&255,d>>8&255,d&255]}e.toChannels=l})(rd||={});function na(e){let t=e.toString(16);return t.length<2?"0"+t:t}function Ln(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var sL=class extends mc{constructor(e,t,s){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=s}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()]}},Sd=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new Ns}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let s=[],r=t.translateToString(!0),o=0,l=0,d=0,f=t.getFg(0),m=t.getBg(0);for(let h=0;h<t.getTrimmedLength();h++)if(t.loadCell(h,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==f||this._workCell.bg!==m){if(h-o>1){let _=this._getJoinedRanges(r,d,l,t,o);for(let v=0;v<_.length;v++)s.push(_[v])}o=h,d=l,f=this._workCell.fg,m=this._workCell.bg}l+=this._workCell.getChars().length||Nr.length}if(this._bufferService.cols-o>1){let h=this._getJoinedRanges(r,d,l,t,o);for(let _=0;_<h.length;_++)s.push(h[_])}return s}_getJoinedRanges(e,t,s,r,o){let l=e.substring(t,s),d=[];try{d=this._characterJoiners[0].handler(l)}catch(f){console.error(f)}for(let f=1;f<this._characterJoiners.length;f++)try{let m=this._characterJoiners[f].handler(l);for(let h=0;h<m.length;h++)Sd._mergeRanges(d,m[h])}catch(m){console.error(m)}return this._stringRangesToCellRanges(d,r,o),d}_stringRangesToCellRanges(e,t,s){let r=0,o=!1,l=0,d=e[r];if(d){for(let f=s;f<this._bufferService.cols;f++){let m=t.getWidth(f),h=t.getString(f).length||Nr.length;if(m!==0){if(!o&&d[0]<=l&&(d[0]=f,o=!0),d[1]<=l){if(d[1]=f,d=e[++r],!d)break;d[0]<=l?(d[0]=f,o=!0):o=!1}l+=h}}d&&(d[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let s=!1;for(let r=0;r<e.length;r++){let o=e[r];if(s){if(t[1]<=o[0])return e[r-1][1]=t[1],e;if(t[1]<=o[1])return e[r-1][1]=Math.max(t[1],o[1]),e.splice(r,1),e;e.splice(r,1),r--}else{if(t[1]<=o[0])return e.splice(r,0,t),e;if(t[1]<=o[1])return o[0]=Math.min(t[0],o[0]),e;t[0]<o[1]&&(o[0]=Math.min(t[0],o[0]),s=!0);continue}}return s?e[e.length-1][1]=t[1]:e.push(t),e}};Sd=Pt([be(0,ji)],Sd);function nL(e){return 57508<=e&&e<=57558}function rL(e){return 9472<=e&&e<=9631}function aL(e){return nL(e)||rL(e)}function oL(){return{css:{canvas:Vu(),cell:Vu()},device:{canvas:Vu(),cell:Vu(),char:{width:0,height:0,left:0,top:0}}}}function Vu(){return{width:0,height:0}}var cg=class{constructor(e,t,s,r,o,l,d){this._document=e,this._characterJoinerService=t,this._optionsService=s,this._coreBrowserService=r,this._coreService=o,this._decorationService=l,this._themeService=d,this._workCell=new Ns,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,s){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=s}createRow(e,t,s,r,o,l,d,f,m,h,_){let v=[],b=this._characterJoinerService.getJoinedCharacters(t),y=this._themeService.colors,x=e.getNoBgTrimmedLength();s&&x<l+1&&(x=l+1);let w,N=0,A="",R=0,T=0,M=0,z=0,U=!1,j=0,O=!1,K=0,H=0,G=[],J=h!==-1&&_!==-1;for(let I=0;I<x;I++){e.loadCell(I,this._workCell);let ee=this._workCell.getWidth();if(ee===0)continue;let q=!1,k=I>=H,F=I,V=this._workCell;if(b.length>0&&I===b[0][0]&&k){let je=b.shift(),It=this._isCellInSelection(je[0],t);for(R=je[0]+1;R<je[1];R++)k&&=It===this._isCellInSelection(R,t);k&&=!s||l<je[0]||l>=je[1],k?(q=!0,V=new sL(this._workCell,e.translateToString(!0,je[0],je[1]),je[1]-je[0]),F=je[1]-1,ee=V.getWidth()):H=je[1]}let Z=this._isCellInSelection(I,t),W=s&&I===l,D=J&&I>=h&&I<=_,ie=!1;this._decorationService.forEachDecorationAtCell(I,t,void 0,je=>{ie=!0});let ce=V.getChars()||Nr;if(ce===" "&&(V.isUnderline()||V.isOverline())&&(ce=" "),K=ee*f-m.get(ce,V.isBold(),V.isItalic()),!w)w=this._document.createElement("span");else if(N&&(Z&&O||!Z&&!O&&V.bg===T)&&(Z&&O&&y.selectionForeground||V.fg===M)&&V.extended.ext===z&&D===U&&K===j&&!W&&!q&&!ie&&k){V.isInvisible()?A+=Nr:A+=ce,N++;continue}else N&&(w.textContent=A),w=this._document.createElement("span"),N=0,A="";if(T=V.bg,M=V.fg,z=V.extended.ext,U=D,j=K,O=Z,q&&l>=I&&l<=F&&(l=I),!this._coreService.isCursorHidden&&W&&this._coreService.isCursorInitialized){if(G.push("xterm-cursor"),this._coreBrowserService.isFocused)d&&G.push("xterm-cursor-blink"),G.push(r==="bar"?"xterm-cursor-bar":r==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(o)switch(o){case"outline":G.push("xterm-cursor-outline");break;case"block":G.push("xterm-cursor-block");break;case"bar":G.push("xterm-cursor-bar");break;case"underline":G.push("xterm-cursor-underline");break}}if(V.isBold()&&G.push("xterm-bold"),V.isItalic()&&G.push("xterm-italic"),V.isDim()&&G.push("xterm-dim"),V.isInvisible()?A=Nr:A=V.getChars()||Nr,V.isUnderline()&&(G.push(`xterm-underline-${V.extended.underlineStyle}`),A===" "&&(A=" "),!V.isUnderlineColorDefault()))if(V.isUnderlineColorRGB())w.style.textDecorationColor=`rgb(${mc.toColorRGB(V.getUnderlineColor()).join(",")})`;else{let je=V.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&V.isBold()&&je<8&&(je+=8),w.style.textDecorationColor=y.ansi[je].css}V.isOverline()&&(G.push("xterm-overline"),A===" "&&(A=" ")),V.isStrikethrough()&&G.push("xterm-strikethrough"),D&&(w.style.textDecoration="underline");let le=V.getFgColor(),de=V.getFgColorMode(),ge=V.getBgColor(),Se=V.getBgColorMode(),Be=!!V.isInverse();if(Be){let je=le;le=ge,ge=je;let It=de;de=Se,Se=It}let Ee,it,rt=!1;this._decorationService.forEachDecorationAtCell(I,t,void 0,je=>{je.options.layer!=="top"&&rt||(je.backgroundColorRGB&&(Se=50331648,ge=je.backgroundColorRGB.rgba>>8&16777215,Ee=je.backgroundColorRGB),je.foregroundColorRGB&&(de=50331648,le=je.foregroundColorRGB.rgba>>8&16777215,it=je.foregroundColorRGB),rt=je.options.layer==="top")}),!rt&&Z&&(Ee=this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque,ge=Ee.rgba>>8&16777215,Se=50331648,rt=!0,y.selectionForeground&&(de=50331648,le=y.selectionForeground.rgba>>8&16777215,it=y.selectionForeground)),rt&&G.push("xterm-decoration-top");let at;switch(Se){case 16777216:case 33554432:at=y.ansi[ge],G.push(`xterm-bg-${ge}`);break;case 50331648:at=ti.toColor(ge>>16,ge>>8&255,ge&255),this._addStyle(w,`background-color:#${ux((ge>>>0).toString(16),"0",6)}`);break;default:Be?(at=y.foreground,G.push("xterm-bg-257")):at=y.background}switch(Ee||V.isDim()&&(Ee=Ct.multiplyOpacity(at,.5)),de){case 16777216:case 33554432:V.isBold()&&le<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(le+=8),this._applyMinimumContrast(w,at,y.ansi[le],V,Ee,void 0)||G.push(`xterm-fg-${le}`);break;case 50331648:let je=ti.toColor(le>>16&255,le>>8&255,le&255);this._applyMinimumContrast(w,at,je,V,Ee,it)||this._addStyle(w,`color:#${ux(le.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(w,at,y.foreground,V,Ee,it)||Be&&G.push("xterm-fg-257")}G.length&&(w.className=G.join(" "),G.length=0),!W&&!q&&!ie&&k?N++:w.textContent=A,K!==this.defaultSpacing&&(w.style.letterSpacing=`${K}px`),v.push(w),I=F}return w&&N&&(w.textContent=A),v}_applyMinimumContrast(e,t,s,r,o,l){if(this._optionsService.rawOptions.minimumContrastRatio===1||aL(r.getCode()))return!1;let d=this._getContrastCache(r),f;if(!o&&!l&&(f=d.getColor(t.rgba,s.rgba)),f===void 0){let m=this._optionsService.rawOptions.minimumContrastRatio/(r.isDim()?2:1);f=Ct.ensureContrastRatio(o||t,l||s,m),d.setColor((o||t).rgba,(l||s).rgba,f??null)}return f?(this._addStyle(e,`color:${f.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){let s=this._selectionStart,r=this._selectionEnd;return!s||!r?!1:this._columnSelectMode?s[0]<=r[0]?e>=s[0]&&t>=s[1]&&e<r[0]&&t<=r[1]:e<s[0]&&t>=s[1]&&e>=r[0]&&t<=r[1]:t>s[1]&&t<r[1]||s[1]===r[1]&&t===s[1]&&e>=s[0]&&e<r[0]||s[1]<r[1]&&t===r[1]&&e<r[0]||s[1]<r[1]&&t===s[1]&&e>=s[0]}};cg=Pt([be(1,EE),be(2,Bi),be(3,In),be(4,ba),be(5,pc),be(6,Eo)],cg);function ux(e,t,s){for(;e.length<s;)e=t+e;return e}var lL=class{constructor(e,t){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=e.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";let s=e.createElement("span");s.classList.add("xterm-char-measure-element");let r=e.createElement("span");r.classList.add("xterm-char-measure-element"),r.style.fontWeight="bold";let o=e.createElement("span");o.classList.add("xterm-char-measure-element"),o.style.fontStyle="italic";let l=e.createElement("span");l.classList.add("xterm-char-measure-element"),l.style.fontWeight="bold",l.style.fontStyle="italic",this._measureElements=[s,r,o,l],this._container.appendChild(s),this._container.appendChild(r),this._container.appendChild(o),this._container.appendChild(l),t.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(e,t,s,r){e===this._font&&t===this._fontSize&&s===this._weight&&r===this._weightBold||(this._font=e,this._fontSize=t,this._weight=s,this._weightBold=r,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${s}`,this._measureElements[1].style.fontWeight=`${r}`,this._measureElements[2].style.fontWeight=`${s}`,this._measureElements[3].style.fontWeight=`${r}`,this.clear())}get(e,t,s){let r=0;if(!t&&!s&&e.length===1&&(r=e.charCodeAt(0))<256){if(this._flat[r]!==-9999)return this._flat[r];let d=this._measure(e,0);return d>0&&(this._flat[r]=d),d}let o=e;t&&(o+="B"),s&&(o+="I");let l=this._holey.get(o);if(l===void 0){let d=0;t&&(d|=1),s&&(d|=2),l=this._measure(e,d),l>0&&this._holey.set(o,l)}return l}_measure(e,t){let s=this._measureElements[t];return s.textContent=e.repeat(32),s.offsetWidth/32}},cL=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,s,r=!1){if(this.selectionStart=t,this.selectionEnd=s,!t||!s||t[0]===s[0]&&t[1]===s[1]){this.clear();return}let o=e.buffers.active.ydisp,l=t[1]-o,d=s[1]-o,f=Math.max(l,0),m=Math.min(d,e.rows-1);if(f>=e.rows||m<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=r,this.viewportStartRow=l,this.viewportEndRow=d,this.viewportCappedStartRow=f,this.viewportCappedEndRow=m,this.startCol=t[0],this.endCol=s[0]}isCellSelected(e,t,s){return this.hasSelection?(s-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&s>=this.viewportCappedStartRow&&t<this.endCol&&s<=this.viewportCappedEndRow:t<this.startCol&&s>=this.viewportCappedStartRow&&t>=this.endCol&&s<=this.viewportCappedEndRow:s>this.viewportStartRow&&s<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&s===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&s===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&s===this.viewportStartRow&&t>=this.startCol):!1}};function uL(){return new cL}var ym="xterm-dom-renderer-owner-",bs="xterm-rows",$u="xterm-fg-",dx="xterm-bg-",Ml="xterm-focus",qu="xterm-selection",dL=1,ug=class extends Ke{constructor(e,t,s,r,o,l,d,f,m,h,_,v,b,y){super(),this._terminal=e,this._document=t,this._element=s,this._screenElement=r,this._viewportElement=o,this._helperContainer=l,this._linkifier2=d,this._charSizeService=m,this._optionsService=h,this._bufferService=_,this._coreService=v,this._coreBrowserService=b,this._themeService=y,this._terminalClass=dL++,this._rowElements=[],this._selectionRenderModel=uL(),this.onRequestRedraw=this._register(new he).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(bs),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(qu),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=oL(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(x=>this._injectCss(x))),this._injectCss(this._themeService.colors),this._rowFactory=f.createInstance(cg,document),this._element.classList.add(ym+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(x=>this._handleLinkHover(x))),this._register(this._linkifier2.onHideLinkUnderline(x=>this._handleLinkLeave(x))),this._register(Mt(()=>{this._element.classList.remove(ym+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new lL(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 s of this._rowElements)s.style.width=`${this.dimensions.css.canvas.width}px`,s.style.height=`${this.dimensions.css.cell.height}px`,s.style.lineHeight=`${this.dimensions.css.cell.height}px`,s.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${bs} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${bs} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${bs} .xterm-dim { color: ${Ct.multiplyOpacity(e.foreground,.5).css};}`,t+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let s=`blink_underline_${this._terminalClass}`,r=`blink_bar_${this._terminalClass}`,o=`blink_block_${this._terminalClass}`;t+=`@keyframes ${s} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${r} { 50% { box-shadow: none; }}`,t+=`@keyframes ${o} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${bs}.${Ml} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${bs}.${Ml} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${bs}.${Ml} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${o} 1s step-end infinite;}${this._terminalSelector} .${bs} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${bs} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${bs} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${bs} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${bs} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${qu} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${qu} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${qu} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[l,d]of e.ansi.entries())t+=`${this._terminalSelector} .${$u}${l} { color: ${d.css}; }${this._terminalSelector} .${$u}${l}.xterm-dim { color: ${Ct.multiplyOpacity(d,.5).css}; }${this._terminalSelector} .${dx}${l} { background-color: ${d.css}; }`;t+=`${this._terminalSelector} .${$u}257 { color: ${Ct.opaque(e.background).css}; }${this._terminalSelector} .${$u}257.xterm-dim { color: ${Ct.multiplyOpacity(Ct.opaque(e.background),.5).css}; }${this._terminalSelector} .${dx}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let s=this._rowElements.length;s<=t;s++){let r=this._document.createElement("div");this._rowContainer.appendChild(r),this._rowElements.push(r)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(Ml),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(Ml),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,s){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,s),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,s),!this._selectionRenderModel.hasSelection))return;let r=this._selectionRenderModel.viewportStartRow,o=this._selectionRenderModel.viewportEndRow,l=this._selectionRenderModel.viewportCappedStartRow,d=this._selectionRenderModel.viewportCappedEndRow,f=this._document.createDocumentFragment();if(s){let m=e[0]>t[0];f.appendChild(this._createSelectionElement(l,m?t[0]:e[0],m?e[0]:t[0],d-l+1))}else{let m=r===l?e[0]:0,h=l===o?t[0]:this._bufferService.cols;f.appendChild(this._createSelectionElement(l,m,h));let _=d-l-1;if(f.appendChild(this._createSelectionElement(l+1,0,this._bufferService.cols,_)),l!==d){let v=o===d?t[0]:this._bufferService.cols;f.appendChild(this._createSelectionElement(d,0,v))}}this._selectionContainer.appendChild(f)}_createSelectionElement(e,t,s,r=1){let o=this._document.createElement("div"),l=t*this.dimensions.css.cell.width,d=this.dimensions.css.cell.width*(s-t);return l+d>this.dimensions.css.canvas.width&&(d=this.dimensions.css.canvas.width-l),o.style.height=`${r*this.dimensions.css.cell.height}px`,o.style.top=`${e*this.dimensions.css.cell.height}px`,o.style.left=`${l}px`,o.style.width=`${d}px`,o}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let s=this._bufferService.buffer,r=s.ybase+s.y,o=Math.min(s.x,this._bufferService.cols-1),l=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,d=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,f=this._optionsService.rawOptions.cursorInactiveStyle;for(let m=e;m<=t;m++){let h=m+s.ydisp,_=this._rowElements[m],v=s.lines.get(h);if(!_||!v)break;_.replaceChildren(...this._rowFactory.createRow(v,h,h===r,d,f,o,l,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${ym}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,s,r,o,l){s<0&&(e=0),r<0&&(t=0);let d=this._bufferService.rows-1;s=Math.max(Math.min(s,d),0),r=Math.max(Math.min(r,d),0),o=Math.min(o,this._bufferService.cols);let f=this._bufferService.buffer,m=f.ybase+f.y,h=Math.min(f.x,o-1),_=this._optionsService.rawOptions.cursorBlink,v=this._optionsService.rawOptions.cursorStyle,b=this._optionsService.rawOptions.cursorInactiveStyle;for(let y=s;y<=r;++y){let x=y+f.ydisp,w=this._rowElements[y],N=f.lines.get(x);if(!w||!N)break;w.replaceChildren(...this._rowFactory.createRow(N,x,x===m,v,b,h,_,this.dimensions.css.cell.width,this._widthCache,l?y===s?e:0:-1,l?(y===r?t:o)-1:-1))}}};ug=Pt([be(7,a0),be(8,jd),be(9,Bi),be(10,ji),be(11,ba),be(12,In),be(13,Eo)],ug);var dg=class extends Ke{constructor(e,t,s){super(),this._optionsService=s,this.width=0,this.height=0,this._onCharSizeChange=this._register(new he),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new fL(this._optionsService))}catch{this._measureStrategy=this._register(new hL(e,t,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};dg=Pt([be(2,Bi)],dg);var VE=class extends Ke{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},hL=class extends VE{constructor(e,t,s){super(),this._document=e,this._parentElement=t,this._optionsService=s,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}},fL=class extends VE{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let t=this._ctx.measureText("W");if(!("width"in t&&"fontBoundingBoxAscent"in t&&"fontBoundingBoxDescent"in t))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},mL=class extends Ke{constructor(e,t,s){super(),this._textarea=e,this._window=t,this.mainDocument=s,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new pL(this._window)),this._onDprChange=this._register(new he),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new he),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(r=>this._screenDprMonitor.setWindow(r))),this._register(wi.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Pe(this._textarea,"focus",()=>this._isFocused=!0)),this._register(Pe(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}},pL=class extends Ke{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new yo),this._onDprChange=this._register(new he),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(Mt(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Pe(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)}},gL=class extends Ke{constructor(){super(),this.linkProviders=[],this._register(Mt(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function m0(e,t,s){let r=s.getBoundingClientRect(),o=e.getComputedStyle(s),l=parseInt(o.getPropertyValue("padding-left")),d=parseInt(o.getPropertyValue("padding-top"));return[t.clientX-r.left-l,t.clientY-r.top-d]}function _L(e,t,s,r,o,l,d,f,m){if(!l)return;let h=m0(e,t,s);if(h)return h[0]=Math.ceil((h[0]+(m?d/2:0))/d),h[1]=Math.ceil(h[1]/f),h[0]=Math.min(Math.max(h[0],1),r+(m?1:0)),h[1]=Math.min(Math.max(h[1],1),o),h}var hg=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,s,r,o){return _L(window,e,t,s,r,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,o)}getMouseReportCoords(e,t){let s=m0(window,e,t);if(this._charSizeService.hasValidSize)return s[0]=Math.min(Math.max(s[0],0),this._renderService.dimensions.css.canvas.width-1),s[1]=Math.min(Math.max(s[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(s[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(s[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(s[0]),y:Math.floor(s[1])}}};hg=Pt([be(0,Un),be(1,jd)],hg);var vL=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,t,s){this._rowCount=s,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t,!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},$E={};T7($E,{getSafariVersion:()=>yL,isChromeOS:()=>WE,isFirefox:()=>qE,isIpad:()=>xL,isIphone:()=>SL,isLegacyEdge:()=>bL,isLinux:()=>p0,isMac:()=>wd,isNode:()=>Bd,isSafari:()=>KE,isWindows:()=>GE});var Bd=typeof process<"u"&&"title"in process,gc=Bd?"node":navigator.userAgent,_c=Bd?"node":navigator.platform,qE=gc.includes("Firefox"),bL=gc.includes("Edge"),KE=/^((?!chrome|android).)*safari/i.test(gc);function yL(){if(!KE)return 0;let e=gc.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var wd=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(_c),xL=_c==="iPad",SL=_c==="iPhone",GE=["Windows","Win16","Win32","WinCE"].includes(_c),p0=_c.indexOf("Linux")>=0,WE=/\bCrOS\b/.test(gc),YE=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(e){this._idleCallback=void 0;let t=0,s=0,r=e.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),s=Math.max(t,s),o=e.timeRemaining(),s*1.5>o){r-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-t))}ms`),this._start();return}r=o}this.clear()}},wL=class extends YE{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},EL=class extends YE{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},Ed=!Bd&&"requestIdleCallback"in window?EL:wL,CL=class{constructor(){this._queue=new Ed}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},fg=class extends Ke{constructor(e,t,s,r,o,l,d,f,m){super(),this._rowCount=e,this._optionsService=s,this._charSizeService=r,this._coreService=o,this._coreBrowserService=f,this._renderer=this._register(new yo),this._pausedResizeTask=new CL,this._observerDisposable=this._register(new yo),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 he),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new he),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new he),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new he),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new vL((h,_)=>this._renderRows(h,_),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new NL(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(Mt(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(d.onResize(()=>this._fullRefresh())),this._register(d.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(l.onDecorationRegistered(()=>this._fullRefresh())),this._register(l.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(d.cols,d.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(d.buffer.y,d.buffer.y,!0))),this._register(m.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(h=>this._registerIntersectionObserver(h,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let s=new e.IntersectionObserver(r=>this._handleIntersectionChange(r[r.length-1]),{threshold:0});s.observe(t),this._observerDisposable.value=Mt(()=>s.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,s=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let r=this._syncOutputHandler.flush();r&&(e=Math.min(e,r.start),t=Math.max(t,r.end)),s||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(t=>this.refreshRows(t.start,t.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(e,t)):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,t,s){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=s,this._renderer.value?.handleSelectionChanged(e,t,s)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};fg=Pt([be(2,Bi),be(3,jd),be(4,ba),be(5,pc),be(6,ji),be(7,In),be(8,Eo)],fg);var NL=class{constructor(e,t,s){this._coreBrowserService=e,this._coreService=t,this._onTimeout=s,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function kL(e,t,s,r){let o=s.buffer.x,l=s.buffer.y;if(!s.buffer.hasScrollback)return AL(o,l,e,t,s,r)+zd(l,t,s,r)+RL(o,l,e,t,s,r);let d;if(l===t)return d=o>e?"D":"C",nc(Math.abs(o-e),sc(d,r));d=l>t?"D":"C";let f=Math.abs(l-t),m=ML(l>t?e:o,s)+(f-1)*s.cols+1+TL(l>t?o:e);return nc(m,sc(d,r))}function TL(e,t){return e-1}function ML(e,t){return t.cols-e}function AL(e,t,s,r,o,l){return zd(t,r,o,l).length===0?"":nc(ZE(e,t,e,t-pa(t,o),!1,o).length,sc("D",l))}function zd(e,t,s,r){let o=e-pa(e,s),l=t-pa(t,s),d=Math.abs(o-l)-DL(e,t,s);return nc(d,sc(XE(e,t),r))}function RL(e,t,s,r,o,l){let d;zd(t,r,o,l).length>0?d=r-pa(r,o):d=t;let f=r,m=OL(e,t,s,r,o,l);return nc(ZE(e,d,s,f,m==="C",o).length,sc(m,l))}function DL(e,t,s){let r=0,o=e-pa(e,s),l=t-pa(t,s);for(let d=0;d<Math.abs(o-l);d++){let f=XE(e,t)==="A"?-1:1;s.buffer.lines.get(o+f*d)?.isWrapped&&r++}return r}function pa(e,t){let s=0,r=t.buffer.lines.get(e),o=r?.isWrapped;for(;o&&e>=0&&e<t.rows;)s++,r=t.buffer.lines.get(--e),o=r?.isWrapped;return s}function OL(e,t,s,r,o,l){let d;return zd(s,r,o,l).length>0?d=r-pa(r,o):d=t,e<s&&d<=r||e>=s&&d<r?"C":"D"}function XE(e,t){return e>t?"A":"B"}function ZE(e,t,s,r,o,l){let d=e,f=t,m="";for(;(d!==s||f!==r)&&f>=0&&f<l.buffer.lines.length;)d+=o?1:-1,o&&d>l.cols-1?(m+=l.buffer.translateBufferLineToString(f,!1,e,d),d=0,e=0,f++):!o&&d<0&&(m+=l.buffer.translateBufferLineToString(f,!1,0,e+1),d=l.cols-1,e=d,f--);return m+l.buffer.translateBufferLineToString(f,!1,e,d)}function sc(e,t){let s=t?"O":"[";return oe.ESC+s+e}function nc(e,t){e=Math.floor(e);let s="";for(let r=0;r<e;r++)s+=t;return s}var LL=class{constructor(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:!this.selectionEnd||!this.selectionStart?this.selectionStart:this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function hx(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var xm=50,jL=15,BL=50,zL=500,PL=" ",IL=new RegExp(PL,"g"),mg=class extends Ke{constructor(e,t,s,r,o,l,d,f,m){super(),this._element=e,this._screenElement=t,this._linkifier=s,this._bufferService=r,this._coreService=o,this._mouseService=l,this._optionsService=d,this._renderService=f,this._coreBrowserService=m,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Ns,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new he),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new he),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new he),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new he),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=h=>this._handleMouseMove(h),this._mouseUpListener=h=>this._handleMouseUp(h),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(h=>this._handleTrim(h)),this._register(this._bufferService.buffers.onBufferActivate(h=>this._handleBufferActivate(h))),this.enable(),this._model=new LL(this._bufferService),this._activeSelectionMode=0,this._register(Mt(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(h=>{h.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";let s=this._bufferService.buffer,r=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let o=e[0]<t[0]?e[0]:t[0],l=e[0]<t[0]?t[0]:e[0];for(let d=e[1];d<=t[1];d++){let f=s.translateBufferLineToString(d,!0,o,l);r.push(f)}}else{let o=e[1]===t[1]?t[0]:void 0;r.push(s.translateBufferLineToString(e[1],!0,e[0],o));for(let l=e[1]+1;l<=t[1]-1;l++){let d=s.lines.get(l),f=s.translateBufferLineToString(l,!0);d?.isWrapped?r[r.length-1]+=f:r.push(f)}if(e[1]!==t[1]){let l=s.lines.get(t[1]),d=s.translateBufferLineToString(t[1],!0,0,t[0]);l&&l.isWrapped?r[r.length-1]+=d:r.push(d)}}return r.map(o=>o.replace(IL," ")).join(GE?`\r
|
|
30
|
-
`:`
|
|
31
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),p0&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),s=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!s||!r||!t?!1:this._areCoordsInSelection(t,s,r)}isCellInSelection(e,t){let s=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!s||!r?!1:this._areCoordsInSelection([e,t],s,r)}_areCoordsInSelection(e,t,s){return e[1]>t[1]&&e[1]<s[1]||t[1]===s[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<s[0]||t[1]<s[1]&&e[1]===s[1]&&e[0]<s[0]||t[1]<s[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){let s=this._linkifier.currentLink?.link?.range;if(s)return this._model.selectionStart=[s.start.x-1,s.start.y-1],this._model.selectionStartLength=hx(s,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let r=this._getMouseBufferCoords(e);return r?(this._selectWordAt(r,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=m0(this._coreBrowserService.window,e,this._screenElement)[1],s=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=s?0:(t>s&&(t-=s),t=Math.min(Math.max(t,-xm),xm),t/=xm,t/Math.abs(t)+Math.round(t*(jL-1)))}shouldForceSelection(e){return wd?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),BL)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(wd&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let s=this._bufferService.buffer;if(this._model.selectionEnd[1]<s.lines.length){let r=s.lines.get(this._model.selectionEnd[1]);r&&r.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!t||t[0]!==this._model.selectionEnd[0]||t[1]!==this._model.selectionEnd[1])&&this.refresh(!0)}_dragScroll(){if(!(!this._model.selectionEnd||!this._model.selectionStart)&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<zL&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let s=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(s&&s[0]!==void 0&&s[1]!==void 0){let r=kL(s[0]-1,s[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(r,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,s=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!s){this._oldHasSelection&&this._fireOnSelectionChange(e,t,s);return}!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,s)}_fireOnSelectionChange(e,t,s){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=s,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let s=t;for(let r=0;t>=r;r++){let o=e.loadCell(r,this._workCell).getChars().length;this._workCell.getWidth()===0?s--:o>1&&t!==r&&(s+=o-1)}return s}setSelection(e,t,s){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=s,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,s=!0,r=!0){if(e[0]>=this._bufferService.cols)return;let o=this._bufferService.buffer,l=o.lines.get(e[1]);if(!l)return;let d=o.translateBufferLineToString(e[1],!1),f=this._convertViewportColToCharacterIndex(l,e[0]),m=f,h=e[0]-f,_=0,v=0,b=0,y=0;if(d.charAt(f)===" "){for(;f>0&&d.charAt(f-1)===" ";)f--;for(;m<d.length&&d.charAt(m+1)===" ";)m++}else{let N=e[0],A=e[0];l.getWidth(N)===0&&(_++,N--),l.getWidth(A)===2&&(v++,A++);let R=l.getString(A).length;for(R>1&&(y+=R-1,m+=R-1);N>0&&f>0&&!this._isCharWordSeparator(l.loadCell(N-1,this._workCell));){l.loadCell(N-1,this._workCell);let T=this._workCell.getChars().length;this._workCell.getWidth()===0?(_++,N--):T>1&&(b+=T-1,f-=T-1),f--,N--}for(;A<l.length&&m+1<d.length&&!this._isCharWordSeparator(l.loadCell(A+1,this._workCell));){l.loadCell(A+1,this._workCell);let T=this._workCell.getChars().length;this._workCell.getWidth()===2?(v++,A++):T>1&&(y+=T-1,m+=T-1),m++,A++}}m++;let x=f+h-_+b,w=Math.min(this._bufferService.cols,m-f+_+v-b-y);if(!(!t&&d.slice(f,m).trim()==="")){if(s&&x===0&&l.getCodePoint(0)!==32){let N=o.lines.get(e[1]-1);if(N&&l.isWrapped&&N.getCodePoint(this._bufferService.cols-1)!==32){let A=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(A){let R=this._bufferService.cols-A.start;x-=R,w+=R}}}if(r&&x+w===this._bufferService.cols&&l.getCodePoint(this._bufferService.cols-1)!==32){let N=o.lines.get(e[1]+1);if(N?.isWrapped&&N.getCodePoint(0)!==32){let A=this._getWordAt([0,e[1]+1],!1,!1,!0);A&&(w+=A.length)}}return{start:x,length:w}}}_selectWordAt(e,t){let s=this._getWordAt(e,t);if(s){for(;s.start<0;)s.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[s.start,e[1]],this._model.selectionStartLength=s.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let s=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,s--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,s++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,s]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),s={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=hx(s,this._bufferService.cols)}};mg=Pt([be(3,ji),be(4,ba),be(5,o0),be(6,Bi),be(7,Un),be(8,In)],mg);var fx=class{constructor(){this._data={}}set(e,t,s){this._data[e]||(this._data[e]={}),this._data[e][t]=s}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},mx=class{constructor(){this._color=new fx,this._css=new fx}setCss(e,t,s){this._css.set(e,t,s)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,s){this._color.set(e,t,s)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},ni=Object.freeze((()=>{let e=[Ot.toColor("#2e3436"),Ot.toColor("#cc0000"),Ot.toColor("#4e9a06"),Ot.toColor("#c4a000"),Ot.toColor("#3465a4"),Ot.toColor("#75507b"),Ot.toColor("#06989a"),Ot.toColor("#d3d7cf"),Ot.toColor("#555753"),Ot.toColor("#ef2929"),Ot.toColor("#8ae234"),Ot.toColor("#fce94f"),Ot.toColor("#729fcf"),Ot.toColor("#ad7fa8"),Ot.toColor("#34e2e2"),Ot.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let s=0;s<216;s++){let r=t[s/36%6|0],o=t[s/6%6|0],l=t[s%6];e.push({css:ti.toCss(r,o,l),rgba:ti.toRgba(r,o,l)})}for(let s=0;s<24;s++){let r=8+s*10;e.push({css:ti.toCss(r,r,r),rgba:ti.toRgba(r,r,r)})}return e})()),aa=Ot.toColor("#ffffff"),Il=Ot.toColor("#000000"),px=Ot.toColor("#ffffff"),gx=Il,Al={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},UL=aa,pg=class extends Ke{constructor(e){super(),this._optionsService=e,this._contrastCache=new mx,this._halfContrastCache=new mx,this._onChangeColors=this._register(new he),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:aa,background:Il,cursor:px,cursorAccent:gx,selectionForeground:void 0,selectionBackgroundTransparent:Al,selectionBackgroundOpaque:Ct.blend(Il,Al),selectionInactiveBackgroundTransparent:Al,selectionInactiveBackgroundOpaque:Ct.blend(Il,Al),scrollbarSliderBackground:Ct.opacity(aa,.2),scrollbarSliderHoverBackground:Ct.opacity(aa,.4),scrollbarSliderActiveBackground:Ct.opacity(aa,.5),overviewRulerBorder:aa,ansi:ni.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this._register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(e={}){let t=this._colors;if(t.foreground=gt(e.foreground,aa),t.background=gt(e.background,Il),t.cursor=Ct.blend(t.background,gt(e.cursor,px)),t.cursorAccent=Ct.blend(t.background,gt(e.cursorAccent,gx)),t.selectionBackgroundTransparent=gt(e.selectionBackground,Al),t.selectionBackgroundOpaque=Ct.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=gt(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=Ct.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?gt(e.selectionForeground,cx):void 0,t.selectionForeground===cx&&(t.selectionForeground=void 0),Ct.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=Ct.opacity(t.selectionBackgroundTransparent,.3)),Ct.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=Ct.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=gt(e.scrollbarSliderBackground,Ct.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=gt(e.scrollbarSliderHoverBackground,Ct.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=gt(e.scrollbarSliderActiveBackground,Ct.opacity(t.foreground,.5)),t.overviewRulerBorder=gt(e.overviewRulerBorder,UL),t.ansi=ni.slice(),t.ansi[0]=gt(e.black,ni[0]),t.ansi[1]=gt(e.red,ni[1]),t.ansi[2]=gt(e.green,ni[2]),t.ansi[3]=gt(e.yellow,ni[3]),t.ansi[4]=gt(e.blue,ni[4]),t.ansi[5]=gt(e.magenta,ni[5]),t.ansi[6]=gt(e.cyan,ni[6]),t.ansi[7]=gt(e.white,ni[7]),t.ansi[8]=gt(e.brightBlack,ni[8]),t.ansi[9]=gt(e.brightRed,ni[9]),t.ansi[10]=gt(e.brightGreen,ni[10]),t.ansi[11]=gt(e.brightYellow,ni[11]),t.ansi[12]=gt(e.brightBlue,ni[12]),t.ansi[13]=gt(e.brightMagenta,ni[13]),t.ansi[14]=gt(e.brightCyan,ni[14]),t.ansi[15]=gt(e.brightWhite,ni[15]),e.extendedAnsi){let s=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let r=0;r<s;r++)t.ansi[r+16]=gt(e.extendedAnsi[r],ni[r+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e===void 0){for(let t=0;t<this._restoreColors.ansi.length;++t)this._colors.ansi[t]=this._restoreColors.ansi[t];return}switch(e){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};pg=Pt([be(0,Bi)],pg);function gt(e,t){if(e!==void 0)try{return Ot.toColor(e)}catch{}return t}var HL=class{constructor(...e){this._entries=new Map;for(let[t,s]of e)this.set(t,s)}set(e,t){let s=this._entries.get(e);return this._entries.set(e,t),s}forEach(e){for(let[t,s]of this._entries.entries())e(t,s)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},FL=class{constructor(){this._services=new HL,this._services.set(a0,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let s=j7(e).sort((l,d)=>l.index-d.index),r=[];for(let l of s){let d=this._services.get(l.id);if(!d)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${l.id._id}.`);r.push(d)}let o=s.length>0?s[0].index:t.length;if(t.length!==o)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${o+1} conflicts with ${t.length} static arguments`);return new e(...t,...r)}},VL={trace:0,debug:1,info:2,warn:3,error:4,off:5},$L="xterm.js: ",gg=class extends Ke{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=VL[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,s){this._evalLazyOptionalParams(s),e.call(console,(this._optionsService.options.logger?"":$L)+t,...s)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};gg=Pt([be(0,Bi)],gg);var _x=class extends Ke{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new he),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new he),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new he),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=new Array(e);for(let s=0;s<Math.min(e,this.length);s++)t[s]=this._array[this._getCyclicIndex(s)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,t,...s){if(t){for(let r=e;r<this._length-t;r++)this._array[this._getCyclicIndex(r)]=this._array[this._getCyclicIndex(r+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let r=this._length-1;r>=e;r--)this._array[this._getCyclicIndex(r+s.length)]=this._array[this._getCyclicIndex(r)];for(let r=0;r<s.length;r++)this._array[this._getCyclicIndex(e+r)]=s[r];if(s.length&&this.onInsertEmitter.fire({index:e,amount:s.length}),this._length+s.length>this._maxLength){let r=this._length+s.length-this._maxLength;this._startIndex+=r,this._length=this._maxLength,this.onTrimEmitter.fire(r)}else this._length+=s.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,s){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+s<0)throw new Error("Cannot shift elements in list beyond index 0");if(s>0){for(let o=t-1;o>=0;o--)this.set(e+o+s,this.get(e+o));let r=e+t+s-this._length;if(r>0)for(this._length+=r;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let r=0;r<t;r++)this.set(e+r+s,this.get(e+r))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},$e=3,Qt=Object.freeze(new mc),Ku=0,Sm=2,Ul=class QE{constructor(t,s,r=!1){this.isWrapped=r,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*$e);let o=s||Ns.fromCharData([0,_E,1,0]);for(let l=0;l<t;++l)this.setCell(l,o);this.length=t}get(t){let s=this._data[t*$e+0],r=s&2097151;return[this._data[t*$e+1],s&2097152?this._combined[t]:r?wr(r):"",s>>22,s&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):r]}set(t,s){this._data[t*$e+1]=s[0],s[1].length>1?(this._combined[t]=s[1],this._data[t*$e+0]=t|2097152|s[2]<<22):this._data[t*$e+0]=s[1].charCodeAt(0)|s[2]<<22}getWidth(t){return this._data[t*$e+0]>>22}hasWidth(t){return this._data[t*$e+0]&12582912}getFg(t){return this._data[t*$e+1]}getBg(t){return this._data[t*$e+2]}hasContent(t){return this._data[t*$e+0]&4194303}getCodePoint(t){let s=this._data[t*$e+0];return s&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):s&2097151}isCombined(t){return this._data[t*$e+0]&2097152}getString(t){let s=this._data[t*$e+0];return s&2097152?this._combined[t]:s&2097151?wr(s&2097151):""}isProtected(t){return this._data[t*$e+2]&536870912}loadCell(t,s){return Ku=t*$e,s.content=this._data[Ku+0],s.fg=this._data[Ku+1],s.bg=this._data[Ku+2],s.content&2097152&&(s.combinedData=this._combined[t]),s.bg&268435456&&(s.extended=this._extendedAttrs[t]),s}setCell(t,s){s.content&2097152&&(this._combined[t]=s.combinedData),s.bg&268435456&&(this._extendedAttrs[t]=s.extended),this._data[t*$e+0]=s.content,this._data[t*$e+1]=s.fg,this._data[t*$e+2]=s.bg}setCellFromCodepoint(t,s,r,o){o.bg&268435456&&(this._extendedAttrs[t]=o.extended),this._data[t*$e+0]=s|r<<22,this._data[t*$e+1]=o.fg,this._data[t*$e+2]=o.bg}addCodepointToCell(t,s,r){let o=this._data[t*$e+0];o&2097152?this._combined[t]+=wr(s):o&2097151?(this._combined[t]=wr(o&2097151)+wr(s),o&=-2097152,o|=2097152):o=s|1<<22,r&&(o&=-12582913,o|=r<<22),this._data[t*$e+0]=o}insertCells(t,s,r){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),s<this.length-t){let o=new Ns;for(let l=this.length-t-s-1;l>=0;--l)this.setCell(t+s+l,this.loadCell(t+l,o));for(let l=0;l<s;++l)this.setCell(t+l,r)}else for(let o=t;o<this.length;++o)this.setCell(o,r);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,r)}deleteCells(t,s,r){if(t%=this.length,s<this.length-t){let o=new Ns;for(let l=0;l<this.length-t-s;++l)this.setCell(t+l,this.loadCell(t+s+l,o));for(let l=this.length-s;l<this.length;++l)this.setCell(l,r)}else for(let o=t;o<this.length;++o)this.setCell(o,r);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,r)}replaceCells(t,s,r,o=!1){if(o){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,r),s<this.length&&this.getWidth(s-1)===2&&!this.isProtected(s)&&this.setCellFromCodepoint(s,0,1,r);t<s&&t<this.length;)this.isProtected(t)||this.setCell(t,r),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),s<this.length&&this.getWidth(s-1)===2&&this.setCellFromCodepoint(s,0,1,r);t<s&&t<this.length;)this.setCell(t++,r)}resize(t,s){if(t===this.length)return this._data.length*4*Sm<this._data.buffer.byteLength;let r=t*$e;if(t>this.length){if(this._data.buffer.byteLength>=r*4)this._data=new Uint32Array(this._data.buffer,0,r);else{let o=new Uint32Array(r);o.set(this._data),this._data=o}for(let o=this.length;o<t;++o)this.setCell(o,s)}else{this._data=this._data.subarray(0,r);let o=Object.keys(this._combined);for(let d=0;d<o.length;d++){let f=parseInt(o[d],10);f>=t&&delete this._combined[f]}let l=Object.keys(this._extendedAttrs);for(let d=0;d<l.length;d++){let f=parseInt(l[d],10);f>=t&&delete this._extendedAttrs[f]}}return this.length=t,r*4*Sm<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*Sm<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,s=!1){if(s){for(let r=0;r<this.length;++r)this.isProtected(r)||this.setCell(r,t);return}this._combined={},this._extendedAttrs={};for(let r=0;r<this.length;++r)this.setCell(r,t)}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(let s in t._combined)this._combined[s]=t._combined[s];this._extendedAttrs={};for(let s in t._extendedAttrs)this._extendedAttrs[s]=t._extendedAttrs[s];this.isWrapped=t.isWrapped}clone(){let t=new QE(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let s in this._combined)t._combined[s]=this._combined[s];for(let s in this._extendedAttrs)t._extendedAttrs[s]=this._extendedAttrs[s];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*$e+0]&4194303)return t+(this._data[t*$e+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*$e+0]&4194303||this._data[t*$e+2]&50331648)return t+(this._data[t*$e+0]>>22);return 0}copyCellsFrom(t,s,r,o,l){let d=t._data;if(l)for(let m=o-1;m>=0;m--){for(let h=0;h<$e;h++)this._data[(r+m)*$e+h]=d[(s+m)*$e+h];d[(s+m)*$e+2]&268435456&&(this._extendedAttrs[r+m]=t._extendedAttrs[s+m])}else for(let m=0;m<o;m++){for(let h=0;h<$e;h++)this._data[(r+m)*$e+h]=d[(s+m)*$e+h];d[(s+m)*$e+2]&268435456&&(this._extendedAttrs[r+m]=t._extendedAttrs[s+m])}let f=Object.keys(t._combined);for(let m=0;m<f.length;m++){let h=parseInt(f[m],10);h>=s&&(this._combined[h-s+r]=t._combined[h])}}translateToString(t,s,r,o){s=s??0,r=r??this.length,t&&(r=Math.min(r,this.getTrimmedLength())),o&&(o.length=0);let l="";for(;s<r;){let d=this._data[s*$e+0],f=d&2097151,m=d&2097152?this._combined[s]:f?wr(f):Nr;if(l+=m,o)for(let h=0;h<m.length;++h)o.push(s);s+=d>>22||1}return o&&o.push(s),l}};function qL(e,t,s,r,o,l){let d=[];for(let f=0;f<e.length-1;f++){let m=f,h=e.get(++m);if(!h.isWrapped)continue;let _=[e.get(f)];for(;m<e.length&&h.isWrapped;)_.push(h),h=e.get(++m);if(!l&&r>=f&&r<m){f+=_.length-1;continue}let v=0,b=rc(_,v,t),y=1,x=0;for(;y<_.length;){let N=rc(_,y,t),A=N-x,R=s-b,T=Math.min(A,R);_[v].copyCellsFrom(_[y],x,b,T,!1),b+=T,b===s&&(v++,b=0),x+=T,x===N&&(y++,x=0),b===0&&v!==0&&_[v-1].getWidth(s-1)===2&&(_[v].copyCellsFrom(_[v-1],s-1,b++,1,!1),_[v-1].setCell(s-1,o))}_[v].replaceCells(b,s,o);let w=0;for(let N=_.length-1;N>0&&(N>v||_[N].getTrimmedLength()===0);N--)w++;w>0&&(d.push(f+_.length-w),d.push(w)),f+=_.length-1}return d}function KL(e,t){let s=[],r=0,o=t[r],l=0;for(let d=0;d<e.length;d++)if(o===d){let f=t[++r];e.onDeleteEmitter.fire({index:d-l,amount:f}),d+=f-1,l+=f,o=t[++r]}else s.push(d);return{layout:s,countRemoved:l}}function GL(e,t){let s=[];for(let r=0;r<t.length;r++)s.push(e.get(t[r]));for(let r=0;r<s.length;r++)e.set(r,s[r]);e.length=t.length}function WL(e,t,s){let r=[],o=e.map((m,h)=>rc(e,h,t)).reduce((m,h)=>m+h),l=0,d=0,f=0;for(;f<o;){if(o-f<s){r.push(o-f);break}l+=s;let m=rc(e,d,t);l>m&&(l-=m,d++);let h=e[d].getWidth(l-1)===2;h&&l--;let _=h?s-1:s;r.push(_),f+=_}return r}function rc(e,t,s){if(t===e.length-1)return e[t].getTrimmedLength();let r=!e[t].hasContent(s-1)&&e[t].getWidth(s-1)===1,o=e[t+1].getWidth(0)===2;return r&&o?s-1:s}var JE=class eC{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=eC._nextId++,this._onDispose=this.register(new he),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),ma(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};JE._nextId=1;var YL=JE,oi={},oa=oi.B;oi[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:"≥","{":"π","|":"≠","}":"£","~":"·"};oi.A={"#":"£"};oi.B=void 0;oi[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};oi.C=oi[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};oi.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};oi.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};oi.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};oi.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};oi.E=oi[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};oi.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};oi.H=oi[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};oi["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var vx=4294967295,bx=class{constructor(e,t,s){this._hasScrollback=e,this._optionsService=t,this._bufferService=s,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=Qt.clone(),this.savedCharset=oa,this.markers=[],this._nullCell=Ns.fromCharData([0,_E,1,0]),this._whitespaceCell=Ns.fromCharData([0,Nr,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new Ed,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new _x(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new yd),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new yd),this._whitespaceCell}getBlankLine(e,t){return new Ul(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let t=e+this._optionsService.rawOptions.scrollback;return t>vx?vx:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=Qt);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new _x(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let s=this.getNullCell(Qt),r=0,o=this._getCorrectBufferLength(t);if(o>this.lines.maxLength&&(this.lines.maxLength=o),this.lines.length>0){if(this._cols<e)for(let d=0;d<this.lines.length;d++)r+=+this.lines.get(d).resize(e,s);let l=0;if(this._rows<t)for(let d=this._rows;d<t;d++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new Ul(e,s)):this.ybase>0&&this.lines.length<=this.ybase+this.y+l+1?(this.ybase--,l++,this.ydisp>0&&this.ydisp--):this.lines.push(new Ul(e,s)));else for(let d=this._rows;d>t;d--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(o<this.lines.maxLength){let d=this.lines.length-o;d>0&&(this.lines.trimStart(d),this.ybase=Math.max(this.ybase-d,0),this.ydisp=Math.max(this.ydisp-d,0),this.savedY=Math.max(this.savedY-d,0)),this.lines.maxLength=o}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),l&&(this.y+=l),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let l=0;l<this.lines.length;l++)r+=+this.lines.get(l).resize(e,s);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),r>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let s=this._optionsService.rawOptions.reflowCursorLine,r=qL(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(Qt),s);if(r.length>0){let o=KL(this.lines,r);GL(this.lines,o.layout),this._reflowLargerAdjustViewport(e,t,o.countRemoved)}}_reflowLargerAdjustViewport(e,t,s){let r=this.getNullCell(Qt),o=s;for(;o-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new Ul(e,r))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-s,0)}_reflowSmaller(e,t){let s=this._optionsService.rawOptions.reflowCursorLine,r=this.getNullCell(Qt),o=[],l=0;for(let d=this.lines.length-1;d>=0;d--){let f=this.lines.get(d);if(!f||!f.isWrapped&&f.getTrimmedLength()<=e)continue;let m=[f];for(;f.isWrapped&&d>0;)f=this.lines.get(--d),m.unshift(f);if(!s){let T=this.ybase+this.y;if(T>=d&&T<d+m.length)continue}let h=m[m.length-1].getTrimmedLength(),_=WL(m,this._cols,e),v=_.length-m.length,b;this.ybase===0&&this.y!==this.lines.length-1?b=Math.max(0,this.y-this.lines.maxLength+v):b=Math.max(0,this.lines.length-this.lines.maxLength+v);let y=[];for(let T=0;T<v;T++){let M=this.getBlankLine(Qt,!0);y.push(M)}y.length>0&&(o.push({start:d+m.length+l,newLines:y}),l+=y.length),m.push(...y);let x=_.length-1,w=_[x];w===0&&(x--,w=_[x]);let N=m.length-v-1,A=h;for(;N>=0;){let T=Math.min(A,w);if(m[x]===void 0)break;if(m[x].copyCellsFrom(m[N],A-T,w-T,T,!0),w-=T,w===0&&(x--,w=_[x]),A-=T,A===0){N--;let M=Math.max(N,0);A=rc(m,M,this._cols)}}for(let T=0;T<m.length;T++)_[T]<e&&m[T].setCell(_[T],r);let R=v-b;for(;R-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+l)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+v,this.ybase+t-1)}if(o.length>0){let d=[],f=[];for(let w=0;w<this.lines.length;w++)f.push(this.lines.get(w));let m=this.lines.length,h=m-1,_=0,v=o[_];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+l);let b=0;for(let w=Math.min(this.lines.maxLength-1,m+l-1);w>=0;w--)if(v&&v.start>h+b){for(let N=v.newLines.length-1;N>=0;N--)this.lines.set(w--,v.newLines[N]);w++,d.push({index:h+1,amount:v.newLines.length}),b+=v.newLines.length,v=o[++_]}else this.lines.set(w,f[h--]);let y=0;for(let w=d.length-1;w>=0;w--)d[w].index+=y,this.lines.onInsertEmitter.fire(d[w]),y+=d[w].amount;let x=Math.max(0,m+l-this.lines.maxLength);x>0&&this.lines.onTrimEmitter.fire(x)}}translateBufferLineToString(e,t,s=0,r){let o=this.lines.get(e);return o?o.translateToString(t,s,r):""}getWrappedRangeForLine(e){let t=e,s=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;s+1<this.lines.length&&this.lines.get(s+1).isWrapped;)s++;return{first:t,last:s}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let t=new YL(e);return this.markers.push(t),t.register(this.lines.onTrim(s=>{t.line-=s,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(s=>{t.line>=s.index&&(t.line+=s.amount)})),t.register(this.lines.onDelete(s=>{t.line>=s.index&&t.line<s.index+s.amount&&t.dispose(),t.line>s.index&&(t.line-=s.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},XL=class extends Ke{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new he),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 bx(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new bx(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},tC=2,iC=1,_g=class extends Ke{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new he),this.onResize=this._onResize.event,this._onScroll=this._register(new he),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,tC),this.rows=Math.max(e.rawOptions.rows||0,iC),this.buffers=this._register(new XL(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let s=this.cols!==e,r=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:s,rowsChanged:r})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let s=this.buffer,r;r=this._cachedBlankLine,(!r||r.length!==this.cols||r.getFg(0)!==e.fg||r.getBg(0)!==e.bg)&&(r=s.getBlankLine(e,t),this._cachedBlankLine=r),r.isWrapped=t;let o=s.ybase+s.scrollTop,l=s.ybase+s.scrollBottom;if(s.scrollTop===0){let d=s.lines.isFull;l===s.lines.length-1?d?s.lines.recycle().copyFrom(r):s.lines.push(r.clone()):s.lines.splice(l+1,0,r.clone()),d?this.isUserScrolling&&(s.ydisp=Math.max(s.ydisp-1,0)):(s.ybase++,this.isUserScrolling||s.ydisp++)}else{let d=l-o+1;s.lines.shiftElements(o+1,d-1,-1),s.lines.set(l,r.clone())}this.isUserScrolling||(s.ydisp=s.ybase),this._onScroll.fire(s.ydisp)}scrollLines(e,t){let s=this.buffer;if(e<0){if(s.ydisp===0)return;this.isUserScrolling=!0}else e+s.ydisp>=s.ybase&&(this.isUserScrolling=!1);let r=s.ydisp;s.ydisp=Math.max(Math.min(s.ydisp+e,s.ybase),0),r!==s.ydisp&&(t||this._onScroll.fire(s.ydisp))}};_g=Pt([be(0,Bi)],_g);var lo={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:wd,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},ZL=["normal","bold","100","200","300","400","500","600","700","800","900"],QL=class extends Ke{constructor(e){super(),this._onOptionChange=this._register(new he),this.onOptionChange=this._onOptionChange.event;let t={...lo};for(let s in e)if(s in t)try{let r=e[s];t[s]=this._sanitizeAndValidateOption(s,r)}catch(r){console.error(r)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(Mt(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(s=>{s===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(s=>{e.indexOf(s)!==-1&&t()})}_setupOptions(){let e=s=>{if(!(s in lo))throw new Error(`No option with key "${s}"`);return this.rawOptions[s]},t=(s,r)=>{if(!(s in lo))throw new Error(`No option with key "${s}"`);r=this._sanitizeAndValidateOption(s,r),this.rawOptions[s]!==r&&(this.rawOptions[s]=r,this._onOptionChange.fire(s))};for(let s in this.rawOptions){let r={get:e.bind(this,s),set:t.bind(this,s)};Object.defineProperty(this.options,s,r)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=lo[e]),!JL(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=lo[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=ZL.includes(t)?t:lo[e];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${e} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case"scrollback":if(t=Math.min(t,4294967295),t<0)throw new Error(`${e} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${e} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{};break}return t}};function JL(e){return e==="block"||e==="underline"||e==="bar"}function Hl(e,t=5){if(typeof e!="object")return e;let s=Array.isArray(e)?[]:{};for(let r in e)s[r]=t<=1?e[r]:e[r]&&Hl(e[r],t-1);return s}var yx=Object.freeze({insertMode:!1}),xx=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),vg=class extends Ke{constructor(e,t,s){super(),this._bufferService=e,this._logService=t,this._optionsService=s,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new he),this.onData=this._onData.event,this._onUserInput=this._register(new he),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new he),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new he),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=Hl(yx),this.decPrivateModes=Hl(xx)}reset(){this.modes=Hl(yx),this.decPrivateModes=Hl(xx)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let s=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&s.ybase!==s.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(r=>r.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(t=>t.charCodeAt(0))),this._onBinary.fire(e))}};vg=Pt([be(0,ji),be(1,SE),be(2,Bi)],vg);var Sx={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function wm(e,t){let s=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(s|=64,s|=e.action):(s|=e.button&3,e.button&4&&(s|=64),e.button&8&&(s|=128),e.action===32?s|=32:e.action===0&&!t&&(s|=3)),s}var Em=String.fromCharCode,wx={DEFAULT:e=>{let t=[wm(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${Em(t[0])}${Em(t[1])}${Em(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${wm(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${wm(e,!0)};${e.x};${e.y}${t}`}},bg=class extends Ke{constructor(e,t,s){super(),this._bufferService=e,this._coreService=t,this._optionsService=s,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new he),this.onProtocolChange=this._onProtocolChange.event;for(let r of Object.keys(Sx))this.addProtocol(r,Sx[r]);for(let r of Object.keys(wx))this.addEncoding(r,wx[r]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,s){if(e.deltaY===0||e.shiftKey||t===void 0||s===void 0)return 0;let r=t/s,o=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(o/=r+0,Math.abs(e.deltaY)<50&&(o*=.3),this._wheelPartialScroll+=o,o=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(o*=this._bufferService.rows),o}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,s){if(s){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};bg=Pt([be(0,ji),be(1,ba),be(2,Bi)],bg);var Cm=[[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]],e9=[[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]],ri;function t9(e,t){let s=0,r=t.length-1,o;if(e<t[0][0]||e>t[r][1])return!1;for(;r>=s;)if(o=s+r>>1,e>t[o][1])s=o+1;else if(e<t[o][0])r=o-1;else return!0;return!1}var i9=class{constructor(){if(this.version="6",!ri){ri=new Uint8Array(65536),ri.fill(1),ri[0]=0,ri.fill(0,1,32),ri.fill(0,127,160),ri.fill(2,4352,4448),ri[9001]=2,ri[9002]=2,ri.fill(2,11904,42192),ri[12351]=1,ri.fill(2,44032,55204),ri.fill(2,63744,64256),ri.fill(2,65040,65050),ri.fill(2,65072,65136),ri.fill(2,65280,65377),ri.fill(2,65504,65511);for(let e=0;e<Cm.length;++e)ri.fill(0,Cm[e][0],Cm[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?ri[e]:t9(e,e9)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let s=this.wcwidth(e),r=s===0&&t!==0;if(r){let o=ua.extractWidth(t);o===0?r=!1:o>s&&(s=o)}return ua.createPropertyValue(0,s,r)}},ua=class ad{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new he,this.onChange=this._onChange.event;let t=new i9;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,s,r=!1){return(t&16777215)<<3|(s&3)<<1|(r?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let s=0,r=0,o=t.length;for(let l=0;l<o;++l){let d=t.charCodeAt(l);if(55296<=d&&d<=56319){if(++l>=o)return s+this.wcwidth(d);let h=t.charCodeAt(l);56320<=h&&h<=57343?d=(d-55296)*1024+h-56320+65536:s+=this.wcwidth(h)}let f=this.charProperties(d,r),m=ad.extractWidth(f);ad.extractShouldJoin(f)&&(m-=ad.extractWidth(r)),s+=m,r=f}return s}charProperties(t,s){return this._activeProvider.charProperties(t,s)}},s9=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function Ex(e){let t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.get(e.cols-1),s=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);s&&t&&(s.isWrapped=t[3]!==0&&t[3]!==32)}var Rl=2147483647,n9=256,sC=class yg{constructor(t=32,s=32){if(this.maxLength=t,this.maxSubParamsLength=s,s>n9)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(s),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let s=new yg;if(!t.length)return s;for(let r=Array.isArray(t[0])?1:0;r<t.length;++r){let o=t[r];if(Array.isArray(o))for(let l=0;l<o.length;++l)s.addSubParam(o[l]);else s.addParam(o)}return s}clone(){let t=new yg(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let t=[];for(let s=0;s<this.length;++s){t.push(this.params[s]);let r=this._subParamsIdx[s]>>8,o=this._subParamsIdx[s]&255;o-r>0&&t.push(Array.prototype.slice.call(this._subParams,r,o))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>Rl?Rl:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>Rl?Rl:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let s=this._subParamsIdx[t]>>8,r=this._subParamsIdx[t]&255;return r-s>0?this._subParams.subarray(s,r):null}getSubParamsAll(){let t={};for(let s=0;s<this.length;++s){let r=this._subParamsIdx[s]>>8,o=this._subParamsIdx[s]&255;o-r>0&&(t[s]=this._subParams.slice(r,o))}return t}addDigit(t){let s;if(this._rejectDigits||!(s=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let r=this._digitIsSub?this._subParams:this.params,o=r[s-1];r[s-1]=~o?Math.min(o*10+t,Rl):t}},Dl=[],r9=class{constructor(){this._state=0,this._active=Dl,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let s=this._handlers[e];return s.push(t),{dispose:()=>{let r=s.indexOf(t);r!==-1&&s.splice(r,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=Dl}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=Dl,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||Dl,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,s){if(!this._active.length)this._handlerFb(this._id,"PUT",Ld(e,t,s));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,s)}start(){this.reset(),this._state=1}put(e,t,s){if(this._state!==3){if(this._state===1)for(;t<s;){let r=e[t++];if(r===59){this._state=2,this._start();break}if(r<48||57<r){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+r-48}this._state===2&&s-t>0&&this._put(e,t,s)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let s=!1,r=this._active.length-1,o=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,s=t,o=this._stack.fallThrough,this._stack.paused=!1),!o&&s===!1){for(;r>=0&&(s=this._active[r].end(e),s!==!0);r--)if(s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,s;r--}for(;r>=0;r--)if(s=this._active[r].end(!1),s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,s}this._active=Dl,this._id=-1,this._state=0}}},rs=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,s){this._hitLimit||(this._data+=Ld(e,t,s),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(s=>(this._data="",this._hitLimit=!1,s));return this._data="",this._hitLimit=!1,t}},Ol=[],a9=class{constructor(){this._handlers=Object.create(null),this._active=Ol,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Ol}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let s=this._handlers[e];return s.push(t),{dispose:()=>{let r=s.indexOf(t);r!==-1&&s.splice(r,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=Ol,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||Ol,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let s=this._active.length-1;s>=0;s--)this._active[s].hook(t)}put(e,t,s){if(!this._active.length)this._handlerFb(this._ident,"PUT",Ld(e,t,s));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,s)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let s=!1,r=this._active.length-1,o=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,s=t,o=this._stack.fallThrough,this._stack.paused=!1),!o&&s===!1){for(;r>=0&&(s=this._active[r].unhook(e),s!==!0);r--)if(s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,s;r--}for(;r>=0;r--)if(s=this._active[r].unhook(!1),s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,s}this._active=Ol,this._ident=0}},Fl=new sC;Fl.addParam(0);var Cx=class{constructor(e){this._handler=e,this._data="",this._params=Fl,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():Fl,this._data="",this._hitLimit=!1}put(e,t,s){this._hitLimit||(this._data+=Ld(e,t,s),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(s=>(this._params=Fl,this._data="",this._hitLimit=!1,s));return this._params=Fl,this._data="",this._hitLimit=!1,t}},o9=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,s,r){this.table[t<<8|e]=s<<4|r}addMany(e,t,s,r){for(let o=0;o<e.length;o++)this.table[t<<8|e[o]]=s<<4|r}},Ss=160,l9=(function(){let e=new o9(4095),t=Array.apply(null,Array(256)).map((f,m)=>m),s=(f,m)=>t.slice(f,m),r=s(32,127),o=s(0,24);o.push(25),o.push.apply(o,s(28,32));let l=s(0,14),d;e.setDefault(1,0),e.addMany(r,0,2,0);for(d in l)e.addMany([24,26,153,154],d,3,0),e.addMany(s(128,144),d,3,0),e.addMany(s(144,152),d,3,0),e.add(156,d,0,0),e.add(27,d,11,1),e.add(157,d,4,8),e.addMany([152,158,159],d,0,7),e.add(155,d,11,3),e.add(144,d,11,9);return e.addMany(o,0,3,0),e.addMany(o,1,3,1),e.add(127,1,0,1),e.addMany(o,8,0,8),e.addMany(o,3,3,3),e.add(127,3,0,3),e.addMany(o,4,3,4),e.add(127,4,0,4),e.addMany(o,6,3,6),e.addMany(o,5,3,5),e.add(127,5,0,5),e.addMany(o,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(r,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(s(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(r,7,0,7),e.addMany(o,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(s(64,127),3,7,0),e.addMany(s(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(s(48,60),4,8,4),e.addMany(s(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(s(32,64),6,0,6),e.add(127,6,0,6),e.addMany(s(64,127),6,0,0),e.addMany(s(32,48),3,9,5),e.addMany(s(32,48),5,9,5),e.addMany(s(48,64),5,0,6),e.addMany(s(64,127),5,7,0),e.addMany(s(32,48),4,9,5),e.addMany(s(32,48),1,9,2),e.addMany(s(32,48),2,9,2),e.addMany(s(48,127),2,10,0),e.addMany(s(48,80),1,10,0),e.addMany(s(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(s(96,127),1,10,0),e.add(80,1,11,9),e.addMany(o,9,0,9),e.add(127,9,0,9),e.addMany(s(28,32),9,0,9),e.addMany(s(32,48),9,9,12),e.addMany(s(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(o,11,0,11),e.addMany(s(32,128),11,0,11),e.addMany(s(28,32),11,0,11),e.addMany(o,10,0,10),e.add(127,10,0,10),e.addMany(s(28,32),10,0,10),e.addMany(s(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(s(32,48),10,9,12),e.addMany(o,12,0,12),e.add(127,12,0,12),e.addMany(s(28,32),12,0,12),e.addMany(s(32,48),12,9,12),e.addMany(s(48,64),12,0,11),e.addMany(s(64,127),12,12,13),e.addMany(s(64,127),10,12,13),e.addMany(s(64,127),9,12,13),e.addMany(o,13,13,13),e.addMany(r,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(Ss,0,2,0),e.add(Ss,8,5,8),e.add(Ss,6,0,6),e.add(Ss,11,0,11),e.add(Ss,13,13,13),e})(),c9=class extends Ke{constructor(e=l9){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 sC,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,s,r)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,s)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(Mt(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new r9),this._dcsParser=this._register(new a9),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let s=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(s=e.prefix.charCodeAt(0),s&&60>s||s>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 o=0;o<e.intermediates.length;++o){let l=e.intermediates.charCodeAt(o);if(32>l||l>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");s<<=8,s|=l}}if(e.final.length!==1)throw new Error("final must be a single byte");let r=e.final.charCodeAt(0);if(t[0]>r||r>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return s<<=8,s|=r,s}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let s=this._identifier(e,[48,126]);this._escHandlers[s]===void 0&&(this._escHandlers[s]=[]);let r=this._escHandlers[s];return r.push(t),{dispose:()=>{let o=r.indexOf(t);o!==-1&&r.splice(o,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let s=this._identifier(e);this._csiHandlers[s]===void 0&&(this._csiHandlers[s]=[]);let r=this._csiHandlers[s];return r.push(t),{dispose:()=>{let o=r.indexOf(t);o!==-1&&r.splice(o,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,s,r,o){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=s,this._parseStack.transition=r,this._parseStack.chunkPos=o}parse(e,t,s){let r=0,o=0,l=0,d;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,l=this._parseStack.chunkPos+1;else{if(s===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let f=this._parseStack.handlers,m=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(s===!1&&m>-1){for(;m>=0&&(d=f[m](this._params),d!==!0);m--)if(d instanceof Promise)return this._parseStack.handlerPos=m,d}this._parseStack.handlers=[];break;case 4:if(s===!1&&m>-1){for(;m>=0&&(d=f[m](),d!==!0);m--)if(d instanceof Promise)return this._parseStack.handlerPos=m,d}this._parseStack.handlers=[];break;case 6:if(r=e[this._parseStack.chunkPos],d=this._dcsParser.unhook(r!==24&&r!==26,s),d)return d;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(r=e[this._parseStack.chunkPos],d=this._oscParser.end(r!==24&&r!==26,s),d)return d;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,l=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let f=l;f<t;++f){switch(r=e[f],o=this._transitions.table[this.currentState<<8|(r<160?r:Ss)],o>>4){case 2:for(let b=f+1;;++b){if(b>=t||(r=e[b])<32||r>126&&r<Ss){this._printHandler(e,f,b),f=b-1;break}if(++b>=t||(r=e[b])<32||r>126&&r<Ss){this._printHandler(e,f,b),f=b-1;break}if(++b>=t||(r=e[b])<32||r>126&&r<Ss){this._printHandler(e,f,b),f=b-1;break}if(++b>=t||(r=e[b])<32||r>126&&r<Ss){this._printHandler(e,f,b),f=b-1;break}}break;case 3:this._executeHandlers[r]?this._executeHandlers[r]():this._executeHandlerFb(r),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:f,code:r,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let m=this._csiHandlers[this._collect<<8|r],h=m?m.length-1:-1;for(;h>=0&&(d=m[h](this._params),d!==!0);h--)if(d instanceof Promise)return this._preserveStack(3,m,h,o,f),d;h<0&&this._csiHandlerFb(this._collect<<8|r,this._params),this.precedingJoinState=0;break;case 8:do switch(r){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(r-48)}while(++f<t&&(r=e[f])>47&&r<60);f--;break;case 9:this._collect<<=8,this._collect|=r;break;case 10:let _=this._escHandlers[this._collect<<8|r],v=_?_.length-1:-1;for(;v>=0&&(d=_[v](),d!==!0);v--)if(d instanceof Promise)return this._preserveStack(4,_,v,o,f),d;v<0&&this._escHandlerFb(this._collect<<8|r),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|r,this._params);break;case 13:for(let b=f+1;;++b)if(b>=t||(r=e[b])===24||r===26||r===27||r>127&&r<Ss){this._dcsParser.put(e,f,b),f=b-1;break}break;case 14:if(d=this._dcsParser.unhook(r!==24&&r!==26),d)return this._preserveStack(6,[],0,o,f),d;r===27&&(o|=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 b=f+1;;b++)if(b>=t||(r=e[b])<32||r>127&&r<Ss){this._oscParser.put(e,f,b),f=b-1;break}break;case 6:if(d=this._oscParser.end(r!==24&&r!==26),d)return this._preserveStack(5,[],0,o,f),d;r===27&&(o|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=o&15}}},u9=/^([\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})$/,d9=/^[\da-f]+$/;function Nx(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let s=u9.exec(t);if(s){let r=s[1]?15:s[4]?255:s[7]?4095:65535;return[Math.round(parseInt(s[1]||s[4]||s[7]||s[10],16)/r*255),Math.round(parseInt(s[2]||s[5]||s[8]||s[11],16)/r*255),Math.round(parseInt(s[3]||s[6]||s[9]||s[12],16)/r*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),d9.exec(t)&&[3,6,9,12].includes(t.length))){let s=t.length/3,r=[0,0,0];for(let o=0;o<3;++o){let l=parseInt(t.slice(s*o,s*o+s),16);r[o]=s===1?l<<4:s===2?l:s===3?l>>4:l>>8}return r}}function Nm(e,t){let s=e.toString(16),r=s.length<2?"0"+s:s;switch(t){case 4:return s[0];case 8:return r;case 12:return(r+r).slice(0,3);default:return r+r}}function h9(e,t=16){let[s,r,o]=e;return`rgb:${Nm(s,t)}/${Nm(r,t)}/${Nm(o,t)}`}var f9={"(":0,")":1,"*":2,"+":3,"-":1,".":2},xr=131072,kx=10;function Tx(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var Mx=5e3,Ax=0,m9=class extends Ke{constructor(e,t,s,r,o,l,d,f,m=new c9){super(),this._bufferService=e,this._charsetService=t,this._coreService=s,this._logService=r,this._optionsService=o,this._oscLinkService=l,this._coreMouseService=d,this._unicodeService=f,this._parser=m,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new O7,this._utf8Decoder=new L7,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=Qt.clone(),this._eraseAttrDataInternal=Qt.clone(),this._onRequestBell=this._register(new he),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new he),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new he),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new he),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new he),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new he),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new he),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new he),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new he),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new he),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new he),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new he),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new he),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 xg(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(h=>this._activeBuffer=h.activeBuffer)),this._parser.setCsiHandlerFallback((h,_)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(h),params:_.toArray()})}),this._parser.setEscHandlerFallback(h=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(h)})}),this._parser.setExecuteHandlerFallback(h=>{this._logService.debug("Unknown EXECUTE code: ",{code:h})}),this._parser.setOscHandlerFallback((h,_,v)=>{this._logService.debug("Unknown OSC code: ",{identifier:h,action:_,data:v})}),this._parser.setDcsHandlerFallback((h,_,v)=>{_==="HOOK"&&(v=v.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(h),action:_,payload:v})}),this._parser.setPrintHandler((h,_,v)=>this.print(h,_,v)),this._parser.registerCsiHandler({final:"@"},h=>this.insertChars(h)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},h=>this.scrollLeft(h)),this._parser.registerCsiHandler({final:"A"},h=>this.cursorUp(h)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},h=>this.scrollRight(h)),this._parser.registerCsiHandler({final:"B"},h=>this.cursorDown(h)),this._parser.registerCsiHandler({final:"C"},h=>this.cursorForward(h)),this._parser.registerCsiHandler({final:"D"},h=>this.cursorBackward(h)),this._parser.registerCsiHandler({final:"E"},h=>this.cursorNextLine(h)),this._parser.registerCsiHandler({final:"F"},h=>this.cursorPrecedingLine(h)),this._parser.registerCsiHandler({final:"G"},h=>this.cursorCharAbsolute(h)),this._parser.registerCsiHandler({final:"H"},h=>this.cursorPosition(h)),this._parser.registerCsiHandler({final:"I"},h=>this.cursorForwardTab(h)),this._parser.registerCsiHandler({final:"J"},h=>this.eraseInDisplay(h,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},h=>this.eraseInDisplay(h,!0)),this._parser.registerCsiHandler({final:"K"},h=>this.eraseInLine(h,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},h=>this.eraseInLine(h,!0)),this._parser.registerCsiHandler({final:"L"},h=>this.insertLines(h)),this._parser.registerCsiHandler({final:"M"},h=>this.deleteLines(h)),this._parser.registerCsiHandler({final:"P"},h=>this.deleteChars(h)),this._parser.registerCsiHandler({final:"S"},h=>this.scrollUp(h)),this._parser.registerCsiHandler({final:"T"},h=>this.scrollDown(h)),this._parser.registerCsiHandler({final:"X"},h=>this.eraseChars(h)),this._parser.registerCsiHandler({final:"Z"},h=>this.cursorBackwardTab(h)),this._parser.registerCsiHandler({final:"`"},h=>this.charPosAbsolute(h)),this._parser.registerCsiHandler({final:"a"},h=>this.hPositionRelative(h)),this._parser.registerCsiHandler({final:"b"},h=>this.repeatPrecedingCharacter(h)),this._parser.registerCsiHandler({final:"c"},h=>this.sendDeviceAttributesPrimary(h)),this._parser.registerCsiHandler({prefix:">",final:"c"},h=>this.sendDeviceAttributesSecondary(h)),this._parser.registerCsiHandler({final:"d"},h=>this.linePosAbsolute(h)),this._parser.registerCsiHandler({final:"e"},h=>this.vPositionRelative(h)),this._parser.registerCsiHandler({final:"f"},h=>this.hVPosition(h)),this._parser.registerCsiHandler({final:"g"},h=>this.tabClear(h)),this._parser.registerCsiHandler({final:"h"},h=>this.setMode(h)),this._parser.registerCsiHandler({prefix:"?",final:"h"},h=>this.setModePrivate(h)),this._parser.registerCsiHandler({final:"l"},h=>this.resetMode(h)),this._parser.registerCsiHandler({prefix:"?",final:"l"},h=>this.resetModePrivate(h)),this._parser.registerCsiHandler({final:"m"},h=>this.charAttributes(h)),this._parser.registerCsiHandler({final:"n"},h=>this.deviceStatus(h)),this._parser.registerCsiHandler({prefix:"?",final:"n"},h=>this.deviceStatusPrivate(h)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},h=>this.softReset(h)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},h=>this.setCursorStyle(h)),this._parser.registerCsiHandler({final:"r"},h=>this.setScrollRegion(h)),this._parser.registerCsiHandler({final:"s"},h=>this.saveCursor(h)),this._parser.registerCsiHandler({final:"t"},h=>this.windowOptions(h)),this._parser.registerCsiHandler({final:"u"},h=>this.restoreCursor(h)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},h=>this.insertColumns(h)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},h=>this.deleteColumns(h)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},h=>this.selectProtected(h)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},h=>this.requestMode(h,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},h=>this.requestMode(h,!1)),this._parser.setExecuteHandler(oe.BEL,()=>this.bell()),this._parser.setExecuteHandler(oe.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(oe.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(oe.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(oe.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(oe.BS,()=>this.backspace()),this._parser.setExecuteHandler(oe.HT,()=>this.tab()),this._parser.setExecuteHandler(oe.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(oe.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(nd.IND,()=>this.index()),this._parser.setExecuteHandler(nd.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(nd.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new rs(h=>(this.setTitle(h),this.setIconName(h),!0))),this._parser.registerOscHandler(1,new rs(h=>this.setIconName(h))),this._parser.registerOscHandler(2,new rs(h=>this.setTitle(h))),this._parser.registerOscHandler(4,new rs(h=>this.setOrReportIndexedColor(h))),this._parser.registerOscHandler(8,new rs(h=>this.setHyperlink(h))),this._parser.registerOscHandler(10,new rs(h=>this.setOrReportFgColor(h))),this._parser.registerOscHandler(11,new rs(h=>this.setOrReportBgColor(h))),this._parser.registerOscHandler(12,new rs(h=>this.setOrReportCursorColor(h))),this._parser.registerOscHandler(104,new rs(h=>this.restoreIndexedColor(h))),this._parser.registerOscHandler(110,new rs(h=>this.restoreFgColor(h))),this._parser.registerOscHandler(111,new rs(h=>this.restoreBgColor(h))),this._parser.registerOscHandler(112,new rs(h=>this.restoreCursorColor(h))),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 h in oi)this._parser.registerEscHandler({intermediates:"(",final:h},()=>this.selectCharset("("+h)),this._parser.registerEscHandler({intermediates:")",final:h},()=>this.selectCharset(")"+h)),this._parser.registerEscHandler({intermediates:"*",final:h},()=>this.selectCharset("*"+h)),this._parser.registerEscHandler({intermediates:"+",final:h},()=>this.selectCharset("+"+h)),this._parser.registerEscHandler({intermediates:"-",final:h},()=>this.selectCharset("-"+h)),this._parser.registerEscHandler({intermediates:".",final:h},()=>this.selectCharset("."+h)),this._parser.registerEscHandler({intermediates:"/",final:h},()=>this.selectCharset("/"+h));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(h=>(this._logService.error("Parsing error: ",h),h)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new Cx((h,_)=>this.requestStatusString(h,_)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,s,r){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=s,this._parseStack.position=r}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,s)=>setTimeout(()=>s("#SLOW_TIMEOUT"),Mx))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${Mx} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let s,r=this._activeBuffer.x,o=this._activeBuffer.y,l=0,d=this._parseStack.paused;if(d){if(s=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(s),s;r=this._parseStack.cursorStartX,o=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>xr&&(l=this._parseStack.position+xr)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,h=>String.fromCharCode(h)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(h=>h.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<xr&&(this._parseBuffer=new Uint32Array(Math.min(e.length,xr))),d||this._dirtyRowTracker.clearRange(),e.length>xr)for(let h=l;h<e.length;h+=xr){let _=h+xr<e.length?h+xr:e.length,v=typeof e=="string"?this._stringDecoder.decode(e.substring(h,_),this._parseBuffer):this._utf8Decoder.decode(e.subarray(h,_),this._parseBuffer);if(s=this._parser.parse(this._parseBuffer,v))return this._preserveStack(r,o,v,h),this._logSlowResolvingAsync(s),s}else if(!d){let h=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(s=this._parser.parse(this._parseBuffer,h))return this._preserveStack(r,o,h,0),this._logSlowResolvingAsync(s),s}(this._activeBuffer.x!==r||this._activeBuffer.y!==o)&&this._onCursorMove.fire();let f=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),m=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);m<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(m,this._bufferService.rows-1),end:Math.min(f,this._bufferService.rows-1)})}print(e,t,s){let r,o,l=this._charsetService.charset,d=this._optionsService.rawOptions.screenReaderMode,f=this._bufferService.cols,m=this._coreService.decPrivateModes.wraparound,h=this._coreService.modes.insertMode,_=this._curAttrData,v=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&s-t>0&&v.getWidth(this._activeBuffer.x-1)===2&&v.setCellFromCodepoint(this._activeBuffer.x-1,0,1,_);let b=this._parser.precedingJoinState;for(let y=t;y<s;++y){if(r=e[y],r<127&&l){let A=l[String.fromCharCode(r)];A&&(r=A.charCodeAt(0))}let x=this._unicodeService.charProperties(r,b);o=ua.extractWidth(x);let w=ua.extractShouldJoin(x),N=w?ua.extractWidth(b):0;if(b=x,d&&this._onA11yChar.fire(wr(r)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+o-N>f){if(m){let A=v,R=this._activeBuffer.x-N;for(this._activeBuffer.x=N,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),N>0&&v instanceof Ul&&v.copyCellsFrom(A,R,0,N,!1);R<f;)A.setCellFromCodepoint(R++,0,1,_)}else if(this._activeBuffer.x=f-1,o===2)continue}if(w&&this._activeBuffer.x){let A=v.getWidth(this._activeBuffer.x-1)?1:2;v.addCodepointToCell(this._activeBuffer.x-A,r,o);for(let R=o-N;--R>=0;)v.setCellFromCodepoint(this._activeBuffer.x++,0,0,_);continue}if(h&&(v.insertCells(this._activeBuffer.x,o-N,this._activeBuffer.getNullCell(_)),v.getWidth(f-1)===2&&v.setCellFromCodepoint(f-1,0,1,_)),v.setCellFromCodepoint(this._activeBuffer.x++,r,o,_),o>0)for(;--o;)v.setCellFromCodepoint(this._activeBuffer.x++,0,0,_)}this._parser.precedingJoinState=b,this._activeBuffer.x<f&&s-t>0&&v.getWidth(this._activeBuffer.x)===0&&!v.hasContent(this._activeBuffer.x)&&v.setCellFromCodepoint(this._activeBuffer.x,0,1,_),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,s=>Tx(s.params[0],this._optionsService.rawOptions.windowOptions)?t(s):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new Cx(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new rs(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,s,r=!1,o=!1){let l=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);l.replaceCells(t,s,this._activeBuffer.getNullCell(this._eraseAttrData()),o),r&&(l.isWrapped=!1)}_resetBufferLine(e,t=!1){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);s&&(s.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),s.isWrapped=!1)}eraseInDisplay(e,t=!1){this._restrictCursor(this._bufferService.cols);let s;switch(e.params[0]){case 0:for(s=this._activeBuffer.y,this._dirtyRowTracker.markDirty(s),this._eraseInBufferLine(s++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);s<this._bufferService.rows;s++)this._resetBufferLine(s,t);this._dirtyRowTracker.markDirty(s);break;case 1:for(s=this._activeBuffer.y,this._dirtyRowTracker.markDirty(s),this._eraseInBufferLine(s,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(s+1).isWrapped=!1);s--;)this._resetBufferLine(s,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(s=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,s-1);s--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+s)?.getTrimmedLength(););for(;s>=0;s--)this._bufferService.scroll(this._eraseAttrData())}else{for(s=this._bufferService.rows,this._dirtyRowTracker.markDirty(s-1);s--;)this._resetBufferLine(s,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let r=this._activeBuffer.lines.length-this._bufferService.rows;r>0&&(this._activeBuffer.lines.trimStart(r),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-r,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-r,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let s=this._activeBuffer.ybase+this._activeBuffer.y,r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,o=this._bufferService.rows-1+this._activeBuffer.ybase-r+1;for(;t--;)this._activeBuffer.lines.splice(o-1,1),this._activeBuffer.lines.splice(s,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let s=this._activeBuffer.ybase+this._activeBuffer.y,r;for(r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r=this._bufferService.rows-1+this._activeBuffer.ybase-r;t--;)this._activeBuffer.lines.splice(s,1),this._activeBuffer.lines.splice(r,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(Qt));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let s=this._activeBuffer.scrollTop;s<=this._activeBuffer.scrollBottom;++s){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+s);r.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let s=this._activeBuffer.scrollTop;s<=this._activeBuffer.scrollBottom;++s){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+s);r.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let s=this._activeBuffer.scrollTop;s<=this._activeBuffer.scrollBottom;++s){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+s);r.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let s=this._activeBuffer.scrollTop;s<=this._activeBuffer.scrollBottom;++s){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+s);r.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let s=e.params[0]||1,r=ua.extractWidth(t),o=this._activeBuffer.x-r,l=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(o),d=new Uint32Array(l.length*s),f=0;for(let h=0;h<l.length;){let _=l.codePointAt(h)||0;d[f++]=_,h+=_>65535?2:1}let m=f;for(let h=1;h<s;++h)d.copyWithin(m,0,f),m+=f;return this.print(d,0,m),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(oe.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(oe.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(oe.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(oe.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(oe.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,oa),this._charsetService.setgCharset(1,oa),this._charsetService.setgCharset(2,oa),this._charsetService.setgCharset(3,oa);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0;break}return!0}resetMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[t]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0);break}return!0}requestMode(e,t){let s;(w=>(w[w.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",w[w.SET=1]="SET",w[w.RESET=2]="RESET",w[w.PERMANENTLY_SET=3]="PERMANENTLY_SET",w[w.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(s||={});let r=this._coreService.decPrivateModes,{activeProtocol:o,activeEncoding:l}=this._coreMouseService,d=this._coreService,{buffers:f,cols:m}=this._bufferService,{active:h,alt:_}=f,v=this._optionsService.rawOptions,b=(w,N)=>(d.triggerDataEvent(`${oe.ESC}[${t?"":"?"}${w};${N}$y`),!0),y=w=>w?1:2,x=e.params[0];return t?x===2?b(x,4):x===4?b(x,y(d.modes.insertMode)):x===12?b(x,3):x===20?b(x,y(v.convertEol)):b(x,0):x===1?b(x,y(r.applicationCursorKeys)):x===3?b(x,v.windowOptions.setWinLines?m===80?2:m===132?1:0:0):x===6?b(x,y(r.origin)):x===7?b(x,y(r.wraparound)):x===8?b(x,3):x===9?b(x,y(o==="X10")):x===12?b(x,y(v.cursorBlink)):x===25?b(x,y(!d.isCursorHidden)):x===45?b(x,y(r.reverseWraparound)):x===66?b(x,y(r.applicationKeypad)):x===67?b(x,4):x===1e3?b(x,y(o==="VT200")):x===1002?b(x,y(o==="DRAG")):x===1003?b(x,y(o==="ANY")):x===1004?b(x,y(r.sendFocus)):x===1005?b(x,4):x===1006?b(x,y(l==="SGR")):x===1015?b(x,4):x===1016?b(x,y(l==="SGR_PIXELS")):x===1048?b(x,1):x===47||x===1047||x===1049?b(x,y(h===_)):x===2004?b(x,y(r.bracketedPasteMode)):x===2026?b(x,y(r.synchronizedOutput)):b(x,0)}_updateAttrColor(e,t,s,r,o){return t===2?(e|=50331648,e&=-16777216,e|=mc.fromColorRGB([s,r,o])):t===5&&(e&=-50331904,e|=33554432|s&255),e}_extractColor(e,t,s){let r=[0,0,-1,0,0,0],o=0,l=0;do{if(r[l+o]=e.params[t+l],e.hasSubParams(t+l)){let d=e.getSubParams(t+l),f=0;do r[1]===5&&(o=1),r[l+f+1+o]=d[f];while(++f<d.length&&f+l+1+o<r.length);break}if(r[1]===5&&l+o>=2||r[1]===2&&l+o>=5)break;r[1]&&(o=1)}while(++l+t<e.length&&l+o<r.length);for(let d=2;d<r.length;++d)r[d]===-1&&(r[d]=0);switch(r[0]){case 38:s.fg=this._updateAttrColor(s.fg,r[1],r[3],r[4],r[5]);break;case 48:s.bg=this._updateAttrColor(s.bg,r[1],r[3],r[4],r[5]);break;case 58:s.extended=s.extended.clone(),s.extended.underlineColor=this._updateAttrColor(s.extended.underlineColor,r[1],r[3],r[4],r[5])}return l}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=Qt.fg,e.bg=Qt.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,s,r=this._curAttrData;for(let o=0;o<t;o++)s=e.params[o],s>=30&&s<=37?(r.fg&=-50331904,r.fg|=16777216|s-30):s>=40&&s<=47?(r.bg&=-50331904,r.bg|=16777216|s-40):s>=90&&s<=97?(r.fg&=-50331904,r.fg|=16777216|s-90|8):s>=100&&s<=107?(r.bg&=-50331904,r.bg|=16777216|s-100|8):s===0?this._processSGR0(r):s===1?r.fg|=134217728:s===3?r.bg|=67108864:s===4?(r.fg|=268435456,this._processUnderline(e.hasSubParams(o)?e.getSubParams(o)[0]:1,r)):s===5?r.fg|=536870912:s===7?r.fg|=67108864:s===8?r.fg|=1073741824:s===9?r.fg|=2147483648:s===2?r.bg|=134217728:s===21?this._processUnderline(2,r):s===22?(r.fg&=-134217729,r.bg&=-134217729):s===23?r.bg&=-67108865:s===24?(r.fg&=-268435457,this._processUnderline(0,r)):s===25?r.fg&=-536870913:s===27?r.fg&=-67108865:s===28?r.fg&=-1073741825:s===29?r.fg&=2147483647:s===39?(r.fg&=-67108864,r.fg|=Qt.fg&16777215):s===49?(r.bg&=-67108864,r.bg|=Qt.bg&16777215):s===38||s===48||s===58?o+=this._extractColor(e,o,r):s===53?r.bg|=1073741824:s===55?r.bg&=-1073741825:s===59?(r.extended=r.extended.clone(),r.extended.underlineColor=-1,r.updateExtended()):s===100?(r.fg&=-67108864,r.fg|=Qt.fg&16777215,r.bg&=-67108864,r.bg|=Qt.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",s);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${oe.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,s=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${oe.ESC}[${t};${s}R`);break}return!0}deviceStatusPrivate(e){if(e.params[0]===6){let t=this._activeBuffer.y+1,s=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${oe.ESC}[?${t};${s}R`)}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=Qt.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let s=t%2===1;this._coreService.decPrivateModes.cursorBlink=s}return!0}setScrollRegion(e){let t=e.params[0]||1,s;return(e.length<2||(s=e.params[1])>this._bufferService.rows||s===0)&&(s=this._bufferService.rows),s>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=s-1,this._setCursor(0,0)),!0}windowOptions(e){if(!Tx(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${oe.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>kx&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>kx&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],s=e.split(";");for(;s.length>1;){let r=s.shift(),o=s.shift();if(/^\d+$/.exec(r)){let l=parseInt(r);if(Rx(l))if(o==="?")t.push({type:0,index:l});else{let d=Nx(o);d&&t.push({type:1,index:l,color:d})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let s=e.slice(0,t).trim(),r=e.slice(t+1);return r?this._createHyperlink(s,r):s.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let s=e.split(":"),r,o=s.findIndex(l=>l.startsWith("id="));return o!==-1&&(r=s[o].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:r,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let s=e.split(";");for(let r=0;r<s.length&&!(t>=this._specialColors.length);++r,++t)if(s[r]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let o=Nx(s[r]);o&&this._onColor.fire([{type:1,index:this._specialColors[t],color:o}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],s=e.split(";");for(let r=0;r<s.length;++r)if(/^\d+$/.exec(s[r])){let o=parseInt(s[r]);Rx(o)&&t.push({type:2,index:o})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,oa),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(f9[e[0]],oi[e[1]]||oa),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=Qt.clone(),this._eraseAttrDataInternal=Qt.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new Ns;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let s=this._activeBuffer.ybase+this._activeBuffer.y+t,r=this._activeBuffer.lines.get(s);r&&(r.fill(e),r.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let s=d=>(this._coreService.triggerDataEvent(`${oe.ESC}${d}${oe.ESC}\\`),!0),r=this._bufferService.buffer,o=this._optionsService.rawOptions;return s(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${r.scrollTop+1};${r.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[o.cursorStyle]-(o.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},xg=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(Ax=e,e=t,t=Ax),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};xg=Pt([be(0,ji)],xg);function Rx(e){return 0<=e&&e<256}var p9=5e7,Dx=12,g9=50,_9=class extends Ke{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 he),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let s;for(;s=this._writeBuffer.shift();){this._action(s);let r=this._callbacks.shift();r&&r()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>p9)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let s=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let r=this._writeBuffer[this._bufferOffset],o=this._action(r,t);if(o){let d=f=>performance.now()-s>=Dx?setTimeout(()=>this._innerWrite(0,f)):this._innerWrite(s,f);o.catch(f=>(queueMicrotask(()=>{throw f}),Promise.resolve(!1))).then(d);return}let l=this._callbacks[this._bufferOffset];if(l&&l(),this._bufferOffset++,this._pendingData-=r.length,performance.now()-s>=Dx)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>g9&&(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()}},Sg=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let f=t.addMarker(t.ybase+t.y),m={data:e,id:this._nextId++,lines:[f]};return f.onDispose(()=>this._removeMarkerFromLink(m,f)),this._dataByLinkId.set(m.id,m),m.id}let s=e,r=this._getEntryIdKey(s),o=this._entriesWithId.get(r);if(o)return this.addLineToLink(o.id,t.ybase+t.y),o.id;let l=t.addMarker(t.ybase+t.y),d={id:this._nextId++,key:this._getEntryIdKey(s),data:s,lines:[l]};return l.onDispose(()=>this._removeMarkerFromLink(d,l)),this._entriesWithId.set(d.key,d),this._dataByLinkId.set(d.id,d),d.id}addLineToLink(e,t){let s=this._dataByLinkId.get(e);if(s&&s.lines.every(r=>r.line!==t)){let r=this._bufferService.buffer.addMarker(t);s.lines.push(r),r.onDispose(()=>this._removeMarkerFromLink(s,r))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let s=e.lines.indexOf(t);s!==-1&&(e.lines.splice(s,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};Sg=Pt([be(0,ji)],Sg);var Ox=!1,v9=class extends Ke{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new yo),this._onBinary=this._register(new he),this.onBinary=this._onBinary.event,this._onData=this._register(new he),this.onData=this._onData.event,this._onLineFeed=this._register(new he),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new he),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new he),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new he),this._instantiationService=new FL,this.optionsService=this._register(new QL(e)),this._instantiationService.setService(Bi,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(_g)),this._instantiationService.setService(ji,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(gg)),this._instantiationService.setService(SE,this._logService),this.coreService=this._register(this._instantiationService.createInstance(vg)),this._instantiationService.setService(ba,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(bg)),this._instantiationService.setService(xE,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(ua)),this._instantiationService.setService(P7,this.unicodeService),this._charsetService=this._instantiationService.createInstance(s9),this._instantiationService.setService(z7,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(Sg),this._instantiationService.setService(wE,this._oscLinkService),this._inputHandler=this._register(new m9(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(wi.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(wi.forward(this._bufferService.onResize,this._onResize)),this._register(wi.forward(this.coreService.onData,this._onData)),this._register(wi.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 _9((t,s)=>this._inputHandler.parse(t,s))),this._register(wi.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new he),this._onScroll.event(e=>{this._onScrollApi?.fire(e.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!Ox&&(this._logService.warn("writeSync is unreliable and will be removed soon."),Ox=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,tC),t=Math.max(t,iC),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend==="conpty"&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(Ex.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(Ex(this._bufferService),!1))),this._windowsWrappingHeuristics.value=Mt(()=>{for(let t of e)t.dispose()})}}},b9={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 y9(e,t,s,r){let o={type:0,cancel:!1,key:void 0},l=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?o.key=oe.ESC+"OA":o.key=oe.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?o.key=oe.ESC+"OD":o.key=oe.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?o.key=oe.ESC+"OC":o.key=oe.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?o.key=oe.ESC+"OB":o.key=oe.ESC+"[B");break;case 8:o.key=e.ctrlKey?"\b":oe.DEL,e.altKey&&(o.key=oe.ESC+o.key);break;case 9:if(e.shiftKey){o.key=oe.ESC+"[Z";break}o.key=oe.HT,o.cancel=!0;break;case 13:o.key=e.altKey?oe.ESC+oe.CR:oe.CR,o.cancel=!0;break;case 27:o.key=oe.ESC,e.altKey&&(o.key=oe.ESC+oe.ESC),o.cancel=!0;break;case 37:if(e.metaKey)break;l?o.key=oe.ESC+"[1;"+(l+1)+"D":t?o.key=oe.ESC+"OD":o.key=oe.ESC+"[D";break;case 39:if(e.metaKey)break;l?o.key=oe.ESC+"[1;"+(l+1)+"C":t?o.key=oe.ESC+"OC":o.key=oe.ESC+"[C";break;case 38:if(e.metaKey)break;l?o.key=oe.ESC+"[1;"+(l+1)+"A":t?o.key=oe.ESC+"OA":o.key=oe.ESC+"[A";break;case 40:if(e.metaKey)break;l?o.key=oe.ESC+"[1;"+(l+1)+"B":t?o.key=oe.ESC+"OB":o.key=oe.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(o.key=oe.ESC+"[2~");break;case 46:l?o.key=oe.ESC+"[3;"+(l+1)+"~":o.key=oe.ESC+"[3~";break;case 36:l?o.key=oe.ESC+"[1;"+(l+1)+"H":t?o.key=oe.ESC+"OH":o.key=oe.ESC+"[H";break;case 35:l?o.key=oe.ESC+"[1;"+(l+1)+"F":t?o.key=oe.ESC+"OF":o.key=oe.ESC+"[F";break;case 33:e.shiftKey?o.type=2:e.ctrlKey?o.key=oe.ESC+"[5;"+(l+1)+"~":o.key=oe.ESC+"[5~";break;case 34:e.shiftKey?o.type=3:e.ctrlKey?o.key=oe.ESC+"[6;"+(l+1)+"~":o.key=oe.ESC+"[6~";break;case 112:l?o.key=oe.ESC+"[1;"+(l+1)+"P":o.key=oe.ESC+"OP";break;case 113:l?o.key=oe.ESC+"[1;"+(l+1)+"Q":o.key=oe.ESC+"OQ";break;case 114:l?o.key=oe.ESC+"[1;"+(l+1)+"R":o.key=oe.ESC+"OR";break;case 115:l?o.key=oe.ESC+"[1;"+(l+1)+"S":o.key=oe.ESC+"OS";break;case 116:l?o.key=oe.ESC+"[15;"+(l+1)+"~":o.key=oe.ESC+"[15~";break;case 117:l?o.key=oe.ESC+"[17;"+(l+1)+"~":o.key=oe.ESC+"[17~";break;case 118:l?o.key=oe.ESC+"[18;"+(l+1)+"~":o.key=oe.ESC+"[18~";break;case 119:l?o.key=oe.ESC+"[19;"+(l+1)+"~":o.key=oe.ESC+"[19~";break;case 120:l?o.key=oe.ESC+"[20;"+(l+1)+"~":o.key=oe.ESC+"[20~";break;case 121:l?o.key=oe.ESC+"[21;"+(l+1)+"~":o.key=oe.ESC+"[21~";break;case 122:l?o.key=oe.ESC+"[23;"+(l+1)+"~":o.key=oe.ESC+"[23~";break;case 123:l?o.key=oe.ESC+"[24;"+(l+1)+"~":o.key=oe.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?o.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?o.key=oe.NUL:e.keyCode>=51&&e.keyCode<=55?o.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?o.key=oe.DEL:e.keyCode===219?o.key=oe.ESC:e.keyCode===220?o.key=oe.FS:e.keyCode===221&&(o.key=oe.GS);else if((!s||r)&&e.altKey&&!e.metaKey){let d=b9[e.keyCode]?.[e.shiftKey?1:0];if(d)o.key=oe.ESC+d;else if(e.keyCode>=65&&e.keyCode<=90){let f=e.ctrlKey?e.keyCode-64:e.keyCode+32,m=String.fromCharCode(f);e.shiftKey&&(m=m.toUpperCase()),o.key=oe.ESC+m}else if(e.keyCode===32)o.key=oe.ESC+(e.ctrlKey?oe.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let f=e.code.slice(3,4);e.shiftKey||(f=f.toLowerCase()),o.key=oe.ESC+f,o.cancel=!0}}else s&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(o.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?o.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(o.key=oe.US),e.key==="@"&&(o.key=oe.NUL));break}return o}var qt=0,x9=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new Ed,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new Ed,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((o,l)=>this._getKey(o)-this._getKey(l)),t=0,s=0,r=new Array(this._array.length+this._insertedValues.length);for(let o=0;o<r.length;o++)s>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[s])?(r[o]=e[t],t++):r[o]=this._array[s++];this._array=r,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(qt=this._search(t),qt===-1)||this._getKey(this._array[qt])!==t)return!1;do if(this._array[qt]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(qt),!0;while(++qt<this._array.length&&this._getKey(this._array[qt])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((o,l)=>o-l),t=0,s=new Array(this._array.length-e.length),r=0;for(let o=0;o<this._array.length;o++)e[t]===o?t++:s[r++]=this._array[o];this._array=s,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&&(qt=this._search(e),!(qt<0||qt>=this._array.length)&&this._getKey(this._array[qt])===e))do yield this._array[qt];while(++qt<this._array.length&&this._getKey(this._array[qt])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(qt=this._search(e),!(qt<0||qt>=this._array.length)&&this._getKey(this._array[qt])===e))do t(this._array[qt]);while(++qt<this._array.length&&this._getKey(this._array[qt])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,s=this._array.length-1;for(;s>=t;){let r=t+s>>1,o=this._getKey(this._array[r]);if(o>e)s=r-1;else if(o<e)t=r+1;else{for(;r>0&&this._getKey(this._array[r-1])===e;)r--;return r}}return t}},km=0,Lx=0,S9=class extends Ke{constructor(){super(),this._decorations=new x9(e=>e?.marker.line),this._onDecorationRegistered=this._register(new he),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new he),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(Mt(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new w9(e);if(t){let s=t.marker.onDispose(()=>t.dispose()),r=t.onDispose(()=>{r.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),s.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,s){let r=0,o=0;for(let l of this._decorations.getKeyIterator(t))r=l.options.x??0,o=r+(l.options.width??1),e>=r&&e<o&&(!s||(l.options.layer??"bottom")===s)&&(yield l)}forEachDecorationAtCell(e,t,s,r){this._decorations.forEachByKey(t,o=>{km=o.options.x??0,Lx=km+(o.options.width??1),e>=km&&e<Lx&&(!s||(o.options.layer??"bottom")===s)&&r(o)})}},w9=class extends kr{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new he),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new he),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=Ot.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=Ot.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},E9=1e3,C9=class{constructor(e,t=E9){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,s){this._rowCount=s,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t;let r=performance.now();if(r-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=r,this._innerRefresh();else if(!this._additionalRefreshRequested){let o=r-this._lastRefreshMs,l=this._debounceThresholdMS-o;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},l)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},jx=20,Cd=class extends Ke{constructor(e,t,s,r){super(),this._terminal=e,this._coreBrowserService=s,this._renderService=r,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let o=this._coreBrowserService.mainDocument;this._accessibilityContainer=o.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=o.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=o.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new C9(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(`
|
|
32
|
-
`))),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(Pe(o,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(Mt(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<jx+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
33
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===jx+1&&(this._liveRegion.textContent+=Fp.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let s=this._terminal.buffer,r=s.lines.length.toString();for(let o=e;o<=t;o++){let l=s.lines.get(s.ydisp+o),d=[],f=l?.translateToString(!0,void 0,void 0,d)||"",m=(s.ydisp+o+1).toString(),h=this._rowElements[o];h&&(f.length===0?(h.textContent=" ",this._rowColumns.set(h,[0,1])):(h.textContent=f,this._rowColumns.set(h,d)),h.setAttribute("aria-posinset",m),h.setAttribute("aria-setsize",r),this._alignRowWidth(h))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let s=e.target,r=this._rowElements[t===0?1:this._rowElements.length-2],o=s.getAttribute("aria-posinset"),l=t===0?"1":`${this._terminal.buffer.lines.length}`;if(o===l||e.relatedTarget!==r)return;let d,f;if(t===0?(d=s,f=this._rowElements.pop(),this._rowContainer.removeChild(f)):(d=this._rowElements.shift(),f=s,this._rowContainer.removeChild(d)),d.removeEventListener("focus",this._topBoundaryFocusListener),f.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let m=this._createAccessibilityTreeNode();this._rowElements.unshift(m),this._rowContainer.insertAdjacentElement("afterbegin",m)}else{let m=this._createAccessibilityTreeNode();this._rowElements.push(m),this._rowContainer.appendChild(m)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let t={node:e.anchorNode,offset:e.anchorOffset},s={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(s.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===s.node&&t.offset>s.offset)&&([t,s]=[s,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let r=this._rowElements.slice(-1)[0];if(s.node.compareDocumentPosition(r)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(s={node:r,offset:r.textContent?.length??0}),!this._rowContainer.contains(s.node))return;let o=({node:f,offset:m})=>{let h=f instanceof Text?f.parentNode:f,_=parseInt(h?.getAttribute("aria-posinset"),10)-1;if(isNaN(_))return console.warn("row is invalid. Race condition?"),null;let v=this._rowColumns.get(h);if(!v)return console.warn("columns is null. Race condition?"),null;let b=m<v.length?v[m]:v.slice(-1)[0]+1;return b>=this._terminal.cols&&(++_,b=0),{row:_,column:b}},l=o(t),d=o(s);if(!(!l||!d)){if(l.row>d.row||l.row===d.row&&l.column>=d.column)throw new Error("invalid range");this._terminal.select(l.column,l.row,(d.row-l.row)*this._terminal.cols-l.column+d.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){e.style.transform="";let t=e.getBoundingClientRect().width,s=this._rowColumns.get(e)?.slice(-1)?.[0];if(!s)return;let r=s*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${r/t})`}};Cd=Pt([be(1,a0),be(2,In),be(3,Un)],Cd);var wg=class extends Ke{constructor(e,t,s,r,o){super(),this._element=e,this._mouseService=t,this._renderService=s,this._bufferService=r,this._linkProviderService=o,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new he),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new he),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(Mt(()=>{ma(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(Pe(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Pe(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(Pe(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(Pe(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let s=e.composedPath();for(let r=0;r<s.length;r++){let o=s[r];if(o.classList.contains("xterm"))break;if(o.classList.contains("xterm-hover"))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){(!this._activeProviderReplies||!t)&&(this._activeProviderReplies?.forEach(r=>{r?.forEach(o=>{o.link.dispose&&o.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let s=!1;for(let[r,o]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(r)&&(s=this._checkLinkProviderResult(r,e,s)):o.provideLinks(e.y,l=>{if(this._isMouseOut)return;let d=l?.map(f=>({link:f}));this._activeProviderReplies?.set(r,d),s=this._checkLinkProviderResult(r,e,s),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let s=new Set;for(let r=0;r<t.size;r++){let o=t.get(r);if(o)for(let l=0;l<o.length;l++){let d=o[l],f=d.link.range.start.y<e?0:d.link.range.start.x,m=d.link.range.end.y>e?this._bufferService.cols:d.link.range.end.x;for(let h=f;h<=m;h++){if(s.has(h)){o.splice(l--,1);break}s.add(h)}}}}_checkLinkProviderResult(e,t,s){if(!this._activeProviderReplies)return s;let r=this._activeProviderReplies.get(e),o=!1;for(let l=0;l<e;l++)(!this._activeProviderReplies.has(l)||this._activeProviderReplies.get(l))&&(o=!0);if(!o&&r){let l=r.find(d=>this._linkAtPosition(d.link,t));l&&(s=!0,this._handleNewLink(l))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!s)for(let l=0;l<this._activeProviderReplies.size;l++){let d=this._activeProviderReplies.get(l)?.find(f=>this._linkAtPosition(f.link,t));if(d){s=!0,this._handleNewLink(d);break}}return s}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&N9(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,ma(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:s=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==s&&(this._currentLink.state.decorations.pointerCursor=s,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",s))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:s=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==s&&(this._currentLink.state.decorations.underline=s,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,s))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(s=>{if(!this._currentLink)return;let r=s.start===0?0:s.start+1+this._bufferService.buffer.ydisp,o=this._bufferService.buffer.ydisp+1+s.end;if(this._currentLink.link.range.start.y>=r&&this._currentLink.link.range.end.y<=o&&(this._clearCurrentLink(r,o),this._lastMouseEvent)){let l=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);l&&this._askForLink(l,!1)}})))}_linkHover(e,t,s){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(s,t.text)}_fireUnderlineEvent(e,t){let s=e.range,r=this._bufferService.buffer.ydisp,o=this._createLinkUnderlineEvent(s.start.x-1,s.start.y-r-1,s.end.x,s.end.y-r-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(o)}_linkLeave(e,t,s){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(s,t.text)}_linkAtPosition(e,t){let s=e.range.start.y*this._bufferService.cols+e.range.start.x,r=e.range.end.y*this._bufferService.cols+e.range.end.x,o=t.y*this._bufferService.cols+t.x;return s<=o&&o<=r}_positionFromMouseEvent(e,t,s){let r=s.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(r)return{x:r[0],y:r[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,s,r,o){return{x1:e,y1:t,x2:s,y2:r,cols:this._bufferService.cols,fg:o}}};wg=Pt([be(1,o0),be(2,Un),be(3,ji),be(4,CE)],wg);function N9(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var k9=class extends v9{constructor(e={}){super(e),this._linkifier=this._register(new yo),this.browser=$E,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new yo),this._onCursorMove=this._register(new he),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new he),this.onKey=this._onKey.event,this._onRender=this._register(new he),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new he),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new he),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new he),this.onBell=this._onBell.event,this._onFocus=this._register(new he),this._onBlur=this._register(new he),this._onA11yCharEmitter=this._register(new he),this._onA11yTabEmitter=this._register(new he),this._onWillOpen=this._register(new he),this._setup(),this._decorationService=this._instantiationService.createInstance(S9),this._instantiationService.setService(pc,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(gL),this._instantiationService.setService(CE,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance($p)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh(t?.start??0,t?.end??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(t=>this._reportWindowsOptions(t))),this._register(this._inputHandler.onColor(t=>this._handleColorEvent(t))),this._register(wi.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(wi.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(wi.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(wi.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(Mt(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let t of e){let s,r="";switch(t.index){case 256:s="foreground",r="10";break;case 257:s="background",r="11";break;case 258:s="cursor",r="12";break;default:s="ansi",r="4;"+t.index}switch(t.type){case 0:let o=Ct.toColorRGB(s==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[s]);this.coreService.triggerDataEvent(`${oe.ESC}]${r};${h9(o)}${FE.ST}`);break;case 1:if(s==="ansi")this._themeService.modifyColors(l=>l.ansi[t.index]=ti.toColor(...t.color));else{let l=s;this._themeService.modifyColors(d=>d[l]=ti.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Cd,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(oe.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(oe.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let s=Math.min(this.buffer.x,this.cols-1),r=this._renderService.dimensions.css.cell.height,o=t.getWidth(s),l=this._renderService.dimensions.css.cell.width*o,d=this.buffer.y*this._renderService.dimensions.css.cell.height,f=s*this._renderService.dimensions.css.cell.width;this.textarea.style.left=f+"px",this.textarea.style.top=d+"px",this.textarea.style.width=l+"px",this.textarea.style.height=r+"px",this.textarea.style.lineHeight=r+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(Pe(this.element,"copy",t=>{this.hasSelection()&&R7(t,this._selectionService)}));let e=t=>D7(t,this.textarea,this.coreService,this.optionsService);this._register(Pe(this.textarea,"paste",e)),this._register(Pe(this.element,"paste",e)),qE?this._register(Pe(this.element,"mousedown",t=>{t.button===2&&qy(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Pe(this.element,"contextmenu",t=>{qy(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),p0&&this._register(Pe(this.element,"auxclick",t=>{t.button===1&&gE(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Pe(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(Pe(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(Pe(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(Pe(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(Pe(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(Pe(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(Pe(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(Pe(this.screenElement,"mousemove",o=>this.updateCursorStyle(o))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let s=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",Hp.get()),WE||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",()=>s.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(mL,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(In,this._coreBrowserService),this._register(Pe(this.textarea,"focus",o=>this._handleTextAreaFocus(o))),this._register(Pe(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(dg,this._document,this._helperContainer),this._instantiationService.setService(jd,this._charSizeService),this._themeService=this._instantiationService.createInstance(pg),this._instantiationService.setService(Eo,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(Sd),this._instantiationService.setService(EE,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(fg,this.rows,this.screenElement)),this._instantiationService.setService(Un,this._renderService),this._register(this._renderService.onRenderedViewportChange(o=>this._onRender.fire(o))),this.onResize(o=>this._renderService.resize(o.cols,o.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(lg,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(hg),this._instantiationService.setService(o0,this._mouseService);let r=this._linkifier.value=this._register(this._instantiationService.createInstance(wg,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(ag,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(o=>{super.scrollLines(o,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(mg,this.element,this.screenElement,r)),this._instantiationService.setService(U7,this._selectionService),this._register(this._selectionService.onRequestScrollLines(o=>this.scrollLines(o.amount,o.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(o=>this._renderService.handleSelectionChanged(o.start,o.end,o.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(o=>{this.textarea.value=o,this.textarea.focus(),this.textarea.select()})),this._register(wi.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(og,this.screenElement)),this._register(Pe(this.element,"mousedown",o=>this._selectionService.handleMouseDown(o))),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(Cd,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",o=>this._handleScreenReaderModeOptionChange(o))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(xd,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",o=>{!this._overviewRulerRenderer&&o&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(xd,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(ug,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function s(l){let d=e._mouseService.getMouseReportCoords(l,e.screenElement);if(!d)return!1;let f,m;switch(l.overrideType||l.type){case"mousemove":m=32,l.buttons===void 0?(f=3,l.button!==void 0&&(f=l.button<3?l.button:3)):f=l.buttons&1?0:l.buttons&4?1:l.buttons&2?2:3;break;case"mouseup":m=0,f=l.button<3?l.button:3;break;case"mousedown":m=1,f=l.button<3?l.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(l)===!1)return!1;let h=l.deltaY;if(h===0||e.coreMouseService.consumeWheelEvent(l,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;m=h<0?0:1,f=4;break;default:return!1}return m===void 0||f===void 0||f>4?!1:e.coreMouseService.triggerMouseEvent({col:d.col,row:d.row,x:d.x,y:d.y,button:f,action:m,ctrl:l.ctrlKey,alt:l.altKey,shift:l.shiftKey})}let r={mouseup:null,wheel:null,mousedrag:null,mousemove:null},o={mouseup:l=>(s(l),l.buttons||(this._document.removeEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.removeEventListener("mousemove",r.mousedrag)),this.cancel(l)),wheel:l=>(s(l),this.cancel(l,!0)),mousedrag:l=>{l.buttons&&s(l)},mousemove:l=>{l.buttons||s(l)}};this._register(this.coreMouseService.onProtocolChange(l=>{l?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(l)),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()),l&8?r.mousemove||(t.addEventListener("mousemove",o.mousemove),r.mousemove=o.mousemove):(t.removeEventListener("mousemove",r.mousemove),r.mousemove=null),l&16?r.wheel||(t.addEventListener("wheel",o.wheel,{passive:!1}),r.wheel=o.wheel):(t.removeEventListener("wheel",r.wheel),r.wheel=null),l&2?r.mouseup||(r.mouseup=o.mouseup):(this._document.removeEventListener("mouseup",r.mouseup),r.mouseup=null),l&4?r.mousedrag||(r.mousedrag=o.mousedrag):(this._document.removeEventListener("mousemove",r.mousedrag),r.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Pe(t,"mousedown",l=>{if(l.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(l)))return s(l),r.mouseup&&this._document.addEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.addEventListener("mousemove",r.mousedrag),this.cancel(l)})),this._register(Pe(t,"wheel",l=>{if(!r.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(l)===!1)return!1;if(!this.buffer.hasScrollback){if(l.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(l,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(l,!0);let d=oe.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(l.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(d,!0),this.cancel(l,!0)}}},{passive:!1}))}refresh(e,t){this._renderService?.refreshRows(e,t)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){pE(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,s){this._selectionService.setSelection(e,t,s)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,t){this._selectionService?.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let s=y9(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),s.type===3||s.type===2){let r=this.rows-1;return this.scrollLines(s.type===2?-r:r),this.cancel(e,!0)}if(s.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(s.cancel&&this.cancel(e,!0),!s.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((s.key===oe.ETX||s.key===oe.CR)&&(this.textarea.value=""),this._onKey.fire({key:s.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(s.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let s=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return t.type==="keypress"?s:s&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(T9(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){this._charSizeService?.measure()}clear(){if(!(this.buffer.ybase===0&&this.buffer.y===0)){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(Qt));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(oe.ESC+"[I"):this.coreService.triggerDataEvent(oe.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),s=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${oe.ESC}[4;${s};${t}t`);break;case 1:let r=this._renderService.dimensions.css.cell.width.toFixed(0),o=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${oe.ESC}[6;${o};${r}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function T9(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var M9=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let s={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(s),t.dispose=()=>this._wrappedAddonDispose(s),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let s=0;s<this._addons.length;s++)if(this._addons[s]===e){t=s;break}if(t===-1)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},A9=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new Ns)}translateToString(e,t,s){return this._line.translateToString(e,t,s)}},Bx=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){let t=this._buffer.lines.get(e);if(t)return new A9(t)}getNullCell(){return new Ns}},R9=class extends Ke{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new he),this.onBufferChange=this._onBufferChange.event,this._normal=new Bx(this._core.buffers.normal,"normal"),this._alternate=new Bx(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)}},D9=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,s=>t(s.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(s,r)=>t(s,r.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},O9=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}},L9=["cols","rows"],$s=0,j9=class extends Ke{constructor(e){super(),this._core=this._register(new k9(e)),this._addonManager=this._register(new M9),this._publicOptions={...this._core.options};let t=r=>this._core.options[r],s=(r,o)=>{this._checkReadonlyOptions(r),this._core.options[r]=o};for(let r in this._core.options){let o={get:t.bind(this,r),set:s.bind(this,r)};Object.defineProperty(this._publicOptions,r,o)}}_checkReadonlyOptions(e){if(L9.includes(e))throw new Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new D9(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new O9(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 R9(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,s){this._verifyIntegers(e,t,s),this._core.select(e,t,s)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
|
|
34
|
-
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return Hp.get()},set promptLabel(e){Hp.set(e)},get tooMuchOutput(){return Fp.get()},set tooMuchOutput(e){Fp.set(e)}}}_verifyIntegers(...e){for($s of e)if($s===1/0||isNaN($s)||$s%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for($s of e)if($s&&($s===1/0||isNaN($s)||$s%1!==0||$s<0))throw new Error("This API only accepts positive integers")}};function B9({sessionId:e,active:t}){const s=E.useRef(null),r=E.useRef(null),o=E.useRef(null),l=E.useRef(null),[d,f]=E.useState("Local workspace"),[m,h]=E.useState("connecting"),[_,v]=E.useState("Opening shell"),b=E.useCallback(()=>{const x=l.current,w=o.current;if(!x||x.readyState!==WebSocket.OPEN||!w)return;w.fit();const N=w.proposeDimensions();N&&x.send(JSON.stringify({cols:N.cols,rows:N.rows,type:"resize"}))},[]);E.useEffect(()=>{if(!s.current)return;const x=new j9({allowProposedApi:!0,cursorBlink:!0,fontFamily:'"SF Mono", "JetBrains Mono", ui-monospace, Menlo, monospace',fontSize:12,lineHeight:1.25,scrollback:4e3,theme:{background:"#090909",black:"#090909",blue:"#69a7ff",brightBlack:"#5f6368",brightBlue:"#8ab4f8",brightCyan:"#7ddfd7",brightGreen:"#8fdc8a",brightMagenta:"#d7a2ff",brightRed:"#ff8a80",brightWhite:"#ffffff",brightYellow:"#ffd166",cyan:"#62d0c8",foreground:"#f2f2f2",green:"#7ac77f",magenta:"#c792ea",red:"#ff6b6b",selectionBackground:"#ffffff33",white:"#e8eaed",yellow:"#f7c948"}}),w=new N7;x.loadAddon(w),x.open(s.current),r.current=x,o.current=w;const N=new WebSocket(z9(e));l.current=N;const A=x.onData(R=>{N.readyState===WebSocket.OPEN&&N.send(JSON.stringify({data:R,type:"input"}))});return N.addEventListener("open",()=>{h("running"),v("Shell connected"),b()}),N.addEventListener("message",R=>{const T=P9(R.data);if(T){if(T.type==="output"){x.write(T.data);return}if(T.type==="error"){h("error"),v(T.error);return}h(T.state==="idle"?"connecting":T.state),T.cwd&&f(T.cwd),v(T.error??T.shell??"Shell connected")}}),N.addEventListener("close",()=>{h(R=>R==="exited"?R:"exited"),v("Socket closed")}),N.addEventListener("error",()=>{h("error"),v("Terminal socket error")}),window.addEventListener("resize",b),window.setTimeout(b,0),()=>{window.removeEventListener("resize",b),A.dispose(),N.close(),x.dispose(),l.current=null,r.current=null,o.current=null}},[e,b]),E.useEffect(()=>{if(!t)return;const x=window.setTimeout(()=>{b(),r.current?.focus()},0);return()=>window.clearTimeout(x)},[t,b]);const y=E.useCallback(x=>{const w=l.current;if(!w||w.readyState!==WebSocket.OPEN)return;const N=o.current?.proposeDimensions();w.send(JSON.stringify({cols:N?.cols,rows:N?.rows,...x}))},[]);return u.jsxs("section",{className:pe("flex h-full min-h-0 flex-col bg-[#090909] text-white",!t&&"hidden"),children:[u.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-between gap-3 border-b border-white/10 bg-[#111111] px-4 py-2",children:[u.jsx("div",{className:"min-w-0",children:u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(Ve,{className:pe("border-white/15 bg-white/10 text-white shadow-none",m==="running"&&"border-emerald-400/35 text-emerald-200",m==="error"&&"border-red-400/35 text-red-200"),variant:"outline",children:m}),u.jsxs("span",{className:"truncate font-mono text-[11px] text-white/55",children:[d," · ",_]})]})}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs(fe,{"aria-label":"Restart terminal",className:"border-white/15 bg-white/5 text-white hover:bg-white/10",size:"sm",variant:"outline",onClick:()=>y({type:"restart"}),type:"button",children:[u.jsx($S,{}),"Restart"]}),u.jsxs(fe,{"aria-label":"Stop terminal",className:"border-white/15 bg-white/5 text-white hover:bg-white/10",size:"sm",variant:"outline",onClick:()=>y({type:"stop"}),type:"button",children:[u.jsx(kd,{}),"Stop"]})]})]}),u.jsx("div",{"aria-label":"terminal viewport",className:"min-h-0 flex-1 overflow-hidden p-3",ref:s})]})}function z9(e){const t=window.location.protocol==="https:"?"wss:":"ws:",s=encodeURIComponent(e);return`${t}//${window.location.host}/api/terminal/socket?id=${s}`}function P9(e){if(typeof e!="string")return null;try{const t=JSON.parse(e);return typeof t?.type=="string"?t:null}catch{return null}}function I9(){const[e,t]=E.useState([]),[s,r]=E.useState(null),[o,l]=E.useState(!1);E.useEffect(()=>{let m=!1;return(async()=>{let h=await pT().catch(()=>[]);if(h.length===0){const _=await Gf().catch(()=>null);h=_?[_]:[]}m||(t(h),r(h[0]?.id??null))})(),()=>{m=!0}},[]);const d=E.useCallback(async()=>{l(!0);try{const m=await Gf();t(h=>[...h,m]),r(m.id)}finally{l(!1)}},[]),f=E.useCallback(async m=>{l(!0);try{await gT(m);const h=e.findIndex(v=>v.id===m),_=e.filter(v=>v.id!==m);if(_.length===0){const v=await Gf();t([v]),r(v.id);return}if(t(_),s===m){const v=_[Math.min(h,_.length-1)];r(v.id)}}finally{l(!1)}},[e,s]);return u.jsxs("section",{className:"flex h-full min-h-0 flex-col bg-[#090909] text-white",children:[u.jsxs("div",{"aria-label":"Terminal tabs",className:"flex shrink-0 items-center gap-1 overflow-x-auto border-b border-white/10 bg-[#111111] px-2 py-1.5",role:"tablist",children:[e.map((m,h)=>u.jsxs("div",{className:pe("group flex items-center gap-1 rounded-md border border-transparent px-2 py-1 text-xs",m.id===s?"border-white/15 bg-white/10 text-white":"text-white/60 hover:bg-white/5"),children:[u.jsxs("button",{"aria-selected":m.id===s,className:"max-w-[160px] truncate font-medium",onClick:()=>r(m.id),role:"tab",type:"button",children:["Terminal ",h+1]}),u.jsx("button",{"aria-label":`Close Terminal ${h+1}`,className:"rounded p-0.5 text-white/40 opacity-0 transition hover:bg-white/10 hover:text-white group-hover:opacity-100",disabled:o,onClick:()=>{f(m.id)},type:"button",children:u.jsx(rn,{className:"size-3"})})]},m.id)),u.jsx("button",{"aria-label":"New terminal",className:"ml-1 rounded-md p-1 text-white/60 transition hover:bg-white/10 hover:text-white disabled:opacity-40",disabled:o,onClick:()=>{d()},type:"button",children:u.jsx(Es,{className:"size-4"})})]}),u.jsx("div",{className:"relative min-h-0 flex-1",children:e.length===0?u.jsx("div",{className:"flex h-full items-center justify-center font-mono text-[11px] text-white/40",children:"Starting terminal…"}):e.map(m=>u.jsx("div",{className:"absolute inset-0",children:u.jsx(B9,{active:m.id===s,sessionId:m.id})},m.id))})]})}const U9=800;function nC({activeHunkIndex:e=0,diff:t}){const s=F9(t),r=E.useRef([]),[o,l]=E.useState(!1),d=E.useMemo(()=>s.reduce((m,h)=>Math.max(m,h.content.length),0),[s]),f=d>U9;if(E.useEffect(()=>{l(!1)},[t]),E.useEffect(()=>{if(f&&!o)return;r.current[e]?.scrollIntoView({block:"start",behavior:"smooth"})},[e,t,f,o]),f&&!o){const m=s.filter(_=>_.kind==="add").length,h=s.filter(_=>_.kind==="delete").length;return u.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-white p-6",children:u.jsxs("div",{className:"max-w-sm space-y-3 text-center",children:[u.jsx("p",{className:"text-[13px] font-medium text-foreground",children:"Diff hidden for this data file"}),u.jsxs("p",{className:"text-[12px] text-muted-foreground",children:["Rows run up to ",d.toLocaleString()," characters, so this looks like a CSV, log, or other data dump rather than source code."]}),u.jsxs("p",{className:"font-mono text-[11px]",children:[u.jsxs("span",{className:"text-emerald-700",children:["+",m]})," ",u.jsxs("span",{className:"text-red-700",children:["-",h]})," lines changed"]}),u.jsx(fe,{onClick:()=>l(!0),size:"sm",type:"button",variant:"outline",children:"Show diff anyway"})]})})}return u.jsx("div",{className:"absolute inset-0 overflow-auto bg-white text-xs leading-6",children:u.jsx("div",{className:"min-w-full font-mono",children:s.map((m,h)=>u.jsxs("div",{className:pe("grid grid-cols-[3rem_3rem_minmax(0,1fr)]",m.kind==="add"&&"bg-emerald-50 text-emerald-800",m.kind==="delete"&&"bg-red-50 text-red-800",zx(s,h)&&m.hunkIndex===e&&"outline outline-1 outline-offset-[-1px] outline-primary/35"),ref:m.hunkIndex!==null&&zx(s,h)?_=>{r.current[m.hunkIndex??0]=_}:void 0,children:[u.jsx(Px,{value:m.oldLine}),u.jsx(Px,{value:m.newLine}),u.jsx("span",{className:"min-w-0 whitespace-pre-wrap break-all px-2",children:m.content||" "})]},`${h}-${m.content}`))})})}function H9(e){return e.split(`
|
|
35
|
-
`).reduce((t,s)=>(s.startsWith("@@")?t.hunks+=1:s.startsWith("+")&&!s.startsWith("+++")?t.additions+=1:s.startsWith("-")&&!s.startsWith("---")&&(t.deletions+=1),t),{additions:0,deletions:0,hunks:0})}function F9(e){const t=V9(e);return t.some(s=>s.kind==="hunk")?t.filter(s=>s.kind!=="meta"&&s.kind!=="hunk"):t}function V9(e){let t=null,s=null,r=null;return e.split(`
|
|
36
|
-
`).map(o=>{if($9(o))return t=null,s=null,r=null,{content:o,hunkIndex:r,kind:"meta",oldLine:null,newLine:null};if(o.startsWith("@@")){const d=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(o);return d&&(t=Number(d[1]),s=Number(d[2])),r=(r??-1)+1,{content:o,hunkIndex:r,kind:"hunk",oldLine:null,newLine:null}}if(t===null||s===null)return{content:o,hunkIndex:null,kind:"meta",oldLine:null,newLine:null};if(o.startsWith("\\ No newline"))return{content:o,hunkIndex:r,kind:"meta",oldLine:null,newLine:null};if(o.startsWith("+")&&!o.startsWith("+++")){const d={content:o,hunkIndex:r,kind:"add",oldLine:null,newLine:s};return s+=1,d}if(o.startsWith("-")&&!o.startsWith("---")){const d={content:o,hunkIndex:r,kind:"delete",oldLine:t,newLine:null};return t+=1,d}const l={content:o,hunkIndex:r,kind:"context",oldLine:t,newLine:s};return t+=1,s+=1,l})}function zx(e,t){const s=e[t]?.hunkIndex;if(s===null)return!1;const r=e.findIndex(o=>o.hunkIndex===s&&(o.kind==="add"||o.kind==="delete"));return r!==-1?r===t:e.findIndex(o=>o.hunkIndex===s)===t}function $9(e){return e.startsWith("diff --git ")||e.startsWith("index ")||e.startsWith("--- ")||e.startsWith("+++ ")||e.startsWith("new file mode ")||e.startsWith("deleted file mode ")||e.startsWith("old mode ")||e.startsWith("new mode ")||e.startsWith("similarity index ")||e.startsWith("rename from ")||e.startsWith("rename to ")||e.startsWith("Binary files ")}function Px({value:e}){return u.jsx("span",{className:pe("select-none border-r border-border/70 px-2 text-right text-muted-foreground",e===null&&"text-transparent"),children:e??"-"})}function q9({branch:e,error:t,files:s,selectedFile:r,onSelectFile:o,root:l}){const d=E.useMemo(()=>Y9(s).filter(h=>h.files.length),[s]),[f,m]=E.useState({staged:!1,unstaged:!1,untracked:!1});return u.jsxs(Js,{className:"flex min-h-0 flex-1 flex-col overflow-hidden rounded-none border-0 bg-transparent",children:[u.jsx(en,{className:"border-b border-border px-2.5 py-1.5",children:u.jsxs(tn,{className:"flex items-center justify-between gap-2",children:[u.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[u.jsx(Yl,{className:"size-3.5"}),u.jsx("span",{className:"truncate",children:"Changes"})]}),u.jsxs("span",{className:"flex shrink-0 items-center gap-1.5",children:[e?u.jsx(Ve,{variant:"outline",children:e}):null,u.jsx(Ve,{variant:"secondary",children:s.length})]})]})}),u.jsx(sn,{className:"min-h-0 flex-1 overflow-auto p-0",children:d.length?d.map(h=>u.jsx(K9,{collapsed:f[h.id],group:h,onSelectFile:o,onToggle:()=>m(_=>({..._,[h.id]:!_[h.id]})),root:l,selectedFile:r},h.id)):u.jsx(ht,{variant:"muted",className:"m-3 text-center",children:t??"No changed files."})})]})}function K9({collapsed:e,group:t,onSelectFile:s,onToggle:r,root:o,selectedFile:l}){const d=e?ga:Pn;return u.jsxs("section",{className:"border-b border-border last:border-b-0",children:[u.jsxs("button",{className:"flex w-full items-center justify-between gap-2 bg-muted/55 px-2.5 py-1 text-left text-[10px] font-semibold uppercase text-muted-foreground hover:bg-muted",onClick:r,type:"button",children:[u.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[u.jsx(d,{className:"size-3.5"}),u.jsx("span",{className:"truncate",children:t.label})]}),u.jsx(Ve,{className:"min-w-6 justify-center font-mono shadow-none",size:"small",variant:"outline",children:t.files.length})]}),e?null:u.jsx("div",{children:t.files.map(f=>u.jsx(G9,{active:l===f.path,file:f,group:t.id,onClick:()=>s(f.path),root:o},f.path))})]})}function G9({active:e,file:t,group:s,onClick:r,root:o}){const l=t.path.split("/").pop()||t.path,d=t.path.split("/").slice(0,-1).join("/"),f=o?nE(iE(o,t.path)):{};return u.jsxs(fe,{className:pe("grid h-auto w-full grid-cols-[1fr_auto] items-center gap-2 rounded-none border-b border-border px-2.5 py-1.5 text-left",e&&"bg-muted"),onClick:r,type:"button",variant:"ghost",...f,children:[u.jsxs("span",{className:"min-w-0",children:[u.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[u.jsx(i0,{path:t.path}),u.jsx("span",{className:"truncate text-[13px] font-medium",children:l})]}),d?u.jsx("span",{className:"block truncate pl-5 text-[10px] text-muted-foreground",children:d}):null]}),u.jsx("span",{className:pe("w-3.5 shrink-0 text-center font-mono text-[11px] font-semibold",s==="untracked"&&"text-amber-700",s==="staged"&&"text-emerald-700",s==="unstaged"&&"text-zinc-800"),children:W9(t,s)})]})}function W9(e,t){return t==="untracked"?"?":t==="staged"?e.index.trim():e.workingTree.trim()}function Y9(e){return[{id:"unstaged",label:"Changes",files:e.filter(t=>!(t.index==="?"&&t.workingTree==="?")&&t.workingTree.trim())},{id:"staged",label:"Staged Changes",files:e.filter(t=>!(t.index==="?"&&t.workingTree==="?")&&t.index.trim()&&!t.workingTree.trim())},{id:"untracked",label:"Untracked Files",files:e.filter(t=>t.index==="?"&&t.workingTree==="?")}]}function X9(e){const t={name:"",path:"",children:[],isFile:!1},s=new Map;s.set("",t);const r=[...e].sort();for(const l of r){const d=l.split("/");let f="";for(let m=0;m<d.length;m+=1){const h=d[m],_=m===d.length-1,v=f?`${f}/${h}`:h;let b=s.get(v);b||(b={name:h,path:v,children:[],isFile:_},s.set(v,b),s.get(f).children.push(b)),f=v}}const o=l=>{l.children.sort((d,f)=>d.isFile!==f.isFile?d.isFile?1:-1:d.name.localeCompare(f.name)),l.children.forEach(o)};return o(t),t}function Z9({paths:e,status:t,selectedFile:s,onSelectFile:r,branch:o,root:l}){const d=E.useMemo(()=>X9(e),[e]),f=E.useMemo(()=>{const y=new Map;for(const x of t)y.set(x.path,x);return y},[t]),[m,h]=E.useState({"":!0}),[_,v]=E.useState(!1);E.useEffect(()=>{if(_||d.children.length===0)return;const y={"":!0};for(const x of d.children)x.isFile||(y[x.path]=!0);h(y),v(!0)},[_,d.children]);function b(y){h(x=>({...x,[y]:!x[y]}))}return u.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[u.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border bg-card/95 px-2.5 py-1.5",children:[u.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 text-[12px] font-semibold tracking-tight",children:[u.jsx(_a,{className:"size-3.5"}),u.jsx("span",{className:"truncate",children:"Files"})]}),u.jsxs("span",{className:"flex shrink-0 items-center gap-1.5",children:[o?u.jsx(Ve,{variant:"outline",children:o}):null,u.jsx(Ve,{variant:"secondary",children:e.length})]})]}),u.jsx("div",{className:"min-h-0 flex-1 overflow-auto py-1",children:d.children.length===0?u.jsx(ht,{variant:"muted",className:"m-3 text-center",children:"No tracked files."}):d.children.map(y=>u.jsx(rC,{depth:0,expanded:m,node:y,onSelectFile:r,onToggle:b,root:l,selectedFile:s,statusByPath:f},y.path))})]})}function rC({depth:e,expanded:t,node:s,onSelectFile:r,onToggle:o,root:l,selectedFile:d,statusByPath:f}){const m=t[s.path]??!1,h=6+e*12,_=l?nE(iE(l,s.path)):{};if(s.isFile){const y=f.get(s.path),x=d===s.path;return u.jsxs("button",{className:pe("flex w-full items-center gap-1.5 px-1 py-0.5 text-left text-[12px] hover:bg-muted",x&&"bg-muted font-medium"),onClick:()=>r(s.path),style:{paddingLeft:h},type:"button",..._,children:[u.jsx(i0,{path:s.path}),u.jsx("span",{className:"min-w-0 flex-1 truncate",children:s.name}),y?u.jsx(Q9,{file:y}):null]})}const v=m?Pn:ga,b=m?Nd:_a;return u.jsxs("div",{children:[u.jsxs("button",{className:"flex w-full items-center gap-1 py-0.5 text-left text-[12px] font-medium hover:bg-muted",onClick:()=>o(s.path),style:{paddingLeft:h},type:"button",..._,children:[u.jsx(v,{className:"size-3.5 shrink-0 text-muted-foreground"}),u.jsx(b,{className:"size-3.5 shrink-0 text-amber-600"}),u.jsx("span",{className:"min-w-0 flex-1 truncate",children:s.name})]}),m?s.children.map(y=>u.jsx(rC,{depth:e+1,expanded:t,node:y,onSelectFile:r,onToggle:o,root:l,selectedFile:d,statusByPath:f},y.path)):null]})}function Q9({file:e}){const t=e.workingTree.trim()||e.index.trim();if(!t)return null;const s=e.index.trim()&&!e.workingTree.trim()?"text-emerald-700":t==="?"?"text-amber-700":"text-zinc-700";return u.jsx("span",{className:pe("ml-1 shrink-0 font-mono text-[10px] font-semibold",s),children:t})}var Tm,Ix;function J9(){if(Ix)return Tm;Ix=1;function e(B){return B instanceof Map?B.clear=B.delete=B.set=function(){throw new Error("map is read-only")}:B instanceof Set&&(B.add=B.clear=B.delete=function(){throw new Error("set is read-only")}),Object.freeze(B),Object.getOwnPropertyNames(B).forEach(ne=>{const _e=B[ne],ze=typeof _e;(ze==="object"||ze==="function")&&!Object.isFrozen(_e)&&e(_e)}),B}class t{constructor(ne){ne.data===void 0&&(ne.data={}),this.data=ne.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function s(B){return B.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function r(B,...ne){const _e=Object.create(null);for(const ze in B)_e[ze]=B[ze];return ne.forEach(function(ze){for(const St in ze)_e[St]=ze[St]}),_e}const o="</span>",l=B=>!!B.scope,d=(B,{prefix:ne})=>{if(B.startsWith("language:"))return B.replace("language:","language-");if(B.includes(".")){const _e=B.split(".");return[`${ne}${_e.shift()}`,..._e.map((ze,St)=>`${ze}${"_".repeat(St+1)}`)].join(" ")}return`${ne}${B}`};class f{constructor(ne,_e){this.buffer="",this.classPrefix=_e.classPrefix,ne.walk(this)}addText(ne){this.buffer+=s(ne)}openNode(ne){if(!l(ne))return;const _e=d(ne.scope,{prefix:this.classPrefix});this.span(_e)}closeNode(ne){l(ne)&&(this.buffer+=o)}value(){return this.buffer}span(ne){this.buffer+=`<span class="${ne}">`}}const m=(B={})=>{const ne={children:[]};return Object.assign(ne,B),ne};class h{constructor(){this.rootNode=m(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(ne){this.top.children.push(ne)}openNode(ne){const _e=m({scope:ne});this.add(_e),this.stack.push(_e)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(ne){return this.constructor._walk(ne,this.rootNode)}static _walk(ne,_e){return typeof _e=="string"?ne.addText(_e):_e.children&&(ne.openNode(_e),_e.children.forEach(ze=>this._walk(ne,ze)),ne.closeNode(_e)),ne}static _collapse(ne){typeof ne!="string"&&ne.children&&(ne.children.every(_e=>typeof _e=="string")?ne.children=[ne.children.join("")]:ne.children.forEach(_e=>{h._collapse(_e)}))}}class _ extends h{constructor(ne){super(),this.options=ne}addText(ne){ne!==""&&this.add(ne)}startScope(ne){this.openNode(ne)}endScope(){this.closeNode()}__addSublanguage(ne,_e){const ze=ne.root;_e&&(ze.scope=`language:${_e}`),this.add(ze)}toHTML(){return new f(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function v(B){return B?typeof B=="string"?B:B.source:null}function b(B){return w("(?=",B,")")}function y(B){return w("(?:",B,")*")}function x(B){return w("(?:",B,")?")}function w(...B){return B.map(_e=>v(_e)).join("")}function N(B){const ne=B[B.length-1];return typeof ne=="object"&&ne.constructor===Object?(B.splice(B.length-1,1),ne):{}}function A(...B){return"("+(N(B).capture?"":"?:")+B.map(ze=>v(ze)).join("|")+")"}function R(B){return new RegExp(B.toString()+"|").exec("").length-1}function T(B,ne){const _e=B&&B.exec(ne);return _e&&_e.index===0}const M=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function z(B,{joinWith:ne}){let _e=0;return B.map(ze=>{_e+=1;const St=_e;let _t=v(ze),ke="";for(;_t.length>0;){const ye=M.exec(_t);if(!ye){ke+=_t;break}ke+=_t.substring(0,ye.index),_t=_t.substring(ye.index+ye[0].length),ye[0][0]==="\\"&&ye[1]?ke+="\\"+String(Number(ye[1])+St):(ke+=ye[0],ye[0]==="("&&_e++)}return ke}).map(ze=>`(${ze})`).join(ne)}const U=/\b\B/,j="[a-zA-Z]\\w*",O="[a-zA-Z_]\\w*",K="\\b\\d+(\\.\\d+)?",H="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",G="\\b(0b[01]+)",J="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",I=(B={})=>{const ne=/^#![ ]*\//;return B.binary&&(B.begin=w(ne,/.*\b/,B.binary,/\b.*/)),r({scope:"meta",begin:ne,end:/$/,relevance:0,"on:begin":(_e,ze)=>{_e.index!==0&&ze.ignoreMatch()}},B)},ee={begin:"\\\\[\\s\\S]",relevance:0},q={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ee]},k={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ee]},F={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},V=function(B,ne,_e={}){const ze=r({scope:"comment",begin:B,end:ne,contains:[]},_e);ze.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const St=A("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return ze.contains.push({begin:w(/[ ]+/,"(",St,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),ze},Z=V("//","$"),W=V("/\\*","\\*/"),D=V("#","$"),ie={scope:"number",begin:K,relevance:0},ce={scope:"number",begin:H,relevance:0},le={scope:"number",begin:G,relevance:0},de={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[ee,{begin:/\[/,end:/\]/,relevance:0,contains:[ee]}]},ge={scope:"title",begin:j,relevance:0},Se={scope:"title",begin:O,relevance:0},Be={begin:"\\.\\s*"+O,relevance:0};var it=Object.freeze({__proto__:null,APOS_STRING_MODE:q,BACKSLASH_ESCAPE:ee,BINARY_NUMBER_MODE:le,BINARY_NUMBER_RE:G,COMMENT:V,C_BLOCK_COMMENT_MODE:W,C_LINE_COMMENT_MODE:Z,C_NUMBER_MODE:ce,C_NUMBER_RE:H,END_SAME_AS_BEGIN:function(B){return Object.assign(B,{"on:begin":(ne,_e)=>{_e.data._beginMatch=ne[1]},"on:end":(ne,_e)=>{_e.data._beginMatch!==ne[1]&&_e.ignoreMatch()}})},HASH_COMMENT_MODE:D,IDENT_RE:j,MATCH_NOTHING_RE:U,METHOD_GUARD:Be,NUMBER_MODE:ie,NUMBER_RE:K,PHRASAL_WORDS_MODE:F,QUOTE_STRING_MODE:k,REGEXP_MODE:de,RE_STARTERS_RE:J,SHEBANG:I,TITLE_MODE:ge,UNDERSCORE_IDENT_RE:O,UNDERSCORE_TITLE_MODE:Se});function rt(B,ne){B.input[B.index-1]==="."&&ne.ignoreMatch()}function at(B,ne){B.className!==void 0&&(B.scope=B.className,delete B.className)}function je(B,ne){ne&&B.beginKeywords&&(B.begin="\\b("+B.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",B.__beforeBegin=rt,B.keywords=B.keywords||B.beginKeywords,delete B.beginKeywords,B.relevance===void 0&&(B.relevance=0))}function It(B,ne){Array.isArray(B.illegal)&&(B.illegal=A(...B.illegal))}function Or(B,ne){if(B.match){if(B.begin||B.end)throw new Error("begin & end are not supported with match");B.begin=B.match,delete B.match}}function an(B,ne){B.relevance===void 0&&(B.relevance=1)}const ya=(B,ne)=>{if(!B.beforeMatch)return;if(B.starts)throw new Error("beforeMatch cannot be used with starts");const _e=Object.assign({},B);Object.keys(B).forEach(ze=>{delete B[ze]}),B.keywords=_e.keywords,B.begin=w(_e.beforeMatch,b(_e.begin)),B.starts={relevance:0,contains:[Object.assign(_e,{endsParent:!0})]},B.relevance=0,delete _e.beforeMatch},Lr=["of","and","for","in","not","or","if","then","parent","list","value"],jr="keyword";function Hn(B,ne,_e=jr){const ze=Object.create(null);return typeof B=="string"?St(_e,B.split(" ")):Array.isArray(B)?St(_e,B):Object.keys(B).forEach(function(_t){Object.assign(ze,Hn(B[_t],ne,_t))}),ze;function St(_t,ke){ne&&(ke=ke.map(ye=>ye.toLowerCase())),ke.forEach(function(ye){const Le=ye.split("|");ze[Le[0]]=[_t,on(Le[0],Le[1])]})}}function on(B,ne){return ne?Number(ne):No(B)?0:1}function No(B){return Lr.includes(B.toLowerCase())}const xa={},At=B=>{console.error(B)},ln=(B,...ne)=>{console.log(`WARN: ${B}`,...ne)},pi=(B,ne)=>{xa[`${B}/${ne}`]||(console.log(`Deprecated as of ${B}. ${ne}`),xa[`${B}/${ne}`]=!0)},cn=new Error;function un(B,ne,{key:_e}){let ze=0;const St=B[_e],_t={},ke={};for(let ye=1;ye<=ne.length;ye++)ke[ye+ze]=St[ye],_t[ye+ze]=!0,ze+=R(ne[ye-1]);B[_e]=ke,B[_e]._emit=_t,B[_e]._multi=!0}function Sa(B){if(Array.isArray(B.begin)){if(B.skip||B.excludeBegin||B.returnBegin)throw At("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),cn;if(typeof B.beginScope!="object"||B.beginScope===null)throw At("beginScope must be object"),cn;un(B,B.begin,{key:"beginScope"}),B.begin=z(B.begin,{joinWith:""})}}function Fn(B){if(Array.isArray(B.end)){if(B.skip||B.excludeEnd||B.returnEnd)throw At("skip, excludeEnd, returnEnd not compatible with endScope: {}"),cn;if(typeof B.endScope!="object"||B.endScope===null)throw At("endScope must be object"),cn;un(B,B.end,{key:"endScope"}),B.end=z(B.end,{joinWith:""})}}function ko(B){B.scope&&typeof B.scope=="object"&&B.scope!==null&&(B.beginScope=B.scope,delete B.scope)}function wa(B){ko(B),typeof B.beginScope=="string"&&(B.beginScope={_wrap:B.beginScope}),typeof B.endScope=="string"&&(B.endScope={_wrap:B.endScope}),Sa(B),Fn(B)}function dn(B){function ne(ke,ye){return new RegExp(v(ke),"m"+(B.case_insensitive?"i":"")+(B.unicodeRegex?"u":"")+(ye?"g":""))}class _e{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(ye,Le){Le.position=this.position++,this.matchIndexes[this.matchAt]=Le,this.regexes.push([Le,ye]),this.matchAt+=R(ye)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const ye=this.regexes.map(Le=>Le[1]);this.matcherRe=ne(z(ye,{joinWith:"|"}),!0),this.lastIndex=0}exec(ye){this.matcherRe.lastIndex=this.lastIndex;const Le=this.matcherRe.exec(ye);if(!Le)return null;const Ut=Le.findIndex((hn,Ca)=>Ca>0&&hn!==void 0),kt=this.matchIndexes[Ut];return Le.splice(0,Ut),Object.assign(Le,kt)}}class ze{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(ye){if(this.multiRegexes[ye])return this.multiRegexes[ye];const Le=new _e;return this.rules.slice(ye).forEach(([Ut,kt])=>Le.addRule(Ut,kt)),Le.compile(),this.multiRegexes[ye]=Le,Le}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(ye,Le){this.rules.push([ye,Le]),Le.type==="begin"&&this.count++}exec(ye){const Le=this.getMatcher(this.regexIndex);Le.lastIndex=this.lastIndex;let Ut=Le.exec(ye);if(this.resumingScanAtSamePosition()&&!(Ut&&Ut.index===this.lastIndex)){const kt=this.getMatcher(0);kt.lastIndex=this.lastIndex+1,Ut=kt.exec(ye)}return Ut&&(this.regexIndex+=Ut.position+1,this.regexIndex===this.count&&this.considerAll()),Ut}}function St(ke){const ye=new ze;return ke.contains.forEach(Le=>ye.addRule(Le.begin,{rule:Le,type:"begin"})),ke.terminatorEnd&&ye.addRule(ke.terminatorEnd,{type:"end"}),ke.illegal&&ye.addRule(ke.illegal,{type:"illegal"}),ye}function _t(ke,ye){const Le=ke;if(ke.isCompiled)return Le;[at,Or,wa,ya].forEach(kt=>kt(ke,ye)),B.compilerExtensions.forEach(kt=>kt(ke,ye)),ke.__beforeBegin=null,[je,It,an].forEach(kt=>kt(ke,ye)),ke.isCompiled=!0;let Ut=null;return typeof ke.keywords=="object"&&ke.keywords.$pattern&&(ke.keywords=Object.assign({},ke.keywords),Ut=ke.keywords.$pattern,delete ke.keywords.$pattern),Ut=Ut||/\w+/,ke.keywords&&(ke.keywords=Hn(ke.keywords,B.case_insensitive)),Le.keywordPatternRe=ne(Ut,!0),ye&&(ke.begin||(ke.begin=/\B|\b/),Le.beginRe=ne(Le.begin),!ke.end&&!ke.endsWithParent&&(ke.end=/\B|\b/),ke.end&&(Le.endRe=ne(Le.end)),Le.terminatorEnd=v(Le.end)||"",ke.endsWithParent&&ye.terminatorEnd&&(Le.terminatorEnd+=(ke.end?"|":"")+ye.terminatorEnd)),ke.illegal&&(Le.illegalRe=ne(ke.illegal)),ke.contains||(ke.contains=[]),ke.contains=[].concat(...ke.contains.map(function(kt){return cs(kt==="self"?ke:kt)})),ke.contains.forEach(function(kt){_t(kt,Le)}),ke.starts&&_t(ke.starts,ye),Le.matcher=St(Le),Le}if(B.compilerExtensions||(B.compilerExtensions=[]),B.contains&&B.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return B.classNameAliases=r(B.classNameAliases||{}),_t(B)}function li(B){return B?B.endsWithParent||li(B.starts):!1}function cs(B){return B.variants&&!B.cachedVariants&&(B.cachedVariants=B.variants.map(function(ne){return r(B,{variants:null},ne)})),B.cachedVariants?B.cachedVariants:li(B)?r(B,{starts:B.starts?r(B.starts):null}):Object.isFrozen(B)?r(B):B}var gi="11.11.1";class To extends Error{constructor(ne,_e){super(ne),this.name="HTMLInjectionError",this.html=_e}}const Br=s,Ea=r,et=Symbol("nomatch"),As=7,Wi=function(B){const ne=Object.create(null),_e=Object.create(null),ze=[];let St=!0;const _t="Could not find the language '{}', did you forget to load/include a language module?",ke={disableAutodetect:!0,name:"Plain text",contains:[]};let ye={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:_};function Le(ue){return ye.noHighlightRe.test(ue)}function Ut(ue){let Ae=ue.className+" ";Ae+=ue.parentNode?ue.parentNode.className:"";const Ge=ye.languageDetectRe.exec(Ae);if(Ge){const lt=Ai(Ge[1]);return lt||(ln(_t.replace("{}",Ge[1])),ln("Falling back to no-highlight mode for this block.",ue)),lt?Ge[1]:"no-highlight"}return Ae.split(/\s+/).find(lt=>Le(lt)||Ai(lt))}function kt(ue,Ae,Ge){let lt="",Ft="";typeof Ae=="object"?(lt=ue,Ge=Ae.ignoreIllegals,Ft=Ae.language):(pi("10.7.0","highlight(lang, code, ...args) has been deprecated."),pi("10.7.0",`Please use highlight(code, options) instead.
|
|
37
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),Ft=ue,lt=Ae),Ge===void 0&&(Ge=!0);const ki={code:lt,language:Ft};Pr("before:highlight",ki);const Yi=ki.result?ki.result:hn(ki.language,ki.code,Ge);return Yi.code=ki.code,Pr("after:highlight",Yi),Yi}function hn(ue,Ae,Ge,lt){const Ft=Object.create(null);function ki(me,Te){return me.keywords[Te]}function Yi(){if(!Oe.keywords){Gt.addText(ct);return}let me=0;Oe.keywordPatternRe.lastIndex=0;let Te=Oe.keywordPatternRe.exec(ct),Ue="";for(;Te;){Ue+=ct.substring(me,Te.index);const Xe=_i.case_insensitive?Te[0].toLowerCase():Te[0],Rt=ki(Oe,Xe);if(Rt){const[us,Lo]=Rt;if(Gt.addText(Ue),Ue="",Ft[Xe]=(Ft[Xe]||0)+1,Ft[Xe]<=As&&(Kn+=Lo),us.startsWith("_"))Ue+=Te[0];else{const Ec=_i.classNameAliases[us]||us;Xi(Te[0],Ec)}}else Ue+=Te[0];me=Oe.keywordPatternRe.lastIndex,Te=Oe.keywordPatternRe.exec(ct)}Ue+=ct.substring(me),Gt.addText(Ue)}function zi(){if(ct==="")return;let me=null;if(typeof Oe.subLanguage=="string"){if(!ne[Oe.subLanguage]){Gt.addText(ct);return}me=hn(Oe.subLanguage,ct,!0,wc[Oe.subLanguage]),wc[Oe.subLanguage]=me._top}else me=Na(ct,Oe.subLanguage.length?Oe.subLanguage:null);Oe.relevance>0&&(Kn+=me.relevance),Gt.__addSublanguage(me._emitter,me.language)}function xt(){Oe.subLanguage!=null?zi():Yi(),ct=""}function Xi(me,Te){me!==""&&(Gt.startScope(Te),Gt.addText(me),Gt.endScope())}function xc(me,Te){let Ue=1;const Xe=Te.length-1;for(;Ue<=Xe;){if(!me._emit[Ue]){Ue++;continue}const Rt=_i.classNameAliases[me[Ue]]||me[Ue],us=Te[Ue];Rt?Xi(us,Rt):(ct=us,Yi(),ct=""),Ue++}}function Ta(me,Te){return me.scope&&typeof me.scope=="string"&&Gt.openNode(_i.classNameAliases[me.scope]||me.scope),me.beginScope&&(me.beginScope._wrap?(Xi(ct,_i.classNameAliases[me.beginScope._wrap]||me.beginScope._wrap),ct=""):me.beginScope._multi&&(xc(me.beginScope,Te),ct="")),Oe=Object.create(me,{parent:{value:Oe}}),Oe}function Ro(me,Te,Ue){let Xe=T(me.endRe,Ue);if(Xe){if(me["on:end"]){const Rt=new t(me);me["on:end"](Te,Rt),Rt.isMatchIgnored&&(Xe=!1)}if(Xe){for(;me.endsParent&&me.parent;)me=me.parent;return me}}if(me.endsWithParent)return Ro(me.parent,Te,Ue)}function Ma(me){return Oe.matcher.regexIndex===0?(ct+=me[0],1):(Gn=!0,0)}function Pd(me){const Te=me[0],Ue=me.rule,Xe=new t(Ue),Rt=[Ue.__beforeBegin,Ue["on:begin"]];for(const us of Rt)if(us&&(us(me,Xe),Xe.isMatchIgnored))return Ma(Te);return Ue.skip?ct+=Te:(Ue.excludeBegin&&(ct+=Te),xt(),!Ue.returnBegin&&!Ue.excludeBegin&&(ct=Te)),Ta(Ue,me),Ue.returnBegin?0:Te.length}function Pi(me){const Te=me[0],Ue=Ae.substring(me.index),Xe=Ro(Oe,me,Ue);if(!Xe)return et;const Rt=Oe;Oe.endScope&&Oe.endScope._wrap?(xt(),Xi(Te,Oe.endScope._wrap)):Oe.endScope&&Oe.endScope._multi?(xt(),xc(Oe.endScope,me)):Rt.skip?ct+=Te:(Rt.returnEnd||Rt.excludeEnd||(ct+=Te),xt(),Rt.excludeEnd&&(ct=Te));do Oe.scope&&Gt.closeNode(),!Oe.skip&&!Oe.subLanguage&&(Kn+=Oe.relevance),Oe=Oe.parent;while(Oe!==Xe.parent);return Xe.starts&&Ta(Xe.starts,me),Rt.returnEnd?0:Te.length}function Do(){const me=[];for(let Te=Oe;Te!==_i;Te=Te.parent)Te.scope&&me.unshift(Te.scope);me.forEach(Te=>Gt.openNode(Te))}let Ir={};function Aa(me,Te){const Ue=Te&&Te[0];if(ct+=me,Ue==null)return xt(),0;if(Ir.type==="begin"&&Te.type==="end"&&Ir.index===Te.index&&Ue===""){if(ct+=Ae.slice(Te.index,Te.index+1),!St){const Xe=new Error(`0 width match regex (${ue})`);throw Xe.languageName=ue,Xe.badRule=Ir.rule,Xe}return 1}if(Ir=Te,Te.type==="begin")return Pd(Te);if(Te.type==="illegal"&&!Ge){const Xe=new Error('Illegal lexeme "'+Ue+'" for mode "'+(Oe.scope||"<unnamed>")+'"');throw Xe.mode=Oe,Xe}else if(Te.type==="end"){const Xe=Pi(Te);if(Xe!==et)return Xe}if(Te.type==="illegal"&&Ue==="")return ct+=`
|
|
38
|
-
`,1;if(Oo>1e5&&Oo>Te.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ct+=Ue,Ue.length}const _i=Ai(ue);if(!_i)throw At(_t.replace("{}",ue)),new Error('Unknown language: "'+ue+'"');const Sc=dn(_i);let Ra="",Oe=lt||Sc;const wc={},Gt=new ye.__emitter(ye);Do();let ct="",Kn=0,pn=0,Oo=0,Gn=!1;try{if(_i.__emitTokens)_i.__emitTokens(Ae,Gt);else{for(Oe.matcher.considerAll();;){Oo++,Gn?Gn=!1:Oe.matcher.considerAll(),Oe.matcher.lastIndex=pn;const me=Oe.matcher.exec(Ae);if(!me)break;const Te=Ae.substring(pn,me.index),Ue=Aa(Te,me);pn=me.index+Ue}Aa(Ae.substring(pn))}return Gt.finalize(),Ra=Gt.toHTML(),{language:ue,value:Ra,relevance:Kn,illegal:!1,_emitter:Gt,_top:Oe}}catch(me){if(me.message&&me.message.includes("Illegal"))return{language:ue,value:Br(Ae),illegal:!0,relevance:0,_illegalBy:{message:me.message,index:pn,context:Ae.slice(pn-100,pn+100),mode:me.mode,resultSoFar:Ra},_emitter:Gt};if(St)return{language:ue,value:Br(Ae),illegal:!1,relevance:0,errorRaised:me,_emitter:Gt,_top:Oe};throw me}}function Ca(ue){const Ae={value:Br(ue),illegal:!1,relevance:0,_top:ke,_emitter:new ye.__emitter(ye)};return Ae._emitter.addText(ue),Ae}function Na(ue,Ae){Ae=Ae||ye.languages||Object.keys(ne);const Ge=Ca(ue),lt=Ae.filter(Ai).filter($n).map(xt=>hn(xt,ue,!1));lt.unshift(Ge);const Ft=lt.sort((xt,Xi)=>{if(xt.relevance!==Xi.relevance)return Xi.relevance-xt.relevance;if(xt.language&&Xi.language){if(Ai(xt.language).supersetOf===Xi.language)return 1;if(Ai(Xi.language).supersetOf===xt.language)return-1}return 0}),[ki,Yi]=Ft,zi=ki;return zi.secondBest=Yi,zi}function zs(ue,Ae,Ge){const lt=Ae&&_e[Ae]||Ge;ue.classList.add("hljs"),ue.classList.add(`language-${lt}`)}function Ht(ue){let Ae=null;const Ge=Ut(ue);if(Le(Ge))return;if(Pr("before:highlightElement",{el:ue,language:Ge}),ue.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",ue);return}if(ue.children.length>0&&(ye.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(ue)),ye.throwUnescapedHTML))throw new To("One of your code blocks includes unescaped HTML.",ue.innerHTML);Ae=ue;const lt=Ae.textContent,Ft=Ge?kt(lt,{language:Ge,ignoreIllegals:!0}):Na(lt);ue.innerHTML=Ft.value,ue.dataset.highlighted="yes",zs(ue,Ge,Ft.language),ue.result={language:Ft.language,re:Ft.relevance,relevance:Ft.relevance},Ft.secondBest&&(ue.secondBest={language:Ft.secondBest.language,relevance:Ft.secondBest.relevance}),Pr("after:highlightElement",{el:ue,result:Ft,text:lt})}function Ni(ue){ye=Ea(ye,ue)}const Vn=()=>{ka(),pi("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Mo(){ka(),pi("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let vc=!1;function ka(){function ue(){ka()}if(document.readyState==="loading"){vc||window.addEventListener("DOMContentLoaded",ue,!1),vc=!0;return}document.querySelectorAll(ye.cssSelector).forEach(Ht)}function bc(ue,Ae){let Ge=null;try{Ge=Ae(B)}catch(lt){if(At("Language definition for '{}' could not be registered.".replace("{}",ue)),St)At(lt);else throw lt;Ge=ke}Ge.name||(Ge.name=ue),ne[ue]=Ge,Ge.rawDefinition=Ae.bind(null,B),Ge.aliases&&fn(Ge.aliases,{languageName:ue})}function zr(ue){delete ne[ue];for(const Ae of Object.keys(_e))_e[Ae]===ue&&delete _e[Ae]}function Ao(){return Object.keys(ne)}function Ai(ue){return ue=(ue||"").toLowerCase(),ne[ue]||ne[_e[ue]]}function fn(ue,{languageName:Ae}){typeof ue=="string"&&(ue=[ue]),ue.forEach(Ge=>{_e[Ge.toLowerCase()]=Ae})}function $n(ue){const Ae=Ai(ue);return Ae&&!Ae.disableAutodetect}function qn(ue){ue["before:highlightBlock"]&&!ue["before:highlightElement"]&&(ue["before:highlightElement"]=Ae=>{ue["before:highlightBlock"](Object.assign({block:Ae.el},Ae))}),ue["after:highlightBlock"]&&!ue["after:highlightElement"]&&(ue["after:highlightElement"]=Ae=>{ue["after:highlightBlock"](Object.assign({block:Ae.el},Ae))})}function Kt(ue){qn(ue),ze.push(ue)}function yc(ue){const Ae=ze.indexOf(ue);Ae!==-1&&ze.splice(Ae,1)}function Pr(ue,Ae){const Ge=ue;ze.forEach(function(lt){lt[Ge]&<[Ge](Ae)})}function mn(ue){return pi("10.7.0","highlightBlock will be removed entirely in v12.0"),pi("10.7.0","Please use highlightElement now."),Ht(ue)}Object.assign(B,{highlight:kt,highlightAuto:Na,highlightAll:ka,highlightElement:Ht,highlightBlock:mn,configure:Ni,initHighlighting:Vn,initHighlightingOnLoad:Mo,registerLanguage:bc,unregisterLanguage:zr,listLanguages:Ao,getLanguage:Ai,registerAliases:fn,autoDetection:$n,inherit:Ea,addPlugin:Kt,removePlugin:yc}),B.debugMode=function(){St=!1},B.safeMode=function(){St=!0},B.versionString=gi,B.regex={concat:w,lookahead:b,either:A,optional:x,anyNumberOfTimes:y};for(const ue in it)typeof it[ue]=="object"&&e(it[ue]);return Object.assign(B,it),B},Ci=Wi({});return Ci.newInstance=()=>Wi({}),Tm=Ci,Ci.HighlightJS=Ci,Ci.default=Ci,Tm}var Mm,Ux;function ej(){if(Ux)return Mm;Ux=1;function e(t){const s=t.regex,r=s.concat(/[\p{L}_]/u,s.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),o=/[\p{L}0-9._:-]+/u,l={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},d={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},f=t.inherit(d,{begin:/\(/,end:/\)/}),m=t.inherit(t.APOS_STRING_MODE,{className:"string"}),h=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),_={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:o,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[l]},{begin:/'/,end:/'/,contains:[l]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[d,h,m,f,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[d,f,h,m]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},l,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[h]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[_],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[_],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:s.concat(/</,s.lookahead(s.concat(r,s.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:r,relevance:0,starts:_}]},{className:"tag",begin:s.concat(/<\//,s.lookahead(s.concat(r,/>/))),contains:[{className:"name",begin:r,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}return Mm=e,Mm}var Am,Hx;function tj(){if(Hx)return Am;Hx=1;function e(t){const s=t.regex,r={},o={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[r]}]};Object.assign(r,{className:"variable",variants:[{begin:s.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},o]});const l={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},d=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),f={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},m={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,r,l]};l.contains.push(m);const h={match:/\\"/},_={className:"string",begin:/'/,end:/'/},v={match:/\\'/},b={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,r]},y=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],x=t.SHEBANG({binary:`(${y.join("|")})`,relevance:10}),w={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},N=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],A=["true","false"],R={match:/(\/[a-z._-]+)+/},T=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],M=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],z=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],U=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:N,literal:A,built_in:[...T,...M,"set","shopt",...z,...U]},contains:[x,t.SHEBANG(),w,b,d,f,R,m,h,_,v,r]}}return Am=e,Am}var Rm,Fx;function ij(){if(Fx)return Rm;Fx=1;function e(t){const s=t.regex,r=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),o="decltype\\(auto\\)",l="[a-zA-Z_]\\w*::",f="("+o+"|"+s.optional(l)+"[a-zA-Z_]\\w*"+s.optional("<[^<>]+>")+")",m={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},_={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},v={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},b={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(_,{className:"string"}),{className:"string",begin:/<.*?>/},r,t.C_BLOCK_COMMENT_MODE]},y={className:"title",begin:s.optional(l)+t.IDENT_RE,relevance:0},x=s.optional(l)+t.IDENT_RE+"\\s*\\(",A={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},R=[b,m,r,t.C_BLOCK_COMMENT_MODE,v,_],T={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:A,contains:R.concat([{begin:/\(/,end:/\)/,keywords:A,contains:R.concat(["self"]),relevance:0}]),relevance:0},M={begin:"("+f+"[\\*&\\s]+)+"+x,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:A,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:o,keywords:A,relevance:0},{begin:x,returnBegin:!0,contains:[t.inherit(y,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:[r,t.C_BLOCK_COMMENT_MODE,_,v,m,{begin:/\(/,end:/\)/,keywords:A,relevance:0,contains:["self",r,t.C_BLOCK_COMMENT_MODE,_,v,m]}]},m,r,t.C_BLOCK_COMMENT_MODE,b]};return{name:"C",aliases:["h"],keywords:A,disableAutodetect:!0,illegal:"</",contains:[].concat(T,M,R,[b,{begin:t.IDENT_RE+"::",keywords:A},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:b,strings:_,keywords:A}}}return Rm=e,Rm}var Dm,Vx;function sj(){if(Vx)return Dm;Vx=1;function e(t){const s=t.regex,r=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),o="decltype\\(auto\\)",l="[a-zA-Z_]\\w*::",f="(?!struct)("+o+"|"+s.optional(l)+"[a-zA-Z_]\\w*"+s.optional("<[^<>]+>")+")",m={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},_={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},v={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},b={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(_,{className:"string"}),{className:"string",begin:/<.*?>/},r,t.C_BLOCK_COMMENT_MODE]},y={className:"title",begin:s.optional(l)+t.IDENT_RE,relevance:0},x=s.optional(l)+t.IDENT_RE+"\\s*\\(",w=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],N=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],A=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],R=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],z={type:N,keyword:w,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:A},U={className:"function.dispatch",relevance:0,keywords:{_hint:R},begin:s.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,s.lookahead(/(<[^<>]+>|)\s*\(/))},j=[U,b,m,r,t.C_BLOCK_COMMENT_MODE,v,_],O={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:z,contains:j.concat([{begin:/\(/,end:/\)/,keywords:z,contains:j.concat(["self"]),relevance:0}]),relevance:0},K={className:"function",begin:"("+f+"[\\*&\\s]+)+"+x,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:z,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:o,keywords:z,relevance:0},{begin:x,returnBegin:!0,contains:[y],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[_,v]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:z,relevance:0,contains:[r,t.C_BLOCK_COMMENT_MODE,_,v,m,{begin:/\(/,end:/\)/,keywords:z,relevance:0,contains:["self",r,t.C_BLOCK_COMMENT_MODE,_,v,m]}]},m,r,t.C_BLOCK_COMMENT_MODE,b]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:z,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(O,K,U,j,[b,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:z,contains:["self",m]},{begin:t.IDENT_RE+"::",keywords:z},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}return Dm=e,Dm}var Om,$x;function nj(){if($x)return Om;$x=1;function e(t){const s=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],r=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],o=["default","false","null","true"],l=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],d=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],f={keyword:l.concat(d),built_in:s,literal:o},m=t.inherit(t.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),h={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},_={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},v={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},b=t.inherit(v,{illegal:/\n/}),y={className:"subst",begin:/\{/,end:/\}/,keywords:f},x=t.inherit(y,{illegal:/\n/}),w={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,x]},N={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},y]},A=t.inherit(N,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},x]});y.contains=[N,w,v,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,h,t.C_BLOCK_COMMENT_MODE],x.contains=[A,w,b,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,h,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const R={variants:[_,N,w,v,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},T={begin:"<",end:">",contains:[{beginKeywords:"in out"},m]},M=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",z={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:f,illegal:/::/,contains:[t.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},R,h,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},m,T,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[m,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[m,T,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+M+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:f,contains:[{beginKeywords:r.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,T],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,relevance:0,contains:[R,h,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},z]}}return Om=e,Om}var Lm,qx;function rj(){if(qx)return Lm;qx=1;const e=h=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:h.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[h.APOS_STRING_MODE,h.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:h.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),t=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],s=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],r=[...t,...s],o=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),l=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),d=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),f=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function m(h){const _=h.regex,v=e(h),b={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},y="and or not only",x=/@-?\w[\w]*(-\w+)*/,w="[a-zA-Z-][a-zA-Z0-9_-]*",N=[h.APOS_STRING_MODE,h.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[v.BLOCK_COMMENT,b,v.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+w,relevance:0},v.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+l.join("|")+")"},{begin:":(:)?("+d.join("|")+")"}]},v.CSS_VARIABLE,{className:"attribute",begin:"\\b("+f.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[v.BLOCK_COMMENT,v.HEXCOLOR,v.IMPORTANT,v.CSS_NUMBER_MODE,...N,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...N,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},v.FUNCTION_DISPATCH]},{begin:_.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:x},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:y,attribute:o.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...N,v.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+r.join("|")+")\\b"}]}}return Lm=m,Lm}var jm,Kx;function aj(){if(Kx)return jm;Kx=1;function e(t){const s=t.regex,r={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},o={begin:"^[-\\*]{3,}",end:"$"},l={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},d={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},f={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},m=/[A-Za-z][A-Za-z0-9+.-]*/,h={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:s.concat(/\[.+?\]\(/,m,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},_={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},v={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},b=t.inherit(_,{contains:[]}),y=t.inherit(v,{contains:[]});_.contains.push(y),v.contains.push(b);let x=[r,h];return[_,v,b,y].forEach(R=>{R.contains=R.contains.concat(x)}),x=x.concat(_,v),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:x},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:x}]}]},r,d,_,v,{className:"quote",begin:"^>\\s+",contains:x,end:"$"},l,o,h,f,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}return jm=e,jm}var Bm,Gx;function oj(){if(Gx)return Bm;Gx=1;function e(t){const s=t.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:s.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:s.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}return Bm=e,Bm}var zm,Wx;function lj(){if(Wx)return zm;Wx=1;function e(t){const s=t.regex,r="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",o=s.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),l=s.concat(o,/(::\w+)*/),f={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},m={className:"doctag",begin:"@[A-Za-z]+"},h={begin:"#<",end:">"},_=[t.COMMENT("#","$",{contains:[m]}),t.COMMENT("^=begin","^=end",{contains:[m],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],v={className:"subst",begin:/#\{/,end:/\}/,keywords:f},b={className:"string",contains:[t.BACKSLASH_ESCAPE,v],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:s.concat(/<<[-~]?'?/,s.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,v]})]}]},y="[1-9](_?[0-9])*|0",x="[0-9](_?[0-9])*",w={className:"number",relevance:0,variants:[{begin:`\\b(${y})(\\.(${x}))?([eE][+-]?(${x})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},N={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:f}]},j=[b,{variants:[{match:[/class\s+/,l,/\s+<\s+/,l]},{match:[/\b(class|module)\s+/,l]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:f},{match:[/(include|extend)\s+/,l],scope:{2:"title.class"},keywords:f},{relevance:0,match:[l,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:o,scope:"title.class"},{match:[/def/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[N]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[b,{begin:r}],relevance:0},w,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:f},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,v],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(h,_),relevance:0}].concat(h,_);v.contains=j,N.contains=j;const G=[{begin:/^\s*=>/,starts:{end:"$",contains:j}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:f,contains:j}}];return _.unshift(h),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:f,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(G).concat(_).concat(j)}}return zm=e,zm}var Pm,Yx;function cj(){if(Yx)return Pm;Yx=1;function e(t){const d={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:d,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:d,illegal:/["']/}]}]}}return Pm=e,Pm}var Im,Xx;function uj(){if(Xx)return Im;Xx=1;function e(t){const s=t.regex,r=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[t.HASH_COMMENT_MODE,t.QUOTE_STRING_MODE,t.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:s.concat(r,s.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}return Im=e,Im}var Um,Zx;function dj(){if(Zx)return Um;Zx=1;function e(t){const s=t.regex,r={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:t.NUMBER_RE}]},o=t.COMMENT();o.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const l={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},d={className:"literal",begin:/\bon|off|true|false|yes|no\b/},f={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},m={begin:/\[/,end:/\]/,contains:[o,d,l,f,r,"self"],relevance:0},h=/[A-Za-z0-9_-]+/,_=/"(\\"|[^"])*"/,v=/'[^']*'/,b=s.either(h,_,v),y=s.concat(b,"(\\s*\\.\\s*",b,")*",s.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[o,{className:"section",begin:/\[+/,end:/\]+/},{begin:y,className:"attr",starts:{end:/$/,contains:[o,m,d,l,f,r]}}]}}return Um=e,Um}var Hm,Qx;function hj(){if(Qx)return Hm;Qx=1;var e="[0-9](_*[0-9])*",t=`\\.(${e})`,s="[0-9a-fA-F](_*[0-9a-fA-F])*",r={className:"number",variants:[{begin:`(\\b(${e})((${t})|\\.)?|(${t}))[eE][+-]?(${e})[fFdD]?\\b`},{begin:`\\b(${e})((${t})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${t})[fFdD]?\\b`},{begin:`\\b(${e})[fFdD]\\b`},{begin:`\\b0[xX]((${s})\\.?|(${s})?\\.(${s}))[pP][+-]?(${e})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${s})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function o(d,f,m){return m===-1?"":d.replace(f,h=>o(d,f,m-1))}function l(d){const f=d.regex,m="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",h=m+o("(?:<"+m+"~~~(?:\\s*,\\s*"+m+"~~~)*>)?",/~~~/g,2),x={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},w={className:"meta",begin:"@"+m,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},N={className:"params",begin:/\(/,end:/\)/,keywords:x,relevance:0,contains:[d.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:x,illegal:/<\/|#/,contains:[d.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},d.C_LINE_COMMENT_MODE,d.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[d.BACKSLASH_ESCAPE]},d.APOS_STRING_MODE,d.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,m],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[f.concat(/(?!else)/,m),/\s+/,m,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,m],className:{1:"keyword",3:"title.class"},contains:[N,d.C_LINE_COMMENT_MODE,d.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+h+"\\s+)",d.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:x,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:x,relevance:0,contains:[w,d.APOS_STRING_MODE,d.QUOTE_STRING_MODE,r,d.C_BLOCK_COMMENT_MODE]},d.C_LINE_COMMENT_MODE,d.C_BLOCK_COMMENT_MODE]},r,w]}}return Hm=l,Hm}var Fm,Jx;function fj(){if(Jx)return Fm;Jx=1;const e="[A-Za-z$_][0-9A-Za-z$_]*",t=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],s=["true","false","null","undefined","NaN","Infinity"],r=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],o=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],l=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],d=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],f=[].concat(l,r,o);function m(h){const _=h.regex,v=(Se,{after:Be})=>{const Ee="</"+Se[0].slice(1);return Se.input.indexOf(Ee,Be)!==-1},b=e,y={begin:"<>",end:"</>"},x=/<[A-Za-z0-9\\._:-]+\s*\/>/,w={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Se,Be)=>{const Ee=Se[0].length+Se.index,it=Se.input[Ee];if(it==="<"||it===","){Be.ignoreMatch();return}it===">"&&(v(Se,{after:Ee})||Be.ignoreMatch());let rt;const at=Se.input.substring(Ee);if(rt=at.match(/^\s*=/)){Be.ignoreMatch();return}if((rt=at.match(/^\s+extends\s+/))&&rt.index===0){Be.ignoreMatch();return}}},N={$pattern:e,keyword:t,literal:s,built_in:f,"variable.language":d},A="[0-9](_?[0-9])*",R=`\\.(${A})`,T="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",M={className:"number",variants:[{begin:`(\\b(${T})((${R})|\\.)?|(${R}))[eE][+-]?(${A})\\b`},{begin:`\\b(${T})\\b((${R})\\b|\\.)?|(${R})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},z={className:"subst",begin:"\\$\\{",end:"\\}",keywords:N,contains:[]},U={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[h.BACKSLASH_ESCAPE,z],subLanguage:"xml"}},j={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[h.BACKSLASH_ESCAPE,z],subLanguage:"css"}},O={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[h.BACKSLASH_ESCAPE,z],subLanguage:"graphql"}},K={className:"string",begin:"`",end:"`",contains:[h.BACKSLASH_ESCAPE,z]},G={className:"comment",variants:[h.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:b+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),h.C_BLOCK_COMMENT_MODE,h.C_LINE_COMMENT_MODE]},J=[h.APOS_STRING_MODE,h.QUOTE_STRING_MODE,U,j,O,K,{match:/\$\d+/},M];z.contains=J.concat({begin:/\{/,end:/\}/,keywords:N,contains:["self"].concat(J)});const I=[].concat(G,z.contains),ee=I.concat([{begin:/(\s*)\(/,end:/\)/,keywords:N,contains:["self"].concat(I)}]),q={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:N,contains:ee},k={variants:[{match:[/class/,/\s+/,b,/\s+/,/extends/,/\s+/,_.concat(b,"(",_.concat(/\./,b),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,b],scope:{1:"keyword",3:"title.class"}}]},F={relevance:0,match:_.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...r,...o]}},V={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},Z={variants:[{match:[/function/,/\s+/,b,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[q],illegal:/%/},W={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function D(Se){return _.concat("(?!",Se.join("|"),")")}const ie={match:_.concat(/\b/,D([...l,"super","import"].map(Se=>`${Se}\\s*\\(`)),b,_.lookahead(/\s*\(/)),className:"title.function",relevance:0},ce={begin:_.concat(/\./,_.lookahead(_.concat(b,/(?![0-9A-Za-z$_(])/))),end:b,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},le={match:[/get|set/,/\s+/,b,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},q]},de="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+h.UNDERSCORE_IDENT_RE+")\\s*=>",ge={match:[/const|var|let/,/\s+/,b,/\s*/,/=\s*/,/(async\s*)?/,_.lookahead(de)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[q]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:N,exports:{PARAMS_CONTAINS:ee,CLASS_REFERENCE:F},illegal:/#(?![$_A-z])/,contains:[h.SHEBANG({label:"shebang",binary:"node",relevance:5}),V,h.APOS_STRING_MODE,h.QUOTE_STRING_MODE,U,j,O,K,G,{match:/\$\d+/},M,F,{scope:"attr",match:b+_.lookahead(":"),relevance:0},ge,{begin:"("+h.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[G,h.REGEXP_MODE,{className:"function",begin:de,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:h.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:N,contains:ee}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:y.begin,end:y.end},{match:x},{begin:w.begin,"on:begin":w.isTrulyOpeningTag,end:w.end}],subLanguage:"xml",contains:[{begin:w.begin,end:w.end,skip:!0,contains:["self"]}]}]},Z,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+h.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[q,h.inherit(h.TITLE_MODE,{begin:b,className:"title.function"})]},{match:/\.\.\./,relevance:0},ce,{match:"\\$"+b,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[q]},ie,W,k,le,{match:/\$[(.]/}]}}return Fm=m,Fm}var Vm,eS;function mj(){if(eS)return Vm;eS=1;function e(t){const s={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},r={match:/[{}[\],:]/,className:"punctuation",relevance:0},o=["true","false","null"],l={scope:"literal",beginKeywords:o.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:o},contains:[s,r,t.QUOTE_STRING_MODE,l,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}return Vm=e,Vm}var $m,tS;function pj(){if(tS)return $m;tS=1;var e="[0-9](_*[0-9])*",t=`\\.(${e})`,s="[0-9a-fA-F](_*[0-9a-fA-F])*",r={className:"number",variants:[{begin:`(\\b(${e})((${t})|\\.)?|(${t}))[eE][+-]?(${e})[fFdD]?\\b`},{begin:`\\b(${e})((${t})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${t})[fFdD]?\\b`},{begin:`\\b(${e})[fFdD]\\b`},{begin:`\\b0[xX]((${s})\\.?|(${s})?\\.(${s}))[pP][+-]?(${e})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${s})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function o(l){const d={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},f={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},m={className:"symbol",begin:l.UNDERSCORE_IDENT_RE+"@"},h={className:"subst",begin:/\$\{/,end:/\}/,contains:[l.C_NUMBER_MODE]},_={className:"variable",begin:"\\$"+l.UNDERSCORE_IDENT_RE},v={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[_,h]},{begin:"'",end:"'",illegal:/\n/,contains:[l.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[l.BACKSLASH_ESCAPE,_,h]}]};h.contains.push(v);const b={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+l.UNDERSCORE_IDENT_RE+")?"},y={className:"meta",begin:"@"+l.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[l.inherit(v,{className:"string"}),"self"]}]},x=r,w=l.COMMENT("/\\*","\\*/",{contains:[l.C_BLOCK_COMMENT_MODE]}),N={variants:[{className:"type",begin:l.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},A=N;return A.variants[1].contains=[N],N.variants[1].contains=[A],{name:"Kotlin",aliases:["kt","kts"],keywords:d,contains:[l.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),l.C_LINE_COMMENT_MODE,w,f,m,b,y,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:d,relevance:5,contains:[{begin:l.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[l.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:d,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[N,l.C_LINE_COMMENT_MODE,w],relevance:0},l.C_LINE_COMMENT_MODE,w,b,y,v,l.C_NUMBER_MODE]},w]},{begin:[/class|interface|trait/,/\s+/,l.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},l.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},b,y]},v,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
39
|
-
`},x]}}return $m=o,$m}var qm,iS;function gj(){if(iS)return qm;iS=1;const e=_=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:_.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[_.APOS_STRING_MODE,_.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:_.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),t=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],s=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],r=[...t,...s],o=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),l=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),d=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),f=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),m=l.concat(d).sort().reverse();function h(_){const v=e(_),b=m,y="and or not only",x="[\\w-]+",w="("+x+"|@\\{"+x+"\\})",N=[],A=[],R=function(I){return{className:"string",begin:"~?"+I+".*?"+I}},T=function(I,ee,q){return{className:I,begin:ee,relevance:q}},M={$pattern:/[a-z-]+/,keyword:y,attribute:o.join(" ")},z={begin:"\\(",end:"\\)",contains:A,keywords:M,relevance:0};A.push(_.C_LINE_COMMENT_MODE,_.C_BLOCK_COMMENT_MODE,R("'"),R('"'),v.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},v.HEXCOLOR,z,T("variable","@@?"+x,10),T("variable","@\\{"+x+"\\}"),T("built_in","~?`[^`]*?`"),{className:"attribute",begin:x+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},v.IMPORTANT,{beginKeywords:"and not"},v.FUNCTION_DISPATCH);const U=A.concat({begin:/\{/,end:/\}/,contains:N}),j={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(A)},O={begin:w+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},v.CSS_VARIABLE,{className:"attribute",begin:"\\b("+f.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:A}}]},K={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:M,returnEnd:!0,contains:A,relevance:0}},H={className:"variable",variants:[{begin:"@"+x+"\\s*:",relevance:15},{begin:"@"+x}],starts:{end:"[;}]",returnEnd:!0,contains:U}},G={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:w,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[_.C_LINE_COMMENT_MODE,_.C_BLOCK_COMMENT_MODE,j,T("keyword","all\\b"),T("variable","@\\{"+x+"\\}"),{begin:"\\b("+r.join("|")+")\\b",className:"selector-tag"},v.CSS_NUMBER_MODE,T("selector-tag",w,0),T("selector-id","#"+w),T("selector-class","\\."+w,0),T("selector-tag","&",0),v.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+l.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+d.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:U},{begin:"!important"},v.FUNCTION_DISPATCH]},J={begin:x+`:(:)?(${b.join("|")})`,returnBegin:!0,contains:[G]};return N.push(_.C_LINE_COMMENT_MODE,_.C_BLOCK_COMMENT_MODE,K,H,J,O,G,j,v.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:N}}return qm=h,qm}var Km,sS;function _j(){if(sS)return Km;sS=1;function e(t){const s="\\[=*\\[",r="\\]=*\\]",o={begin:s,end:r,contains:["self"]},l=[t.COMMENT("--(?!"+s+")","$"),t.COMMENT("--"+s,r,{contains:[o],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:t.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:l.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:l}].concat(l)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:s,end:r,contains:[o],relevance:5}])}}return Km=e,Km}var Gm,nS;function vj(){if(nS)return Gm;nS=1;function e(t){const s={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},r={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,s]},o={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[s,r]},l={begin:"^"+t.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},d={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},f={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[s]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[t.HASH_COMMENT_MODE,s,r,o,l,d,f]}}return Gm=e,Gm}var Wm,rS;function bj(){if(rS)return Wm;rS=1;function e(t){const s=t.regex,r=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],o=/[dualxmsipngr]{0,12}/,l={$pattern:/[\w.]+/,keyword:r.join(" ")},d={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:l},f={begin:/->\{/,end:/\}/},m={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},h={scope:"variable",variants:[{begin:/\$\d/},{begin:s.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[m]},_={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},v=[t.BACKSLASH_ESCAPE,d,h],b=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],y=(N,A,R="\\1")=>{const T=R==="\\1"?R:s.concat(R,A);return s.concat(s.concat("(?:",N,")"),A,/(?:\\.|[^\\\/])*?/,T,/(?:\\.|[^\\\/])*?/,R,o)},x=(N,A,R)=>s.concat(s.concat("(?:",N,")"),A,/(?:\\.|[^\\\/])*?/,R,o),w=[h,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),f,{className:"string",contains:v,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},_,{begin:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:y("s|tr|y",s.either(...b,{capture:!0}))},{begin:y("s|tr|y","\\(","\\)")},{begin:y("s|tr|y","\\[","\\]")},{begin:y("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:x("(?:m|qr)?",/\//,/\//)},{begin:x("m|qr",s.either(...b,{capture:!0}),/\1/)},{begin:x("m|qr",/\(/,/\)/)},{begin:x("m|qr",/\[/,/\]/)},{begin:x("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,m]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,m,_]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return d.contains=w,f.contains=w,{name:"Perl",aliases:["pl","pm"],keywords:l,contains:w}}return Wm=e,Wm}var Ym,aS;function yj(){if(aS)return Ym;aS=1;function e(t){const s={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},r=/[a-zA-Z@][a-zA-Z0-9_]*/,m={"variable.language":["this","super"],$pattern:r,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},h={$pattern:r,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:m,illegal:"</",contains:[s,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.C_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+h.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:h,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}}return Ym=e,Ym}var Xm,oS;function xj(){if(oS)return Xm;oS=1;function e(t){const s=t.regex,r=/(?![A-Za-z0-9])(?![$])/,o=s.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,r),l=s.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,r),d=s.concat(/[A-Z]+/,r),f={scope:"variable",match:"\\$+"+o},m={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},h={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},_=t.inherit(t.APOS_STRING_MODE,{illegal:null}),v=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(h)}),b={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(h),"on:begin":(q,k)=>{k.data._beginMatch=q[1]||q[2]},"on:end":(q,k)=>{k.data._beginMatch!==q[1]&&k.ignoreMatch()}},y=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),x=`[
|
|
40
|
-
]`,w={scope:"string",variants:[v,_,b,y]},N={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},A=["false","null","true"],R=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],T=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],z={keyword:R,literal:(q=>{const k=[];return q.forEach(F=>{k.push(F),F.toLowerCase()===F?k.push(F.toUpperCase()):k.push(F.toLowerCase())}),k})(A),built_in:T},U=q=>q.map(k=>k.replace(/\|\d+$/,"")),j={variants:[{match:[/new/,s.concat(x,"+"),s.concat("(?!",U(T).join("\\b|"),"\\b)"),l],scope:{1:"keyword",4:"title.class"}}]},O=s.concat(o,"\\b(?!\\()"),K={variants:[{match:[s.concat(/::/,s.lookahead(/(?!class\b)/)),O],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[l,s.concat(/::/,s.lookahead(/(?!class\b)/)),O],scope:{1:"title.class",3:"variable.constant"}},{match:[l,s.concat("::",s.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[l,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},H={scope:"attr",match:s.concat(o,s.lookahead(":"),s.lookahead(/(?!::)/))},G={relevance:0,begin:/\(/,end:/\)/,keywords:z,contains:[H,f,K,t.C_BLOCK_COMMENT_MODE,w,N,j]},J={relevance:0,match:[/\b/,s.concat("(?!fn\\b|function\\b|",U(R).join("\\b|"),"|",U(T).join("\\b|"),"\\b)"),o,s.concat(x,"*"),s.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[G]};G.contains.push(J);const I=[H,K,t.C_BLOCK_COMMENT_MODE,w,N,j],ee={begin:s.concat(/#\[\s*\\?/,s.either(l,d)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:A,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:A,keyword:["new","array"]},contains:["self",...I]},...I,{scope:"meta",variants:[{match:l},{match:d}]}]};return{case_insensitive:!1,keywords:z,contains:[ee,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},m,{scope:"variable.language",match:/\$this\b/},f,J,K,{match:[/const/,/\s/,o],scope:{1:"keyword",3:"variable.constant"}},j,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:z,contains:["self",ee,f,K,t.C_BLOCK_COMMENT_MODE,w,N]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},w,N]}}return Xm=e,Xm}var Zm,lS;function Sj(){if(lS)return Zm;lS=1;function e(t){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}return Zm=e,Zm}var Qm,cS;function wj(){if(cS)return Qm;cS=1;function e(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}return Qm=e,Qm}var Jm,uS;function Ej(){if(uS)return Jm;uS=1;function e(t){const s=t.regex,r=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),o=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],m={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:o,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},h={className:"meta",begin:/^(>>>|\.\.\.) /},_={className:"subst",begin:/\{/,end:/\}/,keywords:m,illegal:/#/},v={begin:/\{\{/,relevance:0},b={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,h],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,h],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,h,v,_]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,h,v,_]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,v,_]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,v,_]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},y="[0-9](_?[0-9])*",x=`(\\b(${y}))?\\.(${y})|\\b(${y})\\.`,w=`\\b|${o.join("|")}`,N={className:"number",relevance:0,variants:[{begin:`(\\b(${y})|(${x}))[eE][+-]?(${y})[jJ]?(?=${w})`},{begin:`(${x})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${w})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${w})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${w})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${w})`},{begin:`\\b(${y})[jJ](?=${w})`}]},A={className:"comment",begin:s.lookahead(/# type:/),end:/$/,keywords:m,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},R={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:m,contains:["self",h,N,b,t.HASH_COMMENT_MODE]}]};return _.contains=[b,N,h],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:m,illegal:/(<\/|\?)|=>/,contains:[h,N,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},b,A,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[R]},{variants:[{match:[/\bclass/,/\s+/,r,/\s*/,/\(\s*/,r,/\s*\)/]},{match:[/\bclass/,/\s+/,r]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[N,R,b]}]}}return Jm=e,Jm}var ep,dS;function Cj(){if(dS)return ep;dS=1;function e(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}return ep=e,ep}var tp,hS;function Nj(){if(hS)return tp;hS=1;function e(t){const s=t.regex,r=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,o=s.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),l=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,d=s.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:r,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[t.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:s.lookahead(s.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:r},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),t.HASH_COMMENT_MODE,{scope:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[l,o]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,o]},{scope:{1:"punctuation",2:"number"},match:[d,o]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,o]}]},{scope:{3:"operator"},match:[r,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:l},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:d},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}return tp=e,tp}var ip,fS;function kj(){if(fS)return ip;fS=1;function e(t){const s=t.regex,r=/(r#)?/,o=s.concat(r,t.UNDERSCORE_IDENT_RE),l=s.concat(r,t.IDENT_RE),d={className:"title.function.invoke",relevance:0,begin:s.concat(/\b/,/(?!let|for|while|if|else|match\b)/,l,s.lookahead(/\s*\(/))},f="([ui](8|16|32|64|128|size)|f(32|64))?",m=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],h=["true","false","Some","None","Ok","Err"],_=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],v=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:v,keyword:m,literal:h,built_in:_},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+f},{begin:"\\b0o([0-7_]+)"+f},{begin:"\\b0x([A-Fa-f0-9_]+)"+f},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+f}],relevance:0},{begin:[/fn/,/\s+/,o],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,o],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,o,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,o],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,o],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:_,type:v}},{className:"punctuation",begin:"->"},d]}}return ip=e,ip}var sp,mS;function Tj(){if(mS)return sp;mS=1;const e=h=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:h.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[h.APOS_STRING_MODE,h.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:h.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),t=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],s=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],r=[...t,...s],o=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),l=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),d=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),f=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function m(h){const _=e(h),v=d,b=l,y="@[a-z-]+",x="and or not only",N={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[h.C_LINE_COMMENT_MODE,h.C_BLOCK_COMMENT_MODE,_.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},_.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+r.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+b.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+v.join("|")+")"},N,{begin:/\(/,end:/\)/,contains:[_.CSS_NUMBER_MODE]},_.CSS_VARIABLE,{className:"attribute",begin:"\\b("+f.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[_.BLOCK_COMMENT,N,_.HEXCOLOR,_.CSS_NUMBER_MODE,h.QUOTE_STRING_MODE,h.APOS_STRING_MODE,_.IMPORTANT,_.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:y,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:x,attribute:o.join(" ")},contains:[{begin:y,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},N,h.QUOTE_STRING_MODE,h.APOS_STRING_MODE,_.HEXCOLOR,_.CSS_NUMBER_MODE]},_.FUNCTION_DISPATCH]}}return sp=m,sp}var np,pS;function Mj(){if(pS)return np;pS=1;function e(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}return np=e,np}var rp,gS;function Aj(){if(gS)return rp;gS=1;function e(t){const s=t.regex,r=t.COMMENT("--","$"),o={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},l={begin:/"/,end:/"/,contains:[{match:/""/}]},d=["true","false","unknown"],f=["double precision","large object","with timezone","without timezone"],m=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],h=["add","asc","collation","desc","final","first","last","view"],_=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],v=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],b=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],y=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],x=v,w=[..._,...h].filter(U=>!v.includes(U)),N={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},A={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},R={match:s.concat(/\b/,s.either(...x),/\s*\(/),relevance:0,keywords:{built_in:x}};function T(U){return s.concat(/\b/,s.either(...U.map(j=>j.replace(/\s+/,"\\s+"))),/\b/)}const M={scope:"keyword",match:T(y),relevance:0};function z(U,{exceptions:j,when:O}={}){const K=O;return j=j||[],U.map(H=>H.match(/\|\d+$/)||j.includes(H)?H:K(H)?`${H}|0`:H)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:z(w,{when:U=>U.length<3}),literal:d,type:m,built_in:b},contains:[{scope:"type",match:T(f)},M,R,N,o,l,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,r,A]}}return rp=e,rp}var ap,_S;function Rj(){if(_S)return ap;_S=1;function e(O){return O?typeof O=="string"?O:O.source:null}function t(O){return s("(?=",O,")")}function s(...O){return O.map(H=>e(H)).join("")}function r(O){const K=O[O.length-1];return typeof K=="object"&&K.constructor===Object?(O.splice(O.length-1,1),K):{}}function o(...O){return"("+(r(O).capture?"":"?:")+O.map(G=>e(G)).join("|")+")"}const l=O=>s(/\b/,O,/\w$/.test(O)?/\b/:/\B/),d=["Protocol","Type"].map(l),f=["init","self"].map(l),m=["Any","Self"],h=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],_=["false","nil","true"],v=["assignment","associativity","higherThan","left","lowerThan","none","right"],b=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],y=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],x=o(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),w=o(x,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),N=s(x,w,"*"),A=o(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),R=o(A,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),T=s(A,R,"*"),M=s(/[A-Z]/,R,"*"),z=["attached","autoclosure",s(/convention\(/,o("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",s(/objc\(/,T,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],U=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function j(O){const K={match:/\s+/,relevance:0},H=O.COMMENT("/\\*","\\*/",{contains:["self"]}),G=[O.C_LINE_COMMENT_MODE,H],J={match:[/\./,o(...d,...f)],className:{2:"keyword"}},I={match:s(/\./,o(...h)),relevance:0},ee=h.filter(et=>typeof et=="string").concat(["_|0"]),q=h.filter(et=>typeof et!="string").concat(m).map(l),k={variants:[{className:"keyword",match:o(...q,...f)}]},F={$pattern:o(/\b\w+/,/#\w+/),keyword:ee.concat(b),literal:_},V=[J,I,k],Z={match:s(/\./,o(...y)),relevance:0},W={className:"built_in",match:s(/\b/,o(...y),/(?=\()/)},D=[Z,W],ie={match:/->/,relevance:0},ce={className:"operator",relevance:0,variants:[{match:N},{match:`\\.(\\.|${w})+`}]},le=[ie,ce],de="([0-9]_*)+",ge="([0-9a-fA-F]_*)+",Se={className:"number",relevance:0,variants:[{match:`\\b(${de})(\\.(${de}))?([eE][+-]?(${de}))?\\b`},{match:`\\b0x(${ge})(\\.(${ge}))?([pP][+-]?(${de}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},Be=(et="")=>({className:"subst",variants:[{match:s(/\\/,et,/[0\\tnr"']/)},{match:s(/\\/,et,/u\{[0-9a-fA-F]{1,8}\}/)}]}),Ee=(et="")=>({className:"subst",match:s(/\\/,et,/[\t ]*(?:[\r\n]|\r\n)/)}),it=(et="")=>({className:"subst",label:"interpol",begin:s(/\\/,et,/\(/),end:/\)/}),rt=(et="")=>({begin:s(et,/"""/),end:s(/"""/,et),contains:[Be(et),Ee(et),it(et)]}),at=(et="")=>({begin:s(et,/"/),end:s(/"/,et),contains:[Be(et),it(et)]}),je={className:"string",variants:[rt(),rt("#"),rt("##"),rt("###"),at(),at("#"),at("##"),at("###")]},It=[O.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[O.BACKSLASH_ESCAPE]}],Or={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:It},an=et=>{const As=s(et,/\//),Wi=s(/\//,et);return{begin:As,end:Wi,contains:[...It,{scope:"comment",begin:`#(?!.*${Wi})`,end:/$/}]}},ya={scope:"regexp",variants:[an("###"),an("##"),an("#"),Or]},Lr={match:s(/`/,T,/`/)},jr={className:"variable",match:/\$\d+/},Hn={className:"variable",match:`\\$${R}+`},on=[Lr,jr,Hn],No={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:U,contains:[...le,Se,je]}]}},xa={scope:"keyword",match:s(/@/,o(...z),t(o(/\(/,/\s+/)))},At={scope:"meta",match:s(/@/,T)},ln=[No,xa,At],pi={match:t(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:s(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,R,"+")},{className:"type",match:M,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:s(/\s+&\s+/,t(M)),relevance:0}]},cn={begin:/</,end:/>/,keywords:F,contains:[...G,...V,...ln,ie,pi]};pi.contains.push(cn);const un={match:s(T,/\s*:/),keywords:"_|0",relevance:0},Sa={begin:/\(/,end:/\)/,relevance:0,keywords:F,contains:["self",un,...G,ya,...V,...D,...le,Se,je,...on,...ln,pi]},Fn={begin:/</,end:/>/,keywords:"repeat each",contains:[...G,pi]},ko={begin:o(t(s(T,/\s*:/)),t(s(T,/\s+/,T,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:T}]},wa={begin:/\(/,end:/\)/,keywords:F,contains:[ko,...G,...V,...le,Se,je,...ln,pi,Sa],endsParent:!0,illegal:/["']/},dn={match:[/(func|macro)/,/\s+/,o(Lr.match,T,N)],className:{1:"keyword",3:"title.function"},contains:[Fn,wa,K],illegal:[/\[/,/%/]},li={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[Fn,wa,K],illegal:/\[|%/},cs={match:[/operator/,/\s+/,N],className:{1:"keyword",3:"title"}},gi={begin:[/precedencegroup/,/\s+/,M],className:{1:"keyword",3:"title"},contains:[pi],keywords:[...v,..._],end:/}/},To={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Br={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Ea={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,T,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:F,contains:[Fn,...V,{begin:/:/,end:/\{/,keywords:F,contains:[{scope:"title.class.inherited",match:M},...V],relevance:0}]};for(const et of je.variants){const As=et.contains.find(Ci=>Ci.label==="interpol");As.keywords=F;const Wi=[...V,...D,...le,Se,je,...on];As.contains=[...Wi,{begin:/\(/,end:/\)/,contains:["self",...Wi]}]}return{name:"Swift",keywords:F,contains:[...G,dn,li,To,Br,Ea,cs,gi,{beginKeywords:"import",end:/$/,contains:[...G],relevance:0},ya,...V,...D,...le,Se,je,...on,...ln,pi,Sa]}}return ap=j,ap}var op,vS;function Dj(){if(vS)return op;vS=1;function e(t){const s="true false yes no null",r="[\\w#;/?:@&=+$,.~*'()[\\]]+",o={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},l={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},d={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},f={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,l]},m=t.inherit(f,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),y={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},x={end:",",endsWithParent:!0,excludeEnd:!0,keywords:s,relevance:0},w={begin:/\{/,end:/\}/,contains:[x],illegal:"\\n",relevance:0},N={begin:"\\[",end:"\\]",contains:[x],illegal:"\\n",relevance:0},A=[o,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+r},{className:"type",begin:"!<"+r+">"},{className:"type",begin:"!"+r},{className:"type",begin:"!!"+r},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:s,keywords:{literal:s}},y,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},w,N,d,f],R=[...A];return R.pop(),R.push(m),x.contains=R,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:A}}return op=e,op}var lp,bS;function Oj(){if(bS)return lp;bS=1;const e="[A-Za-z$_][0-9A-Za-z$_]*",t=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],s=["true","false","null","undefined","NaN","Infinity"],r=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],o=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],l=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],d=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],f=[].concat(l,r,o);function m(_){const v=_.regex,b=(Be,{after:Ee})=>{const it="</"+Be[0].slice(1);return Be.input.indexOf(it,Ee)!==-1},y=e,x={begin:"<>",end:"</>"},w=/<[A-Za-z0-9\\._:-]+\s*\/>/,N={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Be,Ee)=>{const it=Be[0].length+Be.index,rt=Be.input[it];if(rt==="<"||rt===","){Ee.ignoreMatch();return}rt===">"&&(b(Be,{after:it})||Ee.ignoreMatch());let at;const je=Be.input.substring(it);if(at=je.match(/^\s*=/)){Ee.ignoreMatch();return}if((at=je.match(/^\s+extends\s+/))&&at.index===0){Ee.ignoreMatch();return}}},A={$pattern:e,keyword:t,literal:s,built_in:f,"variable.language":d},R="[0-9](_?[0-9])*",T=`\\.(${R})`,M="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",z={className:"number",variants:[{begin:`(\\b(${M})((${T})|\\.)?|(${T}))[eE][+-]?(${R})\\b`},{begin:`\\b(${M})\\b((${T})\\b|\\.)?|(${T})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},U={className:"subst",begin:"\\$\\{",end:"\\}",keywords:A,contains:[]},j={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[_.BACKSLASH_ESCAPE,U],subLanguage:"xml"}},O={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[_.BACKSLASH_ESCAPE,U],subLanguage:"css"}},K={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[_.BACKSLASH_ESCAPE,U],subLanguage:"graphql"}},H={className:"string",begin:"`",end:"`",contains:[_.BACKSLASH_ESCAPE,U]},J={className:"comment",variants:[_.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:y+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),_.C_BLOCK_COMMENT_MODE,_.C_LINE_COMMENT_MODE]},I=[_.APOS_STRING_MODE,_.QUOTE_STRING_MODE,j,O,K,H,{match:/\$\d+/},z];U.contains=I.concat({begin:/\{/,end:/\}/,keywords:A,contains:["self"].concat(I)});const ee=[].concat(J,U.contains),q=ee.concat([{begin:/(\s*)\(/,end:/\)/,keywords:A,contains:["self"].concat(ee)}]),k={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:A,contains:q},F={variants:[{match:[/class/,/\s+/,y,/\s+/,/extends/,/\s+/,v.concat(y,"(",v.concat(/\./,y),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,y],scope:{1:"keyword",3:"title.class"}}]},V={relevance:0,match:v.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...r,...o]}},Z={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},W={variants:[{match:[/function/,/\s+/,y,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[k],illegal:/%/},D={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function ie(Be){return v.concat("(?!",Be.join("|"),")")}const ce={match:v.concat(/\b/,ie([...l,"super","import"].map(Be=>`${Be}\\s*\\(`)),y,v.lookahead(/\s*\(/)),className:"title.function",relevance:0},le={begin:v.concat(/\./,v.lookahead(v.concat(y,/(?![0-9A-Za-z$_(])/))),end:y,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},de={match:[/get|set/,/\s+/,y,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},k]},ge="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+_.UNDERSCORE_IDENT_RE+")\\s*=>",Se={match:[/const|var|let/,/\s+/,y,/\s*/,/=\s*/,/(async\s*)?/,v.lookahead(ge)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[k]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:A,exports:{PARAMS_CONTAINS:q,CLASS_REFERENCE:V},illegal:/#(?![$_A-z])/,contains:[_.SHEBANG({label:"shebang",binary:"node",relevance:5}),Z,_.APOS_STRING_MODE,_.QUOTE_STRING_MODE,j,O,K,H,J,{match:/\$\d+/},z,V,{scope:"attr",match:y+v.lookahead(":"),relevance:0},Se,{begin:"("+_.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[J,_.REGEXP_MODE,{className:"function",begin:ge,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:_.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:A,contains:q}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:x.begin,end:x.end},{match:w},{begin:N.begin,"on:begin":N.isTrulyOpeningTag,end:N.end}],subLanguage:"xml",contains:[{begin:N.begin,end:N.end,skip:!0,contains:["self"]}]}]},W,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+_.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[k,_.inherit(_.TITLE_MODE,{begin:y,className:"title.function"})]},{match:/\.\.\./,relevance:0},le,{match:"\\$"+y,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[k]},ce,D,F,de,{match:/\$[(.]/}]}}function h(_){const v=_.regex,b=m(_),y=e,x=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],w={begin:[/namespace/,/\s+/,_.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},N={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:x},contains:[b.exports.CLASS_REFERENCE]},A={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},R=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],T={$pattern:e,keyword:t.concat(R),literal:s,built_in:f.concat(x),"variable.language":d},M={className:"meta",begin:"@"+y},z=(K,H,G)=>{const J=K.contains.findIndex(I=>I.label===H);if(J===-1)throw new Error("can not find mode to replace");K.contains.splice(J,1,G)};Object.assign(b.keywords,T),b.exports.PARAMS_CONTAINS.push(M);const U=b.contains.find(K=>K.scope==="attr"),j=Object.assign({},U,{match:v.concat(y,v.lookahead(/\s*\?:/))});b.exports.PARAMS_CONTAINS.push([b.exports.CLASS_REFERENCE,U,j]),b.contains=b.contains.concat([M,w,N,j]),z(b,"shebang",_.SHEBANG()),z(b,"use_strict",A);const O=b.contains.find(K=>K.label==="func.def");return O.relevance=0,Object.assign(b,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),b}return lp=h,lp}var cp,yS;function Lj(){if(yS)return cp;yS=1;function e(t){const s=t.regex,r={className:"string",begin:/"(""|[^/n])"C\b/},o={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},l=/\d{1,2}\/\d{1,2}\/\d{4}/,d=/\d{4}-\d{1,2}-\d{1,2}/,f=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,m=/\d{1,2}(:\d{1,2}){1,2}/,h={className:"literal",variants:[{begin:s.concat(/# */,s.either(d,l),/ *#/)},{begin:s.concat(/# */,m,/ *#/)},{begin:s.concat(/# */,f,/ *#/)},{begin:s.concat(/# */,s.either(d,l),/ +/,s.either(f,m),/ *#/)}]},_={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},v={className:"label",begin:/^\w+:/},b=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),y=t.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[r,o,h,_,v,b,y,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[y]}]}}return cp=e,cp}var up,xS;function jj(){if(xS)return up;xS=1;function e(t){t.regex;const s=t.COMMENT(/\(;/,/;\)/);s.contains.push("self");const r=t.COMMENT(/;;/,/$/),o=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],l={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},d={className:"variable",begin:/\$[\w_]+/},f={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},m={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},h={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},_={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:o},contains:[r,s,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},d,f,l,t.QUOTE_STRING_MODE,h,_,m]}}return up=e,up}var dp,SS;function Bj(){if(SS)return dp;SS=1;var e=J9();return e.registerLanguage("xml",ej()),e.registerLanguage("bash",tj()),e.registerLanguage("c",ij()),e.registerLanguage("cpp",sj()),e.registerLanguage("csharp",nj()),e.registerLanguage("css",rj()),e.registerLanguage("markdown",aj()),e.registerLanguage("diff",oj()),e.registerLanguage("ruby",lj()),e.registerLanguage("go",cj()),e.registerLanguage("graphql",uj()),e.registerLanguage("ini",dj()),e.registerLanguage("java",hj()),e.registerLanguage("javascript",fj()),e.registerLanguage("json",mj()),e.registerLanguage("kotlin",pj()),e.registerLanguage("less",gj()),e.registerLanguage("lua",_j()),e.registerLanguage("makefile",vj()),e.registerLanguage("perl",bj()),e.registerLanguage("objectivec",yj()),e.registerLanguage("php",xj()),e.registerLanguage("php-template",Sj()),e.registerLanguage("plaintext",wj()),e.registerLanguage("python",Ej()),e.registerLanguage("python-repl",Cj()),e.registerLanguage("r",Nj()),e.registerLanguage("rust",kj()),e.registerLanguage("scss",Tj()),e.registerLanguage("shell",Mj()),e.registerLanguage("sql",Aj()),e.registerLanguage("swift",Rj()),e.registerLanguage("yaml",Dj()),e.registerLanguage("typescript",Oj()),e.registerLanguage("vbnet",Lj()),e.registerLanguage("wasm",jj()),e.HighlightJS=e,e.default=e,dp=e,dp}var zj=Bj();const wS=cN(zj);function Pj(e){const t=e.split("/").pop()?.toLowerCase()??"",s=t.includes(".")?t.split(".").pop()??"":"",r={ts:"typescript",tsx:"typescript",js:"javascript",jsx:"javascript",mjs:"javascript",cjs:"javascript",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",kt:"kotlin",swift:"swift",c:"c",h:"c",cpp:"cpp",cc:"cpp",hpp:"cpp",cs:"csharp",sh:"bash",bash:"bash",zsh:"bash",json:"json",yaml:"yaml",yml:"yaml",toml:"ini",ini:"ini",md:"markdown",mdx:"markdown",css:"css",scss:"scss",less:"less",html:"xml",xml:"xml",sql:"sql",dockerfile:"dockerfile"};return r[s]?r[s]:t==="dockerfile"?"dockerfile":null}function Ij(e,t){const s=e.endsWith(`
|
|
41
|
-
`)?e.slice(0,-1):e;return!t||!wS.getLanguage(t)?s.split(`
|
|
42
|
-
`).map(ES):s.split(`
|
|
43
|
-
`).map(r=>{if(!r)return"";try{return wS.highlight(r,{language:t,ignoreIllegals:!0}).value}catch{return ES(r)}})}function ES(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function Uj({content:e,path:t}){const s=E.useMemo(()=>Pj(t),[t]),r=E.useMemo(()=>Ij(e,s),[e,s]),o=`${Math.max(2,String(r.length).length)}ch`;return u.jsx("div",{className:"min-w-max font-mono text-[12px] leading-[1.5]",children:r.map((l,d)=>u.jsxs("div",{className:"flex",children:[u.jsx("span",{className:"shrink-0 select-none border-r border-zinc-200 bg-zinc-100 px-2 text-right text-zinc-400",style:{minWidth:`calc(${o} + 1rem)`},children:d+1}),u.jsx("span",{className:"hljs whitespace-pre px-3 text-zinc-800",dangerouslySetInnerHTML:{__html:l||" "}})]},d))})}function Hj({path:e,isModified:t,onViewDiff:s}){const[r,o]=E.useState(null),[l,d]=E.useState(null),[f,m]=E.useState(!1);return E.useEffect(()=>{if(!e){o(null);return}let h=!0;return m(!0),d(null),eT(e).then(_=>{h&&(o(_),m(!1))}).catch(_=>{h&&(d(_ instanceof Error?_.message:String(_)),m(!1))}),()=>{h=!1}},[e]),e?u.jsxs("section",{className:"flex min-h-0 min-w-0 flex-col border-l border-border bg-white",children:[u.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-3 border-b border-border px-3 py-1.5",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("h2",{className:"truncate text-[13px] font-semibold tracking-tight",children:e}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[10px] text-muted-foreground",children:[u.jsx("span",{children:"Read-only view of tracked file."}),r?.truncated?u.jsx("span",{className:"text-amber-700",children:"Truncated — file exceeds 1MB."}):null,r?.binary?u.jsx("span",{className:"text-amber-700",children:"Binary file."}):null]})]}),t?u.jsx(fe,{onClick:s,size:"sm",type:"button",variant:"outline",children:"View diff"}):null]}),u.jsx("div",{className:"min-h-0 flex-1 overflow-auto bg-zinc-50",children:l?u.jsx("div",{className:"p-4",children:u.jsx(ht,{variant:"destructive",children:l})}):f?u.jsx("div",{className:"p-4 text-[12px] text-muted-foreground",children:"Loading…"}):r?.binary?u.jsx("div",{className:"p-4 text-[12px] text-muted-foreground",children:"Cannot display binary content."}):r?u.jsx(Uj,{content:r.content,path:e}):null})]}):u.jsx("div",{className:"p-4",children:u.jsx(ht,{variant:"muted",className:"border-dashed p-12 text-center",children:"Select a file to view its contents."})})}function Fj({activeHunkIndex:e,filePaths:t,hunkCount:s,pendingNextFilePath:r,selectedFile:o}){if(s>0&&e<s-1)return{kind:"hunk",activeHunkIndex:e+1};const l=t.indexOf(o),d=t[l+1];return d?r===d?{kind:"file",filePath:d}:{kind:"confirm-next-file",filePath:d}:{kind:"none"}}function CS(e){const t={name:"",fullPath:"",children:new Map};for(const s of e){const r=s.name.split("/");let o=t;r.forEach((l,d)=>{let f=o.children.get(l);f||(f={name:l,fullPath:r.slice(0,d+1).join("/"),children:new Map},o.children.set(l,f)),o=f}),o.branch=s}return t}function NS({label:e,tree:t,onSelect:s,defaultOpen:r,forceOpen:o}){const[l,d]=E.useState(r??!1),f=o||l,m=t.children.size===0;return u.jsxs("div",{className:"mb-1",children:[u.jsxs("button",{type:"button",onClick:()=>d(h=>!h),className:"flex w-full items-center gap-1 px-2 py-0.5 text-left text-[11px] font-semibold uppercase tracking-wide text-muted-foreground hover:text-foreground",children:[f?u.jsx(Pn,{size:12}):u.jsx(ga,{size:12}),e,m?null:u.jsxs("span",{className:"ml-1 text-[10px] font-normal",children:["(",t.children.size,")"]})]}),f&&!m?u.jsx("ul",{children:Array.from(t.children.values()).map(h=>u.jsx(aC,{node:h,depth:1,onSelect:s,forceOpen:o},h.fullPath))}):null]})}function aC({node:e,depth:t,onSelect:s,forceOpen:r}){const[o,l]=E.useState(!0),d=r||o,f=e.children.size>0,m=e.branch,h={paddingLeft:`${t*10}px`};return!f&&m?u.jsx("li",{children:u.jsxs("button",{type:"button",onClick:()=>s(m),style:h,title:m.name,className:`flex w-full items-center gap-1.5 py-0.5 pr-2 text-left text-[12px] hover:bg-muted/60 ${m.current?"font-semibold text-emerald-700":""}`,children:[u.jsx(Yl,{size:11,className:"shrink-0 opacity-70"}),u.jsx("span",{className:"truncate",children:e.name}),m.current?u.jsx("span",{className:"text-[10px]",children:"●"}):null]})}):u.jsxs("li",{children:[u.jsxs("button",{type:"button",onClick:()=>{m?s(m):l(_=>!_)},style:h,className:"flex w-full items-center gap-1 py-0.5 pr-2 text-left text-[12px] hover:bg-muted/60",children:[f?d?u.jsx(Pn,{size:11}):u.jsx(ga,{size:11}):u.jsx("span",{className:"inline-block w-[11px]"}),u.jsx("span",{className:"truncate",children:e.name})]}),d&&f?u.jsx("ul",{children:Array.from(e.children.values()).map(_=>u.jsx(aC,{node:_,depth:t+1,onSelect:s,forceOpen:r},_.fullPath))}):null]})}function Vj({selectedCommit:e,selectedFile:t,diff:s,diffLoading:r,diffError:o}){return u.jsxs("section",{className:"flex min-h-0 min-w-0 flex-col bg-white border-b border-border",children:[u.jsx("div",{className:"flex shrink-0 items-center justify-between gap-3 border-b border-border px-3 py-1.5",children:u.jsxs("div",{className:"min-w-0",children:[u.jsx("h2",{className:"truncate text-[13px] font-semibold tracking-tight",children:t??(e?e.subject:"Commit")}),e?u.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[10px] text-muted-foreground",children:[u.jsx("span",{className:"font-mono",children:e.hash.slice(0,12)}),u.jsxs("span",{children:[e.author," <",e.email,">"]}),u.jsx("span",{children:new Date(e.timestamp*1e3).toLocaleString()})]}):null]})}),u.jsx("div",{className:"relative min-h-0 min-w-0 flex-1",children:o?u.jsx("div",{className:"p-4",children:u.jsx(ht,{variant:"destructive",children:o})}):e?r?u.jsx("div",{className:"p-4 text-[12px] text-muted-foreground",children:"Loading diff…"}):s?u.jsx(nC,{activeHunkIndex:0,diff:s}):u.jsx("div",{className:"p-4",children:u.jsx(ht,{variant:"muted",className:"border-dashed p-6 text-center",children:e.parents.length>1?"Merge commit with no conflict resolution — no diff against the first parent.":"No textual changes in this commit."})}):u.jsx("div",{className:"p-4",children:u.jsx(ht,{variant:"muted",className:"border-dashed p-12 text-center",children:"Select a commit to inspect its diff."})})})]})}function $j({files:e,filesError:t,selectedHash:s,selectedFile:r,onSelect:o}){return u.jsxs("aside",{className:"flex min-h-0 flex-col overflow-hidden border-r border-border",children:[u.jsx("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-1.5",children:u.jsxs("h2",{className:"text-[13px] font-semibold tracking-tight",children:["Files",e.length?u.jsx("span",{className:"ml-2 text-[11px] font-normal text-muted-foreground",children:e.length}):null]})}),u.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:t?u.jsx("div",{className:"p-3",children:u.jsx(ht,{variant:"destructive",children:t})}):s?e.length===0?u.jsx("div",{className:"p-3 text-[12px] text-muted-foreground",children:"No file changes."}):u.jsx("ul",{className:"divide-y divide-border",children:e.map(l=>u.jsx("li",{children:u.jsxs("button",{onClick:()=>o(l.path),type:"button",title:l.path,className:`flex w-full items-center gap-2 px-2 py-1 text-left text-[12px] transition-colors hover:bg-muted/60 ${r===l.path?"bg-muted":""}`,children:[u.jsx("span",{className:qj(l.index),children:l.index.trim()||"·"}),u.jsx("span",{className:"truncate font-mono",children:l.path})]})},l.path))}):u.jsx("div",{className:"p-3 text-[12px] text-muted-foreground",children:"Select a commit to see its files."})})]})}function qj(e){const t="inline-flex h-4 w-4 shrink-0 items-center justify-center rounded text-[10px] font-bold";switch(e.trim().toUpperCase()){case"A":return`${t} bg-emerald-100 text-emerald-800`;case"D":return`${t} bg-red-100 text-red-800`;case"M":return`${t} bg-amber-100 text-amber-800`;case"R":return`${t} bg-blue-100 text-blue-800`;case"C":return`${t} bg-indigo-100 text-indigo-800`;default:return`${t} bg-slate-100 text-slate-700`}}const kS=["#3b82f6","#10b981","#f59e0b","#ec4899","#8b5cf6","#14b8a6","#ef4444","#84cc16"];function Ll(e){return kS[e%kS.length]}function Kj({lane:e,laneCount:t,edges:s,throughLanes:r,isMerge:o,height:l=28,laneWidth:d=14}){const m=Math.max(e+1,t,1)*d,h=l/2,_=jl(e,d),v=o?4:3.5;return u.jsxs("svg",{width:m,height:l,viewBox:`0 0 ${m} ${l}`,style:{flex:"0 0 auto",display:"block"},children:[r.map(b=>u.jsx("line",{x1:jl(b,d),y1:0,x2:jl(b,d),y2:l,stroke:Ll(b),strokeWidth:1.5},`t-${b}`)),u.jsx("line",{x1:_,y1:0,x2:_,y2:h,stroke:Ll(e),strokeWidth:1.5}),s.map((b,y)=>{const x=jl(b.fromLane,d),w=jl(b.toLane,d);if(x===w)return u.jsx("line",{x1:x,y1:h,x2:w,y2:l,stroke:Ll(b.toLane),strokeWidth:1.5},`e-${y}`);const N=h+(l-h)/2;return u.jsx("path",{d:`M ${x} ${h} C ${x} ${N}, ${w} ${N}, ${w} ${l}`,fill:"none",stroke:Ll(b.toLane),strokeWidth:1.5},`e-${y}`)}),u.jsx("circle",{cx:_,cy:h,r:v,fill:Ll(e),stroke:"var(--background, #fff)",strokeWidth:1.5})]})}function jl(e,t){return e*t+t/2}const TS=28;function Gj({commits:e,loading:t,error:s,selectedHash:r,maxLanes:o,rowRefs:l,onSelect:d,onLoadMore:f}){return u.jsxs("aside",{className:"flex min-h-0 flex-col overflow-hidden border-r border-border",children:[u.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-1.5",children:[u.jsxs("h2",{className:"text-[13px] font-semibold tracking-tight",children:["Commit tree",e.length?u.jsxs("span",{className:"ml-2 text-[11px] font-normal text-muted-foreground",children:[e.length," commits"]}):null]}),u.jsx(fe,{disabled:t,onClick:f,size:"sm",type:"button",variant:"outline",children:"Load more"})]}),u.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:s?u.jsx("div",{className:"p-3",children:u.jsx(ht,{variant:"destructive",children:s})}):t&&e.length===0?u.jsx("div",{className:"p-3 text-[12px] text-muted-foreground",children:"Loading commits…"}):e.length===0?u.jsx("div",{className:"p-3 text-[12px] text-muted-foreground",children:"No commits."}):u.jsx("ul",{className:"divide-y divide-border",children:e.map(m=>u.jsx("li",{ref:h=>{h?l.current.set(m.hash,h):l.current.delete(m.hash)},children:u.jsxs("button",{onClick:()=>d(m.hash),type:"button",className:`flex w-full items-center gap-2 px-2 py-0.5 text-left transition-colors hover:bg-muted/60 ${r===m.hash?"bg-muted":""}`,style:{minHeight:TS},title:`${m.hash}
|
|
44
|
-
${m.author} <${m.email}>
|
|
45
|
-
${m.subject}`,children:[u.jsx(Kj,{lane:m.lane,laneCount:Math.max(m.laneCount,o),edges:m.edges,throughLanes:m.throughLanes,isMerge:m.parents.length>1,height:TS}),u.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:m.hash.slice(0,7)}),u.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:[m.refs.map(h=>u.jsx("span",{className:Yj(h.kind),children:h.name},`${h.kind}-${h.name}`)),u.jsx("span",{className:"truncate text-[12px]",children:m.subject})]}),u.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:m.author}),u.jsx("span",{className:"shrink-0 font-mono text-[10px] tabular-nums text-muted-foreground/70",title:new Date(m.timestamp*1e3).toLocaleString(),children:Wj(m.timestamp)})]})},m.hash))})})]})}function Wj(e){if(!e)return"";const t=Math.max(0,Math.floor(Date.now()/1e3-e));if(t<60)return`${t}s`;const s=Math.floor(t/60);if(s<60)return`${s}m`;const r=Math.floor(s/60);if(r<24)return`${r}h`;const o=Math.floor(r/24);if(o<30)return`${o}d`;const l=Math.floor(o/30);return l<12?`${l}mo`:`${Math.floor(l/12)}y`}function Yj(e){const t="rounded px-1.5 py-px text-[10px] font-medium";switch(e){case"head":return`${t} bg-emerald-100 text-emerald-800`;case"branch":return`${t} bg-blue-100 text-blue-800`;case"remote":return`${t} bg-slate-100 text-slate-700`;case"tag":return`${t} bg-amber-100 text-amber-800`}}const MS=200;function Xj(){const[e,t]=E.useState([]),[s,r]=E.useState(MS),[o,l]=E.useState(!0),[d,f]=E.useState(null),[m,h]=E.useState(null),[_,v]=E.useState([]),[b,y]=E.useState(null),[x,w]=E.useState(null),[N,A]=E.useState(""),[R,T]=E.useState(!1),[M,z]=E.useState(null);E.useEffect(()=>{let O=!0;return l(!0),f(null),X5(s).then(K=>{O&&(t(K),K.length>0&&!K.some(H=>H.hash===m)&&h(K[0].hash))}).catch(K=>{O&&f(K instanceof Error?K.message:String(K))}).finally(()=>{O&&l(!1)}),()=>{O=!1}},[s]),E.useEffect(()=>{if(!m){v([]),w(null);return}let O=!0;return y(null),Q5(m).then(K=>{O&&(v(K),w(K[0]?.path??null))}).catch(K=>{O&&y(K instanceof Error?K.message:String(K))}),()=>{O=!1}},[m]),E.useEffect(()=>{if(!m){A("");return}let O=!0;return z(null),T(!0),Z5(m,x??void 0).then(K=>{O&&A(K)}).catch(K=>{O&&z(K instanceof Error?K.message:String(K))}).finally(()=>{O&&T(!1)}),()=>{O=!1}},[m,x]);const U=E.useMemo(()=>e.reduce((O,K)=>Math.max(O,K.laneCount),1),[e]),j=e.find(O=>O.hash===m)??null;return{commits:e,loading:o,error:d,selectedHash:m,setSelectedHash:h,files:_,filesError:b,selectedFile:x,setSelectedFile:w,diff:N,diffLoading:R,diffError:M,maxLanes:U,selectedCommit:j,loadMore:()=>r(O=>O+MS)}}function Zj({branches:e=[]}){const{commits:t,loading:s,error:r,selectedHash:o,setSelectedHash:l,files:d,filesError:f,selectedFile:m,setSelectedFile:h,diff:_,diffLoading:v,diffError:b,maxLanes:y,selectedCommit:x,loadMore:w}=Xj(),[N,A]=E.useState(""),R=E.useMemo(()=>{const O=N.trim().toLowerCase();return O?e.filter(K=>K.name.toLowerCase().includes(O)):e},[e,N]),T=E.useMemo(()=>CS(R.filter(O=>!O.remote)),[R]),M=E.useMemo(()=>CS(R.filter(O=>O.remote)),[R]),z=N.trim().length>0,U=E.useRef(new Map);function j(O){const K=O.remote?"remote":"branch",H=t.find(J=>J.refs.some(I=>I.kind===K&&I.name===O.name));if(!H)return;l(H.hash);const G=U.current.get(H.hash);G&&G.scrollIntoView({block:"center",behavior:"smooth"})}return u.jsxs("div",{className:"grid h-full min-h-0 overflow-hidden border-0 bg-card/85 grid-cols-[220px_minmax(0,1fr)]",children:[u.jsxs("aside",{className:"flex min-h-0 flex-col overflow-hidden border-r border-border",children:[u.jsxs("div",{className:"flex shrink-0 flex-col gap-1 border-b border-border px-3 py-1.5",children:[u.jsx("h2",{className:"text-[13px] font-semibold tracking-tight",children:"Branches"}),u.jsx("input",{type:"search",value:N,onChange:O=>A(O.target.value),placeholder:"Search branches…",className:"w-full rounded border border-border bg-background px-2 py-1 text-[11px] outline-none focus:border-foreground"})]}),u.jsxs("div",{className:"min-h-0 flex-1 overflow-auto py-1",children:[u.jsx(NS,{label:"Local",tree:T,onSelect:j,defaultOpen:!0,forceOpen:z}),u.jsx(NS,{label:"Remote",tree:M,onSelect:j,forceOpen:z})]})]}),u.jsxs("div",{className:"grid min-h-0 min-w-0 grid-rows-[minmax(0,3fr)_minmax(0,2fr)]",children:[u.jsx(Vj,{selectedCommit:x,selectedFile:m,diff:_,diffLoading:v,diffError:b}),u.jsxs("div",{className:"grid min-h-0 min-w-0 grid-cols-[minmax(0,1fr)_280px]",children:[u.jsx(Gj,{commits:t,loading:s,error:r,selectedHash:o,maxLanes:y,rowRefs:U,onSelect:l,onLoadMore:w}),u.jsx($j,{files:d,filesError:f,selectedHash:o,selectedFile:m,onSelect:h})]})]})]})}function Qj({data:e}){const[t,s]=E.useState("changes"),[r,o]=E.useState("changes"),[l,d]=E.useState(e.git.status?.files[0]?.path??""),[f,m]=E.useState(""),[h,_]=E.useState([]),[v,b]=E.useState(null),[y,x]=E.useState(""),[w,N]=E.useState(null),[A,R]=E.useState(0),[T,M]=E.useState(null),z=e.git.status?.files??[],U=E.useMemo(()=>z.map(Z=>Z.path),[z]),j=E.useMemo(()=>H9(y),[y]);E.useEffect(()=>{const Z=e.git.status?.files[0]?.path??"";d(W=>W&&e.git.status?.files.some(D=>D.path===W)?W:Z)},[e.git.status?.files]),E.useEffect(()=>{if(r!=="all"||h.length>0)return;let Z=!0;return b(null),J5().then(W=>{Z&&_(W)}).catch(W=>{Z&&b(W instanceof Error?W.message:String(W))}),()=>{Z=!1}},[r,h.length]),E.useEffect(()=>{if(!l){x("");return}let Z=!0;return N(null),tT(l).then(W=>{Z&&(x(W),R(0),M(null))}).catch(W=>{Z&&N(W instanceof Error?W.message:String(W))}),()=>{Z=!1}},[l]);function O(Z){R(0),M(null),d(Z)}function K(){const Z=Fj({activeHunkIndex:A,filePaths:U,hunkCount:j.hunks,pendingNextFilePath:T,selectedFile:l});Z.kind==="hunk"?(M(null),R(Z.activeHunkIndex)):Z.kind==="confirm-next-file"?M(Z.filePath):Z.kind==="file"?O(Z.filePath):M(null)}function H(){if(M(null),A>0){R(D=>D-1);return}const Z=z.findIndex(D=>D.path===l),W=z[Z-1];W&&O(W.path)}const G=z.findIndex(Z=>Z.path===l),J=!!(j.hunks&&A<j.hunks-1||z[G+1]),I=!!(A>0||z[G-1]),ee=T?`End of file. Click Next again to open ${T}.`:null,q=Z=>`rounded px-2 py-0.5 text-[11px] font-medium transition-colors ${Z?"bg-foreground text-background":"text-muted-foreground hover:text-foreground"}`,k=Z=>`flex-1 px-2 py-0.5 text-[11px] font-medium transition-colors ${Z?"bg-foreground text-background":"text-muted-foreground hover:text-foreground"}`,F=E.useMemo(()=>new Set(z.map(Z=>Z.path)),[z]);function V(){f&&(o("changes"),O(f))}return u.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-card/85",children:[u.jsxs("div",{className:"flex shrink-0 items-center gap-1 border-b border-border bg-card/95 px-3 py-1",children:[u.jsx("button",{type:"button",className:q(t==="changes"),onClick:()=>s("changes"),children:"Changes"}),u.jsx("button",{type:"button",className:q(t==="graph"),onClick:()=>s("graph"),children:"Tree"})]}),u.jsx("div",{className:"min-h-0 flex-1",children:t==="graph"?u.jsx(Zj,{branches:e.git.branches??[]}):u.jsxs("div",{className:"grid h-full min-h-0 overflow-hidden border-0 bg-card/85 xl:grid-cols-[320px_minmax(0,1fr)]",children:[u.jsxs("aside",{className:"flex min-h-0 flex-col overflow-hidden",children:[u.jsxs("div",{className:"flex shrink-0 gap-0.5 border-b border-border bg-card/95 p-1",children:[u.jsx("button",{className:k(r==="changes"),onClick:()=>o("changes"),type:"button",children:"Changes"}),u.jsx("button",{className:k(r==="all"),onClick:()=>o("all"),type:"button",children:"All files"})]}),r==="changes"?u.jsx(q9,{branch:e.git.status?.branch||void 0,error:e.git.error,files:e.git.status?.files??[],selectedFile:l,onSelectFile:O,root:e.git.cwd}):v?u.jsx(ht,{variant:"destructive",className:"m-3",children:v}):u.jsx(Z9,{branch:e.git.status?.branch||void 0,onSelectFile:m,paths:h,root:e.git.cwd,selectedFile:f,status:e.git.status?.files??[]})]}),r==="all"?u.jsx(Hj,{isModified:F.has(f),onViewDiff:V,path:f}):u.jsxs("section",{className:"flex min-h-0 min-w-0 flex-col border-l border-border bg-white",children:[u.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-3 border-b border-border px-3 py-1.5",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("h2",{className:"truncate text-[13px] font-semibold tracking-tight",children:l||"Diff"}),u.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[10px] text-muted-foreground",children:[u.jsx("span",{children:"Long rows wrap inside the editor pane."}),j.additions||j.deletions?u.jsxs("span",{className:"flex items-center gap-1 font-mono",children:[u.jsxs("span",{className:"text-emerald-700",children:["+",j.additions]}),u.jsxs("span",{className:"text-red-700",children:["-",j.deletions]})]}):null]})]}),u.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[ee?u.jsx("span",{className:"max-w-72 truncate rounded border border-amber-200 bg-amber-50 px-2 py-1 text-[11px] text-amber-900",children:ee}):null,u.jsxs(fe,{disabled:!l||!I,onClick:H,size:"sm",type:"button",variant:"outline",children:[u.jsx(TN,{}),"Previous"]}),u.jsxs(fe,{disabled:!l||!J,onClick:K,size:"sm",type:"button",variant:"outline",children:[u.jsx(NN,{}),"Next"]})]})]}),u.jsx("div",{className:"relative min-h-0 min-w-0 flex-1",children:w?u.jsx("div",{className:"p-4",children:u.jsx(ht,{variant:"destructive",children:w})}):l?u.jsx(nC,{activeHunkIndex:A,diff:y||"No unstaged diff for this file."}):u.jsx("div",{className:"p-4",children:u.jsx(ht,{variant:"muted",className:"border-dashed p-12 text-center",children:"Select a changed file to inspect its diff."})})})]})]})})]})}function Jj({initialPath:e,onSelect:t,selectedPath:s}){const[r,o]=E.useState(e),[l,d]=E.useState(null),[f,m]=E.useState(null),[h,_]=E.useState(!1),v=eB(l);return E.useEffect(()=>{o(e)},[e]),E.useEffect(()=>{let b=!0;return _(!0),m(null),ZS(r).then(y=>{b&&(d(y),t(y.path))}).catch(y=>{b&&m(y instanceof Error?y.message:String(y))}).finally(()=>{b&&_(!1)}),()=>{b=!1}},[r,t]),u.jsxs("div",{className:"rounded-md border border-border bg-background",children:[u.jsxs("div",{className:"flex items-center gap-2 border-b border-border p-2",children:[v?u.jsx(fe,{"aria-label":"Open parent folder",onClick:()=>l&&o(l.parent),size:"icon",type:"button",variant:"ghost",children:u.jsx(Pn,{className:"rotate-90"})}):null,u.jsx("div",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:l?.path??r}),h?u.jsx(Zs,{className:"size-4 animate-spin text-muted-foreground"}):null]}),u.jsxs("div",{className:"max-h-56 overflow-auto p-1",children:[f?u.jsx(ht,{variant:"destructive",className:"m-1",children:f}):null,!f&&l?.entries.length===0?u.jsx(ht,{variant:"muted",className:"m-1 text-center",children:"No folders here."}):null,l?.entries.map(b=>u.jsxs(fe,{className:pe("h-8 w-full justify-start rounded-sm px-2 text-left",s===b.path&&"bg-muted"),onClick:()=>o(b.path),title:b.path,type:"button",variant:"ghost",children:[u.jsx(_a,{className:"text-accent"}),u.jsx("span",{className:"truncate",children:b.name})]},b.path))]})]})}function eB(e){return!!(e&&e.parent!==e.path)}function AS(e){return e.split(/[\\/]/).filter(Boolean).pop()??"project"}function tB({data:e,onRefresh:t}){const[s,r]=E.useState(!1),[o,l]=E.useState(e.git.cwd),[d,f]=E.useState(null),[m,h]=E.useState(!1),[_,v]=E.useState(e.git.cwd),b=E.useRef(null),y=e.git.selectedRepository,x=y?.name??AS(e.git.cwd),{error:w,success:N}=ls(),A=sB({gitCwd:e.git.cwd});E.useEffect(()=>{l(e.git.cwd),v(e.git.cwd)},[e.git.cwd]),E.useEffect(()=>{if(!s)return;function j(O){b.current&&O.target instanceof Node&&!b.current.contains(O.target)&&r(!1)}return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[s]);async function R(j){try{await Gi("/api/git/select",{name:j}),r(!1),await t(),N(`Switched to ${j}.`)}catch(O){w(O instanceof Error?O.message:String(O))}}async function T(j){const O=j.trim();if(!iB(O)){const K="Please add an absolute path. Paths beginning with ~ are not expanded here.";return f(K),w(K),!1}try{const K=AS(O);return await Gi("/api/git/repositories",{name:K,path:O}),f(null),await t(),N(`Added Git project ${K}.`),!0}catch(K){const H=K instanceof Error?K.message:String(K);return f(H),w(H),!1}}async function M(j){try{await iT(j),await t(),N(`Removed Git project ${j}.`)}catch(O){w(O instanceof Error?O.message:String(O))}}async function z(j){j.preventDefault(),await T(o)&&r(!1)}function U(){f(null),v(A.selectedPath),h(!0)}return u.jsxs("div",{className:"relative z-50 flex items-center gap-2",ref:b,children:[u.jsxs(fe,{className:"max-w-[220px] justify-start gap-2 rounded-md border-border bg-card",onClick:()=>r(j=>!j),size:"sm",type:"button",variant:"outline",children:[u.jsx(_a,{className:"text-muted-foreground"}),u.jsx("span",{className:"truncate",children:x}),u.jsx(Pn,{className:pe("ml-auto transition-transform",s&&"rotate-180")})]}),u.jsx(fe,{"aria-label":"Add Git project",onClick:U,size:"sm",type:"button",variant:"outline",children:u.jsx(Es,{})}),s?u.jsxs("div",{className:"absolute right-0 top-10 z-50 w-[min(380px,calc(100vw-2rem))] overflow-hidden rounded-lg border border-border bg-card shadow-lg",children:[u.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-3 py-2",children:[u.jsx(ZN,{className:"size-3.5 text-muted-foreground"}),u.jsx("div",{className:"text-xs font-semibold",children:"Git Projects"}),u.jsx(Ve,{className:"ml-auto h-5 px-1.5 text-[10px]",variant:"outline",children:e.config.gitRepositories.length})]}),u.jsx("div",{className:"max-h-72 overflow-auto",children:e.config.gitRepositories.length?u.jsx("div",{className:"divide-y divide-border",children:e.config.gitRepositories.map(j=>{const O=j.name===y?.name;return u.jsxs("div",{className:pe("group grid w-full grid-cols-[1fr_auto_auto] items-center gap-2 px-3 py-1.5 text-left transition-colors hover:bg-muted",O&&"bg-muted/70"),children:[u.jsxs("button",{className:"min-w-0 text-left",onClick:()=>{R(j.name)},type:"button",children:[u.jsx("span",{className:"block truncate text-sm font-medium leading-tight",children:j.name}),u.jsx("span",{className:"block truncate font-mono text-[10px] leading-tight text-muted-foreground",children:j.path})]}),O?u.jsx(ac,{className:"size-3.5"}):u.jsx("span",{className:"size-3.5"}),u.jsx(fe,{"aria-label":`Remove ${j.name}`,className:"size-6 opacity-0 transition-opacity group-hover:opacity-100",onClick:()=>{M(j.name)},size:"icon",title:`Remove ${j.name}`,type:"button",variant:"ghost",children:u.jsx(lc,{className:"size-3.5 text-destructive"})})]},j.name)})}):u.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"No saved Git projects yet."})}),u.jsxs("div",{className:"border-t border-border bg-muted/20 p-2",children:[u.jsxs("form",{className:"flex gap-1.5",onSubmit:z,children:[u.jsx(bt,{"aria-label":"Paste absolute path",className:"h-7 flex-1 px-2 font-mono text-[11px]",onChange:j=>{l(j.target.value),f(null)},placeholder:"/absolute/path",value:o}),u.jsxs(fe,{className:"h-7 px-2 text-[11px]",size:"sm",type:"submit",children:[u.jsx(Es,{className:"size-3"}),"Add"]}),u.jsx(fe,{"aria-label":"Browse and add Git project",className:"h-7 px-2",onClick:U,size:"sm",type:"button",variant:"outline",children:u.jsx(hk,{className:"size-3"})})]}),d?u.jsx("div",{className:"mt-1.5 truncate text-[10px] text-destructive",children:d}):null]})]}):null,m?u.jsx(nB,{confirmLabel:A.confirmLabel,errorMessage:d,initialPath:A.initialPath,selectedPath:_,title:"Add Git Project",onCancel:()=>h(!1),onSelect:v,onUse:async()=>{await T(_)&&(h(!1),r(!1))}}):null]})}function iB(e){return e.startsWith("/")}function sB({gitCwd:e}){return{confirmLabel:"Add Git project",initialPath:e,selectedPath:e}}function nB({confirmLabel:e="Use this folder",errorMessage:t,initialPath:s,onCancel:r,onSelect:o,onUse:l,selectedPath:d,title:f="Choose Git Project Folder"}){return s0.createPortal(u.jsx("div",{className:"fixed inset-0 z-[1000] grid place-items-center bg-black/35 px-4",children:u.jsxs("div",{className:"w-full max-w-2xl rounded-xl border border-border bg-card p-4 shadow-xl",children:[u.jsxs("div",{className:"mb-3 flex items-center gap-3",children:[u.jsx("div",{className:"flex size-8 items-center justify-center rounded-lg border border-border bg-background",children:u.jsx(_a,{className:"size-4"})}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("div",{className:"text-sm font-semibold",children:f}),u.jsx("div",{className:"truncate font-mono text-xs text-muted-foreground",children:d})]}),u.jsx(fe,{"aria-label":"Close folder picker",onClick:r,size:"icon",variant:"ghost",children:u.jsx(rn,{})})]}),u.jsx(Jj,{initialPath:s,onSelect:o,selectedPath:d}),t?u.jsx("div",{className:"mt-3 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive",children:t}):null,u.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[u.jsx(fe,{onClick:r,type:"button",variant:"outline",children:"Cancel"}),u.jsx(fe,{onClick:()=>{l()},type:"button",children:e})]})]})}),document.body)}function rB({branches:e,currentBranch:t,disabled:s,onRefresh:r}){const[o,l]=E.useState(!1),[d,f]=E.useState(""),[m,h]=E.useState(null),[_,v]=E.useState(null),[b,y]=E.useState(null),x=e.filter(M=>!M.remote),w=e.filter(M=>M.remote);async function N(M,z){h(M),y(null),v(null);try{await z(),await r()}catch(U){y(U instanceof Error?U.message:String(U))}finally{h(null)}}async function A(M){await N(`switch:${M}`,async()=>{await Gi("/api/git/branches/switch",{name:M}),l(!1)})}async function R(){await N("fetch",async()=>{await Gi("/api/git/fetch",{}),v("Fetched latest branch refs.")})}async function T(M){M.preventDefault();const z=d.trim();if(!z){y("Branch name is required.");return}await N("create",async()=>{await Gi("/api/git/branches",{name:z}),f(""),l(!1)})}return u.jsxs("div",{className:"fixed bottom-12 right-4 z-50 flex items-end",children:[o?u.jsxs("div",{"aria-label":"Switch Git branch",className:"mb-11 w-[min(460px,calc(100vw-2rem))] rounded-lg border border-border bg-card shadow-xl",role:"dialog",children:[u.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-border p-3",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[u.jsx(Yl,{className:"size-4 text-muted-foreground"}),u.jsx("span",{className:"truncate text-sm font-semibold",children:t||"Branches"})]}),u.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[u.jsx(fe,{"aria-label":"Fetch branches",disabled:s||m!==null,onClick:()=>{R()},size:"icon",title:"Fetch branches",type:"button",variant:"ghost",children:u.jsx(VS,{className:pe(m==="fetch"&&"animate-spin")})}),u.jsx(fe,{"aria-label":"Close branch dialog",onClick:()=>l(!1),size:"icon",type:"button",variant:"ghost",children:u.jsx(rn,{})})]})]}),u.jsx("div",{className:"max-h-72 overflow-auto",children:e.length?u.jsxs(u.Fragment,{children:[u.jsx(RS,{branches:x,busy:m!==null,disabled:s,label:"Local",onSwitch:A}),u.jsx(RS,{branches:w,busy:m!==null,disabled:s,label:"Remote",onSwitch:A})]}):u.jsx("div",{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"No branches found."})}),u.jsxs("div",{className:"border-t border-border p-3",children:[u.jsxs("form",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",onSubmit:T,children:[u.jsx(bt,{"aria-label":"New branch name",disabled:s||m!==null,onChange:M=>{f(M.target.value),y(null),v(null)},placeholder:"feature/new-work",value:d}),u.jsxs(fe,{disabled:s||m!==null,type:"submit",children:[u.jsx(bk,{}),"Create"]})]}),b||_?u.jsx(ht,{className:"mt-3 px-3 py-2 text-xs",variant:b?"destructive":"muted",children:b??_}):null]})]}):null,u.jsxs(fe,{className:"h-8 max-w-[260px] gap-2 rounded-md shadow-lg",disabled:s,onClick:()=>l(M=>!M),size:"sm",title:"Switch Git branch",type:"button",variant:"default",children:[u.jsx(Yl,{className:"size-4"}),u.jsx("span",{className:"truncate font-mono text-xs",children:t||"No branch"}),u.jsx(Pn,{className:pe("size-4 transition-transform",o&&"rotate-180")})]})]})}function RS({branches:e,busy:t,disabled:s,label:r,onSwitch:o}){return u.jsxs("section",{children:[u.jsx("div",{className:"border-b border-border bg-muted/60 px-3 py-1.5 text-[11px] font-semibold uppercase text-muted-foreground",children:r}),e.length?e.map(l=>u.jsxs("button",{className:pe("grid w-full grid-cols-[1fr_auto] items-center gap-2 border-b border-border px-3 py-2 text-left text-sm last:border-b-0 hover:bg-muted",l.current&&"bg-muted/70"),disabled:s||t||l.current,onClick:()=>{o(l.name)},type:"button",children:[u.jsxs("span",{className:"min-w-0",children:[u.jsx("span",{className:"block truncate font-medium",children:l.name}),l.upstream?u.jsxs("span",{className:"block truncate font-mono text-[11px] text-muted-foreground",children:["tracks ",l.upstream]}):null]}),u.jsx(Ve,{variant:l.current?"success":l.remote?"outline":"secondary",children:l.current?"current":l.remote?"remote":"local"})]},`${l.remote?"remote":"local"}:${l.name}`)):u.jsxs("div",{className:"border-b border-border px-3 py-3 text-sm text-muted-foreground",children:["No ",r.toLowerCase()," branches."]})]})}function aB(e=!1){return pe("group/sidebar hidden h-full shrink-0 overflow-x-hidden overflow-y-auto border-r border-border bg-card/85 py-5 backdrop-blur transition-[width,padding] duration-200 md:flex md:flex-col",e?"w-64 px-4":"w-16 px-2 hover:w-64 hover:px-4")}function oB(e,t=!1){return pe("relative grid h-12 grid-cols-[48px_minmax(0,1fr)] items-center justify-start gap-0 overflow-hidden rounded-md px-0 text-[15px] font-medium transition-[background-color,color,width] duration-150",t?"w-full":"w-12 group-hover/sidebar:w-full",e?"bg-primary text-primary-foreground hover:bg-primary/90":"hover:bg-muted")}function lB(e=!1,t=!1){return pe("min-w-0 overflow-hidden text-left text-current transition duration-150 whitespace-pre",e?"translate-x-1 opacity-100":"opacity-0 group-hover/sidebar:translate-x-1 group-hover/sidebar:opacity-100",t?"pr-10":"pr-3")}function cB(e=!1){return pe("flex size-12 items-center justify-center text-current transition-transform duration-150 [&_svg]:size-5",e?"translate-x-0":"-translate-x-px group-hover/sidebar:translate-x-0")}function uB({docked:e,onToggleDock:t}){return u.jsxs("div",{className:pe("mt-auto flex h-10 min-w-0 items-center overflow-hidden border-t border-border/60 text-[11px] text-muted-foreground transition-[height,opacity,width] duration-150",e?"w-full justify-start opacity-100":"w-12 justify-center group-hover/sidebar:w-full group-hover/sidebar:justify-start group-hover/sidebar:opacity-100"),children:[u.jsxs("span",{className:pe("flex min-w-0 items-center gap-1.5 overflow-hidden whitespace-pre transition-[opacity,width] duration-150",e?"flex-1 opacity-100":"w-0 flex-none opacity-0 group-hover/sidebar:w-auto group-hover/sidebar:flex-1 group-hover/sidebar:opacity-100"),children:[u.jsx("span",{children:"Made with"}),u.jsx(xk,{"aria-label":"love",className:"size-3 shrink-0 fill-red-500 text-red-500"}),u.jsx("span",{children:"by Robert Wang"}),u.jsx("a",{"aria-label":"Robert Wang on LinkedIn",className:"shrink-0 rounded p-0.5 text-muted-foreground transition-colors hover:bg-muted hover:text-[#0A66C2]",href:"https://www.linkedin.com/in/robert-wang-cs/",rel:"noopener noreferrer",target:"_blank",title:"LinkedIn",children:u.jsx("svg",{"aria-hidden":!0,className:"size-3 fill-current",role:"img",viewBox:"0 0 24 24",children:u.jsx("path",{d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.063 2.063 0 1 1 0-4.126 2.063 2.063 0 0 1 0 4.126zM7.119 20.452H3.554V9h3.565v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.225 0z"})})})]}),u.jsx("button",{"aria-label":e?"Undock sidebar":"Dock sidebar","aria-pressed":e,className:pe("flex size-8 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground [&_svg]:size-4",e?"ml-auto bg-muted text-foreground":"group-hover/sidebar:ml-auto"),onClick:t,title:e?"Undock sidebar":"Dock sidebar",type:"button",children:e?u.jsx(Vk,{}):u.jsx(qk,{})})]})}function dB({className:e}){return u.jsxs("div",{className:pe("min-w-0",e),children:[u.jsxs("div",{className:"flex items-baseline gap-1.5",children:[u.jsx("div",{className:"text-sm font-semibold",children:"NoMoreIDE"}),u.jsxs("div",{className:"font-mono text-[10px] text-muted-foreground",children:["v","0.1.33"]})]}),u.jsx("div",{className:"font-mono text-[11px] text-muted-foreground",children:"127.0.0.1 console"})]})}function hB(){const[e,t]=E.useState(()=>window.location.pathname.startsWith("/agent")?"agent":window.location.pathname.startsWith("/errors")?"errors":window.location.pathname.startsWith("/database")?"database":window.location.pathname.startsWith("/terminal")?"terminal":window.location.pathname.startsWith("/git")?"git":"services"),[s,r]=E.useState(null),[o,l]=E.useState(null),[d,f]=E.useState(!0),{error:m,success:h}=ls(),[_,v]=E.useState(()=>window.localStorage.getItem("nomoreide:sidebar-docked")==="true"),b=E.useCallback(async(x={})=>{x.silent||f(!0),l(null);try{r(await rT()),x.notify&&h("Dashboard refreshed.")}catch(w){const N=w instanceof Error?w.message:String(w);l(N),m(N)}finally{f(!1)}},[m,h]);E.useEffect(()=>{b()},[b]),E.useEffect(()=>{function x(){document.visibilityState==="visible"&&b({silent:!0})}const w=window.setInterval(x,5e3);return window.addEventListener("focus",x),document.addEventListener("visibilitychange",x),()=>{window.clearInterval(w),window.removeEventListener("focus",x),document.removeEventListener("visibilitychange",x)}},[e,b]),E.useEffect(()=>{const x=e==="git"?"/git":e==="agent"?"/agent":e==="errors"?"/errors":e==="database"?"/database":e==="terminal"?"/terminal":"/";window.location.pathname!==x&&window.history.pushState(null,"",x)},[e]),E.useEffect(()=>{window.localStorage.setItem("nomoreide:sidebar-docked",String(_))},[_]);const y=E.useMemo(()=>s?Object.values(s.runtime.services).filter(x=>x.state==="running").length:0,[s]);return u.jsxs("div",{className:"h-screen overflow-hidden pb-9",children:[u.jsxs("div",{className:"mx-auto flex h-full max-w-[1500px]",children:[u.jsxs("aside",{className:aB(_),children:[u.jsxs("div",{className:pe("grid h-12 grid-cols-[48px_minmax(0,1fr)] items-center overflow-hidden transition-[width] duration-150",_?"w-full":"w-12 group-hover/sidebar:w-full"),children:[u.jsx("div",{className:"flex size-12 items-center justify-center",children:u.jsx("div",{className:"flex size-9 items-center justify-center overflow-hidden rounded-md bg-primary",children:u.jsx("img",{alt:"NoMoreIDE",className:"size-full object-cover",src:O5})})}),u.jsx(dB,{className:pe("min-w-0 translate-x-1 overflow-hidden transition-opacity duration-200",_?"opacity-100":"opacity-0 group-hover/sidebar:opacity-100")})]}),u.jsxs("nav",{className:"mt-5 grid flex-1 content-start gap-1",children:[u.jsx(co,{active:e==="services",badge:y,docked:_,icon:u.jsx(d5,{}),label:"Services",onClick:()=>t("services")}),u.jsx(co,{active:e==="git",docked:_,icon:u.jsx(Yl,{}),label:"Git Review",onClick:()=>t("git")}),u.jsx(co,{active:e==="errors",docked:_,icon:u.jsx(fp,{}),label:"Error Inbox",onClick:()=>t("errors")}),u.jsx(co,{active:e==="database",docked:_,icon:u.jsx(oc,{}),label:"Database",onClick:()=>t("database")}),u.jsx(co,{active:e==="terminal",docked:_,icon:u.jsx(v5,{}),label:"Terminal",onClick:()=>t("terminal")}),u.jsx(co,{active:e==="agent",docked:_,icon:u.jsx(Wl,{}),label:"Agent",onClick:()=>t("agent")})]}),u.jsx(uB,{docked:_,onToggleDock:()=>v(x=>!x)})]}),u.jsxs("main",{className:"flex h-full min-w-0 flex-1 flex-col px-0 py-0",children:[u.jsxs("header",{className:pe("relative z-40 flex shrink-0 flex-wrap items-center justify-between gap-3 border border-border bg-card/90 px-4 py-3 backdrop-blur","border-x-0 border-t-0 border-b"),children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(Gk,{className:"size-4 text-muted-foreground md:hidden"}),u.jsxs("div",{children:[u.jsx("h1",{className:"text-lg font-semibold tracking-tight",children:e==="git"?"Git Review":e==="agent"?"Agent":e==="errors"?"Error Inbox":e==="database"?"Database":e==="terminal"?"Terminal":"Services"}),u.jsx("p",{className:"font-mono text-xs text-muted-foreground",children:s?.git.selectedRepository?.name??s?.git.cwd??"Local workspace"})]})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[o?u.jsx(Ve,{variant:"danger",children:o}):null,s&&e==="git"?u.jsx(tB,{data:s,onRefresh:b}):null,u.jsxs(fe,{onClick:()=>{b({notify:!0})},size:"sm",title:"Refresh dashboard",variant:"outline",children:[u.jsx(VS,{className:pe(d&&"animate-spin")}),"Refresh"]})]})]}),d&&!s?u.jsx(ht,{variant:"muted",children:"Loading NoMoreIDE state..."}):null,u.jsxs("div",{className:"min-h-0 flex-1 overflow-hidden",children:[s&&e==="services"?u.jsx(x7,{data:s,onRefresh:b}):null,s&&e==="git"?u.jsx(Qj,{data:s}):null,e==="agent"?u.jsx(b8,{}):null,e==="errors"?u.jsx(oD,{}):null,e==="database"?u.jsx(iD,{}):null,e==="terminal"?u.jsx(I9,{}):null]})]})]}),s&&e==="git"?u.jsx(rB,{branches:s.git.branches,currentBranch:s.git.status?.branch||void 0,disabled:!s.git.status,onRefresh:b}):null,u.jsx(B8,{onOpenAgentPage:e==="agent"?void 0:()=>t("agent")})]})}function co({active:e,badge:t,docked:s,icon:r,label:o,onClick:l}){return u.jsxs(fe,{"aria-label":o,title:o,className:oB(e,s),variant:"ghost",onClick:l,type:"button",children:[u.jsx("span",{className:cB(s),children:r}),u.jsx("span",{className:lB(s,t!==void 0),children:o}),t!==void 0?u.jsx(Ve,{appearance:t>0?"solid":"outline",className:pe("min-w-6 justify-center px-1.5 font-mono shadow-none",e?"border-primary-foreground/40 bg-primary-foreground/15 text-primary-foreground":t>0?"":"border-border bg-background text-muted-foreground","absolute right-1.5 top-1.5 h-4 min-w-4 rounded-full px-1 text-[10px] leading-none shadow-none group-hover/sidebar:right-2 group-hover/sidebar:top-1/2 group-hover/sidebar:-translate-y-1/2 group-hover/sidebar:text-xs",s&&"right-2 top-1/2 -translate-y-1/2 text-xs"),size:"small",variant:t>0?"success":"outline",children:t}):null]})}OS.createRoot(document.getElementById("root")).render(u.jsx(E.StrictMode,{children:u.jsx(hB,{})}));
|