aegis-bridge 2.8.1 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,262 @@
1
+ var z0=Object.defineProperty;var j0=(i,s,a)=>s in i?z0(i,s,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[s]=a;var Et=(i,s,a)=>j0(i,typeof s!="symbol"?s+"":s,a);(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const g of document.querySelectorAll('link[rel="modulepreload"]'))o(g);new MutationObserver(g=>{for(const w of g)if(w.type==="childList")for(const T of w.addedNodes)T.tagName==="LINK"&&T.rel==="modulepreload"&&o(T)}).observe(document,{childList:!0,subtree:!0});function a(g){const w={};return g.integrity&&(w.integrity=g.integrity),g.referrerPolicy&&(w.referrerPolicy=g.referrerPolicy),g.crossOrigin==="use-credentials"?w.credentials="include":g.crossOrigin==="anonymous"?w.credentials="omit":w.credentials="same-origin",w}function o(g){if(g.ep)return;g.ep=!0;const w=a(g);fetch(g.href,w)}})();function lp(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Ru={exports:{}},oa={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var am;function H0(){if(am)return oa;am=1;var i=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function a(o,g,w){var T=null;if(w!==void 0&&(T=""+w),g.key!==void 0&&(T=""+g.key),"key"in g){w={};for(var l in g)l!=="key"&&(w[l]=g[l])}else w=g;return g=w.ref,{$$typeof:i,type:o,key:T,ref:g!==void 0?g:null,props:w}}return oa.Fragment=s,oa.jsx=a,oa.jsxs=a,oa}var om;function U0(){return om||(om=1,Ru.exports=H0()),Ru.exports}var O=U0(),Du={exports:{}},Ae={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var lm;function I0(){if(lm)return Ae;lm=1;var i=Symbol.for("react.transitional.element"),s=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),T=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),b=Symbol.iterator;function x(L){return L===null||typeof L!="object"?null:(L=b&&L[b]||L["@@iterator"],typeof L=="function"?L:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,_={};function v(L,H,X){this.props=L,this.context=H,this.refs=_,this.updater=X||k}v.prototype.isReactComponent={},v.prototype.setState=function(L,H){if(typeof L!="object"&&typeof L!="function"&&L!=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,L,H,"setState")},v.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function f(){}f.prototype=v.prototype;function p(L,H,X){this.props=L,this.context=H,this.refs=_,this.updater=X||k}var S=p.prototype=new f;S.constructor=p,C(S,v.prototype),S.isPureReactComponent=!0;var A=Array.isArray;function R(){}var M={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function B(L,H,X){var ne=X.ref;return{$$typeof:i,type:L,key:H,ref:ne!==void 0?ne:null,props:X}}function $(L,H){return B(L.type,H,L.props)}function I(L){return typeof L=="object"&&L!==null&&L.$$typeof===i}function q(L){var H={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(X){return H[X]})}var P=/\/+/g;function Q(L,H){return typeof L=="object"&&L!==null&&L.key!=null?q(""+L.key):H.toString(36)}function re(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(R,R):(L.status="pending",L.then(function(H){L.status==="pending"&&(L.status="fulfilled",L.value=H)},function(H){L.status==="pending"&&(L.status="rejected",L.reason=H)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function G(L,H,X,ne,he){var me=typeof L;(me==="undefined"||me==="boolean")&&(L=null);var Y=!1;if(L===null)Y=!0;else switch(me){case"bigint":case"string":case"number":Y=!0;break;case"object":switch(L.$$typeof){case i:case s:Y=!0;break;case y:return Y=L._init,G(Y(L._payload),H,X,ne,he)}}if(Y)return he=he(L),Y=ne===""?"."+Q(L,0):ne,A(he)?(X="",Y!=null&&(X=Y.replace(P,"$&/")+"/"),G(he,H,X,"",function(oe){return oe})):he!=null&&(I(he)&&(he=$(he,X+(he.key==null||L&&L.key===he.key?"":(""+he.key).replace(P,"$&/")+"/")+Y)),H.push(he)),1;Y=0;var j=ne===""?".":ne+":";if(A(L))for(var ce=0;ce<L.length;ce++)ne=L[ce],me=j+Q(ne,ce),Y+=G(ne,H,X,me,he);else if(ce=x(L),typeof ce=="function")for(L=ce.call(L),ce=0;!(ne=L.next()).done;)ne=ne.value,me=j+Q(ne,ce++),Y+=G(ne,H,X,me,he);else if(me==="object"){if(typeof L.then=="function")return G(re(L),H,X,ne,he);throw H=String(L),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return Y}function V(L,H,X){if(L==null)return L;var ne=[],he=0;return G(L,ne,"","",function(me){return H.call(X,me,he++)}),ne}function ee(L){if(L._status===-1){var H=L._result;H=H(),H.then(function(X){(L._status===0||L._status===-1)&&(L._status=1,L._result=X)},function(X){(L._status===0||L._status===-1)&&(L._status=2,L._result=X)}),L._status===-1&&(L._status=0,L._result=H)}if(L._status===1)return L._result.default;throw L._result}var N=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},U={map:V,forEach:function(L,H,X){V(L,function(){H.apply(this,arguments)},X)},count:function(L){var H=0;return V(L,function(){H++}),H},toArray:function(L){return V(L,function(H){return H})||[]},only:function(L){if(!I(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return Ae.Activity=m,Ae.Children=U,Ae.Component=v,Ae.Fragment=a,Ae.Profiler=g,Ae.PureComponent=p,Ae.StrictMode=o,Ae.Suspense=h,Ae.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,Ae.__COMPILER_RUNTIME={__proto__:null,c:function(L){return M.H.useMemoCache(L)}},Ae.cache=function(L){return function(){return L.apply(null,arguments)}},Ae.cacheSignal=function(){return null},Ae.cloneElement=function(L,H,X){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var ne=C({},L.props),he=L.key;if(H!=null)for(me in H.key!==void 0&&(he=""+H.key),H)!E.call(H,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&H.ref===void 0||(ne[me]=H[me]);var me=arguments.length-2;if(me===1)ne.children=X;else if(1<me){for(var Y=Array(me),j=0;j<me;j++)Y[j]=arguments[j+2];ne.children=Y}return B(L.type,he,ne)},Ae.createContext=function(L){return L={$$typeof:T,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:w,_context:L},L},Ae.createElement=function(L,H,X){var ne,he={},me=null;if(H!=null)for(ne in H.key!==void 0&&(me=""+H.key),H)E.call(H,ne)&&ne!=="key"&&ne!=="__self"&&ne!=="__source"&&(he[ne]=H[ne]);var Y=arguments.length-2;if(Y===1)he.children=X;else if(1<Y){for(var j=Array(Y),ce=0;ce<Y;ce++)j[ce]=arguments[ce+2];he.children=j}if(L&&L.defaultProps)for(ne in Y=L.defaultProps,Y)he[ne]===void 0&&(he[ne]=Y[ne]);return B(L,me,he)},Ae.createRef=function(){return{current:null}},Ae.forwardRef=function(L){return{$$typeof:l,render:L}},Ae.isValidElement=I,Ae.lazy=function(L){return{$$typeof:y,_payload:{_status:-1,_result:L},_init:ee}},Ae.memo=function(L,H){return{$$typeof:u,type:L,compare:H===void 0?null:H}},Ae.startTransition=function(L){var H=M.T,X={};M.T=X;try{var ne=L(),he=M.S;he!==null&&he(X,ne),typeof ne=="object"&&ne!==null&&typeof ne.then=="function"&&ne.then(R,N)}catch(me){N(me)}finally{H!==null&&X.types!==null&&(H.types=X.types),M.T=H}},Ae.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},Ae.use=function(L){return M.H.use(L)},Ae.useActionState=function(L,H,X){return M.H.useActionState(L,H,X)},Ae.useCallback=function(L,H){return M.H.useCallback(L,H)},Ae.useContext=function(L){return M.H.useContext(L)},Ae.useDebugValue=function(){},Ae.useDeferredValue=function(L,H){return M.H.useDeferredValue(L,H)},Ae.useEffect=function(L,H){return M.H.useEffect(L,H)},Ae.useEffectEvent=function(L){return M.H.useEffectEvent(L)},Ae.useId=function(){return M.H.useId()},Ae.useImperativeHandle=function(L,H,X){return M.H.useImperativeHandle(L,H,X)},Ae.useInsertionEffect=function(L,H){return M.H.useInsertionEffect(L,H)},Ae.useLayoutEffect=function(L,H){return M.H.useLayoutEffect(L,H)},Ae.useMemo=function(L,H){return M.H.useMemo(L,H)},Ae.useOptimistic=function(L,H){return M.H.useOptimistic(L,H)},Ae.useReducer=function(L,H,X){return M.H.useReducer(L,H,X)},Ae.useRef=function(L){return M.H.useRef(L)},Ae.useState=function(L){return M.H.useState(L)},Ae.useSyncExternalStore=function(L,H,X){return M.H.useSyncExternalStore(L,H,X)},Ae.useTransition=function(){return M.H.useTransition()},Ae.version="19.2.4",Ae}var cm;function sh(){return cm||(cm=1,Du.exports=I0()),Du.exports}var F=sh();const va=lp(F);var ku={exports:{}},la={},Ou={exports:{}},Mu={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var um;function P0(){return um||(um=1,(function(i){function s(G,V){var ee=G.length;G.push(V);e:for(;0<ee;){var N=ee-1>>>1,U=G[N];if(0<g(U,V))G[N]=V,G[ee]=U,ee=N;else break e}}function a(G){return G.length===0?null:G[0]}function o(G){if(G.length===0)return null;var V=G[0],ee=G.pop();if(ee!==V){G[0]=ee;e:for(var N=0,U=G.length,L=U>>>1;N<L;){var H=2*(N+1)-1,X=G[H],ne=H+1,he=G[ne];if(0>g(X,ee))ne<U&&0>g(he,X)?(G[N]=he,G[ne]=ee,N=ne):(G[N]=X,G[H]=ee,N=H);else if(ne<U&&0>g(he,ee))G[N]=he,G[ne]=ee,N=ne;else break e}}return V}function g(G,V){var ee=G.sortIndex-V.sortIndex;return ee!==0?ee:G.id-V.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var w=performance;i.unstable_now=function(){return w.now()}}else{var T=Date,l=T.now();i.unstable_now=function(){return T.now()-l}}var h=[],u=[],y=1,m=null,b=3,x=!1,k=!1,C=!1,_=!1,v=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;function S(G){for(var V=a(u);V!==null;){if(V.callback===null)o(u);else if(V.startTime<=G)o(u),V.sortIndex=V.expirationTime,s(h,V);else break;V=a(u)}}function A(G){if(C=!1,S(G),!k)if(a(h)!==null)k=!0,R||(R=!0,q());else{var V=a(u);V!==null&&re(A,V.startTime-G)}}var R=!1,M=-1,E=5,B=-1;function $(){return _?!0:!(i.unstable_now()-B<E)}function I(){if(_=!1,R){var G=i.unstable_now();B=G;var V=!0;try{e:{k=!1,C&&(C=!1,f(M),M=-1),x=!0;var ee=b;try{t:{for(S(G),m=a(h);m!==null&&!(m.expirationTime>G&&$());){var N=m.callback;if(typeof N=="function"){m.callback=null,b=m.priorityLevel;var U=N(m.expirationTime<=G);if(G=i.unstable_now(),typeof U=="function"){m.callback=U,S(G),V=!0;break t}m===a(h)&&o(h),S(G)}else o(h);m=a(h)}if(m!==null)V=!0;else{var L=a(u);L!==null&&re(A,L.startTime-G),V=!1}}break e}finally{m=null,b=ee,x=!1}V=void 0}}finally{V?q():R=!1}}}var q;if(typeof p=="function")q=function(){p(I)};else if(typeof MessageChannel<"u"){var P=new MessageChannel,Q=P.port2;P.port1.onmessage=I,q=function(){Q.postMessage(null)}}else q=function(){v(I,0)};function re(G,V){M=v(function(){G(i.unstable_now())},V)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(G){G.callback=null},i.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<G?Math.floor(1e3/G):5},i.unstable_getCurrentPriorityLevel=function(){return b},i.unstable_next=function(G){switch(b){case 1:case 2:case 3:var V=3;break;default:V=b}var ee=b;b=V;try{return G()}finally{b=ee}},i.unstable_requestPaint=function(){_=!0},i.unstable_runWithPriority=function(G,V){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var ee=b;b=G;try{return V()}finally{b=ee}},i.unstable_scheduleCallback=function(G,V,ee){var N=i.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?N+ee:N):ee=N,G){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=ee+U,G={id:y++,callback:V,priorityLevel:G,startTime:ee,expirationTime:U,sortIndex:-1},ee>N?(G.sortIndex=ee,s(u,G),a(h)===null&&G===a(u)&&(C?(f(M),M=-1):C=!0,re(A,ee-N))):(G.sortIndex=U,s(h,G),k||x||(k=!0,R||(R=!0,q()))),G},i.unstable_shouldYield=$,i.unstable_wrapCallback=function(G){var V=b;return function(){var ee=b;b=V;try{return G.apply(this,arguments)}finally{b=ee}}}})(Mu)),Mu}var hm;function $0(){return hm||(hm=1,Ou.exports=P0()),Ou.exports}var Lu={exports:{}},$t={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var fm;function F0(){if(fm)return $t;fm=1;var i=sh();function s(h){var u="https://react.dev/errors/"+h;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)u+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+h+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var o={d:{f:a,r:function(){throw Error(s(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},g=Symbol.for("react.portal");function w(h,u,y){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:g,key:m==null?null:""+m,children:h,containerInfo:u,implementation:y}}var T=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(h,u){if(h==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return $t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,$t.createPortal=function(h,u){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)throw Error(s(299));return w(h,u,null,y)},$t.flushSync=function(h){var u=T.T,y=o.p;try{if(T.T=null,o.p=2,h)return h()}finally{T.T=u,o.p=y,o.d.f()}},$t.preconnect=function(h,u){typeof h=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,o.d.C(h,u))},$t.prefetchDNS=function(h){typeof h=="string"&&o.d.D(h)},$t.preinit=function(h,u){if(typeof h=="string"&&u&&typeof u.as=="string"){var y=u.as,m=l(y,u.crossOrigin),b=typeof u.integrity=="string"?u.integrity:void 0,x=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;y==="style"?o.d.S(h,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:m,integrity:b,fetchPriority:x}):y==="script"&&o.d.X(h,{crossOrigin:m,integrity:b,fetchPriority:x,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},$t.preinitModule=function(h,u){if(typeof h=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var y=l(u.as,u.crossOrigin);o.d.M(h,{crossOrigin:y,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0})}}else u==null&&o.d.M(h)},$t.preload=function(h,u){if(typeof h=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var y=u.as,m=l(y,u.crossOrigin);o.d.L(h,y,{crossOrigin:m,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0,type:typeof u.type=="string"?u.type:void 0,fetchPriority:typeof u.fetchPriority=="string"?u.fetchPriority:void 0,referrerPolicy:typeof u.referrerPolicy=="string"?u.referrerPolicy:void 0,imageSrcSet:typeof u.imageSrcSet=="string"?u.imageSrcSet:void 0,imageSizes:typeof u.imageSizes=="string"?u.imageSizes:void 0,media:typeof u.media=="string"?u.media:void 0})}},$t.preloadModule=function(h,u){if(typeof h=="string")if(u){var y=l(u.as,u.crossOrigin);o.d.m(h,{as:typeof u.as=="string"&&u.as!=="script"?u.as:void 0,crossOrigin:y,integrity:typeof u.integrity=="string"?u.integrity:void 0})}else o.d.m(h)},$t.requestFormReset=function(h){o.d.r(h)},$t.unstable_batchedUpdates=function(h,u){return h(u)},$t.useFormState=function(h,u,y){return T.H.useFormState(h,u,y)},$t.useFormStatus=function(){return T.H.useHostTransitionStatus()},$t.version="19.2.4",$t}var dm;function Z0(){if(dm)return Lu.exports;dm=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(s){console.error(s)}}return i(),Lu.exports=F0(),Lu.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var _m;function q0(){if(_m)return la;_m=1;var i=$0(),s=sh(),a=Z0();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r])}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 g(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function w(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function T(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 l(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 h(e){if(w(e)!==e)throw Error(o(188))}function u(e){var t=e.alternate;if(!t){if(t=w(e),t===null)throw Error(o(188));return t!==e?null:e}for(var r=e,n=t;;){var c=r.return;if(c===null)break;var d=c.alternate;if(d===null){if(n=c.return,n!==null){r=n;continue}break}if(c.child===d.child){for(d=c.child;d;){if(d===r)return h(c),e;if(d===n)return h(c),t;d=d.sibling}throw Error(o(188))}if(r.return!==n.return)r=c,n=d;else{for(var D=!1,z=c.child;z;){if(z===r){D=!0,r=c,n=d;break}if(z===n){D=!0,n=c,r=d;break}z=z.sibling}if(!D){for(z=d.child;z;){if(z===r){D=!0,r=d,n=c;break}if(z===n){D=!0,n=d,r=c;break}z=z.sibling}if(!D)throw Error(o(189))}}if(r.alternate!==n)throw Error(o(190))}if(r.tag!==3)throw Error(o(188));return r.stateNode.current===r?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,b=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),p=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),$=Symbol.for("react.memo_cache_sentinel"),I=Symbol.iterator;function q(e){return e===null||typeof e!="object"?null:(e=I&&e[I]||e["@@iterator"],typeof e=="function"?e:null)}var P=Symbol.for("react.client.reference");function Q(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===P?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case C:return"Fragment";case v:return"Profiler";case _:return"StrictMode";case A:return"Suspense";case R:return"SuspenseList";case B:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case k:return"Portal";case p:return e.displayName||"Context";case f:return(e._context.displayName||"Context")+".Consumer";case S:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case M:return t=e.displayName||null,t!==null?t:Q(e.type)||"Memo";case E:t=e._payload,e=e._init;try{return Q(e(t))}catch{}}return null}var re=Array.isArray,G=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee={pending:!1,data:null,method:null,action:null},N=[],U=-1;function L(e){return{current:e}}function H(e){0>U||(e.current=N[U],N[U]=null,U--)}function X(e,t){U++,N[U]=e.current,e.current=t}var ne=L(null),he=L(null),me=L(null),Y=L(null);function j(e,t){switch(X(me,t),X(he,e),X(ne,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?D_(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=D_(t),e=k_(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}H(ne),X(ne,e)}function ce(){H(ne),H(he),H(me)}function oe(e){e.memoizedState!==null&&X(Y,e);var t=ne.current,r=k_(t,e.type);t!==r&&(X(he,e),X(ne,r))}function ve(e){he.current===e&&(H(ne),H(he)),Y.current===e&&(H(Y),ra._currentValue=ee)}var pe,Te;function je(e){if(pe===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);pe=t&&t[1]||"",Te=-1<r.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+pe+e+Te}var Ue=!1;function ct(e,t){if(!e||Ue)return"";Ue=!0;var r=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(ae){var se=ae}Reflect.construct(e,[],de)}else{try{de.call()}catch(ae){se=ae}e.call(de.prototype)}}else{try{throw Error()}catch(ae){se=ae}(de=e())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(ae){if(ae&&se&&typeof ae.stack=="string")return[ae.stack,se.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=n.DetermineComponentFrameRoot(),D=d[0],z=d[1];if(D&&z){var Z=D.split(`
44
+ `),ie=z.split(`
45
+ `);for(c=n=0;n<Z.length&&!Z[n].includes("DetermineComponentFrameRoot");)n++;for(;c<ie.length&&!ie[c].includes("DetermineComponentFrameRoot");)c++;if(n===Z.length||c===ie.length)for(n=Z.length-1,c=ie.length-1;1<=n&&0<=c&&Z[n]!==ie[c];)c--;for(;1<=n&&0<=c;n--,c--)if(Z[n]!==ie[c]){if(n!==1||c!==1)do if(n--,c--,0>c||Z[n]!==ie[c]){var le=`
46
+ `+Z[n].replace(" at new "," at ");return e.displayName&&le.includes("<anonymous>")&&(le=le.replace("<anonymous>",e.displayName)),le}while(1<=n&&0<=c);break}}}finally{Ue=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?je(r):""}function Ee(e,t){switch(e.tag){case 26:case 27:case 5:return je(e.type);case 16:return je("Lazy");case 13:return e.child!==t&&t!==null?je("Suspense Fallback"):je("Suspense");case 19:return je("SuspenseList");case 0:case 15:return ct(e.type,!1);case 11:return ct(e.type.render,!1);case 1:return ct(e.type,!0);case 31:return je("Activity");default:return""}}function Ft(e){try{var t="",r=null;do t+=Ee(e,r),r=e,e=e.return;while(e);return t}catch(n){return`
47
+ Error generating stack: `+n.message+`
48
+ `+n.stack}}var mi=Object.prototype.hasOwnProperty,pi=i.unstable_scheduleCallback,Ii=i.unstable_cancelCallback,Ki=i.unstable_shouldYield,Pt=i.unstable_requestPaint,nt=i.unstable_now,Dt=i.unstable_getCurrentPriorityLevel,Zt=i.unstable_ImmediatePriority,Nt=i.unstable_UserBlockingPriority,Bt=i.unstable_NormalPriority,Vi=i.unstable_LowPriority,Vt=i.unstable_IdlePriority,Li=i.log,Ye=i.unstable_setDisableYieldValue,vi=null,kt=null;function Ot(e){if(typeof Li=="function"&&Ye(e),kt&&typeof kt.setStrictMode=="function")try{kt.setStrictMode(vi,e)}catch{}}var yt=Math.clz32?Math.clz32:Sl,un=Math.log,hn=Math.LN2;function Sl(e){return e>>>=0,e===0?32:31-(un(e)/hn|0)|0}var Xi=256,Ji=262144,gs=4194304;function ai(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 ys(e,t,r){var n=e.pendingLanes;if(n===0)return 0;var c=0,d=e.suspendedLanes,D=e.pingedLanes;e=e.warmLanes;var z=n&134217727;return z!==0?(n=z&~d,n!==0?c=ai(n):(D&=z,D!==0?c=ai(D):r||(r=z&~e,r!==0&&(c=ai(r))))):(z=n&~d,z!==0?c=ai(z):D!==0?c=ai(D):r||(r=n&~e,r!==0&&(c=ai(r)))),c===0?0:t!==0&&t!==c&&(t&d)===0&&(d=c&-c,r=t&-t,d>=r||d===32&&(r&4194048)!==0)?t:c}function Jr(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function mt(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 Qi(){var e=gs;return gs<<=1,(gs&62914560)===0&&(gs=4194304),e}function fn(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function br(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function dn(e,t,r,n,c,d){var D=e.pendingLanes;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=r,e.entangledLanes&=r,e.errorRecoveryDisabledLanes&=r,e.shellSuspendCounter=0;var z=e.entanglements,Z=e.expirationTimes,ie=e.hiddenUpdates;for(r=D&~r;0<r;){var le=31-yt(r),de=1<<le;z[le]=0,Z[le]=-1;var se=ie[le];if(se!==null)for(ie[le]=null,le=0;le<se.length;le++){var ae=se[le];ae!==null&&(ae.lane&=-536870913)}r&=~de}n!==0&&_n(e,n,0),d!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=d&~(D&~t))}function _n(e,t,r){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-yt(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|r&261930}function mn(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-yt(r),c=1<<n;c&t|e[n]&t&&(e[n]|=t),r&=~c}}function Ea(e,t){var r=t&-t;return r=(r&42)!==0?1:Xt(r),(r&(e.suspendedLanes|t))!==0?0:r}function Xt(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 Ni(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function pn(){var e=V.p;return e!==0?e:(e=window.event,e===void 0?32:Q_(e.type))}function vn(e,t){var r=V.p;try{return V.p=e,t()}finally{V.p=r}}var gi=Math.random().toString(36).slice(2),St="__reactFiber$"+gi,it="__reactProps$"+gi,er="__reactContainer$"+gi,Ss="__reactEvents$"+gi,Ta="__reactListeners$"+gi,Aa="__reactHandles$"+gi,Ra="__reactResources$"+gi,Se="__reactMarker$"+gi;function W(e){delete e[St],delete e[it],delete e[Ss],delete e[Ta],delete e[Aa]}function _e(e){var t=e[St];if(t)return t;for(var r=e.parentNode;r;){if(t=r[er]||r[St]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=j_(e);e!==null;){if(r=e[St])return r;e=j_(e)}return t}e=r,r=e.parentNode}return null}function ge(e){if(e=e[St]||e[er]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ze(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function at(e){var t=e[Ra];return t||(t=e[Ra]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ke(e){e[Se]=!0}var zt=new Set,yi={};function Jt(e,t){Pi(e,t),Pi(e+"Capture",t)}function Pi(e,t){for(yi[e]=t,e=0;e<t.length;e++)zt.add(t[e])}var At=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]*$"),gn={},yn={};function Rv(e){return mi.call(yn,e)?!0:mi.call(gn,e)?!1:At.test(e)?yn[e]=!0:(gn[e]=!0,!1)}function Da(e,t,r){if(Rv(t))if(r===null)e.removeAttribute(t);else{switch(typeof r){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,""+r)}}function ka(e,t,r){if(r===null)e.removeAttribute(t);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+r)}}function tr(e,t,r,n){if(n===null)e.removeAttribute(r);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(r);return}e.setAttributeNS(t,r,""+n)}}function Si(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Sh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Dv(e,t,r){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var c=n.get,d=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(D){r=""+D,d.call(this,D)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(D){r=""+D},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function bl(e){if(!e._valueTracker){var t=Sh(e)?"checked":"value";e._valueTracker=Dv(e,t,""+e[t])}}function bh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=Sh(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Oa(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 kv=/[\n"\\]/g;function bi(e){return e.replace(kv,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Cl(e,t,r,n,c,d,D,z){e.name="",D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?e.type=D:e.removeAttribute("type"),t!=null?D==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Si(t)):e.value!==""+Si(t)&&(e.value=""+Si(t)):D!=="submit"&&D!=="reset"||e.removeAttribute("value"),t!=null?xl(e,D,Si(t)):r!=null?xl(e,D,Si(r)):n!=null&&e.removeAttribute("value"),c==null&&d!=null&&(e.defaultChecked=!!d),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?e.name=""+Si(z):e.removeAttribute("name")}function Ch(e,t,r,n,c,d,D,z){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),t!=null||r!=null){if(!(d!=="submit"&&d!=="reset"||t!=null)){bl(e);return}r=r!=null?""+Si(r):"",t=t!=null?""+Si(t):r,z||t===e.value||(e.value=t),e.defaultValue=t}n=n??c,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=z?e.checked:!!n,e.defaultChecked=!!n,D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(e.name=D),bl(e)}function xl(e,t,r){t==="number"&&Oa(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function bs(e,t,r,n){if(e=e.options,t){t={};for(var c=0;c<r.length;c++)t["$"+r[c]]=!0;for(r=0;r<e.length;r++)c=t.hasOwnProperty("$"+e[r].value),e[r].selected!==c&&(e[r].selected=c),c&&n&&(e[r].defaultSelected=!0)}else{for(r=""+Si(r),t=null,c=0;c<e.length;c++){if(e[c].value===r){e[c].selected=!0,n&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function xh(e,t,r){if(t!=null&&(t=""+Si(t),t!==e.value&&(e.value=t),r==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=r!=null?""+Si(r):""}function wh(e,t,r,n){if(t==null){if(n!=null){if(r!=null)throw Error(o(92));if(re(n)){if(1<n.length)throw Error(o(93));n=n[0]}r=n}r==null&&(r=""),t=r}r=Si(t),e.defaultValue=r,n=e.textContent,n===r&&n!==""&&n!==null&&(e.value=n),bl(e)}function Cs(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Ov=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 Eh(e,t,r){var n=t.indexOf("--")===0;r==null||typeof r=="boolean"||r===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,r):typeof r!="number"||r===0||Ov.has(t)?t==="float"?e.cssFloat=r:e[t]=(""+r).trim():e[t]=r+"px"}function Th(e,t,r){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,r!=null){for(var n in r)!r.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var c in t)n=t[c],t.hasOwnProperty(c)&&r[c]!==n&&Eh(e,c,n)}else for(var d in t)t.hasOwnProperty(d)&&Eh(e,d,t[d])}function wl(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 Mv=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"]]),Lv=/^[\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 Ma(e){return Lv.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ir(){}var El=null;function Tl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var xs=null,ws=null;function Ah(e){var t=ge(e);if(t&&(e=t.stateNode)){var r=e[it]||null;e:switch(e=t.stateNode,t.type){case"input":if(Cl(e,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name="'+bi(""+t)+'"][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var c=n[it]||null;if(!c)throw Error(o(90));Cl(n,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<r.length;t++)n=r[t],n.form===e.form&&bh(n)}break e;case"textarea":xh(e,r.value,r.defaultValue);break e;case"select":t=r.value,t!=null&&bs(e,!!r.multiple,t,!1)}}}var Al=!1;function Rh(e,t,r){if(Al)return e(t,r);Al=!0;try{var n=e(t);return n}finally{if(Al=!1,(xs!==null||ws!==null)&&(So(),xs&&(t=xs,e=ws,ws=xs=null,Ah(t),e)))for(t=0;t<e.length;t++)Ah(e[t])}}function Sn(e,t){var r=e.stateNode;if(r===null)return null;var n=r[it]||null;if(n===null)return null;r=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(r&&typeof r!="function")throw Error(o(231,t,typeof r));return r}var rr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rl=!1;if(rr)try{var bn={};Object.defineProperty(bn,"passive",{get:function(){Rl=!0}}),window.addEventListener("test",bn,bn),window.removeEventListener("test",bn,bn)}catch{Rl=!1}var Cr=null,Dl=null,La=null;function Dh(){if(La)return La;var e,t=Dl,r=t.length,n,c="value"in Cr?Cr.value:Cr.textContent,d=c.length;for(e=0;e<r&&t[e]===c[e];e++);var D=r-e;for(n=1;n<=D&&t[r-n]===c[d-n];n++);return La=c.slice(e,1<n?1-n:void 0)}function Na(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 Ba(){return!0}function kh(){return!1}function Qt(e){function t(r,n,c,d,D){this._reactName=r,this._targetInst=c,this.type=n,this.nativeEvent=d,this.target=D,this.currentTarget=null;for(var z in e)e.hasOwnProperty(z)&&(r=e[z],this[z]=r?r(d):d[z]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?Ba:kh,this.isPropagationStopped=kh,this}return m(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Ba)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Ba)},persist:function(){},isPersistent:Ba}),t}var Qr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},za=Qt(Qr),Cn=m({},Qr,{view:0,detail:0}),Nv=Qt(Cn),kl,Ol,xn,ja=m({},Cn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ll,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!==xn&&(xn&&e.type==="mousemove"?(kl=e.screenX-xn.screenX,Ol=e.screenY-xn.screenY):Ol=kl=0,xn=e),kl)},movementY:function(e){return"movementY"in e?e.movementY:Ol}}),Oh=Qt(ja),Bv=m({},ja,{dataTransfer:0}),zv=Qt(Bv),jv=m({},Cn,{relatedTarget:0}),Ml=Qt(jv),Hv=m({},Qr,{animationName:0,elapsedTime:0,pseudoElement:0}),Uv=Qt(Hv),Iv=m({},Qr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Pv=Qt(Iv),$v=m({},Qr,{data:0}),Mh=Qt($v),Fv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Zv={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"},qv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Gv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=qv[e])?!!t[e]:!1}function Ll(){return Gv}var Wv=m({},Cn,{key:function(e){if(e.key){var t=Fv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Na(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Zv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ll,charCode:function(e){return e.type==="keypress"?Na(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Na(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Yv=Qt(Wv),Kv=m({},ja,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Lh=Qt(Kv),Vv=m({},Cn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ll}),Xv=Qt(Vv),Jv=m({},Qr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Qv=Qt(Jv),eg=m({},ja,{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}),tg=Qt(eg),ig=m({},Qr,{newState:0,oldState:0}),rg=Qt(ig),sg=[9,13,27,32],Nl=rr&&"CompositionEvent"in window,wn=null;rr&&"documentMode"in document&&(wn=document.documentMode);var ng=rr&&"TextEvent"in window&&!wn,Nh=rr&&(!Nl||wn&&8<wn&&11>=wn),Bh=" ",zh=!1;function jh(e,t){switch(e){case"keyup":return sg.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Es=!1;function ag(e,t){switch(e){case"compositionend":return Hh(t);case"keypress":return t.which!==32?null:(zh=!0,Bh);case"textInput":return e=t.data,e===Bh&&zh?null:e;default:return null}}function og(e,t){if(Es)return e==="compositionend"||!Nl&&jh(e,t)?(e=Dh(),La=Dl=Cr=null,Es=!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 Nh&&t.locale!=="ko"?null:t.data;default:return null}}var lg={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 Uh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!lg[e.type]:t==="textarea"}function Ih(e,t,r,n){xs?ws?ws.push(n):ws=[n]:xs=n,t=Ao(t,"onChange"),0<t.length&&(r=new za("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var En=null,Tn=null;function cg(e){x_(e,0)}function Ha(e){var t=Ze(e);if(bh(t))return e}function Ph(e,t){if(e==="change")return t}var $h=!1;if(rr){var Bl;if(rr){var zl="oninput"in document;if(!zl){var Fh=document.createElement("div");Fh.setAttribute("oninput","return;"),zl=typeof Fh.oninput=="function"}Bl=zl}else Bl=!1;$h=Bl&&(!document.documentMode||9<document.documentMode)}function Zh(){En&&(En.detachEvent("onpropertychange",qh),Tn=En=null)}function qh(e){if(e.propertyName==="value"&&Ha(Tn)){var t=[];Ih(t,Tn,e,Tl(e)),Rh(cg,t)}}function ug(e,t,r){e==="focusin"?(Zh(),En=t,Tn=r,En.attachEvent("onpropertychange",qh)):e==="focusout"&&Zh()}function hg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ha(Tn)}function fg(e,t){if(e==="click")return Ha(t)}function dg(e,t){if(e==="input"||e==="change")return Ha(t)}function _g(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var oi=typeof Object.is=="function"?Object.is:_g;function An(e,t){if(oi(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var c=r[n];if(!mi.call(t,c)||!oi(e[c],t[c]))return!1}return!0}function Gh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Wh(e,t){var r=Gh(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Gh(r)}}function Yh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Yh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Kh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Oa(e.document);t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Oa(e.document)}return t}function jl(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 mg=rr&&"documentMode"in document&&11>=document.documentMode,Ts=null,Hl=null,Rn=null,Ul=!1;function Vh(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Ul||Ts==null||Ts!==Oa(n)||(n=Ts,"selectionStart"in n&&jl(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}),Rn&&An(Rn,n)||(Rn=n,n=Ao(Hl,"onSelect"),0<n.length&&(t=new za("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=Ts)))}function es(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var As={animationend:es("Animation","AnimationEnd"),animationiteration:es("Animation","AnimationIteration"),animationstart:es("Animation","AnimationStart"),transitionrun:es("Transition","TransitionRun"),transitionstart:es("Transition","TransitionStart"),transitioncancel:es("Transition","TransitionCancel"),transitionend:es("Transition","TransitionEnd")},Il={},Xh={};rr&&(Xh=document.createElement("div").style,"AnimationEvent"in window||(delete As.animationend.animation,delete As.animationiteration.animation,delete As.animationstart.animation),"TransitionEvent"in window||delete As.transitionend.transition);function ts(e){if(Il[e])return Il[e];if(!As[e])return e;var t=As[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Xh)return Il[e]=t[r];return e}var Jh=ts("animationend"),Qh=ts("animationiteration"),ef=ts("animationstart"),pg=ts("transitionrun"),vg=ts("transitionstart"),gg=ts("transitioncancel"),tf=ts("transitionend"),rf=new Map,Pl="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(" ");Pl.push("scrollEnd");function Bi(e,t){rf.set(e,t),Jt(t,[e])}var Ua=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)},Ci=[],Rs=0,$l=0;function Ia(){for(var e=Rs,t=$l=Rs=0;t<e;){var r=Ci[t];Ci[t++]=null;var n=Ci[t];Ci[t++]=null;var c=Ci[t];Ci[t++]=null;var d=Ci[t];if(Ci[t++]=null,n!==null&&c!==null){var D=n.pending;D===null?c.next=c:(c.next=D.next,D.next=c),n.pending=c}d!==0&&sf(r,c,d)}}function Pa(e,t,r,n){Ci[Rs++]=e,Ci[Rs++]=t,Ci[Rs++]=r,Ci[Rs++]=n,$l|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function Fl(e,t,r,n){return Pa(e,t,r,n),$a(e)}function is(e,t){return Pa(e,null,null,t),$a(e)}function sf(e,t,r){e.lanes|=r;var n=e.alternate;n!==null&&(n.lanes|=r);for(var c=!1,d=e.return;d!==null;)d.childLanes|=r,n=d.alternate,n!==null&&(n.childLanes|=r),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(c=!0)),e=d,d=d.return;return e.tag===3?(d=e.stateNode,c&&t!==null&&(c=31-yt(r),e=d.hiddenUpdates,n=e[c],n===null?e[c]=[t]:n.push(t),t.lane=r|536870912),d):null}function $a(e){if(50<Vn)throw Vn=0,Jc=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ds={};function yg(e,t,r,n){this.tag=e,this.key=r,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 li(e,t,r,n){return new yg(e,t,r,n)}function Zl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function sr(e,t){var r=e.alternate;return r===null?(r=li(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&65011712,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r.refCleanup=e.refCleanup,r}function nf(e,t){e.flags&=65011714;var r=e.alternate;return r===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=r.childLanes,e.lanes=r.lanes,e.child=r.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=r.memoizedProps,e.memoizedState=r.memoizedState,e.updateQueue=r.updateQueue,e.type=r.type,t=r.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Fa(e,t,r,n,c,d){var D=0;if(n=e,typeof e=="function")Zl(e)&&(D=1);else if(typeof e=="string")D=w0(e,r,ne.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case B:return e=li(31,r,t,c),e.elementType=B,e.lanes=d,e;case C:return rs(r.children,c,d,t);case _:D=8,c|=24;break;case v:return e=li(12,r,t,c|2),e.elementType=v,e.lanes=d,e;case A:return e=li(13,r,t,c),e.elementType=A,e.lanes=d,e;case R:return e=li(19,r,t,c),e.elementType=R,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case p:D=10;break e;case f:D=9;break e;case S:D=11;break e;case M:D=14;break e;case E:D=16,n=null;break e}D=29,r=Error(o(130,e===null?"null":typeof e,"")),n=null}return t=li(D,r,t,c),t.elementType=e,t.type=n,t.lanes=d,t}function rs(e,t,r,n){return e=li(7,e,n,t),e.lanes=r,e}function ql(e,t,r){return e=li(6,e,null,t),e.lanes=r,e}function af(e){var t=li(18,null,null,0);return t.stateNode=e,t}function Gl(e,t,r){return t=li(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var of=new WeakMap;function xi(e,t){if(typeof e=="object"&&e!==null){var r=of.get(e);return r!==void 0?r:(t={value:e,source:t,stack:Ft(t)},of.set(e,t),t)}return{value:e,source:t,stack:Ft(t)}}var ks=[],Os=0,Za=null,Dn=0,wi=[],Ei=0,xr=null,$i=1,Fi="";function nr(e,t){ks[Os++]=Dn,ks[Os++]=Za,Za=e,Dn=t}function lf(e,t,r){wi[Ei++]=$i,wi[Ei++]=Fi,wi[Ei++]=xr,xr=e;var n=$i;e=Fi;var c=32-yt(n)-1;n&=~(1<<c),r+=1;var d=32-yt(t)+c;if(30<d){var D=c-c%5;d=(n&(1<<D)-1).toString(32),n>>=D,c-=D,$i=1<<32-yt(t)+c|r<<c|n,Fi=d+e}else $i=1<<d|r<<c|n,Fi=e}function Wl(e){e.return!==null&&(nr(e,1),lf(e,1,0))}function Yl(e){for(;e===Za;)Za=ks[--Os],ks[Os]=null,Dn=ks[--Os],ks[Os]=null;for(;e===xr;)xr=wi[--Ei],wi[Ei]=null,Fi=wi[--Ei],wi[Ei]=null,$i=wi[--Ei],wi[Ei]=null}function cf(e,t){wi[Ei++]=$i,wi[Ei++]=Fi,wi[Ei++]=xr,$i=t.id,Fi=t.overflow,xr=e}var jt=null,et=null,He=!1,wr=null,Ti=!1,Kl=Error(o(519));function Er(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw kn(xi(t,e)),Kl}function uf(e){var t=e.stateNode,r=e.type,n=e.memoizedProps;switch(t[St]=e,t[it]=n,r){case"dialog":Ne("cancel",t),Ne("close",t);break;case"iframe":case"object":case"embed":Ne("load",t);break;case"video":case"audio":for(r=0;r<Jn.length;r++)Ne(Jn[r],t);break;case"source":Ne("error",t);break;case"img":case"image":case"link":Ne("error",t),Ne("load",t);break;case"details":Ne("toggle",t);break;case"input":Ne("invalid",t),Ch(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":Ne("invalid",t);break;case"textarea":Ne("invalid",t),wh(t,n.value,n.defaultValue,n.children)}r=n.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||t.textContent===""+r||n.suppressHydrationWarning===!0||A_(t.textContent,r)?(n.popover!=null&&(Ne("beforetoggle",t),Ne("toggle",t)),n.onScroll!=null&&Ne("scroll",t),n.onScrollEnd!=null&&Ne("scrollend",t),n.onClick!=null&&(t.onclick=ir),t=!0):t=!1,t||Er(e,!0)}function hf(e){for(jt=e.return;jt;)switch(jt.tag){case 5:case 31:case 13:Ti=!1;return;case 27:case 3:Ti=!0;return;default:jt=jt.return}}function Ms(e){if(e!==jt)return!1;if(!He)return hf(e),He=!0,!1;var t=e.tag,r;if((r=t!==3&&t!==27)&&((r=t===5)&&(r=e.type,r=!(r!=="form"&&r!=="button")||du(e.type,e.memoizedProps)),r=!r),r&&et&&Er(e),hf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));et=z_(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));et=z_(e)}else t===27?(t=et,Ur(e.type)?(e=gu,gu=null,et=e):et=t):et=jt?Ri(e.stateNode.nextSibling):null;return!0}function ss(){et=jt=null,He=!1}function Vl(){var e=wr;return e!==null&&(ri===null?ri=e:ri.push.apply(ri,e),wr=null),e}function kn(e){wr===null?wr=[e]:wr.push(e)}var Xl=L(null),ns=null,ar=null;function Tr(e,t,r){X(Xl,t._currentValue),t._currentValue=r}function or(e){e._currentValue=Xl.current,H(Xl)}function Jl(e,t,r){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===r)break;e=e.return}}function Ql(e,t,r,n){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var d=c.dependencies;if(d!==null){var D=c.child;d=d.firstContext;e:for(;d!==null;){var z=d;d=c;for(var Z=0;Z<t.length;Z++)if(z.context===t[Z]){d.lanes|=r,z=d.alternate,z!==null&&(z.lanes|=r),Jl(d.return,r,e),n||(D=null);break e}d=z.next}}else if(c.tag===18){if(D=c.return,D===null)throw Error(o(341));D.lanes|=r,d=D.alternate,d!==null&&(d.lanes|=r),Jl(D,r,e),D=null}else D=c.child;if(D!==null)D.return=c;else for(D=c;D!==null;){if(D===e){D=null;break}if(c=D.sibling,c!==null){c.return=D.return,D=c;break}D=D.return}c=D}}function Ls(e,t,r,n){e=null;for(var c=t,d=!1;c!==null;){if(!d){if((c.flags&524288)!==0)d=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var D=c.alternate;if(D===null)throw Error(o(387));if(D=D.memoizedProps,D!==null){var z=c.type;oi(c.pendingProps.value,D.value)||(e!==null?e.push(z):e=[z])}}else if(c===Y.current){if(D=c.alternate,D===null)throw Error(o(387));D.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(ra):e=[ra])}c=c.return}e!==null&&Ql(t,e,r,n),t.flags|=262144}function qa(e){for(e=e.firstContext;e!==null;){if(!oi(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function as(e){ns=e,ar=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ht(e){return ff(ns,e)}function Ga(e,t){return ns===null&&as(e),ff(e,t)}function ff(e,t){var r=t._currentValue;if(t={context:t,memoizedValue:r,next:null},ar===null){if(e===null)throw Error(o(308));ar=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ar=ar.next=t;return r}var Sg=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(r,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(r){return r()})}},bg=i.unstable_scheduleCallback,Cg=i.unstable_NormalPriority,bt={$$typeof:p,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ec(){return{controller:new Sg,data:new Map,refCount:0}}function On(e){e.refCount--,e.refCount===0&&bg(Cg,function(){e.controller.abort()})}var Mn=null,tc=0,Ns=0,Bs=null;function xg(e,t){if(Mn===null){var r=Mn=[];tc=0,Ns=su(),Bs={status:"pending",value:void 0,then:function(n){r.push(n)}}}return tc++,t.then(df,df),t}function df(){if(--tc===0&&Mn!==null){Bs!==null&&(Bs.status="fulfilled");var e=Mn;Mn=null,Ns=0,Bs=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function wg(e,t){var r=[],n={status:"pending",value:null,reason:null,then:function(c){r.push(c)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var c=0;c<r.length;c++)(0,r[c])(t)},function(c){for(n.status="rejected",n.reason=c,c=0;c<r.length;c++)(0,r[c])(void 0)}),n}var _f=G.S;G.S=function(e,t){Xd=nt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&xg(e,t),_f!==null&&_f(e,t)};var os=L(null);function ic(){var e=os.current;return e!==null?e:Je.pooledCache}function Wa(e,t){t===null?X(os,os.current):X(os,t.pool)}function mf(){var e=ic();return e===null?null:{parent:bt._currentValue,pool:e}}var zs=Error(o(460)),rc=Error(o(474)),Ya=Error(o(542)),Ka={then:function(){}};function pf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function vf(e,t,r){switch(r=e[r],r===void 0?e.push(t):r!==t&&(t.then(ir,ir),t=r),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,yf(e),e;default:if(typeof t.status=="string")t.then(ir,ir);else{if(e=Je,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=n}},function(n){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,yf(e),e}throw cs=t,zs}}function ls(e){try{var t=e._init;return t(e._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(cs=r,zs):r}}var cs=null;function gf(){if(cs===null)throw Error(o(459));var e=cs;return cs=null,e}function yf(e){if(e===zs||e===Ya)throw Error(o(483))}var js=null,Ln=0;function Va(e){var t=Ln;return Ln+=1,js===null&&(js=[]),vf(js,e,t)}function Nn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Xa(e,t){throw t.$$typeof===b?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Sf(e){function t(J,K){if(e){var te=J.deletions;te===null?(J.deletions=[K],J.flags|=16):te.push(K)}}function r(J,K){if(!e)return null;for(;K!==null;)t(J,K),K=K.sibling;return null}function n(J){for(var K=new Map;J!==null;)J.key!==null?K.set(J.key,J):K.set(J.index,J),J=J.sibling;return K}function c(J,K){return J=sr(J,K),J.index=0,J.sibling=null,J}function d(J,K,te){return J.index=te,e?(te=J.alternate,te!==null?(te=te.index,te<K?(J.flags|=67108866,K):te):(J.flags|=67108866,K)):(J.flags|=1048576,K)}function D(J){return e&&J.alternate===null&&(J.flags|=67108866),J}function z(J,K,te,ue){return K===null||K.tag!==6?(K=ql(te,J.mode,ue),K.return=J,K):(K=c(K,te),K.return=J,K)}function Z(J,K,te,ue){var Ce=te.type;return Ce===C?le(J,K,te.props.children,ue,te.key):K!==null&&(K.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===E&&ls(Ce)===K.type)?(K=c(K,te.props),Nn(K,te),K.return=J,K):(K=Fa(te.type,te.key,te.props,null,J.mode,ue),Nn(K,te),K.return=J,K)}function ie(J,K,te,ue){return K===null||K.tag!==4||K.stateNode.containerInfo!==te.containerInfo||K.stateNode.implementation!==te.implementation?(K=Gl(te,J.mode,ue),K.return=J,K):(K=c(K,te.children||[]),K.return=J,K)}function le(J,K,te,ue,Ce){return K===null||K.tag!==7?(K=rs(te,J.mode,ue,Ce),K.return=J,K):(K=c(K,te),K.return=J,K)}function de(J,K,te){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return K=ql(""+K,J.mode,te),K.return=J,K;if(typeof K=="object"&&K!==null){switch(K.$$typeof){case x:return te=Fa(K.type,K.key,K.props,null,J.mode,te),Nn(te,K),te.return=J,te;case k:return K=Gl(K,J.mode,te),K.return=J,K;case E:return K=ls(K),de(J,K,te)}if(re(K)||q(K))return K=rs(K,J.mode,te,null),K.return=J,K;if(typeof K.then=="function")return de(J,Va(K),te);if(K.$$typeof===p)return de(J,Ga(J,K),te);Xa(J,K)}return null}function se(J,K,te,ue){var Ce=K!==null?K.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return Ce!==null?null:z(J,K,""+te,ue);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case x:return te.key===Ce?Z(J,K,te,ue):null;case k:return te.key===Ce?ie(J,K,te,ue):null;case E:return te=ls(te),se(J,K,te,ue)}if(re(te)||q(te))return Ce!==null?null:le(J,K,te,ue,null);if(typeof te.then=="function")return se(J,K,Va(te),ue);if(te.$$typeof===p)return se(J,K,Ga(J,te),ue);Xa(J,te)}return null}function ae(J,K,te,ue,Ce){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return J=J.get(te)||null,z(K,J,""+ue,Ce);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case x:return J=J.get(ue.key===null?te:ue.key)||null,Z(K,J,ue,Ce);case k:return J=J.get(ue.key===null?te:ue.key)||null,ie(K,J,ue,Ce);case E:return ue=ls(ue),ae(J,K,te,ue,Ce)}if(re(ue)||q(ue))return J=J.get(te)||null,le(K,J,ue,Ce,null);if(typeof ue.then=="function")return ae(J,K,te,Va(ue),Ce);if(ue.$$typeof===p)return ae(J,K,te,Ga(K,ue),Ce);Xa(K,ue)}return null}function ye(J,K,te,ue){for(var Ce=null,Pe=null,be=K,De=K=0,ze=null;be!==null&&De<te.length;De++){be.index>De?(ze=be,be=null):ze=be.sibling;var $e=se(J,be,te[De],ue);if($e===null){be===null&&(be=ze);break}e&&be&&$e.alternate===null&&t(J,be),K=d($e,K,De),Pe===null?Ce=$e:Pe.sibling=$e,Pe=$e,be=ze}if(De===te.length)return r(J,be),He&&nr(J,De),Ce;if(be===null){for(;De<te.length;De++)be=de(J,te[De],ue),be!==null&&(K=d(be,K,De),Pe===null?Ce=be:Pe.sibling=be,Pe=be);return He&&nr(J,De),Ce}for(be=n(be);De<te.length;De++)ze=ae(be,J,De,te[De],ue),ze!==null&&(e&&ze.alternate!==null&&be.delete(ze.key===null?De:ze.key),K=d(ze,K,De),Pe===null?Ce=ze:Pe.sibling=ze,Pe=ze);return e&&be.forEach(function(Zr){return t(J,Zr)}),He&&nr(J,De),Ce}function we(J,K,te,ue){if(te==null)throw Error(o(151));for(var Ce=null,Pe=null,be=K,De=K=0,ze=null,$e=te.next();be!==null&&!$e.done;De++,$e=te.next()){be.index>De?(ze=be,be=null):ze=be.sibling;var Zr=se(J,be,$e.value,ue);if(Zr===null){be===null&&(be=ze);break}e&&be&&Zr.alternate===null&&t(J,be),K=d(Zr,K,De),Pe===null?Ce=Zr:Pe.sibling=Zr,Pe=Zr,be=ze}if($e.done)return r(J,be),He&&nr(J,De),Ce;if(be===null){for(;!$e.done;De++,$e=te.next())$e=de(J,$e.value,ue),$e!==null&&(K=d($e,K,De),Pe===null?Ce=$e:Pe.sibling=$e,Pe=$e);return He&&nr(J,De),Ce}for(be=n(be);!$e.done;De++,$e=te.next())$e=ae(be,J,De,$e.value,ue),$e!==null&&(e&&$e.alternate!==null&&be.delete($e.key===null?De:$e.key),K=d($e,K,De),Pe===null?Ce=$e:Pe.sibling=$e,Pe=$e);return e&&be.forEach(function(B0){return t(J,B0)}),He&&nr(J,De),Ce}function Xe(J,K,te,ue){if(typeof te=="object"&&te!==null&&te.type===C&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case x:e:{for(var Ce=te.key;K!==null;){if(K.key===Ce){if(Ce=te.type,Ce===C){if(K.tag===7){r(J,K.sibling),ue=c(K,te.props.children),ue.return=J,J=ue;break e}}else if(K.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===E&&ls(Ce)===K.type){r(J,K.sibling),ue=c(K,te.props),Nn(ue,te),ue.return=J,J=ue;break e}r(J,K);break}else t(J,K);K=K.sibling}te.type===C?(ue=rs(te.props.children,J.mode,ue,te.key),ue.return=J,J=ue):(ue=Fa(te.type,te.key,te.props,null,J.mode,ue),Nn(ue,te),ue.return=J,J=ue)}return D(J);case k:e:{for(Ce=te.key;K!==null;){if(K.key===Ce)if(K.tag===4&&K.stateNode.containerInfo===te.containerInfo&&K.stateNode.implementation===te.implementation){r(J,K.sibling),ue=c(K,te.children||[]),ue.return=J,J=ue;break e}else{r(J,K);break}else t(J,K);K=K.sibling}ue=Gl(te,J.mode,ue),ue.return=J,J=ue}return D(J);case E:return te=ls(te),Xe(J,K,te,ue)}if(re(te))return ye(J,K,te,ue);if(q(te)){if(Ce=q(te),typeof Ce!="function")throw Error(o(150));return te=Ce.call(te),we(J,K,te,ue)}if(typeof te.then=="function")return Xe(J,K,Va(te),ue);if(te.$$typeof===p)return Xe(J,K,Ga(J,te),ue);Xa(J,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,K!==null&&K.tag===6?(r(J,K.sibling),ue=c(K,te),ue.return=J,J=ue):(r(J,K),ue=ql(te,J.mode,ue),ue.return=J,J=ue),D(J)):r(J,K)}return function(J,K,te,ue){try{Ln=0;var Ce=Xe(J,K,te,ue);return js=null,Ce}catch(be){if(be===zs||be===Ya)throw be;var Pe=li(29,be,null,J.mode);return Pe.lanes=ue,Pe.return=J,Pe}finally{}}}var us=Sf(!0),bf=Sf(!1),Ar=!1;function sc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function nc(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 Rr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Dr(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(Fe&2)!==0){var c=n.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),n.pending=t,t=$a(e),sf(e,null,r),t}return Pa(e,n,t,r),$a(e)}function Bn(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,mn(e,r)}}function ac(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var c=null,d=null;if(r=r.firstBaseUpdate,r!==null){do{var D={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};d===null?c=d=D:d=d.next=D,r=r.next}while(r!==null);d===null?c=d=t:d=d.next=t}else c=d=t;r={baseState:n.baseState,firstBaseUpdate:c,lastBaseUpdate:d,shared:n.shared,callbacks:n.callbacks},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}var oc=!1;function zn(){if(oc){var e=Bs;if(e!==null)throw e}}function jn(e,t,r,n){oc=!1;var c=e.updateQueue;Ar=!1;var d=c.firstBaseUpdate,D=c.lastBaseUpdate,z=c.shared.pending;if(z!==null){c.shared.pending=null;var Z=z,ie=Z.next;Z.next=null,D===null?d=ie:D.next=ie,D=Z;var le=e.alternate;le!==null&&(le=le.updateQueue,z=le.lastBaseUpdate,z!==D&&(z===null?le.firstBaseUpdate=ie:z.next=ie,le.lastBaseUpdate=Z))}if(d!==null){var de=c.baseState;D=0,le=ie=Z=null,z=d;do{var se=z.lane&-536870913,ae=se!==z.lane;if(ae?(Be&se)===se:(n&se)===se){se!==0&&se===Ns&&(oc=!0),le!==null&&(le=le.next={lane:0,tag:z.tag,payload:z.payload,callback:null,next:null});e:{var ye=e,we=z;se=t;var Xe=r;switch(we.tag){case 1:if(ye=we.payload,typeof ye=="function"){de=ye.call(Xe,de,se);break e}de=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=we.payload,se=typeof ye=="function"?ye.call(Xe,de,se):ye,se==null)break e;de=m({},de,se);break e;case 2:Ar=!0}}se=z.callback,se!==null&&(e.flags|=64,ae&&(e.flags|=8192),ae=c.callbacks,ae===null?c.callbacks=[se]:ae.push(se))}else ae={lane:se,tag:z.tag,payload:z.payload,callback:z.callback,next:null},le===null?(ie=le=ae,Z=de):le=le.next=ae,D|=se;if(z=z.next,z===null){if(z=c.shared.pending,z===null)break;ae=z,z=ae.next,ae.next=null,c.lastBaseUpdate=ae,c.shared.pending=null}}while(!0);le===null&&(Z=de),c.baseState=Z,c.firstBaseUpdate=ie,c.lastBaseUpdate=le,d===null&&(c.shared.lanes=0),Nr|=D,e.lanes=D,e.memoizedState=de}}function Cf(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function xf(e,t){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;e<r.length;e++)Cf(r[e],t)}var Hs=L(null),Ja=L(0);function wf(e,t){e=pr,X(Ja,e),X(Hs,t),pr=e|t.baseLanes}function lc(){X(Ja,pr),X(Hs,Hs.current)}function cc(){pr=Ja.current,H(Hs),H(Ja)}var ci=L(null),Ai=null;function kr(e){var t=e.alternate;X(pt,pt.current&1),X(ci,e),Ai===null&&(t===null||Hs.current!==null||t.memoizedState!==null)&&(Ai=e)}function uc(e){X(pt,pt.current),X(ci,e),Ai===null&&(Ai=e)}function Ef(e){e.tag===22?(X(pt,pt.current),X(ci,e),Ai===null&&(Ai=e)):Or()}function Or(){X(pt,pt.current),X(ci,ci.current)}function ui(e){H(ci),Ai===e&&(Ai=null),H(pt)}var pt=L(0);function Qa(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||pu(r)||vu(r)))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 lr=0,Re=null,Ke=null,Ct=null,eo=!1,Us=!1,hs=!1,to=0,Hn=0,Is=null,Eg=0;function ut(){throw Error(o(321))}function hc(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!oi(e[r],t[r]))return!1;return!0}function fc(e,t,r,n,c,d){return lr=d,Re=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,G.H=e===null||e.memoizedState===null?ld:Ac,hs=!1,d=r(n,c),hs=!1,Us&&(d=Af(t,r,n,c)),Tf(e),d}function Tf(e){G.H=Pn;var t=Ke!==null&&Ke.next!==null;if(lr=0,Ct=Ke=Re=null,eo=!1,Hn=0,Is=null,t)throw Error(o(300));e===null||xt||(e=e.dependencies,e!==null&&qa(e)&&(xt=!0))}function Af(e,t,r,n){Re=e;var c=0;do{if(Us&&(Is=null),Hn=0,Us=!1,25<=c)throw Error(o(301));if(c+=1,Ct=Ke=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}G.H=cd,d=t(r,n)}while(Us);return d}function Tg(){var e=G.H,t=e.useState()[0];return t=typeof t.then=="function"?Un(t):t,e=e.useState()[0],(Ke!==null?Ke.memoizedState:null)!==e&&(Re.flags|=1024),t}function dc(){var e=to!==0;return to=0,e}function _c(e,t,r){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r}function mc(e){if(eo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}eo=!1}lr=0,Ct=Ke=Re=null,Us=!1,Hn=to=0,Is=null}function qt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ct===null?Re.memoizedState=Ct=e:Ct=Ct.next=e,Ct}function vt(){if(Ke===null){var e=Re.alternate;e=e!==null?e.memoizedState:null}else e=Ke.next;var t=Ct===null?Re.memoizedState:Ct.next;if(t!==null)Ct=t,Ke=e;else{if(e===null)throw Re.alternate===null?Error(o(467)):Error(o(310));Ke=e,e={memoizedState:Ke.memoizedState,baseState:Ke.baseState,baseQueue:Ke.baseQueue,queue:Ke.queue,next:null},Ct===null?Re.memoizedState=Ct=e:Ct=Ct.next=e}return Ct}function io(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Un(e){var t=Hn;return Hn+=1,Is===null&&(Is=[]),e=vf(Is,e,t),t=Re,(Ct===null?t.memoizedState:Ct.next)===null&&(t=t.alternate,G.H=t===null||t.memoizedState===null?ld:Ac),e}function ro(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Un(e);if(e.$$typeof===p)return Ht(e)}throw Error(o(438,String(e)))}function pc(e){var t=null,r=Re.updateQueue;if(r!==null&&(t=r.memoCache),t==null){var n=Re.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),r===null&&(r=io(),Re.updateQueue=r),r.memoCache=t,r=t.data[t.index],r===void 0)for(r=t.data[t.index]=Array(e),n=0;n<e;n++)r[n]=$;return t.index++,r}function cr(e,t){return typeof t=="function"?t(e):t}function so(e){var t=vt();return vc(t,Ke,e)}function vc(e,t,r){var n=e.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=r;var c=e.baseQueue,d=n.pending;if(d!==null){if(c!==null){var D=c.next;c.next=d.next,d.next=D}t.baseQueue=c=d,n.pending=null}if(d=e.baseState,c===null)e.memoizedState=d;else{t=c.next;var z=D=null,Z=null,ie=t,le=!1;do{var de=ie.lane&-536870913;if(de!==ie.lane?(Be&de)===de:(lr&de)===de){var se=ie.revertLane;if(se===0)Z!==null&&(Z=Z.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),de===Ns&&(le=!0);else if((lr&se)===se){ie=ie.next,se===Ns&&(le=!0);continue}else de={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},Z===null?(z=Z=de,D=d):Z=Z.next=de,Re.lanes|=se,Nr|=se;de=ie.action,hs&&r(d,de),d=ie.hasEagerState?ie.eagerState:r(d,de)}else se={lane:de,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},Z===null?(z=Z=se,D=d):Z=Z.next=se,Re.lanes|=de,Nr|=de;ie=ie.next}while(ie!==null&&ie!==t);if(Z===null?D=d:Z.next=z,!oi(d,e.memoizedState)&&(xt=!0,le&&(r=Bs,r!==null)))throw r;e.memoizedState=d,e.baseState=D,e.baseQueue=Z,n.lastRenderedState=d}return c===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function gc(e){var t=vt(),r=t.queue;if(r===null)throw Error(o(311));r.lastRenderedReducer=e;var n=r.dispatch,c=r.pending,d=t.memoizedState;if(c!==null){r.pending=null;var D=c=c.next;do d=e(d,D.action),D=D.next;while(D!==c);oi(d,t.memoizedState)||(xt=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),r.lastRenderedState=d}return[d,n]}function Rf(e,t,r){var n=Re,c=vt(),d=He;if(d){if(r===void 0)throw Error(o(407));r=r()}else r=t();var D=!oi((Ke||c).memoizedState,r);if(D&&(c.memoizedState=r,xt=!0),c=c.queue,bc(Of.bind(null,n,c,e),[e]),c.getSnapshot!==t||D||Ct!==null&&Ct.memoizedState.tag&1){if(n.flags|=2048,Ps(9,{destroy:void 0},kf.bind(null,n,c,r,t),null),Je===null)throw Error(o(349));d||(lr&127)!==0||Df(n,t,r)}return r}function Df(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Re.updateQueue,t===null?(t=io(),Re.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function kf(e,t,r,n){t.value=r,t.getSnapshot=n,Mf(t)&&Lf(e)}function Of(e,t,r){return r(function(){Mf(t)&&Lf(e)})}function Mf(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!oi(e,r)}catch{return!0}}function Lf(e){var t=is(e,2);t!==null&&si(t,e,2)}function yc(e){var t=qt();if(typeof e=="function"){var r=e;if(e=r(),hs){Ot(!0);try{r()}finally{Ot(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cr,lastRenderedState:e},t}function Nf(e,t,r,n){return e.baseState=r,vc(e,Ke,typeof n=="function"?n:cr)}function Ag(e,t,r,n,c){if(oo(e))throw Error(o(485));if(e=t.action,e!==null){var d={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(D){d.listeners.push(D)}};G.T!==null?r(!0):d.isTransition=!1,n(d),r=t.pending,r===null?(d.next=t.pending=d,Bf(t,d)):(d.next=r.next,t.pending=r.next=d)}}function Bf(e,t){var r=t.action,n=t.payload,c=e.state;if(t.isTransition){var d=G.T,D={};G.T=D;try{var z=r(c,n),Z=G.S;Z!==null&&Z(D,z),zf(e,t,z)}catch(ie){Sc(e,t,ie)}finally{d!==null&&D.types!==null&&(d.types=D.types),G.T=d}}else try{d=r(c,n),zf(e,t,d)}catch(ie){Sc(e,t,ie)}}function zf(e,t,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(n){jf(e,t,n)},function(n){return Sc(e,t,n)}):jf(e,t,r)}function jf(e,t,r){t.status="fulfilled",t.value=r,Hf(t),e.state=r,t=e.pending,t!==null&&(r=t.next,r===t?e.pending=null:(r=r.next,t.next=r,Bf(e,r)))}function Sc(e,t,r){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=r,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 Uf(e,t){return t}function If(e,t){if(He){var r=Je.formState;if(r!==null){e:{var n=Re;if(He){if(et){t:{for(var c=et,d=Ti;c.nodeType!==8;){if(!d){c=null;break t}if(c=Ri(c.nextSibling),c===null){c=null;break t}}d=c.data,c=d==="F!"||d==="F"?c:null}if(c){et=Ri(c.nextSibling),n=c.data==="F!";break e}}Er(n)}n=!1}n&&(t=r[0])}}return r=qt(),r.memoizedState=r.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Uf,lastRenderedState:t},r.queue=n,r=nd.bind(null,Re,n),n.dispatch=r,n=yc(!1),d=Tc.bind(null,Re,!1,n.queue),n=qt(),c={state:t,dispatch:null,action:e,pending:null},n.queue=c,r=Ag.bind(null,Re,c,d,r),c.dispatch=r,n.memoizedState=e,[t,r,!1]}function Pf(e){var t=vt();return $f(t,Ke,e)}function $f(e,t,r){if(t=vc(e,t,Uf)[0],e=so(cr)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=Un(t)}catch(D){throw D===zs?Ya:D}else n=t;t=vt();var c=t.queue,d=c.dispatch;return r!==t.memoizedState&&(Re.flags|=2048,Ps(9,{destroy:void 0},Rg.bind(null,c,r),null)),[n,d,e]}function Rg(e,t){e.action=t}function Ff(e){var t=vt(),r=Ke;if(r!==null)return $f(t,r,e);vt(),t=t.memoizedState,r=vt();var n=r.queue.dispatch;return r.memoizedState=e,[t,n,!1]}function Ps(e,t,r,n){return e={tag:e,create:r,deps:n,inst:t,next:null},t=Re.updateQueue,t===null&&(t=io(),Re.updateQueue=t),r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e),e}function Zf(){return vt().memoizedState}function no(e,t,r,n){var c=qt();Re.flags|=e,c.memoizedState=Ps(1|t,{destroy:void 0},r,n===void 0?null:n)}function ao(e,t,r,n){var c=vt();n=n===void 0?null:n;var d=c.memoizedState.inst;Ke!==null&&n!==null&&hc(n,Ke.memoizedState.deps)?c.memoizedState=Ps(t,d,r,n):(Re.flags|=e,c.memoizedState=Ps(1|t,d,r,n))}function qf(e,t){no(8390656,8,e,t)}function bc(e,t){ao(2048,8,e,t)}function Dg(e){Re.flags|=4;var t=Re.updateQueue;if(t===null)t=io(),Re.updateQueue=t,t.events=[e];else{var r=t.events;r===null?t.events=[e]:r.push(e)}}function Gf(e){var t=vt().memoizedState;return Dg({ref:t,nextImpl:e}),function(){if((Fe&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Wf(e,t){return ao(4,2,e,t)}function Yf(e,t){return ao(4,4,e,t)}function Kf(e,t){if(typeof t=="function"){e=e();var r=t(e);return function(){typeof r=="function"?r():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Vf(e,t,r){r=r!=null?r.concat([e]):null,ao(4,4,Kf.bind(null,t,e),r)}function Cc(){}function Xf(e,t){var r=vt();t=t===void 0?null:t;var n=r.memoizedState;return t!==null&&hc(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function Jf(e,t){var r=vt();t=t===void 0?null:t;var n=r.memoizedState;if(t!==null&&hc(t,n[1]))return n[0];if(n=e(),hs){Ot(!0);try{e()}finally{Ot(!1)}}return r.memoizedState=[n,t],n}function xc(e,t,r){return r===void 0||(lr&1073741824)!==0&&(Be&261930)===0?e.memoizedState=t:(e.memoizedState=r,e=Qd(),Re.lanes|=e,Nr|=e,r)}function Qf(e,t,r,n){return oi(r,t)?r:Hs.current!==null?(e=xc(e,r,n),oi(e,t)||(xt=!0),e):(lr&42)===0||(lr&1073741824)!==0&&(Be&261930)===0?(xt=!0,e.memoizedState=r):(e=Qd(),Re.lanes|=e,Nr|=e,t)}function ed(e,t,r,n,c){var d=V.p;V.p=d!==0&&8>d?d:8;var D=G.T,z={};G.T=z,Tc(e,!1,t,r);try{var Z=c(),ie=G.S;if(ie!==null&&ie(z,Z),Z!==null&&typeof Z=="object"&&typeof Z.then=="function"){var le=wg(Z,n);In(e,t,le,di(e))}else In(e,t,n,di(e))}catch(de){In(e,t,{then:function(){},status:"rejected",reason:de},di())}finally{V.p=d,D!==null&&z.types!==null&&(D.types=z.types),G.T=D}}function kg(){}function wc(e,t,r,n){if(e.tag!==5)throw Error(o(476));var c=td(e).queue;ed(e,c,t,ee,r===null?kg:function(){return id(e),r(n)})}function td(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cr,lastRenderedState:ee},next:null};var r={};return t.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cr,lastRenderedState:r},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function id(e){var t=td(e);t.next===null&&(t=e.alternate.memoizedState),In(e,t.next.queue,{},di())}function Ec(){return Ht(ra)}function rd(){return vt().memoizedState}function sd(){return vt().memoizedState}function Og(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var r=di();e=Rr(r);var n=Dr(t,e,r);n!==null&&(si(n,t,r),Bn(n,t,r)),t={cache:ec()},e.payload=t;return}t=t.return}}function Mg(e,t,r){var n=di();r={lane:n,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},oo(e)?ad(t,r):(r=Fl(e,t,r,n),r!==null&&(si(r,e,n),od(r,t,n)))}function nd(e,t,r){var n=di();In(e,t,r,n)}function In(e,t,r,n){var c={lane:n,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(oo(e))ad(t,c);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var D=t.lastRenderedState,z=d(D,r);if(c.hasEagerState=!0,c.eagerState=z,oi(z,D))return Pa(e,t,c,0),Je===null&&Ia(),!1}catch{}finally{}if(r=Fl(e,t,c,n),r!==null)return si(r,e,n),od(r,t,n),!0}return!1}function Tc(e,t,r,n){if(n={lane:2,revertLane:su(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},oo(e)){if(t)throw Error(o(479))}else t=Fl(e,r,n,2),t!==null&&si(t,e,2)}function oo(e){var t=e.alternate;return e===Re||t!==null&&t===Re}function ad(e,t){Us=eo=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function od(e,t,r){if((r&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,mn(e,r)}}var Pn={readContext:Ht,use:ro,useCallback:ut,useContext:ut,useEffect:ut,useImperativeHandle:ut,useLayoutEffect:ut,useInsertionEffect:ut,useMemo:ut,useReducer:ut,useRef:ut,useState:ut,useDebugValue:ut,useDeferredValue:ut,useTransition:ut,useSyncExternalStore:ut,useId:ut,useHostTransitionStatus:ut,useFormState:ut,useActionState:ut,useOptimistic:ut,useMemoCache:ut,useCacheRefresh:ut};Pn.useEffectEvent=ut;var ld={readContext:Ht,use:ro,useCallback:function(e,t){return qt().memoizedState=[e,t===void 0?null:t],e},useContext:Ht,useEffect:qf,useImperativeHandle:function(e,t,r){r=r!=null?r.concat([e]):null,no(4194308,4,Kf.bind(null,t,e),r)},useLayoutEffect:function(e,t){return no(4194308,4,e,t)},useInsertionEffect:function(e,t){no(4,2,e,t)},useMemo:function(e,t){var r=qt();t=t===void 0?null:t;var n=e();if(hs){Ot(!0);try{e()}finally{Ot(!1)}}return r.memoizedState=[n,t],n},useReducer:function(e,t,r){var n=qt();if(r!==void 0){var c=r(t);if(hs){Ot(!0);try{r(t)}finally{Ot(!1)}}}else c=t;return n.memoizedState=n.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},n.queue=e,e=e.dispatch=Mg.bind(null,Re,e),[n.memoizedState,e]},useRef:function(e){var t=qt();return e={current:e},t.memoizedState=e},useState:function(e){e=yc(e);var t=e.queue,r=nd.bind(null,Re,t);return t.dispatch=r,[e.memoizedState,r]},useDebugValue:Cc,useDeferredValue:function(e,t){var r=qt();return xc(r,e,t)},useTransition:function(){var e=yc(!1);return e=ed.bind(null,Re,e.queue,!0,!1),qt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,r){var n=Re,c=qt();if(He){if(r===void 0)throw Error(o(407));r=r()}else{if(r=t(),Je===null)throw Error(o(349));(Be&127)!==0||Df(n,t,r)}c.memoizedState=r;var d={value:r,getSnapshot:t};return c.queue=d,qf(Of.bind(null,n,d,e),[e]),n.flags|=2048,Ps(9,{destroy:void 0},kf.bind(null,n,d,r,t),null),r},useId:function(){var e=qt(),t=Je.identifierPrefix;if(He){var r=Fi,n=$i;r=(n&~(1<<32-yt(n)-1)).toString(32)+r,t="_"+t+"R_"+r,r=to++,0<r&&(t+="H"+r.toString(32)),t+="_"}else r=Eg++,t="_"+t+"r_"+r.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Ec,useFormState:If,useActionState:If,useOptimistic:function(e){var t=qt();t.memoizedState=t.baseState=e;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=r,t=Tc.bind(null,Re,!0,r),r.dispatch=t,[e,t]},useMemoCache:pc,useCacheRefresh:function(){return qt().memoizedState=Og.bind(null,Re)},useEffectEvent:function(e){var t=qt(),r={impl:e};return t.memoizedState=r,function(){if((Fe&2)!==0)throw Error(o(440));return r.impl.apply(void 0,arguments)}}},Ac={readContext:Ht,use:ro,useCallback:Xf,useContext:Ht,useEffect:bc,useImperativeHandle:Vf,useInsertionEffect:Wf,useLayoutEffect:Yf,useMemo:Jf,useReducer:so,useRef:Zf,useState:function(){return so(cr)},useDebugValue:Cc,useDeferredValue:function(e,t){var r=vt();return Qf(r,Ke.memoizedState,e,t)},useTransition:function(){var e=so(cr)[0],t=vt().memoizedState;return[typeof e=="boolean"?e:Un(e),t]},useSyncExternalStore:Rf,useId:rd,useHostTransitionStatus:Ec,useFormState:Pf,useActionState:Pf,useOptimistic:function(e,t){var r=vt();return Nf(r,Ke,e,t)},useMemoCache:pc,useCacheRefresh:sd};Ac.useEffectEvent=Gf;var cd={readContext:Ht,use:ro,useCallback:Xf,useContext:Ht,useEffect:bc,useImperativeHandle:Vf,useInsertionEffect:Wf,useLayoutEffect:Yf,useMemo:Jf,useReducer:gc,useRef:Zf,useState:function(){return gc(cr)},useDebugValue:Cc,useDeferredValue:function(e,t){var r=vt();return Ke===null?xc(r,e,t):Qf(r,Ke.memoizedState,e,t)},useTransition:function(){var e=gc(cr)[0],t=vt().memoizedState;return[typeof e=="boolean"?e:Un(e),t]},useSyncExternalStore:Rf,useId:rd,useHostTransitionStatus:Ec,useFormState:Ff,useActionState:Ff,useOptimistic:function(e,t){var r=vt();return Ke!==null?Nf(r,Ke,e,t):(r.baseState=e,[e,r.queue.dispatch])},useMemoCache:pc,useCacheRefresh:sd};cd.useEffectEvent=Gf;function Rc(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:m({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Dc={enqueueSetState:function(e,t,r){e=e._reactInternals;var n=di(),c=Rr(n);c.payload=t,r!=null&&(c.callback=r),t=Dr(e,c,n),t!==null&&(si(t,e,n),Bn(t,e,n))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=di(),c=Rr(n);c.tag=1,c.payload=t,r!=null&&(c.callback=r),t=Dr(e,c,n),t!==null&&(si(t,e,n),Bn(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=di(),n=Rr(r);n.tag=2,t!=null&&(n.callback=t),t=Dr(e,n,r),t!==null&&(si(t,e,r),Bn(t,e,r))}};function ud(e,t,r,n,c,d,D){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,d,D):t.prototype&&t.prototype.isPureReactComponent?!An(r,n)||!An(c,d):!0}function hd(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&Dc.enqueueReplaceState(t,t.state,null)}function fs(e,t){var r=t;if("ref"in t){r={};for(var n in t)n!=="ref"&&(r[n]=t[n])}if(e=e.defaultProps){r===t&&(r=m({},r));for(var c in e)r[c]===void 0&&(r[c]=e[c])}return r}function fd(e){Ua(e)}function dd(e){console.error(e)}function _d(e){Ua(e)}function lo(e,t){try{var r=e.onUncaughtError;r(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function md(e,t,r){try{var n=e.onCaughtError;n(r.value,{componentStack:r.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function kc(e,t,r){return r=Rr(r),r.tag=3,r.payload={element:null},r.callback=function(){lo(e,t)},r}function pd(e){return e=Rr(e),e.tag=3,e}function vd(e,t,r,n){var c=r.type.getDerivedStateFromError;if(typeof c=="function"){var d=n.value;e.payload=function(){return c(d)},e.callback=function(){md(t,r,n)}}var D=r.stateNode;D!==null&&typeof D.componentDidCatch=="function"&&(e.callback=function(){md(t,r,n),typeof c!="function"&&(Br===null?Br=new Set([this]):Br.add(this));var z=n.stack;this.componentDidCatch(n.value,{componentStack:z!==null?z:""})})}function Lg(e,t,r,n,c){if(r.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=r.alternate,t!==null&&Ls(t,r,c,!0),r=ci.current,r!==null){switch(r.tag){case 31:case 13:return Ai===null?bo():r.alternate===null&&ht===0&&(ht=3),r.flags&=-257,r.flags|=65536,r.lanes=c,n===Ka?r.flags|=16384:(t=r.updateQueue,t===null?r.updateQueue=new Set([n]):t.add(n),tu(e,n,c)),!1;case 22:return r.flags|=65536,n===Ka?r.flags|=16384:(t=r.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},r.updateQueue=t):(r=t.retryQueue,r===null?t.retryQueue=new Set([n]):r.add(n)),tu(e,n,c)),!1}throw Error(o(435,r.tag))}return tu(e,n,c),bo(),!1}if(He)return t=ci.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,n!==Kl&&(e=Error(o(422),{cause:n}),kn(xi(e,r)))):(n!==Kl&&(t=Error(o(423),{cause:n}),kn(xi(t,r))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,n=xi(n,r),c=kc(e.stateNode,n,c),ac(e,c),ht!==4&&(ht=2)),!1;var d=Error(o(520),{cause:n});if(d=xi(d,r),Kn===null?Kn=[d]:Kn.push(d),ht!==4&&(ht=2),t===null)return!0;n=xi(n,r),r=t;do{switch(r.tag){case 3:return r.flags|=65536,e=c&-c,r.lanes|=e,e=kc(r.stateNode,n,e),ac(r,e),!1;case 1:if(t=r.type,d=r.stateNode,(r.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(Br===null||!Br.has(d))))return r.flags|=65536,c&=-c,r.lanes|=c,c=pd(c),vd(c,e,r,n),ac(r,c),!1}r=r.return}while(r!==null);return!1}var Oc=Error(o(461)),xt=!1;function Ut(e,t,r,n){t.child=e===null?bf(t,null,r,n):us(t,e.child,r,n)}function gd(e,t,r,n,c){r=r.render;var d=t.ref;if("ref"in n){var D={};for(var z in n)z!=="ref"&&(D[z]=n[z])}else D=n;return as(t),n=fc(e,t,r,D,d,c),z=dc(),e!==null&&!xt?(_c(e,t,c),ur(e,t,c)):(He&&z&&Wl(t),t.flags|=1,Ut(e,t,n,c),t.child)}function yd(e,t,r,n,c){if(e===null){var d=r.type;return typeof d=="function"&&!Zl(d)&&d.defaultProps===void 0&&r.compare===null?(t.tag=15,t.type=d,Sd(e,t,d,n,c)):(e=Fa(r.type,null,n,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,!Uc(e,c)){var D=d.memoizedProps;if(r=r.compare,r=r!==null?r:An,r(D,n)&&e.ref===t.ref)return ur(e,t,c)}return t.flags|=1,e=sr(d,n),e.ref=t.ref,e.return=t,t.child=e}function Sd(e,t,r,n,c){if(e!==null){var d=e.memoizedProps;if(An(d,n)&&e.ref===t.ref)if(xt=!1,t.pendingProps=n=d,Uc(e,c))(e.flags&131072)!==0&&(xt=!0);else return t.lanes=e.lanes,ur(e,t,c)}return Mc(e,t,r,n,c)}function bd(e,t,r,n){var c=n.children,d=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(d=d!==null?d.baseLanes|r:r,e!==null){for(n=t.child=e.child,c=0;n!==null;)c=c|n.lanes|n.childLanes,n=n.sibling;n=c&~d}else n=0,t.child=null;return Cd(e,t,d,r,n)}if((r&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Wa(t,d!==null?d.cachePool:null),d!==null?wf(t,d):lc(),Ef(t);else return n=t.lanes=536870912,Cd(e,t,d!==null?d.baseLanes|r:r,r,n)}else d!==null?(Wa(t,d.cachePool),wf(t,d),Or(),t.memoizedState=null):(e!==null&&Wa(t,null),lc(),Or());return Ut(e,t,c,r),t.child}function $n(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Cd(e,t,r,n,c){var d=ic();return d=d===null?null:{parent:bt._currentValue,pool:d},t.memoizedState={baseLanes:r,cachePool:d},e!==null&&Wa(t,null),lc(),Ef(t),e!==null&&Ls(e,t,n,!0),t.childLanes=c,null}function co(e,t){return t=ho({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function xd(e,t,r){return us(t,e.child,null,r),e=co(t,t.pendingProps),e.flags|=2,ui(t),t.memoizedState=null,e}function Ng(e,t,r){var n=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(He){if(n.mode==="hidden")return e=co(t,n),t.lanes=536870912,$n(null,e);if(uc(t),(e=et)?(e=B_(e,Ti),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:xr!==null?{id:$i,overflow:Fi}:null,retryLane:536870912,hydrationErrors:null},r=af(e),r.return=t,t.child=r,jt=t,et=null)):e=null,e===null)throw Er(t);return t.lanes=536870912,null}return co(t,n)}var d=e.memoizedState;if(d!==null){var D=d.dehydrated;if(uc(t),c)if(t.flags&256)t.flags&=-257,t=xd(e,t,r);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(xt||Ls(e,t,r,!1),c=(r&e.childLanes)!==0,xt||c){if(n=Je,n!==null&&(D=Ea(n,r),D!==0&&D!==d.retryLane))throw d.retryLane=D,is(e,D),si(n,e,D),Oc;bo(),t=xd(e,t,r)}else e=d.treeContext,et=Ri(D.nextSibling),jt=t,He=!0,wr=null,Ti=!1,e!==null&&cf(t,e),t=co(t,n),t.flags|=4096;return t}return e=sr(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function uo(e,t){var r=t.ref;if(r===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(o(284));(e===null||e.ref!==r)&&(t.flags|=4194816)}}function Mc(e,t,r,n,c){return as(t),r=fc(e,t,r,n,void 0,c),n=dc(),e!==null&&!xt?(_c(e,t,c),ur(e,t,c)):(He&&n&&Wl(t),t.flags|=1,Ut(e,t,r,c),t.child)}function wd(e,t,r,n,c,d){return as(t),t.updateQueue=null,r=Af(t,n,r,c),Tf(e),n=dc(),e!==null&&!xt?(_c(e,t,d),ur(e,t,d)):(He&&n&&Wl(t),t.flags|=1,Ut(e,t,r,d),t.child)}function Ed(e,t,r,n,c){if(as(t),t.stateNode===null){var d=Ds,D=r.contextType;typeof D=="object"&&D!==null&&(d=Ht(D)),d=new r(n,d),t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=Dc,t.stateNode=d,d._reactInternals=t,d=t.stateNode,d.props=n,d.state=t.memoizedState,d.refs={},sc(t),D=r.contextType,d.context=typeof D=="object"&&D!==null?Ht(D):Ds,d.state=t.memoizedState,D=r.getDerivedStateFromProps,typeof D=="function"&&(Rc(t,r,D,n),d.state=t.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(D=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),D!==d.state&&Dc.enqueueReplaceState(d,d.state,null),jn(t,n,d,c),zn(),d.state=t.memoizedState),typeof d.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){d=t.stateNode;var z=t.memoizedProps,Z=fs(r,z);d.props=Z;var ie=d.context,le=r.contextType;D=Ds,typeof le=="object"&&le!==null&&(D=Ht(le));var de=r.getDerivedStateFromProps;le=typeof de=="function"||typeof d.getSnapshotBeforeUpdate=="function",z=t.pendingProps!==z,le||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(z||ie!==D)&&hd(t,d,n,D),Ar=!1;var se=t.memoizedState;d.state=se,jn(t,n,d,c),zn(),ie=t.memoizedState,z||se!==ie||Ar?(typeof de=="function"&&(Rc(t,r,de,n),ie=t.memoizedState),(Z=Ar||ud(t,r,Z,n,se,ie,D))?(le||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(t.flags|=4194308)):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=ie),d.props=n,d.state=ie,d.context=D,n=Z):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{d=t.stateNode,nc(e,t),D=t.memoizedProps,le=fs(r,D),d.props=le,de=t.pendingProps,se=d.context,ie=r.contextType,Z=Ds,typeof ie=="object"&&ie!==null&&(Z=Ht(ie)),z=r.getDerivedStateFromProps,(ie=typeof z=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(D!==de||se!==Z)&&hd(t,d,n,Z),Ar=!1,se=t.memoizedState,d.state=se,jn(t,n,d,c),zn();var ae=t.memoizedState;D!==de||se!==ae||Ar||e!==null&&e.dependencies!==null&&qa(e.dependencies)?(typeof z=="function"&&(Rc(t,r,z,n),ae=t.memoizedState),(le=Ar||ud(t,r,le,n,se,ae,Z)||e!==null&&e.dependencies!==null&&qa(e.dependencies))?(ie||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(n,ae,Z),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(n,ae,Z)),typeof d.componentDidUpdate=="function"&&(t.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof d.componentDidUpdate!="function"||D===e.memoizedProps&&se===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||D===e.memoizedProps&&se===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=ae),d.props=n,d.state=ae,d.context=Z,n=le):(typeof d.componentDidUpdate!="function"||D===e.memoizedProps&&se===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||D===e.memoizedProps&&se===e.memoizedState||(t.flags|=1024),n=!1)}return d=n,uo(e,t),n=(t.flags&128)!==0,d||n?(d=t.stateNode,r=n&&typeof r.getDerivedStateFromError!="function"?null:d.render(),t.flags|=1,e!==null&&n?(t.child=us(t,e.child,null,c),t.child=us(t,null,r,c)):Ut(e,t,r,c),t.memoizedState=d.state,e=t.child):e=ur(e,t,c),e}function Td(e,t,r,n){return ss(),t.flags|=256,Ut(e,t,r,n),t.child}var Lc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Nc(e){return{baseLanes:e,cachePool:mf()}}function Bc(e,t,r){return e=e!==null?e.childLanes&~r:0,t&&(e|=fi),e}function Ad(e,t,r){var n=t.pendingProps,c=!1,d=(t.flags&128)!==0,D;if((D=d)||(D=e!==null&&e.memoizedState===null?!1:(pt.current&2)!==0),D&&(c=!0,t.flags&=-129),D=(t.flags&32)!==0,t.flags&=-33,e===null){if(He){if(c?kr(t):Or(),(e=et)?(e=B_(e,Ti),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:xr!==null?{id:$i,overflow:Fi}:null,retryLane:536870912,hydrationErrors:null},r=af(e),r.return=t,t.child=r,jt=t,et=null)):e=null,e===null)throw Er(t);return vu(e)?t.lanes=32:t.lanes=536870912,null}var z=n.children;return n=n.fallback,c?(Or(),c=t.mode,z=ho({mode:"hidden",children:z},c),n=rs(n,c,r,null),z.return=t,n.return=t,z.sibling=n,t.child=z,n=t.child,n.memoizedState=Nc(r),n.childLanes=Bc(e,D,r),t.memoizedState=Lc,$n(null,n)):(kr(t),zc(t,z))}var Z=e.memoizedState;if(Z!==null&&(z=Z.dehydrated,z!==null)){if(d)t.flags&256?(kr(t),t.flags&=-257,t=jc(e,t,r)):t.memoizedState!==null?(Or(),t.child=e.child,t.flags|=128,t=null):(Or(),z=n.fallback,c=t.mode,n=ho({mode:"visible",children:n.children},c),z=rs(z,c,r,null),z.flags|=2,n.return=t,z.return=t,n.sibling=z,t.child=n,us(t,e.child,null,r),n=t.child,n.memoizedState=Nc(r),n.childLanes=Bc(e,D,r),t.memoizedState=Lc,t=$n(null,n));else if(kr(t),vu(z)){if(D=z.nextSibling&&z.nextSibling.dataset,D)var ie=D.dgst;D=ie,n=Error(o(419)),n.stack="",n.digest=D,kn({value:n,source:null,stack:null}),t=jc(e,t,r)}else if(xt||Ls(e,t,r,!1),D=(r&e.childLanes)!==0,xt||D){if(D=Je,D!==null&&(n=Ea(D,r),n!==0&&n!==Z.retryLane))throw Z.retryLane=n,is(e,n),si(D,e,n),Oc;pu(z)||bo(),t=jc(e,t,r)}else pu(z)?(t.flags|=192,t.child=e.child,t=null):(e=Z.treeContext,et=Ri(z.nextSibling),jt=t,He=!0,wr=null,Ti=!1,e!==null&&cf(t,e),t=zc(t,n.children),t.flags|=4096);return t}return c?(Or(),z=n.fallback,c=t.mode,Z=e.child,ie=Z.sibling,n=sr(Z,{mode:"hidden",children:n.children}),n.subtreeFlags=Z.subtreeFlags&65011712,ie!==null?z=sr(ie,z):(z=rs(z,c,r,null),z.flags|=2),z.return=t,n.return=t,n.sibling=z,t.child=n,$n(null,n),n=t.child,z=e.child.memoizedState,z===null?z=Nc(r):(c=z.cachePool,c!==null?(Z=bt._currentValue,c=c.parent!==Z?{parent:Z,pool:Z}:c):c=mf(),z={baseLanes:z.baseLanes|r,cachePool:c}),n.memoizedState=z,n.childLanes=Bc(e,D,r),t.memoizedState=Lc,$n(e.child,n)):(kr(t),r=e.child,e=r.sibling,r=sr(r,{mode:"visible",children:n.children}),r.return=t,r.sibling=null,e!==null&&(D=t.deletions,D===null?(t.deletions=[e],t.flags|=16):D.push(e)),t.child=r,t.memoizedState=null,r)}function zc(e,t){return t=ho({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ho(e,t){return e=li(22,e,null,t),e.lanes=0,e}function jc(e,t,r){return us(t,e.child,null,r),e=zc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Rd(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Jl(e.return,t,r)}function Hc(e,t,r,n,c,d){var D=e.memoizedState;D===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:c,treeForkCount:d}:(D.isBackwards=t,D.rendering=null,D.renderingStartTime=0,D.last=n,D.tail=r,D.tailMode=c,D.treeForkCount=d)}function Dd(e,t,r){var n=t.pendingProps,c=n.revealOrder,d=n.tail;n=n.children;var D=pt.current,z=(D&2)!==0;if(z?(D=D&1|2,t.flags|=128):D&=1,X(pt,D),Ut(e,t,n,r),n=He?Dn:0,!z&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Rd(e,r,t);else if(e.tag===19)Rd(e,r,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(c){case"forwards":for(r=t.child,c=null;r!==null;)e=r.alternate,e!==null&&Qa(e)===null&&(c=r),r=r.sibling;r=c,r===null?(c=t.child,t.child=null):(c=r.sibling,r.sibling=null),Hc(t,!1,c,r,d,n);break;case"backwards":case"unstable_legacy-backwards":for(r=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&Qa(e)===null){t.child=c;break}e=c.sibling,c.sibling=r,r=c,c=e}Hc(t,!0,r,null,d,n);break;case"together":Hc(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function ur(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Nr|=t.lanes,(r&t.childLanes)===0)if(e!==null){if(Ls(e,t,r,!1),(r&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,r=sr(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=sr(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Uc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&qa(e)))}function Bg(e,t,r){switch(t.tag){case 3:j(t,t.stateNode.containerInfo),Tr(t,bt,e.memoizedState.cache),ss();break;case 27:case 5:oe(t);break;case 4:j(t,t.stateNode.containerInfo);break;case 10:Tr(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,uc(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(kr(t),t.flags|=128,null):(r&t.child.childLanes)!==0?Ad(e,t,r):(kr(t),e=ur(e,t,r),e!==null?e.sibling:null);kr(t);break;case 19:var c=(e.flags&128)!==0;if(n=(r&t.childLanes)!==0,n||(Ls(e,t,r,!1),n=(r&t.childLanes)!==0),c){if(n)return Dd(e,t,r);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),X(pt,pt.current),n)break;return null;case 22:return t.lanes=0,bd(e,t,r,t.pendingProps);case 24:Tr(t,bt,e.memoizedState.cache)}return ur(e,t,r)}function kd(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps)xt=!0;else{if(!Uc(e,r)&&(t.flags&128)===0)return xt=!1,Bg(e,t,r);xt=(e.flags&131072)!==0}else xt=!1,He&&(t.flags&1048576)!==0&&lf(t,Dn,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=ls(t.elementType),t.type=e,typeof e=="function")Zl(e)?(n=fs(e,n),t.tag=1,t=Ed(null,t,e,n,r)):(t.tag=0,t=Mc(null,t,e,n,r));else{if(e!=null){var c=e.$$typeof;if(c===S){t.tag=11,t=gd(null,t,e,n,r);break e}else if(c===M){t.tag=14,t=yd(null,t,e,n,r);break e}}throw t=Q(e)||e,Error(o(306,t,""))}}return t;case 0:return Mc(e,t,t.type,t.pendingProps,r);case 1:return n=t.type,c=fs(n,t.pendingProps),Ed(e,t,n,c,r);case 3:e:{if(j(t,t.stateNode.containerInfo),e===null)throw Error(o(387));n=t.pendingProps;var d=t.memoizedState;c=d.element,nc(e,t),jn(t,n,null,r);var D=t.memoizedState;if(n=D.cache,Tr(t,bt,n),n!==d.cache&&Ql(t,[bt],r,!0),zn(),n=D.element,d.isDehydrated)if(d={element:n,isDehydrated:!1,cache:D.cache},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){t=Td(e,t,n,r);break e}else if(n!==c){c=xi(Error(o(424)),t),kn(c),t=Td(e,t,n,r);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(et=Ri(e.firstChild),jt=t,He=!0,wr=null,Ti=!0,r=bf(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling}else{if(ss(),n===c){t=ur(e,t,r);break e}Ut(e,t,n,r)}t=t.child}return t;case 26:return uo(e,t),e===null?(r=P_(t.type,null,t.pendingProps,null))?t.memoizedState=r:He||(r=t.type,e=t.pendingProps,n=Ro(me.current).createElement(r),n[St]=t,n[it]=e,It(n,r,e),ke(n),t.stateNode=n):t.memoizedState=P_(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return oe(t),e===null&&He&&(n=t.stateNode=H_(t.type,t.pendingProps,me.current),jt=t,Ti=!0,c=et,Ur(t.type)?(gu=c,et=Ri(n.firstChild)):et=c),Ut(e,t,t.pendingProps.children,r),uo(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&He&&((c=n=et)&&(n=h0(n,t.type,t.pendingProps,Ti),n!==null?(t.stateNode=n,jt=t,et=Ri(n.firstChild),Ti=!1,c=!0):c=!1),c||Er(t)),oe(t),c=t.type,d=t.pendingProps,D=e!==null?e.memoizedProps:null,n=d.children,du(c,d)?n=null:D!==null&&du(c,D)&&(t.flags|=32),t.memoizedState!==null&&(c=fc(e,t,Tg,null,null,r),ra._currentValue=c),uo(e,t),Ut(e,t,n,r),t.child;case 6:return e===null&&He&&((e=r=et)&&(r=f0(r,t.pendingProps,Ti),r!==null?(t.stateNode=r,jt=t,et=null,e=!0):e=!1),e||Er(t)),null;case 13:return Ad(e,t,r);case 4:return j(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=us(t,null,n,r):Ut(e,t,n,r),t.child;case 11:return gd(e,t,t.type,t.pendingProps,r);case 7:return Ut(e,t,t.pendingProps,r),t.child;case 8:return Ut(e,t,t.pendingProps.children,r),t.child;case 12:return Ut(e,t,t.pendingProps.children,r),t.child;case 10:return n=t.pendingProps,Tr(t,t.type,n.value),Ut(e,t,n.children,r),t.child;case 9:return c=t.type._context,n=t.pendingProps.children,as(t),c=Ht(c),n=n(c),t.flags|=1,Ut(e,t,n,r),t.child;case 14:return yd(e,t,t.type,t.pendingProps,r);case 15:return Sd(e,t,t.type,t.pendingProps,r);case 19:return Dd(e,t,r);case 31:return Ng(e,t,r);case 22:return bd(e,t,r,t.pendingProps);case 24:return as(t),n=Ht(bt),e===null?(c=ic(),c===null&&(c=Je,d=ec(),c.pooledCache=d,d.refCount++,d!==null&&(c.pooledCacheLanes|=r),c=d),t.memoizedState={parent:n,cache:c},sc(t),Tr(t,bt,c)):((e.lanes&r)!==0&&(nc(e,t),jn(t,null,null,r),zn()),c=e.memoizedState,d=t.memoizedState,c.parent!==n?(c={parent:n,cache:n},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),Tr(t,bt,n)):(n=d.cache,Tr(t,bt,n),n!==c.cache&&Ql(t,[bt],r,!0))),Ut(e,t,t.pendingProps.children,r),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function hr(e){e.flags|=4}function Ic(e,t,r,n,c){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(r_())e.flags|=8192;else throw cs=Ka,rc}else e.flags&=-16777217}function Od(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!G_(t))if(r_())e.flags|=8192;else throw cs=Ka,rc}function fo(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Qi():536870912,e.lanes|=t,qs|=t)}function Fn(e,t){if(!He)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function tt(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var c=e.child;c!==null;)r|=c.lanes|c.childLanes,n|=c.subtreeFlags&65011712,n|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)r|=c.lanes|c.childLanes,n|=c.subtreeFlags,n|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function zg(e,t,r){var n=t.pendingProps;switch(Yl(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tt(t),null;case 1:return tt(t),null;case 3:return r=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),or(bt),ce(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Ms(t)?hr(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Vl())),tt(t),null;case 26:var c=t.type,d=t.memoizedState;return e===null?(hr(t),d!==null?(tt(t),Od(t,d)):(tt(t),Ic(t,c,null,n,r))):d?d!==e.memoizedState?(hr(t),tt(t),Od(t,d)):(tt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&hr(t),tt(t),Ic(t,c,e,n,r)),null;case 27:if(ve(t),r=me.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&hr(t);else{if(!n){if(t.stateNode===null)throw Error(o(166));return tt(t),null}e=ne.current,Ms(t)?uf(t):(e=H_(c,n,r),t.stateNode=e,hr(t))}return tt(t),null;case 5:if(ve(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&hr(t);else{if(!n){if(t.stateNode===null)throw Error(o(166));return tt(t),null}if(d=ne.current,Ms(t))uf(t);else{var D=Ro(me.current);switch(d){case 1:d=D.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:d=D.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":d=D.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":d=D.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":d=D.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof n.is=="string"?D.createElement("select",{is:n.is}):D.createElement("select"),n.multiple?d.multiple=!0:n.size&&(d.size=n.size);break;default:d=typeof n.is=="string"?D.createElement(c,{is:n.is}):D.createElement(c)}}d[St]=t,d[it]=n;e:for(D=t.child;D!==null;){if(D.tag===5||D.tag===6)d.appendChild(D.stateNode);else if(D.tag!==4&&D.tag!==27&&D.child!==null){D.child.return=D,D=D.child;continue}if(D===t)break e;for(;D.sibling===null;){if(D.return===null||D.return===t)break e;D=D.return}D.sibling.return=D.return,D=D.sibling}t.stateNode=d;e:switch(It(d,c,n),c){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&hr(t)}}return tt(t),Ic(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,r),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&hr(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(o(166));if(e=me.current,Ms(t)){if(e=t.stateNode,r=t.memoizedProps,n=null,c=jt,c!==null)switch(c.tag){case 27:case 5:n=c.memoizedProps}e[St]=t,e=!!(e.nodeValue===r||n!==null&&n.suppressHydrationWarning===!0||A_(e.nodeValue,r)),e||Er(t,!0)}else e=Ro(e).createTextNode(n),e[St]=t,t.stateNode=e}return tt(t),null;case 31:if(r=t.memoizedState,e===null||e.memoizedState!==null){if(n=Ms(t),r!==null){if(e===null){if(!n)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[St]=t}else ss(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;tt(t),e=!1}else r=Vl(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),e=!0;if(!e)return t.flags&256?(ui(t),t):(ui(t),null);if((t.flags&128)!==0)throw Error(o(558))}return tt(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=Ms(t),n!==null&&n.dehydrated!==null){if(e===null){if(!c)throw Error(o(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(o(317));c[St]=t}else ss(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;tt(t),c=!1}else c=Vl(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(ui(t),t):(ui(t),null)}return ui(t),(t.flags&128)!==0?(t.lanes=r,t):(r=n!==null,e=e!==null&&e.memoizedState!==null,r&&(n=t.child,c=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(c=n.alternate.memoizedState.cachePool.pool),d=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(d=n.memoizedState.cachePool.pool),d!==c&&(n.flags|=2048)),r!==e&&r&&(t.child.flags|=8192),fo(t,t.updateQueue),tt(t),null);case 4:return ce(),e===null&&lu(t.stateNode.containerInfo),tt(t),null;case 10:return or(t.type),tt(t),null;case 19:if(H(pt),n=t.memoizedState,n===null)return tt(t),null;if(c=(t.flags&128)!==0,d=n.rendering,d===null)if(c)Fn(n,!1);else{if(ht!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(d=Qa(e),d!==null){for(t.flags|=128,Fn(n,!1),e=d.updateQueue,t.updateQueue=e,fo(t,e),t.subtreeFlags=0,e=r,r=t.child;r!==null;)nf(r,e),r=r.sibling;return X(pt,pt.current&1|2),He&&nr(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&nt()>go&&(t.flags|=128,c=!0,Fn(n,!1),t.lanes=4194304)}else{if(!c)if(e=Qa(d),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,fo(t,e),Fn(n,!0),n.tail===null&&n.tailMode==="hidden"&&!d.alternate&&!He)return tt(t),null}else 2*nt()-n.renderingStartTime>go&&r!==536870912&&(t.flags|=128,c=!0,Fn(n,!1),t.lanes=4194304);n.isBackwards?(d.sibling=t.child,t.child=d):(e=n.last,e!==null?e.sibling=d:t.child=d,n.last=d)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=nt(),e.sibling=null,r=pt.current,X(pt,c?r&1|2:r&1),He&&nr(t,n.treeForkCount),e):(tt(t),null);case 22:case 23:return ui(t),cc(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(r&536870912)!==0&&(t.flags&128)===0&&(tt(t),t.subtreeFlags&6&&(t.flags|=8192)):tt(t),r=t.updateQueue,r!==null&&fo(t,r.retryQueue),r=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==r&&(t.flags|=2048),e!==null&&H(os),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),or(bt),tt(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function jg(e,t){switch(Yl(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return or(bt),ce(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ve(t),null;case 31:if(t.memoizedState!==null){if(ui(t),t.alternate===null)throw Error(o(340));ss()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ui(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));ss()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return H(pt),null;case 4:return ce(),null;case 10:return or(t.type),null;case 22:case 23:return ui(t),cc(),e!==null&&H(os),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return or(bt),null;case 25:return null;default:return null}}function Md(e,t){switch(Yl(t),t.tag){case 3:or(bt),ce();break;case 26:case 27:case 5:ve(t);break;case 4:ce();break;case 31:t.memoizedState!==null&&ui(t);break;case 13:ui(t);break;case 19:H(pt);break;case 10:or(t.type);break;case 22:case 23:ui(t),cc(),e!==null&&H(os);break;case 24:or(bt)}}function Zn(e,t){try{var r=t.updateQueue,n=r!==null?r.lastEffect:null;if(n!==null){var c=n.next;r=c;do{if((r.tag&e)===e){n=void 0;var d=r.create,D=r.inst;n=d(),D.destroy=n}r=r.next}while(r!==c)}}catch(z){Ge(t,t.return,z)}}function Mr(e,t,r){try{var n=t.updateQueue,c=n!==null?n.lastEffect:null;if(c!==null){var d=c.next;n=d;do{if((n.tag&e)===e){var D=n.inst,z=D.destroy;if(z!==void 0){D.destroy=void 0,c=t;var Z=r,ie=z;try{ie()}catch(le){Ge(c,Z,le)}}}n=n.next}while(n!==d)}}catch(le){Ge(t,t.return,le)}}function Ld(e){var t=e.updateQueue;if(t!==null){var r=e.stateNode;try{xf(t,r)}catch(n){Ge(e,e.return,n)}}}function Nd(e,t,r){r.props=fs(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(n){Ge(e,t,n)}}function qn(e,t){try{var r=e.ref;if(r!==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 r=="function"?e.refCleanup=r(n):r.current=n}}catch(c){Ge(e,t,c)}}function Zi(e,t){var r=e.ref,n=e.refCleanup;if(r!==null)if(typeof n=="function")try{n()}catch(c){Ge(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(c){Ge(e,t,c)}else r.current=null}function Bd(e){var t=e.type,r=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":r.autoFocus&&n.focus();break e;case"img":r.src?n.src=r.src:r.srcSet&&(n.srcset=r.srcSet)}}catch(c){Ge(e,e.return,c)}}function Pc(e,t,r){try{var n=e.stateNode;n0(n,e.type,r,t),n[it]=t}catch(c){Ge(e,e.return,c)}}function zd(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ur(e.type)||e.tag===4}function $c(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||zd(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&&Ur(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 Fc(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(e,t):(t=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,t.appendChild(e),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=ir));else if(n!==4&&(n===27&&Ur(e.type)&&(r=e.stateNode,t=null),e=e.child,e!==null))for(Fc(e,t,r),e=e.sibling;e!==null;)Fc(e,t,r),e=e.sibling}function _o(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(n===27&&Ur(e.type)&&(r=e.stateNode),e=e.child,e!==null))for(_o(e,t,r),e=e.sibling;e!==null;)_o(e,t,r),e=e.sibling}function jd(e){var t=e.stateNode,r=e.memoizedProps;try{for(var n=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);It(t,n,r),t[St]=e,t[it]=r}catch(d){Ge(e,e.return,d)}}var fr=!1,wt=!1,Zc=!1,Hd=typeof WeakSet=="function"?WeakSet:Set,Mt=null;function Hg(e,t){if(e=e.containerInfo,hu=Bo,e=Kh(e),jl(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var c=n.anchorOffset,d=n.focusNode;n=n.focusOffset;try{r.nodeType,d.nodeType}catch{r=null;break e}var D=0,z=-1,Z=-1,ie=0,le=0,de=e,se=null;t:for(;;){for(var ae;de!==r||c!==0&&de.nodeType!==3||(z=D+c),de!==d||n!==0&&de.nodeType!==3||(Z=D+n),de.nodeType===3&&(D+=de.nodeValue.length),(ae=de.firstChild)!==null;)se=de,de=ae;for(;;){if(de===e)break t;if(se===r&&++ie===c&&(z=D),se===d&&++le===n&&(Z=D),(ae=de.nextSibling)!==null)break;de=se,se=de.parentNode}de=ae}r=z===-1||Z===-1?null:{start:z,end:Z}}else r=null}r=r||{start:0,end:0}}else r=null;for(fu={focusedElem:e,selectionRange:r},Bo=!1,Mt=t;Mt!==null;)if(t=Mt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Mt=e;else for(;Mt!==null;){switch(t=Mt,d=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(r=0;r<e.length;r++)c=e[r],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&d!==null){e=void 0,r=t,c=d.memoizedProps,d=d.memoizedState,n=r.stateNode;try{var ye=fs(r.type,c);e=n.getSnapshotBeforeUpdate(ye,d),n.__reactInternalSnapshotBeforeUpdate=e}catch(we){Ge(r,r.return,we)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,r=e.nodeType,r===9)mu(e);else if(r===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":mu(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(o(163))}if(e=t.sibling,e!==null){e.return=t.return,Mt=e;break}Mt=t.return}}function Ud(e,t,r){var n=r.flags;switch(r.tag){case 0:case 11:case 15:_r(e,r),n&4&&Zn(5,r);break;case 1:if(_r(e,r),n&4)if(e=r.stateNode,t===null)try{e.componentDidMount()}catch(D){Ge(r,r.return,D)}else{var c=fs(r.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(D){Ge(r,r.return,D)}}n&64&&Ld(r),n&512&&qn(r,r.return);break;case 3:if(_r(e,r),n&64&&(e=r.updateQueue,e!==null)){if(t=null,r.child!==null)switch(r.child.tag){case 27:case 5:t=r.child.stateNode;break;case 1:t=r.child.stateNode}try{xf(e,t)}catch(D){Ge(r,r.return,D)}}break;case 27:t===null&&n&4&&jd(r);case 26:case 5:_r(e,r),t===null&&n&4&&Bd(r),n&512&&qn(r,r.return);break;case 12:_r(e,r);break;case 31:_r(e,r),n&4&&$d(e,r);break;case 13:_r(e,r),n&4&&Fd(e,r),n&64&&(e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(r=Wg.bind(null,r),d0(e,r))));break;case 22:if(n=r.memoizedState!==null||fr,!n){t=t!==null&&t.memoizedState!==null||wt,c=fr;var d=wt;fr=n,(wt=t)&&!d?mr(e,r,(r.subtreeFlags&8772)!==0):_r(e,r),fr=c,wt=d}break;case 30:break;default:_r(e,r)}}function Id(e){var t=e.alternate;t!==null&&(e.alternate=null,Id(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&W(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 rt=null,ei=!1;function dr(e,t,r){for(r=r.child;r!==null;)Pd(e,t,r),r=r.sibling}function Pd(e,t,r){if(kt&&typeof kt.onCommitFiberUnmount=="function")try{kt.onCommitFiberUnmount(vi,r)}catch{}switch(r.tag){case 26:wt||Zi(r,t),dr(e,t,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:wt||Zi(r,t);var n=rt,c=ei;Ur(r.type)&&(rt=r.stateNode,ei=!1),dr(e,t,r),ea(r.stateNode),rt=n,ei=c;break;case 5:wt||Zi(r,t);case 6:if(n=rt,c=ei,rt=null,dr(e,t,r),rt=n,ei=c,rt!==null)if(ei)try{(rt.nodeType===9?rt.body:rt.nodeName==="HTML"?rt.ownerDocument.body:rt).removeChild(r.stateNode)}catch(d){Ge(r,t,d)}else try{rt.removeChild(r.stateNode)}catch(d){Ge(r,t,d)}break;case 18:rt!==null&&(ei?(e=rt,L_(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,r.stateNode),Qs(e)):L_(rt,r.stateNode));break;case 4:n=rt,c=ei,rt=r.stateNode.containerInfo,ei=!0,dr(e,t,r),rt=n,ei=c;break;case 0:case 11:case 14:case 15:Mr(2,r,t),wt||Mr(4,r,t),dr(e,t,r);break;case 1:wt||(Zi(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"&&Nd(r,t,n)),dr(e,t,r);break;case 21:dr(e,t,r);break;case 22:wt=(n=wt)||r.memoizedState!==null,dr(e,t,r),wt=n;break;default:dr(e,t,r)}}function $d(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Qs(e)}catch(r){Ge(t,t.return,r)}}}function Fd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Qs(e)}catch(r){Ge(t,t.return,r)}}function Ug(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Hd),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Hd),t;default:throw Error(o(435,e.tag))}}function mo(e,t){var r=Ug(e);t.forEach(function(n){if(!r.has(n)){r.add(n);var c=Yg.bind(null,e,n);n.then(c,c)}})}function ti(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var c=r[n],d=e,D=t,z=D;e:for(;z!==null;){switch(z.tag){case 27:if(Ur(z.type)){rt=z.stateNode,ei=!1;break e}break;case 5:rt=z.stateNode,ei=!1;break e;case 3:case 4:rt=z.stateNode.containerInfo,ei=!0;break e}z=z.return}if(rt===null)throw Error(o(160));Pd(d,D,c),rt=null,ei=!1,d=c.alternate,d!==null&&(d.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Zd(t,e),t=t.sibling}var zi=null;function Zd(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ti(t,e),ii(e),n&4&&(Mr(3,e,e.return),Zn(3,e),Mr(5,e,e.return));break;case 1:ti(t,e),ii(e),n&512&&(wt||r===null||Zi(r,r.return)),n&64&&fr&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(r=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=r===null?n:r.concat(n))));break;case 26:var c=zi;if(ti(t,e),ii(e),n&512&&(wt||r===null||Zi(r,r.return)),n&4){var d=r!==null?r.memoizedState:null;if(n=e.memoizedState,r===null)if(n===null)if(e.stateNode===null){e:{n=e.type,r=e.memoizedProps,c=c.ownerDocument||c;t:switch(n){case"title":d=c.getElementsByTagName("title")[0],(!d||d[Se]||d[St]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=c.createElement(n),c.head.insertBefore(d,c.querySelector("head > title"))),It(d,n,r),d[St]=e,ke(d),n=d;break e;case"link":var D=Z_("link","href",c).get(n+(r.href||""));if(D){for(var z=0;z<D.length;z++)if(d=D[z],d.getAttribute("href")===(r.href==null||r.href===""?null:r.href)&&d.getAttribute("rel")===(r.rel==null?null:r.rel)&&d.getAttribute("title")===(r.title==null?null:r.title)&&d.getAttribute("crossorigin")===(r.crossOrigin==null?null:r.crossOrigin)){D.splice(z,1);break t}}d=c.createElement(n),It(d,n,r),c.head.appendChild(d);break;case"meta":if(D=Z_("meta","content",c).get(n+(r.content||""))){for(z=0;z<D.length;z++)if(d=D[z],d.getAttribute("content")===(r.content==null?null:""+r.content)&&d.getAttribute("name")===(r.name==null?null:r.name)&&d.getAttribute("property")===(r.property==null?null:r.property)&&d.getAttribute("http-equiv")===(r.httpEquiv==null?null:r.httpEquiv)&&d.getAttribute("charset")===(r.charSet==null?null:r.charSet)){D.splice(z,1);break t}}d=c.createElement(n),It(d,n,r),c.head.appendChild(d);break;default:throw Error(o(468,n))}d[St]=e,ke(d),n=d}e.stateNode=n}else q_(c,e.type,e.stateNode);else e.stateNode=F_(c,n,e.memoizedProps);else d!==n?(d===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):d.count--,n===null?q_(c,e.type,e.stateNode):F_(c,n,e.memoizedProps)):n===null&&e.stateNode!==null&&Pc(e,e.memoizedProps,r.memoizedProps)}break;case 27:ti(t,e),ii(e),n&512&&(wt||r===null||Zi(r,r.return)),r!==null&&n&4&&Pc(e,e.memoizedProps,r.memoizedProps);break;case 5:if(ti(t,e),ii(e),n&512&&(wt||r===null||Zi(r,r.return)),e.flags&32){c=e.stateNode;try{Cs(c,"")}catch(ye){Ge(e,e.return,ye)}}n&4&&e.stateNode!=null&&(c=e.memoizedProps,Pc(e,c,r!==null?r.memoizedProps:c)),n&1024&&(Zc=!0);break;case 6:if(ti(t,e),ii(e),n&4){if(e.stateNode===null)throw Error(o(162));n=e.memoizedProps,r=e.stateNode;try{r.nodeValue=n}catch(ye){Ge(e,e.return,ye)}}break;case 3:if(Oo=null,c=zi,zi=Do(t.containerInfo),ti(t,e),zi=c,ii(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{Qs(t.containerInfo)}catch(ye){Ge(e,e.return,ye)}Zc&&(Zc=!1,qd(e));break;case 4:n=zi,zi=Do(e.stateNode.containerInfo),ti(t,e),ii(e),zi=n;break;case 12:ti(t,e),ii(e);break;case 31:ti(t,e),ii(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,mo(e,n)));break;case 13:ti(t,e),ii(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(vo=nt()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,mo(e,n)));break;case 22:c=e.memoizedState!==null;var Z=r!==null&&r.memoizedState!==null,ie=fr,le=wt;if(fr=ie||c,wt=le||Z,ti(t,e),wt=le,fr=ie,ii(e),n&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(r===null||Z||fr||wt||ds(e)),r=null,t=e;;){if(t.tag===5||t.tag===26){if(r===null){Z=r=t;try{if(d=Z.stateNode,c)D=d.style,typeof D.setProperty=="function"?D.setProperty("display","none","important"):D.display="none";else{z=Z.stateNode;var de=Z.memoizedProps.style,se=de!=null&&de.hasOwnProperty("display")?de.display:null;z.style.display=se==null||typeof se=="boolean"?"":(""+se).trim()}}catch(ye){Ge(Z,Z.return,ye)}}}else if(t.tag===6){if(r===null){Z=t;try{Z.stateNode.nodeValue=c?"":Z.memoizedProps}catch(ye){Ge(Z,Z.return,ye)}}}else if(t.tag===18){if(r===null){Z=t;try{var ae=Z.stateNode;c?N_(ae,!0):N_(Z.stateNode,!1)}catch(ye){Ge(Z,Z.return,ye)}}}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;r===t&&(r=null),t=t.return}r===t&&(r=null),t.sibling.return=t.return,t=t.sibling}n&4&&(n=e.updateQueue,n!==null&&(r=n.retryQueue,r!==null&&(n.retryQueue=null,mo(e,r))));break;case 19:ti(t,e),ii(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,mo(e,n)));break;case 30:break;case 21:break;default:ti(t,e),ii(e)}}function ii(e){var t=e.flags;if(t&2){try{for(var r,n=e.return;n!==null;){if(zd(n)){r=n;break}n=n.return}if(r==null)throw Error(o(160));switch(r.tag){case 27:var c=r.stateNode,d=$c(e);_o(e,d,c);break;case 5:var D=r.stateNode;r.flags&32&&(Cs(D,""),r.flags&=-33);var z=$c(e);_o(e,z,D);break;case 3:case 4:var Z=r.stateNode.containerInfo,ie=$c(e);Fc(e,ie,Z);break;default:throw Error(o(161))}}catch(le){Ge(e,e.return,le)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function qd(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;qd(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function _r(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Ud(e,t.alternate,t),t=t.sibling}function ds(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Mr(4,t,t.return),ds(t);break;case 1:Zi(t,t.return);var r=t.stateNode;typeof r.componentWillUnmount=="function"&&Nd(t,t.return,r),ds(t);break;case 27:ea(t.stateNode);case 26:case 5:Zi(t,t.return),ds(t);break;case 22:t.memoizedState===null&&ds(t);break;case 30:ds(t);break;default:ds(t)}e=e.sibling}}function mr(e,t,r){for(r=r&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,c=e,d=t,D=d.flags;switch(d.tag){case 0:case 11:case 15:mr(c,d,r),Zn(4,d);break;case 1:if(mr(c,d,r),n=d,c=n.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(ie){Ge(n,n.return,ie)}if(n=d,c=n.updateQueue,c!==null){var z=n.stateNode;try{var Z=c.shared.hiddenCallbacks;if(Z!==null)for(c.shared.hiddenCallbacks=null,c=0;c<Z.length;c++)Cf(Z[c],z)}catch(ie){Ge(n,n.return,ie)}}r&&D&64&&Ld(d),qn(d,d.return);break;case 27:jd(d);case 26:case 5:mr(c,d,r),r&&n===null&&D&4&&Bd(d),qn(d,d.return);break;case 12:mr(c,d,r);break;case 31:mr(c,d,r),r&&D&4&&$d(c,d);break;case 13:mr(c,d,r),r&&D&4&&Fd(c,d);break;case 22:d.memoizedState===null&&mr(c,d,r),qn(d,d.return);break;case 30:break;default:mr(c,d,r)}t=t.sibling}}function qc(e,t){var r=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==r&&(e!=null&&e.refCount++,r!=null&&On(r))}function Gc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&On(e))}function ji(e,t,r,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Gd(e,t,r,n),t=t.sibling}function Gd(e,t,r,n){var c=t.flags;switch(t.tag){case 0:case 11:case 15:ji(e,t,r,n),c&2048&&Zn(9,t);break;case 1:ji(e,t,r,n);break;case 3:ji(e,t,r,n),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&On(e)));break;case 12:if(c&2048){ji(e,t,r,n),e=t.stateNode;try{var d=t.memoizedProps,D=d.id,z=d.onPostCommit;typeof z=="function"&&z(D,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(Z){Ge(t,t.return,Z)}}else ji(e,t,r,n);break;case 31:ji(e,t,r,n);break;case 13:ji(e,t,r,n);break;case 23:break;case 22:d=t.stateNode,D=t.alternate,t.memoizedState!==null?d._visibility&2?ji(e,t,r,n):Gn(e,t):d._visibility&2?ji(e,t,r,n):(d._visibility|=2,$s(e,t,r,n,(t.subtreeFlags&10256)!==0||!1)),c&2048&&qc(D,t);break;case 24:ji(e,t,r,n),c&2048&&Gc(t.alternate,t);break;default:ji(e,t,r,n)}}function $s(e,t,r,n,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var d=e,D=t,z=r,Z=n,ie=D.flags;switch(D.tag){case 0:case 11:case 15:$s(d,D,z,Z,c),Zn(8,D);break;case 23:break;case 22:var le=D.stateNode;D.memoizedState!==null?le._visibility&2?$s(d,D,z,Z,c):Gn(d,D):(le._visibility|=2,$s(d,D,z,Z,c)),c&&ie&2048&&qc(D.alternate,D);break;case 24:$s(d,D,z,Z,c),c&&ie&2048&&Gc(D.alternate,D);break;default:$s(d,D,z,Z,c)}t=t.sibling}}function Gn(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var r=e,n=t,c=n.flags;switch(n.tag){case 22:Gn(r,n),c&2048&&qc(n.alternate,n);break;case 24:Gn(r,n),c&2048&&Gc(n.alternate,n);break;default:Gn(r,n)}t=t.sibling}}var Wn=8192;function Fs(e,t,r){if(e.subtreeFlags&Wn)for(e=e.child;e!==null;)Wd(e,t,r),e=e.sibling}function Wd(e,t,r){switch(e.tag){case 26:Fs(e,t,r),e.flags&Wn&&e.memoizedState!==null&&E0(r,zi,e.memoizedState,e.memoizedProps);break;case 5:Fs(e,t,r);break;case 3:case 4:var n=zi;zi=Do(e.stateNode.containerInfo),Fs(e,t,r),zi=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=Wn,Wn=16777216,Fs(e,t,r),Wn=n):Fs(e,t,r));break;default:Fs(e,t,r)}}function Yd(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 Yn(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var r=0;r<t.length;r++){var n=t[r];Mt=n,Vd(n,e)}Yd(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Kd(e),e=e.sibling}function Kd(e){switch(e.tag){case 0:case 11:case 15:Yn(e),e.flags&2048&&Mr(9,e,e.return);break;case 3:Yn(e);break;case 12:Yn(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,po(e)):Yn(e);break;default:Yn(e)}}function po(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var r=0;r<t.length;r++){var n=t[r];Mt=n,Vd(n,e)}Yd(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Mr(8,t,t.return),po(t);break;case 22:r=t.stateNode,r._visibility&2&&(r._visibility&=-3,po(t));break;default:po(t)}e=e.sibling}}function Vd(e,t){for(;Mt!==null;){var r=Mt;switch(r.tag){case 0:case 11:case 15:Mr(8,r,t);break;case 23:case 22:if(r.memoizedState!==null&&r.memoizedState.cachePool!==null){var n=r.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:On(r.memoizedState.cache)}if(n=r.child,n!==null)n.return=r,Mt=n;else e:for(r=e;Mt!==null;){n=Mt;var c=n.sibling,d=n.return;if(Id(n),n===r){Mt=null;break e}if(c!==null){c.return=d,Mt=c;break e}Mt=d}}}var Ig={getCacheForType:function(e){var t=Ht(bt),r=t.data.get(e);return r===void 0&&(r=e(),t.data.set(e,r)),r},cacheSignal:function(){return Ht(bt).controller.signal}},Pg=typeof WeakMap=="function"?WeakMap:Map,Fe=0,Je=null,Le=null,Be=0,qe=0,hi=null,Lr=!1,Zs=!1,Wc=!1,pr=0,ht=0,Nr=0,_s=0,Yc=0,fi=0,qs=0,Kn=null,ri=null,Kc=!1,vo=0,Xd=0,go=1/0,yo=null,Br=null,Rt=0,zr=null,Gs=null,vr=0,Vc=0,Xc=null,Jd=null,Vn=0,Jc=null;function di(){return(Fe&2)!==0&&Be!==0?Be&-Be:G.T!==null?su():pn()}function Qd(){if(fi===0)if((Be&536870912)===0||He){var e=Ji;Ji<<=1,(Ji&3932160)===0&&(Ji=262144),fi=e}else fi=536870912;return e=ci.current,e!==null&&(e.flags|=32),fi}function si(e,t,r){(e===Je&&(qe===2||qe===9)||e.cancelPendingCommit!==null)&&(Ws(e,0),jr(e,Be,fi,!1)),br(e,r),((Fe&2)===0||e!==Je)&&(e===Je&&((Fe&2)===0&&(_s|=r),ht===4&&jr(e,Be,fi,!1)),qi(e))}function e_(e,t,r){if((Fe&6)!==0)throw Error(o(327));var n=!r&&(t&127)===0&&(t&e.expiredLanes)===0||Jr(e,t),c=n?Zg(e,t):eu(e,t,!0),d=n;do{if(c===0){Zs&&!n&&jr(e,t,0,!1);break}else{if(r=e.current.alternate,d&&!$g(r)){c=eu(e,t,!1),d=!1;continue}if(c===2){if(d=t,e.errorRecoveryDisabledLanes&d)var D=0;else D=e.pendingLanes&-536870913,D=D!==0?D:D&536870912?536870912:0;if(D!==0){t=D;e:{var z=e;c=Kn;var Z=z.current.memoizedState.isDehydrated;if(Z&&(Ws(z,D).flags|=256),D=eu(z,D,!1),D!==2){if(Wc&&!Z){z.errorRecoveryDisabledLanes|=d,_s|=d,c=4;break e}d=ri,ri=c,d!==null&&(ri===null?ri=d:ri.push.apply(ri,d))}c=D}if(d=!1,c!==2)continue}}if(c===1){Ws(e,0),jr(e,t,0,!0);break}e:{switch(n=e,d=c,d){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:jr(n,t,fi,!Lr);break e;case 2:ri=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(c=vo+300-nt(),10<c)){if(jr(n,t,fi,!Lr),ys(n,0,!0)!==0)break e;vr=t,n.timeoutHandle=O_(t_.bind(null,n,r,ri,yo,Kc,t,fi,_s,qs,Lr,d,"Throttled",-0,0),c);break e}t_(n,r,ri,yo,Kc,t,fi,_s,qs,Lr,d,null,-0,0)}}break}while(!0);qi(e)}function t_(e,t,r,n,c,d,D,z,Z,ie,le,de,se,ae){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:ir},Wd(t,d,de);var ye=(d&62914560)===d?vo-nt():(d&4194048)===d?Xd-nt():0;if(ye=T0(de,ye),ye!==null){vr=d,e.cancelPendingCommit=ye(c_.bind(null,e,t,d,r,n,c,D,z,Z,le,de,null,se,ae)),jr(e,d,D,!ie);return}}c_(e,t,d,r,n,c,D,z,Z)}function $g(e){for(var t=e;;){var r=t.tag;if((r===0||r===11||r===15)&&t.flags&16384&&(r=t.updateQueue,r!==null&&(r=r.stores,r!==null)))for(var n=0;n<r.length;n++){var c=r[n],d=c.getSnapshot;c=c.value;try{if(!oi(d(),c))return!1}catch{return!1}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;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 jr(e,t,r,n){t&=~Yc,t&=~_s,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var c=t;0<c;){var d=31-yt(c),D=1<<d;n[d]=-1,c&=~D}r!==0&&_n(e,r,t)}function So(){return(Fe&6)===0?(Xn(0),!1):!0}function Qc(){if(Le!==null){if(qe===0)var e=Le.return;else e=Le,ar=ns=null,mc(e),js=null,Ln=0,e=Le;for(;e!==null;)Md(e.alternate,e),e=e.return;Le=null}}function Ws(e,t){var r=e.timeoutHandle;r!==-1&&(e.timeoutHandle=-1,l0(r)),r=e.cancelPendingCommit,r!==null&&(e.cancelPendingCommit=null,r()),vr=0,Qc(),Je=e,Le=r=sr(e.current,null),Be=t,qe=0,hi=null,Lr=!1,Zs=Jr(e,t),Wc=!1,qs=fi=Yc=_s=Nr=ht=0,ri=Kn=null,Kc=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var c=31-yt(n),d=1<<c;t|=e[c],n&=~d}return pr=t,Ia(),r}function i_(e,t){Re=null,G.H=Pn,t===zs||t===Ya?(t=gf(),qe=3):t===rc?(t=gf(),qe=4):qe=t===Oc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,hi=t,Le===null&&(ht=1,lo(e,xi(t,e.current)))}function r_(){var e=ci.current;return e===null?!0:(Be&4194048)===Be?Ai===null:(Be&62914560)===Be||(Be&536870912)!==0?e===Ai:!1}function s_(){var e=G.H;return G.H=Pn,e===null?Pn:e}function n_(){var e=G.A;return G.A=Ig,e}function bo(){ht=4,Lr||(Be&4194048)!==Be&&ci.current!==null||(Zs=!0),(Nr&134217727)===0&&(_s&134217727)===0||Je===null||jr(Je,Be,fi,!1)}function eu(e,t,r){var n=Fe;Fe|=2;var c=s_(),d=n_();(Je!==e||Be!==t)&&(yo=null,Ws(e,t)),t=!1;var D=ht;e:do try{if(qe!==0&&Le!==null){var z=Le,Z=hi;switch(qe){case 8:Qc(),D=6;break e;case 3:case 2:case 9:case 6:ci.current===null&&(t=!0);var ie=qe;if(qe=0,hi=null,Ys(e,z,Z,ie),r&&Zs){D=0;break e}break;default:ie=qe,qe=0,hi=null,Ys(e,z,Z,ie)}}Fg(),D=ht;break}catch(le){i_(e,le)}while(!0);return t&&e.shellSuspendCounter++,ar=ns=null,Fe=n,G.H=c,G.A=d,Le===null&&(Je=null,Be=0,Ia()),D}function Fg(){for(;Le!==null;)a_(Le)}function Zg(e,t){var r=Fe;Fe|=2;var n=s_(),c=n_();Je!==e||Be!==t?(yo=null,go=nt()+500,Ws(e,t)):Zs=Jr(e,t);e:do try{if(qe!==0&&Le!==null){t=Le;var d=hi;t:switch(qe){case 1:qe=0,hi=null,Ys(e,t,d,1);break;case 2:case 9:if(pf(d)){qe=0,hi=null,o_(t);break}t=function(){qe!==2&&qe!==9||Je!==e||(qe=7),qi(e)},d.then(t,t);break e;case 3:qe=7;break e;case 4:qe=5;break e;case 7:pf(d)?(qe=0,hi=null,o_(t)):(qe=0,hi=null,Ys(e,t,d,7));break;case 5:var D=null;switch(Le.tag){case 26:D=Le.memoizedState;case 5:case 27:var z=Le;if(D?G_(D):z.stateNode.complete){qe=0,hi=null;var Z=z.sibling;if(Z!==null)Le=Z;else{var ie=z.return;ie!==null?(Le=ie,Co(ie)):Le=null}break t}}qe=0,hi=null,Ys(e,t,d,5);break;case 6:qe=0,hi=null,Ys(e,t,d,6);break;case 8:Qc(),ht=6;break e;default:throw Error(o(462))}}qg();break}catch(le){i_(e,le)}while(!0);return ar=ns=null,G.H=n,G.A=c,Fe=r,Le!==null?0:(Je=null,Be=0,Ia(),ht)}function qg(){for(;Le!==null&&!Ki();)a_(Le)}function a_(e){var t=kd(e.alternate,e,pr);e.memoizedProps=e.pendingProps,t===null?Co(e):Le=t}function o_(e){var t=e,r=t.alternate;switch(t.tag){case 15:case 0:t=wd(r,t,t.pendingProps,t.type,void 0,Be);break;case 11:t=wd(r,t,t.pendingProps,t.type.render,t.ref,Be);break;case 5:mc(t);default:Md(r,t),t=Le=nf(t,pr),t=kd(r,t,pr)}e.memoizedProps=e.pendingProps,t===null?Co(e):Le=t}function Ys(e,t,r,n){ar=ns=null,mc(t),js=null,Ln=0;var c=t.return;try{if(Lg(e,c,t,r,Be)){ht=1,lo(e,xi(r,e.current)),Le=null;return}}catch(d){if(c!==null)throw Le=c,d;ht=1,lo(e,xi(r,e.current)),Le=null;return}t.flags&32768?(He||n===1?e=!0:Zs||(Be&536870912)!==0?e=!1:(Lr=e=!0,(n===2||n===9||n===3||n===6)&&(n=ci.current,n!==null&&n.tag===13&&(n.flags|=16384))),l_(t,e)):Co(t)}function Co(e){var t=e;do{if((t.flags&32768)!==0){l_(t,Lr);return}e=t.return;var r=zg(t.alternate,t,pr);if(r!==null){Le=r;return}if(t=t.sibling,t!==null){Le=t;return}Le=t=e}while(t!==null);ht===0&&(ht=5)}function l_(e,t){do{var r=jg(e.alternate,e);if(r!==null){r.flags&=32767,Le=r;return}if(r=e.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!t&&(e=e.sibling,e!==null)){Le=e;return}Le=e=r}while(e!==null);ht=6,Le=null}function c_(e,t,r,n,c,d,D,z,Z){e.cancelPendingCommit=null;do xo();while(Rt!==0);if((Fe&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(d=t.lanes|t.childLanes,d|=$l,dn(e,r,d,D,z,Z),e===Je&&(Le=Je=null,Be=0),Gs=t,zr=e,vr=r,Vc=d,Xc=c,Jd=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Kg(Bt,function(){return __(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=G.T,G.T=null,c=V.p,V.p=2,D=Fe,Fe|=4;try{Hg(e,t,r)}finally{Fe=D,V.p=c,G.T=n}}Rt=1,u_(),h_(),f_()}}function u_(){if(Rt===1){Rt=0;var e=zr,t=Gs,r=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||r){r=G.T,G.T=null;var n=V.p;V.p=2;var c=Fe;Fe|=4;try{Zd(t,e);var d=fu,D=Kh(e.containerInfo),z=d.focusedElem,Z=d.selectionRange;if(D!==z&&z&&z.ownerDocument&&Yh(z.ownerDocument.documentElement,z)){if(Z!==null&&jl(z)){var ie=Z.start,le=Z.end;if(le===void 0&&(le=ie),"selectionStart"in z)z.selectionStart=ie,z.selectionEnd=Math.min(le,z.value.length);else{var de=z.ownerDocument||document,se=de&&de.defaultView||window;if(se.getSelection){var ae=se.getSelection(),ye=z.textContent.length,we=Math.min(Z.start,ye),Xe=Z.end===void 0?we:Math.min(Z.end,ye);!ae.extend&&we>Xe&&(D=Xe,Xe=we,we=D);var J=Wh(z,we),K=Wh(z,Xe);if(J&&K&&(ae.rangeCount!==1||ae.anchorNode!==J.node||ae.anchorOffset!==J.offset||ae.focusNode!==K.node||ae.focusOffset!==K.offset)){var te=de.createRange();te.setStart(J.node,J.offset),ae.removeAllRanges(),we>Xe?(ae.addRange(te),ae.extend(K.node,K.offset)):(te.setEnd(K.node,K.offset),ae.addRange(te))}}}}for(de=[],ae=z;ae=ae.parentNode;)ae.nodeType===1&&de.push({element:ae,left:ae.scrollLeft,top:ae.scrollTop});for(typeof z.focus=="function"&&z.focus(),z=0;z<de.length;z++){var ue=de[z];ue.element.scrollLeft=ue.left,ue.element.scrollTop=ue.top}}Bo=!!hu,fu=hu=null}finally{Fe=c,V.p=n,G.T=r}}e.current=t,Rt=2}}function h_(){if(Rt===2){Rt=0;var e=zr,t=Gs,r=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||r){r=G.T,G.T=null;var n=V.p;V.p=2;var c=Fe;Fe|=4;try{Ud(e,t.alternate,t)}finally{Fe=c,V.p=n,G.T=r}}Rt=3}}function f_(){if(Rt===4||Rt===3){Rt=0,Pt();var e=zr,t=Gs,r=vr,n=Jd;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Rt=5:(Rt=0,Gs=zr=null,d_(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(Br=null),Ni(r),t=t.stateNode,kt&&typeof kt.onCommitFiberRoot=="function")try{kt.onCommitFiberRoot(vi,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=G.T,c=V.p,V.p=2,G.T=null;try{for(var d=e.onRecoverableError,D=0;D<n.length;D++){var z=n[D];d(z.value,{componentStack:z.stack})}}finally{G.T=t,V.p=c}}(vr&3)!==0&&xo(),qi(e),c=e.pendingLanes,(r&261930)!==0&&(c&42)!==0?e===Jc?Vn++:(Vn=0,Jc=e):Vn=0,Xn(0)}}function d_(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,On(t)))}function xo(){return u_(),h_(),f_(),__()}function __(){if(Rt!==5)return!1;var e=zr,t=Vc;Vc=0;var r=Ni(vr),n=G.T,c=V.p;try{V.p=32>r?32:r,G.T=null,r=Xc,Xc=null;var d=zr,D=vr;if(Rt=0,Gs=zr=null,vr=0,(Fe&6)!==0)throw Error(o(331));var z=Fe;if(Fe|=4,Kd(d.current),Gd(d,d.current,D,r),Fe=z,Xn(0,!1),kt&&typeof kt.onPostCommitFiberRoot=="function")try{kt.onPostCommitFiberRoot(vi,d)}catch{}return!0}finally{V.p=c,G.T=n,d_(e,t)}}function m_(e,t,r){t=xi(r,t),t=kc(e.stateNode,t,2),e=Dr(e,t,2),e!==null&&(br(e,2),qi(e))}function Ge(e,t,r){if(e.tag===3)m_(e,e,r);else for(;t!==null;){if(t.tag===3){m_(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Br===null||!Br.has(n))){e=xi(r,e),r=pd(2),n=Dr(t,r,2),n!==null&&(vd(r,n,t,e),br(n,2),qi(n));break}}t=t.return}}function tu(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new Pg;var c=new Set;n.set(t,c)}else c=n.get(t),c===void 0&&(c=new Set,n.set(t,c));c.has(r)||(Wc=!0,c.add(r),e=Gg.bind(null,e,t,r),t.then(e,e))}function Gg(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,Je===e&&(Be&r)===r&&(ht===4||ht===3&&(Be&62914560)===Be&&300>nt()-vo?(Fe&2)===0&&Ws(e,0):Yc|=r,qs===Be&&(qs=0)),qi(e)}function p_(e,t){t===0&&(t=Qi()),e=is(e,t),e!==null&&(br(e,t),qi(e))}function Wg(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),p_(e,r)}function Yg(e,t){var r=0;switch(e.tag){case 31:case 13:var n=e.stateNode,c=e.memoizedState;c!==null&&(r=c.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(o(314))}n!==null&&n.delete(t),p_(e,r)}function Kg(e,t){return pi(e,t)}var wo=null,Ks=null,iu=!1,Eo=!1,ru=!1,Hr=0;function qi(e){e!==Ks&&e.next===null&&(Ks===null?wo=Ks=e:Ks=Ks.next=e),Eo=!0,iu||(iu=!0,Xg())}function Xn(e,t){if(!ru&&Eo){ru=!0;do for(var r=!1,n=wo;n!==null;){if(e!==0){var c=n.pendingLanes;if(c===0)var d=0;else{var D=n.suspendedLanes,z=n.pingedLanes;d=(1<<31-yt(42|e)+1)-1,d&=c&~(D&~z),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(r=!0,S_(n,d))}else d=Be,d=ys(n,n===Je?d:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(d&3)===0||Jr(n,d)||(r=!0,S_(n,d));n=n.next}while(r);ru=!1}}function Vg(){v_()}function v_(){Eo=iu=!1;var e=0;Hr!==0&&o0()&&(e=Hr);for(var t=nt(),r=null,n=wo;n!==null;){var c=n.next,d=g_(n,t);d===0?(n.next=null,r===null?wo=c:r.next=c,c===null&&(Ks=r)):(r=n,(e!==0||(d&3)!==0)&&(Eo=!0)),n=c}Rt!==0&&Rt!==5||Xn(e),Hr!==0&&(Hr=0)}function g_(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,c=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var D=31-yt(d),z=1<<D,Z=c[D];Z===-1?((z&r)===0||(z&n)!==0)&&(c[D]=mt(z,t)):Z<=t&&(e.expiredLanes|=z),d&=~z}if(t=Je,r=Be,r=ys(e,e===t?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,r===0||e===t&&(qe===2||qe===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&Ii(n),e.callbackNode=null,e.callbackPriority=0;if((r&3)===0||Jr(e,r)){if(t=r&-r,t===e.callbackPriority)return t;switch(n!==null&&Ii(n),Ni(r)){case 2:case 8:r=Nt;break;case 32:r=Bt;break;case 268435456:r=Vt;break;default:r=Bt}return n=y_.bind(null,e),r=pi(r,n),e.callbackPriority=t,e.callbackNode=r,t}return n!==null&&n!==null&&Ii(n),e.callbackPriority=2,e.callbackNode=null,2}function y_(e,t){if(Rt!==0&&Rt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var r=e.callbackNode;if(xo()&&e.callbackNode!==r)return null;var n=Be;return n=ys(e,e===Je?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(e_(e,n,t),g_(e,nt()),e.callbackNode!=null&&e.callbackNode===r?y_.bind(null,e):null)}function S_(e,t){if(xo())return null;e_(e,t,!0)}function Xg(){c0(function(){(Fe&6)!==0?pi(Zt,Vg):v_()})}function su(){if(Hr===0){var e=Ns;e===0&&(e=Xi,Xi<<=1,(Xi&261888)===0&&(Xi=256)),Hr=e}return Hr}function b_(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ma(""+e)}function C_(e,t){var r=t.ownerDocument.createElement("input");return r.name=t.name,r.value=t.value,e.id&&r.setAttribute("form",e.id),t.parentNode.insertBefore(r,t),e=new FormData(e),r.parentNode.removeChild(r),e}function Jg(e,t,r,n,c){if(t==="submit"&&r&&r.stateNode===c){var d=b_((c[it]||null).action),D=n.submitter;D&&(t=(t=D[it]||null)?b_(t.formAction):D.getAttribute("formAction"),t!==null&&(d=t,D=null));var z=new za("action","action",null,n,c);e.push({event:z,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(Hr!==0){var Z=D?C_(c,D):new FormData(c);wc(r,{pending:!0,data:Z,method:c.method,action:d},null,Z)}}else typeof d=="function"&&(z.preventDefault(),Z=D?C_(c,D):new FormData(c),wc(r,{pending:!0,data:Z,method:c.method,action:d},d,Z))},currentTarget:c}]})}}for(var nu=0;nu<Pl.length;nu++){var au=Pl[nu],Qg=au.toLowerCase(),e0=au[0].toUpperCase()+au.slice(1);Bi(Qg,"on"+e0)}Bi(Jh,"onAnimationEnd"),Bi(Qh,"onAnimationIteration"),Bi(ef,"onAnimationStart"),Bi("dblclick","onDoubleClick"),Bi("focusin","onFocus"),Bi("focusout","onBlur"),Bi(pg,"onTransitionRun"),Bi(vg,"onTransitionStart"),Bi(gg,"onTransitionCancel"),Bi(tf,"onTransitionEnd"),Pi("onMouseEnter",["mouseout","mouseover"]),Pi("onMouseLeave",["mouseout","mouseover"]),Pi("onPointerEnter",["pointerout","pointerover"]),Pi("onPointerLeave",["pointerout","pointerover"]),Jt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Jt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Jt("onBeforeInput",["compositionend","keypress","textInput","paste"]),Jt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Jt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Jt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Jn="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(" "),t0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Jn));function x_(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],c=n.event;n=n.listeners;e:{var d=void 0;if(t)for(var D=n.length-1;0<=D;D--){var z=n[D],Z=z.instance,ie=z.currentTarget;if(z=z.listener,Z!==d&&c.isPropagationStopped())break e;d=z,c.currentTarget=ie;try{d(c)}catch(le){Ua(le)}c.currentTarget=null,d=Z}else for(D=0;D<n.length;D++){if(z=n[D],Z=z.instance,ie=z.currentTarget,z=z.listener,Z!==d&&c.isPropagationStopped())break e;d=z,c.currentTarget=ie;try{d(c)}catch(le){Ua(le)}c.currentTarget=null,d=Z}}}}function Ne(e,t){var r=t[Ss];r===void 0&&(r=t[Ss]=new Set);var n=e+"__bubble";r.has(n)||(w_(t,e,2,!1),r.add(n))}function ou(e,t,r){var n=0;t&&(n|=4),w_(r,e,n,t)}var To="_reactListening"+Math.random().toString(36).slice(2);function lu(e){if(!e[To]){e[To]=!0,zt.forEach(function(r){r!=="selectionchange"&&(t0.has(r)||ou(r,!1,e),ou(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[To]||(t[To]=!0,ou("selectionchange",!1,t))}}function w_(e,t,r,n){switch(Q_(t)){case 2:var c=D0;break;case 8:c=k0;break;default:c=xu}r=c.bind(null,t,r,e),c=void 0,!Rl||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),n?c!==void 0?e.addEventListener(t,r,{capture:!0,passive:c}):e.addEventListener(t,r,!0):c!==void 0?e.addEventListener(t,r,{passive:c}):e.addEventListener(t,r,!1)}function cu(e,t,r,n,c){var d=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var D=n.tag;if(D===3||D===4){var z=n.stateNode.containerInfo;if(z===c)break;if(D===4)for(D=n.return;D!==null;){var Z=D.tag;if((Z===3||Z===4)&&D.stateNode.containerInfo===c)return;D=D.return}for(;z!==null;){if(D=_e(z),D===null)return;if(Z=D.tag,Z===5||Z===6||Z===26||Z===27){n=d=D;continue e}z=z.parentNode}}n=n.return}Rh(function(){var ie=d,le=Tl(r),de=[];e:{var se=rf.get(e);if(se!==void 0){var ae=za,ye=e;switch(e){case"keypress":if(Na(r)===0)break e;case"keydown":case"keyup":ae=Yv;break;case"focusin":ye="focus",ae=Ml;break;case"focusout":ye="blur",ae=Ml;break;case"beforeblur":case"afterblur":ae=Ml;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ae=Oh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ae=zv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ae=Xv;break;case Jh:case Qh:case ef:ae=Uv;break;case tf:ae=Qv;break;case"scroll":case"scrollend":ae=Nv;break;case"wheel":ae=tg;break;case"copy":case"cut":case"paste":ae=Pv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ae=Lh;break;case"toggle":case"beforetoggle":ae=rg}var we=(t&4)!==0,Xe=!we&&(e==="scroll"||e==="scrollend"),J=we?se!==null?se+"Capture":null:se;we=[];for(var K=ie,te;K!==null;){var ue=K;if(te=ue.stateNode,ue=ue.tag,ue!==5&&ue!==26&&ue!==27||te===null||J===null||(ue=Sn(K,J),ue!=null&&we.push(Qn(K,ue,te))),Xe)break;K=K.return}0<we.length&&(se=new ae(se,ye,null,r,le),de.push({event:se,listeners:we}))}}if((t&7)===0){e:{if(se=e==="mouseover"||e==="pointerover",ae=e==="mouseout"||e==="pointerout",se&&r!==El&&(ye=r.relatedTarget||r.fromElement)&&(_e(ye)||ye[er]))break e;if((ae||se)&&(se=le.window===le?le:(se=le.ownerDocument)?se.defaultView||se.parentWindow:window,ae?(ye=r.relatedTarget||r.toElement,ae=ie,ye=ye?_e(ye):null,ye!==null&&(Xe=w(ye),we=ye.tag,ye!==Xe||we!==5&&we!==27&&we!==6)&&(ye=null)):(ae=null,ye=ie),ae!==ye)){if(we=Oh,ue="onMouseLeave",J="onMouseEnter",K="mouse",(e==="pointerout"||e==="pointerover")&&(we=Lh,ue="onPointerLeave",J="onPointerEnter",K="pointer"),Xe=ae==null?se:Ze(ae),te=ye==null?se:Ze(ye),se=new we(ue,K+"leave",ae,r,le),se.target=Xe,se.relatedTarget=te,ue=null,_e(le)===ie&&(we=new we(J,K+"enter",ye,r,le),we.target=te,we.relatedTarget=Xe,ue=we),Xe=ue,ae&&ye)t:{for(we=i0,J=ae,K=ye,te=0,ue=J;ue;ue=we(ue))te++;ue=0;for(var Ce=K;Ce;Ce=we(Ce))ue++;for(;0<te-ue;)J=we(J),te--;for(;0<ue-te;)K=we(K),ue--;for(;te--;){if(J===K||K!==null&&J===K.alternate){we=J;break t}J=we(J),K=we(K)}we=null}else we=null;ae!==null&&E_(de,se,ae,we,!1),ye!==null&&Xe!==null&&E_(de,Xe,ye,we,!0)}}e:{if(se=ie?Ze(ie):window,ae=se.nodeName&&se.nodeName.toLowerCase(),ae==="select"||ae==="input"&&se.type==="file")var Pe=Ph;else if(Uh(se))if($h)Pe=dg;else{Pe=hg;var be=ug}else ae=se.nodeName,!ae||ae.toLowerCase()!=="input"||se.type!=="checkbox"&&se.type!=="radio"?ie&&wl(ie.elementType)&&(Pe=Ph):Pe=fg;if(Pe&&(Pe=Pe(e,ie))){Ih(de,Pe,r,le);break e}be&&be(e,se,ie),e==="focusout"&&ie&&se.type==="number"&&ie.memoizedProps.value!=null&&xl(se,"number",se.value)}switch(be=ie?Ze(ie):window,e){case"focusin":(Uh(be)||be.contentEditable==="true")&&(Ts=be,Hl=ie,Rn=null);break;case"focusout":Rn=Hl=Ts=null;break;case"mousedown":Ul=!0;break;case"contextmenu":case"mouseup":case"dragend":Ul=!1,Vh(de,r,le);break;case"selectionchange":if(mg)break;case"keydown":case"keyup":Vh(de,r,le)}var De;if(Nl)e:{switch(e){case"compositionstart":var ze="onCompositionStart";break e;case"compositionend":ze="onCompositionEnd";break e;case"compositionupdate":ze="onCompositionUpdate";break e}ze=void 0}else Es?jh(e,r)&&(ze="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(ze="onCompositionStart");ze&&(Nh&&r.locale!=="ko"&&(Es||ze!=="onCompositionStart"?ze==="onCompositionEnd"&&Es&&(De=Dh()):(Cr=le,Dl="value"in Cr?Cr.value:Cr.textContent,Es=!0)),be=Ao(ie,ze),0<be.length&&(ze=new Mh(ze,e,null,r,le),de.push({event:ze,listeners:be}),De?ze.data=De:(De=Hh(r),De!==null&&(ze.data=De)))),(De=ng?ag(e,r):og(e,r))&&(ze=Ao(ie,"onBeforeInput"),0<ze.length&&(be=new Mh("onBeforeInput","beforeinput",null,r,le),de.push({event:be,listeners:ze}),be.data=De)),Jg(de,e,ie,r,le)}x_(de,t)})}function Qn(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Ao(e,t){for(var r=t+"Capture",n=[];e!==null;){var c=e,d=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||d===null||(c=Sn(e,r),c!=null&&n.unshift(Qn(e,c,d)),c=Sn(e,t),c!=null&&n.push(Qn(e,c,d))),e.tag===3)return n;e=e.return}return[]}function i0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function E_(e,t,r,n,c){for(var d=t._reactName,D=[];r!==null&&r!==n;){var z=r,Z=z.alternate,ie=z.stateNode;if(z=z.tag,Z!==null&&Z===n)break;z!==5&&z!==26&&z!==27||ie===null||(Z=ie,c?(ie=Sn(r,d),ie!=null&&D.unshift(Qn(r,ie,Z))):c||(ie=Sn(r,d),ie!=null&&D.push(Qn(r,ie,Z)))),r=r.return}D.length!==0&&e.push({event:t,listeners:D})}var r0=/\r\n?/g,s0=/\u0000|\uFFFD/g;function T_(e){return(typeof e=="string"?e:""+e).replace(r0,`
49
+ `).replace(s0,"")}function A_(e,t){return t=T_(t),T_(e)===t}function Ve(e,t,r,n,c,d){switch(r){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||Cs(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&Cs(e,""+n);break;case"className":ka(e,"class",n);break;case"tabIndex":ka(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":ka(e,r,n);break;case"style":Th(e,n,d);break;case"data":if(t!=="object"){ka(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||r!=="href")){e.removeAttribute(r);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(r);break}n=Ma(""+n),e.setAttribute(r,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(r,"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 d=="function"&&(r==="formAction"?(t!=="input"&&Ve(e,t,"name",c.name,c,null),Ve(e,t,"formEncType",c.formEncType,c,null),Ve(e,t,"formMethod",c.formMethod,c,null),Ve(e,t,"formTarget",c.formTarget,c,null)):(Ve(e,t,"encType",c.encType,c,null),Ve(e,t,"method",c.method,c,null),Ve(e,t,"target",c.target,c,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(r);break}n=Ma(""+n),e.setAttribute(r,n);break;case"onClick":n!=null&&(e.onclick=ir);break;case"onScroll":n!=null&&Ne("scroll",e);break;case"onScrollEnd":n!=null&&Ne("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(o(61));if(r=n.__html,r!=null){if(c.children!=null)throw Error(o(60));e.innerHTML=r}}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}r=Ma(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);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(r,""+n):e.removeAttribute(r);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(r,""):e.removeAttribute(r);break;case"capture":case"download":n===!0?e.setAttribute(r,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(r,n):e.removeAttribute(r);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(r,n):e.removeAttribute(r);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(r):e.setAttribute(r,n);break;case"popover":Ne("beforetoggle",e),Ne("toggle",e),Da(e,"popover",n);break;case"xlinkActuate":tr(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":tr(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":tr(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":tr(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":tr(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":tr(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":tr(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":tr(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":tr(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":Da(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(r=Mv.get(r)||r,Da(e,r,n))}}function uu(e,t,r,n,c,d){switch(r){case"style":Th(e,n,d);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(o(61));if(r=n.__html,r!=null){if(c.children!=null)throw Error(o(60));e.innerHTML=r}}break;case"children":typeof n=="string"?Cs(e,n):(typeof n=="number"||typeof n=="bigint")&&Cs(e,""+n);break;case"onScroll":n!=null&&Ne("scroll",e);break;case"onScrollEnd":n!=null&&Ne("scrollend",e);break;case"onClick":n!=null&&(e.onclick=ir);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!yi.hasOwnProperty(r))e:{if(r[0]==="o"&&r[1]==="n"&&(c=r.endsWith("Capture"),t=r.slice(2,c?r.length-7:void 0),d=e[it]||null,d=d!=null?d[r]:null,typeof d=="function"&&e.removeEventListener(t,d,c),typeof n=="function")){typeof d!="function"&&d!==null&&(r in e?e[r]=null:e.hasAttribute(r)&&e.removeAttribute(r)),e.addEventListener(t,n,c);break e}r in e?e[r]=n:n===!0?e.setAttribute(r,""):Da(e,r,n)}}}function It(e,t,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ne("error",e),Ne("load",e);var n=!1,c=!1,d;for(d in r)if(r.hasOwnProperty(d)){var D=r[d];if(D!=null)switch(d){case"src":n=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ve(e,t,d,D,r,null)}}c&&Ve(e,t,"srcSet",r.srcSet,r,null),n&&Ve(e,t,"src",r.src,r,null);return;case"input":Ne("invalid",e);var z=d=D=c=null,Z=null,ie=null;for(n in r)if(r.hasOwnProperty(n)){var le=r[n];if(le!=null)switch(n){case"name":c=le;break;case"type":D=le;break;case"checked":Z=le;break;case"defaultChecked":ie=le;break;case"value":d=le;break;case"defaultValue":z=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(o(137,t));break;default:Ve(e,t,n,le,r,null)}}Ch(e,d,z,Z,ie,D,c,!1);return;case"select":Ne("invalid",e),n=D=d=null;for(c in r)if(r.hasOwnProperty(c)&&(z=r[c],z!=null))switch(c){case"value":d=z;break;case"defaultValue":D=z;break;case"multiple":n=z;default:Ve(e,t,c,z,r,null)}t=d,r=D,e.multiple=!!n,t!=null?bs(e,!!n,t,!1):r!=null&&bs(e,!!n,r,!0);return;case"textarea":Ne("invalid",e),d=c=n=null;for(D in r)if(r.hasOwnProperty(D)&&(z=r[D],z!=null))switch(D){case"value":n=z;break;case"defaultValue":c=z;break;case"children":d=z;break;case"dangerouslySetInnerHTML":if(z!=null)throw Error(o(91));break;default:Ve(e,t,D,z,r,null)}wh(e,n,c,d);return;case"option":for(Z in r)if(r.hasOwnProperty(Z)&&(n=r[Z],n!=null))switch(Z){case"selected":e.selected=n&&typeof n!="function"&&typeof n!="symbol";break;default:Ve(e,t,Z,n,r,null)}return;case"dialog":Ne("beforetoggle",e),Ne("toggle",e),Ne("cancel",e),Ne("close",e);break;case"iframe":case"object":Ne("load",e);break;case"video":case"audio":for(n=0;n<Jn.length;n++)Ne(Jn[n],e);break;case"image":Ne("error",e),Ne("load",e);break;case"details":Ne("toggle",e);break;case"embed":case"source":case"link":Ne("error",e),Ne("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(ie in r)if(r.hasOwnProperty(ie)&&(n=r[ie],n!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ve(e,t,ie,n,r,null)}return;default:if(wl(t)){for(le in r)r.hasOwnProperty(le)&&(n=r[le],n!==void 0&&uu(e,t,le,n,r,void 0));return}}for(z in r)r.hasOwnProperty(z)&&(n=r[z],n!=null&&Ve(e,t,z,n,r,null))}function n0(e,t,r,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,d=null,D=null,z=null,Z=null,ie=null,le=null;for(ae in r){var de=r[ae];if(r.hasOwnProperty(ae)&&de!=null)switch(ae){case"checked":break;case"value":break;case"defaultValue":Z=de;default:n.hasOwnProperty(ae)||Ve(e,t,ae,null,n,de)}}for(var se in n){var ae=n[se];if(de=r[se],n.hasOwnProperty(se)&&(ae!=null||de!=null))switch(se){case"type":d=ae;break;case"name":c=ae;break;case"checked":ie=ae;break;case"defaultChecked":le=ae;break;case"value":D=ae;break;case"defaultValue":z=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(o(137,t));break;default:ae!==de&&Ve(e,t,se,ae,n,de)}}Cl(e,D,z,Z,ie,le,d,c);return;case"select":ae=D=z=se=null;for(d in r)if(Z=r[d],r.hasOwnProperty(d)&&Z!=null)switch(d){case"value":break;case"multiple":ae=Z;default:n.hasOwnProperty(d)||Ve(e,t,d,null,n,Z)}for(c in n)if(d=n[c],Z=r[c],n.hasOwnProperty(c)&&(d!=null||Z!=null))switch(c){case"value":se=d;break;case"defaultValue":z=d;break;case"multiple":D=d;default:d!==Z&&Ve(e,t,c,d,n,Z)}t=z,r=D,n=ae,se!=null?bs(e,!!r,se,!1):!!n!=!!r&&(t!=null?bs(e,!!r,t,!0):bs(e,!!r,r?[]:"",!1));return;case"textarea":ae=se=null;for(z in r)if(c=r[z],r.hasOwnProperty(z)&&c!=null&&!n.hasOwnProperty(z))switch(z){case"value":break;case"children":break;default:Ve(e,t,z,null,n,c)}for(D in n)if(c=n[D],d=r[D],n.hasOwnProperty(D)&&(c!=null||d!=null))switch(D){case"value":se=c;break;case"defaultValue":ae=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(o(91));break;default:c!==d&&Ve(e,t,D,c,n,d)}xh(e,se,ae);return;case"option":for(var ye in r)if(se=r[ye],r.hasOwnProperty(ye)&&se!=null&&!n.hasOwnProperty(ye))switch(ye){case"selected":e.selected=!1;break;default:Ve(e,t,ye,null,n,se)}for(Z in n)if(se=n[Z],ae=r[Z],n.hasOwnProperty(Z)&&se!==ae&&(se!=null||ae!=null))switch(Z){case"selected":e.selected=se&&typeof se!="function"&&typeof se!="symbol";break;default:Ve(e,t,Z,se,n,ae)}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 we in r)se=r[we],r.hasOwnProperty(we)&&se!=null&&!n.hasOwnProperty(we)&&Ve(e,t,we,null,n,se);for(ie in n)if(se=n[ie],ae=r[ie],n.hasOwnProperty(ie)&&se!==ae&&(se!=null||ae!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(o(137,t));break;default:Ve(e,t,ie,se,n,ae)}return;default:if(wl(t)){for(var Xe in r)se=r[Xe],r.hasOwnProperty(Xe)&&se!==void 0&&!n.hasOwnProperty(Xe)&&uu(e,t,Xe,void 0,n,se);for(le in n)se=n[le],ae=r[le],!n.hasOwnProperty(le)||se===ae||se===void 0&&ae===void 0||uu(e,t,le,se,n,ae);return}}for(var J in r)se=r[J],r.hasOwnProperty(J)&&se!=null&&!n.hasOwnProperty(J)&&Ve(e,t,J,null,n,se);for(de in n)se=n[de],ae=r[de],!n.hasOwnProperty(de)||se===ae||se==null&&ae==null||Ve(e,t,de,se,n,ae)}function R_(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function a0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,r=performance.getEntriesByType("resource"),n=0;n<r.length;n++){var c=r[n],d=c.transferSize,D=c.initiatorType,z=c.duration;if(d&&z&&R_(D)){for(D=0,z=c.responseEnd,n+=1;n<r.length;n++){var Z=r[n],ie=Z.startTime;if(ie>z)break;var le=Z.transferSize,de=Z.initiatorType;le&&R_(de)&&(Z=Z.responseEnd,D+=le*(Z<z?1:(z-ie)/(Z-ie)))}if(--n,t+=8*(d+D)/(c.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 hu=null,fu=null;function Ro(e){return e.nodeType===9?e:e.ownerDocument}function D_(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 k_(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 du(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 _u=null;function o0(){var e=window.event;return e&&e.type==="popstate"?e===_u?!1:(_u=e,!0):(_u=null,!1)}var O_=typeof setTimeout=="function"?setTimeout:void 0,l0=typeof clearTimeout=="function"?clearTimeout:void 0,M_=typeof Promise=="function"?Promise:void 0,c0=typeof queueMicrotask=="function"?queueMicrotask:typeof M_<"u"?function(e){return M_.resolve(null).then(e).catch(u0)}:O_;function u0(e){setTimeout(function(){throw e})}function Ur(e){return e==="head"}function L_(e,t){var r=t,n=0;do{var c=r.nextSibling;if(e.removeChild(r),c&&c.nodeType===8)if(r=c.data,r==="/$"||r==="/&"){if(n===0){e.removeChild(c),Qs(t);return}n--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")n++;else if(r==="html")ea(e.ownerDocument.documentElement);else if(r==="head"){r=e.ownerDocument.head,ea(r);for(var d=r.firstChild;d;){var D=d.nextSibling,z=d.nodeName;d[Se]||z==="SCRIPT"||z==="STYLE"||z==="LINK"&&d.rel.toLowerCase()==="stylesheet"||r.removeChild(d),d=D}}else r==="body"&&ea(e.ownerDocument.body);r=c}while(r);Qs(t)}function N_(e,t){var r=e;e=0;do{var n=r.nextSibling;if(r.nodeType===1?t?(r._stashedDisplay=r.style.display,r.style.display="none"):(r.style.display=r._stashedDisplay||"",r.getAttribute("style")===""&&r.removeAttribute("style")):r.nodeType===3&&(t?(r._stashedText=r.nodeValue,r.nodeValue=""):r.nodeValue=r._stashedText||""),n&&n.nodeType===8)if(r=n.data,r==="/$"){if(e===0)break;e--}else r!=="$"&&r!=="$?"&&r!=="$~"&&r!=="$!"||e++;r=n}while(r)}function mu(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var r=t;switch(t=t.nextSibling,r.nodeName){case"HTML":case"HEAD":case"BODY":mu(r),W(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}e.removeChild(r)}}function h0(e,t,r,n){for(;e.nodeType===1;){var c=r;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[Se])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(d=e.getAttribute("rel"),d==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(d!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var d=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=Ri(e.nextSibling),e===null)break}return null}function f0(e,t,r){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!r||(e=Ri(e.nextSibling),e===null))return null;return e}function B_(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Ri(e.nextSibling),e===null))return null;return e}function pu(e){return e.data==="$?"||e.data==="$~"}function vu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function d0(e,t){var r=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||r.readyState!=="loading")t();else{var n=function(){t(),r.removeEventListener("DOMContentLoaded",n)};r.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function Ri(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 gu=null;function z_(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"||r==="/&"){if(t===0)return Ri(e.nextSibling);t--}else r!=="$"&&r!=="$!"&&r!=="$?"&&r!=="$~"&&r!=="&"||t++}e=e.nextSibling}return null}function j_(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"){if(t===0)return e;t--}else r!=="/$"&&r!=="/&"||t++}e=e.previousSibling}return null}function H_(e,t,r){switch(t=Ro(r),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function ea(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);W(e)}var Di=new Map,U_=new Set;function Do(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var gr=V.d;V.d={f:_0,r:m0,D:p0,C:v0,L:g0,m:y0,X:b0,S:S0,M:C0};function _0(){var e=gr.f(),t=So();return e||t}function m0(e){var t=ge(e);t!==null&&t.tag===5&&t.type==="form"?id(t):gr.r(e)}var Vs=typeof document>"u"?null:document;function I_(e,t,r){var n=Vs;if(n&&typeof t=="string"&&t){var c=bi(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof r=="string"&&(c+='[crossorigin="'+r+'"]'),U_.has(c)||(U_.add(c),e={rel:e,crossOrigin:r,href:t},n.querySelector(c)===null&&(t=n.createElement("link"),It(t,"link",e),ke(t),n.head.appendChild(t)))}}function p0(e){gr.D(e),I_("dns-prefetch",e,null)}function v0(e,t){gr.C(e,t),I_("preconnect",e,t)}function g0(e,t,r){gr.L(e,t,r);var n=Vs;if(n&&e&&t){var c='link[rel="preload"][as="'+bi(t)+'"]';t==="image"&&r&&r.imageSrcSet?(c+='[imagesrcset="'+bi(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(c+='[imagesizes="'+bi(r.imageSizes)+'"]')):c+='[href="'+bi(e)+'"]';var d=c;switch(t){case"style":d=Xs(e);break;case"script":d=Js(e)}Di.has(d)||(e=m({rel:"preload",href:t==="image"&&r&&r.imageSrcSet?void 0:e,as:t},r),Di.set(d,e),n.querySelector(c)!==null||t==="style"&&n.querySelector(ta(d))||t==="script"&&n.querySelector(ia(d))||(t=n.createElement("link"),It(t,"link",e),ke(t),n.head.appendChild(t)))}}function y0(e,t){gr.m(e,t);var r=Vs;if(r&&e){var n=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+bi(n)+'"][href="'+bi(e)+'"]',d=c;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=Js(e)}if(!Di.has(d)&&(e=m({rel:"modulepreload",href:e},t),Di.set(d,e),r.querySelector(c)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(ia(d)))return}n=r.createElement("link"),It(n,"link",e),ke(n),r.head.appendChild(n)}}}function S0(e,t,r){gr.S(e,t,r);var n=Vs;if(n&&e){var c=at(n).hoistableStyles,d=Xs(e);t=t||"default";var D=c.get(d);if(!D){var z={loading:0,preload:null};if(D=n.querySelector(ta(d)))z.loading=5;else{e=m({rel:"stylesheet",href:e,"data-precedence":t},r),(r=Di.get(d))&&yu(e,r);var Z=D=n.createElement("link");ke(Z),It(Z,"link",e),Z._p=new Promise(function(ie,le){Z.onload=ie,Z.onerror=le}),Z.addEventListener("load",function(){z.loading|=1}),Z.addEventListener("error",function(){z.loading|=2}),z.loading|=4,ko(D,t,n)}D={type:"stylesheet",instance:D,count:1,state:z},c.set(d,D)}}}function b0(e,t){gr.X(e,t);var r=Vs;if(r&&e){var n=at(r).hoistableScripts,c=Js(e),d=n.get(c);d||(d=r.querySelector(ia(c)),d||(e=m({src:e,async:!0},t),(t=Di.get(c))&&Su(e,t),d=r.createElement("script"),ke(d),It(d,"link",e),r.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},n.set(c,d))}}function C0(e,t){gr.M(e,t);var r=Vs;if(r&&e){var n=at(r).hoistableScripts,c=Js(e),d=n.get(c);d||(d=r.querySelector(ia(c)),d||(e=m({src:e,async:!0,type:"module"},t),(t=Di.get(c))&&Su(e,t),d=r.createElement("script"),ke(d),It(d,"link",e),r.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},n.set(c,d))}}function P_(e,t,r,n){var c=(c=me.current)?Do(c):null;if(!c)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(t=Xs(r.href),r=at(c).hoistableStyles,n=r.get(t),n||(n={type:"style",instance:null,count:0,state:null},r.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){e=Xs(r.href);var d=at(c).hoistableStyles,D=d.get(e);if(D||(c=c.ownerDocument||c,D={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,D),(d=c.querySelector(ta(e)))&&!d._p&&(D.instance=d,D.state.loading=5),Di.has(e)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},Di.set(e,r),d||x0(c,e,r,D.state))),t&&n===null)throw Error(o(528,""));return D}if(t&&n!==null)throw Error(o(529,""));return null;case"script":return t=r.async,r=r.src,typeof r=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Js(r),r=at(c).hoistableScripts,n=r.get(t),n||(n={type:"script",instance:null,count:0,state:null},r.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Xs(e){return'href="'+bi(e)+'"'}function ta(e){return'link[rel="stylesheet"]['+e+"]"}function $_(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function x0(e,t,r,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}),It(t,"link",r),ke(t),e.head.appendChild(t))}function Js(e){return'[src="'+bi(e)+'"]'}function ia(e){return"script[async]"+e}function F_(e,t,r){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+bi(r.href)+'"]');if(n)return t.instance=n,ke(n),n;var c=m({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),ke(n),It(n,"style",c),ko(n,r.precedence,e),t.instance=n;case"stylesheet":c=Xs(r.href);var d=e.querySelector(ta(c));if(d)return t.state.loading|=4,t.instance=d,ke(d),d;n=$_(r),(c=Di.get(c))&&yu(n,c),d=(e.ownerDocument||e).createElement("link"),ke(d);var D=d;return D._p=new Promise(function(z,Z){D.onload=z,D.onerror=Z}),It(d,"link",n),t.state.loading|=4,ko(d,r.precedence,e),t.instance=d;case"script":return d=Js(r.src),(c=e.querySelector(ia(d)))?(t.instance=c,ke(c),c):(n=r,(c=Di.get(d))&&(n=m({},r),Su(n,c)),e=e.ownerDocument||e,c=e.createElement("script"),ke(c),It(c,"link",n),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,ko(n,r.precedence,e));return t.instance}function ko(e,t,r){for(var n=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=n.length?n[n.length-1]:null,d=c,D=0;D<n.length;D++){var z=n[D];if(z.dataset.precedence===t)d=z;else if(d!==c)break}d?d.parentNode.insertBefore(e,d.nextSibling):(t=r.nodeType===9?r.head:r,t.insertBefore(e,t.firstChild))}function yu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Su(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Oo=null;function Z_(e,t,r){if(Oo===null){var n=new Map,c=Oo=new Map;c.set(r,n)}else c=Oo,n=c.get(r),n||(n=new Map,c.set(r,n));if(n.has(e))return n;for(n.set(e,null),r=r.getElementsByTagName(e),c=0;c<r.length;c++){var d=r[c];if(!(d[Se]||d[St]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var D=d.getAttribute(t)||"";D=e+D;var z=n.get(D);z?z.push(d):n.set(D,[d])}}return n}function q_(e,t,r){e=e.ownerDocument||e,e.head.insertBefore(r,t==="title"?e.querySelector("head > title"):null)}function w0(e,t,r){if(r===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 G_(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function E0(e,t,r,n){if(r.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var c=Xs(n.href),d=t.querySelector(ta(c));if(d){t=d._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Mo.bind(e),t.then(e,e)),r.state.loading|=4,r.instance=d,ke(d);return}d=t.ownerDocument||t,n=$_(n),(c=Di.get(c))&&yu(n,c),d=d.createElement("link"),ke(d);var D=d;D._p=new Promise(function(z,Z){D.onload=z,D.onerror=Z}),It(d,"link",n),r.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(r,t),(t=r.state.preload)&&(r.state.loading&3)===0&&(e.count++,r=Mo.bind(e),t.addEventListener("load",r),t.addEventListener("error",r))}}var bu=0;function T0(e,t){return e.stylesheets&&e.count===0&&No(e,e.stylesheets),0<e.count||0<e.imgCount?function(r){var n=setTimeout(function(){if(e.stylesheets&&No(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+t);0<e.imgBytes&&bu===0&&(bu=62500*a0());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&No(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>bu?50:800)+t);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(c)}}:null}function Mo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)No(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Lo=null;function No(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Lo=new Map,t.forEach(A0,e),Lo=null,Mo.call(e))}function A0(e,t){if(!(t.state.loading&4)){var r=Lo.get(e);if(r)var n=r.get(null);else{r=new Map,Lo.set(e,r);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<c.length;d++){var D=c[d];(D.nodeName==="LINK"||D.getAttribute("media")!=="not all")&&(r.set(D.dataset.precedence,D),n=D)}n&&r.set(null,n)}c=t.instance,D=c.getAttribute("data-precedence"),d=r.get(D)||n,d===n&&r.set(null,c),r.set(D,c),this.count++,n=Mo.bind(this),c.addEventListener("load",n),c.addEventListener("error",n),d?d.parentNode.insertBefore(c,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var ra={$$typeof:p,Provider:null,Consumer:null,_currentValue:ee,_currentValue2:ee,_threadCount:0};function R0(e,t,r,n,c,d,D,z,Z){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=fn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fn(0),this.hiddenUpdates=fn(null),this.identifierPrefix=n,this.onUncaughtError=c,this.onCaughtError=d,this.onRecoverableError=D,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Z,this.incompleteTransitions=new Map}function W_(e,t,r,n,c,d,D,z,Z,ie,le,de){return e=new R0(e,t,r,D,Z,ie,le,de,z),t=1,d===!0&&(t|=24),d=li(3,null,null,t),e.current=d,d.stateNode=e,t=ec(),t.refCount++,e.pooledCache=t,t.refCount++,d.memoizedState={element:n,isDehydrated:r,cache:t},sc(d),e}function Y_(e){return e?(e=Ds,e):Ds}function K_(e,t,r,n,c,d){c=Y_(c),n.context===null?n.context=c:n.pendingContext=c,n=Rr(t),n.payload={element:r},d=d===void 0?null:d,d!==null&&(n.callback=d),r=Dr(e,n,t),r!==null&&(si(r,e,t),Bn(r,e,t))}function V_(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Cu(e,t){V_(e,t),(e=e.alternate)&&V_(e,t)}function X_(e){if(e.tag===13||e.tag===31){var t=is(e,67108864);t!==null&&si(t,e,67108864),Cu(e,67108864)}}function J_(e){if(e.tag===13||e.tag===31){var t=di();t=Xt(t);var r=is(e,t);r!==null&&si(r,e,t),Cu(e,t)}}var Bo=!0;function D0(e,t,r,n){var c=G.T;G.T=null;var d=V.p;try{V.p=2,xu(e,t,r,n)}finally{V.p=d,G.T=c}}function k0(e,t,r,n){var c=G.T;G.T=null;var d=V.p;try{V.p=8,xu(e,t,r,n)}finally{V.p=d,G.T=c}}function xu(e,t,r,n){if(Bo){var c=wu(n);if(c===null)cu(e,t,n,zo,r),em(e,n);else if(M0(c,e,t,r,n))n.stopPropagation();else if(em(e,n),t&4&&-1<O0.indexOf(e)){for(;c!==null;){var d=ge(c);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var D=ai(d.pendingLanes);if(D!==0){var z=d;for(z.pendingLanes|=2,z.entangledLanes|=2;D;){var Z=1<<31-yt(D);z.entanglements[1]|=Z,D&=~Z}qi(d),(Fe&6)===0&&(go=nt()+500,Xn(0))}}break;case 31:case 13:z=is(d,2),z!==null&&si(z,d,2),So(),Cu(d,2)}if(d=wu(n),d===null&&cu(e,t,n,zo,r),d===c)break;c=d}c!==null&&n.stopPropagation()}else cu(e,t,n,null,r)}}function wu(e){return e=Tl(e),Eu(e)}var zo=null;function Eu(e){if(zo=null,e=_e(e),e!==null){var t=w(e);if(t===null)e=null;else{var r=t.tag;if(r===13){if(e=T(t),e!==null)return e;e=null}else if(r===31){if(e=l(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return zo=e,null}function Q_(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(Dt()){case Zt:return 2;case Nt:return 8;case Bt:case Vi:return 32;case Vt:return 268435456;default:return 32}default:return 32}}var Tu=!1,Ir=null,Pr=null,$r=null,sa=new Map,na=new Map,Fr=[],O0="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 em(e,t){switch(e){case"focusin":case"focusout":Ir=null;break;case"dragenter":case"dragleave":Pr=null;break;case"mouseover":case"mouseout":$r=null;break;case"pointerover":case"pointerout":sa.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":na.delete(t.pointerId)}}function aa(e,t,r,n,c,d){return e===null||e.nativeEvent!==d?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:d,targetContainers:[c]},t!==null&&(t=ge(t),t!==null&&X_(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function M0(e,t,r,n,c){switch(t){case"focusin":return Ir=aa(Ir,e,t,r,n,c),!0;case"dragenter":return Pr=aa(Pr,e,t,r,n,c),!0;case"mouseover":return $r=aa($r,e,t,r,n,c),!0;case"pointerover":var d=c.pointerId;return sa.set(d,aa(sa.get(d)||null,e,t,r,n,c)),!0;case"gotpointercapture":return d=c.pointerId,na.set(d,aa(na.get(d)||null,e,t,r,n,c)),!0}return!1}function tm(e){var t=_e(e.target);if(t!==null){var r=w(t);if(r!==null){if(t=r.tag,t===13){if(t=T(r),t!==null){e.blockedOn=t,vn(e.priority,function(){J_(r)});return}}else if(t===31){if(t=l(r),t!==null){e.blockedOn=t,vn(e.priority,function(){J_(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function jo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=wu(e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);El=n,r.target.dispatchEvent(n),El=null}else return t=ge(r),t!==null&&X_(t),e.blockedOn=r,!1;t.shift()}return!0}function im(e,t,r){jo(e)&&r.delete(t)}function L0(){Tu=!1,Ir!==null&&jo(Ir)&&(Ir=null),Pr!==null&&jo(Pr)&&(Pr=null),$r!==null&&jo($r)&&($r=null),sa.forEach(im),na.forEach(im)}function Ho(e,t){e.blockedOn===t&&(e.blockedOn=null,Tu||(Tu=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,L0)))}var Uo=null;function rm(e){Uo!==e&&(Uo=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){Uo===e&&(Uo=null);for(var t=0;t<e.length;t+=3){var r=e[t],n=e[t+1],c=e[t+2];if(typeof n!="function"){if(Eu(n||r)===null)continue;break}var d=ge(r);d!==null&&(e.splice(t,3),t-=3,wc(d,{pending:!0,data:c,method:r.method,action:n},n,c))}}))}function Qs(e){function t(Z){return Ho(Z,e)}Ir!==null&&Ho(Ir,e),Pr!==null&&Ho(Pr,e),$r!==null&&Ho($r,e),sa.forEach(t),na.forEach(t);for(var r=0;r<Fr.length;r++){var n=Fr[r];n.blockedOn===e&&(n.blockedOn=null)}for(;0<Fr.length&&(r=Fr[0],r.blockedOn===null);)tm(r),r.blockedOn===null&&Fr.shift();if(r=(e.ownerDocument||e).$$reactFormReplay,r!=null)for(n=0;n<r.length;n+=3){var c=r[n],d=r[n+1],D=c[it]||null;if(typeof d=="function")D||rm(r);else if(D){var z=null;if(d&&d.hasAttribute("formAction")){if(c=d,D=d[it]||null)z=D.formAction;else if(Eu(c)!==null)continue}else z=D.action;typeof z=="function"?r[n+1]=z:(r.splice(n,3),n-=3),rm(r)}}}function sm(){function e(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(D){return c=D})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),n||setTimeout(r,20)}function r(){if(!n&&!navigation.transition){var d=navigation.currentEntry;d&&d.url!=null&&navigation.navigate(d.url,{state:d.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(r,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function Au(e){this._internalRoot=e}Io.prototype.render=Au.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var r=t.current,n=di();K_(r,n,e,t,null,null)},Io.prototype.unmount=Au.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;K_(e.current,2,null,e,null,null),So(),t[er]=null}};function Io(e){this._internalRoot=e}Io.prototype.unstable_scheduleHydration=function(e){if(e){var t=pn();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Fr.length&&t!==0&&t<Fr[r].priority;r++);Fr.splice(r,0,e),r===0&&tm(e)}};var nm=s.version;if(nm!=="19.2.4")throw Error(o(527,nm,"19.2.4"));V.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=u(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var N0={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:G,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Po=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Po.isDisabled&&Po.supportsFiber)try{vi=Po.inject(N0),kt=Po}catch{}}return la.createRoot=function(e,t){if(!g(e))throw Error(o(299));var r=!1,n="",c=fd,d=dd,D=_d;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(d=t.onCaughtError),t.onRecoverableError!==void 0&&(D=t.onRecoverableError)),t=W_(e,1,!1,null,null,r,n,null,c,d,D,sm),e[er]=t.current,lu(e),new Au(t)},la.hydrateRoot=function(e,t,r){if(!g(e))throw Error(o(299));var n=!1,c="",d=fd,D=dd,z=_d,Z=null;return r!=null&&(r.unstable_strictMode===!0&&(n=!0),r.identifierPrefix!==void 0&&(c=r.identifierPrefix),r.onUncaughtError!==void 0&&(d=r.onUncaughtError),r.onCaughtError!==void 0&&(D=r.onCaughtError),r.onRecoverableError!==void 0&&(z=r.onRecoverableError),r.formState!==void 0&&(Z=r.formState)),t=W_(e,1,!0,t,r??null,n,c,Z,d,D,z,sm),t.context=Y_(null),r=t.current,n=di(),n=Xt(n),c=Rr(n),c.callback=null,Dr(r,c,n),r=n,t.current.lanes=r,br(t,r),qi(t),e[er]=t.current,lu(e),new Io(t)},la.version="19.2.4",la}var mm;function G0(){if(mm)return ku.exports;mm=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(s){console.error(s)}}return i(),ku.exports=q0(),ku.exports}var W0=G0();const Y0=lp(W0);/**
50
+ * react-router v7.13.2
51
+ *
52
+ * Copyright (c) Remix Software Inc.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE.md file in the root directory of this source tree.
56
+ *
57
+ * @license MIT
58
+ */var pm="popstate";function vm(i){return typeof i=="object"&&i!=null&&"pathname"in i&&"search"in i&&"hash"in i&&"state"in i&&"key"in i}function K0(i={}){function s(o,g){var u;let w=(u=g.state)==null?void 0:u.masked,{pathname:T,search:l,hash:h}=w||o.location;return Vu("",{pathname:T,search:l,hash:h},g.state&&g.state.usr||null,g.state&&g.state.key||"default",w?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function a(o,g){return typeof g=="string"?g:ya(g)}return X0(s,a,null,i)}function ot(i,s){if(i===!1||i===null||typeof i>"u")throw new Error(s)}function Yi(i,s){if(!i){typeof console<"u"&&console.warn(s);try{throw new Error(s)}catch{}}}function V0(){return Math.random().toString(36).substring(2,10)}function gm(i,s){return{usr:i.state,key:i.key,idx:s,masked:i.unstable_mask?{pathname:i.pathname,search:i.search,hash:i.hash}:void 0}}function Vu(i,s,a=null,o,g){return{pathname:typeof i=="string"?i:i.pathname,search:"",hash:"",...typeof s=="string"?on(s):s,state:a,key:s&&s.key||o||V0(),unstable_mask:g}}function ya({pathname:i="/",search:s="",hash:a=""}){return s&&s!=="?"&&(i+=s.charAt(0)==="?"?s:"?"+s),a&&a!=="#"&&(i+=a.charAt(0)==="#"?a:"#"+a),i}function on(i){let s={};if(i){let a=i.indexOf("#");a>=0&&(s.hash=i.substring(a),i=i.substring(0,a));let o=i.indexOf("?");o>=0&&(s.search=i.substring(o),i=i.substring(0,o)),i&&(s.pathname=i)}return s}function X0(i,s,a,o={}){let{window:g=document.defaultView,v5Compat:w=!1}=o,T=g.history,l="POP",h=null,u=y();u==null&&(u=0,T.replaceState({...T.state,idx:u},""));function y(){return(T.state||{idx:null}).idx}function m(){l="POP";let _=y(),v=_==null?null:_-u;u=_,h&&h({action:l,location:C.location,delta:v})}function b(_,v){l="PUSH";let f=vm(_)?_:Vu(C.location,_,v);u=y()+1;let p=gm(f,u),S=C.createHref(f.unstable_mask||f);try{T.pushState(p,"",S)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;g.location.assign(S)}w&&h&&h({action:l,location:C.location,delta:1})}function x(_,v){l="REPLACE";let f=vm(_)?_:Vu(C.location,_,v);u=y();let p=gm(f,u),S=C.createHref(f.unstable_mask||f);T.replaceState(p,"",S),w&&h&&h({action:l,location:C.location,delta:0})}function k(_){return J0(_)}let C={get action(){return l},get location(){return i(g,T)},listen(_){if(h)throw new Error("A history only accepts one active listener");return g.addEventListener(pm,m),h=_,()=>{g.removeEventListener(pm,m),h=null}},createHref(_){return s(g,_)},createURL:k,encodeLocation(_){let v=k(_);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:b,replace:x,go(_){return T.go(_)}};return C}function J0(i,s=!1){let a="http://localhost";typeof window<"u"&&(a=window.location.origin!=="null"?window.location.origin:window.location.href),ot(a,"No window.location.(origin|href) available to create URL");let o=typeof i=="string"?i:ya(i);return o=o.replace(/ $/,"%20"),!s&&o.startsWith("//")&&(o=a+o),new URL(o,a)}function cp(i,s,a="/"){return Q0(i,s,a,!1)}function Q0(i,s,a,o){let g=typeof s=="string"?on(s):s,w=Sr(g.pathname||"/",a);if(w==null)return null;let T=up(i);ey(T);let l=null;for(let h=0;l==null&&h<T.length;++h){let u=hy(w);l=cy(T[h],u,o)}return l}function up(i,s=[],a=[],o="",g=!1){let w=(T,l,h=g,u)=>{let y={relativePath:u===void 0?T.path||"":u,caseSensitive:T.caseSensitive===!0,childrenIndex:l,route:T};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(o)&&h)return;ot(y.relativePath.startsWith(o),`Absolute route path "${y.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(o.length)}let m=Wi([o,y.relativePath]),b=a.concat(y);T.children&&T.children.length>0&&(ot(T.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),up(T.children,s,b,m,h)),!(T.path==null&&!T.index)&&s.push({path:m,score:oy(m,T.index),routesMeta:b})};return i.forEach((T,l)=>{var h;if(T.path===""||!((h=T.path)!=null&&h.includes("?")))w(T,l);else for(let u of hp(T.path))w(T,l,!0,u)}),s}function hp(i){let s=i.split("/");if(s.length===0)return[];let[a,...o]=s,g=a.endsWith("?"),w=a.replace(/\?$/,"");if(o.length===0)return g?[w,""]:[w];let T=hp(o.join("/")),l=[];return l.push(...T.map(h=>h===""?w:[w,h].join("/"))),g&&l.push(...T),l.map(h=>i.startsWith("/")&&h===""?"/":h)}function ey(i){i.sort((s,a)=>s.score!==a.score?a.score-s.score:ly(s.routesMeta.map(o=>o.childrenIndex),a.routesMeta.map(o=>o.childrenIndex)))}var ty=/^:[\w-]+$/,iy=3,ry=2,sy=1,ny=10,ay=-2,ym=i=>i==="*";function oy(i,s){let a=i.split("/"),o=a.length;return a.some(ym)&&(o+=ay),s&&(o+=ry),a.filter(g=>!ym(g)).reduce((g,w)=>g+(ty.test(w)?iy:w===""?sy:ny),o)}function ly(i,s){return i.length===s.length&&i.slice(0,-1).every((o,g)=>o===s[g])?i[i.length-1]-s[s.length-1]:0}function cy(i,s,a=!1){let{routesMeta:o}=i,g={},w="/",T=[];for(let l=0;l<o.length;++l){let h=o[l],u=l===o.length-1,y=w==="/"?s:s.slice(w.length)||"/",m=el({path:h.relativePath,caseSensitive:h.caseSensitive,end:u},y),b=h.route;if(!m&&u&&a&&!o[o.length-1].route.index&&(m=el({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},y)),!m)return null;Object.assign(g,m.params),T.push({params:g,pathname:Wi([w,m.pathname]),pathnameBase:my(Wi([w,m.pathnameBase])),route:b}),m.pathnameBase!=="/"&&(w=Wi([w,m.pathnameBase]))}return T}function el(i,s){typeof i=="string"&&(i={path:i,caseSensitive:!1,end:!0});let[a,o]=uy(i.path,i.caseSensitive,i.end),g=s.match(a);if(!g)return null;let w=g[0],T=w.replace(/(.)\/+$/,"$1"),l=g.slice(1);return{params:o.reduce((u,{paramName:y,isOptional:m},b)=>{if(y==="*"){let k=l[b]||"";T=w.slice(0,w.length-k.length).replace(/(.)\/+$/,"$1")}const x=l[b];return m&&!x?u[y]=void 0:u[y]=(x||"").replace(/%2F/g,"/"),u},{}),pathname:w,pathnameBase:T,pattern:i}}function uy(i,s=!1,a=!0){Yi(i==="*"||!i.endsWith("*")||i.endsWith("/*"),`Route path "${i}" will be treated as if it were "${i.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${i.replace(/\*$/,"/*")}".`);let o=[],g="^"+i.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(T,l,h,u,y)=>{if(o.push({paramName:l,isOptional:h!=null}),h){let m=y.charAt(u+T.length);return m&&m!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return i.endsWith("*")?(o.push({paramName:"*"}),g+=i==="*"||i==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?g+="\\/*$":i!==""&&i!=="/"&&(g+="(?:(?=\\/|$))"),[new RegExp(g,s?void 0:"i"),o]}function hy(i){try{return i.split("/").map(s=>decodeURIComponent(s).replace(/\//g,"%2F")).join("/")}catch(s){return Yi(!1,`The URL path "${i}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${s}).`),i}}function Sr(i,s){if(s==="/")return i;if(!i.toLowerCase().startsWith(s.toLowerCase()))return null;let a=s.endsWith("/")?s.length-1:s.length,o=i.charAt(a);return o&&o!=="/"?null:i.slice(a)||"/"}var fy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function dy(i,s="/"){let{pathname:a,search:o="",hash:g=""}=typeof i=="string"?on(i):i,w;return a?(a=a.replace(/\/\/+/g,"/"),a.startsWith("/")?w=Sm(a.substring(1),"/"):w=Sm(a,s)):w=s,{pathname:w,search:py(o),hash:vy(g)}}function Sm(i,s){let a=s.replace(/\/+$/,"").split("/");return i.split("/").forEach(g=>{g===".."?a.length>1&&a.pop():g!=="."&&a.push(g)}),a.length>1?a.join("/"):"/"}function Nu(i,s,a,o){return`Cannot include a '${i}' character in a manually specified \`to.${s}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function _y(i){return i.filter((s,a)=>a===0||s.route.path&&s.route.path.length>0)}function fp(i){let s=_y(i);return s.map((a,o)=>o===s.length-1?a.pathname:a.pathnameBase)}function nh(i,s,a,o=!1){let g;typeof i=="string"?g=on(i):(g={...i},ot(!g.pathname||!g.pathname.includes("?"),Nu("?","pathname","search",g)),ot(!g.pathname||!g.pathname.includes("#"),Nu("#","pathname","hash",g)),ot(!g.search||!g.search.includes("#"),Nu("#","search","hash",g)));let w=i===""||g.pathname==="",T=w?"/":g.pathname,l;if(T==null)l=a;else{let m=s.length-1;if(!o&&T.startsWith("..")){let b=T.split("/");for(;b[0]==="..";)b.shift(),m-=1;g.pathname=b.join("/")}l=m>=0?s[m]:"/"}let h=dy(g,l),u=T&&T!=="/"&&T.endsWith("/"),y=(w||T===".")&&a.endsWith("/");return!h.pathname.endsWith("/")&&(u||y)&&(h.pathname+="/"),h}var Wi=i=>i.join("/").replace(/\/\/+/g,"/"),my=i=>i.replace(/\/+$/,"").replace(/^\/*/,"/"),py=i=>!i||i==="?"?"":i.startsWith("?")?i:"?"+i,vy=i=>!i||i==="#"?"":i.startsWith("#")?i:"#"+i,gy=class{constructor(i,s,a,o=!1){this.status=i,this.statusText=s||"",this.internal=o,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function yy(i){return i!=null&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.internal=="boolean"&&"data"in i}function Sy(i){return i.map(s=>s.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var dp=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function _p(i,s){let a=i;if(typeof a!="string"||!fy.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let o=a,g=!1;if(dp)try{let w=new URL(window.location.href),T=a.startsWith("//")?new URL(w.protocol+a):new URL(a),l=Sr(T.pathname,s);T.origin===w.origin&&l!=null?a=l+T.search+T.hash:g=!0}catch{Yi(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:g,to:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var mp=["POST","PUT","PATCH","DELETE"];new Set(mp);var by=["GET",...mp];new Set(by);var ln=F.createContext(null);ln.displayName="DataRouter";var ll=F.createContext(null);ll.displayName="DataRouterState";var Cy=F.createContext(!1),pp=F.createContext({isTransitioning:!1});pp.displayName="ViewTransition";var xy=F.createContext(new Map);xy.displayName="Fetchers";var wy=F.createContext(null);wy.displayName="Await";var Oi=F.createContext(null);Oi.displayName="Navigation";var ba=F.createContext(null);ba.displayName="Location";var Ui=F.createContext({outlet:null,matches:[],isDataRoute:!1});Ui.displayName="Route";var ah=F.createContext(null);ah.displayName="RouteError";var vp="REACT_ROUTER_ERROR",Ey="REDIRECT",Ty="ROUTE_ERROR_RESPONSE";function Ay(i){if(i.startsWith(`${vp}:${Ey}:{`))try{let s=JSON.parse(i.slice(28));if(typeof s=="object"&&s&&typeof s.status=="number"&&typeof s.statusText=="string"&&typeof s.location=="string"&&typeof s.reloadDocument=="boolean"&&typeof s.replace=="boolean")return s}catch{}}function Ry(i){if(i.startsWith(`${vp}:${Ty}:{`))try{let s=JSON.parse(i.slice(40));if(typeof s=="object"&&s&&typeof s.status=="number"&&typeof s.statusText=="string")return new gy(s.status,s.statusText,s.data)}catch{}}function Dy(i,{relative:s}={}){ot(Ca(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:o}=F.useContext(Oi),{hash:g,pathname:w,search:T}=xa(i,{relative:s}),l=w;return a!=="/"&&(l=w==="/"?a:Wi([a,w])),o.createHref({pathname:l,search:T,hash:g})}function Ca(){return F.useContext(ba)!=null}function Yr(){return ot(Ca(),"useLocation() may be used only in the context of a <Router> component."),F.useContext(ba).location}var gp="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function yp(i){F.useContext(Oi).static||F.useLayoutEffect(i)}function cl(){let{isDataRoute:i}=F.useContext(Ui);return i?Zy():ky()}function ky(){ot(Ca(),"useNavigate() may be used only in the context of a <Router> component.");let i=F.useContext(ln),{basename:s,navigator:a}=F.useContext(Oi),{matches:o}=F.useContext(Ui),{pathname:g}=Yr(),w=JSON.stringify(fp(o)),T=F.useRef(!1);return yp(()=>{T.current=!0}),F.useCallback((h,u={})=>{if(Yi(T.current,gp),!T.current)return;if(typeof h=="number"){a.go(h);return}let y=nh(h,JSON.parse(w),g,u.relative==="path");i==null&&s!=="/"&&(y.pathname=y.pathname==="/"?s:Wi([s,y.pathname])),(u.replace?a.replace:a.push)(y,u.state,u)},[s,a,w,g,i])}var Oy=F.createContext(null);function My(i){let s=F.useContext(Ui).outlet;return F.useMemo(()=>s&&F.createElement(Oy.Provider,{value:i},s),[s,i])}function Sp(){let{matches:i}=F.useContext(Ui),s=i[i.length-1];return s?s.params:{}}function xa(i,{relative:s}={}){let{matches:a}=F.useContext(Ui),{pathname:o}=Yr(),g=JSON.stringify(fp(a));return F.useMemo(()=>nh(i,JSON.parse(g),o,s==="path"),[i,g,o,s])}function Ly(i,s){return bp(i,s)}function bp(i,s,a){var _;ot(Ca(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=F.useContext(Oi),{matches:g}=F.useContext(Ui),w=g[g.length-1],T=w?w.params:{},l=w?w.pathname:"/",h=w?w.pathnameBase:"/",u=w&&w.route;{let v=u&&u.path||"";xp(l,!u||v.endsWith("*")||v.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (under <Route path="${v}">) 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.
59
+
60
+ Please change the parent <Route path="${v}"> to <Route path="${v==="/"?"*":`${v}/*`}">.`)}let y=Yr(),m;if(s){let v=typeof s=="string"?on(s):s;ot(h==="/"||((_=v.pathname)==null?void 0:_.startsWith(h)),`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 "${h}" but pathname "${v.pathname}" was given in the \`location\` prop.`),m=v}else m=y;let b=m.pathname||"/",x=b;if(h!=="/"){let v=h.replace(/^\//,"").split("/");x="/"+b.replace(/^\//,"").split("/").slice(v.length).join("/")}let k=cp(i,{pathname:x});Yi(u||k!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),Yi(k==null||k[k.length-1].route.element!==void 0||k[k.length-1].route.Component!==void 0||k[k.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.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 C=Hy(k&&k.map(v=>Object.assign({},v,{params:Object.assign({},T,v.params),pathname:Wi([h,o.encodeLocation?o.encodeLocation(v.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?h:Wi([h,o.encodeLocation?o.encodeLocation(v.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:v.pathnameBase])})),g,a);return s&&C?F.createElement(ba.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...m},navigationType:"POP"}},C):C}function Ny(){let i=Fy(),s=yy(i)?`${i.status} ${i.statusText}`:i instanceof Error?i.message:JSON.stringify(i),a=i instanceof Error?i.stack:null,o="rgba(200,200,200, 0.5)",g={padding:"0.5rem",backgroundColor:o},w={padding:"2px 4px",backgroundColor:o},T=null;return console.error("Error handled by React Router default ErrorBoundary:",i),T=F.createElement(F.Fragment,null,F.createElement("p",null,"💿 Hey developer 👋"),F.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",F.createElement("code",{style:w},"ErrorBoundary")," or"," ",F.createElement("code",{style:w},"errorElement")," prop on your route.")),F.createElement(F.Fragment,null,F.createElement("h2",null,"Unexpected Application Error!"),F.createElement("h3",{style:{fontStyle:"italic"}},s),a?F.createElement("pre",{style:g},a):null,T)}var By=F.createElement(Ny,null),Cp=class extends F.Component{constructor(i){super(i),this.state={location:i.location,revalidation:i.revalidation,error:i.error}}static getDerivedStateFromError(i){return{error:i}}static getDerivedStateFromProps(i,s){return s.location!==i.location||s.revalidation!=="idle"&&i.revalidation==="idle"?{error:i.error,location:i.location,revalidation:i.revalidation}:{error:i.error!==void 0?i.error:s.error,location:s.location,revalidation:i.revalidation||s.revalidation}}componentDidCatch(i,s){this.props.onError?this.props.onError(i,s):console.error("React Router caught the following error during render",i)}render(){let i=this.state.error;if(this.context&&typeof i=="object"&&i&&"digest"in i&&typeof i.digest=="string"){const a=Ry(i.digest);a&&(i=a)}let s=i!==void 0?F.createElement(Ui.Provider,{value:this.props.routeContext},F.createElement(ah.Provider,{value:i,children:this.props.component})):this.props.children;return this.context?F.createElement(zy,{error:i},s):s}};Cp.contextType=Cy;var Bu=new WeakMap;function zy({children:i,error:s}){let{basename:a}=F.useContext(Oi);if(typeof s=="object"&&s&&"digest"in s&&typeof s.digest=="string"){let o=Ay(s.digest);if(o){let g=Bu.get(s);if(g)throw g;let w=_p(o.location,a);if(dp&&!Bu.get(s))if(w.isExternal||o.reloadDocument)window.location.href=w.absoluteURL||w.to;else{const T=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(w.to,{replace:o.replace}));throw Bu.set(s,T),T}return F.createElement("meta",{httpEquiv:"refresh",content:`0;url=${w.absoluteURL||w.to}`})}}return i}function jy({routeContext:i,match:s,children:a}){let o=F.useContext(ln);return o&&o.static&&o.staticContext&&(s.route.errorElement||s.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=s.route.id),F.createElement(Ui.Provider,{value:i},a)}function Hy(i,s=[],a){let o=a==null?void 0:a.state;if(i==null){if(!o)return null;if(o.errors)i=o.matches;else if(s.length===0&&!o.initialized&&o.matches.length>0)i=o.matches;else return null}let g=i,w=o==null?void 0:o.errors;if(w!=null){let y=g.findIndex(m=>m.route.id&&(w==null?void 0:w[m.route.id])!==void 0);ot(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(w).join(",")}`),g=g.slice(0,Math.min(g.length,y+1))}let T=!1,l=-1;if(a&&o){T=o.renderFallback;for(let y=0;y<g.length;y++){let m=g[y];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(l=y),m.route.id){let{loaderData:b,errors:x}=o,k=m.route.loader&&!b.hasOwnProperty(m.route.id)&&(!x||x[m.route.id]===void 0);if(m.route.lazy||k){a.isStatic&&(T=!0),l>=0?g=g.slice(0,l+1):g=[g[0]];break}}}}let h=a==null?void 0:a.onError,u=o&&h?(y,m)=>{var b,x;h(y,{location:o.location,params:((x=(b=o.matches)==null?void 0:b[0])==null?void 0:x.params)??{},unstable_pattern:Sy(o.matches),errorInfo:m})}:void 0;return g.reduceRight((y,m,b)=>{let x,k=!1,C=null,_=null;o&&(x=w&&m.route.id?w[m.route.id]:void 0,C=m.route.errorElement||By,T&&(l<0&&b===0?(xp("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,_=null):l===b&&(k=!0,_=m.route.hydrateFallbackElement||null)));let v=s.concat(g.slice(0,b+1)),f=()=>{let p;return x?p=C:k?p=_:m.route.Component?p=F.createElement(m.route.Component,null):m.route.element?p=m.route.element:p=y,F.createElement(jy,{match:m,routeContext:{outlet:y,matches:v,isDataRoute:o!=null},children:p})};return o&&(m.route.ErrorBoundary||m.route.errorElement||b===0)?F.createElement(Cp,{location:o.location,revalidation:o.revalidation,component:C,error:x,children:f(),routeContext:{outlet:null,matches:v,isDataRoute:!0},onError:u}):f()},null)}function oh(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Uy(i){let s=F.useContext(ln);return ot(s,oh(i)),s}function Iy(i){let s=F.useContext(ll);return ot(s,oh(i)),s}function Py(i){let s=F.useContext(Ui);return ot(s,oh(i)),s}function lh(i){let s=Py(i),a=s.matches[s.matches.length-1];return ot(a.route.id,`${i} can only be used on routes that contain a unique "id"`),a.route.id}function $y(){return lh("useRouteId")}function Fy(){var o;let i=F.useContext(ah),s=Iy("useRouteError"),a=lh("useRouteError");return i!==void 0?i:(o=s.errors)==null?void 0:o[a]}function Zy(){let{router:i}=Uy("useNavigate"),s=lh("useNavigate"),a=F.useRef(!1);return yp(()=>{a.current=!0}),F.useCallback(async(g,w={})=>{Yi(a.current,gp),a.current&&(typeof g=="number"?await i.navigate(g):await i.navigate(g,{fromRouteId:s,...w}))},[i,s])}var bm={};function xp(i,s,a){!s&&!bm[i]&&(bm[i]=!0,Yi(!1,a))}F.memo(qy);function qy({routes:i,future:s,state:a,isStatic:o,onError:g}){return bp(i,void 0,{state:a,isStatic:o,onError:g})}function Gy(i){return My(i.context)}function ps(i){ot(!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 Wy({basename:i="/",children:s=null,location:a,navigationType:o="POP",navigator:g,static:w=!1,unstable_useTransitions:T}){ot(!Ca(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=i.replace(/^\/*/,"/"),h=F.useMemo(()=>({basename:l,navigator:g,static:w,unstable_useTransitions:T,future:{}}),[l,g,w,T]);typeof a=="string"&&(a=on(a));let{pathname:u="/",search:y="",hash:m="",state:b=null,key:x="default",unstable_mask:k}=a,C=F.useMemo(()=>{let _=Sr(u,l);return _==null?null:{location:{pathname:_,search:y,hash:m,state:b,key:x,unstable_mask:k},navigationType:o}},[l,u,y,m,b,x,o,k]);return Yi(C!=null,`<Router basename="${l}"> is not able to match the URL "${u}${y}${m}" because it does not start with the basename, so the <Router> won't render anything.`),C==null?null:F.createElement(Oi.Provider,{value:h},F.createElement(ba.Provider,{children:s,value:C}))}function Yy({children:i,location:s}){return Ly(Xu(i),s)}function Xu(i,s=[]){let a=[];return F.Children.forEach(i,(o,g)=>{if(!F.isValidElement(o))return;let w=[...s,g];if(o.type===F.Fragment){a.push.apply(a,Xu(o.props.children,w));return}ot(o.type===ps,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ot(!o.props.index||!o.props.children,"An index route cannot have child routes.");let T={id:o.props.id||w.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(T.children=Xu(o.props.children,w)),a.push(T)}),a}var Vo="get",Xo="application/x-www-form-urlencoded";function ul(i){return typeof HTMLElement<"u"&&i instanceof HTMLElement}function Ky(i){return ul(i)&&i.tagName.toLowerCase()==="button"}function Vy(i){return ul(i)&&i.tagName.toLowerCase()==="form"}function Xy(i){return ul(i)&&i.tagName.toLowerCase()==="input"}function Jy(i){return!!(i.metaKey||i.altKey||i.ctrlKey||i.shiftKey)}function Qy(i,s){return i.button===0&&(!s||s==="_self")&&!Jy(i)}var $o=null;function eS(){if($o===null)try{new FormData(document.createElement("form"),0),$o=!1}catch{$o=!0}return $o}var tS=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function zu(i){return i!=null&&!tS.has(i)?(Yi(!1,`"${i}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Xo}"`),null):i}function iS(i,s){let a,o,g,w,T;if(Vy(i)){let l=i.getAttribute("action");o=l?Sr(l,s):null,a=i.getAttribute("method")||Vo,g=zu(i.getAttribute("enctype"))||Xo,w=new FormData(i)}else if(Ky(i)||Xy(i)&&(i.type==="submit"||i.type==="image")){let l=i.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=i.getAttribute("formaction")||l.getAttribute("action");if(o=h?Sr(h,s):null,a=i.getAttribute("formmethod")||l.getAttribute("method")||Vo,g=zu(i.getAttribute("formenctype"))||zu(l.getAttribute("enctype"))||Xo,w=new FormData(l,i),!eS()){let{name:u,type:y,value:m}=i;if(y==="image"){let b=u?`${u}.`:"";w.append(`${b}x`,"0"),w.append(`${b}y`,"0")}else u&&w.append(u,m)}}else{if(ul(i))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=Vo,o=null,g=Xo,T=i}return w&&g==="text/plain"&&(T=w,w=void 0),{action:o,method:a.toLowerCase(),encType:g,formData:w,body:T}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function ch(i,s){if(i===!1||i===null||typeof i>"u")throw new Error(s)}function rS(i,s,a,o){let g=typeof i=="string"?new URL(i,typeof window>"u"?"server://singlefetch/":window.location.origin):i;return a?g.pathname.endsWith("/")?g.pathname=`${g.pathname}_.${o}`:g.pathname=`${g.pathname}.${o}`:g.pathname==="/"?g.pathname=`_root.${o}`:s&&Sr(g.pathname,s)==="/"?g.pathname=`${s.replace(/\/$/,"")}/_root.${o}`:g.pathname=`${g.pathname.replace(/\/$/,"")}.${o}`,g}async function sS(i,s){if(i.id in s)return s[i.id];try{let a=await import(i.module);return s[i.id]=a,a}catch(a){return console.error(`Error loading route module \`${i.module}\`, reloading page...`),console.error(a),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function nS(i){return i==null?!1:i.href==null?i.rel==="preload"&&typeof i.imageSrcSet=="string"&&typeof i.imageSizes=="string":typeof i.rel=="string"&&typeof i.href=="string"}async function aS(i,s,a){let o=await Promise.all(i.map(async g=>{let w=s.routes[g.route.id];if(w){let T=await sS(w,a);return T.links?T.links():[]}return[]}));return uS(o.flat(1).filter(nS).filter(g=>g.rel==="stylesheet"||g.rel==="preload").map(g=>g.rel==="stylesheet"?{...g,rel:"prefetch",as:"style"}:{...g,rel:"prefetch"}))}function Cm(i,s,a,o,g,w){let T=(h,u)=>a[u]?h.route.id!==a[u].route.id:!0,l=(h,u)=>{var y;return a[u].pathname!==h.pathname||((y=a[u].route.path)==null?void 0:y.endsWith("*"))&&a[u].params["*"]!==h.params["*"]};return w==="assets"?s.filter((h,u)=>T(h,u)||l(h,u)):w==="data"?s.filter((h,u)=>{var m;let y=o.routes[h.route.id];if(!y||!y.hasLoader)return!1;if(T(h,u)||l(h,u))return!0;if(h.route.shouldRevalidate){let b=h.route.shouldRevalidate({currentUrl:new URL(g.pathname+g.search+g.hash,window.origin),currentParams:((m=a[0])==null?void 0:m.params)||{},nextUrl:new URL(i,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function oS(i,s,{includeHydrateFallback:a}={}){return lS(i.map(o=>{let g=s.routes[o.route.id];if(!g)return[];let w=[g.module];return g.clientActionModule&&(w=w.concat(g.clientActionModule)),g.clientLoaderModule&&(w=w.concat(g.clientLoaderModule)),a&&g.hydrateFallbackModule&&(w=w.concat(g.hydrateFallbackModule)),g.imports&&(w=w.concat(g.imports)),w}).flat(1))}function lS(i){return[...new Set(i)]}function cS(i){let s={},a=Object.keys(i).sort();for(let o of a)s[o]=i[o];return s}function uS(i,s){let a=new Set;return new Set(s),i.reduce((o,g)=>{let w=JSON.stringify(cS(g));return a.has(w)||(a.add(w),o.push({key:w,link:g})),o},[])}function wp(){let i=F.useContext(ln);return ch(i,"You must render this element inside a <DataRouterContext.Provider> element"),i}function hS(){let i=F.useContext(ll);return ch(i,"You must render this element inside a <DataRouterStateContext.Provider> element"),i}var uh=F.createContext(void 0);uh.displayName="FrameworkContext";function Ep(){let i=F.useContext(uh);return ch(i,"You must render this element inside a <HydratedRouter> element"),i}function fS(i,s){let a=F.useContext(uh),[o,g]=F.useState(!1),[w,T]=F.useState(!1),{onFocus:l,onBlur:h,onMouseEnter:u,onMouseLeave:y,onTouchStart:m}=s,b=F.useRef(null);F.useEffect(()=>{if(i==="render"&&T(!0),i==="viewport"){let C=v=>{v.forEach(f=>{T(f.isIntersecting)})},_=new IntersectionObserver(C,{threshold:.5});return b.current&&_.observe(b.current),()=>{_.disconnect()}}},[i]),F.useEffect(()=>{if(o){let C=setTimeout(()=>{T(!0)},100);return()=>{clearTimeout(C)}}},[o]);let x=()=>{g(!0)},k=()=>{g(!1),T(!1)};return a?i!=="intent"?[w,b,{}]:[w,b,{onFocus:ca(l,x),onBlur:ca(h,k),onMouseEnter:ca(u,x),onMouseLeave:ca(y,k),onTouchStart:ca(m,x)}]:[!1,b,{}]}function ca(i,s){return a=>{i&&i(a),a.defaultPrevented||s(a)}}function dS({page:i,...s}){let{router:a}=wp(),o=F.useMemo(()=>cp(a.routes,i,a.basename),[a.routes,i,a.basename]);return o?F.createElement(mS,{page:i,matches:o,...s}):null}function _S(i){let{manifest:s,routeModules:a}=Ep(),[o,g]=F.useState([]);return F.useEffect(()=>{let w=!1;return aS(i,s,a).then(T=>{w||g(T)}),()=>{w=!0}},[i,s,a]),o}function mS({page:i,matches:s,...a}){let o=Yr(),{future:g,manifest:w,routeModules:T}=Ep(),{basename:l}=wp(),{loaderData:h,matches:u}=hS(),y=F.useMemo(()=>Cm(i,s,u,w,o,"data"),[i,s,u,w,o]),m=F.useMemo(()=>Cm(i,s,u,w,o,"assets"),[i,s,u,w,o]),b=F.useMemo(()=>{if(i===o.pathname+o.search+o.hash)return[];let C=new Set,_=!1;if(s.forEach(f=>{var S;let p=w.routes[f.route.id];!p||!p.hasLoader||(!y.some(A=>A.route.id===f.route.id)&&f.route.id in h&&((S=T[f.route.id])!=null&&S.shouldRevalidate)||p.hasClientLoader?_=!0:C.add(f.route.id))}),C.size===0)return[];let v=rS(i,l,g.unstable_trailingSlashAwareDataRequests,"data");return _&&C.size>0&&v.searchParams.set("_routes",s.filter(f=>C.has(f.route.id)).map(f=>f.route.id).join(",")),[v.pathname+v.search]},[l,g.unstable_trailingSlashAwareDataRequests,h,o,w,y,s,i,T]),x=F.useMemo(()=>oS(m,w),[m,w]),k=_S(m);return F.createElement(F.Fragment,null,b.map(C=>F.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...a})),x.map(C=>F.createElement("link",{key:C,rel:"modulepreload",href:C,...a})),k.map(({key:C,link:_})=>F.createElement("link",{key:C,nonce:a.nonce,..._,crossOrigin:_.crossOrigin??a.crossOrigin})))}function pS(...i){return s=>{i.forEach(a=>{typeof a=="function"?a(s):a!=null&&(a.current=s)})}}var vS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{vS&&(window.__reactRouterVersion="7.13.2")}catch{}function gS({basename:i,children:s,unstable_useTransitions:a,window:o}){let g=F.useRef();g.current==null&&(g.current=K0({window:o,v5Compat:!0}));let w=g.current,[T,l]=F.useState({action:w.action,location:w.location}),h=F.useCallback(u=>{a===!1?l(u):F.startTransition(()=>l(u))},[a]);return F.useLayoutEffect(()=>w.listen(h),[w,h]),F.createElement(Wy,{basename:i,children:s,location:T.location,navigationType:T.action,navigator:w,unstable_useTransitions:a})}var Tp=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Hi=F.forwardRef(function({onClick:s,discover:a="render",prefetch:o="none",relative:g,reloadDocument:w,replace:T,unstable_mask:l,state:h,target:u,to:y,preventScrollReset:m,viewTransition:b,unstable_defaultShouldRevalidate:x,...k},C){let{basename:_,navigator:v,unstable_useTransitions:f}=F.useContext(Oi),p=typeof y=="string"&&Tp.test(y),S=_p(y,_);y=S.to;let A=Dy(y,{relative:g}),R=Yr(),M=null;if(l){let re=nh(l,[],R.unstable_mask?R.unstable_mask.pathname:"/",!0);_!=="/"&&(re.pathname=re.pathname==="/"?_:Wi([_,re.pathname])),M=v.createHref(re)}let[E,B,$]=fS(o,k),I=bS(y,{replace:T,unstable_mask:l,state:h,target:u,preventScrollReset:m,relative:g,viewTransition:b,unstable_defaultShouldRevalidate:x,unstable_useTransitions:f});function q(re){s&&s(re),re.defaultPrevented||I(re)}let P=!(S.isExternal||w),Q=F.createElement("a",{...k,...$,href:(P?M:void 0)||S.absoluteURL||A,onClick:P?q:s,ref:pS(C,B),target:u,"data-discover":!p&&a==="render"?"true":void 0});return E&&!p?F.createElement(F.Fragment,null,Q,F.createElement(dS,{page:A})):Q});Hi.displayName="Link";var Ap=F.forwardRef(function({"aria-current":s="page",caseSensitive:a=!1,className:o="",end:g=!1,style:w,to:T,viewTransition:l,children:h,...u},y){let m=xa(T,{relative:u.relative}),b=Yr(),x=F.useContext(ll),{navigator:k,basename:C}=F.useContext(Oi),_=x!=null&&TS(m)&&l===!0,v=k.encodeLocation?k.encodeLocation(m).pathname:m.pathname,f=b.pathname,p=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;a||(f=f.toLowerCase(),p=p?p.toLowerCase():null,v=v.toLowerCase()),p&&C&&(p=Sr(p,C)||p);const S=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let A=f===v||!g&&f.startsWith(v)&&f.charAt(S)==="/",R=p!=null&&(p===v||!g&&p.startsWith(v)&&p.charAt(v.length)==="/"),M={isActive:A,isPending:R,isTransitioning:_},E=A?s:void 0,B;typeof o=="function"?B=o(M):B=[o,A?"active":null,R?"pending":null,_?"transitioning":null].filter(Boolean).join(" ");let $=typeof w=="function"?w(M):w;return F.createElement(Hi,{...u,"aria-current":E,className:B,ref:y,style:$,to:T,viewTransition:l},typeof h=="function"?h(M):h)});Ap.displayName="NavLink";var yS=F.forwardRef(({discover:i="render",fetcherKey:s,navigate:a,reloadDocument:o,replace:g,state:w,method:T=Vo,action:l,onSubmit:h,relative:u,preventScrollReset:y,viewTransition:m,unstable_defaultShouldRevalidate:b,...x},k)=>{let{unstable_useTransitions:C}=F.useContext(Oi),_=wS(),v=ES(l,{relative:u}),f=T.toLowerCase()==="get"?"get":"post",p=typeof l=="string"&&Tp.test(l),S=A=>{if(h&&h(A),A.defaultPrevented)return;A.preventDefault();let R=A.nativeEvent.submitter,M=(R==null?void 0:R.getAttribute("formmethod"))||T,E=()=>_(R||A.currentTarget,{fetcherKey:s,method:M,navigate:a,replace:g,state:w,relative:u,preventScrollReset:y,viewTransition:m,unstable_defaultShouldRevalidate:b});C&&a!==!1?F.startTransition(()=>E()):E()};return F.createElement("form",{ref:k,method:f,action:v,onSubmit:o?h:S,...x,"data-discover":!p&&i==="render"?"true":void 0})});yS.displayName="Form";function SS(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Rp(i){let s=F.useContext(ln);return ot(s,SS(i)),s}function bS(i,{target:s,replace:a,unstable_mask:o,state:g,preventScrollReset:w,relative:T,viewTransition:l,unstable_defaultShouldRevalidate:h,unstable_useTransitions:u}={}){let y=cl(),m=Yr(),b=xa(i,{relative:T});return F.useCallback(x=>{if(Qy(x,s)){x.preventDefault();let k=a!==void 0?a:ya(m)===ya(b),C=()=>y(i,{replace:k,unstable_mask:o,state:g,preventScrollReset:w,relative:T,viewTransition:l,unstable_defaultShouldRevalidate:h});u?F.startTransition(()=>C()):C()}},[m,y,b,a,o,g,s,i,w,T,l,h,u])}var CS=0,xS=()=>`__${String(++CS)}__`;function wS(){let{router:i}=Rp("useSubmit"),{basename:s}=F.useContext(Oi),a=$y(),o=i.fetch,g=i.navigate;return F.useCallback(async(w,T={})=>{let{action:l,method:h,encType:u,formData:y,body:m}=iS(w,s);if(T.navigate===!1){let b=T.fetcherKey||xS();await o(b,a,T.action||l,{unstable_defaultShouldRevalidate:T.unstable_defaultShouldRevalidate,preventScrollReset:T.preventScrollReset,formData:y,body:m,formMethod:T.method||h,formEncType:T.encType||u,flushSync:T.flushSync})}else await g(T.action||l,{unstable_defaultShouldRevalidate:T.unstable_defaultShouldRevalidate,preventScrollReset:T.preventScrollReset,formData:y,body:m,formMethod:T.method||h,formEncType:T.encType||u,replace:T.replace,state:T.state,fromRouteId:a,flushSync:T.flushSync,viewTransition:T.viewTransition})},[o,g,s,a])}function ES(i,{relative:s}={}){let{basename:a}=F.useContext(Oi),o=F.useContext(Ui);ot(o,"useFormAction must be used inside a RouteContext");let[g]=o.matches.slice(-1),w={...xa(i||".",{relative:s})},T=Yr();if(i==null){w.search=T.search;let l=new URLSearchParams(w.search),h=l.getAll("index");if(h.some(y=>y==="")){l.delete("index"),h.filter(m=>m).forEach(m=>l.append("index",m));let y=l.toString();w.search=y?`?${y}`:""}}return(!i||i===".")&&g.route.index&&(w.search=w.search?w.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(w.pathname=w.pathname==="/"?a:Wi([a,w.pathname])),ya(w)}function TS(i,{relative:s}={}){let a=F.useContext(pp);ot(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=Rp("useViewTransitionState"),g=xa(i,{relative:s});if(!a.isTransitioning)return!1;let w=Sr(a.currentLocation.pathname,o)||a.currentLocation.pathname,T=Sr(a.nextLocation.pathname,o)||a.nextLocation.pathname;return el(g.pathname,T)!=null||el(g.pathname,w)!=null}class AS extends F.Component{constructor(){super(...arguments);Et(this,"state",{hasError:!1,error:null});Et(this,"handleReload",()=>{this.setState({hasError:!1,error:null}),window.location.reload()})}static getDerivedStateFromError(a){return{hasError:!0,error:a}}componentDidCatch(a,o){console.error("[ErrorBoundary]",a,o.componentStack)}render(){var a;return this.state.hasError?O.jsxs("div",{className:"min-h-screen bg-[#0a0a0f] flex flex-col items-center justify-center text-center px-4",children:[O.jsx("div",{className:"text-6xl mb-4",children:"⚠"}),O.jsx("h1",{className:"text-lg text-[#e0e0e0] mb-2",children:"Something went wrong"}),O.jsx("p",{className:"text-sm text-[#555] mb-6 max-w-md",children:((a=this.state.error)==null?void 0:a.message)??"An unexpected error occurred."}),O.jsx("button",{onClick:this.handleReload,className:"px-4 py-2 text-sm font-medium rounded bg-[#00e5ff]/10 hover:bg-[#00e5ff]/20 text-[#00e5ff] border border-[#00e5ff]/30 transition-colors",children:"Reload"})]}):this.props.children}}/**
61
+ * @license lucide-react v0.474.0 - ISC
62
+ *
63
+ * This source code is licensed under the ISC license.
64
+ * See the LICENSE file in the root directory of this source tree.
65
+ */const RS=i=>i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Dp=(...i)=>i.filter((s,a,o)=>!!s&&s.trim()!==""&&o.indexOf(s)===a).join(" ").trim();/**
66
+ * @license lucide-react v0.474.0 - ISC
67
+ *
68
+ * This source code is licensed under the ISC license.
69
+ * See the LICENSE file in the root directory of this source tree.
70
+ */var DS={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"};/**
71
+ * @license lucide-react v0.474.0 - ISC
72
+ *
73
+ * This source code is licensed under the ISC license.
74
+ * See the LICENSE file in the root directory of this source tree.
75
+ */const kS=F.forwardRef(({color:i="currentColor",size:s=24,strokeWidth:a=2,absoluteStrokeWidth:o,className:g="",children:w,iconNode:T,...l},h)=>F.createElement("svg",{ref:h,...DS,width:s,height:s,stroke:i,strokeWidth:o?Number(a)*24/Number(s):a,className:Dp("lucide",g),...l},[...T.map(([u,y])=>F.createElement(u,y)),...Array.isArray(w)?w:[w]]));/**
76
+ * @license lucide-react v0.474.0 - ISC
77
+ *
78
+ * This source code is licensed under the ISC license.
79
+ * See the LICENSE file in the root directory of this source tree.
80
+ */const Qe=(i,s)=>{const a=F.forwardRef(({className:o,...g},w)=>F.createElement(kS,{ref:w,iconNode:s,className:Dp(`lucide-${RS(i)}`,o),...g}));return a.displayName=`${i}`,a};/**
81
+ * @license lucide-react v0.474.0 - ISC
82
+ *
83
+ * This source code is licensed under the ISC license.
84
+ * See the LICENSE file in the root directory of this source tree.
85
+ */const OS=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],kp=Qe("Activity",OS);/**
86
+ * @license lucide-react v0.474.0 - ISC
87
+ *
88
+ * This source code is licensed under the ISC license.
89
+ * See the LICENSE file in the root directory of this source tree.
90
+ */const MS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]],Op=Qe("Ban",MS);/**
91
+ * @license lucide-react v0.474.0 - ISC
92
+ *
93
+ * This source code is licensed under the ISC license.
94
+ * See the LICENSE file in the root directory of this source tree.
95
+ */const LS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Mp=Qe("CircleCheck",LS);/**
96
+ * @license lucide-react v0.474.0 - ISC
97
+ *
98
+ * This source code is licensed under the ISC license.
99
+ * See the LICENSE file in the root directory of this source tree.
100
+ */const NS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],BS=Qe("CirclePlus",NS);/**
101
+ * @license lucide-react v0.474.0 - ISC
102
+ *
103
+ * This source code is licensed under the ISC license.
104
+ * See the LICENSE file in the root directory of this source tree.
105
+ */const zS=[["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"}]],tl=Qe("CircleX",zS);/**
106
+ * @license lucide-react v0.474.0 - ISC
107
+ *
108
+ * This source code is licensed under the ISC license.
109
+ * See the LICENSE file in the root directory of this source tree.
110
+ */const jS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],HS=Qe("Clock",jS);/**
111
+ * @license lucide-react v0.474.0 - ISC
112
+ *
113
+ * This source code is licensed under the ISC license.
114
+ * See the LICENSE file in the root directory of this source tree.
115
+ */const US=[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]],IS=Qe("CornerDownLeft",US);/**
116
+ * @license lucide-react v0.474.0 - ISC
117
+ *
118
+ * This source code is licensed under the ISC license.
119
+ * See the LICENSE file in the root directory of this source tree.
120
+ */const PS=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],$S=Qe("Layers",PS);/**
121
+ * @license lucide-react v0.474.0 - ISC
122
+ *
123
+ * This source code is licensed under the ISC license.
124
+ * See the LICENSE file in the root directory of this source tree.
125
+ */const FS=[["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"}]],ZS=Qe("LayoutDashboard",FS);/**
126
+ * @license lucide-react v0.474.0 - ISC
127
+ *
128
+ * This source code is licensed under the ISC license.
129
+ * See the LICENSE file in the root directory of this source tree.
130
+ */const qS=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ju=Qe("LoaderCircle",qS);/**
131
+ * @license lucide-react v0.474.0 - ISC
132
+ *
133
+ * This source code is licensed under the ISC license.
134
+ * See the LICENSE file in the root directory of this source tree.
135
+ */const GS=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],WS=Qe("MessageSquare",GS);/**
136
+ * @license lucide-react v0.474.0 - ISC
137
+ *
138
+ * This source code is licensed under the ISC license.
139
+ * See the LICENSE file in the root directory of this source tree.
140
+ */const YS=[["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}]],KS=Qe("Octagon",YS);/**
141
+ * @license lucide-react v0.474.0 - ISC
142
+ *
143
+ * This source code is licensed under the ISC license.
144
+ * See the LICENSE file in the root directory of this source tree.
145
+ */const VS=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Lp=Qe("Play",VS);/**
146
+ * @license lucide-react v0.474.0 - ISC
147
+ *
148
+ * This source code is licensed under the ISC license.
149
+ * See the LICENSE file in the root directory of this source tree.
150
+ */const XS=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],hl=Qe("Plus",XS);/**
151
+ * @license lucide-react v0.474.0 - ISC
152
+ *
153
+ * This source code is licensed under the ISC license.
154
+ * See the LICENSE file in the root directory of this source tree.
155
+ */const JS=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],QS=Qe("Power",JS);/**
156
+ * @license lucide-react v0.474.0 - ISC
157
+ *
158
+ * This source code is licensed under the ISC license.
159
+ * See the LICENSE file in the root directory of this source tree.
160
+ */const eb=[["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"}]],tb=Qe("RefreshCw",eb);/**
161
+ * @license lucide-react v0.474.0 - ISC
162
+ *
163
+ * This source code is licensed under the ISC license.
164
+ * See the LICENSE file in the root directory of this source tree.
165
+ */const ib=[["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"}]],rb=Qe("Send",ib);/**
166
+ * @license lucide-react v0.474.0 - ISC
167
+ *
168
+ * This source code is licensed under the ISC license.
169
+ * See the LICENSE file in the root directory of this source tree.
170
+ */const sb=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],nb=Qe("ShieldAlert",sb);/**
171
+ * @license lucide-react v0.474.0 - ISC
172
+ *
173
+ * This source code is licensed under the ISC license.
174
+ * See the LICENSE file in the root directory of this source tree.
175
+ */const ab=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],ob=Qe("Shield",ab);/**
176
+ * @license lucide-react v0.474.0 - ISC
177
+ *
178
+ * This source code is licensed under the ISC license.
179
+ * See the LICENSE file in the root directory of this source tree.
180
+ */const lb=[["path",{d:"m12.5 17-.5-1-.5 1h1z",key:"3me087"}],["path",{d:"M15 22a1 1 0 0 0 1-1v-1a2 2 0 0 0 1.56-3.25 8 8 0 1 0-11.12 0A2 2 0 0 0 8 20v1a1 1 0 0 0 1 1z",key:"1o5pge"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}]],cb=Qe("Skull",lb);/**
181
+ * @license lucide-react v0.474.0 - ISC
182
+ *
183
+ * This source code is licensed under the ISC license.
184
+ * See the LICENSE file in the root directory of this source tree.
185
+ */const ub=[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]],hb=Qe("Terminal",ub);/**
186
+ * @license lucide-react v0.474.0 - ISC
187
+ *
188
+ * This source code is licensed under the ISC license.
189
+ * See the LICENSE file in the root directory of this source tree.
190
+ */const fb=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],Np=Qe("Trash2",fb);/**
191
+ * @license lucide-react v0.474.0 - ISC
192
+ *
193
+ * This source code is licensed under the ISC license.
194
+ * See the LICENSE file in the root directory of this source tree.
195
+ */const db=[["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"}]],Bp=Qe("TriangleAlert",db);/**
196
+ * @license lucide-react v0.474.0 - ISC
197
+ *
198
+ * This source code is licensed under the ISC license.
199
+ * See the LICENSE file in the root directory of this source tree.
200
+ */const _b=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]],mb=Qe("UserCheck",_b);/**
201
+ * @license lucide-react v0.474.0 - ISC
202
+ *
203
+ * This source code is licensed under the ISC license.
204
+ * See the LICENSE file in the root directory of this source tree.
205
+ */const pb=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]],vb=Qe("Users",pb);/**
206
+ * @license lucide-react v0.474.0 - ISC
207
+ *
208
+ * This source code is licensed under the ISC license.
209
+ * See the LICENSE file in the root directory of this source tree.
210
+ */const gb=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],fl=Qe("X",gb);/**
211
+ * @license lucide-react v0.474.0 - ISC
212
+ *
213
+ * This source code is licensed under the ISC license.
214
+ * See the LICENSE file in the root directory of this source tree.
215
+ */const yb=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Sb=Qe("Zap",yb),xm=i=>{let s;const a=new Set,o=(u,y)=>{const m=typeof u=="function"?u(s):u;if(!Object.is(m,s)){const b=s;s=y??(typeof m!="object"||m===null)?m:Object.assign({},s,m),a.forEach(x=>x(s,b))}},g=()=>s,l={setState:o,getState:g,getInitialState:()=>h,subscribe:u=>(a.add(u),()=>a.delete(u))},h=s=i(o,g,l);return l},bb=(i=>i?xm(i):xm),Cb=i=>i;function xb(i,s=Cb){const a=va.useSyncExternalStore(i.subscribe,va.useCallback(()=>s(i.getState()),[i,s]),va.useCallback(()=>s(i.getInitialState()),[i,s]));return va.useDebugValue(a),a}const wm=i=>{const s=bb(i),a=o=>xb(s,o);return Object.assign(a,s),a},zp=(i=>i?wm(i):wm),ft=zp(i=>({token:localStorage.getItem("aegis_token"),setToken:s=>{localStorage.setItem("aegis_token",s),i({token:s})},clearToken:()=>{localStorage.removeItem("aegis_token"),i({token:null})},sessions:[],setSessions:s=>i({sessions:s}),healthMap:{},setSessionsAndHealth:(s,a)=>i({sessions:s,healthMap:a}),metrics:null,setMetrics:s=>i({metrics:s}),sseConnected:!1,setSseConnected:s=>i({sseConnected:s}),sseError:null,setSseError:s=>i({sseError:s}),activities:[],addActivity:s=>i(a=>({activities:[s,...a.activities].slice(0,200)})),clearActivities:()=>i({activities:[]}),activityFilterSession:null,setActivityFilterSession:s=>i({activityFilterSession:s}),activityFilterType:null,setActivityFilterType:s=>i({activityFilterType:s})}));function fe(i,s,a){function o(l,h){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:h,constr:T,traits:new Set},enumerable:!1}),l._zod.traits.has(i))return;l._zod.traits.add(i),s(l,h);const u=T.prototype,y=Object.keys(u);for(let m=0;m<y.length;m++){const b=y[m];b in l||(l[b]=u[b].bind(l))}}const g=(a==null?void 0:a.Parent)??Object;class w extends g{}Object.defineProperty(w,"name",{value:i});function T(l){var h;const u=a!=null&&a.Parent?new w:this;o(u,l),(h=u._zod).deferred??(h.deferred=[]);for(const y of u._zod.deferred)y();return u}return Object.defineProperty(T,"init",{value:o}),Object.defineProperty(T,Symbol.hasInstance,{value:l=>{var h,u;return a!=null&&a.Parent&&l instanceof a.Parent?!0:(u=(h=l==null?void 0:l._zod)==null?void 0:h.traits)==null?void 0:u.has(i)}}),Object.defineProperty(T,"name",{value:i}),T}class rn extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class jp extends Error{constructor(s){super(`Encountered unidirectional transform during encode: ${s}`),this.name="ZodEncodeError"}}const Hp={};function Gr(i){return Hp}function Up(i){const s=Object.values(i).filter(o=>typeof o=="number");return Object.entries(i).filter(([o,g])=>s.indexOf(+o)===-1).map(([o,g])=>g)}function Qu(i,s){return typeof s=="bigint"?s.toString():s}function hh(i){return{get value(){{const s=i();return Object.defineProperty(this,"value",{value:s}),s}}}}function fh(i){return i==null}function dh(i){const s=i.startsWith("^")?1:0,a=i.endsWith("$")?i.length-1:i.length;return i.slice(s,a)}function wb(i,s){const a=(i.toString().split(".")[1]||"").length,o=s.toString();let g=(o.split(".")[1]||"").length;if(g===0&&/\d?e-\d?/.test(o)){const h=o.match(/\d?e-(\d?)/);h!=null&&h[1]&&(g=Number.parseInt(h[1]))}const w=a>g?a:g,T=Number.parseInt(i.toFixed(w).replace(".","")),l=Number.parseInt(s.toFixed(w).replace(".",""));return T%l/10**w}const Em=Symbol("evaluating");function We(i,s,a){let o;Object.defineProperty(i,s,{get(){if(o!==Em)return o===void 0&&(o=Em,o=a()),o},set(g){Object.defineProperty(i,s,{value:g})},configurable:!0})}function vs(i,s,a){Object.defineProperty(i,s,{value:a,writable:!0,enumerable:!0,configurable:!0})}function Kr(...i){const s={};for(const a of i){const o=Object.getOwnPropertyDescriptors(a);Object.assign(s,o)}return Object.defineProperties({},s)}function Tm(i){return JSON.stringify(i)}function Eb(i){return i.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Ip="captureStackTrace"in Error?Error.captureStackTrace:(...i)=>{};function il(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}const Tb=hh(()=>{var i;if(typeof navigator<"u"&&((i=navigator==null?void 0:navigator.userAgent)!=null&&i.includes("Cloudflare")))return!1;try{const s=Function;return new s(""),!0}catch{return!1}});function sn(i){if(il(i)===!1)return!1;const s=i.constructor;if(s===void 0||typeof s!="function")return!0;const a=s.prototype;return!(il(a)===!1||Object.prototype.hasOwnProperty.call(a,"isPrototypeOf")===!1)}function Pp(i){return sn(i)?{...i}:Array.isArray(i)?[...i]:i}const Ab=new Set(["string","number","symbol"]);function dl(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Vr(i,s,a){const o=new i._zod.constr(s??i._zod.def);return(!s||a!=null&&a.parent)&&(o._zod.parent=i),o}function xe(i){const s=i;if(!s)return{};if(typeof s=="string")return{error:()=>s};if((s==null?void 0:s.message)!==void 0){if((s==null?void 0:s.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");s.error=s.message}return delete s.message,typeof s.error=="string"?{...s,error:()=>s.error}:s}function Rb(i){return Object.keys(i).filter(s=>i[s]._zod.optin==="optional"&&i[s]._zod.optout==="optional")}const Db={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function kb(i,s){const a=i._zod.def,o=a.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const w=Kr(i._zod.def,{get shape(){const T={};for(const l in s){if(!(l in a.shape))throw new Error(`Unrecognized key: "${l}"`);s[l]&&(T[l]=a.shape[l])}return vs(this,"shape",T),T},checks:[]});return Vr(i,w)}function Ob(i,s){const a=i._zod.def,o=a.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const w=Kr(i._zod.def,{get shape(){const T={...i._zod.def.shape};for(const l in s){if(!(l in a.shape))throw new Error(`Unrecognized key: "${l}"`);s[l]&&delete T[l]}return vs(this,"shape",T),T},checks:[]});return Vr(i,w)}function Mb(i,s){if(!sn(s))throw new Error("Invalid input to extend: expected a plain object");const a=i._zod.def.checks;if(a&&a.length>0){const w=i._zod.def.shape;for(const T in s)if(Object.getOwnPropertyDescriptor(w,T)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const g=Kr(i._zod.def,{get shape(){const w={...i._zod.def.shape,...s};return vs(this,"shape",w),w}});return Vr(i,g)}function Lb(i,s){if(!sn(s))throw new Error("Invalid input to safeExtend: expected a plain object");const a=Kr(i._zod.def,{get shape(){const o={...i._zod.def.shape,...s};return vs(this,"shape",o),o}});return Vr(i,a)}function Nb(i,s){const a=Kr(i._zod.def,{get shape(){const o={...i._zod.def.shape,...s._zod.def.shape};return vs(this,"shape",o),o},get catchall(){return s._zod.def.catchall},checks:[]});return Vr(i,a)}function Bb(i,s,a){const g=s._zod.def.checks;if(g&&g.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const T=Kr(s._zod.def,{get shape(){const l=s._zod.def.shape,h={...l};if(a)for(const u in a){if(!(u in l))throw new Error(`Unrecognized key: "${u}"`);a[u]&&(h[u]=i?new i({type:"optional",innerType:l[u]}):l[u])}else for(const u in l)h[u]=i?new i({type:"optional",innerType:l[u]}):l[u];return vs(this,"shape",h),h},checks:[]});return Vr(s,T)}function zb(i,s,a){const o=Kr(s._zod.def,{get shape(){const g=s._zod.def.shape,w={...g};if(a)for(const T in a){if(!(T in w))throw new Error(`Unrecognized key: "${T}"`);a[T]&&(w[T]=new i({type:"nonoptional",innerType:g[T]}))}else for(const T in g)w[T]=new i({type:"nonoptional",innerType:g[T]});return vs(this,"shape",w),w}});return Vr(s,o)}function en(i,s=0){var a;if(i.aborted===!0)return!0;for(let o=s;o<i.issues.length;o++)if(((a=i.issues[o])==null?void 0:a.continue)!==!0)return!0;return!1}function tn(i,s){return s.map(a=>{var o;return(o=a).path??(o.path=[]),a.path.unshift(i),a})}function Fo(i){return typeof i=="string"?i:i==null?void 0:i.message}function Wr(i,s,a){var g,w,T,l,h,u;const o={...i,path:i.path??[]};if(!i.message){const y=Fo((T=(w=(g=i.inst)==null?void 0:g._zod.def)==null?void 0:w.error)==null?void 0:T.call(w,i))??Fo((l=s==null?void 0:s.error)==null?void 0:l.call(s,i))??Fo((h=a.customError)==null?void 0:h.call(a,i))??Fo((u=a.localeError)==null?void 0:u.call(a,i))??"Invalid input";o.message=y}return delete o.inst,delete o.continue,s!=null&&s.reportInput||delete o.input,o}function _h(i){return Array.isArray(i)?"array":typeof i=="string"?"string":"unknown"}function Sa(...i){const[s,a,o]=i;return typeof s=="string"?{message:s,code:"custom",input:a,inst:o}:{...s}}const $p=(i,s)=>{i.name="$ZodError",Object.defineProperty(i,"_zod",{value:i._zod,enumerable:!1}),Object.defineProperty(i,"issues",{value:s,enumerable:!1}),i.message=JSON.stringify(s,Qu,2),Object.defineProperty(i,"toString",{value:()=>i.message,enumerable:!1})},Fp=fe("$ZodError",$p),Zp=fe("$ZodError",$p,{Parent:Error});function jb(i,s=a=>a.message){const a={},o=[];for(const g of i.issues)g.path.length>0?(a[g.path[0]]=a[g.path[0]]||[],a[g.path[0]].push(s(g))):o.push(s(g));return{formErrors:o,fieldErrors:a}}function Hb(i,s=a=>a.message){const a={_errors:[]},o=g=>{for(const w of g.issues)if(w.code==="invalid_union"&&w.errors.length)w.errors.map(T=>o({issues:T}));else if(w.code==="invalid_key")o({issues:w.issues});else if(w.code==="invalid_element")o({issues:w.issues});else if(w.path.length===0)a._errors.push(s(w));else{let T=a,l=0;for(;l<w.path.length;){const h=w.path[l];l===w.path.length-1?(T[h]=T[h]||{_errors:[]},T[h]._errors.push(s(w))):T[h]=T[h]||{_errors:[]},T=T[h],l++}}};return o(i),a}const mh=i=>(s,a,o,g)=>{const w=o?Object.assign(o,{async:!1}):{async:!1},T=s._zod.run({value:a,issues:[]},w);if(T instanceof Promise)throw new rn;if(T.issues.length){const l=new((g==null?void 0:g.Err)??i)(T.issues.map(h=>Wr(h,w,Gr())));throw Ip(l,g==null?void 0:g.callee),l}return T.value},ph=i=>async(s,a,o,g)=>{const w=o?Object.assign(o,{async:!0}):{async:!0};let T=s._zod.run({value:a,issues:[]},w);if(T instanceof Promise&&(T=await T),T.issues.length){const l=new((g==null?void 0:g.Err)??i)(T.issues.map(h=>Wr(h,w,Gr())));throw Ip(l,g==null?void 0:g.callee),l}return T.value},_l=i=>(s,a,o)=>{const g=o?{...o,async:!1}:{async:!1},w=s._zod.run({value:a,issues:[]},g);if(w instanceof Promise)throw new rn;return w.issues.length?{success:!1,error:new(i??Fp)(w.issues.map(T=>Wr(T,g,Gr())))}:{success:!0,data:w.value}},Ub=_l(Zp),ml=i=>async(s,a,o)=>{const g=o?Object.assign(o,{async:!0}):{async:!0};let w=s._zod.run({value:a,issues:[]},g);return w instanceof Promise&&(w=await w),w.issues.length?{success:!1,error:new i(w.issues.map(T=>Wr(T,g,Gr())))}:{success:!0,data:w.value}},Ib=ml(Zp),Pb=i=>(s,a,o)=>{const g=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return mh(i)(s,a,g)},$b=i=>(s,a,o)=>mh(i)(s,a,o),Fb=i=>async(s,a,o)=>{const g=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return ph(i)(s,a,g)},Zb=i=>async(s,a,o)=>ph(i)(s,a,o),qb=i=>(s,a,o)=>{const g=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return _l(i)(s,a,g)},Gb=i=>(s,a,o)=>_l(i)(s,a,o),Wb=i=>async(s,a,o)=>{const g=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return ml(i)(s,a,g)},Yb=i=>async(s,a,o)=>ml(i)(s,a,o),Kb=/^[cC][^\s-]{8,}$/,Vb=/^[0-9a-z]+$/,Xb=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Jb=/^[0-9a-vA-V]{20}$/,Qb=/^[A-Za-z0-9]{27}$/,e1=/^[a-zA-Z0-9_-]{21}$/,t1=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,i1=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Am=i=>i?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${i}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,r1=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,s1="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function n1(){return new RegExp(s1,"u")}const a1=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,o1=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,l1=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,c1=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,u1=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,qp=/^[A-Za-z0-9_-]*$/,h1=/^\+[1-9]\d{6,14}$/,Gp="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",f1=new RegExp(`^${Gp}$`);function Wp(i){const s="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof i.precision=="number"?i.precision===-1?`${s}`:i.precision===0?`${s}:[0-5]\\d`:`${s}:[0-5]\\d\\.\\d{${i.precision}}`:`${s}(?::[0-5]\\d(?:\\.\\d+)?)?`}function d1(i){return new RegExp(`^${Wp(i)}$`)}function _1(i){const s=Wp({precision:i.precision}),a=["Z"];i.local&&a.push(""),i.offset&&a.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const o=`${s}(?:${a.join("|")})`;return new RegExp(`^${Gp}T(?:${o})$`)}const m1=i=>{const s=i?`[\\s\\S]{${(i==null?void 0:i.minimum)??0},${(i==null?void 0:i.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${s}$`)},p1=/^-?\d+$/,Yp=/^-?\d+(?:\.\d+)?$/,v1=/^(?:true|false)$/i,g1=/^[^A-Z]*$/,y1=/^[^a-z]*$/,ni=fe("$ZodCheck",(i,s)=>{var a;i._zod??(i._zod={}),i._zod.def=s,(a=i._zod).onattach??(a.onattach=[])}),Kp={number:"number",bigint:"bigint",object:"date"},Vp=fe("$ZodCheckLessThan",(i,s)=>{ni.init(i,s);const a=Kp[typeof s.value];i._zod.onattach.push(o=>{const g=o._zod.bag,w=(s.inclusive?g.maximum:g.exclusiveMaximum)??Number.POSITIVE_INFINITY;s.value<w&&(s.inclusive?g.maximum=s.value:g.exclusiveMaximum=s.value)}),i._zod.check=o=>{(s.inclusive?o.value<=s.value:o.value<s.value)||o.issues.push({origin:a,code:"too_big",maximum:typeof s.value=="object"?s.value.getTime():s.value,input:o.value,inclusive:s.inclusive,inst:i,continue:!s.abort})}}),Xp=fe("$ZodCheckGreaterThan",(i,s)=>{ni.init(i,s);const a=Kp[typeof s.value];i._zod.onattach.push(o=>{const g=o._zod.bag,w=(s.inclusive?g.minimum:g.exclusiveMinimum)??Number.NEGATIVE_INFINITY;s.value>w&&(s.inclusive?g.minimum=s.value:g.exclusiveMinimum=s.value)}),i._zod.check=o=>{(s.inclusive?o.value>=s.value:o.value>s.value)||o.issues.push({origin:a,code:"too_small",minimum:typeof s.value=="object"?s.value.getTime():s.value,input:o.value,inclusive:s.inclusive,inst:i,continue:!s.abort})}}),S1=fe("$ZodCheckMultipleOf",(i,s)=>{ni.init(i,s),i._zod.onattach.push(a=>{var o;(o=a._zod.bag).multipleOf??(o.multipleOf=s.value)}),i._zod.check=a=>{if(typeof a.value!=typeof s.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof a.value=="bigint"?a.value%s.value===BigInt(0):wb(a.value,s.value)===0)||a.issues.push({origin:typeof a.value,code:"not_multiple_of",divisor:s.value,input:a.value,inst:i,continue:!s.abort})}}),b1=fe("$ZodCheckNumberFormat",(i,s)=>{var T;ni.init(i,s),s.format=s.format||"float64";const a=(T=s.format)==null?void 0:T.includes("int"),o=a?"int":"number",[g,w]=Db[s.format];i._zod.onattach.push(l=>{const h=l._zod.bag;h.format=s.format,h.minimum=g,h.maximum=w,a&&(h.pattern=p1)}),i._zod.check=l=>{const h=l.value;if(a){if(!Number.isInteger(h)){l.issues.push({expected:o,format:s.format,code:"invalid_type",continue:!1,input:h,inst:i});return}if(!Number.isSafeInteger(h)){h>0?l.issues.push({input:h,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:i,origin:o,inclusive:!0,continue:!s.abort}):l.issues.push({input:h,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:i,origin:o,inclusive:!0,continue:!s.abort});return}}h<g&&l.issues.push({origin:"number",input:h,code:"too_small",minimum:g,inclusive:!0,inst:i,continue:!s.abort}),h>w&&l.issues.push({origin:"number",input:h,code:"too_big",maximum:w,inclusive:!0,inst:i,continue:!s.abort})}}),C1=fe("$ZodCheckMaxLength",(i,s)=>{var a;ni.init(i,s),(a=i._zod.def).when??(a.when=o=>{const g=o.value;return!fh(g)&&g.length!==void 0}),i._zod.onattach.push(o=>{const g=o._zod.bag.maximum??Number.POSITIVE_INFINITY;s.maximum<g&&(o._zod.bag.maximum=s.maximum)}),i._zod.check=o=>{const g=o.value;if(g.length<=s.maximum)return;const T=_h(g);o.issues.push({origin:T,code:"too_big",maximum:s.maximum,inclusive:!0,input:g,inst:i,continue:!s.abort})}}),x1=fe("$ZodCheckMinLength",(i,s)=>{var a;ni.init(i,s),(a=i._zod.def).when??(a.when=o=>{const g=o.value;return!fh(g)&&g.length!==void 0}),i._zod.onattach.push(o=>{const g=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;s.minimum>g&&(o._zod.bag.minimum=s.minimum)}),i._zod.check=o=>{const g=o.value;if(g.length>=s.minimum)return;const T=_h(g);o.issues.push({origin:T,code:"too_small",minimum:s.minimum,inclusive:!0,input:g,inst:i,continue:!s.abort})}}),w1=fe("$ZodCheckLengthEquals",(i,s)=>{var a;ni.init(i,s),(a=i._zod.def).when??(a.when=o=>{const g=o.value;return!fh(g)&&g.length!==void 0}),i._zod.onattach.push(o=>{const g=o._zod.bag;g.minimum=s.length,g.maximum=s.length,g.length=s.length}),i._zod.check=o=>{const g=o.value,w=g.length;if(w===s.length)return;const T=_h(g),l=w>s.length;o.issues.push({origin:T,...l?{code:"too_big",maximum:s.length}:{code:"too_small",minimum:s.length},inclusive:!0,exact:!0,input:o.value,inst:i,continue:!s.abort})}}),pl=fe("$ZodCheckStringFormat",(i,s)=>{var a,o;ni.init(i,s),i._zod.onattach.push(g=>{const w=g._zod.bag;w.format=s.format,s.pattern&&(w.patterns??(w.patterns=new Set),w.patterns.add(s.pattern))}),s.pattern?(a=i._zod).check??(a.check=g=>{s.pattern.lastIndex=0,!s.pattern.test(g.value)&&g.issues.push({origin:"string",code:"invalid_format",format:s.format,input:g.value,...s.pattern?{pattern:s.pattern.toString()}:{},inst:i,continue:!s.abort})}):(o=i._zod).check??(o.check=()=>{})}),E1=fe("$ZodCheckRegex",(i,s)=>{pl.init(i,s),i._zod.check=a=>{s.pattern.lastIndex=0,!s.pattern.test(a.value)&&a.issues.push({origin:"string",code:"invalid_format",format:"regex",input:a.value,pattern:s.pattern.toString(),inst:i,continue:!s.abort})}}),T1=fe("$ZodCheckLowerCase",(i,s)=>{s.pattern??(s.pattern=g1),pl.init(i,s)}),A1=fe("$ZodCheckUpperCase",(i,s)=>{s.pattern??(s.pattern=y1),pl.init(i,s)}),R1=fe("$ZodCheckIncludes",(i,s)=>{ni.init(i,s);const a=dl(s.includes),o=new RegExp(typeof s.position=="number"?`^.{${s.position}}${a}`:a);s.pattern=o,i._zod.onattach.push(g=>{const w=g._zod.bag;w.patterns??(w.patterns=new Set),w.patterns.add(o)}),i._zod.check=g=>{g.value.includes(s.includes,s.position)||g.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:s.includes,input:g.value,inst:i,continue:!s.abort})}}),D1=fe("$ZodCheckStartsWith",(i,s)=>{ni.init(i,s);const a=new RegExp(`^${dl(s.prefix)}.*`);s.pattern??(s.pattern=a),i._zod.onattach.push(o=>{const g=o._zod.bag;g.patterns??(g.patterns=new Set),g.patterns.add(a)}),i._zod.check=o=>{o.value.startsWith(s.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:s.prefix,input:o.value,inst:i,continue:!s.abort})}}),k1=fe("$ZodCheckEndsWith",(i,s)=>{ni.init(i,s);const a=new RegExp(`.*${dl(s.suffix)}$`);s.pattern??(s.pattern=a),i._zod.onattach.push(o=>{const g=o._zod.bag;g.patterns??(g.patterns=new Set),g.patterns.add(a)}),i._zod.check=o=>{o.value.endsWith(s.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:s.suffix,input:o.value,inst:i,continue:!s.abort})}}),O1=fe("$ZodCheckOverwrite",(i,s)=>{ni.init(i,s),i._zod.check=a=>{a.value=s.tx(a.value)}});class M1{constructor(s=[]){this.content=[],this.indent=0,this&&(this.args=s)}indented(s){this.indent+=1,s(this),this.indent-=1}write(s){if(typeof s=="function"){s(this,{execution:"sync"}),s(this,{execution:"async"});return}const o=s.split(`
216
+ `).filter(T=>T),g=Math.min(...o.map(T=>T.length-T.trimStart().length)),w=o.map(T=>T.slice(g)).map(T=>" ".repeat(this.indent*2)+T);for(const T of w)this.content.push(T)}compile(){const s=Function,a=this==null?void 0:this.args,g=[...((this==null?void 0:this.content)??[""]).map(w=>` ${w}`)];return new s(...a,g.join(`
217
+ `))}}const L1={major:4,minor:3,patch:6},dt=fe("$ZodType",(i,s)=>{var g;var a;i??(i={}),i._zod.def=s,i._zod.bag=i._zod.bag||{},i._zod.version=L1;const o=[...i._zod.def.checks??[]];i._zod.traits.has("$ZodCheck")&&o.unshift(i);for(const w of o)for(const T of w._zod.onattach)T(i);if(o.length===0)(a=i._zod).deferred??(a.deferred=[]),(g=i._zod.deferred)==null||g.push(()=>{i._zod.run=i._zod.parse});else{const w=(l,h,u)=>{let y=en(l),m;for(const b of h){if(b._zod.def.when){if(!b._zod.def.when(l))continue}else if(y)continue;const x=l.issues.length,k=b._zod.check(l);if(k instanceof Promise&&(u==null?void 0:u.async)===!1)throw new rn;if(m||k instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await k,l.issues.length!==x&&(y||(y=en(l,x)))});else{if(l.issues.length===x)continue;y||(y=en(l,x))}}return m?m.then(()=>l):l},T=(l,h,u)=>{if(en(l))return l.aborted=!0,l;const y=w(h,o,u);if(y instanceof Promise){if(u.async===!1)throw new rn;return y.then(m=>i._zod.parse(m,u))}return i._zod.parse(y,u)};i._zod.run=(l,h)=>{if(h.skipChecks)return i._zod.parse(l,h);if(h.direction==="backward"){const y=i._zod.parse({value:l.value,issues:[]},{...h,skipChecks:!0});return y instanceof Promise?y.then(m=>T(m,l,h)):T(y,l,h)}const u=i._zod.parse(l,h);if(u instanceof Promise){if(h.async===!1)throw new rn;return u.then(y=>w(y,o,h))}return w(u,o,h)}}We(i,"~standard",()=>({validate:w=>{var T;try{const l=Ub(i,w);return l.success?{value:l.data}:{issues:(T=l.error)==null?void 0:T.issues}}catch{return Ib(i,w).then(h=>{var u;return h.success?{value:h.data}:{issues:(u=h.error)==null?void 0:u.issues}})}},vendor:"zod",version:1}))}),vh=fe("$ZodString",(i,s)=>{var a;dt.init(i,s),i._zod.pattern=[...((a=i==null?void 0:i._zod.bag)==null?void 0:a.patterns)??[]].pop()??m1(i._zod.bag),i._zod.parse=(o,g)=>{if(s.coerce)try{o.value=String(o.value)}catch{}return typeof o.value=="string"||o.issues.push({expected:"string",code:"invalid_type",input:o.value,inst:i}),o}}),st=fe("$ZodStringFormat",(i,s)=>{pl.init(i,s),vh.init(i,s)}),N1=fe("$ZodGUID",(i,s)=>{s.pattern??(s.pattern=i1),st.init(i,s)}),B1=fe("$ZodUUID",(i,s)=>{if(s.version){const o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[s.version];if(o===void 0)throw new Error(`Invalid UUID version: "${s.version}"`);s.pattern??(s.pattern=Am(o))}else s.pattern??(s.pattern=Am());st.init(i,s)}),z1=fe("$ZodEmail",(i,s)=>{s.pattern??(s.pattern=r1),st.init(i,s)}),j1=fe("$ZodURL",(i,s)=>{st.init(i,s),i._zod.check=a=>{try{const o=a.value.trim(),g=new URL(o);s.hostname&&(s.hostname.lastIndex=0,s.hostname.test(g.hostname)||a.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:s.hostname.source,input:a.value,inst:i,continue:!s.abort})),s.protocol&&(s.protocol.lastIndex=0,s.protocol.test(g.protocol.endsWith(":")?g.protocol.slice(0,-1):g.protocol)||a.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:s.protocol.source,input:a.value,inst:i,continue:!s.abort})),s.normalize?a.value=g.href:a.value=o;return}catch{a.issues.push({code:"invalid_format",format:"url",input:a.value,inst:i,continue:!s.abort})}}}),H1=fe("$ZodEmoji",(i,s)=>{s.pattern??(s.pattern=n1()),st.init(i,s)}),U1=fe("$ZodNanoID",(i,s)=>{s.pattern??(s.pattern=e1),st.init(i,s)}),I1=fe("$ZodCUID",(i,s)=>{s.pattern??(s.pattern=Kb),st.init(i,s)}),P1=fe("$ZodCUID2",(i,s)=>{s.pattern??(s.pattern=Vb),st.init(i,s)}),$1=fe("$ZodULID",(i,s)=>{s.pattern??(s.pattern=Xb),st.init(i,s)}),F1=fe("$ZodXID",(i,s)=>{s.pattern??(s.pattern=Jb),st.init(i,s)}),Z1=fe("$ZodKSUID",(i,s)=>{s.pattern??(s.pattern=Qb),st.init(i,s)}),q1=fe("$ZodISODateTime",(i,s)=>{s.pattern??(s.pattern=_1(s)),st.init(i,s)}),G1=fe("$ZodISODate",(i,s)=>{s.pattern??(s.pattern=f1),st.init(i,s)}),W1=fe("$ZodISOTime",(i,s)=>{s.pattern??(s.pattern=d1(s)),st.init(i,s)}),Y1=fe("$ZodISODuration",(i,s)=>{s.pattern??(s.pattern=t1),st.init(i,s)}),K1=fe("$ZodIPv4",(i,s)=>{s.pattern??(s.pattern=a1),st.init(i,s),i._zod.bag.format="ipv4"}),V1=fe("$ZodIPv6",(i,s)=>{s.pattern??(s.pattern=o1),st.init(i,s),i._zod.bag.format="ipv6",i._zod.check=a=>{try{new URL(`http://[${a.value}]`)}catch{a.issues.push({code:"invalid_format",format:"ipv6",input:a.value,inst:i,continue:!s.abort})}}}),X1=fe("$ZodCIDRv4",(i,s)=>{s.pattern??(s.pattern=l1),st.init(i,s)}),J1=fe("$ZodCIDRv6",(i,s)=>{s.pattern??(s.pattern=c1),st.init(i,s),i._zod.check=a=>{const o=a.value.split("/");try{if(o.length!==2)throw new Error;const[g,w]=o;if(!w)throw new Error;const T=Number(w);if(`${T}`!==w)throw new Error;if(T<0||T>128)throw new Error;new URL(`http://[${g}]`)}catch{a.issues.push({code:"invalid_format",format:"cidrv6",input:a.value,inst:i,continue:!s.abort})}}});function Jp(i){if(i==="")return!0;if(i.length%4!==0)return!1;try{return atob(i),!0}catch{return!1}}const Q1=fe("$ZodBase64",(i,s)=>{s.pattern??(s.pattern=u1),st.init(i,s),i._zod.bag.contentEncoding="base64",i._zod.check=a=>{Jp(a.value)||a.issues.push({code:"invalid_format",format:"base64",input:a.value,inst:i,continue:!s.abort})}});function eC(i){if(!qp.test(i))return!1;const s=i.replace(/[-_]/g,o=>o==="-"?"+":"/"),a=s.padEnd(Math.ceil(s.length/4)*4,"=");return Jp(a)}const tC=fe("$ZodBase64URL",(i,s)=>{s.pattern??(s.pattern=qp),st.init(i,s),i._zod.bag.contentEncoding="base64url",i._zod.check=a=>{eC(a.value)||a.issues.push({code:"invalid_format",format:"base64url",input:a.value,inst:i,continue:!s.abort})}}),iC=fe("$ZodE164",(i,s)=>{s.pattern??(s.pattern=h1),st.init(i,s)});function rC(i,s=null){try{const a=i.split(".");if(a.length!==3)return!1;const[o]=a;if(!o)return!1;const g=JSON.parse(atob(o));return!("typ"in g&&(g==null?void 0:g.typ)!=="JWT"||!g.alg||s&&(!("alg"in g)||g.alg!==s))}catch{return!1}}const sC=fe("$ZodJWT",(i,s)=>{st.init(i,s),i._zod.check=a=>{rC(a.value,s.alg)||a.issues.push({code:"invalid_format",format:"jwt",input:a.value,inst:i,continue:!s.abort})}}),Qp=fe("$ZodNumber",(i,s)=>{dt.init(i,s),i._zod.pattern=i._zod.bag.pattern??Yp,i._zod.parse=(a,o)=>{if(s.coerce)try{a.value=Number(a.value)}catch{}const g=a.value;if(typeof g=="number"&&!Number.isNaN(g)&&Number.isFinite(g))return a;const w=typeof g=="number"?Number.isNaN(g)?"NaN":Number.isFinite(g)?void 0:"Infinity":void 0;return a.issues.push({expected:"number",code:"invalid_type",input:g,inst:i,...w?{received:w}:{}}),a}}),nC=fe("$ZodNumberFormat",(i,s)=>{b1.init(i,s),Qp.init(i,s)}),aC=fe("$ZodBoolean",(i,s)=>{dt.init(i,s),i._zod.pattern=v1,i._zod.parse=(a,o)=>{if(s.coerce)try{a.value=!!a.value}catch{}const g=a.value;return typeof g=="boolean"||a.issues.push({expected:"boolean",code:"invalid_type",input:g,inst:i}),a}}),oC=fe("$ZodUnknown",(i,s)=>{dt.init(i,s),i._zod.parse=a=>a}),lC=fe("$ZodNever",(i,s)=>{dt.init(i,s),i._zod.parse=(a,o)=>(a.issues.push({expected:"never",code:"invalid_type",input:a.value,inst:i}),a)});function Rm(i,s,a){i.issues.length&&s.issues.push(...tn(a,i.issues)),s.value[a]=i.value}const cC=fe("$ZodArray",(i,s)=>{dt.init(i,s),i._zod.parse=(a,o)=>{const g=a.value;if(!Array.isArray(g))return a.issues.push({expected:"array",code:"invalid_type",input:g,inst:i}),a;a.value=Array(g.length);const w=[];for(let T=0;T<g.length;T++){const l=g[T],h=s.element._zod.run({value:l,issues:[]},o);h instanceof Promise?w.push(h.then(u=>Rm(u,a,T))):Rm(h,a,T)}return w.length?Promise.all(w).then(()=>a):a}});function rl(i,s,a,o,g){if(i.issues.length){if(g&&!(a in o))return;s.issues.push(...tn(a,i.issues))}i.value===void 0?a in o&&(s.value[a]=void 0):s.value[a]=i.value}function ev(i){var o,g,w,T;const s=Object.keys(i.shape);for(const l of s)if(!((T=(w=(g=(o=i.shape)==null?void 0:o[l])==null?void 0:g._zod)==null?void 0:w.traits)!=null&&T.has("$ZodType")))throw new Error(`Invalid element at key "${l}": expected a Zod schema`);const a=Rb(i.shape);return{...i,keys:s,keySet:new Set(s),numKeys:s.length,optionalKeys:new Set(a)}}function tv(i,s,a,o,g,w){const T=[],l=g.keySet,h=g.catchall._zod,u=h.def.type,y=h.optout==="optional";for(const m in s){if(l.has(m))continue;if(u==="never"){T.push(m);continue}const b=h.run({value:s[m],issues:[]},o);b instanceof Promise?i.push(b.then(x=>rl(x,a,m,s,y))):rl(b,a,m,s,y)}return T.length&&a.issues.push({code:"unrecognized_keys",keys:T,input:s,inst:w}),i.length?Promise.all(i).then(()=>a):a}const uC=fe("$ZodObject",(i,s)=>{dt.init(i,s);const a=Object.getOwnPropertyDescriptor(s,"shape");if(!(a!=null&&a.get)){const l=s.shape;Object.defineProperty(s,"shape",{get:()=>{const h={...l};return Object.defineProperty(s,"shape",{value:h}),h}})}const o=hh(()=>ev(s));We(i._zod,"propValues",()=>{const l=s.shape,h={};for(const u in l){const y=l[u]._zod;if(y.values){h[u]??(h[u]=new Set);for(const m of y.values)h[u].add(m)}}return h});const g=il,w=s.catchall;let T;i._zod.parse=(l,h)=>{T??(T=o.value);const u=l.value;if(!g(u))return l.issues.push({expected:"object",code:"invalid_type",input:u,inst:i}),l;l.value={};const y=[],m=T.shape;for(const b of T.keys){const x=m[b],k=x._zod.optout==="optional",C=x._zod.run({value:u[b],issues:[]},h);C instanceof Promise?y.push(C.then(_=>rl(_,l,b,u,k))):rl(C,l,b,u,k)}return w?tv(y,u,l,h,o.value,i):y.length?Promise.all(y).then(()=>l):l}}),hC=fe("$ZodObjectJIT",(i,s)=>{uC.init(i,s);const a=i._zod.parse,o=hh(()=>ev(s)),g=b=>{var p;const x=new M1(["shape","payload","ctx"]),k=o.value,C=S=>{const A=Tm(S);return`shape[${A}]._zod.run({ value: input[${A}], issues: [] }, ctx)`};x.write("const input = payload.value;");const _=Object.create(null);let v=0;for(const S of k.keys)_[S]=`key_${v++}`;x.write("const newResult = {};");for(const S of k.keys){const A=_[S],R=Tm(S),M=b[S],E=((p=M==null?void 0:M._zod)==null?void 0:p.optout)==="optional";x.write(`const ${A} = ${C(S)};`),E?x.write(`
218
+ if (${A}.issues.length) {
219
+ if (${R} in input) {
220
+ payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
221
+ ...iss,
222
+ path: iss.path ? [${R}, ...iss.path] : [${R}]
223
+ })));
224
+ }
225
+ }
226
+
227
+ if (${A}.value === undefined) {
228
+ if (${R} in input) {
229
+ newResult[${R}] = undefined;
230
+ }
231
+ } else {
232
+ newResult[${R}] = ${A}.value;
233
+ }
234
+
235
+ `):x.write(`
236
+ if (${A}.issues.length) {
237
+ payload.issues = payload.issues.concat(${A}.issues.map(iss => ({
238
+ ...iss,
239
+ path: iss.path ? [${R}, ...iss.path] : [${R}]
240
+ })));
241
+ }
242
+
243
+ if (${A}.value === undefined) {
244
+ if (${R} in input) {
245
+ newResult[${R}] = undefined;
246
+ }
247
+ } else {
248
+ newResult[${R}] = ${A}.value;
249
+ }
250
+
251
+ `)}x.write("payload.value = newResult;"),x.write("return payload;");const f=x.compile();return(S,A)=>f(b,S,A)};let w;const T=il,l=!Hp.jitless,u=l&&Tb.value,y=s.catchall;let m;i._zod.parse=(b,x)=>{m??(m=o.value);const k=b.value;return T(k)?l&&u&&(x==null?void 0:x.async)===!1&&x.jitless!==!0?(w||(w=g(s.shape)),b=w(b,x),y?tv([],k,b,x,m,i):b):a(b,x):(b.issues.push({expected:"object",code:"invalid_type",input:k,inst:i}),b)}});function Dm(i,s,a,o){for(const w of i)if(w.issues.length===0)return s.value=w.value,s;const g=i.filter(w=>!en(w));return g.length===1?(s.value=g[0].value,g[0]):(s.issues.push({code:"invalid_union",input:s.value,inst:a,errors:i.map(w=>w.issues.map(T=>Wr(T,o,Gr())))}),s)}const fC=fe("$ZodUnion",(i,s)=>{dt.init(i,s),We(i._zod,"optin",()=>s.options.some(g=>g._zod.optin==="optional")?"optional":void 0),We(i._zod,"optout",()=>s.options.some(g=>g._zod.optout==="optional")?"optional":void 0),We(i._zod,"values",()=>{if(s.options.every(g=>g._zod.values))return new Set(s.options.flatMap(g=>Array.from(g._zod.values)))}),We(i._zod,"pattern",()=>{if(s.options.every(g=>g._zod.pattern)){const g=s.options.map(w=>w._zod.pattern);return new RegExp(`^(${g.map(w=>dh(w.source)).join("|")})$`)}});const a=s.options.length===1,o=s.options[0]._zod.run;i._zod.parse=(g,w)=>{if(a)return o(g,w);let T=!1;const l=[];for(const h of s.options){const u=h._zod.run({value:g.value,issues:[]},w);if(u instanceof Promise)l.push(u),T=!0;else{if(u.issues.length===0)return u;l.push(u)}}return T?Promise.all(l).then(h=>Dm(h,g,i,w)):Dm(l,g,i,w)}}),dC=fe("$ZodIntersection",(i,s)=>{dt.init(i,s),i._zod.parse=(a,o)=>{const g=a.value,w=s.left._zod.run({value:g,issues:[]},o),T=s.right._zod.run({value:g,issues:[]},o);return w instanceof Promise||T instanceof Promise?Promise.all([w,T]).then(([h,u])=>km(a,h,u)):km(a,w,T)}});function eh(i,s){if(i===s)return{valid:!0,data:i};if(i instanceof Date&&s instanceof Date&&+i==+s)return{valid:!0,data:i};if(sn(i)&&sn(s)){const a=Object.keys(s),o=Object.keys(i).filter(w=>a.indexOf(w)!==-1),g={...i,...s};for(const w of o){const T=eh(i[w],s[w]);if(!T.valid)return{valid:!1,mergeErrorPath:[w,...T.mergeErrorPath]};g[w]=T.data}return{valid:!0,data:g}}if(Array.isArray(i)&&Array.isArray(s)){if(i.length!==s.length)return{valid:!1,mergeErrorPath:[]};const a=[];for(let o=0;o<i.length;o++){const g=i[o],w=s[o],T=eh(g,w);if(!T.valid)return{valid:!1,mergeErrorPath:[o,...T.mergeErrorPath]};a.push(T.data)}return{valid:!0,data:a}}return{valid:!1,mergeErrorPath:[]}}function km(i,s,a){const o=new Map;let g;for(const l of s.issues)if(l.code==="unrecognized_keys"){g??(g=l);for(const h of l.keys)o.has(h)||o.set(h,{}),o.get(h).l=!0}else i.issues.push(l);for(const l of a.issues)if(l.code==="unrecognized_keys")for(const h of l.keys)o.has(h)||o.set(h,{}),o.get(h).r=!0;else i.issues.push(l);const w=[...o].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(w.length&&g&&i.issues.push({...g,keys:w}),en(i))return i;const T=eh(s.value,a.value);if(!T.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(T.mergeErrorPath)}`);return i.value=T.data,i}const _C=fe("$ZodRecord",(i,s)=>{dt.init(i,s),i._zod.parse=(a,o)=>{const g=a.value;if(!sn(g))return a.issues.push({expected:"record",code:"invalid_type",input:g,inst:i}),a;const w=[],T=s.keyType._zod.values;if(T){a.value={};const l=new Set;for(const u of T)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){l.add(typeof u=="number"?u.toString():u);const y=s.valueType._zod.run({value:g[u],issues:[]},o);y instanceof Promise?w.push(y.then(m=>{m.issues.length&&a.issues.push(...tn(u,m.issues)),a.value[u]=m.value})):(y.issues.length&&a.issues.push(...tn(u,y.issues)),a.value[u]=y.value)}let h;for(const u in g)l.has(u)||(h=h??[],h.push(u));h&&h.length>0&&a.issues.push({code:"unrecognized_keys",input:g,inst:i,keys:h})}else{a.value={};for(const l of Reflect.ownKeys(g)){if(l==="__proto__")continue;let h=s.keyType._zod.run({value:l,issues:[]},o);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&Yp.test(l)&&h.issues.length){const m=s.keyType._zod.run({value:Number(l),issues:[]},o);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");m.issues.length===0&&(h=m)}if(h.issues.length){s.mode==="loose"?a.value[l]=g[l]:a.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(m=>Wr(m,o,Gr())),input:l,path:[l],inst:i});continue}const y=s.valueType._zod.run({value:g[l],issues:[]},o);y instanceof Promise?w.push(y.then(m=>{m.issues.length&&a.issues.push(...tn(l,m.issues)),a.value[h.value]=m.value})):(y.issues.length&&a.issues.push(...tn(l,y.issues)),a.value[h.value]=y.value)}}return w.length?Promise.all(w).then(()=>a):a}}),mC=fe("$ZodEnum",(i,s)=>{dt.init(i,s);const a=Up(s.entries),o=new Set(a);i._zod.values=o,i._zod.pattern=new RegExp(`^(${a.filter(g=>Ab.has(typeof g)).map(g=>typeof g=="string"?dl(g):g.toString()).join("|")})$`),i._zod.parse=(g,w)=>{const T=g.value;return o.has(T)||g.issues.push({code:"invalid_value",values:a,input:T,inst:i}),g}}),pC=fe("$ZodTransform",(i,s)=>{dt.init(i,s),i._zod.parse=(a,o)=>{if(o.direction==="backward")throw new jp(i.constructor.name);const g=s.transform(a.value,a);if(o.async)return(g instanceof Promise?g:Promise.resolve(g)).then(T=>(a.value=T,a));if(g instanceof Promise)throw new rn;return a.value=g,a}});function Om(i,s){return i.issues.length&&s===void 0?{issues:[],value:void 0}:i}const iv=fe("$ZodOptional",(i,s)=>{dt.init(i,s),i._zod.optin="optional",i._zod.optout="optional",We(i._zod,"values",()=>s.innerType._zod.values?new Set([...s.innerType._zod.values,void 0]):void 0),We(i._zod,"pattern",()=>{const a=s.innerType._zod.pattern;return a?new RegExp(`^(${dh(a.source)})?$`):void 0}),i._zod.parse=(a,o)=>{if(s.innerType._zod.optin==="optional"){const g=s.innerType._zod.run(a,o);return g instanceof Promise?g.then(w=>Om(w,a.value)):Om(g,a.value)}return a.value===void 0?a:s.innerType._zod.run(a,o)}}),vC=fe("$ZodExactOptional",(i,s)=>{iv.init(i,s),We(i._zod,"values",()=>s.innerType._zod.values),We(i._zod,"pattern",()=>s.innerType._zod.pattern),i._zod.parse=(a,o)=>s.innerType._zod.run(a,o)}),gC=fe("$ZodNullable",(i,s)=>{dt.init(i,s),We(i._zod,"optin",()=>s.innerType._zod.optin),We(i._zod,"optout",()=>s.innerType._zod.optout),We(i._zod,"pattern",()=>{const a=s.innerType._zod.pattern;return a?new RegExp(`^(${dh(a.source)}|null)$`):void 0}),We(i._zod,"values",()=>s.innerType._zod.values?new Set([...s.innerType._zod.values,null]):void 0),i._zod.parse=(a,o)=>a.value===null?a:s.innerType._zod.run(a,o)}),yC=fe("$ZodDefault",(i,s)=>{dt.init(i,s),i._zod.optin="optional",We(i._zod,"values",()=>s.innerType._zod.values),i._zod.parse=(a,o)=>{if(o.direction==="backward")return s.innerType._zod.run(a,o);if(a.value===void 0)return a.value=s.defaultValue,a;const g=s.innerType._zod.run(a,o);return g instanceof Promise?g.then(w=>Mm(w,s)):Mm(g,s)}});function Mm(i,s){return i.value===void 0&&(i.value=s.defaultValue),i}const SC=fe("$ZodPrefault",(i,s)=>{dt.init(i,s),i._zod.optin="optional",We(i._zod,"values",()=>s.innerType._zod.values),i._zod.parse=(a,o)=>(o.direction==="backward"||a.value===void 0&&(a.value=s.defaultValue),s.innerType._zod.run(a,o))}),bC=fe("$ZodNonOptional",(i,s)=>{dt.init(i,s),We(i._zod,"values",()=>{const a=s.innerType._zod.values;return a?new Set([...a].filter(o=>o!==void 0)):void 0}),i._zod.parse=(a,o)=>{const g=s.innerType._zod.run(a,o);return g instanceof Promise?g.then(w=>Lm(w,i)):Lm(g,i)}});function Lm(i,s){return!i.issues.length&&i.value===void 0&&i.issues.push({code:"invalid_type",expected:"nonoptional",input:i.value,inst:s}),i}const CC=fe("$ZodCatch",(i,s)=>{dt.init(i,s),We(i._zod,"optin",()=>s.innerType._zod.optin),We(i._zod,"optout",()=>s.innerType._zod.optout),We(i._zod,"values",()=>s.innerType._zod.values),i._zod.parse=(a,o)=>{if(o.direction==="backward")return s.innerType._zod.run(a,o);const g=s.innerType._zod.run(a,o);return g instanceof Promise?g.then(w=>(a.value=w.value,w.issues.length&&(a.value=s.catchValue({...a,error:{issues:w.issues.map(T=>Wr(T,o,Gr()))},input:a.value}),a.issues=[]),a)):(a.value=g.value,g.issues.length&&(a.value=s.catchValue({...a,error:{issues:g.issues.map(w=>Wr(w,o,Gr()))},input:a.value}),a.issues=[]),a)}}),xC=fe("$ZodPipe",(i,s)=>{dt.init(i,s),We(i._zod,"values",()=>s.in._zod.values),We(i._zod,"optin",()=>s.in._zod.optin),We(i._zod,"optout",()=>s.out._zod.optout),We(i._zod,"propValues",()=>s.in._zod.propValues),i._zod.parse=(a,o)=>{if(o.direction==="backward"){const w=s.out._zod.run(a,o);return w instanceof Promise?w.then(T=>Zo(T,s.in,o)):Zo(w,s.in,o)}const g=s.in._zod.run(a,o);return g instanceof Promise?g.then(w=>Zo(w,s.out,o)):Zo(g,s.out,o)}});function Zo(i,s,a){return i.issues.length?(i.aborted=!0,i):s._zod.run({value:i.value,issues:i.issues},a)}const wC=fe("$ZodReadonly",(i,s)=>{dt.init(i,s),We(i._zod,"propValues",()=>s.innerType._zod.propValues),We(i._zod,"values",()=>s.innerType._zod.values),We(i._zod,"optin",()=>{var a,o;return(o=(a=s.innerType)==null?void 0:a._zod)==null?void 0:o.optin}),We(i._zod,"optout",()=>{var a,o;return(o=(a=s.innerType)==null?void 0:a._zod)==null?void 0:o.optout}),i._zod.parse=(a,o)=>{if(o.direction==="backward")return s.innerType._zod.run(a,o);const g=s.innerType._zod.run(a,o);return g instanceof Promise?g.then(Nm):Nm(g)}});function Nm(i){return i.value=Object.freeze(i.value),i}const EC=fe("$ZodCustom",(i,s)=>{ni.init(i,s),dt.init(i,s),i._zod.parse=(a,o)=>a,i._zod.check=a=>{const o=a.value,g=s.fn(o);if(g instanceof Promise)return g.then(w=>Bm(w,a,o,i));Bm(g,a,o,i)}});function Bm(i,s,a,o){if(!i){const g={code:"custom",input:a,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(g.params=o._zod.def.params),s.issues.push(Sa(g))}}var zm;class TC{constructor(){this._map=new WeakMap,this._idmap=new Map}add(s,...a){const o=a[0];return this._map.set(s,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,s),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(s){const a=this._map.get(s);return a&&typeof a=="object"&&"id"in a&&this._idmap.delete(a.id),this._map.delete(s),this}get(s){const a=s._zod.parent;if(a){const o={...this.get(a)??{}};delete o.id;const g={...o,...this._map.get(s)};return Object.keys(g).length?g:void 0}return this._map.get(s)}has(s){return this._map.has(s)}}function AC(){return new TC}(zm=globalThis).__zod_globalRegistry??(zm.__zod_globalRegistry=AC());const ga=globalThis.__zod_globalRegistry;function RC(i,s){return new i({type:"string",...xe(s)})}function DC(i,s){return new i({type:"string",format:"email",check:"string_format",abort:!1,...xe(s)})}function jm(i,s){return new i({type:"string",format:"guid",check:"string_format",abort:!1,...xe(s)})}function kC(i,s){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,...xe(s)})}function OC(i,s){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...xe(s)})}function MC(i,s){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...xe(s)})}function LC(i,s){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...xe(s)})}function NC(i,s){return new i({type:"string",format:"url",check:"string_format",abort:!1,...xe(s)})}function BC(i,s){return new i({type:"string",format:"emoji",check:"string_format",abort:!1,...xe(s)})}function zC(i,s){return new i({type:"string",format:"nanoid",check:"string_format",abort:!1,...xe(s)})}function jC(i,s){return new i({type:"string",format:"cuid",check:"string_format",abort:!1,...xe(s)})}function HC(i,s){return new i({type:"string",format:"cuid2",check:"string_format",abort:!1,...xe(s)})}function UC(i,s){return new i({type:"string",format:"ulid",check:"string_format",abort:!1,...xe(s)})}function IC(i,s){return new i({type:"string",format:"xid",check:"string_format",abort:!1,...xe(s)})}function PC(i,s){return new i({type:"string",format:"ksuid",check:"string_format",abort:!1,...xe(s)})}function $C(i,s){return new i({type:"string",format:"ipv4",check:"string_format",abort:!1,...xe(s)})}function FC(i,s){return new i({type:"string",format:"ipv6",check:"string_format",abort:!1,...xe(s)})}function ZC(i,s){return new i({type:"string",format:"cidrv4",check:"string_format",abort:!1,...xe(s)})}function qC(i,s){return new i({type:"string",format:"cidrv6",check:"string_format",abort:!1,...xe(s)})}function GC(i,s){return new i({type:"string",format:"base64",check:"string_format",abort:!1,...xe(s)})}function WC(i,s){return new i({type:"string",format:"base64url",check:"string_format",abort:!1,...xe(s)})}function YC(i,s){return new i({type:"string",format:"e164",check:"string_format",abort:!1,...xe(s)})}function KC(i,s){return new i({type:"string",format:"jwt",check:"string_format",abort:!1,...xe(s)})}function VC(i,s){return new i({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...xe(s)})}function XC(i,s){return new i({type:"string",format:"date",check:"string_format",...xe(s)})}function JC(i,s){return new i({type:"string",format:"time",check:"string_format",precision:null,...xe(s)})}function QC(i,s){return new i({type:"string",format:"duration",check:"string_format",...xe(s)})}function ex(i,s){return new i({type:"number",checks:[],...xe(s)})}function tx(i,s){return new i({type:"number",check:"number_format",abort:!1,format:"safeint",...xe(s)})}function ix(i,s){return new i({type:"boolean",...xe(s)})}function rx(i){return new i({type:"unknown"})}function sx(i,s){return new i({type:"never",...xe(s)})}function Hm(i,s){return new Vp({check:"less_than",...xe(s),value:i,inclusive:!1})}function ju(i,s){return new Vp({check:"less_than",...xe(s),value:i,inclusive:!0})}function Um(i,s){return new Xp({check:"greater_than",...xe(s),value:i,inclusive:!1})}function Hu(i,s){return new Xp({check:"greater_than",...xe(s),value:i,inclusive:!0})}function Im(i,s){return new S1({check:"multiple_of",...xe(s),value:i})}function rv(i,s){return new C1({check:"max_length",...xe(s),maximum:i})}function sl(i,s){return new x1({check:"min_length",...xe(s),minimum:i})}function sv(i,s){return new w1({check:"length_equals",...xe(s),length:i})}function nx(i,s){return new E1({check:"string_format",format:"regex",...xe(s),pattern:i})}function ax(i){return new T1({check:"string_format",format:"lowercase",...xe(i)})}function ox(i){return new A1({check:"string_format",format:"uppercase",...xe(i)})}function lx(i,s){return new R1({check:"string_format",format:"includes",...xe(s),includes:i})}function cx(i,s){return new D1({check:"string_format",format:"starts_with",...xe(s),prefix:i})}function ux(i,s){return new k1({check:"string_format",format:"ends_with",...xe(s),suffix:i})}function cn(i){return new O1({check:"overwrite",tx:i})}function hx(i){return cn(s=>s.normalize(i))}function fx(){return cn(i=>i.trim())}function dx(){return cn(i=>i.toLowerCase())}function _x(){return cn(i=>i.toUpperCase())}function mx(){return cn(i=>Eb(i))}function px(i,s,a){return new i({type:"array",element:s,...xe(a)})}function vx(i,s,a){return new i({type:"custom",check:"custom",fn:s,...xe(a)})}function gx(i){const s=yx(a=>(a.addIssue=o=>{if(typeof o=="string")a.issues.push(Sa(o,a.value,s._zod.def));else{const g=o;g.fatal&&(g.continue=!1),g.code??(g.code="custom"),g.input??(g.input=a.value),g.inst??(g.inst=s),g.continue??(g.continue=!s._zod.def.abort),a.issues.push(Sa(g))}},i(a.value,a)));return s}function yx(i,s){const a=new ni({check:"custom",...xe(s)});return a._zod.check=i,a}function nv(i){let s=(i==null?void 0:i.target)??"draft-2020-12";return s==="draft-4"&&(s="draft-04"),s==="draft-7"&&(s="draft-07"),{processors:i.processors??{},metadataRegistry:(i==null?void 0:i.metadata)??ga,target:s,unrepresentable:(i==null?void 0:i.unrepresentable)??"throw",override:(i==null?void 0:i.override)??(()=>{}),io:(i==null?void 0:i.io)??"output",counter:0,seen:new Map,cycles:(i==null?void 0:i.cycles)??"ref",reused:(i==null?void 0:i.reused)??"inline",external:(i==null?void 0:i.external)??void 0}}function Tt(i,s,a={path:[],schemaPath:[]}){var y,m;var o;const g=i._zod.def,w=s.seen.get(i);if(w)return w.count++,a.schemaPath.includes(i)&&(w.cycle=a.path),w.schema;const T={schema:{},count:1,cycle:void 0,path:a.path};s.seen.set(i,T);const l=(m=(y=i._zod).toJSONSchema)==null?void 0:m.call(y);if(l)T.schema=l;else{const b={...a,schemaPath:[...a.schemaPath,i],path:a.path};if(i._zod.processJSONSchema)i._zod.processJSONSchema(s,T.schema,b);else{const k=T.schema,C=s.processors[g.type];if(!C)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${g.type}`);C(i,s,k,b)}const x=i._zod.parent;x&&(T.ref||(T.ref=x),Tt(x,s,b),s.seen.get(x).isParent=!0)}const h=s.metadataRegistry.get(i);return h&&Object.assign(T.schema,h),s.io==="input"&&Wt(i)&&(delete T.schema.examples,delete T.schema.default),s.io==="input"&&T.schema._prefault&&((o=T.schema).default??(o.default=T.schema._prefault)),delete T.schema._prefault,s.seen.get(i).schema}function av(i,s){var T,l,h,u;const a=i.seen.get(s);if(!a)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=new Map;for(const y of i.seen.entries()){const m=(T=i.metadataRegistry.get(y[0]))==null?void 0:T.id;if(m){const b=o.get(m);if(b&&b!==y[0])throw new Error(`Duplicate schema id "${m}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(m,y[0])}}const g=y=>{var C;const m=i.target==="draft-2020-12"?"$defs":"definitions";if(i.external){const _=(C=i.external.registry.get(y[0]))==null?void 0:C.id,v=i.external.uri??(p=>p);if(_)return{ref:v(_)};const f=y[1].defId??y[1].schema.id??`schema${i.counter++}`;return y[1].defId=f,{defId:f,ref:`${v("__shared")}#/${m}/${f}`}}if(y[1]===a)return{ref:"#"};const x=`#/${m}/`,k=y[1].schema.id??`__schema${i.counter++}`;return{defId:k,ref:x+k}},w=y=>{if(y[1].schema.$ref)return;const m=y[1],{ref:b,defId:x}=g(y);m.def={...m.schema},x&&(m.defId=x);const k=m.schema;for(const C in k)delete k[C];k.$ref=b};if(i.cycles==="throw")for(const y of i.seen.entries()){const m=y[1];if(m.cycle)throw new Error(`Cycle detected: #/${(l=m.cycle)==null?void 0:l.join("/")}/<root>
252
+
253
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const y of i.seen.entries()){const m=y[1];if(s===y[0]){w(y);continue}if(i.external){const x=(h=i.external.registry.get(y[0]))==null?void 0:h.id;if(s!==y[0]&&x){w(y);continue}}if((u=i.metadataRegistry.get(y[0]))==null?void 0:u.id){w(y);continue}if(m.cycle){w(y);continue}if(m.count>1&&i.reused==="ref"){w(y);continue}}}function ov(i,s){var T,l,h;const a=i.seen.get(s);if(!a)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=u=>{const y=i.seen.get(u);if(y.ref===null)return;const m=y.def??y.schema,b={...m},x=y.ref;if(y.ref=null,x){o(x);const C=i.seen.get(x),_=C.schema;if(_.$ref&&(i.target==="draft-07"||i.target==="draft-04"||i.target==="openapi-3.0")?(m.allOf=m.allOf??[],m.allOf.push(_)):Object.assign(m,_),Object.assign(m,b),u._zod.parent===x)for(const f in m)f==="$ref"||f==="allOf"||f in b||delete m[f];if(_.$ref&&C.def)for(const f in m)f==="$ref"||f==="allOf"||f in C.def&&JSON.stringify(m[f])===JSON.stringify(C.def[f])&&delete m[f]}const k=u._zod.parent;if(k&&k!==x){o(k);const C=i.seen.get(k);if(C!=null&&C.schema.$ref&&(m.$ref=C.schema.$ref,C.def))for(const _ in m)_==="$ref"||_==="allOf"||_ in C.def&&JSON.stringify(m[_])===JSON.stringify(C.def[_])&&delete m[_]}i.override({zodSchema:u,jsonSchema:m,path:y.path??[]})};for(const u of[...i.seen.entries()].reverse())o(u[0]);const g={};if(i.target==="draft-2020-12"?g.$schema="https://json-schema.org/draft/2020-12/schema":i.target==="draft-07"?g.$schema="http://json-schema.org/draft-07/schema#":i.target==="draft-04"?g.$schema="http://json-schema.org/draft-04/schema#":i.target,(T=i.external)!=null&&T.uri){const u=(l=i.external.registry.get(s))==null?void 0:l.id;if(!u)throw new Error("Schema is missing an `id` property");g.$id=i.external.uri(u)}Object.assign(g,a.def??a.schema);const w=((h=i.external)==null?void 0:h.defs)??{};for(const u of i.seen.entries()){const y=u[1];y.def&&y.defId&&(w[y.defId]=y.def)}i.external||Object.keys(w).length>0&&(i.target==="draft-2020-12"?g.$defs=w:g.definitions=w);try{const u=JSON.parse(JSON.stringify(g));return Object.defineProperty(u,"~standard",{value:{...s["~standard"],jsonSchema:{input:nl(s,"input",i.processors),output:nl(s,"output",i.processors)}},enumerable:!1,writable:!1}),u}catch{throw new Error("Error converting schema to JSON.")}}function Wt(i,s){const a=s??{seen:new Set};if(a.seen.has(i))return!1;a.seen.add(i);const o=i._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return Wt(o.element,a);if(o.type==="set")return Wt(o.valueType,a);if(o.type==="lazy")return Wt(o.getter(),a);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return Wt(o.innerType,a);if(o.type==="intersection")return Wt(o.left,a)||Wt(o.right,a);if(o.type==="record"||o.type==="map")return Wt(o.keyType,a)||Wt(o.valueType,a);if(o.type==="pipe")return Wt(o.in,a)||Wt(o.out,a);if(o.type==="object"){for(const g in o.shape)if(Wt(o.shape[g],a))return!0;return!1}if(o.type==="union"){for(const g of o.options)if(Wt(g,a))return!0;return!1}if(o.type==="tuple"){for(const g of o.items)if(Wt(g,a))return!0;return!!(o.rest&&Wt(o.rest,a))}return!1}const Sx=(i,s={})=>a=>{const o=nv({...a,processors:s});return Tt(i,o),av(o,i),ov(o,i)},nl=(i,s,a={})=>o=>{const{libraryOptions:g,target:w}=o??{},T=nv({...g??{},target:w,io:s,processors:a});return Tt(i,T),av(T,i),ov(T,i)},bx={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Cx=(i,s,a,o)=>{const g=a;g.type="string";const{minimum:w,maximum:T,format:l,patterns:h,contentEncoding:u}=i._zod.bag;if(typeof w=="number"&&(g.minLength=w),typeof T=="number"&&(g.maxLength=T),l&&(g.format=bx[l]??l,g.format===""&&delete g.format,l==="time"&&delete g.format),u&&(g.contentEncoding=u),h&&h.size>0){const y=[...h];y.length===1?g.pattern=y[0].source:y.length>1&&(g.allOf=[...y.map(m=>({...s.target==="draft-07"||s.target==="draft-04"||s.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},xx=(i,s,a,o)=>{const g=a,{minimum:w,maximum:T,format:l,multipleOf:h,exclusiveMaximum:u,exclusiveMinimum:y}=i._zod.bag;typeof l=="string"&&l.includes("int")?g.type="integer":g.type="number",typeof y=="number"&&(s.target==="draft-04"||s.target==="openapi-3.0"?(g.minimum=y,g.exclusiveMinimum=!0):g.exclusiveMinimum=y),typeof w=="number"&&(g.minimum=w,typeof y=="number"&&s.target!=="draft-04"&&(y>=w?delete g.minimum:delete g.exclusiveMinimum)),typeof u=="number"&&(s.target==="draft-04"||s.target==="openapi-3.0"?(g.maximum=u,g.exclusiveMaximum=!0):g.exclusiveMaximum=u),typeof T=="number"&&(g.maximum=T,typeof u=="number"&&s.target!=="draft-04"&&(u<=T?delete g.maximum:delete g.exclusiveMaximum)),typeof h=="number"&&(g.multipleOf=h)},wx=(i,s,a,o)=>{a.type="boolean"},Ex=(i,s,a,o)=>{a.not={}},Tx=(i,s,a,o)=>{},Ax=(i,s,a,o)=>{const g=i._zod.def,w=Up(g.entries);w.every(T=>typeof T=="number")&&(a.type="number"),w.every(T=>typeof T=="string")&&(a.type="string"),a.enum=w},Rx=(i,s,a,o)=>{if(s.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Dx=(i,s,a,o)=>{if(s.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},kx=(i,s,a,o)=>{const g=a,w=i._zod.def,{minimum:T,maximum:l}=i._zod.bag;typeof T=="number"&&(g.minItems=T),typeof l=="number"&&(g.maxItems=l),g.type="array",g.items=Tt(w.element,s,{...o,path:[...o.path,"items"]})},Ox=(i,s,a,o)=>{var u;const g=a,w=i._zod.def;g.type="object",g.properties={};const T=w.shape;for(const y in T)g.properties[y]=Tt(T[y],s,{...o,path:[...o.path,"properties",y]});const l=new Set(Object.keys(T)),h=new Set([...l].filter(y=>{const m=w.shape[y]._zod;return s.io==="input"?m.optin===void 0:m.optout===void 0}));h.size>0&&(g.required=Array.from(h)),((u=w.catchall)==null?void 0:u._zod.def.type)==="never"?g.additionalProperties=!1:w.catchall?w.catchall&&(g.additionalProperties=Tt(w.catchall,s,{...o,path:[...o.path,"additionalProperties"]})):s.io==="output"&&(g.additionalProperties=!1)},Mx=(i,s,a,o)=>{const g=i._zod.def,w=g.inclusive===!1,T=g.options.map((l,h)=>Tt(l,s,{...o,path:[...o.path,w?"oneOf":"anyOf",h]}));w?a.oneOf=T:a.anyOf=T},Lx=(i,s,a,o)=>{const g=i._zod.def,w=Tt(g.left,s,{...o,path:[...o.path,"allOf",0]}),T=Tt(g.right,s,{...o,path:[...o.path,"allOf",1]}),l=u=>"allOf"in u&&Object.keys(u).length===1,h=[...l(w)?w.allOf:[w],...l(T)?T.allOf:[T]];a.allOf=h},Nx=(i,s,a,o)=>{const g=a,w=i._zod.def;g.type="object";const T=w.keyType,l=T._zod.bag,h=l==null?void 0:l.patterns;if(w.mode==="loose"&&h&&h.size>0){const y=Tt(w.valueType,s,{...o,path:[...o.path,"patternProperties","*"]});g.patternProperties={};for(const m of h)g.patternProperties[m.source]=y}else(s.target==="draft-07"||s.target==="draft-2020-12")&&(g.propertyNames=Tt(w.keyType,s,{...o,path:[...o.path,"propertyNames"]})),g.additionalProperties=Tt(w.valueType,s,{...o,path:[...o.path,"additionalProperties"]});const u=T._zod.values;if(u){const y=[...u].filter(m=>typeof m=="string"||typeof m=="number");y.length>0&&(g.required=y)}},Bx=(i,s,a,o)=>{const g=i._zod.def,w=Tt(g.innerType,s,o),T=s.seen.get(i);s.target==="openapi-3.0"?(T.ref=g.innerType,a.nullable=!0):a.anyOf=[w,{type:"null"}]},zx=(i,s,a,o)=>{const g=i._zod.def;Tt(g.innerType,s,o);const w=s.seen.get(i);w.ref=g.innerType},jx=(i,s,a,o)=>{const g=i._zod.def;Tt(g.innerType,s,o);const w=s.seen.get(i);w.ref=g.innerType,a.default=JSON.parse(JSON.stringify(g.defaultValue))},Hx=(i,s,a,o)=>{const g=i._zod.def;Tt(g.innerType,s,o);const w=s.seen.get(i);w.ref=g.innerType,s.io==="input"&&(a._prefault=JSON.parse(JSON.stringify(g.defaultValue)))},Ux=(i,s,a,o)=>{const g=i._zod.def;Tt(g.innerType,s,o);const w=s.seen.get(i);w.ref=g.innerType;let T;try{T=g.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}a.default=T},Ix=(i,s,a,o)=>{const g=i._zod.def,w=s.io==="input"?g.in._zod.def.type==="transform"?g.out:g.in:g.out;Tt(w,s,o);const T=s.seen.get(i);T.ref=w},Px=(i,s,a,o)=>{const g=i._zod.def;Tt(g.innerType,s,o);const w=s.seen.get(i);w.ref=g.innerType,a.readOnly=!0},lv=(i,s,a,o)=>{const g=i._zod.def;Tt(g.innerType,s,o);const w=s.seen.get(i);w.ref=g.innerType},$x=fe("ZodISODateTime",(i,s)=>{q1.init(i,s),lt.init(i,s)});function Fx(i){return VC($x,i)}const Zx=fe("ZodISODate",(i,s)=>{G1.init(i,s),lt.init(i,s)});function qx(i){return XC(Zx,i)}const Gx=fe("ZodISOTime",(i,s)=>{W1.init(i,s),lt.init(i,s)});function Wx(i){return JC(Gx,i)}const Yx=fe("ZodISODuration",(i,s)=>{Y1.init(i,s),lt.init(i,s)});function Kx(i){return QC(Yx,i)}const Vx=(i,s)=>{Fp.init(i,s),i.name="ZodError",Object.defineProperties(i,{format:{value:a=>Hb(i,a)},flatten:{value:a=>jb(i,a)},addIssue:{value:a=>{i.issues.push(a),i.message=JSON.stringify(i.issues,Qu,2)}},addIssues:{value:a=>{i.issues.push(...a),i.message=JSON.stringify(i.issues,Qu,2)}},isEmpty:{get(){return i.issues.length===0}}})},Mi=fe("ZodError",Vx,{Parent:Error}),Xx=mh(Mi),Jx=ph(Mi),Qx=_l(Mi),ew=ml(Mi),tw=Pb(Mi),iw=$b(Mi),rw=Fb(Mi),sw=Zb(Mi),nw=qb(Mi),aw=Gb(Mi),ow=Wb(Mi),lw=Yb(Mi),_t=fe("ZodType",(i,s)=>(dt.init(i,s),Object.assign(i["~standard"],{jsonSchema:{input:nl(i,"input"),output:nl(i,"output")}}),i.toJSONSchema=Sx(i,{}),i.def=s,i.type=s.type,Object.defineProperty(i,"_def",{value:s}),i.check=(...a)=>i.clone(Kr(s,{checks:[...s.checks??[],...a.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0}),i.with=i.check,i.clone=(a,o)=>Vr(i,a,o),i.brand=()=>i,i.register=((a,o)=>(a.add(i,o),i)),i.parse=(a,o)=>Xx(i,a,o,{callee:i.parse}),i.safeParse=(a,o)=>Qx(i,a,o),i.parseAsync=async(a,o)=>Jx(i,a,o,{callee:i.parseAsync}),i.safeParseAsync=async(a,o)=>ew(i,a,o),i.spa=i.safeParseAsync,i.encode=(a,o)=>tw(i,a,o),i.decode=(a,o)=>iw(i,a,o),i.encodeAsync=async(a,o)=>rw(i,a,o),i.decodeAsync=async(a,o)=>sw(i,a,o),i.safeEncode=(a,o)=>nw(i,a,o),i.safeDecode=(a,o)=>aw(i,a,o),i.safeEncodeAsync=async(a,o)=>ow(i,a,o),i.safeDecodeAsync=async(a,o)=>lw(i,a,o),i.refine=(a,o)=>i.check(tE(a,o)),i.superRefine=a=>i.check(iE(a)),i.overwrite=a=>i.check(cn(a)),i.optional=()=>Fm(i),i.exactOptional=()=>$w(i),i.nullable=()=>Zm(i),i.nullish=()=>Fm(Zm(i)),i.nonoptional=a=>Yw(i,a),i.array=()=>vl(i),i.or=a=>Bw([i,a]),i.and=a=>jw(i,a),i.transform=a=>qm(i,Iw(a)),i.default=a=>qw(i,a),i.prefault=a=>Ww(i,a),i.catch=a=>Vw(i,a),i.pipe=a=>qm(i,a),i.readonly=()=>Qw(i),i.describe=a=>{const o=i.clone();return ga.add(o,{description:a}),o},Object.defineProperty(i,"description",{get(){var a;return(a=ga.get(i))==null?void 0:a.description},configurable:!0}),i.meta=(...a)=>{if(a.length===0)return ga.get(i);const o=i.clone();return ga.add(o,a[0]),o},i.isOptional=()=>i.safeParse(void 0).success,i.isNullable=()=>i.safeParse(null).success,i.apply=a=>a(i),i)),cv=fe("_ZodString",(i,s)=>{vh.init(i,s),_t.init(i,s),i._zod.processJSONSchema=(o,g,w)=>Cx(i,o,g);const a=i._zod.bag;i.format=a.format??null,i.minLength=a.minimum??null,i.maxLength=a.maximum??null,i.regex=(...o)=>i.check(nx(...o)),i.includes=(...o)=>i.check(lx(...o)),i.startsWith=(...o)=>i.check(cx(...o)),i.endsWith=(...o)=>i.check(ux(...o)),i.min=(...o)=>i.check(sl(...o)),i.max=(...o)=>i.check(rv(...o)),i.length=(...o)=>i.check(sv(...o)),i.nonempty=(...o)=>i.check(sl(1,...o)),i.lowercase=o=>i.check(ax(o)),i.uppercase=o=>i.check(ox(o)),i.trim=()=>i.check(fx()),i.normalize=(...o)=>i.check(hx(...o)),i.toLowerCase=()=>i.check(dx()),i.toUpperCase=()=>i.check(_x()),i.slugify=()=>i.check(mx())}),cw=fe("ZodString",(i,s)=>{vh.init(i,s),cv.init(i,s),i.email=a=>i.check(DC(uw,a)),i.url=a=>i.check(NC(hw,a)),i.jwt=a=>i.check(KC(Tw,a)),i.emoji=a=>i.check(BC(fw,a)),i.guid=a=>i.check(jm(Pm,a)),i.uuid=a=>i.check(kC(qo,a)),i.uuidv4=a=>i.check(OC(qo,a)),i.uuidv6=a=>i.check(MC(qo,a)),i.uuidv7=a=>i.check(LC(qo,a)),i.nanoid=a=>i.check(zC(dw,a)),i.guid=a=>i.check(jm(Pm,a)),i.cuid=a=>i.check(jC(_w,a)),i.cuid2=a=>i.check(HC(mw,a)),i.ulid=a=>i.check(UC(pw,a)),i.base64=a=>i.check(GC(xw,a)),i.base64url=a=>i.check(WC(ww,a)),i.xid=a=>i.check(IC(vw,a)),i.ksuid=a=>i.check(PC(gw,a)),i.ipv4=a=>i.check($C(yw,a)),i.ipv6=a=>i.check(FC(Sw,a)),i.cidrv4=a=>i.check(ZC(bw,a)),i.cidrv6=a=>i.check(qC(Cw,a)),i.e164=a=>i.check(YC(Ew,a)),i.datetime=a=>i.check(Fx(a)),i.date=a=>i.check(qx(a)),i.time=a=>i.check(Wx(a)),i.duration=a=>i.check(Kx(a))});function Ie(i){return RC(cw,i)}const lt=fe("ZodStringFormat",(i,s)=>{st.init(i,s),cv.init(i,s)}),uw=fe("ZodEmail",(i,s)=>{z1.init(i,s),lt.init(i,s)}),Pm=fe("ZodGUID",(i,s)=>{N1.init(i,s),lt.init(i,s)}),qo=fe("ZodUUID",(i,s)=>{B1.init(i,s),lt.init(i,s)}),hw=fe("ZodURL",(i,s)=>{j1.init(i,s),lt.init(i,s)}),fw=fe("ZodEmoji",(i,s)=>{H1.init(i,s),lt.init(i,s)}),dw=fe("ZodNanoID",(i,s)=>{U1.init(i,s),lt.init(i,s)}),_w=fe("ZodCUID",(i,s)=>{I1.init(i,s),lt.init(i,s)}),mw=fe("ZodCUID2",(i,s)=>{P1.init(i,s),lt.init(i,s)}),pw=fe("ZodULID",(i,s)=>{$1.init(i,s),lt.init(i,s)}),vw=fe("ZodXID",(i,s)=>{F1.init(i,s),lt.init(i,s)}),gw=fe("ZodKSUID",(i,s)=>{Z1.init(i,s),lt.init(i,s)}),yw=fe("ZodIPv4",(i,s)=>{K1.init(i,s),lt.init(i,s)}),Sw=fe("ZodIPv6",(i,s)=>{V1.init(i,s),lt.init(i,s)}),bw=fe("ZodCIDRv4",(i,s)=>{X1.init(i,s),lt.init(i,s)}),Cw=fe("ZodCIDRv6",(i,s)=>{J1.init(i,s),lt.init(i,s)}),xw=fe("ZodBase64",(i,s)=>{Q1.init(i,s),lt.init(i,s)}),ww=fe("ZodBase64URL",(i,s)=>{tC.init(i,s),lt.init(i,s)}),Ew=fe("ZodE164",(i,s)=>{iC.init(i,s),lt.init(i,s)}),Tw=fe("ZodJWT",(i,s)=>{sC.init(i,s),lt.init(i,s)}),uv=fe("ZodNumber",(i,s)=>{Qp.init(i,s),_t.init(i,s),i._zod.processJSONSchema=(o,g,w)=>xx(i,o,g),i.gt=(o,g)=>i.check(Um(o,g)),i.gte=(o,g)=>i.check(Hu(o,g)),i.min=(o,g)=>i.check(Hu(o,g)),i.lt=(o,g)=>i.check(Hm(o,g)),i.lte=(o,g)=>i.check(ju(o,g)),i.max=(o,g)=>i.check(ju(o,g)),i.int=o=>i.check($m(o)),i.safe=o=>i.check($m(o)),i.positive=o=>i.check(Um(0,o)),i.nonnegative=o=>i.check(Hu(0,o)),i.negative=o=>i.check(Hm(0,o)),i.nonpositive=o=>i.check(ju(0,o)),i.multipleOf=(o,g)=>i.check(Im(o,g)),i.step=(o,g)=>i.check(Im(o,g)),i.finite=()=>i;const a=i._zod.bag;i.minValue=Math.max(a.minimum??Number.NEGATIVE_INFINITY,a.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,i.maxValue=Math.min(a.maximum??Number.POSITIVE_INFINITY,a.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,i.isInt=(a.format??"").includes("int")||Number.isSafeInteger(a.multipleOf??.5),i.isFinite=!0,i.format=a.format??null});function Oe(i){return ex(uv,i)}const Aw=fe("ZodNumberFormat",(i,s)=>{nC.init(i,s),uv.init(i,s)});function $m(i){return tx(Aw,i)}const Rw=fe("ZodBoolean",(i,s)=>{aC.init(i,s),_t.init(i,s),i._zod.processJSONSchema=(a,o,g)=>wx(i,a,o)});function yr(i){return ix(Rw,i)}const Dw=fe("ZodUnknown",(i,s)=>{oC.init(i,s),_t.init(i,s),i._zod.processJSONSchema=(a,o,g)=>Tx()});function al(){return rx(Dw)}const kw=fe("ZodNever",(i,s)=>{lC.init(i,s),_t.init(i,s),i._zod.processJSONSchema=(a,o,g)=>Ex(i,a,o)});function Ow(i){return sx(kw,i)}const Mw=fe("ZodArray",(i,s)=>{cC.init(i,s),_t.init(i,s),i._zod.processJSONSchema=(a,o,g)=>kx(i,a,o,g),i.element=s.element,i.min=(a,o)=>i.check(sl(a,o)),i.nonempty=a=>i.check(sl(1,a)),i.max=(a,o)=>i.check(rv(a,o)),i.length=(a,o)=>i.check(sv(a,o)),i.unwrap=()=>i.element});function vl(i,s){return px(Mw,i,s)}const Lw=fe("ZodObject",(i,s)=>{hC.init(i,s),_t.init(i,s),i._zod.processJSONSchema=(a,o,g)=>Ox(i,a,o,g),We(i,"shape",()=>s.shape),i.keyof=()=>nn(Object.keys(i._zod.def.shape)),i.catchall=a=>i.clone({...i._zod.def,catchall:a}),i.passthrough=()=>i.clone({...i._zod.def,catchall:al()}),i.loose=()=>i.clone({...i._zod.def,catchall:al()}),i.strict=()=>i.clone({...i._zod.def,catchall:Ow()}),i.strip=()=>i.clone({...i._zod.def,catchall:void 0}),i.extend=a=>Mb(i,a),i.safeExtend=a=>Lb(i,a),i.merge=a=>Nb(i,a),i.pick=a=>kb(i,a),i.omit=a=>Ob(i,a),i.partial=(...a)=>Bb(hv,i,a[0]),i.required=(...a)=>zb(fv,i,a[0])});function Lt(i,s){const a={type:"object",shape:i??{},...xe(s)};return new Lw(a)}const Nw=fe("ZodUnion",(i,s)=>{fC.init(i,s),_t.init(i,s),i._zod.processJSONSchema=(a,o,g)=>Mx(i,a,o,g),i.options=s.options});function Bw(i,s){return new Nw({type:"union",options:i,...xe(s)})}const zw=fe("ZodIntersection",(i,s)=>{dC.init(i,s),_t.init(i,s),i._zod.processJSONSchema=(a,o,g)=>Lx(i,a,o,g)});function jw(i,s){return new zw({type:"intersection",left:i,right:s})}const Hw=fe("ZodRecord",(i,s)=>{_C.init(i,s),_t.init(i,s),i._zod.processJSONSchema=(a,o,g)=>Nx(i,a,o,g),i.keyType=s.keyType,i.valueType=s.valueType});function gl(i,s,a){return new Hw({type:"record",keyType:i,valueType:s,...xe(a)})}const th=fe("ZodEnum",(i,s)=>{mC.init(i,s),_t.init(i,s),i._zod.processJSONSchema=(o,g,w)=>Ax(i,o,g),i.enum=s.entries,i.options=Object.values(s.entries);const a=new Set(Object.keys(s.entries));i.extract=(o,g)=>{const w={};for(const T of o)if(a.has(T))w[T]=s.entries[T];else throw new Error(`Key ${T} not found in enum`);return new th({...s,checks:[],...xe(g),entries:w})},i.exclude=(o,g)=>{const w={...s.entries};for(const T of o)if(a.has(T))delete w[T];else throw new Error(`Key ${T} not found in enum`);return new th({...s,checks:[],...xe(g),entries:w})}});function nn(i,s){const a=Array.isArray(i)?Object.fromEntries(i.map(o=>[o,o])):i;return new th({type:"enum",entries:a,...xe(s)})}const Uw=fe("ZodTransform",(i,s)=>{pC.init(i,s),_t.init(i,s),i._zod.processJSONSchema=(a,o,g)=>Dx(i,a),i._zod.parse=(a,o)=>{if(o.direction==="backward")throw new jp(i.constructor.name);a.addIssue=w=>{if(typeof w=="string")a.issues.push(Sa(w,a.value,s));else{const T=w;T.fatal&&(T.continue=!1),T.code??(T.code="custom"),T.input??(T.input=a.value),T.inst??(T.inst=i),a.issues.push(Sa(T))}};const g=s.transform(a.value,a);return g instanceof Promise?g.then(w=>(a.value=w,a)):(a.value=g,a)}});function Iw(i){return new Uw({type:"transform",transform:i})}const hv=fe("ZodOptional",(i,s)=>{iv.init(i,s),_t.init(i,s),i._zod.processJSONSchema=(a,o,g)=>lv(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function Fm(i){return new hv({type:"optional",innerType:i})}const Pw=fe("ZodExactOptional",(i,s)=>{vC.init(i,s),_t.init(i,s),i._zod.processJSONSchema=(a,o,g)=>lv(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function $w(i){return new Pw({type:"optional",innerType:i})}const Fw=fe("ZodNullable",(i,s)=>{gC.init(i,s),_t.init(i,s),i._zod.processJSONSchema=(a,o,g)=>Bx(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function Zm(i){return new Fw({type:"nullable",innerType:i})}const Zw=fe("ZodDefault",(i,s)=>{yC.init(i,s),_t.init(i,s),i._zod.processJSONSchema=(a,o,g)=>jx(i,a,o,g),i.unwrap=()=>i._zod.def.innerType,i.removeDefault=i.unwrap});function qw(i,s){return new Zw({type:"default",innerType:i,get defaultValue(){return typeof s=="function"?s():Pp(s)}})}const Gw=fe("ZodPrefault",(i,s)=>{SC.init(i,s),_t.init(i,s),i._zod.processJSONSchema=(a,o,g)=>Hx(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function Ww(i,s){return new Gw({type:"prefault",innerType:i,get defaultValue(){return typeof s=="function"?s():Pp(s)}})}const fv=fe("ZodNonOptional",(i,s)=>{bC.init(i,s),_t.init(i,s),i._zod.processJSONSchema=(a,o,g)=>zx(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function Yw(i,s){return new fv({type:"nonoptional",innerType:i,...xe(s)})}const Kw=fe("ZodCatch",(i,s)=>{CC.init(i,s),_t.init(i,s),i._zod.processJSONSchema=(a,o,g)=>Ux(i,a,o,g),i.unwrap=()=>i._zod.def.innerType,i.removeCatch=i.unwrap});function Vw(i,s){return new Kw({type:"catch",innerType:i,catchValue:typeof s=="function"?s:()=>s})}const Xw=fe("ZodPipe",(i,s)=>{xC.init(i,s),_t.init(i,s),i._zod.processJSONSchema=(a,o,g)=>Ix(i,a,o,g),i.in=s.in,i.out=s.out});function qm(i,s){return new Xw({type:"pipe",in:i,out:s})}const Jw=fe("ZodReadonly",(i,s)=>{wC.init(i,s),_t.init(i,s),i._zod.processJSONSchema=(a,o,g)=>Px(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function Qw(i){return new Jw({type:"readonly",innerType:i})}const eE=fe("ZodCustom",(i,s)=>{EC.init(i,s),_t.init(i,s),i._zod.processJSONSchema=(a,o,g)=>Rx(i,a)});function tE(i,s={}){return vx(eE,i,s)}function iE(i){return gx(i)}const gh=nn(["idle","working","compacting","context_warning","waiting_for_input","permission_prompt","plan_mode","ask_question","bash_approval","settings","error","unknown"]),dv=Lt({ok:yr()}),rE=dv.extend({delivered:yr(),attempts:Oe()}),sE=Lt({status:Ie(),version:Ie(),uptime:Oe(),sessions:Lt({active:Oe(),total:Oe()}),timestamp:Ie()}),yh=Lt({id:Ie(),windowId:Ie(),windowName:Ie(),workDir:Ie(),claudeSessionId:Ie().optional(),jsonlPath:Ie().optional(),byteOffset:Oe(),monitorOffset:Oe(),status:gh,createdAt:Oe(),lastActivity:Oe(),stallThresholdMs:Oe(),permissionMode:Ie(),autoApprove:yr().optional(),settingsPatched:yr().optional(),promptDelivery:Lt({delivered:yr(),attempts:Oe()}).optional(),actionHints:gl(Ie(),Lt({method:Ie(),url:Ie(),description:Ie()})).optional()}),nE=Lt({sessions:vl(yh),pagination:Lt({page:Oe(),limit:Oe(),total:Oe(),totalPages:Oe()})}),aE=Lt({alive:yr(),windowExists:yr(),claudeRunning:yr(),paneCommand:Ie().nullable(),status:gh,hasTranscript:yr(),lastActivity:Oe(),lastActivityAgo:Oe(),sessionAge:Oe(),details:Ie(),actionHints:gl(Ie(),Lt({method:Ie(),url:Ie(),description:Ie()})).optional()}),oE=Lt({durationSec:Oe(),messages:Oe(),toolCalls:Oe(),approvals:Oe(),autoApprovals:Oe(),statusChanges:vl(Ie())}),lE=Lt({role:nn(["user","assistant","system"]),contentType:nn(["text","thinking","tool_use","tool_result","permission_request"]),text:Ie(),toolName:Ie().optional(),toolUseId:Ie().optional(),timestamp:Ie().optional()}),cE=Lt({messages:vl(lE),status:gh,statusText:Ie().nullable(),interactiveContent:Ie().nullable()}),uE=Lt({uptime:Oe(),sessions:Lt({total_created:Oe(),currently_active:Oe(),completed:Oe(),failed:Oe(),avg_duration_sec:Oe(),avg_messages_per_session:Oe()}),auto_approvals:Oe(),webhooks_sent:Oe(),webhooks_failed:Oe(),screenshots_taken:Oe(),pipelines_created:Oe(),batches_created:Oe(),prompt_delivery:Lt({sent:Oe(),delivered:Oe(),failed:Oe(),success_rate:Oe().nullable()})}),hE=nn(["status","message","approval","ended","heartbeat","stall","dead","system","hook","subagent_start","subagent_stop"]),fE=Lt({event:hE,sessionId:Ie(),timestamp:Ie(),data:gl(Ie(),al()).optional()}),dE=nn(["session_status_change","session_message","session_approval","session_ended","session_created","session_stall","session_dead","session_subagent_start","session_subagent_stop"]),_E=Lt({event:dE,sessionId:Ie(),timestamp:Ie(),data:gl(Ie(),al())}),mE=3e4,pE=300*1e3;class ol{constructor(s,a,o={}){Et(this,"eventSource",null);Et(this,"consecutiveFailures",0);Et(this,"failStartTime",null);Et(this,"destroyed",!1);Et(this,"gaveUp",!1);Et(this,"reconnectTimer",null);Et(this,"url");Et(this,"callbacks");Et(this,"onMessage");this.url=s,this.onMessage=a,this.callbacks=o,this.connect()}connect(){this.destroyed||(this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.eventSource&&(this.eventSource.close(),this.eventSource=null),this.eventSource=new EventSource(this.url),this.eventSource.onmessage=this.onMessage,this.eventSource.onopen=()=>{var s,a;this.destroyed||(this.consecutiveFailures=0,this.failStartTime=null,this.gaveUp=!1,(a=(s=this.callbacks).onOpen)==null||a.call(s))},this.eventSource.onerror=()=>{var a,o,g,w,T,l,h;if(this.destroyed)return;if((a=this.eventSource)==null||a.close(),this.eventSource=null,this.failStartTime===null&&(this.failStartTime=Date.now()),Date.now()-this.failStartTime>=pE){this.gaveUp||(this.gaveUp=!0,(g=(o=this.callbacks).onGiveUp)==null||g.call(o),(T=(w=this.callbacks).onClose)==null||T.call(w));return}this.consecutiveFailures++;const s=Math.min(mE,1e3*Math.pow(2,this.consecutiveFailures-1));(h=(l=this.callbacks).onReconnecting)==null||h.call(l,this.consecutiveFailures,s),this.reconnectTimer=setTimeout(()=>this.connect(),s)})}close(){var s;this.destroyed=!0,this.reconnectTimer&&clearTimeout(this.reconnectTimer),(s=this.eventSource)==null||s.close(),this.eventSource=null}}const vE="";function gE(i){if(!i)return{};if(i instanceof Headers){const s={};return i.forEach((a,o)=>{s[o]=a}),s}return i}function yE(i,s,a){const o=s.safeParse(i);if(o.success)return o.data;throw console.error(`[aegis] API response validation failed (${a}):`,o.error.issues),new Error(`API response validation failed for ${a}: ${o.error.issues.map(g=>g.message).join(", ")}`)}function SE(i){return!(i.name==="AbortError"||!i.message||i.message.includes("HTTP "))}async function gt(i,s={}){const a=localStorage.getItem("aegis_token"),o={"Content-Type":"application/json",...a?{Authorization:`Bearer ${a}`}:{},...gE(s.headers)},{retries:g=0,schema:w,schemaContext:T,...l}=s;let h=null;for(let u=0;u<=g;u++)try{const y=await fetch(`${vE}${i}`,{...l,headers:o});if(!y.ok){const b=await y.json().catch(()=>({error:y.statusText})),x=new Error(b.error??`HTTP ${y.status}`);throw x.statusCode=y.status,x}const m=await y.json();return w?yE(m,w,T??i):m}catch(y){if(h=y,u<g&&SE(h))await new Promise(m=>setTimeout(m,1e3*Math.pow(2,u)));else throw h}throw h}function bE(){return gt("/v1/health",{schema:sE,schemaContext:"getHealth"})}function CE(){return gt("/v1/metrics",{schema:uE,schemaContext:"getMetrics"})}function xE(){return gt("/v1/sessions",{schema:nE,schemaContext:"getSessions"})}function wE(i){return gt(`/v1/sessions/${encodeURIComponent(i)}`,{schema:yh,schemaContext:"getSession"})}function EE(i){const{signal:s,...a}=i;return gt("/v1/sessions",{method:"POST",body:JSON.stringify(a),signal:s,schema:yh,schemaContext:"createSession"})}function _v(i){return gt(`/v1/sessions/${encodeURIComponent(i)}`,{method:"DELETE",schema:dv,schemaContext:"killSession"})}function TE(i){return gt(`/v1/sessions/${encodeURIComponent(i)}/health`,{schema:aE,schemaContext:"getSessionHealth"})}function AE(){return gt("/v1/sessions/health")}function RE(i){return gt(`/v1/sessions/${encodeURIComponent(i)}/read`,{schema:cE,schemaContext:"getSessionMessages"})}function DE(i){return gt(`/v1/sessions/${encodeURIComponent(i)}/metrics`,{schema:oE,schemaContext:"getSessionMetrics"})}function kE(i){return gt(`/v1/sessions/${encodeURIComponent(i)}/pane`)}function OE(i,s){return gt(`/v1/sessions/${encodeURIComponent(i)}/send`,{method:"POST",body:JSON.stringify({text:s}),schema:rE,schemaContext:"sendMessage"})}function mv(i){return gt(`/v1/sessions/${encodeURIComponent(i)}/approve`,{method:"POST"})}function ME(i){return gt(`/v1/sessions/${encodeURIComponent(i)}/reject`,{method:"POST"})}function pv(i){return gt(`/v1/sessions/${encodeURIComponent(i)}/interrupt`,{method:"POST"})}function LE(i){return gt(`/v1/sessions/${encodeURIComponent(i)}/escape`,{method:"POST"})}const Gm=3,NE=1e3;async function vv(i,s){for(let a=0;a<Gm;a++){if(s!=null&&s.aborted)throw new DOMException("Aborted","AbortError");try{return await IE(s)}catch{if(s!=null&&s.aborted)throw new DOMException("Aborted","AbortError");if(a<Gm-1){const o=NE*Math.pow(2,a);await new Promise(g=>{const w=setTimeout(g,o);s==null||s.addEventListener("abort",()=>{clearTimeout(w),g(void 0)},{once:!0})})}}}throw i==null||i(),new Error("Real-time updates unavailable")}function gv(i,s,a,o){const g=`/v1/sessions/${encodeURIComponent(i)}/events`;let w=null,T=!1;const l=new AbortController;return a?vv(o==null?void 0:o.onGiveUp,l.signal).then(h=>{if(T)return;const u=`${g}?token=${encodeURIComponent(h.token)}`;w=new ol(u,s,o)}).catch(()=>{}):w=new ol(g,s,o),()=>{T=!0,l.abort(),w==null||w.close()}}function BE(i,s,a){const o="/v1/events";let g=null,w=!1;const T=new AbortController,l=h=>{try{const u=_E.safeParse(JSON.parse(h.data));if(!u.success){console.warn("Global SSE event failed validation",u.error.message);return}i(u.data)}catch{}};return s?vv(a==null?void 0:a.onGiveUp,T.signal).then(h=>{if(w)return;const u=`${o}?token=${encodeURIComponent(h.token)}`;g=new ol(u,l,a)}).catch(()=>{}):g=new ol(o,l,a),()=>{var h;w=!0,T.abort(),(h=a==null?void 0:a.onClose)==null||h.call(a),g==null||g.close()}}function zE(i){const{signal:s,...a}=i;return gt("/v1/sessions/batch",{method:"POST",signal:s,body:JSON.stringify(a)})}function jE(i){return gt("/v1/pipelines",{method:"POST",body:JSON.stringify(i)})}function HE(){return gt("/v1/pipelines")}function UE(i){return gt(`/v1/pipelines/${encodeURIComponent(i)}`)}function IE(i){return gt("/v1/auth/sse-token",{method:"POST",signal:i})}const Go=new Map;let PE=0;const Xr=zp(i=>({toasts:[],addToast:(s,a,o)=>{const g=`toast-${++PE}`,w=setTimeout(()=>{Go.delete(g),i(T=>({toasts:T.toasts.filter(l=>l.id!==g)}))},4e3);return Go.set(g,w),i(T=>({toasts:[...T.toasts,{id:g,type:s,title:a,description:o}]})),g},removeToast:s=>{const a=Go.get(s);a&&(clearTimeout(a),Go.delete(s)),i(o=>({toasts:o.toasts.filter(g=>g.id!==s)}))}})),$E={error:"border-red-500/50 bg-red-950/80 text-red-200",success:"border-green-500/50 bg-green-950/80 text-green-200",info:"border-cyan-500/50 bg-cyan-950/80 text-cyan-200",warning:"border-yellow-500/50 bg-yellow-950/80 text-yellow-200"};function FE({id:i,type:s,title:a,description:o}){const g=Xr(w=>w.removeToast);return O.jsxs("div",{role:"alert",className:`flex items-start gap-3 rounded-lg border px-4 py-3 shadow-lg backdrop-blur-sm animate-slide-in ${$E[s]}`,children:[O.jsxs("div",{className:"flex-1 min-w-0",children:[O.jsx("p",{className:"text-sm font-medium",children:a}),o&&O.jsx("p",{className:"mt-0.5 text-xs opacity-80",children:o})]}),O.jsx("button",{onClick:()=>g(i),className:"shrink-0 rounded p-0.5 opacity-60 hover:opacity-100 transition-opacity","aria-label":"Dismiss",children:O.jsx(fl,{className:"h-3.5 w-3.5"})})]})}function ZE(){const i=Xr(s=>s.toasts);return i.length===0?null:O.jsx("div",{className:"fixed bottom-4 right-4 z-50 flex flex-col gap-2 max-w-sm w-full pointer-events-none",children:i.map(s=>O.jsx("div",{className:"pointer-events-auto",children:O.jsx(FE,{id:s.id,type:s.type,title:s.title,description:s.description})},s.id))})}const qE=[{to:"/",label:"Overview",icon:ZS},{to:"/pipelines",label:"Pipelines",icon:kp}],GE=5,WE=1e3;function YE(){const i=ft(u=>u.sseConnected),s=ft(u=>u.setSseConnected),a=ft(u=>u.sseError),o=ft(u=>u.setSseError),g=ft(u=>u.addActivity),w=ft(u=>u.token),T=F.useRef(null),[l,h]=F.useState(0);return F.useEffect(()=>{let u=!1,y,m=null;function b(x){if(!u)try{y=BE(k=>{k.sessionId&&g(k)},w,{onOpen:()=>{T.current&&(clearTimeout(T.current),T.current=null),s(!0),o(null),h(0)},onClose:()=>{T.current=setTimeout(()=>{s(!1)},2e3)},onGiveUp:()=>{o("SSE connection failed — real-time updates unavailable"),s(!1)}})}catch(k){if(console.error("Failed to subscribe to global SSE (attempt %d):",x+1,k),x<GE){const C=WE*Math.pow(2,x);h(x+1),m=setTimeout(()=>b(x+1),C)}else o("SSE subscription failed after retries — real-time updates unavailable"),s(!1)}}return b(0),()=>{u=!0,T.current&&clearTimeout(T.current),m&&clearTimeout(m),y==null||y()}},[s,o,g,w]),O.jsxs("div",{className:"flex h-screen overflow-hidden bg-void",children:[O.jsxs("aside",{className:"flex w-56 flex-col border-r border-void-lighter bg-void-light shrink-0",children:[O.jsxs("div",{className:"flex items-center gap-2 px-4 py-5 border-b border-void-lighter",children:[O.jsx(ob,{className:"h-6 w-6 text-cyan glow-text-cyan"}),O.jsx("span",{className:"text-lg font-semibold tracking-tight text-gray-100",children:"Aegis"})]}),O.jsxs("nav",{className:"flex flex-col gap-1 px-2 py-4 flex-1",children:[qE.map(({to:u,label:y,icon:m})=>O.jsxs(Ap,{to:u,end:u==="/",className:({isActive:b})=>`flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm font-medium transition-colors ${b?"bg-cyan/10 text-cyan":"text-gray-400 hover:bg-void-lighter hover:text-gray-200"}`,children:[O.jsx(m,{className:"h-4 w-4"}),y]},u)),O.jsx("div",{className:"mt-4 border-t border-void-lighter pt-4 opacity-40",children:O.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2 text-sm text-gray-500",children:[O.jsx(hb,{className:"h-4 w-4"}),"Sessions"]})})]})]}),O.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[O.jsxs("header",{className:"flex items-center justify-between border-b border-void-lighter bg-void-light px-6 py-3 shrink-0",children:[O.jsx("h1",{className:"text-sm font-medium text-gray-300",children:"Aegis Dashboard"}),O.jsx("div",{className:"flex items-center gap-3",children:O.jsx("div",{className:"flex items-center gap-1.5 text-xs text-gray-500",title:a??void 0,children:a?O.jsxs(O.Fragment,{children:[O.jsx(Bp,{className:"h-3 w-3 text-amber-500"}),O.jsxs("span",{className:"text-amber-500",children:["SSE Error",l>0?` (retry ${l})`:""]})]}):O.jsxs(O.Fragment,{children:[O.jsx("span",{className:`status-dot ${i?"status-dot--idle":""}`,style:i?void 0:{backgroundColor:"#666"}}),i?"SSE Live":"SSE Off"]})})})]}),O.jsx("main",{className:"flex-1 overflow-auto p-6",children:O.jsx(Gy,{})})]}),O.jsx(ZE,{})]})}function KE(i){if(i<0)return"0s";const s=Math.floor(i/3600),a=Math.floor(i%3600/60);return s>0&&a>0?`${s}h ${a}m`:s>0?`${s}h`:a>0?`${a}m`:`${Math.floor(i)}s`}function an(i){const s=Date.now()-i;if(s<0)return"just now";const a=Math.floor(s/1e3);if(a<60)return`${a}s ago`;const o=Math.floor(a/60);if(o<60)return`${o}m ago`;const g=Math.floor(o/60);return g<24?`${g}h ago`:`${Math.floor(g/24)}d ago`}function VE(i){if(i<0)return"0s";const s=Math.floor(i/1e3);if(s<60)return`${s}s`;const a=Math.floor(s/60),o=s%60;if(a<60)return`${a}m ${o.toString().padStart(2,"0")}s`;const g=Math.floor(a/60),w=a%60;return`${g}h ${w.toString().padStart(2,"0")}m`}function qr({label:i,value:s,icon:a,suffix:o}){return O.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-4",children:[O.jsxs("div",{className:"mb-2 flex items-center gap-2 text-sm text-[#888]",children:[a,i]}),O.jsxs("div",{className:"font-mono text-2xl text-[#00e5ff]",children:[s,o&&O.jsx("span",{className:"ml-1 text-base text-[#666]",children:o})]})]})}function XE(){const i=ft(y=>y.metrics),s=ft(y=>y.sseConnected),a=ft(y=>y.setMetrics),[o,g]=F.useState(null),w=F.useCallback(async()=>{try{const[y,m]=await Promise.all([CE(),bE()]);a(y),g(m)}catch(y){Xr.getState().addToast("error","Failed to load metrics",y instanceof Error?y.message:void 0)}},[a]);F.useEffect(()=>{if(w(),s)return;const y=setInterval(w,1e4);return()=>clearInterval(y)},[w,s]);const T=(i==null?void 0:i.sessions.currently_active)??(o==null?void 0:o.sessions.active)??0,l=(i==null?void 0:i.sessions.total_created)??(o==null?void 0:o.sessions.total)??0,h=i==null?void 0:i.prompt_delivery.success_rate,u=(o==null?void 0:o.uptime)??(i==null?void 0:i.uptime)??0;return O.jsxs("div",{className:"grid grid-cols-2 gap-4 lg:grid-cols-4",children:[O.jsx(qr,{label:"Active Sessions",value:T,icon:O.jsx(kp,{className:"h-4 w-4"})}),O.jsx(qr,{label:"Total Created",value:l,icon:O.jsx($S,{className:"h-4 w-4"})}),O.jsx(qr,{label:"Delivery Rate",value:h!=null?h.toFixed(1):"—",suffix:"%",icon:O.jsx(Sb,{className:"h-4 w-4"})}),O.jsx(qr,{label:"Uptime",value:KE(u),icon:O.jsx(HS,{className:"h-4 w-4"})})]})}const Wm={idle:"#00ff88",working:"#00e5ff",permission_prompt:"#ffaa00",bash_approval:"#ffaa00",plan_mode:"#ff8800",ask_question:"#ff3366",settings:"#00e5ff",error:"#ff0000",compacting:"#ffaa00",context_warning:"#ffaa00",waiting_for_input:"#ffaa00",unknown:"#666666"},JE=new Set(["working","permission_prompt","bash_approval","ask_question"]);function yl({status:i}){const s=Wm[i]??Wm.unknown,a=JE.has(i);return O.jsx("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",backgroundColor:s,boxShadow:`0 0 6px ${s}66`,animation:a?"pulse 1.5s ease-in-out infinite":void 0}})}const yv=i=>i.status==="permission_prompt"||i.status==="bash_approval",Sv=(i,s=40)=>i.length>s?`…${i.slice(i.length-s+1)}`:i,QE=(i,s)=>i.id===s.id&&i.windowName===s.windowName&&i.workDir===s.workDir&&i.status===s.status&&i.createdAt===s.createdAt&&i.lastActivity===s.lastActivity&&i.permissionMode===s.permissionMode,bv=(i,s)=>QE(i.session,s.session)&&i.isAlive===s.isAlive&&i.currentAction===s.currentAction,e2=F.memo(function({session:s,isAlive:a,currentAction:o,onApprove:g,onInterrupt:w,onKill:T}){return O.jsxs(Hi,{to:`/sessions/${encodeURIComponent(s.id)}`,className:"block rounded-lg border border-[#1a1a2e] bg-[#111118] p-4 active:bg-[#1a1a2e]/50 transition-colors",children:[O.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[O.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[O.jsx(yl,{status:s.status}),O.jsx("span",{className:"truncate font-medium text-gray-200",children:s.windowName||s.id}),!a&&O.jsx(tl,{className:"h-3.5 w-3.5 shrink-0 text-red-400"})]}),O.jsxs("div",{className:"ml-2 flex shrink-0 items-center gap-1.5",children:[yv(s)&&O.jsx("button",{onClick:l=>g(l,s.id),disabled:o==="approve",className:"flex min-h-[44px] min-w-[44px] items-center justify-center rounded-md bg-green-900/30 p-2 text-green-400 transition-colors hover:bg-green-900/50 disabled:pointer-events-none disabled:opacity-40",title:"Approve",children:O.jsx(Lp,{className:"h-4 w-4"})}),O.jsx("button",{onClick:l=>w(l,s.id),disabled:o==="interrupt"||o==="kill",className:"flex min-h-[44px] min-w-[44px] items-center justify-center rounded-md bg-yellow-900/30 p-2 text-yellow-400 transition-colors hover:bg-yellow-900/50 disabled:pointer-events-none disabled:opacity-40",title:"Interrupt",children:O.jsx(Op,{className:"h-4 w-4"})}),O.jsx("button",{onClick:l=>T(l,s.id),disabled:o==="kill",className:"flex min-h-[44px] min-w-[44px] items-center justify-center rounded-md bg-red-900/30 p-2 text-red-400 transition-colors hover:bg-red-900/50 disabled:pointer-events-none disabled:opacity-40",title:"Kill",children:O.jsx(tl,{className:"h-4 w-4"})})]})]}),O.jsx("div",{className:"mb-1.5 truncate font-mono text-xs text-gray-500",children:Sv(s.workDir,50)}),O.jsxs("div",{className:"flex items-center gap-3 text-xs text-gray-500",children:[O.jsxs("span",{children:["Age: ",an(s.createdAt)]}),O.jsxs("span",{children:["Active: ",an(s.lastActivity)]}),s.permissionMode&&s.permissionMode!=="default"?O.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-green-900/30 px-2 py-0.5 text-green-400",children:[O.jsx(Mp,{className:"h-3 w-3"})," ",s.permissionMode]}):null]})]})},bv),t2=F.memo(function({session:s,isAlive:a,currentAction:o,onApprove:g,onInterrupt:w,onKill:T}){return O.jsxs("tr",{className:"border-b border-void-lighter/50 transition-colors hover:border-l-2 hover:border-l-cyan",children:[O.jsx("td",{className:"px-4 py-3",children:O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsx(yl,{status:s.status}),!a&&O.jsx(tl,{className:"h-3.5 w-3.5 text-red-400"})]})}),O.jsx("td",{className:"px-4 py-3",children:O.jsx(Hi,{to:`/sessions/${encodeURIComponent(s.id)}`,className:"font-medium text-gray-200 transition-colors hover:text-cyan",children:s.windowName||s.id})}),O.jsx("td",{className:"max-w-[200px] truncate px-4 py-3 font-mono text-xs text-gray-400",title:s.workDir,children:Sv(s.workDir)}),O.jsx("td",{className:"whitespace-nowrap px-4 py-3 text-gray-400",children:an(s.createdAt)}),O.jsx("td",{className:"whitespace-nowrap px-4 py-3 text-gray-400",children:an(s.lastActivity)}),O.jsx("td",{className:"px-4 py-3",children:s.permissionMode&&s.permissionMode!=="default"?O.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-green-900/30 px-2 py-0.5 text-xs text-green-400",children:[O.jsx(Mp,{className:"h-3 w-3"}),s.permissionMode]}):O.jsx("span",{className:"inline-flex items-center gap-1 rounded-full bg-void-lighter px-2 py-0.5 text-xs text-gray-500",children:"default"})}),O.jsx("td",{className:"px-4 py-3",children:O.jsxs("div",{className:"flex items-center gap-1.5",children:[yv(s)&&O.jsx("button",{onClick:l=>g(l,s.id),disabled:o==="approve",className:"flex min-h-[44px] min-w-[44px] items-center justify-center rounded-md bg-green-900/30 text-xs font-medium text-green-400 transition-colors hover:bg-green-900/50 disabled:pointer-events-none disabled:opacity-40",title:"Approve",children:O.jsx(Lp,{className:"h-3 w-3"})}),O.jsx("button",{onClick:l=>w(l,s.id),disabled:o==="interrupt"||o==="kill",className:"flex min-h-[44px] min-w-[44px] items-center justify-center rounded-md bg-yellow-900/30 text-xs font-medium text-yellow-400 transition-colors hover:bg-yellow-900/50 disabled:pointer-events-none disabled:opacity-40",title:"Interrupt",children:O.jsx(Op,{className:"h-3 w-3"})}),O.jsx("button",{onClick:l=>T(l,s.id),disabled:o==="kill",className:"flex min-h-[44px] min-w-[44px] items-center justify-center rounded-md bg-red-900/30 text-xs font-medium text-red-400 transition-colors hover:bg-red-900/50 disabled:pointer-events-none disabled:opacity-40",title:"Kill",children:O.jsx(tl,{className:"h-3 w-3"})})]})})]})},bv);function i2(){const i=ft(b=>b.sessions),s=ft(b=>b.healthMap),a=ft(b=>b.sseConnected),o=ft(b=>b.setSessionsAndHealth),g=Xr(b=>b.addToast),[w,T]=F.useState({}),l=F.useCallback(async(b,x,k)=>{T(C=>({...C,[b]:x}));try{await k()}finally{T(C=>({...C,[b]:null}))}},[]),h=F.useCallback(async()=>{try{const b=await xE();let x={};try{const k=await AE(),C=new Set(b.sessions.map(_=>_.id));for(const[_,v]of Object.entries(k))C.has(_)&&(x[_]={alive:v.alive,loading:!1})}catch{}o(b.sessions,x)}catch(b){g("error","Failed to fetch sessions",b instanceof Error?b.message:void 0)}},[g,o]);F.useEffect(()=>{if(h(),a)return;const b=setInterval(h,5e3);return()=>clearInterval(b)},[h,a]);const u=F.useCallback(async(b,x)=>{b.preventDefault(),await l(x,"approve",async()=>{try{await mv(x)}catch(k){g("error","Approve failed",k instanceof Error?k.message:void 0)}})},[g,l]),y=F.useCallback(async(b,x)=>{b.preventDefault(),await l(x,"interrupt",async()=>{try{await pv(x)}catch(k){g("error","Interrupt failed",k instanceof Error?k.message:void 0)}})},[g,l]),m=F.useCallback(async(b,x)=>{b.preventDefault(),confirm("Kill this session?")&&await l(x,"kill",async()=>{try{await _v(x)}catch(k){g("error","Failed to kill session",k instanceof Error?k.message:void 0)}})},[g,l]);return i.length===0?O.jsx("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-12 text-center",children:O.jsx("p",{className:"text-gray-500",children:"No active sessions"})}):O.jsxs(O.Fragment,{children:[O.jsx("div",{className:"space-y-3 md:hidden",children:i.map(b=>{const x=s[b.id],k=x?x.alive:!0;return O.jsx(e2,{session:b,isAlive:k,currentAction:w[b.id]??null,onApprove:u,onInterrupt:y,onKill:m},b.id)})}),O.jsx("div",{className:"hidden overflow-x-auto rounded-lg border border-void-lighter bg-[#111118] md:block",children:O.jsxs("table",{className:"w-full text-left text-sm",children:[O.jsx("thead",{children:O.jsxs("tr",{className:"border-b border-void-lighter text-[#666]",children:[O.jsx("th",{className:"px-4 py-3 font-medium",children:"Status"}),O.jsx("th",{className:"px-4 py-3 font-medium",children:"Name"}),O.jsx("th",{className:"px-4 py-3 font-medium",children:"WorkDir"}),O.jsx("th",{className:"px-4 py-3 font-medium",children:"Age"}),O.jsx("th",{className:"px-4 py-3 font-medium",children:"Last Activity"}),O.jsx("th",{className:"px-4 py-3 font-medium",children:"Permission"}),O.jsx("th",{className:"px-4 py-3 font-medium",children:"Actions"})]})}),O.jsx("tbody",{children:i.map(b=>{const x=s[b.id],k=x?x.alive:!0;return O.jsx(t2,{session:b,isAlive:k,currentAction:w[b.id]??null,onApprove:u,onInterrupt:y,onKill:m},b.id)})})]})})]})}const Uu={session_status_change:{icon:tb,label:"Status",color:"#00e5ff"},session_message:{icon:WS,label:"Message",color:"#00ff88"},session_approval:{icon:nb,label:"Approval",color:"#ffaa00"},session_ended:{icon:QS,label:"Ended",color:"#ff3366"},session_created:{icon:BS,label:"Created",color:"#a78bfa"},session_stall:{icon:Bp,label:"Stall",color:"#ff6600"},session_dead:{icon:cb,label:"Dead",color:"#ff0044"},session_subagent_start:{icon:vb,label:"Subagent",color:"#38bdf8"},session_subagent_stop:{icon:mb,label:"Subagent Done",color:"#34d399"}};function ms(i,s="unknown"){return typeof i=="string"?i:s}function r2(i){const s=i.data;switch(i.event){case"session_status_change":{const a=ms(s.status),o=typeof s.detail=="string"?`: ${s.detail}`:"";return`Status → ${a}${o}`}case"session_message":{const a=s.role==="user"?"User":s.role==="assistant"?"Claude":"System",o=typeof s.text=="string"?s.text:JSON.stringify(s.text??"");return`${a}: ${Ym(o,80)}`}case"session_approval":{const a=typeof s.prompt=="string"?s.prompt:JSON.stringify(s.prompt??"");return`Approval needed: ${Ym(a,80)}`}case"session_ended":return`Session ended: ${ms(s.reason)}`;case"session_created":return`Created in ${ms(s.workDir,"unknown dir")}`;case"session_stall":return`Session stalled: ${ms(s.stallType)}`;case"session_dead":return`Session dead: ${ms(s.stallType)}`;case"session_subagent_start":return`Subagent started: ${ms(s.name)}`;case"session_subagent_stop":return`Subagent finished: ${ms(s.name)}`;default:return JSON.stringify(s)}}function Ym(i,s){return i.length>s?i.slice(0,s)+"...":i}function s2(i){try{return new Date(i).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return""}}function n2(){const i=ft(u=>u.activities),s=ft(u=>u.activityFilterSession),a=ft(u=>u.activityFilterType),o=ft(u=>u.setActivityFilterSession),g=ft(u=>u.setActivityFilterType),w=ft(u=>u.sessions),T=F.useMemo(()=>i.filter(u=>!(s&&u.sessionId!==s||a&&u.event!==a)),[i,s,a]),l=F.useMemo(()=>{const u=new Map;for(const y of w)u.set(y.id,y.windowName??y.id.slice(0,8));return u},[w]),h=u=>l.get(u)??(u??"unknown").slice(0,8);return O.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg w-full",children:[O.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 px-3 sm:px-4 py-3 border-b border-[#1a1a2e]",children:[O.jsx("h3",{className:"text-sm font-semibold text-gray-200",children:"Activity Stream"}),O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsxs("select",{value:s??"",onChange:u=>o(u.target.value||null),className:"min-h-[44px] text-xs bg-[#0a0a0f] border border-[#1a1a2e] rounded px-2 py-2 text-gray-400 focus:outline-none focus:border-[#00e5ff]",children:[O.jsx("option",{value:"",children:"All sessions"}),w.map(u=>O.jsx("option",{value:u.id,children:u.windowName||u.id.slice(0,8)},u.id))]}),O.jsxs("select",{value:a??"",onChange:u=>g(u.target.value||null),className:"min-h-[44px] text-xs bg-[#0a0a0f] border border-[#1a1a2e] rounded px-2 py-2 text-gray-400 focus:outline-none focus:border-[#00e5ff]",children:[O.jsx("option",{value:"",children:"All types"}),Object.entries(Uu).map(([u,y])=>O.jsx("option",{value:u,children:y.label},u))]}),(s||a)&&O.jsx("button",{onClick:()=>{o(null),g(null)},className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-gray-300",children:O.jsx(fl,{className:"h-4 w-4"})})]})]}),O.jsxs("div",{className:"max-h-[360px] overflow-y-auto divide-y divide-[#1a1a2e]/50",children:[T.length===0&&O.jsx("div",{className:"px-4 py-8 text-center text-sm text-[#555]",children:"No activity yet"}),T.map((u,y)=>{const m=Uu[u.event]??Uu.session_status_change,b=m.icon;return O.jsxs("div",{className:"flex items-start gap-2 sm:gap-3 px-3 sm:px-4 py-2 sm:py-2.5 hover:bg-[#1a1a2e]/30 transition-colors",children:[O.jsx(b,{className:"h-4 w-4 mt-0.5 shrink-0",style:{color:m.color}}),O.jsxs("div",{className:"flex-1 min-w-0",children:[O.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2",children:[O.jsx("span",{className:"text-xs font-medium text-gray-300 truncate",children:h(u.sessionId)}),O.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider px-1.5 py-0.5 rounded hidden sm:inline-block",style:{backgroundColor:`${m.color}15`,color:m.color},children:m.label})]}),O.jsx("p",{className:"text-xs text-gray-500 mt-0.5 font-mono truncate",children:r2(u)})]}),O.jsx("span",{className:"text-[10px] text-[#444] shrink-0 tabular-nums mt-0.5",children:s2(u.timestamp)})]},`${u.sessionId}-${u.timestamp}-${y}`)})]})]})}let a2=0;function ua(){return{workDir:"",name:"",prompt:"",_key:a2++}}function o2({open:i,onClose:s}){const a=cl(),o=F.useRef(null),g=F.useRef(null),w=F.useCallback(()=>{I(),s()},[s]),T=F.useRef(null);F.useEffect(()=>{if(!i)return;const V=ee=>{var N;ee.key==="Escape"&&((N=g.current)==null||N.abort(),w())};return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[i,w]),F.useEffect(()=>{if(!i)return;const V=T.current;if(!V)return;const ee='input, textarea, select, button, [tabindex]:not([tabindex="-1"])',N=U=>{if(U.key!=="Tab")return;const L=Array.from(V.querySelectorAll(ee));if(L.length===0)return;const H=L[0],X=L[L.length-1];U.shiftKey?document.activeElement===H&&(U.preventDefault(),X.focus()):document.activeElement===X&&(U.preventDefault(),H.focus())};return V.addEventListener("keydown",N),()=>V.removeEventListener("keydown",N)},[i]),F.useEffect(()=>{if(i){const V=setTimeout(()=>{var ee;return(ee=o.current)==null?void 0:ee.focus()},50);return()=>clearTimeout(V)}},[i]);const[l,h]=F.useState(""),[u,y]=F.useState(""),[m,b]=F.useState(""),[x,k]=F.useState("default"),[C,_]=F.useState(!1),[v,f]=F.useState(null),[p,S]=F.useState("single"),[A,R]=F.useState([ua(),ua()]),[M,E]=F.useState(""),[B,$]=F.useState(null);function I(){h(""),y(""),b(""),k("default"),_(!1),f(null),R([ua(),ua()]),E(""),$(null),S("single")}function q(){A.length>=10||R([...A,ua()])}function P(V){A.length<=1||R(A.filter((ee,N)=>N!==V))}function Q(V,ee,N){R(A.map((U,L)=>L===V?{...U,[ee]:N}:U))}async function re(V){var U;V.preventDefault(),f(null),$(null);const ee=A.filter(L=>L.workDir.trim());if(ee.length===0){f("At least one working directory is required");return}_(!0),(U=g.current)==null||U.abort();const N=new AbortController;g.current=N;try{const L=await zE({sessions:ee.map(H=>({workDir:H.workDir.trim(),name:H.name.trim()||void 0,prompt:H.prompt.trim()||M.trim()||void 0,permissionMode:x})),signal:N.signal});$(L)}catch(L){if(N.signal.aborted)return;f(L instanceof Error?L.message:"Failed to create sessions")}finally{g.current===N&&(g.current=null,_(!1))}}if(!i)return null;async function G(V){var N;if(V.preventDefault(),f(null),!l.trim()){f("Working directory is required");return}_(!0),(N=g.current)==null||N.abort();const ee=new AbortController;g.current=ee;try{const U=await EE({workDir:l.trim(),name:u.trim()||void 0,prompt:m.trim()||void 0,permissionMode:x,signal:ee.signal});I(),s(),a(`/sessions/${U.id}`)}catch(U){if(ee.signal.aborted)return;f(U instanceof Error?U.message:"Failed to create session")}finally{g.current===ee&&(g.current=null,_(!1))}}return O.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[O.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:w}),O.jsxs("div",{ref:T,role:"dialog","aria-modal":"true","aria-label":"Create new session",className:`relative w-full ${p==="batch"?"max-w-2xl":"max-w-md"} mx-4 bg-[#111118] border border-[#1a1a2e] rounded-lg shadow-2xl max-h-[90vh] overflow-y-auto`,children:[O.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-5 py-4 border-b border-[#1a1a2e]",children:[O.jsxs("div",{className:"flex items-center gap-4",children:[O.jsx("h2",{className:"text-sm font-semibold text-gray-100",children:"New Session"}),O.jsxs("div",{className:"flex rounded bg-[#0a0a0f] p-0.5",children:[O.jsx("button",{type:"button",onClick:()=>S("single"),className:`px-3 py-1 text-xs rounded transition-colors ${p==="single"?"bg-[#00e5ff]/10 text-[#00e5ff]":"text-gray-500 hover:text-gray-300"}`,children:"Single"}),O.jsx("button",{type:"button",onClick:()=>S("batch"),className:`px-3 py-1 text-xs rounded transition-colors ${p==="batch"?"bg-[#00e5ff]/10 text-[#00e5ff]":"text-gray-500 hover:text-gray-300"}`,children:"Batch"})]})]}),O.jsx("button",{onClick:w,className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-gray-300 transition-colors",children:O.jsx(fl,{className:"h-4 w-4"})})]}),p==="single"&&O.jsxs("form",{onSubmit:G,className:"p-4 sm:p-5 space-y-4",children:[O.jsxs("div",{children:[O.jsxs("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:["Working Directory ",O.jsx("span",{className:"text-[#ff3366]",children:"*"})]}),O.jsx("input",{type:"text",ref:o,value:l,onChange:V=>h(V.target.value),placeholder:"/home/user/project",className:"w-full min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#00e5ff] font-mono"})]}),O.jsxs("div",{children:[O.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Session Name"}),O.jsx("input",{type:"text",value:u,onChange:V=>y(V.target.value),placeholder:"my-session",className:"w-full min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#00e5ff]"})]}),O.jsxs("div",{children:[O.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Initial Prompt"}),O.jsx("textarea",{value:m,onChange:V=>b(V.target.value),placeholder:"Fix the login bug...",rows:3,className:"w-full min-h-[88px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#00e5ff] resize-none"})]}),O.jsxs("div",{children:[O.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Permission Mode"}),O.jsxs("select",{value:x,onChange:V=>k(V.target.value),className:"w-full min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 focus:outline-none focus:border-[#00e5ff]",children:[O.jsx("option",{value:"default",children:"default — asks for everything"}),O.jsx("option",{value:"plan",children:"plan — auto-reads, asks for writes"}),O.jsx("option",{value:"acceptEdits",children:"acceptEdits — auto-edits, asks for bash"}),O.jsx("option",{value:"bypassPermissions",children:"bypassPermissions — never asks"}),O.jsx("option",{value:"auto",children:"auto — auto-approve in sandbox"})]})]}),v&&O.jsx("div",{className:"text-xs text-[#ff3366] bg-[#ff3366]/10 border border-[#ff3366]/20 rounded px-3 py-2",children:v}),O.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[O.jsx("button",{type:"button",onClick:w,className:"min-h-[44px] px-4 py-2.5 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-gray-300 transition-colors",children:"Cancel"}),O.jsxs("button",{type:"submit",disabled:C||!l.trim(),className:"min-h-[44px] flex items-center gap-1.5 px-4 py-2.5 text-xs font-medium rounded bg-[#00e5ff]/10 hover:bg-[#00e5ff]/20 text-[#00e5ff] border border-[#00e5ff]/30 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[C&&O.jsx(Ju,{className:"h-3 w-3 animate-spin"}),"Create Session"]})]})]}),p==="batch"&&!B&&O.jsxs("form",{onSubmit:re,className:"p-4 sm:p-5 space-y-4",children:[O.jsxs("div",{children:[O.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Shared Prompt"}),O.jsx("textarea",{value:M,onChange:V=>E(V.target.value),placeholder:"Apply to all sessions without a per-row prompt...",rows:2,className:"w-full min-h-[88px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#00e5ff] resize-none"})]}),O.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 text-xs font-medium text-gray-500 px-1",children:[O.jsxs("span",{children:["Working Directory ",O.jsx("span",{className:"text-[#ff3366]",children:"*"})]}),O.jsx("span",{children:"Name"}),O.jsx("span",{children:"Prompt (override)"}),O.jsx("span",{})]}),O.jsx("div",{className:"space-y-2",children:A.map((V,ee)=>O.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 items-start",children:[O.jsx("input",{type:"text",value:V.workDir,onChange:N=>Q(ee,"workDir",N.target.value),placeholder:"/home/user/project",className:"min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#00e5ff] font-mono"}),O.jsx("input",{type:"text",value:V.name,onChange:N=>Q(ee,"name",N.target.value),placeholder:"name",className:"min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#00e5ff]"}),O.jsx("input",{type:"text",value:V.prompt,onChange:N=>Q(ee,"prompt",N.target.value),placeholder:"Override prompt...",className:"min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#00e5ff]"}),O.jsx("button",{type:"button",onClick:()=>P(ee),disabled:A.length<=1,className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-[#ff3366] transition-colors disabled:opacity-30 disabled:cursor-not-allowed",children:O.jsx(Np,{className:"h-3.5 w-3.5"})})]},V._key))}),A.length<10&&O.jsxs("button",{type:"button",onClick:q,className:"flex items-center gap-1.5 text-xs text-gray-500 hover:text-gray-300 transition-colors",children:[O.jsx(hl,{className:"h-3.5 w-3.5"}),"Add session"]}),O.jsxs("div",{children:[O.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Permission Mode"}),O.jsxs("select",{value:x,onChange:V=>k(V.target.value),className:"w-full min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 focus:outline-none focus:border-[#00e5ff]",children:[O.jsx("option",{value:"default",children:"default — asks for everything"}),O.jsx("option",{value:"plan",children:"plan — auto-reads, asks for writes"}),O.jsx("option",{value:"acceptEdits",children:"acceptEdits — auto-edits, asks for bash"}),O.jsx("option",{value:"bypassPermissions",children:"bypassPermissions — never asks"}),O.jsx("option",{value:"auto",children:"auto — auto-approve in sandbox"})]})]}),v&&O.jsx("div",{className:"text-xs text-[#ff3366] bg-[#ff3366]/10 border border-[#ff3366]/20 rounded px-3 py-2",children:v}),O.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[O.jsx("button",{type:"button",onClick:w,className:"min-h-[44px] px-4 py-2.5 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-gray-300 transition-colors",children:"Cancel"}),O.jsxs("button",{type:"submit",disabled:C||!A.some(V=>V.workDir.trim()),className:"min-h-[44px] flex items-center gap-1.5 px-4 py-2.5 text-xs font-medium rounded bg-[#00e5ff]/10 hover:bg-[#00e5ff]/20 text-[#00e5ff] border border-[#00e5ff]/30 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[C&&O.jsx(Ju,{className:"h-3 w-3 animate-spin"}),"Create ",A.filter(V=>V.workDir.trim()).length," Session(s)"]})]})]}),B&&O.jsxs("div",{className:"p-4 sm:p-5 space-y-4",children:[O.jsxs("div",{className:"flex items-center gap-3",children:[B.created>0&&O.jsxs("span",{className:"text-xs font-medium text-emerald-400 bg-emerald-400/10 border border-emerald-400/20 rounded px-3 py-1.5",children:[B.created," created"]}),B.failed>0&&O.jsxs("span",{className:"text-xs font-medium text-[#ff3366] bg-[#ff3366]/10 border border-[#ff3366]/20 rounded px-3 py-1.5",children:[B.failed," failed"]})]}),B.sessions.length>0&&O.jsxs("div",{className:"space-y-1",children:[O.jsx("p",{className:"text-xs font-medium text-gray-400",children:"Created sessions"}),O.jsx("ul",{className:"space-y-1",children:B.sessions.map(V=>O.jsx("li",{children:O.jsxs("button",{type:"button",onClick:()=>{w(),a(`/sessions/${V.id}`)},className:"text-xs text-[#00e5ff] hover:underline font-mono",children:[V.id.slice(0,8),"...",V.name?` — ${V.name}`:""]})},V.id))})]}),B.errors.length>0&&O.jsxs("div",{className:"space-y-1",children:[O.jsx("p",{className:"text-xs font-medium text-gray-400",children:"Errors"}),O.jsx("ul",{className:"space-y-1",children:B.errors.map((V,ee)=>O.jsx("li",{className:"text-xs text-[#ff3366]",children:V},ee))})]}),O.jsx("div",{className:"flex justify-end pt-2",children:O.jsx("button",{type:"button",onClick:w,className:"min-h-[44px] px-4 py-2.5 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-gray-300 transition-colors",children:"Close"})})]})]})]})}function l2(){const[i,s]=F.useState(!1);return O.jsxs("div",{className:"flex flex-col gap-6",children:[O.jsxs("div",{className:"flex items-center justify-between",children:[O.jsxs("div",{children:[O.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"Overview"}),O.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Aegis session monitoring and metrics"})]}),O.jsxs("button",{onClick:()=>s(!0),className:"flex items-center gap-1.5 px-3 py-2 text-xs font-medium rounded bg-[#00e5ff]/10 hover:bg-[#00e5ff]/20 text-[#00e5ff] border border-[#00e5ff]/30 transition-colors",children:[O.jsx(hl,{className:"h-3.5 w-3.5"}),"New Session"]})]}),O.jsx(XE,{}),O.jsxs("div",{children:[O.jsx("h3",{className:"mb-3 text-lg font-semibold text-gray-200",children:"Sessions"}),O.jsx(i2,{})]}),O.jsx(n2,{}),O.jsx(o2,{open:i,onClose:()=>s(!1)})]})}function Km(i){return i instanceof Error&&"statusCode"in i}function c2(i){const s=ft(Q=>Q.token),a=Xr(Q=>Q.addToast),[o,g]=F.useState(null),[w,T]=F.useState(null),[l,h]=F.useState(!1),[u,y]=F.useState(!0),[m,b]=F.useState(""),[x,k]=F.useState(!0),[C,_]=F.useState(null),[v,f]=F.useState(!0),p=F.useRef(i);p.current=i;const S=F.useRef(!1),A=F.useRef(0),R=F.useRef(void 0),M=F.useRef(void 0),E=F.useCallback(async()=>{try{const[Q,re]=await Promise.allSettled([wE(p.current),TE(p.current)]);if(Q.status==="rejected"&&Km(Q.reason)&&Q.reason.statusCode===404||re.status==="rejected"&&Km(re.reason)&&re.reason.statusCode===404){h(!0);return}Q.status==="fulfilled"&&g(Q.value),re.status==="fulfilled"&&T(re.value)}catch(Q){a("error","Failed to load session",Q instanceof Error?Q.message:void 0)}finally{y(!1)}},[a]);R.current=E;const B=F.useCallback(async()=>{if(S.current)return;const Q=p.current;try{const re=await kE(Q);S.current||b(re.pane??"")}catch(re){a("warning","Failed to load terminal pane",re instanceof Error?re.message:void 0)}finally{S.current||k(!1)}try{const re=await DE(Q);S.current||_(re)}catch(re){a("warning","Failed to load session metrics",re instanceof Error?re.message:void 0)}finally{S.current||f(!1)}},[a]);M.current=B,F.useEffect(()=>(S.current=!1,A.current++,y(!0),k(!0),f(!0),E(),B(),()=>{S.current=!0,$.current&&clearTimeout($.current),I.current&&clearTimeout(I.current)}),[i,E,B]);const $=F.useRef(void 0),I=F.useRef(void 0),q=F.useCallback(()=>{$.current&&clearTimeout($.current);const Q=A.current;$.current=setTimeout(()=>{var re;A.current===Q&&((re=M.current)==null||re.call(M))},1e3)},[]),P=F.useCallback(()=>{I.current&&clearTimeout(I.current);const Q=A.current;I.current=setTimeout(()=>{var re;A.current===Q&&((re=R.current)==null||re.call(R))},1e3)},[]);return F.useEffect(()=>{if(!i)return;const Q=gv(i,re=>{var G,V;try{const ee=fE.safeParse(JSON.parse(re.data));if(!ee.success){console.warn("SSE event failed validation",ee.error.message);return}switch(ee.data.event){case"status":case"approval":case"stall":case"dead":P(),q();break;case"message":q();break;case"ended":(G=R.current)==null||G.call(R),(V=M.current)==null||V.call(M);break}}catch{}},s);return()=>Q()},[i,s,P,q]),{session:o,health:w,notFound:l,loading:u,paneContent:m,paneLoading:x,metrics:C,metricsLoading:v,refetchPaneAndMetrics:B}}const u2={idle:"Idle",working:"Working",permission_prompt:"Permission",plan_mode:"Planning",ask_question:"Question",bash_approval:"Bash Approval",settings:"Settings",error:"Error",compacting:"Compacting",context_warning:"Context Warning",waiting_for_input:"Waiting",unknown:"Unknown"};function Vm(i,s){if(i.length<=s)return i;const a=i.slice(0,Math.ceil(s/2)-1),o=i.slice(-(Math.floor(s/2)-2));return`${a}…${o}`}function Xm(i){return new Date(i).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function h2({session:i,health:s,onApprove:a,onReject:o,onInterrupt:g,onKill:w}){const[T,l]=F.useState(!1),h=s.status==="permission_prompt"||s.status==="bash_approval";return O.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg p-3 sm:p-4",children:[O.jsxs("div",{className:"flex items-start gap-3 mb-3",children:[O.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[O.jsx(yl,{status:s.status}),O.jsx("span",{className:"text-sm font-medium text-[#e0e0e0]",children:u2[s.status]})]}),O.jsxs("div",{className:"flex-1 min-w-0",children:[O.jsx("h1",{className:"text-base sm:text-lg font-semibold text-[#e0e0e0] truncate",children:i.windowName||"Untitled Session"}),O.jsx("div",{className:"text-xs text-[#555] font-mono truncate mt-0.5",children:Vm(i.workDir,40)})]}),O.jsxs("div",{className:"hidden sm:flex items-center gap-2 shrink-0",children:[i.permissionMode&&i.permissionMode!=="default"&&O.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider px-2 py-0.5 rounded bg-[#003322] text-[#00ff88] border border-[#00ff88]/30",children:i.permissionMode}),s.alive?O.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider px-2 py-0.5 rounded bg-[#111118] text-[#888] border border-[#1a1a2e]",children:"Alive"}):O.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider px-2 py-0.5 rounded bg-[#331111] text-[#ff3366] border border-[#ff3366]/30",children:"Dead"})]})]}),O.jsxs("div",{className:"flex items-center gap-3 sm:gap-4 text-[11px] text-[#555] mb-3 flex-wrap",children:[O.jsxs("span",{children:["Created: ",Xm(i.createdAt)]}),O.jsxs("span",{className:"hidden sm:inline",children:["Last activity: ",Xm(i.lastActivity)]}),O.jsxs("span",{className:"font-mono hidden sm:inline",children:["ID: ",Vm(i.id,16)]}),s.details&&O.jsx("span",{className:"text-[#888] italic",children:s.details})]}),O.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h&&O.jsxs(O.Fragment,{children:[O.jsx("button",{onClick:a,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#003322] hover:bg-[#004433] text-[#00ff88] border border-[#00ff88]/30 transition-colors",children:"Approve"}),O.jsx("button",{onClick:o,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#331111] hover:bg-[#442222] text-[#ff3366] border border-[#ff3366]/30 transition-colors",children:"Reject"})]}),O.jsx("button",{onClick:g,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-[#e0e0e0] border border-[#1a1a2e] transition-colors",children:"Interrupt"}),T?O.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[O.jsx("span",{className:"text-xs text-[#ff3366]",children:"Confirm kill?"}),O.jsx("button",{onClick:()=>{w==null||w(),l(!1)},className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#331111] text-[#ff3366] border border-[#ff3366]/30 transition-colors",children:"Yes, Kill"}),O.jsx("button",{onClick:()=>l(!1),className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-[#e0e0e0] border border-[#1a1a2e] transition-colors",children:"Cancel"})]}):O.jsx("button",{onClick:()=>l(!0),className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-[#e0e0e0] border border-[#1a1a2e] transition-colors ml-auto",children:"Kill"})]})]})}/*! @license DOMPurify 3.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.3/LICENSE */const{entries:Cv,setPrototypeOf:Jm,isFrozen:f2,getPrototypeOf:d2,getOwnPropertyDescriptor:_2}=Object;let{freeze:Yt,seal:ki,create:Jo}=Object,{apply:ih,construct:rh}=typeof Reflect<"u"&&Reflect;Yt||(Yt=function(s){return s});ki||(ki=function(s){return s});ih||(ih=function(s,a){for(var o=arguments.length,g=new Array(o>2?o-2:0),w=2;w<o;w++)g[w-2]=arguments[w];return s.apply(a,g)});rh||(rh=function(s){for(var a=arguments.length,o=new Array(a>1?a-1:0),g=1;g<a;g++)o[g-1]=arguments[g];return new s(...o)});const Wo=Kt(Array.prototype.forEach),m2=Kt(Array.prototype.lastIndexOf),Qm=Kt(Array.prototype.pop),ha=Kt(Array.prototype.push),p2=Kt(Array.prototype.splice),Qo=Kt(String.prototype.toLowerCase),Iu=Kt(String.prototype.toString),Pu=Kt(String.prototype.match),fa=Kt(String.prototype.replace),v2=Kt(String.prototype.indexOf),g2=Kt(String.prototype.trim),_i=Kt(Object.prototype.hasOwnProperty),Gt=Kt(RegExp.prototype.test),da=y2(TypeError);function Kt(i){return function(s){s instanceof RegExp&&(s.lastIndex=0);for(var a=arguments.length,o=new Array(a>1?a-1:0),g=1;g<a;g++)o[g-1]=arguments[g];return ih(i,s,o)}}function y2(i){return function(){for(var s=arguments.length,a=new Array(s),o=0;o<s;o++)a[o]=arguments[o];return rh(i,a)}}function Me(i,s){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Qo;Jm&&Jm(i,null);let o=s.length;for(;o--;){let g=s[o];if(typeof g=="string"){const w=a(g);w!==g&&(f2(s)||(s[o]=w),g=w)}i[g]=!0}return i}function S2(i){for(let s=0;s<i.length;s++)_i(i,s)||(i[s]=null);return i}function Gi(i){const s=Jo(null);for(const[a,o]of Cv(i))_i(i,a)&&(Array.isArray(o)?s[a]=S2(o):o&&typeof o=="object"&&o.constructor===Object?s[a]=Gi(o):s[a]=o);return s}function _a(i,s){for(;i!==null;){const o=_2(i,s);if(o){if(o.get)return Kt(o.get);if(typeof o.value=="function")return Kt(o.value)}i=d2(i)}function a(){return null}return a}const ep=Yt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),$u=Yt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Fu=Yt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),b2=Yt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Zu=Yt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),C2=Yt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),tp=Yt(["#text"]),ip=Yt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),qu=Yt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),rp=Yt(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Yo=Yt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),x2=ki(/\{\{[\w\W]*|[\w\W]*\}\}/gm),w2=ki(/<%[\w\W]*|[\w\W]*%>/gm),E2=ki(/\$\{[\w\W]*/gm),T2=ki(/^data-[\-\w.\u00B7-\uFFFF]+$/),A2=ki(/^aria-[\-\w]+$/),xv=ki(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),R2=ki(/^(?:\w+script|data):/i),D2=ki(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),wv=ki(/^html$/i),k2=ki(/^[a-z][.\w]*(-[.\w]+)+$/i);var sp=Object.freeze({__proto__:null,ARIA_ATTR:A2,ATTR_WHITESPACE:D2,CUSTOM_ELEMENT:k2,DATA_ATTR:T2,DOCTYPE_NAME:wv,ERB_EXPR:w2,IS_ALLOWED_URI:xv,IS_SCRIPT_OR_DATA:R2,MUSTACHE_EXPR:x2,TMPLIT_EXPR:E2});const ma={element:1,text:3,progressingInstruction:7,comment:8,document:9},O2=function(){return typeof window>"u"?null:window},M2=function(s,a){if(typeof s!="object"||typeof s.createPolicy!="function")return null;let o=null;const g="data-tt-policy-suffix";a&&a.hasAttribute(g)&&(o=a.getAttribute(g));const w="dompurify"+(o?"#"+o:"");try{return s.createPolicy(w,{createHTML(T){return T},createScriptURL(T){return T}})}catch{return console.warn("TrustedTypes policy "+w+" could not be created."),null}},np=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Ev(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:O2();const s=Se=>Ev(Se);if(s.version="3.3.3",s.removed=[],!i||!i.document||i.document.nodeType!==ma.document||!i.Element)return s.isSupported=!1,s;let{document:a}=i;const o=a,g=o.currentScript,{DocumentFragment:w,HTMLTemplateElement:T,Node:l,Element:h,NodeFilter:u,NamedNodeMap:y=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:m,DOMParser:b,trustedTypes:x}=i,k=h.prototype,C=_a(k,"cloneNode"),_=_a(k,"remove"),v=_a(k,"nextSibling"),f=_a(k,"childNodes"),p=_a(k,"parentNode");if(typeof T=="function"){const Se=a.createElement("template");Se.content&&Se.content.ownerDocument&&(a=Se.content.ownerDocument)}let S,A="";const{implementation:R,createNodeIterator:M,createDocumentFragment:E,getElementsByTagName:B}=a,{importNode:$}=o;let I=np();s.isSupported=typeof Cv=="function"&&typeof p=="function"&&R&&R.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:q,ERB_EXPR:P,TMPLIT_EXPR:Q,DATA_ATTR:re,ARIA_ATTR:G,IS_SCRIPT_OR_DATA:V,ATTR_WHITESPACE:ee,CUSTOM_ELEMENT:N}=sp;let{IS_ALLOWED_URI:U}=sp,L=null;const H=Me({},[...ep,...$u,...Fu,...Zu,...tp]);let X=null;const ne=Me({},[...ip,...qu,...rp,...Yo]);let he=Object.seal(Jo(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),me=null,Y=null;const j=Object.seal(Jo(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ce=!0,oe=!0,ve=!1,pe=!0,Te=!1,je=!0,Ue=!1,ct=!1,Ee=!1,Ft=!1,mi=!1,pi=!1,Ii=!0,Ki=!1;const Pt="user-content-";let nt=!0,Dt=!1,Zt={},Nt=null;const Bt=Me({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Vi=null;const Vt=Me({},["audio","video","img","source","image","track"]);let Li=null;const Ye=Me({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),vi="http://www.w3.org/1998/Math/MathML",kt="http://www.w3.org/2000/svg",Ot="http://www.w3.org/1999/xhtml";let yt=Ot,un=!1,hn=null;const Sl=Me({},[vi,kt,Ot],Iu);let Xi=Me({},["mi","mo","mn","ms","mtext"]),Ji=Me({},["annotation-xml"]);const gs=Me({},["title","style","font","a","script"]);let ai=null;const ys=["application/xhtml+xml","text/html"],Jr="text/html";let mt=null,Qi=null;const fn=a.createElement("form"),br=function(W){return W instanceof RegExp||W instanceof Function},dn=function(){let W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Qi&&Qi===W)){if((!W||typeof W!="object")&&(W={}),W=Gi(W),ai=ys.indexOf(W.PARSER_MEDIA_TYPE)===-1?Jr:W.PARSER_MEDIA_TYPE,mt=ai==="application/xhtml+xml"?Iu:Qo,L=_i(W,"ALLOWED_TAGS")?Me({},W.ALLOWED_TAGS,mt):H,X=_i(W,"ALLOWED_ATTR")?Me({},W.ALLOWED_ATTR,mt):ne,hn=_i(W,"ALLOWED_NAMESPACES")?Me({},W.ALLOWED_NAMESPACES,Iu):Sl,Li=_i(W,"ADD_URI_SAFE_ATTR")?Me(Gi(Ye),W.ADD_URI_SAFE_ATTR,mt):Ye,Vi=_i(W,"ADD_DATA_URI_TAGS")?Me(Gi(Vt),W.ADD_DATA_URI_TAGS,mt):Vt,Nt=_i(W,"FORBID_CONTENTS")?Me({},W.FORBID_CONTENTS,mt):Bt,me=_i(W,"FORBID_TAGS")?Me({},W.FORBID_TAGS,mt):Gi({}),Y=_i(W,"FORBID_ATTR")?Me({},W.FORBID_ATTR,mt):Gi({}),Zt=_i(W,"USE_PROFILES")?W.USE_PROFILES:!1,ce=W.ALLOW_ARIA_ATTR!==!1,oe=W.ALLOW_DATA_ATTR!==!1,ve=W.ALLOW_UNKNOWN_PROTOCOLS||!1,pe=W.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Te=W.SAFE_FOR_TEMPLATES||!1,je=W.SAFE_FOR_XML!==!1,Ue=W.WHOLE_DOCUMENT||!1,Ft=W.RETURN_DOM||!1,mi=W.RETURN_DOM_FRAGMENT||!1,pi=W.RETURN_TRUSTED_TYPE||!1,Ee=W.FORCE_BODY||!1,Ii=W.SANITIZE_DOM!==!1,Ki=W.SANITIZE_NAMED_PROPS||!1,nt=W.KEEP_CONTENT!==!1,Dt=W.IN_PLACE||!1,U=W.ALLOWED_URI_REGEXP||xv,yt=W.NAMESPACE||Ot,Xi=W.MATHML_TEXT_INTEGRATION_POINTS||Xi,Ji=W.HTML_INTEGRATION_POINTS||Ji,he=W.CUSTOM_ELEMENT_HANDLING||{},W.CUSTOM_ELEMENT_HANDLING&&br(W.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(he.tagNameCheck=W.CUSTOM_ELEMENT_HANDLING.tagNameCheck),W.CUSTOM_ELEMENT_HANDLING&&br(W.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(he.attributeNameCheck=W.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),W.CUSTOM_ELEMENT_HANDLING&&typeof W.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(he.allowCustomizedBuiltInElements=W.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Te&&(oe=!1),mi&&(Ft=!0),Zt&&(L=Me({},tp),X=Jo(null),Zt.html===!0&&(Me(L,ep),Me(X,ip)),Zt.svg===!0&&(Me(L,$u),Me(X,qu),Me(X,Yo)),Zt.svgFilters===!0&&(Me(L,Fu),Me(X,qu),Me(X,Yo)),Zt.mathMl===!0&&(Me(L,Zu),Me(X,rp),Me(X,Yo))),_i(W,"ADD_TAGS")||(j.tagCheck=null),_i(W,"ADD_ATTR")||(j.attributeCheck=null),W.ADD_TAGS&&(typeof W.ADD_TAGS=="function"?j.tagCheck=W.ADD_TAGS:(L===H&&(L=Gi(L)),Me(L,W.ADD_TAGS,mt))),W.ADD_ATTR&&(typeof W.ADD_ATTR=="function"?j.attributeCheck=W.ADD_ATTR:(X===ne&&(X=Gi(X)),Me(X,W.ADD_ATTR,mt))),W.ADD_URI_SAFE_ATTR&&Me(Li,W.ADD_URI_SAFE_ATTR,mt),W.FORBID_CONTENTS&&(Nt===Bt&&(Nt=Gi(Nt)),Me(Nt,W.FORBID_CONTENTS,mt)),W.ADD_FORBID_CONTENTS&&(Nt===Bt&&(Nt=Gi(Nt)),Me(Nt,W.ADD_FORBID_CONTENTS,mt)),nt&&(L["#text"]=!0),Ue&&Me(L,["html","head","body"]),L.table&&(Me(L,["tbody"]),delete me.tbody),W.TRUSTED_TYPES_POLICY){if(typeof W.TRUSTED_TYPES_POLICY.createHTML!="function")throw da('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof W.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw da('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');S=W.TRUSTED_TYPES_POLICY,A=S.createHTML("")}else S===void 0&&(S=M2(x,g)),S!==null&&typeof A=="string"&&(A=S.createHTML(""));Yt&&Yt(W),Qi=W}},_n=Me({},[...$u,...Fu,...b2]),mn=Me({},[...Zu,...C2]),Ea=function(W){let _e=p(W);(!_e||!_e.tagName)&&(_e={namespaceURI:yt,tagName:"template"});const ge=Qo(W.tagName),Ze=Qo(_e.tagName);return hn[W.namespaceURI]?W.namespaceURI===kt?_e.namespaceURI===Ot?ge==="svg":_e.namespaceURI===vi?ge==="svg"&&(Ze==="annotation-xml"||Xi[Ze]):!!_n[ge]:W.namespaceURI===vi?_e.namespaceURI===Ot?ge==="math":_e.namespaceURI===kt?ge==="math"&&Ji[Ze]:!!mn[ge]:W.namespaceURI===Ot?_e.namespaceURI===kt&&!Ji[Ze]||_e.namespaceURI===vi&&!Xi[Ze]?!1:!mn[ge]&&(gs[ge]||!_n[ge]):!!(ai==="application/xhtml+xml"&&hn[W.namespaceURI]):!1},Xt=function(W){ha(s.removed,{element:W});try{p(W).removeChild(W)}catch{_(W)}},Ni=function(W,_e){try{ha(s.removed,{attribute:_e.getAttributeNode(W),from:_e})}catch{ha(s.removed,{attribute:null,from:_e})}if(_e.removeAttribute(W),W==="is")if(Ft||mi)try{Xt(_e)}catch{}else try{_e.setAttribute(W,"")}catch{}},pn=function(W){let _e=null,ge=null;if(Ee)W="<remove></remove>"+W;else{const ke=Pu(W,/^[\r\n\t ]+/);ge=ke&&ke[0]}ai==="application/xhtml+xml"&&yt===Ot&&(W='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+W+"</body></html>");const Ze=S?S.createHTML(W):W;if(yt===Ot)try{_e=new b().parseFromString(Ze,ai)}catch{}if(!_e||!_e.documentElement){_e=R.createDocument(yt,"template",null);try{_e.documentElement.innerHTML=un?A:Ze}catch{}}const at=_e.body||_e.documentElement;return W&&ge&&at.insertBefore(a.createTextNode(ge),at.childNodes[0]||null),yt===Ot?B.call(_e,Ue?"html":"body")[0]:Ue?_e.documentElement:at},vn=function(W){return M.call(W.ownerDocument||W,W,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},gi=function(W){return W instanceof m&&(typeof W.nodeName!="string"||typeof W.textContent!="string"||typeof W.removeChild!="function"||!(W.attributes instanceof y)||typeof W.removeAttribute!="function"||typeof W.setAttribute!="function"||typeof W.namespaceURI!="string"||typeof W.insertBefore!="function"||typeof W.hasChildNodes!="function")},St=function(W){return typeof l=="function"&&W instanceof l};function it(Se,W,_e){Wo(Se,ge=>{ge.call(s,W,_e,Qi)})}const er=function(W){let _e=null;if(it(I.beforeSanitizeElements,W,null),gi(W))return Xt(W),!0;const ge=mt(W.nodeName);if(it(I.uponSanitizeElement,W,{tagName:ge,allowedTags:L}),je&&W.hasChildNodes()&&!St(W.firstElementChild)&&Gt(/<[/\w!]/g,W.innerHTML)&&Gt(/<[/\w!]/g,W.textContent)||W.nodeType===ma.progressingInstruction||je&&W.nodeType===ma.comment&&Gt(/<[/\w]/g,W.data))return Xt(W),!0;if(!(j.tagCheck instanceof Function&&j.tagCheck(ge))&&(!L[ge]||me[ge])){if(!me[ge]&&Ta(ge)&&(he.tagNameCheck instanceof RegExp&&Gt(he.tagNameCheck,ge)||he.tagNameCheck instanceof Function&&he.tagNameCheck(ge)))return!1;if(nt&&!Nt[ge]){const Ze=p(W)||W.parentNode,at=f(W)||W.childNodes;if(at&&Ze){const ke=at.length;for(let zt=ke-1;zt>=0;--zt){const yi=C(at[zt],!0);yi.__removalCount=(W.__removalCount||0)+1,Ze.insertBefore(yi,v(W))}}}return Xt(W),!0}return W instanceof h&&!Ea(W)||(ge==="noscript"||ge==="noembed"||ge==="noframes")&&Gt(/<\/no(script|embed|frames)/i,W.innerHTML)?(Xt(W),!0):(Te&&W.nodeType===ma.text&&(_e=W.textContent,Wo([q,P,Q],Ze=>{_e=fa(_e,Ze," ")}),W.textContent!==_e&&(ha(s.removed,{element:W.cloneNode()}),W.textContent=_e)),it(I.afterSanitizeElements,W,null),!1)},Ss=function(W,_e,ge){if(Y[_e]||Ii&&(_e==="id"||_e==="name")&&(ge in a||ge in fn))return!1;if(!(oe&&!Y[_e]&&Gt(re,_e))){if(!(ce&&Gt(G,_e))){if(!(j.attributeCheck instanceof Function&&j.attributeCheck(_e,W))){if(!X[_e]||Y[_e]){if(!(Ta(W)&&(he.tagNameCheck instanceof RegExp&&Gt(he.tagNameCheck,W)||he.tagNameCheck instanceof Function&&he.tagNameCheck(W))&&(he.attributeNameCheck instanceof RegExp&&Gt(he.attributeNameCheck,_e)||he.attributeNameCheck instanceof Function&&he.attributeNameCheck(_e,W))||_e==="is"&&he.allowCustomizedBuiltInElements&&(he.tagNameCheck instanceof RegExp&&Gt(he.tagNameCheck,ge)||he.tagNameCheck instanceof Function&&he.tagNameCheck(ge))))return!1}else if(!Li[_e]){if(!Gt(U,fa(ge,ee,""))){if(!((_e==="src"||_e==="xlink:href"||_e==="href")&&W!=="script"&&v2(ge,"data:")===0&&Vi[W])){if(!(ve&&!Gt(V,fa(ge,ee,"")))){if(ge)return!1}}}}}}}return!0},Ta=function(W){return W!=="annotation-xml"&&Pu(W,N)},Aa=function(W){it(I.beforeSanitizeAttributes,W,null);const{attributes:_e}=W;if(!_e||gi(W))return;const ge={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:X,forceKeepAttr:void 0};let Ze=_e.length;for(;Ze--;){const at=_e[Ze],{name:ke,namespaceURI:zt,value:yi}=at,Jt=mt(ke),Pi=yi;let At=ke==="value"?Pi:g2(Pi);if(ge.attrName=Jt,ge.attrValue=At,ge.keepAttr=!0,ge.forceKeepAttr=void 0,it(I.uponSanitizeAttribute,W,ge),At=ge.attrValue,Ki&&(Jt==="id"||Jt==="name")&&(Ni(ke,W),At=Pt+At),je&&Gt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,At)){Ni(ke,W);continue}if(Jt==="attributename"&&Pu(At,"href")){Ni(ke,W);continue}if(ge.forceKeepAttr)continue;if(!ge.keepAttr){Ni(ke,W);continue}if(!pe&&Gt(/\/>/i,At)){Ni(ke,W);continue}Te&&Wo([q,P,Q],yn=>{At=fa(At,yn," ")});const gn=mt(W.nodeName);if(!Ss(gn,Jt,At)){Ni(ke,W);continue}if(S&&typeof x=="object"&&typeof x.getAttributeType=="function"&&!zt)switch(x.getAttributeType(gn,Jt)){case"TrustedHTML":{At=S.createHTML(At);break}case"TrustedScriptURL":{At=S.createScriptURL(At);break}}if(At!==Pi)try{zt?W.setAttributeNS(zt,ke,At):W.setAttribute(ke,At),gi(W)?Xt(W):Qm(s.removed)}catch{Ni(ke,W)}}it(I.afterSanitizeAttributes,W,null)},Ra=function Se(W){let _e=null;const ge=vn(W);for(it(I.beforeSanitizeShadowDOM,W,null);_e=ge.nextNode();)it(I.uponSanitizeShadowNode,_e,null),er(_e),Aa(_e),_e.content instanceof w&&Se(_e.content);it(I.afterSanitizeShadowDOM,W,null)};return s.sanitize=function(Se){let W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_e=null,ge=null,Ze=null,at=null;if(un=!Se,un&&(Se="<!-->"),typeof Se!="string"&&!St(Se))if(typeof Se.toString=="function"){if(Se=Se.toString(),typeof Se!="string")throw da("dirty is not a string, aborting")}else throw da("toString is not a function");if(!s.isSupported)return Se;if(ct||dn(W),s.removed=[],typeof Se=="string"&&(Dt=!1),Dt){if(Se.nodeName){const yi=mt(Se.nodeName);if(!L[yi]||me[yi])throw da("root node is forbidden and cannot be sanitized in-place")}}else if(Se instanceof l)_e=pn("<!---->"),ge=_e.ownerDocument.importNode(Se,!0),ge.nodeType===ma.element&&ge.nodeName==="BODY"||ge.nodeName==="HTML"?_e=ge:_e.appendChild(ge);else{if(!Ft&&!Te&&!Ue&&Se.indexOf("<")===-1)return S&&pi?S.createHTML(Se):Se;if(_e=pn(Se),!_e)return Ft?null:pi?A:""}_e&&Ee&&Xt(_e.firstChild);const ke=vn(Dt?Se:_e);for(;Ze=ke.nextNode();)er(Ze),Aa(Ze),Ze.content instanceof w&&Ra(Ze.content);if(Dt)return Se;if(Ft){if(mi)for(at=E.call(_e.ownerDocument);_e.firstChild;)at.appendChild(_e.firstChild);else at=_e;return(X.shadowroot||X.shadowrootmode)&&(at=$.call(o,at,!0)),at}let zt=Ue?_e.outerHTML:_e.innerHTML;return Ue&&L["!doctype"]&&_e.ownerDocument&&_e.ownerDocument.doctype&&_e.ownerDocument.doctype.name&&Gt(wv,_e.ownerDocument.doctype.name)&&(zt="<!DOCTYPE "+_e.ownerDocument.doctype.name+`>
254
+ `+zt),Te&&Wo([q,P,Q],yi=>{zt=fa(zt,yi," ")}),S&&pi?S.createHTML(zt):zt},s.setConfig=function(){let Se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};dn(Se),ct=!0},s.clearConfig=function(){Qi=null,ct=!1},s.isValidAttribute=function(Se,W,_e){Qi||dn({});const ge=mt(Se),Ze=mt(W);return Ss(ge,Ze,_e)},s.addHook=function(Se,W){typeof W=="function"&&ha(I[Se],W)},s.removeHook=function(Se,W){if(W!==void 0){const _e=m2(I[Se],W);return _e===-1?void 0:p2(I[Se],_e,1)[0]}return Qm(I[Se])},s.removeHooks=function(Se){I[Se]=[]},s.removeAllHooks=function(){I=np()},s}var L2=Ev();function wa(i){return L2.sanitize(i,{ALLOWED_TAGS:[]})}const N2={Read:"📖",Edit:"✏️",Write:"📝",Bash:"💻",Search:"🔍"};function B2(i){return i?N2[i]??"❓":"❓"}function z2(i){if(!i)return"";try{return new Date(i).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch{return""}}function Gu({entry:i}){const s=i.role==="user";return O.jsx("div",{className:`flex ${s?"justify-end":"justify-start"} mb-3`,children:O.jsxs("div",{className:`max-w-[80%] rounded-lg px-4 py-2.5 text-sm leading-relaxed ${s?"bg-[#1a1a3e] text-[#e0e0e0] rounded-br-sm":"bg-[#111118] text-[#e0e0e0] rounded-bl-sm border border-[#1a1a2e]"}`,children:[O.jsx("div",{className:"whitespace-pre-wrap break-words",children:wa(i.text)}),i.timestamp&&O.jsx("div",{className:`text-[10px] mt-1 ${s?"text-[#555]":"text-[#444]"}`,children:z2(i.timestamp)})]})})}function j2({entry:i}){const[s,a]=F.useState(!1);return O.jsx("div",{className:"flex justify-start mb-3",children:O.jsxs("div",{className:"max-w-[80%] w-full",children:[O.jsxs("button",{onClick:()=>a(o=>!o),className:"flex items-center gap-2 text-xs text-[#555] hover:text-[#777] transition-colors py-1 group",children:[O.jsx("span",{className:"inline-block transition-transform duration-200",style:{transform:s?"rotate(90deg)":"rotate(0deg)"},children:"▶"}),O.jsx("span",{className:"italic",children:"Thinking…"})]}),s&&O.jsx("div",{className:"bg-[#0d0d12] border border-[#1a1a2e] rounded-lg px-4 py-3 mt-1 text-sm text-[#555] italic leading-relaxed whitespace-pre-wrap break-words max-h-64 overflow-y-auto",children:wa(i.text)})]})})}function H2({entry:i}){const s=wa(i.text),a=s.length>100?s.slice(0,100)+"…":s;return O.jsx("div",{className:"flex justify-start mb-3",children:O.jsxs("div",{className:"max-w-[80%] w-full bg-[#0d0d12] border border-[#1a1a2e] rounded-lg overflow-hidden",children:[O.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-[#1a1a2e]",children:[O.jsx("span",{className:"text-base",children:B2(i.toolName)}),O.jsx("span",{className:"text-xs font-semibold text-[#00e5ff] font-mono",children:i.toolName??"Tool"}),O.jsx("span",{className:"text-[10px] text-[#555] ml-auto",children:"tool_use"})]}),O.jsx("div",{className:"px-3 py-2 text-xs text-[#888] font-mono whitespace-pre-wrap break-all max-h-32 overflow-y-auto",children:a})]})})}function U2({entry:i}){const s=i.text.toLowerCase().startsWith("error");return O.jsx("div",{className:"flex justify-start mb-3",children:O.jsxs("div",{className:`max-w-[80%] w-full bg-[#0d0d12] rounded-lg overflow-hidden ${s?"border border-[#ff3366]/40":"border border-[#00ff88]/30"}`,children:[O.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 border-b border-[#1a1a2e]",children:[O.jsx("span",{className:"text-xs font-semibold text-[#888]",children:s?"✗ Result":"✓ Result"}),i.toolName&&O.jsx("span",{className:"text-[10px] text-[#555] font-mono",children:i.toolName})]}),O.jsx("div",{className:"px-3 py-2 text-xs text-[#666] font-mono whitespace-pre-wrap break-all max-h-32 overflow-y-auto",children:wa(i.text)||"(empty)"})]})})}function I2({entry:i}){if(i.role==="user")return O.jsx(Gu,{entry:i});switch(i.contentType){case"text":return O.jsx(Gu,{entry:i});case"thinking":return O.jsx(j2,{entry:i});case"tool_use":return O.jsx(H2,{entry:i});case"tool_result":return O.jsx(U2,{entry:i});case"permission_request":return O.jsxs("div",{className:"text-red-400 text-sm font-semibold px-3 py-2",children:["Permission Request: ",wa(i.text)]});default:return O.jsx(Gu,{entry:i})}}const Ko=1e3;function Wu(i){return`${i.timestamp??""}:${i.role}:${i.contentType}:${i.text.length}:${i.text.slice(0,80)}`}function P2({sessionId:i}){const[s,a]=F.useState([]),[o,g]=F.useState(!0),[w,T]=F.useState(null),l=ft(S=>S.token),[h,u]=F.useState({thinking:!1,tool_use:!0,tool_result:!0}),[y,m]=F.useState(!1),b=F.useRef(null),x=F.useRef(null),k=F.useRef(!1),C=F.useRef(new Set);F.useEffect(()=>{let S=!1;return RE(i).then(A=>{if(!S){const R=A.messages??[],M=R.length>Ko?R.slice(R.length-Ko):R;a(M),C.current=new Set(M.map(Wu))}}).catch(A=>{S||T(A instanceof Error?A.message:"Failed to load")}).finally(()=>{S||g(!1)}),()=>{S=!0}},[i]),F.useEffect(()=>{const S=gv(i,A=>{try{const R=JSON.parse(A.data);if(R.event!=="message")return;const M=R.data;a(E=>{const B=Wu(M);if(C.current.has(B))return E;C.current.add(B);const $=[...E,M];if($.length>Ko){const I=$.length-Ko,q=$.slice(I);for(let P=0;P<I;P++)C.current.delete(Wu($[P]));return q}return $})}catch{}},l);return()=>S()},[i,l]),F.useEffect(()=>{var S;k.current||(S=b.current)==null||S.scrollIntoView({behavior:"smooth"})},[s]);const _=F.useCallback(()=>{const S=x.current;if(!S)return;const A=S.scrollHeight-S.scrollTop-S.clientHeight<60;k.current=!A,m(!A)},[]),v=F.useCallback(()=>{var S;k.current=!1,(S=b.current)==null||S.scrollIntoView({behavior:"smooth"})},[]),f=F.useCallback(S=>{u(A=>({...A,[S]:!A[S]}))},[]),p=F.useMemo(()=>s.filter(S=>S.role==="user"?!0:!(S.contentType==="thinking"&&!h.thinking||S.contentType==="tool_use"&&!h.tool_use||S.contentType==="tool_result"&&!h.tool_result)),[s,h]);return o?O.jsx("div",{className:"flex items-center justify-center h-full text-[#555] text-sm",children:O.jsx("div",{className:"animate-pulse",children:"Loading transcript…"})}):w?O.jsxs("div",{className:"flex items-center justify-center h-full text-[#ff3366] text-sm",children:["⚠ ",w]}):O.jsxs("div",{className:"flex flex-col h-full relative",children:[O.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-b border-[#1a1a2e] bg-[#0a0a0f] shrink-0",children:[O.jsx("span",{className:"text-[10px] text-[#555] uppercase tracking-wider",children:"Filter:"}),["thinking","tool_use","tool_result"].map(S=>O.jsx("button",{onClick:()=>f(S),"aria-pressed":h[S],className:`text-xs px-2 py-0.5 rounded border transition-colors ${h[S]?"border-[#00e5ff]/40 text-[#00e5ff] bg-[#00e5ff]/10":"border-[#1a1a2e] text-[#555] hover:text-[#888]"}`,children:S==="tool_use"?"Tools":S==="tool_result"?"Results":S},S)),O.jsxs("span",{className:"text-[10px] text-[#444] ml-auto",children:[p.length," / ",s.length]})]}),O.jsxs("div",{ref:x,onScroll:_,className:"flex-1 overflow-y-auto px-4 py-3",children:[p.length===0&&O.jsx("div",{className:"flex items-center justify-center h-full text-[#555] text-sm",children:"No messages yet"}),p.map((S,A)=>O.jsx(I2,{entry:S},S.toolUseId??`${S.role}-${S.timestamp??A}`)),O.jsx("div",{ref:b})]}),y&&O.jsx("button",{onClick:v,className:"absolute bottom-4 right-4 bg-[#1a1a2e] hover:bg-[#2a2a3e] text-[#00e5ff] rounded-full w-10 h-10 flex items-center justify-center shadow-lg border border-[#1a1a2e] transition-colors z-10",title:"Scroll to bottom",children:"↓"})]})}var Yu={exports:{}},ap;function $2(){return ap||(ap=1,(function(i,s){(function(a,o){i.exports=o()})(globalThis,(()=>(()=>{var a={4567:function(T,l,h){var u=this&&this.__decorate||function(f,p,S,A){var R,M=arguments.length,E=M<3?p:A===null?A=Object.getOwnPropertyDescriptor(p,S):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(f,p,S,A);else for(var B=f.length-1;B>=0;B--)(R=f[B])&&(E=(M<3?R(E):M>3?R(p,S,E):R(p,S))||E);return M>3&&E&&Object.defineProperty(p,S,E),E},y=this&&this.__param||function(f,p){return function(S,A){p(S,A,f)}};Object.defineProperty(l,"__esModule",{value:!0}),l.AccessibilityManager=void 0;const m=h(9042),b=h(9924),x=h(844),k=h(4725),C=h(2585),_=h(3656);let v=l.AccessibilityManager=class extends x.Disposable{constructor(f,p,S,A){super(),this._terminal=f,this._coreBrowserService=S,this._renderService=A,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 R=0;R<this._terminal.rows;R++)this._rowElements[R]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[R]);if(this._topBoundaryFocusListener=R=>this._handleBoundaryFocus(R,0),this._bottomBoundaryFocusListener=R=>this._handleBoundaryFocus(R,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 b.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((R=>this._handleResize(R.rows)))),this.register(this._terminal.onRender((R=>this._refreshRows(R.start,R.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((R=>this._handleChar(R)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
255
+ `)))),this.register(this._terminal.onA11yTab((R=>this._handleTab(R)))),this.register(this._terminal.onKey((R=>this._handleKey(R.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,_.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,x.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(f){for(let p=0;p<f;p++)this._handleChar(" ")}_handleChar(f){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==f&&(this._charsToAnnounce+=f):this._charsToAnnounce+=f,f===`
256
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=m.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(f){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(f)||this._charsToConsume.push(f)}_refreshRows(f,p){this._liveRegionDebouncer.refresh(f,p,this._terminal.rows)}_renderRows(f,p){const S=this._terminal.buffer,A=S.lines.length.toString();for(let R=f;R<=p;R++){const M=S.lines.get(S.ydisp+R),E=[],B=(M==null?void 0:M.translateToString(!0,void 0,void 0,E))||"",$=(S.ydisp+R+1).toString(),I=this._rowElements[R];I&&(B.length===0?(I.innerText=" ",this._rowColumns.set(I,[0,1])):(I.textContent=B,this._rowColumns.set(I,E)),I.setAttribute("aria-posinset",$),I.setAttribute("aria-setsize",A))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(f,p){const S=f.target,A=this._rowElements[p===0?1:this._rowElements.length-2];if(S.getAttribute("aria-posinset")===(p===0?"1":`${this._terminal.buffer.lines.length}`)||f.relatedTarget!==A)return;let R,M;if(p===0?(R=S,M=this._rowElements.pop(),this._rowContainer.removeChild(M)):(R=this._rowElements.shift(),M=S,this._rowContainer.removeChild(R)),R.removeEventListener("focus",this._topBoundaryFocusListener),M.removeEventListener("focus",this._bottomBoundaryFocusListener),p===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(p===0?-1:1),this._rowElements[p===0?1:this._rowElements.length-2].focus(),f.preventDefault(),f.stopImmediatePropagation()}_handleSelectionChange(){var B;if(this._rowElements.length===0)return;const f=document.getSelection();if(!f)return;if(f.isCollapsed)return void(this._rowContainer.contains(f.anchorNode)&&this._terminal.clearSelection());if(!f.anchorNode||!f.focusNode)return void console.error("anchorNode and/or focusNode are null");let p={node:f.anchorNode,offset:f.anchorOffset},S={node:f.focusNode,offset:f.focusOffset};if((p.node.compareDocumentPosition(S.node)&Node.DOCUMENT_POSITION_PRECEDING||p.node===S.node&&p.offset>S.offset)&&([p,S]=[S,p]),p.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(p={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(p.node))return;const A=this._rowElements.slice(-1)[0];if(S.node.compareDocumentPosition(A)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(S={node:A,offset:((B=A.textContent)==null?void 0:B.length)??0}),!this._rowContainer.contains(S.node))return;const R=({node:$,offset:I})=>{const q=$ instanceof Text?$.parentNode:$;let P=parseInt(q==null?void 0:q.getAttribute("aria-posinset"),10)-1;if(isNaN(P))return console.warn("row is invalid. Race condition?"),null;const Q=this._rowColumns.get(q);if(!Q)return console.warn("columns is null. Race condition?"),null;let re=I<Q.length?Q[I]:Q.slice(-1)[0]+1;return re>=this._terminal.cols&&(++P,re=0),{row:P,column:re}},M=R(p),E=R(S);if(M&&E){if(M.row>E.row||M.row===E.row&&M.column>=E.column)throw new Error("invalid range");this._terminal.select(M.column,M.row,(E.row-M.row)*this._terminal.cols-M.column+E.column)}}_handleResize(f){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let p=this._rowContainer.children.length;p<this._terminal.rows;p++)this._rowElements[p]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[p]);for(;this._rowElements.length>f;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const f=this._coreBrowserService.mainDocument.createElement("div");return f.setAttribute("role","listitem"),f.tabIndex=-1,this._refreshRowDimensions(f),f}_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 f=0;f<this._terminal.rows;f++)this._refreshRowDimensions(this._rowElements[f])}}_refreshRowDimensions(f){f.style.height=`${this._renderService.dimensions.css.cell.height}px`}};l.AccessibilityManager=v=u([y(1,C.IInstantiationService),y(2,k.ICoreBrowserService),y(3,k.IRenderService)],v)},3614:(T,l)=>{function h(b){return b.replace(/\r?\n/g,"\r")}function u(b,x){return x?"\x1B[200~"+b+"\x1B[201~":b}function y(b,x,k,C){b=u(b=h(b),k.decPrivateModes.bracketedPasteMode&&C.rawOptions.ignoreBracketedPasteMode!==!0),k.triggerDataEvent(b,!0),x.value=""}function m(b,x,k){const C=k.getBoundingClientRect(),_=b.clientX-C.left-10,v=b.clientY-C.top-10;x.style.width="20px",x.style.height="20px",x.style.left=`${_}px`,x.style.top=`${v}px`,x.style.zIndex="1000",x.focus()}Object.defineProperty(l,"__esModule",{value:!0}),l.rightClickHandler=l.moveTextAreaUnderMouseCursor=l.paste=l.handlePasteEvent=l.copyHandler=l.bracketTextForPaste=l.prepareTextForTerminal=void 0,l.prepareTextForTerminal=h,l.bracketTextForPaste=u,l.copyHandler=function(b,x){b.clipboardData&&b.clipboardData.setData("text/plain",x.selectionText),b.preventDefault()},l.handlePasteEvent=function(b,x,k,C){b.stopPropagation(),b.clipboardData&&y(b.clipboardData.getData("text/plain"),x,k,C)},l.paste=y,l.moveTextAreaUnderMouseCursor=m,l.rightClickHandler=function(b,x,k,C,_){m(b,x,k),_&&C.rightClickSelect(b),x.value=C.selectionText,x.select()}},7239:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorContrastCache=void 0;const u=h(1505);l.ColorContrastCache=class{constructor(){this._color=new u.TwoKeyMap,this._css=new u.TwoKeyMap}setCss(y,m,b){this._css.set(y,m,b)}getCss(y,m){return this._css.get(y,m)}setColor(y,m,b){this._color.set(y,m,b)}getColor(y,m){return this._color.get(y,m)}clear(){this._color.clear(),this._css.clear()}}},3656:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.addDisposableDomListener=void 0,l.addDisposableDomListener=function(h,u,y,m){h.addEventListener(u,y,m);let b=!1;return{dispose:()=>{b||(b=!0,h.removeEventListener(u,y,m))}}}},3551:function(T,l,h){var u=this&&this.__decorate||function(v,f,p,S){var A,R=arguments.length,M=R<3?f:S===null?S=Object.getOwnPropertyDescriptor(f,p):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(v,f,p,S);else for(var E=v.length-1;E>=0;E--)(A=v[E])&&(M=(R<3?A(M):R>3?A(f,p,M):A(f,p))||M);return R>3&&M&&Object.defineProperty(f,p,M),M},y=this&&this.__param||function(v,f){return function(p,S){f(p,S,v)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Linkifier=void 0;const m=h(3656),b=h(8460),x=h(844),k=h(2585),C=h(4725);let _=l.Linkifier=class extends x.Disposable{get currentLink(){return this._currentLink}constructor(v,f,p,S,A){super(),this._element=v,this._mouseService=f,this._renderService=p,this._bufferService=S,this._linkProviderService=A,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new b.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new b.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,x.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,x.toDisposable)((()=>{var R;this._lastMouseEvent=void 0,(R=this._activeProviderReplies)==null||R.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,m.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,m.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,m.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,m.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(v){this._lastMouseEvent=v;const f=this._positionFromMouseEvent(v,this._element,this._mouseService);if(!f)return;this._isMouseOut=!1;const p=v.composedPath();for(let S=0;S<p.length;S++){const A=p[S];if(A.classList.contains("xterm"))break;if(A.classList.contains("xterm-hover"))return}this._lastBufferCell&&f.x===this._lastBufferCell.x&&f.y===this._lastBufferCell.y||(this._handleHover(f),this._lastBufferCell=f)}_handleHover(v){if(this._activeLine!==v.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(v,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,v)||(this._clearCurrentLink(),this._askForLink(v,!0))}_askForLink(v,f){var S,A;this._activeProviderReplies&&f||((S=this._activeProviderReplies)==null||S.forEach((R=>{R==null||R.forEach((M=>{M.link.dispose&&M.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=v.y);let p=!1;for(const[R,M]of this._linkProviderService.linkProviders.entries())f?(A=this._activeProviderReplies)!=null&&A.get(R)&&(p=this._checkLinkProviderResult(R,v,p)):M.provideLinks(v.y,(E=>{var $,I;if(this._isMouseOut)return;const B=E==null?void 0:E.map((q=>({link:q})));($=this._activeProviderReplies)==null||$.set(R,B),p=this._checkLinkProviderResult(R,v,p),((I=this._activeProviderReplies)==null?void 0:I.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(v.y,this._activeProviderReplies)}))}_removeIntersectingLinks(v,f){const p=new Set;for(let S=0;S<f.size;S++){const A=f.get(S);if(A)for(let R=0;R<A.length;R++){const M=A[R],E=M.link.range.start.y<v?0:M.link.range.start.x,B=M.link.range.end.y>v?this._bufferService.cols:M.link.range.end.x;for(let $=E;$<=B;$++){if(p.has($)){A.splice(R--,1);break}p.add($)}}}}_checkLinkProviderResult(v,f,p){var R;if(!this._activeProviderReplies)return p;const S=this._activeProviderReplies.get(v);let A=!1;for(let M=0;M<v;M++)this._activeProviderReplies.has(M)&&!this._activeProviderReplies.get(M)||(A=!0);if(!A&&S){const M=S.find((E=>this._linkAtPosition(E.link,f)));M&&(p=!0,this._handleNewLink(M))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!p)for(let M=0;M<this._activeProviderReplies.size;M++){const E=(R=this._activeProviderReplies.get(M))==null?void 0:R.find((B=>this._linkAtPosition(B.link,f)));if(E){p=!0,this._handleNewLink(E);break}}return p}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(v){if(!this._currentLink)return;const f=this._positionFromMouseEvent(v,this._element,this._mouseService);f&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,f)&&this._currentLink.link.activate(v,this._currentLink.link.text)}_clearCurrentLink(v,f){this._currentLink&&this._lastMouseEvent&&(!v||!f||this._currentLink.link.range.start.y>=v&&this._currentLink.link.range.end.y<=f)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,x.disposeArray)(this._linkCacheDisposables))}_handleNewLink(v){if(!this._lastMouseEvent)return;const f=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);f&&this._linkAtPosition(v.link,f)&&(this._currentLink=v,this._currentLink.state={decorations:{underline:v.link.decorations===void 0||v.link.decorations.underline,pointerCursor:v.link.decorations===void 0||v.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,v.link,this._lastMouseEvent),v.link.decorations={},Object.defineProperties(v.link.decorations,{pointerCursor:{get:()=>{var p,S;return(S=(p=this._currentLink)==null?void 0:p.state)==null?void 0:S.decorations.pointerCursor},set:p=>{var S;(S=this._currentLink)!=null&&S.state&&this._currentLink.state.decorations.pointerCursor!==p&&(this._currentLink.state.decorations.pointerCursor=p,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",p))}},underline:{get:()=>{var p,S;return(S=(p=this._currentLink)==null?void 0:p.state)==null?void 0:S.decorations.underline},set:p=>{var S,A,R;(S=this._currentLink)!=null&&S.state&&((R=(A=this._currentLink)==null?void 0:A.state)==null?void 0:R.decorations.underline)!==p&&(this._currentLink.state.decorations.underline=p,this._currentLink.state.isHovered&&this._fireUnderlineEvent(v.link,p))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((p=>{if(!this._currentLink)return;const S=p.start===0?0:p.start+1+this._bufferService.buffer.ydisp,A=this._bufferService.buffer.ydisp+1+p.end;if(this._currentLink.link.range.start.y>=S&&this._currentLink.link.range.end.y<=A&&(this._clearCurrentLink(S,A),this._lastMouseEvent)){const R=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);R&&this._askForLink(R,!1)}}))))}_linkHover(v,f,p){var S;(S=this._currentLink)!=null&&S.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(f,!0),this._currentLink.state.decorations.pointerCursor&&v.classList.add("xterm-cursor-pointer")),f.hover&&f.hover(p,f.text)}_fireUnderlineEvent(v,f){const p=v.range,S=this._bufferService.buffer.ydisp,A=this._createLinkUnderlineEvent(p.start.x-1,p.start.y-S-1,p.end.x,p.end.y-S-1,void 0);(f?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(A)}_linkLeave(v,f,p){var S;(S=this._currentLink)!=null&&S.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(f,!1),this._currentLink.state.decorations.pointerCursor&&v.classList.remove("xterm-cursor-pointer")),f.leave&&f.leave(p,f.text)}_linkAtPosition(v,f){const p=v.range.start.y*this._bufferService.cols+v.range.start.x,S=v.range.end.y*this._bufferService.cols+v.range.end.x,A=f.y*this._bufferService.cols+f.x;return p<=A&&A<=S}_positionFromMouseEvent(v,f,p){const S=p.getCoords(v,f,this._bufferService.cols,this._bufferService.rows);if(S)return{x:S[0],y:S[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(v,f,p,S,A){return{x1:v,y1:f,x2:p,y2:S,cols:this._bufferService.cols,fg:A}}};l.Linkifier=_=u([y(1,C.IMouseService),y(2,C.IRenderService),y(3,k.IBufferService),y(4,C.ILinkProviderService)],_)},9042:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.tooMuchOutput=l.promptLabel=void 0,l.promptLabel="Terminal input",l.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(T,l,h){var u=this&&this.__decorate||function(C,_,v,f){var p,S=arguments.length,A=S<3?_:f===null?f=Object.getOwnPropertyDescriptor(_,v):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(C,_,v,f);else for(var R=C.length-1;R>=0;R--)(p=C[R])&&(A=(S<3?p(A):S>3?p(_,v,A):p(_,v))||A);return S>3&&A&&Object.defineProperty(_,v,A),A},y=this&&this.__param||function(C,_){return function(v,f){_(v,f,C)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkProvider=void 0;const m=h(511),b=h(2585);let x=l.OscLinkProvider=class{constructor(C,_,v){this._bufferService=C,this._optionsService=_,this._oscLinkService=v}provideLinks(C,_){var B;const v=this._bufferService.buffer.lines.get(C-1);if(!v)return void _(void 0);const f=[],p=this._optionsService.rawOptions.linkHandler,S=new m.CellData,A=v.getTrimmedLength();let R=-1,M=-1,E=!1;for(let $=0;$<A;$++)if(M!==-1||v.hasContent($)){if(v.loadCell($,S),S.hasExtendedAttrs()&&S.extended.urlId){if(M===-1){M=$,R=S.extended.urlId;continue}E=S.extended.urlId!==R}else M!==-1&&(E=!0);if(E||M!==-1&&$===A-1){const I=(B=this._oscLinkService.getLinkData(R))==null?void 0:B.uri;if(I){const q={start:{x:M+1,y:C},end:{x:$+(E||$!==A-1?0:1),y:C}};let P=!1;if(!(p!=null&&p.allowNonHttpProtocols))try{const Q=new URL(I);["http:","https:"].includes(Q.protocol)||(P=!0)}catch{P=!0}P||f.push({text:I,range:q,activate:(Q,re)=>p?p.activate(Q,re,q):k(0,re),hover:(Q,re)=>{var G;return(G=p==null?void 0:p.hover)==null?void 0:G.call(p,Q,re,q)},leave:(Q,re)=>{var G;return(G=p==null?void 0:p.leave)==null?void 0:G.call(p,Q,re,q)}})}E=!1,S.hasExtendedAttrs()&&S.extended.urlId?(M=$,R=S.extended.urlId):(M=-1,R=-1)}}_(f)}};function k(C,_){if(confirm(`Do you want to navigate to ${_}?
257
+
258
+ WARNING: This link could potentially be dangerous`)){const v=window.open();if(v){try{v.opener=null}catch{}v.location.href=_}else console.warn("Opening link blocked as opener could not be cleared")}}l.OscLinkProvider=x=u([y(0,b.IBufferService),y(1,b.IOptionsService),y(2,b.IOscLinkService)],x)},6193:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.RenderDebouncer=void 0,l.RenderDebouncer=class{constructor(h,u){this._renderCallback=h,this._coreBrowserService=u,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(h){return this._refreshCallbacks.push(h),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(h,u,y){this._rowCount=y,h=h!==void 0?h:0,u=u!==void 0?u:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,h):h,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,u):u,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 h=Math.max(this._rowStart,0),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(h,u),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const h of this._refreshCallbacks)h(0);this._refreshCallbacks=[]}}},3236:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const u=h(3614),y=h(3656),m=h(3551),b=h(9042),x=h(3730),k=h(1680),C=h(3107),_=h(5744),v=h(2950),f=h(1296),p=h(428),S=h(4269),A=h(5114),R=h(8934),M=h(3230),E=h(9312),B=h(4725),$=h(6731),I=h(8055),q=h(8969),P=h(8460),Q=h(844),re=h(6114),G=h(8437),V=h(2584),ee=h(7399),N=h(5941),U=h(9074),L=h(2585),H=h(5435),X=h(4567),ne=h(779);class he extends q.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(Y={}){super(Y),this.browser=re,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new Q.MutableDisposable),this._onCursorMove=this.register(new P.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new P.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new P.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new P.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new P.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new P.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new P.EventEmitter),this._onBlur=this.register(new P.EventEmitter),this._onA11yCharEmitter=this.register(new P.EventEmitter),this._onA11yTabEmitter=this.register(new P.EventEmitter),this._onWillOpen=this.register(new P.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(U.DecorationService),this._instantiationService.setService(L.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ne.LinkProviderService),this._instantiationService.setService(B.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(x.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((j,ce)=>this.refresh(j,ce)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((j=>this._reportWindowsOptions(j)))),this.register(this._inputHandler.onColor((j=>this._handleColorEvent(j)))),this.register((0,P.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,P.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,P.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,P.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((j=>this._afterResize(j.cols,j.rows)))),this.register((0,Q.toDisposable)((()=>{var j,ce;this._customKeyEventHandler=void 0,(ce=(j=this.element)==null?void 0:j.parentNode)==null||ce.removeChild(this.element)})))}_handleColorEvent(Y){if(this._themeService)for(const j of Y){let ce,oe="";switch(j.index){case 256:ce="foreground",oe="10";break;case 257:ce="background",oe="11";break;case 258:ce="cursor",oe="12";break;default:ce="ansi",oe="4;"+j.index}switch(j.type){case 0:const ve=I.color.toColorRGB(ce==="ansi"?this._themeService.colors.ansi[j.index]:this._themeService.colors[ce]);this.coreService.triggerDataEvent(`${V.C0.ESC}]${oe};${(0,N.toRgbString)(ve)}${V.C1_ESCAPED.ST}`);break;case 1:if(ce==="ansi")this._themeService.modifyColors((pe=>pe.ansi[j.index]=I.channels.toColor(...j.color)));else{const pe=ce;this._themeService.modifyColors((Te=>Te[pe]=I.channels.toColor(...j.color)))}break;case 2:this._themeService.restoreColor(j.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(Y){Y?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(X.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(Y){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(V.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var Y;return(Y=this.textarea)==null?void 0:Y.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(V.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 Y=this.buffer.ybase+this.buffer.y,j=this.buffer.lines.get(Y);if(!j)return;const ce=Math.min(this.buffer.x,this.cols-1),oe=this._renderService.dimensions.css.cell.height,ve=j.getWidth(ce),pe=this._renderService.dimensions.css.cell.width*ve,Te=this.buffer.y*this._renderService.dimensions.css.cell.height,je=ce*this._renderService.dimensions.css.cell.width;this.textarea.style.left=je+"px",this.textarea.style.top=Te+"px",this.textarea.style.width=pe+"px",this.textarea.style.height=oe+"px",this.textarea.style.lineHeight=oe+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,y.addDisposableDomListener)(this.element,"copy",(j=>{this.hasSelection()&&(0,u.copyHandler)(j,this._selectionService)})));const Y=j=>(0,u.handlePasteEvent)(j,this.textarea,this.coreService,this.optionsService);this.register((0,y.addDisposableDomListener)(this.textarea,"paste",Y)),this.register((0,y.addDisposableDomListener)(this.element,"paste",Y)),re.isFirefox?this.register((0,y.addDisposableDomListener)(this.element,"mousedown",(j=>{j.button===2&&(0,u.rightClickHandler)(j,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,y.addDisposableDomListener)(this.element,"contextmenu",(j=>{(0,u.rightClickHandler)(j,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),re.isLinux&&this.register((0,y.addDisposableDomListener)(this.element,"auxclick",(j=>{j.button===1&&(0,u.moveTextAreaUnderMouseCursor)(j,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,y.addDisposableDomListener)(this.textarea,"keyup",(Y=>this._keyUp(Y)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keydown",(Y=>this._keyDown(Y)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keypress",(Y=>this._keyPress(Y)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionupdate",(Y=>this._compositionHelper.compositionupdate(Y)))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,y.addDisposableDomListener)(this.textarea,"input",(Y=>this._inputEvent(Y)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(Y){var ce;if(!Y)throw new Error("Terminal requires a parent element.");if(Y.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ce=this.element)==null?void 0:ce.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=Y.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"),Y.appendChild(this.element);const j=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),j.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,y.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),j.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",b.promptLabel),re.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(A.CoreBrowserService,this.textarea,Y.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(B.ICoreBrowserService,this._coreBrowserService),this.register((0,y.addDisposableDomListener)(this.textarea,"focus",(oe=>this._handleTextAreaFocus(oe)))),this.register((0,y.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(p.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(B.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance($.ThemeService),this._instantiationService.setService(B.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(S.CharacterJoinerService),this._instantiationService.setService(B.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(M.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(B.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(v.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(R.MouseService),this._instantiationService.setService(B.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(m.Linkifier,this.screenElement)),this.element.appendChild(j);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(k.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(B.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,y.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(C.BufferDecorationRenderer,this.screenElement)),this.register((0,y.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(X.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(oe=>this._handleScreenReaderModeOptionChange(oe)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(_.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(oe=>{!this._overviewRulerRenderer&&oe&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(_.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(f.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const Y=this,j=this.element;function ce(pe){const Te=Y._mouseService.getMouseReportCoords(pe,Y.screenElement);if(!Te)return!1;let je,Ue;switch(pe.overrideType||pe.type){case"mousemove":Ue=32,pe.buttons===void 0?(je=3,pe.button!==void 0&&(je=pe.button<3?pe.button:3)):je=1&pe.buttons?0:4&pe.buttons?1:2&pe.buttons?2:3;break;case"mouseup":Ue=0,je=pe.button<3?pe.button:3;break;case"mousedown":Ue=1,je=pe.button<3?pe.button:3;break;case"wheel":if(Y._customWheelEventHandler&&Y._customWheelEventHandler(pe)===!1||Y.viewport.getLinesScrolled(pe)===0)return!1;Ue=pe.deltaY<0?0:1,je=4;break;default:return!1}return!(Ue===void 0||je===void 0||je>4)&&Y.coreMouseService.triggerMouseEvent({col:Te.col,row:Te.row,x:Te.x,y:Te.y,button:je,action:Ue,ctrl:pe.ctrlKey,alt:pe.altKey,shift:pe.shiftKey})}const oe={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ve={mouseup:pe=>(ce(pe),pe.buttons||(this._document.removeEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.removeEventListener("mousemove",oe.mousedrag)),this.cancel(pe)),wheel:pe=>(ce(pe),this.cancel(pe,!0)),mousedrag:pe=>{pe.buttons&&ce(pe)},mousemove:pe=>{pe.buttons||ce(pe)}};this.register(this.coreMouseService.onProtocolChange((pe=>{pe?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(pe)),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&pe?oe.mousemove||(j.addEventListener("mousemove",ve.mousemove),oe.mousemove=ve.mousemove):(j.removeEventListener("mousemove",oe.mousemove),oe.mousemove=null),16&pe?oe.wheel||(j.addEventListener("wheel",ve.wheel,{passive:!1}),oe.wheel=ve.wheel):(j.removeEventListener("wheel",oe.wheel),oe.wheel=null),2&pe?oe.mouseup||(oe.mouseup=ve.mouseup):(this._document.removeEventListener("mouseup",oe.mouseup),oe.mouseup=null),4&pe?oe.mousedrag||(oe.mousedrag=ve.mousedrag):(this._document.removeEventListener("mousemove",oe.mousedrag),oe.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,y.addDisposableDomListener)(j,"mousedown",(pe=>{if(pe.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(pe))return ce(pe),oe.mouseup&&this._document.addEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.addEventListener("mousemove",oe.mousedrag),this.cancel(pe)}))),this.register((0,y.addDisposableDomListener)(j,"wheel",(pe=>{if(!oe.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(pe)===!1)return!1;if(!this.buffer.hasScrollback){const Te=this.viewport.getLinesScrolled(pe);if(Te===0)return;const je=V.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(pe.deltaY<0?"A":"B");let Ue="";for(let ct=0;ct<Math.abs(Te);ct++)Ue+=je;return this.coreService.triggerDataEvent(Ue,!0),this.cancel(pe,!0)}return this.viewport.handleWheel(pe)?this.cancel(pe):void 0}}),{passive:!1})),this.register((0,y.addDisposableDomListener)(j,"touchstart",(pe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(pe),this.cancel(pe)}),{passive:!0})),this.register((0,y.addDisposableDomListener)(j,"touchmove",(pe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(pe)?void 0:this.cancel(pe)}),{passive:!1}))}refresh(Y,j){var ce;(ce=this._renderService)==null||ce.refreshRows(Y,j)}updateCursorStyle(Y){var j;(j=this._selectionService)!=null&&j.shouldColumnSelect(Y)?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(Y,j,ce=0){var oe;ce===1?(super.scrollLines(Y,j,ce),this.refresh(0,this.rows-1)):(oe=this.viewport)==null||oe.scrollLines(Y)}paste(Y){(0,u.paste)(Y,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(Y){this._customKeyEventHandler=Y}attachCustomWheelEventHandler(Y){this._customWheelEventHandler=Y}registerLinkProvider(Y){return this._linkProviderService.registerLinkProvider(Y)}registerCharacterJoiner(Y){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const j=this._characterJoinerService.register(Y);return this.refresh(0,this.rows-1),j}deregisterCharacterJoiner(Y){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(Y)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(Y){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+Y)}registerDecoration(Y){return this._decorationService.registerDecoration(Y)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(Y,j,ce){this._selectionService.setSelection(Y,j,ce)}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 Y;(Y=this._selectionService)==null||Y.clearSelection()}selectAll(){var Y;(Y=this._selectionService)==null||Y.selectAll()}selectLines(Y,j){var ce;(ce=this._selectionService)==null||ce.selectLines(Y,j)}_keyDown(Y){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(Y)===!1)return!1;const j=this.browser.isMac&&this.options.macOptionIsMeta&&Y.altKey;if(!j&&!this._compositionHelper.keydown(Y))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;j||Y.key!=="Dead"&&Y.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ce=(0,ee.evaluateKeyboardEvent)(Y,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Y),ce.type===3||ce.type===2){const oe=this.rows-1;return this.scrollLines(ce.type===2?-oe:oe),this.cancel(Y,!0)}return ce.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,Y)||(ce.cancel&&this.cancel(Y,!0),!ce.key||!!(Y.key&&!Y.ctrlKey&&!Y.altKey&&!Y.metaKey&&Y.key.length===1&&Y.key.charCodeAt(0)>=65&&Y.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ce.key!==V.C0.ETX&&ce.key!==V.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ce.key,domEvent:Y}),this._showCursor(),this.coreService.triggerDataEvent(ce.key,!0),!this.optionsService.rawOptions.screenReaderMode||Y.altKey||Y.ctrlKey?this.cancel(Y,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(Y,j){const ce=Y.isMac&&!this.options.macOptionIsMeta&&j.altKey&&!j.ctrlKey&&!j.metaKey||Y.isWindows&&j.altKey&&j.ctrlKey&&!j.metaKey||Y.isWindows&&j.getModifierState("AltGraph");return j.type==="keypress"?ce:ce&&(!j.keyCode||j.keyCode>47)}_keyUp(Y){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(Y)===!1||((function(j){return j.keyCode===16||j.keyCode===17||j.keyCode===18})(Y)||this.focus(),this.updateCursorStyle(Y),this._keyPressHandled=!1)}_keyPress(Y){let j;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(Y)===!1)return!1;if(this.cancel(Y),Y.charCode)j=Y.charCode;else if(Y.which===null||Y.which===void 0)j=Y.keyCode;else{if(Y.which===0||Y.charCode===0)return!1;j=Y.which}return!(!j||(Y.altKey||Y.ctrlKey||Y.metaKey)&&!this._isThirdLevelShift(this.browser,Y)||(j=String.fromCharCode(j),this._onKey.fire({key:j,domEvent:Y}),this._showCursor(),this.coreService.triggerDataEvent(j,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(Y){if(Y.data&&Y.inputType==="insertText"&&(!Y.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const j=Y.data;return this.coreService.triggerDataEvent(j,!0),this.cancel(Y),!0}return!1}resize(Y,j){Y!==this.cols||j!==this.rows?super.resize(Y,j):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(Y,j){var ce,oe;(ce=this._charSizeService)==null||ce.measure(),(oe=this.viewport)==null||oe.syncScrollArea(!0)}clear(){var Y;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 j=1;j<this.rows;j++)this.buffer.lines.push(this.buffer.getBlankLine(G.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(Y=this.viewport)==null||Y.reset(),this.refresh(0,this.rows-1)}}reset(){var j,ce;this.options.rows=this.rows,this.options.cols=this.cols;const Y=this._customKeyEventHandler;this._setup(),super.reset(),(j=this._selectionService)==null||j.reset(),this._decorationService.reset(),(ce=this.viewport)==null||ce.reset(),this._customKeyEventHandler=Y,this.refresh(0,this.rows-1)}clearTextureAtlas(){var Y;(Y=this._renderService)==null||Y.clearTextureAtlas()}_reportFocus(){var Y;(Y=this.element)!=null&&Y.classList.contains("focus")?this.coreService.triggerDataEvent(V.C0.ESC+"[I"):this.coreService.triggerDataEvent(V.C0.ESC+"[O")}_reportWindowsOptions(Y){if(this._renderService)switch(Y){case H.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const j=this._renderService.dimensions.css.canvas.width.toFixed(0),ce=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${V.C0.ESC}[4;${ce};${j}t`);break;case H.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const oe=this._renderService.dimensions.css.cell.width.toFixed(0),ve=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${V.C0.ESC}[6;${ve};${oe}t`)}}cancel(Y,j){if(this.options.cancelEvents||j)return Y.preventDefault(),Y.stopPropagation(),!1}}l.Terminal=he},9924:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TimeBasedDebouncer=void 0,l.TimeBasedDebouncer=class{constructor(h,u=1e3){this._renderCallback=h,this._debounceThresholdMS=u,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(h,u,y){this._rowCount=y,h=h!==void 0?h:0,u=u!==void 0?u:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,h):h,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,u):u;const m=Date.now();if(m-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=m,this._innerRefresh();else if(!this._additionalRefreshRequested){const b=m-this._lastRefreshMs,x=this._debounceThresholdMS-b;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),x)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const h=Math.max(this._rowStart,0),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(h,u)}}},1680:function(T,l,h){var u=this&&this.__decorate||function(v,f,p,S){var A,R=arguments.length,M=R<3?f:S===null?S=Object.getOwnPropertyDescriptor(f,p):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(v,f,p,S);else for(var E=v.length-1;E>=0;E--)(A=v[E])&&(M=(R<3?A(M):R>3?A(f,p,M):A(f,p))||M);return R>3&&M&&Object.defineProperty(f,p,M),M},y=this&&this.__param||function(v,f){return function(p,S){f(p,S,v)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Viewport=void 0;const m=h(3656),b=h(4725),x=h(8460),k=h(844),C=h(2585);let _=l.Viewport=class extends k.Disposable{constructor(v,f,p,S,A,R,M,E){super(),this._viewportElement=v,this._scrollArea=f,this._bufferService=p,this._optionsService=S,this._charSizeService=A,this._renderService=R,this._coreBrowserService=M,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 x.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,m.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((B=>this._activeBuffer=B.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((B=>this._renderDimensions=B))),this._handleThemeChange(E.colors),this.register(E.onChangeColors((B=>this._handleThemeChange(B)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(v){this._viewportElement.style.backgroundColor=v.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(v){if(v)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 f=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==f&&(this._lastRecordedBufferHeight=f,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const v=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==v&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=v),this._refreshAnimationFrame=null}syncScrollArea(v=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(v);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(v)}_handleScroll(v){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 f=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:f,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const v=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(v*(this._smoothScrollState.target-this._smoothScrollState.origin)),v<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(v,f){const p=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(f<0&&this._viewportElement.scrollTop!==0||f>0&&p<this._lastRecordedBufferHeight)||(v.cancelable&&v.preventDefault(),!1)}handleWheel(v){const f=this._getPixelsScrolled(v);return f!==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+f:this._smoothScrollState.target+=f,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=f,this._bubbleScroll(v,f))}scrollLines(v){if(v!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const f=v*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+f,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:v,suppressScrollEvent:!1})}_getPixelsScrolled(v){if(v.deltaY===0||v.shiftKey)return 0;let f=this._applyScrollModifier(v.deltaY,v);return v.deltaMode===WheelEvent.DOM_DELTA_LINE?f*=this._currentRowHeight:v.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(f*=this._currentRowHeight*this._bufferService.rows),f}getBufferElements(v,f){var E;let p,S="";const A=[],R=f??this._bufferService.buffer.lines.length,M=this._bufferService.buffer.lines;for(let B=v;B<R;B++){const $=M.get(B);if(!$)continue;const I=(E=M.get(B+1))==null?void 0:E.isWrapped;if(S+=$.translateToString(!I),!I||B===M.length-1){const q=document.createElement("div");q.textContent=S,A.push(q),S.length>0&&(p=q),S=""}}return{bufferElements:A,cursorElement:p}}getLinesScrolled(v){if(v.deltaY===0||v.shiftKey)return 0;let f=this._applyScrollModifier(v.deltaY,v);return v.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(f/=this._currentRowHeight+0,this._wheelPartialScroll+=f,f=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):v.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(f*=this._bufferService.rows),f}_applyScrollModifier(v,f){const p=this._optionsService.rawOptions.fastScrollModifier;return p==="alt"&&f.altKey||p==="ctrl"&&f.ctrlKey||p==="shift"&&f.shiftKey?v*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:v*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(v){this._lastTouchY=v.touches[0].pageY}handleTouchMove(v){const f=this._lastTouchY-v.touches[0].pageY;return this._lastTouchY=v.touches[0].pageY,f!==0&&(this._viewportElement.scrollTop+=f,this._bubbleScroll(v,f))}};l.Viewport=_=u([y(2,C.IBufferService),y(3,C.IOptionsService),y(4,b.ICharSizeService),y(5,b.IRenderService),y(6,b.ICoreBrowserService),y(7,b.IThemeService)],_)},3107:function(T,l,h){var u=this&&this.__decorate||function(C,_,v,f){var p,S=arguments.length,A=S<3?_:f===null?f=Object.getOwnPropertyDescriptor(_,v):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(C,_,v,f);else for(var R=C.length-1;R>=0;R--)(p=C[R])&&(A=(S<3?p(A):S>3?p(_,v,A):p(_,v))||A);return S>3&&A&&Object.defineProperty(_,v,A),A},y=this&&this.__param||function(C,_){return function(v,f){_(v,f,C)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferDecorationRenderer=void 0;const m=h(4725),b=h(844),x=h(2585);let k=l.BufferDecorationRenderer=class extends b.Disposable{constructor(C,_,v,f,p){super(),this._screenElement=C,this._bufferService=_,this._coreBrowserService=v,this._decorationService=f,this._renderService=p,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((S=>this._removeDecoration(S)))),this.register((0,b.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 C of this._decorationService.decorations)this._renderDecoration(C);this._dimensionsChanged=!1}_renderDecoration(C){this._refreshStyle(C),this._dimensionsChanged&&this._refreshXPosition(C)}_createElement(C){var f;const _=this._coreBrowserService.mainDocument.createElement("div");_.classList.add("xterm-decoration"),_.classList.toggle("xterm-decoration-top-layer",((f=C==null?void 0:C.options)==null?void 0:f.layer)==="top"),_.style.width=`${Math.round((C.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,_.style.height=(C.options.height||1)*this._renderService.dimensions.css.cell.height+"px",_.style.top=(C.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",_.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const v=C.options.x??0;return v&&v>this._bufferService.cols&&(_.style.display="none"),this._refreshXPosition(C,_),_}_refreshStyle(C){const _=C.marker.line-this._bufferService.buffers.active.ydisp;if(_<0||_>=this._bufferService.rows)C.element&&(C.element.style.display="none",C.onRenderEmitter.fire(C.element));else{let v=this._decorationElements.get(C);v||(v=this._createElement(C),C.element=v,this._decorationElements.set(C,v),this._container.appendChild(v),C.onDispose((()=>{this._decorationElements.delete(C),v.remove()}))),v.style.top=_*this._renderService.dimensions.css.cell.height+"px",v.style.display=this._altBufferIsActive?"none":"block",C.onRenderEmitter.fire(v)}}_refreshXPosition(C,_=C.element){if(!_)return;const v=C.options.x??0;(C.options.anchor||"left")==="right"?_.style.right=v?v*this._renderService.dimensions.css.cell.width+"px":"":_.style.left=v?v*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(C){var _;(_=this._decorationElements.get(C))==null||_.remove(),this._decorationElements.delete(C),C.dispose()}};l.BufferDecorationRenderer=k=u([y(1,x.IBufferService),y(2,m.ICoreBrowserService),y(3,x.IDecorationService),y(4,m.IRenderService)],k)},5871:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorZoneStore=void 0,l.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(h){if(h.options.overviewRulerOptions){for(const u of this._zones)if(u.color===h.options.overviewRulerOptions.color&&u.position===h.options.overviewRulerOptions.position){if(this._lineIntersectsZone(u,h.marker.line))return;if(this._lineAdjacentToZone(u,h.marker.line,h.options.overviewRulerOptions.position))return void this._addLineToZone(u,h.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=h.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=h.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=h.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=h.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:h.options.overviewRulerOptions.color,position:h.options.overviewRulerOptions.position,startBufferLine:h.marker.line,endBufferLine:h.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(h){this._linePadding=h}_lineIntersectsZone(h,u){return u>=h.startBufferLine&&u<=h.endBufferLine}_lineAdjacentToZone(h,u,y){return u>=h.startBufferLine-this._linePadding[y||"full"]&&u<=h.endBufferLine+this._linePadding[y||"full"]}_addLineToZone(h,u){h.startBufferLine=Math.min(h.startBufferLine,u),h.endBufferLine=Math.max(h.endBufferLine,u)}}},5744:function(T,l,h){var u=this&&this.__decorate||function(p,S,A,R){var M,E=arguments.length,B=E<3?S:R===null?R=Object.getOwnPropertyDescriptor(S,A):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(p,S,A,R);else for(var $=p.length-1;$>=0;$--)(M=p[$])&&(B=(E<3?M(B):E>3?M(S,A,B):M(S,A))||B);return E>3&&B&&Object.defineProperty(S,A,B),B},y=this&&this.__param||function(p,S){return function(A,R){S(A,R,p)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OverviewRulerRenderer=void 0;const m=h(5871),b=h(4725),x=h(844),k=h(2585),C={full:0,left:0,center:0,right:0},_={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0};let f=l.OverviewRulerRenderer=class extends x.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(p,S,A,R,M,E,B){var I;super(),this._viewportElement=p,this._screenElement=S,this._bufferService=A,this._decorationService=R,this._renderService=M,this._optionsService=E,this._coreBrowserService=B,this._colorZoneStore=new m.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(),(I=this._viewportElement.parentElement)==null||I.insertBefore(this._canvas,this._viewportElement);const $=this._canvas.getContext("2d");if(!$)throw new Error("Ctx cannot be null");this._ctx=$,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,x.toDisposable)((()=>{var q;(q=this._canvas)==null||q.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 p=Math.floor(this._canvas.width/3),S=Math.ceil(this._canvas.width/3);_.full=this._canvas.width,_.left=p,_.center=S,_.right=p,this._refreshDrawHeightConstants(),v.full=0,v.left=0,v.center=_.left,v.right=_.left+_.center}_refreshDrawHeightConstants(){C.full=Math.round(2*this._coreBrowserService.dpr);const p=this._canvas.height/this._bufferService.buffer.lines.length,S=Math.round(Math.max(Math.min(p,12),6)*this._coreBrowserService.dpr);C.left=S,C.center=S,C.right=S}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*C.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 S of this._decorationService.decorations)this._colorZoneStore.addDecoration(S);this._ctx.lineWidth=1;const p=this._colorZoneStore.zones;for(const S of p)S.position!=="full"&&this._renderColorZone(S);for(const S of p)S.position==="full"&&this._renderColorZone(S);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(p){this._ctx.fillStyle=p.color,this._ctx.fillRect(v[p.position||"full"],Math.round((this._canvas.height-1)*(p.startBufferLine/this._bufferService.buffers.active.lines.length)-C[p.position||"full"]/2),_[p.position||"full"],Math.round((this._canvas.height-1)*((p.endBufferLine-p.startBufferLine)/this._bufferService.buffers.active.lines.length)+C[p.position||"full"]))}_queueRefresh(p,S){this._shouldUpdateDimensions=p||this._shouldUpdateDimensions,this._shouldUpdateAnchor=S||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};l.OverviewRulerRenderer=f=u([y(2,k.IBufferService),y(3,k.IDecorationService),y(4,b.IRenderService),y(5,k.IOptionsService),y(6,b.ICoreBrowserService)],f)},2950:function(T,l,h){var u=this&&this.__decorate||function(C,_,v,f){var p,S=arguments.length,A=S<3?_:f===null?f=Object.getOwnPropertyDescriptor(_,v):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(C,_,v,f);else for(var R=C.length-1;R>=0;R--)(p=C[R])&&(A=(S<3?p(A):S>3?p(_,v,A):p(_,v))||A);return S>3&&A&&Object.defineProperty(_,v,A),A},y=this&&this.__param||function(C,_){return function(v,f){_(v,f,C)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CompositionHelper=void 0;const m=h(4725),b=h(2585),x=h(2584);let k=l.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(C,_,v,f,p,S){this._textarea=C,this._compositionView=_,this._bufferService=v,this._optionsService=f,this._coreService=p,this._renderService=S,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(C){this._compositionView.textContent=C.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(C){if(this._isComposing||this._isSendingComposition){if(C.keyCode===229||C.keyCode===16||C.keyCode===17||C.keyCode===18)return!1;this._finalizeComposition(!1)}return C.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(C){if(this._compositionView.classList.remove("active"),this._isComposing=!1,C){const _={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let v;this._isSendingComposition=!1,_.start+=this._dataAlreadySent.length,v=this._isComposing?this._textarea.value.substring(_.start,_.end):this._textarea.value.substring(_.start),v.length>0&&this._coreService.triggerDataEvent(v,!0)}}),0)}else{this._isSendingComposition=!1;const _=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(_,!0)}}_handleAnyTextareaChanges(){const C=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const _=this._textarea.value,v=_.replace(C,"");this._dataAlreadySent=v,_.length>C.length?this._coreService.triggerDataEvent(v,!0):_.length<C.length?this._coreService.triggerDataEvent(`${x.C0.DEL}`,!0):_.length===C.length&&_!==C&&this._coreService.triggerDataEvent(_,!0)}}),0)}updateCompositionElements(C){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const _=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),v=this._renderService.dimensions.css.cell.height,f=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,p=_*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=p+"px",this._compositionView.style.top=f+"px",this._compositionView.style.height=v+"px",this._compositionView.style.lineHeight=v+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const S=this._compositionView.getBoundingClientRect();this._textarea.style.left=p+"px",this._textarea.style.top=f+"px",this._textarea.style.width=Math.max(S.width,1)+"px",this._textarea.style.height=Math.max(S.height,1)+"px",this._textarea.style.lineHeight=S.height+"px"}C||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};l.CompositionHelper=k=u([y(2,b.IBufferService),y(3,b.IOptionsService),y(4,b.ICoreService),y(5,m.IRenderService)],k)},9806:(T,l)=>{function h(u,y,m){const b=m.getBoundingClientRect(),x=u.getComputedStyle(m),k=parseInt(x.getPropertyValue("padding-left")),C=parseInt(x.getPropertyValue("padding-top"));return[y.clientX-b.left-k,y.clientY-b.top-C]}Object.defineProperty(l,"__esModule",{value:!0}),l.getCoords=l.getCoordsRelativeToElement=void 0,l.getCoordsRelativeToElement=h,l.getCoords=function(u,y,m,b,x,k,C,_,v){if(!k)return;const f=h(u,y,m);return f?(f[0]=Math.ceil((f[0]+(v?C/2:0))/C),f[1]=Math.ceil(f[1]/_),f[0]=Math.min(Math.max(f[0],1),b+(v?1:0)),f[1]=Math.min(Math.max(f[1],1),x),f):void 0}},9504:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.moveToCellSequence=void 0;const u=h(2584);function y(_,v,f,p){const S=_-m(_,f),A=v-m(v,f),R=Math.abs(S-A)-(function(M,E,B){let $=0;const I=M-m(M,B),q=E-m(E,B);for(let P=0;P<Math.abs(I-q);P++){const Q=b(M,E)==="A"?-1:1,re=B.buffer.lines.get(I+Q*P);re!=null&&re.isWrapped&&$++}return $})(_,v,f);return C(R,k(b(_,v),p))}function m(_,v){let f=0,p=v.buffer.lines.get(_),S=p==null?void 0:p.isWrapped;for(;S&&_>=0&&_<v.rows;)f++,p=v.buffer.lines.get(--_),S=p==null?void 0:p.isWrapped;return f}function b(_,v){return _>v?"A":"B"}function x(_,v,f,p,S,A){let R=_,M=v,E="";for(;R!==f||M!==p;)R+=S?1:-1,S&&R>A.cols-1?(E+=A.buffer.translateBufferLineToString(M,!1,_,R),R=0,_=0,M++):!S&&R<0&&(E+=A.buffer.translateBufferLineToString(M,!1,0,_+1),R=A.cols-1,_=R,M--);return E+A.buffer.translateBufferLineToString(M,!1,_,R)}function k(_,v){const f=v?"O":"[";return u.C0.ESC+f+_}function C(_,v){_=Math.floor(_);let f="";for(let p=0;p<_;p++)f+=v;return f}l.moveToCellSequence=function(_,v,f,p){const S=f.buffer.x,A=f.buffer.y;if(!f.buffer.hasScrollback)return(function(E,B,$,I,q,P){return y(B,I,q,P).length===0?"":C(x(E,B,E,B-m(B,q),!1,q).length,k("D",P))})(S,A,0,v,f,p)+y(A,v,f,p)+(function(E,B,$,I,q,P){let Q;Q=y(B,I,q,P).length>0?I-m(I,q):B;const re=I,G=(function(V,ee,N,U,L,H){let X;return X=y(N,U,L,H).length>0?U-m(U,L):ee,V<N&&X<=U||V>=N&&X<U?"C":"D"})(E,B,$,I,q,P);return C(x(E,Q,$,re,G==="C",q).length,k(G,P))})(S,A,_,v,f,p);let R;if(A===v)return R=S>_?"D":"C",C(Math.abs(S-_),k(R,p));R=A>v?"D":"C";const M=Math.abs(A-v);return C((function(E,B){return B.cols-E})(A>v?_:S,f)+(M-1)*f.cols+1+((A>v?S:_)-1),k(R,p))}},1296:function(T,l,h){var u=this&&this.__decorate||function(P,Q,re,G){var V,ee=arguments.length,N=ee<3?Q:G===null?G=Object.getOwnPropertyDescriptor(Q,re):G;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(P,Q,re,G);else for(var U=P.length-1;U>=0;U--)(V=P[U])&&(N=(ee<3?V(N):ee>3?V(Q,re,N):V(Q,re))||N);return ee>3&&N&&Object.defineProperty(Q,re,N),N},y=this&&this.__param||function(P,Q){return function(re,G){Q(re,G,P)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRenderer=void 0;const m=h(3787),b=h(2550),x=h(2223),k=h(6171),C=h(6052),_=h(4725),v=h(8055),f=h(8460),p=h(844),S=h(2585),A="xterm-dom-renderer-owner-",R="xterm-rows",M="xterm-fg-",E="xterm-bg-",B="xterm-focus",$="xterm-selection";let I=1,q=l.DomRenderer=class extends p.Disposable{constructor(P,Q,re,G,V,ee,N,U,L,H,X,ne,he){super(),this._terminal=P,this._document=Q,this._element=re,this._screenElement=G,this._viewportElement=V,this._helperContainer=ee,this._linkifier2=N,this._charSizeService=L,this._optionsService=H,this._bufferService=X,this._coreBrowserService=ne,this._themeService=he,this._terminalClass=I++,this._rowElements=[],this._selectionRenderModel=(0,C.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new f.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(R),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add($),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,k.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((me=>this._injectCss(me)))),this._injectCss(this._themeService.colors),this._rowFactory=U.createInstance(m.DomRendererRowFactory,document),this._element.classList.add(A+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((me=>this._handleLinkHover(me)))),this.register(this._linkifier2.onHideLinkUnderline((me=>this._handleLinkLeave(me)))),this.register((0,p.toDisposable)((()=>{this._element.classList.remove(A+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new b.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 P=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*P,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*P),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/P),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/P),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 re of this._rowElements)re.style.width=`${this.dimensions.css.canvas.width}px`,re.style.height=`${this.dimensions.css.cell.height}px`,re.style.lineHeight=`${this.dimensions.css.cell.height}px`,re.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const Q=`${this._terminalSelector} .${R} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=Q,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(P){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let Q=`${this._terminalSelector} .${R} { color: ${P.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;Q+=`${this._terminalSelector} .${R} .xterm-dim { color: ${v.color.multiplyOpacity(P.foreground,.5).css};}`,Q+=`${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 re=`blink_underline_${this._terminalClass}`,G=`blink_bar_${this._terminalClass}`,V=`blink_block_${this._terminalClass}`;Q+=`@keyframes ${re} { 50% { border-bottom-style: hidden; }}`,Q+=`@keyframes ${G} { 50% { box-shadow: none; }}`,Q+=`@keyframes ${V} { 0% { background-color: ${P.cursor.css}; color: ${P.cursorAccent.css}; } 50% { background-color: inherit; color: ${P.cursor.css}; }}`,Q+=`${this._terminalSelector} .${R}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${re} 1s step-end infinite;}${this._terminalSelector} .${R}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${R}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${V} 1s step-end infinite;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block { background-color: ${P.cursor.css}; color: ${P.cursorAccent.css};}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${P.cursor.css} !important; color: ${P.cursorAccent.css} !important;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${P.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${P.cursor.css} inset;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${P.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,Q+=`${this._terminalSelector} .${$} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${$} div { position: absolute; background-color: ${P.selectionBackgroundOpaque.css};}${this._terminalSelector} .${$} div { position: absolute; background-color: ${P.selectionInactiveBackgroundOpaque.css};}`;for(const[ee,N]of P.ansi.entries())Q+=`${this._terminalSelector} .${M}${ee} { color: ${N.css}; }${this._terminalSelector} .${M}${ee}.xterm-dim { color: ${v.color.multiplyOpacity(N,.5).css}; }${this._terminalSelector} .${E}${ee} { background-color: ${N.css}; }`;Q+=`${this._terminalSelector} .${M}${x.INVERTED_DEFAULT_COLOR} { color: ${v.color.opaque(P.background).css}; }${this._terminalSelector} .${M}${x.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${v.color.multiplyOpacity(v.color.opaque(P.background),.5).css}; }${this._terminalSelector} .${E}${x.INVERTED_DEFAULT_COLOR} { background-color: ${P.foreground.css}; }`,this._themeStyleElement.textContent=Q}_setDefaultSpacing(){const P=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${P}px`,this._rowFactory.defaultSpacing=P}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(P,Q){for(let re=this._rowElements.length;re<=Q;re++){const G=this._document.createElement("div");this._rowContainer.appendChild(G),this._rowElements.push(G)}for(;this._rowElements.length>Q;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(P,Q){this._refreshRowElements(P,Q),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(B),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(B),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(P,Q,re){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(P,Q,re),this.renderRows(0,this._bufferService.rows-1),!P||!Q)return;this._selectionRenderModel.update(this._terminal,P,Q,re);const G=this._selectionRenderModel.viewportStartRow,V=this._selectionRenderModel.viewportEndRow,ee=this._selectionRenderModel.viewportCappedStartRow,N=this._selectionRenderModel.viewportCappedEndRow;if(ee>=this._bufferService.rows||N<0)return;const U=this._document.createDocumentFragment();if(re){const L=P[0]>Q[0];U.appendChild(this._createSelectionElement(ee,L?Q[0]:P[0],L?P[0]:Q[0],N-ee+1))}else{const L=G===ee?P[0]:0,H=ee===V?Q[0]:this._bufferService.cols;U.appendChild(this._createSelectionElement(ee,L,H));const X=N-ee-1;if(U.appendChild(this._createSelectionElement(ee+1,0,this._bufferService.cols,X)),ee!==N){const ne=V===N?Q[0]:this._bufferService.cols;U.appendChild(this._createSelectionElement(N,0,ne))}}this._selectionContainer.appendChild(U)}_createSelectionElement(P,Q,re,G=1){const V=this._document.createElement("div"),ee=Q*this.dimensions.css.cell.width;let N=this.dimensions.css.cell.width*(re-Q);return ee+N>this.dimensions.css.canvas.width&&(N=this.dimensions.css.canvas.width-ee),V.style.height=G*this.dimensions.css.cell.height+"px",V.style.top=P*this.dimensions.css.cell.height+"px",V.style.left=`${ee}px`,V.style.width=`${N}px`,V}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 P of this._rowElements)P.replaceChildren()}renderRows(P,Q){const re=this._bufferService.buffer,G=re.ybase+re.y,V=Math.min(re.x,this._bufferService.cols-1),ee=this._optionsService.rawOptions.cursorBlink,N=this._optionsService.rawOptions.cursorStyle,U=this._optionsService.rawOptions.cursorInactiveStyle;for(let L=P;L<=Q;L++){const H=L+re.ydisp,X=this._rowElements[L],ne=re.lines.get(H);if(!X||!ne)break;X.replaceChildren(...this._rowFactory.createRow(ne,H,H===G,N,U,V,ee,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${A}${this._terminalClass}`}_handleLinkHover(P){this._setCellUnderline(P.x1,P.x2,P.y1,P.y2,P.cols,!0)}_handleLinkLeave(P){this._setCellUnderline(P.x1,P.x2,P.y1,P.y2,P.cols,!1)}_setCellUnderline(P,Q,re,G,V,ee){re<0&&(P=0),G<0&&(Q=0);const N=this._bufferService.rows-1;re=Math.max(Math.min(re,N),0),G=Math.max(Math.min(G,N),0),V=Math.min(V,this._bufferService.cols);const U=this._bufferService.buffer,L=U.ybase+U.y,H=Math.min(U.x,V-1),X=this._optionsService.rawOptions.cursorBlink,ne=this._optionsService.rawOptions.cursorStyle,he=this._optionsService.rawOptions.cursorInactiveStyle;for(let me=re;me<=G;++me){const Y=me+U.ydisp,j=this._rowElements[me],ce=U.lines.get(Y);if(!j||!ce)break;j.replaceChildren(...this._rowFactory.createRow(ce,Y,Y===L,ne,he,H,X,this.dimensions.css.cell.width,this._widthCache,ee?me===re?P:0:-1,ee?(me===G?Q:V)-1:-1))}}};l.DomRenderer=q=u([y(7,S.IInstantiationService),y(8,_.ICharSizeService),y(9,S.IOptionsService),y(10,S.IBufferService),y(11,_.ICoreBrowserService),y(12,_.IThemeService)],q)},3787:function(T,l,h){var u=this&&this.__decorate||function(R,M,E,B){var $,I=arguments.length,q=I<3?M:B===null?B=Object.getOwnPropertyDescriptor(M,E):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")q=Reflect.decorate(R,M,E,B);else for(var P=R.length-1;P>=0;P--)($=R[P])&&(q=(I<3?$(q):I>3?$(M,E,q):$(M,E))||q);return I>3&&q&&Object.defineProperty(M,E,q),q},y=this&&this.__param||function(R,M){return function(E,B){M(E,B,R)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRendererRowFactory=void 0;const m=h(2223),b=h(643),x=h(511),k=h(2585),C=h(8055),_=h(4725),v=h(4269),f=h(6171),p=h(3734);let S=l.DomRendererRowFactory=class{constructor(R,M,E,B,$,I,q){this._document=R,this._characterJoinerService=M,this._optionsService=E,this._coreBrowserService=B,this._coreService=$,this._decorationService=I,this._themeService=q,this._workCell=new x.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(R,M,E){this._selectionStart=R,this._selectionEnd=M,this._columnSelectMode=E}createRow(R,M,E,B,$,I,q,P,Q,re,G){const V=[],ee=this._characterJoinerService.getJoinedCharacters(M),N=this._themeService.colors;let U,L=R.getNoBgTrimmedLength();E&&L<I+1&&(L=I+1);let H=0,X="",ne=0,he=0,me=0,Y=!1,j=0,ce=!1,oe=0;const ve=[],pe=re!==-1&&G!==-1;for(let Te=0;Te<L;Te++){R.loadCell(Te,this._workCell);let je=this._workCell.getWidth();if(je===0)continue;let Ue=!1,ct=Te,Ee=this._workCell;if(ee.length>0&&Te===ee[0][0]){Ue=!0;const Ye=ee.shift();Ee=new v.JoinedCellData(this._workCell,R.translateToString(!0,Ye[0],Ye[1]),Ye[1]-Ye[0]),ct=Ye[1]-1,je=Ee.getWidth()}const Ft=this._isCellInSelection(Te,M),mi=E&&Te===I,pi=pe&&Te>=re&&Te<=G;let Ii=!1;this._decorationService.forEachDecorationAtCell(Te,M,void 0,(Ye=>{Ii=!0}));let Ki=Ee.getChars()||b.WHITESPACE_CELL_CHAR;if(Ki===" "&&(Ee.isUnderline()||Ee.isOverline())&&(Ki=" "),oe=je*P-Q.get(Ki,Ee.isBold(),Ee.isItalic()),U){if(H&&(Ft&&ce||!Ft&&!ce&&Ee.bg===ne)&&(Ft&&ce&&N.selectionForeground||Ee.fg===he)&&Ee.extended.ext===me&&pi===Y&&oe===j&&!mi&&!Ue&&!Ii){Ee.isInvisible()?X+=b.WHITESPACE_CELL_CHAR:X+=Ki,H++;continue}H&&(U.textContent=X),U=this._document.createElement("span"),H=0,X=""}else U=this._document.createElement("span");if(ne=Ee.bg,he=Ee.fg,me=Ee.extended.ext,Y=pi,j=oe,ce=Ft,Ue&&I>=Te&&I<=ct&&(I=Te),!this._coreService.isCursorHidden&&mi&&this._coreService.isCursorInitialized){if(ve.push("xterm-cursor"),this._coreBrowserService.isFocused)q&&ve.push("xterm-cursor-blink"),ve.push(B==="bar"?"xterm-cursor-bar":B==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if($)switch($){case"outline":ve.push("xterm-cursor-outline");break;case"block":ve.push("xterm-cursor-block");break;case"bar":ve.push("xterm-cursor-bar");break;case"underline":ve.push("xterm-cursor-underline")}}if(Ee.isBold()&&ve.push("xterm-bold"),Ee.isItalic()&&ve.push("xterm-italic"),Ee.isDim()&&ve.push("xterm-dim"),X=Ee.isInvisible()?b.WHITESPACE_CELL_CHAR:Ee.getChars()||b.WHITESPACE_CELL_CHAR,Ee.isUnderline()&&(ve.push(`xterm-underline-${Ee.extended.underlineStyle}`),X===" "&&(X=" "),!Ee.isUnderlineColorDefault()))if(Ee.isUnderlineColorRGB())U.style.textDecorationColor=`rgb(${p.AttributeData.toColorRGB(Ee.getUnderlineColor()).join(",")})`;else{let Ye=Ee.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Ee.isBold()&&Ye<8&&(Ye+=8),U.style.textDecorationColor=N.ansi[Ye].css}Ee.isOverline()&&(ve.push("xterm-overline"),X===" "&&(X=" ")),Ee.isStrikethrough()&&ve.push("xterm-strikethrough"),pi&&(U.style.textDecoration="underline");let Pt=Ee.getFgColor(),nt=Ee.getFgColorMode(),Dt=Ee.getBgColor(),Zt=Ee.getBgColorMode();const Nt=!!Ee.isInverse();if(Nt){const Ye=Pt;Pt=Dt,Dt=Ye;const vi=nt;nt=Zt,Zt=vi}let Bt,Vi,Vt,Li=!1;switch(this._decorationService.forEachDecorationAtCell(Te,M,void 0,(Ye=>{Ye.options.layer!=="top"&&Li||(Ye.backgroundColorRGB&&(Zt=50331648,Dt=Ye.backgroundColorRGB.rgba>>8&16777215,Bt=Ye.backgroundColorRGB),Ye.foregroundColorRGB&&(nt=50331648,Pt=Ye.foregroundColorRGB.rgba>>8&16777215,Vi=Ye.foregroundColorRGB),Li=Ye.options.layer==="top")})),!Li&&Ft&&(Bt=this._coreBrowserService.isFocused?N.selectionBackgroundOpaque:N.selectionInactiveBackgroundOpaque,Dt=Bt.rgba>>8&16777215,Zt=50331648,Li=!0,N.selectionForeground&&(nt=50331648,Pt=N.selectionForeground.rgba>>8&16777215,Vi=N.selectionForeground)),Li&&ve.push("xterm-decoration-top"),Zt){case 16777216:case 33554432:Vt=N.ansi[Dt],ve.push(`xterm-bg-${Dt}`);break;case 50331648:Vt=C.channels.toColor(Dt>>16,Dt>>8&255,255&Dt),this._addStyle(U,`background-color:#${A((Dt>>>0).toString(16),"0",6)}`);break;default:Nt?(Vt=N.foreground,ve.push(`xterm-bg-${m.INVERTED_DEFAULT_COLOR}`)):Vt=N.background}switch(Bt||Ee.isDim()&&(Bt=C.color.multiplyOpacity(Vt,.5)),nt){case 16777216:case 33554432:Ee.isBold()&&Pt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Pt+=8),this._applyMinimumContrast(U,Vt,N.ansi[Pt],Ee,Bt,void 0)||ve.push(`xterm-fg-${Pt}`);break;case 50331648:const Ye=C.channels.toColor(Pt>>16&255,Pt>>8&255,255&Pt);this._applyMinimumContrast(U,Vt,Ye,Ee,Bt,Vi)||this._addStyle(U,`color:#${A(Pt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(U,Vt,N.foreground,Ee,Bt,Vi)||Nt&&ve.push(`xterm-fg-${m.INVERTED_DEFAULT_COLOR}`)}ve.length&&(U.className=ve.join(" "),ve.length=0),mi||Ue||Ii?U.textContent=X:H++,oe!==this.defaultSpacing&&(U.style.letterSpacing=`${oe}px`),V.push(U),Te=ct}return U&&H&&(U.textContent=X),V}_applyMinimumContrast(R,M,E,B,$,I){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,f.treatGlyphAsBackgroundColor)(B.getCode()))return!1;const q=this._getContrastCache(B);let P;if($||I||(P=q.getColor(M.rgba,E.rgba)),P===void 0){const Q=this._optionsService.rawOptions.minimumContrastRatio/(B.isDim()?2:1);P=C.color.ensureContrastRatio($||M,I||E,Q),q.setColor(($||M).rgba,(I||E).rgba,P??null)}return!!P&&(this._addStyle(R,`color:${P.css}`),!0)}_getContrastCache(R){return R.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(R,M){R.setAttribute("style",`${R.getAttribute("style")||""}${M};`)}_isCellInSelection(R,M){const E=this._selectionStart,B=this._selectionEnd;return!(!E||!B)&&(this._columnSelectMode?E[0]<=B[0]?R>=E[0]&&M>=E[1]&&R<B[0]&&M<=B[1]:R<E[0]&&M>=E[1]&&R>=B[0]&&M<=B[1]:M>E[1]&&M<B[1]||E[1]===B[1]&&M===E[1]&&R>=E[0]&&R<B[0]||E[1]<B[1]&&M===B[1]&&R<B[0]||E[1]<B[1]&&M===E[1]&&R>=E[0])}};function A(R,M,E){for(;R.length<E;)R=M+R;return R}l.DomRendererRowFactory=S=u([y(1,_.ICharacterJoinerService),y(2,k.IOptionsService),y(3,_.ICoreBrowserService),y(4,k.ICoreService),y(5,k.IDecorationService),y(6,_.IThemeService)],S)},2550:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WidthCache=void 0,l.WidthCache=class{constructor(h,u){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=h.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 y=h.createElement("span");y.classList.add("xterm-char-measure-element");const m=h.createElement("span");m.classList.add("xterm-char-measure-element"),m.style.fontWeight="bold";const b=h.createElement("span");b.classList.add("xterm-char-measure-element"),b.style.fontStyle="italic";const x=h.createElement("span");x.classList.add("xterm-char-measure-element"),x.style.fontWeight="bold",x.style.fontStyle="italic",this._measureElements=[y,m,b,x],this._container.appendChild(y),this._container.appendChild(m),this._container.appendChild(b),this._container.appendChild(x),u.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(h,u,y,m){h===this._font&&u===this._fontSize&&y===this._weight&&m===this._weightBold||(this._font=h,this._fontSize=u,this._weight=y,this._weightBold=m,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${y}`,this._measureElements[1].style.fontWeight=`${m}`,this._measureElements[2].style.fontWeight=`${y}`,this._measureElements[3].style.fontWeight=`${m}`,this.clear())}get(h,u,y){let m=0;if(!u&&!y&&h.length===1&&(m=h.charCodeAt(0))<256){if(this._flat[m]!==-9999)return this._flat[m];const k=this._measure(h,0);return k>0&&(this._flat[m]=k),k}let b=h;u&&(b+="B"),y&&(b+="I");let x=this._holey.get(b);if(x===void 0){let k=0;u&&(k|=1),y&&(k|=2),x=this._measure(h,k),x>0&&this._holey.set(b,x)}return x}_measure(h,u){const y=this._measureElements[u];return y.textContent=h.repeat(32),y.offsetWidth/32}}},2223:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TEXT_BASELINE=l.DIM_OPACITY=l.INVERTED_DEFAULT_COLOR=void 0;const u=h(6114);l.INVERTED_DEFAULT_COLOR=257,l.DIM_OPACITY=.5,l.TEXT_BASELINE=u.isFirefox||u.isLegacyEdge?"bottom":"ideographic"},6171:(T,l)=>{function h(y){return 57508<=y&&y<=57558}function u(y){return y>=128512&&y<=128591||y>=127744&&y<=128511||y>=128640&&y<=128767||y>=9728&&y<=9983||y>=9984&&y<=10175||y>=65024&&y<=65039||y>=129280&&y<=129535||y>=127462&&y<=127487}Object.defineProperty(l,"__esModule",{value:!0}),l.computeNextVariantOffset=l.createRenderDimensions=l.treatGlyphAsBackgroundColor=l.allowRescaling=l.isEmoji=l.isRestrictedPowerlineGlyph=l.isPowerlineGlyph=l.throwIfFalsy=void 0,l.throwIfFalsy=function(y){if(!y)throw new Error("value must not be falsy");return y},l.isPowerlineGlyph=h,l.isRestrictedPowerlineGlyph=function(y){return 57520<=y&&y<=57527},l.isEmoji=u,l.allowRescaling=function(y,m,b,x){return m===1&&b>Math.ceil(1.5*x)&&y!==void 0&&y>255&&!u(y)&&!h(y)&&!(function(k){return 57344<=k&&k<=63743})(y)},l.treatGlyphAsBackgroundColor=function(y){return h(y)||(function(m){return 9472<=m&&m<=9631})(y)},l.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}}}},l.computeNextVariantOffset=function(y,m,b=0){return(y-(2*Math.round(m)-b))%(2*Math.round(m))}},6052:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createSelectionRenderModel=void 0;class h{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(y,m,b,x=!1){if(this.selectionStart=m,this.selectionEnd=b,!m||!b||m[0]===b[0]&&m[1]===b[1])return void this.clear();const k=y.buffers.active.ydisp,C=m[1]-k,_=b[1]-k,v=Math.max(C,0),f=Math.min(_,y.rows-1);v>=y.rows||f<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=x,this.viewportStartRow=C,this.viewportEndRow=_,this.viewportCappedStartRow=v,this.viewportCappedEndRow=f,this.startCol=m[0],this.endCol=b[0])}isCellSelected(y,m,b){return!!this.hasSelection&&(b-=y.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?m>=this.startCol&&b>=this.viewportCappedStartRow&&m<this.endCol&&b<=this.viewportCappedEndRow:m<this.startCol&&b>=this.viewportCappedStartRow&&m>=this.endCol&&b<=this.viewportCappedEndRow:b>this.viewportStartRow&&b<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&b===this.viewportStartRow&&m>=this.startCol&&m<this.endCol||this.viewportStartRow<this.viewportEndRow&&b===this.viewportEndRow&&m<this.endCol||this.viewportStartRow<this.viewportEndRow&&b===this.viewportStartRow&&m>=this.startCol)}}l.createSelectionRenderModel=function(){return new h}},456:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionModel=void 0,l.SelectionModel=class{constructor(h){this._bufferService=h,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 h=this.selectionStart[0]+this.selectionStartLength;return h>this._bufferService.cols?h%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(h/this._bufferService.cols)-1]:[h%this._bufferService.cols,this.selectionStart[1]+Math.floor(h/this._bufferService.cols)]:[h,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const h=this.selectionStart[0]+this.selectionStartLength;return h>this._bufferService.cols?[h%this._bufferService.cols,this.selectionStart[1]+Math.floor(h/this._bufferService.cols)]:[Math.max(h,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const h=this.selectionStart,u=this.selectionEnd;return!(!h||!u)&&(h[1]>u[1]||h[1]===u[1]&&h[0]>u[0])}handleTrim(h){return this.selectionStart&&(this.selectionStart[1]-=h),this.selectionEnd&&(this.selectionEnd[1]-=h),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(T,l,h){var u=this&&this.__decorate||function(f,p,S,A){var R,M=arguments.length,E=M<3?p:A===null?A=Object.getOwnPropertyDescriptor(p,S):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(f,p,S,A);else for(var B=f.length-1;B>=0;B--)(R=f[B])&&(E=(M<3?R(E):M>3?R(p,S,E):R(p,S))||E);return M>3&&E&&Object.defineProperty(p,S,E),E},y=this&&this.__param||function(f,p){return function(S,A){p(S,A,f)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharSizeService=void 0;const m=h(2585),b=h(8460),x=h(844);let k=l.CharSizeService=class extends x.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(f,p,S){super(),this._optionsService=S,this.width=0,this.height=0,this._onCharSizeChange=this.register(new b.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new v(this._optionsService))}catch{this._measureStrategy=this.register(new _(f,p,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const f=this._measureStrategy.measure();f.width===this.width&&f.height===this.height||(this.width=f.width,this.height=f.height,this._onCharSizeChange.fire())}};l.CharSizeService=k=u([y(2,m.IOptionsService)],k);class C extends x.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(p,S){p!==void 0&&p>0&&S!==void 0&&S>0&&(this._result.width=p,this._result.height=S)}}class _ extends C{constructor(p,S,A){super(),this._document=p,this._parentElement=S,this._optionsService=A,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 v extends C{constructor(p){super(),this._optionsService=p,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const S=this._ctx.measureText("W");if(!("width"in S&&"fontBoundingBoxAscent"in S&&"fontBoundingBoxDescent"in S))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const p=this._ctx.measureText("W");return this._validateAndSet(p.width,p.fontBoundingBoxAscent+p.fontBoundingBoxDescent),this._result}}},4269:function(T,l,h){var u=this&&this.__decorate||function(v,f,p,S){var A,R=arguments.length,M=R<3?f:S===null?S=Object.getOwnPropertyDescriptor(f,p):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(v,f,p,S);else for(var E=v.length-1;E>=0;E--)(A=v[E])&&(M=(R<3?A(M):R>3?A(f,p,M):A(f,p))||M);return R>3&&M&&Object.defineProperty(f,p,M),M},y=this&&this.__param||function(v,f){return function(p,S){f(p,S,v)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharacterJoinerService=l.JoinedCellData=void 0;const m=h(3734),b=h(643),x=h(511),k=h(2585);class C extends m.AttributeData{constructor(f,p,S){super(),this.content=0,this.combinedData="",this.fg=f.fg,this.bg=f.bg,this.combinedData=p,this._width=S}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(f){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.JoinedCellData=C;let _=l.CharacterJoinerService=class Tv{constructor(f){this._bufferService=f,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new x.CellData}register(f){const p={id:this._nextCharacterJoinerId++,handler:f};return this._characterJoiners.push(p),p.id}deregister(f){for(let p=0;p<this._characterJoiners.length;p++)if(this._characterJoiners[p].id===f)return this._characterJoiners.splice(p,1),!0;return!1}getJoinedCharacters(f){if(this._characterJoiners.length===0)return[];const p=this._bufferService.buffer.lines.get(f);if(!p||p.length===0)return[];const S=[],A=p.translateToString(!0);let R=0,M=0,E=0,B=p.getFg(0),$=p.getBg(0);for(let I=0;I<p.getTrimmedLength();I++)if(p.loadCell(I,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==B||this._workCell.bg!==$){if(I-R>1){const q=this._getJoinedRanges(A,E,M,p,R);for(let P=0;P<q.length;P++)S.push(q[P])}R=I,E=M,B=this._workCell.fg,$=this._workCell.bg}M+=this._workCell.getChars().length||b.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-R>1){const I=this._getJoinedRanges(A,E,M,p,R);for(let q=0;q<I.length;q++)S.push(I[q])}return S}_getJoinedRanges(f,p,S,A,R){const M=f.substring(p,S);let E=[];try{E=this._characterJoiners[0].handler(M)}catch(B){console.error(B)}for(let B=1;B<this._characterJoiners.length;B++)try{const $=this._characterJoiners[B].handler(M);for(let I=0;I<$.length;I++)Tv._mergeRanges(E,$[I])}catch($){console.error($)}return this._stringRangesToCellRanges(E,A,R),E}_stringRangesToCellRanges(f,p,S){let A=0,R=!1,M=0,E=f[A];if(E){for(let B=S;B<this._bufferService.cols;B++){const $=p.getWidth(B),I=p.getString(B).length||b.WHITESPACE_CELL_CHAR.length;if($!==0){if(!R&&E[0]<=M&&(E[0]=B,R=!0),E[1]<=M){if(E[1]=B,E=f[++A],!E)break;E[0]<=M?(E[0]=B,R=!0):R=!1}M+=I}}E&&(E[1]=this._bufferService.cols)}}static _mergeRanges(f,p){let S=!1;for(let A=0;A<f.length;A++){const R=f[A];if(S){if(p[1]<=R[0])return f[A-1][1]=p[1],f;if(p[1]<=R[1])return f[A-1][1]=Math.max(p[1],R[1]),f.splice(A,1),f;f.splice(A,1),A--}else{if(p[1]<=R[0])return f.splice(A,0,p),f;if(p[1]<=R[1])return R[0]=Math.min(p[0],R[0]),f;p[0]<R[1]&&(R[0]=Math.min(p[0],R[0]),S=!0)}}return S?f[f.length-1][1]=p[1]:f.push(p),f}};l.CharacterJoinerService=_=u([y(0,k.IBufferService)],_)},5114:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreBrowserService=void 0;const u=h(844),y=h(8460),m=h(3656);class b extends u.Disposable{constructor(C,_,v){super(),this._textarea=C,this._window=_,this.mainDocument=v,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new x(this._window),this._onDprChange=this.register(new y.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new y.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((f=>this._screenDprMonitor.setWindow(f)))),this.register((0,y.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(C){this._window!==C&&(this._window=C,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}}l.CoreBrowserService=b;class x extends u.Disposable{constructor(C){super(),this._parentWindow=C,this._windowResizeListener=this.register(new u.MutableDisposable),this._onDprChange=this.register(new y.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,u.toDisposable)((()=>this.clearListener())))}setWindow(C){this._parentWindow=C,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,m.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var C;this._outerListener&&((C=this._resolutionMediaMatchList)==null||C.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:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.LinkProviderService=void 0;const u=h(844);class y extends u.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,u.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(b){return this.linkProviders.push(b),{dispose:()=>{const x=this.linkProviders.indexOf(b);x!==-1&&this.linkProviders.splice(x,1)}}}}l.LinkProviderService=y},8934:function(T,l,h){var u=this&&this.__decorate||function(k,C,_,v){var f,p=arguments.length,S=p<3?C:v===null?v=Object.getOwnPropertyDescriptor(C,_):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(k,C,_,v);else for(var A=k.length-1;A>=0;A--)(f=k[A])&&(S=(p<3?f(S):p>3?f(C,_,S):f(C,_))||S);return p>3&&S&&Object.defineProperty(C,_,S),S},y=this&&this.__param||function(k,C){return function(_,v){C(_,v,k)}};Object.defineProperty(l,"__esModule",{value:!0}),l.MouseService=void 0;const m=h(4725),b=h(9806);let x=l.MouseService=class{constructor(k,C){this._renderService=k,this._charSizeService=C}getCoords(k,C,_,v,f){return(0,b.getCoords)(window,k,C,_,v,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,f)}getMouseReportCoords(k,C){const _=(0,b.getCoordsRelativeToElement)(window,k,C);if(this._charSizeService.hasValidSize)return _[0]=Math.min(Math.max(_[0],0),this._renderService.dimensions.css.canvas.width-1),_[1]=Math.min(Math.max(_[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(_[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(_[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(_[0]),y:Math.floor(_[1])}}};l.MouseService=x=u([y(0,m.IRenderService),y(1,m.ICharSizeService)],x)},3230:function(T,l,h){var u=this&&this.__decorate||function(f,p,S,A){var R,M=arguments.length,E=M<3?p:A===null?A=Object.getOwnPropertyDescriptor(p,S):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(f,p,S,A);else for(var B=f.length-1;B>=0;B--)(R=f[B])&&(E=(M<3?R(E):M>3?R(p,S,E):R(p,S))||E);return M>3&&E&&Object.defineProperty(p,S,E),E},y=this&&this.__param||function(f,p){return function(S,A){p(S,A,f)}};Object.defineProperty(l,"__esModule",{value:!0}),l.RenderService=void 0;const m=h(6193),b=h(4725),x=h(8460),k=h(844),C=h(7226),_=h(2585);let v=l.RenderService=class extends k.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(f,p,S,A,R,M,E,B){super(),this._rowCount=f,this._charSizeService=A,this._renderer=this.register(new k.MutableDisposable),this._pausedResizeTask=new C.DebouncedIdleTask,this._observerDisposable=this.register(new k.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 x.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new x.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new x.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new x.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new m.RenderDebouncer((($,I)=>this._renderRows($,I)),E),this.register(this._renderDebouncer),this.register(E.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(M.onResize((()=>this._fullRefresh()))),this.register(M.buffers.onBufferActivate((()=>{var $;return($=this._renderer.value)==null?void 0:$.clear()}))),this.register(S.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(R.onDecorationRegistered((()=>this._fullRefresh()))),this.register(R.onDecorationRemoved((()=>this._fullRefresh()))),this.register(S.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(M.cols,M.rows),this._fullRefresh()}))),this.register(S.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(M.buffer.y,M.buffer.y,!0)))),this.register(B.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(E.window,p),this.register(E.onWindowChange(($=>this._registerIntersectionObserver($,p))))}_registerIntersectionObserver(f,p){if("IntersectionObserver"in f){const S=new f.IntersectionObserver((A=>this._handleIntersectionChange(A[A.length-1])),{threshold:0});S.observe(p),this._observerDisposable.value=(0,k.toDisposable)((()=>S.disconnect()))}}_handleIntersectionChange(f){this._isPaused=f.isIntersecting===void 0?f.intersectionRatio===0:!f.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(f,p,S=!1){this._isPaused?this._needsFullRefresh=!0:(S||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(f,p,this._rowCount))}_renderRows(f,p){this._renderer.value&&(f=Math.min(f,this._rowCount-1),p=Math.min(p,this._rowCount-1),this._renderer.value.renderRows(f,p),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:f,end:p}),this._onRender.fire({start:f,end:p}),this._isNextRenderRedrawOnly=!0)}resize(f,p){this._rowCount=p,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(f){this._renderer.value=f,this._renderer.value&&(this._renderer.value.onRequestRedraw((p=>this.refreshRows(p.start,p.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(f){return this._renderDebouncer.addRefreshCallback(f)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var f,p;this._renderer.value&&((p=(f=this._renderer.value).clearTextureAtlas)==null||p.call(f),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(f,p){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var S;return(S=this._renderer.value)==null?void 0:S.handleResize(f,p)})):this._renderer.value.handleResize(f,p),this._fullRefresh())}handleCharSizeChanged(){var f;(f=this._renderer.value)==null||f.handleCharSizeChanged()}handleBlur(){var f;(f=this._renderer.value)==null||f.handleBlur()}handleFocus(){var f;(f=this._renderer.value)==null||f.handleFocus()}handleSelectionChanged(f,p,S){var A;this._selectionState.start=f,this._selectionState.end=p,this._selectionState.columnSelectMode=S,(A=this._renderer.value)==null||A.handleSelectionChanged(f,p,S)}handleCursorMove(){var f;(f=this._renderer.value)==null||f.handleCursorMove()}clear(){var f;(f=this._renderer.value)==null||f.clear()}};l.RenderService=v=u([y(2,_.IOptionsService),y(3,b.ICharSizeService),y(4,_.IDecorationService),y(5,_.IBufferService),y(6,b.ICoreBrowserService),y(7,b.IThemeService)],v)},9312:function(T,l,h){var u=this&&this.__decorate||function(E,B,$,I){var q,P=arguments.length,Q=P<3?B:I===null?I=Object.getOwnPropertyDescriptor(B,$):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Q=Reflect.decorate(E,B,$,I);else for(var re=E.length-1;re>=0;re--)(q=E[re])&&(Q=(P<3?q(Q):P>3?q(B,$,Q):q(B,$))||Q);return P>3&&Q&&Object.defineProperty(B,$,Q),Q},y=this&&this.__param||function(E,B){return function($,I){B($,I,E)}};Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionService=void 0;const m=h(9806),b=h(9504),x=h(456),k=h(4725),C=h(8460),_=h(844),v=h(6114),f=h(4841),p=h(511),S=h(2585),A=" ",R=new RegExp(A,"g");let M=l.SelectionService=class extends _.Disposable{constructor(E,B,$,I,q,P,Q,re,G){super(),this._element=E,this._screenElement=B,this._linkifier=$,this._bufferService=I,this._coreService=q,this._mouseService=P,this._optionsService=Q,this._renderService=re,this._coreBrowserService=G,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new p.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new C.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new C.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new C.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new C.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=V=>this._handleMouseMove(V),this._mouseUpListener=V=>this._handleMouseUp(V),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((V=>this._handleTrim(V))),this.register(this._bufferService.buffers.onBufferActivate((V=>this._handleBufferActivate(V)))),this.enable(),this._model=new x.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,_.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,B=this._model.finalSelectionEnd;return!(!E||!B||E[0]===B[0]&&E[1]===B[1])}get selectionText(){const E=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;if(!E||!B)return"";const $=this._bufferService.buffer,I=[];if(this._activeSelectionMode===3){if(E[0]===B[0])return"";const q=E[0]<B[0]?E[0]:B[0],P=E[0]<B[0]?B[0]:E[0];for(let Q=E[1];Q<=B[1];Q++){const re=$.translateBufferLineToString(Q,!0,q,P);I.push(re)}}else{const q=E[1]===B[1]?B[0]:void 0;I.push($.translateBufferLineToString(E[1],!0,E[0],q));for(let P=E[1]+1;P<=B[1]-1;P++){const Q=$.lines.get(P),re=$.translateBufferLineToString(P,!0);Q!=null&&Q.isWrapped?I[I.length-1]+=re:I.push(re)}if(E[1]!==B[1]){const P=$.lines.get(B[1]),Q=$.translateBufferLineToString(B[1],!0,0,B[0]);P&&P.isWrapped?I[I.length-1]+=Q:I.push(Q)}}return I.map((q=>q.replace(R," "))).join(v.isWindows?`\r
259
+ `:`
260
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(E){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),v.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 B=this._getMouseBufferCoords(E),$=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!!($&&I&&B)&&this._areCoordsInSelection(B,$,I)}isCellInSelection(E,B){const $=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!(!$||!I)&&this._areCoordsInSelection([E,B],$,I)}_areCoordsInSelection(E,B,$){return E[1]>B[1]&&E[1]<$[1]||B[1]===$[1]&&E[1]===B[1]&&E[0]>=B[0]&&E[0]<$[0]||B[1]<$[1]&&E[1]===$[1]&&E[0]<$[0]||B[1]<$[1]&&E[1]===B[1]&&E[0]>=B[0]}_selectWordAtCursor(E,B){var q,P;const $=(P=(q=this._linkifier.currentLink)==null?void 0:q.link)==null?void 0:P.range;if($)return this._model.selectionStart=[$.start.x-1,$.start.y-1],this._model.selectionStartLength=(0,f.getRangeLength)($,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const I=this._getMouseBufferCoords(E);return!!I&&(this._selectWordAt(I,B),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(E,B){this._model.clearSelection(),E=Math.max(E,0),B=Math.min(B,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,E],this._model.selectionEnd=[this._bufferService.cols,B],this.refresh(),this._onSelectionChange.fire()}_handleTrim(E){this._model.handleTrim(E)&&this.refresh()}_getMouseBufferCoords(E){const B=this._mouseService.getCoords(E,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(B)return B[0]--,B[1]--,B[1]+=this._bufferService.buffer.ydisp,B}_getMouseEventScrollAmount(E){let B=(0,m.getCoordsRelativeToElement)(this._coreBrowserService.window,E,this._screenElement)[1];const $=this._renderService.dimensions.css.canvas.height;return B>=0&&B<=$?0:(B>$&&(B-=$),B=Math.min(Math.max(B,-50),50),B/=50,B/Math.abs(B)+Math.round(14*B))}shouldForceSelection(E){return v.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 B=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);B&&B.length!==this._model.selectionStart[0]&&B.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(E){this._selectWordAtCursor(E,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(E){const B=this._getMouseBufferCoords(E);B&&(this._activeSelectionMode=2,this._selectLineAt(B[1]))}shouldColumnSelect(E){return E.altKey&&!(v.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(E){if(E.stopImmediatePropagation(),!this._model.selectionStart)return;const B=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 $=this._bufferService.buffer;if(this._model.selectionEnd[1]<$.lines.length){const I=$.lines.get(this._model.selectionEnd[1]);I&&I.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}B&&B[0]===this._model.selectionEnd[0]&&B[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 B=E.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&B<500&&E.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const $=this._mouseService.getCoords(E,this._element,this._bufferService.cols,this._bufferService.rows,!1);if($&&$[0]!==void 0&&$[1]!==void 0){const I=(0,b.moveToCellSequence)($[0]-1,$[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(I,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const E=this._model.finalSelectionStart,B=this._model.finalSelectionEnd,$=!(!E||!B||E[0]===B[0]&&E[1]===B[1]);$?E&&B&&(this._oldSelectionStart&&this._oldSelectionEnd&&E[0]===this._oldSelectionStart[0]&&E[1]===this._oldSelectionStart[1]&&B[0]===this._oldSelectionEnd[0]&&B[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(E,B,$)):this._oldHasSelection&&this._fireOnSelectionChange(E,B,$)}_fireOnSelectionChange(E,B,$){this._oldSelectionStart=E,this._oldSelectionEnd=B,this._oldHasSelection=$,this._onSelectionChange.fire()}_handleBufferActivate(E){this.clearSelection(),this._trimListener.dispose(),this._trimListener=E.activeBuffer.lines.onTrim((B=>this._handleTrim(B)))}_convertViewportColToCharacterIndex(E,B){let $=B;for(let I=0;B>=I;I++){const q=E.loadCell(I,this._workCell).getChars().length;this._workCell.getWidth()===0?$--:q>1&&B!==I&&($+=q-1)}return $}setSelection(E,B,$){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[E,B],this._model.selectionStartLength=$,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(E){this._isClickInSelection(E)||(this._selectWordAtCursor(E,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(E,B,$=!0,I=!0){if(E[0]>=this._bufferService.cols)return;const q=this._bufferService.buffer,P=q.lines.get(E[1]);if(!P)return;const Q=q.translateBufferLineToString(E[1],!1);let re=this._convertViewportColToCharacterIndex(P,E[0]),G=re;const V=E[0]-re;let ee=0,N=0,U=0,L=0;if(Q.charAt(re)===" "){for(;re>0&&Q.charAt(re-1)===" ";)re--;for(;G<Q.length&&Q.charAt(G+1)===" ";)G++}else{let ne=E[0],he=E[0];P.getWidth(ne)===0&&(ee++,ne--),P.getWidth(he)===2&&(N++,he++);const me=P.getString(he).length;for(me>1&&(L+=me-1,G+=me-1);ne>0&&re>0&&!this._isCharWordSeparator(P.loadCell(ne-1,this._workCell));){P.loadCell(ne-1,this._workCell);const Y=this._workCell.getChars().length;this._workCell.getWidth()===0?(ee++,ne--):Y>1&&(U+=Y-1,re-=Y-1),re--,ne--}for(;he<P.length&&G+1<Q.length&&!this._isCharWordSeparator(P.loadCell(he+1,this._workCell));){P.loadCell(he+1,this._workCell);const Y=this._workCell.getChars().length;this._workCell.getWidth()===2?(N++,he++):Y>1&&(L+=Y-1,G+=Y-1),G++,he++}}G++;let H=re+V-ee+U,X=Math.min(this._bufferService.cols,G-re+ee+N-U-L);if(B||Q.slice(re,G).trim()!==""){if($&&H===0&&P.getCodePoint(0)!==32){const ne=q.lines.get(E[1]-1);if(ne&&P.isWrapped&&ne.getCodePoint(this._bufferService.cols-1)!==32){const he=this._getWordAt([this._bufferService.cols-1,E[1]-1],!1,!0,!1);if(he){const me=this._bufferService.cols-he.start;H-=me,X+=me}}}if(I&&H+X===this._bufferService.cols&&P.getCodePoint(this._bufferService.cols-1)!==32){const ne=q.lines.get(E[1]+1);if(ne!=null&&ne.isWrapped&&ne.getCodePoint(0)!==32){const he=this._getWordAt([0,E[1]+1],!1,!1,!0);he&&(X+=he.length)}}return{start:H,length:X}}}_selectWordAt(E,B){const $=this._getWordAt(E,B);if($){for(;$.start<0;)$.start+=this._bufferService.cols,E[1]--;this._model.selectionStart=[$.start,E[1]],this._model.selectionStartLength=$.length}}_selectToWordAt(E){const B=this._getWordAt(E,!0);if(B){let $=E[1];for(;B.start<0;)B.start+=this._bufferService.cols,$--;if(!this._model.areSelectionValuesReversed())for(;B.start+B.length>this._bufferService.cols;)B.length-=this._bufferService.cols,$++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?B.start:B.start+B.length,$]}}_isCharWordSeparator(E){return E.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(E.getChars())>=0}_selectLineAt(E){const B=this._bufferService.buffer.getWrappedRangeForLine(E),$={start:{x:0,y:B.first},end:{x:this._bufferService.cols-1,y:B.last}};this._model.selectionStart=[0,B.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,f.getRangeLength)($,this._bufferService.cols)}};l.SelectionService=M=u([y(3,S.IBufferService),y(4,S.ICoreService),y(5,k.IMouseService),y(6,S.IOptionsService),y(7,k.IRenderService),y(8,k.ICoreBrowserService)],M)},4725:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ILinkProviderService=l.IThemeService=l.ICharacterJoinerService=l.ISelectionService=l.IRenderService=l.IMouseService=l.ICoreBrowserService=l.ICharSizeService=void 0;const u=h(8343);l.ICharSizeService=(0,u.createDecorator)("CharSizeService"),l.ICoreBrowserService=(0,u.createDecorator)("CoreBrowserService"),l.IMouseService=(0,u.createDecorator)("MouseService"),l.IRenderService=(0,u.createDecorator)("RenderService"),l.ISelectionService=(0,u.createDecorator)("SelectionService"),l.ICharacterJoinerService=(0,u.createDecorator)("CharacterJoinerService"),l.IThemeService=(0,u.createDecorator)("ThemeService"),l.ILinkProviderService=(0,u.createDecorator)("LinkProviderService")},6731:function(T,l,h){var u=this&&this.__decorate||function(M,E,B,$){var I,q=arguments.length,P=q<3?E:$===null?$=Object.getOwnPropertyDescriptor(E,B):$;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(M,E,B,$);else for(var Q=M.length-1;Q>=0;Q--)(I=M[Q])&&(P=(q<3?I(P):q>3?I(E,B,P):I(E,B))||P);return q>3&&P&&Object.defineProperty(E,B,P),P},y=this&&this.__param||function(M,E){return function(B,$){E(B,$,M)}};Object.defineProperty(l,"__esModule",{value:!0}),l.ThemeService=l.DEFAULT_ANSI_COLORS=void 0;const m=h(7239),b=h(8055),x=h(8460),k=h(844),C=h(2585),_=b.css.toColor("#ffffff"),v=b.css.toColor("#000000"),f=b.css.toColor("#ffffff"),p=b.css.toColor("#000000"),S={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};l.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const M=[b.css.toColor("#2e3436"),b.css.toColor("#cc0000"),b.css.toColor("#4e9a06"),b.css.toColor("#c4a000"),b.css.toColor("#3465a4"),b.css.toColor("#75507b"),b.css.toColor("#06989a"),b.css.toColor("#d3d7cf"),b.css.toColor("#555753"),b.css.toColor("#ef2929"),b.css.toColor("#8ae234"),b.css.toColor("#fce94f"),b.css.toColor("#729fcf"),b.css.toColor("#ad7fa8"),b.css.toColor("#34e2e2"),b.css.toColor("#eeeeec")],E=[0,95,135,175,215,255];for(let B=0;B<216;B++){const $=E[B/36%6|0],I=E[B/6%6|0],q=E[B%6];M.push({css:b.channels.toCss($,I,q),rgba:b.channels.toRgba($,I,q)})}for(let B=0;B<24;B++){const $=8+10*B;M.push({css:b.channels.toCss($,$,$),rgba:b.channels.toRgba($,$,$)})}return M})());let A=l.ThemeService=class extends k.Disposable{get colors(){return this._colors}constructor(M){super(),this._optionsService=M,this._contrastCache=new m.ColorContrastCache,this._halfContrastCache=new m.ColorContrastCache,this._onChangeColors=this.register(new x.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:_,background:v,cursor:f,cursorAccent:p,selectionForeground:void 0,selectionBackgroundTransparent:S,selectionBackgroundOpaque:b.color.blend(v,S),selectionInactiveBackgroundTransparent:S,selectionInactiveBackgroundOpaque:b.color.blend(v,S),ansi:l.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(M={}){const E=this._colors;if(E.foreground=R(M.foreground,_),E.background=R(M.background,v),E.cursor=R(M.cursor,f),E.cursorAccent=R(M.cursorAccent,p),E.selectionBackgroundTransparent=R(M.selectionBackground,S),E.selectionBackgroundOpaque=b.color.blend(E.background,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundTransparent=R(M.selectionInactiveBackground,E.selectionBackgroundTransparent),E.selectionInactiveBackgroundOpaque=b.color.blend(E.background,E.selectionInactiveBackgroundTransparent),E.selectionForeground=M.selectionForeground?R(M.selectionForeground,b.NULL_COLOR):void 0,E.selectionForeground===b.NULL_COLOR&&(E.selectionForeground=void 0),b.color.isOpaque(E.selectionBackgroundTransparent)&&(E.selectionBackgroundTransparent=b.color.opacity(E.selectionBackgroundTransparent,.3)),b.color.isOpaque(E.selectionInactiveBackgroundTransparent)&&(E.selectionInactiveBackgroundTransparent=b.color.opacity(E.selectionInactiveBackgroundTransparent,.3)),E.ansi=l.DEFAULT_ANSI_COLORS.slice(),E.ansi[0]=R(M.black,l.DEFAULT_ANSI_COLORS[0]),E.ansi[1]=R(M.red,l.DEFAULT_ANSI_COLORS[1]),E.ansi[2]=R(M.green,l.DEFAULT_ANSI_COLORS[2]),E.ansi[3]=R(M.yellow,l.DEFAULT_ANSI_COLORS[3]),E.ansi[4]=R(M.blue,l.DEFAULT_ANSI_COLORS[4]),E.ansi[5]=R(M.magenta,l.DEFAULT_ANSI_COLORS[5]),E.ansi[6]=R(M.cyan,l.DEFAULT_ANSI_COLORS[6]),E.ansi[7]=R(M.white,l.DEFAULT_ANSI_COLORS[7]),E.ansi[8]=R(M.brightBlack,l.DEFAULT_ANSI_COLORS[8]),E.ansi[9]=R(M.brightRed,l.DEFAULT_ANSI_COLORS[9]),E.ansi[10]=R(M.brightGreen,l.DEFAULT_ANSI_COLORS[10]),E.ansi[11]=R(M.brightYellow,l.DEFAULT_ANSI_COLORS[11]),E.ansi[12]=R(M.brightBlue,l.DEFAULT_ANSI_COLORS[12]),E.ansi[13]=R(M.brightMagenta,l.DEFAULT_ANSI_COLORS[13]),E.ansi[14]=R(M.brightCyan,l.DEFAULT_ANSI_COLORS[14]),E.ansi[15]=R(M.brightWhite,l.DEFAULT_ANSI_COLORS[15]),M.extendedAnsi){const B=Math.min(E.ansi.length-16,M.extendedAnsi.length);for(let $=0;$<B;$++)E.ansi[$+16]=R(M.extendedAnsi[$],l.DEFAULT_ANSI_COLORS[$+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(M){this._restoreColor(M),this._onChangeColors.fire(this.colors)}_restoreColor(M){if(M!==void 0)switch(M){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[M]=this._restoreColors.ansi[M]}else for(let E=0;E<this._restoreColors.ansi.length;++E)this._colors.ansi[E]=this._restoreColors.ansi[E]}modifyColors(M){M(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 R(M,E){if(M!==void 0)try{return b.css.toColor(M)}catch{}return E}l.ThemeService=A=u([y(0,C.IOptionsService)],A)},6349:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CircularList=void 0;const u=h(8460),y=h(844);class m extends y.Disposable{constructor(x){super(),this._maxLength=x,this.onDeleteEmitter=this.register(new u.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new u.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new u.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(x){if(this._maxLength===x)return;const k=new Array(x);for(let C=0;C<Math.min(x,this.length);C++)k[C]=this._array[this._getCyclicIndex(C)];this._array=k,this._maxLength=x,this._startIndex=0}get length(){return this._length}set length(x){if(x>this._length)for(let k=this._length;k<x;k++)this._array[k]=void 0;this._length=x}get(x){return this._array[this._getCyclicIndex(x)]}set(x,k){this._array[this._getCyclicIndex(x)]=k}push(x){this._array[this._getCyclicIndex(this._length)]=x,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(x,k,...C){if(k){for(let _=x;_<this._length-k;_++)this._array[this._getCyclicIndex(_)]=this._array[this._getCyclicIndex(_+k)];this._length-=k,this.onDeleteEmitter.fire({index:x,amount:k})}for(let _=this._length-1;_>=x;_--)this._array[this._getCyclicIndex(_+C.length)]=this._array[this._getCyclicIndex(_)];for(let _=0;_<C.length;_++)this._array[this._getCyclicIndex(x+_)]=C[_];if(C.length&&this.onInsertEmitter.fire({index:x,amount:C.length}),this._length+C.length>this._maxLength){const _=this._length+C.length-this._maxLength;this._startIndex+=_,this._length=this._maxLength,this.onTrimEmitter.fire(_)}else this._length+=C.length}trimStart(x){x>this._length&&(x=this._length),this._startIndex+=x,this._length-=x,this.onTrimEmitter.fire(x)}shiftElements(x,k,C){if(!(k<=0)){if(x<0||x>=this._length)throw new Error("start argument out of range");if(x+C<0)throw new Error("Cannot shift elements in list beyond index 0");if(C>0){for(let v=k-1;v>=0;v--)this.set(x+v+C,this.get(x+v));const _=x+k+C-this._length;if(_>0)for(this._length+=_;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let _=0;_<k;_++)this.set(x+_+C,this.get(x+_))}}_getCyclicIndex(x){return(this._startIndex+x)%this._maxLength}}l.CircularList=m},1439:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.clone=void 0,l.clone=function h(u,y=5){if(typeof u!="object")return u;const m=Array.isArray(u)?[]:{};for(const b in u)m[b]=y<=1?u[b]:u[b]&&h(u[b],y-1);return m}},8055:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.contrastRatio=l.toPaddedHex=l.rgba=l.rgb=l.css=l.color=l.channels=l.NULL_COLOR=void 0;let h=0,u=0,y=0,m=0;var b,x,k,C,_;function v(p){const S=p.toString(16);return S.length<2?"0"+S:S}function f(p,S){return p<S?(S+.05)/(p+.05):(p+.05)/(S+.05)}l.NULL_COLOR={css:"#00000000",rgba:0},(function(p){p.toCss=function(S,A,R,M){return M!==void 0?`#${v(S)}${v(A)}${v(R)}${v(M)}`:`#${v(S)}${v(A)}${v(R)}`},p.toRgba=function(S,A,R,M=255){return(S<<24|A<<16|R<<8|M)>>>0},p.toColor=function(S,A,R,M){return{css:p.toCss(S,A,R,M),rgba:p.toRgba(S,A,R,M)}}})(b||(l.channels=b={})),(function(p){function S(A,R){return m=Math.round(255*R),[h,u,y]=_.toChannels(A.rgba),{css:b.toCss(h,u,y,m),rgba:b.toRgba(h,u,y,m)}}p.blend=function(A,R){if(m=(255&R.rgba)/255,m===1)return{css:R.css,rgba:R.rgba};const M=R.rgba>>24&255,E=R.rgba>>16&255,B=R.rgba>>8&255,$=A.rgba>>24&255,I=A.rgba>>16&255,q=A.rgba>>8&255;return h=$+Math.round((M-$)*m),u=I+Math.round((E-I)*m),y=q+Math.round((B-q)*m),{css:b.toCss(h,u,y),rgba:b.toRgba(h,u,y)}},p.isOpaque=function(A){return(255&A.rgba)==255},p.ensureContrastRatio=function(A,R,M){const E=_.ensureContrastRatio(A.rgba,R.rgba,M);if(E)return b.toColor(E>>24&255,E>>16&255,E>>8&255)},p.opaque=function(A){const R=(255|A.rgba)>>>0;return[h,u,y]=_.toChannels(R),{css:b.toCss(h,u,y),rgba:R}},p.opacity=S,p.multiplyOpacity=function(A,R){return m=255&A.rgba,S(A,m*R/255)},p.toColorRGB=function(A){return[A.rgba>>24&255,A.rgba>>16&255,A.rgba>>8&255]}})(x||(l.color=x={})),(function(p){let S,A;try{const R=document.createElement("canvas");R.width=1,R.height=1;const M=R.getContext("2d",{willReadFrequently:!0});M&&(S=M,S.globalCompositeOperation="copy",A=S.createLinearGradient(0,0,1,1))}catch{}p.toColor=function(R){if(R.match(/#[\da-f]{3,8}/i))switch(R.length){case 4:return h=parseInt(R.slice(1,2).repeat(2),16),u=parseInt(R.slice(2,3).repeat(2),16),y=parseInt(R.slice(3,4).repeat(2),16),b.toColor(h,u,y);case 5:return h=parseInt(R.slice(1,2).repeat(2),16),u=parseInt(R.slice(2,3).repeat(2),16),y=parseInt(R.slice(3,4).repeat(2),16),m=parseInt(R.slice(4,5).repeat(2),16),b.toColor(h,u,y,m);case 7:return{css:R,rgba:(parseInt(R.slice(1),16)<<8|255)>>>0};case 9:return{css:R,rgba:parseInt(R.slice(1),16)>>>0}}const M=R.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(M)return h=parseInt(M[1]),u=parseInt(M[2]),y=parseInt(M[3]),m=Math.round(255*(M[5]===void 0?1:parseFloat(M[5]))),b.toColor(h,u,y,m);if(!S||!A)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=A,S.fillStyle=R,typeof S.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(S.fillRect(0,0,1,1),[h,u,y,m]=S.getImageData(0,0,1,1).data,m!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:b.toRgba(h,u,y,m),css:R}}})(k||(l.css=k={})),(function(p){function S(A,R,M){const E=A/255,B=R/255,$=M/255;return .2126*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))+.7152*(B<=.03928?B/12.92:Math.pow((B+.055)/1.055,2.4))+.0722*($<=.03928?$/12.92:Math.pow(($+.055)/1.055,2.4))}p.relativeLuminance=function(A){return S(A>>16&255,A>>8&255,255&A)},p.relativeLuminance2=S})(C||(l.rgb=C={})),(function(p){function S(R,M,E){const B=R>>24&255,$=R>>16&255,I=R>>8&255;let q=M>>24&255,P=M>>16&255,Q=M>>8&255,re=f(C.relativeLuminance2(q,P,Q),C.relativeLuminance2(B,$,I));for(;re<E&&(q>0||P>0||Q>0);)q-=Math.max(0,Math.ceil(.1*q)),P-=Math.max(0,Math.ceil(.1*P)),Q-=Math.max(0,Math.ceil(.1*Q)),re=f(C.relativeLuminance2(q,P,Q),C.relativeLuminance2(B,$,I));return(q<<24|P<<16|Q<<8|255)>>>0}function A(R,M,E){const B=R>>24&255,$=R>>16&255,I=R>>8&255;let q=M>>24&255,P=M>>16&255,Q=M>>8&255,re=f(C.relativeLuminance2(q,P,Q),C.relativeLuminance2(B,$,I));for(;re<E&&(q<255||P<255||Q<255);)q=Math.min(255,q+Math.ceil(.1*(255-q))),P=Math.min(255,P+Math.ceil(.1*(255-P))),Q=Math.min(255,Q+Math.ceil(.1*(255-Q))),re=f(C.relativeLuminance2(q,P,Q),C.relativeLuminance2(B,$,I));return(q<<24|P<<16|Q<<8|255)>>>0}p.blend=function(R,M){if(m=(255&M)/255,m===1)return M;const E=M>>24&255,B=M>>16&255,$=M>>8&255,I=R>>24&255,q=R>>16&255,P=R>>8&255;return h=I+Math.round((E-I)*m),u=q+Math.round((B-q)*m),y=P+Math.round(($-P)*m),b.toRgba(h,u,y)},p.ensureContrastRatio=function(R,M,E){const B=C.relativeLuminance(R>>8),$=C.relativeLuminance(M>>8);if(f(B,$)<E){if($<B){const P=S(R,M,E),Q=f(B,C.relativeLuminance(P>>8));if(Q<E){const re=A(R,M,E);return Q>f(B,C.relativeLuminance(re>>8))?P:re}return P}const I=A(R,M,E),q=f(B,C.relativeLuminance(I>>8));if(q<E){const P=S(R,M,E);return q>f(B,C.relativeLuminance(P>>8))?I:P}return I}},p.reduceLuminance=S,p.increaseLuminance=A,p.toChannels=function(R){return[R>>24&255,R>>16&255,R>>8&255,255&R]}})(_||(l.rgba=_={})),l.toPaddedHex=v,l.contrastRatio=f},8969:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreTerminal=void 0;const u=h(844),y=h(2585),m=h(4348),b=h(7866),x=h(744),k=h(7302),C=h(6975),_=h(8460),v=h(1753),f=h(1480),p=h(7994),S=h(9282),A=h(5435),R=h(5981),M=h(2660);let E=!1;class B extends u.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new _.EventEmitter),this._onScroll.event((I=>{var q;(q=this._onScrollApi)==null||q.fire(I.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(I){for(const q in I)this.optionsService.options[q]=I[q]}constructor(I){super(),this._windowsWrappingHeuristics=this.register(new u.MutableDisposable),this._onBinary=this.register(new _.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new _.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new _.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new _.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new _.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new _.EventEmitter),this._instantiationService=new m.InstantiationService,this.optionsService=this.register(new k.OptionsService(I)),this._instantiationService.setService(y.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(x.BufferService)),this._instantiationService.setService(y.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(b.LogService)),this._instantiationService.setService(y.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(C.CoreService)),this._instantiationService.setService(y.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(v.CoreMouseService)),this._instantiationService.setService(y.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(f.UnicodeService)),this._instantiationService.setService(y.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(p.CharsetService),this._instantiationService.setService(y.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(M.OscLinkService),this._instantiationService.setService(y.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new A.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,_.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,_.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,_.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,_.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((q=>{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((q=>{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 R.WriteBuffer(((q,P)=>this._inputHandler.parse(q,P)))),this.register((0,_.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(I,q){this._writeBuffer.write(I,q)}writeSync(I,q){this._logService.logLevel<=y.LogLevelEnum.WARN&&!E&&(this._logService.warn("writeSync is unreliable and will be removed soon."),E=!0),this._writeBuffer.writeSync(I,q)}input(I,q=!0){this.coreService.triggerDataEvent(I,q)}resize(I,q){isNaN(I)||isNaN(q)||(I=Math.max(I,x.MINIMUM_COLS),q=Math.max(q,x.MINIMUM_ROWS),this._bufferService.resize(I,q))}scroll(I,q=!1){this._bufferService.scroll(I,q)}scrollLines(I,q,P){this._bufferService.scrollLines(I,q,P)}scrollPages(I){this.scrollLines(I*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(I){const q=I-this._bufferService.buffer.ydisp;q!==0&&this.scrollLines(q)}registerEscHandler(I,q){return this._inputHandler.registerEscHandler(I,q)}registerDcsHandler(I,q){return this._inputHandler.registerDcsHandler(I,q)}registerCsiHandler(I,q){return this._inputHandler.registerCsiHandler(I,q)}registerOscHandler(I,q){return this._inputHandler.registerOscHandler(I,q)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let I=!1;const q=this.optionsService.rawOptions.windowsPty;q&&q.buildNumber!==void 0&&q.buildNumber!==void 0?I=q.backend==="conpty"&&q.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(I=!0),I?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const I=[];I.push(this.onLineFeed(S.updateWindowsModeWrappedState.bind(null,this._bufferService))),I.push(this.registerCsiHandler({final:"H"},(()=>((0,S.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,u.toDisposable)((()=>{for(const q of I)q.dispose()}))}}}l.CoreTerminal=B},8460:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.runAndSubscribe=l.forwardEvent=l.EventEmitter=void 0,l.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=h=>(this._listeners.push(h),{dispose:()=>{if(!this._disposed){for(let u=0;u<this._listeners.length;u++)if(this._listeners[u]===h)return void this._listeners.splice(u,1)}}})),this._event}fire(h,u){const y=[];for(let m=0;m<this._listeners.length;m++)y.push(this._listeners[m]);for(let m=0;m<y.length;m++)y[m].call(void 0,h,u)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},l.forwardEvent=function(h,u){return h((y=>u.fire(y)))},l.runAndSubscribe=function(h,u){return u(void 0),h((y=>u(y)))}},5435:function(T,l,h){var u=this&&this.__decorate||function(ee,N,U,L){var H,X=arguments.length,ne=X<3?N:L===null?L=Object.getOwnPropertyDescriptor(N,U):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ne=Reflect.decorate(ee,N,U,L);else for(var he=ee.length-1;he>=0;he--)(H=ee[he])&&(ne=(X<3?H(ne):X>3?H(N,U,ne):H(N,U))||ne);return X>3&&ne&&Object.defineProperty(N,U,ne),ne},y=this&&this.__param||function(ee,N){return function(U,L){N(U,L,ee)}};Object.defineProperty(l,"__esModule",{value:!0}),l.InputHandler=l.WindowsOptionsReportType=void 0;const m=h(2584),b=h(7116),x=h(2015),k=h(844),C=h(482),_=h(8437),v=h(8460),f=h(643),p=h(511),S=h(3734),A=h(2585),R=h(1480),M=h(6242),E=h(6351),B=h(5941),$={"(":0,")":1,"*":2,"+":3,"-":1,".":2},I=131072;function q(ee,N){if(ee>24)return N.setWinLines||!1;switch(ee){case 1:return!!N.restoreWin;case 2:return!!N.minimizeWin;case 3:return!!N.setWinPosition;case 4:return!!N.setWinSizePixels;case 5:return!!N.raiseWin;case 6:return!!N.lowerWin;case 7:return!!N.refreshWin;case 8:return!!N.setWinSizeChars;case 9:return!!N.maximizeWin;case 10:return!!N.fullscreenWin;case 11:return!!N.getWinState;case 13:return!!N.getWinPosition;case 14:return!!N.getWinSizePixels;case 15:return!!N.getScreenSizePixels;case 16:return!!N.getCellSizePixels;case 18:return!!N.getWinSizeChars;case 19:return!!N.getScreenSizeChars;case 20:return!!N.getIconTitle;case 21:return!!N.getWinTitle;case 22:return!!N.pushTitle;case 23:return!!N.popTitle;case 24:return!!N.setWinLines}return!1}var P;(function(ee){ee[ee.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",ee[ee.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(P||(l.WindowsOptionsReportType=P={}));let Q=0;class re extends k.Disposable{getAttrData(){return this._curAttrData}constructor(N,U,L,H,X,ne,he,me,Y=new x.EscapeSequenceParser){super(),this._bufferService=N,this._charsetService=U,this._coreService=L,this._logService=H,this._optionsService=X,this._oscLinkService=ne,this._coreMouseService=he,this._unicodeService=me,this._parser=Y,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new C.StringToUtf32,this._utf8Decoder=new C.Utf8ToUtf32,this._workCell=new p.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=_.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=_.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new v.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new v.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new v.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new v.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new v.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new v.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new v.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new v.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new v.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new v.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new v.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new v.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 G(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((j=>this._activeBuffer=j.activeBuffer))),this._parser.setCsiHandlerFallback(((j,ce)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(j),params:ce.toArray()})})),this._parser.setEscHandlerFallback((j=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(j)})})),this._parser.setExecuteHandlerFallback((j=>{this._logService.debug("Unknown EXECUTE code: ",{code:j})})),this._parser.setOscHandlerFallback(((j,ce,oe)=>{this._logService.debug("Unknown OSC code: ",{identifier:j,action:ce,data:oe})})),this._parser.setDcsHandlerFallback(((j,ce,oe)=>{ce==="HOOK"&&(oe=oe.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(j),action:ce,payload:oe})})),this._parser.setPrintHandler(((j,ce,oe)=>this.print(j,ce,oe))),this._parser.registerCsiHandler({final:"@"},(j=>this.insertChars(j))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(j=>this.scrollLeft(j))),this._parser.registerCsiHandler({final:"A"},(j=>this.cursorUp(j))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(j=>this.scrollRight(j))),this._parser.registerCsiHandler({final:"B"},(j=>this.cursorDown(j))),this._parser.registerCsiHandler({final:"C"},(j=>this.cursorForward(j))),this._parser.registerCsiHandler({final:"D"},(j=>this.cursorBackward(j))),this._parser.registerCsiHandler({final:"E"},(j=>this.cursorNextLine(j))),this._parser.registerCsiHandler({final:"F"},(j=>this.cursorPrecedingLine(j))),this._parser.registerCsiHandler({final:"G"},(j=>this.cursorCharAbsolute(j))),this._parser.registerCsiHandler({final:"H"},(j=>this.cursorPosition(j))),this._parser.registerCsiHandler({final:"I"},(j=>this.cursorForwardTab(j))),this._parser.registerCsiHandler({final:"J"},(j=>this.eraseInDisplay(j,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(j=>this.eraseInDisplay(j,!0))),this._parser.registerCsiHandler({final:"K"},(j=>this.eraseInLine(j,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(j=>this.eraseInLine(j,!0))),this._parser.registerCsiHandler({final:"L"},(j=>this.insertLines(j))),this._parser.registerCsiHandler({final:"M"},(j=>this.deleteLines(j))),this._parser.registerCsiHandler({final:"P"},(j=>this.deleteChars(j))),this._parser.registerCsiHandler({final:"S"},(j=>this.scrollUp(j))),this._parser.registerCsiHandler({final:"T"},(j=>this.scrollDown(j))),this._parser.registerCsiHandler({final:"X"},(j=>this.eraseChars(j))),this._parser.registerCsiHandler({final:"Z"},(j=>this.cursorBackwardTab(j))),this._parser.registerCsiHandler({final:"`"},(j=>this.charPosAbsolute(j))),this._parser.registerCsiHandler({final:"a"},(j=>this.hPositionRelative(j))),this._parser.registerCsiHandler({final:"b"},(j=>this.repeatPrecedingCharacter(j))),this._parser.registerCsiHandler({final:"c"},(j=>this.sendDeviceAttributesPrimary(j))),this._parser.registerCsiHandler({prefix:">",final:"c"},(j=>this.sendDeviceAttributesSecondary(j))),this._parser.registerCsiHandler({final:"d"},(j=>this.linePosAbsolute(j))),this._parser.registerCsiHandler({final:"e"},(j=>this.vPositionRelative(j))),this._parser.registerCsiHandler({final:"f"},(j=>this.hVPosition(j))),this._parser.registerCsiHandler({final:"g"},(j=>this.tabClear(j))),this._parser.registerCsiHandler({final:"h"},(j=>this.setMode(j))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(j=>this.setModePrivate(j))),this._parser.registerCsiHandler({final:"l"},(j=>this.resetMode(j))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(j=>this.resetModePrivate(j))),this._parser.registerCsiHandler({final:"m"},(j=>this.charAttributes(j))),this._parser.registerCsiHandler({final:"n"},(j=>this.deviceStatus(j))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(j=>this.deviceStatusPrivate(j))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(j=>this.softReset(j))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(j=>this.setCursorStyle(j))),this._parser.registerCsiHandler({final:"r"},(j=>this.setScrollRegion(j))),this._parser.registerCsiHandler({final:"s"},(j=>this.saveCursor(j))),this._parser.registerCsiHandler({final:"t"},(j=>this.windowOptions(j))),this._parser.registerCsiHandler({final:"u"},(j=>this.restoreCursor(j))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(j=>this.insertColumns(j))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(j=>this.deleteColumns(j))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(j=>this.selectProtected(j))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(j=>this.requestMode(j,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(j=>this.requestMode(j,!1))),this._parser.setExecuteHandler(m.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(m.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(m.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(m.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(m.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(m.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(m.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(m.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(m.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(m.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(m.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(m.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new M.OscHandler((j=>(this.setTitle(j),this.setIconName(j),!0)))),this._parser.registerOscHandler(1,new M.OscHandler((j=>this.setIconName(j)))),this._parser.registerOscHandler(2,new M.OscHandler((j=>this.setTitle(j)))),this._parser.registerOscHandler(4,new M.OscHandler((j=>this.setOrReportIndexedColor(j)))),this._parser.registerOscHandler(8,new M.OscHandler((j=>this.setHyperlink(j)))),this._parser.registerOscHandler(10,new M.OscHandler((j=>this.setOrReportFgColor(j)))),this._parser.registerOscHandler(11,new M.OscHandler((j=>this.setOrReportBgColor(j)))),this._parser.registerOscHandler(12,new M.OscHandler((j=>this.setOrReportCursorColor(j)))),this._parser.registerOscHandler(104,new M.OscHandler((j=>this.restoreIndexedColor(j)))),this._parser.registerOscHandler(110,new M.OscHandler((j=>this.restoreFgColor(j)))),this._parser.registerOscHandler(111,new M.OscHandler((j=>this.restoreBgColor(j)))),this._parser.registerOscHandler(112,new M.OscHandler((j=>this.restoreCursorColor(j)))),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 j in b.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:j},(()=>this.selectCharset("("+j))),this._parser.registerEscHandler({intermediates:")",final:j},(()=>this.selectCharset(")"+j))),this._parser.registerEscHandler({intermediates:"*",final:j},(()=>this.selectCharset("*"+j))),this._parser.registerEscHandler({intermediates:"+",final:j},(()=>this.selectCharset("+"+j))),this._parser.registerEscHandler({intermediates:"-",final:j},(()=>this.selectCharset("-"+j))),this._parser.registerEscHandler({intermediates:".",final:j},(()=>this.selectCharset("."+j))),this._parser.registerEscHandler({intermediates:"/",final:j},(()=>this.selectCharset("/"+j)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((j=>(this._logService.error("Parsing error: ",j),j))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new E.DcsHandler(((j,ce)=>this.requestStatusString(j,ce))))}_preserveStack(N,U,L,H){this._parseStack.paused=!0,this._parseStack.cursorStartX=N,this._parseStack.cursorStartY=U,this._parseStack.decodedLength=L,this._parseStack.position=H}_logSlowResolvingAsync(N){this._logService.logLevel<=A.LogLevelEnum.WARN&&Promise.race([N,new Promise(((U,L)=>setTimeout((()=>L("#SLOW_TIMEOUT")),5e3)))]).catch((U=>{if(U!=="#SLOW_TIMEOUT")throw U;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(N,U){let L,H=this._activeBuffer.x,X=this._activeBuffer.y,ne=0;const he=this._parseStack.paused;if(he){if(L=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,U))return this._logSlowResolvingAsync(L),L;H=this._parseStack.cursorStartX,X=this._parseStack.cursorStartY,this._parseStack.paused=!1,N.length>I&&(ne=this._parseStack.position+I)}if(this._logService.logLevel<=A.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof N=="string"?` "${N}"`:` "${Array.prototype.map.call(N,(j=>String.fromCharCode(j))).join("")}"`),typeof N=="string"?N.split("").map((j=>j.charCodeAt(0))):N),this._parseBuffer.length<N.length&&this._parseBuffer.length<I&&(this._parseBuffer=new Uint32Array(Math.min(N.length,I))),he||this._dirtyRowTracker.clearRange(),N.length>I)for(let j=ne;j<N.length;j+=I){const ce=j+I<N.length?j+I:N.length,oe=typeof N=="string"?this._stringDecoder.decode(N.substring(j,ce),this._parseBuffer):this._utf8Decoder.decode(N.subarray(j,ce),this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,oe))return this._preserveStack(H,X,oe,j),this._logSlowResolvingAsync(L),L}else if(!he){const j=typeof N=="string"?this._stringDecoder.decode(N,this._parseBuffer):this._utf8Decoder.decode(N,this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,j))return this._preserveStack(H,X,j,0),this._logSlowResolvingAsync(L),L}this._activeBuffer.x===H&&this._activeBuffer.y===X||this._onCursorMove.fire();const me=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),Y=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);Y<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(Y,this._bufferService.rows-1),Math.min(me,this._bufferService.rows-1))}print(N,U,L){let H,X;const ne=this._charsetService.charset,he=this._optionsService.rawOptions.screenReaderMode,me=this._bufferService.cols,Y=this._coreService.decPrivateModes.wraparound,j=this._coreService.modes.insertMode,ce=this._curAttrData;let oe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&L-U>0&&oe.getWidth(this._activeBuffer.x-1)===2&&oe.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ce);let ve=this._parser.precedingJoinState;for(let pe=U;pe<L;++pe){if(H=N[pe],H<127&&ne){const ct=ne[String.fromCharCode(H)];ct&&(H=ct.charCodeAt(0))}const Te=this._unicodeService.charProperties(H,ve);X=R.UnicodeService.extractWidth(Te);const je=R.UnicodeService.extractShouldJoin(Te),Ue=je?R.UnicodeService.extractWidth(ve):0;if(ve=Te,he&&this._onA11yChar.fire((0,C.stringFromCodePoint)(H)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+X-Ue>me){if(Y){const ct=oe;let Ee=this._activeBuffer.x-Ue;for(this._activeBuffer.x=Ue,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),Ue>0&&oe instanceof _.BufferLine&&oe.copyCellsFrom(ct,Ee,0,Ue,!1);Ee<me;)ct.setCellFromCodepoint(Ee++,0,1,ce)}else if(this._activeBuffer.x=me-1,X===2)continue}if(je&&this._activeBuffer.x){const ct=oe.getWidth(this._activeBuffer.x-1)?1:2;oe.addCodepointToCell(this._activeBuffer.x-ct,H,X);for(let Ee=X-Ue;--Ee>=0;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,ce)}else if(j&&(oe.insertCells(this._activeBuffer.x,X-Ue,this._activeBuffer.getNullCell(ce)),oe.getWidth(me-1)===2&&oe.setCellFromCodepoint(me-1,f.NULL_CELL_CODE,f.NULL_CELL_WIDTH,ce)),oe.setCellFromCodepoint(this._activeBuffer.x++,H,X,ce),X>0)for(;--X;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,ce)}this._parser.precedingJoinState=ve,this._activeBuffer.x<me&&L-U>0&&oe.getWidth(this._activeBuffer.x)===0&&!oe.hasContent(this._activeBuffer.x)&&oe.setCellFromCodepoint(this._activeBuffer.x,0,1,ce),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(N,U){return N.final!=="t"||N.prefix||N.intermediates?this._parser.registerCsiHandler(N,U):this._parser.registerCsiHandler(N,(L=>!q(L.params[0],this._optionsService.rawOptions.windowOptions)||U(L)))}registerDcsHandler(N,U){return this._parser.registerDcsHandler(N,new E.DcsHandler(U))}registerEscHandler(N,U){return this._parser.registerEscHandler(N,U)}registerOscHandler(N,U){return this._parser.registerOscHandler(N,new M.OscHandler(U))}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 N;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&&((N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&N.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);U.hasWidth(this._activeBuffer.x)&&!U.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const N=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-N),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(N=this._bufferService.cols-1){this._activeBuffer.x=Math.min(N,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(N,U){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=N,this._activeBuffer.y=this._activeBuffer.scrollTop+U):(this._activeBuffer.x=N,this._activeBuffer.y=U),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(N,U){this._restrictCursor(),this._setCursor(this._activeBuffer.x+N,this._activeBuffer.y+U)}cursorUp(N){const U=this._activeBuffer.y-this._activeBuffer.scrollTop;return U>=0?this._moveCursor(0,-Math.min(U,N.params[0]||1)):this._moveCursor(0,-(N.params[0]||1)),!0}cursorDown(N){const U=this._activeBuffer.scrollBottom-this._activeBuffer.y;return U>=0?this._moveCursor(0,Math.min(U,N.params[0]||1)):this._moveCursor(0,N.params[0]||1),!0}cursorForward(N){return this._moveCursor(N.params[0]||1,0),!0}cursorBackward(N){return this._moveCursor(-(N.params[0]||1),0),!0}cursorNextLine(N){return this.cursorDown(N),this._activeBuffer.x=0,!0}cursorPrecedingLine(N){return this.cursorUp(N),this._activeBuffer.x=0,!0}cursorCharAbsolute(N){return this._setCursor((N.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(N){return this._setCursor(N.length>=2?(N.params[1]||1)-1:0,(N.params[0]||1)-1),!0}charPosAbsolute(N){return this._setCursor((N.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(N){return this._moveCursor(N.params[0]||1,0),!0}linePosAbsolute(N){return this._setCursor(this._activeBuffer.x,(N.params[0]||1)-1),!0}vPositionRelative(N){return this._moveCursor(0,N.params[0]||1),!0}hVPosition(N){return this.cursorPosition(N),!0}tabClear(N){const U=N.params[0];return U===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:U===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(N){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let U=N.params[0]||1;for(;U--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(N){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let U=N.params[0]||1;for(;U--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(N){const U=N.params[0];return U===1&&(this._curAttrData.bg|=536870912),U!==2&&U!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(N,U,L,H=!1,X=!1){const ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);ne.replaceCells(U,L,this._activeBuffer.getNullCell(this._eraseAttrData()),X),H&&(ne.isWrapped=!1)}_resetBufferLine(N,U=!1){const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);L&&(L.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),U),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+N),L.isWrapped=!1)}eraseInDisplay(N,U=!1){let L;switch(this._restrictCursor(this._bufferService.cols),N.params[0]){case 0:for(L=this._activeBuffer.y,this._dirtyRowTracker.markDirty(L),this._eraseInBufferLine(L++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,U);L<this._bufferService.rows;L++)this._resetBufferLine(L,U);this._dirtyRowTracker.markDirty(L);break;case 1:for(L=this._activeBuffer.y,this._dirtyRowTracker.markDirty(L),this._eraseInBufferLine(L,0,this._activeBuffer.x+1,!0,U),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(L+1).isWrapped=!1);L--;)this._resetBufferLine(L,U);this._dirtyRowTracker.markDirty(0);break;case 2:for(L=this._bufferService.rows,this._dirtyRowTracker.markDirty(L-1);L--;)this._resetBufferLine(L,U);this._dirtyRowTracker.markDirty(0);break;case 3:const H=this._activeBuffer.lines.length-this._bufferService.rows;H>0&&(this._activeBuffer.lines.trimStart(H),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-H,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-H,0),this._onScroll.fire(0))}return!0}eraseInLine(N,U=!1){switch(this._restrictCursor(this._bufferService.cols),N.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,U);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,U);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,U)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(N){this._restrictCursor();let U=N.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=this._activeBuffer.ybase+this._activeBuffer.y,H=this._bufferService.rows-1-this._activeBuffer.scrollBottom,X=this._bufferService.rows-1+this._activeBuffer.ybase-H+1;for(;U--;)this._activeBuffer.lines.splice(X-1,1),this._activeBuffer.lines.splice(L,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(N){this._restrictCursor();let U=N.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=this._activeBuffer.ybase+this._activeBuffer.y;let H;for(H=this._bufferService.rows-1-this._activeBuffer.scrollBottom,H=this._bufferService.rows-1+this._activeBuffer.ybase-H;U--;)this._activeBuffer.lines.splice(L,1),this._activeBuffer.lines.splice(H,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(N){this._restrictCursor();const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return U&&(U.insertCells(this._activeBuffer.x,N.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(N){this._restrictCursor();const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return U&&(U.deleteCells(this._activeBuffer.x,N.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(N){let U=N.params[0]||1;for(;U--;)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(N){let U=N.params[0]||1;for(;U--;)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(_.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=N.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);H.deleteCells(0,U,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=N.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);H.insertCells(0,U,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=N.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);H.insertCells(this._activeBuffer.x,U,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=N.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);H.deleteCells(this._activeBuffer.x,U,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(N){this._restrictCursor();const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return U&&(U.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(N.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(N){const U=this._parser.precedingJoinState;if(!U)return!0;const L=N.params[0]||1,H=R.UnicodeService.extractWidth(U),X=this._activeBuffer.x-H,ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(X),he=new Uint32Array(ne.length*L);let me=0;for(let j=0;j<ne.length;){const ce=ne.codePointAt(j)||0;he[me++]=ce,j+=ce>65535?2:1}let Y=me;for(let j=1;j<L;++j)he.copyWithin(Y,0,me),Y+=me;return this.print(he,0,Y),!0}sendDeviceAttributesPrimary(N){return N.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(m.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(m.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(N){return N.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(m.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(m.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(N.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(m.C0.ESC+"[>83;40003;0c")),!0}_is(N){return(this._optionsService.rawOptions.termName+"").indexOf(N)===0}setMode(N){for(let U=0;U<N.length;U++)switch(N.params[U]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(N){for(let U=0;U<N.length;U++)switch(N.params[U]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,b.DEFAULT_CHARSET),this._charsetService.setgCharset(1,b.DEFAULT_CHARSET),this._charsetService.setgCharset(2,b.DEFAULT_CHARSET),this._charsetService.setgCharset(3,b.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(N){for(let U=0;U<N.length;U++)switch(N.params[U]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(N){for(let U=0;U<N.length;U++)switch(N.params[U]){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(),N.params[U]===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(N,U){const L=this._coreService.decPrivateModes,{activeProtocol:H,activeEncoding:X}=this._coreMouseService,ne=this._coreService,{buffers:he,cols:me}=this._bufferService,{active:Y,alt:j}=he,ce=this._optionsService.rawOptions,oe=je=>je?1:2,ve=N.params[0];return pe=ve,Te=U?ve===2?4:ve===4?oe(ne.modes.insertMode):ve===12?3:ve===20?oe(ce.convertEol):0:ve===1?oe(L.applicationCursorKeys):ve===3?ce.windowOptions.setWinLines?me===80?2:me===132?1:0:0:ve===6?oe(L.origin):ve===7?oe(L.wraparound):ve===8?3:ve===9?oe(H==="X10"):ve===12?oe(ce.cursorBlink):ve===25?oe(!ne.isCursorHidden):ve===45?oe(L.reverseWraparound):ve===66?oe(L.applicationKeypad):ve===67?4:ve===1e3?oe(H==="VT200"):ve===1002?oe(H==="DRAG"):ve===1003?oe(H==="ANY"):ve===1004?oe(L.sendFocus):ve===1005?4:ve===1006?oe(X==="SGR"):ve===1015?4:ve===1016?oe(X==="SGR_PIXELS"):ve===1048?1:ve===47||ve===1047||ve===1049?oe(Y===j):ve===2004?oe(L.bracketedPasteMode):0,ne.triggerDataEvent(`${m.C0.ESC}[${U?"":"?"}${pe};${Te}$y`),!0;var pe,Te}_updateAttrColor(N,U,L,H,X){return U===2?(N|=50331648,N&=-16777216,N|=S.AttributeData.fromColorRGB([L,H,X])):U===5&&(N&=-50331904,N|=33554432|255&L),N}_extractColor(N,U,L){const H=[0,0,-1,0,0,0];let X=0,ne=0;do{if(H[ne+X]=N.params[U+ne],N.hasSubParams(U+ne)){const he=N.getSubParams(U+ne);let me=0;do H[1]===5&&(X=1),H[ne+me+1+X]=he[me];while(++me<he.length&&me+ne+1+X<H.length);break}if(H[1]===5&&ne+X>=2||H[1]===2&&ne+X>=5)break;H[1]&&(X=1)}while(++ne+U<N.length&&ne+X<H.length);for(let he=2;he<H.length;++he)H[he]===-1&&(H[he]=0);switch(H[0]){case 38:L.fg=this._updateAttrColor(L.fg,H[1],H[3],H[4],H[5]);break;case 48:L.bg=this._updateAttrColor(L.bg,H[1],H[3],H[4],H[5]);break;case 58:L.extended=L.extended.clone(),L.extended.underlineColor=this._updateAttrColor(L.extended.underlineColor,H[1],H[3],H[4],H[5])}return ne}_processUnderline(N,U){U.extended=U.extended.clone(),(!~N||N>5)&&(N=1),U.extended.underlineStyle=N,U.fg|=268435456,N===0&&(U.fg&=-268435457),U.updateExtended()}_processSGR0(N){N.fg=_.DEFAULT_ATTR_DATA.fg,N.bg=_.DEFAULT_ATTR_DATA.bg,N.extended=N.extended.clone(),N.extended.underlineStyle=0,N.extended.underlineColor&=-67108864,N.updateExtended()}charAttributes(N){if(N.length===1&&N.params[0]===0)return this._processSGR0(this._curAttrData),!0;const U=N.length;let L;const H=this._curAttrData;for(let X=0;X<U;X++)L=N.params[X],L>=30&&L<=37?(H.fg&=-50331904,H.fg|=16777216|L-30):L>=40&&L<=47?(H.bg&=-50331904,H.bg|=16777216|L-40):L>=90&&L<=97?(H.fg&=-50331904,H.fg|=16777224|L-90):L>=100&&L<=107?(H.bg&=-50331904,H.bg|=16777224|L-100):L===0?this._processSGR0(H):L===1?H.fg|=134217728:L===3?H.bg|=67108864:L===4?(H.fg|=268435456,this._processUnderline(N.hasSubParams(X)?N.getSubParams(X)[0]:1,H)):L===5?H.fg|=536870912:L===7?H.fg|=67108864:L===8?H.fg|=1073741824:L===9?H.fg|=2147483648:L===2?H.bg|=134217728:L===21?this._processUnderline(2,H):L===22?(H.fg&=-134217729,H.bg&=-134217729):L===23?H.bg&=-67108865:L===24?(H.fg&=-268435457,this._processUnderline(0,H)):L===25?H.fg&=-536870913:L===27?H.fg&=-67108865:L===28?H.fg&=-1073741825:L===29?H.fg&=2147483647:L===39?(H.fg&=-67108864,H.fg|=16777215&_.DEFAULT_ATTR_DATA.fg):L===49?(H.bg&=-67108864,H.bg|=16777215&_.DEFAULT_ATTR_DATA.bg):L===38||L===48||L===58?X+=this._extractColor(N,X,H):L===53?H.bg|=1073741824:L===55?H.bg&=-1073741825:L===59?(H.extended=H.extended.clone(),H.extended.underlineColor=-1,H.updateExtended()):L===100?(H.fg&=-67108864,H.fg|=16777215&_.DEFAULT_ATTR_DATA.fg,H.bg&=-67108864,H.bg|=16777215&_.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",L);return!0}deviceStatus(N){switch(N.params[0]){case 5:this._coreService.triggerDataEvent(`${m.C0.ESC}[0n`);break;case 6:const U=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${m.C0.ESC}[${U};${L}R`)}return!0}deviceStatusPrivate(N){if(N.params[0]===6){const U=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${m.C0.ESC}[?${U};${L}R`)}return!0}softReset(N){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=_.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(N){const U=N.params[0]||1;switch(U){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 L=U%2==1;return this._optionsService.options.cursorBlink=L,!0}setScrollRegion(N){const U=N.params[0]||1;let L;return(N.length<2||(L=N.params[1])>this._bufferService.rows||L===0)&&(L=this._bufferService.rows),L>U&&(this._activeBuffer.scrollTop=U-1,this._activeBuffer.scrollBottom=L-1,this._setCursor(0,0)),!0}windowOptions(N){if(!q(N.params[0],this._optionsService.rawOptions.windowOptions))return!0;const U=N.length>1?N.params[1]:0;switch(N.params[0]){case 14:U!==2&&this._onRequestWindowsOptionsReport.fire(P.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(P.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${m.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:U!==0&&U!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),U!==0&&U!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:U!==0&&U!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),U!==0&&U!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(N){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(N){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(N){return this._windowTitle=N,this._onTitleChange.fire(N),!0}setIconName(N){return this._iconName=N,!0}setOrReportIndexedColor(N){const U=[],L=N.split(";");for(;L.length>1;){const H=L.shift(),X=L.shift();if(/^\d+$/.exec(H)){const ne=parseInt(H);if(V(ne))if(X==="?")U.push({type:0,index:ne});else{const he=(0,B.parseColor)(X);he&&U.push({type:1,index:ne,color:he})}}}return U.length&&this._onColor.fire(U),!0}setHyperlink(N){const U=N.split(";");return!(U.length<2)&&(U[1]?this._createHyperlink(U[0],U[1]):!U[0]&&this._finishHyperlink())}_createHyperlink(N,U){this._getCurrentLinkId()&&this._finishHyperlink();const L=N.split(":");let H;const X=L.findIndex((ne=>ne.startsWith("id=")));return X!==-1&&(H=L[X].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:H,uri:U}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(N,U){const L=N.split(";");for(let H=0;H<L.length&&!(U>=this._specialColors.length);++H,++U)if(L[H]==="?")this._onColor.fire([{type:0,index:this._specialColors[U]}]);else{const X=(0,B.parseColor)(L[H]);X&&this._onColor.fire([{type:1,index:this._specialColors[U],color:X}])}return!0}setOrReportFgColor(N){return this._setOrReportSpecialColor(N,0)}setOrReportBgColor(N){return this._setOrReportSpecialColor(N,1)}setOrReportCursorColor(N){return this._setOrReportSpecialColor(N,2)}restoreIndexedColor(N){if(!N)return this._onColor.fire([{type:2}]),!0;const U=[],L=N.split(";");for(let H=0;H<L.length;++H)if(/^\d+$/.exec(L[H])){const X=parseInt(L[H]);V(X)&&U.push({type:2,index:X})}return U.length&&this._onColor.fire(U),!0}restoreFgColor(N){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(N){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(N){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,b.DEFAULT_CHARSET),!0}selectCharset(N){return N.length!==2?(this.selectDefaultCharset(),!0):(N[0]==="/"||this._charsetService.setgCharset($[N[0]],b.CHARSETS[N[1]]||b.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 N=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,N,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=_.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=_.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(N){return this._charsetService.setgLevel(N),!0}screenAlignmentPattern(){const N=new p.CellData;N.content=4194373,N.fg=this._curAttrData.fg,N.bg=this._curAttrData.bg,this._setCursor(0,0);for(let U=0;U<this._bufferService.rows;++U){const L=this._activeBuffer.ybase+this._activeBuffer.y+U,H=this._activeBuffer.lines.get(L);H&&(H.fill(N),H.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(N,U){const L=this._bufferService.buffer,H=this._optionsService.rawOptions;return(X=>(this._coreService.triggerDataEvent(`${m.C0.ESC}${X}${m.C0.ESC}\\`),!0))(N==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:N==='"p'?'P1$r61;1"p':N==="r"?`P1$r${L.scrollTop+1};${L.scrollBottom+1}r`:N==="m"?"P1$r0m":N===" q"?`P1$r${{block:2,underline:4,bar:6}[H.cursorStyle]-(H.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(N,U){this._dirtyRowTracker.markRangeDirty(N,U)}}l.InputHandler=re;let G=class{constructor(ee){this._bufferService=ee,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(ee){ee<this.start?this.start=ee:ee>this.end&&(this.end=ee)}markRangeDirty(ee,N){ee>N&&(Q=ee,ee=N,N=Q),ee<this.start&&(this.start=ee),N>this.end&&(this.end=N)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function V(ee){return 0<=ee&&ee<256}G=u([y(0,A.IBufferService)],G)},844:(T,l)=>{function h(u){for(const y of u)y.dispose();u.length=0}Object.defineProperty(l,"__esModule",{value:!0}),l.getDisposeArrayDisposable=l.disposeArray=l.toDisposable=l.MutableDisposable=l.Disposable=void 0,l.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const u of this._disposables)u.dispose();this._disposables.length=0}register(u){return this._disposables.push(u),u}unregister(u){const y=this._disposables.indexOf(u);y!==-1&&this._disposables.splice(y,1)}},l.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(u){var y;this._isDisposed||u===this._value||((y=this._value)==null||y.dispose(),this._value=u)}clear(){this.value=void 0}dispose(){var u;this._isDisposed=!0,(u=this._value)==null||u.dispose(),this._value=void 0}},l.toDisposable=function(u){return{dispose:u}},l.disposeArray=h,l.getDisposeArrayDisposable=function(u){return{dispose:()=>h(u)}}},1505:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.FourKeyMap=l.TwoKeyMap=void 0;class h{constructor(){this._data={}}set(y,m,b){this._data[y]||(this._data[y]={}),this._data[y][m]=b}get(y,m){return this._data[y]?this._data[y][m]:void 0}clear(){this._data={}}}l.TwoKeyMap=h,l.FourKeyMap=class{constructor(){this._data=new h}set(u,y,m,b,x){this._data.get(u,y)||this._data.set(u,y,new h),this._data.get(u,y).set(m,b,x)}get(u,y,m,b){var x;return(x=this._data.get(u,y))==null?void 0:x.get(m,b)}clear(){this._data.clear()}}},6114:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.isChromeOS=l.isLinux=l.isWindows=l.isIphone=l.isIpad=l.isMac=l.getSafariVersion=l.isSafari=l.isLegacyEdge=l.isFirefox=l.isNode=void 0,l.isNode=typeof process<"u"&&"title"in process;const h=l.isNode?"node":navigator.userAgent,u=l.isNode?"node":navigator.platform;l.isFirefox=h.includes("Firefox"),l.isLegacyEdge=h.includes("Edge"),l.isSafari=/^((?!chrome|android).)*safari/i.test(h),l.getSafariVersion=function(){if(!l.isSafari)return 0;const y=h.match(/Version\/(\d+)/);return y===null||y.length<2?0:parseInt(y[1])},l.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(u),l.isIpad=u==="iPad",l.isIphone=u==="iPhone",l.isWindows=["Windows","Win16","Win32","WinCE"].includes(u),l.isLinux=u.indexOf("Linux")>=0,l.isChromeOS=/\bCrOS\b/.test(h)},6106:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SortedList=void 0;let h=0;l.SortedList=class{constructor(u){this._getKey=u,this._array=[]}clear(){this._array.length=0}insert(u){this._array.length!==0?(h=this._search(this._getKey(u)),this._array.splice(h,0,u)):this._array.push(u)}delete(u){if(this._array.length===0)return!1;const y=this._getKey(u);if(y===void 0||(h=this._search(y),h===-1)||this._getKey(this._array[h])!==y)return!1;do if(this._array[h]===u)return this._array.splice(h,1),!0;while(++h<this._array.length&&this._getKey(this._array[h])===y);return!1}*getKeyIterator(u){if(this._array.length!==0&&(h=this._search(u),!(h<0||h>=this._array.length)&&this._getKey(this._array[h])===u))do yield this._array[h];while(++h<this._array.length&&this._getKey(this._array[h])===u)}forEachByKey(u,y){if(this._array.length!==0&&(h=this._search(u),!(h<0||h>=this._array.length)&&this._getKey(this._array[h])===u))do y(this._array[h]);while(++h<this._array.length&&this._getKey(this._array[h])===u)}values(){return[...this._array].values()}_search(u){let y=0,m=this._array.length-1;for(;m>=y;){let b=y+m>>1;const x=this._getKey(this._array[b]);if(x>u)m=b-1;else{if(!(x<u)){for(;b>0&&this._getKey(this._array[b-1])===u;)b--;return b}y=b+1}}return y}}},7226:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DebouncedIdleTask=l.IdleTaskQueue=l.PriorityTaskQueue=void 0;const u=h(6114);class y{constructor(){this._tasks=[],this._i=0}enqueue(x){this._tasks.push(x),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(x){this._idleCallback=void 0;let k=0,C=0,_=x.timeRemaining(),v=0;for(;this._i<this._tasks.length;){if(k=Date.now(),this._tasks[this._i]()||this._i++,k=Math.max(1,Date.now()-k),C=Math.max(k,C),v=x.timeRemaining(),1.5*C>v)return _-k<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(_-k))}ms`),void this._start();_=v}this.clear()}}class m extends y{_requestCallback(x){return setTimeout((()=>x(this._createDeadline(16))))}_cancelCallback(x){clearTimeout(x)}_createDeadline(x){const k=Date.now()+x;return{timeRemaining:()=>Math.max(0,k-Date.now())}}}l.PriorityTaskQueue=m,l.IdleTaskQueue=!u.isNode&&"requestIdleCallback"in window?class extends y{_requestCallback(b){return requestIdleCallback(b)}_cancelCallback(b){cancelIdleCallback(b)}}:m,l.DebouncedIdleTask=class{constructor(){this._queue=new l.IdleTaskQueue}set(b){this._queue.clear(),this._queue.enqueue(b)}flush(){this._queue.flush()}}},9282:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.updateWindowsModeWrappedState=void 0;const u=h(643);l.updateWindowsModeWrappedState=function(y){const m=y.buffer.lines.get(y.buffer.ybase+y.buffer.y-1),b=m==null?void 0:m.get(y.cols-1),x=y.buffer.lines.get(y.buffer.ybase+y.buffer.y);x&&b&&(x.isWrapped=b[u.CHAR_DATA_CODE_INDEX]!==u.NULL_CELL_CODE&&b[u.CHAR_DATA_CODE_INDEX]!==u.WHITESPACE_CELL_CODE)}},3734:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ExtendedAttrs=l.AttributeData=void 0;class h{constructor(){this.fg=0,this.bg=0,this.extended=new u}static toColorRGB(m){return[m>>>16&255,m>>>8&255,255&m]}static fromColorRGB(m){return(255&m[0])<<16|(255&m[1])<<8|255&m[2]}clone(){const m=new h;return m.fg=this.fg,m.bg=this.bg,m.extended=this.extended.clone(),m}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}}l.AttributeData=h;class u{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(m){this._ext=m}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(m){this._ext&=-469762049,this._ext|=m<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(m){this._ext&=-67108864,this._ext|=67108863&m}get urlId(){return this._urlId}set urlId(m){this._urlId=m}get underlineVariantOffset(){const m=(3758096384&this._ext)>>29;return m<0?4294967288^m:m}set underlineVariantOffset(m){this._ext&=536870911,this._ext|=m<<29&3758096384}constructor(m=0,b=0){this._ext=0,this._urlId=0,this._ext=m,this._urlId=b}clone(){return new u(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}l.ExtendedAttrs=u},9092:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Buffer=l.MAX_BUFFER_SIZE=void 0;const u=h(6349),y=h(7226),m=h(3734),b=h(8437),x=h(4634),k=h(511),C=h(643),_=h(4863),v=h(7116);l.MAX_BUFFER_SIZE=4294967295,l.Buffer=class{constructor(f,p,S){this._hasScrollback=f,this._optionsService=p,this._bufferService=S,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=b.DEFAULT_ATTR_DATA.clone(),this.savedCharset=v.DEFAULT_CHARSET,this.markers=[],this._nullCell=k.CellData.fromCharData([0,C.NULL_CELL_CHAR,C.NULL_CELL_WIDTH,C.NULL_CELL_CODE]),this._whitespaceCell=k.CellData.fromCharData([0,C.WHITESPACE_CELL_CHAR,C.WHITESPACE_CELL_WIDTH,C.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new y.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(f){return f?(this._nullCell.fg=f.fg,this._nullCell.bg=f.bg,this._nullCell.extended=f.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new m.ExtendedAttrs),this._nullCell}getWhitespaceCell(f){return f?(this._whitespaceCell.fg=f.fg,this._whitespaceCell.bg=f.bg,this._whitespaceCell.extended=f.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new m.ExtendedAttrs),this._whitespaceCell}getBlankLine(f,p){return new b.BufferLine(this._bufferService.cols,this.getNullCell(f),p)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const f=this.ybase+this.y-this.ydisp;return f>=0&&f<this._rows}_getCorrectBufferLength(f){if(!this._hasScrollback)return f;const p=f+this._optionsService.rawOptions.scrollback;return p>l.MAX_BUFFER_SIZE?l.MAX_BUFFER_SIZE:p}fillViewportRows(f){if(this.lines.length===0){f===void 0&&(f=b.DEFAULT_ATTR_DATA);let p=this._rows;for(;p--;)this.lines.push(this.getBlankLine(f))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(f,p){const S=this.getNullCell(b.DEFAULT_ATTR_DATA);let A=0;const R=this._getCorrectBufferLength(p);if(R>this.lines.maxLength&&(this.lines.maxLength=R),this.lines.length>0){if(this._cols<f)for(let E=0;E<this.lines.length;E++)A+=+this.lines.get(E).resize(f,S);let M=0;if(this._rows<p)for(let E=this._rows;E<p;E++)this.lines.length<p+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new b.BufferLine(f,S)):this.ybase>0&&this.lines.length<=this.ybase+this.y+M+1?(this.ybase--,M++,this.ydisp>0&&this.ydisp--):this.lines.push(new b.BufferLine(f,S)));else for(let E=this._rows;E>p;E--)this.lines.length>p+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(R<this.lines.maxLength){const E=this.lines.length-R;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=R}this.x=Math.min(this.x,f-1),this.y=Math.min(this.y,p-1),M&&(this.y+=M),this.savedX=Math.min(this.savedX,f-1),this.scrollTop=0}if(this.scrollBottom=p-1,this._isReflowEnabled&&(this._reflow(f,p),this._cols>f))for(let M=0;M<this.lines.length;M++)A+=+this.lines.get(M).resize(f,S);this._cols=f,this._rows=p,this._memoryCleanupQueue.clear(),A>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let f=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,f=!1);let p=0;for(;this._memoryCleanupPosition<this.lines.length;)if(p+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),p>100)return!0;return f}get _isReflowEnabled(){const f=this._optionsService.rawOptions.windowsPty;return f&&f.buildNumber?this._hasScrollback&&f.backend==="conpty"&&f.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(f,p){this._cols!==f&&(f>this._cols?this._reflowLarger(f,p):this._reflowSmaller(f,p))}_reflowLarger(f,p){const S=(0,x.reflowLargerGetLinesToRemove)(this.lines,this._cols,f,this.ybase+this.y,this.getNullCell(b.DEFAULT_ATTR_DATA));if(S.length>0){const A=(0,x.reflowLargerCreateNewLayout)(this.lines,S);(0,x.reflowLargerApplyNewLayout)(this.lines,A.layout),this._reflowLargerAdjustViewport(f,p,A.countRemoved)}}_reflowLargerAdjustViewport(f,p,S){const A=this.getNullCell(b.DEFAULT_ATTR_DATA);let R=S;for(;R-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<p&&this.lines.push(new b.BufferLine(f,A))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-S,0)}_reflowSmaller(f,p){const S=this.getNullCell(b.DEFAULT_ATTR_DATA),A=[];let R=0;for(let M=this.lines.length-1;M>=0;M--){let E=this.lines.get(M);if(!E||!E.isWrapped&&E.getTrimmedLength()<=f)continue;const B=[E];for(;E.isWrapped&&M>0;)E=this.lines.get(--M),B.unshift(E);const $=this.ybase+this.y;if($>=M&&$<M+B.length)continue;const I=B[B.length-1].getTrimmedLength(),q=(0,x.reflowSmallerGetNewLineLengths)(B,this._cols,f),P=q.length-B.length;let Q;Q=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+P):Math.max(0,this.lines.length-this.lines.maxLength+P);const re=[];for(let L=0;L<P;L++){const H=this.getBlankLine(b.DEFAULT_ATTR_DATA,!0);re.push(H)}re.length>0&&(A.push({start:M+B.length+R,newLines:re}),R+=re.length),B.push(...re);let G=q.length-1,V=q[G];V===0&&(G--,V=q[G]);let ee=B.length-P-1,N=I;for(;ee>=0;){const L=Math.min(N,V);if(B[G]===void 0)break;if(B[G].copyCellsFrom(B[ee],N-L,V-L,L,!0),V-=L,V===0&&(G--,V=q[G]),N-=L,N===0){ee--;const H=Math.max(ee,0);N=(0,x.getWrappedLineTrimmedLength)(B,H,this._cols)}}for(let L=0;L<B.length;L++)q[L]<f&&B[L].setCell(q[L],S);let U=P-Q;for(;U-- >0;)this.ybase===0?this.y<p-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+R)-p&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+P,this.ybase+p-1)}if(A.length>0){const M=[],E=[];for(let G=0;G<this.lines.length;G++)E.push(this.lines.get(G));const B=this.lines.length;let $=B-1,I=0,q=A[I];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+R);let P=0;for(let G=Math.min(this.lines.maxLength-1,B+R-1);G>=0;G--)if(q&&q.start>$+P){for(let V=q.newLines.length-1;V>=0;V--)this.lines.set(G--,q.newLines[V]);G++,M.push({index:$+1,amount:q.newLines.length}),P+=q.newLines.length,q=A[++I]}else this.lines.set(G,E[$--]);let Q=0;for(let G=M.length-1;G>=0;G--)M[G].index+=Q,this.lines.onInsertEmitter.fire(M[G]),Q+=M[G].amount;const re=Math.max(0,B+R-this.lines.maxLength);re>0&&this.lines.onTrimEmitter.fire(re)}}translateBufferLineToString(f,p,S=0,A){const R=this.lines.get(f);return R?R.translateToString(p,S,A):""}getWrappedRangeForLine(f){let p=f,S=f;for(;p>0&&this.lines.get(p).isWrapped;)p--;for(;S+1<this.lines.length&&this.lines.get(S+1).isWrapped;)S++;return{first:p,last:S}}setupTabStops(f){for(f!=null?this.tabs[f]||(f=this.prevStop(f)):(this.tabs={},f=0);f<this._cols;f+=this._optionsService.rawOptions.tabStopWidth)this.tabs[f]=!0}prevStop(f){for(f==null&&(f=this.x);!this.tabs[--f]&&f>0;);return f>=this._cols?this._cols-1:f<0?0:f}nextStop(f){for(f==null&&(f=this.x);!this.tabs[++f]&&f<this._cols;);return f>=this._cols?this._cols-1:f<0?0:f}clearMarkers(f){this._isClearing=!0;for(let p=0;p<this.markers.length;p++)this.markers[p].line===f&&(this.markers[p].dispose(),this.markers.splice(p--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let f=0;f<this.markers.length;f++)this.markers[f].dispose(),this.markers.splice(f--,1);this._isClearing=!1}addMarker(f){const p=new _.Marker(f);return this.markers.push(p),p.register(this.lines.onTrim((S=>{p.line-=S,p.line<0&&p.dispose()}))),p.register(this.lines.onInsert((S=>{p.line>=S.index&&(p.line+=S.amount)}))),p.register(this.lines.onDelete((S=>{p.line>=S.index&&p.line<S.index+S.amount&&p.dispose(),p.line>S.index&&(p.line-=S.amount)}))),p.register(p.onDispose((()=>this._removeMarker(p)))),p}_removeMarker(f){this._isClearing||this.markers.splice(this.markers.indexOf(f),1)}}},8437:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLine=l.DEFAULT_ATTR_DATA=void 0;const u=h(3734),y=h(511),m=h(643),b=h(482);l.DEFAULT_ATTR_DATA=Object.freeze(new u.AttributeData);let x=0;class k{constructor(_,v,f=!1){this.isWrapped=f,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*_);const p=v||y.CellData.fromCharData([0,m.NULL_CELL_CHAR,m.NULL_CELL_WIDTH,m.NULL_CELL_CODE]);for(let S=0;S<_;++S)this.setCell(S,p);this.length=_}get(_){const v=this._data[3*_+0],f=2097151&v;return[this._data[3*_+1],2097152&v?this._combined[_]:f?(0,b.stringFromCodePoint)(f):"",v>>22,2097152&v?this._combined[_].charCodeAt(this._combined[_].length-1):f]}set(_,v){this._data[3*_+1]=v[m.CHAR_DATA_ATTR_INDEX],v[m.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[_]=v[1],this._data[3*_+0]=2097152|_|v[m.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*_+0]=v[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|v[m.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(_){return this._data[3*_+0]>>22}hasWidth(_){return 12582912&this._data[3*_+0]}getFg(_){return this._data[3*_+1]}getBg(_){return this._data[3*_+2]}hasContent(_){return 4194303&this._data[3*_+0]}getCodePoint(_){const v=this._data[3*_+0];return 2097152&v?this._combined[_].charCodeAt(this._combined[_].length-1):2097151&v}isCombined(_){return 2097152&this._data[3*_+0]}getString(_){const v=this._data[3*_+0];return 2097152&v?this._combined[_]:2097151&v?(0,b.stringFromCodePoint)(2097151&v):""}isProtected(_){return 536870912&this._data[3*_+2]}loadCell(_,v){return x=3*_,v.content=this._data[x+0],v.fg=this._data[x+1],v.bg=this._data[x+2],2097152&v.content&&(v.combinedData=this._combined[_]),268435456&v.bg&&(v.extended=this._extendedAttrs[_]),v}setCell(_,v){2097152&v.content&&(this._combined[_]=v.combinedData),268435456&v.bg&&(this._extendedAttrs[_]=v.extended),this._data[3*_+0]=v.content,this._data[3*_+1]=v.fg,this._data[3*_+2]=v.bg}setCellFromCodepoint(_,v,f,p){268435456&p.bg&&(this._extendedAttrs[_]=p.extended),this._data[3*_+0]=v|f<<22,this._data[3*_+1]=p.fg,this._data[3*_+2]=p.bg}addCodepointToCell(_,v,f){let p=this._data[3*_+0];2097152&p?this._combined[_]+=(0,b.stringFromCodePoint)(v):2097151&p?(this._combined[_]=(0,b.stringFromCodePoint)(2097151&p)+(0,b.stringFromCodePoint)(v),p&=-2097152,p|=2097152):p=v|4194304,f&&(p&=-12582913,p|=f<<22),this._data[3*_+0]=p}insertCells(_,v,f){if((_%=this.length)&&this.getWidth(_-1)===2&&this.setCellFromCodepoint(_-1,0,1,f),v<this.length-_){const p=new y.CellData;for(let S=this.length-_-v-1;S>=0;--S)this.setCell(_+v+S,this.loadCell(_+S,p));for(let S=0;S<v;++S)this.setCell(_+S,f)}else for(let p=_;p<this.length;++p)this.setCell(p,f);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,f)}deleteCells(_,v,f){if(_%=this.length,v<this.length-_){const p=new y.CellData;for(let S=0;S<this.length-_-v;++S)this.setCell(_+S,this.loadCell(_+v+S,p));for(let S=this.length-v;S<this.length;++S)this.setCell(S,f)}else for(let p=_;p<this.length;++p)this.setCell(p,f);_&&this.getWidth(_-1)===2&&this.setCellFromCodepoint(_-1,0,1,f),this.getWidth(_)!==0||this.hasContent(_)||this.setCellFromCodepoint(_,0,1,f)}replaceCells(_,v,f,p=!1){if(p)for(_&&this.getWidth(_-1)===2&&!this.isProtected(_-1)&&this.setCellFromCodepoint(_-1,0,1,f),v<this.length&&this.getWidth(v-1)===2&&!this.isProtected(v)&&this.setCellFromCodepoint(v,0,1,f);_<v&&_<this.length;)this.isProtected(_)||this.setCell(_,f),_++;else for(_&&this.getWidth(_-1)===2&&this.setCellFromCodepoint(_-1,0,1,f),v<this.length&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v,0,1,f);_<v&&_<this.length;)this.setCell(_++,f)}resize(_,v){if(_===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const f=3*_;if(_>this.length){if(this._data.buffer.byteLength>=4*f)this._data=new Uint32Array(this._data.buffer,0,f);else{const p=new Uint32Array(f);p.set(this._data),this._data=p}for(let p=this.length;p<_;++p)this.setCell(p,v)}else{this._data=this._data.subarray(0,f);const p=Object.keys(this._combined);for(let A=0;A<p.length;A++){const R=parseInt(p[A],10);R>=_&&delete this._combined[R]}const S=Object.keys(this._extendedAttrs);for(let A=0;A<S.length;A++){const R=parseInt(S[A],10);R>=_&&delete this._extendedAttrs[R]}}return this.length=_,4*f*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const _=new Uint32Array(this._data.length);return _.set(this._data),this._data=_,1}return 0}fill(_,v=!1){if(v)for(let f=0;f<this.length;++f)this.isProtected(f)||this.setCell(f,_);else{this._combined={},this._extendedAttrs={};for(let f=0;f<this.length;++f)this.setCell(f,_)}}copyFrom(_){this.length!==_.length?this._data=new Uint32Array(_._data):this._data.set(_._data),this.length=_.length,this._combined={};for(const v in _._combined)this._combined[v]=_._combined[v];this._extendedAttrs={};for(const v in _._extendedAttrs)this._extendedAttrs[v]=_._extendedAttrs[v];this.isWrapped=_.isWrapped}clone(){const _=new k(0);_._data=new Uint32Array(this._data),_.length=this.length;for(const v in this._combined)_._combined[v]=this._combined[v];for(const v in this._extendedAttrs)_._extendedAttrs[v]=this._extendedAttrs[v];return _.isWrapped=this.isWrapped,_}getTrimmedLength(){for(let _=this.length-1;_>=0;--_)if(4194303&this._data[3*_+0])return _+(this._data[3*_+0]>>22);return 0}getNoBgTrimmedLength(){for(let _=this.length-1;_>=0;--_)if(4194303&this._data[3*_+0]||50331648&this._data[3*_+2])return _+(this._data[3*_+0]>>22);return 0}copyCellsFrom(_,v,f,p,S){const A=_._data;if(S)for(let M=p-1;M>=0;M--){for(let E=0;E<3;E++)this._data[3*(f+M)+E]=A[3*(v+M)+E];268435456&A[3*(v+M)+2]&&(this._extendedAttrs[f+M]=_._extendedAttrs[v+M])}else for(let M=0;M<p;M++){for(let E=0;E<3;E++)this._data[3*(f+M)+E]=A[3*(v+M)+E];268435456&A[3*(v+M)+2]&&(this._extendedAttrs[f+M]=_._extendedAttrs[v+M])}const R=Object.keys(_._combined);for(let M=0;M<R.length;M++){const E=parseInt(R[M],10);E>=v&&(this._combined[E-v+f]=_._combined[E])}}translateToString(_,v,f,p){v=v??0,f=f??this.length,_&&(f=Math.min(f,this.getTrimmedLength())),p&&(p.length=0);let S="";for(;v<f;){const A=this._data[3*v+0],R=2097151&A,M=2097152&A?this._combined[v]:R?(0,b.stringFromCodePoint)(R):m.WHITESPACE_CELL_CHAR;if(S+=M,p)for(let E=0;E<M.length;++E)p.push(v);v+=A>>22||1}return p&&p.push(v),S}}l.BufferLine=k},4841:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.getRangeLength=void 0,l.getRangeLength=function(h,u){if(h.start.y>h.end.y)throw new Error(`Buffer range end (${h.end.x}, ${h.end.y}) cannot be before start (${h.start.x}, ${h.start.y})`);return u*(h.end.y-h.start.y)+(h.end.x-h.start.x+1)}},4634:(T,l)=>{function h(u,y,m){if(y===u.length-1)return u[y].getTrimmedLength();const b=!u[y].hasContent(m-1)&&u[y].getWidth(m-1)===1,x=u[y+1].getWidth(0)===2;return b&&x?m-1:m}Object.defineProperty(l,"__esModule",{value:!0}),l.getWrappedLineTrimmedLength=l.reflowSmallerGetNewLineLengths=l.reflowLargerApplyNewLayout=l.reflowLargerCreateNewLayout=l.reflowLargerGetLinesToRemove=void 0,l.reflowLargerGetLinesToRemove=function(u,y,m,b,x){const k=[];for(let C=0;C<u.length-1;C++){let _=C,v=u.get(++_);if(!v.isWrapped)continue;const f=[u.get(C)];for(;_<u.length&&v.isWrapped;)f.push(v),v=u.get(++_);if(b>=C&&b<_){C+=f.length-1;continue}let p=0,S=h(f,p,y),A=1,R=0;for(;A<f.length;){const E=h(f,A,y),B=E-R,$=m-S,I=Math.min(B,$);f[p].copyCellsFrom(f[A],R,S,I,!1),S+=I,S===m&&(p++,S=0),R+=I,R===E&&(A++,R=0),S===0&&p!==0&&f[p-1].getWidth(m-1)===2&&(f[p].copyCellsFrom(f[p-1],m-1,S++,1,!1),f[p-1].setCell(m-1,x))}f[p].replaceCells(S,m,x);let M=0;for(let E=f.length-1;E>0&&(E>p||f[E].getTrimmedLength()===0);E--)M++;M>0&&(k.push(C+f.length-M),k.push(M)),C+=f.length-1}return k},l.reflowLargerCreateNewLayout=function(u,y){const m=[];let b=0,x=y[b],k=0;for(let C=0;C<u.length;C++)if(x===C){const _=y[++b];u.onDeleteEmitter.fire({index:C-k,amount:_}),C+=_-1,k+=_,x=y[++b]}else m.push(C);return{layout:m,countRemoved:k}},l.reflowLargerApplyNewLayout=function(u,y){const m=[];for(let b=0;b<y.length;b++)m.push(u.get(y[b]));for(let b=0;b<m.length;b++)u.set(b,m[b]);u.length=y.length},l.reflowSmallerGetNewLineLengths=function(u,y,m){const b=[],x=u.map(((v,f)=>h(u,f,y))).reduce(((v,f)=>v+f));let k=0,C=0,_=0;for(;_<x;){if(x-_<m){b.push(x-_);break}k+=m;const v=h(u,C,y);k>v&&(k-=v,C++);const f=u[C].getWidth(k-1)===2;f&&k--;const p=f?m-1:m;b.push(p),_+=p}return b},l.getWrappedLineTrimmedLength=h},5295:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferSet=void 0;const u=h(8460),y=h(844),m=h(9092);class b extends y.Disposable{constructor(k,C){super(),this._optionsService=k,this._bufferService=C,this._onBufferActivate=this.register(new u.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 m.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new m.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(k){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(k),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(k,C){this._normal.resize(k,C),this._alt.resize(k,C),this.setupTabStops(k)}setupTabStops(k){this._normal.setupTabStops(k),this._alt.setupTabStops(k)}}l.BufferSet=b},511:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CellData=void 0;const u=h(482),y=h(643),m=h(3734);class b extends m.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new m.ExtendedAttrs,this.combinedData=""}static fromCharData(k){const C=new b;return C.setFromCharData(k),C}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,u.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(k){this.fg=k[y.CHAR_DATA_ATTR_INDEX],this.bg=0;let C=!1;if(k[y.CHAR_DATA_CHAR_INDEX].length>2)C=!0;else if(k[y.CHAR_DATA_CHAR_INDEX].length===2){const _=k[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=_&&_<=56319){const v=k[y.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=v&&v<=57343?this.content=1024*(_-55296)+v-56320+65536|k[y.CHAR_DATA_WIDTH_INDEX]<<22:C=!0}else C=!0}else this.content=k[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|k[y.CHAR_DATA_WIDTH_INDEX]<<22;C&&(this.combinedData=k[y.CHAR_DATA_CHAR_INDEX],this.content=2097152|k[y.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.CellData=b},643:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WHITESPACE_CELL_CODE=l.WHITESPACE_CELL_WIDTH=l.WHITESPACE_CELL_CHAR=l.NULL_CELL_CODE=l.NULL_CELL_WIDTH=l.NULL_CELL_CHAR=l.CHAR_DATA_CODE_INDEX=l.CHAR_DATA_WIDTH_INDEX=l.CHAR_DATA_CHAR_INDEX=l.CHAR_DATA_ATTR_INDEX=l.DEFAULT_EXT=l.DEFAULT_ATTR=l.DEFAULT_COLOR=void 0,l.DEFAULT_COLOR=0,l.DEFAULT_ATTR=256|l.DEFAULT_COLOR<<9,l.DEFAULT_EXT=0,l.CHAR_DATA_ATTR_INDEX=0,l.CHAR_DATA_CHAR_INDEX=1,l.CHAR_DATA_WIDTH_INDEX=2,l.CHAR_DATA_CODE_INDEX=3,l.NULL_CELL_CHAR="",l.NULL_CELL_WIDTH=1,l.NULL_CELL_CODE=0,l.WHITESPACE_CELL_CHAR=" ",l.WHITESPACE_CELL_WIDTH=1,l.WHITESPACE_CELL_CODE=32},4863:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Marker=void 0;const u=h(8460),y=h(844);class m{get id(){return this._id}constructor(x){this.line=x,this.isDisposed=!1,this._disposables=[],this._id=m._nextId++,this._onDispose=this.register(new u.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,y.disposeArray)(this._disposables),this._disposables.length=0)}register(x){return this._disposables.push(x),x}}l.Marker=m,m._nextId=1},7116:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DEFAULT_CHARSET=l.CHARSETS=void 0,l.CHARSETS={},l.DEFAULT_CHARSET=l.CHARSETS.B,l.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:"≥","{":"π","|":"≠","}":"£","~":"·"},l.CHARSETS.A={"#":"£"},l.CHARSETS.B=void 0,l.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},l.CHARSETS.C=l.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},l.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},l.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},l.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},l.CHARSETS.E=l.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},l.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},l.CHARSETS.H=l.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(T,l)=>{var h,u,y;Object.defineProperty(l,"__esModule",{value:!0}),l.C1_ESCAPED=l.C1=l.C0=void 0,(function(m){m.NUL="\0",m.SOH="",m.STX="",m.ETX="",m.EOT="",m.ENQ="",m.ACK="",m.BEL="\x07",m.BS="\b",m.HT=" ",m.LF=`
261
+ `,m.VT="\v",m.FF="\f",m.CR="\r",m.SO="",m.SI="",m.DLE="",m.DC1="",m.DC2="",m.DC3="",m.DC4="",m.NAK="",m.SYN="",m.ETB="",m.CAN="",m.EM="",m.SUB="",m.ESC="\x1B",m.FS="",m.GS="",m.RS="",m.US="",m.SP=" ",m.DEL=""})(h||(l.C0=h={})),(function(m){m.PAD="€",m.HOP="",m.BPH="‚",m.NBH="ƒ",m.IND="„",m.NEL="…",m.SSA="†",m.ESA="‡",m.HTS="ˆ",m.HTJ="‰",m.VTS="Š",m.PLD="‹",m.PLU="Œ",m.RI="",m.SS2="Ž",m.SS3="",m.DCS="",m.PU1="‘",m.PU2="’",m.STS="“",m.CCH="”",m.MW="•",m.SPA="–",m.EPA="—",m.SOS="˜",m.SGCI="™",m.SCI="š",m.CSI="›",m.ST="œ",m.OSC="",m.PM="ž",m.APC="Ÿ"})(u||(l.C1=u={})),(function(m){m.ST=`${h.ESC}\\`})(y||(l.C1_ESCAPED=y={}))},7399:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.evaluateKeyboardEvent=void 0;const u=h(2584),y={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:["'",'"']};l.evaluateKeyboardEvent=function(m,b,x,k){const C={type:0,cancel:!1,key:void 0},_=(m.shiftKey?1:0)|(m.altKey?2:0)|(m.ctrlKey?4:0)|(m.metaKey?8:0);switch(m.keyCode){case 0:m.key==="UIKeyInputUpArrow"?C.key=b?u.C0.ESC+"OA":u.C0.ESC+"[A":m.key==="UIKeyInputLeftArrow"?C.key=b?u.C0.ESC+"OD":u.C0.ESC+"[D":m.key==="UIKeyInputRightArrow"?C.key=b?u.C0.ESC+"OC":u.C0.ESC+"[C":m.key==="UIKeyInputDownArrow"&&(C.key=b?u.C0.ESC+"OB":u.C0.ESC+"[B");break;case 8:C.key=m.ctrlKey?"\b":u.C0.DEL,m.altKey&&(C.key=u.C0.ESC+C.key);break;case 9:if(m.shiftKey){C.key=u.C0.ESC+"[Z";break}C.key=u.C0.HT,C.cancel=!0;break;case 13:C.key=m.altKey?u.C0.ESC+u.C0.CR:u.C0.CR,C.cancel=!0;break;case 27:C.key=u.C0.ESC,m.altKey&&(C.key=u.C0.ESC+u.C0.ESC),C.cancel=!0;break;case 37:if(m.metaKey)break;_?(C.key=u.C0.ESC+"[1;"+(_+1)+"D",C.key===u.C0.ESC+"[1;3D"&&(C.key=u.C0.ESC+(x?"b":"[1;5D"))):C.key=b?u.C0.ESC+"OD":u.C0.ESC+"[D";break;case 39:if(m.metaKey)break;_?(C.key=u.C0.ESC+"[1;"+(_+1)+"C",C.key===u.C0.ESC+"[1;3C"&&(C.key=u.C0.ESC+(x?"f":"[1;5C"))):C.key=b?u.C0.ESC+"OC":u.C0.ESC+"[C";break;case 38:if(m.metaKey)break;_?(C.key=u.C0.ESC+"[1;"+(_+1)+"A",x||C.key!==u.C0.ESC+"[1;3A"||(C.key=u.C0.ESC+"[1;5A")):C.key=b?u.C0.ESC+"OA":u.C0.ESC+"[A";break;case 40:if(m.metaKey)break;_?(C.key=u.C0.ESC+"[1;"+(_+1)+"B",x||C.key!==u.C0.ESC+"[1;3B"||(C.key=u.C0.ESC+"[1;5B")):C.key=b?u.C0.ESC+"OB":u.C0.ESC+"[B";break;case 45:m.shiftKey||m.ctrlKey||(C.key=u.C0.ESC+"[2~");break;case 46:C.key=_?u.C0.ESC+"[3;"+(_+1)+"~":u.C0.ESC+"[3~";break;case 36:C.key=_?u.C0.ESC+"[1;"+(_+1)+"H":b?u.C0.ESC+"OH":u.C0.ESC+"[H";break;case 35:C.key=_?u.C0.ESC+"[1;"+(_+1)+"F":b?u.C0.ESC+"OF":u.C0.ESC+"[F";break;case 33:m.shiftKey?C.type=2:m.ctrlKey?C.key=u.C0.ESC+"[5;"+(_+1)+"~":C.key=u.C0.ESC+"[5~";break;case 34:m.shiftKey?C.type=3:m.ctrlKey?C.key=u.C0.ESC+"[6;"+(_+1)+"~":C.key=u.C0.ESC+"[6~";break;case 112:C.key=_?u.C0.ESC+"[1;"+(_+1)+"P":u.C0.ESC+"OP";break;case 113:C.key=_?u.C0.ESC+"[1;"+(_+1)+"Q":u.C0.ESC+"OQ";break;case 114:C.key=_?u.C0.ESC+"[1;"+(_+1)+"R":u.C0.ESC+"OR";break;case 115:C.key=_?u.C0.ESC+"[1;"+(_+1)+"S":u.C0.ESC+"OS";break;case 116:C.key=_?u.C0.ESC+"[15;"+(_+1)+"~":u.C0.ESC+"[15~";break;case 117:C.key=_?u.C0.ESC+"[17;"+(_+1)+"~":u.C0.ESC+"[17~";break;case 118:C.key=_?u.C0.ESC+"[18;"+(_+1)+"~":u.C0.ESC+"[18~";break;case 119:C.key=_?u.C0.ESC+"[19;"+(_+1)+"~":u.C0.ESC+"[19~";break;case 120:C.key=_?u.C0.ESC+"[20;"+(_+1)+"~":u.C0.ESC+"[20~";break;case 121:C.key=_?u.C0.ESC+"[21;"+(_+1)+"~":u.C0.ESC+"[21~";break;case 122:C.key=_?u.C0.ESC+"[23;"+(_+1)+"~":u.C0.ESC+"[23~";break;case 123:C.key=_?u.C0.ESC+"[24;"+(_+1)+"~":u.C0.ESC+"[24~";break;default:if(!m.ctrlKey||m.shiftKey||m.altKey||m.metaKey)if(x&&!k||!m.altKey||m.metaKey)!x||m.altKey||m.ctrlKey||m.shiftKey||!m.metaKey?m.key&&!m.ctrlKey&&!m.altKey&&!m.metaKey&&m.keyCode>=48&&m.key.length===1?C.key=m.key:m.key&&m.ctrlKey&&(m.key==="_"&&(C.key=u.C0.US),m.key==="@"&&(C.key=u.C0.NUL)):m.keyCode===65&&(C.type=1);else{const v=y[m.keyCode],f=v==null?void 0:v[m.shiftKey?1:0];if(f)C.key=u.C0.ESC+f;else if(m.keyCode>=65&&m.keyCode<=90){const p=m.ctrlKey?m.keyCode-64:m.keyCode+32;let S=String.fromCharCode(p);m.shiftKey&&(S=S.toUpperCase()),C.key=u.C0.ESC+S}else if(m.keyCode===32)C.key=u.C0.ESC+(m.ctrlKey?u.C0.NUL:" ");else if(m.key==="Dead"&&m.code.startsWith("Key")){let p=m.code.slice(3,4);m.shiftKey||(p=p.toLowerCase()),C.key=u.C0.ESC+p,C.cancel=!0}}else m.keyCode>=65&&m.keyCode<=90?C.key=String.fromCharCode(m.keyCode-64):m.keyCode===32?C.key=u.C0.NUL:m.keyCode>=51&&m.keyCode<=55?C.key=String.fromCharCode(m.keyCode-51+27):m.keyCode===56?C.key=u.C0.DEL:m.keyCode===219?C.key=u.C0.ESC:m.keyCode===220?C.key=u.C0.FS:m.keyCode===221&&(C.key=u.C0.GS)}return C}},482:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Utf8ToUtf32=l.StringToUtf32=l.utf32ToString=l.stringFromCodePoint=void 0,l.stringFromCodePoint=function(h){return h>65535?(h-=65536,String.fromCharCode(55296+(h>>10))+String.fromCharCode(h%1024+56320)):String.fromCharCode(h)},l.utf32ToString=function(h,u=0,y=h.length){let m="";for(let b=u;b<y;++b){let x=h[b];x>65535?(x-=65536,m+=String.fromCharCode(55296+(x>>10))+String.fromCharCode(x%1024+56320)):m+=String.fromCharCode(x)}return m},l.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(h,u){const y=h.length;if(!y)return 0;let m=0,b=0;if(this._interim){const x=h.charCodeAt(b++);56320<=x&&x<=57343?u[m++]=1024*(this._interim-55296)+x-56320+65536:(u[m++]=this._interim,u[m++]=x),this._interim=0}for(let x=b;x<y;++x){const k=h.charCodeAt(x);if(55296<=k&&k<=56319){if(++x>=y)return this._interim=k,m;const C=h.charCodeAt(x);56320<=C&&C<=57343?u[m++]=1024*(k-55296)+C-56320+65536:(u[m++]=k,u[m++]=C)}else k!==65279&&(u[m++]=k)}return m}},l.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(h,u){const y=h.length;if(!y)return 0;let m,b,x,k,C=0,_=0,v=0;if(this.interim[0]){let S=!1,A=this.interim[0];A&=(224&A)==192?31:(240&A)==224?15:7;let R,M=0;for(;(R=63&this.interim[++M])&&M<4;)A<<=6,A|=R;const E=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,B=E-M;for(;v<B;){if(v>=y)return 0;if(R=h[v++],(192&R)!=128){v--,S=!0;break}this.interim[M++]=R,A<<=6,A|=63&R}S||(E===2?A<128?v--:u[C++]=A:E===3?A<2048||A>=55296&&A<=57343||A===65279||(u[C++]=A):A<65536||A>1114111||(u[C++]=A)),this.interim.fill(0)}const f=y-4;let p=v;for(;p<y;){for(;!(!(p<f)||128&(m=h[p])||128&(b=h[p+1])||128&(x=h[p+2])||128&(k=h[p+3]));)u[C++]=m,u[C++]=b,u[C++]=x,u[C++]=k,p+=4;if(m=h[p++],m<128)u[C++]=m;else if((224&m)==192){if(p>=y)return this.interim[0]=m,C;if(b=h[p++],(192&b)!=128){p--;continue}if(_=(31&m)<<6|63&b,_<128){p--;continue}u[C++]=_}else if((240&m)==224){if(p>=y)return this.interim[0]=m,C;if(b=h[p++],(192&b)!=128){p--;continue}if(p>=y)return this.interim[0]=m,this.interim[1]=b,C;if(x=h[p++],(192&x)!=128){p--;continue}if(_=(15&m)<<12|(63&b)<<6|63&x,_<2048||_>=55296&&_<=57343||_===65279)continue;u[C++]=_}else if((248&m)==240){if(p>=y)return this.interim[0]=m,C;if(b=h[p++],(192&b)!=128){p--;continue}if(p>=y)return this.interim[0]=m,this.interim[1]=b,C;if(x=h[p++],(192&x)!=128){p--;continue}if(p>=y)return this.interim[0]=m,this.interim[1]=b,this.interim[2]=x,C;if(k=h[p++],(192&k)!=128){p--;continue}if(_=(7&m)<<18|(63&b)<<12|(63&x)<<6|63&k,_<65536||_>1114111)continue;u[C++]=_}}return C}}},225:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeV6=void 0;const u=h(1480),y=[[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]],m=[[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 b;l.UnicodeV6=class{constructor(){if(this.version="6",!b){b=new Uint8Array(65536),b.fill(1),b[0]=0,b.fill(0,1,32),b.fill(0,127,160),b.fill(2,4352,4448),b[9001]=2,b[9002]=2,b.fill(2,11904,42192),b[12351]=1,b.fill(2,44032,55204),b.fill(2,63744,64256),b.fill(2,65040,65050),b.fill(2,65072,65136),b.fill(2,65280,65377),b.fill(2,65504,65511);for(let x=0;x<y.length;++x)b.fill(0,y[x][0],y[x][1]+1)}}wcwidth(x){return x<32?0:x<127?1:x<65536?b[x]:(function(k,C){let _,v=0,f=C.length-1;if(k<C[0][0]||k>C[f][1])return!1;for(;f>=v;)if(_=v+f>>1,k>C[_][1])v=_+1;else{if(!(k<C[_][0]))return!0;f=_-1}return!1})(x,m)?0:x>=131072&&x<=196605||x>=196608&&x<=262141?2:1}charProperties(x,k){let C=this.wcwidth(x),_=C===0&&k!==0;if(_){const v=u.UnicodeService.extractWidth(k);v===0?_=!1:v>C&&(C=v)}return u.UnicodeService.createPropertyValue(0,C,_)}}},5981:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WriteBuffer=void 0;const u=h(8460),y=h(844);class m extends y.Disposable{constructor(x){super(),this._action=x,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(x,k){if(k!==void 0&&this._syncCalls>k)return void(this._syncCalls=0);if(this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let C;for(this._isSyncWriting=!0;C=this._writeBuffer.shift();){this._action(C);const _=this._callbacks.shift();_&&_()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(x,k){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+=x.length,this._writeBuffer.push(x),this._callbacks.push(k),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(k)}_innerWrite(x=0,k=!0){const C=x||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const _=this._writeBuffer[this._bufferOffset],v=this._action(_,k);if(v){const p=S=>Date.now()-C>=12?setTimeout((()=>this._innerWrite(0,S))):this._innerWrite(C,S);return void v.catch((S=>(queueMicrotask((()=>{throw S})),Promise.resolve(!1)))).then(p)}const f=this._callbacks[this._bufferOffset];if(f&&f(),this._bufferOffset++,this._pendingData-=_.length,Date.now()-C>=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()}}l.WriteBuffer=m},5941:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.toRgbString=l.parseColor=void 0;const h=/^([\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})$/,u=/^[\da-f]+$/;function y(m,b){const x=m.toString(16),k=x.length<2?"0"+x:x;switch(b){case 4:return x[0];case 8:return k;case 12:return(k+k).slice(0,3);default:return k+k}}l.parseColor=function(m){if(!m)return;let b=m.toLowerCase();if(b.indexOf("rgb:")===0){b=b.slice(4);const x=h.exec(b);if(x){const k=x[1]?15:x[4]?255:x[7]?4095:65535;return[Math.round(parseInt(x[1]||x[4]||x[7]||x[10],16)/k*255),Math.round(parseInt(x[2]||x[5]||x[8]||x[11],16)/k*255),Math.round(parseInt(x[3]||x[6]||x[9]||x[12],16)/k*255)]}}else if(b.indexOf("#")===0&&(b=b.slice(1),u.exec(b)&&[3,6,9,12].includes(b.length))){const x=b.length/3,k=[0,0,0];for(let C=0;C<3;++C){const _=parseInt(b.slice(x*C,x*C+x),16);k[C]=x===1?_<<4:x===2?_:x===3?_>>4:_>>8}return k}},l.toRgbString=function(m,b=16){const[x,k,C]=m;return`rgb:${y(x,b)}/${y(k,b)}/${y(C,b)}`}},5770:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.PAYLOAD_LIMIT=void 0,l.PAYLOAD_LIMIT=1e7},6351:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DcsHandler=l.DcsParser=void 0;const u=h(482),y=h(8742),m=h(5770),b=[];l.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=b,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=b}registerHandler(k,C){this._handlers[k]===void 0&&(this._handlers[k]=[]);const _=this._handlers[k];return _.push(C),{dispose:()=>{const v=_.indexOf(C);v!==-1&&_.splice(v,1)}}}clearHandler(k){this._handlers[k]&&delete this._handlers[k]}setHandlerFallback(k){this._handlerFb=k}reset(){if(this._active.length)for(let k=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;k>=0;--k)this._active[k].unhook(!1);this._stack.paused=!1,this._active=b,this._ident=0}hook(k,C){if(this.reset(),this._ident=k,this._active=this._handlers[k]||b,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].hook(C);else this._handlerFb(this._ident,"HOOK",C)}put(k,C,_){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(k,C,_);else this._handlerFb(this._ident,"PUT",(0,u.utf32ToString)(k,C,_))}unhook(k,C=!0){if(this._active.length){let _=!1,v=this._active.length-1,f=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,_=C,f=this._stack.fallThrough,this._stack.paused=!1),!f&&_===!1){for(;v>=0&&(_=this._active[v].unhook(k),_!==!0);v--)if(_ instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!1,_;v--}for(;v>=0;v--)if(_=this._active[v].unhook(!1),_ instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!0,_}else this._handlerFb(this._ident,"UNHOOK",k);this._active=b,this._ident=0}};const x=new y.Params;x.addParam(0),l.DcsHandler=class{constructor(k){this._handler=k,this._data="",this._params=x,this._hitLimit=!1}hook(k){this._params=k.length>1||k.params[0]?k.clone():x,this._data="",this._hitLimit=!1}put(k,C,_){this._hitLimit||(this._data+=(0,u.utf32ToString)(k,C,_),this._data.length>m.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(k){let C=!1;if(this._hitLimit)C=!1;else if(k&&(C=this._handler(this._data,this._params),C instanceof Promise))return C.then((_=>(this._params=x,this._data="",this._hitLimit=!1,_)));return this._params=x,this._data="",this._hitLimit=!1,C}}},2015:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.EscapeSequenceParser=l.VT500_TRANSITION_TABLE=l.TransitionTable=void 0;const u=h(844),y=h(8742),m=h(6242),b=h(6351);class x{constructor(v){this.table=new Uint8Array(v)}setDefault(v,f){this.table.fill(v<<4|f)}add(v,f,p,S){this.table[f<<8|v]=p<<4|S}addMany(v,f,p,S){for(let A=0;A<v.length;A++)this.table[f<<8|v[A]]=p<<4|S}}l.TransitionTable=x;const k=160;l.VT500_TRANSITION_TABLE=(function(){const _=new x(4095),v=Array.apply(null,Array(256)).map(((M,E)=>E)),f=(M,E)=>v.slice(M,E),p=f(32,127),S=f(0,24);S.push(25),S.push.apply(S,f(28,32));const A=f(0,14);let R;for(R in _.setDefault(1,0),_.addMany(p,0,2,0),A)_.addMany([24,26,153,154],R,3,0),_.addMany(f(128,144),R,3,0),_.addMany(f(144,152),R,3,0),_.add(156,R,0,0),_.add(27,R,11,1),_.add(157,R,4,8),_.addMany([152,158,159],R,0,7),_.add(155,R,11,3),_.add(144,R,11,9);return _.addMany(S,0,3,0),_.addMany(S,1,3,1),_.add(127,1,0,1),_.addMany(S,8,0,8),_.addMany(S,3,3,3),_.add(127,3,0,3),_.addMany(S,4,3,4),_.add(127,4,0,4),_.addMany(S,6,3,6),_.addMany(S,5,3,5),_.add(127,5,0,5),_.addMany(S,2,3,2),_.add(127,2,0,2),_.add(93,1,4,8),_.addMany(p,8,5,8),_.add(127,8,5,8),_.addMany([156,27,24,26,7],8,6,0),_.addMany(f(28,32),8,0,8),_.addMany([88,94,95],1,0,7),_.addMany(p,7,0,7),_.addMany(S,7,0,7),_.add(156,7,0,0),_.add(127,7,0,7),_.add(91,1,11,3),_.addMany(f(64,127),3,7,0),_.addMany(f(48,60),3,8,4),_.addMany([60,61,62,63],3,9,4),_.addMany(f(48,60),4,8,4),_.addMany(f(64,127),4,7,0),_.addMany([60,61,62,63],4,0,6),_.addMany(f(32,64),6,0,6),_.add(127,6,0,6),_.addMany(f(64,127),6,0,0),_.addMany(f(32,48),3,9,5),_.addMany(f(32,48),5,9,5),_.addMany(f(48,64),5,0,6),_.addMany(f(64,127),5,7,0),_.addMany(f(32,48),4,9,5),_.addMany(f(32,48),1,9,2),_.addMany(f(32,48),2,9,2),_.addMany(f(48,127),2,10,0),_.addMany(f(48,80),1,10,0),_.addMany(f(81,88),1,10,0),_.addMany([89,90,92],1,10,0),_.addMany(f(96,127),1,10,0),_.add(80,1,11,9),_.addMany(S,9,0,9),_.add(127,9,0,9),_.addMany(f(28,32),9,0,9),_.addMany(f(32,48),9,9,12),_.addMany(f(48,60),9,8,10),_.addMany([60,61,62,63],9,9,10),_.addMany(S,11,0,11),_.addMany(f(32,128),11,0,11),_.addMany(f(28,32),11,0,11),_.addMany(S,10,0,10),_.add(127,10,0,10),_.addMany(f(28,32),10,0,10),_.addMany(f(48,60),10,8,10),_.addMany([60,61,62,63],10,0,11),_.addMany(f(32,48),10,9,12),_.addMany(S,12,0,12),_.add(127,12,0,12),_.addMany(f(28,32),12,0,12),_.addMany(f(32,48),12,9,12),_.addMany(f(48,64),12,0,11),_.addMany(f(64,127),12,12,13),_.addMany(f(64,127),10,12,13),_.addMany(f(64,127),9,12,13),_.addMany(S,13,13,13),_.addMany(p,13,13,13),_.add(127,13,0,13),_.addMany([27,156,24,26],13,14,0),_.add(k,0,2,0),_.add(k,8,5,8),_.add(k,6,0,6),_.add(k,11,0,11),_.add(k,13,13,13),_})();class C extends u.Disposable{constructor(v=l.VT500_TRANSITION_TABLE){super(),this._transitions=v,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new y.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(f,p,S)=>{},this._executeHandlerFb=f=>{},this._csiHandlerFb=(f,p)=>{},this._escHandlerFb=f=>{},this._errorHandlerFb=f=>f,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,u.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new m.OscParser),this._dcsParser=this.register(new b.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(v,f=[64,126]){let p=0;if(v.prefix){if(v.prefix.length>1)throw new Error("only one byte as prefix supported");if(p=v.prefix.charCodeAt(0),p&&60>p||p>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(v.intermediates){if(v.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let A=0;A<v.intermediates.length;++A){const R=v.intermediates.charCodeAt(A);if(32>R||R>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");p<<=8,p|=R}}if(v.final.length!==1)throw new Error("final must be a single byte");const S=v.final.charCodeAt(0);if(f[0]>S||S>f[1])throw new Error(`final must be in range ${f[0]} .. ${f[1]}`);return p<<=8,p|=S,p}identToString(v){const f=[];for(;v;)f.push(String.fromCharCode(255&v)),v>>=8;return f.reverse().join("")}setPrintHandler(v){this._printHandler=v}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(v,f){const p=this._identifier(v,[48,126]);this._escHandlers[p]===void 0&&(this._escHandlers[p]=[]);const S=this._escHandlers[p];return S.push(f),{dispose:()=>{const A=S.indexOf(f);A!==-1&&S.splice(A,1)}}}clearEscHandler(v){this._escHandlers[this._identifier(v,[48,126])]&&delete this._escHandlers[this._identifier(v,[48,126])]}setEscHandlerFallback(v){this._escHandlerFb=v}setExecuteHandler(v,f){this._executeHandlers[v.charCodeAt(0)]=f}clearExecuteHandler(v){this._executeHandlers[v.charCodeAt(0)]&&delete this._executeHandlers[v.charCodeAt(0)]}setExecuteHandlerFallback(v){this._executeHandlerFb=v}registerCsiHandler(v,f){const p=this._identifier(v);this._csiHandlers[p]===void 0&&(this._csiHandlers[p]=[]);const S=this._csiHandlers[p];return S.push(f),{dispose:()=>{const A=S.indexOf(f);A!==-1&&S.splice(A,1)}}}clearCsiHandler(v){this._csiHandlers[this._identifier(v)]&&delete this._csiHandlers[this._identifier(v)]}setCsiHandlerFallback(v){this._csiHandlerFb=v}registerDcsHandler(v,f){return this._dcsParser.registerHandler(this._identifier(v),f)}clearDcsHandler(v){this._dcsParser.clearHandler(this._identifier(v))}setDcsHandlerFallback(v){this._dcsParser.setHandlerFallback(v)}registerOscHandler(v,f){return this._oscParser.registerHandler(v,f)}clearOscHandler(v){this._oscParser.clearHandler(v)}setOscHandlerFallback(v){this._oscParser.setHandlerFallback(v)}setErrorHandler(v){this._errorHandler=v}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(v,f,p,S,A){this._parseStack.state=v,this._parseStack.handlers=f,this._parseStack.handlerPos=p,this._parseStack.transition=S,this._parseStack.chunkPos=A}parse(v,f,p){let S,A=0,R=0,M=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,M=this._parseStack.chunkPos+1;else{if(p===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 B=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(p===!1&&B>-1){for(;B>=0&&(S=E[B](this._params),S!==!0);B--)if(S instanceof Promise)return this._parseStack.handlerPos=B,S}this._parseStack.handlers=[];break;case 4:if(p===!1&&B>-1){for(;B>=0&&(S=E[B](),S!==!0);B--)if(S instanceof Promise)return this._parseStack.handlerPos=B,S}this._parseStack.handlers=[];break;case 6:if(A=v[this._parseStack.chunkPos],S=this._dcsParser.unhook(A!==24&&A!==26,p),S)return S;A===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(A=v[this._parseStack.chunkPos],S=this._oscParser.end(A!==24&&A!==26,p),S)return S;A===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,M=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let E=M;E<f;++E){switch(A=v[E],R=this._transitions.table[this.currentState<<8|(A<160?A:k)],R>>4){case 2:for(let P=E+1;;++P){if(P>=f||(A=v[P])<32||A>126&&A<k){this._printHandler(v,E,P),E=P-1;break}if(++P>=f||(A=v[P])<32||A>126&&A<k){this._printHandler(v,E,P),E=P-1;break}if(++P>=f||(A=v[P])<32||A>126&&A<k){this._printHandler(v,E,P),E=P-1;break}if(++P>=f||(A=v[P])<32||A>126&&A<k){this._printHandler(v,E,P),E=P-1;break}}break;case 3:this._executeHandlers[A]?this._executeHandlers[A]():this._executeHandlerFb(A),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:E,code:A,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const B=this._csiHandlers[this._collect<<8|A];let $=B?B.length-1:-1;for(;$>=0&&(S=B[$](this._params),S!==!0);$--)if(S instanceof Promise)return this._preserveStack(3,B,$,R,E),S;$<0&&this._csiHandlerFb(this._collect<<8|A,this._params),this.precedingJoinState=0;break;case 8:do switch(A){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(A-48)}while(++E<f&&(A=v[E])>47&&A<60);E--;break;case 9:this._collect<<=8,this._collect|=A;break;case 10:const I=this._escHandlers[this._collect<<8|A];let q=I?I.length-1:-1;for(;q>=0&&(S=I[q](),S!==!0);q--)if(S instanceof Promise)return this._preserveStack(4,I,q,R,E),S;q<0&&this._escHandlerFb(this._collect<<8|A),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|A,this._params);break;case 13:for(let P=E+1;;++P)if(P>=f||(A=v[P])===24||A===26||A===27||A>127&&A<k){this._dcsParser.put(v,E,P),E=P-1;break}break;case 14:if(S=this._dcsParser.unhook(A!==24&&A!==26),S)return this._preserveStack(6,[],0,R,E),S;A===27&&(R|=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 P=E+1;;P++)if(P>=f||(A=v[P])<32||A>127&&A<k){this._oscParser.put(v,E,P),E=P-1;break}break;case 6:if(S=this._oscParser.end(A!==24&&A!==26),S)return this._preserveStack(5,[],0,R,E),S;A===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&R}}}l.EscapeSequenceParser=C},6242:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OscHandler=l.OscParser=void 0;const u=h(5770),y=h(482),m=[];l.OscParser=class{constructor(){this._state=0,this._active=m,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(b,x){this._handlers[b]===void 0&&(this._handlers[b]=[]);const k=this._handlers[b];return k.push(x),{dispose:()=>{const C=k.indexOf(x);C!==-1&&k.splice(C,1)}}}clearHandler(b){this._handlers[b]&&delete this._handlers[b]}setHandlerFallback(b){this._handlerFb=b}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=m}reset(){if(this._state===2)for(let b=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;b>=0;--b)this._active[b].end(!1);this._stack.paused=!1,this._active=m,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||m,this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].start();else this._handlerFb(this._id,"START")}_put(b,x,k){if(this._active.length)for(let C=this._active.length-1;C>=0;C--)this._active[C].put(b,x,k);else this._handlerFb(this._id,"PUT",(0,y.utf32ToString)(b,x,k))}start(){this.reset(),this._state=1}put(b,x,k){if(this._state!==3){if(this._state===1)for(;x<k;){const C=b[x++];if(C===59){this._state=2,this._start();break}if(C<48||57<C)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+C-48}this._state===2&&k-x>0&&this._put(b,x,k)}}end(b,x=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let k=!1,C=this._active.length-1,_=!1;if(this._stack.paused&&(C=this._stack.loopPosition-1,k=x,_=this._stack.fallThrough,this._stack.paused=!1),!_&&k===!1){for(;C>=0&&(k=this._active[C].end(b),k!==!0);C--)if(k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=C,this._stack.fallThrough=!1,k;C--}for(;C>=0;C--)if(k=this._active[C].end(!1),k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=C,this._stack.fallThrough=!0,k}else this._handlerFb(this._id,"END",b);this._active=m,this._id=-1,this._state=0}}},l.OscHandler=class{constructor(b){this._handler=b,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(b,x,k){this._hitLimit||(this._data+=(0,y.utf32ToString)(b,x,k),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(b){let x=!1;if(this._hitLimit)x=!1;else if(b&&(x=this._handler(this._data),x instanceof Promise))return x.then((k=>(this._data="",this._hitLimit=!1,k)));return this._data="",this._hitLimit=!1,x}}},8742:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Params=void 0;const h=2147483647;class u{static fromArray(m){const b=new u;if(!m.length)return b;for(let x=Array.isArray(m[0])?1:0;x<m.length;++x){const k=m[x];if(Array.isArray(k))for(let C=0;C<k.length;++C)b.addSubParam(k[C]);else b.addParam(k)}return b}constructor(m=32,b=32){if(this.maxLength=m,this.maxSubParamsLength=b,b>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(m),this.length=0,this._subParams=new Int32Array(b),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(m),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const m=new u(this.maxLength,this.maxSubParamsLength);return m.params.set(this.params),m.length=this.length,m._subParams.set(this._subParams),m._subParamsLength=this._subParamsLength,m._subParamsIdx.set(this._subParamsIdx),m._rejectDigits=this._rejectDigits,m._rejectSubDigits=this._rejectSubDigits,m._digitIsSub=this._digitIsSub,m}toArray(){const m=[];for(let b=0;b<this.length;++b){m.push(this.params[b]);const x=this._subParamsIdx[b]>>8,k=255&this._subParamsIdx[b];k-x>0&&m.push(Array.prototype.slice.call(this._subParams,x,k))}return m}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(m){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(m<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=m>h?h:m}}addSubParam(m){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(m<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=m>h?h:m,this._subParamsIdx[this.length-1]++}}hasSubParams(m){return(255&this._subParamsIdx[m])-(this._subParamsIdx[m]>>8)>0}getSubParams(m){const b=this._subParamsIdx[m]>>8,x=255&this._subParamsIdx[m];return x-b>0?this._subParams.subarray(b,x):null}getSubParamsAll(){const m={};for(let b=0;b<this.length;++b){const x=this._subParamsIdx[b]>>8,k=255&this._subParamsIdx[b];k-x>0&&(m[b]=this._subParams.slice(x,k))}return m}addDigit(m){let b;if(this._rejectDigits||!(b=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const x=this._digitIsSub?this._subParams:this.params,k=x[b-1];x[b-1]=~k?Math.min(10*k+m,h):m}}l.Params=u},5741:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.AddonManager=void 0,l.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let h=this._addons.length-1;h>=0;h--)this._addons[h].instance.dispose()}loadAddon(h,u){const y={instance:u,dispose:u.dispose,isDisposed:!1};this._addons.push(y),u.dispose=()=>this._wrappedAddonDispose(y),u.activate(h)}_wrappedAddonDispose(h){if(h.isDisposed)return;let u=-1;for(let y=0;y<this._addons.length;y++)if(this._addons[y]===h){u=y;break}if(u===-1)throw new Error("Could not dispose an addon that has not been loaded");h.isDisposed=!0,h.dispose.apply(h.instance),this._addons.splice(u,1)}}},8771:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferApiView=void 0;const u=h(3785),y=h(511);l.BufferApiView=class{constructor(m,b){this._buffer=m,this.type=b}init(m){return this._buffer=m,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(m){const b=this._buffer.lines.get(m);if(b)return new u.BufferLineApiView(b)}getNullCell(){return new y.CellData}}},3785:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLineApiView=void 0;const u=h(511);l.BufferLineApiView=class{constructor(y){this._line=y}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(y,m){if(!(y<0||y>=this._line.length))return m?(this._line.loadCell(y,m),m):this._line.loadCell(y,new u.CellData)}translateToString(y,m,b){return this._line.translateToString(y,m,b)}}},8285:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferNamespaceApi=void 0;const u=h(8771),y=h(8460),m=h(844);class b extends m.Disposable{constructor(k){super(),this._core=k,this._onBufferChange=this.register(new y.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new u.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new u.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)}}l.BufferNamespaceApi=b},7975:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ParserApi=void 0,l.ParserApi=class{constructor(h){this._core=h}registerCsiHandler(h,u){return this._core.registerCsiHandler(h,(y=>u(y.toArray())))}addCsiHandler(h,u){return this.registerCsiHandler(h,u)}registerDcsHandler(h,u){return this._core.registerDcsHandler(h,((y,m)=>u(y,m.toArray())))}addDcsHandler(h,u){return this.registerDcsHandler(h,u)}registerEscHandler(h,u){return this._core.registerEscHandler(h,u)}addEscHandler(h,u){return this.registerEscHandler(h,u)}registerOscHandler(h,u){return this._core.registerOscHandler(h,u)}addOscHandler(h,u){return this.registerOscHandler(h,u)}}},7090:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeApi=void 0,l.UnicodeApi=class{constructor(h){this._core=h}register(h){this._core.unicodeService.register(h)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(h){this._core.unicodeService.activeVersion=h}}},744:function(T,l,h){var u=this&&this.__decorate||function(_,v,f,p){var S,A=arguments.length,R=A<3?v:p===null?p=Object.getOwnPropertyDescriptor(v,f):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(_,v,f,p);else for(var M=_.length-1;M>=0;M--)(S=_[M])&&(R=(A<3?S(R):A>3?S(v,f,R):S(v,f))||R);return A>3&&R&&Object.defineProperty(v,f,R),R},y=this&&this.__param||function(_,v){return function(f,p){v(f,p,_)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferService=l.MINIMUM_ROWS=l.MINIMUM_COLS=void 0;const m=h(8460),b=h(844),x=h(5295),k=h(2585);l.MINIMUM_COLS=2,l.MINIMUM_ROWS=1;let C=l.BufferService=class extends b.Disposable{get buffer(){return this.buffers.active}constructor(_){super(),this.isUserScrolling=!1,this._onResize=this.register(new m.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new m.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(_.rawOptions.cols||0,l.MINIMUM_COLS),this.rows=Math.max(_.rawOptions.rows||0,l.MINIMUM_ROWS),this.buffers=this.register(new x.BufferSet(_,this))}resize(_,v){this.cols=_,this.rows=v,this.buffers.resize(_,v),this._onResize.fire({cols:_,rows:v})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(_,v=!1){const f=this.buffer;let p;p=this._cachedBlankLine,p&&p.length===this.cols&&p.getFg(0)===_.fg&&p.getBg(0)===_.bg||(p=f.getBlankLine(_,v),this._cachedBlankLine=p),p.isWrapped=v;const S=f.ybase+f.scrollTop,A=f.ybase+f.scrollBottom;if(f.scrollTop===0){const R=f.lines.isFull;A===f.lines.length-1?R?f.lines.recycle().copyFrom(p):f.lines.push(p.clone()):f.lines.splice(A+1,0,p.clone()),R?this.isUserScrolling&&(f.ydisp=Math.max(f.ydisp-1,0)):(f.ybase++,this.isUserScrolling||f.ydisp++)}else{const R=A-S+1;f.lines.shiftElements(S+1,R-1,-1),f.lines.set(A,p.clone())}this.isUserScrolling||(f.ydisp=f.ybase),this._onScroll.fire(f.ydisp)}scrollLines(_,v,f){const p=this.buffer;if(_<0){if(p.ydisp===0)return;this.isUserScrolling=!0}else _+p.ydisp>=p.ybase&&(this.isUserScrolling=!1);const S=p.ydisp;p.ydisp=Math.max(Math.min(p.ydisp+_,p.ybase),0),S!==p.ydisp&&(v||this._onScroll.fire(p.ydisp))}};l.BufferService=C=u([y(0,k.IOptionsService)],C)},7994:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CharsetService=void 0,l.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(h){this.glevel=h,this.charset=this._charsets[h]}setgCharset(h,u){this._charsets[h]=u,this.glevel===h&&(this.charset=u)}}},1753:function(T,l,h){var u=this&&this.__decorate||function(p,S,A,R){var M,E=arguments.length,B=E<3?S:R===null?R=Object.getOwnPropertyDescriptor(S,A):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(p,S,A,R);else for(var $=p.length-1;$>=0;$--)(M=p[$])&&(B=(E<3?M(B):E>3?M(S,A,B):M(S,A))||B);return E>3&&B&&Object.defineProperty(S,A,B),B},y=this&&this.__param||function(p,S){return function(A,R){S(A,R,p)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreMouseService=void 0;const m=h(2585),b=h(8460),x=h(844),k={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:p=>p.button!==4&&p.action===1&&(p.ctrl=!1,p.alt=!1,p.shift=!1,!0)},VT200:{events:19,restrict:p=>p.action!==32},DRAG:{events:23,restrict:p=>p.action!==32||p.button!==3},ANY:{events:31,restrict:p=>!0}};function C(p,S){let A=(p.ctrl?16:0)|(p.shift?4:0)|(p.alt?8:0);return p.button===4?(A|=64,A|=p.action):(A|=3&p.button,4&p.button&&(A|=64),8&p.button&&(A|=128),p.action===32?A|=32:p.action!==0||S||(A|=3)),A}const _=String.fromCharCode,v={DEFAULT:p=>{const S=[C(p,!1)+32,p.col+32,p.row+32];return S[0]>255||S[1]>255||S[2]>255?"":`\x1B[M${_(S[0])}${_(S[1])}${_(S[2])}`},SGR:p=>{const S=p.action===0&&p.button!==4?"m":"M";return`\x1B[<${C(p,!0)};${p.col};${p.row}${S}`},SGR_PIXELS:p=>{const S=p.action===0&&p.button!==4?"m":"M";return`\x1B[<${C(p,!0)};${p.x};${p.y}${S}`}};let f=l.CoreMouseService=class extends x.Disposable{constructor(p,S){super(),this._bufferService=p,this._coreService=S,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new b.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const A of Object.keys(k))this.addProtocol(A,k[A]);for(const A of Object.keys(v))this.addEncoding(A,v[A]);this.reset()}addProtocol(p,S){this._protocols[p]=S}addEncoding(p,S){this._encodings[p]=S}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(p){if(!this._protocols[p])throw new Error(`unknown protocol "${p}"`);this._activeProtocol=p,this._onProtocolChange.fire(this._protocols[p].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(p){if(!this._encodings[p])throw new Error(`unknown encoding "${p}"`);this._activeEncoding=p}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(p){if(p.col<0||p.col>=this._bufferService.cols||p.row<0||p.row>=this._bufferService.rows||p.button===4&&p.action===32||p.button===3&&p.action!==32||p.button!==4&&(p.action===2||p.action===3)||(p.col++,p.row++,p.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,p,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(p))return!1;const S=this._encodings[this._activeEncoding](p);return S&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(S):this._coreService.triggerDataEvent(S,!0)),this._lastEvent=p,!0}explainEvents(p){return{down:!!(1&p),up:!!(2&p),drag:!!(4&p),move:!!(8&p),wheel:!!(16&p)}}_equalEvents(p,S,A){if(A){if(p.x!==S.x||p.y!==S.y)return!1}else if(p.col!==S.col||p.row!==S.row)return!1;return p.button===S.button&&p.action===S.action&&p.ctrl===S.ctrl&&p.alt===S.alt&&p.shift===S.shift}};l.CoreMouseService=f=u([y(0,m.IBufferService),y(1,m.ICoreService)],f)},6975:function(T,l,h){var u=this&&this.__decorate||function(f,p,S,A){var R,M=arguments.length,E=M<3?p:A===null?A=Object.getOwnPropertyDescriptor(p,S):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(f,p,S,A);else for(var B=f.length-1;B>=0;B--)(R=f[B])&&(E=(M<3?R(E):M>3?R(p,S,E):R(p,S))||E);return M>3&&E&&Object.defineProperty(p,S,E),E},y=this&&this.__param||function(f,p){return function(S,A){p(S,A,f)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreService=void 0;const m=h(1439),b=h(8460),x=h(844),k=h(2585),C=Object.freeze({insertMode:!1}),_=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let v=l.CoreService=class extends x.Disposable{constructor(f,p,S){super(),this._bufferService=f,this._logService=p,this._optionsService=S,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new b.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new b.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new b.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new b.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,m.clone)(C),this.decPrivateModes=(0,m.clone)(_)}reset(){this.modes=(0,m.clone)(C),this.decPrivateModes=(0,m.clone)(_)}triggerDataEvent(f,p=!1){if(this._optionsService.rawOptions.disableStdin)return;const S=this._bufferService.buffer;p&&this._optionsService.rawOptions.scrollOnUserInput&&S.ybase!==S.ydisp&&this._onRequestScrollToBottom.fire(),p&&this._onUserInput.fire(),this._logService.debug(`sending data "${f}"`,(()=>f.split("").map((A=>A.charCodeAt(0))))),this._onData.fire(f)}triggerBinaryEvent(f){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${f}"`,(()=>f.split("").map((p=>p.charCodeAt(0))))),this._onBinary.fire(f))}};l.CoreService=v=u([y(0,k.IBufferService),y(1,k.ILogService),y(2,k.IOptionsService)],v)},9074:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DecorationService=void 0;const u=h(8055),y=h(8460),m=h(844),b=h(6106);let x=0,k=0;class C extends m.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new b.SortedList((f=>f==null?void 0:f.marker.line)),this._onDecorationRegistered=this.register(new y.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new y.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,m.toDisposable)((()=>this.reset())))}registerDecoration(f){if(f.marker.isDisposed)return;const p=new _(f);if(p){const S=p.marker.onDispose((()=>p.dispose()));p.onDispose((()=>{p&&(this._decorations.delete(p)&&this._onDecorationRemoved.fire(p),S.dispose())})),this._decorations.insert(p),this._onDecorationRegistered.fire(p)}return p}reset(){for(const f of this._decorations.values())f.dispose();this._decorations.clear()}*getDecorationsAtCell(f,p,S){let A=0,R=0;for(const M of this._decorations.getKeyIterator(p))A=M.options.x??0,R=A+(M.options.width??1),f>=A&&f<R&&(!S||(M.options.layer??"bottom")===S)&&(yield M)}forEachDecorationAtCell(f,p,S,A){this._decorations.forEachByKey(p,(R=>{x=R.options.x??0,k=x+(R.options.width??1),f>=x&&f<k&&(!S||(R.options.layer??"bottom")===S)&&A(R)}))}}l.DecorationService=C;class _ extends m.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=u.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=u.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(f){super(),this.options=f,this.onRenderEmitter=this.register(new y.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new y.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=f.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.InstantiationService=l.ServiceCollection=void 0;const u=h(2585),y=h(8343);class m{constructor(...x){this._entries=new Map;for(const[k,C]of x)this.set(k,C)}set(x,k){const C=this._entries.get(x);return this._entries.set(x,k),C}forEach(x){for(const[k,C]of this._entries.entries())x(k,C)}has(x){return this._entries.has(x)}get(x){return this._entries.get(x)}}l.ServiceCollection=m,l.InstantiationService=class{constructor(){this._services=new m,this._services.set(u.IInstantiationService,this)}setService(b,x){this._services.set(b,x)}getService(b){return this._services.get(b)}createInstance(b,...x){const k=(0,y.getServiceDependencies)(b).sort(((v,f)=>v.index-f.index)),C=[];for(const v of k){const f=this._services.get(v.id);if(!f)throw new Error(`[createInstance] ${b.name} depends on UNKNOWN service ${v.id}.`);C.push(f)}const _=k.length>0?k[0].index:x.length;if(x.length!==_)throw new Error(`[createInstance] First service dependency of ${b.name} at position ${_+1} conflicts with ${x.length} static arguments`);return new b(...x,...C)}}},7866:function(T,l,h){var u=this&&this.__decorate||function(_,v,f,p){var S,A=arguments.length,R=A<3?v:p===null?p=Object.getOwnPropertyDescriptor(v,f):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(_,v,f,p);else for(var M=_.length-1;M>=0;M--)(S=_[M])&&(R=(A<3?S(R):A>3?S(v,f,R):S(v,f))||R);return A>3&&R&&Object.defineProperty(v,f,R),R},y=this&&this.__param||function(_,v){return function(f,p){v(f,p,_)}};Object.defineProperty(l,"__esModule",{value:!0}),l.traceCall=l.setTraceLogger=l.LogService=void 0;const m=h(844),b=h(2585),x={trace:b.LogLevelEnum.TRACE,debug:b.LogLevelEnum.DEBUG,info:b.LogLevelEnum.INFO,warn:b.LogLevelEnum.WARN,error:b.LogLevelEnum.ERROR,off:b.LogLevelEnum.OFF};let k,C=l.LogService=class extends m.Disposable{get logLevel(){return this._logLevel}constructor(_){super(),this._optionsService=_,this._logLevel=b.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),k=this}_updateLogLevel(){this._logLevel=x[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(_){for(let v=0;v<_.length;v++)typeof _[v]=="function"&&(_[v]=_[v]())}_log(_,v,f){this._evalLazyOptionalParams(f),_.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+v,...f)}trace(_,...v){var f;this._logLevel<=b.LogLevelEnum.TRACE&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.trace.bind(this._optionsService.options.logger))??console.log,_,v)}debug(_,...v){var f;this._logLevel<=b.LogLevelEnum.DEBUG&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.debug.bind(this._optionsService.options.logger))??console.log,_,v)}info(_,...v){var f;this._logLevel<=b.LogLevelEnum.INFO&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.info.bind(this._optionsService.options.logger))??console.info,_,v)}warn(_,...v){var f;this._logLevel<=b.LogLevelEnum.WARN&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.warn.bind(this._optionsService.options.logger))??console.warn,_,v)}error(_,...v){var f;this._logLevel<=b.LogLevelEnum.ERROR&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.error.bind(this._optionsService.options.logger))??console.error,_,v)}};l.LogService=C=u([y(0,b.IOptionsService)],C),l.setTraceLogger=function(_){k=_},l.traceCall=function(_,v,f){if(typeof f.value!="function")throw new Error("not supported");const p=f.value;f.value=function(...S){if(k.logLevel!==b.LogLevelEnum.TRACE)return p.apply(this,S);k.trace(`GlyphRenderer#${p.name}(${S.map((R=>JSON.stringify(R))).join(", ")})`);const A=p.apply(this,S);return k.trace(`GlyphRenderer#${p.name} return`,A),A}}},7302:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OptionsService=l.DEFAULT_OPTIONS=void 0;const u=h(8460),y=h(844),m=h(6114);l.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:m.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const b=["normal","bold","100","200","300","400","500","600","700","800","900"];class x extends y.Disposable{constructor(C){super(),this._onOptionChange=this.register(new u.EventEmitter),this.onOptionChange=this._onOptionChange.event;const _={...l.DEFAULT_OPTIONS};for(const v in C)if(v in _)try{const f=C[v];_[v]=this._sanitizeAndValidateOption(v,f)}catch(f){console.error(f)}this.rawOptions=_,this.options={..._},this._setupOptions(),this.register((0,y.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(C,_){return this.onOptionChange((v=>{v===C&&_(this.rawOptions[C])}))}onMultipleOptionChange(C,_){return this.onOptionChange((v=>{C.indexOf(v)!==-1&&_()}))}_setupOptions(){const C=v=>{if(!(v in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);return this.rawOptions[v]},_=(v,f)=>{if(!(v in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);f=this._sanitizeAndValidateOption(v,f),this.rawOptions[v]!==f&&(this.rawOptions[v]=f,this._onOptionChange.fire(v))};for(const v in this.rawOptions){const f={get:C.bind(this,v),set:_.bind(this,v)};Object.defineProperty(this.options,v,f)}}_sanitizeAndValidateOption(C,_){switch(C){case"cursorStyle":if(_||(_=l.DEFAULT_OPTIONS[C]),!(function(v){return v==="block"||v==="underline"||v==="bar"})(_))throw new Error(`"${_}" is not a valid value for ${C}`);break;case"wordSeparator":_||(_=l.DEFAULT_OPTIONS[C]);break;case"fontWeight":case"fontWeightBold":if(typeof _=="number"&&1<=_&&_<=1e3)break;_=b.includes(_)?_:l.DEFAULT_OPTIONS[C];break;case"cursorWidth":_=Math.floor(_);case"lineHeight":case"tabStopWidth":if(_<1)throw new Error(`${C} cannot be less than 1, value: ${_}`);break;case"minimumContrastRatio":_=Math.max(1,Math.min(21,Math.round(10*_)/10));break;case"scrollback":if((_=Math.min(_,4294967295))<0)throw new Error(`${C} cannot be less than 0, value: ${_}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(_<=0)throw new Error(`${C} cannot be less than or equal to 0, value: ${_}`);break;case"rows":case"cols":if(!_&&_!==0)throw new Error(`${C} must be numeric, value: ${_}`);break;case"windowsPty":_=_??{}}return _}}l.OptionsService=x},2660:function(T,l,h){var u=this&&this.__decorate||function(x,k,C,_){var v,f=arguments.length,p=f<3?k:_===null?_=Object.getOwnPropertyDescriptor(k,C):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(x,k,C,_);else for(var S=x.length-1;S>=0;S--)(v=x[S])&&(p=(f<3?v(p):f>3?v(k,C,p):v(k,C))||p);return f>3&&p&&Object.defineProperty(k,C,p),p},y=this&&this.__param||function(x,k){return function(C,_){k(C,_,x)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkService=void 0;const m=h(2585);let b=l.OscLinkService=class{constructor(x){this._bufferService=x,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(x){const k=this._bufferService.buffer;if(x.id===void 0){const S=k.addMarker(k.ybase+k.y),A={data:x,id:this._nextId++,lines:[S]};return S.onDispose((()=>this._removeMarkerFromLink(A,S))),this._dataByLinkId.set(A.id,A),A.id}const C=x,_=this._getEntryIdKey(C),v=this._entriesWithId.get(_);if(v)return this.addLineToLink(v.id,k.ybase+k.y),v.id;const f=k.addMarker(k.ybase+k.y),p={id:this._nextId++,key:this._getEntryIdKey(C),data:C,lines:[f]};return f.onDispose((()=>this._removeMarkerFromLink(p,f))),this._entriesWithId.set(p.key,p),this._dataByLinkId.set(p.id,p),p.id}addLineToLink(x,k){const C=this._dataByLinkId.get(x);if(C&&C.lines.every((_=>_.line!==k))){const _=this._bufferService.buffer.addMarker(k);C.lines.push(_),_.onDispose((()=>this._removeMarkerFromLink(C,_)))}}getLinkData(x){var k;return(k=this._dataByLinkId.get(x))==null?void 0:k.data}_getEntryIdKey(x){return`${x.id};;${x.uri}`}_removeMarkerFromLink(x,k){const C=x.lines.indexOf(k);C!==-1&&(x.lines.splice(C,1),x.lines.length===0&&(x.data.id!==void 0&&this._entriesWithId.delete(x.key),this._dataByLinkId.delete(x.id)))}};l.OscLinkService=b=u([y(0,m.IBufferService)],b)},8343:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createDecorator=l.getServiceDependencies=l.serviceRegistry=void 0;const h="di$target",u="di$dependencies";l.serviceRegistry=new Map,l.getServiceDependencies=function(y){return y[u]||[]},l.createDecorator=function(y){if(l.serviceRegistry.has(y))return l.serviceRegistry.get(y);const m=function(b,x,k){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(C,_,v){_[h]===_?_[u].push({id:C,index:v}):(_[u]=[{id:C,index:v}],_[h]=_)})(m,b,k)};return m.toString=()=>y,l.serviceRegistry.set(y,m),m}},2585:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.IDecorationService=l.IUnicodeService=l.IOscLinkService=l.IOptionsService=l.ILogService=l.LogLevelEnum=l.IInstantiationService=l.ICharsetService=l.ICoreService=l.ICoreMouseService=l.IBufferService=void 0;const u=h(8343);var y;l.IBufferService=(0,u.createDecorator)("BufferService"),l.ICoreMouseService=(0,u.createDecorator)("CoreMouseService"),l.ICoreService=(0,u.createDecorator)("CoreService"),l.ICharsetService=(0,u.createDecorator)("CharsetService"),l.IInstantiationService=(0,u.createDecorator)("InstantiationService"),(function(m){m[m.TRACE=0]="TRACE",m[m.DEBUG=1]="DEBUG",m[m.INFO=2]="INFO",m[m.WARN=3]="WARN",m[m.ERROR=4]="ERROR",m[m.OFF=5]="OFF"})(y||(l.LogLevelEnum=y={})),l.ILogService=(0,u.createDecorator)("LogService"),l.IOptionsService=(0,u.createDecorator)("OptionsService"),l.IOscLinkService=(0,u.createDecorator)("OscLinkService"),l.IUnicodeService=(0,u.createDecorator)("UnicodeService"),l.IDecorationService=(0,u.createDecorator)("DecorationService")},1480:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeService=void 0;const u=h(8460),y=h(225);class m{static extractShouldJoin(x){return(1&x)!=0}static extractWidth(x){return x>>1&3}static extractCharKind(x){return x>>3}static createPropertyValue(x,k,C=!1){return(16777215&x)<<3|(3&k)<<1|(C?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new u.EventEmitter,this.onChange=this._onChange.event;const x=new y.UnicodeV6;this.register(x),this._active=x.version,this._activeProvider=x}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(x){if(!this._providers[x])throw new Error(`unknown Unicode version "${x}"`);this._active=x,this._activeProvider=this._providers[x],this._onChange.fire(x)}register(x){this._providers[x.version]=x}wcwidth(x){return this._activeProvider.wcwidth(x)}getStringCellWidth(x){let k=0,C=0;const _=x.length;for(let v=0;v<_;++v){let f=x.charCodeAt(v);if(55296<=f&&f<=56319){if(++v>=_)return k+this.wcwidth(f);const A=x.charCodeAt(v);56320<=A&&A<=57343?f=1024*(f-55296)+A-56320+65536:k+=this.wcwidth(A)}const p=this.charProperties(f,C);let S=m.extractWidth(p);m.extractShouldJoin(p)&&(S-=m.extractWidth(C)),k+=S,C=p}return k}charProperties(x,k){return this._activeProvider.charProperties(x,k)}}l.UnicodeService=m}},o={};function g(T){var l=o[T];if(l!==void 0)return l.exports;var h=o[T]={exports:{}};return a[T].call(h.exports,h,h.exports,g),h.exports}var w={};return(()=>{var T=w;Object.defineProperty(T,"__esModule",{value:!0}),T.Terminal=void 0;const l=g(9042),h=g(3236),u=g(844),y=g(5741),m=g(8285),b=g(7975),x=g(7090),k=["cols","rows"];class C extends u.Disposable{constructor(v){super(),this._core=this.register(new h.Terminal(v)),this._addonManager=this.register(new y.AddonManager),this._publicOptions={...this._core.options};const f=S=>this._core.options[S],p=(S,A)=>{this._checkReadonlyOptions(S),this._core.options[S]=A};for(const S in this._core.options){const A={get:f.bind(this,S),set:p.bind(this,S)};Object.defineProperty(this._publicOptions,S,A)}}_checkReadonlyOptions(v){if(k.includes(v))throw new Error(`Option "${v}" 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 b.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new x.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 m.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const v=this._core.coreService.decPrivateModes;let f="none";switch(this._core.coreMouseService.activeProtocol){case"X10":f="x10";break;case"VT200":f="vt200";break;case"DRAG":f="drag";break;case"ANY":f="any"}return{applicationCursorKeysMode:v.applicationCursorKeys,applicationKeypadMode:v.applicationKeypad,bracketedPasteMode:v.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:f,originMode:v.origin,reverseWraparoundMode:v.reverseWraparound,sendFocusMode:v.sendFocus,wraparoundMode:v.wraparound}}get options(){return this._publicOptions}set options(v){for(const f in v)this._publicOptions[f]=v[f]}blur(){this._core.blur()}focus(){this._core.focus()}input(v,f=!0){this._core.input(v,f)}resize(v,f){this._verifyIntegers(v,f),this._core.resize(v,f)}open(v){this._core.open(v)}attachCustomKeyEventHandler(v){this._core.attachCustomKeyEventHandler(v)}attachCustomWheelEventHandler(v){this._core.attachCustomWheelEventHandler(v)}registerLinkProvider(v){return this._core.registerLinkProvider(v)}registerCharacterJoiner(v){return this._checkProposedApi(),this._core.registerCharacterJoiner(v)}deregisterCharacterJoiner(v){this._checkProposedApi(),this._core.deregisterCharacterJoiner(v)}registerMarker(v=0){return this._verifyIntegers(v),this._core.registerMarker(v)}registerDecoration(v){return this._checkProposedApi(),this._verifyPositiveIntegers(v.x??0,v.width??0,v.height??0),this._core.registerDecoration(v)}hasSelection(){return this._core.hasSelection()}select(v,f,p){this._verifyIntegers(v,f,p),this._core.select(v,f,p)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(v,f){this._verifyIntegers(v,f),this._core.selectLines(v,f)}dispose(){super.dispose()}scrollLines(v){this._verifyIntegers(v),this._core.scrollLines(v)}scrollPages(v){this._verifyIntegers(v),this._core.scrollPages(v)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(v){this._verifyIntegers(v),this._core.scrollToLine(v)}clear(){this._core.clear()}write(v,f){this._core.write(v,f)}writeln(v,f){this._core.write(v),this._core.write(`\r
262
+ `,f)}paste(v){this._core.paste(v)}refresh(v,f){this._verifyIntegers(v,f),this._core.refresh(v,f)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(v){this._addonManager.loadAddon(this,v)}static get strings(){return l}_verifyIntegers(...v){for(const f of v)if(f===1/0||isNaN(f)||f%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...v){for(const f of v)if(f&&(f===1/0||isNaN(f)||f%1!=0||f<0))throw new Error("This API only accepts positive integers")}}T.Terminal=C})(),w})()))})(Yu)),Yu.exports}var F2=$2(),Ku={exports:{}},op;function Z2(){return op||(op=1,(function(i,s){(function(a,o){i.exports=o()})(self,(()=>(()=>{var a={};return(()=>{var o=a;Object.defineProperty(o,"__esModule",{value:!0}),o.FitAddon=void 0,o.FitAddon=class{activate(g){this._terminal=g}dispose(){}fit(){const g=this.proposeDimensions();if(!g||!this._terminal||isNaN(g.cols)||isNaN(g.rows))return;const w=this._terminal._core;this._terminal.rows===g.rows&&this._terminal.cols===g.cols||(w._renderService.clear(),this._terminal.resize(g.cols,g.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const g=this._terminal._core,w=g._renderService.dimensions;if(w.css.cell.width===0||w.css.cell.height===0)return;const T=this._terminal.options.scrollback===0?0:g.viewport.scrollBarWidth,l=window.getComputedStyle(this._terminal.element.parentElement),h=parseInt(l.getPropertyValue("height")),u=Math.max(0,parseInt(l.getPropertyValue("width"))),y=window.getComputedStyle(this._terminal.element),m=h-(parseInt(y.getPropertyValue("padding-top"))+parseInt(y.getPropertyValue("padding-bottom"))),b=u-(parseInt(y.getPropertyValue("padding-right"))+parseInt(y.getPropertyValue("padding-left")))-T;return{cols:Math.max(2,Math.floor(b/w.css.cell.width)),rows:Math.max(1,Math.floor(m/w.css.cell.height))}}}})(),a})()))})(Ku)),Ku.exports}var q2=Z2();const G2=3e4,W2=300*1e3;class Y2{constructor(s,a,o){Et(this,"ws",null);Et(this,"consecutiveFailures",0);Et(this,"failStartTime",null);Et(this,"destroyed",!1);Et(this,"reconnectTimer",null);Et(this,"url");Et(this,"authToken");Et(this,"callbacks");this.url=s,this.authToken=o,this.callbacks=a,this.connect()}connect(){if(!this.destroyed){try{this.ws=new WebSocket(this.url)}catch{this.scheduleReconnect();return}this.ws.onopen=()=>{var s,a,o;this.destroyed||(this.consecutiveFailures=0,this.failStartTime=null,this.authToken&&((s=this.ws)==null?void 0:s.readyState)===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"auth",token:this.authToken})),(o=(a=this.callbacks).onOpen)==null||o.call(a))},this.ws.onmessage=s=>{if(!this.destroyed)try{this.callbacks.onMessage(JSON.parse(s.data))}catch{}},this.ws.onclose=()=>{this.destroyed||(this.ws=null,this.scheduleReconnect())},this.ws.onerror=()=>{this.destroyed}}}scheduleReconnect(){var a,o,g,w,T,l;if(this.destroyed)return;if(this.failStartTime===null&&(this.failStartTime=Date.now()),Date.now()-this.failStartTime>=W2){(o=(a=this.callbacks).onGiveUp)==null||o.call(a),(w=(g=this.callbacks).onClose)==null||w.call(g);return}this.consecutiveFailures++;const s=Math.min(G2,1e3*Math.pow(2,this.consecutiveFailures-1));(l=(T=this.callbacks).onReconnecting)==null||l.call(T,this.consecutiveFailures,s),this.reconnectTimer=setTimeout(()=>this.connect(),s)}send(s){var a;((a=this.ws)==null?void 0:a.readyState)===WebSocket.OPEN&&this.ws.send(JSON.stringify(s))}close(){var s;this.destroyed=!0,this.reconnectTimer&&clearTimeout(this.reconnectTimer),(s=this.ws)==null||s.close(),this.ws=null}}function K2({sessionId:i,status:s}){const a=ft(_=>_.token),o=F.useRef(null),g=F.useRef(null),w=F.useRef(null),T=F.useRef(null),l=F.useRef(s),h=F.useRef("");F.useEffect(()=>{l.current=s},[s]);const[u,y]=F.useState("connecting"),[m,b]=F.useState(null),x=F.useCallback(()=>{const _=window.location.origin,v=`/v1/sessions/${encodeURIComponent(i)}/terminal`;return`${_.replace(/^http/,"ws")}${v}`},[i]);F.useEffect(()=>{if(!o.current)return;const _=new F2.Terminal({cursorBlink:!0,fontSize:13,fontFamily:'"JetBrains Mono", "Fira Code", "Cascadia Code", Consolas, monospace',theme:{background:"#000000",foreground:"#00ff88",cursor:"#00ff88",cursorAccent:"#000000",selectionBackground:"#00e5ff40"},convertEol:!0,scrollback:1e3}),v=new q2.FitAddon;_.loadAddon(v),_.open(o.current),v.fit(),g.current=_,w.current=v;const f=new ResizeObserver(()=>{var A;v.fit();const{cols:p,rows:S}=_;(A=T.current)==null||A.send({type:"resize",cols:p,rows:S})});return f.observe(o.current),()=>{f.disconnect(),_.dispose(),g.current=null,w.current=null}},[]),F.useEffect(()=>{const _=x(),v=new Y2(_,{onMessage:f=>{const p=f,S=g.current;if(S)switch(p.type){case"pane":{const A=h.current,R=p.content;A&&R.startsWith(A)?S.write(R.slice(A.length)):(S.reset(),S.write(R)),h.current=R,b(null);break}case"status":break;case"error":b(p.message);break}},onOpen:()=>{var p;y("connected"),b(null);const f=g.current;w.current&&f&&((p=T.current)==null||p.send({type:"resize",cols:f.cols,rows:f.rows}))},onReconnecting:()=>{y("reconnecting")},onGiveUp:()=>{y("disconnected")},onClose:()=>{y("disconnected")}},a??void 0);return T.current=v,()=>{T.current=null,v.close()}},[x,a]),F.useEffect(()=>{const _=g.current;if(!_)return;const v=_.onData(f=>{var p;(p=T.current)==null||p.send({type:"input",text:f})});return()=>{v.dispose()}},[]);const k=s==="working",C=u==="connected";return O.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg overflow-hidden",children:[O.jsxs("div",{className:"flex items-center justify-between px-4 py-2 text-xs border-b border-[#1a1a2e]",children:[O.jsx("div",{className:"flex items-center gap-2",children:O.jsx("span",{className:"font-mono text-[#888]",children:"Terminal"})}),O.jsxs("div",{className:"flex items-center gap-3",children:[O.jsxs("div",{className:"flex items-center gap-1.5",children:[O.jsx("span",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:C?"#00e5ff":u==="reconnecting"?"#ffaa00":"#666",boxShadow:C?"0 0 4px #00e5ff40":"none",animation:u==="reconnecting"?"pulse 1s ease-in-out infinite":"none"}}),O.jsx("span",{className:"text-[10px] text-[#555] uppercase",children:u==="connecting"?"connecting…":u==="reconnecting"?"reconnecting…":u==="connected"?"ws live":"disconnected"})]}),O.jsxs("div",{className:"flex items-center gap-1.5",children:[O.jsx("span",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:k?"#00ff88":"#888",boxShadow:k?"0 0 4px #00ff88":"none"}}),O.jsx("span",{className:"text-[10px] text-[#555] uppercase",children:k?"active":"idle"})]})]})]}),m&&O.jsx("div",{className:"px-4 py-2 text-xs text-[#ff3366] bg-[#ff336610] border-b border-[#ff336620]",children:m}),O.jsx("div",{ref:o,className:"h-[calc(100vh-420px)] sm:h-[calc(100vh-460px)] min-h-[250px] sm:min-h-[300px]"})]})}function V2({metrics:i,loading:s}){if(s||!i)return O.jsx("div",{className:"flex items-center justify-center h-48 text-[#555] text-sm animate-pulse",children:"Loading metrics…"});const a=[{label:"Duration",value:VE(i.durationSec*1e3),icon:"⏱",color:"#00e5ff"},{label:"Messages",value:i.messages.toString(),icon:"💬",color:"#00e5ff"},{label:"Tool Calls",value:i.toolCalls.toString(),icon:"🔧",color:"#00e5ff"},{label:"Approvals",value:i.approvals.toString(),icon:"✅",color:"#00ff88"},{label:"Auto-approvals",value:i.autoApprovals.toString(),icon:"⚡",color:"#ffaa00"},{label:"Status Changes",value:i.statusChanges.length.toString(),icon:"🔄",color:"#8888ff"}];return O.jsxs("div",{className:"space-y-4",children:[O.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3",children:a.map(o=>O.jsxs("div",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-4 transition-colors duration-150 hover:border-[#00e5ff]/30",children:[O.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[O.jsx("span",{className:"text-base",children:o.icon}),O.jsx("span",{className:"text-[10px] text-[#888] uppercase tracking-wider",children:o.label})]}),O.jsx("div",{className:"text-2xl font-semibold font-mono tabular-nums",style:{color:o.color},children:o.value})]},o.label))}),i.statusChanges.length>0&&O.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg p-4",children:[O.jsx("h3",{className:"text-xs text-[#888] uppercase tracking-wider mb-3",children:"Status Changes"}),O.jsx("div",{className:"flex flex-wrap gap-2",children:i.statusChanges.map((o,g)=>O.jsx("div",{className:"text-xs font-mono text-[#555] bg-[#0a0a0f] px-2 py-1 rounded border border-[#1a1a2e]",children:o},g))})]})]})}const X2=new Set(["bypassPermissions","dontAsk","acceptEdits","plan","auto"]);function J2({prompt:i,permissionMode:s,onApprove:a,onReject:o}){const[g,w]=F.useState(!1);return s&&s!=="default"&&X2.has(s)?O.jsx("div",{className:"flex items-center gap-2 px-4 py-2 bg-[#003322]/50 border border-[#00ff88]/30 rounded-lg text-sm",children:O.jsxs("span",{className:"text-[#00ff88] font-semibold text-xs uppercase tracking-wider",children:["AUTO-APPROVED (",s,")"]})}):O.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3 px-3 sm:px-4 py-3 bg-[#1a1a00]/60 border border-[#ffaa00]/40 rounded-lg",children:[O.jsxs("div",{className:"flex items-center gap-3 sm:gap-2 min-w-0",children:[O.jsx("span",{className:"text-[#ffaa00] text-lg shrink-0",children:"⚠"}),O.jsxs("div",{className:"flex-1 min-w-0",children:[O.jsx("div",{className:"text-xs text-[#ffaa00] font-semibold uppercase tracking-wider mb-0.5",children:"Permission Required"}),O.jsxs("div",{className:`text-sm text-[#e0e0e0] font-mono cursor-pointer ${g?"":"truncate"}`,onClick:()=>w(!g),title:g?void 0:"Click to expand",children:[i,!g&&i.length>60&&O.jsx("span",{className:"text-[#888] ml-1",children:"..."})]})]})]}),O.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[O.jsx("button",{onClick:a,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#003322] hover:bg-[#004433] text-[#00ff88] border border-[#00ff88]/30 transition-colors",children:"Approve"}),O.jsx("button",{onClick:o,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#331111] hover:bg-[#442222] text-[#ff3366] border border-[#ff3366]/30 transition-colors",children:"Reject"})]})]})}const Q2=[{id:"transcript",label:"Transcript"},{id:"terminal",label:"Terminal"},{id:"metrics",label:"Metrics"}];function eT(){const{id:i}=Sp(),s=cl(),[a,o]=F.useState("transcript"),{session:g,health:w,notFound:T,loading:l,metrics:h,metricsLoading:u}=c2(i??""),[y,m]=F.useState(""),[b,x]=F.useState(!1),k=F.useRef(null),C=F.useRef(!1),_=Xr(I=>I.addToast);if(l)return O.jsx("div",{className:"min-h-screen bg-[#0a0a0f] flex items-center justify-center text-[#555] text-sm",children:O.jsx("div",{className:"animate-pulse",children:"Loading session…"})});if(T||!g||!w)return O.jsxs("div",{className:"min-h-screen bg-[#0a0a0f] flex flex-col items-center justify-center text-[#555]",children:[O.jsx("div",{className:"text-6xl mb-4",children:"404"}),O.jsx("div",{className:"text-lg mb-6 text-[#e0e0e0]",children:"Session not found"}),O.jsx(Hi,{to:"/",className:"text-sm text-[#00e5ff] hover:underline",children:"← Back to Overview"})]});const v=g,f=w,p=f.status==="permission_prompt"||f.status==="bash_approval";function S(){mv(v.id).catch(I=>_("error","Approve failed",I instanceof Error?I.message:void 0))}function A(){ME(v.id).catch(I=>_("error","Reject failed",I instanceof Error?I.message:void 0))}function R(){pv(v.id).catch(I=>_("error","Interrupt failed",I instanceof Error?I.message:void 0))}function M(){LE(v.id).catch(I=>_("error","Escape failed",I instanceof Error?I.message:void 0))}async function E(){try{await _v(v.id),s("/")}catch(I){_("error","Failed to kill session",I instanceof Error?I.message:void 0)}}async function B(){var q;const I=y.trim();if(I&&!C.current){C.current=!0,x(!0);try{await OE(v.id,I),m("")}catch(P){_("error","Failed to send message",P instanceof Error?P.message:void 0)}finally{x(!1),C.current=!1,(q=k.current)==null||q.focus()}}}function $(I){I.key==="Enter"&&!I.shiftKey&&(I.preventDefault(),B())}return O.jsx("div",{className:"min-h-screen bg-[#0a0a0f]",children:O.jsxs("div",{className:"max-w-6xl mx-auto px-3 sm:px-4 py-3 sm:py-4 space-y-3 sm:space-y-4",children:[O.jsxs("nav",{className:"text-xs text-[#555] flex items-center gap-1",children:[O.jsx(Hi,{to:"/",className:"hover:text-[#00e5ff] transition-colors",children:"Overview"}),O.jsx("span",{className:"text-[#333]",children:"/"}),O.jsx("span",{className:"text-[#e0e0e0] truncate max-w-[160px] sm:max-w-xs",children:v.windowName||v.id})]}),O.jsx(h2,{session:v,health:f,onApprove:S,onReject:A,onInterrupt:R,onKill:E}),O.jsx("div",{className:"flex border-b border-[#1a1a2e]",role:"tablist",children:Q2.map(I=>O.jsxs("button",{id:`tab-${I.id}`,onClick:()=>o(I.id),role:"tab","aria-selected":a===I.id,"aria-controls":`panel-${I.id}`,tabIndex:a===I.id?0:-1,className:`flex-1 min-h-[44px] text-sm font-medium transition-colors relative ${a===I.id?"text-[#00e5ff]":"text-[#555] hover:text-[#888]"}`,children:[I.label,a===I.id&&O.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-[#00e5ff]"})]},I.id))}),O.jsxs("div",{className:"bg-[#0a0a0f] rounded-lg min-h-[300px] sm:min-h-[400px]",children:[p&&O.jsx("div",{className:"p-3 sm:p-4 pb-0",children:O.jsx(J2,{prompt:f.details,permissionMode:v.permissionMode,onApprove:S,onReject:A})}),a==="transcript"&&O.jsx("div",{id:"panel-transcript",role:"tabpanel","aria-labelledby":"tab-transcript",tabIndex:0,className:"h-[calc(100vh-380px)] sm:h-[calc(100vh-420px)] min-h-[250px] sm:min-h-[300px]",children:O.jsx(P2,{sessionId:v.id})}),a==="terminal"&&O.jsx("div",{id:"panel-terminal",role:"tabpanel","aria-labelledby":"tab-terminal",tabIndex:0,children:O.jsx(K2,{sessionId:v.id,status:f.status})}),a==="metrics"&&O.jsx("div",{id:"panel-metrics",role:"tabpanel","aria-labelledby":"tab-metrics",tabIndex:0,className:"p-3 sm:p-4",children:O.jsx(V2,{metrics:h,loading:u})})]}),O.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg p-3",children:[O.jsxs("div",{className:"flex items-center gap-2",children:[O.jsx("input",{ref:k,type:"text",value:y,onChange:I=>m(I.target.value),onKeyDown:$,placeholder:"Send a message to Claude…",disabled:b||!f.alive,className:"flex-1 min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#00e5ff] font-mono disabled:opacity-50"}),O.jsx("button",{onClick:B,disabled:b||!y.trim()||!f.alive,className:"min-h-[44px] min-w-[44px] flex items-center justify-center p-2.5 rounded bg-[#00e5ff]/10 hover:bg-[#00e5ff]/20 text-[#00e5ff] border border-[#00e5ff]/30 transition-colors disabled:opacity-30 disabled:cursor-not-allowed",title:"Send message",children:O.jsx(rb,{className:"h-4 w-4"})})]}),O.jsxs("div",{className:"flex flex-wrap items-center gap-2 mt-2 pt-2 border-t border-[#1a1a2e]/50",children:[O.jsxs("button",{onClick:R,className:"flex items-center gap-1.5 min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-gray-300 border border-[#1a1a2e] transition-colors",title:"Interrupt (Ctrl+C)",children:[O.jsx(KS,{className:"h-3.5 w-3.5"}),"Interrupt"]}),O.jsxs("button",{onClick:M,className:"flex items-center gap-1.5 min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-gray-300 border border-[#1a1a2e] transition-colors",title:"Send Escape",children:[O.jsx(IS,{className:"h-3.5 w-3.5"}),"Escape"]})]})]})]})})}const tT={running:"bg-cyan/10 text-cyan border-cyan/30",completed:"bg-emerald-400/10 text-emerald-400 border-emerald-400/30",failed:"bg-red-400/10 text-red-400 border-red-400/30",pending:"bg-gray-500/10 text-gray-400 border-gray-500/30"},iT=new Set(["running"]);function Av({status:i}){const s=tT[i]??"bg-gray-500/10 text-gray-500 border-gray-500/30",a=iT.has(i);return O.jsxs("span",{className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium ${s}`,children:[a&&O.jsxs("span",{className:"relative flex h-2 w-2",children:[O.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75 bg-current"}),O.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-current"})]}),i]})}let rT=0;function pa(){return{workDir:"",name:"",prompt:"",_key:rT++}}function sT({open:i,onClose:s}){const a=cl(),o=F.useRef(null),g=F.useRef(null),[w,T]=F.useState(""),[l,h]=F.useState([pa(),pa()]),[u,y]=F.useState(!1),[m,b]=F.useState(null),x=F.useCallback(()=>{k(),s()},[s]);function k(){T(""),h([pa(),pa()]),y(!1),b(null)}F.useEffect(()=>{if(!i)return;const S=A=>{A.key==="Escape"&&x()};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[i,x]),F.useEffect(()=>{if(!i)return;const S=o.current;if(!S)return;const A='input, textarea, select, button, [tabindex]:not([tabindex="-1"])',R=M=>{if(M.key!=="Tab")return;const E=Array.from(S.querySelectorAll(A));if(E.length===0)return;const B=E[0],$=E[E.length-1];M.shiftKey?document.activeElement===B&&(M.preventDefault(),$.focus()):document.activeElement===$&&(M.preventDefault(),B.focus())};return S.addEventListener("keydown",R),()=>S.removeEventListener("keydown",R)},[i]),F.useEffect(()=>{if(i){const S=setTimeout(()=>{var A;return(A=g.current)==null?void 0:A.focus()},50);return()=>clearTimeout(S)}},[i]);function C(){l.length>=10||h([...l,pa()])}function _(S){l.length<=1||h(l.filter((A,R)=>R!==S))}function v(S,A,R){h(l.map((M,E)=>E===S?{...M,[A]:R}:M))}async function f(S){S.preventDefault(),b(null);const A=l.filter(R=>R.workDir.trim());if(!w.trim()){b("Pipeline name is required");return}if(A.length===0){b("At least one step with a working directory is required");return}y(!0);try{const R=await jE({name:w.trim(),workDir:A[0].workDir.trim(),stages:A.map(M=>({workDir:M.workDir.trim(),name:M.name.trim()||void 0,prompt:M.prompt.trim()||void 0}))});k(),s(),a(`/pipelines/${R.id}`)}catch(R){b(R instanceof Error?R.message:"Failed to create pipeline")}finally{y(!1)}}if(!i)return null;const p=w.trim()&&l.some(S=>S.workDir.trim());return O.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[O.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:x}),O.jsxs("div",{ref:o,role:"dialog","aria-modal":"true","aria-label":"Create new pipeline",className:"relative w-full max-w-2xl mx-4 bg-[#111118] border border-[#1a1a2e] rounded-lg shadow-2xl max-h-[90vh] overflow-y-auto",children:[O.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-5 py-4 border-b border-[#1a1a2e]",children:[O.jsx("h2",{className:"text-sm font-semibold text-gray-100",children:"New Pipeline"}),O.jsx("button",{onClick:x,className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-gray-300 transition-colors",children:O.jsx(fl,{className:"h-4 w-4"})})]}),O.jsxs("form",{onSubmit:f,className:"p-4 sm:p-5 space-y-4",children:[O.jsxs("div",{children:[O.jsxs("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:["Pipeline Name ",O.jsx("span",{className:"text-[#ff3366]",children:"*"})]}),O.jsx("input",{type:"text",ref:g,value:w,onChange:S=>T(S.target.value),placeholder:"my-pipeline","aria-label":"Pipeline Name",className:"w-full min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#00e5ff]"})]}),O.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 text-xs font-medium text-gray-500 px-1",children:[O.jsxs("span",{children:["Working Directory ",O.jsx("span",{className:"text-[#ff3366]",children:"*"})]}),O.jsx("span",{children:"Name"}),O.jsx("span",{children:"Prompt"}),O.jsx("span",{})]}),O.jsx("div",{className:"space-y-2",children:l.map((S,A)=>O.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 items-start",children:[O.jsx("input",{type:"text",value:S.workDir,onChange:R=>v(A,"workDir",R.target.value),placeholder:"/home/user/project",className:"min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#00e5ff] font-mono"}),O.jsx("input",{type:"text",value:S.name,onChange:R=>v(A,"name",R.target.value),placeholder:"name",className:"min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#00e5ff]"}),O.jsx("input",{type:"text",value:S.prompt,onChange:R=>v(A,"prompt",R.target.value),placeholder:"Initial prompt...",className:"min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#00e5ff]"}),O.jsx("button",{type:"button",onClick:()=>_(A),disabled:l.length<=1,"aria-label":`Remove step ${A+1}`,className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-[#ff3366] transition-colors disabled:opacity-30 disabled:cursor-not-allowed",children:O.jsx(Np,{className:"h-3.5 w-3.5"})})]},S._key))}),l.length<10&&O.jsxs("button",{type:"button",onClick:C,className:"flex items-center gap-1.5 text-xs text-gray-500 hover:text-gray-300 transition-colors",children:[O.jsx(hl,{className:"h-3.5 w-3.5"}),"Add Step"]}),m&&O.jsx("div",{className:"text-xs text-[#ff3366] bg-[#ff3366]/10 border border-[#ff3366]/20 rounded px-3 py-2",children:m}),O.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[O.jsx("button",{type:"button",onClick:x,className:"min-h-[44px] px-4 py-2.5 text-xs font-medium rounded bg-[#1a1a2e] hover:bg-[#2a2a3e] text-gray-300 transition-colors",children:"Cancel"}),O.jsxs("button",{type:"submit",disabled:u||!p,className:"min-h-[44px] flex items-center gap-1.5 px-4 py-2.5 text-xs font-medium rounded bg-[#00e5ff]/10 hover:bg-[#00e5ff]/20 text-[#00e5ff] border border-[#00e5ff]/30 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[u&&O.jsx(Ju,{className:"h-3 w-3 animate-spin"}),"Create Pipeline"]})]})]})]})]})}function nT(){const[i,s]=F.useState([]),[a,o]=F.useState(!0),[g,w]=F.useState(!1),T=Xr(u=>u.addToast),l=F.useCallback(async()=>{try{const u=await HE();s(u)}catch(u){T("error","Failed to fetch pipelines",u instanceof Error?u.message:void 0)}finally{o(!1)}},[T]);F.useEffect(()=>{l();const u=setInterval(l,5e3);return()=>clearInterval(u)},[l]);const h={total:i.length,running:i.filter(u=>u.status==="running").length,completed:i.filter(u=>u.status==="completed").length,failed:i.filter(u=>u.status==="failed").length};return a?O.jsx("div",{className:"flex items-center justify-center min-h-[50vh] text-gray-500 text-sm",children:O.jsx("div",{className:"animate-pulse",children:"Loading pipelines…"})}):O.jsxs("div",{className:"flex flex-col gap-6",children:[O.jsxs("div",{className:"flex items-center justify-between",children:[O.jsxs("div",{children:[O.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"Pipelines"}),O.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Manage and monitor session pipelines"})]}),O.jsxs("button",{onClick:()=>w(!0),className:"flex items-center gap-1.5 px-3 py-2 text-xs font-medium rounded bg-[#00e5ff]/10 hover:bg-[#00e5ff]/20 text-[#00e5ff] border border-[#00e5ff]/30 transition-colors",children:[O.jsx(hl,{className:"h-3.5 w-3.5"}),"New Pipeline"]})]}),O.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[O.jsx(qr,{label:"Total",value:h.total}),O.jsx(qr,{label:"Running",value:h.running}),O.jsx(qr,{label:"Completed",value:h.completed}),O.jsx(qr,{label:"Failed",value:h.failed})]}),i.length===0?O.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-12 text-center",children:[O.jsx("p",{className:"text-gray-500",children:"No pipelines yet"}),O.jsx("p",{className:"mt-1 text-xs text-gray-600",children:"Create a pipeline to run sessions in sequence"})]}):O.jsx("div",{className:"space-y-3",children:i.map(u=>O.jsx(Hi,{to:`/pipelines/${u.id}`,className:"block rounded-lg border border-[#1a1a2e] bg-[#111118] p-4 hover:border-[#00e5ff]/30 transition-colors",children:O.jsxs("div",{className:"flex items-center justify-between",children:[O.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[O.jsx("span",{className:"font-medium text-gray-200 truncate",children:u.name}),O.jsx(Av,{status:u.status})]}),O.jsxs("div",{className:"flex items-center gap-4 text-xs text-gray-500 shrink-0 ml-4",children:[O.jsxs("span",{children:[u.stages.length," step",u.stages.length!==1?"s":""]}),O.jsx("span",{children:an(u.createdAt)})]})]})},u.id))}),O.jsx(sT,{open:g,onClose:()=>w(!1)})]})}function aT(){const{id:i}=Sp(),[s,a]=F.useState(null),[o,g]=F.useState(!0),[w,T]=F.useState(!1),l=Xr(u=>u.addToast),h=F.useCallback(async()=>{if(i)try{const u=await UE(i);a(u),T(!1)}catch(u){const y=u;y.statusCode===404?T(!0):l("error","Failed to fetch pipeline",y.message)}finally{g(!1)}},[i,l]);return F.useEffect(()=>{h();const u=setInterval(h,3e3);return()=>clearInterval(u)},[h]),o?O.jsx("div",{className:"flex items-center justify-center min-h-[50vh] text-gray-500 text-sm",children:O.jsx("div",{className:"animate-pulse",children:"Loading pipeline…"})}):w||!s?O.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[50vh] text-gray-500",children:[O.jsx("div",{className:"text-6xl mb-4",children:"404"}),O.jsx("div",{className:"text-lg mb-6 text-gray-200",children:"Pipeline not found"}),O.jsx(Hi,{to:"/pipelines",className:"text-sm text-[#00e5ff] hover:underline",children:"← Back to Pipelines"})]}):O.jsxs("div",{className:"flex flex-col gap-6",children:[O.jsxs("nav",{className:"text-xs text-gray-500 flex items-center gap-1",children:[O.jsx(Hi,{to:"/pipelines",className:"hover:text-[#00e5ff] transition-colors",children:"Pipelines"}),O.jsx("span",{className:"text-gray-700",children:"/"}),O.jsx("span",{className:"text-gray-200 truncate max-w-xs",children:s.name})]}),O.jsxs("div",{className:"flex items-center justify-between",children:[O.jsxs("div",{className:"flex items-center gap-3",children:[O.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:s.name}),O.jsx(Av,{status:s.status})]}),O.jsxs("div",{className:"text-xs text-gray-500",children:["Created ",an(s.createdAt)]})]}),O.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118]",children:[O.jsx("div",{className:"px-4 py-3 border-b border-void-lighter",children:O.jsxs("h3",{className:"text-sm font-semibold text-gray-200",children:["Steps (",s.stages.length,")"]})}),s.stages.length===0?O.jsx("div",{className:"p-8 text-center text-gray-500 text-sm",children:"No steps yet"}):O.jsxs("table",{className:"w-full text-left text-sm",children:[O.jsx("thead",{children:O.jsxs("tr",{className:"border-b border-void-lighter text-gray-600",children:[O.jsx("th",{className:"px-4 py-3 font-medium w-16",children:"#"}),O.jsx("th",{className:"px-4 py-3 font-medium",children:"Status"}),O.jsx("th",{className:"px-4 py-3 font-medium",children:"Name"}),O.jsx("th",{className:"px-4 py-3 font-medium",children:"Session"})]})}),O.jsx("tbody",{children:s.stages.map((u,y)=>O.jsxs("tr",{className:"border-b border-void-lighter/50 transition-colors hover:border-l-2 hover:border-l-cyan",children:[O.jsxs("td",{className:"px-4 py-3 text-gray-500 font-mono text-xs",children:["#",y+1]}),O.jsx("td",{className:"px-4 py-3",children:O.jsx(yl,{status:u.status})}),O.jsx("td",{className:"px-4 py-3",children:u.sessionId?O.jsx(Hi,{to:`/sessions/${encodeURIComponent(u.sessionId)}`,className:"font-medium text-gray-200 hover:text-cyan transition-colors",children:u.name}):O.jsx("span",{className:"font-medium text-gray-200",children:u.name})}),O.jsx("td",{className:"px-4 py-3 font-mono text-xs text-gray-400",children:u.sessionId??"—"})]},u.name))})]})]})]})}function oT(){return O.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 text-center",children:[O.jsx("h1",{className:"text-6xl font-bold text-gray-500",children:"404"}),O.jsx("p",{className:"text-lg text-gray-400",children:"Page not found"}),O.jsx(Hi,{to:"/",className:"mt-2 rounded-lg bg-cyan px-4 py-2 text-sm font-medium text-void transition-colors hover:bg-cyan/80",children:"Back to Dashboard"})]})}function lT(){return O.jsx(AS,{children:O.jsx(Yy,{children:O.jsxs(ps,{element:O.jsx(YE,{}),children:[O.jsx(ps,{path:"/",element:O.jsx(l2,{})}),O.jsx(ps,{path:"/sessions/:id",element:O.jsx(eT,{})}),O.jsx(ps,{path:"/pipelines",element:O.jsx(nT,{})}),O.jsx(ps,{path:"/pipelines/:id",element:O.jsx(aT,{})}),O.jsx(ps,{path:"*",element:O.jsx(oT,{})})]})})})}Y0.createRoot(document.getElementById("root")).render(O.jsx(va.StrictMode,{children:O.jsx(gS,{basename:"/dashboard",children:O.jsx(lT,{})})}));