nomoreide 0.1.44 → 0.1.46
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/cli/git.js +4 -1
- package/dist/cli/git.js.map +1 -1
- package/dist/core/agent-runtime.d.ts +15 -0
- package/dist/core/agent-runtime.js +39 -3
- package/dist/core/agent-runtime.js.map +1 -1
- package/dist/core/config-store.d.ts +7 -0
- package/dist/core/config-store.js +45 -0
- package/dist/core/config-store.js.map +1 -1
- package/dist/core/git-actions.d.ts +30 -0
- package/dist/core/git-actions.js +58 -0
- package/dist/core/git-actions.js.map +1 -0
- package/dist/core/git-manager.d.ts +13 -0
- package/dist/core/git-manager.js +43 -1
- package/dist/core/git-manager.js.map +1 -1
- package/dist/core/github-manager.d.ts +149 -0
- package/dist/core/github-manager.js +181 -0
- package/dist/core/github-manager.js.map +1 -0
- package/dist/core/repo-onboard.d.ts +2 -2
- package/dist/core/types.d.ts +8 -0
- package/dist/core/workflows.d.ts +204 -0
- package/dist/core/workflows.js +146 -0
- package/dist/core/workflows.js.map +1 -0
- package/dist/mcp/tools/context.d.ts +3 -0
- package/dist/mcp/tools/context.js +5 -0
- package/dist/mcp/tools/context.js.map +1 -1
- package/dist/mcp/tools/git.d.ts +1 -1
- package/dist/mcp/tools/git.js +10 -1
- package/dist/mcp/tools/git.js.map +1 -1
- package/dist/mcp/tools/github.d.ts +4 -0
- package/dist/mcp/tools/github.js +206 -0
- package/dist/mcp/tools/github.js.map +1 -0
- package/dist/mcp/tools/index.d.ts +1 -1
- package/dist/mcp/tools/index.js +3 -0
- package/dist/mcp/tools/index.js.map +1 -1
- package/dist/web/client/assets/{code-editor-NLVWCtZl.js → code-editor-o1tS7fpw.js} +1 -1
- package/dist/web/client/assets/index-CFZyk7FD.js +201 -0
- package/dist/web/client/assets/index-Dcqu3Z0L.css +1 -0
- package/dist/web/client/index.html +2 -2
- package/dist/web/routes/agent-chat-routes.js +3 -0
- package/dist/web/routes/agent-chat-routes.js.map +1 -1
- package/dist/web/routes/git-routes.js +60 -0
- package/dist/web/routes/git-routes.js.map +1 -1
- package/dist/web/routes/github-context.d.ts +9 -0
- package/dist/web/routes/github-context.js +31 -0
- package/dist/web/routes/github-context.js.map +1 -0
- package/dist/web/routes/github-routes.d.ts +2 -0
- package/dist/web/routes/github-routes.js +342 -0
- package/dist/web/routes/github-routes.js.map +1 -0
- package/dist/web/routes/index.js +4 -0
- package/dist/web/routes/index.js.map +1 -1
- package/dist/web/routes/workflow-routes.d.ts +8 -0
- package/dist/web/routes/workflow-routes.js +45 -0
- package/dist/web/routes/workflow-routes.js.map +1 -0
- package/package.json +1 -1
- package/dist/web/client/assets/index-B-5D3C0G.js +0 -197
- package/dist/web/client/assets/index-g1k-tjDx.css +0 -1
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function i(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(a){if(a.ep)return;a.ep=!0;const o=i(a);fetch(a.href,o)}})();function QT(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var sp={exports:{}},lc={};var Kx;function JT(){if(Kx)return lc;Kx=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function i(s,a,o){var u=null;if(o!==void 0&&(u=""+o),a.key!==void 0&&(u=""+a.key),"key"in a){o={};for(var h in a)h!=="key"&&(o[h]=a[h])}else o=a;return a=o.ref,{$$typeof:e,type:s,key:u,ref:a!==void 0?a:null,props:o}}return lc.Fragment=t,lc.jsx=i,lc.jsxs=i,lc}var Gx;function eA(){return Gx||(Gx=1,sp.exports=JT()),sp.exports}var c=eA(),rp={exports:{}},He={};var Wx;function tA(){if(Wx)return He;Wx=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),u=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),_=Symbol.iterator;function x(j){return j===null||typeof j!="object"?null:(j=_&&j[_]||j["@@iterator"],typeof j=="function"?j:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,E={};function C(j,W,he){this.props=j,this.context=W,this.refs=E,this.updater=he||y}C.prototype.isReactComponent={},C.prototype.setState=function(j,W){if(typeof j!="object"&&typeof j!="function"&&j!=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,j,W,"setState")},C.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function A(){}A.prototype=C.prototype;function N(j,W,he){this.props=j,this.context=W,this.refs=E,this.updater=he||y}var M=N.prototype=new A;M.constructor=N,S(M,C.prototype),M.isPureReactComponent=!0;var D=Array.isArray;function U(){}var L={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function $(j,W,he){var oe=he.ref;return{$$typeof:e,type:j,key:W,ref:oe!==void 0?oe:null,props:he}}function I(j,W){return $(j.type,W,j.props)}function F(j){return typeof j=="object"&&j!==null&&j.$$typeof===e}function G(j){var W={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(he){return W[he]})}var Y=/\/+/g;function Q(j,W){return typeof j=="object"&&j!==null&&j.key!=null?G(""+j.key):W.toString(36)}function q(j){switch(j.status){case"fulfilled":return j.value;case"rejected":throw j.reason;default:switch(typeof j.status=="string"?j.then(U,U):(j.status="pending",j.then(function(W){j.status==="pending"&&(j.status="fulfilled",j.value=W)},function(W){j.status==="pending"&&(j.status="rejected",j.reason=W)})),j.status){case"fulfilled":return j.value;case"rejected":throw j.reason}}throw j}function O(j,W,he,oe,me){var ne=typeof j;(ne==="undefined"||ne==="boolean")&&(j=null);var fe=!1;if(j===null)fe=!0;else switch(ne){case"bigint":case"string":case"number":fe=!0;break;case"object":switch(j.$$typeof){case e:case t:fe=!0;break;case p:return fe=j._init,O(fe(j._payload),W,he,oe,me)}}if(fe)return me=me(j),fe=oe===""?"."+Q(j,0):oe,D(me)?(he="",fe!=null&&(he=fe.replace(Y,"$&/")+"/"),O(me,W,he,"",function(Ze){return Ze})):me!=null&&(F(me)&&(me=I(me,he+(me.key==null||j&&j.key===me.key?"":(""+me.key).replace(Y,"$&/")+"/")+fe)),W.push(me)),1;fe=0;var we=oe===""?".":oe+":";if(D(j))for(var ye=0;ye<j.length;ye++)oe=j[ye],ne=we+Q(oe,ye),fe+=O(oe,W,he,ne,me);else if(ye=x(j),typeof ye=="function")for(j=ye.call(j),ye=0;!(oe=j.next()).done;)oe=oe.value,ne=we+Q(oe,ye++),fe+=O(oe,W,he,ne,me);else if(ne==="object"){if(typeof j.then=="function")return O(q(j),W,he,oe,me);throw W=String(j),Error("Objects are not valid as a React child (found: "+(W==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":W)+"). If you meant to render a collection of children, use an array instead.")}return fe}function X(j,W,he){if(j==null)return j;var oe=[],me=0;return O(j,oe,"","",function(ne){return W.call(he,ne,me++)}),oe}function Z(j){if(j._status===-1){var W=j._result;W=W(),W.then(function(he){(j._status===0||j._status===-1)&&(j._status=1,j._result=he)},function(he){(j._status===0||j._status===-1)&&(j._status=2,j._result=he)}),j._status===-1&&(j._status=0,j._result=W)}if(j._status===1)return j._result.default;throw j._result}var V=typeof reportError=="function"?reportError:function(j){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var W=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof j=="object"&&j!==null&&typeof j.message=="string"?String(j.message):String(j),error:j});if(!window.dispatchEvent(W))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",j);return}console.error(j)},P={map:X,forEach:function(j,W,he){X(j,function(){W.apply(this,arguments)},he)},count:function(j){var W=0;return X(j,function(){W++}),W},toArray:function(j){return X(j,function(W){return W})||[]},only:function(j){if(!F(j))throw Error("React.Children.only expected to receive a single React element child.");return j}};return He.Activity=b,He.Children=P,He.Component=C,He.Fragment=i,He.Profiler=a,He.PureComponent=N,He.StrictMode=s,He.Suspense=m,He.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,He.__COMPILER_RUNTIME={__proto__:null,c:function(j){return L.H.useMemoCache(j)}},He.cache=function(j){return function(){return j.apply(null,arguments)}},He.cacheSignal=function(){return null},He.cloneElement=function(j,W,he){if(j==null)throw Error("The argument must be a React element, but you passed "+j+".");var oe=S({},j.props),me=j.key;if(W!=null)for(ne in W.key!==void 0&&(me=""+W.key),W)!R.call(W,ne)||ne==="key"||ne==="__self"||ne==="__source"||ne==="ref"&&W.ref===void 0||(oe[ne]=W[ne]);var ne=arguments.length-2;if(ne===1)oe.children=he;else if(1<ne){for(var fe=Array(ne),we=0;we<ne;we++)fe[we]=arguments[we+2];oe.children=fe}return $(j.type,me,oe)},He.createContext=function(j){return j={$$typeof:u,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null},j.Provider=j,j.Consumer={$$typeof:o,_context:j},j},He.createElement=function(j,W,he){var oe,me={},ne=null;if(W!=null)for(oe in W.key!==void 0&&(ne=""+W.key),W)R.call(W,oe)&&oe!=="key"&&oe!=="__self"&&oe!=="__source"&&(me[oe]=W[oe]);var fe=arguments.length-2;if(fe===1)me.children=he;else if(1<fe){for(var we=Array(fe),ye=0;ye<fe;ye++)we[ye]=arguments[ye+2];me.children=we}if(j&&j.defaultProps)for(oe in fe=j.defaultProps,fe)me[oe]===void 0&&(me[oe]=fe[oe]);return $(j,ne,me)},He.createRef=function(){return{current:null}},He.forwardRef=function(j){return{$$typeof:h,render:j}},He.isValidElement=F,He.lazy=function(j){return{$$typeof:p,_payload:{_status:-1,_result:j},_init:Z}},He.memo=function(j,W){return{$$typeof:f,type:j,compare:W===void 0?null:W}},He.startTransition=function(j){var W=L.T,he={};L.T=he;try{var oe=j(),me=L.S;me!==null&&me(he,oe),typeof oe=="object"&&oe!==null&&typeof oe.then=="function"&&oe.then(U,V)}catch(ne){V(ne)}finally{W!==null&&he.types!==null&&(W.types=he.types),L.T=W}},He.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},He.use=function(j){return L.H.use(j)},He.useActionState=function(j,W,he){return L.H.useActionState(j,W,he)},He.useCallback=function(j,W){return L.H.useCallback(j,W)},He.useContext=function(j){return L.H.useContext(j)},He.useDebugValue=function(){},He.useDeferredValue=function(j,W){return L.H.useDeferredValue(j,W)},He.useEffect=function(j,W){return L.H.useEffect(j,W)},He.useEffectEvent=function(j){return L.H.useEffectEvent(j)},He.useId=function(){return L.H.useId()},He.useImperativeHandle=function(j,W,he){return L.H.useImperativeHandle(j,W,he)},He.useInsertionEffect=function(j,W){return L.H.useInsertionEffect(j,W)},He.useLayoutEffect=function(j,W){return L.H.useLayoutEffect(j,W)},He.useMemo=function(j,W){return L.H.useMemo(j,W)},He.useOptimistic=function(j,W){return L.H.useOptimistic(j,W)},He.useReducer=function(j,W,he){return L.H.useReducer(j,W,he)},He.useRef=function(j){return L.H.useRef(j)},He.useState=function(j){return L.H.useState(j)},He.useSyncExternalStore=function(j,W,he){return L.H.useSyncExternalStore(j,W,he)},He.useTransition=function(){return L.H.useTransition()},He.version="19.2.6",He}var Yx;function ib(){return Yx||(Yx=1,rp.exports=tA()),rp.exports}var k=ib(),ap={exports:{}},cc={},op={exports:{}},lp={};var Xx;function iA(){return Xx||(Xx=1,(function(e){function t(O,X){var Z=O.length;O.push(X);e:for(;0<Z;){var V=Z-1>>>1,P=O[V];if(0<a(P,X))O[V]=X,O[Z]=P,Z=V;else break e}}function i(O){return O.length===0?null:O[0]}function s(O){if(O.length===0)return null;var X=O[0],Z=O.pop();if(Z!==X){O[0]=Z;e:for(var V=0,P=O.length,j=P>>>1;V<j;){var W=2*(V+1)-1,he=O[W],oe=W+1,me=O[oe];if(0>a(he,Z))oe<P&&0>a(me,he)?(O[V]=me,O[oe]=Z,V=oe):(O[V]=he,O[W]=Z,V=W);else if(oe<P&&0>a(me,Z))O[V]=me,O[oe]=Z,V=oe;else break e}}return X}function a(O,X){var Z=O.sortIndex-X.sortIndex;return Z!==0?Z:O.id-X.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var u=Date,h=u.now();e.unstable_now=function(){return u.now()-h}}var m=[],f=[],p=1,b=null,_=3,x=!1,y=!1,S=!1,E=!1,C=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function M(O){for(var X=i(f);X!==null;){if(X.callback===null)s(f);else if(X.startTime<=O)s(f),X.sortIndex=X.expirationTime,t(m,X);else break;X=i(f)}}function D(O){if(S=!1,M(O),!y)if(i(m)!==null)y=!0,U||(U=!0,G());else{var X=i(f);X!==null&&q(D,X.startTime-O)}}var U=!1,L=-1,R=5,$=-1;function I(){return E?!0:!(e.unstable_now()-$<R)}function F(){if(E=!1,U){var O=e.unstable_now();$=O;var X=!0;try{e:{y=!1,S&&(S=!1,A(L),L=-1),x=!0;var Z=_;try{t:{for(M(O),b=i(m);b!==null&&!(b.expirationTime>O&&I());){var V=b.callback;if(typeof V=="function"){b.callback=null,_=b.priorityLevel;var P=V(b.expirationTime<=O);if(O=e.unstable_now(),typeof P=="function"){b.callback=P,M(O),X=!0;break t}b===i(m)&&s(m),M(O)}else s(m);b=i(m)}if(b!==null)X=!0;else{var j=i(f);j!==null&&q(D,j.startTime-O),X=!1}}break e}finally{b=null,_=Z,x=!1}X=void 0}}finally{X?G():U=!1}}}var G;if(typeof N=="function")G=function(){N(F)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,Q=Y.port2;Y.port1.onmessage=F,G=function(){Q.postMessage(null)}}else G=function(){C(F,0)};function q(O,X){L=C(function(){O(e.unstable_now())},X)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(O){O.callback=null},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_next=function(O){switch(_){case 1:case 2:case 3:var X=3;break;default:X=_}var Z=_;_=X;try{return O()}finally{_=Z}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(O,X){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var Z=_;_=O;try{return X()}finally{_=Z}},e.unstable_scheduleCallback=function(O,X,Z){var V=e.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?V+Z:V):Z=V,O){case 1:var P=-1;break;case 2:P=250;break;case 5:P=1073741823;break;case 4:P=1e4;break;default:P=5e3}return P=Z+P,O={id:p++,callback:X,priorityLevel:O,startTime:Z,expirationTime:P,sortIndex:-1},Z>V?(O.sortIndex=Z,t(f,O),i(m)===null&&O===i(f)&&(S?(A(L),L=-1):S=!0,q(D,Z-V))):(O.sortIndex=P,t(m,O),y||x||(y=!0,U||(U=!0,G()))),O},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(O){var X=_;return function(){var Z=_;_=X;try{return O.apply(this,arguments)}finally{_=Z}}}})(lp)),lp}var Zx;function nA(){return Zx||(Zx=1,op.exports=iA()),op.exports}var cp={exports:{}},$i={};var Qx;function sA(){if(Qx)return $i;Qx=1;var e=ib();function t(m){var f="https://react.dev/errors/"+m;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)f+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+m+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var s={d:{f:i,r:function(){throw Error(t(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},a=Symbol.for("react.portal");function o(m,f,p){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:b==null?null:""+b,children:m,containerInfo:f,implementation:p}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(m,f){if(m==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return $i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,$i.createPortal=function(m,f){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return o(m,f,null,p)},$i.flushSync=function(m){var f=u.T,p=s.p;try{if(u.T=null,s.p=2,m)return m()}finally{u.T=f,s.p=p,s.d.f()}},$i.preconnect=function(m,f){typeof m=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,s.d.C(m,f))},$i.prefetchDNS=function(m){typeof m=="string"&&s.d.D(m)},$i.preinit=function(m,f){if(typeof m=="string"&&f&&typeof f.as=="string"){var p=f.as,b=h(p,f.crossOrigin),_=typeof f.integrity=="string"?f.integrity:void 0,x=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;p==="style"?s.d.S(m,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:b,integrity:_,fetchPriority:x}):p==="script"&&s.d.X(m,{crossOrigin:b,integrity:_,fetchPriority:x,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},$i.preinitModule=function(m,f){if(typeof m=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var p=h(f.as,f.crossOrigin);s.d.M(m,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&s.d.M(m)},$i.preload=function(m,f){if(typeof m=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var p=f.as,b=h(p,f.crossOrigin);s.d.L(m,p,{crossOrigin:b,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},$i.preloadModule=function(m,f){if(typeof m=="string")if(f){var p=h(f.as,f.crossOrigin);s.d.m(m,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else s.d.m(m)},$i.requestFormReset=function(m){s.d.r(m)},$i.unstable_batchedUpdates=function(m,f){return m(f)},$i.useFormState=function(m,f,p){return u.H.useFormState(m,f,p)},$i.useFormStatus=function(){return u.H.useHostTransitionStatus()},$i.version="19.2.6",$i}var Jx;function uk(){if(Jx)return cp.exports;Jx=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(),cp.exports=sA(),cp.exports}var ey;function rA(){if(ey)return cc;ey=1;var e=nA(),t=ib(),i=uk();function s(n){var r="https://react.dev/errors/"+n;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)r+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+n+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function o(n){var r=n,l=n;if(n.alternate)for(;r.return;)r=r.return;else{n=r;do r=n,(r.flags&4098)!==0&&(l=r.return),n=r.return;while(n)}return r.tag===3?l:null}function u(n){if(n.tag===13){var r=n.memoizedState;if(r===null&&(n=n.alternate,n!==null&&(r=n.memoizedState)),r!==null)return r.dehydrated}return null}function h(n){if(n.tag===31){var r=n.memoizedState;if(r===null&&(n=n.alternate,n!==null&&(r=n.memoizedState)),r!==null)return r.dehydrated}return null}function m(n){if(o(n)!==n)throw Error(s(188))}function f(n){var r=n.alternate;if(!r){if(r=o(n),r===null)throw Error(s(188));return r!==n?null:n}for(var l=n,d=r;;){var g=l.return;if(g===null)break;var v=g.alternate;if(v===null){if(d=g.return,d!==null){l=d;continue}break}if(g.child===v.child){for(v=g.child;v;){if(v===l)return m(g),n;if(v===d)return m(g),r;v=v.sibling}throw Error(s(188))}if(l.return!==d.return)l=g,d=v;else{for(var w=!1,T=g.child;T;){if(T===l){w=!0,l=g,d=v;break}if(T===d){w=!0,d=g,l=v;break}T=T.sibling}if(!w){for(T=v.child;T;){if(T===l){w=!0,l=v,d=g;break}if(T===d){w=!0,d=v,l=g;break}T=T.sibling}if(!w)throw Error(s(189))}}if(l.alternate!==d)throw Error(s(190))}if(l.tag!==3)throw Error(s(188));return l.stateNode.current===l?n:r}function p(n){var r=n.tag;if(r===5||r===26||r===27||r===6)return n;for(n=n.child;n!==null;){if(r=p(n),r!==null)return r;n=n.sibling}return null}var b=Object.assign,_=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),N=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function G(n){return n===null||typeof n!="object"?null:(n=F&&n[F]||n["@@iterator"],typeof n=="function"?n:null)}var Y=Symbol.for("react.client.reference");function Q(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===Y?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case S:return"Fragment";case C:return"Profiler";case E:return"StrictMode";case D:return"Suspense";case U:return"SuspenseList";case $:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case y:return"Portal";case N:return n.displayName||"Context";case A:return(n._context.displayName||"Context")+".Consumer";case M:var r=n.render;return n=n.displayName,n||(n=r.displayName||r.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case L:return r=n.displayName||null,r!==null?r:Q(n.type)||"Memo";case R:r=n._payload,n=n._init;try{return Q(n(r))}catch{}}return null}var q=Array.isArray,O=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z={pending:!1,data:null,method:null,action:null},V=[],P=-1;function j(n){return{current:n}}function W(n){0>P||(n.current=V[P],V[P]=null,P--)}function he(n,r){P++,V[P]=n.current,n.current=r}var oe=j(null),me=j(null),ne=j(null),fe=j(null);function we(n,r){switch(he(ne,r),he(me,n),he(oe,null),r.nodeType){case 9:case 11:n=(n=r.documentElement)&&(n=n.namespaceURI)?px(n):0;break;default:if(n=r.tagName,r=r.namespaceURI)r=px(r),n=gx(r,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}W(oe),he(oe,n)}function ye(){W(oe),W(me),W(ne)}function Ze(n){n.memoizedState!==null&&he(fe,n);var r=oe.current,l=gx(r,n.type);r!==l&&(he(me,n),he(oe,l))}function ot(n){me.current===n&&(W(oe),W(me)),fe.current===n&&(W(fe),sc._currentValue=Z)}var lt,Be;function Lt(n){if(lt===void 0)try{throw Error()}catch(l){var r=l.stack.trim().match(/\n( *(at )?)/);lt=r&&r[1]||"",Be=-1<l.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+lt+n+Be}var Os=!1;function Jn(n,r){if(!n||Os)return"";Os=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(r){var le=function(){throw Error()};if(Object.defineProperty(le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(le,[])}catch(ie){var te=ie}Reflect.construct(n,[],le)}else{try{le.call()}catch(ie){te=ie}n.call(le.prototype)}}else{try{throw Error()}catch(ie){te=ie}(le=n())&&typeof le.catch=="function"&&le.catch(function(){})}}catch(ie){if(ie&&te&&typeof ie.stack=="string")return[ie.stack,te.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var g=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");g&&g.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=d.DetermineComponentFrameRoot(),w=v[0],T=v[1];if(w&&T){var B=w.split(`
|
|
4
|
-
`),ee=T.split(`
|
|
5
|
-
`);for(g=d=0;d<B.length&&!B[d].includes("DetermineComponentFrameRoot");)d++;for(;g<ee.length&&!ee[g].includes("DetermineComponentFrameRoot");)g++;if(d===B.length||g===ee.length)for(d=B.length-1,g=ee.length-1;1<=d&&0<=g&&B[d]!==ee[g];)g--;for(;1<=d&&0<=g;d--,g--)if(B[d]!==ee[g]){if(d!==1||g!==1)do if(d--,g--,0>g||B[d]!==ee[g]){var se=`
|
|
6
|
-
`+B[d].replace(" at new "," at ");return n.displayName&&se.includes("<anonymous>")&&(se=se.replace("<anonymous>",n.displayName)),se}while(1<=d&&0<=g);break}}}finally{Os=!1,Error.prepareStackTrace=l}return(l=n?n.displayName||n.name:"")?Lt(l):""}function _e(n,r){switch(n.tag){case 26:case 27:case 5:return Lt(n.type);case 16:return Lt("Lazy");case 13:return n.child!==r&&r!==null?Lt("Suspense Fallback"):Lt("Suspense");case 19:return Lt("SuspenseList");case 0:case 15:return Jn(n.type,!1);case 11:return Jn(n.type.render,!1);case 1:return Jn(n.type,!0);case 31:return Lt("Activity");default:return""}}function mt(n){try{var r="",l=null;do r+=_e(n,l),l=n,n=n.return;while(n);return r}catch(d){return`
|
|
7
|
-
Error generating stack: `+d.message+`
|
|
8
|
-
`+d.stack}}var qi=Object.prototype.hasOwnProperty,li=e.unstable_scheduleCallback,Ki=e.unstable_cancelCallback,oa=e.unstable_shouldYield,mr=e.unstable_requestPaint,Bt=e.unstable_now,Ls=e.unstable_getCurrentPriorityLevel,wi=e.unstable_ImmediatePriority,Bs=e.unstable_UserBlockingPriority,zs=e.unstable_NormalPriority,Qa=e.unstable_LowPriority,pr=e.unstable_IdlePriority,fl=e.log,Ja=e.unstable_setDisableYieldValue,Is=null,gi=null;function Mn(n){if(typeof fl=="function"&&Ja(n),gi&&typeof gi.setStrictMode=="function")try{gi.setStrictMode(Is,n)}catch{}}var ki=Math.clz32?Math.clz32:eo,ml=Math.log,la=Math.LN2;function eo(n){return n>>>=0,n===0?32:31-(ml(n)/la|0)|0}var rt=256,es=262144,gn=4194304;function zi(n){var r=n&42;if(r!==0)return r;switch(n&-n){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 n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function z(n,r,l){var d=n.pendingLanes;if(d===0)return 0;var g=0,v=n.suspendedLanes,w=n.pingedLanes;n=n.warmLanes;var T=d&134217727;return T!==0?(d=T&~v,d!==0?g=zi(d):(w&=T,w!==0?g=zi(w):l||(l=T&~n,l!==0&&(g=zi(l))))):(T=d&~v,T!==0?g=zi(T):w!==0?g=zi(w):l||(l=d&~n,l!==0&&(g=zi(l)))),g===0?0:r!==0&&r!==g&&(r&v)===0&&(v=g&-g,l=r&-r,v>=l||v===32&&(l&4194048)!==0)?r:g}function re(n,r){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&r)===0}function xe(n,r){switch(n){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function $e(){var n=gn;return gn<<=1,(gn&62914560)===0&&(gn=4194304),n}function Nt(n){for(var r=[],l=0;31>l;l++)r.push(n);return r}function wt(n,r){n.pendingLanes|=r,r!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function Ae(n,r,l,d,g,v){var w=n.pendingLanes;n.pendingLanes=l,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=l,n.entangledLanes&=l,n.errorRecoveryDisabledLanes&=l,n.shellSuspendCounter=0;var T=n.entanglements,B=n.expirationTimes,ee=n.hiddenUpdates;for(l=w&~l;0<l;){var se=31-ki(l),le=1<<se;T[se]=0,B[se]=-1;var te=ee[se];if(te!==null)for(ee[se]=null,se=0;se<te.length;se++){var ie=te[se];ie!==null&&(ie.lane&=-536870913)}l&=~le}d!==0&&ke(n,d,0),v!==0&&g===0&&n.tag!==0&&(n.suspendedLanes|=v&~(w&~r))}function ke(n,r,l){n.pendingLanes|=r,n.suspendedLanes&=~r;var d=31-ki(r);n.entangledLanes|=r,n.entanglements[d]=n.entanglements[d]|1073741824|l&261930}function Ie(n,r){var l=n.entangledLanes|=r;for(n=n.entanglements;l;){var d=31-ki(l),g=1<<d;g&r|n[d]&r&&(n[d]|=r),l&=~g}}function qt(n,r){var l=r&-r;return l=(l&42)!==0?1:jt(l),(l&(n.suspendedLanes|r))!==0?0:l}function jt(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=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:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function Ps(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function to(){var n=X.p;return n!==0?n:(n=window.event,n===void 0?32:Px(n.type))}function io(n,r){var l=X.p;try{return X.p=n,r()}finally{X.p=l}}var ds=Math.random().toString(36).slice(2),Kt="__reactFiber$"+ds,Ii="__reactProps$"+ds,gr="__reactContainer$"+ds,pl="__reactEvents$"+ds,du="__reactListeners$"+ds,no="__reactHandles$"+ds,hu="__reactResources$"+ds,ca="__reactMarker$"+ds;function gl(n){delete n[Kt],delete n[Ii],delete n[pl],delete n[du],delete n[no]}function Gi(n){var r=n[Kt];if(r)return r;for(var l=n.parentNode;l;){if(r=l[gr]||l[Kt]){if(l=r.alternate,r.child!==null||l!==null&&l.child!==null)for(n=wx(n);n!==null;){if(l=n[Kt])return l;n=wx(n)}return r}n=l,l=n.parentNode}return null}function $s(n){if(n=n[Kt]||n[gr]){var r=n.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return n}return null}function br(n){var r=n.tag;if(r===5||r===26||r===27||r===6)return n.stateNode;throw Error(s(33))}function vr(n){var r=n[hu];return r||(r=n[hu]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Zt(n){n[ca]=!0}var fu=new Set,ua={};function Us(n,r){pe(n,r),pe(n+"Capture",r)}function pe(n,r){for(ua[n]=r,n=0;n<r.length;n++)fu.add(r[n])}var je=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]*$"),Xe={},pt={};function Gt(n){return qi.call(pt,n)?!0:qi.call(Xe,n)?!1:je.test(n)?pt[n]=!0:(Xe[n]=!0,!1)}function Pi(n,r,l){if(Gt(r))if(l===null)n.removeAttribute(r);else{switch(typeof l){case"undefined":case"function":case"symbol":n.removeAttribute(r);return;case"boolean":var d=r.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){n.removeAttribute(r);return}}n.setAttribute(r,""+l)}}function bn(n,r,l){if(l===null)n.removeAttribute(r);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(r);return}n.setAttribute(r,""+l)}}function nn(n,r,l,d){if(d===null)n.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(l);return}n.setAttributeNS(r,l,""+d)}}function Ct(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function vn(n){var r=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function mu(n,r,l){var d=Object.getOwnPropertyDescriptor(n.constructor.prototype,r);if(!n.hasOwnProperty(r)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var g=d.get,v=d.set;return Object.defineProperty(n,r,{configurable:!0,get:function(){return g.call(this)},set:function(w){l=""+w,v.call(this,w)}}),Object.defineProperty(n,r,{enumerable:d.enumerable}),{getValue:function(){return l},setValue:function(w){l=""+w},stopTracking:function(){n._valueTracker=null,delete n[r]}}}}function so(n){if(!n._valueTracker){var r=vn(n)?"checked":"value";n._valueTracker=mu(n,r,""+n[r])}}function bl(n){if(!n)return!1;var r=n._valueTracker;if(!r)return!0;var l=r.getValue(),d="";return n&&(d=vn(n)?n.checked?"true":"false":n.value),n=d,n!==l?(r.setValue(n),!0):!1}function ro(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var nf=/[\n"\\]/g;function sn(n){return n.replace(nf,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function vl(n,r,l,d,g,v,w,T){n.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?n.type=w:n.removeAttribute("type"),r!=null?w==="number"?(r===0&&n.value===""||n.value!=r)&&(n.value=""+Ct(r)):n.value!==""+Ct(r)&&(n.value=""+Ct(r)):w!=="submit"&&w!=="reset"||n.removeAttribute("value"),r!=null?ao(n,w,Ct(r)):l!=null?ao(n,w,Ct(l)):d!=null&&n.removeAttribute("value"),g==null&&v!=null&&(n.defaultChecked=!!v),g!=null&&(n.checked=g&&typeof g!="function"&&typeof g!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?n.name=""+Ct(T):n.removeAttribute("name")}function da(n,r,l,d,g,v,w,T){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(n.type=v),r!=null||l!=null){if(!(v!=="submit"&&v!=="reset"||r!=null)){so(n);return}l=l!=null?""+Ct(l):"",r=r!=null?""+Ct(r):l,T||r===n.value||(n.value=r),n.defaultValue=r}d=d??g,d=typeof d!="function"&&typeof d!="symbol"&&!!d,n.checked=T?n.checked:!!d,n.defaultChecked=!!d,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(n.name=w),so(n)}function ao(n,r,l){r==="number"&&ro(n.ownerDocument)===n||n.defaultValue===""+l||(n.defaultValue=""+l)}function Ei(n,r,l,d){if(n=n.options,r){r={};for(var g=0;g<l.length;g++)r["$"+l[g]]=!0;for(l=0;l<n.length;l++)g=r.hasOwnProperty("$"+n[l].value),n[l].selected!==g&&(n[l].selected=g),g&&d&&(n[l].defaultSelected=!0)}else{for(l=""+Ct(l),r=null,g=0;g<n.length;g++){if(n[g].value===l){n[g].selected=!0,d&&(n[g].defaultSelected=!0);return}r!==null||n[g].disabled||(r=n[g])}r!==null&&(r.selected=!0)}}function pu(n,r,l){if(r!=null&&(r=""+Ct(r),r!==n.value&&(n.value=r),l==null)){n.defaultValue!==r&&(n.defaultValue=r);return}n.defaultValue=l!=null?""+Ct(l):""}function oo(n,r,l,d){if(r==null){if(d!=null){if(l!=null)throw Error(s(92));if(q(d)){if(1<d.length)throw Error(s(93));d=d[0]}l=d}l==null&&(l=""),r=l}l=Ct(r),n.defaultValue=l,d=n.textContent,d===l&&d!==""&&d!==null&&(n.value=d),so(n)}function ze(n,r){if(r){var l=n.firstChild;if(l&&l===n.lastChild&&l.nodeType===3){l.nodeValue=r;return}}n.textContent=r}var gu=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 Qt(n,r,l){var d=r.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?d?n.setProperty(r,""):r==="float"?n.cssFloat="":n[r]="":d?n.setProperty(r,l):typeof l!="number"||l===0||gu.has(r)?r==="float"?n.cssFloat=l:n[r]=(""+l).trim():n[r]=l+"px"}function gt(n,r,l){if(r!=null&&typeof r!="object")throw Error(s(62));if(n=n.style,l!=null){for(var d in l)!l.hasOwnProperty(d)||r!=null&&r.hasOwnProperty(d)||(d.indexOf("--")===0?n.setProperty(d,""):d==="float"?n.cssFloat="":n[d]="");for(var g in r)d=r[g],r.hasOwnProperty(g)&&l[g]!==d&&Qt(n,g,d)}else for(var v in r)r.hasOwnProperty(v)&&Qt(n,v,r[v])}function _r(n){if(n.indexOf("-")===-1)return!1;switch(n){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 Hs=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"]]),_l=/^[\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 xr(n){return _l.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function ve(){}var Me=null;function Fe(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var tt=null,zt=null;function Rn(n){var r=$s(n);if(r&&(n=r.stateNode)){var l=n[Ii]||null;e:switch(n=r.stateNode,r.type){case"input":if(vl(n,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),r=l.name,l.type==="radio"&&r!=null){for(l=n;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+sn(""+r)+'"][type="radio"]'),r=0;r<l.length;r++){var d=l[r];if(d!==n&&d.form===n.form){var g=d[Ii]||null;if(!g)throw Error(s(90));vl(d,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(r=0;r<l.length;r++)d=l[r],d.form===n.form&&bl(d)}break e;case"textarea":pu(n,l.value,l.defaultValue);break e;case"select":r=l.value,r!=null&&Ei(n,!!l.multiple,r,!1)}}}var xl=!1;function bu(n,r,l){if(xl)return n(r,l);xl=!0;try{var d=n(r);return d}finally{if(xl=!1,(tt!==null||zt!==null)&&(sd(),tt&&(r=tt,n=zt,zt=tt=null,Rn(r),n)))for(r=0;r<n.length;r++)Rn(n[r])}}function yl(n,r){var l=n.stateNode;if(l===null)return null;var d=l[Ii]||null;if(d===null)return null;l=d[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(n=n.type,d=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!d;break e;default:n=!1}if(n)return null;if(l&&typeof l!="function")throw Error(s(231,r,typeof l));return l}var Fs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),sf=!1;if(Fs)try{var Sl={};Object.defineProperty(Sl,"passive",{get:function(){sf=!0}}),window.addEventListener("test",Sl,Sl),window.removeEventListener("test",Sl,Sl)}catch{sf=!1}var yr=null,rf=null,vu=null;function gv(){if(vu)return vu;var n,r=rf,l=r.length,d,g="value"in yr?yr.value:yr.textContent,v=g.length;for(n=0;n<l&&r[n]===g[n];n++);var w=l-n;for(d=1;d<=w&&r[l-d]===g[v-d];d++);return vu=g.slice(n,1<d?1-d:void 0)}function _u(n){var r=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&r===13&&(n=13)):n=r,n===10&&(n=13),32<=n||n===13?n:0}function xu(){return!0}function bv(){return!1}function rn(n){function r(l,d,g,v,w){this._reactName=l,this._targetInst=g,this.type=d,this.nativeEvent=v,this.target=w,this.currentTarget=null;for(var T in n)n.hasOwnProperty(T)&&(l=n[T],this[T]=l?l(v):v[T]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?xu:bv,this.isPropagationStopped=bv,this}return b(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=xu)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=xu)},persist:function(){},isPersistent:xu}),r}var ha={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},yu=rn(ha),wl=b({},ha,{view:0,detail:0}),X3=rn(wl),af,of,kl,Su=b({},wl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:cf,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==kl&&(kl&&n.type==="mousemove"?(af=n.screenX-kl.screenX,of=n.screenY-kl.screenY):of=af=0,kl=n),af)},movementY:function(n){return"movementY"in n?n.movementY:of}}),vv=rn(Su),Z3=b({},Su,{dataTransfer:0}),Q3=rn(Z3),J3=b({},wl,{relatedTarget:0}),lf=rn(J3),e5=b({},ha,{animationName:0,elapsedTime:0,pseudoElement:0}),t5=rn(e5),i5=b({},ha,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),n5=rn(i5),s5=b({},ha,{data:0}),_v=rn(s5),r5={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},a5={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"},o5={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function l5(n){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(n):(n=o5[n])?!!r[n]:!1}function cf(){return l5}var c5=b({},wl,{key:function(n){if(n.key){var r=r5[n.key]||n.key;if(r!=="Unidentified")return r}return n.type==="keypress"?(n=_u(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?a5[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:cf,charCode:function(n){return n.type==="keypress"?_u(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?_u(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),u5=rn(c5),d5=b({},Su,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),xv=rn(d5),h5=b({},wl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:cf}),f5=rn(h5),m5=b({},ha,{propertyName:0,elapsedTime:0,pseudoElement:0}),p5=rn(m5),g5=b({},Su,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),b5=rn(g5),v5=b({},ha,{newState:0,oldState:0}),_5=rn(v5),x5=[9,13,27,32],uf=Fs&&"CompositionEvent"in window,El=null;Fs&&"documentMode"in document&&(El=document.documentMode);var y5=Fs&&"TextEvent"in window&&!El,yv=Fs&&(!uf||El&&8<El&&11>=El),Sv=" ",wv=!1;function kv(n,r){switch(n){case"keyup":return x5.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ev(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var lo=!1;function S5(n,r){switch(n){case"compositionend":return Ev(r);case"keypress":return r.which!==32?null:(wv=!0,Sv);case"textInput":return n=r.data,n===Sv&&wv?null:n;default:return null}}function w5(n,r){if(lo)return n==="compositionend"||!uf&&kv(n,r)?(n=gv(),vu=rf=yr=null,lo=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return yv&&r.locale!=="ko"?null:r.data;default:return null}}var k5={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 Cv(n){var r=n&&n.nodeName&&n.nodeName.toLowerCase();return r==="input"?!!k5[n.type]:r==="textarea"}function Nv(n,r,l,d){tt?zt?zt.push(d):zt=[d]:tt=d,r=dd(r,"onChange"),0<r.length&&(l=new yu("onChange","change",null,l,d),n.push({event:l,listeners:r}))}var Cl=null,Nl=null;function E5(n){cx(n,0)}function wu(n){var r=br(n);if(bl(r))return n}function Tv(n,r){if(n==="change")return r}var Av=!1;if(Fs){var df;if(Fs){var hf="oninput"in document;if(!hf){var Mv=document.createElement("div");Mv.setAttribute("oninput","return;"),hf=typeof Mv.oninput=="function"}df=hf}else df=!1;Av=df&&(!document.documentMode||9<document.documentMode)}function Rv(){Cl&&(Cl.detachEvent("onpropertychange",jv),Nl=Cl=null)}function jv(n){if(n.propertyName==="value"&&wu(Nl)){var r=[];Nv(r,Nl,n,Fe(n)),bu(E5,r)}}function C5(n,r,l){n==="focusin"?(Rv(),Cl=r,Nl=l,Cl.attachEvent("onpropertychange",jv)):n==="focusout"&&Rv()}function N5(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return wu(Nl)}function T5(n,r){if(n==="click")return wu(r)}function A5(n,r){if(n==="input"||n==="change")return wu(r)}function M5(n,r){return n===r&&(n!==0||1/n===1/r)||n!==n&&r!==r}var _n=typeof Object.is=="function"?Object.is:M5;function Tl(n,r){if(_n(n,r))return!0;if(typeof n!="object"||n===null||typeof r!="object"||r===null)return!1;var l=Object.keys(n),d=Object.keys(r);if(l.length!==d.length)return!1;for(d=0;d<l.length;d++){var g=l[d];if(!qi.call(r,g)||!_n(n[g],r[g]))return!1}return!0}function Dv(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Ov(n,r){var l=Dv(n);n=0;for(var d;l;){if(l.nodeType===3){if(d=n+l.textContent.length,n<=r&&d>=r)return{node:l,offset:r-n};n=d}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Dv(l)}}function Lv(n,r){return n&&r?n===r?!0:n&&n.nodeType===3?!1:r&&r.nodeType===3?Lv(n,r.parentNode):"contains"in n?n.contains(r):n.compareDocumentPosition?!!(n.compareDocumentPosition(r)&16):!1:!1}function Bv(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var r=ro(n.document);r instanceof n.HTMLIFrameElement;){try{var l=typeof r.contentWindow.location.href=="string"}catch{l=!1}if(l)n=r.contentWindow;else break;r=ro(n.document)}return r}function ff(n){var r=n&&n.nodeName&&n.nodeName.toLowerCase();return r&&(r==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||r==="textarea"||n.contentEditable==="true")}var R5=Fs&&"documentMode"in document&&11>=document.documentMode,co=null,mf=null,Al=null,pf=!1;function zv(n,r,l){var d=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;pf||co==null||co!==ro(d)||(d=co,"selectionStart"in d&&ff(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Al&&Tl(Al,d)||(Al=d,d=dd(mf,"onSelect"),0<d.length&&(r=new yu("onSelect","select",null,r,l),n.push({event:r,listeners:d}),r.target=co)))}function fa(n,r){var l={};return l[n.toLowerCase()]=r.toLowerCase(),l["Webkit"+n]="webkit"+r,l["Moz"+n]="moz"+r,l}var uo={animationend:fa("Animation","AnimationEnd"),animationiteration:fa("Animation","AnimationIteration"),animationstart:fa("Animation","AnimationStart"),transitionrun:fa("Transition","TransitionRun"),transitionstart:fa("Transition","TransitionStart"),transitioncancel:fa("Transition","TransitionCancel"),transitionend:fa("Transition","TransitionEnd")},gf={},Iv={};Fs&&(Iv=document.createElement("div").style,"AnimationEvent"in window||(delete uo.animationend.animation,delete uo.animationiteration.animation,delete uo.animationstart.animation),"TransitionEvent"in window||delete uo.transitionend.transition);function ma(n){if(gf[n])return gf[n];if(!uo[n])return n;var r=uo[n],l;for(l in r)if(r.hasOwnProperty(l)&&l in Iv)return gf[n]=r[l];return n}var Pv=ma("animationend"),$v=ma("animationiteration"),Uv=ma("animationstart"),j5=ma("transitionrun"),D5=ma("transitionstart"),O5=ma("transitioncancel"),Hv=ma("transitionend"),Fv=new Map,bf="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");bf.push("scrollEnd");function ts(n,r){Fv.set(n,r),Us(r,[n])}var ku=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},jn=[],ho=0,vf=0;function Eu(){for(var n=ho,r=vf=ho=0;r<n;){var l=jn[r];jn[r++]=null;var d=jn[r];jn[r++]=null;var g=jn[r];jn[r++]=null;var v=jn[r];if(jn[r++]=null,d!==null&&g!==null){var w=d.pending;w===null?g.next=g:(g.next=w.next,w.next=g),d.pending=g}v!==0&&Vv(l,g,v)}}function Cu(n,r,l,d){jn[ho++]=n,jn[ho++]=r,jn[ho++]=l,jn[ho++]=d,vf|=d,n.lanes|=d,n=n.alternate,n!==null&&(n.lanes|=d)}function _f(n,r,l,d){return Cu(n,r,l,d),Nu(n)}function pa(n,r){return Cu(n,null,null,r),Nu(n)}function Vv(n,r,l){n.lanes|=l;var d=n.alternate;d!==null&&(d.lanes|=l);for(var g=!1,v=n.return;v!==null;)v.childLanes|=l,d=v.alternate,d!==null&&(d.childLanes|=l),v.tag===22&&(n=v.stateNode,n===null||n._visibility&1||(g=!0)),n=v,v=v.return;return n.tag===3?(v=n.stateNode,g&&r!==null&&(g=31-ki(l),n=v.hiddenUpdates,d=n[g],d===null?n[g]=[r]:d.push(r),r.lane=l|536870912),v):null}function Nu(n){if(50<Zl)throw Zl=0,Tm=null,Error(s(185));for(var r=n.return;r!==null;)n=r,r=n.return;return n.tag===3?n.stateNode:null}var fo={};function L5(n,r,l,d){this.tag=n,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function xn(n,r,l,d){return new L5(n,r,l,d)}function xf(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Vs(n,r){var l=n.alternate;return l===null?(l=xn(n.tag,r,n.key,n.mode),l.elementType=n.elementType,l.type=n.type,l.stateNode=n.stateNode,l.alternate=n,n.alternate=l):(l.pendingProps=r,l.type=n.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=n.flags&65011712,l.childLanes=n.childLanes,l.lanes=n.lanes,l.child=n.child,l.memoizedProps=n.memoizedProps,l.memoizedState=n.memoizedState,l.updateQueue=n.updateQueue,r=n.dependencies,l.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},l.sibling=n.sibling,l.index=n.index,l.ref=n.ref,l.refCleanup=n.refCleanup,l}function qv(n,r){n.flags&=65011714;var l=n.alternate;return l===null?(n.childLanes=0,n.lanes=r,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=l.childLanes,n.lanes=l.lanes,n.child=l.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=l.memoizedProps,n.memoizedState=l.memoizedState,n.updateQueue=l.updateQueue,n.type=l.type,r=l.dependencies,n.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),n}function Tu(n,r,l,d,g,v){var w=0;if(d=n,typeof n=="function")xf(n)&&(w=1);else if(typeof n=="string")w=$T(n,l,oe.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case $:return n=xn(31,l,r,g),n.elementType=$,n.lanes=v,n;case S:return ga(l.children,g,v,r);case E:w=8,g|=24;break;case C:return n=xn(12,l,r,g|2),n.elementType=C,n.lanes=v,n;case D:return n=xn(13,l,r,g),n.elementType=D,n.lanes=v,n;case U:return n=xn(19,l,r,g),n.elementType=U,n.lanes=v,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case N:w=10;break e;case A:w=9;break e;case M:w=11;break e;case L:w=14;break e;case R:w=16,d=null;break e}w=29,l=Error(s(130,n===null?"null":typeof n,"")),d=null}return r=xn(w,l,r,g),r.elementType=n,r.type=d,r.lanes=v,r}function ga(n,r,l,d){return n=xn(7,n,d,r),n.lanes=l,n}function yf(n,r,l){return n=xn(6,n,null,r),n.lanes=l,n}function Kv(n){var r=xn(18,null,null,0);return r.stateNode=n,r}function Sf(n,r,l){return r=xn(4,n.children!==null?n.children:[],n.key,r),r.lanes=l,r.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},r}var Gv=new WeakMap;function Dn(n,r){if(typeof n=="object"&&n!==null){var l=Gv.get(n);return l!==void 0?l:(r={value:n,source:r,stack:mt(r)},Gv.set(n,r),r)}return{value:n,source:r,stack:mt(r)}}var mo=[],po=0,Au=null,Ml=0,On=[],Ln=0,Sr=null,hs=1,fs="";function qs(n,r){mo[po++]=Ml,mo[po++]=Au,Au=n,Ml=r}function Wv(n,r,l){On[Ln++]=hs,On[Ln++]=fs,On[Ln++]=Sr,Sr=n;var d=hs;n=fs;var g=32-ki(d)-1;d&=~(1<<g),l+=1;var v=32-ki(r)+g;if(30<v){var w=g-g%5;v=(d&(1<<w)-1).toString(32),d>>=w,g-=w,hs=1<<32-ki(r)+g|l<<g|d,fs=v+n}else hs=1<<v|l<<g|d,fs=n}function wf(n){n.return!==null&&(qs(n,1),Wv(n,1,0))}function kf(n){for(;n===Au;)Au=mo[--po],mo[po]=null,Ml=mo[--po],mo[po]=null;for(;n===Sr;)Sr=On[--Ln],On[Ln]=null,fs=On[--Ln],On[Ln]=null,hs=On[--Ln],On[Ln]=null}function Yv(n,r){On[Ln++]=hs,On[Ln++]=fs,On[Ln++]=Sr,hs=r.id,fs=r.overflow,Sr=n}var Ci=null,Tt=null,st=!1,wr=null,Bn=!1,Ef=Error(s(519));function kr(n){var r=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Rl(Dn(r,n)),Ef}function Xv(n){var r=n.stateNode,l=n.type,d=n.memoizedProps;switch(r[Kt]=n,r[Ii]=d,l){case"dialog":Je("cancel",r),Je("close",r);break;case"iframe":case"object":case"embed":Je("load",r);break;case"video":case"audio":for(l=0;l<Jl.length;l++)Je(Jl[l],r);break;case"source":Je("error",r);break;case"img":case"image":case"link":Je("error",r),Je("load",r);break;case"details":Je("toggle",r);break;case"input":Je("invalid",r),da(r,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":Je("invalid",r);break;case"textarea":Je("invalid",r),oo(r,d.value,d.defaultValue,d.children)}l=d.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||r.textContent===""+l||d.suppressHydrationWarning===!0||fx(r.textContent,l)?(d.popover!=null&&(Je("beforetoggle",r),Je("toggle",r)),d.onScroll!=null&&Je("scroll",r),d.onScrollEnd!=null&&Je("scrollend",r),d.onClick!=null&&(r.onclick=ve),r=!0):r=!1,r||kr(n,!0)}function Zv(n){for(Ci=n.return;Ci;)switch(Ci.tag){case 5:case 31:case 13:Bn=!1;return;case 27:case 3:Bn=!0;return;default:Ci=Ci.return}}function go(n){if(n!==Ci)return!1;if(!st)return Zv(n),st=!0,!1;var r=n.tag,l;if((l=r!==3&&r!==27)&&((l=r===5)&&(l=n.type,l=!(l!=="form"&&l!=="button")||Fm(n.type,n.memoizedProps)),l=!l),l&&Tt&&kr(n),Zv(n),r===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(317));Tt=Sx(n)}else if(r===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(317));Tt=Sx(n)}else r===27?(r=Tt,Ir(n.type)?(n=Wm,Wm=null,Tt=n):Tt=r):Tt=Ci?In(n.stateNode.nextSibling):null;return!0}function ba(){Tt=Ci=null,st=!1}function Cf(){var n=wr;return n!==null&&(cn===null?cn=n:cn.push.apply(cn,n),wr=null),n}function Rl(n){wr===null?wr=[n]:wr.push(n)}var Nf=j(null),va=null,Ks=null;function Er(n,r,l){he(Nf,r._currentValue),r._currentValue=l}function Gs(n){n._currentValue=Nf.current,W(Nf)}function Tf(n,r,l){for(;n!==null;){var d=n.alternate;if((n.childLanes&r)!==r?(n.childLanes|=r,d!==null&&(d.childLanes|=r)):d!==null&&(d.childLanes&r)!==r&&(d.childLanes|=r),n===l)break;n=n.return}}function Af(n,r,l,d){var g=n.child;for(g!==null&&(g.return=n);g!==null;){var v=g.dependencies;if(v!==null){var w=g.child;v=v.firstContext;e:for(;v!==null;){var T=v;v=g;for(var B=0;B<r.length;B++)if(T.context===r[B]){v.lanes|=l,T=v.alternate,T!==null&&(T.lanes|=l),Tf(v.return,l,n),d||(w=null);break e}v=T.next}}else if(g.tag===18){if(w=g.return,w===null)throw Error(s(341));w.lanes|=l,v=w.alternate,v!==null&&(v.lanes|=l),Tf(w,l,n),w=null}else w=g.child;if(w!==null)w.return=g;else for(w=g;w!==null;){if(w===n){w=null;break}if(g=w.sibling,g!==null){g.return=w.return,w=g;break}w=w.return}g=w}}function bo(n,r,l,d){n=null;for(var g=r,v=!1;g!==null;){if(!v){if((g.flags&524288)!==0)v=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var w=g.alternate;if(w===null)throw Error(s(387));if(w=w.memoizedProps,w!==null){var T=g.type;_n(g.pendingProps.value,w.value)||(n!==null?n.push(T):n=[T])}}else if(g===fe.current){if(w=g.alternate,w===null)throw Error(s(387));w.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(n!==null?n.push(sc):n=[sc])}g=g.return}n!==null&&Af(r,n,l,d),r.flags|=262144}function Mu(n){for(n=n.firstContext;n!==null;){if(!_n(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function _a(n){va=n,Ks=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Ni(n){return Qv(va,n)}function Ru(n,r){return va===null&&_a(n),Qv(n,r)}function Qv(n,r){var l=r._currentValue;if(r={context:r,memoizedValue:l,next:null},Ks===null){if(n===null)throw Error(s(308));Ks=r,n.dependencies={lanes:0,firstContext:r},n.flags|=524288}else Ks=Ks.next=r;return l}var B5=typeof AbortController<"u"?AbortController:function(){var n=[],r=this.signal={aborted:!1,addEventListener:function(l,d){n.push(d)}};this.abort=function(){r.aborted=!0,n.forEach(function(l){return l()})}},z5=e.unstable_scheduleCallback,I5=e.unstable_NormalPriority,Jt={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Mf(){return{controller:new B5,data:new Map,refCount:0}}function jl(n){n.refCount--,n.refCount===0&&z5(I5,function(){n.controller.abort()})}var Dl=null,Rf=0,vo=0,_o=null;function P5(n,r){if(Dl===null){var l=Dl=[];Rf=0,vo=Om(),_o={status:"pending",value:void 0,then:function(d){l.push(d)}}}return Rf++,r.then(Jv,Jv),r}function Jv(){if(--Rf===0&&Dl!==null){_o!==null&&(_o.status="fulfilled");var n=Dl;Dl=null,vo=0,_o=null;for(var r=0;r<n.length;r++)(0,n[r])()}}function $5(n,r){var l=[],d={status:"pending",value:null,reason:null,then:function(g){l.push(g)}};return n.then(function(){d.status="fulfilled",d.value=r;for(var g=0;g<l.length;g++)(0,l[g])(r)},function(g){for(d.status="rejected",d.reason=g,g=0;g<l.length;g++)(0,l[g])(void 0)}),d}var e_=O.S;O.S=function(n,r){z1=Bt(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&P5(n,r),e_!==null&&e_(n,r)};var xa=j(null);function jf(){var n=xa.current;return n!==null?n:kt.pooledCache}function ju(n,r){r===null?he(xa,xa.current):he(xa,r.pool)}function t_(){var n=jf();return n===null?null:{parent:Jt._currentValue,pool:n}}var xo=Error(s(460)),Df=Error(s(474)),Du=Error(s(542)),Ou={then:function(){}};function i_(n){return n=n.status,n==="fulfilled"||n==="rejected"}function n_(n,r,l){switch(l=n[l],l===void 0?n.push(r):l!==r&&(r.then(ve,ve),r=l),r.status){case"fulfilled":return r.value;case"rejected":throw n=r.reason,r_(n),n;default:if(typeof r.status=="string")r.then(ve,ve);else{if(n=kt,n!==null&&100<n.shellSuspendCounter)throw Error(s(482));n=r,n.status="pending",n.then(function(d){if(r.status==="pending"){var g=r;g.status="fulfilled",g.value=d}},function(d){if(r.status==="pending"){var g=r;g.status="rejected",g.reason=d}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw n=r.reason,r_(n),n}throw Sa=r,xo}}function ya(n){try{var r=n._init;return r(n._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Sa=l,xo):l}}var Sa=null;function s_(){if(Sa===null)throw Error(s(459));var n=Sa;return Sa=null,n}function r_(n){if(n===xo||n===Du)throw Error(s(483))}var yo=null,Ol=0;function Lu(n){var r=Ol;return Ol+=1,yo===null&&(yo=[]),n_(yo,n,r)}function Ll(n,r){r=r.props.ref,n.ref=r!==void 0?r:null}function Bu(n,r){throw r.$$typeof===_?Error(s(525)):(n=Object.prototype.toString.call(r),Error(s(31,n==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":n)))}function a_(n){function r(K,H){if(n){var J=K.deletions;J===null?(K.deletions=[H],K.flags|=16):J.push(H)}}function l(K,H){if(!n)return null;for(;H!==null;)r(K,H),H=H.sibling;return null}function d(K){for(var H=new Map;K!==null;)K.key!==null?H.set(K.key,K):H.set(K.index,K),K=K.sibling;return H}function g(K,H){return K=Vs(K,H),K.index=0,K.sibling=null,K}function v(K,H,J){return K.index=J,n?(J=K.alternate,J!==null?(J=J.index,J<H?(K.flags|=67108866,H):J):(K.flags|=67108866,H)):(K.flags|=1048576,H)}function w(K){return n&&K.alternate===null&&(K.flags|=67108866),K}function T(K,H,J,ae){return H===null||H.tag!==6?(H=yf(J,K.mode,ae),H.return=K,H):(H=g(H,J),H.return=K,H)}function B(K,H,J,ae){var Oe=J.type;return Oe===S?se(K,H,J.props.children,ae,J.key):H!==null&&(H.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===R&&ya(Oe)===H.type)?(H=g(H,J.props),Ll(H,J),H.return=K,H):(H=Tu(J.type,J.key,J.props,null,K.mode,ae),Ll(H,J),H.return=K,H)}function ee(K,H,J,ae){return H===null||H.tag!==4||H.stateNode.containerInfo!==J.containerInfo||H.stateNode.implementation!==J.implementation?(H=Sf(J,K.mode,ae),H.return=K,H):(H=g(H,J.children||[]),H.return=K,H)}function se(K,H,J,ae,Oe){return H===null||H.tag!==7?(H=ga(J,K.mode,ae,Oe),H.return=K,H):(H=g(H,J),H.return=K,H)}function le(K,H,J){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=yf(""+H,K.mode,J),H.return=K,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case x:return J=Tu(H.type,H.key,H.props,null,K.mode,J),Ll(J,H),J.return=K,J;case y:return H=Sf(H,K.mode,J),H.return=K,H;case R:return H=ya(H),le(K,H,J)}if(q(H)||G(H))return H=ga(H,K.mode,J,null),H.return=K,H;if(typeof H.then=="function")return le(K,Lu(H),J);if(H.$$typeof===N)return le(K,Ru(K,H),J);Bu(K,H)}return null}function te(K,H,J,ae){var Oe=H!==null?H.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return Oe!==null?null:T(K,H,""+J,ae);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case x:return J.key===Oe?B(K,H,J,ae):null;case y:return J.key===Oe?ee(K,H,J,ae):null;case R:return J=ya(J),te(K,H,J,ae)}if(q(J)||G(J))return Oe!==null?null:se(K,H,J,ae,null);if(typeof J.then=="function")return te(K,H,Lu(J),ae);if(J.$$typeof===N)return te(K,H,Ru(K,J),ae);Bu(K,J)}return null}function ie(K,H,J,ae,Oe){if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return K=K.get(J)||null,T(H,K,""+ae,Oe);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case x:return K=K.get(ae.key===null?J:ae.key)||null,B(H,K,ae,Oe);case y:return K=K.get(ae.key===null?J:ae.key)||null,ee(H,K,ae,Oe);case R:return ae=ya(ae),ie(K,H,J,ae,Oe)}if(q(ae)||G(ae))return K=K.get(J)||null,se(H,K,ae,Oe,null);if(typeof ae.then=="function")return ie(K,H,J,Lu(ae),Oe);if(ae.$$typeof===N)return ie(K,H,J,Ru(H,ae),Oe);Bu(H,ae)}return null}function Ne(K,H,J,ae){for(var Oe=null,ct=null,Re=H,qe=H=0,nt=null;Re!==null&&qe<J.length;qe++){Re.index>qe?(nt=Re,Re=null):nt=Re.sibling;var ut=te(K,Re,J[qe],ae);if(ut===null){Re===null&&(Re=nt);break}n&&Re&&ut.alternate===null&&r(K,Re),H=v(ut,H,qe),ct===null?Oe=ut:ct.sibling=ut,ct=ut,Re=nt}if(qe===J.length)return l(K,Re),st&&qs(K,qe),Oe;if(Re===null){for(;qe<J.length;qe++)Re=le(K,J[qe],ae),Re!==null&&(H=v(Re,H,qe),ct===null?Oe=Re:ct.sibling=Re,ct=Re);return st&&qs(K,qe),Oe}for(Re=d(Re);qe<J.length;qe++)nt=ie(Re,K,qe,J[qe],ae),nt!==null&&(n&&nt.alternate!==null&&Re.delete(nt.key===null?qe:nt.key),H=v(nt,H,qe),ct===null?Oe=nt:ct.sibling=nt,ct=nt);return n&&Re.forEach(function(Fr){return r(K,Fr)}),st&&qs(K,qe),Oe}function Le(K,H,J,ae){if(J==null)throw Error(s(151));for(var Oe=null,ct=null,Re=H,qe=H=0,nt=null,ut=J.next();Re!==null&&!ut.done;qe++,ut=J.next()){Re.index>qe?(nt=Re,Re=null):nt=Re.sibling;var Fr=te(K,Re,ut.value,ae);if(Fr===null){Re===null&&(Re=nt);break}n&&Re&&Fr.alternate===null&&r(K,Re),H=v(Fr,H,qe),ct===null?Oe=Fr:ct.sibling=Fr,ct=Fr,Re=nt}if(ut.done)return l(K,Re),st&&qs(K,qe),Oe;if(Re===null){for(;!ut.done;qe++,ut=J.next())ut=le(K,ut.value,ae),ut!==null&&(H=v(ut,H,qe),ct===null?Oe=ut:ct.sibling=ut,ct=ut);return st&&qs(K,qe),Oe}for(Re=d(Re);!ut.done;qe++,ut=J.next())ut=ie(Re,K,qe,ut.value,ae),ut!==null&&(n&&ut.alternate!==null&&Re.delete(ut.key===null?qe:ut.key),H=v(ut,H,qe),ct===null?Oe=ut:ct.sibling=ut,ct=ut);return n&&Re.forEach(function(ZT){return r(K,ZT)}),st&&qs(K,qe),Oe}function yt(K,H,J,ae){if(typeof J=="object"&&J!==null&&J.type===S&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case x:e:{for(var Oe=J.key;H!==null;){if(H.key===Oe){if(Oe=J.type,Oe===S){if(H.tag===7){l(K,H.sibling),ae=g(H,J.props.children),ae.return=K,K=ae;break e}}else if(H.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===R&&ya(Oe)===H.type){l(K,H.sibling),ae=g(H,J.props),Ll(ae,J),ae.return=K,K=ae;break e}l(K,H);break}else r(K,H);H=H.sibling}J.type===S?(ae=ga(J.props.children,K.mode,ae,J.key),ae.return=K,K=ae):(ae=Tu(J.type,J.key,J.props,null,K.mode,ae),Ll(ae,J),ae.return=K,K=ae)}return w(K);case y:e:{for(Oe=J.key;H!==null;){if(H.key===Oe)if(H.tag===4&&H.stateNode.containerInfo===J.containerInfo&&H.stateNode.implementation===J.implementation){l(K,H.sibling),ae=g(H,J.children||[]),ae.return=K,K=ae;break e}else{l(K,H);break}else r(K,H);H=H.sibling}ae=Sf(J,K.mode,ae),ae.return=K,K=ae}return w(K);case R:return J=ya(J),yt(K,H,J,ae)}if(q(J))return Ne(K,H,J,ae);if(G(J)){if(Oe=G(J),typeof Oe!="function")throw Error(s(150));return J=Oe.call(J),Le(K,H,J,ae)}if(typeof J.then=="function")return yt(K,H,Lu(J),ae);if(J.$$typeof===N)return yt(K,H,Ru(K,J),ae);Bu(K,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,H!==null&&H.tag===6?(l(K,H.sibling),ae=g(H,J),ae.return=K,K=ae):(l(K,H),ae=yf(J,K.mode,ae),ae.return=K,K=ae),w(K)):l(K,H)}return function(K,H,J,ae){try{Ol=0;var Oe=yt(K,H,J,ae);return yo=null,Oe}catch(Re){if(Re===xo||Re===Du)throw Re;var ct=xn(29,Re,null,K.mode);return ct.lanes=ae,ct.return=K,ct}}}var wa=a_(!0),o_=a_(!1),Cr=!1;function Of(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Lf(n,r){n=n.updateQueue,r.updateQueue===n&&(r.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function Nr(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function Tr(n,r,l){var d=n.updateQueue;if(d===null)return null;if(d=d.shared,(ht&2)!==0){var g=d.pending;return g===null?r.next=r:(r.next=g.next,g.next=r),d.pending=r,r=Nu(n),Vv(n,null,l),r}return Cu(n,d,r,l),Nu(n)}function Bl(n,r,l){if(r=r.updateQueue,r!==null&&(r=r.shared,(l&4194048)!==0)){var d=r.lanes;d&=n.pendingLanes,l|=d,r.lanes=l,Ie(n,l)}}function Bf(n,r){var l=n.updateQueue,d=n.alternate;if(d!==null&&(d=d.updateQueue,l===d)){var g=null,v=null;if(l=l.firstBaseUpdate,l!==null){do{var w={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};v===null?g=v=w:v=v.next=w,l=l.next}while(l!==null);v===null?g=v=r:v=v.next=r}else g=v=r;l={baseState:d.baseState,firstBaseUpdate:g,lastBaseUpdate:v,shared:d.shared,callbacks:d.callbacks},n.updateQueue=l;return}n=l.lastBaseUpdate,n===null?l.firstBaseUpdate=r:n.next=r,l.lastBaseUpdate=r}var zf=!1;function zl(){if(zf){var n=_o;if(n!==null)throw n}}function Il(n,r,l,d){zf=!1;var g=n.updateQueue;Cr=!1;var v=g.firstBaseUpdate,w=g.lastBaseUpdate,T=g.shared.pending;if(T!==null){g.shared.pending=null;var B=T,ee=B.next;B.next=null,w===null?v=ee:w.next=ee,w=B;var se=n.alternate;se!==null&&(se=se.updateQueue,T=se.lastBaseUpdate,T!==w&&(T===null?se.firstBaseUpdate=ee:T.next=ee,se.lastBaseUpdate=B))}if(v!==null){var le=g.baseState;w=0,se=ee=B=null,T=v;do{var te=T.lane&-536870913,ie=te!==T.lane;if(ie?(it&te)===te:(d&te)===te){te!==0&&te===vo&&(zf=!0),se!==null&&(se=se.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var Ne=n,Le=T;te=r;var yt=l;switch(Le.tag){case 1:if(Ne=Le.payload,typeof Ne=="function"){le=Ne.call(yt,le,te);break e}le=Ne;break e;case 3:Ne.flags=Ne.flags&-65537|128;case 0:if(Ne=Le.payload,te=typeof Ne=="function"?Ne.call(yt,le,te):Ne,te==null)break e;le=b({},le,te);break e;case 2:Cr=!0}}te=T.callback,te!==null&&(n.flags|=64,ie&&(n.flags|=8192),ie=g.callbacks,ie===null?g.callbacks=[te]:ie.push(te))}else ie={lane:te,tag:T.tag,payload:T.payload,callback:T.callback,next:null},se===null?(ee=se=ie,B=le):se=se.next=ie,w|=te;if(T=T.next,T===null){if(T=g.shared.pending,T===null)break;ie=T,T=ie.next,ie.next=null,g.lastBaseUpdate=ie,g.shared.pending=null}}while(!0);se===null&&(B=le),g.baseState=B,g.firstBaseUpdate=ee,g.lastBaseUpdate=se,v===null&&(g.shared.lanes=0),Dr|=w,n.lanes=w,n.memoizedState=le}}function l_(n,r){if(typeof n!="function")throw Error(s(191,n));n.call(r)}function c_(n,r){var l=n.callbacks;if(l!==null)for(n.callbacks=null,n=0;n<l.length;n++)l_(l[n],r)}var So=j(null),zu=j(0);function u_(n,r){n=ir,he(zu,n),he(So,r),ir=n|r.baseLanes}function If(){he(zu,ir),he(So,So.current)}function Pf(){ir=zu.current,W(So),W(zu)}var yn=j(null),zn=null;function Ar(n){var r=n.alternate;he(Wt,Wt.current&1),he(yn,n),zn===null&&(r===null||So.current!==null||r.memoizedState!==null)&&(zn=n)}function $f(n){he(Wt,Wt.current),he(yn,n),zn===null&&(zn=n)}function d_(n){n.tag===22?(he(Wt,Wt.current),he(yn,n),zn===null&&(zn=n)):Mr()}function Mr(){he(Wt,Wt.current),he(yn,yn.current)}function Sn(n){W(yn),zn===n&&(zn=null),W(Wt)}var Wt=j(0);function Iu(n){for(var r=n;r!==null;){if(r.tag===13){var l=r.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Km(l)||Gm(l)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===n)break;for(;r.sibling===null;){if(r.return===null||r.return===n)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var Ws=0,Ve=null,_t=null,ei=null,Pu=!1,wo=!1,ka=!1,$u=0,Pl=0,ko=null,U5=0;function $t(){throw Error(s(321))}function Uf(n,r){if(r===null)return!1;for(var l=0;l<r.length&&l<n.length;l++)if(!_n(n[l],r[l]))return!1;return!0}function Hf(n,r,l,d,g,v){return Ws=v,Ve=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,O.H=n===null||n.memoizedState===null?W_:nm,ka=!1,v=l(d,g),ka=!1,wo&&(v=f_(r,l,d,g)),h_(n),v}function h_(n){O.H=Hl;var r=_t!==null&&_t.next!==null;if(Ws=0,ei=_t=Ve=null,Pu=!1,Pl=0,ko=null,r)throw Error(s(300));n===null||ti||(n=n.dependencies,n!==null&&Mu(n)&&(ti=!0))}function f_(n,r,l,d){Ve=n;var g=0;do{if(wo&&(ko=null),Pl=0,wo=!1,25<=g)throw Error(s(301));if(g+=1,ei=_t=null,n.updateQueue!=null){var v=n.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}O.H=Y_,v=r(l,d)}while(wo);return v}function H5(){var n=O.H,r=n.useState()[0];return r=typeof r.then=="function"?$l(r):r,n=n.useState()[0],(_t!==null?_t.memoizedState:null)!==n&&(Ve.flags|=1024),r}function Ff(){var n=$u!==0;return $u=0,n}function Vf(n,r,l){r.updateQueue=n.updateQueue,r.flags&=-2053,n.lanes&=~l}function qf(n){if(Pu){for(n=n.memoizedState;n!==null;){var r=n.queue;r!==null&&(r.pending=null),n=n.next}Pu=!1}Ws=0,ei=_t=Ve=null,wo=!1,Pl=$u=0,ko=null}function Wi(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ei===null?Ve.memoizedState=ei=n:ei=ei.next=n,ei}function Yt(){if(_t===null){var n=Ve.alternate;n=n!==null?n.memoizedState:null}else n=_t.next;var r=ei===null?Ve.memoizedState:ei.next;if(r!==null)ei=r,_t=n;else{if(n===null)throw Ve.alternate===null?Error(s(467)):Error(s(310));_t=n,n={memoizedState:_t.memoizedState,baseState:_t.baseState,baseQueue:_t.baseQueue,queue:_t.queue,next:null},ei===null?Ve.memoizedState=ei=n:ei=ei.next=n}return ei}function Uu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function $l(n){var r=Pl;return Pl+=1,ko===null&&(ko=[]),n=n_(ko,n,r),r=Ve,(ei===null?r.memoizedState:ei.next)===null&&(r=r.alternate,O.H=r===null||r.memoizedState===null?W_:nm),n}function Hu(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return $l(n);if(n.$$typeof===N)return Ni(n)}throw Error(s(438,String(n)))}function Kf(n){var r=null,l=Ve.updateQueue;if(l!==null&&(r=l.memoCache),r==null){var d=Ve.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(r={data:d.data.map(function(g){return g.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),l===null&&(l=Uu(),Ve.updateQueue=l),l.memoCache=r,l=r.data[r.index],l===void 0)for(l=r.data[r.index]=Array(n),d=0;d<n;d++)l[d]=I;return r.index++,l}function Ys(n,r){return typeof r=="function"?r(n):r}function Fu(n){var r=Yt();return Gf(r,_t,n)}function Gf(n,r,l){var d=n.queue;if(d===null)throw Error(s(311));d.lastRenderedReducer=l;var g=n.baseQueue,v=d.pending;if(v!==null){if(g!==null){var w=g.next;g.next=v.next,v.next=w}r.baseQueue=g=v,d.pending=null}if(v=n.baseState,g===null)n.memoizedState=v;else{r=g.next;var T=w=null,B=null,ee=r,se=!1;do{var le=ee.lane&-536870913;if(le!==ee.lane?(it&le)===le:(Ws&le)===le){var te=ee.revertLane;if(te===0)B!==null&&(B=B.next={lane:0,revertLane:0,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null}),le===vo&&(se=!0);else if((Ws&te)===te){ee=ee.next,te===vo&&(se=!0);continue}else le={lane:0,revertLane:ee.revertLane,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},B===null?(T=B=le,w=v):B=B.next=le,Ve.lanes|=te,Dr|=te;le=ee.action,ka&&l(v,le),v=ee.hasEagerState?ee.eagerState:l(v,le)}else te={lane:le,revertLane:ee.revertLane,gesture:ee.gesture,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},B===null?(T=B=te,w=v):B=B.next=te,Ve.lanes|=le,Dr|=le;ee=ee.next}while(ee!==null&&ee!==r);if(B===null?w=v:B.next=T,!_n(v,n.memoizedState)&&(ti=!0,se&&(l=_o,l!==null)))throw l;n.memoizedState=v,n.baseState=w,n.baseQueue=B,d.lastRenderedState=v}return g===null&&(d.lanes=0),[n.memoizedState,d.dispatch]}function Wf(n){var r=Yt(),l=r.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=n;var d=l.dispatch,g=l.pending,v=r.memoizedState;if(g!==null){l.pending=null;var w=g=g.next;do v=n(v,w.action),w=w.next;while(w!==g);_n(v,r.memoizedState)||(ti=!0),r.memoizedState=v,r.baseQueue===null&&(r.baseState=v),l.lastRenderedState=v}return[v,d]}function m_(n,r,l){var d=Ve,g=Yt(),v=st;if(v){if(l===void 0)throw Error(s(407));l=l()}else l=r();var w=!_n((_t||g).memoizedState,l);if(w&&(g.memoizedState=l,ti=!0),g=g.queue,Zf(b_.bind(null,d,g,n),[n]),g.getSnapshot!==r||w||ei!==null&&ei.memoizedState.tag&1){if(d.flags|=2048,Eo(9,{destroy:void 0},g_.bind(null,d,g,l,r),null),kt===null)throw Error(s(349));v||(Ws&127)!==0||p_(d,r,l)}return l}function p_(n,r,l){n.flags|=16384,n={getSnapshot:r,value:l},r=Ve.updateQueue,r===null?(r=Uu(),Ve.updateQueue=r,r.stores=[n]):(l=r.stores,l===null?r.stores=[n]:l.push(n))}function g_(n,r,l,d){r.value=l,r.getSnapshot=d,v_(r)&&__(n)}function b_(n,r,l){return l(function(){v_(r)&&__(n)})}function v_(n){var r=n.getSnapshot;n=n.value;try{var l=r();return!_n(n,l)}catch{return!0}}function __(n){var r=pa(n,2);r!==null&&un(r,n,2)}function Yf(n){var r=Wi();if(typeof n=="function"){var l=n;if(n=l(),ka){Mn(!0);try{l()}finally{Mn(!1)}}}return r.memoizedState=r.baseState=n,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ys,lastRenderedState:n},r}function x_(n,r,l,d){return n.baseState=l,Gf(n,_t,typeof d=="function"?d:Ys)}function F5(n,r,l,d,g){if(Ku(n))throw Error(s(485));if(n=r.action,n!==null){var v={payload:g,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){v.listeners.push(w)}};O.T!==null?l(!0):v.isTransition=!1,d(v),l=r.pending,l===null?(v.next=r.pending=v,y_(r,v)):(v.next=l.next,r.pending=l.next=v)}}function y_(n,r){var l=r.action,d=r.payload,g=n.state;if(r.isTransition){var v=O.T,w={};O.T=w;try{var T=l(g,d),B=O.S;B!==null&&B(w,T),S_(n,r,T)}catch(ee){Xf(n,r,ee)}finally{v!==null&&w.types!==null&&(v.types=w.types),O.T=v}}else try{v=l(g,d),S_(n,r,v)}catch(ee){Xf(n,r,ee)}}function S_(n,r,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(d){w_(n,r,d)},function(d){return Xf(n,r,d)}):w_(n,r,l)}function w_(n,r,l){r.status="fulfilled",r.value=l,k_(r),n.state=l,r=n.pending,r!==null&&(l=r.next,l===r?n.pending=null:(l=l.next,r.next=l,y_(n,l)))}function Xf(n,r,l){var d=n.pending;if(n.pending=null,d!==null){d=d.next;do r.status="rejected",r.reason=l,k_(r),r=r.next;while(r!==d)}n.action=null}function k_(n){n=n.listeners;for(var r=0;r<n.length;r++)(0,n[r])()}function E_(n,r){return r}function C_(n,r){if(st){var l=kt.formState;if(l!==null){e:{var d=Ve;if(st){if(Tt){t:{for(var g=Tt,v=Bn;g.nodeType!==8;){if(!v){g=null;break t}if(g=In(g.nextSibling),g===null){g=null;break t}}v=g.data,g=v==="F!"||v==="F"?g:null}if(g){Tt=In(g.nextSibling),d=g.data==="F!";break e}}kr(d)}d=!1}d&&(r=l[0])}}return l=Wi(),l.memoizedState=l.baseState=r,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:E_,lastRenderedState:r},l.queue=d,l=q_.bind(null,Ve,d),d.dispatch=l,d=Yf(!1),v=im.bind(null,Ve,!1,d.queue),d=Wi(),g={state:r,dispatch:null,action:n,pending:null},d.queue=g,l=F5.bind(null,Ve,g,v,l),g.dispatch=l,d.memoizedState=n,[r,l,!1]}function N_(n){var r=Yt();return T_(r,_t,n)}function T_(n,r,l){if(r=Gf(n,r,E_)[0],n=Fu(Ys)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var d=$l(r)}catch(w){throw w===xo?Du:w}else d=r;r=Yt();var g=r.queue,v=g.dispatch;return l!==r.memoizedState&&(Ve.flags|=2048,Eo(9,{destroy:void 0},V5.bind(null,g,l),null)),[d,v,n]}function V5(n,r){n.action=r}function A_(n){var r=Yt(),l=_t;if(l!==null)return T_(r,l,n);Yt(),r=r.memoizedState,l=Yt();var d=l.queue.dispatch;return l.memoizedState=n,[r,d,!1]}function Eo(n,r,l,d){return n={tag:n,create:l,deps:d,inst:r,next:null},r=Ve.updateQueue,r===null&&(r=Uu(),Ve.updateQueue=r),l=r.lastEffect,l===null?r.lastEffect=n.next=n:(d=l.next,l.next=n,n.next=d,r.lastEffect=n),n}function M_(){return Yt().memoizedState}function Vu(n,r,l,d){var g=Wi();Ve.flags|=n,g.memoizedState=Eo(1|r,{destroy:void 0},l,d===void 0?null:d)}function qu(n,r,l,d){var g=Yt();d=d===void 0?null:d;var v=g.memoizedState.inst;_t!==null&&d!==null&&Uf(d,_t.memoizedState.deps)?g.memoizedState=Eo(r,v,l,d):(Ve.flags|=n,g.memoizedState=Eo(1|r,v,l,d))}function R_(n,r){Vu(8390656,8,n,r)}function Zf(n,r){qu(2048,8,n,r)}function q5(n){Ve.flags|=4;var r=Ve.updateQueue;if(r===null)r=Uu(),Ve.updateQueue=r,r.events=[n];else{var l=r.events;l===null?r.events=[n]:l.push(n)}}function j_(n){var r=Yt().memoizedState;return q5({ref:r,nextImpl:n}),function(){if((ht&2)!==0)throw Error(s(440));return r.impl.apply(void 0,arguments)}}function D_(n,r){return qu(4,2,n,r)}function O_(n,r){return qu(4,4,n,r)}function L_(n,r){if(typeof r=="function"){n=n();var l=r(n);return function(){typeof l=="function"?l():r(null)}}if(r!=null)return n=n(),r.current=n,function(){r.current=null}}function B_(n,r,l){l=l!=null?l.concat([n]):null,qu(4,4,L_.bind(null,r,n),l)}function Qf(){}function z_(n,r){var l=Yt();r=r===void 0?null:r;var d=l.memoizedState;return r!==null&&Uf(r,d[1])?d[0]:(l.memoizedState=[n,r],n)}function I_(n,r){var l=Yt();r=r===void 0?null:r;var d=l.memoizedState;if(r!==null&&Uf(r,d[1]))return d[0];if(d=n(),ka){Mn(!0);try{n()}finally{Mn(!1)}}return l.memoizedState=[d,r],d}function Jf(n,r,l){return l===void 0||(Ws&1073741824)!==0&&(it&261930)===0?n.memoizedState=r:(n.memoizedState=l,n=P1(),Ve.lanes|=n,Dr|=n,l)}function P_(n,r,l,d){return _n(l,r)?l:So.current!==null?(n=Jf(n,l,d),_n(n,r)||(ti=!0),n):(Ws&42)===0||(Ws&1073741824)!==0&&(it&261930)===0?(ti=!0,n.memoizedState=l):(n=P1(),Ve.lanes|=n,Dr|=n,r)}function $_(n,r,l,d,g){var v=X.p;X.p=v!==0&&8>v?v:8;var w=O.T,T={};O.T=T,im(n,!1,r,l);try{var B=g(),ee=O.S;if(ee!==null&&ee(T,B),B!==null&&typeof B=="object"&&typeof B.then=="function"){var se=$5(B,d);Ul(n,r,se,En(n))}else Ul(n,r,d,En(n))}catch(le){Ul(n,r,{then:function(){},status:"rejected",reason:le},En())}finally{X.p=v,w!==null&&T.types!==null&&(w.types=T.types),O.T=w}}function K5(){}function em(n,r,l,d){if(n.tag!==5)throw Error(s(476));var g=U_(n).queue;$_(n,g,r,Z,l===null?K5:function(){return H_(n),l(d)})}function U_(n){var r=n.memoizedState;if(r!==null)return r;r={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ys,lastRenderedState:Z},next:null};var l={};return r.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ys,lastRenderedState:l},next:null},n.memoizedState=r,n=n.alternate,n!==null&&(n.memoizedState=r),r}function H_(n){var r=U_(n);r.next===null&&(r=n.alternate.memoizedState),Ul(n,r.next.queue,{},En())}function tm(){return Ni(sc)}function F_(){return Yt().memoizedState}function V_(){return Yt().memoizedState}function G5(n){for(var r=n.return;r!==null;){switch(r.tag){case 24:case 3:var l=En();n=Nr(l);var d=Tr(r,n,l);d!==null&&(un(d,r,l),Bl(d,r,l)),r={cache:Mf()},n.payload=r;return}r=r.return}}function W5(n,r,l){var d=En();l={lane:d,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Ku(n)?K_(r,l):(l=_f(n,r,l,d),l!==null&&(un(l,n,d),G_(l,r,d)))}function q_(n,r,l){var d=En();Ul(n,r,l,d)}function Ul(n,r,l,d){var g={lane:d,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Ku(n))K_(r,g);else{var v=n.alternate;if(n.lanes===0&&(v===null||v.lanes===0)&&(v=r.lastRenderedReducer,v!==null))try{var w=r.lastRenderedState,T=v(w,l);if(g.hasEagerState=!0,g.eagerState=T,_n(T,w))return Cu(n,r,g,0),kt===null&&Eu(),!1}catch{}if(l=_f(n,r,g,d),l!==null)return un(l,n,d),G_(l,r,d),!0}return!1}function im(n,r,l,d){if(d={lane:2,revertLane:Om(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},Ku(n)){if(r)throw Error(s(479))}else r=_f(n,l,d,2),r!==null&&un(r,n,2)}function Ku(n){var r=n.alternate;return n===Ve||r!==null&&r===Ve}function K_(n,r){wo=Pu=!0;var l=n.pending;l===null?r.next=r:(r.next=l.next,l.next=r),n.pending=r}function G_(n,r,l){if((l&4194048)!==0){var d=r.lanes;d&=n.pendingLanes,l|=d,r.lanes=l,Ie(n,l)}}var Hl={readContext:Ni,use:Hu,useCallback:$t,useContext:$t,useEffect:$t,useImperativeHandle:$t,useLayoutEffect:$t,useInsertionEffect:$t,useMemo:$t,useReducer:$t,useRef:$t,useState:$t,useDebugValue:$t,useDeferredValue:$t,useTransition:$t,useSyncExternalStore:$t,useId:$t,useHostTransitionStatus:$t,useFormState:$t,useActionState:$t,useOptimistic:$t,useMemoCache:$t,useCacheRefresh:$t};Hl.useEffectEvent=$t;var W_={readContext:Ni,use:Hu,useCallback:function(n,r){return Wi().memoizedState=[n,r===void 0?null:r],n},useContext:Ni,useEffect:R_,useImperativeHandle:function(n,r,l){l=l!=null?l.concat([n]):null,Vu(4194308,4,L_.bind(null,r,n),l)},useLayoutEffect:function(n,r){return Vu(4194308,4,n,r)},useInsertionEffect:function(n,r){Vu(4,2,n,r)},useMemo:function(n,r){var l=Wi();r=r===void 0?null:r;var d=n();if(ka){Mn(!0);try{n()}finally{Mn(!1)}}return l.memoizedState=[d,r],d},useReducer:function(n,r,l){var d=Wi();if(l!==void 0){var g=l(r);if(ka){Mn(!0);try{l(r)}finally{Mn(!1)}}}else g=r;return d.memoizedState=d.baseState=g,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:g},d.queue=n,n=n.dispatch=W5.bind(null,Ve,n),[d.memoizedState,n]},useRef:function(n){var r=Wi();return n={current:n},r.memoizedState=n},useState:function(n){n=Yf(n);var r=n.queue,l=q_.bind(null,Ve,r);return r.dispatch=l,[n.memoizedState,l]},useDebugValue:Qf,useDeferredValue:function(n,r){var l=Wi();return Jf(l,n,r)},useTransition:function(){var n=Yf(!1);return n=$_.bind(null,Ve,n.queue,!0,!1),Wi().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,r,l){var d=Ve,g=Wi();if(st){if(l===void 0)throw Error(s(407));l=l()}else{if(l=r(),kt===null)throw Error(s(349));(it&127)!==0||p_(d,r,l)}g.memoizedState=l;var v={value:l,getSnapshot:r};return g.queue=v,R_(b_.bind(null,d,v,n),[n]),d.flags|=2048,Eo(9,{destroy:void 0},g_.bind(null,d,v,l,r),null),l},useId:function(){var n=Wi(),r=kt.identifierPrefix;if(st){var l=fs,d=hs;l=(d&~(1<<32-ki(d)-1)).toString(32)+l,r="_"+r+"R_"+l,l=$u++,0<l&&(r+="H"+l.toString(32)),r+="_"}else l=U5++,r="_"+r+"r_"+l.toString(32)+"_";return n.memoizedState=r},useHostTransitionStatus:tm,useFormState:C_,useActionState:C_,useOptimistic:function(n){var r=Wi();r.memoizedState=r.baseState=n;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=l,r=im.bind(null,Ve,!0,l),l.dispatch=r,[n,r]},useMemoCache:Kf,useCacheRefresh:function(){return Wi().memoizedState=G5.bind(null,Ve)},useEffectEvent:function(n){var r=Wi(),l={impl:n};return r.memoizedState=l,function(){if((ht&2)!==0)throw Error(s(440));return l.impl.apply(void 0,arguments)}}},nm={readContext:Ni,use:Hu,useCallback:z_,useContext:Ni,useEffect:Zf,useImperativeHandle:B_,useInsertionEffect:D_,useLayoutEffect:O_,useMemo:I_,useReducer:Fu,useRef:M_,useState:function(){return Fu(Ys)},useDebugValue:Qf,useDeferredValue:function(n,r){var l=Yt();return P_(l,_t.memoizedState,n,r)},useTransition:function(){var n=Fu(Ys)[0],r=Yt().memoizedState;return[typeof n=="boolean"?n:$l(n),r]},useSyncExternalStore:m_,useId:F_,useHostTransitionStatus:tm,useFormState:N_,useActionState:N_,useOptimistic:function(n,r){var l=Yt();return x_(l,_t,n,r)},useMemoCache:Kf,useCacheRefresh:V_};nm.useEffectEvent=j_;var Y_={readContext:Ni,use:Hu,useCallback:z_,useContext:Ni,useEffect:Zf,useImperativeHandle:B_,useInsertionEffect:D_,useLayoutEffect:O_,useMemo:I_,useReducer:Wf,useRef:M_,useState:function(){return Wf(Ys)},useDebugValue:Qf,useDeferredValue:function(n,r){var l=Yt();return _t===null?Jf(l,n,r):P_(l,_t.memoizedState,n,r)},useTransition:function(){var n=Wf(Ys)[0],r=Yt().memoizedState;return[typeof n=="boolean"?n:$l(n),r]},useSyncExternalStore:m_,useId:F_,useHostTransitionStatus:tm,useFormState:A_,useActionState:A_,useOptimistic:function(n,r){var l=Yt();return _t!==null?x_(l,_t,n,r):(l.baseState=n,[n,l.queue.dispatch])},useMemoCache:Kf,useCacheRefresh:V_};Y_.useEffectEvent=j_;function sm(n,r,l,d){r=n.memoizedState,l=l(d,r),l=l==null?r:b({},r,l),n.memoizedState=l,n.lanes===0&&(n.updateQueue.baseState=l)}var rm={enqueueSetState:function(n,r,l){n=n._reactInternals;var d=En(),g=Nr(d);g.payload=r,l!=null&&(g.callback=l),r=Tr(n,g,d),r!==null&&(un(r,n,d),Bl(r,n,d))},enqueueReplaceState:function(n,r,l){n=n._reactInternals;var d=En(),g=Nr(d);g.tag=1,g.payload=r,l!=null&&(g.callback=l),r=Tr(n,g,d),r!==null&&(un(r,n,d),Bl(r,n,d))},enqueueForceUpdate:function(n,r){n=n._reactInternals;var l=En(),d=Nr(l);d.tag=2,r!=null&&(d.callback=r),r=Tr(n,d,l),r!==null&&(un(r,n,l),Bl(r,n,l))}};function X_(n,r,l,d,g,v,w){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(d,v,w):r.prototype&&r.prototype.isPureReactComponent?!Tl(l,d)||!Tl(g,v):!0}function Z_(n,r,l,d){n=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(l,d),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(l,d),r.state!==n&&rm.enqueueReplaceState(r,r.state,null)}function Ea(n,r){var l=r;if("ref"in r){l={};for(var d in r)d!=="ref"&&(l[d]=r[d])}if(n=n.defaultProps){l===r&&(l=b({},l));for(var g in n)l[g]===void 0&&(l[g]=n[g])}return l}function Q_(n){ku(n)}function J_(n){console.error(n)}function e1(n){ku(n)}function Gu(n,r){try{var l=n.onUncaughtError;l(r.value,{componentStack:r.stack})}catch(d){setTimeout(function(){throw d})}}function t1(n,r,l){try{var d=n.onCaughtError;d(l.value,{componentStack:l.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function am(n,r,l){return l=Nr(l),l.tag=3,l.payload={element:null},l.callback=function(){Gu(n,r)},l}function i1(n){return n=Nr(n),n.tag=3,n}function n1(n,r,l,d){var g=l.type.getDerivedStateFromError;if(typeof g=="function"){var v=d.value;n.payload=function(){return g(v)},n.callback=function(){t1(r,l,d)}}var w=l.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(n.callback=function(){t1(r,l,d),typeof g!="function"&&(Or===null?Or=new Set([this]):Or.add(this));var T=d.stack;this.componentDidCatch(d.value,{componentStack:T!==null?T:""})})}function Y5(n,r,l,d,g){if(l.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(r=l.alternate,r!==null&&bo(r,l,g,!0),l=yn.current,l!==null){switch(l.tag){case 31:case 13:return zn===null?rd():l.alternate===null&&Ut===0&&(Ut=3),l.flags&=-257,l.flags|=65536,l.lanes=g,d===Ou?l.flags|=16384:(r=l.updateQueue,r===null?l.updateQueue=new Set([d]):r.add(d),Rm(n,d,g)),!1;case 22:return l.flags|=65536,d===Ou?l.flags|=16384:(r=l.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([d])},l.updateQueue=r):(l=r.retryQueue,l===null?r.retryQueue=new Set([d]):l.add(d)),Rm(n,d,g)),!1}throw Error(s(435,l.tag))}return Rm(n,d,g),rd(),!1}if(st)return r=yn.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=g,d!==Ef&&(n=Error(s(422),{cause:d}),Rl(Dn(n,l)))):(d!==Ef&&(r=Error(s(423),{cause:d}),Rl(Dn(r,l))),n=n.current.alternate,n.flags|=65536,g&=-g,n.lanes|=g,d=Dn(d,l),g=am(n.stateNode,d,g),Bf(n,g),Ut!==4&&(Ut=2)),!1;var v=Error(s(520),{cause:d});if(v=Dn(v,l),Xl===null?Xl=[v]:Xl.push(v),Ut!==4&&(Ut=2),r===null)return!0;d=Dn(d,l),l=r;do{switch(l.tag){case 3:return l.flags|=65536,n=g&-g,l.lanes|=n,n=am(l.stateNode,d,n),Bf(l,n),!1;case 1:if(r=l.type,v=l.stateNode,(l.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Or===null||!Or.has(v))))return l.flags|=65536,g&=-g,l.lanes|=g,g=i1(g),n1(g,n,l,d),Bf(l,g),!1}l=l.return}while(l!==null);return!1}var om=Error(s(461)),ti=!1;function Ti(n,r,l,d){r.child=n===null?o_(r,null,l,d):wa(r,n.child,l,d)}function s1(n,r,l,d,g){l=l.render;var v=r.ref;if("ref"in d){var w={};for(var T in d)T!=="ref"&&(w[T]=d[T])}else w=d;return _a(r),d=Hf(n,r,l,w,v,g),T=Ff(),n!==null&&!ti?(Vf(n,r,g),Xs(n,r,g)):(st&&T&&wf(r),r.flags|=1,Ti(n,r,d,g),r.child)}function r1(n,r,l,d,g){if(n===null){var v=l.type;return typeof v=="function"&&!xf(v)&&v.defaultProps===void 0&&l.compare===null?(r.tag=15,r.type=v,a1(n,r,v,d,g)):(n=Tu(l.type,null,d,r,r.mode,g),n.ref=r.ref,n.return=r,r.child=n)}if(v=n.child,!pm(n,g)){var w=v.memoizedProps;if(l=l.compare,l=l!==null?l:Tl,l(w,d)&&n.ref===r.ref)return Xs(n,r,g)}return r.flags|=1,n=Vs(v,d),n.ref=r.ref,n.return=r,r.child=n}function a1(n,r,l,d,g){if(n!==null){var v=n.memoizedProps;if(Tl(v,d)&&n.ref===r.ref)if(ti=!1,r.pendingProps=d=v,pm(n,g))(n.flags&131072)!==0&&(ti=!0);else return r.lanes=n.lanes,Xs(n,r,g)}return lm(n,r,l,d,g)}function o1(n,r,l,d){var g=d.children,v=n!==null?n.memoizedState:null;if(n===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((r.flags&128)!==0){if(v=v!==null?v.baseLanes|l:l,n!==null){for(d=r.child=n.child,g=0;d!==null;)g=g|d.lanes|d.childLanes,d=d.sibling;d=g&~v}else d=0,r.child=null;return l1(n,r,v,l,d)}if((l&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},n!==null&&ju(r,v!==null?v.cachePool:null),v!==null?u_(r,v):If(),d_(r);else return d=r.lanes=536870912,l1(n,r,v!==null?v.baseLanes|l:l,l,d)}else v!==null?(ju(r,v.cachePool),u_(r,v),Mr(),r.memoizedState=null):(n!==null&&ju(r,null),If(),Mr());return Ti(n,r,g,l),r.child}function Fl(n,r){return n!==null&&n.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function l1(n,r,l,d,g){var v=jf();return v=v===null?null:{parent:Jt._currentValue,pool:v},r.memoizedState={baseLanes:l,cachePool:v},n!==null&&ju(r,null),If(),d_(r),n!==null&&bo(n,r,d,!0),r.childLanes=g,null}function Wu(n,r){return r=Xu({mode:r.mode,children:r.children},n.mode),r.ref=n.ref,n.child=r,r.return=n,r}function c1(n,r,l){return wa(r,n.child,null,l),n=Wu(r,r.pendingProps),n.flags|=2,Sn(r),r.memoizedState=null,n}function X5(n,r,l){var d=r.pendingProps,g=(r.flags&128)!==0;if(r.flags&=-129,n===null){if(st){if(d.mode==="hidden")return n=Wu(r,d),r.lanes=536870912,Fl(null,n);if($f(r),(n=Tt)?(n=yx(n,Bn),n=n!==null&&n.data==="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:Sr!==null?{id:hs,overflow:fs}:null,retryLane:536870912,hydrationErrors:null},l=Kv(n),l.return=r,r.child=l,Ci=r,Tt=null)):n=null,n===null)throw kr(r);return r.lanes=536870912,null}return Wu(r,d)}var v=n.memoizedState;if(v!==null){var w=v.dehydrated;if($f(r),g)if(r.flags&256)r.flags&=-257,r=c1(n,r,l);else if(r.memoizedState!==null)r.child=n.child,r.flags|=128,r=null;else throw Error(s(558));else if(ti||bo(n,r,l,!1),g=(l&n.childLanes)!==0,ti||g){if(d=kt,d!==null&&(w=qt(d,l),w!==0&&w!==v.retryLane))throw v.retryLane=w,pa(n,w),un(d,n,w),om;rd(),r=c1(n,r,l)}else n=v.treeContext,Tt=In(w.nextSibling),Ci=r,st=!0,wr=null,Bn=!1,n!==null&&Yv(r,n),r=Wu(r,d),r.flags|=4096;return r}return n=Vs(n.child,{mode:d.mode,children:d.children}),n.ref=r.ref,r.child=n,n.return=r,n}function Yu(n,r){var l=r.ref;if(l===null)n!==null&&n.ref!==null&&(r.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(s(284));(n===null||n.ref!==l)&&(r.flags|=4194816)}}function lm(n,r,l,d,g){return _a(r),l=Hf(n,r,l,d,void 0,g),d=Ff(),n!==null&&!ti?(Vf(n,r,g),Xs(n,r,g)):(st&&d&&wf(r),r.flags|=1,Ti(n,r,l,g),r.child)}function u1(n,r,l,d,g,v){return _a(r),r.updateQueue=null,l=f_(r,d,l,g),h_(n),d=Ff(),n!==null&&!ti?(Vf(n,r,v),Xs(n,r,v)):(st&&d&&wf(r),r.flags|=1,Ti(n,r,l,v),r.child)}function d1(n,r,l,d,g){if(_a(r),r.stateNode===null){var v=fo,w=l.contextType;typeof w=="object"&&w!==null&&(v=Ni(w)),v=new l(d,v),r.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=rm,r.stateNode=v,v._reactInternals=r,v=r.stateNode,v.props=d,v.state=r.memoizedState,v.refs={},Of(r),w=l.contextType,v.context=typeof w=="object"&&w!==null?Ni(w):fo,v.state=r.memoizedState,w=l.getDerivedStateFromProps,typeof w=="function"&&(sm(r,l,w,d),v.state=r.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(w=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),w!==v.state&&rm.enqueueReplaceState(v,v.state,null),Il(r,d,v,g),zl(),v.state=r.memoizedState),typeof v.componentDidMount=="function"&&(r.flags|=4194308),d=!0}else if(n===null){v=r.stateNode;var T=r.memoizedProps,B=Ea(l,T);v.props=B;var ee=v.context,se=l.contextType;w=fo,typeof se=="object"&&se!==null&&(w=Ni(se));var le=l.getDerivedStateFromProps;se=typeof le=="function"||typeof v.getSnapshotBeforeUpdate=="function",T=r.pendingProps!==T,se||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(T||ee!==w)&&Z_(r,v,d,w),Cr=!1;var te=r.memoizedState;v.state=te,Il(r,d,v,g),zl(),ee=r.memoizedState,T||te!==ee||Cr?(typeof le=="function"&&(sm(r,l,le,d),ee=r.memoizedState),(B=Cr||X_(r,l,B,d,te,ee,w))?(se||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(r.flags|=4194308)):(typeof v.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=d,r.memoizedState=ee),v.props=d,v.state=ee,v.context=w,d=B):(typeof v.componentDidMount=="function"&&(r.flags|=4194308),d=!1)}else{v=r.stateNode,Lf(n,r),w=r.memoizedProps,se=Ea(l,w),v.props=se,le=r.pendingProps,te=v.context,ee=l.contextType,B=fo,typeof ee=="object"&&ee!==null&&(B=Ni(ee)),T=l.getDerivedStateFromProps,(ee=typeof T=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(w!==le||te!==B)&&Z_(r,v,d,B),Cr=!1,te=r.memoizedState,v.state=te,Il(r,d,v,g),zl();var ie=r.memoizedState;w!==le||te!==ie||Cr||n!==null&&n.dependencies!==null&&Mu(n.dependencies)?(typeof T=="function"&&(sm(r,l,T,d),ie=r.memoizedState),(se=Cr||X_(r,l,se,d,te,ie,B)||n!==null&&n.dependencies!==null&&Mu(n.dependencies))?(ee||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(d,ie,B),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(d,ie,B)),typeof v.componentDidUpdate=="function"&&(r.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof v.componentDidUpdate!="function"||w===n.memoizedProps&&te===n.memoizedState||(r.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||w===n.memoizedProps&&te===n.memoizedState||(r.flags|=1024),r.memoizedProps=d,r.memoizedState=ie),v.props=d,v.state=ie,v.context=B,d=se):(typeof v.componentDidUpdate!="function"||w===n.memoizedProps&&te===n.memoizedState||(r.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||w===n.memoizedProps&&te===n.memoizedState||(r.flags|=1024),d=!1)}return v=d,Yu(n,r),d=(r.flags&128)!==0,v||d?(v=r.stateNode,l=d&&typeof l.getDerivedStateFromError!="function"?null:v.render(),r.flags|=1,n!==null&&d?(r.child=wa(r,n.child,null,g),r.child=wa(r,null,l,g)):Ti(n,r,l,g),r.memoizedState=v.state,n=r.child):n=Xs(n,r,g),n}function h1(n,r,l,d){return ba(),r.flags|=256,Ti(n,r,l,d),r.child}var cm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function um(n){return{baseLanes:n,cachePool:t_()}}function dm(n,r,l){return n=n!==null?n.childLanes&~l:0,r&&(n|=kn),n}function f1(n,r,l){var d=r.pendingProps,g=!1,v=(r.flags&128)!==0,w;if((w=v)||(w=n!==null&&n.memoizedState===null?!1:(Wt.current&2)!==0),w&&(g=!0,r.flags&=-129),w=(r.flags&32)!==0,r.flags&=-33,n===null){if(st){if(g?Ar(r):Mr(),(n=Tt)?(n=yx(n,Bn),n=n!==null&&n.data!=="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:Sr!==null?{id:hs,overflow:fs}:null,retryLane:536870912,hydrationErrors:null},l=Kv(n),l.return=r,r.child=l,Ci=r,Tt=null)):n=null,n===null)throw kr(r);return Gm(n)?r.lanes=32:r.lanes=536870912,null}var T=d.children;return d=d.fallback,g?(Mr(),g=r.mode,T=Xu({mode:"hidden",children:T},g),d=ga(d,g,l,null),T.return=r,d.return=r,T.sibling=d,r.child=T,d=r.child,d.memoizedState=um(l),d.childLanes=dm(n,w,l),r.memoizedState=cm,Fl(null,d)):(Ar(r),hm(r,T))}var B=n.memoizedState;if(B!==null&&(T=B.dehydrated,T!==null)){if(v)r.flags&256?(Ar(r),r.flags&=-257,r=fm(n,r,l)):r.memoizedState!==null?(Mr(),r.child=n.child,r.flags|=128,r=null):(Mr(),T=d.fallback,g=r.mode,d=Xu({mode:"visible",children:d.children},g),T=ga(T,g,l,null),T.flags|=2,d.return=r,T.return=r,d.sibling=T,r.child=d,wa(r,n.child,null,l),d=r.child,d.memoizedState=um(l),d.childLanes=dm(n,w,l),r.memoizedState=cm,r=Fl(null,d));else if(Ar(r),Gm(T)){if(w=T.nextSibling&&T.nextSibling.dataset,w)var ee=w.dgst;w=ee,d=Error(s(419)),d.stack="",d.digest=w,Rl({value:d,source:null,stack:null}),r=fm(n,r,l)}else if(ti||bo(n,r,l,!1),w=(l&n.childLanes)!==0,ti||w){if(w=kt,w!==null&&(d=qt(w,l),d!==0&&d!==B.retryLane))throw B.retryLane=d,pa(n,d),un(w,n,d),om;Km(T)||rd(),r=fm(n,r,l)}else Km(T)?(r.flags|=192,r.child=n.child,r=null):(n=B.treeContext,Tt=In(T.nextSibling),Ci=r,st=!0,wr=null,Bn=!1,n!==null&&Yv(r,n),r=hm(r,d.children),r.flags|=4096);return r}return g?(Mr(),T=d.fallback,g=r.mode,B=n.child,ee=B.sibling,d=Vs(B,{mode:"hidden",children:d.children}),d.subtreeFlags=B.subtreeFlags&65011712,ee!==null?T=Vs(ee,T):(T=ga(T,g,l,null),T.flags|=2),T.return=r,d.return=r,d.sibling=T,r.child=d,Fl(null,d),d=r.child,T=n.child.memoizedState,T===null?T=um(l):(g=T.cachePool,g!==null?(B=Jt._currentValue,g=g.parent!==B?{parent:B,pool:B}:g):g=t_(),T={baseLanes:T.baseLanes|l,cachePool:g}),d.memoizedState=T,d.childLanes=dm(n,w,l),r.memoizedState=cm,Fl(n.child,d)):(Ar(r),l=n.child,n=l.sibling,l=Vs(l,{mode:"visible",children:d.children}),l.return=r,l.sibling=null,n!==null&&(w=r.deletions,w===null?(r.deletions=[n],r.flags|=16):w.push(n)),r.child=l,r.memoizedState=null,l)}function hm(n,r){return r=Xu({mode:"visible",children:r},n.mode),r.return=n,n.child=r}function Xu(n,r){return n=xn(22,n,null,r),n.lanes=0,n}function fm(n,r,l){return wa(r,n.child,null,l),n=hm(r,r.pendingProps.children),n.flags|=2,r.memoizedState=null,n}function m1(n,r,l){n.lanes|=r;var d=n.alternate;d!==null&&(d.lanes|=r),Tf(n.return,r,l)}function mm(n,r,l,d,g,v){var w=n.memoizedState;w===null?n.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:d,tail:l,tailMode:g,treeForkCount:v}:(w.isBackwards=r,w.rendering=null,w.renderingStartTime=0,w.last=d,w.tail=l,w.tailMode=g,w.treeForkCount=v)}function p1(n,r,l){var d=r.pendingProps,g=d.revealOrder,v=d.tail;d=d.children;var w=Wt.current,T=(w&2)!==0;if(T?(w=w&1|2,r.flags|=128):w&=1,he(Wt,w),Ti(n,r,d,l),d=st?Ml:0,!T&&n!==null&&(n.flags&128)!==0)e:for(n=r.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&m1(n,l,r);else if(n.tag===19)m1(n,l,r);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===r)break e;for(;n.sibling===null;){if(n.return===null||n.return===r)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(g){case"forwards":for(l=r.child,g=null;l!==null;)n=l.alternate,n!==null&&Iu(n)===null&&(g=l),l=l.sibling;l=g,l===null?(g=r.child,r.child=null):(g=l.sibling,l.sibling=null),mm(r,!1,g,l,v,d);break;case"backwards":case"unstable_legacy-backwards":for(l=null,g=r.child,r.child=null;g!==null;){if(n=g.alternate,n!==null&&Iu(n)===null){r.child=g;break}n=g.sibling,g.sibling=l,l=g,g=n}mm(r,!0,l,null,v,d);break;case"together":mm(r,!1,null,null,void 0,d);break;default:r.memoizedState=null}return r.child}function Xs(n,r,l){if(n!==null&&(r.dependencies=n.dependencies),Dr|=r.lanes,(l&r.childLanes)===0)if(n!==null){if(bo(n,r,l,!1),(l&r.childLanes)===0)return null}else return null;if(n!==null&&r.child!==n.child)throw Error(s(153));if(r.child!==null){for(n=r.child,l=Vs(n,n.pendingProps),r.child=l,l.return=r;n.sibling!==null;)n=n.sibling,l=l.sibling=Vs(n,n.pendingProps),l.return=r;l.sibling=null}return r.child}function pm(n,r){return(n.lanes&r)!==0?!0:(n=n.dependencies,!!(n!==null&&Mu(n)))}function Z5(n,r,l){switch(r.tag){case 3:we(r,r.stateNode.containerInfo),Er(r,Jt,n.memoizedState.cache),ba();break;case 27:case 5:Ze(r);break;case 4:we(r,r.stateNode.containerInfo);break;case 10:Er(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,$f(r),null;break;case 13:var d=r.memoizedState;if(d!==null)return d.dehydrated!==null?(Ar(r),r.flags|=128,null):(l&r.child.childLanes)!==0?f1(n,r,l):(Ar(r),n=Xs(n,r,l),n!==null?n.sibling:null);Ar(r);break;case 19:var g=(n.flags&128)!==0;if(d=(l&r.childLanes)!==0,d||(bo(n,r,l,!1),d=(l&r.childLanes)!==0),g){if(d)return p1(n,r,l);r.flags|=128}if(g=r.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),he(Wt,Wt.current),d)break;return null;case 22:return r.lanes=0,o1(n,r,l,r.pendingProps);case 24:Er(r,Jt,n.memoizedState.cache)}return Xs(n,r,l)}function g1(n,r,l){if(n!==null)if(n.memoizedProps!==r.pendingProps)ti=!0;else{if(!pm(n,l)&&(r.flags&128)===0)return ti=!1,Z5(n,r,l);ti=(n.flags&131072)!==0}else ti=!1,st&&(r.flags&1048576)!==0&&Wv(r,Ml,r.index);switch(r.lanes=0,r.tag){case 16:e:{var d=r.pendingProps;if(n=ya(r.elementType),r.type=n,typeof n=="function")xf(n)?(d=Ea(n,d),r.tag=1,r=d1(null,r,n,d,l)):(r.tag=0,r=lm(null,r,n,d,l));else{if(n!=null){var g=n.$$typeof;if(g===M){r.tag=11,r=s1(null,r,n,d,l);break e}else if(g===L){r.tag=14,r=r1(null,r,n,d,l);break e}}throw r=Q(n)||n,Error(s(306,r,""))}}return r;case 0:return lm(n,r,r.type,r.pendingProps,l);case 1:return d=r.type,g=Ea(d,r.pendingProps),d1(n,r,d,g,l);case 3:e:{if(we(r,r.stateNode.containerInfo),n===null)throw Error(s(387));d=r.pendingProps;var v=r.memoizedState;g=v.element,Lf(n,r),Il(r,d,null,l);var w=r.memoizedState;if(d=w.cache,Er(r,Jt,d),d!==v.cache&&Af(r,[Jt],l,!0),zl(),d=w.element,v.isDehydrated)if(v={element:d,isDehydrated:!1,cache:w.cache},r.updateQueue.baseState=v,r.memoizedState=v,r.flags&256){r=h1(n,r,d,l);break e}else if(d!==g){g=Dn(Error(s(424)),r),Rl(g),r=h1(n,r,d,l);break e}else for(n=r.stateNode.containerInfo,n.nodeType===9?n=n.body:n=n.nodeName==="HTML"?n.ownerDocument.body:n,Tt=In(n.firstChild),Ci=r,st=!0,wr=null,Bn=!0,l=o_(r,null,d,l),r.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(ba(),d===g){r=Xs(n,r,l);break e}Ti(n,r,d,l)}r=r.child}return r;case 26:return Yu(n,r),n===null?(l=Nx(r.type,null,r.pendingProps,null))?r.memoizedState=l:st||(l=r.type,n=r.pendingProps,d=hd(ne.current).createElement(l),d[Kt]=r,d[Ii]=n,Ai(d,l,n),Zt(d),r.stateNode=d):r.memoizedState=Nx(r.type,n.memoizedProps,r.pendingProps,n.memoizedState),null;case 27:return Ze(r),n===null&&st&&(d=r.stateNode=kx(r.type,r.pendingProps,ne.current),Ci=r,Bn=!0,g=Tt,Ir(r.type)?(Wm=g,Tt=In(d.firstChild)):Tt=g),Ti(n,r,r.pendingProps.children,l),Yu(n,r),n===null&&(r.flags|=4194304),r.child;case 5:return n===null&&st&&((g=d=Tt)&&(d=NT(d,r.type,r.pendingProps,Bn),d!==null?(r.stateNode=d,Ci=r,Tt=In(d.firstChild),Bn=!1,g=!0):g=!1),g||kr(r)),Ze(r),g=r.type,v=r.pendingProps,w=n!==null?n.memoizedProps:null,d=v.children,Fm(g,v)?d=null:w!==null&&Fm(g,w)&&(r.flags|=32),r.memoizedState!==null&&(g=Hf(n,r,H5,null,null,l),sc._currentValue=g),Yu(n,r),Ti(n,r,d,l),r.child;case 6:return n===null&&st&&((n=l=Tt)&&(l=TT(l,r.pendingProps,Bn),l!==null?(r.stateNode=l,Ci=r,Tt=null,n=!0):n=!1),n||kr(r)),null;case 13:return f1(n,r,l);case 4:return we(r,r.stateNode.containerInfo),d=r.pendingProps,n===null?r.child=wa(r,null,d,l):Ti(n,r,d,l),r.child;case 11:return s1(n,r,r.type,r.pendingProps,l);case 7:return Ti(n,r,r.pendingProps,l),r.child;case 8:return Ti(n,r,r.pendingProps.children,l),r.child;case 12:return Ti(n,r,r.pendingProps.children,l),r.child;case 10:return d=r.pendingProps,Er(r,r.type,d.value),Ti(n,r,d.children,l),r.child;case 9:return g=r.type._context,d=r.pendingProps.children,_a(r),g=Ni(g),d=d(g),r.flags|=1,Ti(n,r,d,l),r.child;case 14:return r1(n,r,r.type,r.pendingProps,l);case 15:return a1(n,r,r.type,r.pendingProps,l);case 19:return p1(n,r,l);case 31:return X5(n,r,l);case 22:return o1(n,r,l,r.pendingProps);case 24:return _a(r),d=Ni(Jt),n===null?(g=jf(),g===null&&(g=kt,v=Mf(),g.pooledCache=v,v.refCount++,v!==null&&(g.pooledCacheLanes|=l),g=v),r.memoizedState={parent:d,cache:g},Of(r),Er(r,Jt,g)):((n.lanes&l)!==0&&(Lf(n,r),Il(r,null,null,l),zl()),g=n.memoizedState,v=r.memoizedState,g.parent!==d?(g={parent:d,cache:d},r.memoizedState=g,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=g),Er(r,Jt,d)):(d=v.cache,Er(r,Jt,d),d!==g.cache&&Af(r,[Jt],l,!0))),Ti(n,r,r.pendingProps.children,l),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function Zs(n){n.flags|=4}function gm(n,r,l,d,g){if((r=(n.mode&32)!==0)&&(r=!1),r){if(n.flags|=16777216,(g&335544128)===g)if(n.stateNode.complete)n.flags|=8192;else if(F1())n.flags|=8192;else throw Sa=Ou,Df}else n.flags&=-16777217}function b1(n,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!jx(r))if(F1())n.flags|=8192;else throw Sa=Ou,Df}function Zu(n,r){r!==null&&(n.flags|=4),n.flags&16384&&(r=n.tag!==22?$e():536870912,n.lanes|=r,Ao|=r)}function Vl(n,r){if(!st)switch(n.tailMode){case"hidden":r=n.tail;for(var l=null;r!==null;)r.alternate!==null&&(l=r),r=r.sibling;l===null?n.tail=null:l.sibling=null;break;case"collapsed":l=n.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?r||n.tail===null?n.tail=null:n.tail.sibling=null:d.sibling=null}}function At(n){var r=n.alternate!==null&&n.alternate.child===n.child,l=0,d=0;if(r)for(var g=n.child;g!==null;)l|=g.lanes|g.childLanes,d|=g.subtreeFlags&65011712,d|=g.flags&65011712,g.return=n,g=g.sibling;else for(g=n.child;g!==null;)l|=g.lanes|g.childLanes,d|=g.subtreeFlags,d|=g.flags,g.return=n,g=g.sibling;return n.subtreeFlags|=d,n.childLanes=l,r}function Q5(n,r,l){var d=r.pendingProps;switch(kf(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return At(r),null;case 1:return At(r),null;case 3:return l=r.stateNode,d=null,n!==null&&(d=n.memoizedState.cache),r.memoizedState.cache!==d&&(r.flags|=2048),Gs(Jt),ye(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(n===null||n.child===null)&&(go(r)?Zs(r):n===null||n.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,Cf())),At(r),null;case 26:var g=r.type,v=r.memoizedState;return n===null?(Zs(r),v!==null?(At(r),b1(r,v)):(At(r),gm(r,g,null,d,l))):v?v!==n.memoizedState?(Zs(r),At(r),b1(r,v)):(At(r),r.flags&=-16777217):(n=n.memoizedProps,n!==d&&Zs(r),At(r),gm(r,g,n,d,l)),null;case 27:if(ot(r),l=ne.current,g=r.type,n!==null&&r.stateNode!=null)n.memoizedProps!==d&&Zs(r);else{if(!d){if(r.stateNode===null)throw Error(s(166));return At(r),null}n=oe.current,go(r)?Xv(r):(n=kx(g,d,l),r.stateNode=n,Zs(r))}return At(r),null;case 5:if(ot(r),g=r.type,n!==null&&r.stateNode!=null)n.memoizedProps!==d&&Zs(r);else{if(!d){if(r.stateNode===null)throw Error(s(166));return At(r),null}if(v=oe.current,go(r))Xv(r);else{var w=hd(ne.current);switch(v){case 1:v=w.createElementNS("http://www.w3.org/2000/svg",g);break;case 2:v=w.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;default:switch(g){case"svg":v=w.createElementNS("http://www.w3.org/2000/svg",g);break;case"math":v=w.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;case"script":v=w.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof d.is=="string"?w.createElement("select",{is:d.is}):w.createElement("select"),d.multiple?v.multiple=!0:d.size&&(v.size=d.size);break;default:v=typeof d.is=="string"?w.createElement(g,{is:d.is}):w.createElement(g)}}v[Kt]=r,v[Ii]=d;e:for(w=r.child;w!==null;){if(w.tag===5||w.tag===6)v.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===r)break e;for(;w.sibling===null;){if(w.return===null||w.return===r)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}r.stateNode=v;e:switch(Ai(v,g,d),g){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&Zs(r)}}return At(r),gm(r,r.type,n===null?null:n.memoizedProps,r.pendingProps,l),null;case 6:if(n&&r.stateNode!=null)n.memoizedProps!==d&&Zs(r);else{if(typeof d!="string"&&r.stateNode===null)throw Error(s(166));if(n=ne.current,go(r)){if(n=r.stateNode,l=r.memoizedProps,d=null,g=Ci,g!==null)switch(g.tag){case 27:case 5:d=g.memoizedProps}n[Kt]=r,n=!!(n.nodeValue===l||d!==null&&d.suppressHydrationWarning===!0||fx(n.nodeValue,l)),n||kr(r,!0)}else n=hd(n).createTextNode(d),n[Kt]=r,r.stateNode=n}return At(r),null;case 31:if(l=r.memoizedState,n===null||n.memoizedState!==null){if(d=go(r),l!==null){if(n===null){if(!d)throw Error(s(318));if(n=r.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(557));n[Kt]=r}else ba(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;At(r),n=!1}else l=Cf(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=l),n=!0;if(!n)return r.flags&256?(Sn(r),r):(Sn(r),null);if((r.flags&128)!==0)throw Error(s(558))}return At(r),null;case 13:if(d=r.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(g=go(r),d!==null&&d.dehydrated!==null){if(n===null){if(!g)throw Error(s(318));if(g=r.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(s(317));g[Kt]=r}else ba(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;At(r),g=!1}else g=Cf(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=g),g=!0;if(!g)return r.flags&256?(Sn(r),r):(Sn(r),null)}return Sn(r),(r.flags&128)!==0?(r.lanes=l,r):(l=d!==null,n=n!==null&&n.memoizedState!==null,l&&(d=r.child,g=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(g=d.alternate.memoizedState.cachePool.pool),v=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(v=d.memoizedState.cachePool.pool),v!==g&&(d.flags|=2048)),l!==n&&l&&(r.child.flags|=8192),Zu(r,r.updateQueue),At(r),null);case 4:return ye(),n===null&&Im(r.stateNode.containerInfo),At(r),null;case 10:return Gs(r.type),At(r),null;case 19:if(W(Wt),d=r.memoizedState,d===null)return At(r),null;if(g=(r.flags&128)!==0,v=d.rendering,v===null)if(g)Vl(d,!1);else{if(Ut!==0||n!==null&&(n.flags&128)!==0)for(n=r.child;n!==null;){if(v=Iu(n),v!==null){for(r.flags|=128,Vl(d,!1),n=v.updateQueue,r.updateQueue=n,Zu(r,n),r.subtreeFlags=0,n=l,l=r.child;l!==null;)qv(l,n),l=l.sibling;return he(Wt,Wt.current&1|2),st&&qs(r,d.treeForkCount),r.child}n=n.sibling}d.tail!==null&&Bt()>id&&(r.flags|=128,g=!0,Vl(d,!1),r.lanes=4194304)}else{if(!g)if(n=Iu(v),n!==null){if(r.flags|=128,g=!0,n=n.updateQueue,r.updateQueue=n,Zu(r,n),Vl(d,!0),d.tail===null&&d.tailMode==="hidden"&&!v.alternate&&!st)return At(r),null}else 2*Bt()-d.renderingStartTime>id&&l!==536870912&&(r.flags|=128,g=!0,Vl(d,!1),r.lanes=4194304);d.isBackwards?(v.sibling=r.child,r.child=v):(n=d.last,n!==null?n.sibling=v:r.child=v,d.last=v)}return d.tail!==null?(n=d.tail,d.rendering=n,d.tail=n.sibling,d.renderingStartTime=Bt(),n.sibling=null,l=Wt.current,he(Wt,g?l&1|2:l&1),st&&qs(r,d.treeForkCount),n):(At(r),null);case 22:case 23:return Sn(r),Pf(),d=r.memoizedState!==null,n!==null?n.memoizedState!==null!==d&&(r.flags|=8192):d&&(r.flags|=8192),d?(l&536870912)!==0&&(r.flags&128)===0&&(At(r),r.subtreeFlags&6&&(r.flags|=8192)):At(r),l=r.updateQueue,l!==null&&Zu(r,l.retryQueue),l=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),d=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(d=r.memoizedState.cachePool.pool),d!==l&&(r.flags|=2048),n!==null&&W(xa),null;case 24:return l=null,n!==null&&(l=n.memoizedState.cache),r.memoizedState.cache!==l&&(r.flags|=2048),Gs(Jt),At(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function J5(n,r){switch(kf(r),r.tag){case 1:return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 3:return Gs(Jt),ye(),n=r.flags,(n&65536)!==0&&(n&128)===0?(r.flags=n&-65537|128,r):null;case 26:case 27:case 5:return ot(r),null;case 31:if(r.memoizedState!==null){if(Sn(r),r.alternate===null)throw Error(s(340));ba()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 13:if(Sn(r),n=r.memoizedState,n!==null&&n.dehydrated!==null){if(r.alternate===null)throw Error(s(340));ba()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 19:return W(Wt),null;case 4:return ye(),null;case 10:return Gs(r.type),null;case 22:case 23:return Sn(r),Pf(),n!==null&&W(xa),n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 24:return Gs(Jt),null;case 25:return null;default:return null}}function v1(n,r){switch(kf(r),r.tag){case 3:Gs(Jt),ye();break;case 26:case 27:case 5:ot(r);break;case 4:ye();break;case 31:r.memoizedState!==null&&Sn(r);break;case 13:Sn(r);break;case 19:W(Wt);break;case 10:Gs(r.type);break;case 22:case 23:Sn(r),Pf(),n!==null&&W(xa);break;case 24:Gs(Jt)}}function ql(n,r){try{var l=r.updateQueue,d=l!==null?l.lastEffect:null;if(d!==null){var g=d.next;l=g;do{if((l.tag&n)===n){d=void 0;var v=l.create,w=l.inst;d=v(),w.destroy=d}l=l.next}while(l!==g)}}catch(T){vt(r,r.return,T)}}function Rr(n,r,l){try{var d=r.updateQueue,g=d!==null?d.lastEffect:null;if(g!==null){var v=g.next;d=v;do{if((d.tag&n)===n){var w=d.inst,T=w.destroy;if(T!==void 0){w.destroy=void 0,g=r;var B=l,ee=T;try{ee()}catch(se){vt(g,B,se)}}}d=d.next}while(d!==v)}}catch(se){vt(r,r.return,se)}}function _1(n){var r=n.updateQueue;if(r!==null){var l=n.stateNode;try{c_(r,l)}catch(d){vt(n,n.return,d)}}}function x1(n,r,l){l.props=Ea(n.type,n.memoizedProps),l.state=n.memoizedState;try{l.componentWillUnmount()}catch(d){vt(n,r,d)}}function Kl(n,r){try{var l=n.ref;if(l!==null){switch(n.tag){case 26:case 27:case 5:var d=n.stateNode;break;case 30:d=n.stateNode;break;default:d=n.stateNode}typeof l=="function"?n.refCleanup=l(d):l.current=d}}catch(g){vt(n,r,g)}}function ms(n,r){var l=n.ref,d=n.refCleanup;if(l!==null)if(typeof d=="function")try{d()}catch(g){vt(n,r,g)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(g){vt(n,r,g)}else l.current=null}function y1(n){var r=n.type,l=n.memoizedProps,d=n.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":l.autoFocus&&d.focus();break e;case"img":l.src?d.src=l.src:l.srcSet&&(d.srcset=l.srcSet)}}catch(g){vt(n,n.return,g)}}function bm(n,r,l){try{var d=n.stateNode;yT(d,n.type,l,r),d[Ii]=r}catch(g){vt(n,n.return,g)}}function S1(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Ir(n.type)||n.tag===4}function vm(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||S1(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&Ir(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function _m(n,r,l){var d=n.tag;if(d===5||d===6)n=n.stateNode,r?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(n,r):(r=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,r.appendChild(n),l=l._reactRootContainer,l!=null||r.onclick!==null||(r.onclick=ve));else if(d!==4&&(d===27&&Ir(n.type)&&(l=n.stateNode,r=null),n=n.child,n!==null))for(_m(n,r,l),n=n.sibling;n!==null;)_m(n,r,l),n=n.sibling}function Qu(n,r,l){var d=n.tag;if(d===5||d===6)n=n.stateNode,r?l.insertBefore(n,r):l.appendChild(n);else if(d!==4&&(d===27&&Ir(n.type)&&(l=n.stateNode),n=n.child,n!==null))for(Qu(n,r,l),n=n.sibling;n!==null;)Qu(n,r,l),n=n.sibling}function w1(n){var r=n.stateNode,l=n.memoizedProps;try{for(var d=n.type,g=r.attributes;g.length;)r.removeAttributeNode(g[0]);Ai(r,d,l),r[Kt]=n,r[Ii]=l}catch(v){vt(n,n.return,v)}}var Qs=!1,ii=!1,xm=!1,k1=typeof WeakSet=="function"?WeakSet:Set,bi=null;function eT(n,r){if(n=n.containerInfo,Um=_d,n=Bv(n),ff(n)){if("selectionStart"in n)var l={start:n.selectionStart,end:n.selectionEnd};else e:{l=(l=n.ownerDocument)&&l.defaultView||window;var d=l.getSelection&&l.getSelection();if(d&&d.rangeCount!==0){l=d.anchorNode;var g=d.anchorOffset,v=d.focusNode;d=d.focusOffset;try{l.nodeType,v.nodeType}catch{l=null;break e}var w=0,T=-1,B=-1,ee=0,se=0,le=n,te=null;t:for(;;){for(var ie;le!==l||g!==0&&le.nodeType!==3||(T=w+g),le!==v||d!==0&&le.nodeType!==3||(B=w+d),le.nodeType===3&&(w+=le.nodeValue.length),(ie=le.firstChild)!==null;)te=le,le=ie;for(;;){if(le===n)break t;if(te===l&&++ee===g&&(T=w),te===v&&++se===d&&(B=w),(ie=le.nextSibling)!==null)break;le=te,te=le.parentNode}le=ie}l=T===-1||B===-1?null:{start:T,end:B}}else l=null}l=l||{start:0,end:0}}else l=null;for(Hm={focusedElem:n,selectionRange:l},_d=!1,bi=r;bi!==null;)if(r=bi,n=r.child,(r.subtreeFlags&1028)!==0&&n!==null)n.return=r,bi=n;else for(;bi!==null;){switch(r=bi,v=r.alternate,n=r.flags,r.tag){case 0:if((n&4)!==0&&(n=r.updateQueue,n=n!==null?n.events:null,n!==null))for(l=0;l<n.length;l++)g=n[l],g.ref.impl=g.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&v!==null){n=void 0,l=r,g=v.memoizedProps,v=v.memoizedState,d=l.stateNode;try{var Ne=Ea(l.type,g);n=d.getSnapshotBeforeUpdate(Ne,v),d.__reactInternalSnapshotBeforeUpdate=n}catch(Le){vt(l,l.return,Le)}}break;case 3:if((n&1024)!==0){if(n=r.stateNode.containerInfo,l=n.nodeType,l===9)qm(n);else if(l===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":qm(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(s(163))}if(n=r.sibling,n!==null){n.return=r.return,bi=n;break}bi=r.return}}function E1(n,r,l){var d=l.flags;switch(l.tag){case 0:case 11:case 15:er(n,l),d&4&&ql(5,l);break;case 1:if(er(n,l),d&4)if(n=l.stateNode,r===null)try{n.componentDidMount()}catch(w){vt(l,l.return,w)}else{var g=Ea(l.type,r.memoizedProps);r=r.memoizedState;try{n.componentDidUpdate(g,r,n.__reactInternalSnapshotBeforeUpdate)}catch(w){vt(l,l.return,w)}}d&64&&_1(l),d&512&&Kl(l,l.return);break;case 3:if(er(n,l),d&64&&(n=l.updateQueue,n!==null)){if(r=null,l.child!==null)switch(l.child.tag){case 27:case 5:r=l.child.stateNode;break;case 1:r=l.child.stateNode}try{c_(n,r)}catch(w){vt(l,l.return,w)}}break;case 27:r===null&&d&4&&w1(l);case 26:case 5:er(n,l),r===null&&d&4&&y1(l),d&512&&Kl(l,l.return);break;case 12:er(n,l);break;case 31:er(n,l),d&4&&T1(n,l);break;case 13:er(n,l),d&4&&A1(n,l),d&64&&(n=l.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(l=cT.bind(null,l),AT(n,l))));break;case 22:if(d=l.memoizedState!==null||Qs,!d){r=r!==null&&r.memoizedState!==null||ii,g=Qs;var v=ii;Qs=d,(ii=r)&&!v?tr(n,l,(l.subtreeFlags&8772)!==0):er(n,l),Qs=g,ii=v}break;case 30:break;default:er(n,l)}}function C1(n){var r=n.alternate;r!==null&&(n.alternate=null,C1(r)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(r=n.stateNode,r!==null&&gl(r)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var Dt=null,an=!1;function Js(n,r,l){for(l=l.child;l!==null;)N1(n,r,l),l=l.sibling}function N1(n,r,l){if(gi&&typeof gi.onCommitFiberUnmount=="function")try{gi.onCommitFiberUnmount(Is,l)}catch{}switch(l.tag){case 26:ii||ms(l,r),Js(n,r,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:ii||ms(l,r);var d=Dt,g=an;Ir(l.type)&&(Dt=l.stateNode,an=!1),Js(n,r,l),tc(l.stateNode),Dt=d,an=g;break;case 5:ii||ms(l,r);case 6:if(d=Dt,g=an,Dt=null,Js(n,r,l),Dt=d,an=g,Dt!==null)if(an)try{(Dt.nodeType===9?Dt.body:Dt.nodeName==="HTML"?Dt.ownerDocument.body:Dt).removeChild(l.stateNode)}catch(v){vt(l,r,v)}else try{Dt.removeChild(l.stateNode)}catch(v){vt(l,r,v)}break;case 18:Dt!==null&&(an?(n=Dt,_x(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,l.stateNode),zo(n)):_x(Dt,l.stateNode));break;case 4:d=Dt,g=an,Dt=l.stateNode.containerInfo,an=!0,Js(n,r,l),Dt=d,an=g;break;case 0:case 11:case 14:case 15:Rr(2,l,r),ii||Rr(4,l,r),Js(n,r,l);break;case 1:ii||(ms(l,r),d=l.stateNode,typeof d.componentWillUnmount=="function"&&x1(l,r,d)),Js(n,r,l);break;case 21:Js(n,r,l);break;case 22:ii=(d=ii)||l.memoizedState!==null,Js(n,r,l),ii=d;break;default:Js(n,r,l)}}function T1(n,r){if(r.memoizedState===null&&(n=r.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{zo(n)}catch(l){vt(r,r.return,l)}}}function A1(n,r){if(r.memoizedState===null&&(n=r.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{zo(n)}catch(l){vt(r,r.return,l)}}function tT(n){switch(n.tag){case 31:case 13:case 19:var r=n.stateNode;return r===null&&(r=n.stateNode=new k1),r;case 22:return n=n.stateNode,r=n._retryCache,r===null&&(r=n._retryCache=new k1),r;default:throw Error(s(435,n.tag))}}function Ju(n,r){var l=tT(n);r.forEach(function(d){if(!l.has(d)){l.add(d);var g=uT.bind(null,n,d);d.then(g,g)}})}function on(n,r){var l=r.deletions;if(l!==null)for(var d=0;d<l.length;d++){var g=l[d],v=n,w=r,T=w;e:for(;T!==null;){switch(T.tag){case 27:if(Ir(T.type)){Dt=T.stateNode,an=!1;break e}break;case 5:Dt=T.stateNode,an=!1;break e;case 3:case 4:Dt=T.stateNode.containerInfo,an=!0;break e}T=T.return}if(Dt===null)throw Error(s(160));N1(v,w,g),Dt=null,an=!1,v=g.alternate,v!==null&&(v.return=null),g.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)M1(r,n),r=r.sibling}var is=null;function M1(n,r){var l=n.alternate,d=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:on(r,n),ln(n),d&4&&(Rr(3,n,n.return),ql(3,n),Rr(5,n,n.return));break;case 1:on(r,n),ln(n),d&512&&(ii||l===null||ms(l,l.return)),d&64&&Qs&&(n=n.updateQueue,n!==null&&(d=n.callbacks,d!==null&&(l=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=l===null?d:l.concat(d))));break;case 26:var g=is;if(on(r,n),ln(n),d&512&&(ii||l===null||ms(l,l.return)),d&4){var v=l!==null?l.memoizedState:null;if(d=n.memoizedState,l===null)if(d===null)if(n.stateNode===null){e:{d=n.type,l=n.memoizedProps,g=g.ownerDocument||g;t:switch(d){case"title":v=g.getElementsByTagName("title")[0],(!v||v[ca]||v[Kt]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=g.createElement(d),g.head.insertBefore(v,g.querySelector("head > title"))),Ai(v,d,l),v[Kt]=n,Zt(v),d=v;break e;case"link":var w=Mx("link","href",g).get(d+(l.href||""));if(w){for(var T=0;T<w.length;T++)if(v=w[T],v.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&v.getAttribute("rel")===(l.rel==null?null:l.rel)&&v.getAttribute("title")===(l.title==null?null:l.title)&&v.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){w.splice(T,1);break t}}v=g.createElement(d),Ai(v,d,l),g.head.appendChild(v);break;case"meta":if(w=Mx("meta","content",g).get(d+(l.content||""))){for(T=0;T<w.length;T++)if(v=w[T],v.getAttribute("content")===(l.content==null?null:""+l.content)&&v.getAttribute("name")===(l.name==null?null:l.name)&&v.getAttribute("property")===(l.property==null?null:l.property)&&v.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&v.getAttribute("charset")===(l.charSet==null?null:l.charSet)){w.splice(T,1);break t}}v=g.createElement(d),Ai(v,d,l),g.head.appendChild(v);break;default:throw Error(s(468,d))}v[Kt]=n,Zt(v),d=v}n.stateNode=d}else Rx(g,n.type,n.stateNode);else n.stateNode=Ax(g,d,n.memoizedProps);else v!==d?(v===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):v.count--,d===null?Rx(g,n.type,n.stateNode):Ax(g,d,n.memoizedProps)):d===null&&n.stateNode!==null&&bm(n,n.memoizedProps,l.memoizedProps)}break;case 27:on(r,n),ln(n),d&512&&(ii||l===null||ms(l,l.return)),l!==null&&d&4&&bm(n,n.memoizedProps,l.memoizedProps);break;case 5:if(on(r,n),ln(n),d&512&&(ii||l===null||ms(l,l.return)),n.flags&32){g=n.stateNode;try{ze(g,"")}catch(Ne){vt(n,n.return,Ne)}}d&4&&n.stateNode!=null&&(g=n.memoizedProps,bm(n,g,l!==null?l.memoizedProps:g)),d&1024&&(xm=!0);break;case 6:if(on(r,n),ln(n),d&4){if(n.stateNode===null)throw Error(s(162));d=n.memoizedProps,l=n.stateNode;try{l.nodeValue=d}catch(Ne){vt(n,n.return,Ne)}}break;case 3:if(pd=null,g=is,is=fd(r.containerInfo),on(r,n),is=g,ln(n),d&4&&l!==null&&l.memoizedState.isDehydrated)try{zo(r.containerInfo)}catch(Ne){vt(n,n.return,Ne)}xm&&(xm=!1,R1(n));break;case 4:d=is,is=fd(n.stateNode.containerInfo),on(r,n),ln(n),is=d;break;case 12:on(r,n),ln(n);break;case 31:on(r,n),ln(n),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,Ju(n,d)));break;case 13:on(r,n),ln(n),n.child.flags&8192&&n.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(td=Bt()),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,Ju(n,d)));break;case 22:g=n.memoizedState!==null;var B=l!==null&&l.memoizedState!==null,ee=Qs,se=ii;if(Qs=ee||g,ii=se||B,on(r,n),ii=se,Qs=ee,ln(n),d&8192)e:for(r=n.stateNode,r._visibility=g?r._visibility&-2:r._visibility|1,g&&(l===null||B||Qs||ii||Ca(n)),l=null,r=n;;){if(r.tag===5||r.tag===26){if(l===null){B=l=r;try{if(v=B.stateNode,g)w=v.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{T=B.stateNode;var le=B.memoizedProps.style,te=le!=null&&le.hasOwnProperty("display")?le.display:null;T.style.display=te==null||typeof te=="boolean"?"":(""+te).trim()}}catch(Ne){vt(B,B.return,Ne)}}}else if(r.tag===6){if(l===null){B=r;try{B.stateNode.nodeValue=g?"":B.memoizedProps}catch(Ne){vt(B,B.return,Ne)}}}else if(r.tag===18){if(l===null){B=r;try{var ie=B.stateNode;g?xx(ie,!0):xx(B.stateNode,!1)}catch(Ne){vt(B,B.return,Ne)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===n)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===n)break e;for(;r.sibling===null;){if(r.return===null||r.return===n)break e;l===r&&(l=null),r=r.return}l===r&&(l=null),r.sibling.return=r.return,r=r.sibling}d&4&&(d=n.updateQueue,d!==null&&(l=d.retryQueue,l!==null&&(d.retryQueue=null,Ju(n,l))));break;case 19:on(r,n),ln(n),d&4&&(d=n.updateQueue,d!==null&&(n.updateQueue=null,Ju(n,d)));break;case 30:break;case 21:break;default:on(r,n),ln(n)}}function ln(n){var r=n.flags;if(r&2){try{for(var l,d=n.return;d!==null;){if(S1(d)){l=d;break}d=d.return}if(l==null)throw Error(s(160));switch(l.tag){case 27:var g=l.stateNode,v=vm(n);Qu(n,v,g);break;case 5:var w=l.stateNode;l.flags&32&&(ze(w,""),l.flags&=-33);var T=vm(n);Qu(n,T,w);break;case 3:case 4:var B=l.stateNode.containerInfo,ee=vm(n);_m(n,ee,B);break;default:throw Error(s(161))}}catch(se){vt(n,n.return,se)}n.flags&=-3}r&4096&&(n.flags&=-4097)}function R1(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var r=n;R1(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),n=n.sibling}}function er(n,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)E1(n,r.alternate,r),r=r.sibling}function Ca(n){for(n=n.child;n!==null;){var r=n;switch(r.tag){case 0:case 11:case 14:case 15:Rr(4,r,r.return),Ca(r);break;case 1:ms(r,r.return);var l=r.stateNode;typeof l.componentWillUnmount=="function"&&x1(r,r.return,l),Ca(r);break;case 27:tc(r.stateNode);case 26:case 5:ms(r,r.return),Ca(r);break;case 22:r.memoizedState===null&&Ca(r);break;case 30:Ca(r);break;default:Ca(r)}n=n.sibling}}function tr(n,r,l){for(l=l&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var d=r.alternate,g=n,v=r,w=v.flags;switch(v.tag){case 0:case 11:case 15:tr(g,v,l),ql(4,v);break;case 1:if(tr(g,v,l),d=v,g=d.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(ee){vt(d,d.return,ee)}if(d=v,g=d.updateQueue,g!==null){var T=d.stateNode;try{var B=g.shared.hiddenCallbacks;if(B!==null)for(g.shared.hiddenCallbacks=null,g=0;g<B.length;g++)l_(B[g],T)}catch(ee){vt(d,d.return,ee)}}l&&w&64&&_1(v),Kl(v,v.return);break;case 27:w1(v);case 26:case 5:tr(g,v,l),l&&d===null&&w&4&&y1(v),Kl(v,v.return);break;case 12:tr(g,v,l);break;case 31:tr(g,v,l),l&&w&4&&T1(g,v);break;case 13:tr(g,v,l),l&&w&4&&A1(g,v);break;case 22:v.memoizedState===null&&tr(g,v,l),Kl(v,v.return);break;case 30:break;default:tr(g,v,l)}r=r.sibling}}function ym(n,r){var l=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(l=n.memoizedState.cachePool.pool),n=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(n=r.memoizedState.cachePool.pool),n!==l&&(n!=null&&n.refCount++,l!=null&&jl(l))}function Sm(n,r){n=null,r.alternate!==null&&(n=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==n&&(r.refCount++,n!=null&&jl(n))}function ns(n,r,l,d){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)j1(n,r,l,d),r=r.sibling}function j1(n,r,l,d){var g=r.flags;switch(r.tag){case 0:case 11:case 15:ns(n,r,l,d),g&2048&&ql(9,r);break;case 1:ns(n,r,l,d);break;case 3:ns(n,r,l,d),g&2048&&(n=null,r.alternate!==null&&(n=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==n&&(r.refCount++,n!=null&&jl(n)));break;case 12:if(g&2048){ns(n,r,l,d),n=r.stateNode;try{var v=r.memoizedProps,w=v.id,T=v.onPostCommit;typeof T=="function"&&T(w,r.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(B){vt(r,r.return,B)}}else ns(n,r,l,d);break;case 31:ns(n,r,l,d);break;case 13:ns(n,r,l,d);break;case 23:break;case 22:v=r.stateNode,w=r.alternate,r.memoizedState!==null?v._visibility&2?ns(n,r,l,d):Gl(n,r):v._visibility&2?ns(n,r,l,d):(v._visibility|=2,Co(n,r,l,d,(r.subtreeFlags&10256)!==0||!1)),g&2048&&ym(w,r);break;case 24:ns(n,r,l,d),g&2048&&Sm(r.alternate,r);break;default:ns(n,r,l,d)}}function Co(n,r,l,d,g){for(g=g&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var v=n,w=r,T=l,B=d,ee=w.flags;switch(w.tag){case 0:case 11:case 15:Co(v,w,T,B,g),ql(8,w);break;case 23:break;case 22:var se=w.stateNode;w.memoizedState!==null?se._visibility&2?Co(v,w,T,B,g):Gl(v,w):(se._visibility|=2,Co(v,w,T,B,g)),g&&ee&2048&&ym(w.alternate,w);break;case 24:Co(v,w,T,B,g),g&&ee&2048&&Sm(w.alternate,w);break;default:Co(v,w,T,B,g)}r=r.sibling}}function Gl(n,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var l=n,d=r,g=d.flags;switch(d.tag){case 22:Gl(l,d),g&2048&&ym(d.alternate,d);break;case 24:Gl(l,d),g&2048&&Sm(d.alternate,d);break;default:Gl(l,d)}r=r.sibling}}var Wl=8192;function No(n,r,l){if(n.subtreeFlags&Wl)for(n=n.child;n!==null;)D1(n,r,l),n=n.sibling}function D1(n,r,l){switch(n.tag){case 26:No(n,r,l),n.flags&Wl&&n.memoizedState!==null&&UT(l,is,n.memoizedState,n.memoizedProps);break;case 5:No(n,r,l);break;case 3:case 4:var d=is;is=fd(n.stateNode.containerInfo),No(n,r,l),is=d;break;case 22:n.memoizedState===null&&(d=n.alternate,d!==null&&d.memoizedState!==null?(d=Wl,Wl=16777216,No(n,r,l),Wl=d):No(n,r,l));break;default:No(n,r,l)}}function O1(n){var r=n.alternate;if(r!==null&&(n=r.child,n!==null)){r.child=null;do r=n.sibling,n.sibling=null,n=r;while(n!==null)}}function Yl(n){var r=n.deletions;if((n.flags&16)!==0){if(r!==null)for(var l=0;l<r.length;l++){var d=r[l];bi=d,B1(d,n)}O1(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)L1(n),n=n.sibling}function L1(n){switch(n.tag){case 0:case 11:case 15:Yl(n),n.flags&2048&&Rr(9,n,n.return);break;case 3:Yl(n);break;case 12:Yl(n);break;case 22:var r=n.stateNode;n.memoizedState!==null&&r._visibility&2&&(n.return===null||n.return.tag!==13)?(r._visibility&=-3,ed(n)):Yl(n);break;default:Yl(n)}}function ed(n){var r=n.deletions;if((n.flags&16)!==0){if(r!==null)for(var l=0;l<r.length;l++){var d=r[l];bi=d,B1(d,n)}O1(n)}for(n=n.child;n!==null;){switch(r=n,r.tag){case 0:case 11:case 15:Rr(8,r,r.return),ed(r);break;case 22:l=r.stateNode,l._visibility&2&&(l._visibility&=-3,ed(r));break;default:ed(r)}n=n.sibling}}function B1(n,r){for(;bi!==null;){var l=bi;switch(l.tag){case 0:case 11:case 15:Rr(8,l,r);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var d=l.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:jl(l.memoizedState.cache)}if(d=l.child,d!==null)d.return=l,bi=d;else e:for(l=n;bi!==null;){d=bi;var g=d.sibling,v=d.return;if(C1(d),d===l){bi=null;break e}if(g!==null){g.return=v,bi=g;break e}bi=v}}}var iT={getCacheForType:function(n){var r=Ni(Jt),l=r.data.get(n);return l===void 0&&(l=n(),r.data.set(n,l)),l},cacheSignal:function(){return Ni(Jt).controller.signal}},nT=typeof WeakMap=="function"?WeakMap:Map,ht=0,kt=null,Qe=null,it=0,bt=0,wn=null,jr=!1,To=!1,wm=!1,ir=0,Ut=0,Dr=0,Na=0,km=0,kn=0,Ao=0,Xl=null,cn=null,Em=!1,td=0,z1=0,id=1/0,nd=null,Or=null,ci=0,Lr=null,Mo=null,nr=0,Cm=0,Nm=null,I1=null,Zl=0,Tm=null;function En(){return(ht&2)!==0&&it!==0?it&-it:O.T!==null?Om():to()}function P1(){if(kn===0)if((it&536870912)===0||st){var n=es;es<<=1,(es&3932160)===0&&(es=262144),kn=n}else kn=536870912;return n=yn.current,n!==null&&(n.flags|=32),kn}function un(n,r,l){(n===kt&&(bt===2||bt===9)||n.cancelPendingCommit!==null)&&(Ro(n,0),Br(n,it,kn,!1)),wt(n,l),((ht&2)===0||n!==kt)&&(n===kt&&((ht&2)===0&&(Na|=l),Ut===4&&Br(n,it,kn,!1)),ps(n))}function $1(n,r,l){if((ht&6)!==0)throw Error(s(327));var d=!l&&(r&127)===0&&(r&n.expiredLanes)===0||re(n,r),g=d?aT(n,r):Mm(n,r,!0),v=d;do{if(g===0){To&&!d&&Br(n,r,0,!1);break}else{if(l=n.current.alternate,v&&!sT(l)){g=Mm(n,r,!1),v=!1;continue}if(g===2){if(v=r,n.errorRecoveryDisabledLanes&v)var w=0;else w=n.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){r=w;e:{var T=n;g=Xl;var B=T.current.memoizedState.isDehydrated;if(B&&(Ro(T,w).flags|=256),w=Mm(T,w,!1),w!==2){if(wm&&!B){T.errorRecoveryDisabledLanes|=v,Na|=v,g=4;break e}v=cn,cn=g,v!==null&&(cn===null?cn=v:cn.push.apply(cn,v))}g=w}if(v=!1,g!==2)continue}}if(g===1){Ro(n,0),Br(n,r,0,!0);break}e:{switch(d=n,v=g,v){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r)break;case 6:Br(d,r,kn,!jr);break e;case 2:cn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(g=td+300-Bt(),10<g)){if(Br(d,r,kn,!jr),z(d,0,!0)!==0)break e;nr=r,d.timeoutHandle=bx(U1.bind(null,d,l,cn,nd,Em,r,kn,Na,Ao,jr,v,"Throttled",-0,0),g);break e}U1(d,l,cn,nd,Em,r,kn,Na,Ao,jr,v,null,-0,0)}}break}while(!0);ps(n)}function U1(n,r,l,d,g,v,w,T,B,ee,se,le,te,ie){if(n.timeoutHandle=-1,le=r.subtreeFlags,le&8192||(le&16785408)===16785408){le={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ve},D1(r,v,le);var Ne=(v&62914560)===v?td-Bt():(v&4194048)===v?z1-Bt():0;if(Ne=HT(le,Ne),Ne!==null){nr=v,n.cancelPendingCommit=Ne(Y1.bind(null,n,r,v,l,d,g,w,T,B,se,le,null,te,ie)),Br(n,v,w,!ee);return}}Y1(n,r,v,l,d,g,w,T,B)}function sT(n){for(var r=n;;){var l=r.tag;if((l===0||l===11||l===15)&&r.flags&16384&&(l=r.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var d=0;d<l.length;d++){var g=l[d],v=g.getSnapshot;g=g.value;try{if(!_n(v(),g))return!1}catch{return!1}}if(l=r.child,r.subtreeFlags&16384&&l!==null)l.return=r,r=l;else{if(r===n)break;for(;r.sibling===null;){if(r.return===null||r.return===n)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Br(n,r,l,d){r&=~km,r&=~Na,n.suspendedLanes|=r,n.pingedLanes&=~r,d&&(n.warmLanes|=r),d=n.expirationTimes;for(var g=r;0<g;){var v=31-ki(g),w=1<<v;d[v]=-1,g&=~w}l!==0&&ke(n,l,r)}function sd(){return(ht&6)===0?(Ql(0),!1):!0}function Am(){if(Qe!==null){if(bt===0)var n=Qe.return;else n=Qe,Ks=va=null,qf(n),yo=null,Ol=0,n=Qe;for(;n!==null;)v1(n.alternate,n),n=n.return;Qe=null}}function Ro(n,r){var l=n.timeoutHandle;l!==-1&&(n.timeoutHandle=-1,kT(l)),l=n.cancelPendingCommit,l!==null&&(n.cancelPendingCommit=null,l()),nr=0,Am(),kt=n,Qe=l=Vs(n.current,null),it=r,bt=0,wn=null,jr=!1,To=re(n,r),wm=!1,Ao=kn=km=Na=Dr=Ut=0,cn=Xl=null,Em=!1,(r&8)!==0&&(r|=r&32);var d=n.entangledLanes;if(d!==0)for(n=n.entanglements,d&=r;0<d;){var g=31-ki(d),v=1<<g;r|=n[g],d&=~v}return ir=r,Eu(),l}function H1(n,r){Ve=null,O.H=Hl,r===xo||r===Du?(r=s_(),bt=3):r===Df?(r=s_(),bt=4):bt=r===om?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,wn=r,Qe===null&&(Ut=1,Gu(n,Dn(r,n.current)))}function F1(){var n=yn.current;return n===null?!0:(it&4194048)===it?zn===null:(it&62914560)===it||(it&536870912)!==0?n===zn:!1}function V1(){var n=O.H;return O.H=Hl,n===null?Hl:n}function q1(){var n=O.A;return O.A=iT,n}function rd(){Ut=4,jr||(it&4194048)!==it&&yn.current!==null||(To=!0),(Dr&134217727)===0&&(Na&134217727)===0||kt===null||Br(kt,it,kn,!1)}function Mm(n,r,l){var d=ht;ht|=2;var g=V1(),v=q1();(kt!==n||it!==r)&&(nd=null,Ro(n,r)),r=!1;var w=Ut;e:do try{if(bt!==0&&Qe!==null){var T=Qe,B=wn;switch(bt){case 8:Am(),w=6;break e;case 3:case 2:case 9:case 6:yn.current===null&&(r=!0);var ee=bt;if(bt=0,wn=null,jo(n,T,B,ee),l&&To){w=0;break e}break;default:ee=bt,bt=0,wn=null,jo(n,T,B,ee)}}rT(),w=Ut;break}catch(se){H1(n,se)}while(!0);return r&&n.shellSuspendCounter++,Ks=va=null,ht=d,O.H=g,O.A=v,Qe===null&&(kt=null,it=0,Eu()),w}function rT(){for(;Qe!==null;)K1(Qe)}function aT(n,r){var l=ht;ht|=2;var d=V1(),g=q1();kt!==n||it!==r?(nd=null,id=Bt()+500,Ro(n,r)):To=re(n,r);e:do try{if(bt!==0&&Qe!==null){r=Qe;var v=wn;t:switch(bt){case 1:bt=0,wn=null,jo(n,r,v,1);break;case 2:case 9:if(i_(v)){bt=0,wn=null,G1(r);break}r=function(){bt!==2&&bt!==9||kt!==n||(bt=7),ps(n)},v.then(r,r);break e;case 3:bt=7;break e;case 4:bt=5;break e;case 7:i_(v)?(bt=0,wn=null,G1(r)):(bt=0,wn=null,jo(n,r,v,7));break;case 5:var w=null;switch(Qe.tag){case 26:w=Qe.memoizedState;case 5:case 27:var T=Qe;if(w?jx(w):T.stateNode.complete){bt=0,wn=null;var B=T.sibling;if(B!==null)Qe=B;else{var ee=T.return;ee!==null?(Qe=ee,ad(ee)):Qe=null}break t}}bt=0,wn=null,jo(n,r,v,5);break;case 6:bt=0,wn=null,jo(n,r,v,6);break;case 8:Am(),Ut=6;break e;default:throw Error(s(462))}}oT();break}catch(se){H1(n,se)}while(!0);return Ks=va=null,O.H=d,O.A=g,ht=l,Qe!==null?0:(kt=null,it=0,Eu(),Ut)}function oT(){for(;Qe!==null&&!oa();)K1(Qe)}function K1(n){var r=g1(n.alternate,n,ir);n.memoizedProps=n.pendingProps,r===null?ad(n):Qe=r}function G1(n){var r=n,l=r.alternate;switch(r.tag){case 15:case 0:r=u1(l,r,r.pendingProps,r.type,void 0,it);break;case 11:r=u1(l,r,r.pendingProps,r.type.render,r.ref,it);break;case 5:qf(r);default:v1(l,r),r=Qe=qv(r,ir),r=g1(l,r,ir)}n.memoizedProps=n.pendingProps,r===null?ad(n):Qe=r}function jo(n,r,l,d){Ks=va=null,qf(r),yo=null,Ol=0;var g=r.return;try{if(Y5(n,g,r,l,it)){Ut=1,Gu(n,Dn(l,n.current)),Qe=null;return}}catch(v){if(g!==null)throw Qe=g,v;Ut=1,Gu(n,Dn(l,n.current)),Qe=null;return}r.flags&32768?(st||d===1?n=!0:To||(it&536870912)!==0?n=!1:(jr=n=!0,(d===2||d===9||d===3||d===6)&&(d=yn.current,d!==null&&d.tag===13&&(d.flags|=16384))),W1(r,n)):ad(r)}function ad(n){var r=n;do{if((r.flags&32768)!==0){W1(r,jr);return}n=r.return;var l=Q5(r.alternate,r,ir);if(l!==null){Qe=l;return}if(r=r.sibling,r!==null){Qe=r;return}Qe=r=n}while(r!==null);Ut===0&&(Ut=5)}function W1(n,r){do{var l=J5(n.alternate,n);if(l!==null){l.flags&=32767,Qe=l;return}if(l=n.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!r&&(n=n.sibling,n!==null)){Qe=n;return}Qe=n=l}while(n!==null);Ut=6,Qe=null}function Y1(n,r,l,d,g,v,w,T,B){n.cancelPendingCommit=null;do od();while(ci!==0);if((ht&6)!==0)throw Error(s(327));if(r!==null){if(r===n.current)throw Error(s(177));if(v=r.lanes|r.childLanes,v|=vf,Ae(n,l,v,w,T,B),n===kt&&(Qe=kt=null,it=0),Mo=r,Lr=n,nr=l,Cm=v,Nm=g,I1=d,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,dT(zs,function(){return ex(),null})):(n.callbackNode=null,n.callbackPriority=0),d=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||d){d=O.T,O.T=null,g=X.p,X.p=2,w=ht,ht|=4;try{eT(n,r,l)}finally{ht=w,X.p=g,O.T=d}}ci=1,X1(),Z1(),Q1()}}function X1(){if(ci===1){ci=0;var n=Lr,r=Mo,l=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||l){l=O.T,O.T=null;var d=X.p;X.p=2;var g=ht;ht|=4;try{M1(r,n);var v=Hm,w=Bv(n.containerInfo),T=v.focusedElem,B=v.selectionRange;if(w!==T&&T&&T.ownerDocument&&Lv(T.ownerDocument.documentElement,T)){if(B!==null&&ff(T)){var ee=B.start,se=B.end;if(se===void 0&&(se=ee),"selectionStart"in T)T.selectionStart=ee,T.selectionEnd=Math.min(se,T.value.length);else{var le=T.ownerDocument||document,te=le&&le.defaultView||window;if(te.getSelection){var ie=te.getSelection(),Ne=T.textContent.length,Le=Math.min(B.start,Ne),yt=B.end===void 0?Le:Math.min(B.end,Ne);!ie.extend&&Le>yt&&(w=yt,yt=Le,Le=w);var K=Ov(T,Le),H=Ov(T,yt);if(K&&H&&(ie.rangeCount!==1||ie.anchorNode!==K.node||ie.anchorOffset!==K.offset||ie.focusNode!==H.node||ie.focusOffset!==H.offset)){var J=le.createRange();J.setStart(K.node,K.offset),ie.removeAllRanges(),Le>yt?(ie.addRange(J),ie.extend(H.node,H.offset)):(J.setEnd(H.node,H.offset),ie.addRange(J))}}}}for(le=[],ie=T;ie=ie.parentNode;)ie.nodeType===1&&le.push({element:ie,left:ie.scrollLeft,top:ie.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<le.length;T++){var ae=le[T];ae.element.scrollLeft=ae.left,ae.element.scrollTop=ae.top}}_d=!!Um,Hm=Um=null}finally{ht=g,X.p=d,O.T=l}}n.current=r,ci=2}}function Z1(){if(ci===2){ci=0;var n=Lr,r=Mo,l=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||l){l=O.T,O.T=null;var d=X.p;X.p=2;var g=ht;ht|=4;try{E1(n,r.alternate,r)}finally{ht=g,X.p=d,O.T=l}}ci=3}}function Q1(){if(ci===4||ci===3){ci=0,mr();var n=Lr,r=Mo,l=nr,d=I1;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?ci=5:(ci=0,Mo=Lr=null,J1(n,n.pendingLanes));var g=n.pendingLanes;if(g===0&&(Or=null),Ps(l),r=r.stateNode,gi&&typeof gi.onCommitFiberRoot=="function")try{gi.onCommitFiberRoot(Is,r,void 0,(r.current.flags&128)===128)}catch{}if(d!==null){r=O.T,g=X.p,X.p=2,O.T=null;try{for(var v=n.onRecoverableError,w=0;w<d.length;w++){var T=d[w];v(T.value,{componentStack:T.stack})}}finally{O.T=r,X.p=g}}(nr&3)!==0&&od(),ps(n),g=n.pendingLanes,(l&261930)!==0&&(g&42)!==0?n===Tm?Zl++:(Zl=0,Tm=n):Zl=0,Ql(0)}}function J1(n,r){(n.pooledCacheLanes&=r)===0&&(r=n.pooledCache,r!=null&&(n.pooledCache=null,jl(r)))}function od(){return X1(),Z1(),Q1(),ex()}function ex(){if(ci!==5)return!1;var n=Lr,r=Cm;Cm=0;var l=Ps(nr),d=O.T,g=X.p;try{X.p=32>l?32:l,O.T=null,l=Nm,Nm=null;var v=Lr,w=nr;if(ci=0,Mo=Lr=null,nr=0,(ht&6)!==0)throw Error(s(331));var T=ht;if(ht|=4,L1(v.current),j1(v,v.current,w,l),ht=T,Ql(0,!1),gi&&typeof gi.onPostCommitFiberRoot=="function")try{gi.onPostCommitFiberRoot(Is,v)}catch{}return!0}finally{X.p=g,O.T=d,J1(n,r)}}function tx(n,r,l){r=Dn(l,r),r=am(n.stateNode,r,2),n=Tr(n,r,2),n!==null&&(wt(n,2),ps(n))}function vt(n,r,l){if(n.tag===3)tx(n,n,l);else for(;r!==null;){if(r.tag===3){tx(r,n,l);break}else if(r.tag===1){var d=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Or===null||!Or.has(d))){n=Dn(l,n),l=i1(2),d=Tr(r,l,2),d!==null&&(n1(l,d,r,n),wt(d,2),ps(d));break}}r=r.return}}function Rm(n,r,l){var d=n.pingCache;if(d===null){d=n.pingCache=new nT;var g=new Set;d.set(r,g)}else g=d.get(r),g===void 0&&(g=new Set,d.set(r,g));g.has(l)||(wm=!0,g.add(l),n=lT.bind(null,n,r,l),r.then(n,n))}function lT(n,r,l){var d=n.pingCache;d!==null&&d.delete(r),n.pingedLanes|=n.suspendedLanes&l,n.warmLanes&=~l,kt===n&&(it&l)===l&&(Ut===4||Ut===3&&(it&62914560)===it&&300>Bt()-td?(ht&2)===0&&Ro(n,0):km|=l,Ao===it&&(Ao=0)),ps(n)}function ix(n,r){r===0&&(r=$e()),n=pa(n,r),n!==null&&(wt(n,r),ps(n))}function cT(n){var r=n.memoizedState,l=0;r!==null&&(l=r.retryLane),ix(n,l)}function uT(n,r){var l=0;switch(n.tag){case 31:case 13:var d=n.stateNode,g=n.memoizedState;g!==null&&(l=g.retryLane);break;case 19:d=n.stateNode;break;case 22:d=n.stateNode._retryCache;break;default:throw Error(s(314))}d!==null&&d.delete(r),ix(n,l)}function dT(n,r){return li(n,r)}var ld=null,Do=null,jm=!1,cd=!1,Dm=!1,zr=0;function ps(n){n!==Do&&n.next===null&&(Do===null?ld=Do=n:Do=Do.next=n),cd=!0,jm||(jm=!0,fT())}function Ql(n,r){if(!Dm&&cd){Dm=!0;do for(var l=!1,d=ld;d!==null;){if(n!==0){var g=d.pendingLanes;if(g===0)var v=0;else{var w=d.suspendedLanes,T=d.pingedLanes;v=(1<<31-ki(42|n)+1)-1,v&=g&~(w&~T),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(l=!0,ax(d,v))}else v=it,v=z(d,d===kt?v:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(v&3)===0||re(d,v)||(l=!0,ax(d,v));d=d.next}while(l);Dm=!1}}function hT(){nx()}function nx(){cd=jm=!1;var n=0;zr!==0&&wT()&&(n=zr);for(var r=Bt(),l=null,d=ld;d!==null;){var g=d.next,v=sx(d,r);v===0?(d.next=null,l===null?ld=g:l.next=g,g===null&&(Do=l)):(l=d,(n!==0||(v&3)!==0)&&(cd=!0)),d=g}ci!==0&&ci!==5||Ql(n),zr!==0&&(zr=0)}function sx(n,r){for(var l=n.suspendedLanes,d=n.pingedLanes,g=n.expirationTimes,v=n.pendingLanes&-62914561;0<v;){var w=31-ki(v),T=1<<w,B=g[w];B===-1?((T&l)===0||(T&d)!==0)&&(g[w]=xe(T,r)):B<=r&&(n.expiredLanes|=T),v&=~T}if(r=kt,l=it,l=z(n,n===r?l:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),d=n.callbackNode,l===0||n===r&&(bt===2||bt===9)||n.cancelPendingCommit!==null)return d!==null&&d!==null&&Ki(d),n.callbackNode=null,n.callbackPriority=0;if((l&3)===0||re(n,l)){if(r=l&-l,r===n.callbackPriority)return r;switch(d!==null&&Ki(d),Ps(l)){case 2:case 8:l=Bs;break;case 32:l=zs;break;case 268435456:l=pr;break;default:l=zs}return d=rx.bind(null,n),l=li(l,d),n.callbackPriority=r,n.callbackNode=l,r}return d!==null&&d!==null&&Ki(d),n.callbackPriority=2,n.callbackNode=null,2}function rx(n,r){if(ci!==0&&ci!==5)return n.callbackNode=null,n.callbackPriority=0,null;var l=n.callbackNode;if(od()&&n.callbackNode!==l)return null;var d=it;return d=z(n,n===kt?d:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),d===0?null:($1(n,d,r),sx(n,Bt()),n.callbackNode!=null&&n.callbackNode===l?rx.bind(null,n):null)}function ax(n,r){if(od())return null;$1(n,r,!0)}function fT(){ET(function(){(ht&6)!==0?li(wi,hT):nx()})}function Om(){if(zr===0){var n=vo;n===0&&(n=rt,rt<<=1,(rt&261888)===0&&(rt=256)),zr=n}return zr}function ox(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:xr(""+n)}function lx(n,r){var l=r.ownerDocument.createElement("input");return l.name=r.name,l.value=r.value,n.id&&l.setAttribute("form",n.id),r.parentNode.insertBefore(l,r),n=new FormData(n),l.parentNode.removeChild(l),n}function mT(n,r,l,d,g){if(r==="submit"&&l&&l.stateNode===g){var v=ox((g[Ii]||null).action),w=d.submitter;w&&(r=(r=w[Ii]||null)?ox(r.formAction):w.getAttribute("formAction"),r!==null&&(v=r,w=null));var T=new yu("action","action",null,d,g);n.push({event:T,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(zr!==0){var B=w?lx(g,w):new FormData(g);em(l,{pending:!0,data:B,method:g.method,action:v},null,B)}}else typeof v=="function"&&(T.preventDefault(),B=w?lx(g,w):new FormData(g),em(l,{pending:!0,data:B,method:g.method,action:v},v,B))},currentTarget:g}]})}}for(var Lm=0;Lm<bf.length;Lm++){var Bm=bf[Lm],pT=Bm.toLowerCase(),gT=Bm[0].toUpperCase()+Bm.slice(1);ts(pT,"on"+gT)}ts(Pv,"onAnimationEnd"),ts($v,"onAnimationIteration"),ts(Uv,"onAnimationStart"),ts("dblclick","onDoubleClick"),ts("focusin","onFocus"),ts("focusout","onBlur"),ts(j5,"onTransitionRun"),ts(D5,"onTransitionStart"),ts(O5,"onTransitionCancel"),ts(Hv,"onTransitionEnd"),pe("onMouseEnter",["mouseout","mouseover"]),pe("onMouseLeave",["mouseout","mouseover"]),pe("onPointerEnter",["pointerout","pointerover"]),pe("onPointerLeave",["pointerout","pointerover"]),Us("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Us("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Us("onBeforeInput",["compositionend","keypress","textInput","paste"]),Us("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Us("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Us("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Jl="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(" "),bT=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Jl));function cx(n,r){r=(r&4)!==0;for(var l=0;l<n.length;l++){var d=n[l],g=d.event;d=d.listeners;e:{var v=void 0;if(r)for(var w=d.length-1;0<=w;w--){var T=d[w],B=T.instance,ee=T.currentTarget;if(T=T.listener,B!==v&&g.isPropagationStopped())break e;v=T,g.currentTarget=ee;try{v(g)}catch(se){ku(se)}g.currentTarget=null,v=B}else for(w=0;w<d.length;w++){if(T=d[w],B=T.instance,ee=T.currentTarget,T=T.listener,B!==v&&g.isPropagationStopped())break e;v=T,g.currentTarget=ee;try{v(g)}catch(se){ku(se)}g.currentTarget=null,v=B}}}}function Je(n,r){var l=r[pl];l===void 0&&(l=r[pl]=new Set);var d=n+"__bubble";l.has(d)||(ux(r,n,2,!1),l.add(d))}function zm(n,r,l){var d=0;r&&(d|=4),ux(l,n,d,r)}var ud="_reactListening"+Math.random().toString(36).slice(2);function Im(n){if(!n[ud]){n[ud]=!0,fu.forEach(function(l){l!=="selectionchange"&&(bT.has(l)||zm(l,!1,n),zm(l,!0,n))});var r=n.nodeType===9?n:n.ownerDocument;r===null||r[ud]||(r[ud]=!0,zm("selectionchange",!1,r))}}function ux(n,r,l,d){switch(Px(r)){case 2:var g=qT;break;case 8:g=KT;break;default:g=Jm}l=g.bind(null,r,l,n),g=void 0,!sf||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(g=!0),d?g!==void 0?n.addEventListener(r,l,{capture:!0,passive:g}):n.addEventListener(r,l,!0):g!==void 0?n.addEventListener(r,l,{passive:g}):n.addEventListener(r,l,!1)}function Pm(n,r,l,d,g){var v=d;if((r&1)===0&&(r&2)===0&&d!==null)e:for(;;){if(d===null)return;var w=d.tag;if(w===3||w===4){var T=d.stateNode.containerInfo;if(T===g)break;if(w===4)for(w=d.return;w!==null;){var B=w.tag;if((B===3||B===4)&&w.stateNode.containerInfo===g)return;w=w.return}for(;T!==null;){if(w=Gi(T),w===null)return;if(B=w.tag,B===5||B===6||B===26||B===27){d=v=w;continue e}T=T.parentNode}}d=d.return}bu(function(){var ee=v,se=Fe(l),le=[];e:{var te=Fv.get(n);if(te!==void 0){var ie=yu,Ne=n;switch(n){case"keypress":if(_u(l)===0)break e;case"keydown":case"keyup":ie=u5;break;case"focusin":Ne="focus",ie=lf;break;case"focusout":Ne="blur",ie=lf;break;case"beforeblur":case"afterblur":ie=lf;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ie=vv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=Q3;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=f5;break;case Pv:case $v:case Uv:ie=t5;break;case Hv:ie=p5;break;case"scroll":case"scrollend":ie=X3;break;case"wheel":ie=b5;break;case"copy":case"cut":case"paste":ie=n5;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=xv;break;case"toggle":case"beforetoggle":ie=_5}var Le=(r&4)!==0,yt=!Le&&(n==="scroll"||n==="scrollend"),K=Le?te!==null?te+"Capture":null:te;Le=[];for(var H=ee,J;H!==null;){var ae=H;if(J=ae.stateNode,ae=ae.tag,ae!==5&&ae!==26&&ae!==27||J===null||K===null||(ae=yl(H,K),ae!=null&&Le.push(ec(H,ae,J))),yt)break;H=H.return}0<Le.length&&(te=new ie(te,Ne,null,l,se),le.push({event:te,listeners:Le}))}}if((r&7)===0){e:{if(te=n==="mouseover"||n==="pointerover",ie=n==="mouseout"||n==="pointerout",te&&l!==Me&&(Ne=l.relatedTarget||l.fromElement)&&(Gi(Ne)||Ne[gr]))break e;if((ie||te)&&(te=se.window===se?se:(te=se.ownerDocument)?te.defaultView||te.parentWindow:window,ie?(Ne=l.relatedTarget||l.toElement,ie=ee,Ne=Ne?Gi(Ne):null,Ne!==null&&(yt=o(Ne),Le=Ne.tag,Ne!==yt||Le!==5&&Le!==27&&Le!==6)&&(Ne=null)):(ie=null,Ne=ee),ie!==Ne)){if(Le=vv,ae="onMouseLeave",K="onMouseEnter",H="mouse",(n==="pointerout"||n==="pointerover")&&(Le=xv,ae="onPointerLeave",K="onPointerEnter",H="pointer"),yt=ie==null?te:br(ie),J=Ne==null?te:br(Ne),te=new Le(ae,H+"leave",ie,l,se),te.target=yt,te.relatedTarget=J,ae=null,Gi(se)===ee&&(Le=new Le(K,H+"enter",Ne,l,se),Le.target=J,Le.relatedTarget=yt,ae=Le),yt=ae,ie&&Ne)t:{for(Le=vT,K=ie,H=Ne,J=0,ae=K;ae;ae=Le(ae))J++;ae=0;for(var Oe=H;Oe;Oe=Le(Oe))ae++;for(;0<J-ae;)K=Le(K),J--;for(;0<ae-J;)H=Le(H),ae--;for(;J--;){if(K===H||H!==null&&K===H.alternate){Le=K;break t}K=Le(K),H=Le(H)}Le=null}else Le=null;ie!==null&&dx(le,te,ie,Le,!1),Ne!==null&&yt!==null&&dx(le,yt,Ne,Le,!0)}}e:{if(te=ee?br(ee):window,ie=te.nodeName&&te.nodeName.toLowerCase(),ie==="select"||ie==="input"&&te.type==="file")var ct=Tv;else if(Cv(te))if(Av)ct=A5;else{ct=N5;var Re=C5}else ie=te.nodeName,!ie||ie.toLowerCase()!=="input"||te.type!=="checkbox"&&te.type!=="radio"?ee&&_r(ee.elementType)&&(ct=Tv):ct=T5;if(ct&&(ct=ct(n,ee))){Nv(le,ct,l,se);break e}Re&&Re(n,te,ee),n==="focusout"&&ee&&te.type==="number"&&ee.memoizedProps.value!=null&&ao(te,"number",te.value)}switch(Re=ee?br(ee):window,n){case"focusin":(Cv(Re)||Re.contentEditable==="true")&&(co=Re,mf=ee,Al=null);break;case"focusout":Al=mf=co=null;break;case"mousedown":pf=!0;break;case"contextmenu":case"mouseup":case"dragend":pf=!1,zv(le,l,se);break;case"selectionchange":if(R5)break;case"keydown":case"keyup":zv(le,l,se)}var qe;if(uf)e:{switch(n){case"compositionstart":var nt="onCompositionStart";break e;case"compositionend":nt="onCompositionEnd";break e;case"compositionupdate":nt="onCompositionUpdate";break e}nt=void 0}else lo?kv(n,l)&&(nt="onCompositionEnd"):n==="keydown"&&l.keyCode===229&&(nt="onCompositionStart");nt&&(yv&&l.locale!=="ko"&&(lo||nt!=="onCompositionStart"?nt==="onCompositionEnd"&&lo&&(qe=gv()):(yr=se,rf="value"in yr?yr.value:yr.textContent,lo=!0)),Re=dd(ee,nt),0<Re.length&&(nt=new _v(nt,n,null,l,se),le.push({event:nt,listeners:Re}),qe?nt.data=qe:(qe=Ev(l),qe!==null&&(nt.data=qe)))),(qe=y5?S5(n,l):w5(n,l))&&(nt=dd(ee,"onBeforeInput"),0<nt.length&&(Re=new _v("onBeforeInput","beforeinput",null,l,se),le.push({event:Re,listeners:nt}),Re.data=qe)),mT(le,n,ee,l,se)}cx(le,r)})}function ec(n,r,l){return{instance:n,listener:r,currentTarget:l}}function dd(n,r){for(var l=r+"Capture",d=[];n!==null;){var g=n,v=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||v===null||(g=yl(n,l),g!=null&&d.unshift(ec(n,g,v)),g=yl(n,r),g!=null&&d.push(ec(n,g,v))),n.tag===3)return d;n=n.return}return[]}function vT(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function dx(n,r,l,d,g){for(var v=r._reactName,w=[];l!==null&&l!==d;){var T=l,B=T.alternate,ee=T.stateNode;if(T=T.tag,B!==null&&B===d)break;T!==5&&T!==26&&T!==27||ee===null||(B=ee,g?(ee=yl(l,v),ee!=null&&w.unshift(ec(l,ee,B))):g||(ee=yl(l,v),ee!=null&&w.push(ec(l,ee,B)))),l=l.return}w.length!==0&&n.push({event:r,listeners:w})}var _T=/\r\n?/g,xT=/\u0000|\uFFFD/g;function hx(n){return(typeof n=="string"?n:""+n).replace(_T,`
|
|
9
|
-
`).replace(xT,"")}function fx(n,r){return r=hx(r),hx(n)===r}function xt(n,r,l,d,g,v){switch(l){case"children":typeof d=="string"?r==="body"||r==="textarea"&&d===""||ze(n,d):(typeof d=="number"||typeof d=="bigint")&&r!=="body"&&ze(n,""+d);break;case"className":bn(n,"class",d);break;case"tabIndex":bn(n,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":bn(n,l,d);break;case"style":gt(n,d,v);break;case"data":if(r!=="object"){bn(n,"data",d);break}case"src":case"href":if(d===""&&(r!=="a"||l!=="href")){n.removeAttribute(l);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){n.removeAttribute(l);break}d=xr(""+d),n.setAttribute(l,d);break;case"action":case"formAction":if(typeof d=="function"){n.setAttribute(l,"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 v=="function"&&(l==="formAction"?(r!=="input"&&xt(n,r,"name",g.name,g,null),xt(n,r,"formEncType",g.formEncType,g,null),xt(n,r,"formMethod",g.formMethod,g,null),xt(n,r,"formTarget",g.formTarget,g,null)):(xt(n,r,"encType",g.encType,g,null),xt(n,r,"method",g.method,g,null),xt(n,r,"target",g.target,g,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){n.removeAttribute(l);break}d=xr(""+d),n.setAttribute(l,d);break;case"onClick":d!=null&&(n.onclick=ve);break;case"onScroll":d!=null&&Je("scroll",n);break;case"onScrollEnd":d!=null&&Je("scrollend",n);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(s(61));if(l=d.__html,l!=null){if(g.children!=null)throw Error(s(60));n.innerHTML=l}}break;case"multiple":n.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":n.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){n.removeAttribute("xlink:href");break}l=xr(""+d),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(l,""+d):n.removeAttribute(l);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":d&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(l,""):n.removeAttribute(l);break;case"capture":case"download":d===!0?n.setAttribute(l,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?n.setAttribute(l,d):n.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?n.setAttribute(l,d):n.removeAttribute(l);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?n.removeAttribute(l):n.setAttribute(l,d);break;case"popover":Je("beforetoggle",n),Je("toggle",n),Pi(n,"popover",d);break;case"xlinkActuate":nn(n,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":nn(n,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":nn(n,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":nn(n,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":nn(n,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":nn(n,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":nn(n,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":nn(n,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":nn(n,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":Pi(n,"is",d);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=Hs.get(l)||l,Pi(n,l,d))}}function $m(n,r,l,d,g,v){switch(l){case"style":gt(n,d,v);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(s(61));if(l=d.__html,l!=null){if(g.children!=null)throw Error(s(60));n.innerHTML=l}}break;case"children":typeof d=="string"?ze(n,d):(typeof d=="number"||typeof d=="bigint")&&ze(n,""+d);break;case"onScroll":d!=null&&Je("scroll",n);break;case"onScrollEnd":d!=null&&Je("scrollend",n);break;case"onClick":d!=null&&(n.onclick=ve);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ua.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(g=l.endsWith("Capture"),r=l.slice(2,g?l.length-7:void 0),v=n[Ii]||null,v=v!=null?v[l]:null,typeof v=="function"&&n.removeEventListener(r,v,g),typeof d=="function")){typeof v!="function"&&v!==null&&(l in n?n[l]=null:n.hasAttribute(l)&&n.removeAttribute(l)),n.addEventListener(r,d,g);break e}l in n?n[l]=d:d===!0?n.setAttribute(l,""):Pi(n,l,d)}}}function Ai(n,r,l){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Je("error",n),Je("load",n);var d=!1,g=!1,v;for(v in l)if(l.hasOwnProperty(v)){var w=l[v];if(w!=null)switch(v){case"src":d=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:xt(n,r,v,w,l,null)}}g&&xt(n,r,"srcSet",l.srcSet,l,null),d&&xt(n,r,"src",l.src,l,null);return;case"input":Je("invalid",n);var T=v=w=g=null,B=null,ee=null;for(d in l)if(l.hasOwnProperty(d)){var se=l[d];if(se!=null)switch(d){case"name":g=se;break;case"type":w=se;break;case"checked":B=se;break;case"defaultChecked":ee=se;break;case"value":v=se;break;case"defaultValue":T=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(s(137,r));break;default:xt(n,r,d,se,l,null)}}da(n,v,T,B,ee,w,g,!1);return;case"select":Je("invalid",n),d=w=v=null;for(g in l)if(l.hasOwnProperty(g)&&(T=l[g],T!=null))switch(g){case"value":v=T;break;case"defaultValue":w=T;break;case"multiple":d=T;default:xt(n,r,g,T,l,null)}r=v,l=w,n.multiple=!!d,r!=null?Ei(n,!!d,r,!1):l!=null&&Ei(n,!!d,l,!0);return;case"textarea":Je("invalid",n),v=g=d=null;for(w in l)if(l.hasOwnProperty(w)&&(T=l[w],T!=null))switch(w){case"value":d=T;break;case"defaultValue":g=T;break;case"children":v=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(s(91));break;default:xt(n,r,w,T,l,null)}oo(n,d,g,v);return;case"option":for(B in l)l.hasOwnProperty(B)&&(d=l[B],d!=null)&&(B==="selected"?n.selected=d&&typeof d!="function"&&typeof d!="symbol":xt(n,r,B,d,l,null));return;case"dialog":Je("beforetoggle",n),Je("toggle",n),Je("cancel",n),Je("close",n);break;case"iframe":case"object":Je("load",n);break;case"video":case"audio":for(d=0;d<Jl.length;d++)Je(Jl[d],n);break;case"image":Je("error",n),Je("load",n);break;case"details":Je("toggle",n);break;case"embed":case"source":case"link":Je("error",n),Je("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ee in l)if(l.hasOwnProperty(ee)&&(d=l[ee],d!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:xt(n,r,ee,d,l,null)}return;default:if(_r(r)){for(se in l)l.hasOwnProperty(se)&&(d=l[se],d!==void 0&&$m(n,r,se,d,l,void 0));return}}for(T in l)l.hasOwnProperty(T)&&(d=l[T],d!=null&&xt(n,r,T,d,l,null))}function yT(n,r,l,d){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var g=null,v=null,w=null,T=null,B=null,ee=null,se=null;for(ie in l){var le=l[ie];if(l.hasOwnProperty(ie)&&le!=null)switch(ie){case"checked":break;case"value":break;case"defaultValue":B=le;default:d.hasOwnProperty(ie)||xt(n,r,ie,null,d,le)}}for(var te in d){var ie=d[te];if(le=l[te],d.hasOwnProperty(te)&&(ie!=null||le!=null))switch(te){case"type":v=ie;break;case"name":g=ie;break;case"checked":ee=ie;break;case"defaultChecked":se=ie;break;case"value":w=ie;break;case"defaultValue":T=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(s(137,r));break;default:ie!==le&&xt(n,r,te,ie,d,le)}}vl(n,w,T,B,ee,se,v,g);return;case"select":ie=w=T=te=null;for(v in l)if(B=l[v],l.hasOwnProperty(v)&&B!=null)switch(v){case"value":break;case"multiple":ie=B;default:d.hasOwnProperty(v)||xt(n,r,v,null,d,B)}for(g in d)if(v=d[g],B=l[g],d.hasOwnProperty(g)&&(v!=null||B!=null))switch(g){case"value":te=v;break;case"defaultValue":T=v;break;case"multiple":w=v;default:v!==B&&xt(n,r,g,v,d,B)}r=T,l=w,d=ie,te!=null?Ei(n,!!l,te,!1):!!d!=!!l&&(r!=null?Ei(n,!!l,r,!0):Ei(n,!!l,l?[]:"",!1));return;case"textarea":ie=te=null;for(T in l)if(g=l[T],l.hasOwnProperty(T)&&g!=null&&!d.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:xt(n,r,T,null,d,g)}for(w in d)if(g=d[w],v=l[w],d.hasOwnProperty(w)&&(g!=null||v!=null))switch(w){case"value":te=g;break;case"defaultValue":ie=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(s(91));break;default:g!==v&&xt(n,r,w,g,d,v)}pu(n,te,ie);return;case"option":for(var Ne in l)te=l[Ne],l.hasOwnProperty(Ne)&&te!=null&&!d.hasOwnProperty(Ne)&&(Ne==="selected"?n.selected=!1:xt(n,r,Ne,null,d,te));for(B in d)te=d[B],ie=l[B],d.hasOwnProperty(B)&&te!==ie&&(te!=null||ie!=null)&&(B==="selected"?n.selected=te&&typeof te!="function"&&typeof te!="symbol":xt(n,r,B,te,d,ie));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 Le in l)te=l[Le],l.hasOwnProperty(Le)&&te!=null&&!d.hasOwnProperty(Le)&&xt(n,r,Le,null,d,te);for(ee in d)if(te=d[ee],ie=l[ee],d.hasOwnProperty(ee)&&te!==ie&&(te!=null||ie!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(s(137,r));break;default:xt(n,r,ee,te,d,ie)}return;default:if(_r(r)){for(var yt in l)te=l[yt],l.hasOwnProperty(yt)&&te!==void 0&&!d.hasOwnProperty(yt)&&$m(n,r,yt,void 0,d,te);for(se in d)te=d[se],ie=l[se],!d.hasOwnProperty(se)||te===ie||te===void 0&&ie===void 0||$m(n,r,se,te,d,ie);return}}for(var K in l)te=l[K],l.hasOwnProperty(K)&&te!=null&&!d.hasOwnProperty(K)&&xt(n,r,K,null,d,te);for(le in d)te=d[le],ie=l[le],!d.hasOwnProperty(le)||te===ie||te==null&&ie==null||xt(n,r,le,te,d,ie)}function mx(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function ST(){if(typeof performance.getEntriesByType=="function"){for(var n=0,r=0,l=performance.getEntriesByType("resource"),d=0;d<l.length;d++){var g=l[d],v=g.transferSize,w=g.initiatorType,T=g.duration;if(v&&T&&mx(w)){for(w=0,T=g.responseEnd,d+=1;d<l.length;d++){var B=l[d],ee=B.startTime;if(ee>T)break;var se=B.transferSize,le=B.initiatorType;se&&mx(le)&&(B=B.responseEnd,w+=se*(B<T?1:(T-ee)/(B-ee)))}if(--d,r+=8*(v+w)/(g.duration/1e3),n++,10<n)break}}if(0<n)return r/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var Um=null,Hm=null;function hd(n){return n.nodeType===9?n:n.ownerDocument}function px(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function gx(n,r){if(n===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&r==="foreignObject"?0:n}function Fm(n,r){return n==="textarea"||n==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Vm=null;function wT(){var n=window.event;return n&&n.type==="popstate"?n===Vm?!1:(Vm=n,!0):(Vm=null,!1)}var bx=typeof setTimeout=="function"?setTimeout:void 0,kT=typeof clearTimeout=="function"?clearTimeout:void 0,vx=typeof Promise=="function"?Promise:void 0,ET=typeof queueMicrotask=="function"?queueMicrotask:typeof vx<"u"?function(n){return vx.resolve(null).then(n).catch(CT)}:bx;function CT(n){setTimeout(function(){throw n})}function Ir(n){return n==="head"}function _x(n,r){var l=r,d=0;do{var g=l.nextSibling;if(n.removeChild(l),g&&g.nodeType===8)if(l=g.data,l==="/$"||l==="/&"){if(d===0){n.removeChild(g),zo(r);return}d--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")d++;else if(l==="html")tc(n.ownerDocument.documentElement);else if(l==="head"){l=n.ownerDocument.head,tc(l);for(var v=l.firstChild;v;){var w=v.nextSibling,T=v.nodeName;v[ca]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&v.rel.toLowerCase()==="stylesheet"||l.removeChild(v),v=w}}else l==="body"&&tc(n.ownerDocument.body);l=g}while(l);zo(r)}function xx(n,r){var l=n;n=0;do{var d=l.nextSibling;if(l.nodeType===1?r?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(r?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),d&&d.nodeType===8)if(l=d.data,l==="/$"){if(n===0)break;n--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||n++;l=d}while(l)}function qm(n){var r=n.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var l=r;switch(r=r.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":qm(l),gl(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}n.removeChild(l)}}function NT(n,r,l,d){for(;n.nodeType===1;){var g=l;if(n.nodeName.toLowerCase()!==r.toLowerCase()){if(!d&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(d){if(!n[ca])switch(r){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(v=n.getAttribute("rel"),v==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(v!==g.rel||n.getAttribute("href")!==(g.href==null||g.href===""?null:g.href)||n.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin)||n.getAttribute("title")!==(g.title==null?null:g.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(v=n.getAttribute("src"),(v!==(g.src==null?null:g.src)||n.getAttribute("type")!==(g.type==null?null:g.type)||n.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin))&&v&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(r==="input"&&n.type==="hidden"){var v=g.name==null?null:""+g.name;if(g.type==="hidden"&&n.getAttribute("name")===v)return n}else return n;if(n=In(n.nextSibling),n===null)break}return null}function TT(n,r,l){if(r==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!l||(n=In(n.nextSibling),n===null))return null;return n}function yx(n,r){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!r||(n=In(n.nextSibling),n===null))return null;return n}function Km(n){return n.data==="$?"||n.data==="$~"}function Gm(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function AT(n,r){var l=n.ownerDocument;if(n.data==="$~")n._reactRetry=r;else if(n.data!=="$?"||l.readyState!=="loading")r();else{var d=function(){r(),l.removeEventListener("DOMContentLoaded",d)};l.addEventListener("DOMContentLoaded",d),n._reactRetry=d}}function In(n){for(;n!=null;n=n.nextSibling){var r=n.nodeType;if(r===1||r===3)break;if(r===8){if(r=n.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return n}var Wm=null;function Sx(n){n=n.nextSibling;for(var r=0;n;){if(n.nodeType===8){var l=n.data;if(l==="/$"||l==="/&"){if(r===0)return In(n.nextSibling);r--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||r++}n=n.nextSibling}return null}function wx(n){n=n.previousSibling;for(var r=0;n;){if(n.nodeType===8){var l=n.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(r===0)return n;r--}else l!=="/$"&&l!=="/&"||r++}n=n.previousSibling}return null}function kx(n,r,l){switch(r=hd(l),n){case"html":if(n=r.documentElement,!n)throw Error(s(452));return n;case"head":if(n=r.head,!n)throw Error(s(453));return n;case"body":if(n=r.body,!n)throw Error(s(454));return n;default:throw Error(s(451))}}function tc(n){for(var r=n.attributes;r.length;)n.removeAttributeNode(r[0]);gl(n)}var Pn=new Map,Ex=new Set;function fd(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var sr=X.d;X.d={f:MT,r:RT,D:jT,C:DT,L:OT,m:LT,X:zT,S:BT,M:IT};function MT(){var n=sr.f(),r=sd();return n||r}function RT(n){var r=$s(n);r!==null&&r.tag===5&&r.type==="form"?H_(r):sr.r(n)}var Oo=typeof document>"u"?null:document;function Cx(n,r,l){var d=Oo;if(d&&typeof r=="string"&&r){var g=sn(r);g='link[rel="'+n+'"][href="'+g+'"]',typeof l=="string"&&(g+='[crossorigin="'+l+'"]'),Ex.has(g)||(Ex.add(g),n={rel:n,crossOrigin:l,href:r},d.querySelector(g)===null&&(r=d.createElement("link"),Ai(r,"link",n),Zt(r),d.head.appendChild(r)))}}function jT(n){sr.D(n),Cx("dns-prefetch",n,null)}function DT(n,r){sr.C(n,r),Cx("preconnect",n,r)}function OT(n,r,l){sr.L(n,r,l);var d=Oo;if(d&&n&&r){var g='link[rel="preload"][as="'+sn(r)+'"]';r==="image"&&l&&l.imageSrcSet?(g+='[imagesrcset="'+sn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(g+='[imagesizes="'+sn(l.imageSizes)+'"]')):g+='[href="'+sn(n)+'"]';var v=g;switch(r){case"style":v=Lo(n);break;case"script":v=Bo(n)}Pn.has(v)||(n=b({rel:"preload",href:r==="image"&&l&&l.imageSrcSet?void 0:n,as:r},l),Pn.set(v,n),d.querySelector(g)!==null||r==="style"&&d.querySelector(ic(v))||r==="script"&&d.querySelector(nc(v))||(r=d.createElement("link"),Ai(r,"link",n),Zt(r),d.head.appendChild(r)))}}function LT(n,r){sr.m(n,r);var l=Oo;if(l&&n){var d=r&&typeof r.as=="string"?r.as:"script",g='link[rel="modulepreload"][as="'+sn(d)+'"][href="'+sn(n)+'"]',v=g;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=Bo(n)}if(!Pn.has(v)&&(n=b({rel:"modulepreload",href:n},r),Pn.set(v,n),l.querySelector(g)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(nc(v)))return}d=l.createElement("link"),Ai(d,"link",n),Zt(d),l.head.appendChild(d)}}}function BT(n,r,l){sr.S(n,r,l);var d=Oo;if(d&&n){var g=vr(d).hoistableStyles,v=Lo(n);r=r||"default";var w=g.get(v);if(!w){var T={loading:0,preload:null};if(w=d.querySelector(ic(v)))T.loading=5;else{n=b({rel:"stylesheet",href:n,"data-precedence":r},l),(l=Pn.get(v))&&Ym(n,l);var B=w=d.createElement("link");Zt(B),Ai(B,"link",n),B._p=new Promise(function(ee,se){B.onload=ee,B.onerror=se}),B.addEventListener("load",function(){T.loading|=1}),B.addEventListener("error",function(){T.loading|=2}),T.loading|=4,md(w,r,d)}w={type:"stylesheet",instance:w,count:1,state:T},g.set(v,w)}}}function zT(n,r){sr.X(n,r);var l=Oo;if(l&&n){var d=vr(l).hoistableScripts,g=Bo(n),v=d.get(g);v||(v=l.querySelector(nc(g)),v||(n=b({src:n,async:!0},r),(r=Pn.get(g))&&Xm(n,r),v=l.createElement("script"),Zt(v),Ai(v,"link",n),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(g,v))}}function IT(n,r){sr.M(n,r);var l=Oo;if(l&&n){var d=vr(l).hoistableScripts,g=Bo(n),v=d.get(g);v||(v=l.querySelector(nc(g)),v||(n=b({src:n,async:!0,type:"module"},r),(r=Pn.get(g))&&Xm(n,r),v=l.createElement("script"),Zt(v),Ai(v,"link",n),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(g,v))}}function Nx(n,r,l,d){var g=(g=ne.current)?fd(g):null;if(!g)throw Error(s(446));switch(n){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(r=Lo(l.href),l=vr(g).hoistableStyles,d=l.get(r),d||(d={type:"style",instance:null,count:0,state:null},l.set(r,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){n=Lo(l.href);var v=vr(g).hoistableStyles,w=v.get(n);if(w||(g=g.ownerDocument||g,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(n,w),(v=g.querySelector(ic(n)))&&!v._p&&(w.instance=v,w.state.loading=5),Pn.has(n)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Pn.set(n,l),v||PT(g,n,l,w.state))),r&&d===null)throw Error(s(528,""));return w}if(r&&d!==null)throw Error(s(529,""));return null;case"script":return r=l.async,l=l.src,typeof l=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Bo(l),l=vr(g).hoistableScripts,d=l.get(r),d||(d={type:"script",instance:null,count:0,state:null},l.set(r,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,n))}}function Lo(n){return'href="'+sn(n)+'"'}function ic(n){return'link[rel="stylesheet"]['+n+"]"}function Tx(n){return b({},n,{"data-precedence":n.precedence,precedence:null})}function PT(n,r,l,d){n.querySelector('link[rel="preload"][as="style"]['+r+"]")?d.loading=1:(r=n.createElement("link"),d.preload=r,r.addEventListener("load",function(){return d.loading|=1}),r.addEventListener("error",function(){return d.loading|=2}),Ai(r,"link",l),Zt(r),n.head.appendChild(r))}function Bo(n){return'[src="'+sn(n)+'"]'}function nc(n){return"script[async]"+n}function Ax(n,r,l){if(r.count++,r.instance===null)switch(r.type){case"style":var d=n.querySelector('style[data-href~="'+sn(l.href)+'"]');if(d)return r.instance=d,Zt(d),d;var g=b({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return d=(n.ownerDocument||n).createElement("style"),Zt(d),Ai(d,"style",g),md(d,l.precedence,n),r.instance=d;case"stylesheet":g=Lo(l.href);var v=n.querySelector(ic(g));if(v)return r.state.loading|=4,r.instance=v,Zt(v),v;d=Tx(l),(g=Pn.get(g))&&Ym(d,g),v=(n.ownerDocument||n).createElement("link"),Zt(v);var w=v;return w._p=new Promise(function(T,B){w.onload=T,w.onerror=B}),Ai(v,"link",d),r.state.loading|=4,md(v,l.precedence,n),r.instance=v;case"script":return v=Bo(l.src),(g=n.querySelector(nc(v)))?(r.instance=g,Zt(g),g):(d=l,(g=Pn.get(v))&&(d=b({},l),Xm(d,g)),n=n.ownerDocument||n,g=n.createElement("script"),Zt(g),Ai(g,"link",d),n.head.appendChild(g),r.instance=g);case"void":return null;default:throw Error(s(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(d=r.instance,r.state.loading|=4,md(d,l.precedence,n));return r.instance}function md(n,r,l){for(var d=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=d.length?d[d.length-1]:null,v=g,w=0;w<d.length;w++){var T=d[w];if(T.dataset.precedence===r)v=T;else if(v!==g)break}v?v.parentNode.insertBefore(n,v.nextSibling):(r=l.nodeType===9?l.head:l,r.insertBefore(n,r.firstChild))}function Ym(n,r){n.crossOrigin==null&&(n.crossOrigin=r.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=r.referrerPolicy),n.title==null&&(n.title=r.title)}function Xm(n,r){n.crossOrigin==null&&(n.crossOrigin=r.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=r.referrerPolicy),n.integrity==null&&(n.integrity=r.integrity)}var pd=null;function Mx(n,r,l){if(pd===null){var d=new Map,g=pd=new Map;g.set(l,d)}else g=pd,d=g.get(l),d||(d=new Map,g.set(l,d));if(d.has(n))return d;for(d.set(n,null),l=l.getElementsByTagName(n),g=0;g<l.length;g++){var v=l[g];if(!(v[ca]||v[Kt]||n==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var w=v.getAttribute(r)||"";w=n+w;var T=d.get(w);T?T.push(v):d.set(w,[v])}}return d}function Rx(n,r,l){n=n.ownerDocument||n,n.head.insertBefore(l,r==="title"?n.querySelector("head > title"):null)}function $T(n,r,l){if(l===1||r.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;return r.rel==="stylesheet"?(n=r.disabled,typeof r.precedence=="string"&&n==null):!0;case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function jx(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function UT(n,r,l,d){if(l.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var g=Lo(d.href),v=r.querySelector(ic(g));if(v){r=v._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(n.count++,n=gd.bind(n),r.then(n,n)),l.state.loading|=4,l.instance=v,Zt(v);return}v=r.ownerDocument||r,d=Tx(d),(g=Pn.get(g))&&Ym(d,g),v=v.createElement("link"),Zt(v);var w=v;w._p=new Promise(function(T,B){w.onload=T,w.onerror=B}),Ai(v,"link",d),l.instance=v}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(l,r),(r=l.state.preload)&&(l.state.loading&3)===0&&(n.count++,l=gd.bind(n),r.addEventListener("load",l),r.addEventListener("error",l))}}var Zm=0;function HT(n,r){return n.stylesheets&&n.count===0&&vd(n,n.stylesheets),0<n.count||0<n.imgCount?function(l){var d=setTimeout(function(){if(n.stylesheets&&vd(n,n.stylesheets),n.unsuspend){var v=n.unsuspend;n.unsuspend=null,v()}},6e4+r);0<n.imgBytes&&Zm===0&&(Zm=62500*ST());var g=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&vd(n,n.stylesheets),n.unsuspend)){var v=n.unsuspend;n.unsuspend=null,v()}},(n.imgBytes>Zm?50:800)+r);return n.unsuspend=l,function(){n.unsuspend=null,clearTimeout(d),clearTimeout(g)}}:null}function gd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)vd(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var bd=null;function vd(n,r){n.stylesheets=null,n.unsuspend!==null&&(n.count++,bd=new Map,r.forEach(FT,n),bd=null,gd.call(n))}function FT(n,r){if(!(r.state.loading&4)){var l=bd.get(n);if(l)var d=l.get(null);else{l=new Map,bd.set(n,l);for(var g=n.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<g.length;v++){var w=g[v];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(l.set(w.dataset.precedence,w),d=w)}d&&l.set(null,d)}g=r.instance,w=g.getAttribute("data-precedence"),v=l.get(w)||d,v===d&&l.set(null,g),l.set(w,g),this.count++,d=gd.bind(this),g.addEventListener("load",d),g.addEventListener("error",d),v?v.parentNode.insertBefore(g,v.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(g,n.firstChild)),r.state.loading|=4}}var sc={$$typeof:N,Provider:null,Consumer:null,_currentValue:Z,_currentValue2:Z,_threadCount:0};function VT(n,r,l,d,g,v,w,T,B){this.tag=1,this.containerInfo=n,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=Nt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Nt(0),this.hiddenUpdates=Nt(null),this.identifierPrefix=d,this.onUncaughtError=g,this.onCaughtError=v,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=B,this.incompleteTransitions=new Map}function Dx(n,r,l,d,g,v,w,T,B,ee,se,le){return n=new VT(n,r,l,w,B,ee,se,le,T),r=1,v===!0&&(r|=24),v=xn(3,null,null,r),n.current=v,v.stateNode=n,r=Mf(),r.refCount++,n.pooledCache=r,r.refCount++,v.memoizedState={element:d,isDehydrated:l,cache:r},Of(v),n}function Ox(n){return n?(n=fo,n):fo}function Lx(n,r,l,d,g,v){g=Ox(g),d.context===null?d.context=g:d.pendingContext=g,d=Nr(r),d.payload={element:l},v=v===void 0?null:v,v!==null&&(d.callback=v),l=Tr(n,d,r),l!==null&&(un(l,n,r),Bl(l,n,r))}function Bx(n,r){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var l=n.retryLane;n.retryLane=l!==0&&l<r?l:r}}function Qm(n,r){Bx(n,r),(n=n.alternate)&&Bx(n,r)}function zx(n){if(n.tag===13||n.tag===31){var r=pa(n,67108864);r!==null&&un(r,n,67108864),Qm(n,67108864)}}function Ix(n){if(n.tag===13||n.tag===31){var r=En();r=jt(r);var l=pa(n,r);l!==null&&un(l,n,r),Qm(n,r)}}var _d=!0;function qT(n,r,l,d){var g=O.T;O.T=null;var v=X.p;try{X.p=2,Jm(n,r,l,d)}finally{X.p=v,O.T=g}}function KT(n,r,l,d){var g=O.T;O.T=null;var v=X.p;try{X.p=8,Jm(n,r,l,d)}finally{X.p=v,O.T=g}}function Jm(n,r,l,d){if(_d){var g=ep(d);if(g===null)Pm(n,r,d,xd,l),$x(n,d);else if(WT(g,n,r,l,d))d.stopPropagation();else if($x(n,d),r&4&&-1<GT.indexOf(n)){for(;g!==null;){var v=$s(g);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var w=zi(v.pendingLanes);if(w!==0){var T=v;for(T.pendingLanes|=2,T.entangledLanes|=2;w;){var B=1<<31-ki(w);T.entanglements[1]|=B,w&=~B}ps(v),(ht&6)===0&&(id=Bt()+500,Ql(0))}}break;case 31:case 13:T=pa(v,2),T!==null&&un(T,v,2),sd(),Qm(v,2)}if(v=ep(d),v===null&&Pm(n,r,d,xd,l),v===g)break;g=v}g!==null&&d.stopPropagation()}else Pm(n,r,d,null,l)}}function ep(n){return n=Fe(n),tp(n)}var xd=null;function tp(n){if(xd=null,n=Gi(n),n!==null){var r=o(n);if(r===null)n=null;else{var l=r.tag;if(l===13){if(n=u(r),n!==null)return n;n=null}else if(l===31){if(n=h(r),n!==null)return n;n=null}else if(l===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;n=null}else r!==n&&(n=null)}}return xd=n,null}function Px(n){switch(n){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(Ls()){case wi:return 2;case Bs:return 8;case zs:case Qa:return 32;case pr:return 268435456;default:return 32}default:return 32}}var ip=!1,Pr=null,$r=null,Ur=null,rc=new Map,ac=new Map,Hr=[],GT="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 $x(n,r){switch(n){case"focusin":case"focusout":Pr=null;break;case"dragenter":case"dragleave":$r=null;break;case"mouseover":case"mouseout":Ur=null;break;case"pointerover":case"pointerout":rc.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":ac.delete(r.pointerId)}}function oc(n,r,l,d,g,v){return n===null||n.nativeEvent!==v?(n={blockedOn:r,domEventName:l,eventSystemFlags:d,nativeEvent:v,targetContainers:[g]},r!==null&&(r=$s(r),r!==null&&zx(r)),n):(n.eventSystemFlags|=d,r=n.targetContainers,g!==null&&r.indexOf(g)===-1&&r.push(g),n)}function WT(n,r,l,d,g){switch(r){case"focusin":return Pr=oc(Pr,n,r,l,d,g),!0;case"dragenter":return $r=oc($r,n,r,l,d,g),!0;case"mouseover":return Ur=oc(Ur,n,r,l,d,g),!0;case"pointerover":var v=g.pointerId;return rc.set(v,oc(rc.get(v)||null,n,r,l,d,g)),!0;case"gotpointercapture":return v=g.pointerId,ac.set(v,oc(ac.get(v)||null,n,r,l,d,g)),!0}return!1}function Ux(n){var r=Gi(n.target);if(r!==null){var l=o(r);if(l!==null){if(r=l.tag,r===13){if(r=u(l),r!==null){n.blockedOn=r,io(n.priority,function(){Ix(l)});return}}else if(r===31){if(r=h(l),r!==null){n.blockedOn=r,io(n.priority,function(){Ix(l)});return}}else if(r===3&&l.stateNode.current.memoizedState.isDehydrated){n.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}n.blockedOn=null}function yd(n){if(n.blockedOn!==null)return!1;for(var r=n.targetContainers;0<r.length;){var l=ep(n.nativeEvent);if(l===null){l=n.nativeEvent;var d=new l.constructor(l.type,l);Me=d,l.target.dispatchEvent(d),Me=null}else return r=$s(l),r!==null&&zx(r),n.blockedOn=l,!1;r.shift()}return!0}function Hx(n,r,l){yd(n)&&l.delete(r)}function YT(){ip=!1,Pr!==null&&yd(Pr)&&(Pr=null),$r!==null&&yd($r)&&($r=null),Ur!==null&&yd(Ur)&&(Ur=null),rc.forEach(Hx),ac.forEach(Hx)}function Sd(n,r){n.blockedOn===r&&(n.blockedOn=null,ip||(ip=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,YT)))}var wd=null;function Fx(n){wd!==n&&(wd=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){wd===n&&(wd=null);for(var r=0;r<n.length;r+=3){var l=n[r],d=n[r+1],g=n[r+2];if(typeof d!="function"){if(tp(d||l)===null)continue;break}var v=$s(l);v!==null&&(n.splice(r,3),r-=3,em(v,{pending:!0,data:g,method:l.method,action:d},d,g))}}))}function zo(n){function r(B){return Sd(B,n)}Pr!==null&&Sd(Pr,n),$r!==null&&Sd($r,n),Ur!==null&&Sd(Ur,n),rc.forEach(r),ac.forEach(r);for(var l=0;l<Hr.length;l++){var d=Hr[l];d.blockedOn===n&&(d.blockedOn=null)}for(;0<Hr.length&&(l=Hr[0],l.blockedOn===null);)Ux(l),l.blockedOn===null&&Hr.shift();if(l=(n.ownerDocument||n).$$reactFormReplay,l!=null)for(d=0;d<l.length;d+=3){var g=l[d],v=l[d+1],w=g[Ii]||null;if(typeof v=="function")w||Fx(l);else if(w){var T=null;if(v&&v.hasAttribute("formAction")){if(g=v,w=v[Ii]||null)T=w.formAction;else if(tp(g)!==null)continue}else T=w.action;typeof T=="function"?l[d+1]=T:(l.splice(d,3),d-=3),Fx(l)}}}function Vx(){function n(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(w){return g=w})},focusReset:"manual",scroll:"manual"})}function r(){g!==null&&(g(),g=null),d||setTimeout(l,20)}function l(){if(!d&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var d=!1,g=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(l,100),function(){d=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),g!==null&&(g(),g=null)}}}function np(n){this._internalRoot=n}kd.prototype.render=np.prototype.render=function(n){var r=this._internalRoot;if(r===null)throw Error(s(409));var l=r.current,d=En();Lx(l,d,n,r,null,null)},kd.prototype.unmount=np.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var r=n.containerInfo;Lx(n.current,2,null,n,null,null),sd(),r[gr]=null}};function kd(n){this._internalRoot=n}kd.prototype.unstable_scheduleHydration=function(n){if(n){var r=to();n={blockedOn:null,target:n,priority:r};for(var l=0;l<Hr.length&&r!==0&&r<Hr[l].priority;l++);Hr.splice(l,0,n),l===0&&Ux(n)}};var qx=t.version;if(qx!=="19.2.6")throw Error(s(527,qx,"19.2.6"));X.findDOMNode=function(n){var r=n._reactInternals;if(r===void 0)throw typeof n.render=="function"?Error(s(188)):(n=Object.keys(n).join(","),Error(s(268,n)));return n=f(r),n=n!==null?p(n):null,n=n===null?null:n.stateNode,n};var XT={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:O,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ed=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ed.isDisabled&&Ed.supportsFiber)try{Is=Ed.inject(XT),gi=Ed}catch{}}return cc.createRoot=function(n,r){if(!a(n))throw Error(s(299));var l=!1,d="",g=Q_,v=J_,w=e1;return r!=null&&(r.unstable_strictMode===!0&&(l=!0),r.identifierPrefix!==void 0&&(d=r.identifierPrefix),r.onUncaughtError!==void 0&&(g=r.onUncaughtError),r.onCaughtError!==void 0&&(v=r.onCaughtError),r.onRecoverableError!==void 0&&(w=r.onRecoverableError)),r=Dx(n,1,!1,null,null,l,d,null,g,v,w,Vx),n[gr]=r.current,Im(n),new np(r)},cc.hydrateRoot=function(n,r,l){if(!a(n))throw Error(s(299));var d=!1,g="",v=Q_,w=J_,T=e1,B=null;return l!=null&&(l.unstable_strictMode===!0&&(d=!0),l.identifierPrefix!==void 0&&(g=l.identifierPrefix),l.onUncaughtError!==void 0&&(v=l.onUncaughtError),l.onCaughtError!==void 0&&(w=l.onCaughtError),l.onRecoverableError!==void 0&&(T=l.onRecoverableError),l.formState!==void 0&&(B=l.formState)),r=Dx(n,1,!0,r,l??null,d,g,B,v,w,T,Vx),r.context=Ox(null),l=r.current,d=En(),d=jt(d),g=Nr(d),g.callback=null,Tr(l,g,d),l=d,r.current.lanes=l,wt(r,l),ps(r),n[gr]=r.current,Im(n),new kd(r)},cc.version="19.2.6",cc}var ty;function aA(){if(ty)return ap.exports;ty=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(),ap.exports=rA(),ap.exports}var dk=aA();const hk=(...e)=>e.filter((t,i,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===i).join(" ").trim();const oA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const lA=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,i,s)=>s?s.toUpperCase():i.toLowerCase());const iy=e=>{const t=lA(e);return t.charAt(0).toUpperCase()+t.slice(1)};var up={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 cA=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},uA=k.createContext({}),dA=()=>k.useContext(uA),hA=k.forwardRef(({color:e,size:t,strokeWidth:i,absoluteStrokeWidth:s,className:a="",children:o,iconNode:u,...h},m)=>{const{size:f=24,strokeWidth:p=2,absoluteStrokeWidth:b=!1,color:_="currentColor",className:x=""}=dA()??{},y=s??b?Number(i??p)*24/Number(t??f):i??p;return k.createElement("svg",{ref:m,...up,width:t??f??up.width,height:t??f??up.height,stroke:e??_,strokeWidth:y,className:hk("lucide",x,a),...!o&&!cA(h)&&{"aria-hidden":"true"},...h},[...u.map(([S,E])=>k.createElement(S,E)),...Array.isArray(o)?o:[o]])});const ge=(e,t)=>{const i=k.forwardRef(({className:s,...a},o)=>k.createElement(hA,{ref:o,iconNode:t,className:hk(`lucide-${oA(iy(e))}`,`lucide-${e}`,s),...a}));return i.displayName=iy(e),i};const fA=[["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"}]],Pa=ge("activity",fA);const mA=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],pA=ge("arrow-down",mA);const gA=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],fk=ge("arrow-left",gA);const bA=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],mk=ge("arrow-up",bA);const vA=[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]],_A=ge("blocks",vA);const xA=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],yA=ge("book-open",xA);const SA=[["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"}]],wA=ge("bot",SA);const kA=[["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"}]],pk=ge("box",kA);const EA=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],CA=ge("braces",EA);const NA=[["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"}]],gk=ge("brain",NA);const TA=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],sl=ge("check",TA);const AA=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Yn=ge("chevron-down",AA);const MA=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],RA=ge("chevron-left",MA);const jA=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],sa=ge("chevron-right",jA);const DA=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Ph=ge("chevron-up",DA);const OA=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],bk=ge("code-xml",OA);const LA=[["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"}]],Lg=ge("copy",LA);const BA=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],zA=ge("corner-down-left",BA);const IA=[["path",{d:"m15 10 5 5-5 5",key:"qqa56n"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]],PA=ge("corner-down-right",IA);const $A=[["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"}]],UA=ge("cpu",$A);const HA=[["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"}]],us=ge("database",HA);const FA=[["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"}]],vk=ge("download",FA);const VA=[["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"}]],qA=ge("earth",VA);const KA=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],_k=ge("ellipsis",KA);const GA=[["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"}]],nb=ge("external-link",GA);const WA=[["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"}]],xk=ge("eye-off",WA);const YA=[["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"}]],sb=ge("eye",YA);const XA=[["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"}]],yk=ge("file-code-corner",XA);const ZA=[["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"}]],Sk=ge("file-exclamation-point",ZA);const QA=[["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:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],JA=ge("file-spreadsheet",QA);const e4=[["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"}]],wk=ge("file-text",e4);const t4=[["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"}]],kk=ge("file",t4);const i4=[["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"}]],n4=ge("flask-conical",i4);const s4=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 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.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],r4=ge("folder-git-2",s4);const a4=[["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"}]],$h=ge("folder-open",a4);const o4=[["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"}]],l4=ge("folder-plus",o4);const c4=[["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"}]],Ga=ge("folder",c4);const u4=[["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"}]],d4=ge("funnel",u4);const h4=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Ek=ge("gauge",h4);const f4=[["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"}]],Wn=ge("git-branch",f4);const m4=[["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"}]],p4=ge("git-pull-request-create",m4);const g4=[["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"}]],b4=ge("heart",g4);const v4=[["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"}]],_4=ge("image",v4);const x4=[["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"}]],oh=ge("inbox",x4);const y4=[["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"}]],S4=ge("key-round",y4);const w4=[["path",{d:"M10 5h11",key:"1hkqpe"}],["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 19h11",key:"14g2nv"}],["path",{d:"m3 10 3-3-3-3",key:"i7pm08"}],["path",{d:"m3 20 3-3-3-3",key:"20gx1n"}]],k4=ge("list-collapse",w4);const E4=[["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"M3 10a2 2 0 0 0 2 2h3",key:"1npucw"}],["path",{d:"M3 5v12a2 2 0 0 0 2 2h3",key:"x1gjn2"}]],C4=ge("list-tree",E4);const N4=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Oi=ge("loader-circle",N4);const T4=[["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"}]],A4=ge("lock-keyhole",T4);const M4=[["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"}]],Ck=ge("maximize-2",M4);const R4=[["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"}]],j4=ge("memory-stick",R4);const D4=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],O4=ge("message-circle-warning",D4);const L4=[["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"}]],Nk=ge("minimize-2",L4);const B4=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],z4=ge("moon",B4);const I4=[["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"}]],P4=ge("network",I4);const $4=[["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"}]],U4=ge("palette",$4);const H4=[["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"}]],F4=ge("panel-left-close",H4);const V4=[["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"}]],q4=ge("panel-left-open",V4);const K4=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],G4=ge("panel-left",K4);const W4=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}]],Y4=ge("panel-top",W4);const X4=[["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"}]],Z4=ge("paperclip",X4);const Q4=[["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"}]],Ic=ge("pencil",Q4);const J4=[["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"}]],Uh=ge("play",J4);const eM=[["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"}]],Tk=ge("plug",eM);const tM=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],mn=ge("plus",tM);const iM=[["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"}]],nM=ge("radio",iM);const sM=[["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"}]],Hh=ge("refresh-cw",sM);const rM=[["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"}]],rb=ge("rotate-ccw",rM);const aM=[["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"}]],Ak=ge("save",aM);const oM=[["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"}]],Mk=ge("scroll-text",oM);const lM=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],cM=ge("search",lM);const uM=[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]],dM=ge("send-horizontal",uM);const hM=[["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"}]],Rk=ge("server",hM);const fM=[["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"}]],mM=ge("settings-2",fM);const pM=[["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"}]],gM=ge("shield-alert",pM);const bM=[["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"}]],Wa=ge("sparkles",bM);const vM=[["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"}]],_M=ge("square-terminal",vM);const xM=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Fh=ge("square",xM);const yM=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],SM=ge("sun",yM);const wM=[["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"}]],kM=ge("table-2",wM);const EM=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],jk=ge("terminal",EM);const CM=[["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"}]],rl=ge("trash-2",CM);const NM=[["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"}]],TM=ge("triangle-alert",NM);const AM=[["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"}]],MM=ge("wand-sparkles",AM);const RM=[["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"}]],jM=ge("wrench",RM);const DM=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ji=ge("x",DM);const OM=[["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"}]],LM=ge("zap",OM);class Dk extends Error{conflict;constructor(t,i){super(t),this.name="PortConflictResponseError",this.conflict=i}}async function Ke(e,t){const i=await fetch(e,t),s=await i.json().catch(()=>{});if(!i.ok)throw i.status===409&&s?.conflict?.code==="PORT_IN_USE"?new Dk(s?.error||"Port already in use",s.conflict):new Error(s?.error||i.statusText);return s}async function pn(e,t){const i=new URLSearchParams;for(const[s,a]of Object.entries(t))a!==void 0&&String(a).trim()&&i.set(s,String(a));await Ke(e,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:i})}async function Qc(e,t){const i=new URLSearchParams;for(const[s,a]of Object.entries(t))a!==void 0&&String(a).trim()&&i.set(s,String(a));return Ke(e,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:i})}async function BM(){return(await Ke("/api/agent")).agent}async function zM(e){return(await Ke(`/api/agent/mcp-status?agent=${encodeURIComponent(e)}`)).statuses}async function IM(){return(await Ke("/api/agent/usage")).usage}async function PM(){return(await Ke("/api/agent/claude-settings")).settings}async function $M(e){return(await Ke("/api/agent/claude-settings",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)})).settings}async function UM(){const e=await Ke("/api/agent/chat/status");return{configured:e.configured,approvals:e.approvals,provider:e.provider}}async function HM(e,t,i){await Ke("/api/agent/chat/approve",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({sessionId:e,requestId:t,decision:i})})}async function FM(e,t,i,s){const a=await fetch("/api/agent/chat",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({message:e,resumeSessionId:t}),signal:s});if(!a.ok||!a.body){const m=await a.json().catch(()=>{});throw new Error(m?.error||a.statusText||"Agent request failed")}const o=a.body.getReader(),u=new TextDecoder;let h="";for(;;){const{done:m,value:f}=await o.read();if(m)break;h+=u.decode(f,{stream:!0});let p=h.indexOf(`
|
|
10
|
-
|
|
11
|
-
`);for(;p!==-1;){const b=h.slice(0,p);h=h.slice(p+2);const _=b.split(`
|
|
12
|
-
`).find(x=>x.startsWith("data:"));if(_){const x=_.slice(5).trim();if(x)try{i(JSON.parse(x))}catch{}}p=h.indexOf(`
|
|
13
|
-
|
|
14
|
-
`)}}}async function Ok(){return(await Ke("/api/databases")).connections}async function VM(){return(await Ke("/api/databases/detect")).detected}async function qM(e){await Qc("/api/databases",e)}async function KM(e){return Qc("/api/databases/test",e)}async function GM(e){await Ke(`/api/databases/${encodeURIComponent(e)}`,{method:"DELETE"})}async function WM(e){return(await Ke(`/api/databases/${encodeURIComponent(e)}/tables`)).tables}async function YM(e,t,i=100,s=0){return Ke(`/api/databases/${encodeURIComponent(e)}/rows?table=${encodeURIComponent(t)}&limit=${i}&offset=${s}`)}async function Lk(e=100){return(await Ke(`/api/errors?limit=${e}`)).incidents}async function XM(e){return Ke(`/api/errors/${e}/prompt`)}async function ZM(e=200){return(await Ke(`/api/git/graph?limit=${e}`)).commits}async function QM(e,t){const i=new URLSearchParams({hash:e});t&&i.set("file",t);const s=await fetch(`/api/git/commit?${i.toString()}`);if(!s.ok){const a=await s.json().catch(()=>({error:s.statusText}));throw new Error(a.error||"Unable to load commit diff")}return s.text()}async function JM(e){return(await Ke(`/api/git/commit/files?hash=${encodeURIComponent(e)}`)).files}async function e6(){return(await Ke("/api/git/files")).files}async function t6(){return(await Ke("/api/git/file-sizes")).files}async function i6(e){const t=await Ke(`/api/git/file?path=${encodeURIComponent(e)}`);return{content:t.content,truncated:t.truncated,binary:t.binary,size:t.size}}async function n6(e,t){await Ke("/api/git/file",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({path:e,content:t})})}async function s6(e){const t=await fetch(`/api/git/diff?file=${encodeURIComponent(e)}`);if(!t.ok){const i=await t.json().catch(()=>({error:t.statusText}));throw new Error(i.error||"Unable to load diff")}return t.text()}async function r6(e){await Ke(`/api/git/repositories/${encodeURIComponent(e)}`,{method:"DELETE"})}async function a6(){return(await Ke("/api/log-sources")).sources}async function o6(e){return(await Qc("/api/log-sources",e)).sources}async function Bk(e,t={}){const i=new URLSearchParams;return i.set("lines",String(t.lines??500)),t.since&&i.set("since",t.since),t.until&&i.set("until",t.until),t.grep&&i.set("grep",t.grep),t.level&&i.set("level",t.level),t.cursor&&i.set("cursor",t.cursor),t.before&&i.set("before",t.before),(await Ke(`/api/log-sources/${encodeURIComponent(e)}/logs?${i.toString()}`)).logs}const ab={"content-type":"application/json"};async function l6(e){const t=await Ke("/api/onboard/scan",{method:"POST",headers:ab,body:JSON.stringify({url:e})});return{profile:t.profile,proposals:t.proposals,databases:t.databases??[]}}async function c6(e,t,i){const s=i?{name:i.name,engine:i.engine,url:i.url}:void 0;await Ke("/api/onboard/register",{method:"POST",headers:ab,body:JSON.stringify({...e,start:t,database:s})})}async function u6(e,t){const i=await fetch("/api/onboard/install/stream",{method:"POST",headers:ab,body:JSON.stringify(e)});if(!i.ok||!i.body){const u=await i.json().catch(()=>{});t.onError(u?.error||i.statusText);return}const s=i.body.getReader(),a=new TextDecoder;let o="";for(;;){const{done:u,value:h}=await s.read();if(u)break;o+=a.decode(h,{stream:!0});const m=o.split(`
|
|
15
|
-
|
|
16
|
-
`);o=m.pop()??"";for(const f of m)d6(f,t)}}function d6(e,t){let i="message",s="";for(const a of e.split(`
|
|
17
|
-
`))a.startsWith("event:")?i=a.slice(6).trim():a.startsWith("data:")&&(s+=a.slice(5).trim());if(s)try{const a=JSON.parse(s);i==="output"?t.onLine(a):i==="done"?t.onDone(a.exitCode??null):i==="error"&&t.onError(a.error??"Install failed.")}catch{}}async function h6(){return Ke("/api/dashboard")}async function f6(e){await Ke(`/api/services/${encodeURIComponent(e)}`,{method:"DELETE"})}async function m6(e,t,i){t.includes(i)||await pn("/api/bundles",{name:e,originalName:e,services:[...t,i].join(",")})}async function p6(e,t,i){t.includes(i)&&await pn("/api/bundles",{name:e,originalName:e,services:t.filter(s=>s!==i).join(",")})}async function zk(e,{files:t=!1}={}){const i=new URLSearchParams({path:e});return t&&i.set("files","1"),Ke(`/api/fs/directories?${i.toString()}`)}async function Ik(e,t={}){const i=new URLSearchParams;i.set("lines",String(t.lines??500)),t.since&&i.set("since",t.since),t.until&&i.set("until",t.until),t.grep&&i.set("grep",t.grep),t.level&&i.set("level",t.level),t.cursor&&i.set("cursor",t.cursor),t.before&&i.set("before",t.before);const s=await Ke(`/api/services/${encodeURIComponent(e)}/logs?${i.toString()}`);return{logs:s.logs,queryable:!!s.queryable}}async function g6(e,t){const i=t?`?path=${encodeURIComponent(t)}`:"";return Ke(`/api/services/${encodeURIComponent(e)}/config-browse${i}`)}async function b6(e){const t=await Ke(`/api/services/${encodeURIComponent(e)}/config-files`);return{cwd:t.cwd,files:t.files}}async function ny(e,t){return Ke(`/api/services/${encodeURIComponent(e)}/config-file?path=${encodeURIComponent(t)}`)}async function v6(e,t,i){return Ke(`/api/services/${encodeURIComponent(e)}/config-file?path=${encodeURIComponent(t)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({entries:i})})}async function _6(e,t,i){return Ke(`/api/services/${encodeURIComponent(e)}/config-file?path=${encodeURIComponent(t)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({content:i})})}async function x6(e){return(await Ke(`/api/services/${encodeURIComponent(e)}/metrics`)).metrics}async function y6(e){return Qc("/api/services/test",e)}async function S6(e,t){return Qc(`/api/services/${encodeURIComponent(e)}/test`,t?{pattern:t}:{})}async function w6(){return(await Ke("/api/terminal/sessions")).sessions}async function Kd(e){return(await Ke("/api/terminal/sessions",{method:"POST",...e?.serviceName?{headers:{"content-type":"application/json"},body:JSON.stringify({serviceName:e.serviceName})}:{}})).session}async function k6(e){await Ke(`/api/terminal/sessions/${encodeURIComponent(e)}`,{method:"DELETE"})}function Pk(e){var t,i,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(i=Pk(e[t]))&&(s&&(s+=" "),s+=i)}else for(i in e)e[i]&&(s&&(s+=" "),s+=i);return s}function Pc(){for(var e,t,i=0,s="",a=arguments.length;i<a;i++)(e=arguments[i])&&(t=Pk(e))&&(s&&(s+=" "),s+=t);return s}const sy=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ry=Pc,$k=(e,t)=>i=>{var s;if(t?.variants==null)return ry(e,i?.class,i?.className);const{variants:a,defaultVariants:o}=t,u=Object.keys(a).map(f=>{const p=i?.[f],b=o?.[f];if(p===null)return null;const _=sy(p)||sy(b);return a[f][_]}),h=i&&Object.entries(i).reduce((f,p)=>{let[b,_]=p;return _===void 0||(f[b]=_),f},{}),m=t==null||(s=t.compoundVariants)===null||s===void 0?void 0:s.reduce((f,p)=>{let{class:b,className:_,...x}=p;return Object.entries(x).every(y=>{let[S,E]=y;return Array.isArray(E)?E.includes({...o,...h}[S]):{...o,...h}[S]===E})?[...f,b,_]:f},[]);return ry(e,u,m,i?.class,i?.className)},E6=(e,t)=>{const i=new Array(e.length+t.length);for(let s=0;s<e.length;s++)i[s]=e[s];for(let s=0;s<t.length;s++)i[e.length+s]=t[s];return i},C6=(e,t)=>({classGroupId:e,validator:t}),Uk=(e=new Map,t=null,i)=>({nextPart:e,validators:t,classGroupId:i}),lh="-",ay=[],N6="arbitrary..",T6=e=>{const t=M6(e),{conflictingClassGroups:i,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return A6(u);const h=u.split(lh),m=h[0]===""&&h.length>1?1:0;return Hk(h,m,t)},getConflictingClassGroupIds:(u,h)=>{if(h){const m=s[u],f=i[u];return m?f?E6(f,m):m:f||ay}return i[u]||ay}}},Hk=(e,t,i)=>{if(e.length-t===0)return i.classGroupId;const a=e[t],o=i.nextPart.get(a);if(o){const f=Hk(e,t+1,o);if(f)return f}const u=i.validators;if(u===null)return;const h=t===0?e.join(lh):e.slice(t).join(lh),m=u.length;for(let f=0;f<m;f++){const p=u[f];if(p.validator(h))return p.classGroupId}},A6=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),i=t.indexOf(":"),s=t.slice(0,i);return s?N6+s:void 0})(),M6=e=>{const{theme:t,classGroups:i}=e;return R6(i,t)},R6=(e,t)=>{const i=Uk();for(const s in e){const a=e[s];ob(a,i,s,t)}return i},ob=(e,t,i,s)=>{const a=e.length;for(let o=0;o<a;o++){const u=e[o];j6(u,t,i,s)}},j6=(e,t,i,s)=>{if(typeof e=="string"){D6(e,t,i);return}if(typeof e=="function"){O6(e,t,i,s);return}L6(e,t,i,s)},D6=(e,t,i)=>{const s=e===""?t:Fk(t,e);s.classGroupId=i},O6=(e,t,i,s)=>{if(B6(e)){ob(e(s),t,i,s);return}t.validators===null&&(t.validators=[]),t.validators.push(C6(i,e))},L6=(e,t,i,s)=>{const a=Object.entries(e),o=a.length;for(let u=0;u<o;u++){const[h,m]=a[u];ob(m,Fk(t,h),i,s)}},Fk=(e,t)=>{let i=e;const s=t.split(lh),a=s.length;for(let o=0;o<a;o++){const u=s[o];let h=i.nextPart.get(u);h||(h=Uk(),i.nextPart.set(u,h)),i=h}return i},B6=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,z6=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,i=Object.create(null),s=Object.create(null);const a=(o,u)=>{i[o]=u,t++,t>e&&(t=0,s=i,i=Object.create(null))};return{get(o){let u=i[o];if(u!==void 0)return u;if((u=s[o])!==void 0)return a(o,u),u},set(o,u){o in i?i[o]=u:a(o,u)}}},Bg="!",oy=":",I6=[],ly=(e,t,i,s,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:i,maybePostfixModifierPosition:s,isExternal:a}),P6=e=>{const{prefix:t,experimentalParseClassName:i}=e;let s=a=>{const o=[];let u=0,h=0,m=0,f;const p=a.length;for(let S=0;S<p;S++){const E=a[S];if(u===0&&h===0){if(E===oy){o.push(a.slice(m,S)),m=S+1;continue}if(E==="/"){f=S;continue}}E==="["?u++:E==="]"?u--:E==="("?h++:E===")"&&h--}const b=o.length===0?a:a.slice(m);let _=b,x=!1;b.endsWith(Bg)?(_=b.slice(0,-1),x=!0):b.startsWith(Bg)&&(_=b.slice(1),x=!0);const y=f&&f>m?f-m:void 0;return ly(o,x,_,y)};if(t){const a=t+oy,o=s;s=u=>u.startsWith(a)?o(u.slice(a.length)):ly(I6,!1,u,void 0,!0)}if(i){const a=s;s=o=>i({className:o,parseClassName:a})}return s},$6=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((i,s)=>{t.set(i,1e6+s)}),i=>{const s=[];let a=[];for(let o=0;o<i.length;o++){const u=i[o],h=u[0]==="[",m=t.has(u);h||m?(a.length>0&&(a.sort(),s.push(...a),a=[]),s.push(u)):a.push(u)}return a.length>0&&(a.sort(),s.push(...a)),s}},U6=e=>({cache:z6(e.cacheSize),parseClassName:P6(e),sortModifiers:$6(e),postfixLookupClassGroupIds:H6(e),...T6(e)}),H6=e=>{const t=Object.create(null),i=e.postfixLookupClassGroups;if(i)for(let s=0;s<i.length;s++)t[i[s]]=!0;return t},F6=/\s+/,V6=(e,t)=>{const{parseClassName:i,getClassGroupId:s,getConflictingClassGroupIds:a,sortModifiers:o,postfixLookupClassGroupIds:u}=t,h=[],m=e.trim().split(F6);let f="";for(let p=m.length-1;p>=0;p-=1){const b=m[p],{isExternal:_,modifiers:x,hasImportantModifier:y,baseClassName:S,maybePostfixModifierPosition:E}=i(b);if(_){f=b+(f.length>0?" "+f:f);continue}let C=!!E,A;if(C){const L=S.substring(0,E);A=s(L);const R=A&&u[A]?s(S):void 0;R&&R!==A&&(A=R,C=!1)}else A=s(S);if(!A){if(!C){f=b+(f.length>0?" "+f:f);continue}if(A=s(S),!A){f=b+(f.length>0?" "+f:f);continue}C=!1}const N=x.length===0?"":x.length===1?x[0]:o(x).join(":"),M=y?N+Bg:N,D=M+A;if(h.indexOf(D)>-1)continue;h.push(D);const U=a(A,C);for(let L=0;L<U.length;++L){const R=U[L];h.push(M+R)}f=b+(f.length>0?" "+f:f)}return f},q6=(...e)=>{let t=0,i,s,a="";for(;t<e.length;)(i=e[t++])&&(s=Vk(i))&&(a&&(a+=" "),a+=s);return a},Vk=e=>{if(typeof e=="string")return e;let t,i="";for(let s=0;s<e.length;s++)e[s]&&(t=Vk(e[s]))&&(i&&(i+=" "),i+=t);return i},K6=(e,...t)=>{let i,s,a,o;const u=m=>{const f=t.reduce((p,b)=>b(p),e());return i=U6(f),s=i.cache.get,a=i.cache.set,o=h,h(m)},h=m=>{const f=s(m);if(f)return f;const p=V6(m,i);return a(m,p),p};return o=u,(...m)=>o(q6(...m))},G6=[],ui=e=>{const t=i=>i[e]||G6;return t.isThemeGetter=!0,t},qk=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Kk=/^\((?:(\w[\w-]*):)?(.+)\)$/i,W6=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Y6=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,X6=/\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$/,Z6=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Q6=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,J6=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Vr=e=>W6.test(e),We=e=>!!e&&!Number.isNaN(Number(e)),gs=e=>!!e&&Number.isInteger(Number(e)),dp=e=>e.endsWith("%")&&We(e.slice(0,-1)),rr=e=>Y6.test(e),Gk=()=>!0,eR=e=>X6.test(e)&&!Z6.test(e),lb=()=>!1,tR=e=>Q6.test(e),iR=e=>J6.test(e),nR=e=>!Ee(e)&&!Ce(e),sR=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)),rR=e=>ra(e,Xk,lb),Ee=e=>qk.test(e),Ta=e=>ra(e,Zk,eR),cy=e=>ra(e,fR,We),aR=e=>ra(e,Jk,Gk),oR=e=>ra(e,Qk,lb),uy=e=>ra(e,Wk,lb),lR=e=>ra(e,Yk,iR),Cd=e=>ra(e,eE,tR),Ce=e=>Kk.test(e),uc=e=>Ya(e,Zk),cR=e=>Ya(e,Qk),dy=e=>Ya(e,Wk),uR=e=>Ya(e,Xk),dR=e=>Ya(e,Yk),Nd=e=>Ya(e,eE,!0),hR=e=>Ya(e,Jk,!0),ra=(e,t,i)=>{const s=qk.exec(e);return s?s[1]?t(s[1]):i(s[2]):!1},Ya=(e,t,i=!1)=>{const s=Kk.exec(e);return s?s[1]?t(s[1]):i:!1},Wk=e=>e==="position"||e==="percentage",Yk=e=>e==="image"||e==="url",Xk=e=>e==="length"||e==="size"||e==="bg-size",Zk=e=>e==="length",fR=e=>e==="number",Qk=e=>e==="family-name",Jk=e=>e==="number"||e==="weight",eE=e=>e==="shadow",mR=()=>{const e=ui("color"),t=ui("font"),i=ui("text"),s=ui("font-weight"),a=ui("tracking"),o=ui("leading"),u=ui("breakpoint"),h=ui("container"),m=ui("spacing"),f=ui("radius"),p=ui("shadow"),b=ui("inset-shadow"),_=ui("text-shadow"),x=ui("drop-shadow"),y=ui("blur"),S=ui("perspective"),E=ui("aspect"),C=ui("ease"),A=ui("animate"),N=()=>["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"],D=()=>[...M(),Ce,Ee],U=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto","contain","none"],R=()=>[Ce,Ee,m],$=()=>[Vr,"full","auto",...R()],I=()=>[gs,"none","subgrid",Ce,Ee],F=()=>["auto",{span:["full",gs,Ce,Ee]},gs,Ce,Ee],G=()=>[gs,"auto",Ce,Ee],Y=()=>["auto","min","max","fr",Ce,Ee],Q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],O=()=>["auto",...R()],X=()=>[Vr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],Z=()=>[Vr,"screen","full","dvw","lvw","svw","min","max","fit",...R()],V=()=>[Vr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...R()],P=()=>[e,Ce,Ee],j=()=>[...M(),dy,uy,{position:[Ce,Ee]}],W=()=>["no-repeat",{repeat:["","x","y","space","round"]}],he=()=>["auto","cover","contain",uR,rR,{size:[Ce,Ee]}],oe=()=>[dp,uc,Ta],me=()=>["","none","full",f,Ce,Ee],ne=()=>["",We,uc,Ta],fe=()=>["solid","dashed","dotted","double"],we=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ye=()=>[We,dp,dy,uy],Ze=()=>["","none",y,Ce,Ee],ot=()=>["none",We,Ce,Ee],lt=()=>["none",We,Ce,Ee],Be=()=>[We,Ce,Ee],Lt=()=>[Vr,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[rr],breakpoint:[rr],color:[Gk],container:[rr],"drop-shadow":[rr],ease:["in","out","in-out"],font:[nR],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[rr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[rr],shadow:[rr],spacing:["px",We],text:[rr],"text-shadow":[rr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Vr,Ee,Ce,E]}],container:["container"],"container-type":[{"@container":["","normal","size",Ce,Ee]}],"container-named":[sR],columns:[{columns:[We,Ee,Ce,h]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"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:D()}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:$()}],"inset-x":[{"inset-x":$()}],"inset-y":[{"inset-y":$()}],start:[{"inset-s":$(),start:$()}],end:[{"inset-e":$(),end:$()}],"inset-bs":[{"inset-bs":$()}],"inset-be":[{"inset-be":$()}],top:[{top:$()}],right:[{right:$()}],bottom:[{bottom:$()}],left:[{left:$()}],visibility:["visible","invisible","collapse"],z:[{z:[gs,"auto",Ce,Ee]}],basis:[{basis:[Vr,"full","auto",h,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[We,Vr,"auto","initial","none",Ee]}],grow:[{grow:["",We,Ce,Ee]}],shrink:[{shrink:["",We,Ce,Ee]}],order:[{order:[gs,"first","last","none",Ce,Ee]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:F()}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:F()}],"row-start":[{"row-start":G()}],"row-end":[{"row-end":G()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Y()}],"auto-rows":[{"auto-rows":Y()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...Q(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...Q()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":Q()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pbs:[{pbs:R()}],pbe:[{pbe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:O()}],mx:[{mx:O()}],my:[{my:O()}],ms:[{ms:O()}],me:[{me:O()}],mbs:[{mbs:O()}],mbe:[{mbe:O()}],mt:[{mt:O()}],mr:[{mr:O()}],mb:[{mb:O()}],ml:[{ml:O()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],"inline-size":[{inline:["auto",...Z()]}],"min-inline-size":[{"min-inline":["auto",...Z()]}],"max-inline-size":[{"max-inline":["none",...Z()]}],"block-size":[{block:["auto",...V()]}],"min-block-size":[{"min-block":["auto",...V()]}],"max-block-size":[{"max-block":["none",...V()]}],w:[{w:[h,"screen",...X()]}],"min-w":[{"min-w":[h,"screen","none",...X()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[u]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",i,uc,Ta]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,hR,aR]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",dp,Ee]}],"font-family":[{font:[cR,oR,t]}],"font-features":[{"font-features":[Ee]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,Ce,Ee]}],"line-clamp":[{"line-clamp":[We,"none",Ce,cy]}],leading:[{leading:[o,...R()]}],"list-image":[{"list-image":["none",Ce,Ee]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ce,Ee]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...fe(),"wavy"]}],"text-decoration-thickness":[{decoration:[We,"from-font","auto",Ce,Ta]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[We,"auto",Ce,Ee]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"tab-size":[{tab:[gs,Ce,Ee]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ce,Ee]}],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",Ce,Ee]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:j()}],"bg-repeat":[{bg:W()}],"bg-size":[{bg:he()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},gs,Ce,Ee],radial:["",Ce,Ee],conic:[gs,Ce,Ee]},dR,lR]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:oe()}],"gradient-via-pos":[{via:oe()}],"gradient-to-pos":[{to:oe()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:me()}],"rounded-s":[{"rounded-s":me()}],"rounded-e":[{"rounded-e":me()}],"rounded-t":[{"rounded-t":me()}],"rounded-r":[{"rounded-r":me()}],"rounded-b":[{"rounded-b":me()}],"rounded-l":[{"rounded-l":me()}],"rounded-ss":[{"rounded-ss":me()}],"rounded-se":[{"rounded-se":me()}],"rounded-ee":[{"rounded-ee":me()}],"rounded-es":[{"rounded-es":me()}],"rounded-tl":[{"rounded-tl":me()}],"rounded-tr":[{"rounded-tr":me()}],"rounded-br":[{"rounded-br":me()}],"rounded-bl":[{"rounded-bl":me()}],"border-w":[{border:ne()}],"border-w-x":[{"border-x":ne()}],"border-w-y":[{"border-y":ne()}],"border-w-s":[{"border-s":ne()}],"border-w-e":[{"border-e":ne()}],"border-w-bs":[{"border-bs":ne()}],"border-w-be":[{"border-be":ne()}],"border-w-t":[{"border-t":ne()}],"border-w-r":[{"border-r":ne()}],"border-w-b":[{"border-b":ne()}],"border-w-l":[{"border-l":ne()}],"divide-x":[{"divide-x":ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ne()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...fe(),"hidden","none"]}],"divide-style":[{divide:[...fe(),"hidden","none"]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-bs":[{"border-bs":P()}],"border-color-be":[{"border-be":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...fe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[We,Ce,Ee]}],"outline-w":[{outline:["",We,uc,Ta]}],"outline-color":[{outline:P()}],shadow:[{shadow:["","none",p,Nd,Cd]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":["none",b,Nd,Cd]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[We,Ta]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":["none",_,Nd,Cd]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[We,Ce,Ee]}],"mix-blend":[{"mix-blend":[...we(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":we()}],"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":[We]}],"mask-image-linear-from-pos":[{"mask-linear-from":ye()}],"mask-image-linear-to-pos":[{"mask-linear-to":ye()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":ye()}],"mask-image-t-to-pos":[{"mask-t-to":ye()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":ye()}],"mask-image-r-to-pos":[{"mask-r-to":ye()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":ye()}],"mask-image-b-to-pos":[{"mask-b-to":ye()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":ye()}],"mask-image-l-to-pos":[{"mask-l-to":ye()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":ye()}],"mask-image-x-to-pos":[{"mask-x-to":ye()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":ye()}],"mask-image-y-to-pos":[{"mask-y-to":ye()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[Ce,Ee]}],"mask-image-radial-from-pos":[{"mask-radial-from":ye()}],"mask-image-radial-to-pos":[{"mask-radial-to":ye()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"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":[We]}],"mask-image-conic-from-pos":[{"mask-conic-from":ye()}],"mask-image-conic-to-pos":[{"mask-conic-to":ye()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:j()}],"mask-repeat":[{mask:W()}],"mask-size":[{mask:he()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ce,Ee]}],filter:[{filter:["","none",Ce,Ee]}],blur:[{blur:Ze()}],brightness:[{brightness:[We,Ce,Ee]}],contrast:[{contrast:[We,Ce,Ee]}],"drop-shadow":[{"drop-shadow":["","none",x,Nd,Cd]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:["",We,Ce,Ee]}],"hue-rotate":[{"hue-rotate":[We,Ce,Ee]}],invert:[{invert:["",We,Ce,Ee]}],saturate:[{saturate:[We,Ce,Ee]}],sepia:[{sepia:["",We,Ce,Ee]}],"backdrop-filter":[{"backdrop-filter":["","none",Ce,Ee]}],"backdrop-blur":[{"backdrop-blur":Ze()}],"backdrop-brightness":[{"backdrop-brightness":[We,Ce,Ee]}],"backdrop-contrast":[{"backdrop-contrast":[We,Ce,Ee]}],"backdrop-grayscale":[{"backdrop-grayscale":["",We,Ce,Ee]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[We,Ce,Ee]}],"backdrop-invert":[{"backdrop-invert":["",We,Ce,Ee]}],"backdrop-opacity":[{"backdrop-opacity":[We,Ce,Ee]}],"backdrop-saturate":[{"backdrop-saturate":[We,Ce,Ee]}],"backdrop-sepia":[{"backdrop-sepia":["",We,Ce,Ee]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ce,Ee]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[We,"initial",Ce,Ee]}],ease:[{ease:["linear","initial",C,Ce,Ee]}],delay:[{delay:[We,Ce,Ee]}],animate:[{animate:["none",A,Ce,Ee]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Ce,Ee]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:ot()}],"rotate-x":[{"rotate-x":ot()}],"rotate-y":[{"rotate-y":ot()}],"rotate-z":[{"rotate-z":ot()}],scale:[{scale:lt()}],"scale-x":[{"scale-x":lt()}],"scale-y":[{"scale-y":lt()}],"scale-z":[{"scale-z":lt()}],"scale-3d":["scale-3d"],skew:[{skew:Be()}],"skew-x":[{"skew-x":Be()}],"skew-y":[{"skew-y":Be()}],transform:[{transform:[Ce,Ee,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Lt()}],"translate-x":[{"translate-x":Lt()}],"translate-y":[{"translate-y":Lt()}],"translate-z":[{"translate-z":Lt()}],"translate-none":["translate-none"],zoom:[{zoom:[gs,Ce,Ee]}],accent:[{accent:P()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:P()}],"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",Ce,Ee]}],"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":P()}],"scrollbar-track-color":[{"scrollbar-track":P()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mbs":[{"scroll-mbs":R()}],"scroll-mbe":[{"scroll-mbe":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pbs":[{"scroll-pbs":R()}],"scroll-pbe":[{"scroll-pbe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"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",Ce,Ee]}],fill:[{fill:["none",...P()]}],"stroke-w":[{stroke:[We,uc,Ta,cy]}],stroke:[{stroke:["none",...P()]}],"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"]}},pR=K6(mR);function de(...e){return pR(Pc(e))}const gR=$k("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 ue({className:e,variant:t,size:i,...s}){return c.jsx("button",{className:de(gR({variant:t,size:i,className:e})),...s})}const tE=k.createContext({});function bR(e){const t=k.useRef(null);return t.current===null&&(t.current=e()),t.current}const vR=typeof window<"u",_R=vR?k.useLayoutEffect:k.useEffect,cb=k.createContext(null);function ub(e,t){e.indexOf(t)===-1&&e.push(t)}function ch(e,t){const i=e.indexOf(t);i>-1&&e.splice(i,1)}const Ns=(e,t,i)=>i>t?t:i<e?e:i;let db=()=>{};const ta={},iE=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function nE(e){return typeof e=="object"&&e!==null}const sE=e=>/^0[^.\s]+$/u.test(e);function rE(e){let t;return()=>(t===void 0&&(t=e()),t)}const Kn=e=>e,xR=(e,t)=>i=>t(e(i)),Jc=(...e)=>e.reduce(xR),$c=(e,t,i)=>{const s=t-e;return s===0?1:(i-e)/s};class hb{constructor(){this.subscriptions=[]}add(t){return ub(this.subscriptions,t),()=>ch(this.subscriptions,t)}notify(t,i,s){const a=this.subscriptions.length;if(a)if(a===1)this.subscriptions[0](t,i,s);else for(let o=0;o<a;o++){const u=this.subscriptions[o];u&&u(t,i,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const An=e=>e*1e3,qn=e=>e/1e3;function aE(e,t){return t?e*(1e3/t):0}const oE=(e,t,i)=>(((1-3*i+3*t)*e+(3*i-6*t))*e+3*t)*e,yR=1e-7,SR=12;function wR(e,t,i,s,a){let o,u,h=0;do u=t+(i-t)/2,o=oE(u,s,a)-e,o>0?i=u:t=u;while(Math.abs(o)>yR&&++h<SR);return u}function eu(e,t,i,s){if(e===t&&i===s)return Kn;const a=o=>wR(o,0,1,e,i);return o=>o===0||o===1?o:oE(a(o),t,s)}const lE=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,cE=e=>t=>1-e(1-t),uE=eu(.33,1.53,.69,.99),fb=cE(uE),dE=lE(fb),hE=e=>e>=1?1:(e*=2)<1?.5*fb(e):.5*(2-Math.pow(2,-10*(e-1))),mb=e=>1-Math.sin(Math.acos(e)),fE=cE(mb),mE=lE(mb),kR=eu(.42,0,1,1),ER=eu(0,0,.58,1),pE=eu(.42,0,.58,1),CR=e=>Array.isArray(e)&&typeof e[0]!="number",gE=e=>Array.isArray(e)&&typeof e[0]=="number",NR={linear:Kn,easeIn:kR,easeInOut:pE,easeOut:ER,circIn:mb,circInOut:mE,circOut:fE,backIn:fb,backInOut:dE,backOut:uE,anticipate:hE},TR=e=>typeof e=="string",hy=e=>{if(gE(e)){db(e.length===4);const[t,i,s,a]=e;return eu(t,i,s,a)}else if(TR(e))return NR[e];return e},Td=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function AR(e,t){let i=new Set,s=new Set,a=!1,o=!1;const u=new WeakSet;let h={delta:0,timestamp:0,isProcessing:!1};function m(p){u.has(p)&&(f.schedule(p),e()),p(h)}const f={schedule:(p,b=!1,_=!1)=>{const y=_&&a?i:s;return b&&u.add(p),y.add(p),p},cancel:p=>{s.delete(p),u.delete(p)},process:p=>{if(h=p,a){o=!0;return}a=!0;const b=i;i=s,s=b,i.forEach(m),i.clear(),a=!1,o&&(o=!1,f.process(p))}};return f}const MR=40;function bE(e,t){let i=!1,s=!0;const a={delta:0,timestamp:0,isProcessing:!1},o=()=>i=!0,u=Td.reduce((N,M)=>(N[M]=AR(o),N),{}),{setup:h,read:m,resolveKeyframes:f,preUpdate:p,update:b,preRender:_,render:x,postRender:y}=u,S=()=>{const N=ta.useManualTiming,M=N?a.timestamp:performance.now();i=!1,N||(a.delta=s?1e3/60:Math.max(Math.min(M-a.timestamp,MR),1)),a.timestamp=M,a.isProcessing=!0,h.process(a),m.process(a),f.process(a),p.process(a),b.process(a),_.process(a),x.process(a),y.process(a),a.isProcessing=!1,i&&t&&(s=!1,e(S))},E=()=>{i=!0,s=!0,a.isProcessing||e(S)};return{schedule:Td.reduce((N,M)=>{const D=u[M];return N[M]=(U,L=!1,R=!1)=>(i||E(),D.schedule(U,L,R)),N},{}),cancel:N=>{for(let M=0;M<Td.length;M++)u[Td[M]].cancel(N)},state:a,steps:u}}const{schedule:Et,cancel:ia,state:Mi,steps:hp}=bE(typeof requestAnimationFrame<"u"?requestAnimationFrame:Kn,!0);let Gd;function RR(){Gd=void 0}const Zi={now:()=>(Gd===void 0&&Zi.set(Mi.isProcessing||ta.useManualTiming?Mi.timestamp:performance.now()),Gd),set:e=>{Gd=e,queueMicrotask(RR)}},vE=e=>t=>typeof t=="string"&&t.startsWith(e),_E=vE("--"),jR=vE("var(--"),pb=e=>jR(e)?DR.test(e.split("/*")[0].trim()):!1,DR=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function fy(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const al={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Uc={...al,transform:e=>Ns(0,1,e)},Ad={...al,default:1},Rc=e=>Math.round(e*1e5)/1e5,gb=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function OR(e){return e==null}const LR=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,bb=(e,t)=>i=>!!(typeof i=="string"&&LR.test(i)&&i.startsWith(e)||t&&!OR(i)&&Object.prototype.hasOwnProperty.call(i,t)),xE=(e,t,i)=>s=>{if(typeof s!="string")return s;const[a,o,u,h]=s.match(gb);return{[e]:parseFloat(a),[t]:parseFloat(o),[i]:parseFloat(u),alpha:h!==void 0?parseFloat(h):1}},BR=e=>Ns(0,255,e),fp={...al,transform:e=>Math.round(BR(e))},Ba={test:bb("rgb","red"),parse:xE("red","green","blue"),transform:({red:e,green:t,blue:i,alpha:s=1})=>"rgba("+fp.transform(e)+", "+fp.transform(t)+", "+fp.transform(i)+", "+Rc(Uc.transform(s))+")"};function zR(e){let t="",i="",s="",a="";return e.length>5?(t=e.substring(1,3),i=e.substring(3,5),s=e.substring(5,7),a=e.substring(7,9)):(t=e.substring(1,2),i=e.substring(2,3),s=e.substring(3,4),a=e.substring(4,5),t+=t,i+=i,s+=s,a+=a),{red:parseInt(t,16),green:parseInt(i,16),blue:parseInt(s,16),alpha:a?parseInt(a,16)/255:1}}const zg={test:bb("#"),parse:zR,transform:Ba.transform},tu=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Yr=tu("deg"),ks=tu("%"),Te=tu("px"),IR=tu("vh"),PR=tu("vw"),my={...ks,parse:e=>ks.parse(e)/100,transform:e=>ks.transform(e*100)},Ko={test:bb("hsl","hue"),parse:xE("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:i,alpha:s=1})=>"hsla("+Math.round(e)+", "+ks.transform(Rc(t))+", "+ks.transform(Rc(i))+", "+Rc(Uc.transform(s))+")"},si={test:e=>Ba.test(e)||zg.test(e)||Ko.test(e),parse:e=>Ba.test(e)?Ba.parse(e):Ko.test(e)?Ko.parse(e):zg.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ba.transform(e):Ko.transform(e),getAnimatableNone:e=>{const t=si.parse(e);return t.alpha=0,si.transform(t)}},$R=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function UR(e){return isNaN(e)&&typeof e=="string"&&(e.match(gb)?.length||0)+(e.match($R)?.length||0)>0}const yE="number",SE="color",HR="var",FR="var(",py="${}",VR=/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 Jo(e){const t=e.toString(),i=[],s={color:[],number:[],var:[]},a=[];let o=0;const h=t.replace(VR,m=>(si.test(m)?(s.color.push(o),a.push(SE),i.push(si.parse(m))):m.startsWith(FR)?(s.var.push(o),a.push(HR),i.push(m)):(s.number.push(o),a.push(yE),i.push(parseFloat(m))),++o,py)).split(py);return{values:i,split:h,indexes:s,types:a}}function qR(e){return Jo(e).values}function wE({split:e,types:t}){const i=e.length;return s=>{let a="";for(let o=0;o<i;o++)if(a+=e[o],s[o]!==void 0){const u=t[o];u===yE?a+=Rc(s[o]):u===SE?a+=si.transform(s[o]):a+=s[o]}return a}}function KR(e){return wE(Jo(e))}const GR=e=>typeof e=="number"?0:si.test(e)?si.getAnimatableNone(e):e,WR=(e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:GR(e);function YR(e){const t=Jo(e);return wE(t)(t.values.map((s,a)=>WR(s,t.split[a])))}const ls={test:UR,parse:qR,createTransformer:KR,getAnimatableNone:YR};function mp(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+(t-e)*6*i:i<1/2?t:i<2/3?e+(t-e)*(2/3-i)*6:e}function XR({hue:e,saturation:t,lightness:i,alpha:s}){e/=360,t/=100,i/=100;let a=0,o=0,u=0;if(!t)a=o=u=i;else{const h=i<.5?i*(1+t):i+t-i*t,m=2*i-h;a=mp(m,h,e+1/3),o=mp(m,h,e),u=mp(m,h,e-1/3)}return{red:Math.round(a*255),green:Math.round(o*255),blue:Math.round(u*255),alpha:s}}function uh(e,t){return i=>i>0?t:e}const Rt=(e,t,i)=>e+(t-e)*i,pp=(e,t,i)=>{const s=e*e,a=i*(t*t-s)+s;return a<0?0:Math.sqrt(a)},ZR=[zg,Ba,Ko],QR=e=>ZR.find(t=>t.test(e));function gy(e){const t=QR(e);if(!t)return!1;let i=t.parse(e);return t===Ko&&(i=XR(i)),i}const by=(e,t)=>{const i=gy(e),s=gy(t);if(!i||!s)return uh(e,t);const a={...i};return o=>(a.red=pp(i.red,s.red,o),a.green=pp(i.green,s.green,o),a.blue=pp(i.blue,s.blue,o),a.alpha=Rt(i.alpha,s.alpha,o),Ba.transform(a))},Ig=new Set(["none","hidden"]);function JR(e,t){return Ig.has(e)?i=>i<=0?e:t:i=>i>=1?t:e}function ej(e,t){return i=>Rt(e,t,i)}function vb(e){return typeof e=="number"?ej:typeof e=="string"?pb(e)?uh:si.test(e)?by:nj:Array.isArray(e)?kE:typeof e=="object"?si.test(e)?by:tj:uh}function kE(e,t){const i=[...e],s=i.length,a=e.map((o,u)=>vb(o)(o,t[u]));return o=>{for(let u=0;u<s;u++)i[u]=a[u](o);return i}}function tj(e,t){const i={...e,...t},s={};for(const a in i)e[a]!==void 0&&t[a]!==void 0&&(s[a]=vb(e[a])(e[a],t[a]));return a=>{for(const o in s)i[o]=s[o](a);return i}}function ij(e,t){const i=[],s={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const o=t.types[a],u=e.indexes[o][s[o]],h=e.values[u]??0;i[a]=h,s[o]++}return i}const nj=(e,t)=>{const i=ls.createTransformer(t),s=Jo(e),a=Jo(t);return s.indexes.var.length===a.indexes.var.length&&s.indexes.color.length===a.indexes.color.length&&s.indexes.number.length>=a.indexes.number.length?Ig.has(e)&&!a.values.length||Ig.has(t)&&!s.values.length?JR(e,t):Jc(kE(ij(s,a),a.values),i):uh(e,t)};function EE(e,t,i){return typeof e=="number"&&typeof t=="number"&&typeof i=="number"?Rt(e,t,i):vb(e)(e,t)}const sj=e=>{const t=({timestamp:i})=>e(i);return{start:(i=!0)=>Et.update(t,i),stop:()=>ia(t),now:()=>Mi.isProcessing?Mi.timestamp:Zi.now()}},CE=(e,t,i=10)=>{let s="";const a=Math.max(Math.round(t/i),2);for(let o=0;o<a;o++)s+=Math.round(e(o/(a-1))*1e4)/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},dh=2e4;function _b(e){let t=0;const i=50;let s=e.next(t);for(;!s.done&&t<dh;)t+=i,s=e.next(t);return t>=dh?1/0:t}function rj(e,t=100,i){const s=i({...e,keyframes:[0,t]}),a=Math.min(_b(s),dh);return{type:"keyframes",ease:o=>s.next(a*o).value/t,duration:qn(a)}}const Ht={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 Pg(e,t){return e*Math.sqrt(1-t*t)}const aj=12;function oj(e,t,i){let s=i;for(let a=1;a<aj;a++)s=s-e(s)/t(s);return s}const gp=.001;function lj({duration:e=Ht.duration,bounce:t=Ht.bounce,velocity:i=Ht.velocity,mass:s=Ht.mass}){let a,o,u=1-t;u=Ns(Ht.minDamping,Ht.maxDamping,u),e=Ns(Ht.minDuration,Ht.maxDuration,qn(e)),u<1?(a=f=>{const p=f*u,b=p*e,_=p-i,x=Pg(f,u),y=Math.exp(-b);return gp-_/x*y},o=f=>{const b=f*u*e,_=b*i+i,x=Math.pow(u,2)*Math.pow(f,2)*e,y=Math.exp(-b),S=Pg(Math.pow(f,2),u);return(-a(f)+gp>0?-1:1)*((_-x)*y)/S}):(a=f=>{const p=Math.exp(-f*e),b=(f-i)*e+1;return-gp+p*b},o=f=>{const p=Math.exp(-f*e),b=(i-f)*(e*e);return p*b});const h=5/e,m=oj(a,o,h);if(e=An(e),isNaN(m))return{stiffness:Ht.stiffness,damping:Ht.damping,duration:e};{const f=Math.pow(m,2)*s;return{stiffness:f,damping:u*2*Math.sqrt(s*f),duration:e}}}const cj=["duration","bounce"],uj=["stiffness","damping","mass"];function vy(e,t){return t.some(i=>e[i]!==void 0)}function dj(e){let t={velocity:Ht.velocity,stiffness:Ht.stiffness,damping:Ht.damping,mass:Ht.mass,isResolvedFromDuration:!1,...e};if(!vy(e,uj)&&vy(e,cj))if(t.velocity=0,e.visualDuration){const i=e.visualDuration,s=2*Math.PI/(i*1.2),a=s*s,o=2*Ns(.05,1,1-(e.bounce||0))*Math.sqrt(a);t={...t,mass:Ht.mass,stiffness:a,damping:o}}else{const i=lj({...e,velocity:0});t={...t,...i,mass:Ht.mass},t.isResolvedFromDuration=!0}return t}function hh(e=Ht.visualDuration,t=Ht.bounce){const i=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:s,restDelta:a}=i;const o=i.keyframes[0],u=i.keyframes[i.keyframes.length-1],h={done:!1,value:o},{stiffness:m,damping:f,mass:p,duration:b,velocity:_,isResolvedFromDuration:x}=dj({...i,velocity:-qn(i.velocity||0)}),y=_||0,S=f/(2*Math.sqrt(m*p)),E=u-o,C=qn(Math.sqrt(m/p)),A=Math.abs(E)<5;s||(s=A?Ht.restSpeed.granular:Ht.restSpeed.default),a||(a=A?Ht.restDelta.granular:Ht.restDelta.default);let N,M,D,U,L,R;if(S<1)D=Pg(C,S),U=(y+S*C*E)/D,N=I=>{const F=Math.exp(-S*C*I);return u-F*(U*Math.sin(D*I)+E*Math.cos(D*I))},L=S*C*U+E*D,R=S*C*E-U*D,M=I=>Math.exp(-S*C*I)*(L*Math.sin(D*I)+R*Math.cos(D*I));else if(S===1){N=F=>u-Math.exp(-C*F)*(E+(y+C*E)*F);const I=y+C*E;M=F=>Math.exp(-C*F)*(C*I*F-y)}else{const I=C*Math.sqrt(S*S-1);N=Q=>{const q=Math.exp(-S*C*Q),O=Math.min(I*Q,300);return u-q*((y+S*C*E)*Math.sinh(O)+I*E*Math.cosh(O))/I};const F=(y+S*C*E)/I,G=S*C*F-E*I,Y=S*C*E-F*I;M=Q=>{const q=Math.exp(-S*C*Q),O=Math.min(I*Q,300);return q*(G*Math.sinh(O)+Y*Math.cosh(O))}}const $={calculatedDuration:x&&b||null,velocity:I=>An(M(I)),next:I=>{if(!x&&S<1){const G=Math.exp(-S*C*I),Y=Math.sin(D*I),Q=Math.cos(D*I),q=u-G*(U*Y+E*Q),O=An(G*(L*Y+R*Q));return h.done=Math.abs(O)<=s&&Math.abs(u-q)<=a,h.value=h.done?u:q,h}const F=N(I);if(x)h.done=I>=b;else{const G=An(M(I));h.done=Math.abs(G)<=s&&Math.abs(u-F)<=a}return h.value=h.done?u:F,h},toString:()=>{const I=Math.min(_b($),dh),F=CE(G=>$.next(I*G).value,I,30);return I+"ms "+F},toTransition:()=>{}};return $}hh.applyToOptions=e=>{const t=rj(e,100,hh);return e.ease=t.ease,e.duration=An(t.duration),e.type="keyframes",e};const hj=5;function NE(e,t,i){const s=Math.max(t-hj,0);return aE(i-e(s),t-s)}function $g({keyframes:e,velocity:t=0,power:i=.8,timeConstant:s=325,bounceDamping:a=10,bounceStiffness:o=500,modifyTarget:u,min:h,max:m,restDelta:f=.5,restSpeed:p}){const b=e[0],_={done:!1,value:b},x=R=>h!==void 0&&R<h||m!==void 0&&R>m,y=R=>h===void 0?m:m===void 0||Math.abs(h-R)<Math.abs(m-R)?h:m;let S=i*t;const E=b+S,C=u===void 0?E:u(E);C!==E&&(S=C-b);const A=R=>-S*Math.exp(-R/s),N=R=>C+A(R),M=R=>{const $=A(R),I=N(R);_.done=Math.abs($)<=f,_.value=_.done?C:I};let D,U;const L=R=>{x(_.value)&&(D=R,U=hh({keyframes:[_.value,y(_.value)],velocity:NE(N,R,_.value),damping:a,stiffness:o,restDelta:f,restSpeed:p}))};return L(0),{calculatedDuration:null,next:R=>{let $=!1;return!U&&D===void 0&&($=!0,M(R),L(R)),D!==void 0&&R>=D?U.next(R-D):(!$&&M(R),_)}}}function fj(e,t,i){const s=[],a=i||ta.mix||EE,o=e.length-1;for(let u=0;u<o;u++){let h=a(e[u],e[u+1]);if(t){const m=Array.isArray(t)?t[u]||Kn:t;h=Jc(m,h)}s.push(h)}return s}function mj(e,t,{clamp:i=!0,ease:s,mixer:a}={}){const o=e.length;if(db(o===t.length),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const u=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const h=fj(t,s,a),m=h.length,f=p=>{if(u&&p<e[0])return t[0];let b=0;if(m>1)for(;b<e.length-2&&!(p<e[b+1]);b++);const _=$c(e[b],e[b+1],p);return h[b](_)};return i?p=>f(Ns(e[0],e[o-1],p)):f}function pj(e,t){const i=e[e.length-1];for(let s=1;s<=t;s++){const a=$c(0,t,s);e.push(Rt(i,1,a))}}function gj(e){const t=[0];return pj(t,e.length-1),t}function bj(e,t){return e.map(i=>i*t)}function vj(e,t){return e.map(()=>t||pE).splice(0,e.length-1)}function jc({duration:e=300,keyframes:t,times:i,ease:s="easeInOut"}){const a=CR(s)?s.map(hy):hy(s),o={done:!1,value:t[0]},u=bj(i&&i.length===t.length?i:gj(t),e),h=mj(u,t,{ease:Array.isArray(a)?a:vj(t,a)});return{calculatedDuration:e,next:m=>(o.value=h(m),o.done=m>=e,o)}}const _j=e=>e!==null;function Vh(e,{repeat:t,repeatType:i="loop"},s,a=1){const o=e.filter(_j),h=a<0||t&&i!=="loop"&&t%2===1?0:o.length-1;return!h||s===void 0?o[h]:s}const xj={decay:$g,inertia:$g,tween:jc,keyframes:jc,spring:hh};function TE(e){typeof e.type=="string"&&(e.type=xj[e.type])}class xb{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,i){return this.finished.then(t,i)}}const yj=e=>e/100;class fh extends xb{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:i}=this.options;i&&i.updatedAt!==Zi.now()&&this.tick(Zi.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;TE(t);const{type:i=jc,repeat:s=0,repeatDelay:a=0,repeatType:o,velocity:u=0}=t;let{keyframes:h}=t;const m=i||jc;m!==jc&&typeof h[0]!="number"&&(this.mixKeyframes=Jc(yj,EE(h[0],h[1])),h=[0,100]);const f=m({...t,keyframes:h});o==="mirror"&&(this.mirroredGenerator=m({...t,keyframes:[...h].reverse(),velocity:-u})),f.calculatedDuration===null&&(f.calculatedDuration=_b(f));const{calculatedDuration:p}=f;this.calculatedDuration=p,this.resolvedDuration=p+a,this.totalDuration=this.resolvedDuration*(s+1)-a,this.generator=f}updateTime(t){const i=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=i}tick(t,i=!1){const{generator:s,totalDuration:a,mixKeyframes:o,mirroredGenerator:u,resolvedDuration:h,calculatedDuration:m}=this;if(this.startTime===null)return s.next(0);const{delay:f=0,keyframes:p,repeat:b,repeatType:_,repeatDelay:x,type:y,onUpdate:S,finalKeyframe:E}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-a/this.speed,this.startTime)),i?this.currentTime=t:this.updateTime(t);const C=this.currentTime-f*(this.playbackSpeed>=0?1:-1),A=this.playbackSpeed>=0?C<0:C>a;this.currentTime=Math.max(C,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=a);let N=this.currentTime,M=s;if(b){const R=Math.min(this.currentTime,a)/h;let $=Math.floor(R),I=R%1;!I&&R>=1&&(I=1),I===1&&$--,$=Math.min($,b+1),$%2&&(_==="reverse"?(I=1-I,x&&(I-=x/h)):_==="mirror"&&(M=u)),N=Ns(0,1,I)*h}let D;A?(this.delayState.value=p[0],D=this.delayState):D=M.next(N),o&&!A&&(D.value=o(D.value));let{done:U}=D;!A&&m!==null&&(U=this.playbackSpeed>=0?this.currentTime>=a:this.currentTime<=0);const L=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&U);return L&&y!==$g&&(D.value=Vh(p,this.options,E,this.speed)),S&&S(D.value),L&&this.finish(),D}then(t,i){return this.finished.then(t,i)}get duration(){return qn(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+qn(t)}get time(){return qn(this.currentTime)}set time(t){t=An(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 i=this.generator.next(t).value;return NE(s=>this.generator.next(s).value,t,i)}get speed(){return this.playbackSpeed}set speed(t){const i=this.playbackSpeed!==t;i&&this.driver&&this.updateTime(Zi.now()),this.playbackSpeed=t,i&&this.driver&&(this.time=qn(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=sj,startTime:i}=this.options;this.driver||(this.driver=t(a=>this.tick(a))),this.options.onPlay?.();const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=i??s),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(Zi.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 Sj(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const za=e=>e*180/Math.PI,Ug=e=>{const t=za(Math.atan2(e[1],e[0]));return Hg(t)},wj={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Ug,rotateZ:Ug,skewX:e=>za(Math.atan(e[1])),skewY:e=>za(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Hg=e=>(e=e%360,e<0&&(e+=360),e),_y=Ug,xy=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),yy=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),kj={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:xy,scaleY:yy,scale:e=>(xy(e)+yy(e))/2,rotateX:e=>Hg(za(Math.atan2(e[6],e[5]))),rotateY:e=>Hg(za(Math.atan2(-e[2],e[0]))),rotateZ:_y,rotate:_y,skewX:e=>za(Math.atan(e[4])),skewY:e=>za(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Fg(e){return e.includes("scale")?1:0}function Vg(e,t){if(!e||e==="none")return Fg(t);const i=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,a;if(i)s=kj,a=i;else{const h=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=wj,a=h}if(!a)return Fg(t);const o=s[t],u=a[1].split(",").map(Cj);return typeof o=="function"?o(u):u[o]}const Ej=(e,t)=>{const{transform:i="none"}=getComputedStyle(e);return Vg(i,t)};function Cj(e){return parseFloat(e.trim())}const ol=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ll=new Set(ol),Sy=e=>e===al||e===Te,Nj=new Set(["x","y","z"]),Tj=ol.filter(e=>!Nj.has(e));function Aj(e){const t=[];return Tj.forEach(i=>{const s=e.getValue(i);s!==void 0&&(t.push([i,s.get()]),s.set(i.startsWith("scale")?1:0))}),t}const Zr={width:({x:e},{paddingLeft:t="0",paddingRight:i="0",boxSizing:s})=>{const a=e.max-e.min;return s==="border-box"?a:a-parseFloat(t)-parseFloat(i)},height:({y:e},{paddingTop:t="0",paddingBottom:i="0",boxSizing:s})=>{const a=e.max-e.min;return s==="border-box"?a:a-parseFloat(t)-parseFloat(i)},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})=>Vg(t,"x"),y:(e,{transform:t})=>Vg(t,"y")};Zr.translateX=Zr.x;Zr.translateY=Zr.y;const $a=new Set;let qg=!1,Kg=!1,Gg=!1;function AE(){if(Kg){const e=Array.from($a).filter(s=>s.needsMeasurement),t=new Set(e.map(s=>s.element)),i=new Map;t.forEach(s=>{const a=Aj(s);a.length&&(i.set(s,a),s.render())}),e.forEach(s=>s.measureInitialState()),t.forEach(s=>{s.render();const a=i.get(s);a&&a.forEach(([o,u])=>{s.getValue(o)?.set(u)})}),e.forEach(s=>s.measureEndState()),e.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}Kg=!1,qg=!1,$a.forEach(e=>e.complete(Gg)),$a.clear()}function ME(){$a.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Kg=!0)})}function Mj(){Gg=!0,ME(),AE(),Gg=!1}class yb{constructor(t,i,s,a,o,u=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=i,this.name=s,this.motionValue=a,this.element=o,this.isAsync=u}scheduleResolve(){this.state="scheduled",this.isAsync?($a.add(this),qg||(qg=!0,Et.read(ME),Et.resolveKeyframes(AE))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:i,element:s,motionValue:a}=this;if(t[0]===null){const o=a?.get(),u=t[t.length-1];if(o!==void 0)t[0]=o;else if(s&&i){const h=s.readValue(i,u);h!=null&&(t[0]=h)}t[0]===void 0&&(t[0]=u),a&&o===void 0&&a.set(t[0])}Sj(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),$a.delete(this)}cancel(){this.state==="scheduled"&&($a.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Rj=e=>e.startsWith("--");function RE(e,t,i){Rj(t)?e.style.setProperty(t,i):e.style[t]=i}const jj={};function jE(e,t){const i=rE(e);return()=>jj[t]??i()}const Dj=jE(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),DE=jE(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),yc=([e,t,i,s])=>`cubic-bezier(${e}, ${t}, ${i}, ${s})`,wy={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:yc([0,.65,.55,1]),circOut:yc([.55,0,1,.45]),backIn:yc([.31,.01,.66,-.59]),backOut:yc([.33,1.53,.69,.99])};function OE(e,t){if(e)return typeof e=="function"?DE()?CE(e,t):"ease-out":gE(e)?yc(e):Array.isArray(e)?e.map(i=>OE(i,t)||wy.easeOut):wy[e]}function Oj(e,t,i,{delay:s=0,duration:a=300,repeat:o=0,repeatType:u="loop",ease:h="easeOut",times:m}={},f=void 0){const p={[t]:i};m&&(p.offset=m);const b=OE(h,a);Array.isArray(b)&&(p.easing=b);const _={delay:s,duration:a,easing:Array.isArray(b)?"linear":b,fill:"both",iterations:o+1,direction:u==="reverse"?"alternate":"normal"};return f&&(_.pseudoElement=f),e.animate(p,_)}function LE(e){return typeof e=="function"&&"applyToOptions"in e}function Lj({type:e,...t}){return LE(e)&&DE()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class BE extends xb{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:i,name:s,keyframes:a,pseudoElement:o,allowFlatten:u=!1,finalKeyframe:h,onComplete:m}=t;this.isPseudoElement=!!o,this.allowFlatten=u,this.options=t,db(typeof t.type!="string");const f=Lj(t);this.animation=Oj(i,s,a,f,o),f.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const p=Vh(a,this.options,h,this.speed);this.updateMotionValue&&this.updateMotionValue(p),RE(i,s,p),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 qn(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+qn(t)}get time(){return qn(Number(this.animation.currentTime)||0)}set time(t){const i=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=An(t),i&&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:i,rangeEnd:s,observe:a}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Dj()?(this.animation.timeline=t,i&&(this.animation.rangeStart=i),s&&(this.animation.rangeEnd=s),Kn):a(this)}}const zE={anticipate:hE,backInOut:dE,circInOut:mE};function Bj(e){return e in zE}function zj(e){typeof e.ease=="string"&&Bj(e.ease)&&(e.ease=zE[e.ease])}const bp=10;class Ij extends BE{constructor(t){zj(t),TE(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:i,onUpdate:s,onComplete:a,element:o,...u}=this.options;if(!i)return;if(t!==void 0){i.set(t);return}const h=new fh({...u,autoplay:!1}),m=Math.max(bp,Zi.now()-this.startTime),f=Ns(0,bp,m-bp),p=h.sample(m).value,{name:b}=this.options;o&&b&&RE(o,b,p),i.setWithVelocity(h.sample(Math.max(0,m-f)).value,p,f),h.stop()}}const ky=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ls.test(e)||e==="0")&&!e.startsWith("url("));function Pj(e){const t=e[0];if(e.length===1)return!0;for(let i=0;i<e.length;i++)if(e[i]!==t)return!0}function $j(e,t,i,s){const a=e[0];if(a===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],u=ky(a,t),h=ky(o,t);return!u||!h?!1:Pj(e)||(i==="spring"||LE(i))&&s}function Wg(e){e.duration=0,e.type="keyframes"}const IE=new Set(["opacity","clipPath","filter","transform"]),Uj=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Hj(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&Uj.test(e[t]))return!0;return!1}const Fj=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Vj=rE(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function qj(e){const{motionValue:t,name:i,repeatDelay:s,repeatType:a,damping:o,type:u,keyframes:h}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:f,transformTemplate:p}=t.owner.getProps();return Vj()&&i&&(IE.has(i)||Fj.has(i)&&Hj(h))&&(i!=="transform"||!p)&&!f&&!s&&a!=="mirror"&&o!==0&&u!=="inertia"}const Kj=40;class Gj extends xb{constructor({autoplay:t=!0,delay:i=0,type:s="keyframes",repeat:a=0,repeatDelay:o=0,repeatType:u="loop",keyframes:h,name:m,motionValue:f,element:p,...b}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Zi.now();const _={autoplay:t,delay:i,type:s,repeat:a,repeatDelay:o,repeatType:u,name:m,motionValue:f,element:p,...b},x=p?.KeyframeResolver||yb;this.keyframeResolver=new x(h,(y,S,E)=>this.onKeyframesResolved(y,S,_,!E),m,f,p),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,i,s,a){this.keyframeResolver=void 0;const{name:o,type:u,velocity:h,delay:m,isHandoff:f,onUpdate:p}=s;this.resolvedAt=Zi.now();let b=!0;$j(t,o,u,h)||(b=!1,(ta.instantAnimations||!m)&&p?.(Vh(t,s,i)),t[0]=t[t.length-1],Wg(s),s.repeat=0);const x={startTime:a?this.resolvedAt?this.resolvedAt-this.createdAt>Kj?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:i,...s,keyframes:t},y=b&&!f&&qj(x),S=x.motionValue?.owner?.current;let E;if(y)try{E=new Ij({...x,element:S})}catch{E=new fh(x)}else E=new fh(x);E.finished.then(()=>{this.notifyFinished()}).catch(Kn),this.pendingTimeline&&(this.stopTimeline=E.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=E}get finished(){return this._animation?this.animation.finished:this._finished}then(t,i){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Mj()),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 PE(e,t,i,s=0,a=1){const o=Array.from(e).sort((f,p)=>f.sortNodePosition(p)).indexOf(t),u=e.size,h=(u-1)*s;return typeof i=="function"?i(o,u):a===1?o*s:h-o*s}const Wj=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Yj(e){const t=Wj.exec(e);if(!t)return[,];const[,i,s,a]=t;return[`--${i??s}`,a]}function $E(e,t,i=1){const[s,a]=Yj(e);if(!s)return;const o=window.getComputedStyle(t).getPropertyValue(s);if(o){const u=o.trim();return iE(u)?parseFloat(u):u}return pb(a)?$E(a,t,i+1):a}const Xj={type:"spring",stiffness:500,damping:25,restSpeed:10},Zj=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Qj={type:"keyframes",duration:.8},Jj={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},e8=(e,{keyframes:t})=>t.length>2?Qj:ll.has(e)?e.startsWith("scale")?Zj(t[1]):Xj:Jj;function UE(e,t){if(e?.inherit&&t){const{inherit:i,...s}=e;return{...t,...s}}return e}function Sb(e,t){const i=e?.[t]??e?.default??e;return i!==e?UE(i,e):i}const t8=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function i8(e){for(const t in e)if(!t8.has(t))return!0;return!1}const wb=(e,t,i,s={},a,o)=>u=>{const h=Sb(s,e)||{},m=h.delay||s.delay||0;let{elapsed:f=0}=s;f=f-An(m);const p={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:t.getVelocity(),...h,delay:-f,onUpdate:_=>{t.set(_),h.onUpdate&&h.onUpdate(_)},onComplete:()=>{u(),h.onComplete&&h.onComplete()},name:e,motionValue:t,element:o?void 0:a};i8(h)||Object.assign(p,e8(e,p)),p.duration&&(p.duration=An(p.duration)),p.repeatDelay&&(p.repeatDelay=An(p.repeatDelay)),p.from!==void 0&&(p.keyframes[0]=p.from);let b=!1;if((p.type===!1||p.duration===0&&!p.repeatDelay)&&(Wg(p),p.delay===0&&(b=!0)),(ta.instantAnimations||ta.skipAnimations||a?.shouldSkipAnimations)&&(b=!0,Wg(p),p.delay=0),p.allowFlatten=!h.type&&!h.ease,b&&!o&&t.get()!==void 0){const _=Vh(p.keyframes,h);if(_!==void 0){Et.update(()=>{p.onUpdate(_),p.onComplete()});return}}return h.isSync?new fh(p):new Gj(p)};function Ey(e){const t=[{},{}];return e?.values.forEach((i,s)=>{t[0][s]=i.get(),t[1][s]=i.getVelocity()}),t}function kb(e,t,i,s){if(typeof t=="function"){const[a,o]=Ey(s);t=t(i!==void 0?i:e.custom,a,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[a,o]=Ey(s);t=t(i!==void 0?i:e.custom,a,o)}return t}function Ua(e,t,i){const s=e.getProps();return kb(s,t,i!==void 0?i:s.custom,e)}const HE=new Set(["width","height","top","left","right","bottom",...ol]),Cy=30,n8=e=>!isNaN(parseFloat(e));class s8{constructor(t,i={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=s=>{const a=Zi.now();if(this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=i.owner}setCurrent(t){this.current=t,this.updatedAt=Zi.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=n8(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,i){this.events[t]||(this.events[t]=new hb);const s=this.events[t].add(i);return t==="change"?()=>{s(),Et.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,i){this.passiveEffect=t,this.stopPassiveEffect=i}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,i,s){this.set(i),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,i=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,i&&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=Zi.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Cy)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,Cy);return aE(parseFloat(this.current)-parseFloat(this.prevFrameValue),i)}start(t){return this.stop(),new Promise(i=>{this.hasAnimated=!0,this.animation=t(i),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 el(e,t){return new s8(e,t)}const Yg=e=>Array.isArray(e);function r8(e,t,i){e.hasValue(t)?e.getValue(t).set(i):e.addValue(t,el(i))}function a8(e){return Yg(e)?e[e.length-1]||0:e}function o8(e,t){const i=Ua(e,t);let{transitionEnd:s={},transition:a={},...o}=i||{};o={...o,...s};for(const u in o){const h=a8(o[u]);r8(e,u,h)}}const ji=e=>!!(e&&e.getVelocity);function l8(e){return!!(ji(e)&&e.add)}function Xg(e,t){const i=e.getValue("willChange");if(l8(i))return i.add(t);if(!i&&ta.WillChange){const s=new ta.WillChange("auto");e.addValue("willChange",s),s.add(t)}}function Eb(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const c8="framerAppearId",FE="data-"+Eb(c8);function VE(e){return e.props[FE]}function u8({protectedKeys:e,needsAnimating:t},i){const s=e.hasOwnProperty(i)&&t[i]!==!0;return t[i]=!1,s}function qE(e,t,{delay:i=0,transitionOverride:s,type:a}={}){let{transition:o,transitionEnd:u,...h}=t;const m=e.getDefaultTransition();o=o?UE(o,m):m;const f=o?.reduceMotion;s&&(o=s);const p=[],b=a&&e.animationState&&e.animationState.getState()[a];for(const _ in h){const x=e.getValue(_,e.latestValues[_]??null),y=h[_];if(y===void 0||b&&u8(b,_))continue;const S={delay:i,...Sb(o||{},_)},E=x.get();if(E!==void 0&&!x.isAnimating()&&!Array.isArray(y)&&y===E&&!S.velocity){Et.update(()=>x.set(y));continue}let C=!1;if(window.MotionHandoffAnimation){const M=VE(e);if(M){const D=window.MotionHandoffAnimation(M,_,Et);D!==null&&(S.startTime=D,C=!0)}}Xg(e,_);const A=f??e.shouldReduceMotion;x.start(wb(_,x,y,A&&HE.has(_)?{type:!1}:S,e,C));const N=x.animation;N&&p.push(N)}if(u){const _=()=>Et.update(()=>{u&&o8(e,u)});p.length?Promise.all(p).then(_):_()}return p}function Zg(e,t,i={}){const s=Ua(e,t,i.type==="exit"?e.presenceContext?.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=s||{};i.transitionOverride&&(a=i.transitionOverride);const o=s?()=>Promise.all(qE(e,s,i)):()=>Promise.resolve(),u=e.variantChildren&&e.variantChildren.size?(m=0)=>{const{delayChildren:f=0,staggerChildren:p,staggerDirection:b}=a;return d8(e,t,m,f,p,b,i)}:()=>Promise.resolve(),{when:h}=a;if(h){const[m,f]=h==="beforeChildren"?[o,u]:[u,o];return m().then(()=>f())}else return Promise.all([o(),u(i.delay)])}function d8(e,t,i=0,s=0,a=0,o=1,u){const h=[];for(const m of e.variantChildren)m.notify("AnimationStart",t),h.push(Zg(m,t,{...u,delay:i+(typeof s=="function"?0:s)+PE(e.variantChildren,m,s,a,o)}).then(()=>m.notify("AnimationComplete",t)));return Promise.all(h)}function h8(e,t,i={}){e.notify("AnimationStart",t);let s;if(Array.isArray(t)){const a=t.map(o=>Zg(e,o,i));s=Promise.all(a)}else if(typeof t=="string")s=Zg(e,t,i);else{const a=typeof t=="function"?Ua(e,t,i.custom):t;s=Promise.all(qE(e,a,i))}return s.then(()=>{e.notify("AnimationComplete",t)})}const f8={test:e=>e==="auto",parse:e=>e},KE=e=>t=>t.test(e),GE=[al,Te,ks,Yr,PR,IR,f8],Ny=e=>GE.find(KE(e));function m8(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||sE(e):!0}const p8=new Set(["brightness","contrast","saturate","opacity"]);function g8(e){const[t,i]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[s]=i.match(gb)||[];if(!s)return e;const a=i.replace(s,"");let o=p8.has(t)?1:0;return s!==i&&(o*=100),t+"("+o+a+")"}const b8=/\b([a-z-]*)\(.*?\)/gu,Qg={...ls,getAnimatableNone:e=>{const t=e.match(b8);return t?t.map(g8).join(" "):e}},Jg={...ls,getAnimatableNone:e=>{const t=ls.parse(e);return ls.createTransformer(e)(t.map(s=>typeof s=="number"?0:typeof s=="object"?{...s,alpha:1}:s))}},Ty={...al,transform:Math.round},v8={rotate:Yr,rotateX:Yr,rotateY:Yr,rotateZ:Yr,scale:Ad,scaleX:Ad,scaleY:Ad,scaleZ:Ad,skew:Yr,skewX:Yr,skewY:Yr,distance:Te,translateX:Te,translateY:Te,translateZ:Te,x:Te,y:Te,z:Te,perspective:Te,transformPerspective:Te,opacity:Uc,originX:my,originY:my,originZ:Te},Cb={borderWidth:Te,borderTopWidth:Te,borderRightWidth:Te,borderBottomWidth:Te,borderLeftWidth:Te,borderRadius:Te,borderTopLeftRadius:Te,borderTopRightRadius:Te,borderBottomRightRadius:Te,borderBottomLeftRadius:Te,width:Te,maxWidth:Te,height:Te,maxHeight:Te,top:Te,right:Te,bottom:Te,left:Te,inset:Te,insetBlock:Te,insetBlockStart:Te,insetBlockEnd:Te,insetInline:Te,insetInlineStart:Te,insetInlineEnd:Te,padding:Te,paddingTop:Te,paddingRight:Te,paddingBottom:Te,paddingLeft:Te,paddingBlock:Te,paddingBlockStart:Te,paddingBlockEnd:Te,paddingInline:Te,paddingInlineStart:Te,paddingInlineEnd:Te,margin:Te,marginTop:Te,marginRight:Te,marginBottom:Te,marginLeft:Te,marginBlock:Te,marginBlockStart:Te,marginBlockEnd:Te,marginInline:Te,marginInlineStart:Te,marginInlineEnd:Te,fontSize:Te,backgroundPositionX:Te,backgroundPositionY:Te,...v8,zIndex:Ty,fillOpacity:Uc,strokeOpacity:Uc,numOctaves:Ty},_8={...Cb,color:si,backgroundColor:si,outlineColor:si,fill:si,stroke:si,borderColor:si,borderTopColor:si,borderRightColor:si,borderBottomColor:si,borderLeftColor:si,filter:Qg,WebkitFilter:Qg,mask:Jg,WebkitMask:Jg},WE=e=>_8[e],x8=new Set([Qg,Jg]);function YE(e,t){let i=WE(e);return x8.has(i)||(i=ls),i.getAnimatableNone?i.getAnimatableNone(t):void 0}const y8=new Set(["auto","none","0"]);function S8(e,t,i){let s=0,a;for(;s<e.length&&!a;){const o=e[s];typeof o=="string"&&!y8.has(o)&&Jo(o).values.length&&(a=e[s]),s++}if(a&&i)for(const o of t)e[o]=YE(i,a)}class w8 extends yb{constructor(t,i,s,a,o){super(t,i,s,a,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:i,name:s}=this;if(!i||!i.current)return;super.readKeyframes();for(let p=0;p<t.length;p++){let b=t[p];if(typeof b=="string"&&(b=b.trim(),pb(b))){const _=$E(b,i.current);_!==void 0&&(t[p]=_),p===t.length-1&&(this.finalKeyframe=b)}}if(this.resolveNoneKeyframes(),!HE.has(s)||t.length!==2)return;const[a,o]=t,u=Ny(a),h=Ny(o),m=fy(a),f=fy(o);if(m!==f&&Zr[s]){this.needsMeasurement=!0;return}if(u!==h)if(Sy(u)&&Sy(h))for(let p=0;p<t.length;p++){const b=t[p];typeof b=="string"&&(t[p]=parseFloat(b))}else Zr[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:i}=this,s=[];for(let a=0;a<t.length;a++)(t[a]===null||m8(t[a]))&&s.push(a);s.length&&S8(t,s,i)}measureInitialState(){const{element:t,unresolvedKeyframes:i,name:s}=this;if(!t||!t.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Zr[s](t.measureViewportBox(),window.getComputedStyle(t.current)),i[0]=this.measuredOrigin;const a=i[i.length-1];a!==void 0&&t.getValue(s,a).jump(a,!1)}measureEndState(){const{element:t,name:i,unresolvedKeyframes:s}=this;if(!t||!t.current)return;const a=t.getValue(i);a&&a.jump(this.measuredOrigin,!1);const o=s.length-1,u=s[o];s[o]=Zr[i](t.measureViewportBox(),window.getComputedStyle(t.current)),u!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=u),this.removedTransforms?.length&&this.removedTransforms.forEach(([h,m])=>{t.getValue(h).set(m)}),this.resolveNoneKeyframes()}}function XE(e,t,i){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let s=document;const a=i?.[e]??s.querySelectorAll(e);return a?Array.from(a):[]}return Array.from(e).filter(s=>s!=null)}const ZE=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function k8(e){return nE(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Nb}=bE(queueMicrotask,!1),rs={x:!1,y:!1};function QE(){return rs.x||rs.y}function E8(e){return e==="x"||e==="y"?rs[e]?null:(rs[e]=!0,()=>{rs[e]=!1}):rs.x||rs.y?null:(rs.x=rs.y=!0,()=>{rs.x=rs.y=!1})}function JE(e,t){const i=XE(e),s=new AbortController,a={passive:!0,...t,signal:s.signal};return[i,a,()=>s.abort()]}function C8(e){return!(e.pointerType==="touch"||QE())}function N8(e,t,i={}){const[s,a,o]=JE(e,i);return s.forEach(u=>{let h=!1,m=!1,f;const p=()=>{u.removeEventListener("pointerleave",y)},b=E=>{f&&(f(E),f=void 0),p()},_=E=>{h=!1,window.removeEventListener("pointerup",_),window.removeEventListener("pointercancel",_),m&&(m=!1,b(E))},x=()=>{h=!0,window.addEventListener("pointerup",_,a),window.addEventListener("pointercancel",_,a)},y=E=>{if(E.pointerType!=="touch"){if(h){m=!0;return}b(E)}},S=E=>{if(!C8(E))return;m=!1;const C=t(u,E);typeof C=="function"&&(f=C,u.addEventListener("pointerleave",y,a))};u.addEventListener("pointerenter",S,a),u.addEventListener("pointerdown",x,a)}),o}const eC=(e,t)=>t?e===t?!0:eC(e,t.parentElement):!1,Tb=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,T8=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function A8(e){return T8.has(e.tagName)||e.isContentEditable===!0}const M8=new Set(["INPUT","SELECT","TEXTAREA"]);function R8(e){return M8.has(e.tagName)||e.isContentEditable===!0}const Wd=new WeakSet;function Ay(e){return t=>{t.key==="Enter"&&e(t)}}function vp(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const j8=(e,t)=>{const i=e.currentTarget;if(!i)return;const s=Ay(()=>{if(Wd.has(i))return;vp(i,"down");const a=Ay(()=>{vp(i,"up")}),o=()=>vp(i,"cancel");i.addEventListener("keyup",a,t),i.addEventListener("blur",o,t)});i.addEventListener("keydown",s,t),i.addEventListener("blur",()=>i.removeEventListener("keydown",s),t)};function My(e){return Tb(e)&&!QE()}const Ry=new WeakSet;function D8(e,t,i={}){const[s,a,o]=JE(e,i),u=h=>{const m=h.currentTarget;if(!My(h)||Ry.has(h))return;Wd.add(m),i.stopPropagation&&Ry.add(h);const f=t(m,h),p=(x,y)=>{window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",_),Wd.has(m)&&Wd.delete(m),My(x)&&typeof f=="function"&&f(x,{success:y})},b=x=>{p(x,m===window||m===document||i.useGlobalTarget||eC(m,x.target))},_=x=>{p(x,!1)};window.addEventListener("pointerup",b,a),window.addEventListener("pointercancel",_,a)};return s.forEach(h=>{(i.useGlobalTarget?window:h).addEventListener("pointerdown",u,a),k8(h)&&(h.addEventListener("focus",f=>j8(f,a)),!A8(h)&&!h.hasAttribute("tabindex")&&(h.tabIndex=0))}),o}function Ab(e){return nE(e)&&"ownerSVGElement"in e}const Yd=new WeakMap;let Xd;const tC=(e,t,i)=>(s,a)=>a&&a[0]?a[0][e+"Size"]:Ab(s)&&"getBBox"in s?s.getBBox()[t]:s[i],O8=tC("inline","width","offsetWidth"),L8=tC("block","height","offsetHeight");function B8({target:e,borderBoxSize:t}){Yd.get(e)?.forEach(i=>{i(e,{get width(){return O8(e,t)},get height(){return L8(e,t)}})})}function z8(e){e.forEach(B8)}function I8(){typeof ResizeObserver>"u"||(Xd=new ResizeObserver(z8))}function P8(e,t){Xd||I8();const i=XE(e);return i.forEach(s=>{let a=Yd.get(s);a||(a=new Set,Yd.set(s,a)),a.add(t),Xd?.observe(s)}),()=>{i.forEach(s=>{const a=Yd.get(s);a?.delete(t),a?.size||Xd?.unobserve(s)})}}const Zd=new Set;let Go;function $8(){Go=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Zd.forEach(t=>t(e))},window.addEventListener("resize",Go)}function U8(e){return Zd.add(e),Go||$8(),()=>{Zd.delete(e),!Zd.size&&typeof Go=="function"&&(window.removeEventListener("resize",Go),Go=void 0)}}function jy(e,t){return typeof e=="function"?U8(e):P8(e,t)}function H8(e){return Ab(e)&&e.tagName==="svg"}const F8=[...GE,si,ls],V8=e=>F8.find(KE(e)),Dy=()=>({translate:0,scale:1,origin:0,originPoint:0}),Wo=()=>({x:Dy(),y:Dy()}),Oy=()=>({min:0,max:0}),fi=()=>({x:Oy(),y:Oy()}),q8=new WeakMap;function qh(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Hc(e){return typeof e=="string"||Array.isArray(e)}const Mb=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Rb=["initial",...Mb];function Kh(e){return qh(e.animate)||Rb.some(t=>Hc(e[t]))}function iC(e){return!!(Kh(e)||e.variants)}function K8(e,t,i){for(const s in t){const a=t[s],o=i[s];if(ji(a))e.addValue(s,a);else if(ji(o))e.addValue(s,el(a,{owner:e}));else if(o!==a)if(e.hasValue(s)){const u=e.getValue(s);u.liveStyle===!0?u.jump(a):u.hasAnimated||u.set(a)}else{const u=e.getStaticValue(s);e.addValue(s,el(u!==void 0?u:a,{owner:e}))}}for(const s in i)t[s]===void 0&&e.removeValue(s);return t}const e0={current:null},nC={current:!1},G8=typeof window<"u";function W8(){if(nC.current=!0,!!G8)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>e0.current=e.matches;e.addEventListener("change",t),t()}else e0.current=!1}const Ly=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let mh={};function sC(e){mh=e}function Y8(){return mh}class X8{scrapeMotionValuesFromProps(t,i,s){return{}}constructor({parent:t,props:i,presenceContext:s,reducedMotionConfig:a,skipAnimations:o,blockInitialAnimation:u,visualState:h},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=yb,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 x=Zi.now();this.renderScheduledAt<x&&(this.renderScheduledAt=x,Et.render(this.render,!1,!0))};const{latestValues:f,renderState:p}=h;this.latestValues=f,this.baseTarget={...f},this.initialValues=i.initial?{...f}:{},this.renderState=p,this.parent=t,this.props=i,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=a,this.skipAnimationsConfig=o,this.options=m,this.blockInitialAnimation=!!u,this.isControllingVariants=Kh(i),this.isVariantNode=iC(i),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:b,..._}=this.scrapeMotionValuesFromProps(i,{},this);for(const x in _){const y=_[x];f[x]!==void 0&&ji(y)&&y.set(f[x])}}mount(t){if(this.hasBeenMounted)for(const i in this.initialValues)this.values.get(i)?.jump(this.initialValues[i]),this.latestValues[i]=this.initialValues[i];this.current=t,q8.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((i,s)=>this.bindToMotionValue(s,i)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(nC.current||W8(),this.shouldReduceMotion=e0.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(),ia(this.notifyUpdate),ia(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 i=this.features[t];i&&(i.unmount(),i.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,i){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),i.accelerate&&IE.has(t)&&this.current instanceof HTMLElement){const{factory:u,keyframes:h,times:m,ease:f,duration:p}=i.accelerate,b=new BE({element:this.current,name:t,keyframes:h,times:m,ease:f,duration:An(p)}),_=u(b);this.valueSubscriptions.set(t,()=>{_(),b.cancel()});return}const s=ll.has(t);s&&this.onBindTransform&&this.onBindTransform();const a=i.on("change",u=>{this.latestValues[t]=u,this.props.onUpdate&&Et.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,i)),this.valueSubscriptions.set(t,()=>{a(),o&&o(),i.owner&&i.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 mh){const i=mh[t];if(!i)continue;const{isEnabled:s,Feature:a}=i;if(!this.features[t]&&a&&s(this.props)&&(this.features[t]=new a(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):fi()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,i){this.latestValues[t]=i}update(t,i){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=i;for(let s=0;s<Ly.length;s++){const a=Ly[s];this.propEventSubscriptions[a]&&(this.propEventSubscriptions[a](),delete this.propEventSubscriptions[a]);const o="on"+a,u=t[o];u&&(this.propEventSubscriptions[a]=this.on(a,u))}this.prevMotionValues=K8(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 i=this.getClosestVariantNode();if(i)return i.variantChildren&&i.variantChildren.add(t),()=>i.variantChildren.delete(t)}addValue(t,i){const s=this.values.get(t);i!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,i),this.values.set(t,i),this.latestValues[t]=i.get())}removeValue(t){this.values.delete(t);const i=this.valueSubscriptions.get(t);i&&(i(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,i){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return s===void 0&&i!==void 0&&(s=el(i===null?void 0:i,{owner:this}),this.addValue(t,s)),s}readValue(t,i){let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(iE(s)||sE(s))?s=parseFloat(s):!V8(s)&&ls.test(i)&&(s=YE(t,i)),this.setBaseTarget(t,ji(s)?s.get():s)),ji(s)?s.get():s}setBaseTarget(t,i){this.baseTarget[t]=i}getBaseTarget(t){const{initial:i}=this.props;let s;if(typeof i=="string"||typeof i=="object"){const o=kb(this.props,i,this.presenceContext?.custom);o&&(s=o[t])}if(i&&s!==void 0)return s;const a=this.getBaseTargetFromProps(this.props,t);return a!==void 0&&!ji(a)?a:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,i){return this.events[t]||(this.events[t]=new hb),this.events[t].add(i)}notify(t,...i){this.events[t]&&this.events[t].notify(...i)}scheduleRenderMicrotask(){Nb.render(this.render)}}class rC extends X8{constructor(){super(...arguments),this.KeyframeResolver=w8}sortInstanceNodePosition(t,i){return t.compareDocumentPosition(i)&2?1:-1}getBaseTargetFromProps(t,i){const s=t.style;return s?s[i]:void 0}removeValueFromRenderState(t,{vars:i,style:s}){delete i[t],delete s[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ji(t)&&(this.childSubscription=t.on("change",i=>{this.current&&(this.current.textContent=`${i}`)}))}}class aa{constructor(t){this.isMounted=!1,this.node=t}update(){}}function aC({top:e,left:t,right:i,bottom:s}){return{x:{min:t,max:i},y:{min:e,max:s}}}function Z8({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Q8(e,t){if(!t)return e;const i=t({x:e.left,y:e.top}),s=t({x:e.right,y:e.bottom});return{top:i.y,left:i.x,bottom:s.y,right:s.x}}function _p(e){return e===void 0||e===1}function t0({scale:e,scaleX:t,scaleY:i}){return!_p(e)||!_p(t)||!_p(i)}function ja(e){return t0(e)||oC(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function oC(e){return By(e.x)||By(e.y)}function By(e){return e&&e!=="0%"}function ph(e,t,i){const s=e-i,a=t*s;return i+a}function zy(e,t,i,s,a){return a!==void 0&&(e=ph(e,a,s)),ph(e,i,s)+t}function i0(e,t=0,i=1,s,a){e.min=zy(e.min,t,i,s,a),e.max=zy(e.max,t,i,s,a)}function lC(e,{x:t,y:i}){i0(e.x,t.translate,t.scale,t.originPoint),i0(e.y,i.translate,i.scale,i.originPoint)}const Iy=.999999999999,Py=1.0000000000001;function J8(e,t,i,s=!1){const a=i.length;if(!a)return;t.x=t.y=1;let o,u;for(let h=0;h<a;h++){o=i[h],u=o.projectionDelta;const{visualElement:m}=o.options;m&&m.props.style&&m.props.style.display==="contents"||(s&&o.options.layoutScroll&&o.scroll&&o!==o.root&&(Ss(e.x,-o.scroll.offset.x),Ss(e.y,-o.scroll.offset.y)),u&&(t.x*=u.x.scale,t.y*=u.y.scale,lC(e,u)),s&&ja(o.latestValues)&&Qd(e,o.latestValues,o.layout?.layoutBox))}t.x<Py&&t.x>Iy&&(t.x=1),t.y<Py&&t.y>Iy&&(t.y=1)}function Ss(e,t){e.min+=t,e.max+=t}function $y(e,t,i,s,a=.5){const o=Rt(e.min,e.max,a);i0(e,t,i,o,s)}function Uy(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Qd(e,t,i){const s=i??e;$y(e.x,Uy(t.x,s.x),t.scaleX,t.scale,t.originX),$y(e.y,Uy(t.y,s.y),t.scaleY,t.scale,t.originY)}function cC(e,t){return aC(Q8(e.getBoundingClientRect(),t))}function eD(e,t,i){const s=cC(e,i),{scroll:a}=t;return a&&(Ss(s.x,a.offset.x),Ss(s.y,a.offset.y)),s}const tD={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},iD=ol.length;function nD(e,t,i){let s="",a=!0;for(let o=0;o<iD;o++){const u=ol[o],h=e[u];if(h===void 0)continue;let m=!0;if(typeof h=="number")m=h===(u.startsWith("scale")?1:0);else{const f=parseFloat(h);m=u.startsWith("scale")?f===1:f===0}if(!m||i){const f=ZE(h,Cb[u]);if(!m){a=!1;const p=tD[u]||u;s+=`${p}(${f}) `}i&&(t[u]=f)}}return s=s.trim(),i?s=i(t,a?"":s):a&&(s="none"),s}function jb(e,t,i){const{style:s,vars:a,transformOrigin:o}=e;let u=!1,h=!1;for(const m in t){const f=t[m];if(ll.has(m)){u=!0;continue}else if(_E(m)){a[m]=f;continue}else{const p=ZE(f,Cb[m]);m.startsWith("origin")?(h=!0,o[m]=p):s[m]=p}}if(t.transform||(u||i?s.transform=nD(t,e.transform,i):s.transform&&(s.transform="none")),h){const{originX:m="50%",originY:f="50%",originZ:p=0}=o;s.transformOrigin=`${m} ${f} ${p}`}}function uC(e,{style:t,vars:i},s,a){const o=e.style;let u;for(u in t)o[u]=t[u];a?.applyProjectionStyles(o,s);for(u in i)o.setProperty(u,i[u])}function Hy(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const dc={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Te.test(e))e=parseFloat(e);else return e;const i=Hy(e,t.target.x),s=Hy(e,t.target.y);return`${i}% ${s}%`}},sD={correct:(e,{treeScale:t,projectionDelta:i})=>{const s=e,a=ls.parse(e);if(a.length>5)return s;const o=ls.createTransformer(e),u=typeof a[0]!="number"?1:0,h=i.x.scale*t.x,m=i.y.scale*t.y;a[0+u]/=h,a[1+u]/=m;const f=Rt(h,m,.5);return typeof a[2+u]=="number"&&(a[2+u]/=f),typeof a[3+u]=="number"&&(a[3+u]/=f),o(a)}},n0={borderRadius:{...dc,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:dc,borderTopRightRadius:dc,borderBottomLeftRadius:dc,borderBottomRightRadius:dc,boxShadow:sD};function dC(e,{layout:t,layoutId:i}){return ll.has(e)||e.startsWith("origin")||(t||i!==void 0)&&(!!n0[e]||e==="opacity")}function Db(e,t,i){const s=e.style,a=t?.style,o={};if(!s)return o;for(const u in s)(ji(s[u])||a&&ji(a[u])||dC(u,e)||i?.getValue(u)?.liveStyle!==void 0)&&(o[u]=s[u]);return o}function rD(e){return window.getComputedStyle(e)}class aD extends rC{constructor(){super(...arguments),this.type="html",this.renderInstance=uC}readValueFromInstance(t,i){if(ll.has(i))return this.projection?.isProjecting?Fg(i):Ej(t,i);{const s=rD(t),a=(_E(i)?s.getPropertyValue(i):s[i])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(t,{transformPagePoint:i}){return cC(t,i)}build(t,i,s){jb(t,i,s.transformTemplate)}scrapeMotionValuesFromProps(t,i,s){return Db(t,i,s)}}const oD={offset:"stroke-dashoffset",array:"stroke-dasharray"},lD={offset:"strokeDashoffset",array:"strokeDasharray"};function cD(e,t,i=1,s=0,a=!0){e.pathLength=1;const o=a?oD:lD;e[o.offset]=`${-s}`,e[o.array]=`${t} ${i}`}const uD=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function hC(e,{attrX:t,attrY:i,attrScale:s,pathLength:a,pathSpacing:o=1,pathOffset:u=0,...h},m,f,p){if(jb(e,h,f),m){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:b,style:_}=e;b.transform&&(_.transform=b.transform,delete b.transform),(_.transform||b.transformOrigin)&&(_.transformOrigin=b.transformOrigin??"50% 50%",delete b.transformOrigin),_.transform&&(_.transformBox=p?.transformBox??"fill-box",delete b.transformBox);for(const x of uD)b[x]!==void 0&&(_[x]=b[x],delete b[x]);t!==void 0&&(b.x=t),i!==void 0&&(b.y=i),s!==void 0&&(b.scale=s),a!==void 0&&cD(b,a,o,u,!1)}const fC=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"]),mC=e=>typeof e=="string"&&e.toLowerCase()==="svg";function dD(e,t,i,s){uC(e,t,void 0,s);for(const a in t.attrs)e.setAttribute(fC.has(a)?a:Eb(a),t.attrs[a])}function pC(e,t,i){const s=Db(e,t,i);for(const a in e)if(ji(e[a])||ji(t[a])){const o=ol.indexOf(a)!==-1?"attr"+a.charAt(0).toUpperCase()+a.substring(1):a;s[o]=e[a]}return s}class hD extends rC{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=fi}getBaseTargetFromProps(t,i){return t[i]}readValueFromInstance(t,i){if(ll.has(i)){const s=WE(i);return s&&s.default||0}return i=fC.has(i)?i:Eb(i),t.getAttribute(i)}scrapeMotionValuesFromProps(t,i,s){return pC(t,i,s)}build(t,i,s){hC(t,i,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(t,i,s,a){dD(t,i,s,a)}mount(t){this.isSVGTag=mC(t.tagName),super.mount(t)}}const fD=Rb.length;function gC(e){if(!e)return;if(!e.isControllingVariants){const i=e.parent?gC(e.parent)||{}:{};return e.props.initial!==void 0&&(i.initial=e.props.initial),i}const t={};for(let i=0;i<fD;i++){const s=Rb[i],a=e.props[s];(Hc(a)||a===!1)&&(t[s]=a)}return t}function bC(e,t){if(!Array.isArray(t))return!1;const i=t.length;if(i!==e.length)return!1;for(let s=0;s<i;s++)if(t[s]!==e[s])return!1;return!0}const mD=[...Mb].reverse(),pD=Mb.length;function gD(e){return t=>Promise.all(t.map(({animation:i,options:s})=>h8(e,i,s)))}function bD(e){let t=gD(e),i=Fy(),s=!0,a=!1;const o=f=>(p,b)=>{const _=Ua(e,b,f==="exit"?e.presenceContext?.custom:void 0);if(_){const{transition:x,transitionEnd:y,...S}=_;p={...p,...S,...y}}return p};function u(f){t=f(e)}function h(f){const{props:p}=e,b=gC(e.parent)||{},_=[],x=new Set;let y={},S=1/0;for(let C=0;C<pD;C++){const A=mD[C],N=i[A],M=p[A]!==void 0?p[A]:b[A],D=Hc(M),U=A===f?N.isActive:null;U===!1&&(S=C);let L=M===b[A]&&M!==p[A]&&D;if(L&&(s||a)&&e.manuallyAnimateOnMount&&(L=!1),N.protectedKeys={...y},!N.isActive&&U===null||!M&&!N.prevProp||qh(M)||typeof M=="boolean")continue;if(A==="exit"&&N.isActive&&U!==!0){N.prevResolvedValues&&(y={...y,...N.prevResolvedValues});continue}const R=vD(N.prevProp,M);let $=R||A===f&&N.isActive&&!L&&D||C>S&&D,I=!1;const F=Array.isArray(M)?M:[M];let G=F.reduce(o(A),{});U===!1&&(G={});const{prevResolvedValues:Y={}}=N,Q={...Y,...G},q=Z=>{$=!0,x.has(Z)&&(I=!0,x.delete(Z)),N.needsAnimating[Z]=!0;const V=e.getValue(Z);V&&(V.liveStyle=!1)};for(const Z in Q){const V=G[Z],P=Y[Z];if(y.hasOwnProperty(Z))continue;let j=!1;Yg(V)&&Yg(P)?j=!bC(V,P):j=V!==P,j?V!=null?q(Z):x.add(Z):V!==void 0&&x.has(Z)?q(Z):N.protectedKeys[Z]=!0}N.prevProp=M,N.prevResolvedValues=G,N.isActive&&(y={...y,...G}),(s||a)&&e.blockInitialAnimation&&($=!1);const O=L&&R;$&&(!O||I)&&_.push(...F.map(Z=>{const V={type:A};if(typeof Z=="string"&&(s||a)&&!O&&e.manuallyAnimateOnMount&&e.parent){const{parent:P}=e,j=Ua(P,Z);if(P.enteringChildren&&j){const{delayChildren:W}=j.transition||{};V.delay=PE(P.enteringChildren,e,W)}}return{animation:Z,options:V}}))}if(x.size){const C={};if(typeof p.initial!="boolean"){const A=Ua(e,Array.isArray(p.initial)?p.initial[0]:p.initial);A&&A.transition&&(C.transition=A.transition)}x.forEach(A=>{const N=e.getBaseTarget(A),M=e.getValue(A);M&&(M.liveStyle=!0),C[A]=N??null}),_.push({animation:C})}let E=!!_.length;return s&&(p.initial===!1||p.initial===p.animate)&&!e.manuallyAnimateOnMount&&(E=!1),s=!1,a=!1,E?t(_):Promise.resolve()}function m(f,p){if(i[f].isActive===p)return Promise.resolve();e.variantChildren?.forEach(_=>_.animationState?.setActive(f,p)),i[f].isActive=p;const b=h(f);for(const _ in i)i[_].protectedKeys={};return b}return{animateChanges:h,setActive:m,setAnimateFunction:u,getState:()=>i,reset:()=>{i=Fy(),a=!0}}}function vD(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!bC(t,e):!1}function Aa(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Fy(){return{animate:Aa(!0),whileInView:Aa(),whileHover:Aa(),whileTap:Aa(),whileDrag:Aa(),whileFocus:Aa(),exit:Aa()}}function s0(e,t){e.min=t.min,e.max=t.max}function ss(e,t){s0(e.x,t.x),s0(e.y,t.y)}function Vy(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const vC=1e-4,_D=1-vC,xD=1+vC,_C=.01,yD=0-_C,SD=0+_C;function Qi(e){return e.max-e.min}function wD(e,t,i){return Math.abs(e-t)<=i}function qy(e,t,i,s=.5){e.origin=s,e.originPoint=Rt(t.min,t.max,e.origin),e.scale=Qi(i)/Qi(t),e.translate=Rt(i.min,i.max,e.origin)-e.originPoint,(e.scale>=_D&&e.scale<=xD||isNaN(e.scale))&&(e.scale=1),(e.translate>=yD&&e.translate<=SD||isNaN(e.translate))&&(e.translate=0)}function Dc(e,t,i,s){qy(e.x,t.x,i.x,s?s.originX:void 0),qy(e.y,t.y,i.y,s?s.originY:void 0)}function Ky(e,t,i,s=0){const a=s?Rt(i.min,i.max,s):i.min;e.min=a+t.min,e.max=e.min+Qi(t)}function kD(e,t,i,s){Ky(e.x,t.x,i.x,s?.x),Ky(e.y,t.y,i.y,s?.y)}function Gy(e,t,i,s=0){const a=s?Rt(i.min,i.max,s):i.min;e.min=t.min-a,e.max=e.min+Qi(t)}function gh(e,t,i,s){Gy(e.x,t.x,i.x,s?.x),Gy(e.y,t.y,i.y,s?.y)}function Wy(e,t,i,s,a){return e-=t,e=ph(e,1/i,s),a!==void 0&&(e=ph(e,1/a,s)),e}function ED(e,t=0,i=1,s=.5,a,o=e,u=e){if(ks.test(t)&&(t=parseFloat(t),t=Rt(u.min,u.max,t/100)-u.min),typeof t!="number")return;let h=Rt(o.min,o.max,s);e===o&&(h-=t),e.min=Wy(e.min,t,i,h,a),e.max=Wy(e.max,t,i,h,a)}function Yy(e,t,[i,s,a],o,u){ED(e,t[i],t[s],t[a],t.scale,o,u)}const CD=["x","scaleX","originX"],ND=["y","scaleY","originY"];function Xy(e,t,i,s){Yy(e.x,t,CD,i?i.x:void 0,s?s.x:void 0),Yy(e.y,t,ND,i?i.y:void 0,s?s.y:void 0)}function Zy(e){return e.translate===0&&e.scale===1}function xC(e){return Zy(e.x)&&Zy(e.y)}function Qy(e,t){return e.min===t.min&&e.max===t.max}function TD(e,t){return Qy(e.x,t.x)&&Qy(e.y,t.y)}function Jy(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function yC(e,t){return Jy(e.x,t.x)&&Jy(e.y,t.y)}function eS(e){return Qi(e.x)/Qi(e.y)}function tS(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function ys(e){return[e("x"),e("y")]}function AD(e,t,i){let s="";const a=e.x.translate/t.x,o=e.y.translate/t.y,u=i?.z||0;if((a||o||u)&&(s=`translate3d(${a}px, ${o}px, ${u}px) `),(t.x!==1||t.y!==1)&&(s+=`scale(${1/t.x}, ${1/t.y}) `),i){const{transformPerspective:f,rotate:p,rotateX:b,rotateY:_,skewX:x,skewY:y}=i;f&&(s=`perspective(${f}px) ${s}`),p&&(s+=`rotate(${p}deg) `),b&&(s+=`rotateX(${b}deg) `),_&&(s+=`rotateY(${_}deg) `),x&&(s+=`skewX(${x}deg) `),y&&(s+=`skewY(${y}deg) `)}const h=e.x.scale*t.x,m=e.y.scale*t.y;return(h!==1||m!==1)&&(s+=`scale(${h}, ${m})`),s||"none"}const SC=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],MD=SC.length,iS=e=>typeof e=="string"?parseFloat(e):e,nS=e=>typeof e=="number"||Te.test(e);function RD(e,t,i,s,a,o){a?(e.opacity=Rt(0,i.opacity??1,jD(s)),e.opacityExit=Rt(t.opacity??1,0,DD(s))):o&&(e.opacity=Rt(t.opacity??1,i.opacity??1,s));for(let u=0;u<MD;u++){const h=SC[u];let m=sS(t,h),f=sS(i,h);if(m===void 0&&f===void 0)continue;m||(m=0),f||(f=0),m===0||f===0||nS(m)===nS(f)?(e[h]=Math.max(Rt(iS(m),iS(f),s),0),(ks.test(f)||ks.test(m))&&(e[h]+="%")):e[h]=f}(t.rotate||i.rotate)&&(e.rotate=Rt(t.rotate||0,i.rotate||0,s))}function sS(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const jD=wC(0,.5,fE),DD=wC(.5,.95,Kn);function wC(e,t,i){return s=>s<e?0:s>t?1:i($c(e,t,s))}function OD(e,t,i){const s=ji(e)?e:el(e);return s.start(wb("",s,t,i)),s.animation}function Fc(e,t,i,s={passive:!0}){return e.addEventListener(t,i,s),()=>e.removeEventListener(t,i)}const LD=(e,t)=>e.depth-t.depth;class BD{constructor(){this.children=[],this.isDirty=!1}add(t){ub(this.children,t),this.isDirty=!0}remove(t){ch(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(LD),this.isDirty=!1,this.children.forEach(t)}}function zD(e,t){const i=Zi.now(),s=({timestamp:a})=>{const o=a-i;o>=t&&(ia(s),e(o-t))};return Et.setup(s,!0),()=>ia(s)}function Jd(e){return ji(e)?e.get():e}class ID{constructor(){this.members=[]}add(t){ub(this.members,t);for(let i=this.members.length-1;i>=0;i--){const s=this.members[i];if(s===t||s===this.lead||s===this.prevLead)continue;const a=s.instance;(!a||a.isConnected===!1)&&!s.snapshot&&(ch(this.members,s),s.unmount())}t.scheduleRender()}remove(t){if(ch(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const i=this.members[this.members.length-1];i&&this.promote(i)}}relegate(t){for(let i=this.members.indexOf(t)-1;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1&&s.instance?.isConnected!==!1)return this.promote(s),!0}return!1}promote(t,i){const s=this.lead;if(t!==s&&(this.prevLead=s,this.lead=t,t.show(),s)){s.updateSnapshot(),t.scheduleRender();const{layoutDependency:a}=s.options,{layoutDependency:o}=t.options;(a===void 0||a!==o)&&(t.resumeFrom=s,i&&(s.preserveOpacity=!0),s.snapshot&&(t.snapshot=s.snapshot,t.snapshot.latestValues=s.animationValues||s.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&s.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 eh={hasAnimatedSinceResize:!0,hasEverUpdated:!1},xp=["","X","Y","Z"],PD=1e3;let $D=0;function yp(e,t,i,s){const{latestValues:a}=t;a[e]&&(i[e]=a[e],t.setStaticValue(e,0),s&&(s[e]=0))}function kC(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const i=VE(t);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:a,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(i,"transform",Et,!(a||o))}const{parent:s}=e;s&&!s.hasCheckedOptimisedAppear&&kC(s)}function EC({attachResizeListener:e,defaultParent:t,measureScroll:i,checkIsScrollRoot:s,resetTransform:a}){return class{constructor(u={},h=t?.()){this.id=$D++,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(FD),this.nodes.forEach(YD),this.nodes.forEach(XD),this.nodes.forEach(VD)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=u,this.root=h?h.root||h:this,this.path=h?[...h.path,h]:[],this.parent=h,this.depth=h?h.depth+1:0;for(let m=0;m<this.path.length;m++)this.path[m].shouldResetTransform=!0;this.root===this&&(this.nodes=new BD)}addEventListener(u,h){return this.eventHandlers.has(u)||this.eventHandlers.set(u,new hb),this.eventHandlers.get(u).add(h)}notifyListeners(u,...h){const m=this.eventHandlers.get(u);m&&m.notify(...h)}hasListeners(u){return this.eventHandlers.has(u)}mount(u){if(this.instance)return;this.isSVG=Ab(u)&&!H8(u),this.instance=u;const{layoutId:h,layout:m,visualElement:f}=this.options;if(f&&!f.current&&f.mount(u),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(m||h)&&(this.isLayoutDirty=!0),e){let p,b=0;const _=()=>this.root.updateBlockedByResize=!1;Et.read(()=>{b=window.innerWidth}),e(u,()=>{const x=window.innerWidth;x!==b&&(b=x,this.root.updateBlockedByResize=!0,p&&p(),p=zD(_,250),eh.hasAnimatedSinceResize&&(eh.hasAnimatedSinceResize=!1,this.nodes.forEach(oS)))})}h&&this.root.registerSharedNode(h,this),this.options.animate!==!1&&f&&(h||m)&&this.addEventListener("didUpdate",({delta:p,hasLayoutChanged:b,hasRelativeLayoutChanged:_,layout:x})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||f.getDefaultTransition()||tO,{onLayoutAnimationStart:S,onLayoutAnimationComplete:E}=f.getProps(),C=!this.targetLayout||!yC(this.targetLayout,x),A=!b&&_;if(this.options.layoutRoot||this.resumeFrom||A||b&&(C||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const N={...Sb(y,"layout"),onPlay:S,onComplete:E};(f.shouldReduceMotion||this.options.layoutRoot)&&(N.delay=0,N.type=!1),this.startAnimation(N),this.setAnimationOrigin(p,A)}else b||oS(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=x})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const u=this.getStack();u&&u.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ia(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(ZD),this.animationId++)}getTransformTemplate(){const{visualElement:u}=this.options;return u&&u.getProps().transformTemplate}willUpdate(u=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&kC(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let p=0;p<this.path.length;p++){const b=this.path[p];b.shouldResetTransform=!0,(typeof b.latestValues.x=="string"||typeof b.latestValues.y=="string")&&(b.isLayoutDirty=!0),b.updateScroll("snapshot"),b.options.layoutRoot&&b.willUpdate(!1)}const{layoutId:h,layout:m}=this.options;if(h===void 0&&!m)return;const f=this.getTransformTemplate();this.prevTransformTemplateValue=f?f(this.latestValues,""):void 0,this.updateSnapshot(),u&&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(KD),this.nodes.forEach(rS);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(aS);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(GD),this.nodes.forEach(WD),this.nodes.forEach(UD),this.nodes.forEach(HD)):this.nodes.forEach(aS),this.clearAllSnapshots();const h=Zi.now();Mi.delta=Ns(0,1e3/60,h-Mi.timestamp),Mi.timestamp=h,Mi.isProcessing=!0,hp.update.process(Mi),hp.preRender.process(Mi),hp.render.process(Mi),Mi.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Nb.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(qD),this.sharedNodes.forEach(QD)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Et.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Et.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Qi(this.snapshot.measuredBox.x)&&!Qi(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 u=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=fi()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:h}=this.options;h&&h.notify("LayoutMeasure",this.layout.layoutBox,u?u.layoutBox:void 0)}updateScroll(u="measure"){let h=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===u&&(h=!1),h&&this.instance){const m=s(this.instance);this.scroll={animationId:this.root.animationId,phase:u,isRoot:m,offset:i(this.instance),wasRoot:this.scroll?this.scroll.isRoot:m}}}resetTransform(){if(!a)return;const u=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,h=this.projectionDelta&&!xC(this.projectionDelta),m=this.getTransformTemplate(),f=m?m(this.latestValues,""):void 0,p=f!==this.prevTransformTemplateValue;u&&this.instance&&(h||ja(this.latestValues)||p)&&(a(this.instance,f),this.shouldResetTransform=!1,this.scheduleRender())}measure(u=!0){const h=this.measurePageBox();let m=this.removeElementScroll(h);return u&&(m=this.removeTransform(m)),iO(m),{animationId:this.root.animationId,measuredBox:h,layoutBox:m,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:u}=this.options;if(!u)return fi();const h=u.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(nO))){const{scroll:f}=this.root;f&&(Ss(h.x,f.offset.x),Ss(h.y,f.offset.y))}return h}removeElementScroll(u){const h=fi();if(ss(h,u),this.scroll?.wasRoot)return h;for(let m=0;m<this.path.length;m++){const f=this.path[m],{scroll:p,options:b}=f;f!==this.root&&p&&b.layoutScroll&&(p.wasRoot&&ss(h,u),Ss(h.x,p.offset.x),Ss(h.y,p.offset.y))}return h}applyTransform(u,h=!1,m){const f=m||fi();ss(f,u);for(let p=0;p<this.path.length;p++){const b=this.path[p];!h&&b.options.layoutScroll&&b.scroll&&b!==b.root&&(Ss(f.x,-b.scroll.offset.x),Ss(f.y,-b.scroll.offset.y)),ja(b.latestValues)&&Qd(f,b.latestValues,b.layout?.layoutBox)}return ja(this.latestValues)&&Qd(f,this.latestValues,this.layout?.layoutBox),f}removeTransform(u){const h=fi();ss(h,u);for(let m=0;m<this.path.length;m++){const f=this.path[m];if(!ja(f.latestValues))continue;let p;f.instance&&(t0(f.latestValues)&&f.updateSnapshot(),p=fi(),ss(p,f.measurePageBox())),Xy(h,f.latestValues,f.snapshot?.layoutBox,p)}return ja(this.latestValues)&&Xy(h,this.latestValues),h}setTargetDelta(u){this.targetDelta=u,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(u){this.options={...this.options,...u,crossfade:u.crossfade!==void 0?u.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!==Mi.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(u=!1){const h=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=h.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=h.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=h.isSharedProjectionDirty);const m=!!this.resumingFrom||this!==h;if(!(u||m&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:p,layoutId:b}=this.options;if(!this.layout||!(p||b))return;this.resolvedRelativeTargetAt=Mi.timestamp;const _=this.getClosestProjectingParent();_&&this.linkedParentVersion!==_.layoutVersion&&!_.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&_&&_.layout?this.createRelativeTarget(_,this.layout.layoutBox,_.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=fi(),this.targetWithTransforms=fi()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),kD(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):ss(this.target,this.layout.layoutBox),lC(this.target,this.targetDelta)):ss(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&_&&!!_.resumingFrom==!!this.resumingFrom&&!_.options.layoutScroll&&_.target&&this.animationProgress!==1?this.createRelativeTarget(_,this.target,_.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||t0(this.parent.latestValues)||oC(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(u,h,m){this.relativeParent=u,this.linkedParentVersion=u.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=fi(),this.relativeTargetOrigin=fi(),gh(this.relativeTargetOrigin,h,m,this.options.layoutAnchor||void 0),ss(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const u=this.getLead(),h=!!this.resumingFrom||this!==u;let m=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(m=!1),h&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(m=!1),this.resolvedRelativeTargetAt===Mi.timestamp&&(m=!1),m)return;const{layout:f,layoutId:p}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(f||p))return;ss(this.layoutCorrected,this.layout.layoutBox);const b=this.treeScale.x,_=this.treeScale.y;J8(this.layoutCorrected,this.treeScale,this.path,h),u.layout&&!u.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(u.target=u.layout.layoutBox,u.targetWithTransforms=fi());const{target:x}=u;if(!x){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Vy(this.prevProjectionDelta.x,this.projectionDelta.x),Vy(this.prevProjectionDelta.y,this.projectionDelta.y)),Dc(this.projectionDelta,this.layoutCorrected,x,this.latestValues),(this.treeScale.x!==b||this.treeScale.y!==_||!tS(this.projectionDelta.x,this.prevProjectionDelta.x)||!tS(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",x))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(u=!0){if(this.options.visualElement?.scheduleRender(),u){const h=this.getStack();h&&h.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Wo(),this.projectionDelta=Wo(),this.projectionDeltaWithTransform=Wo()}setAnimationOrigin(u,h=!1){const m=this.snapshot,f=m?m.latestValues:{},p={...this.latestValues},b=Wo();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!h;const _=fi(),x=m?m.source:void 0,y=this.layout?this.layout.source:void 0,S=x!==y,E=this.getStack(),C=!E||E.members.length<=1,A=!!(S&&!C&&this.options.crossfade===!0&&!this.path.some(eO));this.animationProgress=0;let N;this.mixTargetDelta=M=>{const D=M/1e3;lS(b.x,u.x,D),lS(b.y,u.y,D),this.setTargetDelta(b),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(gh(_,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),JD(this.relativeTarget,this.relativeTargetOrigin,_,D),N&&TD(this.relativeTarget,N)&&(this.isProjectionDirty=!1),N||(N=fi()),ss(N,this.relativeTarget)),S&&(this.animationValues=p,RD(p,f,this.latestValues,D,A,C)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=D},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(u){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(ia(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Et.update(()=>{eh.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=el(0)),this.motionValue.jump(0,!1),this.currentAnimation=OD(this.motionValue,[0,1e3],{...u,velocity:0,isSync:!0,onUpdate:h=>{this.mixTargetDelta(h),u.onUpdate&&u.onUpdate(h)},onStop:()=>{},onComplete:()=>{u.onComplete&&u.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 u=this.getStack();u&&u.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(PD),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const u=this.getLead();let{targetWithTransforms:h,target:m,layout:f,latestValues:p}=u;if(!(!h||!m||!f)){if(this!==u&&this.layout&&f&&CC(this.options.animationType,this.layout.layoutBox,f.layoutBox)){m=this.target||fi();const b=Qi(this.layout.layoutBox.x);m.x.min=u.target.x.min,m.x.max=m.x.min+b;const _=Qi(this.layout.layoutBox.y);m.y.min=u.target.y.min,m.y.max=m.y.min+_}ss(h,m),Qd(h,p),Dc(this.projectionDeltaWithTransform,this.layoutCorrected,h,p)}}registerSharedNode(u,h){this.sharedNodes.has(u)||this.sharedNodes.set(u,new ID),this.sharedNodes.get(u).add(h);const f=h.options.initialPromotionConfig;h.promote({transition:f?f.transition:void 0,preserveFollowOpacity:f&&f.shouldPreserveFollowOpacity?f.shouldPreserveFollowOpacity(h):void 0})}isLead(){const u=this.getStack();return u?u.lead===this:!0}getLead(){const{layoutId:u}=this.options;return u?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:u}=this.options;return u?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:u}=this.options;if(u)return this.root.sharedNodes.get(u)}promote({needsReset:u,transition:h,preserveFollowOpacity:m}={}){const f=this.getStack();f&&f.promote(this,m),u&&(this.projectionDelta=void 0,this.needsReset=!0),h&&this.setOptions({transition:h})}relegate(){const u=this.getStack();return u?u.relegate(this):!1}resetSkewAndRotation(){const{visualElement:u}=this.options;if(!u)return;let h=!1;const{latestValues:m}=u;if((m.z||m.rotate||m.rotateX||m.rotateY||m.rotateZ||m.skewX||m.skewY)&&(h=!0),!h)return;const f={};m.z&&yp("z",u,f,this.animationValues);for(let p=0;p<xp.length;p++)yp(`rotate${xp[p]}`,u,f,this.animationValues),yp(`skew${xp[p]}`,u,f,this.animationValues);u.render();for(const p in f)u.setStaticValue(p,f[p]),this.animationValues&&(this.animationValues[p]=f[p]);u.scheduleRender()}applyProjectionStyles(u,h){if(!this.instance||this.isSVG)return;if(!this.isVisible){u.visibility="hidden";return}const m=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,u.visibility="",u.opacity="",u.pointerEvents=Jd(h?.pointerEvents)||"",u.transform=m?m(this.latestValues,""):"none";return}const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){this.options.layoutId&&(u.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,u.pointerEvents=Jd(h?.pointerEvents)||""),this.hasProjected&&!ja(this.latestValues)&&(u.transform=m?m({},""):"none",this.hasProjected=!1);return}u.visibility="";const p=f.animationValues||f.latestValues;this.applyTransformsToTarget();let b=AD(this.projectionDeltaWithTransform,this.treeScale,p);m&&(b=m(p,b)),u.transform=b;const{x:_,y:x}=this.projectionDelta;u.transformOrigin=`${_.origin*100}% ${x.origin*100}% 0`,f.animationValues?u.opacity=f===this?p.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:p.opacityExit:u.opacity=f===this?p.opacity!==void 0?p.opacity:"":p.opacityExit!==void 0?p.opacityExit:0;for(const y in n0){if(p[y]===void 0)continue;const{correct:S,applyTo:E,isCSSVariable:C}=n0[y],A=b==="none"?p[y]:S(p[y],f);if(E){const N=E.length;for(let M=0;M<N;M++)u[E[M]]=A}else C?this.options.visualElement.renderState.vars[y]=A:u[y]=A}this.options.layoutId&&(u.pointerEvents=f===this?Jd(h?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(u=>u.currentAnimation?.stop()),this.root.nodes.forEach(rS),this.root.sharedNodes.clear()}}}function UD(e){e.updateLayout()}function HD(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:s}=e.layout,{animationType:a}=e.options,o=t.source!==e.layout.source;if(a==="size")ys(p=>{const b=o?t.measuredBox[p]:t.layoutBox[p],_=Qi(b);b.min=i[p].min,b.max=b.min+_});else if(a==="x"||a==="y"){const p=a==="x"?"y":"x";s0(o?t.measuredBox[p]:t.layoutBox[p],i[p])}else CC(a,t.layoutBox,i)&&ys(p=>{const b=o?t.measuredBox[p]:t.layoutBox[p],_=Qi(i[p]);b.max=b.min+_,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[p].max=e.relativeTarget[p].min+_)});const u=Wo();Dc(u,i,t.layoutBox);const h=Wo();o?Dc(h,e.applyTransform(s,!0),t.measuredBox):Dc(h,i,t.layoutBox);const m=!xC(u);let f=!1;if(!e.resumeFrom){const p=e.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:b,layout:_}=p;if(b&&_){const x=e.options.layoutAnchor||void 0,y=fi();gh(y,t.layoutBox,b.layoutBox,x);const S=fi();gh(S,i,_.layoutBox,x),yC(y,S)||(f=!0),p.options.layoutRoot&&(e.relativeTarget=S,e.relativeTargetOrigin=y,e.relativeParent=p)}}}e.notifyListeners("didUpdate",{layout:i,snapshot:t,delta:h,layoutDelta:u,hasLayoutChanged:m,hasRelativeLayoutChanged:f})}else if(e.isLead()){const{onExitComplete:i}=e.options;i&&i()}e.options.transition=void 0}function FD(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 VD(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function qD(e){e.clearSnapshot()}function rS(e){e.clearMeasurements()}function KD(e){e.isLayoutDirty=!0,e.updateLayout()}function aS(e){e.isLayoutDirty=!1}function GD(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function WD(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function oS(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function YD(e){e.resolveTargetDelta()}function XD(e){e.calcProjection()}function ZD(e){e.resetSkewAndRotation()}function QD(e){e.removeLeadSnapshot()}function lS(e,t,i){e.translate=Rt(t.translate,0,i),e.scale=Rt(t.scale,1,i),e.origin=t.origin,e.originPoint=t.originPoint}function cS(e,t,i,s){e.min=Rt(t.min,i.min,s),e.max=Rt(t.max,i.max,s)}function JD(e,t,i,s){cS(e.x,t.x,i.x,s),cS(e.y,t.y,i.y,s)}function eO(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const tO={duration:.45,ease:[.4,0,.1,1]},uS=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),dS=uS("applewebkit/")&&!uS("chrome/")?Math.round:Kn;function hS(e){e.min=dS(e.min),e.max=dS(e.max)}function iO(e){hS(e.x),hS(e.y)}function CC(e,t,i){return e==="position"||e==="preserve-aspect"&&!wD(eS(t),eS(i),.2)}function nO(e){return e!==e.root&&e.scroll?.wasRoot}const sO=EC({attachResizeListener:(e,t)=>Fc(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Sp={current:void 0},NC=EC({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Sp.current){const e=new sO({});e.mount(window),e.setOptions({layoutScroll:!0}),Sp.current=e}return Sp.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),TC=k.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function rO(e=!0){const t=k.useContext(cb);if(t===null)return[!0,null];const{isPresent:i,onExitComplete:s,register:a}=t,o=k.useId();k.useEffect(()=>{if(e)return a(o)},[e]);const u=k.useCallback(()=>e&&s&&s(o),[o,s,e]);return!i&&s?[!1,u]:[!0]}const AC=k.createContext({strict:!1}),fS={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 mS=!1;function aO(){if(mS)return;const e={};for(const t in fS)e[t]={isEnabled:i=>fS[t].some(s=>!!i[s])};sC(e),mS=!0}function MC(){return aO(),Y8()}function oO(e){const t=MC();for(const i in e)t[i]={...t[i],...e[i]};sC(t)}const lO=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 bh(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||lO.has(e)}let RC=e=>!bh(e);function cO(e){typeof e=="function"&&(RC=t=>t.startsWith("on")?!bh(t):e(t))}try{cO(require("@emotion/is-prop-valid").default)}catch{}function uO(e,t,i){const s={};for(const a in e)a==="values"&&typeof e.values=="object"||ji(e[a])||(RC(a)||i===!0&&bh(a)||!t&&!bh(a)||e.draggable&&a.startsWith("onDrag"))&&(s[a]=e[a]);return s}const Gh=k.createContext({});function dO(e,t){if(Kh(e)){const{initial:i,animate:s}=e;return{initial:i===!1||Hc(i)?i:void 0,animate:Hc(s)?s:void 0}}return e.inherit!==!1?t:{}}function hO(e){const{initial:t,animate:i}=dO(e,k.useContext(Gh));return k.useMemo(()=>({initial:t,animate:i}),[pS(t),pS(i)])}function pS(e){return Array.isArray(e)?e.join(" "):e}const Ob=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function jC(e,t,i){for(const s in t)!ji(t[s])&&!dC(s,i)&&(e[s]=t[s])}function fO({transformTemplate:e},t){return k.useMemo(()=>{const i=Ob();return jb(i,t,e),Object.assign({},i.vars,i.style)},[t])}function mO(e,t){const i=e.style||{},s={};return jC(s,i,e),Object.assign(s,fO(e,t)),s}function pO(e,t){const i={},s=mO(e,t);return e.drag&&e.dragListener!==!1&&(i.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(i.tabIndex=0),i.style=s,i}const DC=()=>({...Ob(),attrs:{}});function gO(e,t,i,s){const a=k.useMemo(()=>{const o=DC();return hC(o,t,mC(s),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};jC(o,e.style,e),a.style={...o,...a.style}}return a}const bO=["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 Lb(e){return typeof e!="string"||e.includes("-")?!1:!!(bO.indexOf(e)>-1||/[A-Z]/u.test(e))}function vO(e,t,i,{latestValues:s},a,o=!1,u){const m=(u??Lb(e)?gO:pO)(t,s,a,e),f=uO(t,typeof e=="string",o),p=e!==k.Fragment?{...f,...m,ref:i}:{},{children:b}=t,_=k.useMemo(()=>ji(b)?b.get():b,[b]);return k.createElement(e,{...p,children:_})}function _O({scrapeMotionValuesFromProps:e,createRenderState:t},i,s,a){return{latestValues:xO(i,s,a,e),renderState:t()}}function xO(e,t,i,s){const a={},o=s(e,{});for(const _ in o)a[_]=Jd(o[_]);let{initial:u,animate:h}=e;const m=Kh(e),f=iC(e);t&&f&&!m&&e.inherit!==!1&&(u===void 0&&(u=t.initial),h===void 0&&(h=t.animate));let p=i?i.initial===!1:!1;p=p||u===!1;const b=p?h:u;if(b&&typeof b!="boolean"&&!qh(b)){const _=Array.isArray(b)?b:[b];for(let x=0;x<_.length;x++){const y=kb(e,_[x]);if(y){const{transitionEnd:S,transition:E,...C}=y;for(const A in C){let N=C[A];if(Array.isArray(N)){const M=p?N.length-1:0;N=N[M]}N!==null&&(a[A]=N)}for(const A in S)a[A]=S[A]}}}return a}const OC=e=>(t,i)=>{const s=k.useContext(Gh),a=k.useContext(cb),o=()=>_O(e,t,s,a);return i?o():bR(o)},yO=OC({scrapeMotionValuesFromProps:Db,createRenderState:Ob}),SO=OC({scrapeMotionValuesFromProps:pC,createRenderState:DC}),wO=Symbol.for("motionComponentSymbol");function kO(e,t,i){const s=k.useRef(i);k.useInsertionEffect(()=>{s.current=i});const a=k.useRef(null);return k.useCallback(o=>{o&&e.onMount?.(o);const u=s.current;if(typeof u=="function")if(o){const h=u(o);typeof h=="function"&&(a.current=h)}else a.current?(a.current(),a.current=null):u(o);else u&&(u.current=o);t&&(o?t.mount(o):t.unmount())},[t])}const LC=k.createContext({});function Vo(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function EO(e,t,i,s,a,o){const{visualElement:u}=k.useContext(Gh),h=k.useContext(AC),m=k.useContext(cb),f=k.useContext(TC),p=f.reducedMotion,b=f.skipAnimations,_=k.useRef(null),x=k.useRef(!1);s=s||h.renderer,!_.current&&s&&(_.current=s(e,{visualState:t,parent:u,props:i,presenceContext:m,blockInitialAnimation:m?m.initial===!1:!1,reducedMotionConfig:p,skipAnimations:b,isSVG:o}),x.current&&_.current&&(_.current.manuallyAnimateOnMount=!0));const y=_.current,S=k.useContext(LC);y&&!y.projection&&a&&(y.type==="html"||y.type==="svg")&&CO(_.current,i,a,S);const E=k.useRef(!1);k.useInsertionEffect(()=>{y&&E.current&&y.update(i,m)});const C=i[FE],A=k.useRef(!!C&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(C)&&window.MotionHasOptimisedAnimation?.(C));return _R(()=>{x.current=!0,y&&(E.current=!0,window.MotionIsMounted=!0,y.updateFeatures(),y.scheduleRenderMicrotask(),A.current&&y.animationState&&y.animationState.animateChanges())}),k.useEffect(()=>{y&&(!A.current&&y.animationState&&y.animationState.animateChanges(),A.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(C)}),A.current=!1),y.enteringChildren=void 0)}),y}function CO(e,t,i,s){const{layoutId:a,layout:o,drag:u,dragConstraints:h,layoutScroll:m,layoutRoot:f,layoutAnchor:p,layoutCrossfade:b}=t;e.projection=new i(e.latestValues,t["data-framer-portal-id"]?void 0:BC(e.parent)),e.projection.setOptions({layoutId:a,layout:o,alwaysMeasureLayout:!!u||h&&Vo(h),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:s,crossfade:b,layoutScroll:m,layoutRoot:f,layoutAnchor:p})}function BC(e){if(e)return e.options.allowProjection!==!1?e.projection:BC(e.parent)}function wp(e,{forwardMotionProps:t=!1,type:i}={},s,a){s&&oO(s);const o=i?i==="svg":Lb(e),u=o?SO:yO;function h(f,p){let b;const _={...k.useContext(TC),...f,layoutId:NO(f)},{isStatic:x}=_,y=hO(f),S=u(f,x);if(!x&&typeof window<"u"){TO();const E=AO(_);b=E.MeasureLayout,y.visualElement=EO(e,S,_,a,E.ProjectionNode,o)}return c.jsxs(Gh.Provider,{value:y,children:[b&&y.visualElement?c.jsx(b,{visualElement:y.visualElement,..._}):null,vO(e,f,kO(S,y.visualElement,p),S,x,t,o)]})}h.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const m=k.forwardRef(h);return m[wO]=e,m}function NO({layoutId:e}){const t=k.useContext(tE).id;return t&&e!==void 0?t+"-"+e:e}function TO(e,t){k.useContext(AC).strict}function AO(e){const t=MC(),{drag:i,layout:s}=t;if(!i&&!s)return{};const a={...i,...s};return{MeasureLayout:i?.isEnabled(e)||s?.isEnabled(e)?a.MeasureLayout:void 0,ProjectionNode:a.ProjectionNode}}function MO(e,t){if(typeof Proxy>"u")return wp;const i=new Map,s=(o,u)=>wp(o,u,e,t),a=(o,u)=>s(o,u);return new Proxy(a,{get:(o,u)=>u==="create"?s:(i.has(u)||i.set(u,wp(u,void 0,e,t)),i.get(u))})}const RO=(e,t)=>t.isSVG??Lb(e)?new hD(t):new aD(t,{allowProjection:e!==k.Fragment});class jO extends aa{constructor(t){super(t),t.animationState||(t.animationState=bD(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();qh(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:i}=this.node.prevProps||{};t!==i&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let DO=0;class OO extends aa{constructor(){super(...arguments),this.id=DO++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:i}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;if(t&&s===!1){if(this.isExitComplete){const{initial:o,custom:u}=this.node.getProps();if(typeof o=="string"){const h=Ua(this.node,o,u);if(h){const{transition:m,transitionEnd:f,...p}=h;for(const b in p)this.node.getValue(b)?.jump(p[b])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const a=this.node.animationState.setActive("exit",!t);i&&!t&&a.then(()=>{this.isExitComplete=!0,i(this.id)})}mount(){const{register:t,onExitComplete:i}=this.node.presenceContext||{};i&&i(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const LO={animation:{Feature:jO},exit:{Feature:OO}};function iu(e){return{point:{x:e.pageX,y:e.pageY}}}const BO=e=>t=>Tb(t)&&e(t,iu(t));function Oc(e,t,i,s){return Fc(e,t,BO(i),s)}const zC=({current:e})=>e?e.ownerDocument.defaultView:null,gS=(e,t)=>Math.abs(e-t);function zO(e,t){const i=gS(e.x,t.x),s=gS(e.y,t.y);return Math.sqrt(i**2+s**2)}const bS=new Set(["auto","scroll"]);class IC{constructor(t,i,{transformPagePoint:s,contextWindow:a=window,dragSnapToOrigin:o=!1,distanceThreshold:u=3,element:h}={}){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=x=>{this.handleScroll(x.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Md(this.lastRawMoveEventInfo,this.transformPagePoint));const x=kp(this.lastMoveEventInfo,this.history),y=this.startEvent!==null,S=zO(x.offset,{x:0,y:0})>=this.distanceThreshold;if(!y&&!S)return;const{point:E}=x,{timestamp:C}=Mi;this.history.push({...E,timestamp:C});const{onStart:A,onMove:N}=this.handlers;y||(A&&A(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),N&&N(this.lastMoveEvent,x)},this.handlePointerMove=(x,y)=>{this.lastMoveEvent=x,this.lastRawMoveEventInfo=y,this.lastMoveEventInfo=Md(y,this.transformPagePoint),Et.update(this.updatePoint,!0)},this.handlePointerUp=(x,y)=>{this.end();const{onEnd:S,onSessionEnd:E,resumeAnimation:C}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&C&&C(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const A=kp(x.type==="pointercancel"?this.lastMoveEventInfo:Md(y,this.transformPagePoint),this.history);this.startEvent&&S&&S(x,A),E&&E(x,A)},!Tb(t))return;this.dragSnapToOrigin=o,this.handlers=i,this.transformPagePoint=s,this.distanceThreshold=u,this.contextWindow=a||window;const m=iu(t),f=Md(m,this.transformPagePoint),{point:p}=f,{timestamp:b}=Mi;this.history=[{...p,timestamp:b}];const{onSessionStart:_}=i;_&&_(t,kp(f,this.history)),this.removeListeners=Jc(Oc(this.contextWindow,"pointermove",this.handlePointerMove),Oc(this.contextWindow,"pointerup",this.handlePointerUp),Oc(this.contextWindow,"pointercancel",this.handlePointerUp)),h&&this.startScrollTracking(h)}startScrollTracking(t){let i=t.parentElement;for(;i;){const s=getComputedStyle(i);(bS.has(s.overflowX)||bS.has(s.overflowY))&&this.scrollPositions.set(i,{x:i.scrollLeft,y:i.scrollTop}),i=i.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 i=this.scrollPositions.get(t);if(!i)return;const s=t===window,a=s?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},o={x:a.x-i.x,y:a.y-i.y};o.x===0&&o.y===0||(s?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o.x,this.lastMoveEventInfo.point.y+=o.y):this.history.length>0&&(this.history[0].x-=o.x,this.history[0].y-=o.y),this.scrollPositions.set(t,a),Et.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ia(this.updatePoint)}}function Md(e,t){return t?{point:t(e.point)}:e}function vS(e,t){return{x:e.x-t.x,y:e.y-t.y}}function kp({point:e},t){return{point:e,delta:vS(e,PC(t)),offset:vS(e,IO(t)),velocity:PO(t,.1)}}function IO(e){return e[0]}function PC(e){return e[e.length-1]}function PO(e,t){if(e.length<2)return{x:0,y:0};let i=e.length-1,s=null;const a=PC(e);for(;i>=0&&(s=e[i],!(a.timestamp-s.timestamp>An(t)));)i--;if(!s)return{x:0,y:0};s===e[0]&&e.length>2&&a.timestamp-s.timestamp>An(t)*2&&(s=e[1]);const o=qn(a.timestamp-s.timestamp);if(o===0)return{x:0,y:0};const u={x:(a.x-s.x)/o,y:(a.y-s.y)/o};return u.x===1/0&&(u.x=0),u.y===1/0&&(u.y=0),u}function $O(e,{min:t,max:i},s){return t!==void 0&&e<t?e=s?Rt(t,e,s.min):Math.max(e,t):i!==void 0&&e>i&&(e=s?Rt(i,e,s.max):Math.min(e,i)),e}function _S(e,t,i){return{min:t!==void 0?e.min+t:void 0,max:i!==void 0?e.max+i-(e.max-e.min):void 0}}function UO(e,{top:t,left:i,bottom:s,right:a}){return{x:_S(e.x,i,a),y:_S(e.y,t,s)}}function xS(e,t){let i=t.min-e.min,s=t.max-e.max;return t.max-t.min<e.max-e.min&&([i,s]=[s,i]),{min:i,max:s}}function HO(e,t){return{x:xS(e.x,t.x),y:xS(e.y,t.y)}}function FO(e,t){let i=.5;const s=Qi(e),a=Qi(t);return a>s?i=$c(t.min,t.max-s,e.min):s>a&&(i=$c(e.min,e.max-a,t.min)),Ns(0,1,i)}function VO(e,t){const i={};return t.min!==void 0&&(i.min=t.min-e.min),t.max!==void 0&&(i.max=t.max-e.min),i}const r0=.35;function qO(e=r0){return e===!1?e=0:e===!0&&(e=r0),{x:yS(e,"left","right"),y:yS(e,"top","bottom")}}function yS(e,t,i){return{min:SS(e,t),max:SS(e,i)}}function SS(e,t){return typeof e=="number"?e:e[t]||0}const KO=new WeakMap;class GO{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=fi(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:i=!1,distanceThreshold:s}={}){const{presenceContext:a}=this.visualElement;if(a&&a.isPresent===!1)return;const o=b=>{i&&this.snapToCursor(iu(b).point),this.stopAnimation()},u=(b,_)=>{const{drag:x,dragPropagation:y,onDragStart:S}=this.getProps();if(x&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=E8(x),!this.openDragLock))return;this.latestPointerEvent=b,this.latestPanInfo=_,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ys(C=>{let A=this.getAxisMotionValue(C).get()||0;if(ks.test(A)){const{projection:N}=this.visualElement;if(N&&N.layout){const M=N.layout.layoutBox[C];M&&(A=Qi(M)*(parseFloat(A)/100))}}this.originPoint[C]=A}),S&&Et.update(()=>S(b,_),!1,!0),Xg(this.visualElement,"transform");const{animationState:E}=this.visualElement;E&&E.setActive("whileDrag",!0)},h=(b,_)=>{this.latestPointerEvent=b,this.latestPanInfo=_;const{dragPropagation:x,dragDirectionLock:y,onDirectionLock:S,onDrag:E}=this.getProps();if(!x&&!this.openDragLock)return;const{offset:C}=_;if(y&&this.currentDirection===null){this.currentDirection=YO(C),this.currentDirection!==null&&S&&S(this.currentDirection);return}this.updateAxis("x",_.point,C),this.updateAxis("y",_.point,C),this.visualElement.render(),E&&Et.update(()=>E(b,_),!1,!0)},m=(b,_)=>{this.latestPointerEvent=b,this.latestPanInfo=_,this.stop(b,_),this.latestPointerEvent=null,this.latestPanInfo=null},f=()=>{const{dragSnapToOrigin:b}=this.getProps();(b||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:p}=this.getProps();this.panSession=new IC(t,{onSessionStart:o,onStart:u,onMove:h,onSessionEnd:m,resumeAnimation:f},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:p,distanceThreshold:s,contextWindow:zC(this.visualElement),element:this.visualElement.current})}stop(t,i){const s=t||this.latestPointerEvent,a=i||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!a||!s)return;const{velocity:u}=a;this.startAnimation(u);const{onDragEnd:h}=this.getProps();h&&Et.postRender(()=>h(s,a))}cancel(){this.isDragging=!1;const{projection:t,animationState:i}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),i&&i.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,i,s){const{drag:a}=this.getProps();if(!s||!Rd(t,a,this.currentDirection))return;const o=this.getAxisMotionValue(t);let u=this.originPoint[t]+s[t];this.constraints&&this.constraints[t]&&(u=$O(u,this.constraints[t],this.elastic[t])),o.set(u)}resolveConstraints(){const{dragConstraints:t,dragElastic:i}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,a=this.constraints;t&&Vo(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&s?this.constraints=UO(s.layoutBox,t):this.constraints=!1,this.elastic=qO(i),a!==this.constraints&&!Vo(t)&&s&&this.constraints&&!this.hasMutatedConstraints&&ys(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=VO(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:i}=this.getProps();if(!t||!Vo(t))return!1;const s=t.current,{projection:a}=this.visualElement;if(!a||!a.layout)return!1;const o=eD(s,a.root,this.visualElement.getTransformPagePoint());let u=HO(a.layout.layoutBox,o);if(i){const h=i(Z8(u));this.hasMutatedConstraints=!!h,h&&(u=aC(h))}return u}startAnimation(t){const{drag:i,dragMomentum:s,dragElastic:a,dragTransition:o,dragSnapToOrigin:u,onDragTransitionEnd:h}=this.getProps(),m=this.constraints||{},f=ys(p=>{if(!Rd(p,i,this.currentDirection))return;let b=m&&m[p]||{};(u===!0||u===p)&&(b={min:0,max:0});const _=a?200:1e6,x=a?40:1e7,y={type:"inertia",velocity:s?t[p]:0,bounceStiffness:_,bounceDamping:x,timeConstant:750,restDelta:1,restSpeed:10,...o,...b};return this.startAxisValueAnimation(p,y)});return Promise.all(f).then(h)}startAxisValueAnimation(t,i){const s=this.getAxisMotionValue(t);return Xg(this.visualElement,t),s.start(wb(t,s,0,i,this.visualElement,!1))}stopAnimation(){ys(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const i=`_drag${t.toUpperCase()}`,s=this.visualElement.getProps(),a=s[i];return a||this.visualElement.getValue(t,(s.initial?s.initial[t]:void 0)||0)}snapToCursor(t){ys(i=>{const{drag:s}=this.getProps();if(!Rd(i,s,this.currentDirection))return;const{projection:a}=this.visualElement,o=this.getAxisMotionValue(i);if(a&&a.layout){const{min:u,max:h}=a.layout.layoutBox[i],m=o.get()||0;o.set(t[i]-Rt(u,h,.5)+m)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:i}=this.getProps(),{projection:s}=this.visualElement;if(!Vo(i)||!s||!this.constraints)return;this.stopAnimation();const a={x:0,y:0};ys(u=>{const h=this.getAxisMotionValue(u);if(h&&this.constraints!==!1){const m=h.get();a[u]=FO({min:m,max:m},this.constraints[u])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.constraints=!1,this.resolveConstraints(),ys(u=>{if(!Rd(u,t,null))return;const h=this.getAxisMotionValue(u),{min:m,max:f}=this.constraints[u];h.set(Rt(m,f,a[u]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;KO.set(this.visualElement,this);const t=this.visualElement.current,i=Oc(t,"pointerdown",f=>{const{drag:p,dragListener:b=!0}=this.getProps(),_=f.target,x=_!==t&&R8(_);p&&b&&!x&&this.start(f)});let s;const a=()=>{const{dragConstraints:f}=this.getProps();Vo(f)&&f.current&&(this.constraints=this.resolveRefConstraints(),s||(s=WO(t,f.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,u=o.addEventListener("measure",a);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),Et.read(a);const h=Fc(window,"resize",()=>this.scalePositionWithinConstraints()),m=o.addEventListener("didUpdate",(({delta:f,hasLayoutChanged:p})=>{this.isDragging&&p&&(ys(b=>{const _=this.getAxisMotionValue(b);_&&(this.originPoint[b]+=f[b].translate,_.set(_.get()+f[b].translate))}),this.visualElement.render())}));return()=>{h(),i(),u(),m&&m(),s&&s()}}getProps(){const t=this.visualElement.getProps(),{drag:i=!1,dragDirectionLock:s=!1,dragPropagation:a=!1,dragConstraints:o=!1,dragElastic:u=r0,dragMomentum:h=!0}=t;return{...t,drag:i,dragDirectionLock:s,dragPropagation:a,dragConstraints:o,dragElastic:u,dragMomentum:h}}}function wS(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function WO(e,t,i){const s=jy(e,wS(i)),a=jy(t,wS(i));return()=>{s(),a()}}function Rd(e,t,i){return(t===!0||t===e)&&(i===null||i===e)}function YO(e,t=10){let i=null;return Math.abs(e.y)>t?i="y":Math.abs(e.x)>t&&(i="x"),i}class XO extends aa{constructor(t){super(t),this.removeGroupControls=Kn,this.removeListeners=Kn,this.controls=new GO(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Kn}update(){const{dragControls:t}=this.node.getProps(),{dragControls:i}=this.node.prevProps||{};t!==i&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Ep=e=>(t,i)=>{e&&Et.update(()=>e(t,i),!1,!0)};class ZO extends aa{constructor(){super(...arguments),this.removePointerDownListener=Kn}onPointerDown(t){this.session=new IC(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:zC(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:i,onPan:s,onPanEnd:a}=this.node.getProps();return{onSessionStart:Ep(t),onStart:Ep(i),onMove:Ep(s),onEnd:(o,u)=>{delete this.session,a&&Et.postRender(()=>a(o,u))}}}mount(){this.removePointerDownListener=Oc(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 Cp=!1;class QO extends k.Component{componentDidMount(){const{visualElement:t,layoutGroup:i,switchLayoutGroup:s,layoutId:a}=this.props,{projection:o}=t;o&&(i.group&&i.group.add(o),s&&s.register&&a&&s.register(o),Cp&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),eh.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:i,visualElement:s,drag:a,isPresent:o}=this.props,{projection:u}=s;return u&&(u.isPresent=o,t.layoutDependency!==i&&u.setOptions({...u.options,layoutDependency:i}),Cp=!0,a||t.layoutDependency!==i||i===void 0||t.isPresent!==o?u.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?u.promote():u.relegate()||Et.postRender(()=>{const h=u.getStack();(!h||!h.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:i}=this.props,{projection:s}=t;s&&(s.options.layoutAnchor=i,s.root.didUpdate(),Nb.postRender(()=>{!s.currentAnimation&&s.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:i,switchLayoutGroup:s}=this.props,{projection:a}=t;Cp=!0,a&&(a.scheduleCheckAfterUnmount(),i&&i.group&&i.group.remove(a),s&&s.deregister&&s.deregister(a))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function $C(e){const[t,i]=rO(),s=k.useContext(tE);return c.jsx(QO,{...e,layoutGroup:s,switchLayoutGroup:k.useContext(LC),isPresent:t,safeToRemove:i})}const JO={pan:{Feature:ZO},drag:{Feature:XO,ProjectionNode:NC,MeasureLayout:$C}};function kS(e,t,i){const{props:s}=e;e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",i==="Start");const a="onHover"+i,o=s[a];o&&Et.postRender(()=>o(t,iu(t)))}class eL extends aa{mount(){const{current:t}=this.node;t&&(this.unmount=N8(t,(i,s)=>(kS(this.node,s,"Start"),a=>kS(this.node,a,"End"))))}unmount(){}}class tL extends aa{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=Jc(Fc(this.node.current,"focus",()=>this.onFocus()),Fc(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function ES(e,t,i){const{props:s}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&s.whileTap&&e.animationState.setActive("whileTap",i==="Start");const a="onTap"+(i==="End"?"":i),o=s[a];o&&Et.postRender(()=>o(t,iu(t)))}class iL extends aa{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:i,propagate:s}=this.node.props;this.unmount=D8(t,(a,o)=>(ES(this.node,o,"Start"),(u,{success:h})=>ES(this.node,u,h?"End":"Cancel")),{useGlobalTarget:i,stopPropagation:s?.tap===!1})}unmount(){}}const a0=new WeakMap,Np=new WeakMap,nL=e=>{const t=a0.get(e.target);t&&t(e)},sL=e=>{e.forEach(nL)};function rL({root:e,...t}){const i=e||document;Np.has(i)||Np.set(i,{});const s=Np.get(i),a=JSON.stringify(t);return s[a]||(s[a]=new IntersectionObserver(sL,{root:e,...t})),s[a]}function aL(e,t,i){const s=rL(t);return a0.set(e,i),s.observe(e),()=>{a0.delete(e),s.unobserve(e)}}const oL={some:0,all:1};class lL extends aa{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();const{viewport:t={}}=this.node.getProps(),{root:i,margin:s,amount:a="some",once:o}=t,u={root:i?i.current:void 0,rootMargin:s,threshold:typeof a=="number"?a:oL[a]},h=m=>{const{isIntersecting:f}=m;if(this.isInView===f||(this.isInView=f,o&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:p,onViewportLeave:b}=this.node.getProps(),_=f?p:b;_&&_(m)};this.stopObserver=aL(this.node.current,u,h)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:i}=this.node;["amount","margin","root"].some(cL(t,i))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}}function cL({viewport:e={}},{viewport:t={}}={}){return i=>e[i]!==t[i]}const uL={inView:{Feature:lL},tap:{Feature:iL},focus:{Feature:tL},hover:{Feature:eL}},dL={layout:{ProjectionNode:NC,MeasureLayout:$C}},hL={...LO,...uL,...JO,...dL},Tp=MO(hL,RO),Pe=({label:e,children:t,variant:i="primary",size:s="medium",icon:a,onClick:o,removable:u=!1,className:h,maxWidth:m,appearance:f,onRemove:p,isLoading:b=!1})=>{const _=fL(i),x=f??(i==="outline"?"outline":"solid"),y=e??t,S=!!o,E={primary:{solid:"border border-transparent bg-primary text-primary-foreground dark:border-zinc-700/80 dark:bg-zinc-900/80 dark:text-zinc-100",outline:"border-2 border-primary/60 text-foreground dark:border-zinc-700/80 dark:bg-zinc-900/80 dark:text-zinc-100",subtle:"border border-transparent bg-primary/15 text-foreground dark:border-zinc-700/70 dark:bg-zinc-900/70 dark:text-zinc-200"},secondary:{solid:"border border-transparent bg-secondary text-secondary-foreground dark:border-zinc-700/80 dark:bg-zinc-900/80 dark:text-zinc-200",outline:"border-2 border-border bg-card text-foreground dark:border-zinc-700/80 dark:bg-zinc-900/80 dark:text-zinc-200",subtle:"border border-border bg-muted text-foreground dark:border-zinc-700/70 dark:bg-zinc-900/70 dark:text-zinc-200"},success:{solid:"border border-transparent bg-emerald-600 text-white dark:border-emerald-400/30 dark:bg-emerald-500/15 dark:text-emerald-300",outline:"border-2 border-emerald-600 text-emerald-700 dark:border-emerald-400/40 dark:bg-emerald-500/10 dark:text-emerald-300",subtle:"border border-transparent bg-emerald-500/15 text-emerald-700 dark:border-emerald-400/25 dark:bg-emerald-500/15 dark:text-emerald-300"},warning:{solid:"border border-transparent bg-amber-500 text-white dark:border-amber-400/30 dark:bg-amber-500/15 dark:text-amber-300",outline:"border-2 border-amber-500 text-amber-700 dark:border-amber-400/40 dark:bg-amber-500/10 dark:text-amber-300",subtle:"border border-transparent bg-amber-500/15 text-amber-700 dark:border-amber-400/25 dark:bg-amber-500/15 dark:text-amber-300"},error:{solid:"border border-transparent bg-destructive text-destructive-foreground dark:border-red-400/30 dark:bg-red-500/15 dark:text-red-300",outline:"border-2 border-destructive text-destructive dark:border-red-400/40 dark:bg-red-500/10 dark:text-red-300",subtle:"border border-transparent bg-destructive/20 text-destructive dark:border-red-400/25 dark:bg-red-500/15 dark:text-red-300"}},C={small:"text-xs px-2 py-1",medium:"text-xs px-2.5 py-1",large:"text-sm px-3 py-1.5"},A=M=>{M.stopPropagation(),o?.()},N=M=>{M.stopPropagation(),p?.()};return c.jsxs(Tp.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:S?1.04:1,transition:{duration:.2,ease:"easeInOut",type:"spring"}},onClick:A,style:{maxWidth:m},className:de("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",E[_][x],C[s],S&&"cursor-pointer",h),children:[b?c.jsx(Tp.div,{animate:{rotate:360},transition:{duration:1,ease:"linear",repeat:1/0},className:"flex-shrink-0",children:c.jsx(Oi,{className:"size-3.5"})}):a&&c.jsx("span",{className:"flex-shrink-0",children:a}),c.jsx("span",{className:"min-w-0 truncate",children:y}),u&&c.jsx(Tp.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-foreground/15 p-1 opacity-70 hover:opacity-100",onClick:N,type:"button",children:c.jsx(Ji,{className:"size-3.5"})})]})};function fL(e){return e==="danger"?"error":e==="default"||e==="outline"?"primary":e}const mL=$k("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-destructive/40 bg-destructive/10 text-destructive dark:text-red-300"}},defaultVariants:{variant:"default"}});function dt({className:e,variant:t,...i}){return c.jsx("div",{className:de(mL({variant:t,className:e})),...i})}function vh(e){return de("group/header-action inline-flex h-8 w-8 items-center overflow-hidden rounded-md text-sm font-medium text-muted-foreground transition-[width,background-color,color] duration-200 hover:w-24 hover:bg-muted hover:text-foreground focus:w-24 focus:bg-muted focus:text-foreground focus-visible:w-24 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",e)}function _h(e){return de("flex size-8 shrink-0 items-center justify-center [&_svg]:size-4 [&_svg]:shrink-0",e)}function xh(e){return de("max-w-0 overflow-hidden whitespace-nowrap text-left opacity-0 transition-[max-width,opacity] duration-200 group-hover/header-action:max-w-20 group-hover/header-action:opacity-100 group-focus/header-action:max-w-20 group-focus/header-action:opacity-100",e)}function Ms({className:e,...t}){return c.jsx("div",{className:de("rounded-lg border border-border bg-card text-card-foreground",e),...t})}function Rs({className:e,...t}){return c.jsx("div",{className:de("grid gap-1.5 p-4",e),...t})}function js({className:e,...t}){return c.jsx("h3",{className:de("text-sm font-semibold tracking-tight",e),...t})}function dr({className:e,...t}){return c.jsx("p",{className:de("text-sm text-muted-foreground",e),...t})}function Ds({className:e,...t}){return c.jsx("div",{className:de("p-4 pt-0",e),...t})}const CS=100;function pL(){const[e,t]=k.useState([]),[i,s]=k.useState(!1),a=k.useRef(new Set);k.useEffect(()=>{const u=new EventSource("/api/agent/tool-calls/stream");return u.addEventListener("open",()=>s(!0)),u.addEventListener("error",()=>s(!1)),u.addEventListener("tool-call",h=>{try{const m=JSON.parse(h.data);t(f=>{if(a.current.has(m.id))return f;a.current.add(m.id);const p=[...f,m];return p.length>CS&&p.splice(0,p.length-CS),p})}catch{}}),()=>{u.close()}},[]);const o=[...e].reverse();return c.jsxs(Ms,{className:"min-w-0 rounded-none border-0 border-b border-border bg-transparent",children:[c.jsxs(Rs,{className:"border-b border-border px-3 py-2",children:[c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Pa,{className:"size-4 text-muted-foreground"}),c.jsx(js,{children:"Live MCP Tool Calls"}),c.jsx(Pe,{variant:"outline",size:"small",children:e.length})]}),c.jsx(Pe,{variant:"outline",size:"small",icon:c.jsx("span",{className:de("inline-block size-1.5 rounded-full",i?"animate-pulse bg-emerald-500":"bg-muted-foreground/60")}),children:i?"live":"reconnecting…"})]}),c.jsx(dr,{className:"text-xs",children:"Streamed from this NoMoreIDE MCP server. Newest at the top."})]}),c.jsx(Ds,{className:"p-0",children:o.length?c.jsx("ul",{className:"max-h-96 divide-y divide-border overflow-auto",children:o.map(u=>c.jsxs("li",{className:"px-3 py-2",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:u.tool}),c.jsxs("div",{className:"flex shrink-0 items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[c.jsxs("span",{children:[u.durationMs," ms"]}),c.jsx(Pe,{variant:u.status==="ok"?"success":"error",appearance:"outline",size:"small",children:u.status})]})]}),u.args?c.jsx("div",{className:"mt-0.5 truncate font-mono text-[11px] text-muted-foreground",children:u.args}):null,u.error?c.jsx("div",{className:"mt-0.5 font-mono text-[11px] text-destructive",children:u.error}):null,c.jsx("div",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground/80",children:new Date(u.startedAt).toLocaleTimeString()})]},u.id))}):c.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 gL({agent:e}){return c.jsxs(c.Fragment,{children:[c.jsx(pL,{}),c.jsxs(Ms,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[c.jsxs(Rs,{className:"border-b border-border px-3 py-2",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx($h,{className:"size-4 text-muted-foreground"}),c.jsx(js,{children:"Recent Projects"})]}),c.jsx(Pe,{variant:"outline",size:"small",children:e.projects.length})]}),c.jsx(dr,{className:"text-xs",children:"Most recently active projects known to the agent."})]}),c.jsx(Ds,{className:"p-0",children:e.projects.length?c.jsx("ul",{className:"divide-y divide-border",children:e.projects.map(t=>c.jsxs("li",{className:de("flex items-start justify-between gap-3 px-3 py-2",t.current&&"bg-primary/5"),children:[c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:t.path}),t.current?c.jsx(Pe,{variant:"outline",size:"small",children:"current"}):null]}),t.lastSessionFirstPrompt?c.jsx("p",{className:"mt-0.5 truncate text-[11px] text-muted-foreground",children:t.lastSessionFirstPrompt}):null]}),c.jsxs("div",{className:"shrink-0 text-right font-mono text-[10px] text-muted-foreground",children:[t.mcpServerCount?c.jsxs("div",{children:[t.mcpServerCount," mcp"]}):null,t.lastSessionModified?c.jsx("div",{children:bL(t.lastSessionModified)}):null]})]},t.path))}):c.jsx("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"No known projects."})})]})]})}function bL(e){const t=Date.parse(e);return Number.isNaN(t)?e:new Date(t).toLocaleString()}function cl({className:e}){return c.jsx("svg",{className:de("size-3.5",e),viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:c.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 nu({className:e}){return c.jsx("svg",{className:de("size-3.5",e),viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":!0,children:c.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 vL({className:e}){return c.jsx("svg",{className:de("size-3.5",e),viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:c.jsx("path",{d:"M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81"})})}let NS=0;const TS=()=>(NS+=1,`t${Date.now()}-${NS}`);function _L(){const[e,t]=k.useState([]),[i,s]=k.useState(!1),[a,o]=k.useState(null),[u,h]=k.useState(null),[m,f]=k.useState(null),[p,b]=k.useState([]),_=k.useRef(null),x=k.useRef(void 0);k.useEffect(()=>{UM().then(A=>{h(A.configured),f(A.provider)}).catch(()=>h(!1))},[]);const y=k.useCallback(async(A,N)=>{b(D=>D.filter(U=>U.requestId!==A));const M=x.current;if(M)try{await HM(M,A,N)}catch{}},[]),S=k.useCallback(()=>{_.current?.abort(),_.current=null,s(!1)},[]),E=k.useCallback(async(A,N)=>{const M=A.trim();if(!M||i)return;o(null);const D={id:TS(),createdAt:Date.now(),role:"user",text:M,label:N?.label,tools:[]},U=TS(),L={id:U,createdAt:Date.now(),role:"assistant",text:"",tools:[]};t(I=>[...I,D,L]);const R=I=>t(F=>F.map(G=>G.id===U?I(G):G)),$=new AbortController;_.current=$,s(!0);try{await FM(M,x.current,I=>{switch(I.type){case"session":x.current=I.sessionId;break;case"text":R(F=>({...F,text:F.text+I.text}));break;case"tool_use":R(F=>({...F,tools:[...F.tools,{id:I.id,name:I.name,input:I.input,status:"running"}]}));break;case"tool_result":R(F=>({...F,tools:F.tools.map(G=>G.id===I.id?{...G,preview:I.preview,isError:I.isError,status:"done"}:G)}));break;case"approval_request":b(F=>[...F,{requestId:I.requestId,name:I.name,input:I.input}]);break;case"error":o(I.message);break;case"done":break}},$.signal)}catch(I){$.signal.aborted||o(I instanceof Error?I.message:String(I))}finally{_.current=null,s(!1)}},[i]),C=k.useCallback(()=>{S(),x.current=void 0,t([]),b([]),o(null)},[S]);return{turns:e,streaming:i,error:a,configured:u,provider:m,approvals:p,send:E,stop:S,clear:C,respond:y}}const UC=k.createContext(null);function xL({children:e}){const t=_L(),{streaming:i}=t,[s,a]=k.useState(!1),[o,u]=k.useState(""),[h,m]=k.useState(null),[f,p]=k.useState(0),[b,_]=k.useState(0),[x,y]=k.useState(!1),S=k.useRef([]),E=k.useCallback(()=>p($=>$+1),[]),C=k.useCallback(()=>_($=>$+1),[]),A=k.useCallback(($,I)=>(C(),t.send($,I)),[t,C]),N=k.useCallback(()=>m(null),[]),M=k.useCallback(()=>{a(!0),y(!0)},[]),D=k.useCallback($=>{a(!0),u(I=>I.trim()?`${I.replace(/\s*$/,"")}
|
|
18
|
-
${$}`:$),E()},[E]);k.useEffect(()=>{if(i)return;const $=S.current.shift();$&&A($.prompt,{label:$.label})},[i,A]);const U=k.useCallback(({prompt:$,source:I,mode:F="send",label:G})=>(a(!0),m(I??null),C(),F==="draft"?(u($),E(),{queued:!1}):i?(S.current.push({prompt:$,label:G}),{queued:!0}):(A($,{label:G}),{queued:!1})),[i,A,E,C]),L=k.useCallback(()=>{S.current=[],m(null),t.clear()},[t]),R={...t,send:A,clear:L,open:s,setOpen:a,draft:o,setDraft:u,insertPath:D,activeSource:h,clearSource:N,focusNonce:f,stickNonce:b,sendToAgent:U,onboarding:x,setOnboarding:y,startOnboard:M};return c.jsx(UC.Provider,{value:R,children:e})}function Li(){const e=k.useContext(UC);if(!e)throw new Error("useAgentDock must be used within an AgentProvider");return e}function yL(e){const t=Math.max(0,Math.floor(e/6e4));if(t<60)return`${t}m`;const i=Math.floor(t/60),s=t%60;return`${i}h ${String(s).padStart(2,"0")}m`}function SL(e,t=Date.now()){const i=e[0],s=i?t-i.createdAt:0,a=e.length,o=s>=60*6e4||a>=30,u=s>=30*6e4||a>=16,h=o?"heavy":u?"long":"fresh";return{durationLabel:i?yL(s):"0m",recommendation:h==="fresh"?null:"Consider starting a new chat for a cleaner context.",status:h,statusLabel:h==="heavy"?"Heavy context":h==="long"?"Long":"Fresh",turnCount:a}}function wL({now:e,onNewChat:t,turns:i}){const[s,a]=k.useState(()=>Date.now());k.useEffect(()=>{const h=window.setInterval(()=>a(Date.now()),3e4);return()=>window.clearInterval(h)},[]);const o=SL(i,e??s),u=i.length>0;return c.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-b border-border bg-background/55 px-3 py-2 text-xs",children:[c.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[c.jsx(O4,{className:de("size-4 shrink-0",o.status==="heavy"?"text-amber-500":o.status==="long"?"text-yellow-500":"text-muted-foreground")}),c.jsx("span",{className:"font-medium",children:"Conversation"}),c.jsx("span",{className:"font-mono text-muted-foreground",children:u?o.durationLabel:"not started"}),u?c.jsxs("span",{className:"font-mono text-muted-foreground",children:[o.turnCount," turns"]}):null]}),c.jsx(Pe,{appearance:o.status==="fresh"?"subtle":"solid",size:"small",variant:o.status==="heavy"?"warning":o.status==="long"?"secondary":"outline",children:o.statusLabel}),o.recommendation?c.jsx("span",{className:"min-w-0 flex-1 text-muted-foreground",children:o.recommendation}):c.jsx("span",{className:"min-w-0 flex-1 text-muted-foreground",children:"Short chats usually give the agent cleaner context."}),c.jsxs(ue,{className:"h-7 gap-1.5 px-2 text-xs",disabled:!u,onClick:t,size:"sm",type:"button",variant:"outline",children:[c.jsx(rb,{className:"size-3.5"}),"New chat"]})]})}function kL({agent:e,agentId:t}){const i=e.project.instructionFileName??(e.project.claudeMdPath?"CLAUDE.md":void 0),s=e.project.instructionFilePreview??e.project.claudeMdPreview,a=e.project.memoryFiles.length+(i?1:0);return c.jsxs(Ms,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[c.jsxs(Rs,{className:"border-b border-border px-3 py-2",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(gk,{className:"size-4 text-muted-foreground"}),c.jsx(js,{children:"Project Memory"})]}),c.jsx(Pe,{variant:"outline",size:"small",children:a})]}),c.jsx(dr,{className:"truncate text-xs",children:e.project.memoryDir??(t==="codex"?"No Codex memory directory found for this project.":"No memory directory found for this project.")})]}),c.jsxs(Ds,{className:"space-y-2 p-3",children:[i?c.jsx(AS,{title:i,preview:s,defaultOpen:!0}):null,e.project.memoryFiles.length?e.project.memoryFiles.map(o=>c.jsx(AS,{title:o.name,subtitle:`${o.size} B`,preview:o.preview,defaultOpen:o.name==="MEMORY.md"},o.path)):i?null:c.jsx("p",{className:"text-xs text-muted-foreground",children:"No memory files persisted yet for this project."})]})]})}function AS({title:e,subtitle:t,preview:i,defaultOpen:s=!1}){const[a,o]=k.useState(s);return c.jsxs("div",{className:"rounded-md border border-border bg-background/40",children:[c.jsxs("button",{type:"button",onClick:()=>o(!a),className:"flex w-full items-center gap-2 px-2.5 py-1.5 text-left text-xs font-semibold",children:[c.jsx(sa,{className:de("size-3.5 text-muted-foreground transition-transform",a&&"rotate-90")}),c.jsx("span",{children:e}),t?c.jsx("span",{className:"font-mono text-[10px] font-normal text-muted-foreground",children:t}):null]}),a&&i?c.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:i}):null]})}const EL=[{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%)"}],CL=({size:e=20,color:t="#8f8f8f"})=>c.jsx("div",{style:{width:e,height:e},children:c.jsx("div",{className:"relative left-1/2 top-1/2",style:{width:e,height:e},children:EL.map(i=>c.jsx("div",{className:"absolute -left-[10%] -top-[3.9%] h-[8%] w-[24%] animate-fade-spin rounded-[5px]",style:{backgroundColor:t,...i}},i.transform))})}),NL=[{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"}],TL={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"},AL={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]"}},jd=({size:e="medium",type:t="primary",variant:i="styled",shape:s="square",svgOnly:a=!1,children:o,prefix:u,suffix:h,shadow:m=!1,loading:f=!1,disabled:p=!1,fullWidth:b=!1,className:_,...x})=>c.jsxs("button",{disabled:p,tabIndex:0,className:Pc("flex items-center justify-center gap-0.5 duration-150",NL[+a][e],p||f?"cursor-not-allowed border border-gray-400 bg-gray-100 text-gray-700":TL[t],AL[s][e],m&&"shadow-border-small border-none",b&&"w-full",i==="unstyled"?"h-fit bg-transparent px-0 text-gray-1000 outline-none hover:bg-transparent":"focus:shadow-focus-ring focus:outline-0",_),type:"button",...x,children:[f?c.jsx(CL,{size:e==="large"?24:16}):u,c.jsx("span",{className:Pc("relative overflow-hidden overflow-ellipsis whitespace-nowrap font-sans",e!=="tiny"&&i!=="unstyled"&&"px-1.5"),children:o}),!f&&h]}),ML=({className:e})=>c.jsx("svg",{height:"16",strokeLinejoin:"round",viewBox:"0 0 16 16",width:"16",className:e,children:c.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"})}),RL=()=>c.jsx("svg",{height:"16",strokeLinejoin:"round",viewBox:"0 0 16 16",width:"16",className:"fill-gray-1000",children:c.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 Ap=null,jL=0;const ri={toasts:[],listeners:new Set,add(e,t,i,s,a,o){const u=jL++,h={id:u,text:e,preserve:i,action:s,onAction:a,onUndoAction:o,type:t};if(!h.preserve){h.remaining=3e3,h.start=Date.now();const m=()=>{this.toasts=this.toasts.filter(f=>f.id!==u),this.notify()};h.timeout=setTimeout(m,h.remaining),h.pause=()=>{h.timeout&&(clearTimeout(h.timeout),h.timeout=void 0,h.remaining-=Date.now()-h.start)},h.resume=()=>{h.timeout||(h.start=Date.now(),h.timeout=setTimeout(m,h.remaining))}}this.toasts.push(h),this.notify()},remove(e){ri.toasts=ri.toasts.filter(t=>t.id!==e),ri.notify()},subscribe(e){return ri.listeners.add(e),()=>{ri.listeners.delete(e)}},notify(){ri.listeners.forEach(e=>{e()})}},DL=()=>{const[e,t]=k.useState([]),[i,s]=k.useState([]),[a,o]=k.useState(!1),u=y=>S=>{S&&y.measuredHeight==null&&(y.measuredHeight=S.getBoundingClientRect().height,ri.notify())};k.useEffect(()=>(t([...ri.toasts]),ri.subscribe(()=>{t([...ri.toasts])})),[]),k.useEffect(()=>{const y=e.filter(S=>!i.includes(S.id)).map(S=>S.id);y.length>0&&requestAnimationFrame(()=>{s(S=>[...S,...y])})},[i,e]);const m=Math.max(0,e.length-3),f=(y,S)=>{if(y===S-1)return"none";const E=S-1-y;let C=e[S-1]?.measuredHeight||63;for(let M=S-1;M>y;M--)a?C+=(e[M-1]?.measuredHeight||63)+10:C+=20;const A=-E,N=a?1:1-.05*E;return`translate3d(0, calc(100% - ${C}px), ${A}px) scale(${N})`},p=()=>{o(!0),ri.toasts.forEach(y=>{y.pause?.()})},b=()=>{o(!1),ri.toasts.forEach(y=>{y.resume?.()})},x=e.slice(m).reduce((y,S)=>y+(S.measuredHeight??63),0);return c.jsx("div",{className:"pointer-events-none fixed bottom-4 right-4 z-[9999] w-[min(420px,calc(100vw-2rem))]",style:{height:x},children:c.jsx("div",{className:"pointer-events-auto relative w-full",style:{height:x},onMouseEnter:p,onMouseLeave:b,children:e.map((y,S)=>{const E=S>=m;return c.jsx("div",{ref:u(y),className:Pc("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"}[y.type],E?"opacity-100":"opacity-0",S<m&&"pointer-events-none"),style:{width:"100%",transition:"all .35s cubic-bezier(.25,.75,.6,.98)",transform:i.includes(y.id)?f(S,e.length):"translate3d(0, 100%, 150px) scale(1)"},children:c.jsxs("div",{className:"flex flex-col items-center justify-between text-[.875rem]",children:[c.jsxs("div",{className:"flex h-full w-full items-center justify-between gap-4",children:[c.jsx("span",{children:y.text}),!y.action&&c.jsxs("div",{className:"flex gap-1",children:[y.onUndoAction&&c.jsx(jd,{type:"tertiary",svgOnly:!0,size:"small",onClick:()=>{y.onUndoAction?.(),ri.remove(y.id)},children:c.jsx(RL,{})}),c.jsx(jd,{type:"tertiary",svgOnly:!0,size:"small",onClick:()=>ri.remove(y.id),children:c.jsx(ML,{className:{message:"fill-gray-1000",success:"fill-contrast-fg",warning:"fill-gray-1000 dark:fill-gray-100",error:"fill-contrast-fg"}[y.type]})})]})]}),y.action&&c.jsxs("div",{className:"flex w-full items-center justify-end gap-2",children:[c.jsx(jd,{type:"tertiary",size:"small",onClick:()=>ri.remove(y.id),children:"Dismiss"}),c.jsx(jd,{type:"primary",size:"small",onClick:()=>{y.onAction?.(),ri.remove(y.id)},children:y.action})]})]})},y.id)})})})},Dd=()=>{if(Ap)return;const e=document.createElement("div");e.className="fixed bottom-4 right-4 z-[9999]",document.body.appendChild(e),Ap=dk.createRoot(e),Ap.render(c.jsx(DL,{}))},Bi=()=>({message:k.useCallback(({text:e,preserve:t,action:i,onAction:s,onUndoAction:a})=>{Dd(),ri.add(e,"message",t,i,s,a)},[]),success:k.useCallback(e=>{Dd(),ri.add(e,"success")},[]),warning:k.useCallback(e=>{Dd(),ri.add(e,"warning")},[]),error:k.useCallback(e=>{Dd(),ri.add(e,"error")},[])});function OL({usage:e}){const t=e.inputTokens+e.cacheCreationInputTokens+e.cacheReadInputTokens,i=t>0?e.cacheReadInputTokens/t*100:0;return c.jsxs("div",{className:"rounded-md border border-border",children:[c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-border px-3 py-1.5",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(cl,{className:"size-3.5 text-amber-700"}),c.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Claude Code · last session"}),e.sessionId?c.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:e.sessionId.slice(0,8)}):null]}),c.jsxs("span",{className:"font-mono text-sm font-semibold text-emerald-700",children:["$",e.costUSD.toFixed(4)]})]}),c.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:[c.jsx(Hi,{label:"Input",value:Fn(e.inputTokens)}),c.jsx(Hi,{label:"Output",value:Fn(e.outputTokens)}),c.jsx(Hi,{label:"Cache read",value:Fn(e.cacheReadInputTokens)}),c.jsx(Hi,{label:"Cache create",value:Fn(e.cacheCreationInputTokens)}),c.jsx(Hi,{label:"Lines +",value:String(e.linesAdded)}),c.jsx(Hi,{label:"Lines −",value:String(e.linesRemoved)}),c.jsx(Hi,{label:"Wall",value:RS(e.durationMs)}),c.jsx(Hi,{label:"API",value:RS(e.apiDurationMs)})]}),c.jsxs("div",{className:"border-t border-border px-3 py-2",children:[c.jsxs("div",{className:"flex items-center justify-between text-[11px] text-muted-foreground",children:[c.jsx("span",{children:"Cache read share of input"}),c.jsxs("span",{className:"font-mono",children:[i.toFixed(1),"%"]})]}),c.jsx("div",{className:"mt-1 h-1.5 overflow-hidden rounded-full bg-muted",children:c.jsx("div",{className:"h-full bg-emerald-500",style:{width:`${Math.min(100,i).toFixed(2)}%`}})})]}),e.fiveHour||e.weekly?c.jsxs("div",{className:"space-y-2 border-t border-border px-3 py-2",children:[c.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Rate limits"}),e.fiveHour?c.jsx(yh,{label:"5h block",window:e.fiveHour}):null,e.weekly?c.jsx(yh,{label:"This week",window:e.weekly}):null]}):null,e.models.length?c.jsxs("div",{className:"space-y-1 border-t border-border px-3 py-2",children:[c.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"By model"}),e.models.map(s=>c.jsxs("div",{className:"flex items-center justify-between gap-2 font-mono text-[11px]",children:[c.jsx("span",{className:"truncate",children:s.model}),c.jsxs("span",{className:"shrink-0 text-muted-foreground",children:[Fn(s.inputTokens+s.outputTokens)," tok ·"," ",c.jsxs("span",{className:"text-emerald-700",children:["$",s.costUSD.toFixed(4)]})]})]},s.model))]}):null]})}function LL({usage:e}){const t=e.inputTokens>0?e.cachedInputTokens/e.inputTokens*100:0,i=e.contextWindow&&e.contextWindow>0?e.lastTotalTokens/e.contextWindow*100:0;return c.jsxs("div",{className:"rounded-md border border-border",children:[c.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3 py-1.5",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(nu,{className:"size-3.5 text-foreground"}),c.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Codex · last session"})]}),e.timestamp?c.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:new Date(e.timestamp).toLocaleString()}):null]}),c.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:[c.jsx(Hi,{label:"Input",value:Fn(e.inputTokens)}),c.jsx(Hi,{label:"Output",value:Fn(e.outputTokens)}),c.jsx(Hi,{label:"Cache read",value:Fn(e.cachedInputTokens)}),c.jsx(Hi,{label:"Reasoning",value:Fn(e.reasoningOutputTokens)}),c.jsx(Hi,{label:"Total",value:Fn(e.totalTokens)}),c.jsx(Hi,{label:"Last turn",value:Fn(e.lastTotalTokens)}),c.jsx(Hi,{label:"Context",value:e.contextWindow?Fn(e.contextWindow):"n/a"}),c.jsx(Hi,{label:"Cost",value:"n/a"})]}),c.jsxs("div",{className:"space-y-2 border-t border-border px-3 py-2",children:[c.jsx(MS,{label:"Cache read share of input",value:t,tone:"bg-emerald-500"}),e.contextWindow?c.jsx(MS,{label:"Last turn context share",value:i,tone:"bg-sky-500"}):null]}),e.primary||e.secondary?c.jsxs("div",{className:"space-y-2 border-t border-border px-3 py-2",children:[c.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Rate limits"}),e.primary?c.jsx(yh,{label:"5h window",window:e.primary}):null,e.secondary?c.jsx(yh,{label:"Weekly window",window:e.secondary}):null]}):null]})}function MS({label:e,value:t,tone:i}){const s=Math.min(100,Math.max(0,t));return c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between text-[11px] text-muted-foreground",children:[c.jsx("span",{children:e}),c.jsxs("span",{className:"font-mono",children:[s.toFixed(1),"%"]})]}),c.jsx("div",{className:"mt-1 h-1.5 overflow-hidden rounded-full bg-muted",children:c.jsx("div",{className:de("h-full",i),style:{width:`${s.toFixed(2)}%`}})})]})}function yh({label:e,window:t}){const i=Math.min(100,Math.max(0,t.usedPercent)),s=t.resetsAtUnix?new Date(t.resetsAtUnix*1e3).toLocaleString():null,a=i>=90?"bg-red-500":i>=70?"bg-amber-500":"bg-emerald-500";return c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between text-[11px]",children:[c.jsx("span",{className:"text-muted-foreground",children:e}),c.jsxs("span",{className:"font-mono",children:[i.toFixed(1),"%"]})]}),c.jsx("div",{className:"mt-1 h-1.5 overflow-hidden rounded-full bg-muted",children:c.jsx("div",{className:de("h-full",a),style:{width:`${i.toFixed(2)}%`}})}),s?c.jsxs("div",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground",children:["resets ",s]}):null]})}function Hi({label:e,value:t}){return c.jsxs("div",{children:[c.jsx("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:e}),c.jsx("div",{className:"font-mono text-xs font-semibold",children:t})]})}function Fn(e){return e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function RS(e){if(!e)return"0s";if(e<1e3)return`${e}ms`;const t=e/1e3;if(t<60)return`${t.toFixed(1)}s`;const i=Math.floor(t/60),s=Math.round(t-i*60);return`${i}m ${s}s`}function BL(e=1e4){const[t,i]=k.useState(null),[s,a]=k.useState(null);return k.useEffect(()=>{let o=!0;const u=()=>{IM().then(m=>{o&&(i(m),a(null))}).catch(m=>{o&&a(m instanceof Error?m.message:String(m))})};u();const h=window.setInterval(u,e);return()=>{o=!1,window.clearInterval(h)}},[e]),{usage:t,error:s}}const zL={"claude-code":{label:"Claude Code",icon:c.jsx(cl,{})},codex:{label:"Codex",icon:c.jsx(nu,{})}};function IL({agent:e,agentId:t,isDetected:i}){const{usage:s,error:a}=BL(),o=zL[t],u=t==="codex";return c.jsxs(Ms,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[c.jsxs(Rs,{className:"border-b border-border px-3 py-2",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(Ek,{className:"size-4 text-muted-foreground"}),c.jsx(js,{children:u?"Token Usage & Rate Limits":"Token & Cost Usage"}),c.jsx(Pe,{variant:"outline",size:"small",icon:o.icon,children:o.label}),i?c.jsx(Pe,{variant:"outline",size:"small",children:"active session"}):c.jsx("span",{className:"text-[11px] text-muted-foreground",children:"Not the active agent in this session"}),u?null:c.jsx(PL,{className:"ml-auto"})]}),c.jsxs(dr,{className:"truncate text-xs",children:[u?c.jsxs(c.Fragment,{children:["Session metrics from ",c.jsx("code",{className:"font-mono",children:"~/.codex/sessions"})]}):c.jsxs(c.Fragment,{children:["Last-session metrics from ",c.jsx("code",{className:"font-mono",children:"~/.claude.json"})]})," · ",c.jsx("span",{className:"font-mono",children:e.project.cwd})]})]}),c.jsxs(Ds,{className:"p-3",children:[a?c.jsx("p",{className:"text-xs text-destructive",children:a}):null,u?s?.codex?c.jsx(LL,{usage:s.codex}):a?null:c.jsx(jS,{agent:"Codex CLI"}):s?.claude?c.jsx(OL,{usage:s.claude}):a?null:c.jsx(jS,{agent:"Claude Code"})]})]})}function PL({className:e}){const[t,i]=k.useState(!0),[s,a]=k.useState(!0),[o,u]=k.useState(!1),h=Bi();k.useEffect(()=>{let f=!0;return PM().then(p=>f&&i(p.coAuthorWithClaude)).catch(()=>{}).finally(()=>f&&a(!1)),()=>{f=!1}},[]);const m=async()=>{const f=!t;u(!0),i(f);try{const p=await $M({coAuthorWithClaude:f});i(p.coAuthorWithClaude),h.success(p.coAuthorWithClaude?"Claude co-author trailer enabled for commits":"Claude co-author trailer disabled for commits")}catch(p){i(!f),h.error(p instanceof Error?p.message:"Failed to update setting")}finally{u(!1)}};return c.jsxs(ue,{type:"button",variant:t?"default":"outline",size:"sm",onClick:m,disabled:s||o,"aria-pressed":t,title:t?"Claude will be added as commit co-author. Click to disable.":"Co-author trailer disabled. Click to enable.",className:de("gap-1.5",e),children:[c.jsx(cl,{className:"size-3.5"}),"Co-author"]})}function jS({agent:e}){return c.jsxs("p",{className:"text-xs text-muted-foreground",children:["No usage data yet. Run a session with ",e," in this project."]})}const $L=["I want to add a new service to NoMoreIDE. Walk me through it one step at a time —","ask a single question per message and give me options to choose from where it helps.","","Whenever you offer me a set of choices, end that message with a fenced block","labelled `options`, one choice per line, so I can click them. For example:","```options","Local","Docker Compose","SSH (remote)","```","","When the answer is free text (not a pick-list), always show a concrete example","in the question so I know the format — e.g. ask for the SSH host as","'What SSH host alias should I use? (for example: `devbox`)', the command as","'(for example: `npm run dev`)', the directory as '(for example: `/srv/app`)',","and the name as '(for example: `backend`)'. Never ask for a value without an example.","","1. First ask whether it's local, a Docker Compose service, or remote over SSH.","2. For local or Docker: ask which folder it lives in — and remind me I can click"," the paperclip (attach) button at the bottom-left of this chat to browse and"," insert the folder path. Then look inside it (package.json scripts,"," docker-compose.yml, go.mod, etc.) and propose the start command and port —"," confirm with me, don't assume."," For SSH: ask for the host alias, the remote command, and the remote directory.","3. Confirm a short name for it.","","Once I've confirmed everything, register it by running the nomoreide CLI:",' nomoreide add service <name> --command "<cmd>" --cwd "<dir>" [--port <n>] [--description "<text>"]'," Docker: --kind docker-compose --compose-service <svc> [--compose-file <file>] --cwd <dir>",' SSH: --kind ssh --host <alias> --command "<cmd>" --cwd "<remote dir>"',"After it registers successfully, end your final message with the service name in a","fenced `service` block so I get Start / Open buttons for it, e.g.:","```service","backend","```"].join(`
|
|
19
|
-
`),UL=["I want to connect a database to NoMoreIDE so I can browse it in the Database tab.","Walk me through it one step at a time — ask a single question per message and give","me options to choose from where it helps.","","Whenever you offer me a set of choices, end that message with a fenced block","labelled `options`, one choice per line, so I can click them. For example:","```options","Postgres","MySQL","SQLite","```","","First, look at what's already here before asking me to type things:","- Call `nomoreide_list_services` and check for a database service (a docker-compose"," or local service using a postgres / pgvector / mysql / mariadb image).","- If I just onboarded a repo, prefer the database it exposed.","","Then confirm the connection details with me: engine, host, port, user, password,","and database name. When the answer is free text, show a concrete example in the","question — e.g. the host as '(for example: `127.0.0.1`)' and the port as","'(for example: `5432`)'. For a docker-compose database, use the published host","port (the left side of a `5433:5432` mapping), not the in-container port.","","Once I've confirmed everything, register it with the `nomoreide_register_database`","tool — pass name, engine (postgres|mysql|sqlite), and a connection url, e.g.","`postgres://user:password@127.0.0.1:5433/dbname` (or an absolute file path for","sqlite). After it registers, tell me it's ready to browse in the Database tab."].join(`
|
|
20
|
-
`);function HL(e){const t=e?.trim();return[t?`Onboard this repository into NoMoreIDE and get it running: ${t}`:"I want to add a project to NoMoreIDE from a Git URL. First ask me for the repository URL (for example: `https://github.com/owner/repo`).","","Then set it up end-to-end yourself — don't make me fill in a form:","1. Call the `nomoreide_onboard_repo` tool with the URL to clone and analyze it."," It returns the clone path, a profile (manifests, Docker/compose, env keys,"," README excerpt), and ranked proposals with install-command hints.","2. Pick the best proposal straight from that result. Trust the profile — don't"," crawl the repo with Read/Glob/Grep or shell file reads; it already has what"," you need. Only ask me if it's genuinely ambiguous (e.g. several equally-likely"," apps in a monorepo) — otherwise choose sensible defaults.","3. Install dependencies if needed (run the install command in the clone path).","4. Register it with `nomoreide_register_service` using the returned clone path as"," the cwd, then register it as a git repo with `nomoreide_git_register_repository`"," so it shows in the Git tab."," If the onboard result includes any `databases`, register each one with"," `nomoreide_register_database` (use its name, engine, and url) so it shows in the"," Database tab.","5. Start it with `nomoreide_start_service` and confirm it came up (check its logs).","","Keep me posted as you go, but keep decisions to yourself unless you're truly stuck.","When it's running, end your message with the service name in a fenced `service`","block so I get Start / Open buttons for it, e.g.:","```service","backend","```"].join(`
|
|
21
|
-
`)}function FL(e,t,i,s,a){const o=s.map(u=>`- ${u.name}: ${u.dataType}${u.primaryKey?" (PK)":""}${u.nullable?"":" NOT NULL"}`).join(`
|
|
22
|
-
`);return[`I'm looking at a row in my ${t} database (connection "${e}", table \`${i.qualifiedName}\`).`,"","## Table schema",o,"","## Row","```json",JSON.stringify(a,null,2),"```","","Explain what this row represents and anything notable about its values."].join(`
|
|
23
|
-
`)}function DS(e,t,i){const s=i?.engine?`my ${i.engine} database (connection "${e}")`:`my database (connection "${e}")`,a=[`I'm looking at the table \`${t.qualifiedName}\` in ${s}.`,""];return i?.columns?.length&&(a.push("## Table schema"),a.push(i.columns.map(o=>`- ${o.name}: ${o.dataType}${o.primaryKey?" (PK)":""}${o.nullable?"":" NOT NULL"}`).join(`
|
|
24
|
-
`)),a.push("")),a.push("My question: "),a.join(`
|
|
25
|
-
`)}function VL({absolutePath:e,lines:t,relativePath:i}){return[`Please structurally split this large file and preserve behavior: ${i}`,"",`Absolute path: ${e}`,`Current size: ${t.toLocaleString()} lines`,"","First read the file and nearby imports/tests, then propose the smallest safe decomposition.","Prefer extracting cohesive responsibilities into focused modules over mechanical slicing.","Keep public APIs stable where possible, update imports, and run the relevant tests after editing."].join(`
|
|
26
|
-
`)}function qL(e,t){return[`About commit \`${e.hash.slice(0,7)}\` — "${e.subject}" by ${e.author}:`,"",t,"",`Run \`git show ${e.hash}\` to see the diff if you need it.`].join(`
|
|
27
|
-
`)}function KL(e){return["I have these ungrouped services in NoMoreIDE and I'd like to organise them into groups","(groups let me start/stop related services together):","",e.length?e.map(i=>{const s=[`- ${i.name}`];return i.command&&s.push(`command: \`${i.command}\``),i.cwd&&s.push(`cwd: \`${i.cwd}\``),typeof i.port=="number"&&s.push(`port: ${i.port}`),i.description&&s.push(i.description),s.join(" — ")}).join(`
|
|
28
|
-
`):"- (none — all services are already grouped)","","Look at their names, commands, directories and ports and propose how to group them —","for example a frontend + backend that share a repo, or services that boot together.","Group only the ones that genuinely belong together; it's fine to leave some ungrouped.","","Present your proposal as a short list of `group name → services` and end that message","with a fenced `options` block so I can confirm, e.g.:","```options","Yes, create these groups","Let me adjust them first","```","","Do NOT create anything until I confirm. Once I say yes, register each group by running:"," nomoreide add bundle <group-name> <service> <service> ...","Then tell me which groups you created."].join(`
|
|
29
|
-
`)}function GL({service:e,context:t}){return[`Here's the current debug context for my \`${e}\` service. Take a look at its`,"state and recent logs, tell me what stands out, and help me fix anything that's wrong.","",t].join(`
|
|
30
|
-
`)}function OS(){return{serviceNames:[],databaseNames:[],errorIds:[],repositoryPaths:[]}}function WL(e){return e.serviceNames.length>0||e.databaseNames.length>0||e.errorIds.length>0||e.repositoryPaths.length>0}function YL({dashboard:e,databases:t,incidents:i,note:s,selection:a}){const o=[ZL(e,a.serviceNames),QL(t,a.databaseNames),JL(i,a.errorIds),e7(e,a.repositoryPaths)].filter(Boolean);return["Diagnose this NoMoreIDE workspace context.","Use the selected services, databases, incidents, and repositories together. Tell me what stands out, likely root causes, and the safest next steps.","",`Workspace: ${e.cwd}`,s?.trim()?`Extra user context:
|
|
31
|
-
${s.trim()}`:null,"",o.join(`
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
`)].filter(Boolean).join(`
|
|
36
|
-
`)}function XL({note:e,selection:t}){const i=[Od(t.serviceNames.length,"service"),Od(t.databaseNames.length,"database"),Od(t.errorIds.length,"error"),Od(t.repositoryPaths.length,"repo")].filter(Boolean),s=e?.trim().replace(/\s+/g," ");return s?`Diagnose: ${i.join(", ")}. Note: ${s.slice(0,80)}`:`Diagnose: ${i.join(", ")}`}function ZL(e,t){return t.length?["Services",t.map(s=>{const a=e.config.services.find(m=>m.name===s),o=e.runtime.services[s],u=e.health[s],h=e.logs.filter(m=>m.service===s).slice(-8).map(m=>`${m.timestamp} ${m.stream}: ${m.text}`);return[`Service: ${s}`,a?.kind?`kind: ${a.kind}`:null,a?.command?`command: ${a.command}`:null,a?.cwd?`cwd: ${a.cwd}`:null,a?.port?`port: ${a.port}`:null,o?`state: ${o.state}`:"state: unknown",o?.pid?`pid: ${o.pid}`:null,o?.url?`url: ${o.url}`:null,o?.exitCode!==void 0&&o.exitCode!==null?`exitCode: ${o.exitCode}`:null,u?`health: ${u.status} - ${u.summary}`:null,u?.agentContext?`agent debug context:
|
|
37
|
-
${u.agentContext}`:null,h.length?`recent logs:
|
|
38
|
-
${h.join(`
|
|
39
|
-
`)}`:null].filter(Boolean).join(`
|
|
40
|
-
`)}).join(`
|
|
41
|
-
|
|
42
|
-
`)].join(`
|
|
43
|
-
`):null}function QL(e,t){return t.length?["Databases",t.map(s=>{const a=e.find(o=>o.name===s);return[`Database: ${s}`,a?.engine?`engine: ${a.engine}`:null,a?.url?`url: ${a.url}`:null].filter(Boolean).join(`
|
|
44
|
-
`)}).join(`
|
|
45
|
-
|
|
46
|
-
`)].join(`
|
|
47
|
-
`):null}function JL(e,t){return t.length?["Error Inbox",t.map(s=>{const a=e.find(o=>o.id===s);return a?[`Incident #${a.id}`,`service: ${a.service}`,`level: ${a.level}`,`title: ${a.title}`,a.file?`file: ${a.file}${a.line?`:${a.line}`:""}`:null,`count: ${a.count}`,`firstSeen: ${a.firstSeen}`,`lastSeen: ${a.lastSeen}`,a.logExcerpt.length?`log excerpt:
|
|
48
|
-
${a.logExcerpt.join(`
|
|
49
|
-
`)}`:null].filter(Boolean).join(`
|
|
50
|
-
`):`Incident #${s}`}).join(`
|
|
51
|
-
|
|
52
|
-
`)].join(`
|
|
53
|
-
`):null}function e7(e,t){if(!t.length)return null;const i=t7(e),s=e.git.selectedRepository?.path??e.git.cwd,a=e.git.status?.files.map(u=>`${u.status}: ${u.path}`)??[];return["Git Repositories",t.map(u=>{const h=i.find(f=>f.path===u),m=u===s;return[`Repository: ${h?.name??u.split("/").pop()??u}`,`path: ${u}`,m?"current: yes":"current: no",m?a.length?`changed files:
|
|
54
|
-
${a.join(`
|
|
55
|
-
`)}`:"changed files: none":"changed files: not loaded for this repository in the current dashboard view"].join(`
|
|
56
|
-
`)}).join(`
|
|
57
|
-
|
|
58
|
-
`)].join(`
|
|
59
|
-
`)}function t7(e){return e.config.gitRepositories.length?e.config.gitRepositories:e.git.selectedRepository?[e.git.selectedRepository]:[{name:e.git.cwd.split("/").pop()??"repository",path:e.git.cwd}]}function Od(e,t){return e?`${e} ${t}${e===1?"":"s"}`:null}function Bb(e){return e==="codex"?"Codex":"Claude Code"}function i7(e,t){const i=e==="codex"?"`~/.codex/skills/<name>/SKILL.md` (user) or `.codex/skills/<name>/SKILL.md` (project)":"`~/.claude/skills/<name>/SKILL.md` (user) or `.claude/skills/<name>/SKILL.md` (project)";return[`Add a new skill for ${Bb(e)} from this:`,"",t,"",`Scaffold it at ${i} with valid frontmatter (\`name\`, \`description\`) and a short body, then confirm it's discovered. If the input is a URL or repo, fetch and adapt it.`].join(`
|
|
60
|
-
`)}function n7(e){return[`Remove the ${e.scope} skill \`${e.name}\`${e.path?` (at \`${e.path}\`)`:""}.`,"","Delete its directory and confirm it's no longer registered. Check nothing else references it first."].join(`
|
|
61
|
-
`)}function s7(e){const t=[`I'm looking at the ${e.scope} skill \`${e.name}\`${e.path?` (at \`${e.path}\`)`:""}.`];return e.description&&t.push("",`Its description: ${e.description}`),t.push("","My question: "),t.join(`
|
|
62
|
-
`)}function r7(e,t){const i=e==="codex"?"by adding an `[mcp_servers.<name>]` section to `~/.codex/config.toml`":"with `claude mcp add` (or by editing `~/.claude.json`)";return[`Register a new MCP server for ${Bb(e)} from this:`,"",t,"",`Set it up ${i}, then verify it connects. Parse the name, command/URL, and any env/args from the input above.`].join(`
|
|
63
|
-
`)}function a7(e,t){const i=t==="codex"?`Remove the \`[mcp_servers.${e.name}]\` section from \`~/.codex/config.toml\`.`:`Run \`claude mcp remove ${e.name}\` (scope: ${e.scope}).`;return[`Remove the ${e.scope} MCP server \`${e.name}\`.`,"",`${i} Then confirm it no longer appears in the server list.`].join(`
|
|
64
|
-
`)}function o7(e){const t=[`I'm looking at the ${e.scope} MCP server \`${e.name}\`.`],i=e.command?[e.command,...e.args??[]].join(" "):e.url??e.type;return i&&t.push("",`It points at: \`${i}\``),t.push("","My question: "),t.join(`
|
|
65
|
-
`)}function l7(e,t){return[`Install a plugin for ${Bb(e)} from this:`,"",t,"","Use the `/plugin` command or `claude plugin install <name>@<marketplace>` (add the marketplace first if needed), then confirm its skills, commands, and MCP servers are available."].join(`
|
|
66
|
-
`)}function c7(e){const t=e.marketplace?` (from \`${e.marketplace}\`)`:"";return[`Uninstall the plugin \`${e.name}\`${t}.`,"","Use `claude plugin uninstall` or the `/plugin` command, then confirm its skills, commands, and MCP servers are gone."].join(`
|
|
67
|
-
`)}function u7(e){const t=[`I'm looking at the plugin \`${e.name}\`${e.marketplace?` from \`${e.marketplace}\``:""}${e.version?` (v${e.version})`:""}.`];e.description&&t.push("",e.description);const i=[];return e.skills.length&&i.push(`skills: ${e.skills.join(", ")}`),e.commands.length&&i.push(`commands: ${e.commands.join(", ")}`),e.agents.length&&i.push(`agents: ${e.agents.join(", ")}`),e.mcpServers.length&&i.push(`MCP servers: ${e.mcpServers.join(", ")}`),i.length&&(t.push("","It contributes —"),t.push(...i.map(s=>`- ${s}`))),t.push("","My question: "),t.join(`
|
|
68
|
-
`)}function HC({id:e,className:t}){return e==="codex"?c.jsx(nu,{className:de("text-foreground",t)}):e==="gemini"?c.jsx(vL,{className:de("text-[#1A73E8]",t)}):c.jsx(cl,{className:de("text-[#D97757]",t)})}function cs({className:e}){const{provider:t}=Li();return c.jsx(HC,{id:t?.id,className:e})}function tl({onAsk:e,label:t,className:i}){const{provider:s}=Li(),a=t??`Ask ${s?.label??"Claude"}`;return c.jsx("button",{"aria-label":a,className:de("flex size-6 items-center justify-center rounded-md opacity-0 transition-all duration-150 hover:bg-muted group-hover:opacity-100",i),onClick:e,title:a,type:"button",children:c.jsx(HC,{id:s?.id,className:"size-3.5"})})}function Wh({placeholder:e,onSubmit:t,onCancel:i,className:s}){const[a,o]=k.useState(""),u=()=>{const h=a.trim();h&&t(h)};return c.jsxs("form",{className:de("flex items-center gap-1.5 rounded-md border border-primary/40 bg-primary/5 px-1.5 py-1",s),onSubmit:h=>{h.preventDefault(),u()},children:[c.jsx(tl,{className:"size-5 opacity-100",label:"Send to the agent",onAsk:u}),c.jsx("input",{autoFocus:!0,className:"min-w-0 flex-1 bg-transparent text-xs outline-none placeholder:text-muted-foreground",onChange:h=>o(h.target.value),onKeyDown:h=>{h.key==="Escape"&&i()},placeholder:e,value:a}),c.jsx(ue,{type:"submit",size:"icon",className:"size-6",disabled:!a.trim(),title:"Send",children:c.jsx(sl,{className:"size-3.5"})}),c.jsx(ue,{type:"button",size:"icon",variant:"ghost",className:"size-6",onClick:i,"aria-label":"Cancel",title:"Cancel",children:c.jsx(Ji,{className:"size-3.5"})})]})}function zb({label:e,onClick:t}){return c.jsxs(ue,{type:"button",variant:"ghost",size:"sm",className:"h-6 gap-1 px-1.5 text-[11px] font-medium",onClick:t,title:e,"aria-label":e,children:[c.jsx(mn,{className:"size-3.5"}),"Add"]})}function Ib({askLabel:e,removeLabel:t,onAsk:i,onRemove:s}){return c.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[c.jsx(tl,{label:e,onAsk:i}),c.jsx(d7,{label:t,onConfirm:s})]})}function d7({label:e,onConfirm:t}){const[i,s]=k.useState(!1);return i?c.jsxs("span",{className:"flex items-center gap-0.5",children:[c.jsx("button",{type:"button","aria-label":e,title:e,onClick:()=>{s(!1),t()},className:"flex size-6 items-center justify-center rounded-md text-emerald-600 transition-colors hover:bg-emerald-500/10",children:c.jsx(sl,{className:"size-3.5"})}),c.jsx("button",{type:"button","aria-label":"Cancel",title:"Cancel",onClick:()=>s(!1),className:"flex size-6 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted",children:c.jsx(Ji,{className:"size-3.5"})})]}):c.jsx("button",{type:"button","aria-label":e,title:e,onClick:()=>s(!0),className:"flex size-6 items-center justify-center rounded-md text-muted-foreground opacity-0 transition-all duration-150 hover:bg-destructive/10 hover:text-destructive group-hover:opacity-100",children:c.jsx(rl,{className:"size-3.5"})})}function h7({agent:e,agentId:t}){const{sendToAgent:i}=Li(),[s,a]=k.useState([]),[o,u]=k.useState(!1),[h,m]=k.useState(!1),f=k.useCallback(async()=>{u(!0);try{a(await zM(t))}catch{a([])}finally{u(!1)}},[t]);k.useEffect(()=>{f()},[f]);const p=k.useMemo(()=>{const S={};for(const E of s)S[E.name]=E.state;return S},[s]),b=k.useMemo(()=>{const S=new Set(e.mcpServers.map(C=>C.name)),E=s.filter(C=>!S.has(C.name)).map(C=>({name:C.name,scope:"user",synthetic:!0}));return[...e.mcpServers,...E]},[e.mcpServers,s]);function _(S){m(!1),i({prompt:r7(t,S),source:{type:"agent-mcp",label:"New MCP server"},label:`Add MCP server: ${S}`})}function x(S){i({prompt:o7(S),source:{type:"agent-mcp",label:`${S.name} server`},mode:"draft"})}function y(S){i({prompt:a7(S,t),source:{type:"agent-mcp",label:`Remove ${S.name}`},label:`Remove MCP server: ${S.name}`})}return c.jsxs(Ms,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[c.jsxs(Rs,{className:"border-b border-border px-3 py-2",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Tk,{className:"size-4 text-muted-foreground"}),c.jsx(js,{children:"MCP Servers"})]}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx(Pe,{variant:"outline",size:"small",children:b.length}),c.jsx(ue,{type:"button",variant:"ghost",size:"icon",className:"size-6",onClick:()=>{f()},disabled:o,title:"Re-check authentication status","aria-label":"Re-check authentication status",children:c.jsx(Hh,{className:o?"animate-spin":void 0})}),c.jsx(zb,{label:"Register an MCP server with AI",onClick:()=>m(S=>!S)})]})]}),h?c.jsx(Wh,{className:"mt-1.5",placeholder:"Paste the MCP install command or URL…",onSubmit:_,onCancel:()=>m(!1)}):c.jsxs(dr,{className:"text-xs",children:["From"," ",c.jsx("code",{className:"font-mono",children:t==="codex"?"~/.codex/config.toml":"~/.claude.json"}),t==="codex"?"":" + claude.ai connectors",". Status via"," ",c.jsxs("code",{className:"font-mono",children:[t==="codex"?"codex":"claude"," mcp list"]})," ","(fresh health check)."]})]}),c.jsx(Ds,{className:"p-0",children:b.length?c.jsx("ul",{className:"divide-y divide-border",children:b.map(S=>c.jsxs("li",{className:"group px-3 py-2",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:S.name}),c.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[c.jsx(m7,{state:p[S.name],loading:o}),c.jsx(Pe,{variant:"outline",size:"small",children:S.synthetic?"connector":S.scope}),c.jsx(Ib,{askLabel:`Ask AI about the ${S.name} server`,removeLabel:`Remove the ${S.name} server`,onAsk:()=>x(S),onRemove:()=>y(S)})]})]}),c.jsx("div",{className:"mt-1 truncate font-mono text-[11px] text-muted-foreground",children:S.synthetic?"claude.ai managed connector":p7(S)})]},`${S.scope}:${S.name}`))}):c.jsx("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"No MCP servers configured."})})]})}const f7={connected:{label:"Connected",dot:"bg-emerald-500"},"needs-auth":{label:"Needs auth",dot:"bg-amber-500"},failed:{label:"Failed",dot:"bg-red-500"},"no-auth":{label:"local",dot:"bg-muted-foreground/50"}};function m7({state:e,loading:t}){if(!e)return t?c.jsx(Oi,{className:"size-3 animate-spin text-muted-foreground"}):null;const i=e==="unknown"?void 0:f7[e];return i?c.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[c.jsx("span",{className:de("size-1.5 shrink-0 rounded-full",i.dot),"aria-hidden":!0}),i.label]}):null}function p7(e){return e.command?[e.command,...e.args??[]].join(" "):e.url??e.type??"-"}function g7({agent:e,agentId:t}){const{sendToAgent:i}=Li(),[s,a]=k.useState(!1),o=e.plugins??[];function u(f){a(!1),i({prompt:l7(t,f),source:{type:"agent-plugin",label:"New plugin"},label:`Install plugin: ${f}`})}function h(f){i({prompt:u7(f),source:{type:"agent-plugin",label:`${f.name} plugin`},mode:"draft"})}function m(f){i({prompt:c7(f),source:{type:"agent-plugin",label:`Remove ${f.name}`},label:`Uninstall plugin: ${f.name}`})}return c.jsxs(Ms,{className:"min-w-0 rounded-none border-0 border-t border-border bg-transparent xl:border-t",children:[c.jsxs(Rs,{className:"border-b border-border px-3 py-2",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(_A,{className:"size-4 text-muted-foreground"}),c.jsx(js,{children:"Plugins"})]}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx(Pe,{variant:"outline",size:"small",children:o.length}),c.jsx(zb,{label:"Install a plugin with AI",onClick:()=>a(f=>!f)})]})]}),s?c.jsx(Wh,{className:"mt-1.5",placeholder:"Paste a plugin name, marketplace, or install command…",onSubmit:u,onCancel:()=>a(!1)}):c.jsx(dr,{className:"text-xs",children:t==="codex"?"Codex doesn't expose an installed-plugin registry here yet.":"Installed from marketplaces (~/.claude/plugins). Each bundles skills, commands, agents, and MCP servers."})]}),c.jsx(Ds,{className:"p-0",children:o.length?c.jsx("ul",{className:"divide-y divide-border",children:o.map(f=>c.jsxs("li",{className:"group px-3 py-2",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:f.name}),c.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[f.version&&f.version!=="unknown"?c.jsxs(Pe,{variant:"outline",size:"small",children:["v",f.version]}):null,f.marketplace?c.jsx(Pe,{variant:"outline",size:"small",children:f.marketplace}):null,c.jsx(Ib,{askLabel:`Ask AI about the ${f.name} plugin`,removeLabel:`Uninstall the ${f.name} plugin`,onAsk:()=>h(f),onRemove:()=>m(f)})]})]}),f.description?c.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:f.description}):null,c.jsx(b7,{plugin:f})]},`${f.name}@${f.marketplace??""}`))}):c.jsx("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"No plugins installed."})})]})}function b7({plugin:e}){const t=[];return e.skills.length&&t.push(`${e.skills.length} skill${Ld(e.skills.length)}`),e.commands.length&&t.push(`${e.commands.length} command${Ld(e.commands.length)}`),e.agents.length&&t.push(`${e.agents.length} agent${Ld(e.agents.length)}`),e.mcpServers.length&&t.push(`${e.mcpServers.length} MCP server${Ld(e.mcpServers.length)}`),t.length?c.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1",children:t.map(i=>c.jsx("span",{className:"rounded-full bg-muted px-2 py-0.5 text-[10px] text-muted-foreground",children:i},i))}):null}function Ld(e){return e===1?"":"s"}function v7({agent:e,agentId:t}){const{sendToAgent:i}=Li(),[s,a]=k.useState(!1);function o(m){a(!1),i({prompt:i7(t,m),source:{type:"agent-skill",label:"New skill"},label:`Add skill: ${m}`})}function u(m){i({prompt:s7(m),source:{type:"agent-skill",label:`${m.name} skill`},mode:"draft"})}function h(m){i({prompt:n7(m),source:{type:"agent-skill",label:`Remove ${m.name}`},label:`Remove skill: ${m.name}`})}return c.jsxs(Ms,{className:"min-w-0 rounded-none border-0 bg-transparent",children:[c.jsxs(Rs,{className:"border-b border-border px-3 py-2",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Wa,{className:"size-4 text-muted-foreground"}),c.jsx(js,{children:"Skills"})]}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx(Pe,{variant:"outline",size:"small",children:e.skills.length}),c.jsx(zb,{label:"Add a skill with AI",onClick:()=>a(m=>!m)})]})]}),s?c.jsx(Wh,{className:"mt-1.5",placeholder:"Paste a skill URL/repo, or describe the skill…",onSubmit:o,onCancel:()=>a(!1)}):c.jsx(dr,{className:"text-xs",children:t==="codex"?"User, project, and system skills discovered for Codex.":"User and project skills discovered for the active agent."})]}),c.jsx(Ds,{className:"p-0",children:e.skills.length?c.jsx("ul",{className:"divide-y divide-border",children:e.skills.map(m=>c.jsxs("li",{className:"group px-3 py-2",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:m.name}),c.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[c.jsx(Pe,{variant:"outline",size:"small",children:m.scope}),c.jsx(Ib,{askLabel:`Ask AI about the ${m.name} skill`,removeLabel:`Remove the ${m.name} skill`,onAsk:()=>u(m),onRemove:()=>h(m)})]})]}),m.description?c.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:m.description}):null]},`${m.scope}:${m.name}`))}):c.jsx("p",{className:"px-3 py-4 text-xs text-muted-foreground",children:"No skills found."})})]})}function _7({agent:e,agentId:t}){return c.jsxs("div",{className:"flex flex-col",children:[c.jsxs("div",{className:"grid grid-cols-1 divide-y divide-border xl:grid-cols-2 xl:divide-x xl:divide-y-0",children:[c.jsx(v7,{agent:e,agentId:t}),c.jsx(h7,{agent:e,agentId:t})]}),c.jsx(g7,{agent:e,agentId:t})]})}const x7=[{id:"claude-code",label:"Claude Code",icon:c.jsx(cl,{className:"size-4"})},{id:"codex",label:"Codex",icon:c.jsx(nu,{className:"size-4"})}],y7=[{id:"overview",label:"Overview",icon:c.jsx(Ek,{className:"size-3.5"})},{id:"memory",label:"Memory",icon:c.jsx(gk,{className:"size-3.5"})},{id:"tools",label:"Skills, MCPs & Plugins",icon:c.jsx(Tk,{className:"size-3.5"})},{id:"activity",label:"Activity",icon:c.jsx(Pa,{className:"size-3.5"})}];function S7(){const[e,t]=k.useState(null),[i,s]=k.useState(null),[a,o]=k.useState("claude-code"),[u,h]=k.useState("overview"),{clear:m,turns:f}=Li();if(k.useEffect(()=>{let b=!0;return BM().then(_=>{b&&(t(_),_.detected.name==="codex"&&o("codex"))}).catch(_=>{b&&s(_ instanceof Error?_.message:String(_))}),()=>{b=!1}},[]),i)return c.jsx("div",{className:"h-full overflow-auto bg-card/85 p-4",children:c.jsxs(dt,{variant:"muted",className:"border-destructive/40 text-destructive",children:["Failed to load agent info: ",i]})});if(!e)return c.jsx("div",{className:"h-full overflow-auto bg-card/85 p-4",children:c.jsx(dt,{variant:"muted",children:"Loading agent info…"})});const p=e.agents?.[a]??e;return c.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-card/85",children:[c.jsx("div",{className:"flex shrink-0 items-center gap-2 border-b border-border bg-card/90 px-3 py-2",children:x7.map(b=>{const _=a===b.id,x=e.detected.name===b.id;return c.jsxs("button",{type:"button",onClick:()=>o(b.id),className:de("flex items-center gap-2 rounded-lg border px-3 py-1.5 text-xs font-medium transition-colors",_?"border-border bg-background text-foreground shadow-sm":"border-transparent text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[b.icon,b.label,x?c.jsx("span",{className:"size-1.5 rounded-full bg-emerald-500","aria-label":"active session"}):null]},b.id)})}),c.jsx("div",{className:"flex shrink-0 items-center gap-1 border-b border-border bg-card/90 px-3",children:y7.map(b=>c.jsxs("button",{type:"button",onClick:()=>h(b.id),className:de("relative flex items-center gap-1.5 px-2.5 py-2 text-xs font-medium transition-colors",u===b.id?"text-foreground":"text-muted-foreground hover:text-foreground"),children:[b.icon,b.label,u===b.id?c.jsx("span",{className:"absolute inset-x-1 -bottom-px h-0.5 bg-primary"}):null]},b.id))}),c.jsx(wL,{onNewChat:m,turns:f}),c.jsxs("div",{className:"min-h-0 flex-1 overflow-auto",children:[u==="overview"?c.jsx(IL,{agent:p,agentId:a,isDetected:e.detected.name===a}):null,u==="memory"?c.jsx(kL,{agent:p,agentId:a}):null,u==="tools"?c.jsx(_7,{agent:p,agentId:a}):null,u==="activity"?c.jsx(gL,{agent:p,agentId:a}):null]})]})}var su=uk();function Ts({children:e,icon:t,onClose:i,title:s,size:a="md"}){return k.useEffect(()=>{function o(u){u.key==="Escape"&&i()}return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[i]),su.createPortal(c.jsx("div",{className:"fixed inset-0 z-[1000] grid place-items-center bg-black/35 px-4",onMouseDown:i,children:c.jsxs("div",{"aria-modal":"true",className:`flex max-h-[min(820px,calc(100vh-2rem))] w-full flex-col overflow-hidden rounded-lg border border-border bg-card shadow-xl ${a==="xl"?"max-w-[min(1400px,calc(100vw-2rem))]":a==="lg"?"max-w-3xl":"max-w-lg"}`,onMouseDown:o=>o.stopPropagation(),role:"dialog",children:[c.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-3",children:[c.jsx("div",{className:"flex size-8 items-center justify-center rounded-md border border-border bg-background text-foreground [&_svg]:size-4",children:t}),c.jsx("h2",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:s}),c.jsx(ue,{"aria-label":"Close dialog",onClick:i,size:"icon",type:"button",variant:"ghost",children:c.jsx(Ji,{})})]}),c.jsx("div",{className:"min-h-0 overflow-auto p-4",children:e})]})}),document.body)}function et({className:e,type:t,...i}){return c.jsx("input",{type:t,className:de("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),...i})}const w7={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 Qo({label:e,children:t,side:i="bottom",className:s}){return c.jsxs("span",{className:de("group/tt relative inline-flex",s),children:[t,c.jsx("span",{role:"tooltip",className:de("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",w7[i]),children:e})]})}const Pb="application/x-nomoreide-path";function ru(e,t){return`${e.replace(/\/+$/,"")}/${t.replace(/^\/+/,"")}`}function FC(e,t){e.setData(Pb,t)}function LS(e){return e.types.includes(Pb)}function k7(e){return e.getData(Pb)||null}function VC(e){return{draggable:!0,onDragStart:t=>{FC(t.dataTransfer,e),t.dataTransfer.effectAllowed="copy"}}}const Xn='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>',Zn='</title><path d="',Qn='"/></svg>',E7={title:".NET",slug:"dotnet",get svg(){return Xn+".NET"+Zn+this.path+Qn},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"}},C7={title:"Bun",slug:"bun",get svg(){return Xn+"Bun"+Zn+this.path+Qn},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"},N7={title:"Deno",slug:"deno",get svg(){return Xn+"Deno"+Zn+this.path+Qn},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"}},T7={title:"Docker",slug:"docker",get svg(){return Xn+"Docker"+Zn+this.path+Qn},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"},A7={title:"Go",slug:"go",get svg(){return Xn+"Go"+Zn+this.path+Qn},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"},M7={title:"Node.js",slug:"nodedotjs",get svg(){return Xn+"Node.js"+Zn+this.path+Qn},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"},R7={title:"npm",slug:"npm",get svg(){return Xn+"npm"+Zn+this.path+Qn},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"},j7={title:"pnpm",slug:"pnpm",get svg(){return Xn+"pnpm"+Zn+this.path+Qn},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"},D7={title:"Python",slug:"python",get svg(){return Xn+"Python"+Zn+this.path+Qn},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/"},BS={title:"Rust",slug:"rust",get svg(){return Xn+"Rust"+Zn+this.path+Qn},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"}},O7={title:"Vite",slug:"vite",get svg(){return Xn+"Vite"+Zn+this.path+Qn},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"},L7={title:"Yarn",slug:"yarn",get svg(){return Xn+"Yarn"+Zn+this.path+Qn},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 B7(e){const t=e.toLowerCase();return/\bvite\b/.test(t)?dn.vite:/\bcargo\s+/.test(t)?dn.cargo:/\brustc\b/.test(t)?dn.rust:/\bdotnet\b/.test(t)?dn.dotnet:/\bdocker(?:\s+compose|-compose|\s+)/.test(t)?dn.docker:/\bpython3?\b|\buvicorn\b|\bfastapi\b/.test(t)?dn.python:/\bgo\s+(run|test|build)\b|\bair\b/.test(t)?dn.go:/\bbun\b/.test(t)?dn.bun:/\bdeno\b/.test(t)?dn.deno:/\bpnpm\b/.test(t)?dn.pnpm:/\byarn\b/.test(t)?dn.yarn:/\bnpm\b/.test(t)?dn.npm:/\bnode\b/.test(t)?dn.node:dn.generic}const dn={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 $b({command:e,compact:t}){const i=B7(e),s=z7[i.kind];return c.jsx("span",{"aria-label":`${i.label} process`,className:de("inline-flex shrink-0 items-center justify-center rounded-md border bg-card shadow-sm dark:border-zinc-700/80 dark:bg-zinc-100",t?"size-6":"size-7",s?"border-border":"border-border bg-muted text-muted-foreground dark:bg-zinc-100 dark:text-zinc-700"),style:s?{color:`#${s.hex}`}:void 0,title:i.label,children:s?c.jsx("svg",{"aria-hidden":"true",className:t?"size-3.5":"size-4",fill:"currentColor",role:"img",viewBox:"0 0 24 24",children:c.jsx("path",{d:s.path})}):c.jsx(jk,{className:t?"size-3.5":"size-4"})})}const z7={bun:C7,cargo:BS,deno:N7,dotnet:E7,docker:T7,generic:null,go:A7,node:M7,npm:R7,pnpm:j7,python:D7,rust:BS,vite:O7,yarn:L7};function Un({className:e,...t}){return c.jsx("label",{className:de("grid gap-1.5 text-xs font-medium text-muted-foreground",e),...t})}const I7=[{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"}],zS=[{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 P7({result:e}){const t=[...e.stdout,...e.stderr].slice(0,4);return c.jsxs(dt,{variant:e.ok?"default":"destructive",children:[c.jsx("div",{className:"font-medium",children:e.ok?"Command test passed":"Command test failed"}),c.jsx("div",{className:"mt-1 text-xs",children:e.message}),t.length?c.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(`
|
|
69
|
-
`)}):null]})}function Ub({active:e,baseUrl:t,compact:i=!1,onRefresh:s,onStarted:a,restartAction:o,solidStart:u=!1,targetLabel:h}){return e?c.jsxs(c.Fragment,{children:[c.jsx(Mp,{compact:i,intent:"restart",icon:c.jsx(rb,{}),label:"Restart",action:o,targetLabel:h,url:`${t}/restart`,onRefresh:s,onSuccess:a}),c.jsx(Mp,{compact:i,intent:"stop",icon:c.jsx(Fh,{}),label:"Stop",targetLabel:h,url:`${t}/stop`,onRefresh:s})]}):c.jsx(Mp,{compact:i,intent:u?"startSolid":"start",icon:c.jsx(Uh,{}),label:"Start",targetLabel:h,url:`${t}/start`,onRefresh:s,onSuccess:a})}function Sh(e,t,i){const s=i instanceof Error?i.message:String(i);return`${e} failed for ${t}: ${s}`}function Mp({action:e,compact:t=!1,intent:i="neutral",icon:s,label:a,targetLabel:o,url:u,onRefresh:h,onSuccess:m}){const[f,p]=k.useState(!1),[b,_]=k.useState(null),{error:x,success:y}=Bi();async function S(C={}){p(!0);try{e?await e():await pn(u,C),y(`${a} requested for ${o}.`),await h(),_(null),m?.()}catch(A){A instanceof Dk?_(A.conflict):x(Sh(a,o,A))}finally{p(!1)}}const E=c.jsxs(ue,{"aria-label":a,className:`${U7[i]} ${t?"size-7":""}`.trim(),disabled:f,onClick:()=>S(),size:t?"icon":"sm",variant:"outline",children:[s,t?null:a]});return c.jsxs(c.Fragment,{children:[t?c.jsx(Qo,{label:a,children:E}):E,b?c.jsx($7,{busy:f,conflict:b,onCancel:()=>_(null),onKillAndStart:()=>S({strategy:"killHolder"}),targetLabel:o}):null]})}function $7({busy:e,conflict:t,onCancel:i,onKillAndStart:s,targetLabel:a}){const o=t.holder,u=`http://localhost:${t.port}/`;return c.jsx(Ts,{icon:c.jsx(LM,{}),onClose:e?()=>{}:i,title:`Port ${t.port} is already in use`,children:c.jsxs("div",{className:"space-y-3 p-4 text-sm",children:[c.jsxs("p",{children:[c.jsx("span",{className:"font-medium",children:a})," wants port"," ",c.jsx("span",{className:"font-mono",children:t.port}),", but it's already held by:"]}),c.jsx("pre",{className:"overflow-auto whitespace-pre-wrap rounded border border-border bg-background p-3 font-mono text-xs",children:o?`pid ${o.pid}${o.pgid?` (pgid ${o.pgid})`:""}
|
|
70
|
-
${o.command}`:"unknown process"}),c.jsxs("div",{className:"flex flex-wrap justify-end gap-2 pt-2",children:[c.jsx(ue,{onClick:i,size:"sm",type:"button",variant:"outline",disabled:e,children:"Cancel"}),c.jsxs(ue,{onClick:()=>window.open(u,"_blank","noopener,noreferrer"),size:"sm",type:"button",variant:"outline",disabled:e,children:[c.jsx(nb,{}),"Open in browser"]}),c.jsx(ue,{className:"border-red-600 bg-red-600 text-white hover:bg-red-700",disabled:e||!o,onClick:s,size:"sm",type:"button",children:"Stop holder & start"})]})]})})}const U7={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 H7({cwd:e,onRefresh:t,onSaved:i,initialService:s}){const{error:a,success:o}=Bi(),u=!!s,[h,m]=k.useState(s?.kind??"local"),[f,p]=k.useState(s?.name??""),[b,_]=k.useState(s?.command??""),[x,y]=k.useState(s?.cwd??e),[S,E]=k.useState(s?.port?String(s.port):""),[C,A]=k.useState(s?.description??""),[N,M]=k.useState(s?.composeFile??""),[D,U]=k.useState(s?.composeService??""),[L,R]=k.useState(s?.host??""),[$,I]=k.useState(null),[F,G]=k.useState(!1);k.useEffect(()=>{I(null)},[b,x,S,h]);function Y(){p(""),_(""),y(e),E(""),A(""),M(""),U(""),R(""),I(null)}async function Q(O){O.preventDefault();try{const X={name:f,kind:h,cwd:x,port:S,description:C};(h==="local"||h==="ssh")&&(X.command=b),h==="docker-compose"&&(X.composeFile=N,X.composeService=D),h==="ssh"&&(X.host=L),await pn("/api/services",X),u||Y(),o(u?`${f} updated.`:`${f} added.`),await t(),i?.()}catch(X){a(Sh(u?"Update service":"Add service",f||"service",X))}}async function q(){if(!b.trim()){a("Test command failed for service: command is required.");return}G(!0);try{I(await y6({command:b,cwd:x,port:S}))}catch(O){a(Sh("Test command",f||"service",O))}finally{G(!1)}}return{editing:u,kind:h,setKind:m,name:f,setName:p,command:b,setCommand:_,formCwd:x,setFormCwd:y,port:S,setPort:E,description:C,setDescription:A,composeFile:N,setComposeFile:M,composeService:D,setComposeService:U,host:L,setHost:R,testResult:$,testing:F,submit:Q,testCommand:q}}function IS({cwd:e,onRefresh:t,onSaved:i,initialService:s}){const{editing:a,kind:o,setKind:u,name:h,setName:m,command:f,setCommand:p,formCwd:b,setFormCwd:_,port:x,setPort:y,description:S,setDescription:E,composeFile:C,setComposeFile:A,composeService:N,setComposeService:M,host:D,setHost:U,testResult:L,testing:R,submit:$,testCommand:I}=H7({cwd:e,onRefresh:t,onSaved:i,initialService:s}),F=zS.find(q=>q.value===o),G=o==="local"&&f.trim().length>0&&b.trim().length>0,Y="grid gap-2 rounded-md border border-border bg-muted/30 p-3",Q="px-1 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground";return c.jsxs("form",{className:"grid gap-3",onSubmit:$,children:[c.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[c.jsxs("fieldset",{className:`${Y} sm:col-span-2`,children:[c.jsx("legend",{className:Q,children:"Step 1 · Service kind"}),c.jsx("div",{className:"grid grid-cols-3 gap-1.5",children:zS.map(q=>c.jsx(ue,{className:"justify-center",disabled:a,onClick:()=>u(q.value),size:"sm",type:"button",variant:o===q.value?"default":"outline",children:q.label},q.value))}),c.jsx("p",{className:"text-[11px] text-muted-foreground",children:F.hint})]}),c.jsxs("div",{className:"grid gap-3 sm:col-start-1 sm:row-start-2 sm:self-start",children:[c.jsxs("fieldset",{className:Y,children:[c.jsx("legend",{className:Q,children:"Step 2 · Identity"}),c.jsxs(Un,{children:["Name",c.jsx(et,{className:"h-8 text-sm",name:"name",onChange:q=>m(q.target.value),placeholder:"backend",readOnly:a,required:!0,value:h}),a?c.jsx("span",{className:"text-[11px] text-muted-foreground",children:"Name is the service key and can't be changed here."}):null]}),c.jsxs(Un,{children:["Description",c.jsx(et,{className:"h-8 text-sm",name:"description",onChange:q=>E(q.target.value),placeholder:"API server",value:S})]})]}),c.jsxs("fieldset",{className:Y,children:[c.jsx("legend",{className:Q,children:"Step 4 · Networking (optional)"}),c.jsxs(Un,{children:["Port",c.jsx(et,{className:"h-8 text-sm",inputMode:"numeric",name:"port",onChange:q=>y(q.target.value),placeholder:"3001",value:x})]})]})]}),o==="local"?c.jsxs("fieldset",{className:`${Y} sm:col-start-2 sm:row-start-2 sm:self-start`,children:[c.jsx("legend",{className:Q,children:"Step 3 · Local command"}),c.jsx("div",{className:"grid grid-cols-2 gap-1.5 sm:grid-cols-4",children:I7.map(q=>c.jsxs(ue,{className:"justify-start gap-1.5",onClick:()=>{p(q.command),E(q.description)},size:"sm",type:"button",variant:"outline",children:[c.jsx($b,{command:q.badgeCommand??q.command,compact:!0}),c.jsx("span",{className:"truncate",children:q.label})]},q.label))}),c.jsxs(Un,{children:["Command",c.jsx(et,{className:"h-8 font-mono text-sm",name:"command",onChange:q=>p(q.target.value),placeholder:"npm run dev",required:!0,value:f})]}),c.jsxs(Un,{children:["Working Directory",c.jsx(et,{className:"h-8 font-mono text-sm",name:"cwd",onChange:q=>_(q.target.value),required:!0,value:b})]})]}):null,o==="docker-compose"?c.jsxs("fieldset",{className:`${Y} sm:col-start-2 sm:row-start-2 sm:self-start`,children:[c.jsx("legend",{className:Q,children:"Step 3 · Docker Compose target"}),c.jsxs(Un,{children:["Compose Service",c.jsx(et,{className:"h-8 font-mono text-sm",name:"composeService",onChange:q=>M(q.target.value),placeholder:"api",required:!0,value:N})]}),c.jsxs(Un,{children:["Compose File (optional)",c.jsx(et,{className:"h-8 font-mono text-sm",name:"composeFile",onChange:q=>A(q.target.value),placeholder:"docker-compose.yml",value:C})]}),c.jsxs(Un,{children:["Working Directory (where compose file lives)",c.jsx(et,{className:"h-8 font-mono text-sm",name:"cwd",onChange:q=>_(q.target.value),required:!0,value:b})]})]}):null,o==="ssh"?c.jsxs("fieldset",{className:`${Y} sm:col-start-2 sm:row-start-2 sm:self-start`,children:[c.jsx("legend",{className:Q,children:"Step 3 · SSH connection"}),c.jsxs(Un,{children:["SSH Host (alias from ~/.ssh/config)",c.jsx(et,{className:"h-8 font-mono text-sm",name:"host",onChange:q=>U(q.target.value),placeholder:"devbox",required:!0,value:D})]}),c.jsxs(Un,{children:["Remote Command",c.jsx(et,{className:"h-8 font-mono text-sm",name:"command",onChange:q=>p(q.target.value),placeholder:"npm run dev",required:!0,value:f})]}),c.jsxs(Un,{children:["Remote Working Directory",c.jsx(et,{className:"h-8 font-mono text-sm",name:"cwd",onChange:q=>_(q.target.value),placeholder:"/srv/app",required:!0,value:b})]}),c.jsxs(dt,{variant:"muted",children:[c.jsx("div",{className:"font-medium",children:"SSH key handling"}),c.jsxs("div",{className:"mt-1 text-xs",children:["NoMoreIDE never stores key files. Add a ",c.jsxs("code",{children:["Host ",D||"<alias>"]})," entry to",c.jsx("code",{children:" ~/.ssh/config"})," with ",c.jsx("code",{children:"HostName"}),", ",c.jsx("code",{children:"User"}),", and"," ",c.jsx("code",{children:"IdentityFile ~/.ssh/your-key.pem"})," (chmod 0600). Make sure"," ",c.jsx("code",{children:"ssh-agent"})," is running or your key is loaded (",c.jsx("code",{children:"ssh-add ~/.ssh/your-key.pem"}),"). NoMoreIDE will run"," ",c.jsxs("code",{children:["ssh ",D||"<alias>"]})," using that config."]})]})]}):null]}),L?c.jsx(P7,{result:L}):null,c.jsxs("div",{className:"flex flex-wrap justify-end gap-2",children:[o==="local"?c.jsxs(ue,{disabled:R||!G,onClick:I,type:"button",variant:"outline",children:[c.jsx(jk,{}),R?"Testing...":"Test Command"]}):null,c.jsx(ue,{type:"submit",children:a?"Save Service":"Add Service"})]})]})}function qC({initialName:e="",initialServices:t=[],onSaved:i,onRefresh:s,originalName:a,services:o,submitLabel:u="Save Group"}){const{error:h,success:m}=Bi();async function f(p){p.preventDefault();const b=p.currentTarget,_=new FormData(b),x=String(_.get("name")??""),y=_.getAll("services").map(S=>String(S)).filter(Boolean);try{await pn("/api/bundles",{name:x,originalName:a,services:y.join(",")}),b.reset(),m(`${x} group saved.`),await s(),i?.()}catch(S){h(Sh("Save group",x||"group",S))}}return c.jsxs("form",{className:"grid gap-2.5",onSubmit:f,children:[c.jsxs(Un,{children:["Group name",c.jsx(et,{className:"h-8 text-sm",defaultValue:e,name:"name",placeholder:"full-stack",required:!0})]}),c.jsxs("fieldset",{className:"grid gap-1.5",children:[c.jsx("legend",{className:"text-xs font-medium",children:"Services"}),o.length?o.map(p=>c.jsxs("label",{className:"flex items-center gap-2 overflow-hidden rounded-md border border-border px-2.5 py-1.5 text-sm",children:[c.jsx("input",{className:"size-4 shrink-0 accent-primary",defaultChecked:t.includes(p.name),name:"services",type:"checkbox",value:p.name}),c.jsx($b,{command:p.command??"",compact:!0}),c.jsxs("span",{className:"min-w-0 flex-1",children:[c.jsx("span",{className:"block truncate text-sm font-medium",children:p.name}),c.jsx("span",{className:"block truncate font-mono text-[11px] text-muted-foreground",children:p.command??p.kind??""})]})]},p.name)):c.jsx(dt,{variant:"muted",children:"All services are already grouped, or none registered."})]}),c.jsx(ue,{className:"h-8",disabled:!o.length,type:"submit",children:u})]})}function F7({allServices:e,group:t,onRefresh:i,ports:s,services:a,health:o,statuses:u,timeline:h,selectedService:m,onSelectService:f,onDropService:p}){const[b,_]=k.useState(!1),[x,y]=k.useState(!1),[S,E]=k.useState(!1),C=a.some(M=>Lc(u[M.name]?.state));function A(M){!p||!M.dataTransfer.types.includes(Vc)||(M.preventDefault(),M.dataTransfer.dropEffect="copy",E(!0))}function N(M){if(!p)return;M.preventDefault(),E(!1);const D=M.dataTransfer.getData(Vc);D&&p(D)}return c.jsxs("section",{className:de("transition-colors",S&&"bg-primary/5 outline-dashed outline-2 -outline-offset-2 outline-primary/60"),onDragOver:A,onDragLeave:()=>E(!1),onDrop:N,children:[c.jsxs("div",{className:"flex items-center gap-1.5 bg-muted/35 px-3 py-1.5",children:[c.jsxs("button",{"aria-expanded":!x,className:"flex min-w-0 flex-1 cursor-pointer items-center gap-1.5 text-left",onClick:()=>y(M=>!M),type:"button",children:[c.jsx(Yn,{className:de("size-3.5 shrink-0 text-muted-foreground transition-transform",x&&"-rotate-90")}),c.jsx("span",{className:"truncate text-sm font-medium",children:t.name}),t.services.length?c.jsx(Pe,{size:"small",variant:"secondary",children:t.services.length}):null]}),c.jsx(Qo,{label:"Edit group",children:c.jsx(ue,{"aria-expanded":b,"aria-label":`Edit ${t.name}`,className:"size-7",onClick:()=>_(M=>!M),size:"icon",type:"button",variant:"ghost",children:c.jsx(Ic,{})})}),c.jsx(Ub,{active:C,baseUrl:`/api/bundles/${encodeURIComponent(t.name)}`,compact:!0,restartAction:async()=>{await pn(`/api/bundles/${encodeURIComponent(t.name)}/stop`,{}),await pn(`/api/bundles/${encodeURIComponent(t.name)}/start`,{})},solidStart:!0,targetLabel:`group ${t.name}`,onRefresh:i,onStarted:()=>{const M=a[0];M&&f(M.name)}})]}),b?c.jsx("div",{className:"border-t border-border bg-background/65 p-3",children:c.jsx(qC,{initialName:t.name,initialServices:t.services,onRefresh:i,onSaved:()=>_(!1),originalName:t.name,services:e,submitLabel:"Save Group"})}):null,x?null:c.jsx("div",{className:"divide-y divide-border border-t border-border bg-background/45",children:a.length?a.map(M=>c.jsx(KC,{service:M,status:u[M.name],health:o[M.name],ports:s,onRefresh:i,timeline:h,selected:m===M.name,onSelect:()=>f(M.name)},M.name)):c.jsx(dt,{variant:"muted",className:"m-4",children:"This group does not match any registered services."})})]})}function KC({service:e,status:t,onRefresh:i,selected:s=!1,onSelect:a}){const o=t?.state??"stopped",u=Lc(o),[h,m]=k.useState(!1);return c.jsxs("div",{"aria-selected":s,draggable:!0,onDragStart:f=>{f.dataTransfer.setData(Vc,e.name),e.cwd&&FC(f.dataTransfer,e.cwd),f.dataTransfer.effectAllowed="copyMove",m(!0)},onDragEnd:()=>m(!1),className:de("group grid cursor-pointer grid-cols-[1.75rem_minmax(0,1fr)_auto_auto] items-center gap-2 border-l-2 px-3 py-1.5 transition-colors",h&&"opacity-50",s?"border-l-primary bg-primary/10":"border-l-transparent hover:bg-muted"),onClick:a,role:"option",children:[c.jsx($b,{command:e.command??""}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("div",{className:"truncate text-sm font-medium",children:e.name}),c.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[c.jsx(V7,{kind:e.kind}),e.port?c.jsxs("span",{children:[":",e.port]}):null]})]}),c.jsx(Hb,{state:o}),c.jsx("span",{className:"flex items-center gap-1",onClick:f=>f.stopPropagation(),children:c.jsx(Ub,{active:u,baseUrl:`/api/services/${encodeURIComponent(e.name)}`,compact:!0,targetLabel:e.name,onRefresh:i,onStarted:a})})]})}const Vc="application/x-nomoreide-service",PS={local:{label:"local",className:"border-border bg-muted text-muted-foreground"},"docker-compose":{label:"docker",className:"border-sky-500/40 bg-sky-500/10 text-sky-700 dark:text-sky-300"},ssh:{label:"ssh",className:"border-violet-500/40 bg-violet-500/10 text-violet-700 dark:text-violet-300"}};function V7({kind:e}){const t=PS[e??"local"]??PS.local;return c.jsx("span",{className:de("rounded border px-1 py-px text-[9px] font-semibold uppercase leading-none tracking-wide",t.className),children:t.label})}function Lc(e){return e==="running"||e==="starting"}function q7(e){return`http://127.0.0.1:${e}`}function Hb({state:e}){return c.jsx(Pe,{variant:e==="running"?"success":e==="exited"?"danger":e==="starting"?"warning":"outline",className:de(e==="running"&&"font-mono"),children:e})}function K7({data:e}){const[t,i]=k.useState(!1),[s,a]=k.useState(()=>OS()),[o,u]=k.useState(""),[h,m]=k.useState([]),[f,p]=k.useState([]),[b,_]=k.useState(null),{sendToAgent:x}=Li();k.useEffect(()=>{if(!t)return;let N=!0;return _(null),Promise.allSettled([Ok(),Lk(20)]).then(M=>{if(!N)return;const[D,U]=M;D.status==="fulfilled"&&m(D.value),U.status==="fulfilled"&&p(U.value),M.filter(R=>R.status==="rejected").length&&_("Some AI context could not be loaded. You can still send available context.")}),()=>{N=!1}},[t]);const y=k.useMemo(()=>G7(e),[e]),S=WL(s),E=k.useMemo(()=>s.serviceNames.length+s.databaseNames.length+s.errorIds.length+s.repositoryPaths.length,[s]);function C(N,M){a(D=>{const U=D[N],L=U.includes(M)?U.filter(R=>R!==M):[...U,M];return{...D,[N]:L}})}function A(){S&&(x({prompt:YL({dashboard:e,databases:h,incidents:f,note:o,selection:s}),source:{type:"workspace-context",label:"AI Diagnose"},label:XL({note:o,selection:s})}),i(!1),u(""),a(OS()))}return c.jsxs(c.Fragment,{children:[c.jsxs("button",{"aria-label":"Open AI Diagnose",className:vh(),onClick:()=>i(!0),title:"Open AI Diagnose",type:"button",children:[c.jsx("span",{className:_h(),children:c.jsx(cs,{className:"size-4"})}),c.jsx("span",{className:xh(),children:"Diagnose"})]}),t?c.jsx(Ts,{icon:c.jsx(cs,{}),onClose:()=>i(!1),size:"xl",title:"AI Diagnose",children:c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-sm font-medium",children:"Pick the context the agent should inspect"}),c.jsx("div",{className:"text-xs text-muted-foreground",children:"Combine services, databases, incidents, and repositories into one focused prompt."})]}),c.jsxs(Pe,{variant:E?"secondary":"outline",children:[E," selected"]})]}),b?c.jsx(dt,{variant:"muted",children:b}):null,c.jsxs("div",{className:"grid min-h-0 gap-3 overflow-hidden lg:grid-cols-4",children:[c.jsx(Bd,{count:e.config.services.length,icon:c.jsx(Rk,{}),title:"Services",children:c.jsx("div",{className:"grid gap-2",children:e.config.services.map(N=>{const M=s.serviceNames.includes(N.name),D=e.runtime.services[N.name],U=e.health[N.name];return c.jsxs(zd,{selected:M,onClick:()=>C("serviceNames",N.name),children:[c.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[c.jsx("span",{className:"min-w-0 flex-1 truncate font-semibold",children:N.name}),c.jsx("span",{className:"shrink-0",children:c.jsx(Hb,{state:D?.state??"stopped"})})]}),c.jsxs("span",{className:"mt-1 flex flex-wrap gap-1.5 text-[11px] text-muted-foreground",children:[N.kind?c.jsx("span",{children:N.kind}):null,N.port?c.jsxs("span",{children:[":",N.port]}):null,U?.status?c.jsx("span",{children:U.status}):null]})]},N.name)})})}),c.jsx(Bd,{count:h.length,icon:c.jsx(us,{}),title:"Databases",children:h.length?c.jsx("div",{className:"grid gap-2",children:h.map(N=>c.jsxs(zd,{selected:s.databaseNames.includes(N.name),onClick:()=>C("databaseNames",N.name),children:[c.jsx("span",{className:"truncate font-semibold",children:N.name}),c.jsx("span",{className:"mt-1 block truncate text-[11px] text-muted-foreground",children:N.engine})]},N.name))}):c.jsx($S,{text:"No database connections detected."})}),c.jsx(Bd,{count:f.length,icon:c.jsx(oh,{}),title:"Error Inbox",children:f.length?c.jsx("div",{className:"grid gap-2",children:f.map(N=>c.jsxs(zd,{selected:s.errorIds.includes(N.id),onClick:()=>C("errorIds",N.id),children:[c.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[c.jsx("span",{className:"min-w-0 flex-1 truncate font-semibold",children:N.title}),c.jsx(Pe,{appearance:"subtle",size:"small",variant:N.level==="error"?"danger":"secondary",children:N.level})]}),c.jsxs("span",{className:"mt-1 block min-w-0 truncate font-mono text-[11px] text-muted-foreground",children:[N.service," x",N.count]})]},N.id))}):c.jsx($S,{text:"No recent incidents."})}),c.jsx(Bd,{count:y.length,icon:c.jsx(Wn,{}),title:"Git Repositories",children:c.jsx("div",{className:"grid gap-2",children:y.map(N=>{const M=s.repositoryPaths.includes(N.path),D=N.path===(e.git.selectedRepository?.path??e.git.cwd),U=D?e.git.status?.files.length??0:void 0;return c.jsxs(zd,{selected:M,onClick:()=>C("repositoryPaths",N.path),children:[c.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[c.jsx("span",{className:"min-w-0 flex-1 truncate font-semibold",children:N.name}),D?c.jsx(Pe,{className:"shrink-0",size:"small",variant:"outline",children:"current"}):null]}),c.jsx("span",{className:"mt-1 block min-w-0 truncate font-mono text-[11px] text-muted-foreground",children:N.path}),U!==void 0?c.jsx("span",{className:"mt-1 block truncate text-[11px] text-muted-foreground",children:U?`${U} changed file${U===1?"":"s"}`:"No changed files"}):null]},N.path)})})})]}),c.jsxs("label",{className:"block space-y-2",children:[c.jsx("span",{className:"text-sm font-medium",children:"Extra context"}),c.jsx("textarea",{className:"min-h-24 w-full resize-y rounded-md border border-border bg-background px-3 py-2 text-sm outline-none transition-colors placeholder:text-muted-foreground focus:border-foreground/40 focus:ring-2 focus:ring-ring",onChange:N=>u(N.target.value),placeholder:"Example: checkout is failing after login, API exits when DB is selected...",value:o})]}),c.jsxs("div",{className:"flex items-center justify-end gap-2",children:[c.jsx(ue,{onClick:()=>i(!1),type:"button",variant:"outline",children:"Cancel"}),c.jsxs(ue,{className:"gap-2",disabled:!S,onClick:A,type:"button",children:[c.jsx(dM,{className:"size-4"}),"Send"]})]})]})}):null]})}function Bd({children:e,count:t,icon:i,title:s}){return c.jsxs("section",{className:"flex max-h-[min(520px,calc(100vh-18rem))] min-h-0 min-w-0 flex-col space-y-2 rounded-md border border-border bg-background/45 p-3",children:[c.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-sm font-semibold",children:[c.jsx("span",{className:"flex size-6 items-center justify-center rounded-md border border-border bg-background text-muted-foreground [&_svg]:size-3.5",children:i}),c.jsx("span",{className:"min-w-0 flex-1 truncate",children:s}),c.jsx(Pe,{className:"shrink-0",size:"small",variant:"outline",children:t})]}),c.jsx("div",{className:"min-h-0 flex-1 overflow-auto pr-1",children:e})]})}function zd({children:e,onClick:t,selected:i}){return c.jsx("button",{"aria-pressed":i,className:de("min-h-16 min-w-0 rounded-md border p-3 text-left text-sm transition-colors",i?"border-primary bg-primary/10 text-foreground":"border-border bg-background hover:border-foreground/30 hover:bg-muted/60"),onClick:t,type:"button",children:e})}function $S({text:e}){return c.jsx("div",{className:"rounded-md border border-dashed border-border bg-background/60 px-3 py-3 text-xs text-muted-foreground",children:e})}function G7(e){return e.config.gitRepositories.length?e.config.gitRepositories:e.git.selectedRepository?[e.git.selectedRepository]:[{name:e.git.cwd.split("/").pop()??"repository",path:e.git.cwd}]}const W7=new Set(["c","cpp","cs","go","java","js","jsx","kt","mjs","py","rs","swift","ts","tsx"]),Y7=new Set([".env",".gitignore","components.json","dockerfile","package.json","tsconfig.json","vite.config.ts"]),X7=new Set(["conf","config","ini","toml","yaml","yml"]),Z7=new Set(["csv","json","sql","xml"]),Q7=new Set(["md","mdx","rst","txt"]),J7=new Set(["gif","jpeg","jpg","png","svg","webp"]),e9=new Set(["package-lock.json","pnpm-lock.yaml","yarn.lock"]),t9=new Set(["css","less","sass","scss"]);function i9(e){const t=e.split("/").pop()?.toLowerCase()??e.toLowerCase(),i=t.includes(".")?t.split(".").pop()??"":"";return e9.has(t)||t.endsWith(".lock")?"lock":n9(t)?"test":Y7.has(t)||X7.has(i)?"config":t9.has(i)?"style":J7.has(i)?"image":Q7.has(i)?"document":Z7.has(i)?"data":W7.has(i)?"code":"generic"}function n9(e){return e.includes(".test.")||e.includes(".spec.")||e.endsWith("_test.go")}function Fb({path:e,className:t}){const i=i9(e),s=s9[i];return c.jsx(s,{"aria-label":`${i} file`,className:de("size-3.5 shrink-0",r9[i],t)})}const s9={code:yk,config:mM,data:us,document:wk,generic:kk,image:_4,lock:A4,style:U4,test:n4},r9={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 a9(e){const t=e.lastIndexOf(".");return t>0?e.slice(t):""}function o9({onPick:e,onClose:t}){const[i,s]=k.useState(""),[a,o]=k.useState(null),[u,h]=k.useState(null),[m,f]=k.useState(!1),p=k.useRef(null),b=a?a.parent!==a.path:!1;return k.useEffect(()=>{function _(x){p.current&&!p.current.contains(x.target)&&t()}return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[t]),k.useEffect(()=>{let _=!0;return f(!0),h(null),zk(i,{files:!0}).then(x=>_&&o(x)).catch(x=>_&&h(x instanceof Error?x.message:String(x))).finally(()=>_&&f(!1)),()=>{_=!1}},[i]),c.jsxs("div",{ref:p,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:[c.jsxs("div",{className:"flex items-center gap-1 border-b border-border px-2 py-1.5",children:[c.jsx(ue,{"aria-label":"Parent folder",className:"size-7",disabled:!b,onClick:()=>a&&s(a.parent),size:"icon",type:"button",variant:"ghost",children:c.jsx(Ph,{})}),c.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[11px] text-muted-foreground",title:a?.path,children:a?.path??"…"}),m?c.jsx(Oi,{className:"size-3.5 animate-spin text-muted-foreground"}):null,a?c.jsxs(ue,{className:"h-7 px-2 text-[11px]",onClick:()=>e(a.path),size:"sm",title:"Attach this folder",type:"button",variant:"outline",children:[c.jsx(PA,{})," This folder"]}):null,c.jsx(ue,{"aria-label":"Close",className:"size-7",onClick:t,size:"icon",type:"button",variant:"ghost",children:c.jsx(Ji,{})})]}),c.jsx("div",{className:"max-h-64 overflow-auto p-1",children:u?c.jsx(dt,{variant:"destructive",className:"m-1",children:u}):a&&a.entries.length===0?c.jsx(dt,{variant:"muted",className:"m-1 text-center",children:"Empty folder."}):a?.entries.map(_=>{const x=_.isDir?"":a9(_.name);return c.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:()=>_.isDir?s(_.path):e(_.path),title:_.path,type:"button",children:[_.isDir?c.jsx(Ga,{className:"size-3.5 shrink-0 text-amber-600"}):c.jsx(Fb,{path:_.path}),c.jsx("span",{className:"min-w-0 flex-1 truncate",children:_.name}),x?c.jsx("span",{className:"shrink-0 rounded bg-muted px-1 font-mono text-[10px] text-muted-foreground",children:x}):null]},_.path)})})]})}const l9=/```options[^\n]*\n([\s\S]*?)```/g,c9=/```service[^\n]*\n([\s\S]*?)```/g,u9=/```(?:options|service)[^\n]*\n[\s\S]*$/;function d9(e){const t=[];let i=null,s=e.replace(l9,(a,o)=>{for(const u of o.split(`
|
|
71
|
-
`)){const h=u.replace(/^[-*\d.)\s]+/,"").trim();h&&t.push(h)}return""});return s=s.replace(c9,(a,o)=>{const u=o.split(`
|
|
72
|
-
`).map(h=>h.trim()).find(Boolean);return u&&(i=u),""}),s=s.replace(u9,""),{body:s.trim(),options:t,service:i}}function h9({options:e,disabled:t,onChoose:i}){return c.jsx("div",{className:"flex flex-wrap gap-1.5",children:e.map(s=>c.jsx(ue,{className:"h-7",disabled:t,onClick:()=>i(s),size:"sm",type:"button",variant:"outline",children:s},s))})}function f9({service:e,onStart:t,onOpen:i}){return c.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 rounded-md border border-border bg-muted/30 px-2 py-1.5",children:[c.jsxs("span",{className:"text-[11px] text-muted-foreground",children:["Added ",c.jsx("span",{className:"font-medium text-foreground",children:e})]}),c.jsxs("div",{className:"ml-auto flex gap-1.5",children:[c.jsxs(ue,{className:"h-7",onClick:()=>t(e),size:"sm",type:"button",children:[c.jsx(Uh,{})," Start"]}),i?c.jsxs(ue,{className:"h-7",onClick:()=>i(e),size:"sm",type:"button",variant:"outline",children:[c.jsx(nb,{})," Open"]}):null]})]})}function Vb(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Xa=Vb();function GC(e){Xa=e}var La={exec:()=>null};function Io(e){let t=[];return i=>{let s=Math.max(0,Math.min(3,i-1)),a=t[s];return a||(a=e(s),t[s]=a),a}}function at(e,t=""){let i=typeof e=="string"?e:e.source,s={replace:(a,o)=>{let u=typeof o=="string"?o:o.source;return u=u.replace(Fi.caret,"$1"),i=i.replace(a,u),s},getRegex:()=>new RegExp(i,t)};return s}var m9=((e="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+e)}catch{return!1}})(),Fi={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Io(e=>new RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Io(e=>new RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Io(e=>new RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:Io(e=>new RegExp(`^ {0,${e}}#`)),htmlBeginRegex:Io(e=>new RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Io(e=>new RegExp(`^ {0,${e}}>`))},p9=/^(?:[ \t]*(?:\n|$))+/,g9=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,b9=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,au=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,v9=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,qb=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,WC=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,YC=at(WC).replace(/bull/g,qb).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),_9=at(WC).replace(/bull/g,qb).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Kb=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,x9=/^[^\n]+/,Gb=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,y9=at(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Gb).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),S9=at(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,qb).getRegex(),Yh="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Wb=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,w9=at("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Wb).replace("tag",Yh).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),XC=at(Kb).replace("hr",au).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Yh).getRegex(),k9=at(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",XC).getRegex(),Yb={blockquote:k9,code:g9,def:y9,fences:b9,heading:v9,hr:au,html:w9,lheading:YC,list:S9,newline:p9,paragraph:XC,table:La,text:x9},US=at("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",au).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Yh).getRegex(),E9={...Yb,lheading:_9,table:US,paragraph:at(Kb).replace("hr",au).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",US).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Yh).getRegex()},C9={...Yb,html:at(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Wb).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:La,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:at(Kb).replace("hr",au).replace("heading",` *#{1,6} *[^
|
|
73
|
-
]`).replace("lheading",YC).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},N9=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,T9=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ZC=/^( {2,}|\\)\n(?!\s*$)/,A9=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ul=/[\p{P}\p{S}]/u,Xh=/[\s\p{P}\p{S}]/u,Xb=/[^\s\p{P}\p{S}]/u,M9=at(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Xh).getRegex(),QC=/(?!~)[\p{P}\p{S}]/u,R9=/(?!~)[\s\p{P}\p{S}]/u,j9=/(?:[^\s\p{P}\p{S}]|~)/u,D9=at(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",m9?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),JC=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,O9=at(JC,"u").replace(/punct/g,ul).getRegex(),L9=at(JC,"u").replace(/punct/g,QC).getRegex(),eN="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",B9=at(eN,"gu").replace(/notPunctSpace/g,Xb).replace(/punctSpace/g,Xh).replace(/punct/g,ul).getRegex(),z9=at(eN,"gu").replace(/notPunctSpace/g,j9).replace(/punctSpace/g,R9).replace(/punct/g,QC).getRegex(),I9=at("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Xb).replace(/punctSpace/g,Xh).replace(/punct/g,ul).getRegex(),P9=at(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ul).getRegex(),$9="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",U9=at($9,"gu").replace(/notPunctSpace/g,Xb).replace(/punctSpace/g,Xh).replace(/punct/g,ul).getRegex(),H9=at(/\\(punct)/,"gu").replace(/punct/g,ul).getRegex(),F9=at(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),V9=at(Wb).replace("(?:-->|$)","-->").getRegex(),q9=at("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",V9).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),wh=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,K9=at(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",wh).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),tN=at(/^!?\[(label)\]\[(ref)\]/).replace("label",wh).replace("ref",Gb).getRegex(),iN=at(/^!?\[(ref)\](?:\[\])?/).replace("ref",Gb).getRegex(),G9=at("reflink|nolink(?!\\()","g").replace("reflink",tN).replace("nolink",iN).getRegex(),HS=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Zb={_backpedal:La,anyPunctuation:H9,autolink:F9,blockSkip:D9,br:ZC,code:T9,del:La,delLDelim:La,delRDelim:La,emStrongLDelim:O9,emStrongRDelimAst:B9,emStrongRDelimUnd:I9,escape:N9,link:K9,nolink:iN,punctuation:M9,reflink:tN,reflinkSearch:G9,tag:q9,text:A9,url:La},W9={...Zb,link:at(/^!?\[(label)\]\((.*?)\)/).replace("label",wh).getRegex(),reflink:at(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",wh).getRegex()},o0={...Zb,emStrongRDelimAst:z9,emStrongLDelim:L9,delLDelim:P9,delRDelim:U9,url:at(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",HS).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:at(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",HS).getRegex()},Y9={...o0,br:at(ZC).replace("{2,}","*").getRegex(),text:at(o0.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Id={normal:Yb,gfm:E9,pedantic:C9},hc={normal:Zb,gfm:o0,breaks:Y9,pedantic:W9},X9={"&":"&","<":"<",">":">",'"':""","'":"'"},FS=e=>X9[e];function _s(e,t){if(t){if(Fi.escapeTest.test(e))return e.replace(Fi.escapeReplace,FS)}else if(Fi.escapeTestNoEncode.test(e))return e.replace(Fi.escapeReplaceNoEncode,FS);return e}function VS(e){try{e=encodeURI(e).replace(Fi.percentDecode,"%")}catch{return null}return e}function qS(e,t){let i=e.replace(Fi.findPipe,(o,u,h)=>{let m=!1,f=u;for(;--f>=0&&h[f]==="\\";)m=!m;return m?"|":" |"}),s=i.split(Fi.splitPipe),a=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),t)if(s.length>t)s.splice(t);else for(;s.length<t;)s.push("");for(;a<s.length;a++)s[a]=s[a].trim().replace(Fi.slashPipe,"|");return s}function qr(e,t,i){let s=e.length;if(s===0)return"";let a=0;for(;a<s&&e.charAt(s-a-1)===t;)a++;return e.slice(0,s-a)}function KS(e){let t=e.split(`
|
|
74
|
-
`),i=t.length-1;for(;i>=0&&Fi.blankLine.test(t[i]);)i--;return t.length-i<=2?e:t.slice(0,i+1).join(`
|
|
75
|
-
`)}function Z9(e,t){if(e.indexOf(t[1])===-1)return-1;let i=0;for(let s=0;s<e.length;s++)if(e[s]==="\\")s++;else if(e[s]===t[0])i++;else if(e[s]===t[1]&&(i--,i<0))return s;return i>0?-2:-1}function Q9(e,t=0){let i=t,s="";for(let a of e)if(a===" "){let o=4-i%4;s+=" ".repeat(o),i+=o}else s+=a,i++;return s}function GS(e,t,i,s,a){let o=t.href,u=t.title||null,h=e[1].replace(a.other.outputLinkReplace,"$1");s.state.inLink=!0;let m={type:e[0].charAt(0)==="!"?"image":"link",raw:i,href:o,title:u,text:h,tokens:s.inlineTokens(h)};return s.state.inLink=!1,m}function J9(e,t,i){let s=e.match(i.other.indentCodeCompensation);if(s===null)return t;let a=s[1];return t.split(`
|
|
76
|
-
`).map(o=>{let u=o.match(i.other.beginningSpace);if(u===null)return o;let[h]=u;return h.length>=a.length?o.slice(a.length):o}).join(`
|
|
77
|
-
`)}var kh=class{options;rules;lexer;constructor(e){this.options=e||Xa}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let i=this.options.pedantic?t[0]:KS(t[0]),s=i.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:i,codeBlockStyle:"indented",text:s}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let i=t[0],s=J9(i,t[3]||"",this.rules);return{type:"code",raw:i,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:s}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let i=t[2].trim();if(this.rules.other.endingHash.test(i)){let s=qr(i,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(i=s.trim())}return{type:"heading",raw:qr(t[0],`
|
|
78
|
-
`),depth:t[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:qr(t[0],`
|
|
79
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let i=qr(t[0],`
|
|
80
|
-
`).split(`
|
|
81
|
-
`),s="",a="",o=[];for(;i.length>0;){let u=!1,h=[],m;for(m=0;m<i.length;m++)if(this.rules.other.blockquoteStart.test(i[m]))h.push(i[m]),u=!0;else if(!u)h.push(i[m]);else break;i=i.slice(m);let f=h.join(`
|
|
82
|
-
`),p=f.replace(this.rules.other.blockquoteSetextReplace,`
|
|
83
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
|
84
|
-
${f}`:f,a=a?`${a}
|
|
85
|
-
${p}`:p;let b=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,o,!0),this.lexer.state.top=b,i.length===0)break;let _=o.at(-1);if(_?.type==="code")break;if(_?.type==="blockquote"){let x=_,y=x.raw+`
|
|
86
|
-
`+i.join(`
|
|
87
|
-
`),S=this.blockquote(y);o[o.length-1]=S,s=s.substring(0,s.length-x.raw.length)+S.raw,a=a.substring(0,a.length-x.text.length)+S.text;break}else if(_?.type==="list"){let x=_,y=x.raw+`
|
|
88
|
-
`+i.join(`
|
|
89
|
-
`),S=this.list(y);o[o.length-1]=S,s=s.substring(0,s.length-_.raw.length)+S.raw,a=a.substring(0,a.length-x.raw.length)+S.raw,i=y.substring(o.at(-1).raw.length).split(`
|
|
90
|
-
`);continue}}return{type:"blockquote",raw:s,tokens:o,text:a}}}list(e){let t=this.rules.block.list.exec(e);if(t){let i=t[1].trim(),s=i.length>1,a={type:"list",raw:"",ordered:s,start:s?+i.slice(0,-1):"",loose:!1,items:[]};i=s?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=s?i:"[*+-]");let o=this.rules.other.listItemRegex(i),u=!1;for(;e;){let m=!1,f="",p="";if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;f=t[0],e=e.substring(f.length);let b=Q9(t[2].split(`
|
|
91
|
-
`,1)[0],t[1].length),_=e.split(`
|
|
92
|
-
`,1)[0],x=!b.trim(),y=0;if(this.options.pedantic?(y=2,p=b.trimStart()):x?y=t[1].length+1:(y=b.search(this.rules.other.nonSpaceChar),y=y>4?1:y,p=b.slice(y),y+=t[1].length),x&&this.rules.other.blankLine.test(_)&&(f+=_+`
|
|
93
|
-
`,e=e.substring(_.length+1),m=!0),!m){let S=this.rules.other.nextBulletRegex(y),E=this.rules.other.hrRegex(y),C=this.rules.other.fencesBeginRegex(y),A=this.rules.other.headingBeginRegex(y),N=this.rules.other.htmlBeginRegex(y),M=this.rules.other.blockquoteBeginRegex(y);for(;e;){let D=e.split(`
|
|
94
|
-
`,1)[0],U;if(_=D,this.options.pedantic?(_=_.replace(this.rules.other.listReplaceNesting," "),U=_):U=_.replace(this.rules.other.tabCharGlobal," "),C.test(_)||A.test(_)||N.test(_)||M.test(_)||S.test(_)||E.test(_))break;if(U.search(this.rules.other.nonSpaceChar)>=y||!_.trim())p+=`
|
|
95
|
-
`+U.slice(y);else{if(x||b.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||C.test(b)||A.test(b)||E.test(b))break;p+=`
|
|
96
|
-
`+_}x=!_.trim(),f+=D+`
|
|
97
|
-
`,e=e.substring(D.length+1),b=U.slice(y)}}a.loose||(u?a.loose=!0:this.rules.other.doubleBlankLine.test(f)&&(u=!0)),a.items.push({type:"list_item",raw:f,task:!!this.options.gfm&&this.rules.other.listIsTask.test(p),loose:!1,text:p,tokens:[]}),a.raw+=f}let h=a.items.at(-1);if(h)h.raw=h.raw.trimEnd(),h.text=h.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let m of a.items){this.lexer.state.top=!1,m.tokens=this.lexer.blockTokens(m.text,[]);let f=m.tokens[0];if(m.task&&(f?.type==="text"||f?.type==="paragraph")){m.text=m.text.replace(this.rules.other.listReplaceTask,""),f.raw=f.raw.replace(this.rules.other.listReplaceTask,""),f.text=f.text.replace(this.rules.other.listReplaceTask,"");for(let b=this.lexer.inlineQueue.length-1;b>=0;b--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[b].src)){this.lexer.inlineQueue[b].src=this.lexer.inlineQueue[b].src.replace(this.rules.other.listReplaceTask,"");break}let p=this.rules.other.listTaskCheckbox.exec(m.raw);if(p){let b={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};m.checked=b.checked,a.loose?m.tokens[0]&&["paragraph","text"].includes(m.tokens[0].type)&&"tokens"in m.tokens[0]&&m.tokens[0].tokens?(m.tokens[0].raw=b.raw+m.tokens[0].raw,m.tokens[0].text=b.raw+m.tokens[0].text,m.tokens[0].tokens.unshift(b)):m.tokens.unshift({type:"paragraph",raw:b.raw,text:b.raw,tokens:[b]}):m.tokens.unshift(b)}}else m.task&&(m.task=!1);if(!a.loose){let p=m.tokens.filter(_=>_.type==="space"),b=p.length>0&&p.some(_=>this.rules.other.anyLine.test(_.raw));a.loose=b}}if(a.loose)for(let m of a.items){m.loose=!0;for(let f of m.tokens)f.type==="text"&&(f.type="paragraph")}return a}}html(e){let t=this.rules.block.html.exec(e);if(t){let i=KS(t[0]);return{type:"html",block:!0,raw:i,pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:i}}}def(e){let t=this.rules.block.def.exec(e);if(t){let i=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:i,raw:qr(t[0],`
|
|
98
|
-
`),href:s,title:a}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let i=qS(t[1]),s=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),a=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
99
|
-
`):[],o={type:"table",raw:qr(t[0],`
|
|
100
|
-
`),header:[],align:[],rows:[]};if(i.length===s.length){for(let u of s)this.rules.other.tableAlignRight.test(u)?o.align.push("right"):this.rules.other.tableAlignCenter.test(u)?o.align.push("center"):this.rules.other.tableAlignLeft.test(u)?o.align.push("left"):o.align.push(null);for(let u=0;u<i.length;u++)o.header.push({text:i[u],tokens:this.lexer.inline(i[u]),header:!0,align:o.align[u]});for(let u of a)o.rows.push(qS(u,o.header.length).map((h,m)=>({text:h,tokens:this.lexer.inline(h),header:!1,align:o.align[m]})));return o}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let i=t[1].trim();return{type:"heading",raw:qr(t[0],`
|
|
101
|
-
`),depth:t[2].charAt(0)==="="?1:2,text:i,tokens:this.lexer.inline(i)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let i=t[1].charAt(t[1].length-1)===`
|
|
102
|
-
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:i,tokens:this.lexer.inline(i)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let i=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let o=qr(i.slice(0,-1),"\\");if((i.length-o.length)%2===0)return}else{let o=Z9(t[2],"()");if(o===-2)return;if(o>-1){let u=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,u).trim(),t[3]=""}}let s=t[2],a="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(s);o&&(s=o[1],a=o[3])}else a=t[3]?t[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?s=s.slice(1):s=s.slice(1,-1)),GS(t,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){let s=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),a=t[s.toLowerCase()];if(!a){let o=i[0].charAt(0);return{type:"text",raw:o,text:o}}return GS(i,a,i[0],this.lexer,this.rules)}}emStrong(e,t,i=""){let s=this.rules.inline.emStrongLDelim.exec(e);if(!(!s||!s[1]&&!s[2]&&!s[3]&&!s[4]||s[4]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[3])||!i||this.rules.inline.punctuation.exec(i))){let a=[...s[0]].length-1,o,u,h=a,m=0,f=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(f.lastIndex=0,t=t.slice(-1*e.length+a);(s=f.exec(t))!==null;){if(o=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!o)continue;if(u=[...o].length,s[3]||s[4]){h+=u;continue}else if((s[5]||s[6])&&a%3&&!((a+u)%3)){m+=u;continue}if(h-=u,h>0)continue;u=Math.min(u,u+h+m);let p=[...s[0]][0].length,b=e.slice(0,a+s.index+p+u);if(Math.min(a,u)%2){let x=b.slice(1,-1);return{type:"em",raw:b,text:x,tokens:this.lexer.inlineTokens(x)}}let _=b.slice(2,-2);return{type:"strong",raw:b,text:_,tokens:this.lexer.inlineTokens(_)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let i=t[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(i),a=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return s&&a&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:t[0],text:i}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e,t,i=""){let s=this.rules.inline.delLDelim.exec(e);if(s&&(!s[1]||!i||this.rules.inline.punctuation.exec(i))){let a=[...s[0]].length-1,o,u,h=a,m=this.rules.inline.delRDelim;for(m.lastIndex=0,t=t.slice(-1*e.length+a);(s=m.exec(t))!==null;){if(o=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!o||(u=[...o].length,u!==a))continue;if(s[3]||s[4]){h+=u;continue}if(h-=u,h>0)continue;u=Math.min(u,u+h);let f=[...s[0]][0].length,p=e.slice(0,a+s.index+f+u),b=p.slice(a,-a);return{type:"del",raw:p,text:b,tokens:this.lexer.inlineTokens(b)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let i,s;return t[2]==="@"?(i=t[1],s="mailto:"+i):(i=t[1],s=i),{type:"link",raw:t[0],text:i,href:s,tokens:[{type:"text",raw:i,text:i}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let i,s;if(t[2]==="@")i=t[0],s="mailto:"+i;else{let a;do a=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(a!==t[0]);i=t[0],t[1]==="www."?s="http://"+t[0]:s=t[0]}return{type:"link",raw:t[0],text:i,href:s,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let i=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:i}}}},as=class l0{tokens;options;state;inlineQueue;tokenizer;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Xa,this.options.tokenizer=this.options.tokenizer||new kh,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let i={other:Fi,block:Id.normal,inline:hc.normal};this.options.pedantic?(i.block=Id.pedantic,i.inline=hc.pedantic):this.options.gfm&&(i.block=Id.gfm,this.options.breaks?i.inline=hc.breaks:i.inline=hc.gfm),this.tokenizer.rules=i}static get rules(){return{block:Id,inline:hc}}static lex(t,i){return new l0(i).lex(t)}static lexInline(t,i){return new l0(i).inlineTokens(t)}lex(t){t=t.replace(Fi.carriageReturn,`
|
|
103
|
-
`),this.blockTokens(t,this.tokens);for(let i=0;i<this.inlineQueue.length;i++){let s=this.inlineQueue[i];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,i=[],s=!1){this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(Fi.tabCharGlobal," ").replace(Fi.spaceLine,""));let a=1/0;for(;t;){if(t.length<a)a=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}let o;if(this.options.extensions?.block?.some(h=>(o=h.call({lexer:this},t,i))?(t=t.substring(o.raw.length),i.push(o),!0):!1))continue;if(o=this.tokenizer.space(t)){t=t.substring(o.raw.length);let h=i.at(-1);o.raw.length===1&&h!==void 0?h.raw+=`
|
|
104
|
-
`:i.push(o);continue}if(o=this.tokenizer.code(t)){t=t.substring(o.raw.length);let h=i.at(-1);h?.type==="paragraph"||h?.type==="text"?(h.raw+=(h.raw.endsWith(`
|
|
105
|
-
`)?"":`
|
|
106
|
-
`)+o.raw,h.text+=`
|
|
107
|
-
`+o.text,this.inlineQueue.at(-1).src=h.text):i.push(o);continue}if(o=this.tokenizer.fences(t)){t=t.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.heading(t)){t=t.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.hr(t)){t=t.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.blockquote(t)){t=t.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.list(t)){t=t.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.html(t)){t=t.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.def(t)){t=t.substring(o.raw.length);let h=i.at(-1);h?.type==="paragraph"||h?.type==="text"?(h.raw+=(h.raw.endsWith(`
|
|
108
|
-
`)?"":`
|
|
109
|
-
`)+o.raw,h.text+=`
|
|
110
|
-
`+o.raw,this.inlineQueue.at(-1).src=h.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title},i.push(o));continue}if(o=this.tokenizer.table(t)){t=t.substring(o.raw.length),i.push(o);continue}if(o=this.tokenizer.lheading(t)){t=t.substring(o.raw.length),i.push(o);continue}let u=t;if(this.options.extensions?.startBlock){let h=1/0,m=t.slice(1),f;this.options.extensions.startBlock.forEach(p=>{f=p.call({lexer:this},m),typeof f=="number"&&f>=0&&(h=Math.min(h,f))}),h<1/0&&h>=0&&(u=t.substring(0,h+1))}if(this.state.top&&(o=this.tokenizer.paragraph(u))){let h=i.at(-1);s&&h?.type==="paragraph"?(h.raw+=(h.raw.endsWith(`
|
|
111
|
-
`)?"":`
|
|
112
|
-
`)+o.raw,h.text+=`
|
|
113
|
-
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):i.push(o),s=u.length!==t.length,t=t.substring(o.raw.length);continue}if(o=this.tokenizer.text(t)){t=t.substring(o.raw.length);let h=i.at(-1);h?.type==="text"?(h.raw+=(h.raw.endsWith(`
|
|
114
|
-
`)?"":`
|
|
115
|
-
`)+o.raw,h.text+=`
|
|
116
|
-
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):i.push(o);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return this.state.top=!0,i}inline(t,i=[]){return this.inlineQueue.push({src:t,tokens:i}),i}inlineTokens(t,i=[]){this.tokenizer.lexer=this;let s=t,a=null;if(this.tokens.links){let f=Object.keys(this.tokens.links);if(f.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(s))!==null;)f.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,a.index)+"["+"a".repeat(a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.anyPunctuation.exec(s))!==null;)s=s.slice(0,a.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let o;for(;(a=this.tokenizer.rules.inline.blockSkip.exec(s))!==null;)o=a[2]?a[2].length:0,s=s.slice(0,a.index+o)+"["+"a".repeat(a[0].length-o-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let u=!1,h="",m=1/0;for(;t;){if(t.length<m)m=t.length;else{this.infiniteLoopError(t.charCodeAt(0));break}u||(h=""),u=!1;let f;if(this.options.extensions?.inline?.some(b=>(f=b.call({lexer:this},t,i))?(t=t.substring(f.raw.length),i.push(f),!0):!1))continue;if(f=this.tokenizer.escape(t)){t=t.substring(f.raw.length),i.push(f);continue}if(f=this.tokenizer.tag(t)){t=t.substring(f.raw.length),i.push(f);continue}if(f=this.tokenizer.link(t)){t=t.substring(f.raw.length),i.push(f);continue}if(f=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(f.raw.length);let b=i.at(-1);f.type==="text"&&b?.type==="text"?(b.raw+=f.raw,b.text+=f.text):i.push(f);continue}if(f=this.tokenizer.emStrong(t,s,h)){t=t.substring(f.raw.length),i.push(f);continue}if(f=this.tokenizer.codespan(t)){t=t.substring(f.raw.length),i.push(f);continue}if(f=this.tokenizer.br(t)){t=t.substring(f.raw.length),i.push(f);continue}if(f=this.tokenizer.del(t,s,h)){t=t.substring(f.raw.length),i.push(f);continue}if(f=this.tokenizer.autolink(t)){t=t.substring(f.raw.length),i.push(f);continue}if(!this.state.inLink&&(f=this.tokenizer.url(t))){t=t.substring(f.raw.length),i.push(f);continue}let p=t;if(this.options.extensions?.startInline){let b=1/0,_=t.slice(1),x;this.options.extensions.startInline.forEach(y=>{x=y.call({lexer:this},_),typeof x=="number"&&x>=0&&(b=Math.min(b,x))}),b<1/0&&b>=0&&(p=t.substring(0,b+1))}if(f=this.tokenizer.inlineText(p)){t=t.substring(f.raw.length),f.raw.slice(-1)!=="_"&&(h=f.raw.slice(-1)),u=!0;let b=i.at(-1);b?.type==="text"?(b.raw+=f.raw,b.text+=f.text):i.push(f);continue}if(t){this.infiniteLoopError(t.charCodeAt(0));break}}return i}infiniteLoopError(t){let i="Infinite loop on byte: "+t;if(this.options.silent)console.error(i);else throw new Error(i)}},Eh=class{options;parser;constructor(e){this.options=e||Xa}space(e){return""}code({text:e,lang:t,escaped:i}){let s=(t||"").match(Fi.notSpaceStart)?.[0],a=e.replace(Fi.endingNewline,"")+`
|
|
117
|
-
`;return s?'<pre><code class="language-'+_s(s)+'">'+(i?a:_s(a,!0))+`</code></pre>
|
|
118
|
-
`:"<pre><code>"+(i?a:_s(a,!0))+`</code></pre>
|
|
119
|
-
`}blockquote({tokens:e}){return`<blockquote>
|
|
120
|
-
${this.parser.parse(e)}</blockquote>
|
|
121
|
-
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
122
|
-
`}hr(e){return`<hr>
|
|
123
|
-
`}list(e){let t=e.ordered,i=e.start,s="";for(let u=0;u<e.items.length;u++){let h=e.items[u];s+=this.listitem(h)}let a=t?"ol":"ul",o=t&&i!==1?' start="'+i+'"':"";return"<"+a+o+`>
|
|
124
|
-
`+s+"</"+a+`>
|
|
125
|
-
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
126
|
-
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
127
|
-
`}table(e){let t="",i="";for(let a=0;a<e.header.length;a++)i+=this.tablecell(e.header[a]);t+=this.tablerow({text:i});let s="";for(let a=0;a<e.rows.length;a++){let o=e.rows[a];i="";for(let u=0;u<o.length;u++)i+=this.tablecell(o[u]);s+=this.tablerow({text:i})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
|
128
|
-
<thead>
|
|
129
|
-
`+t+`</thead>
|
|
130
|
-
`+s+`</table>
|
|
131
|
-
`}tablerow({text:e}){return`<tr>
|
|
132
|
-
${e}</tr>
|
|
133
|
-
`}tablecell(e){let t=this.parser.parseInline(e.tokens),i=e.header?"th":"td";return(e.align?`<${i} align="${e.align}">`:`<${i}>`)+t+`</${i}>
|
|
134
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${_s(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:i}){let s=this.parser.parseInline(i),a=VS(e);if(a===null)return s;e=a;let o='<a href="'+e+'"';return t&&(o+=' title="'+_s(t)+'"'),o+=">"+s+"</a>",o}image({href:e,title:t,text:i,tokens:s}){s&&(i=this.parser.parseInline(s,this.parser.textRenderer));let a=VS(e);if(a===null)return _s(i);e=a;let o=`<img src="${e}" alt="${_s(i)}"`;return t&&(o+=` title="${_s(t)}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:_s(e.text)}},Qb=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},os=class c0{options;renderer;textRenderer;constructor(t){this.options=t||Xa,this.options.renderer=this.options.renderer||new Eh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Qb}static parse(t,i){return new c0(i).parse(t)}static parseInline(t,i){return new c0(i).parseInline(t)}parse(t){this.renderer.parser=this;let i="";for(let s=0;s<t.length;s++){let a=t[s];if(this.options.extensions?.renderers?.[a.type]){let u=a,h=this.options.extensions.renderers[u.type].call({parser:this},u);if(h!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(u.type)){i+=h||"";continue}}let o=a;switch(o.type){case"space":{i+=this.renderer.space(o);break}case"hr":{i+=this.renderer.hr(o);break}case"heading":{i+=this.renderer.heading(o);break}case"code":{i+=this.renderer.code(o);break}case"table":{i+=this.renderer.table(o);break}case"blockquote":{i+=this.renderer.blockquote(o);break}case"list":{i+=this.renderer.list(o);break}case"checkbox":{i+=this.renderer.checkbox(o);break}case"html":{i+=this.renderer.html(o);break}case"def":{i+=this.renderer.def(o);break}case"paragraph":{i+=this.renderer.paragraph(o);break}case"text":{i+=this.renderer.text(o);break}default:{let u='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return i}parseInline(t,i=this.renderer){this.renderer.parser=this;let s="";for(let a=0;a<t.length;a++){let o=t[a];if(this.options.extensions?.renderers?.[o.type]){let h=this.options.extensions.renderers[o.type].call({parser:this},o);if(h!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){s+=h||"";continue}}let u=o;switch(u.type){case"escape":{s+=i.text(u);break}case"html":{s+=i.html(u);break}case"link":{s+=i.link(u);break}case"image":{s+=i.image(u);break}case"checkbox":{s+=i.checkbox(u);break}case"strong":{s+=i.strong(u);break}case"em":{s+=i.em(u);break}case"codespan":{s+=i.codespan(u);break}case"br":{s+=i.br(u);break}case"del":{s+=i.del(u);break}case"text":{s+=i.text(u);break}default:{let h='Token with "'+u.type+'" type was not found.';if(this.options.silent)return console.error(h),"";throw new Error(h)}}}return s}},Sc=class{options;block;constructor(e){this.options=e||Xa}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?as.lex:as.lexInline}provideParser(e=this.block){return e?os.parse:os.parseInline}},eB=class{defaults=Vb();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=os;Renderer=Eh;TextRenderer=Qb;Lexer=as;Tokenizer=kh;Hooks=Sc;constructor(...t){this.use(...t)}walkTokens(t,i){let s=[];for(let a of t)switch(s=s.concat(i.call(this,a)),a.type){case"table":{let o=a;for(let u of o.header)s=s.concat(this.walkTokens(u.tokens,i));for(let u of o.rows)for(let h of u)s=s.concat(this.walkTokens(h.tokens,i));break}case"list":{let o=a;s=s.concat(this.walkTokens(o.items,i));break}default:{let o=a;this.defaults.extensions?.childTokens?.[o.type]?this.defaults.extensions.childTokens[o.type].forEach(u=>{let h=o[u].flat(1/0);s=s.concat(this.walkTokens(h,i))}):o.tokens&&(s=s.concat(this.walkTokens(o.tokens,i)))}}return s}use(...t){let i=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(s=>{let a={...s};if(a.async=this.defaults.async||a.async||!1,s.extensions&&(s.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let u=i.renderers[o.name];u?i.renderers[o.name]=function(...h){let m=o.renderer.apply(this,h);return m===!1&&(m=u.apply(this,h)),m}:i.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let u=i[o.level];u?u.unshift(o.tokenizer):i[o.level]=[o.tokenizer],o.start&&(o.level==="block"?i.startBlock?i.startBlock.push(o.start):i.startBlock=[o.start]:o.level==="inline"&&(i.startInline?i.startInline.push(o.start):i.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(i.childTokens[o.name]=o.childTokens)}),a.extensions=i),s.renderer){let o=this.defaults.renderer||new Eh(this.defaults);for(let u in s.renderer){if(!(u in o))throw new Error(`renderer '${u}' does not exist`);if(["options","parser"].includes(u))continue;let h=u,m=s.renderer[h],f=o[h];o[h]=(...p)=>{let b=m.apply(o,p);return b===!1&&(b=f.apply(o,p)),b||""}}a.renderer=o}if(s.tokenizer){let o=this.defaults.tokenizer||new kh(this.defaults);for(let u in s.tokenizer){if(!(u in o))throw new Error(`tokenizer '${u}' does not exist`);if(["options","rules","lexer"].includes(u))continue;let h=u,m=s.tokenizer[h],f=o[h];o[h]=(...p)=>{let b=m.apply(o,p);return b===!1&&(b=f.apply(o,p)),b}}a.tokenizer=o}if(s.hooks){let o=this.defaults.hooks||new Sc;for(let u in s.hooks){if(!(u in o))throw new Error(`hook '${u}' does not exist`);if(["options","block"].includes(u))continue;let h=u,m=s.hooks[h],f=o[h];Sc.passThroughHooks.has(u)?o[h]=p=>{if(this.defaults.async&&Sc.passThroughHooksRespectAsync.has(u))return(async()=>{let _=await m.call(o,p);return f.call(o,_)})();let b=m.call(o,p);return f.call(o,b)}:o[h]=(...p)=>{if(this.defaults.async)return(async()=>{let _=await m.apply(o,p);return _===!1&&(_=await f.apply(o,p)),_})();let b=m.apply(o,p);return b===!1&&(b=f.apply(o,p)),b}}a.hooks=o}if(s.walkTokens){let o=this.defaults.walkTokens,u=s.walkTokens;a.walkTokens=function(h){let m=[];return m.push(u.call(this,h)),o&&(m=m.concat(o.call(this,h))),m}}this.defaults={...this.defaults,...a}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,i){return as.lex(t,i??this.defaults)}parser(t,i){return os.parse(t,i??this.defaults)}parseMarkdown(t){return(i,s)=>{let a={...s},o={...this.defaults,...a},u=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&a.async===!1)return u(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof i>"u"||i===null)return u(new Error("marked(): input parameter is undefined or null"));if(typeof i!="string")return u(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(i)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=t),o.async)return(async()=>{let h=o.hooks?await o.hooks.preprocess(i):i,m=await(o.hooks?await o.hooks.provideLexer(t):t?as.lex:as.lexInline)(h,o),f=o.hooks?await o.hooks.processAllTokens(m):m;o.walkTokens&&await Promise.all(this.walkTokens(f,o.walkTokens));let p=await(o.hooks?await o.hooks.provideParser(t):t?os.parse:os.parseInline)(f,o);return o.hooks?await o.hooks.postprocess(p):p})().catch(u);try{o.hooks&&(i=o.hooks.preprocess(i));let h=(o.hooks?o.hooks.provideLexer(t):t?as.lex:as.lexInline)(i,o);o.hooks&&(h=o.hooks.processAllTokens(h)),o.walkTokens&&this.walkTokens(h,o.walkTokens);let m=(o.hooks?o.hooks.provideParser(t):t?os.parse:os.parseInline)(h,o);return o.hooks&&(m=o.hooks.postprocess(m)),m}catch(h){return u(h)}}}onError(t,i){return s=>{if(s.message+=`
|
|
135
|
-
Please report this to https://github.com/markedjs/marked.`,t){let a="<p>An error occurred:</p><pre>"+_s(s.message+"",!0)+"</pre>";return i?Promise.resolve(a):a}if(i)return Promise.reject(s);throw s}}},Va=new eB;function ft(e,t){return Va.parse(e,t)}ft.options=ft.setOptions=function(e){return Va.setOptions(e),ft.defaults=Va.defaults,GC(ft.defaults),ft};ft.getDefaults=Vb;ft.defaults=Xa;ft.use=function(...e){return Va.use(...e),ft.defaults=Va.defaults,GC(ft.defaults),ft};ft.walkTokens=function(e,t){return Va.walkTokens(e,t)};ft.parseInline=Va.parseInline;ft.Parser=os;ft.parser=os.parse;ft.Renderer=Eh;ft.TextRenderer=Qb;ft.Lexer=as;ft.lexer=as.lex;ft.Tokenizer=kh;ft.Hooks=Sc;ft.parse=ft;ft.options;ft.setOptions;ft.use;ft.walkTokens;ft.parseInline;os.parse;as.lex;function tB(e){return e.replace(/<\/?(script|style|iframe|object|embed)\b[^>]*>/gi,"").replace(/\son\w+\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi,"").replace(/(href|src)\s*=\s*("|')\s*javascript:[^"']*\2/gi,"$1=$2#$2")}function iB({content:e}){const t=k.useMemo(()=>{const i=ft.parse(e,{async:!1,gfm:!0,breaks:!0});return tB(i)},[e]);return c.jsx("div",{className:"chat-md",dangerouslySetInnerHTML:{__html:t}})}function nB(e){return Math.min(e,Math.max(1,Math.ceil(e/22)))}function sB(e){const[t,i]=k.useState(e),s=k.useRef(e),a=k.useRef(e);return a.current=e,k.useEffect(()=>{e.startsWith(s.current)||(s.current=e,i(e))},[e]),k.useEffect(()=>{if(s.current.length>=a.current.length)return;const o=requestAnimationFrame(()=>{const u=a.current,h=u.slice(0,s.current.length+nB(u.length-s.current.length));s.current=h,i(h)});return()=>cancelAnimationFrame(o)},[t,e]),t}function rB(){return c.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",role:"status",children:[c.jsx(Oi,{className:"size-3.5 animate-spin"}),c.jsx("span",{children:"Thinking…"})]})}function aB({onOpenAgentPage:e,onOpenService:t}){const{error:i,success:s}=Bi(),{turns:a,streaming:o,error:u,configured:h,provider:m,approvals:f,send:p,stop:b,clear:_,respond:x,open:y,setOpen:S,draft:E,setDraft:C,insertPath:A,activeSource:N,clearSource:M,focusNonce:D,stickNonce:U,sendToAgent:L,onboarding:R,setOnboarding:$}=Li(),[I,F]=k.useState(""),[G,Y]=k.useState(!1),[Q,q]=k.useState(!1),[O,X]=k.useState(!1),[Z,V]=k.useState(null),[P,j]=k.useState(!1),W=k.useRef(null),he=k.useRef(null),oe=k.useRef(null),me=k.useRef(null);k.useEffect(()=>{if(!y||R)return;let _e=0,mt=0;const qi=()=>{const li=he.current;if(!li||E&&li.value!==E){mt++<10&&(_e=requestAnimationFrame(qi));return}li.focus();const Ki=li.value.length;li.setSelectionRange(Ki,Ki),li.scrollTop=li.scrollHeight};return _e=requestAnimationFrame(qi),()=>cancelAnimationFrame(_e)},[y,D,R]),k.useLayoutEffect(()=>{const _e=he.current;_e&&(_e.style.height="auto",_e.style.height=`${_e.scrollHeight}px`)},[E]),k.useEffect(()=>{!y||!R||requestAnimationFrame(()=>oe.current?.focus())},[y,R]),k.useEffect(()=>{if(!y)return;const _e=mt=>{me.current?.contains(mt.target)||S(!1)};return document.addEventListener("pointerdown",_e),()=>document.removeEventListener("pointerdown",_e)},[y,S]),k.useEffect(()=>{const _e=qi=>{qi.dataTransfer&&LS(qi.dataTransfer)&&Y(!0)},mt=()=>{Y(!1),q(!1)};return document.addEventListener("dragstart",_e),document.addEventListener("dragend",mt),document.addEventListener("drop",mt),()=>{document.removeEventListener("dragstart",_e),document.removeEventListener("dragend",mt),document.removeEventListener("drop",mt)}},[]);const ne=k.useRef(!0);function fe(){const _e=W.current;_e&&(ne.current=_e.scrollHeight-_e.scrollTop-_e.clientHeight<48)}k.useEffect(()=>{const _e=W.current;_e&&ne.current&&(_e.scrollTop=_e.scrollHeight)},[a,y]),k.useEffect(()=>{ne.current=!0;const _e=W.current;if(!_e)return;const mt=requestAnimationFrame(()=>{_e.scrollTop=_e.scrollHeight});return()=>cancelAnimationFrame(mt)},[U]);async function we(){const _e=E;C(""),ne.current=!0,await p(_e)}function ye(_e){_e.trim()&&(C(""),$(!1),F(""),ne.current=!0,L({prompt:HL(_e),source:{type:"repo-onboard",label:"Onboard repo"},label:`Onboard and run this repo: ${_e}`}))}function Ze(_e){ne.current=!0,p(_e)}async function ot(_e){try{await pn(`/api/services/${encodeURIComponent(_e)}/start`,{}),s(`Starting ${_e}…`)}catch(mt){i(mt instanceof Error?mt.message:`Could not start ${_e}.`)}}function lt(_e){_e.key==="Enter"&&!_e.shiftKey&&(_e.preventDefault(),we())}function Be(_e){LS(_e.dataTransfer)&&(_e.preventDefault(),_e.dataTransfer.dropEffect="copy",y||S(!0),q(!0))}function Lt(_e){_e.currentTarget.contains(_e.relatedTarget)||q(!1)}function Os(_e){q(!1);const mt=k7(_e.dataTransfer);mt&&(_e.preventDefault(),A(mt))}function Jn(_e){if(!y)return;_e.preventDefault(),_e.currentTarget.setPointerCapture(_e.pointerId),j(!0);const mt=160,qi=window.innerHeight-48;function li(oa){const mr=window.innerHeight-oa.clientY;V(Math.max(mt,Math.min(qi,mr)))}function Ki(){j(!1),window.removeEventListener("pointermove",li),window.removeEventListener("pointerup",Ki)}window.addEventListener("pointermove",li),window.addEventListener("pointerup",Ki)}return c.jsx("div",{ref:me,className:de("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",P?"select-none":"transition-[height] duration-200",y?Z===null?"h-[50vh]":"":G?"h-12":"h-9",G&&!Q&&"border-primary/60 bg-primary/5",Q&&"outline-dashed outline-2 -outline-offset-2 outline-primary/70"),style:y&&Z!==null?{height:Z}:void 0,onDragOver:Be,onDragLeave:Lt,onDrop:Os,children:y?c.jsxs(c.Fragment,{children:[c.jsx("div",{"aria-hidden":!0,className:"absolute inset-x-0 -top-1 z-10 h-2 cursor-ns-resize",onDoubleClick:()=>V(null),onPointerDown:Jn}),c.jsxs("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-20 flex items-start justify-between gap-2 px-2 pt-1.5",children:[c.jsxs("div",{className:"pointer-events-auto flex items-center gap-2",children:[c.jsx(WS,{provider:m,className:"size-4 text-primary"}),c.jsx("span",{className:"text-sm font-medium",children:m?.label??"Agent"}),N?c.jsxs("span",{className:"flex items-center gap-1 rounded-full border border-primary/30 bg-primary/10 px-2 py-0.5 text-[11px] text-primary",children:[c.jsx(Wa,{className:"size-3"}),c.jsx("span",{className:"max-w-40 truncate",children:N.label}),c.jsx("button",{"aria-label":"Clear source",className:"opacity-60 hover:opacity-100",onClick:M,type:"button",children:c.jsx(Ji,{className:"size-3"})})]}):null]}),c.jsxs("div",{className:"pointer-events-auto flex items-center gap-1",children:[e?c.jsx(ue,{"aria-label":"Open agent page",className:"size-7",onClick:e,size:"icon",title:"Open the full agent page",type:"button",variant:"ghost",children:c.jsx(Y4,{})}):null,c.jsx(ue,{"aria-label":"Clear conversation",className:"size-7",disabled:a.length===0,onClick:_,size:"icon",title:"Clear conversation",type:"button",variant:"ghost",children:c.jsx(rl,{})}),c.jsx(ue,{"aria-label":"Collapse agent",className:"size-7",onClick:()=>S(!1),size:"icon",title:"Collapse",type:"button",variant:"ghost",children:c.jsx(Yn,{})})]})]}),c.jsx("div",{ref:W,className:"min-h-0 flex-1 overflow-auto px-3 py-3",onScroll:fe,children:c.jsxs("div",{className:"mx-auto w-full max-w-4xl space-y-3",children:[a.length===0?c.jsx(oB,{configured:h,provider:m,onOnboard:()=>$(!0)}):a.map((_e,mt)=>c.jsx(dB,{turn:_e,streaming:o&&mt===a.length-1,isLast:mt===a.length-1,onChoose:Ze,onStartService:ot,onOpenService:t},_e.id)),u?c.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:[c.jsx(TM,{className:"mt-px size-3.5 shrink-0"}),c.jsx("span",{className:"min-w-0 break-words",children:u})]}):null]})}),f.length>0?c.jsx("div",{className:"shrink-0 space-y-1.5 border-t border-amber-500/25 bg-amber-500/[0.04] px-3 py-2",children:f.map(_e=>c.jsx(fB,{prompt:_e,onRespond:x},_e.requestId))}):null,c.jsxs("div",{className:de("relative shrink-0 p-2 transition-colors",G&&"bg-primary/5"),children:[O?c.jsx(o9,{onClose:()=>X(!1),onPick:_e=>{X(!1),A(_e)}}):null,c.jsxs("div",{className:"mx-auto w-full max-w-4xl",children:[R?c.jsxs("form",{className:"mb-2 flex items-center gap-2 rounded-md border border-primary/40 bg-primary/5 p-1.5",onSubmit:_e=>{_e.preventDefault(),ye(I)},children:[c.jsx(Wn,{className:"size-4 shrink-0 text-primary"}),c.jsx("input",{ref:oe,className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onChange:_e=>F(_e.target.value),placeholder:"Paste a repo URL — e.g. https://github.com/owner/repo",value:I}),c.jsx(ue,{disabled:!I.trim(),size:"sm",type:"submit",children:"Onboard"}),c.jsx(ue,{"aria-label":"Cancel onboarding",className:"size-7",onClick:()=>{$(!1),F("")},size:"icon",type:"button",variant:"ghost",children:c.jsx(Ji,{})})]}):cB(E)&&!o?c.jsxs("button",{className:"mb-2 flex w-full items-center gap-2 rounded-md border border-primary/40 bg-primary/5 px-3 py-1.5 text-left text-xs text-primary transition-colors hover:bg-primary/10",onClick:()=>ye(E),type:"button",children:[c.jsx(Wn,{className:"size-3.5 shrink-0"}),c.jsxs("span",{className:"min-w-0 flex-1 truncate",children:["Onboard ",c.jsx("span",{className:"font-mono",children:E.trim()})," as a service"]}),c.jsx(zA,{className:"size-3.5 shrink-0 opacity-60"})]}):null,c.jsxs("div",{className:"flex items-end gap-1.5 rounded-2xl border border-border bg-background px-1.5 py-1.5 shadow-sm transition-colors hover:border-foreground/25 focus-within:border-foreground/40 focus-within:ring-1 focus-within:ring-ring",children:[c.jsx(ue,{"aria-label":"Attach a file or folder",className:"size-8 shrink-0 rounded-full text-muted-foreground hover:text-foreground",disabled:h===!1,onClick:()=>X(!0),size:"icon",title:"Attach a file or folder",type:"button",variant:O?"secondary":"ghost",children:c.jsx(Z4,{})}),c.jsx("textarea",{ref:he,className:"max-h-32 min-h-8 flex-1 resize-none self-center overflow-y-auto bg-transparent px-1 py-1.5 text-sm outline-none placeholder:text-muted-foreground",disabled:h===!1,onChange:_e=>C(_e.target.value),onKeyDown:lt,placeholder:h===!1?`${m?.label??"Agent"} (\`${m?.commandName??"agent"}\`) is not installed`:`Ask ${m?.label??"the agent"} anything about this project...`,rows:1,value:E}),o?c.jsx(ue,{"aria-label":"Stop generating",className:"size-8 shrink-0 rounded-full",onClick:b,size:"icon",title:"Stop",type:"button",variant:"secondary",children:c.jsx(Fh,{className:"size-3.5 fill-current"})}):c.jsx(ue,{"aria-label":"Send message",className:"size-8 shrink-0 rounded-full",disabled:!E.trim()||h===!1,onClick:()=>{we()},size:"icon",title:"Send",type:"button",children:c.jsx(mk,{className:"size-4"})})]})]})]})]}):c.jsx("button",{className:de("flex h-full w-full items-center gap-2 px-3 text-left text-sm hover:bg-muted/50",G?"font-medium text-primary":"text-muted-foreground"),onClick:()=>S(!0),type:"button",children:G?c.jsxs(c.Fragment,{children:[c.jsx(vk,{className:"size-4 animate-bounce text-primary"}),c.jsx("span",{children:"Drop here to add it to your message"})]}):c.jsxs(c.Fragment,{children:[c.jsx(WS,{provider:m,className:"size-4 text-primary"}),o?c.jsxs("span",{className:"flex items-center gap-2 text-foreground",children:[c.jsx(Oi,{className:"size-3.5 animate-spin"})," ",m?.label??"Agent"," is thinking…"]}):c.jsxs("span",{children:["Ask ",m?.label??"the agent","..."]}),c.jsx("span",{className:"ml-auto text-xs text-muted-foreground/70",children:"click to expand"})]})})})}function WS({provider:e,className:t}){return e?.id==="claude"?c.jsx(cl,{className:t}):e?.id==="codex"?c.jsx(nu,{className:t}):c.jsx(Wa,{className:t})}function oB({configured:e,provider:t,onOnboard:i}){return e===!1?c.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 ",c.jsx("code",{className:"font-mono",children:t?.commandName??"agent"})," ","CLI. ",t?.installHint??"Install the active agent CLI, then reload."]}):c.jsxs("div",{className:"space-y-2 text-xs text-muted-foreground",children:[c.jsx("p",{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".'}),c.jsxs("button",{className:"inline-flex items-center gap-1.5 rounded-full border border-primary/40 bg-primary/5 px-2.5 py-1 text-primary transition-colors hover:bg-primary/10",onClick:i,type:"button",children:[c.jsx(Wn,{className:"size-3.5"}),"Onboard a repo from a URL"]})]})}const lB=/^(?:https?:\/\/|git@|ssh:\/\/)\S+$/i;function cB(e){const t=e.trim();return t.includes(`
|
|
136
|
-
`)||t.includes(" ")||!lB.test(t)?!1:/github\.com|gitlab\.|bitbucket\.|\.git$/i.test(t)}function uB({turn:e}){const[t,i]=k.useState(!1),s=!!e.label&&e.label!==e.text,a=s&&!t?e.label:e.text;return c.jsx("div",{className:"flex justify-end",children:c.jsxs("div",{className:"flex max-w-[85%] flex-col items-end gap-0.5",children:[c.jsx("div",{className:"whitespace-pre-wrap break-words rounded-2xl rounded-br-sm bg-muted px-3.5 py-2 text-sm text-foreground",children:a}),s?c.jsxs("button",{className:"flex items-center gap-0.5 px-1 text-[11px] text-muted-foreground transition-colors hover:text-foreground",onClick:()=>i(o=>!o),type:"button",children:[t?c.jsx(Ph,{className:"size-3"}):c.jsx(Yn,{className:"size-3"}),t?"Hide full prompt":"Show full prompt"]}):null]})})}function dB({turn:e,streaming:t,isLast:i,onChoose:s,onStartService:a,onOpenService:o}){const u=sB(e.text);if(e.role==="user")return c.jsx(uB,{turn:e});const{body:h,options:m,service:f}=d9(u);return c.jsxs("div",{className:"space-y-1.5",children:[e.tools.map(p=>c.jsx(hB,{tool:p},p.id)),h?c.jsx("div",{className:"break-words px-0.5 text-sm text-foreground",children:c.jsx(iB,{content:h})}):null,m.length>0&&i&&!t?c.jsx(h9,{options:m,onChoose:s}):null,f&&!t?c.jsx(f9,{service:f,onStart:a,onOpen:o}):null,t&&!h?c.jsx(rB,{}):null]})}function hB({tool:e}){const t=nN(e.input);return c.jsxs("div",{className:de("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"?c.jsx(Oi,{className:"size-3 animate-spin"}):c.jsx(jM,{className:"size-3"}),c.jsx("span",{className:"font-semibold",children:e.name}),t?c.jsx("span",{className:"truncate",children:t}):null]})}function fB({prompt:e,onRespond:t}){const i=nN(e.input).slice(0,140);return c.jsxs("div",{className:"flex items-center gap-2.5 rounded-lg border border-amber-500/30 bg-amber-500/5 px-2.5 py-2 text-xs",children:[c.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-md bg-amber-500/15 text-amber-600 dark:text-amber-400",children:c.jsx(gM,{className:"size-4"})}),c.jsxs("div",{className:"min-w-0 flex-1 leading-tight",children:[c.jsx("div",{className:"mb-0.5 text-[10px] font-semibold uppercase tracking-wider text-amber-600 dark:text-amber-400/90",children:"Permission needed"}),c.jsxs("div",{className:"truncate font-mono text-[11px]",children:[c.jsx("span",{className:"font-semibold text-foreground",children:e.name}),i?c.jsx("span",{className:"ml-1 text-muted-foreground",children:i}):null]})]}),c.jsxs(ue,{className:"h-7 gap-1 text-muted-foreground hover:border-destructive/40 hover:bg-destructive/10 hover:text-destructive",onClick:()=>t(e.requestId,"deny"),size:"sm",type:"button",variant:"outline",children:[c.jsx(Ji,{className:"size-3.5"})," Deny"]}),c.jsxs(ue,{className:"h-7 gap-1",onClick:()=>t(e.requestId,"allow"),size:"sm",type:"button",children:[c.jsx(sl,{className:"size-3.5"})," Allow"]})]})}function nN(e){return!e||typeof e!="object"?"":Object.values(e).filter(i=>i!==void 0&&i!=="").map(i=>String(i)).join(" ")}const Rp={host:"",port:"",user:"",password:"",database:"",ssl:!1},mB="localhost";function u0(e,t,{includePassword:i=!0}={}){const s=e==="mysql"?"mysql":"postgres",a=t.host.trim()||mB,o=t.port.trim(),u=t.database.trim().replace(/^\//,""),h=t.user.trim(),m=i&&t.password,f=h?`${encodeURIComponent(h)}${m?`:${encodeURIComponent(t.password)}`:""}@`:"",p=o?`:${o}`:"",b=e==="postgres"&&t.ssl?"?sslmode=require":"";return`${s}://${f}${a}${p}/${u}${b}`}function d0(e){if(!e.trim())return null;let t;try{t=new URL(e.trim())}catch{return null}return{host:t.hostname,port:t.port,user:YS(t.username),password:YS(t.password),database:t.pathname.replace(/^\//,""),ssl:t.searchParams.get("sslmode")==="require"||t.searchParams.has("ssl")}}function pB(e){const t=/^([a-z0-9+]+):\/\//i.exec(e.trim());if(!t)return null;const i=t[1].toLowerCase();return i.startsWith("postgres")?"postgres":i.startsWith("mysql")?"mysql":i.startsWith("sqlite")||i==="file"?"sqlite":null}function YS(e){try{return decodeURIComponent(e)}catch{return e}}const gB=[{value:"postgres",label:"Postgres"},{value:"mysql",label:"MySQL"},{value:"sqlite",label:"SQLite"}];function bB({onClose:e,onSaved:t,initial:i}){const{error:s,success:a}=Bi(),o=!!i,u=k.useMemo(()=>vB(i),[i]),[h,m]=k.useState(u.engine),[f,p]=k.useState(u.name),[b,_]=k.useState(u.url),[x,y]=k.useState(u.fields),[S,E]=k.useState([]),[C,A]=k.useState({status:"idle"}),[N,M]=k.useState(!1),[D,U]=k.useState(!1);k.useEffect(()=>{o||VM().then(E).catch(()=>E([]))},[o]);const L=h==="sqlite",R=L?b.trim():u0(h,x),$=L?!!b.trim():!!(x.host.trim()&&x.database.trim());function I(){A({status:"idle"})}function F(V,P){return u0(V,P,{includePassword:!1})}function G(V){m(V),I(),V!=="sqlite"&&_(F(V,x))}function Y(V){const P={...x,...V};y(P),_(F(h,P)),I()}function Q(V){I();const P=pB(V),j=P??h;P&&P!==h&&m(P);const W=P==="sqlite"?null:d0(V);if(!W){_(V);return}W.password?(y(W),_(F(j,W))):(y({...W,password:x.password}),_(V))}function q(V){m(V.engine);const P=V.engine==="sqlite"?null:d0(V.url);P?(y(P),_(F(V.engine,P))):_(V.url),I(),f.trim()||p(_B(V))}function O(){return f.trim()?L?b.trim()?null:"Database file path is required.":x.host.trim()?x.database.trim()?null:"Database name is required.":"Host is required.":"Name is required."}async function X(){if($){M(!0),I();try{const V=await KM({engine:h,url:R});A(V.ok?{status:"ok",message:"Connected"}:{status:"fail",message:V.error??"Connection failed"})}catch(V){A({status:"fail",message:V instanceof Error?V.message:String(V)})}finally{M(!1)}}}async function Z(){const V=O();if(V){s(V);return}U(!0);try{await qM({name:f.trim(),engine:h,url:R}),a(`Saved connection "${f.trim()}".`),t(),e()}catch(P){s(P instanceof Error?P.message:String(P))}finally{U(!1)}}return c.jsx(Ts,{icon:c.jsx(us,{}),onClose:e,title:o?"Edit database connection":"Add database connection",children:c.jsxs("div",{className:"flex flex-col gap-4",children:[S.length>0?c.jsxs("section",{children:[c.jsxs("p",{className:"mb-1.5 flex items-center gap-1.5 text-xs font-medium text-muted-foreground",children:[c.jsx(MM,{className:"size-3.5"}),"Found in your services"]}),c.jsx("div",{className:"flex flex-wrap gap-1.5",children:S.map(V=>c.jsxs("button",{type:"button",onClick:()=>q(V),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:V.maskedUrl,children:[c.jsx(Pe,{variant:"outline",size:"small",children:V.engine}),c.jsx("span",{className:"font-mono",children:V.service}),c.jsxs("span",{className:"font-mono text-muted-foreground",children:["·",V.key]})]},`${V.service}:${V.key}`))})]}):null,c.jsxs("section",{children:[c.jsx("p",{className:"mb-1.5 text-xs font-medium text-muted-foreground",children:"Engine"}),c.jsx("div",{className:"flex gap-1.5",children:gB.map(V=>c.jsx(ue,{size:"sm",variant:h===V.value?"default":"outline",onClick:()=>G(V.value),disabled:o,type:"button",children:V.label},V.value))})]}),c.jsxs("label",{className:"flex flex-col gap-1.5",children:[c.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Name"}),c.jsx(et,{value:f,onChange:V=>p(V.target.value),placeholder:"e.g. shop-db",disabled:o}),o?c.jsx("span",{className:"text-[11px] text-muted-foreground",children:"The name identifies the connection and can't be changed here."}):null]}),L?null:c.jsxs("section",{className:"flex flex-col gap-3",children:[c.jsxs("div",{className:"flex gap-3",children:[c.jsxs("label",{className:"flex flex-1 flex-col gap-1.5",children:[c.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Host"}),c.jsx(et,{value:x.host,onChange:V=>Y({host:V.target.value}),placeholder:"localhost",className:"font-mono text-xs"})]}),c.jsxs("label",{className:"flex w-24 flex-col gap-1.5",children:[c.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Port"}),c.jsx(et,{value:x.port,onChange:V=>Y({port:V.target.value}),placeholder:h==="mysql"?"3306":"5432",className:"font-mono text-xs"})]})]}),c.jsxs("div",{className:"flex gap-3",children:[c.jsxs("label",{className:"flex flex-1 flex-col gap-1.5",children:[c.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"User"}),c.jsx(et,{value:x.user,onChange:V=>Y({user:V.target.value}),placeholder:"postgres",className:"font-mono text-xs"})]}),c.jsxs("label",{className:"flex flex-1 flex-col gap-1.5",children:[c.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Password"}),c.jsx(et,{type:"password",value:x.password,onChange:V=>Y({password:V.target.value}),placeholder:o?"leave blank to keep current":"••••••••",className:"font-mono text-xs"})]})]}),c.jsxs("label",{className:"flex flex-col gap-1.5",children:[c.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Database"}),c.jsx(et,{value:x.database,onChange:V=>Y({database:V.target.value}),placeholder:"app",className:"font-mono text-xs"})]}),h==="postgres"?c.jsxs("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[c.jsx("input",{type:"checkbox",checked:x.ssl,onChange:V=>Y({ssl:V.target.checked}),className:"size-3.5 accent-primary"}),"Require SSL (adds ",c.jsx("span",{className:"font-mono",children:"?sslmode=require"}),")"]}):null]}),c.jsxs("label",{className:"flex flex-col gap-1.5",children:[c.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:L?"Database file path":"Connection URL"}),c.jsx(et,{value:b,onChange:V=>Q(V.target.value),placeholder:L?"/abs/path/to/app.db":h==="mysql"?"mysql://user:pass@host:3306/db":"postgres://user:pass@host:5432/db",className:"font-mono text-xs"}),c.jsx("span",{className:"text-[11px] text-muted-foreground",children:L?"Read-only. Stored like a secret and masked in the UI and API.":"Synced with the fields above; the password stays in its field and is never shown here. Stored like a secret and masked in the UI and API."})]}),C.status!=="idle"?c.jsxs("div",{className:`flex items-center gap-1.5 rounded-md border px-2.5 py-1.5 text-xs ${C.status==="ok"?"border-emerald-500/40 text-emerald-600 dark:text-emerald-400":"border-destructive/40 text-destructive"}`,children:[C.status==="ok"?c.jsx(sl,{className:"size-3.5"}):c.jsx(Ji,{className:"size-3.5"}),c.jsx("span",{className:"break-all font-mono",children:C.message})]}):null,c.jsxs("div",{className:"flex items-center justify-end gap-2 border-t border-border pt-3",children:[c.jsxs(ue,{variant:"outline",size:"sm",onClick:()=>{X()},disabled:N||!$,type:"button",children:[N?c.jsx(Oi,{className:"animate-spin"}):null,"Test connection"]}),c.jsxs(ue,{size:"sm",onClick:()=>{Z()},disabled:D,type:"button",children:[D?c.jsx(Oi,{className:"animate-spin"}):null,o?"Save changes":"Save"]})]})]})})}function vB(e){if(!e)return{engine:"postgres",name:"",fields:Rp,url:""};if(e.engine==="sqlite")return{engine:"sqlite",name:e.name,fields:Rp,url:e.url};const t=d0(e.url),i=t?{...t,password:""}:Rp;return{engine:e.engine,name:e.name,fields:i,url:u0(e.engine,i,{includePassword:!1})}}function _B(e){try{const i=new URL(e.url).pathname.replace(/^\//,"");if(i)return`${e.service}-${i}`}catch{}return`${e.service}-${e.engine}`}function xB({connections:e,selected:t,onSelect:i,onAdd:s,onEdit:a,onRemove:o}){const[u,h]=k.useState(!1),m=k.useRef(null),f=e.find(p=>p.name===t);return k.useEffect(()=>{if(!u)return;function p(b){m.current&&b.target instanceof Node&&!m.current.contains(b.target)&&h(!1)}return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[u]),c.jsxs("div",{className:"relative z-50 flex items-center gap-2",ref:m,children:[c.jsxs(ue,{className:"max-w-[240px] justify-start gap-2 rounded-md border-border bg-card",onClick:()=>h(p=>!p),size:"sm",type:"button",variant:"outline",children:[c.jsx(us,{className:"text-muted-foreground"}),c.jsx("span",{className:"truncate",children:f?.name??"Select connection"}),f?c.jsx(Pe,{variant:"outline",size:"small",children:f.engine}):null,c.jsx(Yn,{className:de("ml-auto transition-transform",u&&"rotate-180")})]}),u?c.jsxs("div",{className:"absolute right-0 top-10 z-50 w-[min(420px,calc(100vw-2rem))] overflow-hidden rounded-lg border border-border bg-card shadow-lg",children:[c.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-3 py-2",children:[c.jsx(us,{className:"size-3.5 text-muted-foreground"}),c.jsx("div",{className:"text-xs font-semibold",children:"Connections"}),c.jsx(Pe,{className:"ml-auto",variant:"outline",size:"small",children:e.length})]}),c.jsx("div",{className:"max-h-72 overflow-auto",children:e.length?c.jsx("div",{className:"divide-y divide-border",children:e.map(p=>{const b=p.name===t;return c.jsxs("div",{className:de("group grid w-full grid-cols-[1fr_auto_auto_auto] items-center gap-2 px-3 py-1.5 text-left transition-colors hover:bg-muted",b&&"bg-muted/70"),children:[c.jsxs("button",{className:"min-w-0 text-left",onClick:()=>{i(p.name),h(!1)},type:"button",children:[c.jsx("span",{className:"block truncate text-sm font-medium leading-tight",children:p.name}),c.jsx("span",{className:"block truncate font-mono text-[10px] leading-tight text-muted-foreground",children:p.url})]}),b?c.jsx(sl,{className:"size-3.5"}):c.jsx("span",{className:"size-3.5"}),c.jsx(ue,{"aria-label":`Edit ${p.name}`,className:"size-6 opacity-0 transition-opacity group-hover:opacity-100",onClick:()=>{a(p),h(!1)},size:"icon",title:`Edit ${p.name}`,type:"button",variant:"ghost",children:c.jsx(Ic,{className:"size-3.5"})}),c.jsx(ue,{"aria-label":`Remove ${p.name}`,className:"size-6 opacity-0 transition-opacity group-hover:opacity-100",onClick:()=>o(p.name),size:"icon",title:`Remove ${p.name}`,type:"button",variant:"ghost",children:c.jsx(rl,{className:"size-3.5 text-destructive"})})]},p.name)})}):c.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"No saved connections yet."})}),c.jsx("div",{className:"border-t border-border bg-muted/20 p-2",children:c.jsxs(ue,{className:"w-full",onClick:()=>{s(),h(!1)},size:"sm",type:"button",children:[c.jsx(mn,{className:"size-3"}),"Add connection"]})})]}):null]})}function yB({onAddManual:e,onAddWithAi:t}){const[i,s]=k.useState(!1),a=k.useRef(null);k.useEffect(()=>{if(!i)return;function u(h){a.current&&h.target instanceof Node&&!a.current.contains(h.target)&&s(!1)}return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[i]);function o(u){s(!1),u()}return c.jsxs("div",{className:"relative",ref:a,children:[c.jsxs(ue,{"aria-label":"Add database connection",onClick:()=>s(u=>!u),size:"sm",type:"button",children:[c.jsx(mn,{className:"size-3.5"}),"Add"]}),i?c.jsxs("div",{className:"absolute right-0 top-9 z-50 w-56 overflow-hidden rounded-lg border border-border bg-card shadow-lg",children:[c.jsxs("button",{className:"flex w-full items-center gap-2 px-3 py-2 text-left text-sm transition-colors hover:bg-muted",onClick:()=>o(e),type:"button",children:[c.jsx(us,{className:"size-3.5 text-muted-foreground"}),"Add connection"]}),c.jsxs("button",{className:"flex w-full items-center gap-2 border-t border-border px-3 py-2 text-left text-sm transition-colors hover:bg-muted",onClick:()=>o(t),type:"button",children:[c.jsx(Wa,{className:"size-3.5 text-muted-foreground"}),"Add with AI"]})]}):null]})}function sN({items:e,label:t="More actions",className:i}){const[s,a]=k.useState(!1),[o,u]=k.useState({top:0,right:0}),h=k.useRef(null),m=k.useRef(null);function f(){const p=h.current?.getBoundingClientRect();p&&u({top:p.bottom+4,right:window.innerWidth-p.right}),a(b=>!b)}return k.useEffect(()=>{if(!s)return;function p(x){const y=x.target;h.current?.contains(y)||m.current?.contains(y)||a(!1)}function b(x){x.key==="Escape"&&a(!1)}const _=()=>a(!1);return document.addEventListener("mousedown",p),document.addEventListener("keydown",b),window.addEventListener("scroll",_,!0),()=>{document.removeEventListener("mousedown",p),document.removeEventListener("keydown",b),window.removeEventListener("scroll",_,!0)}},[s]),c.jsxs(c.Fragment,{children:[c.jsx("button",{"aria-label":t,className:de("flex size-6 items-center justify-center rounded-md text-muted-foreground opacity-0 transition-all duration-150 hover:bg-muted hover:text-foreground group-hover:opacity-100",s&&"opacity-100",i),onClick:f,ref:h,title:t,type:"button",children:c.jsx(_k,{className:"size-3.5"})}),s?su.createPortal(c.jsx("div",{className:"fixed z-50 min-w-44 overflow-hidden rounded-md border border-border bg-card p-1 shadow-md",ref:m,style:{top:o.top,right:o.right},children:e.map(p=>c.jsxs("button",{className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-xs text-foreground transition-colors hover:bg-muted",onClick:()=>{a(!1),p.onSelect()},type:"button",children:[p.icon?c.jsx("span",{className:"text-muted-foreground",children:p.icon}):null,p.label]},p.label))}),document.body):null]})}function SB({connection:e,sample:t}){const{sendToAgent:i}=Li(),{success:s,error:a}=Bi(),o=t.columns.map(p=>p.name);function u(p){i({prompt:FL(e,t.engine,t.table,t.columns,p),source:{type:"database-row",label:`${t.table} row`},label:`Explain this row from \`${t.table.qualifiedName}\`.`,mode:"send"})}async function h(p,b){try{await navigator.clipboard.writeText(p),s(`Copied ${b}.`)}catch(_){a(_ instanceof Error?_.message:String(_))}}function m(p){const b=_=>{const x=jp(_);return/[",\n]/.test(x)?`"${x.replace(/"/g,'""')}"`:x};return`${o.join(",")}
|
|
137
|
-
${o.map(_=>b(p[_])).join(",")}`}function f(p){const b=x=>x==null?"NULL":typeof x=="number"||typeof x=="boolean"?String(x):`'${(typeof x=="object"?JSON.stringify(x):String(x)).replace(/'/g,"''")}'`,_=o.map(x=>b(p[x])).join(", ");return`INSERT INTO ${t.table} (${o.join(", ")}) VALUES (${_});`}return t.columns.length===0?c.jsx("div",{className:"p-6 text-sm text-muted-foreground",children:"This table has no columns."}):c.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:c.jsxs("table",{className:"w-max min-w-full border-collapse text-left font-mono text-[11px]",children:[c.jsx("thead",{className:"sticky top-0 z-10 bg-card",children:c.jsxs("tr",{className:"border-b border-border",children:[t.columns.map(p=>c.jsxs("th",{className:"whitespace-nowrap px-3 py-2 font-semibold text-foreground",children:[c.jsxs("span",{className:"flex items-center gap-1",children:[p.primaryKey?c.jsx(S4,{className:"size-3 text-amber-500"}):null,p.name]}),c.jsx("span",{className:"block text-[10px] font-normal text-muted-foreground",children:p.dataType})]},p.name)),c.jsx("th",{className:"w-16 px-2 py-2"})]})}),c.jsxs("tbody",{children:[t.rows.map((p,b)=>c.jsxs("tr",{className:"group border-b border-border/60 hover:bg-muted/40",children:[t.columns.map(_=>c.jsx("td",{className:"max-w-[320px] truncate px-3 py-1 align-top text-muted-foreground",title:jp(p[_.name]),children:jp(p[_.name])},_.name)),c.jsx("td",{className:"px-2 py-1 align-top",children:c.jsxs("div",{className:"flex items-center justify-end gap-0.5",children:[c.jsx(tl,{label:"Ask AI about this row",onAsk:()=>u(p)}),c.jsx(sN,{label:"Row actions",items:[{label:"Copy as JSON",icon:c.jsx(CA,{className:"size-3.5"}),onSelect:()=>{h(JSON.stringify(p,null,2),"row as JSON")}},{label:"Copy as CSV",icon:c.jsx(JA,{className:"size-3.5"}),onSelect:()=>{h(m(p),"row as CSV")}},{label:"Copy as SQL INSERT",icon:c.jsx(us,{className:"size-3.5"}),onSelect:()=>{h(f(p),"INSERT statement")}}]})]})})]},b)),t.rows.length===0?c.jsx("tr",{children:c.jsx("td",{colSpan:t.columns.length+1,className:"px-3 py-6 text-center text-muted-foreground",children:"No rows."})}):null]})]})})}function jp(e){return e==null?"NULL":typeof e=="object"?JSON.stringify(e):String(e)}function wB(){const[e,t]=k.useState([]),[i,s]=k.useState(!0),[a,o]=k.useState(null),u=k.useCallback(async()=>{s(!0),o(null);try{t(await Ok())}catch(h){o(h instanceof Error?h.message:String(h))}finally{s(!1)}},[]);return k.useEffect(()=>{u()},[u]),{connections:e,loading:i,error:a,refresh:u}}const kB=[50,100,500,1e3];function EB(e){const[t,i]=k.useState([]),[s,a]=k.useState(null),[o,u]=k.useState(null),[h,m]=k.useState(null),[f,p]=k.useState(null),[b,_]=k.useState(!1),[x,y]=k.useState(!1),[S,E]=k.useState(100),[C,A]=k.useState(0);k.useEffect(()=>{A(0)},[e,s]),k.useEffect(()=>{if(i([]),a(null),u(null),m(null),p(null),!e)return;let R=!1;return _(!0),WM(e).then($=>{R||(i($),a($[0]?.qualifiedName??null))}).catch($=>{R||m($ instanceof Error?$.message:String($))}).finally(()=>{R||_(!1)}),()=>{R=!0}},[e]),k.useEffect(()=>{if(u(null),p(null),!e||!s)return;let R=!1;return y(!0),YM(e,s,S,C).then($=>{R||u($)}).catch($=>{R||p($ instanceof Error?$.message:String($))}).finally(()=>{R||y(!1)}),()=>{R=!0}},[e,s,S,C]);const N=C>0,M=o?o.rowCount===S:!1;function D(R){E(R),A(0)}function U(){M&&A(R=>R+S)}function L(){A(R=>Math.max(0,R-S))}return{tables:t,selectedTable:s,setSelectedTable:a,sample:o,tablesError:h,rowsError:f,loadingTables:b,loadingRows:x,limit:S,offset:C,canPrev:N,canNext:M,changePageSize:D,nextPage:U,prevPage:L}}function CB(){const{connections:e,loading:t,error:i,refresh:s}=wB(),{error:a,success:o}=Bi(),{sendToAgent:u}=Li(),[h,m]=k.useState(null),[f,p]=k.useState(null);function b(){u({prompt:UL,source:{type:"database-setup",label:"Add a database"},label:"Help me connect a database, one step at a time."})}k.useEffect(()=>{if(e.length===0){m(null);return}m(y=>y&&e.some(S=>S.name===y)?y:e[0].name)},[e]);async function _(y){try{await GM(y),o(`Removed connection "${y}".`),await s()}catch(S){a(S instanceof Error?S.message:String(S))}}function x(y){p({mode:"edit",target:y})}return c.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-card/85",children:[c.jsxs("header",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(us,{className:"size-4 text-muted-foreground"}),c.jsx("span",{className:"text-sm font-semibold",children:"Databases"}),t&&e.length===0?c.jsx(Oi,{className:"size-3.5 animate-spin text-muted-foreground"}):null]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(xB,{connections:e,selected:h,onSelect:m,onAdd:()=>p({mode:"add"}),onEdit:x,onRemove:y=>{_(y)}}),c.jsx(yB,{onAddManual:()=>p({mode:"add"}),onAddWithAi:b})]})]}),c.jsx("div",{className:"min-h-0 flex-1",children:i?c.jsx("div",{className:"p-4",children:c.jsx(dt,{variant:"muted",className:"border-destructive/40 text-destructive",children:i})}):h?c.jsx(NB,{connection:h}):c.jsx(TB,{onAdd:()=>p({mode:"add"}),onAddWithAi:b})}),f?c.jsx(bB,{initial:f.mode==="edit"?f.target:void 0,onClose:()=>p(null),onSaved:s}):null]})}function NB({connection:e}){const{sendToAgent:t}=Li(),{tables:i,selectedTable:s,setSelectedTable:a,sample:o,tablesError:u,rowsError:h,loadingTables:m,loadingRows:f,limit:p,offset:b,canPrev:_,canNext:x,changePageSize:y,nextPage:S,prevPage:E}=EB(e);function C(N){t({prompt:DS(e,N.table,{engine:N.engine,columns:N.columns}),source:{type:"database-table",label:`${N.table.name} table`},mode:"draft"})}function A(N){t({prompt:DS(e,N),source:{type:"database-table",label:`${N.name} table`},mode:"draft"})}return c.jsxs("div",{className:"flex h-full min-h-0",children:[c.jsxs("div",{className:"flex w-56 shrink-0 flex-col border-r border-border",children:[c.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-2",children:[c.jsx(kM,{className:"size-4 text-muted-foreground"}),c.jsx("span",{className:"text-sm font-semibold",children:"Tables"}),c.jsx(Pe,{variant:"outline",size:"small",children:i.length}),m?c.jsx(Oi,{className:"size-3.5 animate-spin"}):null]}),u?c.jsx("div",{className:"p-3",children:c.jsx(dt,{variant:"muted",className:"border-destructive/40 text-destructive",children:u})}):c.jsxs("ul",{className:"min-h-0 flex-1 overflow-auto",children:[i.map(N=>c.jsxs("li",{className:de("group flex items-center gap-1 pr-1 transition-colors hover:bg-muted/50",N.qualifiedName===s&&"bg-muted/70"),children:[c.jsx("button",{type:"button",onClick:()=>a(N.qualifiedName),className:de("min-w-0 flex-1 truncate px-3 py-1.5 text-left font-mono text-[11px]",N.qualifiedName===s&&"font-semibold"),children:N.qualifiedName}),c.jsx(tl,{label:`Ask AI about \`${N.qualifiedName}\``,onAsk:()=>A(N)})]},N.qualifiedName)),!m&&i.length===0?c.jsx("li",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No tables."}):null]})]}),c.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[c.jsxs("div",{className:"group flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-2",children:[c.jsxs("span",{className:"flex min-w-0 items-center gap-1",children:[c.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:s??"Select a table"}),o?c.jsx(tl,{label:`Ask AI about \`${o.table.qualifiedName}\``,onAsk:()=>C(o)}):null]}),o?c.jsxs("div",{className:"flex shrink-0 items-center gap-2 text-[11px] text-muted-foreground",children:[c.jsx("span",{className:"tabular-nums",children:o.rowCount===0?"no rows":`rows ${b+1}–${b+o.rowCount}`}),c.jsx("select",{"aria-label":"Rows per page",className:"rounded-md border border-border bg-background px-1.5 py-0.5 text-[11px]",value:p,onChange:N=>y(Number(N.target.value)),children:kB.map(N=>c.jsxs("option",{value:N,children:[N," / page"]},N))}),c.jsx(ue,{size:"sm",variant:"outline",className:"h-6 px-2",onClick:E,disabled:!_,type:"button",children:"Prev"}),c.jsx(ue,{size:"sm",variant:"outline",className:"h-6 px-2",onClick:S,disabled:!x,type:"button",children:"Next"})]}):null]}),h?c.jsx("div",{className:"p-4",children:c.jsx(dt,{variant:"muted",className:"border-destructive/40 text-destructive",children:h})}):f?c.jsxs("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:[c.jsx(Oi,{className:"mr-2 size-4 animate-spin"}),"Loading rows…"]}):o?c.jsx(SB,{connection:e,sample:o}):c.jsx("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:"Pick a table to sample its rows."})]})]})}function TB({onAdd:e,onAddWithAi:t}){return c.jsx("div",{className:"flex h-full items-center justify-center p-8 text-center",children:c.jsxs("div",{className:"max-w-sm",children:[c.jsx(us,{className:"mx-auto size-8 text-muted-foreground/50"}),c.jsx("p",{className:"mt-3 text-sm font-medium",children:"No connections yet"}),c.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' ",c.jsx("code",{children:".env"})," files."]}),c.jsxs("div",{className:"mt-4 flex items-center justify-center gap-2",children:[c.jsxs(ue,{size:"sm",onClick:e,type:"button",children:[c.jsx(mn,{}),"Add connection"]}),c.jsxs(ue,{size:"sm",variant:"outline",onClick:t,type:"button",children:[c.jsx(Wa,{}),"Add with AI"]})]})]})})}function AB({incident:e}){const{error:t}=Bi(),{sendToAgent:i}=Li(),[s,a]=k.useState(!1);async function o(){a(!0);try{const{prompt:u}=await XM(e.id);i({prompt:u,source:{type:"error",label:`${e.service} — ${e.level}`},label:`Help me debug this ${e.level} in \`${e.service}\`: ${e.title}`})}catch(u){t(u instanceof Error?u.message:String(u))}finally{a(!1)}}return c.jsxs("div",{className:"flex h-full min-h-0 min-w-0 flex-col",children:[c.jsxs("div",{className:"shrink-0 border-b border-border px-4 py-3",children:[c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[c.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[c.jsx(Pe,{variant:e.level==="error"?"danger":"secondary",appearance:"subtle",size:"small",children:e.level}),c.jsx("span",{className:"truncate font-mono text-xs font-semibold",children:e.service}),e.count>1?c.jsxs(Pe,{variant:"outline",size:"small",children:["×",e.count]}):null]}),c.jsxs(ue,{onClick:()=>{o()},disabled:s,size:"sm",variant:"outline",children:[c.jsx(cs,{className:"size-3.5"}),s?"Sending…":"Fix with AI"]})]}),c.jsx("p",{className:"mt-1.5 break-words font-mono text-xs text-foreground",children:e.title}),e.file?c.jsxs("p",{className:"mt-1 flex items-center gap-1.5 font-mono text-[11px] text-muted-foreground",children:[c.jsx(Sk,{className:"size-3.5"}),e.file,e.line?`:${e.line}`:""]}):null,c.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()]})]}),c.jsxs("div",{className:"min-h-0 flex-1 overflow-auto p-4",children:[c.jsx("p",{className:"mb-1.5 text-xs font-medium text-muted-foreground",children:"Log excerpt"}),c.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(`
|
|
138
|
-
`)}),c.jsx("p",{className:"mt-3 text-[11px] text-muted-foreground",children:`"Fix with AI" sends the agent this excerpt with the affected file's diff and the last 40 log lines, so it can start debugging right away.`})]})]})}function XS(e){return[...e].sort((t,i)=>t.lastSeen<i.lastSeen?1:t.lastSeen>i.lastSeen?-1:i.id-t.id)}function MB(){const[e,t]=k.useState([]),[i,s]=k.useState(!1),[a,o]=k.useState(null),u=k.useCallback(h=>{t(m=>XS([...m.filter(f=>f.id!==h.id),h]))},[]);return k.useEffect(()=>{let h=!0;Lk().then(f=>{h&&t(XS(f))}).catch(f=>{h&&o(f instanceof Error?f.message:String(f))});const m=new EventSource("/api/errors/stream");return m.addEventListener("open",()=>s(!0)),m.addEventListener("error",()=>s(!1)),m.addEventListener("incident",f=>{try{const p=JSON.parse(f.data);u(p)}catch{}}),()=>{h=!1,m.close()}},[u]),{incidents:e,connected:i,error:a}}function RB(){const{incidents:e,connected:t,error:i}=MB(),[s,a]=k.useState(null);k.useEffect(()=>{if(e.length===0){a(null);return}a(u=>u!==null&&e.some(h=>h.id===u)?u:e[0].id)},[e]);const o=k.useMemo(()=>e.find(u=>u.id===s)??null,[e,s]);return c.jsxs("div",{className:"flex h-full min-h-0 bg-card/85",children:[c.jsxs("div",{className:"flex w-72 shrink-0 flex-col border-r border-border",children:[c.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(oh,{className:"size-4 text-muted-foreground"}),c.jsx("span",{className:"text-sm font-semibold",children:"Incidents"}),c.jsx(Pe,{variant:"outline",size:"small",children:e.length})]}),c.jsx(Pe,{variant:"outline",size:"small",icon:c.jsx("span",{className:de("inline-block size-1.5 rounded-full",t?"animate-pulse bg-emerald-500":"bg-muted-foreground/60")}),children:t?"live":"reconnecting…"})]}),c.jsx("ul",{className:"min-h-0 flex-1 divide-y divide-border overflow-auto",children:e.map(u=>c.jsx("li",{children:c.jsxs("button",{type:"button",onClick:()=>a(u.id),className:de("flex w-full flex-col gap-1 px-3 py-2 text-left transition-colors hover:bg-muted/50",u.id===s&&"bg-muted/70"),children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsx("span",{className:"truncate font-mono text-[11px] font-semibold",children:u.service}),c.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[u.count>1?c.jsxs(Pe,{variant:"outline",size:"small",children:["×",u.count]}):null,c.jsx(Pe,{variant:u.level==="error"?"danger":"secondary",appearance:"subtle",size:"small",children:u.level})]})]}),c.jsx("span",{className:"truncate font-mono text-[11px] text-muted-foreground",children:u.title}),c.jsx("span",{className:"font-mono text-[10px] text-muted-foreground/70",children:new Date(u.lastSeen).toLocaleTimeString()})]})},u.id))})]}),c.jsx("div",{className:"min-h-0 min-w-0 flex-1",children:i?c.jsx("div",{className:"p-4",children:c.jsxs(dt,{variant:"muted",className:"border-destructive/40 text-destructive",children:["Failed to load incidents: ",i]})}):o?c.jsx(AB,{incident:o}):c.jsx("div",{className:"flex h-full items-center justify-center p-8 text-center",children:c.jsxs("div",{className:"max-w-sm",children:[c.jsx(oh,{className:"mx-auto size-8 text-muted-foreground/50"}),c.jsx("p",{className:"mt-3 text-sm font-medium",children:"No incidents yet"}),c.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."})]})})})]})}function Ch({label:e}){return c.jsx(dt,{variant:"muted",className:"m-4 text-center",children:e})}const jB=900*1e3,wc=12,Dp=200;function DB({events:e}){const[t,i]=k.useState(null),[s,a]=k.useState(null),{rows:o,windowStart:u,windowEnd:h}=k.useMemo(()=>OB(e),[e]),m=t?o.find(f=>f.service===t)??null:null;return c.jsxs(c.Fragment,{children:[c.jsxs(Ms,{className:"rounded-none border-0 border-b border-border bg-transparent",children:[c.jsxs(Rs,{className:"border-b border-border px-3 py-2",children:[c.jsxs(js,{className:"flex items-center gap-2",children:[c.jsx(Pa,{className:"size-3.5"}),"Runtime Monitor"]}),c.jsx(dr,{className:"text-xs",children:e.length===0?"No events yet":`${e.length} event${e.length===1?"":"s"} · last 15 min`})]}),c.jsx(Ds,{className:"p-0",children:o.length===0?c.jsx(Ch,{label:"No runtime timeline events yet."}):c.jsxs("div",{className:"divide-y divide-border",children:[o.map(f=>c.jsx(BB,{onClick:()=>i(f.service),row:f,windowEnd:h,windowStart:u},f.service)),c.jsxs("div",{className:"flex justify-between px-3 py-1.5 font-mono text-[10px] text-muted-foreground",children:[c.jsx("span",{children:Nh(u)}),c.jsx("span",{children:"now"})]})]})})]}),m?c.jsx(Ts,{icon:c.jsx(Pa,{}),onClose:()=>i(null),title:m.service,children:c.jsx(IB,{onSelect:a,row:m})}):null,s?c.jsx(Ts,{icon:c.jsx(Pa,{}),onClose:()=>a(null),title:s.title,children:c.jsx(PB,{event:s})}):null]})}function OB(e){const t=Date.now(),i=t,s=t-jB;let a=e.filter(m=>{if(m.kind==="service.http")return!1;const f=new Date(m.timestamp).getTime();return!Number.isNaN(f)&&f>=s});a.length===0&&e.length>0?a=e.slice(-Dp):a.length>Dp&&(a=a.slice(-Dp));const o=new Map;for(const m of a){const f=m.service||"·system",p=o.get(f)??[];p.push(m),o.set(f,p)}const u=Math.max(i-s,1);return{rows:Array.from(o.entries()).map(([m,f])=>{const p=[...f].sort((A,N)=>A.timestamp.localeCompare(N.timestamp)),b=new Array(wc).fill(0),_=new Array(wc).fill(null);for(const A of p){const N=new Date(A.timestamp).getTime(),M=Math.max(s,Math.min(i,N)),D=Math.min(wc-1,Math.floor((M-s)/u*wc));b[D]+=1;const U=_[D];_[D]=LB(U,A.severity)}const x=p.filter(A=>A.severity==="error").length,y=p.filter(A=>A.severity==="warning").length,S=p.length-x-y,E=[...p].reverse().find(A=>A.severity!=="info")??null,C=x>0?"error":y>0?"warning":"info";return{service:m,events:p,errors:x,warnings:y,infos:S,buckets:b,bucketSeverity:_,lastNotable:E,worstSeverity:C}}).sort((m,f)=>{const p=_=>_.errors*1e3+_.warnings,b=p(f)-p(m);return b!==0?b:m.service.localeCompare(f.service)}),windowStart:s,windowEnd:i}}function LB(e,t){return e==="error"||t==="error"?"error":e==="warning"||t==="warning"?"warning":"info"}function BB({onClick:e,row:t,windowEnd:i,windowStart:s}){const a=Math.max(1,...t.buckets);return c.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:[c.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[c.jsx("span",{className:de("size-2 shrink-0 rounded-full",rN(t.worstSeverity))}),c.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium text-foreground",dir:"rtl",children:c.jsx("bdi",{children:t.service})}),t.errors>0?c.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?c.jsxs("span",{className:"rounded bg-amber-500/15 px-1 font-mono text-[10px] text-amber-500",children:[t.warnings,"W"]}):null,c.jsx(sa,{className:"size-3 text-muted-foreground"})]}),c.jsx("div",{className:"timeline-density mt-1.5 grid h-3 gap-px","data-testid":"timeline-density",style:{gridTemplateColumns:`repeat(${wc}, minmax(0, 1fr))`},children:t.buckets.map((o,u)=>c.jsx(zB,{count:o,max:a,severity:t.bucketSeverity[u]},u))}),t.lastNotable?c.jsx("div",{className:"mt-1 truncate font-mono text-[10px] text-muted-foreground",children:t.lastNotable.detail??t.lastNotable.title}):c.jsxs("div",{className:"mt-1 truncate text-[10px] text-muted-foreground",children:[t.infos," info ",t.infos===1?"event":"events"]}),c.jsxs("div",{className:"mt-0.5 flex justify-between font-mono text-[9px] text-muted-foreground/60",children:[c.jsx("span",{children:Nh(s)}),c.jsx("span",{children:Nh(i)})]})]})}function zB({count:e,max:t,severity:i}){if(e===0)return c.jsx("span",{className:"rounded-sm bg-border/60"});const s=Math.min(1,.35+e/t*.65);return c.jsx("span",{className:de("rounded-sm",$B(i)),style:{opacity:s},title:`${e} event${e===1?"":"s"}`})}function IB({onSelect:e,row:t}){const i=[...t.events].sort((s,a)=>a.timestamp.localeCompare(s.timestamp));return c.jsxs("div",{className:"flex max-h-[480px] flex-col overflow-hidden",children:[c.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-border px-4 py-2 text-xs text-muted-foreground",children:[c.jsxs("span",{children:[t.events.length," events"]}),c.jsx("span",{children:"·"}),c.jsxs("span",{children:[t.errors," error",t.errors===1?"":"s"]}),c.jsx("span",{children:"·"}),c.jsxs("span",{children:[t.warnings," warning",t.warnings===1?"":"s"]})]}),c.jsx("ul",{className:"min-h-0 divide-y divide-border overflow-auto",children:i.map(s=>c.jsx("li",{children:c.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(s),type:"button",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:de("size-2 shrink-0 rounded-full",rN(s.severity))}),c.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-medium text-foreground",children:s.title}),c.jsx("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground",children:Nh(s.timestamp)})]}),s.detail?c.jsx("div",{className:"mt-1 truncate font-mono text-[10px] text-muted-foreground",children:s.detail}):null]})},s.id))})]})}function PB({event:e}){const t=new Date(e.timestamp);return c.jsxs("div",{className:"space-y-3 p-4 text-sm",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx("span",{className:de("rounded px-1.5 py-0.5 font-mono text-[10px] uppercase text-white",UB(e.severity)),children:e.severity}),c.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?c.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]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs text-muted-foreground",children:"When"}),c.jsx("div",{className:"font-mono text-xs",children:Number.isNaN(t.getTime())?e.timestamp:t.toLocaleString()})]}),e.detail?c.jsxs("div",{children:[c.jsx("div",{className:"text-xs text-muted-foreground",children:"Detail"}),c.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 rN(e){return e==="error"?"bg-red-500":e==="warning"?"bg-amber-500":"bg-zinc-400"}function $B(e){return e==="error"?"bg-red-500":e==="warning"?"bg-amber-500":"bg-zinc-500"}function UB(e){return e==="error"?"bg-red-600":e==="warning"?"bg-amber-600":"bg-zinc-700"}function Nh(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 HB({health:e}){if(!e)return null;const t=e.processTree,i=e.status==="healthy"||e.status==="unknown"?void 0:KB(e.summary);return c.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:[c.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[c.jsxs("span",{className:de("inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md px-2.5 font-medium",FB(e.status)),children:[c.jsx("span",{className:"inline-flex shrink-0",children:c.jsx(Pa,{className:"size-3"})}),c.jsx("span",{className:"whitespace-nowrap",children:e.status})]}),i?c.jsx("span",{className:"min-w-0 truncate",children:i}):null]}),t?c.jsxs("div",{className:"health-metrics flex min-w-max items-center gap-2 font-mono sm:justify-end",children:[c.jsxs("span",{className:"inline-flex items-center gap-1 font-mono",children:[c.jsx(UA,{className:"size-3"}),t.processCount," ",t.processCount===1?"process":"processes"]}),c.jsxs("span",{children:[qB(t.cpuPercent)," CPU"]}),c.jsxs("span",{className:"inline-flex items-center gap-1 font-mono",children:[c.jsx(j4,{className:"size-3"}),VB(t.rssMb)," RAM"]})]}):null]})}function FB(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 VB(e){return Number.isInteger(e)?`${e} MB`:`${e.toFixed(1)} MB`}function qB(e){return`${e.toFixed(1)}%`}function KB(e){return e.replace(/^Recent error log:\s*/i,"Recent stderr: ").replace(/:\s*\d+(?:\.\d+)? MB RSS\.?$/i,"").replace(/\s+RSS\.?$/i,"")}function GB({ports:e}){const t=e.filter(s=>s.state==="occupied").length,i=e.filter(s=>s.state==="managed").length;return c.jsxs(Ms,{className:"rounded-none border-0 border-b border-border bg-transparent",children:[c.jsxs(Rs,{className:"border-b border-border px-3 py-2",children:[c.jsxs(js,{className:"flex items-center gap-2",children:[c.jsx(P4,{className:"size-3.5"}),"Ports"]}),c.jsxs(dr,{className:"text-xs",children:[i," managed, ",t," occupied by other"]})]}),c.jsx(Ds,{className:"p-0",children:e.length?c.jsx("div",{className:"divide-y divide-border",children:e.map(s=>c.jsxs("div",{className:"grid grid-cols-[1fr_auto] items-center gap-2 px-3 py-2",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsxs("div",{className:"font-mono text-xs",children:[":",s.port]}),c.jsx("div",{className:"truncate text-[11px] text-muted-foreground",children:s.services.join(", ")||"Unassigned"}),s.urls[0]?c.jsx("div",{className:"truncate font-mono text-[10px] text-muted-foreground",children:s.urls[0]}):null]}),c.jsx(WB,{port:s})]},s.port))}):c.jsx(Ch,{label:"No configured ports yet."})})]})}function WB({compact:e,port:t}){const i=t.state==="managed"?"managed":t.state==="occupied"?"occupied by other":"available",s=t.state==="managed"?"success":t.state==="occupied"?"warning":"outline";return c.jsx(Pe,{className:de(e&&"max-w-36 truncate"),variant:s,children:i})}function YB({onChange:e,value:t}){return c.jsxs("label",{className:"relative block",children:[c.jsx(cM,{className:"pointer-events-none absolute left-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground"}),c.jsx(et,{"aria-label":"Search logs",className:"h-8 w-44 pl-7 text-xs",onChange:i=>e(i.target.value),placeholder:"Search logs",value:t})]})}function XB({className:e,containerRef:t,emptyText:i,logs:s,query:a}){return c.jsx("div",{className:de("h-full max-w-full overflow-auto bg-background font-mono text-[11px] leading-5 dark:bg-zinc-950",e),ref:t,role:"log",children:s.length?s.map((o,u)=>c.jsxs("div",{className:de("grid min-w-max grid-cols-[168px_minmax(420px,1fr)] gap-2 border-b border-border/45 px-3 py-0.5 dark:border-zinc-800/80",o.stream==="stderr"?"bg-red-50/70 text-red-800 dark:bg-red-950/35 dark:text-red-100":"bg-emerald-50/35 text-zinc-800 dark:bg-zinc-950 dark:text-zinc-200 dark:odd:bg-zinc-900/45"),children:[c.jsx("span",{className:"text-muted-foreground dark:text-zinc-500",children:o.timestamp}),c.jsxs("span",{className:"whitespace-pre-wrap break-words",children:[o.stream==="stderr"?c.jsx("span",{className:"mr-2 rounded bg-red-100 px-1 font-semibold uppercase text-red-700 dark:bg-red-500/15 dark:text-red-300 dark:ring-1 dark:ring-red-400/20",children:"stderr"}):null,QB(o.text,a)]})]},`${o.timestamp}-${o.stream}-${u}`)):c.jsx("div",{className:"p-3 text-muted-foreground",children:i})})}function ZB(e){return`${e.timestamp} ${e.stream} ${e.text}`}function QB(e,t){const i=t.trim();if(!i)return e;const s=e.toLowerCase(),a=i.toLowerCase(),o=[];let u=0,h=s.indexOf(a);for(;h!==-1;){h>u&&o.push(e.slice(u,h));const m=h+i.length;o.push(c.jsx("mark",{className:"rounded bg-amber-200 px-0.5 text-amber-950 dark:bg-amber-400/20 dark:text-amber-200",children:e.slice(h,m)},`${h}-${m}`)),u=m,h=s.indexOf(a,u)}return u<e.length&&o.push(e.slice(u)),o}function ZS(e){return`${e.kind}:${e.name}`}function JB(e,t=!1,i={}){const[s,a]=k.useState(),[o,u]=k.useState(),[h,m]=k.useState(e.kind==="source"),f=JSON.stringify(i);return k.useEffect(()=>{a(void 0),u(void 0);let p=!1;const b=async()=>{try{if(e.kind==="service"){const x=await Ik(e.name,i);p||(a(x.logs),m(x.queryable),u(void 0))}else{const x=await Bk(e.name,i);p||(a(x),m(!0),u(void 0))}}catch(x){p||u(x instanceof Error?x.message:String(x))}};b();const _=window.setInterval(b,t?1e3:2e3);return()=>{p=!0,window.clearInterval(_)}},[e.kind,e.name,t,f]),{logs:s,error:o,queryable:h}}const ez=[{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 aN({target:e,query:t,setQuery:i,streaming:s,setStreaming:a,hideStdout:o,setHideStdout:u,fill:h=!1,leading:m,trailing:f}){const p=e.kind==="source",[b,_]=k.useState(""),[x,y]=k.useState(""),[S,E]=k.useState(t);k.useEffect(()=>{const V=window.setTimeout(()=>E(t),300);return()=>window.clearTimeout(V)},[t]);const C=k.useMemo(()=>{const V={};b&&(V.since=b),x&&(V.level=x);const P=S.trim();return P&&(V.grep=P),V},[b,x,S]),{logs:A,error:N,queryable:M}=JB(e,s,C),D=p||M,U=k.useRef(null),L=k.useRef(!0),[R,$]=k.useState([]),[I,F]=k.useState(!1),G=JSON.stringify(C);k.useEffect(()=>{$([])},[G,e.kind,e.name]);const Y=k.useMemo(()=>{const V=A??[];if(R.length===0)return V;const P=new Set(R.map(j=>j.cursor).filter(Boolean));return[...R,...V.filter(j=>!j.cursor||!P.has(j.cursor))]},[A,R]),Q=(R[0]??(A??[])[0])?.cursor;async function q(){if(!(!D||!Q||I)){F(!0),L.current=!1;try{const V={...C,before:Q,lines:200},P=e.kind==="source"?await Bk(e.name,V):(await Ik(e.name,V)).logs;P.length&&$(j=>{const W=new Set(j.map(oe=>oe.cursor).filter(Boolean));return[...P.filter(oe=>!oe.cursor||!W.has(oe.cursor)),...j]})}finally{F(!1)}}}const O=t.trim().toLowerCase(),X=k.useMemo(()=>{let V=Y;return o&&(V=V.filter(P=>P.stream==="stderr")),O&&(V=V.filter(P=>ZB(P).toLowerCase().includes(O))),V},[Y,o,O]);k.useEffect(()=>{const V=U.current;if(!V)return;const P=()=>{const j=V.scrollHeight-V.scrollTop-V.clientHeight;L.current=j<40};return P(),V.addEventListener("scroll",P,{passive:!0}),()=>V.removeEventListener("scroll",P)},[]),k.useEffect(()=>{if(!s||!L.current||X.length===0)return;const V=U.current;V&&(V.scrollTop=V.scrollHeight)},[s,X]);const Z=A?O?`No log lines match "${t.trim()}".`:o?"No stderr output captured.":"No log entries.":"Loading…";return c.jsxs("div",{className:h?"flex h-full min-h-0 flex-col gap-2":"flex flex-col gap-2",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[m,c.jsx(YB,{onChange:i,value:t}),D?c.jsxs(c.Fragment,{children:[c.jsx("select",{"aria-label":"Time range",className:"h-8 rounded-md border border-border bg-background px-2 text-xs",onChange:V=>_(V.target.value),value:b,children:ez.map(V=>c.jsx("option",{value:V.value,children:V.label},V.label))}),c.jsxs("select",{"aria-label":"Level",className:"h-8 rounded-md border border-border bg-background px-2 text-xs",onChange:V=>y(V.target.value),value:x,children:[c.jsx("option",{value:"",children:"All levels"}),c.jsx("option",{value:"warn",children:"Warnings+"}),c.jsx("option",{value:"error",children:"Errors"})]})]}):c.jsxs(QS,{active:o,activeClassName:"border-amber-600 bg-amber-50 text-amber-700 dark:border-amber-400/40 dark:bg-amber-500/15 dark:text-amber-300",onClick:()=>u(!o),children:[c.jsx(d4,{}),"Errors only"]}),c.jsxs(QS,{active:s,activeClassName:"border-emerald-600 bg-emerald-50 text-emerald-700 dark:border-emerald-400/40 dark:bg-emerald-500/15 dark:text-emerald-300",onClick:()=>a(!s),children:[c.jsx(nM,{}),s?"Streaming":"Stream"]}),D&&Q?c.jsxs(ue,{disabled:I,onClick:()=>{q()},size:"sm",type:"button",variant:"outline",children:[c.jsx(Ph,{}),I?"Loading…":"Load older"]}):null,f?c.jsx("div",{className:"ml-auto flex items-center gap-2",children:f}):null]}),N?c.jsx("div",{className:"text-red-600",children:N}):null,c.jsx(XB,{className:de("rounded border border-border/60",h?"min-h-0 flex-1":"max-h-80"),containerRef:U,emptyText:Z,logs:X,query:t})]})}function QS({active:e,activeClassName:t,children:i,onClick:s}){return c.jsx(ue,{"aria-pressed":e,className:e?t:void 0,onClick:s,size:"sm",type:"button",variant:"outline",children:i})}function tz(e,t){return e.kind===t.kind&&e.name===t.name}function iz({options:e,target:t,onChange:i,className:s}){const a=e.findIndex(u=>tz(u.target,t)),o=[...new Set(e.map(u=>u.group))];return c.jsx("select",{"aria-label":"Log source",className:s??"h-8 max-w-44 rounded-md border border-border bg-background px-2 text-xs",onChange:u=>i(e[Number(u.target.value)].target),value:String(a),children:o.map(u=>c.jsx("optgroup",{label:u,children:e.map((h,m)=>h.group===u?c.jsx("option",{value:String(m),children:h.label},`${h.group}:${h.label}`):null)},u))})}function nz({serviceName:e}){const[t,i]=k.useState(""),[s,a]=k.useState(!1),[o,u]=k.useState(!1),[h,m]=k.useState(!1),f=c.jsx(aN,{fill:!0,hideStdout:o,query:t,setHideStdout:u,setQuery:i,setStreaming:a,streaming:s,target:{kind:"service",name:e},trailing:c.jsxs(ue,{onClick:()=>m(p=>!p),size:"sm",type:"button",variant:"outline",children:[h?c.jsx(Nk,{}):c.jsx(Ck,{}),h?"Exit":"Expand"]})});return h?c.jsx(Jb,{onClose:()=>m(!1),title:`Logs — ${e}`,children:f}):c.jsx("div",{className:"h-[60vh] min-h-[24rem]",children:f})}function Jb({title:e,onClose:t,children:i,maxWidthClass:s="max-w-6xl"}){return k.useEffect(()=>{function a(o){o.key==="Escape"&&t()}return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[t]),su.createPortal(c.jsx("div",{className:"fixed inset-0 z-[1000] bg-black/40 p-4 sm:p-8",onMouseDown:t,children:c.jsxs("div",{"aria-modal":"true",className:`mx-auto flex h-full ${s} flex-col overflow-hidden rounded-lg border border-border bg-card text-xs shadow-xl`,onMouseDown:a=>a.stopPropagation(),role:"dialog",children:[c.jsxs("div",{className:"flex shrink-0 items-center gap-3 border-b border-border px-4 py-2",children:[c.jsx("h2",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:e}),c.jsx(ue,{"aria-label":"Close logs",onClick:t,size:"icon",type:"button",variant:"ghost",children:c.jsx(Ji,{})})]}),c.jsx("div",{className:"min-h-0 flex-1 p-3",children:i})]})}),document.body)}const sz={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 rz({onClose:e,onAdded:t}){const[i,s]=k.useState(""),[a,o]=k.useState("journald"),[u,h]=k.useState(""),[m,f]=k.useState(""),[p,b]=k.useState(""),[_,x]=k.useState(""),[y,S]=k.useState(""),[E,C]=k.useState(""),[A,N]=k.useState(),[M,D]=k.useState(!1);async function U(){D(!0),N(void 0);try{const L={name:i.trim(),kind:"command"};a==="file"?(L.kind="file",L.path=m.trim()):a==="ssh"?(L.kind="ssh",L.host=u.trim(),L.path=m.trim()):a==="command"?(L.kind="command",L.command=p.trim(),_.trim()&&(L.cwd=_.trim())):a==="journald"?(L.driver="journald",L.unit=y.trim(),u.trim()&&(L.host=u.trim())):a==="docker"&&(L.driver="docker",L.container=E.trim(),u.trim()&&(L.host=u.trim()));const R=await o6(L);t(R,L.name),e()}catch(L){N(L instanceof Error?L.message:String(L))}finally{D(!1)}}return c.jsx(Ts,{icon:c.jsx(Mk,{}),onClose:e,size:"md",title:"Add log source",children:c.jsxs("form",{className:"flex flex-col gap-3 p-4 text-xs",onSubmit:L=>{L.preventDefault(),U()},children:[c.jsx(ar,{label:"Name",children:c.jsx(et,{autoFocus:!0,onChange:L=>s(L.target.value),placeholder:"PROD",value:i})}),c.jsxs(ar,{label:"Type",children:[c.jsxs("select",{className:"h-9 w-full rounded-md border border-border bg-background px-2 text-xs",onChange:L=>o(L.target.value),value:a,children:[c.jsx("option",{value:"journald",children:"systemd journal (journald)"}),c.jsx("option",{value:"docker",children:"Docker container"}),c.jsx("option",{value:"ssh",children:"Remote file (SSH)"}),c.jsx("option",{value:"file",children:"Local file"}),c.jsx("option",{value:"command",children:"Command"})]}),c.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:sz[a]})]}),a==="journald"||a==="docker"?c.jsx(ar,{label:"Host (optional — leave blank to run locally)",children:c.jsx(et,{onChange:L=>h(L.target.value),placeholder:"jobjourney-prod (an alias from ~/.ssh/config)",value:u})}):null,a==="journald"?c.jsx(ar,{label:"Unit",children:c.jsx(et,{onChange:L=>S(L.target.value),placeholder:"jobjourney",value:y})}):null,a==="docker"?c.jsx(ar,{label:"Container",children:c.jsx(et,{onChange:L=>C(L.target.value),placeholder:"brainctl-api",value:E})}):null,a==="ssh"?c.jsx(ar,{label:"Host",children:c.jsx(et,{onChange:L=>h(L.target.value),placeholder:"prod (an alias from ~/.ssh/config)",value:u})}):null,a==="file"||a==="ssh"?c.jsx(ar,{label:a==="ssh"?"Remote path":"File path",children:c.jsx(et,{onChange:L=>f(L.target.value),placeholder:"/var/log/app/out.log",value:m})}):null,a==="command"?c.jsxs(c.Fragment,{children:[c.jsx(ar,{label:"Command",children:c.jsx(et,{onChange:L=>b(L.target.value),placeholder:"kubectl logs -l app=myapp --tail 500",value:p})}),c.jsx(ar,{label:"Working directory (optional)",children:c.jsx(et,{onChange:L=>x(L.target.value),placeholder:"/srv/app",value:_})})]}):null,A?c.jsx("div",{className:"text-red-600",children:A}):null,c.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[c.jsx(ue,{onClick:e,size:"sm",type:"button",variant:"outline",children:"Cancel"}),c.jsx(ue,{disabled:M||!i.trim(),size:"sm",type:"submit",children:M?"Saving…":"Add source"})]})]})})}function ar({label:e,children:t}){return c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"font-medium text-muted-foreground",children:e}),t]})}const JS=4;function az({services:e,initialService:t,onClose:i}){const[s,a]=k.useState([]),[o,u]=k.useState(!1),[h,m]=k.useState(()=>[0]),[f,p]=k.useState(()=>{const N=t?{kind:"service",name:t}:e[0]?{kind:"service",name:e[0]}:void 0;return N?{0:N}:{}}),b=k.useRef(1);k.useEffect(()=>{let N=!1;return a6().then(M=>{N||a(M)}),()=>{N=!0}},[]);const _=[...e.map(N=>({target:{kind:"service",name:N},label:N,group:"Services"})),...s.map(N=>({target:{kind:"source",name:N.name},label:N.name,group:"Log sources"}))],x=_.map(N=>N.target);function y(){if(h.length>=JS||x.length===0)return;const N=b.current++,M=new Set(Object.values(f).map(ZS)),D=x.find(U=>!M.has(ZS(U)))??x[0];m(U=>[...U,N]),p(U=>({...U,[N]:D}))}function S(N){m(M=>M.filter(D=>D!==N)),p(M=>{const D={...M};return delete D[N],D})}function E(N,M){p(D=>({...D,[N]:M}))}function C(N,M){a(N);const D=h[0];D!==void 0&&E(D,{kind:"source",name:M})}const A=c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("span",{children:"Logs"}),c.jsxs(ue,{onClick:()=>u(!0),size:"sm",type:"button",variant:"outline",children:[c.jsx(mn,{}),"Add source"]}),c.jsxs(ue,{disabled:h.length>=JS||x.length===0,onClick:y,size:"sm",type:"button",variant:"outline",children:[c.jsx(mn,{}),"Add pane"]})]});return c.jsxs(c.Fragment,{children:[c.jsx(Jb,{maxWidthClass:"max-w-[1500px]",onClose:i,title:A,children:x.length===0?c.jsx("div",{className:"grid h-full place-items-center text-center text-muted-foreground",children:c.jsxs("div",{children:[c.jsx("p",{children:"No services or log sources yet."}),c.jsxs(ue,{className:"mt-2",onClick:()=>u(!0),size:"sm",type:"button",children:[c.jsx(mn,{}),"Add a log source"]})]})}):c.jsx("div",{className:de("grid h-full min-h-0 gap-3",h.length>1?"lg:grid-cols-2":"grid-cols-1",h.length>2?"lg:grid-rows-2":"grid-rows-1"),children:h.map(N=>c.jsx(oz,{onChangeTarget:M=>E(N,M),onRemove:h.length>1?()=>S(N):void 0,options:_,target:f[N]??x[0]},N))})}),o?c.jsx(rz,{onAdded:C,onClose:()=>u(!1)}):null]})}function oz({options:e,target:t,onChangeTarget:i,onRemove:s}){const[a,o]=k.useState(""),[u,h]=k.useState(!0),[m,f]=k.useState(!1);return c.jsx("div",{className:"flex min-h-0 min-w-0 flex-col rounded-lg border border-border bg-background/60 p-2",children:c.jsx(aN,{fill:!0,hideStdout:m,leading:c.jsx(iz,{onChange:i,options:e,target:t}),query:a,setHideStdout:f,setQuery:o,setStreaming:h,streaming:u,target:t,trailing:s?c.jsx(ue,{"aria-label":"Remove pane",onClick:s,size:"icon",type:"button",variant:"ghost",children:c.jsx(Ji,{})}):void 0})})}function lz({rows:e,revealAll:t,onAdd:i,onRemove:s,onUpdate:a}){return e.length===0?c.jsxs("div",{className:"text-muted-foreground",children:["No variables yet."," ",c.jsx("button",{className:"underline",onClick:i,type:"button",children:"Add one"}),"."]}):c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full font-mono text-[11px]",children:[c.jsx("thead",{className:"text-left text-muted-foreground",children:c.jsxs("tr",{children:[c.jsx("th",{className:"py-1 pr-3",children:"Key"}),c.jsx("th",{className:"py-1 pr-3",children:"Value"}),c.jsx("th",{className:"py-1 w-8"})]})}),c.jsx("tbody",{children:e.map((o,u)=>{const h=!o.reveal&&!t;return c.jsxs("tr",{className:"border-t border-border/40",children:[c.jsx("td",{className:"py-1 pr-3 align-top",children:c.jsx("input",{className:"w-full rounded border border-border/60 bg-background px-1.5 py-0.5 font-mono",onChange:m=>a(u,{key:m.target.value}),placeholder:"KEY",spellCheck:!1,value:o.key})}),c.jsx("td",{className:"py-1 pr-3 align-top",children:c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("input",{className:"w-full rounded border border-border/60 bg-background px-1.5 py-0.5 font-mono",onChange:m=>a(u,{value:m.target.value}),spellCheck:!1,type:h?"password":"text",value:o.value}),c.jsx("button",{className:"text-muted-foreground hover:text-foreground",onClick:()=>a(u,{reveal:!o.reveal}),title:o.reveal||t?"Hide":"Reveal",type:"button",children:o.reveal||t?c.jsx(xk,{size:14}):c.jsx(sb,{size:14})})]})}),c.jsx("td",{className:"py-1 align-top",children:c.jsx("button",{className:"text-muted-foreground hover:text-red-600",onClick:()=>s(u),type:"button",children:c.jsx(rl,{size:14})})})]},u)})})]})})}function cz({serviceName:e,onClose:t,onPick:i}){const[s,a]=k.useState(),[o,u]=k.useState(),[h,m]=k.useState(!0),[f,p]=k.useState();k.useEffect(()=>{let x=!1;return m(!0),u(void 0),(async()=>{try{const y=await g6(e,f);x||a(y)}catch(y){x||u(y instanceof Error?y.message:String(y))}finally{x||m(!1)}})(),()=>{x=!0}},[e,f]);function b(x){if(x.kind==="directory"){p(x.relativePath);return}x.supported&&i(x.relativePath)}function _(){if(!s||s.isRoot)return;const x=s.relativePath,y=x.includes("/")?x.slice(0,x.lastIndexOf("/")):"";p(y||void 0)}return c.jsx(Ts,{icon:c.jsx($h,{}),onClose:t,size:"lg",title:"Pick a config file",children:c.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[c.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[c.jsxs(ue,{disabled:!s||s.isRoot,onClick:_,size:"sm",type:"button",variant:"outline",children:[c.jsx(Ph,{})," Up"]}),c.jsx("code",{className:"truncate rounded bg-muted px-2 py-1 font-mono",children:s?.relativePath||"./"})]}),o?c.jsx("div",{className:"text-red-600",children:o}):h?c.jsx("div",{className:"text-muted-foreground",children:"Loading…"}):!s||s.entries.length===0?c.jsx("div",{className:"text-muted-foreground",children:"Empty directory."}):c.jsx("div",{className:"max-h-[50vh] overflow-auto rounded border border-border/60",children:c.jsx("ul",{className:"divide-y divide-border/40",children:s.entries.map(x=>{const y=x.kind==="directory",S=y||x.supported;return c.jsx("li",{children:c.jsxs("button",{className:de("flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs",S?"hover:bg-muted":"cursor-not-allowed text-muted-foreground"),disabled:!S,onClick:()=>b(x),type:"button",children:[y?c.jsx(Ga,{size:14}):c.jsx(kk,{size:14}),c.jsx("span",{className:"flex-1 truncate font-mono",children:x.name}),!y&&x.format?c.jsx(Pe,{size:"small",variant:"secondary",children:x.format}):null]})},x.relativePath)})})}),c.jsxs("p",{className:"text-xs text-muted-foreground",children:["Only ",c.jsx("code",{children:".env*"}),", ",c.jsx("code",{children:"appsettings*.json"}),", and"," ",c.jsx("code",{children:"application*.yml"})," can be selected. Other files are shown disabled."]})]})})}function oN(e){if(!e.trim())return e;try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function uz(e){const{error:t,success:i}=Bi(),[s,a]=k.useState([]),[o,u]=k.useState(),[h,m]=k.useState(),[f,p]=k.useState(!0),[b,_]=k.useState(!1),[x,y]=k.useState(!1),[S,E]=k.useState(!1),[C,A]=k.useState();k.useEffect(()=>{let I=!1;return p(!0),A(void 0),(async()=>{try{const F=await b6(e);if(I)return;a(F.files),F.files.length>0?u(G=>G??F.files[0].path):(u(void 0),m(void 0))}catch(F){I||A(F instanceof Error?F.message:String(F))}finally{I||p(!1)}})(),()=>{I=!0}},[e]);const N=k.useCallback(async I=>{_(!0),A(void 0);try{const F=await ny(e,I),G={path:F.path,relativePath:F.relativePath,format:F.format};F.format==="env"?m({info:G,exists:F.exists,rows:F.entries.map(Y=>({...Y,reveal:!1}))}):m({info:G,exists:F.exists,text:F.format==="json"?oN(F.content):F.content}),E(!1)}catch(F){A(F instanceof Error?F.message:String(F))}finally{_(!1)}},[e]);k.useEffect(()=>{o&&N(o)},[o,N]);function M(I,F){m(G=>{if(!G?.rows)return G;const Y=G.rows.map((Q,q)=>q===I?{...Q,...F}:Q);return{...G,rows:Y}}),E(!0)}function D(){m(I=>I?.rows?{...I,rows:[...I.rows,{key:"",value:"",secret:!1,reveal:!0}]}:I),E(!0)}function U(I){m(F=>F?.rows?{...F,rows:F.rows.filter((G,Y)=>Y!==I)}:F),E(!0)}function L(I){m(F=>F&&{...F,text:I}),E(!0)}async function R(){if(h){y(!0);try{if(h.info.format==="env"&&h.rows){const I=await v6(e,h.info.path,h.rows.map(F=>({key:F.key.trim(),value:F.value})));m({info:{path:I.path,relativePath:I.relativePath,format:I.format},exists:I.exists,rows:I.entries.map(F=>({...F,reveal:!1}))}),i(`Saved ${I.entries.length} entries to ${I.relativePath}.`)}else if(h.text!==void 0){const I=await _6(e,h.info.path,h.text);m({info:{path:I.path,relativePath:I.relativePath,format:I.format},exists:I.exists,text:I.content}),i(`Saved ${I.relativePath}.`)}E(!1)}catch(I){t(I instanceof Error?I.message:String(I))}finally{y(!1)}}}async function $(I){try{const F=await ny(e,I),G={path:F.path,relativePath:F.relativePath,format:F.format};return a(Y=>Y.some(Q=>Q.path===G.path)?Y:[...Y,G]),u(G.path),i(`Loaded ${G.relativePath}.`),!0}catch(F){return t(F instanceof Error?F.message:String(F)),!1}}return{files:s,selectedPath:o,setSelectedPath:u,loaded:h,loadingList:f,loadingFile:b,saving:x,dirty:S,error:C,addRow:D,removeRow:U,updateRow:M,updateText:L,save:R,pickFile:$}}function dz({serviceName:e}){const{files:t,selectedPath:i,setSelectedPath:s,loaded:a,loadingList:o,loadingFile:u,saving:h,dirty:m,error:f,addRow:p,removeRow:b,updateRow:_,updateText:x,save:y,pickFile:S}=uz(e),[E,C]=k.useState(!1),[A,N]=k.useState(!1);return o?c.jsx("div",{className:"text-muted-foreground",children:"Loading…"}):f&&!a?c.jsx("div",{className:"text-red-600",children:f}):c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx("span",{className:"text-muted-foreground",children:"File:"}),t.length>0?c.jsx("select",{className:"rounded border border-border/60 bg-background px-1.5 py-0.5 font-mono text-xs",onChange:M=>s(M.target.value),value:i??"",children:t.map(M=>c.jsxs("option",{value:M.path,children:[M.relativePath," [",M.format,"]"]},M.path))}):c.jsx("span",{className:"text-muted-foreground",children:"none detected"}),c.jsxs(ue,{onClick:()=>N(!0),size:"sm",type:"button",variant:"outline",children:[c.jsx($h,{})," Browse files"]}),a?c.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 font-mono text-muted-foreground",children:a.info.path}):null]}),c.jsxs("div",{className:"flex items-center gap-1",children:[a?.info.format==="env"?c.jsxs(c.Fragment,{children:[c.jsxs(ue,{onClick:()=>C(M=>!M),size:"sm",type:"button",variant:"outline",children:[E?c.jsx(xk,{}):c.jsx(sb,{}),E?"Hide secrets":"Reveal secrets"]}),c.jsxs(ue,{onClick:p,size:"sm",type:"button",variant:"outline",children:[c.jsx(mn,{})," Add"]})]}):null,c.jsxs(ue,{disabled:!m||h||!a,onClick:y,size:"sm",type:"button",children:[c.jsx(Ak,{})," ",h?"Saving…":"Save"]})]})]}),f&&!a?c.jsx("div",{className:"text-red-600",children:f}):a?.info.format==="env"&&a.rows?c.jsx("div",{className:de(u&&"opacity-60 transition-opacity"),children:c.jsx(lz,{revealAll:E,rows:a.rows,onAdd:p,onRemove:b,onUpdate:_})}):a?.text!==void 0?c.jsxs("div",{className:de("space-y-1",u&&"opacity-60 transition-opacity"),children:[a.info.format==="json"?c.jsx("div",{className:"flex justify-end",children:c.jsx(ue,{onClick:()=>x(oN(a.text??"")),size:"sm",type:"button",variant:"outline",children:"Format JSON"})}):null,c.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=>x(M.target.value),spellCheck:!1,value:a.text})]}):u?c.jsx("div",{className:"text-muted-foreground",children:"Loading file…"}):null,a?c.jsxs("p",{className:"text-muted-foreground",children:[a.info.format==="env"?"Comments and blank lines are preserved.":a.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,A?c.jsx(cz,{onClose:()=>N(!1),onPick:M=>{S(M).then(D=>{D&&N(!1)})},serviceName:e}):null]})}function hz({serviceName:e,status:t,timeline:i,onRefresh:s}){const{error:a,success:o}=Bi(),[u,h]=k.useState(!1),m=t?.inspector,f=t?.state==="running",p=k.useMemo(()=>i.filter(x=>x.kind==="service.http"&&x.service===e).map(x=>{const y=x.data??{};return{id:y.id??x.id,startedAt:x.timestamp,method:y.method??"?",path:y.path??"?",status:y.status??0,durationMs:y.durationMs??0,reqBytes:y.reqBytes??0,resBytes:y.resBytes??0}}).slice(-500).reverse(),[i,e]);async function b(x){h(!0);try{await pn(`/api/services/${encodeURIComponent(e)}/inspector`,{enabled:x?"true":"false"}),await s(),o(x?`HTTP inspector started for ${e}.`:`HTTP inspector stopped for ${e}.`)}catch(y){a(y instanceof Error?y.message:String(y))}finally{h(!1)}}if(!f)return c.jsx("div",{className:"text-muted-foreground",children:"Service is not running."});if(!m?.enabled)return c.jsxs("div",{className:"space-y-2",children:[c.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."}),c.jsxs(ue,{disabled:u,onClick:()=>b(!0),size:"sm",type:"button",children:[c.jsx(Uh,{})," Start HTTP inspector"]})]});const _=m.port?`http://127.0.0.1:${m.port}`:void 0;return c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx("span",{className:"text-muted-foreground",children:"Inspect URL:"}),_?c.jsxs(c.Fragment,{children:[c.jsx("code",{className:"rounded bg-background px-1.5 py-0.5 font-mono",children:_}),c.jsxs(ue,{onClick:()=>{navigator.clipboard.writeText(_),o("Copied inspect URL.")},size:"sm",type:"button",variant:"outline",children:[c.jsx(Lg,{})," Copy"]}),c.jsx(ue,{onClick:()=>window.open(_,"_blank","noopener,noreferrer"),size:"sm",type:"button",variant:"outline",children:"Open"})]}):c.jsx("span",{className:"text-muted-foreground",children:"starting…"}),c.jsxs("span",{className:"text-muted-foreground",children:["→ upstream :",m.upstreamPort??"?"]}),c.jsxs(ue,{disabled:u,onClick:()=>b(!1),size:"sm",type:"button",variant:"outline",children:[c.jsx(Fh,{})," Stop"]})]}),p.length===0?c.jsx("div",{className:"text-muted-foreground",children:"No requests captured yet. Hit the inspect URL in your browser to see traffic."}):c.jsx("div",{className:"max-h-80 overflow-auto",children:c.jsxs("table",{className:"w-full font-mono text-[11px]",children:[c.jsx("thead",{className:"sticky top-0 bg-muted/60 text-left text-muted-foreground",children:c.jsxs("tr",{children:[c.jsx("th",{className:"py-1 pr-3",children:"Time"}),c.jsx("th",{className:"py-1 pr-3",children:"Method"}),c.jsx("th",{className:"py-1 pr-3",children:"Path"}),c.jsx("th",{className:"py-1 pr-3 text-right",children:"Status"}),c.jsx("th",{className:"py-1 pr-3 text-right",children:"Size"}),c.jsx("th",{className:"py-1 pr-3 text-right",children:"ms"})]})}),c.jsx("tbody",{children:p.map(x=>c.jsxs("tr",{className:"border-t border-border/40",children:[c.jsx("td",{className:"py-1 pr-3 text-muted-foreground",children:new Date(x.startedAt).toLocaleTimeString()}),c.jsx("td",{className:"py-1 pr-3",children:x.method}),c.jsx("td",{className:"py-1 pr-3 truncate max-w-[40ch]",children:x.path}),c.jsx("td",{className:de("py-1 pr-3 text-right",fz(x.status)),children:x.status}),c.jsx("td",{className:"py-1 pr-3 text-right text-muted-foreground",children:mz(x.resBytes)}),c.jsx("td",{className:"py-1 pr-3 text-right",children:x.durationMs.toFixed(1)})]},x.id))})]})})]})}function fz(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 mz(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function pz({serviceName:e}){const[t,i]=k.useState(null),[s,a]=k.useState(null),[o,u]=k.useState(()=>Date.now());return k.useEffect(()=>{let h=!1;async function m(){try{const p=await x6(e);h||(i(p),u(Date.now()),a(null))}catch(p){h||a(p instanceof Error?p.message:String(p))}}m();const f=setInterval(()=>{m()},3e3);return()=>{h=!0,clearInterval(f)}},[e]),s?c.jsxs("p",{className:"text-destructive",children:["Failed to load metrics: ",s]}):t?t.samples.length===0?c.jsx("p",{className:"text-muted-foreground",children:"No samples yet. Metrics start collecting once the service is running."}):c.jsx(gz,{series:t,now:o}):c.jsx("p",{className:"text-muted-foreground",children:"Loading metrics…"})}function gz({series:e,now:t}){const{samples:i}=e,s=k.useMemo(()=>ew(i,m=>m.cpu),[i]),a=k.useMemo(()=>ew(i,m=>m.rss),[i]),o=e.startedAt?new Date(e.startedAt):null,u=o?t-o.getTime():null,h=i.length>1?i[i.length-1].t-i[0].t:0;return c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:[c.jsx(Pd,{accent:"#22c55e",label:"CPU",value:`${s.last.toFixed(1)}%`,sub:`peak ${s.max.toFixed(1)}% · avg ${s.avg.toFixed(1)}%`}),c.jsx(Pd,{accent:"#3b82f6",label:"Memory",value:Op(a.last),sub:`peak ${Op(a.max)} · avg ${Op(a.avg)}`}),c.jsx(Pd,{accent:"#a855f7",label:"Uptime",value:u!=null?nw(u):"—",sub:o?`since ${o.toLocaleTimeString()}`:"not running"}),c.jsx(Pd,{accent:"#f59e0b",label:"Samples",value:String(i.length),sub:h?`over ${nw(h)}`:"collecting…"})]}),c.jsx(iw,{label:"CPU",samples:i,pick:m=>m.cpu,summary:s,color:"#22c55e",suffix:"%",unit:"percent"}),c.jsx(iw,{label:"Memory (RSS)",samples:i,pick:m=>m.rss,summary:a,color:"#3b82f6",suffix:" MB",unit:"mb"})]})}function ew(e,t){const i=e.map(t),s=i.reduce((a,o)=>a+o,0);return{last:i[i.length-1],max:Math.max(...i),min:Math.min(...i),avg:s/i.length}}function Pd({accent:e,label:t,value:i,sub:s}){return c.jsxs("div",{className:"rounded-lg border border-border bg-card px-3 py-2",children:[c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full",style:{backgroundColor:e}}),c.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:t})]}),c.jsx("div",{className:"mt-1 font-mono text-lg leading-none tabular-nums",children:i}),c.jsx("div",{className:"mt-1 truncate font-mono text-[10px] text-muted-foreground",children:s})]})}const Po=160,tw=44,bz=20;function iw({label:e,samples:t,pick:i,summary:s,color:a,suffix:o,unit:u}){const h=k.useMemo(()=>`metric-grad-${u}-${Math.random().toString(36).slice(2,8)}`,[u]),m=t.map(i),f=Math.max(...m,u==="percent"?10:1),p=vz(f),b=0,_=p-b||1,x=t[0].t,y=t[t.length-1].t,S=Math.max(1,y-x),E=I=>(I-x)/S*1e3,C=I=>(1-(I-b)/_)*1e3,A=t.map(I=>`${E(I.t).toFixed(1)},${C(i(I)).toFixed(1)}`),N=`M0,1000 L${A.join(" L")} L1000,1000 Z`,M=`M${A.join(" L")}`,D=E(y),U=C(s.last),L=C(s.avg),R=[1,.75,.5,.25,0],$=5;return c.jsxs("figure",{className:"space-y-1",children:[c.jsxs("figcaption",{className:"flex items-baseline justify-between",children:[c.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:e}),c.jsxs("span",{className:"font-mono text-[11px] text-muted-foreground",children:["now ",c.jsxs("span",{className:"text-foreground",children:[s.last.toFixed(1),o]}),c.jsx("span",{className:"mx-1.5",children:"·"}),"peak ",s.max.toFixed(1),o,c.jsx("span",{className:"mx-1.5",children:"·"}),"avg ",s.avg.toFixed(1),o]})]}),c.jsxs("div",{className:"rounded-lg border border-border bg-card p-2",children:[c.jsxs("div",{className:"flex",children:[c.jsx("div",{className:"relative flex shrink-0 flex-col justify-between text-right font-mono text-[10px] text-muted-foreground",style:{width:tw,height:Po},children:R.map(I=>c.jsx("span",{className:"pr-1 leading-none",children:_z(b+I*_,u)},I))}),c.jsxs("div",{className:"relative min-w-0 flex-1",style:{height:Po},children:[R.map((I,F)=>c.jsx("div",{className:"pointer-events-none absolute inset-x-0 border-t border-border/40",style:{top:`${I===1?0:I===0?Po-1:(1-I)*Po}px`,borderStyle:F===R.length-1?"solid":"dashed"}},I)),c.jsx("div",{className:"pointer-events-none absolute inset-x-0 border-t border-dashed",style:{top:`${L/1e3*Po}px`,borderColor:a,opacity:.4}}),c.jsxs("svg",{"aria-label":e,className:"absolute inset-0 h-full w-full",preserveAspectRatio:"none",role:"img",viewBox:"0 0 1000 1000",children:[c.jsx("defs",{children:c.jsxs("linearGradient",{id:h,x1:"0",x2:"0",y1:"0",y2:"1",children:[c.jsx("stop",{offset:"0%",stopColor:a,stopOpacity:.35}),c.jsx("stop",{offset:"100%",stopColor:a,stopOpacity:.02})]})}),c.jsx("path",{d:N,fill:`url(#${h})`}),c.jsx("path",{d:M,fill:"none",stroke:a,strokeWidth:2,vectorEffect:"non-scaling-stroke",strokeLinejoin:"round",strokeLinecap:"round"})]}),c.jsx("span",{className:"pointer-events-none absolute z-10 block h-2.5 w-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full ring-2 ring-card",style:{left:`${D/1e3*100}%`,top:`${U/1e3*Po}px`,backgroundColor:a,boxShadow:`0 0 0 4px ${a}33`}})]})]}),c.jsx("div",{className:"flex font-mono text-[10px] text-muted-foreground",style:{height:bz,paddingLeft:tw},children:c.jsx("div",{className:"relative flex-1",children:Array.from({length:$+1},(I,F)=>{const G=F/$,Y=x+G*S;return c.jsx("span",{className:"absolute top-1 whitespace-nowrap",style:{left:`${G*100}%`,transform:F===0?"translateX(0)":F===$?"translateX(-100%)":"translateX(-50%)"},children:xz(Y-y)},F)})})})]})]})}function vz(e){if(e<=1)return 1;const t=Math.pow(10,Math.floor(Math.log10(e))),i=e/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function _z(e,t){return t==="percent"?`${e.toFixed(0)}%`:e>=1024?`${(e/1024).toFixed(1)}G`:`${e.toFixed(0)}M`}function Op(e){return e>=1024?`${(e/1024).toFixed(2)} GB`:`${e.toFixed(0)} MB`}function nw(e){const t=Math.max(0,Math.round(e/1e3));if(t<60)return`${t}s`;const i=Math.floor(t/60);if(i<60)return`${i}m ${t%60}s`;const s=Math.floor(i/60);return s<24?`${s}h ${i%60}m`:`${Math.floor(s/24)}d ${s%24}h`}function xz(e){const t=Math.round(e/1e3);if(t===0)return"now";if(Math.abs(t)<60)return`${t}s`;const s=Math.round(t/60);return Math.abs(s)<60?`${s}m`:`${Math.round(s/60)}h`}function yz({rows:e}){if(e.length===0)return c.jsx("div",{className:"text-muted-foreground",children:"No process tree (service not running)."});const t=[...e].sort((s,a)=>a.cpuPercent-s.cpuPercent),i=new Set(e.map(s=>s.pid));return c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full font-mono text-[11px]",children:[c.jsx("thead",{className:"text-left text-muted-foreground",children:c.jsxs("tr",{children:[c.jsx("th",{className:"py-1 pr-3",children:"PID"}),c.jsx("th",{className:"py-1 pr-3",children:"PPID"}),c.jsx("th",{className:"py-1 pr-3 text-right",children:"CPU%"}),c.jsx("th",{className:"py-1 pr-3 text-right",children:"RSS MB"}),c.jsx("th",{className:"py-1",children:"Command"})]})}),c.jsx("tbody",{children:t.map(s=>{const a=i.has(s.ppid);return c.jsxs("tr",{className:"border-t border-border/40",children:[c.jsx("td",{className:"py-1 pr-3",children:s.pid}),c.jsx("td",{className:"py-1 pr-3 text-muted-foreground",children:s.ppid}),c.jsx("td",{className:"py-1 pr-3 text-right",children:s.cpuPercent.toFixed(1)}),c.jsx("td",{className:"py-1 pr-3 text-right",children:s.rssMb.toFixed(1)}),c.jsx("td",{className:de("py-1 truncate max-w-[60ch]",a&&"pl-4"),children:s.command})]},s.pid)})})]})})}var Sz=2,wz=1,kz=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,i=window.getComputedStyle(this._terminal.element.parentElement),s=parseInt(i.getPropertyValue("height")),a=Math.max(0,parseInt(i.getPropertyValue("width"))),o=window.getComputedStyle(this._terminal.element),u={top:parseInt(o.getPropertyValue("padding-top")),bottom:parseInt(o.getPropertyValue("padding-bottom")),right:parseInt(o.getPropertyValue("padding-right")),left:parseInt(o.getPropertyValue("padding-left"))},h=u.top+u.bottom,m=u.right+u.left,f=s-h,p=a-m-t;return{cols:Math.max(Sz,Math.floor(p/e.css.cell.width)),rows:Math.max(wz,Math.floor(f/e.css.cell.height))}}};var lN=Object.defineProperty,Ez=Object.getOwnPropertyDescriptor,Cz=(e,t)=>{for(var i in t)lN(e,i,{get:t[i],enumerable:!0})},Vt=(e,t,i,s)=>{for(var a=s>1?void 0:s?Ez(t,i):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(a=(s?u(t,i,a):u(a))||a);return s&&a&&lN(t,i,a),a},Se=(e,t)=>(i,s)=>t(i,s,e),sw="Terminal input",h0={get:()=>sw,set:e=>sw=e},rw="Too much output to announce, navigate to rows manually to read",f0={get:()=>rw,set:e=>rw=e};function Nz(e){return e.replace(/\r?\n/g,"\r")}function Tz(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function Az(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function Mz(e,t,i,s){if(e.stopPropagation(),e.clipboardData){let a=e.clipboardData.getData("text/plain");cN(a,t,i,s)}}function cN(e,t,i,s){e=Nz(e),e=Tz(e,i.decPrivateModes.bracketedPasteMode&&s.rawOptions.ignoreBracketedPasteMode!==!0),i.triggerDataEvent(e,!0),t.value=""}function uN(e,t,i){let s=i.getBoundingClientRect(),a=e.clientX-s.left-10,o=e.clientY-s.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${a}px`,t.style.top=`${o}px`,t.style.zIndex="1000",t.focus()}function aw(e,t,i,s,a){uN(e,t,i),a&&s.rightClickSelect(e),t.value=s.selectionText,t.select()}function Xr(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function Zh(e,t=0,i=e.length){let s="";for(let a=t;a<i;++a){let o=e[a];o>65535?(o-=65536,s+=String.fromCharCode((o>>10)+55296)+String.fromCharCode(o%1024+56320)):s+=String.fromCharCode(o)}return s}var Rz=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let i=e.length;if(!i)return 0;let s=0,a=0;if(this._interim){let o=e.charCodeAt(a++);56320<=o&&o<=57343?t[s++]=(this._interim-55296)*1024+o-56320+65536:(t[s++]=this._interim,t[s++]=o),this._interim=0}for(let o=a;o<i;++o){let u=e.charCodeAt(o);if(55296<=u&&u<=56319){if(++o>=i)return this._interim=u,s;let h=e.charCodeAt(o);56320<=h&&h<=57343?t[s++]=(u-55296)*1024+h-56320+65536:(t[s++]=u,t[s++]=h);continue}u!==65279&&(t[s++]=u)}return s}},jz=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let i=e.length;if(!i)return 0;let s=0,a,o,u,h,m=0,f=0;if(this.interim[0]){let _=!1,x=this.interim[0];x&=(x&224)===192?31:(x&240)===224?15:7;let y=0,S;for(;(S=this.interim[++y]&63)&&y<4;)x<<=6,x|=S;let E=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,C=E-y;for(;f<C;){if(f>=i)return 0;if(S=e[f++],(S&192)!==128){f--,_=!0;break}else this.interim[y++]=S,x<<=6,x|=S&63}_||(E===2?x<128?f--:t[s++]=x:E===3?x<2048||x>=55296&&x<=57343||x===65279||(t[s++]=x):x<65536||x>1114111||(t[s++]=x)),this.interim.fill(0)}let p=i-4,b=f;for(;b<i;){for(;b<p&&!((a=e[b])&128)&&!((o=e[b+1])&128)&&!((u=e[b+2])&128)&&!((h=e[b+3])&128);)t[s++]=a,t[s++]=o,t[s++]=u,t[s++]=h,b+=4;if(a=e[b++],a<128)t[s++]=a;else if((a&224)===192){if(b>=i)return this.interim[0]=a,s;if(o=e[b++],(o&192)!==128){b--;continue}if(m=(a&31)<<6|o&63,m<128){b--;continue}t[s++]=m}else if((a&240)===224){if(b>=i)return this.interim[0]=a,s;if(o=e[b++],(o&192)!==128){b--;continue}if(b>=i)return this.interim[0]=a,this.interim[1]=o,s;if(u=e[b++],(u&192)!==128){b--;continue}if(m=(a&15)<<12|(o&63)<<6|u&63,m<2048||m>=55296&&m<=57343||m===65279)continue;t[s++]=m}else if((a&248)===240){if(b>=i)return this.interim[0]=a,s;if(o=e[b++],(o&192)!==128){b--;continue}if(b>=i)return this.interim[0]=a,this.interim[1]=o,s;if(u=e[b++],(u&192)!==128){b--;continue}if(b>=i)return this.interim[0]=a,this.interim[1]=o,this.interim[2]=u,s;if(h=e[b++],(h&192)!==128){b--;continue}if(m=(a&7)<<18|(o&63)<<12|(u&63)<<6|h&63,m<65536||m>1114111)continue;t[s++]=m}}return s}},dN="",Qr=" ",ou=class hN{constructor(){this.fg=0,this.bg=0,this.extended=new Th}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 hN;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}},Th=class fN{constructor(t=0,i=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=i}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 fN(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Gn=class mN extends ou{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Th,this.combinedData=""}static fromCharData(t){let i=new mN;return i.setFromCharData(t),i}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Xr(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 i=!1;if(t[1].length>2)i=!0;else if(t[1].length===2){let s=t[1].charCodeAt(0);if(55296<=s&&s<=56319){let a=t[1].charCodeAt(1);56320<=a&&a<=57343?this.content=(s-55296)*1024+a-56320+65536|t[2]<<22:i=!0}else i=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;i&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},ow="di$target",m0="di$dependencies",Lp=new Map;function Dz(e){return e[m0]||[]}function Si(e){if(Lp.has(e))return Lp.get(e);let t=function(i,s,a){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Oz(t,i,a)};return t._id=e,Lp.set(e,t),t}function Oz(e,t,i){t[ow]===t?t[m0].push({id:e,index:i}):(t[m0]=[{id:e,index:i}],t[ow]=t)}var en=Si("BufferService"),pN=Si("CoreMouseService"),Za=Si("CoreService"),Lz=Si("CharsetService"),ev=Si("InstantiationService"),gN=Si("LogService"),tn=Si("OptionsService"),bN=Si("OscLinkService"),Bz=Si("UnicodeService"),lu=Si("DecorationService"),p0=class{constructor(e,t,i){this._bufferService=e,this._optionsService=t,this._oscLinkService=i}provideLinks(e,t){let i=this._bufferService.buffer.lines.get(e-1);if(!i){t(void 0);return}let s=[],a=this._optionsService.rawOptions.linkHandler,o=new Gn,u=i.getTrimmedLength(),h=-1,m=-1,f=!1;for(let p=0;p<u;p++)if(!(m===-1&&!i.hasContent(p))){if(i.loadCell(p,o),o.hasExtendedAttrs()&&o.extended.urlId)if(m===-1){m=p,h=o.extended.urlId;continue}else f=o.extended.urlId!==h;else m!==-1&&(f=!0);if(f||m!==-1&&p===u-1){let b=this._oscLinkService.getLinkData(h)?.uri;if(b){let _={start:{x:m+1,y:e},end:{x:p+(!f&&p===u-1?1:0),y:e}},x=!1;if(!a?.allowNonHttpProtocols)try{let y=new URL(b);["http:","https:"].includes(y.protocol)||(x=!0)}catch{x=!0}x||s.push({text:b,range:_,activate:(y,S)=>a?a.activate(y,S,_):zz(y,S),hover:(y,S)=>a?.hover?.(y,S,_),leave:(y,S)=>a?.leave?.(y,S,_)})}f=!1,o.hasExtendedAttrs()&&o.extended.urlId?(m=p,h=o.extended.urlId):(m=-1,h=-1)}}t(s)}};p0=Vt([Se(0,en),Se(1,tn),Se(2,bN)],p0);function zz(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
139
|
-
|
|
140
|
-
WARNING: This link could potentially be dangerous`)){let i=window.open();if(i){try{i.opener=null}catch{}i.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var Qh=Si("CharSizeService"),hr=Si("CoreBrowserService"),tv=Si("MouseService"),fr=Si("RenderService"),Iz=Si("SelectionService"),vN=Si("CharacterJoinerService"),dl=Si("ThemeService"),_N=Si("LinkProviderService"),Pz=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?lw.isErrorNoTelemetry(e)?new lw(e.message+`
|
|
141
|
-
|
|
142
|
-
`+e.stack):new Error(e.message+`
|
|
143
|
-
|
|
144
|
-
`+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)}},$z=new Pz;function th(e){Uz(e)||$z.onUnexpectedError(e)}var g0="Canceled";function Uz(e){return e instanceof Hz?!0:e instanceof Error&&e.name===g0&&e.message===g0}var Hz=class extends Error{constructor(){super(g0),this.name=this.message}};function Fz(e){return new Error(`Illegal argument: ${e}`)}var lw=class b0 extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof b0)return t;let i=new b0;return i.message=t.message,i.stack=t.stack,i}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},v0=class xN extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,xN.prototype)}};function Cn(e,t=0){return e[e.length-(1+t)]}var Vz;(e=>{function t(o){return o<0}e.isLessThan=t;function i(o){return o<=0}e.isLessThanOrEqual=i;function s(o){return o>0}e.isGreaterThan=s;function a(o){return o===0}e.isNeitherLessOrGreaterThan=a,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(Vz||={});function qz(e,t){let i=this,s=!1,a;return function(){return s||(s=!0,t||(a=e.apply(i,arguments))),a}}var yN;(e=>{function t(M){return M&&typeof M=="object"&&typeof M[Symbol.iterator]=="function"}e.is=t;let i=Object.freeze([]);function s(){return i}e.empty=s;function*a(M){yield M}e.single=a;function o(M){return t(M)?M:a(M)}e.wrap=o;function u(M){return M||i}e.from=u;function*h(M){for(let D=M.length-1;D>=0;D--)yield M[D]}e.reverse=h;function m(M){return!M||M[Symbol.iterator]().next().done===!0}e.isEmpty=m;function f(M){return M[Symbol.iterator]().next().value}e.first=f;function p(M,D){let U=0;for(let L of M)if(D(L,U++))return!0;return!1}e.some=p;function b(M,D){for(let U of M)if(D(U))return U}e.find=b;function*_(M,D){for(let U of M)D(U)&&(yield U)}e.filter=_;function*x(M,D){let U=0;for(let L of M)yield D(L,U++)}e.map=x;function*y(M,D){let U=0;for(let L of M)yield*D(L,U++)}e.flatMap=y;function*S(...M){for(let D of M)yield*D}e.concat=S;function E(M,D,U){let L=U;for(let R of M)L=D(L,R);return L}e.reduce=E;function*C(M,D,U=M.length){for(D<0&&(D+=M.length),U<0?U+=M.length:U>M.length&&(U=M.length);D<U;D++)yield M[D]}e.slice=C;function A(M,D=Number.POSITIVE_INFINITY){let U=[];if(D===0)return[U,M];let L=M[Symbol.iterator]();for(let R=0;R<D;R++){let $=L.next();if($.done)return[U,e.empty()];U.push($.value)}return[U,{[Symbol.iterator](){return L}}]}e.consume=A;async function N(M){let D=[];for await(let U of M)D.push(U);return Promise.resolve(D)}e.asyncToArray=N})(yN||={});function qa(e){if(yN.is(e)){let t=[];for(let i of e)if(i)try{i.dispose()}catch(s){t.push(s)}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 Kz(...e){return Ot(()=>qa(e))}function Ot(e){return{dispose:qz(()=>{e()})}}var SN=class wN{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{qa(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?wN.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)}};SN.DISABLE_DISPOSED_WARNING=!1;var Jr=SN,Ye=class{constructor(){this._store=new Jr,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)}};Ye.None=Object.freeze({dispose(){}});var il=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}},cr=typeof window=="object"?window:globalThis,_0=class x0{constructor(t){this.element=t,this.next=x0.Undefined,this.prev=x0.Undefined}};_0.Undefined=new _0(void 0);var It=_0,cw=class{constructor(){this._first=It.Undefined,this._last=It.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===It.Undefined}clear(){let e=this._first;for(;e!==It.Undefined;){let t=e.next;e.prev=It.Undefined,e.next=It.Undefined,e=t}this._first=It.Undefined,this._last=It.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let i=new It(e);if(this._first===It.Undefined)this._first=i,this._last=i;else if(t){let a=this._last;this._last=i,i.prev=a,a.next=i}else{let a=this._first;this._first=i,i.next=a,a.prev=i}this._size+=1;let s=!1;return()=>{s||(s=!0,this._remove(i))}}shift(){if(this._first!==It.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==It.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==It.Undefined&&e.next!==It.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===It.Undefined&&e.next===It.Undefined?(this._first=It.Undefined,this._last=It.Undefined):e.next===It.Undefined?(this._last=this._last.prev,this._last.next=It.Undefined):e.prev===It.Undefined&&(this._first=this._first.next,this._first.prev=It.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==It.Undefined;)yield e.element,e=e.next}},Gz=globalThis.performance&&typeof globalThis.performance.now=="function",Wz=class kN{static create(t){return new kN(t)}constructor(t){this._now=Gz&&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}},Ri;(e=>{e.None=()=>Ye.None;function t(G,Y){return b(G,()=>{},0,void 0,!0,void 0,Y)}e.defer=t;function i(G){return(Y,Q=null,q)=>{let O=!1,X;return X=G(Z=>{if(!O)return X?X.dispose():O=!0,Y.call(Q,Z)},null,q),O&&X.dispose(),X}}e.once=i;function s(G,Y,Q){return f((q,O=null,X)=>G(Z=>q.call(O,Y(Z)),null,X),Q)}e.map=s;function a(G,Y,Q){return f((q,O=null,X)=>G(Z=>{Y(Z),q.call(O,Z)},null,X),Q)}e.forEach=a;function o(G,Y,Q){return f((q,O=null,X)=>G(Z=>Y(Z)&&q.call(O,Z),null,X),Q)}e.filter=o;function u(G){return G}e.signal=u;function h(...G){return(Y,Q=null,q)=>{let O=Kz(...G.map(X=>X(Z=>Y.call(Q,Z))));return p(O,q)}}e.any=h;function m(G,Y,Q,q){let O=Q;return s(G,X=>(O=Y(O,X),O),q)}e.reduce=m;function f(G,Y){let Q,q={onWillAddFirstListener(){Q=G(O.fire,O)},onDidRemoveLastListener(){Q?.dispose()}},O=new be(q);return Y?.add(O),O.event}function p(G,Y){return Y instanceof Array?Y.push(G):Y&&Y.add(G),G}function b(G,Y,Q=100,q=!1,O=!1,X,Z){let V,P,j,W=0,he,oe={leakWarningThreshold:X,onWillAddFirstListener(){V=G(ne=>{W++,P=Y(P,ne),q&&!j&&(me.fire(P),P=void 0),he=()=>{let fe=P;P=void 0,j=void 0,(!q||W>1)&&me.fire(fe),W=0},typeof Q=="number"?(clearTimeout(j),j=setTimeout(he,Q)):j===void 0&&(j=0,queueMicrotask(he))})},onWillRemoveListener(){O&&W>0&&he?.()},onDidRemoveLastListener(){he=void 0,V.dispose()}},me=new be(oe);return Z?.add(me),me.event}e.debounce=b;function _(G,Y=0,Q){return e.debounce(G,(q,O)=>q?(q.push(O),q):[O],Y,void 0,!0,void 0,Q)}e.accumulate=_;function x(G,Y=(q,O)=>q===O,Q){let q=!0,O;return o(G,X=>{let Z=q||!Y(X,O);return q=!1,O=X,Z},Q)}e.latch=x;function y(G,Y,Q){return[e.filter(G,Y,Q),e.filter(G,q=>!Y(q),Q)]}e.split=y;function S(G,Y=!1,Q=[],q){let O=Q.slice(),X=G(P=>{O?O.push(P):V.fire(P)});q&&q.add(X);let Z=()=>{O?.forEach(P=>V.fire(P)),O=null},V=new be({onWillAddFirstListener(){X||(X=G(P=>V.fire(P)),q&&q.add(X))},onDidAddFirstListener(){O&&(Y?setTimeout(Z):Z())},onDidRemoveLastListener(){X&&X.dispose(),X=null}});return q&&q.add(V),V.event}e.buffer=S;function E(G,Y){return(Q,q,O)=>{let X=Y(new A);return G(function(Z){let V=X.evaluate(Z);V!==C&&Q.call(q,V)},void 0,O)}}e.chain=E;let C=Symbol("HaltChainable");class A{constructor(){this.steps=[]}map(Y){return this.steps.push(Y),this}forEach(Y){return this.steps.push(Q=>(Y(Q),Q)),this}filter(Y){return this.steps.push(Q=>Y(Q)?Q:C),this}reduce(Y,Q){let q=Q;return this.steps.push(O=>(q=Y(q,O),q)),this}latch(Y=(Q,q)=>Q===q){let Q=!0,q;return this.steps.push(O=>{let X=Q||!Y(O,q);return Q=!1,q=O,X?O:C}),this}evaluate(Y){for(let Q of this.steps)if(Y=Q(Y),Y===C)break;return Y}}function N(G,Y,Q=q=>q){let q=(...V)=>Z.fire(Q(...V)),O=()=>G.on(Y,q),X=()=>G.removeListener(Y,q),Z=new be({onWillAddFirstListener:O,onDidRemoveLastListener:X});return Z.event}e.fromNodeEventEmitter=N;function M(G,Y,Q=q=>q){let q=(...V)=>Z.fire(Q(...V)),O=()=>G.addEventListener(Y,q),X=()=>G.removeEventListener(Y,q),Z=new be({onWillAddFirstListener:O,onDidRemoveLastListener:X});return Z.event}e.fromDOMEventEmitter=M;function D(G){return new Promise(Y=>i(G)(Y))}e.toPromise=D;function U(G){let Y=new be;return G.then(Q=>{Y.fire(Q)},()=>{Y.fire(void 0)}).finally(()=>{Y.dispose()}),Y.event}e.fromPromise=U;function L(G,Y){return G(Q=>Y.fire(Q))}e.forward=L;function R(G,Y,Q){return Y(Q),G(q=>Y(q))}e.runAndSubscribe=R;class ${constructor(Y,Q){this._observable=Y,this._counter=0,this._hasChanged=!1;let q={onWillAddFirstListener:()=>{Y.addObserver(this)},onDidRemoveLastListener:()=>{Y.removeObserver(this)}};this.emitter=new be(q),Q&&Q.add(this.emitter)}beginUpdate(Y){this._counter++}handlePossibleChange(Y){}handleChange(Y,Q){this._hasChanged=!0}endUpdate(Y){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function I(G,Y){return new $(G,Y).emitter.event}e.fromObservable=I;function F(G){return(Y,Q,q)=>{let O=0,X=!1,Z={beginUpdate(){O++},endUpdate(){O--,O===0&&(G.reportChanges(),X&&(X=!1,Y.call(Q)))},handlePossibleChange(){},handleChange(){X=!0}};G.addObserver(Z),G.reportChanges();let V={dispose(){G.removeObserver(Z)}};return q instanceof Jr?q.add(V):Array.isArray(q)&&q.push(V),V}}e.fromObservableLight=F})(Ri||={});var y0=class S0{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${S0._idPool++}`,S0.all.add(this)}start(t){this._stopWatch=new Wz,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}}};y0.all=new Set,y0._idPool=0;var Yz=y0,Xz=-1,EN=class CN{constructor(t,i,s=(CN._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=i,this.name=s,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(t,i){let s=this.threshold;if(s<=0||i<s)return;this._stacks||(this._stacks=new Map);let a=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,a+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=s*.5;let[o,u]=this.getMostFrequentStack(),h=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${u}):`;console.warn(h),console.warn(o);let m=new Jz(h,o);this._errorHandler(m)}return()=>{let o=this._stacks.get(t.value)||0;this._stacks.set(t.value,o-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,i=0;for(let[s,a]of this._stacks)(!t||i<a)&&(t=[s,a],i=a);return t}};EN._idPool=1;var Zz=EN,Qz=class NN{constructor(t){this.value=t}static create(){let t=new Error;return new NN(t.stack??"")}print(){console.warn(this.value.split(`
|
|
145
|
-
`).slice(2).join(`
|
|
146
|
-
`))}},Jz=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},eI=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},tI=0,Bp=class{constructor(e){this.value=e,this.id=tI++}},iI=2,nI,be=class{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new Zz(e?.onListenerError??th,this._options?.leakWarningThreshold??Xz):void 0,this._perfMon=this._options?._profName?new Yz(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,i)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let u=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(u);let h=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],m=new eI(`${u}. HINT: Stack shows most frequent listener (${h[1]}-times)`,h[0]);return(this._options?.onListenerError||th)(m),Ye.None}if(this._disposed)return Ye.None;t&&(e=e.bind(t));let s=new Bp(e),a;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(s.stack=Qz.create(),a=this._leakageMon.check(s.stack,this._size+1)),this._listeners?this._listeners instanceof Bp?(this._deliveryQueue??=new sI,this._listeners=[this._listeners,s]):this._listeners.push(s):(this._options?.onWillAddFirstListener?.(this),this._listeners=s,this._options?.onDidAddFirstListener?.(this)),this._size++;let o=Ot(()=>{a?.(),this._removeListener(s)});return i instanceof Jr?i.add(o):Array.isArray(i)&&i.push(o),o},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,i=t.indexOf(e);if(i===-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[i]=void 0;let s=this._deliveryQueue.current===this;if(this._size*iI<=t.length){let a=0;for(let o=0;o<t.length;o++)t[o]?t[a++]=t[o]:s&&(this._deliveryQueue.end--,a<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=a}}_deliver(e,t){if(!e)return;let i=this._options?.onListenerError||th;if(!i){e.value(t);return}try{e.value(t)}catch(s){i(s)}}_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 Bp)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}},sI=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},w0=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new be,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new be,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,i){if(this.getZoomLevel(i)===t)return;let s=this.getWindowId(i);this.mapWindowIdToZoomLevel.set(s,t),this._onDidChangeZoomLevel.fire(s)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,i){this.mapWindowIdToZoomFactor.set(this.getWindowId(i),t)}setFullscreen(t,i){if(this.isFullscreen(i)===t)return;let s=this.getWindowId(i);this.mapWindowIdToFullScreen.set(s,t),this._onDidChangeFullscreen.fire(s)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};w0.INSTANCE=new w0;var iv=w0;function rI(e,t,i){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",i)}iv.INSTANCE.onDidChangeZoomLevel;function aI(e){return iv.INSTANCE.getZoomFactor(e)}iv.INSTANCE.onDidChangeFullscreen;var hl=typeof navigator=="object"?navigator.userAgent:"",k0=hl.indexOf("Firefox")>=0,oI=hl.indexOf("AppleWebKit")>=0,nv=hl.indexOf("Chrome")>=0,lI=!nv&&hl.indexOf("Safari")>=0;hl.indexOf("Electron/")>=0;hl.indexOf("Android")>=0;var zp=!1;if(typeof cr.matchMedia=="function"){let e=cr.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=cr.matchMedia("(display-mode: fullscreen)");zp=e.matches,rI(cr,e,({matches:i})=>{zp&&t.matches||(zp=i)})}var Yo="en",E0=!1,C0=!1,ih=!1,TN=!1,$d,nh=Yo,uw=Yo,cI,lr,Ha=globalThis,Tn;typeof Ha.vscode<"u"&&typeof Ha.vscode.process<"u"?Tn=Ha.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(Tn=process);var uI=typeof Tn?.versions?.electron=="string",dI=uI&&Tn?.type==="renderer";if(typeof Tn=="object"){E0=Tn.platform==="win32",C0=Tn.platform==="darwin",ih=Tn.platform==="linux",ih&&Tn.env.SNAP&&Tn.env.SNAP_REVISION,Tn.env.CI||Tn.env.BUILD_ARTIFACTSTAGINGDIRECTORY,$d=Yo,nh=Yo;let e=Tn.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);$d=t.userLocale,uw=t.osLocale,nh=t.resolvedLanguage||Yo,cI=t.languagePack?.translationsConfigFile}catch{}TN=!0}else typeof navigator=="object"&&!dI?(lr=navigator.userAgent,E0=lr.indexOf("Windows")>=0,C0=lr.indexOf("Macintosh")>=0,(lr.indexOf("Macintosh")>=0||lr.indexOf("iPad")>=0||lr.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,ih=lr.indexOf("Linux")>=0,lr?.indexOf("Mobi")>=0,nh=globalThis._VSCODE_NLS_LANGUAGE||Yo,$d=navigator.language.toLowerCase(),uw=$d):console.error("Unable to resolve platform.");var AN=E0,Es=C0,hI=ih,dw=TN,As=lr,Kr=nh,fI;(e=>{function t(){return Kr}e.value=t;function i(){return Kr.length===2?Kr==="en":Kr.length>=3?Kr[0]==="e"&&Kr[1]==="n"&&Kr[2]==="-":!1}e.isDefaultVariant=i;function s(){return Kr==="en"}e.isDefault=s})(fI||={});var mI=typeof Ha.postMessage=="function"&&!Ha.importScripts;(()=>{if(mI){let e=[];Ha.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let s=0,a=e.length;s<a;s++){let o=e[s];if(o.id===i.data.vscodeScheduleAsyncWork){e.splice(s,1),o.callback();return}}});let t=0;return i=>{let s=++t;e.push({id:s,callback:i}),Ha.postMessage({vscodeScheduleAsyncWork:s},"*")}}return e=>setTimeout(e)})();var pI=!!(As&&As.indexOf("Chrome")>=0);As&&As.indexOf("Firefox")>=0;!pI&&As&&As.indexOf("Safari")>=0;As&&As.indexOf("Edg/")>=0;As&&As.indexOf("Android")>=0;var $o=typeof navigator=="object"?navigator:{};dw||document.queryCommandSupported&&document.queryCommandSupported("copy")||$o&&$o.clipboard&&$o.clipboard.writeText,dw||$o&&$o.clipboard&&$o.clipboard.readText;var sv=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}},Ip=new sv,hw=new sv,fw=new sv,gI=new Array(230),MN;(e=>{function t(h){return Ip.keyCodeToStr(h)}e.toString=t;function i(h){return Ip.strToKeyCode(h)}e.fromString=i;function s(h){return hw.keyCodeToStr(h)}e.toUserSettingsUS=s;function a(h){return fw.keyCodeToStr(h)}e.toUserSettingsGeneral=a;function o(h){return hw.strToKeyCode(h)||fw.strToKeyCode(h)}e.fromUserSettings=o;function u(h){if(h>=98&&h<=113)return null;switch(h){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Ip.keyCodeToStr(h)}e.toElectronAccelerator=u})(MN||={});var bI=class RN{constructor(t,i,s,a,o){this.ctrlKey=t,this.shiftKey=i,this.altKey=s,this.metaKey=a,this.keyCode=o}equals(t){return t instanceof RN&&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",i=this.shiftKey?"1":"0",s=this.altKey?"1":"0",a=this.metaKey?"1":"0";return`K${t}${i}${s}${a}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new vI([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},vI=class{constructor(e){if(e.length===0)throw Fz("chords");this.chords=e}getHashCode(){let e="";for(let t=0,i=this.chords.length;t<i;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 _I(e){if(e.charCode){let i=String.fromCharCode(e.charCode).toUpperCase();return MN.fromString(i)}let t=e.keyCode;if(t===3)return 7;if(k0)switch(t){case 59:return 85;case 60:if(hI)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Es)return 57;break}else if(oI&&(Es&&t===93||!Es&&t===92))return 57;return gI[t]||0}var xI=Es?256:2048,yI=512,SI=1024,wI=Es?2048:256,mw=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=_I(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|=xI),this.altKey&&(t|=yI),this.shiftKey&&(t|=SI),this.metaKey&&(t|=wI),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new bI(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},pw=new WeakMap;function kI(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,i=e.parent.location;if(t.origin!=="null"&&i.origin!=="null"&&t.origin!==i.origin)return null}catch{return null}return e.parent}var EI=class{static getSameOriginWindowChain(e){let t=pw.get(e);if(!t){t=[],pw.set(e,t);let i=e,s;do s=kI(i),s?t.push({window:new WeakRef(i),iframeElement:i.frameElement||null}):t.push({window:new WeakRef(i),iframeElement:null}),i=s;while(i)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let i=0,s=0,a=this.getSameOriginWindowChain(e);for(let o of a){let u=o.window.deref();if(i+=u?.scrollY??0,s+=u?.scrollX??0,u===t||!o.iframeElement)break;let h=o.iframeElement.getBoundingClientRect();i+=h.top,s+=h.left}return{top:i,left:s}}},Ud=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 i=EI.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=i.left,this.posy-=i.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},gw=class{constructor(e,t=0,i=0){this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=i,this.deltaX=t;let s=!1;if(nv){let a=navigator.userAgent.match(/Chrome\/(\d+)/);s=(a?parseInt(a[1]):123)<=122}if(e){let a=e,o=e,u=e.view?.devicePixelRatio||1;if(typeof a.wheelDeltaY<"u")s?this.deltaY=a.wheelDeltaY/(120*u):this.deltaY=a.wheelDeltaY/120;else if(typeof o.VERTICAL_AXIS<"u"&&o.axis===o.VERTICAL_AXIS)this.deltaY=-o.detail/3;else if(e.type==="wheel"){let h=e;h.deltaMode===h.DOM_DELTA_LINE?k0&&!Es?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof a.wheelDeltaX<"u")lI&&AN?this.deltaX=-(a.wheelDeltaX/120):s?this.deltaX=a.wheelDeltaX/(120*u):this.deltaX=a.wheelDeltaX/120;else if(typeof o.HORIZONTAL_AXIS<"u"&&o.axis===o.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let h=e;h.deltaMode===h.DOM_DELTA_LINE?k0&&!Es?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(s?this.deltaY=e.wheelDelta/(120*u):this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}},jN=Object.freeze(function(e,t){let i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}}),CI;(e=>{function t(i){return i===e.None||i===e.Cancelled||i instanceof NI?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Ri.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:jN})})(CI||={});var NI=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?jN:(this._emitter||(this._emitter=new be),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},rv=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 v0("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new v0("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},TI=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,i=globalThis){if(this.isDisposed)throw new v0("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let s=i.setInterval(()=>{e()},t);this.disposable=Ot(()=>{i.clearInterval(s),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},AI;(e=>{async function t(s){let a,o=await Promise.all(s.map(u=>u.then(h=>h,h=>{a||(a=h)})));if(typeof a<"u")throw a;return o}e.settled=t;function i(s){return new Promise(async(a,o)=>{try{await s(a,o)}catch(u){o(u)}})}e.withAsyncBody=i})(AI||={});var bw=class Hn{static fromArray(t){return new Hn(i=>{i.emitMany(t)})}static fromPromise(t){return new Hn(async i=>{i.emitMany(await t)})}static fromPromises(t){return new Hn(async i=>{await Promise.all(t.map(async s=>i.emitOne(await s)))})}static merge(t){return new Hn(async i=>{await Promise.all(t.map(async s=>{for await(let a of s)i.emitOne(a)}))})}constructor(t,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new be,queueMicrotask(async()=>{let s={emitOne:a=>this.emitOne(a),emitMany:a=>this.emitMany(a),reject:a=>this.reject(a)};try{await Promise.resolve(t(s)),this.resolve()}catch(a){this.reject(a)}finally{s.emitOne=void 0,s.emitMany=void 0,s.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 Ri.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,i){return new Hn(async s=>{for await(let a of t)s.emitOne(i(a))})}map(t){return Hn.map(this,t)}static filter(t,i){return new Hn(async s=>{for await(let a of t)i(a)&&s.emitOne(a)})}filter(t){return Hn.filter(this,t)}static coalesce(t){return Hn.filter(t,i=>!!i)}coalesce(){return Hn.coalesce(this)}static async toPromise(t){let i=[];for await(let s of t)i.push(s);return i}toPromise(){return Hn.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())}};bw.EMPTY=bw.fromArray([]);var{getWindow:ws,getWindowId:MI,onDidRegisterWindow:RI}=(function(){let e=new Map,t={window:cr,disposables:new Jr};e.set(cr.vscodeWindowId,t);let i=new be,s=new be,a=new be;function o(u,h){return(typeof u=="number"?e.get(u):void 0)??(h?t:void 0)}return{onDidRegisterWindow:i.event,onWillUnregisterWindow:a.event,onDidUnregisterWindow:s.event,registerWindow(u){if(e.has(u.vscodeWindowId))return Ye.None;let h=new Jr,m={window:u,disposables:h.add(new Jr)};return e.set(u.vscodeWindowId,m),h.add(Ot(()=>{e.delete(u.vscodeWindowId),s.fire(u)})),h.add(Ue(u,vi.BEFORE_UNLOAD,()=>{a.fire(u)})),i.fire(m),h},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(u){return u.vscodeWindowId},hasWindow(u){return e.has(u)},getWindowById:o,getWindow(u){let h=u;if(h?.ownerDocument?.defaultView)return h.ownerDocument.defaultView.window;let m=u;return m?.view?m.view.window:cr},getDocument(u){return ws(u).document}}})(),jI=class{constructor(e,t,i,s){this._node=e,this._type=t,this._handler=i,this._options=s||!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 Ue(e,t,i,s){return new jI(e,t,i,s)}var vw=function(e,t,i,s){return Ue(e,t,i,s)},av,DI=class extends TI{constructor(e){super(),this.defaultTarget=e&&ws(e)}cancelAndSet(e,t,i){return super.cancelAndSet(e,t,i??this.defaultTarget)}},_w=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){th(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,i=new Map,s=new Map,a=o=>{i.set(o,!1);let u=e.get(o)??[];for(t.set(o,u),e.set(o,[]),s.set(o,!0);u.length>0;)u.sort(_w.sort),u.shift().execute();s.set(o,!1)};av=(o,u,h=0)=>{let m=MI(o),f=new _w(u,h),p=e.get(m);return p||(p=[],e.set(m,p)),p.push(f),i.get(m)||(i.set(m,!0),o.requestAnimationFrame(()=>a(m))),f}})();function OI(e){let t=e.getBoundingClientRect(),i=ws(e);return{left:t.left+i.scrollX,top:t.top+i.scrollY,width:t.width,height:t.height}}var vi={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"},LI=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=hn(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=hn(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=hn(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=hn(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=hn(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=hn(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=hn(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=hn(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=hn(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=hn(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=hn(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=hn(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=hn(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=hn(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 hn(e){return typeof e=="number"?`${e}px`:e}function Bc(e){return new LI(e)}var DN=class{constructor(){this._hooks=new Jr,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 i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,i,s,a){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=s,this._onStopCallback=a;let o=e;try{e.setPointerCapture(t),this._hooks.add(Ot(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{o=ws(e)}this._hooks.add(Ue(o,vi.POINTER_MOVE,u=>{if(u.buttons!==i){this.stopMonitoring(!0);return}u.preventDefault(),this._pointerMoveCallback(u)})),this._hooks.add(Ue(o,vi.POINTER_UP,u=>this.stopMonitoring(!0)))}};function BI(e,t,i){let s=null,a=null;if(typeof i.value=="function"?(s="value",a=i.value,a.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof i.get=="function"&&(s="get",a=i.get),!a)throw new Error("not supported");let o=`$memoize$${t}`;i[s]=function(...u){return this.hasOwnProperty(o)||Object.defineProperty(this,o,{configurable:!1,enumerable:!1,writable:!1,value:a.apply(this,u)}),this[o]}}var xs;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(xs||={});var kc=class Ui extends Ye{constructor(){super(),this.dispatched=!1,this.targets=new cw,this.ignoreTargets=new cw,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Ri.runAndSubscribe(RI,({window:t,disposables:i})=>{i.add(Ue(t.document,"touchstart",s=>this.onTouchStart(s),{passive:!1})),i.add(Ue(t.document,"touchend",s=>this.onTouchEnd(t,s))),i.add(Ue(t.document,"touchmove",s=>this.onTouchMove(s),{passive:!1}))},{window:cr,disposables:this._store}))}static addTarget(t){if(!Ui.isTouchDevice())return Ye.None;Ui.INSTANCE||(Ui.INSTANCE=new Ui);let i=Ui.INSTANCE.targets.push(t);return Ot(i)}static ignoreTarget(t){if(!Ui.isTouchDevice())return Ye.None;Ui.INSTANCE||(Ui.INSTANCE=new Ui);let i=Ui.INSTANCE.ignoreTargets.push(t);return Ot(i)}static isTouchDevice(){return"ontouchstart"in cr||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let i=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let s=0,a=t.targetTouches.length;s<a;s++){let o=t.targetTouches.item(s);this.activeTouches[o.identifier]={id:o.identifier,initialTarget:o.target,initialTimeStamp:i,initialPageX:o.pageX,initialPageY:o.pageY,rollingTimestamps:[i],rollingPageX:[o.pageX],rollingPageY:[o.pageY]};let u=this.newGestureEvent(xs.Start,o.target);u.pageX=o.pageX,u.pageY=o.pageY,this.dispatchEvent(u)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,i){let s=Date.now(),a=Object.keys(this.activeTouches).length;for(let o=0,u=i.changedTouches.length;o<u;o++){let h=i.changedTouches.item(o);if(!this.activeTouches.hasOwnProperty(String(h.identifier))){console.warn("move of an UNKNOWN touch",h);continue}let m=this.activeTouches[h.identifier],f=Date.now()-m.initialTimeStamp;if(f<Ui.HOLD_DELAY&&Math.abs(m.initialPageX-Cn(m.rollingPageX))<30&&Math.abs(m.initialPageY-Cn(m.rollingPageY))<30){let p=this.newGestureEvent(xs.Tap,m.initialTarget);p.pageX=Cn(m.rollingPageX),p.pageY=Cn(m.rollingPageY),this.dispatchEvent(p)}else if(f>=Ui.HOLD_DELAY&&Math.abs(m.initialPageX-Cn(m.rollingPageX))<30&&Math.abs(m.initialPageY-Cn(m.rollingPageY))<30){let p=this.newGestureEvent(xs.Contextmenu,m.initialTarget);p.pageX=Cn(m.rollingPageX),p.pageY=Cn(m.rollingPageY),this.dispatchEvent(p)}else if(a===1){let p=Cn(m.rollingPageX),b=Cn(m.rollingPageY),_=Cn(m.rollingTimestamps)-m.rollingTimestamps[0],x=p-m.rollingPageX[0],y=b-m.rollingPageY[0],S=[...this.targets].filter(E=>m.initialTarget instanceof Node&&E.contains(m.initialTarget));this.inertia(t,S,s,Math.abs(x)/_,x>0?1:-1,p,Math.abs(y)/_,y>0?1:-1,b)}this.dispatchEvent(this.newGestureEvent(xs.End,m.initialTarget)),delete this.activeTouches[h.identifier]}this.dispatched&&(i.preventDefault(),i.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,i){let s=document.createEvent("CustomEvent");return s.initEvent(t,!1,!0),s.initialTarget=i,s.tapCount=0,s}dispatchEvent(t){if(t.type===xs.Tap){let i=new Date().getTime(),s=0;i-this._lastSetTapCountTime>Ui.CLEAR_TAP_COUNT_TIME?s=1:s=2,this._lastSetTapCountTime=i,t.tapCount=s}else(t.type===xs.Change||t.type===xs.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let s of this.ignoreTargets)if(s.contains(t.initialTarget))return;let i=[];for(let s of this.targets)if(s.contains(t.initialTarget)){let a=0,o=t.initialTarget;for(;o&&o!==s;)a++,o=o.parentElement;i.push([a,s])}i.sort((s,a)=>s[0]-a[0]);for(let[s,a]of i)a.dispatchEvent(t),this.dispatched=!0}}inertia(t,i,s,a,o,u,h,m,f){this.handle=av(t,()=>{let p=Date.now(),b=p-s,_=0,x=0,y=!0;a+=Ui.SCROLL_FRICTION*b,h+=Ui.SCROLL_FRICTION*b,a>0&&(y=!1,_=o*a*b),h>0&&(y=!1,x=m*h*b);let S=this.newGestureEvent(xs.Change);S.translationX=_,S.translationY=x,i.forEach(E=>E.dispatchEvent(S)),y||this.inertia(t,i,p,a,o,u+_,h,m,f+x)})}onTouchMove(t){let i=Date.now();for(let s=0,a=t.changedTouches.length;s<a;s++){let o=t.changedTouches.item(s);if(!this.activeTouches.hasOwnProperty(String(o.identifier))){console.warn("end of an UNKNOWN touch",o);continue}let u=this.activeTouches[o.identifier],h=this.newGestureEvent(xs.Change,u.initialTarget);h.translationX=o.pageX-Cn(u.rollingPageX),h.translationY=o.pageY-Cn(u.rollingPageY),h.pageX=o.pageX,h.pageY=o.pageY,this.dispatchEvent(h),u.rollingPageX.length>3&&(u.rollingPageX.shift(),u.rollingPageY.shift(),u.rollingTimestamps.shift()),u.rollingPageX.push(o.pageX),u.rollingPageY.push(o.pageY),u.rollingTimestamps.push(i)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};kc.SCROLL_FRICTION=-.005,kc.HOLD_DELAY=700,kc.CLEAR_TAP_COUNT_TIME=400,Vt([BI],kc,"isTouchDevice",1);var zI=kc,ov=class extends Ye{onclick(e,t){this._register(Ue(e,vi.CLICK,i=>t(new Ud(ws(e),i))))}onmousedown(e,t){this._register(Ue(e,vi.MOUSE_DOWN,i=>t(new Ud(ws(e),i))))}onmouseover(e,t){this._register(Ue(e,vi.MOUSE_OVER,i=>t(new Ud(ws(e),i))))}onmouseleave(e,t){this._register(Ue(e,vi.MOUSE_LEAVE,i=>t(new Ud(ws(e),i))))}onkeydown(e,t){this._register(Ue(e,vi.KEY_DOWN,i=>t(new mw(i))))}onkeyup(e,t){this._register(Ue(e,vi.KEY_UP,i=>t(new mw(i))))}oninput(e,t){this._register(Ue(e,vi.INPUT,t))}onblur(e,t){this._register(Ue(e,vi.BLUR,t))}onfocus(e,t){this._register(Ue(e,vi.FOCUS,t))}onchange(e,t){this._register(Ue(e,vi.CHANGE,t))}ignoreGesture(e){return zI.ignoreTarget(e)}},xw=11,II=class extends ov{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=xw+"px",this.domNode.style.height=xw+"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 DN),this._register(vw(this.bgDomNode,vi.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(vw(this.domNode,vi.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new DI),this._pointerdownScheduleRepeatTimer=this._register(new rv)}_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,i=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},PI=class N0{constructor(t,i,s,a,o,u,h){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(i=i|0,s=s|0,a=a|0,o=o|0,u=u|0,h=h|0),this.rawScrollLeft=a,this.rawScrollTop=h,i<0&&(i=0),a+i>s&&(a=s-i),a<0&&(a=0),o<0&&(o=0),h+o>u&&(h=u-o),h<0&&(h=0),this.width=i,this.scrollWidth=s,this.scrollLeft=a,this.height=o,this.scrollHeight=u,this.scrollTop=h}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,i){return new N0(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,i?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,i?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new N0(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,i){let s=this.width!==t.width,a=this.scrollWidth!==t.scrollWidth,o=this.scrollLeft!==t.scrollLeft,u=this.height!==t.height,h=this.scrollHeight!==t.scrollHeight,m=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:i,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:s,scrollWidthChanged:a,scrollLeftChanged:o,heightChanged:u,scrollHeightChanged:h,scrollTopChanged:m}}},$I=class extends Ye{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new be),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new PI(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 i=this._state.withScrollDimensions(e,t);this._setState(i,!!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 i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let s;t?s=new Sw(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):s=this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=s}else{let i=this._state.withScrollPosition(e);this._smoothScrolling=Sw.start(this._state,i,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let 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 i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}},yw=class{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}};function Pp(e,t){let i=t-e;return function(s){return e+i*FI(s)}}function UI(e,t,i){return function(s){return s<i?e(s/i):t((s-i)/(1-i))}}var Sw=class T0{constructor(t,i,s,a){this.from=t,this.to=i,this.duration=a,this.startTime=s,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,i,s){if(Math.abs(t-i)>2.5*s){let a,o;return t<i?(a=t+.75*s,o=i-.75*s):(a=t-.75*s,o=i+.75*s),UI(Pp(t,a),Pp(o,i),.33)}return Pp(t,i)}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 i=(t-this.startTime)/this.duration;if(i<1){let s=this.scrollLeft(i),a=this.scrollTop(i);return new yw(s,a,!1)}return new yw(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,i,s){return T0.start(t,i,s)}static start(t,i,s){s=s+10;let a=Date.now()-10;return new T0(t,i,a,s)}};function HI(e){return Math.pow(e,3)}function FI(e){return 1-HI(1-e)}var VI=class extends Ye{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new rv)}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":"")))}},qI=140,ON=class extends ov{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 VI(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new DN),this._shouldRender=!0,this.domNode=Bc(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(Ue(this.domNode.domNode,vi.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new II(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,s){this.slider=Bc(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof i=="number"&&this.slider.setWidth(i),typeof s=="number"&&this.slider.setHeight(s),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Ue(this.slider.domNode,vi.POINTER_DOWN,a=>{a.button===0&&(a.preventDefault(),this._sliderPointerDown(a))})),this.onclick(this.slider.domNode,a=>{a.leftButton&&a.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),s=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),a=this._sliderPointerPosition(e);i<=a&&a<=s?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,i=e.offsetY;else{let a=OI(this.domNode.domNode);t=e.pageX-a.left,i=e.pageY-a.top}let s=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(s):this._scrollbarState.getDesiredScrollPositionFromOffset(s)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),i=this._sliderOrthogonalPointerPosition(e),s=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,a=>{let o=this._sliderOrthogonalPointerPosition(a),u=Math.abs(o-i);if(AN&&u>qI){this._setDesiredScrollPositionNow(s.getScrollPosition());return}let h=this._sliderPointerPosition(a)-t;this._setDesiredScrollPositionNow(s.getDesiredScrollPositionFromDelta(h))},()=>{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()}},LN=class A0{constructor(t,i,s,a,o,u){this._scrollbarSize=Math.round(i),this._oppositeScrollbarSize=Math.round(s),this._arrowSize=Math.round(t),this._visibleSize=a,this._scrollSize=o,this._scrollPosition=u,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new A0(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let i=Math.round(t);return this._visibleSize!==i?(this._visibleSize=i,this._refreshComputedValues(),!0):!1}setScrollSize(t){let i=Math.round(t);return this._scrollSize!==i?(this._scrollSize=i,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let i=Math.round(t);return this._scrollPosition!==i?(this._scrollPosition=i,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,i,s,a,o){let u=Math.max(0,s-t),h=Math.max(0,u-2*i),m=a>0&&a>s;if(!m)return{computedAvailableSize:Math.round(u),computedIsNeeded:m,computedSliderSize:Math.round(h),computedSliderRatio:0,computedSliderPosition:0};let f=Math.round(Math.max(20,Math.floor(s*h/a))),p=(h-f)/(a-s),b=o*p;return{computedAvailableSize:Math.round(u),computedIsNeeded:m,computedSliderSize:Math.round(f),computedSliderRatio:p,computedSliderPosition:Math.round(b)}}_refreshComputedValues(){let t=A0._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 i=t-this._arrowSize-this._computedSliderSize/2;return Math.round(i/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let i=t-this._arrowSize,s=this._scrollPosition;return i<this._computedSliderPosition?s-=this._visibleSize:s+=this._visibleSize,s}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let i=this._computedSliderPosition+t;return Math.round(i/this._computedSliderRatio)}},KI=class extends ON{constructor(e,t,i){let s=e.getScrollDimensions(),a=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new LN(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,s.width,s.scrollWidth,a.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},GI=class extends ON{constructor(e,t,i){let s=e.getScrollDimensions(),a=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new LN(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,s.height,s.scrollHeight,a.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},WI=500,ww=50,YI=class{constructor(e,t,i){this.timestamp=e,this.deltaX=t,this.deltaY=i,this.score=0}},M0=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,i=0,s=1,a=this._rear;do{let o=a===this._front?t:Math.pow(2,-s);if(t-=o,i+=this._memory[a].score*o,a===this._front)break;a=(this._capacity+a-1)%this._capacity,s++}while(!0);return i<=.5}acceptStandardWheelEvent(t){if(nv){let i=ws(t.browserEvent),s=aI(i);this.accept(Date.now(),t.deltaX*s,t.deltaY*s)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,i,s){let a=null,o=new YI(t,i,s);this._front===-1&&this._rear===-1?(this._memory[0]=o,this._front=0,this._rear=0):(a=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=o),o.score=this._computeScore(o,a)}_computeScore(t,i){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let s=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(s+=.25),i){let a=Math.abs(t.deltaX),o=Math.abs(t.deltaY),u=Math.abs(i.deltaX),h=Math.abs(i.deltaY),m=Math.max(Math.min(a,u),1),f=Math.max(Math.min(o,h),1),p=Math.max(a,u),b=Math.max(o,h);p%m===0&&b%f===0&&(s-=.5)}return Math.min(Math.max(s,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};M0.INSTANCE=new M0;var XI=M0,ZI=class extends ov{constructor(e,t,i){super(),this._onScroll=this._register(new be),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new be),this.onWillScroll=this._onWillScroll.event,this._options=JI(t),this._scrollable=i,this._register(this._scrollable.onScroll(a=>{this._onWillScroll.fire(a),this._onDidScroll(a),this._onScroll.fire(a)}));let s={onMouseWheel:a=>this._onMouseWheel(a),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new GI(this._scrollable,this._options,s)),this._horizontalScrollbar=this._register(new KI(this._scrollable,this._options,s)),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=Bc(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Bc(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Bc(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,a=>this._onMouseOver(a)),this.onmouseleave(this._listenOnDomNode,a=>this._onMouseLeave(a)),this._hideTimeout=this._register(new rv),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=qa(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,Es&&(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 gw(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=qa(this._mouseWheelToDispose),e)){let t=i=>{this._onMouseWheel(new gw(i))};this._mouseWheelToDispose.push(Ue(this._listenOnDomNode,vi.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=XI.INSTANCE;t.acceptStandardWheelEvent(e);let i=!1;if(e.deltaY||e.deltaX){let a=e.deltaY*this._options.mouseWheelScrollSensitivity,o=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&o+a===0?o=a=0:Math.abs(a)>=Math.abs(o)?o=0:a=0),this._options.flipAxes&&([a,o]=[o,a]);let u=!Es&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||u)&&!o&&(o=a,a=0),e.browserEvent&&e.browserEvent.altKey&&(o=o*this._options.fastScrollSensitivity,a=a*this._options.fastScrollSensitivity);let h=this._scrollable.getFutureScrollPosition(),m={};if(a){let f=ww*a,p=h.scrollTop-(f<0?Math.floor(f):Math.ceil(f));this._verticalScrollbar.writeScrollPosition(m,p)}if(o){let f=ww*o,p=h.scrollLeft-(f<0?Math.floor(f):Math.ceil(f));this._horizontalScrollbar.writeScrollPosition(m,p)}m=this._scrollable.validateScrollPosition(m),(h.scrollLeft!==m.scrollLeft||h.scrollTop!==m.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(m):this._scrollable.setScrollPositionNow(m),i=!0)}let s=i;!s&&this._options.alwaysConsumeMouseWheel&&(s=!0),!s&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(s=!0),s&&(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,i=e.scrollLeft>0,s=i?" left":"",a=t?" top":"",o=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${s}`),this._topShadowDomNode.setClassName(`shadow${a}`),this._topLeftShadowDomNode.setClassName(`shadow${o}${a}${s}`)}}_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(),WI)}},QI=class extends ZI{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function JI(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,Es&&(t.className+=" mac"),t}var R0=class extends Ye{constructor(e,t,i,s,a,o,u,h){super(),this._bufferService=i,this._optionsService=u,this._renderService=h,this._onRequestScrollLines=this._register(new be),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let m=this._register(new $I({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:f=>av(s.window,f)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{m.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new QI(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},m)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(a.onProtocolChange(f=>{this._scrollableElement.updateOptions({handleMouseWheel:!(f&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(Ri.runAndSubscribe(o.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=o.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(Ot(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=s.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(Ot(()=>this._styleElement.remove())),this._register(Ri.runAndSubscribe(o.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${o.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${o.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${o.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
|
|
147
|
-
`)})),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(f=>this._handleScroll(f)))}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),i=t-this._bufferService.buffer.ydisp;i!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(i)),this._isHandlingScroll=!1}};R0=Vt([Se(2,en),Se(3,hr),Se(4,pN),Se(5,dl),Se(6,tn),Se(7,fr)],R0);var j0=class extends Ye{constructor(e,t,i,s,a){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=i,this._decorationService=s,this._renderService=a,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(o=>this._removeDecoration(o))),this._register(Ot(()=>{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 i=e.options.x??0;return i&&i>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 i=this._decorationElements.get(e);i||(i=this._createElement(e),e.element=i,this._decorationElements.set(e,i),this._container.appendChild(i),e.onDispose(()=>{this._decorationElements.delete(e),i.remove()})),i.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(i.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,i.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,i.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,i.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(i)}}_refreshXPosition(e,t=e.element){if(!t)return;let i=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=i?`${i*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=i?`${i*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};j0=Vt([Se(1,en),Se(2,hr),Se(3,lu),Se(4,fr)],j0);var eP=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,i){return t>=e.startBufferLine-this._linePadding[i||"full"]&&t<=e.endBufferLine+this._linePadding[i||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},bs={full:0,left:0,center:0,right:0},Gr={full:0,left:0,center:0,right:0},fc={full:0,left:0,center:0,right:0},Ah=class extends Ye{constructor(e,t,i,s,a,o,u,h){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=i,this._decorationService=s,this._renderService=a,this._optionsService=o,this._themeService=u,this._coreBrowserService=h,this._colorZoneStore=new eP,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(Ot(()=>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);Gr.full=this._canvas.width,Gr.left=e,Gr.center=t,Gr.right=e,this._refreshDrawHeightConstants(),fc.full=1,fc.left=1,fc.center=1+Gr.left,fc.right=1+Gr.left+Gr.center}_refreshDrawHeightConstants(){bs.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);bs.left=t,bs.center=t,bs.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*bs.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*bs.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*bs.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*bs.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(fc[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-bs[e.position||"full"]/2),Gr[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+bs[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}))}};Ah=Vt([Se(2,en),Se(3,lu),Se(4,fr),Se(5,tn),Se(6,dl),Se(7,hr)],Ah);var ce;(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=`
|
|
148
|
-
`,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=""))(ce||={});var sh;(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=""))(sh||={});var BN;(e=>e.ST=`${ce.ESC}\\`)(BN||={});var D0=class{constructor(e,t,i,s,a,o){this._textarea=e,this._compositionView=t,this._bufferService=i,this._optionsService=s,this._coreService=a,this._renderService=o,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 i;t.start+=this._dataAlreadySent.length,this._isComposing?i=this._textarea.value.substring(t.start,this._compositionPosition.start):i=this._textarea.value.substring(t.start),i.length>0&&this._coreService.triggerDataEvent(i,!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,i=t.replace(e,"");this._dataAlreadySent=i,t.length>e.length?this._coreService.triggerDataEvent(i,!0):t.length<e.length?this._coreService.triggerDataEvent(`${ce.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),i=this._renderService.dimensions.css.cell.height,s=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,a=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=a+"px",this._compositionView.style.top=s+"px",this._compositionView.style.height=i+"px",this._compositionView.style.lineHeight=i+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let o=this._compositionView.getBoundingClientRect();this._textarea.style.left=a+"px",this._textarea.style.top=s+"px",this._textarea.style.width=Math.max(o.width,1)+"px",this._textarea.style.height=Math.max(o.height,1)+"px",this._textarea.style.lineHeight=o.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};D0=Vt([Se(2,en),Se(3,tn),Se(4,Za),Se(5,fr)],D0);var _i=0,xi=0,yi=0,Ft=0,kw={css:"#00000000",rgba:0},ai;(e=>{function t(a,o,u,h){return h!==void 0?`#${Ma(a)}${Ma(o)}${Ma(u)}${Ma(h)}`:`#${Ma(a)}${Ma(o)}${Ma(u)}`}e.toCss=t;function i(a,o,u,h=255){return(a<<24|o<<16|u<<8|h)>>>0}e.toRgba=i;function s(a,o,u,h){return{css:e.toCss(a,o,u,h),rgba:e.toRgba(a,o,u,h)}}e.toColor=s})(ai||={});var Mt;(e=>{function t(m,f){if(Ft=(f.rgba&255)/255,Ft===1)return{css:f.css,rgba:f.rgba};let p=f.rgba>>24&255,b=f.rgba>>16&255,_=f.rgba>>8&255,x=m.rgba>>24&255,y=m.rgba>>16&255,S=m.rgba>>8&255;_i=x+Math.round((p-x)*Ft),xi=y+Math.round((b-y)*Ft),yi=S+Math.round((_-S)*Ft);let E=ai.toCss(_i,xi,yi),C=ai.toRgba(_i,xi,yi);return{css:E,rgba:C}}e.blend=t;function i(m){return(m.rgba&255)===255}e.isOpaque=i;function s(m,f,p){let b=rh.ensureContrastRatio(m.rgba,f.rgba,p);if(b)return ai.toColor(b>>24&255,b>>16&255,b>>8&255)}e.ensureContrastRatio=s;function a(m){let f=(m.rgba|255)>>>0;return[_i,xi,yi]=rh.toChannels(f),{css:ai.toCss(_i,xi,yi),rgba:f}}e.opaque=a;function o(m,f){return Ft=Math.round(f*255),[_i,xi,yi]=rh.toChannels(m.rgba),{css:ai.toCss(_i,xi,yi,Ft),rgba:ai.toRgba(_i,xi,yi,Ft)}}e.opacity=o;function u(m,f){return Ft=m.rgba&255,o(m,Ft*f/255)}e.multiplyOpacity=u;function h(m){return[m.rgba>>24&255,m.rgba>>16&255,m.rgba>>8&255]}e.toColorRGB=h})(Mt||={});var Pt;(e=>{let t,i;try{let a=document.createElement("canvas");a.width=1,a.height=1;let o=a.getContext("2d",{willReadFrequently:!0});o&&(t=o,t.globalCompositeOperation="copy",i=t.createLinearGradient(0,0,1,1))}catch{}function s(a){if(a.match(/#[\da-f]{3,8}/i))switch(a.length){case 4:return _i=parseInt(a.slice(1,2).repeat(2),16),xi=parseInt(a.slice(2,3).repeat(2),16),yi=parseInt(a.slice(3,4).repeat(2),16),ai.toColor(_i,xi,yi);case 5:return _i=parseInt(a.slice(1,2).repeat(2),16),xi=parseInt(a.slice(2,3).repeat(2),16),yi=parseInt(a.slice(3,4).repeat(2),16),Ft=parseInt(a.slice(4,5).repeat(2),16),ai.toColor(_i,xi,yi,Ft);case 7:return{css:a,rgba:(parseInt(a.slice(1),16)<<8|255)>>>0};case 9:return{css:a,rgba:parseInt(a.slice(1),16)>>>0}}let o=a.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(o)return _i=parseInt(o[1]),xi=parseInt(o[2]),yi=parseInt(o[3]),Ft=Math.round((o[5]===void 0?1:parseFloat(o[5]))*255),ai.toColor(_i,xi,yi,Ft);if(!t||!i)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=i,t.fillStyle=a,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[_i,xi,yi,Ft]=t.getImageData(0,0,1,1).data,Ft!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:ai.toRgba(_i,xi,yi,Ft),css:a}}e.toColor=s})(Pt||={});var Yi;(e=>{function t(s){return i(s>>16&255,s>>8&255,s&255)}e.relativeLuminance=t;function i(s,a,o){let u=s/255,h=a/255,m=o/255,f=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4),p=h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4),b=m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4);return f*.2126+p*.7152+b*.0722}e.relativeLuminance2=i})(Yi||={});var rh;(e=>{function t(u,h){if(Ft=(h&255)/255,Ft===1)return h;let m=h>>24&255,f=h>>16&255,p=h>>8&255,b=u>>24&255,_=u>>16&255,x=u>>8&255;return _i=b+Math.round((m-b)*Ft),xi=_+Math.round((f-_)*Ft),yi=x+Math.round((p-x)*Ft),ai.toRgba(_i,xi,yi)}e.blend=t;function i(u,h,m){let f=Yi.relativeLuminance(u>>8),p=Yi.relativeLuminance(h>>8);if(or(f,p)<m){if(p<f){let x=s(u,h,m),y=or(f,Yi.relativeLuminance(x>>8));if(y<m){let S=a(u,h,m),E=or(f,Yi.relativeLuminance(S>>8));return y>E?x:S}return x}let b=a(u,h,m),_=or(f,Yi.relativeLuminance(b>>8));if(_<m){let x=s(u,h,m),y=or(f,Yi.relativeLuminance(x>>8));return _>y?b:x}return b}}e.ensureContrastRatio=i;function s(u,h,m){let f=u>>24&255,p=u>>16&255,b=u>>8&255,_=h>>24&255,x=h>>16&255,y=h>>8&255,S=or(Yi.relativeLuminance2(_,x,y),Yi.relativeLuminance2(f,p,b));for(;S<m&&(_>0||x>0||y>0);)_-=Math.max(0,Math.ceil(_*.1)),x-=Math.max(0,Math.ceil(x*.1)),y-=Math.max(0,Math.ceil(y*.1)),S=or(Yi.relativeLuminance2(_,x,y),Yi.relativeLuminance2(f,p,b));return(_<<24|x<<16|y<<8|255)>>>0}e.reduceLuminance=s;function a(u,h,m){let f=u>>24&255,p=u>>16&255,b=u>>8&255,_=h>>24&255,x=h>>16&255,y=h>>8&255,S=or(Yi.relativeLuminance2(_,x,y),Yi.relativeLuminance2(f,p,b));for(;S<m&&(_<255||x<255||y<255);)_=Math.min(255,_+Math.ceil((255-_)*.1)),x=Math.min(255,x+Math.ceil((255-x)*.1)),y=Math.min(255,y+Math.ceil((255-y)*.1)),S=or(Yi.relativeLuminance2(_,x,y),Yi.relativeLuminance2(f,p,b));return(_<<24|x<<16|y<<8|255)>>>0}e.increaseLuminance=a;function o(u){return[u>>24&255,u>>16&255,u>>8&255,u&255]}e.toChannels=o})(rh||={});function Ma(e){let t=e.toString(16);return t.length<2?"0"+t:t}function or(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var tP=class extends ou{constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=i}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()]}},Mh=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new Gn}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 i=[],s=t.translateToString(!0),a=0,o=0,u=0,h=t.getFg(0),m=t.getBg(0);for(let f=0;f<t.getTrimmedLength();f++)if(t.loadCell(f,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==h||this._workCell.bg!==m){if(f-a>1){let p=this._getJoinedRanges(s,u,o,t,a);for(let b=0;b<p.length;b++)i.push(p[b])}a=f,u=o,h=this._workCell.fg,m=this._workCell.bg}o+=this._workCell.getChars().length||Qr.length}if(this._bufferService.cols-a>1){let f=this._getJoinedRanges(s,u,o,t,a);for(let p=0;p<f.length;p++)i.push(f[p])}return i}_getJoinedRanges(e,t,i,s,a){let o=e.substring(t,i),u=[];try{u=this._characterJoiners[0].handler(o)}catch(h){console.error(h)}for(let h=1;h<this._characterJoiners.length;h++)try{let m=this._characterJoiners[h].handler(o);for(let f=0;f<m.length;f++)Mh._mergeRanges(u,m[f])}catch(m){console.error(m)}return this._stringRangesToCellRanges(u,s,a),u}_stringRangesToCellRanges(e,t,i){let s=0,a=!1,o=0,u=e[s];if(u){for(let h=i;h<this._bufferService.cols;h++){let m=t.getWidth(h),f=t.getString(h).length||Qr.length;if(m!==0){if(!a&&u[0]<=o&&(u[0]=h,a=!0),u[1]<=o){if(u[1]=h,u=e[++s],!u)break;u[0]<=o?(u[0]=h,a=!0):a=!1}o+=f}}u&&(u[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let i=!1;for(let s=0;s<e.length;s++){let a=e[s];if(i){if(t[1]<=a[0])return e[s-1][1]=t[1],e;if(t[1]<=a[1])return e[s-1][1]=Math.max(t[1],a[1]),e.splice(s,1),e;e.splice(s,1),s--}else{if(t[1]<=a[0])return e.splice(s,0,t),e;if(t[1]<=a[1])return a[0]=Math.min(t[0],a[0]),e;t[0]<a[1]&&(a[0]=Math.min(t[0],a[0]),i=!0);continue}}return i?e[e.length-1][1]=t[1]:e.push(t),e}};Mh=Vt([Se(0,en)],Mh);function iP(e){return 57508<=e&&e<=57558}function nP(e){return 9472<=e&&e<=9631}function sP(e){return iP(e)||nP(e)}function rP(){return{css:{canvas:Hd(),cell:Hd()},device:{canvas:Hd(),cell:Hd(),char:{width:0,height:0,left:0,top:0}}}}function Hd(){return{width:0,height:0}}var O0=class{constructor(e,t,i,s,a,o,u){this._document=e,this._characterJoinerService=t,this._optionsService=i,this._coreBrowserService=s,this._coreService=a,this._decorationService=o,this._themeService=u,this._workCell=new Gn,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,i){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=i}createRow(e,t,i,s,a,o,u,h,m,f,p){let b=[],_=this._characterJoinerService.getJoinedCharacters(t),x=this._themeService.colors,y=e.getNoBgTrimmedLength();i&&y<o+1&&(y=o+1);let S,E=0,C="",A=0,N=0,M=0,D=0,U=!1,L=0,R=!1,$=0,I=0,F=[],G=f!==-1&&p!==-1;for(let Y=0;Y<y;Y++){e.loadCell(Y,this._workCell);let Q=this._workCell.getWidth();if(Q===0)continue;let q=!1,O=Y>=I,X=Y,Z=this._workCell;if(_.length>0&&Y===_[0][0]&&O){let Be=_.shift(),Lt=this._isCellInSelection(Be[0],t);for(A=Be[0]+1;A<Be[1];A++)O&&=Lt===this._isCellInSelection(A,t);O&&=!i||o<Be[0]||o>=Be[1],O?(q=!0,Z=new tP(this._workCell,e.translateToString(!0,Be[0],Be[1]),Be[1]-Be[0]),X=Be[1]-1,Q=Z.getWidth()):I=Be[1]}let V=this._isCellInSelection(Y,t),P=i&&Y===o,j=G&&Y>=f&&Y<=p,W=!1;this._decorationService.forEachDecorationAtCell(Y,t,void 0,Be=>{W=!0});let he=Z.getChars()||Qr;if(he===" "&&(Z.isUnderline()||Z.isOverline())&&(he=" "),$=Q*h-m.get(he,Z.isBold(),Z.isItalic()),!S)S=this._document.createElement("span");else if(E&&(V&&R||!V&&!R&&Z.bg===N)&&(V&&R&&x.selectionForeground||Z.fg===M)&&Z.extended.ext===D&&j===U&&$===L&&!P&&!q&&!W&&O){Z.isInvisible()?C+=Qr:C+=he,E++;continue}else E&&(S.textContent=C),S=this._document.createElement("span"),E=0,C="";if(N=Z.bg,M=Z.fg,D=Z.extended.ext,U=j,L=$,R=V,q&&o>=Y&&o<=X&&(o=Y),!this._coreService.isCursorHidden&&P&&this._coreService.isCursorInitialized){if(F.push("xterm-cursor"),this._coreBrowserService.isFocused)u&&F.push("xterm-cursor-blink"),F.push(s==="bar"?"xterm-cursor-bar":s==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(a)switch(a){case"outline":F.push("xterm-cursor-outline");break;case"block":F.push("xterm-cursor-block");break;case"bar":F.push("xterm-cursor-bar");break;case"underline":F.push("xterm-cursor-underline");break}}if(Z.isBold()&&F.push("xterm-bold"),Z.isItalic()&&F.push("xterm-italic"),Z.isDim()&&F.push("xterm-dim"),Z.isInvisible()?C=Qr:C=Z.getChars()||Qr,Z.isUnderline()&&(F.push(`xterm-underline-${Z.extended.underlineStyle}`),C===" "&&(C=" "),!Z.isUnderlineColorDefault()))if(Z.isUnderlineColorRGB())S.style.textDecorationColor=`rgb(${ou.toColorRGB(Z.getUnderlineColor()).join(",")})`;else{let Be=Z.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Z.isBold()&&Be<8&&(Be+=8),S.style.textDecorationColor=x.ansi[Be].css}Z.isOverline()&&(F.push("xterm-overline"),C===" "&&(C=" ")),Z.isStrikethrough()&&F.push("xterm-strikethrough"),j&&(S.style.textDecoration="underline");let oe=Z.getFgColor(),me=Z.getFgColorMode(),ne=Z.getBgColor(),fe=Z.getBgColorMode(),we=!!Z.isInverse();if(we){let Be=oe;oe=ne,ne=Be;let Lt=me;me=fe,fe=Lt}let ye,Ze,ot=!1;this._decorationService.forEachDecorationAtCell(Y,t,void 0,Be=>{Be.options.layer!=="top"&&ot||(Be.backgroundColorRGB&&(fe=50331648,ne=Be.backgroundColorRGB.rgba>>8&16777215,ye=Be.backgroundColorRGB),Be.foregroundColorRGB&&(me=50331648,oe=Be.foregroundColorRGB.rgba>>8&16777215,Ze=Be.foregroundColorRGB),ot=Be.options.layer==="top")}),!ot&&V&&(ye=this._coreBrowserService.isFocused?x.selectionBackgroundOpaque:x.selectionInactiveBackgroundOpaque,ne=ye.rgba>>8&16777215,fe=50331648,ot=!0,x.selectionForeground&&(me=50331648,oe=x.selectionForeground.rgba>>8&16777215,Ze=x.selectionForeground)),ot&&F.push("xterm-decoration-top");let lt;switch(fe){case 16777216:case 33554432:lt=x.ansi[ne],F.push(`xterm-bg-${ne}`);break;case 50331648:lt=ai.toColor(ne>>16,ne>>8&255,ne&255),this._addStyle(S,`background-color:#${Ew((ne>>>0).toString(16),"0",6)}`);break;default:we?(lt=x.foreground,F.push("xterm-bg-257")):lt=x.background}switch(ye||Z.isDim()&&(ye=Mt.multiplyOpacity(lt,.5)),me){case 16777216:case 33554432:Z.isBold()&&oe<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(oe+=8),this._applyMinimumContrast(S,lt,x.ansi[oe],Z,ye,void 0)||F.push(`xterm-fg-${oe}`);break;case 50331648:let Be=ai.toColor(oe>>16&255,oe>>8&255,oe&255);this._applyMinimumContrast(S,lt,Be,Z,ye,Ze)||this._addStyle(S,`color:#${Ew(oe.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(S,lt,x.foreground,Z,ye,Ze)||we&&F.push("xterm-fg-257")}F.length&&(S.className=F.join(" "),F.length=0),!P&&!q&&!W&&O?E++:S.textContent=C,$!==this.defaultSpacing&&(S.style.letterSpacing=`${$}px`),b.push(S),Y=X}return S&&E&&(S.textContent=C),b}_applyMinimumContrast(e,t,i,s,a,o){if(this._optionsService.rawOptions.minimumContrastRatio===1||sP(s.getCode()))return!1;let u=this._getContrastCache(s),h;if(!a&&!o&&(h=u.getColor(t.rgba,i.rgba)),h===void 0){let m=this._optionsService.rawOptions.minimumContrastRatio/(s.isDim()?2:1);h=Mt.ensureContrastRatio(a||t,o||i,m),u.setColor((a||t).rgba,(o||i).rgba,h??null)}return h?(this._addStyle(e,`color:${h.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 i=this._selectionStart,s=this._selectionEnd;return!i||!s?!1:this._columnSelectMode?i[0]<=s[0]?e>=i[0]&&t>=i[1]&&e<s[0]&&t<=s[1]:e<i[0]&&t>=i[1]&&e>=s[0]&&t<=s[1]:t>i[1]&&t<s[1]||i[1]===s[1]&&t===i[1]&&e>=i[0]&&e<s[0]||i[1]<s[1]&&t===s[1]&&e<s[0]||i[1]<s[1]&&t===i[1]&&e>=i[0]}};O0=Vt([Se(1,vN),Se(2,tn),Se(3,hr),Se(4,Za),Se(5,lu),Se(6,dl)],O0);function Ew(e,t,i){for(;e.length<i;)e=t+e;return e}var aP=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 i=e.createElement("span");i.classList.add("xterm-char-measure-element");let s=e.createElement("span");s.classList.add("xterm-char-measure-element"),s.style.fontWeight="bold";let a=e.createElement("span");a.classList.add("xterm-char-measure-element"),a.style.fontStyle="italic";let o=e.createElement("span");o.classList.add("xterm-char-measure-element"),o.style.fontWeight="bold",o.style.fontStyle="italic",this._measureElements=[i,s,a,o],this._container.appendChild(i),this._container.appendChild(s),this._container.appendChild(a),this._container.appendChild(o),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,i,s){e===this._font&&t===this._fontSize&&i===this._weight&&s===this._weightBold||(this._font=e,this._fontSize=t,this._weight=i,this._weightBold=s,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${i}`,this._measureElements[1].style.fontWeight=`${s}`,this._measureElements[2].style.fontWeight=`${i}`,this._measureElements[3].style.fontWeight=`${s}`,this.clear())}get(e,t,i){let s=0;if(!t&&!i&&e.length===1&&(s=e.charCodeAt(0))<256){if(this._flat[s]!==-9999)return this._flat[s];let u=this._measure(e,0);return u>0&&(this._flat[s]=u),u}let a=e;t&&(a+="B"),i&&(a+="I");let o=this._holey.get(a);if(o===void 0){let u=0;t&&(u|=1),i&&(u|=2),o=this._measure(e,u),o>0&&this._holey.set(a,o)}return o}_measure(e,t){let i=this._measureElements[t];return i.textContent=e.repeat(32),i.offsetWidth/32}},oP=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,i,s=!1){if(this.selectionStart=t,this.selectionEnd=i,!t||!i||t[0]===i[0]&&t[1]===i[1]){this.clear();return}let a=e.buffers.active.ydisp,o=t[1]-a,u=i[1]-a,h=Math.max(o,0),m=Math.min(u,e.rows-1);if(h>=e.rows||m<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=s,this.viewportStartRow=o,this.viewportEndRow=u,this.viewportCappedStartRow=h,this.viewportCappedEndRow=m,this.startCol=t[0],this.endCol=i[0]}isCellSelected(e,t,i){return this.hasSelection?(i-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&i>=this.viewportCappedStartRow&&t<this.endCol&&i<=this.viewportCappedEndRow:t<this.startCol&&i>=this.viewportCappedStartRow&&t>=this.endCol&&i<=this.viewportCappedEndRow:i>this.viewportStartRow&&i<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&i===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportStartRow&&t>=this.startCol):!1}};function lP(){return new oP}var $p="xterm-dom-renderer-owner-",$n="xterm-rows",Fd="xterm-fg-",Cw="xterm-bg-",mc="xterm-focus",Vd="xterm-selection",cP=1,L0=class extends Ye{constructor(e,t,i,s,a,o,u,h,m,f,p,b,_,x){super(),this._terminal=e,this._document=t,this._element=i,this._screenElement=s,this._viewportElement=a,this._helperContainer=o,this._linkifier2=u,this._charSizeService=m,this._optionsService=f,this._bufferService=p,this._coreService=b,this._coreBrowserService=_,this._themeService=x,this._terminalClass=cP++,this._rowElements=[],this._selectionRenderModel=lP(),this.onRequestRedraw=this._register(new be).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add($n),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(Vd),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=rP(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(y=>this._injectCss(y))),this._injectCss(this._themeService.colors),this._rowFactory=h.createInstance(O0,document),this._element.classList.add($p+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(y=>this._handleLinkHover(y))),this._register(this._linkifier2.onHideLinkUnderline(y=>this._handleLinkLeave(y))),this._register(Ot(()=>{this._element.classList.remove($p+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new aP(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 i of this._rowElements)i.style.width=`${this.dimensions.css.canvas.width}px`,i.style.height=`${this.dimensions.css.cell.height}px`,i.style.lineHeight=`${this.dimensions.css.cell.height}px`,i.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${$n} 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} .${$n} { 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} .${$n} .xterm-dim { color: ${Mt.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 i=`blink_underline_${this._terminalClass}`,s=`blink_bar_${this._terminalClass}`,a=`blink_block_${this._terminalClass}`;t+=`@keyframes ${i} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${s} { 50% { box-shadow: none; }}`,t+=`@keyframes ${a} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${$n}.${mc} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${$n}.${mc} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${$n}.${mc} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${a} 1s step-end infinite;}${this._terminalSelector} .${$n} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${$n} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${$n} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${$n} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${$n} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${Vd} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Vd} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Vd} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[o,u]of e.ansi.entries())t+=`${this._terminalSelector} .${Fd}${o} { color: ${u.css}; }${this._terminalSelector} .${Fd}${o}.xterm-dim { color: ${Mt.multiplyOpacity(u,.5).css}; }${this._terminalSelector} .${Cw}${o} { background-color: ${u.css}; }`;t+=`${this._terminalSelector} .${Fd}257 { color: ${Mt.opaque(e.background).css}; }${this._terminalSelector} .${Fd}257.xterm-dim { color: ${Mt.multiplyOpacity(Mt.opaque(e.background),.5).css}; }${this._terminalSelector} .${Cw}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 i=this._rowElements.length;i<=t;i++){let s=this._document.createElement("div");this._rowContainer.appendChild(s),this._rowElements.push(s)}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(mc),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(mc),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,i){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,i),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,i),!this._selectionRenderModel.hasSelection))return;let s=this._selectionRenderModel.viewportStartRow,a=this._selectionRenderModel.viewportEndRow,o=this._selectionRenderModel.viewportCappedStartRow,u=this._selectionRenderModel.viewportCappedEndRow,h=this._document.createDocumentFragment();if(i){let m=e[0]>t[0];h.appendChild(this._createSelectionElement(o,m?t[0]:e[0],m?e[0]:t[0],u-o+1))}else{let m=s===o?e[0]:0,f=o===a?t[0]:this._bufferService.cols;h.appendChild(this._createSelectionElement(o,m,f));let p=u-o-1;if(h.appendChild(this._createSelectionElement(o+1,0,this._bufferService.cols,p)),o!==u){let b=a===u?t[0]:this._bufferService.cols;h.appendChild(this._createSelectionElement(u,0,b))}}this._selectionContainer.appendChild(h)}_createSelectionElement(e,t,i,s=1){let a=this._document.createElement("div"),o=t*this.dimensions.css.cell.width,u=this.dimensions.css.cell.width*(i-t);return o+u>this.dimensions.css.canvas.width&&(u=this.dimensions.css.canvas.width-o),a.style.height=`${s*this.dimensions.css.cell.height}px`,a.style.top=`${e*this.dimensions.css.cell.height}px`,a.style.left=`${o}px`,a.style.width=`${u}px`,a}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let i=this._bufferService.buffer,s=i.ybase+i.y,a=Math.min(i.x,this._bufferService.cols-1),o=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,u=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,h=this._optionsService.rawOptions.cursorInactiveStyle;for(let m=e;m<=t;m++){let f=m+i.ydisp,p=this._rowElements[m],b=i.lines.get(f);if(!p||!b)break;p.replaceChildren(...this._rowFactory.createRow(b,f,f===s,u,h,a,o,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${$p}${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,i,s,a,o){i<0&&(e=0),s<0&&(t=0);let u=this._bufferService.rows-1;i=Math.max(Math.min(i,u),0),s=Math.max(Math.min(s,u),0),a=Math.min(a,this._bufferService.cols);let h=this._bufferService.buffer,m=h.ybase+h.y,f=Math.min(h.x,a-1),p=this._optionsService.rawOptions.cursorBlink,b=this._optionsService.rawOptions.cursorStyle,_=this._optionsService.rawOptions.cursorInactiveStyle;for(let x=i;x<=s;++x){let y=x+h.ydisp,S=this._rowElements[x],E=h.lines.get(y);if(!S||!E)break;S.replaceChildren(...this._rowFactory.createRow(E,y,y===m,b,_,f,p,this.dimensions.css.cell.width,this._widthCache,o?x===i?e:0:-1,o?(x===s?t:a)-1:-1))}}};L0=Vt([Se(7,ev),Se(8,Qh),Se(9,tn),Se(10,en),Se(11,Za),Se(12,hr),Se(13,dl)],L0);var B0=class extends Ye{constructor(e,t,i){super(),this._optionsService=i,this.width=0,this.height=0,this._onCharSizeChange=this._register(new be),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new dP(this._optionsService))}catch{this._measureStrategy=this._register(new uP(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())}};B0=Vt([Se(2,tn)],B0);var zN=class extends Ye{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)}},uP=class extends zN{constructor(e,t,i){super(),this._document=e,this._parentElement=t,this._optionsService=i,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},dP=class extends zN{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}},hP=class extends Ye{constructor(e,t,i){super(),this._textarea=e,this._window=t,this.mainDocument=i,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new fP(this._window)),this._onDprChange=this._register(new be),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new be),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(s=>this._screenDprMonitor.setWindow(s))),this._register(Ri.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Ue(this._textarea,"focus",()=>this._isFocused=!0)),this._register(Ue(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}},fP=class extends Ye{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new il),this._onDprChange=this._register(new be),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(Ot(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Ue(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)}},mP=class extends Ye{constructor(){super(),this.linkProviders=[],this._register(Ot(()=>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 lv(e,t,i){let s=i.getBoundingClientRect(),a=e.getComputedStyle(i),o=parseInt(a.getPropertyValue("padding-left")),u=parseInt(a.getPropertyValue("padding-top"));return[t.clientX-s.left-o,t.clientY-s.top-u]}function pP(e,t,i,s,a,o,u,h,m){if(!o)return;let f=lv(e,t,i);if(f)return f[0]=Math.ceil((f[0]+(m?u/2:0))/u),f[1]=Math.ceil(f[1]/h),f[0]=Math.min(Math.max(f[0],1),s+(m?1:0)),f[1]=Math.min(Math.max(f[1],1),a),f}var z0=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,i,s,a){return pP(window,e,t,i,s,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,a)}getMouseReportCoords(e,t){let i=lv(window,e,t);if(this._charSizeService.hasValidSize)return i[0]=Math.min(Math.max(i[0],0),this._renderService.dimensions.css.canvas.width-1),i[1]=Math.min(Math.max(i[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(i[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(i[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(i[0]),y:Math.floor(i[1])}}};z0=Vt([Se(0,fr),Se(1,Qh)],z0);var gP=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,i){this._rowCount=i,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=[]}},IN={};Cz(IN,{getSafariVersion:()=>vP,isChromeOS:()=>HN,isFirefox:()=>PN,isIpad:()=>_P,isIphone:()=>xP,isLegacyEdge:()=>bP,isLinux:()=>cv,isMac:()=>Rh,isNode:()=>Jh,isSafari:()=>$N,isWindows:()=>UN});var Jh=typeof process<"u"&&"title"in process,cu=Jh?"node":navigator.userAgent,uu=Jh?"node":navigator.platform,PN=cu.includes("Firefox"),bP=cu.includes("Edge"),$N=/^((?!chrome|android).)*safari/i.test(cu);function vP(){if(!$N)return 0;let e=cu.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var Rh=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(uu),_P=uu==="iPad",xP=uu==="iPhone",UN=["Windows","Win16","Win32","WinCE"].includes(uu),cv=uu.indexOf("Linux")>=0,HN=/\bCrOS\b/.test(cu),FN=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,i=0,s=e.timeRemaining(),a=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),i=Math.max(t,i),a=e.timeRemaining(),i*1.5>a){s-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(s-t))}ms`),this._start();return}s=a}this.clear()}},yP=class extends FN{_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())}}},SP=class extends FN{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},jh=!Jh&&"requestIdleCallback"in window?SP:yP,wP=class{constructor(){this._queue=new jh}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},I0=class extends Ye{constructor(e,t,i,s,a,o,u,h,m){super(),this._rowCount=e,this._optionsService=i,this._charSizeService=s,this._coreService=a,this._coreBrowserService=h,this._renderer=this._register(new il),this._pausedResizeTask=new wP,this._observerDisposable=this._register(new il),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 be),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new be),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new be),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new be),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new gP((f,p)=>this._renderRows(f,p),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new kP(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(Ot(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(u.onResize(()=>this._fullRefresh())),this._register(u.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(o.onDecorationRegistered(()=>this._fullRefresh())),this._register(o.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(u.cols,u.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(u.buffer.y,u.buffer.y,!0))),this._register(m.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(f=>this._registerIntersectionObserver(f,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let i=new e.IntersectionObserver(s=>this._handleIntersectionChange(s[s.length-1]),{threshold:0});i.observe(t),this._observerDisposable.value=Ot(()=>i.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,i=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let s=this._syncOutputHandler.flush();s&&(e=Math.min(e,s.start),t=Math.max(t,s.end)),i||(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,i){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=i,this._renderer.value?.handleSelectionChanged(e,t,i)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};I0=Vt([Se(2,tn),Se(3,Qh),Se(4,Za),Se(5,lu),Se(6,en),Se(7,hr),Se(8,dl)],I0);var kP=class{constructor(e,t,i){this._coreBrowserService=e,this._coreService=t,this._onTimeout=i,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 EP(e,t,i,s){let a=i.buffer.x,o=i.buffer.y;if(!i.buffer.hasScrollback)return TP(a,o,e,t,i,s)+ef(o,t,i,s)+AP(a,o,e,t,i,s);let u;if(o===t)return u=a>e?"D":"C",Kc(Math.abs(a-e),qc(u,s));u=o>t?"D":"C";let h=Math.abs(o-t),m=NP(o>t?e:a,i)+(h-1)*i.cols+1+CP(o>t?a:e);return Kc(m,qc(u,s))}function CP(e,t){return e-1}function NP(e,t){return t.cols-e}function TP(e,t,i,s,a,o){return ef(t,s,a,o).length===0?"":Kc(qN(e,t,e,t-Ka(t,a),!1,a).length,qc("D",o))}function ef(e,t,i,s){let a=e-Ka(e,i),o=t-Ka(t,i),u=Math.abs(a-o)-MP(e,t,i);return Kc(u,qc(VN(e,t),s))}function AP(e,t,i,s,a,o){let u;ef(t,s,a,o).length>0?u=s-Ka(s,a):u=t;let h=s,m=RP(e,t,i,s,a,o);return Kc(qN(e,u,i,h,m==="C",a).length,qc(m,o))}function MP(e,t,i){let s=0,a=e-Ka(e,i),o=t-Ka(t,i);for(let u=0;u<Math.abs(a-o);u++){let h=VN(e,t)==="A"?-1:1;i.buffer.lines.get(a+h*u)?.isWrapped&&s++}return s}function Ka(e,t){let i=0,s=t.buffer.lines.get(e),a=s?.isWrapped;for(;a&&e>=0&&e<t.rows;)i++,s=t.buffer.lines.get(--e),a=s?.isWrapped;return i}function RP(e,t,i,s,a,o){let u;return ef(i,s,a,o).length>0?u=s-Ka(s,a):u=t,e<i&&u<=s||e>=i&&u<s?"C":"D"}function VN(e,t){return e>t?"A":"B"}function qN(e,t,i,s,a,o){let u=e,h=t,m="";for(;(u!==i||h!==s)&&h>=0&&h<o.buffer.lines.length;)u+=a?1:-1,a&&u>o.cols-1?(m+=o.buffer.translateBufferLineToString(h,!1,e,u),u=0,e=0,h++):!a&&u<0&&(m+=o.buffer.translateBufferLineToString(h,!1,0,e+1),u=o.cols-1,e=u,h--);return m+o.buffer.translateBufferLineToString(h,!1,e,u)}function qc(e,t){let i=t?"O":"[";return ce.ESC+i+e}function Kc(e,t){e=Math.floor(e);let i="";for(let s=0;s<e;s++)i+=t;return i}var jP=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 Nw(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 Up=50,DP=15,OP=50,LP=500,BP=" ",zP=new RegExp(BP,"g"),P0=class extends Ye{constructor(e,t,i,s,a,o,u,h,m){super(),this._element=e,this._screenElement=t,this._linkifier=i,this._bufferService=s,this._coreService=a,this._mouseService=o,this._optionsService=u,this._renderService=h,this._coreBrowserService=m,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Gn,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new be),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new be),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new be),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new be),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=f=>this._handleMouseMove(f),this._mouseUpListener=f=>this._handleMouseUp(f),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(f=>this._handleTrim(f)),this._register(this._bufferService.buffers.onBufferActivate(f=>this._handleBufferActivate(f))),this.enable(),this._model=new jP(this._bufferService),this._activeSelectionMode=0,this._register(Ot(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(f=>{f.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 i=this._bufferService.buffer,s=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let a=e[0]<t[0]?e[0]:t[0],o=e[0]<t[0]?t[0]:e[0];for(let u=e[1];u<=t[1];u++){let h=i.translateBufferLineToString(u,!0,a,o);s.push(h)}}else{let a=e[1]===t[1]?t[0]:void 0;s.push(i.translateBufferLineToString(e[1],!0,e[0],a));for(let o=e[1]+1;o<=t[1]-1;o++){let u=i.lines.get(o),h=i.translateBufferLineToString(o,!0);u?.isWrapped?s[s.length-1]+=h:s.push(h)}if(e[1]!==t[1]){let o=i.lines.get(t[1]),u=i.translateBufferLineToString(t[1],!0,0,t[0]);o&&o.isWrapped?s[s.length-1]+=u:s.push(u)}}return s.map(a=>a.replace(zP," ")).join(UN?`\r
|
|
149
|
-
`:`
|
|
150
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),cv&&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),i=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!i||!s||!t?!1:this._areCoordsInSelection(t,i,s)}isCellInSelection(e,t){let i=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!i||!s?!1:this._areCoordsInSelection([e,t],i,s)}_areCoordsInSelection(e,t,i){return e[1]>t[1]&&e[1]<i[1]||t[1]===i[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<i[0]||t[1]<i[1]&&e[1]===i[1]&&e[0]<i[0]||t[1]<i[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){let i=this._linkifier.currentLink?.link?.range;if(i)return this._model.selectionStart=[i.start.x-1,i.start.y-1],this._model.selectionStartLength=Nw(i,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let s=this._getMouseBufferCoords(e);return s?(this._selectWordAt(s,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=lv(this._coreBrowserService.window,e,this._screenElement)[1],i=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=i?0:(t>i&&(t-=i),t=Math.min(Math.max(t,-Up),Up),t/=Up,t/Math.abs(t)+Math.round(t*(DP-1)))}shouldForceSelection(e){return Rh?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(),OP)}_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&&!(Rh&&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 i=this._bufferService.buffer;if(this._model.selectionEnd[1]<i.lines.length){let s=i.lines.get(this._model.selectionEnd[1]);s&&s.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<LP&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let i=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(i&&i[0]!==void 0&&i[1]!==void 0){let s=EP(i[0]-1,i[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(s,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,i=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!i){this._oldHasSelection&&this._fireOnSelectionChange(e,t,i);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,i)}_fireOnSelectionChange(e,t,i){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=i,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let i=t;for(let s=0;t>=s;s++){let a=e.loadCell(s,this._workCell).getChars().length;this._workCell.getWidth()===0?i--:a>1&&t!==s&&(i+=a-1)}return i}setSelection(e,t,i){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=i,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,i=!0,s=!0){if(e[0]>=this._bufferService.cols)return;let a=this._bufferService.buffer,o=a.lines.get(e[1]);if(!o)return;let u=a.translateBufferLineToString(e[1],!1),h=this._convertViewportColToCharacterIndex(o,e[0]),m=h,f=e[0]-h,p=0,b=0,_=0,x=0;if(u.charAt(h)===" "){for(;h>0&&u.charAt(h-1)===" ";)h--;for(;m<u.length&&u.charAt(m+1)===" ";)m++}else{let E=e[0],C=e[0];o.getWidth(E)===0&&(p++,E--),o.getWidth(C)===2&&(b++,C++);let A=o.getString(C).length;for(A>1&&(x+=A-1,m+=A-1);E>0&&h>0&&!this._isCharWordSeparator(o.loadCell(E-1,this._workCell));){o.loadCell(E-1,this._workCell);let N=this._workCell.getChars().length;this._workCell.getWidth()===0?(p++,E--):N>1&&(_+=N-1,h-=N-1),h--,E--}for(;C<o.length&&m+1<u.length&&!this._isCharWordSeparator(o.loadCell(C+1,this._workCell));){o.loadCell(C+1,this._workCell);let N=this._workCell.getChars().length;this._workCell.getWidth()===2?(b++,C++):N>1&&(x+=N-1,m+=N-1),m++,C++}}m++;let y=h+f-p+_,S=Math.min(this._bufferService.cols,m-h+p+b-_-x);if(!(!t&&u.slice(h,m).trim()==="")){if(i&&y===0&&o.getCodePoint(0)!==32){let E=a.lines.get(e[1]-1);if(E&&o.isWrapped&&E.getCodePoint(this._bufferService.cols-1)!==32){let C=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(C){let A=this._bufferService.cols-C.start;y-=A,S+=A}}}if(s&&y+S===this._bufferService.cols&&o.getCodePoint(this._bufferService.cols-1)!==32){let E=a.lines.get(e[1]+1);if(E?.isWrapped&&E.getCodePoint(0)!==32){let C=this._getWordAt([0,e[1]+1],!1,!1,!0);C&&(S+=C.length)}}return{start:y,length:S}}}_selectWordAt(e,t){let i=this._getWordAt(e,t);if(i){for(;i.start<0;)i.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[i.start,e[1]],this._model.selectionStartLength=i.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let i=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,i--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,i++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,i]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),i={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=Nw(i,this._bufferService.cols)}};P0=Vt([Se(3,en),Se(4,Za),Se(5,tv),Se(6,tn),Se(7,fr),Se(8,hr)],P0);var Tw=class{constructor(){this._data={}}set(e,t,i){this._data[e]||(this._data[e]={}),this._data[e][t]=i}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},Aw=class{constructor(){this._color=new Tw,this._css=new Tw}setCss(e,t,i){this._css.set(e,t,i)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,i){this._color.set(e,t,i)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},di=Object.freeze((()=>{let e=[Pt.toColor("#2e3436"),Pt.toColor("#cc0000"),Pt.toColor("#4e9a06"),Pt.toColor("#c4a000"),Pt.toColor("#3465a4"),Pt.toColor("#75507b"),Pt.toColor("#06989a"),Pt.toColor("#d3d7cf"),Pt.toColor("#555753"),Pt.toColor("#ef2929"),Pt.toColor("#8ae234"),Pt.toColor("#fce94f"),Pt.toColor("#729fcf"),Pt.toColor("#ad7fa8"),Pt.toColor("#34e2e2"),Pt.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let i=0;i<216;i++){let s=t[i/36%6|0],a=t[i/6%6|0],o=t[i%6];e.push({css:ai.toCss(s,a,o),rgba:ai.toRgba(s,a,o)})}for(let i=0;i<24;i++){let s=8+i*10;e.push({css:ai.toCss(s,s,s),rgba:ai.toRgba(s,s,s)})}return e})()),Da=Pt.toColor("#ffffff"),Ec=Pt.toColor("#000000"),Mw=Pt.toColor("#ffffff"),Rw=Ec,pc={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},IP=Da,$0=class extends Ye{constructor(e){super(),this._optionsService=e,this._contrastCache=new Aw,this._halfContrastCache=new Aw,this._onChangeColors=this._register(new be),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:Da,background:Ec,cursor:Mw,cursorAccent:Rw,selectionForeground:void 0,selectionBackgroundTransparent:pc,selectionBackgroundOpaque:Mt.blend(Ec,pc),selectionInactiveBackgroundTransparent:pc,selectionInactiveBackgroundOpaque:Mt.blend(Ec,pc),scrollbarSliderBackground:Mt.opacity(Da,.2),scrollbarSliderHoverBackground:Mt.opacity(Da,.4),scrollbarSliderActiveBackground:Mt.opacity(Da,.5),overviewRulerBorder:Da,ansi:di.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=St(e.foreground,Da),t.background=St(e.background,Ec),t.cursor=Mt.blend(t.background,St(e.cursor,Mw)),t.cursorAccent=Mt.blend(t.background,St(e.cursorAccent,Rw)),t.selectionBackgroundTransparent=St(e.selectionBackground,pc),t.selectionBackgroundOpaque=Mt.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=St(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=Mt.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?St(e.selectionForeground,kw):void 0,t.selectionForeground===kw&&(t.selectionForeground=void 0),Mt.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=Mt.opacity(t.selectionBackgroundTransparent,.3)),Mt.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=Mt.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=St(e.scrollbarSliderBackground,Mt.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=St(e.scrollbarSliderHoverBackground,Mt.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=St(e.scrollbarSliderActiveBackground,Mt.opacity(t.foreground,.5)),t.overviewRulerBorder=St(e.overviewRulerBorder,IP),t.ansi=di.slice(),t.ansi[0]=St(e.black,di[0]),t.ansi[1]=St(e.red,di[1]),t.ansi[2]=St(e.green,di[2]),t.ansi[3]=St(e.yellow,di[3]),t.ansi[4]=St(e.blue,di[4]),t.ansi[5]=St(e.magenta,di[5]),t.ansi[6]=St(e.cyan,di[6]),t.ansi[7]=St(e.white,di[7]),t.ansi[8]=St(e.brightBlack,di[8]),t.ansi[9]=St(e.brightRed,di[9]),t.ansi[10]=St(e.brightGreen,di[10]),t.ansi[11]=St(e.brightYellow,di[11]),t.ansi[12]=St(e.brightBlue,di[12]),t.ansi[13]=St(e.brightMagenta,di[13]),t.ansi[14]=St(e.brightCyan,di[14]),t.ansi[15]=St(e.brightWhite,di[15]),e.extendedAnsi){let i=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let s=0;s<i;s++)t.ansi[s+16]=St(e.extendedAnsi[s],di[s+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()}}};$0=Vt([Se(0,tn)],$0);function St(e,t){if(e!==void 0)try{return Pt.toColor(e)}catch{}return t}var PP=class{constructor(...e){this._entries=new Map;for(let[t,i]of e)this.set(t,i)}set(e,t){let i=this._entries.get(e);return this._entries.set(e,t),i}forEach(e){for(let[t,i]of this._entries.entries())e(t,i)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},$P=class{constructor(){this._services=new PP,this._services.set(ev,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let i=Dz(e).sort((o,u)=>o.index-u.index),s=[];for(let o of i){let u=this._services.get(o.id);if(!u)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${o.id._id}.`);s.push(u)}let a=i.length>0?i[0].index:t.length;if(t.length!==a)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${a+1} conflicts with ${t.length} static arguments`);return new e(...t,...s)}},UP={trace:0,debug:1,info:2,warn:3,error:4,off:5},HP="xterm.js: ",U0=class extends Ye{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=UP[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,i){this._evalLazyOptionalParams(i),e.call(console,(this._optionsService.options.logger?"":HP)+t,...i)}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)}};U0=Vt([Se(0,tn)],U0);var jw=class extends Ye{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new be),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new be),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new be),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 i=0;i<Math.min(e,this.length);i++)t[i]=this._array[this._getCyclicIndex(i)];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,...i){if(t){for(let s=e;s<this._length-t;s++)this._array[this._getCyclicIndex(s)]=this._array[this._getCyclicIndex(s+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let s=this._length-1;s>=e;s--)this._array[this._getCyclicIndex(s+i.length)]=this._array[this._getCyclicIndex(s)];for(let s=0;s<i.length;s++)this._array[this._getCyclicIndex(e+s)]=i[s];if(i.length&&this.onInsertEmitter.fire({index:e,amount:i.length}),this._length+i.length>this._maxLength){let s=this._length+i.length-this._maxLength;this._startIndex+=s,this._length=this._maxLength,this.onTrimEmitter.fire(s)}else this._length+=i.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,i){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+i<0)throw new Error("Cannot shift elements in list beyond index 0");if(i>0){for(let a=t-1;a>=0;a--)this.set(e+a+i,this.get(e+a));let s=e+t+i-this._length;if(s>0)for(this._length+=s;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let s=0;s<t;s++)this.set(e+s+i,this.get(e+s))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},Ge=3,ni=Object.freeze(new ou),qd=0,Hp=2,Cc=class KN{constructor(t,i,s=!1){this.isWrapped=s,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*Ge);let a=i||Gn.fromCharData([0,dN,1,0]);for(let o=0;o<t;++o)this.setCell(o,a);this.length=t}get(t){let i=this._data[t*Ge+0],s=i&2097151;return[this._data[t*Ge+1],i&2097152?this._combined[t]:s?Xr(s):"",i>>22,i&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):s]}set(t,i){this._data[t*Ge+1]=i[0],i[1].length>1?(this._combined[t]=i[1],this._data[t*Ge+0]=t|2097152|i[2]<<22):this._data[t*Ge+0]=i[1].charCodeAt(0)|i[2]<<22}getWidth(t){return this._data[t*Ge+0]>>22}hasWidth(t){return this._data[t*Ge+0]&12582912}getFg(t){return this._data[t*Ge+1]}getBg(t){return this._data[t*Ge+2]}hasContent(t){return this._data[t*Ge+0]&4194303}getCodePoint(t){let i=this._data[t*Ge+0];return i&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):i&2097151}isCombined(t){return this._data[t*Ge+0]&2097152}getString(t){let i=this._data[t*Ge+0];return i&2097152?this._combined[t]:i&2097151?Xr(i&2097151):""}isProtected(t){return this._data[t*Ge+2]&536870912}loadCell(t,i){return qd=t*Ge,i.content=this._data[qd+0],i.fg=this._data[qd+1],i.bg=this._data[qd+2],i.content&2097152&&(i.combinedData=this._combined[t]),i.bg&268435456&&(i.extended=this._extendedAttrs[t]),i}setCell(t,i){i.content&2097152&&(this._combined[t]=i.combinedData),i.bg&268435456&&(this._extendedAttrs[t]=i.extended),this._data[t*Ge+0]=i.content,this._data[t*Ge+1]=i.fg,this._data[t*Ge+2]=i.bg}setCellFromCodepoint(t,i,s,a){a.bg&268435456&&(this._extendedAttrs[t]=a.extended),this._data[t*Ge+0]=i|s<<22,this._data[t*Ge+1]=a.fg,this._data[t*Ge+2]=a.bg}addCodepointToCell(t,i,s){let a=this._data[t*Ge+0];a&2097152?this._combined[t]+=Xr(i):a&2097151?(this._combined[t]=Xr(a&2097151)+Xr(i),a&=-2097152,a|=2097152):a=i|1<<22,s&&(a&=-12582913,a|=s<<22),this._data[t*Ge+0]=a}insertCells(t,i,s){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,s),i<this.length-t){let a=new Gn;for(let o=this.length-t-i-1;o>=0;--o)this.setCell(t+i+o,this.loadCell(t+o,a));for(let o=0;o<i;++o)this.setCell(t+o,s)}else for(let a=t;a<this.length;++a)this.setCell(a,s);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,s)}deleteCells(t,i,s){if(t%=this.length,i<this.length-t){let a=new Gn;for(let o=0;o<this.length-t-i;++o)this.setCell(t+o,this.loadCell(t+i+o,a));for(let o=this.length-i;o<this.length;++o)this.setCell(o,s)}else for(let a=t;a<this.length;++a)this.setCell(a,s);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,s),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,s)}replaceCells(t,i,s,a=!1){if(a){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,s),i<this.length&&this.getWidth(i-1)===2&&!this.isProtected(i)&&this.setCellFromCodepoint(i,0,1,s);t<i&&t<this.length;)this.isProtected(t)||this.setCell(t,s),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,s),i<this.length&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i,0,1,s);t<i&&t<this.length;)this.setCell(t++,s)}resize(t,i){if(t===this.length)return this._data.length*4*Hp<this._data.buffer.byteLength;let s=t*Ge;if(t>this.length){if(this._data.buffer.byteLength>=s*4)this._data=new Uint32Array(this._data.buffer,0,s);else{let a=new Uint32Array(s);a.set(this._data),this._data=a}for(let a=this.length;a<t;++a)this.setCell(a,i)}else{this._data=this._data.subarray(0,s);let a=Object.keys(this._combined);for(let u=0;u<a.length;u++){let h=parseInt(a[u],10);h>=t&&delete this._combined[h]}let o=Object.keys(this._extendedAttrs);for(let u=0;u<o.length;u++){let h=parseInt(o[u],10);h>=t&&delete this._extendedAttrs[h]}}return this.length=t,s*4*Hp<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*Hp<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,i=!1){if(i){for(let s=0;s<this.length;++s)this.isProtected(s)||this.setCell(s,t);return}this._combined={},this._extendedAttrs={};for(let s=0;s<this.length;++s)this.setCell(s,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 i in t._combined)this._combined[i]=t._combined[i];this._extendedAttrs={};for(let i in t._extendedAttrs)this._extendedAttrs[i]=t._extendedAttrs[i];this.isWrapped=t.isWrapped}clone(){let t=new KN(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let i in this._combined)t._combined[i]=this._combined[i];for(let i in this._extendedAttrs)t._extendedAttrs[i]=this._extendedAttrs[i];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Ge+0]&4194303)return t+(this._data[t*Ge+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Ge+0]&4194303||this._data[t*Ge+2]&50331648)return t+(this._data[t*Ge+0]>>22);return 0}copyCellsFrom(t,i,s,a,o){let u=t._data;if(o)for(let m=a-1;m>=0;m--){for(let f=0;f<Ge;f++)this._data[(s+m)*Ge+f]=u[(i+m)*Ge+f];u[(i+m)*Ge+2]&268435456&&(this._extendedAttrs[s+m]=t._extendedAttrs[i+m])}else for(let m=0;m<a;m++){for(let f=0;f<Ge;f++)this._data[(s+m)*Ge+f]=u[(i+m)*Ge+f];u[(i+m)*Ge+2]&268435456&&(this._extendedAttrs[s+m]=t._extendedAttrs[i+m])}let h=Object.keys(t._combined);for(let m=0;m<h.length;m++){let f=parseInt(h[m],10);f>=i&&(this._combined[f-i+s]=t._combined[f])}}translateToString(t,i,s,a){i=i??0,s=s??this.length,t&&(s=Math.min(s,this.getTrimmedLength())),a&&(a.length=0);let o="";for(;i<s;){let u=this._data[i*Ge+0],h=u&2097151,m=u&2097152?this._combined[i]:h?Xr(h):Qr;if(o+=m,a)for(let f=0;f<m.length;++f)a.push(i);i+=u>>22||1}return a&&a.push(i),o}};function FP(e,t,i,s,a,o){let u=[];for(let h=0;h<e.length-1;h++){let m=h,f=e.get(++m);if(!f.isWrapped)continue;let p=[e.get(h)];for(;m<e.length&&f.isWrapped;)p.push(f),f=e.get(++m);if(!o&&s>=h&&s<m){h+=p.length-1;continue}let b=0,_=Gc(p,b,t),x=1,y=0;for(;x<p.length;){let E=Gc(p,x,t),C=E-y,A=i-_,N=Math.min(C,A);p[b].copyCellsFrom(p[x],y,_,N,!1),_+=N,_===i&&(b++,_=0),y+=N,y===E&&(x++,y=0),_===0&&b!==0&&p[b-1].getWidth(i-1)===2&&(p[b].copyCellsFrom(p[b-1],i-1,_++,1,!1),p[b-1].setCell(i-1,a))}p[b].replaceCells(_,i,a);let S=0;for(let E=p.length-1;E>0&&(E>b||p[E].getTrimmedLength()===0);E--)S++;S>0&&(u.push(h+p.length-S),u.push(S)),h+=p.length-1}return u}function VP(e,t){let i=[],s=0,a=t[s],o=0;for(let u=0;u<e.length;u++)if(a===u){let h=t[++s];e.onDeleteEmitter.fire({index:u-o,amount:h}),u+=h-1,o+=h,a=t[++s]}else i.push(u);return{layout:i,countRemoved:o}}function qP(e,t){let i=[];for(let s=0;s<t.length;s++)i.push(e.get(t[s]));for(let s=0;s<i.length;s++)e.set(s,i[s]);e.length=t.length}function KP(e,t,i){let s=[],a=e.map((m,f)=>Gc(e,f,t)).reduce((m,f)=>m+f),o=0,u=0,h=0;for(;h<a;){if(a-h<i){s.push(a-h);break}o+=i;let m=Gc(e,u,t);o>m&&(o-=m,u++);let f=e[u].getWidth(o-1)===2;f&&o--;let p=f?i-1:i;s.push(p),h+=p}return s}function Gc(e,t,i){if(t===e.length-1)return e[t].getTrimmedLength();let s=!e[t].hasContent(i-1)&&e[t].getWidth(i-1)===1,a=e[t+1].getWidth(0)===2;return s&&a?i-1:i}var GN=class WN{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=WN._nextId++,this._onDispose=this.register(new be),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),qa(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};GN._nextId=1;var GP=GN,pi={},Oa=pi.B;pi[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:"≥","{":"π","|":"≠","}":"£","~":"·"};pi.A={"#":"£"};pi.B=void 0;pi[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};pi.C=pi[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};pi.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};pi.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};pi.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};pi.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};pi.E=pi[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};pi.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};pi.H=pi[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};pi["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var Dw=4294967295,Ow=class{constructor(e,t,i){this._hasScrollback=e,this._optionsService=t,this._bufferService=i,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=ni.clone(),this.savedCharset=Oa,this.markers=[],this._nullCell=Gn.fromCharData([0,dN,1,0]),this._whitespaceCell=Gn.fromCharData([0,Qr,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new jh,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new jw(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 Th),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 Th),this._whitespaceCell}getBlankLine(e,t){return new Cc(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>Dw?Dw:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=ni);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 jw(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let i=this.getNullCell(ni),s=0,a=this._getCorrectBufferLength(t);if(a>this.lines.maxLength&&(this.lines.maxLength=a),this.lines.length>0){if(this._cols<e)for(let u=0;u<this.lines.length;u++)s+=+this.lines.get(u).resize(e,i);let o=0;if(this._rows<t)for(let u=this._rows;u<t;u++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new Cc(e,i)):this.ybase>0&&this.lines.length<=this.ybase+this.y+o+1?(this.ybase--,o++,this.ydisp>0&&this.ydisp--):this.lines.push(new Cc(e,i)));else for(let u=this._rows;u>t;u--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(a<this.lines.maxLength){let u=this.lines.length-a;u>0&&(this.lines.trimStart(u),this.ybase=Math.max(this.ybase-u,0),this.ydisp=Math.max(this.ydisp-u,0),this.savedY=Math.max(this.savedY-u,0)),this.lines.maxLength=a}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),o&&(this.y+=o),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 o=0;o<this.lines.length;o++)s+=+this.lines.get(o).resize(e,i);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),s>.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 i=this._optionsService.rawOptions.reflowCursorLine,s=FP(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(ni),i);if(s.length>0){let a=VP(this.lines,s);qP(this.lines,a.layout),this._reflowLargerAdjustViewport(e,t,a.countRemoved)}}_reflowLargerAdjustViewport(e,t,i){let s=this.getNullCell(ni),a=i;for(;a-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new Cc(e,s))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-i,0)}_reflowSmaller(e,t){let i=this._optionsService.rawOptions.reflowCursorLine,s=this.getNullCell(ni),a=[],o=0;for(let u=this.lines.length-1;u>=0;u--){let h=this.lines.get(u);if(!h||!h.isWrapped&&h.getTrimmedLength()<=e)continue;let m=[h];for(;h.isWrapped&&u>0;)h=this.lines.get(--u),m.unshift(h);if(!i){let N=this.ybase+this.y;if(N>=u&&N<u+m.length)continue}let f=m[m.length-1].getTrimmedLength(),p=KP(m,this._cols,e),b=p.length-m.length,_;this.ybase===0&&this.y!==this.lines.length-1?_=Math.max(0,this.y-this.lines.maxLength+b):_=Math.max(0,this.lines.length-this.lines.maxLength+b);let x=[];for(let N=0;N<b;N++){let M=this.getBlankLine(ni,!0);x.push(M)}x.length>0&&(a.push({start:u+m.length+o,newLines:x}),o+=x.length),m.push(...x);let y=p.length-1,S=p[y];S===0&&(y--,S=p[y]);let E=m.length-b-1,C=f;for(;E>=0;){let N=Math.min(C,S);if(m[y]===void 0)break;if(m[y].copyCellsFrom(m[E],C-N,S-N,N,!0),S-=N,S===0&&(y--,S=p[y]),C-=N,C===0){E--;let M=Math.max(E,0);C=Gc(m,M,this._cols)}}for(let N=0;N<m.length;N++)p[N]<e&&m[N].setCell(p[N],s);let A=b-_;for(;A-- >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+o)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+b,this.ybase+t-1)}if(a.length>0){let u=[],h=[];for(let S=0;S<this.lines.length;S++)h.push(this.lines.get(S));let m=this.lines.length,f=m-1,p=0,b=a[p];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+o);let _=0;for(let S=Math.min(this.lines.maxLength-1,m+o-1);S>=0;S--)if(b&&b.start>f+_){for(let E=b.newLines.length-1;E>=0;E--)this.lines.set(S--,b.newLines[E]);S++,u.push({index:f+1,amount:b.newLines.length}),_+=b.newLines.length,b=a[++p]}else this.lines.set(S,h[f--]);let x=0;for(let S=u.length-1;S>=0;S--)u[S].index+=x,this.lines.onInsertEmitter.fire(u[S]),x+=u[S].amount;let y=Math.max(0,m+o-this.lines.maxLength);y>0&&this.lines.onTrimEmitter.fire(y)}}translateBufferLineToString(e,t,i=0,s){let a=this.lines.get(e);return a?a.translateToString(t,i,s):""}getWrappedRangeForLine(e){let t=e,i=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;i+1<this.lines.length&&this.lines.get(i+1).isWrapped;)i++;return{first:t,last:i}}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 GP(e);return this.markers.push(t),t.register(this.lines.onTrim(i=>{t.line-=i,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(i=>{t.line>=i.index&&(t.line+=i.amount)})),t.register(this.lines.onDelete(i=>{t.line>=i.index&&t.line<i.index+i.amount&&t.dispose(),t.line>i.index&&(t.line-=i.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},WP=class extends Ye{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new be),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 Ow(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new Ow(!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)}},YN=2,XN=1,H0=class extends Ye{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new be),this.onResize=this._onResize.event,this._onScroll=this._register(new be),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,YN),this.rows=Math.max(e.rawOptions.rows||0,XN),this.buffers=this._register(new WP(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let i=this.cols!==e,s=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:i,rowsChanged:s})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let i=this.buffer,s;s=this._cachedBlankLine,(!s||s.length!==this.cols||s.getFg(0)!==e.fg||s.getBg(0)!==e.bg)&&(s=i.getBlankLine(e,t),this._cachedBlankLine=s),s.isWrapped=t;let a=i.ybase+i.scrollTop,o=i.ybase+i.scrollBottom;if(i.scrollTop===0){let u=i.lines.isFull;o===i.lines.length-1?u?i.lines.recycle().copyFrom(s):i.lines.push(s.clone()):i.lines.splice(o+1,0,s.clone()),u?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{let u=o-a+1;i.lines.shiftElements(a+1,u-1,-1),i.lines.set(o,s.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(e,t){let i=this.buffer;if(e<0){if(i.ydisp===0)return;this.isUserScrolling=!0}else e+i.ydisp>=i.ybase&&(this.isUserScrolling=!1);let s=i.ydisp;i.ydisp=Math.max(Math.min(i.ydisp+e,i.ybase),0),s!==i.ydisp&&(t||this._onScroll.fire(i.ydisp))}};H0=Vt([Se(0,tn)],H0);var Uo={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:Rh,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},YP=["normal","bold","100","200","300","400","500","600","700","800","900"],XP=class extends Ye{constructor(e){super(),this._onOptionChange=this._register(new be),this.onOptionChange=this._onOptionChange.event;let t={...Uo};for(let i in e)if(i in t)try{let s=e[i];t[i]=this._sanitizeAndValidateOption(i,s)}catch(s){console.error(s)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(Ot(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(i=>{i===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(i=>{e.indexOf(i)!==-1&&t()})}_setupOptions(){let e=i=>{if(!(i in Uo))throw new Error(`No option with key "${i}"`);return this.rawOptions[i]},t=(i,s)=>{if(!(i in Uo))throw new Error(`No option with key "${i}"`);s=this._sanitizeAndValidateOption(i,s),this.rawOptions[i]!==s&&(this.rawOptions[i]=s,this._onOptionChange.fire(i))};for(let i in this.rawOptions){let s={get:e.bind(this,i),set:t.bind(this,i)};Object.defineProperty(this.options,i,s)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=Uo[e]),!ZP(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=Uo[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=YP.includes(t)?t:Uo[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 ZP(e){return e==="block"||e==="underline"||e==="bar"}function Nc(e,t=5){if(typeof e!="object")return e;let i=Array.isArray(e)?[]:{};for(let s in e)i[s]=t<=1?e[s]:e[s]&&Nc(e[s],t-1);return i}var Lw=Object.freeze({insertMode:!1}),Bw=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),F0=class extends Ye{constructor(e,t,i){super(),this._bufferService=e,this._logService=t,this._optionsService=i,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new be),this.onData=this._onData.event,this._onUserInput=this._register(new be),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new be),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new be),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=Nc(Lw),this.decPrivateModes=Nc(Bw)}reset(){this.modes=Nc(Lw),this.decPrivateModes=Nc(Bw)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let i=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&i.ybase!==i.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(s=>s.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))}};F0=Vt([Se(0,en),Se(1,gN),Se(2,tn)],F0);var zw={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 Fp(e,t){let i=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(i|=64,i|=e.action):(i|=e.button&3,e.button&4&&(i|=64),e.button&8&&(i|=128),e.action===32?i|=32:e.action===0&&!t&&(i|=3)),i}var Vp=String.fromCharCode,Iw={DEFAULT:e=>{let t=[Fp(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${Vp(t[0])}${Vp(t[1])}${Vp(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Fp(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Fp(e,!0)};${e.x};${e.y}${t}`}},V0=class extends Ye{constructor(e,t,i){super(),this._bufferService=e,this._coreService=t,this._optionsService=i,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new be),this.onProtocolChange=this._onProtocolChange.event;for(let s of Object.keys(zw))this.addProtocol(s,zw[s]);for(let s of Object.keys(Iw))this.addEncoding(s,Iw[s]);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,i){if(e.deltaY===0||e.shiftKey||t===void 0||i===void 0)return 0;let s=t/i,a=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(a/=s+0,Math.abs(e.deltaY)<50&&(a*=.3),this._wheelPartialScroll+=a,a=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(a*=this._bufferService.rows),a}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,i){if(i){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)}};V0=Vt([Se(0,en),Se(1,Za),Se(2,tn)],V0);var qp=[[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]],QP=[[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]],hi;function JP(e,t){let i=0,s=t.length-1,a;if(e<t[0][0]||e>t[s][1])return!1;for(;s>=i;)if(a=i+s>>1,e>t[a][1])i=a+1;else if(e<t[a][0])s=a-1;else return!0;return!1}var e$=class{constructor(){if(this.version="6",!hi){hi=new Uint8Array(65536),hi.fill(1),hi[0]=0,hi.fill(0,1,32),hi.fill(0,127,160),hi.fill(2,4352,4448),hi[9001]=2,hi[9002]=2,hi.fill(2,11904,42192),hi[12351]=1,hi.fill(2,44032,55204),hi.fill(2,63744,64256),hi.fill(2,65040,65050),hi.fill(2,65072,65136),hi.fill(2,65280,65377),hi.fill(2,65504,65511);for(let e=0;e<qp.length;++e)hi.fill(0,qp[e][0],qp[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?hi[e]:JP(e,QP)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let i=this.wcwidth(e),s=i===0&&t!==0;if(s){let a=Ia.extractWidth(t);a===0?s=!1:a>i&&(i=a)}return Ia.createPropertyValue(0,i,s)}},Ia=class ah{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new be,this.onChange=this._onChange.event;let t=new e$;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,i,s=!1){return(t&16777215)<<3|(i&3)<<1|(s?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 i=0,s=0,a=t.length;for(let o=0;o<a;++o){let u=t.charCodeAt(o);if(55296<=u&&u<=56319){if(++o>=a)return i+this.wcwidth(u);let f=t.charCodeAt(o);56320<=f&&f<=57343?u=(u-55296)*1024+f-56320+65536:i+=this.wcwidth(f)}let h=this.charProperties(u,s),m=ah.extractWidth(h);ah.extractShouldJoin(h)&&(m-=ah.extractWidth(s)),i+=m,s=h}return i}charProperties(t,i){return this._activeProvider.charProperties(t,i)}},t$=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 Pw(e){let t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.get(e.cols-1),i=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);i&&t&&(i.isWrapped=t[3]!==0&&t[3]!==32)}var gc=2147483647,i$=256,ZN=class q0{constructor(t=32,i=32){if(this.maxLength=t,this.maxSubParamsLength=i,i>i$)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(i),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let i=new q0;if(!t.length)return i;for(let s=Array.isArray(t[0])?1:0;s<t.length;++s){let a=t[s];if(Array.isArray(a))for(let o=0;o<a.length;++o)i.addSubParam(a[o]);else i.addParam(a)}return i}clone(){let t=new q0(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 i=0;i<this.length;++i){t.push(this.params[i]);let s=this._subParamsIdx[i]>>8,a=this._subParamsIdx[i]&255;a-s>0&&t.push(Array.prototype.slice.call(this._subParams,s,a))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>gc?gc: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>gc?gc:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let i=this._subParamsIdx[t]>>8,s=this._subParamsIdx[t]&255;return s-i>0?this._subParams.subarray(i,s):null}getSubParamsAll(){let t={};for(let i=0;i<this.length;++i){let s=this._subParamsIdx[i]>>8,a=this._subParamsIdx[i]&255;a-s>0&&(t[i]=this._subParams.slice(s,a))}return t}addDigit(t){let i;if(this._rejectDigits||!(i=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let s=this._digitIsSub?this._subParams:this.params,a=s[i-1];s[i-1]=~a?Math.min(a*10+t,gc):t}},bc=[],n$=class{constructor(){this._state=0,this._active=bc,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 i=this._handlers[e];return i.push(t),{dispose:()=>{let s=i.indexOf(t);s!==-1&&i.splice(s,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=bc}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=bc,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||bc,!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,i){if(!this._active.length)this._handlerFb(this._id,"PUT",Zh(e,t,i));else for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,t,i)}start(){this.reset(),this._state=1}put(e,t,i){if(this._state!==3){if(this._state===1)for(;t<i;){let s=e[t++];if(s===59){this._state=2,this._start();break}if(s<48||57<s){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+s-48}this._state===2&&i-t>0&&this._put(e,t,i)}}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 i=!1,s=this._active.length-1,a=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,i=t,a=this._stack.fallThrough,this._stack.paused=!1),!a&&i===!1){for(;s>=0&&(i=this._active[s].end(e),i!==!0);s--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,i;s--}for(;s>=0;s--)if(i=this._active[s].end(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,i}this._active=bc,this._id=-1,this._state=0}}},Nn=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=Zh(e,t,i),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(i=>(this._data="",this._hitLimit=!1,i));return this._data="",this._hitLimit=!1,t}},vc=[],s$=class{constructor(){this._handlers=Object.create(null),this._active=vc,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=vc}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let i=this._handlers[e];return i.push(t),{dispose:()=>{let s=i.indexOf(t);s!==-1&&i.splice(s,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=vc,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||vc,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let i=this._active.length-1;i>=0;i--)this._active[i].hook(t)}put(e,t,i){if(!this._active.length)this._handlerFb(this._ident,"PUT",Zh(e,t,i));else for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,t,i)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let i=!1,s=this._active.length-1,a=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,i=t,a=this._stack.fallThrough,this._stack.paused=!1),!a&&i===!1){for(;s>=0&&(i=this._active[s].unhook(e),i!==!0);s--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,i;s--}for(;s>=0;s--)if(i=this._active[s].unhook(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,i}this._active=vc,this._ident=0}},Tc=new ZN;Tc.addParam(0);var $w=class{constructor(e){this._handler=e,this._data="",this._params=Tc,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():Tc,this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=Zh(e,t,i),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(i=>(this._params=Tc,this._data="",this._hitLimit=!1,i));return this._params=Tc,this._data="",this._hitLimit=!1,t}},r$=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,i,s){this.table[t<<8|e]=i<<4|s}addMany(e,t,i,s){for(let a=0;a<e.length;a++)this.table[t<<8|e[a]]=i<<4|s}},Vn=160,a$=(function(){let e=new r$(4095),t=Array.apply(null,Array(256)).map((h,m)=>m),i=(h,m)=>t.slice(h,m),s=i(32,127),a=i(0,24);a.push(25),a.push.apply(a,i(28,32));let o=i(0,14),u;e.setDefault(1,0),e.addMany(s,0,2,0);for(u in o)e.addMany([24,26,153,154],u,3,0),e.addMany(i(128,144),u,3,0),e.addMany(i(144,152),u,3,0),e.add(156,u,0,0),e.add(27,u,11,1),e.add(157,u,4,8),e.addMany([152,158,159],u,0,7),e.add(155,u,11,3),e.add(144,u,11,9);return e.addMany(a,0,3,0),e.addMany(a,1,3,1),e.add(127,1,0,1),e.addMany(a,8,0,8),e.addMany(a,3,3,3),e.add(127,3,0,3),e.addMany(a,4,3,4),e.add(127,4,0,4),e.addMany(a,6,3,6),e.addMany(a,5,3,5),e.add(127,5,0,5),e.addMany(a,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(s,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(i(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(s,7,0,7),e.addMany(a,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(i(64,127),3,7,0),e.addMany(i(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(i(48,60),4,8,4),e.addMany(i(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(i(32,64),6,0,6),e.add(127,6,0,6),e.addMany(i(64,127),6,0,0),e.addMany(i(32,48),3,9,5),e.addMany(i(32,48),5,9,5),e.addMany(i(48,64),5,0,6),e.addMany(i(64,127),5,7,0),e.addMany(i(32,48),4,9,5),e.addMany(i(32,48),1,9,2),e.addMany(i(32,48),2,9,2),e.addMany(i(48,127),2,10,0),e.addMany(i(48,80),1,10,0),e.addMany(i(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(i(96,127),1,10,0),e.add(80,1,11,9),e.addMany(a,9,0,9),e.add(127,9,0,9),e.addMany(i(28,32),9,0,9),e.addMany(i(32,48),9,9,12),e.addMany(i(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(a,11,0,11),e.addMany(i(32,128),11,0,11),e.addMany(i(28,32),11,0,11),e.addMany(a,10,0,10),e.add(127,10,0,10),e.addMany(i(28,32),10,0,10),e.addMany(i(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(i(32,48),10,9,12),e.addMany(a,12,0,12),e.add(127,12,0,12),e.addMany(i(28,32),12,0,12),e.addMany(i(32,48),12,9,12),e.addMany(i(48,64),12,0,11),e.addMany(i(64,127),12,12,13),e.addMany(i(64,127),10,12,13),e.addMany(i(64,127),9,12,13),e.addMany(a,13,13,13),e.addMany(s,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(Vn,0,2,0),e.add(Vn,8,5,8),e.add(Vn,6,0,6),e.add(Vn,11,0,11),e.add(Vn,13,13,13),e})(),o$=class extends Ye{constructor(e=a$){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 ZN,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,i,s)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,i)=>{},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(Ot(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new n$),this._dcsParser=this._register(new s$),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let i=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(i=e.prefix.charCodeAt(0),i&&60>i||i>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let a=0;a<e.intermediates.length;++a){let o=e.intermediates.charCodeAt(a);if(32>o||o>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");i<<=8,i|=o}}if(e.final.length!==1)throw new Error("final must be a single byte");let s=e.final.charCodeAt(0);if(t[0]>s||s>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return i<<=8,i|=s,i}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 i=this._identifier(e,[48,126]);this._escHandlers[i]===void 0&&(this._escHandlers[i]=[]);let s=this._escHandlers[i];return s.push(t),{dispose:()=>{let a=s.indexOf(t);a!==-1&&s.splice(a,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let i=this._identifier(e);this._csiHandlers[i]===void 0&&(this._csiHandlers[i]=[]);let s=this._csiHandlers[i];return s.push(t),{dispose:()=>{let a=s.indexOf(t);a!==-1&&s.splice(a,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,i,s,a){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=i,this._parseStack.transition=s,this._parseStack.chunkPos=a}parse(e,t,i){let s=0,a=0,o=0,u;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,o=this._parseStack.chunkPos+1;else{if(i===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let h=this._parseStack.handlers,m=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(i===!1&&m>-1){for(;m>=0&&(u=h[m](this._params),u!==!0);m--)if(u instanceof Promise)return this._parseStack.handlerPos=m,u}this._parseStack.handlers=[];break;case 4:if(i===!1&&m>-1){for(;m>=0&&(u=h[m](),u!==!0);m--)if(u instanceof Promise)return this._parseStack.handlerPos=m,u}this._parseStack.handlers=[];break;case 6:if(s=e[this._parseStack.chunkPos],u=this._dcsParser.unhook(s!==24&&s!==26,i),u)return u;s===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(s=e[this._parseStack.chunkPos],u=this._oscParser.end(s!==24&&s!==26,i),u)return u;s===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,o=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let h=o;h<t;++h){switch(s=e[h],a=this._transitions.table[this.currentState<<8|(s<160?s:Vn)],a>>4){case 2:for(let _=h+1;;++_){if(_>=t||(s=e[_])<32||s>126&&s<Vn){this._printHandler(e,h,_),h=_-1;break}if(++_>=t||(s=e[_])<32||s>126&&s<Vn){this._printHandler(e,h,_),h=_-1;break}if(++_>=t||(s=e[_])<32||s>126&&s<Vn){this._printHandler(e,h,_),h=_-1;break}if(++_>=t||(s=e[_])<32||s>126&&s<Vn){this._printHandler(e,h,_),h=_-1;break}}break;case 3:this._executeHandlers[s]?this._executeHandlers[s]():this._executeHandlerFb(s),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:h,code:s,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let m=this._csiHandlers[this._collect<<8|s],f=m?m.length-1:-1;for(;f>=0&&(u=m[f](this._params),u!==!0);f--)if(u instanceof Promise)return this._preserveStack(3,m,f,a,h),u;f<0&&this._csiHandlerFb(this._collect<<8|s,this._params),this.precedingJoinState=0;break;case 8:do switch(s){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(s-48)}while(++h<t&&(s=e[h])>47&&s<60);h--;break;case 9:this._collect<<=8,this._collect|=s;break;case 10:let p=this._escHandlers[this._collect<<8|s],b=p?p.length-1:-1;for(;b>=0&&(u=p[b](),u!==!0);b--)if(u instanceof Promise)return this._preserveStack(4,p,b,a,h),u;b<0&&this._escHandlerFb(this._collect<<8|s),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|s,this._params);break;case 13:for(let _=h+1;;++_)if(_>=t||(s=e[_])===24||s===26||s===27||s>127&&s<Vn){this._dcsParser.put(e,h,_),h=_-1;break}break;case 14:if(u=this._dcsParser.unhook(s!==24&&s!==26),u)return this._preserveStack(6,[],0,a,h),u;s===27&&(a|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let _=h+1;;_++)if(_>=t||(s=e[_])<32||s>127&&s<Vn){this._oscParser.put(e,h,_),h=_-1;break}break;case 6:if(u=this._oscParser.end(s!==24&&s!==26),u)return this._preserveStack(5,[],0,a,h),u;s===27&&(a|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=a&15}}},l$=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,c$=/^[\da-f]+$/;function Uw(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let i=l$.exec(t);if(i){let s=i[1]?15:i[4]?255:i[7]?4095:65535;return[Math.round(parseInt(i[1]||i[4]||i[7]||i[10],16)/s*255),Math.round(parseInt(i[2]||i[5]||i[8]||i[11],16)/s*255),Math.round(parseInt(i[3]||i[6]||i[9]||i[12],16)/s*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),c$.exec(t)&&[3,6,9,12].includes(t.length))){let i=t.length/3,s=[0,0,0];for(let a=0;a<3;++a){let o=parseInt(t.slice(i*a,i*a+i),16);s[a]=i===1?o<<4:i===2?o:i===3?o>>4:o>>8}return s}}function Kp(e,t){let i=e.toString(16),s=i.length<2?"0"+i:i;switch(t){case 4:return i[0];case 8:return s;case 12:return(s+s).slice(0,3);default:return s+s}}function u$(e,t=16){let[i,s,a]=e;return`rgb:${Kp(i,t)}/${Kp(s,t)}/${Kp(a,t)}`}var d$={"(":0,")":1,"*":2,"+":3,"-":1,".":2},Wr=131072,Hw=10;function Fw(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 Vw=5e3,qw=0,h$=class extends Ye{constructor(e,t,i,s,a,o,u,h,m=new o$){super(),this._bufferService=e,this._charsetService=t,this._coreService=i,this._logService=s,this._optionsService=a,this._oscLinkService=o,this._coreMouseService=u,this._unicodeService=h,this._parser=m,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new Rz,this._utf8Decoder=new jz,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=ni.clone(),this._eraseAttrDataInternal=ni.clone(),this._onRequestBell=this._register(new be),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new be),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new be),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new be),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new be),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new be),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new be),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new be),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new be),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new be),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new be),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new be),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new be),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 K0(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(f=>this._activeBuffer=f.activeBuffer)),this._parser.setCsiHandlerFallback((f,p)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(f),params:p.toArray()})}),this._parser.setEscHandlerFallback(f=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(f)})}),this._parser.setExecuteHandlerFallback(f=>{this._logService.debug("Unknown EXECUTE code: ",{code:f})}),this._parser.setOscHandlerFallback((f,p,b)=>{this._logService.debug("Unknown OSC code: ",{identifier:f,action:p,data:b})}),this._parser.setDcsHandlerFallback((f,p,b)=>{p==="HOOK"&&(b=b.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(f),action:p,payload:b})}),this._parser.setPrintHandler((f,p,b)=>this.print(f,p,b)),this._parser.registerCsiHandler({final:"@"},f=>this.insertChars(f)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},f=>this.scrollLeft(f)),this._parser.registerCsiHandler({final:"A"},f=>this.cursorUp(f)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},f=>this.scrollRight(f)),this._parser.registerCsiHandler({final:"B"},f=>this.cursorDown(f)),this._parser.registerCsiHandler({final:"C"},f=>this.cursorForward(f)),this._parser.registerCsiHandler({final:"D"},f=>this.cursorBackward(f)),this._parser.registerCsiHandler({final:"E"},f=>this.cursorNextLine(f)),this._parser.registerCsiHandler({final:"F"},f=>this.cursorPrecedingLine(f)),this._parser.registerCsiHandler({final:"G"},f=>this.cursorCharAbsolute(f)),this._parser.registerCsiHandler({final:"H"},f=>this.cursorPosition(f)),this._parser.registerCsiHandler({final:"I"},f=>this.cursorForwardTab(f)),this._parser.registerCsiHandler({final:"J"},f=>this.eraseInDisplay(f,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},f=>this.eraseInDisplay(f,!0)),this._parser.registerCsiHandler({final:"K"},f=>this.eraseInLine(f,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},f=>this.eraseInLine(f,!0)),this._parser.registerCsiHandler({final:"L"},f=>this.insertLines(f)),this._parser.registerCsiHandler({final:"M"},f=>this.deleteLines(f)),this._parser.registerCsiHandler({final:"P"},f=>this.deleteChars(f)),this._parser.registerCsiHandler({final:"S"},f=>this.scrollUp(f)),this._parser.registerCsiHandler({final:"T"},f=>this.scrollDown(f)),this._parser.registerCsiHandler({final:"X"},f=>this.eraseChars(f)),this._parser.registerCsiHandler({final:"Z"},f=>this.cursorBackwardTab(f)),this._parser.registerCsiHandler({final:"`"},f=>this.charPosAbsolute(f)),this._parser.registerCsiHandler({final:"a"},f=>this.hPositionRelative(f)),this._parser.registerCsiHandler({final:"b"},f=>this.repeatPrecedingCharacter(f)),this._parser.registerCsiHandler({final:"c"},f=>this.sendDeviceAttributesPrimary(f)),this._parser.registerCsiHandler({prefix:">",final:"c"},f=>this.sendDeviceAttributesSecondary(f)),this._parser.registerCsiHandler({final:"d"},f=>this.linePosAbsolute(f)),this._parser.registerCsiHandler({final:"e"},f=>this.vPositionRelative(f)),this._parser.registerCsiHandler({final:"f"},f=>this.hVPosition(f)),this._parser.registerCsiHandler({final:"g"},f=>this.tabClear(f)),this._parser.registerCsiHandler({final:"h"},f=>this.setMode(f)),this._parser.registerCsiHandler({prefix:"?",final:"h"},f=>this.setModePrivate(f)),this._parser.registerCsiHandler({final:"l"},f=>this.resetMode(f)),this._parser.registerCsiHandler({prefix:"?",final:"l"},f=>this.resetModePrivate(f)),this._parser.registerCsiHandler({final:"m"},f=>this.charAttributes(f)),this._parser.registerCsiHandler({final:"n"},f=>this.deviceStatus(f)),this._parser.registerCsiHandler({prefix:"?",final:"n"},f=>this.deviceStatusPrivate(f)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},f=>this.softReset(f)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},f=>this.setCursorStyle(f)),this._parser.registerCsiHandler({final:"r"},f=>this.setScrollRegion(f)),this._parser.registerCsiHandler({final:"s"},f=>this.saveCursor(f)),this._parser.registerCsiHandler({final:"t"},f=>this.windowOptions(f)),this._parser.registerCsiHandler({final:"u"},f=>this.restoreCursor(f)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},f=>this.insertColumns(f)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},f=>this.deleteColumns(f)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},f=>this.selectProtected(f)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},f=>this.requestMode(f,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},f=>this.requestMode(f,!1)),this._parser.setExecuteHandler(ce.BEL,()=>this.bell()),this._parser.setExecuteHandler(ce.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(ce.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(ce.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(ce.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(ce.BS,()=>this.backspace()),this._parser.setExecuteHandler(ce.HT,()=>this.tab()),this._parser.setExecuteHandler(ce.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(ce.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(sh.IND,()=>this.index()),this._parser.setExecuteHandler(sh.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(sh.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new Nn(f=>(this.setTitle(f),this.setIconName(f),!0))),this._parser.registerOscHandler(1,new Nn(f=>this.setIconName(f))),this._parser.registerOscHandler(2,new Nn(f=>this.setTitle(f))),this._parser.registerOscHandler(4,new Nn(f=>this.setOrReportIndexedColor(f))),this._parser.registerOscHandler(8,new Nn(f=>this.setHyperlink(f))),this._parser.registerOscHandler(10,new Nn(f=>this.setOrReportFgColor(f))),this._parser.registerOscHandler(11,new Nn(f=>this.setOrReportBgColor(f))),this._parser.registerOscHandler(12,new Nn(f=>this.setOrReportCursorColor(f))),this._parser.registerOscHandler(104,new Nn(f=>this.restoreIndexedColor(f))),this._parser.registerOscHandler(110,new Nn(f=>this.restoreFgColor(f))),this._parser.registerOscHandler(111,new Nn(f=>this.restoreBgColor(f))),this._parser.registerOscHandler(112,new Nn(f=>this.restoreCursorColor(f))),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 f in pi)this._parser.registerEscHandler({intermediates:"(",final:f},()=>this.selectCharset("("+f)),this._parser.registerEscHandler({intermediates:")",final:f},()=>this.selectCharset(")"+f)),this._parser.registerEscHandler({intermediates:"*",final:f},()=>this.selectCharset("*"+f)),this._parser.registerEscHandler({intermediates:"+",final:f},()=>this.selectCharset("+"+f)),this._parser.registerEscHandler({intermediates:"-",final:f},()=>this.selectCharset("-"+f)),this._parser.registerEscHandler({intermediates:".",final:f},()=>this.selectCharset("."+f)),this._parser.registerEscHandler({intermediates:"/",final:f},()=>this.selectCharset("/"+f));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(f=>(this._logService.error("Parsing error: ",f),f)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new $w((f,p)=>this.requestStatusString(f,p)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,i,s){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=i,this._parseStack.position=s}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,i)=>setTimeout(()=>i("#SLOW_TIMEOUT"),Vw))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${Vw} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let i,s=this._activeBuffer.x,a=this._activeBuffer.y,o=0,u=this._parseStack.paused;if(u){if(i=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(i),i;s=this._parseStack.cursorStartX,a=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>Wr&&(o=this._parseStack.position+Wr)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,f=>String.fromCharCode(f)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(f=>f.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<Wr&&(this._parseBuffer=new Uint32Array(Math.min(e.length,Wr))),u||this._dirtyRowTracker.clearRange(),e.length>Wr)for(let f=o;f<e.length;f+=Wr){let p=f+Wr<e.length?f+Wr:e.length,b=typeof e=="string"?this._stringDecoder.decode(e.substring(f,p),this._parseBuffer):this._utf8Decoder.decode(e.subarray(f,p),this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,b))return this._preserveStack(s,a,b,f),this._logSlowResolvingAsync(i),i}else if(!u){let f=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,f))return this._preserveStack(s,a,f,0),this._logSlowResolvingAsync(i),i}(this._activeBuffer.x!==s||this._activeBuffer.y!==a)&&this._onCursorMove.fire();let h=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(h,this._bufferService.rows-1)})}print(e,t,i){let s,a,o=this._charsetService.charset,u=this._optionsService.rawOptions.screenReaderMode,h=this._bufferService.cols,m=this._coreService.decPrivateModes.wraparound,f=this._coreService.modes.insertMode,p=this._curAttrData,b=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&i-t>0&&b.getWidth(this._activeBuffer.x-1)===2&&b.setCellFromCodepoint(this._activeBuffer.x-1,0,1,p);let _=this._parser.precedingJoinState;for(let x=t;x<i;++x){if(s=e[x],s<127&&o){let C=o[String.fromCharCode(s)];C&&(s=C.charCodeAt(0))}let y=this._unicodeService.charProperties(s,_);a=Ia.extractWidth(y);let S=Ia.extractShouldJoin(y),E=S?Ia.extractWidth(_):0;if(_=y,u&&this._onA11yChar.fire(Xr(s)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+a-E>h){if(m){let C=b,A=this._activeBuffer.x-E;for(this._activeBuffer.x=E,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),b=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),E>0&&b instanceof Cc&&b.copyCellsFrom(C,A,0,E,!1);A<h;)C.setCellFromCodepoint(A++,0,1,p)}else if(this._activeBuffer.x=h-1,a===2)continue}if(S&&this._activeBuffer.x){let C=b.getWidth(this._activeBuffer.x-1)?1:2;b.addCodepointToCell(this._activeBuffer.x-C,s,a);for(let A=a-E;--A>=0;)b.setCellFromCodepoint(this._activeBuffer.x++,0,0,p);continue}if(f&&(b.insertCells(this._activeBuffer.x,a-E,this._activeBuffer.getNullCell(p)),b.getWidth(h-1)===2&&b.setCellFromCodepoint(h-1,0,1,p)),b.setCellFromCodepoint(this._activeBuffer.x++,s,a,p),a>0)for(;--a;)b.setCellFromCodepoint(this._activeBuffer.x++,0,0,p)}this._parser.precedingJoinState=_,this._activeBuffer.x<h&&i-t>0&&b.getWidth(this._activeBuffer.x)===0&&!b.hasContent(this._activeBuffer.x)&&b.setCellFromCodepoint(this._activeBuffer.x,0,1,p),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,i=>Fw(i.params[0],this._optionsService.rawOptions.windowOptions)?t(i):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new $w(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new Nn(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,i,s=!1,a=!1){let o=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);o.replaceCells(t,i,this._activeBuffer.getNullCell(this._eraseAttrData()),a),s&&(o.isWrapped=!1)}_resetBufferLine(e,t=!1){let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i&&(i.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),i.isWrapped=!1)}eraseInDisplay(e,t=!1){this._restrictCursor(this._bufferService.cols);let i;switch(e.params[0]){case 0:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);i<this._bufferService.rows;i++)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(i);break;case 1:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(i+1).isWrapped=!1);i--;)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(i=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,i-1);i--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+i)?.getTrimmedLength(););for(;i>=0;i--)this._bufferService.scroll(this._eraseAttrData())}else{for(i=this._bufferService.rows,this._dirtyRowTracker.markDirty(i-1);i--;)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let s=this._activeBuffer.lines.length-this._bufferService.rows;s>0&&(this._activeBuffer.lines.trimStart(s),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-s,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-s,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 i=this._activeBuffer.ybase+this._activeBuffer.y,s=this._bufferService.rows-1-this._activeBuffer.scrollBottom,a=this._bufferService.rows-1+this._activeBuffer.ybase-s+1;for(;t--;)this._activeBuffer.lines.splice(a-1,1),this._activeBuffer.lines.splice(i,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(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 i=this._activeBuffer.ybase+this._activeBuffer.y,s;for(s=this._bufferService.rows-1-this._activeBuffer.scrollBottom,s=this._bufferService.rows-1+this._activeBuffer.ybase-s;t--;)this._activeBuffer.lines.splice(i,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}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(ni));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 i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);s.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.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 i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);s.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.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 i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);s.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.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 i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);s.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),s.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 i=e.params[0]||1,s=Ia.extractWidth(t),a=this._activeBuffer.x-s,o=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(a),u=new Uint32Array(o.length*i),h=0;for(let f=0;f<o.length;){let p=o.codePointAt(f)||0;u[h++]=p,f+=p>65535?2:1}let m=h;for(let f=1;f<i;++f)u.copyWithin(m,0,h),m+=h;return this.print(u,0,m),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(ce.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(ce.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(ce.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(ce.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(ce.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 i;(S=>(S[S.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",S[S.SET=1]="SET",S[S.RESET=2]="RESET",S[S.PERMANENTLY_SET=3]="PERMANENTLY_SET",S[S.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(i||={});let s=this._coreService.decPrivateModes,{activeProtocol:a,activeEncoding:o}=this._coreMouseService,u=this._coreService,{buffers:h,cols:m}=this._bufferService,{active:f,alt:p}=h,b=this._optionsService.rawOptions,_=(S,E)=>(u.triggerDataEvent(`${ce.ESC}[${t?"":"?"}${S};${E}$y`),!0),x=S=>S?1:2,y=e.params[0];return t?y===2?_(y,4):y===4?_(y,x(u.modes.insertMode)):y===12?_(y,3):y===20?_(y,x(b.convertEol)):_(y,0):y===1?_(y,x(s.applicationCursorKeys)):y===3?_(y,b.windowOptions.setWinLines?m===80?2:m===132?1:0:0):y===6?_(y,x(s.origin)):y===7?_(y,x(s.wraparound)):y===8?_(y,3):y===9?_(y,x(a==="X10")):y===12?_(y,x(b.cursorBlink)):y===25?_(y,x(!u.isCursorHidden)):y===45?_(y,x(s.reverseWraparound)):y===66?_(y,x(s.applicationKeypad)):y===67?_(y,4):y===1e3?_(y,x(a==="VT200")):y===1002?_(y,x(a==="DRAG")):y===1003?_(y,x(a==="ANY")):y===1004?_(y,x(s.sendFocus)):y===1005?_(y,4):y===1006?_(y,x(o==="SGR")):y===1015?_(y,4):y===1016?_(y,x(o==="SGR_PIXELS")):y===1048?_(y,1):y===47||y===1047||y===1049?_(y,x(f===p)):y===2004?_(y,x(s.bracketedPasteMode)):y===2026?_(y,x(s.synchronizedOutput)):_(y,0)}_updateAttrColor(e,t,i,s,a){return t===2?(e|=50331648,e&=-16777216,e|=ou.fromColorRGB([i,s,a])):t===5&&(e&=-50331904,e|=33554432|i&255),e}_extractColor(e,t,i){let s=[0,0,-1,0,0,0],a=0,o=0;do{if(s[o+a]=e.params[t+o],e.hasSubParams(t+o)){let u=e.getSubParams(t+o),h=0;do s[1]===5&&(a=1),s[o+h+1+a]=u[h];while(++h<u.length&&h+o+1+a<s.length);break}if(s[1]===5&&o+a>=2||s[1]===2&&o+a>=5)break;s[1]&&(a=1)}while(++o+t<e.length&&o+a<s.length);for(let u=2;u<s.length;++u)s[u]===-1&&(s[u]=0);switch(s[0]){case 38:i.fg=this._updateAttrColor(i.fg,s[1],s[3],s[4],s[5]);break;case 48:i.bg=this._updateAttrColor(i.bg,s[1],s[3],s[4],s[5]);break;case 58:i.extended=i.extended.clone(),i.extended.underlineColor=this._updateAttrColor(i.extended.underlineColor,s[1],s[3],s[4],s[5])}return o}_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=ni.fg,e.bg=ni.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,i,s=this._curAttrData;for(let a=0;a<t;a++)i=e.params[a],i>=30&&i<=37?(s.fg&=-50331904,s.fg|=16777216|i-30):i>=40&&i<=47?(s.bg&=-50331904,s.bg|=16777216|i-40):i>=90&&i<=97?(s.fg&=-50331904,s.fg|=16777216|i-90|8):i>=100&&i<=107?(s.bg&=-50331904,s.bg|=16777216|i-100|8):i===0?this._processSGR0(s):i===1?s.fg|=134217728:i===3?s.bg|=67108864:i===4?(s.fg|=268435456,this._processUnderline(e.hasSubParams(a)?e.getSubParams(a)[0]:1,s)):i===5?s.fg|=536870912:i===7?s.fg|=67108864:i===8?s.fg|=1073741824:i===9?s.fg|=2147483648:i===2?s.bg|=134217728:i===21?this._processUnderline(2,s):i===22?(s.fg&=-134217729,s.bg&=-134217729):i===23?s.bg&=-67108865:i===24?(s.fg&=-268435457,this._processUnderline(0,s)):i===25?s.fg&=-536870913:i===27?s.fg&=-67108865:i===28?s.fg&=-1073741825:i===29?s.fg&=2147483647:i===39?(s.fg&=-67108864,s.fg|=ni.fg&16777215):i===49?(s.bg&=-67108864,s.bg|=ni.bg&16777215):i===38||i===48||i===58?a+=this._extractColor(e,a,s):i===53?s.bg|=1073741824:i===55?s.bg&=-1073741825:i===59?(s.extended=s.extended.clone(),s.extended.underlineColor=-1,s.updateExtended()):i===100?(s.fg&=-67108864,s.fg|=ni.fg&16777215,s.bg&=-67108864,s.bg|=ni.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",i);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${ce.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${ce.ESC}[${t};${i}R`);break}return!0}deviceStatusPrivate(e){if(e.params[0]===6){let t=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${ce.ESC}[?${t};${i}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=ni.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 i=t%2===1;this._coreService.decPrivateModes.cursorBlink=i}return!0}setScrollRegion(e){let t=e.params[0]||1,i;return(e.length<2||(i=e.params[1])>this._bufferService.rows||i===0)&&(i=this._bufferService.rows),i>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=i-1,this._setCursor(0,0)),!0}windowOptions(e){if(!Fw(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(`${ce.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>Hw&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>Hw&&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=[],i=e.split(";");for(;i.length>1;){let s=i.shift(),a=i.shift();if(/^\d+$/.exec(s)){let o=parseInt(s);if(Kw(o))if(a==="?")t.push({type:0,index:o});else{let u=Uw(a);u&&t.push({type:1,index:o,color:u})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let i=e.slice(0,t).trim(),s=e.slice(t+1);return s?this._createHyperlink(i,s):i.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let i=e.split(":"),s,a=i.findIndex(o=>o.startsWith("id="));return a!==-1&&(s=i[a].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:s,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 i=e.split(";");for(let s=0;s<i.length&&!(t>=this._specialColors.length);++s,++t)if(i[s]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let a=Uw(i[s]);a&&this._onColor.fire([{type:1,index:this._specialColors[t],color:a}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],i=e.split(";");for(let s=0;s<i.length;++s)if(/^\d+$/.exec(i[s])){let a=parseInt(i[s]);Kw(a)&&t.push({type:2,index:a})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,Oa),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(d$[e[0]],pi[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=ni.clone(),this._eraseAttrDataInternal=ni.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 Gn;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 i=this._activeBuffer.ybase+this._activeBuffer.y+t,s=this._activeBuffer.lines.get(i);s&&(s.fill(e),s.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let i=u=>(this._coreService.triggerDataEvent(`${ce.ESC}${u}${ce.ESC}\\`),!0),s=this._bufferService.buffer,a=this._optionsService.rawOptions;return i(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${s.scrollTop+1};${s.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[a.cursorStyle]-(a.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},K0=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&&(qw=e,e=t,t=qw),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};K0=Vt([Se(0,en)],K0);function Kw(e){return 0<=e&&e<256}var f$=5e7,Gw=12,m$=50,p$=class extends Ye{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 be),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 i;for(;i=this._writeBuffer.shift();){this._action(i);let s=this._callbacks.shift();s&&s()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>f$)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 i=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let s=this._writeBuffer[this._bufferOffset],a=this._action(s,t);if(a){let u=h=>performance.now()-i>=Gw?setTimeout(()=>this._innerWrite(0,h)):this._innerWrite(i,h);a.catch(h=>(queueMicrotask(()=>{throw h}),Promise.resolve(!1))).then(u);return}let o=this._callbacks[this._bufferOffset];if(o&&o(),this._bufferOffset++,this._pendingData-=s.length,performance.now()-i>=Gw)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>m$&&(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()}},G0=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 h=t.addMarker(t.ybase+t.y),m={data:e,id:this._nextId++,lines:[h]};return h.onDispose(()=>this._removeMarkerFromLink(m,h)),this._dataByLinkId.set(m.id,m),m.id}let i=e,s=this._getEntryIdKey(i),a=this._entriesWithId.get(s);if(a)return this.addLineToLink(a.id,t.ybase+t.y),a.id;let o=t.addMarker(t.ybase+t.y),u={id:this._nextId++,key:this._getEntryIdKey(i),data:i,lines:[o]};return o.onDispose(()=>this._removeMarkerFromLink(u,o)),this._entriesWithId.set(u.key,u),this._dataByLinkId.set(u.id,u),u.id}addLineToLink(e,t){let i=this._dataByLinkId.get(e);if(i&&i.lines.every(s=>s.line!==t)){let s=this._bufferService.buffer.addMarker(t);i.lines.push(s),s.onDispose(()=>this._removeMarkerFromLink(i,s))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let i=e.lines.indexOf(t);i!==-1&&(e.lines.splice(i,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};G0=Vt([Se(0,en)],G0);var Ww=!1,g$=class extends Ye{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new il),this._onBinary=this._register(new be),this.onBinary=this._onBinary.event,this._onData=this._register(new be),this.onData=this._onData.event,this._onLineFeed=this._register(new be),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new be),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new be),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new be),this._instantiationService=new $P,this.optionsService=this._register(new XP(e)),this._instantiationService.setService(tn,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(H0)),this._instantiationService.setService(en,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(U0)),this._instantiationService.setService(gN,this._logService),this.coreService=this._register(this._instantiationService.createInstance(F0)),this._instantiationService.setService(Za,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(V0)),this._instantiationService.setService(pN,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Ia)),this._instantiationService.setService(Bz,this.unicodeService),this._charsetService=this._instantiationService.createInstance(t$),this._instantiationService.setService(Lz,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(G0),this._instantiationService.setService(bN,this._oscLinkService),this._inputHandler=this._register(new h$(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(Ri.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(Ri.forward(this._bufferService.onResize,this._onResize)),this._register(Ri.forward(this.coreService.onData,this._onData)),this._register(Ri.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 p$((t,i)=>this._inputHandler.parse(t,i))),this._register(Ri.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new be),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&&!Ww&&(this._logService.warn("writeSync is unreliable and will be removed soon."),Ww=!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,YN),t=Math.max(t,XN),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(Pw.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(Pw(this._bufferService),!1))),this._windowsWrappingHeuristics.value=Ot(()=>{for(let t of e)t.dispose()})}}},b$={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 v$(e,t,i,s){let a={type:0,cancel:!1,key:void 0},o=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?a.key=ce.ESC+"OA":a.key=ce.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?a.key=ce.ESC+"OD":a.key=ce.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?a.key=ce.ESC+"OC":a.key=ce.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?a.key=ce.ESC+"OB":a.key=ce.ESC+"[B");break;case 8:a.key=e.ctrlKey?"\b":ce.DEL,e.altKey&&(a.key=ce.ESC+a.key);break;case 9:if(e.shiftKey){a.key=ce.ESC+"[Z";break}a.key=ce.HT,a.cancel=!0;break;case 13:a.key=e.altKey?ce.ESC+ce.CR:ce.CR,a.cancel=!0;break;case 27:a.key=ce.ESC,e.altKey&&(a.key=ce.ESC+ce.ESC),a.cancel=!0;break;case 37:if(e.metaKey)break;o?a.key=ce.ESC+"[1;"+(o+1)+"D":t?a.key=ce.ESC+"OD":a.key=ce.ESC+"[D";break;case 39:if(e.metaKey)break;o?a.key=ce.ESC+"[1;"+(o+1)+"C":t?a.key=ce.ESC+"OC":a.key=ce.ESC+"[C";break;case 38:if(e.metaKey)break;o?a.key=ce.ESC+"[1;"+(o+1)+"A":t?a.key=ce.ESC+"OA":a.key=ce.ESC+"[A";break;case 40:if(e.metaKey)break;o?a.key=ce.ESC+"[1;"+(o+1)+"B":t?a.key=ce.ESC+"OB":a.key=ce.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(a.key=ce.ESC+"[2~");break;case 46:o?a.key=ce.ESC+"[3;"+(o+1)+"~":a.key=ce.ESC+"[3~";break;case 36:o?a.key=ce.ESC+"[1;"+(o+1)+"H":t?a.key=ce.ESC+"OH":a.key=ce.ESC+"[H";break;case 35:o?a.key=ce.ESC+"[1;"+(o+1)+"F":t?a.key=ce.ESC+"OF":a.key=ce.ESC+"[F";break;case 33:e.shiftKey?a.type=2:e.ctrlKey?a.key=ce.ESC+"[5;"+(o+1)+"~":a.key=ce.ESC+"[5~";break;case 34:e.shiftKey?a.type=3:e.ctrlKey?a.key=ce.ESC+"[6;"+(o+1)+"~":a.key=ce.ESC+"[6~";break;case 112:o?a.key=ce.ESC+"[1;"+(o+1)+"P":a.key=ce.ESC+"OP";break;case 113:o?a.key=ce.ESC+"[1;"+(o+1)+"Q":a.key=ce.ESC+"OQ";break;case 114:o?a.key=ce.ESC+"[1;"+(o+1)+"R":a.key=ce.ESC+"OR";break;case 115:o?a.key=ce.ESC+"[1;"+(o+1)+"S":a.key=ce.ESC+"OS";break;case 116:o?a.key=ce.ESC+"[15;"+(o+1)+"~":a.key=ce.ESC+"[15~";break;case 117:o?a.key=ce.ESC+"[17;"+(o+1)+"~":a.key=ce.ESC+"[17~";break;case 118:o?a.key=ce.ESC+"[18;"+(o+1)+"~":a.key=ce.ESC+"[18~";break;case 119:o?a.key=ce.ESC+"[19;"+(o+1)+"~":a.key=ce.ESC+"[19~";break;case 120:o?a.key=ce.ESC+"[20;"+(o+1)+"~":a.key=ce.ESC+"[20~";break;case 121:o?a.key=ce.ESC+"[21;"+(o+1)+"~":a.key=ce.ESC+"[21~";break;case 122:o?a.key=ce.ESC+"[23;"+(o+1)+"~":a.key=ce.ESC+"[23~";break;case 123:o?a.key=ce.ESC+"[24;"+(o+1)+"~":a.key=ce.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?a.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?a.key=ce.NUL:e.keyCode>=51&&e.keyCode<=55?a.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?a.key=ce.DEL:e.keyCode===219?a.key=ce.ESC:e.keyCode===220?a.key=ce.FS:e.keyCode===221&&(a.key=ce.GS);else if((!i||s)&&e.altKey&&!e.metaKey){let u=b$[e.keyCode]?.[e.shiftKey?1:0];if(u)a.key=ce.ESC+u;else if(e.keyCode>=65&&e.keyCode<=90){let h=e.ctrlKey?e.keyCode-64:e.keyCode+32,m=String.fromCharCode(h);e.shiftKey&&(m=m.toUpperCase()),a.key=ce.ESC+m}else if(e.keyCode===32)a.key=ce.ESC+(e.ctrlKey?ce.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let h=e.code.slice(3,4);e.shiftKey||(h=h.toLowerCase()),a.key=ce.ESC+h,a.cancel=!0}}else i&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(a.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?a.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(a.key=ce.US),e.key==="@"&&(a.key=ce.NUL));break}return a}var Xt=0,_$=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new jh,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new jh,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((a,o)=>this._getKey(a)-this._getKey(o)),t=0,i=0,s=new Array(this._array.length+this._insertedValues.length);for(let a=0;a<s.length;a++)i>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[i])?(s[a]=e[t],t++):s[a]=this._array[i++];this._array=s,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||(Xt=this._search(t),Xt===-1)||this._getKey(this._array[Xt])!==t)return!1;do if(this._array[Xt]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(Xt),!0;while(++Xt<this._array.length&&this._getKey(this._array[Xt])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((a,o)=>a-o),t=0,i=new Array(this._array.length-e.length),s=0;for(let a=0;a<this._array.length;a++)e[t]===a?t++:i[s++]=this._array[a];this._array=i,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&&(Xt=this._search(e),!(Xt<0||Xt>=this._array.length)&&this._getKey(this._array[Xt])===e))do yield this._array[Xt];while(++Xt<this._array.length&&this._getKey(this._array[Xt])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Xt=this._search(e),!(Xt<0||Xt>=this._array.length)&&this._getKey(this._array[Xt])===e))do t(this._array[Xt]);while(++Xt<this._array.length&&this._getKey(this._array[Xt])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,i=this._array.length-1;for(;i>=t;){let s=t+i>>1,a=this._getKey(this._array[s]);if(a>e)i=s-1;else if(a<e)t=s+1;else{for(;s>0&&this._getKey(this._array[s-1])===e;)s--;return s}}return t}},Gp=0,Yw=0,x$=class extends Ye{constructor(){super(),this._decorations=new _$(e=>e?.marker.line),this._onDecorationRegistered=this._register(new be),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new be),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(Ot(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new y$(e);if(t){let i=t.marker.onDispose(()=>t.dispose()),s=t.onDispose(()=>{s.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),i.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,i){let s=0,a=0;for(let o of this._decorations.getKeyIterator(t))s=o.options.x??0,a=s+(o.options.width??1),e>=s&&e<a&&(!i||(o.options.layer??"bottom")===i)&&(yield o)}forEachDecorationAtCell(e,t,i,s){this._decorations.forEachByKey(t,a=>{Gp=a.options.x??0,Yw=Gp+(a.options.width??1),e>=Gp&&e<Yw&&(!i||(a.options.layer??"bottom")===i)&&s(a)})}},y$=class extends Jr{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new be),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new be),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=Pt.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=Pt.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},S$=1e3,w$=class{constructor(e,t=S$){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,i){this._rowCount=i,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 s=performance.now();if(s-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=s,this._innerRefresh();else if(!this._additionalRefreshRequested){let a=s-this._lastRefreshMs,o=this._debounceThresholdMS-a;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},o)}}_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)}},Xw=20,Dh=class extends Ye{constructor(e,t,i,s){super(),this._terminal=e,this._coreBrowserService=i,this._renderService=s,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let a=this._coreBrowserService.mainDocument;this._accessibilityContainer=a.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=a.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let o=0;o<this._terminal.rows;o++)this._rowElements[o]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[o]);if(this._topBoundaryFocusListener=o=>this._handleBoundaryFocus(o,0),this._bottomBoundaryFocusListener=o=>this._handleBoundaryFocus(o,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=a.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new w$(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(o=>this._handleResize(o.rows))),this._register(this._terminal.onRender(o=>this._refreshRows(o.start,o.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(o=>this._handleChar(o))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
151
|
-
`))),this._register(this._terminal.onA11yTab(o=>this._handleTab(o))),this._register(this._terminal.onKey(o=>this._handleKey(o.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(Ue(a,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(Ot(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<Xw+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
152
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===Xw+1&&(this._liveRegion.textContent+=f0.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 i=this._terminal.buffer,s=i.lines.length.toString();for(let a=e;a<=t;a++){let o=i.lines.get(i.ydisp+a),u=[],h=o?.translateToString(!0,void 0,void 0,u)||"",m=(i.ydisp+a+1).toString(),f=this._rowElements[a];f&&(h.length===0?(f.textContent=" ",this._rowColumns.set(f,[0,1])):(f.textContent=h,this._rowColumns.set(f,u)),f.setAttribute("aria-posinset",m),f.setAttribute("aria-setsize",s),this._alignRowWidth(f))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let i=e.target,s=this._rowElements[t===0?1:this._rowElements.length-2],a=i.getAttribute("aria-posinset"),o=t===0?"1":`${this._terminal.buffer.lines.length}`;if(a===o||e.relatedTarget!==s)return;let u,h;if(t===0?(u=i,h=this._rowElements.pop(),this._rowContainer.removeChild(h)):(u=this._rowElements.shift(),h=i,this._rowContainer.removeChild(u)),u.removeEventListener("focus",this._topBoundaryFocusListener),h.removeEventListener("focus",this._bottomBoundaryFocusListener),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},i={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(i.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===i.node&&t.offset>i.offset)&&([t,i]=[i,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 s=this._rowElements.slice(-1)[0];if(i.node.compareDocumentPosition(s)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(i={node:s,offset:s.textContent?.length??0}),!this._rowContainer.contains(i.node))return;let a=({node:h,offset:m})=>{let f=h instanceof Text?h.parentNode:h,p=parseInt(f?.getAttribute("aria-posinset"),10)-1;if(isNaN(p))return console.warn("row is invalid. Race condition?"),null;let b=this._rowColumns.get(f);if(!b)return console.warn("columns is null. Race condition?"),null;let _=m<b.length?b[m]:b.slice(-1)[0]+1;return _>=this._terminal.cols&&(++p,_=0),{row:p,column:_}},o=a(t),u=a(i);if(!(!o||!u)){if(o.row>u.row||o.row===u.row&&o.column>=u.column)throw new Error("invalid range");this._terminal.select(o.column,o.row,(u.row-o.row)*this._terminal.cols-o.column+u.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){e.style.transform="";let t=e.getBoundingClientRect().width,i=this._rowColumns.get(e)?.slice(-1)?.[0];if(!i)return;let s=i*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${s/t})`}};Dh=Vt([Se(1,ev),Se(2,hr),Se(3,fr)],Dh);var W0=class extends Ye{constructor(e,t,i,s,a){super(),this._element=e,this._mouseService=t,this._renderService=i,this._bufferService=s,this._linkProviderService=a,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new be),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new be),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(Ot(()=>{qa(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(Ue(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Ue(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(Ue(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(Ue(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 i=e.composedPath();for(let s=0;s<i.length;s++){let a=i[s];if(a.classList.contains("xterm"))break;if(a.classList.contains("xterm-hover"))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){(!this._activeProviderReplies||!t)&&(this._activeProviderReplies?.forEach(s=>{s?.forEach(a=>{a.link.dispose&&a.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let i=!1;for(let[s,a]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(s)&&(i=this._checkLinkProviderResult(s,e,i)):a.provideLinks(e.y,o=>{if(this._isMouseOut)return;let u=o?.map(h=>({link:h}));this._activeProviderReplies?.set(s,u),i=this._checkLinkProviderResult(s,e,i),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let i=new Set;for(let s=0;s<t.size;s++){let a=t.get(s);if(a)for(let o=0;o<a.length;o++){let u=a[o],h=u.link.range.start.y<e?0:u.link.range.start.x,m=u.link.range.end.y>e?this._bufferService.cols:u.link.range.end.x;for(let f=h;f<=m;f++){if(i.has(f)){a.splice(o--,1);break}i.add(f)}}}}_checkLinkProviderResult(e,t,i){if(!this._activeProviderReplies)return i;let s=this._activeProviderReplies.get(e),a=!1;for(let o=0;o<e;o++)(!this._activeProviderReplies.has(o)||this._activeProviderReplies.get(o))&&(a=!0);if(!a&&s){let o=s.find(u=>this._linkAtPosition(u.link,t));o&&(i=!0,this._handleNewLink(o))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!i)for(let o=0;o<this._activeProviderReplies.size;o++){let u=this._activeProviderReplies.get(o)?.find(h=>this._linkAtPosition(h.link,t));if(u){i=!0,this._handleNewLink(u);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&k$(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,qa(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:i=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==i&&(this._currentLink.state.decorations.pointerCursor=i,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",i))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:i=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==i&&(this._currentLink.state.decorations.underline=i,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,i))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(i=>{if(!this._currentLink)return;let s=i.start===0?0:i.start+1+this._bufferService.buffer.ydisp,a=this._bufferService.buffer.ydisp+1+i.end;if(this._currentLink.link.range.start.y>=s&&this._currentLink.link.range.end.y<=a&&(this._clearCurrentLink(s,a),this._lastMouseEvent)){let o=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);o&&this._askForLink(o,!1)}})))}_linkHover(e,t,i){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(i,t.text)}_fireUnderlineEvent(e,t){let i=e.range,s=this._bufferService.buffer.ydisp,a=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-s-1,i.end.x,i.end.y-s-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(a)}_linkLeave(e,t,i){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(i,t.text)}_linkAtPosition(e,t){let i=e.range.start.y*this._bufferService.cols+e.range.start.x,s=e.range.end.y*this._bufferService.cols+e.range.end.x,a=t.y*this._bufferService.cols+t.x;return i<=a&&a<=s}_positionFromMouseEvent(e,t,i){let s=i.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(s)return{x:s[0],y:s[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,i,s,a){return{x1:e,y1:t,x2:i,y2:s,cols:this._bufferService.cols,fg:a}}};W0=Vt([Se(1,tv),Se(2,fr),Se(3,en),Se(4,_N)],W0);function k$(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 E$=class extends g${constructor(e={}){super(e),this._linkifier=this._register(new il),this.browser=IN,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new il),this._onCursorMove=this._register(new be),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new be),this.onKey=this._onKey.event,this._onRender=this._register(new be),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new be),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new be),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new be),this.onBell=this._onBell.event,this._onFocus=this._register(new be),this._onBlur=this._register(new be),this._onA11yCharEmitter=this._register(new be),this._onA11yTabEmitter=this._register(new be),this._onWillOpen=this._register(new be),this._setup(),this._decorationService=this._instantiationService.createInstance(x$),this._instantiationService.setService(lu,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(mP),this._instantiationService.setService(_N,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(p0)),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(Ri.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(Ri.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(Ri.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(Ri.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(Ot(()=>{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 i,s="";switch(t.index){case 256:i="foreground",s="10";break;case 257:i="background",s="11";break;case 258:i="cursor",s="12";break;default:i="ansi",s="4;"+t.index}switch(t.type){case 0:let a=Mt.toColorRGB(i==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[i]);this.coreService.triggerDataEvent(`${ce.ESC}]${s};${u$(a)}${BN.ST}`);break;case 1:if(i==="ansi")this._themeService.modifyColors(o=>o.ansi[t.index]=ai.toColor(...t.color));else{let o=i;this._themeService.modifyColors(u=>u[o]=ai.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(Dh,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ce.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ce.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let i=Math.min(this.buffer.x,this.cols-1),s=this._renderService.dimensions.css.cell.height,a=t.getWidth(i),o=this._renderService.dimensions.css.cell.width*a,u=this.buffer.y*this._renderService.dimensions.css.cell.height,h=i*this._renderService.dimensions.css.cell.width;this.textarea.style.left=h+"px",this.textarea.style.top=u+"px",this.textarea.style.width=o+"px",this.textarea.style.height=s+"px",this.textarea.style.lineHeight=s+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(Ue(this.element,"copy",t=>{this.hasSelection()&&Az(t,this._selectionService)}));let e=t=>Mz(t,this.textarea,this.coreService,this.optionsService);this._register(Ue(this.textarea,"paste",e)),this._register(Ue(this.element,"paste",e)),PN?this._register(Ue(this.element,"mousedown",t=>{t.button===2&&aw(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Ue(this.element,"contextmenu",t=>{aw(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),cv&&this._register(Ue(this.element,"auxclick",t=>{t.button===1&&uN(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Ue(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(Ue(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(Ue(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(Ue(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(Ue(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(Ue(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(Ue(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(Ue(this.screenElement,"mousemove",a=>this.updateCursorStyle(a))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let i=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",h0.get()),HN||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",()=>i.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(hP,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(hr,this._coreBrowserService),this._register(Ue(this.textarea,"focus",a=>this._handleTextAreaFocus(a))),this._register(Ue(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(B0,this._document,this._helperContainer),this._instantiationService.setService(Qh,this._charSizeService),this._themeService=this._instantiationService.createInstance($0),this._instantiationService.setService(dl,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(Mh),this._instantiationService.setService(vN,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(I0,this.rows,this.screenElement)),this._instantiationService.setService(fr,this._renderService),this._register(this._renderService.onRenderedViewportChange(a=>this._onRender.fire(a))),this.onResize(a=>this._renderService.resize(a.cols,a.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(D0,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(z0),this._instantiationService.setService(tv,this._mouseService);let s=this._linkifier.value=this._register(this._instantiationService.createInstance(W0,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(R0,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(a=>{super.scrollLines(a,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(P0,this.element,this.screenElement,s)),this._instantiationService.setService(Iz,this._selectionService),this._register(this._selectionService.onRequestScrollLines(a=>this.scrollLines(a.amount,a.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(a=>this._renderService.handleSelectionChanged(a.start,a.end,a.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(a=>{this.textarea.value=a,this.textarea.focus(),this.textarea.select()})),this._register(Ri.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(j0,this.screenElement)),this._register(Ue(this.element,"mousedown",a=>this._selectionService.handleMouseDown(a))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(Dh,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",a=>this._handleScreenReaderModeOptionChange(a))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Ah,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",a=>{!this._overviewRulerRenderer&&a&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Ah,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(L0,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function i(o){let u=e._mouseService.getMouseReportCoords(o,e.screenElement);if(!u)return!1;let h,m;switch(o.overrideType||o.type){case"mousemove":m=32,o.buttons===void 0?(h=3,o.button!==void 0&&(h=o.button<3?o.button:3)):h=o.buttons&1?0:o.buttons&4?1:o.buttons&2?2:3;break;case"mouseup":m=0,h=o.button<3?o.button:3;break;case"mousedown":m=1,h=o.button<3?o.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(o)===!1)return!1;let f=o.deltaY;if(f===0||e.coreMouseService.consumeWheelEvent(o,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;m=f<0?0:1,h=4;break;default:return!1}return m===void 0||h===void 0||h>4?!1:e.coreMouseService.triggerMouseEvent({col:u.col,row:u.row,x:u.x,y:u.y,button:h,action:m,ctrl:o.ctrlKey,alt:o.altKey,shift:o.shiftKey})}let s={mouseup:null,wheel:null,mousedrag:null,mousemove:null},a={mouseup:o=>(i(o),o.buttons||(this._document.removeEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.removeEventListener("mousemove",s.mousedrag)),this.cancel(o)),wheel:o=>(i(o),this.cancel(o,!0)),mousedrag:o=>{o.buttons&&i(o)},mousemove:o=>{o.buttons||i(o)}};this._register(this.coreMouseService.onProtocolChange(o=>{o?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(o)),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()),o&8?s.mousemove||(t.addEventListener("mousemove",a.mousemove),s.mousemove=a.mousemove):(t.removeEventListener("mousemove",s.mousemove),s.mousemove=null),o&16?s.wheel||(t.addEventListener("wheel",a.wheel,{passive:!1}),s.wheel=a.wheel):(t.removeEventListener("wheel",s.wheel),s.wheel=null),o&2?s.mouseup||(s.mouseup=a.mouseup):(this._document.removeEventListener("mouseup",s.mouseup),s.mouseup=null),o&4?s.mousedrag||(s.mousedrag=a.mousedrag):(this._document.removeEventListener("mousemove",s.mousedrag),s.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Ue(t,"mousedown",o=>{if(o.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(o)))return i(o),s.mouseup&&this._document.addEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.addEventListener("mousemove",s.mousedrag),this.cancel(o)})),this._register(Ue(t,"wheel",o=>{if(!s.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(o)===!1)return!1;if(!this.buffer.hasScrollback){if(o.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(o,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(o,!0);let u=ce.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(o.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(u,!0),this.cancel(o,!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){cN(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,i){this._selectionService.setSelection(e,t,i)}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 i=v$(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),i.type===3||i.type===2){let s=this.rows-1;return this.scrollLines(i.type===2?-s:s),this.cancel(e,!0)}if(i.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(i.cancel&&this.cancel(e,!0),!i.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((i.key===ce.ETX||i.key===ce.CR)&&(this.textarea.value=""),this._onKey.fire({key:i.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(i.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let i=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"?i:i&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(C$(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(ni));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(ce.ESC+"[I"):this.coreService.triggerDataEvent(ce.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),i=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${ce.ESC}[4;${i};${t}t`);break;case 1:let s=this._renderService.dimensions.css.cell.width.toFixed(0),a=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${ce.ESC}[6;${a};${s}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function C$(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var N$=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let i={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(i),t.dispose=()=>this._wrappedAddonDispose(i),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let i=0;i<this._addons.length;i++)if(this._addons[i]===e){t=i;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)}},T$=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 Gn)}translateToString(e,t,i){return this._line.translateToString(e,t,i)}},Zw=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 T$(t)}getNullCell(){return new Gn}},A$=class extends Ye{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new be),this.onBufferChange=this._onBufferChange.event,this._normal=new Zw(this._core.buffers.normal,"normal"),this._alternate=new Zw(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)}},M$=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,i=>t(i.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(i,s)=>t(i,s.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)}},R$=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}},j$=["cols","rows"],vs=0,D$=class extends Ye{constructor(e){super(),this._core=this._register(new E$(e)),this._addonManager=this._register(new N$),this._publicOptions={...this._core.options};let t=s=>this._core.options[s],i=(s,a)=>{this._checkReadonlyOptions(s),this._core.options[s]=a};for(let s in this._core.options){let a={get:t.bind(this,s),set:i.bind(this,s)};Object.defineProperty(this._publicOptions,s,a)}}_checkReadonlyOptions(e){if(j$.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 M$(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new R$(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 A$(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,i){this._verifyIntegers(e,t,i),this._core.select(e,t,i)}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
|
|
153
|
-
`,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 h0.get()},set promptLabel(e){h0.set(e)},get tooMuchOutput(){return f0.get()},set tooMuchOutput(e){f0.set(e)}}}_verifyIntegers(...e){for(vs of e)if(vs===1/0||isNaN(vs)||vs%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(vs of e)if(vs&&(vs===1/0||isNaN(vs)||vs%1!==0||vs<0))throw new Error("This API only accepts positive integers")}};function QN({sessionId:e,active:t,toolbarExtra:i}){const s=k.useRef(null),a=k.useRef(null),o=k.useRef(null),u=k.useRef(null),[h,m]=k.useState("Local workspace"),[f,p]=k.useState("connecting"),[b,_]=k.useState("Opening shell"),x=k.useCallback(()=>{const S=u.current,E=o.current;if(!S||S.readyState!==WebSocket.OPEN||!E)return;E.fit();const C=E.proposeDimensions();C&&S.send(JSON.stringify({cols:C.cols,rows:C.rows,type:"resize"}))},[]);k.useEffect(()=>{if(!s.current)return;const S=new D$({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"}}),E=new kz;S.loadAddon(E),S.open(s.current),a.current=S,o.current=E;const C=new WebSocket(O$(e));u.current=C;const A=S.onData(M=>{C.readyState===WebSocket.OPEN&&C.send(JSON.stringify({data:M,type:"input"}))});C.addEventListener("open",()=>{p("running"),_("Shell connected"),x()}),C.addEventListener("message",M=>{const D=L$(M.data);if(D){if(D.type==="output"){S.write(D.data);return}if(D.type==="error"){p("error"),_(D.error);return}p(D.state==="idle"?"connecting":D.state),D.cwd&&m(D.cwd),_(D.error??D.shell??"Shell connected")}}),C.addEventListener("close",()=>{p(M=>M==="exited"?M:"exited"),_("Socket closed")}),C.addEventListener("error",()=>{p("error"),_("Terminal socket error")}),window.addEventListener("resize",x),window.setTimeout(x,0);const N=new ResizeObserver(()=>x());return N.observe(s.current),()=>{window.removeEventListener("resize",x),N.disconnect(),A.dispose(),C.close(),S.dispose(),u.current=null,a.current=null,o.current=null}},[e,x]),k.useEffect(()=>{if(!t)return;const S=window.setTimeout(()=>{x(),a.current?.focus()},0);return()=>window.clearTimeout(S)},[t,x]);const y=k.useCallback(S=>{const E=u.current;if(!E||E.readyState!==WebSocket.OPEN)return;const C=o.current?.proposeDimensions();E.send(JSON.stringify({cols:C?.cols,rows:C?.rows,...S}))},[]);return c.jsxs("section",{className:de("flex h-full min-h-0 flex-col bg-[#090909] text-white",!t&&"hidden"),children:[c.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:[c.jsx("div",{className:"min-w-0",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Pe,{className:de("border-white/15 bg-white/10 text-white shadow-none",f==="running"&&"border-emerald-400/35 text-emerald-200",f==="error"&&"border-red-400/35 text-red-200"),variant:"outline",children:f}),c.jsxs("span",{className:"truncate font-mono text-[11px] text-white/55",children:[h," · ",b]})]})}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs(ue,{"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:[c.jsx(rb,{}),"Restart"]}),c.jsxs(ue,{"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:[c.jsx(Fh,{}),"Stop"]}),i]})]}),c.jsx("div",{"aria-label":"terminal viewport",className:"min-h-0 flex-1 overflow-hidden px-3 py-0.5",children:c.jsx("div",{className:"h-full w-full",ref:s})})]})}function O$(e){const t=window.location.protocol==="https:"?"wss:":"ws:",i=encodeURIComponent(e);return`${t}//${window.location.host}/api/terminal/socket?id=${i}`}function L$(e){if(typeof e!="string")return null;try{const t=JSON.parse(e);return typeof t?.type=="string"?t:null}catch{return null}}function B$({serviceName:e,active:t}){const[i,s]=k.useState(null),[a,o]=k.useState(null),[u,h]=k.useState(!1),m=k.useRef(!1);k.useEffect(()=>{if(!t||m.current)return;m.current=!0;let b=!1;return(async()=>{try{const _=await Kd({serviceName:e});b||s(_.id)}catch(_){b||o(_ instanceof Error?_.message:String(_))}})(),()=>{b=!0}},[t,e]);const f=c.jsxs(ue,{"aria-label":u?"Exit fullscreen terminal":"Expand terminal",className:"border-white/15 bg-white/5 text-white hover:bg-white/10",onClick:()=>h(b=>!b),size:"sm",type:"button",variant:"outline",children:[u?c.jsx(Nk,{}):c.jsx(Ck,{}),u?"Exit":"Expand"]}),p=a?c.jsxs("div",{className:"p-3 font-mono text-[11px] text-destructive",children:["Could not open terminal: ",a]}):i?c.jsx(QN,{active:t,sessionId:i,toolbarExtra:f}):c.jsx("div",{className:"p-3 font-mono text-[11px] text-muted-foreground",children:"Opening terminal…"});return u&&t?c.jsx(Jb,{onClose:()=>h(!1),title:`Terminal — ${e}`,children:p}):c.jsx("div",{className:de("h-[60vh] min-h-[24rem] overflow-hidden rounded-md border border-border",!t&&"hidden"),children:p})}const z$=500;function I$(e){const[t,i]=k.useState(),[s,a]=k.useState([]),[o,u]=k.useState(),[h,m]=k.useState(!1),f=k.useRef(void 0);k.useEffect(()=>{f.current=void 0,i(void 0),a([]);const b=new EventSource(`/api/services/${encodeURIComponent(e)}/test/stream`),_=x=>{try{const y=JSON.parse(x.data);y.run.id!==f.current&&(f.current=y.run.id,a([])),i(y.run),y.line&&a(S=>[...S,y.line].slice(-z$))}catch{}};return b.addEventListener("status",_),b.addEventListener("output",_),()=>b.close()},[e]);const p=k.useCallback(async b=>{m(!0),u(void 0);try{await S6(e,b)}catch(_){u(_ instanceof Error?_.message:String(_))}finally{m(!1)}},[e]);return{run:t,lines:s,error:o,starting:h,start:p}}const P$={running:"secondary",passed:"success",failed:"error",error:"error"},$$={running:"Running",passed:"Passed",failed:"Failed",error:"Error"};function U$({serviceName:e}){const{run:t,lines:i,error:s,starting:a,start:o}=I$(e),[u,h]=k.useState(""),m=t?.status==="running"||a,f=t?.status==="failed"||t?.status==="error";return c.jsxs("div",{className:"space-y-2",children:[c.jsxs("form",{className:"flex items-center gap-2",onSubmit:p=>{p.preventDefault(),m||o(u.trim()||void 0)},children:[c.jsx(et,{className:"h-7 flex-1 text-[11px]",disabled:m,onChange:p=>h(p.target.value),placeholder:"Optional test pattern (e.g. config-store)",value:u}),c.jsx(ue,{disabled:m,size:"sm",type:"submit",children:m?"Running…":"Run tests"})]}),s?c.jsx("div",{className:"text-red-600",children:s}):null,t?c.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-muted-foreground",children:[c.jsx(Pe,{size:"small",variant:P$[t.status],children:$$[t.status]}),c.jsx("code",{className:"font-mono text-[11px]",children:t.command}),t.failingCount>0?c.jsxs("span",{children:["· ",t.failingCount," failing"]}):null,t.exitCode!=null?c.jsxs("span",{children:["· exit ",t.exitCode]}):null]}):c.jsx("div",{className:"text-muted-foreground",children:"No test runs yet."}),i.length>0?c.jsx("pre",{className:"max-h-72 overflow-auto whitespace-pre-wrap break-all rounded bg-background p-2 font-mono text-[11px]",children:i.map((p,b)=>c.jsx("div",{className:de(p.stream==="stderr"&&"text-red-500"),children:p.text},b))}):null,f?c.jsxs("div",{className:"rounded border border-border bg-muted/40 p-2",children:["Failures were piped into the"," ",c.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 H$({serviceName:e,status:t,health:i,timeline:s,onRefresh:a}){const[o,u]=k.useState("metrics"),h=i?.processTree?.processes??[];return c.jsxs("div",{className:"border-t border-border bg-muted/30 px-3 py-2 text-xs",children:[c.jsxs("div",{className:"mb-2 flex gap-1",children:[c.jsx(Ra,{active:o==="logs",onClick:()=>u("logs"),children:"Logs"}),c.jsxs(Ra,{active:o==="processes",onClick:()=>u("processes"),children:["Processes ",h.length?c.jsx(Pe,{variant:"secondary",size:"small",children:h.length}):null]}),c.jsx(Ra,{active:o==="metrics",onClick:()=>u("metrics"),children:"Metrics"}),c.jsxs(Ra,{active:o==="http",onClick:()=>u("http"),children:["HTTP",t?.inspector?.enabled?c.jsx(Pe,{variant:"success",size:"small",children:"on"}):null]}),c.jsx(Ra,{active:o==="env",onClick:()=>u("env"),children:"Env"}),c.jsx(Ra,{active:o==="tests",onClick:()=>u("tests"),children:"Tests"}),c.jsx(Ra,{active:o==="terminal",onClick:()=>u("terminal"),children:"Terminal"})]}),o==="processes"?c.jsx(yz,{rows:h}):null,o==="metrics"?c.jsx(pz,{serviceName:e}):null,o==="http"?c.jsx(hz,{serviceName:e,status:t,timeline:s,onRefresh:a}):null,o==="env"?c.jsx(dz,{serviceName:e}):null,o==="tests"?c.jsx(U$,{serviceName:e}):null,o==="logs"?c.jsx(nz,{serviceName:e}):null,c.jsx(B$,{active:o==="terminal",serviceName:e},e)]})}function Ra({active:e,onClick:t,children:i}){return c.jsx("button",{className:de("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:i})}const F$={high:"success",medium:"warning",low:"secondary"};function V$({onClose:e,onRefresh:t}){const i=Bi(),{sendToAgent:s}=Li(),[a,o]=k.useState("url"),[u,h]=k.useState(""),[m,f]=k.useState(!1),[p,b]=k.useState(null),[_,x]=k.useState(null),[y,S]=k.useState([]),[E,C]=k.useState([]),[A,N]=k.useState(null),M=A?.kind==="docker-compose"?E.find(R=>R.composeService===A.composeService):void 0;async function D(){if(u.trim()){f(!0),b(null);try{const R=await l6(u.trim());x(R.profile),S(R.proposals),C(R.databases),N(R.proposals[0]??null),R.proposals.length===0&&b("Cloned, but couldn't detect how to run this repo. Refine with AI or add it manually."),o("review")}catch(R){b(R instanceof Error?R.message:String(R))}finally{f(!1)}}}function U(){s({prompt:`Onboard this repository and register it as a NoMoreIDE service: ${u.trim()}
|
|
154
|
-
Use nomoreide_onboard_repo to inspect it, pick the best run command, then register and start it.`,source:{type:"repo-onboard",label:"Onboard repo"},label:`Onboard and run this repo: ${u.trim()}`}),e()}async function L(R){if(A){f(!0),b(null);try{await c6(A,R,M),await t(),i.success(`${A.name} registered${M?" (+ database)":""}${R?" and starting":""}.`),e()}catch($){b($ instanceof Error?$.message:String($))}finally{f(!1)}}}return c.jsxs(Ts,{icon:c.jsx(Wn,{}),onClose:e,size:"lg",title:"Add from GitHub",children:[a==="url"?c.jsx(q$,{url:u,busy:m,error:p,onChange:h,onScan:D,onRefine:U}):null,a==="review"&&_?c.jsx(K$,{profile:_,proposals:y,selected:A,database:M,error:p,onSelect:N,onEdit:N,onBack:()=>o("url"),onRefine:U,onContinue:()=>o("install")}):null,a==="install"&&A?c.jsx(W$,{proposal:A,busy:m,error:p,onBack:()=>o("review"),onRegister:L}):null]})}function q$({url:e,busy:t,error:i,onChange:s,onScan:a,onRefine:o}){return c.jsxs("div",{className:"flex flex-col gap-3",children:[c.jsx("p",{className:"text-sm text-muted-foreground",children:"Paste a repository URL. NoMoreIDE clones it, detects how it runs, and proposes a service."}),c.jsx(et,{autoFocus:!0,placeholder:"https://github.com/owner/repo",value:e,onChange:u=>s(u.target.value),onKeyDown:u=>{u.key==="Enter"&&!t&&a()}}),i?c.jsx("p",{className:"text-sm text-destructive",children:i}):null,c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs(ue,{variant:"ghost",size:"sm",onClick:o,disabled:!e.trim(),children:[c.jsx(Wa,{className:"size-3.5"}),"Refine with AI"]}),c.jsxs(ue,{onClick:a,disabled:t||!e.trim(),children:[t?c.jsx(Oi,{className:"size-4 animate-spin"}):c.jsx(Wn,{className:"size-4"}),t?"Cloning…":"Clone & detect"]})]})]})}function K$({profile:e,proposals:t,selected:i,database:s,error:a,onSelect:o,onEdit:u,onBack:h,onRefine:m,onContinue:f}){return c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[c.jsx("span",{className:"text-sm font-medium",children:e.name}),e.languages.map(p=>c.jsx(Pe,{variant:"outline",size:"small",label:p},p))]}),a?c.jsx("p",{className:"text-sm text-destructive",children:a}):null,t.length>0?c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsxs("span",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:["Detected service",t.length>1?"s":""]}),t.map(p=>{const b=i?.name===p.name;return c.jsxs("button",{type:"button",onClick:()=>o(p),className:`rounded-md border px-3 py-2 text-left text-sm transition-colors ${b?"border-primary bg-primary/5":"border-border hover:bg-muted/50"}`,children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsx("span",{className:"font-medium",children:p.name}),c.jsx(Pe,{variant:F$[p.confidence],size:"small",label:p.confidence})]}),c.jsx("div",{className:"mt-0.5 font-mono text-xs text-muted-foreground",children:p.kind==="docker-compose"?`compose · ${p.composeService}`:p.command}),c.jsx("div",{className:"text-[11px] text-muted-foreground",children:p.reason})]},p.name)})]}):null,i?c.jsx(G$,{proposal:i,onChange:u}):null,s?c.jsxs("div",{className:"flex items-center gap-1.5 rounded-md border border-border bg-muted/30 px-2.5 py-1.5 text-xs text-muted-foreground",children:[c.jsx(us,{className:"size-3.5"}),c.jsxs("span",{children:["Also registers database ",c.jsx("span",{className:"font-medium",children:s.name})," (",s.engine,") so it shows in the Database tab."]})]}):null,e.envKeys.length>0?c.jsxs("div",{className:"text-xs text-muted-foreground",children:[c.jsx("span",{className:"font-medium",children:"Env from .env.example:"})," ",e.envKeys.join(", ")]}):null,e.readmeExcerpt?c.jsxs("details",{className:"rounded-md border border-border bg-muted/30 p-2 text-xs",children:[c.jsx("summary",{className:"cursor-pointer font-medium",children:"README excerpt"}),c.jsx("pre",{className:"mt-2 max-h-40 overflow-auto whitespace-pre-wrap font-mono",children:e.readmeExcerpt})]}):null,c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs(ue,{variant:"ghost",size:"sm",onClick:h,children:[c.jsx(fk,{className:"size-3.5"}),"Back"]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs(ue,{variant:"outline",size:"sm",onClick:m,children:[c.jsx(Wa,{className:"size-3.5"}),"Refine with AI"]}),c.jsx(ue,{onClick:f,disabled:!i,children:"Continue"})]})]})]})}function G$({proposal:e,onChange:t}){return c.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[c.jsx(Ac,{label:"Service name",children:c.jsx(et,{value:e.name,onChange:i=>t({...e,name:i.target.value})})}),c.jsx(Ac,{label:"Port (optional)",children:c.jsx(et,{value:e.port?.toString()??"",placeholder:"auto",onChange:i=>t({...e,port:i.target.value?Number(i.target.value):void 0})})}),e.kind==="docker-compose"?c.jsx(Ac,{label:"Compose service",className:"col-span-2",children:c.jsx(et,{value:e.composeService??"",onChange:i=>t({...e,composeService:i.target.value})})}):c.jsx(Ac,{label:"Run command",className:"col-span-2",children:c.jsx(et,{value:e.command??"",onChange:i=>t({...e,command:i.target.value})})})]})}function W$({proposal:e,busy:t,error:i,onBack:s,onRegister:a}){const[o,u]=k.useState(e.installCommand??""),[h,m]=k.useState([]),[f,p]=k.useState(!1),[b,_]=k.useState(!1),x=k.useRef(null);function y(E){m(C=>[...C,E]),queueMicrotask(()=>{const C=x.current;C&&(C.scrollTop=C.scrollHeight)})}async function S(){o.trim()&&(p(!0),_(!1),m([]),await u6({clonePath:e.cwd,command:o.trim()},{onLine:E=>y(E.text),onDone:E=>{y(E===0?"✓ install complete":`✗ install exited ${E}`),p(!1),_(E===0)},onError:E=>{y(`✗ ${E}`),p(!1)}}))}return c.jsxs("div",{className:"flex flex-col gap-3",children:[c.jsxs("div",{className:"flex items-end gap-2",children:[c.jsx(Ac,{label:"Install command (optional)",className:"flex-1",children:c.jsx(et,{value:o,placeholder:"e.g. npm install",onChange:E=>u(E.target.value)})}),c.jsxs(ue,{variant:"outline",onClick:S,disabled:f||!o.trim(),children:[f?c.jsx(Oi,{className:"size-4 animate-spin"}):c.jsx(vk,{className:"size-4"}),"Install"]})]}),h.length>0?c.jsx("pre",{ref:x,className:"max-h-48 overflow-auto rounded-md border border-border bg-black/80 p-2 font-mono text-[11px] text-green-200",children:h.join(`
|
|
155
|
-
`)}):null,i?c.jsx("p",{className:"text-sm text-destructive",children:i}):null,c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs(ue,{variant:"ghost",size:"sm",onClick:s,children:[c.jsx(fk,{className:"size-3.5"}),"Back"]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(ue,{variant:"outline",onClick:()=>a(!1),disabled:t,children:"Register only"}),c.jsxs(ue,{onClick:()=>a(!0),disabled:t,children:[t?c.jsx(Oi,{className:"size-4 animate-spin"}):c.jsx(Uh,{className:"size-4"}),b||!o.trim()?"Register & start":"Skip install & start"]})]})]})]})}function Ac({label:e,className:t,children:i}){return c.jsxs("label",{className:`flex flex-col gap-1 text-xs ${t??""}`,children:[c.jsx("span",{className:"font-medium text-muted-foreground",children:e}),i]})}function Y$({data:e,onRefresh:t,focusService:i,onServiceFocused:s}){const a=e.config.services[0]?.name??"",[o,u]=k.useState(a),[h,m]=k.useState(null),[f,p]=k.useState(!1),{sendToAgent:b,startOnboard:_}=Li(),[x,y]=k.useState(!1),[S,E]=k.useState(!1),[C,A]=k.useState(!1),[N,M]=k.useState(!1),D=k.useRef({}),{error:U,message:L,success:R}=Bi(),$=k.useMemo(()=>new Set(e.config.bundles.flatMap(P=>P.services)),[e.config.bundles]),I=k.useMemo(()=>{const P=new Map;for(const j of e.config.bundles)for(const W of j.services)P.has(W)||P.set(W,j.name);return P},[e.config.bundles]),F=k.useMemo(()=>e.config.services.filter(P=>!$.has(P.name)),[e.config.services,$]),G=e.health??{},Y=e.config.bundles.length>0||F.length>0;k.useEffect(()=>{!e.config.services.some(j=>j.name===o)&&a&&u(a)},[e.config.services,a,o]),k.useEffect(()=>{i&&e.config.services.some(P=>P.name===i)&&(u(i),s?.())},[i,e.config.services,s]);const Q=k.useMemo(()=>e.config.services.find(P=>P.name===o),[e.config.services,o]),q=o?e.runtime.services[o]:void 0,O=o?G[o]:void 0;async function X(P,j){if(!P.services.includes(j))try{await m6(P.name,P.services,j),R(`Added ${j} to ${P.name}.`),await t()}catch(W){U(W instanceof Error?W.message:String(W))}}async function Z(){if(Q){if(Lc(q?.state)){U(`Stop ${Q.name} before deleting it.`);return}if(window.confirm(`Delete service "${Q.name}"? This removes it from your config.`))try{await f6(Q.name),R(`Deleted ${Q.name}.`),await t()}catch(P){U(P instanceof Error?P.message:String(P))}}}async function V(P){const j=e.config.bundles.filter(W=>W.services.includes(P));if(j.length!==0)try{for(const W of j)await p6(W.name,W.services,P);L({text:`Removed ${P} from ${j.map(W=>W.name).join(", ")}.`}),await t()}catch(W){U(W instanceof Error?W.message:String(W))}}return k.useEffect(()=>{const P=Object.fromEntries(e.config.services.map(W=>[W.name,e.runtime.services[W.name]?.state??"stopped"])),j=D.current;if(Object.keys(j).length){const W=new Map,he=new Map;for(const oe of e.config.services){const me=P[oe.name],ne=j[oe.name];if(!ne||ne===me)continue;const fe=e.runtime.services[oe.name],we=I.get(oe.name);if(we){const ye=W.get(we)??new Map;if(ye.set(me,(ye.get(me)??0)+1),W.set(we,ye),me==="exited"){const Ze=he.get(we)??[];Ze.push(fe?.exitCode),he.set(we,Ze)}continue}if(me==="running")R(`${oe.name} is running.`);else if(me==="stopped")L({text:`${oe.name} stopped.`});else if(me==="starting")L({text:`${oe.name} is starting.`});else if(me==="exited"){const ye=fe?.exitCode===void 0||fe.exitCode===null?"":` with code ${fe.exitCode}`;U(`${oe.name} exited${ye}.`)}}for(const[oe,me]of W)Z$({exitCodes:he.get(oe)??[],groupName:oe,showErrorToast:U,showMessageToast:L,showSuccessToast:R,transitions:me})}D.current=P},[e.config.services,e.runtime.services,I,U,L,R]),c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:de("grid h-full min-h-0 overflow-hidden bg-card/85",S?"lg:grid-cols-[320px_minmax(0,1fr)]":"lg:grid-cols-[320px_minmax(0,1fr)_340px]"),children:[c.jsx("div",{className:"min-h-0 min-w-0 overflow-auto border-r border-border",children:c.jsxs(Ms,{className:"min-w-0 rounded-none border-0 border-b border-border bg-transparent",children:[c.jsx(Rs,{className:"border-b border-border px-3 py-2",children:c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsx(js,{className:"text-sm",children:"Services"}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsxs(ue,{"aria-haspopup":"dialog",className:"h-7 gap-1.5 px-2 text-xs",onClick:()=>y(!0),size:"sm",type:"button",variant:"outline",children:[c.jsx(Mk,{className:"size-3.5"}),"Logs"]}),c.jsx(X$,{onCreateGroup:()=>m("group"),onCreateService:()=>m("service"),onOnboardRepo:()=>p(!0),onOnboardWithAi:_,canGroupWithAi:F.length>1,onCreateWithAi:()=>b({prompt:$L,source:{type:"service-setup",label:"Add a service"},label:"Help me add a new service, one step at a time."}),onGroupWithAi:()=>b({prompt:KL(F),source:{type:"group-services",label:"Group services"},label:"Propose how to group my ungrouped services."})})]})]})}),c.jsx(Ds,{className:"p-0",children:Y?c.jsxs("div",{className:"divide-y divide-border",children:[e.config.bundles.map(P=>c.jsx(F7,{group:P,onRefresh:t,ports:e.ports,allServices:e.config.services,health:G,services:e.config.services.filter(j=>P.services.includes(j.name)),statuses:e.runtime.services,timeline:e.timeline,selectedService:o,onSelectService:u,onDropService:j=>{X(P,j)}},P.name)),F.length?c.jsxs("div",{className:de("transition-colors",N&&"bg-primary/5 outline-dashed outline-2 -outline-offset-2 outline-primary/60"),onDragOver:P=>{P.dataTransfer.types.includes(Vc)&&(P.preventDefault(),P.dataTransfer.dropEffect="move",M(!0))},onDragLeave:()=>M(!1),onDrop:P=>{P.preventDefault(),M(!1);const j=P.dataTransfer.getData(Vc);j&&V(j)},children:[c.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:[c.jsx("span",{children:"Ungrouped"}),c.jsx("span",{className:"text-muted-foreground/80",children:F.length})]}),c.jsx("div",{className:"divide-y divide-border",children:F.map(P=>c.jsx(KC,{service:P,status:e.runtime.services[P.name],health:G[P.name],ports:e.ports,onRefresh:t,timeline:e.timeline,selected:o===P.name,onSelect:()=>u(P.name)},P.name))})]}):null]}):c.jsx(Ch,{label:"No services registered yet."})})]})}),c.jsx("div",{className:"min-h-0 min-w-0 overflow-auto",children:Q?c.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[c.jsxs("div",{className:"shrink-0 space-y-2 border-b border-border bg-background/60 px-4 py-3",children:[c.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[c.jsx("h2",{className:"min-w-0 truncate text-base font-semibold",children:Q.name}),c.jsx(Hb,{state:q?.state??"stopped"}),c.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1.5",children:[(()=>{const P=q?.url??(Q.port?q7(Q.port):void 0);return P?c.jsx(Qo,{label:`Open ${P}`,children:c.jsx(ue,{"aria-label":"Open in browser",className:"size-7",onClick:()=>window.open(P,"_blank","noopener,noreferrer"),size:"icon",type:"button",variant:"outline",children:c.jsx(nb,{})})}):null})(),O?.agentContext&&Q?c.jsx(Qo,{label:"Debug this service with AI",children:c.jsx(ue,{"aria-label":"Debug this service with AI",className:"size-7",onClick:()=>b({prompt:GL({service:Q.name,context:O.agentContext}),source:{type:"service-debug",label:Q.name},label:`Debug \`${Q.name}\` with its current context.`}),size:"icon",type:"button",variant:"outline",children:c.jsx(cs,{className:"size-3.5"})})}):null,c.jsx(Ub,{active:Lc(q?.state),baseUrl:`/api/services/${encodeURIComponent(Q.name)}`,compact:!0,targetLabel:Q.name,onRefresh:t}),c.jsx(sN,{className:"size-7 border border-border bg-background opacity-100 hover:border-foreground/30",items:[{icon:c.jsx(Ic,{className:"size-3.5"}),label:"Edit service",onSelect:()=>A(!0)},...Lc(q?.state)?[]:[{icon:c.jsx(rl,{className:"size-3.5 text-destructive"}),label:"Delete service",onSelect:()=>{Z()}}]],label:`More actions for ${Q.name}`}),c.jsx(Qo,{label:S?"Show Ports & Timeline":"Hide Ports & Timeline",side:"left",children:c.jsx(ue,{"aria-label":S?"Show Ports & Timeline":"Hide Ports & Timeline",className:"size-7",onClick:()=>E(P=>!P),size:"icon",type:"button",variant:"ghost",children:S?c.jsx(RA,{}):c.jsx(sa,{})})})]})]}),Q.command?c.jsxs("div",{className:"truncate font-mono text-[11px] text-muted-foreground",title:Q.command,children:["$ ",Q.command]}):null,Q.cwd?c.jsx("div",{className:"truncate font-mono text-[11px] text-muted-foreground",title:Q.cwd,children:Q.cwd}):null,c.jsx(HB,{health:O})]}),c.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:c.jsx(H$,{serviceName:Q.name,status:q,health:O,timeline:e.timeline??[],onRefresh:t},Q.name)})]}):c.jsx(Ch,{label:"Select a service to see details."})}),S?null:c.jsxs("div",{className:"min-h-0 overflow-auto border-l border-border",children:[c.jsx(GB,{ports:e.ports}),c.jsx(DB,{events:e.timeline??[]})]})]}),C&&Q?c.jsx(Ts,{icon:c.jsx(Ic,{}),onClose:()=>A(!1),size:"lg",title:`Edit Service — ${Q.name}`,children:c.jsx(IS,{cwd:e.cwd,initialService:Q,onRefresh:t,onSaved:()=>A(!1)})}):null,h?c.jsx(Ts,{icon:h==="service"?c.jsx(mn,{}):c.jsx(pk,{}),onClose:()=>m(null),size:h==="service"?"lg":"md",title:h==="service"?"Add Service":"Create Group",children:h==="service"?c.jsx(IS,{cwd:e.cwd,onRefresh:t,onSaved:()=>m(null)}):c.jsx(qC,{services:F,onRefresh:t,onSaved:()=>m(null)})}):null,f?c.jsx(V$,{onClose:()=>p(!1),onRefresh:t}):null,x?c.jsx(az,{initialService:o||void 0,onClose:()=>y(!1),services:e.config.services.map(P=>P.name)}):null]})}function X$({onCreateService:e,onCreateGroup:t,onCreateWithAi:i,onGroupWithAi:s,canGroupWithAi:a,onOnboardRepo:o,onOnboardWithAi:u}){const[h,m]=k.useState(!1);function f(p){m(!1),p()}return c.jsxs("div",{className:"relative",children:[c.jsx(Qo,{label:"Add",side:"bottom",children:c.jsx(ue,{"aria-expanded":h,"aria-haspopup":"menu","aria-label":"Add service or group",className:"size-7",onClick:()=>m(p=>!p),size:"icon",type:"button",variant:"ghost",children:c.jsx(mn,{})})}),h?c.jsxs(c.Fragment,{children:[c.jsx("button",{"aria-hidden":!0,className:"fixed inset-0 z-[40] cursor-default",onClick:()=>m(!1),tabIndex:-1,type:"button"}),c.jsxs("div",{className:"absolute right-0 z-[50] mt-1 w-56 overflow-hidden rounded-md border border-border bg-card py-1 shadow-lg",role:"menu",children:[c.jsxs("div",{className:"group flex items-stretch",children:[c.jsxs("button",{className:"flex flex-1 items-center gap-2 whitespace-nowrap px-3 py-2 text-left text-sm hover:bg-muted/60 [&_svg]:size-4",onClick:()=>f(e),role:"menuitem",type:"button",children:[c.jsx(mn,{}),"Create Service"]}),c.jsxs("button",{className:"flex max-w-0 items-center gap-1.5 overflow-hidden whitespace-nowrap border-l border-transparent px-0 text-[11px] font-medium text-muted-foreground opacity-0 transition-all duration-200 ease-out hover:bg-muted/60 hover:text-foreground group-hover:max-w-24 group-hover:border-border group-hover:px-3 group-hover:opacity-100",onClick:()=>f(i),role:"menuitem",title:"Set up with AI — the agent walks you through it",type:"button",children:[c.jsx(cs,{className:"size-3.5 shrink-0"}),"AI"]})]}),c.jsxs("div",{className:"group flex items-stretch",children:[c.jsxs("button",{className:"flex flex-1 items-center gap-2 whitespace-nowrap px-3 py-2 text-left text-sm hover:bg-muted/60 [&_svg]:size-4",onClick:()=>f(t),role:"menuitem",type:"button",children:[c.jsx(pk,{}),"Create Group"]}),a?c.jsxs("button",{className:"flex max-w-0 items-center gap-1.5 overflow-hidden whitespace-nowrap border-l border-transparent px-0 text-[11px] font-medium text-muted-foreground opacity-0 transition-all duration-200 ease-out hover:bg-muted/60 hover:text-foreground group-hover:max-w-24 group-hover:border-border group-hover:px-3 group-hover:opacity-100",onClick:()=>f(s),role:"menuitem",title:"Group with AI — the agent proposes groupings for your ungrouped services",type:"button",children:[c.jsx(cs,{className:"size-3.5 shrink-0"}),"AI"]}):null]}),c.jsxs("div",{className:"group flex items-stretch",children:[c.jsxs("button",{className:"flex flex-1 items-center gap-2 whitespace-nowrap px-3 py-2 text-left text-sm hover:bg-muted/60 [&_svg]:size-4",onClick:()=>f(o),role:"menuitem",type:"button",children:[c.jsx(Wn,{}),"Add from GitHub"]}),c.jsxs("button",{className:"flex max-w-0 items-center gap-1.5 overflow-hidden whitespace-nowrap border-l border-transparent px-0 text-[11px] font-medium text-muted-foreground opacity-0 transition-all duration-200 ease-out hover:bg-muted/60 hover:text-foreground group-hover:max-w-24 group-hover:border-border group-hover:px-3 group-hover:opacity-100",onClick:()=>f(u),role:"menuitem",title:"Onboard with AI — the agent clones, detects and runs it for you",type:"button",children:[c.jsx(cs,{className:"size-3.5 shrink-0"}),"AI"]})]})]})]}):null]})}function Z$({exitCodes:e,groupName:t,showErrorToast:i,showMessageToast:s,showSuccessToast:a,transitions:o}){if(o.size===1){const[m]=o.keys();if(m==="running")a(`${t} group is running.`);else if(m==="stopped")s({text:`${t} group stopped.`});else if(m==="starting")s({text:`${t} group is starting.`});else if(m==="exited"){const f=e.filter(b=>b!=null),p=f.length?` with code ${f.join(", ")}`:"";i(`${t} group exited${p}.`)}return}const u=[...o.entries()].map(([m,f])=>`${f} ${m}`).join(", "),h=`${t} group updated: ${u}.`;o.has("exited")?i(h):s({text:h})}function Q$({data:e,onOpenService:t}){const i=k.useMemo(()=>J$(e),[e]);return i.length?c.jsxs("div",{className:"flex shrink-0 items-center gap-3 overflow-x-auto border-b border-border bg-card/60 px-4 py-1.5 backdrop-blur",children:[c.jsxs("span",{className:"flex shrink-0 items-center gap-1.5 font-mono text-[10px] uppercase tracking-wider text-muted-foreground",children:[c.jsx(Pa,{className:"size-3"}),"Running"]}),c.jsx("div",{className:"flex min-w-0 items-center gap-2",children:i.map(s=>c.jsxs("button",{className:"group flex shrink-0 items-center gap-2 rounded-md border border-border/60 bg-background/60 px-2.5 py-1 font-mono text-[11px] transition-colors hover:border-border hover:bg-muted",onClick:()=>t(s.name),title:s.url?`${s.name} — ${s.url}`:s.name,type:"button",children:[c.jsx("span",{className:de("size-2 shrink-0 rounded-full",tU(s.tone))}),c.jsx("span",{className:"max-w-40 truncate font-medium text-foreground",children:s.name}),s.port?c.jsxs("span",{className:"text-muted-foreground",children:[":",s.port]}):null,s.uptime?c.jsxs("span",{className:"text-muted-foreground/70",children:["↑",s.uptime]}):null]},s.name))})]}):null}function J$(e){const t=new Map(e.config.services.map(i=>[i.name,i.port]));return Object.values(e.runtime.services).filter(i=>i.state==="running"||i.state==="starting").map(i=>({name:i.name,tone:eU(i,e.health[i.name]),port:t.get(i.name)??iU(i.url),uptime:i.state==="running"?nU(i.startedAt):"starting…",url:i.url})).sort((i,s)=>i.name.localeCompare(s.name))}function eU(e,t){return e.state==="starting"?"starting":t?.status==="healthy"?"healthy":t?.status==="warning"?"warning":t?.status==="unhealthy"?"unhealthy":"healthy"}function tU(e){return e==="starting"?"animate-pulse bg-amber-500":e==="warning"?"bg-amber-500":e==="unhealthy"?"bg-red-500":e==="unknown"?"bg-zinc-500":"bg-emerald-500"}function iU(e){if(e)try{const t=new URL(e).port;return t?Number(t):void 0}catch{return}}function nU(e){if(!e)return;const t=new Date(e).getTime();if(Number.isNaN(t))return;const i=Math.max(0,Math.floor((Date.now()-t)/1e3));if(i<60)return`${i}s`;const s=Math.floor(i/60);if(s<60)return`${s}m`;const a=Math.floor(s/60),o=s%60;return a<24?`${a}h${o?`${o}m`:""}`:`${Math.floor(a/24)}d${a%24?`${a%24}h`:""}`}function sU(){const[e,t]=k.useState([]),[i,s]=k.useState(null),[a,o]=k.useState(!1);k.useEffect(()=>{let m=!1;return(async()=>{let f=await w6().catch(()=>[]);if(f.length===0){const p=await Kd().catch(()=>null);f=p?[p]:[]}m||(t(f),s(f[0]?.id??null))})(),()=>{m=!0}},[]);const u=k.useCallback(async()=>{o(!0);try{const m=await Kd();t(f=>[...f,m]),s(m.id)}finally{o(!1)}},[]),h=k.useCallback(async m=>{o(!0);try{await k6(m);const f=e.findIndex(b=>b.id===m),p=e.filter(b=>b.id!==m);if(p.length===0){const b=await Kd();t([b]),s(b.id);return}if(t(p),i===m){const b=p[Math.min(f,p.length-1)];s(b.id)}}finally{o(!1)}},[e,i]);return c.jsxs("section",{className:"flex h-full min-h-0 flex-col bg-[#090909] text-white",children:[c.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,f)=>{const p=m.label??`Terminal ${f+1}`;return c.jsxs("div",{className:de("group flex items-center gap-1 rounded-md border border-transparent px-2 py-1 text-xs",m.id===i?"border-white/15 bg-white/10 text-white":"text-white/60 hover:bg-white/5"),children:[c.jsx("button",{"aria-selected":m.id===i,className:"max-w-[160px] truncate font-medium",onClick:()=>s(m.id),role:"tab",type:"button",children:p}),c.jsx("button",{"aria-label":`Close ${p}`,className:"rounded p-0.5 text-white/40 opacity-0 transition hover:bg-white/10 hover:text-white group-hover:opacity-100",disabled:a,onClick:()=>{h(m.id)},type:"button",children:c.jsx(Ji,{className:"size-3"})})]},m.id)}),c.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:a,onClick:()=>{u()},type:"button",children:c.jsx(mn,{className:"size-4"})})]}),c.jsx("div",{className:"relative min-h-0 flex-1",children:e.length===0?c.jsx("div",{className:"flex h-full items-center justify-center font-mono text-[11px] text-white/40",children:"Starting terminal…"}):e.map(m=>c.jsx("div",{className:"absolute inset-0",children:c.jsx(QN,{active:m.id===i,sessionId:m.id})},m.id))})]})}const rU=800;function JN({activeHunkIndex:e=0,diff:t}){const i=oU(t),s=k.useRef(null),a=k.useRef([]),[o,u]=k.useState(!1),h=k.useMemo(()=>i.reduce((f,p)=>Math.max(f,p.content.length),0),[i]),m=h>rU;if(k.useEffect(()=>{u(!1)},[t]),k.useEffect(()=>{if(m&&!o)return;const f=a.current[e],p=s.current;!f||!p||p.scrollTo({top:Math.max(f.offsetTop-8,0),behavior:"smooth"})},[e,t,m,o]),m&&!o){const f=i.filter(b=>b.kind==="add").length,p=i.filter(b=>b.kind==="delete").length;return c.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-card p-6",children:c.jsxs("div",{className:"max-w-sm space-y-3 text-center",children:[c.jsx("p",{className:"text-[13px] font-medium text-foreground",children:"Diff hidden for this data file"}),c.jsxs("p",{className:"text-[12px] text-muted-foreground",children:["Rows run up to ",h.toLocaleString()," characters, so this looks like a CSV, log, or other data dump rather than source code."]}),c.jsxs("p",{className:"font-mono text-[11px]",children:[c.jsxs("span",{className:"text-emerald-700",children:["+",f]})," ",c.jsxs("span",{className:"text-red-700",children:["-",p]})," lines changed"]}),c.jsx(ue,{onClick:()=>u(!0),size:"sm",type:"button",variant:"outline",children:"Show diff anyway"})]})})}return c.jsx("div",{className:"absolute inset-0 overflow-auto bg-card text-xs leading-6 text-foreground",ref:s,children:c.jsx("div",{className:"min-w-full font-mono",children:i.map((f,p)=>c.jsxs("div",{className:de("grid grid-cols-[3rem_3rem_minmax(0,1fr)]",f.kind==="add"&&"bg-emerald-50 text-emerald-800 dark:bg-emerald-500/15 dark:text-emerald-300",f.kind==="delete"&&"bg-red-50 text-red-800 dark:bg-red-500/15 dark:text-red-300",Qw(i,p)&&f.hunkIndex===e&&"outline outline-1 outline-offset-[-1px] outline-primary/35"),ref:f.hunkIndex!==null&&Qw(i,p)?b=>{a.current[f.hunkIndex??0]=b}:void 0,children:[c.jsx(Jw,{value:f.oldLine}),c.jsx(Jw,{value:f.newLine}),c.jsx("span",{className:"min-w-0 whitespace-pre-wrap break-all px-2",children:f.content||" "})]},`${p}-${f.content}`))})})}function aU(e){return e.split(`
|
|
156
|
-
`).reduce((t,i)=>(i.startsWith("@@")?t.hunks+=1:i.startsWith("+")&&!i.startsWith("+++")?t.additions+=1:i.startsWith("-")&&!i.startsWith("---")&&(t.deletions+=1),t),{additions:0,deletions:0,hunks:0})}function oU(e){const t=lU(e);return t.some(i=>i.kind==="hunk")?t.filter(i=>i.kind!=="meta"&&i.kind!=="hunk"):t}function lU(e){let t=null,i=null,s=null;return e.split(`
|
|
157
|
-
`).map(a=>{if(cU(a))return t=null,i=null,s=null,{content:a,hunkIndex:s,kind:"meta",oldLine:null,newLine:null};if(a.startsWith("@@")){const u=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(a);return u&&(t=Number(u[1]),i=Number(u[2])),s=(s??-1)+1,{content:a,hunkIndex:s,kind:"hunk",oldLine:null,newLine:null}}if(t===null||i===null)return{content:a,hunkIndex:null,kind:"meta",oldLine:null,newLine:null};if(a.startsWith("\\ No newline"))return{content:a,hunkIndex:s,kind:"meta",oldLine:null,newLine:null};if(a.startsWith("+")&&!a.startsWith("+++")){const u={content:a,hunkIndex:s,kind:"add",oldLine:null,newLine:i};return i+=1,u}if(a.startsWith("-")&&!a.startsWith("---")){const u={content:a,hunkIndex:s,kind:"delete",oldLine:t,newLine:null};return t+=1,u}const o={content:a,hunkIndex:s,kind:"context",oldLine:t,newLine:i};return t+=1,i+=1,o})}function Qw(e,t){const i=e[t]?.hunkIndex;if(i===null)return!1;const s=e.findIndex(a=>a.hunkIndex===i&&(a.kind==="add"||a.kind==="delete"));return s!==-1?s===t:e.findIndex(a=>a.hunkIndex===i)===t}function cU(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 Jw({value:e}){return c.jsx("span",{className:de("select-none border-r border-border/70 px-2 text-right text-muted-foreground",e===null&&"text-transparent"),children:e??"-"})}function uU({branch:e,error:t,files:i,selectedFile:s,onSelectFile:a,root:o}){const u=k.useMemo(()=>mU(i).filter(f=>f.files.length),[i]),[h,m]=k.useState({staged:!1,unstaged:!1,untracked:!1});return c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[c.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:[c.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 text-[12px] font-semibold tracking-tight",children:[c.jsx(Wn,{className:"size-3.5"}),c.jsx("span",{className:"truncate",children:"Changes"})]}),c.jsxs("span",{className:"flex shrink-0 items-center gap-1.5",children:[e?c.jsx(Pe,{variant:"outline",children:e}):null,c.jsx(Pe,{variant:"secondary",children:i.length})]})]}),c.jsx("div",{className:"min-h-0 flex-1 overflow-auto py-1",children:u.length?u.map(f=>c.jsx(dU,{collapsed:h[f.id],group:f,onSelectFile:a,onToggle:()=>m(p=>({...p,[f.id]:!p[f.id]})),root:o,selectedFile:s},f.id)):c.jsx(dt,{variant:"muted",className:"m-3 text-center",children:t??"No changed files."})})]})}function dU({collapsed:e,group:t,onSelectFile:i,onToggle:s,root:a,selectedFile:o}){const u=e?sa:Yn;return c.jsxs("section",{className:"border-b border-border last:border-b-0",children:[c.jsxs("button",{className:"flex w-full items-center justify-between gap-2 bg-muted/45 px-2 py-0.5 text-left text-[10px] font-semibold uppercase text-muted-foreground hover:bg-muted",onClick:s,type:"button",children:[c.jsxs("span",{className:"flex min-w-0 items-center gap-1.5",children:[c.jsx(u,{className:"size-3.5"}),c.jsx("span",{className:"truncate",children:t.label})]}),c.jsx(Pe,{className:"min-w-6 justify-center font-mono shadow-none",size:"small",variant:"outline",children:t.files.length})]}),e?null:c.jsx("div",{children:t.files.map(h=>c.jsx(hU,{active:o===h.path,file:h,group:t.id,onClick:()=>i(h.path),root:a},h.path))})]})}function hU({active:e,file:t,group:i,onClick:s,root:a}){const o=t.path.split("/").pop()||t.path,u=t.path.split("/").slice(0,-1).join("/"),h=a?VC(ru(a,t.path)):{};return c.jsxs("button",{"aria-label":`Open changed file ${t.path}`,className:de("flex w-full items-center gap-1.5 px-1 py-0.5 text-left text-[12px] hover:bg-muted",e&&"bg-muted font-medium"),onClick:s,type:"button",...h,children:[c.jsx(Fb,{path:t.path}),c.jsxs("span",{className:"flex min-w-0 flex-1 items-baseline gap-1.5 truncate",children:[c.jsx("span",{"data-testid":"changed-file-name",className:"shrink-0 truncate",children:o}),u?c.jsx("span",{"data-testid":"changed-file-dir",className:"min-w-0 truncate text-muted-foreground",children:u}):null]}),c.jsx("span",{className:de("ml-1 shrink-0 font-mono text-[10px] font-semibold",i==="untracked"&&"text-amber-700",i==="staged"&&"text-emerald-700",i==="unstaged"&&"text-zinc-800"),children:fU(t,i)})]})}function fU(e,t){return t==="untracked"?"?":t==="staged"?e.index.trim():e.workingTree.trim()}function mU(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 pU(e){const t={name:"",path:"",children:[],isFile:!1},i=new Map;i.set("",t);const s=[...e].sort();for(const o of s){const u=o.split("/");let h="";for(let m=0;m<u.length;m+=1){const f=u[m],p=m===u.length-1,b=h?`${h}/${f}`:f;let _=i.get(b);_||(_={name:f,path:b,children:[],isFile:p},i.set(b,_),i.get(h)?.children.push(_)),h=b}}const a=o=>{o.children.sort((u,h)=>u.isFile!==h.isFile?u.isFile?1:-1:u.name.localeCompare(h.name)),o.children.forEach(a)};return a(t),t}function e2(e,t){const i={"":!0},s=a=>{for(const o of a.children)o.isFile||(i[o.path]=!0,t&&s(o))};return s(e),i}function t2({defaultExpandAll:e=!1,paths:t,status:i,selectedFile:s,onSelectFile:a,branch:o,emptyMessage:u="No tracked files.",root:h,title:m="Files"}){const f=k.useMemo(()=>pU(t),[t]),p=k.useMemo(()=>e2(f,e),[e,f]),b=k.useMemo(()=>e2(f,!0),[f]),_=Math.max(0,Object.keys(b).length-1),x=k.useMemo(()=>{const D=new Map;for(const U of i)D.set(U.path,U);return D},[i]),[y,S]=k.useState(p),[E,C]=k.useState(!1);k.useEffect(()=>{E||f.children.length===0||(S(p),C(!0))},[p,E,f.children.length]);function A(D){S(U=>({...U,[D]:!U[D]}))}function N(){S(b)}function M(){S({"":!0})}return c.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[c.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:[c.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 text-[12px] font-semibold tracking-tight",children:[c.jsx(Ga,{className:"size-3.5"}),c.jsx("span",{className:"truncate",children:m})]}),c.jsxs("span",{className:"flex shrink-0 items-center gap-1.5",children:[_>0?c.jsxs("span",{className:"flex items-center gap-0.5",children:[c.jsx("button",{"aria-label":"Expand all folders",className:"flex size-6 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",onClick:N,title:"Expand all folders",type:"button",children:c.jsx(C4,{className:"size-3.5"})}),c.jsx("button",{"aria-label":"Collapse all folders",className:"flex size-6 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",onClick:M,title:"Collapse all folders",type:"button",children:c.jsx(k4,{className:"size-3.5"})})]}):null,o?c.jsx(Pe,{variant:"outline",children:o}):null,c.jsx(Pe,{variant:"secondary",children:t.length})]})]}),c.jsx("div",{className:"min-h-0 flex-1 overflow-auto py-1",children:f.children.length===0?c.jsx(dt,{variant:"muted",className:"m-3 text-center",children:u}):f.children.map(D=>c.jsx(e3,{depth:0,expanded:y,node:D,onSelectFile:a,onToggle:A,root:h,selectedFile:s,statusByPath:x},D.path))})]})}function e3({depth:e,expanded:t,node:i,onSelectFile:s,onToggle:a,root:o,selectedFile:u,statusByPath:h}){const m=t[i.path]??!1,f=6+e*12,p=o?VC(ru(o,i.path)):{};if(i.isFile){const x=h.get(i.path),y=u===i.path;return c.jsxs("button",{className:de("flex w-full items-center gap-1.5 px-1 py-0.5 text-left text-[12px] hover:bg-muted",y&&"bg-muted font-medium"),onClick:()=>s(i.path),style:{paddingLeft:f},type:"button",...p,children:[c.jsx(Fb,{path:i.path}),c.jsx("span",{className:"min-w-0 flex-1 truncate",children:i.name}),x?c.jsx(gU,{file:x}):null]})}const b=m?Yn:sa,_=m?$h:Ga;return c.jsxs("div",{children:[c.jsxs("button",{className:"flex w-full items-center gap-1 py-0.5 text-left text-[12px] font-medium hover:bg-muted",onClick:()=>a(i.path),style:{paddingLeft:f},type:"button",...p,children:[c.jsx(b,{className:"size-3.5 shrink-0 text-muted-foreground"}),c.jsx(_,{className:"size-3.5 shrink-0 text-amber-600"}),c.jsx("span",{className:"min-w-0 flex-1 truncate",children:i.name})]}),m?i.children.map(x=>c.jsx(e3,{depth:e+1,expanded:t,node:x,onSelectFile:s,onToggle:a,root:o,selectedFile:u,statusByPath:h},x.path)):null]})}function gU({file:e}){const t=e.workingTree.trim()||e.index.trim();if(!t)return null;const i=e.index.trim()&&!e.workingTree.trim()?"text-emerald-700":t==="?"?"text-amber-700":"text-zinc-700";return c.jsx("span",{className:de("ml-1 shrink-0 font-mono text-[10px] font-semibold",i),children:t})}const bU="modulepreload",vU=function(e){return"/"+e},i2={},_U=function(t,i,s){let a=Promise.resolve();if(i&&i.length>0){let m=function(f){return Promise.all(f.map(p=>Promise.resolve(p).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),h=u?.nonce||u?.getAttribute("nonce");a=m(i.map(f=>{if(f=vU(f),f in i2)return;i2[f]=!0;const p=f.endsWith(".css"),b=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${b}`))return;const _=document.createElement("link");if(_.rel=p?"stylesheet":bU,p||(_.as="script"),_.crossOrigin="",_.href=f,h&&_.setAttribute("nonce",h),document.head.appendChild(_),p)return new Promise((x,y)=>{_.addEventListener("load",x),_.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${f}`)))})}))}function o(u){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=u,window.dispatchEvent(h),!h.defaultPrevented)throw u}return a.then(u=>{for(const h of u||[])h.status==="rejected"&&o(h.reason);return t().catch(o)})};var Wp,n2;function xU(){if(n2)return Wp;n2=1;function e(z){return z instanceof Map?z.clear=z.delete=z.set=function(){throw new Error("map is read-only")}:z instanceof Set&&(z.add=z.clear=z.delete=function(){throw new Error("set is read-only")}),Object.freeze(z),Object.getOwnPropertyNames(z).forEach(re=>{const xe=z[re],$e=typeof xe;($e==="object"||$e==="function")&&!Object.isFrozen(xe)&&e(xe)}),z}class t{constructor(re){re.data===void 0&&(re.data={}),this.data=re.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function i(z){return z.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function s(z,...re){const xe=Object.create(null);for(const $e in z)xe[$e]=z[$e];return re.forEach(function($e){for(const Nt in $e)xe[Nt]=$e[Nt]}),xe}const a="</span>",o=z=>!!z.scope,u=(z,{prefix:re})=>{if(z.startsWith("language:"))return z.replace("language:","language-");if(z.includes(".")){const xe=z.split(".");return[`${re}${xe.shift()}`,...xe.map(($e,Nt)=>`${$e}${"_".repeat(Nt+1)}`)].join(" ")}return`${re}${z}`};class h{constructor(re,xe){this.buffer="",this.classPrefix=xe.classPrefix,re.walk(this)}addText(re){this.buffer+=i(re)}openNode(re){if(!o(re))return;const xe=u(re.scope,{prefix:this.classPrefix});this.span(xe)}closeNode(re){o(re)&&(this.buffer+=a)}value(){return this.buffer}span(re){this.buffer+=`<span class="${re}">`}}const m=(z={})=>{const re={children:[]};return Object.assign(re,z),re};class f{constructor(){this.rootNode=m(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(re){this.top.children.push(re)}openNode(re){const xe=m({scope:re});this.add(xe),this.stack.push(xe)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(re){return this.constructor._walk(re,this.rootNode)}static _walk(re,xe){return typeof xe=="string"?re.addText(xe):xe.children&&(re.openNode(xe),xe.children.forEach($e=>this._walk(re,$e)),re.closeNode(xe)),re}static _collapse(re){typeof re!="string"&&re.children&&(re.children.every(xe=>typeof xe=="string")?re.children=[re.children.join("")]:re.children.forEach(xe=>{f._collapse(xe)}))}}class p extends f{constructor(re){super(),this.options=re}addText(re){re!==""&&this.add(re)}startScope(re){this.openNode(re)}endScope(){this.closeNode()}__addSublanguage(re,xe){const $e=re.root;xe&&($e.scope=`language:${xe}`),this.add($e)}toHTML(){return new h(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function b(z){return z?typeof z=="string"?z:z.source:null}function _(z){return S("(?=",z,")")}function x(z){return S("(?:",z,")*")}function y(z){return S("(?:",z,")?")}function S(...z){return z.map(xe=>b(xe)).join("")}function E(z){const re=z[z.length-1];return typeof re=="object"&&re.constructor===Object?(z.splice(z.length-1,1),re):{}}function C(...z){return"("+(E(z).capture?"":"?:")+z.map($e=>b($e)).join("|")+")"}function A(z){return new RegExp(z.toString()+"|").exec("").length-1}function N(z,re){const xe=z&&z.exec(re);return xe&&xe.index===0}const M=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function D(z,{joinWith:re}){let xe=0;return z.map($e=>{xe+=1;const Nt=xe;let wt=b($e),Ae="";for(;wt.length>0;){const ke=M.exec(wt);if(!ke){Ae+=wt;break}Ae+=wt.substring(0,ke.index),wt=wt.substring(ke.index+ke[0].length),ke[0][0]==="\\"&&ke[1]?Ae+="\\"+String(Number(ke[1])+Nt):(Ae+=ke[0],ke[0]==="("&&xe++)}return Ae}).map($e=>`(${$e})`).join(re)}const U=/\b\B/,L="[a-zA-Z]\\w*",R="[a-zA-Z_]\\w*",$="\\b\\d+(\\.\\d+)?",I="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",F="\\b(0b[01]+)",G="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Y=(z={})=>{const re=/^#![ ]*\//;return z.binary&&(z.begin=S(re,/.*\b/,z.binary,/\b.*/)),s({scope:"meta",begin:re,end:/$/,relevance:0,"on:begin":(xe,$e)=>{xe.index!==0&&$e.ignoreMatch()}},z)},Q={begin:"\\\\[\\s\\S]",relevance:0},q={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Q]},O={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Q]},X={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/},Z=function(z,re,xe={}){const $e=s({scope:"comment",begin:z,end:re,contains:[]},xe);$e.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 Nt=C("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 $e.contains.push({begin:S(/[ ]+/,"(",Nt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),$e},V=Z("//","$"),P=Z("/\\*","\\*/"),j=Z("#","$"),W={scope:"number",begin:$,relevance:0},he={scope:"number",begin:I,relevance:0},oe={scope:"number",begin:F,relevance:0},me={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Q,{begin:/\[/,end:/\]/,relevance:0,contains:[Q]}]},ne={scope:"title",begin:L,relevance:0},fe={scope:"title",begin:R,relevance:0},we={begin:"\\.\\s*"+R,relevance:0};var Ze=Object.freeze({__proto__:null,APOS_STRING_MODE:q,BACKSLASH_ESCAPE:Q,BINARY_NUMBER_MODE:oe,BINARY_NUMBER_RE:F,COMMENT:Z,C_BLOCK_COMMENT_MODE:P,C_LINE_COMMENT_MODE:V,C_NUMBER_MODE:he,C_NUMBER_RE:I,END_SAME_AS_BEGIN:function(z){return Object.assign(z,{"on:begin":(re,xe)=>{xe.data._beginMatch=re[1]},"on:end":(re,xe)=>{xe.data._beginMatch!==re[1]&&xe.ignoreMatch()}})},HASH_COMMENT_MODE:j,IDENT_RE:L,MATCH_NOTHING_RE:U,METHOD_GUARD:we,NUMBER_MODE:W,NUMBER_RE:$,PHRASAL_WORDS_MODE:X,QUOTE_STRING_MODE:O,REGEXP_MODE:me,RE_STARTERS_RE:G,SHEBANG:Y,TITLE_MODE:ne,UNDERSCORE_IDENT_RE:R,UNDERSCORE_TITLE_MODE:fe});function ot(z,re){z.input[z.index-1]==="."&&re.ignoreMatch()}function lt(z,re){z.className!==void 0&&(z.scope=z.className,delete z.className)}function Be(z,re){re&&z.beginKeywords&&(z.begin="\\b("+z.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",z.__beforeBegin=ot,z.keywords=z.keywords||z.beginKeywords,delete z.beginKeywords,z.relevance===void 0&&(z.relevance=0))}function Lt(z,re){Array.isArray(z.illegal)&&(z.illegal=C(...z.illegal))}function Os(z,re){if(z.match){if(z.begin||z.end)throw new Error("begin & end are not supported with match");z.begin=z.match,delete z.match}}function Jn(z,re){z.relevance===void 0&&(z.relevance=1)}const _e=(z,re)=>{if(!z.beforeMatch)return;if(z.starts)throw new Error("beforeMatch cannot be used with starts");const xe=Object.assign({},z);Object.keys(z).forEach($e=>{delete z[$e]}),z.keywords=xe.keywords,z.begin=S(xe.beforeMatch,_(xe.begin)),z.starts={relevance:0,contains:[Object.assign(xe,{endsParent:!0})]},z.relevance=0,delete xe.beforeMatch},mt=["of","and","for","in","not","or","if","then","parent","list","value"],qi="keyword";function li(z,re,xe=qi){const $e=Object.create(null);return typeof z=="string"?Nt(xe,z.split(" ")):Array.isArray(z)?Nt(xe,z):Object.keys(z).forEach(function(wt){Object.assign($e,li(z[wt],re,wt))}),$e;function Nt(wt,Ae){re&&(Ae=Ae.map(ke=>ke.toLowerCase())),Ae.forEach(function(ke){const Ie=ke.split("|");$e[Ie[0]]=[wt,Ki(Ie[0],Ie[1])]})}}function Ki(z,re){return re?Number(re):oa(z)?0:1}function oa(z){return mt.includes(z.toLowerCase())}const mr={},Bt=z=>{console.error(z)},Ls=(z,...re)=>{console.log(`WARN: ${z}`,...re)},wi=(z,re)=>{mr[`${z}/${re}`]||(console.log(`Deprecated as of ${z}. ${re}`),mr[`${z}/${re}`]=!0)},Bs=new Error;function zs(z,re,{key:xe}){let $e=0;const Nt=z[xe],wt={},Ae={};for(let ke=1;ke<=re.length;ke++)Ae[ke+$e]=Nt[ke],wt[ke+$e]=!0,$e+=A(re[ke-1]);z[xe]=Ae,z[xe]._emit=wt,z[xe]._multi=!0}function Qa(z){if(Array.isArray(z.begin)){if(z.skip||z.excludeBegin||z.returnBegin)throw Bt("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Bs;if(typeof z.beginScope!="object"||z.beginScope===null)throw Bt("beginScope must be object"),Bs;zs(z,z.begin,{key:"beginScope"}),z.begin=D(z.begin,{joinWith:""})}}function pr(z){if(Array.isArray(z.end)){if(z.skip||z.excludeEnd||z.returnEnd)throw Bt("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Bs;if(typeof z.endScope!="object"||z.endScope===null)throw Bt("endScope must be object"),Bs;zs(z,z.end,{key:"endScope"}),z.end=D(z.end,{joinWith:""})}}function fl(z){z.scope&&typeof z.scope=="object"&&z.scope!==null&&(z.beginScope=z.scope,delete z.scope)}function Ja(z){fl(z),typeof z.beginScope=="string"&&(z.beginScope={_wrap:z.beginScope}),typeof z.endScope=="string"&&(z.endScope={_wrap:z.endScope}),Qa(z),pr(z)}function Is(z){function re(Ae,ke){return new RegExp(b(Ae),"m"+(z.case_insensitive?"i":"")+(z.unicodeRegex?"u":"")+(ke?"g":""))}class xe{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(ke,Ie){Ie.position=this.position++,this.matchIndexes[this.matchAt]=Ie,this.regexes.push([Ie,ke]),this.matchAt+=A(ke)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const ke=this.regexes.map(Ie=>Ie[1]);this.matcherRe=re(D(ke,{joinWith:"|"}),!0),this.lastIndex=0}exec(ke){this.matcherRe.lastIndex=this.lastIndex;const Ie=this.matcherRe.exec(ke);if(!Ie)return null;const qt=Ie.findIndex((Ps,to)=>to>0&&Ps!==void 0),jt=this.matchIndexes[qt];return Ie.splice(0,qt),Object.assign(Ie,jt)}}class $e{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(ke){if(this.multiRegexes[ke])return this.multiRegexes[ke];const Ie=new xe;return this.rules.slice(ke).forEach(([qt,jt])=>Ie.addRule(qt,jt)),Ie.compile(),this.multiRegexes[ke]=Ie,Ie}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(ke,Ie){this.rules.push([ke,Ie]),Ie.type==="begin"&&this.count++}exec(ke){const Ie=this.getMatcher(this.regexIndex);Ie.lastIndex=this.lastIndex;let qt=Ie.exec(ke);if(this.resumingScanAtSamePosition()&&!(qt&&qt.index===this.lastIndex)){const jt=this.getMatcher(0);jt.lastIndex=this.lastIndex+1,qt=jt.exec(ke)}return qt&&(this.regexIndex+=qt.position+1,this.regexIndex===this.count&&this.considerAll()),qt}}function Nt(Ae){const ke=new $e;return Ae.contains.forEach(Ie=>ke.addRule(Ie.begin,{rule:Ie,type:"begin"})),Ae.terminatorEnd&&ke.addRule(Ae.terminatorEnd,{type:"end"}),Ae.illegal&&ke.addRule(Ae.illegal,{type:"illegal"}),ke}function wt(Ae,ke){const Ie=Ae;if(Ae.isCompiled)return Ie;[lt,Os,Ja,_e].forEach(jt=>jt(Ae,ke)),z.compilerExtensions.forEach(jt=>jt(Ae,ke)),Ae.__beforeBegin=null,[Be,Lt,Jn].forEach(jt=>jt(Ae,ke)),Ae.isCompiled=!0;let qt=null;return typeof Ae.keywords=="object"&&Ae.keywords.$pattern&&(Ae.keywords=Object.assign({},Ae.keywords),qt=Ae.keywords.$pattern,delete Ae.keywords.$pattern),qt=qt||/\w+/,Ae.keywords&&(Ae.keywords=li(Ae.keywords,z.case_insensitive)),Ie.keywordPatternRe=re(qt,!0),ke&&(Ae.begin||(Ae.begin=/\B|\b/),Ie.beginRe=re(Ie.begin),!Ae.end&&!Ae.endsWithParent&&(Ae.end=/\B|\b/),Ae.end&&(Ie.endRe=re(Ie.end)),Ie.terminatorEnd=b(Ie.end)||"",Ae.endsWithParent&&ke.terminatorEnd&&(Ie.terminatorEnd+=(Ae.end?"|":"")+ke.terminatorEnd)),Ae.illegal&&(Ie.illegalRe=re(Ae.illegal)),Ae.contains||(Ae.contains=[]),Ae.contains=[].concat(...Ae.contains.map(function(jt){return Mn(jt==="self"?Ae:jt)})),Ae.contains.forEach(function(jt){wt(jt,Ie)}),Ae.starts&&wt(Ae.starts,ke),Ie.matcher=Nt(Ie),Ie}if(z.compilerExtensions||(z.compilerExtensions=[]),z.contains&&z.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return z.classNameAliases=s(z.classNameAliases||{}),wt(z)}function gi(z){return z?z.endsWithParent||gi(z.starts):!1}function Mn(z){return z.variants&&!z.cachedVariants&&(z.cachedVariants=z.variants.map(function(re){return s(z,{variants:null},re)})),z.cachedVariants?z.cachedVariants:gi(z)?s(z,{starts:z.starts?s(z.starts):null}):Object.isFrozen(z)?s(z):z}var ki="11.11.1";class ml extends Error{constructor(re,xe){super(re),this.name="HTMLInjectionError",this.html=xe}}const la=i,eo=s,rt=Symbol("nomatch"),es=7,gn=function(z){const re=Object.create(null),xe=Object.create(null),$e=[];let Nt=!0;const wt="Could not find the language '{}', did you forget to load/include a language module?",Ae={disableAutodetect:!0,name:"Plain text",contains:[]};let ke={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:p};function Ie(pe){return ke.noHighlightRe.test(pe)}function qt(pe){let je=pe.className+" ";je+=pe.parentNode?pe.parentNode.className:"";const Xe=ke.languageDetectRe.exec(je);if(Xe){const pt=Gi(Xe[1]);return pt||(Ls(wt.replace("{}",Xe[1])),Ls("Falling back to no-highlight mode for this block.",pe)),pt?Xe[1]:"no-highlight"}return je.split(/\s+/).find(pt=>Ie(pt)||Gi(pt))}function jt(pe,je,Xe){let pt="",Gt="";typeof je=="object"?(pt=pe,Xe=je.ignoreIllegals,Gt=je.language):(wi("10.7.0","highlight(lang, code, ...args) has been deprecated."),wi("10.7.0",`Please use highlight(code, options) instead.
|
|
158
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),Gt=pe,pt=je),Xe===void 0&&(Xe=!0);const Pi={code:pt,language:Gt};ua("before:highlight",Pi);const bn=Pi.result?Pi.result:Ps(Pi.language,Pi.code,Xe);return bn.code=Pi.code,ua("after:highlight",bn),bn}function Ps(pe,je,Xe,pt){const Gt=Object.create(null);function Pi(ve,Me){return ve.keywords[Me]}function bn(){if(!ze.keywords){Qt.addText(gt);return}let ve=0;ze.keywordPatternRe.lastIndex=0;let Me=ze.keywordPatternRe.exec(gt),Fe="";for(;Me;){Fe+=gt.substring(ve,Me.index);const tt=Ei.case_insensitive?Me[0].toLowerCase():Me[0],zt=Pi(ze,tt);if(zt){const[Rn,xl]=zt;if(Qt.addText(Fe),Fe="",Gt[tt]=(Gt[tt]||0)+1,Gt[tt]<=es&&(_r+=xl),Rn.startsWith("_"))Fe+=Me[0];else{const bu=Ei.classNameAliases[Rn]||Rn;vn(Me[0],bu)}}else Fe+=Me[0];ve=ze.keywordPatternRe.lastIndex,Me=ze.keywordPatternRe.exec(gt)}Fe+=gt.substring(ve),Qt.addText(Fe)}function nn(){if(gt==="")return;let ve=null;if(typeof ze.subLanguage=="string"){if(!re[ze.subLanguage]){Qt.addText(gt);return}ve=Ps(ze.subLanguage,gt,!0,gu[ze.subLanguage]),gu[ze.subLanguage]=ve._top}else ve=io(gt,ze.subLanguage.length?ze.subLanguage:null);ze.relevance>0&&(_r+=ve.relevance),Qt.__addSublanguage(ve._emitter,ve.language)}function Ct(){ze.subLanguage!=null?nn():bn(),gt=""}function vn(ve,Me){ve!==""&&(Qt.startScope(Me),Qt.addText(ve),Qt.endScope())}function mu(ve,Me){let Fe=1;const tt=Me.length-1;for(;Fe<=tt;){if(!ve._emit[Fe]){Fe++;continue}const zt=Ei.classNameAliases[ve[Fe]]||ve[Fe],Rn=Me[Fe];zt?vn(Rn,zt):(gt=Rn,bn(),gt=""),Fe++}}function so(ve,Me){return ve.scope&&typeof ve.scope=="string"&&Qt.openNode(Ei.classNameAliases[ve.scope]||ve.scope),ve.beginScope&&(ve.beginScope._wrap?(vn(gt,Ei.classNameAliases[ve.beginScope._wrap]||ve.beginScope._wrap),gt=""):ve.beginScope._multi&&(mu(ve.beginScope,Me),gt="")),ze=Object.create(ve,{parent:{value:ze}}),ze}function bl(ve,Me,Fe){let tt=N(ve.endRe,Fe);if(tt){if(ve["on:end"]){const zt=new t(ve);ve["on:end"](Me,zt),zt.isMatchIgnored&&(tt=!1)}if(tt){for(;ve.endsParent&&ve.parent;)ve=ve.parent;return ve}}if(ve.endsWithParent)return bl(ve.parent,Me,Fe)}function ro(ve){return ze.matcher.regexIndex===0?(gt+=ve[0],1):(xr=!0,0)}function nf(ve){const Me=ve[0],Fe=ve.rule,tt=new t(Fe),zt=[Fe.__beforeBegin,Fe["on:begin"]];for(const Rn of zt)if(Rn&&(Rn(ve,tt),tt.isMatchIgnored))return ro(Me);return Fe.skip?gt+=Me:(Fe.excludeBegin&&(gt+=Me),Ct(),!Fe.returnBegin&&!Fe.excludeBegin&&(gt=Me)),so(Fe,ve),Fe.returnBegin?0:Me.length}function sn(ve){const Me=ve[0],Fe=je.substring(ve.index),tt=bl(ze,ve,Fe);if(!tt)return rt;const zt=ze;ze.endScope&&ze.endScope._wrap?(Ct(),vn(Me,ze.endScope._wrap)):ze.endScope&&ze.endScope._multi?(Ct(),mu(ze.endScope,ve)):zt.skip?gt+=Me:(zt.returnEnd||zt.excludeEnd||(gt+=Me),Ct(),zt.excludeEnd&&(gt=Me));do ze.scope&&Qt.closeNode(),!ze.skip&&!ze.subLanguage&&(_r+=ze.relevance),ze=ze.parent;while(ze!==tt.parent);return tt.starts&&so(tt.starts,ve),zt.returnEnd?0:Me.length}function vl(){const ve=[];for(let Me=ze;Me!==Ei;Me=Me.parent)Me.scope&&ve.unshift(Me.scope);ve.forEach(Me=>Qt.openNode(Me))}let da={};function ao(ve,Me){const Fe=Me&&Me[0];if(gt+=ve,Fe==null)return Ct(),0;if(da.type==="begin"&&Me.type==="end"&&da.index===Me.index&&Fe===""){if(gt+=je.slice(Me.index,Me.index+1),!Nt){const tt=new Error(`0 width match regex (${pe})`);throw tt.languageName=pe,tt.badRule=da.rule,tt}return 1}if(da=Me,Me.type==="begin")return nf(Me);if(Me.type==="illegal"&&!Xe){const tt=new Error('Illegal lexeme "'+Fe+'" for mode "'+(ze.scope||"<unnamed>")+'"');throw tt.mode=ze,tt}else if(Me.type==="end"){const tt=sn(Me);if(tt!==rt)return tt}if(Me.type==="illegal"&&Fe==="")return gt+=`
|
|
159
|
-
`,1;if(_l>1e5&&_l>Me.index*3)throw new Error("potential infinite loop, way more iterations than matches");return gt+=Fe,Fe.length}const Ei=Gi(pe);if(!Ei)throw Bt(wt.replace("{}",pe)),new Error('Unknown language: "'+pe+'"');const pu=Is(Ei);let oo="",ze=pt||pu;const gu={},Qt=new ke.__emitter(ke);vl();let gt="",_r=0,Hs=0,_l=0,xr=!1;try{if(Ei.__emitTokens)Ei.__emitTokens(je,Qt);else{for(ze.matcher.considerAll();;){_l++,xr?xr=!1:ze.matcher.considerAll(),ze.matcher.lastIndex=Hs;const ve=ze.matcher.exec(je);if(!ve)break;const Me=je.substring(Hs,ve.index),Fe=ao(Me,ve);Hs=ve.index+Fe}ao(je.substring(Hs))}return Qt.finalize(),oo=Qt.toHTML(),{language:pe,value:oo,relevance:_r,illegal:!1,_emitter:Qt,_top:ze}}catch(ve){if(ve.message&&ve.message.includes("Illegal"))return{language:pe,value:la(je),illegal:!0,relevance:0,_illegalBy:{message:ve.message,index:Hs,context:je.slice(Hs-100,Hs+100),mode:ve.mode,resultSoFar:oo},_emitter:Qt};if(Nt)return{language:pe,value:la(je),illegal:!1,relevance:0,errorRaised:ve,_emitter:Qt,_top:ze};throw ve}}function to(pe){const je={value:la(pe),illegal:!1,relevance:0,_top:Ae,_emitter:new ke.__emitter(ke)};return je._emitter.addText(pe),je}function io(pe,je){je=je||ke.languages||Object.keys(re);const Xe=to(pe),pt=je.filter(Gi).filter(br).map(Ct=>Ps(Ct,pe,!1));pt.unshift(Xe);const Gt=pt.sort((Ct,vn)=>{if(Ct.relevance!==vn.relevance)return vn.relevance-Ct.relevance;if(Ct.language&&vn.language){if(Gi(Ct.language).supersetOf===vn.language)return 1;if(Gi(vn.language).supersetOf===Ct.language)return-1}return 0}),[Pi,bn]=Gt,nn=Pi;return nn.secondBest=bn,nn}function ds(pe,je,Xe){const pt=je&&xe[je]||Xe;pe.classList.add("hljs"),pe.classList.add(`language-${pt}`)}function Kt(pe){let je=null;const Xe=qt(pe);if(Ie(Xe))return;if(ua("before:highlightElement",{el:pe,language:Xe}),pe.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",pe);return}if(pe.children.length>0&&(ke.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(pe)),ke.throwUnescapedHTML))throw new ml("One of your code blocks includes unescaped HTML.",pe.innerHTML);je=pe;const pt=je.textContent,Gt=Xe?jt(pt,{language:Xe,ignoreIllegals:!0}):io(pt);pe.innerHTML=Gt.value,pe.dataset.highlighted="yes",ds(pe,Xe,Gt.language),pe.result={language:Gt.language,re:Gt.relevance,relevance:Gt.relevance},Gt.secondBest&&(pe.secondBest={language:Gt.secondBest.language,relevance:Gt.secondBest.relevance}),ua("after:highlightElement",{el:pe,result:Gt,text:pt})}function Ii(pe){ke=eo(ke,pe)}const gr=()=>{no(),wi("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function pl(){no(),wi("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let du=!1;function no(){function pe(){no()}if(document.readyState==="loading"){du||window.addEventListener("DOMContentLoaded",pe,!1),du=!0;return}document.querySelectorAll(ke.cssSelector).forEach(Kt)}function hu(pe,je){let Xe=null;try{Xe=je(z)}catch(pt){if(Bt("Language definition for '{}' could not be registered.".replace("{}",pe)),Nt)Bt(pt);else throw pt;Xe=Ae}Xe.name||(Xe.name=pe),re[pe]=Xe,Xe.rawDefinition=je.bind(null,z),Xe.aliases&&$s(Xe.aliases,{languageName:pe})}function ca(pe){delete re[pe];for(const je of Object.keys(xe))xe[je]===pe&&delete xe[je]}function gl(){return Object.keys(re)}function Gi(pe){return pe=(pe||"").toLowerCase(),re[pe]||re[xe[pe]]}function $s(pe,{languageName:je}){typeof pe=="string"&&(pe=[pe]),pe.forEach(Xe=>{xe[Xe.toLowerCase()]=je})}function br(pe){const je=Gi(pe);return je&&!je.disableAutodetect}function vr(pe){pe["before:highlightBlock"]&&!pe["before:highlightElement"]&&(pe["before:highlightElement"]=je=>{pe["before:highlightBlock"](Object.assign({block:je.el},je))}),pe["after:highlightBlock"]&&!pe["after:highlightElement"]&&(pe["after:highlightElement"]=je=>{pe["after:highlightBlock"](Object.assign({block:je.el},je))})}function Zt(pe){vr(pe),$e.push(pe)}function fu(pe){const je=$e.indexOf(pe);je!==-1&&$e.splice(je,1)}function ua(pe,je){const Xe=pe;$e.forEach(function(pt){pt[Xe]&&pt[Xe](je)})}function Us(pe){return wi("10.7.0","highlightBlock will be removed entirely in v12.0"),wi("10.7.0","Please use highlightElement now."),Kt(pe)}Object.assign(z,{highlight:jt,highlightAuto:io,highlightAll:no,highlightElement:Kt,highlightBlock:Us,configure:Ii,initHighlighting:gr,initHighlightingOnLoad:pl,registerLanguage:hu,unregisterLanguage:ca,listLanguages:gl,getLanguage:Gi,registerAliases:$s,autoDetection:br,inherit:eo,addPlugin:Zt,removePlugin:fu}),z.debugMode=function(){Nt=!1},z.safeMode=function(){Nt=!0},z.versionString=ki,z.regex={concat:S,lookahead:_,either:C,optional:y,anyNumberOfTimes:x};for(const pe in Ze)typeof Ze[pe]=="object"&&e(Ze[pe]);return Object.assign(z,Ze),z},zi=gn({});return zi.newInstance=()=>gn({}),Wp=zi,zi.HighlightJS=zi,zi.default=zi,Wp}var Yp,s2;function yU(){if(s2)return Yp;s2=1;function e(t){const i=t.regex,s=i.concat(/[\p{L}_]/u,i.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),a=/[\p{L}0-9._:-]+/u,o={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},u={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},h=t.inherit(u,{begin:/\(/,end:/\)/}),m=t.inherit(t.APOS_STRING_MODE,{className:"string"}),f=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),p={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:a,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[o]},{begin:/'/,end:/'/,contains:[o]},{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:[u,f,m,h,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[u,h,f,m]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},o,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[f]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[p],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[p],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:i.concat(/</,i.lookahead(i.concat(s,i.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:s,relevance:0,starts:p}]},{className:"tag",begin:i.concat(/<\//,i.lookahead(i.concat(s,/>/))),contains:[{className:"name",begin:s,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}return Yp=e,Yp}var Xp,r2;function SU(){if(r2)return Xp;r2=1;function e(t){const i=t.regex,s={},a={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[s]}]};Object.assign(s,{className:"variable",variants:[{begin:i.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},a]});const o={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},u=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),h={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,s,o]};o.contains.push(m);const f={match:/\\"/},p={className:"string",begin:/'/,end:/'/},b={match:/\\'/},_={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,s]},x=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],y=t.SHEBANG({binary:`(${x.join("|")})`,relevance:10}),S={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},E=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],C=["true","false"],A={match:/(\/[a-z._-]+)+/},N=["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"],D=["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:E,literal:C,built_in:[...N,...M,"set","shopt",...D,...U]},contains:[y,t.SHEBANG(),S,_,u,h,A,m,f,p,b,s]}}return Xp=e,Xp}var Zp,a2;function wU(){if(a2)return Zp;a2=1;function e(t){const i=t.regex,s=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),a="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",h="("+a+"|"+i.optional(o)+"[a-zA-Z_]\\w*"+i.optional("<[^<>]+>")+")",m={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},p={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})"/})]},b={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},_={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(p,{className:"string"}),{className:"string",begin:/<.*?>/},s,t.C_BLOCK_COMMENT_MODE]},x={className:"title",begin:i.optional(o)+t.IDENT_RE,relevance:0},y=i.optional(o)+t.IDENT_RE+"\\s*\\(",C={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"},A=[_,m,s,t.C_BLOCK_COMMENT_MODE,b,p],N={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:C,contains:A.concat([{begin:/\(/,end:/\)/,keywords:C,contains:A.concat(["self"]),relevance:0}]),relevance:0},M={begin:"("+h+"[\\*&\\s]+)+"+y,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:C,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:C,relevance:0},{begin:y,returnBegin:!0,contains:[t.inherit(x,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:C,relevance:0,contains:[s,t.C_BLOCK_COMMENT_MODE,p,b,m,{begin:/\(/,end:/\)/,keywords:C,relevance:0,contains:["self",s,t.C_BLOCK_COMMENT_MODE,p,b,m]}]},m,s,t.C_BLOCK_COMMENT_MODE,_]};return{name:"C",aliases:["h"],keywords:C,disableAutodetect:!0,illegal:"</",contains:[].concat(N,M,A,[_,{begin:t.IDENT_RE+"::",keywords:C},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:_,strings:p,keywords:C}}}return Zp=e,Zp}var Qp,o2;function kU(){if(o2)return Qp;o2=1;function e(t){const i=t.regex,s=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),a="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",h="(?!struct)("+a+"|"+i.optional(o)+"[a-zA-Z_]\\w*"+i.optional("<[^<>]+>")+")",m={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},p={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})"/})]},b={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},_={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(p,{className:"string"}),{className:"string",begin:/<.*?>/},s,t.C_BLOCK_COMMENT_MODE]},x={className:"title",begin:i.optional(o)+t.IDENT_RE,relevance:0},y=i.optional(o)+t.IDENT_RE+"\\s*\\(",S=["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"],E=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],C=["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"],A=["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"],D={type:E,keyword:S,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:C},U={className:"function.dispatch",relevance:0,keywords:{_hint:A},begin:i.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,i.lookahead(/(<[^<>]+>|)\s*\(/))},L=[U,_,m,s,t.C_BLOCK_COMMENT_MODE,b,p],R={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:D,contains:L.concat([{begin:/\(/,end:/\)/,keywords:D,contains:L.concat(["self"]),relevance:0}]),relevance:0},$={className:"function",begin:"("+h+"[\\*&\\s]+)+"+y,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:D,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:D,relevance:0},{begin:y,returnBegin:!0,contains:[x],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[p,b]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:D,relevance:0,contains:[s,t.C_BLOCK_COMMENT_MODE,p,b,m,{begin:/\(/,end:/\)/,keywords:D,relevance:0,contains:["self",s,t.C_BLOCK_COMMENT_MODE,p,b,m]}]},m,s,t.C_BLOCK_COMMENT_MODE,_]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:D,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(R,$,U,L,[_,{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:D,contains:["self",m]},{begin:t.IDENT_RE+"::",keywords:D},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}return Qp=e,Qp}var Jp,l2;function EU(){if(l2)return Jp;l2=1;function e(t){const i=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],s=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],a=["default","false","null","true"],o=["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"],u=["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"],h={keyword:o.concat(u),built_in:i,literal:a},m=t.inherit(t.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),f={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},p={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},b={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},_=t.inherit(b,{illegal:/\n/}),x={className:"subst",begin:/\{/,end:/\}/,keywords:h},y=t.inherit(x,{illegal:/\n/}),S={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,y]},E={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},x]},C=t.inherit(E,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},y]});x.contains=[E,S,b,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,f,t.C_BLOCK_COMMENT_MODE],y.contains=[C,S,_,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,f,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const A={variants:[p,E,S,b,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},N={begin:"<",end:">",contains:[{beginKeywords:"in out"},m]},M=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",D={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:h,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"}},A,f,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},m,N,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,N,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:h,contains:[{beginKeywords:s.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,N],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:h,relevance:0,contains:[A,f,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},D]}}return Jp=e,Jp}var eg,c2;function CU(){if(c2)return eg;c2=1;const e=f=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:f.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:[f.APOS_STRING_MODE,f.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:f.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"],i=["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"],s=[...t,...i],a=["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(),o=["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(),u=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),h=["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(f){const p=f.regex,b=e(f),_={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},x="and or not only",y=/@-?\w[\w]*(-\w+)*/,S="[a-zA-Z-][a-zA-Z0-9_-]*",E=[f.APOS_STRING_MODE,f.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[b.BLOCK_COMMENT,_,b.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+S,relevance:0},b.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+o.join("|")+")"},{begin:":(:)?("+u.join("|")+")"}]},b.CSS_VARIABLE,{className:"attribute",begin:"\\b("+h.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[b.BLOCK_COMMENT,b.HEXCOLOR,b.IMPORTANT,b.CSS_NUMBER_MODE,...E,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...E,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},b.FUNCTION_DISPATCH]},{begin:p.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:y},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:x,attribute:a.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...E,b.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+s.join("|")+")\\b"}]}}return eg=m,eg}var tg,u2;function NU(){if(u2)return tg;u2=1;function e(t){const i=t.regex,s={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},a={begin:"^[-\\*]{3,}",end:"$"},o={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}]},u={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},h={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+.-]*/,f={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:i.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}]},p={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},b={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},_=t.inherit(p,{contains:[]}),x=t.inherit(b,{contains:[]});p.contains.push(x),b.contains.push(_);let y=[s,f];return[p,b,_,x].forEach(A=>{A.contains=A.contains.concat(y)}),y=y.concat(p,b),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:y},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:y}]}]},s,u,p,b,{className:"quote",begin:"^>\\s+",contains:y,end:"$"},o,a,f,h,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}return tg=e,tg}var ig,d2;function TU(){if(d2)return ig;d2=1;function e(t){const i=t.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:i.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:i.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 ig=e,ig}var ng,h2;function AU(){if(h2)return ng;h2=1;function e(t){const i=t.regex,s="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",a=i.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),o=i.concat(a,/(::\w+)*/),h={"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]+"},f={begin:"#<",end:">"},p=[t.COMMENT("#","$",{contains:[m]}),t.COMMENT("^=begin","^=end",{contains:[m],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],b={className:"subst",begin:/#\{/,end:/\}/,keywords:h},_={className:"string",contains:[t.BACKSLASH_ESCAPE,b],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:i.concat(/<<[-~]?'?/,i.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,b]})]}]},x="[1-9](_?[0-9])*|0",y="[0-9](_?[0-9])*",S={className:"number",relevance:0,variants:[{begin:`\\b(${x})(\\.(${y}))?([eE][+-]?(${y})|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"}]},E={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:h}]},L=[_,{variants:[{match:[/class\s+/,o,/\s+<\s+/,o]},{match:[/\b(class|module)\s+/,o]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:h},{match:[/(include|extend)\s+/,o],scope:{2:"title.class"},keywords:h},{relevance:0,match:[o,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:a,scope:"title.class"},{match:[/def/,/\s+/,s],scope:{1:"keyword",3:"title.function"},contains:[E]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[_,{begin:s}],relevance:0},S,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:h},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,b],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(f,p),relevance:0}].concat(f,p);b.contains=L,E.contains=L;const F=[{begin:/^\s*=>/,starts:{end:"$",contains:L}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:h,contains:L}}];return p.unshift(f),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:h,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(F).concat(p).concat(L)}}return ng=e,ng}var sg,f2;function MU(){if(f2)return sg;f2=1;function e(t){const u={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:u,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:u,illegal:/["']/}]}]}}return sg=e,sg}var rg,m2;function RU(){if(m2)return rg;m2=1;function e(t){const i=t.regex,s=/[_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:i.concat(s,i.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}return rg=e,rg}var ag,p2;function jU(){if(p2)return ag;p2=1;function e(t){const i=t.regex,s={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:t.NUMBER_RE}]},a=t.COMMENT();a.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const o={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},u={className:"literal",begin:/\bon|off|true|false|yes|no\b/},h={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},m={begin:/\[/,end:/\]/,contains:[a,u,o,h,s,"self"],relevance:0},f=/[A-Za-z0-9_-]+/,p=/"(\\"|[^"])*"/,b=/'[^']*'/,_=i.either(f,p,b),x=i.concat(_,"(\\s*\\.\\s*",_,")*",i.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[a,{className:"section",begin:/\[+/,end:/\]+/},{begin:x,className:"attr",starts:{end:/$/,contains:[a,m,u,o,h,s]}}]}}return ag=e,ag}var og,g2;function DU(){if(g2)return og;g2=1;var e="[0-9](_*[0-9])*",t=`\\.(${e})`,i="[0-9a-fA-F](_*[0-9a-fA-F])*",s={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]((${i})\\.?|(${i})?\\.(${i}))[pP][+-]?(${e})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${i})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function a(u,h,m){return m===-1?"":u.replace(h,f=>a(u,h,m-1))}function o(u){const h=u.regex,m="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",f=m+a("(?:<"+m+"~~~(?:\\s*,\\s*"+m+"~~~)*>)?",/~~~/g,2),y={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"]},S={className:"meta",begin:"@"+m,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},E={className:"params",begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:[u.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:y,illegal:/<\/|#/,contains:[u.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},u.C_LINE_COMMENT_MODE,u.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[u.BACKSLASH_ESCAPE]},u.APOS_STRING_MODE,u.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:[h.concat(/(?!else)/,m),/\s+/,m,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,m],className:{1:"keyword",3:"title.class"},contains:[E,u.C_LINE_COMMENT_MODE,u.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+f+"\\s+)",u.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:y,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:[S,u.APOS_STRING_MODE,u.QUOTE_STRING_MODE,s,u.C_BLOCK_COMMENT_MODE]},u.C_LINE_COMMENT_MODE,u.C_BLOCK_COMMENT_MODE]},s,S]}}return og=o,og}var lg,b2;function OU(){if(b2)return lg;b2=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"],i=["true","false","null","undefined","NaN","Infinity"],s=["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"],a=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],o=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],u=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],h=[].concat(o,s,a);function m(f){const p=f.regex,b=(fe,{after:we})=>{const ye="</"+fe[0].slice(1);return fe.input.indexOf(ye,we)!==-1},_=e,x={begin:"<>",end:"</>"},y=/<[A-Za-z0-9\\._:-]+\s*\/>/,S={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(fe,we)=>{const ye=fe[0].length+fe.index,Ze=fe.input[ye];if(Ze==="<"||Ze===","){we.ignoreMatch();return}Ze===">"&&(b(fe,{after:ye})||we.ignoreMatch());let ot;const lt=fe.input.substring(ye);if(ot=lt.match(/^\s*=/)){we.ignoreMatch();return}if((ot=lt.match(/^\s+extends\s+/))&&ot.index===0){we.ignoreMatch();return}}},E={$pattern:e,keyword:t,literal:i,built_in:h,"variable.language":u},C="[0-9](_?[0-9])*",A=`\\.(${C})`,N="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",M={className:"number",variants:[{begin:`(\\b(${N})((${A})|\\.)?|(${A}))[eE][+-]?(${C})\\b`},{begin:`\\b(${N})\\b((${A})\\b|\\.)?|(${A})\\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},D={className:"subst",begin:"\\$\\{",end:"\\}",keywords:E,contains:[]},U={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[f.BACKSLASH_ESCAPE,D],subLanguage:"xml"}},L={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[f.BACKSLASH_ESCAPE,D],subLanguage:"css"}},R={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[f.BACKSLASH_ESCAPE,D],subLanguage:"graphql"}},$={className:"string",begin:"`",end:"`",contains:[f.BACKSLASH_ESCAPE,D]},F={className:"comment",variants:[f.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:_+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),f.C_BLOCK_COMMENT_MODE,f.C_LINE_COMMENT_MODE]},G=[f.APOS_STRING_MODE,f.QUOTE_STRING_MODE,U,L,R,$,{match:/\$\d+/},M];D.contains=G.concat({begin:/\{/,end:/\}/,keywords:E,contains:["self"].concat(G)});const Y=[].concat(F,D.contains),Q=Y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:E,contains:["self"].concat(Y)}]),q={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:E,contains:Q},O={variants:[{match:[/class/,/\s+/,_,/\s+/,/extends/,/\s+/,p.concat(_,"(",p.concat(/\./,_),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,_],scope:{1:"keyword",3:"title.class"}}]},X={relevance:0,match:p.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:{_:[...s,...a]}},Z={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},V={variants:[{match:[/function/,/\s+/,_,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[q],illegal:/%/},P={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function j(fe){return p.concat("(?!",fe.join("|"),")")}const W={match:p.concat(/\b/,j([...o,"super","import"].map(fe=>`${fe}\\s*\\(`)),_,p.lookahead(/\s*\(/)),className:"title.function",relevance:0},he={begin:p.concat(/\./,p.lookahead(p.concat(_,/(?![0-9A-Za-z$_(])/))),end:_,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},oe={match:[/get|set/,/\s+/,_,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},q]},me="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+f.UNDERSCORE_IDENT_RE+")\\s*=>",ne={match:[/const|var|let/,/\s+/,_,/\s*/,/=\s*/,/(async\s*)?/,p.lookahead(me)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[q]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:E,exports:{PARAMS_CONTAINS:Q,CLASS_REFERENCE:X},illegal:/#(?![$_A-z])/,contains:[f.SHEBANG({label:"shebang",binary:"node",relevance:5}),Z,f.APOS_STRING_MODE,f.QUOTE_STRING_MODE,U,L,R,$,F,{match:/\$\d+/},M,X,{scope:"attr",match:_+p.lookahead(":"),relevance:0},ne,{begin:"("+f.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[F,f.REGEXP_MODE,{className:"function",begin:me,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:f.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:E,contains:Q}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:x.begin,end:x.end},{match:y},{begin:S.begin,"on:begin":S.isTrulyOpeningTag,end:S.end}],subLanguage:"xml",contains:[{begin:S.begin,end:S.end,skip:!0,contains:["self"]}]}]},V,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+f.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[q,f.inherit(f.TITLE_MODE,{begin:_,className:"title.function"})]},{match:/\.\.\./,relevance:0},he,{match:"\\$"+_,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[q]},W,P,O,oe,{match:/\$[(.]/}]}}return lg=m,lg}var cg,v2;function LU(){if(v2)return cg;v2=1;function e(t){const i={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},s={match:/[{}[\],:]/,className:"punctuation",relevance:0},a=["true","false","null"],o={scope:"literal",beginKeywords:a.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:a},contains:[i,s,t.QUOTE_STRING_MODE,o,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}return cg=e,cg}var ug,_2;function BU(){if(_2)return ug;_2=1;var e="[0-9](_*[0-9])*",t=`\\.(${e})`,i="[0-9a-fA-F](_*[0-9a-fA-F])*",s={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]((${i})\\.?|(${i})?\\.(${i}))[pP][+-]?(${e})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${i})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function a(o){const u={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"},h={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},m={className:"symbol",begin:o.UNDERSCORE_IDENT_RE+"@"},f={className:"subst",begin:/\$\{/,end:/\}/,contains:[o.C_NUMBER_MODE]},p={className:"variable",begin:"\\$"+o.UNDERSCORE_IDENT_RE},b={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[p,f]},{begin:"'",end:"'",illegal:/\n/,contains:[o.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[o.BACKSLASH_ESCAPE,p,f]}]};f.contains.push(b);const _={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+o.UNDERSCORE_IDENT_RE+")?"},x={className:"meta",begin:"@"+o.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[o.inherit(b,{className:"string"}),"self"]}]},y=s,S=o.COMMENT("/\\*","\\*/",{contains:[o.C_BLOCK_COMMENT_MODE]}),E={variants:[{className:"type",begin:o.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},C=E;return C.variants[1].contains=[E],E.variants[1].contains=[C],{name:"Kotlin",aliases:["kt","kts"],keywords:u,contains:[o.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),o.C_LINE_COMMENT_MODE,S,h,m,_,x,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:u,relevance:5,contains:[{begin:o.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[o.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:u,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[E,o.C_LINE_COMMENT_MODE,S],relevance:0},o.C_LINE_COMMENT_MODE,S,_,x,b,o.C_NUMBER_MODE]},S]},{begin:[/class|interface|trait/,/\s+/,o.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},o.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},_,x]},b,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
160
|
-
`},y]}}return ug=a,ug}var dg,x2;function zU(){if(x2)return dg;x2=1;const e=p=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:p.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:[p.APOS_STRING_MODE,p.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:p.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"],i=["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"],s=[...t,...i],a=["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(),o=["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(),u=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),h=["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=o.concat(u).sort().reverse();function f(p){const b=e(p),_=m,x="and or not only",y="[\\w-]+",S="("+y+"|@\\{"+y+"\\})",E=[],C=[],A=function(Y){return{className:"string",begin:"~?"+Y+".*?"+Y}},N=function(Y,Q,q){return{className:Y,begin:Q,relevance:q}},M={$pattern:/[a-z-]+/,keyword:x,attribute:a.join(" ")},D={begin:"\\(",end:"\\)",contains:C,keywords:M,relevance:0};C.push(p.C_LINE_COMMENT_MODE,p.C_BLOCK_COMMENT_MODE,A("'"),A('"'),b.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},b.HEXCOLOR,D,N("variable","@@?"+y,10),N("variable","@\\{"+y+"\\}"),N("built_in","~?`[^`]*?`"),{className:"attribute",begin:y+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},b.IMPORTANT,{beginKeywords:"and not"},b.FUNCTION_DISPATCH);const U=C.concat({begin:/\{/,end:/\}/,contains:E}),L={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(C)},R={begin:S+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},b.CSS_VARIABLE,{className:"attribute",begin:"\\b("+h.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:C}}]},$={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:C,relevance:0}},I={className:"variable",variants:[{begin:"@"+y+"\\s*:",relevance:15},{begin:"@"+y}],starts:{end:"[;}]",returnEnd:!0,contains:U}},F={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:S,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[p.C_LINE_COMMENT_MODE,p.C_BLOCK_COMMENT_MODE,L,N("keyword","all\\b"),N("variable","@\\{"+y+"\\}"),{begin:"\\b("+s.join("|")+")\\b",className:"selector-tag"},b.CSS_NUMBER_MODE,N("selector-tag",S,0),N("selector-id","#"+S),N("selector-class","\\."+S,0),N("selector-tag","&",0),b.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+o.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+u.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:U},{begin:"!important"},b.FUNCTION_DISPATCH]},G={begin:y+`:(:)?(${_.join("|")})`,returnBegin:!0,contains:[F]};return E.push(p.C_LINE_COMMENT_MODE,p.C_BLOCK_COMMENT_MODE,$,I,G,R,F,L,b.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:E}}return dg=f,dg}var hg,y2;function IU(){if(y2)return hg;y2=1;function e(t){const i="\\[=*\\[",s="\\]=*\\]",a={begin:i,end:s,contains:["self"]},o=[t.COMMENT("--(?!"+i+")","$"),t.COMMENT("--"+i,s,{contains:[a],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:o.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:o}].concat(o)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:i,end:s,contains:[a],relevance:5}])}}return hg=e,hg}var fg,S2;function PU(){if(S2)return fg;S2=1;function e(t){const i={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},s={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,i]},a={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:[i,s]},o={begin:"^"+t.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},u={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},h={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[i]};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,i,s,a,o,u,h]}}return fg=e,fg}var mg,w2;function $U(){if(w2)return mg;w2=1;function e(t){const i=t.regex,s=["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"],a=/[dualxmsipngr]{0,12}/,o={$pattern:/[\w.]+/,keyword:s.join(" ")},u={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:o},h={begin:/->\{/,end:/\}/},m={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},f={scope:"variable",variants:[{begin:/\$\d/},{begin:i.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[m]},p={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},b=[t.BACKSLASH_ESCAPE,u,f],_=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],x=(E,C,A="\\1")=>{const N=A==="\\1"?A:i.concat(A,C);return i.concat(i.concat("(?:",E,")"),C,/(?:\\.|[^\\\/])*?/,N,/(?:\\.|[^\\\/])*?/,A,a)},y=(E,C,A)=>i.concat(i.concat("(?:",E,")"),C,/(?:\\.|[^\\\/])*?/,A,a),S=[f,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),h,{className:"string",contains:b,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}]},p,{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:x("s|tr|y",i.either(..._,{capture:!0}))},{begin:x("s|tr|y","\\(","\\)")},{begin:x("s|tr|y","\\[","\\]")},{begin:x("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:y("(?:m|qr)?",/\//,/\//)},{begin:y("m|qr",i.either(..._,{capture:!0}),/\1/)},{begin:y("m|qr",/\(/,/\)/)},{begin:y("m|qr",/\[/,/\]/)},{begin:y("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,p]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return u.contains=S,h.contains=S,{name:"Perl",aliases:["pl","pm"],keywords:o,contains:S}}return mg=e,mg}var pg,k2;function UU(){if(k2)return pg;k2=1;function e(t){const i={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+"},s=/[a-zA-Z@][a-zA-Z0-9_]*/,m={"variable.language":["this","super"],$pattern:s,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"]},f={$pattern:s,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:m,illegal:"</",contains:[i,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:"("+f.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:f,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}}return pg=e,pg}var gg,E2;function HU(){if(E2)return gg;E2=1;function e(t){const i=t.regex,s=/(?![A-Za-z0-9])(?![$])/,a=i.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,s),o=i.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,s),u=i.concat(/[A-Z]+/,s),h={scope:"variable",match:"\\$+"+a},m={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},f={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},p=t.inherit(t.APOS_STRING_MODE,{illegal:null}),b=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(f)}),_={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(f),"on:begin":(q,O)=>{O.data._beginMatch=q[1]||q[2]},"on:end":(q,O)=>{O.data._beginMatch!==q[1]&&O.ignoreMatch()}},x=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),y=`[
|
|
161
|
-
]`,S={scope:"string",variants:[b,p,_,x]},E={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},C=["false","null","true"],A=["__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"],N=["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"],D={keyword:A,literal:(q=>{const O=[];return q.forEach(X=>{O.push(X),X.toLowerCase()===X?O.push(X.toUpperCase()):O.push(X.toLowerCase())}),O})(C),built_in:N},U=q=>q.map(O=>O.replace(/\|\d+$/,"")),L={variants:[{match:[/new/,i.concat(y,"+"),i.concat("(?!",U(N).join("\\b|"),"\\b)"),o],scope:{1:"keyword",4:"title.class"}}]},R=i.concat(a,"\\b(?!\\()"),$={variants:[{match:[i.concat(/::/,i.lookahead(/(?!class\b)/)),R],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[o,i.concat(/::/,i.lookahead(/(?!class\b)/)),R],scope:{1:"title.class",3:"variable.constant"}},{match:[o,i.concat("::",i.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[o,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},I={scope:"attr",match:i.concat(a,i.lookahead(":"),i.lookahead(/(?!::)/))},F={relevance:0,begin:/\(/,end:/\)/,keywords:D,contains:[I,h,$,t.C_BLOCK_COMMENT_MODE,S,E,L]},G={relevance:0,match:[/\b/,i.concat("(?!fn\\b|function\\b|",U(A).join("\\b|"),"|",U(N).join("\\b|"),"\\b)"),a,i.concat(y,"*"),i.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[F]};F.contains.push(G);const Y=[I,$,t.C_BLOCK_COMMENT_MODE,S,E,L],Q={begin:i.concat(/#\[\s*\\?/,i.either(o,u)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:C,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:C,keyword:["new","array"]},contains:["self",...Y]},...Y,{scope:"meta",variants:[{match:o},{match:u}]}]};return{case_insensitive:!1,keywords:D,contains:[Q,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/},h,G,$,{match:[/const/,/\s/,a],scope:{1:"keyword",3:"variable.constant"}},L,{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:D,contains:["self",Q,h,$,t.C_BLOCK_COMMENT_MODE,S,E]}]},{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]},S,E]}}return gg=e,gg}var bg,C2;function FU(){if(C2)return bg;C2=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 bg=e,bg}var vg,N2;function VU(){if(N2)return vg;N2=1;function e(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}return vg=e,vg}var _g,T2;function qU(){if(T2)return _g;T2=1;function e(t){const i=t.regex,s=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),a=["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:a,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"]},f={className:"meta",begin:/^(>>>|\.\.\.) /},p={className:"subst",begin:/\{/,end:/\}/,keywords:m,illegal:/#/},b={begin:/\{\{/,relevance:0},_={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,f],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,f],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,f,b,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,f,b,p]},{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,b,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,b,p]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},x="[0-9](_?[0-9])*",y=`(\\b(${x}))?\\.(${x})|\\b(${x})\\.`,S=`\\b|${a.join("|")}`,E={className:"number",relevance:0,variants:[{begin:`(\\b(${x})|(${y}))[eE][+-]?(${x})[jJ]?(?=${S})`},{begin:`(${y})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${S})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${S})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${S})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${S})`},{begin:`\\b(${x})[jJ](?=${S})`}]},C={className:"comment",begin:i.lookahead(/# type:/),end:/$/,keywords:m,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},A={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:m,contains:["self",f,E,_,t.HASH_COMMENT_MODE]}]};return p.contains=[_,E,f],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:m,illegal:/(<\/|\?)|=>/,contains:[f,E,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},_,C,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,s],scope:{1:"keyword",3:"title.function"},contains:[A]},{variants:[{match:[/\bclass/,/\s+/,s,/\s*/,/\(\s*/,s,/\s*\)/]},{match:[/\bclass/,/\s+/,s]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[E,A,_]}]}}return _g=e,_g}var xg,A2;function KU(){if(A2)return xg;A2=1;function e(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}return xg=e,xg}var yg,M2;function GU(){if(M2)return yg;M2=1;function e(t){const i=t.regex,s=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,a=i.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]?/),o=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,u=i.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:s,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:i.lookahead(i.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:s},{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:[o,a]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,a]},{scope:{1:"punctuation",2:"number"},match:[u,a]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,a]}]},{scope:{3:"operator"},match:[s,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:o},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:u},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}return yg=e,yg}var Sg,R2;function WU(){if(R2)return Sg;R2=1;function e(t){const i=t.regex,s=/(r#)?/,a=i.concat(s,t.UNDERSCORE_IDENT_RE),o=i.concat(s,t.IDENT_RE),u={className:"title.function.invoke",relevance:0,begin:i.concat(/\b/,/(?!let|for|while|if|else|match\b)/,o,i.lookahead(/\s*\(/))},h="([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"],f=["true","false","Some","None","Ok","Err"],p=["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!"],b=["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:b,keyword:m,literal:f,built_in:p},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_]+)"+h},{begin:"\\b0o([0-7_]+)"+h},{begin:"\\b0x([A-Fa-f0-9_]+)"+h},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+h}],relevance:0},{begin:[/fn/,/\s+/,a],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,a],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,a,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,a],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,a],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:p,type:b}},{className:"punctuation",begin:"->"},u]}}return Sg=e,Sg}var wg,j2;function YU(){if(j2)return wg;j2=1;const e=f=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:f.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:[f.APOS_STRING_MODE,f.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:f.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"],i=["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"],s=[...t,...i],a=["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(),o=["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(),u=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),h=["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(f){const p=e(f),b=u,_=o,x="@[a-z-]+",y="and or not only",E={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[f.C_LINE_COMMENT_MODE,f.C_BLOCK_COMMENT_MODE,p.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},p.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+s.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+_.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+b.join("|")+")"},E,{begin:/\(/,end:/\)/,contains:[p.CSS_NUMBER_MODE]},p.CSS_VARIABLE,{className:"attribute",begin:"\\b("+h.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:[p.BLOCK_COMMENT,E,p.HEXCOLOR,p.CSS_NUMBER_MODE,f.QUOTE_STRING_MODE,f.APOS_STRING_MODE,p.IMPORTANT,p.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:x,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:y,attribute:a.join(" ")},contains:[{begin:x,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},E,f.QUOTE_STRING_MODE,f.APOS_STRING_MODE,p.HEXCOLOR,p.CSS_NUMBER_MODE]},p.FUNCTION_DISPATCH]}}return wg=m,wg}var kg,D2;function XU(){if(D2)return kg;D2=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 kg=e,kg}var Eg,O2;function ZU(){if(O2)return Eg;O2=1;function e(t){const i=t.regex,s=t.COMMENT("--","$"),a={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},o={begin:/"/,end:/"/,contains:[{match:/""/}]},u=["true","false","unknown"],h=["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"],f=["add","asc","collation","desc","final","first","last","view"],p=["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"],b=["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"],_=["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"],x=["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"],y=b,S=[...p,...f].filter(U=>!b.includes(U)),E={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},C={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},A={match:i.concat(/\b/,i.either(...y),/\s*\(/),relevance:0,keywords:{built_in:y}};function N(U){return i.concat(/\b/,i.either(...U.map(L=>L.replace(/\s+/,"\\s+"))),/\b/)}const M={scope:"keyword",match:N(x),relevance:0};function D(U,{exceptions:L,when:R}={}){const $=R;return L=L||[],U.map(I=>I.match(/\|\d+$/)||L.includes(I)?I:$(I)?`${I}|0`:I)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:D(S,{when:U=>U.length<3}),literal:u,type:m,built_in:_},contains:[{scope:"type",match:N(h)},M,A,E,a,o,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,s,C]}}return Eg=e,Eg}var Cg,L2;function QU(){if(L2)return Cg;L2=1;function e(R){return R?typeof R=="string"?R:R.source:null}function t(R){return i("(?=",R,")")}function i(...R){return R.map(I=>e(I)).join("")}function s(R){const $=R[R.length-1];return typeof $=="object"&&$.constructor===Object?(R.splice(R.length-1,1),$):{}}function a(...R){return"("+(s(R).capture?"":"?:")+R.map(F=>e(F)).join("|")+")"}const o=R=>i(/\b/,R,/\w$/.test(R)?/\b/:/\B/),u=["Protocol","Type"].map(o),h=["init","self"].map(o),m=["Any","Self"],f=["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"],p=["false","nil","true"],b=["assignment","associativity","higherThan","left","lowerThan","none","right"],_=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],x=["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"],y=a(/[/=\-+!*%<>&|^~?]/,/[\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]/),S=a(y,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),E=i(y,S,"*"),C=a(/[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]/),A=a(C,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),N=i(C,A,"*"),M=i(/[A-Z]/,A,"*"),D=["attached","autoclosure",i(/convention\(/,a("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",i(/objc\(/,N,/\)/),"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 L(R){const $={match:/\s+/,relevance:0},I=R.COMMENT("/\\*","\\*/",{contains:["self"]}),F=[R.C_LINE_COMMENT_MODE,I],G={match:[/\./,a(...u,...h)],className:{2:"keyword"}},Y={match:i(/\./,a(...f)),relevance:0},Q=f.filter(rt=>typeof rt=="string").concat(["_|0"]),q=f.filter(rt=>typeof rt!="string").concat(m).map(o),O={variants:[{className:"keyword",match:a(...q,...h)}]},X={$pattern:a(/\b\w+/,/#\w+/),keyword:Q.concat(_),literal:p},Z=[G,Y,O],V={match:i(/\./,a(...x)),relevance:0},P={className:"built_in",match:i(/\b/,a(...x),/(?=\()/)},j=[V,P],W={match:/->/,relevance:0},he={className:"operator",relevance:0,variants:[{match:E},{match:`\\.(\\.|${S})+`}]},oe=[W,he],me="([0-9]_*)+",ne="([0-9a-fA-F]_*)+",fe={className:"number",relevance:0,variants:[{match:`\\b(${me})(\\.(${me}))?([eE][+-]?(${me}))?\\b`},{match:`\\b0x(${ne})(\\.(${ne}))?([pP][+-]?(${me}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},we=(rt="")=>({className:"subst",variants:[{match:i(/\\/,rt,/[0\\tnr"']/)},{match:i(/\\/,rt,/u\{[0-9a-fA-F]{1,8}\}/)}]}),ye=(rt="")=>({className:"subst",match:i(/\\/,rt,/[\t ]*(?:[\r\n]|\r\n)/)}),Ze=(rt="")=>({className:"subst",label:"interpol",begin:i(/\\/,rt,/\(/),end:/\)/}),ot=(rt="")=>({begin:i(rt,/"""/),end:i(/"""/,rt),contains:[we(rt),ye(rt),Ze(rt)]}),lt=(rt="")=>({begin:i(rt,/"/),end:i(/"/,rt),contains:[we(rt),Ze(rt)]}),Be={className:"string",variants:[ot(),ot("#"),ot("##"),ot("###"),lt(),lt("#"),lt("##"),lt("###")]},Lt=[R.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[R.BACKSLASH_ESCAPE]}],Os={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:Lt},Jn=rt=>{const es=i(rt,/\//),gn=i(/\//,rt);return{begin:es,end:gn,contains:[...Lt,{scope:"comment",begin:`#(?!.*${gn})`,end:/$/}]}},_e={scope:"regexp",variants:[Jn("###"),Jn("##"),Jn("#"),Os]},mt={match:i(/`/,N,/`/)},qi={className:"variable",match:/\$\d+/},li={className:"variable",match:`\\$${A}+`},Ki=[mt,qi,li],oa={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:U,contains:[...oe,fe,Be]}]}},mr={scope:"keyword",match:i(/@/,a(...D),t(a(/\(/,/\s+/)))},Bt={scope:"meta",match:i(/@/,N)},Ls=[oa,mr,Bt],wi={match:t(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:i(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,A,"+")},{className:"type",match:M,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:i(/\s+&\s+/,t(M)),relevance:0}]},Bs={begin:/</,end:/>/,keywords:X,contains:[...F,...Z,...Ls,W,wi]};wi.contains.push(Bs);const zs={match:i(N,/\s*:/),keywords:"_|0",relevance:0},Qa={begin:/\(/,end:/\)/,relevance:0,keywords:X,contains:["self",zs,...F,_e,...Z,...j,...oe,fe,Be,...Ki,...Ls,wi]},pr={begin:/</,end:/>/,keywords:"repeat each",contains:[...F,wi]},fl={begin:a(t(i(N,/\s*:/)),t(i(N,/\s+/,N,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:N}]},Ja={begin:/\(/,end:/\)/,keywords:X,contains:[fl,...F,...Z,...oe,fe,Be,...Ls,wi,Qa],endsParent:!0,illegal:/["']/},Is={match:[/(func|macro)/,/\s+/,a(mt.match,N,E)],className:{1:"keyword",3:"title.function"},contains:[pr,Ja,$],illegal:[/\[/,/%/]},gi={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[pr,Ja,$],illegal:/\[|%/},Mn={match:[/operator/,/\s+/,E],className:{1:"keyword",3:"title"}},ki={begin:[/precedencegroup/,/\s+/,M],className:{1:"keyword",3:"title"},contains:[wi],keywords:[...b,...p],end:/}/},ml={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},la={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},eo={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,N,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:X,contains:[pr,...Z,{begin:/:/,end:/\{/,keywords:X,contains:[{scope:"title.class.inherited",match:M},...Z],relevance:0}]};for(const rt of Be.variants){const es=rt.contains.find(zi=>zi.label==="interpol");es.keywords=X;const gn=[...Z,...j,...oe,fe,Be,...Ki];es.contains=[...gn,{begin:/\(/,end:/\)/,contains:["self",...gn]}]}return{name:"Swift",keywords:X,contains:[...F,Is,gi,ml,la,eo,Mn,ki,{beginKeywords:"import",end:/$/,contains:[...F],relevance:0},_e,...Z,...j,...oe,fe,Be,...Ki,...Ls,wi,Qa]}}return Cg=L,Cg}var Ng,B2;function JU(){if(B2)return Ng;B2=1;function e(t){const i="true false yes no null",s="[\\w#;/?:@&=+$,.~*'()[\\]]+",a={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},o={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},u={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},h={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,o]},m=t.inherit(h,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),x={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"},y={end:",",endsWithParent:!0,excludeEnd:!0,keywords:i,relevance:0},S={begin:/\{/,end:/\}/,contains:[y],illegal:"\\n",relevance:0},E={begin:"\\[",end:"\\]",contains:[y],illegal:"\\n",relevance:0},C=[a,{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+!"+s},{className:"type",begin:"!<"+s+">"},{className:"type",begin:"!"+s},{className:"type",begin:"!!"+s},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:i,keywords:{literal:i}},x,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},S,E,u,h],A=[...C];return A.pop(),A.push(m),y.contains=A,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:C}}return Ng=e,Ng}var Tg,z2;function eH(){if(z2)return Tg;z2=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"],i=["true","false","null","undefined","NaN","Infinity"],s=["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"],a=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],o=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],u=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],h=[].concat(o,s,a);function m(p){const b=p.regex,_=(we,{after:ye})=>{const Ze="</"+we[0].slice(1);return we.input.indexOf(Ze,ye)!==-1},x=e,y={begin:"<>",end:"</>"},S=/<[A-Za-z0-9\\._:-]+\s*\/>/,E={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(we,ye)=>{const Ze=we[0].length+we.index,ot=we.input[Ze];if(ot==="<"||ot===","){ye.ignoreMatch();return}ot===">"&&(_(we,{after:Ze})||ye.ignoreMatch());let lt;const Be=we.input.substring(Ze);if(lt=Be.match(/^\s*=/)){ye.ignoreMatch();return}if((lt=Be.match(/^\s+extends\s+/))&<.index===0){ye.ignoreMatch();return}}},C={$pattern:e,keyword:t,literal:i,built_in:h,"variable.language":u},A="[0-9](_?[0-9])*",N=`\\.(${A})`,M="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",D={className:"number",variants:[{begin:`(\\b(${M})((${N})|\\.)?|(${N}))[eE][+-]?(${A})\\b`},{begin:`\\b(${M})\\b((${N})\\b|\\.)?|(${N})\\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:C,contains:[]},L={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[p.BACKSLASH_ESCAPE,U],subLanguage:"xml"}},R={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[p.BACKSLASH_ESCAPE,U],subLanguage:"css"}},$={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[p.BACKSLASH_ESCAPE,U],subLanguage:"graphql"}},I={className:"string",begin:"`",end:"`",contains:[p.BACKSLASH_ESCAPE,U]},G={className:"comment",variants:[p.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:x+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),p.C_BLOCK_COMMENT_MODE,p.C_LINE_COMMENT_MODE]},Y=[p.APOS_STRING_MODE,p.QUOTE_STRING_MODE,L,R,$,I,{match:/\$\d+/},D];U.contains=Y.concat({begin:/\{/,end:/\}/,keywords:C,contains:["self"].concat(Y)});const Q=[].concat(G,U.contains),q=Q.concat([{begin:/(\s*)\(/,end:/\)/,keywords:C,contains:["self"].concat(Q)}]),O={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:C,contains:q},X={variants:[{match:[/class/,/\s+/,x,/\s+/,/extends/,/\s+/,b.concat(x,"(",b.concat(/\./,x),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,x],scope:{1:"keyword",3:"title.class"}}]},Z={relevance:0,match:b.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:{_:[...s,...a]}},V={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},P={variants:[{match:[/function/,/\s+/,x,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[O],illegal:/%/},j={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function W(we){return b.concat("(?!",we.join("|"),")")}const he={match:b.concat(/\b/,W([...o,"super","import"].map(we=>`${we}\\s*\\(`)),x,b.lookahead(/\s*\(/)),className:"title.function",relevance:0},oe={begin:b.concat(/\./,b.lookahead(b.concat(x,/(?![0-9A-Za-z$_(])/))),end:x,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},me={match:[/get|set/,/\s+/,x,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},O]},ne="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+p.UNDERSCORE_IDENT_RE+")\\s*=>",fe={match:[/const|var|let/,/\s+/,x,/\s*/,/=\s*/,/(async\s*)?/,b.lookahead(ne)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[O]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:C,exports:{PARAMS_CONTAINS:q,CLASS_REFERENCE:Z},illegal:/#(?![$_A-z])/,contains:[p.SHEBANG({label:"shebang",binary:"node",relevance:5}),V,p.APOS_STRING_MODE,p.QUOTE_STRING_MODE,L,R,$,I,G,{match:/\$\d+/},D,Z,{scope:"attr",match:x+b.lookahead(":"),relevance:0},fe,{begin:"("+p.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[G,p.REGEXP_MODE,{className:"function",begin:ne,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:p.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:C,contains:q}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:y.begin,end:y.end},{match:S},{begin:E.begin,"on:begin":E.isTrulyOpeningTag,end:E.end}],subLanguage:"xml",contains:[{begin:E.begin,end:E.end,skip:!0,contains:["self"]}]}]},P,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+p.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[O,p.inherit(p.TITLE_MODE,{begin:x,className:"title.function"})]},{match:/\.\.\./,relevance:0},oe,{match:"\\$"+x,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[O]},he,j,X,me,{match:/\$[(.]/}]}}function f(p){const b=p.regex,_=m(p),x=e,y=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],S={begin:[/namespace/,/\s+/,p.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},E={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:y},contains:[_.exports.CLASS_REFERENCE]},C={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},A=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],N={$pattern:e,keyword:t.concat(A),literal:i,built_in:h.concat(y),"variable.language":u},M={className:"meta",begin:"@"+x},D=($,I,F)=>{const G=$.contains.findIndex(Y=>Y.label===I);if(G===-1)throw new Error("can not find mode to replace");$.contains.splice(G,1,F)};Object.assign(_.keywords,N),_.exports.PARAMS_CONTAINS.push(M);const U=_.contains.find($=>$.scope==="attr"),L=Object.assign({},U,{match:b.concat(x,b.lookahead(/\s*\?:/))});_.exports.PARAMS_CONTAINS.push([_.exports.CLASS_REFERENCE,U,L]),_.contains=_.contains.concat([M,S,E,L]),D(_,"shebang",p.SHEBANG()),D(_,"use_strict",C);const R=_.contains.find($=>$.label==="func.def");return R.relevance=0,Object.assign(_,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),_}return Tg=f,Tg}var Ag,I2;function tH(){if(I2)return Ag;I2=1;function e(t){const i=t.regex,s={className:"string",begin:/"(""|[^/n])"C\b/},a={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},o=/\d{1,2}\/\d{1,2}\/\d{4}/,u=/\d{4}-\d{1,2}-\d{1,2}/,h=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,m=/\d{1,2}(:\d{1,2}){1,2}/,f={className:"literal",variants:[{begin:i.concat(/# */,i.either(u,o),/ *#/)},{begin:i.concat(/# */,m,/ *#/)},{begin:i.concat(/# */,h,/ *#/)},{begin:i.concat(/# */,i.either(u,o),/ +/,i.either(h,m),/ *#/)}]},p={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])|[%&])?/}]},b={className:"label",begin:/^\w+:/},_=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),x=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:[s,a,f,p,b,_,x,{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:[x]}]}}return Ag=e,Ag}var Mg,P2;function iH(){if(P2)return Mg;P2=1;function e(t){t.regex;const i=t.COMMENT(/\(;/,/;\)/);i.contains.push("self");const s=t.COMMENT(/;;/,/$/),a=["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"],o={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},u={className:"variable",begin:/\$[\w_]+/},h={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/},f={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},p={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:a},contains:[s,i,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},u,h,o,t.QUOTE_STRING_MODE,f,p,m]}}return Mg=e,Mg}var Rg,$2;function nH(){if($2)return Rg;$2=1;var e=xU();return e.registerLanguage("xml",yU()),e.registerLanguage("bash",SU()),e.registerLanguage("c",wU()),e.registerLanguage("cpp",kU()),e.registerLanguage("csharp",EU()),e.registerLanguage("css",CU()),e.registerLanguage("markdown",NU()),e.registerLanguage("diff",TU()),e.registerLanguage("ruby",AU()),e.registerLanguage("go",MU()),e.registerLanguage("graphql",RU()),e.registerLanguage("ini",jU()),e.registerLanguage("java",DU()),e.registerLanguage("javascript",OU()),e.registerLanguage("json",LU()),e.registerLanguage("kotlin",BU()),e.registerLanguage("less",zU()),e.registerLanguage("lua",IU()),e.registerLanguage("makefile",PU()),e.registerLanguage("perl",$U()),e.registerLanguage("objectivec",UU()),e.registerLanguage("php",HU()),e.registerLanguage("php-template",FU()),e.registerLanguage("plaintext",VU()),e.registerLanguage("python",qU()),e.registerLanguage("python-repl",KU()),e.registerLanguage("r",GU()),e.registerLanguage("rust",WU()),e.registerLanguage("scss",YU()),e.registerLanguage("shell",XU()),e.registerLanguage("sql",ZU()),e.registerLanguage("swift",QU()),e.registerLanguage("yaml",JU()),e.registerLanguage("typescript",eH()),e.registerLanguage("vbnet",tH()),e.registerLanguage("wasm",iH()),e.HighlightJS=e,e.default=e,Rg=e,Rg}var sH=nH();const Y0=QT(sH);function rH(e){return e.replace(/<\/?(script|style|iframe|object|embed)\b[^>]*>/gi,"").replace(/\son\w+\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi,"").replace(/(href|src)\s*=\s*("|')\s*javascript:[^"']*\2/gi,"$1=$2#$2")}function aH({content:e}){const t=k.useMemo(()=>{const s=ft.parse(e,{async:!1,gfm:!0,breaks:!1});return rH(s)},[e]),i=k.useRef(null);return k.useEffect(()=>{const s=i.current;s&&s.querySelectorAll("pre code").forEach(a=>{Y0.highlightElement(a)})},[t]),c.jsx("div",{ref:i,className:"md-preview min-w-0 px-6 py-5",dangerouslySetInnerHTML:{__html:t}})}function t3(e){return typeof e>"u"||e===null}function oH(e){return typeof e=="object"&&e!==null}function lH(e){return Array.isArray(e)?e:t3(e)?[]:[e]}function cH(e,t){var i,s,a,o;if(t)for(o=Object.keys(t),i=0,s=o.length;i<s;i+=1)a=o[i],e[a]=t[a];return e}function uH(e,t){var i="",s;for(s=0;s<t;s+=1)i+=e;return i}function dH(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var hH=t3,fH=oH,mH=lH,pH=uH,gH=dH,bH=cH,mi={isNothing:hH,isObject:fH,toArray:mH,repeat:pH,isNegativeZero:gH,extend:bH};function i3(e,t){var i="",s=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(i+='in "'+e.mark.name+'" '),i+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(i+=`
|
|
162
|
-
|
|
163
|
-
`+e.mark.snippet),s+" "+i):s}function Wc(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=i3(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Wc.prototype=Object.create(Error.prototype);Wc.prototype.constructor=Wc;Wc.prototype.toString=function(t){return this.name+": "+i3(this,t)};var Xi=Wc;function jg(e,t,i,s,a){var o="",u="",h=Math.floor(a/2)-1;return s-t>h&&(o=" ... ",t=s-h+o.length),i-s>h&&(u=" ...",i=s+h-u.length),{str:o+e.slice(t,i).replace(/\t/g,"→")+u,pos:s-t+o.length}}function Dg(e,t){return mi.repeat(" ",t-e.length)+e}function vH(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var i=/\r?\n|\r|\0/g,s=[0],a=[],o,u=-1;o=i.exec(e.buffer);)a.push(o.index),s.push(o.index+o[0].length),e.position<=o.index&&u<0&&(u=s.length-2);u<0&&(u=s.length-1);var h="",m,f,p=Math.min(e.line+t.linesAfter,a.length).toString().length,b=t.maxLength-(t.indent+p+3);for(m=1;m<=t.linesBefore&&!(u-m<0);m++)f=jg(e.buffer,s[u-m],a[u-m],e.position-(s[u]-s[u-m]),b),h=mi.repeat(" ",t.indent)+Dg((e.line-m+1).toString(),p)+" | "+f.str+`
|
|
164
|
-
`+h;for(f=jg(e.buffer,s[u],a[u],e.position,b),h+=mi.repeat(" ",t.indent)+Dg((e.line+1).toString(),p)+" | "+f.str+`
|
|
165
|
-
`,h+=mi.repeat("-",t.indent+p+3+f.pos)+`^
|
|
166
|
-
`,m=1;m<=t.linesAfter&&!(u+m>=a.length);m++)f=jg(e.buffer,s[u+m],a[u+m],e.position-(s[u]-s[u+m]),b),h+=mi.repeat(" ",t.indent)+Dg((e.line+m+1).toString(),p)+" | "+f.str+`
|
|
167
|
-
`;return h.replace(/\n$/,"")}var _H=vH,xH=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],yH=["scalar","sequence","mapping"];function SH(e){var t={};return e!==null&&Object.keys(e).forEach(function(i){e[i].forEach(function(s){t[String(s)]=i})}),t}function wH(e,t){if(t=t||{},Object.keys(t).forEach(function(i){if(xH.indexOf(i)===-1)throw new Xi('Unknown option "'+i+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(i){return i},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=SH(t.styleAliases||null),yH.indexOf(this.kind)===-1)throw new Xi('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var Di=wH;function U2(e,t){var i=[];return e[t].forEach(function(s){var a=i.length;i.forEach(function(o,u){o.tag===s.tag&&o.kind===s.kind&&o.multi===s.multi&&(a=u)}),i[a]=s}),i}function kH(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,i;function s(a){a.multi?(e.multi[a.kind].push(a),e.multi.fallback.push(a)):e[a.kind][a.tag]=e.fallback[a.tag]=a}for(t=0,i=arguments.length;t<i;t+=1)arguments[t].forEach(s);return e}function X0(e){return this.extend(e)}X0.prototype.extend=function(t){var i=[],s=[];if(t instanceof Di)s.push(t);else if(Array.isArray(t))s=s.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(i=i.concat(t.implicit)),t.explicit&&(s=s.concat(t.explicit));else throw new Xi("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");i.forEach(function(o){if(!(o instanceof Di))throw new Xi("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new Xi("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(o.multi)throw new Xi("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),s.forEach(function(o){if(!(o instanceof Di))throw new Xi("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var a=Object.create(X0.prototype);return a.implicit=(this.implicit||[]).concat(i),a.explicit=(this.explicit||[]).concat(s),a.compiledImplicit=U2(a,"implicit"),a.compiledExplicit=U2(a,"explicit"),a.compiledTypeMap=kH(a.compiledImplicit,a.compiledExplicit),a};var n3=X0,s3=new Di("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),r3=new Di("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),a3=new Di("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),o3=new n3({explicit:[s3,r3,a3]});function EH(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function CH(){return null}function NH(e){return e===null}var l3=new Di("tag:yaml.org,2002:null",{kind:"scalar",resolve:EH,construct:CH,predicate:NH,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function TH(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function AH(e){return e==="true"||e==="True"||e==="TRUE"}function MH(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var c3=new Di("tag:yaml.org,2002:bool",{kind:"scalar",resolve:TH,construct:AH,predicate:MH,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function RH(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function jH(e){return 48<=e&&e<=55}function DH(e){return 48<=e&&e<=57}function OH(e){if(e===null)return!1;var t=e.length,i=0,s=!1,a;if(!t)return!1;if(a=e[i],(a==="-"||a==="+")&&(a=e[++i]),a==="0"){if(i+1===t)return!0;if(a=e[++i],a==="b"){for(i++;i<t;i++)if(a=e[i],a!=="_"){if(a!=="0"&&a!=="1")return!1;s=!0}return s&&a!=="_"}if(a==="x"){for(i++;i<t;i++)if(a=e[i],a!=="_"){if(!RH(e.charCodeAt(i)))return!1;s=!0}return s&&a!=="_"}if(a==="o"){for(i++;i<t;i++)if(a=e[i],a!=="_"){if(!jH(e.charCodeAt(i)))return!1;s=!0}return s&&a!=="_"}}if(a==="_")return!1;for(;i<t;i++)if(a=e[i],a!=="_"){if(!DH(e.charCodeAt(i)))return!1;s=!0}return!(!s||a==="_")}function LH(e){var t=e,i=1,s;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),s=t[0],(s==="-"||s==="+")&&(s==="-"&&(i=-1),t=t.slice(1),s=t[0]),t==="0")return 0;if(s==="0"){if(t[1]==="b")return i*parseInt(t.slice(2),2);if(t[1]==="x")return i*parseInt(t.slice(2),16);if(t[1]==="o")return i*parseInt(t.slice(2),8)}return i*parseInt(t,10)}function BH(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!mi.isNegativeZero(e)}var u3=new Di("tag:yaml.org,2002:int",{kind:"scalar",resolve:OH,construct:LH,predicate:BH,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),zH=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function IH(e){return!(e===null||!zH.test(e)||e[e.length-1]==="_")}function PH(e){var t,i;return t=e.replace(/_/g,"").toLowerCase(),i=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?i===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:i*parseFloat(t,10)}var $H=/^[-+]?[0-9]+e/;function UH(e,t){var i;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(mi.isNegativeZero(e))return"-0.0";return i=e.toString(10),$H.test(i)?i.replace("e",".e"):i}function HH(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||mi.isNegativeZero(e))}var d3=new Di("tag:yaml.org,2002:float",{kind:"scalar",resolve:IH,construct:PH,predicate:HH,represent:UH,defaultStyle:"lowercase"}),h3=o3.extend({implicit:[l3,c3,u3,d3]}),f3=h3,m3=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),p3=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function FH(e){return e===null?!1:m3.exec(e)!==null||p3.exec(e)!==null}function VH(e){var t,i,s,a,o,u,h,m=0,f=null,p,b,_;if(t=m3.exec(e),t===null&&(t=p3.exec(e)),t===null)throw new Error("Date resolve error");if(i=+t[1],s=+t[2]-1,a=+t[3],!t[4])return new Date(Date.UTC(i,s,a));if(o=+t[4],u=+t[5],h=+t[6],t[7]){for(m=t[7].slice(0,3);m.length<3;)m+="0";m=+m}return t[9]&&(p=+t[10],b=+(t[11]||0),f=(p*60+b)*6e4,t[9]==="-"&&(f=-f)),_=new Date(Date.UTC(i,s,a,o,u,h,m)),f&&_.setTime(_.getTime()-f),_}function qH(e){return e.toISOString()}var g3=new Di("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:FH,construct:VH,instanceOf:Date,represent:qH});function KH(e){return e==="<<"||e===null}var b3=new Di("tag:yaml.org,2002:merge",{kind:"scalar",resolve:KH}),uv=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
168
|
-
\r`;function GH(e){if(e===null)return!1;var t,i,s=0,a=e.length,o=uv;for(i=0;i<a;i++)if(t=o.indexOf(e.charAt(i)),!(t>64)){if(t<0)return!1;s+=6}return s%8===0}function WH(e){var t,i,s=e.replace(/[\r\n=]/g,""),a=s.length,o=uv,u=0,h=[];for(t=0;t<a;t++)t%4===0&&t&&(h.push(u>>16&255),h.push(u>>8&255),h.push(u&255)),u=u<<6|o.indexOf(s.charAt(t));return i=a%4*6,i===0?(h.push(u>>16&255),h.push(u>>8&255),h.push(u&255)):i===18?(h.push(u>>10&255),h.push(u>>2&255)):i===12&&h.push(u>>4&255),new Uint8Array(h)}function YH(e){var t="",i=0,s,a,o=e.length,u=uv;for(s=0;s<o;s++)s%3===0&&s&&(t+=u[i>>18&63],t+=u[i>>12&63],t+=u[i>>6&63],t+=u[i&63]),i=(i<<8)+e[s];return a=o%3,a===0?(t+=u[i>>18&63],t+=u[i>>12&63],t+=u[i>>6&63],t+=u[i&63]):a===2?(t+=u[i>>10&63],t+=u[i>>4&63],t+=u[i<<2&63],t+=u[64]):a===1&&(t+=u[i>>2&63],t+=u[i<<4&63],t+=u[64],t+=u[64]),t}function XH(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var v3=new Di("tag:yaml.org,2002:binary",{kind:"scalar",resolve:GH,construct:WH,predicate:XH,represent:YH}),ZH=Object.prototype.hasOwnProperty,QH=Object.prototype.toString;function JH(e){if(e===null)return!0;var t=[],i,s,a,o,u,h=e;for(i=0,s=h.length;i<s;i+=1){if(a=h[i],u=!1,QH.call(a)!=="[object Object]")return!1;for(o in a)if(ZH.call(a,o))if(!u)u=!0;else return!1;if(!u)return!1;if(t.indexOf(o)===-1)t.push(o);else return!1}return!0}function eF(e){return e!==null?e:[]}var _3=new Di("tag:yaml.org,2002:omap",{kind:"sequence",resolve:JH,construct:eF}),tF=Object.prototype.toString;function iF(e){if(e===null)return!0;var t,i,s,a,o,u=e;for(o=new Array(u.length),t=0,i=u.length;t<i;t+=1){if(s=u[t],tF.call(s)!=="[object Object]"||(a=Object.keys(s),a.length!==1))return!1;o[t]=[a[0],s[a[0]]]}return!0}function nF(e){if(e===null)return[];var t,i,s,a,o,u=e;for(o=new Array(u.length),t=0,i=u.length;t<i;t+=1)s=u[t],a=Object.keys(s),o[t]=[a[0],s[a[0]]];return o}var x3=new Di("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:iF,construct:nF}),sF=Object.prototype.hasOwnProperty;function rF(e){if(e===null)return!0;var t,i=e;for(t in i)if(sF.call(i,t)&&i[t]!==null)return!1;return!0}function aF(e){return e!==null?e:{}}var y3=new Di("tag:yaml.org,2002:set",{kind:"mapping",resolve:rF,construct:aF}),dv=f3.extend({implicit:[g3,b3],explicit:[v3,_3,x3,y3]}),na=Object.prototype.hasOwnProperty,Oh=1,S3=2,w3=3,Lh=4,Og=1,oF=2,H2=3,lF=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,cF=/[\x85\u2028\u2029]/,uF=/[,\[\]\{\}]/,k3=/^(?:!|!!|![a-z\-]+!)$/i,E3=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function F2(e){return Object.prototype.toString.call(e)}function Cs(e){return e===10||e===13}function Fa(e){return e===9||e===32}function fn(e){return e===9||e===32||e===10||e===13}function Xo(e){return e===44||e===91||e===93||e===123||e===125}function dF(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function hF(e){return e===120?2:e===117?4:e===85?8:0}function fF(e){return 48<=e&&e<=57?e-48:-1}function V2(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
|
|
169
|
-
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"
":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function mF(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function C3(e,t,i){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:i}):e[t]=i}var N3=new Array(256),T3=new Array(256);for(var Ho=0;Ho<256;Ho++)N3[Ho]=V2(Ho)?1:0,T3[Ho]=V2(Ho);function pF(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||dv,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function A3(e,t){var i={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return i.snippet=_H(i),new Xi(t,i)}function De(e,t){throw A3(e,t)}function Bh(e,t){e.onWarning&&e.onWarning.call(null,A3(e,t))}var q2={YAML:function(t,i,s){var a,o,u;t.version!==null&&De(t,"duplication of %YAML directive"),s.length!==1&&De(t,"YAML directive accepts exactly one argument"),a=/^([0-9]+)\.([0-9]+)$/.exec(s[0]),a===null&&De(t,"ill-formed argument of the YAML directive"),o=parseInt(a[1],10),u=parseInt(a[2],10),o!==1&&De(t,"unacceptable YAML version of the document"),t.version=s[0],t.checkLineBreaks=u<2,u!==1&&u!==2&&Bh(t,"unsupported YAML version of the document")},TAG:function(t,i,s){var a,o;s.length!==2&&De(t,"TAG directive accepts exactly two arguments"),a=s[0],o=s[1],k3.test(a)||De(t,"ill-formed tag handle (first argument) of the TAG directive"),na.call(t.tagMap,a)&&De(t,'there is a previously declared suffix for "'+a+'" tag handle'),E3.test(o)||De(t,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch{De(t,"tag prefix is malformed: "+o)}t.tagMap[a]=o}};function ea(e,t,i,s){var a,o,u,h;if(t<i){if(h=e.input.slice(t,i),s)for(a=0,o=h.length;a<o;a+=1)u=h.charCodeAt(a),u===9||32<=u&&u<=1114111||De(e,"expected valid JSON character");else lF.test(h)&&De(e,"the stream contains non-printable characters");e.result+=h}}function K2(e,t,i,s){var a,o,u,h;for(mi.isObject(i)||De(e,"cannot merge mappings; the provided source object is unacceptable"),a=Object.keys(i),u=0,h=a.length;u<h;u+=1)o=a[u],na.call(t,o)||(C3(t,o,i[o]),s[o]=!0)}function Zo(e,t,i,s,a,o,u,h,m){var f,p;if(Array.isArray(a))for(a=Array.prototype.slice.call(a),f=0,p=a.length;f<p;f+=1)Array.isArray(a[f])&&De(e,"nested arrays are not supported inside keys"),typeof a=="object"&&F2(a[f])==="[object Object]"&&(a[f]="[object Object]");if(typeof a=="object"&&F2(a)==="[object Object]"&&(a="[object Object]"),a=String(a),t===null&&(t={}),s==="tag:yaml.org,2002:merge")if(Array.isArray(o))for(f=0,p=o.length;f<p;f+=1)K2(e,t,o[f],i);else K2(e,t,o,i);else!e.json&&!na.call(i,a)&&na.call(t,a)&&(e.line=u||e.line,e.lineStart=h||e.lineStart,e.position=m||e.position,De(e,"duplicated mapping key")),C3(t,a,o),delete i[a];return t}function hv(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):De(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function oi(e,t,i){for(var s=0,a=e.input.charCodeAt(e.position);a!==0;){for(;Fa(a);)a===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),a=e.input.charCodeAt(++e.position);if(t&&a===35)do a=e.input.charCodeAt(++e.position);while(a!==10&&a!==13&&a!==0);if(Cs(a))for(hv(e),a=e.input.charCodeAt(e.position),s++,e.lineIndent=0;a===32;)e.lineIndent++,a=e.input.charCodeAt(++e.position);else break}return i!==-1&&s!==0&&e.lineIndent<i&&Bh(e,"deficient indentation"),s}function tf(e){var t=e.position,i;return i=e.input.charCodeAt(t),!!((i===45||i===46)&&i===e.input.charCodeAt(t+1)&&i===e.input.charCodeAt(t+2)&&(t+=3,i=e.input.charCodeAt(t),i===0||fn(i)))}function fv(e,t){t===1?e.result+=" ":t>1&&(e.result+=mi.repeat(`
|
|
170
|
-
`,t-1))}function gF(e,t,i){var s,a,o,u,h,m,f,p,b=e.kind,_=e.result,x;if(x=e.input.charCodeAt(e.position),fn(x)||Xo(x)||x===35||x===38||x===42||x===33||x===124||x===62||x===39||x===34||x===37||x===64||x===96||(x===63||x===45)&&(a=e.input.charCodeAt(e.position+1),fn(a)||i&&Xo(a)))return!1;for(e.kind="scalar",e.result="",o=u=e.position,h=!1;x!==0;){if(x===58){if(a=e.input.charCodeAt(e.position+1),fn(a)||i&&Xo(a))break}else if(x===35){if(s=e.input.charCodeAt(e.position-1),fn(s))break}else{if(e.position===e.lineStart&&tf(e)||i&&Xo(x))break;if(Cs(x))if(m=e.line,f=e.lineStart,p=e.lineIndent,oi(e,!1,-1),e.lineIndent>=t){h=!0,x=e.input.charCodeAt(e.position);continue}else{e.position=u,e.line=m,e.lineStart=f,e.lineIndent=p;break}}h&&(ea(e,o,u,!1),fv(e,e.line-m),o=u=e.position,h=!1),Fa(x)||(u=e.position+1),x=e.input.charCodeAt(++e.position)}return ea(e,o,u,!1),e.result?!0:(e.kind=b,e.result=_,!1)}function bF(e,t){var i,s,a;if(i=e.input.charCodeAt(e.position),i!==39)return!1;for(e.kind="scalar",e.result="",e.position++,s=a=e.position;(i=e.input.charCodeAt(e.position))!==0;)if(i===39)if(ea(e,s,e.position,!0),i=e.input.charCodeAt(++e.position),i===39)s=e.position,e.position++,a=e.position;else return!0;else Cs(i)?(ea(e,s,a,!0),fv(e,oi(e,!1,t)),s=a=e.position):e.position===e.lineStart&&tf(e)?De(e,"unexpected end of the document within a single quoted scalar"):(e.position++,a=e.position);De(e,"unexpected end of the stream within a single quoted scalar")}function vF(e,t){var i,s,a,o,u,h;if(h=e.input.charCodeAt(e.position),h!==34)return!1;for(e.kind="scalar",e.result="",e.position++,i=s=e.position;(h=e.input.charCodeAt(e.position))!==0;){if(h===34)return ea(e,i,e.position,!0),e.position++,!0;if(h===92){if(ea(e,i,e.position,!0),h=e.input.charCodeAt(++e.position),Cs(h))oi(e,!1,t);else if(h<256&&N3[h])e.result+=T3[h],e.position++;else if((u=hF(h))>0){for(a=u,o=0;a>0;a--)h=e.input.charCodeAt(++e.position),(u=dF(h))>=0?o=(o<<4)+u:De(e,"expected hexadecimal character");e.result+=mF(o),e.position++}else De(e,"unknown escape sequence");i=s=e.position}else Cs(h)?(ea(e,i,s,!0),fv(e,oi(e,!1,t)),i=s=e.position):e.position===e.lineStart&&tf(e)?De(e,"unexpected end of the document within a double quoted scalar"):(e.position++,s=e.position)}De(e,"unexpected end of the stream within a double quoted scalar")}function _F(e,t){var i=!0,s,a,o,u=e.tag,h,m=e.anchor,f,p,b,_,x,y=Object.create(null),S,E,C,A;if(A=e.input.charCodeAt(e.position),A===91)p=93,x=!1,h=[];else if(A===123)p=125,x=!0,h={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=h),A=e.input.charCodeAt(++e.position);A!==0;){if(oi(e,!0,t),A=e.input.charCodeAt(e.position),A===p)return e.position++,e.tag=u,e.anchor=m,e.kind=x?"mapping":"sequence",e.result=h,!0;i?A===44&&De(e,"expected the node content, but found ','"):De(e,"missed comma between flow collection entries"),E=S=C=null,b=_=!1,A===63&&(f=e.input.charCodeAt(e.position+1),fn(f)&&(b=_=!0,e.position++,oi(e,!0,t))),s=e.line,a=e.lineStart,o=e.position,nl(e,t,Oh,!1,!0),E=e.tag,S=e.result,oi(e,!0,t),A=e.input.charCodeAt(e.position),(_||e.line===s)&&A===58&&(b=!0,A=e.input.charCodeAt(++e.position),oi(e,!0,t),nl(e,t,Oh,!1,!0),C=e.result),x?Zo(e,h,y,E,S,C,s,a,o):b?h.push(Zo(e,null,y,E,S,C,s,a,o)):h.push(S),oi(e,!0,t),A=e.input.charCodeAt(e.position),A===44?(i=!0,A=e.input.charCodeAt(++e.position)):i=!1}De(e,"unexpected end of the stream within a flow collection")}function xF(e,t){var i,s,a=Og,o=!1,u=!1,h=t,m=0,f=!1,p,b;if(b=e.input.charCodeAt(e.position),b===124)s=!1;else if(b===62)s=!0;else return!1;for(e.kind="scalar",e.result="";b!==0;)if(b=e.input.charCodeAt(++e.position),b===43||b===45)Og===a?a=b===43?H2:oF:De(e,"repeat of a chomping mode identifier");else if((p=fF(b))>=0)p===0?De(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):u?De(e,"repeat of an indentation width identifier"):(h=t+p-1,u=!0);else break;if(Fa(b)){do b=e.input.charCodeAt(++e.position);while(Fa(b));if(b===35)do b=e.input.charCodeAt(++e.position);while(!Cs(b)&&b!==0)}for(;b!==0;){for(hv(e),e.lineIndent=0,b=e.input.charCodeAt(e.position);(!u||e.lineIndent<h)&&b===32;)e.lineIndent++,b=e.input.charCodeAt(++e.position);if(!u&&e.lineIndent>h&&(h=e.lineIndent),Cs(b)){m++;continue}if(e.lineIndent<h){a===H2?e.result+=mi.repeat(`
|
|
171
|
-
`,o?1+m:m):a===Og&&o&&(e.result+=`
|
|
172
|
-
`);break}for(s?Fa(b)?(f=!0,e.result+=mi.repeat(`
|
|
173
|
-
`,o?1+m:m)):f?(f=!1,e.result+=mi.repeat(`
|
|
174
|
-
`,m+1)):m===0?o&&(e.result+=" "):e.result+=mi.repeat(`
|
|
175
|
-
`,m):e.result+=mi.repeat(`
|
|
176
|
-
`,o?1+m:m),o=!0,u=!0,m=0,i=e.position;!Cs(b)&&b!==0;)b=e.input.charCodeAt(++e.position);ea(e,i,e.position,!1)}return!0}function G2(e,t){var i,s=e.tag,a=e.anchor,o=[],u,h=!1,m;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=o),m=e.input.charCodeAt(e.position);m!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,De(e,"tab characters must not be used in indentation")),!(m!==45||(u=e.input.charCodeAt(e.position+1),!fn(u))));){if(h=!0,e.position++,oi(e,!0,-1)&&e.lineIndent<=t){o.push(null),m=e.input.charCodeAt(e.position);continue}if(i=e.line,nl(e,t,w3,!1,!0),o.push(e.result),oi(e,!0,-1),m=e.input.charCodeAt(e.position),(e.line===i||e.lineIndent>t)&&m!==0)De(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return h?(e.tag=s,e.anchor=a,e.kind="sequence",e.result=o,!0):!1}function yF(e,t,i){var s,a,o,u,h,m,f=e.tag,p=e.anchor,b={},_=Object.create(null),x=null,y=null,S=null,E=!1,C=!1,A;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=b),A=e.input.charCodeAt(e.position);A!==0;){if(!E&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,De(e,"tab characters must not be used in indentation")),s=e.input.charCodeAt(e.position+1),o=e.line,(A===63||A===58)&&fn(s))A===63?(E&&(Zo(e,b,_,x,y,null,u,h,m),x=y=S=null),C=!0,E=!0,a=!0):E?(E=!1,a=!0):De(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,A=s;else{if(u=e.line,h=e.lineStart,m=e.position,!nl(e,i,S3,!1,!0))break;if(e.line===o){for(A=e.input.charCodeAt(e.position);Fa(A);)A=e.input.charCodeAt(++e.position);if(A===58)A=e.input.charCodeAt(++e.position),fn(A)||De(e,"a whitespace character is expected after the key-value separator within a block mapping"),E&&(Zo(e,b,_,x,y,null,u,h,m),x=y=S=null),C=!0,E=!1,a=!1,x=e.tag,y=e.result;else if(C)De(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=f,e.anchor=p,!0}else if(C)De(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=f,e.anchor=p,!0}if((e.line===o||e.lineIndent>t)&&(E&&(u=e.line,h=e.lineStart,m=e.position),nl(e,t,Lh,!0,a)&&(E?y=e.result:S=e.result),E||(Zo(e,b,_,x,y,S,u,h,m),x=y=S=null),oi(e,!0,-1),A=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>t)&&A!==0)De(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return E&&Zo(e,b,_,x,y,null,u,h,m),C&&(e.tag=f,e.anchor=p,e.kind="mapping",e.result=b),C}function SF(e){var t,i=!1,s=!1,a,o,u;if(u=e.input.charCodeAt(e.position),u!==33)return!1;if(e.tag!==null&&De(e,"duplication of a tag property"),u=e.input.charCodeAt(++e.position),u===60?(i=!0,u=e.input.charCodeAt(++e.position)):u===33?(s=!0,a="!!",u=e.input.charCodeAt(++e.position)):a="!",t=e.position,i){do u=e.input.charCodeAt(++e.position);while(u!==0&&u!==62);e.position<e.length?(o=e.input.slice(t,e.position),u=e.input.charCodeAt(++e.position)):De(e,"unexpected end of the stream within a verbatim tag")}else{for(;u!==0&&!fn(u);)u===33&&(s?De(e,"tag suffix cannot contain exclamation marks"):(a=e.input.slice(t-1,e.position+1),k3.test(a)||De(e,"named tag handle cannot contain such characters"),s=!0,t=e.position+1)),u=e.input.charCodeAt(++e.position);o=e.input.slice(t,e.position),uF.test(o)&&De(e,"tag suffix cannot contain flow indicator characters")}o&&!E3.test(o)&&De(e,"tag name cannot contain such characters: "+o);try{o=decodeURIComponent(o)}catch{De(e,"tag name is malformed: "+o)}return i?e.tag=o:na.call(e.tagMap,a)?e.tag=e.tagMap[a]+o:a==="!"?e.tag="!"+o:a==="!!"?e.tag="tag:yaml.org,2002:"+o:De(e,'undeclared tag handle "'+a+'"'),!0}function wF(e){var t,i;if(i=e.input.charCodeAt(e.position),i!==38)return!1;for(e.anchor!==null&&De(e,"duplication of an anchor property"),i=e.input.charCodeAt(++e.position),t=e.position;i!==0&&!fn(i)&&!Xo(i);)i=e.input.charCodeAt(++e.position);return e.position===t&&De(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function kF(e){var t,i,s;if(s=e.input.charCodeAt(e.position),s!==42)return!1;for(s=e.input.charCodeAt(++e.position),t=e.position;s!==0&&!fn(s)&&!Xo(s);)s=e.input.charCodeAt(++e.position);return e.position===t&&De(e,"name of an alias node must contain at least one character"),i=e.input.slice(t,e.position),na.call(e.anchorMap,i)||De(e,'unidentified alias "'+i+'"'),e.result=e.anchorMap[i],oi(e,!0,-1),!0}function nl(e,t,i,s,a){var o,u,h,m=1,f=!1,p=!1,b,_,x,y,S,E;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=u=h=Lh===i||w3===i,s&&oi(e,!0,-1)&&(f=!0,e.lineIndent>t?m=1:e.lineIndent===t?m=0:e.lineIndent<t&&(m=-1)),m===1)for(;SF(e)||wF(e);)oi(e,!0,-1)?(f=!0,h=o,e.lineIndent>t?m=1:e.lineIndent===t?m=0:e.lineIndent<t&&(m=-1)):h=!1;if(h&&(h=f||a),(m===1||Lh===i)&&(Oh===i||S3===i?S=t:S=t+1,E=e.position-e.lineStart,m===1?h&&(G2(e,E)||yF(e,E,S))||_F(e,S)?p=!0:(u&&xF(e,S)||bF(e,S)||vF(e,S)?p=!0:kF(e)?(p=!0,(e.tag!==null||e.anchor!==null)&&De(e,"alias node should not have any properties")):gF(e,S,Oh===i)&&(p=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):m===0&&(p=h&&G2(e,E))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&De(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),b=0,_=e.implicitTypes.length;b<_;b+=1)if(y=e.implicitTypes[b],y.resolve(e.result)){e.result=y.construct(e.result),e.tag=y.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(na.call(e.typeMap[e.kind||"fallback"],e.tag))y=e.typeMap[e.kind||"fallback"][e.tag];else for(y=null,x=e.typeMap.multi[e.kind||"fallback"],b=0,_=x.length;b<_;b+=1)if(e.tag.slice(0,x[b].tag.length)===x[b].tag){y=x[b];break}y||De(e,"unknown tag !<"+e.tag+">"),e.result!==null&&y.kind!==e.kind&&De(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+y.kind+'", not "'+e.kind+'"'),y.resolve(e.result,e.tag)?(e.result=y.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):De(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||p}function EF(e){var t=e.position,i,s,a,o=!1,u;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(u=e.input.charCodeAt(e.position))!==0&&(oi(e,!0,-1),u=e.input.charCodeAt(e.position),!(e.lineIndent>0||u!==37));){for(o=!0,u=e.input.charCodeAt(++e.position),i=e.position;u!==0&&!fn(u);)u=e.input.charCodeAt(++e.position);for(s=e.input.slice(i,e.position),a=[],s.length<1&&De(e,"directive name must not be less than one character in length");u!==0;){for(;Fa(u);)u=e.input.charCodeAt(++e.position);if(u===35){do u=e.input.charCodeAt(++e.position);while(u!==0&&!Cs(u));break}if(Cs(u))break;for(i=e.position;u!==0&&!fn(u);)u=e.input.charCodeAt(++e.position);a.push(e.input.slice(i,e.position))}u!==0&&hv(e),na.call(q2,s)?q2[s](e,s,a):Bh(e,'unknown document directive "'+s+'"')}if(oi(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,oi(e,!0,-1)):o&&De(e,"directives end mark is expected"),nl(e,e.lineIndent-1,Lh,!1,!0),oi(e,!0,-1),e.checkLineBreaks&&cF.test(e.input.slice(t,e.position))&&Bh(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&tf(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,oi(e,!0,-1));return}if(e.position<e.length-1)De(e,"end of the stream or a document separator is expected");else return}function M3(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
|
177
|
-
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var i=new pF(e,t),s=e.indexOf("\0");for(s!==-1&&(i.position=s,De(i,"null byte is not allowed in input")),i.input+="\0";i.input.charCodeAt(i.position)===32;)i.lineIndent+=1,i.position+=1;for(;i.position<i.length-1;)EF(i);return i.documents}function CF(e,t,i){t!==null&&typeof t=="object"&&typeof i>"u"&&(i=t,t=null);var s=M3(e,i);if(typeof t!="function")return s;for(var a=0,o=s.length;a<o;a+=1)t(s[a])}function NF(e,t){var i=M3(e,t);if(i.length!==0){if(i.length===1)return i[0];throw new Xi("expected a single document in the stream, but found more")}}var TF=CF,AF=NF,R3={loadAll:TF,load:AF},j3=Object.prototype.toString,D3=Object.prototype.hasOwnProperty,mv=65279,MF=9,Yc=10,RF=13,jF=32,DF=33,OF=34,Z0=35,LF=37,BF=38,zF=39,IF=42,O3=44,PF=45,zh=58,$F=61,UF=62,HF=63,FF=64,L3=91,B3=93,VF=96,z3=123,qF=124,I3=125,Vi={};Vi[0]="\\0";Vi[7]="\\a";Vi[8]="\\b";Vi[9]="\\t";Vi[10]="\\n";Vi[11]="\\v";Vi[12]="\\f";Vi[13]="\\r";Vi[27]="\\e";Vi[34]='\\"';Vi[92]="\\\\";Vi[133]="\\N";Vi[160]="\\_";Vi[8232]="\\L";Vi[8233]="\\P";var KF=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],GF=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function WF(e,t){var i,s,a,o,u,h,m;if(t===null)return{};for(i={},s=Object.keys(t),a=0,o=s.length;a<o;a+=1)u=s[a],h=String(t[u]),u.slice(0,2)==="!!"&&(u="tag:yaml.org,2002:"+u.slice(2)),m=e.compiledTypeMap.fallback[u],m&&D3.call(m.styleAliases,h)&&(h=m.styleAliases[h]),i[u]=h;return i}function YF(e){var t,i,s;if(t=e.toString(16).toUpperCase(),e<=255)i="x",s=2;else if(e<=65535)i="u",s=4;else if(e<=4294967295)i="U",s=8;else throw new Xi("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+i+mi.repeat("0",s-t.length)+t}var XF=1,Xc=2;function ZF(e){this.schema=e.schema||dv,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=mi.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=WF(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?Xc:XF,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function W2(e,t){for(var i=mi.repeat(" ",t),s=0,a=-1,o="",u,h=e.length;s<h;)a=e.indexOf(`
|
|
178
|
-
`,s),a===-1?(u=e.slice(s),s=h):(u=e.slice(s,a+1),s=a+1),u.length&&u!==`
|
|
179
|
-
`&&(o+=i),o+=u;return o}function Q0(e,t){return`
|
|
180
|
-
`+mi.repeat(" ",e.indent*t)}function QF(e,t){var i,s,a;for(i=0,s=e.implicitTypes.length;i<s;i+=1)if(a=e.implicitTypes[i],a.resolve(t))return!0;return!1}function Ih(e){return e===jF||e===MF}function Zc(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==mv||65536<=e&&e<=1114111}function Y2(e){return Zc(e)&&e!==mv&&e!==RF&&e!==Yc}function X2(e,t,i){var s=Y2(e),a=s&&!Ih(e);return(i?s:s&&e!==O3&&e!==L3&&e!==B3&&e!==z3&&e!==I3)&&e!==Z0&&!(t===zh&&!a)||Y2(t)&&!Ih(t)&&e===Z0||t===zh&&a}function JF(e){return Zc(e)&&e!==mv&&!Ih(e)&&e!==PF&&e!==HF&&e!==zh&&e!==O3&&e!==L3&&e!==B3&&e!==z3&&e!==I3&&e!==Z0&&e!==BF&&e!==IF&&e!==DF&&e!==qF&&e!==$F&&e!==UF&&e!==zF&&e!==OF&&e!==LF&&e!==FF&&e!==VF}function eV(e){return!Ih(e)&&e!==zh}function Mc(e,t){var i=e.charCodeAt(t),s;return i>=55296&&i<=56319&&t+1<e.length&&(s=e.charCodeAt(t+1),s>=56320&&s<=57343)?(i-55296)*1024+s-56320+65536:i}function P3(e){var t=/^\n* /;return t.test(e)}var $3=1,J0=2,U3=3,H3=4,qo=5;function tV(e,t,i,s,a,o,u,h){var m,f=0,p=null,b=!1,_=!1,x=s!==-1,y=-1,S=JF(Mc(e,0))&&eV(Mc(e,e.length-1));if(t||u)for(m=0;m<e.length;f>=65536?m+=2:m++){if(f=Mc(e,m),!Zc(f))return qo;S=S&&X2(f,p,h),p=f}else{for(m=0;m<e.length;f>=65536?m+=2:m++){if(f=Mc(e,m),f===Yc)b=!0,x&&(_=_||m-y-1>s&&e[y+1]!==" ",y=m);else if(!Zc(f))return qo;S=S&&X2(f,p,h),p=f}_=_||x&&m-y-1>s&&e[y+1]!==" "}return!b&&!_?S&&!u&&!a(e)?$3:o===Xc?qo:J0:i>9&&P3(e)?qo:u?o===Xc?qo:J0:_?H3:U3}function iV(e,t,i,s,a){e.dump=(function(){if(t.length===0)return e.quotingType===Xc?'""':"''";if(!e.noCompatMode&&(KF.indexOf(t)!==-1||GF.test(t)))return e.quotingType===Xc?'"'+t+'"':"'"+t+"'";var o=e.indent*Math.max(1,i),u=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),h=s||e.flowLevel>-1&&i>=e.flowLevel;function m(f){return QF(e,f)}switch(tV(t,h,e.indent,u,m,e.quotingType,e.forceQuotes&&!s,a)){case $3:return t;case J0:return"'"+t.replace(/'/g,"''")+"'";case U3:return"|"+Z2(t,e.indent)+Q2(W2(t,o));case H3:return">"+Z2(t,e.indent)+Q2(W2(nV(t,u),o));case qo:return'"'+sV(t)+'"';default:throw new Xi("impossible error: invalid scalar style")}})()}function Z2(e,t){var i=P3(e)?String(t):"",s=e[e.length-1]===`
|
|
181
|
-
`,a=s&&(e[e.length-2]===`
|
|
182
|
-
`||e===`
|
|
183
|
-
`),o=a?"+":s?"":"-";return i+o+`
|
|
184
|
-
`}function Q2(e){return e[e.length-1]===`
|
|
185
|
-
`?e.slice(0,-1):e}function nV(e,t){for(var i=/(\n+)([^\n]*)/g,s=(function(){var f=e.indexOf(`
|
|
186
|
-
`);return f=f!==-1?f:e.length,i.lastIndex=f,J2(e.slice(0,f),t)})(),a=e[0]===`
|
|
187
|
-
`||e[0]===" ",o,u;u=i.exec(e);){var h=u[1],m=u[2];o=m[0]===" ",s+=h+(!a&&!o&&m!==""?`
|
|
188
|
-
`:"")+J2(m,t),a=o}return s}function J2(e,t){if(e===""||e[0]===" ")return e;for(var i=/ [^ ]/g,s,a=0,o,u=0,h=0,m="";s=i.exec(e);)h=s.index,h-a>t&&(o=u>a?u:h,m+=`
|
|
189
|
-
`+e.slice(a,o),a=o+1),u=h;return m+=`
|
|
190
|
-
`,e.length-a>t&&u>a?m+=e.slice(a,u)+`
|
|
191
|
-
`+e.slice(u+1):m+=e.slice(a),m.slice(1)}function sV(e){for(var t="",i=0,s,a=0;a<e.length;i>=65536?a+=2:a++)i=Mc(e,a),s=Vi[i],!s&&Zc(i)?(t+=e[a],i>=65536&&(t+=e[a+1])):t+=s||YF(i);return t}function rV(e,t,i){var s="",a=e.tag,o,u,h;for(o=0,u=i.length;o<u;o+=1)h=i[o],e.replacer&&(h=e.replacer.call(i,String(o),h)),(ur(e,t,h,!1,!1)||typeof h>"u"&&ur(e,t,null,!1,!1))&&(s!==""&&(s+=","+(e.condenseFlow?"":" ")),s+=e.dump);e.tag=a,e.dump="["+s+"]"}function ek(e,t,i,s){var a="",o=e.tag,u,h,m;for(u=0,h=i.length;u<h;u+=1)m=i[u],e.replacer&&(m=e.replacer.call(i,String(u),m)),(ur(e,t+1,m,!0,!0,!1,!0)||typeof m>"u"&&ur(e,t+1,null,!0,!0,!1,!0))&&((!s||a!=="")&&(a+=Q0(e,t)),e.dump&&Yc===e.dump.charCodeAt(0)?a+="-":a+="- ",a+=e.dump);e.tag=o,e.dump=a||"[]"}function aV(e,t,i){var s="",a=e.tag,o=Object.keys(i),u,h,m,f,p;for(u=0,h=o.length;u<h;u+=1)p="",s!==""&&(p+=", "),e.condenseFlow&&(p+='"'),m=o[u],f=i[m],e.replacer&&(f=e.replacer.call(i,m,f)),ur(e,t,m,!1,!1)&&(e.dump.length>1024&&(p+="? "),p+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),ur(e,t,f,!1,!1)&&(p+=e.dump,s+=p));e.tag=a,e.dump="{"+s+"}"}function oV(e,t,i,s){var a="",o=e.tag,u=Object.keys(i),h,m,f,p,b,_;if(e.sortKeys===!0)u.sort();else if(typeof e.sortKeys=="function")u.sort(e.sortKeys);else if(e.sortKeys)throw new Xi("sortKeys must be a boolean or a function");for(h=0,m=u.length;h<m;h+=1)_="",(!s||a!=="")&&(_+=Q0(e,t)),f=u[h],p=i[f],e.replacer&&(p=e.replacer.call(i,f,p)),ur(e,t+1,f,!0,!0,!0)&&(b=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,b&&(e.dump&&Yc===e.dump.charCodeAt(0)?_+="?":_+="? "),_+=e.dump,b&&(_+=Q0(e,t)),ur(e,t+1,p,!0,b)&&(e.dump&&Yc===e.dump.charCodeAt(0)?_+=":":_+=": ",_+=e.dump,a+=_));e.tag=o,e.dump=a||"{}"}function tk(e,t,i){var s,a,o,u,h,m;for(a=i?e.explicitTypes:e.implicitTypes,o=0,u=a.length;o<u;o+=1)if(h=a[o],(h.instanceOf||h.predicate)&&(!h.instanceOf||typeof t=="object"&&t instanceof h.instanceOf)&&(!h.predicate||h.predicate(t))){if(i?h.multi&&h.representName?e.tag=h.representName(t):e.tag=h.tag:e.tag="?",h.represent){if(m=e.styleMap[h.tag]||h.defaultStyle,j3.call(h.represent)==="[object Function]")s=h.represent(t,m);else if(D3.call(h.represent,m))s=h.represent[m](t,m);else throw new Xi("!<"+h.tag+'> tag resolver accepts not "'+m+'" style');e.dump=s}return!0}return!1}function ur(e,t,i,s,a,o,u){e.tag=null,e.dump=i,tk(e,i,!1)||tk(e,i,!0);var h=j3.call(e.dump),m=s,f;s&&(s=e.flowLevel<0||e.flowLevel>t);var p=h==="[object Object]"||h==="[object Array]",b,_;if(p&&(b=e.duplicates.indexOf(i),_=b!==-1),(e.tag!==null&&e.tag!=="?"||_||e.indent!==2&&t>0)&&(a=!1),_&&e.usedDuplicates[b])e.dump="*ref_"+b;else{if(p&&_&&!e.usedDuplicates[b]&&(e.usedDuplicates[b]=!0),h==="[object Object]")s&&Object.keys(e.dump).length!==0?(oV(e,t,e.dump,a),_&&(e.dump="&ref_"+b+e.dump)):(aV(e,t,e.dump),_&&(e.dump="&ref_"+b+" "+e.dump));else if(h==="[object Array]")s&&e.dump.length!==0?(e.noArrayIndent&&!u&&t>0?ek(e,t-1,e.dump,a):ek(e,t,e.dump,a),_&&(e.dump="&ref_"+b+e.dump)):(rV(e,t,e.dump),_&&(e.dump="&ref_"+b+" "+e.dump));else if(h==="[object String]")e.tag!=="?"&&iV(e,e.dump,t,o,m);else{if(h==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new Xi("unacceptable kind of an object to dump "+h)}e.tag!==null&&e.tag!=="?"&&(f=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?f="!"+f:f.slice(0,18)==="tag:yaml.org,2002:"?f="!!"+f.slice(18):f="!<"+f+">",e.dump=f+" "+e.dump)}return!0}function lV(e,t){var i=[],s=[],a,o;for(eb(e,i,s),a=0,o=s.length;a<o;a+=1)t.duplicates.push(i[s[a]]);t.usedDuplicates=new Array(o)}function eb(e,t,i){var s,a,o;if(e!==null&&typeof e=="object")if(a=t.indexOf(e),a!==-1)i.indexOf(a)===-1&&i.push(a);else if(t.push(e),Array.isArray(e))for(a=0,o=e.length;a<o;a+=1)eb(e[a],t,i);else for(s=Object.keys(e),a=0,o=s.length;a<o;a+=1)eb(e[s[a]],t,i)}function cV(e,t){t=t||{};var i=new ZF(t);i.noRefs||lV(e,i);var s=e;return i.replacer&&(s=i.replacer.call({"":s},"",s)),ur(i,0,s,!0,!0)?i.dump+`
|
|
192
|
-
`:""}var uV=cV,dV={dump:uV};function pv(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var hV=Di,fV=n3,mV=o3,pV=h3,gV=f3,bV=dv,vV=R3.load,_V=R3.loadAll,xV=dV.dump,yV=Xi,SV={binary:v3,float:d3,map:a3,null:l3,pairs:x3,set:y3,timestamp:g3,bool:c3,int:u3,merge:b3,omap:_3,seq:r3,str:s3},wV=pv("safeLoad","load"),kV=pv("safeLoadAll","loadAll"),EV=pv("safeDump","dump"),CV={Type:hV,Schema:fV,FAILSAFE_SCHEMA:mV,JSON_SCHEMA:pV,CORE_SCHEMA:gV,DEFAULT_SCHEMA:bV,load:vV,loadAll:_V,dump:xV,YAMLException:yV,types:SV,safeLoad:wV,safeLoadAll:kV,safeDump:EV};function F3(e){return e!==null&&typeof e=="object"}function V3(e){return typeof e=="string"?"text-rose-700 dark:text-rose-300":typeof e=="number"?"text-emerald-700 dark:text-emerald-300":typeof e=="boolean"?"text-blue-700 dark:text-blue-400":e==null?"text-muted-foreground italic":"text-foreground"}function q3(e){return e==null?"null":typeof e=="string"?e===""?'""':e:String(e)}function K3({label:e,value:t,depth:i,defaultOpen:s}){const[a,o]=k.useState(s),u={paddingLeft:`${i*1.1}rem`};if(!F3(t))return c.jsxs("div",{className:"flex items-baseline gap-2 py-[1px]",style:u,children:[c.jsxs("span",{className:"text-muted-foreground",children:[e,":"]}),c.jsx("span",{className:de("whitespace-pre-wrap break-words",V3(t)),children:q3(t)})]});const h=Array.isArray(t)?t.map((f,p)=>[String(p),f]):Object.entries(t),m=Array.isArray(t)?`[${h.length}]`:`{${h.length}}`;return c.jsxs("div",{children:[c.jsxs("button",{type:"button",onClick:()=>o(f=>!f),className:"flex w-full items-center gap-1 py-[1px] text-left hover:bg-muted",style:u,children:[a?c.jsx(Yn,{className:"size-3.5 shrink-0 text-muted-foreground"}):c.jsx(sa,{className:"size-3.5 shrink-0 text-muted-foreground"}),c.jsx("span",{className:"font-medium text-foreground",children:e}),c.jsx("span",{className:"text-muted-foreground",children:m})]}),a?h.map(([f,p])=>c.jsx(K3,{label:f,value:p,depth:i+1,defaultOpen:i<1},f)):null]})}function NV({content:e}){const t=k.useMemo(()=>{try{const s=CV.loadAll(e);return{value:s.length<=1?s[0]:s,error:null}}catch(s){return{value:null,error:s instanceof Error?s.message:String(s)}}},[e]);if(t.error)return c.jsx("div",{className:"p-4",children:c.jsxs(dt,{variant:"destructive",children:["Could not parse YAML: ",t.error]})});if(!F3(t.value))return c.jsx("div",{className:"p-4 font-mono text-[12px]",children:c.jsx("span",{className:V3(t.value),children:q3(t.value)})});const i=Array.isArray(t.value)?t.value.map((s,a)=>[String(a),s]):Object.entries(t.value);return c.jsx("div",{className:"min-w-max px-4 py-3 font-mono text-[12px] leading-[1.6]",children:i.map(([s,a])=>c.jsx(K3,{label:s,value:a,depth:0,defaultOpen:!0},s))})}const TV=k.lazy(()=>_U(()=>import("./code-editor-NLVWCtZl.js"),[]).then(e=>({default:e.CodeEditor})));function AV(e){const t=e.split("/").pop()?.toLowerCase().split(".").pop()??"";return t==="md"||t==="mdx"||t==="markdown"?"markdown":t==="yml"||t==="yaml"?"yaml":null}function MV(e){const t=e.split("/").pop()?.toLowerCase()??"",i=t.includes(".")?t.split(".").pop()??"":"",s={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 s[i]?s[i]:t==="dockerfile"?"dockerfile":null}function RV(e,t){const i=e.endsWith(`
|
|
193
|
-
`)?e.slice(0,-1):e;return!t||!Y0.getLanguage(t)?i.split(`
|
|
194
|
-
`).map(ik):i.split(`
|
|
195
|
-
`).map(s=>{if(!s)return"";try{return Y0.highlight(s,{language:t,ignoreIllegals:!0}).value}catch{return ik(s)}})}function ik(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function jV({content:e,path:t}){const i=k.useMemo(()=>MV(t),[t]),s=k.useMemo(()=>RV(e,i),[e,i]),a=`${Math.max(2,String(s.length).length)}ch`;return c.jsx("div",{className:"min-w-max font-mono text-[12px] leading-[1.5]",children:s.map((o,u)=>c.jsxs("div",{className:"flex",children:[c.jsx("span",{className:"shrink-0 select-none border-r border-zinc-200 bg-zinc-100 px-2 text-right text-zinc-400 dark:border-zinc-800 dark:bg-zinc-900 dark:text-zinc-500",style:{minWidth:`calc(${a} + 1rem)`},children:u+1}),c.jsx("span",{className:"hljs whitespace-pre px-3 text-zinc-800 dark:text-zinc-100",dangerouslySetInnerHTML:{__html:o||" "}})]},u))})}function DV({path:e,isModified:t,onViewDiff:i,onFileSaved:s,onSendToAi:a}){const[o,u]=k.useState(null),[h,m]=k.useState(""),[f,p]=k.useState(!1),[b,_]=k.useState(null),[x,y]=k.useState(!1),[S,E]=k.useState(!1),{success:C,error:A}=Bi(),N=k.useMemo(()=>AV(e),[e]),[M,D]=k.useState("preview"),U=!!(o&&!o.binary&&!o.truncated),L=o?h!==o.content:!1;k.useEffect(()=>{D(N?"preview":"source"),p(!1)},[N]),k.useEffect(()=>{if(!e){u(null);return}let I=!0;return y(!0),_(null),p(!1),i6(e).then(F=>{I&&(u(F),m(F.content),y(!1))}).catch(F=>{I&&(_(F instanceof Error?F.message:String(F)),y(!1))}),()=>{I=!1}},[e]);async function R(){if(!(!e||!o||!L||S)){E(!0);try{await n6(e,h);const I={...o,content:h,size:new TextEncoder().encode(h).length};u(I),p(!1),C(`Saved ${e}.`),s?.(e)}catch(I){A(I instanceof Error?I.message:String(I))}finally{E(!1)}}}function $(){m(o?.content??""),p(!1)}return e?c.jsxs("section",{className:"flex min-h-0 min-w-0 flex-col border-l border-border bg-card",children:[c.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-3 border-b border-border px-3 py-1.5",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("h2",{className:"truncate text-[13px] font-semibold tracking-tight",children:e}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[10px] text-muted-foreground",children:[c.jsx("span",{children:"Read-only view of tracked file."}),o?.truncated?c.jsx("span",{className:"text-amber-700",children:"Truncated — file exceeds 1MB."}):null,o?.binary?c.jsx("span",{className:"text-amber-700",children:"Binary file."}):null]})]}),c.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[N&&!o?.binary?c.jsxs("div",{className:"flex items-center rounded-md border border-border p-0.5",children:[c.jsxs("button",{type:"button",onClick:()=>D("preview"),"aria-pressed":M==="preview",className:de("flex items-center gap-1 rounded px-2 py-1 text-[11px] font-medium transition-colors",M==="preview"?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-muted"),children:[c.jsx(sb,{className:"size-3.5"}),"Preview"]}),c.jsxs("button",{type:"button",onClick:()=>D("source"),"aria-pressed":M==="source",className:de("flex items-center gap-1 rounded px-2 py-1 text-[11px] font-medium transition-colors",M==="source"?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-muted"),children:[c.jsx(bk,{className:"size-3.5"}),"Source"]})]}):null,t?c.jsx(ue,{onClick:i,size:"sm",type:"button",variant:"outline",children:"View diff"}):null,a?c.jsx(ue,{"aria-label":"Send file to AI input",className:"size-8",disabled:!e,onClick:a,size:"icon",title:"Send file path to AI input",type:"button",variant:"outline",children:c.jsx(cs,{className:"size-4"})}):null,f?c.jsxs(c.Fragment,{children:[c.jsxs(ue,{disabled:!L||S,onClick:()=>{R()},size:"sm",type:"button",children:[c.jsx(Ak,{}),"Apply"]}),c.jsxs(ue,{disabled:S,onClick:$,size:"sm",type:"button",variant:"outline",children:[c.jsx(Ji,{}),"Cancel"]})]}):U?c.jsxs(ue,{onClick:()=>{D("source"),p(!0)},size:"sm",type:"button",variant:"outline",children:[c.jsx(Ic,{}),"Edit"]}):null]})]}),c.jsx("div",{className:"min-h-0 flex-1 overflow-auto bg-zinc-50 dark:bg-zinc-950",children:b?c.jsx("div",{className:"p-4",children:c.jsx(dt,{variant:"destructive",children:b})}):x?c.jsx("div",{className:"p-4 text-[12px] text-muted-foreground",children:"Loading…"}):o?.binary?c.jsx("div",{className:"p-4 text-[12px] text-muted-foreground",children:"Cannot display binary content."}):o?f?c.jsx(k.Suspense,{fallback:c.jsx("div",{className:"p-4 text-[12px] text-muted-foreground",children:"Loading editor…"}),children:c.jsx(TV,{path:e,value:h,onChange:m})}):N&&M==="preview"?N==="markdown"?c.jsx(aH,{content:o.content}):c.jsx(NV,{content:o.content}):c.jsx(jV,{content:o.content,path:e}):null})]}):c.jsx("div",{className:"p-4",children:c.jsx(dt,{variant:"muted",className:"border-dashed p-12 text-center",children:"Select a file to view its contents."})})}function OV({activeHunkIndex:e,filePaths:t,hunkCount:i,pendingNextFilePath:s,selectedFile:a}){if(i>0&&e<i-1)return{kind:"hunk",activeHunkIndex:e+1};const o=t.indexOf(a),u=t[o+1];return u?s===u?{kind:"file",filePath:u}:{kind:"confirm-next-file",filePath:u}:{kind:"none"}}function nk(e){const t={name:"",fullPath:"",children:new Map};for(const i of e){const s=i.name.split("/");let a=t;s.forEach((o,u)=>{let h=a.children.get(o);h||(h={name:o,fullPath:s.slice(0,u+1).join("/"),children:new Map},a.children.set(o,h)),a=h}),a.branch=i}return t}function sk({label:e,tree:t,onSelect:i,defaultOpen:s,forceOpen:a}){const[o,u]=k.useState(s??!1),h=a||o,m=t.children.size===0;return c.jsxs("div",{className:"mb-1",children:[c.jsxs("button",{type:"button",onClick:()=>u(f=>!f),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:[h?c.jsx(Yn,{size:12}):c.jsx(sa,{size:12}),e,m?null:c.jsxs("span",{className:"ml-1 text-[10px] font-normal",children:["(",t.children.size,")"]})]}),h&&!m?c.jsx("ul",{children:Array.from(t.children.values()).map(f=>c.jsx(G3,{node:f,depth:1,onSelect:i,forceOpen:a},f.fullPath))}):null]})}function G3({node:e,depth:t,onSelect:i,forceOpen:s}){const[a,o]=k.useState(!0),u=s||a,h=e.children.size>0,m=e.branch,f={paddingLeft:`${t*10}px`};return!h&&m?c.jsx("li",{children:c.jsxs("button",{type:"button",onClick:()=>i(m),style:f,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:[c.jsx(Wn,{size:11,className:"shrink-0 opacity-70"}),c.jsx("span",{className:"truncate",children:e.name}),m.current?c.jsx("span",{className:"text-[10px]",children:"●"}):null]})}):c.jsxs("li",{children:[c.jsxs("button",{type:"button",onClick:()=>{m?i(m):o(p=>!p)},style:f,className:"flex w-full items-center gap-1 py-0.5 pr-2 text-left text-[12px] hover:bg-muted/60",children:[h?u?c.jsx(Yn,{size:11}):c.jsx(sa,{size:11}):c.jsx("span",{className:"inline-block w-[11px]"}),c.jsx("span",{className:"truncate",children:e.name})]}),u&&h?c.jsx("ul",{children:Array.from(e.children.values()).map(p=>c.jsx(G3,{node:p,depth:t+1,onSelect:i,forceOpen:s},p.fullPath))}):null]})}function LV({selectedCommit:e,selectedFile:t,diff:i,diffLoading:s,diffError:a}){return c.jsxs("section",{className:"flex min-h-0 min-w-0 flex-col bg-card border-b border-border",children:[c.jsx("div",{className:"flex shrink-0 items-center justify-between gap-3 border-b border-border px-3 py-1.5",children:c.jsxs("div",{className:"min-w-0",children:[c.jsx("h2",{className:"truncate text-[13px] font-semibold tracking-tight",children:t??(e?e.subject:"Commit")}),e?c.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[10px] text-muted-foreground",children:[c.jsx("span",{className:"font-mono",children:e.hash.slice(0,12)}),c.jsxs("span",{children:[e.author," <",e.email,">"]}),c.jsx("span",{children:new Date(e.timestamp*1e3).toLocaleString()})]}):null]})}),c.jsx("div",{className:"relative min-h-0 min-w-0 flex-1",children:a?c.jsx("div",{className:"p-4",children:c.jsx(dt,{variant:"destructive",children:a})}):e?s?c.jsx("div",{className:"p-4 text-[12px] text-muted-foreground",children:"Loading diff…"}):i?c.jsx(JN,{activeHunkIndex:0,diff:i}):c.jsx("div",{className:"p-4",children:c.jsx(dt,{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."})}):c.jsx("div",{className:"p-4",children:c.jsx(dt,{variant:"muted",className:"border-dashed p-12 text-center",children:"Select a commit to inspect its diff."})})})]})}function BV({files:e,filesError:t,selectedHash:i,selectedFile:s,onSelect:a}){return c.jsxs("aside",{className:"flex min-h-0 flex-col overflow-hidden border-r border-border",children:[c.jsx("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-1.5",children:c.jsxs("h2",{className:"text-[13px] font-semibold tracking-tight",children:["Files",e.length?c.jsx("span",{className:"ml-2 text-[11px] font-normal text-muted-foreground",children:e.length}):null]})}),c.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:t?c.jsx("div",{className:"p-3",children:c.jsx(dt,{variant:"destructive",children:t})}):i?e.length===0?c.jsx("div",{className:"p-3 text-[12px] text-muted-foreground",children:"No file changes."}):c.jsx("ul",{className:"divide-y divide-border",children:e.map(o=>c.jsx("li",{children:c.jsxs("button",{onClick:()=>a(o.path),type:"button",title:o.path,className:`flex w-full items-center gap-2 px-2 py-1 text-left text-[12px] transition-colors hover:bg-muted/60 ${s===o.path?"bg-muted":""}`,children:[c.jsx("span",{className:zV(o.index),children:o.index.trim()||"·"}),c.jsx("span",{className:"truncate font-mono",children:o.path})]})},o.path))}):c.jsx("div",{className:"p-3 text-[12px] text-muted-foreground",children:"Select a commit to see its files."})})]})}function zV(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 rk=["#3b82f6","#10b981","#f59e0b","#ec4899","#8b5cf6","#14b8a6","#ef4444","#84cc16"];function _c(e){return rk[e%rk.length]}function IV({lane:e,laneCount:t,edges:i,throughLanes:s,isMerge:a,height:o=28,laneWidth:u=14}){const m=Math.max(e+1,t,1)*u,f=o/2,p=xc(e,u),b=a?4:3.5;return c.jsxs("svg",{width:m,height:o,viewBox:`0 0 ${m} ${o}`,style:{flex:"0 0 auto",display:"block"},children:[s.map(_=>c.jsx("line",{x1:xc(_,u),y1:0,x2:xc(_,u),y2:o,stroke:_c(_),strokeWidth:1.5},`t-${_}`)),c.jsx("line",{x1:p,y1:0,x2:p,y2:f,stroke:_c(e),strokeWidth:1.5}),i.map((_,x)=>{const y=xc(_.fromLane,u),S=xc(_.toLane,u);if(y===S)return c.jsx("line",{x1:y,y1:f,x2:S,y2:o,stroke:_c(_.toLane),strokeWidth:1.5},`e-${x}`);const E=f+(o-f)/2;return c.jsx("path",{d:`M ${y} ${f} C ${y} ${E}, ${S} ${E}, ${S} ${o}`,fill:"none",stroke:_c(_.toLane),strokeWidth:1.5},`e-${x}`)}),c.jsx("circle",{cx:p,cy:f,r:b,fill:_c(e),stroke:"var(--background, #fff)",strokeWidth:1.5})]})}function xc(e,t){return e*t+t/2}const ak=28;function PV({commits:e,loading:t,error:i,selectedHash:s,maxLanes:a,rowRefs:o,onSelect:u,onLoadMore:h}){const{sendToAgent:m}=Li(),[f,p]=k.useState(null);function b(_,x){p(null),m({prompt:qL(_,x),source:{type:"git-commit",label:_.hash.slice(0,7)},label:`${_.hash.slice(0,7)}: ${x}`})}return c.jsxs("aside",{className:"flex min-h-0 flex-col overflow-hidden border-r border-border",children:[c.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-1.5",children:[c.jsxs("h2",{className:"text-[13px] font-semibold tracking-tight",children:["Commit tree",e.length?c.jsxs("span",{className:"ml-2 text-[11px] font-normal text-muted-foreground",children:[e.length," commits"]}):null]}),c.jsx(ue,{disabled:t,onClick:h,size:"sm",type:"button",variant:"outline",children:"Load more"})]}),c.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:i?c.jsx("div",{className:"p-3",children:c.jsx(dt,{variant:"destructive",children:i})}):t&&e.length===0?c.jsx("div",{className:"p-3 text-[12px] text-muted-foreground",children:"Loading commits…"}):e.length===0?c.jsx("div",{className:"p-3 text-[12px] text-muted-foreground",children:"No commits."}):c.jsx("ul",{className:"divide-y divide-border",children:e.map(_=>c.jsxs("li",{ref:x=>{x?o.current.set(_.hash,x):o.current.delete(_.hash)},className:"group flex flex-col",children:[c.jsxs("div",{className:`flex items-center transition-colors hover:bg-muted/60 ${s===_.hash?"bg-muted":""}`,children:[c.jsxs("button",{onClick:()=>u(_.hash),type:"button",className:"flex min-w-0 flex-1 items-center gap-2 px-2 py-0.5 text-left",style:{minHeight:ak},title:`${_.hash}
|
|
196
|
-
${_.author} <${_.email}>
|
|
197
|
-
${_.subject}`,children:[c.jsx(IV,{lane:_.lane,laneCount:Math.max(_.laneCount,a),edges:_.edges,throughLanes:_.throughLanes,isMerge:_.parents.length>1,height:ak}),c.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:_.hash.slice(0,7)}),c.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:[_.refs.map(x=>c.jsx("span",{className:UV(x.kind),children:x.name},`${x.kind}-${x.name}`)),c.jsx("span",{className:"truncate text-[12px]",children:_.subject})]}),c.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:_.author}),c.jsx("span",{className:"shrink-0 font-mono text-[10px] tabular-nums text-muted-foreground/70",title:new Date(_.timestamp*1e3).toLocaleString(),children:$V(_.timestamp)})]}),c.jsx(tl,{className:`mr-1 shrink-0 ${f===_.hash?"opacity-100":""}`,label:`Ask AI about commit ${_.hash.slice(0,7)}`,onAsk:()=>p(x=>x===_.hash?null:_.hash)})]}),f===_.hash?c.jsx("div",{className:"px-2 pb-1.5 pt-0.5",children:c.jsx(Wh,{placeholder:"What should the agent do with this commit? (explain, summarize, find regressions…)",onSubmit:x=>b(_,x),onCancel:()=>p(null)})}):null]},_.hash))})})]})}function $V(e){if(!e)return"";const t=Math.max(0,Math.floor(Date.now()/1e3-e));if(t<60)return`${t}s`;const i=Math.floor(t/60);if(i<60)return`${i}m`;const s=Math.floor(i/60);if(s<24)return`${s}h`;const a=Math.floor(s/24);if(a<30)return`${a}d`;const o=Math.floor(a/30);return o<12?`${o}mo`:`${Math.floor(o/12)}y`}function UV(e){const t="rounded border px-1.5 py-px text-[10px] font-medium";switch(e){case"head":return`${t} border-emerald-200 bg-emerald-100 text-emerald-800 dark:border-emerald-400/30 dark:bg-emerald-500/15 dark:text-emerald-300`;case"branch":return`${t} border-blue-200 bg-blue-100 text-blue-800 dark:border-blue-400/30 dark:bg-blue-500/15 dark:text-blue-300`;case"remote":return`${t} border-slate-200 bg-slate-100 text-slate-700 dark:border-zinc-700/80 dark:bg-zinc-800/80 dark:text-zinc-300`;case"tag":return`${t} border-amber-200 bg-amber-100 text-amber-800 dark:border-amber-400/30 dark:bg-amber-500/15 dark:text-amber-300`}}const ok=200;function HV(){const[e,t]=k.useState([]),[i,s]=k.useState(ok),[a,o]=k.useState(!0),[u,h]=k.useState(null),[m,f]=k.useState(null),[p,b]=k.useState([]),[_,x]=k.useState(null),[y,S]=k.useState(null),[E,C]=k.useState(""),[A,N]=k.useState(!1),[M,D]=k.useState(null);k.useEffect(()=>{let R=!0;return o(!0),h(null),ZM(i).then($=>{R&&(t($),$.length>0&&!$.some(I=>I.hash===m)&&f($[0].hash))}).catch($=>{R&&h($ instanceof Error?$.message:String($))}).finally(()=>{R&&o(!1)}),()=>{R=!1}},[i]),k.useEffect(()=>{if(!m){b([]),S(null);return}let R=!0;return x(null),JM(m).then($=>{R&&(b($),S($[0]?.path??null))}).catch($=>{R&&x($ instanceof Error?$.message:String($))}),()=>{R=!1}},[m]),k.useEffect(()=>{if(!m){C("");return}let R=!0;return D(null),N(!0),QM(m,y??void 0).then($=>{R&&C($)}).catch($=>{R&&D($ instanceof Error?$.message:String($))}).finally(()=>{R&&N(!1)}),()=>{R=!1}},[m,y]);const U=k.useMemo(()=>e.reduce((R,$)=>Math.max(R,$.laneCount),1),[e]),L=e.find(R=>R.hash===m)??null;return{commits:e,loading:a,error:u,selectedHash:m,setSelectedHash:f,files:p,filesError:_,selectedFile:y,setSelectedFile:S,diff:E,diffLoading:A,diffError:M,maxLanes:U,selectedCommit:L,loadMore:()=>s(R=>R+ok)}}function FV({branches:e=[]}){const{commits:t,loading:i,error:s,selectedHash:a,setSelectedHash:o,files:u,filesError:h,selectedFile:m,setSelectedFile:f,diff:p,diffLoading:b,diffError:_,maxLanes:x,selectedCommit:y,loadMore:S}=HV(),[E,C]=k.useState(""),A=k.useMemo(()=>{const R=E.trim().toLowerCase();return R?e.filter($=>$.name.toLowerCase().includes(R)):e},[e,E]),N=k.useMemo(()=>nk(A.filter(R=>!R.remote)),[A]),M=k.useMemo(()=>nk(A.filter(R=>R.remote)),[A]),D=E.trim().length>0,U=k.useRef(new Map);function L(R){const $=R.remote?"remote":"branch",I=t.find(Y=>Y.refs.some(Q=>Q.kind===$&&Q.name===R.name));if(!I)return;o(I.hash);const F=U.current.get(I.hash),G=F?.parentElement?.parentElement;!F||!G||G.scrollTo({top:Math.max(F.offsetTop-G.clientHeight/2+F.clientHeight/2,0),behavior:"smooth"})}return c.jsxs("div",{className:"grid h-full min-h-0 overflow-hidden border-0 bg-card/85 grid-cols-[220px_minmax(0,1fr)]",children:[c.jsxs("aside",{className:"flex min-h-0 flex-col overflow-hidden border-r border-border",children:[c.jsxs("div",{className:"flex shrink-0 flex-col gap-1 border-b border-border px-3 py-1.5",children:[c.jsx("h2",{className:"text-[13px] font-semibold tracking-tight",children:"Branches"}),c.jsx("input",{type:"search",value:E,onChange:R=>C(R.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"})]}),c.jsxs("div",{className:"min-h-0 flex-1 overflow-auto py-1",children:[c.jsx(sk,{label:"Local",tree:N,onSelect:L,defaultOpen:!0,forceOpen:D}),c.jsx(sk,{label:"Remote",tree:M,onSelect:L,forceOpen:D})]})]}),c.jsxs("div",{className:"grid min-h-0 min-w-0 grid-rows-[minmax(0,3fr)_minmax(0,2fr)]",children:[c.jsx(LV,{selectedCommit:y,selectedFile:m,diff:p,diffLoading:b,diffError:_}),c.jsxs("div",{className:"grid min-h-0 min-w-0 grid-cols-[minmax(0,1fr)_280px]",children:[c.jsx(PV,{commits:t,loading:i,error:s,selectedHash:a,maxLanes:x,rowRefs:U,onSelect:o,onLoadMore:S}),c.jsx(BV,{files:u,filesError:h,selectedHash:a,selectedFile:m,onSelect:f})]})]})]})}const tb=300,VV=600,qV=new Set(["md","mdx","markdown","txt","rst","adoc","json","jsonc","json5","yaml","yml","toml","xml","ini","cfg","conf","env","properties","csv","tsv","lock","svg","map","snap","png","jpg","jpeg","gif","ico","webp"]);function KV(e){const t=e.toLowerCase();if(t.endsWith(".d.ts")||t.endsWith(".min.js")||t.endsWith(".min.css"))return!1;const i=t.lastIndexOf(".");return i<0?!0:!qV.has(t.slice(i+1))}function GV(e){return e>=VV?"danger":e>=tb?"warn":"ok"}const WV={ok:"bg-emerald-500/60",warn:"bg-amber-500/70",danger:"bg-destructive/70"},YV={ok:"text-muted-foreground",warn:"text-amber-600 dark:text-amber-400",danger:"text-destructive"};function XV({onOpenFile:e,root:t}){const[i,s]=k.useState([]),[a,o]=k.useState(!0),[u,h]=k.useState(null),[m,f]=k.useState(!0);function p(){o(!0),h(null),t6().then(s).catch(S=>h(S instanceof Error?S.message:String(S))).finally(()=>o(!1))}k.useEffect(()=>{p()},[]);const b=k.useMemo(()=>m?i.filter(S=>KV(S.path)):i,[i,m]),_=i.length-b.length,x=b[0]?.lines??1,y=b.filter(S=>S.lines>=tb).length;return c.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-card/85",children:[c.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border px-3 py-2",children:[c.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[c.jsx(Sk,{className:"size-4"}),c.jsx("span",{className:"font-semibold text-foreground",children:"Largest files"}),!a&&!u?c.jsxs("span",{children:[b.length," files · ",y," over ",tb," lines",m&&_>0?` · ${_} data/docs hidden`:""]}):null]}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsxs(ue,{size:"sm",variant:m?"default":"outline",className:"h-7",onClick:()=>f(S=>!S),title:"Hide docs, data, config and generated files",type:"button",children:[c.jsx(bk,{}),"Code only"]}),c.jsxs(ue,{size:"sm",variant:"outline",className:"h-7",onClick:p,disabled:a,type:"button",children:[a?c.jsx(Oi,{className:"animate-spin"}):c.jsx(Hh,{}),"Refresh"]})]})]}),u?c.jsx(dt,{variant:"destructive",className:"m-3",children:u}):a&&i.length===0?c.jsxs("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:[c.jsx(Oi,{className:"mr-2 size-4 animate-spin"}),"Scanning tracked files…"]}):b.length===0?c.jsx("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:i.length===0?"No tracked text files found.":"No code files — toggle off “Code only” to see data & docs."}):c.jsx("ul",{className:"min-h-0 flex-1 divide-y divide-border/60 overflow-auto",children:b.map((S,E)=>{const C=GV(S.lines);return c.jsxs("li",{className:"group flex items-center gap-3 px-3 transition-colors hover:bg-muted/50",children:[c.jsx("span",{className:"w-6 shrink-0 text-right font-mono text-[10px] text-muted-foreground",children:E+1}),c.jsx("button",{type:"button",onClick:()=>e(S.path),className:"min-w-0 flex-1 py-1.5 text-left",children:c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex items-center justify-between gap-3",children:[c.jsx("span",{className:"truncate font-mono text-[11px]",children:S.path}),c.jsxs("span",{className:de("shrink-0 font-mono text-[11px] tabular-nums",YV[C]),children:[S.truncated?"≥":"",S.lines.toLocaleString()," lines"]})]}),c.jsx("div",{className:"mt-1 h-1 w-full overflow-hidden rounded-full bg-muted",children:c.jsx("div",{className:de("h-full rounded-full",WV[C]),style:{width:`${Math.max(2,S.lines/x*100)}%`}})})]})}),c.jsxs("div",{className:"flex shrink-0 items-center justify-end gap-0.5",children:[c.jsx(ZV,{file:S,root:t}),c.jsx(QV,{file:S,root:t})]})]},S.path)})})]})}function ZV({file:e,root:t}){const{sendToAgent:i}=Li(),s=ru(t,e.path),a=e.path.split("/").pop()??e.path;function o(){i({prompt:VL({absolutePath:s,lines:e.lines,relativePath:e.path}),source:{label:a,type:"large-file"},label:`Help me split \`${e.path}\` (${e.lines.toLocaleString()} lines).`,mode:"send"})}function u(){i({prompt:s,source:{label:a,type:"large-file"},mode:"draft"})}return c.jsx(W3,{label:`AI actions for ${e.path}`,trigger:c.jsx(cs,{className:"size-3.5"}),children:h=>c.jsxs(c.Fragment,{children:[c.jsx(zc,{icon:c.jsx(cs,{className:"size-3.5"}),onSelect:()=>{h(),o()},children:"Ask AI to split this file"}),c.jsx(zc,{icon:c.jsx(yk,{className:"size-3.5"}),onSelect:()=>{h(),u()},children:"Send file path to AI"})]})})}function QV({file:e,root:t}){const{error:i,success:s}=Bi(),a=ru(t,e.path),o=e.path.split("/").pop()??e.path;async function u(h,m){try{await navigator.clipboard.writeText(h),s(`Copied ${m}.`)}catch(f){i(f instanceof Error?f.message:`Could not copy ${m}.`)}}return c.jsx(W3,{label:`Copy path for ${e.path}`,trigger:c.jsxs(c.Fragment,{children:[c.jsx(_k,{className:"size-3.5"}),c.jsx("span",{className:"sr-only",children:"More actions"})]}),children:h=>c.jsxs(c.Fragment,{children:[c.jsx(zc,{icon:c.jsx(wk,{className:"size-3.5"}),onSelect:()=>{h(),u(o,"file name")},children:"Copy file name"}),c.jsx(zc,{icon:c.jsx(Lg,{className:"size-3.5"}),onSelect:()=>{h(),u(e.path,"relative path")},children:"Copy relative path"}),c.jsx(zc,{icon:c.jsx(Lg,{className:"size-3.5"}),onSelect:()=>{h(),u(a,"absolute path")},children:"Copy absolute path"})]})})}function W3({children:e,label:t,trigger:i}){const[s,a]=k.useState(!1),[o,u]=k.useState({right:0,top:0}),h=k.useRef(null),m=k.useRef(null);function f(){a(!1)}function p(){const b=h.current?.getBoundingClientRect();b&&u({top:b.bottom+6,right:window.innerWidth-b.right}),a(_=>!_)}return k.useEffect(()=>{if(!s)return;function b(x){const y=x.target;h.current?.contains(y)||m.current?.contains(y)||f()}function _(x){x.key==="Escape"&&f()}return document.addEventListener("mousedown",b),document.addEventListener("keydown",_),window.addEventListener("scroll",f,!0),()=>{document.removeEventListener("mousedown",b),document.removeEventListener("keydown",_),window.removeEventListener("scroll",f,!0)}},[s]),c.jsxs(c.Fragment,{children:[c.jsx("button",{"aria-label":t,className:de("flex h-7 min-w-7 shrink-0 items-center justify-center gap-1 rounded-md px-1.5 text-muted-foreground opacity-0 transition-all duration-150 hover:bg-muted hover:text-foreground group-hover:opacity-100",s&&"bg-muted text-foreground opacity-100"),onClick:p,ref:h,title:t,type:"button",children:i}),s?su.createPortal(c.jsx("div",{className:"fixed z-50 w-56 overflow-hidden rounded-md border border-border bg-card p-1 shadow-md",ref:m,style:{top:o.top,right:o.right},children:e(f)}),document.body):null]})}function zc({children:e,icon:t,onSelect:i}){return c.jsxs("button",{className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-xs text-foreground transition-colors hover:bg-muted",onClick:i,type:"button",children:[c.jsx("span",{className:"text-muted-foreground",children:t}),c.jsx("span",{className:"min-w-0 flex-1 truncate",children:e})]})}function JV({data:e}){const{insertPath:t}=Li(),[i,s]=k.useState("changes"),[a,o]=k.useState("changes"),[u,h]=k.useState(e.git.status?.files[0]?.path??""),[m,f]=k.useState(""),[p,b]=k.useState([]),[_,x]=k.useState(null),[y,S]=k.useState(""),[E,C]=k.useState(null),[A,N]=k.useState(0),[M,D]=k.useState(null),[U,L]=k.useState(()=>new Set),R=e.git.status?.files??[],$=k.useMemo(()=>{const ne=new Set(R.map(we=>we.path)),fe=[...U].filter(we=>!ne.has(we)).sort().map(we=>({path:we,index:" ",workingTree:"M"}));return[...R,...fe]},[R,U]),I=k.useMemo(()=>$.map(ne=>ne.path),[$]),F=k.useMemo(()=>aU(y),[y]);k.useEffect(()=>{const ne=$[0]?.path??"";h(fe=>fe&&$.some(we=>we.path===fe)?fe:ne)},[$]),k.useEffect(()=>{if(i!=="all"||p.length>0)return;let ne=!0;return x(null),e6().then(fe=>{ne&&b(fe)}).catch(fe=>{ne&&x(fe instanceof Error?fe.message:String(fe))}),()=>{ne=!1}},[i,p.length]),k.useEffect(()=>{if(!u){S("");return}let ne=!0;return C(null),s6(u).then(fe=>{ne&&(S(fe),N(0),D(null))}).catch(fe=>{ne&&C(fe instanceof Error?fe.message:String(fe))}),()=>{ne=!1}},[u]);function G(ne){N(0),D(null),h(ne)}function Y(){const ne=OV({activeHunkIndex:A,filePaths:I,hunkCount:F.hunks,pendingNextFilePath:M,selectedFile:u});ne.kind==="hunk"?(D(null),N(ne.activeHunkIndex)):ne.kind==="confirm-next-file"?D(ne.filePath):ne.kind==="file"?G(ne.filePath):D(null)}function Q(){if(D(null),A>0){N(we=>we-1);return}const ne=$.findIndex(we=>we.path===u),fe=$[ne-1];fe&&G(fe.path)}const q=$.findIndex(ne=>ne.path===u),O=!!(F.hunks&&A<F.hunks-1||$[q+1]),X=!!(A>0||$[q-1]),Z=M?`End of file. Click Next again to open ${M}.`:null,V=ne=>`rounded px-2 py-0.5 text-[11px] font-medium transition-colors ${ne?"bg-foreground text-background":"text-muted-foreground hover:text-foreground"}`,P=ne=>`flex-1 px-2 py-0.5 text-[11px] font-medium transition-colors ${ne?"bg-foreground text-background":"text-muted-foreground hover:text-foreground"}`,j=k.useMemo(()=>{const ne=new Set($.map(fe=>fe.path));for(const fe of U)ne.add(fe);return ne},[$,U]);if(!e.git.selectedRepository)return c.jsx(eq,{});function W(){m&&(s("changes"),o("changes"),G(m))}function he(ne){L(fe=>new Set(fe).add(ne)),f(ne),s("changes"),o("changes"),G(ne)}function oe(ne){f(ne),s("all")}function me(ne){ne&&t(ru(e.git.cwd,ne))}return c.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-card/85",children:[c.jsxs("div",{className:"flex shrink-0 items-center gap-1 border-b border-border bg-card/95 px-3 py-1",children:[c.jsx("button",{type:"button",className:V(i==="changes"),onClick:()=>s("changes"),children:"Changes"}),c.jsx("button",{type:"button","aria-label":"Open all tracked files",className:V(i==="all"),onClick:()=>s("all"),children:"All files"}),c.jsx("button",{type:"button",className:V(i==="graph"),onClick:()=>s("graph"),children:"Tree"}),c.jsx("button",{type:"button",className:V(i==="largest"),onClick:()=>s("largest"),children:"Largest files"})]}),c.jsx("div",{className:"min-h-0 flex-1",children:i==="graph"?c.jsx(FV,{branches:e.git.branches??[]}):i==="largest"?c.jsx(XV,{onOpenFile:oe,root:e.git.cwd}):i==="all"?c.jsxs("div",{className:"grid h-full min-h-0 overflow-hidden border-0 bg-card/85 xl:grid-cols-[320px_minmax(0,1fr)]",children:[c.jsx("aside",{className:"flex min-h-0 flex-col overflow-hidden",children:_?c.jsx(dt,{variant:"destructive",className:"m-3",children:_}):c.jsx(t2,{branch:e.git.status?.branch||void 0,onSelectFile:f,paths:p,root:e.git.cwd,selectedFile:m,status:$})}),c.jsx(DV,{isModified:j.has(m),onFileSaved:he,onSendToAi:()=>me(m),onViewDiff:W,path:m})]}):c.jsxs("div",{className:"grid h-full min-h-0 overflow-hidden border-0 bg-card/85 xl:grid-cols-[320px_minmax(0,1fr)]",children:[c.jsxs("aside",{className:"flex min-h-0 flex-col overflow-hidden",children:[c.jsxs("div",{className:"flex shrink-0 gap-0.5 border-b border-border bg-card/95 p-1",children:[c.jsx("button",{"aria-label":"Show changed files as a list",className:P(a==="changes"),onClick:()=>o("changes"),type:"button",children:"Changes"}),c.jsx("button",{"aria-label":"Show changed files as a tree",className:P(a==="tree"),onClick:()=>o("tree"),type:"button",children:"Tree"})]}),a==="changes"?c.jsx(uU,{branch:e.git.status?.branch||void 0,error:e.git.error,files:$,selectedFile:u,onSelectFile:G,root:e.git.cwd}):c.jsx(t2,{branch:e.git.status?.branch||void 0,defaultExpandAll:!0,emptyMessage:e.git.error??"No changed files.",onSelectFile:G,paths:I,root:e.git.cwd,selectedFile:u,status:$,title:"Changes"})]}),c.jsxs("section",{className:"flex min-h-0 min-w-0 flex-col border-l border-border bg-card",children:[c.jsxs("div",{className:"flex shrink-0 items-center justify-between gap-3 border-b border-border px-3 py-1.5",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("h2",{className:"truncate text-[13px] font-semibold tracking-tight",children:u||"Diff"}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[10px] text-muted-foreground",children:[c.jsx("span",{children:"Long rows wrap inside the editor pane."}),F.additions||F.deletions?c.jsxs("span",{className:"flex items-center gap-1 font-mono",children:[c.jsxs("span",{className:"text-emerald-700",children:["+",F.additions]}),c.jsxs("span",{className:"text-red-700",children:["-",F.deletions]})]}):null]})]}),c.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[Z?c.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:Z}):null,c.jsxs(ue,{disabled:!u||!X,onClick:Q,size:"sm",type:"button",variant:"outline",children:[c.jsx(mk,{}),"Previous"]}),c.jsxs(ue,{disabled:!u||!O,onClick:Y,size:"sm",type:"button",variant:"outline",children:[c.jsx(pA,{}),"Next"]}),c.jsx(ue,{"aria-label":"Send selected file to AI input",className:"size-8",disabled:!u,onClick:()=>me(u),size:"icon",title:"Send selected file path to AI input",type:"button",variant:"outline",children:c.jsx(cs,{className:"size-4"})})]})]}),c.jsx("div",{className:"relative min-h-0 min-w-0 flex-1",children:E?c.jsx("div",{className:"p-4",children:c.jsx(dt,{variant:"destructive",children:E})}):u?c.jsx(JN,{activeHunkIndex:A,diff:y||"No unstaged diff for this file."}):c.jsx("div",{className:"p-4",children:c.jsx(dt,{variant:"muted",className:"border-dashed p-12 text-center",children:"Select a changed file to inspect its diff."})})})]})]})})]})}function eq(){return c.jsx("div",{className:"flex h-full items-center justify-center p-8 text-center",children:c.jsxs("div",{className:"max-w-sm",children:[c.jsx(r4,{className:"mx-auto size-8 text-muted-foreground/50"}),c.jsx("p",{className:"mt-3 text-sm font-medium",children:"No Git project registered"}),c.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Add a folder that is a Git worktree to review changes, browse files, and inspect history. Use the project picker in the header to add one."})]})})}function tq({initialPath:e,onSelect:t,selectedPath:i}){const[s,a]=k.useState(e),[o,u]=k.useState(null),[h,m]=k.useState(null),[f,p]=k.useState(!1),b=iq(o);return k.useEffect(()=>{a(e)},[e]),k.useEffect(()=>{let _=!0;return p(!0),m(null),zk(s).then(x=>{_&&(u(x),t(x.path))}).catch(x=>{_&&m(x instanceof Error?x.message:String(x))}).finally(()=>{_&&p(!1)}),()=>{_=!1}},[s,t]),c.jsxs("div",{className:"rounded-md border border-border bg-background",children:[c.jsxs("div",{className:"flex items-center gap-2 border-b border-border p-2",children:[b?c.jsx(ue,{"aria-label":"Open parent folder",onClick:()=>o&&a(o.parent),size:"icon",type:"button",variant:"ghost",children:c.jsx(Yn,{className:"rotate-90"})}):null,c.jsx("div",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:o?.path??s}),f?c.jsx(Oi,{className:"size-4 animate-spin text-muted-foreground"}):null]}),c.jsxs("div",{className:"max-h-56 overflow-auto p-1",children:[h?c.jsx(dt,{variant:"destructive",className:"m-1",children:h}):null,!h&&o?.entries.length===0?c.jsx(dt,{variant:"muted",className:"m-1 text-center",children:"No folders here."}):null,o?.entries.map(_=>c.jsxs(ue,{className:de("h-8 w-full justify-start rounded-sm px-2 text-left",i===_.path&&"bg-muted"),onClick:()=>a(_.path),title:_.path,type:"button",variant:"ghost",children:[c.jsx(Ga,{className:"text-accent"}),c.jsx("span",{className:"truncate",children:_.name})]},_.path))]})]})}function iq(e){return!!(e&&e.parent!==e.path)}function lk(e){return e.split(/[\\/]/).filter(Boolean).pop()??"project"}function nq({data:e,onRefresh:t}){const[i,s]=k.useState(!1),[a,o]=k.useState(e.git.cwd),[u,h]=k.useState(null),[m,f]=k.useState(!1),[p,b]=k.useState(e.git.cwd),_=k.useRef(null),x=e.git.selectedRepository,y=x?.name??(e.git.cwd?lk(e.git.cwd):"Add Git project"),{error:S,success:E}=Bi(),C=rq({gitCwd:e.git.cwd});k.useEffect(()=>{o(e.git.cwd),b(e.git.cwd)},[e.git.cwd]),k.useEffect(()=>{if(!i)return;function L(R){_.current&&R.target instanceof Node&&!_.current.contains(R.target)&&s(!1)}return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[i]);async function A(L){try{await pn("/api/git/select",{name:L}),s(!1),await t(),E(`Switched to ${L}.`)}catch(R){S(R instanceof Error?R.message:String(R))}}async function N(L){const R=L.trim();if(!sq(R)){const $="Please add an absolute path. Paths beginning with ~ are not expanded here.";return h($),S($),!1}try{const $=lk(R);return await pn("/api/git/repositories",{name:$,path:R}),h(null),await t(),E(`Added Git project ${$}.`),!0}catch($){const I=$ instanceof Error?$.message:String($);return h(I),S(I),!1}}async function M(L){try{await r6(L),await t(),E(`Removed Git project ${L}.`)}catch(R){S(R instanceof Error?R.message:String(R))}}async function D(L){L.preventDefault(),await N(a)&&s(!1)}function U(){h(null),b(C.selectedPath),f(!0)}return c.jsxs("div",{className:"relative z-50 flex items-center gap-2",ref:_,children:[c.jsxs(ue,{className:"max-w-[220px] justify-start gap-2 rounded-md border-border bg-card",onClick:()=>s(L=>!L),size:"sm",type:"button",variant:"outline",children:[c.jsx(Ga,{className:"text-muted-foreground"}),c.jsx("span",{className:"truncate",children:y}),c.jsx(Yn,{className:de("ml-auto transition-transform",i&&"rotate-180")})]}),c.jsx(ue,{"aria-label":"Add Git project",onClick:U,size:"sm",type:"button",variant:"outline",children:c.jsx(mn,{})}),i?c.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:[c.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-3 py-2",children:[c.jsx(qA,{className:"size-3.5 text-muted-foreground"}),c.jsx("div",{className:"text-xs font-semibold",children:"Git Projects"}),c.jsx(Pe,{className:"ml-auto h-5 px-1.5 text-[10px]",variant:"outline",children:e.config.gitRepositories.length})]}),c.jsx("div",{className:"max-h-72 overflow-auto",children:e.config.gitRepositories.length?c.jsx("div",{className:"divide-y divide-border",children:e.config.gitRepositories.map(L=>{const R=L.name===x?.name;return c.jsxs("div",{className:de("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",R&&"bg-muted/70"),children:[c.jsxs("button",{className:"min-w-0 text-left",onClick:()=>{A(L.name)},type:"button",children:[c.jsx("span",{className:"block truncate text-sm font-medium leading-tight",children:L.name}),c.jsx("span",{className:"block truncate font-mono text-[10px] leading-tight text-muted-foreground",children:L.path})]}),R?c.jsx(sl,{className:"size-3.5"}):c.jsx("span",{className:"size-3.5"}),c.jsx(ue,{"aria-label":`Remove ${L.name}`,className:"size-6 opacity-0 transition-opacity group-hover:opacity-100",onClick:()=>{M(L.name)},size:"icon",title:`Remove ${L.name}`,type:"button",variant:"ghost",children:c.jsx(rl,{className:"size-3.5 text-destructive"})})]},L.name)})}):c.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:"No saved Git projects yet."})}),c.jsxs("div",{className:"border-t border-border bg-muted/20 p-2",children:[c.jsxs("form",{className:"flex gap-1.5",onSubmit:D,children:[c.jsx(et,{"aria-label":"Paste absolute path",className:"h-7 flex-1 px-2 font-mono text-[11px]",onChange:L=>{o(L.target.value),h(null)},placeholder:"/absolute/path",value:a}),c.jsxs(ue,{className:"h-7 px-2 text-[11px]",size:"sm",type:"submit",children:[c.jsx(mn,{className:"size-3"}),"Add"]}),c.jsx(ue,{"aria-label":"Browse and add Git project",className:"h-7 px-2",onClick:U,size:"sm",type:"button",variant:"outline",children:c.jsx(l4,{className:"size-3"})})]}),u?c.jsx("div",{className:"mt-1.5 truncate text-[10px] text-destructive",children:u}):null]})]}):null,m?c.jsx(aq,{confirmLabel:C.confirmLabel,errorMessage:u,initialPath:C.initialPath,selectedPath:p,title:"Add Git Project",onCancel:()=>f(!1),onSelect:b,onUse:async()=>{await N(p)&&(f(!1),s(!1))}}):null]})}function sq(e){return e.startsWith("/")}function rq({gitCwd:e}){return{confirmLabel:"Add Git project",initialPath:e,selectedPath:e}}function aq({confirmLabel:e="Use this folder",errorMessage:t,initialPath:i,onCancel:s,onSelect:a,onUse:o,selectedPath:u,title:h="Choose Git Project Folder"}){return su.createPortal(c.jsx("div",{className:"fixed inset-0 z-[1000] grid place-items-center bg-black/35 px-4",children:c.jsxs("div",{className:"w-full max-w-2xl rounded-xl border border-border bg-card p-4 shadow-xl",children:[c.jsxs("div",{className:"mb-3 flex items-center gap-3",children:[c.jsx("div",{className:"flex size-8 items-center justify-center rounded-lg border border-border bg-background",children:c.jsx(Ga,{className:"size-4"})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("div",{className:"text-sm font-semibold",children:h}),c.jsx("div",{className:"truncate font-mono text-xs text-muted-foreground",children:u})]}),c.jsx(ue,{"aria-label":"Close folder picker",onClick:s,size:"icon",variant:"ghost",children:c.jsx(Ji,{})})]}),c.jsx(tq,{initialPath:i,onSelect:a,selectedPath:u}),t?c.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,c.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[c.jsx(ue,{onClick:s,type:"button",variant:"outline",children:"Cancel"}),c.jsx(ue,{onClick:()=>{o()},type:"button",children:e})]})]})}),document.body)}function oq({branches:e,currentBranch:t,disabled:i,onRefresh:s}){const[a,o]=k.useState(!1),[u,h]=k.useState(""),[m,f]=k.useState(null),[p,b]=k.useState(null),[_,x]=k.useState(null),y=e.filter(M=>!M.remote),S=e.filter(M=>M.remote);async function E(M,D){f(M),x(null),b(null);try{await D(),await s()}catch(U){x(U instanceof Error?U.message:String(U))}finally{f(null)}}async function C(M){await E(`switch:${M}`,async()=>{await pn("/api/git/branches/switch",{name:M}),o(!1)})}async function A(){await E("fetch",async()=>{await pn("/api/git/fetch",{}),b("Fetched latest branch refs.")})}async function N(M){M.preventDefault();const D=u.trim();if(!D){x("Branch name is required.");return}await E("create",async()=>{await pn("/api/git/branches",{name:D}),h(""),o(!1)})}return c.jsxs("div",{className:"fixed bottom-12 right-4 z-50 flex items-end",children:[a?c.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:[c.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-border p-3",children:[c.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[c.jsx(Wn,{className:"size-4 text-muted-foreground"}),c.jsx("span",{className:"truncate text-sm font-semibold",children:t||"Branches"})]}),c.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[c.jsx(ue,{"aria-label":"Fetch branches",disabled:i||m!==null,onClick:()=>{A()},size:"icon",title:"Fetch branches",type:"button",variant:"ghost",children:c.jsx(Hh,{className:de(m==="fetch"&&"animate-spin")})}),c.jsx(ue,{"aria-label":"Close branch dialog",onClick:()=>o(!1),size:"icon",type:"button",variant:"ghost",children:c.jsx(Ji,{})})]})]}),c.jsx("div",{className:"max-h-72 overflow-auto",children:e.length?c.jsxs(c.Fragment,{children:[c.jsx(ck,{branches:y,busy:m!==null,disabled:i,label:"Local",onSwitch:C}),c.jsx(ck,{branches:S,busy:m!==null,disabled:i,label:"Remote",onSwitch:C})]}):c.jsx("div",{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"No branches found."})}),c.jsxs("div",{className:"border-t border-border p-3",children:[c.jsxs("form",{className:"grid gap-2 sm:grid-cols-[1fr_auto]",onSubmit:N,children:[c.jsx(et,{"aria-label":"New branch name",disabled:i||m!==null,onChange:M=>{h(M.target.value),x(null),b(null)},placeholder:"feature/new-work",value:u}),c.jsxs(ue,{disabled:i||m!==null,type:"submit",children:[c.jsx(p4,{}),"Create"]})]}),_||p?c.jsx(dt,{className:"mt-3 px-3 py-2 text-xs",variant:_?"destructive":"muted",children:_??p}):null]})]}):null,c.jsxs(ue,{className:"h-8 max-w-[260px] gap-2 rounded-md shadow-lg",disabled:i,onClick:()=>o(M=>!M),size:"sm",title:"Switch Git branch",type:"button",variant:"default",children:[c.jsx(Wn,{className:"size-4"}),c.jsx("span",{className:"truncate font-mono text-xs",children:t||"No branch"}),c.jsx(Yn,{className:de("size-4 transition-transform",a&&"rotate-180")})]})]})}function ck({branches:e,busy:t,disabled:i,label:s,onSwitch:a}){return c.jsxs("section",{children:[c.jsx("div",{className:"border-b border-border bg-muted/60 px-3 py-1.5 text-[11px] font-semibold uppercase text-muted-foreground",children:s}),e.length?e.map(o=>c.jsxs("button",{className:de("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",o.current&&"bg-muted/70"),disabled:i||t||o.current,onClick:()=>{a(o.name)},type:"button",children:[c.jsxs("span",{className:"min-w-0",children:[c.jsx("span",{className:"block truncate font-medium",children:o.name}),o.upstream?c.jsxs("span",{className:"block truncate font-mono text-[11px] text-muted-foreground",children:["tracks ",o.upstream]}):null]}),c.jsx(Pe,{variant:o.current?"success":o.remote?"outline":"secondary",children:o.current?"current":o.remote?"remote":"local"})]},`${o.remote?"remote":"local"}:${o.name}`)):c.jsxs("div",{className:"border-b border-border px-3 py-3 text-sm text-muted-foreground",children:["No ",s.toLowerCase()," branches."]})]})}const Y3="nomoreide-theme-choice";function lq(){if(typeof window>"u")return"dark";const e=window.localStorage.getItem(Y3);return e==="light"||e==="dark"?e:"dark"}function cq(e){const t=document.documentElement;t.classList.toggle("dark",e==="dark"),t.style.colorScheme=e}function uq(){const[e,t]=k.useState(()=>lq()),i=k.useRef(null);k.useEffect(()=>{cq(e),window.localStorage.setItem(Y3,e)},[e]);const s=k.useCallback(()=>{const a=e==="dark"?"light":"dark",o=i.current,u=document;if(!o||!u.startViewTransition||window.matchMedia("(prefers-reduced-motion: reduce)").matches){t(a);return}const h=o.getBoundingClientRect(),m=h.left+h.width/2,f=h.top+h.height/2,p=Math.hypot(Math.max(m,window.innerWidth-m),Math.max(f,window.innerHeight-f));u.startViewTransition(()=>{t(a)}).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${m}px ${f}px)`,`circle(${p}px at ${m}px ${f}px)`]},{duration:500,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})},[e]);return c.jsxs("button",{ref:i,onClick:s,title:e==="dark"?"Switch to light mode":"Switch to dark mode","aria-label":"Toggle theme",className:vh(),children:[c.jsx("span",{className:_h(),children:e==="dark"?c.jsx(SM,{}):c.jsx(z4,{})}),c.jsx("span",{className:xh(),children:"Theme"})]})}function dq(e=!1){return de("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 hq(e,t=!1){return de("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 fq(e=!1,t=!1){return de("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 mq(e=!1){return de("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 pq({docked:e,onToggleDock:t}){return c.jsxs("div",{className:de("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:[c.jsxs("span",{className:de("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:[c.jsx("span",{children:"Made with"}),c.jsx(b4,{"aria-label":"love",className:"size-3 shrink-0 fill-red-500 text-red-500"}),c.jsx("span",{children:"by Robert Wang"}),c.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:c.jsx("svg",{"aria-hidden":!0,className:"size-3 fill-current",role:"img",viewBox:"0 0 24 24",children:c.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"})})})]}),c.jsx("button",{"aria-label":e?"Undock sidebar":"Dock sidebar","aria-pressed":e,className:de("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?c.jsx(F4,{}):c.jsx(q4,{})})]})}function gq({className:e}){return c.jsxs("div",{className:de("min-w-0",e),children:[c.jsxs("div",{className:"flex items-baseline gap-1.5",children:[c.jsx("div",{className:"text-sm font-semibold",children:"NoMoreIDE"}),c.jsxs("div",{className:"font-mono text-[10px] text-muted-foreground",children:["v","0.1.44"]})]}),c.jsx("div",{className:"font-mono text-[11px] text-muted-foreground",children:"127.0.0.1 console"})]})}function bq({syncLocation:e=!0}={}){const[t,i]=k.useState(()=>e?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":"services"),[s,a]=k.useState(null),[o,u]=k.useState(null),[h,m]=k.useState(null),[f,p]=k.useState(!0),{error:b,success:_}=Bi(),[x,y]=k.useState(()=>window.localStorage.getItem("nomoreide:sidebar-docked")==="true"),S=k.useCallback(async(C={})=>{C.silent||p(!0),m(null);try{a(await h6()),C.notify&&_("Dashboard refreshed.")}catch(A){const N=A instanceof Error?A.message:String(A);m(N),b(N)}finally{p(!1)}},[b,_]);k.useEffect(()=>{S()},[S]),k.useEffect(()=>{function C(){document.visibilityState==="visible"&&S({silent:!0})}const A=window.setInterval(C,5e3);return window.addEventListener("focus",C),document.addEventListener("visibilitychange",C),()=>{window.clearInterval(A),window.removeEventListener("focus",C),document.removeEventListener("visibilitychange",C)}},[t,S]),k.useEffect(()=>{if(!e)return;const C=t==="git"?"/git":t==="agent"?"/agent":t==="errors"?"/errors":t==="database"?"/database":t==="terminal"?"/terminal":"/";window.location.pathname!==C&&window.history.pushState(null,"",C)},[t,e]),k.useEffect(()=>{window.localStorage.setItem("nomoreide:sidebar-docked",String(x))},[x]);const E=k.useMemo(()=>s?Object.values(s.runtime.services).filter(C=>C.state==="running").length:0,[s]);return c.jsx(xL,{children:c.jsxs("div",{className:"h-screen overflow-hidden pb-9",children:[c.jsxs("div",{className:"mx-auto flex h-full max-w-[1500px]",children:[c.jsxs("aside",{className:dq(x),children:[c.jsxs("div",{className:de("grid h-12 grid-cols-[48px_minmax(0,1fr)] items-center overflow-hidden transition-[width] duration-150",x?"w-full":"w-12 group-hover/sidebar:w-full"),children:[c.jsx("div",{className:"flex size-12 items-center justify-center",children:c.jsx("div",{className:"flex size-9 items-center justify-center overflow-hidden rounded-md bg-primary text-primary-foreground",children:c.jsxs("svg",{"aria-label":"NoMoreIDE",className:"size-6",fill:"none",role:"img",viewBox:"0 0 64 64",xmlns:"http://www.w3.org/2000/svg",children:[c.jsx("path",{d:"M5 17C5 13.69 7.69 11 11 11H25L31 17H53C56.31 17 59 19.69 59 23V53C59 56.31 56.31 59 53 59H11C7.69 59 5 56.31 5 53V17Z",fill:"currentColor"}),c.jsx("path",{d:"M22 31L30 39L22 47",stroke:"hsl(var(--primary))",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"4.5"}),c.jsx("path",{d:"M36 47H48",stroke:"hsl(var(--primary))",strokeLinecap:"round",strokeWidth:"4.5"})]})})}),c.jsx(gq,{className:de("min-w-0 translate-x-1 overflow-hidden transition-opacity duration-200",x?"opacity-100":"opacity-0 group-hover/sidebar:opacity-100")})]}),c.jsxs("nav",{className:"mt-5 grid flex-1 content-start gap-1",children:[c.jsx(Fo,{active:t==="services",badge:E,docked:x,icon:c.jsx(Rk,{}),label:"Services",onClick:()=>i("services")}),c.jsx(Fo,{active:t==="git",docked:x,icon:c.jsx(Wn,{}),label:"Git Review",onClick:()=>i("git")}),c.jsx(Fo,{active:t==="errors",docked:x,icon:c.jsx(oh,{}),label:"Error Inbox",onClick:()=>i("errors")}),c.jsx(Fo,{active:t==="database",docked:x,icon:c.jsx(us,{}),label:"Database",onClick:()=>i("database")}),c.jsx(Fo,{active:t==="terminal",docked:x,icon:c.jsx(_M,{}),label:"Terminal",onClick:()=>i("terminal")}),c.jsx(Fo,{active:t==="agent",docked:x,icon:c.jsx(wA,{}),label:"Agent",onClick:()=>i("agent")})]}),c.jsx(pq,{docked:x,onToggleDock:()=>y(C=>!C)})]}),c.jsxs("main",{className:"flex h-full min-w-0 flex-1 flex-col px-0 py-0",children:[c.jsxs("header",{className:de("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:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(G4,{className:"size-4 text-muted-foreground md:hidden"}),c.jsxs("div",{children:[c.jsx("h1",{className:"text-lg font-semibold tracking-tight",children:t==="git"?"Git Review":t==="agent"?"Agent":t==="errors"?"Error Inbox":t==="database"?"Database":t==="terminal"?"Terminal":"Services"}),c.jsx("p",{className:"font-mono text-xs text-muted-foreground",children:s?.git.selectedRepository?.name??s?.git.cwd??"Local workspace"})]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[h?c.jsx(Pe,{variant:"danger",children:h}):null,s&&t==="git"?c.jsx(nq,{data:s,onRefresh:S}):null,c.jsxs("div",{"aria-label":"Dashboard quick actions",className:"flex items-center gap-1 rounded-lg border border-border bg-background p-1",role:"group",children:[c.jsxs("button",{"aria-label":"Refresh dashboard",className:vh(),onClick:()=>{S({notify:!0})},title:"Refresh dashboard",type:"button",children:[c.jsx("span",{className:_h(),children:c.jsx(Hh,{className:de(f&&"animate-spin")})}),c.jsx("span",{className:xh(),children:"Refresh"})]}),c.jsx(uq,{}),c.jsxs("a",{"aria-label":"Open NoMoreIDE documentation",className:vh(),href:"https://www.nomoreide.com/docs",rel:"noreferrer",target:"_blank",title:"Open NoMoreIDE documentation",children:[c.jsx("span",{className:_h(),children:c.jsx(yA,{})}),c.jsx("span",{className:xh(),children:"Docs"})]}),s?c.jsx(K7,{data:s}):null]})]})]}),s?c.jsx(Q$,{data:s,onOpenService:C=>{u(C),i("services"),S({silent:!0})}}):null,f&&!s?c.jsx(dt,{variant:"muted",children:"Loading NoMoreIDE state..."}):null,c.jsxs("div",{className:"min-h-0 flex-1 overflow-hidden",children:[s&&t==="services"?c.jsx(Y$,{data:s,onRefresh:S,focusService:o,onServiceFocused:()=>u(null)}):null,s&&t==="git"?c.jsx(JV,{data:s}):null,t==="agent"?c.jsx(S7,{}):null,t==="errors"?c.jsx(RB,{}):null,t==="database"?c.jsx(CB,{}):null,t==="terminal"?c.jsx(sU,{}):null]})]})]}),s&&t==="git"?c.jsx(oq,{branches:s.git.branches,currentBranch:s.git.status?.branch||void 0,disabled:!s.git.status,onRefresh:S}):null,c.jsx(aB,{onOpenAgentPage:t==="agent"?void 0:()=>i("agent"),onOpenService:C=>{u(C),i("services"),S({silent:!0})}})]})})}function Fo({active:e,badge:t,docked:i,icon:s,label:a,onClick:o}){const u=t!==void 0&&t>0;return c.jsxs(ue,{"aria-label":a,title:a,className:hq(e,i),variant:"ghost",onClick:o,type:"button",children:[c.jsx("span",{className:mq(i),children:s}),c.jsx("span",{className:fq(i,u),children:a}),t!==void 0&&t>0?c.jsx(Pe,{appearance:t>0?"solid":"outline",className:de("min-w-6 justify-center px-1.5 font-mono shadow-none",e?"border-primary-foreground/40 bg-primary-foreground/15 text-primary-foreground dark:border-primary-foreground/40 dark:bg-primary-foreground/15 dark: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",i&&"right-2 top-1/2 -translate-y-1/2 text-xs"),size:"small",variant:t>0?"success":"outline",children:t}):null]})}dk.createRoot(document.getElementById("root")).render(c.jsx(k.StrictMode,{children:c.jsx(bq,{})}));export{c as j,k as r};
|