clitrigger 0.2.67 → 0.2.69
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/client/assets/{AnalyticsPanel-DQ9grCp0.js → AnalyticsPanel-Dr9Zypd4.js} +1 -1
- package/dist/client/assets/{CalendarGrid-Fk99r9nq.js → CalendarGrid-BRVf7WJK.js} +1 -1
- package/dist/client/assets/{DiscussionDetail-HcG3ohsQ.js → DiscussionDetail-DetjETsr.js} +4 -4
- package/dist/client/assets/{DiscussionForm-BZfnK2EV.js → DiscussionForm-Bi4L47Ly.js} +1 -1
- package/dist/client/assets/{EmptyState-GADfcNs7.js → EmptyState--9RqKIk6.js} +1 -1
- package/dist/client/assets/{FloatingComposerController-5A3GJtK4-CTCqYxNF.js → FloatingComposerController-5A3GJtK4-85zrcVy6.js} +1 -1
- package/dist/client/assets/{LogViewer-Di7SxByZ.js → LogViewer-BDuckIDB.js} +1 -1
- package/dist/client/assets/{MarkdownContent-WshMOH5P.js → MarkdownContent-CwGbW814.js} +1 -1
- package/dist/client/assets/{PersonalAgenda-DrfVGibs.js → PersonalAgenda-JNpWPEDQ.js} +3 -3
- package/dist/client/assets/{PlannerPageEditor-B2m5SwtT.js → PlannerPageEditor-9_jJ-l98.js} +3 -3
- package/dist/client/assets/ProjectDetail-DwN6S3uf.js +183 -0
- package/dist/client/assets/{ProjectList-D2tf2Kfp.js → ProjectList-LeZ7mrEM.js} +1 -1
- package/dist/client/assets/{ReviewQueue-UrhgwrGk.js → ReviewQueue-DzTHqZdO.js} +1 -1
- package/dist/client/assets/{TaskGraph-Bp62pL5V.js → TaskGraph-BrHxqYJn.js} +1 -1
- package/dist/client/assets/{VaultLayout-ClyLfQdP.js → VaultLayout-DftlF-Gd.js} +1 -1
- package/dist/client/assets/{folder-git-2-CntWBh-U.js → folder-git-2-DocDG5LN.js} +1 -1
- package/dist/client/assets/index--CryAcdA.js +427 -0
- package/dist/client/assets/index-xIZH9sMw.css +32 -0
- package/dist/client/assets/{rotate-ccw-DRnyCt5y.js → rotate-ccw-CY6Wl56G.js} +1 -1
- package/dist/client/assets/{style-DcT-60Dn.js → style-D7Mv0Jex.js} +1 -1
- package/dist/client/assets/{with-selector-QmxTx8WM.js → with-selector-bSOP5zTp.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/services/cli-adapters.js +1 -1
- package/dist/server/services/cli-adapters.js.map +1 -1
- package/dist/server/services/cli-status.d.ts.map +1 -1
- package/dist/server/services/cli-status.js +12 -1
- package/dist/server/services/cli-status.js.map +1 -1
- package/package.json +1 -1
- package/dist/client/assets/ProjectDetail-B96iIeaz.js +0 -183
- package/dist/client/assets/index-DB7C6wx1.js +0 -427
- package/dist/client/assets/index-gug7OXWO.css +0 -32
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ProjectList-LeZ7mrEM.js","assets/EmptyState--9RqKIk6.js","assets/ProjectDetail-DwN6S3uf.js","assets/CalendarGrid-BRVf7WJK.js","assets/LogViewer-BDuckIDB.js","assets/MarkdownContent-CwGbW814.js","assets/DiscussionForm-Bi4L47Ly.js","assets/rotate-ccw-CY6Wl56G.js","assets/DiscussionDetail-DetjETsr.js","assets/ReviewQueue-DzTHqZdO.js","assets/folder-git-2-DocDG5LN.js","assets/PersonalAgenda-JNpWPEDQ.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var Hb=Object.defineProperty;var Pb=(s,h,w)=>h in s?Hb(s,h,{enumerable:!0,configurable:!0,writable:!0,value:w}):s[h]=w;var jm=(s,h,w)=>Pb(s,typeof h!="symbol"?h+"":h,w);function Ib(s,h){for(var w=0;w<h.length;w++){const S=h[w];if(typeof S!="string"&&!Array.isArray(S)){for(const M in S)if(M!=="default"&&!(M in s)){const O=Object.getOwnPropertyDescriptor(S,M);O&&Object.defineProperty(s,M,O.get?O:{enumerable:!0,get:()=>S[M]})}}}return Object.freeze(Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}))}(function(){const h=document.createElement("link").relList;if(h&&h.supports&&h.supports("modulepreload"))return;for(const M of document.querySelectorAll('link[rel="modulepreload"]'))S(M);new MutationObserver(M=>{for(const O of M)if(O.type==="childList")for(const A of O.addedNodes)A.tagName==="LINK"&&A.rel==="modulepreload"&&S(A)}).observe(document,{childList:!0,subtree:!0});function w(M){const O={};return M.integrity&&(O.integrity=M.integrity),M.referrerPolicy&&(O.referrerPolicy=M.referrerPolicy),M.crossOrigin==="use-credentials"?O.credentials="include":M.crossOrigin==="anonymous"?O.credentials="omit":O.credentials="same-origin",O}function S(M){if(M.ep)return;M.ep=!0;const O=w(M);fetch(M.href,O)}})();var X2=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yh(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var zu={exports:{}},go={};/**
|
|
3
|
+
* @license React
|
|
4
|
+
* react-jsx-runtime.production.js
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/var Om;function Fb(){if(Om)return go;Om=1;var s=Symbol.for("react.transitional.element"),h=Symbol.for("react.fragment");function w(S,M,O){var A=null;if(O!==void 0&&(A=""+O),M.key!==void 0&&(A=""+M.key),"key"in M){O={};for(var r in M)r!=="key"&&(O[r]=M[r])}else O=M;return M=O.ref,{$$typeof:s,type:S,key:A,ref:M!==void 0?M:null,props:O}}return go.Fragment=h,go.jsx=w,go.jsxs=w,go}var Bm;function Ub(){return Bm||(Bm=1,zu.exports=Fb()),zu.exports}var v=Ub(),Hu={exports:{}},dt={};/**
|
|
11
|
+
* @license React
|
|
12
|
+
* react.production.js
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the MIT license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/var Nm;function $b(){if(Nm)return dt;Nm=1;var s=Symbol.for("react.transitional.element"),h=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),A=Symbol.for("react.context"),r=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),l=Symbol.for("react.activity"),m=Symbol.iterator;function b(B){return B===null||typeof B!="object"?null:(B=m&&B[m]||B["@@iterator"],typeof B=="function"?B:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},p=Object.assign,o={};function c(B,W,Z){this.props=B,this.context=W,this.refs=o,this.updater=Z||C}c.prototype.isReactComponent={},c.prototype.setState=function(B,W){if(typeof B!="object"&&typeof B!="function"&&B!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,B,W,"setState")},c.prototype.forceUpdate=function(B){this.updater.enqueueForceUpdate(this,B,"forceUpdate")};function a(){}a.prototype=c.prototype;function f(B,W,Z){this.props=B,this.context=W,this.refs=o,this.updater=Z||C}var y=f.prototype=new a;y.constructor=f,p(y,c.prototype),y.isPureReactComponent=!0;var R=Array.isArray;function k(){}var D={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function L(B,W,Z){var ne=Z.ref;return{$$typeof:s,type:B,key:W,ref:ne!==void 0?ne:null,props:Z}}function z(B,W){return L(B.type,W,B.props)}function H(B){return typeof B=="object"&&B!==null&&B.$$typeof===s}function P(B){var W={"=":"=0",":":"=2"};return"$"+B.replace(/[=:]/g,function(Z){return W[Z]})}var I=/\/+/g;function K(B,W){return typeof B=="object"&&B!==null&&B.key!=null?P(""+B.key):W.toString(36)}function X(B){switch(B.status){case"fulfilled":return B.value;case"rejected":throw B.reason;default:switch(typeof B.status=="string"?B.then(k,k):(B.status="pending",B.then(function(W){B.status==="pending"&&(B.status="fulfilled",B.value=W)},function(W){B.status==="pending"&&(B.status="rejected",B.reason=W)})),B.status){case"fulfilled":return B.value;case"rejected":throw B.reason}}throw B}function Y(B,W,Z,ne,ge){var xe=typeof B;(xe==="undefined"||xe==="boolean")&&(B=null);var J=!1;if(B===null)J=!0;else switch(xe){case"bigint":case"string":case"number":J=!0;break;case"object":switch(B.$$typeof){case s:case h:J=!0;break;case g:return J=B._init,Y(J(B._payload),W,Z,ne,ge)}}if(J)return ge=ge(B),J=ne===""?"."+K(B,0):ne,R(ge)?(Z="",J!=null&&(Z=J.replace(I,"$&/")+"/"),Y(ge,W,Z,"",function(oe){return oe})):ge!=null&&(H(ge)&&(ge=z(ge,Z+(ge.key==null||B&&B.key===ge.key?"":(""+ge.key).replace(I,"$&/")+"/")+J)),W.push(ge)),1;J=0;var G=ne===""?".":ne+":";if(R(B))for(var de=0;de<B.length;de++)ne=B[de],xe=G+K(ne,de),J+=Y(ne,W,Z,xe,ge);else if(de=b(B),typeof de=="function")for(B=de.call(B),de=0;!(ne=B.next()).done;)ne=ne.value,xe=G+K(ne,de++),J+=Y(ne,W,Z,xe,ge);else if(xe==="object"){if(typeof B.then=="function")return Y(X(B),W,Z,ne,ge);throw W=String(B),Error("Objects are not valid as a React child (found: "+(W==="[object Object]"?"object with keys {"+Object.keys(B).join(", ")+"}":W)+"). If you meant to render a collection of children, use an array instead.")}return J}function $(B,W,Z){if(B==null)return B;var ne=[],ge=0;return Y(B,ne,"","",function(xe){return W.call(Z,xe,ge++)}),ne}function U(B){if(B._status===-1){var W=B._result;W=W(),W.then(function(Z){(B._status===0||B._status===-1)&&(B._status=1,B._result=Z)},function(Z){(B._status===0||B._status===-1)&&(B._status=2,B._result=Z)}),B._status===-1&&(B._status=0,B._result=W)}if(B._status===1)return B._result.default;throw B._result}var T=typeof reportError=="function"?reportError:function(B){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var W=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof B=="object"&&B!==null&&typeof B.message=="string"?String(B.message):String(B),error:B});if(!window.dispatchEvent(W))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",B);return}console.error(B)},F={map:$,forEach:function(B,W,Z){$(B,function(){W.apply(this,arguments)},Z)},count:function(B){var W=0;return $(B,function(){W++}),W},toArray:function(B){return $(B,function(W){return W})||[]},only:function(B){if(!H(B))throw Error("React.Children.only expected to receive a single React element child.");return B}};return dt.Activity=l,dt.Children=F,dt.Component=c,dt.Fragment=w,dt.Profiler=M,dt.PureComponent=f,dt.StrictMode=S,dt.Suspense=u,dt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,dt.__COMPILER_RUNTIME={__proto__:null,c:function(B){return D.H.useMemoCache(B)}},dt.cache=function(B){return function(){return B.apply(null,arguments)}},dt.cacheSignal=function(){return null},dt.cloneElement=function(B,W,Z){if(B==null)throw Error("The argument must be a React element, but you passed "+B+".");var ne=p({},B.props),ge=B.key;if(W!=null)for(xe in W.key!==void 0&&(ge=""+W.key),W)!E.call(W,xe)||xe==="key"||xe==="__self"||xe==="__source"||xe==="ref"&&W.ref===void 0||(ne[xe]=W[xe]);var xe=arguments.length-2;if(xe===1)ne.children=Z;else if(1<xe){for(var J=Array(xe),G=0;G<xe;G++)J[G]=arguments[G+2];ne.children=J}return L(B.type,ge,ne)},dt.createContext=function(B){return B={$$typeof:A,_currentValue:B,_currentValue2:B,_threadCount:0,Provider:null,Consumer:null},B.Provider=B,B.Consumer={$$typeof:O,_context:B},B},dt.createElement=function(B,W,Z){var ne,ge={},xe=null;if(W!=null)for(ne in W.key!==void 0&&(xe=""+W.key),W)E.call(W,ne)&&ne!=="key"&&ne!=="__self"&&ne!=="__source"&&(ge[ne]=W[ne]);var J=arguments.length-2;if(J===1)ge.children=Z;else if(1<J){for(var G=Array(J),de=0;de<J;de++)G[de]=arguments[de+2];ge.children=G}if(B&&B.defaultProps)for(ne in J=B.defaultProps,J)ge[ne]===void 0&&(ge[ne]=J[ne]);return L(B,xe,ge)},dt.createRef=function(){return{current:null}},dt.forwardRef=function(B){return{$$typeof:r,render:B}},dt.isValidElement=H,dt.lazy=function(B){return{$$typeof:g,_payload:{_status:-1,_result:B},_init:U}},dt.memo=function(B,W){return{$$typeof:d,type:B,compare:W===void 0?null:W}},dt.startTransition=function(B){var W=D.T,Z={};D.T=Z;try{var ne=B(),ge=D.S;ge!==null&&ge(Z,ne),typeof ne=="object"&&ne!==null&&typeof ne.then=="function"&&ne.then(k,T)}catch(xe){T(xe)}finally{W!==null&&Z.types!==null&&(W.types=Z.types),D.T=W}},dt.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},dt.use=function(B){return D.H.use(B)},dt.useActionState=function(B,W,Z){return D.H.useActionState(B,W,Z)},dt.useCallback=function(B,W){return D.H.useCallback(B,W)},dt.useContext=function(B){return D.H.useContext(B)},dt.useDebugValue=function(){},dt.useDeferredValue=function(B,W){return D.H.useDeferredValue(B,W)},dt.useEffect=function(B,W){return D.H.useEffect(B,W)},dt.useEffectEvent=function(B){return D.H.useEffectEvent(B)},dt.useId=function(){return D.H.useId()},dt.useImperativeHandle=function(B,W,Z){return D.H.useImperativeHandle(B,W,Z)},dt.useInsertionEffect=function(B,W){return D.H.useInsertionEffect(B,W)},dt.useLayoutEffect=function(B,W){return D.H.useLayoutEffect(B,W)},dt.useMemo=function(B,W){return D.H.useMemo(B,W)},dt.useOptimistic=function(B,W){return D.H.useOptimistic(B,W)},dt.useReducer=function(B,W,Z){return D.H.useReducer(B,W,Z)},dt.useRef=function(B){return D.H.useRef(B)},dt.useState=function(B){return D.H.useState(B)},dt.useSyncExternalStore=function(B,W,Z){return D.H.useSyncExternalStore(B,W,Z)},dt.useTransition=function(){return D.H.useTransition()},dt.version="19.2.4",dt}var zm;function wh(){return zm||(zm=1,Hu.exports=$b()),Hu.exports}var j=wh();const tv=yh(j),V2=Ib({__proto__:null,default:tv},[j]);var Pu={exports:{}},vo={},Iu={exports:{}},Fu={};/**
|
|
19
|
+
* @license React
|
|
20
|
+
* scheduler.production.js
|
|
21
|
+
*
|
|
22
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the MIT license found in the
|
|
25
|
+
* LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/var Hm;function Wb(){return Hm||(Hm=1,(function(s){function h(Y,$){var U=Y.length;Y.push($);e:for(;0<U;){var T=U-1>>>1,F=Y[T];if(0<M(F,$))Y[T]=$,Y[U]=F,U=T;else break e}}function w(Y){return Y.length===0?null:Y[0]}function S(Y){if(Y.length===0)return null;var $=Y[0],U=Y.pop();if(U!==$){Y[0]=U;e:for(var T=0,F=Y.length,B=F>>>1;T<B;){var W=2*(T+1)-1,Z=Y[W],ne=W+1,ge=Y[ne];if(0>M(Z,U))ne<F&&0>M(ge,Z)?(Y[T]=ge,Y[ne]=U,T=ne):(Y[T]=Z,Y[W]=U,T=W);else if(ne<F&&0>M(ge,U))Y[T]=ge,Y[ne]=U,T=ne;else break e}}return $}function M(Y,$){var U=Y.sortIndex-$.sortIndex;return U!==0?U:Y.id-$.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var O=performance;s.unstable_now=function(){return O.now()}}else{var A=Date,r=A.now();s.unstable_now=function(){return A.now()-r}}var u=[],d=[],g=1,l=null,m=3,b=!1,C=!1,p=!1,o=!1,c=typeof setTimeout=="function"?setTimeout:null,a=typeof clearTimeout=="function"?clearTimeout:null,f=typeof setImmediate<"u"?setImmediate:null;function y(Y){for(var $=w(d);$!==null;){if($.callback===null)S(d);else if($.startTime<=Y)S(d),$.sortIndex=$.expirationTime,h(u,$);else break;$=w(d)}}function R(Y){if(p=!1,y(Y),!C)if(w(u)!==null)C=!0,k||(k=!0,P());else{var $=w(d);$!==null&&X(R,$.startTime-Y)}}var k=!1,D=-1,E=5,L=-1;function z(){return o?!0:!(s.unstable_now()-L<E)}function H(){if(o=!1,k){var Y=s.unstable_now();L=Y;var $=!0;try{e:{C=!1,p&&(p=!1,a(D),D=-1),b=!0;var U=m;try{t:{for(y(Y),l=w(u);l!==null&&!(l.expirationTime>Y&&z());){var T=l.callback;if(typeof T=="function"){l.callback=null,m=l.priorityLevel;var F=T(l.expirationTime<=Y);if(Y=s.unstable_now(),typeof F=="function"){l.callback=F,y(Y),$=!0;break t}l===w(u)&&S(u),y(Y)}else S(u);l=w(u)}if(l!==null)$=!0;else{var B=w(d);B!==null&&X(R,B.startTime-Y),$=!1}}break e}finally{l=null,m=U,b=!1}$=void 0}}finally{$?P():k=!1}}}var P;if(typeof f=="function")P=function(){f(H)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,K=I.port2;I.port1.onmessage=H,P=function(){K.postMessage(null)}}else P=function(){c(H,0)};function X(Y,$){D=c(function(){Y(s.unstable_now())},$)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(Y){Y.callback=null},s.unstable_forceFrameRate=function(Y){0>Y||125<Y?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<Y?Math.floor(1e3/Y):5},s.unstable_getCurrentPriorityLevel=function(){return m},s.unstable_next=function(Y){switch(m){case 1:case 2:case 3:var $=3;break;default:$=m}var U=m;m=$;try{return Y()}finally{m=U}},s.unstable_requestPaint=function(){o=!0},s.unstable_runWithPriority=function(Y,$){switch(Y){case 1:case 2:case 3:case 4:case 5:break;default:Y=3}var U=m;m=Y;try{return $()}finally{m=U}},s.unstable_scheduleCallback=function(Y,$,U){var T=s.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?T+U:T):U=T,Y){case 1:var F=-1;break;case 2:F=250;break;case 5:F=1073741823;break;case 4:F=1e4;break;default:F=5e3}return F=U+F,Y={id:g++,callback:$,priorityLevel:Y,startTime:U,expirationTime:F,sortIndex:-1},U>T?(Y.sortIndex=U,h(d,Y),w(u)===null&&Y===w(d)&&(p?(a(D),D=-1):p=!0,X(R,U-T))):(Y.sortIndex=F,h(u,Y),C||b||(C=!0,k||(k=!0,P()))),Y},s.unstable_shouldYield=z,s.unstable_wrapCallback=function(Y){var $=m;return function(){var U=m;m=$;try{return Y.apply(this,arguments)}finally{m=U}}}})(Fu)),Fu}var Pm;function qb(){return Pm||(Pm=1,Iu.exports=Wb()),Iu.exports}var Uu={exports:{}},gi={};/**
|
|
27
|
+
* @license React
|
|
28
|
+
* react-dom.production.js
|
|
29
|
+
*
|
|
30
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
31
|
+
*
|
|
32
|
+
* This source code is licensed under the MIT license found in the
|
|
33
|
+
* LICENSE file in the root directory of this source tree.
|
|
34
|
+
*/var Im;function Gb(){if(Im)return gi;Im=1;var s=wh();function h(u){var d="https://react.dev/errors/"+u;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)d+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+u+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function w(){}var S={d:{f:w,r:function(){throw Error(h(522))},D:w,C:w,L:w,m:w,X:w,S:w,M:w},p:0,findDOMNode:null},M=Symbol.for("react.portal");function O(u,d,g){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:M,key:l==null?null:""+l,children:u,containerInfo:d,implementation:g}}var A=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function r(u,d){if(u==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return gi.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=S,gi.createPortal=function(u,d){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(h(299));return O(u,d,null,g)},gi.flushSync=function(u){var d=A.T,g=S.p;try{if(A.T=null,S.p=2,u)return u()}finally{A.T=d,S.p=g,S.d.f()}},gi.preconnect=function(u,d){typeof u=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,S.d.C(u,d))},gi.prefetchDNS=function(u){typeof u=="string"&&S.d.D(u)},gi.preinit=function(u,d){if(typeof u=="string"&&d&&typeof d.as=="string"){var g=d.as,l=r(g,d.crossOrigin),m=typeof d.integrity=="string"?d.integrity:void 0,b=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;g==="style"?S.d.S(u,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:l,integrity:m,fetchPriority:b}):g==="script"&&S.d.X(u,{crossOrigin:l,integrity:m,fetchPriority:b,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},gi.preinitModule=function(u,d){if(typeof u=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var g=r(d.as,d.crossOrigin);S.d.M(u,{crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&S.d.M(u)},gi.preload=function(u,d){if(typeof u=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var g=d.as,l=r(g,d.crossOrigin);S.d.L(u,g,{crossOrigin:l,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},gi.preloadModule=function(u,d){if(typeof u=="string")if(d){var g=r(d.as,d.crossOrigin);S.d.m(u,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else S.d.m(u)},gi.requestFormReset=function(u){S.d.r(u)},gi.unstable_batchedUpdates=function(u,d){return u(d)},gi.useFormState=function(u,d,g){return A.H.useFormState(u,d,g)},gi.useFormStatus=function(){return A.H.useHostTransitionStatus()},gi.version="19.2.4",gi}var Fm;function iv(){if(Fm)return Uu.exports;Fm=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(h){console.error(h)}}return s(),Uu.exports=Gb(),Uu.exports}/**
|
|
35
|
+
* @license React
|
|
36
|
+
* react-dom-client.production.js
|
|
37
|
+
*
|
|
38
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
39
|
+
*
|
|
40
|
+
* This source code is licensed under the MIT license found in the
|
|
41
|
+
* LICENSE file in the root directory of this source tree.
|
|
42
|
+
*/var Um;function Yb(){if(Um)return vo;Um=1;var s=qb(),h=wh(),w=iv();function S(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function M(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function O(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function A(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function r(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(O(e)!==e)throw Error(S(188))}function d(e){var t=e.alternate;if(!t){if(t=O(e),t===null)throw Error(S(188));return t!==e?null:e}for(var i=e,n=t;;){var _=i.return;if(_===null)break;var x=_.alternate;if(x===null){if(n=_.return,n!==null){i=n;continue}break}if(_.child===x.child){for(x=_.child;x;){if(x===i)return u(_),e;if(x===n)return u(_),t;x=x.sibling}throw Error(S(188))}if(i.return!==n.return)i=_,n=x;else{for(var N=!1,q=_.child;q;){if(q===i){N=!0,i=_,n=x;break}if(q===n){N=!0,n=_,i=x;break}q=q.sibling}if(!N){for(q=x.child;q;){if(q===i){N=!0,i=x,n=_;break}if(q===n){N=!0,n=x,i=_;break}q=q.sibling}if(!N)throw Error(S(189))}}if(i.alternate!==n)throw Error(S(190))}if(i.tag!==3)throw Error(S(188));return i.stateNode.current===i?e:t}function g(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=g(e),t!==null)return t;e=e.sibling}return null}var l=Object.assign,m=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),f=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),z=Symbol.for("react.memo_cache_sentinel"),H=Symbol.iterator;function P(e){return e===null||typeof e!="object"?null:(e=H&&e[H]||e["@@iterator"],typeof e=="function"?e:null)}var I=Symbol.for("react.client.reference");function K(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===I?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case p:return"Fragment";case c:return"Profiler";case o:return"StrictMode";case R:return"Suspense";case k:return"SuspenseList";case L:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case C:return"Portal";case f:return e.displayName||"Context";case a:return(e._context.displayName||"Context")+".Consumer";case y:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case D:return t=e.displayName||null,t!==null?t:K(e.type)||"Memo";case E:t=e._payload,e=e._init;try{return K(e(t))}catch{}}return null}var X=Array.isArray,Y=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=w.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U={pending:!1,data:null,method:null,action:null},T=[],F=-1;function B(e){return{current:e}}function W(e){0>F||(e.current=T[F],T[F]=null,F--)}function Z(e,t){F++,T[F]=e.current,e.current=t}var ne=B(null),ge=B(null),xe=B(null),J=B(null);function G(e,t){switch(Z(xe,t),Z(ge,e),Z(ne,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?im(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=im(t),e=sm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}W(ne),Z(ne,e)}function de(){W(ne),W(ge),W(xe)}function oe(e){e.memoizedState!==null&&Z(J,e);var t=ne.current,i=sm(t,e.type);t!==i&&(Z(ge,e),Z(ne,i))}function Ae(e){ge.current===e&&(W(ne),W(ge)),J.current===e&&(W(J),ho._currentValue=U)}var Oe,Xe;function We(e){if(Oe===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);Oe=t&&t[1]||"",Xe=-1<i.stack.indexOf(`
|
|
43
|
+
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
44
|
+
`+Oe+e+Xe}var rt=!1;function ye(e,t){if(!e||rt)return"";rt=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var De=function(){throw Error()};if(Object.defineProperty(De.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(De,[])}catch(we){var ve=we}Reflect.construct(e,[],De)}else{try{De.call()}catch(we){ve=we}e.call(De.prototype)}}else{try{throw Error()}catch(we){ve=we}(De=e())&&typeof De.catch=="function"&&De.catch(function(){})}}catch(we){if(we&&ve&&typeof we.stack=="string")return[we.stack,ve.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var _=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");_&&_.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=n.DetermineComponentFrameRoot(),N=x[0],q=x[1];if(N&&q){var te=N.split(`
|
|
45
|
+
`),me=q.split(`
|
|
46
|
+
`);for(_=n=0;n<te.length&&!te[n].includes("DetermineComponentFrameRoot");)n++;for(;_<me.length&&!me[_].includes("DetermineComponentFrameRoot");)_++;if(n===te.length||_===me.length)for(n=te.length-1,_=me.length-1;1<=n&&0<=_&&te[n]!==me[_];)_--;for(;1<=n&&0<=_;n--,_--)if(te[n]!==me[_]){if(n!==1||_!==1)do if(n--,_--,0>_||te[n]!==me[_]){var Le=`
|
|
47
|
+
`+te[n].replace(" at new "," at ");return e.displayName&&Le.includes("<anonymous>")&&(Le=Le.replace("<anonymous>",e.displayName)),Le}while(1<=n&&0<=_);break}}}finally{rt=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?We(i):""}function Te(e,t){switch(e.tag){case 26:case 27:case 5:return We(e.type);case 16:return We("Lazy");case 13:return e.child!==t&&t!==null?We("Suspense Fallback"):We("Suspense");case 19:return We("SuspenseList");case 0:case 15:return ye(e.type,!1);case 11:return ye(e.type.render,!1);case 1:return ye(e.type,!0);case 31:return We("Activity");default:return""}}function ct(e){try{var t="",i=null;do t+=Te(e,i),i=e,e=e.return;while(e);return t}catch(n){return`
|
|
48
|
+
Error generating stack: `+n.message+`
|
|
49
|
+
`+n.stack}}var it=Object.prototype.hasOwnProperty,ze=s.unstable_scheduleCallback,qe=s.unstable_cancelCallback,Fe=s.unstable_shouldYield,Be=s.unstable_requestPaint,$e=s.unstable_now,lt=s.unstable_getCurrentPriorityLevel,st=s.unstable_ImmediatePriority,St=s.unstable_UserBlockingPriority,Se=s.unstable_NormalPriority,Ie=s.unstable_LowPriority,le=s.unstable_IdlePriority,Ne=s.log,je=s.unstable_setDisableYieldValue,ue=null,ee=null;function be(e){if(typeof Ne=="function"&&je(e),ee&&typeof ee.setStrictMode=="function")try{ee.setStrictMode(ue,e)}catch{}}var he=Math.clz32?Math.clz32:Ge,He=Math.log,Me=Math.LN2;function Ge(e){return e>>>=0,e===0?32:31-(He(e)/Me|0)|0}var se=256,V=262144,ie=4194304;function Q(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ke(e,t,i){var n=e.pendingLanes;if(n===0)return 0;var _=0,x=e.suspendedLanes,N=e.pingedLanes;e=e.warmLanes;var q=n&134217727;return q!==0?(n=q&~x,n!==0?_=Q(n):(N&=q,N!==0?_=Q(N):i||(i=q&~e,i!==0&&(_=Q(i))))):(q=n&~x,q!==0?_=Q(q):N!==0?_=Q(N):i||(i=n&~e,i!==0&&(_=Q(i)))),_===0?0:t!==0&&t!==_&&(t&x)===0&&(x=_&-_,i=t&-t,x>=i||x===32&&(i&4194048)!==0)?t:_}function ce(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function _e(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 Ee(){var e=ie;return ie<<=1,(ie&62914560)===0&&(ie=4194304),e}function Pe(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function Ue(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ot(e,t,i,n,_,x){var N=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var q=e.entanglements,te=e.expirationTimes,me=e.hiddenUpdates;for(i=N&~i;0<i;){var Le=31-he(i),De=1<<Le;q[Le]=0,te[Le]=-1;var ve=me[Le];if(ve!==null)for(me[Le]=null,Le=0;Le<ve.length;Le++){var we=ve[Le];we!==null&&(we.lane&=-536870913)}i&=~De}n!==0&&Ye(e,n,0),x!==0&&_===0&&e.tag!==0&&(e.suspendedLanes|=x&~(N&~t))}function Ye(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-he(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|i&261930}function ut(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var n=31-he(i),_=1<<n;_&t|e[n]&t&&(e[n]|=t),i&=~_}}function ft(e,t){var i=t&-t;return i=(i&42)!==0?1:kt(i),(i&(e.suspendedLanes|t))!==0?0:i}function kt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function vt(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Vt(){var e=$.p;return e!==0?e:(e=window.event,e===void 0?32:Em(e.type))}function Nt(e,t){var i=$.p;try{return $.p=e,t()}finally{$.p=i}}var Ze=Math.random().toString(36).slice(2),fe="__reactFiber$"+Ze,Ve="__reactProps$"+Ze,ht="__reactContainer$"+Ze,At="__reactEvents$"+Ze,Jt="__reactListeners$"+Ze,jt="__reactHandles$"+Ze,ei="__reactResources$"+Ze,$t="__reactMarker$"+Ze;function li(e){delete e[fe],delete e[Ve],delete e[At],delete e[Jt],delete e[jt]}function mi(e){var t=e[fe];if(t)return t;for(var i=e.parentNode;i;){if(t=i[ht]||i[fe]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=um(e);e!==null;){if(i=e[fe])return i;e=um(e)}return t}e=i,i=e.parentNode}return null}function _i(e){if(e=e[fe]||e[ht]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ns(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(S(33))}function ci(e){var t=e[ei];return t||(t=e[ei]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Lt(e){e[$t]=!0}var Er=new Set,Lr={};function rs(e,t){bi(e,t),bi(e+"Capture",t)}function bi(e,t){for(Lr[e]=t,e=0;e<t.length;e++)Er.add(t[e])}var D_=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]*$"),qh={},Gh={};function T_(e){return it.call(Gh,e)?!0:it.call(qh,e)?!1:D_.test(e)?Gh[e]=!0:(qh[e]=!0,!1)}function Po(e,t,i){if(T_(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var n=t.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+i)}}function Io(e,t,i){if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+i)}}function ds(e,t,i,n){if(n===null)e.removeAttribute(i);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,""+n)}}function Hi(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Yh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function M_(e,t,i){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var _=n.get,x=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return _.call(this)},set:function(N){i=""+N,x.call(this,N)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(N){i=""+N},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Tl(e){if(!e._valueTracker){var t=Yh(e)?"checked":"value";e._valueTracker=M_(e,t,""+e[t])}}function Kh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),n="";return e&&(n=Yh(e)?e.checked?"true":"false":e.value),e=n,e!==i?(t.setValue(e),!0):!1}function Fo(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var A_=/[\n"\\]/g;function Pi(e){return e.replace(A_,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ml(e,t,i,n,_,x,N,q){e.name="",N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?e.type=N:e.removeAttribute("type"),t!=null?N==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Hi(t)):e.value!==""+Hi(t)&&(e.value=""+Hi(t)):N!=="submit"&&N!=="reset"||e.removeAttribute("value"),t!=null?Al(e,N,Hi(t)):i!=null?Al(e,N,Hi(i)):n!=null&&e.removeAttribute("value"),_==null&&x!=null&&(e.defaultChecked=!!x),_!=null&&(e.checked=_&&typeof _!="function"&&typeof _!="symbol"),q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"?e.name=""+Hi(q):e.removeAttribute("name")}function Xh(e,t,i,n,_,x,N,q){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.type=x),t!=null||i!=null){if(!(x!=="submit"&&x!=="reset"||t!=null)){Tl(e);return}i=i!=null?""+Hi(i):"",t=t!=null?""+Hi(t):i,q||t===e.value||(e.value=t),e.defaultValue=t}n=n??_,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=q?e.checked:!!n,e.defaultChecked=!!n,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(e.name=N),Tl(e)}function Al(e,t,i){t==="number"&&Fo(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function jn(e,t,i,n){if(e=e.options,t){t={};for(var _=0;_<i.length;_++)t["$"+i[_]]=!0;for(i=0;i<e.length;i++)_=t.hasOwnProperty("$"+e[i].value),e[i].selected!==_&&(e[i].selected=_),_&&n&&(e[i].defaultSelected=!0)}else{for(i=""+Hi(i),t=null,_=0;_<e.length;_++){if(e[_].value===i){e[_].selected=!0,n&&(e[_].defaultSelected=!0);return}t!==null||e[_].disabled||(t=e[_])}t!==null&&(t.selected=!0)}}function Vh(e,t,i){if(t!=null&&(t=""+Hi(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+Hi(i):""}function Jh(e,t,i,n){if(t==null){if(n!=null){if(i!=null)throw Error(S(92));if(X(n)){if(1<n.length)throw Error(S(93));n=n[0]}i=n}i==null&&(i=""),t=i}i=Hi(t),e.defaultValue=i,n=e.textContent,n===i&&n!==""&&n!==null&&(e.value=n),Tl(e)}function On(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var j_=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 Qh(e,t,i){var n=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,i):typeof i!="number"||i===0||j_.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function Zh(e,t,i){if(t!=null&&typeof t!="object")throw Error(S(62));if(e=e.style,i!=null){for(var n in i)!i.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var _ in t)n=t[_],t.hasOwnProperty(_)&&i[_]!==n&&Qh(e,_,n)}else for(var x in t)t.hasOwnProperty(x)&&Qh(e,x,t[x])}function jl(e){if(e.indexOf("-")===-1)return!1;switch(e){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 O_=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"]]),B_=/^[\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 Uo(e){return B_.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function fs(){}var Ol=null;function Bl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Bn=null,Nn=null;function ed(e){var t=_i(e);if(t&&(e=t.stateNode)){var i=e[Ve]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ml(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+Pi(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var n=i[t];if(n!==e&&n.form===e.form){var _=n[Ve]||null;if(!_)throw Error(S(90));Ml(n,_.value,_.defaultValue,_.defaultValue,_.checked,_.defaultChecked,_.type,_.name)}}for(t=0;t<i.length;t++)n=i[t],n.form===e.form&&Kh(n)}break e;case"textarea":Vh(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&jn(e,!!i.multiple,t,!1)}}}var Nl=!1;function td(e,t,i){if(Nl)return e(t,i);Nl=!0;try{var n=e(t);return n}finally{if(Nl=!1,(Bn!==null||Nn!==null)&&(Da(),Bn&&(t=Bn,e=Nn,Nn=Bn=null,ed(t),e)))for(t=0;t<e.length;t++)ed(e[t])}}function Rr(e,t){var i=e.stateNode;if(i===null)return null;var n=i[Ve]||null;if(n===null)return null;i=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(S(231,t,typeof i));return i}var ps=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),zl=!1;if(ps)try{var Dr={};Object.defineProperty(Dr,"passive",{get:function(){zl=!0}}),window.addEventListener("test",Dr,Dr),window.removeEventListener("test",Dr,Dr)}catch{zl=!1}var js=null,Hl=null,$o=null;function id(){if($o)return $o;var e,t=Hl,i=t.length,n,_="value"in js?js.value:js.textContent,x=_.length;for(e=0;e<i&&t[e]===_[e];e++);var N=i-e;for(n=1;n<=N&&t[i-n]===_[x-n];n++);return $o=_.slice(e,1<n?1-n:void 0)}function Wo(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function qo(){return!0}function sd(){return!1}function yi(e){function t(i,n,_,x,N){this._reactName=i,this._targetInst=_,this.type=n,this.nativeEvent=x,this.target=N,this.currentTarget=null;for(var q in e)e.hasOwnProperty(q)&&(i=e[q],this[q]=i?i(x):x[q]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?qo:sd,this.isPropagationStopped=sd,this}return l(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=qo)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=qo)},persist:function(){},isPersistent:qo}),t}var hn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Go=yi(hn),Tr=l({},hn,{view:0,detail:0}),N_=yi(Tr),Pl,Il,Mr,Yo=l({},Tr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ul,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Mr&&(Mr&&e.type==="mousemove"?(Pl=e.screenX-Mr.screenX,Il=e.screenY-Mr.screenY):Il=Pl=0,Mr=e),Pl)},movementY:function(e){return"movementY"in e?e.movementY:Il}}),nd=yi(Yo),z_=l({},Yo,{dataTransfer:0}),H_=yi(z_),P_=l({},Tr,{relatedTarget:0}),Fl=yi(P_),I_=l({},hn,{animationName:0,elapsedTime:0,pseudoElement:0}),F_=yi(I_),U_=l({},hn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),$_=yi(U_),W_=l({},hn,{data:0}),rd=yi(W_),q_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},G_={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"},Y_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function K_(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Y_[e])?!!t[e]:!1}function Ul(){return K_}var X_=l({},Tr,{key:function(e){if(e.key){var t=q_[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Wo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?G_[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ul,charCode:function(e){return e.type==="keypress"?Wo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Wo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),V_=yi(X_),J_=l({},Yo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),od=yi(J_),Q_=l({},Tr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ul}),Z_=yi(Q_),e0=l({},hn,{propertyName:0,elapsedTime:0,pseudoElement:0}),t0=yi(e0),i0=l({},Yo,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),s0=yi(i0),n0=l({},hn,{newState:0,oldState:0}),r0=yi(n0),o0=[9,13,27,32],$l=ps&&"CompositionEvent"in window,Ar=null;ps&&"documentMode"in document&&(Ar=document.documentMode);var a0=ps&&"TextEvent"in window&&!Ar,ad=ps&&(!$l||Ar&&8<Ar&&11>=Ar),ld=" ",cd=!1;function ud(e,t){switch(e){case"keyup":return o0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var zn=!1;function l0(e,t){switch(e){case"compositionend":return hd(t);case"keypress":return t.which!==32?null:(cd=!0,ld);case"textInput":return e=t.data,e===ld&&cd?null:e;default:return null}}function c0(e,t){if(zn)return e==="compositionend"||!$l&&ud(e,t)?(e=id(),$o=Hl=js=null,zn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return ad&&t.locale!=="ko"?null:t.data;default:return null}}var u0={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 dd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!u0[e.type]:t==="textarea"}function fd(e,t,i,n){Bn?Nn?Nn.push(n):Nn=[n]:Bn=n,t=Na(t,"onChange"),0<t.length&&(i=new Go("onChange","change",null,i,n),e.push({event:i,listeners:t}))}var jr=null,Or=null;function h0(e){Vp(e,0)}function Ko(e){var t=ns(e);if(Kh(t))return e}function pd(e,t){if(e==="change")return t}var md=!1;if(ps){var Wl;if(ps){var ql="oninput"in document;if(!ql){var gd=document.createElement("div");gd.setAttribute("oninput","return;"),ql=typeof gd.oninput=="function"}Wl=ql}else Wl=!1;md=Wl&&(!document.documentMode||9<document.documentMode)}function vd(){jr&&(jr.detachEvent("onpropertychange",_d),Or=jr=null)}function _d(e){if(e.propertyName==="value"&&Ko(Or)){var t=[];fd(t,Or,e,Bl(e)),td(h0,t)}}function d0(e,t,i){e==="focusin"?(vd(),jr=t,Or=i,jr.attachEvent("onpropertychange",_d)):e==="focusout"&&vd()}function f0(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ko(Or)}function p0(e,t){if(e==="click")return Ko(t)}function m0(e,t){if(e==="input"||e==="change")return Ko(t)}function g0(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ti=typeof Object.is=="function"?Object.is:g0;function Br(e,t){if(Ti(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),n=Object.keys(t);if(i.length!==n.length)return!1;for(n=0;n<i.length;n++){var _=i[n];if(!it.call(t,_)||!Ti(e[_],t[_]))return!1}return!0}function bd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function yd(e,t){var i=bd(e);e=0;for(var n;i;){if(i.nodeType===3){if(n=e+i.textContent.length,e<=t&&n>=t)return{node:i,offset:t-e};e=n}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=bd(i)}}function wd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?wd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Sd(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Fo(e.document);t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=Fo(e.document)}return t}function Gl(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var v0=ps&&"documentMode"in document&&11>=document.documentMode,Hn=null,Yl=null,Nr=null,Kl=!1;function xd(e,t,i){var n=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Kl||Hn==null||Hn!==Fo(n)||(n=Hn,"selectionStart"in n&&Gl(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Nr&&Br(Nr,n)||(Nr=n,n=Na(Yl,"onSelect"),0<n.length&&(t=new Go("onSelect","select",null,t,i),e.push({event:t,listeners:n}),t.target=Hn)))}function dn(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Pn={animationend:dn("Animation","AnimationEnd"),animationiteration:dn("Animation","AnimationIteration"),animationstart:dn("Animation","AnimationStart"),transitionrun:dn("Transition","TransitionRun"),transitionstart:dn("Transition","TransitionStart"),transitioncancel:dn("Transition","TransitionCancel"),transitionend:dn("Transition","TransitionEnd")},Xl={},Cd={};ps&&(Cd=document.createElement("div").style,"AnimationEvent"in window||(delete Pn.animationend.animation,delete Pn.animationiteration.animation,delete Pn.animationstart.animation),"TransitionEvent"in window||delete Pn.transitionend.transition);function fn(e){if(Xl[e])return Xl[e];if(!Pn[e])return e;var t=Pn[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in Cd)return Xl[e]=t[i];return e}var kd=fn("animationend"),Ed=fn("animationiteration"),Ld=fn("animationstart"),_0=fn("transitionrun"),b0=fn("transitionstart"),y0=fn("transitioncancel"),Rd=fn("transitionend"),Dd=new Map,Vl="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(" ");Vl.push("scrollEnd");function Vi(e,t){Dd.set(e,t),rs(t,[e])}var Xo=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Ii=[],In=0,Jl=0;function Vo(){for(var e=In,t=Jl=In=0;t<e;){var i=Ii[t];Ii[t++]=null;var n=Ii[t];Ii[t++]=null;var _=Ii[t];Ii[t++]=null;var x=Ii[t];if(Ii[t++]=null,n!==null&&_!==null){var N=n.pending;N===null?_.next=_:(_.next=N.next,N.next=_),n.pending=_}x!==0&&Td(i,_,x)}}function Jo(e,t,i,n){Ii[In++]=e,Ii[In++]=t,Ii[In++]=i,Ii[In++]=n,Jl|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function Ql(e,t,i,n){return Jo(e,t,i,n),Qo(e)}function pn(e,t){return Jo(e,null,null,t),Qo(e)}function Td(e,t,i){e.lanes|=i;var n=e.alternate;n!==null&&(n.lanes|=i);for(var _=!1,x=e.return;x!==null;)x.childLanes|=i,n=x.alternate,n!==null&&(n.childLanes|=i),x.tag===22&&(e=x.stateNode,e===null||e._visibility&1||(_=!0)),e=x,x=x.return;return e.tag===3?(x=e.stateNode,_&&t!==null&&(_=31-he(i),e=x.hiddenUpdates,n=e[_],n===null?e[_]=[t]:n.push(t),t.lane=i|536870912),x):null}function Qo(e){if(50<no)throw no=0,au=null,Error(S(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Fn={};function w0(e,t,i,n){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Mi(e,t,i,n){return new w0(e,t,i,n)}function Zl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ms(e,t){var i=e.alternate;return i===null?(i=Mi(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&65011712,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function Md(e,t){e.flags&=65011714;var i=e.alternate;return i===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,t=i.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Zo(e,t,i,n,_,x){var N=0;if(n=e,typeof e=="function")Zl(e)&&(N=1);else if(typeof e=="string")N=Eb(e,i,ne.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case L:return e=Mi(31,i,t,_),e.elementType=L,e.lanes=x,e;case p:return mn(i.children,_,x,t);case o:N=8,_|=24;break;case c:return e=Mi(12,i,t,_|2),e.elementType=c,e.lanes=x,e;case R:return e=Mi(13,i,t,_),e.elementType=R,e.lanes=x,e;case k:return e=Mi(19,i,t,_),e.elementType=k,e.lanes=x,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case f:N=10;break e;case a:N=9;break e;case y:N=11;break e;case D:N=14;break e;case E:N=16,n=null;break e}N=29,i=Error(S(130,e===null?"null":typeof e,"")),n=null}return t=Mi(N,i,t,_),t.elementType=e,t.type=n,t.lanes=x,t}function mn(e,t,i,n){return e=Mi(7,e,n,t),e.lanes=i,e}function ec(e,t,i){return e=Mi(6,e,null,t),e.lanes=i,e}function Ad(e){var t=Mi(18,null,null,0);return t.stateNode=e,t}function tc(e,t,i){return t=Mi(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var jd=new WeakMap;function Fi(e,t){if(typeof e=="object"&&e!==null){var i=jd.get(e);return i!==void 0?i:(t={value:e,source:t,stack:ct(t)},jd.set(e,t),t)}return{value:e,source:t,stack:ct(t)}}var Un=[],$n=0,ea=null,zr=0,Ui=[],$i=0,Os=null,os=1,as="";function gs(e,t){Un[$n++]=zr,Un[$n++]=ea,ea=e,zr=t}function Od(e,t,i){Ui[$i++]=os,Ui[$i++]=as,Ui[$i++]=Os,Os=e;var n=os;e=as;var _=32-he(n)-1;n&=~(1<<_),i+=1;var x=32-he(t)+_;if(30<x){var N=_-_%5;x=(n&(1<<N)-1).toString(32),n>>=N,_-=N,os=1<<32-he(t)+_|i<<_|n,as=x+e}else os=1<<x|i<<_|n,as=e}function ic(e){e.return!==null&&(gs(e,1),Od(e,1,0))}function sc(e){for(;e===ea;)ea=Un[--$n],Un[$n]=null,zr=Un[--$n],Un[$n]=null;for(;e===Os;)Os=Ui[--$i],Ui[$i]=null,as=Ui[--$i],Ui[$i]=null,os=Ui[--$i],Ui[$i]=null}function Bd(e,t){Ui[$i++]=os,Ui[$i++]=as,Ui[$i++]=Os,os=t.id,as=t.overflow,Os=e}var ui=null,Wt=null,Et=!1,Bs=null,Wi=!1,nc=Error(S(519));function Ns(e){var t=Error(S(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Hr(Fi(t,e)),nc}function Nd(e){var t=e.stateNode,i=e.type,n=e.memoizedProps;switch(t[fe]=e,t[Ve]=n,i){case"dialog":wt("cancel",t),wt("close",t);break;case"iframe":case"object":case"embed":wt("load",t);break;case"video":case"audio":for(i=0;i<oo.length;i++)wt(oo[i],t);break;case"source":wt("error",t);break;case"img":case"image":case"link":wt("error",t),wt("load",t);break;case"details":wt("toggle",t);break;case"input":wt("invalid",t),Xh(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":wt("invalid",t);break;case"textarea":wt("invalid",t),Jh(t,n.value,n.defaultValue,n.children)}i=n.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||n.suppressHydrationWarning===!0||em(t.textContent,i)?(n.popover!=null&&(wt("beforetoggle",t),wt("toggle",t)),n.onScroll!=null&&wt("scroll",t),n.onScrollEnd!=null&&wt("scrollend",t),n.onClick!=null&&(t.onclick=fs),t=!0):t=!1,t||Ns(e,!0)}function zd(e){for(ui=e.return;ui;)switch(ui.tag){case 5:case 31:case 13:Wi=!1;return;case 27:case 3:Wi=!0;return;default:ui=ui.return}}function Wn(e){if(e!==ui)return!1;if(!Et)return zd(e),Et=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||Su(e.type,e.memoizedProps)),i=!i),i&&Wt&&Ns(e),zd(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(S(317));Wt=cm(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(S(317));Wt=cm(e)}else t===27?(t=Wt,Vs(e.type)?(e=Lu,Lu=null,Wt=e):Wt=t):Wt=ui?Gi(e.stateNode.nextSibling):null;return!0}function gn(){Wt=ui=null,Et=!1}function rc(){var e=Bs;return e!==null&&(Ci===null?Ci=e:Ci.push.apply(Ci,e),Bs=null),e}function Hr(e){Bs===null?Bs=[e]:Bs.push(e)}var oc=B(null),vn=null,vs=null;function zs(e,t,i){Z(oc,t._currentValue),t._currentValue=i}function _s(e){e._currentValue=oc.current,W(oc)}function ac(e,t,i){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===i)break;e=e.return}}function lc(e,t,i,n){var _=e.child;for(_!==null&&(_.return=e);_!==null;){var x=_.dependencies;if(x!==null){var N=_.child;x=x.firstContext;e:for(;x!==null;){var q=x;x=_;for(var te=0;te<t.length;te++)if(q.context===t[te]){x.lanes|=i,q=x.alternate,q!==null&&(q.lanes|=i),ac(x.return,i,e),n||(N=null);break e}x=q.next}}else if(_.tag===18){if(N=_.return,N===null)throw Error(S(341));N.lanes|=i,x=N.alternate,x!==null&&(x.lanes|=i),ac(N,i,e),N=null}else N=_.child;if(N!==null)N.return=_;else for(N=_;N!==null;){if(N===e){N=null;break}if(_=N.sibling,_!==null){_.return=N.return,N=_;break}N=N.return}_=N}}function qn(e,t,i,n){e=null;for(var _=t,x=!1;_!==null;){if(!x){if((_.flags&524288)!==0)x=!0;else if((_.flags&262144)!==0)break}if(_.tag===10){var N=_.alternate;if(N===null)throw Error(S(387));if(N=N.memoizedProps,N!==null){var q=_.type;Ti(_.pendingProps.value,N.value)||(e!==null?e.push(q):e=[q])}}else if(_===J.current){if(N=_.alternate,N===null)throw Error(S(387));N.memoizedState.memoizedState!==_.memoizedState.memoizedState&&(e!==null?e.push(ho):e=[ho])}_=_.return}e!==null&&lc(t,e,i,n),t.flags|=262144}function ta(e){for(e=e.firstContext;e!==null;){if(!Ti(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function _n(e){vn=e,vs=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function hi(e){return Hd(vn,e)}function ia(e,t){return vn===null&&_n(e),Hd(e,t)}function Hd(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},vs===null){if(e===null)throw Error(S(308));vs=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else vs=vs.next=t;return i}var S0=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},x0=s.unstable_scheduleCallback,C0=s.unstable_NormalPriority,ti={$$typeof:f,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function cc(){return{controller:new S0,data:new Map,refCount:0}}function Pr(e){e.refCount--,e.refCount===0&&x0(C0,function(){e.controller.abort()})}var Ir=null,uc=0,Gn=0,Yn=null;function k0(e,t){if(Ir===null){var i=Ir=[];uc=0,Gn=fu(),Yn={status:"pending",value:void 0,then:function(n){i.push(n)}}}return uc++,t.then(Pd,Pd),t}function Pd(){if(--uc===0&&Ir!==null){Yn!==null&&(Yn.status="fulfilled");var e=Ir;Ir=null,Gn=0,Yn=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function E0(e,t){var i=[],n={status:"pending",value:null,reason:null,then:function(_){i.push(_)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var _=0;_<i.length;_++)(0,i[_])(t)},function(_){for(n.status="rejected",n.reason=_,_=0;_<i.length;_++)(0,i[_])(void 0)}),n}var Id=Y.S;Y.S=function(e,t){Cp=$e(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&k0(e,t),Id!==null&&Id(e,t)};var bn=B(null);function hc(){var e=bn.current;return e!==null?e:It.pooledCache}function sa(e,t){t===null?Z(bn,bn.current):Z(bn,t.pool)}function Fd(){var e=hc();return e===null?null:{parent:ti._currentValue,pool:e}}var Kn=Error(S(460)),dc=Error(S(474)),na=Error(S(542)),ra={then:function(){}};function Ud(e){return e=e.status,e==="fulfilled"||e==="rejected"}function $d(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(fs,fs),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,qd(e),e;default:if(typeof t.status=="string")t.then(fs,fs);else{if(e=It,e!==null&&100<e.shellSuspendCounter)throw Error(S(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var _=t;_.status="fulfilled",_.value=n}},function(n){if(t.status==="pending"){var _=t;_.status="rejected",_.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,qd(e),e}throw wn=t,Kn}}function yn(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(wn=i,Kn):i}}var wn=null;function Wd(){if(wn===null)throw Error(S(459));var e=wn;return wn=null,e}function qd(e){if(e===Kn||e===na)throw Error(S(483))}var Xn=null,Fr=0;function oa(e){var t=Fr;return Fr+=1,Xn===null&&(Xn=[]),$d(Xn,e,t)}function Ur(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function aa(e,t){throw t.$$typeof===m?Error(S(525)):(e=Object.prototype.toString.call(t),Error(S(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Gd(e){function t(ae,re){if(e){var pe=ae.deletions;pe===null?(ae.deletions=[re],ae.flags|=16):pe.push(re)}}function i(ae,re){if(!e)return null;for(;re!==null;)t(ae,re),re=re.sibling;return null}function n(ae){for(var re=new Map;ae!==null;)ae.key!==null?re.set(ae.key,ae):re.set(ae.index,ae),ae=ae.sibling;return re}function _(ae,re){return ae=ms(ae,re),ae.index=0,ae.sibling=null,ae}function x(ae,re,pe){return ae.index=pe,e?(pe=ae.alternate,pe!==null?(pe=pe.index,pe<re?(ae.flags|=67108866,re):pe):(ae.flags|=67108866,re)):(ae.flags|=1048576,re)}function N(ae){return e&&ae.alternate===null&&(ae.flags|=67108866),ae}function q(ae,re,pe,Re){return re===null||re.tag!==6?(re=ec(pe,ae.mode,Re),re.return=ae,re):(re=_(re,pe),re.return=ae,re)}function te(ae,re,pe,Re){var et=pe.type;return et===p?Le(ae,re,pe.props.children,Re,pe.key):re!==null&&(re.elementType===et||typeof et=="object"&&et!==null&&et.$$typeof===E&&yn(et)===re.type)?(re=_(re,pe.props),Ur(re,pe),re.return=ae,re):(re=Zo(pe.type,pe.key,pe.props,null,ae.mode,Re),Ur(re,pe),re.return=ae,re)}function me(ae,re,pe,Re){return re===null||re.tag!==4||re.stateNode.containerInfo!==pe.containerInfo||re.stateNode.implementation!==pe.implementation?(re=tc(pe,ae.mode,Re),re.return=ae,re):(re=_(re,pe.children||[]),re.return=ae,re)}function Le(ae,re,pe,Re,et){return re===null||re.tag!==7?(re=mn(pe,ae.mode,Re,et),re.return=ae,re):(re=_(re,pe),re.return=ae,re)}function De(ae,re,pe){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return re=ec(""+re,ae.mode,pe),re.return=ae,re;if(typeof re=="object"&&re!==null){switch(re.$$typeof){case b:return pe=Zo(re.type,re.key,re.props,null,ae.mode,pe),Ur(pe,re),pe.return=ae,pe;case C:return re=tc(re,ae.mode,pe),re.return=ae,re;case E:return re=yn(re),De(ae,re,pe)}if(X(re)||P(re))return re=mn(re,ae.mode,pe,null),re.return=ae,re;if(typeof re.then=="function")return De(ae,oa(re),pe);if(re.$$typeof===f)return De(ae,ia(ae,re),pe);aa(ae,re)}return null}function ve(ae,re,pe,Re){var et=re!==null?re.key:null;if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return et!==null?null:q(ae,re,""+pe,Re);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case b:return pe.key===et?te(ae,re,pe,Re):null;case C:return pe.key===et?me(ae,re,pe,Re):null;case E:return pe=yn(pe),ve(ae,re,pe,Re)}if(X(pe)||P(pe))return et!==null?null:Le(ae,re,pe,Re,null);if(typeof pe.then=="function")return ve(ae,re,oa(pe),Re);if(pe.$$typeof===f)return ve(ae,re,ia(ae,pe),Re);aa(ae,pe)}return null}function we(ae,re,pe,Re,et){if(typeof Re=="string"&&Re!==""||typeof Re=="number"||typeof Re=="bigint")return ae=ae.get(pe)||null,q(re,ae,""+Re,et);if(typeof Re=="object"&&Re!==null){switch(Re.$$typeof){case b:return ae=ae.get(Re.key===null?pe:Re.key)||null,te(re,ae,Re,et);case C:return ae=ae.get(Re.key===null?pe:Re.key)||null,me(re,ae,Re,et);case E:return Re=yn(Re),we(ae,re,pe,Re,et)}if(X(Re)||P(Re))return ae=ae.get(pe)||null,Le(re,ae,Re,et,null);if(typeof Re.then=="function")return we(ae,re,pe,oa(Re),et);if(Re.$$typeof===f)return we(ae,re,pe,ia(re,Re),et);aa(re,Re)}return null}function Ke(ae,re,pe,Re){for(var et=null,Rt=null,Je=re,mt=re=0,Ct=null;Je!==null&&mt<pe.length;mt++){Je.index>mt?(Ct=Je,Je=null):Ct=Je.sibling;var Dt=ve(ae,Je,pe[mt],Re);if(Dt===null){Je===null&&(Je=Ct);break}e&&Je&&Dt.alternate===null&&t(ae,Je),re=x(Dt,re,mt),Rt===null?et=Dt:Rt.sibling=Dt,Rt=Dt,Je=Ct}if(mt===pe.length)return i(ae,Je),Et&&gs(ae,mt),et;if(Je===null){for(;mt<pe.length;mt++)Je=De(ae,pe[mt],Re),Je!==null&&(re=x(Je,re,mt),Rt===null?et=Je:Rt.sibling=Je,Rt=Je);return Et&&gs(ae,mt),et}for(Je=n(Je);mt<pe.length;mt++)Ct=we(Je,ae,mt,pe[mt],Re),Ct!==null&&(e&&Ct.alternate!==null&&Je.delete(Ct.key===null?mt:Ct.key),re=x(Ct,re,mt),Rt===null?et=Ct:Rt.sibling=Ct,Rt=Ct);return e&&Je.forEach(function(tn){return t(ae,tn)}),Et&&gs(ae,mt),et}function at(ae,re,pe,Re){if(pe==null)throw Error(S(151));for(var et=null,Rt=null,Je=re,mt=re=0,Ct=null,Dt=pe.next();Je!==null&&!Dt.done;mt++,Dt=pe.next()){Je.index>mt?(Ct=Je,Je=null):Ct=Je.sibling;var tn=ve(ae,Je,Dt.value,Re);if(tn===null){Je===null&&(Je=Ct);break}e&&Je&&tn.alternate===null&&t(ae,Je),re=x(tn,re,mt),Rt===null?et=tn:Rt.sibling=tn,Rt=tn,Je=Ct}if(Dt.done)return i(ae,Je),Et&&gs(ae,mt),et;if(Je===null){for(;!Dt.done;mt++,Dt=pe.next())Dt=De(ae,Dt.value,Re),Dt!==null&&(re=x(Dt,re,mt),Rt===null?et=Dt:Rt.sibling=Dt,Rt=Dt);return Et&&gs(ae,mt),et}for(Je=n(Je);!Dt.done;mt++,Dt=pe.next())Dt=we(Je,ae,mt,Dt.value,Re),Dt!==null&&(e&&Dt.alternate!==null&&Je.delete(Dt.key===null?mt:Dt.key),re=x(Dt,re,mt),Rt===null?et=Dt:Rt.sibling=Dt,Rt=Dt);return e&&Je.forEach(function(zb){return t(ae,zb)}),Et&&gs(ae,mt),et}function Pt(ae,re,pe,Re){if(typeof pe=="object"&&pe!==null&&pe.type===p&&pe.key===null&&(pe=pe.props.children),typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case b:e:{for(var et=pe.key;re!==null;){if(re.key===et){if(et=pe.type,et===p){if(re.tag===7){i(ae,re.sibling),Re=_(re,pe.props.children),Re.return=ae,ae=Re;break e}}else if(re.elementType===et||typeof et=="object"&&et!==null&&et.$$typeof===E&&yn(et)===re.type){i(ae,re.sibling),Re=_(re,pe.props),Ur(Re,pe),Re.return=ae,ae=Re;break e}i(ae,re);break}else t(ae,re);re=re.sibling}pe.type===p?(Re=mn(pe.props.children,ae.mode,Re,pe.key),Re.return=ae,ae=Re):(Re=Zo(pe.type,pe.key,pe.props,null,ae.mode,Re),Ur(Re,pe),Re.return=ae,ae=Re)}return N(ae);case C:e:{for(et=pe.key;re!==null;){if(re.key===et)if(re.tag===4&&re.stateNode.containerInfo===pe.containerInfo&&re.stateNode.implementation===pe.implementation){i(ae,re.sibling),Re=_(re,pe.children||[]),Re.return=ae,ae=Re;break e}else{i(ae,re);break}else t(ae,re);re=re.sibling}Re=tc(pe,ae.mode,Re),Re.return=ae,ae=Re}return N(ae);case E:return pe=yn(pe),Pt(ae,re,pe,Re)}if(X(pe))return Ke(ae,re,pe,Re);if(P(pe)){if(et=P(pe),typeof et!="function")throw Error(S(150));return pe=et.call(pe),at(ae,re,pe,Re)}if(typeof pe.then=="function")return Pt(ae,re,oa(pe),Re);if(pe.$$typeof===f)return Pt(ae,re,ia(ae,pe),Re);aa(ae,pe)}return typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint"?(pe=""+pe,re!==null&&re.tag===6?(i(ae,re.sibling),Re=_(re,pe),Re.return=ae,ae=Re):(i(ae,re),Re=ec(pe,ae.mode,Re),Re.return=ae,ae=Re),N(ae)):i(ae,re)}return function(ae,re,pe,Re){try{Fr=0;var et=Pt(ae,re,pe,Re);return Xn=null,et}catch(Je){if(Je===Kn||Je===na)throw Je;var Rt=Mi(29,Je,null,ae.mode);return Rt.lanes=Re,Rt.return=ae,Rt}finally{}}}var Sn=Gd(!0),Yd=Gd(!1),Hs=!1;function fc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function pc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ps(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Is(e,t,i){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(Mt&2)!==0){var _=n.pending;return _===null?t.next=t:(t.next=_.next,_.next=t),n.pending=t,t=Qo(e),Td(e,null,i),t}return Jo(e,n,t,i),Qo(e)}function $r(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,i|=n,t.lanes=i,ut(e,i)}}function mc(e,t){var i=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,i===n)){var _=null,x=null;if(i=i.firstBaseUpdate,i!==null){do{var N={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};x===null?_=x=N:x=x.next=N,i=i.next}while(i!==null);x===null?_=x=t:x=x.next=t}else _=x=t;i={baseState:n.baseState,firstBaseUpdate:_,lastBaseUpdate:x,shared:n.shared,callbacks:n.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var gc=!1;function Wr(){if(gc){var e=Yn;if(e!==null)throw e}}function qr(e,t,i,n){gc=!1;var _=e.updateQueue;Hs=!1;var x=_.firstBaseUpdate,N=_.lastBaseUpdate,q=_.shared.pending;if(q!==null){_.shared.pending=null;var te=q,me=te.next;te.next=null,N===null?x=me:N.next=me,N=te;var Le=e.alternate;Le!==null&&(Le=Le.updateQueue,q=Le.lastBaseUpdate,q!==N&&(q===null?Le.firstBaseUpdate=me:q.next=me,Le.lastBaseUpdate=te))}if(x!==null){var De=_.baseState;N=0,Le=me=te=null,q=x;do{var ve=q.lane&-536870913,we=ve!==q.lane;if(we?(xt&ve)===ve:(n&ve)===ve){ve!==0&&ve===Gn&&(gc=!0),Le!==null&&(Le=Le.next={lane:0,tag:q.tag,payload:q.payload,callback:null,next:null});e:{var Ke=e,at=q;ve=t;var Pt=i;switch(at.tag){case 1:if(Ke=at.payload,typeof Ke=="function"){De=Ke.call(Pt,De,ve);break e}De=Ke;break e;case 3:Ke.flags=Ke.flags&-65537|128;case 0:if(Ke=at.payload,ve=typeof Ke=="function"?Ke.call(Pt,De,ve):Ke,ve==null)break e;De=l({},De,ve);break e;case 2:Hs=!0}}ve=q.callback,ve!==null&&(e.flags|=64,we&&(e.flags|=8192),we=_.callbacks,we===null?_.callbacks=[ve]:we.push(ve))}else we={lane:ve,tag:q.tag,payload:q.payload,callback:q.callback,next:null},Le===null?(me=Le=we,te=De):Le=Le.next=we,N|=ve;if(q=q.next,q===null){if(q=_.shared.pending,q===null)break;we=q,q=we.next,we.next=null,_.lastBaseUpdate=we,_.shared.pending=null}}while(!0);Le===null&&(te=De),_.baseState=te,_.firstBaseUpdate=me,_.lastBaseUpdate=Le,x===null&&(_.shared.lanes=0),qs|=N,e.lanes=N,e.memoizedState=De}}function Kd(e,t){if(typeof e!="function")throw Error(S(191,e));e.call(t)}function Xd(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)Kd(i[e],t)}var Vn=B(null),la=B(0);function Vd(e,t){e=Ls,Z(la,e),Z(Vn,t),Ls=e|t.baseLanes}function vc(){Z(la,Ls),Z(Vn,Vn.current)}function _c(){Ls=la.current,W(Vn),W(la)}var Ai=B(null),qi=null;function Fs(e){var t=e.alternate;Z(Qt,Qt.current&1),Z(Ai,e),qi===null&&(t===null||Vn.current!==null||t.memoizedState!==null)&&(qi=e)}function bc(e){Z(Qt,Qt.current),Z(Ai,e),qi===null&&(qi=e)}function Jd(e){e.tag===22?(Z(Qt,Qt.current),Z(Ai,e),qi===null&&(qi=e)):Us()}function Us(){Z(Qt,Qt.current),Z(Ai,Ai.current)}function ji(e){W(Ai),qi===e&&(qi=null),W(Qt)}var Qt=B(0);function ca(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||ku(i)||Eu(i)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var bs=0,pt=null,zt=null,ii=null,ua=!1,Jn=!1,xn=!1,ha=0,Gr=0,Qn=null,L0=0;function Kt(){throw Error(S(321))}function yc(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!Ti(e[i],t[i]))return!1;return!0}function wc(e,t,i,n,_,x){return bs=x,pt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Y.H=e===null||e.memoizedState===null?Bf:Nc,xn=!1,x=i(n,_),xn=!1,Jn&&(x=Zd(t,i,n,_)),Qd(e),x}function Qd(e){Y.H=Xr;var t=zt!==null&&zt.next!==null;if(bs=0,ii=zt=pt=null,ua=!1,Gr=0,Qn=null,t)throw Error(S(300));e===null||si||(e=e.dependencies,e!==null&&ta(e)&&(si=!0))}function Zd(e,t,i,n){pt=e;var _=0;do{if(Jn&&(Qn=null),Gr=0,Jn=!1,25<=_)throw Error(S(301));if(_+=1,ii=zt=null,e.updateQueue!=null){var x=e.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}Y.H=Nf,x=t(i,n)}while(Jn);return x}function R0(){var e=Y.H,t=e.useState()[0];return t=typeof t.then=="function"?Yr(t):t,e=e.useState()[0],(zt!==null?zt.memoizedState:null)!==e&&(pt.flags|=1024),t}function Sc(){var e=ha!==0;return ha=0,e}function xc(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function Cc(e){if(ua){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ua=!1}bs=0,ii=zt=pt=null,Jn=!1,Gr=ha=0,Qn=null}function vi(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ii===null?pt.memoizedState=ii=e:ii=ii.next=e,ii}function Zt(){if(zt===null){var e=pt.alternate;e=e!==null?e.memoizedState:null}else e=zt.next;var t=ii===null?pt.memoizedState:ii.next;if(t!==null)ii=t,zt=e;else{if(e===null)throw pt.alternate===null?Error(S(467)):Error(S(310));zt=e,e={memoizedState:zt.memoizedState,baseState:zt.baseState,baseQueue:zt.baseQueue,queue:zt.queue,next:null},ii===null?pt.memoizedState=ii=e:ii=ii.next=e}return ii}function da(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Yr(e){var t=Gr;return Gr+=1,Qn===null&&(Qn=[]),e=$d(Qn,e,t),t=pt,(ii===null?t.memoizedState:ii.next)===null&&(t=t.alternate,Y.H=t===null||t.memoizedState===null?Bf:Nc),e}function fa(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Yr(e);if(e.$$typeof===f)return hi(e)}throw Error(S(438,String(e)))}function kc(e){var t=null,i=pt.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var n=pt.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(_){return _.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=da(),pt.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),n=0;n<e;n++)i[n]=z;return t.index++,i}function ys(e,t){return typeof t=="function"?t(e):t}function pa(e){var t=Zt();return Ec(t,zt,e)}function Ec(e,t,i){var n=e.queue;if(n===null)throw Error(S(311));n.lastRenderedReducer=i;var _=e.baseQueue,x=n.pending;if(x!==null){if(_!==null){var N=_.next;_.next=x.next,x.next=N}t.baseQueue=_=x,n.pending=null}if(x=e.baseState,_===null)e.memoizedState=x;else{t=_.next;var q=N=null,te=null,me=t,Le=!1;do{var De=me.lane&-536870913;if(De!==me.lane?(xt&De)===De:(bs&De)===De){var ve=me.revertLane;if(ve===0)te!==null&&(te=te.next={lane:0,revertLane:0,gesture:null,action:me.action,hasEagerState:me.hasEagerState,eagerState:me.eagerState,next:null}),De===Gn&&(Le=!0);else if((bs&ve)===ve){me=me.next,ve===Gn&&(Le=!0);continue}else De={lane:0,revertLane:me.revertLane,gesture:null,action:me.action,hasEagerState:me.hasEagerState,eagerState:me.eagerState,next:null},te===null?(q=te=De,N=x):te=te.next=De,pt.lanes|=ve,qs|=ve;De=me.action,xn&&i(x,De),x=me.hasEagerState?me.eagerState:i(x,De)}else ve={lane:De,revertLane:me.revertLane,gesture:me.gesture,action:me.action,hasEagerState:me.hasEagerState,eagerState:me.eagerState,next:null},te===null?(q=te=ve,N=x):te=te.next=ve,pt.lanes|=De,qs|=De;me=me.next}while(me!==null&&me!==t);if(te===null?N=x:te.next=q,!Ti(x,e.memoizedState)&&(si=!0,Le&&(i=Yn,i!==null)))throw i;e.memoizedState=x,e.baseState=N,e.baseQueue=te,n.lastRenderedState=x}return _===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function Lc(e){var t=Zt(),i=t.queue;if(i===null)throw Error(S(311));i.lastRenderedReducer=e;var n=i.dispatch,_=i.pending,x=t.memoizedState;if(_!==null){i.pending=null;var N=_=_.next;do x=e(x,N.action),N=N.next;while(N!==_);Ti(x,t.memoizedState)||(si=!0),t.memoizedState=x,t.baseQueue===null&&(t.baseState=x),i.lastRenderedState=x}return[x,n]}function ef(e,t,i){var n=pt,_=Zt(),x=Et;if(x){if(i===void 0)throw Error(S(407));i=i()}else i=t();var N=!Ti((zt||_).memoizedState,i);if(N&&(_.memoizedState=i,si=!0),_=_.queue,Tc(nf.bind(null,n,_,e),[e]),_.getSnapshot!==t||N||ii!==null&&ii.memoizedState.tag&1){if(n.flags|=2048,Zn(9,{destroy:void 0},sf.bind(null,n,_,i,t),null),It===null)throw Error(S(349));x||(bs&127)!==0||tf(n,t,i)}return i}function tf(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=pt.updateQueue,t===null?(t=da(),pt.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function sf(e,t,i,n){t.value=i,t.getSnapshot=n,rf(t)&&of(e)}function nf(e,t,i){return i(function(){rf(t)&&of(e)})}function rf(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!Ti(e,i)}catch{return!0}}function of(e){var t=pn(e,2);t!==null&&ki(t,e,2)}function Rc(e){var t=vi();if(typeof e=="function"){var i=e;if(e=i(),xn){be(!0);try{i()}finally{be(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ys,lastRenderedState:e},t}function af(e,t,i,n){return e.baseState=i,Ec(e,zt,typeof n=="function"?n:ys)}function D0(e,t,i,n,_){if(va(e))throw Error(S(485));if(e=t.action,e!==null){var x={payload:_,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(N){x.listeners.push(N)}};Y.T!==null?i(!0):x.isTransition=!1,n(x),i=t.pending,i===null?(x.next=t.pending=x,lf(t,x)):(x.next=i.next,t.pending=i.next=x)}}function lf(e,t){var i=t.action,n=t.payload,_=e.state;if(t.isTransition){var x=Y.T,N={};Y.T=N;try{var q=i(_,n),te=Y.S;te!==null&&te(N,q),cf(e,t,q)}catch(me){Dc(e,t,me)}finally{x!==null&&N.types!==null&&(x.types=N.types),Y.T=x}}else try{x=i(_,n),cf(e,t,x)}catch(me){Dc(e,t,me)}}function cf(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(n){uf(e,t,n)},function(n){return Dc(e,t,n)}):uf(e,t,i)}function uf(e,t,i){t.status="fulfilled",t.value=i,hf(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,lf(e,i)))}function Dc(e,t,i){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=i,hf(t),t=t.next;while(t!==n)}e.action=null}function hf(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function df(e,t){return t}function ff(e,t){if(Et){var i=It.formState;if(i!==null){e:{var n=pt;if(Et){if(Wt){t:{for(var _=Wt,x=Wi;_.nodeType!==8;){if(!x){_=null;break t}if(_=Gi(_.nextSibling),_===null){_=null;break t}}x=_.data,_=x==="F!"||x==="F"?_:null}if(_){Wt=Gi(_.nextSibling),n=_.data==="F!";break e}}Ns(n)}n=!1}n&&(t=i[0])}}return i=vi(),i.memoizedState=i.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:df,lastRenderedState:t},i.queue=n,i=Af.bind(null,pt,n),n.dispatch=i,n=Rc(!1),x=Bc.bind(null,pt,!1,n.queue),n=vi(),_={state:t,dispatch:null,action:e,pending:null},n.queue=_,i=D0.bind(null,pt,_,x,i),_.dispatch=i,n.memoizedState=e,[t,i,!1]}function pf(e){var t=Zt();return mf(t,zt,e)}function mf(e,t,i){if(t=Ec(e,t,df)[0],e=pa(ys)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=Yr(t)}catch(N){throw N===Kn?na:N}else n=t;t=Zt();var _=t.queue,x=_.dispatch;return i!==t.memoizedState&&(pt.flags|=2048,Zn(9,{destroy:void 0},T0.bind(null,_,i),null)),[n,x,e]}function T0(e,t){e.action=t}function gf(e){var t=Zt(),i=zt;if(i!==null)return mf(t,i,e);Zt(),t=t.memoizedState,i=Zt();var n=i.queue.dispatch;return i.memoizedState=e,[t,n,!1]}function Zn(e,t,i,n){return e={tag:e,create:i,deps:n,inst:t,next:null},t=pt.updateQueue,t===null&&(t=da(),pt.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(n=i.next,i.next=e,e.next=n,t.lastEffect=e),e}function vf(){return Zt().memoizedState}function ma(e,t,i,n){var _=vi();pt.flags|=e,_.memoizedState=Zn(1|t,{destroy:void 0},i,n===void 0?null:n)}function ga(e,t,i,n){var _=Zt();n=n===void 0?null:n;var x=_.memoizedState.inst;zt!==null&&n!==null&&yc(n,zt.memoizedState.deps)?_.memoizedState=Zn(t,x,i,n):(pt.flags|=e,_.memoizedState=Zn(1|t,x,i,n))}function _f(e,t){ma(8390656,8,e,t)}function Tc(e,t){ga(2048,8,e,t)}function M0(e){pt.flags|=4;var t=pt.updateQueue;if(t===null)t=da(),pt.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function bf(e){var t=Zt().memoizedState;return M0({ref:t,nextImpl:e}),function(){if((Mt&2)!==0)throw Error(S(440));return t.impl.apply(void 0,arguments)}}function yf(e,t){return ga(4,2,e,t)}function wf(e,t){return ga(4,4,e,t)}function Sf(e,t){if(typeof t=="function"){e=e();var i=t(e);return function(){typeof i=="function"?i():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function xf(e,t,i){i=i!=null?i.concat([e]):null,ga(4,4,Sf.bind(null,t,e),i)}function Mc(){}function Cf(e,t){var i=Zt();t=t===void 0?null:t;var n=i.memoizedState;return t!==null&&yc(t,n[1])?n[0]:(i.memoizedState=[e,t],e)}function kf(e,t){var i=Zt();t=t===void 0?null:t;var n=i.memoizedState;if(t!==null&&yc(t,n[1]))return n[0];if(n=e(),xn){be(!0);try{e()}finally{be(!1)}}return i.memoizedState=[n,t],n}function Ac(e,t,i){return i===void 0||(bs&1073741824)!==0&&(xt&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=Ep(),pt.lanes|=e,qs|=e,i)}function Ef(e,t,i,n){return Ti(i,t)?i:Vn.current!==null?(e=Ac(e,i,n),Ti(e,t)||(si=!0),e):(bs&42)===0||(bs&1073741824)!==0&&(xt&261930)===0?(si=!0,e.memoizedState=i):(e=Ep(),pt.lanes|=e,qs|=e,t)}function Lf(e,t,i,n,_){var x=$.p;$.p=x!==0&&8>x?x:8;var N=Y.T,q={};Y.T=q,Bc(e,!1,t,i);try{var te=_(),me=Y.S;if(me!==null&&me(q,te),te!==null&&typeof te=="object"&&typeof te.then=="function"){var Le=E0(te,n);Kr(e,t,Le,Ni(e))}else Kr(e,t,n,Ni(e))}catch(De){Kr(e,t,{then:function(){},status:"rejected",reason:De},Ni())}finally{$.p=x,N!==null&&q.types!==null&&(N.types=q.types),Y.T=N}}function A0(){}function jc(e,t,i,n){if(e.tag!==5)throw Error(S(476));var _=Rf(e).queue;Lf(e,_,t,U,i===null?A0:function(){return Df(e),i(n)})}function Rf(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:U,baseState:U,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ys,lastRenderedState:U},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ys,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Df(e){var t=Rf(e);t.next===null&&(t=e.alternate.memoizedState),Kr(e,t.next.queue,{},Ni())}function Oc(){return hi(ho)}function Tf(){return Zt().memoizedState}function Mf(){return Zt().memoizedState}function j0(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=Ni();e=Ps(i);var n=Is(t,e,i);n!==null&&(ki(n,t,i),$r(n,t,i)),t={cache:cc()},e.payload=t;return}t=t.return}}function O0(e,t,i){var n=Ni();i={lane:n,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},va(e)?jf(t,i):(i=Ql(e,t,i,n),i!==null&&(ki(i,e,n),Of(i,t,n)))}function Af(e,t,i){var n=Ni();Kr(e,t,i,n)}function Kr(e,t,i,n){var _={lane:n,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(va(e))jf(t,_);else{var x=e.alternate;if(e.lanes===0&&(x===null||x.lanes===0)&&(x=t.lastRenderedReducer,x!==null))try{var N=t.lastRenderedState,q=x(N,i);if(_.hasEagerState=!0,_.eagerState=q,Ti(q,N))return Jo(e,t,_,0),It===null&&Vo(),!1}catch{}finally{}if(i=Ql(e,t,_,n),i!==null)return ki(i,e,n),Of(i,t,n),!0}return!1}function Bc(e,t,i,n){if(n={lane:2,revertLane:fu(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},va(e)){if(t)throw Error(S(479))}else t=Ql(e,i,n,2),t!==null&&ki(t,e,2)}function va(e){var t=e.alternate;return e===pt||t!==null&&t===pt}function jf(e,t){Jn=ua=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function Of(e,t,i){if((i&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,i|=n,t.lanes=i,ut(e,i)}}var Xr={readContext:hi,use:fa,useCallback:Kt,useContext:Kt,useEffect:Kt,useImperativeHandle:Kt,useLayoutEffect:Kt,useInsertionEffect:Kt,useMemo:Kt,useReducer:Kt,useRef:Kt,useState:Kt,useDebugValue:Kt,useDeferredValue:Kt,useTransition:Kt,useSyncExternalStore:Kt,useId:Kt,useHostTransitionStatus:Kt,useFormState:Kt,useActionState:Kt,useOptimistic:Kt,useMemoCache:Kt,useCacheRefresh:Kt};Xr.useEffectEvent=Kt;var Bf={readContext:hi,use:fa,useCallback:function(e,t){return vi().memoizedState=[e,t===void 0?null:t],e},useContext:hi,useEffect:_f,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,ma(4194308,4,Sf.bind(null,t,e),i)},useLayoutEffect:function(e,t){return ma(4194308,4,e,t)},useInsertionEffect:function(e,t){ma(4,2,e,t)},useMemo:function(e,t){var i=vi();t=t===void 0?null:t;var n=e();if(xn){be(!0);try{e()}finally{be(!1)}}return i.memoizedState=[n,t],n},useReducer:function(e,t,i){var n=vi();if(i!==void 0){var _=i(t);if(xn){be(!0);try{i(t)}finally{be(!1)}}}else _=t;return n.memoizedState=n.baseState=_,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:_},n.queue=e,e=e.dispatch=O0.bind(null,pt,e),[n.memoizedState,e]},useRef:function(e){var t=vi();return e={current:e},t.memoizedState=e},useState:function(e){e=Rc(e);var t=e.queue,i=Af.bind(null,pt,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:Mc,useDeferredValue:function(e,t){var i=vi();return Ac(i,e,t)},useTransition:function(){var e=Rc(!1);return e=Lf.bind(null,pt,e.queue,!0,!1),vi().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var n=pt,_=vi();if(Et){if(i===void 0)throw Error(S(407));i=i()}else{if(i=t(),It===null)throw Error(S(349));(xt&127)!==0||tf(n,t,i)}_.memoizedState=i;var x={value:i,getSnapshot:t};return _.queue=x,_f(nf.bind(null,n,x,e),[e]),n.flags|=2048,Zn(9,{destroy:void 0},sf.bind(null,n,x,i,t),null),i},useId:function(){var e=vi(),t=It.identifierPrefix;if(Et){var i=as,n=os;i=(n&~(1<<32-he(n)-1)).toString(32)+i,t="_"+t+"R_"+i,i=ha++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=L0++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Oc,useFormState:ff,useActionState:ff,useOptimistic:function(e){var t=vi();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=Bc.bind(null,pt,!0,i),i.dispatch=t,[e,t]},useMemoCache:kc,useCacheRefresh:function(){return vi().memoizedState=j0.bind(null,pt)},useEffectEvent:function(e){var t=vi(),i={impl:e};return t.memoizedState=i,function(){if((Mt&2)!==0)throw Error(S(440));return i.impl.apply(void 0,arguments)}}},Nc={readContext:hi,use:fa,useCallback:Cf,useContext:hi,useEffect:Tc,useImperativeHandle:xf,useInsertionEffect:yf,useLayoutEffect:wf,useMemo:kf,useReducer:pa,useRef:vf,useState:function(){return pa(ys)},useDebugValue:Mc,useDeferredValue:function(e,t){var i=Zt();return Ef(i,zt.memoizedState,e,t)},useTransition:function(){var e=pa(ys)[0],t=Zt().memoizedState;return[typeof e=="boolean"?e:Yr(e),t]},useSyncExternalStore:ef,useId:Tf,useHostTransitionStatus:Oc,useFormState:pf,useActionState:pf,useOptimistic:function(e,t){var i=Zt();return af(i,zt,e,t)},useMemoCache:kc,useCacheRefresh:Mf};Nc.useEffectEvent=bf;var Nf={readContext:hi,use:fa,useCallback:Cf,useContext:hi,useEffect:Tc,useImperativeHandle:xf,useInsertionEffect:yf,useLayoutEffect:wf,useMemo:kf,useReducer:Lc,useRef:vf,useState:function(){return Lc(ys)},useDebugValue:Mc,useDeferredValue:function(e,t){var i=Zt();return zt===null?Ac(i,e,t):Ef(i,zt.memoizedState,e,t)},useTransition:function(){var e=Lc(ys)[0],t=Zt().memoizedState;return[typeof e=="boolean"?e:Yr(e),t]},useSyncExternalStore:ef,useId:Tf,useHostTransitionStatus:Oc,useFormState:gf,useActionState:gf,useOptimistic:function(e,t){var i=Zt();return zt!==null?af(i,zt,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:kc,useCacheRefresh:Mf};Nf.useEffectEvent=bf;function zc(e,t,i,n){t=e.memoizedState,i=i(n,t),i=i==null?t:l({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Hc={enqueueSetState:function(e,t,i){e=e._reactInternals;var n=Ni(),_=Ps(n);_.payload=t,i!=null&&(_.callback=i),t=Is(e,_,n),t!==null&&(ki(t,e,n),$r(t,e,n))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var n=Ni(),_=Ps(n);_.tag=1,_.payload=t,i!=null&&(_.callback=i),t=Is(e,_,n),t!==null&&(ki(t,e,n),$r(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=Ni(),n=Ps(i);n.tag=2,t!=null&&(n.callback=t),t=Is(e,n,i),t!==null&&(ki(t,e,i),$r(t,e,i))}};function zf(e,t,i,n,_,x,N){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,x,N):t.prototype&&t.prototype.isPureReactComponent?!Br(i,n)||!Br(_,x):!0}function Hf(e,t,i,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,n),t.state!==e&&Hc.enqueueReplaceState(t,t.state,null)}function Cn(e,t){var i=t;if("ref"in t){i={};for(var n in t)n!=="ref"&&(i[n]=t[n])}if(e=e.defaultProps){i===t&&(i=l({},i));for(var _ in e)i[_]===void 0&&(i[_]=e[_])}return i}function Pf(e){Xo(e)}function If(e){console.error(e)}function Ff(e){Xo(e)}function _a(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function Uf(e,t,i){try{var n=e.onCaughtError;n(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(_){setTimeout(function(){throw _})}}function Pc(e,t,i){return i=Ps(i),i.tag=3,i.payload={element:null},i.callback=function(){_a(e,t)},i}function $f(e){return e=Ps(e),e.tag=3,e}function Wf(e,t,i,n){var _=i.type.getDerivedStateFromError;if(typeof _=="function"){var x=n.value;e.payload=function(){return _(x)},e.callback=function(){Uf(t,i,n)}}var N=i.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(e.callback=function(){Uf(t,i,n),typeof _!="function"&&(Gs===null?Gs=new Set([this]):Gs.add(this));var q=n.stack;this.componentDidCatch(n.value,{componentStack:q!==null?q:""})})}function B0(e,t,i,n,_){if(i.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=i.alternate,t!==null&&qn(t,i,_,!0),i=Ai.current,i!==null){switch(i.tag){case 31:case 13:return qi===null?Ta():i.alternate===null&&Xt===0&&(Xt=3),i.flags&=-257,i.flags|=65536,i.lanes=_,n===ra?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([n]):t.add(n),uu(e,n,_)),!1;case 22:return i.flags|=65536,n===ra?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([n]):i.add(n)),uu(e,n,_)),!1}throw Error(S(435,i.tag))}return uu(e,n,_),Ta(),!1}if(Et)return t=Ai.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=_,n!==nc&&(e=Error(S(422),{cause:n}),Hr(Fi(e,i)))):(n!==nc&&(t=Error(S(423),{cause:n}),Hr(Fi(t,i))),e=e.current.alternate,e.flags|=65536,_&=-_,e.lanes|=_,n=Fi(n,i),_=Pc(e.stateNode,n,_),mc(e,_),Xt!==4&&(Xt=2)),!1;var x=Error(S(520),{cause:n});if(x=Fi(x,i),so===null?so=[x]:so.push(x),Xt!==4&&(Xt=2),t===null)return!0;n=Fi(n,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=_&-_,i.lanes|=e,e=Pc(i.stateNode,n,e),mc(i,e),!1;case 1:if(t=i.type,x=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Gs===null||!Gs.has(x))))return i.flags|=65536,_&=-_,i.lanes|=_,_=$f(_),Wf(_,e,i,n),mc(i,_),!1}i=i.return}while(i!==null);return!1}var Ic=Error(S(461)),si=!1;function di(e,t,i,n){t.child=e===null?Yd(t,null,i,n):Sn(t,e.child,i,n)}function qf(e,t,i,n,_){i=i.render;var x=t.ref;if("ref"in n){var N={};for(var q in n)q!=="ref"&&(N[q]=n[q])}else N=n;return _n(t),n=wc(e,t,i,N,x,_),q=Sc(),e!==null&&!si?(xc(e,t,_),ws(e,t,_)):(Et&&q&&ic(t),t.flags|=1,di(e,t,n,_),t.child)}function Gf(e,t,i,n,_){if(e===null){var x=i.type;return typeof x=="function"&&!Zl(x)&&x.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=x,Yf(e,t,x,n,_)):(e=Zo(i.type,null,n,t,t.mode,_),e.ref=t.ref,e.return=t,t.child=e)}if(x=e.child,!Kc(e,_)){var N=x.memoizedProps;if(i=i.compare,i=i!==null?i:Br,i(N,n)&&e.ref===t.ref)return ws(e,t,_)}return t.flags|=1,e=ms(x,n),e.ref=t.ref,e.return=t,t.child=e}function Yf(e,t,i,n,_){if(e!==null){var x=e.memoizedProps;if(Br(x,n)&&e.ref===t.ref)if(si=!1,t.pendingProps=n=x,Kc(e,_))(e.flags&131072)!==0&&(si=!0);else return t.lanes=e.lanes,ws(e,t,_)}return Fc(e,t,i,n,_)}function Kf(e,t,i,n){var _=n.children,x=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.mode==="hidden"){if((t.flags&128)!==0){if(x=x!==null?x.baseLanes|i:i,e!==null){for(n=t.child=e.child,_=0;n!==null;)_=_|n.lanes|n.childLanes,n=n.sibling;n=_&~x}else n=0,t.child=null;return Xf(e,t,x,i,n)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&sa(t,x!==null?x.cachePool:null),x!==null?Vd(t,x):vc(),Jd(t);else return n=t.lanes=536870912,Xf(e,t,x!==null?x.baseLanes|i:i,i,n)}else x!==null?(sa(t,x.cachePool),Vd(t,x),Us(),t.memoizedState=null):(e!==null&&sa(t,null),vc(),Us());return di(e,t,_,i),t.child}function Vr(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Xf(e,t,i,n,_){var x=hc();return x=x===null?null:{parent:ti._currentValue,pool:x},t.memoizedState={baseLanes:i,cachePool:x},e!==null&&sa(t,null),vc(),Jd(t),e!==null&&qn(e,t,n,!0),t.childLanes=_,null}function ba(e,t){return t=wa({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Vf(e,t,i){return Sn(t,e.child,null,i),e=ba(t,t.pendingProps),e.flags|=2,ji(t),t.memoizedState=null,e}function N0(e,t,i){var n=t.pendingProps,_=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Et){if(n.mode==="hidden")return e=ba(t,n),t.lanes=536870912,Vr(null,e);if(bc(t),(e=Wt)?(e=lm(e,Wi),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Os!==null?{id:os,overflow:as}:null,retryLane:536870912,hydrationErrors:null},i=Ad(e),i.return=t,t.child=i,ui=t,Wt=null)):e=null,e===null)throw Ns(t);return t.lanes=536870912,null}return ba(t,n)}var x=e.memoizedState;if(x!==null){var N=x.dehydrated;if(bc(t),_)if(t.flags&256)t.flags&=-257,t=Vf(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(S(558));else if(si||qn(e,t,i,!1),_=(i&e.childLanes)!==0,si||_){if(n=It,n!==null&&(N=ft(n,i),N!==0&&N!==x.retryLane))throw x.retryLane=N,pn(e,N),ki(n,e,N),Ic;Ta(),t=Vf(e,t,i)}else e=x.treeContext,Wt=Gi(N.nextSibling),ui=t,Et=!0,Bs=null,Wi=!1,e!==null&&Bd(t,e),t=ba(t,n),t.flags|=4096;return t}return e=ms(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ya(e,t){var i=t.ref;if(i===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(S(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function Fc(e,t,i,n,_){return _n(t),i=wc(e,t,i,n,void 0,_),n=Sc(),e!==null&&!si?(xc(e,t,_),ws(e,t,_)):(Et&&n&&ic(t),t.flags|=1,di(e,t,i,_),t.child)}function Jf(e,t,i,n,_,x){return _n(t),t.updateQueue=null,i=Zd(t,n,i,_),Qd(e),n=Sc(),e!==null&&!si?(xc(e,t,x),ws(e,t,x)):(Et&&n&&ic(t),t.flags|=1,di(e,t,i,x),t.child)}function Qf(e,t,i,n,_){if(_n(t),t.stateNode===null){var x=Fn,N=i.contextType;typeof N=="object"&&N!==null&&(x=hi(N)),x=new i(n,x),t.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=Hc,t.stateNode=x,x._reactInternals=t,x=t.stateNode,x.props=n,x.state=t.memoizedState,x.refs={},fc(t),N=i.contextType,x.context=typeof N=="object"&&N!==null?hi(N):Fn,x.state=t.memoizedState,N=i.getDerivedStateFromProps,typeof N=="function"&&(zc(t,i,N,n),x.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(N=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),N!==x.state&&Hc.enqueueReplaceState(x,x.state,null),qr(t,n,x,_),Wr(),x.state=t.memoizedState),typeof x.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){x=t.stateNode;var q=t.memoizedProps,te=Cn(i,q);x.props=te;var me=x.context,Le=i.contextType;N=Fn,typeof Le=="object"&&Le!==null&&(N=hi(Le));var De=i.getDerivedStateFromProps;Le=typeof De=="function"||typeof x.getSnapshotBeforeUpdate=="function",q=t.pendingProps!==q,Le||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(q||me!==N)&&Hf(t,x,n,N),Hs=!1;var ve=t.memoizedState;x.state=ve,qr(t,n,x,_),Wr(),me=t.memoizedState,q||ve!==me||Hs?(typeof De=="function"&&(zc(t,i,De,n),me=t.memoizedState),(te=Hs||zf(t,i,te,n,ve,me,N))?(Le||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(t.flags|=4194308)):(typeof x.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=me),x.props=n,x.state=me,x.context=N,n=te):(typeof x.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{x=t.stateNode,pc(e,t),N=t.memoizedProps,Le=Cn(i,N),x.props=Le,De=t.pendingProps,ve=x.context,me=i.contextType,te=Fn,typeof me=="object"&&me!==null&&(te=hi(me)),q=i.getDerivedStateFromProps,(me=typeof q=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(N!==De||ve!==te)&&Hf(t,x,n,te),Hs=!1,ve=t.memoizedState,x.state=ve,qr(t,n,x,_),Wr();var we=t.memoizedState;N!==De||ve!==we||Hs||e!==null&&e.dependencies!==null&&ta(e.dependencies)?(typeof q=="function"&&(zc(t,i,q,n),we=t.memoizedState),(Le=Hs||zf(t,i,Le,n,ve,we,te)||e!==null&&e.dependencies!==null&&ta(e.dependencies))?(me||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(n,we,te),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(n,we,te)),typeof x.componentDidUpdate=="function"&&(t.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof x.componentDidUpdate!="function"||N===e.memoizedProps&&ve===e.memoizedState||(t.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||N===e.memoizedProps&&ve===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=we),x.props=n,x.state=we,x.context=te,n=Le):(typeof x.componentDidUpdate!="function"||N===e.memoizedProps&&ve===e.memoizedState||(t.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||N===e.memoizedProps&&ve===e.memoizedState||(t.flags|=1024),n=!1)}return x=n,ya(e,t),n=(t.flags&128)!==0,x||n?(x=t.stateNode,i=n&&typeof i.getDerivedStateFromError!="function"?null:x.render(),t.flags|=1,e!==null&&n?(t.child=Sn(t,e.child,null,_),t.child=Sn(t,null,i,_)):di(e,t,i,_),t.memoizedState=x.state,e=t.child):e=ws(e,t,_),e}function Zf(e,t,i,n){return gn(),t.flags|=256,di(e,t,i,n),t.child}var Uc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function $c(e){return{baseLanes:e,cachePool:Fd()}}function Wc(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=Bi),e}function ep(e,t,i){var n=t.pendingProps,_=!1,x=(t.flags&128)!==0,N;if((N=x)||(N=e!==null&&e.memoizedState===null?!1:(Qt.current&2)!==0),N&&(_=!0,t.flags&=-129),N=(t.flags&32)!==0,t.flags&=-33,e===null){if(Et){if(_?Fs(t):Us(),(e=Wt)?(e=lm(e,Wi),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Os!==null?{id:os,overflow:as}:null,retryLane:536870912,hydrationErrors:null},i=Ad(e),i.return=t,t.child=i,ui=t,Wt=null)):e=null,e===null)throw Ns(t);return Eu(e)?t.lanes=32:t.lanes=536870912,null}var q=n.children;return n=n.fallback,_?(Us(),_=t.mode,q=wa({mode:"hidden",children:q},_),n=mn(n,_,i,null),q.return=t,n.return=t,q.sibling=n,t.child=q,n=t.child,n.memoizedState=$c(i),n.childLanes=Wc(e,N,i),t.memoizedState=Uc,Vr(null,n)):(Fs(t),qc(t,q))}var te=e.memoizedState;if(te!==null&&(q=te.dehydrated,q!==null)){if(x)t.flags&256?(Fs(t),t.flags&=-257,t=Gc(e,t,i)):t.memoizedState!==null?(Us(),t.child=e.child,t.flags|=128,t=null):(Us(),q=n.fallback,_=t.mode,n=wa({mode:"visible",children:n.children},_),q=mn(q,_,i,null),q.flags|=2,n.return=t,q.return=t,n.sibling=q,t.child=n,Sn(t,e.child,null,i),n=t.child,n.memoizedState=$c(i),n.childLanes=Wc(e,N,i),t.memoizedState=Uc,t=Vr(null,n));else if(Fs(t),Eu(q)){if(N=q.nextSibling&&q.nextSibling.dataset,N)var me=N.dgst;N=me,n=Error(S(419)),n.stack="",n.digest=N,Hr({value:n,source:null,stack:null}),t=Gc(e,t,i)}else if(si||qn(e,t,i,!1),N=(i&e.childLanes)!==0,si||N){if(N=It,N!==null&&(n=ft(N,i),n!==0&&n!==te.retryLane))throw te.retryLane=n,pn(e,n),ki(N,e,n),Ic;ku(q)||Ta(),t=Gc(e,t,i)}else ku(q)?(t.flags|=192,t.child=e.child,t=null):(e=te.treeContext,Wt=Gi(q.nextSibling),ui=t,Et=!0,Bs=null,Wi=!1,e!==null&&Bd(t,e),t=qc(t,n.children),t.flags|=4096);return t}return _?(Us(),q=n.fallback,_=t.mode,te=e.child,me=te.sibling,n=ms(te,{mode:"hidden",children:n.children}),n.subtreeFlags=te.subtreeFlags&65011712,me!==null?q=ms(me,q):(q=mn(q,_,i,null),q.flags|=2),q.return=t,n.return=t,n.sibling=q,t.child=n,Vr(null,n),n=t.child,q=e.child.memoizedState,q===null?q=$c(i):(_=q.cachePool,_!==null?(te=ti._currentValue,_=_.parent!==te?{parent:te,pool:te}:_):_=Fd(),q={baseLanes:q.baseLanes|i,cachePool:_}),n.memoizedState=q,n.childLanes=Wc(e,N,i),t.memoizedState=Uc,Vr(e.child,n)):(Fs(t),i=e.child,e=i.sibling,i=ms(i,{mode:"visible",children:n.children}),i.return=t,i.sibling=null,e!==null&&(N=t.deletions,N===null?(t.deletions=[e],t.flags|=16):N.push(e)),t.child=i,t.memoizedState=null,i)}function qc(e,t){return t=wa({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function wa(e,t){return e=Mi(22,e,null,t),e.lanes=0,e}function Gc(e,t,i){return Sn(t,e.child,null,i),e=qc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function tp(e,t,i){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),ac(e.return,t,i)}function Yc(e,t,i,n,_,x){var N=e.memoizedState;N===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:i,tailMode:_,treeForkCount:x}:(N.isBackwards=t,N.rendering=null,N.renderingStartTime=0,N.last=n,N.tail=i,N.tailMode=_,N.treeForkCount=x)}function ip(e,t,i){var n=t.pendingProps,_=n.revealOrder,x=n.tail;n=n.children;var N=Qt.current,q=(N&2)!==0;if(q?(N=N&1|2,t.flags|=128):N&=1,Z(Qt,N),di(e,t,n,i),n=Et?zr:0,!q&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&tp(e,i,t);else if(e.tag===19)tp(e,i,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(_){case"forwards":for(i=t.child,_=null;i!==null;)e=i.alternate,e!==null&&ca(e)===null&&(_=i),i=i.sibling;i=_,i===null?(_=t.child,t.child=null):(_=i.sibling,i.sibling=null),Yc(t,!1,_,i,x,n);break;case"backwards":case"unstable_legacy-backwards":for(i=null,_=t.child,t.child=null;_!==null;){if(e=_.alternate,e!==null&&ca(e)===null){t.child=_;break}e=_.sibling,_.sibling=i,i=_,_=e}Yc(t,!0,i,null,x,n);break;case"together":Yc(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function ws(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),qs|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(qn(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(S(153));if(t.child!==null){for(e=t.child,i=ms(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=ms(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Kc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ta(e)))}function z0(e,t,i){switch(t.tag){case 3:G(t,t.stateNode.containerInfo),zs(t,ti,e.memoizedState.cache),gn();break;case 27:case 5:oe(t);break;case 4:G(t,t.stateNode.containerInfo);break;case 10:zs(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,bc(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(Fs(t),t.flags|=128,null):(i&t.child.childLanes)!==0?ep(e,t,i):(Fs(t),e=ws(e,t,i),e!==null?e.sibling:null);Fs(t);break;case 19:var _=(e.flags&128)!==0;if(n=(i&t.childLanes)!==0,n||(qn(e,t,i,!1),n=(i&t.childLanes)!==0),_){if(n)return ip(e,t,i);t.flags|=128}if(_=t.memoizedState,_!==null&&(_.rendering=null,_.tail=null,_.lastEffect=null),Z(Qt,Qt.current),n)break;return null;case 22:return t.lanes=0,Kf(e,t,i,t.pendingProps);case 24:zs(t,ti,e.memoizedState.cache)}return ws(e,t,i)}function sp(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)si=!0;else{if(!Kc(e,i)&&(t.flags&128)===0)return si=!1,z0(e,t,i);si=(e.flags&131072)!==0}else si=!1,Et&&(t.flags&1048576)!==0&&Od(t,zr,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=yn(t.elementType),t.type=e,typeof e=="function")Zl(e)?(n=Cn(e,n),t.tag=1,t=Qf(null,t,e,n,i)):(t.tag=0,t=Fc(null,t,e,n,i));else{if(e!=null){var _=e.$$typeof;if(_===y){t.tag=11,t=qf(null,t,e,n,i);break e}else if(_===D){t.tag=14,t=Gf(null,t,e,n,i);break e}}throw t=K(e)||e,Error(S(306,t,""))}}return t;case 0:return Fc(e,t,t.type,t.pendingProps,i);case 1:return n=t.type,_=Cn(n,t.pendingProps),Qf(e,t,n,_,i);case 3:e:{if(G(t,t.stateNode.containerInfo),e===null)throw Error(S(387));n=t.pendingProps;var x=t.memoizedState;_=x.element,pc(e,t),qr(t,n,null,i);var N=t.memoizedState;if(n=N.cache,zs(t,ti,n),n!==x.cache&&lc(t,[ti],i,!0),Wr(),n=N.element,x.isDehydrated)if(x={element:n,isDehydrated:!1,cache:N.cache},t.updateQueue.baseState=x,t.memoizedState=x,t.flags&256){t=Zf(e,t,n,i);break e}else if(n!==_){_=Fi(Error(S(424)),t),Hr(_),t=Zf(e,t,n,i);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Wt=Gi(e.firstChild),ui=t,Et=!0,Bs=null,Wi=!0,i=Yd(t,null,n,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(gn(),n===_){t=ws(e,t,i);break e}di(e,t,n,i)}t=t.child}return t;case 26:return ya(e,t),e===null?(i=pm(t.type,null,t.pendingProps,null))?t.memoizedState=i:Et||(i=t.type,e=t.pendingProps,n=za(xe.current).createElement(i),n[fe]=t,n[Ve]=e,fi(n,i,e),Lt(n),t.stateNode=n):t.memoizedState=pm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return oe(t),e===null&&Et&&(n=t.stateNode=hm(t.type,t.pendingProps,xe.current),ui=t,Wi=!0,_=Wt,Vs(t.type)?(Lu=_,Wt=Gi(n.firstChild)):Wt=_),di(e,t,t.pendingProps.children,i),ya(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Et&&((_=n=Wt)&&(n=fb(n,t.type,t.pendingProps,Wi),n!==null?(t.stateNode=n,ui=t,Wt=Gi(n.firstChild),Wi=!1,_=!0):_=!1),_||Ns(t)),oe(t),_=t.type,x=t.pendingProps,N=e!==null?e.memoizedProps:null,n=x.children,Su(_,x)?n=null:N!==null&&Su(_,N)&&(t.flags|=32),t.memoizedState!==null&&(_=wc(e,t,R0,null,null,i),ho._currentValue=_),ya(e,t),di(e,t,n,i),t.child;case 6:return e===null&&Et&&((e=i=Wt)&&(i=pb(i,t.pendingProps,Wi),i!==null?(t.stateNode=i,ui=t,Wt=null,e=!0):e=!1),e||Ns(t)),null;case 13:return ep(e,t,i);case 4:return G(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Sn(t,null,n,i):di(e,t,n,i),t.child;case 11:return qf(e,t,t.type,t.pendingProps,i);case 7:return di(e,t,t.pendingProps,i),t.child;case 8:return di(e,t,t.pendingProps.children,i),t.child;case 12:return di(e,t,t.pendingProps.children,i),t.child;case 10:return n=t.pendingProps,zs(t,t.type,n.value),di(e,t,n.children,i),t.child;case 9:return _=t.type._context,n=t.pendingProps.children,_n(t),_=hi(_),n=n(_),t.flags|=1,di(e,t,n,i),t.child;case 14:return Gf(e,t,t.type,t.pendingProps,i);case 15:return Yf(e,t,t.type,t.pendingProps,i);case 19:return ip(e,t,i);case 31:return N0(e,t,i);case 22:return Kf(e,t,i,t.pendingProps);case 24:return _n(t),n=hi(ti),e===null?(_=hc(),_===null&&(_=It,x=cc(),_.pooledCache=x,x.refCount++,x!==null&&(_.pooledCacheLanes|=i),_=x),t.memoizedState={parent:n,cache:_},fc(t),zs(t,ti,_)):((e.lanes&i)!==0&&(pc(e,t),qr(t,null,null,i),Wr()),_=e.memoizedState,x=t.memoizedState,_.parent!==n?(_={parent:n,cache:n},t.memoizedState=_,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=_),zs(t,ti,n)):(n=x.cache,zs(t,ti,n),n!==_.cache&&lc(t,[ti],i,!0))),di(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(S(156,t.tag))}function Ss(e){e.flags|=4}function Xc(e,t,i,n,_){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(_&335544128)===_)if(e.stateNode.complete)e.flags|=8192;else if(Tp())e.flags|=8192;else throw wn=ra,dc}else e.flags&=-16777217}function np(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!bm(t))if(Tp())e.flags|=8192;else throw wn=ra,dc}function Sa(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ee():536870912,e.lanes|=t,sr|=t)}function Jr(e,t){if(!Et)switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var n=null;i!==null;)i.alternate!==null&&(n=i),i=i.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function qt(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,n=0;if(t)for(var _=e.child;_!==null;)i|=_.lanes|_.childLanes,n|=_.subtreeFlags&65011712,n|=_.flags&65011712,_.return=e,_=_.sibling;else for(_=e.child;_!==null;)i|=_.lanes|_.childLanes,n|=_.subtreeFlags,n|=_.flags,_.return=e,_=_.sibling;return e.subtreeFlags|=n,e.childLanes=i,t}function H0(e,t,i){var n=t.pendingProps;switch(sc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qt(t),null;case 1:return qt(t),null;case 3:return i=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),_s(ti),de(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Wn(t)?Ss(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,rc())),qt(t),null;case 26:var _=t.type,x=t.memoizedState;return e===null?(Ss(t),x!==null?(qt(t),np(t,x)):(qt(t),Xc(t,_,null,n,i))):x?x!==e.memoizedState?(Ss(t),qt(t),np(t,x)):(qt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&Ss(t),qt(t),Xc(t,_,e,n,i)),null;case 27:if(Ae(t),i=xe.current,_=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Ss(t);else{if(!n){if(t.stateNode===null)throw Error(S(166));return qt(t),null}e=ne.current,Wn(t)?Nd(t):(e=hm(_,n,i),t.stateNode=e,Ss(t))}return qt(t),null;case 5:if(Ae(t),_=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Ss(t);else{if(!n){if(t.stateNode===null)throw Error(S(166));return qt(t),null}if(x=ne.current,Wn(t))Nd(t);else{var N=za(xe.current);switch(x){case 1:x=N.createElementNS("http://www.w3.org/2000/svg",_);break;case 2:x=N.createElementNS("http://www.w3.org/1998/Math/MathML",_);break;default:switch(_){case"svg":x=N.createElementNS("http://www.w3.org/2000/svg",_);break;case"math":x=N.createElementNS("http://www.w3.org/1998/Math/MathML",_);break;case"script":x=N.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof n.is=="string"?N.createElement("select",{is:n.is}):N.createElement("select"),n.multiple?x.multiple=!0:n.size&&(x.size=n.size);break;default:x=typeof n.is=="string"?N.createElement(_,{is:n.is}):N.createElement(_)}}x[fe]=t,x[Ve]=n;e:for(N=t.child;N!==null;){if(N.tag===5||N.tag===6)x.appendChild(N.stateNode);else if(N.tag!==4&&N.tag!==27&&N.child!==null){N.child.return=N,N=N.child;continue}if(N===t)break e;for(;N.sibling===null;){if(N.return===null||N.return===t)break e;N=N.return}N.sibling.return=N.return,N=N.sibling}t.stateNode=x;e:switch(fi(x,_,n),_){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&Ss(t)}}return qt(t),Xc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&Ss(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(S(166));if(e=xe.current,Wn(t)){if(e=t.stateNode,i=t.memoizedProps,n=null,_=ui,_!==null)switch(_.tag){case 27:case 5:n=_.memoizedProps}e[fe]=t,e=!!(e.nodeValue===i||n!==null&&n.suppressHydrationWarning===!0||em(e.nodeValue,i)),e||Ns(t,!0)}else e=za(e).createTextNode(n),e[fe]=t,t.stateNode=e}return qt(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(n=Wn(t),i!==null){if(e===null){if(!n)throw Error(S(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(S(557));e[fe]=t}else gn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;qt(t),e=!1}else i=rc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(ji(t),t):(ji(t),null);if((t.flags&128)!==0)throw Error(S(558))}return qt(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(_=Wn(t),n!==null&&n.dehydrated!==null){if(e===null){if(!_)throw Error(S(318));if(_=t.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(S(317));_[fe]=t}else gn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;qt(t),_=!1}else _=rc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=_),_=!0;if(!_)return t.flags&256?(ji(t),t):(ji(t),null)}return ji(t),(t.flags&128)!==0?(t.lanes=i,t):(i=n!==null,e=e!==null&&e.memoizedState!==null,i&&(n=t.child,_=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(_=n.alternate.memoizedState.cachePool.pool),x=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(x=n.memoizedState.cachePool.pool),x!==_&&(n.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),Sa(t,t.updateQueue),qt(t),null);case 4:return de(),e===null&&vu(t.stateNode.containerInfo),qt(t),null;case 10:return _s(t.type),qt(t),null;case 19:if(W(Qt),n=t.memoizedState,n===null)return qt(t),null;if(_=(t.flags&128)!==0,x=n.rendering,x===null)if(_)Jr(n,!1);else{if(Xt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(x=ca(e),x!==null){for(t.flags|=128,Jr(n,!1),e=x.updateQueue,t.updateQueue=e,Sa(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)Md(i,e),i=i.sibling;return Z(Qt,Qt.current&1|2),Et&&gs(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&$e()>La&&(t.flags|=128,_=!0,Jr(n,!1),t.lanes=4194304)}else{if(!_)if(e=ca(x),e!==null){if(t.flags|=128,_=!0,e=e.updateQueue,t.updateQueue=e,Sa(t,e),Jr(n,!0),n.tail===null&&n.tailMode==="hidden"&&!x.alternate&&!Et)return qt(t),null}else 2*$e()-n.renderingStartTime>La&&i!==536870912&&(t.flags|=128,_=!0,Jr(n,!1),t.lanes=4194304);n.isBackwards?(x.sibling=t.child,t.child=x):(e=n.last,e!==null?e.sibling=x:t.child=x,n.last=x)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=$e(),e.sibling=null,i=Qt.current,Z(Qt,_?i&1|2:i&1),Et&&gs(t,n.treeForkCount),e):(qt(t),null);case 22:case 23:return ji(t),_c(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(i&536870912)!==0&&(t.flags&128)===0&&(qt(t),t.subtreeFlags&6&&(t.flags|=8192)):qt(t),i=t.updateQueue,i!==null&&Sa(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==i&&(t.flags|=2048),e!==null&&W(bn),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),_s(ti),qt(t),null;case 25:return null;case 30:return null}throw Error(S(156,t.tag))}function P0(e,t){switch(sc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return _s(ti),de(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ae(t),null;case 31:if(t.memoizedState!==null){if(ji(t),t.alternate===null)throw Error(S(340));gn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ji(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(S(340));gn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return W(Qt),null;case 4:return de(),null;case 10:return _s(t.type),null;case 22:case 23:return ji(t),_c(),e!==null&&W(bn),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return _s(ti),null;case 25:return null;default:return null}}function rp(e,t){switch(sc(t),t.tag){case 3:_s(ti),de();break;case 26:case 27:case 5:Ae(t);break;case 4:de();break;case 31:t.memoizedState!==null&&ji(t);break;case 13:ji(t);break;case 19:W(Qt);break;case 10:_s(t.type);break;case 22:case 23:ji(t),_c(),e!==null&&W(bn);break;case 24:_s(ti)}}function Qr(e,t){try{var i=t.updateQueue,n=i!==null?i.lastEffect:null;if(n!==null){var _=n.next;i=_;do{if((i.tag&e)===e){n=void 0;var x=i.create,N=i.inst;n=x(),N.destroy=n}i=i.next}while(i!==_)}}catch(q){Bt(t,t.return,q)}}function $s(e,t,i){try{var n=t.updateQueue,_=n!==null?n.lastEffect:null;if(_!==null){var x=_.next;n=x;do{if((n.tag&e)===e){var N=n.inst,q=N.destroy;if(q!==void 0){N.destroy=void 0,_=t;var te=i,me=q;try{me()}catch(Le){Bt(_,te,Le)}}}n=n.next}while(n!==x)}}catch(Le){Bt(t,t.return,Le)}}function op(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{Xd(t,i)}catch(n){Bt(e,e.return,n)}}}function ap(e,t,i){i.props=Cn(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(n){Bt(e,t,n)}}function Zr(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof i=="function"?e.refCleanup=i(n):i.current=n}}catch(_){Bt(e,t,_)}}function ls(e,t){var i=e.ref,n=e.refCleanup;if(i!==null)if(typeof n=="function")try{n()}catch(_){Bt(e,t,_)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(_){Bt(e,t,_)}else i.current=null}function lp(e){var t=e.type,i=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&n.focus();break e;case"img":i.src?n.src=i.src:i.srcSet&&(n.srcset=i.srcSet)}}catch(_){Bt(e,e.return,_)}}function Vc(e,t,i){try{var n=e.stateNode;ab(n,e.type,i,t),n[Ve]=t}catch(_){Bt(e,e.return,_)}}function cp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Vs(e.type)||e.tag===4}function Jc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||cp(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Vs(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Qc(e,t,i){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(e,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(e),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=fs));else if(n!==4&&(n===27&&Vs(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(Qc(e,t,i),e=e.sibling;e!==null;)Qc(e,t,i),e=e.sibling}function xa(e,t,i){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(n!==4&&(n===27&&Vs(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(xa(e,t,i),e=e.sibling;e!==null;)xa(e,t,i),e=e.sibling}function up(e){var t=e.stateNode,i=e.memoizedProps;try{for(var n=e.type,_=t.attributes;_.length;)t.removeAttributeNode(_[0]);fi(t,n,i),t[fe]=e,t[Ve]=i}catch(x){Bt(e,e.return,x)}}var xs=!1,ni=!1,Zc=!1,hp=typeof WeakSet=="function"?WeakSet:Set,ai=null;function I0(e,t){if(e=e.containerInfo,yu=Wa,e=Sd(e),Gl(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var n=i.getSelection&&i.getSelection();if(n&&n.rangeCount!==0){i=n.anchorNode;var _=n.anchorOffset,x=n.focusNode;n=n.focusOffset;try{i.nodeType,x.nodeType}catch{i=null;break e}var N=0,q=-1,te=-1,me=0,Le=0,De=e,ve=null;t:for(;;){for(var we;De!==i||_!==0&&De.nodeType!==3||(q=N+_),De!==x||n!==0&&De.nodeType!==3||(te=N+n),De.nodeType===3&&(N+=De.nodeValue.length),(we=De.firstChild)!==null;)ve=De,De=we;for(;;){if(De===e)break t;if(ve===i&&++me===_&&(q=N),ve===x&&++Le===n&&(te=N),(we=De.nextSibling)!==null)break;De=ve,ve=De.parentNode}De=we}i=q===-1||te===-1?null:{start:q,end:te}}else i=null}i=i||{start:0,end:0}}else i=null;for(wu={focusedElem:e,selectionRange:i},Wa=!1,ai=t;ai!==null;)if(t=ai,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ai=e;else for(;ai!==null;){switch(t=ai,x=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(i=0;i<e.length;i++)_=e[i],_.ref.impl=_.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&x!==null){e=void 0,i=t,_=x.memoizedProps,x=x.memoizedState,n=i.stateNode;try{var Ke=Cn(i.type,_);e=n.getSnapshotBeforeUpdate(Ke,x),n.__reactInternalSnapshotBeforeUpdate=e}catch(at){Bt(i,i.return,at)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)Cu(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Cu(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(S(163))}if(e=t.sibling,e!==null){e.return=t.return,ai=e;break}ai=t.return}}function dp(e,t,i){var n=i.flags;switch(i.tag){case 0:case 11:case 15:ks(e,i),n&4&&Qr(5,i);break;case 1:if(ks(e,i),n&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(N){Bt(i,i.return,N)}else{var _=Cn(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(_,t,e.__reactInternalSnapshotBeforeUpdate)}catch(N){Bt(i,i.return,N)}}n&64&&op(i),n&512&&Zr(i,i.return);break;case 3:if(ks(e,i),n&64&&(e=i.updateQueue,e!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=i.child.stateNode;break;case 1:t=i.child.stateNode}try{Xd(e,t)}catch(N){Bt(i,i.return,N)}}break;case 27:t===null&&n&4&&up(i);case 26:case 5:ks(e,i),t===null&&n&4&&lp(i),n&512&&Zr(i,i.return);break;case 12:ks(e,i);break;case 31:ks(e,i),n&4&&mp(e,i);break;case 13:ks(e,i),n&4&&gp(e,i),n&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=X0.bind(null,i),mb(e,i))));break;case 22:if(n=i.memoizedState!==null||xs,!n){t=t!==null&&t.memoizedState!==null||ni,_=xs;var x=ni;xs=n,(ni=t)&&!x?Es(e,i,(i.subtreeFlags&8772)!==0):ks(e,i),xs=_,ni=x}break;case 30:break;default:ks(e,i)}}function fp(e){var t=e.alternate;t!==null&&(e.alternate=null,fp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&li(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Gt=null,wi=!1;function Cs(e,t,i){for(i=i.child;i!==null;)pp(e,t,i),i=i.sibling}function pp(e,t,i){if(ee&&typeof ee.onCommitFiberUnmount=="function")try{ee.onCommitFiberUnmount(ue,i)}catch{}switch(i.tag){case 26:ni||ls(i,t),Cs(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:ni||ls(i,t);var n=Gt,_=wi;Vs(i.type)&&(Gt=i.stateNode,wi=!1),Cs(e,t,i),lo(i.stateNode),Gt=n,wi=_;break;case 5:ni||ls(i,t);case 6:if(n=Gt,_=wi,Gt=null,Cs(e,t,i),Gt=n,wi=_,Gt!==null)if(wi)try{(Gt.nodeType===9?Gt.body:Gt.nodeName==="HTML"?Gt.ownerDocument.body:Gt).removeChild(i.stateNode)}catch(x){Bt(i,t,x)}else try{Gt.removeChild(i.stateNode)}catch(x){Bt(i,t,x)}break;case 18:Gt!==null&&(wi?(e=Gt,om(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),hr(e)):om(Gt,i.stateNode));break;case 4:n=Gt,_=wi,Gt=i.stateNode.containerInfo,wi=!0,Cs(e,t,i),Gt=n,wi=_;break;case 0:case 11:case 14:case 15:$s(2,i,t),ni||$s(4,i,t),Cs(e,t,i);break;case 1:ni||(ls(i,t),n=i.stateNode,typeof n.componentWillUnmount=="function"&&ap(i,t,n)),Cs(e,t,i);break;case 21:Cs(e,t,i);break;case 22:ni=(n=ni)||i.memoizedState!==null,Cs(e,t,i),ni=n;break;default:Cs(e,t,i)}}function mp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{hr(e)}catch(i){Bt(t,t.return,i)}}}function gp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{hr(e)}catch(i){Bt(t,t.return,i)}}function F0(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new hp),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new hp),t;default:throw Error(S(435,e.tag))}}function Ca(e,t){var i=F0(e);t.forEach(function(n){if(!i.has(n)){i.add(n);var _=V0.bind(null,e,n);n.then(_,_)}})}function Si(e,t){var i=t.deletions;if(i!==null)for(var n=0;n<i.length;n++){var _=i[n],x=e,N=t,q=N;e:for(;q!==null;){switch(q.tag){case 27:if(Vs(q.type)){Gt=q.stateNode,wi=!1;break e}break;case 5:Gt=q.stateNode,wi=!1;break e;case 3:case 4:Gt=q.stateNode.containerInfo,wi=!0;break e}q=q.return}if(Gt===null)throw Error(S(160));pp(x,N,_),Gt=null,wi=!1,x=_.alternate,x!==null&&(x.return=null),_.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)vp(t,e),t=t.sibling}var Ji=null;function vp(e,t){var i=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Si(t,e),xi(e),n&4&&($s(3,e,e.return),Qr(3,e),$s(5,e,e.return));break;case 1:Si(t,e),xi(e),n&512&&(ni||i===null||ls(i,i.return)),n&64&&xs&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?n:i.concat(n))));break;case 26:var _=Ji;if(Si(t,e),xi(e),n&512&&(ni||i===null||ls(i,i.return)),n&4){var x=i!==null?i.memoizedState:null;if(n=e.memoizedState,i===null)if(n===null)if(e.stateNode===null){e:{n=e.type,i=e.memoizedProps,_=_.ownerDocument||_;t:switch(n){case"title":x=_.getElementsByTagName("title")[0],(!x||x[$t]||x[fe]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=_.createElement(n),_.head.insertBefore(x,_.querySelector("head > title"))),fi(x,n,i),x[fe]=e,Lt(x),n=x;break e;case"link":var N=vm("link","href",_).get(n+(i.href||""));if(N){for(var q=0;q<N.length;q++)if(x=N[q],x.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&x.getAttribute("rel")===(i.rel==null?null:i.rel)&&x.getAttribute("title")===(i.title==null?null:i.title)&&x.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){N.splice(q,1);break t}}x=_.createElement(n),fi(x,n,i),_.head.appendChild(x);break;case"meta":if(N=vm("meta","content",_).get(n+(i.content||""))){for(q=0;q<N.length;q++)if(x=N[q],x.getAttribute("content")===(i.content==null?null:""+i.content)&&x.getAttribute("name")===(i.name==null?null:i.name)&&x.getAttribute("property")===(i.property==null?null:i.property)&&x.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&x.getAttribute("charset")===(i.charSet==null?null:i.charSet)){N.splice(q,1);break t}}x=_.createElement(n),fi(x,n,i),_.head.appendChild(x);break;default:throw Error(S(468,n))}x[fe]=e,Lt(x),n=x}e.stateNode=n}else _m(_,e.type,e.stateNode);else e.stateNode=gm(_,n,e.memoizedProps);else x!==n?(x===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):x.count--,n===null?_m(_,e.type,e.stateNode):gm(_,n,e.memoizedProps)):n===null&&e.stateNode!==null&&Vc(e,e.memoizedProps,i.memoizedProps)}break;case 27:Si(t,e),xi(e),n&512&&(ni||i===null||ls(i,i.return)),i!==null&&n&4&&Vc(e,e.memoizedProps,i.memoizedProps);break;case 5:if(Si(t,e),xi(e),n&512&&(ni||i===null||ls(i,i.return)),e.flags&32){_=e.stateNode;try{On(_,"")}catch(Ke){Bt(e,e.return,Ke)}}n&4&&e.stateNode!=null&&(_=e.memoizedProps,Vc(e,_,i!==null?i.memoizedProps:_)),n&1024&&(Zc=!0);break;case 6:if(Si(t,e),xi(e),n&4){if(e.stateNode===null)throw Error(S(162));n=e.memoizedProps,i=e.stateNode;try{i.nodeValue=n}catch(Ke){Bt(e,e.return,Ke)}}break;case 3:if(Ia=null,_=Ji,Ji=Ha(t.containerInfo),Si(t,e),Ji=_,xi(e),n&4&&i!==null&&i.memoizedState.isDehydrated)try{hr(t.containerInfo)}catch(Ke){Bt(e,e.return,Ke)}Zc&&(Zc=!1,_p(e));break;case 4:n=Ji,Ji=Ha(e.stateNode.containerInfo),Si(t,e),xi(e),Ji=n;break;case 12:Si(t,e),xi(e);break;case 31:Si(t,e),xi(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Ca(e,n)));break;case 13:Si(t,e),xi(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Ea=$e()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Ca(e,n)));break;case 22:_=e.memoizedState!==null;var te=i!==null&&i.memoizedState!==null,me=xs,Le=ni;if(xs=me||_,ni=Le||te,Si(t,e),ni=Le,xs=me,xi(e),n&8192)e:for(t=e.stateNode,t._visibility=_?t._visibility&-2:t._visibility|1,_&&(i===null||te||xs||ni||kn(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){te=i=t;try{if(x=te.stateNode,_)N=x.style,typeof N.setProperty=="function"?N.setProperty("display","none","important"):N.display="none";else{q=te.stateNode;var De=te.memoizedProps.style,ve=De!=null&&De.hasOwnProperty("display")?De.display:null;q.style.display=ve==null||typeof ve=="boolean"?"":(""+ve).trim()}}catch(Ke){Bt(te,te.return,Ke)}}}else if(t.tag===6){if(i===null){te=t;try{te.stateNode.nodeValue=_?"":te.memoizedProps}catch(Ke){Bt(te,te.return,Ke)}}}else if(t.tag===18){if(i===null){te=t;try{var we=te.stateNode;_?am(we,!0):am(te.stateNode,!1)}catch(Ke){Bt(te,te.return,Ke)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;i===t&&(i=null),t=t.return}i===t&&(i=null),t.sibling.return=t.return,t=t.sibling}n&4&&(n=e.updateQueue,n!==null&&(i=n.retryQueue,i!==null&&(n.retryQueue=null,Ca(e,i))));break;case 19:Si(t,e),xi(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Ca(e,n)));break;case 30:break;case 21:break;default:Si(t,e),xi(e)}}function xi(e){var t=e.flags;if(t&2){try{for(var i,n=e.return;n!==null;){if(cp(n)){i=n;break}n=n.return}if(i==null)throw Error(S(160));switch(i.tag){case 27:var _=i.stateNode,x=Jc(e);xa(e,x,_);break;case 5:var N=i.stateNode;i.flags&32&&(On(N,""),i.flags&=-33);var q=Jc(e);xa(e,q,N);break;case 3:case 4:var te=i.stateNode.containerInfo,me=Jc(e);Qc(e,me,te);break;default:throw Error(S(161))}}catch(Le){Bt(e,e.return,Le)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function _p(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;_p(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ks(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)dp(e,t.alternate,t),t=t.sibling}function kn(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:$s(4,t,t.return),kn(t);break;case 1:ls(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&ap(t,t.return,i),kn(t);break;case 27:lo(t.stateNode);case 26:case 5:ls(t,t.return),kn(t);break;case 22:t.memoizedState===null&&kn(t);break;case 30:kn(t);break;default:kn(t)}e=e.sibling}}function Es(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,_=e,x=t,N=x.flags;switch(x.tag){case 0:case 11:case 15:Es(_,x,i),Qr(4,x);break;case 1:if(Es(_,x,i),n=x,_=n.stateNode,typeof _.componentDidMount=="function")try{_.componentDidMount()}catch(me){Bt(n,n.return,me)}if(n=x,_=n.updateQueue,_!==null){var q=n.stateNode;try{var te=_.shared.hiddenCallbacks;if(te!==null)for(_.shared.hiddenCallbacks=null,_=0;_<te.length;_++)Kd(te[_],q)}catch(me){Bt(n,n.return,me)}}i&&N&64&&op(x),Zr(x,x.return);break;case 27:up(x);case 26:case 5:Es(_,x,i),i&&n===null&&N&4&&lp(x),Zr(x,x.return);break;case 12:Es(_,x,i);break;case 31:Es(_,x,i),i&&N&4&&mp(_,x);break;case 13:Es(_,x,i),i&&N&4&&gp(_,x);break;case 22:x.memoizedState===null&&Es(_,x,i),Zr(x,x.return);break;case 30:break;default:Es(_,x,i)}t=t.sibling}}function eu(e,t){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&Pr(i))}function tu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Pr(e))}function Qi(e,t,i,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)bp(e,t,i,n),t=t.sibling}function bp(e,t,i,n){var _=t.flags;switch(t.tag){case 0:case 11:case 15:Qi(e,t,i,n),_&2048&&Qr(9,t);break;case 1:Qi(e,t,i,n);break;case 3:Qi(e,t,i,n),_&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Pr(e)));break;case 12:if(_&2048){Qi(e,t,i,n),e=t.stateNode;try{var x=t.memoizedProps,N=x.id,q=x.onPostCommit;typeof q=="function"&&q(N,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(te){Bt(t,t.return,te)}}else Qi(e,t,i,n);break;case 31:Qi(e,t,i,n);break;case 13:Qi(e,t,i,n);break;case 23:break;case 22:x=t.stateNode,N=t.alternate,t.memoizedState!==null?x._visibility&2?Qi(e,t,i,n):eo(e,t):x._visibility&2?Qi(e,t,i,n):(x._visibility|=2,er(e,t,i,n,(t.subtreeFlags&10256)!==0||!1)),_&2048&&eu(N,t);break;case 24:Qi(e,t,i,n),_&2048&&tu(t.alternate,t);break;default:Qi(e,t,i,n)}}function er(e,t,i,n,_){for(_=_&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var x=e,N=t,q=i,te=n,me=N.flags;switch(N.tag){case 0:case 11:case 15:er(x,N,q,te,_),Qr(8,N);break;case 23:break;case 22:var Le=N.stateNode;N.memoizedState!==null?Le._visibility&2?er(x,N,q,te,_):eo(x,N):(Le._visibility|=2,er(x,N,q,te,_)),_&&me&2048&&eu(N.alternate,N);break;case 24:er(x,N,q,te,_),_&&me&2048&&tu(N.alternate,N);break;default:er(x,N,q,te,_)}t=t.sibling}}function eo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,n=t,_=n.flags;switch(n.tag){case 22:eo(i,n),_&2048&&eu(n.alternate,n);break;case 24:eo(i,n),_&2048&&tu(n.alternate,n);break;default:eo(i,n)}t=t.sibling}}var to=8192;function tr(e,t,i){if(e.subtreeFlags&to)for(e=e.child;e!==null;)yp(e,t,i),e=e.sibling}function yp(e,t,i){switch(e.tag){case 26:tr(e,t,i),e.flags&to&&e.memoizedState!==null&&Lb(i,Ji,e.memoizedState,e.memoizedProps);break;case 5:tr(e,t,i);break;case 3:case 4:var n=Ji;Ji=Ha(e.stateNode.containerInfo),tr(e,t,i),Ji=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=to,to=16777216,tr(e,t,i),to=n):tr(e,t,i));break;default:tr(e,t,i)}}function wp(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function io(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var n=t[i];ai=n,xp(n,e)}wp(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Sp(e),e=e.sibling}function Sp(e){switch(e.tag){case 0:case 11:case 15:io(e),e.flags&2048&&$s(9,e,e.return);break;case 3:io(e);break;case 12:io(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ka(e)):io(e);break;default:io(e)}}function ka(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var n=t[i];ai=n,xp(n,e)}wp(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:$s(8,t,t.return),ka(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,ka(t));break;default:ka(t)}e=e.sibling}}function xp(e,t){for(;ai!==null;){var i=ai;switch(i.tag){case 0:case 11:case 15:$s(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var n=i.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:Pr(i.memoizedState.cache)}if(n=i.child,n!==null)n.return=i,ai=n;else e:for(i=e;ai!==null;){n=ai;var _=n.sibling,x=n.return;if(fp(n),n===i){ai=null;break e}if(_!==null){_.return=x,ai=_;break e}ai=x}}}var U0={getCacheForType:function(e){var t=hi(ti),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return hi(ti).controller.signal}},$0=typeof WeakMap=="function"?WeakMap:Map,Mt=0,It=null,yt=null,xt=0,Ot=0,Oi=null,Ws=!1,ir=!1,iu=!1,Ls=0,Xt=0,qs=0,En=0,su=0,Bi=0,sr=0,so=null,Ci=null,nu=!1,Ea=0,Cp=0,La=1/0,Ra=null,Gs=null,ri=0,Ys=null,nr=null,Rs=0,ru=0,ou=null,kp=null,no=0,au=null;function Ni(){return(Mt&2)!==0&&xt!==0?xt&-xt:Y.T!==null?fu():Vt()}function Ep(){if(Bi===0)if((xt&536870912)===0||Et){var e=V;V<<=1,(V&3932160)===0&&(V=262144),Bi=e}else Bi=536870912;return e=Ai.current,e!==null&&(e.flags|=32),Bi}function ki(e,t,i){(e===It&&(Ot===2||Ot===9)||e.cancelPendingCommit!==null)&&(rr(e,0),Ks(e,xt,Bi,!1)),Ue(e,i),((Mt&2)===0||e!==It)&&(e===It&&((Mt&2)===0&&(En|=i),Xt===4&&Ks(e,xt,Bi,!1)),cs(e))}function Lp(e,t,i){if((Mt&6)!==0)throw Error(S(327));var n=!i&&(t&127)===0&&(t&e.expiredLanes)===0||ce(e,t),_=n?G0(e,t):cu(e,t,!0),x=n;do{if(_===0){ir&&!n&&Ks(e,t,0,!1);break}else{if(i=e.current.alternate,x&&!W0(i)){_=cu(e,t,!1),x=!1;continue}if(_===2){if(x=t,e.errorRecoveryDisabledLanes&x)var N=0;else N=e.pendingLanes&-536870913,N=N!==0?N:N&536870912?536870912:0;if(N!==0){t=N;e:{var q=e;_=so;var te=q.current.memoizedState.isDehydrated;if(te&&(rr(q,N).flags|=256),N=cu(q,N,!1),N!==2){if(iu&&!te){q.errorRecoveryDisabledLanes|=x,En|=x,_=4;break e}x=Ci,Ci=_,x!==null&&(Ci===null?Ci=x:Ci.push.apply(Ci,x))}_=N}if(x=!1,_!==2)continue}}if(_===1){rr(e,0),Ks(e,t,0,!0);break}e:{switch(n=e,x=_,x){case 0:case 1:throw Error(S(345));case 4:if((t&4194048)!==t)break;case 6:Ks(n,t,Bi,!Ws);break e;case 2:Ci=null;break;case 3:case 5:break;default:throw Error(S(329))}if((t&62914560)===t&&(_=Ea+300-$e(),10<_)){if(Ks(n,t,Bi,!Ws),ke(n,0,!0)!==0)break e;Rs=t,n.timeoutHandle=nm(Rp.bind(null,n,i,Ci,Ra,nu,t,Bi,En,sr,Ws,x,"Throttled",-0,0),_);break e}Rp(n,i,Ci,Ra,nu,t,Bi,En,sr,Ws,x,null,-0,0)}}break}while(!0);cs(e)}function Rp(e,t,i,n,_,x,N,q,te,me,Le,De,ve,we){if(e.timeoutHandle=-1,De=t.subtreeFlags,De&8192||(De&16785408)===16785408){De={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:fs},yp(t,x,De);var Ke=(x&62914560)===x?Ea-$e():(x&4194048)===x?Cp-$e():0;if(Ke=Rb(De,Ke),Ke!==null){Rs=x,e.cancelPendingCommit=Ke(Np.bind(null,e,t,x,i,n,_,N,q,te,Le,De,null,ve,we)),Ks(e,x,N,!me);return}}Np(e,t,x,i,n,_,N,q,te)}function W0(e){for(var t=e;;){var i=t.tag;if((i===0||i===11||i===15)&&t.flags&16384&&(i=t.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var n=0;n<i.length;n++){var _=i[n],x=_.getSnapshot;_=_.value;try{if(!Ti(x(),_))return!1}catch{return!1}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ks(e,t,i,n){t&=~su,t&=~En,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var _=t;0<_;){var x=31-he(_),N=1<<x;n[x]=-1,_&=~N}i!==0&&Ye(e,i,t)}function Da(){return(Mt&6)===0?(ro(0),!1):!0}function lu(){if(yt!==null){if(Ot===0)var e=yt.return;else e=yt,vs=vn=null,Cc(e),Xn=null,Fr=0,e=yt;for(;e!==null;)rp(e.alternate,e),e=e.return;yt=null}}function rr(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,ub(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),Rs=0,lu(),It=e,yt=i=ms(e.current,null),xt=t,Ot=0,Oi=null,Ws=!1,ir=ce(e,t),iu=!1,sr=Bi=su=En=qs=Xt=0,Ci=so=null,nu=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var _=31-he(n),x=1<<_;t|=e[_],n&=~x}return Ls=t,Vo(),i}function Dp(e,t){pt=null,Y.H=Xr,t===Kn||t===na?(t=Wd(),Ot=3):t===dc?(t=Wd(),Ot=4):Ot=t===Ic?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Oi=t,yt===null&&(Xt=1,_a(e,Fi(t,e.current)))}function Tp(){var e=Ai.current;return e===null?!0:(xt&4194048)===xt?qi===null:(xt&62914560)===xt||(xt&536870912)!==0?e===qi:!1}function Mp(){var e=Y.H;return Y.H=Xr,e===null?Xr:e}function Ap(){var e=Y.A;return Y.A=U0,e}function Ta(){Xt=4,Ws||(xt&4194048)!==xt&&Ai.current!==null||(ir=!0),(qs&134217727)===0&&(En&134217727)===0||It===null||Ks(It,xt,Bi,!1)}function cu(e,t,i){var n=Mt;Mt|=2;var _=Mp(),x=Ap();(It!==e||xt!==t)&&(Ra=null,rr(e,t)),t=!1;var N=Xt;e:do try{if(Ot!==0&&yt!==null){var q=yt,te=Oi;switch(Ot){case 8:lu(),N=6;break e;case 3:case 2:case 9:case 6:Ai.current===null&&(t=!0);var me=Ot;if(Ot=0,Oi=null,or(e,q,te,me),i&&ir){N=0;break e}break;default:me=Ot,Ot=0,Oi=null,or(e,q,te,me)}}q0(),N=Xt;break}catch(Le){Dp(e,Le)}while(!0);return t&&e.shellSuspendCounter++,vs=vn=null,Mt=n,Y.H=_,Y.A=x,yt===null&&(It=null,xt=0,Vo()),N}function q0(){for(;yt!==null;)jp(yt)}function G0(e,t){var i=Mt;Mt|=2;var n=Mp(),_=Ap();It!==e||xt!==t?(Ra=null,La=$e()+500,rr(e,t)):ir=ce(e,t);e:do try{if(Ot!==0&&yt!==null){t=yt;var x=Oi;t:switch(Ot){case 1:Ot=0,Oi=null,or(e,t,x,1);break;case 2:case 9:if(Ud(x)){Ot=0,Oi=null,Op(t);break}t=function(){Ot!==2&&Ot!==9||It!==e||(Ot=7),cs(e)},x.then(t,t);break e;case 3:Ot=7;break e;case 4:Ot=5;break e;case 7:Ud(x)?(Ot=0,Oi=null,Op(t)):(Ot=0,Oi=null,or(e,t,x,7));break;case 5:var N=null;switch(yt.tag){case 26:N=yt.memoizedState;case 5:case 27:var q=yt;if(N?bm(N):q.stateNode.complete){Ot=0,Oi=null;var te=q.sibling;if(te!==null)yt=te;else{var me=q.return;me!==null?(yt=me,Ma(me)):yt=null}break t}}Ot=0,Oi=null,or(e,t,x,5);break;case 6:Ot=0,Oi=null,or(e,t,x,6);break;case 8:lu(),Xt=6;break e;default:throw Error(S(462))}}Y0();break}catch(Le){Dp(e,Le)}while(!0);return vs=vn=null,Y.H=n,Y.A=_,Mt=i,yt!==null?0:(It=null,xt=0,Vo(),Xt)}function Y0(){for(;yt!==null&&!Fe();)jp(yt)}function jp(e){var t=sp(e.alternate,e,Ls);e.memoizedProps=e.pendingProps,t===null?Ma(e):yt=t}function Op(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=Jf(i,t,t.pendingProps,t.type,void 0,xt);break;case 11:t=Jf(i,t,t.pendingProps,t.type.render,t.ref,xt);break;case 5:Cc(t);default:rp(i,t),t=yt=Md(t,Ls),t=sp(i,t,Ls)}e.memoizedProps=e.pendingProps,t===null?Ma(e):yt=t}function or(e,t,i,n){vs=vn=null,Cc(t),Xn=null,Fr=0;var _=t.return;try{if(B0(e,_,t,i,xt)){Xt=1,_a(e,Fi(i,e.current)),yt=null;return}}catch(x){if(_!==null)throw yt=_,x;Xt=1,_a(e,Fi(i,e.current)),yt=null;return}t.flags&32768?(Et||n===1?e=!0:ir||(xt&536870912)!==0?e=!1:(Ws=e=!0,(n===2||n===9||n===3||n===6)&&(n=Ai.current,n!==null&&n.tag===13&&(n.flags|=16384))),Bp(t,e)):Ma(t)}function Ma(e){var t=e;do{if((t.flags&32768)!==0){Bp(t,Ws);return}e=t.return;var i=H0(t.alternate,t,Ls);if(i!==null){yt=i;return}if(t=t.sibling,t!==null){yt=t;return}yt=t=e}while(t!==null);Xt===0&&(Xt=5)}function Bp(e,t){do{var i=P0(e.alternate,e);if(i!==null){i.flags&=32767,yt=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){yt=e;return}yt=e=i}while(e!==null);Xt=6,yt=null}function Np(e,t,i,n,_,x,N,q,te){e.cancelPendingCommit=null;do Aa();while(ri!==0);if((Mt&6)!==0)throw Error(S(327));if(t!==null){if(t===e.current)throw Error(S(177));if(x=t.lanes|t.childLanes,x|=Jl,ot(e,i,x,N,q,te),e===It&&(yt=It=null,xt=0),nr=t,Ys=e,Rs=i,ru=x,ou=_,kp=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,J0(Se,function(){return Fp(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=Y.T,Y.T=null,_=$.p,$.p=2,N=Mt,Mt|=4;try{I0(e,t,i)}finally{Mt=N,$.p=_,Y.T=n}}ri=1,zp(),Hp(),Pp()}}function zp(){if(ri===1){ri=0;var e=Ys,t=nr,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=Y.T,Y.T=null;var n=$.p;$.p=2;var _=Mt;Mt|=4;try{vp(t,e);var x=wu,N=Sd(e.containerInfo),q=x.focusedElem,te=x.selectionRange;if(N!==q&&q&&q.ownerDocument&&wd(q.ownerDocument.documentElement,q)){if(te!==null&&Gl(q)){var me=te.start,Le=te.end;if(Le===void 0&&(Le=me),"selectionStart"in q)q.selectionStart=me,q.selectionEnd=Math.min(Le,q.value.length);else{var De=q.ownerDocument||document,ve=De&&De.defaultView||window;if(ve.getSelection){var we=ve.getSelection(),Ke=q.textContent.length,at=Math.min(te.start,Ke),Pt=te.end===void 0?at:Math.min(te.end,Ke);!we.extend&&at>Pt&&(N=Pt,Pt=at,at=N);var ae=yd(q,at),re=yd(q,Pt);if(ae&&re&&(we.rangeCount!==1||we.anchorNode!==ae.node||we.anchorOffset!==ae.offset||we.focusNode!==re.node||we.focusOffset!==re.offset)){var pe=De.createRange();pe.setStart(ae.node,ae.offset),we.removeAllRanges(),at>Pt?(we.addRange(pe),we.extend(re.node,re.offset)):(pe.setEnd(re.node,re.offset),we.addRange(pe))}}}}for(De=[],we=q;we=we.parentNode;)we.nodeType===1&&De.push({element:we,left:we.scrollLeft,top:we.scrollTop});for(typeof q.focus=="function"&&q.focus(),q=0;q<De.length;q++){var Re=De[q];Re.element.scrollLeft=Re.left,Re.element.scrollTop=Re.top}}Wa=!!yu,wu=yu=null}finally{Mt=_,$.p=n,Y.T=i}}e.current=t,ri=2}}function Hp(){if(ri===2){ri=0;var e=Ys,t=nr,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=Y.T,Y.T=null;var n=$.p;$.p=2;var _=Mt;Mt|=4;try{dp(e,t.alternate,t)}finally{Mt=_,$.p=n,Y.T=i}}ri=3}}function Pp(){if(ri===4||ri===3){ri=0,Be();var e=Ys,t=nr,i=Rs,n=kp;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?ri=5:(ri=0,nr=Ys=null,Ip(e,e.pendingLanes));var _=e.pendingLanes;if(_===0&&(Gs=null),vt(i),t=t.stateNode,ee&&typeof ee.onCommitFiberRoot=="function")try{ee.onCommitFiberRoot(ue,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=Y.T,_=$.p,$.p=2,Y.T=null;try{for(var x=e.onRecoverableError,N=0;N<n.length;N++){var q=n[N];x(q.value,{componentStack:q.stack})}}finally{Y.T=t,$.p=_}}(Rs&3)!==0&&Aa(),cs(e),_=e.pendingLanes,(i&261930)!==0&&(_&42)!==0?e===au?no++:(no=0,au=e):no=0,ro(0)}}function Ip(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Pr(t)))}function Aa(){return zp(),Hp(),Pp(),Fp()}function Fp(){if(ri!==5)return!1;var e=Ys,t=ru;ru=0;var i=vt(Rs),n=Y.T,_=$.p;try{$.p=32>i?32:i,Y.T=null,i=ou,ou=null;var x=Ys,N=Rs;if(ri=0,nr=Ys=null,Rs=0,(Mt&6)!==0)throw Error(S(331));var q=Mt;if(Mt|=4,Sp(x.current),bp(x,x.current,N,i),Mt=q,ro(0,!1),ee&&typeof ee.onPostCommitFiberRoot=="function")try{ee.onPostCommitFiberRoot(ue,x)}catch{}return!0}finally{$.p=_,Y.T=n,Ip(e,t)}}function Up(e,t,i){t=Fi(i,t),t=Pc(e.stateNode,t,2),e=Is(e,t,2),e!==null&&(Ue(e,2),cs(e))}function Bt(e,t,i){if(e.tag===3)Up(e,e,i);else for(;t!==null;){if(t.tag===3){Up(t,e,i);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Gs===null||!Gs.has(n))){e=Fi(i,e),i=$f(2),n=Is(t,i,2),n!==null&&(Wf(i,n,t,e),Ue(n,2),cs(n));break}}t=t.return}}function uu(e,t,i){var n=e.pingCache;if(n===null){n=e.pingCache=new $0;var _=new Set;n.set(t,_)}else _=n.get(t),_===void 0&&(_=new Set,n.set(t,_));_.has(i)||(iu=!0,_.add(i),e=K0.bind(null,e,t,i),t.then(e,e))}function K0(e,t,i){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,It===e&&(xt&i)===i&&(Xt===4||Xt===3&&(xt&62914560)===xt&&300>$e()-Ea?(Mt&2)===0&&rr(e,0):su|=i,sr===xt&&(sr=0)),cs(e)}function $p(e,t){t===0&&(t=Ee()),e=pn(e,t),e!==null&&(Ue(e,t),cs(e))}function X0(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),$p(e,i)}function V0(e,t){var i=0;switch(e.tag){case 31:case 13:var n=e.stateNode,_=e.memoizedState;_!==null&&(i=_.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(S(314))}n!==null&&n.delete(t),$p(e,i)}function J0(e,t){return ze(e,t)}var ja=null,ar=null,hu=!1,Oa=!1,du=!1,Xs=0;function cs(e){e!==ar&&e.next===null&&(ar===null?ja=ar=e:ar=ar.next=e),Oa=!0,hu||(hu=!0,Z0())}function ro(e,t){if(!du&&Oa){du=!0;do for(var i=!1,n=ja;n!==null;){if(e!==0){var _=n.pendingLanes;if(_===0)var x=0;else{var N=n.suspendedLanes,q=n.pingedLanes;x=(1<<31-he(42|e)+1)-1,x&=_&~(N&~q),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(i=!0,Yp(n,x))}else x=xt,x=ke(n,n===It?x:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(x&3)===0||ce(n,x)||(i=!0,Yp(n,x));n=n.next}while(i);du=!1}}function Q0(){Wp()}function Wp(){Oa=hu=!1;var e=0;Xs!==0&&cb()&&(e=Xs);for(var t=$e(),i=null,n=ja;n!==null;){var _=n.next,x=qp(n,t);x===0?(n.next=null,i===null?ja=_:i.next=_,_===null&&(ar=i)):(i=n,(e!==0||(x&3)!==0)&&(Oa=!0)),n=_}ri!==0&&ri!==5||ro(e),Xs!==0&&(Xs=0)}function qp(e,t){for(var i=e.suspendedLanes,n=e.pingedLanes,_=e.expirationTimes,x=e.pendingLanes&-62914561;0<x;){var N=31-he(x),q=1<<N,te=_[N];te===-1?((q&i)===0||(q&n)!==0)&&(_[N]=_e(q,t)):te<=t&&(e.expiredLanes|=q),x&=~q}if(t=It,i=xt,i=ke(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,i===0||e===t&&(Ot===2||Ot===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&qe(n),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||ce(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(n!==null&&qe(n),vt(i)){case 2:case 8:i=St;break;case 32:i=Se;break;case 268435456:i=le;break;default:i=Se}return n=Gp.bind(null,e),i=ze(i,n),e.callbackPriority=t,e.callbackNode=i,t}return n!==null&&n!==null&&qe(n),e.callbackPriority=2,e.callbackNode=null,2}function Gp(e,t){if(ri!==0&&ri!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(Aa()&&e.callbackNode!==i)return null;var n=xt;return n=ke(e,e===It?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(Lp(e,n,t),qp(e,$e()),e.callbackNode!=null&&e.callbackNode===i?Gp.bind(null,e):null)}function Yp(e,t){if(Aa())return null;Lp(e,t,!0)}function Z0(){hb(function(){(Mt&6)!==0?ze(st,Q0):Wp()})}function fu(){if(Xs===0){var e=Gn;e===0&&(e=se,se<<=1,(se&261888)===0&&(se=256)),Xs=e}return Xs}function Kp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Uo(""+e)}function Xp(e,t){var i=t.ownerDocument.createElement("input");return i.name=t.name,i.value=t.value,e.id&&i.setAttribute("form",e.id),t.parentNode.insertBefore(i,t),e=new FormData(e),i.parentNode.removeChild(i),e}function eb(e,t,i,n,_){if(t==="submit"&&i&&i.stateNode===_){var x=Kp((_[Ve]||null).action),N=n.submitter;N&&(t=(t=N[Ve]||null)?Kp(t.formAction):N.getAttribute("formAction"),t!==null&&(x=t,N=null));var q=new Go("action","action",null,n,_);e.push({event:q,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(Xs!==0){var te=N?Xp(_,N):new FormData(_);jc(i,{pending:!0,data:te,method:_.method,action:x},null,te)}}else typeof x=="function"&&(q.preventDefault(),te=N?Xp(_,N):new FormData(_),jc(i,{pending:!0,data:te,method:_.method,action:x},x,te))},currentTarget:_}]})}}for(var pu=0;pu<Vl.length;pu++){var mu=Vl[pu],tb=mu.toLowerCase(),ib=mu[0].toUpperCase()+mu.slice(1);Vi(tb,"on"+ib)}Vi(kd,"onAnimationEnd"),Vi(Ed,"onAnimationIteration"),Vi(Ld,"onAnimationStart"),Vi("dblclick","onDoubleClick"),Vi("focusin","onFocus"),Vi("focusout","onBlur"),Vi(_0,"onTransitionRun"),Vi(b0,"onTransitionStart"),Vi(y0,"onTransitionCancel"),Vi(Rd,"onTransitionEnd"),bi("onMouseEnter",["mouseout","mouseover"]),bi("onMouseLeave",["mouseout","mouseover"]),bi("onPointerEnter",["pointerout","pointerover"]),bi("onPointerLeave",["pointerout","pointerover"]),rs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),rs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),rs("onBeforeInput",["compositionend","keypress","textInput","paste"]),rs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),rs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),rs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var oo="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(" "),sb=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(oo));function Vp(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var n=e[i],_=n.event;n=n.listeners;e:{var x=void 0;if(t)for(var N=n.length-1;0<=N;N--){var q=n[N],te=q.instance,me=q.currentTarget;if(q=q.listener,te!==x&&_.isPropagationStopped())break e;x=q,_.currentTarget=me;try{x(_)}catch(Le){Xo(Le)}_.currentTarget=null,x=te}else for(N=0;N<n.length;N++){if(q=n[N],te=q.instance,me=q.currentTarget,q=q.listener,te!==x&&_.isPropagationStopped())break e;x=q,_.currentTarget=me;try{x(_)}catch(Le){Xo(Le)}_.currentTarget=null,x=te}}}}function wt(e,t){var i=t[At];i===void 0&&(i=t[At]=new Set);var n=e+"__bubble";i.has(n)||(Jp(t,e,2,!1),i.add(n))}function gu(e,t,i){var n=0;t&&(n|=4),Jp(i,e,n,t)}var Ba="_reactListening"+Math.random().toString(36).slice(2);function vu(e){if(!e[Ba]){e[Ba]=!0,Er.forEach(function(i){i!=="selectionchange"&&(sb.has(i)||gu(i,!1,e),gu(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ba]||(t[Ba]=!0,gu("selectionchange",!1,t))}}function Jp(e,t,i,n){switch(Em(t)){case 2:var _=Mb;break;case 8:_=Ab;break;default:_=Au}i=_.bind(null,t,i,e),_=void 0,!zl||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(_=!0),n?_!==void 0?e.addEventListener(t,i,{capture:!0,passive:_}):e.addEventListener(t,i,!0):_!==void 0?e.addEventListener(t,i,{passive:_}):e.addEventListener(t,i,!1)}function _u(e,t,i,n,_){var x=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var N=n.tag;if(N===3||N===4){var q=n.stateNode.containerInfo;if(q===_)break;if(N===4)for(N=n.return;N!==null;){var te=N.tag;if((te===3||te===4)&&N.stateNode.containerInfo===_)return;N=N.return}for(;q!==null;){if(N=mi(q),N===null)return;if(te=N.tag,te===5||te===6||te===26||te===27){n=x=N;continue e}q=q.parentNode}}n=n.return}td(function(){var me=x,Le=Bl(i),De=[];e:{var ve=Dd.get(e);if(ve!==void 0){var we=Go,Ke=e;switch(e){case"keypress":if(Wo(i)===0)break e;case"keydown":case"keyup":we=V_;break;case"focusin":Ke="focus",we=Fl;break;case"focusout":Ke="blur",we=Fl;break;case"beforeblur":case"afterblur":we=Fl;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":we=nd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":we=H_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":we=Z_;break;case kd:case Ed:case Ld:we=F_;break;case Rd:we=t0;break;case"scroll":case"scrollend":we=N_;break;case"wheel":we=s0;break;case"copy":case"cut":case"paste":we=$_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":we=od;break;case"toggle":case"beforetoggle":we=r0}var at=(t&4)!==0,Pt=!at&&(e==="scroll"||e==="scrollend"),ae=at?ve!==null?ve+"Capture":null:ve;at=[];for(var re=me,pe;re!==null;){var Re=re;if(pe=Re.stateNode,Re=Re.tag,Re!==5&&Re!==26&&Re!==27||pe===null||ae===null||(Re=Rr(re,ae),Re!=null&&at.push(ao(re,Re,pe))),Pt)break;re=re.return}0<at.length&&(ve=new we(ve,Ke,null,i,Le),De.push({event:ve,listeners:at}))}}if((t&7)===0){e:{if(ve=e==="mouseover"||e==="pointerover",we=e==="mouseout"||e==="pointerout",ve&&i!==Ol&&(Ke=i.relatedTarget||i.fromElement)&&(mi(Ke)||Ke[ht]))break e;if((we||ve)&&(ve=Le.window===Le?Le:(ve=Le.ownerDocument)?ve.defaultView||ve.parentWindow:window,we?(Ke=i.relatedTarget||i.toElement,we=me,Ke=Ke?mi(Ke):null,Ke!==null&&(Pt=O(Ke),at=Ke.tag,Ke!==Pt||at!==5&&at!==27&&at!==6)&&(Ke=null)):(we=null,Ke=me),we!==Ke)){if(at=nd,Re="onMouseLeave",ae="onMouseEnter",re="mouse",(e==="pointerout"||e==="pointerover")&&(at=od,Re="onPointerLeave",ae="onPointerEnter",re="pointer"),Pt=we==null?ve:ns(we),pe=Ke==null?ve:ns(Ke),ve=new at(Re,re+"leave",we,i,Le),ve.target=Pt,ve.relatedTarget=pe,Re=null,mi(Le)===me&&(at=new at(ae,re+"enter",Ke,i,Le),at.target=pe,at.relatedTarget=Pt,Re=at),Pt=Re,we&&Ke)t:{for(at=nb,ae=we,re=Ke,pe=0,Re=ae;Re;Re=at(Re))pe++;Re=0;for(var et=re;et;et=at(et))Re++;for(;0<pe-Re;)ae=at(ae),pe--;for(;0<Re-pe;)re=at(re),Re--;for(;pe--;){if(ae===re||re!==null&&ae===re.alternate){at=ae;break t}ae=at(ae),re=at(re)}at=null}else at=null;we!==null&&Qp(De,ve,we,at,!1),Ke!==null&&Pt!==null&&Qp(De,Pt,Ke,at,!0)}}e:{if(ve=me?ns(me):window,we=ve.nodeName&&ve.nodeName.toLowerCase(),we==="select"||we==="input"&&ve.type==="file")var Rt=pd;else if(dd(ve))if(md)Rt=m0;else{Rt=f0;var Je=d0}else we=ve.nodeName,!we||we.toLowerCase()!=="input"||ve.type!=="checkbox"&&ve.type!=="radio"?me&&jl(me.elementType)&&(Rt=pd):Rt=p0;if(Rt&&(Rt=Rt(e,me))){fd(De,Rt,i,Le);break e}Je&&Je(e,ve,me),e==="focusout"&&me&&ve.type==="number"&&me.memoizedProps.value!=null&&Al(ve,"number",ve.value)}switch(Je=me?ns(me):window,e){case"focusin":(dd(Je)||Je.contentEditable==="true")&&(Hn=Je,Yl=me,Nr=null);break;case"focusout":Nr=Yl=Hn=null;break;case"mousedown":Kl=!0;break;case"contextmenu":case"mouseup":case"dragend":Kl=!1,xd(De,i,Le);break;case"selectionchange":if(v0)break;case"keydown":case"keyup":xd(De,i,Le)}var mt;if($l)e:{switch(e){case"compositionstart":var Ct="onCompositionStart";break e;case"compositionend":Ct="onCompositionEnd";break e;case"compositionupdate":Ct="onCompositionUpdate";break e}Ct=void 0}else zn?ud(e,i)&&(Ct="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Ct="onCompositionStart");Ct&&(ad&&i.locale!=="ko"&&(zn||Ct!=="onCompositionStart"?Ct==="onCompositionEnd"&&zn&&(mt=id()):(js=Le,Hl="value"in js?js.value:js.textContent,zn=!0)),Je=Na(me,Ct),0<Je.length&&(Ct=new rd(Ct,e,null,i,Le),De.push({event:Ct,listeners:Je}),mt?Ct.data=mt:(mt=hd(i),mt!==null&&(Ct.data=mt)))),(mt=a0?l0(e,i):c0(e,i))&&(Ct=Na(me,"onBeforeInput"),0<Ct.length&&(Je=new rd("onBeforeInput","beforeinput",null,i,Le),De.push({event:Je,listeners:Ct}),Je.data=mt)),eb(De,e,me,i,Le)}Vp(De,t)})}function ao(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Na(e,t){for(var i=t+"Capture",n=[];e!==null;){var _=e,x=_.stateNode;if(_=_.tag,_!==5&&_!==26&&_!==27||x===null||(_=Rr(e,i),_!=null&&n.unshift(ao(e,_,x)),_=Rr(e,t),_!=null&&n.push(ao(e,_,x))),e.tag===3)return n;e=e.return}return[]}function nb(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Qp(e,t,i,n,_){for(var x=t._reactName,N=[];i!==null&&i!==n;){var q=i,te=q.alternate,me=q.stateNode;if(q=q.tag,te!==null&&te===n)break;q!==5&&q!==26&&q!==27||me===null||(te=me,_?(me=Rr(i,x),me!=null&&N.unshift(ao(i,me,te))):_||(me=Rr(i,x),me!=null&&N.push(ao(i,me,te)))),i=i.return}N.length!==0&&e.push({event:t,listeners:N})}var rb=/\r\n?/g,ob=/\u0000|\uFFFD/g;function Zp(e){return(typeof e=="string"?e:""+e).replace(rb,`
|
|
50
|
+
`).replace(ob,"")}function em(e,t){return t=Zp(t),Zp(e)===t}function Ht(e,t,i,n,_,x){switch(i){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||On(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&On(e,""+n);break;case"className":Io(e,"class",n);break;case"tabIndex":Io(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":Io(e,i,n);break;case"style":Zh(e,n,x);break;case"data":if(t!=="object"){Io(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(i);break}n=Uo(""+n),e.setAttribute(i,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(i,"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 x=="function"&&(i==="formAction"?(t!=="input"&&Ht(e,t,"name",_.name,_,null),Ht(e,t,"formEncType",_.formEncType,_,null),Ht(e,t,"formMethod",_.formMethod,_,null),Ht(e,t,"formTarget",_.formTarget,_,null)):(Ht(e,t,"encType",_.encType,_,null),Ht(e,t,"method",_.method,_,null),Ht(e,t,"target",_.target,_,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(i);break}n=Uo(""+n),e.setAttribute(i,n);break;case"onClick":n!=null&&(e.onclick=fs);break;case"onScroll":n!=null&&wt("scroll",e);break;case"onScrollEnd":n!=null&&wt("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(S(61));if(i=n.__html,i!=null){if(_.children!=null)throw Error(S(60));e.innerHTML=i}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}i=Uo(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(i,""+n):e.removeAttribute(i);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":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":n===!0?e.setAttribute(i,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(i,n):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(i,n):e.removeAttribute(i);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(i):e.setAttribute(i,n);break;case"popover":wt("beforetoggle",e),wt("toggle",e),Po(e,"popover",n);break;case"xlinkActuate":ds(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":ds(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":ds(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":ds(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":ds(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":ds(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":ds(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":ds(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":ds(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":Po(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=O_.get(i)||i,Po(e,i,n))}}function bu(e,t,i,n,_,x){switch(i){case"style":Zh(e,n,x);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(S(61));if(i=n.__html,i!=null){if(_.children!=null)throw Error(S(60));e.innerHTML=i}}break;case"children":typeof n=="string"?On(e,n):(typeof n=="number"||typeof n=="bigint")&&On(e,""+n);break;case"onScroll":n!=null&&wt("scroll",e);break;case"onScrollEnd":n!=null&&wt("scrollend",e);break;case"onClick":n!=null&&(e.onclick=fs);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Lr.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(_=i.endsWith("Capture"),t=i.slice(2,_?i.length-7:void 0),x=e[Ve]||null,x=x!=null?x[i]:null,typeof x=="function"&&e.removeEventListener(t,x,_),typeof n=="function")){typeof x!="function"&&x!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,n,_);break e}i in e?e[i]=n:n===!0?e.setAttribute(i,""):Po(e,i,n)}}}function fi(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":wt("error",e),wt("load",e);var n=!1,_=!1,x;for(x in i)if(i.hasOwnProperty(x)){var N=i[x];if(N!=null)switch(x){case"src":n=!0;break;case"srcSet":_=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(S(137,t));default:Ht(e,t,x,N,i,null)}}_&&Ht(e,t,"srcSet",i.srcSet,i,null),n&&Ht(e,t,"src",i.src,i,null);return;case"input":wt("invalid",e);var q=x=N=_=null,te=null,me=null;for(n in i)if(i.hasOwnProperty(n)){var Le=i[n];if(Le!=null)switch(n){case"name":_=Le;break;case"type":N=Le;break;case"checked":te=Le;break;case"defaultChecked":me=Le;break;case"value":x=Le;break;case"defaultValue":q=Le;break;case"children":case"dangerouslySetInnerHTML":if(Le!=null)throw Error(S(137,t));break;default:Ht(e,t,n,Le,i,null)}}Xh(e,x,q,te,me,N,_,!1);return;case"select":wt("invalid",e),n=N=x=null;for(_ in i)if(i.hasOwnProperty(_)&&(q=i[_],q!=null))switch(_){case"value":x=q;break;case"defaultValue":N=q;break;case"multiple":n=q;default:Ht(e,t,_,q,i,null)}t=x,i=N,e.multiple=!!n,t!=null?jn(e,!!n,t,!1):i!=null&&jn(e,!!n,i,!0);return;case"textarea":wt("invalid",e),x=_=n=null;for(N in i)if(i.hasOwnProperty(N)&&(q=i[N],q!=null))switch(N){case"value":n=q;break;case"defaultValue":_=q;break;case"children":x=q;break;case"dangerouslySetInnerHTML":if(q!=null)throw Error(S(91));break;default:Ht(e,t,N,q,i,null)}Jh(e,n,_,x);return;case"option":for(te in i)if(i.hasOwnProperty(te)&&(n=i[te],n!=null))switch(te){case"selected":e.selected=n&&typeof n!="function"&&typeof n!="symbol";break;default:Ht(e,t,te,n,i,null)}return;case"dialog":wt("beforetoggle",e),wt("toggle",e),wt("cancel",e),wt("close",e);break;case"iframe":case"object":wt("load",e);break;case"video":case"audio":for(n=0;n<oo.length;n++)wt(oo[n],e);break;case"image":wt("error",e),wt("load",e);break;case"details":wt("toggle",e);break;case"embed":case"source":case"link":wt("error",e),wt("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(me in i)if(i.hasOwnProperty(me)&&(n=i[me],n!=null))switch(me){case"children":case"dangerouslySetInnerHTML":throw Error(S(137,t));default:Ht(e,t,me,n,i,null)}return;default:if(jl(t)){for(Le in i)i.hasOwnProperty(Le)&&(n=i[Le],n!==void 0&&bu(e,t,Le,n,i,void 0));return}}for(q in i)i.hasOwnProperty(q)&&(n=i[q],n!=null&&Ht(e,t,q,n,i,null))}function ab(e,t,i,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var _=null,x=null,N=null,q=null,te=null,me=null,Le=null;for(we in i){var De=i[we];if(i.hasOwnProperty(we)&&De!=null)switch(we){case"checked":break;case"value":break;case"defaultValue":te=De;default:n.hasOwnProperty(we)||Ht(e,t,we,null,n,De)}}for(var ve in n){var we=n[ve];if(De=i[ve],n.hasOwnProperty(ve)&&(we!=null||De!=null))switch(ve){case"type":x=we;break;case"name":_=we;break;case"checked":me=we;break;case"defaultChecked":Le=we;break;case"value":N=we;break;case"defaultValue":q=we;break;case"children":case"dangerouslySetInnerHTML":if(we!=null)throw Error(S(137,t));break;default:we!==De&&Ht(e,t,ve,we,n,De)}}Ml(e,N,q,te,me,Le,x,_);return;case"select":we=N=q=ve=null;for(x in i)if(te=i[x],i.hasOwnProperty(x)&&te!=null)switch(x){case"value":break;case"multiple":we=te;default:n.hasOwnProperty(x)||Ht(e,t,x,null,n,te)}for(_ in n)if(x=n[_],te=i[_],n.hasOwnProperty(_)&&(x!=null||te!=null))switch(_){case"value":ve=x;break;case"defaultValue":q=x;break;case"multiple":N=x;default:x!==te&&Ht(e,t,_,x,n,te)}t=q,i=N,n=we,ve!=null?jn(e,!!i,ve,!1):!!n!=!!i&&(t!=null?jn(e,!!i,t,!0):jn(e,!!i,i?[]:"",!1));return;case"textarea":we=ve=null;for(q in i)if(_=i[q],i.hasOwnProperty(q)&&_!=null&&!n.hasOwnProperty(q))switch(q){case"value":break;case"children":break;default:Ht(e,t,q,null,n,_)}for(N in n)if(_=n[N],x=i[N],n.hasOwnProperty(N)&&(_!=null||x!=null))switch(N){case"value":ve=_;break;case"defaultValue":we=_;break;case"children":break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(S(91));break;default:_!==x&&Ht(e,t,N,_,n,x)}Vh(e,ve,we);return;case"option":for(var Ke in i)if(ve=i[Ke],i.hasOwnProperty(Ke)&&ve!=null&&!n.hasOwnProperty(Ke))switch(Ke){case"selected":e.selected=!1;break;default:Ht(e,t,Ke,null,n,ve)}for(te in n)if(ve=n[te],we=i[te],n.hasOwnProperty(te)&&ve!==we&&(ve!=null||we!=null))switch(te){case"selected":e.selected=ve&&typeof ve!="function"&&typeof ve!="symbol";break;default:Ht(e,t,te,ve,n,we)}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 at in i)ve=i[at],i.hasOwnProperty(at)&&ve!=null&&!n.hasOwnProperty(at)&&Ht(e,t,at,null,n,ve);for(me in n)if(ve=n[me],we=i[me],n.hasOwnProperty(me)&&ve!==we&&(ve!=null||we!=null))switch(me){case"children":case"dangerouslySetInnerHTML":if(ve!=null)throw Error(S(137,t));break;default:Ht(e,t,me,ve,n,we)}return;default:if(jl(t)){for(var Pt in i)ve=i[Pt],i.hasOwnProperty(Pt)&&ve!==void 0&&!n.hasOwnProperty(Pt)&&bu(e,t,Pt,void 0,n,ve);for(Le in n)ve=n[Le],we=i[Le],!n.hasOwnProperty(Le)||ve===we||ve===void 0&&we===void 0||bu(e,t,Le,ve,n,we);return}}for(var ae in i)ve=i[ae],i.hasOwnProperty(ae)&&ve!=null&&!n.hasOwnProperty(ae)&&Ht(e,t,ae,null,n,ve);for(De in n)ve=n[De],we=i[De],!n.hasOwnProperty(De)||ve===we||ve==null&&we==null||Ht(e,t,De,ve,n,we)}function tm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function lb(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),n=0;n<i.length;n++){var _=i[n],x=_.transferSize,N=_.initiatorType,q=_.duration;if(x&&q&&tm(N)){for(N=0,q=_.responseEnd,n+=1;n<i.length;n++){var te=i[n],me=te.startTime;if(me>q)break;var Le=te.transferSize,De=te.initiatorType;Le&&tm(De)&&(te=te.responseEnd,N+=Le*(te<q?1:(q-me)/(te-me)))}if(--n,t+=8*(x+N)/(_.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var yu=null,wu=null;function za(e){return e.nodeType===9?e:e.ownerDocument}function im(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function sm(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Su(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var xu=null;function cb(){var e=window.event;return e&&e.type==="popstate"?e===xu?!1:(xu=e,!0):(xu=null,!1)}var nm=typeof setTimeout=="function"?setTimeout:void 0,ub=typeof clearTimeout=="function"?clearTimeout:void 0,rm=typeof Promise=="function"?Promise:void 0,hb=typeof queueMicrotask=="function"?queueMicrotask:typeof rm<"u"?function(e){return rm.resolve(null).then(e).catch(db)}:nm;function db(e){setTimeout(function(){throw e})}function Vs(e){return e==="head"}function om(e,t){var i=t,n=0;do{var _=i.nextSibling;if(e.removeChild(i),_&&_.nodeType===8)if(i=_.data,i==="/$"||i==="/&"){if(n===0){e.removeChild(_),hr(t);return}n--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")n++;else if(i==="html")lo(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,lo(i);for(var x=i.firstChild;x;){var N=x.nextSibling,q=x.nodeName;x[$t]||q==="SCRIPT"||q==="STYLE"||q==="LINK"&&x.rel.toLowerCase()==="stylesheet"||i.removeChild(x),x=N}}else i==="body"&&lo(e.ownerDocument.body);i=_}while(i);hr(t)}function am(e,t){var i=e;e=0;do{var n=i.nextSibling;if(i.nodeType===1?t?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(t?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),n&&n.nodeType===8)if(i=n.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=n}while(i)}function Cu(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var i=t;switch(t=t.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":Cu(i),li(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function fb(e,t,i,n){for(;e.nodeType===1;){var _=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[$t])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(x=e.getAttribute("rel"),x==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(x!==_.rel||e.getAttribute("href")!==(_.href==null||_.href===""?null:_.href)||e.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin)||e.getAttribute("title")!==(_.title==null?null:_.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(x=e.getAttribute("src"),(x!==(_.src==null?null:_.src)||e.getAttribute("type")!==(_.type==null?null:_.type)||e.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin))&&x&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var x=_.name==null?null:""+_.name;if(_.type==="hidden"&&e.getAttribute("name")===x)return e}else return e;if(e=Gi(e.nextSibling),e===null)break}return null}function pb(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=Gi(e.nextSibling),e===null))return null;return e}function lm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Gi(e.nextSibling),e===null))return null;return e}function ku(e){return e.data==="$?"||e.data==="$~"}function Eu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function mb(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var n=function(){t(),i.removeEventListener("DOMContentLoaded",n)};i.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function Gi(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Lu=null;function cm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return Gi(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function um(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(t===0)return e;t--}else i!=="/$"&&i!=="/&"||t++}e=e.previousSibling}return null}function hm(e,t,i){switch(t=za(i),e){case"html":if(e=t.documentElement,!e)throw Error(S(452));return e;case"head":if(e=t.head,!e)throw Error(S(453));return e;case"body":if(e=t.body,!e)throw Error(S(454));return e;default:throw Error(S(451))}}function lo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);li(e)}var Yi=new Map,dm=new Set;function Ha(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ds=$.d;$.d={f:gb,r:vb,D:_b,C:bb,L:yb,m:wb,X:xb,S:Sb,M:Cb};function gb(){var e=Ds.f(),t=Da();return e||t}function vb(e){var t=_i(e);t!==null&&t.tag===5&&t.type==="form"?Df(t):Ds.r(e)}var lr=typeof document>"u"?null:document;function fm(e,t,i){var n=lr;if(n&&typeof t=="string"&&t){var _=Pi(t);_='link[rel="'+e+'"][href="'+_+'"]',typeof i=="string"&&(_+='[crossorigin="'+i+'"]'),dm.has(_)||(dm.add(_),e={rel:e,crossOrigin:i,href:t},n.querySelector(_)===null&&(t=n.createElement("link"),fi(t,"link",e),Lt(t),n.head.appendChild(t)))}}function _b(e){Ds.D(e),fm("dns-prefetch",e,null)}function bb(e,t){Ds.C(e,t),fm("preconnect",e,t)}function yb(e,t,i){Ds.L(e,t,i);var n=lr;if(n&&e&&t){var _='link[rel="preload"][as="'+Pi(t)+'"]';t==="image"&&i&&i.imageSrcSet?(_+='[imagesrcset="'+Pi(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(_+='[imagesizes="'+Pi(i.imageSizes)+'"]')):_+='[href="'+Pi(e)+'"]';var x=_;switch(t){case"style":x=cr(e);break;case"script":x=ur(e)}Yi.has(x)||(e=l({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),Yi.set(x,e),n.querySelector(_)!==null||t==="style"&&n.querySelector(co(x))||t==="script"&&n.querySelector(uo(x))||(t=n.createElement("link"),fi(t,"link",e),Lt(t),n.head.appendChild(t)))}}function wb(e,t){Ds.m(e,t);var i=lr;if(i&&e){var n=t&&typeof t.as=="string"?t.as:"script",_='link[rel="modulepreload"][as="'+Pi(n)+'"][href="'+Pi(e)+'"]',x=_;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=ur(e)}if(!Yi.has(x)&&(e=l({rel:"modulepreload",href:e},t),Yi.set(x,e),i.querySelector(_)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(uo(x)))return}n=i.createElement("link"),fi(n,"link",e),Lt(n),i.head.appendChild(n)}}}function Sb(e,t,i){Ds.S(e,t,i);var n=lr;if(n&&e){var _=ci(n).hoistableStyles,x=cr(e);t=t||"default";var N=_.get(x);if(!N){var q={loading:0,preload:null};if(N=n.querySelector(co(x)))q.loading=5;else{e=l({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Yi.get(x))&&Ru(e,i);var te=N=n.createElement("link");Lt(te),fi(te,"link",e),te._p=new Promise(function(me,Le){te.onload=me,te.onerror=Le}),te.addEventListener("load",function(){q.loading|=1}),te.addEventListener("error",function(){q.loading|=2}),q.loading|=4,Pa(N,t,n)}N={type:"stylesheet",instance:N,count:1,state:q},_.set(x,N)}}}function xb(e,t){Ds.X(e,t);var i=lr;if(i&&e){var n=ci(i).hoistableScripts,_=ur(e),x=n.get(_);x||(x=i.querySelector(uo(_)),x||(e=l({src:e,async:!0},t),(t=Yi.get(_))&&Du(e,t),x=i.createElement("script"),Lt(x),fi(x,"link",e),i.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},n.set(_,x))}}function Cb(e,t){Ds.M(e,t);var i=lr;if(i&&e){var n=ci(i).hoistableScripts,_=ur(e),x=n.get(_);x||(x=i.querySelector(uo(_)),x||(e=l({src:e,async:!0,type:"module"},t),(t=Yi.get(_))&&Du(e,t),x=i.createElement("script"),Lt(x),fi(x,"link",e),i.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},n.set(_,x))}}function pm(e,t,i,n){var _=(_=xe.current)?Ha(_):null;if(!_)throw Error(S(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=cr(i.href),i=ci(_).hoistableStyles,n=i.get(t),n||(n={type:"style",instance:null,count:0,state:null},i.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=cr(i.href);var x=ci(_).hoistableStyles,N=x.get(e);if(N||(_=_.ownerDocument||_,N={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(e,N),(x=_.querySelector(co(e)))&&!x._p&&(N.instance=x,N.state.loading=5),Yi.has(e)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Yi.set(e,i),x||kb(_,e,i,N.state))),t&&n===null)throw Error(S(528,""));return N}if(t&&n!==null)throw Error(S(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=ur(i),i=ci(_).hoistableScripts,n=i.get(t),n||(n={type:"script",instance:null,count:0,state:null},i.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(S(444,e))}}function cr(e){return'href="'+Pi(e)+'"'}function co(e){return'link[rel="stylesheet"]['+e+"]"}function mm(e){return l({},e,{"data-precedence":e.precedence,precedence:null})}function kb(e,t,i,n){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?n.loading=1:(t=e.createElement("link"),n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2}),fi(t,"link",i),Lt(t),e.head.appendChild(t))}function ur(e){return'[src="'+Pi(e)+'"]'}function uo(e){return"script[async]"+e}function gm(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+Pi(i.href)+'"]');if(n)return t.instance=n,Lt(n),n;var _=l({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),Lt(n),fi(n,"style",_),Pa(n,i.precedence,e),t.instance=n;case"stylesheet":_=cr(i.href);var x=e.querySelector(co(_));if(x)return t.state.loading|=4,t.instance=x,Lt(x),x;n=mm(i),(_=Yi.get(_))&&Ru(n,_),x=(e.ownerDocument||e).createElement("link"),Lt(x);var N=x;return N._p=new Promise(function(q,te){N.onload=q,N.onerror=te}),fi(x,"link",n),t.state.loading|=4,Pa(x,i.precedence,e),t.instance=x;case"script":return x=ur(i.src),(_=e.querySelector(uo(x)))?(t.instance=_,Lt(_),_):(n=i,(_=Yi.get(x))&&(n=l({},i),Du(n,_)),e=e.ownerDocument||e,_=e.createElement("script"),Lt(_),fi(_,"link",n),e.head.appendChild(_),t.instance=_);case"void":return null;default:throw Error(S(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,Pa(n,i.precedence,e));return t.instance}function Pa(e,t,i){for(var n=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),_=n.length?n[n.length-1]:null,x=_,N=0;N<n.length;N++){var q=n[N];if(q.dataset.precedence===t)x=q;else if(x!==_)break}x?x.parentNode.insertBefore(e,x.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function Ru(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Du(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ia=null;function vm(e,t,i){if(Ia===null){var n=new Map,_=Ia=new Map;_.set(i,n)}else _=Ia,n=_.get(i),n||(n=new Map,_.set(i,n));if(n.has(e))return n;for(n.set(e,null),i=i.getElementsByTagName(e),_=0;_<i.length;_++){var x=i[_];if(!(x[$t]||x[fe]||e==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var N=x.getAttribute(t)||"";N=e+N;var q=n.get(N);q?q.push(x):n.set(N,[x])}}return n}function _m(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function Eb(e,t,i){if(i===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function bm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Lb(e,t,i,n){if(i.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var _=cr(n.href),x=t.querySelector(co(_));if(x){t=x._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Fa.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=x,Lt(x);return}x=t.ownerDocument||t,n=mm(n),(_=Yi.get(_))&&Ru(n,_),x=x.createElement("link"),Lt(x);var N=x;N._p=new Promise(function(q,te){N.onload=q,N.onerror=te}),fi(x,"link",n),i.instance=x}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=Fa.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var Tu=0;function Rb(e,t){return e.stylesheets&&e.count===0&&$a(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var n=setTimeout(function(){if(e.stylesheets&&$a(e,e.stylesheets),e.unsuspend){var x=e.unsuspend;e.unsuspend=null,x()}},6e4+t);0<e.imgBytes&&Tu===0&&(Tu=62500*lb());var _=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&$a(e,e.stylesheets),e.unsuspend)){var x=e.unsuspend;e.unsuspend=null,x()}},(e.imgBytes>Tu?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(_)}}:null}function Fa(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)$a(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ua=null;function $a(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ua=new Map,t.forEach(Db,e),Ua=null,Fa.call(e))}function Db(e,t){if(!(t.state.loading&4)){var i=Ua.get(e);if(i)var n=i.get(null);else{i=new Map,Ua.set(e,i);for(var _=e.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<_.length;x++){var N=_[x];(N.nodeName==="LINK"||N.getAttribute("media")!=="not all")&&(i.set(N.dataset.precedence,N),n=N)}n&&i.set(null,n)}_=t.instance,N=_.getAttribute("data-precedence"),x=i.get(N)||n,x===n&&i.set(null,_),i.set(N,_),this.count++,n=Fa.bind(this),_.addEventListener("load",n),_.addEventListener("error",n),x?x.parentNode.insertBefore(_,x.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(_,e.firstChild)),t.state.loading|=4}}var ho={$$typeof:f,Provider:null,Consumer:null,_currentValue:U,_currentValue2:U,_threadCount:0};function Tb(e,t,i,n,_,x,N,q,te){this.tag=1,this.containerInfo=e,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=Pe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pe(0),this.hiddenUpdates=Pe(null),this.identifierPrefix=n,this.onUncaughtError=_,this.onCaughtError=x,this.onRecoverableError=N,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=te,this.incompleteTransitions=new Map}function ym(e,t,i,n,_,x,N,q,te,me,Le,De){return e=new Tb(e,t,i,N,te,me,Le,De,q),t=1,x===!0&&(t|=24),x=Mi(3,null,null,t),e.current=x,x.stateNode=e,t=cc(),t.refCount++,e.pooledCache=t,t.refCount++,x.memoizedState={element:n,isDehydrated:i,cache:t},fc(x),e}function wm(e){return e?(e=Fn,e):Fn}function Sm(e,t,i,n,_,x){_=wm(_),n.context===null?n.context=_:n.pendingContext=_,n=Ps(t),n.payload={element:i},x=x===void 0?null:x,x!==null&&(n.callback=x),i=Is(e,n,t),i!==null&&(ki(i,e,t),$r(i,e,t))}function xm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function Mu(e,t){xm(e,t),(e=e.alternate)&&xm(e,t)}function Cm(e){if(e.tag===13||e.tag===31){var t=pn(e,67108864);t!==null&&ki(t,e,67108864),Mu(e,67108864)}}function km(e){if(e.tag===13||e.tag===31){var t=Ni();t=kt(t);var i=pn(e,t);i!==null&&ki(i,e,t),Mu(e,t)}}var Wa=!0;function Mb(e,t,i,n){var _=Y.T;Y.T=null;var x=$.p;try{$.p=2,Au(e,t,i,n)}finally{$.p=x,Y.T=_}}function Ab(e,t,i,n){var _=Y.T;Y.T=null;var x=$.p;try{$.p=8,Au(e,t,i,n)}finally{$.p=x,Y.T=_}}function Au(e,t,i,n){if(Wa){var _=ju(n);if(_===null)_u(e,t,n,qa,i),Lm(e,n);else if(Ob(_,e,t,i,n))n.stopPropagation();else if(Lm(e,n),t&4&&-1<jb.indexOf(e)){for(;_!==null;){var x=_i(_);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var N=Q(x.pendingLanes);if(N!==0){var q=x;for(q.pendingLanes|=2,q.entangledLanes|=2;N;){var te=1<<31-he(N);q.entanglements[1]|=te,N&=~te}cs(x),(Mt&6)===0&&(La=$e()+500,ro(0))}}break;case 31:case 13:q=pn(x,2),q!==null&&ki(q,x,2),Da(),Mu(x,2)}if(x=ju(n),x===null&&_u(e,t,n,qa,i),x===_)break;_=x}_!==null&&n.stopPropagation()}else _u(e,t,n,null,i)}}function ju(e){return e=Bl(e),Ou(e)}var qa=null;function Ou(e){if(qa=null,e=mi(e),e!==null){var t=O(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=A(t),e!==null)return e;e=null}else if(i===31){if(e=r(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return qa=e,null}function Em(e){switch(e){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(lt()){case st:return 2;case St:return 8;case Se:case Ie:return 32;case le:return 268435456;default:return 32}default:return 32}}var Bu=!1,Js=null,Qs=null,Zs=null,fo=new Map,po=new Map,en=[],jb="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 Lm(e,t){switch(e){case"focusin":case"focusout":Js=null;break;case"dragenter":case"dragleave":Qs=null;break;case"mouseover":case"mouseout":Zs=null;break;case"pointerover":case"pointerout":fo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":po.delete(t.pointerId)}}function mo(e,t,i,n,_,x){return e===null||e.nativeEvent!==x?(e={blockedOn:t,domEventName:i,eventSystemFlags:n,nativeEvent:x,targetContainers:[_]},t!==null&&(t=_i(t),t!==null&&Cm(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,_!==null&&t.indexOf(_)===-1&&t.push(_),e)}function Ob(e,t,i,n,_){switch(t){case"focusin":return Js=mo(Js,e,t,i,n,_),!0;case"dragenter":return Qs=mo(Qs,e,t,i,n,_),!0;case"mouseover":return Zs=mo(Zs,e,t,i,n,_),!0;case"pointerover":var x=_.pointerId;return fo.set(x,mo(fo.get(x)||null,e,t,i,n,_)),!0;case"gotpointercapture":return x=_.pointerId,po.set(x,mo(po.get(x)||null,e,t,i,n,_)),!0}return!1}function Rm(e){var t=mi(e.target);if(t!==null){var i=O(t);if(i!==null){if(t=i.tag,t===13){if(t=A(i),t!==null){e.blockedOn=t,Nt(e.priority,function(){km(i)});return}}else if(t===31){if(t=r(i),t!==null){e.blockedOn=t,Nt(e.priority,function(){km(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ga(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=ju(e.nativeEvent);if(i===null){i=e.nativeEvent;var n=new i.constructor(i.type,i);Ol=n,i.target.dispatchEvent(n),Ol=null}else return t=_i(i),t!==null&&Cm(t),e.blockedOn=i,!1;t.shift()}return!0}function Dm(e,t,i){Ga(e)&&i.delete(t)}function Bb(){Bu=!1,Js!==null&&Ga(Js)&&(Js=null),Qs!==null&&Ga(Qs)&&(Qs=null),Zs!==null&&Ga(Zs)&&(Zs=null),fo.forEach(Dm),po.forEach(Dm)}function Ya(e,t){e.blockedOn===t&&(e.blockedOn=null,Bu||(Bu=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,Bb)))}var Ka=null;function Tm(e){Ka!==e&&(Ka=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){Ka===e&&(Ka=null);for(var t=0;t<e.length;t+=3){var i=e[t],n=e[t+1],_=e[t+2];if(typeof n!="function"){if(Ou(n||i)===null)continue;break}var x=_i(i);x!==null&&(e.splice(t,3),t-=3,jc(x,{pending:!0,data:_,method:i.method,action:n},n,_))}}))}function hr(e){function t(te){return Ya(te,e)}Js!==null&&Ya(Js,e),Qs!==null&&Ya(Qs,e),Zs!==null&&Ya(Zs,e),fo.forEach(t),po.forEach(t);for(var i=0;i<en.length;i++){var n=en[i];n.blockedOn===e&&(n.blockedOn=null)}for(;0<en.length&&(i=en[0],i.blockedOn===null);)Rm(i),i.blockedOn===null&&en.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(n=0;n<i.length;n+=3){var _=i[n],x=i[n+1],N=_[Ve]||null;if(typeof x=="function")N||Tm(i);else if(N){var q=null;if(x&&x.hasAttribute("formAction")){if(_=x,N=x[Ve]||null)q=N.formAction;else if(Ou(_)!==null)continue}else q=N.action;typeof q=="function"?i[n+1]=q:(i.splice(n,3),n-=3),Tm(i)}}}function Mm(){function e(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(N){return _=N})},focusReset:"manual",scroll:"manual"})}function t(){_!==null&&(_(),_=null),n||setTimeout(i,20)}function i(){if(!n&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,_=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),_!==null&&(_(),_=null)}}}function Nu(e){this._internalRoot=e}Xa.prototype.render=Nu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(S(409));var i=t.current,n=Ni();Sm(i,n,e,t,null,null)},Xa.prototype.unmount=Nu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Sm(e.current,2,null,e,null,null),Da(),t[ht]=null}};function Xa(e){this._internalRoot=e}Xa.prototype.unstable_scheduleHydration=function(e){if(e){var t=Vt();e={blockedOn:null,target:e,priority:t};for(var i=0;i<en.length&&t!==0&&t<en[i].priority;i++);en.splice(i,0,e),i===0&&Rm(e)}};var Am=h.version;if(Am!=="19.2.4")throw Error(S(527,Am,"19.2.4"));$.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(S(188)):(e=Object.keys(e).join(","),Error(S(268,e)));return e=d(t),e=e!==null?g(e):null,e=e===null?null:e.stateNode,e};var Nb={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:Y,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Va=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Va.isDisabled&&Va.supportsFiber)try{ue=Va.inject(Nb),ee=Va}catch{}}return vo.createRoot=function(e,t){if(!M(e))throw Error(S(299));var i=!1,n="",_=Pf,x=If,N=Ff;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(_=t.onUncaughtError),t.onCaughtError!==void 0&&(x=t.onCaughtError),t.onRecoverableError!==void 0&&(N=t.onRecoverableError)),t=ym(e,1,!1,null,null,i,n,null,_,x,N,Mm),e[ht]=t.current,vu(e),new Nu(t)},vo.hydrateRoot=function(e,t,i){if(!M(e))throw Error(S(299));var n=!1,_="",x=Pf,N=If,q=Ff,te=null;return i!=null&&(i.unstable_strictMode===!0&&(n=!0),i.identifierPrefix!==void 0&&(_=i.identifierPrefix),i.onUncaughtError!==void 0&&(x=i.onUncaughtError),i.onCaughtError!==void 0&&(N=i.onCaughtError),i.onRecoverableError!==void 0&&(q=i.onRecoverableError),i.formState!==void 0&&(te=i.formState)),t=ym(e,1,!0,t,i??null,n,_,te,x,N,q,Mm),t.context=wm(null),i=t.current,n=Ni(),n=kt(n),_=Ps(n),_.callback=null,Is(i,_,n),i=n,t.current.lanes=i,Ue(t,i),cs(t),e[ht]=t.current,vu(e),new Xa(t)},vo.version="19.2.4",vo}var $m;function Kb(){if($m)return Pu.exports;$m=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(h){console.error(h)}}return s(),Pu.exports=Yb(),Pu.exports}var Xb=Kb();const Vb=yh(Xb),Jb="modulepreload",Qb=function(s){return"/"+s},Wm={},Oo=function(h,w,S){let M=Promise.resolve();if(w&&w.length>0){let A=function(d){return Promise.all(d.map(g=>Promise.resolve(g).then(l=>({status:"fulfilled",value:l}),l=>({status:"rejected",reason:l}))))};document.getElementsByTagName("link");const r=document.querySelector("meta[property=csp-nonce]"),u=(r==null?void 0:r.nonce)||(r==null?void 0:r.getAttribute("nonce"));M=A(w.map(d=>{if(d=Qb(d),d in Wm)return;Wm[d]=!0;const g=d.endsWith(".css"),l=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${l}`))return;const m=document.createElement("link");if(m.rel=g?"stylesheet":Jb,g||(m.as="script"),m.crossOrigin="",m.href=d,u&&m.setAttribute("nonce",u),document.head.appendChild(m),g)return new Promise((b,C)=>{m.addEventListener("load",b),m.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${d}`)))})}))}function O(A){const r=new Event("vite:preloadError",{cancelable:!0});if(r.payload=A,window.dispatchEvent(r),!r.defaultPrevented)throw A}return M.then(A=>{for(const r of A||[])r.status==="rejected"&&O(r.reason);return h().catch(O)})};/**
|
|
51
|
+
* react-router v7.13.2
|
|
52
|
+
*
|
|
53
|
+
* Copyright (c) Remix Software Inc.
|
|
54
|
+
*
|
|
55
|
+
* This source code is licensed under the MIT license found in the
|
|
56
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
57
|
+
*
|
|
58
|
+
* @license MIT
|
|
59
|
+
*/var qm="popstate";function Gm(s){return typeof s=="object"&&s!=null&&"pathname"in s&&"search"in s&&"hash"in s&&"state"in s&&"key"in s}function Zb(s={}){function h(S,M){var d;let O=(d=M.state)==null?void 0:d.masked,{pathname:A,search:r,hash:u}=O||S.location;return rh("",{pathname:A,search:r,hash:u},M.state&&M.state.usr||null,M.state&&M.state.key||"default",O?{pathname:S.location.pathname,search:S.location.search,hash:S.location.hash}:void 0)}function w(S,M){return typeof M=="string"?M:Ro(M)}return ty(h,w,null,s)}function Yt(s,h){if(s===!1||s===null||typeof s>"u")throw new Error(h)}function is(s,h){if(!s){typeof console<"u"&&console.warn(h);try{throw new Error(h)}catch{}}}function ey(){return Math.random().toString(36).substring(2,10)}function Ym(s,h){return{usr:s.state,key:s.key,idx:h,masked:s.unstable_mask?{pathname:s.pathname,search:s.search,hash:s.hash}:void 0}}function rh(s,h,w=null,S,M){return{pathname:typeof s=="string"?s:s.pathname,search:"",hash:"",...typeof h=="string"?Sr(h):h,state:w,key:h&&h.key||S||ey(),unstable_mask:M}}function Ro({pathname:s="/",search:h="",hash:w=""}){return h&&h!=="?"&&(s+=h.charAt(0)==="?"?h:"?"+h),w&&w!=="#"&&(s+=w.charAt(0)==="#"?w:"#"+w),s}function Sr(s){let h={};if(s){let w=s.indexOf("#");w>=0&&(h.hash=s.substring(w),s=s.substring(0,w));let S=s.indexOf("?");S>=0&&(h.search=s.substring(S),s=s.substring(0,S)),s&&(h.pathname=s)}return h}function ty(s,h,w,S={}){let{window:M=document.defaultView,v5Compat:O=!1}=S,A=M.history,r="POP",u=null,d=g();d==null&&(d=0,A.replaceState({...A.state,idx:d},""));function g(){return(A.state||{idx:null}).idx}function l(){r="POP";let o=g(),c=o==null?null:o-d;d=o,u&&u({action:r,location:p.location,delta:c})}function m(o,c){r="PUSH";let a=Gm(o)?o:rh(p.location,o,c);d=g()+1;let f=Ym(a,d),y=p.createHref(a.unstable_mask||a);try{A.pushState(f,"",y)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;M.location.assign(y)}O&&u&&u({action:r,location:p.location,delta:1})}function b(o,c){r="REPLACE";let a=Gm(o)?o:rh(p.location,o,c);d=g();let f=Ym(a,d),y=p.createHref(a.unstable_mask||a);A.replaceState(f,"",y),O&&u&&u({action:r,location:p.location,delta:0})}function C(o){return iy(o)}let p={get action(){return r},get location(){return s(M,A)},listen(o){if(u)throw new Error("A history only accepts one active listener");return M.addEventListener(qm,l),u=o,()=>{M.removeEventListener(qm,l),u=null}},createHref(o){return h(M,o)},createURL:C,encodeLocation(o){let c=C(o);return{pathname:c.pathname,search:c.search,hash:c.hash}},push:m,replace:b,go(o){return A.go(o)}};return p}function iy(s,h=!1){let w="http://localhost";typeof window<"u"&&(w=window.location.origin!=="null"?window.location.origin:window.location.href),Yt(w,"No window.location.(origin|href) available to create URL");let S=typeof s=="string"?s:Ro(s);return S=S.replace(/ $/,"%20"),!h&&S.startsWith("//")&&(S=w+S),new URL(S,w)}function sv(s,h,w="/"){return sy(s,h,w,!1)}function sy(s,h,w,S){let M=typeof h=="string"?Sr(h):h,O=As(M.pathname||"/",w);if(O==null)return null;let A=nv(s);ny(A);let r=null;for(let u=0;r==null&&u<A.length;++u){let d=my(O);r=fy(A[u],d,S)}return r}function nv(s,h=[],w=[],S="",M=!1){let O=(A,r,u=M,d)=>{let g={relativePath:d===void 0?A.path||"":d,caseSensitive:A.caseSensitive===!0,childrenIndex:r,route:A};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(S)&&u)return;Yt(g.relativePath.startsWith(S),`Absolute route path "${g.relativePath}" nested under path "${S}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(S.length)}let l=us([S,g.relativePath]),m=w.concat(g);A.children&&A.children.length>0&&(Yt(A.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),nv(A.children,h,m,l,u)),!(A.path==null&&!A.index)&&h.push({path:l,score:hy(l,A.index),routesMeta:m})};return s.forEach((A,r)=>{var u;if(A.path===""||!((u=A.path)!=null&&u.includes("?")))O(A,r);else for(let d of rv(A.path))O(A,r,!0,d)}),h}function rv(s){let h=s.split("/");if(h.length===0)return[];let[w,...S]=h,M=w.endsWith("?"),O=w.replace(/\?$/,"");if(S.length===0)return M?[O,""]:[O];let A=rv(S.join("/")),r=[];return r.push(...A.map(u=>u===""?O:[O,u].join("/"))),M&&r.push(...A),r.map(u=>s.startsWith("/")&&u===""?"/":u)}function ny(s){s.sort((h,w)=>h.score!==w.score?w.score-h.score:dy(h.routesMeta.map(S=>S.childrenIndex),w.routesMeta.map(S=>S.childrenIndex)))}var ry=/^:[\w-]+$/,oy=3,ay=2,ly=1,cy=10,uy=-2,Km=s=>s==="*";function hy(s,h){let w=s.split("/"),S=w.length;return w.some(Km)&&(S+=uy),h&&(S+=ay),w.filter(M=>!Km(M)).reduce((M,O)=>M+(ry.test(O)?oy:O===""?ly:cy),S)}function dy(s,h){return s.length===h.length&&s.slice(0,-1).every((S,M)=>S===h[M])?s[s.length-1]-h[h.length-1]:0}function fy(s,h,w=!1){let{routesMeta:S}=s,M={},O="/",A=[];for(let r=0;r<S.length;++r){let u=S[r],d=r===S.length-1,g=O==="/"?h:h.slice(O.length)||"/",l=fl({path:u.relativePath,caseSensitive:u.caseSensitive,end:d},g),m=u.route;if(!l&&d&&w&&!S[S.length-1].route.index&&(l=fl({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},g)),!l)return null;Object.assign(M,l.params),A.push({params:M,pathname:us([O,l.pathname]),pathnameBase:by(us([O,l.pathnameBase])),route:m}),l.pathnameBase!=="/"&&(O=us([O,l.pathnameBase]))}return A}function fl(s,h){typeof s=="string"&&(s={path:s,caseSensitive:!1,end:!0});let[w,S]=py(s.path,s.caseSensitive,s.end),M=h.match(w);if(!M)return null;let O=M[0],A=O.replace(/(.)\/+$/,"$1"),r=M.slice(1);return{params:S.reduce((d,{paramName:g,isOptional:l},m)=>{if(g==="*"){let C=r[m]||"";A=O.slice(0,O.length-C.length).replace(/(.)\/+$/,"$1")}const b=r[m];return l&&!b?d[g]=void 0:d[g]=(b||"").replace(/%2F/g,"/"),d},{}),pathname:O,pathnameBase:A,pattern:s}}function py(s,h=!1,w=!0){is(s==="*"||!s.endsWith("*")||s.endsWith("/*"),`Route path "${s}" will be treated as if it were "${s.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${s.replace(/\*$/,"/*")}".`);let S=[],M="^"+s.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(A,r,u,d,g)=>{if(S.push({paramName:r,isOptional:u!=null}),u){let l=g.charAt(d+A.length);return l&&l!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return s.endsWith("*")?(S.push({paramName:"*"}),M+=s==="*"||s==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):w?M+="\\/*$":s!==""&&s!=="/"&&(M+="(?:(?=\\/|$))"),[new RegExp(M,h?void 0:"i"),S]}function my(s){try{return s.split("/").map(h=>decodeURIComponent(h).replace(/\//g,"%2F")).join("/")}catch(h){return is(!1,`The URL path "${s}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${h}).`),s}}function As(s,h){if(h==="/")return s;if(!s.toLowerCase().startsWith(h.toLowerCase()))return null;let w=h.endsWith("/")?h.length-1:h.length,S=s.charAt(w);return S&&S!=="/"?null:s.slice(w)||"/"}var gy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function vy(s,h="/"){let{pathname:w,search:S="",hash:M=""}=typeof s=="string"?Sr(s):s,O;return w?(w=w.replace(/\/\/+/g,"/"),w.startsWith("/")?O=Xm(w.substring(1),"/"):O=Xm(w,h)):O=h,{pathname:O,search:yy(S),hash:wy(M)}}function Xm(s,h){let w=h.replace(/\/+$/,"").split("/");return s.split("/").forEach(M=>{M===".."?w.length>1&&w.pop():M!=="."&&w.push(M)}),w.length>1?w.join("/"):"/"}function $u(s,h,w,S){return`Cannot include a '${s}' character in a manually specified \`to.${h}\` field [${JSON.stringify(S)}]. Please separate it out to the \`to.${w}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function _y(s){return s.filter((h,w)=>w===0||h.route.path&&h.route.path.length>0)}function ov(s){let h=_y(s);return h.map((w,S)=>S===h.length-1?w.pathname:w.pathnameBase)}function Sh(s,h,w,S=!1){let M;typeof s=="string"?M=Sr(s):(M={...s},Yt(!M.pathname||!M.pathname.includes("?"),$u("?","pathname","search",M)),Yt(!M.pathname||!M.pathname.includes("#"),$u("#","pathname","hash",M)),Yt(!M.search||!M.search.includes("#"),$u("#","search","hash",M)));let O=s===""||M.pathname==="",A=O?"/":M.pathname,r;if(A==null)r=w;else{let l=h.length-1;if(!S&&A.startsWith("..")){let m=A.split("/");for(;m[0]==="..";)m.shift(),l-=1;M.pathname=m.join("/")}r=l>=0?h[l]:"/"}let u=vy(M,r),d=A&&A!=="/"&&A.endsWith("/"),g=(O||A===".")&&w.endsWith("/");return!u.pathname.endsWith("/")&&(d||g)&&(u.pathname+="/"),u}var us=s=>s.join("/").replace(/\/\/+/g,"/"),by=s=>s.replace(/\/+$/,"").replace(/^\/*/,"/"),yy=s=>!s||s==="?"?"":s.startsWith("?")?s:"?"+s,wy=s=>!s||s==="#"?"":s.startsWith("#")?s:"#"+s,Sy=class{constructor(s,h,w,S=!1){this.status=s,this.statusText=h||"",this.internal=S,w instanceof Error?(this.data=w.toString(),this.error=w):this.data=w}};function xy(s){return s!=null&&typeof s.status=="number"&&typeof s.statusText=="string"&&typeof s.internal=="boolean"&&"data"in s}function Cy(s){return s.map(h=>h.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var av=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function lv(s,h){let w=s;if(typeof w!="string"||!gy.test(w))return{absoluteURL:void 0,isExternal:!1,to:w};let S=w,M=!1;if(av)try{let O=new URL(window.location.href),A=w.startsWith("//")?new URL(O.protocol+w):new URL(w),r=As(A.pathname,h);A.origin===O.origin&&r!=null?w=r+A.search+A.hash:M=!0}catch{is(!1,`<Link to="${w}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:S,isExternal:M,to:w}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var cv=["POST","PUT","PATCH","DELETE"];new Set(cv);var ky=["GET",...cv];new Set(ky);var xr=j.createContext(null);xr.displayName="DataRouter";var Sl=j.createContext(null);Sl.displayName="DataRouterState";var Ey=j.createContext(!1),uv=j.createContext({isTransitioning:!1});uv.displayName="ViewTransition";var Ly=j.createContext(new Map);Ly.displayName="Fetchers";var Ry=j.createContext(null);Ry.displayName="Await";var Xi=j.createContext(null);Xi.displayName="Navigation";var Bo=j.createContext(null);Bo.displayName="Location";var hs=j.createContext({outlet:null,matches:[],isDataRoute:!1});hs.displayName="Route";var xh=j.createContext(null);xh.displayName="RouteError";var hv="REACT_ROUTER_ERROR",Dy="REDIRECT",Ty="ROUTE_ERROR_RESPONSE";function My(s){if(s.startsWith(`${hv}:${Dy}:{`))try{let h=JSON.parse(s.slice(28));if(typeof h=="object"&&h&&typeof h.status=="number"&&typeof h.statusText=="string"&&typeof h.location=="string"&&typeof h.reloadDocument=="boolean"&&typeof h.replace=="boolean")return h}catch{}}function Ay(s){if(s.startsWith(`${hv}:${Ty}:{`))try{let h=JSON.parse(s.slice(40));if(typeof h=="object"&&h&&typeof h.status=="number"&&typeof h.statusText=="string")return new Sy(h.status,h.statusText,h.data)}catch{}}function jy(s,{relative:h}={}){Yt(No(),"useHref() may be used only in the context of a <Router> component.");let{basename:w,navigator:S}=j.useContext(Xi),{hash:M,pathname:O,search:A}=zo(s,{relative:h}),r=O;return w!=="/"&&(r=O==="/"?w:us([w,O])),S.createHref({pathname:r,search:A,hash:M})}function No(){return j.useContext(Bo)!=null}function ss(){return Yt(No(),"useLocation() may be used only in the context of a <Router> component."),j.useContext(Bo).location}var dv="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function fv(s){j.useContext(Xi).static||j.useLayoutEffect(s)}function xl(){let{isDataRoute:s}=j.useContext(hs);return s?Yy():Oy()}function Oy(){Yt(No(),"useNavigate() may be used only in the context of a <Router> component.");let s=j.useContext(xr),{basename:h,navigator:w}=j.useContext(Xi),{matches:S}=j.useContext(hs),{pathname:M}=ss(),O=JSON.stringify(ov(S)),A=j.useRef(!1);return fv(()=>{A.current=!0}),j.useCallback((u,d={})=>{if(is(A.current,dv),!A.current)return;if(typeof u=="number"){w.go(u);return}let g=Sh(u,JSON.parse(O),M,d.relative==="path");s==null&&h!=="/"&&(g.pathname=g.pathname==="/"?h:us([h,g.pathname])),(d.replace?w.replace:w.push)(g,d.state,d)},[h,w,O,M,s])}j.createContext(null);function By(){let{matches:s}=j.useContext(hs),h=s[s.length-1];return h?h.params:{}}function zo(s,{relative:h}={}){let{matches:w}=j.useContext(hs),{pathname:S}=ss(),M=JSON.stringify(ov(w));return j.useMemo(()=>Sh(s,JSON.parse(M),S,h==="path"),[s,M,S,h])}function Ny(s,h){return pv(s,h)}function pv(s,h,w){var o;Yt(No(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:S}=j.useContext(Xi),{matches:M}=j.useContext(hs),O=M[M.length-1],A=O?O.params:{},r=O?O.pathname:"/",u=O?O.pathnameBase:"/",d=O&&O.route;{let c=d&&d.path||"";gv(r,!d||c.endsWith("*")||c.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${r}" (under <Route path="${c}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
60
|
+
|
|
61
|
+
Please change the parent <Route path="${c}"> to <Route path="${c==="/"?"*":`${c}/*`}">.`)}let g=ss(),l;if(h){let c=typeof h=="string"?Sr(h):h;Yt(u==="/"||((o=c.pathname)==null?void 0:o.startsWith(u)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${u}" but pathname "${c.pathname}" was given in the \`location\` prop.`),l=c}else l=g;let m=l.pathname||"/",b=m;if(u!=="/"){let c=u.replace(/^\//,"").split("/");b="/"+m.replace(/^\//,"").split("/").slice(c.length).join("/")}let C=sv(s,{pathname:b});is(d||C!=null,`No routes matched location "${l.pathname}${l.search}${l.hash}" `),is(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${l.pathname}${l.search}${l.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let p=Fy(C&&C.map(c=>Object.assign({},c,{params:Object.assign({},A,c.params),pathname:us([u,S.encodeLocation?S.encodeLocation(c.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:c.pathname]),pathnameBase:c.pathnameBase==="/"?u:us([u,S.encodeLocation?S.encodeLocation(c.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:c.pathnameBase])})),M,w);return h&&p?j.createElement(Bo.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...l},navigationType:"POP"}},p):p}function zy(){let s=Gy(),h=xy(s)?`${s.status} ${s.statusText}`:s instanceof Error?s.message:JSON.stringify(s),w=s instanceof Error?s.stack:null,S="rgba(200,200,200, 0.5)",M={padding:"0.5rem",backgroundColor:S},O={padding:"2px 4px",backgroundColor:S},A=null;return console.error("Error handled by React Router default ErrorBoundary:",s),A=j.createElement(j.Fragment,null,j.createElement("p",null,"💿 Hey developer 👋"),j.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",j.createElement("code",{style:O},"ErrorBoundary")," or"," ",j.createElement("code",{style:O},"errorElement")," prop on your route.")),j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},h),w?j.createElement("pre",{style:M},w):null,A)}var Hy=j.createElement(zy,null),mv=class extends j.Component{constructor(s){super(s),this.state={location:s.location,revalidation:s.revalidation,error:s.error}}static getDerivedStateFromError(s){return{error:s}}static getDerivedStateFromProps(s,h){return h.location!==s.location||h.revalidation!=="idle"&&s.revalidation==="idle"?{error:s.error,location:s.location,revalidation:s.revalidation}:{error:s.error!==void 0?s.error:h.error,location:h.location,revalidation:s.revalidation||h.revalidation}}componentDidCatch(s,h){this.props.onError?this.props.onError(s,h):console.error("React Router caught the following error during render",s)}render(){let s=this.state.error;if(this.context&&typeof s=="object"&&s&&"digest"in s&&typeof s.digest=="string"){const w=Ay(s.digest);w&&(s=w)}let h=s!==void 0?j.createElement(hs.Provider,{value:this.props.routeContext},j.createElement(xh.Provider,{value:s,children:this.props.component})):this.props.children;return this.context?j.createElement(Py,{error:s},h):h}};mv.contextType=Ey;var Wu=new WeakMap;function Py({children:s,error:h}){let{basename:w}=j.useContext(Xi);if(typeof h=="object"&&h&&"digest"in h&&typeof h.digest=="string"){let S=My(h.digest);if(S){let M=Wu.get(h);if(M)throw M;let O=lv(S.location,w);if(av&&!Wu.get(h))if(O.isExternal||S.reloadDocument)window.location.href=O.absoluteURL||O.to;else{const A=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(O.to,{replace:S.replace}));throw Wu.set(h,A),A}return j.createElement("meta",{httpEquiv:"refresh",content:`0;url=${O.absoluteURL||O.to}`})}}return s}function Iy({routeContext:s,match:h,children:w}){let S=j.useContext(xr);return S&&S.static&&S.staticContext&&(h.route.errorElement||h.route.ErrorBoundary)&&(S.staticContext._deepestRenderedBoundaryId=h.route.id),j.createElement(hs.Provider,{value:s},w)}function Fy(s,h=[],w){let S=w==null?void 0:w.state;if(s==null){if(!S)return null;if(S.errors)s=S.matches;else if(h.length===0&&!S.initialized&&S.matches.length>0)s=S.matches;else return null}let M=s,O=S==null?void 0:S.errors;if(O!=null){let g=M.findIndex(l=>l.route.id&&(O==null?void 0:O[l.route.id])!==void 0);Yt(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(O).join(",")}`),M=M.slice(0,Math.min(M.length,g+1))}let A=!1,r=-1;if(w&&S){A=S.renderFallback;for(let g=0;g<M.length;g++){let l=M[g];if((l.route.HydrateFallback||l.route.hydrateFallbackElement)&&(r=g),l.route.id){let{loaderData:m,errors:b}=S,C=l.route.loader&&!m.hasOwnProperty(l.route.id)&&(!b||b[l.route.id]===void 0);if(l.route.lazy||C){w.isStatic&&(A=!0),r>=0?M=M.slice(0,r+1):M=[M[0]];break}}}}let u=w==null?void 0:w.onError,d=S&&u?(g,l)=>{var m,b;u(g,{location:S.location,params:((b=(m=S.matches)==null?void 0:m[0])==null?void 0:b.params)??{},unstable_pattern:Cy(S.matches),errorInfo:l})}:void 0;return M.reduceRight((g,l,m)=>{let b,C=!1,p=null,o=null;S&&(b=O&&l.route.id?O[l.route.id]:void 0,p=l.route.errorElement||Hy,A&&(r<0&&m===0?(gv("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),C=!0,o=null):r===m&&(C=!0,o=l.route.hydrateFallbackElement||null)));let c=h.concat(M.slice(0,m+1)),a=()=>{let f;return b?f=p:C?f=o:l.route.Component?f=j.createElement(l.route.Component,null):l.route.element?f=l.route.element:f=g,j.createElement(Iy,{match:l,routeContext:{outlet:g,matches:c,isDataRoute:S!=null},children:f})};return S&&(l.route.ErrorBoundary||l.route.errorElement||m===0)?j.createElement(mv,{location:S.location,revalidation:S.revalidation,component:p,error:b,children:a(),routeContext:{outlet:null,matches:c,isDataRoute:!0},onError:d}):a()},null)}function Ch(s){return`${s} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Uy(s){let h=j.useContext(xr);return Yt(h,Ch(s)),h}function $y(s){let h=j.useContext(Sl);return Yt(h,Ch(s)),h}function Wy(s){let h=j.useContext(hs);return Yt(h,Ch(s)),h}function kh(s){let h=Wy(s),w=h.matches[h.matches.length-1];return Yt(w.route.id,`${s} can only be used on routes that contain a unique "id"`),w.route.id}function qy(){return kh("useRouteId")}function Gy(){var S;let s=j.useContext(xh),h=$y("useRouteError"),w=kh("useRouteError");return s!==void 0?s:(S=h.errors)==null?void 0:S[w]}function Yy(){let{router:s}=Uy("useNavigate"),h=kh("useNavigate"),w=j.useRef(!1);return fv(()=>{w.current=!0}),j.useCallback(async(M,O={})=>{is(w.current,dv),w.current&&(typeof M=="number"?await s.navigate(M):await s.navigate(M,{fromRouteId:h,...O}))},[s,h])}var Vm={};function gv(s,h,w){!h&&!Vm[s]&&(Vm[s]=!0,is(!1,w))}j.memo(Ky);function Ky({routes:s,future:h,state:w,isStatic:S,onError:M}){return pv(s,void 0,{state:w,isStatic:S,onError:M})}function an(s){Yt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Xy({basename:s="/",children:h=null,location:w,navigationType:S="POP",navigator:M,static:O=!1,unstable_useTransitions:A}){Yt(!No(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let r=s.replace(/^\/*/,"/"),u=j.useMemo(()=>({basename:r,navigator:M,static:O,unstable_useTransitions:A,future:{}}),[r,M,O,A]);typeof w=="string"&&(w=Sr(w));let{pathname:d="/",search:g="",hash:l="",state:m=null,key:b="default",unstable_mask:C}=w,p=j.useMemo(()=>{let o=As(d,r);return o==null?null:{location:{pathname:o,search:g,hash:l,state:m,key:b,unstable_mask:C},navigationType:S}},[r,d,g,l,m,b,S,C]);return is(p!=null,`<Router basename="${r}"> is not able to match the URL "${d}${g}${l}" because it does not start with the basename, so the <Router> won't render anything.`),p==null?null:j.createElement(Xi.Provider,{value:u},j.createElement(Bo.Provider,{children:h,value:p}))}function Jm({children:s,location:h}){return Ny(oh(s),h)}function oh(s,h=[]){let w=[];return j.Children.forEach(s,(S,M)=>{if(!j.isValidElement(S))return;let O=[...h,M];if(S.type===j.Fragment){w.push.apply(w,oh(S.props.children,O));return}Yt(S.type===an,`[${typeof S.type=="string"?S.type:S.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Yt(!S.props.index||!S.props.children,"An index route cannot have child routes.");let A={id:S.props.id||O.join("-"),caseSensitive:S.props.caseSensitive,element:S.props.element,Component:S.props.Component,index:S.props.index,path:S.props.path,middleware:S.props.middleware,loader:S.props.loader,action:S.props.action,hydrateFallbackElement:S.props.hydrateFallbackElement,HydrateFallback:S.props.HydrateFallback,errorElement:S.props.errorElement,ErrorBoundary:S.props.ErrorBoundary,hasErrorBoundary:S.props.hasErrorBoundary===!0||S.props.ErrorBoundary!=null||S.props.errorElement!=null,shouldRevalidate:S.props.shouldRevalidate,handle:S.props.handle,lazy:S.props.lazy};S.props.children&&(A.children=oh(S.props.children,O)),w.push(A)}),w}var cl="get",ul="application/x-www-form-urlencoded";function Cl(s){return typeof HTMLElement<"u"&&s instanceof HTMLElement}function Vy(s){return Cl(s)&&s.tagName.toLowerCase()==="button"}function Jy(s){return Cl(s)&&s.tagName.toLowerCase()==="form"}function Qy(s){return Cl(s)&&s.tagName.toLowerCase()==="input"}function Zy(s){return!!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)}function ew(s,h){return s.button===0&&(!h||h==="_self")&&!Zy(s)}function ah(s=""){return new URLSearchParams(typeof s=="string"||Array.isArray(s)||s instanceof URLSearchParams?s:Object.keys(s).reduce((h,w)=>{let S=s[w];return h.concat(Array.isArray(S)?S.map(M=>[w,M]):[[w,S]])},[]))}function tw(s,h){let w=ah(s);return h&&h.forEach((S,M)=>{w.has(M)||h.getAll(M).forEach(O=>{w.append(M,O)})}),w}var Ja=null;function iw(){if(Ja===null)try{new FormData(document.createElement("form"),0),Ja=!1}catch{Ja=!0}return Ja}var sw=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function qu(s){return s!=null&&!sw.has(s)?(is(!1,`"${s}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ul}"`),null):s}function nw(s,h){let w,S,M,O,A;if(Jy(s)){let r=s.getAttribute("action");S=r?As(r,h):null,w=s.getAttribute("method")||cl,M=qu(s.getAttribute("enctype"))||ul,O=new FormData(s)}else if(Vy(s)||Qy(s)&&(s.type==="submit"||s.type==="image")){let r=s.form;if(r==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=s.getAttribute("formaction")||r.getAttribute("action");if(S=u?As(u,h):null,w=s.getAttribute("formmethod")||r.getAttribute("method")||cl,M=qu(s.getAttribute("formenctype"))||qu(r.getAttribute("enctype"))||ul,O=new FormData(r,s),!iw()){let{name:d,type:g,value:l}=s;if(g==="image"){let m=d?`${d}.`:"";O.append(`${m}x`,"0"),O.append(`${m}y`,"0")}else d&&O.append(d,l)}}else{if(Cl(s))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');w=cl,S=null,M=ul,A=s}return O&&M==="text/plain"&&(A=O,O=void 0),{action:S,method:w.toLowerCase(),encType:M,formData:O,body:A}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Eh(s,h){if(s===!1||s===null||typeof s>"u")throw new Error(h)}function rw(s,h,w,S){let M=typeof s=="string"?new URL(s,typeof window>"u"?"server://singlefetch/":window.location.origin):s;return w?M.pathname.endsWith("/")?M.pathname=`${M.pathname}_.${S}`:M.pathname=`${M.pathname}.${S}`:M.pathname==="/"?M.pathname=`_root.${S}`:h&&As(M.pathname,h)==="/"?M.pathname=`${h.replace(/\/$/,"")}/_root.${S}`:M.pathname=`${M.pathname.replace(/\/$/,"")}.${S}`,M}async function ow(s,h){if(s.id in h)return h[s.id];try{let w=await import(s.module);return h[s.id]=w,w}catch(w){return console.error(`Error loading route module \`${s.module}\`, reloading page...`),console.error(w),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function aw(s){return s==null?!1:s.href==null?s.rel==="preload"&&typeof s.imageSrcSet=="string"&&typeof s.imageSizes=="string":typeof s.rel=="string"&&typeof s.href=="string"}async function lw(s,h,w){let S=await Promise.all(s.map(async M=>{let O=h.routes[M.route.id];if(O){let A=await ow(O,w);return A.links?A.links():[]}return[]}));return dw(S.flat(1).filter(aw).filter(M=>M.rel==="stylesheet"||M.rel==="preload").map(M=>M.rel==="stylesheet"?{...M,rel:"prefetch",as:"style"}:{...M,rel:"prefetch"}))}function Qm(s,h,w,S,M,O){let A=(u,d)=>w[d]?u.route.id!==w[d].route.id:!0,r=(u,d)=>{var g;return w[d].pathname!==u.pathname||((g=w[d].route.path)==null?void 0:g.endsWith("*"))&&w[d].params["*"]!==u.params["*"]};return O==="assets"?h.filter((u,d)=>A(u,d)||r(u,d)):O==="data"?h.filter((u,d)=>{var l;let g=S.routes[u.route.id];if(!g||!g.hasLoader)return!1;if(A(u,d)||r(u,d))return!0;if(u.route.shouldRevalidate){let m=u.route.shouldRevalidate({currentUrl:new URL(M.pathname+M.search+M.hash,window.origin),currentParams:((l=w[0])==null?void 0:l.params)||{},nextUrl:new URL(s,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof m=="boolean")return m}return!0}):[]}function cw(s,h,{includeHydrateFallback:w}={}){return uw(s.map(S=>{let M=h.routes[S.route.id];if(!M)return[];let O=[M.module];return M.clientActionModule&&(O=O.concat(M.clientActionModule)),M.clientLoaderModule&&(O=O.concat(M.clientLoaderModule)),w&&M.hydrateFallbackModule&&(O=O.concat(M.hydrateFallbackModule)),M.imports&&(O=O.concat(M.imports)),O}).flat(1))}function uw(s){return[...new Set(s)]}function hw(s){let h={},w=Object.keys(s).sort();for(let S of w)h[S]=s[S];return h}function dw(s,h){let w=new Set;return new Set(h),s.reduce((S,M)=>{let O=JSON.stringify(hw(M));return w.has(O)||(w.add(O),S.push({key:O,link:M})),S},[])}function vv(){let s=j.useContext(xr);return Eh(s,"You must render this element inside a <DataRouterContext.Provider> element"),s}function fw(){let s=j.useContext(Sl);return Eh(s,"You must render this element inside a <DataRouterStateContext.Provider> element"),s}var Lh=j.createContext(void 0);Lh.displayName="FrameworkContext";function _v(){let s=j.useContext(Lh);return Eh(s,"You must render this element inside a <HydratedRouter> element"),s}function pw(s,h){let w=j.useContext(Lh),[S,M]=j.useState(!1),[O,A]=j.useState(!1),{onFocus:r,onBlur:u,onMouseEnter:d,onMouseLeave:g,onTouchStart:l}=h,m=j.useRef(null);j.useEffect(()=>{if(s==="render"&&A(!0),s==="viewport"){let p=c=>{c.forEach(a=>{A(a.isIntersecting)})},o=new IntersectionObserver(p,{threshold:.5});return m.current&&o.observe(m.current),()=>{o.disconnect()}}},[s]),j.useEffect(()=>{if(S){let p=setTimeout(()=>{A(!0)},100);return()=>{clearTimeout(p)}}},[S]);let b=()=>{M(!0)},C=()=>{M(!1),A(!1)};return w?s!=="intent"?[O,m,{}]:[O,m,{onFocus:_o(r,b),onBlur:_o(u,C),onMouseEnter:_o(d,b),onMouseLeave:_o(g,C),onTouchStart:_o(l,b)}]:[!1,m,{}]}function _o(s,h){return w=>{s&&s(w),w.defaultPrevented||h(w)}}function mw({page:s,...h}){let{router:w}=vv(),S=j.useMemo(()=>sv(w.routes,s,w.basename),[w.routes,s,w.basename]);return S?j.createElement(vw,{page:s,matches:S,...h}):null}function gw(s){let{manifest:h,routeModules:w}=_v(),[S,M]=j.useState([]);return j.useEffect(()=>{let O=!1;return lw(s,h,w).then(A=>{O||M(A)}),()=>{O=!0}},[s,h,w]),S}function vw({page:s,matches:h,...w}){let S=ss(),{future:M,manifest:O,routeModules:A}=_v(),{basename:r}=vv(),{loaderData:u,matches:d}=fw(),g=j.useMemo(()=>Qm(s,h,d,O,S,"data"),[s,h,d,O,S]),l=j.useMemo(()=>Qm(s,h,d,O,S,"assets"),[s,h,d,O,S]),m=j.useMemo(()=>{if(s===S.pathname+S.search+S.hash)return[];let p=new Set,o=!1;if(h.forEach(a=>{var y;let f=O.routes[a.route.id];!f||!f.hasLoader||(!g.some(R=>R.route.id===a.route.id)&&a.route.id in u&&((y=A[a.route.id])!=null&&y.shouldRevalidate)||f.hasClientLoader?o=!0:p.add(a.route.id))}),p.size===0)return[];let c=rw(s,r,M.unstable_trailingSlashAwareDataRequests,"data");return o&&p.size>0&&c.searchParams.set("_routes",h.filter(a=>p.has(a.route.id)).map(a=>a.route.id).join(",")),[c.pathname+c.search]},[r,M.unstable_trailingSlashAwareDataRequests,u,S,O,g,h,s,A]),b=j.useMemo(()=>cw(l,O),[l,O]),C=gw(l);return j.createElement(j.Fragment,null,m.map(p=>j.createElement("link",{key:p,rel:"prefetch",as:"fetch",href:p,...w})),b.map(p=>j.createElement("link",{key:p,rel:"modulepreload",href:p,...w})),C.map(({key:p,link:o})=>j.createElement("link",{key:p,nonce:w.nonce,...o,crossOrigin:o.crossOrigin??w.crossOrigin})))}function _w(...s){return h=>{s.forEach(w=>{typeof w=="function"?w(h):w!=null&&(w.current=h)})}}var bw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{bw&&(window.__reactRouterVersion="7.13.2")}catch{}function yw({basename:s,children:h,unstable_useTransitions:w,window:S}){let M=j.useRef();M.current==null&&(M.current=Zb({window:S,v5Compat:!0}));let O=M.current,[A,r]=j.useState({action:O.action,location:O.location}),u=j.useCallback(d=>{w===!1?r(d):j.startTransition(()=>r(d))},[w]);return j.useLayoutEffect(()=>O.listen(u),[O,u]),j.createElement(Xy,{basename:s,children:h,location:A.location,navigationType:A.action,navigator:O,unstable_useTransitions:w})}var bv=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,es=j.forwardRef(function({onClick:h,discover:w="render",prefetch:S="none",relative:M,reloadDocument:O,replace:A,unstable_mask:r,state:u,target:d,to:g,preventScrollReset:l,viewTransition:m,unstable_defaultShouldRevalidate:b,...C},p){let{basename:o,navigator:c,unstable_useTransitions:a}=j.useContext(Xi),f=typeof g=="string"&&bv.test(g),y=lv(g,o);g=y.to;let R=jy(g,{relative:M}),k=ss(),D=null;if(r){let X=Sh(r,[],k.unstable_mask?k.unstable_mask.pathname:"/",!0);o!=="/"&&(X.pathname=X.pathname==="/"?o:us([o,X.pathname])),D=c.createHref(X)}let[E,L,z]=pw(S,C),H=Cw(g,{replace:A,unstable_mask:r,state:u,target:d,preventScrollReset:l,relative:M,viewTransition:m,unstable_defaultShouldRevalidate:b,unstable_useTransitions:a});function P(X){h&&h(X),X.defaultPrevented||H(X)}let I=!(y.isExternal||O),K=j.createElement("a",{...C,...z,href:(I?D:void 0)||y.absoluteURL||R,onClick:I?P:h,ref:_w(p,L),target:d,"data-discover":!f&&w==="render"?"true":void 0});return E&&!f?j.createElement(j.Fragment,null,K,j.createElement(mw,{page:R})):K});es.displayName="Link";var ww=j.forwardRef(function({"aria-current":h="page",caseSensitive:w=!1,className:S="",end:M=!1,style:O,to:A,viewTransition:r,children:u,...d},g){let l=zo(A,{relative:d.relative}),m=ss(),b=j.useContext(Sl),{navigator:C,basename:p}=j.useContext(Xi),o=b!=null&&Tw(l)&&r===!0,c=C.encodeLocation?C.encodeLocation(l).pathname:l.pathname,a=m.pathname,f=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;w||(a=a.toLowerCase(),f=f?f.toLowerCase():null,c=c.toLowerCase()),f&&p&&(f=As(f,p)||f);const y=c!=="/"&&c.endsWith("/")?c.length-1:c.length;let R=a===c||!M&&a.startsWith(c)&&a.charAt(y)==="/",k=f!=null&&(f===c||!M&&f.startsWith(c)&&f.charAt(c.length)==="/"),D={isActive:R,isPending:k,isTransitioning:o},E=R?h:void 0,L;typeof S=="function"?L=S(D):L=[S,R?"active":null,k?"pending":null,o?"transitioning":null].filter(Boolean).join(" ");let z=typeof O=="function"?O(D):O;return j.createElement(es,{...d,"aria-current":E,className:L,ref:g,style:z,to:A,viewTransition:r},typeof u=="function"?u(D):u)});ww.displayName="NavLink";var Sw=j.forwardRef(({discover:s="render",fetcherKey:h,navigate:w,reloadDocument:S,replace:M,state:O,method:A=cl,action:r,onSubmit:u,relative:d,preventScrollReset:g,viewTransition:l,unstable_defaultShouldRevalidate:m,...b},C)=>{let{unstable_useTransitions:p}=j.useContext(Xi),o=Rw(),c=Dw(r,{relative:d}),a=A.toLowerCase()==="get"?"get":"post",f=typeof r=="string"&&bv.test(r),y=R=>{if(u&&u(R),R.defaultPrevented)return;R.preventDefault();let k=R.nativeEvent.submitter,D=(k==null?void 0:k.getAttribute("formmethod"))||A,E=()=>o(k||R.currentTarget,{fetcherKey:h,method:D,navigate:w,replace:M,state:O,relative:d,preventScrollReset:g,viewTransition:l,unstable_defaultShouldRevalidate:m});p&&w!==!1?j.startTransition(()=>E()):E()};return j.createElement("form",{ref:C,method:a,action:c,onSubmit:S?u:y,...b,"data-discover":!f&&s==="render"?"true":void 0})});Sw.displayName="Form";function xw(s){return`${s} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function yv(s){let h=j.useContext(xr);return Yt(h,xw(s)),h}function Cw(s,{target:h,replace:w,unstable_mask:S,state:M,preventScrollReset:O,relative:A,viewTransition:r,unstable_defaultShouldRevalidate:u,unstable_useTransitions:d}={}){let g=xl(),l=ss(),m=zo(s,{relative:A});return j.useCallback(b=>{if(ew(b,h)){b.preventDefault();let C=w!==void 0?w:Ro(l)===Ro(m),p=()=>g(s,{replace:C,unstable_mask:S,state:M,preventScrollReset:O,relative:A,viewTransition:r,unstable_defaultShouldRevalidate:u});d?j.startTransition(()=>p()):p()}},[l,g,m,w,S,M,h,s,O,A,r,u,d])}function kw(s){is(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let h=j.useRef(ah(s)),w=j.useRef(!1),S=ss(),M=j.useMemo(()=>tw(S.search,w.current?null:h.current),[S.search]),O=xl(),A=j.useCallback((r,u)=>{const d=ah(typeof r=="function"?r(new URLSearchParams(M)):r);w.current=!0,O("?"+d,u)},[O,M]);return[M,A]}var Ew=0,Lw=()=>`__${String(++Ew)}__`;function Rw(){let{router:s}=yv("useSubmit"),{basename:h}=j.useContext(Xi),w=qy(),S=s.fetch,M=s.navigate;return j.useCallback(async(O,A={})=>{let{action:r,method:u,encType:d,formData:g,body:l}=nw(O,h);if(A.navigate===!1){let m=A.fetcherKey||Lw();await S(m,w,A.action||r,{unstable_defaultShouldRevalidate:A.unstable_defaultShouldRevalidate,preventScrollReset:A.preventScrollReset,formData:g,body:l,formMethod:A.method||u,formEncType:A.encType||d,flushSync:A.flushSync})}else await M(A.action||r,{unstable_defaultShouldRevalidate:A.unstable_defaultShouldRevalidate,preventScrollReset:A.preventScrollReset,formData:g,body:l,formMethod:A.method||u,formEncType:A.encType||d,replace:A.replace,state:A.state,fromRouteId:w,flushSync:A.flushSync,viewTransition:A.viewTransition})},[S,M,h,w])}function Dw(s,{relative:h}={}){let{basename:w}=j.useContext(Xi),S=j.useContext(hs);Yt(S,"useFormAction must be used inside a RouteContext");let[M]=S.matches.slice(-1),O={...zo(s||".",{relative:h})},A=ss();if(s==null){O.search=A.search;let r=new URLSearchParams(O.search),u=r.getAll("index");if(u.some(g=>g==="")){r.delete("index"),u.filter(l=>l).forEach(l=>r.append("index",l));let g=r.toString();O.search=g?`?${g}`:""}}return(!s||s===".")&&M.route.index&&(O.search=O.search?O.search.replace(/^\?/,"?index&"):"?index"),w!=="/"&&(O.pathname=O.pathname==="/"?w:us([w,O.pathname])),Ro(O)}function Tw(s,{relative:h}={}){let w=j.useContext(uv);Yt(w!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:S}=yv("useViewTransitionState"),M=zo(s,{relative:h});if(!w.isTransitioning)return!1;let O=As(w.currentLocation.pathname,S)||w.currentLocation.pathname,A=As(w.nextLocation.pathname,S)||w.nextLocation.pathname;return fl(M.pathname,A)!=null||fl(M.pathname,O)!=null}var zi=iv();const J2=yh(zi);class pl extends Error{constructor(h,w){super(w),this.status=h}}async function kl(s,h,w){const S={method:s,credentials:"include",headers:{"Content-Type":"application/json"}};w!==void 0&&(S.body=JSON.stringify(w));const M=await fetch(h,S);if(M.status===401)throw window.dispatchEvent(new CustomEvent("auth:unauthorized")),new pl(401,"Unauthorized");if(!M.ok){const O=await M.text().catch(()=>"");let A="";try{A=JSON.parse(O).error??""}catch{}throw A||(console.error("[api]",s,h,M.status,O),A=`HTTP ${M.status}`),new pl(M.status,A)}if(M.status!==204)return M.json()}function bt(s){return kl("GET",s)}function nt(s,h){return kl("POST",s,h)}function Di(s,h){return kl("PUT",s,h)}function Cr(s){return kl("DELETE",s)}function Zm(s,h=!1){return nt("/api/auth/login",{password:s,remember:h})}function eg(){return nt("/api/auth/logout")}function Mw(){return bt("/api/auth/status")}function Aw(s,h){return nt("/api/auth/setup",{password:s,confirmPassword:h})}function wv(s,h,w){return Di("/api/auth/password",{oldPassword:s,newPassword:h,confirmPassword:w})}function jw(){const[s,h]=j.useState(!1),[w,S]=j.useState(!0),[M,O]=j.useState(!1),[A,r]=j.useState(!0);j.useEffect(()=>{Mw().then(m=>{h(m.authenticated),S(m.authRequired),O(m.setupRequired)}).catch(()=>h(!1)).finally(()=>r(!1))},[]),j.useEffect(()=>{const m=()=>h(!1);return window.addEventListener("auth:unauthorized",m),()=>window.removeEventListener("auth:unauthorized",m)},[]);const u=j.useCallback(async(m,b)=>{await Zm(m,b),h(!0)},[]),d=j.useCallback(async()=>{await eg(),h(!1)},[]),g=j.useCallback(async(m,b)=>{await Aw(m,b),O(!1),h(!0)},[]),l=j.useCallback(async(m,b,C,p)=>{await Zm(m,p);try{await wv(m,b,C)}catch(o){throw await eg().catch(()=>{}),o}h(!0)},[]);return{authenticated:s,authRequired:w,setupRequired:M,loading:A,login:u,logout:d,setup:g,changePassword:l}}const Ow=1;function Bw(s){const[h,w]=j.useState(!1),S=j.useRef(null),M=j.useRef(new Set),O=j.useRef(new Map),A=j.useRef(void 0),r=j.useRef(0),u=j.useCallback(()=>{if(!s)return;const b=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`,C=new WebSocket(b);C.binaryType="arraybuffer",S.current=C,C.onopen=()=>{w(!0),r.current=0},C.onmessage=p=>{if(p.data instanceof ArrayBuffer){const o=new Uint8Array(p.data);if(o.length<2||o[0]!==Ow)return;const c=o[1];if(o.length<2+c)return;const a=new TextDecoder("utf-8").decode(o.subarray(2,2+c)),f=o.subarray(2+c),y=O.current.get(a);if(y)for(const R of y)try{R(f)}catch{}return}try{const o=JSON.parse(p.data);M.current.forEach(c=>c(o))}catch{}},C.onclose=()=>{w(!1),S.current=null;const p=Math.min(1e3*2**r.current,3e4);r.current++,A.current=setTimeout(u,p)},C.onerror=()=>{C.close()}},[s]);j.useEffect(()=>(u(),()=>{A.current&&clearTimeout(A.current),S.current&&S.current.close()}),[u]);const d=j.useCallback(m=>(M.current.add(m),()=>{M.current.delete(m)}),[]),g=j.useCallback(m=>{S.current&&S.current.readyState===WebSocket.OPEN&&S.current.send(JSON.stringify(m))},[]),l=j.useCallback((m,b)=>{let C=O.current.get(m);return C||(C=new Set,O.current.set(m,C)),C.add(b),()=>{const p=O.current.get(m);p&&(p.delete(b),p.size===0&&O.current.delete(m))}},[]);return{connected:h,onEvent:d,sendMessage:g,subscribeBinary:l}}const Rh=new Map;function Nw(s){Rh.set(s.id,s)}function Q2(){return Array.from(Rh.values())}function zw(){const s={},h={};for(const w of Rh.values())Object.assign(s,w.translations.en),Object.assign(h,w.translations.ko);return{en:s,ko:h}}const Hw={en:{"login.title":"CLITrigger","login.subtitle":"Authentication Required","login.password":"Enter password","login.rememberMe":"Keep me logged in","login.submit":"Sign In","login.loading":"Authenticating…","login.error":"Access denied. Please try again.","login.footer":"Secure Access","login.changePassword":"Change password","login.backToLogin":"Back to sign in","login.changeSubmit":"Change password & sign in","login.forgot":"Forgot your password?","login.forgotHint":'Resetting requires access to the machine running the server. Run "clitrigger reset-password" in a terminal (desktop app: Help → Reset password menu), then set a new password on this screen.',"login.disclaimer":'This software is provided "as is" without any warranties. Users are solely responsible for all actions taken using this tool, including any costs incurred from AI CLI usage, data loss, or unintended code changes. The developers assume no liability for any direct, indirect, or consequential damages arising from use.',"setup.title":"Welcome to CLITrigger","setup.subtitle":"Set a password to secure this instance","setup.password":"New password","setup.confirm":"Confirm password","setup.submit":"Create password","setup.loading":"Saving…","setup.tooShort":"Password must be at least 8 characters.","setup.mismatch":"Passwords do not match.","setup.tunnelPaused":"External sharing (Cloudflare tunnel) is paused until setup completes.","setup.error":"Failed to save password.","errors.unexpected":"Something went wrong. Please try again.","errors.renderTitle":"CLITrigger could not display this screen","errors.renderDescription":"Your data is safe. Reload the app to restore the screen.","errors.reload":"Reload app","errors.projectsLoad":"Failed to load projects.","errors.projectCreate":"Failed to create the project.","errors.projectDelete":"Failed to delete the project.","projects.cleanupPartialFailed":"Cleanup partially failed: {details}","common.ok":"OK","common.cancel":"Cancel","sidebar.home":"Home","sidebar.review":"Review Queue","sidebar.agenda":"My Schedule","agenda.title":"My Schedule","agenda.subtitle":"Personal notes and agenda, plus routines across all projects","agenda.today":"Today","agenda.refresh":"Refresh","agenda.refreshHelp":"Re-fetches the current range: memos, project routines/planner, and assigned Jira issues. The view also refreshes when you navigate or switch views; it does not poll while idle.","agenda.view.month":"Month","agenda.view.week":"Week","agenda.view.day":"Day","agenda.view.table":"Table","agenda.addItem":"Add item","agenda.expand":"Expand","agenda.collapse":"Collapse","agenda.tags.all":"All","agenda.tags.placeholder":"Add tag…","agenda.resizePanel":"Drag to resize","agenda.resizeCalendar":"Drag to resize the calendar","agenda.untitled":"(untitled)","agenda.source.personal":"Memos","agenda.source.schedule":"Routines","agenda.source.planner":"Planner","agenda.source.jira":"Jira","agenda.jira.settings":"Jira connection","agenda.jira.subtitle":"See the Jira tasks assigned to you right here on your calendar.","agenda.jira.enable":"Show Jira issues assigned to me","agenda.jira.baseUrlLabel":"Jira site address","agenda.jira.baseUrlHint":"The address you use to open Jira: the part at the very start of your browser's address bar. e.g. https://yourcompany.atlassian.net","agenda.jira.emailLabel":"Login email","agenda.jira.emailHint":"The email you sign in to Jira (Atlassian) with.","agenda.jira.tokenLabel":"API token","agenda.jira.tokenPlaceholder":"Paste your API token","agenda.jira.tokenLink":"Create an API token","agenda.jira.tokenStep1":"1. Open the link above and sign in.","agenda.jira.tokenStep2":'2. Click "Create API token", give it any name.',"agenda.jira.tokenStep3":"3. Copy it and paste it into the box above. (Not your password; a separate token.)","agenda.jira.criteria":"Import criteria","agenda.jira.criteriaHint":"Choose which issues show up on the calendar and can be imported.","agenda.jira.assigneeMe":"Only issues assigned to me","agenda.jira.includeDone":"Include done issues","agenda.jira.projects":"Projects","agenda.jira.projectsHint":"Limit to these project keys (comma or space separated). Leave empty for all.","agenda.jira.statuses":"Statuses to import","agenda.jira.statusesHint":'Only issues in the checked statuses are imported. Leave all unchecked to use "Include done issues" above instead.',"agenda.jira.statusesLoad":"Load statuses","agenda.jira.statusesLoading":"Loading…","agenda.jira.statusesNeedConn":"Save & test the connection first to load statuses.","agenda.jira.statusesSearch":"Filter statuses…","agenda.jira.statusesEmpty":'No statuses loaded. Click "Load statuses".',"agenda.jira.dismiss":"Hide from my schedule","agenda.jira.dismissedTitle":"Hidden Jira issues","agenda.jira.restore":"Restore","agenda.jira.extraJql":"Advanced (JQL)","agenda.jira.extraJqlHint":"Extra JQL, AND-ed with the above. e.g. labels = urgent AND priority >= High","agenda.jira.test":"Test connection","agenda.jira.tokenSaved":"Token saved (leave blank to keep)","agenda.jira.hint":'Open issues assigned to you are pulled in. Due-dated ones land on the calendar; the rest are listed under "Jira (no due date)". Auth uses your email + API token.',"agenda.jira.import":"Add to my schedule","agenda.jira.noDue":"Jira (no due date)","agenda.jira.error":"Jira error","agenda.moveToPlanner":"Move to planner","agenda.importToPlanner":"Add to planner","agenda.pickProject":"Select a project","agenda.noProjects":"No projects","agenda.table.name":"Name","agenda.table.date":"Date","agenda.table.kind":"Type","agenda.table.status":"Status","agenda.kind.personal":"Memo","agenda.kind.schedule":"Routine","agenda.kind.planner":"Planner","agenda.kind.jira":"Jira","agenda.status.done":"Done","agenda.status.pending":"Pending","agenda.add":"Add","agenda.memo":"Memo","agenda.backlog":"No date","agenda.backlogEmpty":"No undated memos","agenda.dayEmpty":"Nothing on this day","agenda.fromSchedule":"Project routine","agenda.fromPlanner":"Project planner","agenda.toggleDone":"Toggle done","agenda.delete":"Delete","agenda.confirmDelete":"Delete this item?","agenda.addTitle":"New item","agenda.editTitle":"Edit item","agenda.titlePlaceholder":"Title","agenda.descPlaceholder":"Notes (optional)","agenda.dateHint":"Leave the date empty for an undated memo. Set a time for a timed item.","agenda.cancel":"Cancel","agenda.save":"Save","agenda.cleanup":"Clean up memos","agenda.cleanup.title":"Delete memos by date range","agenda.cleanup.subtitle":"Bulk-delete personal memos in a date range. This cannot be undone.","agenda.cleanup.from":"From","agenda.cleanup.to":"To","agenda.cleanup.doneOnly":"Only completed memos","agenda.cleanup.includeBacklog":"Also delete undated (backlog) memos","agenda.cleanup.previewLabel":"To delete","agenda.cleanup.unit":"memo(s)","agenda.cleanup.none":"No memos match these conditions","agenda.cleanup.confirm":"Delete","sidebar.workspaces":"Workspaces","sidebar.favorites":"Favorites","sidebar.collapse":"Collapse sidebar","sidebar.expand":"Expand sidebar","favorites.add":"Add favorite","favorites.edit":"Edit favorite","favorites.delete":"Delete","favorites.deleteConfirm":"Delete this favorite?","favorites.launchFailed":"Launch failed","favorites.empty":"No favorites yet.","favorites.form.title.create":"New Favorite","favorites.form.title.edit":"Edit Favorite","favorites.form.name":"Name","favorites.form.type":"Type","favorites.form.target":"Target","favorites.form.browse":"Browse…","favorites.form.targetHint.executable":"Absolute path to .exe / .bat / .sh","favorites.form.targetHint.command":"Shell command (runs as-is)","favorites.form.targetHint.url":"http:// or https:// URL","favorites.form.args":"Arguments (space-separated)","favorites.form.cwd":"Working directory (optional)","favorites.form.create":"Create","favorites.form.save":"Save","favorites.form.cancel":"Cancel","favorites.types.executable":"Executable","favorites.types.command":"Command","favorites.types.url":"URL","favorites.security.notice":"Favorites run on the server with your account. If tunneling is enabled, anyone with the password can launch them.","tunnel.title":"Tunnel Settings","tunnel.description":"Cloudflare tunnel configuration. Set a custom domain to avoid browser warnings on shared *.trycloudflare.com / *.cfargotunnel.com URLs.","tunnel.name.label":"Named tunnel","tunnel.name.placeholder":"my-app","tunnel.name.hint":"Empty = use a random Quick Tunnel (https://*.trycloudflare.com).","tunnel.hostname.label":"Custom domain (optional)","tunnel.hostname.placeholder":"app.your-domain.com","tunnel.hostname.hint":'You must run "cloudflared tunnel route dns" to point this domain at your tunnel first. Empty = fall back to *.cfargotunnel.com.',"tunnel.hostname.invalid":"Enter a valid public domain (e.g. app.your-domain.com).","tunnel.hostname.needsName":"Set a named tunnel first to use a custom domain.","tunnel.guide.toggle":"How to set up a custom domain","tunnel.guide.heading":"One-time setup with the cloudflared CLI:","tunnel.guide.step4":"Enter the tunnel name and domain above and save.","tunnel.guide.note":"Your domain must already be on a Cloudflare account (free plan is fine).","tunnel.status.stopped":"Stopped","tunnel.status.starting":"Starting…","tunnel.status.running":"Running","tunnel.status.error":"Error","tunnel.save":"Save","tunnel.saving":"Saving…","tunnel.saved":"Tunnel settings saved. Restart the tunnel to apply.","tunnel.saveFailed":"Failed to save tunnel settings.","tunnel.close":"Close","tunnel.restart":"Restart tunnel","tunnel.restarting":"Restarting…","tunnel.restarted":"Tunnel restarted.","tunnel.restartFailed":"Failed to restart tunnel.","tunnel.start":"Start tunnel","tunnel.starting":"Starting…","tunnel.urlCopied":"External URL copied to clipboard","settings.title":"Settings","settings.tabs.account":"Account","settings.tabs.session":"Terminals","settings.tabs.tunnel":"Tunnel","settings.tabs.mcp":"MCP","mcp.title":"MCP Connection","mcp.description":"Connect an AI CLI or desktop client to CLITrigger over MCP: list projects, create and run tasks, and check status from your editor. Register one of the two ways below and keep this server running.","mcp.loading":"Loading connection info…","mcp.config.label":"Option A · Paste this config (Claude Desktop and other JSON clients)","mcp.commands.label":"Option B · Run one command in your CLI","mcp.commands.hint":"Copy the line for the CLI you use. Each registers CLITrigger over HTTP transport.","mcp.copy":"Copy","mcp.copied":"Copied to clipboard","mcp.copyFailed":"Copy failed","mcp.tokenNote":"This token grants full API access to anyone who can reach this server. Treat it like a password.","mcp.close":"Close","sessionSettings.title":"Terminal preferences","sessionSettings.description":"Default behavior for new terminals and reusable color tags.","sessionSettings.saved":"Saved","sessionSettings.worktree.title":"Worktree default","sessionSettings.worktree.label":"Use git worktree for new terminals","sessionSettings.worktree.hint":"When enabled, every new terminal is created on its own branch in .worktrees/. Only applies to git repos.","sessionSettings.fontSize.title":"Default font size","sessionSettings.fontSize.label":"Font size for new terminals (px)","sessionSettings.fontSize.hint":"Terminals you have not zoomed yet inherit this value live. Per-terminal zoom (Ctrl+wheel, A−/A+) overrides it.","sessionSettings.tags.title":"Tags","sessionSettings.tags.description":"Pick a name and color, then assign in the terminal form.","sessionSettings.tags.empty":"No tags yet. Add one above.","sessionSettings.tags.namePlaceholder":"Tag name (e.g. exploring, deploy)","sessionSettings.tags.color":"Color","sessionSettings.tags.add":"Add","sessionSettings.tags.edit":"Edit","sessionSettings.tags.delete":"Delete","sessionSettings.tags.save":"Save","sessionSettings.tags.cancel":"Cancel","sessionSettings.tags.deleteConfirm":'Delete tag "{name}"? Terminals tagged with it will become untagged.',"sessionSettings.aliases.title":"Terminal aliases","sessionSettings.aliases.description":"Saved command snippets. Click the ⌘ icon in a terminal window's titlebar to insert one as input; Enter is yours to press.","sessionSettings.aliases.namePlaceholder":"Name (e.g. WSL Ubuntu)","sessionSettings.aliases.commandPlaceholder":"Command (e.g. wsl -d Ubuntu)","sessionSettings.aliases.add":"Add","sessionSettings.aliases.empty":"No aliases yet.","sessionSettings.aliases.deleteConfirm":'Delete alias "{name}"? Sessions using it will fall back to the OS default shell.',"common.save":"Save","common.edit":"Edit","common.delete":"Delete","session.tag.none":"No tag","account.title":"Change password","account.description":"Enter your current password, then choose a new one.","account.oldPassword":"Current password","account.newPassword":"New password","account.confirm":"Confirm new password","account.tooShort":"Password must be at least 8 characters.","account.mismatch":"Passwords do not match.","account.save":"Save","account.saving":"Saving…","account.saved":"Password updated. Other sessions will be signed out.","account.saveFailed":"Failed to update password.","account.close":"Close","review.title":"Review Queue","review.subtitle":"Triage overnight todos across all projects","review.refresh":"Refresh","review.empty":"Nothing to review in this window.","review.viewDetails":"View","review.approve":"Approve & Merge","review.requestChanges":"Request changes","review.discard":"Discard","review.cancel":"Cancel","review.send":"Send","review.continuePlaceholder":"Describe what to fix or change…","review.discardConfirm":"Discard this todo and clean up its worktree?","review.mergeFailed":"Merge failed","review.continueFailed":"Continue failed","review.discardFailed":"Discard failed","review.closeDetails":"Close details","review.justNow":"just now","review.minAgo":"m ago","review.hourAgo":"h ago","review.dayAgo":"d ago","review.files":"files","review.lines":"lines","review.rounds":"rounds","review.window.12h":"Last 12h","review.window.24h":"Last 24h","review.window.7d":"Last 7d","review.filter.all":"All","review.filter.risky":"Risky","review.filter.quickWins":"Quick wins","review.filter.failed":"Failed","review.risk.low":"Low risk","review.risk.medium":"Medium risk","review.risk.high":"High risk","review.tokens.total":"Total tokens","review.tokens.todos":"Todos","review.tokens.byCli":"By CLI tool","review.diff.empty":"No changes against the base branch.","review.diff.noBranch":"Diff unavailable: this todo has no branch (ran on the main branch).","review.diff.branchMissing":"Diff unavailable: branch was deleted.","review.diff.baseBranchMissing":"Diff unavailable: base branch not found in repo. Check the project's default_branch setting.","review.diff.notFound":"Todo not found.","projects.title":"All Projects","projects.subtitle":"Project Console","projects.new":"New Project","projects.logout":"Sign Out","projects.loading":"Loading projects…","projects.empty":"No projects yet","projects.emptyHint":"Create your first project to get started.","projects.tasks":"tasks","projects.active":"active","projects.done":"done","projects.search":"Search projects…","projects.delete":"Delete project","projects.deleteConfirm":"Are you sure you want to delete this project?","projects.pathMissing":"Path not found","projects.pathMissingConfirm":"The local folder for this project no longer exists. Delete it?","projects.noGit":"No Git","detail.back":"Projects","detail.loading":"Loading…","detail.notFound":"Project not found","detail.backToProjects":"Back to Projects","detail.live":"Connected","header.branch":"Branch","header.editName":"Click to rename project","header.openFolder":"Open folder","header.workers":"Workers","header.model":"Model","header.settings":"Settings","header.runAll":"Run All","header.stopAll":"Stop All","header.config":"Project Settings","header.execConfig":"Automation Settings","header.execConfigHint":"Applies to Tasks, Discussions, and Routines.","header.maxWorkers":"Max Workers","settings.defaultMaxTurns":"Default Max Turns","settings.defaultMaxTurnsHint":"Default turn limit per task. Tasks can override individually.","header.cliTool":"CLI Tool","header.cliFlags":"CLI Flags","header.cancel":"Cancel","header.save":"Save","header.saving":"Saving…","header.noGit":"No Git","header.noGitHint":'This project is not a git repository. Tasks will run directly without worktree isolation. Run "git init" in the project path, then re-check.',"header.recheckGit":"Re-check Git Status","header.fallbackChainTitle":"CLI Fallback Chain","header.fallbackChainHint":"When a CLI tool runs out of context, automatically switch to the next tool in the chain.","header.autoReviewerTitle":"Auto Reviewer","header.autoReviewerHint":"When a task assigned to the worker CLI completes successfully, automatically create a follow-up review task for the reviewer CLI.","header.autoReviewerEnable":"Enable auto review","header.autoReviewerFrom":"Worker CLI","header.autoReviewerTo":"Reviewer CLI","header.sandboxTitle":"Sandbox Mode","header.sandboxBadgeStrict":"Sandbox: Strict","header.sandboxBadgePermissive":"Sandbox: Permissive","header.sandboxStrict":"Strict (Recommended)","header.sandboxStrictDesc":"CLI tools can only access files within the worktree directory.","header.sandboxPermissive":"Permissive","header.sandboxPermissiveDesc":"CLI tools can access any file on the system.","header.sandboxWarning":"Warning: In permissive mode, CLI tools can access files outside the worktree. Use with caution.","header.worktreeTitle":"Worktree Isolation","header.worktreeEnabled":"Worktree (Recommended)","header.worktreeEnabledDesc":"Each task runs in its own branch. Safe for parallel tasks.","header.worktreeDisabled":"Direct (Main Branch)","header.worktreeDisabledDesc":"Tasks run on the main branch. Max workers forced to 1.","header.worktreeWarning":"Warning: Tasks will modify the main branch directly. Concurrent execution is disabled.","header.npmAutoInstallLabel":"Auto-run `npm install` on worktree creation","header.npmAutoInstallHint":"Lets agents run test/build inside the worktree immediately for npm projects. Disable for pnpm/yarn/bun or non-npm projects.","header.autoCommitLabel":"Auto-commit leftover changes","header.autoCommitHint":"Commits uncommitted worktree changes when a task or session ends, and before merging a worktree branch. When off, merging a worktree with uncommitted changes is refused.","header.noWorktreeBadge":"No Worktree","header.debugBadge":"Debug Logs","header.showTokenUsageTitle":"Token Usage Display","header.showTokenUsageDesc":"Show token usage (input/output) after task completion.","header.showTokenUsageEnable":"Show token usage","header.debugLoggingTitle":"Debug Logging","header.debugLoggingDesc":"Save full CLI input/output to .debug-logs/ for each task execution.","header.debugLoggingEnable":"Enable debug log files","header.usageLimit":"Usage","header.cliNotInstalled":"{tool} is not installed","header.cliInstalled":"Installed","header.cliNotFound":"Not installed","header.cliInstallHint.claude":"npm install -g @anthropic-ai/claude-code","header.cliInstallHint.antigravity":"curl -fsSL https://antigravity.google/cli/install.sh | bash","header.cliInstallHint.codex":"npm install -g @openai/codex","header.cliRefresh":"Re-check","form.newProject":"New Project","form.projectName":"Project Name","form.folderPath":"Folder Path","form.cancel":"Cancel","form.create":"Create","form.creating":"Creating…","form.createError":"Failed to create project","browse.title":"Browse Folder","browse.select":"Select","browse.loading":"Loading…","browse.error":"Failed to load directory","browse.empty":"No folders found","todos.title":"Tasks","todos.add":"Add Task","todos.empty":"No tasks yet","todos.emptyHint":"Add a task to begin.","todos.merge":"Merge","todos.filterAll":"All","todos.filterActive":"In Progress","todos.filterCompleted":"Completed","todos.filterCancelled":"Cancelled","todos.filterEmpty":"No tasks in this filter.","todos.stackModeOn":"Stack mode on. Click again to disable.","todos.stackModeOff":"Enable stack mode (iOS-style collapse)","todos.collapseStack":"Collapse to stack","todos.expandStack":"Click to expand","todo.description":"Description","todo.noDescription":"No description provided.","todo.attachedImages":"Attached Images","todo.branch":"Branch","todo.path":"Path","todo.worktree":"Worktree","todo.result":"Result","todo.mergeFailed":"Merge failed","todo.diffError":"Diff error","todo.diffOutput":"Changes","todo.files":"files","todo.systemLog":"Activity Log","todo.start":"Start","todo.startHeadless":"Headless","todo.startHeadlessDesc":"Runs autonomously. All permissions auto-approved. No user input needed.","todo.startInteractive":"Interactive","todo.startInteractiveDesc":"Keeps stdin open so you can send messages during execution.","todo.startVerbose":"Verbose","todo.startVerboseDesc":"Auto-approved + full raw log output in real-time.","todo.sendPlaceholder":"Type a message…","todo.startWithDependency":"Start parent task first","todo.stop":"Stop","todo.viewDiff":"View Diff","todo.hideDiff":"Hide Diff","todo.viewDebugLog":"Debug Log","todo.merge":"Merge","todo.mergeChain":"Merge Chain","todo.mergeChainDesc":"Merge all tasks in this chain to main branch","todo.chainComplete":"Chain Complete","todo.chainTasks":"{count} tasks","todo.edit":"Edit","todo.delete":"Delete","todo.cleanup":"Clean up worktree","todo.cleanupFailed":"Cleanup failed","cleanup.confirmDeleteBranch":`Worktree will be removed. Also delete branch "{name}"?
|
|
62
|
+
|
|
63
|
+
OK = delete worktree + branch
|
|
64
|
+
Cancel = delete worktree only`,"todo.retry":"Retry","todo.retryDesc":"Cleans up previous worktree, clears logs, and re-runs from scratch.","todo.retryFailed":"Retry failed","todo.continue":"Continue","todo.continueDesc":"Run a follow-up prompt in the same worktree, preserving prior work.","todo.continuing":"Continuing…","todo.confirmContinue":"Run follow-up","todo.continuePromptLabel":"Follow-up prompt","todo.continuePromptPlaceholder":"Describe the next step or fix to apply in this worktree…","todo.continuePromptRequired":"Follow-up prompt is required.","todo.roundLabel":"round","todo.dependsOn":"Depends on","todo.mergedFrom":"Inherited from","todo.transferredTo":"Transferred to","todo.schedule":"Schedule","todo.scheduleDesc":"Convert this task into a one-time routine run.","todo.scheduleAt":"Run at","todo.scheduling":"Scheduling…","todo.confirmSchedule":"Schedule","todo.scheduleKeepOriginal":"Keep original task","todo.scheduleOnReset":"Run on Reset","todo.scheduleOnResetDesc":"Auto-run a new task when the rate limit resets.","todo.scheduleOnResetLabel":"Rate limit resets at","todo.resetPromptPlaceholder":"Enter the prompt to run after rate limit resets…","todo.confirmResetSchedule":"Schedule on Reset","todoForm.titlePlaceholder":"e.g. Fix login redirect bug","todoForm.descPlaceholder":"Description (optional)…","todoForm.cliTool":"CLI Tool","todoForm.addImage":"Add Image","todoForm.pasteHint":"Ctrl+V to paste image","todoForm.images":"Images","todoForm.maxTurns":"Max Turns","todoForm.maxTurnsPlaceholder":"No limit","todoForm.maxTurnsHint":"Limit the number of agentic turns to prevent excessive token usage.","todoForm.loopEnable":"Repeat until a done rule is satisfied (loop)","todoForm.loopHint":"After each round the done rules are checked; if unmet, the task runs again in the same worktree with the check output.","todoForm.loopMaxRounds":"Max rounds","todoForm.loopMaxCost":"Cost cap (USD)","todoForm.loopMaxCostPlaceholder":"None","todoForm.loopCheck":"Verification command","todoForm.loopCheckHint":"Runs in the working directory after each round. Exit code 0 = done.","todoForm.loopDonePhrase":"Done phrase","todoForm.loopDonePhraseHint":"The loop ends when the agent's final message contains this text.","todoForm.loopNoDoneRule":"No done rule set: the loop will simply run for the max number of rounds.","todoForm.loopRules":"Rules for every round","todoForm.loopRulesPlaceholder":"e.g. Fix one failing test at a time and commit. Never touch src/legacy.","todoForm.loopRulesHint":"Appended to the prompt of every round.","todoForm.loopStopWhenNoChanges":"Stop if a round makes no commits","todoForm.loopResume":"Resume the CLI session between rounds","todoForm.loopResumeHint":"Off (recommended): each round starts with a fresh context and relies on git history plus the check output.","header.loopDefaultsTitle":"Default Loop Rules","header.loopDefaultsHint":"Template for new tasks: when a task turns on the loop, these rules are prefilled so you do not retype the verification command each time.","header.loopDefaultsEnable":"Keep a default loop rule template for this project","todoForm.dependsOn":"Depends On","todoForm.noDependency":"None (independent task)","todoForm.dependsOnHint":"This task will wait for the dependency to complete, then squash merge its changes into a new branch.","todoForm.worktreeMode":"Execution Branch","todoForm.worktreeInherit":"Follow project setting","todoForm.worktreeForceOn":"Use worktree (isolated branch)","todoForm.worktreeForceOff":"Run on main branch","todoForm.worktreeProjectDefaultOn":"Project default: worktree","todoForm.worktreeProjectDefaultOff":"Project default: main branch","todoForm.worktreeMainWarning":"Running on main branch blocks other todos from running concurrently.","todoForm.cancel":"Cancel","todoForm.save":"Save","dnd.dropHint":"Run after this task","dnd.removeDep":"Remove dependency","dnd.dropToRemoveDep":"Drop here to remove dependency","dnd.cyclicWarning":"Cannot link: circular dependency","graph.autoLayout":"Auto Layout","graph.listView":"List View","graph.graphView":"Graph View","status.pending":"Idle","status.running":"Running","status.completed":"Done","status.failed":"Failed","status.stopped":"Stopped","status.merged":"Merged","progress.complete":"complete","progress.done":"Done","progress.live":"Running","progress.idle":"Idle","progress.fail":"Failed","progress.stop":"Stopped","progress.merged":"Merged","failure.title":"Failure Reason","failure.exitCode":"Exit code","failure.fix":"Fix This: Creates a new task that analyzes the failure and attempts to fix the issue.","failure.fixPrefix":"[Fix] ","result.duration":"Duration","result.commits":"commits","result.filesChanged":"files changed","result.commitHistory":"Commit History","result.changedFiles":"Changed Files","result.tokenUsage":"Token Usage","result.inputTokens":"input","result.outputTokens":"output","result.totalCost":"Cost","result.cacheTokens":"cache","result.turns":"turns","result.contextUsed":"ctx","result.levelLight":"Light","result.levelModerate":"Moderate","result.levelHigh":"High","result.levelHeavy":"Heavy","log.awaiting":"Awaiting output…","log.waitingResponse":"Waiting for response…","log.noChanges":"No changes detected.","log.copy":"Copy","log.copied":"Copied!","log.viewChat":"Chat","log.viewRaw":"Raw","schedules.title":"Routines","schedules.add":"New Routine","schedules.empty":"No routines yet","schedules.emptyHint":"Create a routine to automate recurring tasks.","schedule.type":"Routine Type","schedule.recurring":"Recurring","schedule.once":"One-time","schedule.runAtLabel":"Run at","schedule.cronExpression":"Frequency","schedule.cronHint":"e.g. */30 * * * * (every 30min), 0 9 * * * (daily 9am), 0 9 * * 1-5 (weekdays 9am)","cron.everyMinutes":"Minutes","cron.hourly":"Hourly","cron.daily":"Daily","cron.weekly":"Weekly","cron.monthly":"Monthly","cron.custom":"Custom","cron.every":"Every","cron.minutesLabel":"minutes","cron.everyHourAt":"Every hour at","cron.minutesPast":"min past","cron.everyDayAt":"Every day at","cron.at":"at","cron.everyMonthOn":"Every month on day","cron.dayAt":"at","cron.expression":"Cron","cron.mon":"Mon","cron.tue":"Tue","cron.wed":"Wed","cron.thu":"Thu","cron.fri":"Fri","cron.sat":"Sat","cron.sun":"Sun","schedule.skipIfRunning":"Skip if previous run still active","schedule.active":"Active","schedule.paused":"Paused","schedule.lastRun":"Last run","schedule.never":"Never","schedule.trigger":"Run Now","schedule.activate":"Activate","schedule.pause":"Pause","schedule.edit":"Edit","schedule.delete":"Delete","schedule.runs":"Run History","schedule.runTriggered":"Triggered","schedule.runSkipped":"Skipped","schedule.runCompleted":"Completed","schedule.runFailed":"Failed","schedule.noRuns":"No runs yet","scheduleForm.titlePlaceholder":"e.g. Nightly dependency audit","scheduleForm.descPlaceholder":"Task description template…","scheduleForm.cliTool":"CLI Tool","scheduleForm.cancel":"Cancel","scheduleForm.save":"Save","tabs.automation":"Automation","tabs.automation.help":"Tasks, Loops, Discussions, and Routines in one place.","tabs.web":"Web","tabs.web.help":"Embed an external site (Notion, docs, dashboards) inside the desktop app.","tabs.projectNavigation":"Project workflow","tabs.group.prepare":"Prepare","tabs.group.execute":"Execute","tabs.group.review":"Review","tabs.tasks":"Auto Tasks","tabs.sessions":"Terminals","tabs.discussions":"Discussions","tabs.schedules":"Routines","tabs.git":"Git","tabs.svn":"SVN","tabs.files":"Documents","tabs.planner":"Planner","tabs.wiki":"Wiki","tabs.analytics":"Analytics","tabs.wiki.help":"Project knowledge graph. Curate nodes/edges and they get injected as a <long_term_memory> block into auto-task and discussion prompts so the LLM keeps context across runs.","tabs.planner.help":"Lightweight task notes with tags, priorities, and image attachments. Promote favorites into auto tasks or routines, or import/export as Markdown.","tabs.tasks.help":"A task queue: each TODO runs in its own isolated git worktree (Claude/Antigravity/Codex), in parallel up to the concurrency limit, with dependency chains, multi-round continue, and merge automation.","tabs.loops":"Loops","tabs.loops.help":"Tasks that repeat until a done rule is satisfied: a verification command passes or a done phrase appears. Stop rules (max rounds, cost cap, no-commit rounds) keep them bounded.","loops.empty":"No loops yet","loops.emptyHint":"Create a loop to keep an agent iterating until your verification command passes.","todoForm.loopRulesTitle":"Loop rules","tabs.sessions.help":"Drive Claude/Antigravity/Codex interactively in a floating window. Unlike auto tasks (fire-and-forget), terminals stay live so you can type, observe, and steer the CLI in real time.","tabs.discussions.help":"Multi-agent AI discussions over rounds, then optional implementation. Extract action items into the planner when finished.","tabs.schedules.help":"Trigger auto tasks on cron or one-off routines. Supports auto-restart at rate-limit reset times.","tabs.git.help":"Built-in Fork/SourceTree-style Git client: file status, commit graph, branch management, and diff viewer.","tabs.svn.help":"Built-in SVN working-copy panel: file status, revision log, and diff viewer.","svn.fileStatus":"File Status","svn.history":"History","svn.unversioned":"Unversioned","svn.changed":"Changed","svn.groupByDir":"Group by directory","svn.viewFlat":"Flat list","svn.dirFileCount":"{d} dirs · {f} files","svn.fileCount":"{f} files","svn.workingCopyRev":"Working Copy Revision","svn.update":"Update","svn.refresh":"Refresh","svn.add":"Add","svn.revert":"Revert","svn.delete":"Delete","svn.resolve":"Resolve","svn.commitMessagePlaceholder":"Describe the change. Required.","svn.templates":"Templates","svn.noTemplates":"No templates yet","svn.templatePickHint":"Click: append · Shift+click: replace","svn.templateNamePlaceholder":"Name (defaults to first line)","svn.saveTemplate":"Save","svn.saveTemplateHint":"Save the current message as a template","svn.deleteTemplate":"Delete template","svn.commit":"Commit","svn.committing":"Committing…","svn.commitSuccess":"Committed r{rev}","svn.updating":"Updating…","svn.updateProgress":"{n} files","svn.running":"Running {cmd}…","svn.updateSuccess":"Updated to r{rev}","svn.updateConflicts":"Update finished with {n} conflict(s)","svn.previewDiff":"Preview diff","svn.noChanges":"No local changes.","svn.selectFiles":"Select one or more files first.","svn.notSvn":"Not an SVN working copy.","svn.cliMissing":"svn CLI not found. Install Subversion to use this panel.","svn.repoUrl":"Repository URL","svn.relativePath":"Path","svn.viewsHeader":"Views","svn.actionsHeader":"Commands","svn.checkForModifications":"Check for modifications","svn.showLog":"Show log","svn.updateToRevision":"Update to revision…","svn.cleanup":"Clean up","svn.checkRepository":"Check repository","svn.remoteBadge":"remote","svn.remoteHint":"Contacts the SVN server","svn.loadLog":"Load log","svn.logEmptyHint":"The log is fetched from the SVN server. Nothing loads automatically.","svn.loadMore":"Load more","svn.revision":"Revision","svn.revisionPlaceholder":"e.g. 1234 or HEAD","svn.cleaningUp":"Cleaning up…","svn.cleanupSuccess":"Clean up complete","svn.checking":"Checking…","svn.behindCount":"{n} incoming change(s) on server","svn.upToDate":"Up to date with server","svn.resolveWorking":"Mark resolved (keep working copy)","svn.resolveMine":"Resolve using mine","svn.resolveTheirs":"Resolve using theirs","svn.resolveBase":"Resolve using base","svn.viewDiff":"View diff","svn.showRevisionChanges":"Show changes","svn.compareRevisionWithWorking":"Compare with working copy","svn.revisionChangesTitle":"r{rev} changes","svn.compareWithWorkingTitle":"r{rev} ↔ working copy","svn.cancel":"Cancel","svn.properties":"Properties","svn.propertiesOf":"Properties: {target}","svn.workingCopyRoot":"Working copy root","svn.noProperties":"No properties on this item.","svn.editProperty":"Edit","svn.saveProperty":"Save","svn.close":"Close","svn.ext.path":"Path","svn.ext.peg":"Peg","svn.ext.operative":"Operative","svn.ext.localPath":"Local path","svn.ext.revision":"Revision","svn.ext.showLog":"Show log","svn.ext.pickHint":"Click a revision to use it as the peg revision.","svn.ext.new":"New","svn.ext.remove":"Remove","svn.ext.findHead":"Find HEAD-Revision","svn.ext.editText":"Edit as text","svn.ext.editTable":"Edit as table","svn.ext.empty":"No externals defined.","svn.changelistDefault":"Changes","svn.changelistUnversioned":"Unversioned Files","svn.changelistMissing":"Locally Deleted Files","svn.moveToChangelist":"Move to Changelist","svn.newChangelist":"New Changelist…","svn.removeFromChangelist":"Remove from Changelist","svn.changelistNamePlaceholder":"Changelist name","svn.createChangelist":"Create","svn.renameChangelist":"Rename Changelist","svn.deleteChangelist":"Delete Changelist","header.svnTitle":"SVN (Subversion)","header.svnHint":"Off by default. When enabled, the project is checked for a .svn/ working copy and an SVN tab is shown when found.","header.svnEnable":"Enable SVN for this project","header.processesTitle":"Terminal processes","header.processesHint":"CLI processes of the running terminal sessions. Fetched once when this tab opens (2–3 s on Windows).","header.processesRefresh":"Refresh","header.processesSnapshotAt":"Snapshot time","header.processesNoneRunning":"No running terminal","header.processesLoading":"Listing processes…","header.processesNotFound":"Not in this snapshot — exited or just started","header.processesFailed":"Could not list processes: {reason}","header.processesSub":"{count} subprocesses","header.processesSubHint":"Processes the CLI spawned to do its work (shells, hooks, status line…)","header.processesNoSub":"No subprocesses","header.tabShowHint":"On by default. Uncheck to hide this tab in this project.","header.tabShowEnable":"Show the {tab} tab in this project","tabs.files.help":"Markdown document wiki: browse the file tree, preview/edit notes, and explore wikilinks between .md files through graph, backlinks, outline, tags, and search panels.","tabs.analytics.help":"Execution and cost analytics. Token usage by CLI, status distribution, and daily cost trends in interactive charts.","files.root":"Root","files.empty":"Empty folder","files.loading":"Loading…","files.refresh":"Refresh","files.graph":"Wiki graph: wikilink connections between .md files","files.showHidden":"Show hidden files","files.hideHidden":"Hide hidden files","files.copyPath":"Copy path","files.sendToTerminal":"Send to terminal","files.newTerminal":"New terminal","files.includeLinks":"Include linked docs","files.sendToTask":"Create task from file","files.sentToTerminal":"Sent to terminal","files.noActiveSession":"No open session","files.taskCreated":"Task created","files.taskCreateFailed":"Failed to create task","files.hide":"Hide from Documents","files.unhide":"Show in Documents","files.openInOS":"Open in default app","files.revealInExplorer":"Reveal in file manager","files.openFolder":"Open folder in file manager","files.pin":"Pin to top","files.unpin":"Unpin","files.pinned":"Pinned","files.tooLarge":"File too large to preview (max 2 MB).","files.binaryNotPreviewable":"Binary file. Preview not available.","files.download":"Download","files.preview.empty":"Select a file to preview.","files.html.sandboxNotice":"Safe preview: scripts and external resources are blocked.","files.editor.edit":"Edit","files.editor.save":"Save","files.editor.done":"Done","files.editor.saved":"Saved","files.editor.saveFailed":"Save failed","files.editor.conflict":"File changed on disk. Reopen it to see the new content.","files.editor.discardConfirm":"Discard unsaved changes?","vault.onboarding.title":"Set up the Docs tab","vault.onboarding.intro":"The Docs tab scans the project's .md/.html files and shows them as a [[wikilink]] graph. On large projects the first scan and graph render can be slow. A .vaultignore file (gitignore syntax) limits the tab to the documents you pick.","vault.onboarding.step1Title":"Start with everything hidden","vault.onboarding.step1Body":".vaultignore starts with *, so every file is excluded from the Docs tab. Files stay on disk; they are only hidden here.","vault.onboarding.step2Title":"Unhide the documents you need","vault.onboarding.step2Body":'Right-click a grayed-out file or folder in the file explorer and choose "Show in Docs". The hidden-file toggle is turned on for you.',"vault.onboarding.step3Title":"The graph only includes visible documents","vault.onboarding.step3Body":"Only unhidden documents are scanned and graphed. Edit the patterns anytime in the .vaultignore settings on the left rail.","vault.onboarding.startIgnoreAll":"Start with everything hidden (recommended for large projects)","vault.onboarding.startShowAll":"Start with everything visible (fine for small projects)","vault.onboarding.saving":"Saving…","files.editor.dirty":"Modified","files.editor.draftRestored":"Recovered unsaved edits","find.openFind":"Find","find.placeholder":"Find","find.replacePlaceholder":"Replace","find.case":"Match case","find.word":"Match whole word","find.regex":"Use regular expression","find.next":"Next match (Enter)","find.prev":"Previous match (Shift+Enter)","find.replace":"Replace","find.replaceAll":"Replace all","find.close":"Close (Esc)","find.toggleReplace":"Toggle replace","find.noMatches":"No results","annotate.start":"Start drawing","annotate.stop":"Stop drawing","annotate.select":"Select","annotate.pen":"Pen","annotate.highlighter":"Highlighter","annotate.eraser":"Eraser","annotate.color":"Color","annotate.undo":"Undo","annotate.redo":"Redo","annotate.clear":"Clear all","wiki.title":"Wiki","wiki.add":"New Entry","wiki.edit":"Edit","wiki.delete":"Delete","wiki.save":"Save","wiki.saving":"Saving…","wiki.cancel":"Cancel","wiki.empty":"No wiki entries yet","wiki.emptyHint":"Add notes, conventions, and lessons that the LLM should reference when running tasks.","wiki.viewList":"List","wiki.viewGraph":"Graph","wiki.viewHierarchical":"Hierarchy","wiki.viewNetwork":"Network","wiki.searchPlaceholder":"Search wiki…","wiki.backlinks":"Backlinks","wiki.addLink":"Add link to another entry","wiki.addLinkPlaceholder":"Search an entry to link…","wiki.connect.title":"How should these entries be connected?","wiki.connect.wikilink":"Reference (wikilink)","wiki.connect.wikilinkHint":"Inserts [[target title]] into the source body. Free-form mention, no semantic relation.","wiki.connect.edge":"Relation (typed edge)","wiki.connect.edgeHint":"Adds a typed relation (related/precedes/refines/...) you can label.","wiki.allTags":"All tags","wiki.countLabel":"{count} item(s)","wiki.deleteConfirm":"Delete this entry and all its connections?","wiki.noResults":"No results","wiki.noBody":"No content","wiki.connections":"Connections","wiki.outgoing":"Outgoing","wiki.incoming":"Incoming","wiki.autoLayout":"Auto Layout","wiki.form.newTitle":"New entry","wiki.form.editTitle":"Edit entry","wiki.form.title":"Title","wiki.form.titlePlaceholder":"Short, descriptive title","wiki.form.body":"Body (Markdown supported)","wiki.form.bodyPlaceholder":"Write the knowledge or convention you want the LLM to reference…","wiki.form.linkHint":"Type [[ or @ to link another wiki entry.","wiki.form.tags":"Tags","wiki.form.tagsPlaceholder":"Type tag and press Enter","wiki.form.pinned":"Pin to highlight","wiki.edge.editTitle":"Edit Connection","wiki.edge.relationType":"Relation","wiki.edge.label":"Label","wiki.edge.labelPlaceholder":'Optional note (e.g. "see section 3.2")',"wiki.edge.deleteConfirm":"Delete this connection?","wiki.edge.relations.related":"Related","wiki.edge.relations.precedes":"Precedes","wiki.edge.relations.example_of":"Example of","wiki.edge.relations.counter_example":"Counter-example","wiki.edge.relations.refines":"Refines","vault.title":"Documents","vault.empty":"No markdown files found","vault.noResults":"No matching files","vault.searchPlaceholder":"Search files…","vault.graph.addLink":"Add link from here","vault.graph.linkHint":"Click a target node to link · Esc to cancel","vault.graph.showLabels":"Show names","vault.graph.rightClickHint":"Right-click → add link","vault.newFile":"New File","vault.create":"Create","vault.save":"Save","vault.delete":"Delete","vault.unsaved":"unsaved","vault.confirmDelete":"Delete {path}?","vault.backlinks":"Backlinks","vault.filesCount":"files","vault.panel.fileExplorer":"Files","vault.panel.search":"Search","vault.panel.tags":"Tags","vault.panel.graph":"Graph","vault.panel.outline":"Outline","vault.panel.backlinks":"Backlinks","vault.panel.outgoing":"Outgoing Links","vault.panel.preview":"Preview","vault.outline.empty":"No headings in this note","vault.outgoing.empty":"No outgoing wikilinks","vault.backlinks.empty":"No backlinks","vault.tags.empty":"No tags in documents","vault.search.empty":"No matches","vault.search.prompt":"Search across .md notes","vault.activeFile.empty":"Select a file to preview or edit","vault.sidebar.collapse":"Collapse sidebar","vault.sidebar.expand":"Expand sidebar","vault.loadError":"Failed to load documents","vault.retry":"Retry","vault.allHidden":"All documents are hidden by .vaultignore. Right-click a file in the explorer to show it.","vault.ignoreHelp":".vaultignore guide","vaultInject.title":"Document Injection","vaultInject.modeNone":"Off","vaultInject.modeAuto":"Auto","vaultInject.modeAll":"Inject all","vaultInject.modeSelected":"Inject selected","vaultInject.autoHint":"Before each run, the LLM picks up to 10 relevant files from {count} file(s) using the task description as the query.","vaultInject.previewToggle":"Preview","vaultInject.previewChars":"{n} chars","vaultInject.previewTokens":"~{n} tokens","vaultInject.empty":"No .md or .html files in the project root.","vaultInject.injectedCount":"Will inject {count} file(s)","vaultInject.allCount":"Will inject all {count} file(s)","vaultInject.searchPlaceholder":"Filter by name…","vaultInject.loading":"Loading…","vaultInject.includeLinked":"Also pull in 1-hop linked files when I check one","vaultInject.linkedAdded":"+{n} linked","vaultInject.noResults":"No files match.","wiki.ingest":"Ingest","wiki.ingest.title":"Ingest Source Material","wiki.ingest.tabTask":"From Task","wiki.ingest.tabDiscussion":"From Discussion","wiki.ingest.tabText":"Paste Text","wiki.ingest.selectTask":"Select a completed task","wiki.ingest.selectDiscussion":"Select a completed discussion","wiki.ingest.noTasks":"No completed tasks found","wiki.ingest.noDiscussions":"No completed discussions found","wiki.ingest.textPlaceholder":"Paste any text (article, notes, chat transcript) to extract knowledge…","wiki.ingest.run":"Ingest","wiki.ingest.running":"Ingesting…","wiki.ingest.success":"Created {created}, updated {updated}, {edges} edge(s) added","wiki.ingest.parseFailed":"Could not parse the LLM response. Nothing was changed.","wiki.ingest.modelEmpty":"The LLM returned no proposals. It judged the source had nothing new worth adding.","wiki.ingest.allSkipped":"All proposals were skipped. See the breakdown below.","wiki.ingest.proposed":"Proposed: {c} create, {u} update, {e} edges","wiki.ingest.skipNote":"Skipped","wiki.ingest.skip.duplicate":"duplicate title (already exists)","wiki.ingest.skip.unique":"DB UNIQUE conflict on title","wiki.ingest.skip.empty":"empty title","wiki.ingest.skip.badId":"invalid update id","wiki.ingest.skip.badEdge":"edge endpoint not found","wiki.ingest.skip.selfEdge":"self-edge","wiki.ingest.skip.edgeUnique":"edge UNIQUE conflict","wiki.ingest.rawSnippet":"Show raw response snippet","wiki.ingest.toast.success":"Wiki updated from {source}: {created} created, {updated} updated, {edges} edges","wiki.ingest.toast.empty":"Wiki ingest from {source}: nothing new to add","wiki.ingest.toast.parseFailed":"Wiki ingest from {source}: could not parse LLM response","wiki.ingest.toast.failed":"Wiki auto-ingest failed","wiki.schemaSection":"Schema","wiki.schemaSectionHint":"Defines entry types and conventions used by Ingest. Edit to customize for this project.","wiki.schemaBannerTitle":"Wiki Schema","wiki.schemaBannerHint":"Edits here change how the LLM categorizes new entries on Ingest. Delete this entry to reset to defaults.","wiki.systemSection":"System","wiki.systemSectionHint":"Auto-maintained entries that drive Ingest behavior and quick navigation.","wiki.indexBannerTitle":"Wiki Index","wiki.indexBannerHint":"Auto-regenerated on every wiki change. Manual edits are overwritten; deleting it only lasts until the next change.","wiki.asset.uploading":"Uploading image…","wiki.asset.tooLarge":"Image too large (max 10MB)","wiki.diskDiff.button":"Disk diff","wiki.diskDiff.tooltip":"Compare exported wiki files against the database","wiki.diskDiff.title":"Wiki vs. .clitrigger/wiki/","wiki.diskDiff.intro":"Read-only view of disk files that differ from what the database would export. Files edited outside (e.g. Obsidian) surface here; Rebuild overwrites disk with the current DB state.","wiki.diskDiff.running":"Comparing…","wiki.diskDiff.empty":"Disk and database are in sync.","wiki.diskDiff.refresh":"Re-check","wiki.diskDiff.close":"Close","wiki.diskDiff.section.modified":"Modified on disk ({n})","wiki.diskDiff.section.missing":"Missing on disk ({n})","wiki.diskDiff.section.untracked":"Untracked file on disk ({n})","wiki.diskDiff.rebuild":"Rebuild from DB","wiki.diskDiff.rebuildTooltip":"Overwrites all wiki/ files with the current database state. Disk-only edits will be lost.","wiki.diskDiff.rebuildConfirm":"Overwrite the wiki/ folder with the current database state? Any disk-only edits will be lost.","wiki.diskDiff.rebuildResult":"Rebuilt: {written} written, {removed} removed","wiki.lint":"Lint","wiki.lint.title":"Wiki Health Check","wiki.lint.running":"Checking…","wiki.lint.empty":"No issues found.","wiki.lint.close":"Close","wiki.lint.rerun":"Re-run","wiki.lint.mergeConfirm":'Merge "{absorb}" into "{keep}"? This combines bodies, unions tags, redirects edges and wikilinks, and deletes "{absorb}".',"wiki.lint.action.mergeKeep":'Keep "{keep}", merge "{absorb}"',"wiki.lint.action.delete":"Delete","wiki.lint.action.deleteTitle":'Delete "{title}"',"wiki.lint.action.link":"Link","wiki.lint.action.linkTo":"Link to…","wiki.sourceAutoLabel":"Auto","wiki.viewRaw":"View Raw Source","wiki.loading":"Loading…","wiki.close":"Close","wiki.subTab.wiki":"Wiki","wiki.subTab.sources":"Sources","wiki.subTab.activity":"Activity","wiki.activity.empty":"No activity yet","wiki.activity.emptyHint":"Ingest, lint, retrieve, and merge events show up here.","wiki.activity.refresh":"Refresh","wiki.activity.filter.all":"All","wiki.activity.filter.ingest":"Ingest","wiki.activity.filter.lint":"Lint","wiki.activity.filter.retrieve":"Retrieve","wiki.activity.filter.merge":"Merge","wiki.sources.empty":"Select a raw file from the sidebar to view its content.","wiki.sources.noFiles":"No raw files yet. Run Ingest to create some.","wiki.rawFile.derivedTitle":"Derived Wiki Entries","wiki.rawFile.noDerived":"No wiki entries derived from this source","wiki.rawFile.openSiblings":"Show {n} entries from this source","wiki.rawFile.openExternal":"Open in default app","wiki.rawFile.revealInFolder":"Reveal in folder","wiki.rawFile.delete":"Delete raw file","wiki.rawFile.deleteConfirm":"Delete this raw source file? Wiki entries are kept.","wiki.rawFile.deleteConfirmDerived":"Delete this raw source file and unlink {n} derived wiki entr(y/ies)? The entries themselves are kept; only the source link is removed.","planner.title":"Planner","planner.add":"New Item","planner.empty":"No planner items yet","planner.emptyHint":"Add ideas, tasks, and plans to your planner.","planner.view.pages":"Pages","planner.view.all":"All items","planner.nav.calendar":"Calendar","planner.nav.list":"List","web.urlPlaceholder":"https://…","web.go":"Go","web.desktopOnly":"Embedded web pages are available in the desktop app.","web.openExternal":"Open in browser","web.fullscreen":"Fullscreen","web.exitFullscreen":"Exit fullscreen","web.newTab":"New tab","web.closeTab":"Close tab","web.emptyTab":"Enter a URL above to start","web.hideBar":"Hide address bar","web.showBar":"Show address bar","web.back":"Back","web.addFavorite":"Add to favorites","web.removeFavorite":"Remove from favorites","planner.block.tasklist":"Task list","planner.block.calendar":"Calendar","planner.block.addTask":"Add a task…","planner.pages.newTemplate":"New page: choose a template","planner.tpl.blank":"Blank","planner.tpl.blank.desc":"Start from an empty page","planner.tpl.meeting":"Meeting notes","planner.tpl.meeting.desc":"Date, attendees, agenda, action items","planner.tpl.project":"Project plan","planner.tpl.project.desc":"Overview, milestones, schedule","planner.tpl.weekly":"Weekly planner","planner.tpl.weekly.desc":"Weekly goals, tasks, calendar","planner.pages.new":"New Page","planner.pages.untitled":"Untitled","planner.pages.empty":"No pages yet","planner.pages.emptyHint":"Create a free-form page to write notes, docs, and checklists.","planner.pages.deleteConfirm":"Delete this page? This cannot be undone.","planner.pages.saving":"Saving…","planner.pages.saved":"Saved","planner.filterTag":"All Tags","planner.filterStatus":"All Statuses","planner.col.title":"Title","planner.col.tags":"Tags","planner.col.dueDate":"Due Date","planner.col.status":"Status","planner.col.actions":"","planner.edit":"Edit","planner.delete":"Delete","planner.deleteConfirm":"Delete this planner item?","planner.convertToTask":"Convert to Task","planner.convertToSchedule":"Convert to Routine","planner.convertToTerminal":"Send to Terminal","planner.movedToTodo":"Moved to Tasks","planner.movedToSchedule":"Moved to Routines","planner.movedToSession":"Moved to Terminal","planner.fromDiscussion":"From Discussion","planner.noDueDate":"—","planner.export":"Export","planner.exportTooltip":"Export planner items to a Markdown file","planner.exportError":"Export failed","planner.import":"Import","planner.importTooltip":"Import planner items from a Markdown file","planner.importSuccess":"Imported {items} item(s) and {tags} tag(s).","planner.importError":"Import failed","planner.importInvalidMarkdown":"File is empty or not valid Markdown","planner.importNoImages":"Note: images are not included in exported files.","planner.dropHint":"Drop a Markdown file to import","planner.dropHintSub":".md or .markdown","planner.dropInvalidFile":"Only Markdown files (.md / .markdown) can be imported","plannerForm.titlePlaceholder":"e.g. Draft release notes","plannerForm.descPlaceholder":"Details, links, acceptance criteria…","plannerForm.tags":"Tags","plannerForm.tagsPlaceholder":"Type and press Enter","plannerForm.dueDate":"Due Date","plannerForm.priority":"Priority","plannerForm.priorityLow":"Low","plannerForm.priorityNormal":"Normal","plannerForm.priorityHigh":"High","plannerForm.priorityCritical":"Critical","plannerForm.status":"Status","plannerForm.addImage":"Add Image","plannerForm.pasteHint":"Ctrl+V to paste image","plannerForm.images":"Images","plannerForm.cancel":"Cancel","plannerForm.save":"Save","plannerStatus.pending":"Pending","plannerStatus.in_progress":"In Progress","plannerStatus.done":"Done","plannerStatus.moved":"Moved","plannerConvert.toTask":"Convert to Task","plannerConvert.toSchedule":"Convert to Routine","plannerConvert.toTerminal":"Send to Terminal","plannerConvert.useWorktree":"Use git worktree","plannerConvert.cliTool":"CLI Tool","plannerConvert.maxTurns":"Max Turns","plannerConvert.scheduleType":"Routine Type","plannerConvert.recurring":"Recurring","plannerConvert.once":"One-time","plannerConvert.cronExpression":"Cron Expression","plannerConvert.runAt":"Run At","plannerConvert.cancel":"Cancel","plannerConvert.convert":"Convert","plannerTag.selectOrCreate":"Select or create","plannerTag.delete":"Delete","plannerTag.deleteConfirm":"Remove this tag from all items?","plannerTag.color":"Color","plannerTag.rename":"Rename","plannerTag.color.default":"Default","plannerTag.color.gray":"Gray","plannerTag.color.brown":"Brown","plannerTag.color.orange":"Orange","plannerTag.color.yellow":"Yellow","plannerTag.color.green":"Green","plannerTag.color.blue":"Blue","plannerTag.color.purple":"Purple","plannerTag.color.pink":"Pink","plannerTag.color.red":"Red","session.new":"New Terminal","session.windowState.floating":"Open","session.windowState.minimized":"Minimized","session.windowState.popped":"Separate window","session.recallToMain":"Bring to main window","session.popout.minimize":"Minimize","session.restoreWindow":"Restore window","session.focusWindow":"Go to window","session.maximize":"Maximize terminal","session.restoreSize":"Restore terminal size","session.maximizeHint":"Double-click the title bar to toggle","session.layout.single":"Single pane","session.layout.columns":"Two columns","session.layout.grid":"2 × 2 grid","session.openWindow":"Open terminal","session.dock.poppedHint":"Separate window. Click to bring it to front.","session.title":"Terminal Title","session.description":"Initial Prompt (Optional)","session.start":"Start","session.stop":"Stop","session.resume":"Resume","session.resumeHint":"Continue the last Claude conversation of this session","session.delete":"Delete","session.edit":"Edit","session.editDisabledRunning":"Cannot edit while running","session.save":"Save","session.saving":"saving…","session.empty":"No terminals yet","session.emptyHint":"Start an interactive AI conversation.","session.create":"Create Terminal","session.cliTool":"CLI Tool","session.cliNotInstalled":" (not installed)","session.worktree":"Use worktree (isolated branch)","session.cleanup":"Clean up worktree","session.startInWindow":"Start","session.starting":"starting…","session.starting.typeAhead":"type-ahead is captured and replayed once ready","session.stopping":"stopping…","session.startFailed":"Failed to start","session.confirmStop":"End this terminal? The running task will be terminated.","session.popout.blocked":"Popup blocked. Allow popups for this site to use Pop Out.","session.diff.capture":"Capture snapshot","session.diff.pageStart":"From start","session.minimize":"Minimize","session.fontDecrease":"Decrease font size","session.fontIncrease":"Increase font size","session.refresh":"Refresh rendering","session.refresh.hint":"Rebuild the terminal view (PTY stays running)","session.initialPrompt.ready":"Initial prompt ready to send","session.initialPrompt.preview":"Preview","session.initialPrompt.hidePreview":"Hide","session.initialPrompt.send":"Send","session.initialPrompt.skip":"Skip","session.initialPrompt.loading":"loading…","session.initialPrompt.blocked":"Press Send or Skip before typing. Keystrokes are ignored until then.","group.closeTab":"Close tab","group.newTab":"New shell tab","analytics.title":"Execution Analytics","analytics.loading":"Loading analytics…","analytics.noData":"No data available","analytics.totalTasks":"Total Tasks","analytics.successRate":"Success Rate","analytics.totalCost":"Total Cost","analytics.totalTokens":"Total Tokens","analytics.avgPerTask":"Avg / Task","analytics.byStatus":"By Status","analytics.byCliTool":"By CLI Tool","analytics.dailyActivity":"Daily Activity","analytics.dailyCost":"Daily Cost","analytics.costBreakdown":"Cost Summary","analytics.tasks":"tasks","analytics.period.7d":"7D","analytics.period.30d":"30D","analytics.period.90d":"90D","analytics.period.all":"All","analytics.clear":"Clear","analytics.clearConfirm":"Reset analytics? Tasks are kept, but only tasks created from now on will be counted.","discussions.title":"Discussions","discussions.add":"New Discussion","discussions.empty":"No discussions yet","discussions.emptyHint":"Create a discussion to have agents collaborate on a feature.","discussions.round":"Round","discussions.maxRounds":"Max Rounds","discussions.agents":"Agents","discussions.speaking":"Speaking…","discussions.inject":"Send Message","discussions.skipTurn":"Skip Turn","discussions.implement":"Start Implementation","discussions.implementHint":"Select an agent to implement the discussed feature.","discussions.selectAgent":"Select Implementer","discussions.toPlanner":"Send to Planner","discussions.extractTitle":"Extract Action Items","discussions.extractHint":"AI proposed these planner items from the discussion. Edit, deselect, or adjust priority before saving.","discussions.extractLoading":"Extracting action items from the discussion…","discussions.extractLoadingHint":"This may take up to two minutes. The dialog will stay open until extraction finishes.","discussions.extractEmpty":"No actionable items found. Try a different discussion or add more agreement.","discussions.extractConfirm":"Save to Planner","discussions.extractSaving":"Saving…","discussions.priorityLow":"Low","discussions.priorityMedium":"Medium","discussions.priorityHigh":"High","discussions.priorityUrgent":"Urgent","discussions.notFound":"Discussion not found","discussions.back":"Back to Discussions","discussions.userMessage":"Your message…","discussions.implementation":"Implementation","discussions.resume":"Resume","discussions.retry":"Retry","discussions.failureTitle":"Discussion Failed","discussions.noErrorLogs":"No error details available","discussions.pause":"Pause","discussions.waiting":"Waiting…","discussions.roundExplain":"One round = each agent speaks once.","discussions.autoImplement":"Auto-implement after discussion","discussions.autoImplementHint":"Automatically start implementation when all rounds complete.","discussions.collapse":"Collapse","discussions.expand":"Expand","discussions.collapseAll":"Collapse All","discussions.expandAll":"Expand All","status.skipped":"Skipped","status.paused":"Paused","agents.title":"Agent Personas","agents.add":"Add Agent","agents.name":"Name","agents.role":"Role","agents.systemPrompt":"System Prompt","agents.cliTool":"CLI Tool","agents.color":"Color","agents.empty":"No agents yet. Create agent personas to start a discussion.","agents.manage":"Manage Agents","agents.presets":"Preset Templates","agents.roles.architect":"Architect","agents.roles.developer":"Developer","agents.roles.reviewer":"Reviewer","agents.roles.pm":"Product Manager","agents.roles.tester":"Tester","agents.roles.custom":"Custom","agents.canImplement":"Implement during discussion","agents.canImplementHelp":"When it is this agent's turn, they can write code and commit to the discussion branch, not just talk. Useful for developer-style agents that should demonstrate ideas mid-discussion.","agents.canImplementBadge":"Implementer","git.ahead":"ahead","git.behind":"behind","git.staged":"Staged","git.unstaged":"Unstaged","git.noChanges":"Working tree clean","git.refresh":"Refresh","git.files":"files","git.commitHistory":"Commit History","git.branches":"Branches","git.remotes":"Remotes","git.tags":"Tags","git.stashes":"Stashes","git.noCommits":"No commits yet","git.loadMore":"Loading more…","git.author":"Author","git.hash":"Hash","git.graph":"Graph","git.description":"Description","git.date":"Date","git.commit":"Commit","git.pull":"Pull","git.push":"Push","git.pushDialog.targetRemote":"Push to","git.pushDialog.branchesHeader":"Branches to push","git.pushDialog.colPush":"Push?","git.pushDialog.colLocal":"Local branch","git.pushDialog.colRemote":"Remote branch","git.pushDialog.colTracking":"Track?","git.pushDialog.selectAll":"Select all","git.pushDialog.allTags":"Push all tags","git.pushDialog.force":"Force push","git.pushDialog.forceHint":"Uses --force-with-lease (rejects if remote moved since your last fetch).","git.pushDialog.submit":"Push","git.pushDialog.cancel":"Cancel","git.pushDialog.pushing":"Pushing…","git.pushDialog.loading":"Loading…","git.pushDialog.errorRequireBranch":"Select at least one branch to push.","git.pushDialog.noLocalBranches":"No local branches.","git.pushDialog.newBranch":"new","git.pushDialog.customRemote":"Enter name…","git.fetch":"Fetch","git.branch":"Branch","git.merge":"Merge","git.conflicts":"Conflicts","git.conflictMergeInProgress":"Merge in progress","git.conflictRebaseInProgress":"Rebase in progress","git.conflictBanner":"{n} conflicted file(s). Resolve each, then press Continue.","git.conflictAllResolved":"All conflicts resolved. Press Continue.","git.acceptOurs":"Use ours","git.acceptTheirs":"Use theirs","git.cr.ours":"Ours (HEAD)","git.cr.theirs":"Theirs (incoming)","git.cr.both":"Use both","git.cr.manual":"Edit manually","git.cr.guided":"Guided","git.cr.save":"Save resolution","git.cr.unresolved":"{n} unresolved","git.cr.allResolved":"All resolved","git.cr.markersRemain":"Conflict markers still remain","git.cr.loadFailed":"Failed to load conflicted file","git.cr.noConflicts":"No conflict regions in this file","git.conflictContinue":"Continue","git.conflictAbort":"Abort","git.confirmConflictAbort":"Abort and restore the previous state?","git.viewConflicts":"View conflicts","git.stash":"Stash","git.discard":"Discard","git.tag":"Tag","git.untracked":"Untracked","git.fileStatus":"File Status","git.stageAll":"Stage All","git.unstageAll":"Unstage All","git.stage":"Stage","git.unstage":"Unstage","git.commitMessage":"Commit message…","git.branchName":"Branch name…","git.tagName":"Tag name…","git.tagMessage":"Tag message (optional)…","git.stashMessage":"Stash message (optional)…","git.selectBranch":"Select branch…","git.discardAll":"Discard All","git.confirmDiscard":"Discard all changes? This cannot be undone.","git.confirmDiscardFile":"Discard changes to this file?","git.newBranch":"New Branch","git.deleteBranch":"Delete Branch","git.stashPop":"Pop","git.noStashes":"No stashes","git.actions":"Actions","git.close":"Close","git.create":"Create","git.delete":"Delete","git.modified":"Modified","git.added":"Added","git.deleted":"Deleted","git.renamed":"Renamed","git.copied":"Copied","git.checkout":"Checkout","git.mergeInto":"Merge into current branch","git.rebaseOnto":"Rebase current onto","git.copySha":"Copy SHA","git.createBranchHere":"Create branch here…","git.createTagHere":"Create tag here…","git.cherryPick":"Cherry-pick to current branch","git.revertCommit":"Revert commit","git.resetHere":"Reset current branch to here","git.confirmRevert":"Revert commit {hash}? This creates a new commit that undoes its changes.","git.confirmCherryPick":"Cherry-pick {hash} onto the current branch?","git.confirmReset":"Reset current branch to {hash} ({mode})?","git.confirmResetHard":"Hard reset to {hash}? Commits after this point and any uncommitted changes will be permanently lost.","git.promptBranchName":"New branch name (from {hash}):","git.promptTagName":"New tag name (at {hash}):","git.renameBranch":"Rename branch","git.confirmDelete":"Delete branch {name}?","git.newBranchName":"New branch name…","git.rename":"Rename","git.checkoutRemote":"Checkout as local branch","git.commitDetail":"Commit Detail","git.changedFiles":"Changed Files","git.selectFileToViewDiff":"Select a file to view diff","git.noFilesChanged":"No files changed","git.loadingFiles":"Loading files…","git.loadingDiff":"Loading diff…","git.worktrees":"Worktrees","git.cleanupWorktree":"Cleanup","git.confirmCleanupWorktree":"Remove worktree and branch {name}?","git.deleteWorktreeAndBranch":"Delete branch + worktree","git.confirmDeleteWorktreeAndBranch":"Delete branch {name} and its worktree?","git.confirmForceDelete":"Branch {name} is not fully merged. Force delete anyway? Unmerged commits will be lost.","git.workspace":"WORKSPACE","git.viewFileStatus":"File Status","git.viewHistory":"History","git.search":"Search","git.searchPlaceholder":"Search","git.stagedFiles":"Staged files","git.unstagedFiles":"Unstaged files","git.untrackedFiles":"Untracked files","git.unstageAllShort":"Unstage all","git.unstageSelectedShort":"Unstage selected","git.stageAllShort":"Stage all","git.stageSelectedShort":"Stage selected","git.addToGitignore":"Add to .gitignore","git.commitOptions":"Commit options","git.pushImmediately":"Push to {remote} after commit","git.amendLastCommit":"Amend last commit","git.commitButton":"Commit","git.selectFileForDiff":"Select a file to view the diff","git.binaryFile":"Binary file (no diff preview)","git.untrackedNewFile":"(new file)","git.workingTreeClean":"Working tree is clean. Nothing to commit.","git.statusTarget":"Checkout","git.mainCheckout":"Main checkout","lang.toggle":"KO","theme.light":"Light","theme.dark":"Dark","notification.taskCompleted":"Task Completed","notification.taskFailed":"Task Failed","notification.discussionCompleted":"Discussion Completed","notification.discussionFailed":"Discussion Failed","notification.toggle":"Toggle notifications","notification.blocked":"Notifications blocked by browser","notification.sessionBlocked":"Session is waiting for input","notification.sessionDone":"Session finished"},ko:{"login.title":"CLITrigger","login.subtitle":"인증이 필요합니다","login.password":"비밀번호 입력","login.rememberMe":"로그인 상태 유지","login.submit":"로그인","login.loading":"인증 중…","login.error":"접근이 거부되었습니다. 다시 시도해주세요.","login.footer":"보안 접속","login.changePassword":"비밀번호 변경","login.backToLogin":"로그인으로 돌아가기","login.changeSubmit":"변경 후 로그인","login.forgot":"비밀번호를 잊으셨나요?","login.forgotHint":'초기화는 서버가 실행 중인 머신에서만 가능합니다. 터미널에서 "clitrigger reset-password"를 실행하거나 데스크톱 앱의 도움말 → 비밀번호 초기화 메뉴를 사용한 뒤, 이 화면에서 새 비밀번호를 설정하세요.',"login.disclaimer":'This software is provided "as is" without any warranties. Users are solely responsible for all actions taken using this tool, including any costs incurred from AI CLI usage, data loss, or unintended code changes. The developers assume no liability for any direct, indirect, or consequential damages arising from use.',"setup.title":"CLITrigger에 오신 것을 환영합니다","setup.subtitle":"이 인스턴스를 보호할 비밀번호를 설정하세요","setup.password":"새 비밀번호","setup.confirm":"비밀번호 확인","setup.submit":"비밀번호 만들기","setup.loading":"저장 중…","setup.tooShort":"비밀번호는 8자 이상이어야 합니다.","setup.mismatch":"비밀번호가 일치하지 않습니다.","setup.tunnelPaused":"셋업이 끝날 때까지 외부 공유(Cloudflare 터널)는 자동 시작되지 않습니다.","setup.error":"비밀번호 저장에 실패했습니다.","errors.unexpected":"예상하지 못한 오류가 발생했습니다. 다시 시도해 주세요.","errors.renderTitle":"화면을 표시할 수 없습니다","errors.renderDescription":"데이터는 안전합니다. 앱을 다시 불러와 화면을 복구하세요.","errors.reload":"앱 다시 불러오기","errors.projectsLoad":"프로젝트를 불러오지 못했습니다.","errors.projectCreate":"프로젝트를 생성하지 못했습니다.","errors.projectDelete":"프로젝트를 삭제하지 못했습니다.","projects.cleanupPartialFailed":"정리가 일부 실패했습니다: {details}","common.ok":"확인","common.cancel":"취소","sidebar.home":"홈","sidebar.review":"리뷰 큐","sidebar.agenda":"내 일정","agenda.title":"내 일정","agenda.subtitle":"개인 메모·일정과 전 프로젝트 루틴을 한곳에서","agenda.today":"오늘","agenda.refresh":"새로고침","agenda.refreshHelp":"현재 기간의 내 메모, 프로젝트 루틴/플래너, 할당된 Jira 이슈를 다시 불러옵니다. 달/주/일 이동이나 뷰 전환 시에도 자동 갱신되며, 가만히 있을 때는 폴링하지 않습니다.","agenda.view.month":"월","agenda.view.week":"주","agenda.view.day":"일","agenda.view.table":"표","agenda.addItem":"항목 추가","agenda.expand":"크게 보기","agenda.collapse":"작게 보기","agenda.tags.all":"전체","agenda.tags.placeholder":"태그 추가…","agenda.resizePanel":"드래그하여 크기 조절","agenda.resizeCalendar":"드래그하여 달력 크기 조절","agenda.untitled":"(제목 없음)","agenda.source.personal":"메모","agenda.source.schedule":"루틴","agenda.source.planner":"플래너","agenda.source.jira":"Jira","agenda.jira.settings":"Jira 연결","agenda.jira.subtitle":"내게 할당된 Jira 작업을 이 캘린더에서 함께 봅니다.","agenda.jira.enable":"내게 할당된 Jira 이슈 표시","agenda.jira.baseUrlLabel":"Jira 사이트 주소","agenda.jira.baseUrlHint":"Jira를 열 때 쓰는 주소예요. 브라우저 주소창 맨 앞부분. 예: https://회사이름.atlassian.net","agenda.jira.emailLabel":"로그인 이메일","agenda.jira.emailHint":"Jira(Atlassian)에 로그인할 때 쓰는 이메일이에요.","agenda.jira.tokenLabel":"API 토큰","agenda.jira.tokenPlaceholder":"발급받은 API 토큰을 붙여넣으세요","agenda.jira.tokenLink":"API 토큰 발급받기","agenda.jira.tokenStep1":"1. 위 링크를 열고 로그인하세요.","agenda.jira.tokenStep2":'2. "API 토큰 만들기"를 누르고 아무 이름이나 지어주세요.',"agenda.jira.tokenStep3":"3. 만들어진 토큰을 복사해 위 칸에 붙여넣으세요. (비밀번호가 아니라 별도 토큰이에요.)","agenda.jira.criteria":"가져오기 기준","agenda.jira.criteriaHint":"캘린더에 표시하고 가져올 수 있는 이슈의 조건을 정합니다.","agenda.jira.assigneeMe":"나에게 할당된 이슈만","agenda.jira.includeDone":"완료된 이슈도 포함","agenda.jira.projects":"프로젝트","agenda.jira.projectsHint":"이 프로젝트 키만 가져옵니다(쉼표 또는 공백으로 구분). 비우면 전체.","agenda.jira.statuses":"가져올 상태","agenda.jira.statusesHint":'체크한 상태의 이슈만 가져옵니다. 모두 체크 해제하면 위 "완료된 이슈도 포함" 설정을 따릅니다.',"agenda.jira.statusesLoad":"상태 불러오기","agenda.jira.statusesLoading":"불러오는 중…","agenda.jira.statusesNeedConn":"상태를 불러오려면 먼저 연결을 저장하고 테스트하세요.","agenda.jira.statusesSearch":"상태 검색…","agenda.jira.statusesEmpty":'불러온 상태가 없습니다. "상태 불러오기"를 누르세요.',"agenda.jira.dismiss":"내 일정에서 숨기기","agenda.jira.dismissedTitle":"숨긴 JIRA 이슈","agenda.jira.restore":"복원","agenda.jira.extraJql":"고급 (JQL)","agenda.jira.extraJqlHint":"위 조건에 AND로 합쳐지는 추가 JQL. 예: labels = urgent AND priority >= High","agenda.jira.test":"연결 테스트","agenda.jira.tokenSaved":"토큰 저장됨 (비우면 유지)","agenda.jira.hint":'내게 할당된 열린 이슈를 가져옵니다. 기한 있는 것은 캘린더에, 나머지는 "Jira (마감일 없음)" 목록에 표시됩니다. 인증은 이메일 + API 토큰.',"agenda.jira.import":"내 일정에 추가","agenda.jira.noDue":"Jira (마감일 없음)","agenda.jira.error":"Jira 오류","agenda.moveToPlanner":"플래너로 이동","agenda.importToPlanner":"플래너에 추가","agenda.pickProject":"프로젝트 선택","agenda.noProjects":"프로젝트 없음","agenda.table.name":"제목","agenda.table.date":"날짜","agenda.table.kind":"종류","agenda.table.status":"상태","agenda.kind.personal":"메모","agenda.kind.schedule":"루틴","agenda.kind.planner":"플래너","agenda.kind.jira":"Jira","agenda.status.done":"완료","agenda.status.pending":"대기","agenda.add":"추가","agenda.memo":"메모","agenda.backlog":"날짜 없음","agenda.backlogEmpty":"날짜 없는 메모가 없습니다","agenda.dayEmpty":"이 날짜에 일정이 없습니다","agenda.fromSchedule":"프로젝트 루틴","agenda.fromPlanner":"프로젝트 플래너","agenda.toggleDone":"완료 토글","agenda.delete":"삭제","agenda.confirmDelete":"이 항목을 삭제할까요?","agenda.addTitle":"새 항목","agenda.editTitle":"항목 편집","agenda.titlePlaceholder":"제목","agenda.descPlaceholder":"메모 (선택)","agenda.dateHint":"날짜를 비우면 날짜 없는 메모로 저장됩니다. 시간을 지정하면 시간 일정이 됩니다.","agenda.cancel":"취소","agenda.save":"저장","agenda.cleanup":"메모 정리","agenda.cleanup.title":"기간으로 메모 삭제","agenda.cleanup.subtitle":"선택한 기간의 개인 메모를 한 번에 삭제합니다. 되돌릴 수 없습니다.","agenda.cleanup.from":"시작","agenda.cleanup.to":"종료","agenda.cleanup.doneOnly":"완료된 메모만","agenda.cleanup.includeBacklog":"날짜 없는 백로그 메모도 삭제","agenda.cleanup.previewLabel":"삭제 대상","agenda.cleanup.unit":"개","agenda.cleanup.none":"조건에 해당하는 메모가 없습니다","agenda.cleanup.confirm":"삭제","sidebar.workspaces":"워크스페이스","sidebar.favorites":"즐겨찾기","sidebar.collapse":"사이드바 접기","sidebar.expand":"사이드바 펼치기","favorites.add":"즐겨찾기 추가","favorites.edit":"즐겨찾기 편집","favorites.delete":"삭제","favorites.deleteConfirm":"이 즐겨찾기를 삭제할까요?","favorites.launchFailed":"실행 실패","favorites.empty":"등록된 즐겨찾기가 없습니다.","favorites.form.title.create":"새 즐겨찾기","favorites.form.title.edit":"즐겨찾기 편집","favorites.form.name":"이름","favorites.form.type":"종류","favorites.form.target":"대상","favorites.form.browse":"찾아보기…","favorites.form.targetHint.executable":".exe / .bat / .sh 절대 경로","favorites.form.targetHint.command":"셸 명령어 (그대로 실행됨)","favorites.form.targetHint.url":"http:// 또는 https:// URL","favorites.form.args":"인자 (공백으로 구분)","favorites.form.cwd":"작업 디렉토리 (선택)","favorites.form.create":"생성","favorites.form.save":"저장","favorites.form.cancel":"취소","favorites.types.executable":"실행 파일","favorites.types.command":"명령어","favorites.types.url":"URL","favorites.security.notice":"즐겨찾기는 서버 계정으로 실행됩니다. 터널 공유가 켜져 있다면 비밀번호를 아는 사람이 누구나 실행할 수 있습니다.","tunnel.title":"터널 설정","tunnel.description":"Cloudflare 터널 설정. 공유 도메인(*.trycloudflare.com / *.cfargotunnel.com)에서 뜨는 브라우저 위험 경고를 피하려면 본인 도메인을 지정하세요.","tunnel.name.label":"Named tunnel 이름","tunnel.name.placeholder":"my-app","tunnel.name.hint":"비워두면 무작위 Quick Tunnel(https://*.trycloudflare.com)을 사용합니다.","tunnel.hostname.label":"커스텀 도메인 (선택)","tunnel.hostname.placeholder":"app.your-domain.com","tunnel.hostname.hint":'미리 "cloudflared tunnel route dns" 명령으로 이 도메인을 터널에 연결해 두어야 합니다. 비우면 *.cfargotunnel.com으로 폴백.',"tunnel.hostname.invalid":"유효한 공인 도메인을 입력하세요 (예: app.your-domain.com).","tunnel.hostname.needsName":"커스텀 도메인을 사용하려면 먼저 named tunnel 이름을 지정하세요.","tunnel.guide.toggle":"커스텀 도메인 셋업 방법","tunnel.guide.heading":"cloudflared CLI로 1회 셋업:","tunnel.guide.step4":"위 입력란에 터널 이름과 도메인을 적고 저장하세요.","tunnel.guide.note":"도메인은 Cloudflare 계정에 등록되어 있어야 합니다 (무료 플랜으로 충분).","tunnel.status.stopped":"중지됨","tunnel.status.starting":"시작 중…","tunnel.status.running":"실행 중","tunnel.status.error":"오류","tunnel.save":"저장","tunnel.saving":"저장 중…","tunnel.saved":"터널 설정을 저장했습니다. 터널을 재시작하면 적용됩니다.","tunnel.saveFailed":"터널 설정 저장에 실패했습니다.","tunnel.close":"닫기","tunnel.restart":"터널 재시작","tunnel.restarting":"재시작 중…","tunnel.restarted":"터널을 재시작했습니다.","tunnel.restartFailed":"터널 재시작에 실패했습니다.","tunnel.start":"터널 시작","tunnel.starting":"시작 중…","tunnel.urlCopied":"외부 URL을 클립보드에 복사했습니다.","settings.title":"설정","settings.tabs.account":"계정","settings.tabs.session":"터미널","settings.tabs.tunnel":"터널","settings.tabs.mcp":"MCP","mcp.title":"MCP 연결","mcp.description":"AI CLI나 데스크톱 클라이언트를 MCP로 CLITrigger에 연결합니다. 에디터에서 바로 프로젝트 조회, 할일 생성·실행, 상태 확인이 가능합니다. 아래 두 방법 중 하나로 등록하고, 사용하는 동안 이 서버를 켜 두세요.","mcp.loading":"연결 정보를 불러오는 중…","mcp.config.label":"방법 A · 설정 파일에 붙여넣기 (Claude Desktop 등 JSON 클라이언트)","mcp.commands.label":"방법 B · CLI에서 한 줄 실행","mcp.commands.hint":"쓰는 CLI에 맞는 줄을 복사하세요. 셋 다 HTTP transport로 CLITrigger를 등록합니다.","mcp.copy":"복사","mcp.copied":"클립보드에 복사됨","mcp.copyFailed":"복사 실패","mcp.tokenNote":"이 토큰은 서버에 접근 가능한 누구에게나 전체 API 권한을 부여합니다. 비밀번호처럼 취급하세요.","mcp.close":"닫기","sessionSettings.title":"터미널 환경설정","sessionSettings.description":"새 터미널의 기본 동작과 재사용할 색상 태그를 관리합니다.","sessionSettings.saved":"저장되었습니다.","sessionSettings.worktree.title":"Worktree 기본값","sessionSettings.worktree.label":"새 터미널에 git worktree 사용","sessionSettings.worktree.hint":"켜두면 새 터미널이 .worktrees/ 안의 별도 브랜치에서 생성됩니다. git 저장소에만 적용됩니다.","sessionSettings.fontSize.title":"기본 폰트 크기","sessionSettings.fontSize.label":"새 터미널의 폰트 크기 (px)","sessionSettings.fontSize.hint":"아직 줌을 만지지 않은 터미널은 이 값을 즉시 따라갑니다. 터미널별 줌(Ctrl+휠, A−/A+)이 적용된 터미널은 영향받지 않습니다.","sessionSettings.tags.title":"태그","sessionSettings.tags.description":"이름과 색을 정해두면 터미널 생성 폼에서 골라 붙일 수 있습니다.","sessionSettings.tags.empty":"아직 태그가 없습니다. 위에서 하나 추가하세요.","sessionSettings.tags.namePlaceholder":"태그 이름 (예: 탐색, 배포)","sessionSettings.tags.color":"색","sessionSettings.tags.add":"추가","sessionSettings.tags.edit":"수정","sessionSettings.tags.delete":"삭제","sessionSettings.tags.save":"저장","sessionSettings.tags.cancel":"취소","sessionSettings.tags.deleteConfirm":'"{name}" 태그를 삭제할까요? 이 태그를 쓰던 터미널은 태그가 비워집니다.',"sessionSettings.aliases.title":"터미널 별칭","sessionSettings.aliases.description":"저장해 둔 명령 스니펫입니다. 터미널 창 타이틀바의 ⌘ 아이콘을 누르면 입력창에 삽입되고, Enter는 직접 누릅니다.","sessionSettings.aliases.namePlaceholder":"이름 (예: WSL Ubuntu)","sessionSettings.aliases.commandPlaceholder":"명령 (예: wsl -d Ubuntu)","sessionSettings.aliases.add":"추가","sessionSettings.aliases.empty":"아직 별칭이 없습니다.","sessionSettings.aliases.deleteConfirm":'"{name}" 별칭을 삭제할까요? 이 별칭을 쓰던 세션은 OS 기본 셸로 대체됩니다.',"common.save":"저장","common.edit":"수정","common.delete":"삭제","session.tag.none":"태그 없음","account.title":"비밀번호 변경","account.description":"현재 비밀번호를 입력한 후 새 비밀번호를 선택하세요.","account.oldPassword":"현재 비밀번호","account.newPassword":"새 비밀번호","account.confirm":"새 비밀번호 확인","account.tooShort":"비밀번호는 8자 이상이어야 합니다.","account.mismatch":"비밀번호가 일치하지 않습니다.","account.save":"저장","account.saving":"저장 중…","account.saved":"비밀번호가 변경되었습니다. 다른 세션은 모두 로그아웃됩니다.","account.saveFailed":"비밀번호 변경에 실패했습니다.","account.close":"닫기","review.title":"리뷰 큐","review.subtitle":"모든 프로젝트의 밤샘 결과를 한 화면에서 정리","review.refresh":"새로고침","review.empty":"이 기간에 리뷰할 항목이 없습니다.","review.viewDetails":"자세히","review.approve":"승인 · 머지","review.requestChanges":"수정 요청","review.discard":"폐기","review.cancel":"취소","review.send":"전송","review.continuePlaceholder":"무엇을 고치거나 바꿔야 하는지 설명…","review.discardConfirm":"이 todo를 폐기하고 워크트리를 정리할까요?","review.mergeFailed":"머지 실패","review.continueFailed":"이어가기 실패","review.discardFailed":"폐기 실패","review.closeDetails":"닫기","review.justNow":"방금","review.minAgo":"분 전","review.hourAgo":"시간 전","review.dayAgo":"일 전","review.files":"파일","review.lines":"줄","review.rounds":"라운드","review.window.12h":"12시간","review.window.24h":"24시간","review.window.7d":"7일","review.filter.all":"전체","review.filter.risky":"위험","review.filter.quickWins":"Quick wins","review.filter.failed":"실패","review.risk.low":"낮은 위험","review.risk.medium":"중간 위험","review.risk.high":"높은 위험","review.tokens.total":"총 토큰","review.tokens.todos":"Todo 수","review.tokens.byCli":"CLI별","review.diff.empty":"베이스 브랜치 대비 변경 사항이 없습니다.","review.diff.noBranch":"브랜치 없이 메인 브랜치에서 실행된 todo라 diff를 표시할 수 없습니다.","review.diff.branchMissing":"브랜치가 삭제되어 diff를 표시할 수 없습니다.","review.diff.baseBranchMissing":"베이스 브랜치를 repo에서 찾을 수 없어 diff를 표시할 수 없습니다. 프로젝트 default_branch 설정을 확인하세요.","review.diff.notFound":"Todo를 찾을 수 없습니다.","projects.title":"전체 프로젝트","projects.subtitle":"프로젝트 콘솔","projects.new":"새 프로젝트","projects.logout":"로그아웃","projects.loading":"프로젝트 로딩 중…","projects.empty":"프로젝트가 없습니다","projects.emptyHint":"첫 번째 프로젝트를 만들어보세요.","projects.tasks":"작업","projects.active":"실행 중","projects.done":"완료","projects.search":"프로젝트 검색…","projects.delete":"프로젝트 삭제","projects.deleteConfirm":"이 프로젝트를 삭제하시겠습니까?","projects.pathMissing":"경로 없음","projects.pathMissingConfirm":"이 프로젝트의 로컬 폴더가 존재하지 않습니다. 삭제하시겠습니까?","projects.noGit":"Git 없음","detail.back":"프로젝트","detail.loading":"로딩 중…","detail.notFound":"프로젝트를 찾을 수 없습니다","detail.backToProjects":"프로젝트 목록으로","detail.live":"연결됨","header.branch":"브랜치","header.editName":"클릭하여 프로젝트 이름 변경","header.openFolder":"폴더 열기","header.workers":"워커","header.model":"모델","header.settings":"설정","header.runAll":"전체 실행","header.stopAll":"전체 중지","header.config":"프로젝트 설정","header.execConfig":"자동화 설정","header.execConfigHint":"자동 작업·토론·루틴 실행에 적용됩니다.","header.maxWorkers":"최대 워커 수","settings.defaultMaxTurns":"기본 턴 제한","settings.defaultMaxTurnsHint":"작업별 기본 턴 제한. 개별 작업에서 재설정 가능.","header.cliTool":"CLI 도구","header.cliFlags":"CLI 플래그","header.cancel":"취소","header.save":"저장","header.saving":"저장 중…","header.noGit":"Git 없음","header.noGitHint":'이 프로젝트는 Git 저장소가 아닙니다. 작업은 워크트리 격리 없이 직접 실행됩니다. 프로젝트 경로에서 "git init" 실행 후 재확인하세요.',"header.recheckGit":"Git 상태 재확인","header.fallbackChainTitle":"CLI 폴백 체인","header.fallbackChainHint":"CLI 도구의 컨텍스트가 소진되면 체인의 다음 도구로 자동 전환합니다.","header.autoReviewerTitle":"자동 리뷰어","header.autoReviewerHint":"작업 CLI에 할당된 태스크가 성공적으로 완료되면 리뷰 CLI에 할당된 후속 리뷰 태스크를 자동으로 생성합니다.","header.autoReviewerEnable":"자동 리뷰 활성화","header.autoReviewerFrom":"작업 CLI","header.autoReviewerTo":"리뷰 CLI","header.sandboxTitle":"샌드박스 모드","header.sandboxBadgeStrict":"샌드박스: 엄격","header.sandboxBadgePermissive":"샌드박스: 허용","header.sandboxStrict":"엄격 (권장)","header.sandboxStrictDesc":"CLI 도구가 워크트리 디렉토리 내 파일만 접근할 수 있습니다.","header.sandboxPermissive":"허용","header.sandboxPermissiveDesc":"CLI 도구가 시스템의 모든 파일에 접근할 수 있습니다.","header.sandboxWarning":"경고: 허용 모드에서는 CLI 도구가 워크트리 밖 파일에도 접근할 수 있습니다. 주의해서 사용하세요.","header.worktreeTitle":"워크트리 격리","header.worktreeEnabled":"워크트리 (권장)","header.worktreeEnabledDesc":"각 작업이 독립 브랜치에서 실행됩니다. 병렬 작업에 안전합니다.","header.worktreeDisabled":"직접 실행 (메인 브랜치)","header.worktreeDisabledDesc":"메인 브랜치에서 직접 실행합니다. 최대 워커 1개로 제한됩니다.","header.worktreeWarning":"경고: 메인 브랜치를 직접 수정합니다. 동시 실행이 비활성화됩니다.","header.npmAutoInstallLabel":"워크트리 생성 시 `npm install` 자동 실행","header.npmAutoInstallHint":"npm 프로젝트에서 에이전트가 워크트리 안에서 test/build를 바로 돌릴 수 있게 합니다. pnpm/yarn/bun이나 npm이 아닌 프로젝트에서는 꺼두세요.","header.autoCommitLabel":"남은 변경 자동 커밋","header.autoCommitHint":"작업이나 세션이 끝날 때, 그리고 워크트리 브랜치를 병합하기 전에 커밋되지 않은 변경을 자동으로 커밋합니다. 끄면 미커밋 변경이 있는 워크트리는 병합이 거부됩니다.","header.noWorktreeBadge":"워크트리 없음","header.debugBadge":"디버그 로그","header.showTokenUsageTitle":"토큰 사용량 표시","header.showTokenUsageDesc":"작업 완료 후 토큰 사용량(입력/출력)을 표시합니다.","header.showTokenUsageEnable":"토큰 사용량 표시","header.debugLoggingTitle":"디버그 로깅","header.debugLoggingDesc":"각 태스크 실행 시 CLI 입출력 전체를 .debug-logs/ 파일로 저장합니다.","header.debugLoggingEnable":"디버그 로그 파일 활성화","header.usageLimit":"사용량","header.cliNotInstalled":"{tool}이(가) 설치되지 않았습니다","header.cliInstalled":"설치됨","header.cliNotFound":"미설치","header.cliInstallHint.claude":"npm install -g @anthropic-ai/claude-code","header.cliInstallHint.antigravity":"curl -fsSL https://antigravity.google/cli/install.sh | bash","header.cliInstallHint.codex":"npm install -g @openai/codex","header.cliRefresh":"재확인","form.newProject":"새 프로젝트","form.projectName":"프로젝트 이름","form.folderPath":"폴더 경로","form.cancel":"취소","form.create":"생성","form.creating":"생성 중…","form.createError":"프로젝트 생성 실패","browse.title":"폴더 찾아보기","browse.select":"선택","browse.loading":"불러오는 중…","browse.error":"디렉토리를 불러올 수 없습니다","browse.empty":"폴더가 없습니다","todos.title":"자동 작업 목록","todos.add":"자동 작업 추가","todos.empty":"자동 작업이 없습니다","todos.emptyHint":"자동 작업을 추가하세요.","todos.filterAll":"전체","todos.filterActive":"작업중","todos.filterCompleted":"완료","todos.filterCancelled":"취소","todos.filterEmpty":"해당 상태의 자동 작업이 없습니다.","todos.stackModeOn":"스택 모드 켜짐 (다시 누르면 해제)","todos.stackModeOff":"스택 모드 켜기 (iOS 알림 스타일)","todos.collapseStack":"스택으로 접기","todos.expandStack":"클릭하면 펼쳐집니다","todos.merge":"병합","todo.description":"설명","todo.noDescription":"설명이 없습니다.","todo.attachedImages":"첨부 이미지","todo.branch":"브랜치","todo.path":"경로","todo.worktree":"워크트리","todo.result":"실행 결과","todo.mergeFailed":"병합 실패","todo.diffError":"Diff 오류","todo.diffOutput":"변경사항","todo.files":"파일","todo.systemLog":"활동 로그","todo.start":"시작","todo.startHeadless":"Headless","todo.startHeadlessDesc":"자율 실행. 모든 권한 자동 승인.","todo.startInteractive":"Interactive","todo.startInteractiveDesc":"stdin을 열어두고 실행 중 메시지 전송 가능.","todo.startVerbose":"Verbose","todo.startVerboseDesc":"자동 승인 + 모든 로그 실시간 출력.","todo.sendPlaceholder":"메시지 입력…","todo.startWithDependency":"선행 작업 먼저 시작","todo.stop":"중지","todo.viewDiff":"Diff 보기","todo.hideDiff":"Diff 접기","todo.viewDebugLog":"디버그 로그","todo.merge":"병합","todo.mergeChain":"체인 병합","todo.mergeChainDesc":"이 체인의 모든 작업을 메인 브랜치에 병합","todo.chainComplete":"체인 완료","todo.chainTasks":"{count}개 작업","todo.edit":"편집","todo.delete":"삭제","todo.cleanup":"워크트리 삭제","todo.cleanupFailed":"정리 실패","cleanup.confirmDeleteBranch":`워크트리를 삭제합니다. 브랜치 "{name}"도 함께 삭제할까요?
|
|
65
|
+
|
|
66
|
+
확인 = 워크트리 + 브랜치 삭제
|
|
67
|
+
취소 = 워크트리만 삭제`,"todo.retry":"재시도","todo.retryDesc":"이전 워크트리를 정리하고 처음부터 다시 실행합니다.","todo.retryFailed":"재시도 실패","todo.continue":"이어서","todo.continueDesc":"같은 워크트리에서 후속 프롬프트를 실행합니다.","todo.continuing":"이어가는 중…","todo.confirmContinue":"이어서 실행","todo.continuePromptLabel":"후속 프롬프트","todo.continuePromptPlaceholder":"이 워크트리에 적용할 다음 지시사항을 입력하세요…","todo.continuePromptRequired":"후속 프롬프트를 입력해주세요.","todo.roundLabel":"라운드","todo.dependsOn":"선행 작업","todo.mergedFrom":"이전 작업에서 병합","todo.transferredTo":"작업 이전됨","todo.schedule":"예약","todo.scheduleDesc":"특정 시간에 1회 실행되도록 루틴으로 변환합니다.","todo.scheduleAt":"실행 시각","todo.scheduling":"예약 중…","todo.confirmSchedule":"예약","todo.scheduleKeepOriginal":"원본 작업 유지","todo.scheduleOnReset":"리셋 시 실행","todo.scheduleOnResetDesc":"토큰 한도 리셋 시 자동으로 새 작업을 실행합니다.","todo.scheduleOnResetLabel":"리셋 시각","todo.resetPromptPlaceholder":"리셋 후 실행할 프롬프트를 입력하세요…","todo.confirmResetSchedule":"리셋 시 실행 예약","todoForm.titlePlaceholder":"예: 로그인 리다이렉트 버그 수정","todoForm.descPlaceholder":"설명 (선택사항)…","todoForm.cliTool":"CLI 도구","todoForm.addImage":"이미지 추가","todoForm.pasteHint":"Ctrl+V로 이미지 붙여넣기","todoForm.images":"이미지","todoForm.maxTurns":"최대 턴 수","todoForm.maxTurnsPlaceholder":"제한 없음","todoForm.maxTurnsHint":"에이전트 턴 수를 제한하여 과도한 토큰 사용을 방지합니다.","todoForm.loopEnable":"종료 규칙이 만족될 때까지 반복 (루프)","todoForm.loopHint":"라운드가 끝날 때마다 종료 규칙을 검사하고, 미달이면 검증 출력을 넘겨 같은 워크트리에서 다시 실행합니다.","todoForm.loopMaxRounds":"최대 라운드","todoForm.loopMaxCost":"비용 상한 (USD)","todoForm.loopMaxCostPlaceholder":"없음","todoForm.loopCheck":"검증 명령","todoForm.loopCheckHint":"라운드마다 작업 디렉터리에서 실행합니다. exit 0이면 완료.","todoForm.loopDonePhrase":"완료 문구","todoForm.loopDonePhraseHint":"에이전트의 마지막 메시지에 이 문구가 포함되면 완료로 봅니다.","todoForm.loopNoDoneRule":"종료 규칙이 없습니다. 최대 라운드만큼 반복한 뒤 완료 처리됩니다.","todoForm.loopRules":"매 라운드 규칙","todoForm.loopRulesPlaceholder":"예: 실패하는 테스트를 한 번에 하나씩 고치고 커밋할 것. src/legacy는 건드리지 말 것.","todoForm.loopRulesHint":"모든 라운드의 프롬프트 끝에 붙습니다.","todoForm.loopStopWhenNoChanges":"커밋 없이 끝난 라운드가 있으면 중단","todoForm.loopResume":"라운드 사이에 CLI 세션 이어가기","todoForm.loopResumeHint":"끄면(권장) 매 라운드 새 컨텍스트로 시작해 git 이력과 검증 출력만 보고 진행합니다.","header.loopDefaultsTitle":"기본 루프 규칙","header.loopDefaultsHint":"새 작업용 템플릿입니다. 작업에서 루프를 켜면 이 규칙이 미리 채워져 검증 명령을 매번 다시 입력하지 않아도 됩니다.","header.loopDefaultsEnable":"이 프로젝트의 기본 루프 규칙 템플릿 유지","todoForm.dependsOn":"선행 작업","todoForm.noDependency":"없음 (독립 작업)","todoForm.dependsOnHint":"선행 작업이 완료되면 변경사항을 스쿼시 머지하고 새 브랜치에서 실행됩니다.","todoForm.worktreeMode":"실행 브랜치","todoForm.worktreeInherit":"프로젝트 설정 따름","todoForm.worktreeForceOn":"워크트리 사용 (격리 브랜치)","todoForm.worktreeForceOff":"메인 브랜치에서 실행","todoForm.worktreeProjectDefaultOn":"프로젝트 기본: 워크트리","todoForm.worktreeProjectDefaultOff":"프로젝트 기본: 메인 브랜치","todoForm.worktreeMainWarning":"메인 브랜치에서 실행 시 다른 작업의 동시 실행이 차단됩니다.","todoForm.cancel":"취소","todoForm.save":"저장","dnd.dropHint":"이 작업 이후에 실행","dnd.removeDep":"의존성 제거","dnd.dropToRemoveDep":"여기에 놓으면 의존성 제거","dnd.cyclicWarning":"순환 의존성으로 연결할 수 없습니다","graph.autoLayout":"자동 정렬","graph.listView":"리스트 보기","graph.graphView":"그래프 보기","status.pending":"대기","status.running":"실행 중","status.completed":"완료","status.failed":"실패","status.stopped":"중지","status.merged":"병합됨","progress.complete":"완료","progress.done":"완료","progress.live":"실행 중","progress.idle":"대기","progress.fail":"실패","progress.stop":"중지","progress.merged":"병합됨","failure.title":"실패 원인","failure.exitCode":"종료 코드","failure.fix":"수정하기: 실패 원인을 분석하고 문제를 수정하는 새 작업을 생성합니다.","failure.fixPrefix":"[수정] ","result.duration":"소요 시간","result.commits":"커밋","result.filesChanged":"파일 변경","result.commitHistory":"커밋 이력","result.changedFiles":"변경된 파일","result.tokenUsage":"토큰 사용량","result.inputTokens":"입력","result.outputTokens":"출력","result.totalCost":"비용","result.cacheTokens":"캐시","result.turns":"턴","result.contextUsed":"사용","result.levelLight":"가벼움","result.levelModerate":"보통","result.levelHigh":"많음","result.levelHeavy":"과다","log.awaiting":"출력 대기 중…","log.waitingResponse":"응답 대기 중…","log.noChanges":"변경사항이 없습니다.","log.copy":"복사","log.copied":"복사됨!","log.viewChat":"대화","log.viewRaw":"원시","schedules.title":"루틴","schedules.add":"새 루틴","schedules.empty":"루틴이 없습니다","schedules.emptyHint":"반복 작업을 자동화할 루틴을 만드세요.","schedule.type":"루틴 유형","schedule.recurring":"반복","schedule.once":"1회","schedule.runAtLabel":"실행 시각","schedule.cronExpression":"실행 주기","schedule.cronHint":"예: */30 * * * * (30분마다), 0 9 * * * (매일 9시), 0 9 * * 1-5 (평일 9시)","cron.everyMinutes":"분 간격","cron.hourly":"매시간","cron.daily":"매일","cron.weekly":"매주","cron.monthly":"매월","cron.custom":"직접 입력","cron.every":"매","cron.minutesLabel":"분마다","cron.everyHourAt":"매시간","cron.minutesPast":"분에","cron.everyDayAt":"매일","cron.at":"시간","cron.everyMonthOn":"매월","cron.dayAt":"일","cron.expression":"Cron","cron.mon":"월","cron.tue":"화","cron.wed":"수","cron.thu":"목","cron.fri":"금","cron.sat":"토","cron.sun":"일","schedule.skipIfRunning":"이전 실행이 진행 중이면 건너뛰기","schedule.active":"활성","schedule.paused":"일시정지","schedule.lastRun":"마지막 실행","schedule.never":"없음","schedule.trigger":"즉시 실행","schedule.activate":"활성화","schedule.pause":"일시정지","schedule.edit":"편집","schedule.delete":"삭제","schedule.runs":"실행 이력","schedule.runTriggered":"실행됨","schedule.runSkipped":"건너뜀","schedule.runCompleted":"완료","schedule.runFailed":"실패","schedule.noRuns":"실행 이력이 없습니다","scheduleForm.titlePlaceholder":"예: 매일 밤 의존성 점검","scheduleForm.descPlaceholder":"작업 설명 템플릿…","scheduleForm.cliTool":"CLI 도구","scheduleForm.cancel":"취소","scheduleForm.save":"저장","tabs.automation":"자동화","tabs.automation.help":"자동 작업·루프·토론·루틴을 한곳에서 관리합니다.","tabs.web":"웹","tabs.web.help":"노션 등 외부 사이트를 데스크톱 앱 안에 임베드합니다.","tabs.projectNavigation":"프로젝트 작업 흐름","tabs.group.prepare":"준비","tabs.group.execute":"실행","tabs.group.review":"검토","tabs.tasks":"자동 작업","tabs.sessions":"터미널","tabs.discussions":"토론","tabs.schedules":"루틴","tabs.git":"Git","tabs.svn":"SVN","tabs.files":"문서","tabs.planner":"플래너","tabs.wiki":"위키","tabs.analytics":"통계","tabs.wiki.help":"프로젝트 지식 그래프. 노드/엣지를 만들어 두면 자동 작업·토론 프롬프트에 <long_term_memory> 블록으로 주입돼서 LLM이 실행 간에도 맥락을 유지합니다.","tabs.planner.help":"가벼운 작업 메모. 태그·우선순위·이미지 첨부가 가능하고, 마음에 드는 항목은 자동 작업이나 루틴으로 변환하거나 Markdown으로 내보내기/가져오기 할 수 있습니다.","tabs.tasks.help":"작업 큐입니다. 각 TODO는 독립된 git worktree에서 Claude/Antigravity/Codex로 실행되고, 동시 실행 한도까지 병렬 처리되며 의존성 체이닝·멀티 라운드 continue·머지 자동화를 지원합니다.","tabs.loops":"루프","tabs.loops.help":"종료 규칙이 만족될 때까지 반복 실행되는 작업입니다. 검증 명령 통과나 완료 문구 출력으로 끝나고, 최대 라운드·비용 상한·커밋 없음 중단 규칙으로 폭주를 막습니다.","loops.empty":"루프가 없습니다","loops.emptyHint":"검증 명령이 통과할 때까지 에이전트가 반복 작업하도록 루프를 만들어 보세요.","todoForm.loopRulesTitle":"루프 규칙","tabs.sessions.help":"Claude/Antigravity/Codex를 플로팅 창에서 직접 조작하는 대화형 모드입니다. 자동 작업(fire-and-forget)과 달리 터미널은 계속 살아 있어서 실시간으로 입력하고 결과를 보면서 CLI를 직접 컨트롤할 수 있습니다.","tabs.discussions.help":"여러 AI 에이전트가 라운드별로 토론한 뒤 합의를 코드로 구현. 결과를 플래너 항목으로 추출할 수도 있습니다.","tabs.schedules.help":"cron 또는 일회성 예약으로 자동 작업을 트리거. 레이트 리밋 리셋 시점 자동 재시작도 지원합니다.","tabs.git.help":"워크스페이스 내장 Git 클라이언트. 파일 상태/커밋 그래프/브랜치 관리/diff 뷰어를 Fork·SourceTree 스타일 레이아웃으로 제공합니다.","tabs.svn.help":"내장 SVN 워킹카피 패널. 파일 상태/리비전 로그/diff 뷰어를 제공합니다.","svn.fileStatus":"파일 상태","svn.history":"히스토리","svn.unversioned":"버전 미관리","svn.changed":"변경됨","svn.groupByDir":"디렉터리로 그룹화","svn.viewFlat":"목록으로 보기","svn.dirFileCount":"{d}개 디렉터리 · {f}개 파일","svn.fileCount":"{f}개 파일","svn.workingCopyRev":"워킹카피 리비전","svn.update":"업데이트","svn.refresh":"새로고침","svn.add":"추가","svn.revert":"되돌리기","svn.delete":"삭제","svn.resolve":"충돌 해결","svn.commitMessagePlaceholder":"커밋 메시지를 입력하세요. 필수.","svn.templates":"템플릿","svn.noTemplates":"저장된 템플릿이 없습니다","svn.templatePickHint":"클릭: 뒤에 이어붙이기 · Shift+클릭: 교체","svn.templateNamePlaceholder":"이름 (비우면 첫 줄 사용)","svn.saveTemplate":"저장","svn.saveTemplateHint":"현재 메시지를 템플릿으로 저장","svn.deleteTemplate":"템플릿 삭제","svn.commit":"커밋","svn.committing":"커밋 중…","svn.commitSuccess":"r{rev} 커밋 완료","svn.updating":"업데이트 중…","svn.updateProgress":"{n}개 파일","svn.running":"{cmd} 실행 중…","svn.updateSuccess":"r{rev}로 업데이트 완료","svn.updateConflicts":"업데이트 완료: 충돌 {n}개 발생","svn.previewDiff":"diff 미리보기","svn.noChanges":"로컬 변경사항 없음.","svn.selectFiles":"먼저 파일을 한 개 이상 선택하세요.","svn.notSvn":"SVN 워킹카피가 아닙니다.","svn.cliMissing":"svn CLI를 찾을 수 없습니다. 이 패널을 사용하려면 Subversion을 설치하세요.","svn.repoUrl":"저장소 URL","svn.relativePath":"경로","svn.viewsHeader":"보기","svn.actionsHeader":"명령","svn.checkForModifications":"로컬 변경 확인","svn.showLog":"로그 보기","svn.updateToRevision":"특정 리비전으로 업데이트…","svn.cleanup":"정리(Cleanup)","svn.checkRepository":"원격 변경 확인","svn.remoteBadge":"원격","svn.remoteHint":"SVN 서버에 접속합니다","svn.loadLog":"로그 불러오기","svn.logEmptyHint":"로그는 SVN 서버에서 가져옵니다. 자동으로 불러오지 않습니다.","svn.loadMore":"더 보기","svn.revision":"리비전","svn.revisionPlaceholder":"예: 1234 또는 HEAD","svn.cleaningUp":"정리 중…","svn.cleanupSuccess":"정리 완료","svn.checking":"확인 중…","svn.behindCount":"서버에 들어올 변경 {n}건","svn.upToDate":"서버와 동일","svn.resolveWorking":"해결 표시 (워킹카피 유지)","svn.resolveMine":"내 변경으로 해결","svn.resolveTheirs":"서버 변경으로 해결","svn.resolveBase":"기준본으로 해결","svn.viewDiff":"Diff 보기","svn.showRevisionChanges":"변경 내용 보기","svn.compareRevisionWithWorking":"작업 사본과 비교","svn.revisionChangesTitle":"r{rev} 변경 내용","svn.compareWithWorkingTitle":"r{rev} ↔ 작업 사본","svn.cancel":"취소","svn.properties":"속성(Properties)","svn.propertiesOf":"속성: {target}","svn.workingCopyRoot":"워킹카피 루트","svn.noProperties":"이 항목에 속성이 없습니다.","svn.editProperty":"수정","svn.saveProperty":"저장","svn.close":"닫기","svn.ext.path":"경로","svn.ext.peg":"Peg","svn.ext.operative":"Operative","svn.ext.localPath":"로컬 경로","svn.ext.revision":"리비전","svn.ext.showLog":"로그 보기","svn.ext.pickHint":"리비전을 클릭하면 Peg 리비전으로 적용됩니다.","svn.ext.new":"새 항목","svn.ext.remove":"삭제","svn.ext.findHead":"HEAD 리비전 조회","svn.ext.editText":"텍스트로 편집","svn.ext.editTable":"표로 편집","svn.ext.empty":"정의된 external이 없습니다.","svn.changelistDefault":"변경","svn.changelistUnversioned":"버전이 없는 파일","svn.changelistMissing":"로컬에서 삭제된 파일","svn.moveToChangelist":"변경 목록으로 이동","svn.newChangelist":"새 변경 목록…","svn.removeFromChangelist":"변경 목록에서 제거","svn.changelistNamePlaceholder":"변경 목록 이름","svn.createChangelist":"만들기","svn.renameChangelist":"변경 목록 이름 바꾸기","svn.deleteChangelist":"변경 목록 삭제","header.svnTitle":"SVN (Subversion)","header.svnHint":"기본값 OFF. 켜면 프로젝트에 .svn/ 워킹카피가 있는지 검사하고, 발견 시 SVN 탭이 표시됩니다.","header.svnEnable":"이 프로젝트에서 SVN 활성화","header.processesTitle":"터미널 프로세스","header.processesHint":"실행 중인 터미널 세션이 띄운 CLI 프로세스입니다. 이 탭을 열 때 한 번 조회하며, Windows에서는 2~3초 걸립니다.","header.processesRefresh":"새로고침","header.processesSnapshotAt":"스냅샷 시각","header.processesNoneRunning":"실행 중인 터미널이 없습니다","header.processesLoading":"프로세스 조회 중…","header.processesNotFound":"이 스냅샷에 없음 — 종료되었거나 방금 시작됨","header.processesFailed":"프로세스 목록을 가져올 수 없습니다: {reason}","header.processesSub":"서브 프로세스 {count}개","header.processesSubHint":"Claude가 작업을 위해 띄운 프로세스 (셸, 훅, 상태줄 등)","header.processesNoSub":"서브 프로세스 없음","header.tabShowHint":"기본값 ON. 체크를 해제하면 이 프로젝트에서 해당 탭이 숨겨집니다.","header.tabShowEnable":"이 프로젝트에서 {tab} 탭 표시","tabs.files.help":"마크다운 문서 위키: 파일 트리 탐색, 노트 미리보기/편집, 그래프·백링크·개요·태그·검색 패널로 .md 파일 간 위키링크 탐색.","tabs.analytics.help":"실행 통계와 비용 분석. CLI별 토큰 사용량, 상태 분포, 일별 비용 추이를 차트로 시각화합니다.","files.root":"루트","files.empty":"빈 폴더","files.loading":"불러오는 중…","files.refresh":"새로고침","files.graph":"위키 그래프: .md 파일 간 위키링크 연결 표시","files.showHidden":"숨김 파일 보기","files.hideHidden":"숨김 파일 숨기기","files.copyPath":"경로 복사","files.sendToTerminal":"터미널로 보내기","files.newTerminal":"새 터미널","files.includeLinks":"링크된 문서 포함","files.sendToTask":"작업으로 보내기","files.sentToTerminal":"터미널로 전송됨","files.noActiveSession":"열린 세션이 없습니다","files.taskCreated":"작업이 생성됨","files.taskCreateFailed":"작업 생성 실패","files.hide":"문서에서 숨기기","files.unhide":"문서에 다시 보이기","files.openInOS":"기본 앱으로 열기","files.revealInExplorer":"탐색기에서 보기","files.openFolder":"탐색기에서 폴더 열기","files.pin":"상단에 고정","files.unpin":"고정 해제","files.pinned":"고정됨","files.tooLarge":"미리보기를 표시하기엔 파일이 너무 큽니다 (최대 2MB).","files.binaryNotPreviewable":"바이너리 파일은 미리보기를 지원하지 않습니다.","files.download":"다운로드","files.preview.empty":"파일을 선택해 미리보기를 확인하세요.","files.html.sandboxNotice":"안전 미리보기: 스크립트와 외부 리소스가 차단되었습니다.","files.editor.edit":"편집","files.editor.save":"저장","files.editor.done":"완료","files.editor.saved":"저장됨","files.editor.saveFailed":"저장 실패","files.editor.conflict":"파일이 디스크에서 변경되었습니다. 다시 열어주세요.","files.editor.discardConfirm":"변경사항을 폐기하시겠습니까?","vault.onboarding.title":"문서 탭 시작하기","vault.onboarding.intro":"문서 탭은 프로젝트의 .md/.html 파일을 스캔해 [[wikilink]] 그래프로 보여줍니다. 큰 프로젝트는 첫 스캔과 그래프 렌더링이 느릴 수 있습니다. .vaultignore(gitignore 문법)로 표시할 문서만 골라두면 가볍게 쓸 수 있습니다.","vault.onboarding.step1Title":"전부 숨김으로 시작","vault.onboarding.step1Body":".vaultignore에 *가 들어가 모든 파일이 문서 탭에서 제외된 상태로 시작합니다. 파일은 그대로 있고 문서 탭에서만 보이지 않습니다.","vault.onboarding.step2Title":"필요한 문서만 해제","vault.onboarding.step2Body":'파일 탐색기에서 회색으로 표시된 파일·폴더를 우클릭해 "문서에 다시 보이기"를 선택합니다. 숨김 파일 표시는 자동으로 켜 둡니다.',"vault.onboarding.step3Title":"그래프는 표시된 문서만","vault.onboarding.step3Body":"해제한 문서만 스캔과 그래프에 올라갑니다. 패턴은 좌측 레일의 .vaultignore 설정에서 언제든 직접 편집할 수 있습니다.","vault.onboarding.startIgnoreAll":"전부 숨김으로 시작 (큰 프로젝트 권장)","vault.onboarding.startShowAll":"전체 표시로 시작 (작은 프로젝트에 적합)","vault.onboarding.saving":"설정 중…","files.editor.dirty":"변경됨","files.editor.draftRestored":"저장 안 된 편집 내용 복구됨","find.openFind":"찾기","find.placeholder":"찾을 내용","find.replacePlaceholder":"바꿀 내용","find.case":"대소문자 구분","find.word":"전체 단어 일치","find.regex":"정규식 사용","find.next":"다음 결과 (Enter)","find.prev":"이전 결과 (Shift+Enter)","find.replace":"바꾸기","find.replaceAll":"모두 바꾸기","find.close":"닫기 (Esc)","find.toggleReplace":"바꾸기 토글","find.noMatches":"결과 없음","annotate.start":"낙서 시작","annotate.stop":"낙서 종료","annotate.select":"선택","annotate.pen":"펜","annotate.highlighter":"형광펜","annotate.eraser":"지우개","annotate.color":"색상","annotate.undo":"되돌리기","annotate.redo":"다시 실행","annotate.clear":"모두 지우기","wiki.title":"위키","wiki.add":"새 항목","wiki.edit":"편집","wiki.delete":"삭제","wiki.save":"저장","wiki.saving":"저장 중…","wiki.cancel":"취소","wiki.empty":"아직 위키 항목이 없습니다","wiki.emptyHint":"LLM이 작업할 때 참고해야 할 노트, 컨벤션, 교훈을 추가하세요.","wiki.viewList":"목록","wiki.viewGraph":"그래프","wiki.viewHierarchical":"계층","wiki.viewNetwork":"네트워크","wiki.searchPlaceholder":"위키 검색…","wiki.backlinks":"백링크","wiki.addLink":"다른 항목 링크 추가","wiki.addLinkPlaceholder":"연결할 항목 검색…","wiki.connect.title":"어떻게 연결할까요?","wiki.connect.wikilink":"참조 (wikilink)","wiki.connect.wikilinkHint":"소스 본문에 [[대상 제목]]을 추가합니다. 자유로운 언급, 의미 관계 없음.","wiki.connect.edge":"관계 (타입드 엣지)","wiki.connect.edgeHint":"관계 타입(관련/선행/구체화 등)을 가진 엣지를 추가합니다.","wiki.allTags":"모든 태그","wiki.countLabel":"{count}개","wiki.deleteConfirm":"이 항목과 연결된 모든 관계를 삭제할까요?","wiki.noResults":"검색 결과 없음","wiki.noBody":"본문 없음","wiki.connections":"연결","wiki.outgoing":"나가는 연결","wiki.incoming":"들어오는 연결","wiki.autoLayout":"자동 정렬","wiki.form.newTitle":"새 항목","wiki.form.editTitle":"항목 편집","wiki.form.title":"제목","wiki.form.titlePlaceholder":"간결하고 명확한 제목","wiki.form.body":"본문 (Markdown 지원)","wiki.form.bodyPlaceholder":"LLM이 참고해야 할 지식이나 컨벤션을 작성하세요…","wiki.form.linkHint":"[[ 또는 @ 입력으로 다른 위키 항목을 링크하세요.","wiki.form.tags":"태그","wiki.form.tagsPlaceholder":"태그 입력 후 Enter","wiki.form.pinned":"고정 (강조 표시)","wiki.edge.editTitle":"연결 편집","wiki.edge.relationType":"관계 종류","wiki.edge.label":"라벨","wiki.edge.labelPlaceholder":'선택 메모 (예: "3.2절 참조")',"wiki.edge.deleteConfirm":"이 연결을 삭제할까요?","wiki.edge.relations.related":"관련","wiki.edge.relations.precedes":"선행","wiki.edge.relations.example_of":"예시","wiki.edge.relations.counter_example":"반례","wiki.edge.relations.refines":"구체화","vault.title":"문서","vault.empty":"마크다운 파일이 없습니다","vault.noResults":"일치하는 파일 없음","vault.searchPlaceholder":"파일 검색…","vault.graph.addLink":"여기서 링크 추가","vault.graph.linkHint":"연결할 대상 노드를 클릭하세요 · Esc 취소","vault.graph.showLabels":"이름 표시","vault.graph.rightClickHint":"우클릭 → 링크 추가","vault.newFile":"새 파일","vault.create":"만들기","vault.save":"저장","vault.delete":"삭제","vault.unsaved":"미저장","vault.confirmDelete":"{path} 파일을 삭제할까요?","vault.backlinks":"백링크","vault.filesCount":"개 파일","vault.panel.fileExplorer":"파일","vault.panel.search":"검색","vault.panel.tags":"태그","vault.panel.graph":"그래프","vault.panel.outline":"개요","vault.panel.backlinks":"백링크","vault.panel.outgoing":"아웃고잉 링크","vault.panel.preview":"미리보기","vault.outline.empty":"이 노트에 헤딩이 없습니다","vault.outgoing.empty":"아웃고잉 위키링크 없음","vault.backlinks.empty":"백링크 없음","vault.tags.empty":"문서에 태그 없음","vault.search.empty":"결과 없음","vault.search.prompt":".md 노트 검색","vault.activeFile.empty":"파일을 선택해 미리보기/편집하세요","vault.sidebar.collapse":"사이드바 접기","vault.sidebar.expand":"사이드바 펼치기","vault.loadError":"문서 목록을 불러오지 못했습니다","vault.retry":"다시 시도","vault.allHidden":'모든 문서가 .vaultignore로 숨김 상태입니다. 파일 탐색기에서 우클릭 → "문서에 다시 보이기"로 해제하세요.',"vault.ignoreHelp":".vaultignore 사용법","vaultInject.title":"문서 주입","vaultInject.modeNone":"사용 안 함","vaultInject.modeAuto":"자동","vaultInject.modeAll":"전체 주입","vaultInject.modeSelected":"선택 주입","vaultInject.autoHint":"실행 직전 LLM이 작업 설명을 기준으로 {count}개 파일 중 최대 10개를 골라 주입합니다.","vaultInject.previewToggle":"미리보기","vaultInject.previewChars":"{n}자","vaultInject.previewTokens":"약 {n} 토큰","vaultInject.empty":"프로젝트 루트에 .md/.html 파일이 없습니다.","vaultInject.injectedCount":"{count}개 파일 주입","vaultInject.allCount":"전체 {count}개 파일 주입","vaultInject.searchPlaceholder":"이름으로 필터…","vaultInject.loading":"불러오는 중…","vaultInject.includeLinked":"체크 시 1-hop 연결된 파일도 함께 선택","vaultInject.linkedAdded":"+{n}개 연결","vaultInject.noResults":"일치하는 파일 없음","wiki.ingest":"Ingest","wiki.ingest.title":"소스 자료 인제스트","wiki.ingest.tabTask":"태스크에서","wiki.ingest.tabDiscussion":"디스커션에서","wiki.ingest.tabText":"텍스트 붙여넣기","wiki.ingest.selectTask":"완료된 태스크 선택","wiki.ingest.selectDiscussion":"완료된 디스커션 선택","wiki.ingest.noTasks":"완료된 태스크가 없습니다","wiki.ingest.noDiscussions":"완료된 디스커션이 없습니다","wiki.ingest.textPlaceholder":"아티클, 노트, 채팅 기록 등 텍스트를 붙여넣으면 지식을 추출합니다…","wiki.ingest.run":"인제스트","wiki.ingest.running":"인제스트 중…","wiki.ingest.success":"{created}개 생성, {updated}개 갱신, 엣지 {edges}개 추가","wiki.ingest.parseFailed":"LLM 응답을 JSON으로 해석하지 못했습니다. 변경 사항 없음.","wiki.ingest.modelEmpty":"LLM이 추가할 만한 새 내용이 없다고 판단했습니다. 제안 0건.","wiki.ingest.allSkipped":"제안된 항목이 모두 스킵되었습니다. 아래 사유를 확인하세요.","wiki.ingest.proposed":"LLM 제안: 생성 {c}, 갱신 {u}, 엣지 {e}","wiki.ingest.skipNote":"스킵됨","wiki.ingest.skip.duplicate":"이미 존재하는 제목","wiki.ingest.skip.unique":"DB UNIQUE 충돌","wiki.ingest.skip.empty":"제목 없음","wiki.ingest.skip.badId":"갱신 대상 id 가 유효하지 않음","wiki.ingest.skip.badEdge":"엣지 양 끝 노드를 찾을 수 없음","wiki.ingest.skip.selfEdge":"자기 자신을 가리키는 엣지","wiki.ingest.skip.edgeUnique":"엣지 UNIQUE 충돌","wiki.ingest.rawSnippet":"원본 응답 일부 보기","wiki.ingest.toast.success":"{source} → 위키 업데이트: {created}개 생성, {updated}개 갱신, 엣지 {edges}개","wiki.ingest.toast.empty":"{source} → 위키 인제스트: 추가할 새 내용 없음","wiki.ingest.toast.parseFailed":"{source} → 위키 인제스트: LLM 응답 파싱 실패","wiki.ingest.toast.failed":"위키 자동 인제스트 실패","wiki.schemaSection":"스키마","wiki.schemaSectionHint":"Ingest가 사용하는 항목 종류와 규칙을 정의합니다. 프로젝트에 맞게 편집하세요.","wiki.schemaBannerTitle":"위키 스키마","wiki.schemaBannerHint":"여기를 편집하면 Ingest 시 LLM이 새 항목을 분류하는 방식이 바뀝니다. 삭제하면 기본값으로 재생성됩니다.","wiki.systemSection":"시스템","wiki.systemSectionHint":"Ingest 동작과 빠른 탐색을 지원하는 자동 유지 항목들입니다.","wiki.indexBannerTitle":"위키 인덱스","wiki.indexBannerHint":"위키 변경 시마다 자동 재생성됩니다. 수동 편집은 덮어써지고, 삭제해도 다음 변경 때 재생성됩니다.","wiki.asset.uploading":"이미지 업로드 중…","wiki.asset.tooLarge":"이미지가 너무 큽니다 (최대 10MB)","wiki.diskDiff.button":"디스크 비교","wiki.diskDiff.tooltip":"내보낸 위키 파일과 DB 비교","wiki.diskDiff.title":"위키 vs .clitrigger/wiki/","wiki.diskDiff.intro":"DB가 export할 내용과 디스크 파일이 다른 것만 보여주는 읽기 전용 뷰입니다. Obsidian 등 외부에서 편집한 내용이 여기 나타나고, Rebuild는 디스크를 현재 DB 상태로 덮어씁니다.","wiki.diskDiff.running":"비교 중…","wiki.diskDiff.empty":"디스크와 DB가 일치합니다.","wiki.diskDiff.refresh":"다시 비교","wiki.diskDiff.close":"닫기","wiki.diskDiff.section.modified":"디스크에서 수정됨 ({n})","wiki.diskDiff.section.missing":"디스크에 없음 ({n})","wiki.diskDiff.section.untracked":"추적되지 않는 디스크 파일 ({n})","wiki.diskDiff.rebuild":"DB 기준으로 재생성","wiki.diskDiff.rebuildTooltip":"현재 DB 상태로 wiki/ 폴더를 덮어씁니다. 디스크의 편집 내용은 사라집니다.","wiki.diskDiff.rebuildConfirm":"wiki/ 폴더를 현재 DB 상태로 덮어쓸까요? 디스크의 편집 내용은 사라집니다.","wiki.diskDiff.rebuildResult":"재생성됨: {written}개 작성, {removed}개 삭제","wiki.lint":"Lint","wiki.lint.title":"위키 건강 검사","wiki.lint.running":"검사 중…","wiki.lint.empty":"발견된 이슈가 없습니다.","wiki.lint.close":"닫기","wiki.lint.rerun":"다시 검사","wiki.lint.mergeConfirm":'"{absorb}"을(를) "{keep}"에 병합할까요? 본문 결합, 태그 합집합, 엣지/위키링크 재배선 후 "{absorb}"이 삭제됩니다.',"wiki.lint.action.mergeKeep":'"{keep}" 유지, "{absorb}" 병합',"wiki.lint.action.delete":"삭제","wiki.lint.action.deleteTitle":'"{title}" 삭제',"wiki.lint.action.link":"연결","wiki.lint.action.linkTo":"연결 대상…","wiki.sourceAutoLabel":"자동","wiki.viewRaw":"Raw 원본 보기","wiki.loading":"불러오는 중…","wiki.close":"닫기","wiki.subTab.wiki":"위키","wiki.subTab.sources":"원본","wiki.subTab.activity":"활동","wiki.activity.empty":"아직 활동 없음","wiki.activity.emptyHint":"Ingest, Lint, Retrieve, Merge 이벤트가 여기 기록됩니다.","wiki.activity.refresh":"새로고침","wiki.activity.filter.all":"전체","wiki.activity.filter.ingest":"인제스트","wiki.activity.filter.lint":"Lint","wiki.activity.filter.retrieve":"검색","wiki.activity.filter.merge":"병합","wiki.sources.empty":"사이드바에서 raw 파일을 선택하세요.","wiki.sources.noFiles":"아직 raw 파일이 없습니다. Ingest를 실행하세요.","wiki.rawFile.derivedTitle":"이 원본에서 파생된 항목","wiki.rawFile.noDerived":"이 원본에서 파생된 항목 없음","wiki.rawFile.openSiblings":"이 원본에서 파생된 {n}개 항목 보기","wiki.rawFile.openExternal":"기본 앱으로 열기","wiki.rawFile.revealInFolder":"폴더에서 보기","wiki.rawFile.delete":"원본 삭제","wiki.rawFile.deleteConfirm":"이 원본 파일을 삭제할까요? 위키 노드는 유지됩니다.","wiki.rawFile.deleteConfirmDerived":"이 원본 파일을 삭제하고 파생된 {n}개 위키 노드의 source 링크를 끊을까요? 노드 자체는 유지됩니다.","planner.title":"플래너","planner.add":"새 항목","planner.view.pages":"페이지","planner.view.all":"전체 보기","planner.nav.calendar":"달력","planner.nav.list":"목록","web.urlPlaceholder":"https://…","web.go":"이동","web.desktopOnly":"웹 페이지 임베드는 데스크톱 앱에서만 표시됩니다.","web.openExternal":"브라우저에서 열기","web.fullscreen":"전체 화면","web.exitFullscreen":"전체 화면 종료","web.newTab":"새 탭","web.closeTab":"탭 닫기","web.emptyTab":"위 주소창에 URL을 입력하세요","web.hideBar":"주소창 숨기기","web.showBar":"주소창 표시","web.back":"뒤로","web.addFavorite":"즐겨찾기 추가","web.removeFavorite":"즐겨찾기 삭제","planner.block.tasklist":"할일 목록","planner.block.calendar":"캘린더","planner.block.addTask":"작업 추가…","planner.pages.newTemplate":"새 페이지: 템플릿 선택","planner.tpl.blank":"빈 페이지","planner.tpl.blank.desc":"빈 페이지에서 시작","planner.tpl.meeting":"회의 노트","planner.tpl.meeting.desc":"날짜·참석자·안건·액션 아이템","planner.tpl.project":"프로젝트 플랜","planner.tpl.project.desc":"개요·마일스톤·일정","planner.tpl.weekly":"위클리 플래너","planner.tpl.weekly.desc":"주간 목표·할 일·캘린더","planner.pages.new":"새 페이지","planner.pages.untitled":"제목 없음","planner.pages.empty":"페이지가 없습니다","planner.pages.emptyHint":"메모·문서·체크리스트를 자유롭게 작성할 페이지를 만드세요.","planner.pages.deleteConfirm":"이 페이지를 삭제할까요? 되돌릴 수 없습니다.","planner.pages.saving":"저장 중…","planner.pages.saved":"저장됨","planner.empty":"플래너 항목이 없습니다","planner.emptyHint":"아이디어, 작업, 계획을 플래너에 추가하세요.","planner.filterTag":"모든 태그","planner.filterStatus":"모든 상태","planner.col.title":"제목","planner.col.tags":"태그","planner.col.dueDate":"마감일","planner.col.status":"상태","planner.col.actions":"","planner.edit":"수정","planner.delete":"삭제","planner.deleteConfirm":"이 플래너 항목을 삭제하시겠습니까?","planner.convertToTask":"자동 작업으로 변환","planner.convertToSchedule":"루틴으로 변환","planner.convertToTerminal":"터미널로 보내기","planner.movedToTodo":"자동 작업으로 이동됨","planner.movedToSchedule":"루틴으로 이동됨","planner.movedToSession":"터미널로 이동됨","planner.fromDiscussion":"토론에서","planner.noDueDate":"—","planner.export":"내보내기","planner.exportTooltip":"플래너 항목을 Markdown 파일로 내보내기","planner.exportError":"내보내기 실패","planner.import":"가져오기","planner.importTooltip":"Markdown 파일에서 플래너 항목 가져오기","planner.importSuccess":"{items}개 항목과 {tags}개 태그를 가져왔습니다.","planner.importError":"가져오기 실패","planner.importInvalidMarkdown":"파일이 비어 있거나 유효한 Markdown이 아닙니다","planner.importNoImages":"참고: 이미지는 내보낸 파일에 포함되지 않습니다.","planner.dropHint":"여기에 Markdown 파일을 놓아 가져오기","planner.dropHintSub":".md 또는 .markdown","planner.dropInvalidFile":"Markdown 파일(.md / .markdown)만 가져올 수 있습니다","plannerForm.titlePlaceholder":"예: 릴리스 노트 초안 작성","plannerForm.descPlaceholder":"세부 내용, 링크, 완료 조건…","plannerForm.tags":"태그","plannerForm.tagsPlaceholder":"태그를 입력하고 Enter를 누르세요","plannerForm.dueDate":"마감일","plannerForm.priority":"우선순위","plannerForm.priorityLow":"낮음","plannerForm.priorityNormal":"보통","plannerForm.priorityHigh":"높음","plannerForm.priorityCritical":"긴급","plannerForm.status":"상태","plannerForm.addImage":"이미지 추가","plannerForm.pasteHint":"Ctrl+V로 이미지 붙여넣기","plannerForm.images":"이미지","plannerForm.cancel":"취소","plannerForm.save":"저장","plannerStatus.pending":"대기","plannerStatus.in_progress":"진행 중","plannerStatus.done":"완료","plannerStatus.moved":"이동됨","plannerConvert.toTask":"자동 작업으로 변환","plannerConvert.toSchedule":"루틴으로 변환","plannerConvert.toTerminal":"터미널로 보내기","plannerConvert.useWorktree":"git worktree 사용","plannerConvert.cliTool":"CLI 도구","plannerConvert.maxTurns":"최대 턴","plannerConvert.scheduleType":"루틴 유형","plannerConvert.recurring":"반복","plannerConvert.once":"일회성","plannerConvert.cronExpression":"Cron 표현식","plannerConvert.runAt":"실행 시각","plannerConvert.cancel":"취소","plannerConvert.convert":"변환","plannerTag.selectOrCreate":"옵션 선택 또는 생성","plannerTag.delete":"삭제","plannerTag.deleteConfirm":"이 태그를 모든 항목에서 제거하시겠습니까?","plannerTag.color":"색","plannerTag.rename":"이름 변경","plannerTag.color.default":"기본","plannerTag.color.gray":"회색","plannerTag.color.brown":"갈색","plannerTag.color.orange":"주황색","plannerTag.color.yellow":"노란색","plannerTag.color.green":"초록색","plannerTag.color.blue":"파란색","plannerTag.color.purple":"보라색","plannerTag.color.pink":"분홍색","plannerTag.color.red":"빨간색","session.new":"새 터미널","session.windowState.floating":"열림","session.windowState.minimized":"최소화","session.windowState.popped":"별도 창","session.recallToMain":"중앙으로 불러오기","session.popout.minimize":"최소화","session.restoreWindow":"창 복원","session.focusWindow":"창으로 이동","session.maximize":"터미널 최대화","session.restoreSize":"터미널 크기 복원","session.maximizeHint":"제목 표시줄을 두 번 클릭해 전환","session.layout.single":"1분할","session.layout.columns":"2분할","session.layout.grid":"2 × 2 분할","session.openWindow":"터미널 열기","session.dock.poppedHint":"별도 창입니다. 클릭하면 앞으로 가져옵니다.","session.title":"터미널 제목","session.description":"초기 프롬프트 (선택)","session.start":"시작","session.stop":"중지","session.resume":"이어서 시작","session.resumeHint":"이 세션의 직전 Claude 대화에 이어서 시작합니다","session.delete":"삭제","session.edit":"편집","session.editDisabledRunning":"실행 중에는 편집할 수 없습니다","session.save":"저장","session.saving":"저장 중…","session.empty":"터미널이 없습니다","session.emptyHint":"대화형 AI 터미널을 시작하세요.","session.create":"터미널 생성","session.cliTool":"CLI 도구","session.cliNotInstalled":" (설치 안 됨)","session.worktree":"워크트리 사용 (격리된 브랜치)","session.cleanup":"워크트리 삭제","session.startInWindow":"시작","session.starting":"시작하는 중…","session.starting.typeAhead":"미리 입력한 내용은 터미널 준비가 끝나면 그대로 전송됩니다","session.stopping":"중지하는 중…","session.startFailed":"시작 실패","session.confirmStop":"이 터미널을 종료할까요? 진행 중인 작업이 종료됩니다.","session.popout.blocked":"팝업이 차단되었습니다. 팝아웃을 쓰려면 이 사이트의 팝업을 허용하세요.","session.diff.capture":"스냅샷 캡처","session.diff.pageStart":"시작부터","session.minimize":"최소화","session.fontDecrease":"글자 작게","session.refresh":"새로고침","session.refresh.hint":"터미널 화면만 다시 그립니다 (PTY는 그대로 유지)","session.initialPrompt.ready":"보낼 준비된 초기 프롬프트","session.initialPrompt.preview":"미리보기","session.initialPrompt.hidePreview":"숨기기","session.initialPrompt.send":"보내기","session.initialPrompt.skip":"건너뛰기","session.initialPrompt.loading":"불러오는 중…","session.initialPrompt.blocked":"타이핑하려면 보내기 또는 건너뛰기를 먼저 눌러주세요. 그 전엔 입력이 무시됩니다.","session.fontIncrease":"글자 크게","group.closeTab":"탭 닫기","group.newTab":"쉘 탭 새로 열기","analytics.title":"실행 통계","analytics.loading":"통계 로딩 중…","analytics.noData":"데이터 없음","analytics.totalTasks":"총 작업","analytics.successRate":"성공률","analytics.totalCost":"총 비용","analytics.totalTokens":"총 토큰","analytics.avgPerTask":"작업당 평균","analytics.byStatus":"상태별","analytics.byCliTool":"CLI 도구별","analytics.dailyActivity":"일별 활동","analytics.dailyCost":"일별 비용","analytics.costBreakdown":"비용 요약","analytics.tasks":"작업","analytics.period.7d":"7일","analytics.period.30d":"30일","analytics.period.90d":"90일","analytics.period.all":"전체","analytics.clear":"초기화","analytics.clearConfirm":"통계를 초기화할까요? 작업은 삭제되지 않으며, 지금 이후에 생성된 작업만 집계됩니다.","discussions.title":"에이전트 토론","discussions.add":"새 토론","discussions.empty":"아직 토론이 없습니다","discussions.emptyHint":"에이전트들이 피쳐를 함께 토론하도록 새 토론을 만드세요.","discussions.round":"라운드","discussions.maxRounds":"최대 라운드","discussions.agents":"에이전트","discussions.speaking":"발언 중…","discussions.inject":"메시지 전송","discussions.skipTurn":"턴 건너뛰기","discussions.implement":"구현 시작","discussions.implementHint":"토론된 기능을 구현할 에이전트를 선택하세요.","discussions.selectAgent":"구현 에이전트 선택","discussions.toPlanner":"Planner로 보내기","discussions.extractTitle":"액션 아이템 추출","discussions.extractHint":"AI가 토론에서 추출한 Planner 항목입니다. 저장 전에 편집하거나 제외하거나 우선순위를 조정하세요.","discussions.extractLoading":"토론에서 액션 아이템을 추출하는 중…","discussions.extractLoadingHint":"최대 2분 정도 걸릴 수 있습니다. 추출이 끝날 때까지 창이 닫히지 않습니다.","discussions.extractEmpty":"추출할 액션 아이템이 없습니다. 다른 토론을 시도하거나 합의된 내용을 보강하세요.","discussions.extractConfirm":"Planner에 저장","discussions.extractSaving":"저장 중…","discussions.priorityLow":"낮음","discussions.priorityMedium":"보통","discussions.priorityHigh":"높음","discussions.priorityUrgent":"긴급","discussions.notFound":"토론을 찾을 수 없습니다","discussions.back":"토론 목록으로","discussions.userMessage":"메시지를 입력하세요…","discussions.implementation":"구현","discussions.resume":"재개","discussions.retry":"다시 실행","discussions.failureTitle":"토론 실패","discussions.noErrorLogs":"에러 상세 정보가 없습니다","discussions.pause":"일시 중지","discussions.waiting":"대기 중…","discussions.roundExplain":"에이전트 전원이 한 번씩 발언하는 단위입니다.","discussions.autoImplement":"토론 후 자동 구현","discussions.autoImplementHint":"모든 라운드 완료 후 자동으로 구현을 시작합니다.","discussions.collapse":"접기","discussions.expand":"펼치기","discussions.collapseAll":"전체 접기","discussions.expandAll":"전체 펼치기","status.skipped":"건너뜀","status.paused":"일시 중지","agents.title":"에이전트 페르소나","agents.add":"에이전트 추가","agents.name":"이름","agents.role":"역할","agents.systemPrompt":"시스템 프롬프트","agents.cliTool":"CLI 도구","agents.color":"색상","agents.empty":"에이전트가 없습니다. 토론을 시작하려면 에이전트 페르소나를 만드세요.","agents.manage":"에이전트 관리","agents.presets":"프리셋 템플릿","agents.roles.architect":"아키텍트","agents.roles.developer":"개발자","agents.roles.reviewer":"리뷰어","agents.roles.pm":"PM","agents.roles.tester":"테스터","agents.roles.custom":"사용자 정의","agents.canImplement":"토론 중 구현 수행","agents.canImplementHelp":"이 에이전트의 턴에서 발언뿐 아니라 실제 코드 작성·커밋까지 수행합니다. 개발자 역할 에이전트가 아이디어를 즉석에서 시연하도록 할 때 유용합니다.","agents.canImplementBadge":"구현자","git.ahead":"앞섬","git.behind":"뒤처짐","git.staged":"스테이징","git.unstaged":"변경됨","git.noChanges":"작업 트리 깨끗","git.refresh":"새로고침","git.files":"파일","git.commitHistory":"커밋 히스토리","git.branches":"브랜치","git.remotes":"원격","git.tags":"태그","git.stashes":"스태시","git.noCommits":"아직 커밋이 없습니다","git.loadMore":"더 불러오는 중…","git.author":"작성자","git.hash":"해시","git.graph":"그래프","git.description":"설명","git.date":"날짜","git.commit":"커밋","git.pull":"Pull","git.push":"Push","git.pushDialog.targetRemote":"다음 저장소에 푸시","git.pushDialog.branchesHeader":"푸시할 브랜치","git.pushDialog.colPush":"푸시?","git.pushDialog.colLocal":"로컬 브랜치","git.pushDialog.colRemote":"리모트 브랜치","git.pushDialog.colTracking":"추적?","git.pushDialog.selectAll":"모두 선택","git.pushDialog.allTags":"모든 태그 푸시","git.pushDialog.force":"강제 푸시","git.pushDialog.forceHint":"--force-with-lease 사용 (마지막 fetch 이후 원격이 진행되었으면 거부).","git.pushDialog.submit":"Push","git.pushDialog.cancel":"취소","git.pushDialog.pushing":"푸시 중…","git.pushDialog.loading":"불러오는 중…","git.pushDialog.errorRequireBranch":"푸시할 브랜치를 하나 이상 선택하세요.","git.pushDialog.noLocalBranches":"로컬 브랜치가 없습니다.","git.pushDialog.newBranch":"신규","git.pushDialog.customRemote":"직접 입력…","git.fetch":"패치","git.branch":"브랜치","git.merge":"병합","git.conflicts":"충돌","git.conflictMergeInProgress":"병합 진행 중","git.conflictRebaseInProgress":"리베이스 진행 중","git.conflictBanner":"충돌 파일 {n}개. 파일별로 해결한 뒤 계속을 누르세요.","git.conflictAllResolved":"충돌이 모두 해결되었습니다. 계속을 누르세요.","git.acceptOurs":"내 변경 사용","git.acceptTheirs":"상대 변경 사용","git.cr.ours":"내 변경 (HEAD)","git.cr.theirs":"상대 변경 (incoming)","git.cr.both":"둘 다","git.cr.manual":"직접 편집","git.cr.guided":"가이드","git.cr.save":"해결 내용 저장","git.cr.unresolved":"미해결 {n}개","git.cr.allResolved":"모두 해결됨","git.cr.markersRemain":"아직 충돌 마커가 남아 있습니다","git.cr.loadFailed":"충돌 파일을 불러오지 못했습니다","git.cr.noConflicts":"이 파일에는 충돌 구역이 없습니다","git.conflictContinue":"계속","git.conflictAbort":"중단","git.confirmConflictAbort":"중단하고 이전 상태로 되돌릴까요?","git.viewConflicts":"충돌 보기","git.stash":"스태시","git.discard":"폐기","git.tag":"태그","git.untracked":"추적 안 됨","git.fileStatus":"파일 상태","git.stageAll":"모두 스테이지","git.unstageAll":"모두 언스테이지","git.stage":"스테이지","git.unstage":"언스테이지","git.commitMessage":"커밋 메시지…","git.branchName":"브랜치 이름…","git.tagName":"태그 이름…","git.tagMessage":"태그 메시지 (선택)…","git.stashMessage":"스태시 메시지 (선택)…","git.selectBranch":"브랜치 선택…","git.discardAll":"모두 폐기","git.confirmDiscard":"모든 변경 사항을 폐기하시겠습니까? 되돌릴 수 없습니다.","git.confirmDiscardFile":"이 파일의 변경 사항을 폐기하시겠습니까?","git.newBranch":"새 브랜치","git.deleteBranch":"브랜치 삭제","git.stashPop":"꺼내기","git.noStashes":"스태시 없음","git.actions":"작업","git.close":"닫기","git.create":"생성","git.delete":"삭제","git.modified":"수정됨","git.added":"추가됨","git.deleted":"삭제됨","git.renamed":"이름변경","git.copied":"복사됨","git.checkout":"체크아웃","git.mergeInto":"현재 브랜치로 병합","git.rebaseOnto":"현재 변경사항을 재배치","git.copySha":"SHA 복사","git.createBranchHere":"여기서 브랜치 생성…","git.createTagHere":"여기에 태그 생성…","git.cherryPick":"현재 브랜치로 Cherry-pick","git.revertCommit":"커밋 되돌리기 (Revert)","git.resetHere":"현재 브랜치를 이 커밋으로 초기화","git.confirmRevert":"커밋 {hash}을(를) 되돌릴까요? 변경을 취소하는 새 커밋이 생성됩니다.","git.confirmCherryPick":"{hash}을(를) 현재 브랜치에 cherry-pick할까요?","git.confirmReset":"현재 브랜치를 {hash}({mode})로 초기화할까요?","git.confirmResetHard":"{hash}로 hard 초기화할까요? 이 지점 이후의 커밋과 커밋되지 않은 변경이 영구히 사라집니다.","git.promptBranchName":"새 브랜치 이름 ({hash} 기준):","git.promptTagName":"새 태그 이름 ({hash} 위치):","git.renameBranch":"브랜치 이름 변경","git.confirmDelete":"브랜치 {name}을(를) 삭제하시겠습니까?","git.newBranchName":"새 브랜치 이름…","git.rename":"이름 변경","git.checkoutRemote":"로컬 브랜치로 체크아웃","git.commitDetail":"커밋 상세","git.changedFiles":"변경된 파일","git.selectFileToViewDiff":"파일을 선택하면 차이를 볼 수 있습니다","git.noFilesChanged":"변경된 파일 없음","git.loadingFiles":"파일 불러오는 중…","git.loadingDiff":"차이 불러오는 중…","git.worktrees":"워크트리","git.cleanupWorktree":"정리","git.confirmCleanupWorktree":"워크트리와 브랜치 {name}을(를) 삭제하시겠습니까?","git.deleteWorktreeAndBranch":"브랜치 + 워크트리 삭제","git.confirmDeleteWorktreeAndBranch":"브랜치 {name}과(와) 연결된 워크트리를 함께 삭제할까요?","git.confirmForceDelete":"브랜치 {name}은(는) 어디에도 머지되지 않았습니다. 그래도 강제로 삭제할까요? 머지되지 않은 커밋은 사라집니다.","git.workspace":"워크스페이스","git.viewFileStatus":"파일 상태","git.viewHistory":"History","git.search":"Search","git.searchPlaceholder":"검색","git.stagedFiles":"스테이지에 올라간 파일","git.unstagedFiles":"스테이지에 올라가지 않은 파일","git.untrackedFiles":"추적 안 되는 파일","git.unstageAllShort":"모두 스테이지에서 내리기","git.unstageSelectedShort":"선택 내용 스테이지에서 내리기","git.stageAllShort":"모두 스테이지에 올리기","git.stageSelectedShort":"선택 내용 스테이지에 올리기","git.addToGitignore":".gitignore에 추가","git.commitOptions":"커밋 옵션","git.pushImmediately":"커밋 후 {remote}에 즉시 푸시","git.amendLastCommit":"마지막 커밋 정정","git.commitButton":"커밋","git.selectFileForDiff":"파일을 선택하면 차이를 볼 수 있습니다","git.binaryFile":"바이너리 파일 (미리보기 불가)","git.untrackedNewFile":"(새 파일)","git.workingTreeClean":"커밋할 변경사항이 없습니다.","git.statusTarget":"체크아웃","git.mainCheckout":"메인 체크아웃","lang.toggle":"EN","theme.light":"라이트","theme.dark":"다크","notification.taskCompleted":"작업 완료","notification.taskFailed":"작업 실패","notification.discussionCompleted":"토론 완료","notification.discussionFailed":"토론 실패","notification.toggle":"알림 토글","notification.blocked":"브라우저에서 알림이 차단되었습니다","notification.sessionBlocked":"세션이 입력을 기다립니다","notification.sessionDone":"세션 작업이 끝났습니다"}},Sv=j.createContext(null);function Pw({children:s}){const[h,w]=j.useState(()=>{const A=localStorage.getItem("clitrigger-lang");return A==="ko"||A==="en"?A:"ko"}),S=j.useCallback(()=>{w(A=>{const r=A==="en"?"ko":"en";return localStorage.setItem("clitrigger-lang",r),r})},[]),M=j.useMemo(()=>zw(),[]),O=j.useCallback(A=>Hw[h][A]??M[h][A]??A,[h,M]);return v.jsx(Sv.Provider,{value:{lang:h,toggleLang:S,t:O},children:s})}function Tt(){const s=j.useContext(Sv);if(!s)throw new Error("useI18n must be used within I18nProvider");return s}const pi=({className:s="",variant:h="text",width:w,height:S,count:M=1})=>{const O="animate-pulse bg-warm-200",A={text:"rounded-md h-3 mb-2 last:mb-0",circular:"rounded-full",rectangular:"rounded-none",rounded:"rounded-xl"},r={width:w,height:S},u=Array.from({length:M});return v.jsx(v.Fragment,{children:u.map((d,g)=>v.jsx("div",{className:`${O} ${A[h]} ${s}`,style:r},g))})};/**
|
|
68
|
+
* @license lucide-react v1.8.0 - ISC
|
|
69
|
+
*
|
|
70
|
+
* This source code is licensed under the ISC license.
|
|
71
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
72
|
+
*/const xv=(...s)=>s.filter((h,w,S)=>!!h&&h.trim()!==""&&S.indexOf(h)===w).join(" ").trim();/**
|
|
73
|
+
* @license lucide-react v1.8.0 - ISC
|
|
74
|
+
*
|
|
75
|
+
* This source code is licensed under the ISC license.
|
|
76
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
77
|
+
*/const Iw=s=>s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
78
|
+
* @license lucide-react v1.8.0 - ISC
|
|
79
|
+
*
|
|
80
|
+
* This source code is licensed under the ISC license.
|
|
81
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
82
|
+
*/const Fw=s=>s.replace(/^([A-Z])|[\s-_]+(\w)/g,(h,w,S)=>S?S.toUpperCase():w.toLowerCase());/**
|
|
83
|
+
* @license lucide-react v1.8.0 - ISC
|
|
84
|
+
*
|
|
85
|
+
* This source code is licensed under the ISC license.
|
|
86
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
87
|
+
*/const tg=s=>{const h=Fw(s);return h.charAt(0).toUpperCase()+h.slice(1)};/**
|
|
88
|
+
* @license lucide-react v1.8.0 - ISC
|
|
89
|
+
*
|
|
90
|
+
* This source code is licensed under the ISC license.
|
|
91
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
92
|
+
*/var Gu={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"};/**
|
|
93
|
+
* @license lucide-react v1.8.0 - ISC
|
|
94
|
+
*
|
|
95
|
+
* This source code is licensed under the ISC license.
|
|
96
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
97
|
+
*/const Uw=s=>{for(const h in s)if(h.startsWith("aria-")||h==="role"||h==="title")return!0;return!1},$w=j.createContext({}),Ww=()=>j.useContext($w),qw=j.forwardRef(({color:s,size:h,strokeWidth:w,absoluteStrokeWidth:S,className:M="",children:O,iconNode:A,...r},u)=>{const{size:d=24,strokeWidth:g=2,absoluteStrokeWidth:l=!1,color:m="currentColor",className:b=""}=Ww()??{},C=S??l?Number(w??g)*24/Number(h??d):w??g;return j.createElement("svg",{ref:u,...Gu,width:h??d??Gu.width,height:h??d??Gu.height,stroke:s??m,strokeWidth:C,className:xv("lucide",b,M),...!O&&!Uw(r)&&{"aria-hidden":"true"},...r},[...A.map(([p,o])=>j.createElement(p,o)),...Array.isArray(O)?O:[O]])});/**
|
|
98
|
+
* @license lucide-react v1.8.0 - ISC
|
|
99
|
+
*
|
|
100
|
+
* This source code is licensed under the ISC license.
|
|
101
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
102
|
+
*/const Qe=(s,h)=>{const w=j.forwardRef(({className:S,...M},O)=>j.createElement(qw,{ref:O,iconNode:h,className:xv(`lucide-${Iw(tg(s))}`,`lucide-${s}`,S),...M}));return w.displayName=tg(s),w};/**
|
|
103
|
+
* @license lucide-react v1.8.0 - ISC
|
|
104
|
+
*
|
|
105
|
+
* This source code is licensed under the ISC license.
|
|
106
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
107
|
+
*/const Gw=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]],Yw=Qe("bell-off",Gw);/**
|
|
108
|
+
* @license lucide-react v1.8.0 - ISC
|
|
109
|
+
*
|
|
110
|
+
* This source code is licensed under the ISC license.
|
|
111
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
112
|
+
*/const Kw=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],Xw=Qe("bell",Kw);/**
|
|
113
|
+
* @license lucide-react v1.8.0 - ISC
|
|
114
|
+
*
|
|
115
|
+
* This source code is licensed under the ISC license.
|
|
116
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
117
|
+
*/const Vw=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],Jw=Qe("bug",Vw);/**
|
|
118
|
+
* @license lucide-react v1.8.0 - ISC
|
|
119
|
+
*
|
|
120
|
+
* This source code is licensed under the ISC license.
|
|
121
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
122
|
+
*/const Qw=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],ig=Qe("calendar-days",Qw);/**
|
|
123
|
+
* @license lucide-react v1.8.0 - ISC
|
|
124
|
+
*
|
|
125
|
+
* This source code is licensed under the ISC license.
|
|
126
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
127
|
+
*/const Zw=[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],e1=Qe("camera",Zw);/**
|
|
128
|
+
* @license lucide-react v1.8.0 - ISC
|
|
129
|
+
*
|
|
130
|
+
* This source code is licensed under the ISC license.
|
|
131
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
132
|
+
*/const t1=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Do=Qe("check",t1);/**
|
|
133
|
+
* @license lucide-react v1.8.0 - ISC
|
|
134
|
+
*
|
|
135
|
+
* This source code is licensed under the ISC license.
|
|
136
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
137
|
+
*/const i1=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Dh=Qe("chevron-down",i1);/**
|
|
138
|
+
* @license lucide-react v1.8.0 - ISC
|
|
139
|
+
*
|
|
140
|
+
* This source code is licensed under the ISC license.
|
|
141
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
142
|
+
*/const s1=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],n1=Qe("chevron-right",s1);/**
|
|
143
|
+
* @license lucide-react v1.8.0 - ISC
|
|
144
|
+
*
|
|
145
|
+
* This source code is licensed under the ISC license.
|
|
146
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
147
|
+
*/const r1=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Cv=Qe("chevron-up",r1);/**
|
|
148
|
+
* @license lucide-react v1.8.0 - ISC
|
|
149
|
+
*
|
|
150
|
+
* This source code is licensed under the ISC license.
|
|
151
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
152
|
+
*/const o1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],kv=Qe("circle-alert",o1);/**
|
|
153
|
+
* @license lucide-react v1.8.0 - ISC
|
|
154
|
+
*
|
|
155
|
+
* This source code is licensed under the ISC license.
|
|
156
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
157
|
+
*/const a1=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],l1=Qe("circle-check-big",a1);/**
|
|
158
|
+
* @license lucide-react v1.8.0 - ISC
|
|
159
|
+
*
|
|
160
|
+
* This source code is licensed under the ISC license.
|
|
161
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
162
|
+
*/const c1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],u1=Qe("circle-x",c1);/**
|
|
163
|
+
* @license lucide-react v1.8.0 - ISC
|
|
164
|
+
*
|
|
165
|
+
* This source code is licensed under the ISC license.
|
|
166
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
167
|
+
*/const h1=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]],d1=Qe("clipboard",h1);/**
|
|
168
|
+
* @license lucide-react v1.8.0 - ISC
|
|
169
|
+
*
|
|
170
|
+
* This source code is licensed under the ISC license.
|
|
171
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
172
|
+
*/const f1=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],Ev=Qe("cloud",f1);/**
|
|
173
|
+
* @license lucide-react v1.8.0 - ISC
|
|
174
|
+
*
|
|
175
|
+
* This source code is licensed under the ISC license.
|
|
176
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
177
|
+
*/const p1=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],Lv=Qe("columns-2",p1);/**
|
|
178
|
+
* @license lucide-react v1.8.0 - ISC
|
|
179
|
+
*
|
|
180
|
+
* This source code is licensed under the ISC license.
|
|
181
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
182
|
+
*/const m1=[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]],g1=Qe("command",m1);/**
|
|
183
|
+
* @license lucide-react v1.8.0 - ISC
|
|
184
|
+
*
|
|
185
|
+
* This source code is licensed under the ISC license.
|
|
186
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
187
|
+
*/const v1=[["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"}]],_1=Qe("copy",v1);/**
|
|
188
|
+
* @license lucide-react v1.8.0 - ISC
|
|
189
|
+
*
|
|
190
|
+
* This source code is licensed under the ISC license.
|
|
191
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
192
|
+
*/const b1=[["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"}]],_r=Qe("external-link",b1);/**
|
|
193
|
+
* @license lucide-react v1.8.0 - ISC
|
|
194
|
+
*
|
|
195
|
+
* This source code is licensed under the ISC license.
|
|
196
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
197
|
+
*/const y1=[["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 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],Rv=Qe("file-code",y1);/**
|
|
198
|
+
* @license lucide-react v1.8.0 - ISC
|
|
199
|
+
*
|
|
200
|
+
* This source code is licensed under the ISC license.
|
|
201
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
202
|
+
*/const w1=[["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"}]],Dv=Qe("folder-open",w1);/**
|
|
203
|
+
* @license lucide-react v1.8.0 - ISC
|
|
204
|
+
*
|
|
205
|
+
* This source code is licensed under the ISC license.
|
|
206
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
207
|
+
*/const S1=[["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"}]],x1=Qe("git-branch",S1);/**
|
|
208
|
+
* @license lucide-react v1.8.0 - ISC
|
|
209
|
+
*
|
|
210
|
+
* This source code is licensed under the ISC license.
|
|
211
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
212
|
+
*/const C1=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]],k1=Qe("git-compare",C1);/**
|
|
213
|
+
* @license lucide-react v1.8.0 - ISC
|
|
214
|
+
*
|
|
215
|
+
* This source code is licensed under the ISC license.
|
|
216
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
217
|
+
*/const E1=[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 12h18",key:"1i2n21"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]],Tv=Qe("grid-2x2",E1);/**
|
|
218
|
+
* @license lucide-react v1.8.0 - ISC
|
|
219
|
+
*
|
|
220
|
+
* This source code is licensed under the ISC license.
|
|
221
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
222
|
+
*/const L1=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],R1=Qe("grip-vertical",L1);/**
|
|
223
|
+
* @license lucide-react v1.8.0 - ISC
|
|
224
|
+
*
|
|
225
|
+
* This source code is licensed under the ISC license.
|
|
226
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
227
|
+
*/const D1=[["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"}]],sg=Qe("inbox",D1);/**
|
|
228
|
+
* @license lucide-react v1.8.0 - ISC
|
|
229
|
+
*
|
|
230
|
+
* This source code is licensed under the ISC license.
|
|
231
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
232
|
+
*/const T1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],M1=Qe("info",T1);/**
|
|
233
|
+
* @license lucide-react v1.8.0 - ISC
|
|
234
|
+
*
|
|
235
|
+
* This source code is licensed under the ISC license.
|
|
236
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
237
|
+
*/const A1=[["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"}]],j1=Qe("key-round",A1);/**
|
|
238
|
+
* @license lucide-react v1.8.0 - ISC
|
|
239
|
+
*
|
|
240
|
+
* This source code is licensed under the ISC license.
|
|
241
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
242
|
+
*/const O1=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],ng=Qe("layout-dashboard",O1);/**
|
|
243
|
+
* @license lucide-react v1.8.0 - ISC
|
|
244
|
+
*
|
|
245
|
+
* This source code is licensed under the ISC license.
|
|
246
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
247
|
+
*/const B1=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],Mv=Qe("link",B1);/**
|
|
248
|
+
* @license lucide-react v1.8.0 - ISC
|
|
249
|
+
*
|
|
250
|
+
* This source code is licensed under the ISC license.
|
|
251
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
252
|
+
*/const N1=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],lh=Qe("loader-circle",N1);/**
|
|
253
|
+
* @license lucide-react v1.8.0 - ISC
|
|
254
|
+
*
|
|
255
|
+
* This source code is licensed under the ISC license.
|
|
256
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
257
|
+
*/const z1=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],H1=Qe("log-out",z1);/**
|
|
258
|
+
* @license lucide-react v1.8.0 - ISC
|
|
259
|
+
*
|
|
260
|
+
* This source code is licensed under the ISC license.
|
|
261
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
262
|
+
*/const P1=[["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"}]],El=Qe("maximize-2",P1);/**
|
|
263
|
+
* @license lucide-react v1.8.0 - ISC
|
|
264
|
+
*
|
|
265
|
+
* This source code is licensed under the ISC license.
|
|
266
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
267
|
+
*/const I1=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],F1=Qe("menu",I1);/**
|
|
268
|
+
* @license lucide-react v1.8.0 - ISC
|
|
269
|
+
*
|
|
270
|
+
* This source code is licensed under the ISC license.
|
|
271
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
272
|
+
*/const U1=[["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"}]],Th=Qe("minimize-2",U1);/**
|
|
273
|
+
* @license lucide-react v1.8.0 - ISC
|
|
274
|
+
*
|
|
275
|
+
* This source code is licensed under the ISC license.
|
|
276
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
277
|
+
*/const $1=[["path",{d:"M5 12h14",key:"1ays0h"}]],Mh=Qe("minus",$1);/**
|
|
278
|
+
* @license lucide-react v1.8.0 - ISC
|
|
279
|
+
*
|
|
280
|
+
* This source code is licensed under the ISC license.
|
|
281
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
282
|
+
*/const W1=[["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"}]],rg=Qe("moon",W1);/**
|
|
283
|
+
* @license lucide-react v1.8.0 - ISC
|
|
284
|
+
*
|
|
285
|
+
* This source code is licensed under the ISC license.
|
|
286
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
287
|
+
*/const q1=[["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"}]],G1=Qe("palette",q1);/**
|
|
288
|
+
* @license lucide-react v1.8.0 - ISC
|
|
289
|
+
*
|
|
290
|
+
* This source code is licensed under the ISC license.
|
|
291
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
292
|
+
*/const Y1=[["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"}]],K1=Qe("panel-left-close",Y1);/**
|
|
293
|
+
* @license lucide-react v1.8.0 - ISC
|
|
294
|
+
*
|
|
295
|
+
* This source code is licensed under the ISC license.
|
|
296
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
297
|
+
*/const X1=[["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"}]],V1=Qe("panel-left-open",X1);/**
|
|
298
|
+
* @license lucide-react v1.8.0 - ISC
|
|
299
|
+
*
|
|
300
|
+
* This source code is licensed under the ISC license.
|
|
301
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
302
|
+
*/const J1=[["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"}]],Q1=Qe("pen",J1);/**
|
|
303
|
+
* @license lucide-react v1.8.0 - ISC
|
|
304
|
+
*
|
|
305
|
+
* This source code is licensed under the ISC license.
|
|
306
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
307
|
+
*/const Z1=[["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"}]],ch=Qe("pencil",Z1);/**
|
|
308
|
+
* @license lucide-react v1.8.0 - ISC
|
|
309
|
+
*
|
|
310
|
+
* This source code is licensed under the ISC license.
|
|
311
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
312
|
+
*/const eS=[["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"}]],tS=Qe("play",eS);/**
|
|
313
|
+
* @license lucide-react v1.8.0 - ISC
|
|
314
|
+
*
|
|
315
|
+
* This source code is licensed under the ISC license.
|
|
316
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
317
|
+
*/const iS=[["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"}]],sS=Qe("plug",iS);/**
|
|
318
|
+
* @license lucide-react v1.8.0 - ISC
|
|
319
|
+
*
|
|
320
|
+
* This source code is licensed under the ISC license.
|
|
321
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
322
|
+
*/const nS=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Mn=Qe("plus",nS);/**
|
|
323
|
+
* @license lucide-react v1.8.0 - ISC
|
|
324
|
+
*
|
|
325
|
+
* This source code is licensed under the ISC license.
|
|
326
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
327
|
+
*/const rS=[["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"}]],Av=Qe("refresh-cw",rS);/**
|
|
328
|
+
* @license lucide-react v1.8.0 - ISC
|
|
329
|
+
*
|
|
330
|
+
* This source code is licensed under the ISC license.
|
|
331
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
332
|
+
*/const oS=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],aS=Qe("rotate-cw",oS);/**
|
|
333
|
+
* @license lucide-react v1.8.0 - ISC
|
|
334
|
+
*
|
|
335
|
+
* This source code is licensed under the ISC license.
|
|
336
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
337
|
+
*/const lS=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],og=Qe("search",lS);/**
|
|
338
|
+
* @license lucide-react v1.8.0 - ISC
|
|
339
|
+
*
|
|
340
|
+
* This source code is licensed under the ISC license.
|
|
341
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
342
|
+
*/const cS=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],uS=Qe("send",cS);/**
|
|
343
|
+
* @license lucide-react v1.8.0 - ISC
|
|
344
|
+
*
|
|
345
|
+
* This source code is licensed under the ISC license.
|
|
346
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
347
|
+
*/const hS=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],ag=Qe("settings",hS);/**
|
|
348
|
+
* @license lucide-react v1.8.0 - ISC
|
|
349
|
+
*
|
|
350
|
+
* This source code is licensed under the ISC license.
|
|
351
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
352
|
+
*/const dS=[["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"}]],Ah=Qe("square-terminal",dS);/**
|
|
353
|
+
* @license lucide-react v1.8.0 - ISC
|
|
354
|
+
*
|
|
355
|
+
* This source code is licensed under the ISC license.
|
|
356
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
357
|
+
*/const fS=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],jv=Qe("square",fS);/**
|
|
358
|
+
* @license lucide-react v1.8.0 - ISC
|
|
359
|
+
*
|
|
360
|
+
* This source code is licensed under the ISC license.
|
|
361
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
362
|
+
*/const pS=[["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"}]],lg=Qe("sun",pS);/**
|
|
363
|
+
* @license lucide-react v1.8.0 - ISC
|
|
364
|
+
*
|
|
365
|
+
* This source code is licensed under the ISC license.
|
|
366
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
367
|
+
*/const mS=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Ov=Qe("terminal",mS);/**
|
|
368
|
+
* @license lucide-react v1.8.0 - ISC
|
|
369
|
+
*
|
|
370
|
+
* This source code is licensed under the ISC license.
|
|
371
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
372
|
+
*/const gS=[["path",{d:"m16 16-3 3 3 3",key:"117b85"}],["path",{d:"M3 12h14.5a1 1 0 0 1 0 7H13",key:"18xa6z"}],["path",{d:"M3 19h6",key:"1ygdsz"}],["path",{d:"M3 5h18",key:"1u36vt"}]],vS=Qe("text-wrap",gS);/**
|
|
373
|
+
* @license lucide-react v1.8.0 - ISC
|
|
374
|
+
*
|
|
375
|
+
* This source code is licensed under the ISC license.
|
|
376
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
377
|
+
*/const _S=[["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"}]],cg=Qe("trash-2",_S);/**
|
|
378
|
+
* @license lucide-react v1.8.0 - ISC
|
|
379
|
+
*
|
|
380
|
+
* This source code is licensed under the ISC license.
|
|
381
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
382
|
+
*/const bS=[["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"}]],yS=Qe("triangle-alert",bS);/**
|
|
383
|
+
* @license lucide-react v1.8.0 - ISC
|
|
384
|
+
*
|
|
385
|
+
* This source code is licensed under the ISC license.
|
|
386
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
387
|
+
*/const wS=[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]],SS=Qe("type",wS);/**
|
|
388
|
+
* @license lucide-react v1.8.0 - ISC
|
|
389
|
+
*
|
|
390
|
+
* This source code is licensed under the ISC license.
|
|
391
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
392
|
+
*/const xS=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ri=Qe("x",xS);/**
|
|
393
|
+
* @license lucide-react v1.8.0 - ISC
|
|
394
|
+
*
|
|
395
|
+
* This source code is licensed under the ISC license.
|
|
396
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
397
|
+
*/const CS=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],kS=Qe("zoom-in",CS);/**
|
|
398
|
+
* @license lucide-react v1.8.0 - ISC
|
|
399
|
+
*
|
|
400
|
+
* This source code is licensed under the ISC license.
|
|
401
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
402
|
+
*/const ES=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],LS=Qe("zoom-out",ES),ug=8;function RS({onLogin:s,onChangePassword:h}){const[w,S]=j.useState(""),[M,O]=j.useState(""),[A,r]=j.useState(""),[u,d]=j.useState(!1),[g,l]=j.useState(!1),[m,b]=j.useState(!1),[C,p]=j.useState(""),[o,c]=j.useState(!1),{t:a,toggleLang:f}=Tt(),y=u&&M.length>0&&M.length<ug,R=u&&A.length>0&&M!==A,k=u?!!w&&M.length>=ug&&M===A:!!w,D=()=>{d(L=>!L),O(""),r(""),p("")},E=async L=>{if(L.preventDefault(),!(!k||o)){p(""),c(!0);try{u?await h(w,M,A,m):await s(w,m)}catch(z){p(u&&z instanceof Error&&z.message?z.message:a("login.error"))}finally{c(!1)}}};return v.jsxs("div",{className:"min-h-screen bg-theme-bg flex items-center justify-center px-4 relative",children:[v.jsx("button",{onClick:f,className:"lang-toggle absolute top-6 right-6",children:a("lang.toggle")}),v.jsxs("div",{className:"w-full max-w-sm",children:[v.jsxs("div",{className:"text-center mb-10",children:[v.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-accent/10 mb-5",children:v.jsx(Ah,{size:32,className:"text-accent"})}),v.jsx("h1",{className:"text-2xl font-semibold text-theme-text",children:a("login.title")}),v.jsx("p",{className:"text-theme-muted text-sm mt-2",children:a("login.subtitle")})]}),v.jsx("form",{onSubmit:E,children:v.jsxs("div",{className:"card p-8",children:[v.jsx("label",{className:"block text-sm font-medium text-theme-text-secondary mb-2",children:a(u?"account.oldPassword":"login.password")}),v.jsx("input",{type:"password",value:w,onChange:L=>S(L.target.value),placeholder:"*************",className:"input-field text-base",autoComplete:"current-password",autoFocus:!0}),u&&v.jsxs(v.Fragment,{children:[v.jsx("label",{className:"block text-sm font-medium text-theme-text-secondary mb-2 mt-4",children:a("account.newPassword")}),v.jsx("input",{type:"password",value:M,onChange:L=>O(L.target.value),className:"input-field text-base",autoComplete:"new-password","aria-label":a("account.newPassword")}),y&&v.jsx("p",{className:"mt-1 text-2xs text-status-error",children:a("account.tooShort")}),v.jsx("label",{className:"block text-sm font-medium text-theme-text-secondary mb-2 mt-4",children:a("account.confirm")}),v.jsx("input",{type:"password",value:A,onChange:L=>r(L.target.value),className:"input-field text-base",autoComplete:"new-password","aria-label":a("account.confirm")}),R&&v.jsx("p",{className:"mt-1 text-2xs text-status-error",children:a("account.mismatch")})]}),C&&v.jsx("div",{className:"mt-4 py-2.5 px-4 bg-status-error/5 rounded-xl text-sm text-status-error",children:C}),v.jsxs("label",{className:"flex items-center gap-2 mt-5 text-sm text-theme-text-secondary cursor-pointer select-none",children:[v.jsx("input",{type:"checkbox",checked:m,onChange:L=>b(L.target.checked),className:"accent-accent w-4 h-4"}),a("login.rememberMe")]}),v.jsx("button",{type:"submit",disabled:!k||o,className:"btn-primary w-full mt-6 py-3",children:a(o?"login.loading":u?"login.changeSubmit":"login.submit")})]})}),v.jsxs("div",{className:"mt-4 flex items-center justify-center gap-5 text-xs",children:[v.jsx("button",{type:"button",onClick:D,className:"text-theme-muted hover:text-theme-text underline-offset-2 hover:underline",children:a(u?"login.backToLogin":"login.changePassword")}),v.jsx("button",{type:"button",onClick:()=>l(L=>!L),className:"text-theme-muted hover:text-theme-text underline-offset-2 hover:underline",children:a("login.forgot")})]}),g&&v.jsx("div",{className:"mt-3 px-4 py-3 rounded-xl text-xs text-theme-text-tertiary border leading-relaxed",children:a("login.forgotHint")}),v.jsx("div",{className:"mt-6 text-center text-xs text-theme-text-tertiary",children:a("login.footer")}),v.jsx("div",{className:"mt-4 px-2 py-3 rounded-xl text-xs text-theme-text-tertiary border leading-relaxed text-center",children:a("login.disclaimer")})]})]})}const hg=8;function DS({onSetup:s}){const[h,w]=j.useState(""),[S,M]=j.useState(""),[O,A]=j.useState(""),[r,u]=j.useState(!1),{t:d,toggleLang:g}=Tt(),l=h.length>0&&h.length<hg,m=S.length>0&&h!==S,b=h.length>=hg&&h===S&&!r,C=async p=>{if(p.preventDefault(),!!b){A(""),u(!0);try{await s(h,S)}catch(o){A(o instanceof Error&&o.message?o.message:d("setup.error"))}finally{u(!1)}}};return v.jsxs("div",{className:"min-h-screen bg-theme-bg flex items-center justify-center px-4 relative",children:[v.jsx("button",{onClick:g,className:"lang-toggle absolute top-6 right-6",children:d("lang.toggle")}),v.jsxs("div",{className:"w-full max-w-sm",children:[v.jsxs("div",{className:"text-center mb-10",children:[v.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-accent/10 mb-5",children:v.jsx(Ah,{size:32,className:"text-accent"})}),v.jsx("h1",{className:"text-2xl font-semibold text-theme-text",children:d("setup.title")}),v.jsx("p",{className:"text-theme-muted text-sm mt-2",children:d("setup.subtitle")})]}),v.jsx("form",{onSubmit:C,children:v.jsxs("div",{className:"card p-8",children:[v.jsx("label",{className:"block text-sm font-medium text-theme-text-secondary mb-2",children:d("setup.password")}),v.jsx("input",{type:"password",value:h,onChange:p=>w(p.target.value),placeholder:"*************",className:"input-field text-base",autoFocus:!0}),l&&v.jsx("p",{className:"mt-1 text-2xs text-status-error",children:d("setup.tooShort")}),v.jsx("label",{className:"block text-sm font-medium text-theme-text-secondary mb-2 mt-5",children:d("setup.confirm")}),v.jsx("input",{type:"password",value:S,onChange:p=>M(p.target.value),placeholder:"*************",className:"input-field text-base"}),m&&v.jsx("p",{className:"mt-1 text-2xs text-status-error",children:d("setup.mismatch")}),O&&v.jsx("div",{className:"mt-4 py-2.5 px-4 bg-status-error/5 rounded-xl text-sm text-status-error",children:O}),v.jsx("button",{type:"submit",disabled:!b,className:"btn-primary w-full mt-6 py-3",children:d(r?"setup.loading":"setup.submit")})]})}),v.jsx("div",{className:"mt-4 px-4 py-3 rounded-xl text-xs text-theme-text-tertiary border leading-relaxed text-center",children:d("setup.tunnelPaused")})]})]})}function TS(s){return nt("/api/projects/browse",{initialPath:s})}function Z2(s){return nt("/api/projects/open-folder",{path:s})}function Bv(){return bt("/api/projects")}function ek(s){return bt(`/api/projects/${s}`)}function MS(s){return nt("/api/projects",s)}function tk(s){return bt(`/api/projects/${s}/svn-detect`)}function AS(s,h){return Di(`/api/projects/${s}`,h)}function ik(s,h){const w=h?`?todoId=${encodeURIComponent(h)}`:"";return bt(`/api/projects/${s}/debug-logs${w}`)}function jS(s){return Cr(`/api/projects/${s}`)}function OS(s){return nt("/api/projects/reorder",{ids:s})}function sk(s){return nt(`/api/projects/${s}/start`)}function nk(s){return nt(`/api/projects/${s}/stop`)}function BS(s){return bt(`/api/projects/${s}/status`)}function rk(){return bt("/api/active-work")}function ok(s){return nt(`/api/projects/${s}/check-git`)}function ak(s,h){const w=h?`?worktreePath=${encodeURIComponent(h)}`:"";return bt(`/api/projects/${s}/git-status${w}`)}function lk(s,h=0,w=50,S){const M=new URLSearchParams({skip:String(h),limit:String(w)});return bt(`/api/projects/${s}/git-log?${M}`)}function ck(s,h){return bt(`/api/projects/${s}/git-refs`)}function uk(s,h,w){return nt(`/api/projects/${s}/git-stage`,{files:h,worktreePath:w})}function hk(s,h,w){return nt(`/api/projects/${s}/git-unstage`,{files:h,worktreePath:w})}function dk(s,h,w){return nt(`/api/projects/${s}/git-ignore`,{path:h,worktreePath:w})}function fk(s,h,w){return nt(`/api/projects/${s}/git-commit`,{message:h,worktreePath:w})}function pk(s,h,w){return nt(`/api/projects/${s}/git-pull`,{remote:h,branch:w})}function mk(s,h){return nt(`/api/projects/${s}/git-push`,h||{})}function gk(s){return bt(`/api/projects/${s}/git-remotes`)}function vk(s,h,w){return nt(`/api/projects/${s}/git-fetch`,{remote:h,prune:w})}function _k(s,h,w){return nt(`/api/projects/${s}/git-branch`,{name:h,startPoint:w})}function bk(s,h,w){return nt(`/api/projects/${s}/git-branch-delete`,{name:h,force:w})}function yk(s,h){return nt(`/api/projects/${s}/git-checkout`,{branch:h})}function wk(s,h){return nt(`/api/projects/${s}/git-merge`,{branch:h})}function Sk(s,h,w,S){return nt(`/api/projects/${s}/git-conflict-resolve`,{file:h,side:w,worktreePath:S})}function xk(s,h,w){const S=w?`&worktreePath=${encodeURIComponent(w)}`:"";return bt(`/api/projects/${s}/git-conflict-file?file=${encodeURIComponent(h)}${S}`)}function Ck(s,h,w,S){return nt(`/api/projects/${s}/git-conflict-file`,{file:h,content:w,worktreePath:S})}function kk(s){return nt(`/api/projects/${s}/git-conflict-continue`)}function Ek(s){return nt(`/api/projects/${s}/git-conflict-abort`)}function Lk(s,h){return nt(`/api/projects/${s}/git-stash`,{message:h})}function Rk(s,h){return nt(`/api/projects/${s}/git-stash-pop`,{index:h})}function Dk(s){return bt(`/api/projects/${s}/git-stash-list`)}function Tk(s,h,w,S){return nt(`/api/projects/${s}/git-discard`,{files:h,all:w,worktreePath:S})}function Mk(s,h,w,S){return nt(`/api/projects/${s}/git-tag`,{name:h,message:w,commit:S})}function Ak(s,h,w){return nt(`/api/projects/${s}/git-branch-rename`,{oldName:h,newName:w})}function jk(s,h){return nt(`/api/projects/${s}/git-rebase`,{onto:h})}function Ok(s,h){return nt(`/api/projects/${s}/git-revert`,{commit:h})}function Bk(s,h){return nt(`/api/projects/${s}/git-cherry-pick`,{commit:h})}function Nk(s,h,w){return nt(`/api/projects/${s}/git-reset`,{commit:h,mode:w})}function zk(s,h,w,S){const M=new URLSearchParams;return h&&M.set("file",h),w&&M.set("staged","true"),S&&M.set("worktreePath",S),bt(`/api/projects/${s}/git-diff?${M}`)}function Hk(s,h){const w=new URLSearchParams({hash:h});return bt(`/api/projects/${s}/git-commit-files?${w}`)}function Pk(s,h,w){const S=new URLSearchParams({hash:h});return w&&S.set("file",w),bt(`/api/projects/${s}/git-commit-diff?${S}`)}function Ik(s){return bt(`/api/projects/${s}/worktrees`)}function Fk(s,h,w){return nt(`/api/projects/${s}/worktree-cleanup`,{worktreePath:h,branchName:w})}function Nv(s){const h=new URLSearchParams;s.hours!==void 0&&h.set("hours",String(s.hours)),s.statuses&&s.statuses.length>0&&h.set("statuses",s.statuses.join(","));const w=h.toString();return w?`?${w}`:""}function Uk(s={}){return bt(`/api/review/queue${Nv(s)}`)}function NS(s={}){return bt(`/api/review/summary${Nv(s)}`)}function $k(s){return bt(`/api/review/diff/${encodeURIComponent(s)}`)}function Wk(s,h){return bt(`/api/review/diff/${encodeURIComponent(s)}/file?path=${encodeURIComponent(h)}`)}function zS(){return bt("/api/favorites")}function HS(s){return nt("/api/favorites",s)}function PS(s,h){return Di(`/api/favorites/${s}`,h)}function IS(s){return Cr(`/api/favorites/${s}`)}function FS(s){return nt(`/api/favorites/${s}/launch`)}function US(s){return nt("/api/favorites/browse-file",{initialPath:s})}function uh(){return bt("/api/tunnel/status")}function $S(){return bt("/api/tunnel/config")}function WS(s){return Di("/api/tunnel/config",s)}function zv(s){return nt("/api/tunnel/start",{})}function qS(){return nt("/api/tunnel/stop")}const Hv=j.createContext({theme:"light",toggleTheme:()=>{}});function GS(){const[s,h]=j.useState(()=>{const S=localStorage.getItem("theme");return S==="light"||S==="dark"?S:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"});j.useEffect(()=>{document.documentElement.setAttribute("data-theme",s),localStorage.setItem("theme",s)},[s]);const w=j.useCallback(()=>{h(S=>S==="light"?"dark":"light")},[]);return{theme:s,toggleTheme:w}}function YS(){return j.useContext(Hv)}const Pv=j.createContext({enabled:!1,supported:!1,toggleNotification:()=>{},sendNotification:()=>{}});function KS(){const s="Notification"in window,[h,w]=j.useState(()=>s?localStorage.getItem("clitrigger-notifications")==="on"&&Notification.permission==="granted":!1),S=j.useRef(h);j.useEffect(()=>{S.current=h},[h]);const M=j.useCallback(async()=>{if(s)if(S.current)localStorage.setItem("clitrigger-notifications","off"),w(!1);else{if(Notification.permission==="denied"||Notification.permission==="default"&&await Notification.requestPermission()!=="granted")return;localStorage.setItem("clitrigger-notifications","on"),w(!0)}},[s]),O=j.useCallback((A,r,u)=>{if(!S.current)return;const d=new Notification(A,{body:r});d.onclick=()=>{u==null||u();const g=window.electronAPI;g!=null&&g.windowFocus?g.windowFocus():window.focus(),d.close()}},[]);return{enabled:h,supported:s,toggleNotification:M,sendNotification:O}}function Ll(){return j.useContext(Pv)}let XS=0;const Iv=j.createContext(null);function VS({children:s}){const[h,w]=j.useState([]),S=j.useRef(new Map),M=j.useRef(new Map),O=j.useRef(new Map),A=j.useCallback(b=>{w(o=>o.filter(c=>c.id!==b));const C=O.current.get(b);C&&M.current.get(C)===b&&M.current.delete(C),O.current.delete(b);const p=S.current.get(b);p&&(clearTimeout(p),S.current.delete(b))},[]),r=j.useCallback((b,C="info",p=3500)=>{const o=`${C}:${b}`,c=M.current.get(o);if(c)return c;const a=`toast-${++XS}`;M.current.set(o,a),O.current.set(a,o),w(y=>[...y,{id:a,message:b,type:C,duration:p}]);const f=setTimeout(()=>A(a),p);return S.current.set(a,f),a},[A]),u=j.useCallback((b,C)=>r(b,"success",C),[r]),d=j.useCallback((b,C)=>r(b,"error",C),[r]),g=j.useCallback((b,C)=>r(b,"info",C),[r]),l=j.useCallback((b,C)=>r(b,"warning",C),[r]);j.useEffect(()=>()=>{S.current.forEach(clearTimeout),S.current.clear(),M.current.clear(),O.current.clear()},[]);const m=j.useMemo(()=>({toasts:h,show:r,success:u,error:d,info:g,warning:l,dismiss:A}),[h,r,u,d,g,l,A]);return j.createElement(Iv.Provider,{value:m},s)}function un(){const s=j.useContext(Iv);if(!s)throw new Error("useToast must be used within ToastProvider");return s}function Tn(...s){return s.filter(Boolean).join(" ")}const JS={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl","4xl":"max-w-4xl"};function Ho({open:s,onClose:h,size:w="md",position:S="center",disableEscClose:M=!1,disableBackdropClose:O=!1,children:A}){const r=j.useRef(null);return j.useEffect(()=>{if(!s||M)return;const u=d=>{d.key==="Escape"&&h()};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[s,M,h]),s?zi.createPortal(v.jsx("div",{ref:r,className:Tn("fixed inset-0 bg-black/50 backdrop-blur-sm z-modal flex",S==="center"?"items-center justify-center p-4":"items-start justify-center px-4 pt-[20vh]"),onClick:u=>{!O&&u.target===r.current&&h()},children:v.jsx("div",{className:Tn("w-full",JS[w]),children:A})}),document.body):null}const QS={default:"btn",primary:"btn-primary",secondary:"btn-secondary",danger:"btn-danger",ghost:"btn-ghost"},ZS={sm:"btn-sm",md:"btn-md",lg:"btn-lg"},Li=j.forwardRef(function({variant:h="default",size:w,type:S="button",className:M,...O},A){return v.jsx("button",{ref:A,type:S,className:Tn(QS[h],w&&ZS[w],M),...O})}),Fv=j.createContext(null);let dg=0;function ex({children:s}){const[h,w]=j.useState(null),S=j.useRef(null),M=j.useCallback(d=>{const g=S.current;g&&(g.kind==="confirm"?g.resolve(!1):g.resolve(null)),S.current=d,w(d)},[]),O=j.useCallback(()=>{S.current=null,w(null)},[]),A=j.useCallback(d=>{const g=typeof d=="string"?{message:d}:d;return new Promise(l=>{M({id:++dg,kind:"confirm",options:g,resolve:l})})},[M]),r=j.useCallback(d=>{const g=typeof d=="string"?{message:d}:d;return new Promise(l=>{M({id:++dg,kind:"prompt",options:g,resolve:l})})},[M]),u=j.useMemo(()=>({confirm:A,prompt:r}),[A,r]);return v.jsxs(Fv.Provider,{value:u,children:[s,h&&v.jsx(tx,{dialog:h,onSettled:O},h.id)]})}function tx({dialog:s,onSettled:h}){const{t:w}=Tt(),[S,M]=j.useState(s.kind==="prompt"?s.options.initialValue??"":""),O=()=>{s.kind==="confirm"?s.resolve(!1):s.resolve(null),h()},A=()=>{s.kind==="confirm"?s.resolve(!0):s.resolve(S),h()},r=s.kind==="confirm"&&!!s.options.danger,u=s.kind==="confirm"&&s.options.confirmLabel||w("common.ok"),d=s.kind==="confirm"&&s.options.cancelLabel||w("common.cancel"),g=v.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[v.jsx(Li,{size:"sm",onClick:O,autoFocus:r,children:d}),v.jsx(Li,{variant:r?"danger":"primary",size:"sm",type:s.kind==="prompt"?"submit":"button",onClick:s.kind==="prompt"?void 0:A,autoFocus:s.kind==="confirm"&&!r,children:u})]});return v.jsx(Ho,{open:!0,onClose:O,size:"sm",children:v.jsxs("div",{className:"bg-theme-card border border-theme-border rounded-2xl shadow-elevated p-5",children:[s.options.title&&v.jsx("div",{className:"text-sm font-semibold text-theme-text mb-2",children:s.options.title}),v.jsx("p",{className:"text-sm text-theme-text-secondary whitespace-pre-line break-words",children:s.options.message}),s.kind==="prompt"?v.jsxs("form",{onSubmit:l=>{l.preventDefault(),A()},children:[v.jsx("input",{autoFocus:!0,value:S,onChange:l=>M(l.target.value),placeholder:s.options.placeholder,className:"input-field mt-3"}),g]}):g]})})}function kr(){const s=j.useContext(Fv);if(!s)throw new Error("useDialog must be used within DialogProvider");return s}function ix({onSubmit:s,onCancel:h}){const[w,S]=j.useState(""),[M,O]=j.useState(""),[A,r]=j.useState(!1),[u,d]=j.useState(!1),[g,l]=j.useState(""),{t:m}=Tt(),b=async p=>{if(p.preventDefault(),!(!w.trim()||!M.trim())){l(""),d(!0);try{await s(w.trim(),M.trim())}catch(o){const c=o instanceof Error?o.message:String(o);l(c||m("form.createError"))}finally{d(!1)}}},C=async()=>{r(!0);try{const p=await TS(M||void 0);p.path&&O(p.path)}catch{}r(!1)};return v.jsx(Ho,{open:!0,onClose:h,size:"md",children:v.jsxs("div",{className:"bg-theme-card border border-theme-border rounded-2xl shadow-elevated p-8",children:[v.jsx("h2",{className:"text-lg font-semibold text-warm-800 mb-6",children:m("form.newProject")}),v.jsxs("form",{onSubmit:b,children:[v.jsxs("div",{className:"mb-5",children:[v.jsx("label",{className:"block text-sm font-medium text-warm-600 mb-2",children:m("form.projectName")}),v.jsx("input",{type:"text",placeholder:"my-project",value:w,onChange:p=>S(p.target.value),className:"input-field",autoFocus:!0})]}),v.jsxs("div",{className:"mb-8",children:[v.jsx("label",{className:"block text-sm font-medium text-warm-600 mb-2",children:m("form.folderPath")}),v.jsxs("div",{className:"flex gap-2",children:[v.jsx("input",{type:"text",placeholder:"C:/Projects/my-project",value:M,onChange:p=>O(p.target.value),className:"input-field text-sm flex-1"}),v.jsx("button",{type:"button",onClick:C,disabled:A,className:"btn-ghost text-sm px-3 shrink-0",title:m("browse.title"),children:A?v.jsx(lh,{size:16,className:"animate-spin"}):v.jsx(Dv,{size:16})})]})]}),g&&v.jsx("p",{className:"text-sm mb-4",style:{color:"var(--color-danger, #ef4444)"},children:g}),v.jsxs("div",{className:"flex justify-end gap-3",children:[v.jsx("button",{type:"button",onClick:h,className:"btn-ghost text-sm",children:m("form.cancel")}),v.jsx("button",{type:"submit",disabled:!w.trim()||!M.trim()||u,className:"btn-primary text-sm",children:m(u?"form.creating":"form.create")})]})]})]})})}const sx=[{value:"executable",icon:Rv},{value:"command",icon:Ov},{value:"url",icon:Mv}];function nx(s){const h=[],w=/"([^"]*)"|(\S+)/g;let S;for(;(S=w.exec(s))!==null;)h.push(S[1]!==void 0?S[1]:S[2]);return h}function fg(s){if(!s)return"";try{const h=JSON.parse(s);if(Array.isArray(h))return h.map(w=>typeof w=="string"&&/\s/.test(w)?`"${w}"`:String(w)).join(" ")}catch{}return""}function rx({initial:s,onSubmit:h,onCancel:w}){const{t:S}=Tt(),[M,O]=j.useState((s==null?void 0:s.name)??""),[A,r]=j.useState((s==null?void 0:s.type)??"executable"),[u,d]=j.useState((s==null?void 0:s.target)??""),[g,l]=j.useState(fg((s==null?void 0:s.args)??null)),[m,b]=j.useState((s==null?void 0:s.cwd)??""),[C,p]=j.useState(!1);j.useEffect(()=>{O((s==null?void 0:s.name)??""),r((s==null?void 0:s.type)??"executable"),d((s==null?void 0:s.target)??""),l(fg((s==null?void 0:s.args)??null)),b((s==null?void 0:s.cwd)??"")},[s]);const[o,c]=j.useState(!1),a=A==="executable",f=async()=>{c(!0);try{const{path:H}=await US(u||void 0);if(!H)return;if(d(H),!M.trim()){const P=H.replace(/\\/g,"/").split("/").pop()||"";O(P.replace(/\.[^.]+$/,""))}}catch{}finally{c(!1)}},y=!!s,R=M.trim(),k=u.trim(),D=A!=="url"||/^https?:\/\//i.test(k),E=!!R&&!!k&&D&&!C,L=async H=>{if(H.preventDefault(),!!E){p(!0);try{const P={name:R,type:A,target:k,args:A==="executable"&&g.trim()?nx(g.trim()):null,cwd:A!=="url"&&m.trim()?m.trim():null};await h(P)}finally{p(!1)}}},z=S(A==="executable"?"favorites.form.targetHint.executable":A==="command"?"favorites.form.targetHint.command":"favorites.form.targetHint.url");return v.jsx(Ho,{open:!0,onClose:w,size:"md",children:v.jsxs("div",{className:"bg-theme-card border border-theme-border rounded-2xl shadow-elevated p-8",children:[v.jsx("h2",{className:"text-lg font-semibold text-warm-800 mb-6",children:S(y?"favorites.form.title.edit":"favorites.form.title.create")}),v.jsxs("form",{onSubmit:L,children:[v.jsxs("div",{className:"mb-5",children:[v.jsx("label",{className:"block text-sm font-medium text-warm-600 mb-2",children:S("favorites.form.type")}),v.jsx("div",{className:"grid grid-cols-3 gap-2",children:sx.map(({value:H,icon:P})=>v.jsxs("button",{type:"button",onClick:()=>r(H),className:"flex items-center justify-center gap-2 px-3 py-2 rounded-lg text-xs font-medium transition-all border",style:A===H?{backgroundColor:"var(--color-accent)",color:"white",borderColor:"var(--color-accent)"}:{color:"var(--color-text-tertiary)",borderColor:"var(--color-border)"},children:[v.jsx(P,{size:14}),S(`favorites.types.${H}`)]},H))})]}),v.jsxs("div",{className:"mb-5",children:[v.jsx("label",{className:"block text-sm font-medium text-warm-600 mb-2",children:S("favorites.form.name")}),v.jsx("input",{type:"text",value:M,onChange:H=>O(H.target.value),className:"input-field",autoFocus:!0})]}),v.jsxs("div",{className:"mb-5",children:[v.jsx("label",{className:"block text-sm font-medium text-warm-600 mb-2",children:S("favorites.form.target")}),v.jsxs("div",{className:"flex gap-2",children:[v.jsx("input",{type:"text",value:u,onChange:H=>d(H.target.value),className:"input-field text-sm font-mono flex-1",placeholder:z}),a&&v.jsxs("button",{type:"button",onClick:f,disabled:o,className:"btn-ghost text-sm whitespace-nowrap flex items-center gap-1.5 disabled:opacity-50",children:[v.jsx(Dv,{size:14}),S("favorites.form.browse")]})]}),v.jsx("p",{className:"mt-1 text-2xs",style:{color:"var(--color-text-muted)"},children:z})]}),A==="executable"&&v.jsxs("div",{className:"mb-5",children:[v.jsx("label",{className:"block text-sm font-medium text-warm-600 mb-2",children:S("favorites.form.args")}),v.jsx("input",{type:"text",value:g,onChange:H=>l(H.target.value),className:"input-field text-sm font-mono",placeholder:'--flag value "with spaces"'})]}),A!=="url"&&v.jsxs("div",{className:"mb-5",children:[v.jsx("label",{className:"block text-sm font-medium text-warm-600 mb-2",children:S("favorites.form.cwd")}),v.jsx("input",{type:"text",value:m,onChange:H=>b(H.target.value),className:"input-field text-sm font-mono",placeholder:"C:/Projects/my-project"})]}),v.jsx("p",{className:"mb-6 text-2xs leading-snug",style:{color:"var(--color-text-muted)"},children:S("favorites.security.notice")}),v.jsxs("div",{className:"flex justify-end gap-3",children:[v.jsx("button",{type:"button",onClick:w,className:"btn-ghost text-sm",children:S("favorites.form.cancel")}),v.jsx("button",{type:"submit",disabled:!E,className:"btn-primary text-sm",children:S(y?"favorites.form.save":"favorites.form.create")})]})]})]})})}const ox=/^([a-z0-9]([a-z0-9-]*[a-z0-9])?\.)+[a-z]{2,}$/i;function ax({onClose:s}){const{t:h}=Tt(),{error:w,success:S}=un(),[M,O]=j.useState(""),[A,r]=j.useState(""),[u,d]=j.useState(""),[g,l]=j.useState(""),[m,b]=j.useState(!1),[C,p]=j.useState(!1),[o,c]=j.useState(!1),[a,f]=j.useState(null);j.useEffect(()=>{let P=!1;return Promise.all([$S(),uh()]).then(([I,K])=>{P||(O(I.tunnelName),r(I.customHostname),d(I.tunnelName),l(I.customHostname),f(K))}).catch(()=>{}),()=>{P=!0}},[]);const y=M.trim(),R=A.trim(),k=y!==u.trim()||R!==g.trim(),D=!!R&&(!ox.test(R)||R.toLowerCase()==="localhost"||R.toLowerCase()==="127.0.0.1"),E=!!R&&!y,L=k&&!C&&!D&&!E,z=async()=>{if(L){p(!0);try{const P=await WS({tunnelName:y,customHostname:R});d(P.tunnelName),l(P.customHostname),O(P.tunnelName),r(P.customHostname),S(h("tunnel.saved"))}catch(P){w(P instanceof Error?P.message:h("tunnel.saveFailed"))}finally{p(!1)}}},H=async()=>{c(!0);try{try{await qS()}catch{}const P=await zv();f({status:"running",url:P.url}),S(h("tunnel.restarted"))}catch(P){w(P instanceof Error?P.message:h("tunnel.restartFailed"))}finally{c(!1)}};return v.jsxs("div",{className:"p-8",children:[v.jsx("h2",{className:"text-lg font-semibold text-warm-800 mb-1",children:h("tunnel.title")}),v.jsx("p",{className:"text-xs text-warm-400 mb-6",children:h("tunnel.description")}),a&&v.jsxs("div",{className:"mb-5 p-3 rounded-lg text-xs flex items-center gap-2",style:{backgroundColor:"var(--color-bg-hover)",color:"var(--color-text-tertiary)"},children:[v.jsx("span",{className:`w-2 h-2 rounded-full ${a.status==="running"?"bg-status-success":a.status==="error"?"bg-status-error":"bg-status-pending"}`}),v.jsx("span",{className:"font-medium",children:h(`tunnel.status.${a.status}`)}),a.url&&v.jsx("a",{href:a.url,target:"_blank",rel:"noreferrer",className:"ml-auto font-mono truncate hover:underline",style:{color:"var(--color-accent)"},children:a.url})]}),v.jsxs("div",{className:"mb-4",children:[v.jsx("label",{className:"block text-sm font-medium text-warm-600 mb-2",children:h("tunnel.name.label")}),v.jsx("input",{type:"text",value:M,onChange:P=>O(P.target.value),placeholder:h("tunnel.name.placeholder"),className:"input-field text-sm font-mono"}),v.jsx("p",{className:"mt-1 text-2xs",style:{color:"var(--color-text-muted)"},children:h("tunnel.name.hint")})]}),v.jsxs("div",{className:"mb-4",children:[v.jsx("label",{className:"block text-sm font-medium text-warm-600 mb-2",children:h("tunnel.hostname.label")}),v.jsx("input",{type:"text",value:A,onChange:P=>r(P.target.value),placeholder:h("tunnel.hostname.placeholder"),className:"input-field text-sm font-mono"}),v.jsx("p",{className:"mt-1 text-2xs",style:{color:"var(--color-text-muted)"},children:h("tunnel.hostname.hint")}),D&&v.jsx("p",{className:"mt-1 text-2xs text-status-error",children:h("tunnel.hostname.invalid")}),E&&v.jsx("p",{className:"mt-1 text-2xs text-status-error",children:h("tunnel.hostname.needsName")})]}),v.jsxs("div",{className:"mb-5",children:[v.jsxs("button",{type:"button",onClick:()=>b(!m),className:"flex items-center gap-1 text-xs text-accent-dark hover:text-accent transition-colors",children:[v.jsx("span",{className:`inline-block transition-transform ${m?"rotate-90":""}`,children:"▶"}),h("tunnel.guide.toggle")]}),m&&v.jsxs("div",{className:"mt-3 p-3 bg-warm-50 border border-warm-150 rounded-lg text-xs text-warm-600 space-y-2",children:[v.jsx("p",{className:"font-semibold text-warm-700 mb-1",children:h("tunnel.guide.heading")}),v.jsxs("ol",{className:"list-decimal list-inside space-y-1 ml-1",children:[v.jsx("li",{children:v.jsx("code",{className:"font-mono",children:"cloudflared tunnel login"})}),v.jsx("li",{children:v.jsx("code",{className:"font-mono",children:"cloudflared tunnel create my-app"})}),v.jsx("li",{children:v.jsx("code",{className:"font-mono",children:"cloudflared tunnel route dns my-app app.your-domain.com"})}),v.jsx("li",{children:h("tunnel.guide.step4")})]}),v.jsx("p",{className:"text-2xs text-warm-400 pt-1",children:h("tunnel.guide.note")})]})]}),v.jsxs("div",{className:"flex items-center justify-between gap-3",children:[v.jsx("button",{type:"button",onClick:H,disabled:o,className:"btn-ghost text-sm disabled:opacity-50",children:o?(a==null?void 0:a.status)==="running"?h("tunnel.restarting"):h("tunnel.starting"):(a==null?void 0:a.status)==="running"?h("tunnel.restart"):h("tunnel.start")}),v.jsxs("div",{className:"flex gap-3",children:[s&&v.jsx("button",{type:"button",onClick:s,className:"btn-ghost text-sm",children:h("tunnel.close")}),v.jsx("button",{type:"button",onClick:z,disabled:!L,className:"btn-primary text-sm",children:h(C?"tunnel.saving":"tunnel.save")})]})]})]})}const pg=8;function lx({onClose:s}){const{t:h}=Tt(),{error:w,success:S}=un(),[M,O]=j.useState(""),[A,r]=j.useState(""),[u,d]=j.useState(""),[g,l]=j.useState(!1),m=A.length>0&&A.length<pg,b=u.length>0&&A!==u,C=!!M&&A.length>=pg&&A===u&&!g,p=()=>{O(""),r(""),d("")},o=async()=>{if(C){l(!0);try{await wv(M,A,u),S(h("account.saved")),p()}catch(c){w(c instanceof Error&&c.message?c.message:h("account.saveFailed"))}finally{l(!1)}}};return v.jsxs("div",{className:"p-8",children:[v.jsx("h2",{className:"text-lg font-semibold text-warm-800 mb-1",children:h("account.title")}),v.jsx("p",{className:"text-xs text-warm-400 mb-6",children:h("account.description")}),v.jsxs("div",{className:"mb-4",children:[v.jsx("label",{className:"block text-sm font-medium text-warm-600 mb-2",children:h("account.oldPassword")}),v.jsx("input",{type:"password",value:M,onChange:c=>O(c.target.value),className:"input-field text-sm",autoComplete:"current-password"})]}),v.jsxs("div",{className:"mb-4",children:[v.jsx("label",{className:"block text-sm font-medium text-warm-600 mb-2",children:h("account.newPassword")}),v.jsx("input",{type:"password",value:A,onChange:c=>r(c.target.value),className:"input-field text-sm",autoComplete:"new-password"}),m&&v.jsx("p",{className:"mt-1 text-2xs text-status-error",children:h("account.tooShort")})]}),v.jsxs("div",{className:"mb-6",children:[v.jsx("label",{className:"block text-sm font-medium text-warm-600 mb-2",children:h("account.confirm")}),v.jsx("input",{type:"password",value:u,onChange:c=>d(c.target.value),className:"input-field text-sm",autoComplete:"new-password"}),b&&v.jsx("p",{className:"mt-1 text-2xs text-status-error",children:h("account.mismatch")})]}),v.jsxs("div",{className:"flex items-center justify-end gap-3",children:[s&&v.jsx("button",{type:"button",onClick:s,className:"btn-ghost text-sm",children:h("account.close")}),v.jsx("button",{type:"button",onClick:o,disabled:!C,className:"btn-primary text-sm",children:h(g?"account.saving":"account.save")})]})]})}function cx(){return bt("/api/session-tags")}function ux(s){return nt("/api/session-tags",s)}function hx(s,h){return Di(`/api/session-tags/${s}`,h)}function dx(s){return Cr(`/api/session-tags/${s}`)}function Uv(){return bt("/api/session-aliases")}function $v(s){return nt("/api/session-aliases",s)}function fx(s,h){return Di(`/api/session-aliases/${s}`,h)}function px(s){return Cr(`/api/session-aliases/${s}`)}function Wv(){return bt("/api/session-settings")}function Yu(s){return Di("/api/session-settings",s)}const Ce={titleBg:"#2d2d2d",titleText:"#999",bg:"#0c0c0c",text:"#cccccc",dim:"#666666",bright:"#f2f2f2",prompt:"#16c60c",success:"#16c60c",error:"#f14c4c",warning:"#cca700",info:"#569cd6",separator:"#333333"},_t="'Cascadia Code', 'Cascadia Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Courier New', monospace",jh=13,wo=8,So=28,br=new Map,Rn=new Map;let ml=jh;function Oh(s){return`sessionFontSize:${s}`}window.addEventListener("storage",s=>{var S;if(s.storageArea!==localStorage||!((S=s.key)!=null&&S.startsWith("sessionFontSize:")))return;const h=s.key.slice(16);br.delete(h);const w=Rn.get(h);if(w){const M=xo(h);w.forEach(O=>O(M))}});function hh(s){return Number.isFinite(s)?Math.max(wo,Math.min(So,Math.round(s))):ml}function mx(s){if(br.has(s))return!0;try{return localStorage.getItem(Oh(s))!==null}catch{return!1}}function xo(s){const h=br.get(s);if(h!==void 0)return h;let w=null;try{const S=localStorage.getItem(Oh(s));if(S!==null){const M=parseInt(S,10);Number.isFinite(M)&&(w=hh(M))}}catch{}return w===null?hh(ml):(br.set(s,w),w)}function dh(s,h){const w=hh(h);if(br.get(s)===w)return;br.set(s,w);try{localStorage.setItem(Oh(s),String(w))}catch{}const S=Rn.get(s);S&&S.forEach(M=>M(w))}function bo(s,h){dh(s,xo(s)+h)}function hl(s){const h=Math.max(wo,Math.min(So,Math.round(s)));Number.isFinite(h)&&h!==ml&&(ml=h,Rn.forEach((w,S)=>{mx(S)||w.forEach(M=>M(h))}))}function qv(s){const[h,w]=j.useState(()=>xo(s));j.useEffect(()=>{w(xo(s));let O=Rn.get(s);return O||(O=new Set,Rn.set(s,O)),O.add(w),()=>{const A=Rn.get(s);A&&(A.delete(w),A.size===0&&Rn.delete(s))}},[s]);const S=j.useCallback(O=>dh(s,O),[s]),M=j.useCallback(O=>dh(s,xo(s)+O),[s]);return[h,S,M]}const Co=["#A78BFA","#F472B6","#FB923C","#FBBF24","#34D399","#60A5FA","#F87171","#94A3B8"];function mg(s){for(const h of Co)if(!s.some(w=>w.color.toLowerCase()===h.toLowerCase()))return h;return Co[s.length%Co.length]}function gx({onClose:s}){const{t:h}=Tt(),{confirm:w}=kr(),{error:S,success:M}=un(),[O,A]=j.useState([]),[r,u]=j.useState(!1),[d,g]=j.useState(jh),[l,m]=j.useState(!1),[b,C]=j.useState(!1),[p,o]=j.useState(!1),[c,a]=j.useState(!1),f=j.useRef(null),[y,R]=j.useState(""),[k,D]=j.useState(Co[0]),[E,L]=j.useState(!1),[z,H]=j.useState(null),[P,I]=j.useState(""),[K,X]=j.useState(Co[0]),[Y,$]=j.useState(!1),[U,T]=j.useState([]),[F,B]=j.useState(""),[W,Z]=j.useState(""),[ne,ge]=j.useState(!1),[xe,J]=j.useState(null),[G,de]=j.useState(""),[oe,Ae]=j.useState(""),[Oe,Xe]=j.useState(!1);j.useEffect(()=>{let ee=!1;return Promise.all([cx(),Wv(),Uv()]).then(([be,he,He])=>{ee||(A(be),u(he.defaultUseWorktree),g(he.defaultFontSize),hl(he.defaultFontSize),m(he.imeDebug),D(mg(be)),T(He),C(!0))}).catch(be=>{ee||S(be instanceof Error?be.message:"Failed to load")}),()=>{ee=!0}},[S]);const We=y.trim(),rt=!!We&&!E,ye=j.useMemo(()=>[...O].sort((ee,be)=>ee.sort_order-be.sort_order||ee.name.localeCompare(be.name)),[O]);j.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]);const Te=ee=>{if(!Number.isFinite(ee))return;const be=Math.max(wo,Math.min(So,Math.round(ee)));g(be),hl(be),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{Yu({defaultFontSize:be}).then(he=>{g(he.defaultFontSize),hl(he.defaultFontSize)}).catch(he=>S(he instanceof Error?he.message:"Save failed"))},350)},ct=async ee=>{o(!0);try{const be=await Yu({defaultUseWorktree:ee});u(be.defaultUseWorktree),M(h("sessionSettings.saved"))}catch(be){S(be instanceof Error?be.message:"Save failed")}finally{o(!1)}},it=async ee=>{var be,he;a(!0);try{const He=await Yu({imeDebug:ee});m(He.imeDebug),(he=(be=window.electronAPI)==null?void 0:be.imeSetDebug)==null||he.call(be,He.imeDebug),M(h("sessionSettings.saved"))}catch(He){S(He instanceof Error?He.message:"Save failed")}finally{a(!1)}},ze=async()=>{if(rt){L(!0);try{const ee=await ux({name:We,color:k});A(be=>[...be,ee]),R(""),D(mg([...O,ee]))}catch(ee){S(ee instanceof Error?ee.message:"Create failed")}finally{L(!1)}}},qe=ee=>{H(ee.id),I(ee.name),X(ee.color)},Fe=()=>{H(null),I("")},Be=async()=>{if(!z)return;const ee=P.trim();if(ee){$(!0);try{const be=await hx(z,{name:ee,color:K});A(he=>he.map(He=>He.id===be.id?be:He)),Fe()}catch(be){S(be instanceof Error?be.message:"Save failed")}finally{$(!1)}}},$e=async ee=>{if(await w({message:h("sessionSettings.tags.deleteConfirm").replace("{name}",ee.name),danger:!0}))try{await dx(ee.id),A(be=>be.filter(he=>he.id!==ee.id))}catch(be){S(be instanceof Error?be.message:"Delete failed")}},lt=F.trim(),st=W.trim(),St=!!lt&&!!st&&!ne,Se=j.useMemo(()=>[...U].sort((ee,be)=>ee.sort_order-be.sort_order||ee.name.localeCompare(be.name)),[U]),Ie=async()=>{if(St){ge(!0);try{const ee=await $v({name:lt,command_template:st});T(be=>[...be,ee]),B(""),Z("")}catch(ee){S(ee instanceof Error?ee.message:"Create failed")}finally{ge(!1)}}},le=ee=>{J(ee.id),de(ee.name),Ae(ee.command_template)},Ne=()=>{J(null),de(""),Ae("")},je=async()=>{if(!xe)return;const ee=G.trim(),be=oe.trim();if(!(!ee||!be)){Xe(!0);try{const he=await fx(xe,{name:ee,command_template:be});T(He=>He.map(Me=>Me.id===he.id?he:Me)),Ne()}catch(he){S(he instanceof Error?he.message:"Save failed")}finally{Xe(!1)}}},ue=async ee=>{if(await w({message:h("sessionSettings.aliases.deleteConfirm").replace("{name}",ee.name),danger:!0}))try{await px(ee.id),T(be=>be.filter(he=>he.id!==ee.id))}catch(be){S(be instanceof Error?be.message:"Delete failed")}};return v.jsxs("div",{className:"p-8",children:[v.jsx("h2",{className:"text-lg font-semibold text-warm-800 mb-1",children:h("sessionSettings.title")}),v.jsx("p",{className:"text-xs text-warm-400 mb-6",children:h("sessionSettings.description")}),v.jsxs("section",{className:"mb-7",children:[v.jsxs("h3",{className:"text-sm font-semibold text-warm-700 mb-2 flex items-center gap-1.5",children:[v.jsx(x1,{size:14}),h("sessionSettings.worktree.title")]}),v.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[v.jsx("input",{type:"checkbox",checked:r,disabled:p||!b,onChange:ee=>ct(ee.target.checked),className:"rounded-md border-warm-300"}),v.jsx("span",{className:"text-sm text-warm-600",children:h("sessionSettings.worktree.label")})]}),v.jsx("p",{className:"mt-1 text-2xs ml-6",style:{color:"var(--color-text-muted)"},children:h("sessionSettings.worktree.hint")})]}),v.jsxs("section",{className:"mb-7",children:[v.jsxs("h3",{className:"text-sm font-semibold text-warm-700 mb-2 flex items-center gap-1.5",children:[v.jsx(SS,{size:14}),h("sessionSettings.fontSize.title")]}),v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("input",{type:"range",min:wo,max:So,step:1,value:d,disabled:!b,onChange:ee=>Te(parseInt(ee.target.value,10)),className:"flex-1 max-w-xs","aria-label":h("sessionSettings.fontSize.label")}),v.jsx("input",{type:"number",min:wo,max:So,step:1,value:d,disabled:!b,onChange:ee=>Te(parseInt(ee.target.value,10)),className:"input text-sm w-20"}),v.jsx("span",{className:"text-xs text-warm-400",children:"px"})]}),v.jsx("p",{className:"mt-1 text-2xs",style:{color:"var(--color-text-muted)"},children:h("sessionSettings.fontSize.hint")})]}),v.jsxs("section",{children:[v.jsx("h3",{className:"text-sm font-semibold text-warm-700 mb-2",children:h("sessionSettings.tags.title")}),v.jsx("p",{className:"text-xs text-warm-400 mb-3",children:h("sessionSettings.tags.description")}),v.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[v.jsx("input",{type:"color",value:k,onChange:ee=>D(ee.target.value),className:"w-9 h-9 rounded-md cursor-pointer border border-warm-200",title:h("sessionSettings.tags.color")}),v.jsx("input",{type:"text",value:y,onChange:ee=>R(ee.target.value),onKeyDown:ee=>{ee.key==="Enter"&&(ee.preventDefault(),ze())},placeholder:h("sessionSettings.tags.namePlaceholder"),className:"input text-sm flex-1",maxLength:32}),v.jsxs("button",{type:"button",onClick:ze,disabled:!rt,className:"btn-primary text-sm py-1.5 px-3 inline-flex items-center gap-1",children:[v.jsx(Mn,{size:14}),h("sessionSettings.tags.add")]})]}),ye.length===0?v.jsx("p",{className:"text-xs text-warm-400 italic py-3",children:h("sessionSettings.tags.empty")}):v.jsx("ul",{className:"space-y-1.5",children:ye.map(ee=>{const be=z===ee.id;return v.jsx("li",{className:"flex items-center gap-2 px-3 py-2 rounded-lg border",style:{borderColor:"var(--color-border)"},children:be?v.jsxs(v.Fragment,{children:[v.jsx("input",{type:"color",value:K,onChange:he=>X(he.target.value),className:"w-7 h-7 rounded-md cursor-pointer border border-warm-200"}),v.jsx("input",{type:"text",value:P,onChange:he=>I(he.target.value),onKeyDown:he=>{he.key==="Enter"&&(he.preventDefault(),Be()),he.key==="Escape"&&Fe()},autoFocus:!0,className:"input text-sm flex-1",maxLength:32}),v.jsx("button",{type:"button",onClick:Be,disabled:Y||!P.trim(),className:"p-1.5 text-status-success hover:bg-status-success/10 rounded-md",title:h("sessionSettings.tags.save"),children:v.jsx(Do,{size:14})}),v.jsx("button",{type:"button",onClick:Fe,className:"p-1.5 text-warm-400 hover:bg-warm-100 rounded-md",title:h("sessionSettings.tags.cancel"),children:v.jsx(Ri,{size:14})})]}):v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"w-4 h-4 rounded-full shrink-0 border",style:{backgroundColor:ee.color,borderColor:"rgba(0,0,0,0.08)"}}),v.jsx("span",{className:"text-sm text-warm-700 flex-1 truncate",children:ee.name}),v.jsx("button",{type:"button",onClick:()=>qe(ee),className:"p-1.5 text-warm-400 hover:text-warm-700 hover:bg-warm-100 rounded-md",title:h("sessionSettings.tags.edit"),children:v.jsx(ch,{size:14})}),v.jsx("button",{type:"button",onClick:()=>$e(ee),className:"p-1.5 text-warm-400 hover:text-status-error hover:bg-warm-100 rounded-md",title:h("sessionSettings.tags.delete"),children:v.jsx(cg,{size:14})})]})},ee.id)})})]}),v.jsxs("section",{className:"mt-7",children:[v.jsx("h3",{className:"text-sm font-semibold text-warm-700 mb-2",children:h("sessionSettings.aliases.title")}),v.jsx("p",{className:"text-xs text-warm-400 mb-3",children:h("sessionSettings.aliases.description")}),v.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[v.jsx("input",{type:"text",value:F,onChange:ee=>B(ee.target.value),placeholder:h("sessionSettings.aliases.namePlaceholder"),className:"input text-sm w-44",maxLength:64}),v.jsx("input",{type:"text",value:W,onChange:ee=>Z(ee.target.value),onKeyDown:ee=>{ee.key==="Enter"&&(ee.preventDefault(),Ie())},placeholder:h("sessionSettings.aliases.commandPlaceholder"),className:"input text-sm flex-1 font-mono",maxLength:1024}),v.jsxs("button",{type:"button",onClick:Ie,disabled:!St,className:"btn-primary text-sm py-1.5 px-3 inline-flex items-center gap-1",children:[v.jsx(Mn,{size:14}),h("sessionSettings.aliases.add")]})]}),Se.length===0?v.jsx("p",{className:"text-xs text-warm-400 italic py-3",children:h("sessionSettings.aliases.empty")}):v.jsx("ul",{className:"space-y-1.5",children:Se.map(ee=>{const be=xe===ee.id;return v.jsx("li",{className:"flex items-center gap-2 px-3 py-2 rounded-lg border",style:{borderColor:"var(--color-border)"},children:be?v.jsxs(v.Fragment,{children:[v.jsx("input",{type:"text",value:G,onChange:he=>de(he.target.value),className:"input text-sm w-44",maxLength:64}),v.jsx("input",{type:"text",value:oe,onChange:he=>Ae(he.target.value),onKeyDown:he=>{he.key==="Enter"&&(he.preventDefault(),je()),he.key==="Escape"&&Ne()},autoFocus:!0,className:"input text-sm flex-1 font-mono",maxLength:1024}),v.jsx("button",{type:"button",onClick:je,disabled:Oe||!G.trim()||!oe.trim(),className:"p-1.5 text-status-success hover:bg-status-success/10 rounded-md",title:h("common.save"),children:v.jsx(Do,{size:14})}),v.jsx("button",{type:"button",onClick:Ne,className:"p-1.5 text-warm-400 hover:bg-warm-100 rounded-md",title:h("common.cancel"),children:v.jsx(Ri,{size:14})})]}):v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"text-sm text-warm-700 w-44 truncate",children:ee.name}),v.jsx("code",{className:"text-xs text-warm-500 flex-1 truncate font-mono",children:ee.command_template}),v.jsx("button",{type:"button",onClick:()=>le(ee),className:"p-1.5 text-warm-400 hover:text-warm-700 hover:bg-warm-100 rounded-md",title:h("common.edit"),children:v.jsx(ch,{size:14})}),v.jsx("button",{type:"button",onClick:()=>ue(ee),className:"p-1.5 text-warm-400 hover:text-status-error hover:bg-warm-100 rounded-md",title:h("common.delete"),children:v.jsx(cg,{size:14})})]})},ee.id)})})]}),v.jsxs("section",{className:"mt-7",children:[v.jsxs("h3",{className:"text-sm font-semibold text-warm-700 mb-2 flex items-center gap-1.5",children:[v.jsx(Jw,{size:14}),"IME 디버그 로그"]}),v.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[v.jsx("input",{type:"checkbox",checked:l,disabled:c||!b,onChange:ee=>it(ee.target.checked),className:"rounded-md border-warm-300"}),v.jsx("span",{className:"text-sm text-warm-600",children:"한글 입력(IME) 진단 로그 기록"})]}),v.jsx("p",{className:"mt-1 text-2xs ml-6",style:{color:"var(--color-text-muted)"},children:"조합 창이 화면 좌상단에 뜨는 문제를 진단하기 위해 입력 시점 상태를 기록합니다. 데스크톱 앱에서만 동작하며, 로그는 앱 데이터 폴더의 ime-debug.log에 저장됩니다."})]}),s&&v.jsx("div",{className:"flex justify-end gap-3 mt-7",children:v.jsx("button",{type:"button",onClick:s,className:"btn-ghost text-sm",children:h("tunnel.close")})})]})}function vx(){return bt("/api/mcp/connection")}function _x({onClose:s}){const{t:h}=Tt(),{success:w,error:S}=un(),[M,O]=j.useState(null),[A,r]=j.useState(null);j.useEffect(()=>{let m=!1;return vx().then(b=>{m||O(b)}).catch(()=>{}),()=>{m=!0}},[]);const u=async(m,b)=>{try{await navigator.clipboard.writeText(b),r(m),setTimeout(()=>r(C=>C===m?null:C),1500),w(h("mcp.copied"))}catch{S(h("mcp.copyFailed"))}},d=M?JSON.stringify(M.config,null,2):"",g=({label:m,text:b})=>v.jsxs("button",{type:"button",onClick:()=>u(m,b),className:"btn-ghost text-xs flex items-center gap-1",children:[A===m?v.jsx(Do,{size:14}):v.jsx(_1,{size:14}),h("mcp.copy")]}),l={backgroundColor:"var(--color-bg-hover)",color:"var(--color-text-secondary)"};return v.jsxs("div",{className:"p-8",children:[v.jsx("h2",{className:"text-lg font-semibold text-warm-800 mb-1",children:h("mcp.title")}),v.jsx("p",{className:"text-xs text-warm-400 mb-6",children:h("mcp.description")}),M?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"mb-5",children:[v.jsxs("div",{className:"flex items-center justify-between mb-2",children:[v.jsx("label",{className:"block text-sm font-medium text-warm-600",children:h("mcp.config.label")}),v.jsx(g,{label:"config",text:d})]}),v.jsx("pre",{className:"p-3 rounded-lg text-2xs font-mono overflow-x-auto",style:l,children:d})]}),v.jsxs("div",{className:"mb-5",children:[v.jsx("label",{className:"block text-sm font-medium text-warm-600 mb-1",children:h("mcp.commands.label")}),v.jsx("p",{className:"text-2xs text-warm-400 mb-3",children:h("mcp.commands.hint")}),v.jsx("div",{className:"space-y-3",children:M.commands.map(m=>v.jsxs("div",{children:[v.jsxs("div",{className:"flex items-center justify-between mb-1",children:[v.jsx("span",{className:"text-xs text-warm-500",children:m.label}),v.jsx(g,{label:`command:${m.id}`,text:m.command})]}),v.jsx("pre",{className:"p-3 rounded-lg text-2xs font-mono overflow-x-auto",style:l,children:m.command})]},m.id))})]}),v.jsx("p",{className:"text-2xs text-warm-400",children:h("mcp.tokenNote")})]}):v.jsx("p",{className:"text-sm text-warm-400",children:h("mcp.loading")}),s&&v.jsx("div",{className:"flex justify-end mt-6",children:v.jsx("button",{type:"button",onClick:s,className:"btn-ghost text-sm",children:h("mcp.close")})})]})}function gg({open:s,onClose:h}){const{t:w}=Tt(),[S,M]=j.useState("account");if(!s)return null;const O=[{id:"account",label:w("settings.tabs.account"),icon:j1},{id:"session",label:w("settings.tabs.session"),icon:Ah},{id:"tunnel",label:w("settings.tabs.tunnel"),icon:Ev},{id:"mcp",label:w("settings.tabs.mcp"),icon:sS}];return v.jsx(Ho,{open:s,onClose:h,size:"xl",children:v.jsx("div",{className:"bg-theme-card border border-theme-border rounded-2xl shadow-elevated overflow-hidden",children:v.jsxs("div",{className:"flex",style:{minHeight:460},children:[v.jsxs("aside",{className:"w-44 shrink-0 border-r flex flex-col",style:{borderColor:"var(--color-border)",backgroundColor:"var(--color-bg-hover)"},children:[v.jsx("div",{className:"px-4 pt-5 pb-3 text-xs font-semibold uppercase tracking-wider",style:{color:"var(--color-text-muted)"},children:w("settings.title")}),v.jsx("nav",{className:"flex flex-col",children:O.map(({id:A,label:r,icon:u})=>{const d=S===A;return v.jsxs("button",{type:"button",onClick:()=>M(A),className:"flex items-center gap-2 px-4 py-2.5 text-sm transition-colors text-left",style:{color:d?"var(--color-accent)":"var(--color-text-secondary)",backgroundColor:d?"var(--color-bg-primary)":"transparent",fontWeight:d?600:400},children:[v.jsx(u,{size:14}),v.jsx("span",{children:r})]},A)})}),v.jsxs("div",{className:"px-4 py-3 mt-auto text-[11px] tracking-wide",style:{color:"var(--color-text-muted)"},children:["v","0.2.69"]})]}),v.jsxs("div",{className:"flex-1 min-w-0",children:[S==="account"&&v.jsx(lx,{onClose:h}),S==="session"&&v.jsx(gx,{onClose:h}),S==="tunnel"&&v.jsx(ax,{onClose:h}),S==="mcp"&&v.jsx(_x,{onClose:h})]})]})})})}const fh=["#55708F","#4F7A68","#9A783F","#A15F5A","#74658A","#925F73","#477B7D","#747A50"];function bx(s,h){let w=0;for(let S=0;S<s.length;S++)w=(w<<5)-w+s.charCodeAt(S)|0;return Math.abs(w)%h}function To(s){return s.color&&/^#[0-9a-f]{6}$/i.test(s.color)?s.color:fh[bx(s.id,fh.length)]}const vg=192,yx=88,Qa=8;function wx({project:s,anchorX:h,anchorY:w,onPick:S,onClose:M}){const O=j.useRef(null),[A,r]=j.useState({left:h,top:w}),u=To(s);return j.useLayoutEffect(()=>{const d=Math.min(Math.max(h,Qa),window.innerWidth-vg-Qa),g=Math.min(Math.max(w,Qa),window.innerHeight-yx-Qa);r({left:d,top:g})},[h,w]),j.useEffect(()=>{const d=l=>{var m;(m=O.current)!=null&&m.contains(l.target)||M()},g=l=>{l.key==="Escape"&&M()};return window.addEventListener("mousedown",d),window.addEventListener("keydown",g),()=>{window.removeEventListener("mousedown",d),window.removeEventListener("keydown",g)}},[M]),zi.createPortal(v.jsxs("div",{ref:O,role:"menu",className:"z-tooltip",style:{position:"fixed",left:A.left,top:A.top,width:vg,background:"var(--color-bg-elevated, #1f1f23)",border:"1px solid var(--color-border)",borderRadius:10,padding:10,boxShadow:"0 12px 32px rgba(0,0,0,0.45)"},children:[v.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:8,marginBottom:8},children:fh.map(d=>{const g=s.color?d.toLowerCase()===s.color.toLowerCase():d===u&&!s.color;return v.jsx("button",{onClick:()=>S(d),"aria-label":d,style:{width:20,height:20,borderRadius:6,background:d,border:g?"2px solid var(--color-text-primary)":"2px solid transparent",cursor:"pointer",padding:0}},d)})}),v.jsx("button",{onClick:()=>S(null),style:{width:"100%",background:"transparent",border:"1px solid var(--color-border)",color:"var(--color-text-tertiary)",padding:"4px 8px",borderRadius:6,fontSize:11,cursor:"pointer"},children:"자동 색 (기본값)"})]}),document.body)}function Gv(s,h){return s instanceof Error&&s.message.trim()?s.message:typeof s=="string"&&s.trim()?s:h}function Sx(s){const h=s instanceof Error?s.message:typeof s=="string"?s:"";return/^ResizeObserver loop (?:limit exceeded|completed with undelivered notifications\.?)$/i.test(h.trim())}const xx={sm:"btn-icon-sm",md:"btn-icon-md",lg:"btn-icon-lg"},Cx={default:"",active:"btn-icon-active",danger:"btn-icon-danger"},Ei=j.forwardRef(function({label:h,size:w="md",variant:S="default",pressed:M,type:O="button",title:A,className:r,...u},d){return v.jsx("button",{ref:d,type:O,"aria-label":h,"aria-pressed":M,title:A??h,className:Tn("btn-icon",xx[w],Cx[S],r),...u})});function kx(s){return s==="executable"?Rv:s==="command"?Ov:Mv}function Ex({onLogout:s,authRequired:h,connected:w,onEvent:S,onClose:M,collapsed:O=!1,onToggleCollapsed:A}){var St;const[r,u]=j.useState([]),[d,g]=j.useState({}),[l,m]=j.useState(null),[b,C]=j.useState(!1),[p,o]=j.useState(null),[c,a]=j.useState([]),[f,y]=j.useState(!1),[R,k]=j.useState(null),[D,E]=j.useState(!1),[L,z]=j.useState(null),[H,P]=j.useState(!1),[I,K]=j.useState(null),[X,Y]=j.useState(null),$=ss(),U=xl(),{t:T,toggleLang:F}=Tt(),{theme:B,toggleTheme:W}=YS(),{enabled:Z,supported:ne,toggleNotification:ge}=Ll(),{error:xe,success:J,info:G,warning:de}=un(),{confirm:oe}=kr(),Ae=((St=$.pathname.match(/^\/projects\/([^/]+)/))==null?void 0:St[1])||null;j.useEffect(()=>{it(),Xe(),uh().then(z).catch(()=>{})},[]);async function Oe(){if(!H){P(!0);try{const Se=await uh();if(z(Se),Se.status==="running"&&Se.url){await navigator.clipboard.writeText(Se.url),J(T("tunnel.urlCopied"));return}const Ie=await zv(),le={status:"running",url:Ie.url};z(le);try{await navigator.clipboard.writeText(Ie.url),J(T("tunnel.urlCopied"))}catch{J(Ie.url)}}catch(Se){xe(Se instanceof Error?Se.message:T("tunnel.restartFailed"))}finally{P(!1)}}}function Xe(){zS().then(a).catch(()=>{})}const We=async Se=>{try{R?await PS(R.id,Se):await HS(Se),y(!1),k(null),Xe()}catch(Ie){xe(Ie instanceof Error?Ie.message:"Failed to save favorite")}},rt=async Se=>{try{await FS(Se)}catch(Ie){const le=Ie instanceof Error?Ie.message:T("favorites.launchFailed");xe(`${T("favorites.launchFailed")}: ${le}`)}},ye=async(Se,Ie)=>{if(Ie.preventDefault(),Ie.stopPropagation(),!!await oe({message:T("favorites.deleteConfirm"),danger:!0}))try{await IS(Se),a(le=>le.filter(Ne=>Ne.id!==Se))}catch(le){xe(le instanceof Error?le.message:"Failed to delete favorite")}},Te=(Se,Ie)=>{Ie.preventDefault(),Ie.stopPropagation(),k(Se),y(!0)};j.useEffect(()=>{const Se=()=>it();return window.addEventListener("projects:changed",Se),()=>window.removeEventListener("projects:changed",Se)},[]),j.useEffect(()=>{const Se=()=>ct();return window.addEventListener("review:changed",Se),()=>window.removeEventListener("review:changed",Se)},[]),j.useEffect(()=>S(Se=>{var Ie;if(Se.type==="project:status-changed"&&Se.projectId&&g(le=>({...le,[Se.projectId]:{running:Se.running??0,completed:Se.completed??0,total:Se.total??0,running_sessions:Se.running_sessions??0,running_discussions:Se.running_discussions??0}})),Se.type==="todo:status-changed"&&ct(),Se.type==="memory:ingest-finished"){const le=r.find(Me=>Me.id===Se.projectId),Ne=(le==null?void 0:le.name)??"",je=Se.sourceTitle?`“${Se.sourceTitle}”`:Se.sourceType??"",ue=Ne?`[${Ne}] `:"";if(Se.error){xe(`${ue}${T("wiki.ingest.toast.failed")}: ${Se.error}`,6e3);return}const ee=Se.created??0,be=Se.updated??0,he=Se.edgesAdded??0;if(ee+be+he>0){const Me=T("wiki.ingest.toast.success").replace("{source}",je).replace("{created}",String(ee)).replace("{updated}",String(be)).replace("{edges}",String(he));J(`${ue}${Me}`)}else(Ie=Se.skipped)!=null&&Ie.parseFailed?de(`${ue}${T("wiki.ingest.toast.parseFailed").replace("{source}",je)}`,5e3):G(`${ue}${T("wiki.ingest.toast.empty").replace("{source}",je)}`,4e3)}}),[S,r,T,xe,G,J,de]),j.useEffect(()=>{ct()},[]);function ct(){NS({hours:24}).then(Se=>m(Se.total_todos)).catch(()=>{})}function it(){Bv().then(Se=>{u(Se),Se.forEach(Ie=>{BS(Ie.id).then(le=>{g(Ne=>({...Ne,[Ie.id]:le}))}).catch(()=>{})})}).catch(()=>{})}const ze=()=>{M==null||M()},qe=async(Se,Ie)=>{await MS({name:Se,path:Ie}),C(!1),window.dispatchEvent(new Event("projects:changed"))},Fe=j.useCallback(async(Se,Ie)=>{const le=r.map(Me=>Me.id),Ne=le.indexOf(Se);if(Ne<0)return;const je=le.filter(Me=>Me!==Se),ue=Ie>Ne?Ie-1:Ie;if(ue===Ne)return;const ee=[...je.slice(0,ue),Se,...je.slice(ue)],be=r,he=new Map(r.map(Me=>[Me.id,Me])),He=ee.map(Me=>he.get(Me)).filter(Boolean);u(He);try{await OS(ee)}catch(Me){u(be),xe(Me instanceof Error?Me.message:"Failed to reorder projects")}},[r,xe]),Be=j.useRef(!1),$e=j.useCallback((Se,Ie)=>{if(Ie.button!==0||Ie.target.closest("button"))return;Ie.preventDefault();const Ne=Ie.clientX,je=Ie.clientY,ue=6;let ee=!1,be=null;const he=V=>{const ie=document.querySelectorAll("[data-workspace-item]");if(ie.length===0)return null;const Q=ie[0].getBoundingClientRect();if(V<Q.top)return 0;const ke=ie[ie.length-1].getBoundingClientRect();if(V>ke.bottom)return ie.length;for(let ce=0;ce<ie.length;ce++){const _e=ie[ce].getBoundingClientRect();if(V>=_e.top&&V<=_e.bottom){const Ee=_e.top+_e.height/2;return V<Ee?ce:ce+1}}return null},He=V=>{if(!ee){if(Math.hypot(V.clientX-Ne,V.clientY-je)<ue)return;ee=!0,K(Se)}const ie=he(V.clientY);ie!==be&&(be=ie,Y(ie))},Me=()=>{window.removeEventListener("mousemove",He),window.removeEventListener("mouseup",Ge),window.removeEventListener("keydown",se)},Ge=()=>{if(Me(),!ee)return;Be.current=!0,requestAnimationFrame(()=>{Be.current=!1});const V=be;K(null),Y(null),V!==null&&Fe(Se,V)},se=V=>{V.key==="Escape"&&(Me(),K(null),Y(null),ee&&(Be.current=!0,requestAnimationFrame(()=>{Be.current=!1})))};window.addEventListener("mousemove",He),window.addEventListener("mouseup",Ge),window.addEventListener("keydown",se)},[Fe]),lt=async(Se,Ie)=>{if(Ie.preventDefault(),Ie.stopPropagation(),!!await oe({message:T("projects.deleteConfirm"),danger:!0}))try{await jS(Se),u(le=>le.filter(Ne=>Ne.id!==Se)),window.dispatchEvent(new Event("projects:changed")),Ae===String(Se)&&U("/")}catch(le){xe(Gv(le,T("errors.projectDelete")))}},st=Se=>v.jsx("div",{className:"pointer-events-none absolute left-2 right-2 h-0.5 rounded-full",style:{backgroundColor:"var(--color-accent)",zIndex:10,...Se==="above"?{top:-1}:{bottom:-1}}});if(O){const Se=v.jsx("div",{className:"w-7 border-t my-1.5",style:{borderColor:"var(--color-border)"}});return v.jsxs("div",{className:"flex flex-col items-center h-full bg-theme-bg-secondary border-none py-3",children:[v.jsx(Ei,{onClick:A,label:T("sidebar.expand"),size:"lg",children:v.jsx(V1,{size:16})}),Se,v.jsx(es,{to:"/",onClick:ze,className:"relative flex items-center justify-center w-9 h-9 rounded-lg transition-colors hover:bg-theme-hover",style:$.pathname==="/"?{backgroundColor:"var(--color-bg-hover)",color:"var(--color-text-primary)"}:{color:"var(--color-text-tertiary)"},title:T("sidebar.home"),children:v.jsx(ng,{size:16})}),v.jsxs(es,{to:"/review",onClick:ze,className:"relative flex items-center justify-center w-9 h-9 rounded-lg transition-colors hover:bg-theme-hover mt-0.5",style:$.pathname==="/review"?{backgroundColor:"var(--color-bg-hover)",color:"var(--color-text-primary)"}:{color:"var(--color-text-tertiary)"},title:T("sidebar.review"),children:[v.jsx(sg,{size:16}),l!==null&&l>0&&v.jsx("span",{className:"absolute top-1 right-1 w-1.5 h-1.5 rounded-full",style:{backgroundColor:"var(--color-accent)"}})]}),v.jsx(es,{to:"/agenda",onClick:ze,className:"relative flex items-center justify-center w-9 h-9 rounded-lg transition-colors hover:bg-theme-hover mt-0.5",style:$.pathname==="/agenda"?{backgroundColor:"var(--color-bg-hover)",color:"var(--color-text-primary)"}:{color:"var(--color-text-tertiary)"},title:T("sidebar.agenda"),children:v.jsx(ig,{size:16})}),Se,v.jsx("div",{className:"flex-1 overflow-y-auto w-full flex flex-col items-center gap-1 py-1",children:r.map(Ie=>{const le=d[Ie.id],Ne=Ae===String(Ie.id),je=le?le.running+le.running_sessions+le.running_discussions:0,ue=je>0,ee=To(Ie);return v.jsxs(es,{to:`/projects/${Ie.id}`,onClick:ze,className:"relative flex items-center justify-center w-9 h-9 rounded-lg transition-colors hover:bg-theme-hover",style:Ne?{backgroundColor:"var(--color-bg-hover)"}:void 0,title:ue?`${Ie.name} · ${je} ${T("detail.live")}`:Ie.name,children:[Ne&&v.jsx("span",{className:"absolute left-0 top-1/4 bottom-1/4 w-[3px] rounded-r-full",style:{backgroundColor:ee}}),v.jsx("span",{className:`w-2.5 h-2.5 rounded-[3px] ${ue?"workspace-dot-pulse":""}`,style:{backgroundColor:ee,opacity:Ne||ue?1:.55}})]},Ie.id)})}),Se,v.jsx("span",{className:`w-1.5 h-1.5 rounded-full my-1 ${w?"bg-status-success":"bg-status-error"}`,title:w?T("detail.live"):"Disconnected"}),v.jsx(Ei,{onClick:W,label:T(B==="light"?"theme.dark":"theme.light"),size:"lg",children:B==="light"?v.jsx(rg,{size:16}):v.jsx(lg,{size:16})}),v.jsx(Ei,{onClick:()=>E(!0),label:T("settings.title"),size:"lg",children:v.jsx(ag,{size:16})}),v.jsx(gg,{open:D,onClose:()=>E(!1)})]})}return v.jsxs("div",{className:"flex flex-col h-full bg-theme-bg-secondary border-none",onDragStart:Se=>Se.preventDefault(),children:[v.jsxs("div",{className:"px-4 pt-5 pb-3 flex items-center justify-between",children:[v.jsxs(es,{to:"/",onClick:ze,className:"block font-mono text-[22px] leading-none whitespace-nowrap select-none",children:[v.jsxs("span",{className:"font-medium text-accent/50",children:[">","_ "]}),v.jsx("span",{className:"font-bold text-accent",children:"CLI"}),v.jsx("span",{className:"font-medium text-theme-text",children:"Trigger"})]}),v.jsx(Ei,{onClick:A,label:T("sidebar.collapse"),size:"sm",className:"hidden md:inline-flex flex-shrink-0",children:v.jsx(K1,{size:16})})]}),v.jsxs("nav",{className:"px-3 mb-2 space-y-0.5",children:[v.jsxs(es,{to:"/",onClick:ze,className:`relative flex items-center gap-3 px-3 py-2 rounded-lg text-sm transition-all duration-200 active:scale-95 ${$.pathname==="/"?"font-medium":""}`,style:$.pathname==="/"?{backgroundColor:"var(--color-bg-hover)",color:"var(--color-text-primary)",boxShadow:"var(--shadow-soft)"}:{color:"var(--color-text-tertiary)"},children:[$.pathname==="/"&&v.jsx("span",{className:"absolute left-0 top-1/4 bottom-1/4 w-[3px] rounded-r-full",style:{backgroundColor:"var(--color-accent)"}}),v.jsx(ng,{size:16}),T("sidebar.home")]}),v.jsxs(es,{to:"/review",onClick:ze,className:`relative flex items-center gap-3 px-3 py-2 rounded-lg text-sm transition-all duration-200 active:scale-95 ${$.pathname==="/review"?"font-medium":""}`,style:$.pathname==="/review"?{backgroundColor:"var(--color-bg-hover)",color:"var(--color-text-primary)",boxShadow:"var(--shadow-soft)"}:{color:"var(--color-text-tertiary)"},children:[$.pathname==="/review"&&v.jsx("span",{className:"absolute left-0 top-1/4 bottom-1/4 w-[3px] rounded-r-full",style:{backgroundColor:"var(--color-accent)"}}),v.jsx(sg,{size:16}),v.jsx("span",{className:"flex-1",children:T("sidebar.review")}),l!==null&&l>0&&v.jsx("span",{className:"text-2xs px-1.5 py-0.5 rounded-full font-medium",style:{backgroundColor:"var(--color-accent)",color:"white"},children:l})]}),v.jsxs(es,{to:"/agenda",onClick:ze,className:`relative flex items-center gap-3 px-3 py-2 rounded-lg text-sm transition-all duration-200 active:scale-95 ${$.pathname==="/agenda"?"font-medium":""}`,style:$.pathname==="/agenda"?{backgroundColor:"var(--color-bg-hover)",color:"var(--color-text-primary)",boxShadow:"var(--shadow-soft)"}:{color:"var(--color-text-tertiary)"},children:[$.pathname==="/agenda"&&v.jsx("span",{className:"absolute left-0 top-1/4 bottom-1/4 w-[3px] rounded-r-full",style:{backgroundColor:"var(--color-accent)"}}),v.jsx(ig,{size:16}),T("sidebar.agenda")]})]}),v.jsx("div",{className:"mx-4 border-t",style:{borderColor:"var(--color-border)"}}),v.jsxs("div",{className:"flex-1 overflow-y-auto px-3 pt-3",children:[v.jsxs("div",{className:"px-3 mb-2 flex items-center justify-between",children:[v.jsx("span",{className:"text-2xs font-semibold uppercase tracking-wider",style:{color:"var(--color-text-muted)"},children:T("sidebar.workspaces")}),v.jsx(Ei,{onClick:()=>C(!0),label:T("projects.new"),size:"sm",children:v.jsx(Mn,{size:14})})]}),v.jsx("div",{className:"space-y-0.5",children:r.map((Se,Ie)=>{const le=d[Se.id],Ne=Ae===String(Se.id),je=le?le.running+le.running_sessions+le.running_discussions:0,ue=je>0,ee=To(Se),be=I===Se.id,he=I!==null&&X===Ie,He=I!==null&&Ie===r.length-1&&X===r.length;return v.jsxs("div",{className:"relative","data-workspace-item":!0,children:[he&&st("above"),v.jsxs(es,{to:`/projects/${Se.id}`,draggable:!1,onDragStart:Me=>Me.preventDefault(),onClick:Me=>{if(Be.current){Me.preventDefault();return}ze()},onMouseDown:Me=>$e(Se.id,Me),onContextMenu:Me=>{Me.preventDefault(),o({project:Se,x:Me.clientX,y:Me.clientY})},className:`relative flex items-center gap-2.5 px-3 py-1.5 rounded-lg text-sm transition-all duration-200 hover:bg-theme-hover active:scale-95 group ${Ne?"font-medium":""} ${be?"opacity-50":""}`,style:Ne?{backgroundColor:"var(--color-bg-hover)",color:"var(--color-text-primary)",boxShadow:"var(--shadow-soft)",cursor:I?"grabbing":"pointer",userSelect:"none"}:{color:"var(--color-text-tertiary)",cursor:I?"grabbing":"pointer",userSelect:"none"},children:[Ne&&v.jsx("span",{className:"absolute left-0 top-1/4 bottom-1/4 w-[3px] rounded-r-full",style:{backgroundColor:ee}}),v.jsx("span",{className:`w-1.5 h-3 rounded-[2px] flex-shrink-0 ${ue?"workspace-dot-pulse":""}`,style:{backgroundColor:ee,opacity:Ne||ue?1:.55},title:ue?`${T("sidebar.workspaces")} · ${je} ${T("detail.live")}`:Se.name}),v.jsx("span",{className:"truncate flex-1",children:Se.name}),v.jsx(Ei,{onClick:Me=>lt(Se.id,Me),label:T("projects.delete"),size:"sm",variant:"danger",className:"flex-shrink-0 opacity-0 group-hover:opacity-100 focus-visible:opacity-100",children:v.jsx(Ri,{size:12})})]}),He&&st("below")]},Se.id)})})]}),b&&v.jsx(ix,{onSubmit:(Se,Ie)=>qe(Se,Ie),onCancel:()=>C(!1)}),v.jsxs("div",{className:"px-3 pt-3 pb-2 border-t",style:{borderColor:"var(--color-border)"},children:[v.jsxs("div",{className:"px-3 mb-2 flex items-center justify-between",children:[v.jsx("span",{className:"text-2xs font-semibold uppercase tracking-wider",style:{color:"var(--color-text-muted)"},children:T("sidebar.favorites")}),v.jsx(Ei,{onClick:()=>{k(null),y(!0)},label:T("favorites.add"),size:"sm",children:v.jsx(Mn,{size:14})})]}),v.jsx("div",{className:"space-y-0.5 max-h-48 overflow-y-auto",children:c.map(Se=>{const Ie=kx(Se.type);return v.jsxs("button",{onClick:()=>rt(Se.id),className:"w-full relative flex items-center gap-2.5 px-3 py-1.5 rounded-lg text-sm transition-all duration-200 hover:bg-theme-hover active:scale-95 group",style:{color:"var(--color-text-tertiary)"},title:Se.target,children:[v.jsx(Ie,{size:14,className:"flex-shrink-0"}),v.jsx("span",{className:"truncate flex-1 text-left",children:Se.name}),v.jsx("span",{onClick:le=>Te(Se,le),className:"flex-shrink-0 p-0.5 rounded-md opacity-0 group-hover:opacity-100 transition-all hover:bg-theme-hover cursor-pointer",style:{color:"var(--color-text-muted)"},title:T("favorites.edit"),children:v.jsx(Q1,{size:12})}),v.jsx("span",{onClick:le=>ye(Se.id,le),className:"flex-shrink-0 p-0.5 rounded-md opacity-0 group-hover:opacity-100 transition-all hover:bg-status-error/10 cursor-pointer",style:{color:"var(--color-text-muted)"},title:T("favorites.delete"),children:v.jsx(Ri,{size:12})})]},Se.id)})})]}),f&&v.jsx(rx,{initial:R??void 0,onSubmit:We,onCancel:()=>{y(!1),k(null)}}),p&&v.jsx(wx,{project:p.project,anchorX:p.x,anchorY:p.y,onPick:async Se=>{try{const Ie=await AS(p.project.id,{color:Se});u(le=>le.map(Ne=>Ne.id===Ie.id?{...Ne,color:Ie.color}:Ne)),window.dispatchEvent(new Event("projects:changed"))}catch(Ie){xe(Ie instanceof Error?Ie.message:"Failed to update color")}o(null)},onClose:()=>o(null)}),v.jsx(gg,{open:D,onClose:()=>E(!1)}),v.jsx("div",{className:"px-3 pb-4 pt-2",style:{borderTop:"1px solid var(--color-border)"},children:v.jsxs("div",{className:"flex items-center gap-1 px-1",children:[v.jsx("span",{className:`w-1.5 h-1.5 rounded-full flex-shrink-0 mr-1 ${w?"bg-status-success":"bg-status-error"}`,title:w?T("detail.live"):"Disconnected"}),v.jsx(Ei,{onClick:W,label:T(B==="light"?"theme.dark":"theme.light"),children:B==="light"?v.jsx(rg,{size:16}):v.jsx(lg,{size:16})}),v.jsx(Ei,{onClick:F,label:T("lang.toggle"),className:"text-xs font-medium",children:T("lang.toggle")}),ne&&v.jsx(Ei,{onClick:ge,label:"Notification"in window&&Notification.permission==="denied"?T("notification.blocked"):T("notification.toggle"),variant:Z?"active":"default",pressed:Z,children:Z?v.jsx(Xw,{size:16}):v.jsx(Yw,{size:16})}),v.jsx(Ei,{onClick:Oe,disabled:H,label:T("tunnel.start"),variant:(L==null?void 0:L.status)==="running"?"active":"default",pressed:(L==null?void 0:L.status)==="running",title:(L==null?void 0:L.status)==="running"&&L.url?`${L.url} — ${T("tunnel.urlCopied")}`:T(H?"tunnel.starting":"tunnel.start"),children:v.jsx(Ev,{size:16})}),v.jsx(Ei,{onClick:()=>E(!0),label:T("settings.title"),children:v.jsx(ag,{size:16})}),h&&v.jsx(Ei,{onClick:s,label:T("projects.logout"),variant:"danger",className:"ml-auto",children:v.jsx(H1,{size:16})})]})})]})}function Lx({children:s,onLogout:h,authRequired:w,connected:S,onEvent:M}){const[O,A]=j.useState(!1),{t:r}=Tt(),[u,d]=j.useState(()=>localStorage.getItem("sidebarCollapsed")==="1"),g=()=>{d(l=>{const m=!l;return localStorage.setItem("sidebarCollapsed",m?"1":"0"),m})};return v.jsxs("div",{className:"flex h-screen bg-theme-bg",children:[v.jsx("aside",{"data-app-sidebar":!0,className:`
|
|
403
|
+
fixed inset-y-0 left-0 z-40 flex-shrink-0
|
|
404
|
+
transition-[transform,width] duration-200 ease-in-out
|
|
405
|
+
md:translate-x-0 md:static md:z-auto
|
|
406
|
+
${u?"w-60 md:w-14":"w-60"}
|
|
407
|
+
${O?"translate-x-0":"-translate-x-full"}
|
|
408
|
+
`,children:v.jsx(Ex,{onLogout:h,authRequired:w,connected:S,onEvent:M,onClose:()=>A(!1),collapsed:u,onToggleCollapsed:g})}),O&&v.jsx("div",{className:"fixed inset-0 z-overlay bg-black/50 backdrop-blur-sm md:hidden",onClick:()=>A(!1)}),v.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden min-w-0",children:[v.jsxs("div",{className:"md:hidden flex items-center px-4 py-3 border-b border-theme-border bg-theme-bg-secondary z-20",children:[v.jsx(Ei,{onClick:()=>A(!0),label:r("sidebar.expand"),size:"md",children:v.jsx(F1,{size:20})}),v.jsx("span",{className:"ml-3 text-sm font-semibold text-theme-text",children:"CLITrigger"})]}),v.jsx("main",{className:"flex-1 overflow-y-auto relative",style:{marginLeft:"var(--dock-inset-left, 0px)",marginRight:"var(--dock-inset-right, 0px)",marginTop:"var(--dock-inset-top, 0px)",marginBottom:"var(--dock-inset-bottom, 0px)"},children:v.jsx("div",{className:"relative",style:{zIndex:1},children:s})})]})]})}function ln(s,h){return{kind:"stack",tabs:s.slice(),activeTab:h??s[0]}}function cn(s,h){let w=s;for(const S of h){if(w.kind!=="split"||S<0||S>=w.children.length)return null;w=w.children[S]}return w}function yr(s,h){if(s.kind==="stack")return s.tabs.includes(h)?[]:null;for(let w=0;w<s.children.length;w++){const S=yr(s.children[w],h);if(S)return[w,...S]}return null}function Ft(s){return s.kind==="stack"?s.tabs.slice():s.children.flatMap(Ft)}function wr(s){return s.kind==="stack"?[s.activeTab]:s.children.flatMap(wr)}function Yv(s,h){const w=Ft(s);if(w.length<=1||h==="single")return ln(w,wr(s)[0]||w[0]);const S=Math.min(h==="columns"?2:4,w.length),M=Array.from({length:S},()=>[]);w.forEach((l,m)=>M[m%S].push(l));const O=new Set(wr(s)),A=M.map(l=>ln(l,l.find(m=>O.has(m))||l[0]));if(h==="columns"||A.length<=2)return{kind:"split",orientation:"horizontal",children:A,sizes:A.map(()=>100/A.length)};const r=A.slice(0,2),u=A.slice(2),d=l=>l.length===1?l[0]:{kind:"split",orientation:"horizontal",children:l,sizes:l.map(()=>100/l.length)};return{kind:"split",orientation:"vertical",children:[d(r),d(u)],sizes:[50,50]}}function Dn(s,h){return Kv(s,h)}function Kv(s,h){if(s.kind==="stack"){if(!s.tabs.includes(h))return s;const O=s.tabs.filter(r=>r!==h);if(O.length===0)return null;const A=s.activeTab===h?O[0]:s.activeTab;return{kind:"stack",tabs:O,activeTab:A}}const w=[],S=[];for(let O=0;O<s.children.length;O++){const A=Kv(s.children[O],h);A!==null&&(w.push(A),S.push(s.sizes[O]))}if(w.length===0)return null;if(w.length===1)return w[0];const M=S.reduce((O,A)=>O+A,0)||1;return{kind:"split",orientation:s.orientation,children:w,sizes:S.map(O=>O/M*100)}}function pr(s,h,w){return Rl(s,h,S=>{if(S.kind!=="stack")throw new Error("insertIntoStack: target must be a stack");return S.tabs.includes(w)?{...S,activeTab:w}:{kind:"stack",tabs:[...S.tabs,w],activeTab:w}})}function ko(s,h,w,S){const M=w==="left"||w==="right"?"horizontal":"vertical",O=w==="left"||w==="top";return Rl(s,h,A=>({kind:"split",orientation:M,children:O?[S,A]:[A,S],sizes:[50,50]}))}function Xv(s,h,w,S,M){const O=M&&S.includes(M)?M:S[S.length-1],A=w==="center"?S.reduce((r,u)=>pr(r,h,u),s):ko(s,h,w,ln(S,O));return Ki(A,O)}function Rl(s,h,w){if(h.length===0)return gl(w(s));if(s.kind!=="split")throw new Error("replaceAt: path traverses non-split");const[S,...M]=h;if(S<0||S>=s.children.length)throw new Error("replaceAt: bad path");const O=s.children.map((A,r)=>r===S?Rl(A,M,w):A);return gl({...s,children:O})}function gl(s){if(s.kind==="stack")return s;const h=s.children.map(gl),w=[],S=[];for(let O=0;O<h.length;O++){const A=h[O],r=s.sizes[O]??100/h.length;if(A.kind==="split"&&A.orientation===s.orientation){const u=A.sizes.reduce((d,g)=>d+g,0)||1;for(let d=0;d<A.children.length;d++)w.push(A.children[d]),S.push(A.sizes[d]/u*r)}else w.push(A),S.push(r)}if(w.length===1)return w[0];const M=S.reduce((O,A)=>O+A,0)||1;return{kind:"split",orientation:s.orientation,children:w,sizes:S.map(O=>O/M*100)}}function Ki(s,h){return s.kind==="stack"?s.tabs.includes(h)?{...s,activeTab:h}:s:{...s,children:s.children.map(w=>Ki(w,h))}}function Vv(s,h,w){if(s.kind==="stack"){if(!s.tabs.includes(h))return s;const S=s.tabs.indexOf(h),M=Math.max(0,Math.min(w,s.tabs.length-1));if(M===S)return s;const O=s.tabs.slice();return O.splice(S,1),O.splice(M,0,h),{...s,tabs:O}}return{...s,children:s.children.map(S=>Vv(S,h,w))}}function Jv(s,h,w){return Rl(s,h,S=>{if(S.kind!=="split")throw new Error("setSplitSizes: target must be a split");if(S.children.length!==w.length)throw new Error("setSplitSizes: size count mismatch");return{...S,sizes:w}})}function Rx(s,h,w,S){const M=cn(s,w);if(!M||M.kind!=="stack"||S==="center"&&M.tabs.includes(h))return null;const O=M.tabs.find(d=>d!==h);if(!O)return null;const A=Dn(s,h);if(!A)return null;const r=yr(A,O);if(!r)return null;const u=S==="center"?pr(A,r,h):ko(A,r,S,ln([h]));return Ki(u,h)}function Dx(s,h,w){const S=w==="left"||w==="right"?"horizontal":"vertical",M=w==="right"||w==="down";for(let O=h.length-1;O>=0;O--){const A=cn(s,h.slice(0,O));if(!A||A.kind!=="split"||A.orientation!==S)continue;const r=h[O]+(M?1:-1);if(r<0||r>=A.children.length)continue;const u=Tx(s,h,O,S);return[...h.slice(0,O),r,...Mx(A.children[r],M,u,S)]}return null}function Tx(s,h,w,S){let M=0,O=1;for(let A=w;A<h.length;A++){const r=cn(s,h.slice(0,A));if(!r||r.kind!=="split"||r.orientation===S)continue;const u=r.sizes.reduce((m,b)=>m+b,0)||1,d=r.sizes.slice(0,h[A]).reduce((m,b)=>m+b,0)/u,g=r.sizes[h[A]]/u,l=O-M;O=M+l*(d+g),M=M+l*d}return(M+O)/2}function Mx(s,h,w,S){const M=[];let O=s,A=w;for(;O.kind==="split";){let r=O.children.length-1;if(O.orientation===S)r=h?0:O.children.length-1;else{const u=O.sizes.reduce((g,l)=>g+l,0)||1;let d=0;for(let g=0;g<O.children.length;g++){const l=O.sizes[g]/u;if(A<d+l||g===O.children.length-1){r=g,A=l>0?(A-d)/l:.5;break}d+=l}}M.push(r),O=O.children[r]}return M}function Qv(s,h){const w=Ft(s);let S=s;for(const M of w){if(!S)break;h.has(M)||(S=Dn(S,M))}return S}function _g(s){const h=new Set,w=[];for(const S of s){const M=Ft(S.root),O=new Set(M.filter(d=>!h.has(d)));for(const d of M)h.add(d);if(O.size===M.length){w.push(S);continue}const A=Qv(S.root,O);if(!A)continue;const r={};for(const d of Object.keys(S.colors))O.has(d)&&(r[d]=S.colors[d]);const u={};for(const d of Object.keys(S.intents))O.has(d)&&(u[d]=S.intents[d]);w.push({...S,root:A,colors:r,intents:u})}return w}const Ax="clitrigger:session-windows:global";function Bh(){if(typeof BroadcastChannel>"u")return{post:()=>{},subscribe:()=>()=>{},close:()=>{}};const s=new BroadcastChannel(Ax),h=new Set;return s.onmessage=w=>{const S=w.data;for(const M of h)try{M(S)}catch{}},{post:w=>{s.postMessage(w)},subscribe:w=>(h.add(w),()=>{h.delete(w)}),close:()=>{h.clear(),s.close()}}}const gt="main",ph=new Map;function jx(s,h){ph.set(s,h)}function Ox(s){const h=ph.get(s);if(!h||h.closed)return ph.delete(s),!1;try{return h.focus(),!0}catch{return!1}}function Bx(){return`popout_${Math.random().toString(36).slice(2,10)}_${Date.now().toString(36)}`}const Nh=5e3,Zv=15e3;let fr=null;function An(){var w;const s=window.electronAPI,h=(w=s==null?void 0:s.getZoomFactor)==null?void 0:w.call(s);return typeof h=="number"&&h>0?h:1}function e_(){if(typeof window>"u")return()=>{};const s=h=>{const w=An();fr={ox:h.screenX-h.clientX*w,oy:h.screenY-h.clientY*w,wx:window.screenX,wy:window.screenY}};return window.addEventListener("mousemove",s,{passive:!0}),()=>window.removeEventListener("mousemove",s)}function t_(){if(fr)return{ox:fr.ox+(window.screenX-fr.wx),oy:fr.oy+(window.screenY-fr.wy)};const s=An(),h=Math.max(0,(window.outerWidth-window.innerWidth*s)/2),w=Math.max(0,window.outerHeight-window.innerHeight*s-h);return{ox:window.screenX+h,oy:window.screenY+w}}function vl(s,h){const w=An(),{ox:S,oy:M}=t_();return{x:(s-S)/w,y:(h-M)/w}}function i_(s,h){const w=An(),{ox:S,oy:M}=t_();return{x:S+s*w,y:M+h*w}}function _l(s){return s.x>=0&&s.y>=0&&s.x<=window.innerWidth&&s.y<=window.innerHeight}const mh="clitrigger:popout-alive:";function Nx(s){return`${mh}${s}`}function zh(){return typeof navigator<"u"&&!!navigator.locks&&typeof navigator.locks.query=="function"}function zx(s){if(!zh())return()=>{};let h=()=>{};return navigator.locks.request(Nx(s),()=>new Promise(w=>{h=w})).catch(()=>{}),()=>h()}async function s_(){var s;if(!zh())return new Set;try{const h=await navigator.locks.query(),w=new Set;for(const S of h.held??[])(s=S.name)!=null&&s.startsWith(mh)&&w.add(S.name.slice(mh.length));return w}catch{return new Set}}const Hx={states:{},attention:new Set},Hh=j.createContext(Hx);function Ph(s,h,w){const[S,M]=j.useState({}),[O,A]=j.useState(()=>new Set),r=j.useRef(S);r.current=S;const u=j.useRef(h);u.current=h;const d=j.useRef(w);return d.current=w,j.useEffect(()=>s(g=>{var C;if(g.type!=="session:agent-state"||!g.sessionId||!g.state)return;const l=g.sessionId,m=g.state;if(r.current[l]===m)return;M(p=>({...p,[l]:m})),(m==="blocked"||m==="done"&&g.reason!=="stopped")&&!u.current.has(l)?(A(p=>p.has(l)?p:new Set(p).add(l)),(C=d.current)==null||C.call(d,l,m)):A(p=>{if(!p.has(l))return p;const o=new Set(p);return o.delete(l),o})}),[s]),j.useEffect(()=>{A(g=>{let l=null;for(const m of h)g.has(m)&&(l||(l=new Set(g)),l.delete(m));return l??g})},[h]),{states:S,attention:O}}const Mo="sessionGroups:",Px="pendingSessionRestore",Ix="pendingSessionRecall",n_="sessionDockOrder",r_="sessionDockTray:left";function dr(s){return`${s.projectId}:${s.groupId}`}function Fx(){try{const s=localStorage.getItem(n_),h=s?JSON.parse(s):[];return Array.isArray(h)?h.filter(w=>typeof w=="string"):[]}catch{return[]}}function Ux(s){try{localStorage.setItem(n_,JSON.stringify(s))}catch{}}function $x(){try{const s=localStorage.getItem(r_);if(s===null)return null;const h=Number(s);return Number.isFinite(h)?h:null}catch{return null}}function bg(s){try{localStorage.setItem(r_,String(Math.round(s)))}catch{}}function yg(){var h;const s=[];try{for(let w=0;w<localStorage.length;w++){const S=localStorage.key(w);if(!S||!S.startsWith(Mo))continue;const M=S.slice(Mo.length),O=localStorage.getItem(S);if(O)try{const A=JSON.parse(O);if(!Array.isArray(A.groups))continue;const r=A.titles??{};for(const u of A.groups){if(!(u!=null&&u.root))continue;const d=!!u.ownerWindowId&&u.ownerWindowId!==gt;if(!d&&!u.minimized)continue;const g=Ft(u.root);s.push({projectId:M,groupId:u.id,sessionIds:g,titles:r,colorProjectId:((h=A.sessionProjects)==null?void 0:h[g[0]])??M,kind:d?"popped":"minimized",ownerWindowId:d?u.ownerWindowId:void 0})}}catch{}}}catch{}return s.sort((w,S)=>w.projectId.localeCompare(S.projectId)||w.groupId.localeCompare(S.groupId)),s}function Wx(s,h){try{const w=Mo+s,S=localStorage.getItem(w);if(!S)return;const M=JSON.parse(S);if(!Array.isArray(M.groups))return;M.groups=M.groups.map(O=>O.id===h?{...O,ownerWindowId:gt}:O),localStorage.setItem(w,JSON.stringify(M))}catch{}}function qx(s){const h=s.match(/^\/projects\/([^/]+)/);return h?h[1]:null}const Gx=new Set;function Yx({onEvent:s}){const{t:h}=Tt(),{sendNotification:w}=Ll(),S=xl(),M=ss(),[O,A]=j.useState(()=>yg()),[r,u]=j.useState({}),d=qx(M.pathname),g=j.useCallback(()=>A(yg()),[]),l=j.useRef(null);j.useEffect(()=>{const $=Bh();return l.current=$,()=>{$.close(),l.current=null}},[]);const[m,b]=j.useState(()=>Fx()),C=j.useRef(null),p=j.useMemo(()=>{const $=U=>{const T=m.indexOf(U);return T===-1?Number.MAX_SAFE_INTEGER:T};return[...O].sort((U,T)=>$(dr(U))-$(dr(T)))},[O,m]),o=j.useCallback($=>{const U=C.current;if(C.current=null,!U||U===$)return;const T=p.map(dr),F=T.indexOf(U),B=T.indexOf($);F<0||B<0||(T.splice(B,0,T.splice(F,1)[0]),b(T),Ux(T))},[p]),c=j.useRef(null),a=j.useRef($x()),f=j.useRef(null),[y,R]=j.useState(()=>a.current),k=j.useCallback($=>{const U=c.current;if(U){$.preventDefault(),f.current={startX:$.clientX,startLeft:U.getBoundingClientRect().left};try{$.currentTarget.setPointerCapture($.pointerId)}catch{}}},[]),D=j.useCallback($=>{var W;const U=f.current;if(!U)return;const T=((W=c.current)==null?void 0:W.offsetWidth)??200,F=Math.max(8,window.innerWidth-T-8),B=Math.max(8,Math.min(U.startLeft+($.clientX-U.startX),F));a.current=B,R(B)},[]),E=j.useCallback($=>{if(f.current){f.current=null;try{$.currentTarget.releasePointerCapture($.pointerId)}catch{}a.current!==null&&bg(a.current)}},[]);j.useEffect(()=>{const $=()=>R(U=>{var B;if(U===null)return U;const T=((B=c.current)==null?void 0:B.offsetWidth)??200,F=Math.max(8,Math.min(U,window.innerWidth-T-8));return F!==U&&(a.current=F,bg(F)),F});return window.addEventListener("resize",$),()=>window.removeEventListener("resize",$)},[]),j.useEffect(()=>{const $=()=>Bv().then(U=>{const T={};for(const F of U)T[F.id]=F;u(T)}).catch(()=>{});return $(),window.addEventListener("projects:changed",$),()=>window.removeEventListener("projects:changed",$)},[]),j.useEffect(()=>{const $=T=>{(T.key===null||T.key.startsWith(Mo))&&g()},U=()=>g();return window.addEventListener("storage",$),window.addEventListener("session-windows:changed",U),()=>{window.removeEventListener("storage",$),window.removeEventListener("session-windows:changed",U)}},[g]),j.useEffect(()=>{g()},[M.pathname,g]);const L=j.useRef(O);L.current=O;const{states:z,attention:H}=Ph(s,Gx,($,U)=>{const T=L.current.find(F=>F.kind==="minimized"&&F.sessionIds.includes($));T&&w(h(U==="blocked"?"notification.sessionBlocked":"notification.sessionDone"),T.titles[$]||$,()=>I(T,$))}),P=j.useRef(new Map);j.useEffect(()=>{if(!zh())return;const $=async()=>{const T=L.current.filter(Z=>Z.kind==="popped"&&!!Z.ownerWindowId&&Z.projectId!==d);if(T.length===0){P.current.clear();return}const F=await s_(),B=Date.now();let W=!1;for(const Z of T){const ne=Z.ownerWindowId;if(F.has(ne)){P.current.delete(ne);continue}const ge=P.current.get(ne);if(ge===void 0){P.current.set(ne,B);continue}B-ge<Zv||(P.current.delete(ne),Wx(Z.projectId,Z.groupId),W=!0)}W&&g()},U=setInterval(()=>{$()},Nh);return()=>clearInterval(U)},[d,g]);const I=($,U)=>{var T;if($.kind==="popped"){$.ownerWindowId&&(Ox($.ownerWindowId),(T=l.current)==null||T.post({t:"group-focus",popoutId:$.ownerWindowId,groupId:$.groupId}));return}if($.projectId===d){window.dispatchEvent(new CustomEvent("session-windows:restore",{detail:{projectId:$.projectId,groupId:$.groupId,sessionId:U}}));return}try{sessionStorage.setItem(Px,JSON.stringify({projectId:$.projectId,groupId:$.groupId,sessionId:U}))}catch{}S(`/projects/${$.projectId}`)},K=$=>{if($.projectId===d){window.dispatchEvent(new CustomEvent("session-windows:recall",{detail:{projectId:$.projectId,groupId:$.groupId}}));return}try{sessionStorage.setItem(Ix,JSON.stringify({projectId:$.projectId,groupId:$.groupId}))}catch{}S(`/projects/${$.projectId}`)},X=$=>{if($.projectId===d){window.dispatchEvent(new CustomEvent("session-windows:close",{detail:{projectId:$.projectId,groupId:$.groupId}}));return}try{const U=Mo+$.projectId,T=localStorage.getItem(U);if(T){const F=JSON.parse(T);Array.isArray(F.groups)&&(F.groups=F.groups.filter(B=>B.id!==$.groupId),localStorage.setItem(U,JSON.stringify(F)))}}catch{}g()},Y=y!==null;return O.length===0?null:zi.createPortal(v.jsxs("div",{ref:c,className:Y?"fixed bottom-2":"fixed bottom-2 left-2 md:left-[248px] max-w-[calc(100vw-16px)] md:max-w-[calc(100vw-256px)]",style:{display:"flex",alignItems:"center",gap:6,zIndex:900,flexWrap:"wrap",...Y?{left:y,maxWidth:`calc(100vw - ${Math.round(y)+8}px)`}:{}},children:[v.jsx("div",{onPointerDown:k,onPointerMove:D,onPointerUp:E,"aria-label":"move dock",style:{display:"flex",alignItems:"center",flexShrink:0,color:Ce.titleText,cursor:"grab",padding:2,touchAction:"none"},children:v.jsx(R1,{size:14})}),p.map($=>{const U=$.sessionIds.map(ne=>$.titles[ne]||ne),T=U.length===1?U[0]:`${U[0]} +${U.length-1}`,F=$.projectId!==d,B=$.kind==="popped",W=B?void 0:$.sessionIds.find(ne=>H.has(ne)),Z=W?z[W]:void 0;return v.jsxs("div",{draggable:!0,onDragStart:ne=>{C.current=dr($),ne.dataTransfer.effectAllowed="move"},onDragOver:ne=>{C.current&&C.current!==dr($)&&ne.preventDefault()},onDrop:ne=>{ne.preventDefault(),o(dr($))},onDragEnd:()=>{C.current=null},onClick:()=>I($),title:`${F?`[${$.projectId}] `:""}${U.join(" · ")}${B?` — ${h("session.dock.poppedHint")}`:""}${Z?` — ${Z}`:""}`,style:{display:"flex",alignItems:"center",gap:6,background:Ce.titleBg,border:B?"1px solid rgba(139,92,246,0.7)":`1px solid ${Ce.separator}`,opacity:F?.75:1,borderRadius:6,padding:"4px 6px 4px 4px",fontFamily:_t,fontSize:12,color:Ce.titleText,cursor:"pointer",boxShadow:"0 4px 12px rgba(0,0,0,0.35)",maxWidth:240,userSelect:"none"},children:[v.jsx("div",{style:{height:12,width:12,borderRadius:3,flexShrink:0,background:r[$.colorProjectId]?To(r[$.colorProjectId]):To({id:$.colorProjectId})}}),B&&v.jsx(_r,{size:12,style:{flexShrink:0,color:"rgb(167,139,250)"}}),Z&&v.jsx("span",{"aria-label":Z,style:{width:7,height:7,borderRadius:"50%",flexShrink:0,background:Z==="blocked"?Ce.warning:Ce.info}}),v.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1},children:T}),B&&v.jsx("button",{onClick:ne=>{ne.stopPropagation(),K($)},"aria-label":"recall",title:h("session.recallToMain"),style:{background:"transparent",border:"none",color:"rgb(167,139,250)",cursor:"pointer",padding:2,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:3},children:v.jsx(El,{size:12})}),v.jsx("button",{onClick:ne=>{ne.stopPropagation(),X($)},"aria-label":"close",style:{background:"transparent",border:"none",color:Ce.titleText,cursor:"pointer",padding:2,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:3},children:v.jsx(Ri,{size:12})})]},`${$.projectId}:${$.groupId}`)})]}),document.body)}var Ku={exports:{}},wg;function Kx(){return wg||(wg=1,(function(s,h){(function(w,S){s.exports=S()})(globalThis,(()=>(()=>{var w={4567:function(A,r,u){var d=this&&this.__decorate||function(a,f,y,R){var k,D=arguments.length,E=D<3?f:R===null?R=Object.getOwnPropertyDescriptor(f,y):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(a,f,y,R);else for(var L=a.length-1;L>=0;L--)(k=a[L])&&(E=(D<3?k(E):D>3?k(f,y,E):k(f,y))||E);return D>3&&E&&Object.defineProperty(f,y,E),E},g=this&&this.__param||function(a,f){return function(y,R){f(y,R,a)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;const l=u(9042),m=u(9924),b=u(844),C=u(4725),p=u(2585),o=u(3656);let c=r.AccessibilityManager=class extends b.Disposable{constructor(a,f,y,R){super(),this._terminal=a,this._coreBrowserService=y,this._renderService=R,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let k=0;k<this._terminal.rows;k++)this._rowElements[k]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[k]);if(this._topBoundaryFocusListener=k=>this._handleBoundaryFocus(k,0),this._bottomBoundaryFocusListener=k=>this._handleBoundaryFocus(k,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new m.TimeBasedDebouncer(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((k=>this._handleResize(k.rows)))),this.register(this._terminal.onRender((k=>this._refreshRows(k.start,k.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((k=>this._handleChar(k)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
409
|
+
`)))),this.register(this._terminal.onA11yTab((k=>this._handleTab(k)))),this.register(this._terminal.onKey((k=>this._handleKey(k.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,o.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,b.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(a){for(let f=0;f<a;f++)this._handleChar(" ")}_handleChar(a){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==a&&(this._charsToAnnounce+=a):this._charsToAnnounce+=a,a===`
|
|
410
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=l.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(a){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(a)||this._charsToConsume.push(a)}_refreshRows(a,f){this._liveRegionDebouncer.refresh(a,f,this._terminal.rows)}_renderRows(a,f){const y=this._terminal.buffer,R=y.lines.length.toString();for(let k=a;k<=f;k++){const D=y.lines.get(y.ydisp+k),E=[],L=(D==null?void 0:D.translateToString(!0,void 0,void 0,E))||"",z=(y.ydisp+k+1).toString(),H=this._rowElements[k];H&&(L.length===0?(H.innerText=" ",this._rowColumns.set(H,[0,1])):(H.textContent=L,this._rowColumns.set(H,E)),H.setAttribute("aria-posinset",z),H.setAttribute("aria-setsize",R))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(a,f){const y=a.target,R=this._rowElements[f===0?1:this._rowElements.length-2];if(y.getAttribute("aria-posinset")===(f===0?"1":`${this._terminal.buffer.lines.length}`)||a.relatedTarget!==R)return;let k,D;if(f===0?(k=y,D=this._rowElements.pop(),this._rowContainer.removeChild(D)):(k=this._rowElements.shift(),D=y,this._rowContainer.removeChild(k)),k.removeEventListener("focus",this._topBoundaryFocusListener),D.removeEventListener("focus",this._bottomBoundaryFocusListener),f===0){const E=this._createAccessibilityTreeNode();this._rowElements.unshift(E),this._rowContainer.insertAdjacentElement("afterbegin",E)}else{const E=this._createAccessibilityTreeNode();this._rowElements.push(E),this._rowContainer.appendChild(E)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(f===0?-1:1),this._rowElements[f===0?1:this._rowElements.length-2].focus(),a.preventDefault(),a.stopImmediatePropagation()}_handleSelectionChange(){var L;if(this._rowElements.length===0)return;const a=document.getSelection();if(!a)return;if(a.isCollapsed)return void(this._rowContainer.contains(a.anchorNode)&&this._terminal.clearSelection());if(!a.anchorNode||!a.focusNode)return void console.error("anchorNode and/or focusNode are null");let f={node:a.anchorNode,offset:a.anchorOffset},y={node:a.focusNode,offset:a.focusOffset};if((f.node.compareDocumentPosition(y.node)&Node.DOCUMENT_POSITION_PRECEDING||f.node===y.node&&f.offset>y.offset)&&([f,y]=[y,f]),f.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(f={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(f.node))return;const R=this._rowElements.slice(-1)[0];if(y.node.compareDocumentPosition(R)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(y={node:R,offset:((L=R.textContent)==null?void 0:L.length)??0}),!this._rowContainer.contains(y.node))return;const k=({node:z,offset:H})=>{const P=z instanceof Text?z.parentNode:z;let I=parseInt(P==null?void 0:P.getAttribute("aria-posinset"),10)-1;if(isNaN(I))return console.warn("row is invalid. Race condition?"),null;const K=this._rowColumns.get(P);if(!K)return console.warn("columns is null. Race condition?"),null;let X=H<K.length?K[H]:K.slice(-1)[0]+1;return X>=this._terminal.cols&&(++I,X=0),{row:I,column:X}},D=k(f),E=k(y);if(D&&E){if(D.row>E.row||D.row===E.row&&D.column>=E.column)throw new Error("invalid range");this._terminal.select(D.column,D.row,(E.row-D.row)*this._terminal.cols-D.column+E.column)}}_handleResize(a){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let f=this._rowContainer.children.length;f<this._terminal.rows;f++)this._rowElements[f]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[f]);for(;this._rowElements.length>a;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const a=this._coreBrowserService.mainDocument.createElement("div");return a.setAttribute("role","listitem"),a.tabIndex=-1,this._refreshRowDimensions(a),a}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let a=0;a<this._terminal.rows;a++)this._refreshRowDimensions(this._rowElements[a])}}_refreshRowDimensions(a){a.style.height=`${this._renderService.dimensions.css.cell.height}px`}};r.AccessibilityManager=c=d([g(1,p.IInstantiationService),g(2,C.ICoreBrowserService),g(3,C.IRenderService)],c)},3614:(A,r)=>{function u(m){return m.replace(/\r?\n/g,"\r")}function d(m,b){return b?"\x1B[200~"+m+"\x1B[201~":m}function g(m,b,C,p){m=d(m=u(m),C.decPrivateModes.bracketedPasteMode&&p.rawOptions.ignoreBracketedPasteMode!==!0),C.triggerDataEvent(m,!0),b.value=""}function l(m,b,C){const p=C.getBoundingClientRect(),o=m.clientX-p.left-10,c=m.clientY-p.top-10;b.style.width="20px",b.style.height="20px",b.style.left=`${o}px`,b.style.top=`${c}px`,b.style.zIndex="1000",b.focus()}Object.defineProperty(r,"__esModule",{value:!0}),r.rightClickHandler=r.moveTextAreaUnderMouseCursor=r.paste=r.handlePasteEvent=r.copyHandler=r.bracketTextForPaste=r.prepareTextForTerminal=void 0,r.prepareTextForTerminal=u,r.bracketTextForPaste=d,r.copyHandler=function(m,b){m.clipboardData&&m.clipboardData.setData("text/plain",b.selectionText),m.preventDefault()},r.handlePasteEvent=function(m,b,C,p){m.stopPropagation(),m.clipboardData&&g(m.clipboardData.getData("text/plain"),b,C,p)},r.paste=g,r.moveTextAreaUnderMouseCursor=l,r.rightClickHandler=function(m,b,C,p,o){l(m,b,C),o&&p.rightClickSelect(m),b.value=p.selectionText,b.select()}},7239:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorContrastCache=void 0;const d=u(1505);r.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(g,l,m){this._css.set(g,l,m)}getCss(g,l){return this._css.get(g,l)}setColor(g,l,m){this._color.set(g,l,m)}getColor(g,l){return this._color.get(g,l)}clear(){this._color.clear(),this._css.clear()}}},3656:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(u,d,g,l){u.addEventListener(d,g,l);let m=!1;return{dispose:()=>{m||(m=!0,u.removeEventListener(d,g,l))}}}},3551:function(A,r,u){var d=this&&this.__decorate||function(c,a,f,y){var R,k=arguments.length,D=k<3?a:y===null?y=Object.getOwnPropertyDescriptor(a,f):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(c,a,f,y);else for(var E=c.length-1;E>=0;E--)(R=c[E])&&(D=(k<3?R(D):k>3?R(a,f,D):R(a,f))||D);return k>3&&D&&Object.defineProperty(a,f,D),D},g=this&&this.__param||function(c,a){return function(f,y){a(f,y,c)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Linkifier=void 0;const l=u(3656),m=u(8460),b=u(844),C=u(2585),p=u(4725);let o=r.Linkifier=class extends b.Disposable{get currentLink(){return this._currentLink}constructor(c,a,f,y,R){super(),this._element=c,this._mouseService=a,this._renderService=f,this._bufferService=y,this._linkProviderService=R,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new m.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new m.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,b.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,b.toDisposable)((()=>{var k;this._lastMouseEvent=void 0,(k=this._activeProviderReplies)==null||k.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,l.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,l.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,l.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,l.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(c){this._lastMouseEvent=c;const a=this._positionFromMouseEvent(c,this._element,this._mouseService);if(!a)return;this._isMouseOut=!1;const f=c.composedPath();for(let y=0;y<f.length;y++){const R=f[y];if(R.classList.contains("xterm"))break;if(R.classList.contains("xterm-hover"))return}this._lastBufferCell&&a.x===this._lastBufferCell.x&&a.y===this._lastBufferCell.y||(this._handleHover(a),this._lastBufferCell=a)}_handleHover(c){if(this._activeLine!==c.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(c,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,c)||(this._clearCurrentLink(),this._askForLink(c,!0))}_askForLink(c,a){var y,R;this._activeProviderReplies&&a||((y=this._activeProviderReplies)==null||y.forEach((k=>{k==null||k.forEach((D=>{D.link.dispose&&D.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=c.y);let f=!1;for(const[k,D]of this._linkProviderService.linkProviders.entries())a?(R=this._activeProviderReplies)!=null&&R.get(k)&&(f=this._checkLinkProviderResult(k,c,f)):D.provideLinks(c.y,(E=>{var z,H;if(this._isMouseOut)return;const L=E==null?void 0:E.map((P=>({link:P})));(z=this._activeProviderReplies)==null||z.set(k,L),f=this._checkLinkProviderResult(k,c,f),((H=this._activeProviderReplies)==null?void 0:H.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(c.y,this._activeProviderReplies)}))}_removeIntersectingLinks(c,a){const f=new Set;for(let y=0;y<a.size;y++){const R=a.get(y);if(R)for(let k=0;k<R.length;k++){const D=R[k],E=D.link.range.start.y<c?0:D.link.range.start.x,L=D.link.range.end.y>c?this._bufferService.cols:D.link.range.end.x;for(let z=E;z<=L;z++){if(f.has(z)){R.splice(k--,1);break}f.add(z)}}}}_checkLinkProviderResult(c,a,f){var k;if(!this._activeProviderReplies)return f;const y=this._activeProviderReplies.get(c);let R=!1;for(let D=0;D<c;D++)this._activeProviderReplies.has(D)&&!this._activeProviderReplies.get(D)||(R=!0);if(!R&&y){const D=y.find((E=>this._linkAtPosition(E.link,a)));D&&(f=!0,this._handleNewLink(D))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!f)for(let D=0;D<this._activeProviderReplies.size;D++){const E=(k=this._activeProviderReplies.get(D))==null?void 0:k.find((L=>this._linkAtPosition(L.link,a)));if(E){f=!0,this._handleNewLink(E);break}}return f}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(c){if(!this._currentLink)return;const a=this._positionFromMouseEvent(c,this._element,this._mouseService);a&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,a)&&this._currentLink.link.activate(c,this._currentLink.link.text)}_clearCurrentLink(c,a){this._currentLink&&this._lastMouseEvent&&(!c||!a||this._currentLink.link.range.start.y>=c&&this._currentLink.link.range.end.y<=a)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,b.disposeArray)(this._linkCacheDisposables))}_handleNewLink(c){if(!this._lastMouseEvent)return;const a=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);a&&this._linkAtPosition(c.link,a)&&(this._currentLink=c,this._currentLink.state={decorations:{underline:c.link.decorations===void 0||c.link.decorations.underline,pointerCursor:c.link.decorations===void 0||c.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,c.link,this._lastMouseEvent),c.link.decorations={},Object.defineProperties(c.link.decorations,{pointerCursor:{get:()=>{var f,y;return(y=(f=this._currentLink)==null?void 0:f.state)==null?void 0:y.decorations.pointerCursor},set:f=>{var y;(y=this._currentLink)!=null&&y.state&&this._currentLink.state.decorations.pointerCursor!==f&&(this._currentLink.state.decorations.pointerCursor=f,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",f))}},underline:{get:()=>{var f,y;return(y=(f=this._currentLink)==null?void 0:f.state)==null?void 0:y.decorations.underline},set:f=>{var y,R,k;(y=this._currentLink)!=null&&y.state&&((k=(R=this._currentLink)==null?void 0:R.state)==null?void 0:k.decorations.underline)!==f&&(this._currentLink.state.decorations.underline=f,this._currentLink.state.isHovered&&this._fireUnderlineEvent(c.link,f))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((f=>{if(!this._currentLink)return;const y=f.start===0?0:f.start+1+this._bufferService.buffer.ydisp,R=this._bufferService.buffer.ydisp+1+f.end;if(this._currentLink.link.range.start.y>=y&&this._currentLink.link.range.end.y<=R&&(this._clearCurrentLink(y,R),this._lastMouseEvent)){const k=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);k&&this._askForLink(k,!1)}}))))}_linkHover(c,a,f){var y;(y=this._currentLink)!=null&&y.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(a,!0),this._currentLink.state.decorations.pointerCursor&&c.classList.add("xterm-cursor-pointer")),a.hover&&a.hover(f,a.text)}_fireUnderlineEvent(c,a){const f=c.range,y=this._bufferService.buffer.ydisp,R=this._createLinkUnderlineEvent(f.start.x-1,f.start.y-y-1,f.end.x,f.end.y-y-1,void 0);(a?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(R)}_linkLeave(c,a,f){var y;(y=this._currentLink)!=null&&y.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(a,!1),this._currentLink.state.decorations.pointerCursor&&c.classList.remove("xterm-cursor-pointer")),a.leave&&a.leave(f,a.text)}_linkAtPosition(c,a){const f=c.range.start.y*this._bufferService.cols+c.range.start.x,y=c.range.end.y*this._bufferService.cols+c.range.end.x,R=a.y*this._bufferService.cols+a.x;return f<=R&&R<=y}_positionFromMouseEvent(c,a,f){const y=f.getCoords(c,a,this._bufferService.cols,this._bufferService.rows);if(y)return{x:y[0],y:y[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(c,a,f,y,R){return{x1:c,y1:a,x2:f,y2:y,cols:this._bufferService.cols,fg:R}}};r.Linkifier=o=d([g(1,p.IMouseService),g(2,p.IRenderService),g(3,C.IBufferService),g(4,p.ILinkProviderService)],o)},9042:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tooMuchOutput=r.promptLabel=void 0,r.promptLabel="Terminal input",r.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(A,r,u){var d=this&&this.__decorate||function(p,o,c,a){var f,y=arguments.length,R=y<3?o:a===null?a=Object.getOwnPropertyDescriptor(o,c):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(p,o,c,a);else for(var k=p.length-1;k>=0;k--)(f=p[k])&&(R=(y<3?f(R):y>3?f(o,c,R):f(o,c))||R);return y>3&&R&&Object.defineProperty(o,c,R),R},g=this&&this.__param||function(p,o){return function(c,a){o(c,a,p)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkProvider=void 0;const l=u(511),m=u(2585);let b=r.OscLinkProvider=class{constructor(p,o,c){this._bufferService=p,this._optionsService=o,this._oscLinkService=c}provideLinks(p,o){var L;const c=this._bufferService.buffer.lines.get(p-1);if(!c)return void o(void 0);const a=[],f=this._optionsService.rawOptions.linkHandler,y=new l.CellData,R=c.getTrimmedLength();let k=-1,D=-1,E=!1;for(let z=0;z<R;z++)if(D!==-1||c.hasContent(z)){if(c.loadCell(z,y),y.hasExtendedAttrs()&&y.extended.urlId){if(D===-1){D=z,k=y.extended.urlId;continue}E=y.extended.urlId!==k}else D!==-1&&(E=!0);if(E||D!==-1&&z===R-1){const H=(L=this._oscLinkService.getLinkData(k))==null?void 0:L.uri;if(H){const P={start:{x:D+1,y:p},end:{x:z+(E||z!==R-1?0:1),y:p}};let I=!1;if(!(f!=null&&f.allowNonHttpProtocols))try{const K=new URL(H);["http:","https:"].includes(K.protocol)||(I=!0)}catch{I=!0}I||a.push({text:H,range:P,activate:(K,X)=>f?f.activate(K,X,P):C(0,X),hover:(K,X)=>{var Y;return(Y=f==null?void 0:f.hover)==null?void 0:Y.call(f,K,X,P)},leave:(K,X)=>{var Y;return(Y=f==null?void 0:f.leave)==null?void 0:Y.call(f,K,X,P)}})}E=!1,y.hasExtendedAttrs()&&y.extended.urlId?(D=z,k=y.extended.urlId):(D=-1,k=-1)}}o(a)}};function C(p,o){if(confirm(`Do you want to navigate to ${o}?
|
|
411
|
+
|
|
412
|
+
WARNING: This link could potentially be dangerous`)){const c=window.open();if(c){try{c.opener=null}catch{}c.location.href=o}else console.warn("Opening link blocked as opener could not be cleared")}}r.OscLinkProvider=b=d([g(0,m.IBufferService),g(1,m.IOptionsService),g(2,m.IOscLinkService)],b)},6193:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RenderDebouncer=void 0,r.RenderDebouncer=class{constructor(u,d){this._renderCallback=u,this._coreBrowserService=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(u,d,g){this._rowCount=g,u=u!==void 0?u:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d,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)return void this._runRefreshCallbacks();const u=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Terminal=void 0;const d=u(3614),g=u(3656),l=u(3551),m=u(9042),b=u(3730),C=u(1680),p=u(3107),o=u(5744),c=u(2950),a=u(1296),f=u(428),y=u(4269),R=u(5114),k=u(8934),D=u(3230),E=u(9312),L=u(4725),z=u(6731),H=u(8055),P=u(8969),I=u(8460),K=u(844),X=u(6114),Y=u(8437),$=u(2584),U=u(7399),T=u(5941),F=u(9074),B=u(2585),W=u(5435),Z=u(4567),ne=u(779);class ge extends P.CoreTerminal{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}constructor(J={}){super(J),this.browser=X,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new K.MutableDisposable),this._onCursorMove=this.register(new I.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new I.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new I.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new I.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new I.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new I.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new I.EventEmitter),this._onBlur=this.register(new I.EventEmitter),this._onA11yCharEmitter=this.register(new I.EventEmitter),this._onA11yTabEmitter=this.register(new I.EventEmitter),this._onWillOpen=this.register(new I.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(F.DecorationService),this._instantiationService.setService(B.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ne.LinkProviderService),this._instantiationService.setService(L.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(b.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((G,de)=>this.refresh(G,de)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((G=>this._reportWindowsOptions(G)))),this.register(this._inputHandler.onColor((G=>this._handleColorEvent(G)))),this.register((0,I.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,I.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,I.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,I.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((G=>this._afterResize(G.cols,G.rows)))),this.register((0,K.toDisposable)((()=>{var G,de;this._customKeyEventHandler=void 0,(de=(G=this.element)==null?void 0:G.parentNode)==null||de.removeChild(this.element)})))}_handleColorEvent(J){if(this._themeService)for(const G of J){let de,oe="";switch(G.index){case 256:de="foreground",oe="10";break;case 257:de="background",oe="11";break;case 258:de="cursor",oe="12";break;default:de="ansi",oe="4;"+G.index}switch(G.type){case 0:const Ae=H.color.toColorRGB(de==="ansi"?this._themeService.colors.ansi[G.index]:this._themeService.colors[de]);this.coreService.triggerDataEvent(`${$.C0.ESC}]${oe};${(0,T.toRgbString)(Ae)}${$.C1_ESCAPED.ST}`);break;case 1:if(de==="ansi")this._themeService.modifyColors((Oe=>Oe.ansi[G.index]=H.channels.toColor(...G.color)));else{const Oe=de;this._themeService.modifyColors((Xe=>Xe[Oe]=H.channels.toColor(...G.color)))}break;case 2:this._themeService.restoreColor(G.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(J){J?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Z.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(J){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent($.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var J;return(J=this.textarea)==null?void 0:J.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent($.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const J=this.buffer.ybase+this.buffer.y,G=this.buffer.lines.get(J);if(!G)return;const de=Math.min(this.buffer.x,this.cols-1),oe=this._renderService.dimensions.css.cell.height,Ae=G.getWidth(de),Oe=this._renderService.dimensions.css.cell.width*Ae,Xe=this.buffer.y*this._renderService.dimensions.css.cell.height,We=de*this._renderService.dimensions.css.cell.width;this.textarea.style.left=We+"px",this.textarea.style.top=Xe+"px",this.textarea.style.width=Oe+"px",this.textarea.style.height=oe+"px",this.textarea.style.lineHeight=oe+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,g.addDisposableDomListener)(this.element,"copy",(G=>{this.hasSelection()&&(0,d.copyHandler)(G,this._selectionService)})));const J=G=>(0,d.handlePasteEvent)(G,this.textarea,this.coreService,this.optionsService);this.register((0,g.addDisposableDomListener)(this.textarea,"paste",J)),this.register((0,g.addDisposableDomListener)(this.element,"paste",J)),X.isFirefox?this.register((0,g.addDisposableDomListener)(this.element,"mousedown",(G=>{G.button===2&&(0,d.rightClickHandler)(G,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,g.addDisposableDomListener)(this.element,"contextmenu",(G=>{(0,d.rightClickHandler)(G,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),X.isLinux&&this.register((0,g.addDisposableDomListener)(this.element,"auxclick",(G=>{G.button===1&&(0,d.moveTextAreaUnderMouseCursor)(G,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,g.addDisposableDomListener)(this.textarea,"keyup",(J=>this._keyUp(J)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keydown",(J=>this._keyDown(J)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keypress",(J=>this._keyPress(J)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionupdate",(J=>this._compositionHelper.compositionupdate(J)))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,g.addDisposableDomListener)(this.textarea,"input",(J=>this._inputEvent(J)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(J){var de;if(!J)throw new Error("Terminal requires a parent element.");if(J.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((de=this.element)==null?void 0:de.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=J.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"),J.appendChild(this.element);const G=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),G.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,g.addDisposableDomListener)(this.screenElement,"mousemove",(oe=>this.updateCursorStyle(oe)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),G.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",m.promptLabel),X.isChromeOS||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._coreBrowserService=this.register(this._instantiationService.createInstance(R.CoreBrowserService,this.textarea,J.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(L.ICoreBrowserService,this._coreBrowserService),this.register((0,g.addDisposableDomListener)(this.textarea,"focus",(oe=>this._handleTextAreaFocus(oe)))),this.register((0,g.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(f.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(L.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(z.ThemeService),this._instantiationService.setService(L.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(y.CharacterJoinerService),this._instantiationService.setService(L.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(D.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(L.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((oe=>this._onRender.fire(oe)))),this.onResize((oe=>this._renderService.resize(oe.cols,oe.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(c.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(k.MouseService),this._instantiationService.setService(L.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(l.Linkifier,this.screenElement)),this.element.appendChild(G);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(C.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),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.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(E.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(L.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((oe=>this._renderService.handleSelectionChanged(oe.start,oe.end,oe.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((oe=>{this.textarea.value=oe,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((oe=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,g.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(p.BufferDecorationRenderer,this.screenElement)),this.register((0,g.addDisposableDomListener)(this.element,"mousedown",(oe=>this._selectionService.handleMouseDown(oe)))),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(Z.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(oe=>this._handleScreenReaderModeOptionChange(oe)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(o.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(oe=>{!this._overviewRulerRenderer&&oe&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(o.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(a.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const J=this,G=this.element;function de(Oe){const Xe=J._mouseService.getMouseReportCoords(Oe,J.screenElement);if(!Xe)return!1;let We,rt;switch(Oe.overrideType||Oe.type){case"mousemove":rt=32,Oe.buttons===void 0?(We=3,Oe.button!==void 0&&(We=Oe.button<3?Oe.button:3)):We=1&Oe.buttons?0:4&Oe.buttons?1:2&Oe.buttons?2:3;break;case"mouseup":rt=0,We=Oe.button<3?Oe.button:3;break;case"mousedown":rt=1,We=Oe.button<3?Oe.button:3;break;case"wheel":if(J._customWheelEventHandler&&J._customWheelEventHandler(Oe)===!1||J.viewport.getLinesScrolled(Oe)===0)return!1;rt=Oe.deltaY<0?0:1,We=4;break;default:return!1}return!(rt===void 0||We===void 0||We>4)&&J.coreMouseService.triggerMouseEvent({col:Xe.col,row:Xe.row,x:Xe.x,y:Xe.y,button:We,action:rt,ctrl:Oe.ctrlKey,alt:Oe.altKey,shift:Oe.shiftKey})}const oe={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Ae={mouseup:Oe=>(de(Oe),Oe.buttons||(this._document.removeEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.removeEventListener("mousemove",oe.mousedrag)),this.cancel(Oe)),wheel:Oe=>(de(Oe),this.cancel(Oe,!0)),mousedrag:Oe=>{Oe.buttons&&de(Oe)},mousemove:Oe=>{Oe.buttons||de(Oe)}};this.register(this.coreMouseService.onProtocolChange((Oe=>{Oe?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(Oe)),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()),8&Oe?oe.mousemove||(G.addEventListener("mousemove",Ae.mousemove),oe.mousemove=Ae.mousemove):(G.removeEventListener("mousemove",oe.mousemove),oe.mousemove=null),16&Oe?oe.wheel||(G.addEventListener("wheel",Ae.wheel,{passive:!1}),oe.wheel=Ae.wheel):(G.removeEventListener("wheel",oe.wheel),oe.wheel=null),2&Oe?oe.mouseup||(oe.mouseup=Ae.mouseup):(this._document.removeEventListener("mouseup",oe.mouseup),oe.mouseup=null),4&Oe?oe.mousedrag||(oe.mousedrag=Ae.mousedrag):(this._document.removeEventListener("mousemove",oe.mousedrag),oe.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,g.addDisposableDomListener)(G,"mousedown",(Oe=>{if(Oe.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(Oe))return de(Oe),oe.mouseup&&this._document.addEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.addEventListener("mousemove",oe.mousedrag),this.cancel(Oe)}))),this.register((0,g.addDisposableDomListener)(G,"wheel",(Oe=>{if(!oe.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(Oe)===!1)return!1;if(!this.buffer.hasScrollback){const Xe=this.viewport.getLinesScrolled(Oe);if(Xe===0)return;const We=$.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Oe.deltaY<0?"A":"B");let rt="";for(let ye=0;ye<Math.abs(Xe);ye++)rt+=We;return this.coreService.triggerDataEvent(rt,!0),this.cancel(Oe,!0)}return this.viewport.handleWheel(Oe)?this.cancel(Oe):void 0}}),{passive:!1})),this.register((0,g.addDisposableDomListener)(G,"touchstart",(Oe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(Oe),this.cancel(Oe)}),{passive:!0})),this.register((0,g.addDisposableDomListener)(G,"touchmove",(Oe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(Oe)?void 0:this.cancel(Oe)}),{passive:!1}))}refresh(J,G){var de;(de=this._renderService)==null||de.refreshRows(J,G)}updateCursorStyle(J){var G;(G=this._selectionService)!=null&&G.shouldColumnSelect(J)?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(J,G,de=0){var oe;de===1?(super.scrollLines(J,G,de),this.refresh(0,this.rows-1)):(oe=this.viewport)==null||oe.scrollLines(J)}paste(J){(0,d.paste)(J,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(J){this._customKeyEventHandler=J}attachCustomWheelEventHandler(J){this._customWheelEventHandler=J}registerLinkProvider(J){return this._linkProviderService.registerLinkProvider(J)}registerCharacterJoiner(J){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const G=this._characterJoinerService.register(J);return this.refresh(0,this.rows-1),G}deregisterCharacterJoiner(J){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(J)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(J){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+J)}registerDecoration(J){return this._decorationService.registerDecoration(J)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(J,G,de){this._selectionService.setSelection(J,G,de)}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(){var J;(J=this._selectionService)==null||J.clearSelection()}selectAll(){var J;(J=this._selectionService)==null||J.selectAll()}selectLines(J,G){var de;(de=this._selectionService)==null||de.selectLines(J,G)}_keyDown(J){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(J)===!1)return!1;const G=this.browser.isMac&&this.options.macOptionIsMeta&&J.altKey;if(!G&&!this._compositionHelper.keydown(J))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;G||J.key!=="Dead"&&J.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const de=(0,U.evaluateKeyboardEvent)(J,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(J),de.type===3||de.type===2){const oe=this.rows-1;return this.scrollLines(de.type===2?-oe:oe),this.cancel(J,!0)}return de.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,J)||(de.cancel&&this.cancel(J,!0),!de.key||!!(J.key&&!J.ctrlKey&&!J.altKey&&!J.metaKey&&J.key.length===1&&J.key.charCodeAt(0)>=65&&J.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(de.key!==$.C0.ETX&&de.key!==$.C0.CR||(this.textarea.value=""),this._onKey.fire({key:de.key,domEvent:J}),this._showCursor(),this.coreService.triggerDataEvent(de.key,!0),!this.optionsService.rawOptions.screenReaderMode||J.altKey||J.ctrlKey?this.cancel(J,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(J,G){const de=J.isMac&&!this.options.macOptionIsMeta&&G.altKey&&!G.ctrlKey&&!G.metaKey||J.isWindows&&G.altKey&&G.ctrlKey&&!G.metaKey||J.isWindows&&G.getModifierState("AltGraph");return G.type==="keypress"?de:de&&(!G.keyCode||G.keyCode>47)}_keyUp(J){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(J)===!1||((function(G){return G.keyCode===16||G.keyCode===17||G.keyCode===18})(J)||this.focus(),this.updateCursorStyle(J),this._keyPressHandled=!1)}_keyPress(J){let G;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(J)===!1)return!1;if(this.cancel(J),J.charCode)G=J.charCode;else if(J.which===null||J.which===void 0)G=J.keyCode;else{if(J.which===0||J.charCode===0)return!1;G=J.which}return!(!G||(J.altKey||J.ctrlKey||J.metaKey)&&!this._isThirdLevelShift(this.browser,J)||(G=String.fromCharCode(G),this._onKey.fire({key:G,domEvent:J}),this._showCursor(),this.coreService.triggerDataEvent(G,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(J){if(J.data&&J.inputType==="insertText"&&(!J.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const G=J.data;return this.coreService.triggerDataEvent(G,!0),this.cancel(J),!0}return!1}resize(J,G){J!==this.cols||G!==this.rows?super.resize(J,G):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(J,G){var de,oe;(de=this._charSizeService)==null||de.measure(),(oe=this.viewport)==null||oe.syncScrollArea(!0)}clear(){var J;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 G=1;G<this.rows;G++)this.buffer.lines.push(this.buffer.getBlankLine(Y.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(J=this.viewport)==null||J.reset(),this.refresh(0,this.rows-1)}}reset(){var G,de;this.options.rows=this.rows,this.options.cols=this.cols;const J=this._customKeyEventHandler;this._setup(),super.reset(),(G=this._selectionService)==null||G.reset(),this._decorationService.reset(),(de=this.viewport)==null||de.reset(),this._customKeyEventHandler=J,this.refresh(0,this.rows-1)}clearTextureAtlas(){var J;(J=this._renderService)==null||J.clearTextureAtlas()}_reportFocus(){var J;(J=this.element)!=null&&J.classList.contains("focus")?this.coreService.triggerDataEvent($.C0.ESC+"[I"):this.coreService.triggerDataEvent($.C0.ESC+"[O")}_reportWindowsOptions(J){if(this._renderService)switch(J){case W.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const G=this._renderService.dimensions.css.canvas.width.toFixed(0),de=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${$.C0.ESC}[4;${de};${G}t`);break;case W.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const oe=this._renderService.dimensions.css.cell.width.toFixed(0),Ae=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${$.C0.ESC}[6;${Ae};${oe}t`)}}cancel(J,G){if(this.options.cancelEvents||G)return J.preventDefault(),J.stopPropagation(),!1}}r.Terminal=ge},9924:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TimeBasedDebouncer=void 0,r.TimeBasedDebouncer=class{constructor(u,d=1e3){this._renderCallback=u,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,d,g){this._rowCount=g,u=u!==void 0?u:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d;const l=Date.now();if(l-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=l,this._innerRefresh();else if(!this._additionalRefreshRequested){const m=l-this._lastRefreshMs,b=this._debounceThresholdMS-m;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),b)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,d)}}},1680:function(A,r,u){var d=this&&this.__decorate||function(c,a,f,y){var R,k=arguments.length,D=k<3?a:y===null?y=Object.getOwnPropertyDescriptor(a,f):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(c,a,f,y);else for(var E=c.length-1;E>=0;E--)(R=c[E])&&(D=(k<3?R(D):k>3?R(a,f,D):R(a,f))||D);return k>3&&D&&Object.defineProperty(a,f,D),D},g=this&&this.__param||function(c,a){return function(f,y){a(f,y,c)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Viewport=void 0;const l=u(3656),m=u(4725),b=u(8460),C=u(844),p=u(2585);let o=r.Viewport=class extends C.Disposable{constructor(c,a,f,y,R,k,D,E){super(),this._viewportElement=c,this._scrollArea=a,this._bufferService=f,this._optionsService=y,this._charSizeService=R,this._renderService=k,this._coreBrowserService=D,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new b.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,l.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((L=>this._activeBuffer=L.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((L=>this._renderDimensions=L))),this._handleThemeChange(E.colors),this.register(E.onChangeColors((L=>this._handleThemeChange(L)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(c){this._viewportElement.style.backgroundColor=c.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(c){if(c)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const a=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==a&&(this._lastRecordedBufferHeight=a,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const c=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==c&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=c),this._refreshAnimationFrame=null}syncScrollArea(c=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(c);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(c)}_handleScroll(c){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const a=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:a,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const c=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(c*(this._smoothScrollState.target-this._smoothScrollState.origin)),c<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(c,a){const f=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(a<0&&this._viewportElement.scrollTop!==0||a>0&&f<this._lastRecordedBufferHeight)||(c.cancelable&&c.preventDefault(),!1)}handleWheel(c){const a=this._getPixelsScrolled(c);return a!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+a:this._smoothScrollState.target+=a,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=a,this._bubbleScroll(c,a))}scrollLines(c){if(c!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const a=c*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+a,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:c,suppressScrollEvent:!1})}_getPixelsScrolled(c){if(c.deltaY===0||c.shiftKey)return 0;let a=this._applyScrollModifier(c.deltaY,c);return c.deltaMode===WheelEvent.DOM_DELTA_LINE?a*=this._currentRowHeight:c.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(a*=this._currentRowHeight*this._bufferService.rows),a}getBufferElements(c,a){var E;let f,y="";const R=[],k=a??this._bufferService.buffer.lines.length,D=this._bufferService.buffer.lines;for(let L=c;L<k;L++){const z=D.get(L);if(!z)continue;const H=(E=D.get(L+1))==null?void 0:E.isWrapped;if(y+=z.translateToString(!H),!H||L===D.length-1){const P=document.createElement("div");P.textContent=y,R.push(P),y.length>0&&(f=P),y=""}}return{bufferElements:R,cursorElement:f}}getLinesScrolled(c){if(c.deltaY===0||c.shiftKey)return 0;let a=this._applyScrollModifier(c.deltaY,c);return c.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(a/=this._currentRowHeight+0,this._wheelPartialScroll+=a,a=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):c.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(a*=this._bufferService.rows),a}_applyScrollModifier(c,a){const f=this._optionsService.rawOptions.fastScrollModifier;return f==="alt"&&a.altKey||f==="ctrl"&&a.ctrlKey||f==="shift"&&a.shiftKey?c*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:c*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(c){this._lastTouchY=c.touches[0].pageY}handleTouchMove(c){const a=this._lastTouchY-c.touches[0].pageY;return this._lastTouchY=c.touches[0].pageY,a!==0&&(this._viewportElement.scrollTop+=a,this._bubbleScroll(c,a))}};r.Viewport=o=d([g(2,p.IBufferService),g(3,p.IOptionsService),g(4,m.ICharSizeService),g(5,m.IRenderService),g(6,m.ICoreBrowserService),g(7,m.IThemeService)],o)},3107:function(A,r,u){var d=this&&this.__decorate||function(p,o,c,a){var f,y=arguments.length,R=y<3?o:a===null?a=Object.getOwnPropertyDescriptor(o,c):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(p,o,c,a);else for(var k=p.length-1;k>=0;k--)(f=p[k])&&(R=(y<3?f(R):y>3?f(o,c,R):f(o,c))||R);return y>3&&R&&Object.defineProperty(o,c,R),R},g=this&&this.__param||function(p,o){return function(c,a){o(c,a,p)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferDecorationRenderer=void 0;const l=u(4725),m=u(844),b=u(2585);let C=r.BufferDecorationRenderer=class extends m.Disposable{constructor(p,o,c,a,f){super(),this._screenElement=p,this._bufferService=o,this._coreBrowserService=c,this._decorationService=a,this._renderService=f,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((y=>this._removeDecoration(y)))),this.register((0,m.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const p of this._decorationService.decorations)this._renderDecoration(p);this._dimensionsChanged=!1}_renderDecoration(p){this._refreshStyle(p),this._dimensionsChanged&&this._refreshXPosition(p)}_createElement(p){var a;const o=this._coreBrowserService.mainDocument.createElement("div");o.classList.add("xterm-decoration"),o.classList.toggle("xterm-decoration-top-layer",((a=p==null?void 0:p.options)==null?void 0:a.layer)==="top"),o.style.width=`${Math.round((p.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,o.style.height=(p.options.height||1)*this._renderService.dimensions.css.cell.height+"px",o.style.top=(p.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",o.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const c=p.options.x??0;return c&&c>this._bufferService.cols&&(o.style.display="none"),this._refreshXPosition(p,o),o}_refreshStyle(p){const o=p.marker.line-this._bufferService.buffers.active.ydisp;if(o<0||o>=this._bufferService.rows)p.element&&(p.element.style.display="none",p.onRenderEmitter.fire(p.element));else{let c=this._decorationElements.get(p);c||(c=this._createElement(p),p.element=c,this._decorationElements.set(p,c),this._container.appendChild(c),p.onDispose((()=>{this._decorationElements.delete(p),c.remove()}))),c.style.top=o*this._renderService.dimensions.css.cell.height+"px",c.style.display=this._altBufferIsActive?"none":"block",p.onRenderEmitter.fire(c)}}_refreshXPosition(p,o=p.element){if(!o)return;const c=p.options.x??0;(p.options.anchor||"left")==="right"?o.style.right=c?c*this._renderService.dimensions.css.cell.width+"px":"":o.style.left=c?c*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(p){var o;(o=this._decorationElements.get(p))==null||o.remove(),this._decorationElements.delete(p),p.dispose()}};r.BufferDecorationRenderer=C=d([g(1,b.IBufferService),g(2,l.ICoreBrowserService),g(3,b.IDecorationService),g(4,l.IRenderService)],C)},5871:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorZoneStore=void 0,r.ColorZoneStore=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(u){if(u.options.overviewRulerOptions){for(const d of this._zones)if(d.color===u.options.overviewRulerOptions.color&&d.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,u.marker.line))return;if(this._lineAdjacentToZone(d,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(d,u.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=u.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=u.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=u.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=u.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:u.options.overviewRulerOptions.color,position:u.options.overviewRulerOptions.position,startBufferLine:u.marker.line,endBufferLine:u.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(u){this._linePadding=u}_lineIntersectsZone(u,d){return d>=u.startBufferLine&&d<=u.endBufferLine}_lineAdjacentToZone(u,d,g){return d>=u.startBufferLine-this._linePadding[g||"full"]&&d<=u.endBufferLine+this._linePadding[g||"full"]}_addLineToZone(u,d){u.startBufferLine=Math.min(u.startBufferLine,d),u.endBufferLine=Math.max(u.endBufferLine,d)}}},5744:function(A,r,u){var d=this&&this.__decorate||function(f,y,R,k){var D,E=arguments.length,L=E<3?y:k===null?k=Object.getOwnPropertyDescriptor(y,R):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(f,y,R,k);else for(var z=f.length-1;z>=0;z--)(D=f[z])&&(L=(E<3?D(L):E>3?D(y,R,L):D(y,R))||L);return E>3&&L&&Object.defineProperty(y,R,L),L},g=this&&this.__param||function(f,y){return function(R,k){y(R,k,f)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OverviewRulerRenderer=void 0;const l=u(5871),m=u(4725),b=u(844),C=u(2585),p={full:0,left:0,center:0,right:0},o={full:0,left:0,center:0,right:0},c={full:0,left:0,center:0,right:0};let a=r.OverviewRulerRenderer=class extends b.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(f,y,R,k,D,E,L){var H;super(),this._viewportElement=f,this._screenElement=y,this._bufferService=R,this._decorationService=k,this._renderService=D,this._optionsService=E,this._coreBrowserService=L,this._colorZoneStore=new l.ColorZoneStore,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(),(H=this._viewportElement.parentElement)==null||H.insertBefore(this._canvas,this._viewportElement);const z=this._canvas.getContext("2d");if(!z)throw new Error("Ctx cannot be null");this._ctx=z,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,b.toDisposable)((()=>{var P;(P=this._canvas)==null||P.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){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())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const f=Math.floor(this._canvas.width/3),y=Math.ceil(this._canvas.width/3);o.full=this._canvas.width,o.left=f,o.center=y,o.right=f,this._refreshDrawHeightConstants(),c.full=0,c.left=0,c.center=o.left,c.right=o.left+o.center}_refreshDrawHeightConstants(){p.full=Math.round(2*this._coreBrowserService.dpr);const f=this._canvas.height/this._bufferService.buffer.lines.length,y=Math.round(Math.max(Math.min(f,12),6)*this._coreBrowserService.dpr);p.left=y,p.center=y,p.right=y}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*p.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*p.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*p.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*p.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(const y of this._decorationService.decorations)this._colorZoneStore.addDecoration(y);this._ctx.lineWidth=1;const f=this._colorZoneStore.zones;for(const y of f)y.position!=="full"&&this._renderColorZone(y);for(const y of f)y.position==="full"&&this._renderColorZone(y);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(f){this._ctx.fillStyle=f.color,this._ctx.fillRect(c[f.position||"full"],Math.round((this._canvas.height-1)*(f.startBufferLine/this._bufferService.buffers.active.lines.length)-p[f.position||"full"]/2),o[f.position||"full"],Math.round((this._canvas.height-1)*((f.endBufferLine-f.startBufferLine)/this._bufferService.buffers.active.lines.length)+p[f.position||"full"]))}_queueRefresh(f,y){this._shouldUpdateDimensions=f||this._shouldUpdateDimensions,this._shouldUpdateAnchor=y||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};r.OverviewRulerRenderer=a=d([g(2,C.IBufferService),g(3,C.IDecorationService),g(4,m.IRenderService),g(5,C.IOptionsService),g(6,m.ICoreBrowserService)],a)},2950:function(A,r,u){var d=this&&this.__decorate||function(p,o,c,a){var f,y=arguments.length,R=y<3?o:a===null?a=Object.getOwnPropertyDescriptor(o,c):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(p,o,c,a);else for(var k=p.length-1;k>=0;k--)(f=p[k])&&(R=(y<3?f(R):y>3?f(o,c,R):f(o,c))||R);return y>3&&R&&Object.defineProperty(o,c,R),R},g=this&&this.__param||function(p,o){return function(c,a){o(c,a,p)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CompositionHelper=void 0;const l=u(4725),m=u(2585),b=u(2584);let C=r.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(p,o,c,a,f,y){this._textarea=p,this._compositionView=o,this._bufferService=c,this._optionsService=a,this._coreService=f,this._renderService=y,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(p){this._compositionView.textContent=p.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(p){if(this._isComposing||this._isSendingComposition){if(p.keyCode===229||p.keyCode===16||p.keyCode===17||p.keyCode===18)return!1;this._finalizeComposition(!1)}return p.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(p){if(this._compositionView.classList.remove("active"),this._isComposing=!1,p){const o={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let c;this._isSendingComposition=!1,o.start+=this._dataAlreadySent.length,c=this._isComposing?this._textarea.value.substring(o.start,o.end):this._textarea.value.substring(o.start),c.length>0&&this._coreService.triggerDataEvent(c,!0)}}),0)}else{this._isSendingComposition=!1;const o=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(o,!0)}}_handleAnyTextareaChanges(){const p=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const o=this._textarea.value,c=o.replace(p,"");this._dataAlreadySent=c,o.length>p.length?this._coreService.triggerDataEvent(c,!0):o.length<p.length?this._coreService.triggerDataEvent(`${b.C0.DEL}`,!0):o.length===p.length&&o!==p&&this._coreService.triggerDataEvent(o,!0)}}),0)}updateCompositionElements(p){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const o=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),c=this._renderService.dimensions.css.cell.height,a=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,f=o*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=f+"px",this._compositionView.style.top=a+"px",this._compositionView.style.height=c+"px",this._compositionView.style.lineHeight=c+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const y=this._compositionView.getBoundingClientRect();this._textarea.style.left=f+"px",this._textarea.style.top=a+"px",this._textarea.style.width=Math.max(y.width,1)+"px",this._textarea.style.height=Math.max(y.height,1)+"px",this._textarea.style.lineHeight=y.height+"px"}p||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};r.CompositionHelper=C=d([g(2,m.IBufferService),g(3,m.IOptionsService),g(4,m.ICoreService),g(5,l.IRenderService)],C)},9806:(A,r)=>{function u(d,g,l){const m=l.getBoundingClientRect(),b=d.getComputedStyle(l),C=parseInt(b.getPropertyValue("padding-left")),p=parseInt(b.getPropertyValue("padding-top"));return[g.clientX-m.left-C,g.clientY-m.top-p]}Object.defineProperty(r,"__esModule",{value:!0}),r.getCoords=r.getCoordsRelativeToElement=void 0,r.getCoordsRelativeToElement=u,r.getCoords=function(d,g,l,m,b,C,p,o,c){if(!C)return;const a=u(d,g,l);return a?(a[0]=Math.ceil((a[0]+(c?p/2:0))/p),a[1]=Math.ceil(a[1]/o),a[0]=Math.min(Math.max(a[0],1),m+(c?1:0)),a[1]=Math.min(Math.max(a[1],1),b),a):void 0}},9504:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.moveToCellSequence=void 0;const d=u(2584);function g(o,c,a,f){const y=o-l(o,a),R=c-l(c,a),k=Math.abs(y-R)-(function(D,E,L){let z=0;const H=D-l(D,L),P=E-l(E,L);for(let I=0;I<Math.abs(H-P);I++){const K=m(D,E)==="A"?-1:1,X=L.buffer.lines.get(H+K*I);X!=null&&X.isWrapped&&z++}return z})(o,c,a);return p(k,C(m(o,c),f))}function l(o,c){let a=0,f=c.buffer.lines.get(o),y=f==null?void 0:f.isWrapped;for(;y&&o>=0&&o<c.rows;)a++,f=c.buffer.lines.get(--o),y=f==null?void 0:f.isWrapped;return a}function m(o,c){return o>c?"A":"B"}function b(o,c,a,f,y,R){let k=o,D=c,E="";for(;k!==a||D!==f;)k+=y?1:-1,y&&k>R.cols-1?(E+=R.buffer.translateBufferLineToString(D,!1,o,k),k=0,o=0,D++):!y&&k<0&&(E+=R.buffer.translateBufferLineToString(D,!1,0,o+1),k=R.cols-1,o=k,D--);return E+R.buffer.translateBufferLineToString(D,!1,o,k)}function C(o,c){const a=c?"O":"[";return d.C0.ESC+a+o}function p(o,c){o=Math.floor(o);let a="";for(let f=0;f<o;f++)a+=c;return a}r.moveToCellSequence=function(o,c,a,f){const y=a.buffer.x,R=a.buffer.y;if(!a.buffer.hasScrollback)return(function(E,L,z,H,P,I){return g(L,H,P,I).length===0?"":p(b(E,L,E,L-l(L,P),!1,P).length,C("D",I))})(y,R,0,c,a,f)+g(R,c,a,f)+(function(E,L,z,H,P,I){let K;K=g(L,H,P,I).length>0?H-l(H,P):L;const X=H,Y=(function($,U,T,F,B,W){let Z;return Z=g(T,F,B,W).length>0?F-l(F,B):U,$<T&&Z<=F||$>=T&&Z<F?"C":"D"})(E,L,z,H,P,I);return p(b(E,K,z,X,Y==="C",P).length,C(Y,I))})(y,R,o,c,a,f);let k;if(R===c)return k=y>o?"D":"C",p(Math.abs(y-o),C(k,f));k=R>c?"D":"C";const D=Math.abs(R-c);return p((function(E,L){return L.cols-E})(R>c?o:y,a)+(D-1)*a.cols+1+((R>c?y:o)-1),C(k,f))}},1296:function(A,r,u){var d=this&&this.__decorate||function(I,K,X,Y){var $,U=arguments.length,T=U<3?K:Y===null?Y=Object.getOwnPropertyDescriptor(K,X):Y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(I,K,X,Y);else for(var F=I.length-1;F>=0;F--)($=I[F])&&(T=(U<3?$(T):U>3?$(K,X,T):$(K,X))||T);return U>3&&T&&Object.defineProperty(K,X,T),T},g=this&&this.__param||function(I,K){return function(X,Y){K(X,Y,I)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRenderer=void 0;const l=u(3787),m=u(2550),b=u(2223),C=u(6171),p=u(6052),o=u(4725),c=u(8055),a=u(8460),f=u(844),y=u(2585),R="xterm-dom-renderer-owner-",k="xterm-rows",D="xterm-fg-",E="xterm-bg-",L="xterm-focus",z="xterm-selection";let H=1,P=r.DomRenderer=class extends f.Disposable{constructor(I,K,X,Y,$,U,T,F,B,W,Z,ne,ge){super(),this._terminal=I,this._document=K,this._element=X,this._screenElement=Y,this._viewportElement=$,this._helperContainer=U,this._linkifier2=T,this._charSizeService=B,this._optionsService=W,this._bufferService=Z,this._coreBrowserService=ne,this._themeService=ge,this._terminalClass=H++,this._rowElements=[],this._selectionRenderModel=(0,p.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new a.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(k),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(z),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,C.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((xe=>this._injectCss(xe)))),this._injectCss(this._themeService.colors),this._rowFactory=F.createInstance(l.DomRendererRowFactory,document),this._element.classList.add(R+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((xe=>this._handleLinkHover(xe)))),this.register(this._linkifier2.onHideLinkUnderline((xe=>this._handleLinkLeave(xe)))),this.register((0,f.toDisposable)((()=>{this._element.classList.remove(R+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new m.WidthCache(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(){const I=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*I,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*I),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/I),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/I),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(const X of this._rowElements)X.style.width=`${this.dimensions.css.canvas.width}px`,X.style.height=`${this.dimensions.css.cell.height}px`,X.style.lineHeight=`${this.dimensions.css.cell.height}px`,X.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const K=`${this._terminalSelector} .${k} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=K,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(I){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let K=`${this._terminalSelector} .${k} { color: ${I.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;K+=`${this._terminalSelector} .${k} .xterm-dim { color: ${c.color.multiplyOpacity(I.foreground,.5).css};}`,K+=`${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;}`;const X=`blink_underline_${this._terminalClass}`,Y=`blink_bar_${this._terminalClass}`,$=`blink_block_${this._terminalClass}`;K+=`@keyframes ${X} { 50% { border-bottom-style: hidden; }}`,K+=`@keyframes ${Y} { 50% { box-shadow: none; }}`,K+=`@keyframes ${$} { 0% { background-color: ${I.cursor.css}; color: ${I.cursorAccent.css}; } 50% { background-color: inherit; color: ${I.cursor.css}; }}`,K+=`${this._terminalSelector} .${k}.${L} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${k}.${L} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${k}.${L} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${$} 1s step-end infinite;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-block { background-color: ${I.cursor.css}; color: ${I.cursorAccent.css};}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${I.cursor.css} !important; color: ${I.cursorAccent.css} !important;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${I.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${I.cursor.css} inset;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${I.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,K+=`${this._terminalSelector} .${z} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${z} div { position: absolute; background-color: ${I.selectionBackgroundOpaque.css};}${this._terminalSelector} .${z} div { position: absolute; background-color: ${I.selectionInactiveBackgroundOpaque.css};}`;for(const[U,T]of I.ansi.entries())K+=`${this._terminalSelector} .${D}${U} { color: ${T.css}; }${this._terminalSelector} .${D}${U}.xterm-dim { color: ${c.color.multiplyOpacity(T,.5).css}; }${this._terminalSelector} .${E}${U} { background-color: ${T.css}; }`;K+=`${this._terminalSelector} .${D}${b.INVERTED_DEFAULT_COLOR} { color: ${c.color.opaque(I.background).css}; }${this._terminalSelector} .${D}${b.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${c.color.multiplyOpacity(c.color.opaque(I.background),.5).css}; }${this._terminalSelector} .${E}${b.INVERTED_DEFAULT_COLOR} { background-color: ${I.foreground.css}; }`,this._themeStyleElement.textContent=K}_setDefaultSpacing(){const I=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${I}px`,this._rowFactory.defaultSpacing=I}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(I,K){for(let X=this._rowElements.length;X<=K;X++){const Y=this._document.createElement("div");this._rowContainer.appendChild(Y),this._rowElements.push(Y)}for(;this._rowElements.length>K;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(I,K){this._refreshRowElements(I,K),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(L),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(L),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(I,K,X){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(I,K,X),this.renderRows(0,this._bufferService.rows-1),!I||!K)return;this._selectionRenderModel.update(this._terminal,I,K,X);const Y=this._selectionRenderModel.viewportStartRow,$=this._selectionRenderModel.viewportEndRow,U=this._selectionRenderModel.viewportCappedStartRow,T=this._selectionRenderModel.viewportCappedEndRow;if(U>=this._bufferService.rows||T<0)return;const F=this._document.createDocumentFragment();if(X){const B=I[0]>K[0];F.appendChild(this._createSelectionElement(U,B?K[0]:I[0],B?I[0]:K[0],T-U+1))}else{const B=Y===U?I[0]:0,W=U===$?K[0]:this._bufferService.cols;F.appendChild(this._createSelectionElement(U,B,W));const Z=T-U-1;if(F.appendChild(this._createSelectionElement(U+1,0,this._bufferService.cols,Z)),U!==T){const ne=$===T?K[0]:this._bufferService.cols;F.appendChild(this._createSelectionElement(T,0,ne))}}this._selectionContainer.appendChild(F)}_createSelectionElement(I,K,X,Y=1){const $=this._document.createElement("div"),U=K*this.dimensions.css.cell.width;let T=this.dimensions.css.cell.width*(X-K);return U+T>this.dimensions.css.canvas.width&&(T=this.dimensions.css.canvas.width-U),$.style.height=Y*this.dimensions.css.cell.height+"px",$.style.top=I*this.dimensions.css.cell.height+"px",$.style.left=`${U}px`,$.style.width=`${T}px`,$}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(const I of this._rowElements)I.replaceChildren()}renderRows(I,K){const X=this._bufferService.buffer,Y=X.ybase+X.y,$=Math.min(X.x,this._bufferService.cols-1),U=this._optionsService.rawOptions.cursorBlink,T=this._optionsService.rawOptions.cursorStyle,F=this._optionsService.rawOptions.cursorInactiveStyle;for(let B=I;B<=K;B++){const W=B+X.ydisp,Z=this._rowElements[B],ne=X.lines.get(W);if(!Z||!ne)break;Z.replaceChildren(...this._rowFactory.createRow(ne,W,W===Y,T,F,$,U,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${R}${this._terminalClass}`}_handleLinkHover(I){this._setCellUnderline(I.x1,I.x2,I.y1,I.y2,I.cols,!0)}_handleLinkLeave(I){this._setCellUnderline(I.x1,I.x2,I.y1,I.y2,I.cols,!1)}_setCellUnderline(I,K,X,Y,$,U){X<0&&(I=0),Y<0&&(K=0);const T=this._bufferService.rows-1;X=Math.max(Math.min(X,T),0),Y=Math.max(Math.min(Y,T),0),$=Math.min($,this._bufferService.cols);const F=this._bufferService.buffer,B=F.ybase+F.y,W=Math.min(F.x,$-1),Z=this._optionsService.rawOptions.cursorBlink,ne=this._optionsService.rawOptions.cursorStyle,ge=this._optionsService.rawOptions.cursorInactiveStyle;for(let xe=X;xe<=Y;++xe){const J=xe+F.ydisp,G=this._rowElements[xe],de=F.lines.get(J);if(!G||!de)break;G.replaceChildren(...this._rowFactory.createRow(de,J,J===B,ne,ge,W,Z,this.dimensions.css.cell.width,this._widthCache,U?xe===X?I:0:-1,U?(xe===Y?K:$)-1:-1))}}};r.DomRenderer=P=d([g(7,y.IInstantiationService),g(8,o.ICharSizeService),g(9,y.IOptionsService),g(10,y.IBufferService),g(11,o.ICoreBrowserService),g(12,o.IThemeService)],P)},3787:function(A,r,u){var d=this&&this.__decorate||function(k,D,E,L){var z,H=arguments.length,P=H<3?D:L===null?L=Object.getOwnPropertyDescriptor(D,E):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(k,D,E,L);else for(var I=k.length-1;I>=0;I--)(z=k[I])&&(P=(H<3?z(P):H>3?z(D,E,P):z(D,E))||P);return H>3&&P&&Object.defineProperty(D,E,P),P},g=this&&this.__param||function(k,D){return function(E,L){D(E,L,k)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRendererRowFactory=void 0;const l=u(2223),m=u(643),b=u(511),C=u(2585),p=u(8055),o=u(4725),c=u(4269),a=u(6171),f=u(3734);let y=r.DomRendererRowFactory=class{constructor(k,D,E,L,z,H,P){this._document=k,this._characterJoinerService=D,this._optionsService=E,this._coreBrowserService=L,this._coreService=z,this._decorationService=H,this._themeService=P,this._workCell=new b.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(k,D,E){this._selectionStart=k,this._selectionEnd=D,this._columnSelectMode=E}createRow(k,D,E,L,z,H,P,I,K,X,Y){const $=[],U=this._characterJoinerService.getJoinedCharacters(D),T=this._themeService.colors;let F,B=k.getNoBgTrimmedLength();E&&B<H+1&&(B=H+1);let W=0,Z="",ne=0,ge=0,xe=0,J=!1,G=0,de=!1,oe=0;const Ae=[],Oe=X!==-1&&Y!==-1;for(let Xe=0;Xe<B;Xe++){k.loadCell(Xe,this._workCell);let We=this._workCell.getWidth();if(We===0)continue;let rt=!1,ye=Xe,Te=this._workCell;if(U.length>0&&Xe===U[0][0]){rt=!0;const je=U.shift();Te=new c.JoinedCellData(this._workCell,k.translateToString(!0,je[0],je[1]),je[1]-je[0]),ye=je[1]-1,We=Te.getWidth()}const ct=this._isCellInSelection(Xe,D),it=E&&Xe===H,ze=Oe&&Xe>=X&&Xe<=Y;let qe=!1;this._decorationService.forEachDecorationAtCell(Xe,D,void 0,(je=>{qe=!0}));let Fe=Te.getChars()||m.WHITESPACE_CELL_CHAR;if(Fe===" "&&(Te.isUnderline()||Te.isOverline())&&(Fe=" "),oe=We*I-K.get(Fe,Te.isBold(),Te.isItalic()),F){if(W&&(ct&&de||!ct&&!de&&Te.bg===ne)&&(ct&&de&&T.selectionForeground||Te.fg===ge)&&Te.extended.ext===xe&&ze===J&&oe===G&&!it&&!rt&&!qe){Te.isInvisible()?Z+=m.WHITESPACE_CELL_CHAR:Z+=Fe,W++;continue}W&&(F.textContent=Z),F=this._document.createElement("span"),W=0,Z=""}else F=this._document.createElement("span");if(ne=Te.bg,ge=Te.fg,xe=Te.extended.ext,J=ze,G=oe,de=ct,rt&&H>=Xe&&H<=ye&&(H=Xe),!this._coreService.isCursorHidden&&it&&this._coreService.isCursorInitialized){if(Ae.push("xterm-cursor"),this._coreBrowserService.isFocused)P&&Ae.push("xterm-cursor-blink"),Ae.push(L==="bar"?"xterm-cursor-bar":L==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(z)switch(z){case"outline":Ae.push("xterm-cursor-outline");break;case"block":Ae.push("xterm-cursor-block");break;case"bar":Ae.push("xterm-cursor-bar");break;case"underline":Ae.push("xterm-cursor-underline")}}if(Te.isBold()&&Ae.push("xterm-bold"),Te.isItalic()&&Ae.push("xterm-italic"),Te.isDim()&&Ae.push("xterm-dim"),Z=Te.isInvisible()?m.WHITESPACE_CELL_CHAR:Te.getChars()||m.WHITESPACE_CELL_CHAR,Te.isUnderline()&&(Ae.push(`xterm-underline-${Te.extended.underlineStyle}`),Z===" "&&(Z=" "),!Te.isUnderlineColorDefault()))if(Te.isUnderlineColorRGB())F.style.textDecorationColor=`rgb(${f.AttributeData.toColorRGB(Te.getUnderlineColor()).join(",")})`;else{let je=Te.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Te.isBold()&&je<8&&(je+=8),F.style.textDecorationColor=T.ansi[je].css}Te.isOverline()&&(Ae.push("xterm-overline"),Z===" "&&(Z=" ")),Te.isStrikethrough()&&Ae.push("xterm-strikethrough"),ze&&(F.style.textDecoration="underline");let Be=Te.getFgColor(),$e=Te.getFgColorMode(),lt=Te.getBgColor(),st=Te.getBgColorMode();const St=!!Te.isInverse();if(St){const je=Be;Be=lt,lt=je;const ue=$e;$e=st,st=ue}let Se,Ie,le,Ne=!1;switch(this._decorationService.forEachDecorationAtCell(Xe,D,void 0,(je=>{je.options.layer!=="top"&&Ne||(je.backgroundColorRGB&&(st=50331648,lt=je.backgroundColorRGB.rgba>>8&16777215,Se=je.backgroundColorRGB),je.foregroundColorRGB&&($e=50331648,Be=je.foregroundColorRGB.rgba>>8&16777215,Ie=je.foregroundColorRGB),Ne=je.options.layer==="top")})),!Ne&&ct&&(Se=this._coreBrowserService.isFocused?T.selectionBackgroundOpaque:T.selectionInactiveBackgroundOpaque,lt=Se.rgba>>8&16777215,st=50331648,Ne=!0,T.selectionForeground&&($e=50331648,Be=T.selectionForeground.rgba>>8&16777215,Ie=T.selectionForeground)),Ne&&Ae.push("xterm-decoration-top"),st){case 16777216:case 33554432:le=T.ansi[lt],Ae.push(`xterm-bg-${lt}`);break;case 50331648:le=p.channels.toColor(lt>>16,lt>>8&255,255<),this._addStyle(F,`background-color:#${R((lt>>>0).toString(16),"0",6)}`);break;default:St?(le=T.foreground,Ae.push(`xterm-bg-${l.INVERTED_DEFAULT_COLOR}`)):le=T.background}switch(Se||Te.isDim()&&(Se=p.color.multiplyOpacity(le,.5)),$e){case 16777216:case 33554432:Te.isBold()&&Be<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Be+=8),this._applyMinimumContrast(F,le,T.ansi[Be],Te,Se,void 0)||Ae.push(`xterm-fg-${Be}`);break;case 50331648:const je=p.channels.toColor(Be>>16&255,Be>>8&255,255&Be);this._applyMinimumContrast(F,le,je,Te,Se,Ie)||this._addStyle(F,`color:#${R(Be.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(F,le,T.foreground,Te,Se,Ie)||St&&Ae.push(`xterm-fg-${l.INVERTED_DEFAULT_COLOR}`)}Ae.length&&(F.className=Ae.join(" "),Ae.length=0),it||rt||qe?F.textContent=Z:W++,oe!==this.defaultSpacing&&(F.style.letterSpacing=`${oe}px`),$.push(F),Xe=ye}return F&&W&&(F.textContent=Z),$}_applyMinimumContrast(k,D,E,L,z,H){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,a.treatGlyphAsBackgroundColor)(L.getCode()))return!1;const P=this._getContrastCache(L);let I;if(z||H||(I=P.getColor(D.rgba,E.rgba)),I===void 0){const K=this._optionsService.rawOptions.minimumContrastRatio/(L.isDim()?2:1);I=p.color.ensureContrastRatio(z||D,H||E,K),P.setColor((z||D).rgba,(H||E).rgba,I??null)}return!!I&&(this._addStyle(k,`color:${I.css}`),!0)}_getContrastCache(k){return k.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(k,D){k.setAttribute("style",`${k.getAttribute("style")||""}${D};`)}_isCellInSelection(k,D){const E=this._selectionStart,L=this._selectionEnd;return!(!E||!L)&&(this._columnSelectMode?E[0]<=L[0]?k>=E[0]&&D>=E[1]&&k<L[0]&&D<=L[1]:k<E[0]&&D>=E[1]&&k>=L[0]&&D<=L[1]:D>E[1]&&D<L[1]||E[1]===L[1]&&D===E[1]&&k>=E[0]&&k<L[0]||E[1]<L[1]&&D===L[1]&&k<L[0]||E[1]<L[1]&&D===E[1]&&k>=E[0])}};function R(k,D,E){for(;k.length<E;)k=D+k;return k}r.DomRendererRowFactory=y=d([g(1,o.ICharacterJoinerService),g(2,C.IOptionsService),g(3,o.ICoreBrowserService),g(4,C.ICoreService),g(5,C.IDecorationService),g(6,o.IThemeService)],y)},2550:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WidthCache=void 0,r.WidthCache=class{constructor(u,d){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.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";const g=u.createElement("span");g.classList.add("xterm-char-measure-element");const l=u.createElement("span");l.classList.add("xterm-char-measure-element"),l.style.fontWeight="bold";const m=u.createElement("span");m.classList.add("xterm-char-measure-element"),m.style.fontStyle="italic";const b=u.createElement("span");b.classList.add("xterm-char-measure-element"),b.style.fontWeight="bold",b.style.fontStyle="italic",this._measureElements=[g,l,m,b],this._container.appendChild(g),this._container.appendChild(l),this._container.appendChild(m),this._container.appendChild(b),d.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(u,d,g,l){u===this._font&&d===this._fontSize&&g===this._weight&&l===this._weightBold||(this._font=u,this._fontSize=d,this._weight=g,this._weightBold=l,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${g}`,this._measureElements[1].style.fontWeight=`${l}`,this._measureElements[2].style.fontWeight=`${g}`,this._measureElements[3].style.fontWeight=`${l}`,this.clear())}get(u,d,g){let l=0;if(!d&&!g&&u.length===1&&(l=u.charCodeAt(0))<256){if(this._flat[l]!==-9999)return this._flat[l];const C=this._measure(u,0);return C>0&&(this._flat[l]=C),C}let m=u;d&&(m+="B"),g&&(m+="I");let b=this._holey.get(m);if(b===void 0){let C=0;d&&(C|=1),g&&(C|=2),b=this._measure(u,C),b>0&&this._holey.set(m,b)}return b}_measure(u,d){const g=this._measureElements[d];return g.textContent=u.repeat(32),g.offsetWidth/32}}},2223:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TEXT_BASELINE=r.DIM_OPACITY=r.INVERTED_DEFAULT_COLOR=void 0;const d=u(6114);r.INVERTED_DEFAULT_COLOR=257,r.DIM_OPACITY=.5,r.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(A,r)=>{function u(g){return 57508<=g&&g<=57558}function d(g){return g>=128512&&g<=128591||g>=127744&&g<=128511||g>=128640&&g<=128767||g>=9728&&g<=9983||g>=9984&&g<=10175||g>=65024&&g<=65039||g>=129280&&g<=129535||g>=127462&&g<=127487}Object.defineProperty(r,"__esModule",{value:!0}),r.computeNextVariantOffset=r.createRenderDimensions=r.treatGlyphAsBackgroundColor=r.allowRescaling=r.isEmoji=r.isRestrictedPowerlineGlyph=r.isPowerlineGlyph=r.throwIfFalsy=void 0,r.throwIfFalsy=function(g){if(!g)throw new Error("value must not be falsy");return g},r.isPowerlineGlyph=u,r.isRestrictedPowerlineGlyph=function(g){return 57520<=g&&g<=57527},r.isEmoji=d,r.allowRescaling=function(g,l,m,b){return l===1&&m>Math.ceil(1.5*b)&&g!==void 0&&g>255&&!d(g)&&!u(g)&&!(function(C){return 57344<=C&&C<=63743})(g)},r.treatGlyphAsBackgroundColor=function(g){return u(g)||(function(l){return 9472<=l&&l<=9631})(g)},r.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},r.computeNextVariantOffset=function(g,l,m=0){return(g-(2*Math.round(l)-m))%(2*Math.round(l))}},6052:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createSelectionRenderModel=void 0;class u{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(g,l,m,b=!1){if(this.selectionStart=l,this.selectionEnd=m,!l||!m||l[0]===m[0]&&l[1]===m[1])return void this.clear();const C=g.buffers.active.ydisp,p=l[1]-C,o=m[1]-C,c=Math.max(p,0),a=Math.min(o,g.rows-1);c>=g.rows||a<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=b,this.viewportStartRow=p,this.viewportEndRow=o,this.viewportCappedStartRow=c,this.viewportCappedEndRow=a,this.startCol=l[0],this.endCol=m[0])}isCellSelected(g,l,m){return!!this.hasSelection&&(m-=g.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?l>=this.startCol&&m>=this.viewportCappedStartRow&&l<this.endCol&&m<=this.viewportCappedEndRow:l<this.startCol&&m>=this.viewportCappedStartRow&&l>=this.endCol&&m<=this.viewportCappedEndRow:m>this.viewportStartRow&&m<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&m===this.viewportStartRow&&l>=this.startCol&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&m===this.viewportEndRow&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&m===this.viewportStartRow&&l>=this.startCol)}}r.createSelectionRenderModel=function(){return new u}},456:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionModel=void 0,r.SelectionModel=class{constructor(u){this._bufferService=u,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.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()){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,d=this.selectionEnd;return!(!u||!d)&&(u[1]>d[1]||u[1]===d[1]&&u[0]>d[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(A,r,u){var d=this&&this.__decorate||function(a,f,y,R){var k,D=arguments.length,E=D<3?f:R===null?R=Object.getOwnPropertyDescriptor(f,y):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(a,f,y,R);else for(var L=a.length-1;L>=0;L--)(k=a[L])&&(E=(D<3?k(E):D>3?k(f,y,E):k(f,y))||E);return D>3&&E&&Object.defineProperty(f,y,E),E},g=this&&this.__param||function(a,f){return function(y,R){f(y,R,a)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharSizeService=void 0;const l=u(2585),m=u(8460),b=u(844);let C=r.CharSizeService=class extends b.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(a,f,y){super(),this._optionsService=y,this.width=0,this.height=0,this._onCharSizeChange=this.register(new m.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new c(this._optionsService))}catch{this._measureStrategy=this.register(new o(a,f,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const a=this._measureStrategy.measure();a.width===this.width&&a.height===this.height||(this.width=a.width,this.height=a.height,this._onCharSizeChange.fire())}};r.CharSizeService=C=d([g(2,l.IOptionsService)],C);class p extends b.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(f,y){f!==void 0&&f>0&&y!==void 0&&y>0&&(this._result.width=f,this._result.height=y)}}class o extends p{constructor(f,y,R){super(),this._document=f,this._parentElement=y,this._optionsService=R,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class c extends p{constructor(f){super(),this._optionsService=f,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const y=this._ctx.measureText("W");if(!("width"in y&&"fontBoundingBoxAscent"in y&&"fontBoundingBoxDescent"in y))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const f=this._ctx.measureText("W");return this._validateAndSet(f.width,f.fontBoundingBoxAscent+f.fontBoundingBoxDescent),this._result}}},4269:function(A,r,u){var d=this&&this.__decorate||function(c,a,f,y){var R,k=arguments.length,D=k<3?a:y===null?y=Object.getOwnPropertyDescriptor(a,f):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(c,a,f,y);else for(var E=c.length-1;E>=0;E--)(R=c[E])&&(D=(k<3?R(D):k>3?R(a,f,D):R(a,f))||D);return k>3&&D&&Object.defineProperty(a,f,D),D},g=this&&this.__param||function(c,a){return function(f,y){a(f,y,c)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharacterJoinerService=r.JoinedCellData=void 0;const l=u(3734),m=u(643),b=u(511),C=u(2585);class p extends l.AttributeData{constructor(a,f,y){super(),this.content=0,this.combinedData="",this.fg=a.fg,this.bg=a.bg,this.combinedData=f,this._width=y}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(a){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.JoinedCellData=p;let o=r.CharacterJoinerService=class o_{constructor(a){this._bufferService=a,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new b.CellData}register(a){const f={id:this._nextCharacterJoinerId++,handler:a};return this._characterJoiners.push(f),f.id}deregister(a){for(let f=0;f<this._characterJoiners.length;f++)if(this._characterJoiners[f].id===a)return this._characterJoiners.splice(f,1),!0;return!1}getJoinedCharacters(a){if(this._characterJoiners.length===0)return[];const f=this._bufferService.buffer.lines.get(a);if(!f||f.length===0)return[];const y=[],R=f.translateToString(!0);let k=0,D=0,E=0,L=f.getFg(0),z=f.getBg(0);for(let H=0;H<f.getTrimmedLength();H++)if(f.loadCell(H,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==L||this._workCell.bg!==z){if(H-k>1){const P=this._getJoinedRanges(R,E,D,f,k);for(let I=0;I<P.length;I++)y.push(P[I])}k=H,E=D,L=this._workCell.fg,z=this._workCell.bg}D+=this._workCell.getChars().length||m.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-k>1){const H=this._getJoinedRanges(R,E,D,f,k);for(let P=0;P<H.length;P++)y.push(H[P])}return y}_getJoinedRanges(a,f,y,R,k){const D=a.substring(f,y);let E=[];try{E=this._characterJoiners[0].handler(D)}catch(L){console.error(L)}for(let L=1;L<this._characterJoiners.length;L++)try{const z=this._characterJoiners[L].handler(D);for(let H=0;H<z.length;H++)o_._mergeRanges(E,z[H])}catch(z){console.error(z)}return this._stringRangesToCellRanges(E,R,k),E}_stringRangesToCellRanges(a,f,y){let R=0,k=!1,D=0,E=a[R];if(E){for(let L=y;L<this._bufferService.cols;L++){const z=f.getWidth(L),H=f.getString(L).length||m.WHITESPACE_CELL_CHAR.length;if(z!==0){if(!k&&E[0]<=D&&(E[0]=L,k=!0),E[1]<=D){if(E[1]=L,E=a[++R],!E)break;E[0]<=D?(E[0]=L,k=!0):k=!1}D+=H}}E&&(E[1]=this._bufferService.cols)}}static _mergeRanges(a,f){let y=!1;for(let R=0;R<a.length;R++){const k=a[R];if(y){if(f[1]<=k[0])return a[R-1][1]=f[1],a;if(f[1]<=k[1])return a[R-1][1]=Math.max(f[1],k[1]),a.splice(R,1),a;a.splice(R,1),R--}else{if(f[1]<=k[0])return a.splice(R,0,f),a;if(f[1]<=k[1])return k[0]=Math.min(f[0],k[0]),a;f[0]<k[1]&&(k[0]=Math.min(f[0],k[0]),y=!0)}}return y?a[a.length-1][1]=f[1]:a.push(f),a}};r.CharacterJoinerService=o=d([g(0,C.IBufferService)],o)},5114:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreBrowserService=void 0;const d=u(844),g=u(8460),l=u(3656);class m extends d.Disposable{constructor(p,o,c){super(),this._textarea=p,this._window=o,this.mainDocument=c,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new b(this._window),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new g.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((a=>this._screenDprMonitor.setWindow(a)))),this.register((0,g.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(p){this._window!==p&&(this._window=p,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}}r.CoreBrowserService=m;class b extends d.Disposable{constructor(p){super(),this._parentWindow=p,this._windowResizeListener=this.register(new d.MutableDisposable),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,d.toDisposable)((()=>this.clearListener())))}setWindow(p){this._parentWindow=p,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,l.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var p;this._outerListener&&((p=this._resolutionMediaMatchList)==null||p.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)}}},779:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.LinkProviderService=void 0;const d=u(844);class g extends d.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,d.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(m){return this.linkProviders.push(m),{dispose:()=>{const b=this.linkProviders.indexOf(m);b!==-1&&this.linkProviders.splice(b,1)}}}}r.LinkProviderService=g},8934:function(A,r,u){var d=this&&this.__decorate||function(C,p,o,c){var a,f=arguments.length,y=f<3?p:c===null?c=Object.getOwnPropertyDescriptor(p,o):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(C,p,o,c);else for(var R=C.length-1;R>=0;R--)(a=C[R])&&(y=(f<3?a(y):f>3?a(p,o,y):a(p,o))||y);return f>3&&y&&Object.defineProperty(p,o,y),y},g=this&&this.__param||function(C,p){return function(o,c){p(o,c,C)}};Object.defineProperty(r,"__esModule",{value:!0}),r.MouseService=void 0;const l=u(4725),m=u(9806);let b=r.MouseService=class{constructor(C,p){this._renderService=C,this._charSizeService=p}getCoords(C,p,o,c,a){return(0,m.getCoords)(window,C,p,o,c,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,a)}getMouseReportCoords(C,p){const o=(0,m.getCoordsRelativeToElement)(window,C,p);if(this._charSizeService.hasValidSize)return o[0]=Math.min(Math.max(o[0],0),this._renderService.dimensions.css.canvas.width-1),o[1]=Math.min(Math.max(o[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(o[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(o[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(o[0]),y:Math.floor(o[1])}}};r.MouseService=b=d([g(0,l.IRenderService),g(1,l.ICharSizeService)],b)},3230:function(A,r,u){var d=this&&this.__decorate||function(a,f,y,R){var k,D=arguments.length,E=D<3?f:R===null?R=Object.getOwnPropertyDescriptor(f,y):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(a,f,y,R);else for(var L=a.length-1;L>=0;L--)(k=a[L])&&(E=(D<3?k(E):D>3?k(f,y,E):k(f,y))||E);return D>3&&E&&Object.defineProperty(f,y,E),E},g=this&&this.__param||function(a,f){return function(y,R){f(y,R,a)}};Object.defineProperty(r,"__esModule",{value:!0}),r.RenderService=void 0;const l=u(6193),m=u(4725),b=u(8460),C=u(844),p=u(7226),o=u(2585);let c=r.RenderService=class extends C.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(a,f,y,R,k,D,E,L){super(),this._rowCount=a,this._charSizeService=R,this._renderer=this.register(new C.MutableDisposable),this._pausedResizeTask=new p.DebouncedIdleTask,this._observerDisposable=this.register(new C.MutableDisposable),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 b.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new b.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new b.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new b.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new l.RenderDebouncer(((z,H)=>this._renderRows(z,H)),E),this.register(this._renderDebouncer),this.register(E.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(D.onResize((()=>this._fullRefresh()))),this.register(D.buffers.onBufferActivate((()=>{var z;return(z=this._renderer.value)==null?void 0:z.clear()}))),this.register(y.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(k.onDecorationRegistered((()=>this._fullRefresh()))),this.register(k.onDecorationRemoved((()=>this._fullRefresh()))),this.register(y.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(D.cols,D.rows),this._fullRefresh()}))),this.register(y.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(D.buffer.y,D.buffer.y,!0)))),this.register(L.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(E.window,f),this.register(E.onWindowChange((z=>this._registerIntersectionObserver(z,f))))}_registerIntersectionObserver(a,f){if("IntersectionObserver"in a){const y=new a.IntersectionObserver((R=>this._handleIntersectionChange(R[R.length-1])),{threshold:0});y.observe(f),this._observerDisposable.value=(0,C.toDisposable)((()=>y.disconnect()))}}_handleIntersectionChange(a){this._isPaused=a.isIntersecting===void 0?a.intersectionRatio===0:!a.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(a,f,y=!1){this._isPaused?this._needsFullRefresh=!0:(y||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(a,f,this._rowCount))}_renderRows(a,f){this._renderer.value&&(a=Math.min(a,this._rowCount-1),f=Math.min(f,this._rowCount-1),this._renderer.value.renderRows(a,f),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:a,end:f}),this._onRender.fire({start:a,end:f}),this._isNextRenderRedrawOnly=!0)}resize(a,f){this._rowCount=f,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(a){this._renderer.value=a,this._renderer.value&&(this._renderer.value.onRequestRedraw((f=>this.refreshRows(f.start,f.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(a){return this._renderDebouncer.addRefreshCallback(a)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var a,f;this._renderer.value&&((f=(a=this._renderer.value).clearTextureAtlas)==null||f.call(a),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(a,f){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var y;return(y=this._renderer.value)==null?void 0:y.handleResize(a,f)})):this._renderer.value.handleResize(a,f),this._fullRefresh())}handleCharSizeChanged(){var a;(a=this._renderer.value)==null||a.handleCharSizeChanged()}handleBlur(){var a;(a=this._renderer.value)==null||a.handleBlur()}handleFocus(){var a;(a=this._renderer.value)==null||a.handleFocus()}handleSelectionChanged(a,f,y){var R;this._selectionState.start=a,this._selectionState.end=f,this._selectionState.columnSelectMode=y,(R=this._renderer.value)==null||R.handleSelectionChanged(a,f,y)}handleCursorMove(){var a;(a=this._renderer.value)==null||a.handleCursorMove()}clear(){var a;(a=this._renderer.value)==null||a.clear()}};r.RenderService=c=d([g(2,o.IOptionsService),g(3,m.ICharSizeService),g(4,o.IDecorationService),g(5,o.IBufferService),g(6,m.ICoreBrowserService),g(7,m.IThemeService)],c)},9312:function(A,r,u){var d=this&&this.__decorate||function(E,L,z,H){var P,I=arguments.length,K=I<3?L:H===null?H=Object.getOwnPropertyDescriptor(L,z):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")K=Reflect.decorate(E,L,z,H);else for(var X=E.length-1;X>=0;X--)(P=E[X])&&(K=(I<3?P(K):I>3?P(L,z,K):P(L,z))||K);return I>3&&K&&Object.defineProperty(L,z,K),K},g=this&&this.__param||function(E,L){return function(z,H){L(z,H,E)}};Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionService=void 0;const l=u(9806),m=u(9504),b=u(456),C=u(4725),p=u(8460),o=u(844),c=u(6114),a=u(4841),f=u(511),y=u(2585),R=" ",k=new RegExp(R,"g");let D=r.SelectionService=class extends o.Disposable{constructor(E,L,z,H,P,I,K,X,Y){super(),this._element=E,this._screenElement=L,this._linkifier=z,this._bufferService=H,this._coreService=P,this._mouseService=I,this._optionsService=K,this._renderService=X,this._coreBrowserService=Y,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new f.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new p.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new p.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new p.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new p.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=$=>this._handleMouseMove($),this._mouseUpListener=$=>this._handleMouseUp($),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim(($=>this._handleTrim($))),this.register(this._bufferService.buffers.onBufferActivate(($=>this._handleBufferActivate($)))),this.enable(),this._model=new b.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,o.toDisposable)((()=>{this._removeMouseDownListeners()})))}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(){const E=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;return!(!E||!L||E[0]===L[0]&&E[1]===L[1])}get selectionText(){const E=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;if(!E||!L)return"";const z=this._bufferService.buffer,H=[];if(this._activeSelectionMode===3){if(E[0]===L[0])return"";const P=E[0]<L[0]?E[0]:L[0],I=E[0]<L[0]?L[0]:E[0];for(let K=E[1];K<=L[1];K++){const X=z.translateBufferLineToString(K,!0,P,I);H.push(X)}}else{const P=E[1]===L[1]?L[0]:void 0;H.push(z.translateBufferLineToString(E[1],!0,E[0],P));for(let I=E[1]+1;I<=L[1]-1;I++){const K=z.lines.get(I),X=z.translateBufferLineToString(I,!0);K!=null&&K.isWrapped?H[H.length-1]+=X:H.push(X)}if(E[1]!==L[1]){const I=z.lines.get(L[1]),K=z.translateBufferLineToString(L[1],!0,0,L[0]);I&&I.isWrapped?H[H.length-1]+=K:H.push(K)}}return H.map((P=>P.replace(k," "))).join(c.isWindows?`\r
|
|
413
|
+
`:`
|
|
414
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(E){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),c.isLinux&&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){const L=this._getMouseBufferCoords(E),z=this._model.finalSelectionStart,H=this._model.finalSelectionEnd;return!!(z&&H&&L)&&this._areCoordsInSelection(L,z,H)}isCellInSelection(E,L){const z=this._model.finalSelectionStart,H=this._model.finalSelectionEnd;return!(!z||!H)&&this._areCoordsInSelection([E,L],z,H)}_areCoordsInSelection(E,L,z){return E[1]>L[1]&&E[1]<z[1]||L[1]===z[1]&&E[1]===L[1]&&E[0]>=L[0]&&E[0]<z[0]||L[1]<z[1]&&E[1]===z[1]&&E[0]<z[0]||L[1]<z[1]&&E[1]===L[1]&&E[0]>=L[0]}_selectWordAtCursor(E,L){var P,I;const z=(I=(P=this._linkifier.currentLink)==null?void 0:P.link)==null?void 0:I.range;if(z)return this._model.selectionStart=[z.start.x-1,z.start.y-1],this._model.selectionStartLength=(0,a.getRangeLength)(z,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const H=this._getMouseBufferCoords(E);return!!H&&(this._selectWordAt(H,L),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(E,L){this._model.clearSelection(),E=Math.max(E,0),L=Math.min(L,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,E],this._model.selectionEnd=[this._bufferService.cols,L],this.refresh(),this._onSelectionChange.fire()}_handleTrim(E){this._model.handleTrim(E)&&this.refresh()}_getMouseBufferCoords(E){const L=this._mouseService.getCoords(E,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(L)return L[0]--,L[1]--,L[1]+=this._bufferService.buffer.ydisp,L}_getMouseEventScrollAmount(E){let L=(0,l.getCoordsRelativeToElement)(this._coreBrowserService.window,E,this._screenElement)[1];const z=this._renderService.dimensions.css.canvas.height;return L>=0&&L<=z?0:(L>z&&(L-=z),L=Math.min(Math.max(L,-50),50),L/=50,L/Math.abs(L)+Math.round(14*L))}shouldForceSelection(E){return c.isMac?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()),50)}_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;const L=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);L&&L.length!==this._model.selectionStart[0]&&L.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(E){this._selectWordAtCursor(E,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(E){const L=this._getMouseBufferCoords(E);L&&(this._activeSelectionMode=2,this._selectLineAt(L[1]))}shouldColumnSelect(E){return E.altKey&&!(c.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(E){if(E.stopImmediatePropagation(),!this._model.selectionStart)return;const L=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(E),!this._model.selectionEnd)return void this.refresh(!0);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));const z=this._bufferService.buffer;if(this._model.selectionEnd[1]<z.lines.length){const H=z.lines.get(this._model.selectionEnd[1]);H&&H.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}L&&L[0]===this._model.selectionEnd[0]&&L[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});const 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){const L=E.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&L<500&&E.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const z=this._mouseService.getCoords(E,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(z&&z[0]!==void 0&&z[1]!==void 0){const H=(0,m.moveToCellSequence)(z[0]-1,z[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(H,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const E=this._model.finalSelectionStart,L=this._model.finalSelectionEnd,z=!(!E||!L||E[0]===L[0]&&E[1]===L[1]);z?E&&L&&(this._oldSelectionStart&&this._oldSelectionEnd&&E[0]===this._oldSelectionStart[0]&&E[1]===this._oldSelectionStart[1]&&L[0]===this._oldSelectionEnd[0]&&L[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(E,L,z)):this._oldHasSelection&&this._fireOnSelectionChange(E,L,z)}_fireOnSelectionChange(E,L,z){this._oldSelectionStart=E,this._oldSelectionEnd=L,this._oldHasSelection=z,this._onSelectionChange.fire()}_handleBufferActivate(E){this.clearSelection(),this._trimListener.dispose(),this._trimListener=E.activeBuffer.lines.onTrim((L=>this._handleTrim(L)))}_convertViewportColToCharacterIndex(E,L){let z=L;for(let H=0;L>=H;H++){const P=E.loadCell(H,this._workCell).getChars().length;this._workCell.getWidth()===0?z--:P>1&&L!==H&&(z+=P-1)}return z}setSelection(E,L,z){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[E,L],this._model.selectionStartLength=z,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(E){this._isClickInSelection(E)||(this._selectWordAtCursor(E,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(E,L,z=!0,H=!0){if(E[0]>=this._bufferService.cols)return;const P=this._bufferService.buffer,I=P.lines.get(E[1]);if(!I)return;const K=P.translateBufferLineToString(E[1],!1);let X=this._convertViewportColToCharacterIndex(I,E[0]),Y=X;const $=E[0]-X;let U=0,T=0,F=0,B=0;if(K.charAt(X)===" "){for(;X>0&&K.charAt(X-1)===" ";)X--;for(;Y<K.length&&K.charAt(Y+1)===" ";)Y++}else{let ne=E[0],ge=E[0];I.getWidth(ne)===0&&(U++,ne--),I.getWidth(ge)===2&&(T++,ge++);const xe=I.getString(ge).length;for(xe>1&&(B+=xe-1,Y+=xe-1);ne>0&&X>0&&!this._isCharWordSeparator(I.loadCell(ne-1,this._workCell));){I.loadCell(ne-1,this._workCell);const J=this._workCell.getChars().length;this._workCell.getWidth()===0?(U++,ne--):J>1&&(F+=J-1,X-=J-1),X--,ne--}for(;ge<I.length&&Y+1<K.length&&!this._isCharWordSeparator(I.loadCell(ge+1,this._workCell));){I.loadCell(ge+1,this._workCell);const J=this._workCell.getChars().length;this._workCell.getWidth()===2?(T++,ge++):J>1&&(B+=J-1,Y+=J-1),Y++,ge++}}Y++;let W=X+$-U+F,Z=Math.min(this._bufferService.cols,Y-X+U+T-F-B);if(L||K.slice(X,Y).trim()!==""){if(z&&W===0&&I.getCodePoint(0)!==32){const ne=P.lines.get(E[1]-1);if(ne&&I.isWrapped&&ne.getCodePoint(this._bufferService.cols-1)!==32){const ge=this._getWordAt([this._bufferService.cols-1,E[1]-1],!1,!0,!1);if(ge){const xe=this._bufferService.cols-ge.start;W-=xe,Z+=xe}}}if(H&&W+Z===this._bufferService.cols&&I.getCodePoint(this._bufferService.cols-1)!==32){const ne=P.lines.get(E[1]+1);if(ne!=null&&ne.isWrapped&&ne.getCodePoint(0)!==32){const ge=this._getWordAt([0,E[1]+1],!1,!1,!0);ge&&(Z+=ge.length)}}return{start:W,length:Z}}}_selectWordAt(E,L){const z=this._getWordAt(E,L);if(z){for(;z.start<0;)z.start+=this._bufferService.cols,E[1]--;this._model.selectionStart=[z.start,E[1]],this._model.selectionStartLength=z.length}}_selectToWordAt(E){const L=this._getWordAt(E,!0);if(L){let z=E[1];for(;L.start<0;)L.start+=this._bufferService.cols,z--;if(!this._model.areSelectionValuesReversed())for(;L.start+L.length>this._bufferService.cols;)L.length-=this._bufferService.cols,z++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?L.start:L.start+L.length,z]}}_isCharWordSeparator(E){return E.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(E.getChars())>=0}_selectLineAt(E){const L=this._bufferService.buffer.getWrappedRangeForLine(E),z={start:{x:0,y:L.first},end:{x:this._bufferService.cols-1,y:L.last}};this._model.selectionStart=[0,L.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,a.getRangeLength)(z,this._bufferService.cols)}};r.SelectionService=D=d([g(3,y.IBufferService),g(4,y.ICoreService),g(5,C.IMouseService),g(6,y.IOptionsService),g(7,C.IRenderService),g(8,C.ICoreBrowserService)],D)},4725:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ILinkProviderService=r.IThemeService=r.ICharacterJoinerService=r.ISelectionService=r.IRenderService=r.IMouseService=r.ICoreBrowserService=r.ICharSizeService=void 0;const d=u(8343);r.ICharSizeService=(0,d.createDecorator)("CharSizeService"),r.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),r.IMouseService=(0,d.createDecorator)("MouseService"),r.IRenderService=(0,d.createDecorator)("RenderService"),r.ISelectionService=(0,d.createDecorator)("SelectionService"),r.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),r.IThemeService=(0,d.createDecorator)("ThemeService"),r.ILinkProviderService=(0,d.createDecorator)("LinkProviderService")},6731:function(A,r,u){var d=this&&this.__decorate||function(D,E,L,z){var H,P=arguments.length,I=P<3?E:z===null?z=Object.getOwnPropertyDescriptor(E,L):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(D,E,L,z);else for(var K=D.length-1;K>=0;K--)(H=D[K])&&(I=(P<3?H(I):P>3?H(E,L,I):H(E,L))||I);return P>3&&I&&Object.defineProperty(E,L,I),I},g=this&&this.__param||function(D,E){return function(L,z){E(L,z,D)}};Object.defineProperty(r,"__esModule",{value:!0}),r.ThemeService=r.DEFAULT_ANSI_COLORS=void 0;const l=u(7239),m=u(8055),b=u(8460),C=u(844),p=u(2585),o=m.css.toColor("#ffffff"),c=m.css.toColor("#000000"),a=m.css.toColor("#ffffff"),f=m.css.toColor("#000000"),y={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};r.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const D=[m.css.toColor("#2e3436"),m.css.toColor("#cc0000"),m.css.toColor("#4e9a06"),m.css.toColor("#c4a000"),m.css.toColor("#3465a4"),m.css.toColor("#75507b"),m.css.toColor("#06989a"),m.css.toColor("#d3d7cf"),m.css.toColor("#555753"),m.css.toColor("#ef2929"),m.css.toColor("#8ae234"),m.css.toColor("#fce94f"),m.css.toColor("#729fcf"),m.css.toColor("#ad7fa8"),m.css.toColor("#34e2e2"),m.css.toColor("#eeeeec")],E=[0,95,135,175,215,255];for(let L=0;L<216;L++){const z=E[L/36%6|0],H=E[L/6%6|0],P=E[L%6];D.push({css:m.channels.toCss(z,H,P),rgba:m.channels.toRgba(z,H,P)})}for(let L=0;L<24;L++){const z=8+10*L;D.push({css:m.channels.toCss(z,z,z),rgba:m.channels.toRgba(z,z,z)})}return D})());let R=r.ThemeService=class extends C.Disposable{get colors(){return this._colors}constructor(D){super(),this._optionsService=D,this._contrastCache=new l.ColorContrastCache,this._halfContrastCache=new l.ColorContrastCache,this._onChangeColors=this.register(new b.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:o,background:c,cursor:a,cursorAccent:f,selectionForeground:void 0,selectionBackgroundTransparent:y,selectionBackgroundOpaque:m.color.blend(c,y),selectionInactiveBackgroundTransparent:y,selectionInactiveBackgroundOpaque:m.color.blend(c,y),ansi:r.DEFAULT_ANSI_COLORS.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))))}_setTheme(D={}){const E=this._colors;if(E.foreground=k(D.foreground,o),E.background=k(D.background,c),E.cursor=k(D.cursor,a),E.cursorAccent=k(D.cursorAccent,f),E.selectionBackgroundTransparent=k(D.selectionBackground,y),E.selectionBackgroundOpaque=m.color.blend(E.background,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundTransparent=k(D.selectionInactiveBackground,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundOpaque=m.color.blend(E.background,E.selectionInactiveBackgroundTransparent),E.selectionForeground=D.selectionForeground?k(D.selectionForeground,m.NULL_COLOR):void 0,E.selectionForeground===m.NULL_COLOR&&(E.selectionForeground=void 0),m.color.isOpaque(E.selectionBackgroundTransparent)&&(E.selectionBackgroundTransparent=m.color.opacity(E.selectionBackgroundTransparent,.3)),m.color.isOpaque(E.selectionInactiveBackgroundTransparent)&&(E.selectionInactiveBackgroundTransparent=m.color.opacity(E.selectionInactiveBackgroundTransparent,.3)),E.ansi=r.DEFAULT_ANSI_COLORS.slice(),E.ansi[0]=k(D.black,r.DEFAULT_ANSI_COLORS[0]),E.ansi[1]=k(D.red,r.DEFAULT_ANSI_COLORS[1]),E.ansi[2]=k(D.green,r.DEFAULT_ANSI_COLORS[2]),E.ansi[3]=k(D.yellow,r.DEFAULT_ANSI_COLORS[3]),E.ansi[4]=k(D.blue,r.DEFAULT_ANSI_COLORS[4]),E.ansi[5]=k(D.magenta,r.DEFAULT_ANSI_COLORS[5]),E.ansi[6]=k(D.cyan,r.DEFAULT_ANSI_COLORS[6]),E.ansi[7]=k(D.white,r.DEFAULT_ANSI_COLORS[7]),E.ansi[8]=k(D.brightBlack,r.DEFAULT_ANSI_COLORS[8]),E.ansi[9]=k(D.brightRed,r.DEFAULT_ANSI_COLORS[9]),E.ansi[10]=k(D.brightGreen,r.DEFAULT_ANSI_COLORS[10]),E.ansi[11]=k(D.brightYellow,r.DEFAULT_ANSI_COLORS[11]),E.ansi[12]=k(D.brightBlue,r.DEFAULT_ANSI_COLORS[12]),E.ansi[13]=k(D.brightMagenta,r.DEFAULT_ANSI_COLORS[13]),E.ansi[14]=k(D.brightCyan,r.DEFAULT_ANSI_COLORS[14]),E.ansi[15]=k(D.brightWhite,r.DEFAULT_ANSI_COLORS[15]),D.extendedAnsi){const L=Math.min(E.ansi.length-16,D.extendedAnsi.length);for(let z=0;z<L;z++)E.ansi[z+16]=k(D.extendedAnsi[z],r.DEFAULT_ANSI_COLORS[z+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(D){this._restoreColor(D),this._onChangeColors.fire(this.colors)}_restoreColor(D){if(D!==void 0)switch(D){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[D]=this._restoreColors.ansi[D]}else for(let E=0;E<this._restoreColors.ansi.length;++E)this._colors.ansi[E]=this._restoreColors.ansi[E]}modifyColors(D){D(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()}}};function k(D,E){if(D!==void 0)try{return m.css.toColor(D)}catch{}return E}r.ThemeService=R=d([g(0,p.IOptionsService)],R)},6349:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CircularList=void 0;const d=u(8460),g=u(844);class l extends g.Disposable{constructor(b){super(),this._maxLength=b,this.onDeleteEmitter=this.register(new d.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new d.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new d.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(b){if(this._maxLength===b)return;const C=new Array(b);for(let p=0;p<Math.min(b,this.length);p++)C[p]=this._array[this._getCyclicIndex(p)];this._array=C,this._maxLength=b,this._startIndex=0}get length(){return this._length}set length(b){if(b>this._length)for(let C=this._length;C<b;C++)this._array[C]=void 0;this._length=b}get(b){return this._array[this._getCyclicIndex(b)]}set(b,C){this._array[this._getCyclicIndex(b)]=C}push(b){this._array[this._getCyclicIndex(this._length)]=b,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(b,C,...p){if(C){for(let o=b;o<this._length-C;o++)this._array[this._getCyclicIndex(o)]=this._array[this._getCyclicIndex(o+C)];this._length-=C,this.onDeleteEmitter.fire({index:b,amount:C})}for(let o=this._length-1;o>=b;o--)this._array[this._getCyclicIndex(o+p.length)]=this._array[this._getCyclicIndex(o)];for(let o=0;o<p.length;o++)this._array[this._getCyclicIndex(b+o)]=p[o];if(p.length&&this.onInsertEmitter.fire({index:b,amount:p.length}),this._length+p.length>this._maxLength){const o=this._length+p.length-this._maxLength;this._startIndex+=o,this._length=this._maxLength,this.onTrimEmitter.fire(o)}else this._length+=p.length}trimStart(b){b>this._length&&(b=this._length),this._startIndex+=b,this._length-=b,this.onTrimEmitter.fire(b)}shiftElements(b,C,p){if(!(C<=0)){if(b<0||b>=this._length)throw new Error("start argument out of range");if(b+p<0)throw new Error("Cannot shift elements in list beyond index 0");if(p>0){for(let c=C-1;c>=0;c--)this.set(b+c+p,this.get(b+c));const o=b+C+p-this._length;if(o>0)for(this._length+=o;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let o=0;o<C;o++)this.set(b+o+p,this.get(b+o))}}_getCyclicIndex(b){return(this._startIndex+b)%this._maxLength}}r.CircularList=l},1439:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.clone=void 0,r.clone=function u(d,g=5){if(typeof d!="object")return d;const l=Array.isArray(d)?[]:{};for(const m in d)l[m]=g<=1?d[m]:d[m]&&u(d[m],g-1);return l}},8055:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.contrastRatio=r.toPaddedHex=r.rgba=r.rgb=r.css=r.color=r.channels=r.NULL_COLOR=void 0;let u=0,d=0,g=0,l=0;var m,b,C,p,o;function c(f){const y=f.toString(16);return y.length<2?"0"+y:y}function a(f,y){return f<y?(y+.05)/(f+.05):(f+.05)/(y+.05)}r.NULL_COLOR={css:"#00000000",rgba:0},(function(f){f.toCss=function(y,R,k,D){return D!==void 0?`#${c(y)}${c(R)}${c(k)}${c(D)}`:`#${c(y)}${c(R)}${c(k)}`},f.toRgba=function(y,R,k,D=255){return(y<<24|R<<16|k<<8|D)>>>0},f.toColor=function(y,R,k,D){return{css:f.toCss(y,R,k,D),rgba:f.toRgba(y,R,k,D)}}})(m||(r.channels=m={})),(function(f){function y(R,k){return l=Math.round(255*k),[u,d,g]=o.toChannels(R.rgba),{css:m.toCss(u,d,g,l),rgba:m.toRgba(u,d,g,l)}}f.blend=function(R,k){if(l=(255&k.rgba)/255,l===1)return{css:k.css,rgba:k.rgba};const D=k.rgba>>24&255,E=k.rgba>>16&255,L=k.rgba>>8&255,z=R.rgba>>24&255,H=R.rgba>>16&255,P=R.rgba>>8&255;return u=z+Math.round((D-z)*l),d=H+Math.round((E-H)*l),g=P+Math.round((L-P)*l),{css:m.toCss(u,d,g),rgba:m.toRgba(u,d,g)}},f.isOpaque=function(R){return(255&R.rgba)==255},f.ensureContrastRatio=function(R,k,D){const E=o.ensureContrastRatio(R.rgba,k.rgba,D);if(E)return m.toColor(E>>24&255,E>>16&255,E>>8&255)},f.opaque=function(R){const k=(255|R.rgba)>>>0;return[u,d,g]=o.toChannels(k),{css:m.toCss(u,d,g),rgba:k}},f.opacity=y,f.multiplyOpacity=function(R,k){return l=255&R.rgba,y(R,l*k/255)},f.toColorRGB=function(R){return[R.rgba>>24&255,R.rgba>>16&255,R.rgba>>8&255]}})(b||(r.color=b={})),(function(f){let y,R;try{const k=document.createElement("canvas");k.width=1,k.height=1;const D=k.getContext("2d",{willReadFrequently:!0});D&&(y=D,y.globalCompositeOperation="copy",R=y.createLinearGradient(0,0,1,1))}catch{}f.toColor=function(k){if(k.match(/#[\da-f]{3,8}/i))switch(k.length){case 4:return u=parseInt(k.slice(1,2).repeat(2),16),d=parseInt(k.slice(2,3).repeat(2),16),g=parseInt(k.slice(3,4).repeat(2),16),m.toColor(u,d,g);case 5:return u=parseInt(k.slice(1,2).repeat(2),16),d=parseInt(k.slice(2,3).repeat(2),16),g=parseInt(k.slice(3,4).repeat(2),16),l=parseInt(k.slice(4,5).repeat(2),16),m.toColor(u,d,g,l);case 7:return{css:k,rgba:(parseInt(k.slice(1),16)<<8|255)>>>0};case 9:return{css:k,rgba:parseInt(k.slice(1),16)>>>0}}const D=k.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(D)return u=parseInt(D[1]),d=parseInt(D[2]),g=parseInt(D[3]),l=Math.round(255*(D[5]===void 0?1:parseFloat(D[5]))),m.toColor(u,d,g,l);if(!y||!R)throw new Error("css.toColor: Unsupported css format");if(y.fillStyle=R,y.fillStyle=k,typeof y.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(y.fillRect(0,0,1,1),[u,d,g,l]=y.getImageData(0,0,1,1).data,l!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:m.toRgba(u,d,g,l),css:k}}})(C||(r.css=C={})),(function(f){function y(R,k,D){const E=R/255,L=k/255,z=D/255;return .2126*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))+.7152*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))+.0722*(z<=.03928?z/12.92:Math.pow((z+.055)/1.055,2.4))}f.relativeLuminance=function(R){return y(R>>16&255,R>>8&255,255&R)},f.relativeLuminance2=y})(p||(r.rgb=p={})),(function(f){function y(k,D,E){const L=k>>24&255,z=k>>16&255,H=k>>8&255;let P=D>>24&255,I=D>>16&255,K=D>>8&255,X=a(p.relativeLuminance2(P,I,K),p.relativeLuminance2(L,z,H));for(;X<E&&(P>0||I>0||K>0);)P-=Math.max(0,Math.ceil(.1*P)),I-=Math.max(0,Math.ceil(.1*I)),K-=Math.max(0,Math.ceil(.1*K)),X=a(p.relativeLuminance2(P,I,K),p.relativeLuminance2(L,z,H));return(P<<24|I<<16|K<<8|255)>>>0}function R(k,D,E){const L=k>>24&255,z=k>>16&255,H=k>>8&255;let P=D>>24&255,I=D>>16&255,K=D>>8&255,X=a(p.relativeLuminance2(P,I,K),p.relativeLuminance2(L,z,H));for(;X<E&&(P<255||I<255||K<255);)P=Math.min(255,P+Math.ceil(.1*(255-P))),I=Math.min(255,I+Math.ceil(.1*(255-I))),K=Math.min(255,K+Math.ceil(.1*(255-K))),X=a(p.relativeLuminance2(P,I,K),p.relativeLuminance2(L,z,H));return(P<<24|I<<16|K<<8|255)>>>0}f.blend=function(k,D){if(l=(255&D)/255,l===1)return D;const E=D>>24&255,L=D>>16&255,z=D>>8&255,H=k>>24&255,P=k>>16&255,I=k>>8&255;return u=H+Math.round((E-H)*l),d=P+Math.round((L-P)*l),g=I+Math.round((z-I)*l),m.toRgba(u,d,g)},f.ensureContrastRatio=function(k,D,E){const L=p.relativeLuminance(k>>8),z=p.relativeLuminance(D>>8);if(a(L,z)<E){if(z<L){const I=y(k,D,E),K=a(L,p.relativeLuminance(I>>8));if(K<E){const X=R(k,D,E);return K>a(L,p.relativeLuminance(X>>8))?I:X}return I}const H=R(k,D,E),P=a(L,p.relativeLuminance(H>>8));if(P<E){const I=y(k,D,E);return P>a(L,p.relativeLuminance(I>>8))?H:I}return H}},f.reduceLuminance=y,f.increaseLuminance=R,f.toChannels=function(k){return[k>>24&255,k>>16&255,k>>8&255,255&k]}})(o||(r.rgba=o={})),r.toPaddedHex=c,r.contrastRatio=a},8969:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreTerminal=void 0;const d=u(844),g=u(2585),l=u(4348),m=u(7866),b=u(744),C=u(7302),p=u(6975),o=u(8460),c=u(1753),a=u(1480),f=u(7994),y=u(9282),R=u(5435),k=u(5981),D=u(2660);let E=!1;class L extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new o.EventEmitter),this._onScroll.event((H=>{var P;(P=this._onScrollApi)==null||P.fire(H.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(H){for(const P in H)this.optionsService.options[P]=H[P]}constructor(H){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new o.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new o.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new o.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new o.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new o.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new o.EventEmitter),this._instantiationService=new l.InstantiationService,this.optionsService=this.register(new C.OptionsService(H)),this._instantiationService.setService(g.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(b.BufferService)),this._instantiationService.setService(g.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(m.LogService)),this._instantiationService.setService(g.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(p.CoreService)),this._instantiationService.setService(g.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(c.CoreMouseService)),this._instantiationService.setService(g.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(a.UnicodeService)),this._instantiationService.setService(g.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(f.CharsetService),this._instantiationService.setService(g.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(D.OscLinkService),this._instantiationService.setService(g.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new R.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,o.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,o.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,o.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,o.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((P=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((P=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new k.WriteBuffer(((P,I)=>this._inputHandler.parse(P,I)))),this.register((0,o.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(H,P){this._writeBuffer.write(H,P)}writeSync(H,P){this._logService.logLevel<=g.LogLevelEnum.WARN&&!E&&(this._logService.warn("writeSync is unreliable and will be removed soon."),E=!0),this._writeBuffer.writeSync(H,P)}input(H,P=!0){this.coreService.triggerDataEvent(H,P)}resize(H,P){isNaN(H)||isNaN(P)||(H=Math.max(H,b.MINIMUM_COLS),P=Math.max(P,b.MINIMUM_ROWS),this._bufferService.resize(H,P))}scroll(H,P=!1){this._bufferService.scroll(H,P)}scrollLines(H,P,I){this._bufferService.scrollLines(H,P,I)}scrollPages(H){this.scrollLines(H*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(H){const P=H-this._bufferService.buffer.ydisp;P!==0&&this.scrollLines(P)}registerEscHandler(H,P){return this._inputHandler.registerEscHandler(H,P)}registerDcsHandler(H,P){return this._inputHandler.registerDcsHandler(H,P)}registerCsiHandler(H,P){return this._inputHandler.registerCsiHandler(H,P)}registerOscHandler(H,P){return this._inputHandler.registerOscHandler(H,P)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let H=!1;const P=this.optionsService.rawOptions.windowsPty;P&&P.buildNumber!==void 0&&P.buildNumber!==void 0?H=P.backend==="conpty"&&P.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(H=!0),H?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const H=[];H.push(this.onLineFeed(y.updateWindowsModeWrappedState.bind(null,this._bufferService))),H.push(this.registerCsiHandler({final:"H"},(()=>((0,y.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)((()=>{for(const P of H)P.dispose()}))}}}r.CoreTerminal=L},8460:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.runAndSubscribe=r.forwardEvent=r.EventEmitter=void 0,r.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===u)return void this._listeners.splice(d,1)}}})),this._event}fire(u,d){const g=[];for(let l=0;l<this._listeners.length;l++)g.push(this._listeners[l]);for(let l=0;l<g.length;l++)g[l].call(void 0,u,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},r.forwardEvent=function(u,d){return u((g=>d.fire(g)))},r.runAndSubscribe=function(u,d){return d(void 0),u((g=>d(g)))}},5435:function(A,r,u){var d=this&&this.__decorate||function(U,T,F,B){var W,Z=arguments.length,ne=Z<3?T:B===null?B=Object.getOwnPropertyDescriptor(T,F):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ne=Reflect.decorate(U,T,F,B);else for(var ge=U.length-1;ge>=0;ge--)(W=U[ge])&&(ne=(Z<3?W(ne):Z>3?W(T,F,ne):W(T,F))||ne);return Z>3&&ne&&Object.defineProperty(T,F,ne),ne},g=this&&this.__param||function(U,T){return function(F,B){T(F,B,U)}};Object.defineProperty(r,"__esModule",{value:!0}),r.InputHandler=r.WindowsOptionsReportType=void 0;const l=u(2584),m=u(7116),b=u(2015),C=u(844),p=u(482),o=u(8437),c=u(8460),a=u(643),f=u(511),y=u(3734),R=u(2585),k=u(1480),D=u(6242),E=u(6351),L=u(5941),z={"(":0,")":1,"*":2,"+":3,"-":1,".":2},H=131072;function P(U,T){if(U>24)return T.setWinLines||!1;switch(U){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 I;(function(U){U[U.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",U[U.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(I||(r.WindowsOptionsReportType=I={}));let K=0;class X extends C.Disposable{getAttrData(){return this._curAttrData}constructor(T,F,B,W,Z,ne,ge,xe,J=new b.EscapeSequenceParser){super(),this._bufferService=T,this._charsetService=F,this._coreService=B,this._logService=W,this._optionsService=Z,this._oscLinkService=ne,this._coreMouseService=ge,this._unicodeService=xe,this._parser=J,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new p.StringToUtf32,this._utf8Decoder=new p.Utf8ToUtf32,this._workCell=new f.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=o.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=o.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new c.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new c.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new c.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new c.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new c.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new c.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new c.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new c.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new c.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new c.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new c.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new c.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new c.EventEmitter),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 Y(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((G=>this._activeBuffer=G.activeBuffer))),this._parser.setCsiHandlerFallback(((G,de)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(G),params:de.toArray()})})),this._parser.setEscHandlerFallback((G=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(G)})})),this._parser.setExecuteHandlerFallback((G=>{this._logService.debug("Unknown EXECUTE code: ",{code:G})})),this._parser.setOscHandlerFallback(((G,de,oe)=>{this._logService.debug("Unknown OSC code: ",{identifier:G,action:de,data:oe})})),this._parser.setDcsHandlerFallback(((G,de,oe)=>{de==="HOOK"&&(oe=oe.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(G),action:de,payload:oe})})),this._parser.setPrintHandler(((G,de,oe)=>this.print(G,de,oe))),this._parser.registerCsiHandler({final:"@"},(G=>this.insertChars(G))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(G=>this.scrollLeft(G))),this._parser.registerCsiHandler({final:"A"},(G=>this.cursorUp(G))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(G=>this.scrollRight(G))),this._parser.registerCsiHandler({final:"B"},(G=>this.cursorDown(G))),this._parser.registerCsiHandler({final:"C"},(G=>this.cursorForward(G))),this._parser.registerCsiHandler({final:"D"},(G=>this.cursorBackward(G))),this._parser.registerCsiHandler({final:"E"},(G=>this.cursorNextLine(G))),this._parser.registerCsiHandler({final:"F"},(G=>this.cursorPrecedingLine(G))),this._parser.registerCsiHandler({final:"G"},(G=>this.cursorCharAbsolute(G))),this._parser.registerCsiHandler({final:"H"},(G=>this.cursorPosition(G))),this._parser.registerCsiHandler({final:"I"},(G=>this.cursorForwardTab(G))),this._parser.registerCsiHandler({final:"J"},(G=>this.eraseInDisplay(G,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(G=>this.eraseInDisplay(G,!0))),this._parser.registerCsiHandler({final:"K"},(G=>this.eraseInLine(G,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(G=>this.eraseInLine(G,!0))),this._parser.registerCsiHandler({final:"L"},(G=>this.insertLines(G))),this._parser.registerCsiHandler({final:"M"},(G=>this.deleteLines(G))),this._parser.registerCsiHandler({final:"P"},(G=>this.deleteChars(G))),this._parser.registerCsiHandler({final:"S"},(G=>this.scrollUp(G))),this._parser.registerCsiHandler({final:"T"},(G=>this.scrollDown(G))),this._parser.registerCsiHandler({final:"X"},(G=>this.eraseChars(G))),this._parser.registerCsiHandler({final:"Z"},(G=>this.cursorBackwardTab(G))),this._parser.registerCsiHandler({final:"`"},(G=>this.charPosAbsolute(G))),this._parser.registerCsiHandler({final:"a"},(G=>this.hPositionRelative(G))),this._parser.registerCsiHandler({final:"b"},(G=>this.repeatPrecedingCharacter(G))),this._parser.registerCsiHandler({final:"c"},(G=>this.sendDeviceAttributesPrimary(G))),this._parser.registerCsiHandler({prefix:">",final:"c"},(G=>this.sendDeviceAttributesSecondary(G))),this._parser.registerCsiHandler({final:"d"},(G=>this.linePosAbsolute(G))),this._parser.registerCsiHandler({final:"e"},(G=>this.vPositionRelative(G))),this._parser.registerCsiHandler({final:"f"},(G=>this.hVPosition(G))),this._parser.registerCsiHandler({final:"g"},(G=>this.tabClear(G))),this._parser.registerCsiHandler({final:"h"},(G=>this.setMode(G))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(G=>this.setModePrivate(G))),this._parser.registerCsiHandler({final:"l"},(G=>this.resetMode(G))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(G=>this.resetModePrivate(G))),this._parser.registerCsiHandler({final:"m"},(G=>this.charAttributes(G))),this._parser.registerCsiHandler({final:"n"},(G=>this.deviceStatus(G))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(G=>this.deviceStatusPrivate(G))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(G=>this.softReset(G))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(G=>this.setCursorStyle(G))),this._parser.registerCsiHandler({final:"r"},(G=>this.setScrollRegion(G))),this._parser.registerCsiHandler({final:"s"},(G=>this.saveCursor(G))),this._parser.registerCsiHandler({final:"t"},(G=>this.windowOptions(G))),this._parser.registerCsiHandler({final:"u"},(G=>this.restoreCursor(G))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(G=>this.insertColumns(G))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(G=>this.deleteColumns(G))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(G=>this.selectProtected(G))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(G=>this.requestMode(G,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(G=>this.requestMode(G,!1))),this._parser.setExecuteHandler(l.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(l.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(l.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(l.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(l.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(l.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(l.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(l.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(l.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new D.OscHandler((G=>(this.setTitle(G),this.setIconName(G),!0)))),this._parser.registerOscHandler(1,new D.OscHandler((G=>this.setIconName(G)))),this._parser.registerOscHandler(2,new D.OscHandler((G=>this.setTitle(G)))),this._parser.registerOscHandler(4,new D.OscHandler((G=>this.setOrReportIndexedColor(G)))),this._parser.registerOscHandler(8,new D.OscHandler((G=>this.setHyperlink(G)))),this._parser.registerOscHandler(10,new D.OscHandler((G=>this.setOrReportFgColor(G)))),this._parser.registerOscHandler(11,new D.OscHandler((G=>this.setOrReportBgColor(G)))),this._parser.registerOscHandler(12,new D.OscHandler((G=>this.setOrReportCursorColor(G)))),this._parser.registerOscHandler(104,new D.OscHandler((G=>this.restoreIndexedColor(G)))),this._parser.registerOscHandler(110,new D.OscHandler((G=>this.restoreFgColor(G)))),this._parser.registerOscHandler(111,new D.OscHandler((G=>this.restoreBgColor(G)))),this._parser.registerOscHandler(112,new D.OscHandler((G=>this.restoreCursorColor(G)))),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(const G in m.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:G},(()=>this.selectCharset("("+G))),this._parser.registerEscHandler({intermediates:")",final:G},(()=>this.selectCharset(")"+G))),this._parser.registerEscHandler({intermediates:"*",final:G},(()=>this.selectCharset("*"+G))),this._parser.registerEscHandler({intermediates:"+",final:G},(()=>this.selectCharset("+"+G))),this._parser.registerEscHandler({intermediates:"-",final:G},(()=>this.selectCharset("-"+G))),this._parser.registerEscHandler({intermediates:".",final:G},(()=>this.selectCharset("."+G))),this._parser.registerEscHandler({intermediates:"/",final:G},(()=>this.selectCharset("/"+G)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((G=>(this._logService.error("Parsing error: ",G),G))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new E.DcsHandler(((G,de)=>this.requestStatusString(G,de))))}_preserveStack(T,F,B,W){this._parseStack.paused=!0,this._parseStack.cursorStartX=T,this._parseStack.cursorStartY=F,this._parseStack.decodedLength=B,this._parseStack.position=W}_logSlowResolvingAsync(T){this._logService.logLevel<=R.LogLevelEnum.WARN&&Promise.race([T,new Promise(((F,B)=>setTimeout((()=>B("#SLOW_TIMEOUT")),5e3)))]).catch((F=>{if(F!=="#SLOW_TIMEOUT")throw F;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(T,F){let B,W=this._activeBuffer.x,Z=this._activeBuffer.y,ne=0;const ge=this._parseStack.paused;if(ge){if(B=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,F))return this._logSlowResolvingAsync(B),B;W=this._parseStack.cursorStartX,Z=this._parseStack.cursorStartY,this._parseStack.paused=!1,T.length>H&&(ne=this._parseStack.position+H)}if(this._logService.logLevel<=R.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof T=="string"?` "${T}"`:` "${Array.prototype.map.call(T,(G=>String.fromCharCode(G))).join("")}"`),typeof T=="string"?T.split("").map((G=>G.charCodeAt(0))):T),this._parseBuffer.length<T.length&&this._parseBuffer.length<H&&(this._parseBuffer=new Uint32Array(Math.min(T.length,H))),ge||this._dirtyRowTracker.clearRange(),T.length>H)for(let G=ne;G<T.length;G+=H){const de=G+H<T.length?G+H:T.length,oe=typeof T=="string"?this._stringDecoder.decode(T.substring(G,de),this._parseBuffer):this._utf8Decoder.decode(T.subarray(G,de),this._parseBuffer);if(B=this._parser.parse(this._parseBuffer,oe))return this._preserveStack(W,Z,oe,G),this._logSlowResolvingAsync(B),B}else if(!ge){const G=typeof T=="string"?this._stringDecoder.decode(T,this._parseBuffer):this._utf8Decoder.decode(T,this._parseBuffer);if(B=this._parser.parse(this._parseBuffer,G))return this._preserveStack(W,Z,G,0),this._logSlowResolvingAsync(B),B}this._activeBuffer.x===W&&this._activeBuffer.y===Z||this._onCursorMove.fire();const xe=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),J=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);J<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(J,this._bufferService.rows-1),Math.min(xe,this._bufferService.rows-1))}print(T,F,B){let W,Z;const ne=this._charsetService.charset,ge=this._optionsService.rawOptions.screenReaderMode,xe=this._bufferService.cols,J=this._coreService.decPrivateModes.wraparound,G=this._coreService.modes.insertMode,de=this._curAttrData;let oe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&B-F>0&&oe.getWidth(this._activeBuffer.x-1)===2&&oe.setCellFromCodepoint(this._activeBuffer.x-1,0,1,de);let Ae=this._parser.precedingJoinState;for(let Oe=F;Oe<B;++Oe){if(W=T[Oe],W<127&&ne){const ye=ne[String.fromCharCode(W)];ye&&(W=ye.charCodeAt(0))}const Xe=this._unicodeService.charProperties(W,Ae);Z=k.UnicodeService.extractWidth(Xe);const We=k.UnicodeService.extractShouldJoin(Xe),rt=We?k.UnicodeService.extractWidth(Ae):0;if(Ae=Xe,ge&&this._onA11yChar.fire((0,p.stringFromCodePoint)(W)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+Z-rt>xe){if(J){const ye=oe;let Te=this._activeBuffer.x-rt;for(this._activeBuffer.x=rt,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),oe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),rt>0&&oe instanceof o.BufferLine&&oe.copyCellsFrom(ye,Te,0,rt,!1);Te<xe;)ye.setCellFromCodepoint(Te++,0,1,de)}else if(this._activeBuffer.x=xe-1,Z===2)continue}if(We&&this._activeBuffer.x){const ye=oe.getWidth(this._activeBuffer.x-1)?1:2;oe.addCodepointToCell(this._activeBuffer.x-ye,W,Z);for(let Te=Z-rt;--Te>=0;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,de)}else if(G&&(oe.insertCells(this._activeBuffer.x,Z-rt,this._activeBuffer.getNullCell(de)),oe.getWidth(xe-1)===2&&oe.setCellFromCodepoint(xe-1,a.NULL_CELL_CODE,a.NULL_CELL_WIDTH,de)),oe.setCellFromCodepoint(this._activeBuffer.x++,W,Z,de),Z>0)for(;--Z;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,de)}this._parser.precedingJoinState=Ae,this._activeBuffer.x<xe&&B-F>0&&oe.getWidth(this._activeBuffer.x)===0&&!oe.hasContent(this._activeBuffer.x)&&oe.setCellFromCodepoint(this._activeBuffer.x,0,1,de),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(T,F){return T.final!=="t"||T.prefix||T.intermediates?this._parser.registerCsiHandler(T,F):this._parser.registerCsiHandler(T,(B=>!P(B.params[0],this._optionsService.rawOptions.windowOptions)||F(B)))}registerDcsHandler(T,F){return this._parser.registerDcsHandler(T,new E.DcsHandler(F))}registerEscHandler(T,F){return this._parser.registerEscHandler(T,F)}registerOscHandler(T,F){return this._parser.registerOscHandler(T,new D.OscHandler(F))}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(){var T;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&&((T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&T.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);F.hasWidth(this._activeBuffer.x)&&!F.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const T=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-T),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(T=this._bufferService.cols-1){this._activeBuffer.x=Math.min(T,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(T,F){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=T,this._activeBuffer.y=this._activeBuffer.scrollTop+F):(this._activeBuffer.x=T,this._activeBuffer.y=F),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(T,F){this._restrictCursor(),this._setCursor(this._activeBuffer.x+T,this._activeBuffer.y+F)}cursorUp(T){const F=this._activeBuffer.y-this._activeBuffer.scrollTop;return F>=0?this._moveCursor(0,-Math.min(F,T.params[0]||1)):this._moveCursor(0,-(T.params[0]||1)),!0}cursorDown(T){const F=this._activeBuffer.scrollBottom-this._activeBuffer.y;return F>=0?this._moveCursor(0,Math.min(F,T.params[0]||1)):this._moveCursor(0,T.params[0]||1),!0}cursorForward(T){return this._moveCursor(T.params[0]||1,0),!0}cursorBackward(T){return this._moveCursor(-(T.params[0]||1),0),!0}cursorNextLine(T){return this.cursorDown(T),this._activeBuffer.x=0,!0}cursorPrecedingLine(T){return this.cursorUp(T),this._activeBuffer.x=0,!0}cursorCharAbsolute(T){return this._setCursor((T.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(T){return this._setCursor(T.length>=2?(T.params[1]||1)-1:0,(T.params[0]||1)-1),!0}charPosAbsolute(T){return this._setCursor((T.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(T){return this._moveCursor(T.params[0]||1,0),!0}linePosAbsolute(T){return this._setCursor(this._activeBuffer.x,(T.params[0]||1)-1),!0}vPositionRelative(T){return this._moveCursor(0,T.params[0]||1),!0}hVPosition(T){return this.cursorPosition(T),!0}tabClear(T){const F=T.params[0];return F===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:F===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(T){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let F=T.params[0]||1;for(;F--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(T){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let F=T.params[0]||1;for(;F--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(T){const F=T.params[0];return F===1&&(this._curAttrData.bg|=536870912),F!==2&&F!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(T,F,B,W=!1,Z=!1){const ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);ne.replaceCells(F,B,this._activeBuffer.getNullCell(this._eraseAttrData()),Z),W&&(ne.isWrapped=!1)}_resetBufferLine(T,F=!1){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);B&&(B.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),F),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+T),B.isWrapped=!1)}eraseInDisplay(T,F=!1){let B;switch(this._restrictCursor(this._bufferService.cols),T.params[0]){case 0:for(B=this._activeBuffer.y,this._dirtyRowTracker.markDirty(B),this._eraseInBufferLine(B++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,F);B<this._bufferService.rows;B++)this._resetBufferLine(B,F);this._dirtyRowTracker.markDirty(B);break;case 1:for(B=this._activeBuffer.y,this._dirtyRowTracker.markDirty(B),this._eraseInBufferLine(B,0,this._activeBuffer.x+1,!0,F),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(B+1).isWrapped=!1);B--;)this._resetBufferLine(B,F);this._dirtyRowTracker.markDirty(0);break;case 2:for(B=this._bufferService.rows,this._dirtyRowTracker.markDirty(B-1);B--;)this._resetBufferLine(B,F);this._dirtyRowTracker.markDirty(0);break;case 3:const W=this._activeBuffer.lines.length-this._bufferService.rows;W>0&&(this._activeBuffer.lines.trimStart(W),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-W,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-W,0),this._onScroll.fire(0))}return!0}eraseInLine(T,F=!1){switch(this._restrictCursor(this._bufferService.cols),T.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,F);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,F);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,F)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(T){this._restrictCursor();let F=T.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=this._activeBuffer.ybase+this._activeBuffer.y,W=this._bufferService.rows-1-this._activeBuffer.scrollBottom,Z=this._bufferService.rows-1+this._activeBuffer.ybase-W+1;for(;F--;)this._activeBuffer.lines.splice(Z-1,1),this._activeBuffer.lines.splice(B,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(T){this._restrictCursor();let F=T.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=this._activeBuffer.ybase+this._activeBuffer.y;let W;for(W=this._bufferService.rows-1-this._activeBuffer.scrollBottom,W=this._bufferService.rows-1+this._activeBuffer.ybase-W;F--;)this._activeBuffer.lines.splice(B,1),this._activeBuffer.lines.splice(W,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(T){this._restrictCursor();const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return F&&(F.insertCells(this._activeBuffer.x,T.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(T){this._restrictCursor();const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return F&&(F.deleteCells(this._activeBuffer.x,T.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(T){let F=T.params[0]||1;for(;F--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(T){let F=T.params[0]||1;for(;F--;)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(o.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(T){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const F=T.params[0]||1;for(let B=this._activeBuffer.scrollTop;B<=this._activeBuffer.scrollBottom;++B){const W=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);W.deleteCells(0,F,this._activeBuffer.getNullCell(this._eraseAttrData())),W.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(T){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const F=T.params[0]||1;for(let B=this._activeBuffer.scrollTop;B<=this._activeBuffer.scrollBottom;++B){const W=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);W.insertCells(0,F,this._activeBuffer.getNullCell(this._eraseAttrData())),W.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(T){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const F=T.params[0]||1;for(let B=this._activeBuffer.scrollTop;B<=this._activeBuffer.scrollBottom;++B){const W=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);W.insertCells(this._activeBuffer.x,F,this._activeBuffer.getNullCell(this._eraseAttrData())),W.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(T){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const F=T.params[0]||1;for(let B=this._activeBuffer.scrollTop;B<=this._activeBuffer.scrollBottom;++B){const W=this._activeBuffer.lines.get(this._activeBuffer.ybase+B);W.deleteCells(this._activeBuffer.x,F,this._activeBuffer.getNullCell(this._eraseAttrData())),W.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(T){this._restrictCursor();const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return F&&(F.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(T.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(T){const F=this._parser.precedingJoinState;if(!F)return!0;const B=T.params[0]||1,W=k.UnicodeService.extractWidth(F),Z=this._activeBuffer.x-W,ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(Z),ge=new Uint32Array(ne.length*B);let xe=0;for(let G=0;G<ne.length;){const de=ne.codePointAt(G)||0;ge[xe++]=de,G+=de>65535?2:1}let J=xe;for(let G=1;G<B;++G)ge.copyWithin(J,0,xe),J+=xe;return this.print(ge,0,J),!0}sendDeviceAttributesPrimary(T){return T.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(l.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(l.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(T){return T.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(l.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(l.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(T.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(l.C0.ESC+"[>83;40003;0c")),!0}_is(T){return(this._optionsService.rawOptions.termName+"").indexOf(T)===0}setMode(T){for(let F=0;F<T.length;F++)switch(T.params[F]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(T){for(let F=0;F<T.length;F++)switch(T.params[F]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,m.DEFAULT_CHARSET),this._charsetService.setgCharset(1,m.DEFAULT_CHARSET),this._charsetService.setgCharset(2,m.DEFAULT_CHARSET),this._charsetService.setgCharset(3,m.DEFAULT_CHARSET);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(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(T){for(let F=0;F<T.length;F++)switch(T.params[F]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(T){for(let F=0;F<T.length;F++)switch(T.params[F]){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:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),T.params[F]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(T,F){const B=this._coreService.decPrivateModes,{activeProtocol:W,activeEncoding:Z}=this._coreMouseService,ne=this._coreService,{buffers:ge,cols:xe}=this._bufferService,{active:J,alt:G}=ge,de=this._optionsService.rawOptions,oe=We=>We?1:2,Ae=T.params[0];return Oe=Ae,Xe=F?Ae===2?4:Ae===4?oe(ne.modes.insertMode):Ae===12?3:Ae===20?oe(de.convertEol):0:Ae===1?oe(B.applicationCursorKeys):Ae===3?de.windowOptions.setWinLines?xe===80?2:xe===132?1:0:0:Ae===6?oe(B.origin):Ae===7?oe(B.wraparound):Ae===8?3:Ae===9?oe(W==="X10"):Ae===12?oe(de.cursorBlink):Ae===25?oe(!ne.isCursorHidden):Ae===45?oe(B.reverseWraparound):Ae===66?oe(B.applicationKeypad):Ae===67?4:Ae===1e3?oe(W==="VT200"):Ae===1002?oe(W==="DRAG"):Ae===1003?oe(W==="ANY"):Ae===1004?oe(B.sendFocus):Ae===1005?4:Ae===1006?oe(Z==="SGR"):Ae===1015?4:Ae===1016?oe(Z==="SGR_PIXELS"):Ae===1048?1:Ae===47||Ae===1047||Ae===1049?oe(J===G):Ae===2004?oe(B.bracketedPasteMode):0,ne.triggerDataEvent(`${l.C0.ESC}[${F?"":"?"}${Oe};${Xe}$y`),!0;var Oe,Xe}_updateAttrColor(T,F,B,W,Z){return F===2?(T|=50331648,T&=-16777216,T|=y.AttributeData.fromColorRGB([B,W,Z])):F===5&&(T&=-50331904,T|=33554432|255&B),T}_extractColor(T,F,B){const W=[0,0,-1,0,0,0];let Z=0,ne=0;do{if(W[ne+Z]=T.params[F+ne],T.hasSubParams(F+ne)){const ge=T.getSubParams(F+ne);let xe=0;do W[1]===5&&(Z=1),W[ne+xe+1+Z]=ge[xe];while(++xe<ge.length&&xe+ne+1+Z<W.length);break}if(W[1]===5&&ne+Z>=2||W[1]===2&&ne+Z>=5)break;W[1]&&(Z=1)}while(++ne+F<T.length&&ne+Z<W.length);for(let ge=2;ge<W.length;++ge)W[ge]===-1&&(W[ge]=0);switch(W[0]){case 38:B.fg=this._updateAttrColor(B.fg,W[1],W[3],W[4],W[5]);break;case 48:B.bg=this._updateAttrColor(B.bg,W[1],W[3],W[4],W[5]);break;case 58:B.extended=B.extended.clone(),B.extended.underlineColor=this._updateAttrColor(B.extended.underlineColor,W[1],W[3],W[4],W[5])}return ne}_processUnderline(T,F){F.extended=F.extended.clone(),(!~T||T>5)&&(T=1),F.extended.underlineStyle=T,F.fg|=268435456,T===0&&(F.fg&=-268435457),F.updateExtended()}_processSGR0(T){T.fg=o.DEFAULT_ATTR_DATA.fg,T.bg=o.DEFAULT_ATTR_DATA.bg,T.extended=T.extended.clone(),T.extended.underlineStyle=0,T.extended.underlineColor&=-67108864,T.updateExtended()}charAttributes(T){if(T.length===1&&T.params[0]===0)return this._processSGR0(this._curAttrData),!0;const F=T.length;let B;const W=this._curAttrData;for(let Z=0;Z<F;Z++)B=T.params[Z],B>=30&&B<=37?(W.fg&=-50331904,W.fg|=16777216|B-30):B>=40&&B<=47?(W.bg&=-50331904,W.bg|=16777216|B-40):B>=90&&B<=97?(W.fg&=-50331904,W.fg|=16777224|B-90):B>=100&&B<=107?(W.bg&=-50331904,W.bg|=16777224|B-100):B===0?this._processSGR0(W):B===1?W.fg|=134217728:B===3?W.bg|=67108864:B===4?(W.fg|=268435456,this._processUnderline(T.hasSubParams(Z)?T.getSubParams(Z)[0]:1,W)):B===5?W.fg|=536870912:B===7?W.fg|=67108864:B===8?W.fg|=1073741824:B===9?W.fg|=2147483648:B===2?W.bg|=134217728:B===21?this._processUnderline(2,W):B===22?(W.fg&=-134217729,W.bg&=-134217729):B===23?W.bg&=-67108865:B===24?(W.fg&=-268435457,this._processUnderline(0,W)):B===25?W.fg&=-536870913:B===27?W.fg&=-67108865:B===28?W.fg&=-1073741825:B===29?W.fg&=2147483647:B===39?(W.fg&=-67108864,W.fg|=16777215&o.DEFAULT_ATTR_DATA.fg):B===49?(W.bg&=-67108864,W.bg|=16777215&o.DEFAULT_ATTR_DATA.bg):B===38||B===48||B===58?Z+=this._extractColor(T,Z,W):B===53?W.bg|=1073741824:B===55?W.bg&=-1073741825:B===59?(W.extended=W.extended.clone(),W.extended.underlineColor=-1,W.updateExtended()):B===100?(W.fg&=-67108864,W.fg|=16777215&o.DEFAULT_ATTR_DATA.fg,W.bg&=-67108864,W.bg|=16777215&o.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",B);return!0}deviceStatus(T){switch(T.params[0]){case 5:this._coreService.triggerDataEvent(`${l.C0.ESC}[0n`);break;case 6:const F=this._activeBuffer.y+1,B=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${l.C0.ESC}[${F};${B}R`)}return!0}deviceStatusPrivate(T){if(T.params[0]===6){const F=this._activeBuffer.y+1,B=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${l.C0.ESC}[?${F};${B}R`)}return!0}softReset(T){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=o.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(T){const F=T.params[0]||1;switch(F){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const B=F%2==1;return this._optionsService.options.cursorBlink=B,!0}setScrollRegion(T){const F=T.params[0]||1;let B;return(T.length<2||(B=T.params[1])>this._bufferService.rows||B===0)&&(B=this._bufferService.rows),B>F&&(this._activeBuffer.scrollTop=F-1,this._activeBuffer.scrollBottom=B-1,this._setCursor(0,0)),!0}windowOptions(T){if(!P(T.params[0],this._optionsService.rawOptions.windowOptions))return!0;const F=T.length>1?T.params[1]:0;switch(T.params[0]){case 14:F!==2&&this._onRequestWindowsOptionsReport.fire(I.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(I.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${l.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:F!==0&&F!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),F!==0&&F!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:F!==0&&F!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),F!==0&&F!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(T){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(T){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(T){return this._windowTitle=T,this._onTitleChange.fire(T),!0}setIconName(T){return this._iconName=T,!0}setOrReportIndexedColor(T){const F=[],B=T.split(";");for(;B.length>1;){const W=B.shift(),Z=B.shift();if(/^\d+$/.exec(W)){const ne=parseInt(W);if($(ne))if(Z==="?")F.push({type:0,index:ne});else{const ge=(0,L.parseColor)(Z);ge&&F.push({type:1,index:ne,color:ge})}}}return F.length&&this._onColor.fire(F),!0}setHyperlink(T){const F=T.split(";");return!(F.length<2)&&(F[1]?this._createHyperlink(F[0],F[1]):!F[0]&&this._finishHyperlink())}_createHyperlink(T,F){this._getCurrentLinkId()&&this._finishHyperlink();const B=T.split(":");let W;const Z=B.findIndex((ne=>ne.startsWith("id=")));return Z!==-1&&(W=B[Z].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:W,uri:F}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(T,F){const B=T.split(";");for(let W=0;W<B.length&&!(F>=this._specialColors.length);++W,++F)if(B[W]==="?")this._onColor.fire([{type:0,index:this._specialColors[F]}]);else{const Z=(0,L.parseColor)(B[W]);Z&&this._onColor.fire([{type:1,index:this._specialColors[F],color:Z}])}return!0}setOrReportFgColor(T){return this._setOrReportSpecialColor(T,0)}setOrReportBgColor(T){return this._setOrReportSpecialColor(T,1)}setOrReportCursorColor(T){return this._setOrReportSpecialColor(T,2)}restoreIndexedColor(T){if(!T)return this._onColor.fire([{type:2}]),!0;const F=[],B=T.split(";");for(let W=0;W<B.length;++W)if(/^\d+$/.exec(B[W])){const Z=parseInt(B[W]);$(Z)&&F.push({type:2,index:Z})}return F.length&&this._onColor.fire(F),!0}restoreFgColor(T){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(T){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(T){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,m.DEFAULT_CHARSET),!0}selectCharset(T){return T.length!==2?(this.selectDefaultCharset(),!0):(T[0]==="/"||this._charsetService.setgCharset(z[T[0]],m.CHARSETS[T[1]]||m.DEFAULT_CHARSET),!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){const T=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,T,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=o.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=o.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(T){return this._charsetService.setgLevel(T),!0}screenAlignmentPattern(){const T=new f.CellData;T.content=4194373,T.fg=this._curAttrData.fg,T.bg=this._curAttrData.bg,this._setCursor(0,0);for(let F=0;F<this._bufferService.rows;++F){const B=this._activeBuffer.ybase+this._activeBuffer.y+F,W=this._activeBuffer.lines.get(B);W&&(W.fill(T),W.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(T,F){const B=this._bufferService.buffer,W=this._optionsService.rawOptions;return(Z=>(this._coreService.triggerDataEvent(`${l.C0.ESC}${Z}${l.C0.ESC}\\`),!0))(T==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:T==='"p'?'P1$r61;1"p':T==="r"?`P1$r${B.scrollTop+1};${B.scrollBottom+1}r`:T==="m"?"P1$r0m":T===" q"?`P1$r${{block:2,underline:4,bar:6}[W.cursorStyle]-(W.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(T,F){this._dirtyRowTracker.markRangeDirty(T,F)}}r.InputHandler=X;let Y=class{constructor(U){this._bufferService=U,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(U){U<this.start?this.start=U:U>this.end&&(this.end=U)}markRangeDirty(U,T){U>T&&(K=U,U=T,T=K),U<this.start&&(this.start=U),T>this.end&&(this.end=T)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function $(U){return 0<=U&&U<256}Y=d([g(0,R.IBufferService)],Y)},844:(A,r)=>{function u(d){for(const g of d)g.dispose();d.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.MutableDisposable=r.Disposable=void 0,r.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const g=this._disposables.indexOf(d);g!==-1&&this._disposables.splice(g,1)}},r.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var g;this._isDisposed||d===this._value||((g=this._value)==null||g.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)==null||d.dispose(),this._value=void 0}},r.toDisposable=function(d){return{dispose:d}},r.disposeArray=u,r.getDisposeArrayDisposable=function(d){return{dispose:()=>u(d)}}},1505:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FourKeyMap=r.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(g,l,m){this._data[g]||(this._data[g]={}),this._data[g][l]=m}get(g,l){return this._data[g]?this._data[g][l]:void 0}clear(){this._data={}}}r.TwoKeyMap=u,r.FourKeyMap=class{constructor(){this._data=new u}set(d,g,l,m,b){this._data.get(d,g)||this._data.set(d,g,new u),this._data.get(d,g).set(l,m,b)}get(d,g,l,m){var b;return(b=this._data.get(d,g))==null?void 0:b.get(l,m)}clear(){this._data.clear()}}},6114:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isChromeOS=r.isLinux=r.isWindows=r.isIphone=r.isIpad=r.isMac=r.getSafariVersion=r.isSafari=r.isLegacyEdge=r.isFirefox=r.isNode=void 0,r.isNode=typeof process<"u"&&"title"in process;const u=r.isNode?"node":navigator.userAgent,d=r.isNode?"node":navigator.platform;r.isFirefox=u.includes("Firefox"),r.isLegacyEdge=u.includes("Edge"),r.isSafari=/^((?!chrome|android).)*safari/i.test(u),r.getSafariVersion=function(){if(!r.isSafari)return 0;const g=u.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},r.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),r.isIpad=d==="iPad",r.isIphone=d==="iPhone",r.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),r.isLinux=d.indexOf("Linux")>=0,r.isChromeOS=/\bCrOS\b/.test(u)},6106:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SortedList=void 0;let u=0;r.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(u=this._search(this._getKey(d)),this._array.splice(u,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const g=this._getKey(d);if(g===void 0||(u=this._search(g),u===-1)||this._getKey(this._array[u])!==g)return!1;do if(this._array[u]===d)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===g);return!1}*getKeyIterator(d){if(this._array.length!==0&&(u=this._search(d),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===d))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===d)}forEachByKey(d,g){if(this._array.length!==0&&(u=this._search(d),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===d))do g(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===d)}values(){return[...this._array].values()}_search(d){let g=0,l=this._array.length-1;for(;l>=g;){let m=g+l>>1;const b=this._getKey(this._array[m]);if(b>d)l=m-1;else{if(!(b<d)){for(;m>0&&this._getKey(this._array[m-1])===d;)m--;return m}g=m+1}}return g}}},7226:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DebouncedIdleTask=r.IdleTaskQueue=r.PriorityTaskQueue=void 0;const d=u(6114);class g{constructor(){this._tasks=[],this._i=0}enqueue(b){this._tasks.push(b),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(b){this._idleCallback=void 0;let C=0,p=0,o=b.timeRemaining(),c=0;for(;this._i<this._tasks.length;){if(C=Date.now(),this._tasks[this._i]()||this._i++,C=Math.max(1,Date.now()-C),p=Math.max(C,p),c=b.timeRemaining(),1.5*p>c)return o-C<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(o-C))}ms`),void this._start();o=c}this.clear()}}class l extends g{_requestCallback(b){return setTimeout((()=>b(this._createDeadline(16))))}_cancelCallback(b){clearTimeout(b)}_createDeadline(b){const C=Date.now()+b;return{timeRemaining:()=>Math.max(0,C-Date.now())}}}r.PriorityTaskQueue=l,r.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(m){return requestIdleCallback(m)}_cancelCallback(m){cancelIdleCallback(m)}}:l,r.DebouncedIdleTask=class{constructor(){this._queue=new r.IdleTaskQueue}set(m){this._queue.clear(),this._queue.enqueue(m)}flush(){this._queue.flush()}}},9282:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.updateWindowsModeWrappedState=void 0;const d=u(643);r.updateWindowsModeWrappedState=function(g){const l=g.buffer.lines.get(g.buffer.ybase+g.buffer.y-1),m=l==null?void 0:l.get(g.cols-1),b=g.buffer.lines.get(g.buffer.ybase+g.buffer.y);b&&m&&(b.isWrapped=m[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&m[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ExtendedAttrs=r.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(l){return[l>>>16&255,l>>>8&255,255&l]}static fromColorRGB(l){return(255&l[0])<<16|(255&l[1])<<8|255&l[2]}clone(){const l=new u;return l.fg=this.fg,l.bg=this.bg,l.extended=this.extended.clone(),l}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}r.AttributeData=u;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(l){this._ext=l}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(l){this._ext&=-469762049,this._ext|=l<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(l){this._ext&=-67108864,this._ext|=67108863&l}get urlId(){return this._urlId}set urlId(l){this._urlId=l}get underlineVariantOffset(){const l=(3758096384&this._ext)>>29;return l<0?4294967288^l:l}set underlineVariantOffset(l){this._ext&=536870911,this._ext|=l<<29&3758096384}constructor(l=0,m=0){this._ext=0,this._urlId=0,this._ext=l,this._urlId=m}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}r.ExtendedAttrs=d},9092:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Buffer=r.MAX_BUFFER_SIZE=void 0;const d=u(6349),g=u(7226),l=u(3734),m=u(8437),b=u(4634),C=u(511),p=u(643),o=u(4863),c=u(7116);r.MAX_BUFFER_SIZE=4294967295,r.Buffer=class{constructor(a,f,y){this._hasScrollback=a,this._optionsService=f,this._bufferService=y,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=m.DEFAULT_ATTR_DATA.clone(),this.savedCharset=c.DEFAULT_CHARSET,this.markers=[],this._nullCell=C.CellData.fromCharData([0,p.NULL_CELL_CHAR,p.NULL_CELL_WIDTH,p.NULL_CELL_CODE]),this._whitespaceCell=C.CellData.fromCharData([0,p.WHITESPACE_CELL_CHAR,p.WHITESPACE_CELL_WIDTH,p.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new g.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(a){return a?(this._nullCell.fg=a.fg,this._nullCell.bg=a.bg,this._nullCell.extended=a.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new l.ExtendedAttrs),this._nullCell}getWhitespaceCell(a){return a?(this._whitespaceCell.fg=a.fg,this._whitespaceCell.bg=a.bg,this._whitespaceCell.extended=a.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new l.ExtendedAttrs),this._whitespaceCell}getBlankLine(a,f){return new m.BufferLine(this._bufferService.cols,this.getNullCell(a),f)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const a=this.ybase+this.y-this.ydisp;return a>=0&&a<this._rows}_getCorrectBufferLength(a){if(!this._hasScrollback)return a;const f=a+this._optionsService.rawOptions.scrollback;return f>r.MAX_BUFFER_SIZE?r.MAX_BUFFER_SIZE:f}fillViewportRows(a){if(this.lines.length===0){a===void 0&&(a=m.DEFAULT_ATTR_DATA);let f=this._rows;for(;f--;)this.lines.push(this.getBlankLine(a))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(a,f){const y=this.getNullCell(m.DEFAULT_ATTR_DATA);let R=0;const k=this._getCorrectBufferLength(f);if(k>this.lines.maxLength&&(this.lines.maxLength=k),this.lines.length>0){if(this._cols<a)for(let E=0;E<this.lines.length;E++)R+=+this.lines.get(E).resize(a,y);let D=0;if(this._rows<f)for(let E=this._rows;E<f;E++)this.lines.length<f+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new m.BufferLine(a,y)):this.ybase>0&&this.lines.length<=this.ybase+this.y+D+1?(this.ybase--,D++,this.ydisp>0&&this.ydisp--):this.lines.push(new m.BufferLine(a,y)));else for(let E=this._rows;E>f;E--)this.lines.length>f+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(k<this.lines.maxLength){const E=this.lines.length-k;E>0&&(this.lines.trimStart(E),this.ybase=Math.max(this.ybase-E,0),this.ydisp=Math.max(this.ydisp-E,0),this.savedY=Math.max(this.savedY-E,0)),this.lines.maxLength=k}this.x=Math.min(this.x,a-1),this.y=Math.min(this.y,f-1),D&&(this.y+=D),this.savedX=Math.min(this.savedX,a-1),this.scrollTop=0}if(this.scrollBottom=f-1,this._isReflowEnabled&&(this._reflow(a,f),this._cols>a))for(let D=0;D<this.lines.length;D++)R+=+this.lines.get(D).resize(a,y);this._cols=a,this._rows=f,this._memoryCleanupQueue.clear(),R>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let a=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,a=!1);let f=0;for(;this._memoryCleanupPosition<this.lines.length;)if(f+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),f>100)return!0;return a}get _isReflowEnabled(){const a=this._optionsService.rawOptions.windowsPty;return a&&a.buildNumber?this._hasScrollback&&a.backend==="conpty"&&a.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(a,f){this._cols!==a&&(a>this._cols?this._reflowLarger(a,f):this._reflowSmaller(a,f))}_reflowLarger(a,f){const y=(0,b.reflowLargerGetLinesToRemove)(this.lines,this._cols,a,this.ybase+this.y,this.getNullCell(m.DEFAULT_ATTR_DATA));if(y.length>0){const R=(0,b.reflowLargerCreateNewLayout)(this.lines,y);(0,b.reflowLargerApplyNewLayout)(this.lines,R.layout),this._reflowLargerAdjustViewport(a,f,R.countRemoved)}}_reflowLargerAdjustViewport(a,f,y){const R=this.getNullCell(m.DEFAULT_ATTR_DATA);let k=y;for(;k-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<f&&this.lines.push(new m.BufferLine(a,R))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-y,0)}_reflowSmaller(a,f){const y=this.getNullCell(m.DEFAULT_ATTR_DATA),R=[];let k=0;for(let D=this.lines.length-1;D>=0;D--){let E=this.lines.get(D);if(!E||!E.isWrapped&&E.getTrimmedLength()<=a)continue;const L=[E];for(;E.isWrapped&&D>0;)E=this.lines.get(--D),L.unshift(E);const z=this.ybase+this.y;if(z>=D&&z<D+L.length)continue;const H=L[L.length-1].getTrimmedLength(),P=(0,b.reflowSmallerGetNewLineLengths)(L,this._cols,a),I=P.length-L.length;let K;K=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+I):Math.max(0,this.lines.length-this.lines.maxLength+I);const X=[];for(let B=0;B<I;B++){const W=this.getBlankLine(m.DEFAULT_ATTR_DATA,!0);X.push(W)}X.length>0&&(R.push({start:D+L.length+k,newLines:X}),k+=X.length),L.push(...X);let Y=P.length-1,$=P[Y];$===0&&(Y--,$=P[Y]);let U=L.length-I-1,T=H;for(;U>=0;){const B=Math.min(T,$);if(L[Y]===void 0)break;if(L[Y].copyCellsFrom(L[U],T-B,$-B,B,!0),$-=B,$===0&&(Y--,$=P[Y]),T-=B,T===0){U--;const W=Math.max(U,0);T=(0,b.getWrappedLineTrimmedLength)(L,W,this._cols)}}for(let B=0;B<L.length;B++)P[B]<a&&L[B].setCell(P[B],y);let F=I-K;for(;F-- >0;)this.ybase===0?this.y<f-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+k)-f&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+I,this.ybase+f-1)}if(R.length>0){const D=[],E=[];for(let Y=0;Y<this.lines.length;Y++)E.push(this.lines.get(Y));const L=this.lines.length;let z=L-1,H=0,P=R[H];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+k);let I=0;for(let Y=Math.min(this.lines.maxLength-1,L+k-1);Y>=0;Y--)if(P&&P.start>z+I){for(let $=P.newLines.length-1;$>=0;$--)this.lines.set(Y--,P.newLines[$]);Y++,D.push({index:z+1,amount:P.newLines.length}),I+=P.newLines.length,P=R[++H]}else this.lines.set(Y,E[z--]);let K=0;for(let Y=D.length-1;Y>=0;Y--)D[Y].index+=K,this.lines.onInsertEmitter.fire(D[Y]),K+=D[Y].amount;const X=Math.max(0,L+k-this.lines.maxLength);X>0&&this.lines.onTrimEmitter.fire(X)}}translateBufferLineToString(a,f,y=0,R){const k=this.lines.get(a);return k?k.translateToString(f,y,R):""}getWrappedRangeForLine(a){let f=a,y=a;for(;f>0&&this.lines.get(f).isWrapped;)f--;for(;y+1<this.lines.length&&this.lines.get(y+1).isWrapped;)y++;return{first:f,last:y}}setupTabStops(a){for(a!=null?this.tabs[a]||(a=this.prevStop(a)):(this.tabs={},a=0);a<this._cols;a+=this._optionsService.rawOptions.tabStopWidth)this.tabs[a]=!0}prevStop(a){for(a==null&&(a=this.x);!this.tabs[--a]&&a>0;);return a>=this._cols?this._cols-1:a<0?0:a}nextStop(a){for(a==null&&(a=this.x);!this.tabs[++a]&&a<this._cols;);return a>=this._cols?this._cols-1:a<0?0:a}clearMarkers(a){this._isClearing=!0;for(let f=0;f<this.markers.length;f++)this.markers[f].line===a&&(this.markers[f].dispose(),this.markers.splice(f--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let a=0;a<this.markers.length;a++)this.markers[a].dispose(),this.markers.splice(a--,1);this._isClearing=!1}addMarker(a){const f=new o.Marker(a);return this.markers.push(f),f.register(this.lines.onTrim((y=>{f.line-=y,f.line<0&&f.dispose()}))),f.register(this.lines.onInsert((y=>{f.line>=y.index&&(f.line+=y.amount)}))),f.register(this.lines.onDelete((y=>{f.line>=y.index&&f.line<y.index+y.amount&&f.dispose(),f.line>y.index&&(f.line-=y.amount)}))),f.register(f.onDispose((()=>this._removeMarker(f)))),f}_removeMarker(a){this._isClearing||this.markers.splice(this.markers.indexOf(a),1)}}},8437:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLine=r.DEFAULT_ATTR_DATA=void 0;const d=u(3734),g=u(511),l=u(643),m=u(482);r.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let b=0;class C{constructor(o,c,a=!1){this.isWrapped=a,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*o);const f=c||g.CellData.fromCharData([0,l.NULL_CELL_CHAR,l.NULL_CELL_WIDTH,l.NULL_CELL_CODE]);for(let y=0;y<o;++y)this.setCell(y,f);this.length=o}get(o){const c=this._data[3*o+0],a=2097151&c;return[this._data[3*o+1],2097152&c?this._combined[o]:a?(0,m.stringFromCodePoint)(a):"",c>>22,2097152&c?this._combined[o].charCodeAt(this._combined[o].length-1):a]}set(o,c){this._data[3*o+1]=c[l.CHAR_DATA_ATTR_INDEX],c[l.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[o]=c[1],this._data[3*o+0]=2097152|o|c[l.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*o+0]=c[l.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|c[l.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(o){return this._data[3*o+0]>>22}hasWidth(o){return 12582912&this._data[3*o+0]}getFg(o){return this._data[3*o+1]}getBg(o){return this._data[3*o+2]}hasContent(o){return 4194303&this._data[3*o+0]}getCodePoint(o){const c=this._data[3*o+0];return 2097152&c?this._combined[o].charCodeAt(this._combined[o].length-1):2097151&c}isCombined(o){return 2097152&this._data[3*o+0]}getString(o){const c=this._data[3*o+0];return 2097152&c?this._combined[o]:2097151&c?(0,m.stringFromCodePoint)(2097151&c):""}isProtected(o){return 536870912&this._data[3*o+2]}loadCell(o,c){return b=3*o,c.content=this._data[b+0],c.fg=this._data[b+1],c.bg=this._data[b+2],2097152&c.content&&(c.combinedData=this._combined[o]),268435456&c.bg&&(c.extended=this._extendedAttrs[o]),c}setCell(o,c){2097152&c.content&&(this._combined[o]=c.combinedData),268435456&c.bg&&(this._extendedAttrs[o]=c.extended),this._data[3*o+0]=c.content,this._data[3*o+1]=c.fg,this._data[3*o+2]=c.bg}setCellFromCodepoint(o,c,a,f){268435456&f.bg&&(this._extendedAttrs[o]=f.extended),this._data[3*o+0]=c|a<<22,this._data[3*o+1]=f.fg,this._data[3*o+2]=f.bg}addCodepointToCell(o,c,a){let f=this._data[3*o+0];2097152&f?this._combined[o]+=(0,m.stringFromCodePoint)(c):2097151&f?(this._combined[o]=(0,m.stringFromCodePoint)(2097151&f)+(0,m.stringFromCodePoint)(c),f&=-2097152,f|=2097152):f=c|4194304,a&&(f&=-12582913,f|=a<<22),this._data[3*o+0]=f}insertCells(o,c,a){if((o%=this.length)&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o-1,0,1,a),c<this.length-o){const f=new g.CellData;for(let y=this.length-o-c-1;y>=0;--y)this.setCell(o+c+y,this.loadCell(o+y,f));for(let y=0;y<c;++y)this.setCell(o+y,a)}else for(let f=o;f<this.length;++f)this.setCell(f,a);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,a)}deleteCells(o,c,a){if(o%=this.length,c<this.length-o){const f=new g.CellData;for(let y=0;y<this.length-o-c;++y)this.setCell(o+y,this.loadCell(o+c+y,f));for(let y=this.length-c;y<this.length;++y)this.setCell(y,a)}else for(let f=o;f<this.length;++f)this.setCell(f,a);o&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o-1,0,1,a),this.getWidth(o)!==0||this.hasContent(o)||this.setCellFromCodepoint(o,0,1,a)}replaceCells(o,c,a,f=!1){if(f)for(o&&this.getWidth(o-1)===2&&!this.isProtected(o-1)&&this.setCellFromCodepoint(o-1,0,1,a),c<this.length&&this.getWidth(c-1)===2&&!this.isProtected(c)&&this.setCellFromCodepoint(c,0,1,a);o<c&&o<this.length;)this.isProtected(o)||this.setCell(o,a),o++;else for(o&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o-1,0,1,a),c<this.length&&this.getWidth(c-1)===2&&this.setCellFromCodepoint(c,0,1,a);o<c&&o<this.length;)this.setCell(o++,a)}resize(o,c){if(o===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const a=3*o;if(o>this.length){if(this._data.buffer.byteLength>=4*a)this._data=new Uint32Array(this._data.buffer,0,a);else{const f=new Uint32Array(a);f.set(this._data),this._data=f}for(let f=this.length;f<o;++f)this.setCell(f,c)}else{this._data=this._data.subarray(0,a);const f=Object.keys(this._combined);for(let R=0;R<f.length;R++){const k=parseInt(f[R],10);k>=o&&delete this._combined[k]}const y=Object.keys(this._extendedAttrs);for(let R=0;R<y.length;R++){const k=parseInt(y[R],10);k>=o&&delete this._extendedAttrs[k]}}return this.length=o,4*a*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const o=new Uint32Array(this._data.length);return o.set(this._data),this._data=o,1}return 0}fill(o,c=!1){if(c)for(let a=0;a<this.length;++a)this.isProtected(a)||this.setCell(a,o);else{this._combined={},this._extendedAttrs={};for(let a=0;a<this.length;++a)this.setCell(a,o)}}copyFrom(o){this.length!==o.length?this._data=new Uint32Array(o._data):this._data.set(o._data),this.length=o.length,this._combined={};for(const c in o._combined)this._combined[c]=o._combined[c];this._extendedAttrs={};for(const c in o._extendedAttrs)this._extendedAttrs[c]=o._extendedAttrs[c];this.isWrapped=o.isWrapped}clone(){const o=new C(0);o._data=new Uint32Array(this._data),o.length=this.length;for(const c in this._combined)o._combined[c]=this._combined[c];for(const c in this._extendedAttrs)o._extendedAttrs[c]=this._extendedAttrs[c];return o.isWrapped=this.isWrapped,o}getTrimmedLength(){for(let o=this.length-1;o>=0;--o)if(4194303&this._data[3*o+0])return o+(this._data[3*o+0]>>22);return 0}getNoBgTrimmedLength(){for(let o=this.length-1;o>=0;--o)if(4194303&this._data[3*o+0]||50331648&this._data[3*o+2])return o+(this._data[3*o+0]>>22);return 0}copyCellsFrom(o,c,a,f,y){const R=o._data;if(y)for(let D=f-1;D>=0;D--){for(let E=0;E<3;E++)this._data[3*(a+D)+E]=R[3*(c+D)+E];268435456&R[3*(c+D)+2]&&(this._extendedAttrs[a+D]=o._extendedAttrs[c+D])}else for(let D=0;D<f;D++){for(let E=0;E<3;E++)this._data[3*(a+D)+E]=R[3*(c+D)+E];268435456&R[3*(c+D)+2]&&(this._extendedAttrs[a+D]=o._extendedAttrs[c+D])}const k=Object.keys(o._combined);for(let D=0;D<k.length;D++){const E=parseInt(k[D],10);E>=c&&(this._combined[E-c+a]=o._combined[E])}}translateToString(o,c,a,f){c=c??0,a=a??this.length,o&&(a=Math.min(a,this.getTrimmedLength())),f&&(f.length=0);let y="";for(;c<a;){const R=this._data[3*c+0],k=2097151&R,D=2097152&R?this._combined[c]:k?(0,m.stringFromCodePoint)(k):l.WHITESPACE_CELL_CHAR;if(y+=D,f)for(let E=0;E<D.length;++E)f.push(c);c+=R>>22||1}return f&&f.push(c),y}}r.BufferLine=C},4841:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.getRangeLength=void 0,r.getRangeLength=function(u,d){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return d*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(A,r)=>{function u(d,g,l){if(g===d.length-1)return d[g].getTrimmedLength();const m=!d[g].hasContent(l-1)&&d[g].getWidth(l-1)===1,b=d[g+1].getWidth(0)===2;return m&&b?l-1:l}Object.defineProperty(r,"__esModule",{value:!0}),r.getWrappedLineTrimmedLength=r.reflowSmallerGetNewLineLengths=r.reflowLargerApplyNewLayout=r.reflowLargerCreateNewLayout=r.reflowLargerGetLinesToRemove=void 0,r.reflowLargerGetLinesToRemove=function(d,g,l,m,b){const C=[];for(let p=0;p<d.length-1;p++){let o=p,c=d.get(++o);if(!c.isWrapped)continue;const a=[d.get(p)];for(;o<d.length&&c.isWrapped;)a.push(c),c=d.get(++o);if(m>=p&&m<o){p+=a.length-1;continue}let f=0,y=u(a,f,g),R=1,k=0;for(;R<a.length;){const E=u(a,R,g),L=E-k,z=l-y,H=Math.min(L,z);a[f].copyCellsFrom(a[R],k,y,H,!1),y+=H,y===l&&(f++,y=0),k+=H,k===E&&(R++,k=0),y===0&&f!==0&&a[f-1].getWidth(l-1)===2&&(a[f].copyCellsFrom(a[f-1],l-1,y++,1,!1),a[f-1].setCell(l-1,b))}a[f].replaceCells(y,l,b);let D=0;for(let E=a.length-1;E>0&&(E>f||a[E].getTrimmedLength()===0);E--)D++;D>0&&(C.push(p+a.length-D),C.push(D)),p+=a.length-1}return C},r.reflowLargerCreateNewLayout=function(d,g){const l=[];let m=0,b=g[m],C=0;for(let p=0;p<d.length;p++)if(b===p){const o=g[++m];d.onDeleteEmitter.fire({index:p-C,amount:o}),p+=o-1,C+=o,b=g[++m]}else l.push(p);return{layout:l,countRemoved:C}},r.reflowLargerApplyNewLayout=function(d,g){const l=[];for(let m=0;m<g.length;m++)l.push(d.get(g[m]));for(let m=0;m<l.length;m++)d.set(m,l[m]);d.length=g.length},r.reflowSmallerGetNewLineLengths=function(d,g,l){const m=[],b=d.map(((c,a)=>u(d,a,g))).reduce(((c,a)=>c+a));let C=0,p=0,o=0;for(;o<b;){if(b-o<l){m.push(b-o);break}C+=l;const c=u(d,p,g);C>c&&(C-=c,p++);const a=d[p].getWidth(C-1)===2;a&&C--;const f=a?l-1:l;m.push(f),o+=f}return m},r.getWrappedLineTrimmedLength=u},5295:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferSet=void 0;const d=u(8460),g=u(844),l=u(9092);class m extends g.Disposable{constructor(C,p){super(),this._optionsService=C,this._bufferService=p,this._onBufferActivate=this.register(new d.EventEmitter),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 l.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new l.Buffer(!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(C){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(C),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(C,p){this._normal.resize(C,p),this._alt.resize(C,p),this.setupTabStops(C)}setupTabStops(C){this._normal.setupTabStops(C),this._alt.setupTabStops(C)}}r.BufferSet=m},511:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellData=void 0;const d=u(482),g=u(643),l=u(3734);class m extends l.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new l.ExtendedAttrs,this.combinedData=""}static fromCharData(C){const p=new m;return p.setFromCharData(C),p}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(C){this.fg=C[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let p=!1;if(C[g.CHAR_DATA_CHAR_INDEX].length>2)p=!0;else if(C[g.CHAR_DATA_CHAR_INDEX].length===2){const o=C[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=o&&o<=56319){const c=C[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=c&&c<=57343?this.content=1024*(o-55296)+c-56320+65536|C[g.CHAR_DATA_WIDTH_INDEX]<<22:p=!0}else p=!0}else this.content=C[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|C[g.CHAR_DATA_WIDTH_INDEX]<<22;p&&(this.combinedData=C[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|C[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.CellData=m},643:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WHITESPACE_CELL_CODE=r.WHITESPACE_CELL_WIDTH=r.WHITESPACE_CELL_CHAR=r.NULL_CELL_CODE=r.NULL_CELL_WIDTH=r.NULL_CELL_CHAR=r.CHAR_DATA_CODE_INDEX=r.CHAR_DATA_WIDTH_INDEX=r.CHAR_DATA_CHAR_INDEX=r.CHAR_DATA_ATTR_INDEX=r.DEFAULT_EXT=r.DEFAULT_ATTR=r.DEFAULT_COLOR=void 0,r.DEFAULT_COLOR=0,r.DEFAULT_ATTR=256|r.DEFAULT_COLOR<<9,r.DEFAULT_EXT=0,r.CHAR_DATA_ATTR_INDEX=0,r.CHAR_DATA_CHAR_INDEX=1,r.CHAR_DATA_WIDTH_INDEX=2,r.CHAR_DATA_CODE_INDEX=3,r.NULL_CELL_CHAR="",r.NULL_CELL_WIDTH=1,r.NULL_CELL_CODE=0,r.WHITESPACE_CELL_CHAR=" ",r.WHITESPACE_CELL_WIDTH=1,r.WHITESPACE_CELL_CODE=32},4863:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Marker=void 0;const d=u(8460),g=u(844);class l{get id(){return this._id}constructor(b){this.line=b,this.isDisposed=!1,this._disposables=[],this._id=l._nextId++,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,g.disposeArray)(this._disposables),this._disposables.length=0)}register(b){return this._disposables.push(b),b}}r.Marker=l,l._nextId=1},7116:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DEFAULT_CHARSET=r.CHARSETS=void 0,r.CHARSETS={},r.DEFAULT_CHARSET=r.CHARSETS.B,r.CHARSETS[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:"≥","{":"π","|":"≠","}":"£","~":"·"},r.CHARSETS.A={"#":"£"},r.CHARSETS.B=void 0,r.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},r.CHARSETS.C=r.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},r.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},r.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},r.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},r.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},r.CHARSETS.E=r.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},r.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},r.CHARSETS.H=r.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},r.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(A,r)=>{var u,d,g;Object.defineProperty(r,"__esModule",{value:!0}),r.C1_ESCAPED=r.C1=r.C0=void 0,(function(l){l.NUL="\0",l.SOH="",l.STX="",l.ETX="",l.EOT="",l.ENQ="",l.ACK="",l.BEL="\x07",l.BS="\b",l.HT=" ",l.LF=`
|
|
415
|
+
`,l.VT="\v",l.FF="\f",l.CR="\r",l.SO="",l.SI="",l.DLE="",l.DC1="",l.DC2="",l.DC3="",l.DC4="",l.NAK="",l.SYN="",l.ETB="",l.CAN="",l.EM="",l.SUB="",l.ESC="\x1B",l.FS="",l.GS="",l.RS="",l.US="",l.SP=" ",l.DEL=""})(u||(r.C0=u={})),(function(l){l.PAD="",l.HOP="",l.BPH="",l.NBH="",l.IND="",l.NEL="
",l.SSA="",l.ESA="",l.HTS="",l.HTJ="",l.VTS="",l.PLD="",l.PLU="",l.RI="",l.SS2="",l.SS3="",l.DCS="",l.PU1="",l.PU2="",l.STS="",l.CCH="",l.MW="",l.SPA="",l.EPA="",l.SOS="",l.SGCI="",l.SCI="",l.CSI="",l.ST="",l.OSC="",l.PM="",l.APC=""})(d||(r.C1=d={})),(function(l){l.ST=`${u.ESC}\\`})(g||(r.C1_ESCAPED=g={}))},7399:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.evaluateKeyboardEvent=void 0;const d=u(2584),g={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:["'",'"']};r.evaluateKeyboardEvent=function(l,m,b,C){const p={type:0,cancel:!1,key:void 0},o=(l.shiftKey?1:0)|(l.altKey?2:0)|(l.ctrlKey?4:0)|(l.metaKey?8:0);switch(l.keyCode){case 0:l.key==="UIKeyInputUpArrow"?p.key=m?d.C0.ESC+"OA":d.C0.ESC+"[A":l.key==="UIKeyInputLeftArrow"?p.key=m?d.C0.ESC+"OD":d.C0.ESC+"[D":l.key==="UIKeyInputRightArrow"?p.key=m?d.C0.ESC+"OC":d.C0.ESC+"[C":l.key==="UIKeyInputDownArrow"&&(p.key=m?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:p.key=l.ctrlKey?"\b":d.C0.DEL,l.altKey&&(p.key=d.C0.ESC+p.key);break;case 9:if(l.shiftKey){p.key=d.C0.ESC+"[Z";break}p.key=d.C0.HT,p.cancel=!0;break;case 13:p.key=l.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,p.cancel=!0;break;case 27:p.key=d.C0.ESC,l.altKey&&(p.key=d.C0.ESC+d.C0.ESC),p.cancel=!0;break;case 37:if(l.metaKey)break;o?(p.key=d.C0.ESC+"[1;"+(o+1)+"D",p.key===d.C0.ESC+"[1;3D"&&(p.key=d.C0.ESC+(b?"b":"[1;5D"))):p.key=m?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(l.metaKey)break;o?(p.key=d.C0.ESC+"[1;"+(o+1)+"C",p.key===d.C0.ESC+"[1;3C"&&(p.key=d.C0.ESC+(b?"f":"[1;5C"))):p.key=m?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(l.metaKey)break;o?(p.key=d.C0.ESC+"[1;"+(o+1)+"A",b||p.key!==d.C0.ESC+"[1;3A"||(p.key=d.C0.ESC+"[1;5A")):p.key=m?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(l.metaKey)break;o?(p.key=d.C0.ESC+"[1;"+(o+1)+"B",b||p.key!==d.C0.ESC+"[1;3B"||(p.key=d.C0.ESC+"[1;5B")):p.key=m?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:l.shiftKey||l.ctrlKey||(p.key=d.C0.ESC+"[2~");break;case 46:p.key=o?d.C0.ESC+"[3;"+(o+1)+"~":d.C0.ESC+"[3~";break;case 36:p.key=o?d.C0.ESC+"[1;"+(o+1)+"H":m?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:p.key=o?d.C0.ESC+"[1;"+(o+1)+"F":m?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:l.shiftKey?p.type=2:l.ctrlKey?p.key=d.C0.ESC+"[5;"+(o+1)+"~":p.key=d.C0.ESC+"[5~";break;case 34:l.shiftKey?p.type=3:l.ctrlKey?p.key=d.C0.ESC+"[6;"+(o+1)+"~":p.key=d.C0.ESC+"[6~";break;case 112:p.key=o?d.C0.ESC+"[1;"+(o+1)+"P":d.C0.ESC+"OP";break;case 113:p.key=o?d.C0.ESC+"[1;"+(o+1)+"Q":d.C0.ESC+"OQ";break;case 114:p.key=o?d.C0.ESC+"[1;"+(o+1)+"R":d.C0.ESC+"OR";break;case 115:p.key=o?d.C0.ESC+"[1;"+(o+1)+"S":d.C0.ESC+"OS";break;case 116:p.key=o?d.C0.ESC+"[15;"+(o+1)+"~":d.C0.ESC+"[15~";break;case 117:p.key=o?d.C0.ESC+"[17;"+(o+1)+"~":d.C0.ESC+"[17~";break;case 118:p.key=o?d.C0.ESC+"[18;"+(o+1)+"~":d.C0.ESC+"[18~";break;case 119:p.key=o?d.C0.ESC+"[19;"+(o+1)+"~":d.C0.ESC+"[19~";break;case 120:p.key=o?d.C0.ESC+"[20;"+(o+1)+"~":d.C0.ESC+"[20~";break;case 121:p.key=o?d.C0.ESC+"[21;"+(o+1)+"~":d.C0.ESC+"[21~";break;case 122:p.key=o?d.C0.ESC+"[23;"+(o+1)+"~":d.C0.ESC+"[23~";break;case 123:p.key=o?d.C0.ESC+"[24;"+(o+1)+"~":d.C0.ESC+"[24~";break;default:if(!l.ctrlKey||l.shiftKey||l.altKey||l.metaKey)if(b&&!C||!l.altKey||l.metaKey)!b||l.altKey||l.ctrlKey||l.shiftKey||!l.metaKey?l.key&&!l.ctrlKey&&!l.altKey&&!l.metaKey&&l.keyCode>=48&&l.key.length===1?p.key=l.key:l.key&&l.ctrlKey&&(l.key==="_"&&(p.key=d.C0.US),l.key==="@"&&(p.key=d.C0.NUL)):l.keyCode===65&&(p.type=1);else{const c=g[l.keyCode],a=c==null?void 0:c[l.shiftKey?1:0];if(a)p.key=d.C0.ESC+a;else if(l.keyCode>=65&&l.keyCode<=90){const f=l.ctrlKey?l.keyCode-64:l.keyCode+32;let y=String.fromCharCode(f);l.shiftKey&&(y=y.toUpperCase()),p.key=d.C0.ESC+y}else if(l.keyCode===32)p.key=d.C0.ESC+(l.ctrlKey?d.C0.NUL:" ");else if(l.key==="Dead"&&l.code.startsWith("Key")){let f=l.code.slice(3,4);l.shiftKey||(f=f.toLowerCase()),p.key=d.C0.ESC+f,p.cancel=!0}}else l.keyCode>=65&&l.keyCode<=90?p.key=String.fromCharCode(l.keyCode-64):l.keyCode===32?p.key=d.C0.NUL:l.keyCode>=51&&l.keyCode<=55?p.key=String.fromCharCode(l.keyCode-51+27):l.keyCode===56?p.key=d.C0.DEL:l.keyCode===219?p.key=d.C0.ESC:l.keyCode===220?p.key=d.C0.FS:l.keyCode===221&&(p.key=d.C0.GS)}return p}},482:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Utf8ToUtf32=r.StringToUtf32=r.utf32ToString=r.stringFromCodePoint=void 0,r.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},r.utf32ToString=function(u,d=0,g=u.length){let l="";for(let m=d;m<g;++m){let b=u[m];b>65535?(b-=65536,l+=String.fromCharCode(55296+(b>>10))+String.fromCharCode(b%1024+56320)):l+=String.fromCharCode(b)}return l},r.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,d){const g=u.length;if(!g)return 0;let l=0,m=0;if(this._interim){const b=u.charCodeAt(m++);56320<=b&&b<=57343?d[l++]=1024*(this._interim-55296)+b-56320+65536:(d[l++]=this._interim,d[l++]=b),this._interim=0}for(let b=m;b<g;++b){const C=u.charCodeAt(b);if(55296<=C&&C<=56319){if(++b>=g)return this._interim=C,l;const p=u.charCodeAt(b);56320<=p&&p<=57343?d[l++]=1024*(C-55296)+p-56320+65536:(d[l++]=C,d[l++]=p)}else C!==65279&&(d[l++]=C)}return l}},r.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,d){const g=u.length;if(!g)return 0;let l,m,b,C,p=0,o=0,c=0;if(this.interim[0]){let y=!1,R=this.interim[0];R&=(224&R)==192?31:(240&R)==224?15:7;let k,D=0;for(;(k=63&this.interim[++D])&&D<4;)R<<=6,R|=k;const E=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,L=E-D;for(;c<L;){if(c>=g)return 0;if(k=u[c++],(192&k)!=128){c--,y=!0;break}this.interim[D++]=k,R<<=6,R|=63&k}y||(E===2?R<128?c--:d[p++]=R:E===3?R<2048||R>=55296&&R<=57343||R===65279||(d[p++]=R):R<65536||R>1114111||(d[p++]=R)),this.interim.fill(0)}const a=g-4;let f=c;for(;f<g;){for(;!(!(f<a)||128&(l=u[f])||128&(m=u[f+1])||128&(b=u[f+2])||128&(C=u[f+3]));)d[p++]=l,d[p++]=m,d[p++]=b,d[p++]=C,f+=4;if(l=u[f++],l<128)d[p++]=l;else if((224&l)==192){if(f>=g)return this.interim[0]=l,p;if(m=u[f++],(192&m)!=128){f--;continue}if(o=(31&l)<<6|63&m,o<128){f--;continue}d[p++]=o}else if((240&l)==224){if(f>=g)return this.interim[0]=l,p;if(m=u[f++],(192&m)!=128){f--;continue}if(f>=g)return this.interim[0]=l,this.interim[1]=m,p;if(b=u[f++],(192&b)!=128){f--;continue}if(o=(15&l)<<12|(63&m)<<6|63&b,o<2048||o>=55296&&o<=57343||o===65279)continue;d[p++]=o}else if((248&l)==240){if(f>=g)return this.interim[0]=l,p;if(m=u[f++],(192&m)!=128){f--;continue}if(f>=g)return this.interim[0]=l,this.interim[1]=m,p;if(b=u[f++],(192&b)!=128){f--;continue}if(f>=g)return this.interim[0]=l,this.interim[1]=m,this.interim[2]=b,p;if(C=u[f++],(192&C)!=128){f--;continue}if(o=(7&l)<<18|(63&m)<<12|(63&b)<<6|63&C,o<65536||o>1114111)continue;d[p++]=o}}return p}}},225:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeV6=void 0;const d=u(1480),g=[[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]],l=[[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]];let m;r.UnicodeV6=class{constructor(){if(this.version="6",!m){m=new Uint8Array(65536),m.fill(1),m[0]=0,m.fill(0,1,32),m.fill(0,127,160),m.fill(2,4352,4448),m[9001]=2,m[9002]=2,m.fill(2,11904,42192),m[12351]=1,m.fill(2,44032,55204),m.fill(2,63744,64256),m.fill(2,65040,65050),m.fill(2,65072,65136),m.fill(2,65280,65377),m.fill(2,65504,65511);for(let b=0;b<g.length;++b)m.fill(0,g[b][0],g[b][1]+1)}}wcwidth(b){return b<32?0:b<127?1:b<65536?m[b]:(function(C,p){let o,c=0,a=p.length-1;if(C<p[0][0]||C>p[a][1])return!1;for(;a>=c;)if(o=c+a>>1,C>p[o][1])c=o+1;else{if(!(C<p[o][0]))return!0;a=o-1}return!1})(b,l)?0:b>=131072&&b<=196605||b>=196608&&b<=262141?2:1}charProperties(b,C){let p=this.wcwidth(b),o=p===0&&C!==0;if(o){const c=d.UnicodeService.extractWidth(C);c===0?o=!1:c>p&&(p=c)}return d.UnicodeService.createPropertyValue(0,p,o)}}},5981:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WriteBuffer=void 0;const d=u(8460),g=u(844);class l extends g.Disposable{constructor(b){super(),this._action=b,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(b,C){if(C!==void 0&&this._syncCalls>C)return void(this._syncCalls=0);if(this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let p;for(this._isSyncWriting=!0;p=this._writeBuffer.shift();){this._action(p);const o=this._callbacks.shift();o&&o()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(b,C){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(C),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(C)}_innerWrite(b=0,C=!0){const p=b||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const o=this._writeBuffer[this._bufferOffset],c=this._action(o,C);if(c){const f=y=>Date.now()-p>=12?setTimeout((()=>this._innerWrite(0,y))):this._innerWrite(p,y);return void c.catch((y=>(queueMicrotask((()=>{throw y})),Promise.resolve(!1)))).then(f)}const a=this._callbacks[this._bufferOffset];if(a&&a(),this._bufferOffset++,this._pendingData-=o.length,Date.now()-p>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(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()}}r.WriteBuffer=l},5941:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.toRgbString=r.parseColor=void 0;const u=/^([\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})$/,d=/^[\da-f]+$/;function g(l,m){const b=l.toString(16),C=b.length<2?"0"+b:b;switch(m){case 4:return b[0];case 8:return C;case 12:return(C+C).slice(0,3);default:return C+C}}r.parseColor=function(l){if(!l)return;let m=l.toLowerCase();if(m.indexOf("rgb:")===0){m=m.slice(4);const b=u.exec(m);if(b){const C=b[1]?15:b[4]?255:b[7]?4095:65535;return[Math.round(parseInt(b[1]||b[4]||b[7]||b[10],16)/C*255),Math.round(parseInt(b[2]||b[5]||b[8]||b[11],16)/C*255),Math.round(parseInt(b[3]||b[6]||b[9]||b[12],16)/C*255)]}}else if(m.indexOf("#")===0&&(m=m.slice(1),d.exec(m)&&[3,6,9,12].includes(m.length))){const b=m.length/3,C=[0,0,0];for(let p=0;p<3;++p){const o=parseInt(m.slice(b*p,b*p+b),16);C[p]=b===1?o<<4:b===2?o:b===3?o>>4:o>>8}return C}},r.toRgbString=function(l,m=16){const[b,C,p]=l;return`rgb:${g(b,m)}/${g(C,m)}/${g(p,m)}`}},5770:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PAYLOAD_LIMIT=void 0,r.PAYLOAD_LIMIT=1e7},6351:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DcsHandler=r.DcsParser=void 0;const d=u(482),g=u(8742),l=u(5770),m=[];r.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=m,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=m}registerHandler(C,p){this._handlers[C]===void 0&&(this._handlers[C]=[]);const o=this._handlers[C];return o.push(p),{dispose:()=>{const c=o.indexOf(p);c!==-1&&o.splice(c,1)}}}clearHandler(C){this._handlers[C]&&delete this._handlers[C]}setHandlerFallback(C){this._handlerFb=C}reset(){if(this._active.length)for(let C=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;C>=0;--C)this._active[C].unhook(!1);this._stack.paused=!1,this._active=m,this._ident=0}hook(C,p){if(this.reset(),this._ident=C,this._active=this._handlers[C]||m,this._active.length)for(let o=this._active.length-1;o>=0;o--)this._active[o].hook(p);else this._handlerFb(this._ident,"HOOK",p)}put(C,p,o){if(this._active.length)for(let c=this._active.length-1;c>=0;c--)this._active[c].put(C,p,o);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(C,p,o))}unhook(C,p=!0){if(this._active.length){let o=!1,c=this._active.length-1,a=!1;if(this._stack.paused&&(c=this._stack.loopPosition-1,o=p,a=this._stack.fallThrough,this._stack.paused=!1),!a&&o===!1){for(;c>=0&&(o=this._active[c].unhook(C),o!==!0);c--)if(o instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=c,this._stack.fallThrough=!1,o;c--}for(;c>=0;c--)if(o=this._active[c].unhook(!1),o instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=c,this._stack.fallThrough=!0,o}else this._handlerFb(this._ident,"UNHOOK",C);this._active=m,this._ident=0}};const b=new g.Params;b.addParam(0),r.DcsHandler=class{constructor(C){this._handler=C,this._data="",this._params=b,this._hitLimit=!1}hook(C){this._params=C.length>1||C.params[0]?C.clone():b,this._data="",this._hitLimit=!1}put(C,p,o){this._hitLimit||(this._data+=(0,d.utf32ToString)(C,p,o),this._data.length>l.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(C){let p=!1;if(this._hitLimit)p=!1;else if(C&&(p=this._handler(this._data,this._params),p instanceof Promise))return p.then((o=>(this._params=b,this._data="",this._hitLimit=!1,o)));return this._params=b,this._data="",this._hitLimit=!1,p}}},2015:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.EscapeSequenceParser=r.VT500_TRANSITION_TABLE=r.TransitionTable=void 0;const d=u(844),g=u(8742),l=u(6242),m=u(6351);class b{constructor(c){this.table=new Uint8Array(c)}setDefault(c,a){this.table.fill(c<<4|a)}add(c,a,f,y){this.table[a<<8|c]=f<<4|y}addMany(c,a,f,y){for(let R=0;R<c.length;R++)this.table[a<<8|c[R]]=f<<4|y}}r.TransitionTable=b;const C=160;r.VT500_TRANSITION_TABLE=(function(){const o=new b(4095),c=Array.apply(null,Array(256)).map(((D,E)=>E)),a=(D,E)=>c.slice(D,E),f=a(32,127),y=a(0,24);y.push(25),y.push.apply(y,a(28,32));const R=a(0,14);let k;for(k in o.setDefault(1,0),o.addMany(f,0,2,0),R)o.addMany([24,26,153,154],k,3,0),o.addMany(a(128,144),k,3,0),o.addMany(a(144,152),k,3,0),o.add(156,k,0,0),o.add(27,k,11,1),o.add(157,k,4,8),o.addMany([152,158,159],k,0,7),o.add(155,k,11,3),o.add(144,k,11,9);return o.addMany(y,0,3,0),o.addMany(y,1,3,1),o.add(127,1,0,1),o.addMany(y,8,0,8),o.addMany(y,3,3,3),o.add(127,3,0,3),o.addMany(y,4,3,4),o.add(127,4,0,4),o.addMany(y,6,3,6),o.addMany(y,5,3,5),o.add(127,5,0,5),o.addMany(y,2,3,2),o.add(127,2,0,2),o.add(93,1,4,8),o.addMany(f,8,5,8),o.add(127,8,5,8),o.addMany([156,27,24,26,7],8,6,0),o.addMany(a(28,32),8,0,8),o.addMany([88,94,95],1,0,7),o.addMany(f,7,0,7),o.addMany(y,7,0,7),o.add(156,7,0,0),o.add(127,7,0,7),o.add(91,1,11,3),o.addMany(a(64,127),3,7,0),o.addMany(a(48,60),3,8,4),o.addMany([60,61,62,63],3,9,4),o.addMany(a(48,60),4,8,4),o.addMany(a(64,127),4,7,0),o.addMany([60,61,62,63],4,0,6),o.addMany(a(32,64),6,0,6),o.add(127,6,0,6),o.addMany(a(64,127),6,0,0),o.addMany(a(32,48),3,9,5),o.addMany(a(32,48),5,9,5),o.addMany(a(48,64),5,0,6),o.addMany(a(64,127),5,7,0),o.addMany(a(32,48),4,9,5),o.addMany(a(32,48),1,9,2),o.addMany(a(32,48),2,9,2),o.addMany(a(48,127),2,10,0),o.addMany(a(48,80),1,10,0),o.addMany(a(81,88),1,10,0),o.addMany([89,90,92],1,10,0),o.addMany(a(96,127),1,10,0),o.add(80,1,11,9),o.addMany(y,9,0,9),o.add(127,9,0,9),o.addMany(a(28,32),9,0,9),o.addMany(a(32,48),9,9,12),o.addMany(a(48,60),9,8,10),o.addMany([60,61,62,63],9,9,10),o.addMany(y,11,0,11),o.addMany(a(32,128),11,0,11),o.addMany(a(28,32),11,0,11),o.addMany(y,10,0,10),o.add(127,10,0,10),o.addMany(a(28,32),10,0,10),o.addMany(a(48,60),10,8,10),o.addMany([60,61,62,63],10,0,11),o.addMany(a(32,48),10,9,12),o.addMany(y,12,0,12),o.add(127,12,0,12),o.addMany(a(28,32),12,0,12),o.addMany(a(32,48),12,9,12),o.addMany(a(48,64),12,0,11),o.addMany(a(64,127),12,12,13),o.addMany(a(64,127),10,12,13),o.addMany(a(64,127),9,12,13),o.addMany(y,13,13,13),o.addMany(f,13,13,13),o.add(127,13,0,13),o.addMany([27,156,24,26],13,14,0),o.add(C,0,2,0),o.add(C,8,5,8),o.add(C,6,0,6),o.add(C,11,0,11),o.add(C,13,13,13),o})();class p extends d.Disposable{constructor(c=r.VT500_TRANSITION_TABLE){super(),this._transitions=c,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new g.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(a,f,y)=>{},this._executeHandlerFb=a=>{},this._csiHandlerFb=(a,f)=>{},this._escHandlerFb=a=>{},this._errorHandlerFb=a=>a,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,d.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new l.OscParser),this._dcsParser=this.register(new m.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(c,a=[64,126]){let f=0;if(c.prefix){if(c.prefix.length>1)throw new Error("only one byte as prefix supported");if(f=c.prefix.charCodeAt(0),f&&60>f||f>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(c.intermediates){if(c.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let R=0;R<c.intermediates.length;++R){const k=c.intermediates.charCodeAt(R);if(32>k||k>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");f<<=8,f|=k}}if(c.final.length!==1)throw new Error("final must be a single byte");const y=c.final.charCodeAt(0);if(a[0]>y||y>a[1])throw new Error(`final must be in range ${a[0]} .. ${a[1]}`);return f<<=8,f|=y,f}identToString(c){const a=[];for(;c;)a.push(String.fromCharCode(255&c)),c>>=8;return a.reverse().join("")}setPrintHandler(c){this._printHandler=c}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(c,a){const f=this._identifier(c,[48,126]);this._escHandlers[f]===void 0&&(this._escHandlers[f]=[]);const y=this._escHandlers[f];return y.push(a),{dispose:()=>{const R=y.indexOf(a);R!==-1&&y.splice(R,1)}}}clearEscHandler(c){this._escHandlers[this._identifier(c,[48,126])]&&delete this._escHandlers[this._identifier(c,[48,126])]}setEscHandlerFallback(c){this._escHandlerFb=c}setExecuteHandler(c,a){this._executeHandlers[c.charCodeAt(0)]=a}clearExecuteHandler(c){this._executeHandlers[c.charCodeAt(0)]&&delete this._executeHandlers[c.charCodeAt(0)]}setExecuteHandlerFallback(c){this._executeHandlerFb=c}registerCsiHandler(c,a){const f=this._identifier(c);this._csiHandlers[f]===void 0&&(this._csiHandlers[f]=[]);const y=this._csiHandlers[f];return y.push(a),{dispose:()=>{const R=y.indexOf(a);R!==-1&&y.splice(R,1)}}}clearCsiHandler(c){this._csiHandlers[this._identifier(c)]&&delete this._csiHandlers[this._identifier(c)]}setCsiHandlerFallback(c){this._csiHandlerFb=c}registerDcsHandler(c,a){return this._dcsParser.registerHandler(this._identifier(c),a)}clearDcsHandler(c){this._dcsParser.clearHandler(this._identifier(c))}setDcsHandlerFallback(c){this._dcsParser.setHandlerFallback(c)}registerOscHandler(c,a){return this._oscParser.registerHandler(c,a)}clearOscHandler(c){this._oscParser.clearHandler(c)}setOscHandlerFallback(c){this._oscParser.setHandlerFallback(c)}setErrorHandler(c){this._errorHandler=c}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(c,a,f,y,R){this._parseStack.state=c,this._parseStack.handlers=a,this._parseStack.handlerPos=f,this._parseStack.transition=y,this._parseStack.chunkPos=R}parse(c,a,f){let y,R=0,k=0,D=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,D=this._parseStack.chunkPos+1;else{if(f===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const E=this._parseStack.handlers;let L=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(f===!1&&L>-1){for(;L>=0&&(y=E[L](this._params),y!==!0);L--)if(y instanceof Promise)return this._parseStack.handlerPos=L,y}this._parseStack.handlers=[];break;case 4:if(f===!1&&L>-1){for(;L>=0&&(y=E[L](),y!==!0);L--)if(y instanceof Promise)return this._parseStack.handlerPos=L,y}this._parseStack.handlers=[];break;case 6:if(R=c[this._parseStack.chunkPos],y=this._dcsParser.unhook(R!==24&&R!==26,f),y)return y;R===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(R=c[this._parseStack.chunkPos],y=this._oscParser.end(R!==24&&R!==26,f),y)return y;R===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,D=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let E=D;E<a;++E){switch(R=c[E],k=this._transitions.table[this.currentState<<8|(R<160?R:C)],k>>4){case 2:for(let I=E+1;;++I){if(I>=a||(R=c[I])<32||R>126&&R<C){this._printHandler(c,E,I),E=I-1;break}if(++I>=a||(R=c[I])<32||R>126&&R<C){this._printHandler(c,E,I),E=I-1;break}if(++I>=a||(R=c[I])<32||R>126&&R<C){this._printHandler(c,E,I),E=I-1;break}if(++I>=a||(R=c[I])<32||R>126&&R<C){this._printHandler(c,E,I),E=I-1;break}}break;case 3:this._executeHandlers[R]?this._executeHandlers[R]():this._executeHandlerFb(R),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:E,code:R,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const L=this._csiHandlers[this._collect<<8|R];let z=L?L.length-1:-1;for(;z>=0&&(y=L[z](this._params),y!==!0);z--)if(y instanceof Promise)return this._preserveStack(3,L,z,k,E),y;z<0&&this._csiHandlerFb(this._collect<<8|R,this._params),this.precedingJoinState=0;break;case 8:do switch(R){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(R-48)}while(++E<a&&(R=c[E])>47&&R<60);E--;break;case 9:this._collect<<=8,this._collect|=R;break;case 10:const H=this._escHandlers[this._collect<<8|R];let P=H?H.length-1:-1;for(;P>=0&&(y=H[P](),y!==!0);P--)if(y instanceof Promise)return this._preserveStack(4,H,P,k,E),y;P<0&&this._escHandlerFb(this._collect<<8|R),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|R,this._params);break;case 13:for(let I=E+1;;++I)if(I>=a||(R=c[I])===24||R===26||R===27||R>127&&R<C){this._dcsParser.put(c,E,I),E=I-1;break}break;case 14:if(y=this._dcsParser.unhook(R!==24&&R!==26),y)return this._preserveStack(6,[],0,k,E),y;R===27&&(k|=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 I=E+1;;I++)if(I>=a||(R=c[I])<32||R>127&&R<C){this._oscParser.put(c,E,I),E=I-1;break}break;case 6:if(y=this._oscParser.end(R!==24&&R!==26),y)return this._preserveStack(5,[],0,k,E),y;R===27&&(k|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&k}}}r.EscapeSequenceParser=p},6242:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OscHandler=r.OscParser=void 0;const d=u(5770),g=u(482),l=[];r.OscParser=class{constructor(){this._state=0,this._active=l,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(m,b){this._handlers[m]===void 0&&(this._handlers[m]=[]);const C=this._handlers[m];return C.push(b),{dispose:()=>{const p=C.indexOf(b);p!==-1&&C.splice(p,1)}}}clearHandler(m){this._handlers[m]&&delete this._handlers[m]}setHandlerFallback(m){this._handlerFb=m}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=l}reset(){if(this._state===2)for(let m=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;m>=0;--m)this._active[m].end(!1);this._stack.paused=!1,this._active=l,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||l,this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].start();else this._handlerFb(this._id,"START")}_put(m,b,C){if(this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].put(m,b,C);else this._handlerFb(this._id,"PUT",(0,g.utf32ToString)(m,b,C))}start(){this.reset(),this._state=1}put(m,b,C){if(this._state!==3){if(this._state===1)for(;b<C;){const p=m[b++];if(p===59){this._state=2,this._start();break}if(p<48||57<p)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+p-48}this._state===2&&C-b>0&&this._put(m,b,C)}}end(m,b=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let C=!1,p=this._active.length-1,o=!1;if(this._stack.paused&&(p=this._stack.loopPosition-1,C=b,o=this._stack.fallThrough,this._stack.paused=!1),!o&&C===!1){for(;p>=0&&(C=this._active[p].end(m),C!==!0);p--)if(C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!1,C;p--}for(;p>=0;p--)if(C=this._active[p].end(!1),C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!0,C}else this._handlerFb(this._id,"END",m);this._active=l,this._id=-1,this._state=0}}},r.OscHandler=class{constructor(m){this._handler=m,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(m,b,C){this._hitLimit||(this._data+=(0,g.utf32ToString)(m,b,C),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(m){let b=!1;if(this._hitLimit)b=!1;else if(m&&(b=this._handler(this._data),b instanceof Promise))return b.then((C=>(this._data="",this._hitLimit=!1,C)));return this._data="",this._hitLimit=!1,b}}},8742:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Params=void 0;const u=2147483647;class d{static fromArray(l){const m=new d;if(!l.length)return m;for(let b=Array.isArray(l[0])?1:0;b<l.length;++b){const C=l[b];if(Array.isArray(C))for(let p=0;p<C.length;++p)m.addSubParam(C[p]);else m.addParam(C)}return m}constructor(l=32,m=32){if(this.maxLength=l,this.maxSubParamsLength=m,m>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(l),this.length=0,this._subParams=new Int32Array(m),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(l),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const l=new d(this.maxLength,this.maxSubParamsLength);return l.params.set(this.params),l.length=this.length,l._subParams.set(this._subParams),l._subParamsLength=this._subParamsLength,l._subParamsIdx.set(this._subParamsIdx),l._rejectDigits=this._rejectDigits,l._rejectSubDigits=this._rejectSubDigits,l._digitIsSub=this._digitIsSub,l}toArray(){const l=[];for(let m=0;m<this.length;++m){l.push(this.params[m]);const b=this._subParamsIdx[m]>>8,C=255&this._subParamsIdx[m];C-b>0&&l.push(Array.prototype.slice.call(this._subParams,b,C))}return l}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(l){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(l<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=l>u?u:l}}addSubParam(l){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(l<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=l>u?u:l,this._subParamsIdx[this.length-1]++}}hasSubParams(l){return(255&this._subParamsIdx[l])-(this._subParamsIdx[l]>>8)>0}getSubParams(l){const m=this._subParamsIdx[l]>>8,b=255&this._subParamsIdx[l];return b-m>0?this._subParams.subarray(m,b):null}getSubParamsAll(){const l={};for(let m=0;m<this.length;++m){const b=this._subParamsIdx[m]>>8,C=255&this._subParamsIdx[m];C-b>0&&(l[m]=this._subParams.slice(b,C))}return l}addDigit(l){let m;if(this._rejectDigits||!(m=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const b=this._digitIsSub?this._subParams:this.params,C=b[m-1];b[m-1]=~C?Math.min(10*C+l,u):l}}r.Params=d},5741:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.AddonManager=void 0,r.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,d){const g={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(g),d.dispose=()=>this._wrappedAddonDispose(g),d.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let d=-1;for(let g=0;g<this._addons.length;g++)if(this._addons[g]===u){d=g;break}if(d===-1)throw new Error("Could not dispose an addon that has not been loaded");u.isDisposed=!0,u.dispose.apply(u.instance),this._addons.splice(d,1)}}},8771:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferApiView=void 0;const d=u(3785),g=u(511);r.BufferApiView=class{constructor(l,m){this._buffer=l,this.type=m}init(l){return this._buffer=l,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(l){const m=this._buffer.lines.get(l);if(m)return new d.BufferLineApiView(m)}getNullCell(){return new g.CellData}}},3785:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLineApiView=void 0;const d=u(511);r.BufferLineApiView=class{constructor(g){this._line=g}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(g,l){if(!(g<0||g>=this._line.length))return l?(this._line.loadCell(g,l),l):this._line.loadCell(g,new d.CellData)}translateToString(g,l,m){return this._line.translateToString(g,l,m)}}},8285:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferNamespaceApi=void 0;const d=u(8771),g=u(8460),l=u(844);class m extends l.Disposable{constructor(C){super(),this._core=C,this._onBufferChange=this.register(new g.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new d.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new d.BufferApiView(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)}}r.BufferNamespaceApi=m},7975:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ParserApi=void 0,r.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,d){return this._core.registerCsiHandler(u,(g=>d(g.toArray())))}addCsiHandler(u,d){return this.registerCsiHandler(u,d)}registerDcsHandler(u,d){return this._core.registerDcsHandler(u,((g,l)=>d(g,l.toArray())))}addDcsHandler(u,d){return this.registerDcsHandler(u,d)}registerEscHandler(u,d){return this._core.registerEscHandler(u,d)}addEscHandler(u,d){return this.registerEscHandler(u,d)}registerOscHandler(u,d){return this._core.registerOscHandler(u,d)}addOscHandler(u,d){return this.registerOscHandler(u,d)}}},7090:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeApi=void 0,r.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(A,r,u){var d=this&&this.__decorate||function(o,c,a,f){var y,R=arguments.length,k=R<3?c:f===null?f=Object.getOwnPropertyDescriptor(c,a):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(o,c,a,f);else for(var D=o.length-1;D>=0;D--)(y=o[D])&&(k=(R<3?y(k):R>3?y(c,a,k):y(c,a))||k);return R>3&&k&&Object.defineProperty(c,a,k),k},g=this&&this.__param||function(o,c){return function(a,f){c(a,f,o)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferService=r.MINIMUM_ROWS=r.MINIMUM_COLS=void 0;const l=u(8460),m=u(844),b=u(5295),C=u(2585);r.MINIMUM_COLS=2,r.MINIMUM_ROWS=1;let p=r.BufferService=class extends m.Disposable{get buffer(){return this.buffers.active}constructor(o){super(),this.isUserScrolling=!1,this._onResize=this.register(new l.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new l.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(o.rawOptions.cols||0,r.MINIMUM_COLS),this.rows=Math.max(o.rawOptions.rows||0,r.MINIMUM_ROWS),this.buffers=this.register(new b.BufferSet(o,this))}resize(o,c){this.cols=o,this.rows=c,this.buffers.resize(o,c),this._onResize.fire({cols:o,rows:c})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(o,c=!1){const a=this.buffer;let f;f=this._cachedBlankLine,f&&f.length===this.cols&&f.getFg(0)===o.fg&&f.getBg(0)===o.bg||(f=a.getBlankLine(o,c),this._cachedBlankLine=f),f.isWrapped=c;const y=a.ybase+a.scrollTop,R=a.ybase+a.scrollBottom;if(a.scrollTop===0){const k=a.lines.isFull;R===a.lines.length-1?k?a.lines.recycle().copyFrom(f):a.lines.push(f.clone()):a.lines.splice(R+1,0,f.clone()),k?this.isUserScrolling&&(a.ydisp=Math.max(a.ydisp-1,0)):(a.ybase++,this.isUserScrolling||a.ydisp++)}else{const k=R-y+1;a.lines.shiftElements(y+1,k-1,-1),a.lines.set(R,f.clone())}this.isUserScrolling||(a.ydisp=a.ybase),this._onScroll.fire(a.ydisp)}scrollLines(o,c,a){const f=this.buffer;if(o<0){if(f.ydisp===0)return;this.isUserScrolling=!0}else o+f.ydisp>=f.ybase&&(this.isUserScrolling=!1);const y=f.ydisp;f.ydisp=Math.max(Math.min(f.ydisp+o,f.ybase),0),y!==f.ydisp&&(c||this._onScroll.fire(f.ydisp))}};r.BufferService=p=d([g(0,C.IOptionsService)],p)},7994:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CharsetService=void 0,r.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,d){this._charsets[u]=d,this.glevel===u&&(this.charset=d)}}},1753:function(A,r,u){var d=this&&this.__decorate||function(f,y,R,k){var D,E=arguments.length,L=E<3?y:k===null?k=Object.getOwnPropertyDescriptor(y,R):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(f,y,R,k);else for(var z=f.length-1;z>=0;z--)(D=f[z])&&(L=(E<3?D(L):E>3?D(y,R,L):D(y,R))||L);return E>3&&L&&Object.defineProperty(y,R,L),L},g=this&&this.__param||function(f,y){return function(R,k){y(R,k,f)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreMouseService=void 0;const l=u(2585),m=u(8460),b=u(844),C={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:f=>f.button!==4&&f.action===1&&(f.ctrl=!1,f.alt=!1,f.shift=!1,!0)},VT200:{events:19,restrict:f=>f.action!==32},DRAG:{events:23,restrict:f=>f.action!==32||f.button!==3},ANY:{events:31,restrict:f=>!0}};function p(f,y){let R=(f.ctrl?16:0)|(f.shift?4:0)|(f.alt?8:0);return f.button===4?(R|=64,R|=f.action):(R|=3&f.button,4&f.button&&(R|=64),8&f.button&&(R|=128),f.action===32?R|=32:f.action!==0||y||(R|=3)),R}const o=String.fromCharCode,c={DEFAULT:f=>{const y=[p(f,!1)+32,f.col+32,f.row+32];return y[0]>255||y[1]>255||y[2]>255?"":`\x1B[M${o(y[0])}${o(y[1])}${o(y[2])}`},SGR:f=>{const y=f.action===0&&f.button!==4?"m":"M";return`\x1B[<${p(f,!0)};${f.col};${f.row}${y}`},SGR_PIXELS:f=>{const y=f.action===0&&f.button!==4?"m":"M";return`\x1B[<${p(f,!0)};${f.x};${f.y}${y}`}};let a=r.CoreMouseService=class extends b.Disposable{constructor(f,y){super(),this._bufferService=f,this._coreService=y,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new m.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const R of Object.keys(C))this.addProtocol(R,C[R]);for(const R of Object.keys(c))this.addEncoding(R,c[R]);this.reset()}addProtocol(f,y){this._protocols[f]=y}addEncoding(f,y){this._encodings[f]=y}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(f){if(!this._protocols[f])throw new Error(`unknown protocol "${f}"`);this._activeProtocol=f,this._onProtocolChange.fire(this._protocols[f].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(f){if(!this._encodings[f])throw new Error(`unknown encoding "${f}"`);this._activeEncoding=f}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(f){if(f.col<0||f.col>=this._bufferService.cols||f.row<0||f.row>=this._bufferService.rows||f.button===4&&f.action===32||f.button===3&&f.action!==32||f.button!==4&&(f.action===2||f.action===3)||(f.col++,f.row++,f.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,f,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(f))return!1;const y=this._encodings[this._activeEncoding](f);return y&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(y):this._coreService.triggerDataEvent(y,!0)),this._lastEvent=f,!0}explainEvents(f){return{down:!!(1&f),up:!!(2&f),drag:!!(4&f),move:!!(8&f),wheel:!!(16&f)}}_equalEvents(f,y,R){if(R){if(f.x!==y.x||f.y!==y.y)return!1}else if(f.col!==y.col||f.row!==y.row)return!1;return f.button===y.button&&f.action===y.action&&f.ctrl===y.ctrl&&f.alt===y.alt&&f.shift===y.shift}};r.CoreMouseService=a=d([g(0,l.IBufferService),g(1,l.ICoreService)],a)},6975:function(A,r,u){var d=this&&this.__decorate||function(a,f,y,R){var k,D=arguments.length,E=D<3?f:R===null?R=Object.getOwnPropertyDescriptor(f,y):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(a,f,y,R);else for(var L=a.length-1;L>=0;L--)(k=a[L])&&(E=(D<3?k(E):D>3?k(f,y,E):k(f,y))||E);return D>3&&E&&Object.defineProperty(f,y,E),E},g=this&&this.__param||function(a,f){return function(y,R){f(y,R,a)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreService=void 0;const l=u(1439),m=u(8460),b=u(844),C=u(2585),p=Object.freeze({insertMode:!1}),o=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let c=r.CoreService=class extends b.Disposable{constructor(a,f,y){super(),this._bufferService=a,this._logService=f,this._optionsService=y,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new m.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new m.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new m.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new m.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,l.clone)(p),this.decPrivateModes=(0,l.clone)(o)}reset(){this.modes=(0,l.clone)(p),this.decPrivateModes=(0,l.clone)(o)}triggerDataEvent(a,f=!1){if(this._optionsService.rawOptions.disableStdin)return;const y=this._bufferService.buffer;f&&this._optionsService.rawOptions.scrollOnUserInput&&y.ybase!==y.ydisp&&this._onRequestScrollToBottom.fire(),f&&this._onUserInput.fire(),this._logService.debug(`sending data "${a}"`,(()=>a.split("").map((R=>R.charCodeAt(0))))),this._onData.fire(a)}triggerBinaryEvent(a){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${a}"`,(()=>a.split("").map((f=>f.charCodeAt(0))))),this._onBinary.fire(a))}};r.CoreService=c=d([g(0,C.IBufferService),g(1,C.ILogService),g(2,C.IOptionsService)],c)},9074:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DecorationService=void 0;const d=u(8055),g=u(8460),l=u(844),m=u(6106);let b=0,C=0;class p extends l.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new m.SortedList((a=>a==null?void 0:a.marker.line)),this._onDecorationRegistered=this.register(new g.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new g.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,l.toDisposable)((()=>this.reset())))}registerDecoration(a){if(a.marker.isDisposed)return;const f=new o(a);if(f){const y=f.marker.onDispose((()=>f.dispose()));f.onDispose((()=>{f&&(this._decorations.delete(f)&&this._onDecorationRemoved.fire(f),y.dispose())})),this._decorations.insert(f),this._onDecorationRegistered.fire(f)}return f}reset(){for(const a of this._decorations.values())a.dispose();this._decorations.clear()}*getDecorationsAtCell(a,f,y){let R=0,k=0;for(const D of this._decorations.getKeyIterator(f))R=D.options.x??0,k=R+(D.options.width??1),a>=R&&a<k&&(!y||(D.options.layer??"bottom")===y)&&(yield D)}forEachDecorationAtCell(a,f,y,R){this._decorations.forEachByKey(f,(k=>{b=k.options.x??0,C=b+(k.options.width??1),a>=b&&a<C&&(!y||(k.options.layer??"bottom")===y)&&R(k)}))}}r.DecorationService=p;class o extends l.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=d.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=d.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(a){super(),this.options=a,this.onRenderEmitter=this.register(new g.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new g.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=a.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.InstantiationService=r.ServiceCollection=void 0;const d=u(2585),g=u(8343);class l{constructor(...b){this._entries=new Map;for(const[C,p]of b)this.set(C,p)}set(b,C){const p=this._entries.get(b);return this._entries.set(b,C),p}forEach(b){for(const[C,p]of this._entries.entries())b(C,p)}has(b){return this._entries.has(b)}get(b){return this._entries.get(b)}}r.ServiceCollection=l,r.InstantiationService=class{constructor(){this._services=new l,this._services.set(d.IInstantiationService,this)}setService(m,b){this._services.set(m,b)}getService(m){return this._services.get(m)}createInstance(m,...b){const C=(0,g.getServiceDependencies)(m).sort(((c,a)=>c.index-a.index)),p=[];for(const c of C){const a=this._services.get(c.id);if(!a)throw new Error(`[createInstance] ${m.name} depends on UNKNOWN service ${c.id}.`);p.push(a)}const o=C.length>0?C[0].index:b.length;if(b.length!==o)throw new Error(`[createInstance] First service dependency of ${m.name} at position ${o+1} conflicts with ${b.length} static arguments`);return new m(...b,...p)}}},7866:function(A,r,u){var d=this&&this.__decorate||function(o,c,a,f){var y,R=arguments.length,k=R<3?c:f===null?f=Object.getOwnPropertyDescriptor(c,a):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(o,c,a,f);else for(var D=o.length-1;D>=0;D--)(y=o[D])&&(k=(R<3?y(k):R>3?y(c,a,k):y(c,a))||k);return R>3&&k&&Object.defineProperty(c,a,k),k},g=this&&this.__param||function(o,c){return function(a,f){c(a,f,o)}};Object.defineProperty(r,"__esModule",{value:!0}),r.traceCall=r.setTraceLogger=r.LogService=void 0;const l=u(844),m=u(2585),b={trace:m.LogLevelEnum.TRACE,debug:m.LogLevelEnum.DEBUG,info:m.LogLevelEnum.INFO,warn:m.LogLevelEnum.WARN,error:m.LogLevelEnum.ERROR,off:m.LogLevelEnum.OFF};let C,p=r.LogService=class extends l.Disposable{get logLevel(){return this._logLevel}constructor(o){super(),this._optionsService=o,this._logLevel=m.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),C=this}_updateLogLevel(){this._logLevel=b[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(o){for(let c=0;c<o.length;c++)typeof o[c]=="function"&&(o[c]=o[c]())}_log(o,c,a){this._evalLazyOptionalParams(a),o.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+c,...a)}trace(o,...c){var a;this._logLevel<=m.LogLevelEnum.TRACE&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.trace.bind(this._optionsService.options.logger))??console.log,o,c)}debug(o,...c){var a;this._logLevel<=m.LogLevelEnum.DEBUG&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.debug.bind(this._optionsService.options.logger))??console.log,o,c)}info(o,...c){var a;this._logLevel<=m.LogLevelEnum.INFO&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.info.bind(this._optionsService.options.logger))??console.info,o,c)}warn(o,...c){var a;this._logLevel<=m.LogLevelEnum.WARN&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.warn.bind(this._optionsService.options.logger))??console.warn,o,c)}error(o,...c){var a;this._logLevel<=m.LogLevelEnum.ERROR&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.error.bind(this._optionsService.options.logger))??console.error,o,c)}};r.LogService=p=d([g(0,m.IOptionsService)],p),r.setTraceLogger=function(o){C=o},r.traceCall=function(o,c,a){if(typeof a.value!="function")throw new Error("not supported");const f=a.value;a.value=function(...y){if(C.logLevel!==m.LogLevelEnum.TRACE)return f.apply(this,y);C.trace(`GlyphRenderer#${f.name}(${y.map((k=>JSON.stringify(k))).join(", ")})`);const R=f.apply(this,y);return C.trace(`GlyphRenderer#${f.name} return`,R),R}}},7302:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OptionsService=r.DEFAULT_OPTIONS=void 0;const d=u(8460),g=u(844),l=u(6114);r.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:l.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const m=["normal","bold","100","200","300","400","500","600","700","800","900"];class b extends g.Disposable{constructor(p){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const o={...r.DEFAULT_OPTIONS};for(const c in p)if(c in o)try{const a=p[c];o[c]=this._sanitizeAndValidateOption(c,a)}catch(a){console.error(a)}this.rawOptions=o,this.options={...o},this._setupOptions(),this.register((0,g.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(p,o){return this.onOptionChange((c=>{c===p&&o(this.rawOptions[p])}))}onMultipleOptionChange(p,o){return this.onOptionChange((c=>{p.indexOf(c)!==-1&&o()}))}_setupOptions(){const p=c=>{if(!(c in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${c}"`);return this.rawOptions[c]},o=(c,a)=>{if(!(c in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${c}"`);a=this._sanitizeAndValidateOption(c,a),this.rawOptions[c]!==a&&(this.rawOptions[c]=a,this._onOptionChange.fire(c))};for(const c in this.rawOptions){const a={get:p.bind(this,c),set:o.bind(this,c)};Object.defineProperty(this.options,c,a)}}_sanitizeAndValidateOption(p,o){switch(p){case"cursorStyle":if(o||(o=r.DEFAULT_OPTIONS[p]),!(function(c){return c==="block"||c==="underline"||c==="bar"})(o))throw new Error(`"${o}" is not a valid value for ${p}`);break;case"wordSeparator":o||(o=r.DEFAULT_OPTIONS[p]);break;case"fontWeight":case"fontWeightBold":if(typeof o=="number"&&1<=o&&o<=1e3)break;o=m.includes(o)?o:r.DEFAULT_OPTIONS[p];break;case"cursorWidth":o=Math.floor(o);case"lineHeight":case"tabStopWidth":if(o<1)throw new Error(`${p} cannot be less than 1, value: ${o}`);break;case"minimumContrastRatio":o=Math.max(1,Math.min(21,Math.round(10*o)/10));break;case"scrollback":if((o=Math.min(o,4294967295))<0)throw new Error(`${p} cannot be less than 0, value: ${o}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(o<=0)throw new Error(`${p} cannot be less than or equal to 0, value: ${o}`);break;case"rows":case"cols":if(!o&&o!==0)throw new Error(`${p} must be numeric, value: ${o}`);break;case"windowsPty":o=o??{}}return o}}r.OptionsService=b},2660:function(A,r,u){var d=this&&this.__decorate||function(b,C,p,o){var c,a=arguments.length,f=a<3?C:o===null?o=Object.getOwnPropertyDescriptor(C,p):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(b,C,p,o);else for(var y=b.length-1;y>=0;y--)(c=b[y])&&(f=(a<3?c(f):a>3?c(C,p,f):c(C,p))||f);return a>3&&f&&Object.defineProperty(C,p,f),f},g=this&&this.__param||function(b,C){return function(p,o){C(p,o,b)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkService=void 0;const l=u(2585);let m=r.OscLinkService=class{constructor(b){this._bufferService=b,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(b){const C=this._bufferService.buffer;if(b.id===void 0){const y=C.addMarker(C.ybase+C.y),R={data:b,id:this._nextId++,lines:[y]};return y.onDispose((()=>this._removeMarkerFromLink(R,y))),this._dataByLinkId.set(R.id,R),R.id}const p=b,o=this._getEntryIdKey(p),c=this._entriesWithId.get(o);if(c)return this.addLineToLink(c.id,C.ybase+C.y),c.id;const a=C.addMarker(C.ybase+C.y),f={id:this._nextId++,key:this._getEntryIdKey(p),data:p,lines:[a]};return a.onDispose((()=>this._removeMarkerFromLink(f,a))),this._entriesWithId.set(f.key,f),this._dataByLinkId.set(f.id,f),f.id}addLineToLink(b,C){const p=this._dataByLinkId.get(b);if(p&&p.lines.every((o=>o.line!==C))){const o=this._bufferService.buffer.addMarker(C);p.lines.push(o),o.onDispose((()=>this._removeMarkerFromLink(p,o)))}}getLinkData(b){var C;return(C=this._dataByLinkId.get(b))==null?void 0:C.data}_getEntryIdKey(b){return`${b.id};;${b.uri}`}_removeMarkerFromLink(b,C){const p=b.lines.indexOf(C);p!==-1&&(b.lines.splice(p,1),b.lines.length===0&&(b.data.id!==void 0&&this._entriesWithId.delete(b.key),this._dataByLinkId.delete(b.id)))}};r.OscLinkService=m=d([g(0,l.IBufferService)],m)},8343:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createDecorator=r.getServiceDependencies=r.serviceRegistry=void 0;const u="di$target",d="di$dependencies";r.serviceRegistry=new Map,r.getServiceDependencies=function(g){return g[d]||[]},r.createDecorator=function(g){if(r.serviceRegistry.has(g))return r.serviceRegistry.get(g);const l=function(m,b,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(p,o,c){o[u]===o?o[d].push({id:p,index:c}):(o[d]=[{id:p,index:c}],o[u]=o)})(l,m,C)};return l.toString=()=>g,r.serviceRegistry.set(g,l),l}},2585:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IDecorationService=r.IUnicodeService=r.IOscLinkService=r.IOptionsService=r.ILogService=r.LogLevelEnum=r.IInstantiationService=r.ICharsetService=r.ICoreService=r.ICoreMouseService=r.IBufferService=void 0;const d=u(8343);var g;r.IBufferService=(0,d.createDecorator)("BufferService"),r.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),r.ICoreService=(0,d.createDecorator)("CoreService"),r.ICharsetService=(0,d.createDecorator)("CharsetService"),r.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(l){l[l.TRACE=0]="TRACE",l[l.DEBUG=1]="DEBUG",l[l.INFO=2]="INFO",l[l.WARN=3]="WARN",l[l.ERROR=4]="ERROR",l[l.OFF=5]="OFF"})(g||(r.LogLevelEnum=g={})),r.ILogService=(0,d.createDecorator)("LogService"),r.IOptionsService=(0,d.createDecorator)("OptionsService"),r.IOscLinkService=(0,d.createDecorator)("OscLinkService"),r.IUnicodeService=(0,d.createDecorator)("UnicodeService"),r.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeService=void 0;const d=u(8460),g=u(225);class l{static extractShouldJoin(b){return(1&b)!=0}static extractWidth(b){return b>>1&3}static extractCharKind(b){return b>>3}static createPropertyValue(b,C,p=!1){return(16777215&b)<<3|(3&C)<<1|(p?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const b=new g.UnicodeV6;this.register(b),this._active=b.version,this._activeProvider=b}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(b){if(!this._providers[b])throw new Error(`unknown Unicode version "${b}"`);this._active=b,this._activeProvider=this._providers[b],this._onChange.fire(b)}register(b){this._providers[b.version]=b}wcwidth(b){return this._activeProvider.wcwidth(b)}getStringCellWidth(b){let C=0,p=0;const o=b.length;for(let c=0;c<o;++c){let a=b.charCodeAt(c);if(55296<=a&&a<=56319){if(++c>=o)return C+this.wcwidth(a);const R=b.charCodeAt(c);56320<=R&&R<=57343?a=1024*(a-55296)+R-56320+65536:C+=this.wcwidth(R)}const f=this.charProperties(a,p);let y=l.extractWidth(f);l.extractShouldJoin(f)&&(y-=l.extractWidth(p)),C+=y,p=f}return C}charProperties(b,C){return this._activeProvider.charProperties(b,C)}}r.UnicodeService=l}},S={};function M(A){var r=S[A];if(r!==void 0)return r.exports;var u=S[A]={exports:{}};return w[A].call(u.exports,u,u.exports,M),u.exports}var O={};return(()=>{var A=O;Object.defineProperty(A,"__esModule",{value:!0}),A.Terminal=void 0;const r=M(9042),u=M(3236),d=M(844),g=M(5741),l=M(8285),m=M(7975),b=M(7090),C=["cols","rows"];class p extends d.Disposable{constructor(c){super(),this._core=this.register(new u.Terminal(c)),this._addonManager=this.register(new g.AddonManager),this._publicOptions={...this._core.options};const a=y=>this._core.options[y],f=(y,R)=>{this._checkReadonlyOptions(y),this._core.options[y]=R};for(const y in this._core.options){const R={get:a.bind(this,y),set:f.bind(this,y)};Object.defineProperty(this._publicOptions,y,R)}}_checkReadonlyOptions(c){if(C.includes(c))throw new Error(`Option "${c}" 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.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new b.UnicodeApi(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 l.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const c=this._core.coreService.decPrivateModes;let a="none";switch(this._core.coreMouseService.activeProtocol){case"X10":a="x10";break;case"VT200":a="vt200";break;case"DRAG":a="drag";break;case"ANY":a="any"}return{applicationCursorKeysMode:c.applicationCursorKeys,applicationKeypadMode:c.applicationKeypad,bracketedPasteMode:c.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:a,originMode:c.origin,reverseWraparoundMode:c.reverseWraparound,sendFocusMode:c.sendFocus,wraparoundMode:c.wraparound}}get options(){return this._publicOptions}set options(c){for(const a in c)this._publicOptions[a]=c[a]}blur(){this._core.blur()}focus(){this._core.focus()}input(c,a=!0){this._core.input(c,a)}resize(c,a){this._verifyIntegers(c,a),this._core.resize(c,a)}open(c){this._core.open(c)}attachCustomKeyEventHandler(c){this._core.attachCustomKeyEventHandler(c)}attachCustomWheelEventHandler(c){this._core.attachCustomWheelEventHandler(c)}registerLinkProvider(c){return this._core.registerLinkProvider(c)}registerCharacterJoiner(c){return this._checkProposedApi(),this._core.registerCharacterJoiner(c)}deregisterCharacterJoiner(c){this._checkProposedApi(),this._core.deregisterCharacterJoiner(c)}registerMarker(c=0){return this._verifyIntegers(c),this._core.registerMarker(c)}registerDecoration(c){return this._checkProposedApi(),this._verifyPositiveIntegers(c.x??0,c.width??0,c.height??0),this._core.registerDecoration(c)}hasSelection(){return this._core.hasSelection()}select(c,a,f){this._verifyIntegers(c,a,f),this._core.select(c,a,f)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(c,a){this._verifyIntegers(c,a),this._core.selectLines(c,a)}dispose(){super.dispose()}scrollLines(c){this._verifyIntegers(c),this._core.scrollLines(c)}scrollPages(c){this._verifyIntegers(c),this._core.scrollPages(c)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(c){this._verifyIntegers(c),this._core.scrollToLine(c)}clear(){this._core.clear()}write(c,a){this._core.write(c,a)}writeln(c,a){this._core.write(c),this._core.write(`\r
|
|
416
|
+
`,a)}paste(c){this._core.paste(c)}refresh(c,a){this._verifyIntegers(c,a),this._core.refresh(c,a)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(c){this._addonManager.loadAddon(this,c)}static get strings(){return r}_verifyIntegers(...c){for(const a of c)if(a===1/0||isNaN(a)||a%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...c){for(const a of c)if(a&&(a===1/0||isNaN(a)||a%1!=0||a<0))throw new Error("This API only accepts positive integers")}}A.Terminal=p})(),O})()))})(Ku)),Ku.exports}var Xx=Kx(),Xu={exports:{}},Sg;function Vx(){return Sg||(Sg=1,(function(s,h){(function(w,S){s.exports=S()})(self,(()=>(()=>{var w={};return(()=>{var S=w;Object.defineProperty(S,"__esModule",{value:!0}),S.FitAddon=void 0,S.FitAddon=class{activate(M){this._terminal=M}dispose(){}fit(){const M=this.proposeDimensions();if(!M||!this._terminal||isNaN(M.cols)||isNaN(M.rows))return;const O=this._terminal._core;this._terminal.rows===M.rows&&this._terminal.cols===M.cols||(O._renderService.clear(),this._terminal.resize(M.cols,M.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const M=this._terminal._core,O=M._renderService.dimensions;if(O.css.cell.width===0||O.css.cell.height===0)return;const A=this._terminal.options.scrollback===0?0:M.viewport.scrollBarWidth,r=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(r.getPropertyValue("height")),d=Math.max(0,parseInt(r.getPropertyValue("width"))),g=window.getComputedStyle(this._terminal.element),l=u-(parseInt(g.getPropertyValue("padding-top"))+parseInt(g.getPropertyValue("padding-bottom"))),m=d-(parseInt(g.getPropertyValue("padding-right"))+parseInt(g.getPropertyValue("padding-left")))-A;return{cols:Math.max(2,Math.floor(m/O.css.cell.width)),rows:Math.max(1,Math.floor(l/O.css.cell.height))}}}})(),w})()))})(Xu)),Xu.exports}var Jx=Vx(),Vu={exports:{}},xg;function Qx(){return xg||(xg=1,(function(s,h){(function(w,S){s.exports=S()})(self,(()=>(()=>{var w={903:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BaseRenderLayer=void 0;const d=u(274),g=u(627),l=u(237),m=u(860),b=u(374),C=u(296),p=u(345),o=u(859),c=u(399),a=u(855);class f extends o.Disposable{get canvas(){return this._canvas}get cacheCanvas(){var k;return(k=this._charAtlas)==null?void 0:k.pages[0].canvas}constructor(k,D,E,L,z,H,P,I,K,X){super(),this._terminal=k,this._container=D,this._alpha=z,this._themeService=H,this._bufferService=P,this._optionsService=I,this._decorationService=K,this._coreBrowserService=X,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._selectionModel=(0,C.createSelectionRenderModel)(),this._bitmapGenerator=[],this._charAtlasDisposable=this.register(new o.MutableDisposable),this._onAddTextureAtlasCanvas=this.register(new p.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._cellColorResolver=new d.CellColorResolver(this._terminal,this._optionsService,this._selectionModel,this._decorationService,this._coreBrowserService,this._themeService),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${E}-layer`),this._canvas.style.zIndex=L.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._refreshCharAtlas(this._themeService.colors),this.register(this._themeService.onChangeColors((Y=>{this._refreshCharAtlas(Y),this.reset(),this.handleSelectionChanged(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}))),this.register((0,o.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,b.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(){}handleFocus(){}handleCursorMove(){}handleGridChanged(k,D){}handleSelectionChanged(k,D,E=!1){this._selectionModel.update(this._terminal._core,k,D,E)}_setTransparency(k){if(k===this._alpha)return;const D=this._canvas;this._alpha=k,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,D),this._refreshCharAtlas(this._themeService.colors),this.handleGridChanged(0,this._bufferService.rows-1)}_refreshCharAtlas(k){if(!(this._deviceCharWidth<=0&&this._deviceCharHeight<=0)){this._charAtlas=(0,g.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,k,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlasDisposable.value=(0,p.forwardEvent)(this._charAtlas.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),this._charAtlas.warmUp();for(let D=0;D<this._charAtlas.pages.length;D++)this._bitmapGenerator[D]=new y(this._charAtlas.pages[D].canvas)}}resize(k){this._deviceCellWidth=k.device.cell.width,this._deviceCellHeight=k.device.cell.height,this._deviceCharWidth=k.device.char.width,this._deviceCharHeight=k.device.char.height,this._deviceCharLeft=k.device.char.left,this._deviceCharTop=k.device.char.top,this._canvas.width=k.device.canvas.width,this._canvas.height=k.device.canvas.height,this._canvas.style.width=`${k.css.canvas.width}px`,this._canvas.style.height=`${k.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(this._themeService.colors)}clearTextureAtlas(){var k;(k=this._charAtlas)==null||k.clearTexture()}_fillCells(k,D,E,L){this._ctx.fillRect(k*this._deviceCellWidth,D*this._deviceCellHeight,E*this._deviceCellWidth,L*this._deviceCellHeight)}_fillMiddleLineAtCells(k,D,E=1){const L=Math.ceil(.5*this._deviceCellHeight);this._ctx.fillRect(k*this._deviceCellWidth,(D+1)*this._deviceCellHeight-L-this._coreBrowserService.dpr,E*this._deviceCellWidth,this._coreBrowserService.dpr)}_fillBottomLineAtCells(k,D,E=1,L=0){this._ctx.fillRect(k*this._deviceCellWidth,(D+1)*this._deviceCellHeight+L-this._coreBrowserService.dpr-1,E*this._deviceCellWidth,this._coreBrowserService.dpr)}_curlyUnderlineAtCell(k,D,E=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const L=this._coreBrowserService.dpr;this._ctx.lineWidth=L;for(let z=0;z<E;z++){const H=(k+z)*this._deviceCellWidth,P=(k+z+.5)*this._deviceCellWidth,I=(k+z+1)*this._deviceCellWidth,K=(D+1)*this._deviceCellHeight-L-1,X=K-L,Y=K+L;this._ctx.moveTo(H,K),this._ctx.bezierCurveTo(H,X,P,X,P,K),this._ctx.bezierCurveTo(P,Y,I,Y,I,K)}this._ctx.stroke(),this._ctx.restore()}_dottedUnderlineAtCell(k,D,E=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const L=this._coreBrowserService.dpr;this._ctx.lineWidth=L,this._ctx.setLineDash([2*L,L]);const z=k*this._deviceCellWidth,H=(D+1)*this._deviceCellHeight-L-1;this._ctx.moveTo(z,H);for(let P=0;P<E;P++){const I=(k+E+P)*this._deviceCellWidth;this._ctx.lineTo(I,H)}this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_dashedUnderlineAtCell(k,D,E=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const L=this._coreBrowserService.dpr;this._ctx.lineWidth=L,this._ctx.setLineDash([4*L,3*L]);const z=k*this._deviceCellWidth,H=(k+E)*this._deviceCellWidth,P=(D+1)*this._deviceCellHeight-L-1;this._ctx.moveTo(z,P),this._ctx.lineTo(H,P),this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_fillLeftLineAtCell(k,D,E){this._ctx.fillRect(k*this._deviceCellWidth,D*this._deviceCellHeight,this._coreBrowserService.dpr*E,this._deviceCellHeight)}_strokeRectAtCell(k,D,E,L){const z=this._coreBrowserService.dpr;this._ctx.lineWidth=z,this._ctx.strokeRect(k*this._deviceCellWidth+z/2,D*this._deviceCellHeight+z/2,E*this._deviceCellWidth-z,L*this._deviceCellHeight-z)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(k,D,E,L){this._alpha?this._ctx.clearRect(k*this._deviceCellWidth,D*this._deviceCellHeight,E*this._deviceCellWidth,L*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(k*this._deviceCellWidth,D*this._deviceCellHeight,E*this._deviceCellWidth,L*this._deviceCellHeight))}_fillCharTrueColor(k,D,E){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline=l.TEXT_BASELINE,this._clipRow(E);let L=!1;this._optionsService.rawOptions.customGlyphs!==!1&&(L=(0,m.tryDrawCustomChar)(this._ctx,k.getChars(),D*this._deviceCellWidth,E*this._deviceCellHeight,this._deviceCellWidth,this._deviceCellHeight,this._optionsService.rawOptions.fontSize,this._coreBrowserService.dpr)),L||this._ctx.fillText(k.getChars(),D*this._deviceCellWidth+this._deviceCharLeft,E*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_drawChars(k,D,E){var K,X,Y,$;const L=k.getChars(),z=k.getCode(),H=k.getWidth();if(this._cellColorResolver.resolve(k,D,this._bufferService.buffer.ydisp+E,this._deviceCellWidth),!this._charAtlas)return;let P;if(P=L&&L.length>1?this._charAtlas.getRasterizedGlyphCombinedChar(L,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0):this._charAtlas.getRasterizedGlyph(k.getCode()||a.WHITESPACE_CELL_CODE,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0),!P.size.x||!P.size.y)return;this._ctx.save(),this._clipRow(E),this._bitmapGenerator[P.texturePage]&&this._charAtlas.pages[P.texturePage].canvas!==this._bitmapGenerator[P.texturePage].canvas&&((X=(K=this._bitmapGenerator[P.texturePage])==null?void 0:K.bitmap)==null||X.close(),delete this._bitmapGenerator[P.texturePage]),this._charAtlas.pages[P.texturePage].version!==((Y=this._bitmapGenerator[P.texturePage])==null?void 0:Y.version)&&(this._bitmapGenerator[P.texturePage]||(this._bitmapGenerator[P.texturePage]=new y(this._charAtlas.pages[P.texturePage].canvas)),this._bitmapGenerator[P.texturePage].refresh(),this._bitmapGenerator[P.texturePage].version=this._charAtlas.pages[P.texturePage].version);let I=P.size.x;this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,b.allowRescaling)(z,H,P.size.x,this._deviceCellWidth)&&(I=this._deviceCellWidth-1),this._ctx.drawImage((($=this._bitmapGenerator[P.texturePage])==null?void 0:$.bitmap)||this._charAtlas.pages[P.texturePage].canvas,P.texturePosition.x,P.texturePosition.y,P.size.x,P.size.y,D*this._deviceCellWidth+this._deviceCharLeft-P.offset.x,E*this._deviceCellHeight+this._deviceCharTop-P.offset.y,I,P.size.y),this._ctx.restore()}_clipRow(k){this._ctx.beginPath(),this._ctx.rect(0,k*this._deviceCellHeight,this._bufferService.cols*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(k,D){return`${D?"italic":""} ${k?this._optionsService.rawOptions.fontWeightBold:this._optionsService.rawOptions.fontWeight} ${this._optionsService.rawOptions.fontSize*this._coreBrowserService.dpr}px ${this._optionsService.rawOptions.fontFamily}`}}r.BaseRenderLayer=f;class y{get bitmap(){return this._bitmap}constructor(k){this.canvas=k,this._state=0,this._commitTimeout=void 0,this._bitmap=void 0,this.version=-1}refresh(){var k;(k=this._bitmap)==null||k.close(),this._bitmap=void 0,c.isSafari||(this._commitTimeout===void 0&&(this._commitTimeout=window.setTimeout((()=>this._generate()),100)),this._state===1&&(this._state=2))}_generate(){var k;this._state===0&&((k=this._bitmap)==null||k.close(),this._bitmap=void 0,this._state=1,window.createImageBitmap(this.canvas).then((D=>{this._state===2?this.refresh():this._bitmap=D,this._state=0})),this._commitTimeout&&(this._commitTimeout=void 0))}}},949:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CanvasRenderer=void 0;const d=u(627),g=u(56),l=u(374),m=u(345),b=u(859),C=u(873),p=u(43),o=u(630),c=u(744);class a extends b.Disposable{constructor(y,R,k,D,E,L,z,H,P,I,K){super(),this._terminal=y,this._screenElement=R,this._bufferService=D,this._charSizeService=E,this._optionsService=L,this._coreBrowserService=P,this._themeService=K,this._observerDisposable=this.register(new b.MutableDisposable),this._onRequestRedraw=this.register(new m.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onChangeTextureAtlas=this.register(new m.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new m.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event;const X=this._optionsService.rawOptions.allowTransparency;this._renderLayers=[new c.TextRenderLayer(this._terminal,this._screenElement,0,X,this._bufferService,this._optionsService,z,I,this._coreBrowserService,K),new o.SelectionRenderLayer(this._terminal,this._screenElement,1,this._bufferService,this._coreBrowserService,I,this._optionsService,K),new p.LinkRenderLayer(this._terminal,this._screenElement,2,k,this._bufferService,this._optionsService,I,this._coreBrowserService,K),new C.CursorRenderLayer(this._terminal,this._screenElement,3,this._onRequestRedraw,this._bufferService,this._optionsService,H,this._coreBrowserService,I,K)];for(const Y of this._renderLayers)(0,m.forwardEvent)(Y.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas);this.dimensions=(0,l.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._observerDisposable.value=(0,g.observeDevicePixelDimensions)(this._renderLayers[0].canvas,this._coreBrowserService.window,((Y,$)=>this._setCanvasDevicePixelDimensions(Y,$))),this.register(this._coreBrowserService.onWindowChange((Y=>{this._observerDisposable.value=(0,g.observeDevicePixelDimensions)(this._renderLayers[0].canvas,Y,(($,U)=>this._setCanvasDevicePixelDimensions($,U)))}))),this.register((0,b.toDisposable)((()=>{for(const Y of this._renderLayers)Y.dispose();(0,d.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){return this._renderLayers[0].cacheCanvas}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._bufferService.cols,this._bufferService.rows))}handleResize(y,R){this._updateDimensions();for(const k of this._renderLayers)k.resize(this.dimensions);this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}handleCharSizeChanged(){this.handleResize(this._bufferService.cols,this._bufferService.rows)}handleBlur(){this._runOperation((y=>y.handleBlur()))}handleFocus(){this._runOperation((y=>y.handleFocus()))}handleSelectionChanged(y,R,k=!1){this._runOperation((D=>D.handleSelectionChanged(y,R,k))),this._themeService.colors.selectionForeground&&this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}handleCursorMove(){this._runOperation((y=>y.handleCursorMove()))}clear(){this._runOperation((y=>y.reset()))}_runOperation(y){for(const R of this._renderLayers)y(R)}renderRows(y,R){for(const k of this._renderLayers)k.handleGridChanged(y,R)}clearTextureAtlas(){for(const y of this._renderLayers)y.clearTextureAtlas()}_updateDimensions(){if(!this._charSizeService.hasValidSize)return;const y=this._coreBrowserService.dpr;this.dimensions.device.char.width=Math.floor(this._charSizeService.width*y),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*y),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._bufferService.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._bufferService.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/y),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/y),this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows,this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols}_setCanvasDevicePixelDimensions(y,R){this.dimensions.device.canvas.height=R,this.dimensions.device.canvas.width=y;for(const k of this._renderLayers)k.resize(this.dimensions);this._requestRedrawViewport()}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}}r.CanvasRenderer=a},873:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CursorRenderLayer=void 0;const d=u(457),g=u(859),l=u(399),m=u(782),b=u(903);class C extends b.BaseRenderLayer{constructor(o,c,a,f,y,R,k,D,E,L){super(o,c,"cursor",a,!0,L,y,R,E,D),this._onRequestRedraw=f,this._coreService=k,this._cursorBlinkStateManager=this.register(new g.MutableDisposable),this._cell=new m.CellData,this._state={x:0,y:0,isFocused:!1,style:"",width:0},this._cursorRenderers={bar:this._renderBarCursor.bind(this),block:this._renderBlockCursor.bind(this),underline:this._renderUnderlineCursor.bind(this),outline:this._renderOutlineCursor.bind(this)},this.register(R.onOptionChange((()=>this._handleOptionsChanged()))),this._handleOptionsChanged()}resize(o){super.resize(o),this._state={x:0,y:0,isFocused:!1,style:"",width:0}}reset(){var o;this._clearCursor(),(o=this._cursorBlinkStateManager.value)==null||o.restartBlinkAnimation(),this._handleOptionsChanged()}handleBlur(){var o;(o=this._cursorBlinkStateManager.value)==null||o.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleFocus(){var o;(o=this._cursorBlinkStateManager.value)==null||o.resume(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}_handleOptionsChanged(){this._optionsService.rawOptions.cursorBlink?this._cursorBlinkStateManager.value||(this._cursorBlinkStateManager.value=new d.CursorBlinkStateManager((()=>this._render(!0)),this._coreBrowserService)):this._cursorBlinkStateManager.clear(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleCursorMove(){var o;(o=this._cursorBlinkStateManager.value)==null||o.restartBlinkAnimation()}handleGridChanged(o,c){!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isPaused?this._render(!1):this._cursorBlinkStateManager.value.restartBlinkAnimation()}_render(o){if(!this._coreService.isCursorInitialized||this._coreService.isCursorHidden)return void this._clearCursor();const c=this._bufferService.buffer.ybase+this._bufferService.buffer.y,a=c-this._bufferService.buffer.ydisp;if(a<0||a>=this._bufferService.rows)return void this._clearCursor();const f=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(c).loadCell(f,this._cell),this._cell.content!==void 0){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css;const y=this._optionsService.rawOptions.cursorStyle,R=this._optionsService.rawOptions.cursorInactiveStyle;return R&&R!=="none"&&this._cursorRenderers[R](f,a,this._cell),this._ctx.restore(),this._state.x=f,this._state.y=a,this._state.isFocused=!1,this._state.style=y,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible){if(this._state){if(this._state.x===f&&this._state.y===a&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===this._optionsService.rawOptions.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[this._optionsService.rawOptions.cursorStyle||"block"](f,a,this._cell),this._ctx.restore(),this._state.x=f,this._state.y=a,this._state.isFocused=!1,this._state.style=this._optionsService.rawOptions.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}_clearCursor(){this._state&&(l.isFirefox||this._coreBrowserService.dpr<1?this._clearAll():this._clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:0,y:0,isFocused:!1,style:"",width:0})}_renderBarCursor(o,c,a){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillLeftLineAtCell(o,c,this._optionsService.rawOptions.cursorWidth),this._ctx.restore()}_renderBlockCursor(o,c,a){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillCells(o,c,a.getWidth(),1),this._ctx.fillStyle=this._themeService.colors.cursorAccent.css,this._fillCharTrueColor(a,o,c),this._ctx.restore()}_renderUnderlineCursor(o,c,a){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillBottomLineAtCells(o,c),this._ctx.restore()}_renderOutlineCursor(o,c,a){this._ctx.save(),this._ctx.strokeStyle=this._themeService.colors.cursor.css,this._strokeRectAtCell(o,c,a.getWidth(),1),this._ctx.restore()}}r.CursorRenderLayer=C},574:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.GridCache=void 0,r.GridCache=class{constructor(){this.cache=[]}resize(u,d){for(let g=0;g<u;g++){this.cache.length<=g&&this.cache.push([]);for(let l=this.cache[g].length;l<d;l++)this.cache[g].push(void 0);this.cache[g].length=d}this.cache.length=u}clear(){for(let u=0;u<this.cache.length;u++)for(let d=0;d<this.cache[u].length;d++)this.cache[u][d]=void 0}}},43:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.LinkRenderLayer=void 0;const d=u(197),g=u(237),l=u(903);class m extends l.BaseRenderLayer{constructor(C,p,o,c,a,f,y,R,k){super(C,p,"link",o,!0,k,a,f,y,R),this.register(c.onShowLinkUnderline((D=>this._handleShowLinkUnderline(D)))),this.register(c.onHideLinkUnderline((D=>this._handleHideLinkUnderline(D))))}resize(C){super.resize(C),this._state=void 0}reset(){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const C=this._state.y2-this._state.y1-1;C>0&&this._clearCells(0,this._state.y1+1,this._state.cols,C),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(C){if(C.fg===g.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:C.fg&&(0,d.is256Color)(C.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[C.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,C.y1===C.y2)this._fillBottomLineAtCells(C.x1,C.y1,C.x2-C.x1);else{this._fillBottomLineAtCells(C.x1,C.y1,C.cols-C.x1);for(let p=C.y1+1;p<C.y2;p++)this._fillBottomLineAtCells(0,p,C.cols);this._fillBottomLineAtCells(0,C.y2,C.x2)}this._state=C}_handleHideLinkUnderline(C){this._clearCurrentLink()}}r.LinkRenderLayer=m},630:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionRenderLayer=void 0;const d=u(903);class g extends d.BaseRenderLayer{constructor(m,b,C,p,o,c,a,f){super(m,b,"selection",C,!0,f,p,a,c,o),this._clearState()}_clearState(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}}resize(m){super.resize(m),this._selectionModel.selectionStart&&this._selectionModel.selectionEnd&&(this._clearState(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode))}reset(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())}handleBlur(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleFocus(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleSelectionChanged(m,b,C){super.handleSelectionChanged(m,b,C),this._redrawSelection(m,b,C)}_redrawSelection(m,b,C){if(!this._didStateChange(m,b,C,this._bufferService.buffer.ydisp))return;if(this._clearAll(),!m||!b)return void this._clearState();const p=m[1]-this._bufferService.buffer.ydisp,o=b[1]-this._bufferService.buffer.ydisp,c=Math.max(p,0),a=Math.min(o,this._bufferService.rows-1);if(c>=this._bufferService.rows||a<0)this._state.ydisp=this._bufferService.buffer.ydisp;else{if(this._ctx.fillStyle=(this._coreBrowserService.isFocused?this._themeService.colors.selectionBackgroundTransparent:this._themeService.colors.selectionInactiveBackgroundTransparent).css,C){const f=m[0],y=b[0]-f,R=a-c+1;this._fillCells(f,c,y,R)}else{const f=p===c?m[0]:0,y=c===o?b[0]:this._bufferService.cols;this._fillCells(f,c,y-f,1);const R=Math.max(a-c-1,0);if(this._fillCells(0,c+1,this._bufferService.cols,R),c!==a){const k=o===a?b[0]:this._bufferService.cols;this._fillCells(0,a,k,1)}}this._state.start=[m[0],m[1]],this._state.end=[b[0],b[1]],this._state.columnSelectMode=C,this._state.ydisp=this._bufferService.buffer.ydisp}}_didStateChange(m,b,C,p){return!this._areCoordinatesEqual(m,this._state.start)||!this._areCoordinatesEqual(b,this._state.end)||C!==this._state.columnSelectMode||p!==this._state.ydisp}_areCoordinatesEqual(m,b){return!(!m||!b)&&m[0]===b[0]&&m[1]===b[1]}}r.SelectionRenderLayer=g},744:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TextRenderLayer=void 0;const d=u(577),g=u(147),l=u(782),m=u(855),b=u(903),C=u(574);class p extends b.BaseRenderLayer{constructor(c,a,f,y,R,k,D,E,L,z){super(c,a,"text",f,y,z,R,k,E,L),this._characterJoinerService=D,this._characterWidth=0,this._characterFont="",this._characterOverlapCache={},this._workCell=new l.CellData,this._state=new C.GridCache,this.register(k.onSpecificOptionChange("allowTransparency",(H=>this._setTransparency(H))))}resize(c){super.resize(c);const a=this._getFont(!1,!1);this._characterWidth===c.device.char.width&&this._characterFont===a||(this._characterWidth=c.device.char.width,this._characterFont=a,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)}reset(){this._state.clear(),this._clearAll()}_forEachCell(c,a,f){for(let y=c;y<=a;y++){const R=y+this._bufferService.buffer.ydisp,k=this._bufferService.buffer.lines.get(R),D=this._characterJoinerService.getJoinedCharacters(R);for(let E=0;E<this._bufferService.cols;E++){k.loadCell(E,this._workCell);let L=this._workCell,z=!1,H=E;if(L.getWidth()!==0){if(D.length>0&&E===D[0][0]){z=!0;const P=D.shift();L=new d.JoinedCellData(this._workCell,k.translateToString(!0,P[0],P[1]),P[1]-P[0]),H=P[1]-1}!z&&this._isOverlapping(L)&&H<k.length-1&&k.getCodePoint(H+1)===m.NULL_CELL_CODE&&(L.content&=-12582913,L.content|=8388608),f(L,E,y),E=H}}}}_drawBackground(c,a){const f=this._ctx,y=this._bufferService.cols;let R=0,k=0,D=null;f.save(),this._forEachCell(c,a,((E,L,z)=>{let H=null;E.isInverse()?H=E.isFgDefault()?this._themeService.colors.foreground.css:E.isFgRGB()?`rgb(${g.AttributeData.toColorRGB(E.getFgColor()).join(",")})`:this._themeService.colors.ansi[E.getFgColor()].css:E.isBgRGB()?H=`rgb(${g.AttributeData.toColorRGB(E.getBgColor()).join(",")})`:E.isBgPalette()&&(H=this._themeService.colors.ansi[E.getBgColor()].css);let P=!1;this._decorationService.forEachDecorationAtCell(L,this._bufferService.buffer.ydisp+z,void 0,(I=>{I.options.layer!=="top"&&P||(I.backgroundColorRGB&&(H=I.backgroundColorRGB.css),P=I.options.layer==="top")})),D===null&&(R=L,k=z),z!==k?(f.fillStyle=D||"",this._fillCells(R,k,y-R,1),R=L,k=z):D!==H&&(f.fillStyle=D||"",this._fillCells(R,k,L-R,1),R=L,k=z),D=H})),D!==null&&(f.fillStyle=D,this._fillCells(R,k,y-R,1)),f.restore()}_drawForeground(c,a){this._forEachCell(c,a,((f,y,R)=>this._drawChars(f,y,R)))}handleGridChanged(c,a){this._state.cache.length!==0&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,c,this._bufferService.cols,a-c+1),this._drawBackground(c,a),this._drawForeground(c,a))}_isOverlapping(c){if(c.getWidth()!==1||c.getCode()<256)return!1;const a=c.getChars();if(this._characterOverlapCache.hasOwnProperty(a))return this._characterOverlapCache[a];this._ctx.save(),this._ctx.font=this._characterFont;const f=Math.floor(this._ctx.measureText(a).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[a]=f,f}}r.TextRenderLayer=p},274:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellColorResolver=void 0;const d=u(855),g=u(160),l=u(374);let m,b=0,C=0,p=!1,o=!1,c=!1,a=0;r.CellColorResolver=class{constructor(f,y,R,k,D,E){this._terminal=f,this._optionService=y,this._selectionRenderModel=R,this._decorationService=k,this._coreBrowserService=D,this._themeService=E,this.result={fg:0,bg:0,ext:0}}resolve(f,y,R,k){if(this.result.bg=f.bg,this.result.fg=f.fg,this.result.ext=268435456&f.bg?f.extended.ext:0,C=0,b=0,o=!1,p=!1,c=!1,m=this._themeService.colors,a=0,f.getCode()!==d.NULL_CELL_CODE&&f.extended.underlineStyle===4){const D=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));a=y*k%(2*Math.round(D))}if(this._decorationService.forEachDecorationAtCell(y,R,"bottom",(D=>{D.backgroundColorRGB&&(C=D.backgroundColorRGB.rgba>>8&16777215,o=!0),D.foregroundColorRGB&&(b=D.foregroundColorRGB.rgba>>8&16777215,p=!0)})),c=this._selectionRenderModel.isCellSelected(this._terminal,y,R),c){if(67108864&this.result.fg||(50331648&this.result.bg)!=0){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:C=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:C=(16777215&this.result.fg)<<8|255;break;default:C=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:C=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:C=(16777215&this.result.bg)<<8|255}C=g.rgba.blend(C,4294967040&(this._coreBrowserService.isFocused?m.selectionBackgroundOpaque:m.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else C=(this._coreBrowserService.isFocused?m.selectionBackgroundOpaque:m.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(o=!0,m.selectionForeground&&(b=m.selectionForeground.rgba>>8&16777215,p=!0),(0,l.treatGlyphAsBackgroundColor)(f.getCode())){if(67108864&this.result.fg&&(50331648&this.result.bg)==0)b=(this._coreBrowserService.isFocused?m.selectionBackgroundOpaque:m.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:b=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:b=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:b=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:b=(16777215&this.result.fg)<<8|255;break;default:b=this._themeService.colors.foreground.rgba}b=g.rgba.blend(b,4294967040&(this._coreBrowserService.isFocused?m.selectionBackgroundOpaque:m.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}p=!0}}this._decorationService.forEachDecorationAtCell(y,R,"top",(D=>{D.backgroundColorRGB&&(C=D.backgroundColorRGB.rgba>>8&16777215,o=!0),D.foregroundColorRGB&&(b=D.foregroundColorRGB.rgba>>8&16777215,p=!0)})),o&&(C=c?-16777216&f.bg&-134217729|C|50331648:-16777216&f.bg|C|50331648),p&&(b=-16777216&f.fg&-67108865|b|50331648),67108864&this.result.fg&&(o&&!p&&(b=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&m.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,p=!0),!o&&p&&(C=(50331648&this.result.fg)==0?-67108864&this.result.bg|16777215&m.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,o=!0)),m=void 0,this.result.bg=o?C:this.result.bg,this.result.fg=p?b:this.result.fg,this.result.ext&=536870911,this.result.ext|=a<<29&3758096384}}},627:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.removeTerminalFromCache=r.acquireTextureAtlas=void 0;const d=u(509),g=u(197),l=[];r.acquireTextureAtlas=function(m,b,C,p,o,c,a,f){const y=(0,g.generateConfig)(p,o,c,a,b,C,f);for(let D=0;D<l.length;D++){const E=l[D],L=E.ownedBy.indexOf(m);if(L>=0){if((0,g.configEquals)(E.config,y))return E.atlas;E.ownedBy.length===1?(E.atlas.dispose(),l.splice(D,1)):E.ownedBy.splice(L,1);break}}for(let D=0;D<l.length;D++){const E=l[D];if((0,g.configEquals)(E.config,y))return E.ownedBy.push(m),E.atlas}const R=m._core,k={atlas:new d.TextureAtlas(document,y,R.unicodeService),config:y,ownedBy:[m]};return l.push(k),k.atlas},r.removeTerminalFromCache=function(m){for(let b=0;b<l.length;b++){const C=l[b].ownedBy.indexOf(m);if(C!==-1){l[b].ownedBy.length===1?(l[b].atlas.dispose(),l.splice(b,1)):l[b].ownedBy.splice(C,1);break}}}},197:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.is256Color=r.configEquals=r.generateConfig=void 0;const d=u(160);r.generateConfig=function(g,l,m,b,C,p,o){const c={foreground:p.foreground,background:p.background,cursor:d.NULL_COLOR,cursorAccent:d.NULL_COLOR,selectionForeground:d.NULL_COLOR,selectionBackgroundTransparent:d.NULL_COLOR,selectionBackgroundOpaque:d.NULL_COLOR,selectionInactiveBackgroundTransparent:d.NULL_COLOR,selectionInactiveBackgroundOpaque:d.NULL_COLOR,ansi:p.ansi.slice(),contrastCache:p.contrastCache,halfContrastCache:p.halfContrastCache};return{customGlyphs:C.customGlyphs,devicePixelRatio:o,letterSpacing:C.letterSpacing,lineHeight:C.lineHeight,deviceCellWidth:g,deviceCellHeight:l,deviceCharWidth:m,deviceCharHeight:b,fontFamily:C.fontFamily,fontSize:C.fontSize,fontWeight:C.fontWeight,fontWeightBold:C.fontWeightBold,allowTransparency:C.allowTransparency,drawBoldTextInBrightColors:C.drawBoldTextInBrightColors,minimumContrastRatio:C.minimumContrastRatio,colors:c}},r.configEquals=function(g,l){for(let m=0;m<g.colors.ansi.length;m++)if(g.colors.ansi[m].rgba!==l.colors.ansi[m].rgba)return!1;return g.devicePixelRatio===l.devicePixelRatio&&g.customGlyphs===l.customGlyphs&&g.lineHeight===l.lineHeight&&g.letterSpacing===l.letterSpacing&&g.fontFamily===l.fontFamily&&g.fontSize===l.fontSize&&g.fontWeight===l.fontWeight&&g.fontWeightBold===l.fontWeightBold&&g.allowTransparency===l.allowTransparency&&g.deviceCharWidth===l.deviceCharWidth&&g.deviceCharHeight===l.deviceCharHeight&&g.drawBoldTextInBrightColors===l.drawBoldTextInBrightColors&&g.minimumContrastRatio===l.minimumContrastRatio&&g.colors.foreground.rgba===l.colors.foreground.rgba&&g.colors.background.rgba===l.colors.background.rgba},r.is256Color=function(g){return(50331648&g)==16777216||(50331648&g)==33554432}},237:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TEXT_BASELINE=r.DIM_OPACITY=r.INVERTED_DEFAULT_COLOR=void 0;const d=u(399);r.INVERTED_DEFAULT_COLOR=257,r.DIM_OPACITY=.5,r.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},457:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CursorBlinkStateManager=void 0,r.CursorBlinkStateManager=class{constructor(u,d){this._renderCallback=u,this._coreBrowserService=d,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))))}_restartInterval(u=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){const d=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,d>0)return void this._restartInterval(d)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0})),this._blinkInterval=this._coreBrowserService.window.setInterval((()=>{if(this._animationTimeRestarted){const d=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(d)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),u)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tryDrawCustomChar=r.powerlineDefinitions=r.boxDrawingDefinitions=r.blockElementDefinitions=void 0;const d=u(374);r.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const g={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};r.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(p,o)=>`M0,${.5-o} L1,${.5-o} M0,${.5+o} L1,${.5+o}`},"║":{1:(p,o)=>`M${.5-p},0 L${.5-p},1 M${.5+p},0 L${.5+p},1`},"╒":{1:(p,o)=>`M.5,1 L.5,${.5-o} L1,${.5-o} M.5,${.5+o} L1,${.5+o}`},"╓":{1:(p,o)=>`M${.5-p},1 L${.5-p},.5 L1,.5 M${.5+p},.5 L${.5+p},1`},"╔":{1:(p,o)=>`M1,${.5-o} L${.5-p},${.5-o} L${.5-p},1 M1,${.5+o} L${.5+p},${.5+o} L${.5+p},1`},"╕":{1:(p,o)=>`M0,${.5-o} L.5,${.5-o} L.5,1 M0,${.5+o} L.5,${.5+o}`},"╖":{1:(p,o)=>`M${.5+p},1 L${.5+p},.5 L0,.5 M${.5-p},.5 L${.5-p},1`},"╗":{1:(p,o)=>`M0,${.5+o} L${.5-p},${.5+o} L${.5-p},1 M0,${.5-o} L${.5+p},${.5-o} L${.5+p},1`},"╘":{1:(p,o)=>`M.5,0 L.5,${.5+o} L1,${.5+o} M.5,${.5-o} L1,${.5-o}`},"╙":{1:(p,o)=>`M1,.5 L${.5-p},.5 L${.5-p},0 M${.5+p},.5 L${.5+p},0`},"╚":{1:(p,o)=>`M1,${.5-o} L${.5+p},${.5-o} L${.5+p},0 M1,${.5+o} L${.5-p},${.5+o} L${.5-p},0`},"╛":{1:(p,o)=>`M0,${.5+o} L.5,${.5+o} L.5,0 M0,${.5-o} L.5,${.5-o}`},"╜":{1:(p,o)=>`M0,.5 L${.5+p},.5 L${.5+p},0 M${.5-p},.5 L${.5-p},0`},"╝":{1:(p,o)=>`M0,${.5-o} L${.5-p},${.5-o} L${.5-p},0 M0,${.5+o} L${.5+p},${.5+o} L${.5+p},0`},"╞":{1:(p,o)=>`M.5,0 L.5,1 M.5,${.5-o} L1,${.5-o} M.5,${.5+o} L1,${.5+o}`},"╟":{1:(p,o)=>`M${.5-p},0 L${.5-p},1 M${.5+p},0 L${.5+p},1 M${.5+p},.5 L1,.5`},"╠":{1:(p,o)=>`M${.5-p},0 L${.5-p},1 M1,${.5+o} L${.5+p},${.5+o} L${.5+p},1 M1,${.5-o} L${.5+p},${.5-o} L${.5+p},0`},"╡":{1:(p,o)=>`M.5,0 L.5,1 M0,${.5-o} L.5,${.5-o} M0,${.5+o} L.5,${.5+o}`},"╢":{1:(p,o)=>`M0,.5 L${.5-p},.5 M${.5-p},0 L${.5-p},1 M${.5+p},0 L${.5+p},1`},"╣":{1:(p,o)=>`M${.5+p},0 L${.5+p},1 M0,${.5+o} L${.5-p},${.5+o} L${.5-p},1 M0,${.5-o} L${.5-p},${.5-o} L${.5-p},0`},"╤":{1:(p,o)=>`M0,${.5-o} L1,${.5-o} M0,${.5+o} L1,${.5+o} M.5,${.5+o} L.5,1`},"╥":{1:(p,o)=>`M0,.5 L1,.5 M${.5-p},.5 L${.5-p},1 M${.5+p},.5 L${.5+p},1`},"╦":{1:(p,o)=>`M0,${.5-o} L1,${.5-o} M0,${.5+o} L${.5-p},${.5+o} L${.5-p},1 M1,${.5+o} L${.5+p},${.5+o} L${.5+p},1`},"╧":{1:(p,o)=>`M.5,0 L.5,${.5-o} M0,${.5-o} L1,${.5-o} M0,${.5+o} L1,${.5+o}`},"╨":{1:(p,o)=>`M0,.5 L1,.5 M${.5-p},.5 L${.5-p},0 M${.5+p},.5 L${.5+p},0`},"╩":{1:(p,o)=>`M0,${.5+o} L1,${.5+o} M0,${.5-o} L${.5-p},${.5-o} L${.5-p},0 M1,${.5-o} L${.5+p},${.5-o} L${.5+p},0`},"╪":{1:(p,o)=>`M.5,0 L.5,1 M0,${.5-o} L1,${.5-o} M0,${.5+o} L1,${.5+o}`},"╫":{1:(p,o)=>`M0,.5 L1,.5 M${.5-p},0 L${.5-p},1 M${.5+p},0 L${.5+p},1`},"╬":{1:(p,o)=>`M0,${.5+o} L${.5-p},${.5+o} L${.5-p},1 M1,${.5+o} L${.5+p},${.5+o} L${.5+p},1 M0,${.5-o} L${.5-p},${.5-o} L${.5-p},0 M1,${.5-o} L${.5+p},${.5-o} L${.5+p},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(p,o)=>`M.5,1 L.5,${.5+o/.15*.5} C.5,${.5+o/.15*.5},.5,.5,1,.5`},"╮":{1:(p,o)=>`M.5,1 L.5,${.5+o/.15*.5} C.5,${.5+o/.15*.5},.5,.5,0,.5`},"╯":{1:(p,o)=>`M.5,0 L.5,${.5-o/.15*.5} C.5,${.5-o/.15*.5},.5,.5,0,.5`},"╰":{1:(p,o)=>`M.5,0 L.5,${.5-o/.15*.5} C.5,${.5-o/.15*.5},.5,.5,1,.5`}},r.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},r.powerlineDefinitions[""]=r.powerlineDefinitions[""],r.powerlineDefinitions[""]=r.powerlineDefinitions[""],r.tryDrawCustomChar=function(p,o,c,a,f,y,R,k){const D=r.blockElementDefinitions[o];if(D)return(function(H,P,I,K,X,Y){for(let $=0;$<P.length;$++){const U=P[$],T=X/8,F=Y/8;H.fillRect(I+U.x*T,K+U.y*F,U.w*T,U.h*F)}})(p,D,c,a,f,y),!0;const E=g[o];if(E)return(function(H,P,I,K,X,Y){let $=l.get(P);$||($=new Map,l.set(P,$));const U=H.fillStyle;if(typeof U!="string")throw new Error(`Unexpected fillStyle type "${U}"`);let T=$.get(U);if(!T){const F=P[0].length,B=P.length,W=H.canvas.ownerDocument.createElement("canvas");W.width=F,W.height=B;const Z=(0,d.throwIfFalsy)(W.getContext("2d")),ne=new ImageData(F,B);let ge,xe,J,G;if(U.startsWith("#"))ge=parseInt(U.slice(1,3),16),xe=parseInt(U.slice(3,5),16),J=parseInt(U.slice(5,7),16),G=U.length>7&&parseInt(U.slice(7,9),16)||1;else{if(!U.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${U}" when drawing pattern glyph`);[ge,xe,J,G]=U.substring(5,U.length-1).split(",").map((de=>parseFloat(de)))}for(let de=0;de<B;de++)for(let oe=0;oe<F;oe++)ne.data[4*(de*F+oe)]=ge,ne.data[4*(de*F+oe)+1]=xe,ne.data[4*(de*F+oe)+2]=J,ne.data[4*(de*F+oe)+3]=P[de][oe]*(255*G);Z.putImageData(ne,0,0),T=(0,d.throwIfFalsy)(H.createPattern(W,null)),$.set(U,T)}H.fillStyle=T,H.fillRect(I,K,X,Y)})(p,E,c,a,f,y),!0;const L=r.boxDrawingDefinitions[o];if(L)return(function(H,P,I,K,X,Y,$){H.strokeStyle=H.fillStyle;for(const[U,T]of Object.entries(P)){let F;H.beginPath(),H.lineWidth=$*Number.parseInt(U),F=typeof T=="function"?T(.15,.15/Y*X):T;for(const B of F.split(" ")){const W=B[0],Z=b[W];if(!Z){console.error(`Could not find drawing instructions for "${W}"`);continue}const ne=B.substring(1).split(",");ne[0]&&ne[1]&&Z(H,C(ne,X,Y,I,K,!0,$))}H.stroke(),H.closePath()}})(p,L,c,a,f,y,k),!0;const z=r.powerlineDefinitions[o];return!!z&&((function(H,P,I,K,X,Y,$,U){const T=new Path2D;T.rect(I,K,X,Y),H.clip(T),H.beginPath();const F=$/12;H.lineWidth=U*F;for(const B of P.d.split(" ")){const W=B[0],Z=b[W];if(!Z){console.error(`Could not find drawing instructions for "${W}"`);continue}const ne=B.substring(1).split(",");ne[0]&&ne[1]&&Z(H,C(ne,X,Y,I,K,!1,U,(P.leftPadding??0)*(F/2),(P.rightPadding??0)*(F/2)))}P.type===1?(H.strokeStyle=H.fillStyle,H.stroke()):H.fill(),H.closePath()})(p,z,c,a,f,y,R,k),!0)};const l=new Map;function m(p,o,c=0){return Math.max(Math.min(p,o),c)}const b={C:(p,o)=>p.bezierCurveTo(o[0],o[1],o[2],o[3],o[4],o[5]),L:(p,o)=>p.lineTo(o[0],o[1]),M:(p,o)=>p.moveTo(o[0],o[1])};function C(p,o,c,a,f,y,R,k=0,D=0){const E=p.map((L=>parseFloat(L)||parseInt(L)));if(E.length<2)throw new Error("Too few arguments for instruction");for(let L=0;L<E.length;L+=2)E[L]*=o-k*R-D*R,y&&E[L]!==0&&(E[L]=m(Math.round(E[L]+.5)-.5,o,0)),E[L]+=a+k*R;for(let L=1;L<E.length;L+=2)E[L]*=c,y&&E[L]!==0&&(E[L]=m(Math.round(E[L]+.5)-.5,c,0)),E[L]+=f;return E}},56:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.observeDevicePixelDimensions=void 0;const d=u(859);r.observeDevicePixelDimensions=function(g,l,m){let b=new l.ResizeObserver((C=>{const p=C.find((a=>a.target===g));if(!p)return;if(!("devicePixelContentBoxSize"in p))return b==null||b.disconnect(),void(b=void 0);const o=p.devicePixelContentBoxSize[0].inlineSize,c=p.devicePixelContentBoxSize[0].blockSize;o>0&&c>0&&m(o,c)}));try{b.observe(g,{box:["device-pixel-content-box"]})}catch{b.disconnect(),b=void 0}return(0,d.toDisposable)((()=>b==null?void 0:b.disconnect()))}},374:(A,r)=>{function u(g){return 57508<=g&&g<=57558}function d(g){return g>=128512&&g<=128591||g>=127744&&g<=128511||g>=128640&&g<=128767||g>=9728&&g<=9983||g>=9984&&g<=10175||g>=65024&&g<=65039||g>=129280&&g<=129535||g>=127462&&g<=127487}Object.defineProperty(r,"__esModule",{value:!0}),r.computeNextVariantOffset=r.createRenderDimensions=r.treatGlyphAsBackgroundColor=r.allowRescaling=r.isEmoji=r.isRestrictedPowerlineGlyph=r.isPowerlineGlyph=r.throwIfFalsy=void 0,r.throwIfFalsy=function(g){if(!g)throw new Error("value must not be falsy");return g},r.isPowerlineGlyph=u,r.isRestrictedPowerlineGlyph=function(g){return 57520<=g&&g<=57527},r.isEmoji=d,r.allowRescaling=function(g,l,m,b){return l===1&&m>Math.ceil(1.5*b)&&g!==void 0&&g>255&&!d(g)&&!u(g)&&!(function(C){return 57344<=C&&C<=63743})(g)},r.treatGlyphAsBackgroundColor=function(g){return u(g)||(function(l){return 9472<=l&&l<=9631})(g)},r.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},r.computeNextVariantOffset=function(g,l,m=0){return(g-(2*Math.round(l)-m))%(2*Math.round(l))}},296:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createSelectionRenderModel=void 0;class u{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(g,l,m,b=!1){if(this.selectionStart=l,this.selectionEnd=m,!l||!m||l[0]===m[0]&&l[1]===m[1])return void this.clear();const C=g.buffers.active.ydisp,p=l[1]-C,o=m[1]-C,c=Math.max(p,0),a=Math.min(o,g.rows-1);c>=g.rows||a<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=b,this.viewportStartRow=p,this.viewportEndRow=o,this.viewportCappedStartRow=c,this.viewportCappedEndRow=a,this.startCol=l[0],this.endCol=m[0])}isCellSelected(g,l,m){return!!this.hasSelection&&(m-=g.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?l>=this.startCol&&m>=this.viewportCappedStartRow&&l<this.endCol&&m<=this.viewportCappedEndRow:l<this.startCol&&m>=this.viewportCappedStartRow&&l>=this.endCol&&m<=this.viewportCappedEndRow:m>this.viewportStartRow&&m<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&m===this.viewportStartRow&&l>=this.startCol&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&m===this.viewportEndRow&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&m===this.viewportStartRow&&l>=this.startCol)}}r.createSelectionRenderModel=function(){return new u}},509:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TextureAtlas=void 0;const d=u(237),g=u(860),l=u(374),m=u(160),b=u(345),C=u(485),p=u(385),o=u(147),c=u(855),a={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let f;class y{get pages(){return this._pages}constructor(L,z,H){this._document=L,this._config=z,this._unicodeService=H,this._didWarmUp=!1,this._cacheMap=new C.FourKeyMap,this._cacheMapCombined=new C.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new o.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new b.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new b.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=D(L,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,l.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const L of this.pages)L.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const L=new p.IdleTaskQueue;for(let z=33;z<126;z++)L.enqueue((()=>{if(!this._cacheMap.get(z,c.DEFAULT_COLOR,c.DEFAULT_COLOR,c.DEFAULT_EXT)){const H=this._drawToCache(z,c.DEFAULT_COLOR,c.DEFAULT_COLOR,c.DEFAULT_EXT);this._cacheMap.set(z,c.DEFAULT_COLOR,c.DEFAULT_COLOR,c.DEFAULT_EXT,H)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const L of this._pages)L.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(y.maxAtlasPages&&this._pages.length>=Math.max(4,y.maxAtlasPages)){const z=this._pages.filter(($=>2*$.canvas.width<=(y.maxTextureSize||4096))).sort((($,U)=>U.canvas.width!==$.canvas.width?U.canvas.width-$.canvas.width:U.percentageUsed-$.percentageUsed));let H=-1,P=0;for(let $=0;$<z.length;$++)if(z[$].canvas.width!==P)H=$,P=z[$].canvas.width;else if($-H==3)break;const I=z.slice(H,H+4),K=I.map(($=>$.glyphs[0].texturePage)).sort((($,U)=>$>U?1:-1)),X=this.pages.length-I.length,Y=this._mergePages(I,X);Y.version++;for(let $=K.length-1;$>=0;$--)this._deletePage(K[$]);this.pages.push(Y),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(Y.canvas)}const L=new R(this._document,this._textureSize);return this._pages.push(L),this._activePages.push(L),this._onAddTextureAtlasCanvas.fire(L.canvas),L}_mergePages(L,z){const H=2*L[0].canvas.width,P=new R(this._document,H,L);for(const[I,K]of L.entries()){const X=I*K.canvas.width%H,Y=Math.floor(I/2)*K.canvas.height;P.ctx.drawImage(K.canvas,X,Y);for(const U of K.glyphs)U.texturePage=z,U.sizeClipSpace.x=U.size.x/H,U.sizeClipSpace.y=U.size.y/H,U.texturePosition.x+=X,U.texturePosition.y+=Y,U.texturePositionClipSpace.x=U.texturePosition.x/H,U.texturePositionClipSpace.y=U.texturePosition.y/H;this._onRemoveTextureAtlasCanvas.fire(K.canvas);const $=this._activePages.indexOf(K);$!==-1&&this._activePages.splice($,1)}return P}_deletePage(L){this._pages.splice(L,1);for(let z=L;z<this._pages.length;z++){const H=this._pages[z];for(const P of H.glyphs)P.texturePage--;H.version++}}getRasterizedGlyphCombinedChar(L,z,H,P,I){return this._getFromCacheMap(this._cacheMapCombined,L,z,H,P,I)}getRasterizedGlyph(L,z,H,P,I){return this._getFromCacheMap(this._cacheMap,L,z,H,P,I)}_getFromCacheMap(L,z,H,P,I,K=!1){return f=L.get(z,H,P,I),f||(f=this._drawToCache(z,H,P,I,K),L.set(z,H,P,I,f)),f}_getColorFromAnsiIndex(L){if(L>=this._config.colors.ansi.length)throw new Error("No color found for idx "+L);return this._config.colors.ansi[L]}_getBackgroundColor(L,z,H,P){if(this._config.allowTransparency)return m.NULL_COLOR;let I;switch(L){case 16777216:case 33554432:I=this._getColorFromAnsiIndex(z);break;case 50331648:const K=o.AttributeData.toColorRGB(z);I=m.channels.toColor(K[0],K[1],K[2]);break;default:I=H?m.color.opaque(this._config.colors.foreground):this._config.colors.background}return I}_getForegroundColor(L,z,H,P,I,K,X,Y,$,U){const T=this._getMinimumContrastColor(L,z,H,P,I,K,X,$,Y,U);if(T)return T;let F;switch(I){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&$&&K<8&&(K+=8),F=this._getColorFromAnsiIndex(K);break;case 50331648:const B=o.AttributeData.toColorRGB(K);F=m.channels.toColor(B[0],B[1],B[2]);break;default:F=X?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(F=m.color.opaque(F)),Y&&(F=m.color.multiplyOpacity(F,d.DIM_OPACITY)),F}_resolveBackgroundRgba(L,z,H){switch(L){case 16777216:case 33554432:return this._getColorFromAnsiIndex(z).rgba;case 50331648:return z<<8;default:return H?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(L,z,H,P){switch(L){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&P&&z<8&&(z+=8),this._getColorFromAnsiIndex(z).rgba;case 50331648:return z<<8;default:return H?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(L,z,H,P,I,K,X,Y,$,U){if(this._config.minimumContrastRatio===1||U)return;const T=this._getContrastCache($),F=T.getColor(L,P);if(F!==void 0)return F||void 0;const B=this._resolveBackgroundRgba(z,H,X),W=this._resolveForegroundRgba(I,K,X,Y),Z=m.rgba.ensureContrastRatio(B,W,this._config.minimumContrastRatio/($?2:1));if(!Z)return void T.setColor(L,P,null);const ne=m.channels.toColor(Z>>24&255,Z>>16&255,Z>>8&255);return T.setColor(L,P,ne),ne}_getContrastCache(L){return L?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(L,z,H,P,I=!1){const K=typeof L=="number"?String.fromCharCode(L):L,X=Math.min(this._config.deviceCellWidth*Math.max(K.length,2)+4,this._textureSize);this._tmpCanvas.width<X&&(this._tmpCanvas.width=X);const Y=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<Y&&(this._tmpCanvas.height=Y),this._tmpCtx.save(),this._workAttributeData.fg=H,this._workAttributeData.bg=z,this._workAttributeData.extended.ext=P,this._workAttributeData.isInvisible())return a;const $=!!this._workAttributeData.isBold(),U=!!this._workAttributeData.isInverse(),T=!!this._workAttributeData.isDim(),F=!!this._workAttributeData.isItalic(),B=!!this._workAttributeData.isUnderline(),W=!!this._workAttributeData.isStrikethrough(),Z=!!this._workAttributeData.isOverline();let ne=this._workAttributeData.getFgColor(),ge=this._workAttributeData.getFgColorMode(),xe=this._workAttributeData.getBgColor(),J=this._workAttributeData.getBgColorMode();if(U){const Be=ne;ne=xe,xe=Be;const $e=ge;ge=J,J=$e}const G=this._getBackgroundColor(J,xe,U,T);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=G.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const de=$?this._config.fontWeightBold:this._config.fontWeight,oe=F?"italic":"";this._tmpCtx.font=`${oe} ${de} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=d.TEXT_BASELINE;const Ae=K.length===1&&(0,l.isPowerlineGlyph)(K.charCodeAt(0)),Oe=K.length===1&&(0,l.isRestrictedPowerlineGlyph)(K.charCodeAt(0)),Xe=this._getForegroundColor(z,J,xe,H,ge,ne,U,T,$,(0,l.treatGlyphAsBackgroundColor)(K.charCodeAt(0)));this._tmpCtx.fillStyle=Xe.css;const We=Oe?0:4;let rt=!1;this._config.customGlyphs!==!1&&(rt=(0,g.tryDrawCustomChar)(this._tmpCtx,K,We,We,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let ye,Te=!Ae;if(ye=typeof L=="number"?this._unicodeService.wcwidth(L):this._unicodeService.getStringCellWidth(L),B){this._tmpCtx.save();const Be=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),$e=Be%2==1?.5:0;if(this._tmpCtx.lineWidth=Be,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())Te=!1,this._tmpCtx.strokeStyle=`rgb(${o.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{Te=!1;let le=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&le<8&&(le+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(le).css}this._tmpCtx.beginPath();const lt=We,st=Math.ceil(We+this._config.deviceCharHeight)-$e-(I?2*Be:0),St=st+Be,Se=st+2*Be;let Ie=this._workAttributeData.getUnderlineVariantOffset();for(let le=0;le<ye;le++){this._tmpCtx.save();const Ne=lt+le*this._config.deviceCellWidth,je=lt+(le+1)*this._config.deviceCellWidth,ue=Ne+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(Ne,st),this._tmpCtx.lineTo(je,st),this._tmpCtx.moveTo(Ne,Se),this._tmpCtx.lineTo(je,Se);break;case 3:const ee=Be<=1?Se:Math.ceil(We+this._config.deviceCharHeight-Be/2)-$e,be=Be<=1?st:Math.ceil(We+this._config.deviceCharHeight+Be/2)-$e,he=new Path2D;he.rect(Ne,st,this._config.deviceCellWidth,Se-st),this._tmpCtx.clip(he),this._tmpCtx.moveTo(Ne-this._config.deviceCellWidth/2,St),this._tmpCtx.bezierCurveTo(Ne-this._config.deviceCellWidth/2,be,Ne,be,Ne,St),this._tmpCtx.bezierCurveTo(Ne,ee,ue,ee,ue,St),this._tmpCtx.bezierCurveTo(ue,be,je,be,je,St),this._tmpCtx.bezierCurveTo(je,ee,je+this._config.deviceCellWidth/2,ee,je+this._config.deviceCellWidth/2,St);break;case 4:const He=Ie===0?0:Ie>=Be?2*Be-Ie:Be-Ie;Ie>=Be||He===0?(this._tmpCtx.setLineDash([Math.round(Be),Math.round(Be)]),this._tmpCtx.moveTo(Ne+He,st),this._tmpCtx.lineTo(je,st)):(this._tmpCtx.setLineDash([Math.round(Be),Math.round(Be)]),this._tmpCtx.moveTo(Ne,st),this._tmpCtx.lineTo(Ne+He,st),this._tmpCtx.moveTo(Ne+He+Be,st),this._tmpCtx.lineTo(je,st)),Ie=(0,l.computeNextVariantOffset)(je-Ne,Be,Ie);break;case 5:const Me=.6,Ge=.3,se=je-Ne,V=Math.floor(Me*se),ie=Math.floor(Ge*se),Q=se-V-ie;this._tmpCtx.setLineDash([V,ie,Q]),this._tmpCtx.moveTo(Ne,st),this._tmpCtx.lineTo(je,st);break;default:this._tmpCtx.moveTo(Ne,st),this._tmpCtx.lineTo(je,st)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!rt&&this._config.fontSize>=12&&!this._config.allowTransparency&&K!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const le=this._tmpCtx.measureText(K);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in le&&le.actualBoundingBoxDescent>0){this._tmpCtx.save();const Ne=new Path2D;Ne.rect(lt,st-Math.ceil(Be/2),this._config.deviceCellWidth*ye,Se-st+Math.ceil(Be/2)),this._tmpCtx.clip(Ne),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=G.css,this._tmpCtx.strokeText(K,We,We+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(Z){const Be=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),$e=Be%2==1?.5:0;this._tmpCtx.lineWidth=Be,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(We,We+$e),this._tmpCtx.lineTo(We+this._config.deviceCharWidth*ye,We+$e),this._tmpCtx.stroke()}if(rt||this._tmpCtx.fillText(K,We,We+this._config.deviceCharHeight),K==="_"&&!this._config.allowTransparency){let Be=k(this._tmpCtx.getImageData(We,We,this._config.deviceCellWidth,this._config.deviceCellHeight),G,Xe,Te);if(Be)for(let $e=1;$e<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=G.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(K,We,We+this._config.deviceCharHeight-$e),Be=k(this._tmpCtx.getImageData(We,We,this._config.deviceCellWidth,this._config.deviceCellHeight),G,Xe,Te),Be);$e++);}if(W){const Be=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),$e=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=Be,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(We,We+Math.floor(this._config.deviceCharHeight/2)-$e),this._tmpCtx.lineTo(We+this._config.deviceCharWidth*ye,We+Math.floor(this._config.deviceCharHeight/2)-$e),this._tmpCtx.stroke()}this._tmpCtx.restore();const ct=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let it;if(it=this._config.allowTransparency?(function(Be){for(let $e=0;$e<Be.data.length;$e+=4)if(Be.data[$e+3]>0)return!1;return!0})(ct):k(ct,G,Xe,Te),it)return a;const ze=this._findGlyphBoundingBox(ct,this._workBoundingBox,X,Oe,rt,We);let qe,Fe;for(;;){if(this._activePages.length===0){const Be=this._createNewPage();qe=Be,Fe=Be.currentRow,Fe.height=ze.size.y;break}qe=this._activePages[this._activePages.length-1],Fe=qe.currentRow;for(const Be of this._activePages)ze.size.y<=Be.currentRow.height&&(qe=Be,Fe=Be.currentRow);for(let Be=this._activePages.length-1;Be>=0;Be--)for(const $e of this._activePages[Be].fixedRows)$e.height<=Fe.height&&ze.size.y<=$e.height&&(qe=this._activePages[Be],Fe=$e);if(Fe.y+ze.size.y>=qe.canvas.height||Fe.height>ze.size.y+2){let Be=!1;if(qe.currentRow.y+qe.currentRow.height+ze.size.y>=qe.canvas.height){let $e;for(const lt of this._activePages)if(lt.currentRow.y+lt.currentRow.height+ze.size.y<lt.canvas.height){$e=lt;break}if($e)qe=$e;else if(y.maxAtlasPages&&this._pages.length>=y.maxAtlasPages&&Fe.y+ze.size.y<=qe.canvas.height&&Fe.height>=ze.size.y&&Fe.x+ze.size.x<=qe.canvas.width)Be=!0;else{const lt=this._createNewPage();qe=lt,Fe=lt.currentRow,Fe.height=ze.size.y,Be=!0}}Be||(qe.currentRow.height>0&&qe.fixedRows.push(qe.currentRow),Fe={x:0,y:qe.currentRow.y+qe.currentRow.height,height:ze.size.y},qe.fixedRows.push(Fe),qe.currentRow={x:0,y:Fe.y+Fe.height,height:0})}if(Fe.x+ze.size.x<=qe.canvas.width)break;Fe===qe.currentRow?(Fe.x=0,Fe.y+=Fe.height,Fe.height=0):qe.fixedRows.splice(qe.fixedRows.indexOf(Fe),1)}return ze.texturePage=this._pages.indexOf(qe),ze.texturePosition.x=Fe.x,ze.texturePosition.y=Fe.y,ze.texturePositionClipSpace.x=Fe.x/qe.canvas.width,ze.texturePositionClipSpace.y=Fe.y/qe.canvas.height,ze.sizeClipSpace.x/=qe.canvas.width,ze.sizeClipSpace.y/=qe.canvas.height,Fe.height=Math.max(Fe.height,ze.size.y),Fe.x+=ze.size.x,qe.ctx.putImageData(ct,ze.texturePosition.x-this._workBoundingBox.left,ze.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,ze.size.x,ze.size.y),qe.addGlyph(ze),qe.version++,ze}_findGlyphBoundingBox(L,z,H,P,I,K){z.top=0;const X=P?this._config.deviceCellHeight:this._tmpCanvas.height,Y=P?this._config.deviceCellWidth:H;let $=!1;for(let U=0;U<X;U++){for(let T=0;T<Y;T++){const F=U*this._tmpCanvas.width*4+4*T+3;if(L.data[F]!==0){z.top=U,$=!0;break}}if($)break}z.left=0,$=!1;for(let U=0;U<K+Y;U++){for(let T=0;T<X;T++){const F=T*this._tmpCanvas.width*4+4*U+3;if(L.data[F]!==0){z.left=U,$=!0;break}}if($)break}z.right=Y,$=!1;for(let U=K+Y-1;U>=K;U--){for(let T=0;T<X;T++){const F=T*this._tmpCanvas.width*4+4*U+3;if(L.data[F]!==0){z.right=U,$=!0;break}}if($)break}z.bottom=X,$=!1;for(let U=X-1;U>=0;U--){for(let T=0;T<Y;T++){const F=U*this._tmpCanvas.width*4+4*T+3;if(L.data[F]!==0){z.bottom=U,$=!0;break}}if($)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:z.right-z.left+1,y:z.bottom-z.top+1},sizeClipSpace:{x:z.right-z.left+1,y:z.bottom-z.top+1},offset:{x:-z.left+K+(P||I?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-z.top+K+(P||I?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}r.TextureAtlas=y;class R{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(L){this._glyphs.push(L),this._usedPixels+=L.size.x*L.size.y}constructor(L,z,H){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],H)for(const P of H)this._glyphs.push(...P.glyphs),this._usedPixels+=P._usedPixels;this.canvas=D(L,z,z),this.ctx=(0,l.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function k(E,L,z,H){const P=L.rgba>>>24,I=L.rgba>>>16&255,K=L.rgba>>>8&255,X=z.rgba>>>24,Y=z.rgba>>>16&255,$=z.rgba>>>8&255,U=Math.floor((Math.abs(P-X)+Math.abs(I-Y)+Math.abs(K-$))/12);let T=!0;for(let F=0;F<E.data.length;F+=4)E.data[F]===P&&E.data[F+1]===I&&E.data[F+2]===K||H&&Math.abs(E.data[F]-P)+Math.abs(E.data[F+1]-I)+Math.abs(E.data[F+2]-K)<U?E.data[F+3]=0:T=!1;return T}function D(E,L,z){const H=E.createElement("canvas");return H.width=L,H.height=z,H}},577:function(A,r,u){var d=this&&this.__decorate||function(c,a,f,y){var R,k=arguments.length,D=k<3?a:y===null?y=Object.getOwnPropertyDescriptor(a,f):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(c,a,f,y);else for(var E=c.length-1;E>=0;E--)(R=c[E])&&(D=(k<3?R(D):k>3?R(a,f,D):R(a,f))||D);return k>3&&D&&Object.defineProperty(a,f,D),D},g=this&&this.__param||function(c,a){return function(f,y){a(f,y,c)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharacterJoinerService=r.JoinedCellData=void 0;const l=u(147),m=u(855),b=u(782),C=u(97);class p extends l.AttributeData{constructor(a,f,y){super(),this.content=0,this.combinedData="",this.fg=a.fg,this.bg=a.bg,this.combinedData=f,this._width=y}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(a){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.JoinedCellData=p;let o=r.CharacterJoinerService=class a_{constructor(a){this._bufferService=a,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new b.CellData}register(a){const f={id:this._nextCharacterJoinerId++,handler:a};return this._characterJoiners.push(f),f.id}deregister(a){for(let f=0;f<this._characterJoiners.length;f++)if(this._characterJoiners[f].id===a)return this._characterJoiners.splice(f,1),!0;return!1}getJoinedCharacters(a){if(this._characterJoiners.length===0)return[];const f=this._bufferService.buffer.lines.get(a);if(!f||f.length===0)return[];const y=[],R=f.translateToString(!0);let k=0,D=0,E=0,L=f.getFg(0),z=f.getBg(0);for(let H=0;H<f.getTrimmedLength();H++)if(f.loadCell(H,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==L||this._workCell.bg!==z){if(H-k>1){const P=this._getJoinedRanges(R,E,D,f,k);for(let I=0;I<P.length;I++)y.push(P[I])}k=H,E=D,L=this._workCell.fg,z=this._workCell.bg}D+=this._workCell.getChars().length||m.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-k>1){const H=this._getJoinedRanges(R,E,D,f,k);for(let P=0;P<H.length;P++)y.push(H[P])}return y}_getJoinedRanges(a,f,y,R,k){const D=a.substring(f,y);let E=[];try{E=this._characterJoiners[0].handler(D)}catch(L){console.error(L)}for(let L=1;L<this._characterJoiners.length;L++)try{const z=this._characterJoiners[L].handler(D);for(let H=0;H<z.length;H++)a_._mergeRanges(E,z[H])}catch(z){console.error(z)}return this._stringRangesToCellRanges(E,R,k),E}_stringRangesToCellRanges(a,f,y){let R=0,k=!1,D=0,E=a[R];if(E){for(let L=y;L<this._bufferService.cols;L++){const z=f.getWidth(L),H=f.getString(L).length||m.WHITESPACE_CELL_CHAR.length;if(z!==0){if(!k&&E[0]<=D&&(E[0]=L,k=!0),E[1]<=D){if(E[1]=L,E=a[++R],!E)break;E[0]<=D?(E[0]=L,k=!0):k=!1}D+=H}}E&&(E[1]=this._bufferService.cols)}}static _mergeRanges(a,f){let y=!1;for(let R=0;R<a.length;R++){const k=a[R];if(y){if(f[1]<=k[0])return a[R-1][1]=f[1],a;if(f[1]<=k[1])return a[R-1][1]=Math.max(f[1],k[1]),a.splice(R,1),a;a.splice(R,1),R--}else{if(f[1]<=k[0])return a.splice(R,0,f),a;if(f[1]<=k[1])return k[0]=Math.min(f[0],k[0]),a;f[0]<k[1]&&(k[0]=Math.min(f[0],k[0]),y=!0)}}return y?a[a.length-1][1]=f[1]:a.push(f),a}};r.CharacterJoinerService=o=d([g(0,C.IBufferService)],o)},160:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.contrastRatio=r.toPaddedHex=r.rgba=r.rgb=r.css=r.color=r.channels=r.NULL_COLOR=void 0;let u=0,d=0,g=0,l=0;var m,b,C,p,o;function c(f){const y=f.toString(16);return y.length<2?"0"+y:y}function a(f,y){return f<y?(y+.05)/(f+.05):(f+.05)/(y+.05)}r.NULL_COLOR={css:"#00000000",rgba:0},(function(f){f.toCss=function(y,R,k,D){return D!==void 0?`#${c(y)}${c(R)}${c(k)}${c(D)}`:`#${c(y)}${c(R)}${c(k)}`},f.toRgba=function(y,R,k,D=255){return(y<<24|R<<16|k<<8|D)>>>0},f.toColor=function(y,R,k,D){return{css:f.toCss(y,R,k,D),rgba:f.toRgba(y,R,k,D)}}})(m||(r.channels=m={})),(function(f){function y(R,k){return l=Math.round(255*k),[u,d,g]=o.toChannels(R.rgba),{css:m.toCss(u,d,g,l),rgba:m.toRgba(u,d,g,l)}}f.blend=function(R,k){if(l=(255&k.rgba)/255,l===1)return{css:k.css,rgba:k.rgba};const D=k.rgba>>24&255,E=k.rgba>>16&255,L=k.rgba>>8&255,z=R.rgba>>24&255,H=R.rgba>>16&255,P=R.rgba>>8&255;return u=z+Math.round((D-z)*l),d=H+Math.round((E-H)*l),g=P+Math.round((L-P)*l),{css:m.toCss(u,d,g),rgba:m.toRgba(u,d,g)}},f.isOpaque=function(R){return(255&R.rgba)==255},f.ensureContrastRatio=function(R,k,D){const E=o.ensureContrastRatio(R.rgba,k.rgba,D);if(E)return m.toColor(E>>24&255,E>>16&255,E>>8&255)},f.opaque=function(R){const k=(255|R.rgba)>>>0;return[u,d,g]=o.toChannels(k),{css:m.toCss(u,d,g),rgba:k}},f.opacity=y,f.multiplyOpacity=function(R,k){return l=255&R.rgba,y(R,l*k/255)},f.toColorRGB=function(R){return[R.rgba>>24&255,R.rgba>>16&255,R.rgba>>8&255]}})(b||(r.color=b={})),(function(f){let y,R;try{const k=document.createElement("canvas");k.width=1,k.height=1;const D=k.getContext("2d",{willReadFrequently:!0});D&&(y=D,y.globalCompositeOperation="copy",R=y.createLinearGradient(0,0,1,1))}catch{}f.toColor=function(k){if(k.match(/#[\da-f]{3,8}/i))switch(k.length){case 4:return u=parseInt(k.slice(1,2).repeat(2),16),d=parseInt(k.slice(2,3).repeat(2),16),g=parseInt(k.slice(3,4).repeat(2),16),m.toColor(u,d,g);case 5:return u=parseInt(k.slice(1,2).repeat(2),16),d=parseInt(k.slice(2,3).repeat(2),16),g=parseInt(k.slice(3,4).repeat(2),16),l=parseInt(k.slice(4,5).repeat(2),16),m.toColor(u,d,g,l);case 7:return{css:k,rgba:(parseInt(k.slice(1),16)<<8|255)>>>0};case 9:return{css:k,rgba:parseInt(k.slice(1),16)>>>0}}const D=k.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(D)return u=parseInt(D[1]),d=parseInt(D[2]),g=parseInt(D[3]),l=Math.round(255*(D[5]===void 0?1:parseFloat(D[5]))),m.toColor(u,d,g,l);if(!y||!R)throw new Error("css.toColor: Unsupported css format");if(y.fillStyle=R,y.fillStyle=k,typeof y.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(y.fillRect(0,0,1,1),[u,d,g,l]=y.getImageData(0,0,1,1).data,l!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:m.toRgba(u,d,g,l),css:k}}})(C||(r.css=C={})),(function(f){function y(R,k,D){const E=R/255,L=k/255,z=D/255;return .2126*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))+.7152*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))+.0722*(z<=.03928?z/12.92:Math.pow((z+.055)/1.055,2.4))}f.relativeLuminance=function(R){return y(R>>16&255,R>>8&255,255&R)},f.relativeLuminance2=y})(p||(r.rgb=p={})),(function(f){function y(k,D,E){const L=k>>24&255,z=k>>16&255,H=k>>8&255;let P=D>>24&255,I=D>>16&255,K=D>>8&255,X=a(p.relativeLuminance2(P,I,K),p.relativeLuminance2(L,z,H));for(;X<E&&(P>0||I>0||K>0);)P-=Math.max(0,Math.ceil(.1*P)),I-=Math.max(0,Math.ceil(.1*I)),K-=Math.max(0,Math.ceil(.1*K)),X=a(p.relativeLuminance2(P,I,K),p.relativeLuminance2(L,z,H));return(P<<24|I<<16|K<<8|255)>>>0}function R(k,D,E){const L=k>>24&255,z=k>>16&255,H=k>>8&255;let P=D>>24&255,I=D>>16&255,K=D>>8&255,X=a(p.relativeLuminance2(P,I,K),p.relativeLuminance2(L,z,H));for(;X<E&&(P<255||I<255||K<255);)P=Math.min(255,P+Math.ceil(.1*(255-P))),I=Math.min(255,I+Math.ceil(.1*(255-I))),K=Math.min(255,K+Math.ceil(.1*(255-K))),X=a(p.relativeLuminance2(P,I,K),p.relativeLuminance2(L,z,H));return(P<<24|I<<16|K<<8|255)>>>0}f.blend=function(k,D){if(l=(255&D)/255,l===1)return D;const E=D>>24&255,L=D>>16&255,z=D>>8&255,H=k>>24&255,P=k>>16&255,I=k>>8&255;return u=H+Math.round((E-H)*l),d=P+Math.round((L-P)*l),g=I+Math.round((z-I)*l),m.toRgba(u,d,g)},f.ensureContrastRatio=function(k,D,E){const L=p.relativeLuminance(k>>8),z=p.relativeLuminance(D>>8);if(a(L,z)<E){if(z<L){const I=y(k,D,E),K=a(L,p.relativeLuminance(I>>8));if(K<E){const X=R(k,D,E);return K>a(L,p.relativeLuminance(X>>8))?I:X}return I}const H=R(k,D,E),P=a(L,p.relativeLuminance(H>>8));if(P<E){const I=y(k,D,E);return P>a(L,p.relativeLuminance(I>>8))?H:I}return H}},f.reduceLuminance=y,f.increaseLuminance=R,f.toChannels=function(k){return[k>>24&255,k>>16&255,k>>8&255,255&k]}})(o||(r.rgba=o={})),r.toPaddedHex=c,r.contrastRatio=a},345:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.runAndSubscribe=r.forwardEvent=r.EventEmitter=void 0,r.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===u)return void this._listeners.splice(d,1)}}})),this._event}fire(u,d){const g=[];for(let l=0;l<this._listeners.length;l++)g.push(this._listeners[l]);for(let l=0;l<g.length;l++)g[l].call(void 0,u,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},r.forwardEvent=function(u,d){return u((g=>d.fire(g)))},r.runAndSubscribe=function(u,d){return d(void 0),u((g=>d(g)))}},859:(A,r)=>{function u(d){for(const g of d)g.dispose();d.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.MutableDisposable=r.Disposable=void 0,r.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const g=this._disposables.indexOf(d);g!==-1&&this._disposables.splice(g,1)}},r.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var g;this._isDisposed||d===this._value||((g=this._value)==null||g.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)==null||d.dispose(),this._value=void 0}},r.toDisposable=function(d){return{dispose:d}},r.disposeArray=u,r.getDisposeArrayDisposable=function(d){return{dispose:()=>u(d)}}},485:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FourKeyMap=r.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(g,l,m){this._data[g]||(this._data[g]={}),this._data[g][l]=m}get(g,l){return this._data[g]?this._data[g][l]:void 0}clear(){this._data={}}}r.TwoKeyMap=u,r.FourKeyMap=class{constructor(){this._data=new u}set(d,g,l,m,b){this._data.get(d,g)||this._data.set(d,g,new u),this._data.get(d,g).set(l,m,b)}get(d,g,l,m){var b;return(b=this._data.get(d,g))==null?void 0:b.get(l,m)}clear(){this._data.clear()}}},399:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isChromeOS=r.isLinux=r.isWindows=r.isIphone=r.isIpad=r.isMac=r.getSafariVersion=r.isSafari=r.isLegacyEdge=r.isFirefox=r.isNode=void 0,r.isNode=typeof process<"u"&&"title"in process;const u=r.isNode?"node":navigator.userAgent,d=r.isNode?"node":navigator.platform;r.isFirefox=u.includes("Firefox"),r.isLegacyEdge=u.includes("Edge"),r.isSafari=/^((?!chrome|android).)*safari/i.test(u),r.getSafariVersion=function(){if(!r.isSafari)return 0;const g=u.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},r.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),r.isIpad=d==="iPad",r.isIphone=d==="iPhone",r.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),r.isLinux=d.indexOf("Linux")>=0,r.isChromeOS=/\bCrOS\b/.test(u)},385:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DebouncedIdleTask=r.IdleTaskQueue=r.PriorityTaskQueue=void 0;const d=u(399);class g{constructor(){this._tasks=[],this._i=0}enqueue(b){this._tasks.push(b),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(b){this._idleCallback=void 0;let C=0,p=0,o=b.timeRemaining(),c=0;for(;this._i<this._tasks.length;){if(C=Date.now(),this._tasks[this._i]()||this._i++,C=Math.max(1,Date.now()-C),p=Math.max(C,p),c=b.timeRemaining(),1.5*p>c)return o-C<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(o-C))}ms`),void this._start();o=c}this.clear()}}class l extends g{_requestCallback(b){return setTimeout((()=>b(this._createDeadline(16))))}_cancelCallback(b){clearTimeout(b)}_createDeadline(b){const C=Date.now()+b;return{timeRemaining:()=>Math.max(0,C-Date.now())}}}r.PriorityTaskQueue=l,r.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(m){return requestIdleCallback(m)}_cancelCallback(m){cancelIdleCallback(m)}}:l,r.DebouncedIdleTask=class{constructor(){this._queue=new r.IdleTaskQueue}set(m){this._queue.clear(),this._queue.enqueue(m)}flush(){this._queue.flush()}}},147:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ExtendedAttrs=r.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(l){return[l>>>16&255,l>>>8&255,255&l]}static fromColorRGB(l){return(255&l[0])<<16|(255&l[1])<<8|255&l[2]}clone(){const l=new u;return l.fg=this.fg,l.bg=this.bg,l.extended=this.extended.clone(),l}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}r.AttributeData=u;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(l){this._ext=l}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(l){this._ext&=-469762049,this._ext|=l<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(l){this._ext&=-67108864,this._ext|=67108863&l}get urlId(){return this._urlId}set urlId(l){this._urlId=l}get underlineVariantOffset(){const l=(3758096384&this._ext)>>29;return l<0?4294967288^l:l}set underlineVariantOffset(l){this._ext&=536870911,this._ext|=l<<29&3758096384}constructor(l=0,m=0){this._ext=0,this._urlId=0,this._ext=l,this._urlId=m}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}r.ExtendedAttrs=d},782:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellData=void 0;const d=u(133),g=u(855),l=u(147);class m extends l.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new l.ExtendedAttrs,this.combinedData=""}static fromCharData(C){const p=new m;return p.setFromCharData(C),p}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(C){this.fg=C[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let p=!1;if(C[g.CHAR_DATA_CHAR_INDEX].length>2)p=!0;else if(C[g.CHAR_DATA_CHAR_INDEX].length===2){const o=C[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=o&&o<=56319){const c=C[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=c&&c<=57343?this.content=1024*(o-55296)+c-56320+65536|C[g.CHAR_DATA_WIDTH_INDEX]<<22:p=!0}else p=!0}else this.content=C[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|C[g.CHAR_DATA_WIDTH_INDEX]<<22;p&&(this.combinedData=C[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|C[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.CellData=m},855:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WHITESPACE_CELL_CODE=r.WHITESPACE_CELL_WIDTH=r.WHITESPACE_CELL_CHAR=r.NULL_CELL_CODE=r.NULL_CELL_WIDTH=r.NULL_CELL_CHAR=r.CHAR_DATA_CODE_INDEX=r.CHAR_DATA_WIDTH_INDEX=r.CHAR_DATA_CHAR_INDEX=r.CHAR_DATA_ATTR_INDEX=r.DEFAULT_EXT=r.DEFAULT_ATTR=r.DEFAULT_COLOR=void 0,r.DEFAULT_COLOR=0,r.DEFAULT_ATTR=256|r.DEFAULT_COLOR<<9,r.DEFAULT_EXT=0,r.CHAR_DATA_ATTR_INDEX=0,r.CHAR_DATA_CHAR_INDEX=1,r.CHAR_DATA_WIDTH_INDEX=2,r.CHAR_DATA_CODE_INDEX=3,r.NULL_CELL_CHAR="",r.NULL_CELL_WIDTH=1,r.NULL_CELL_CODE=0,r.WHITESPACE_CELL_CHAR=" ",r.WHITESPACE_CELL_WIDTH=1,r.WHITESPACE_CELL_CODE=32},133:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Utf8ToUtf32=r.StringToUtf32=r.utf32ToString=r.stringFromCodePoint=void 0,r.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},r.utf32ToString=function(u,d=0,g=u.length){let l="";for(let m=d;m<g;++m){let b=u[m];b>65535?(b-=65536,l+=String.fromCharCode(55296+(b>>10))+String.fromCharCode(b%1024+56320)):l+=String.fromCharCode(b)}return l},r.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,d){const g=u.length;if(!g)return 0;let l=0,m=0;if(this._interim){const b=u.charCodeAt(m++);56320<=b&&b<=57343?d[l++]=1024*(this._interim-55296)+b-56320+65536:(d[l++]=this._interim,d[l++]=b),this._interim=0}for(let b=m;b<g;++b){const C=u.charCodeAt(b);if(55296<=C&&C<=56319){if(++b>=g)return this._interim=C,l;const p=u.charCodeAt(b);56320<=p&&p<=57343?d[l++]=1024*(C-55296)+p-56320+65536:(d[l++]=C,d[l++]=p)}else C!==65279&&(d[l++]=C)}return l}},r.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,d){const g=u.length;if(!g)return 0;let l,m,b,C,p=0,o=0,c=0;if(this.interim[0]){let y=!1,R=this.interim[0];R&=(224&R)==192?31:(240&R)==224?15:7;let k,D=0;for(;(k=63&this.interim[++D])&&D<4;)R<<=6,R|=k;const E=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,L=E-D;for(;c<L;){if(c>=g)return 0;if(k=u[c++],(192&k)!=128){c--,y=!0;break}this.interim[D++]=k,R<<=6,R|=63&k}y||(E===2?R<128?c--:d[p++]=R:E===3?R<2048||R>=55296&&R<=57343||R===65279||(d[p++]=R):R<65536||R>1114111||(d[p++]=R)),this.interim.fill(0)}const a=g-4;let f=c;for(;f<g;){for(;!(!(f<a)||128&(l=u[f])||128&(m=u[f+1])||128&(b=u[f+2])||128&(C=u[f+3]));)d[p++]=l,d[p++]=m,d[p++]=b,d[p++]=C,f+=4;if(l=u[f++],l<128)d[p++]=l;else if((224&l)==192){if(f>=g)return this.interim[0]=l,p;if(m=u[f++],(192&m)!=128){f--;continue}if(o=(31&l)<<6|63&m,o<128){f--;continue}d[p++]=o}else if((240&l)==224){if(f>=g)return this.interim[0]=l,p;if(m=u[f++],(192&m)!=128){f--;continue}if(f>=g)return this.interim[0]=l,this.interim[1]=m,p;if(b=u[f++],(192&b)!=128){f--;continue}if(o=(15&l)<<12|(63&m)<<6|63&b,o<2048||o>=55296&&o<=57343||o===65279)continue;d[p++]=o}else if((248&l)==240){if(f>=g)return this.interim[0]=l,p;if(m=u[f++],(192&m)!=128){f--;continue}if(f>=g)return this.interim[0]=l,this.interim[1]=m,p;if(b=u[f++],(192&b)!=128){f--;continue}if(f>=g)return this.interim[0]=l,this.interim[1]=m,this.interim[2]=b,p;if(C=u[f++],(192&C)!=128){f--;continue}if(o=(7&l)<<18|(63&m)<<12|(63&b)<<6|63&C,o<65536||o>1114111)continue;d[p++]=o}}return p}}},776:function(A,r,u){var d=this&&this.__decorate||function(o,c,a,f){var y,R=arguments.length,k=R<3?c:f===null?f=Object.getOwnPropertyDescriptor(c,a):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(o,c,a,f);else for(var D=o.length-1;D>=0;D--)(y=o[D])&&(k=(R<3?y(k):R>3?y(c,a,k):y(c,a))||k);return R>3&&k&&Object.defineProperty(c,a,k),k},g=this&&this.__param||function(o,c){return function(a,f){c(a,f,o)}};Object.defineProperty(r,"__esModule",{value:!0}),r.traceCall=r.setTraceLogger=r.LogService=void 0;const l=u(859),m=u(97),b={trace:m.LogLevelEnum.TRACE,debug:m.LogLevelEnum.DEBUG,info:m.LogLevelEnum.INFO,warn:m.LogLevelEnum.WARN,error:m.LogLevelEnum.ERROR,off:m.LogLevelEnum.OFF};let C,p=r.LogService=class extends l.Disposable{get logLevel(){return this._logLevel}constructor(o){super(),this._optionsService=o,this._logLevel=m.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),C=this}_updateLogLevel(){this._logLevel=b[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(o){for(let c=0;c<o.length;c++)typeof o[c]=="function"&&(o[c]=o[c]())}_log(o,c,a){this._evalLazyOptionalParams(a),o.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+c,...a)}trace(o,...c){var a;this._logLevel<=m.LogLevelEnum.TRACE&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.trace.bind(this._optionsService.options.logger))??console.log,o,c)}debug(o,...c){var a;this._logLevel<=m.LogLevelEnum.DEBUG&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.debug.bind(this._optionsService.options.logger))??console.log,o,c)}info(o,...c){var a;this._logLevel<=m.LogLevelEnum.INFO&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.info.bind(this._optionsService.options.logger))??console.info,o,c)}warn(o,...c){var a;this._logLevel<=m.LogLevelEnum.WARN&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.warn.bind(this._optionsService.options.logger))??console.warn,o,c)}error(o,...c){var a;this._logLevel<=m.LogLevelEnum.ERROR&&this._log(((a=this._optionsService.options.logger)==null?void 0:a.error.bind(this._optionsService.options.logger))??console.error,o,c)}};r.LogService=p=d([g(0,m.IOptionsService)],p),r.setTraceLogger=function(o){C=o},r.traceCall=function(o,c,a){if(typeof a.value!="function")throw new Error("not supported");const f=a.value;a.value=function(...y){if(C.logLevel!==m.LogLevelEnum.TRACE)return f.apply(this,y);C.trace(`GlyphRenderer#${f.name}(${y.map((k=>JSON.stringify(k))).join(", ")})`);const R=f.apply(this,y);return C.trace(`GlyphRenderer#${f.name} return`,R),R}}},726:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createDecorator=r.getServiceDependencies=r.serviceRegistry=void 0;const u="di$target",d="di$dependencies";r.serviceRegistry=new Map,r.getServiceDependencies=function(g){return g[d]||[]},r.createDecorator=function(g){if(r.serviceRegistry.has(g))return r.serviceRegistry.get(g);const l=function(m,b,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(p,o,c){o[u]===o?o[d].push({id:p,index:c}):(o[d]=[{id:p,index:c}],o[u]=o)})(l,m,C)};return l.toString=()=>g,r.serviceRegistry.set(g,l),l}},97:(A,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IDecorationService=r.IUnicodeService=r.IOscLinkService=r.IOptionsService=r.ILogService=r.LogLevelEnum=r.IInstantiationService=r.ICharsetService=r.ICoreService=r.ICoreMouseService=r.IBufferService=void 0;const d=u(726);var g;r.IBufferService=(0,d.createDecorator)("BufferService"),r.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),r.ICoreService=(0,d.createDecorator)("CoreService"),r.ICharsetService=(0,d.createDecorator)("CharsetService"),r.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(l){l[l.TRACE=0]="TRACE",l[l.DEBUG=1]="DEBUG",l[l.INFO=2]="INFO",l[l.WARN=3]="WARN",l[l.ERROR=4]="ERROR",l[l.OFF=5]="OFF"})(g||(r.LogLevelEnum=g={})),r.ILogService=(0,d.createDecorator)("LogService"),r.IOptionsService=(0,d.createDecorator)("OptionsService"),r.IOscLinkService=(0,d.createDecorator)("OscLinkService"),r.IUnicodeService=(0,d.createDecorator)("UnicodeService"),r.IDecorationService=(0,d.createDecorator)("DecorationService")}},S={};function M(A){var r=S[A];if(r!==void 0)return r.exports;var u=S[A]={exports:{}};return w[A].call(u.exports,u,u.exports,M),u.exports}var O={};return(()=>{var A=O;Object.defineProperty(A,"__esModule",{value:!0}),A.CanvasAddon=void 0;const r=M(345),u=M(859),d=M(776),g=M(949);class l extends u.Disposable{constructor(){super(...arguments),this._onChangeTextureAtlas=this.register(new r.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new r.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event}get textureAtlas(){var b;return(b=this._renderer)==null?void 0:b.textureAtlas}activate(b){const C=b._core;if(!b.element)return void this.register(C.onWillOpen((()=>this.activate(b))));this._terminal=b;const p=C.coreService,o=C.optionsService,c=C.screenElement,a=C.linkifier,f=C,y=f._bufferService,R=f._renderService,k=f._characterJoinerService,D=f._charSizeService,E=f._coreBrowserService,L=f._decorationService,z=f._logService,H=f._themeService;(0,d.setTraceLogger)(z),this._renderer=new g.CanvasRenderer(b,c,a,y,D,o,k,p,E,L,H),this.register((0,r.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,r.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),R.setRenderer(this._renderer),R.handleResize(y.cols,y.rows),this.register((0,u.toDisposable)((()=>{var P;R.setRenderer(this._terminal._core._createRenderer()),R.handleResize(b.cols,b.rows),(P=this._renderer)==null||P.dispose(),this._renderer=void 0})))}clearTextureAtlas(){var b;(b=this._renderer)==null||b.clearTextureAtlas()}}A.CanvasAddon=l})(),O})()))})(Vu)),Vu.exports}var Cg=Qx(),Ju={exports:{}},kg;function Zx(){return kg||(kg=1,(function(s,h){(function(w,S){s.exports=S()})(self,(()=>(()=>{var w={345:(A,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.runAndSubscribe=r.forwardEvent=r.EventEmitter=void 0,r.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===u)return void this._listeners.splice(d,1)}}})),this._event}fire(u,d){const g=[];for(let l=0;l<this._listeners.length;l++)g.push(this._listeners[l]);for(let l=0;l<g.length;l++)g[l].call(void 0,u,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},r.forwardEvent=function(u,d){return u((g=>d.fire(g)))},r.runAndSubscribe=function(u,d){return d(void 0),u((g=>d(g)))}},859:(A,r)=>{function u(d){for(const g of d)g.dispose();d.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.MutableDisposable=r.Disposable=void 0,r.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const g=this._disposables.indexOf(d);g!==-1&&this._disposables.splice(g,1)}},r.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var g;this._isDisposed||d===this._value||((g=this._value)==null||g.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)==null||d.dispose(),this._value=void 0}},r.toDisposable=function(d){return{dispose:d}},r.disposeArray=u,r.getDisposeArrayDisposable=function(d){return{dispose:()=>u(d)}}}},S={};function M(A){var r=S[A];if(r!==void 0)return r.exports;var u=S[A]={exports:{}};return w[A](u,u.exports,M),u.exports}var O={};return(()=>{var A=O;Object.defineProperty(A,"__esModule",{value:!0}),A.SearchAddon=void 0;const r=M(345),u=M(859),d=" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?";class g extends u.Disposable{constructor(m){super(),this._highlightedLines=new Set,this._highlightDecorations=[],this._selectedDecoration=this.register(new u.MutableDisposable),this._linesCacheTimeoutId=0,this._linesCacheDisposables=new u.MutableDisposable,this._onDidChangeResults=this.register(new r.EventEmitter),this.onDidChangeResults=this._onDidChangeResults.event,this._highlightLimit=(m==null?void 0:m.highlightLimit)??1e3}activate(m){this._terminal=m,this.register(this._terminal.onWriteParsed((()=>this._updateMatches()))),this.register(this._terminal.onResize((()=>this._updateMatches()))),this.register((0,u.toDisposable)((()=>this.clearDecorations())))}_updateMatches(){var m;this._highlightTimeout&&window.clearTimeout(this._highlightTimeout),this._cachedSearchTerm&&((m=this._lastSearchOptions)!=null&&m.decorations)&&(this._highlightTimeout=setTimeout((()=>{const b=this._cachedSearchTerm;this._cachedSearchTerm=void 0,this.findPrevious(b,{...this._lastSearchOptions,incremental:!0,noScroll:!0})}),200))}clearDecorations(m){this._selectedDecoration.clear(),(0,u.disposeArray)(this._highlightDecorations),this._highlightDecorations=[],this._highlightedLines.clear(),m||(this._cachedSearchTerm=void 0)}clearActiveDecoration(){this._selectedDecoration.clear()}findNext(m,b){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");const C=!this._lastSearchOptions||this._didOptionsChange(this._lastSearchOptions,b);this._lastSearchOptions=b,b!=null&&b.decorations&&(this._cachedSearchTerm===void 0||m!==this._cachedSearchTerm||C)&&this._highlightAllMatches(m,b);const p=this._findNextAndSelect(m,b);return this._fireResults(b),this._cachedSearchTerm=m,p}_highlightAllMatches(m,b){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");if(!m||m.length===0)return void this.clearDecorations();b=b||{},this.clearDecorations(!0);const C=[];let p,o=this._find(m,0,0,b);for(;o&&((p==null?void 0:p.row)!==o.row||(p==null?void 0:p.col)!==o.col)&&!(C.length>=this._highlightLimit);)p=o,C.push(p),o=this._find(m,p.col+p.term.length>=this._terminal.cols?p.row+1:p.row,p.col+p.term.length>=this._terminal.cols?0:p.col+1,b);for(const c of C){const a=this._createResultDecoration(c,b.decorations);a&&(this._highlightedLines.add(a.marker.line),this._highlightDecorations.push({decoration:a,match:c,dispose(){a.dispose()}}))}}_find(m,b,C,p){var a;if(!this._terminal||!m||m.length===0)return(a=this._terminal)==null||a.clearSelection(),void this.clearDecorations();if(C>this._terminal.cols)throw new Error(`Invalid col: ${C} to search in terminal of ${this._terminal.cols} cols`);let o;this._initLinesCache();const c={startRow:b,startCol:C};if(o=this._findInLine(m,c,p),!o)for(let f=b+1;f<this._terminal.buffer.active.baseY+this._terminal.rows&&(c.startRow=f,c.startCol=0,o=this._findInLine(m,c,p),!o);f++);return o}_findNextAndSelect(m,b){var f;if(!this._terminal||!m||m.length===0)return(f=this._terminal)==null||f.clearSelection(),this.clearDecorations(),!1;const C=this._terminal.getSelectionPosition();this._terminal.clearSelection();let p=0,o=0;C&&(this._cachedSearchTerm===m?(p=C.end.x,o=C.end.y):(p=C.start.x,o=C.start.y)),this._initLinesCache();const c={startRow:o,startCol:p};let a=this._findInLine(m,c,b);if(!a)for(let y=o+1;y<this._terminal.buffer.active.baseY+this._terminal.rows&&(c.startRow=y,c.startCol=0,a=this._findInLine(m,c,b),!a);y++);if(!a&&o!==0)for(let y=0;y<o&&(c.startRow=y,c.startCol=0,a=this._findInLine(m,c,b),!a);y++);return!a&&C&&(c.startRow=C.start.y,c.startCol=0,a=this._findInLine(m,c,b)),this._selectResult(a,b==null?void 0:b.decorations,b==null?void 0:b.noScroll)}findPrevious(m,b){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");const C=!this._lastSearchOptions||this._didOptionsChange(this._lastSearchOptions,b);this._lastSearchOptions=b,b!=null&&b.decorations&&(this._cachedSearchTerm===void 0||m!==this._cachedSearchTerm||C)&&this._highlightAllMatches(m,b);const p=this._findPreviousAndSelect(m,b);return this._fireResults(b),this._cachedSearchTerm=m,p}_didOptionsChange(m,b){return!!b&&(m.caseSensitive!==b.caseSensitive||m.regex!==b.regex||m.wholeWord!==b.wholeWord)}_fireResults(m){if(m!=null&&m.decorations){let b=-1;if(this._selectedDecoration.value){const C=this._selectedDecoration.value.match;for(let p=0;p<this._highlightDecorations.length;p++){const o=this._highlightDecorations[p].match;if(o.row===C.row&&o.col===C.col&&o.size===C.size){b=p;break}}}this._onDidChangeResults.fire({resultIndex:b,resultCount:this._highlightDecorations.length})}}_findPreviousAndSelect(m,b){var y;if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");if(!this._terminal||!m||m.length===0)return(y=this._terminal)==null||y.clearSelection(),this.clearDecorations(),!1;const C=this._terminal.getSelectionPosition();this._terminal.clearSelection();let p=this._terminal.buffer.active.baseY+this._terminal.rows-1,o=this._terminal.cols;const c=!0;this._initLinesCache();const a={startRow:p,startCol:o};let f;if(C&&(a.startRow=p=C.start.y,a.startCol=o=C.start.x,this._cachedSearchTerm!==m&&(f=this._findInLine(m,a,b,!1),f||(a.startRow=p=C.end.y,a.startCol=o=C.end.x))),f||(f=this._findInLine(m,a,b,c)),!f){a.startCol=Math.max(a.startCol,this._terminal.cols);for(let R=p-1;R>=0&&(a.startRow=R,f=this._findInLine(m,a,b,c),!f);R--);}if(!f&&p!==this._terminal.buffer.active.baseY+this._terminal.rows-1)for(let R=this._terminal.buffer.active.baseY+this._terminal.rows-1;R>=p&&(a.startRow=R,f=this._findInLine(m,a,b,c),!f);R--);return this._selectResult(f,b==null?void 0:b.decorations,b==null?void 0:b.noScroll)}_initLinesCache(){const m=this._terminal;this._linesCache||(this._linesCache=new Array(m.buffer.active.length),this._linesCacheDisposables.value=(0,u.getDisposeArrayDisposable)([m.onLineFeed((()=>this._destroyLinesCache())),m.onCursorMove((()=>this._destroyLinesCache())),m.onResize((()=>this._destroyLinesCache()))])),window.clearTimeout(this._linesCacheTimeoutId),this._linesCacheTimeoutId=window.setTimeout((()=>this._destroyLinesCache()),15e3)}_destroyLinesCache(){this._linesCache=void 0,this._linesCacheDisposables.clear(),this._linesCacheTimeoutId&&(window.clearTimeout(this._linesCacheTimeoutId),this._linesCacheTimeoutId=0)}_isWholeWord(m,b,C){return(m===0||d.includes(b[m-1]))&&(m+C.length===b.length||d.includes(b[m+C.length]))}_findInLine(m,b,C={},p=!1){var H;const o=this._terminal,c=b.startRow,a=b.startCol,f=o.buffer.active.getLine(c);if(f!=null&&f.isWrapped)return p?void(b.startCol+=o.cols):(b.startRow--,b.startCol+=o.cols,this._findInLine(m,b,C));let y=(H=this._linesCache)==null?void 0:H[c];y||(y=this._translateBufferLineToStringWithWrap(c,!0),this._linesCache&&(this._linesCache[c]=y));const[R,k]=y,D=this._bufferColsToStringOffset(c,a),E=C.caseSensitive?m:m.toLowerCase(),L=C.caseSensitive?R:R.toLowerCase();let z=-1;if(C.regex){const P=RegExp(E,"g");let I;if(p)for(;I=P.exec(L.slice(0,D));)z=P.lastIndex-I[0].length,m=I[0],P.lastIndex-=m.length-1;else I=P.exec(L.slice(D)),I&&I[0].length>0&&(z=D+(P.lastIndex-I[0].length),m=I[0])}else p?D-E.length>=0&&(z=L.lastIndexOf(E,D-E.length)):z=L.indexOf(E,D);if(z>=0){if(C.wholeWord&&!this._isWholeWord(z,L,m))return;let P=0;for(;P<k.length-1&&z>=k[P+1];)P++;let I=P;for(;I<k.length-1&&z+m.length>=k[I+1];)I++;const K=z-k[P],X=z+m.length-k[I],Y=this._stringLengthToBufferSize(c+P,K);return{term:m,col:Y,row:c+P,size:this._stringLengthToBufferSize(c+I,X)-Y+o.cols*(I-P)}}}_stringLengthToBufferSize(m,b){const C=this._terminal.buffer.active.getLine(m);if(!C)return 0;for(let p=0;p<b;p++){const o=C.getCell(p);if(!o)break;const c=o.getChars();c.length>1&&(b-=c.length-1);const a=C.getCell(p+1);a&&a.getWidth()===0&&b++}return b}_bufferColsToStringOffset(m,b){const C=this._terminal;let p=m,o=0,c=C.buffer.active.getLine(p);for(;b>0&&c;){for(let a=0;a<b&&a<C.cols;a++){const f=c.getCell(a);if(!f)break;f.getWidth()&&(o+=f.getCode()===0?1:f.getChars().length)}if(p++,c=C.buffer.active.getLine(p),c&&!c.isWrapped)break;b-=C.cols}return o}_translateBufferLineToStringWithWrap(m,b){var a;const C=this._terminal,p=[],o=[0];let c=C.buffer.active.getLine(m);for(;c;){const f=C.buffer.active.getLine(m+1),y=!!f&&f.isWrapped;let R=c.translateToString(!y&&b);if(y&&f){const k=c.getCell(c.length-1);k&&k.getCode()===0&&k.getWidth()===1&&((a=f.getCell(0))==null?void 0:a.getWidth())===2&&(R=R.slice(0,-1))}if(p.push(R),!y)break;o.push(o[o.length-1]+R.length),m++,c=f}return[p.join(""),o]}_selectResult(m,b,C){const p=this._terminal;if(this._selectedDecoration.clear(),!m)return p.clearSelection(),!1;if(p.select(m.col,m.row,m.size),b){const o=p.registerMarker(-p.buffer.active.baseY-p.buffer.active.cursorY+m.row);if(o){const c=p.registerDecoration({marker:o,x:m.col,width:m.size,backgroundColor:b.activeMatchBackground,layer:"top",overviewRulerOptions:{color:b.activeMatchColorOverviewRuler}});if(c){const a=[];a.push(o),a.push(c.onRender((f=>this._applyStyles(f,b.activeMatchBorder,!0)))),a.push(c.onDispose((()=>(0,u.disposeArray)(a)))),this._selectedDecoration.value={decoration:c,match:m,dispose(){c.dispose()}}}}}if(!C&&(m.row>=p.buffer.active.viewportY+p.rows||m.row<p.buffer.active.viewportY)){let o=m.row-p.buffer.active.viewportY;o-=Math.floor(p.rows/2),p.scrollLines(o)}return!0}_applyStyles(m,b,C){m.classList.contains("xterm-find-result-decoration")||(m.classList.add("xterm-find-result-decoration"),b&&(m.style.outline=`1px solid ${b}`)),C&&m.classList.add("xterm-find-active-result-decoration")}_createResultDecoration(m,b){const C=this._terminal,p=C.registerMarker(-C.buffer.active.baseY-C.buffer.active.cursorY+m.row);if(!p)return;const o=C.registerDecoration({marker:p,x:m.col,width:m.size,backgroundColor:b.matchBackground,overviewRulerOptions:this._highlightedLines.has(p.line)?void 0:{color:b.matchOverviewRuler,position:"center"}});if(o){const c=[];c.push(p),c.push(o.onRender((a=>this._applyStyles(a,b.matchBorder,!1)))),c.push(o.onDispose((()=>(0,u.disposeArray)(c))))}return o}}A.SearchAddon=g})(),O})()))})(Ju)),Ju.exports}var eC=Zx();function tC(s){return bt(`/api/projects/${s}/sessions`)}function l_(s){return bt(`/api/sessions/${s}`)}function iC(s,h){const w=h?`?${new URLSearchParams({from:h})}`:"";return bt(`/api/sessions/${s}/diff${w}`)}function sC(s,h,w,S){const M=new URLSearchParams({path:h});return w&&M.set("from",w),S&&M.set("now",S),bt(`/api/sessions/${s}/diff/file?${M}`)}function nC(s){return bt(`/api/sessions/${s}/snapshots`)}function rC(s){return nt(`/api/sessions/${s}/snapshot`,{})}function Eg(s,h){return nt(`/api/projects/${s}/sessions`,h)}function qk(s,h){return Di(`/api/sessions/${s}`,h)}function Gk(s){return Cr(`/api/sessions/${s}`)}function oC(s,h,w){const S=h?{...h,...w!=null&&w.continueSession?{continueSession:!0}:{}}:w!=null&&w.continueSession?{continueSession:!0}:void 0;return nt(`/api/sessions/${s}/start`,S)}function aC(s){return bt(`/api/sessions/${s}/pending-prompt`)}function lC(s){return nt(`/api/sessions/${s}/submit-initial`,{})}function cC(s){return nt(`/api/sessions/${s}/skip-initial`,{})}function gh(s){return nt(`/api/sessions/${s}/stop`)}function Yk(s,h=!0){return nt(`/api/sessions/${s}/cleanup`,{delete_branch:h})}function c_(s,h,w){return nt(`/api/sessions/${s}/paste-image`,{data:h,name:w})}function uC(s){return bt(`/api/sessions/${s}/clipboard-image-path`)}function Kk(s){return bt(`/api/projects/${s}/sessions/processes`)}const hC={background:"#0c0c0c",foreground:"#cccccc",cursor:"#f2f2f2",cursorAccent:"#0c0c0c",selectionBackground:"#264f78",black:"#0c0c0c",red:"#f14c4c",green:"#16c60c",yellow:"#cca700",blue:"#3b78ff",magenta:"#b4009e",cyan:"#61d6d6",white:"#cccccc",brightBlack:"#666666",brightRed:"#f14c4c",brightGreen:"#16c60c",brightYellow:"#f9f1a5",brightBlue:"#569cd6",brightMagenta:"#b4009e",brightCyan:"#9cdcfe",brightWhite:"#f2f2f2"},oi={default:{id:"default",name:"Default",accent:"#cccccc",theme:hC},claude:{id:"claude",name:"Claude",accent:"#d97757",theme:{background:"#1a1614",foreground:"#ebe5dc",cursor:"#d97757",cursorAccent:"#1a1614",selectionBackground:"#3a2a20",black:"#1a1614",red:"#e36049",green:"#a8b545",yellow:"#d9a657",blue:"#7ea5d4",magenta:"#c688be",cyan:"#82b3a3",white:"#d6cfc4",brightBlack:"#7a6e63",brightRed:"#ed7c5e",brightGreen:"#bdc869",brightYellow:"#e8b76e",brightBlue:"#d97757",brightMagenta:"#dba5d4",brightCyan:"#9bc8b8",brightWhite:"#f5ede0"}},vercel:{id:"vercel",name:"Vercel",accent:"#ffffff",theme:{background:"#000000",foreground:"#ededed",cursor:"#ffffff",cursorAccent:"#000000",selectionBackground:"#333333",black:"#000000",red:"#ff6363",green:"#7eb38a",yellow:"#f0ce6e",blue:"#52a9ff",magenta:"#f771b9",cyan:"#79ffe1",white:"#a1a1a1",brightBlack:"#666666",brightRed:"#ff8888",brightGreen:"#a3d4ad",brightYellow:"#ffe27a",brightBlue:"#79c8ff",brightMagenta:"#ff97cf",brightCyan:"#79ffe1",brightWhite:"#ffffff"}},supabase:{id:"supabase",name:"Supabase",accent:"#3ecf8e",theme:{background:"#1c1c1c",foreground:"#ededed",cursor:"#3ecf8e",cursorAccent:"#1c1c1c",selectionBackground:"#1f4738",black:"#1c1c1c",red:"#ed7777",green:"#3ecf8e",yellow:"#e0c367",blue:"#5a9bf2",magenta:"#bd80de",cyan:"#8edbe1",white:"#cfcfcf",brightBlack:"#525252",brightRed:"#f49191",brightGreen:"#65e0a3",brightYellow:"#f0d480",brightBlue:"#82b6f7",brightMagenta:"#d2a3e8",brightCyan:"#a8e8ed",brightWhite:"#ffffff"}},stripe:{id:"stripe",name:"Stripe",accent:"#635bff",theme:{background:"#0a2540",foreground:"#f6f9fc",cursor:"#635bff",cursorAccent:"#0a2540",selectionBackground:"#2c3e60",black:"#0a2540",red:"#ff5c8a",green:"#5ad6a4",yellow:"#f9c46b",blue:"#7a73ff",magenta:"#a87dff",cyan:"#5fbed9",white:"#cfd7e3",brightBlack:"#425466",brightRed:"#ff7ca6",brightGreen:"#7ee0b6",brightYellow:"#ffd58a",brightBlue:"#9b94ff",brightMagenta:"#c5a4ff",brightCyan:"#88d3e8",brightWhite:"#ffffff"}},spotify:{id:"spotify",name:"Spotify",accent:"#1db954",theme:{background:"#121212",foreground:"#ffffff",cursor:"#1db954",cursorAccent:"#121212",selectionBackground:"#1d4d2e",black:"#121212",red:"#e07a7a",green:"#1db954",yellow:"#d4b35a",blue:"#5099d6",magenta:"#b58fd0",cyan:"#7dccd9",white:"#b3b3b3",brightBlack:"#535353",brightRed:"#f08e8e",brightGreen:"#1ed760",brightYellow:"#e8c977",brightBlue:"#74b1e3",brightMagenta:"#caaae0",brightCyan:"#9adde6",brightWhite:"#ffffff"}},ferrari:{id:"ferrari",name:"Ferrari",accent:"#ff2800",theme:{background:"#0d0d0d",foreground:"#f5f5f5",cursor:"#ff2800",cursorAccent:"#0d0d0d",selectionBackground:"#4a1410",black:"#0d0d0d",red:"#ff2800",green:"#a5b65f",yellow:"#e0c14a",blue:"#4d8fc9",magenta:"#c772a8",cyan:"#6cbac7",white:"#cfcfcf",brightBlack:"#5e5e5e",brightRed:"#ff5a3d",brightGreen:"#bdcc7d",brightYellow:"#f0d56b",brightBlue:"#6ea8db",brightMagenta:"#dc92be",brightCyan:"#8ad0db",brightWhite:"#ffffff"}},nvidia:{id:"nvidia",name:"NVIDIA",accent:"#76b900",theme:{background:"#000000",foreground:"#ffffff",cursor:"#76b900",cursorAccent:"#000000",selectionBackground:"#2d3d10",black:"#000000",red:"#e26060",green:"#76b900",yellow:"#d4b03e",blue:"#5097cc",magenta:"#b87aac",cyan:"#6ec3c5",white:"#bdbdbd",brightBlack:"#4a4a4a",brightRed:"#f08080",brightGreen:"#94d624",brightYellow:"#e6c861",brightBlue:"#6fb0e0",brightMagenta:"#d29ac8",brightCyan:"#90dde0",brightWhite:"#ffffff"}},apple:{id:"apple",name:"Apple",accent:"#0071e3",light:!0,theme:{background:"#ffffff",foreground:"#1d1d1f",cursor:"#0071e3",cursorAccent:"#ffffff",selectionBackground:"#b3d7ff",black:"#1d1d1f",red:"#d70015",green:"#248a3d",yellow:"#9a6b00",blue:"#0071e3",magenta:"#8944ab",cyan:"#008575",white:"#86868b",brightBlack:"#6e6e73",brightRed:"#ff3b30",brightGreen:"#2fa04c",brightYellow:"#bf8700",brightBlue:"#2b8fff",brightMagenta:"#af52de",brightCyan:"#00a3b4",brightWhite:"#f5f5f7"}},notion:{id:"notion",name:"Notion",accent:"#eb5757",light:!0,theme:{background:"#f7f6f3",foreground:"#37352f",cursor:"#37352f",cursorAccent:"#f7f6f3",selectionBackground:"#d3e5ef",black:"#37352f",red:"#d44c47",green:"#448361",yellow:"#cb912f",blue:"#337ea9",magenta:"#9065b0",cyan:"#0f7b6c",white:"#9b9a97",brightBlack:"#787774",brightRed:"#eb5757",brightGreen:"#4f9768",brightYellow:"#d9730d",brightBlue:"#4a94bf",brightMagenta:"#a97cc9",brightCyan:"#339588",brightWhite:"#ffffff"}},starbucks:{id:"starbucks",name:"Starbucks",accent:"#00754a",light:!0,theme:{background:"#f2f0eb",foreground:"#1e3932",cursor:"#00754a",cursorAccent:"#f2f0eb",selectionBackground:"#d4e9e2",black:"#1e3932",red:"#b3423a",green:"#00754a",yellow:"#a1721c",blue:"#3a6c8c",magenta:"#7d4a78",cyan:"#1f7a70",white:"#8a857c",brightBlack:"#5c5a54",brightRed:"#d05b4c",brightGreen:"#008248",brightYellow:"#bf8b2e",brightBlue:"#4d86a8",brightMagenta:"#9a6394",brightCyan:"#349b8f",brightWhite:"#fbf9f4"}}},Lg=["default","claude","vercel","supabase","stripe","spotify","ferrari","nvidia","apple","notion","starbucks"],u_="default";function Rg(s){return oi[s]??oi.default}let Qu=!1;function h_(s){var r,u;const h=window.electronAPI;if(!(h!=null&&h.imeReset)||Qu)return!1;Qu=!0;let w=!1;const S=()=>{w=!0,Qu=!1,window.clearTimeout(O),window.removeEventListener("focus",A)},M=()=>{if(!w)try{s()}finally{S()}},O=window.setTimeout(M,1e3),A=()=>{requestAnimationFrame(()=>{requestAnimationFrame(M)})};return window.addEventListener("focus",A),(u=(r=document.activeElement)==null?void 0:r.blur)==null||u.call(r),h.imeReset(!0),!0}const Zu=(s,h)=>{var w,S;try{(S=(w=window.electronAPI)==null?void 0:w.imeLog)==null||S.call(w,{reason:s,path:window.location.pathname,...h})}catch{}},Za=s=>{const h=s instanceof HTMLElement?s:null;if(!h)return null;const w=typeof h.className=="string"?h.className.slice(0,60):"";return`${h.tagName}${h.id?`#${h.id}`:""}${w?`.${w}`:""}`};if(typeof document<"u"){document.addEventListener("keydown",s=>{const h=s.target instanceof HTMLElement?s.target:null;h!=null&&h.closest("[data-term-container]")||Zu("keydown:outside",{key:s.key,target:Za(h),active:Za(document.activeElement)})},!0),document.addEventListener("focusin",s=>{Zu("focusin",{target:Za(s.target)})},!0);for(const s of["compositionstart","compositionend"])document.addEventListener(s,h=>{const w=h.target instanceof HTMLElement?h.target:null;w!=null&&w.closest("[data-term-container]")||Zu(`${s}:outside`,{target:Za(w),data:h.data??""})},!0)}const el=oi.default.theme,eh={decorations:{matchBackground:"#5a4a00",matchBorder:"#cca700",matchOverviewRuler:"#cca700",activeMatchBackground:"#cca700",activeMatchBorder:"#f2f2f2",activeMatchColorOverviewRuler:"#f2f2f2"}};function Dg(s){const h=/^#([0-9a-f]{6})$/i.exec(s.background??"");if(!h)return 1;const w=parseInt(h[1],16);return .299*(w>>16)+.587*(w>>8&255)+.114*(w&255)>128?4.5:1}function d_(s){return s.includes(`
|
|
417
|
+
`)?`\x1B[200~${s}\x1B[201~`:s}function dC(s){const h=s.filter(Boolean).map(w=>/\s/.test(w)?`"${w}"`:w);return h.length?h.join(" ")+" ":""}function fC(s){return s>=1024*1024?`${(s/(1024*1024)).toFixed(1)} MB`:`${Math.max(1,Math.round(s/1024))} KB`}function pC({sessionId:s,isRunning:h,subscribed:w,onFitted:S,sendMessage:M,subscribeBinary:O,onEvent:A,height:r="100%",fontSize:u=jh,theme:d,inputBlocked:g=!1,autoFocusOnMount:l=!1,onRequestRefresh:m,disableImagePaste:b=!1,onCycleTab:C,onSelectTab:p,onToggleDiff:o}){const c=j.useRef(d);c.current=d;const a=j.useRef(g);a.current=g;const f=j.useRef(b);f.current=b;const y=j.useRef(C);y.current=C;const R=j.useRef(p);R.current=p;const k=j.useRef(o);k.current=o;const D=j.useRef(m);D.current=m;const E=j.useRef(null),L=j.useRef(null),z=j.useRef(null),H=j.useRef(null),P=j.useRef({cols:0,rows:0}),I=j.useRef(null),K=j.useRef(null),X=j.useRef(!1),Y=j.useRef(S);Y.current=S;const $=j.useRef(null),[U,T]=j.useState(!0),[F,B]=j.useState(""),W=j.useRef(B);W.current=B;const[Z,ne]=j.useState(null),ge=j.useRef(null),xe=j.useRef(null),[J,G]=j.useState(!1),[de,oe]=j.useState(""),[Ae,Oe]=j.useState({index:-1,count:0}),Xe=j.useRef(Oe);Xe.current=Oe;const We=j.useRef(!1),rt=()=>{var Ne;const le=((Ne=L.current)==null?void 0:Ne.getSelection())??"";le&&!le.includes(`
|
|
418
|
+
`)&&oe(le),We.current=!0,G(!0)},ye=j.useRef(rt);ye.current=rt;const Te=()=>{var le,Ne;We.current=!1,G(!1),(le=ge.current)==null||le.clearDecorations(),Oe({index:-1,count:0});try{(Ne=L.current)==null||Ne.focus()}catch{}},ct=j.useRef(Te);ct.current=Te;const it=j.useRef(0),ze=(le,Ne,je)=>{const ue=++it.current,ee=Date.now();ne({dataUrl:le,bytes:Ne});const be=()=>{const he=Math.max(0,600-(Date.now()-ee));setTimeout(()=>{it.current===ue&&ne(null)},he)};je.then(be,be)},qe=j.useRef(ze);qe.current=ze;const{warning:Fe}=un(),Be=j.useRef(Fe);Be.current=Fe;const[$e,lt]=j.useState(null),st=j.useRef(()=>{});j.useEffect(()=>{if(!$e)return;const le=()=>lt(null),Ne=je=>{je.key==="Escape"&&le()};return window.addEventListener("keydown",Ne,!0),window.addEventListener("resize",le),window.addEventListener("scroll",le,!0),()=>{window.removeEventListener("keydown",Ne,!0),window.removeEventListener("resize",le),window.removeEventListener("scroll",le,!0)}},[$e]),j.useEffect(()=>{var Ze;const le=E.current;if(!le)return;const Ne=fe=>{const Ve=fe.type;a.current&&Ve==="session:terminal-input"||M(fe)},je=new Xx.Terminal({fontFamily:_t,fontSize:u,lineHeight:1,cursorBlink:h,convertEol:!1,scrollback:5e3,theme:c.current??el,minimumContrastRatio:Dg(c.current??el),allowProposedApi:!0,macOptionIsMeta:!0}),ue=/Mac|iPhone|iPad|iPod/.test(navigator.platform);let ee=0;const be=async()=>{var Ve;if(a.current){console.debug("[paste] inputBlocked → ignored");return}if(!window.isSecureContext)return;if(ee=Date.now(),!f.current)try{const ht=await navigator.clipboard.read();for(const At of ht){const Jt=At.types.find(jt=>jt.startsWith("image/"));if(Jt){const jt=await At.getType(Jt),ei=new FileReader;ei.onload=()=>{const $t=ei.result;console.debug("[paste] image via clipboard.read(), bytes=",jt.size);const li=c_(s,$t);li.catch(mi=>console.warn("[paste] pasteImage failed:",mi)),qe.current($t,jt.size,li)},ei.readAsDataURL(jt);return}}}catch(ht){console.debug("[paste] clipboard.read() rejected, falling through:",ht)}let fe=null;try{fe=await navigator.clipboard.readText()}catch(ht){console.warn("[paste] clipboard.readText() failed:",ht)}if(fe){const ht=fe.includes(`
|
|
419
|
+
`);console.debug("[paste] sending text, len=",fe.length,"multiline=",ht),Ne({type:"session:terminal-input",sessionId:s,input:d_(fe)});return}try{const ht=await uC(s);if(ht.path){console.debug("[paste] empty browser clipboard, using OS file path:",ht.path),Ne({type:"session:terminal-input",sessionId:s,input:ht.path});return}}catch(ht){console.debug("[paste] getClipboardImagePath failed:",ht)}console.warn("[paste] no content available (text empty, no image, no file path)"),(Ve=Be.current)==null||Ve.call(Be,"붙여넣을 내용을 클립보드에서 읽지 못했습니다. 우클릭 → 붙여넣기를 사용하세요.")};je.attachCustomKeyEventHandler(fe=>{var ei;if(fe.type!=="keydown")return!0;const Ve=ue?fe.metaKey:fe.ctrlKey,ht=ue?fe.ctrlKey:fe.metaKey,At=Ve&&!ht&&!fe.altKey&&!fe.shiftKey,Jt=Ve&&!ht&&!fe.altKey&&fe.shiftKey,jt=fe.key.toLowerCase();if(jt==="tab"&&(At||Jt)&&y.current)return fe.preventDefault(),y.current(Jt?"prev":"next"),!1;if(At&&/^[1-9]$/.test(jt)&&R.current)return fe.preventDefault(),R.current(Number(jt)-1),!1;if(jt==="f"&&At)return fe.preventDefault(),ye.current(),!1;if(jt==="t"&&At||jt==="r"&&Jt||jt==="f5"&&!fe.ctrlKey&&!fe.metaKey&&!fe.altKey&&!fe.shiftKey)return fe.preventDefault(),!1;if(jt==="d"&&Jt&&k.current)return fe.preventDefault(),k.current(),!1;if(Jt&&(["a","p","o","m","x","z"].includes(jt)||jt.startsWith("arrow")))return fe.preventDefault(),!1;if(At&&jt==="c"){const $t=je.getSelection();return $t?(fe.preventDefault(),(ei=navigator.clipboard)==null||ei.writeText($t).catch(()=>{}),je.clearSelection(),!1):!ue}if(At&&jt==="v"||fe.altKey&&!fe.ctrlKey&&!fe.metaKey&&!fe.shiftKey&&jt==="v")return fe.preventDefault(),be(),!1;if((fe.ctrlKey||fe.metaKey)&&!fe.altKey){if(fe.key==="+"||fe.key==="=")return fe.preventDefault(),bo(s,1),!1;if(fe.key==="-"||fe.key==="_")return fe.preventDefault(),bo(s,-1),!1}return!0});const he=new Jx.FitAddon;je.loadAddon(he),je.open(le),L.current=je,z.current=he;const He=new eC.SearchAddon;je.loadAddon(He),ge.current=He;const Me=He.onDidChangeResults(({resultIndex:fe,resultCount:Ve})=>{Xe.current({index:fe,count:Ve})}),Ge=()=>{We.current&&ct.current()};le.addEventListener("focusin",Ge),je.attachCustomWheelEventHandler(fe=>!fe.ctrlKey&&!fe.metaKey?!0:(fe.preventDefault(),fe.__zoomHandled=!0,fe.deltaY!==0&&bo(s,fe.deltaY<0?1:-1),!1));const se=fe=>{if(fe.ctrlKey||fe.metaKey){if(fe.preventDefault(),fe.stopPropagation(),fe.deltaY===0||fe.__zoomHandled)return;bo(s,fe.deltaY<0?1:-1);return}fe.stopPropagation()};le.addEventListener("wheel",se,{passive:!1});const V=window.electronAPI,ie=(Ze=V==null?void 0:V.onTerminalZoom)==null?void 0:Ze.call(V,fe=>{var ht;const Ve=le.matches(":hover");(ht=V.imeLog)==null||ht.call(V,{reason:"zoom:recv",dir:fe,hovered:Ve,path:window.location.pathname}),Ve&&bo(s,fe==="in"?1:-1)});st.current=()=>{be()};const Q=fe=>{fe.preventDefault(),lt({x:fe.clientX,y:fe.clientY,hasSelection:je.hasSelection()})};le.addEventListener("contextmenu",Q);try{he.fit()}catch{}if(l){const fe=document.activeElement;if(!(!!fe&&(fe.tagName==="INPUT"||fe.tagName==="TEXTAREA"||fe.tagName==="SELECT"||fe.isContentEditable))&&(fe===null||fe===document.body))try{je.focus()}catch{}}const ke=()=>{const fe=je.cols,Ve=je.rows;fe===P.current.cols&&Ve===P.current.rows||(P.current={cols:fe,rows:Ve},M({type:"session:resize",sessionId:s,cols:fe,rows:Ve}))};$.current=ke;const ce=O(s,fe=>{try{je.write(fe)}catch{}}),_e=A(fe=>{fe.type==="session:replay-end"&&fe.sessionId===s&&T(!1)}),Ee=()=>Date.now()-ee<300,Pe=()=>f.current,Ue=fe=>W.current(fe),ot=(fe,Ve,ht)=>qe.current(fe,Ve,ht),Ye=mC()?SC({container:le,term:je,sessionId:s,sendMessage:Ne}):wC({container:le,term:je,sessionId:s,sendMessage:Ne,isPasteAlreadyHandled:Ee,isImagePasteDisabled:Pe,onComposingChange:Ue,onImagePasted:ot}),ut=100;let ft=null,kt=0,vt=!1;const Vt={cols:je.cols,rows:je.rows},Nt=new ResizeObserver(()=>{if(ft!==null)return;const fe=Math.max(0,ut-(performance.now()-kt));ft=setTimeout(()=>{ft=null,requestAnimationFrame(()=>{var ht;kt=performance.now();const Ve=le.getBoundingClientRect();if(!(Ve.width===0||Ve.height===0)){try{he.fit(),(je.cols!==Vt.cols||je.rows!==Vt.rows)&&(Vt.cols=je.cols,Vt.rows=je.rows,je.refresh(0,je.rows-1))}catch{}!vt&&je.cols>=20&&je.rows>=5&&(vt=!0,(ht=Y.current)==null||ht.call(Y,je.cols,je.rows)),I.current&&clearTimeout(I.current),I.current=setTimeout(ke,150)}})},fe)});return Nt.observe(le),()=>{var fe;Nt.disconnect(),ft!==null&&clearTimeout(ft),I.current&&clearTimeout(I.current),K.current&&clearTimeout(K.current),le.removeEventListener("wheel",se),ie==null||ie(),le.removeEventListener("contextmenu",Q),lt(null),Ye(),ce(),_e();try{M({type:"session:unsubscribe",sessionId:s})}catch{}le.removeEventListener("focusin",Ge),Me.dispose(),ge.current=null,(fe=H.current)==null||fe.dispose(),H.current=null,je.dispose(),L.current=null,z.current=null,$.current=null,X.current=!1}},[s]),j.useEffect(()=>{const le=L.current;if(le){if(l&&!H.current)try{const Ne=new Cg.CanvasAddon;le.loadAddon(Ne),H.current=Ne}catch{H.current=null}else if(!l&&H.current){try{H.current.dispose()}catch{}H.current=null}}},[l,s]),j.useEffect(()=>{if(!w||X.current)return;X.current=!0;const le=L.current;le&&le.cols>0&&le.rows>0&&(P.current={cols:0,rows:0},M({type:"session:resize",sessionId:s,cols:le.cols,rows:le.rows})),M({type:"session:subscribe",sessionId:s})},[w,s,M]),j.useEffect(()=>{L.current&&(L.current.options.cursorBlink=h)},[h]),j.useEffect(()=>{var ue;if(!l)return;const le=document.activeElement;if(!(!(!!le&&le.classList.contains("xterm-helper-textarea"))&&!!le&&(le.tagName==="INPUT"||le.tagName==="TEXTAREA"||le.tagName==="SELECT"||le.isContentEditable)))try{(ue=L.current)==null||ue.focus()}catch{}},[l]),j.useEffect(()=>{const le=L.current,Ne=z.current;if(!le||!Ne||le.options.fontSize===u)return;if(le.options.fontSize=u,H.current){try{H.current.dispose()}catch{}H.current=null;try{const ue=new Cg.CanvasAddon;le.loadAddon(ue),H.current=ue}catch{}}if(le.buffer.active.type==="alternate"){K.current&&clearTimeout(K.current),K.current=setTimeout(()=>{var ue;(ue=D.current)==null||ue.call(D)},500);return}try{Ne.fit(),le.refresh(0,le.rows-1)}catch{}le.cols===P.current.cols&&le.rows===P.current.rows||(K.current&&clearTimeout(K.current),K.current=setTimeout(()=>{var ue;(ue=$.current)==null||ue.call($)},300))},[u,s]),j.useEffect(()=>{const le=L.current;if(le){le.options.theme=d??el,le.options.minimumContrastRatio=Dg(d??el);try{le.refresh(0,le.rows-1)}catch{}}},[d]),j.useEffect(()=>{if(!J)return;const le=ge.current;if(!le)return;const Ne=setTimeout(()=>{de?le.findNext(de,{...eh,incremental:!0}):(le.clearDecorations(),Oe({index:-1,count:0}))},120);return()=>clearTimeout(Ne)},[de,J]),j.useEffect(()=>{var le;J&&((le=xe.current)==null||le.select())},[J]);const St=(d==null?void 0:d.background)??Ce.bg,Se=()=>{var le;de&&((le=ge.current)==null||le.findNext(de,eh))},Ie=()=>{var le;de&&((le=ge.current)==null||le.findPrevious(de,eh))};return v.jsxs("div",{style:{position:"relative",background:St,padding:12,height:r,width:"100%",boxSizing:"border-box",overflow:"hidden"},children:[U&&w&&v.jsx("div",{style:{position:"absolute",top:8,right:12,fontFamily:_t,fontSize:11,color:Ce.dim,zIndex:1,pointerEvents:"none"},children:"loading history…"}),v.jsx("div",{ref:E,"data-term-container":!0,style:{height:"100%",width:"100%"}}),J&&v.jsxs("div",{style:{position:"absolute",top:8,right:12,zIndex:5,display:"flex",alignItems:"center",gap:6,padding:"4px 6px",background:"rgba(0,0,0,0.85)",border:`1px solid ${Ce.separator}`,borderRadius:6,fontFamily:_t,fontSize:12,boxShadow:"0 4px 16px rgba(0,0,0,0.5)"},children:[v.jsx("input",{ref:xe,value:de,onChange:le=>oe(le.target.value),onKeyDown:le=>{le.key==="Enter"?(le.preventDefault(),le.shiftKey?Ie():Se()):le.key==="Escape"&&(le.preventDefault(),Te())},placeholder:"검색",spellCheck:!1,style:{width:160,background:"transparent",border:"none",outline:"none",color:Ce.bright,fontFamily:_t,fontSize:12}}),v.jsx("span",{style:{color:Ce.dim,minWidth:44,textAlign:"right",fontVariantNumeric:"tabular-nums"},children:de?Ae.count>0?`${Ae.index+1}/${Ae.count}`:"0/0":""}),[{label:"↑",title:"이전 (Shift+Enter)",onClick:Ie},{label:"↓",title:"다음 (Enter)",onClick:Se},{label:"×",title:"닫기 (Esc)",onClick:Te}].map(le=>v.jsx("button",{type:"button",title:le.title,onClick:le.onClick,className:"px-1.5 rounded-md hover:bg-white/10",style:{color:Ce.bright,lineHeight:"18px"},children:le.label},le.label))]}),(F||Z)&&v.jsxs("div",{style:{position:"absolute",right:12,bottom:12,maxWidth:"calc(100% - 24px)",display:"flex",flexDirection:"column",alignItems:"flex-end",gap:6,zIndex:2,pointerEvents:"none"},children:[Z&&v.jsxs("div",{style:{padding:4,background:"rgba(0,0,0,0.72)",border:`1px solid ${Ce.separator}`,borderRadius:4,maxWidth:"100%"},children:[v.jsx("img",{src:Z.dataUrl,alt:"",style:{display:"block",maxWidth:220,maxHeight:140,borderRadius:2}}),v.jsxs("div",{style:{fontFamily:_t,fontSize:11,color:Ce.dim,marginTop:3},children:["이미지 붙여넣음 · ",fC(Z.bytes)]})]}),F&&v.jsx("div",{style:{maxWidth:"100%",padding:"3px 8px",background:"rgba(0,0,0,0.72)",border:`1px solid ${Ce.separator}`,borderRadius:4,fontFamily:_t,fontSize:Math.max(12,u),color:Ce.bright,lineHeight:1.3,whiteSpace:"pre",overflow:"hidden",textOverflow:"ellipsis"},children:F})]}),$e&&zi.createPortal((()=>{const je=Math.max(8,Math.min($e.x,window.innerWidth-184-8)),ue=Math.max(8,Math.min($e.y,window.innerHeight-116-8)),ee=()=>lt(null),be=()=>{var Ge,se;const Me=((Ge=L.current)==null?void 0:Ge.getSelection())??"";Me&&((se=navigator.clipboard)==null||se.writeText(Me).catch(()=>{})),ee()},he=()=>{st.current(),ee()},He=()=>{var Me;(Me=L.current)==null||Me.selectAll(),ee()};return v.jsxs(v.Fragment,{children:[v.jsx("div",{style:{position:"fixed",inset:0,zIndex:2147483646},onMouseDown:ee,onContextMenu:Me=>{Me.preventDefault(),ee()}}),v.jsxs("div",{role:"menu",style:{position:"fixed",left:je,top:ue,zIndex:2147483647,minWidth:168,background:Ce.bg,border:`1px solid ${Ce.separator}`,borderRadius:6,padding:4,fontFamily:_t,fontSize:13,boxShadow:"0 8px 24px rgba(0,0,0,0.5)"},children:[v.jsx("button",{type:"button",disabled:!$e.hasSelection,onClick:be,className:"w-full text-left px-3 py-1.5 rounded-md hover:bg-white/10 disabled:opacity-40 disabled:cursor-not-allowed",style:{color:Ce.bright},children:"복사"}),v.jsx("button",{type:"button",onClick:he,className:"w-full text-left px-3 py-1.5 rounded-md hover:bg-white/10",style:{color:Ce.bright},children:"붙여넣기"}),v.jsx("button",{type:"button",onClick:He,className:"w-full text-left px-3 py-1.5 rounded-md hover:bg-white/10",style:{color:Ce.bright},children:"전체 선택"})]})]})})(),document.body)]})}function mC(){if(typeof navigator>"u")return!1;const s=navigator.userAgent;return/iPad|iPhone|iPod/.test(s)||/Mac/.test(s)&&navigator.maxTouchPoints>1||/Android/i.test(s)}const dl=[12593,12594,12596,12599,12600,12601,12609,12610,12611,12613,12614,12615,12616,12617,12618,12619,12620,12621,12622],f_=[12623,12624,12625,12626,12627,12628,12629,12630,12631,12632,12633,12634,12635,12636,12637,12638,12639,12640,12641,12642,12643],Tg=[0,12593,12594,12595,12596,12597,12598,12599,12601,12602,12603,12604,12605,12606,12607,12608,12609,12610,12612,12613,12614,12615,12616,12618,12619,12620,12621,12622];function p_(s){return s>=12593&&s<=12622}function m_(s){return s>=12623&&s<=12643}function gC(s){return p_(s)||m_(s)}function vC(s){return s>=44032&&s<=55203}function _C(){return{cho:-1,jung:-1,jong:0}}function Ih(s){return s.cho<0&&s.jung<0&&s.jong===0}function Ms(s){return Ih(s)?"":s.cho>=0&&s.jung>=0?String.fromCharCode(44032+(s.cho*21+s.jung)*28+s.jong):s.cho>=0?String.fromCharCode(dl[s.cho]):s.jung>=0?String.fromCharCode(f_[s.jung]):""}function Mg(s){const h=Ms(s);return s.cho=-1,s.jung=-1,s.jong=0,h}function bC(s,h){if(m_(h)){const w=f_.indexOf(h);if(w<0)return"";if(s.cho<0&&s.jung<0||s.cho>=0&&s.jung<0)return s.jung=w,"";if(s.cho<0&&s.jung>=0){const A=Ms(s);return s.jung=w,A}if(s.jong===0){const A=Ms(s);return s.cho=-1,s.jung=w,s.jong=0,A}const S=Tg[s.jong],M=dl.indexOf(S);s.jong=0;const O=Ms(s);return M>=0?(s.cho=M,s.jung=w,s.jong=0):(s.cho=-1,s.jung=w,s.jong=0),O}if(p_(h)){const w=dl.indexOf(h),S=Tg.indexOf(h);if(s.cho<0&&s.jung<0)return w>=0?(s.cho=w,""):String.fromCharCode(h);if(s.cho>=0&&s.jung<0){const O=String.fromCharCode(dl[s.cho]);return w>=0?(s.cho=w,O):(s.cho=-1,O+String.fromCharCode(h))}if(s.cho<0&&s.jung>=0){const O=Ms(s);return s.jung=-1,w>=0?(s.cho=w,O):O+String.fromCharCode(h)}if(s.jong===0){if(S>0)return s.jong=S,"";const O=Ms(s);return s.cho=w>=0?w:-1,s.jung=-1,s.jong=0,O}const M=Ms(s);return s.cho=w>=0?w:-1,s.jung=-1,s.jong=0,w<0?M+String.fromCharCode(h):M}return""}function yC(s,h){const w=Ms(s),S=h-44032;return s.cho=Math.floor(S/588),s.jung=Math.floor(S/28)%21,s.jong=S%28,w}function Ag(s){return Ih(s)?!1:(s.cho=-1,s.jung=-1,s.jong=0,!0)}function wC({container:s,term:h,sessionId:w,sendMessage:S,isPasteAlreadyHandled:M,isImagePasteDisabled:O,onComposingChange:A,onImagePasted:r}){let u=!1;const d=L=>{try{A==null||A(L)}catch{}};let g=null;const l=(L,z={})=>{var H,P;try{(P=(H=window.electronAPI)==null?void 0:H.imeLog)==null||P.call(H,{reason:L,path:window.location.pathname,...z})}catch{}},m=(L=!1)=>{try{const z=s.querySelector(".xterm-helper-textarea"),H=s.querySelector(".xterm-screen");if(!z||!H){L||l("pos:no-dom",{hasHelper:!!z,hasScreen:!!H});return}const P=h.cols,I=h.rows;if(P<=0||I<=0){L||l("pos:no-grid",{cols:P,rows:I});return}const K=H.getBoundingClientRect();if(K.width===0||K.height===0){L||l("pos:zero-screen",{w:K.width,h:K.height});return}const X=K.width/P,Y=K.height/I,$=h.buffer.active,U=Math.min($.cursorX,P-1),T=Math.max(0,Math.min($.cursorY,I-1));z.style.left=`${U*X}px`,z.style.top=`${T*Y}px`,z.style.width=`${Math.max(X,1)}px`,z.style.height=`${Math.max(Y,1)}px`,L||l("pos:applied",{cursorX:U,cursorY:T,left:U*X,top:T*Y})}catch{}};m();let b=0;const C=()=>{b||(b=requestAnimationFrame(()=>{b=0,m(!0)}))},p=h.onCursorMove(C),o=()=>{var L;u=!0,m(),d("");try{const z=document.activeElement,H=s.querySelector(".xterm-helper-textarea"),P=H==null?void 0:H.getBoundingClientRect();l("compositionstart",{activeTag:z==null?void 0:z.tagName,activeClass:z==null?void 0:z.className,activeIsHelper:!!z&&((L=z.classList)==null?void 0:L.contains("xterm-helper-textarea")),helperStyleLeft:H==null?void 0:H.style.left,helperStyleTop:H==null?void 0:H.style.top,helperRectLeft:P==null?void 0:P.left,helperRectTop:P==null?void 0:P.top,visibility:document.visibilityState,hasFocus:document.hasFocus(),cols:h.cols,rows:h.rows})}catch{}},c=L=>{d(L.data??""),l("compositionupdate",{data:L.data??""})},a=L=>{u=!1,d("");const z=L.data;l("compositionend",{data:z??"",sent:!!z}),z&&(g=z,S({type:"session:terminal-input",sessionId:w,input:z}))},f=L=>{var P,I;if(M()){L.preventDefault();return}const z=(P=L.clipboardData)==null?void 0:P.items;if(z&&!(O!=null&&O())){for(let K=0;K<z.length;K++)if(z[K].type.startsWith("image/")){L.preventDefault();const X=z[K].getAsFile();if(!X)return;const Y=new FileReader;Y.onload=()=>{const $=Y.result;console.debug("[paste-fallback] image via paste event, bytes=",X.size);const U=c_(w,$,X.name);U.catch(T=>console.warn("[paste-fallback] pasteImage failed:",T)),r==null||r($,X.size,U)},Y.readAsDataURL(X);return}}const H=(I=L.clipboardData)==null?void 0:I.getData("text/plain");if(H){L.preventDefault();const K=H.includes(`
|
|
420
|
+
`);console.debug("[paste-fallback] sending text, len=",H.length,"multiline=",K),S({type:"session:terminal-input",sessionId:w,input:d_(H)})}else console.debug("[paste-fallback] paste event had no usable text/image")},y=L=>{var K,X;const z=(K=L.dataTransfer)==null?void 0:K.files;if(!z||z.length===0)return;L.preventDefault();const H=(X=window.electronAPI)==null?void 0:X.getDroppedFilePath;if(!H)return;const P=[];for(let Y=0;Y<z.length;Y++){const $=H(z[Y]);$&&P.push($)}const I=dC(P);I&&S({type:"session:terminal-input",sessionId:w,input:I})},R=L=>{var z,H;(H=(z=L.dataTransfer)==null?void 0:z.types)!=null&&H.includes("Files")&&(L.preventDefault(),L.dataTransfer.dropEffect="copy")},k=()=>{if(u)return;h_(()=>{try{h.focus()}catch{}})&&l("focus-rescue")},D=L=>{var z,H;l("keydown",{key:L.key,composing:u,activeIsHelper:!!((H=(z=document.activeElement)==null?void 0:z.classList)!=null&&H.contains("xterm-helper-textarea")),hasFocus:document.hasFocus()}),document.hasFocus()||k()};s.addEventListener("keydown",D,!0),s.addEventListener("compositionstart",o,!0),s.addEventListener("compositionupdate",c,!0),s.addEventListener("compositionend",a,!0),s.addEventListener("paste",f,!0),s.addEventListener("dragover",R),s.addEventListener("drop",y);const E=h.onData(L=>{if(!u){if(g!==null&&L===g){g=null;return}g=null,S({type:"session:terminal-input",sessionId:w,input:L})}});return()=>{E.dispose(),p.dispose(),b&&cancelAnimationFrame(b),s.removeEventListener("keydown",D,!0),s.removeEventListener("compositionstart",o,!0),s.removeEventListener("compositionupdate",c,!0),s.removeEventListener("compositionend",a,!0),s.removeEventListener("paste",f,!0),s.removeEventListener("dragover",R),s.removeEventListener("drop",y),d("")}}function SC({container:s,term:h,sessionId:w,sendMessage:S}){const M=s.querySelector(".xterm-helper-textarea");let O="",A=0;M&&(O=M.style.display,A=M.tabIndex,M.style.display="none",M.tabIndex=-1),getComputedStyle(s).position==="static"&&(s.style.position="relative");const r=document.createElement("textarea");r.setAttribute("autocomplete","off"),r.setAttribute("lang","ko"),r.setAttribute("inputmode","text"),r.rows=1,Object.assign(r.style,{position:"absolute",background:"transparent",border:"none",outline:"none",padding:"0",margin:"0",fontFamily:_t,fontSize:"16px",lineHeight:"1.2",resize:"none",overflow:"hidden",whiteSpace:"pre",caretColor:"rgba(255,255,255,0.001)",zIndex:"5"});const u=()=>{Object.assign(r.style,{inset:"0",left:"auto",top:"auto",width:"100%",height:"100%",color:"transparent"})},d=()=>{const k=s.querySelector(".xterm-screen");if(!k)return;const D=h.cols,E=h.rows;if(D<=0||E<=0)return;const L=k.clientWidth/D,z=k.clientHeight/E,H=h.buffer.active.cursorX,P=h.buffer.active.cursorY,I=k.getBoundingClientRect(),K=s.getBoundingClientRect();Object.assign(r.style,{inset:"auto",left:`${I.left-K.left+H*L}px`,top:`${I.top-K.top+P*z}px`,width:`${Math.max(L*30,240)}px`,height:`${Math.max(z,20)}px`,color:Ce.text})};u(),s.appendChild(r);let g=!1;const l=_C();let m=null;const b=()=>{m&&(clearTimeout(m),m=null)},C=k=>{k&&S({type:"session:terminal-input",sessionId:w,input:k})},p=()=>{const k=Mg(l);k&&C(k)},o=()=>{const k=Ms(l);r.value=k,k?d():u()},c=()=>{b(),m=setTimeout(()=>{m=null,p(),r.value="",u()},600)},a=()=>{g=!0,b(),p(),d()},f=k=>{g=!1,k.data&&C(k.data),r.value="",u()};r.addEventListener("compositionstart",a),r.addEventListener("compositionend",f);const y=k=>{if(g)return;const D=k;switch(D.inputType){case"insertCompositionText":case"insertFromComposition":return;case"deleteContentBackward":b(),Ag(l)?o():(C(""),r.value="",u());return;case"insertLineBreak":case"insertParagraph":b(),p(),C("\r"),r.value="",u();return;default:if(!D.data){o();return}b();let E="";for(const L of D.data){const z=L.codePointAt(0);gC(z)?E+=bC(l,z):vC(z)?E+=yC(l,z):(E+=Mg(l),E+=L)}C(E),o(),Ih(l)||c()}};r.addEventListener("input",y);const R=k=>{if(g||k.isComposing)return;let D=null;switch(k.key){case"Enter":D="\r";break;case"Backspace":D="";break;case"Tab":D=" ";break;case"Escape":D="\x1B";break;case"ArrowUp":D="\x1B[A";break;case"ArrowDown":D="\x1B[B";break;case"ArrowRight":D="\x1B[C";break;case"ArrowLeft":D="\x1B[D";break;case"Home":D="\x1B[H";break;case"End":D="\x1B[F";break}if(D){if(k.preventDefault(),b(),k.key==="Backspace"){if(Ag(l)){o();return}}else p();C(D),r.value="",u();return}if(k.ctrlKey&&!k.metaKey&&!k.altKey&&k.key.length===1){const E=k.key.toUpperCase().charCodeAt(0);E>=64&&E<=95&&(k.preventDefault(),b(),p(),C(String.fromCharCode(E-64)),r.value="",u())}};return r.addEventListener("keydown",R),()=>{b(),p(),r.remove(),M&&(M.style.display=O,M.tabIndex=A)}}function xC(s){switch(s){case"A":return{label:"A",color:"text-status-success"};case"D":return{label:"D",color:"text-status-error"};case"R":return{label:"R",color:"text-purple-500"};case"C":return{label:"C",color:"text-blue-500"};default:return{label:"M",color:"text-accent"}}}function CC({files:s,loading:h,selectedFile:w,onFileClick:S,commitHash:M}){const{t:O}=Tt();return v.jsxs("div",{className:"h-full flex flex-col",children:[v.jsxs("div",{className:"px-3 py-2 border-b border-warm-100 flex items-center justify-between shrink-0",children:[v.jsx("span",{className:"text-[11px] font-semibold text-warm-500 uppercase tracking-wider",children:O("git.changedFiles")}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsxs("span",{className:"text-2xs text-warm-400",children:[s.length," ",O("git.files")]}),M&&v.jsx("span",{className:"text-2xs font-mono text-warm-400",children:M.substring(0,7)})]})]}),h?v.jsx("div",{className:"flex-1 flex items-center justify-center",children:v.jsx("span",{className:"text-xs text-warm-400",children:O("git.loadingFiles")})}):s.length===0?v.jsx("div",{className:"flex-1 flex items-center justify-center",children:v.jsx("span",{className:"text-xs text-warm-400",children:O("git.noFilesChanged")})}):v.jsx("div",{className:"flex-1 overflow-y-auto",children:s.map(A=>{const r=xC(A.status),u=w===A.path;return v.jsxs("div",{onClick:()=>S(A.path),className:`flex items-center gap-2 px-3 py-1.5 cursor-pointer text-xs hover:bg-warm-50/50 transition-colors ${u?"bg-accent/10 border-l-2 border-accent":""}`,children:[v.jsx("span",{className:`font-mono font-bold text-2xs w-3 shrink-0 ${r.color}`,children:r.label}),v.jsxs("span",{className:"truncate flex-1 text-warm-600",title:A.path,children:[A.path.split("/").pop(),v.jsx("span",{className:"text-warm-400 ml-1 text-2xs",children:A.path.includes("/")?A.path.substring(0,A.path.lastIndexOf("/")):""})]}),v.jsxs("span",{className:"shrink-0 text-2xs text-status-success",children:["+",A.additions]}),v.jsxs("span",{className:"shrink-0 text-2xs text-status-error",children:["-",A.deletions]})]},A.path)})})]})}function kC({diff:s,loading:h,selectedFile:w,fileHeaders:S}){const{t:M}=Tt(),[O,A]=j.useState(!0);return w?h?v.jsx("div",{className:"h-full flex items-center justify-center",children:v.jsx("span",{className:"text-xs text-warm-400",children:M("git.loadingDiff")})}):v.jsxs("div",{className:"h-full flex flex-col bg-[#1A1A1A]",children:[v.jsxs("div",{className:"px-3 py-2 border-b border-gray-700 shrink-0 flex items-center justify-between gap-2",children:[v.jsx("span",{className:"text-xs font-mono text-gray-100 truncate",title:w,children:w}),v.jsx("button",{onClick:()=>A(r=>!r),title:M("git.wrapLines")||"Wrap lines",className:`p-1 rounded-md shrink-0 hover:bg-gray-700 ${O?"text-accent":"text-gray-500"}`,children:v.jsx(vS,{size:14})})]}),v.jsx("div",{className:"flex-1 overflow-auto",children:v.jsx("div",{className:"p-3 font-mono text-xs leading-relaxed",children:s?(()=>{let r=0,u=0,d=!1;return s.split(`
|
|
421
|
+
`).map((g,l)=>{if(S&&g.startsWith("Index: "))return d=!1,v.jsx("div",{className:"mt-3 first:mt-0 mb-1 pb-1 border-b border-gray-700 font-semibold text-gray-100",children:g.slice(7)},l);if(g.startsWith("@@")){const p=/@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(g);return p&&(r=parseInt(p[1],10),u=parseInt(p[2],10),d=!0),null}if(!d)return null;let m="text-gray-200",b=null,C=null;if(g.startsWith("+")&&!g.startsWith("+++"))m="text-gray-100 bg-green-500/20",C=u++;else if(g.startsWith("-")&&!g.startsWith("---"))m="text-gray-100 bg-red-500/20",b=r++;else if(g.startsWith(" "))b=r++,C=u++;else return null;return v.jsxs("div",{className:`flex items-start ${m}`,children:[v.jsx("span",{className:"select-none shrink-0 w-9 pr-2 text-right text-gray-500",children:b??""}),v.jsx("span",{className:"select-none shrink-0 w-9 pr-2 text-right text-gray-500",children:C??""}),v.jsx("span",{className:`flex-1 min-w-0 ${O?"whitespace-pre-wrap break-words":"whitespace-pre"}`,children:g||" "})]},l)})})():v.jsx("span",{className:"text-gray-400 italic",children:"No changes"})})})]}):v.jsx("div",{className:"h-full flex items-center justify-center",children:v.jsx("span",{className:"text-sm text-warm-400",children:M("git.selectFileToViewDiff")})})}function EC({sessionId:s,onClose:h,projectId:w,onEvent:S,sendMessage:M}){const{t:O}=Tt(),[A,r]=j.useState([]),[u,d]=j.useState(!0),[g,l]=j.useState(null),[m,b]=j.useState(!1),[C,p]=j.useState(null),[o,c]=j.useState(""),[a,f]=j.useState(!1),[y,R]=j.useState(0),[k,D]=j.useState([]),[E,L]=j.useState(null),[z,H]=j.useState(!1),[P,I]=j.useState({from:null,now:null}),K=j.useRef(new Map),X=j.useCallback(()=>R(U=>U+1),[]);j.useEffect(()=>{if(!(!M||!w))return M({type:"git:watch",projectId:w}),()=>M({type:"git:unwatch",projectId:w})},[M,w]),j.useEffect(()=>{if(!(!S||!w))return S(U=>{U.type==="git:changed"&&U.projectId===w&&X()})},[S,w,X]),j.useEffect(()=>{let U=!1;return nC(s).then(T=>{U||D(T.snapshots??[])}).catch(()=>{U||D([])}),()=>{U=!0}},[s,y]),j.useEffect(()=>{let U=!1;return b(!0),iC(s,E??void 0).then(T=>{if(U)return;d(T.available),l(T.reason??null);const F=T.available&&T.files?T.files.map(B=>({path:B.path,status:B.status,additions:B.insertions,deletions:B.deletions})):[];r(F),K.current.clear(),I({from:E,now:T.now??null}),p(B=>B&&F.some(W=>W.path===B)?B:F.length>0?F[0].path:null)}).catch(()=>{U||(d(!1),l("error"),r([]))}).finally(()=>{U||b(!1)}),()=>{U=!0}},[s,E,y]),j.useEffect(()=>{if(!C){c("");return}const U=`${P.now??""}:${C}`,T=K.current.get(U);if(T!==void 0){c(T),f(!1);return}let F=!1;return f(!0),c(""),sC(s,C,P.from??void 0,P.now??void 0).then(B=>{if(F)return;const W=B.available&&B.diff?B.diff:"";K.current.set(U,W),c(W)}).catch(()=>{F||c("")}).finally(()=>{F||f(!1)}),()=>{F=!0}},[s,C,P]);const Y=j.useCallback(()=>{H(!0),rC(s).then(U=>{if(U.available&&U.snapshots){D(U.snapshots);const T=U.snapshots[U.snapshots.length-1];T&&L(T.sha)}}).catch(()=>{}).finally(()=>H(!1))},[s]),$=U=>{const T=new Date(U);return Number.isNaN(T.getTime())?U:T.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})};return v.jsxs("div",{className:"h-full flex flex-col bg-warm-50",children:[v.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-warm-100 shrink-0",children:[v.jsx("span",{className:"text-xs font-semibold text-warm-600",children:O("session.diff.title")||"Diff"}),v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx("button",{onClick:Y,disabled:z||!u,title:O("session.diff.capture")||"Capture snapshot",className:"p-1 rounded-md hover:bg-warm-100 text-warm-500 disabled:opacity-40",children:v.jsx(e1,{size:14,className:z?"animate-pulse":""})}),v.jsx("button",{onClick:X,title:O("common.refresh")||"Refresh",className:"p-1 rounded-md hover:bg-warm-100 text-warm-500",children:v.jsx(Av,{size:14,className:m?"animate-spin":""})}),v.jsx("button",{onClick:h,title:O("common.close")||"Close",className:"p-1 rounded-md hover:bg-warm-100 text-warm-500",children:v.jsx(Ri,{size:14})})]})]}),k.length>0&&v.jsxs("div",{className:"flex items-center gap-1 px-3 py-1.5 border-b border-warm-100 overflow-x-auto shrink-0",children:[v.jsx(jg,{active:E===null,onClick:()=>L(null),label:O("session.diff.pageStart")||"From start"}),k.map(U=>v.jsx(jg,{active:E===U.sha,onClick:()=>L(U.sha),label:`#${U.seq} ${$(U.at)}`},U.sha))]}),u?v.jsxs("div",{className:"flex-1 flex min-h-0",children:[v.jsx("div",{className:"w-2/5 min-w-[180px] max-w-[320px] border-r border-warm-100 overflow-hidden",children:v.jsx(CC,{files:A,loading:m,selectedFile:C,onFileClick:p})}),v.jsx("div",{className:"flex-1 min-w-0",children:v.jsx(kC,{diff:o,loading:a,selectedFile:C})})]}):v.jsx("div",{className:"flex-1 flex items-center justify-center px-4 text-center",children:v.jsx("span",{className:"text-xs text-warm-400",children:g==="not-git"?O("session.diff.notGit")||"Not a git repository":O("session.diff.unavailable")||"Diff unavailable"})})]})}function jg({active:s,onClick:h,label:w}){return v.jsx("button",{onClick:h,className:`px-2 py-0.5 rounded-md text-[11px] whitespace-nowrap shrink-0 ${s?"bg-warm-600 text-white":"bg-warm-100 text-warm-600 hover:bg-warm-200"}`,children:w})}const LC={presetId:u_},Ao=new Map,mr=new Map;function g_(s){return`sessionTheme:${s}`}window.addEventListener("storage",s=>{var S;if(s.storageArea!==localStorage||!((S=s.key)!=null&&S.startsWith("sessionTheme:")))return;const h=s.key.slice(13);Ao.delete(h);const w=mr.get(h);if(w){const M=vh(h);w.forEach(O=>O(M))}});function RC(s){return typeof s!="string"?!1:s==="custom"||s in oi}function vh(s){const h=Ao.get(s);if(h!==void 0)return h;let w=LC;try{const S=localStorage.getItem(g_(s));if(S!==null){const M=JSON.parse(S);M&&RC(M.presetId)&&(w={presetId:M.presetId,custom:M.custom&&typeof M.custom=="object"?M.custom:void 0})}}catch{}return Ao.set(s,w),w}function DC(s,h){const w=Ao.get(s);if(w&&w.presetId===h.presetId&&TC(w.custom,h.custom))return;Ao.set(s,h);try{localStorage.setItem(g_(s),JSON.stringify(h))}catch{}const S=mr.get(s);S&&S.forEach(M=>M(h))}function TC(s,h){return s===h?!0:!s||!h?!1:s.background===h.background&&s.foreground===h.foreground&&s.cursor===h.cursor&&s.selectionBackground===h.selectionBackground&&s.accent===h.accent}function MC(s){if(s.presetId!=="custom")return Rg(s.presetId).theme;const h=Rg(u_).theme,w=s.custom??{},S=w.cursor??w.accent??h.cursor;return{...h,background:w.background??h.background,foreground:w.foreground??h.foreground,cursor:S,cursorAccent:w.background??h.cursorAccent,selectionBackground:w.selectionBackground??h.selectionBackground,brightBlue:w.accent??h.brightBlue,blue:w.accent??h.blue}}function v_(s){const[h,w]=j.useState(()=>vh(s));j.useEffect(()=>{w(vh(s));let O=mr.get(s);return O||(O=new Set,mr.set(s,O)),O.add(w),()=>{const A=mr.get(s);A&&(A.delete(w),A.size===0&&mr.delete(s))}},[s]);const S=j.useCallback(O=>DC(s,O),[s]),M=j.useMemo(()=>MC(h),[h]);return[h,M,S]}function __({session:s,visible:h,intent:w,intentNonce:S,onClose:M,sendMessage:O,subscribeBinary:A,onEvent:r,onCycleTab:u,onSelectTab:d,remountKey:g=0}){const{t:l}=Tt(),m=s.status==="running"||w==="start"||w==="resume"?"pendingFit":"replay-only",[b,C]=j.useState(m),[p,o]=j.useState(null),[c,a]=j.useState(!1),[f,y]=j.useState(480),R=!!s.is_git_repo,k=j.useRef(null),D=j.useCallback(ye=>{ye.preventDefault();const Te=k.current;if(!Te)return;const ct=ze=>{const qe=Te.getBoundingClientRect(),Fe=240,Be=Math.max(Fe,qe.width-200);y(Math.min(Be,Math.max(Fe,qe.right-ze.clientX)))},it=()=>{window.removeEventListener("mousemove",ct),window.removeEventListener("mouseup",it),document.body.style.cursor="",document.body.style.userSelect=""};window.addEventListener("mousemove",ct),window.addEventListener("mouseup",it),document.body.style.cursor="col-resize",document.body.style.userSelect="none"},[]),[E,L]=j.useState(0),z=j.useCallback(()=>L(ye=>ye+1),[]),H=j.useRef(null),P=j.useRef(!1),I=j.useRef(S),[K,X]=j.useState(null),[Y,$]=j.useState(null),[U,T]=j.useState(!1),[F,B]=j.useState(null),[W,Z]=j.useState(null),ne=j.useRef(s.status==="running");j.useEffect(()=>{s.status==="running"&&b!=="subscribed"&&b!=="starting"&&b!=="pendingFit"&&(ne.current=!0,C("subscribed"))},[s.status,b]),j.useEffect(()=>{if(s.status==="running"||!ne.current||b!=="subscribed"&&b!=="stopping")return;const ye=setTimeout(()=>M(),300);return()=>clearTimeout(ye)},[s.status,b,M]);const ge=j.useCallback(async()=>{const ye=H.current;if(ye&&!P.current){P.current=!0,C("starting"),o(null),Z(null);try{const Te=await oC(s.id,ye,w==="resume"?{continueSession:!0}:void 0);C("subscribed"),Te.pendingInitialPrompt?(X(Te.pendingInitialPromptLength??0),$(null),T(!1)):(X(null),$(null))}catch(Te){const ct=Te instanceof Error?Te.message:String(Te);o(ct),C("error")}finally{P.current=!1}}},[s.id,w]),xe=j.useCallback(async()=>{if(U){T(!1);return}if(T(!0),Y===null)try{const ye=await aC(s.id);$(ye.prompt??"")}catch(ye){Z(ye instanceof Error?ye.message:String(ye))}},[U,Y,s.id]),J=j.useCallback(async()=>{if(!F){B("send"),Z(null);try{await lC(s.id),X(null),$(null),T(!1)}catch(ye){Z(ye instanceof Error?ye.message:String(ye))}finally{B(null)}}},[F,s.id]),G=j.useCallback(async()=>{if(!F){B("skip"),Z(null);try{await cC(s.id),X(null),$(null),T(!1)}catch(ye){Z(ye instanceof Error?ye.message:String(ye))}finally{B(null)}}},[F,s.id]);j.useEffect(()=>{if(S===I.current)return;I.current=S,(w==="start"||w==="resume")&&b==="replay-only"&&s.status!=="running"&&(H.current?ge():C("pendingFit"))},[S,w,b,s.status,ge]);const de=j.useCallback(()=>{H.current?ge():C("pendingFit")},[ge]),oe=j.useCallback((ye,Te)=>{H.current={cols:ye,rows:Te},b==="pendingFit"&&(s.status==="running"?(ne.current=!0,C("subscribed")):ge())},[b,ge,s.status]),Ae=s.status==="running",Oe=b==="subscribed",[Xe]=qv(s.id),[,We]=v_(s.id),rt=b==="starting"||b==="pendingFit"?v.jsxs("div",{style:{...tl,pointerEvents:"none"},children:[v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[v.jsx(lh,{size:14,style:{animation:"spin 1s linear infinite",color:Ce.dim}}),v.jsx("span",{style:{color:Ce.dim,fontFamily:_t,fontSize:12},children:l("session.starting")||"starting…"})]}),v.jsx("span",{style:{color:Ce.dim,fontFamily:_t,fontSize:10,marginTop:6},children:l("session.starting.typeAhead")||"type-ahead is captured and replayed once ready"})]}):b==="stopping"?v.jsx("div",{style:{...tl,pointerEvents:"none"},children:v.jsx("span",{style:{color:Ce.dim,fontFamily:_t,fontSize:12},children:l("session.stopping")||"stopping…"})}):b==="replay-only"?v.jsx("div",{style:tl,children:v.jsxs("button",{onClick:de,style:{display:"flex",alignItems:"center",gap:8,fontFamily:_t,fontSize:14,color:Ce.bright,background:"transparent",border:`1px solid ${Ce.separator}`,padding:"10px 22px",borderRadius:6,cursor:"pointer"},children:[v.jsx(tS,{size:16})," ",l("session.startInWindow")||"Start"]})}):b==="error"?v.jsxs("div",{style:tl,children:[v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,color:Ce.error,fontFamily:_t,fontSize:12,marginBottom:8},children:[v.jsx(kv,{size:14})," ",l("session.startFailed")||"failed to start"]}),p&&v.jsx("div",{style:{color:Ce.dim,fontFamily:_t,fontSize:11,marginBottom:8,maxWidth:360,textAlign:"center",wordBreak:"break-word"},children:p}),v.jsx("button",{onClick:()=>{ge()},style:{fontFamily:_t,fontSize:12,color:Ce.bright,background:"transparent",border:`1px solid ${Ce.separator}`,padding:"4px 12px",borderRadius:4,cursor:"pointer"},children:l("common.retry")||"Retry"})]}):null;return v.jsxs("div",{ref:k,style:{display:h?"flex":"none",flexDirection:"row",position:"absolute",inset:0,background:Ce.bg},children:[v.jsxs("div",{style:{position:"relative",flex:1,minWidth:0,height:"100%"},children:[v.jsx(pC,{sessionId:s.id,isRunning:Ae,subscribed:Oe,onFitted:oe,sendMessage:O,subscribeBinary:A,onEvent:r,fontSize:Xe,theme:We,inputBlocked:K!==null,autoFocusOnMount:h,onRequestRefresh:z,disableImagePaste:s.cli_tool==="raw-shell",onCycleTab:u,onSelectTab:d,onToggleDiff:()=>{R&&a(ye=>!ye)}},`${g}:${E}`),rt,R&&!c&&v.jsxs("button",{onClick:()=>a(!0),title:`${l("session.diff.title")||"Diff"} (${navigator.platform.startsWith("Mac")?"⌘":"Ctrl"}+Shift+D)`,style:{position:"absolute",top:4,right:8,zIndex:1002,display:"inline-flex",alignItems:"center",gap:4,fontFamily:_t,fontSize:10,color:Ce.dim,background:"rgba(20,20,28,0.7)",border:`1px solid ${Ce.separator}`,padding:"2px 8px",borderRadius:4,cursor:"pointer"},children:[v.jsx(k1,{size:12})," Diff"]}),K!==null&&v.jsxs("div",{style:AC,children:[v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[v.jsx(d1,{"aria-hidden":!0,size:14,style:{color:Ce.info}}),v.jsxs("span",{style:{flex:1},children:[l("session.initialPrompt.ready")||"Initial prompt ready",v.jsxs("span",{style:{color:Ce.dim,marginLeft:8},children:[K.toLocaleString()," chars"]}),v.jsx("div",{style:{color:Ce.warning,fontSize:10,marginTop:2},children:l("session.initialPrompt.blocked")||"Press Send or Skip before typing — keystrokes are ignored until then."})]}),v.jsxs("button",{onClick:xe,style:th("neutral"),title:U?l("session.initialPrompt.hidePreview")||"Hide preview":l("session.initialPrompt.preview")||"Preview",children:[U?v.jsx(Cv,{size:12}):v.jsx(Dh,{size:12}),U?l("session.initialPrompt.hidePreview")||"Hide":l("session.initialPrompt.preview")||"Preview"]}),v.jsxs("button",{onClick:J,disabled:F!==null,style:th("primary"),children:[F==="send"?v.jsx(lh,{size:12,style:{animation:"spin 1s linear infinite"}}):v.jsx(uS,{size:12}),l("session.initialPrompt.send")||"Send"]}),v.jsx("button",{onClick:G,disabled:F!==null,style:th("danger"),children:l("session.initialPrompt.skip")||"Skip"})]}),W&&v.jsx("div",{style:{color:Ce.error,fontSize:10,marginTop:4},children:W}),U&&v.jsx("pre",{style:{margin:0,marginTop:6,maxHeight:240,overflow:"auto",background:"rgba(0,0,0,0.4)",padding:8,fontFamily:_t,fontSize:10,color:Ce.bright,whiteSpace:"pre-wrap",wordBreak:"break-word",border:`1px solid ${Ce.separator}`,borderRadius:4},children:Y===null?l("session.initialPrompt.loading")||"loading…":Y})]})]}),R&&c&&v.jsxs(v.Fragment,{children:[v.jsx("div",{onMouseDown:D,style:{width:5,flexShrink:0,cursor:"col-resize",background:Ce.separator}}),v.jsx("div",{style:{width:f,flexShrink:0,minWidth:0,height:"100%"},children:v.jsx(EC,{sessionId:s.id,projectId:s.project_id,onEvent:r,sendMessage:O,onClose:()=>a(!1)})})]})]})}const AC={position:"absolute",top:0,left:0,right:0,background:"rgba(28,28,38,0.96)",borderBottom:`1px solid ${Ce.separator}`,borderLeft:`3px solid ${Ce.warning}`,padding:"8px 10px",color:Ce.bright,fontFamily:_t,fontSize:11,zIndex:3,display:"flex",flexDirection:"column"};function th(s){const h={display:"inline-flex",alignItems:"center",gap:4,fontFamily:_t,fontSize:10,padding:"3px 8px",borderRadius:4,cursor:"pointer",border:`1px solid ${Ce.separator}`,background:"transparent"};return s==="primary"?{...h,color:Ce.bright,borderColor:Ce.info,background:`${Ce.info}22`}:s==="danger"?{...h,color:Ce.dim}:{...h,color:Ce.bright}}const tl={position:"absolute",inset:0,background:"rgba(12,12,12,0.85)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",zIndex:1e3},Og=340;function jC({sessionId:s}){var C,p,o,c,a,f;const[h,,w]=v_(s),[S,M]=j.useState(!1),[O,A]=j.useState(!1),[r,u]=j.useState({top:0,left:0}),d=j.useRef(null),g=j.useRef(null),l=j.useCallback(()=>{if(!d.current)return;const y=d.current.getBoundingClientRect(),R=window.innerWidth,k=window.innerHeight,D=g.current;let E=y.bottom+4,L=y.right-Og;if(D){const z=D.offsetHeight,H=D.offsetWidth;L=y.right-H,L<8&&(L=8),L+H>R-8&&(L=R-8-H),E+z>k-8&&(E=Math.max(8,y.top-z-4))}else L<8&&(L=8);u({top:E,left:L}),A(!0)},[]);j.useEffect(()=>{if(!S){A(!1);return}l();const y=requestAnimationFrame(l),R=D=>{var L,z;const E=D.target;(L=d.current)!=null&&L.contains(E)||(z=g.current)!=null&&z.contains(E)||M(!1)},k=D=>{D.key==="Escape"&&M(!1)};return document.addEventListener("mousedown",R),document.addEventListener("keydown",k),window.addEventListener("scroll",l,!0),window.addEventListener("resize",l),()=>{cancelAnimationFrame(y),document.removeEventListener("mousedown",R),document.removeEventListener("keydown",k),window.removeEventListener("scroll",l,!0),window.removeEventListener("resize",l)}},[S,l]);const m=y=>{if(y==="custom"){const R=h.custom??{background:oi.default.theme.background,foreground:oi.default.theme.foreground,cursor:oi.default.theme.cursor,selectionBackground:oi.default.theme.selectionBackground,accent:oi.default.theme.brightBlue};w({presetId:"custom",custom:R})}else w({presetId:y,custom:h.custom}),M(!1)},b=y=>{const R={...h.custom??{},...y};w({presetId:"custom",custom:R})};return v.jsxs(v.Fragment,{children:[v.jsx("button",{ref:d,"data-no-drag":!0,onMouseDown:y=>y.stopPropagation(),onClick:()=>M(y=>!y),"aria-label":"terminal-theme",title:"Terminal theme (Ctrl+Shift+P)",style:{background:"transparent",border:"none",color:Ce.titleText,cursor:"pointer",padding:"0 6px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:0,flexShrink:0,height:"100%"},children:v.jsx(G1,{size:14})}),S&&zi.createPortal(v.jsxs("div",{ref:g,className:"z-tooltip",style:{position:"fixed",top:r.top,left:r.left,width:Og,background:"#1e1e1e",border:`1px solid ${Ce.separator}`,borderRadius:6,padding:10,fontFamily:_t,color:Ce.text,boxShadow:"0 8px 24px rgba(0,0,0,0.5)",opacity:O?1:0,transition:"opacity 80ms"},onMouseDown:y=>y.stopPropagation(),children:[v.jsx("div",{style:{fontSize:10,color:Ce.dim,marginBottom:6,letterSpacing:.5},children:"DARK"}),v.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:6,marginBottom:10},children:Lg.filter(y=>!oi[y].light).map(y=>v.jsx(Bg,{preset:oi[y],selected:h.presetId===y,onClick:()=>m(y)},y))}),v.jsx("div",{style:{fontSize:10,color:Ce.dim,marginBottom:6,letterSpacing:.5},children:"LIGHT"}),v.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:6,marginBottom:10},children:[Lg.filter(y=>oi[y].light).map(y=>v.jsx(Bg,{preset:oi[y],selected:h.presetId===y,onClick:()=>m(y)},y)),v.jsx(OC,{selected:h.presetId==="custom",accent:((C=h.custom)==null?void 0:C.accent)??oi.default.theme.brightBlue??"#569cd6",onClick:()=>m("custom")})]}),h.presetId==="custom"&&v.jsxs("div",{style:{borderTop:`1px solid ${Ce.separator}`,paddingTop:8},children:[v.jsx("div",{style:{fontSize:10,color:Ce.dim,marginBottom:6,letterSpacing:.5},children:"CUSTOM COLORS"}),v.jsx(yo,{label:"Background",value:((p=h.custom)==null?void 0:p.background)??oi.default.theme.background??"#0c0c0c",onChange:y=>b({background:y})}),v.jsx(yo,{label:"Foreground",value:((o=h.custom)==null?void 0:o.foreground)??oi.default.theme.foreground??"#cccccc",onChange:y=>b({foreground:y})}),v.jsx(yo,{label:"Cursor",value:((c=h.custom)==null?void 0:c.cursor)??oi.default.theme.cursor??"#f2f2f2",onChange:y=>b({cursor:y})}),v.jsx(yo,{label:"Selection",value:((a=h.custom)==null?void 0:a.selectionBackground)??oi.default.theme.selectionBackground??"#264f78",onChange:y=>b({selectionBackground:y})}),v.jsx(yo,{label:"Accent",value:((f=h.custom)==null?void 0:f.accent)??oi.default.theme.brightBlue??"#569cd6",onChange:y=>b({accent:y})})]})]}),document.body)]})}function Bg({preset:s,selected:h,onClick:w}){return v.jsxs("button",{onClick:w,style:{position:"relative",background:s.theme.background,border:`1px solid ${h?s.accent:Ce.separator}`,outline:h?`1px solid ${s.accent}`:"none",outlineOffset:-2,borderRadius:4,padding:"6px 8px",cursor:"pointer",fontFamily:_t,fontSize:10,color:s.theme.foreground,textAlign:"left",height:52,display:"flex",flexDirection:"column",justifyContent:"space-between",overflow:"hidden"},children:[v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[v.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:s.accent,flexShrink:0}}),v.jsx("span",{style:{fontWeight:600,fontSize:11,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s.name}),h&&v.jsx(Do,{size:12,style:{marginLeft:"auto",flexShrink:0}})]}),v.jsxs("div",{style:{fontSize:9,opacity:.85,fontFamily:_t},children:[v.jsx("span",{style:{color:s.theme.green},children:"$"})," ",v.jsx("span",{style:{color:s.theme.brightBlue},children:"ls"})]})]})}function OC({selected:s,accent:h,onClick:w}){return v.jsxs("button",{onClick:w,style:{position:"relative",background:"#0c0c0c",border:`1px dashed ${s?h:Ce.separator}`,outline:s?`1px solid ${h}`:"none",outlineOffset:-2,borderRadius:4,padding:"6px 8px",cursor:"pointer",fontFamily:_t,fontSize:10,color:Ce.text,textAlign:"left",height:52,display:"flex",flexDirection:"column",justifyContent:"space-between",overflow:"hidden"},children:[v.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[v.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:h,flexShrink:0}}),v.jsx("span",{style:{fontWeight:600,fontSize:11},children:"Custom"}),s&&v.jsx(Do,{size:12,style:{marginLeft:"auto",flexShrink:0}})]}),v.jsx("div",{style:{fontSize:9,opacity:.7},children:"edit colors"})]})}function yo({label:s,value:h,onChange:w}){const[S,M]=j.useState(h);j.useEffect(()=>{M(h)},[h]);const O=A=>{M(A);const r=A.startsWith("#")?A:`#${A}`;(/^#[0-9a-fA-F]{6}$/.test(r)||/^#[0-9a-fA-F]{3}$/.test(r))&&w(Ng(r))};return v.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,padding:"4px 0",fontSize:11,color:Ce.text},children:[v.jsx("span",{style:{flex:1},children:s}),v.jsx("input",{type:"text",value:S,onChange:A=>O(A.target.value),onBlur:()=>M(h),spellCheck:!1,style:{width:64,padding:"2px 4px",fontSize:10,fontFamily:_t,color:Ce.text,background:"transparent",border:`1px solid ${Ce.separator}`,borderRadius:3}}),v.jsx("input",{type:"color",value:Ng(h),onChange:A=>w(A.target.value),style:{width:28,height:22,padding:0,border:`1px solid ${Ce.separator}`,borderRadius:3,background:"transparent",cursor:"pointer"}})]})}function Ng(s){return/^#[0-9a-fA-F]{6}$/.test(s)?s.toLowerCase():/^#[0-9a-fA-F]{3}$/.test(s)?("#"+s.slice(1).split("").map(h=>h+h).join("")).toLowerCase():"#000000"}const zg=360;function BC({sessionId:s,sendMessage:h}){const[w,S]=j.useState(!1),[M,O]=j.useState(!1),[A,r]=j.useState({top:0,left:0}),[u,d]=j.useState(null),[g,l]=j.useState(""),[m,b]=j.useState(!1),[C,p]=j.useState(""),[o,c]=j.useState(""),[a,f]=j.useState(!1),[y,R]=j.useState(null),k=j.useRef(null),D=j.useRef(null),E=j.useRef(null),L=j.useCallback(()=>{if(!k.current)return;const X=k.current.getBoundingClientRect(),Y=window.innerWidth,$=window.innerHeight,U=D.current;let T=X.bottom+4,F=X.right-zg;if(U){const B=U.offsetHeight,W=U.offsetWidth;F=X.right-W,F<8&&(F=8),F+W>Y-8&&(F=Y-8-W),T+B>$-8&&(T=Math.max(8,X.top-B-4))}else F<8&&(F=8);r({top:T,left:F}),O(!0)},[]);j.useEffect(()=>{if(!w)return;let X=!1;return Uv().then(Y=>{X||d(Y)}).catch(Y=>{X||R(Y instanceof Error?Y.message:"Failed to load")}),()=>{X=!0}},[w]),j.useEffect(()=>{if(!w){O(!1);return}L();const X=requestAnimationFrame(L),Y=requestAnimationFrame(()=>{requestAnimationFrame(()=>{var T;return(T=E.current)==null?void 0:T.focus()})}),$=T=>{var B,W;const F=T.target;(B=k.current)!=null&&B.contains(F)||(W=D.current)!=null&&W.contains(F)||S(!1)},U=T=>{T.key==="Escape"&&S(!1)};return document.addEventListener("mousedown",$),document.addEventListener("keydown",U),window.addEventListener("scroll",L,!0),window.addEventListener("resize",L),()=>{cancelAnimationFrame(X),cancelAnimationFrame(Y),document.removeEventListener("mousedown",$),document.removeEventListener("keydown",U),window.removeEventListener("scroll",L,!0),window.removeEventListener("resize",L)}},[w,L]),j.useEffect(()=>{w||(l(""),b(!1),p(""),c(""),R(null))},[w]);const z=j.useMemo(()=>{if(!u)return[];const X=g.trim().toLowerCase();return X?u.filter(Y=>Y.name.toLowerCase().includes(X)||Y.command_template.toLowerCase().includes(X)):u},[u,g]),H=X=>{h({type:"session:terminal-input",sessionId:s,input:X.command_template}),S(!1)},P=X=>{X.key==="Enter"&&z.length>0&&(X.preventDefault(),H(z[0]))},I=!!C.trim()&&!!o.trim()&&!a,K=async()=>{if(I){f(!0),R(null);try{const X=await $v({name:C.trim(),command_template:o.trim()});d(Y=>Y?[X,...Y]:[X]),p(""),c(""),b(!1)}catch(X){R(X instanceof Error?X.message:"Failed")}finally{f(!1)}}};return v.jsxs(v.Fragment,{children:[v.jsx("button",{ref:k,"data-no-drag":!0,onMouseDown:X=>X.stopPropagation(),onClick:()=>S(X=>!X),"aria-label":"alias-inserter",title:"Insert saved command (alias) (Ctrl+Shift+A)",style:NC,children:v.jsx(g1,{size:14})}),w&&zi.createPortal(v.jsxs("div",{ref:D,className:"z-tooltip",style:{position:"fixed",top:A.top,left:A.left,width:zg,background:"#1e1e1e",border:`1px solid ${Ce.separator}`,borderRadius:6,padding:10,fontFamily:_t,color:Ce.text,boxShadow:"0 8px 24px rgba(0,0,0,0.5)",opacity:M?1:0,transition:"opacity 80ms"},onMouseDown:X=>X.stopPropagation(),children:[v.jsx("input",{ref:E,type:"text",value:g,onChange:X=>l(X.target.value),onKeyDown:P,placeholder:"Filter aliases… (Enter inserts first match)",style:{width:"100%",boxSizing:"border-box",background:"#0c0c0c",border:`1px solid ${Ce.separator}`,borderRadius:4,color:Ce.bright,fontFamily:_t,fontSize:11,padding:"6px 8px",outline:"none"}}),v.jsx("div",{style:{marginTop:8,maxHeight:280,overflowY:"auto"},children:u===null?v.jsx("div",{style:Hg,children:"Loading…"}):z.length===0?v.jsx("div",{style:Hg,children:u.length===0?"No aliases yet — add one below.":"No matches."}):z.map(X=>v.jsxs("button",{onClick:()=>H(X),style:zC,onMouseEnter:Y=>Y.currentTarget.style.background="rgba(255,255,255,0.06)",onMouseLeave:Y=>Y.currentTarget.style.background="transparent",title:`Insert: ${X.command_template}`,children:[v.jsx("span",{style:{fontSize:11,color:Ce.bright,fontWeight:600},children:X.name}),v.jsx("code",{style:{fontSize:10,color:Ce.dim,marginLeft:8,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:X.command_template})]},X.id))}),v.jsx("div",{style:{borderTop:`1px solid ${Ce.separator}`,marginTop:8,paddingTop:8},children:m?v.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[v.jsx("input",{type:"text",value:C,onChange:X=>p(X.target.value),placeholder:"Name (e.g. git status)",maxLength:64,style:Pg}),v.jsx("input",{type:"text",value:o,onChange:X=>c(X.target.value),onKeyDown:X=>{X.key==="Enter"&&(X.preventDefault(),K())},placeholder:"Command (e.g. git status -sb)",maxLength:1024,style:{...Pg,fontFamily:_t}}),y&&v.jsx("div",{style:{fontSize:10,color:"#f87171"},children:y}),v.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:6},children:[v.jsxs("button",{type:"button",onClick:()=>{b(!1),R(null)},style:b_,children:[v.jsx(Ri,{size:12})," Cancel"]}),v.jsx("button",{type:"button",onClick:K,disabled:!I,style:{...HC,opacity:I?1:.5},children:"Save"})]})]}):v.jsxs("button",{type:"button",onClick:()=>{b(!0),R(null)},style:PC,children:[v.jsx(Mn,{size:12})," New alias"]})})]}),document.body)]})}const NC={background:"transparent",border:"none",color:Ce.titleText,cursor:"pointer",padding:"0 6px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:0,flexShrink:0,height:"100%"},Hg={fontSize:11,color:Ce.dim,padding:"12px 4px",textAlign:"center"},zC={display:"flex",alignItems:"center",width:"100%",background:"transparent",border:"none",padding:"6px 8px",cursor:"pointer",textAlign:"left",borderRadius:3,transition:"background 80ms"},Pg={width:"100%",boxSizing:"border-box",background:"#0c0c0c",border:`1px solid ${Ce.separator}`,borderRadius:4,color:Ce.bright,fontSize:11,padding:"5px 7px",outline:"none"},b_={display:"inline-flex",alignItems:"center",gap:3,background:"transparent",border:`1px solid ${Ce.separator}`,color:Ce.dim,fontFamily:_t,fontSize:10,padding:"3px 8px",borderRadius:4,cursor:"pointer"},HC={...b_,background:"rgba(86,156,214,0.13)",border:"1px solid #569cd6",color:Ce.bright},PC={display:"inline-flex",alignItems:"center",gap:4,background:"transparent",border:"none",color:Ce.dim,fontFamily:_t,fontSize:11,padding:"4px 0",cursor:"pointer"};function IC({orientation:s,onDragStart:h,onDrag:w,onDragEnd:S}){const M=j.useCallback(A=>{if(A.button!==0)return;A.preventDefault(),A.stopPropagation();const r=A.clientX,u=A.clientY;h();let d=!1;const g=()=>{d||(d=!0,window.removeEventListener("mousemove",C),window.removeEventListener("mouseup",p),window.removeEventListener("blur",l),window.removeEventListener("keydown",m),document.removeEventListener("visibilitychange",b))},l=()=>{g(),S()},m=o=>{o.key==="Escape"&&l()},b=()=>{document.hidden&&l()},C=o=>{const c=s==="horizontal"?o.clientX-r:o.clientY-u;w(c)},p=()=>{g(),S()};window.addEventListener("mousemove",C),window.addEventListener("mouseup",p),window.addEventListener("blur",l),window.addEventListener("keydown",m),document.addEventListener("visibilitychange",b)},[s,h,w,S]),O=s==="horizontal";return v.jsx("div",{onMouseDown:M,style:{flex:"0 0 4px",background:Ce.separator,cursor:O?"col-resize":"row-resize",position:"relative",zIndex:1}})}function Fh(s){const{node:h,path:w,onSplitSizes:S,zoomPath:M,...O}=s;return h.kind==="stack"?v.jsx(Wh,{stack:h,path:w,...O}):v.jsx(FC,{split:h,path:w,onSplitSizes:S,zoomPath:M,stackProps:O})}const Ig=80;function FC({split:s,path:h,onSplitSizes:w,zoomPath:S,stackProps:M}){const O=s.orientation==="horizontal",A=j.useRef(null),r=j.useRef([]),u=j.useRef(null);return v.jsx("div",{ref:A,style:{display:"flex",flexDirection:O?"row":"column",flex:1,minWidth:0,minHeight:0},children:s.children.map((d,g)=>v.jsxs(j.Fragment,{children:[v.jsx("div",{ref:l=>{r.current[g]=l},style:{flex:S?"1 1 0%":`0 0 ${s.sizes[g]}%`,display:S&&S[h.length]!==g?"none":"flex",flexDirection:"column",minWidth:0,minHeight:0,overflow:"hidden"},children:v.jsx(Fh,{node:d,path:[...h,g],onSplitSizes:w,zoomPath:S,...M})}),!S&&g<s.children.length-1&&v.jsx(IC,{orientation:s.orientation,onDragStart:()=>{const l=A.current;if(!l)return;const m=s.sizes.slice();u.current={i:g,initialSizes:m,finalSizes:m.slice(),total:O?l.clientWidth:l.clientHeight}},onDrag:l=>{const m=u.current;if(!m||m.total<=0)return;const b=m.initialSizes[m.i]/100*m.total,C=m.initialSizes[m.i+1]/100*m.total,p=b+C,o=Math.max(Ig,Math.min(p-Ig,b+l)),c=p-o,a=o/m.total*100,f=c/m.total*100,y=r.current[m.i],R=r.current[m.i+1];y&&(y.style.flexBasis=`${a}%`),R&&(R.style.flexBasis=`${f}%`);const k=m.initialSizes.slice();k[m.i]=a,k[m.i+1]=f,m.finalSizes=k},onDragEnd:()=>{const l=u.current;l&&w(h,l.finalSizes),u.current=null}})]},g))})}const tt=28,Ut=68;function Dl(s,h,w){const S=s-w.x,M=h-w.y;if(S<0||M<0||S>w.w||M>w.h)return null;const O=S-w.w/2,A=M-w.h/2;return Math.abs(O)<=tt&&Math.abs(A)<=tt?"center":O>=-Ut-tt&&O<=-Ut+tt&&Math.abs(A)<=tt?"left":O>=Ut-tt&&O<=Ut+tt&&Math.abs(A)<=tt?"right":A>=-Ut-tt&&A<=-Ut+tt&&Math.abs(O)<=tt?"top":A>=Ut-tt&&A<=Ut+tt&&Math.abs(O)<=tt?"bottom":null}function bl(s,h){const w=document.elementsFromPoint(s,h);for(const S of w){const M=S.closest("[data-group-id][data-stack-path]");if(!M)continue;const O=M.dataset.stackPath||"",A=O===""?[]:O.split(".").map(Number),r=M.getBoundingClientRect(),u={x:r.left,y:r.top,w:r.width,h:r.height};return{groupId:M.dataset.groupId||"",path:A,rect:u,zone:Dl(s,h,u)}}return null}function UC(s,h){const w=s.w/2,S=s.h/2;switch(h){case"center":return s;case"left":return{x:s.x,y:s.y,w,h:s.h};case"right":return{x:s.x+w,y:s.y,w,h:s.h};case"top":return{x:s.x,y:s.y,w:s.w,h:S};case"bottom":return{x:s.x,y:s.y+S,w:s.w,h:S}}}const _h=Ut*2+12;function y_(s,h,w,S){const M=s-w/2,O=h-S/2;return Math.abs(M)<=tt&&Math.abs(O)<=tt?"max":M>=-Ut-tt&&M<=-Ut+tt&&Math.abs(O)<=tt?"left":M>=Ut-tt&&M<=Ut+tt&&Math.abs(O)<=tt?"right":O>=-Ut-tt&&O<=-Ut+tt&&Math.abs(M)<=tt?"top":O>=Ut-tt&&O<=Ut+tt&&Math.abs(M)<=tt?"bottom":O>=-_h-tt&&O<=-_h+tt&&Math.abs(M)<=tt?"popout":null}function w_(s,h,w,S,M){switch(s){case"left":return{x:M,y:0,w:h,h:S};case"right":return{x:w-h,y:0,w:h,h:S};case"top":return{x:M,y:0,w:w-M,h};case"bottom":return{x:M,y:S-h,w:w-M,h}}}function jo(s,h,w,S){if(s==="max")return{x:S,y:0,w:h-S,h:w};const M=Math.round(s==="left"||s==="right"?(h-S)/2:w/2);return w_(s,M,h,w,S)}function gr(){const s=document.querySelector("[data-app-sidebar]");return Math.max(0,s?s.getBoundingClientRect().right:0)}function S_({activeZone:s}){const h=window.innerWidth,w=window.innerHeight,S=h/2,M=w/2,O=s&&s!=="popout"?jo(s,h,w,gr()):null;return zi.createPortal(v.jsxs(v.Fragment,{children:[O&&v.jsx("div",{style:{position:"fixed",left:O.x,top:O.y,width:O.w,height:O.h,background:`${Ce.info}33`,border:`2px dashed ${Ce.info}`,borderRadius:8,pointerEvents:"none",zIndex:2400,transition:"left 80ms ease-out, top 80ms ease-out, width 80ms ease-out, height 80ms ease-out",boxSizing:"border-box"}}),v.jsxs("div",{style:{position:"fixed",inset:0,pointerEvents:"none",zIndex:2500},children:[v.jsx(ts,{offsetX:S-tt,offsetY:M-tt,active:s==="max",kind:"center"}),v.jsx(ts,{offsetX:S-Ut-tt,offsetY:M-tt,active:s==="left",kind:"left"}),v.jsx(ts,{offsetX:S+Ut-tt,offsetY:M-tt,active:s==="right",kind:"right"}),v.jsx(ts,{offsetX:S-tt,offsetY:M-Ut-tt,active:s==="top",kind:"top"}),v.jsx(ts,{offsetX:S-tt,offsetY:M+Ut-tt,active:s==="bottom",kind:"bottom"}),v.jsx(ts,{offsetX:S-tt,offsetY:M-_h-tt,active:s==="popout",kind:"popout"})]})]}),document.body)}function vr({targetRect:s,activeZone:h}){const w=s.x+s.w/2,S=s.y+s.h/2,M=h?UC(s,h):null;return zi.createPortal(v.jsxs(v.Fragment,{children:[M&&v.jsx("div",{style:{position:"fixed",left:M.x,top:M.y,width:M.w,height:M.h,background:`${Ce.info}33`,border:`2px dashed ${Ce.info}`,borderRadius:4,pointerEvents:"none",zIndex:2400,boxSizing:"border-box"}}),(()=>{const O=Ut+tt;return v.jsxs("div",{style:{position:"fixed",left:w-O,top:S-O,width:O*2,height:O*2,pointerEvents:"none",zIndex:2500},children:[v.jsx(ts,{offsetX:O-tt,offsetY:O-tt,active:h==="center",kind:"center"}),v.jsx(ts,{offsetX:O-Ut-tt,offsetY:O-tt,active:h==="left",kind:"left"}),v.jsx(ts,{offsetX:O+Ut-tt,offsetY:O-tt,active:h==="right",kind:"right"}),v.jsx(ts,{offsetX:O-tt,offsetY:O-Ut-tt,active:h==="top",kind:"top"}),v.jsx(ts,{offsetX:O-tt,offsetY:O+Ut-tt,active:h==="bottom",kind:"bottom"})]})})()]}),document.body)}function ts({offsetX:s,offsetY:h,active:w,kind:S}){const M=tt*2,O=w?Ce.info:"#3a3a3a",A=w?Ce.bright:Ce.separator;return v.jsx("div",{style:{position:"absolute",left:s,top:h,width:M,height:M,background:"#1a1a1a",border:`1px solid ${A}`,borderRadius:4,boxShadow:w?`0 0 8px ${Ce.info}`:"0 1px 3px rgba(0,0,0,0.4)",boxSizing:"border-box",overflow:"hidden"},children:v.jsx($C,{kind:S,fill:O})})}function $C({kind:s,fill:h}){const w={position:"absolute",background:h};switch(s){case"center":return v.jsx("div",{style:{...w,inset:4}});case"popout":return v.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:v.jsx(_r,{size:24,color:h})});case"left":return v.jsxs(v.Fragment,{children:[v.jsx("div",{style:{...w,left:4,top:4,bottom:4,width:"calc(50% - 4px)"}}),v.jsx("div",{style:{position:"absolute",right:4,top:4,bottom:4,width:"calc(50% - 4px)",border:`1px dashed ${h}`,boxSizing:"border-box"}})]});case"right":return v.jsxs(v.Fragment,{children:[v.jsx("div",{style:{position:"absolute",left:4,top:4,bottom:4,width:"calc(50% - 4px)",border:`1px dashed ${h}`,boxSizing:"border-box"}}),v.jsx("div",{style:{...w,right:4,top:4,bottom:4,width:"calc(50% - 4px)"}})]});case"top":return v.jsxs(v.Fragment,{children:[v.jsx("div",{style:{...w,top:4,left:4,right:4,height:"calc(50% - 4px)"}}),v.jsx("div",{style:{position:"absolute",bottom:4,left:4,right:4,height:"calc(50% - 4px)",border:`1px dashed ${h}`,boxSizing:"border-box"}})]});case"bottom":return v.jsxs(v.Fragment,{children:[v.jsx("div",{style:{position:"absolute",top:4,left:4,right:4,height:"calc(50% - 4px)",border:`1px dashed ${h}`,boxSizing:"border-box"}}),v.jsx("div",{style:{...w,bottom:4,left:4,right:4,height:"calc(50% - 4px)"}})]})}}function WC(s){const[h,w]=j.useState(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(s).matches);return j.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const S=window.matchMedia(s),M=O=>w(O.matches);return w(S.matches),S.addEventListener("change",M),()=>S.removeEventListener("change",M)},[s]),h}const il=320,sl=200,nl=80,rl=22,qC=4,Fg=8,sn=10,ol=60,GC=12;function nn(s,h,w){return Math.max(h,Math.min(w,s))}function YC(s,h,w,S){const M=s<=Fg,O=s>=w-Fg;if(!M&&!O)return null;const A=S/3,r=S*2/3;return M?h<A?"top-left":h>r?"bottom-left":"left":h<A?"top-right":h>r?"bottom-right":"right"}function Ug(s,h,w){const S=Math.round(h/2),M=Math.round(w/2);switch(s){case"left":return{x:0,y:0,w:S,h:w};case"right":return{x:h-S,y:0,w:S,h:w};case"top-left":return{x:0,y:0,w:S,h:M};case"top-right":return{x:h-S,y:0,w:S,h:M};case"bottom-left":return{x:0,y:w-M,w:S,h:M};case"bottom-right":return{x:h-S,y:w-M,w:S,h:M}}}function KC(s,h,w,S,M){let O=s,A=h;const r=O,u=O+w,d=A,g=A+S;for(const l of M){const m=l.x,b=l.x+l.w,C=l.y,p=l.y+l.h;d<p&&g>C&&(Math.abs(r-b)<=sn?O=b:Math.abs(u-m)<=sn?O=m-w:Math.abs(r-m)<=sn?O=m:Math.abs(u-b)<=sn&&(O=b-w)),r<b&&u>m&&(Math.abs(d-p)<=sn?A=p:Math.abs(g-C)<=sn?A=C-S:Math.abs(d-C)<=sn?A=C:Math.abs(g-p)<=sn&&(A=p-S))}return{x:O,y:A}}function XC({group:s,sessionsById:h,neighbors:w,isTopmost:S,zIndex:M,sendMessage:O,subscribeBinary:A,onEvent:r}){const{t:u}=Tt(),d=WC("(max-width: 767px)"),g=VC(),l=j.useRef(null),[m,b]=j.useState(!1),C=j.useRef(null),[p,o]=j.useState(null),c=j.useRef({x:s.x,y:s.y,w:s.w,h:s.h});c.current={x:s.x,y:s.y,w:s.w,h:s.h};const[a,f]=j.useState(null),y=j.useRef(null),[R,k]=j.useState(!1),[D,E]=j.useState(null),L=j.useRef(null),z=j.useRef(w);z.current=w;const[H,P]=j.useState(null),I=j.useRef(null),K=j.useCallback((ye,Te)=>{if(d||m||ye.button!==0||ye.target.closest("[data-no-drag]"))return;ye.preventDefault(),g.focus(Ft(s.root)[0]||"");const it=ye.clientX,ze=ye.clientY,qe={...c.current},Fe=l.current,Be=window.innerWidth,$e=window.innerHeight,lt=gr();let st=!1,St="";Te&&Fe&&(St=Fe.style.pointerEvents,Fe.style.pointerEvents="none");let Se=!1;const Ie=()=>{Se||(Se=!0,window.removeEventListener("mousemove",ee),window.removeEventListener("mouseup",be),window.removeEventListener("blur",le),window.removeEventListener("keydown",Ne),document.removeEventListener("visibilitychange",je),Te&&Fe&&(Fe.style.pointerEvents=St))},le=()=>{Ie(),I.current=null,P(null),y.current=null,f(null),L.current=null,E(null),k(!1),g.setGroupGeometry(s.id,{...c.current})},Ne=he=>{he.key==="Escape"&&le()},je=()=>{document.hidden&&le()};let ue=!1;const ee=he=>{if(ue)return;{const ce=window.screenX,_e=window.screenY,Ee=ce+window.outerWidth,Pe=_e+window.outerHeight;if(he.screenX<ce-ol||he.screenX>Ee+ol||he.screenY<_e-ol||he.screenY>Pe+ol){ue=!0,Ie(),I.current=null,P(null),y.current=null,f(null),L.current=null,E(null),k(!1),g.setGroupGeometry(s.id,{...c.current}),g.popOutGroup(s.id,{atScreenX:he.screenX,atScreenY:he.screenY});return}}const He=he.clientX-it,Me=he.clientY-ze;let Ge=nn(qe.x+He,-(qe.w-nl),Be-nl),se=nn(qe.y+Me,0,$e-rl);const V=z.current;if(V.length>0){const ce=KC(Ge,se,qe.w,qe.h,V);Ge=ce.x,se=ce.y}if(Fe&&(Fe.style.left=`${Ge}px`,Fe.style.top=`${se}px`),c.current.x=Ge,c.current.y=se,Te){let ce=null;const _e=document.elementFromPoint(he.clientX,he.clientY),Ee=_e==null?void 0:_e.closest("[data-group-id][data-stack-path]");if(Ee){const Pe=Ee.dataset.groupId||"";if(Pe!==s.id){const Ue=Ee.dataset.stackPath||"",ot=Ue===""?[]:Ue.split(".").map(Number),Ye=Ee.getBoundingClientRect(),ut={x:Ye.left,y:Ye.top,w:Ye.width,h:Ye.height};ce={groupId:Pe,path:ot,rect:ut,zone:Dl(he.clientX,he.clientY,ut)}}}I.current=ce,P(ce?{rect:ce.rect,zone:ce.zone}:null)}!st&&Math.hypot(he.clientX-it,he.clientY-ze)>=GC&&(st=!0,k(!0),s.dock&&g.setGroupDock(s.id,null));const ie=Te&&I.current&&I.current.zone,Q=ie||!st?null:y_(he.clientX,he.clientY,Be,$e);Q!==L.current&&(L.current=Q,E(Q));const ke=ie||Q?null:YC(he.clientX,he.clientY,Be,$e);ke!==y.current&&(y.current=ke,f(ke))},be=he=>{Ie(),k(!1);const He=L.current;if(L.current=null,E(null),Te&&I.current&&I.current.zone){const Ge=I.current;g.dockGroup(s.id,Ge.groupId,Ge.path,Ge.zone),I.current=null,P(null),y.current=null,f(null);return}if(He==="popout"){I.current=null,P(null),y.current=null,f(null),g.setGroupGeometry(s.id,{...c.current}),g.popOutGroup(s.id,{atScreenX:he.screenX,atScreenY:he.screenY});return}if(He&&He!=="max"){const Ge=jo(He,Be,$e,lt);Fe&&(Fe.style.left=`${Ge.x}px`,Fe.style.top=`${Ge.y}px`,Fe.style.width=`${Ge.w}px`,Fe.style.height=`${Ge.h}px`),c.current=Ge,I.current=null,P(null),y.current=null,f(null),g.setGroupDock(s.id,He);return}const Me=He?jo(He,Be,$e,lt):y.current?Ug(y.current,Be,$e):null;Me&&(Fe&&(Fe.style.left=`${Me.x}px`,Fe.style.top=`${Me.y}px`,Fe.style.width=`${Me.w}px`,Fe.style.height=`${Me.h}px`),c.current=Me,y.current=null,f(null)),I.current=null,P(null),g.setGroupGeometry(s.id,{...c.current})};window.addEventListener("mousemove",ee),window.addEventListener("mouseup",be),window.addEventListener("blur",le),window.addEventListener("keydown",Ne),document.addEventListener("visibilitychange",je)},[d,m,g,s.id,s.root,s.dock]),X=j.useCallback(ye=>K(ye,!1),[K]),Y=j.useCallback(ye=>K(ye,!0),[K]),$=j.useCallback(ye=>Te=>{if(d||m||Te.button!==0)return;Te.preventDefault(),Te.stopPropagation();const ct=Te.clientX,it=Te.clientY,ze={...c.current},qe=l.current,Fe=window.innerWidth,Be=window.innerHeight,$e=Ne=>{const je=Ne.clientX-ct,ue=Ne.clientY-it;let ee=ze.x,be=ze.y,he=ze.w,He=ze.h;ye.includes("e")?he=nn(ze.w+je,il,Math.max(il,Fe-ze.x)):ye.includes("w")&&(ee=nn(ze.x+je,0,ze.x+ze.w-il),he=ze.x+ze.w-ee),ye.includes("s")?He=nn(ze.h+ue,sl,Math.max(sl,Be-ze.y)):ye.includes("n")&&(be=nn(ze.y+ue,0,ze.y+ze.h-sl),He=ze.y+ze.h-be),qe&&(qe.style.left=`${ee}px`,qe.style.top=`${be}px`,qe.style.width=`${he}px`,qe.style.height=`${He}px`),c.current={x:ee,y:be,w:he,h:He}};let lt=!1;const st=()=>{lt||(lt=!0,window.removeEventListener("mousemove",$e),window.removeEventListener("mouseup",le),window.removeEventListener("blur",St),window.removeEventListener("keydown",Se),document.removeEventListener("visibilitychange",Ie))},St=()=>{st(),g.setGroupGeometry(s.id,{...c.current})},Se=Ne=>{Ne.key==="Escape"&&St()},Ie=()=>{document.hidden&&St()},le=()=>{st(),g.setGroupGeometry(s.id,{...c.current})};window.addEventListener("mousemove",$e),window.addEventListener("mouseup",le),window.addEventListener("blur",St),window.addEventListener("keydown",Se),document.addEventListener("visibilitychange",Ie)},[d,m,g,s.id]);j.useEffect(()=>{if(d||s.dock)return;const ye=()=>{const Te=window.innerWidth,ct=window.innerHeight,it=c.current,ze=nn(it.x,-(it.w-nl),Te-nl),qe=nn(it.y,0,ct-rl);(ze!==it.x||qe!==it.y)&&g.setGroupGeometry(s.id,{...it,x:ze,y:qe})};return window.addEventListener("resize",ye),()=>window.removeEventListener("resize",ye)},[d,g,s.id,s.dock]);const U=j.useCallback(ye=>{o(ye),g.setActiveTab(s.id,ye),g.focus(ye)},[g,s.id]),T=j.useCallback(ye=>{o(ye),g.focus(ye)},[g]),F=j.useCallback(ye=>{g.close(ye)},[g]),B=j.useCallback((ye,Te,ct)=>{g.beginTabDrag(s.id,ye,Te,ct)},[g,s.id]),W=j.useCallback(ye=>{g.close(ye)},[g]),Z=j.useCallback((ye,Te)=>{g.setSplitSizes(s.id,ye,Te)},[g,s.id]),ne=wr(s.root),ge=Ft(s.root);j.useEffect(()=>{p&&ge.includes(p)||o(ne[0]||ge[0]||null)},[p,ne,ge]);const[xe,J]=j.useState(null),G=xe&&s.root.kind==="split"?yr(s.root,xe):null,de=!!xe&&!G;j.useEffect(()=>{de&&J(null)},[de]);const oe=j.useCallback(()=>{if(m){const ye=C.current;ye&&g.setGroupGeometry(s.id,ye),C.current=null,b(!1);return}C.current={...c.current},s.dock&&g.setGroupDock(s.id,null),g.setGroupGeometry(s.id,{x:6,y:6,w:Math.max(il,window.innerWidth-12),h:Math.max(sl,window.innerHeight-12)}),b(!0)},[g,s.id,m,s.dock]),Ae=ye=>{const Te=/Mac|iPhone|iPad|iPod/.test(navigator.platform),ct=Te?ye.metaKey:ye.ctrlKey,it=Te?ye.ctrlKey:ye.metaKey;if(!ct||it||ye.altKey||!ye.shiftKey)return;const ze=ye.key.toLowerCase();if(ze==="o")ye.preventDefault(),g.popOutGroup(s.id);else if(ze==="m")ye.preventDefault(),g.minimizeGroup(s.id);else if(ze==="x")ye.preventDefault(),g.closeGroup(s.id);else if(ze==="z")ye.preventDefault(),s.root.kind==="split"?J(qe=>qe?null:p):oe();else if(ze.startsWith("arrow")){ye.preventDefault();const qe=p?yr(s.root,p):null,Fe=qe?Dx(s.root,qe,ze.slice(5)):null,Be=Fe?cn(s.root,Fe):null;if(!Fe||!Be||Be.kind!=="stack")return;T(Be.activeTab),xe&&J(Be.activeTab);const $e=`[data-stack-path="${Fe.join(".")}"] .xterm-helper-textarea`;requestAnimationFrame(()=>{var st,St;(St=Array.from(((st=l.current)==null?void 0:st.querySelectorAll($e))??[]).find(Se=>Se.offsetParent!==null))==null||St.focus()})}};if(d){const ye=ne[0],Te=ye?h.get(ye):null;if(!Te)return null;const ct=s.intents[ye]??{intent:"open",nonce:0};return zi.createPortal(v.jsxs("div",{style:{position:"fixed",inset:0,background:Ce.bg,display:"flex",flexDirection:"column",zIndex:110},children:[v.jsxs("div",{style:{background:Ce.titleBg,height:rl,display:"flex",alignItems:"center",borderBottom:`1px solid ${Ce.separator}`},children:[v.jsx("span",{style:{flex:1,color:Ce.titleText,fontFamily:_t,fontSize:12,paddingLeft:8,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Te.title}),v.jsx("button",{"data-no-drag":!0,onClick:()=>g.closeGroup(s.id),style:rn,"aria-label":"close",children:v.jsx(Ri,{size:14})})]}),v.jsx("div",{style:{flex:1,position:"relative",minHeight:0},children:v.jsx(__,{session:Te,visible:!0,intent:ct.intent,intentNonce:ct.nonce,onClose:()=>g.close(ye),sendMessage:O,subscribeBinary:A,onEvent:r})})]}),document.body)}const Oe=a?(()=>{const ye=window.innerWidth,Te=window.innerHeight,ct=Ug(a,ye,Te);return zi.createPortal(v.jsx("div",{style:{position:"fixed",left:ct.x,top:ct.y,width:ct.w,height:ct.h,background:`${Ce.info}33`,border:`2px dashed ${Ce.info}`,borderRadius:8,pointerEvents:"none",zIndex:2e3,transition:"left 80ms ease-out, top 80ms ease-out, width 80ms ease-out, height 80ms ease-out",boxSizing:"border-box"}}),document.body)})():null,Xe=(()=>{var Te;if(ge.length===0)return"";const ye=((Te=h.get(ge[0]))==null?void 0:Te.title)||ge[0];return ge.length===1?ye:`${ye} +${ge.length-1}`})(),We=s.root.kind==="split",rt=zi.createPortal(v.jsxs("div",{ref:l,onKeyDown:Ae,onMouseDown:We?()=>g.focus(ge[0]||""):Y,style:{position:"fixed",left:s.x,top:s.y,width:s.w,height:s.h,zIndex:M,background:Ce.bg,border:`1px solid ${S?Ce.info:Ce.separator}`,borderRadius:8,boxShadow:S?`0 10px 40px rgba(0,0,0,0.45), 0 2px 6px rgba(0,0,0,0.3), 0 0 0 1px ${Ce.info}66, 0 0 18px ${Ce.info}33`:"0 10px 40px rgba(0,0,0,0.45), 0 2px 6px rgba(0,0,0,0.3)",display:"flex",flexDirection:"column",overflow:"hidden",opacity:S?1:.88,filter:S?"none":"saturate(0.82)",transition:"box-shadow 120ms ease-out, border-color 120ms ease-out, opacity 140ms ease-out, filter 140ms ease-out"},children:[We&&v.jsxs("div",{onMouseDown:X,onDoubleClick:ye=>{ye.target.closest("button")||oe()},style:{height:rl,flexShrink:0,display:"flex",flexDirection:"column",background:Ce.titleBg,borderBottom:`1px solid ${Ce.separator}`,userSelect:"none",cursor:"move"},children:[v.jsx("div",{style:{display:"flex",height:qC,flexShrink:0},children:ne.map((ye,Te)=>v.jsx("div",{style:{flex:1,background:s.colors[ye]||Ce.titleText}},Te))}),v.jsxs("div",{style:{flex:1,display:"flex",alignItems:"center",padding:"0 4px 0 8px",color:Ce.titleText,fontFamily:_t,fontSize:11},children:[v.jsx("span",{style:{color:Ce.info,fontWeight:600,letterSpacing:1,marginRight:8},"aria-hidden":!0,children:">_"}),v.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Xe}),ge.length>1&&v.jsxs(v.Fragment,{children:[v.jsx("button",{"data-no-drag":!0,onMouseDown:ye=>ye.stopPropagation(),onClick:()=>g.applyLayoutPreset(s.id,"single"),style:rn,"aria-label":"single-pane",title:u("session.layout.single"),children:v.jsx(jv,{size:12})}),v.jsx("button",{"data-no-drag":!0,onMouseDown:ye=>ye.stopPropagation(),onClick:()=>g.applyLayoutPreset(s.id,"columns"),style:rn,"aria-label":"two-columns",title:u("session.layout.columns"),children:v.jsx(Lv,{size:14})}),v.jsx("button",{"data-no-drag":!0,onMouseDown:ye=>ye.stopPropagation(),onClick:()=>g.applyLayoutPreset(s.id,"grid"),style:rn,"aria-label":"grid-layout",title:u("session.layout.grid"),children:v.jsx(Tv,{size:14})})]}),v.jsx("button",{"data-no-drag":!0,onMouseDown:ye=>ye.stopPropagation(),onClick:oe,style:rn,"aria-label":"toggle-maximize",title:`${u(m?"session.restoreSize":"session.maximize")} · ${u("session.maximizeHint")}`,children:m?v.jsx(Th,{size:14}):v.jsx(El,{size:14})}),v.jsx("button",{"data-no-drag":!0,onMouseDown:ye=>ye.stopPropagation(),onClick:()=>g.popOutGroup(s.id),style:rn,"aria-label":"pop-out",title:`${u("session.popOut")||"Pop out to separate window"} (Ctrl+Shift+O)`,children:v.jsx(_r,{size:14})}),v.jsx("button",{"data-no-drag":!0,onClick:()=>g.minimizeGroup(s.id),style:rn,"aria-label":"minimize",title:`${u("session.minimize")||"Minimize"} (Ctrl+Shift+M)`,children:v.jsx(Mh,{size:14})}),v.jsx("button",{"data-no-drag":!0,onClick:()=>g.closeGroup(s.id),style:rn,"aria-label":"close",title:`${u("session.close")||"Close"} (Ctrl+Shift+X)`,children:v.jsx(Ri,{size:14})})]})]}),v.jsx("div",{style:{flex:1,display:"flex",minHeight:0,minWidth:0},children:s.root.kind==="split"?v.jsx(Fh,{node:s.root,path:[],groupId:s.id,sessionsById:h,colors:s.colors,intents:s.intents,onTabClick:U,onTabClose:F,onTabMouseDown:B,onPaneAutoClose:W,registerRect:()=>{},onSplitSizes:Z,zoomPath:G??void 0,sendMessage:O,subscribeBinary:A,onEvent:r,focusedSessionId:p||void 0,groupTopmost:S,onFocusStack:T}):v.jsx(Wh,{stack:s.root,path:[],groupId:s.id,sessionsById:h,colors:s.colors,intents:s.intents,onTabClick:U,onTabClose:F,onTabMouseDown:B,onPaneAutoClose:W,registerRect:()=>{},sendMessage:O,subscribeBinary:A,onEvent:r,focusedSessionId:p||void 0,groupTopmost:S,onFocusStack:T,groupActions:{onMinimizeGroup:()=>g.minimizeGroup(s.id),onCloseGroup:()=>g.closeGroup(s.id),onPopOutGroup:()=>g.popOutGroup(s.id),onToggleMaximize:oe,isMaximized:m,onApplyLayoutPreset:ye=>g.applyLayoutPreset(s.id,ye)}})}),v.jsx("div",{onMouseDown:$("n"),style:{position:"absolute",top:0,left:6,right:6,height:4,cursor:"ns-resize",zIndex:3}}),v.jsx("div",{onMouseDown:$("s"),style:{position:"absolute",bottom:0,left:6,right:6,height:4,cursor:"ns-resize",zIndex:3}}),v.jsx("div",{onMouseDown:$("w"),style:{position:"absolute",top:6,bottom:6,left:0,width:4,cursor:"ew-resize",zIndex:3}}),v.jsx("div",{onMouseDown:$("e"),style:{position:"absolute",top:6,bottom:6,right:0,width:4,cursor:"ew-resize",zIndex:3}}),v.jsx("div",{onMouseDown:$("nw"),style:{position:"absolute",top:0,left:0,width:10,height:10,cursor:"nwse-resize",zIndex:4}}),v.jsx("div",{onMouseDown:$("ne"),style:{position:"absolute",top:0,right:0,width:10,height:10,cursor:"nesw-resize",zIndex:4}}),v.jsx("div",{onMouseDown:$("sw"),style:{position:"absolute",bottom:0,left:0,width:10,height:10,cursor:"nesw-resize",zIndex:4}}),v.jsx("div",{onMouseDown:$("se"),title:"resize",style:{position:"absolute",right:0,bottom:0,width:14,height:14,cursor:"nwse-resize",background:"linear-gradient(135deg, transparent 50%, rgba(255,255,255,0.2) 50%)",zIndex:4}})]}),document.body);return v.jsxs(v.Fragment,{children:[rt,Oe,R&&!(H!=null&&H.zone)&&v.jsx(S_,{activeZone:D}),H&&v.jsx(vr,{targetRect:H.rect,activeZone:H.zone})]})}const rn={background:"transparent",border:"none",color:Ce.titleText,cursor:"pointer",padding:4,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:4},ih=["#3b82f6","#22c55e","#eab308","#ef4444","#a855f7","#06b6d4","#f97316","#ec4899"];function Ln(s){for(const h of ih)if(!s.includes(h))return h;return ih[s.length%ih.length]}const Uh=j.createContext(null),x_=j.createContext({}),C_=j.createContext({});function VC(){const s=j.useContext(Uh);if(!s)throw new Error("useSessionWindows must be used within SessionWindowsHost");return s}function Xk(){return j.useContext(x_)}function Vk(){return j.useContext(C_)}function JC(){return j.useContext(Uh)}const yl=720,$h=460,QC=320,ZC=200,$g=30,k_=80,E_=80,Eo=80,bh=28;function e2(s){const h=typeof window<"u"?window.innerWidth:1280,w=typeof window<"u"?window.innerHeight:800;let S=Number.isFinite(s.w)&&s.w>=QC?s.w:yl,M=Number.isFinite(s.h)&&s.h>=ZC?s.h:$h;S=Math.min(S,h),M=Math.min(M,w);let O=Number.isFinite(s.x)?s.x:k_,A=Number.isFinite(s.y)?s.y:E_;return O=Math.max(Math.min(O,h-Eo),-(S-Eo)),A=Math.max(Math.min(A,w-bh),0),{x:O,y:A,w:S,h:M}}const Wg=12,al=60;function L_(s){return`sessionGroups:${s}`}function Lo(s){try{const h=localStorage.getItem(L_(s));if(!h)return null;const w=JSON.parse(h);if(Array.isArray(w==null?void 0:w.groups)&&typeof(w==null?void 0:w.zCounter)=="number")return w}catch{}return null}function wl(s,h){try{localStorage.setItem(L_(s),JSON.stringify(h))}catch{}}function qg(s,h){const w=Lo(s);!w||!w.groups.some(S=>S.id===h)||(wl(s,{...w,groups:w.groups.filter(S=>S.id!==h)}),window.dispatchEvent(new CustomEvent("session-windows:changed")))}function t2(s,h,w){const S=Lo(s);!S||!S.groups.some(M=>M.id===h)||(wl(s,{...S,groups:S.groups.map(M=>M.id===h?{...M,...w}:M)}),window.dispatchEvent(new CustomEvent("session-windows:changed")))}function i2(s){const h=s%8;return{x:k_+h*$g,y:E_+h*$g,w:yl,h:$h}}function ll(s,h,w){return Math.max(h,Math.min(w,s))}function Gg(){return`g_${Math.random().toString(36).slice(2,10)}_${Date.now().toString(36)}`}function Ts(s,h){for(const w of s)if(yr(w.root,h))return w;return null}function Jk({projectId:s,sessions:h,sendMessage:w,subscribeBinary:S,onEvent:M,onAddSession:O,children:A}){const{t:r}=Tt(),{warning:u}=un(),{confirm:d}=kr(),{sendNotification:g}=Ll(),[l]=j.useState(()=>{const se=Lo(s);if(!se)return{groups:[],zCounter:0};const V=se.groups.map(ie=>{const Q=Ft(ie.root),ke=new Set(Q),ce={};for(const Ue of Object.keys(ie.colors||{}))ke.has(Ue)&&(ce[Ue]=ie.colors[Ue]);const _e={};for(const Ue of Q)_e[Ue]={intent:"open",nonce:0},ce[Ue]||(ce[Ue]=Ln(Object.values(ce)));const Ee=e2({x:ie.x,y:ie.y,w:ie.w,h:ie.h}),Pe=ie.ownerWindowId||gt;return{...ie,...Ee,colors:ce,intents:_e,minimized:!!ie.minimized,ownerWindowId:Pe}});return{groups:_g(V),zCounter:se.zCounter||V.length}}),[m,b]=j.useState(l.groups),C=j.useRef(l.zCounter),p=j.useRef(m);p.current=m;const o=j.useRef(h);o.current=h;const[c,a]=j.useState(null),f=j.useRef(null);f.current=c;const[y,R]=j.useState({}),k=j.useRef(y);k.current=y,j.useEffect(()=>{var Q;const se={},V=((Q=Lo(s))==null?void 0:Q.sessionProjects)??{},ie={};for(const ke of m)for(const ce of Ft(ke.root)){const _e=h.find(Pe=>Pe.id===ce)||y[ce];_e!=null&&_e.title&&(se[ce]=_e.title);const Ee=(_e==null?void 0:_e.project_id)||V[ce];Ee&&(ie[ce]=Ee)}wl(s,{groups:m,zCounter:C.current,titles:se,sessionProjects:ie}),window.dispatchEvent(new CustomEvent("session-windows:changed"))},[s,m,h,y]),j.useEffect(()=>()=>{var _e;const se=p.current;if(se.length===0)return;let V=!1;const ie=se.map(Ee=>(Ee.ownerWindowId||gt)!==gt||Ee.minimized?Ee:(V=!0,{...Ee,minimized:!0}));if(!V)return;const Q={},ke=((_e=Lo(s))==null?void 0:_e.sessionProjects)??{},ce={};for(const Ee of ie)for(const Pe of Ft(Ee.root)){const Ue=o.current.find(Ye=>Ye.id===Pe)||k.current[Pe];Ue!=null&&Ue.title&&(Q[Pe]=Ue.title);const ot=(Ue==null?void 0:Ue.project_id)||ke[Pe];ot&&(ce[Pe]=ot)}wl(s,{groups:ie,zCounter:C.current,titles:Q,sessionProjects:ce}),window.dispatchEvent(new CustomEvent("session-windows:changed"))},[s]),j.useEffect(()=>{const se=document.documentElement.style,V={left:0,right:0,top:0,bottom:0};for(const ie of m)!ie.dock||ie.minimized||(ie.ownerWindowId||gt)!==gt||(ie.dock==="left"?V.left=Math.max(V.left,ie.x+ie.w-gr()):ie.dock==="right"?V.right=Math.max(V.right,window.innerWidth-ie.x):ie.dock==="top"?V.top=Math.max(V.top,ie.y+ie.h):V.bottom=Math.max(V.bottom,window.innerHeight-ie.y));for(const ie of["left","right","top","bottom"])se.setProperty(`--dock-inset-${ie}`,`${Math.max(0,Math.round(V[ie]))}px`);return()=>{for(const ie of["left","right","top","bottom"])se.removeProperty(`--dock-inset-${ie}`)}},[m]),j.useEffect(()=>{const se=()=>{const Q=window.innerWidth,ke=window.innerHeight,ce=gr();b(_e=>{let Ee=!1;const Pe=_e.map(Ue=>{if(!Ue.dock)return Ue;const ot=Ue.dock==="left"||Ue.dock==="right"?Ue.w:Ue.h,Ye=w_(Ue.dock,ot,Q,ke,ce);return Ye.x===Ue.x&&Ye.y===Ue.y&&Ye.w===Ue.w&&Ye.h===Ue.h?Ue:(Ee=!0,{...Ue,...Ye})});return Ee?Pe:_e})};se();const V=document.querySelector("main"),ie=V?new ResizeObserver(se):null;return V&&ie&&ie.observe(V),window.addEventListener("resize",se),()=>{ie==null||ie.disconnect(),window.removeEventListener("resize",se)}},[]);const[D,E]=j.useState(()=>new Set),L=j.useRef(new Set);j.useEffect(()=>{if(h.length===0)return;const se=h.filter(ie=>ie.project_id===s);if(se.length===0)return;const V=new Set(se.map(ie=>ie.id));for(const ie of m)for(const Q of Ft(ie.root))V.has(Q)||y[Q]||D.has(Q)||L.current.has(Q)||(L.current.add(Q),l_(Q).then(ke=>R(ce=>({...ce,[Q]:ke}))).catch(ke=>{ke instanceof pl&&ke.status===404&&E(ce=>new Set(ce).add(Q))}).finally(()=>L.current.delete(Q)))},[m,h,s,y,D]),j.useEffect(()=>M(V=>{V.type!=="session:status-changed"||!V.sessionId||R(ie=>{const Q=ie[V.sessionId];if(!Q)return ie;const ke={status:V.status};return V.worktree_path!==void 0&&(ke.worktree_path=V.worktree_path),V.branch_name!==void 0&&(ke.branch_name=V.branch_name),{...ie,[Q.id]:{...Q,...ke}}})}),[M]),j.useEffect(()=>{D.size!==0&&b(se=>{let V=!1;const ie=[];for(const Q of se){const ke=Ft(Q.root);if(!ke.some(ot=>D.has(ot))){ie.push(Q);continue}V=!0;const ce=new Set(ke.filter(ot=>!D.has(ot))),_e=Qv(Q.root,ce);if(!_e)continue;const Ee=new Set(Ft(_e)),Pe={};for(const ot of Object.keys(Q.colors))Ee.has(ot)&&(Pe[ot]=Q.colors[ot]);const Ue={};for(const ot of Object.keys(Q.intents))Ee.has(ot)&&(Ue[ot]=Q.intents[ot]);ie.push({...Q,root:_e,colors:Pe,intents:Ue})}return V?ie:se})},[D]);const z=j.useCallback((se,V)=>{const ie=p.current.length,Q=i2(ie);C.current+=1;const ke=C.current;return{id:Gg(),...Q,z:ke,minimized:!1,root:ln([se],se),colors:{[se]:Ln([])},intents:{[se]:{intent:V,nonce:0}},ownerWindowId:gt}},[]),H=j.useCallback((se,V="open")=>{b(ie=>{const Q=Ts(ie,se);C.current+=1;const ke=C.current;return Q?ie.map(ce=>{var ot,Ye,ut;if(ce.id!==Q.id)return ce;const _e=((ot=ce.intents[se])==null?void 0:ot.intent)??"open",Ee=V==="start"||V==="resume",Pe=Ee?V:_e,Ue=Pe!==_e||Ee;return{...ce,z:ke,minimized:!1,root:Ki(ce.root,se),intents:{...ce.intents,[se]:{intent:Pe,nonce:Ue?(((Ye=ce.intents[se])==null?void 0:Ye.nonce)??0)+1:((ut=ce.intents[se])==null?void 0:ut.nonce)??0}}}}):[...ie,z(se,V)]})},[z]),P=j.useCallback(se=>{b(V=>{const ie=Ts(V,se);if(!ie)return V;const Q=V.reduce((ce,_e)=>_e.z>ce?_e.z:ce,0);if(ie.z===Q&&!ie.minimized)return V;C.current+=1;const ke=C.current;return V.map(ce=>ce.id===ie.id?{...ce,z:ke,minimized:!1}:ce)})},[]),I=j.useCallback(async se=>{const V=se.map(ie=>o.current.find(Q=>Q.id===ie)||k.current[ie]).filter(ie=>!!ie&&ie.status==="running");if(V.length===0)return!0;if(!await d({message:r("session.confirmStop"),danger:!0}))return!1;for(const ie of V)gh(ie.id).catch(()=>{});return!0},[r,d]),K=j.useCallback(async se=>{await I([se])&&b(V=>{const ie=Ts(V,se);if(!ie)return V;const Q=Dn(ie.root,se);if(!Q)return V.filter(_e=>_e.id!==ie.id);new Set(Ft(Q));const ke={...ie.colors};delete ke[se];const ce={...ie.intents};return delete ce[se],V.map(_e=>_e.id===ie.id?{..._e,root:Q,colors:ke,intents:ce}:_e)})},[I]),X=j.useCallback(se=>{b(V=>{const ie=Ts(V,se);return ie?V.map(Q=>Q.id===ie.id?{...Q,minimized:!0}:Q):V})},[]),Y=j.useCallback(se=>{b(V=>{const ie=Ts(V,se);if(!ie)return V;C.current+=1;const Q=C.current;return V.map(ke=>ke.id===ie.id?{...ke,minimized:!1,z:Q}:ke)})},[]),$=j.useCallback(se=>!!Ts(p.current,se),[]),U=j.useCallback(async se=>{const V=p.current.find(ie=>ie.id===se);V&&!await I(Ft(V.root))||b(ie=>ie.filter(Q=>Q.id!==se))},[I]),T=j.useCallback(se=>{b(V=>V.map(ie=>ie.id===se?{...ie,minimized:!0}:ie))},[]);j.useEffect(()=>{const se=ie=>{const Q=ie.detail;!(Q!=null&&Q.projectId)||!Q.groupId||Q.projectId===s&&b(ke=>{if(!ke.find(Ee=>Ee.id===Q.groupId))return ke;C.current+=1;const _e=C.current;return ke.map(Ee=>Ee.id===Q.groupId?{...Ee,minimized:!1,z:_e,root:Q.sessionId?Ki(Ee.root,Q.sessionId):Ee.root}:Ee)})},V=async ie=>{var _e;const Q=ie.detail;if(!(Q!=null&&Q.projectId)||!Q.groupId||Q.projectId!==s)return;const ke=p.current.find(Ee=>Ee.id===Q.groupId);if(ke&&!await I(Ft(ke.root)))return;const ce=(ke==null?void 0:ke.ownerWindowId)||gt;ce!==gt&&(Ae.current.delete(ce),it.current.delete(Q.groupId),(_e=oe.current)==null||_e.post({t:"group-reclaimed",popoutId:ce,groupIds:[Q.groupId],reason:"late-return"})),b(Ee=>Ee.filter(Pe=>Pe.id!==Q.groupId))};return window.addEventListener("session-windows:restore",se),window.addEventListener("session-windows:close",V),()=>{window.removeEventListener("session-windows:restore",se),window.removeEventListener("session-windows:close",V)}},[s,I]),j.useEffect(()=>{const se=sessionStorage.getItem("pendingSessionRestore");if(se)try{const V=JSON.parse(se);if(V.projectId!==s||!V.groupId)return;sessionStorage.removeItem("pendingSessionRestore"),b(ie=>{if(!ie.find(ce=>ce.id===V.groupId))return ie;C.current+=1;const ke=C.current;return ie.map(ce=>ce.id===V.groupId?{...ce,minimized:!1,z:ke,root:V.sessionId?Ki(ce.root,V.sessionId):ce.root}:ce)})}catch{}},[s]);const F=j.useCallback(se=>{b(V=>{if(!V.find(ke=>ke.id===se))return V;C.current+=1;const Q=C.current;return V.map(ke=>ke.id===se?{...ke,minimized:!1,z:Q}:ke)})},[]),B=j.useCallback((se,V)=>{b(ie=>ie.map(Q=>Q.id===se?{...Q,...V}:Q))},[]),W=j.useCallback((se,V)=>{b(ie=>ie.map(Q=>{if(Q.id===se){if(!V)return Q.dock?{...Q,dock:void 0}:Q;const ke=jo(V,window.innerWidth,window.innerHeight,gr());return{...Q,...ke,dock:V}}return V&&Q.dock===V?{...Q,dock:void 0}:Q}))},[]),Z=j.useCallback((se,V,ie)=>{b(Q=>Q.map(ke=>ke.id===se?{...ke,root:Jv(ke.root,V,ie)}:ke))},[]),ne=j.useCallback((se,V)=>{b(ie=>ie.map(Q=>Q.id===se?{...Q,root:Ki(Q.root,V)}:Q))},[]),ge=j.useCallback((se,V)=>{b(ie=>ie.map(Q=>Q.id===se?{...Q,root:Yv(Q.root,V)}:Q))},[]),xe=j.useCallback((se,V,ie)=>{b(Q=>Q.map(ke=>ke.id===se?{...ke,root:Vv(ke.root,V,ie)}:ke))},[]),J=j.useCallback((se,V,ie,Q)=>{if(Q.button!==0||!p.current.find(Ze=>Ze.id===se))return;Q.preventDefault();const ce=Q.clientX,_e=Q.clientY;let Ee=null;a({groupId:se,sessionId:V,fromPath:ie,startX:ce,startY:_e,mouseX:ce,mouseY:_e,hoveredGroupId:null,hoveredPath:null,hoveredRect:null,zone:null,viewportZone:null});const Pe=(Ze,fe)=>{const Ve=Gg();Ee=Ve;const ht=window.innerWidth,At=window.innerHeight,Jt={x:ll(Ze-60,-yl+Eo,ht-Eo),y:ll(fe-12,0,At-bh),w:yl,h:$h};b(jt=>{const ei=jt.find(Lt=>Lt.id===se);if(!ei)return jt;const $t=Dn(ei.root,V),li=ei.colors[V]||Ln([]),mi=ei.intents[V]??{intent:"open",nonce:0};C.current+=1;const _i=C.current,ns={id:Ve,...Jt,z:_i,minimized:!1,root:ln([V],V),colors:{[V]:li},intents:{[V]:mi},ownerWindowId:gt},ci=[];for(const Lt of jt)if(Lt.id===se){if($t){const Er=new Set(Ft($t)),Lr={};for(const bi of Object.keys(Lt.colors))Er.has(bi)&&(Lr[bi]=Lt.colors[bi]);const rs={};for(const bi of Object.keys(Lt.intents))Er.has(bi)&&(rs[bi]=Lt.intents[bi]);ci.push({...Lt,root:gl($t),colors:Lr,intents:rs})}}else ci.push(Lt);return ci.push(ns),ci})};let Ue=!1;const ot=Ze=>{const fe=window.screenX,Ve=window.screenY,ht=fe+window.outerWidth,At=Ve+window.outerHeight;return Ze.screenX<fe-al||Ze.screenX>ht+al||Ze.screenY<Ve-al||Ze.screenY>At+al},Ye=Ze=>{if(Ue)return;const fe=f.current;if(!fe)return;if(!Ee)Math.hypot(Ze.clientX-ce,Ze.clientY-_e)>=Wg&&Pe(Ze.clientX,Ze.clientY);else{const $t=window.innerWidth,li=window.innerHeight,mi=ll(Ze.clientX-60,-640,$t-Eo),_i=ll(Ze.clientY-12,0,li-bh);b(ns=>ns.map(ci=>ci.id===Ee?{...ci,x:mi,y:_i}:ci))}if(Ee&&ot(Ze)&&p.current.some($t=>$t.id===Ee)){const $t=ze.current;if($t){Ue=!0;const li=Ee;ft(),a(null),$t(li,{atScreenX:Ze.screenX,atScreenY:Ze.screenY});return}}let Ve=null,ht=null,At=null,Jt=null;const jt=document.elementsFromPoint(Ze.clientX,Ze.clientY);for(const $t of jt){const li=$t.closest("[data-group-id][data-stack-path]");if(!li)continue;const mi=li.dataset.groupId||"",_i=li.dataset.stackPath||"";if(Ee?mi===Ee:mi===fe.groupId&&_i===fe.fromPath.join("."))continue;const ci=_i===""?[]:_i.split(".").map(Number),Lt=li.getBoundingClientRect();Ve=mi,ht=ci,At={x:Lt.left,y:Lt.top,w:Lt.width,h:Lt.height},Jt=Dl(Ze.clientX,Ze.clientY,At);break}const ei=Jt||!Ee?null:y_(Ze.clientX,Ze.clientY,window.innerWidth,window.innerHeight);a({...fe,mouseX:Ze.clientX,mouseY:Ze.clientY,hoveredGroupId:Ve,hoveredPath:ht,hoveredRect:At,zone:Jt,viewportZone:ei})};let ut=!1;const ft=()=>{ut||(ut=!0,window.removeEventListener("mousemove",Ye),window.removeEventListener("mouseup",Nt),window.removeEventListener("blur",kt),window.removeEventListener("keydown",vt),document.removeEventListener("visibilitychange",Vt))},kt=()=>{ft(),a(null)},vt=Ze=>{Ze.key==="Escape"&&kt()},Vt=()=>{document.hidden&&kt()},Nt=Ze=>{var ht;ft();const fe=f.current;if(a(null),!fe)return;if(fe.hoveredGroupId&&fe.hoveredPath&&fe.zone){const At=Ee||fe.groupId;G(At,fe.sessionId,fe.hoveredGroupId,fe.hoveredPath,fe.zone);return}const Ve=fe.viewportZone;if(Ve&&Ee&&p.current.some(At=>At.id===Ee)){const At=Ee;if(Ve==="popout")(ht=ze.current)==null||ht.call(ze,At,{atScreenX:Ze.screenX,atScreenY:Ze.screenY});else if(Ve==="max"){const Jt=jo(Ve,window.innerWidth,window.innerHeight,gr());b(jt=>jt.map(ei=>ei.id===At?{...ei,x:Jt.x,y:Jt.y,w:Jt.w,h:Jt.h}:ei))}else W(At,Ve);return}};window.addEventListener("mousemove",Ye),window.addEventListener("mouseup",Nt),window.addEventListener("blur",kt),window.addEventListener("keydown",vt),document.addEventListener("visibilitychange",Vt)},[]),G=j.useCallback((se,V,ie,Q,ke)=>{b(ce=>{const _e=ce.find(vt=>vt.id===se),Ee=ce.find(vt=>vt.id===ie);if(!_e||!Ee)return ce;if(se===ie){const vt=cn(_e.root,Q);if(!vt||vt.kind!=="stack")return ce;const Vt=vt.tabs.find(Ve=>Ve!==V);if(!Vt)return ce;const Nt=Dn(_e.root,V);if(!Nt)return ce;const Ze=yr(Nt,Vt);if(!Ze)return ce;let fe;return ke==="center"?fe=pr(Nt,Ze,V):fe=ko(Nt,Ze,ke,ln([V])),fe=Ki(fe,V),ce.map(Ve=>Ve.id!==se?Ve:(C.current+=1,{...Ve,root:fe,z:C.current,minimized:!1}))}const Pe=Dn(_e.root,V),Ue=_e.colors[V],ot=_e.intents[V]??{intent:"open",nonce:0};let Ye;if(ke==="center")Ye=pr(Ee.root,Q,V);else{const vt=ln([V]);Ye=ko(Ee.root,Q,ke,vt)}Ye=Ki(Ye,V);const ut={...Ee.colors};ut[V]||(ut[V]=Ue||Ln(Object.values(ut)));const ft={...Ee.intents,[V]:ot},kt=[];for(const vt of ce)if(vt.id===se){if(Pe){const Vt=new Set(Ft(Pe)),Nt={};for(const fe of Object.keys(vt.colors))Vt.has(fe)&&(Nt[fe]=vt.colors[fe]);const Ze={};for(const fe of Object.keys(vt.intents))Vt.has(fe)&&(Ze[fe]=vt.intents[fe]);kt.push({...vt,root:Pe,colors:Nt,intents:Ze})}}else vt.id===ie?(C.current+=1,kt.push({...vt,root:Ye,colors:ut,intents:ft,z:C.current,minimized:!1})):kt.push(vt);return kt})},[]),de=j.useCallback((se,V,ie,Q)=>{b(ke=>{if(se===V)return ke;const ce=ke.find(ut=>ut.id===se),_e=ke.find(ut=>ut.id===V);if(!ce||!_e||ce.root.kind!=="stack")return ke;const Ee=ce.root;let Pe;Q==="center"?Pe=Ee.tabs.reduce((ut,ft)=>pr(ut,ie,ft),_e.root):Pe=ko(_e.root,ie,Q,Ee),Pe=Ki(Pe,Ee.activeTab);const Ue={..._e.colors,...ce.colors},ot={..._e.intents,...ce.intents},Ye=[];for(const ut of ke)ut.id!==se&&(ut.id===V?(C.current+=1,Ye.push({...ut,root:Pe,colors:Ue,intents:ot,z:C.current,minimized:!1})):Ye.push(ut));return Ye})},[]),oe=j.useRef(null),Ae=j.useRef(new Map),[Oe,Xe]=j.useState(null),We=j.useRef(Oe);We.current=Oe;const rt=j.useRef(null),ye=j.useRef(typeof document<"u"&&document.hasFocus()?Date.now():0),[Te,ct]=j.useState(()=>typeof document<"u"&&document.hasFocus());j.useEffect(()=>{const se=()=>{ye.current=Date.now(),ct(!0)},V=()=>ct(!1);window.addEventListener("focus",se),window.addEventListener("blur",V);const ie=e_();return()=>{window.removeEventListener("focus",se),window.removeEventListener("blur",V),ie(),rt.current&&clearTimeout(rt.current)}},[]);const it=j.useRef(new Map),ze=j.useRef(null),qe=j.useCallback((se,V)=>{var Ye;const ie=p.current.find(ut=>ut.id===se);if(!ie)return;const Q=Bx(),ke={...ie,ownerWindowId:Q,dock:void 0};it.current.set(se,ke),Ae.current.set(Q,Date.now()),b(ut=>ut.map(ft=>ft.id===se?{...ft,ownerWindowId:Q,dock:void 0}:ft)),(Ye=oe.current)==null||Ye.post({t:"group-handoff",to:Q,groupId:se,group:ke});const ce=V&&(typeof V.atScreenX=="number"||typeof V.atScreenY=="number"),_e=ce?Math.max(0,((V==null?void 0:V.atScreenX)??window.screenX+ie.x)-40):Math.max(0,window.screenX+ie.x),Ee=ce?Math.max(0,((V==null?void 0:V.atScreenY)??window.screenY+ie.y)-12):Math.max(0,window.screenY+ie.y),Pe=["popup",`width=${Math.max(400,ie.w)}`,`height=${Math.max(300,ie.h+40)}`,`left=${_e}`,`top=${Ee}`].join(","),Ue=`/popout/${encodeURIComponent(s)}/${encodeURIComponent(se)}?wid=${encodeURIComponent(Q)}`,ot=window.open(Ue,"_blank",Pe);if(!ot){it.current.delete(se),Ae.current.delete(Q),b(ut=>ut.map(ft=>ft.id===se?{...ft,ownerWindowId:gt}:ft)),u(r("session.popout.blocked"));return}jx(Q,ot)},[s,r,u]);ze.current=qe;const Fe=j.useCallback(se=>{var Q;const V=p.current.find(ke=>ke.id===se);if(!V)return;const ie=V.ownerWindowId||gt;if(ie===gt){F(se);return}(Q=oe.current)==null||Q.post({t:"group-recall",popoutId:ie,groupId:se}),setTimeout(()=>{var _e;const ke=p.current.find(Ee=>Ee.id===se);if(!ke||(ke.ownerWindowId||gt)===gt)return;Ae.current.delete(ie),it.current.delete(se),(_e=oe.current)==null||_e.post({t:"group-reclaimed",popoutId:ie,groupIds:[se],reason:"late-return"}),C.current+=1;const ce=C.current;b(Ee=>Ee.map(Pe=>Pe.id===se?{...Pe,ownerWindowId:gt,minimized:!1,z:ce}:Pe))},1500)},[F]),Be=j.useCallback(se=>{const V=Ts(p.current,se);V&&Fe(V.id)},[Fe]);j.useEffect(()=>{const se=V=>{const ie=V.detail;!(ie!=null&&ie.projectId)||!ie.groupId||ie.projectId!==s||Fe(ie.groupId)};return window.addEventListener("session-windows:recall",se),()=>window.removeEventListener("session-windows:recall",se)},[s,Fe]),j.useEffect(()=>{const se=sessionStorage.getItem("pendingSessionRecall");if(se)try{const V=JSON.parse(se);if(V.projectId!==s||!V.groupId)return;sessionStorage.removeItem("pendingSessionRecall");const ie=V.groupId;setTimeout(()=>Fe(ie),0)}catch{}},[s,Fe]);const $e=j.useCallback(se=>se.kind==="stack"?[]:[0,...$e(se.children[0])],[]),lt=j.useCallback((se,V,ie)=>{const Q=V?p.current.find(Ee=>Ee.id===V):null,ke=Q&&(Q.ownerWindowId||gt)===gt;if(!Q||!ke){H(se,"start");return}const ce=(()=>{if(ie){const Ee=cn(Q.root,ie);if(Ee&&Ee.kind==="stack")return ie}return $e(Q.root)})();C.current+=1;const _e=C.current;b(Ee=>Ee.map(Pe=>{if(Pe.id!==Q.id)return Pe;const Ue=Ki(pr(Pe.root,ce,se),se);return{...Pe,root:Ue,z:_e,minimized:!1,colors:{...Pe.colors,[se]:Ln(Object.values(Pe.colors))},intents:{...Pe.intents,[se]:{intent:"start",nonce:0}}}}))},[H,$e]),st=j.useCallback(async(se,V)=>{const ie=new Date,Q=String(ie.getHours()).padStart(2,"0"),ke=String(ie.getMinutes()).padStart(2,"0"),ce=String(ie.getSeconds()).padStart(2,"0"),_e=await Eg(s,{title:`Shell ${Q}:${ke}:${ce}`,cli_tool:"raw-shell",use_worktree:!1,memory_inject_mode:"none"});return O==null||O(_e),lt(_e.id,se,V),_e.id},[s,O,lt]);j.useEffect(()=>{const se=Bh();oe.current=se;const V=Q=>{var ke;if(Q.t==="hello"){const ce=it.current.get(Q.groupId);if(ce&&ce.ownerWindowId===Q.from)se.post({t:"group-handoff",to:Q.from,groupId:Q.groupId,group:ce});else{const _e=p.current.find(Ee=>Ee.id===Q.groupId);_e&&_e.ownerWindowId===Q.from&&se.post({t:"group-handoff",to:Q.from,groupId:Q.groupId,group:_e})}}else if(Q.t==="group-return"||Q.t==="bye")if(Q.t==="group-return"){const ce=Q.group;ce&&ce.id===Q.groupId&&(it.current.delete(Q.groupId),Ae.current.delete(Q.from),Q.projectId&&Q.projectId!==s&&qg(Q.projectId,Q.groupId),b(_e=>{const Ee={...ce,ownerWindowId:gt,dock:void 0};return _g([..._e.filter(Pe=>Pe.id!==Q.groupId),Ee])}))}else Ae.current.delete(Q.from),b(ce=>ce.map(_e=>_e.ownerWindowId===Q.from?{..._e,ownerWindowId:gt}:_e));else if(Q.t==="group-close")it.current.delete(Q.groupId),Q.projectId&&Q.projectId!==s&&qg(Q.projectId,Q.groupId),b(ce=>ce.filter(_e=>_e.id!==Q.groupId));else if(Q.t==="heartbeat")Ae.current.set(Q.from,Date.now());else if(Q.t==="group-update"){const ce=Q.patch;Q.projectId&&Q.projectId!==s&&t2(Q.projectId,Q.groupId,ce),b(_e=>_e.map(Ee=>Ee.id===Q.groupId?{...Ee,...ce}:Ee))}else if(Q.t==="dock-probe"){if(document.visibilityState!=="visible")return;const ce=vl(Q.x,Q.y),_e=_l(ce)?bl(ce.x,ce.y):null;if(_e){const Ee=We.current;(!Ee||Ee.zone!==_e.zone||Ee.groupId!==_e.groupId||Ee.path.join(".")!==_e.path.join("."))&&Xe({rect:_e.rect,zone:_e.zone,path:_e.path,groupId:_e.groupId}),rt.current&&clearTimeout(rt.current),rt.current=setTimeout(()=>Xe(null),800);const Pe=An();se.post({t:"dock-probe-result",from:gt,to:Q.from,hit:!0,focusAt:ye.current,rect:{...i_(_e.rect.x,_e.rect.y),w:_e.rect.w*Pe,h:_e.rect.h*Pe},zone:_e.zone})}else We.current&&Xe(null),se.post({t:"dock-probe-result",from:gt,to:Q.from,hit:!1,focusAt:ye.current})}else if(Q.t==="dock-end")Xe(null);else if(Q.t==="dock-commit"&&Q.to===gt){const ce=vl(Q.x,Q.y),_e=_l(ce)?bl(ce.x,ce.y):null,Ee=_e&&_e.zone?_e:(ke=We.current)!=null&&ke.zone?We.current:null;let Pe=!1;const Ue=Q.sessions.map(Ye=>Ye.id),ot=p.current.filter(Ye=>(Ye.ownerWindowId||gt)===gt);if(Ee&&Ee.zone&&!Ue.some(Ye=>Ts(ot,Ye))){const Ye=p.current.find(ft=>ft.id===Ee.groupId),ut=Ye?cn(Ye.root,Ee.path):null;if(Ye&&ut&&ut.kind==="stack"){Pe=!0;const ft=Ee.zone,kt=Ee.path;C.current+=1;const vt=C.current;b(Vt=>Vt.map(Nt=>{if(Nt.id!==Ye.id)return Nt;const Ze=Xv(Nt.root,kt,ft,Ue,Q.activeId),fe={...Nt.colors},Ve={...Nt.intents};for(const ht of Q.sessions)fe[ht.id]||(fe[ht.id]=ht.color||Ln(Object.values(fe))),Ve[ht.id]=ht.intentInfo??{intent:"open",nonce:0};return{...Nt,root:Ze,colors:fe,intents:Ve,z:vt,minimized:!1}}))}}Xe(null),se.post({t:"dock-commit-ack",from:gt,to:Q.from,commitId:Q.commitId,accepted:Pe})}},ie=se.subscribe(V);return()=>{ie(),se.close(),oe.current=null}},[s]),j.useEffect(()=>{const se=Date.now();for(const V of l.groups)V.ownerWindowId&&V.ownerWindowId!==gt&&Ae.current.set(V.ownerWindowId,se)},[]),j.useEffect(()=>{const se=async()=>{var Ee;const ie=Date.now(),Q=[];for(const[Pe,Ue]of Ae.current.entries())ie-Ue>Zv&&Q.push(Pe);if(Q.length===0)return;const ke=await s_(),ce=Q.filter(Pe=>ke.has(Pe)?(Ae.current.set(Pe,ie),!1):!0);if(ce.length===0)return;for(const Pe of ce)Ae.current.delete(Pe);const _e=new Set(ce);for(const Pe of p.current)Pe.ownerWindowId&&_e.has(Pe.ownerWindowId)&&it.current.delete(Pe.id);for(const Pe of ce){const Ue=p.current.filter(ot=>ot.ownerWindowId===Pe).map(ot=>ot.id);Ue.length>0&&((Ee=oe.current)==null||Ee.post({t:"group-reclaimed",popoutId:Pe,groupIds:Ue,reason:"heartbeat-timeout"}))}b(Pe=>Pe.map(Ue=>Ue.ownerWindowId&&ce.includes(Ue.ownerWindowId)?{...Ue,ownerWindowId:gt}:Ue))},V=setInterval(()=>{se()},Nh);return()=>clearInterval(V)},[]);const St=j.useCallback((se,V)=>{w({type:"session:terminal-input",sessionId:se,input:V})},[w]),Se=j.useCallback(()=>{var ie,Q;const se=p.current.filter(ke=>(ke.ownerWindowId||gt)===gt).slice().sort((ke,ce)=>ce.z-ke.z),V=[];for(const ke of se)for(const ce of Ft(ke.root)){const _e=((ie=o.current.find(Ee=>Ee.id===ce))==null?void 0:ie.title)||((Q=k.current[ce])==null?void 0:Q.title)||ce;V.push({sessionId:ce,label:_e})}return V},[]),Ie=j.useCallback(async(se,V)=>{const Q=p.current.filter(ce=>!ce.minimized&&(ce.ownerWindowId||gt)===gt).reduce((ce,_e)=>ce&&ce.z>=_e.z?ce:_e,null),ke=await Eg(s,{title:V||"",description:se,use_worktree:!1,memory_inject_mode:"none"});O==null||O(ke),lt(ke.id,(Q==null?void 0:Q.id)??null)},[s,O,lt]),le=j.useMemo(()=>({openOrFocus:H,close:K,focus:P,minimize:X,restore:Y,isOpen:$,recallPopout:Be,closeGroup:U,minimizeGroup:T,restoreGroup:F,setGroupGeometry:B,setGroupDock:W,setSplitSizes:Z,setActiveTab:ne,applyLayoutPreset:ge,reorderTab:xe,beginTabDrag:J,dockGroup:de,popOutGroup:qe,createRawShellTab:st,sendToSession:St,listOpenTerminals:Se,sendToNewTerminal:Ie}),[H,K,P,X,Y,$,Be,U,T,F,B,W,Z,ne,ge,xe,J,de,qe,st,St,Se,Ie]),Ne=j.useMemo(()=>{const se={};for(const V of m){const Q=(V.ownerWindowId||gt)!==gt?"popped":V.minimized?"minimized":"floating";for(const ke of Ft(V.root))se[ke]=Q}return se},[m]),je=j.useMemo(()=>{const se={};for(const V of m)for(const ie of Ft(V.root))se[ie]=V.id;return se},[m]);j.useEffect(()=>{const se=V=>{const ie=/Mac|iPhone|iPad|iPod/.test(navigator.platform),Q=ie?V.metaKey:V.ctrlKey,ke=ie?V.ctrlKey:V.metaKey;if(!Q||ke||V.altKey||V.shiftKey||V.key.toLowerCase()!=="t")return;V.preventDefault();const _e=p.current.filter(Ee=>!Ee.minimized&&(Ee.ownerWindowId||gt)===gt).reduce((Ee,Pe)=>Ee&&Ee.z>=Pe.z?Ee:Pe,null);st((_e==null?void 0:_e.id)??null).catch(()=>{})};return window.addEventListener("keydown",se),()=>window.removeEventListener("keydown",se)},[st]);const ue=j.useMemo(()=>{const se=new Map;for(const V of Object.values(y))se.set(V.id,V);for(const V of h)se.set(V.id,V);return se},[h,y]),ee=m.filter(se=>!se.minimized&&(se.ownerWindowId||gt)===gt),be=ee.reduce((se,V)=>V.z>se.z?{id:V.id,z:V.z}:se,{id:null,z:-1/0}).id,he=ee.find(se=>se.id===be),He=Te&&he?wr(he.root).join(","):"",Me=j.useMemo(()=>new Set(He?He.split(","):[]),[He]),Ge=Ph(M,Me,(se,V)=>{var Q;const ie=Ts(p.current,se);!ie||ie.minimized||(ie.ownerWindowId||gt)!==gt||g(r(V==="blocked"?"notification.sessionBlocked":"notification.sessionDone"),((Q=ue.get(se))==null?void 0:Q.title)||se,()=>H(se))});return v.jsx(Uh.Provider,{value:le,children:v.jsx(x_.Provider,{value:Ne,children:v.jsx(C_.Provider,{value:je,children:v.jsxs(Hh.Provider,{value:Ge,children:[A,(()=>{const se=new Map(ee.slice().sort((V,ie)=>V.z-ie.z).map((V,ie)=>[V.id,ie+1]));return ee.map(V=>{const ie=ee.filter(Q=>Q.id!==V.id).map(({x:Q,y:ke,w:ce,h:_e})=>({x:Q,y:ke,w:ce,h:_e}));return v.jsx(XC,{group:V,sessionsById:ue,neighbors:ie,isTopmost:V.id===be,zIndex:se.get(V.id)??1,sendMessage:w,subscribeBinary:S,onEvent:M},V.id)})})(),c&&c.hoveredRect&&v.jsx(vr,{targetRect:c.hoveredRect,activeZone:c.zone}),c&&!c.zone&&Math.hypot(c.mouseX-c.startX,c.mouseY-c.startY)>=Wg&&v.jsx(S_,{activeZone:c.viewportZone}),Oe&&v.jsx(vr,{targetRect:Oe.rect,activeZone:Oe.zone})]})})})})}const s2=26;function Wh({stack:s,path:h,groupId:w,sessionsById:S,colors:M,intents:O,onTabClick:A,onTabClose:r,onTabMouseDown:u,onPaneAutoClose:d,registerRect:g,sendMessage:l,subscribeBinary:m,onEvent:b,focusedSessionId:C,groupTopmost:p,onFocusStack:o,groupActions:c}){const{t:a}=Tt(),[f,,y]=qv(s.activeTab),[R,k]=j.useState({}),D=()=>{const T=s.activeTab;T&&k(F=>({...F,[T]:(F[T]||0)+1}))},E=JC(),{states:L,attention:z}=j.useContext(Hh),H=p===void 0?!0:p&&(!C||C===s.activeTab),P=p===!0&&!H,I=S.get(s.activeTab),K=[[I==null?void 0:I.cli_tool,I==null?void 0:I.cli_model].filter(Boolean).join("/"),I==null?void 0:I.branch_name,I==null?void 0:I.status,I!=null&&I.total_tokens?`${I.total_tokens.toLocaleString()} tok`:""].filter(Boolean).join(" · "),X=T=>{T.button===0&&s.activeTab&&(o?o(s.activeTab):E==null||E.focus(s.activeTab)),T.stopPropagation()},Y=s.tabs.length>1?T=>{const F=s.tabs.indexOf(s.activeTab);if(F<0)return;const B=s.tabs.length,W=T==="next"?(F+1)%B:(F-1+B)%B;A(s.tabs[W])}:void 0,$=s.tabs.length>1?T=>{const F=s.tabs[T];F&&A(F)}:void 0,U=T=>{var J;const F=/Mac|iPhone|iPad|iPod/.test(navigator.platform),B=F?T.metaKey:T.ctrlKey,W=F?T.ctrlKey:T.metaKey,Z=B&&!W&&!T.altKey&&T.shiftKey,ne=T.key.toLowerCase();if(T.key==="F5"&&!T.ctrlKey&&!T.metaKey&&!T.altKey&&!T.shiftKey||Z&&ne==="r"){T.preventDefault(),D();return}if(!Z||ne!=="a"&&ne!=="p")return;T.preventDefault();const xe=ne==="a"?"alias-inserter":"terminal-theme";(J=T.currentTarget.querySelector(`[aria-label="${xe}"]`))==null||J.click()};return v.jsxs("div",{onKeyDown:U,style:{flex:1,display:"flex",flexDirection:"column",background:Ce.bg,minWidth:0,minHeight:0,position:"relative",overflow:"hidden",opacity:P?p?.78:.88:1,filter:P?"saturate(0.78)":"none",boxShadow:H?`inset 0 0 0 1px ${Ce.info}`:"inset 0 0 0 1px transparent",transition:"opacity 140ms ease-out, filter 140ms ease-out, box-shadow 140ms ease-out"},children:[v.jsxs("div",{onDoubleClick:T=>{var F;T.target.closest("button")||(F=c==null?void 0:c.onToggleMaximize)==null||F.call(c)},style:{display:"flex",height:s2,background:H?"#323a42":Ce.titleBg,borderBottom:`1px solid ${Ce.separator}`,flexShrink:0,overflowX:"auto",overflowY:"hidden"},children:[s.tabs.map((T,F)=>{const B=S.get(T),W=T===s.activeTab,Z=M[T]||Ce.titleText,ne=(B==null?void 0:B.status)==="running"?Ce.success:(B==null?void 0:B.status)==="failed"?Ce.error:(B==null?void 0:B.status)==="completed"?Ce.info:Ce.dim,ge=L[T]??(B==null?void 0:B.agent_state)??"unknown",xe=ge==="working"?Ce.info:ge==="blocked"?Ce.warning:ne,J=z.has(T),G=s.tabs.length>1&&F<9?`Ctrl+${F+1}`:"",de=[B==null?void 0:B.status,ge!=="unknown"?ge:"",B==null?void 0:B.cli_tool,B==null?void 0:B.cli_model,B==null?void 0:B.branch_name,G].filter(Boolean).join(" · ");return v.jsxs("div",{onMouseDown:oe=>{if(oe.button===0){if(c){A(T);return}oe.stopPropagation(),A(T),u(T,h,oe)}},style:{display:"flex",alignItems:"center",gap:6,padding:"0 6px 0 10px",fontFamily:_t,fontSize:11,color:W?Ce.bright:Ce.titleText,background:W?Ce.bg:"transparent",borderRight:`1px solid ${Ce.separator}`,cursor:"pointer",userSelect:"none",whiteSpace:"nowrap",maxWidth:200,position:"relative",boxShadow:J?`inset 0 -2px 0 ${xe}`:void 0},title:`${(B==null?void 0:B.title)||T}${de?`
|
|
422
|
+
${de}`:""}`,children:[v.jsx("span",{"aria-label":ge!=="unknown"?ge:(B==null?void 0:B.status)||"unknown",className:ge==="working"?"workspace-dot-pulse":void 0,style:{width:6,height:6,borderRadius:"50%",background:xe,flexShrink:0}}),v.jsx("span",{"aria-hidden":!0,style:{flexShrink:0,fontFamily:_t,fontSize:11,fontWeight:700,letterSpacing:-.5,lineHeight:1,color:Z,width:16,textAlign:"center"},children:">_"}),v.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",flex:1,color:J?xe:void 0,fontWeight:J?600:void 0},children:(B==null?void 0:B.title)||T}),v.jsx("button",{"data-no-drag":!0,onMouseDown:oe=>oe.stopPropagation(),onClick:oe=>{oe.stopPropagation(),r(T)},"aria-label":"close-tab",title:a("group.closeTab")||"Close tab",style:{background:"transparent",border:"none",color:Ce.titleText,cursor:"pointer",padding:1,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:3,flexShrink:0},children:v.jsx(Ri,{size:12})})]},T)}),E&&v.jsx("button",{"data-no-drag":!0,onMouseDown:T=>T.stopPropagation(),onClick:()=>{E.createRawShellTab(w,h).catch(()=>{})},"aria-label":"new-tab",title:`${a("group.newTab")||"New shell tab"} (Ctrl+T)`,style:{background:"transparent",border:"none",borderRight:`1px solid ${Ce.separator}`,color:Ce.titleText,cursor:"pointer",padding:"0 8px",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,height:"100%"},children:v.jsx(Mn,{size:14})}),v.jsx("div",{style:{flex:1,minWidth:8}}),K&&v.jsx("span",{title:K,style:{maxWidth:260,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:Ce.dim,fontFamily:_t,fontSize:9,padding:"0 7px",flexShrink:1},children:K}),v.jsx(BC,{sessionId:s.activeTab,sendMessage:l}),v.jsx("button",{"data-no-drag":!0,onMouseDown:T=>T.stopPropagation(),onClick:D,"aria-label":"refresh-terminal",title:`${a("session.refresh")||"Refresh rendering"} (F5 · Ctrl+Shift+R) — ${a("session.refresh.hint")||"Rebuild the terminal view (PTY stays running)"}`,style:Zi,children:v.jsx(aS,{size:12})}),v.jsx("button",{"data-no-drag":!0,onMouseDown:T=>T.stopPropagation(),onClick:()=>y(-1),"aria-label":"decrease-font",title:`${a("session.fontDecrease")||"Decrease font size"} (${f}px) · Ctrl+- · Ctrl+wheel`,style:Zi,children:v.jsx(LS,{size:14})}),v.jsx("button",{"data-no-drag":!0,onMouseDown:T=>T.stopPropagation(),onClick:()=>y(1),"aria-label":"increase-font",title:`${a("session.fontIncrease")||"Increase font size"} (${f}px) · Ctrl+= · Ctrl+wheel`,style:Zi,children:v.jsx(kS,{size:14})}),v.jsx(jC,{sessionId:s.activeTab}),c&&v.jsxs(v.Fragment,{children:[s.tabs.length>1&&c.onApplyLayoutPreset&&v.jsxs(v.Fragment,{children:[v.jsx("button",{"data-no-drag":!0,onMouseDown:T=>T.stopPropagation(),onClick:()=>{var T;return(T=c.onApplyLayoutPreset)==null?void 0:T.call(c,"single")},"aria-label":"single-pane",title:a("session.layout.single"),style:Zi,children:v.jsx(jv,{size:12})}),v.jsx("button",{"data-no-drag":!0,onMouseDown:T=>T.stopPropagation(),onClick:()=>{var T;return(T=c.onApplyLayoutPreset)==null?void 0:T.call(c,"columns")},"aria-label":"two-columns",title:a("session.layout.columns"),style:Zi,children:v.jsx(Lv,{size:14})}),v.jsx("button",{"data-no-drag":!0,onMouseDown:T=>T.stopPropagation(),onClick:()=>{var T;return(T=c.onApplyLayoutPreset)==null?void 0:T.call(c,"grid")},"aria-label":"grid-layout",title:a("session.layout.grid"),style:Zi,children:v.jsx(Tv,{size:14})})]}),c.onToggleMaximize&&v.jsx("button",{"data-no-drag":!0,onMouseDown:T=>T.stopPropagation(),onClick:c.onToggleMaximize,"aria-label":"toggle-maximize",title:`${c.isMaximized?a("session.restoreSize"):a("session.maximize")} · ${a("session.maximizeHint")}`,style:Zi,children:c.isMaximized?v.jsx(Th,{size:14}):v.jsx(El,{size:14})}),c.onPopOutGroup&&v.jsx("button",{"data-no-drag":!0,onMouseDown:T=>T.stopPropagation(),onClick:c.onPopOutGroup,"aria-label":"pop-out",title:`${a("session.popOut")||"Pop out to separate window"} (Ctrl+Shift+O)`,style:Zi,children:v.jsx(_r,{size:14})}),c.onReDockGroup&&v.jsx("button",{"data-no-drag":!0,onMouseDown:T=>T.stopPropagation(),onClick:c.onReDockGroup,"aria-label":"redock",title:a("session.popout.redock")||"Re-dock to main window",style:Zi,children:v.jsx(_r,{size:14,style:{transform:"scaleX(-1)"}})}),c.onMinimizeGroup&&v.jsx("button",{"data-no-drag":!0,onMouseDown:T=>T.stopPropagation(),onClick:c.onMinimizeGroup,"aria-label":"minimize",title:`${a("session.minimize")||"Minimize"} (Ctrl+Shift+M)`,style:Zi,children:v.jsx(Mh,{size:14})}),v.jsx("button",{"data-no-drag":!0,onMouseDown:T=>T.stopPropagation(),onClick:c.onCloseGroup,"aria-label":"close",title:`${a("session.close")||"Close"} (Ctrl+Shift+X)`,style:Zi,children:v.jsx(Ri,{size:14})})]})]}),v.jsx("div",{"data-group-id":w,"data-stack-path":h.join("."),ref:T=>{if(!T){g(h,null);return}const F=T.getBoundingClientRect();g(h,{x:F.left,y:F.top,w:F.width,h:F.height})},onMouseDown:X,style:{flex:1,position:"relative",minHeight:0,minWidth:0},children:s.tabs.map(T=>{const F=S.get(T);if(!F)return null;const B=O[T]||{intent:"open",nonce:0};return v.jsx(__,{session:F,visible:T===s.activeTab,intent:B.intent,intentNonce:B.nonce,onClose:()=>d(T),sendMessage:l,subscribeBinary:m,onEvent:b,onCycleTab:Y,onSelectTab:$,remountKey:R[T]||0},T)})})]})}const Zi={background:"transparent",border:"none",color:Ce.titleText,cursor:"pointer",padding:"0 6px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:0,flexShrink:0,height:"100%"},Yg=28;function n2({sendMessage:s,subscribeBinary:h,onEvent:w}){var je;const{projectId:S="",groupId:M=""}=By(),[O]=kw(),A=O.get("wid")||"",{t:r}=Tt(),{confirm:u}=kr(),[d,g]=j.useState(null),[l,m]=j.useState([]),[b,C]=j.useState(null),[p,o]=j.useState(null),[c,a]=j.useState(0),f=j.useRef(0),y=j.useRef(0),R=j.useRef(0);j.useEffect(()=>{const ee=()=>{const Me=f.current;!Me||R.current===Me||Math.abs(y.current-Me)<=400&&(R.current=Me,a(Ge=>Ge+1))},be=()=>{f.current=Date.now(),D(!0),ee()},he=()=>D(!1),He=()=>{y.current=Date.now(),ee()};return window.addEventListener("focus",be),window.addEventListener("blur",he),window.addEventListener("pointerdown",He,!0),()=>{window.removeEventListener("focus",be),window.removeEventListener("blur",he),window.removeEventListener("pointerdown",He,!0)}},[]);const[k,D]=j.useState(()=>typeof document<"u"&&document.hasFocus()),{sendNotification:E}=Ll(),L=j.useRef(null);L.current=d;const z=j.useRef(null),H=j.useRef(!1);j.useEffect(()=>{if(!S)return;let ue=!1;return tC(S).then(ee=>{ue||m(ee)}).catch(ee=>{ue||C(String((ee==null?void 0:ee.message)||ee))}),()=>{ue=!0}},[S]);const P=j.useRef(new Set);j.useEffect(()=>{if(!d||l.length===0)return;const ue=new Set(l.map(ee=>ee.id));for(const ee of Ft(d.root))ue.has(ee)||P.current.has(ee)||(P.current.add(ee),l_(ee).then(be=>m(he=>he.some(He=>He.id===be.id)?he:[...he,be])).catch(()=>{}))},[d,l]),j.useEffect(()=>w(ee=>{ee.type==="session:status-changed"&&ee.sessionId&&m(be=>be.map(he=>{if(he.id!==ee.sessionId)return he;const He={status:ee.status,updated_at:new Date().toISOString()};return ee.worktree_path!==void 0&&(He.worktree_path=ee.worktree_path),ee.branch_name!==void 0&&(He.branch_name=ee.branch_name),{...he,...He}}))}),[w]),j.useEffect(()=>{if(!S||!M||!A)return;const ue=Bh();z.current=ue;const ee=ue.subscribe(Me=>{if(Me.t==="dock-probe"||Me.t==="dock-probe-result"||Me.t==="dock-end"||Me.t==="dock-commit"||Me.t==="dock-commit-ack"){ye.current(Me);return}if(Me.t==="group-handoff"&&Me.to===A&&Me.groupId===M){const Ge=Me.group;g({...Ge,x:0,y:0,w:window.innerWidth,h:Math.max(0,window.innerHeight-(Ge.root.kind==="split"?Yg:0)),minimized:!1,ownerWindowId:A})}else if(Me.t==="group-recall"&&Me.popoutId===A&&Me.groupId===M){const Ge=L.current;Ge&&ue.post({t:"group-return",from:A,groupId:Ge.id,group:Ge,projectId:S}),setTimeout(()=>{try{window.close()}catch{}},50)}else if(Me.t==="group-focus"&&Me.popoutId===A&&Me.groupId===M){const Ge=window.electronAPI;if(Ge!=null&&Ge.windowFocus)Ge.windowFocus();else try{window.focus()}catch{}}else Me.t==="group-reclaimed"&&Me.popoutId===A&&(g(null),o(r("session.popout.reclaimed")||"메인 윈도우가 이 터미널을 회수했습니다. 잠시 후 창이 닫힙니다."),setTimeout(()=>{try{window.close()}catch{}},1500))});ue.post({t:"hello",from:A,groupId:M});const be=zx(A),he=setInterval(()=>{const Me=L.current;ue.post({t:"heartbeat",from:A,ownedGroupIds:Me?[Me.id]:[M]})},Nh),He=()=>{const Me=L.current;Me&&!H.current&&ue.post({t:"group-return",from:A,groupId:Me.id,group:Me,projectId:S}),ue.post({t:"bye",from:A})};return window.addEventListener("beforeunload",He),()=>{clearInterval(he),be(),window.removeEventListener("beforeunload",He),ee(),ue.close(),z.current=null}},[S,M,A]);const I=j.useCallback(ue=>{!z.current||!L.current||z.current.post({t:"group-update",from:A,groupId:L.current.id,patch:ue,projectId:S})},[A,S]),K=j.useCallback(ue=>{g(ee=>{if(!ee)return ee;const be={...ee,root:Ki(ee.root,ue)};return I({root:be.root}),be})},[I]),X=j.useCallback(ue=>{g(ee=>{var se;if(!ee)return ee;const be=Dn(ee.root,ue);if(!be)return H.current=!0,(se=z.current)==null||se.post({t:"group-close",from:A,groupId:ee.id,projectId:S}),setTimeout(()=>window.close(),50),null;const he=new Set(Ft(be)),He={};for(const V of Object.keys(ee.colors))he.has(V)&&(He[V]=ee.colors[V]);const Me={};for(const V of Object.keys(ee.intents))he.has(V)&&(Me[V]=ee.intents[V]);const Ge={...ee,root:be,colors:He,intents:Me};return I({root:Ge.root,colors:Ge.colors,intents:Ge.intents}),Ge})},[I,A]),Y=j.useCallback(async ue=>{const ee=l.find(be=>be.id===ue);if((ee==null?void 0:ee.status)==="running"){if(!await u({message:r("session.confirmStop"),danger:!0}))return;gh(ue).catch(()=>{})}X(ue)},[l,r,X,u]),[$,U]=j.useState(null),T=j.useRef(null);T.current=$;const F=j.useRef(new Map),B=j.useRef(null),W=j.useRef(0),Z=j.useMemo(()=>({begin(){F.current.clear(),W.current=0},probe(ue){var ee;Date.now()-W.current<33||(W.current=Date.now(),(ee=z.current)==null||ee.post({t:"dock-probe",from:A,x:ue.screenX,y:ue.screenY}))},best(){const ue=Date.now();let ee=null;for(const[be,he]of F.current)!he.hit||ue-he.at>500||(!ee||he.focusAt>ee.focusAt)&&(ee={id:be,focusAt:he.focusAt,rect:he.rect,zone:he.zone});return ee},commit(ue,ee,be,he){var Me;const He=`${A}_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,6)}`;B.current&&clearTimeout(B.current.timer),B.current={to:ue,commitId:He,ids:be.map(Ge=>Ge.id),timer:setTimeout(()=>{B.current=null},600)},(Me=z.current)==null||Me.post({t:"dock-commit",from:A,to:ue,x:ee.screenX,y:ee.screenY,commitId:He,sessions:be,activeId:he})},end(){var ue;F.current.clear(),(ue=z.current)==null||ue.post({t:"dock-end",from:A})}}),[A]),[ne,ge]=j.useState(null),xe=j.useRef(ne);xe.current=ne;const J=j.useRef(null),G=j.useRef(typeof document<"u"&&document.hasFocus()?Date.now():0);j.useEffect(()=>{const ue=()=>{G.current=Date.now()};window.addEventListener("focus",ue);const ee=e_();return()=>{window.removeEventListener("focus",ue),ee(),J.current&&clearTimeout(J.current)}},[]);const de=6,oe=j.useCallback((ue,ee,be)=>{if(be.button!==0||!L.current)return;be.preventDefault();const he=be.clientX,He=be.clientY;let Me=!1;Z.begin();const Ge=_e=>{if(!Me){if(Math.hypot(_e.clientX-he,_e.clientY-He)<de)return;Me=!0}if(!(_e.clientX>=0&&_e.clientY>=0&&_e.clientX<=window.innerWidth&&_e.clientY<=window.innerHeight)){U({sessionId:ue,fromPath:ee,hoveredPath:null,hoveredRect:null,zone:null}),Z.probe(_e);return}let Pe=null,Ue=null,ot=null;const Ye=document.elementsFromPoint(_e.clientX,_e.clientY);for(const ut of Ye){const ft=ut.closest("[data-group-id][data-stack-path]");if(!ft)continue;const kt=ft.dataset.stackPath||"",vt=kt===""?[]:kt.split(".").map(Number),Vt=kt===ee.join(".");if(Vt){const Ze=L.current,fe=Ze?cn(Ze.root,ee):null;if(!fe||fe.kind!=="stack"||fe.tabs.length<2)break}const Nt=ft.getBoundingClientRect();Pe=vt,Ue={x:Nt.left,y:Nt.top,w:Nt.width,h:Nt.height},ot=Dl(_e.clientX,_e.clientY,Ue),Vt&&ot==="center"&&(ot=null);break}U({sessionId:ue,fromPath:ee,hoveredPath:Pe,hoveredRect:Ue,zone:ot})};let se=!1;const V=()=>{se||(se=!0,window.removeEventListener("mousemove",Ge),window.removeEventListener("mouseup",ce),window.removeEventListener("blur",ie),window.removeEventListener("keydown",Q),document.removeEventListener("visibilitychange",ke))},ie=()=>{V(),U(null),Z.end()},Q=_e=>{_e.key==="Escape"&&ie()},ke=()=>{document.hidden&&ie()},ce=_e=>{V();const Ee=T.current;U(null);const Pe=Z.best();if(Z.end(),!Ee)return;if(Ee.hoveredPath&&Ee.zone){const ot=L.current;if(!ot)return;const Ye=Rx(ot.root,Ee.sessionId,Ee.hoveredPath,Ee.zone);if(!Ye)return;g({...ot,root:Ye}),I({root:Ye});return}if(!Pe)return;const Ue=L.current;Z.commit(Pe.id,_e,[{id:Ee.sessionId,color:Ue==null?void 0:Ue.colors[Ee.sessionId],intentInfo:Ue==null?void 0:Ue.intents[Ee.sessionId]}],Ee.sessionId)};window.addEventListener("mousemove",Ge),window.addEventListener("mouseup",ce),window.addEventListener("blur",ie),window.addEventListener("keydown",Q),document.addEventListener("visibilitychange",ke)},[I,Z]),[Ae,Oe]=j.useState(null),Xe=j.useCallback(ue=>{var ot;if(ue.button!==0||ue.target.closest("[data-no-drag]"))return;const ee=L.current;if(!ee||ee.root.kind!=="stack")return;ue.preventDefault();const be=ue.screenX,he=ue.screenY,He=window.screenX,Me=window.screenY,Ge=window.electronAPI;(ot=Ge==null?void 0:Ge.windowMoveStart)==null||ot.call(Ge),Z.begin();let se=!1,V=null,ie=0;const Q=()=>{if(ie=0,!!V)if(Ge!=null&&Ge.windowMoveBy)Ge.windowMoveBy(V.dx,V.dy);else try{window.moveTo(He+V.dx,Me+V.dy)}catch{}},ke=Ye=>{const ut=Ye.screenX-be,ft=Ye.screenY-he;if(!se){if(Math.hypot(ut,ft)<de)return;se=!0}V={dx:ut,dy:ft},ie||(ie=requestAnimationFrame(Q)),Z.probe(Ye);const kt=Z.best();if(kt!=null&&kt.rect){const vt=An();Oe({rect:{x:Ye.clientX+(kt.rect.x-Ye.screenX)/vt,y:Ye.clientY+(kt.rect.y-Ye.screenY)/vt,w:kt.rect.w/vt,h:kt.rect.h/vt},zone:kt.zone??null})}else Oe(null)};let ce=!1;const _e=()=>{ce||(ce=!0,window.removeEventListener("mousemove",ke),window.removeEventListener("mouseup",Ue),window.removeEventListener("blur",_e),window.removeEventListener("keydown",Ee),document.removeEventListener("visibilitychange",Pe),ie&&cancelAnimationFrame(ie),Oe(null),Z.end())},Ee=Ye=>{Ye.key==="Escape"&&_e()},Pe=()=>{document.hidden&&_e()},Ue=Ye=>{const ut=Z.best();if(_e(),!se||!(ut!=null&&ut.zone))return;const ft=L.current;!ft||ft.root.kind!=="stack"||Z.commit(ut.id,Ye,ft.root.tabs.map(kt=>({id:kt,color:ft.colors[kt],intentInfo:ft.intents[kt]})),ft.root.activeTab)};window.addEventListener("mousemove",ke),window.addEventListener("mouseup",Ue),window.addEventListener("blur",_e),window.addEventListener("keydown",Ee),document.addEventListener("visibilitychange",Pe)},[Z]),We=j.useCallback(ue=>{g(ee=>{if(!ee)return ee;const be={...ee,root:Yv(ee.root,ue)};return I({root:be.root}),be})},[I]),rt=ue=>{var be;const ee=z.current;if(ee){if(ue.t==="dock-probe"&&ue.from!==A){if(document.visibilityState!=="visible"||!L.current)return;const he=vl(ue.x,ue.y),He=_l(he)?bl(he.x,he.y):null;if(He&&He.groupId===L.current.id){const Me=xe.current;(!Me||Me.zone!==He.zone||Me.path.join(".")!==He.path.join("."))&&ge({rect:He.rect,zone:He.zone,path:He.path}),J.current&&clearTimeout(J.current),J.current=setTimeout(()=>ge(null),800);const Ge=An();ee.post({t:"dock-probe-result",from:A,to:ue.from,hit:!0,focusAt:G.current,rect:{...i_(He.rect.x,He.rect.y),w:He.rect.w*Ge,h:He.rect.h*Ge},zone:He.zone})}else xe.current&&ge(null),ee.post({t:"dock-probe-result",from:A,to:ue.from,hit:!1,focusAt:G.current})}else if(ue.t==="dock-probe-result"&&ue.to===A)F.current.set(ue.from,{hit:ue.hit,focusAt:ue.focusAt,at:Date.now(),rect:ue.rect,zone:ue.zone});else if(ue.t==="dock-end"&&ue.from!==A)ge(null);else if(ue.t==="dock-commit"&&ue.to===A){const he=L.current;let He=!1;const Me=ue.sessions.map(Ge=>Ge.id);if(he&&!Me.some(Ge=>Ft(he.root).includes(Ge))){const Ge=vl(ue.x,ue.y),se=_l(Ge)?bl(Ge.x,Ge.y):null,V=se&&se.groupId===he.id&&se.zone?{path:se.path,zone:se.zone}:(be=xe.current)!=null&&be.zone?{path:xe.current.path,zone:xe.current.zone}:null;if(V){const ie=Xv(he.root,V.path,V.zone,Me,ue.activeId),Q={...he.colors},ke={...he.intents};for(const ce of ue.sessions)Q[ce.id]||(Q[ce.id]=ce.color||Ln(Object.values(Q))),ke[ce.id]=ce.intentInfo??{intent:"open",nonce:0};g({...he,root:ie,colors:Q,intents:ke}),I({root:ie,colors:Q,intents:ke}),He=!0}}ge(null),ee.post({t:"dock-commit-ack",from:A,to:ue.from,commitId:ue.commitId,accepted:He})}else if(ue.t==="dock-commit-ack"&&ue.to===A){const he=B.current;if(he&&he.commitId===ue.commitId&&he.to===ue.from&&(clearTimeout(he.timer),B.current=null,ue.accepted))for(const He of he.ids)X(He)}}},ye=j.useRef(rt);ye.current=rt;const Te=j.useCallback(ue=>{Y(ue)},[Y]),ct=j.useCallback((ue,ee)=>{g(be=>{if(!be)return be;const he={...be,root:Jv(be.root,ue,ee)};return I({root:he.root}),he})},[I]),it=window.electronAPI,ze=!!(it!=null&&it.windowMinimize),qe=j.useCallback(()=>{var ue;(ue=it==null?void 0:it.windowMinimize)==null||ue.call(it)},[it]),Fe=j.useCallback(()=>{const ue=L.current;if(!ue||!z.current){window.close();return}z.current.post({t:"group-return",from:A,groupId:ue.id,group:ue,projectId:S}),setTimeout(()=>window.close(),50)},[A,S]),Be=j.useCallback(async()=>{const ue=L.current;if(!ue||!z.current){window.close();return}const be=Ft(ue.root).filter(he=>{var He;return((He=l.find(Me=>Me.id===he))==null?void 0:He.status)==="running"});be.length&&!await u({message:r("session.confirmStop"),danger:!0})||(be.forEach(he=>gh(he).catch(()=>{})),H.current=!0,z.current.post({t:"group-close",from:A,groupId:ue.id,projectId:S}),setTimeout(()=>window.close(),50))},[l,r,A,S,u]),$e=j.useMemo(()=>{const ue=new Map;for(const ee of l)ue.set(ee.id,ee);return ue},[l]),lt=k&&d?wr(d.root).join(","):"",st=j.useMemo(()=>new Set(lt?lt.split(","):[]),[lt]),St=Ph(w,st,(ue,ee)=>{var he;const be=L.current;!be||!Ft(be.root).includes(ue)||E(r(ee==="blocked"?"notification.sessionBlocked":"notification.sessionDone"),((he=$e.get(ue))==null?void 0:he.title)||ue,()=>K(ue))});if(b)return v.jsxs("div",{style:sh,children:[v.jsx("p",{children:r("session.popout.loadFailed")||"Failed to load popout window."}),v.jsx("p",{style:{fontSize:12,opacity:.7},children:b})]});if(!d)return p?v.jsx("div",{style:sh,children:v.jsx("p",{children:p})}):v.jsxs("div",{style:sh,children:[v.jsx("p",{children:r("session.popout.waiting")||"Waiting for main window…"}),v.jsx("p",{style:{fontSize:12,opacity:.7},children:r("session.popout.waitingHint")||"If the main app is not open, this window cannot start. Open the project in the main app and try Pop Out again."})]});const Se=Ft(d.root),Ie=Se.length>0?((je=$e.get(Se[0]))==null?void 0:je.title)||Se[0]:"",le=Se.length===1?Ie:`${Ie} +${Se.length-1}`,Ne=d.root.kind==="split";return v.jsxs("div",{style:{position:"fixed",inset:0,background:Ce.bg,display:"flex",flexDirection:"column"},children:[c>0&&v.jsx("div",{className:"popout-focus-flash","aria-hidden":!0},c),Ne&&v.jsxs("div",{style:{height:Yg,background:Ce.titleBg,borderBottom:`1px solid ${Ce.separator}`,display:"flex",alignItems:"center",padding:"0 4px 0 10px",color:Ce.titleText,fontFamily:_t,fontSize:11,flexShrink:0,userSelect:"none",WebkitAppRegion:"drag"},children:[v.jsx("span",{style:{color:Ce.info,fontWeight:600,letterSpacing:1,marginRight:8},"aria-hidden":!0,children:">_"}),v.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:le}),ze&&v.jsx("button",{onClick:qe,style:nh,"aria-label":"minimize-popout",title:r("session.popout.minimize")||"Minimize",children:v.jsx(Mh,{size:14})}),v.jsxs("button",{onClick:Fe,style:nh,"aria-label":"redock",title:r("session.popout.redock")||"Re-dock to main window",children:[v.jsx(_r,{size:14,style:{transform:"scaleX(-1)"}}),v.jsx("span",{style:{marginLeft:4},children:r("session.popout.redockShort")||"Re-dock"})]}),v.jsx("button",{onClick:Be,style:nh,"aria-label":"close-popout",title:r("session.popout.closeWindow")||"Close window",children:v.jsx(Ri,{size:14})})]}),v.jsx("div",{onMouseDown:Ne?void 0:Xe,style:{flex:1,display:"flex",minHeight:0,minWidth:0},children:v.jsx(Hh.Provider,{value:St,children:d.root.kind==="split"?v.jsx(Fh,{node:d.root,path:[],groupId:d.id,sessionsById:$e,colors:d.colors,intents:d.intents,onTabClick:K,onTabClose:Y,onTabMouseDown:oe,onPaneAutoClose:Te,registerRect:()=>{},onSplitSizes:ct,sendMessage:s,subscribeBinary:h,onEvent:w}):v.jsx(Wh,{stack:d.root,path:[],groupId:d.id,sessionsById:$e,colors:d.colors,intents:d.intents,onTabClick:K,onTabClose:Y,onTabMouseDown:oe,onPaneAutoClose:Te,registerRect:()=>{},sendMessage:s,subscribeBinary:h,onEvent:w,groupActions:{onMinimizeGroup:ze?qe:void 0,onReDockGroup:Fe,onCloseGroup:Be,onApplyLayoutPreset:We}})})}),$&&$.hoveredRect&&v.jsx(vr,{targetRect:$.hoveredRect,activeZone:$.zone}),Ae&&v.jsx(vr,{targetRect:Ae.rect,activeZone:Ae.zone}),ne&&v.jsx(vr,{targetRect:ne.rect,activeZone:ne.zone})]})}const sh={position:"fixed",inset:0,background:Ce.bg,color:Ce.titleText,fontFamily:_t,fontSize:12,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:8,padding:24,textAlign:"center"},nh={background:"transparent",border:"none",color:Ce.titleText,cursor:"pointer",padding:"4px 8px",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:4,fontFamily:_t,fontSize:11,WebkitAppRegion:"no-drag"},r2=j.lazy(()=>Oo(()=>import("./ProjectList-LeZ7mrEM.js"),__vite__mapDeps([0,1]))),o2=j.lazy(()=>Oo(()=>import("./ProjectDetail-DwN6S3uf.js").then(s=>s.l),__vite__mapDeps([2,3,4,5,6,7,1]))),a2=j.lazy(()=>Oo(()=>import("./DiscussionDetail-DetjETsr.js"),__vite__mapDeps([8,6,5,7]))),l2=j.lazy(()=>Oo(()=>import("./ReviewQueue-DzTHqZdO.js"),__vite__mapDeps([9,4,5,10]))),c2=j.lazy(()=>Oo(()=>import("./PersonalAgenda-JNpWPEDQ.js"),__vite__mapDeps([11,3,7,10])));function u2(){const{authenticated:s,authRequired:h,setupRequired:w,loading:S,login:M,logout:O,setup:A,changePassword:r}=jw(),{connected:u,onEvent:d,sendMessage:g,subscribeBinary:l}=Bw(s),{t:m}=Tt();return j.useEffect(()=>{s&&Wv().then(b=>{var C,p;hl(b.defaultFontSize),(p=(C=window.electronAPI)==null?void 0:C.imeSetDebug)==null||p.call(C,b.imeDebug)}).catch(()=>{})},[s]),j.useEffect(()=>{const b=window.electronAPI,C=f=>{var y;return!!f&&!((y=f.classList)!=null&&y.contains("xterm-helper-textarea"))&&(f.tagName==="INPUT"||f.tagName==="TEXTAREA"||f.isContentEditable)},p=f=>{var y;h_(()=>f.focus())&&((y=b==null?void 0:b.imeLog)==null||y.call(b,{src:"app",event:"focus-rescue",tag:f.tagName}))},o=f=>{var R;const y=f.target;if(C(y)){if(!document.hasFocus()){p(y);return}(R=b==null?void 0:b.imeReset)==null||R.call(b)}},c=f=>{if(document.hasFocus())return;const y=f.target;C(y)&&p(y)},a=()=>{if(document.hasFocus())return;const f=document.activeElement;C(f)&&p(f)};return document.addEventListener("focusin",o,!0),document.addEventListener("pointerdown",c,!0),document.addEventListener("keydown",a,!0),()=>{document.removeEventListener("focusin",o,!0),document.removeEventListener("pointerdown",c,!0),document.removeEventListener("keydown",a,!0)}},[]),S?v.jsxs("div",{className:"flex h-screen overflow-hidden",style:{backgroundColor:"var(--color-bg-primary)"},children:[v.jsxs("div",{className:"hidden md:flex flex-col w-64 border-r border-theme-border p-4 space-y-6",children:[v.jsx(pi,{className:"h-8 w-32 mb-4"}),v.jsxs("div",{className:"space-y-3",children:[v.jsx(pi,{className:"h-4 w-full"}),v.jsx(pi,{className:"h-4 w-5/6"}),v.jsx(pi,{className:"h-4 w-4/6"})]}),v.jsxs("div",{className:"mt-auto space-y-3 pt-4 border-t border-theme-border",children:[v.jsx(pi,{className:"h-4 w-1/2"}),v.jsxs("div",{className:"flex gap-2",children:[v.jsx(pi,{className:"h-8 w-8"}),v.jsx(pi,{className:"h-8 w-8"}),v.jsx(pi,{className:"h-8 w-8"})]})]})]}),v.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[v.jsx("div",{className:"md:hidden h-14 border-b border-theme-border flex items-center px-4",children:v.jsx(pi,{className:"h-6 w-32"})}),v.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-8",children:[v.jsxs("div",{className:"flex justify-between items-center",children:[v.jsxs("div",{className:"space-y-2",children:[v.jsx(pi,{className:"h-8 w-48"}),v.jsx(pi,{className:"h-4 w-32"})]}),v.jsx(pi,{className:"h-10 w-24 rounded-xl"})]}),v.jsx(pi,{className:"h-12 w-full rounded-xl"}),v.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:[...Array(6)].map((b,C)=>v.jsxs("div",{className:"card p-5 space-y-4",children:[v.jsx(pi,{className:"h-5 w-2/3"}),v.jsx(pi,{className:"h-3 w-full"}),v.jsxs("div",{className:"flex gap-2 pt-2",children:[v.jsx(pi,{className:"h-6 w-16"}),v.jsx(pi,{className:"h-6 w-16"})]})]},C))})]})]})]}):w?v.jsx(DS,{onSetup:A}):s?v.jsx(yw,{children:v.jsxs(Jm,{children:[v.jsx(an,{path:"/popout/:projectId/:groupId",element:v.jsx(n2,{sendMessage:g,subscribeBinary:l,onEvent:d})}),v.jsx(an,{path:"*",element:v.jsxs(v.Fragment,{children:[v.jsx(Lx,{onLogout:O,authRequired:h,connected:u,onEvent:d,children:v.jsx(j.Suspense,{fallback:null,children:v.jsxs(Jm,{children:[v.jsx(an,{path:"/",element:v.jsx(r2,{onEvent:d})}),v.jsx(an,{path:"/review",element:v.jsx(l2,{onEvent:d})}),v.jsx(an,{path:"/agenda",element:v.jsx(c2,{})}),v.jsx(an,{path:"/projects/:id",element:v.jsx(o2,{onEvent:d,connected:u,sendMessage:g,subscribeBinary:l})}),v.jsx(an,{path:"/projects/:id/discussions/:discussionId",element:v.jsx(a2,{onEvent:d,connected:u})})]})})}),v.jsx(Yx,{onEvent:d})]})})]})}):v.jsx(RS,{onLogin:M,onChangePassword:r})}function h2(s){return bt(`/api/harness/${s}`)}function Kg(s,h){return bt(`/api/harness/${s}/${h}`)}function d2(s,h,w){return Di(`/api/harness/${s}/${h}/settings`,w)}function f2(s,h,w){return Di(`/api/harness/${s}/${h}/memory`,{content:w})}function p2(s,h,w){return Di(`/api/harness/${s}/${h}/local-memory`,{content:w})}function m2(s,h,w){return Di(`/api/harness/${s}/${h}/hooks`,{hooks:w})}function g2(s,h,w,S,M){return nt(`/api/harness/${s}/${h}/hooks/toggle`,{event:w,index:S,enabled:M})}function v2(s,h,w,S){return nt(`/api/harness/${s}/${h}/skills/${encodeURIComponent(w)}/toggle`,{enabled:S})}function _2(s,h,w,S){return Di(`/api/harness/${s}/${h}/skills/${encodeURIComponent(w)}`,{content:S})}function b2(s,h){return nt(`/api/harness/${s}/${h}/port-from-claude`)}function y2(s,h,w){return Di(`/api/harness/${s}/${h}/mcp/${encodeURIComponent(w.alias)}`,w)}function w2(s,h,w){return Cr(`/api/harness/${s}/${h}/mcp/${encodeURIComponent(w)}`)}const S2={claude:["ask","accept","auto","bypassPermissions"],antigravity:["default","auto","all"],codex:["untrusted","on-request","on-failure","never"]},x2={claude:[],antigravity:["true","false","docker","podman"],codex:["read-only","workspace-write","danger-full-access"]};function C2({cli:s,settings:h,saving:w,onSave:S}){const{t:M}=Tt(),[O,A]=j.useState(h.model??""),[r,u]=j.useState(h.approvalMode??""),[d,g]=j.useState(h.sandbox??"");j.useEffect(()=>{A(h.model??""),u(h.approvalMode??""),g(h.sandbox??"")},[h.model,h.approvalMode,h.sandbox]);const l=(h.model??"")!==O||(h.approvalMode??"")!==r||(h.sandbox??"")!==d,m=async C=>{if(C.preventDefault(),!l||w)return;const p={};(h.model??"")!==O&&(p.model=O||void 0),(h.approvalMode??"")!==r&&(p.approvalMode=r||void 0),(h.sandbox??"")!==d&&(p.sandbox=d||void 0),await S(p)},b=x2[s];return v.jsxs("form",{onSubmit:m,className:"space-y-3 p-4 border border-warm-200 rounded-xl",children:[v.jsx("h4",{className:"text-sm font-semibold text-warm-700",children:M("harness.section.settings")}),v.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[v.jsxs("div",{children:[v.jsx("label",{className:"text-xs text-warm-500 block mb-1",children:M("harness.field.model")}),v.jsx("input",{type:"text",value:O,onChange:C=>A(C.target.value),placeholder:M(`harness.field.modelPlaceholder.${s}`),className:"w-full px-3 py-1.5 text-xs border border-warm-200 rounded-lg bg-warm-50 text-warm-700 focus:ring-1 focus:ring-accent focus:border-accent"})]}),v.jsxs("div",{children:[v.jsx("label",{className:"text-xs text-warm-500 block mb-1",children:M("harness.field.approvalMode")}),v.jsxs("select",{value:r,onChange:C=>u(C.target.value),className:"w-full px-3 py-1.5 text-xs border border-warm-200 rounded-lg bg-warm-50 text-warm-700 focus:ring-1 focus:ring-accent focus:border-accent",children:[v.jsx("option",{value:"",children:M("harness.field.unset")}),S2[s].map(C=>v.jsx("option",{value:C,children:C},C))]})]}),b.length>0&&v.jsxs("div",{children:[v.jsx("label",{className:"text-xs text-warm-500 block mb-1",children:M("harness.field.sandbox")}),v.jsxs("select",{value:d,onChange:C=>g(C.target.value),className:"w-full px-3 py-1.5 text-xs border border-warm-200 rounded-lg bg-warm-50 text-warm-700 focus:ring-1 focus:ring-accent focus:border-accent",children:[v.jsx("option",{value:"",children:M("harness.field.unset")}),b.map(C=>v.jsx("option",{value:C,children:C},C))]})]})]}),v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx(Li,{type:"submit",variant:"primary",size:"sm",disabled:!l||w,children:M(w?"harness.saving":"harness.save")}),!l&&v.jsx("span",{className:"text-xs text-warm-400",children:M("harness.noChanges")})]})]})}function Xg(s,h){if(!h)return[];const w=[],S=s.toLowerCase(),M=h.toLowerCase();let O=S.indexOf(M);for(;O!==-1;)w.push(O),O=S.indexOf(M,O+M.length);return w}function Vg({filePath:s,content:h,saving:w,onSave:S}){const{t:M}=Tt(),[O,A]=j.useState(h),[r,u]=j.useState(!1),[d,g]=j.useState(!1),[l,m]=j.useState(""),[b,C]=j.useState(0),[p,o]=j.useState(null),c=j.useRef(null),a=j.useRef(null),f=j.useRef(null);j.useEffect(()=>{A(h)},[h]);const y=O!==h,R=s.split(/[\\/]/).pop()||s,k=j.useMemo(()=>Xg(O,l),[O,l]),D=k.length?Math.min(b,k.length-1):0,E=(U,T)=>{const F=c.current;if(!F)return;F.setSelectionRange(U,U+T);const B=parseFloat(getComputedStyle(F).lineHeight)||16,W=O.slice(0,U).split(`
|
|
423
|
+
`).length-1;F.scrollTop=Math.max(0,W*B-F.clientHeight/2)},L=()=>{g(!0),requestAnimationFrame(()=>{var U;return(U=a.current)==null?void 0:U.select()})},z=()=>{var U;g(!1),(U=c.current)==null||U.focus()},H=U=>{m(U),C(0);const T=Xg(O,U);T.length&&E(T[0],U.length)},P=U=>{if(!k.length)return;const T=(D+U+k.length)%k.length;C(T),E(k[T],l.length)},I=U=>{(U.ctrlKey||U.metaKey)&&U.key.toLowerCase()==="f"&&(U.preventDefault(),L())},K=U=>{const T=c.current;T&&(U.preventDefault(),U.currentTarget.setPointerCapture(U.pointerId),f.current={startY:U.clientY,startHeight:T.getBoundingClientRect().height})},X=U=>{if(!f.current)return;const T=f.current.startHeight+(U.clientY-f.current.startY);o(Math.max(120,T))},Y=()=>{f.current=null},$=U=>{U.key==="Enter"?(U.preventDefault(),P(U.shiftKey?-1:1)):U.key==="Escape"&&(U.preventDefault(),z())};return v.jsxs("div",{className:"space-y-3 p-4 border border-warm-200 rounded-xl",onKeyDown:I,children:[v.jsxs("div",{className:"flex items-center justify-between gap-2",children:[v.jsx("h4",{className:"text-sm font-semibold text-warm-700 font-mono",children:R}),v.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[v.jsx("code",{className:"text-[10px] text-warm-400 truncate",title:s,children:s}),v.jsx("button",{type:"button",onClick:L,className:"p-1 text-warm-400 hover:text-warm-600 hover:bg-warm-100 rounded-md transition-colors flex-shrink-0",title:M("harness.find.open"),children:v.jsx(og,{size:14})}),v.jsx("button",{type:"button",onClick:()=>{u(U=>!U),o(null)},className:"p-1 text-warm-400 hover:text-warm-600 hover:bg-warm-100 rounded-md transition-colors flex-shrink-0",title:r?M("harness.memory.collapse")||"Collapse":M("harness.memory.expand")||"Expand",children:r?v.jsx(Th,{size:14}):v.jsx(El,{size:14})})]})]}),d&&v.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5 border border-warm-200 rounded-lg bg-warm-50",children:[v.jsx(og,{size:14,className:"text-warm-400 flex-shrink-0"}),v.jsx("input",{ref:a,type:"text",value:l,onChange:U=>H(U.target.value),onKeyDown:$,placeholder:M("harness.find.placeholder"),spellCheck:!1,className:"flex-1 min-w-0 text-xs bg-transparent text-warm-700 focus:outline-none"}),v.jsx("span",{className:"text-[11px] text-warm-400 tabular-nums flex-shrink-0",children:l?`${k.length?D+1:0}/${k.length}`:""}),v.jsx("button",{type:"button",onClick:()=>P(-1),disabled:!k.length,className:"p-0.5 text-warm-400 hover:text-warm-600 disabled:opacity-40 rounded-md transition-colors",title:M("harness.find.prev"),children:v.jsx(Cv,{size:14})}),v.jsx("button",{type:"button",onClick:()=>P(1),disabled:!k.length,className:"p-0.5 text-warm-400 hover:text-warm-600 disabled:opacity-40 rounded-md transition-colors",title:M("harness.find.next"),children:v.jsx(Dh,{size:14})}),v.jsx("button",{type:"button",onClick:z,className:"p-0.5 text-warm-400 hover:text-warm-600 rounded-md transition-colors",title:M("harness.find.close"),children:v.jsx(Ri,{size:14})})]}),v.jsx("textarea",{ref:c,value:O,onChange:U=>A(U.target.value),placeholder:M("harness.memory.placeholder"),spellCheck:!1,style:p!==null?{height:p}:void 0,className:`w-full px-3 py-2 text-xs font-mono leading-relaxed border border-warm-200 rounded-lg bg-warm-50 text-warm-700 focus:ring-1 focus:ring-accent focus:border-accent resize-none ${r?"h-[75vh]":"h-96"}`}),v.jsx("div",{onPointerDown:K,onPointerMove:X,onPointerUp:Y,onPointerCancel:Y,onDoubleClick:()=>o(null),className:"group flex items-center justify-center h-3 -mt-2 cursor-ns-resize touch-none select-none",title:M("harness.memory.resize"),children:v.jsx("div",{className:"w-12 h-1 rounded-full bg-warm-200 group-hover:bg-warm-400 transition-colors"})}),v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx(Li,{variant:"primary",size:"sm",onClick:()=>y&&!w&&S(O),disabled:!y||w,children:M(w?"harness.saving":"harness.save")}),!y&&v.jsx("span",{className:"text-xs text-warm-400",children:M("harness.noChanges")})]})]})}function Jg(s){return Array.isArray(s)?s.filter(h=>typeof h=="object"&&h!==null):null}function k2({hooks:s,disabledHooks:h,filePath:w,saving:S,onSave:M,onToggle:O}){const{t:A}=Tt(),[r,u]=j.useState(!1),[d,g]=j.useState(""),[l,m]=j.useState(null),b=Array.from(new Set([...Object.keys(s??{}),...Object.keys(h??{})])),C=b.length>0,p=Object.keys(h??{}).length>0,o=(a,f,y,R)=>v.jsxs("div",{className:"flex items-start gap-2 text-[11px]",children:[v.jsx("input",{type:"checkbox",checked:R,disabled:S,onChange:()=>O(a,y,!R),title:A(R?"harness.toggle.disable":"harness.toggle.enable"),className:"mt-0.5 flex-shrink-0 cursor-pointer"}),v.jsxs("div",{className:`min-w-0 flex-1${R?"":" opacity-50"}`,children:[f.matcher!==void 0&&f.matcher!==""&&v.jsx("span",{className:"inline-block px-1.5 py-0.5 mr-1.5 rounded-md bg-warm-200/60 text-warm-600 font-mono",children:f.matcher}),(f.hooks??[]).map((k,D)=>v.jsx("code",{className:"block mt-0.5 px-2 py-1 rounded-md bg-theme-card border border-warm-150 text-warm-600 font-mono whitespace-pre-wrap break-all",children:k.command??JSON.stringify(k)},D))]})]},`${R?"on":"off"}-${y}`);j.useEffect(()=>{g(JSON.stringify(s??{},null,2)),m(null)},[s]);const c=async()=>{let a;try{a=JSON.parse(d)}catch{m(A("harness.hooks.invalidJson")||"Invalid JSON");return}if(typeof a!="object"||a===null||Array.isArray(a)){m(A("harness.hooks.invalidJson")||"Invalid JSON");return}m(null);const f=a;await M(Object.keys(f).length===0?null:f),u(!1)};return v.jsxs("div",{className:"space-y-3 p-4 border border-warm-200 rounded-xl",children:[v.jsxs("div",{className:"flex items-center justify-between gap-2",children:[v.jsx("h4",{className:"text-sm font-semibold text-warm-700",children:"Hooks"}),v.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[v.jsx("code",{className:"text-[10px] text-warm-400 truncate",title:w,children:w}),!r&&v.jsxs(Li,{variant:"ghost",size:"sm",onClick:()=>u(!0),className:"flex-shrink-0",children:[v.jsx(ch,{size:12}),A("harness.hooks.editJson")||"Edit JSON"]})]})]}),r?v.jsxs(v.Fragment,{children:[v.jsx("textarea",{value:d,onChange:a=>g(a.target.value),spellCheck:!1,className:"w-full h-64 px-3 py-2 text-xs font-mono leading-relaxed border border-warm-200 rounded-lg bg-warm-50 text-warm-700 focus:ring-1 focus:ring-accent focus:border-accent resize-y"}),l&&v.jsx("p",{className:"text-xs text-status-error",children:l}),v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx(Li,{variant:"primary",size:"sm",onClick:c,disabled:S,children:A(S?"harness.saving":"harness.save")}),v.jsx(Li,{variant:"ghost",size:"sm",onClick:()=>{g(JSON.stringify(s??{},null,2)),m(null),u(!1)},children:A("harness.cancel")})]})]}):C?v.jsxs("div",{className:"space-y-2",children:[b.map(a=>{const f=s==null?void 0:s[a],y=f===void 0?[]:Jg(f),R=Jg(h==null?void 0:h[a])??[];return v.jsxs("div",{className:"p-2.5 bg-warm-50 border border-warm-150 rounded-lg",children:[v.jsx("div",{className:"text-xs font-semibold text-warm-700 font-mono mb-1.5",children:a}),v.jsxs("div",{className:"space-y-1.5",children:[y?y.map((k,D)=>o(a,k,D,!0)):v.jsx("pre",{className:"text-[11px] text-warm-500 font-mono whitespace-pre-wrap break-all",children:JSON.stringify(f,null,2)}),R.map((k,D)=>o(a,k,D,!1))]})]},a)}),p&&v.jsx("p",{className:"text-[11px] text-warm-400",children:A("harness.hooks.parkedNote")})]}):v.jsx("p",{className:"text-xs text-warm-400",children:A("harness.hooks.empty")||"No hooks configured."})]})}function E2({skills:s,saving:h,onSave:w,onToggle:S}){const{t:M}=Tt(),[O,A]=j.useState(null),[r,u]=j.useState(""),d=s??[],g=d.find(b=>b.name===O)??null,l=!!g&&r!==g.content,m=b=>{if(O===b.name){A(null);return}A(b.name),u(b.content)};return v.jsxs("div",{className:"space-y-3 p-4 border border-warm-200 rounded-xl",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("h4",{className:"text-sm font-semibold text-warm-700",children:"Skills"}),v.jsx("code",{className:"text-[10px] text-warm-400",children:".claude/skills/"})]}),d.length===0?v.jsx("p",{className:"text-xs text-warm-400",children:M("harness.skills.empty")||"No skills found."}):v.jsx("div",{className:"space-y-1.5",children:d.map(b=>{const C=O===b.name;return v.jsxs("div",{className:"border border-warm-150 rounded-lg overflow-hidden",children:[v.jsxs("div",{className:"flex items-start gap-2 px-3 py-2 bg-warm-50 hover:bg-warm-100 transition-colors",children:[v.jsx("input",{type:"checkbox",checked:b.enabled,disabled:h,onChange:()=>S(b.name,!b.enabled),title:b.enabled?M("harness.toggle.disable"):M("harness.toggle.enable"),className:"mt-0.5 flex-shrink-0 cursor-pointer"}),v.jsxs("button",{type:"button",onClick:()=>m(b),className:`flex-1 min-w-0 flex items-start gap-2 text-left${b.enabled?"":" opacity-50"}`,children:[v.jsx("span",{className:"mt-0.5 text-warm-400 flex-shrink-0",children:C?v.jsx(Dh,{size:14}):v.jsx(n1,{size:14})}),v.jsxs("span",{className:"min-w-0",children:[v.jsxs("span",{className:"block text-xs font-semibold text-warm-700 font-mono",children:["/",b.name]}),b.description&&v.jsx("span",{className:"block text-[11px] text-warm-400 mt-0.5 line-clamp-2",children:b.description})]})]})]}),C&&v.jsxs("div",{className:"p-3 space-y-2 border-t border-warm-150",children:[v.jsx("code",{className:"block text-[10px] text-warm-400 truncate",title:b.path,children:b.path}),v.jsx("textarea",{value:r,onChange:p=>u(p.target.value),spellCheck:!1,className:"w-full h-80 px-3 py-2 text-xs font-mono leading-relaxed border border-warm-200 rounded-lg bg-warm-50 text-warm-700 focus:ring-1 focus:ring-accent focus:border-accent resize-y"}),v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx(Li,{variant:"primary",size:"sm",onClick:()=>l&&!h&&w(b.name,r),disabled:!l||h,children:M(h?"harness.saving":"harness.save")}),!l&&v.jsx("span",{className:"text-xs text-warm-400",children:M("harness.noChanges")})]})]})]},b.name)})})]})}function Qg(s){const h={};for(const w of s.split(`
|
|
424
|
+
`)){const S=w.trim();if(!S)continue;const M=S.indexOf("=");if(M<0)continue;const O=S.slice(0,M).trim(),A=S.slice(M+1).trim();O&&(h[O]=A)}return h}function Zg(s){return s?Object.entries(s).map(([h,w])=>`${h}=${w}`).join(`
|
|
425
|
+
`):""}function L2({open:s,initial:h,existingAliases:w,saving:S,onCancel:M,onSave:O}){const{t:A}=Tt(),[r,u]=j.useState(""),[d,g]=j.useState("stdio"),[l,m]=j.useState(""),[b,C]=j.useState(""),[p,o]=j.useState(""),[c,a]=j.useState(""),[f,y]=j.useState(""),[R,k]=j.useState(null);j.useEffect(()=>{s&&(u((h==null?void 0:h.alias)??""),g((h==null?void 0:h.transport)??"stdio"),m((h==null?void 0:h.command)??""),C(((h==null?void 0:h.args)??[]).join(" ")),o(Zg(h==null?void 0:h.env)),a((h==null?void 0:h.url)??""),y(Zg(h==null?void 0:h.headers)),k(null))},[s,h]);const D=!!h,E=async L=>{if(L.preventDefault(),S)return;if(!r.trim()){k(A("harness.mcp.errAlias"));return}if(!D&&w.includes(r.trim())){k(A("harness.mcp.errAliasExists"));return}const z={alias:r.trim(),transport:d};if(d==="stdio"){if(!l.trim()){k(A("harness.mcp.errCommand"));return}z.command=l.trim();const H=b.trim()?b.trim().split(/\s+/):[];H.length>0&&(z.args=H);const P=Qg(p);Object.keys(P).length>0&&(z.env=P)}else{if(!c.trim()){k(A("harness.mcp.errUrl"));return}z.url=c.trim();const H=Qg(f);Object.keys(H).length>0&&(z.headers=H)}try{await O(z)}catch(H){k(H instanceof Error?H.message:String(H))}};return v.jsx(Ho,{open:s,onClose:M,size:"lg",children:v.jsxs("form",{onSubmit:E,className:"bg-warm-0 rounded-2xl shadow-elevated p-5 space-y-4",children:[v.jsx("h3",{className:"text-base font-semibold text-warm-700",children:A(D?"harness.mcp.editTitle":"harness.mcp.addTitle")}),v.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[v.jsxs("div",{children:[v.jsx("label",{className:"text-xs text-warm-500 block mb-1",children:A("harness.mcp.alias")}),v.jsx("input",{type:"text",value:r,onChange:L=>u(L.target.value),disabled:D,placeholder:"memory",className:"w-full px-3 py-1.5 text-xs border border-warm-200 rounded-lg bg-warm-50 text-warm-700 focus:ring-1 focus:ring-accent focus:border-accent disabled:opacity-50"})]}),v.jsxs("div",{children:[v.jsx("label",{className:"text-xs text-warm-500 block mb-1",children:A("harness.mcp.transport")}),v.jsxs("select",{value:d,onChange:L=>g(L.target.value),className:"w-full px-3 py-1.5 text-xs border border-warm-200 rounded-lg bg-warm-50 text-warm-700 focus:ring-1 focus:ring-accent focus:border-accent",children:[v.jsx("option",{value:"stdio",children:"stdio"}),v.jsx("option",{value:"http",children:"http"}),v.jsx("option",{value:"sse",children:"sse"})]})]})]}),d==="stdio"?v.jsxs("div",{className:"space-y-3",children:[v.jsxs("div",{children:[v.jsx("label",{className:"text-xs text-warm-500 block mb-1",children:A("harness.mcp.command")}),v.jsx("input",{type:"text",value:l,onChange:L=>m(L.target.value),placeholder:"npx",className:"w-full px-3 py-1.5 text-xs font-mono border border-warm-200 rounded-lg bg-warm-50 text-warm-700 focus:ring-1 focus:ring-accent focus:border-accent"})]}),v.jsxs("div",{children:[v.jsx("label",{className:"text-xs text-warm-500 block mb-1",children:A("harness.mcp.args")}),v.jsx("input",{type:"text",value:b,onChange:L=>C(L.target.value),placeholder:"-y @modelcontextprotocol/server-memory",className:"w-full px-3 py-1.5 text-xs font-mono border border-warm-200 rounded-lg bg-warm-50 text-warm-700 focus:ring-1 focus:ring-accent focus:border-accent"})]}),v.jsxs("div",{children:[v.jsx("label",{className:"text-xs text-warm-500 block mb-1",children:A("harness.mcp.env")}),v.jsx("textarea",{value:p,onChange:L=>o(L.target.value),placeholder:`API_KEY=...
|
|
426
|
+
DEBUG=1`,rows:3,className:"w-full px-3 py-1.5 text-xs font-mono border border-warm-200 rounded-lg bg-warm-50 text-warm-700 focus:ring-1 focus:ring-accent focus:border-accent resize-y"})]})]}):v.jsxs("div",{className:"space-y-3",children:[v.jsxs("div",{children:[v.jsx("label",{className:"text-xs text-warm-500 block mb-1",children:A("harness.mcp.url")}),v.jsx("input",{type:"text",value:c,onChange:L=>a(L.target.value),placeholder:"https://example.com/mcp",className:"w-full px-3 py-1.5 text-xs font-mono border border-warm-200 rounded-lg bg-warm-50 text-warm-700 focus:ring-1 focus:ring-accent focus:border-accent"})]}),v.jsxs("div",{children:[v.jsx("label",{className:"text-xs text-warm-500 block mb-1",children:A("harness.mcp.headers")}),v.jsx("textarea",{value:f,onChange:L=>y(L.target.value),placeholder:"Authorization=Bearer ...",rows:3,className:"w-full px-3 py-1.5 text-xs font-mono border border-warm-200 rounded-lg bg-warm-50 text-warm-700 focus:ring-1 focus:ring-accent focus:border-accent resize-y"})]})]}),R&&v.jsx("p",{className:"text-xs text-status-error",children:R}),v.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2 border-t border-warm-150",children:[v.jsx(Li,{variant:"secondary",size:"sm",onClick:M,disabled:S,children:A("harness.cancel")}),v.jsx(Li,{type:"submit",variant:"primary",size:"sm",disabled:S,children:A(S?"harness.saving":"harness.save")})]})]})})}function R2(s){return s.length<=4?"****":`${s.slice(0,2)}${"*".repeat(Math.min(s.length-4,8))}${s.slice(-2)}`}function D2(s){if(s.transport==="stdio"){const h=s.args?" "+s.args.join(" "):"";return`${s.command??""}${h}`.trim()||"—"}return s.url??"—"}function T2({servers:s,saving:h,onUpsert:w,onRemove:S}){const{t:M}=Tt(),{confirm:O}=kr(),[A,r]=j.useState(null),[u,d]=j.useState(!1),[g,l]=j.useState(null),m=()=>{r(null),d(!0)},b=o=>{r(o),d(!0)},C=async o=>{await w(o),d(!1),r(null)},p=async o=>{if(await O({message:M("harness.mcp.confirmRemove").replace("{alias}",o),danger:!0})){l(o);try{await S(o)}finally{l(null)}}};return v.jsxs("div",{className:"space-y-3 p-4 border border-warm-200 rounded-xl",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("h4",{className:"text-sm font-semibold text-warm-700",children:M("harness.section.mcp")}),v.jsxs(Li,{variant:"primary",size:"sm",onClick:m,children:["+ ",M("harness.mcp.add")]})]}),s.length===0?v.jsx("p",{className:"text-xs text-warm-400",children:M("harness.mcp.empty")}):v.jsx("ul",{className:"space-y-2",children:s.map(o=>{const c=!!(o.env&&Object.keys(o.env).length>0)||!!(o.headers&&Object.keys(o.headers).length>0);return v.jsxs("li",{className:"p-3 border border-warm-150 rounded-lg bg-warm-50 flex items-start justify-between gap-3",children:[v.jsxs("div",{className:"min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[v.jsx("code",{className:"text-xs font-semibold text-warm-700",children:o.alias}),v.jsx("span",{className:"text-[10px] uppercase px-1.5 py-0.5 rounded-md bg-warm-200 text-warm-500",children:o.transport}),c&&v.jsx("span",{className:"text-[10px] uppercase px-1.5 py-0.5 rounded-md bg-warm-150 text-warm-500",children:"env"})]}),v.jsx("code",{className:"text-xs font-mono text-warm-500 break-all",children:D2(o)}),o.env&&Object.keys(o.env).length>0&&v.jsx("div",{className:"mt-1 text-[10px] font-mono text-warm-400 space-y-0.5",children:Object.entries(o.env).map(([a,f])=>v.jsxs("div",{children:[a,"=",R2(f)]},a))})]}),v.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[v.jsx(Li,{variant:"secondary",size:"sm",onClick:()=>b(o),children:M("harness.edit")}),v.jsx(Li,{variant:"danger",size:"sm",onClick:()=>p(o.alias),disabled:g===o.alias,children:g===o.alias?"…":M("harness.delete")})]})]},o.alias)})}),v.jsx(L2,{open:u,initial:A,existingAliases:s.map(o=>o.alias),saving:h,onCancel:()=>{d(!1),r(null)},onSave:C})]})}function M2({projectId:s,cli:h,snapshot:w,onChange:S}){const{t:M}=Tt(),{confirm:O}=kr(),[A,r]=j.useState(!1),[u,d]=j.useState(!1),[g,l]=j.useState(!1),[m,b]=j.useState(!1),[C,p]=j.useState(!1),[o,c]=j.useState(!1),[a,f]=j.useState(!1),[y,R]=j.useState(!1),[k,D]=j.useState(null),E=async U=>{r(!0),D(null);try{const T=await d2(s,h,U);S(T)}catch(T){D(T instanceof Error?T.message:String(T))}finally{r(!1)}},L=async U=>{d(!0),D(null);try{await f2(s,h,U);const T=await Kg(s,h);S(T)}catch(T){D(T instanceof Error?T.message:String(T))}finally{d(!1)}},z=async U=>{l(!0),D(null);try{await p2(s,h,U);const T=await Kg(s,h);S(T)}catch(T){D(T instanceof Error?T.message:String(T))}finally{l(!1)}},H=async U=>{b(!0),D(null);try{const T=await m2(s,h,U);S(T)}catch(T){D(T instanceof Error?T.message:String(T))}finally{b(!1)}},P=async(U,T,F)=>{b(!0),D(null);try{const B=await g2(s,h,U,T,F);S(B)}catch(B){D(B instanceof Error?B.message:String(B))}finally{b(!1)}},I=async(U,T)=>{p(!0),D(null);try{const F=await v2(s,h,U,T);S(F)}catch(F){D(F instanceof Error?F.message:String(F))}finally{p(!1)}},K=async(U,T)=>{p(!0),D(null);try{const F=await _2(s,h,U,T);S(F)}catch(F){D(F instanceof Error?F.message:String(F))}finally{p(!1)}},X=async()=>{if(await O(M("harness.port.confirm"))){R(!0),D(null);try{const U=await b2(s,h);S(U)}catch(U){D(U instanceof Error?U.message:String(U))}finally{R(!1)}}},Y=async U=>{c(!0),D(null);try{const T=await y2(s,h,U);S({...w,mcp:T})}catch(T){throw D(T instanceof Error?T.message:String(T)),T}finally{c(!1)}},$=async U=>{c(!0),D(null);try{const T=await w2(s,h,U);S({...w,mcp:T})}catch(T){D(T instanceof Error?T.message:String(T))}finally{c(!1)}};return v.jsxs("div",{className:"space-y-4",children:[k&&v.jsx("div",{className:"p-3 rounded-lg bg-status-error/5 text-xs text-status-error",children:k}),w.warnings.includes("codex.trustLevelMissing")&&v.jsxs("div",{className:"p-3 border border-status-warning/30 rounded-lg bg-status-warning/5 text-xs text-warm-600",children:[v.jsx("p",{className:"font-semibold mb-1",children:M("harness.warning.codexTrustLevel.title")}),v.jsx("p",{className:"mb-2",children:M("harness.warning.codexTrustLevel.body")}),v.jsx("pre",{className:"px-2 py-1 bg-warm-50 border border-warm-150 rounded-md text-[11px] font-mono whitespace-pre-wrap break-all",children:`[projects."${w.filePaths.settings.replace(/[\\/]\.codex[\\/]config\.toml$/,"").replace(/\\/g,"\\\\")}"]
|
|
427
|
+
trust_level = "trusted"`})]}),h==="codex"&&v.jsx("div",{className:"p-3 border border-warm-200 rounded-lg bg-warm-50 text-xs text-warm-500",children:M("harness.warning.tomlComments")}),h!=="claude"&&v.jsxs("div",{className:"flex items-center justify-between gap-3 p-3 border border-warm-200 rounded-lg bg-warm-50",children:[v.jsx("p",{className:"text-xs text-warm-500",children:M("harness.port.note")}),v.jsx(Li,{variant:"primary",size:"sm",onClick:X,disabled:y,className:"shrink-0",children:M(y?"harness.port.running":"harness.port.button")})]}),v.jsx(C2,{cli:h,settings:w.settings,saving:A,onSave:E}),v.jsx(Vg,{filePath:w.filePaths.memory,content:w.memory,saving:u,onSave:L}),h==="claude"&&w.filePaths.localMemory&&(w.localMemoryExists||a?v.jsx(Vg,{filePath:w.filePaths.localMemory,content:w.localMemory??"",saving:g,onSave:z}):v.jsxs("button",{type:"button",onClick:()=>f(!0),className:"w-full flex items-center justify-center gap-1.5 px-3 py-2.5 text-xs text-warm-400 hover:text-warm-600 border border-dashed border-warm-200 hover:border-warm-300 rounded-xl transition-colors",children:[v.jsx(Mn,{size:14}),M("harness.localMemory.create")||"Create CLAUDE.local.md"]})),h==="claude"&&v.jsxs(v.Fragment,{children:[v.jsx(k2,{hooks:w.hooks,disabledHooks:w.disabledHooks,filePath:w.filePaths.settings,saving:m,onSave:H,onToggle:P}),v.jsx(E2,{skills:w.skills,saving:C,onSave:K,onToggle:I})]}),v.jsx(T2,{servers:w.mcp,saving:o,onUpsert:Y,onRemove:$})]})}const A2=["claude","antigravity","codex"],R_="harness:active-cli";function j2(s){try{const h=localStorage.getItem(`${R_}:${s}`);if(h==="claude"||h==="antigravity"||h==="codex")return h}catch{}return"claude"}function O2(s,h){try{localStorage.setItem(`${R_}:${s}`,h)}catch{}}function B2({project:s}){const{t:h}=Tt(),[w,S]=j.useState(null),[M,O]=j.useState(()=>j2(s.id)),[A,r]=j.useState(null);j.useEffect(()=>{let g=!1;return r(null),S(null),h2(s.id).then(l=>{g||S(l)}).catch(l=>{g||r(l instanceof Error?l.message:String(l))}),()=>{g=!0}},[s.id]);const u=g=>{O(g),O2(s.id,g)},d=(g,l)=>{S(m=>m&&{...m,[g]:l})};return v.jsxs("div",{className:"space-y-4",children:[v.jsxs("div",{className:"p-3 border border-status-warning/30 rounded-lg bg-status-warning/5 text-xs text-warm-600",children:[v.jsx("p",{className:"font-semibold mb-1",children:h("harness.warning.worktreeIsolation.title")}),v.jsx("p",{children:h("harness.warning.worktreeIsolation.body")})]}),v.jsx("div",{className:"flex items-center gap-1 border-b border-warm-200",children:A2.map(g=>v.jsx("button",{type:"button",onClick:()=>u(g),className:`px-4 py-2 text-xs font-medium border-b-2 -mb-px transition-colors ${M===g?"border-accent text-accent-dark":"border-transparent text-warm-500 hover:text-warm-700"}`,children:h(`harness.cli.${g}`)},g))}),A&&v.jsx("div",{className:"p-3 rounded-lg bg-status-error/5 text-xs text-status-error",children:A}),!w&&!A&&v.jsx("p",{className:"text-xs text-warm-400",children:h("harness.loading")}),w&&v.jsx(M2,{projectId:s.id,cli:M,snapshot:w[M],onChange:g=>d(M,g)})]})}function N2(s){return null}const z2={id:"harness",displayName:"Harness",displayNameKo:"하네스",PanelComponent:B2,SettingsComponent:N2,hasTab:!1,isEnabled:s=>!!s.path,translations:{en:{"tabs.harness":"Harness","tabs.harness.help":"Edit your global Claude/Antigravity/Codex CLI config — settings, memory, and MCP servers — without leaving the project. Note: changes affect your user-level CLI dirs, not the worktree.","harness.settingsTitle":"Harness Configuration","harness.settingsDesc":"Edit Claude / Antigravity / Codex CLI settings, memory files, and MCP servers.","harness.loading":"Loading harness configuration…","harness.cli.claude":"Claude","harness.cli.antigravity":"Antigravity","harness.cli.codex":"Codex","harness.section.settings":"Settings","harness.section.mcp":"MCP Servers","harness.field.model":"Model","harness.field.modelPlaceholder.claude":"e.g. claude-sonnet-4-6","harness.field.modelPlaceholder.antigravity":"e.g. leave blank for default","harness.field.modelPlaceholder.codex":"e.g. gpt-5","harness.field.approvalMode":"Approval Mode","harness.field.sandbox":"Sandbox","harness.field.unset":"(unset)","harness.save":"Save","harness.saving":"Saving…","harness.cancel":"Cancel","harness.edit":"Edit","harness.delete":"Delete","harness.noChanges":"No changes","harness.memory.placeholder":"Project context the AI should always know about (preferences, conventions, key files)…","harness.memory.expand":"Expand editor","harness.memory.collapse":"Collapse editor","harness.localMemory.create":"Create CLAUDE.local.md","harness.memory.resize":"Drag to resize, double-click to reset","harness.find.open":"Find (Ctrl+F)","harness.find.placeholder":"Find… (Enter: next, Shift+Enter: previous)","harness.find.prev":"Previous match","harness.find.next":"Next match","harness.find.close":"Close (Esc)","harness.hooks.empty":"No hooks configured.","harness.hooks.editJson":"Edit JSON","harness.hooks.invalidJson":"Invalid JSON — fix the syntax and try again.","harness.hooks.parkedNote":"Disabled hooks are kept in .claude/hooks.disabled.json and restored when re-enabled.","harness.skills.empty":"No skills in .claude/skills/.","harness.toggle.enable":"Enable","harness.toggle.disable":"Disable","harness.port.button":"Import from Claude","harness.port.running":"Importing…","harness.port.note":"Inline CLAUDE.md and .claude/skills/ into AGENTS.md. Hooks are not ported — this CLI has no hook mechanism.","harness.port.confirm":"Port CLAUDE.md + skills into AGENTS.md? A marked block is inserted (or replaced on re-port); content outside the block is kept.","harness.mcp.add":"Add Server","harness.mcp.empty":"No MCP servers configured.","harness.mcp.addTitle":"Add MCP Server","harness.mcp.editTitle":"Edit MCP Server","harness.mcp.alias":"Alias","harness.mcp.transport":"Transport","harness.mcp.command":"Command","harness.mcp.args":"Arguments (space-separated)","harness.mcp.env":"Environment (one KEY=VALUE per line)","harness.mcp.url":"URL","harness.mcp.headers":"Headers (one KEY=VALUE per line)","harness.mcp.confirmRemove":'Remove MCP server "{alias}"?',"harness.mcp.errAlias":"Alias is required.","harness.mcp.errAliasExists":"An MCP server with this alias already exists.","harness.mcp.errCommand":"Command is required for stdio transport.","harness.mcp.errUrl":"URL is required for HTTP/SSE transport.","harness.warning.worktreeIsolation.title":"Edits apply outside CLITrigger worktrees","harness.warning.worktreeIsolation.body":"Changes are saved to the project root. CLI tools launched directly from your terminal pick them up immediately. CLITrigger todos run inside .worktrees/<branch>/, so tracked files (CLAUDE.md, .claude/settings.json) are only included once you commit, and untracked files (.mcp.json, settings.local.json) are not copied automatically.","harness.warning.tomlComments":"Note: saving Codex config.toml via this UI may strip existing comments. Edit the file in a text editor if you want to preserve them.","harness.warning.codexTrustLevel.title":"Codex trust level required","harness.warning.codexTrustLevel.body":"Codex only loads project-level config.toml when this project is marked trusted in your user-global ~/.codex/config.toml. Add the snippet below to enable it:"},ko:{"tabs.harness":"하네스","tabs.harness.help":"Claude/Antigravity/Codex의 사용자 설정·메모리·MCP 서버를 한 곳에서 편집. 변경은 worktree가 아니라 사용자 글로벌 CLI 디렉토리에 적용됩니다.","harness.settingsTitle":"하네스 구성","harness.settingsDesc":"Claude / Antigravity / Codex CLI 설정·메모리 파일·MCP 서버를 편집합니다.","harness.loading":"하네스 구성 불러오는 중…","harness.cli.claude":"Claude","harness.cli.antigravity":"Antigravity","harness.cli.codex":"Codex","harness.section.settings":"설정","harness.section.mcp":"MCP 서버","harness.field.model":"모델","harness.field.modelPlaceholder.claude":"예: claude-sonnet-4-6","harness.field.modelPlaceholder.antigravity":"예: 비워두면 기본값","harness.field.modelPlaceholder.codex":"예: gpt-5","harness.field.approvalMode":"승인 모드","harness.field.sandbox":"샌드박스","harness.field.unset":"(미설정)","harness.save":"저장","harness.saving":"저장 중…","harness.cancel":"취소","harness.edit":"편집","harness.delete":"삭제","harness.noChanges":"변경사항 없음","harness.memory.placeholder":"AI가 항상 알고 있어야 할 프로젝트 컨텍스트(취향, 컨벤션, 주요 파일)…","harness.memory.expand":"에디터 확대","harness.memory.collapse":"에디터 축소","harness.localMemory.create":"CLAUDE.local.md 만들기","harness.memory.resize":"드래그로 높이 조절, 더블클릭으로 초기화","harness.find.open":"찾기 (Ctrl+F)","harness.find.placeholder":"찾기… (Enter: 다음, Shift+Enter: 이전)","harness.find.prev":"이전 결과","harness.find.next":"다음 결과","harness.find.close":"닫기 (Esc)","harness.hooks.empty":"설정된 hook이 없습니다.","harness.hooks.editJson":"JSON 편집","harness.hooks.invalidJson":"JSON 형식이 올바르지 않습니다. 수정 후 다시 저장하세요.","harness.hooks.parkedNote":"꺼진 훅은 .claude/hooks.disabled.json 에 보관되며, 다시 켜면 복원됩니다.","harness.skills.empty":".claude/skills/ 에 스킬이 없습니다.","harness.toggle.enable":"켜기","harness.toggle.disable":"끄기","harness.port.button":"Claude에서 가져오기","harness.port.running":"가져오는 중…","harness.port.note":"CLAUDE.md와 .claude/skills/ 를 AGENTS.md에 인라인합니다. 훅은 이 CLI에 실행 메커니즘이 없어 포팅되지 않습니다.","harness.port.confirm":"CLAUDE.md + 스킬을 AGENTS.md로 포팅할까요? 마커 블록으로 삽입되며(재실행 시 블록만 교체), 블록 밖 내용은 유지됩니다.","harness.mcp.add":"서버 추가","harness.mcp.empty":"등록된 MCP 서버가 없습니다.","harness.mcp.addTitle":"MCP 서버 추가","harness.mcp.editTitle":"MCP 서버 편집","harness.mcp.alias":"별칭","harness.mcp.transport":"전송 방식","harness.mcp.command":"명령어","harness.mcp.args":"인자 (공백 구분)","harness.mcp.env":"환경 변수 (한 줄에 KEY=VALUE)","harness.mcp.url":"URL","harness.mcp.headers":"헤더 (한 줄에 KEY=VALUE)","harness.mcp.confirmRemove":'MCP 서버 "{alias}" 을(를) 삭제할까요?',"harness.mcp.errAlias":"별칭은 필수입니다.","harness.mcp.errAliasExists":"이미 같은 별칭의 MCP 서버가 있습니다.","harness.mcp.errCommand":"stdio 전송 방식에는 명령어가 필요합니다.","harness.mcp.errUrl":"HTTP/SSE 전송 방식에는 URL이 필요합니다.","harness.warning.worktreeIsolation.title":"편집 사항은 CLITrigger worktree 밖에 적용됩니다","harness.warning.worktreeIsolation.body":"변경 사항은 프로젝트 루트에 저장됩니다. 터미널에서 CLI를 직접 띄울 때는 바로 적용되지만, CLITrigger의 todo는 .worktrees/<branch>/ 안에서 실행되므로 추적 파일(CLAUDE.md, .claude/settings.json)은 커밋해야 다음 worktree 생성 시 반영되고, untracked 파일(.mcp.json, settings.local.json)은 자동으로 복사되지 않습니다.","harness.warning.tomlComments":"참고: 이 UI로 Codex config.toml을 저장하면 기존 주석이 사라질 수 있습니다. 주석을 보존하려면 텍스트 에디터에서 직접 편집하세요.","harness.warning.codexTrustLevel.title":"Codex 신뢰 수준이 필요합니다","harness.warning.codexTrustLevel.body":"Codex는 ~/.codex/config.toml에 이 프로젝트가 trusted로 등록된 경우에만 프로젝트별 config.toml을 읽습니다. 아래 스니펫을 추가하세요:"}}};function H2(){Nw(z2)}const P2={success:l1,error:u1,warning:kv,info:M1},I2={success:"text-status-success",error:"text-status-error",warning:"text-status-warning",info:"text-accent"},F2={success:"bg-status-success",error:"bg-status-error",warning:"bg-status-warning",info:"bg-accent"};function U2({toast:s,onDismiss:h}){const[w,S]=j.useState(!1),M=P2[s.type],O=s.duration??3500;return j.useEffect(()=>{const A=requestAnimationFrame(()=>S(!0));return()=>cancelAnimationFrame(A)},[]),v.jsxs("div",{role:s.type==="error"?"alert":"status","aria-atomic":"true",className:Tn("relative flex items-start gap-3 px-4 py-3 rounded-xl shadow-elevated overflow-hidden","bg-theme-card border border-theme-border min-w-[280px] max-w-sm","transition-all duration-300",w?"animate-slide-in-right opacity-100":"opacity-0 translate-x-8"),children:[v.jsx(M,{size:16,className:Tn("mt-0.5 flex-shrink-0",I2[s.type])}),v.jsx("p",{className:"text-xs text-theme-text flex-1 leading-snug",children:s.message}),v.jsx("button",{type:"button","aria-label":"Dismiss notification",onClick:()=>h(s.id),className:"p-0.5 rounded-md text-theme-muted hover:text-theme-text transition-colors flex-shrink-0",children:v.jsx(Ri,{size:12})}),v.jsx("div",{className:Tn("absolute bottom-0 left-0 h-0.5",F2[s.type]),style:{animation:`toastProgress ${O}ms linear forwards`}})]})}function $2({toasts:s,onDismiss:h}){return s.length===0?null:zi.createPortal(v.jsx("div",{"aria-live":"polite","aria-relevant":"additions",className:"fixed bottom-6 right-6 z-toast flex flex-col gap-2 items-end",children:s.map(w=>v.jsx(U2,{toast:w,onDismiss:h},w.id))}),document.body)}class W2 extends j.Component{constructor(){super(...arguments);jm(this,"state",{error:null})}static getDerivedStateFromError(w){return{error:w}}componentDidCatch(w,S){console.error("[app] render failed:",w,S),window.dispatchEvent(new CustomEvent("app:render-error",{detail:w}))}render(){return this.state.error?v.jsx("main",{className:"min-h-screen bg-theme-bg flex items-center justify-center p-6",children:v.jsxs("section",{role:"alert",className:"card w-full max-w-lg p-8 text-center shadow-elevated",children:[v.jsx(yS,{size:32,className:"mx-auto mb-4 text-status-error"}),v.jsx("h1",{className:"text-xl font-semibold text-theme-text mb-2",children:this.props.title}),v.jsx("p",{className:"text-sm text-theme-text-secondary mb-6",children:this.props.description}),v.jsxs("button",{type:"button",className:"btn-primary mx-auto",onClick:()=>window.location.reload(),children:[v.jsx(Av,{size:16}),this.props.reloadLabel]})]})}):this.props.children}}function q2({children:s}){const{t:h}=Tt();return v.jsx(W2,{title:h("errors.renderTitle"),description:h("errors.renderDescription"),reloadLabel:h("errors.reload"),children:s})}H2();const on=window.electronAPI;var ev;(ev=on==null?void 0:on.onTerminalZoom)==null||ev.call(on,s=>{var h;document.querySelector("[data-term-container]:hover")||(h=on.zoomPage)==null||h.call(on,s)});function G2(){const{toasts:s,error:h,dismiss:w}=un(),{t:S}=Tt();return j.useEffect(()=>{const M=u=>{if(Gv(u,"").includes("(reading 'dimensions')")){console.debug("[global-error] suppressed xterm teardown error:",u);return}console.error("[global-error]",u),h(u instanceof pl?u.message:S("errors.unexpected"),7e3)},O=u=>{const d=u.error??u.message;if(Sx(d)){u.preventDefault();return}M(d)},A=u=>M(u.reason),r=u=>M(u.detail);return window.addEventListener("error",O),window.addEventListener("unhandledrejection",A),window.addEventListener("app:render-error",r),()=>{window.removeEventListener("error",O),window.removeEventListener("unhandledrejection",A),window.removeEventListener("app:render-error",r)}},[h,S]),v.jsx($2,{toasts:s,onDismiss:w})}function Y2(){const s=GS(),h=KS();return v.jsx(Hv.Provider,{value:s,children:v.jsx(Pv.Provider,{value:h,children:v.jsx(VS,{children:v.jsxs(Pw,{children:[v.jsx(ex,{children:v.jsx(q2,{children:v.jsx(u2,{})})}),v.jsx(G2,{})]})})})})}Vb.createRoot(document.getElementById("root")).render(v.jsx(tv.StrictMode,{children:v.jsx(Y2,{})}));export{Do as $,Z2 as A,ag as B,Dh as C,yS as D,AS as E,Dv as F,x1 as G,B2 as H,Ei as I,lh as J,R1 as K,es as L,Ho as M,Mv as N,tS as O,Mn as P,jv as Q,Av as R,og as S,Ov as T,cg as U,Ce as V,_t as W,Ri as X,ik as Y,zi as Z,Oo as _,Tt as a,Gk as a$,gk as a0,ck as a1,mk as a2,xk as a3,Ck as a4,WC as a5,ak as a6,lk as a7,Hk as a8,Pk as a9,jk as aA,Ak as aB,pl as aC,Li as aD,Ev as aE,h_ as aF,cx as aG,Wv as aH,VC as aI,Xk as aJ,Vk as aK,Eg as aL,qk as aM,Ah as aN,_r as aO,El as aP,Q1 as aQ,V1 as aR,K1 as aS,Cv as aT,Th as aU,By as aV,kw as aW,Ll as aX,ek as aY,tC as aZ,gh as a_,Ik as aa,kk as ab,Ek as ac,CC as ad,kC as ae,Nk as af,_k as ag,Mk as ah,Bk as ai,Ok as aj,Fk as ak,zk as al,Dk as am,Lk as an,Rk as ao,fk as ap,pk as aq,vk as ar,Tk as as,yk as at,bk as au,wk as av,Sk as aw,hk as ax,uk as ay,dk as az,un as b,Yk as b0,sk as b1,nk as b2,Jk as b3,Tn as b4,Rv as b5,$k as b6,Wk as b7,l1 as b8,u1 as b9,Uk as ba,NS as bb,sg as bc,yh as bd,ig as be,wh as bf,V2 as bg,JC as bh,kv as bi,_1 as bj,SS as bk,YS as bl,X2 as bm,tv as bn,J2 as bo,Xb as bp,Qe as c,kr as d,BS as e,Gv as f,Bv as g,rk as h,pi as i,v as j,To as k,ix as l,MS as m,jS as n,bt as o,nt as p,Cr as q,j as r,Di as s,Kk as t,xl as u,n1 as v,Q2 as w,tk as x,ok as y,ch as z};
|