aegis-bridge 2.12.0 → 2.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dashboard/dist/assets/index-DhUXvnKe.js +302 -0
- package/dashboard/dist/assets/index-hJxI_Ze7.css +32 -0
- package/dashboard/dist/index.html +2 -2
- package/dist/api-contracts.d.ts +197 -0
- package/dist/api-contracts.js +7 -0
- package/dist/api-contracts.typecheck.d.ts +14 -0
- package/dist/api-contracts.typecheck.js +1 -0
- package/dist/channels/telegram.d.ts +12 -1
- package/dist/channels/telegram.js +123 -3
- package/dist/config.d.ts +2 -0
- package/dist/config.js +3 -0
- package/dist/events.d.ts +11 -0
- package/dist/events.js +42 -0
- package/dist/hook-settings.d.ts +1 -1
- package/dist/hook-settings.js +5 -13
- package/dist/hooks.js +2 -13
- package/dist/metrics.d.ts +2 -1
- package/dist/monitor.js +33 -6
- package/dist/server.js +21 -2
- package/dist/session.d.ts +12 -5
- package/dist/session.js +107 -119
- package/dist/tmux.d.ts +2 -0
- package/dist/tmux.js +24 -15
- package/dist/validation.d.ts +11 -7
- package/dist/validation.js +53 -8
- package/package.json +4 -1
- package/dashboard/dist/assets/index--qcihe0P.css +0 -32
- package/dashboard/dist/assets/index-DFdRqV0R.js +0 -302
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
var m0=Object.defineProperty;var _0=(i,r,a)=>r in i?m0(i,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[r]=a;var mt=(i,r,a)=>_0(i,typeof r!="symbol"?r+"":r,a);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const g of document.querySelectorAll('link[rel="modulepreload"]'))o(g);new MutationObserver(g=>{for(const k of g)if(k.type==="childList")for(const T of k.addedNodes)T.tagName==="LINK"&&T.rel==="modulepreload"&&o(T)}).observe(document,{childList:!0,subtree:!0});function a(g){const k={};return g.integrity&&(k.integrity=g.integrity),g.referrerPolicy&&(k.referrerPolicy=g.referrerPolicy),g.crossOrigin==="use-credentials"?k.credentials="include":g.crossOrigin==="anonymous"?k.credentials="omit":k.credentials="same-origin",k}function o(g){if(g.ep)return;g.ep=!0;const k=a(g);fetch(g.href,k)}})();function U_(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Wc={exports:{}},Mn={};/**
|
|
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 jm;function p0(){if(jm)return Mn;jm=1;var i=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function a(o,g,k){var T=null;if(k!==void 0&&(T=""+k),g.key!==void 0&&(T=""+g.key),"key"in g){k={};for(var c in g)c!=="key"&&(k[c]=g[c])}else k=g;return g=k.ref,{$$typeof:i,type:o,key:T,ref:g!==void 0?g:null,props:k}}return Mn.Fragment=r,Mn.jsx=a,Mn.jsxs=a,Mn}var Bm;function v0(){return Bm||(Bm=1,Wc.exports=p0()),Wc.exports}var b=v0(),Xc={exports:{}},we={};/**
|
|
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 zm;function g0(){if(zm)return we;zm=1;var i=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),T=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),C=Symbol.iterator;function E(L){return L===null||typeof L!="object"?null:(L=C&&L[C]||L["@@iterator"],typeof L=="function"?L:null)}var O={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,m={};function p(L,B,$){this.props=L,this.context=B,this.refs=m,this.updater=$||O}p.prototype.isReactComponent={},p.prototype.setState=function(L,B){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,B,"setState")},p.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function f(){}f.prototype=p.prototype;function v(L,B,$){this.props=L,this.context=B,this.refs=m,this.updater=$||O}var S=v.prototype=new f;S.constructor=v,x(S,p.prototype),S.isPureReactComponent=!0;var R=Array.isArray;function A(){}var M={H:null,A:null,T:null,S:null},w=Object.prototype.hasOwnProperty;function N(L,B,$){var Y=$.ref;return{$$typeof:i,type:L,key:B,ref:Y!==void 0?Y:null,props:$}}function I(L,B){return N(L.type,B,L.props)}function q(L){return typeof L=="object"&&L!==null&&L.$$typeof===i}function K(L){var B={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function($){return B[$]})}var Z=/\/+/g;function J(L,B){return typeof L=="object"&&L!==null&&L.key!=null?K(""+L.key):B.toString(36)}function ee(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(A,A):(L.status="pending",L.then(function(B){L.status==="pending"&&(L.status="fulfilled",L.value=B)},function(B){L.status==="pending"&&(L.status="rejected",L.reason=B)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function F(L,B,$,Y,re){var he=typeof L;(he==="undefined"||he==="boolean")&&(L=null);var V=!1;if(L===null)V=!0;else switch(he){case"bigint":case"string":case"number":V=!0;break;case"object":switch(L.$$typeof){case i:case r:V=!0;break;case y:return V=L._init,F(V(L._payload),B,$,Y,re)}}if(V)return re=re(L),V=Y===""?"."+J(L,0):Y,R(re)?($="",V!=null&&($=V.replace(Z,"$&/")+"/"),F(re,B,$,"",function(oe){return oe})):re!=null&&(q(re)&&(re=I(re,$+(re.key==null||L&&L.key===re.key?"":(""+re.key).replace(Z,"$&/")+"/")+V)),B.push(re)),1;V=0;var H=Y===""?".":Y+":";if(R(L))for(var ce=0;ce<L.length;ce++)Y=L[ce],he=H+J(Y,ce),V+=F(Y,B,$,he,re);else if(ce=E(L),typeof ce=="function")for(L=ce.call(L),ce=0;!(Y=L.next()).done;)Y=Y.value,he=H+J(Y,ce++),V+=F(Y,B,$,he,re);else if(he==="object"){if(typeof L.then=="function")return F(ee(L),B,$,Y,re);throw B=String(L),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return V}function Q(L,B,$){if(L==null)return L;var Y=[],re=0;return F(L,Y,"","",function(he){return B.call($,he,re++)}),Y}function ne(L){if(L._status===-1){var B=L._result;B=B(),B.then(function($){(L._status===0||L._status===-1)&&(L._status=1,L._result=$)},function($){(L._status===0||L._status===-1)&&(L._status=2,L._result=$)}),L._status===-1&&(L._status=0,L._result=B)}if(L._status===1)return L._result.default;throw L._result}var j=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=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(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},U={map:Q,forEach:function(L,B,$){Q(L,function(){B.apply(this,arguments)},$)},count:function(L){var B=0;return Q(L,function(){B++}),B},toArray:function(L){return Q(L,function(B){return B})||[]},only:function(L){if(!q(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return we.Activity=d,we.Children=U,we.Component=p,we.Fragment=a,we.Profiler=g,we.PureComponent=v,we.StrictMode=o,we.Suspense=u,we.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,we.__COMPILER_RUNTIME={__proto__:null,c:function(L){return M.H.useMemoCache(L)}},we.cache=function(L){return function(){return L.apply(null,arguments)}},we.cacheSignal=function(){return null},we.cloneElement=function(L,B,$){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var Y=x({},L.props),re=L.key;if(B!=null)for(he in B.key!==void 0&&(re=""+B.key),B)!w.call(B,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&B.ref===void 0||(Y[he]=B[he]);var he=arguments.length-2;if(he===1)Y.children=$;else if(1<he){for(var V=Array(he),H=0;H<he;H++)V[H]=arguments[H+2];Y.children=V}return N(L.type,re,Y)},we.createContext=function(L){return L={$$typeof:T,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:k,_context:L},L},we.createElement=function(L,B,$){var Y,re={},he=null;if(B!=null)for(Y in B.key!==void 0&&(he=""+B.key),B)w.call(B,Y)&&Y!=="key"&&Y!=="__self"&&Y!=="__source"&&(re[Y]=B[Y]);var V=arguments.length-2;if(V===1)re.children=$;else if(1<V){for(var H=Array(V),ce=0;ce<V;ce++)H[ce]=arguments[ce+2];re.children=H}if(L&&L.defaultProps)for(Y in V=L.defaultProps,V)re[Y]===void 0&&(re[Y]=V[Y]);return N(L,he,re)},we.createRef=function(){return{current:null}},we.forwardRef=function(L){return{$$typeof:c,render:L}},we.isValidElement=q,we.lazy=function(L){return{$$typeof:y,_payload:{_status:-1,_result:L},_init:ne}},we.memo=function(L,B){return{$$typeof:h,type:L,compare:B===void 0?null:B}},we.startTransition=function(L){var B=M.T,$={};M.T=$;try{var Y=L(),re=M.S;re!==null&&re($,Y),typeof Y=="object"&&Y!==null&&typeof Y.then=="function"&&Y.then(A,j)}catch(he){j(he)}finally{B!==null&&$.types!==null&&(B.types=$.types),M.T=B}},we.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},we.use=function(L){return M.H.use(L)},we.useActionState=function(L,B,$){return M.H.useActionState(L,B,$)},we.useCallback=function(L,B){return M.H.useCallback(L,B)},we.useContext=function(L){return M.H.useContext(L)},we.useDebugValue=function(){},we.useDeferredValue=function(L,B){return M.H.useDeferredValue(L,B)},we.useEffect=function(L,B){return M.H.useEffect(L,B)},we.useEffectEvent=function(L){return M.H.useEffectEvent(L)},we.useId=function(){return M.H.useId()},we.useImperativeHandle=function(L,B,$){return M.H.useImperativeHandle(L,B,$)},we.useInsertionEffect=function(L,B){return M.H.useInsertionEffect(L,B)},we.useLayoutEffect=function(L,B){return M.H.useLayoutEffect(L,B)},we.useMemo=function(L,B){return M.H.useMemo(L,B)},we.useOptimistic=function(L,B){return M.H.useOptimistic(L,B)},we.useReducer=function(L,B,$){return M.H.useReducer(L,B,$)},we.useRef=function(L){return M.H.useRef(L)},we.useState=function(L){return M.H.useState(L)},we.useSyncExternalStore=function(L,B,$){return M.H.useSyncExternalStore(L,B,$)},we.useTransition=function(){return M.H.useTransition()},we.version="19.2.4",we}var Hm;function Su(){return Hm||(Hm=1,Xc.exports=g0()),Xc.exports}var P=Su();const zn=U_(P);var Jc={exports:{}},Ln={},Qc={exports:{}},eu={};/**
|
|
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 y0(){return Um||(Um=1,(function(i){function r(F,Q){var ne=F.length;F.push(Q);e:for(;0<ne;){var j=ne-1>>>1,U=F[j];if(0<g(U,Q))F[j]=Q,F[ne]=U,ne=j;else break e}}function a(F){return F.length===0?null:F[0]}function o(F){if(F.length===0)return null;var Q=F[0],ne=F.pop();if(ne!==Q){F[0]=ne;e:for(var j=0,U=F.length,L=U>>>1;j<L;){var B=2*(j+1)-1,$=F[B],Y=B+1,re=F[Y];if(0>g($,ne))Y<U&&0>g(re,$)?(F[j]=re,F[Y]=ne,j=Y):(F[j]=$,F[B]=ne,j=B);else if(Y<U&&0>g(re,ne))F[j]=re,F[Y]=ne,j=Y;else break e}}return Q}function g(F,Q){var ne=F.sortIndex-Q.sortIndex;return ne!==0?ne:F.id-Q.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var k=performance;i.unstable_now=function(){return k.now()}}else{var T=Date,c=T.now();i.unstable_now=function(){return T.now()-c}}var u=[],h=[],y=1,d=null,C=3,E=!1,O=!1,x=!1,m=!1,p=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;function S(F){for(var Q=a(h);Q!==null;){if(Q.callback===null)o(h);else if(Q.startTime<=F)o(h),Q.sortIndex=Q.expirationTime,r(u,Q);else break;Q=a(h)}}function R(F){if(x=!1,S(F),!O)if(a(u)!==null)O=!0,A||(A=!0,K());else{var Q=a(h);Q!==null&&ee(R,Q.startTime-F)}}var A=!1,M=-1,w=5,N=-1;function I(){return m?!0:!(i.unstable_now()-N<w)}function q(){if(m=!1,A){var F=i.unstable_now();N=F;var Q=!0;try{e:{O=!1,x&&(x=!1,f(M),M=-1),E=!0;var ne=C;try{t:{for(S(F),d=a(u);d!==null&&!(d.expirationTime>F&&I());){var j=d.callback;if(typeof j=="function"){d.callback=null,C=d.priorityLevel;var U=j(d.expirationTime<=F);if(F=i.unstable_now(),typeof U=="function"){d.callback=U,S(F),Q=!0;break t}d===a(u)&&o(u),S(F)}else o(u);d=a(u)}if(d!==null)Q=!0;else{var L=a(h);L!==null&&ee(R,L.startTime-F),Q=!1}}break e}finally{d=null,C=ne,E=!1}Q=void 0}}finally{Q?K():A=!1}}}var K;if(typeof v=="function")K=function(){v(q)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,J=Z.port2;Z.port1.onmessage=q,K=function(){J.postMessage(null)}}else K=function(){p(q,0)};function ee(F,Q){M=p(function(){F(i.unstable_now())},Q)}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(F){F.callback=null},i.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):w=0<F?Math.floor(1e3/F):5},i.unstable_getCurrentPriorityLevel=function(){return C},i.unstable_next=function(F){switch(C){case 1:case 2:case 3:var Q=3;break;default:Q=C}var ne=C;C=Q;try{return F()}finally{C=ne}},i.unstable_requestPaint=function(){m=!0},i.unstable_runWithPriority=function(F,Q){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var ne=C;C=F;try{return Q()}finally{C=ne}},i.unstable_scheduleCallback=function(F,Q,ne){var j=i.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?j+ne:j):ne=j,F){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=ne+U,F={id:y++,callback:Q,priorityLevel:F,startTime:ne,expirationTime:U,sortIndex:-1},ne>j?(F.sortIndex=ne,r(h,F),a(u)===null&&F===a(h)&&(x?(f(M),M=-1):x=!0,ee(R,ne-j))):(F.sortIndex=U,r(u,F),O||E||(O=!0,A||(A=!0,K()))),F},i.unstable_shouldYield=I,i.unstable_wrapCallback=function(F){var Q=C;return function(){var ne=C;C=Q;try{return F.apply(this,arguments)}finally{C=ne}}}})(eu)),eu}var Im;function b0(){return Im||(Im=1,Qc.exports=y0()),Qc.exports}var tu={exports:{}},Et={};/**
|
|
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 Pm;function S0(){if(Pm)return Et;Pm=1;var i=Su();function r(u){var h="https://react.dev/errors/"+u;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)h+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+u+"; visit "+h+" 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(r(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 k(u,h,y){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:g,key:d==null?null:""+d,children:u,containerInfo:h,implementation:y}}var T=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(u,h){if(u==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Et.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,Et.createPortal=function(u,h){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(r(299));return k(u,h,null,y)},Et.flushSync=function(u){var h=T.T,y=o.p;try{if(T.T=null,o.p=2,u)return u()}finally{T.T=h,o.p=y,o.d.f()}},Et.preconnect=function(u,h){typeof u=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,o.d.C(u,h))},Et.prefetchDNS=function(u){typeof u=="string"&&o.d.D(u)},Et.preinit=function(u,h){if(typeof u=="string"&&h&&typeof h.as=="string"){var y=h.as,d=c(y,h.crossOrigin),C=typeof h.integrity=="string"?h.integrity:void 0,E=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;y==="style"?o.d.S(u,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:d,integrity:C,fetchPriority:E}):y==="script"&&o.d.X(u,{crossOrigin:d,integrity:C,fetchPriority:E,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Et.preinitModule=function(u,h){if(typeof u=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var y=c(h.as,h.crossOrigin);o.d.M(u,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&o.d.M(u)},Et.preload=function(u,h){if(typeof u=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var y=h.as,d=c(y,h.crossOrigin);o.d.L(u,y,{crossOrigin:d,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Et.preloadModule=function(u,h){if(typeof u=="string")if(h){var y=c(h.as,h.crossOrigin);o.d.m(u,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else o.d.m(u)},Et.requestFormReset=function(u){o.d.r(u)},Et.unstable_batchedUpdates=function(u,h){return u(h)},Et.useFormState=function(u,h,y){return T.H.useFormState(u,h,y)},Et.useFormStatus=function(){return T.H.useHostTransitionStatus()},Et.version="19.2.4",Et}var $m;function x0(){if($m)return tu.exports;$m=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(r){console.error(r)}}return i(),tu.exports=S0(),tu.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 Zm;function C0(){if(Zm)return Ln;Zm=1;var i=b0(),r=Su(),a=x0();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s])}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 k(e){var t=e,s=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(s=t.return),e=t.return;while(e)}return t.tag===3?s: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 c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(k(e)!==e)throw Error(o(188))}function h(e){var t=e.alternate;if(!t){if(t=k(e),t===null)throw Error(o(188));return t!==e?null:e}for(var s=e,n=t;;){var l=s.return;if(l===null)break;var _=l.alternate;if(_===null){if(n=l.return,n!==null){s=n;continue}break}if(l.child===_.child){for(_=l.child;_;){if(_===s)return u(l),e;if(_===n)return u(l),t;_=_.sibling}throw Error(o(188))}if(s.return!==n.return)s=l,n=_;else{for(var D=!1,z=l.child;z;){if(z===s){D=!0,s=l,n=_;break}if(z===n){D=!0,n=l,s=_;break}z=z.sibling}if(!D){for(z=_.child;z;){if(z===s){D=!0,s=_,n=l;break}if(z===n){D=!0,n=_,s=l;break}z=z.sibling}if(!D)throw Error(o(189))}}if(s.alternate!==n)throw Error(o(190))}if(s.tag!==3)throw Error(o(188));return s.stateNode.current===s?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 d=Object.assign,C=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),O=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),v=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),N=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),q=Symbol.iterator;function K(e){return e===null||typeof e!="object"?null:(e=q&&e[q]||e["@@iterator"],typeof e=="function"?e:null)}var Z=Symbol.for("react.client.reference");function J(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Z?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case x:return"Fragment";case p:return"Profiler";case m:return"StrictMode";case R:return"Suspense";case A:return"SuspenseList";case N:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case O:return"Portal";case v: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:J(e.type)||"Memo";case w:t=e._payload,e=e._init;try{return J(e(t))}catch{}}return null}var ee=Array.isArray,F=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},j=[],U=-1;function L(e){return{current:e}}function B(e){0>U||(e.current=j[U],j[U]=null,U--)}function $(e,t){U++,j[U]=e.current,e.current=t}var Y=L(null),re=L(null),he=L(null),V=L(null);function H(e,t){switch($(he,t),$(re,e),$(Y,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?rm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=rm(t),e=nm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}B(Y),$(Y,e)}function ce(){B(Y),B(re),B(he)}function oe(e){e.memoizedState!==null&&$(V,e);var t=Y.current,s=nm(t,e.type);t!==s&&($(re,e),$(Y,s))}function me(e){re.current===e&&(B(Y),B(re)),V.current===e&&(B(V),An._currentValue=ne)}var _e,Te;function je(e){if(_e===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);_e=t&&t[1]||"",Te=-1<s.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+_e+e+Te}var Ze=!1;function ct(e,t){if(!e||Ze)return"";Ze=!0;var s=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 l=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");l&&l.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var _=n.DetermineComponentFrameRoot(),D=_[0],z=_[1];if(D&&z){var G=D.split(`
|
|
44
|
+
`),ie=z.split(`
|
|
45
|
+
`);for(l=n=0;n<G.length&&!G[n].includes("DetermineComponentFrameRoot");)n++;for(;l<ie.length&&!ie[l].includes("DetermineComponentFrameRoot");)l++;if(n===G.length||l===ie.length)for(n=G.length-1,l=ie.length-1;1<=n&&0<=l&&G[n]!==ie[l];)l--;for(;1<=n&&0<=l;n--,l--)if(G[n]!==ie[l]){if(n!==1||l!==1)do if(n--,l--,0>l||G[n]!==ie[l]){var le=`
|
|
46
|
+
`+G[n].replace(" at new "," at ");return e.displayName&&le.includes("<anonymous>")&&(le=le.replace("<anonymous>",e.displayName)),le}while(1<=n&&0<=l);break}}}finally{Ze=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?je(s):""}function Ce(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 pe(e){try{var t="",s=null;do t+=Ce(e,s),s=e,e=e.return;while(e);return t}catch(n){return`
|
|
47
|
+
Error generating stack: `+n.message+`
|
|
48
|
+
`+n.stack}}var At=Object.prototype.hasOwnProperty,mi=i.unstable_scheduleCallback,xs=i.unstable_cancelCallback,Fs=i.unstable_shouldYield,Rt=i.unstable_requestPaint,pt=i.unstable_now,Gt=i.unstable_getCurrentPriorityLevel,$i=i.unstable_ImmediatePriority,Ks=i.unstable_UserBlockingPriority,Ht=i.unstable_NormalPriority,Vs=i.unstable_LowPriority,oi=i.unstable_IdlePriority,Cs=i.log,Ge=i.unstable_setDisableYieldValue,ws=null,Ut=null;function Zi(e){if(typeof Cs=="function"&&Ge(e),Ut&&typeof Ut.setStrictMode=="function")try{Ut.setStrictMode(ws,e)}catch{}}var It=Math.clz32?Math.clz32:ev,Jp=Math.log,Qp=Math.LN2;function ev(e){return e>>>=0,e===0?32:31-(Jp(e)/Qp|0)|0}var Gn=256,Yn=262144,Wn=4194304;function Es(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 Xn(e,t,s){var n=e.pendingLanes;if(n===0)return 0;var l=0,_=e.suspendedLanes,D=e.pingedLanes;e=e.warmLanes;var z=n&134217727;return z!==0?(n=z&~_,n!==0?l=Es(n):(D&=z,D!==0?l=Es(D):s||(s=z&~e,s!==0&&(l=Es(s))))):(z=n&~_,z!==0?l=Es(z):D!==0?l=Es(D):s||(s=n&~e,s!==0&&(l=Es(s)))),l===0?0:t!==0&&t!==l&&(t&_)===0&&(_=l&-l,s=t&-t,_>=s||_===32&&(s&4194048)!==0)?t:l}function Ir(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function tv(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 Hu(){var e=Wn;return Wn<<=1,(Wn&62914560)===0&&(Wn=4194304),e}function Ho(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function Pr(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function iv(e,t,s,n,l,_){var D=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var z=e.entanglements,G=e.expirationTimes,ie=e.hiddenUpdates;for(s=D&~s;0<s;){var le=31-It(s),de=1<<le;z[le]=0,G[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)}s&=~de}n!==0&&Uu(e,n,0),_!==0&&l===0&&e.tag!==0&&(e.suspendedLanes|=_&~(D&~t))}function Uu(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-It(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|s&261930}function Iu(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var n=31-It(s),l=1<<n;l&t|e[n]&t&&(e[n]|=t),s&=~l}}function Pu(e,t){var s=t&-t;return s=(s&42)!==0?1:Uo(s),(s&(e.suspendedLanes|t))!==0?0:s}function Uo(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 Io(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function $u(){var e=Q.p;return e!==0?e:(e=window.event,e===void 0?32:Am(e.type))}function Zu(e,t){var s=Q.p;try{return Q.p=e,t()}finally{Q.p=s}}var qi=Math.random().toString(36).slice(2),bt="__reactFiber$"+qi,Dt="__reactProps$"+qi,Gs="__reactContainer$"+qi,Po="__reactEvents$"+qi,sv="__reactListeners$"+qi,rv="__reactHandles$"+qi,qu="__reactResources$"+qi,$r="__reactMarker$"+qi;function $o(e){delete e[bt],delete e[Dt],delete e[Po],delete e[sv],delete e[rv]}function Ys(e){var t=e[bt];if(t)return t;for(var s=e.parentNode;s;){if(t=s[Gs]||s[bt]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=fm(e);e!==null;){if(s=e[bt])return s;e=fm(e)}return t}e=s,s=e.parentNode}return null}function Ws(e){if(e=e[bt]||e[Gs]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Zr(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Xs(e){var t=e[qu];return t||(t=e[qu]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function gt(e){e[$r]=!0}var Fu=new Set,Ku={};function ks(e,t){Js(e,t),Js(e+"Capture",t)}function Js(e,t){for(Ku[e]=t,e=0;e<t.length;e++)Fu.add(t[e])}var nv=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]*$"),Vu={},Gu={};function av(e){return At.call(Gu,e)?!0:At.call(Vu,e)?!1:nv.test(e)?Gu[e]=!0:(Vu[e]=!0,!1)}function Jn(e,t,s){if(av(t))if(s===null)e.removeAttribute(t);else{switch(typeof s){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,""+s)}}function Qn(e,t,s){if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+s)}}function xi(e,t,s,n){if(n===null)e.removeAttribute(s);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(t,s,""+n)}}function Yt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Yu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ov(e,t,s){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,_=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(D){s=""+D,_.call(this,D)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(D){s=""+D},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Zo(e){if(!e._valueTracker){var t=Yu(e)?"checked":"value";e._valueTracker=ov(e,t,""+e[t])}}function Wu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),n="";return e&&(n=Yu(e)?e.checked?"true":"false":e.value),e=n,e!==s?(t.setValue(e),!0):!1}function ea(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 lv=/[\n"\\]/g;function Wt(e){return e.replace(lv,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function qo(e,t,s,n,l,_,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=""+Yt(t)):e.value!==""+Yt(t)&&(e.value=""+Yt(t)):D!=="submit"&&D!=="reset"||e.removeAttribute("value"),t!=null?Fo(e,D,Yt(t)):s!=null?Fo(e,D,Yt(s)):n!=null&&e.removeAttribute("value"),l==null&&_!=null&&(e.defaultChecked=!!_),l!=null&&(e.checked=l&&typeof l!="function"&&typeof l!="symbol"),z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?e.name=""+Yt(z):e.removeAttribute("name")}function Xu(e,t,s,n,l,_,D,z){if(_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(e.type=_),t!=null||s!=null){if(!(_!=="submit"&&_!=="reset"||t!=null)){Zo(e);return}s=s!=null?""+Yt(s):"",t=t!=null?""+Yt(t):s,z||t===e.value||(e.value=t),e.defaultValue=t}n=n??l,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),Zo(e)}function Fo(e,t,s){t==="number"&&ea(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function Qs(e,t,s,n){if(e=e.options,t){t={};for(var l=0;l<s.length;l++)t["$"+s[l]]=!0;for(s=0;s<e.length;s++)l=t.hasOwnProperty("$"+e[s].value),e[s].selected!==l&&(e[s].selected=l),l&&n&&(e[s].defaultSelected=!0)}else{for(s=""+Yt(s),t=null,l=0;l<e.length;l++){if(e[l].value===s){e[l].selected=!0,n&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function Ju(e,t,s){if(t!=null&&(t=""+Yt(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+Yt(s):""}function Qu(e,t,s,n){if(t==null){if(n!=null){if(s!=null)throw Error(o(92));if(ee(n)){if(1<n.length)throw Error(o(93));n=n[0]}s=n}s==null&&(s=""),t=s}s=Yt(t),e.defaultValue=s,n=e.textContent,n===s&&n!==""&&n!==null&&(e.value=n),Zo(e)}function er(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var cv=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,s){var n=t.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,s):typeof s!="number"||s===0||cv.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function th(e,t,s){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,s!=null){for(var n in s)!s.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var l in t)n=t[l],t.hasOwnProperty(l)&&s[l]!==n&&eh(e,l,n)}else for(var _ in t)t.hasOwnProperty(_)&&eh(e,_,t[_])}function Ko(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 uv=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"]]),hv=/^[\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 ta(e){return hv.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ci(){}var Vo=null;function Go(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var tr=null,ir=null;function ih(e){var t=Ws(e);if(t&&(e=t.stateNode)){var s=e[Dt]||null;e:switch(e=t.stateNode,t.type){case"input":if(qo(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Wt(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var n=s[t];if(n!==e&&n.form===e.form){var l=n[Dt]||null;if(!l)throw Error(o(90));qo(n,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name)}}for(t=0;t<s.length;t++)n=s[t],n.form===e.form&&Wu(n)}break e;case"textarea":Ju(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&Qs(e,!!s.multiple,t,!1)}}}var Yo=!1;function sh(e,t,s){if(Yo)return e(t,s);Yo=!0;try{var n=e(t);return n}finally{if(Yo=!1,(tr!==null||ir!==null)&&($a(),tr&&(t=tr,e=ir,ir=tr=null,ih(t),e)))for(t=0;t<e.length;t++)ih(e[t])}}function qr(e,t){var s=e.stateNode;if(s===null)return null;var n=s[Dt]||null;if(n===null)return null;s=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(s&&typeof s!="function")throw Error(o(231,t,typeof s));return s}var wi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Wo=!1;if(wi)try{var Fr={};Object.defineProperty(Fr,"passive",{get:function(){Wo=!0}}),window.addEventListener("test",Fr,Fr),window.removeEventListener("test",Fr,Fr)}catch{Wo=!1}var Fi=null,Xo=null,ia=null;function rh(){if(ia)return ia;var e,t=Xo,s=t.length,n,l="value"in Fi?Fi.value:Fi.textContent,_=l.length;for(e=0;e<s&&t[e]===l[e];e++);var D=s-e;for(n=1;n<=D&&t[s-n]===l[_-n];n++);return ia=l.slice(e,1<n?1-n:void 0)}function sa(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 ra(){return!0}function nh(){return!1}function Ot(e){function t(s,n,l,_,D){this._reactName=s,this._targetInst=l,this.type=n,this.nativeEvent=_,this.target=D,this.currentTarget=null;for(var z in e)e.hasOwnProperty(z)&&(s=e[z],this[z]=s?s(_):_[z]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?ra:nh,this.isPropagationStopped=nh,this}return d(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=ra)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=ra)},persist:function(){},isPersistent:ra}),t}var Ts={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},na=Ot(Ts),Kr=d({},Ts,{view:0,detail:0}),fv=Ot(Kr),Jo,Qo,Vr,aa=d({},Kr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:tl,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!==Vr&&(Vr&&e.type==="mousemove"?(Jo=e.screenX-Vr.screenX,Qo=e.screenY-Vr.screenY):Qo=Jo=0,Vr=e),Jo)},movementY:function(e){return"movementY"in e?e.movementY:Qo}}),ah=Ot(aa),dv=d({},aa,{dataTransfer:0}),mv=Ot(dv),_v=d({},Kr,{relatedTarget:0}),el=Ot(_v),pv=d({},Ts,{animationName:0,elapsedTime:0,pseudoElement:0}),vv=Ot(pv),gv=d({},Ts,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),yv=Ot(gv),bv=d({},Ts,{data:0}),oh=Ot(bv),Sv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},xv={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"},Cv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function wv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Cv[e])?!!t[e]:!1}function tl(){return wv}var Ev=d({},Kr,{key:function(e){if(e.key){var t=Sv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=sa(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?xv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:tl,charCode:function(e){return e.type==="keypress"?sa(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?sa(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),kv=Ot(Ev),Tv=d({},aa,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),lh=Ot(Tv),Av=d({},Kr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:tl}),Rv=Ot(Av),Dv=d({},Ts,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ov=Ot(Dv),Mv=d({},aa,{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}),Lv=Ot(Mv),Nv=d({},Ts,{newState:0,oldState:0}),jv=Ot(Nv),Bv=[9,13,27,32],il=wi&&"CompositionEvent"in window,Gr=null;wi&&"documentMode"in document&&(Gr=document.documentMode);var zv=wi&&"TextEvent"in window&&!Gr,ch=wi&&(!il||Gr&&8<Gr&&11>=Gr),uh=" ",hh=!1;function fh(e,t){switch(e){case"keyup":return Bv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function dh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var sr=!1;function Hv(e,t){switch(e){case"compositionend":return dh(t);case"keypress":return t.which!==32?null:(hh=!0,uh);case"textInput":return e=t.data,e===uh&&hh?null:e;default:return null}}function Uv(e,t){if(sr)return e==="compositionend"||!il&&fh(e,t)?(e=rh(),ia=Xo=Fi=null,sr=!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 ch&&t.locale!=="ko"?null:t.data;default:return null}}var Iv={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 mh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Iv[e.type]:t==="textarea"}function _h(e,t,s,n){tr?ir?ir.push(n):ir=[n]:tr=n,t=Ya(t,"onChange"),0<t.length&&(s=new na("onChange","change",null,s,n),e.push({event:s,listeners:t}))}var Yr=null,Wr=null;function Pv(e){Jd(e,0)}function oa(e){var t=Zr(e);if(Wu(t))return e}function ph(e,t){if(e==="change")return t}var vh=!1;if(wi){var sl;if(wi){var rl="oninput"in document;if(!rl){var gh=document.createElement("div");gh.setAttribute("oninput","return;"),rl=typeof gh.oninput=="function"}sl=rl}else sl=!1;vh=sl&&(!document.documentMode||9<document.documentMode)}function yh(){Yr&&(Yr.detachEvent("onpropertychange",bh),Wr=Yr=null)}function bh(e){if(e.propertyName==="value"&&oa(Wr)){var t=[];_h(t,Wr,e,Go(e)),sh(Pv,t)}}function $v(e,t,s){e==="focusin"?(yh(),Yr=t,Wr=s,Yr.attachEvent("onpropertychange",bh)):e==="focusout"&&yh()}function Zv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return oa(Wr)}function qv(e,t){if(e==="click")return oa(t)}function Fv(e,t){if(e==="input"||e==="change")return oa(t)}function Kv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Pt=typeof Object.is=="function"?Object.is:Kv;function Xr(e,t){if(Pt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),n=Object.keys(t);if(s.length!==n.length)return!1;for(n=0;n<s.length;n++){var l=s[n];if(!At.call(t,l)||!Pt(e[l],t[l]))return!1}return!0}function Sh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function xh(e,t){var s=Sh(e);e=0;for(var n;s;){if(s.nodeType===3){if(n=e+s.textContent.length,e<=t&&n>=t)return{node:s,offset:t-e};e=n}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Sh(s)}}function Ch(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ch(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function wh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ea(e.document);t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=ea(e.document)}return t}function nl(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 Vv=wi&&"documentMode"in document&&11>=document.documentMode,rr=null,al=null,Jr=null,ol=!1;function Eh(e,t,s){var n=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;ol||rr==null||rr!==ea(n)||(n=rr,"selectionStart"in n&&nl(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}),Jr&&Xr(Jr,n)||(Jr=n,n=Ya(al,"onSelect"),0<n.length&&(t=new na("onSelect","select",null,t,s),e.push({event:t,listeners:n}),t.target=rr)))}function As(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var nr={animationend:As("Animation","AnimationEnd"),animationiteration:As("Animation","AnimationIteration"),animationstart:As("Animation","AnimationStart"),transitionrun:As("Transition","TransitionRun"),transitionstart:As("Transition","TransitionStart"),transitioncancel:As("Transition","TransitionCancel"),transitionend:As("Transition","TransitionEnd")},ll={},kh={};wi&&(kh=document.createElement("div").style,"AnimationEvent"in window||(delete nr.animationend.animation,delete nr.animationiteration.animation,delete nr.animationstart.animation),"TransitionEvent"in window||delete nr.transitionend.transition);function Rs(e){if(ll[e])return ll[e];if(!nr[e])return e;var t=nr[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in kh)return ll[e]=t[s];return e}var Th=Rs("animationend"),Ah=Rs("animationiteration"),Rh=Rs("animationstart"),Gv=Rs("transitionrun"),Yv=Rs("transitionstart"),Wv=Rs("transitioncancel"),Dh=Rs("transitionend"),Oh=new Map,cl="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(" ");cl.push("scrollEnd");function li(e,t){Oh.set(e,t),ks(t,[e])}var la=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)},Xt=[],ar=0,ul=0;function ca(){for(var e=ar,t=ul=ar=0;t<e;){var s=Xt[t];Xt[t++]=null;var n=Xt[t];Xt[t++]=null;var l=Xt[t];Xt[t++]=null;var _=Xt[t];if(Xt[t++]=null,n!==null&&l!==null){var D=n.pending;D===null?l.next=l:(l.next=D.next,D.next=l),n.pending=l}_!==0&&Mh(s,l,_)}}function ua(e,t,s,n){Xt[ar++]=e,Xt[ar++]=t,Xt[ar++]=s,Xt[ar++]=n,ul|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function hl(e,t,s,n){return ua(e,t,s,n),ha(e)}function Ds(e,t){return ua(e,null,null,t),ha(e)}function Mh(e,t,s){e.lanes|=s;var n=e.alternate;n!==null&&(n.lanes|=s);for(var l=!1,_=e.return;_!==null;)_.childLanes|=s,n=_.alternate,n!==null&&(n.childLanes|=s),_.tag===22&&(e=_.stateNode,e===null||e._visibility&1||(l=!0)),e=_,_=_.return;return e.tag===3?(_=e.stateNode,l&&t!==null&&(l=31-It(s),e=_.hiddenUpdates,n=e[l],n===null?e[l]=[t]:n.push(t),t.lane=s|536870912),_):null}function ha(e){if(50<Sn)throw Sn=0,bc=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var or={};function Xv(e,t,s,n){this.tag=e,this.key=s,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 $t(e,t,s,n){return new Xv(e,t,s,n)}function fl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ei(e,t){var s=e.alternate;return s===null?(s=$t(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function Lh(e,t){e.flags&=65011714;var s=e.alternate;return s===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=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,t=s.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function fa(e,t,s,n,l,_){var D=0;if(n=e,typeof e=="function")fl(e)&&(D=1);else if(typeof e=="string")D=i0(e,s,Y.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case N:return e=$t(31,s,t,l),e.elementType=N,e.lanes=_,e;case x:return Os(s.children,l,_,t);case m:D=8,l|=24;break;case p:return e=$t(12,s,t,l|2),e.elementType=p,e.lanes=_,e;case R:return e=$t(13,s,t,l),e.elementType=R,e.lanes=_,e;case A:return e=$t(19,s,t,l),e.elementType=A,e.lanes=_,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case v:D=10;break e;case f:D=9;break e;case S:D=11;break e;case M:D=14;break e;case w:D=16,n=null;break e}D=29,s=Error(o(130,e===null?"null":typeof e,"")),n=null}return t=$t(D,s,t,l),t.elementType=e,t.type=n,t.lanes=_,t}function Os(e,t,s,n){return e=$t(7,e,n,t),e.lanes=s,e}function dl(e,t,s){return e=$t(6,e,null,t),e.lanes=s,e}function Nh(e){var t=$t(18,null,null,0);return t.stateNode=e,t}function ml(e,t,s){return t=$t(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var jh=new WeakMap;function Jt(e,t){if(typeof e=="object"&&e!==null){var s=jh.get(e);return s!==void 0?s:(t={value:e,source:t,stack:pe(t)},jh.set(e,t),t)}return{value:e,source:t,stack:pe(t)}}var lr=[],cr=0,da=null,Qr=0,Qt=[],ei=0,Ki=null,_i=1,pi="";function ki(e,t){lr[cr++]=Qr,lr[cr++]=da,da=e,Qr=t}function Bh(e,t,s){Qt[ei++]=_i,Qt[ei++]=pi,Qt[ei++]=Ki,Ki=e;var n=_i;e=pi;var l=32-It(n)-1;n&=~(1<<l),s+=1;var _=32-It(t)+l;if(30<_){var D=l-l%5;_=(n&(1<<D)-1).toString(32),n>>=D,l-=D,_i=1<<32-It(t)+l|s<<l|n,pi=_+e}else _i=1<<_|s<<l|n,pi=e}function _l(e){e.return!==null&&(ki(e,1),Bh(e,1,0))}function pl(e){for(;e===da;)da=lr[--cr],lr[cr]=null,Qr=lr[--cr],lr[cr]=null;for(;e===Ki;)Ki=Qt[--ei],Qt[ei]=null,pi=Qt[--ei],Qt[ei]=null,_i=Qt[--ei],Qt[ei]=null}function zh(e,t){Qt[ei++]=_i,Qt[ei++]=pi,Qt[ei++]=Ki,_i=t.id,pi=t.overflow,Ki=e}var St=null,Ye=null,Le=!1,Vi=null,ti=!1,vl=Error(o(519));function Gi(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw en(Jt(t,e)),vl}function Hh(e){var t=e.stateNode,s=e.type,n=e.memoizedProps;switch(t[bt]=e,t[Dt]=n,s){case"dialog":De("cancel",t),De("close",t);break;case"iframe":case"object":case"embed":De("load",t);break;case"video":case"audio":for(s=0;s<Cn.length;s++)De(Cn[s],t);break;case"source":De("error",t);break;case"img":case"image":case"link":De("error",t),De("load",t);break;case"details":De("toggle",t);break;case"input":De("invalid",t),Xu(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":De("invalid",t);break;case"textarea":De("invalid",t),Qu(t,n.value,n.defaultValue,n.children)}s=n.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||t.textContent===""+s||n.suppressHydrationWarning===!0||im(t.textContent,s)?(n.popover!=null&&(De("beforetoggle",t),De("toggle",t)),n.onScroll!=null&&De("scroll",t),n.onScrollEnd!=null&&De("scrollend",t),n.onClick!=null&&(t.onclick=Ci),t=!0):t=!1,t||Gi(e,!0)}function Uh(e){for(St=e.return;St;)switch(St.tag){case 5:case 31:case 13:ti=!1;return;case 27:case 3:ti=!0;return;default:St=St.return}}function ur(e){if(e!==St)return!1;if(!Le)return Uh(e),Le=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||jc(e.type,e.memoizedProps)),s=!s),s&&Ye&&Gi(e),Uh(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Ye=hm(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Ye=hm(e)}else t===27?(t=Ye,ls(e.type)?(e=Ic,Ic=null,Ye=e):Ye=t):Ye=St?si(e.stateNode.nextSibling):null;return!0}function Ms(){Ye=St=null,Le=!1}function gl(){var e=Vi;return e!==null&&(jt===null?jt=e:jt.push.apply(jt,e),Vi=null),e}function en(e){Vi===null?Vi=[e]:Vi.push(e)}var yl=L(null),Ls=null,Ti=null;function Yi(e,t,s){$(yl,t._currentValue),t._currentValue=s}function Ai(e){e._currentValue=yl.current,B(yl)}function bl(e,t,s){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===s)break;e=e.return}}function Sl(e,t,s,n){var l=e.child;for(l!==null&&(l.return=e);l!==null;){var _=l.dependencies;if(_!==null){var D=l.child;_=_.firstContext;e:for(;_!==null;){var z=_;_=l;for(var G=0;G<t.length;G++)if(z.context===t[G]){_.lanes|=s,z=_.alternate,z!==null&&(z.lanes|=s),bl(_.return,s,e),n||(D=null);break e}_=z.next}}else if(l.tag===18){if(D=l.return,D===null)throw Error(o(341));D.lanes|=s,_=D.alternate,_!==null&&(_.lanes|=s),bl(D,s,e),D=null}else D=l.child;if(D!==null)D.return=l;else for(D=l;D!==null;){if(D===e){D=null;break}if(l=D.sibling,l!==null){l.return=D.return,D=l;break}D=D.return}l=D}}function hr(e,t,s,n){e=null;for(var l=t,_=!1;l!==null;){if(!_){if((l.flags&524288)!==0)_=!0;else if((l.flags&262144)!==0)break}if(l.tag===10){var D=l.alternate;if(D===null)throw Error(o(387));if(D=D.memoizedProps,D!==null){var z=l.type;Pt(l.pendingProps.value,D.value)||(e!==null?e.push(z):e=[z])}}else if(l===V.current){if(D=l.alternate,D===null)throw Error(o(387));D.memoizedState.memoizedState!==l.memoizedState.memoizedState&&(e!==null?e.push(An):e=[An])}l=l.return}e!==null&&Sl(t,e,s,n),t.flags|=262144}function ma(e){for(e=e.firstContext;e!==null;){if(!Pt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ns(e){Ls=e,Ti=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function xt(e){return Ih(Ls,e)}function _a(e,t){return Ls===null&&Ns(e),Ih(e,t)}function Ih(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},Ti===null){if(e===null)throw Error(o(308));Ti=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ti=Ti.next=t;return s}var Jv=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(s,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(s){return s()})}},Qv=i.unstable_scheduleCallback,eg=i.unstable_NormalPriority,ut={$$typeof:v,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function xl(){return{controller:new Jv,data:new Map,refCount:0}}function tn(e){e.refCount--,e.refCount===0&&Qv(eg,function(){e.controller.abort()})}var sn=null,Cl=0,fr=0,dr=null;function tg(e,t){if(sn===null){var s=sn=[];Cl=0,fr=kc(),dr={status:"pending",value:void 0,then:function(n){s.push(n)}}}return Cl++,t.then(Ph,Ph),t}function Ph(){if(--Cl===0&&sn!==null){dr!==null&&(dr.status="fulfilled");var e=sn;sn=null,fr=0,dr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ig(e,t){var s=[],n={status:"pending",value:null,reason:null,then:function(l){s.push(l)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var l=0;l<s.length;l++)(0,s[l])(t)},function(l){for(n.status="rejected",n.reason=l,l=0;l<s.length;l++)(0,s[l])(void 0)}),n}var $h=F.S;F.S=function(e,t){kd=pt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&tg(e,t),$h!==null&&$h(e,t)};var js=L(null);function wl(){var e=js.current;return e!==null?e:Ve.pooledCache}function pa(e,t){t===null?$(js,js.current):$(js,t.pool)}function Zh(){var e=wl();return e===null?null:{parent:ut._currentValue,pool:e}}var mr=Error(o(460)),El=Error(o(474)),va=Error(o(542)),ga={then:function(){}};function qh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Fh(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(Ci,Ci),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Vh(e),e;default:if(typeof t.status=="string")t.then(Ci,Ci);else{if(e=Ve,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var l=t;l.status="fulfilled",l.value=n}},function(n){if(t.status==="pending"){var l=t;l.status="rejected",l.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Vh(e),e}throw zs=t,mr}}function Bs(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(zs=s,mr):s}}var zs=null;function Kh(){if(zs===null)throw Error(o(459));var e=zs;return zs=null,e}function Vh(e){if(e===mr||e===va)throw Error(o(483))}var _r=null,rn=0;function ya(e){var t=rn;return rn+=1,_r===null&&(_r=[]),Fh(_r,e,t)}function nn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ba(e,t){throw t.$$typeof===C?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Gh(e){function t(X,W){if(e){var te=X.deletions;te===null?(X.deletions=[W],X.flags|=16):te.push(W)}}function s(X,W){if(!e)return null;for(;W!==null;)t(X,W),W=W.sibling;return null}function n(X){for(var W=new Map;X!==null;)X.key!==null?W.set(X.key,X):W.set(X.index,X),X=X.sibling;return W}function l(X,W){return X=Ei(X,W),X.index=0,X.sibling=null,X}function _(X,W,te){return X.index=te,e?(te=X.alternate,te!==null?(te=te.index,te<W?(X.flags|=67108866,W):te):(X.flags|=67108866,W)):(X.flags|=1048576,W)}function D(X){return e&&X.alternate===null&&(X.flags|=67108866),X}function z(X,W,te,ue){return W===null||W.tag!==6?(W=dl(te,X.mode,ue),W.return=X,W):(W=l(W,te),W.return=X,W)}function G(X,W,te,ue){var ye=te.type;return ye===x?le(X,W,te.props.children,ue,te.key):W!==null&&(W.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===w&&Bs(ye)===W.type)?(W=l(W,te.props),nn(W,te),W.return=X,W):(W=fa(te.type,te.key,te.props,null,X.mode,ue),nn(W,te),W.return=X,W)}function ie(X,W,te,ue){return W===null||W.tag!==4||W.stateNode.containerInfo!==te.containerInfo||W.stateNode.implementation!==te.implementation?(W=ml(te,X.mode,ue),W.return=X,W):(W=l(W,te.children||[]),W.return=X,W)}function le(X,W,te,ue,ye){return W===null||W.tag!==7?(W=Os(te,X.mode,ue,ye),W.return=X,W):(W=l(W,te),W.return=X,W)}function de(X,W,te){if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return W=dl(""+W,X.mode,te),W.return=X,W;if(typeof W=="object"&&W!==null){switch(W.$$typeof){case E:return te=fa(W.type,W.key,W.props,null,X.mode,te),nn(te,W),te.return=X,te;case O:return W=ml(W,X.mode,te),W.return=X,W;case w:return W=Bs(W),de(X,W,te)}if(ee(W)||K(W))return W=Os(W,X.mode,te,null),W.return=X,W;if(typeof W.then=="function")return de(X,ya(W),te);if(W.$$typeof===v)return de(X,_a(X,W),te);ba(X,W)}return null}function se(X,W,te,ue){var ye=W!==null?W.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return ye!==null?null:z(X,W,""+te,ue);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case E:return te.key===ye?G(X,W,te,ue):null;case O:return te.key===ye?ie(X,W,te,ue):null;case w:return te=Bs(te),se(X,W,te,ue)}if(ee(te)||K(te))return ye!==null?null:le(X,W,te,ue,null);if(typeof te.then=="function")return se(X,W,ya(te),ue);if(te.$$typeof===v)return se(X,W,_a(X,te),ue);ba(X,te)}return null}function ae(X,W,te,ue,ye){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return X=X.get(te)||null,z(W,X,""+ue,ye);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case E:return X=X.get(ue.key===null?te:ue.key)||null,G(W,X,ue,ye);case O:return X=X.get(ue.key===null?te:ue.key)||null,ie(W,X,ue,ye);case w:return ue=Bs(ue),ae(X,W,te,ue,ye)}if(ee(ue)||K(ue))return X=X.get(te)||null,le(W,X,ue,ye,null);if(typeof ue.then=="function")return ae(X,W,te,ya(ue),ye);if(ue.$$typeof===v)return ae(X,W,te,_a(W,ue),ye);ba(W,ue)}return null}function ve(X,W,te,ue){for(var ye=null,Be=null,ge=W,ke=W=0,Me=null;ge!==null&&ke<te.length;ke++){ge.index>ke?(Me=ge,ge=null):Me=ge.sibling;var ze=se(X,ge,te[ke],ue);if(ze===null){ge===null&&(ge=Me);break}e&&ge&&ze.alternate===null&&t(X,ge),W=_(ze,W,ke),Be===null?ye=ze:Be.sibling=ze,Be=ze,ge=Me}if(ke===te.length)return s(X,ge),Le&&ki(X,ke),ye;if(ge===null){for(;ke<te.length;ke++)ge=de(X,te[ke],ue),ge!==null&&(W=_(ge,W,ke),Be===null?ye=ge:Be.sibling=ge,Be=ge);return Le&&ki(X,ke),ye}for(ge=n(ge);ke<te.length;ke++)Me=ae(ge,X,ke,te[ke],ue),Me!==null&&(e&&Me.alternate!==null&&ge.delete(Me.key===null?ke:Me.key),W=_(Me,W,ke),Be===null?ye=Me:Be.sibling=Me,Be=Me);return e&&ge.forEach(function(ds){return t(X,ds)}),Le&&ki(X,ke),ye}function Se(X,W,te,ue){if(te==null)throw Error(o(151));for(var ye=null,Be=null,ge=W,ke=W=0,Me=null,ze=te.next();ge!==null&&!ze.done;ke++,ze=te.next()){ge.index>ke?(Me=ge,ge=null):Me=ge.sibling;var ds=se(X,ge,ze.value,ue);if(ds===null){ge===null&&(ge=Me);break}e&&ge&&ds.alternate===null&&t(X,ge),W=_(ds,W,ke),Be===null?ye=ds:Be.sibling=ds,Be=ds,ge=Me}if(ze.done)return s(X,ge),Le&&ki(X,ke),ye;if(ge===null){for(;!ze.done;ke++,ze=te.next())ze=de(X,ze.value,ue),ze!==null&&(W=_(ze,W,ke),Be===null?ye=ze:Be.sibling=ze,Be=ze);return Le&&ki(X,ke),ye}for(ge=n(ge);!ze.done;ke++,ze=te.next())ze=ae(ge,X,ke,ze.value,ue),ze!==null&&(e&&ze.alternate!==null&&ge.delete(ze.key===null?ke:ze.key),W=_(ze,W,ke),Be===null?ye=ze:Be.sibling=ze,Be=ze);return e&&ge.forEach(function(d0){return t(X,d0)}),Le&&ki(X,ke),ye}function Ke(X,W,te,ue){if(typeof te=="object"&&te!==null&&te.type===x&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case E:e:{for(var ye=te.key;W!==null;){if(W.key===ye){if(ye=te.type,ye===x){if(W.tag===7){s(X,W.sibling),ue=l(W,te.props.children),ue.return=X,X=ue;break e}}else if(W.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===w&&Bs(ye)===W.type){s(X,W.sibling),ue=l(W,te.props),nn(ue,te),ue.return=X,X=ue;break e}s(X,W);break}else t(X,W);W=W.sibling}te.type===x?(ue=Os(te.props.children,X.mode,ue,te.key),ue.return=X,X=ue):(ue=fa(te.type,te.key,te.props,null,X.mode,ue),nn(ue,te),ue.return=X,X=ue)}return D(X);case O:e:{for(ye=te.key;W!==null;){if(W.key===ye)if(W.tag===4&&W.stateNode.containerInfo===te.containerInfo&&W.stateNode.implementation===te.implementation){s(X,W.sibling),ue=l(W,te.children||[]),ue.return=X,X=ue;break e}else{s(X,W);break}else t(X,W);W=W.sibling}ue=ml(te,X.mode,ue),ue.return=X,X=ue}return D(X);case w:return te=Bs(te),Ke(X,W,te,ue)}if(ee(te))return ve(X,W,te,ue);if(K(te)){if(ye=K(te),typeof ye!="function")throw Error(o(150));return te=ye.call(te),Se(X,W,te,ue)}if(typeof te.then=="function")return Ke(X,W,ya(te),ue);if(te.$$typeof===v)return Ke(X,W,_a(X,te),ue);ba(X,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,W!==null&&W.tag===6?(s(X,W.sibling),ue=l(W,te),ue.return=X,X=ue):(s(X,W),ue=dl(te,X.mode,ue),ue.return=X,X=ue),D(X)):s(X,W)}return function(X,W,te,ue){try{rn=0;var ye=Ke(X,W,te,ue);return _r=null,ye}catch(ge){if(ge===mr||ge===va)throw ge;var Be=$t(29,ge,null,X.mode);return Be.lanes=ue,Be.return=X,Be}finally{}}}var Hs=Gh(!0),Yh=Gh(!1),Wi=!1;function kl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Tl(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 Xi(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ji(e,t,s){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(He&2)!==0){var l=n.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),n.pending=t,t=ha(e),Mh(e,null,s),t}return ua(e,n,t,s),ha(e)}function an(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,s|=n,t.lanes=s,Iu(e,s)}}function Al(e,t){var s=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,s===n)){var l=null,_=null;if(s=s.firstBaseUpdate,s!==null){do{var D={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};_===null?l=_=D:_=_.next=D,s=s.next}while(s!==null);_===null?l=_=t:_=_.next=t}else l=_=t;s={baseState:n.baseState,firstBaseUpdate:l,lastBaseUpdate:_,shared:n.shared,callbacks:n.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}var Rl=!1;function on(){if(Rl){var e=dr;if(e!==null)throw e}}function ln(e,t,s,n){Rl=!1;var l=e.updateQueue;Wi=!1;var _=l.firstBaseUpdate,D=l.lastBaseUpdate,z=l.shared.pending;if(z!==null){l.shared.pending=null;var G=z,ie=G.next;G.next=null,D===null?_=ie:D.next=ie,D=G;var le=e.alternate;le!==null&&(le=le.updateQueue,z=le.lastBaseUpdate,z!==D&&(z===null?le.firstBaseUpdate=ie:z.next=ie,le.lastBaseUpdate=G))}if(_!==null){var de=l.baseState;D=0,le=ie=G=null,z=_;do{var se=z.lane&-536870913,ae=se!==z.lane;if(ae?(Oe&se)===se:(n&se)===se){se!==0&&se===fr&&(Rl=!0),le!==null&&(le=le.next={lane:0,tag:z.tag,payload:z.payload,callback:null,next:null});e:{var ve=e,Se=z;se=t;var Ke=s;switch(Se.tag){case 1:if(ve=Se.payload,typeof ve=="function"){de=ve.call(Ke,de,se);break e}de=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=Se.payload,se=typeof ve=="function"?ve.call(Ke,de,se):ve,se==null)break e;de=d({},de,se);break e;case 2:Wi=!0}}se=z.callback,se!==null&&(e.flags|=64,ae&&(e.flags|=8192),ae=l.callbacks,ae===null?l.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,G=de):le=le.next=ae,D|=se;if(z=z.next,z===null){if(z=l.shared.pending,z===null)break;ae=z,z=ae.next,ae.next=null,l.lastBaseUpdate=ae,l.shared.pending=null}}while(!0);le===null&&(G=de),l.baseState=G,l.firstBaseUpdate=ie,l.lastBaseUpdate=le,_===null&&(l.shared.lanes=0),ss|=D,e.lanes=D,e.memoizedState=de}}function Wh(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Xh(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)Wh(s[e],t)}var pr=L(null),Sa=L(0);function Jh(e,t){e=zi,$(Sa,e),$(pr,t),zi=e|t.baseLanes}function Dl(){$(Sa,zi),$(pr,pr.current)}function Ol(){zi=Sa.current,B(pr),B(Sa)}var Zt=L(null),ii=null;function Qi(e){var t=e.alternate;$(ot,ot.current&1),$(Zt,e),ii===null&&(t===null||pr.current!==null||t.memoizedState!==null)&&(ii=e)}function Ml(e){$(ot,ot.current),$(Zt,e),ii===null&&(ii=e)}function Qh(e){e.tag===22?($(ot,ot.current),$(Zt,e),ii===null&&(ii=e)):es()}function es(){$(ot,ot.current),$(Zt,Zt.current)}function qt(e){B(Zt),ii===e&&(ii=null),B(ot)}var ot=L(0);function xa(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Hc(s)||Uc(s)))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 Ri=0,Ee=null,qe=null,ht=null,Ca=!1,vr=!1,Us=!1,wa=0,cn=0,gr=null,sg=0;function st(){throw Error(o(321))}function Ll(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!Pt(e[s],t[s]))return!1;return!0}function Nl(e,t,s,n,l,_){return Ri=_,Ee=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,F.H=e===null||e.memoizedState===null?zf:Yl,Us=!1,_=s(n,l),Us=!1,vr&&(_=tf(t,s,n,l)),ef(e),_}function ef(e){F.H=fn;var t=qe!==null&&qe.next!==null;if(Ri=0,ht=qe=Ee=null,Ca=!1,cn=0,gr=null,t)throw Error(o(300));e===null||ft||(e=e.dependencies,e!==null&&ma(e)&&(ft=!0))}function tf(e,t,s,n){Ee=e;var l=0;do{if(vr&&(gr=null),cn=0,vr=!1,25<=l)throw Error(o(301));if(l+=1,ht=qe=null,e.updateQueue!=null){var _=e.updateQueue;_.lastEffect=null,_.events=null,_.stores=null,_.memoCache!=null&&(_.memoCache.index=0)}F.H=Hf,_=t(s,n)}while(vr);return _}function rg(){var e=F.H,t=e.useState()[0];return t=typeof t.then=="function"?un(t):t,e=e.useState()[0],(qe!==null?qe.memoizedState:null)!==e&&(Ee.flags|=1024),t}function jl(){var e=wa!==0;return wa=0,e}function Bl(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function zl(e){if(Ca){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ca=!1}Ri=0,ht=qe=Ee=null,vr=!1,cn=wa=0,gr=null}function kt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ht===null?Ee.memoizedState=ht=e:ht=ht.next=e,ht}function lt(){if(qe===null){var e=Ee.alternate;e=e!==null?e.memoizedState:null}else e=qe.next;var t=ht===null?Ee.memoizedState:ht.next;if(t!==null)ht=t,qe=e;else{if(e===null)throw Ee.alternate===null?Error(o(467)):Error(o(310));qe=e,e={memoizedState:qe.memoizedState,baseState:qe.baseState,baseQueue:qe.baseQueue,queue:qe.queue,next:null},ht===null?Ee.memoizedState=ht=e:ht=ht.next=e}return ht}function Ea(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function un(e){var t=cn;return cn+=1,gr===null&&(gr=[]),e=Fh(gr,e,t),t=Ee,(ht===null?t.memoizedState:ht.next)===null&&(t=t.alternate,F.H=t===null||t.memoizedState===null?zf:Yl),e}function ka(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return un(e);if(e.$$typeof===v)return xt(e)}throw Error(o(438,String(e)))}function Hl(e){var t=null,s=Ee.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var n=Ee.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(l){return l.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=Ea(),Ee.updateQueue=s),s.memoCache=t,s=t.data[t.index],s===void 0)for(s=t.data[t.index]=Array(e),n=0;n<e;n++)s[n]=I;return t.index++,s}function Di(e,t){return typeof t=="function"?t(e):t}function Ta(e){var t=lt();return Ul(t,qe,e)}function Ul(e,t,s){var n=e.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=s;var l=e.baseQueue,_=n.pending;if(_!==null){if(l!==null){var D=l.next;l.next=_.next,_.next=D}t.baseQueue=l=_,n.pending=null}if(_=e.baseState,l===null)e.memoizedState=_;else{t=l.next;var z=D=null,G=null,ie=t,le=!1;do{var de=ie.lane&-536870913;if(de!==ie.lane?(Oe&de)===de:(Ri&de)===de){var se=ie.revertLane;if(se===0)G!==null&&(G=G.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),de===fr&&(le=!0);else if((Ri&se)===se){ie=ie.next,se===fr&&(le=!0);continue}else de={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},G===null?(z=G=de,D=_):G=G.next=de,Ee.lanes|=se,ss|=se;de=ie.action,Us&&s(_,de),_=ie.hasEagerState?ie.eagerState:s(_,de)}else se={lane:de,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},G===null?(z=G=se,D=_):G=G.next=se,Ee.lanes|=de,ss|=de;ie=ie.next}while(ie!==null&&ie!==t);if(G===null?D=_:G.next=z,!Pt(_,e.memoizedState)&&(ft=!0,le&&(s=dr,s!==null)))throw s;e.memoizedState=_,e.baseState=D,e.baseQueue=G,n.lastRenderedState=_}return l===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function Il(e){var t=lt(),s=t.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=e;var n=s.dispatch,l=s.pending,_=t.memoizedState;if(l!==null){s.pending=null;var D=l=l.next;do _=e(_,D.action),D=D.next;while(D!==l);Pt(_,t.memoizedState)||(ft=!0),t.memoizedState=_,t.baseQueue===null&&(t.baseState=_),s.lastRenderedState=_}return[_,n]}function sf(e,t,s){var n=Ee,l=lt(),_=Le;if(_){if(s===void 0)throw Error(o(407));s=s()}else s=t();var D=!Pt((qe||l).memoizedState,s);if(D&&(l.memoizedState=s,ft=!0),l=l.queue,Zl(af.bind(null,n,l,e),[e]),l.getSnapshot!==t||D||ht!==null&&ht.memoizedState.tag&1){if(n.flags|=2048,yr(9,{destroy:void 0},nf.bind(null,n,l,s,t),null),Ve===null)throw Error(o(349));_||(Ri&127)!==0||rf(n,t,s)}return s}function rf(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=Ee.updateQueue,t===null?(t=Ea(),Ee.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function nf(e,t,s,n){t.value=s,t.getSnapshot=n,of(t)&&lf(e)}function af(e,t,s){return s(function(){of(t)&&lf(e)})}function of(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!Pt(e,s)}catch{return!0}}function lf(e){var t=Ds(e,2);t!==null&&Bt(t,e,2)}function Pl(e){var t=kt();if(typeof e=="function"){var s=e;if(e=s(),Us){Zi(!0);try{s()}finally{Zi(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Di,lastRenderedState:e},t}function cf(e,t,s,n){return e.baseState=s,Ul(e,qe,typeof n=="function"?n:Di)}function ng(e,t,s,n,l){if(Da(e))throw Error(o(485));if(e=t.action,e!==null){var _={payload:l,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(D){_.listeners.push(D)}};F.T!==null?s(!0):_.isTransition=!1,n(_),s=t.pending,s===null?(_.next=t.pending=_,uf(t,_)):(_.next=s.next,t.pending=s.next=_)}}function uf(e,t){var s=t.action,n=t.payload,l=e.state;if(t.isTransition){var _=F.T,D={};F.T=D;try{var z=s(l,n),G=F.S;G!==null&&G(D,z),hf(e,t,z)}catch(ie){$l(e,t,ie)}finally{_!==null&&D.types!==null&&(_.types=D.types),F.T=_}}else try{_=s(l,n),hf(e,t,_)}catch(ie){$l(e,t,ie)}}function hf(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(n){ff(e,t,n)},function(n){return $l(e,t,n)}):ff(e,t,s)}function ff(e,t,s){t.status="fulfilled",t.value=s,df(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,uf(e,s)))}function $l(e,t,s){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=s,df(t),t=t.next;while(t!==n)}e.action=null}function df(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function mf(e,t){return t}function _f(e,t){if(Le){var s=Ve.formState;if(s!==null){e:{var n=Ee;if(Le){if(Ye){t:{for(var l=Ye,_=ti;l.nodeType!==8;){if(!_){l=null;break t}if(l=si(l.nextSibling),l===null){l=null;break t}}_=l.data,l=_==="F!"||_==="F"?l:null}if(l){Ye=si(l.nextSibling),n=l.data==="F!";break e}}Gi(n)}n=!1}n&&(t=s[0])}}return s=kt(),s.memoizedState=s.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:mf,lastRenderedState:t},s.queue=n,s=Nf.bind(null,Ee,n),n.dispatch=s,n=Pl(!1),_=Gl.bind(null,Ee,!1,n.queue),n=kt(),l={state:t,dispatch:null,action:e,pending:null},n.queue=l,s=ng.bind(null,Ee,l,_,s),l.dispatch=s,n.memoizedState=e,[t,s,!1]}function pf(e){var t=lt();return vf(t,qe,e)}function vf(e,t,s){if(t=Ul(e,t,mf)[0],e=Ta(Di)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=un(t)}catch(D){throw D===mr?va:D}else n=t;t=lt();var l=t.queue,_=l.dispatch;return s!==t.memoizedState&&(Ee.flags|=2048,yr(9,{destroy:void 0},ag.bind(null,l,s),null)),[n,_,e]}function ag(e,t){e.action=t}function gf(e){var t=lt(),s=qe;if(s!==null)return vf(t,s,e);lt(),t=t.memoizedState,s=lt();var n=s.queue.dispatch;return s.memoizedState=e,[t,n,!1]}function yr(e,t,s,n){return e={tag:e,create:s,deps:n,inst:t,next:null},t=Ee.updateQueue,t===null&&(t=Ea(),Ee.updateQueue=t),s=t.lastEffect,s===null?t.lastEffect=e.next=e:(n=s.next,s.next=e,e.next=n,t.lastEffect=e),e}function yf(){return lt().memoizedState}function Aa(e,t,s,n){var l=kt();Ee.flags|=e,l.memoizedState=yr(1|t,{destroy:void 0},s,n===void 0?null:n)}function Ra(e,t,s,n){var l=lt();n=n===void 0?null:n;var _=l.memoizedState.inst;qe!==null&&n!==null&&Ll(n,qe.memoizedState.deps)?l.memoizedState=yr(t,_,s,n):(Ee.flags|=e,l.memoizedState=yr(1|t,_,s,n))}function bf(e,t){Aa(8390656,8,e,t)}function Zl(e,t){Ra(2048,8,e,t)}function og(e){Ee.flags|=4;var t=Ee.updateQueue;if(t===null)t=Ea(),Ee.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function Sf(e){var t=lt().memoizedState;return og({ref:t,nextImpl:e}),function(){if((He&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function xf(e,t){return Ra(4,2,e,t)}function Cf(e,t){return Ra(4,4,e,t)}function wf(e,t){if(typeof t=="function"){e=e();var s=t(e);return function(){typeof s=="function"?s():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Ef(e,t,s){s=s!=null?s.concat([e]):null,Ra(4,4,wf.bind(null,t,e),s)}function ql(){}function kf(e,t){var s=lt();t=t===void 0?null:t;var n=s.memoizedState;return t!==null&&Ll(t,n[1])?n[0]:(s.memoizedState=[e,t],e)}function Tf(e,t){var s=lt();t=t===void 0?null:t;var n=s.memoizedState;if(t!==null&&Ll(t,n[1]))return n[0];if(n=e(),Us){Zi(!0);try{e()}finally{Zi(!1)}}return s.memoizedState=[n,t],n}function Fl(e,t,s){return s===void 0||(Ri&1073741824)!==0&&(Oe&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=Ad(),Ee.lanes|=e,ss|=e,s)}function Af(e,t,s,n){return Pt(s,t)?s:pr.current!==null?(e=Fl(e,s,n),Pt(e,t)||(ft=!0),e):(Ri&42)===0||(Ri&1073741824)!==0&&(Oe&261930)===0?(ft=!0,e.memoizedState=s):(e=Ad(),Ee.lanes|=e,ss|=e,t)}function Rf(e,t,s,n,l){var _=Q.p;Q.p=_!==0&&8>_?_:8;var D=F.T,z={};F.T=z,Gl(e,!1,t,s);try{var G=l(),ie=F.S;if(ie!==null&&ie(z,G),G!==null&&typeof G=="object"&&typeof G.then=="function"){var le=ig(G,n);hn(e,t,le,Vt(e))}else hn(e,t,n,Vt(e))}catch(de){hn(e,t,{then:function(){},status:"rejected",reason:de},Vt())}finally{Q.p=_,D!==null&&z.types!==null&&(D.types=z.types),F.T=D}}function lg(){}function Kl(e,t,s,n){if(e.tag!==5)throw Error(o(476));var l=Df(e).queue;Rf(e,l,t,ne,s===null?lg:function(){return Of(e),s(n)})}function Df(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Di,lastRenderedState:ne},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Di,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Of(e){var t=Df(e);t.next===null&&(t=e.alternate.memoizedState),hn(e,t.next.queue,{},Vt())}function Vl(){return xt(An)}function Mf(){return lt().memoizedState}function Lf(){return lt().memoizedState}function cg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=Vt();e=Xi(s);var n=Ji(t,e,s);n!==null&&(Bt(n,t,s),an(n,t,s)),t={cache:xl()},e.payload=t;return}t=t.return}}function ug(e,t,s){var n=Vt();s={lane:n,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Da(e)?jf(t,s):(s=hl(e,t,s,n),s!==null&&(Bt(s,e,n),Bf(s,t,n)))}function Nf(e,t,s){var n=Vt();hn(e,t,s,n)}function hn(e,t,s,n){var l={lane:n,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Da(e))jf(t,l);else{var _=e.alternate;if(e.lanes===0&&(_===null||_.lanes===0)&&(_=t.lastRenderedReducer,_!==null))try{var D=t.lastRenderedState,z=_(D,s);if(l.hasEagerState=!0,l.eagerState=z,Pt(z,D))return ua(e,t,l,0),Ve===null&&ca(),!1}catch{}finally{}if(s=hl(e,t,l,n),s!==null)return Bt(s,e,n),Bf(s,t,n),!0}return!1}function Gl(e,t,s,n){if(n={lane:2,revertLane:kc(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Da(e)){if(t)throw Error(o(479))}else t=hl(e,s,n,2),t!==null&&Bt(t,e,2)}function Da(e){var t=e.alternate;return e===Ee||t!==null&&t===Ee}function jf(e,t){vr=Ca=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function Bf(e,t,s){if((s&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,s|=n,t.lanes=s,Iu(e,s)}}var fn={readContext:xt,use:ka,useCallback:st,useContext:st,useEffect:st,useImperativeHandle:st,useLayoutEffect:st,useInsertionEffect:st,useMemo:st,useReducer:st,useRef:st,useState:st,useDebugValue:st,useDeferredValue:st,useTransition:st,useSyncExternalStore:st,useId:st,useHostTransitionStatus:st,useFormState:st,useActionState:st,useOptimistic:st,useMemoCache:st,useCacheRefresh:st};fn.useEffectEvent=st;var zf={readContext:xt,use:ka,useCallback:function(e,t){return kt().memoizedState=[e,t===void 0?null:t],e},useContext:xt,useEffect:bf,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,Aa(4194308,4,wf.bind(null,t,e),s)},useLayoutEffect:function(e,t){return Aa(4194308,4,e,t)},useInsertionEffect:function(e,t){Aa(4,2,e,t)},useMemo:function(e,t){var s=kt();t=t===void 0?null:t;var n=e();if(Us){Zi(!0);try{e()}finally{Zi(!1)}}return s.memoizedState=[n,t],n},useReducer:function(e,t,s){var n=kt();if(s!==void 0){var l=s(t);if(Us){Zi(!0);try{s(t)}finally{Zi(!1)}}}else l=t;return n.memoizedState=n.baseState=l,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:l},n.queue=e,e=e.dispatch=ug.bind(null,Ee,e),[n.memoizedState,e]},useRef:function(e){var t=kt();return e={current:e},t.memoizedState=e},useState:function(e){e=Pl(e);var t=e.queue,s=Nf.bind(null,Ee,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:ql,useDeferredValue:function(e,t){var s=kt();return Fl(s,e,t)},useTransition:function(){var e=Pl(!1);return e=Rf.bind(null,Ee,e.queue,!0,!1),kt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var n=Ee,l=kt();if(Le){if(s===void 0)throw Error(o(407));s=s()}else{if(s=t(),Ve===null)throw Error(o(349));(Oe&127)!==0||rf(n,t,s)}l.memoizedState=s;var _={value:s,getSnapshot:t};return l.queue=_,bf(af.bind(null,n,_,e),[e]),n.flags|=2048,yr(9,{destroy:void 0},nf.bind(null,n,_,s,t),null),s},useId:function(){var e=kt(),t=Ve.identifierPrefix;if(Le){var s=pi,n=_i;s=(n&~(1<<32-It(n)-1)).toString(32)+s,t="_"+t+"R_"+s,s=wa++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=sg++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Vl,useFormState:_f,useActionState:_f,useOptimistic:function(e){var t=kt();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=Gl.bind(null,Ee,!0,s),s.dispatch=t,[e,t]},useMemoCache:Hl,useCacheRefresh:function(){return kt().memoizedState=cg.bind(null,Ee)},useEffectEvent:function(e){var t=kt(),s={impl:e};return t.memoizedState=s,function(){if((He&2)!==0)throw Error(o(440));return s.impl.apply(void 0,arguments)}}},Yl={readContext:xt,use:ka,useCallback:kf,useContext:xt,useEffect:Zl,useImperativeHandle:Ef,useInsertionEffect:xf,useLayoutEffect:Cf,useMemo:Tf,useReducer:Ta,useRef:yf,useState:function(){return Ta(Di)},useDebugValue:ql,useDeferredValue:function(e,t){var s=lt();return Af(s,qe.memoizedState,e,t)},useTransition:function(){var e=Ta(Di)[0],t=lt().memoizedState;return[typeof e=="boolean"?e:un(e),t]},useSyncExternalStore:sf,useId:Mf,useHostTransitionStatus:Vl,useFormState:pf,useActionState:pf,useOptimistic:function(e,t){var s=lt();return cf(s,qe,e,t)},useMemoCache:Hl,useCacheRefresh:Lf};Yl.useEffectEvent=Sf;var Hf={readContext:xt,use:ka,useCallback:kf,useContext:xt,useEffect:Zl,useImperativeHandle:Ef,useInsertionEffect:xf,useLayoutEffect:Cf,useMemo:Tf,useReducer:Il,useRef:yf,useState:function(){return Il(Di)},useDebugValue:ql,useDeferredValue:function(e,t){var s=lt();return qe===null?Fl(s,e,t):Af(s,qe.memoizedState,e,t)},useTransition:function(){var e=Il(Di)[0],t=lt().memoizedState;return[typeof e=="boolean"?e:un(e),t]},useSyncExternalStore:sf,useId:Mf,useHostTransitionStatus:Vl,useFormState:gf,useActionState:gf,useOptimistic:function(e,t){var s=lt();return qe!==null?cf(s,qe,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:Hl,useCacheRefresh:Lf};Hf.useEffectEvent=Sf;function Wl(e,t,s,n){t=e.memoizedState,s=s(n,t),s=s==null?t:d({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Xl={enqueueSetState:function(e,t,s){e=e._reactInternals;var n=Vt(),l=Xi(n);l.payload=t,s!=null&&(l.callback=s),t=Ji(e,l,n),t!==null&&(Bt(t,e,n),an(t,e,n))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var n=Vt(),l=Xi(n);l.tag=1,l.payload=t,s!=null&&(l.callback=s),t=Ji(e,l,n),t!==null&&(Bt(t,e,n),an(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=Vt(),n=Xi(s);n.tag=2,t!=null&&(n.callback=t),t=Ji(e,n,s),t!==null&&(Bt(t,e,s),an(t,e,s))}};function Uf(e,t,s,n,l,_,D){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,_,D):t.prototype&&t.prototype.isPureReactComponent?!Xr(s,n)||!Xr(l,_):!0}function If(e,t,s,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,n),t.state!==e&&Xl.enqueueReplaceState(t,t.state,null)}function Is(e,t){var s=t;if("ref"in t){s={};for(var n in t)n!=="ref"&&(s[n]=t[n])}if(e=e.defaultProps){s===t&&(s=d({},s));for(var l in e)s[l]===void 0&&(s[l]=e[l])}return s}function Pf(e){la(e)}function $f(e){console.error(e)}function Zf(e){la(e)}function Oa(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function qf(e,t,s){try{var n=e.onCaughtError;n(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(l){setTimeout(function(){throw l})}}function Jl(e,t,s){return s=Xi(s),s.tag=3,s.payload={element:null},s.callback=function(){Oa(e,t)},s}function Ff(e){return e=Xi(e),e.tag=3,e}function Kf(e,t,s,n){var l=s.type.getDerivedStateFromError;if(typeof l=="function"){var _=n.value;e.payload=function(){return l(_)},e.callback=function(){qf(t,s,n)}}var D=s.stateNode;D!==null&&typeof D.componentDidCatch=="function"&&(e.callback=function(){qf(t,s,n),typeof l!="function"&&(rs===null?rs=new Set([this]):rs.add(this));var z=n.stack;this.componentDidCatch(n.value,{componentStack:z!==null?z:""})})}function hg(e,t,s,n,l){if(s.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=s.alternate,t!==null&&hr(t,s,l,!0),s=Zt.current,s!==null){switch(s.tag){case 31:case 13:return ii===null?Za():s.alternate===null&&rt===0&&(rt=3),s.flags&=-257,s.flags|=65536,s.lanes=l,n===ga?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([n]):t.add(n),Cc(e,n,l)),!1;case 22:return s.flags|=65536,n===ga?s.flags|=16384:(t=s.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},s.updateQueue=t):(s=t.retryQueue,s===null?t.retryQueue=new Set([n]):s.add(n)),Cc(e,n,l)),!1}throw Error(o(435,s.tag))}return Cc(e,n,l),Za(),!1}if(Le)return t=Zt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=l,n!==vl&&(e=Error(o(422),{cause:n}),en(Jt(e,s)))):(n!==vl&&(t=Error(o(423),{cause:n}),en(Jt(t,s))),e=e.current.alternate,e.flags|=65536,l&=-l,e.lanes|=l,n=Jt(n,s),l=Jl(e.stateNode,n,l),Al(e,l),rt!==4&&(rt=2)),!1;var _=Error(o(520),{cause:n});if(_=Jt(_,s),bn===null?bn=[_]:bn.push(_),rt!==4&&(rt=2),t===null)return!0;n=Jt(n,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=l&-l,s.lanes|=e,e=Jl(s.stateNode,n,e),Al(s,e),!1;case 1:if(t=s.type,_=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(rs===null||!rs.has(_))))return s.flags|=65536,l&=-l,s.lanes|=l,l=Ff(l),Kf(l,e,s,n),Al(s,l),!1}s=s.return}while(s!==null);return!1}var Ql=Error(o(461)),ft=!1;function Ct(e,t,s,n){t.child=e===null?Yh(t,null,s,n):Hs(t,e.child,s,n)}function Vf(e,t,s,n,l){s=s.render;var _=t.ref;if("ref"in n){var D={};for(var z in n)z!=="ref"&&(D[z]=n[z])}else D=n;return Ns(t),n=Nl(e,t,s,D,_,l),z=jl(),e!==null&&!ft?(Bl(e,t,l),Oi(e,t,l)):(Le&&z&&_l(t),t.flags|=1,Ct(e,t,n,l),t.child)}function Gf(e,t,s,n,l){if(e===null){var _=s.type;return typeof _=="function"&&!fl(_)&&_.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=_,Yf(e,t,_,n,l)):(e=fa(s.type,null,n,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(_=e.child,!oc(e,l)){var D=_.memoizedProps;if(s=s.compare,s=s!==null?s:Xr,s(D,n)&&e.ref===t.ref)return Oi(e,t,l)}return t.flags|=1,e=Ei(_,n),e.ref=t.ref,e.return=t,t.child=e}function Yf(e,t,s,n,l){if(e!==null){var _=e.memoizedProps;if(Xr(_,n)&&e.ref===t.ref)if(ft=!1,t.pendingProps=n=_,oc(e,l))(e.flags&131072)!==0&&(ft=!0);else return t.lanes=e.lanes,Oi(e,t,l)}return ec(e,t,s,n,l)}function Wf(e,t,s,n){var l=n.children,_=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(_=_!==null?_.baseLanes|s:s,e!==null){for(n=t.child=e.child,l=0;n!==null;)l=l|n.lanes|n.childLanes,n=n.sibling;n=l&~_}else n=0,t.child=null;return Xf(e,t,_,s,n)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&pa(t,_!==null?_.cachePool:null),_!==null?Jh(t,_):Dl(),Qh(t);else return n=t.lanes=536870912,Xf(e,t,_!==null?_.baseLanes|s:s,s,n)}else _!==null?(pa(t,_.cachePool),Jh(t,_),es(),t.memoizedState=null):(e!==null&&pa(t,null),Dl(),es());return Ct(e,t,l,s),t.child}function dn(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Xf(e,t,s,n,l){var _=wl();return _=_===null?null:{parent:ut._currentValue,pool:_},t.memoizedState={baseLanes:s,cachePool:_},e!==null&&pa(t,null),Dl(),Qh(t),e!==null&&hr(e,t,n,!0),t.childLanes=l,null}function Ma(e,t){return t=Na({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Jf(e,t,s){return Hs(t,e.child,null,s),e=Ma(t,t.pendingProps),e.flags|=2,qt(t),t.memoizedState=null,e}function fg(e,t,s){var n=t.pendingProps,l=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Le){if(n.mode==="hidden")return e=Ma(t,n),t.lanes=536870912,dn(null,e);if(Ml(t),(e=Ye)?(e=um(e,ti),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ki!==null?{id:_i,overflow:pi}:null,retryLane:536870912,hydrationErrors:null},s=Nh(e),s.return=t,t.child=s,St=t,Ye=null)):e=null,e===null)throw Gi(t);return t.lanes=536870912,null}return Ma(t,n)}var _=e.memoizedState;if(_!==null){var D=_.dehydrated;if(Ml(t),l)if(t.flags&256)t.flags&=-257,t=Jf(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(ft||hr(e,t,s,!1),l=(s&e.childLanes)!==0,ft||l){if(n=Ve,n!==null&&(D=Pu(n,s),D!==0&&D!==_.retryLane))throw _.retryLane=D,Ds(e,D),Bt(n,e,D),Ql;Za(),t=Jf(e,t,s)}else e=_.treeContext,Ye=si(D.nextSibling),St=t,Le=!0,Vi=null,ti=!1,e!==null&&zh(t,e),t=Ma(t,n),t.flags|=4096;return t}return e=Ei(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function La(e,t){var s=t.ref;if(s===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(o(284));(e===null||e.ref!==s)&&(t.flags|=4194816)}}function ec(e,t,s,n,l){return Ns(t),s=Nl(e,t,s,n,void 0,l),n=jl(),e!==null&&!ft?(Bl(e,t,l),Oi(e,t,l)):(Le&&n&&_l(t),t.flags|=1,Ct(e,t,s,l),t.child)}function Qf(e,t,s,n,l,_){return Ns(t),t.updateQueue=null,s=tf(t,n,s,l),ef(e),n=jl(),e!==null&&!ft?(Bl(e,t,_),Oi(e,t,_)):(Le&&n&&_l(t),t.flags|=1,Ct(e,t,s,_),t.child)}function ed(e,t,s,n,l){if(Ns(t),t.stateNode===null){var _=or,D=s.contextType;typeof D=="object"&&D!==null&&(_=xt(D)),_=new s(n,_),t.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,_.updater=Xl,t.stateNode=_,_._reactInternals=t,_=t.stateNode,_.props=n,_.state=t.memoizedState,_.refs={},kl(t),D=s.contextType,_.context=typeof D=="object"&&D!==null?xt(D):or,_.state=t.memoizedState,D=s.getDerivedStateFromProps,typeof D=="function"&&(Wl(t,s,D,n),_.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(D=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),D!==_.state&&Xl.enqueueReplaceState(_,_.state,null),ln(t,n,_,l),on(),_.state=t.memoizedState),typeof _.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){_=t.stateNode;var z=t.memoizedProps,G=Is(s,z);_.props=G;var ie=_.context,le=s.contextType;D=or,typeof le=="object"&&le!==null&&(D=xt(le));var de=s.getDerivedStateFromProps;le=typeof de=="function"||typeof _.getSnapshotBeforeUpdate=="function",z=t.pendingProps!==z,le||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(z||ie!==D)&&If(t,_,n,D),Wi=!1;var se=t.memoizedState;_.state=se,ln(t,n,_,l),on(),ie=t.memoizedState,z||se!==ie||Wi?(typeof de=="function"&&(Wl(t,s,de,n),ie=t.memoizedState),(G=Wi||Uf(t,s,G,n,se,ie,D))?(le||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(t.flags|=4194308)):(typeof _.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=ie),_.props=n,_.state=ie,_.context=D,n=G):(typeof _.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{_=t.stateNode,Tl(e,t),D=t.memoizedProps,le=Is(s,D),_.props=le,de=t.pendingProps,se=_.context,ie=s.contextType,G=or,typeof ie=="object"&&ie!==null&&(G=xt(ie)),z=s.getDerivedStateFromProps,(ie=typeof z=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(D!==de||se!==G)&&If(t,_,n,G),Wi=!1,se=t.memoizedState,_.state=se,ln(t,n,_,l),on();var ae=t.memoizedState;D!==de||se!==ae||Wi||e!==null&&e.dependencies!==null&&ma(e.dependencies)?(typeof z=="function"&&(Wl(t,s,z,n),ae=t.memoizedState),(le=Wi||Uf(t,s,le,n,se,ae,G)||e!==null&&e.dependencies!==null&&ma(e.dependencies))?(ie||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(n,ae,G),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(n,ae,G)),typeof _.componentDidUpdate=="function"&&(t.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof _.componentDidUpdate!="function"||D===e.memoizedProps&&se===e.memoizedState||(t.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||D===e.memoizedProps&&se===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=ae),_.props=n,_.state=ae,_.context=G,n=le):(typeof _.componentDidUpdate!="function"||D===e.memoizedProps&&se===e.memoizedState||(t.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||D===e.memoizedProps&&se===e.memoizedState||(t.flags|=1024),n=!1)}return _=n,La(e,t),n=(t.flags&128)!==0,_||n?(_=t.stateNode,s=n&&typeof s.getDerivedStateFromError!="function"?null:_.render(),t.flags|=1,e!==null&&n?(t.child=Hs(t,e.child,null,l),t.child=Hs(t,null,s,l)):Ct(e,t,s,l),t.memoizedState=_.state,e=t.child):e=Oi(e,t,l),e}function td(e,t,s,n){return Ms(),t.flags|=256,Ct(e,t,s,n),t.child}var tc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ic(e){return{baseLanes:e,cachePool:Zh()}}function sc(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=Kt),e}function id(e,t,s){var n=t.pendingProps,l=!1,_=(t.flags&128)!==0,D;if((D=_)||(D=e!==null&&e.memoizedState===null?!1:(ot.current&2)!==0),D&&(l=!0,t.flags&=-129),D=(t.flags&32)!==0,t.flags&=-33,e===null){if(Le){if(l?Qi(t):es(),(e=Ye)?(e=um(e,ti),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ki!==null?{id:_i,overflow:pi}:null,retryLane:536870912,hydrationErrors:null},s=Nh(e),s.return=t,t.child=s,St=t,Ye=null)):e=null,e===null)throw Gi(t);return Uc(e)?t.lanes=32:t.lanes=536870912,null}var z=n.children;return n=n.fallback,l?(es(),l=t.mode,z=Na({mode:"hidden",children:z},l),n=Os(n,l,s,null),z.return=t,n.return=t,z.sibling=n,t.child=z,n=t.child,n.memoizedState=ic(s),n.childLanes=sc(e,D,s),t.memoizedState=tc,dn(null,n)):(Qi(t),rc(t,z))}var G=e.memoizedState;if(G!==null&&(z=G.dehydrated,z!==null)){if(_)t.flags&256?(Qi(t),t.flags&=-257,t=nc(e,t,s)):t.memoizedState!==null?(es(),t.child=e.child,t.flags|=128,t=null):(es(),z=n.fallback,l=t.mode,n=Na({mode:"visible",children:n.children},l),z=Os(z,l,s,null),z.flags|=2,n.return=t,z.return=t,n.sibling=z,t.child=n,Hs(t,e.child,null,s),n=t.child,n.memoizedState=ic(s),n.childLanes=sc(e,D,s),t.memoizedState=tc,t=dn(null,n));else if(Qi(t),Uc(z)){if(D=z.nextSibling&&z.nextSibling.dataset,D)var ie=D.dgst;D=ie,n=Error(o(419)),n.stack="",n.digest=D,en({value:n,source:null,stack:null}),t=nc(e,t,s)}else if(ft||hr(e,t,s,!1),D=(s&e.childLanes)!==0,ft||D){if(D=Ve,D!==null&&(n=Pu(D,s),n!==0&&n!==G.retryLane))throw G.retryLane=n,Ds(e,n),Bt(D,e,n),Ql;Hc(z)||Za(),t=nc(e,t,s)}else Hc(z)?(t.flags|=192,t.child=e.child,t=null):(e=G.treeContext,Ye=si(z.nextSibling),St=t,Le=!0,Vi=null,ti=!1,e!==null&&zh(t,e),t=rc(t,n.children),t.flags|=4096);return t}return l?(es(),z=n.fallback,l=t.mode,G=e.child,ie=G.sibling,n=Ei(G,{mode:"hidden",children:n.children}),n.subtreeFlags=G.subtreeFlags&65011712,ie!==null?z=Ei(ie,z):(z=Os(z,l,s,null),z.flags|=2),z.return=t,n.return=t,n.sibling=z,t.child=n,dn(null,n),n=t.child,z=e.child.memoizedState,z===null?z=ic(s):(l=z.cachePool,l!==null?(G=ut._currentValue,l=l.parent!==G?{parent:G,pool:G}:l):l=Zh(),z={baseLanes:z.baseLanes|s,cachePool:l}),n.memoizedState=z,n.childLanes=sc(e,D,s),t.memoizedState=tc,dn(e.child,n)):(Qi(t),s=e.child,e=s.sibling,s=Ei(s,{mode:"visible",children:n.children}),s.return=t,s.sibling=null,e!==null&&(D=t.deletions,D===null?(t.deletions=[e],t.flags|=16):D.push(e)),t.child=s,t.memoizedState=null,s)}function rc(e,t){return t=Na({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Na(e,t){return e=$t(22,e,null,t),e.lanes=0,e}function nc(e,t,s){return Hs(t,e.child,null,s),e=rc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function sd(e,t,s){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),bl(e.return,t,s)}function ac(e,t,s,n,l,_){var D=e.memoizedState;D===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:s,tailMode:l,treeForkCount:_}:(D.isBackwards=t,D.rendering=null,D.renderingStartTime=0,D.last=n,D.tail=s,D.tailMode=l,D.treeForkCount=_)}function rd(e,t,s){var n=t.pendingProps,l=n.revealOrder,_=n.tail;n=n.children;var D=ot.current,z=(D&2)!==0;if(z?(D=D&1|2,t.flags|=128):D&=1,$(ot,D),Ct(e,t,n,s),n=Le?Qr:0,!z&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&sd(e,s,t);else if(e.tag===19)sd(e,s,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(l){case"forwards":for(s=t.child,l=null;s!==null;)e=s.alternate,e!==null&&xa(e)===null&&(l=s),s=s.sibling;s=l,s===null?(l=t.child,t.child=null):(l=s.sibling,s.sibling=null),ac(t,!1,l,s,_,n);break;case"backwards":case"unstable_legacy-backwards":for(s=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&xa(e)===null){t.child=l;break}e=l.sibling,l.sibling=s,s=l,l=e}ac(t,!0,s,null,_,n);break;case"together":ac(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function Oi(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),ss|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(hr(e,t,s,!1),(s&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,s=Ei(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=Ei(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function oc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ma(e)))}function dg(e,t,s){switch(t.tag){case 3:H(t,t.stateNode.containerInfo),Yi(t,ut,e.memoizedState.cache),Ms();break;case 27:case 5:oe(t);break;case 4:H(t,t.stateNode.containerInfo);break;case 10:Yi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ml(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(Qi(t),t.flags|=128,null):(s&t.child.childLanes)!==0?id(e,t,s):(Qi(t),e=Oi(e,t,s),e!==null?e.sibling:null);Qi(t);break;case 19:var l=(e.flags&128)!==0;if(n=(s&t.childLanes)!==0,n||(hr(e,t,s,!1),n=(s&t.childLanes)!==0),l){if(n)return rd(e,t,s);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),$(ot,ot.current),n)break;return null;case 22:return t.lanes=0,Wf(e,t,s,t.pendingProps);case 24:Yi(t,ut,e.memoizedState.cache)}return Oi(e,t,s)}function nd(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)ft=!0;else{if(!oc(e,s)&&(t.flags&128)===0)return ft=!1,dg(e,t,s);ft=(e.flags&131072)!==0}else ft=!1,Le&&(t.flags&1048576)!==0&&Bh(t,Qr,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=Bs(t.elementType),t.type=e,typeof e=="function")fl(e)?(n=Is(e,n),t.tag=1,t=ed(null,t,e,n,s)):(t.tag=0,t=ec(null,t,e,n,s));else{if(e!=null){var l=e.$$typeof;if(l===S){t.tag=11,t=Vf(null,t,e,n,s);break e}else if(l===M){t.tag=14,t=Gf(null,t,e,n,s);break e}}throw t=J(e)||e,Error(o(306,t,""))}}return t;case 0:return ec(e,t,t.type,t.pendingProps,s);case 1:return n=t.type,l=Is(n,t.pendingProps),ed(e,t,n,l,s);case 3:e:{if(H(t,t.stateNode.containerInfo),e===null)throw Error(o(387));n=t.pendingProps;var _=t.memoizedState;l=_.element,Tl(e,t),ln(t,n,null,s);var D=t.memoizedState;if(n=D.cache,Yi(t,ut,n),n!==_.cache&&Sl(t,[ut],s,!0),on(),n=D.element,_.isDehydrated)if(_={element:n,isDehydrated:!1,cache:D.cache},t.updateQueue.baseState=_,t.memoizedState=_,t.flags&256){t=td(e,t,n,s);break e}else if(n!==l){l=Jt(Error(o(424)),t),en(l),t=td(e,t,n,s);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(Ye=si(e.firstChild),St=t,Le=!0,Vi=null,ti=!0,s=Yh(t,null,n,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(Ms(),n===l){t=Oi(e,t,s);break e}Ct(e,t,n,s)}t=t.child}return t;case 26:return La(e,t),e===null?(s=pm(t.type,null,t.pendingProps,null))?t.memoizedState=s:Le||(s=t.type,e=t.pendingProps,n=Wa(he.current).createElement(s),n[bt]=t,n[Dt]=e,wt(n,s,e),gt(n),t.stateNode=n):t.memoizedState=pm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return oe(t),e===null&&Le&&(n=t.stateNode=dm(t.type,t.pendingProps,he.current),St=t,ti=!0,l=Ye,ls(t.type)?(Ic=l,Ye=si(n.firstChild)):Ye=l),Ct(e,t,t.pendingProps.children,s),La(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Le&&((l=n=Ye)&&(n=Zg(n,t.type,t.pendingProps,ti),n!==null?(t.stateNode=n,St=t,Ye=si(n.firstChild),ti=!1,l=!0):l=!1),l||Gi(t)),oe(t),l=t.type,_=t.pendingProps,D=e!==null?e.memoizedProps:null,n=_.children,jc(l,_)?n=null:D!==null&&jc(l,D)&&(t.flags|=32),t.memoizedState!==null&&(l=Nl(e,t,rg,null,null,s),An._currentValue=l),La(e,t),Ct(e,t,n,s),t.child;case 6:return e===null&&Le&&((e=s=Ye)&&(s=qg(s,t.pendingProps,ti),s!==null?(t.stateNode=s,St=t,Ye=null,e=!0):e=!1),e||Gi(t)),null;case 13:return id(e,t,s);case 4:return H(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Hs(t,null,n,s):Ct(e,t,n,s),t.child;case 11:return Vf(e,t,t.type,t.pendingProps,s);case 7:return Ct(e,t,t.pendingProps,s),t.child;case 8:return Ct(e,t,t.pendingProps.children,s),t.child;case 12:return Ct(e,t,t.pendingProps.children,s),t.child;case 10:return n=t.pendingProps,Yi(t,t.type,n.value),Ct(e,t,n.children,s),t.child;case 9:return l=t.type._context,n=t.pendingProps.children,Ns(t),l=xt(l),n=n(l),t.flags|=1,Ct(e,t,n,s),t.child;case 14:return Gf(e,t,t.type,t.pendingProps,s);case 15:return Yf(e,t,t.type,t.pendingProps,s);case 19:return rd(e,t,s);case 31:return fg(e,t,s);case 22:return Wf(e,t,s,t.pendingProps);case 24:return Ns(t),n=xt(ut),e===null?(l=wl(),l===null&&(l=Ve,_=xl(),l.pooledCache=_,_.refCount++,_!==null&&(l.pooledCacheLanes|=s),l=_),t.memoizedState={parent:n,cache:l},kl(t),Yi(t,ut,l)):((e.lanes&s)!==0&&(Tl(e,t),ln(t,null,null,s),on()),l=e.memoizedState,_=t.memoizedState,l.parent!==n?(l={parent:n,cache:n},t.memoizedState=l,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=l),Yi(t,ut,n)):(n=_.cache,Yi(t,ut,n),n!==l.cache&&Sl(t,[ut],s,!0))),Ct(e,t,t.pendingProps.children,s),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function Mi(e){e.flags|=4}function lc(e,t,s,n,l){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(l&335544128)===l)if(e.stateNode.complete)e.flags|=8192;else if(Md())e.flags|=8192;else throw zs=ga,El}else e.flags&=-16777217}function ad(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Sm(t))if(Md())e.flags|=8192;else throw zs=ga,El}function ja(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Hu():536870912,e.lanes|=t,Cr|=t)}function mn(e,t){if(!Le)switch(e.tailMode){case"hidden":t=e.tail;for(var s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var n=null;s!==null;)s.alternate!==null&&(n=s),s=s.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function We(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,n=0;if(t)for(var l=e.child;l!==null;)s|=l.lanes|l.childLanes,n|=l.subtreeFlags&65011712,n|=l.flags&65011712,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)s|=l.lanes|l.childLanes,n|=l.subtreeFlags,n|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=n,e.childLanes=s,t}function mg(e,t,s){var n=t.pendingProps;switch(pl(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return We(t),null;case 1:return We(t),null;case 3:return s=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ai(ut),ce(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(ur(t)?Mi(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,gl())),We(t),null;case 26:var l=t.type,_=t.memoizedState;return e===null?(Mi(t),_!==null?(We(t),ad(t,_)):(We(t),lc(t,l,null,n,s))):_?_!==e.memoizedState?(Mi(t),We(t),ad(t,_)):(We(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&Mi(t),We(t),lc(t,l,e,n,s)),null;case 27:if(me(t),s=he.current,l=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Mi(t);else{if(!n){if(t.stateNode===null)throw Error(o(166));return We(t),null}e=Y.current,ur(t)?Hh(t):(e=dm(l,n,s),t.stateNode=e,Mi(t))}return We(t),null;case 5:if(me(t),l=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Mi(t);else{if(!n){if(t.stateNode===null)throw Error(o(166));return We(t),null}if(_=Y.current,ur(t))Hh(t);else{var D=Wa(he.current);switch(_){case 1:_=D.createElementNS("http://www.w3.org/2000/svg",l);break;case 2:_=D.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;default:switch(l){case"svg":_=D.createElementNS("http://www.w3.org/2000/svg",l);break;case"math":_=D.createElementNS("http://www.w3.org/1998/Math/MathML",l);break;case"script":_=D.createElement("div"),_.innerHTML="<script><\/script>",_=_.removeChild(_.firstChild);break;case"select":_=typeof n.is=="string"?D.createElement("select",{is:n.is}):D.createElement("select"),n.multiple?_.multiple=!0:n.size&&(_.size=n.size);break;default:_=typeof n.is=="string"?D.createElement(l,{is:n.is}):D.createElement(l)}}_[bt]=t,_[Dt]=n;e:for(D=t.child;D!==null;){if(D.tag===5||D.tag===6)_.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=_;e:switch(wt(_,l,n),l){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&Mi(t)}}return We(t),lc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&Mi(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(o(166));if(e=he.current,ur(t)){if(e=t.stateNode,s=t.memoizedProps,n=null,l=St,l!==null)switch(l.tag){case 27:case 5:n=l.memoizedProps}e[bt]=t,e=!!(e.nodeValue===s||n!==null&&n.suppressHydrationWarning===!0||im(e.nodeValue,s)),e||Gi(t,!0)}else e=Wa(e).createTextNode(n),e[bt]=t,t.stateNode=e}return We(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(n=ur(t),s!==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[bt]=t}else Ms(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;We(t),e=!1}else s=gl(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(qt(t),t):(qt(t),null);if((t.flags&128)!==0)throw Error(o(558))}return We(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(l=ur(t),n!==null&&n.dehydrated!==null){if(e===null){if(!l)throw Error(o(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(o(317));l[bt]=t}else Ms(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;We(t),l=!1}else l=gl(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),l=!0;if(!l)return t.flags&256?(qt(t),t):(qt(t),null)}return qt(t),(t.flags&128)!==0?(t.lanes=s,t):(s=n!==null,e=e!==null&&e.memoizedState!==null,s&&(n=t.child,l=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(l=n.alternate.memoizedState.cachePool.pool),_=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(_=n.memoizedState.cachePool.pool),_!==l&&(n.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),ja(t,t.updateQueue),We(t),null);case 4:return ce(),e===null&&Dc(t.stateNode.containerInfo),We(t),null;case 10:return Ai(t.type),We(t),null;case 19:if(B(ot),n=t.memoizedState,n===null)return We(t),null;if(l=(t.flags&128)!==0,_=n.rendering,_===null)if(l)mn(n,!1);else{if(rt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(_=xa(e),_!==null){for(t.flags|=128,mn(n,!1),e=_.updateQueue,t.updateQueue=e,ja(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)Lh(s,e),s=s.sibling;return $(ot,ot.current&1|2),Le&&ki(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&pt()>Ia&&(t.flags|=128,l=!0,mn(n,!1),t.lanes=4194304)}else{if(!l)if(e=xa(_),e!==null){if(t.flags|=128,l=!0,e=e.updateQueue,t.updateQueue=e,ja(t,e),mn(n,!0),n.tail===null&&n.tailMode==="hidden"&&!_.alternate&&!Le)return We(t),null}else 2*pt()-n.renderingStartTime>Ia&&s!==536870912&&(t.flags|=128,l=!0,mn(n,!1),t.lanes=4194304);n.isBackwards?(_.sibling=t.child,t.child=_):(e=n.last,e!==null?e.sibling=_:t.child=_,n.last=_)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=pt(),e.sibling=null,s=ot.current,$(ot,l?s&1|2:s&1),Le&&ki(t,n.treeForkCount),e):(We(t),null);case 22:case 23:return qt(t),Ol(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(s&536870912)!==0&&(t.flags&128)===0&&(We(t),t.subtreeFlags&6&&(t.flags|=8192)):We(t),s=t.updateQueue,s!==null&&ja(t,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==s&&(t.flags|=2048),e!==null&&B(js),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Ai(ut),We(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function _g(e,t){switch(pl(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ai(ut),ce(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return me(t),null;case 31:if(t.memoizedState!==null){if(qt(t),t.alternate===null)throw Error(o(340));Ms()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(qt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Ms()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return B(ot),null;case 4:return ce(),null;case 10:return Ai(t.type),null;case 22:case 23:return qt(t),Ol(),e!==null&&B(js),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ai(ut),null;case 25:return null;default:return null}}function od(e,t){switch(pl(t),t.tag){case 3:Ai(ut),ce();break;case 26:case 27:case 5:me(t);break;case 4:ce();break;case 31:t.memoizedState!==null&&qt(t);break;case 13:qt(t);break;case 19:B(ot);break;case 10:Ai(t.type);break;case 22:case 23:qt(t),Ol(),e!==null&&B(js);break;case 24:Ai(ut)}}function _n(e,t){try{var s=t.updateQueue,n=s!==null?s.lastEffect:null;if(n!==null){var l=n.next;s=l;do{if((s.tag&e)===e){n=void 0;var _=s.create,D=s.inst;n=_(),D.destroy=n}s=s.next}while(s!==l)}}catch(z){Pe(t,t.return,z)}}function ts(e,t,s){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var _=l.next;n=_;do{if((n.tag&e)===e){var D=n.inst,z=D.destroy;if(z!==void 0){D.destroy=void 0,l=t;var G=s,ie=z;try{ie()}catch(le){Pe(l,G,le)}}}n=n.next}while(n!==_)}}catch(le){Pe(t,t.return,le)}}function ld(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{Xh(t,s)}catch(n){Pe(e,e.return,n)}}}function cd(e,t,s){s.props=Is(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(n){Pe(e,t,n)}}function pn(e,t){try{var s=e.ref;if(s!==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 s=="function"?e.refCleanup=s(n):s.current=n}}catch(l){Pe(e,t,l)}}function vi(e,t){var s=e.ref,n=e.refCleanup;if(s!==null)if(typeof n=="function")try{n()}catch(l){Pe(e,t,l)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(l){Pe(e,t,l)}else s.current=null}function ud(e){var t=e.type,s=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":s.autoFocus&&n.focus();break e;case"img":s.src?n.src=s.src:s.srcSet&&(n.srcset=s.srcSet)}}catch(l){Pe(e,e.return,l)}}function cc(e,t,s){try{var n=e.stateNode;zg(n,e.type,s,t),n[Dt]=t}catch(l){Pe(e,e.return,l)}}function hd(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ls(e.type)||e.tag===4}function uc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||hd(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&&ls(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 hc(e,t,s){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,t):(t=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,t.appendChild(e),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=Ci));else if(n!==4&&(n===27&&ls(e.type)&&(s=e.stateNode,t=null),e=e.child,e!==null))for(hc(e,t,s),e=e.sibling;e!==null;)hc(e,t,s),e=e.sibling}function Ba(e,t,s){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?s.insertBefore(e,t):s.appendChild(e);else if(n!==4&&(n===27&&ls(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(Ba(e,t,s),e=e.sibling;e!==null;)Ba(e,t,s),e=e.sibling}function fd(e){var t=e.stateNode,s=e.memoizedProps;try{for(var n=e.type,l=t.attributes;l.length;)t.removeAttributeNode(l[0]);wt(t,n,s),t[bt]=e,t[Dt]=s}catch(_){Pe(e,e.return,_)}}var Li=!1,dt=!1,fc=!1,dd=typeof WeakSet=="function"?WeakSet:Set,yt=null;function pg(e,t){if(e=e.containerInfo,Lc=so,e=wh(e),nl(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var n=s.getSelection&&s.getSelection();if(n&&n.rangeCount!==0){s=n.anchorNode;var l=n.anchorOffset,_=n.focusNode;n=n.focusOffset;try{s.nodeType,_.nodeType}catch{s=null;break e}var D=0,z=-1,G=-1,ie=0,le=0,de=e,se=null;t:for(;;){for(var ae;de!==s||l!==0&&de.nodeType!==3||(z=D+l),de!==_||n!==0&&de.nodeType!==3||(G=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===s&&++ie===l&&(z=D),se===_&&++le===n&&(G=D),(ae=de.nextSibling)!==null)break;de=se,se=de.parentNode}de=ae}s=z===-1||G===-1?null:{start:z,end:G}}else s=null}s=s||{start:0,end:0}}else s=null;for(Nc={focusedElem:e,selectionRange:s},so=!1,yt=t;yt!==null;)if(t=yt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,yt=e;else for(;yt!==null;){switch(t=yt,_=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(s=0;s<e.length;s++)l=e[s],l.ref.impl=l.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&_!==null){e=void 0,s=t,l=_.memoizedProps,_=_.memoizedState,n=s.stateNode;try{var ve=Is(s.type,l);e=n.getSnapshotBeforeUpdate(ve,_),n.__reactInternalSnapshotBeforeUpdate=e}catch(Se){Pe(s,s.return,Se)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,s=e.nodeType,s===9)zc(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":zc(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,yt=e;break}yt=t.return}}function md(e,t,s){var n=s.flags;switch(s.tag){case 0:case 11:case 15:ji(e,s),n&4&&_n(5,s);break;case 1:if(ji(e,s),n&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(D){Pe(s,s.return,D)}else{var l=Is(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(l,t,e.__reactInternalSnapshotBeforeUpdate)}catch(D){Pe(s,s.return,D)}}n&64&&ld(s),n&512&&pn(s,s.return);break;case 3:if(ji(e,s),n&64&&(e=s.updateQueue,e!==null)){if(t=null,s.child!==null)switch(s.child.tag){case 27:case 5:t=s.child.stateNode;break;case 1:t=s.child.stateNode}try{Xh(e,t)}catch(D){Pe(s,s.return,D)}}break;case 27:t===null&&n&4&&fd(s);case 26:case 5:ji(e,s),t===null&&n&4&&ud(s),n&512&&pn(s,s.return);break;case 12:ji(e,s);break;case 31:ji(e,s),n&4&&vd(e,s);break;case 13:ji(e,s),n&4&&gd(e,s),n&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=Eg.bind(null,s),Fg(e,s))));break;case 22:if(n=s.memoizedState!==null||Li,!n){t=t!==null&&t.memoizedState!==null||dt,l=Li;var _=dt;Li=n,(dt=t)&&!_?Bi(e,s,(s.subtreeFlags&8772)!==0):ji(e,s),Li=l,dt=_}break;case 30:break;default:ji(e,s)}}function _d(e){var t=e.alternate;t!==null&&(e.alternate=null,_d(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&$o(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 Je=null,Mt=!1;function Ni(e,t,s){for(s=s.child;s!==null;)pd(e,t,s),s=s.sibling}function pd(e,t,s){if(Ut&&typeof Ut.onCommitFiberUnmount=="function")try{Ut.onCommitFiberUnmount(ws,s)}catch{}switch(s.tag){case 26:dt||vi(s,t),Ni(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:dt||vi(s,t);var n=Je,l=Mt;ls(s.type)&&(Je=s.stateNode,Mt=!1),Ni(e,t,s),En(s.stateNode),Je=n,Mt=l;break;case 5:dt||vi(s,t);case 6:if(n=Je,l=Mt,Je=null,Ni(e,t,s),Je=n,Mt=l,Je!==null)if(Mt)try{(Je.nodeType===9?Je.body:Je.nodeName==="HTML"?Je.ownerDocument.body:Je).removeChild(s.stateNode)}catch(_){Pe(s,t,_)}else try{Je.removeChild(s.stateNode)}catch(_){Pe(s,t,_)}break;case 18:Je!==null&&(Mt?(e=Je,lm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),Or(e)):lm(Je,s.stateNode));break;case 4:n=Je,l=Mt,Je=s.stateNode.containerInfo,Mt=!0,Ni(e,t,s),Je=n,Mt=l;break;case 0:case 11:case 14:case 15:ts(2,s,t),dt||ts(4,s,t),Ni(e,t,s);break;case 1:dt||(vi(s,t),n=s.stateNode,typeof n.componentWillUnmount=="function"&&cd(s,t,n)),Ni(e,t,s);break;case 21:Ni(e,t,s);break;case 22:dt=(n=dt)||s.memoizedState!==null,Ni(e,t,s),dt=n;break;default:Ni(e,t,s)}}function vd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Or(e)}catch(s){Pe(t,t.return,s)}}}function gd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Or(e)}catch(s){Pe(t,t.return,s)}}function vg(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new dd),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new dd),t;default:throw Error(o(435,e.tag))}}function za(e,t){var s=vg(e);t.forEach(function(n){if(!s.has(n)){s.add(n);var l=kg.bind(null,e,n);n.then(l,l)}})}function Lt(e,t){var s=t.deletions;if(s!==null)for(var n=0;n<s.length;n++){var l=s[n],_=e,D=t,z=D;e:for(;z!==null;){switch(z.tag){case 27:if(ls(z.type)){Je=z.stateNode,Mt=!1;break e}break;case 5:Je=z.stateNode,Mt=!1;break e;case 3:case 4:Je=z.stateNode.containerInfo,Mt=!0;break e}z=z.return}if(Je===null)throw Error(o(160));pd(_,D,l),Je=null,Mt=!1,_=l.alternate,_!==null&&(_.return=null),l.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)yd(t,e),t=t.sibling}var ci=null;function yd(e,t){var s=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Lt(t,e),Nt(e),n&4&&(ts(3,e,e.return),_n(3,e),ts(5,e,e.return));break;case 1:Lt(t,e),Nt(e),n&512&&(dt||s===null||vi(s,s.return)),n&64&&Li&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?n:s.concat(n))));break;case 26:var l=ci;if(Lt(t,e),Nt(e),n&512&&(dt||s===null||vi(s,s.return)),n&4){var _=s!==null?s.memoizedState:null;if(n=e.memoizedState,s===null)if(n===null)if(e.stateNode===null){e:{n=e.type,s=e.memoizedProps,l=l.ownerDocument||l;t:switch(n){case"title":_=l.getElementsByTagName("title")[0],(!_||_[$r]||_[bt]||_.namespaceURI==="http://www.w3.org/2000/svg"||_.hasAttribute("itemprop"))&&(_=l.createElement(n),l.head.insertBefore(_,l.querySelector("head > title"))),wt(_,n,s),_[bt]=e,gt(_),n=_;break e;case"link":var D=ym("link","href",l).get(n+(s.href||""));if(D){for(var z=0;z<D.length;z++)if(_=D[z],_.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&_.getAttribute("rel")===(s.rel==null?null:s.rel)&&_.getAttribute("title")===(s.title==null?null:s.title)&&_.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){D.splice(z,1);break t}}_=l.createElement(n),wt(_,n,s),l.head.appendChild(_);break;case"meta":if(D=ym("meta","content",l).get(n+(s.content||""))){for(z=0;z<D.length;z++)if(_=D[z],_.getAttribute("content")===(s.content==null?null:""+s.content)&&_.getAttribute("name")===(s.name==null?null:s.name)&&_.getAttribute("property")===(s.property==null?null:s.property)&&_.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&_.getAttribute("charset")===(s.charSet==null?null:s.charSet)){D.splice(z,1);break t}}_=l.createElement(n),wt(_,n,s),l.head.appendChild(_);break;default:throw Error(o(468,n))}_[bt]=e,gt(_),n=_}e.stateNode=n}else bm(l,e.type,e.stateNode);else e.stateNode=gm(l,n,e.memoizedProps);else _!==n?(_===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):_.count--,n===null?bm(l,e.type,e.stateNode):gm(l,n,e.memoizedProps)):n===null&&e.stateNode!==null&&cc(e,e.memoizedProps,s.memoizedProps)}break;case 27:Lt(t,e),Nt(e),n&512&&(dt||s===null||vi(s,s.return)),s!==null&&n&4&&cc(e,e.memoizedProps,s.memoizedProps);break;case 5:if(Lt(t,e),Nt(e),n&512&&(dt||s===null||vi(s,s.return)),e.flags&32){l=e.stateNode;try{er(l,"")}catch(ve){Pe(e,e.return,ve)}}n&4&&e.stateNode!=null&&(l=e.memoizedProps,cc(e,l,s!==null?s.memoizedProps:l)),n&1024&&(fc=!0);break;case 6:if(Lt(t,e),Nt(e),n&4){if(e.stateNode===null)throw Error(o(162));n=e.memoizedProps,s=e.stateNode;try{s.nodeValue=n}catch(ve){Pe(e,e.return,ve)}}break;case 3:if(Qa=null,l=ci,ci=Xa(t.containerInfo),Lt(t,e),ci=l,Nt(e),n&4&&s!==null&&s.memoizedState.isDehydrated)try{Or(t.containerInfo)}catch(ve){Pe(e,e.return,ve)}fc&&(fc=!1,bd(e));break;case 4:n=ci,ci=Xa(e.stateNode.containerInfo),Lt(t,e),Nt(e),ci=n;break;case 12:Lt(t,e),Nt(e);break;case 31:Lt(t,e),Nt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,za(e,n)));break;case 13:Lt(t,e),Nt(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Ua=pt()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,za(e,n)));break;case 22:l=e.memoizedState!==null;var G=s!==null&&s.memoizedState!==null,ie=Li,le=dt;if(Li=ie||l,dt=le||G,Lt(t,e),dt=le,Li=ie,Nt(e),n&8192)e:for(t=e.stateNode,t._visibility=l?t._visibility&-2:t._visibility|1,l&&(s===null||G||Li||dt||Ps(e)),s=null,t=e;;){if(t.tag===5||t.tag===26){if(s===null){G=s=t;try{if(_=G.stateNode,l)D=_.style,typeof D.setProperty=="function"?D.setProperty("display","none","important"):D.display="none";else{z=G.stateNode;var de=G.memoizedProps.style,se=de!=null&&de.hasOwnProperty("display")?de.display:null;z.style.display=se==null||typeof se=="boolean"?"":(""+se).trim()}}catch(ve){Pe(G,G.return,ve)}}}else if(t.tag===6){if(s===null){G=t;try{G.stateNode.nodeValue=l?"":G.memoizedProps}catch(ve){Pe(G,G.return,ve)}}}else if(t.tag===18){if(s===null){G=t;try{var ae=G.stateNode;l?cm(ae,!0):cm(G.stateNode,!1)}catch(ve){Pe(G,G.return,ve)}}}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;s===t&&(s=null),t=t.return}s===t&&(s=null),t.sibling.return=t.return,t=t.sibling}n&4&&(n=e.updateQueue,n!==null&&(s=n.retryQueue,s!==null&&(n.retryQueue=null,za(e,s))));break;case 19:Lt(t,e),Nt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,za(e,n)));break;case 30:break;case 21:break;default:Lt(t,e),Nt(e)}}function Nt(e){var t=e.flags;if(t&2){try{for(var s,n=e.return;n!==null;){if(hd(n)){s=n;break}n=n.return}if(s==null)throw Error(o(160));switch(s.tag){case 27:var l=s.stateNode,_=uc(e);Ba(e,_,l);break;case 5:var D=s.stateNode;s.flags&32&&(er(D,""),s.flags&=-33);var z=uc(e);Ba(e,z,D);break;case 3:case 4:var G=s.stateNode.containerInfo,ie=uc(e);hc(e,ie,G);break;default:throw Error(o(161))}}catch(le){Pe(e,e.return,le)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function bd(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;bd(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ji(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)md(e,t.alternate,t),t=t.sibling}function Ps(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:ts(4,t,t.return),Ps(t);break;case 1:vi(t,t.return);var s=t.stateNode;typeof s.componentWillUnmount=="function"&&cd(t,t.return,s),Ps(t);break;case 27:En(t.stateNode);case 26:case 5:vi(t,t.return),Ps(t);break;case 22:t.memoizedState===null&&Ps(t);break;case 30:Ps(t);break;default:Ps(t)}e=e.sibling}}function Bi(e,t,s){for(s=s&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,l=e,_=t,D=_.flags;switch(_.tag){case 0:case 11:case 15:Bi(l,_,s),_n(4,_);break;case 1:if(Bi(l,_,s),n=_,l=n.stateNode,typeof l.componentDidMount=="function")try{l.componentDidMount()}catch(ie){Pe(n,n.return,ie)}if(n=_,l=n.updateQueue,l!==null){var z=n.stateNode;try{var G=l.shared.hiddenCallbacks;if(G!==null)for(l.shared.hiddenCallbacks=null,l=0;l<G.length;l++)Wh(G[l],z)}catch(ie){Pe(n,n.return,ie)}}s&&D&64&&ld(_),pn(_,_.return);break;case 27:fd(_);case 26:case 5:Bi(l,_,s),s&&n===null&&D&4&&ud(_),pn(_,_.return);break;case 12:Bi(l,_,s);break;case 31:Bi(l,_,s),s&&D&4&&vd(l,_);break;case 13:Bi(l,_,s),s&&D&4&&gd(l,_);break;case 22:_.memoizedState===null&&Bi(l,_,s),pn(_,_.return);break;case 30:break;default:Bi(l,_,s)}t=t.sibling}}function dc(e,t){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&tn(s))}function mc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&tn(e))}function ui(e,t,s,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Sd(e,t,s,n),t=t.sibling}function Sd(e,t,s,n){var l=t.flags;switch(t.tag){case 0:case 11:case 15:ui(e,t,s,n),l&2048&&_n(9,t);break;case 1:ui(e,t,s,n);break;case 3:ui(e,t,s,n),l&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&tn(e)));break;case 12:if(l&2048){ui(e,t,s,n),e=t.stateNode;try{var _=t.memoizedProps,D=_.id,z=_.onPostCommit;typeof z=="function"&&z(D,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(G){Pe(t,t.return,G)}}else ui(e,t,s,n);break;case 31:ui(e,t,s,n);break;case 13:ui(e,t,s,n);break;case 23:break;case 22:_=t.stateNode,D=t.alternate,t.memoizedState!==null?_._visibility&2?ui(e,t,s,n):vn(e,t):_._visibility&2?ui(e,t,s,n):(_._visibility|=2,br(e,t,s,n,(t.subtreeFlags&10256)!==0||!1)),l&2048&&dc(D,t);break;case 24:ui(e,t,s,n),l&2048&&mc(t.alternate,t);break;default:ui(e,t,s,n)}}function br(e,t,s,n,l){for(l=l&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var _=e,D=t,z=s,G=n,ie=D.flags;switch(D.tag){case 0:case 11:case 15:br(_,D,z,G,l),_n(8,D);break;case 23:break;case 22:var le=D.stateNode;D.memoizedState!==null?le._visibility&2?br(_,D,z,G,l):vn(_,D):(le._visibility|=2,br(_,D,z,G,l)),l&&ie&2048&&dc(D.alternate,D);break;case 24:br(_,D,z,G,l),l&&ie&2048&&mc(D.alternate,D);break;default:br(_,D,z,G,l)}t=t.sibling}}function vn(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,n=t,l=n.flags;switch(n.tag){case 22:vn(s,n),l&2048&&dc(n.alternate,n);break;case 24:vn(s,n),l&2048&&mc(n.alternate,n);break;default:vn(s,n)}t=t.sibling}}var gn=8192;function Sr(e,t,s){if(e.subtreeFlags&gn)for(e=e.child;e!==null;)xd(e,t,s),e=e.sibling}function xd(e,t,s){switch(e.tag){case 26:Sr(e,t,s),e.flags&gn&&e.memoizedState!==null&&s0(s,ci,e.memoizedState,e.memoizedProps);break;case 5:Sr(e,t,s);break;case 3:case 4:var n=ci;ci=Xa(e.stateNode.containerInfo),Sr(e,t,s),ci=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=gn,gn=16777216,Sr(e,t,s),gn=n):Sr(e,t,s));break;default:Sr(e,t,s)}}function Cd(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 s=0;s<t.length;s++){var n=t[s];yt=n,Ed(n,e)}Cd(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)wd(e),e=e.sibling}function wd(e){switch(e.tag){case 0:case 11:case 15:yn(e),e.flags&2048&&ts(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,Ha(e)):yn(e);break;default:yn(e)}}function Ha(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var n=t[s];yt=n,Ed(n,e)}Cd(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ts(8,t,t.return),Ha(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,Ha(t));break;default:Ha(t)}e=e.sibling}}function Ed(e,t){for(;yt!==null;){var s=yt;switch(s.tag){case 0:case 11:case 15:ts(8,s,t);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var n=s.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:tn(s.memoizedState.cache)}if(n=s.child,n!==null)n.return=s,yt=n;else e:for(s=e;yt!==null;){n=yt;var l=n.sibling,_=n.return;if(_d(n),n===s){yt=null;break e}if(l!==null){l.return=_,yt=l;break e}yt=_}}}var gg={getCacheForType:function(e){var t=xt(ut),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return xt(ut).controller.signal}},yg=typeof WeakMap=="function"?WeakMap:Map,He=0,Ve=null,Re=null,Oe=0,Ie=0,Ft=null,is=!1,xr=!1,_c=!1,zi=0,rt=0,ss=0,$s=0,pc=0,Kt=0,Cr=0,bn=null,jt=null,vc=!1,Ua=0,kd=0,Ia=1/0,Pa=null,rs=null,vt=0,ns=null,wr=null,Hi=0,gc=0,yc=null,Td=null,Sn=0,bc=null;function Vt(){return(He&2)!==0&&Oe!==0?Oe&-Oe:F.T!==null?kc():$u()}function Ad(){if(Kt===0)if((Oe&536870912)===0||Le){var e=Yn;Yn<<=1,(Yn&3932160)===0&&(Yn=262144),Kt=e}else Kt=536870912;return e=Zt.current,e!==null&&(e.flags|=32),Kt}function Bt(e,t,s){(e===Ve&&(Ie===2||Ie===9)||e.cancelPendingCommit!==null)&&(Er(e,0),as(e,Oe,Kt,!1)),Pr(e,s),((He&2)===0||e!==Ve)&&(e===Ve&&((He&2)===0&&($s|=s),rt===4&&as(e,Oe,Kt,!1)),gi(e))}function Rd(e,t,s){if((He&6)!==0)throw Error(o(327));var n=!s&&(t&127)===0&&(t&e.expiredLanes)===0||Ir(e,t),l=n?xg(e,t):xc(e,t,!0),_=n;do{if(l===0){xr&&!n&&as(e,t,0,!1);break}else{if(s=e.current.alternate,_&&!bg(s)){l=xc(e,t,!1),_=!1;continue}if(l===2){if(_=t,e.errorRecoveryDisabledLanes&_)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;l=bn;var G=z.current.memoizedState.isDehydrated;if(G&&(Er(z,D).flags|=256),D=xc(z,D,!1),D!==2){if(_c&&!G){z.errorRecoveryDisabledLanes|=_,$s|=_,l=4;break e}_=jt,jt=l,_!==null&&(jt===null?jt=_:jt.push.apply(jt,_))}l=D}if(_=!1,l!==2)continue}}if(l===1){Er(e,0),as(e,t,0,!0);break}e:{switch(n=e,_=l,_){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:as(n,t,Kt,!is);break e;case 2:jt=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(l=Ua+300-pt(),10<l)){if(as(n,t,Kt,!is),Xn(n,0,!0)!==0)break e;Hi=t,n.timeoutHandle=am(Dd.bind(null,n,s,jt,Pa,vc,t,Kt,$s,Cr,is,_,"Throttled",-0,0),l);break e}Dd(n,s,jt,Pa,vc,t,Kt,$s,Cr,is,_,null,-0,0)}}break}while(!0);gi(e)}function Dd(e,t,s,n,l,_,D,z,G,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:Ci},xd(t,_,de);var ve=(_&62914560)===_?Ua-pt():(_&4194048)===_?kd-pt():0;if(ve=r0(de,ve),ve!==null){Hi=_,e.cancelPendingCommit=ve(Hd.bind(null,e,t,_,s,n,l,D,z,G,le,de,null,se,ae)),as(e,_,D,!ie);return}}Hd(e,t,_,s,n,l,D,z,G)}function bg(e){for(var t=e;;){var s=t.tag;if((s===0||s===11||s===15)&&t.flags&16384&&(s=t.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var n=0;n<s.length;n++){var l=s[n],_=l.getSnapshot;l=l.value;try{if(!Pt(_(),l))return!1}catch{return!1}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;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 as(e,t,s,n){t&=~pc,t&=~$s,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var l=t;0<l;){var _=31-It(l),D=1<<_;n[_]=-1,l&=~D}s!==0&&Uu(e,s,t)}function $a(){return(He&6)===0?(xn(0),!1):!0}function Sc(){if(Re!==null){if(Ie===0)var e=Re.return;else e=Re,Ti=Ls=null,zl(e),_r=null,rn=0,e=Re;for(;e!==null;)od(e.alternate,e),e=e.return;Re=null}}function Er(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,Ig(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),Hi=0,Sc(),Ve=e,Re=s=Ei(e.current,null),Oe=t,Ie=0,Ft=null,is=!1,xr=Ir(e,t),_c=!1,Cr=Kt=pc=$s=ss=rt=0,jt=bn=null,vc=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var l=31-It(n),_=1<<l;t|=e[l],n&=~_}return zi=t,ca(),s}function Od(e,t){Ee=null,F.H=fn,t===mr||t===va?(t=Kh(),Ie=3):t===El?(t=Kh(),Ie=4):Ie=t===Ql?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ft=t,Re===null&&(rt=1,Oa(e,Jt(t,e.current)))}function Md(){var e=Zt.current;return e===null?!0:(Oe&4194048)===Oe?ii===null:(Oe&62914560)===Oe||(Oe&536870912)!==0?e===ii:!1}function Ld(){var e=F.H;return F.H=fn,e===null?fn:e}function Nd(){var e=F.A;return F.A=gg,e}function Za(){rt=4,is||(Oe&4194048)!==Oe&&Zt.current!==null||(xr=!0),(ss&134217727)===0&&($s&134217727)===0||Ve===null||as(Ve,Oe,Kt,!1)}function xc(e,t,s){var n=He;He|=2;var l=Ld(),_=Nd();(Ve!==e||Oe!==t)&&(Pa=null,Er(e,t)),t=!1;var D=rt;e:do try{if(Ie!==0&&Re!==null){var z=Re,G=Ft;switch(Ie){case 8:Sc(),D=6;break e;case 3:case 2:case 9:case 6:Zt.current===null&&(t=!0);var ie=Ie;if(Ie=0,Ft=null,kr(e,z,G,ie),s&&xr){D=0;break e}break;default:ie=Ie,Ie=0,Ft=null,kr(e,z,G,ie)}}Sg(),D=rt;break}catch(le){Od(e,le)}while(!0);return t&&e.shellSuspendCounter++,Ti=Ls=null,He=n,F.H=l,F.A=_,Re===null&&(Ve=null,Oe=0,ca()),D}function Sg(){for(;Re!==null;)jd(Re)}function xg(e,t){var s=He;He|=2;var n=Ld(),l=Nd();Ve!==e||Oe!==t?(Pa=null,Ia=pt()+500,Er(e,t)):xr=Ir(e,t);e:do try{if(Ie!==0&&Re!==null){t=Re;var _=Ft;t:switch(Ie){case 1:Ie=0,Ft=null,kr(e,t,_,1);break;case 2:case 9:if(qh(_)){Ie=0,Ft=null,Bd(t);break}t=function(){Ie!==2&&Ie!==9||Ve!==e||(Ie=7),gi(e)},_.then(t,t);break e;case 3:Ie=7;break e;case 4:Ie=5;break e;case 7:qh(_)?(Ie=0,Ft=null,Bd(t)):(Ie=0,Ft=null,kr(e,t,_,7));break;case 5:var D=null;switch(Re.tag){case 26:D=Re.memoizedState;case 5:case 27:var z=Re;if(D?Sm(D):z.stateNode.complete){Ie=0,Ft=null;var G=z.sibling;if(G!==null)Re=G;else{var ie=z.return;ie!==null?(Re=ie,qa(ie)):Re=null}break t}}Ie=0,Ft=null,kr(e,t,_,5);break;case 6:Ie=0,Ft=null,kr(e,t,_,6);break;case 8:Sc(),rt=6;break e;default:throw Error(o(462))}}Cg();break}catch(le){Od(e,le)}while(!0);return Ti=Ls=null,F.H=n,F.A=l,He=s,Re!==null?0:(Ve=null,Oe=0,ca(),rt)}function Cg(){for(;Re!==null&&!Fs();)jd(Re)}function jd(e){var t=nd(e.alternate,e,zi);e.memoizedProps=e.pendingProps,t===null?qa(e):Re=t}function Bd(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=Qf(s,t,t.pendingProps,t.type,void 0,Oe);break;case 11:t=Qf(s,t,t.pendingProps,t.type.render,t.ref,Oe);break;case 5:zl(t);default:od(s,t),t=Re=Lh(t,zi),t=nd(s,t,zi)}e.memoizedProps=e.pendingProps,t===null?qa(e):Re=t}function kr(e,t,s,n){Ti=Ls=null,zl(t),_r=null,rn=0;var l=t.return;try{if(hg(e,l,t,s,Oe)){rt=1,Oa(e,Jt(s,e.current)),Re=null;return}}catch(_){if(l!==null)throw Re=l,_;rt=1,Oa(e,Jt(s,e.current)),Re=null;return}t.flags&32768?(Le||n===1?e=!0:xr||(Oe&536870912)!==0?e=!1:(is=e=!0,(n===2||n===9||n===3||n===6)&&(n=Zt.current,n!==null&&n.tag===13&&(n.flags|=16384))),zd(t,e)):qa(t)}function qa(e){var t=e;do{if((t.flags&32768)!==0){zd(t,is);return}e=t.return;var s=mg(t.alternate,t,zi);if(s!==null){Re=s;return}if(t=t.sibling,t!==null){Re=t;return}Re=t=e}while(t!==null);rt===0&&(rt=5)}function zd(e,t){do{var s=_g(e.alternate,e);if(s!==null){s.flags&=32767,Re=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){Re=e;return}Re=e=s}while(e!==null);rt=6,Re=null}function Hd(e,t,s,n,l,_,D,z,G){e.cancelPendingCommit=null;do Fa();while(vt!==0);if((He&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(_=t.lanes|t.childLanes,_|=ul,iv(e,s,_,D,z,G),e===Ve&&(Re=Ve=null,Oe=0),wr=t,ns=e,Hi=s,gc=_,yc=l,Td=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Tg(Ht,function(){return Zd(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=F.T,F.T=null,l=Q.p,Q.p=2,D=He,He|=4;try{pg(e,t,s)}finally{He=D,Q.p=l,F.T=n}}vt=1,Ud(),Id(),Pd()}}function Ud(){if(vt===1){vt=0;var e=ns,t=wr,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=F.T,F.T=null;var n=Q.p;Q.p=2;var l=He;He|=4;try{yd(t,e);var _=Nc,D=wh(e.containerInfo),z=_.focusedElem,G=_.selectionRange;if(D!==z&&z&&z.ownerDocument&&Ch(z.ownerDocument.documentElement,z)){if(G!==null&&nl(z)){var ie=G.start,le=G.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(),ve=z.textContent.length,Se=Math.min(G.start,ve),Ke=G.end===void 0?Se:Math.min(G.end,ve);!ae.extend&&Se>Ke&&(D=Ke,Ke=Se,Se=D);var X=xh(z,Se),W=xh(z,Ke);if(X&&W&&(ae.rangeCount!==1||ae.anchorNode!==X.node||ae.anchorOffset!==X.offset||ae.focusNode!==W.node||ae.focusOffset!==W.offset)){var te=de.createRange();te.setStart(X.node,X.offset),ae.removeAllRanges(),Se>Ke?(ae.addRange(te),ae.extend(W.node,W.offset)):(te.setEnd(W.node,W.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}}so=!!Lc,Nc=Lc=null}finally{He=l,Q.p=n,F.T=s}}e.current=t,vt=2}}function Id(){if(vt===2){vt=0;var e=ns,t=wr,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=F.T,F.T=null;var n=Q.p;Q.p=2;var l=He;He|=4;try{md(e,t.alternate,t)}finally{He=l,Q.p=n,F.T=s}}vt=3}}function Pd(){if(vt===4||vt===3){vt=0,Rt();var e=ns,t=wr,s=Hi,n=Td;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?vt=5:(vt=0,wr=ns=null,$d(e,e.pendingLanes));var l=e.pendingLanes;if(l===0&&(rs=null),Io(s),t=t.stateNode,Ut&&typeof Ut.onCommitFiberRoot=="function")try{Ut.onCommitFiberRoot(ws,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=F.T,l=Q.p,Q.p=2,F.T=null;try{for(var _=e.onRecoverableError,D=0;D<n.length;D++){var z=n[D];_(z.value,{componentStack:z.stack})}}finally{F.T=t,Q.p=l}}(Hi&3)!==0&&Fa(),gi(e),l=e.pendingLanes,(s&261930)!==0&&(l&42)!==0?e===bc?Sn++:(Sn=0,bc=e):Sn=0,xn(0)}}function $d(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,tn(t)))}function Fa(){return Ud(),Id(),Pd(),Zd()}function Zd(){if(vt!==5)return!1;var e=ns,t=gc;gc=0;var s=Io(Hi),n=F.T,l=Q.p;try{Q.p=32>s?32:s,F.T=null,s=yc,yc=null;var _=ns,D=Hi;if(vt=0,wr=ns=null,Hi=0,(He&6)!==0)throw Error(o(331));var z=He;if(He|=4,wd(_.current),Sd(_,_.current,D,s),He=z,xn(0,!1),Ut&&typeof Ut.onPostCommitFiberRoot=="function")try{Ut.onPostCommitFiberRoot(ws,_)}catch{}return!0}finally{Q.p=l,F.T=n,$d(e,t)}}function qd(e,t,s){t=Jt(s,t),t=Jl(e.stateNode,t,2),e=Ji(e,t,2),e!==null&&(Pr(e,2),gi(e))}function Pe(e,t,s){if(e.tag===3)qd(e,e,s);else for(;t!==null;){if(t.tag===3){qd(t,e,s);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(rs===null||!rs.has(n))){e=Jt(s,e),s=Ff(2),n=Ji(t,s,2),n!==null&&(Kf(s,n,t,e),Pr(n,2),gi(n));break}}t=t.return}}function Cc(e,t,s){var n=e.pingCache;if(n===null){n=e.pingCache=new yg;var l=new Set;n.set(t,l)}else l=n.get(t),l===void 0&&(l=new Set,n.set(t,l));l.has(s)||(_c=!0,l.add(s),e=wg.bind(null,e,t,s),t.then(e,e))}function wg(e,t,s){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,Ve===e&&(Oe&s)===s&&(rt===4||rt===3&&(Oe&62914560)===Oe&&300>pt()-Ua?(He&2)===0&&Er(e,0):pc|=s,Cr===Oe&&(Cr=0)),gi(e)}function Fd(e,t){t===0&&(t=Hu()),e=Ds(e,t),e!==null&&(Pr(e,t),gi(e))}function Eg(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),Fd(e,s)}function kg(e,t){var s=0;switch(e.tag){case 31:case 13:var n=e.stateNode,l=e.memoizedState;l!==null&&(s=l.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),Fd(e,s)}function Tg(e,t){return mi(e,t)}var Ka=null,Tr=null,wc=!1,Va=!1,Ec=!1,os=0;function gi(e){e!==Tr&&e.next===null&&(Tr===null?Ka=Tr=e:Tr=Tr.next=e),Va=!0,wc||(wc=!0,Rg())}function xn(e,t){if(!Ec&&Va){Ec=!0;do for(var s=!1,n=Ka;n!==null;){if(e!==0){var l=n.pendingLanes;if(l===0)var _=0;else{var D=n.suspendedLanes,z=n.pingedLanes;_=(1<<31-It(42|e)+1)-1,_&=l&~(D&~z),_=_&201326741?_&201326741|1:_?_|2:0}_!==0&&(s=!0,Yd(n,_))}else _=Oe,_=Xn(n,n===Ve?_:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(_&3)===0||Ir(n,_)||(s=!0,Yd(n,_));n=n.next}while(s);Ec=!1}}function Ag(){Kd()}function Kd(){Va=wc=!1;var e=0;os!==0&&Ug()&&(e=os);for(var t=pt(),s=null,n=Ka;n!==null;){var l=n.next,_=Vd(n,t);_===0?(n.next=null,s===null?Ka=l:s.next=l,l===null&&(Tr=s)):(s=n,(e!==0||(_&3)!==0)&&(Va=!0)),n=l}vt!==0&&vt!==5||xn(e),os!==0&&(os=0)}function Vd(e,t){for(var s=e.suspendedLanes,n=e.pingedLanes,l=e.expirationTimes,_=e.pendingLanes&-62914561;0<_;){var D=31-It(_),z=1<<D,G=l[D];G===-1?((z&s)===0||(z&n)!==0)&&(l[D]=tv(z,t)):G<=t&&(e.expiredLanes|=z),_&=~z}if(t=Ve,s=Oe,s=Xn(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,s===0||e===t&&(Ie===2||Ie===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&xs(n),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||Ir(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(n!==null&&xs(n),Io(s)){case 2:case 8:s=Ks;break;case 32:s=Ht;break;case 268435456:s=oi;break;default:s=Ht}return n=Gd.bind(null,e),s=mi(s,n),e.callbackPriority=t,e.callbackNode=s,t}return n!==null&&n!==null&&xs(n),e.callbackPriority=2,e.callbackNode=null,2}function Gd(e,t){if(vt!==0&&vt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(Fa()&&e.callbackNode!==s)return null;var n=Oe;return n=Xn(e,e===Ve?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(Rd(e,n,t),Vd(e,pt()),e.callbackNode!=null&&e.callbackNode===s?Gd.bind(null,e):null)}function Yd(e,t){if(Fa())return null;Rd(e,t,!0)}function Rg(){Pg(function(){(He&6)!==0?mi($i,Ag):Kd()})}function kc(){if(os===0){var e=fr;e===0&&(e=Gn,Gn<<=1,(Gn&261888)===0&&(Gn=256)),os=e}return os}function Wd(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ta(""+e)}function Xd(e,t){var s=t.ownerDocument.createElement("input");return s.name=t.name,s.value=t.value,e.id&&s.setAttribute("form",e.id),t.parentNode.insertBefore(s,t),e=new FormData(e),s.parentNode.removeChild(s),e}function Dg(e,t,s,n,l){if(t==="submit"&&s&&s.stateNode===l){var _=Wd((l[Dt]||null).action),D=n.submitter;D&&(t=(t=D[Dt]||null)?Wd(t.formAction):D.getAttribute("formAction"),t!==null&&(_=t,D=null));var z=new na("action","action",null,n,l);e.push({event:z,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(os!==0){var G=D?Xd(l,D):new FormData(l);Kl(s,{pending:!0,data:G,method:l.method,action:_},null,G)}}else typeof _=="function"&&(z.preventDefault(),G=D?Xd(l,D):new FormData(l),Kl(s,{pending:!0,data:G,method:l.method,action:_},_,G))},currentTarget:l}]})}}for(var Tc=0;Tc<cl.length;Tc++){var Ac=cl[Tc],Og=Ac.toLowerCase(),Mg=Ac[0].toUpperCase()+Ac.slice(1);li(Og,"on"+Mg)}li(Th,"onAnimationEnd"),li(Ah,"onAnimationIteration"),li(Rh,"onAnimationStart"),li("dblclick","onDoubleClick"),li("focusin","onFocus"),li("focusout","onBlur"),li(Gv,"onTransitionRun"),li(Yv,"onTransitionStart"),li(Wv,"onTransitionCancel"),li(Dh,"onTransitionEnd"),Js("onMouseEnter",["mouseout","mouseover"]),Js("onMouseLeave",["mouseout","mouseover"]),Js("onPointerEnter",["pointerout","pointerover"]),Js("onPointerLeave",["pointerout","pointerover"]),ks("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ks("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ks("onBeforeInput",["compositionend","keypress","textInput","paste"]),ks("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ks("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ks("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Cn="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(" "),Lg=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Cn));function Jd(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var n=e[s],l=n.event;n=n.listeners;e:{var _=void 0;if(t)for(var D=n.length-1;0<=D;D--){var z=n[D],G=z.instance,ie=z.currentTarget;if(z=z.listener,G!==_&&l.isPropagationStopped())break e;_=z,l.currentTarget=ie;try{_(l)}catch(le){la(le)}l.currentTarget=null,_=G}else for(D=0;D<n.length;D++){if(z=n[D],G=z.instance,ie=z.currentTarget,z=z.listener,G!==_&&l.isPropagationStopped())break e;_=z,l.currentTarget=ie;try{_(l)}catch(le){la(le)}l.currentTarget=null,_=G}}}}function De(e,t){var s=t[Po];s===void 0&&(s=t[Po]=new Set);var n=e+"__bubble";s.has(n)||(Qd(t,e,2,!1),s.add(n))}function Rc(e,t,s){var n=0;t&&(n|=4),Qd(s,e,n,t)}var Ga="_reactListening"+Math.random().toString(36).slice(2);function Dc(e){if(!e[Ga]){e[Ga]=!0,Fu.forEach(function(s){s!=="selectionchange"&&(Lg.has(s)||Rc(s,!1,e),Rc(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ga]||(t[Ga]=!0,Rc("selectionchange",!1,t))}}function Qd(e,t,s,n){switch(Am(t)){case 2:var l=o0;break;case 8:l=l0;break;default:l=Fc}s=l.bind(null,t,s,e),l=void 0,!Wo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(l=!0),n?l!==void 0?e.addEventListener(t,s,{capture:!0,passive:l}):e.addEventListener(t,s,!0):l!==void 0?e.addEventListener(t,s,{passive:l}):e.addEventListener(t,s,!1)}function Oc(e,t,s,n,l){var _=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===l)break;if(D===4)for(D=n.return;D!==null;){var G=D.tag;if((G===3||G===4)&&D.stateNode.containerInfo===l)return;D=D.return}for(;z!==null;){if(D=Ys(z),D===null)return;if(G=D.tag,G===5||G===6||G===26||G===27){n=_=D;continue e}z=z.parentNode}}n=n.return}sh(function(){var ie=_,le=Go(s),de=[];e:{var se=Oh.get(e);if(se!==void 0){var ae=na,ve=e;switch(e){case"keypress":if(sa(s)===0)break e;case"keydown":case"keyup":ae=kv;break;case"focusin":ve="focus",ae=el;break;case"focusout":ve="blur",ae=el;break;case"beforeblur":case"afterblur":ae=el;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ae=ah;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ae=mv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ae=Rv;break;case Th:case Ah:case Rh:ae=vv;break;case Dh:ae=Ov;break;case"scroll":case"scrollend":ae=fv;break;case"wheel":ae=Lv;break;case"copy":case"cut":case"paste":ae=yv;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=jv}var Se=(t&4)!==0,Ke=!Se&&(e==="scroll"||e==="scrollend"),X=Se?se!==null?se+"Capture":null:se;Se=[];for(var W=ie,te;W!==null;){var ue=W;if(te=ue.stateNode,ue=ue.tag,ue!==5&&ue!==26&&ue!==27||te===null||X===null||(ue=qr(W,X),ue!=null&&Se.push(wn(W,ue,te))),Ke)break;W=W.return}0<Se.length&&(se=new ae(se,ve,null,s,le),de.push({event:se,listeners:Se}))}}if((t&7)===0){e:{if(se=e==="mouseover"||e==="pointerover",ae=e==="mouseout"||e==="pointerout",se&&s!==Vo&&(ve=s.relatedTarget||s.fromElement)&&(Ys(ve)||ve[Gs]))break e;if((ae||se)&&(se=le.window===le?le:(se=le.ownerDocument)?se.defaultView||se.parentWindow:window,ae?(ve=s.relatedTarget||s.toElement,ae=ie,ve=ve?Ys(ve):null,ve!==null&&(Ke=k(ve),Se=ve.tag,ve!==Ke||Se!==5&&Se!==27&&Se!==6)&&(ve=null)):(ae=null,ve=ie),ae!==ve)){if(Se=ah,ue="onMouseLeave",X="onMouseEnter",W="mouse",(e==="pointerout"||e==="pointerover")&&(Se=lh,ue="onPointerLeave",X="onPointerEnter",W="pointer"),Ke=ae==null?se:Zr(ae),te=ve==null?se:Zr(ve),se=new Se(ue,W+"leave",ae,s,le),se.target=Ke,se.relatedTarget=te,ue=null,Ys(le)===ie&&(Se=new Se(X,W+"enter",ve,s,le),Se.target=te,Se.relatedTarget=Ke,ue=Se),Ke=ue,ae&&ve)t:{for(Se=Ng,X=ae,W=ve,te=0,ue=X;ue;ue=Se(ue))te++;ue=0;for(var ye=W;ye;ye=Se(ye))ue++;for(;0<te-ue;)X=Se(X),te--;for(;0<ue-te;)W=Se(W),ue--;for(;te--;){if(X===W||W!==null&&X===W.alternate){Se=X;break t}X=Se(X),W=Se(W)}Se=null}else Se=null;ae!==null&&em(de,se,ae,Se,!1),ve!==null&&Ke!==null&&em(de,Ke,ve,Se,!0)}}e:{if(se=ie?Zr(ie):window,ae=se.nodeName&&se.nodeName.toLowerCase(),ae==="select"||ae==="input"&&se.type==="file")var Be=ph;else if(mh(se))if(vh)Be=Fv;else{Be=Zv;var ge=$v}else ae=se.nodeName,!ae||ae.toLowerCase()!=="input"||se.type!=="checkbox"&&se.type!=="radio"?ie&&Ko(ie.elementType)&&(Be=ph):Be=qv;if(Be&&(Be=Be(e,ie))){_h(de,Be,s,le);break e}ge&&ge(e,se,ie),e==="focusout"&&ie&&se.type==="number"&&ie.memoizedProps.value!=null&&Fo(se,"number",se.value)}switch(ge=ie?Zr(ie):window,e){case"focusin":(mh(ge)||ge.contentEditable==="true")&&(rr=ge,al=ie,Jr=null);break;case"focusout":Jr=al=rr=null;break;case"mousedown":ol=!0;break;case"contextmenu":case"mouseup":case"dragend":ol=!1,Eh(de,s,le);break;case"selectionchange":if(Vv)break;case"keydown":case"keyup":Eh(de,s,le)}var ke;if(il)e:{switch(e){case"compositionstart":var Me="onCompositionStart";break e;case"compositionend":Me="onCompositionEnd";break e;case"compositionupdate":Me="onCompositionUpdate";break e}Me=void 0}else sr?fh(e,s)&&(Me="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Me="onCompositionStart");Me&&(ch&&s.locale!=="ko"&&(sr||Me!=="onCompositionStart"?Me==="onCompositionEnd"&&sr&&(ke=rh()):(Fi=le,Xo="value"in Fi?Fi.value:Fi.textContent,sr=!0)),ge=Ya(ie,Me),0<ge.length&&(Me=new oh(Me,e,null,s,le),de.push({event:Me,listeners:ge}),ke?Me.data=ke:(ke=dh(s),ke!==null&&(Me.data=ke)))),(ke=zv?Hv(e,s):Uv(e,s))&&(Me=Ya(ie,"onBeforeInput"),0<Me.length&&(ge=new oh("onBeforeInput","beforeinput",null,s,le),de.push({event:ge,listeners:Me}),ge.data=ke)),Dg(de,e,ie,s,le)}Jd(de,t)})}function wn(e,t,s){return{instance:e,listener:t,currentTarget:s}}function Ya(e,t){for(var s=t+"Capture",n=[];e!==null;){var l=e,_=l.stateNode;if(l=l.tag,l!==5&&l!==26&&l!==27||_===null||(l=qr(e,s),l!=null&&n.unshift(wn(e,l,_)),l=qr(e,t),l!=null&&n.push(wn(e,l,_))),e.tag===3)return n;e=e.return}return[]}function Ng(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function em(e,t,s,n,l){for(var _=t._reactName,D=[];s!==null&&s!==n;){var z=s,G=z.alternate,ie=z.stateNode;if(z=z.tag,G!==null&&G===n)break;z!==5&&z!==26&&z!==27||ie===null||(G=ie,l?(ie=qr(s,_),ie!=null&&D.unshift(wn(s,ie,G))):l||(ie=qr(s,_),ie!=null&&D.push(wn(s,ie,G)))),s=s.return}D.length!==0&&e.push({event:t,listeners:D})}var jg=/\r\n?/g,Bg=/\u0000|\uFFFD/g;function tm(e){return(typeof e=="string"?e:""+e).replace(jg,`
|
|
49
|
+
`).replace(Bg,"")}function im(e,t){return t=tm(t),tm(e)===t}function Fe(e,t,s,n,l,_){switch(s){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||er(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&er(e,""+n);break;case"className":Qn(e,"class",n);break;case"tabIndex":Qn(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":Qn(e,s,n);break;case"style":th(e,n,_);break;case"data":if(t!=="object"){Qn(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||s!=="href")){e.removeAttribute(s);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(s);break}n=ta(""+n),e.setAttribute(s,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof _=="function"&&(s==="formAction"?(t!=="input"&&Fe(e,t,"name",l.name,l,null),Fe(e,t,"formEncType",l.formEncType,l,null),Fe(e,t,"formMethod",l.formMethod,l,null),Fe(e,t,"formTarget",l.formTarget,l,null)):(Fe(e,t,"encType",l.encType,l,null),Fe(e,t,"method",l.method,l,null),Fe(e,t,"target",l.target,l,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(s);break}n=ta(""+n),e.setAttribute(s,n);break;case"onClick":n!=null&&(e.onclick=Ci);break;case"onScroll":n!=null&&De("scroll",e);break;case"onScrollEnd":n!=null&&De("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(o(61));if(s=n.__html,s!=null){if(l.children!=null)throw Error(o(60));e.innerHTML=s}}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}s=ta(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);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(s,""+n):e.removeAttribute(s);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(s,""):e.removeAttribute(s);break;case"capture":case"download":n===!0?e.setAttribute(s,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(s,n):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(s,n):e.removeAttribute(s);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(s):e.setAttribute(s,n);break;case"popover":De("beforetoggle",e),De("toggle",e),Jn(e,"popover",n);break;case"xlinkActuate":xi(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":xi(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":xi(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":xi(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":xi(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":xi(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":xi(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":xi(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":xi(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":Jn(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=uv.get(s)||s,Jn(e,s,n))}}function Mc(e,t,s,n,l,_){switch(s){case"style":th(e,n,_);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(o(61));if(s=n.__html,s!=null){if(l.children!=null)throw Error(o(60));e.innerHTML=s}}break;case"children":typeof n=="string"?er(e,n):(typeof n=="number"||typeof n=="bigint")&&er(e,""+n);break;case"onScroll":n!=null&&De("scroll",e);break;case"onScrollEnd":n!=null&&De("scrollend",e);break;case"onClick":n!=null&&(e.onclick=Ci);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ku.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(l=s.endsWith("Capture"),t=s.slice(2,l?s.length-7:void 0),_=e[Dt]||null,_=_!=null?_[s]:null,typeof _=="function"&&e.removeEventListener(t,_,l),typeof n=="function")){typeof _!="function"&&_!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(t,n,l);break e}s in e?e[s]=n:n===!0?e.setAttribute(s,""):Jn(e,s,n)}}}function wt(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":De("error",e),De("load",e);var n=!1,l=!1,_;for(_ in s)if(s.hasOwnProperty(_)){var D=s[_];if(D!=null)switch(_){case"src":n=!0;break;case"srcSet":l=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Fe(e,t,_,D,s,null)}}l&&Fe(e,t,"srcSet",s.srcSet,s,null),n&&Fe(e,t,"src",s.src,s,null);return;case"input":De("invalid",e);var z=_=D=l=null,G=null,ie=null;for(n in s)if(s.hasOwnProperty(n)){var le=s[n];if(le!=null)switch(n){case"name":l=le;break;case"type":D=le;break;case"checked":G=le;break;case"defaultChecked":ie=le;break;case"value":_=le;break;case"defaultValue":z=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(o(137,t));break;default:Fe(e,t,n,le,s,null)}}Xu(e,_,z,G,ie,D,l,!1);return;case"select":De("invalid",e),n=D=_=null;for(l in s)if(s.hasOwnProperty(l)&&(z=s[l],z!=null))switch(l){case"value":_=z;break;case"defaultValue":D=z;break;case"multiple":n=z;default:Fe(e,t,l,z,s,null)}t=_,s=D,e.multiple=!!n,t!=null?Qs(e,!!n,t,!1):s!=null&&Qs(e,!!n,s,!0);return;case"textarea":De("invalid",e),_=l=n=null;for(D in s)if(s.hasOwnProperty(D)&&(z=s[D],z!=null))switch(D){case"value":n=z;break;case"defaultValue":l=z;break;case"children":_=z;break;case"dangerouslySetInnerHTML":if(z!=null)throw Error(o(91));break;default:Fe(e,t,D,z,s,null)}Qu(e,n,l,_);return;case"option":for(G in s)if(s.hasOwnProperty(G)&&(n=s[G],n!=null))switch(G){case"selected":e.selected=n&&typeof n!="function"&&typeof n!="symbol";break;default:Fe(e,t,G,n,s,null)}return;case"dialog":De("beforetoggle",e),De("toggle",e),De("cancel",e),De("close",e);break;case"iframe":case"object":De("load",e);break;case"video":case"audio":for(n=0;n<Cn.length;n++)De(Cn[n],e);break;case"image":De("error",e),De("load",e);break;case"details":De("toggle",e);break;case"embed":case"source":case"link":De("error",e),De("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 s)if(s.hasOwnProperty(ie)&&(n=s[ie],n!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Fe(e,t,ie,n,s,null)}return;default:if(Ko(t)){for(le in s)s.hasOwnProperty(le)&&(n=s[le],n!==void 0&&Mc(e,t,le,n,s,void 0));return}}for(z in s)s.hasOwnProperty(z)&&(n=s[z],n!=null&&Fe(e,t,z,n,s,null))}function zg(e,t,s,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var l=null,_=null,D=null,z=null,G=null,ie=null,le=null;for(ae in s){var de=s[ae];if(s.hasOwnProperty(ae)&&de!=null)switch(ae){case"checked":break;case"value":break;case"defaultValue":G=de;default:n.hasOwnProperty(ae)||Fe(e,t,ae,null,n,de)}}for(var se in n){var ae=n[se];if(de=s[se],n.hasOwnProperty(se)&&(ae!=null||de!=null))switch(se){case"type":_=ae;break;case"name":l=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&&Fe(e,t,se,ae,n,de)}}qo(e,D,z,G,ie,le,_,l);return;case"select":ae=D=z=se=null;for(_ in s)if(G=s[_],s.hasOwnProperty(_)&&G!=null)switch(_){case"value":break;case"multiple":ae=G;default:n.hasOwnProperty(_)||Fe(e,t,_,null,n,G)}for(l in n)if(_=n[l],G=s[l],n.hasOwnProperty(l)&&(_!=null||G!=null))switch(l){case"value":se=_;break;case"defaultValue":z=_;break;case"multiple":D=_;default:_!==G&&Fe(e,t,l,_,n,G)}t=z,s=D,n=ae,se!=null?Qs(e,!!s,se,!1):!!n!=!!s&&(t!=null?Qs(e,!!s,t,!0):Qs(e,!!s,s?[]:"",!1));return;case"textarea":ae=se=null;for(z in s)if(l=s[z],s.hasOwnProperty(z)&&l!=null&&!n.hasOwnProperty(z))switch(z){case"value":break;case"children":break;default:Fe(e,t,z,null,n,l)}for(D in n)if(l=n[D],_=s[D],n.hasOwnProperty(D)&&(l!=null||_!=null))switch(D){case"value":se=l;break;case"defaultValue":ae=l;break;case"children":break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(o(91));break;default:l!==_&&Fe(e,t,D,l,n,_)}Ju(e,se,ae);return;case"option":for(var ve in s)if(se=s[ve],s.hasOwnProperty(ve)&&se!=null&&!n.hasOwnProperty(ve))switch(ve){case"selected":e.selected=!1;break;default:Fe(e,t,ve,null,n,se)}for(G in n)if(se=n[G],ae=s[G],n.hasOwnProperty(G)&&se!==ae&&(se!=null||ae!=null))switch(G){case"selected":e.selected=se&&typeof se!="function"&&typeof se!="symbol";break;default:Fe(e,t,G,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 Se in s)se=s[Se],s.hasOwnProperty(Se)&&se!=null&&!n.hasOwnProperty(Se)&&Fe(e,t,Se,null,n,se);for(ie in n)if(se=n[ie],ae=s[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:Fe(e,t,ie,se,n,ae)}return;default:if(Ko(t)){for(var Ke in s)se=s[Ke],s.hasOwnProperty(Ke)&&se!==void 0&&!n.hasOwnProperty(Ke)&&Mc(e,t,Ke,void 0,n,se);for(le in n)se=n[le],ae=s[le],!n.hasOwnProperty(le)||se===ae||se===void 0&&ae===void 0||Mc(e,t,le,se,n,ae);return}}for(var X in s)se=s[X],s.hasOwnProperty(X)&&se!=null&&!n.hasOwnProperty(X)&&Fe(e,t,X,null,n,se);for(de in n)se=n[de],ae=s[de],!n.hasOwnProperty(de)||se===ae||se==null&&ae==null||Fe(e,t,de,se,n,ae)}function sm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Hg(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,s=performance.getEntriesByType("resource"),n=0;n<s.length;n++){var l=s[n],_=l.transferSize,D=l.initiatorType,z=l.duration;if(_&&z&&sm(D)){for(D=0,z=l.responseEnd,n+=1;n<s.length;n++){var G=s[n],ie=G.startTime;if(ie>z)break;var le=G.transferSize,de=G.initiatorType;le&&sm(de)&&(G=G.responseEnd,D+=le*(G<z?1:(z-ie)/(G-ie)))}if(--n,t+=8*(_+D)/(l.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 Lc=null,Nc=null;function Wa(e){return e.nodeType===9?e:e.ownerDocument}function rm(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 nm(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 jc(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 Bc=null;function Ug(){var e=window.event;return e&&e.type==="popstate"?e===Bc?!1:(Bc=e,!0):(Bc=null,!1)}var am=typeof setTimeout=="function"?setTimeout:void 0,Ig=typeof clearTimeout=="function"?clearTimeout:void 0,om=typeof Promise=="function"?Promise:void 0,Pg=typeof queueMicrotask=="function"?queueMicrotask:typeof om<"u"?function(e){return om.resolve(null).then(e).catch($g)}:am;function $g(e){setTimeout(function(){throw e})}function ls(e){return e==="head"}function lm(e,t){var s=t,n=0;do{var l=s.nextSibling;if(e.removeChild(s),l&&l.nodeType===8)if(s=l.data,s==="/$"||s==="/&"){if(n===0){e.removeChild(l),Or(t);return}n--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")n++;else if(s==="html")En(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,En(s);for(var _=s.firstChild;_;){var D=_.nextSibling,z=_.nodeName;_[$r]||z==="SCRIPT"||z==="STYLE"||z==="LINK"&&_.rel.toLowerCase()==="stylesheet"||s.removeChild(_),_=D}}else s==="body"&&En(e.ownerDocument.body);s=l}while(s);Or(t)}function cm(e,t){var s=e;e=0;do{var n=s.nextSibling;if(s.nodeType===1?t?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(t?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),n&&n.nodeType===8)if(s=n.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=n}while(s)}function zc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var s=t;switch(t=t.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":zc(s),$o(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function Zg(e,t,s,n){for(;e.nodeType===1;){var l=s;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[$r])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(_=e.getAttribute("rel"),_==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(_!==l.rel||e.getAttribute("href")!==(l.href==null||l.href===""?null:l.href)||e.getAttribute("crossorigin")!==(l.crossOrigin==null?null:l.crossOrigin)||e.getAttribute("title")!==(l.title==null?null:l.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(_=e.getAttribute("src"),(_!==(l.src==null?null:l.src)||e.getAttribute("type")!==(l.type==null?null:l.type)||e.getAttribute("crossorigin")!==(l.crossOrigin==null?null:l.crossOrigin))&&_&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var _=l.name==null?null:""+l.name;if(l.type==="hidden"&&e.getAttribute("name")===_)return e}else return e;if(e=si(e.nextSibling),e===null)break}return null}function qg(e,t,s){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=si(e.nextSibling),e===null))return null;return e}function um(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=si(e.nextSibling),e===null))return null;return e}function Hc(e){return e.data==="$?"||e.data==="$~"}function Uc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Fg(e,t){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||s.readyState!=="loading")t();else{var n=function(){t(),s.removeEventListener("DOMContentLoaded",n)};s.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function si(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 Ic=null;function hm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(t===0)return si(e.nextSibling);t--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||t++}e=e.nextSibling}return null}function fm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(t===0)return e;t--}else s!=="/$"&&s!=="/&"||t++}e=e.previousSibling}return null}function dm(e,t,s){switch(t=Wa(s),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 En(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);$o(e)}var ri=new Map,mm=new Set;function Xa(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ui=Q.d;Q.d={f:Kg,r:Vg,D:Gg,C:Yg,L:Wg,m:Xg,X:Qg,S:Jg,M:e0};function Kg(){var e=Ui.f(),t=$a();return e||t}function Vg(e){var t=Ws(e);t!==null&&t.tag===5&&t.type==="form"?Of(t):Ui.r(e)}var Ar=typeof document>"u"?null:document;function _m(e,t,s){var n=Ar;if(n&&typeof t=="string"&&t){var l=Wt(t);l='link[rel="'+e+'"][href="'+l+'"]',typeof s=="string"&&(l+='[crossorigin="'+s+'"]'),mm.has(l)||(mm.add(l),e={rel:e,crossOrigin:s,href:t},n.querySelector(l)===null&&(t=n.createElement("link"),wt(t,"link",e),gt(t),n.head.appendChild(t)))}}function Gg(e){Ui.D(e),_m("dns-prefetch",e,null)}function Yg(e,t){Ui.C(e,t),_m("preconnect",e,t)}function Wg(e,t,s){Ui.L(e,t,s);var n=Ar;if(n&&e&&t){var l='link[rel="preload"][as="'+Wt(t)+'"]';t==="image"&&s&&s.imageSrcSet?(l+='[imagesrcset="'+Wt(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(l+='[imagesizes="'+Wt(s.imageSizes)+'"]')):l+='[href="'+Wt(e)+'"]';var _=l;switch(t){case"style":_=Rr(e);break;case"script":_=Dr(e)}ri.has(_)||(e=d({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),ri.set(_,e),n.querySelector(l)!==null||t==="style"&&n.querySelector(kn(_))||t==="script"&&n.querySelector(Tn(_))||(t=n.createElement("link"),wt(t,"link",e),gt(t),n.head.appendChild(t)))}}function Xg(e,t){Ui.m(e,t);var s=Ar;if(s&&e){var n=t&&typeof t.as=="string"?t.as:"script",l='link[rel="modulepreload"][as="'+Wt(n)+'"][href="'+Wt(e)+'"]',_=l;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":_=Dr(e)}if(!ri.has(_)&&(e=d({rel:"modulepreload",href:e},t),ri.set(_,e),s.querySelector(l)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Tn(_)))return}n=s.createElement("link"),wt(n,"link",e),gt(n),s.head.appendChild(n)}}}function Jg(e,t,s){Ui.S(e,t,s);var n=Ar;if(n&&e){var l=Xs(n).hoistableStyles,_=Rr(e);t=t||"default";var D=l.get(_);if(!D){var z={loading:0,preload:null};if(D=n.querySelector(kn(_)))z.loading=5;else{e=d({rel:"stylesheet",href:e,"data-precedence":t},s),(s=ri.get(_))&&Pc(e,s);var G=D=n.createElement("link");gt(G),wt(G,"link",e),G._p=new Promise(function(ie,le){G.onload=ie,G.onerror=le}),G.addEventListener("load",function(){z.loading|=1}),G.addEventListener("error",function(){z.loading|=2}),z.loading|=4,Ja(D,t,n)}D={type:"stylesheet",instance:D,count:1,state:z},l.set(_,D)}}}function Qg(e,t){Ui.X(e,t);var s=Ar;if(s&&e){var n=Xs(s).hoistableScripts,l=Dr(e),_=n.get(l);_||(_=s.querySelector(Tn(l)),_||(e=d({src:e,async:!0},t),(t=ri.get(l))&&$c(e,t),_=s.createElement("script"),gt(_),wt(_,"link",e),s.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},n.set(l,_))}}function e0(e,t){Ui.M(e,t);var s=Ar;if(s&&e){var n=Xs(s).hoistableScripts,l=Dr(e),_=n.get(l);_||(_=s.querySelector(Tn(l)),_||(e=d({src:e,async:!0,type:"module"},t),(t=ri.get(l))&&$c(e,t),_=s.createElement("script"),gt(_),wt(_,"link",e),s.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},n.set(l,_))}}function pm(e,t,s,n){var l=(l=he.current)?Xa(l):null;if(!l)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(t=Rr(s.href),s=Xs(l).hoistableStyles,n=s.get(t),n||(n={type:"style",instance:null,count:0,state:null},s.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=Rr(s.href);var _=Xs(l).hoistableStyles,D=_.get(e);if(D||(l=l.ownerDocument||l,D={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},_.set(e,D),(_=l.querySelector(kn(e)))&&!_._p&&(D.instance=_,D.state.loading=5),ri.has(e)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},ri.set(e,s),_||t0(l,e,s,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=s.async,s=s.src,typeof s=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Dr(s),s=Xs(l).hoistableScripts,n=s.get(t),n||(n={type:"script",instance:null,count:0,state:null},s.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Rr(e){return'href="'+Wt(e)+'"'}function kn(e){return'link[rel="stylesheet"]['+e+"]"}function vm(e){return d({},e,{"data-precedence":e.precedence,precedence:null})}function t0(e,t,s,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}),wt(t,"link",s),gt(t),e.head.appendChild(t))}function Dr(e){return'[src="'+Wt(e)+'"]'}function Tn(e){return"script[async]"+e}function gm(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+Wt(s.href)+'"]');if(n)return t.instance=n,gt(n),n;var l=d({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),gt(n),wt(n,"style",l),Ja(n,s.precedence,e),t.instance=n;case"stylesheet":l=Rr(s.href);var _=e.querySelector(kn(l));if(_)return t.state.loading|=4,t.instance=_,gt(_),_;n=vm(s),(l=ri.get(l))&&Pc(n,l),_=(e.ownerDocument||e).createElement("link"),gt(_);var D=_;return D._p=new Promise(function(z,G){D.onload=z,D.onerror=G}),wt(_,"link",n),t.state.loading|=4,Ja(_,s.precedence,e),t.instance=_;case"script":return _=Dr(s.src),(l=e.querySelector(Tn(_)))?(t.instance=l,gt(l),l):(n=s,(l=ri.get(_))&&(n=d({},s),$c(n,l)),e=e.ownerDocument||e,l=e.createElement("script"),gt(l),wt(l,"link",n),e.head.appendChild(l),t.instance=l);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,Ja(n,s.precedence,e));return t.instance}function Ja(e,t,s){for(var n=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),l=n.length?n[n.length-1]:null,_=l,D=0;D<n.length;D++){var z=n[D];if(z.dataset.precedence===t)_=z;else if(_!==l)break}_?_.parentNode.insertBefore(e,_.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function Pc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function $c(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Qa=null;function ym(e,t,s){if(Qa===null){var n=new Map,l=Qa=new Map;l.set(s,n)}else l=Qa,n=l.get(s),n||(n=new Map,l.set(s,n));if(n.has(e))return n;for(n.set(e,null),s=s.getElementsByTagName(e),l=0;l<s.length;l++){var _=s[l];if(!(_[$r]||_[bt]||e==="link"&&_.getAttribute("rel")==="stylesheet")&&_.namespaceURI!=="http://www.w3.org/2000/svg"){var D=_.getAttribute(t)||"";D=e+D;var z=n.get(D);z?z.push(_):n.set(D,[_])}}return n}function bm(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function i0(e,t,s){if(s===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 Sm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function s0(e,t,s,n){if(s.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var l=Rr(n.href),_=t.querySelector(kn(l));if(_){t=_._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=eo.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=_,gt(_);return}_=t.ownerDocument||t,n=vm(n),(l=ri.get(l))&&Pc(n,l),_=_.createElement("link"),gt(_);var D=_;D._p=new Promise(function(z,G){D.onload=z,D.onerror=G}),wt(_,"link",n),s.instance=_}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=eo.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var Zc=0;function r0(e,t){return e.stylesheets&&e.count===0&&io(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var n=setTimeout(function(){if(e.stylesheets&&io(e,e.stylesheets),e.unsuspend){var _=e.unsuspend;e.unsuspend=null,_()}},6e4+t);0<e.imgBytes&&Zc===0&&(Zc=62500*Hg());var l=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&io(e,e.stylesheets),e.unsuspend)){var _=e.unsuspend;e.unsuspend=null,_()}},(e.imgBytes>Zc?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(l)}}:null}function eo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)io(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var to=null;function io(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,to=new Map,t.forEach(n0,e),to=null,eo.call(e))}function n0(e,t){if(!(t.state.loading&4)){var s=to.get(e);if(s)var n=s.get(null);else{s=new Map,to.set(e,s);for(var l=e.querySelectorAll("link[data-precedence],style[data-precedence]"),_=0;_<l.length;_++){var D=l[_];(D.nodeName==="LINK"||D.getAttribute("media")!=="not all")&&(s.set(D.dataset.precedence,D),n=D)}n&&s.set(null,n)}l=t.instance,D=l.getAttribute("data-precedence"),_=s.get(D)||n,_===n&&s.set(null,l),s.set(D,l),this.count++,n=eo.bind(this),l.addEventListener("load",n),l.addEventListener("error",n),_?_.parentNode.insertBefore(l,_.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(l,e.firstChild)),t.state.loading|=4}}var An={$$typeof:v,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function a0(e,t,s,n,l,_,D,z,G){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=Ho(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ho(0),this.hiddenUpdates=Ho(null),this.identifierPrefix=n,this.onUncaughtError=l,this.onCaughtError=_,this.onRecoverableError=D,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=G,this.incompleteTransitions=new Map}function xm(e,t,s,n,l,_,D,z,G,ie,le,de){return e=new a0(e,t,s,D,G,ie,le,de,z),t=1,_===!0&&(t|=24),_=$t(3,null,null,t),e.current=_,_.stateNode=e,t=xl(),t.refCount++,e.pooledCache=t,t.refCount++,_.memoizedState={element:n,isDehydrated:s,cache:t},kl(_),e}function Cm(e){return e?(e=or,e):or}function wm(e,t,s,n,l,_){l=Cm(l),n.context===null?n.context=l:n.pendingContext=l,n=Xi(t),n.payload={element:s},_=_===void 0?null:_,_!==null&&(n.callback=_),s=Ji(e,n,t),s!==null&&(Bt(s,e,t),an(s,e,t))}function Em(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function qc(e,t){Em(e,t),(e=e.alternate)&&Em(e,t)}function km(e){if(e.tag===13||e.tag===31){var t=Ds(e,67108864);t!==null&&Bt(t,e,67108864),qc(e,67108864)}}function Tm(e){if(e.tag===13||e.tag===31){var t=Vt();t=Uo(t);var s=Ds(e,t);s!==null&&Bt(s,e,t),qc(e,t)}}var so=!0;function o0(e,t,s,n){var l=F.T;F.T=null;var _=Q.p;try{Q.p=2,Fc(e,t,s,n)}finally{Q.p=_,F.T=l}}function l0(e,t,s,n){var l=F.T;F.T=null;var _=Q.p;try{Q.p=8,Fc(e,t,s,n)}finally{Q.p=_,F.T=l}}function Fc(e,t,s,n){if(so){var l=Kc(n);if(l===null)Oc(e,t,n,ro,s),Rm(e,n);else if(u0(l,e,t,s,n))n.stopPropagation();else if(Rm(e,n),t&4&&-1<c0.indexOf(e)){for(;l!==null;){var _=Ws(l);if(_!==null)switch(_.tag){case 3:if(_=_.stateNode,_.current.memoizedState.isDehydrated){var D=Es(_.pendingLanes);if(D!==0){var z=_;for(z.pendingLanes|=2,z.entangledLanes|=2;D;){var G=1<<31-It(D);z.entanglements[1]|=G,D&=~G}gi(_),(He&6)===0&&(Ia=pt()+500,xn(0))}}break;case 31:case 13:z=Ds(_,2),z!==null&&Bt(z,_,2),$a(),qc(_,2)}if(_=Kc(n),_===null&&Oc(e,t,n,ro,s),_===l)break;l=_}l!==null&&n.stopPropagation()}else Oc(e,t,n,null,s)}}function Kc(e){return e=Go(e),Vc(e)}var ro=null;function Vc(e){if(ro=null,e=Ys(e),e!==null){var t=k(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=T(t),e!==null)return e;e=null}else if(s===31){if(e=c(t),e!==null)return e;e=null}else if(s===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return ro=e,null}function Am(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(Gt()){case $i:return 2;case Ks:return 8;case Ht:case Vs:return 32;case oi:return 268435456;default:return 32}default:return 32}}var Gc=!1,cs=null,us=null,hs=null,Rn=new Map,Dn=new Map,fs=[],c0="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 Rm(e,t){switch(e){case"focusin":case"focusout":cs=null;break;case"dragenter":case"dragleave":us=null;break;case"mouseover":case"mouseout":hs=null;break;case"pointerover":case"pointerout":Rn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Dn.delete(t.pointerId)}}function On(e,t,s,n,l,_){return e===null||e.nativeEvent!==_?(e={blockedOn:t,domEventName:s,eventSystemFlags:n,nativeEvent:_,targetContainers:[l]},t!==null&&(t=Ws(t),t!==null&&km(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),e)}function u0(e,t,s,n,l){switch(t){case"focusin":return cs=On(cs,e,t,s,n,l),!0;case"dragenter":return us=On(us,e,t,s,n,l),!0;case"mouseover":return hs=On(hs,e,t,s,n,l),!0;case"pointerover":var _=l.pointerId;return Rn.set(_,On(Rn.get(_)||null,e,t,s,n,l)),!0;case"gotpointercapture":return _=l.pointerId,Dn.set(_,On(Dn.get(_)||null,e,t,s,n,l)),!0}return!1}function Dm(e){var t=Ys(e.target);if(t!==null){var s=k(t);if(s!==null){if(t=s.tag,t===13){if(t=T(s),t!==null){e.blockedOn=t,Zu(e.priority,function(){Tm(s)});return}}else if(t===31){if(t=c(s),t!==null){e.blockedOn=t,Zu(e.priority,function(){Tm(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function no(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=Kc(e.nativeEvent);if(s===null){s=e.nativeEvent;var n=new s.constructor(s.type,s);Vo=n,s.target.dispatchEvent(n),Vo=null}else return t=Ws(s),t!==null&&km(t),e.blockedOn=s,!1;t.shift()}return!0}function Om(e,t,s){no(e)&&s.delete(t)}function h0(){Gc=!1,cs!==null&&no(cs)&&(cs=null),us!==null&&no(us)&&(us=null),hs!==null&&no(hs)&&(hs=null),Rn.forEach(Om),Dn.forEach(Om)}function ao(e,t){e.blockedOn===t&&(e.blockedOn=null,Gc||(Gc=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,h0)))}var oo=null;function Mm(e){oo!==e&&(oo=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){oo===e&&(oo=null);for(var t=0;t<e.length;t+=3){var s=e[t],n=e[t+1],l=e[t+2];if(typeof n!="function"){if(Vc(n||s)===null)continue;break}var _=Ws(s);_!==null&&(e.splice(t,3),t-=3,Kl(_,{pending:!0,data:l,method:s.method,action:n},n,l))}}))}function Or(e){function t(G){return ao(G,e)}cs!==null&&ao(cs,e),us!==null&&ao(us,e),hs!==null&&ao(hs,e),Rn.forEach(t),Dn.forEach(t);for(var s=0;s<fs.length;s++){var n=fs[s];n.blockedOn===e&&(n.blockedOn=null)}for(;0<fs.length&&(s=fs[0],s.blockedOn===null);)Dm(s),s.blockedOn===null&&fs.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(n=0;n<s.length;n+=3){var l=s[n],_=s[n+1],D=l[Dt]||null;if(typeof _=="function")D||Mm(s);else if(D){var z=null;if(_&&_.hasAttribute("formAction")){if(l=_,D=_[Dt]||null)z=D.formAction;else if(Vc(l)!==null)continue}else z=D.action;typeof z=="function"?s[n+1]=z:(s.splice(n,3),n-=3),Mm(s)}}}function Lm(){function e(_){_.canIntercept&&_.info==="react-transition"&&_.intercept({handler:function(){return new Promise(function(D){return l=D})},focusReset:"manual",scroll:"manual"})}function t(){l!==null&&(l(),l=null),n||setTimeout(s,20)}function s(){if(!n&&!navigation.transition){var _=navigation.currentEntry;_&&_.url!=null&&navigation.navigate(_.url,{state:_.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,l=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(s,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),l!==null&&(l(),l=null)}}}function Yc(e){this._internalRoot=e}lo.prototype.render=Yc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var s=t.current,n=Vt();wm(s,n,e,t,null,null)},lo.prototype.unmount=Yc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;wm(e.current,2,null,e,null,null),$a(),t[Gs]=null}};function lo(e){this._internalRoot=e}lo.prototype.unstable_scheduleHydration=function(e){if(e){var t=$u();e={blockedOn:null,target:e,priority:t};for(var s=0;s<fs.length&&t!==0&&t<fs[s].priority;s++);fs.splice(s,0,e),s===0&&Dm(e)}};var Nm=r.version;if(Nm!=="19.2.4")throw Error(o(527,Nm,"19.2.4"));Q.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=h(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var f0={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:F,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var co=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!co.isDisabled&&co.supportsFiber)try{ws=co.inject(f0),Ut=co}catch{}}return Ln.createRoot=function(e,t){if(!g(e))throw Error(o(299));var s=!1,n="",l=Pf,_=$f,D=Zf;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(l=t.onUncaughtError),t.onCaughtError!==void 0&&(_=t.onCaughtError),t.onRecoverableError!==void 0&&(D=t.onRecoverableError)),t=xm(e,1,!1,null,null,s,n,null,l,_,D,Lm),e[Gs]=t.current,Dc(e),new Yc(t)},Ln.hydrateRoot=function(e,t,s){if(!g(e))throw Error(o(299));var n=!1,l="",_=Pf,D=$f,z=Zf,G=null;return s!=null&&(s.unstable_strictMode===!0&&(n=!0),s.identifierPrefix!==void 0&&(l=s.identifierPrefix),s.onUncaughtError!==void 0&&(_=s.onUncaughtError),s.onCaughtError!==void 0&&(D=s.onCaughtError),s.onRecoverableError!==void 0&&(z=s.onRecoverableError),s.formState!==void 0&&(G=s.formState)),t=xm(e,1,!0,t,s??null,n,l,G,_,D,z,Lm),t.context=Cm(null),s=t.current,n=Vt(),n=Uo(n),l=Xi(n),l.callback=null,Ji(s,l,n),s=n,t.current.lanes=s,Pr(t,s),gi(t),e[Gs]=t.current,Dc(e),new lo(t)},Ln.version="19.2.4",Ln}var qm;function w0(){if(qm)return Jc.exports;qm=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(r){console.error(r)}}return i(),Jc.exports=C0(),Jc.exports}var E0=w0();const k0=U_(E0);/**
|
|
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 Fm="popstate";function Km(i){return typeof i=="object"&&i!=null&&"pathname"in i&&"search"in i&&"hash"in i&&"state"in i&&"key"in i}function T0(i={}){function r(o,g){var h;let k=(h=g.state)==null?void 0:h.masked,{pathname:T,search:c,hash:u}=k||o.location;return fu("",{pathname:T,search:c,hash:u},g.state&&g.state.usr||null,g.state&&g.state.key||"default",k?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function a(o,g){return typeof g=="string"?g:In(g)}return R0(r,a,null,i)}function tt(i,r){if(i===!1||i===null||typeof i>"u")throw new Error(r)}function bi(i,r){if(!i){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function A0(){return Math.random().toString(36).substring(2,10)}function Vm(i,r){return{usr:i.state,key:i.key,idx:r,masked:i.unstable_mask?{pathname:i.pathname,search:i.search,hash:i.hash}:void 0}}function fu(i,r,a=null,o,g){return{pathname:typeof i=="string"?i:i.pathname,search:"",hash:"",...typeof r=="string"?zr(r):r,state:a,key:r&&r.key||o||A0(),unstable_mask:g}}function In({pathname:i="/",search:r="",hash:a=""}){return r&&r!=="?"&&(i+=r.charAt(0)==="?"?r:"?"+r),a&&a!=="#"&&(i+=a.charAt(0)==="#"?a:"#"+a),i}function zr(i){let r={};if(i){let a=i.indexOf("#");a>=0&&(r.hash=i.substring(a),i=i.substring(0,a));let o=i.indexOf("?");o>=0&&(r.search=i.substring(o),i=i.substring(0,o)),i&&(r.pathname=i)}return r}function R0(i,r,a,o={}){let{window:g=document.defaultView,v5Compat:k=!1}=o,T=g.history,c="POP",u=null,h=y();h==null&&(h=0,T.replaceState({...T.state,idx:h},""));function y(){return(T.state||{idx:null}).idx}function d(){c="POP";let m=y(),p=m==null?null:m-h;h=m,u&&u({action:c,location:x.location,delta:p})}function C(m,p){c="PUSH";let f=Km(m)?m:fu(x.location,m,p);h=y()+1;let v=Vm(f,h),S=x.createHref(f.unstable_mask||f);try{T.pushState(v,"",S)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;g.location.assign(S)}k&&u&&u({action:c,location:x.location,delta:1})}function E(m,p){c="REPLACE";let f=Km(m)?m:fu(x.location,m,p);h=y();let v=Vm(f,h),S=x.createHref(f.unstable_mask||f);T.replaceState(v,"",S),k&&u&&u({action:c,location:x.location,delta:0})}function O(m){return D0(m)}let x={get action(){return c},get location(){return i(g,T)},listen(m){if(u)throw new Error("A history only accepts one active listener");return g.addEventListener(Fm,d),u=m,()=>{g.removeEventListener(Fm,d),u=null}},createHref(m){return r(g,m)},createURL:O,encodeLocation(m){let p=O(m);return{pathname:p.pathname,search:p.search,hash:p.hash}},push:C,replace:E,go(m){return T.go(m)}};return x}function D0(i,r=!1){let a="http://localhost";typeof window<"u"&&(a=window.location.origin!=="null"?window.location.origin:window.location.href),tt(a,"No window.location.(origin|href) available to create URL");let o=typeof i=="string"?i:In(i);return o=o.replace(/ $/,"%20"),!r&&o.startsWith("//")&&(o=a+o),new URL(o,a)}function I_(i,r,a="/"){return O0(i,r,a,!1)}function O0(i,r,a,o){let g=typeof r=="string"?zr(r):r,k=Pi(g.pathname||"/",a);if(k==null)return null;let T=P_(i);M0(T);let c=null;for(let u=0;c==null&&u<T.length;++u){let h=Z0(k);c=P0(T[u],h,o)}return c}function P_(i,r=[],a=[],o="",g=!1){let k=(T,c,u=g,h)=>{let y={relativePath:h===void 0?T.path||"":h,caseSensitive:T.caseSensitive===!0,childrenIndex:c,route:T};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(o)&&u)return;tt(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 d=yi([o,y.relativePath]),C=a.concat(y);T.children&&T.children.length>0&&(tt(T.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),P_(T.children,r,C,d,u)),!(T.path==null&&!T.index)&&r.push({path:d,score:U0(d,T.index),routesMeta:C})};return i.forEach((T,c)=>{var u;if(T.path===""||!((u=T.path)!=null&&u.includes("?")))k(T,c);else for(let h of $_(T.path))k(T,c,!0,h)}),r}function $_(i){let r=i.split("/");if(r.length===0)return[];let[a,...o]=r,g=a.endsWith("?"),k=a.replace(/\?$/,"");if(o.length===0)return g?[k,""]:[k];let T=$_(o.join("/")),c=[];return c.push(...T.map(u=>u===""?k:[k,u].join("/"))),g&&c.push(...T),c.map(u=>i.startsWith("/")&&u===""?"/":u)}function M0(i){i.sort((r,a)=>r.score!==a.score?a.score-r.score:I0(r.routesMeta.map(o=>o.childrenIndex),a.routesMeta.map(o=>o.childrenIndex)))}var L0=/^:[\w-]+$/,N0=3,j0=2,B0=1,z0=10,H0=-2,Gm=i=>i==="*";function U0(i,r){let a=i.split("/"),o=a.length;return a.some(Gm)&&(o+=H0),r&&(o+=j0),a.filter(g=>!Gm(g)).reduce((g,k)=>g+(L0.test(k)?N0:k===""?B0:z0),o)}function I0(i,r){return i.length===r.length&&i.slice(0,-1).every((o,g)=>o===r[g])?i[i.length-1]-r[r.length-1]:0}function P0(i,r,a=!1){let{routesMeta:o}=i,g={},k="/",T=[];for(let c=0;c<o.length;++c){let u=o[c],h=c===o.length-1,y=k==="/"?r:r.slice(k.length)||"/",d=bo({path:u.relativePath,caseSensitive:u.caseSensitive,end:h},y),C=u.route;if(!d&&h&&a&&!o[o.length-1].route.index&&(d=bo({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},y)),!d)return null;Object.assign(g,d.params),T.push({params:g,pathname:yi([k,d.pathname]),pathnameBase:V0(yi([k,d.pathnameBase])),route:C}),d.pathnameBase!=="/"&&(k=yi([k,d.pathnameBase]))}return T}function bo(i,r){typeof i=="string"&&(i={path:i,caseSensitive:!1,end:!0});let[a,o]=$0(i.path,i.caseSensitive,i.end),g=r.match(a);if(!g)return null;let k=g[0],T=k.replace(/(.)\/+$/,"$1"),c=g.slice(1);return{params:o.reduce((h,{paramName:y,isOptional:d},C)=>{if(y==="*"){let O=c[C]||"";T=k.slice(0,k.length-O.length).replace(/(.)\/+$/,"$1")}const E=c[C];return d&&!E?h[y]=void 0:h[y]=(E||"").replace(/%2F/g,"/"),h},{}),pathname:k,pathnameBase:T,pattern:i}}function $0(i,r=!1,a=!0){bi(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,c,u,h,y)=>{if(o.push({paramName:c,isOptional:u!=null}),u){let d=y.charAt(h+T.length);return d&&d!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return i.endsWith("*")?(o.push({paramName:"*"}),g+=i==="*"||i==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?g+="\\/*$":i!==""&&i!=="/"&&(g+="(?:(?=\\/|$))"),[new RegExp(g,r?void 0:"i"),o]}function Z0(i){try{return i.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return bi(!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 (${r}).`),i}}function Pi(i,r){if(r==="/")return i;if(!i.toLowerCase().startsWith(r.toLowerCase()))return null;let a=r.endsWith("/")?r.length-1:r.length,o=i.charAt(a);return o&&o!=="/"?null:i.slice(a)||"/"}var q0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function F0(i,r="/"){let{pathname:a,search:o="",hash:g=""}=typeof i=="string"?zr(i):i,k;return a?(a=a.replace(/\/\/+/g,"/"),a.startsWith("/")?k=Ym(a.substring(1),"/"):k=Ym(a,r)):k=r,{pathname:k,search:G0(o),hash:Y0(g)}}function Ym(i,r){let a=r.replace(/\/+$/,"").split("/");return i.split("/").forEach(g=>{g===".."?a.length>1&&a.pop():g!=="."&&a.push(g)}),a.length>1?a.join("/"):"/"}function iu(i,r,a,o){return`Cannot include a '${i}' character in a manually specified \`to.${r}\` 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 K0(i){return i.filter((r,a)=>a===0||r.route.path&&r.route.path.length>0)}function Z_(i){let r=K0(i);return r.map((a,o)=>o===r.length-1?a.pathname:a.pathnameBase)}function xu(i,r,a,o=!1){let g;typeof i=="string"?g=zr(i):(g={...i},tt(!g.pathname||!g.pathname.includes("?"),iu("?","pathname","search",g)),tt(!g.pathname||!g.pathname.includes("#"),iu("#","pathname","hash",g)),tt(!g.search||!g.search.includes("#"),iu("#","search","hash",g)));let k=i===""||g.pathname==="",T=k?"/":g.pathname,c;if(T==null)c=a;else{let d=r.length-1;if(!o&&T.startsWith("..")){let C=T.split("/");for(;C[0]==="..";)C.shift(),d-=1;g.pathname=C.join("/")}c=d>=0?r[d]:"/"}let u=F0(g,c),h=T&&T!=="/"&&T.endsWith("/"),y=(k||T===".")&&a.endsWith("/");return!u.pathname.endsWith("/")&&(h||y)&&(u.pathname+="/"),u}var yi=i=>i.join("/").replace(/\/\/+/g,"/"),V0=i=>i.replace(/\/+$/,"").replace(/^\/*/,"/"),G0=i=>!i||i==="?"?"":i.startsWith("?")?i:"?"+i,Y0=i=>!i||i==="#"?"":i.startsWith("#")?i:"#"+i,W0=class{constructor(i,r,a,o=!1){this.status=i,this.statusText=r||"",this.internal=o,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function X0(i){return i!=null&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.internal=="boolean"&&"data"in i}function J0(i){return i.map(r=>r.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var q_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function F_(i,r){let a=i;if(typeof a!="string"||!q0.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let o=a,g=!1;if(q_)try{let k=new URL(window.location.href),T=a.startsWith("//")?new URL(k.protocol+a):new URL(a),c=Pi(T.pathname,r);T.origin===k.origin&&c!=null?a=c+T.search+T.hash:g=!0}catch{bi(!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 K_=["POST","PUT","PATCH","DELETE"];new Set(K_);var Q0=["GET",...K_];new Set(Q0);var Hr=P.createContext(null);Hr.displayName="DataRouter";var Ao=P.createContext(null);Ao.displayName="DataRouterState";var ey=P.createContext(!1),V_=P.createContext({isTransitioning:!1});V_.displayName="ViewTransition";var ty=P.createContext(new Map);ty.displayName="Fetchers";var iy=P.createContext(null);iy.displayName="Await";var ni=P.createContext(null);ni.displayName="Navigation";var $n=P.createContext(null);$n.displayName="Location";var di=P.createContext({outlet:null,matches:[],isDataRoute:!1});di.displayName="Route";var Cu=P.createContext(null);Cu.displayName="RouteError";var G_="REACT_ROUTER_ERROR",sy="REDIRECT",ry="ROUTE_ERROR_RESPONSE";function ny(i){if(i.startsWith(`${G_}:${sy}:{`))try{let r=JSON.parse(i.slice(28));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.location=="string"&&typeof r.reloadDocument=="boolean"&&typeof r.replace=="boolean")return r}catch{}}function ay(i){if(i.startsWith(`${G_}:${ry}:{`))try{let r=JSON.parse(i.slice(40));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string")return new W0(r.status,r.statusText,r.data)}catch{}}function oy(i,{relative:r}={}){tt(Zn(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:o}=P.useContext(ni),{hash:g,pathname:k,search:T}=qn(i,{relative:r}),c=k;return a!=="/"&&(c=k==="/"?a:yi([a,k])),o.createHref({pathname:c,search:T,hash:g})}function Zn(){return P.useContext($n)!=null}function ys(){return tt(Zn(),"useLocation() may be used only in the context of a <Router> component."),P.useContext($n).location}var Y_="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function W_(i){P.useContext(ni).static||P.useLayoutEffect(i)}function Ro(){let{isDataRoute:i}=P.useContext(di);return i?xy():ly()}function ly(){tt(Zn(),"useNavigate() may be used only in the context of a <Router> component.");let i=P.useContext(Hr),{basename:r,navigator:a}=P.useContext(ni),{matches:o}=P.useContext(di),{pathname:g}=ys(),k=JSON.stringify(Z_(o)),T=P.useRef(!1);return W_(()=>{T.current=!0}),P.useCallback((u,h={})=>{if(bi(T.current,Y_),!T.current)return;if(typeof u=="number"){a.go(u);return}let y=xu(u,JSON.parse(k),g,h.relative==="path");i==null&&r!=="/"&&(y.pathname=y.pathname==="/"?r:yi([r,y.pathname])),(h.replace?a.replace:a.push)(y,h.state,h)},[r,a,k,g,i])}var cy=P.createContext(null);function uy(i){let r=P.useContext(di).outlet;return P.useMemo(()=>r&&P.createElement(cy.Provider,{value:i},r),[r,i])}function X_(){let{matches:i}=P.useContext(di),r=i[i.length-1];return r?r.params:{}}function qn(i,{relative:r}={}){let{matches:a}=P.useContext(di),{pathname:o}=ys(),g=JSON.stringify(Z_(a));return P.useMemo(()=>xu(i,JSON.parse(g),o,r==="path"),[i,g,o,r])}function hy(i,r){return J_(i,r)}function J_(i,r,a){var m;tt(Zn(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=P.useContext(ni),{matches:g}=P.useContext(di),k=g[g.length-1],T=k?k.params:{},c=k?k.pathname:"/",u=k?k.pathnameBase:"/",h=k&&k.route;{let p=h&&h.path||"";ep(c,!h||p.endsWith("*")||p.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${p}">) 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="${p}"> to <Route path="${p==="/"?"*":`${p}/*`}">.`)}let y=ys(),d;if(r){let p=typeof r=="string"?zr(r):r;tt(u==="/"||((m=p.pathname)==null?void 0:m.startsWith(u)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${u}" but pathname "${p.pathname}" was given in the \`location\` prop.`),d=p}else d=y;let C=d.pathname||"/",E=C;if(u!=="/"){let p=u.replace(/^\//,"").split("/");E="/"+C.replace(/^\//,"").split("/").slice(p.length).join("/")}let O=I_(i,{pathname:E});bi(h||O!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),bi(O==null||O[O.length-1].route.element!==void 0||O[O.length-1].route.Component!==void 0||O[O.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.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 x=py(O&&O.map(p=>Object.assign({},p,{params:Object.assign({},T,p.params),pathname:yi([u,o.encodeLocation?o.encodeLocation(p.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:p.pathname]),pathnameBase:p.pathnameBase==="/"?u:yi([u,o.encodeLocation?o.encodeLocation(p.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:p.pathnameBase])})),g,a);return r&&x?P.createElement($n.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...d},navigationType:"POP"}},x):x}function fy(){let i=Sy(),r=X0(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},k={padding:"2px 4px",backgroundColor:o},T=null;return console.error("Error handled by React Router default ErrorBoundary:",i),T=P.createElement(P.Fragment,null,P.createElement("p",null,"💿 Hey developer 👋"),P.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",P.createElement("code",{style:k},"ErrorBoundary")," or"," ",P.createElement("code",{style:k},"errorElement")," prop on your route.")),P.createElement(P.Fragment,null,P.createElement("h2",null,"Unexpected Application Error!"),P.createElement("h3",{style:{fontStyle:"italic"}},r),a?P.createElement("pre",{style:g},a):null,T)}var dy=P.createElement(fy,null),Q_=class extends P.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,r){return r.location!==i.location||r.revalidation!=="idle"&&i.revalidation==="idle"?{error:i.error,location:i.location,revalidation:i.revalidation}:{error:i.error!==void 0?i.error:r.error,location:r.location,revalidation:i.revalidation||r.revalidation}}componentDidCatch(i,r){this.props.onError?this.props.onError(i,r):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=ay(i.digest);a&&(i=a)}let r=i!==void 0?P.createElement(di.Provider,{value:this.props.routeContext},P.createElement(Cu.Provider,{value:i,children:this.props.component})):this.props.children;return this.context?P.createElement(my,{error:i},r):r}};Q_.contextType=ey;var su=new WeakMap;function my({children:i,error:r}){let{basename:a}=P.useContext(ni);if(typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){let o=ny(r.digest);if(o){let g=su.get(r);if(g)throw g;let k=F_(o.location,a);if(q_&&!su.get(r))if(k.isExternal||o.reloadDocument)window.location.href=k.absoluteURL||k.to;else{const T=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(k.to,{replace:o.replace}));throw su.set(r,T),T}return P.createElement("meta",{httpEquiv:"refresh",content:`0;url=${k.absoluteURL||k.to}`})}}return i}function _y({routeContext:i,match:r,children:a}){let o=P.useContext(Hr);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),P.createElement(di.Provider,{value:i},a)}function py(i,r=[],a){let o=a==null?void 0:a.state;if(i==null){if(!o)return null;if(o.errors)i=o.matches;else if(r.length===0&&!o.initialized&&o.matches.length>0)i=o.matches;else return null}let g=i,k=o==null?void 0:o.errors;if(k!=null){let y=g.findIndex(d=>d.route.id&&(k==null?void 0:k[d.route.id])!==void 0);tt(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(k).join(",")}`),g=g.slice(0,Math.min(g.length,y+1))}let T=!1,c=-1;if(a&&o){T=o.renderFallback;for(let y=0;y<g.length;y++){let d=g[y];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(c=y),d.route.id){let{loaderData:C,errors:E}=o,O=d.route.loader&&!C.hasOwnProperty(d.route.id)&&(!E||E[d.route.id]===void 0);if(d.route.lazy||O){a.isStatic&&(T=!0),c>=0?g=g.slice(0,c+1):g=[g[0]];break}}}}let u=a==null?void 0:a.onError,h=o&&u?(y,d)=>{var C,E;u(y,{location:o.location,params:((E=(C=o.matches)==null?void 0:C[0])==null?void 0:E.params)??{},unstable_pattern:J0(o.matches),errorInfo:d})}:void 0;return g.reduceRight((y,d,C)=>{let E,O=!1,x=null,m=null;o&&(E=k&&d.route.id?k[d.route.id]:void 0,x=d.route.errorElement||dy,T&&(c<0&&C===0?(ep("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),O=!0,m=null):c===C&&(O=!0,m=d.route.hydrateFallbackElement||null)));let p=r.concat(g.slice(0,C+1)),f=()=>{let v;return E?v=x:O?v=m:d.route.Component?v=P.createElement(d.route.Component,null):d.route.element?v=d.route.element:v=y,P.createElement(_y,{match:d,routeContext:{outlet:y,matches:p,isDataRoute:o!=null},children:v})};return o&&(d.route.ErrorBoundary||d.route.errorElement||C===0)?P.createElement(Q_,{location:o.location,revalidation:o.revalidation,component:x,error:E,children:f(),routeContext:{outlet:null,matches:p,isDataRoute:!0},onError:h}):f()},null)}function wu(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function vy(i){let r=P.useContext(Hr);return tt(r,wu(i)),r}function gy(i){let r=P.useContext(Ao);return tt(r,wu(i)),r}function yy(i){let r=P.useContext(di);return tt(r,wu(i)),r}function Eu(i){let r=yy(i),a=r.matches[r.matches.length-1];return tt(a.route.id,`${i} can only be used on routes that contain a unique "id"`),a.route.id}function by(){return Eu("useRouteId")}function Sy(){var o;let i=P.useContext(Cu),r=gy("useRouteError"),a=Eu("useRouteError");return i!==void 0?i:(o=r.errors)==null?void 0:o[a]}function xy(){let{router:i}=vy("useNavigate"),r=Eu("useNavigate"),a=P.useRef(!1);return W_(()=>{a.current=!0}),P.useCallback(async(g,k={})=>{bi(a.current,Y_),a.current&&(typeof g=="number"?await i.navigate(g):await i.navigate(g,{fromRouteId:r,...k}))},[i,r])}var Wm={};function ep(i,r,a){!r&&!Wm[i]&&(Wm[i]=!0,bi(!1,a))}P.memo(Cy);function Cy({routes:i,future:r,state:a,isStatic:o,onError:g}){return J_(i,void 0,{state:a,isStatic:o,onError:g})}function wy(i){return uy(i.context)}function _s(i){tt(!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 Ey({basename:i="/",children:r=null,location:a,navigationType:o="POP",navigator:g,static:k=!1,unstable_useTransitions:T}){tt(!Zn(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=i.replace(/^\/*/,"/"),u=P.useMemo(()=>({basename:c,navigator:g,static:k,unstable_useTransitions:T,future:{}}),[c,g,k,T]);typeof a=="string"&&(a=zr(a));let{pathname:h="/",search:y="",hash:d="",state:C=null,key:E="default",unstable_mask:O}=a,x=P.useMemo(()=>{let m=Pi(h,c);return m==null?null:{location:{pathname:m,search:y,hash:d,state:C,key:E,unstable_mask:O},navigationType:o}},[c,h,y,d,C,E,o,O]);return bi(x!=null,`<Router basename="${c}"> is not able to match the URL "${h}${y}${d}" because it does not start with the basename, so the <Router> won't render anything.`),x==null?null:P.createElement(ni.Provider,{value:u},P.createElement($n.Provider,{children:r,value:x}))}function ky({children:i,location:r}){return hy(du(i),r)}function du(i,r=[]){let a=[];return P.Children.forEach(i,(o,g)=>{if(!P.isValidElement(o))return;let k=[...r,g];if(o.type===P.Fragment){a.push.apply(a,du(o.props.children,k));return}tt(o.type===_s,`[${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>`),tt(!o.props.index||!o.props.children,"An index route cannot have child routes.");let T={id:o.props.id||k.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=du(o.props.children,k)),a.push(T)}),a}var go="get",yo="application/x-www-form-urlencoded";function Do(i){return typeof HTMLElement<"u"&&i instanceof HTMLElement}function Ty(i){return Do(i)&&i.tagName.toLowerCase()==="button"}function Ay(i){return Do(i)&&i.tagName.toLowerCase()==="form"}function Ry(i){return Do(i)&&i.tagName.toLowerCase()==="input"}function Dy(i){return!!(i.metaKey||i.altKey||i.ctrlKey||i.shiftKey)}function Oy(i,r){return i.button===0&&(!r||r==="_self")&&!Dy(i)}var uo=null;function My(){if(uo===null)try{new FormData(document.createElement("form"),0),uo=!1}catch{uo=!0}return uo}var Ly=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ru(i){return i!=null&&!Ly.has(i)?(bi(!1,`"${i}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${yo}"`),null):i}function Ny(i,r){let a,o,g,k,T;if(Ay(i)){let c=i.getAttribute("action");o=c?Pi(c,r):null,a=i.getAttribute("method")||go,g=ru(i.getAttribute("enctype"))||yo,k=new FormData(i)}else if(Ty(i)||Ry(i)&&(i.type==="submit"||i.type==="image")){let c=i.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=i.getAttribute("formaction")||c.getAttribute("action");if(o=u?Pi(u,r):null,a=i.getAttribute("formmethod")||c.getAttribute("method")||go,g=ru(i.getAttribute("formenctype"))||ru(c.getAttribute("enctype"))||yo,k=new FormData(c,i),!My()){let{name:h,type:y,value:d}=i;if(y==="image"){let C=h?`${h}.`:"";k.append(`${C}x`,"0"),k.append(`${C}y`,"0")}else h&&k.append(h,d)}}else{if(Do(i))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=go,o=null,g=yo,T=i}return k&&g==="text/plain"&&(T=k,k=void 0),{action:o,method:a.toLowerCase(),encType:g,formData:k,body:T}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function ku(i,r){if(i===!1||i===null||typeof i>"u")throw new Error(r)}function jy(i,r,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}`:r&&Pi(g.pathname,r)==="/"?g.pathname=`${r.replace(/\/$/,"")}/_root.${o}`:g.pathname=`${g.pathname.replace(/\/$/,"")}.${o}`,g}async function By(i,r){if(i.id in r)return r[i.id];try{let a=await import(i.module);return r[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 zy(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 Hy(i,r,a){let o=await Promise.all(i.map(async g=>{let k=r.routes[g.route.id];if(k){let T=await By(k,a);return T.links?T.links():[]}return[]}));return $y(o.flat(1).filter(zy).filter(g=>g.rel==="stylesheet"||g.rel==="preload").map(g=>g.rel==="stylesheet"?{...g,rel:"prefetch",as:"style"}:{...g,rel:"prefetch"}))}function Xm(i,r,a,o,g,k){let T=(u,h)=>a[h]?u.route.id!==a[h].route.id:!0,c=(u,h)=>{var y;return a[h].pathname!==u.pathname||((y=a[h].route.path)==null?void 0:y.endsWith("*"))&&a[h].params["*"]!==u.params["*"]};return k==="assets"?r.filter((u,h)=>T(u,h)||c(u,h)):k==="data"?r.filter((u,h)=>{var d;let y=o.routes[u.route.id];if(!y||!y.hasLoader)return!1;if(T(u,h)||c(u,h))return!0;if(u.route.shouldRevalidate){let C=u.route.shouldRevalidate({currentUrl:new URL(g.pathname+g.search+g.hash,window.origin),currentParams:((d=a[0])==null?void 0:d.params)||{},nextUrl:new URL(i,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof C=="boolean")return C}return!0}):[]}function Uy(i,r,{includeHydrateFallback:a}={}){return Iy(i.map(o=>{let g=r.routes[o.route.id];if(!g)return[];let k=[g.module];return g.clientActionModule&&(k=k.concat(g.clientActionModule)),g.clientLoaderModule&&(k=k.concat(g.clientLoaderModule)),a&&g.hydrateFallbackModule&&(k=k.concat(g.hydrateFallbackModule)),g.imports&&(k=k.concat(g.imports)),k}).flat(1))}function Iy(i){return[...new Set(i)]}function Py(i){let r={},a=Object.keys(i).sort();for(let o of a)r[o]=i[o];return r}function $y(i,r){let a=new Set;return new Set(r),i.reduce((o,g)=>{let k=JSON.stringify(Py(g));return a.has(k)||(a.add(k),o.push({key:k,link:g})),o},[])}function tp(){let i=P.useContext(Hr);return ku(i,"You must render this element inside a <DataRouterContext.Provider> element"),i}function Zy(){let i=P.useContext(Ao);return ku(i,"You must render this element inside a <DataRouterStateContext.Provider> element"),i}var Tu=P.createContext(void 0);Tu.displayName="FrameworkContext";function ip(){let i=P.useContext(Tu);return ku(i,"You must render this element inside a <HydratedRouter> element"),i}function qy(i,r){let a=P.useContext(Tu),[o,g]=P.useState(!1),[k,T]=P.useState(!1),{onFocus:c,onBlur:u,onMouseEnter:h,onMouseLeave:y,onTouchStart:d}=r,C=P.useRef(null);P.useEffect(()=>{if(i==="render"&&T(!0),i==="viewport"){let x=p=>{p.forEach(f=>{T(f.isIntersecting)})},m=new IntersectionObserver(x,{threshold:.5});return C.current&&m.observe(C.current),()=>{m.disconnect()}}},[i]),P.useEffect(()=>{if(o){let x=setTimeout(()=>{T(!0)},100);return()=>{clearTimeout(x)}}},[o]);let E=()=>{g(!0)},O=()=>{g(!1),T(!1)};return a?i!=="intent"?[k,C,{}]:[k,C,{onFocus:Nn(c,E),onBlur:Nn(u,O),onMouseEnter:Nn(h,E),onMouseLeave:Nn(y,O),onTouchStart:Nn(d,E)}]:[!1,C,{}]}function Nn(i,r){return a=>{i&&i(a),a.defaultPrevented||r(a)}}function Fy({page:i,...r}){let{router:a}=tp(),o=P.useMemo(()=>I_(a.routes,i,a.basename),[a.routes,i,a.basename]);return o?P.createElement(Vy,{page:i,matches:o,...r}):null}function Ky(i){let{manifest:r,routeModules:a}=ip(),[o,g]=P.useState([]);return P.useEffect(()=>{let k=!1;return Hy(i,r,a).then(T=>{k||g(T)}),()=>{k=!0}},[i,r,a]),o}function Vy({page:i,matches:r,...a}){let o=ys(),{future:g,manifest:k,routeModules:T}=ip(),{basename:c}=tp(),{loaderData:u,matches:h}=Zy(),y=P.useMemo(()=>Xm(i,r,h,k,o,"data"),[i,r,h,k,o]),d=P.useMemo(()=>Xm(i,r,h,k,o,"assets"),[i,r,h,k,o]),C=P.useMemo(()=>{if(i===o.pathname+o.search+o.hash)return[];let x=new Set,m=!1;if(r.forEach(f=>{var S;let v=k.routes[f.route.id];!v||!v.hasLoader||(!y.some(R=>R.route.id===f.route.id)&&f.route.id in u&&((S=T[f.route.id])!=null&&S.shouldRevalidate)||v.hasClientLoader?m=!0:x.add(f.route.id))}),x.size===0)return[];let p=jy(i,c,g.unstable_trailingSlashAwareDataRequests,"data");return m&&x.size>0&&p.searchParams.set("_routes",r.filter(f=>x.has(f.route.id)).map(f=>f.route.id).join(",")),[p.pathname+p.search]},[c,g.unstable_trailingSlashAwareDataRequests,u,o,k,y,r,i,T]),E=P.useMemo(()=>Uy(d,k),[d,k]),O=Ky(d);return P.createElement(P.Fragment,null,C.map(x=>P.createElement("link",{key:x,rel:"prefetch",as:"fetch",href:x,...a})),E.map(x=>P.createElement("link",{key:x,rel:"modulepreload",href:x,...a})),O.map(({key:x,link:m})=>P.createElement("link",{key:x,nonce:a.nonce,...m,crossOrigin:m.crossOrigin??a.crossOrigin})))}function Gy(...i){return r=>{i.forEach(a=>{typeof a=="function"?a(r):a!=null&&(a.current=r)})}}var Yy=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Yy&&(window.__reactRouterVersion="7.13.2")}catch{}function Wy({basename:i,children:r,unstable_useTransitions:a,window:o}){let g=P.useRef();g.current==null&&(g.current=T0({window:o,v5Compat:!0}));let k=g.current,[T,c]=P.useState({action:k.action,location:k.location}),u=P.useCallback(h=>{a===!1?c(h):P.startTransition(()=>c(h))},[a]);return P.useLayoutEffect(()=>k.listen(u),[k,u]),P.createElement(Ey,{basename:i,children:r,location:T.location,navigationType:T.action,navigator:k,unstable_useTransitions:a})}var sp=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,fi=P.forwardRef(function({onClick:r,discover:a="render",prefetch:o="none",relative:g,reloadDocument:k,replace:T,unstable_mask:c,state:u,target:h,to:y,preventScrollReset:d,viewTransition:C,unstable_defaultShouldRevalidate:E,...O},x){let{basename:m,navigator:p,unstable_useTransitions:f}=P.useContext(ni),v=typeof y=="string"&&sp.test(y),S=F_(y,m);y=S.to;let R=oy(y,{relative:g}),A=ys(),M=null;if(c){let ee=xu(c,[],A.unstable_mask?A.unstable_mask.pathname:"/",!0);m!=="/"&&(ee.pathname=ee.pathname==="/"?m:yi([m,ee.pathname])),M=p.createHref(ee)}let[w,N,I]=qy(o,O),q=Qy(y,{replace:T,unstable_mask:c,state:u,target:h,preventScrollReset:d,relative:g,viewTransition:C,unstable_defaultShouldRevalidate:E,unstable_useTransitions:f});function K(ee){r&&r(ee),ee.defaultPrevented||q(ee)}let Z=!(S.isExternal||k),J=P.createElement("a",{...O,...I,href:(Z?M:void 0)||S.absoluteURL||R,onClick:Z?K:r,ref:Gy(x,N),target:h,"data-discover":!v&&a==="render"?"true":void 0});return w&&!v?P.createElement(P.Fragment,null,J,P.createElement(Fy,{page:R})):J});fi.displayName="Link";var rp=P.forwardRef(function({"aria-current":r="page",caseSensitive:a=!1,className:o="",end:g=!1,style:k,to:T,viewTransition:c,children:u,...h},y){let d=qn(T,{relative:h.relative}),C=ys(),E=P.useContext(Ao),{navigator:O,basename:x}=P.useContext(ni),m=E!=null&&rb(d)&&c===!0,p=O.encodeLocation?O.encodeLocation(d).pathname:d.pathname,f=C.pathname,v=E&&E.navigation&&E.navigation.location?E.navigation.location.pathname:null;a||(f=f.toLowerCase(),v=v?v.toLowerCase():null,p=p.toLowerCase()),v&&x&&(v=Pi(v,x)||v);const S=p!=="/"&&p.endsWith("/")?p.length-1:p.length;let R=f===p||!g&&f.startsWith(p)&&f.charAt(S)==="/",A=v!=null&&(v===p||!g&&v.startsWith(p)&&v.charAt(p.length)==="/"),M={isActive:R,isPending:A,isTransitioning:m},w=R?r:void 0,N;typeof o=="function"?N=o(M):N=[o,R?"active":null,A?"pending":null,m?"transitioning":null].filter(Boolean).join(" ");let I=typeof k=="function"?k(M):k;return P.createElement(fi,{...h,"aria-current":w,className:N,ref:y,style:I,to:T,viewTransition:c},typeof u=="function"?u(M):u)});rp.displayName="NavLink";var Xy=P.forwardRef(({discover:i="render",fetcherKey:r,navigate:a,reloadDocument:o,replace:g,state:k,method:T=go,action:c,onSubmit:u,relative:h,preventScrollReset:y,viewTransition:d,unstable_defaultShouldRevalidate:C,...E},O)=>{let{unstable_useTransitions:x}=P.useContext(ni),m=ib(),p=sb(c,{relative:h}),f=T.toLowerCase()==="get"?"get":"post",v=typeof c=="string"&&sp.test(c),S=R=>{if(u&&u(R),R.defaultPrevented)return;R.preventDefault();let A=R.nativeEvent.submitter,M=(A==null?void 0:A.getAttribute("formmethod"))||T,w=()=>m(A||R.currentTarget,{fetcherKey:r,method:M,navigate:a,replace:g,state:k,relative:h,preventScrollReset:y,viewTransition:d,unstable_defaultShouldRevalidate:C});x&&a!==!1?P.startTransition(()=>w()):w()};return P.createElement("form",{ref:O,method:f,action:p,onSubmit:o?u:S,...E,"data-discover":!v&&i==="render"?"true":void 0})});Xy.displayName="Form";function Jy(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function np(i){let r=P.useContext(Hr);return tt(r,Jy(i)),r}function Qy(i,{target:r,replace:a,unstable_mask:o,state:g,preventScrollReset:k,relative:T,viewTransition:c,unstable_defaultShouldRevalidate:u,unstable_useTransitions:h}={}){let y=Ro(),d=ys(),C=qn(i,{relative:T});return P.useCallback(E=>{if(Oy(E,r)){E.preventDefault();let O=a!==void 0?a:In(d)===In(C),x=()=>y(i,{replace:O,unstable_mask:o,state:g,preventScrollReset:k,relative:T,viewTransition:c,unstable_defaultShouldRevalidate:u});h?P.startTransition(()=>x()):x()}},[d,y,C,a,o,g,r,i,k,T,c,u,h])}var eb=0,tb=()=>`__${String(++eb)}__`;function ib(){let{router:i}=np("useSubmit"),{basename:r}=P.useContext(ni),a=by(),o=i.fetch,g=i.navigate;return P.useCallback(async(k,T={})=>{let{action:c,method:u,encType:h,formData:y,body:d}=Ny(k,r);if(T.navigate===!1){let C=T.fetcherKey||tb();await o(C,a,T.action||c,{unstable_defaultShouldRevalidate:T.unstable_defaultShouldRevalidate,preventScrollReset:T.preventScrollReset,formData:y,body:d,formMethod:T.method||u,formEncType:T.encType||h,flushSync:T.flushSync})}else await g(T.action||c,{unstable_defaultShouldRevalidate:T.unstable_defaultShouldRevalidate,preventScrollReset:T.preventScrollReset,formData:y,body:d,formMethod:T.method||u,formEncType:T.encType||h,replace:T.replace,state:T.state,fromRouteId:a,flushSync:T.flushSync,viewTransition:T.viewTransition})},[o,g,r,a])}function sb(i,{relative:r}={}){let{basename:a}=P.useContext(ni),o=P.useContext(di);tt(o,"useFormAction must be used inside a RouteContext");let[g]=o.matches.slice(-1),k={...qn(i||".",{relative:r})},T=ys();if(i==null){k.search=T.search;let c=new URLSearchParams(k.search),u=c.getAll("index");if(u.some(y=>y==="")){c.delete("index"),u.filter(d=>d).forEach(d=>c.append("index",d));let y=c.toString();k.search=y?`?${y}`:""}}return(!i||i===".")&&g.route.index&&(k.search=k.search?k.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(k.pathname=k.pathname==="/"?a:yi([a,k.pathname])),In(k)}function rb(i,{relative:r}={}){let a=P.useContext(V_);tt(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=np("useViewTransitionState"),g=qn(i,{relative:r});if(!a.isTransitioning)return!1;let k=Pi(a.currentLocation.pathname,o)||a.currentLocation.pathname,T=Pi(a.nextLocation.pathname,o)||a.nextLocation.pathname;return bo(g.pathname,T)!=null||bo(g.pathname,k)!=null}class nb extends P.Component{constructor(){super(...arguments);mt(this,"state",{hasError:!1,error:null});mt(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?b.jsxs("div",{className:"min-h-screen bg-[#0a0a0f] flex flex-col items-center justify-center text-center px-4",children:[b.jsx("div",{className:"text-6xl mb-4",children:"⚠"}),b.jsx("h1",{className:"text-lg text-[#e0e0e0] mb-2",children:"Something went wrong"}),b.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."}),b.jsx("button",{onClick:this.handleReload,className:"px-4 py-2 text-sm font-medium rounded bg-[#3b82f6]/10 hover:bg-[#3b82f6]/20 text-[#3b82f6] border border-[#3b82f6]/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 ab=i=>i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ap=(...i)=>i.filter((r,a,o)=>!!r&&r.trim()!==""&&o.indexOf(r)===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 ob={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 lb=P.forwardRef(({color:i="currentColor",size:r=24,strokeWidth:a=2,absoluteStrokeWidth:o,className:g="",children:k,iconNode:T,...c},u)=>P.createElement("svg",{ref:u,...ob,width:r,height:r,stroke:i,strokeWidth:o?Number(a)*24/Number(r):a,className:ap("lucide",g),...c},[...T.map(([h,y])=>P.createElement(h,y)),...Array.isArray(k)?k:[k]]));/**
|
|
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 Ne=(i,r)=>{const a=P.forwardRef(({className:o,...g},k)=>P.createElement(lb,{ref:k,iconNode:r,className:ap(`lucide-${ab(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 cb=[["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"}]],op=Ne("Activity",cb);/**
|
|
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 ub=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]],lp=Ne("Ban",ub);/**
|
|
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 hb=[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],fb=Ne("Camera",hb);/**
|
|
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 db=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],mb=Ne("ChevronLeft",db);/**
|
|
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 _b=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],pb=Ne("ChevronRight",_b);/**
|
|
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 vb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],cp=Ne("CircleCheck",vb);/**
|
|
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 gb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],yb=Ne("CirclePlus",gb);/**
|
|
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 bb=[["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"}]],So=Ne("CircleX",bb);/**
|
|
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 Sb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],ho=Ne("Clock",Sb);/**
|
|
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 xb=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Cb=Ne("Copy",xb);/**
|
|
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 wb=[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]],Eb=Ne("CornerDownLeft",wb);/**
|
|
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 kb=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Tb=Ne("EyeOff",kb);/**
|
|
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 Ab=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Rb=Ne("Eye",Ab);/**
|
|
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 Db=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],mu=Ne("KeyRound",Db);/**
|
|
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 Ob=[["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"}]],Mb=Ne("Layers",Ob);/**
|
|
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 Lb=[["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"}]],Nb=Ne("LayoutDashboard",Lb);/**
|
|
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 jb=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Un=Ne("LoaderCircle",jb);/**
|
|
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 Bb=[["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"}]],zb=Ne("MessageSquare",Bb);/**
|
|
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 Hb=[["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"}]],Ub=Ne("Octagon",Hb);/**
|
|
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 Ib=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],up=Ne("Play",Ib);/**
|
|
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 Pb=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Fn=Ne("Plus",Pb);/**
|
|
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 $b=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],Zb=Ne("Power",$b);/**
|
|
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 qb=[["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"}]],hp=Ne("RefreshCw",qb);/**
|
|
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 Fb=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Kb=Ne("Search",Fb);/**
|
|
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 Vb=[["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"}]],Gb=Ne("Send",Vb);/**
|
|
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 Yb=[["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"}]],Jm=Ne("ShieldAlert",Yb);/**
|
|
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 Wb=[["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"}]],Xb=Ne("Shield",Wb);/**
|
|
216
|
+
* @license lucide-react v0.474.0 - ISC
|
|
217
|
+
*
|
|
218
|
+
* This source code is licensed under the ISC license.
|
|
219
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
+
*/const Jb=[["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"}]],Qb=Ne("Skull",Jb);/**
|
|
221
|
+
* @license lucide-react v0.474.0 - ISC
|
|
222
|
+
*
|
|
223
|
+
* This source code is licensed under the ISC license.
|
|
224
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
+
*/const e1=[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]],t1=Ne("Terminal",e1);/**
|
|
226
|
+
* @license lucide-react v0.474.0 - ISC
|
|
227
|
+
*
|
|
228
|
+
* This source code is licensed under the ISC license.
|
|
229
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
230
|
+
*/const i1=[["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"}]],Au=Ne("Trash2",i1);/**
|
|
231
|
+
* @license lucide-react v0.474.0 - ISC
|
|
232
|
+
*
|
|
233
|
+
* This source code is licensed under the ISC license.
|
|
234
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
+
*/const s1=[["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"}]],fp=Ne("TriangleAlert",s1);/**
|
|
236
|
+
* @license lucide-react v0.474.0 - ISC
|
|
237
|
+
*
|
|
238
|
+
* This source code is licensed under the ISC license.
|
|
239
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
+
*/const r1=[["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"}]],n1=Ne("UserCheck",r1);/**
|
|
241
|
+
* @license lucide-react v0.474.0 - ISC
|
|
242
|
+
*
|
|
243
|
+
* This source code is licensed under the ISC license.
|
|
244
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
+
*/const a1=[["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"}]],o1=Ne("Users",a1);/**
|
|
246
|
+
* @license lucide-react v0.474.0 - ISC
|
|
247
|
+
*
|
|
248
|
+
* This source code is licensed under the ISC license.
|
|
249
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
+
*/const l1=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Kn=Ne("X",l1);/**
|
|
251
|
+
* @license lucide-react v0.474.0 - ISC
|
|
252
|
+
*
|
|
253
|
+
* This source code is licensed under the ISC license.
|
|
254
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
+
*/const c1=[["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"}]],u1=Ne("Zap",c1),Qm=i=>{let r;const a=new Set,o=(h,y)=>{const d=typeof h=="function"?h(r):h;if(!Object.is(d,r)){const C=r;r=y??(typeof d!="object"||d===null)?d:Object.assign({},r,d),a.forEach(E=>E(r,C))}},g=()=>r,c={setState:o,getState:g,getInitialState:()=>u,subscribe:h=>(a.add(h),()=>a.delete(h))},u=r=i(o,g,c);return c},h1=(i=>i?Qm(i):Qm),f1=i=>i;function d1(i,r=f1){const a=zn.useSyncExternalStore(i.subscribe,zn.useCallback(()=>r(i.getState()),[i,r]),zn.useCallback(()=>r(i.getInitialState()),[i,r]));return zn.useDebugValue(a),a}const e_=i=>{const r=h1(i),a=o=>d1(r,o);return Object.assign(a,r),a},dp=(i=>i?e_(i):e_),et=dp(i=>({token:localStorage.getItem("aegis_token"),setToken:r=>{localStorage.setItem("aegis_token",r),i({token:r})},clearToken:()=>{localStorage.removeItem("aegis_token"),i({token:null})},sessions:[],setSessions:r=>i({sessions:r}),healthMap:{},setSessionsAndHealth:(r,a)=>i({sessions:r,healthMap:a}),metrics:null,setMetrics:r=>i({metrics:r}),sseConnected:!1,setSseConnected:r=>i({sseConnected:r}),sseError:null,setSseError:r=>i({sseError:r}),activities:[],addActivity:r=>i(a=>({activities:[r,...a.activities].slice(0,200)})),clearActivities:()=>i({activities:[]}),activityFilterSession:null,setActivityFilterSession:r=>i({activityFilterSession:r}),activityFilterType:null,setActivityFilterType:r=>i({activityFilterType:r})}));function fe(i,r,a){function o(c,u){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:u,constr:T,traits:new Set},enumerable:!1}),c._zod.traits.has(i))return;c._zod.traits.add(i),r(c,u);const h=T.prototype,y=Object.keys(h);for(let d=0;d<y.length;d++){const C=y[d];C in c||(c[C]=h[C].bind(c))}}const g=(a==null?void 0:a.Parent)??Object;class k extends g{}Object.defineProperty(k,"name",{value:i});function T(c){var u;const h=a!=null&&a.Parent?new k:this;o(h,c),(u=h._zod).deferred??(u.deferred=[]);for(const y of h._zod.deferred)y();return h}return Object.defineProperty(T,"init",{value:o}),Object.defineProperty(T,Symbol.hasInstance,{value:c=>{var u,h;return a!=null&&a.Parent&&c instanceof a.Parent?!0:(h=(u=c==null?void 0:c._zod)==null?void 0:u.traits)==null?void 0:h.has(i)}}),Object.defineProperty(T,"name",{value:i}),T}class Nr extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class mp extends Error{constructor(r){super(`Encountered unidirectional transform during encode: ${r}`),this.name="ZodEncodeError"}}const _p={};function vs(i){return _p}function pp(i){const r=Object.values(i).filter(o=>typeof o=="number");return Object.entries(i).filter(([o,g])=>r.indexOf(+o)===-1).map(([o,g])=>g)}function _u(i,r){return typeof r=="bigint"?r.toString():r}function Ru(i){return{get value(){{const r=i();return Object.defineProperty(this,"value",{value:r}),r}}}}function Du(i){return i==null}function Ou(i){const r=i.startsWith("^")?1:0,a=i.endsWith("$")?i.length-1:i.length;return i.slice(r,a)}function m1(i,r){const a=(i.toString().split(".")[1]||"").length,o=r.toString();let g=(o.split(".")[1]||"").length;if(g===0&&/\d?e-\d?/.test(o)){const u=o.match(/\d?e-(\d?)/);u!=null&&u[1]&&(g=Number.parseInt(u[1]))}const k=a>g?a:g,T=Number.parseInt(i.toFixed(k).replace(".","")),c=Number.parseInt(r.toFixed(k).replace(".",""));return T%c/10**k}const t_=Symbol("evaluating");function $e(i,r,a){let o;Object.defineProperty(i,r,{get(){if(o!==t_)return o===void 0&&(o=t_,o=a()),o},set(g){Object.defineProperty(i,r,{value:g})},configurable:!0})}function qs(i,r,a){Object.defineProperty(i,r,{value:a,writable:!0,enumerable:!0,configurable:!0})}function bs(...i){const r={};for(const a of i){const o=Object.getOwnPropertyDescriptors(a);Object.assign(r,o)}return Object.defineProperties({},r)}function i_(i){return JSON.stringify(i)}function _1(i){return i.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const vp="captureStackTrace"in Error?Error.captureStackTrace:(...i)=>{};function xo(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}const p1=Ru(()=>{var i;if(typeof navigator<"u"&&((i=navigator==null?void 0:navigator.userAgent)!=null&&i.includes("Cloudflare")))return!1;try{const r=Function;return new r(""),!0}catch{return!1}});function jr(i){if(xo(i)===!1)return!1;const r=i.constructor;if(r===void 0||typeof r!="function")return!0;const a=r.prototype;return!(xo(a)===!1||Object.prototype.hasOwnProperty.call(a,"isPrototypeOf")===!1)}function gp(i){return jr(i)?{...i}:Array.isArray(i)?[...i]:i}const v1=new Set(["string","number","symbol"]);function Oo(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ss(i,r,a){const o=new i._zod.constr(r??i._zod.def);return(!r||a!=null&&a.parent)&&(o._zod.parent=i),o}function be(i){const r=i;if(!r)return{};if(typeof r=="string")return{error:()=>r};if((r==null?void 0:r.message)!==void 0){if((r==null?void 0:r.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");r.error=r.message}return delete r.message,typeof r.error=="string"?{...r,error:()=>r.error}:r}function g1(i){return Object.keys(i).filter(r=>i[r]._zod.optin==="optional"&&i[r]._zod.optout==="optional")}const y1={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 b1(i,r){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 k=bs(i._zod.def,{get shape(){const T={};for(const c in r){if(!(c in a.shape))throw new Error(`Unrecognized key: "${c}"`);r[c]&&(T[c]=a.shape[c])}return qs(this,"shape",T),T},checks:[]});return Ss(i,k)}function S1(i,r){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 k=bs(i._zod.def,{get shape(){const T={...i._zod.def.shape};for(const c in r){if(!(c in a.shape))throw new Error(`Unrecognized key: "${c}"`);r[c]&&delete T[c]}return qs(this,"shape",T),T},checks:[]});return Ss(i,k)}function x1(i,r){if(!jr(r))throw new Error("Invalid input to extend: expected a plain object");const a=i._zod.def.checks;if(a&&a.length>0){const k=i._zod.def.shape;for(const T in r)if(Object.getOwnPropertyDescriptor(k,T)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const g=bs(i._zod.def,{get shape(){const k={...i._zod.def.shape,...r};return qs(this,"shape",k),k}});return Ss(i,g)}function C1(i,r){if(!jr(r))throw new Error("Invalid input to safeExtend: expected a plain object");const a=bs(i._zod.def,{get shape(){const o={...i._zod.def.shape,...r};return qs(this,"shape",o),o}});return Ss(i,a)}function w1(i,r){const a=bs(i._zod.def,{get shape(){const o={...i._zod.def.shape,...r._zod.def.shape};return qs(this,"shape",o),o},get catchall(){return r._zod.def.catchall},checks:[]});return Ss(i,a)}function E1(i,r,a){const g=r._zod.def.checks;if(g&&g.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const T=bs(r._zod.def,{get shape(){const c=r._zod.def.shape,u={...c};if(a)for(const h in a){if(!(h in c))throw new Error(`Unrecognized key: "${h}"`);a[h]&&(u[h]=i?new i({type:"optional",innerType:c[h]}):c[h])}else for(const h in c)u[h]=i?new i({type:"optional",innerType:c[h]}):c[h];return qs(this,"shape",u),u},checks:[]});return Ss(r,T)}function k1(i,r,a){const o=bs(r._zod.def,{get shape(){const g=r._zod.def.shape,k={...g};if(a)for(const T in a){if(!(T in k))throw new Error(`Unrecognized key: "${T}"`);a[T]&&(k[T]=new i({type:"nonoptional",innerType:g[T]}))}else for(const T in g)k[T]=new i({type:"nonoptional",innerType:g[T]});return qs(this,"shape",k),k}});return Ss(r,o)}function Mr(i,r=0){var a;if(i.aborted===!0)return!0;for(let o=r;o<i.issues.length;o++)if(((a=i.issues[o])==null?void 0:a.continue)!==!0)return!0;return!1}function Lr(i,r){return r.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 gs(i,r,a){var g,k,T,c,u,h;const o={...i,path:i.path??[]};if(!i.message){const y=fo((T=(k=(g=i.inst)==null?void 0:g._zod.def)==null?void 0:k.error)==null?void 0:T.call(k,i))??fo((c=r==null?void 0:r.error)==null?void 0:c.call(r,i))??fo((u=a.customError)==null?void 0:u.call(a,i))??fo((h=a.localeError)==null?void 0:h.call(a,i))??"Invalid input";o.message=y}return delete o.inst,delete o.continue,r!=null&&r.reportInput||delete o.input,o}function Mu(i){return Array.isArray(i)?"array":typeof i=="string"?"string":"unknown"}function Pn(...i){const[r,a,o]=i;return typeof r=="string"?{message:r,code:"custom",input:a,inst:o}:{...r}}const yp=(i,r)=>{i.name="$ZodError",Object.defineProperty(i,"_zod",{value:i._zod,enumerable:!1}),Object.defineProperty(i,"issues",{value:r,enumerable:!1}),i.message=JSON.stringify(r,_u,2),Object.defineProperty(i,"toString",{value:()=>i.message,enumerable:!1})},bp=fe("$ZodError",yp),Sp=fe("$ZodError",yp,{Parent:Error});function T1(i,r=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(r(g))):o.push(r(g));return{formErrors:o,fieldErrors:a}}function A1(i,r=a=>a.message){const a={_errors:[]},o=g=>{for(const k of g.issues)if(k.code==="invalid_union"&&k.errors.length)k.errors.map(T=>o({issues:T}));else if(k.code==="invalid_key")o({issues:k.issues});else if(k.code==="invalid_element")o({issues:k.issues});else if(k.path.length===0)a._errors.push(r(k));else{let T=a,c=0;for(;c<k.path.length;){const u=k.path[c];c===k.path.length-1?(T[u]=T[u]||{_errors:[]},T[u]._errors.push(r(k))):T[u]=T[u]||{_errors:[]},T=T[u],c++}}};return o(i),a}const Lu=i=>(r,a,o,g)=>{const k=o?Object.assign(o,{async:!1}):{async:!1},T=r._zod.run({value:a,issues:[]},k);if(T instanceof Promise)throw new Nr;if(T.issues.length){const c=new((g==null?void 0:g.Err)??i)(T.issues.map(u=>gs(u,k,vs())));throw vp(c,g==null?void 0:g.callee),c}return T.value},Nu=i=>async(r,a,o,g)=>{const k=o?Object.assign(o,{async:!0}):{async:!0};let T=r._zod.run({value:a,issues:[]},k);if(T instanceof Promise&&(T=await T),T.issues.length){const c=new((g==null?void 0:g.Err)??i)(T.issues.map(u=>gs(u,k,vs())));throw vp(c,g==null?void 0:g.callee),c}return T.value},Mo=i=>(r,a,o)=>{const g=o?{...o,async:!1}:{async:!1},k=r._zod.run({value:a,issues:[]},g);if(k instanceof Promise)throw new Nr;return k.issues.length?{success:!1,error:new(i??bp)(k.issues.map(T=>gs(T,g,vs())))}:{success:!0,data:k.value}},R1=Mo(Sp),Lo=i=>async(r,a,o)=>{const g=o?Object.assign(o,{async:!0}):{async:!0};let k=r._zod.run({value:a,issues:[]},g);return k instanceof Promise&&(k=await k),k.issues.length?{success:!1,error:new i(k.issues.map(T=>gs(T,g,vs())))}:{success:!0,data:k.value}},D1=Lo(Sp),O1=i=>(r,a,o)=>{const g=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Lu(i)(r,a,g)},M1=i=>(r,a,o)=>Lu(i)(r,a,o),L1=i=>async(r,a,o)=>{const g=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Nu(i)(r,a,g)},N1=i=>async(r,a,o)=>Nu(i)(r,a,o),j1=i=>(r,a,o)=>{const g=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Mo(i)(r,a,g)},B1=i=>(r,a,o)=>Mo(i)(r,a,o),z1=i=>async(r,a,o)=>{const g=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Lo(i)(r,a,g)},H1=i=>async(r,a,o)=>Lo(i)(r,a,o),U1=/^[cC][^\s-]{8,}$/,I1=/^[0-9a-z]+$/,P1=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,$1=/^[0-9a-vA-V]{20}$/,Z1=/^[A-Za-z0-9]{27}$/,q1=/^[a-zA-Z0-9_-]{21}$/,F1=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,K1=/^([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})$/,s_=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)$/,V1=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,G1="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Y1(){return new RegExp(G1,"u")}const W1=/^(?:(?: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])$/,X1=/^(([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}|:))$/,J1=/^((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])$/,Q1=/^(([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])$/,eS=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,xp=/^[A-Za-z0-9_-]*$/,tS=/^\+[1-9]\d{6,14}$/,Cp="(?:(?:\\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])))",iS=new RegExp(`^${Cp}$`);function wp(i){const r="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof i.precision=="number"?i.precision===-1?`${r}`:i.precision===0?`${r}:[0-5]\\d`:`${r}:[0-5]\\d\\.\\d{${i.precision}}`:`${r}(?::[0-5]\\d(?:\\.\\d+)?)?`}function sS(i){return new RegExp(`^${wp(i)}$`)}function rS(i){const r=wp({precision:i.precision}),a=["Z"];i.local&&a.push(""),i.offset&&a.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const o=`${r}(?:${a.join("|")})`;return new RegExp(`^${Cp}T(?:${o})$`)}const nS=i=>{const r=i?`[\\s\\S]{${(i==null?void 0:i.minimum)??0},${(i==null?void 0:i.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${r}$`)},aS=/^-?\d+$/,Ep=/^-?\d+(?:\.\d+)?$/,oS=/^(?:true|false)$/i,lS=/^[^A-Z]*$/,cS=/^[^a-z]*$/,zt=fe("$ZodCheck",(i,r)=>{var a;i._zod??(i._zod={}),i._zod.def=r,(a=i._zod).onattach??(a.onattach=[])}),kp={number:"number",bigint:"bigint",object:"date"},Tp=fe("$ZodCheckLessThan",(i,r)=>{zt.init(i,r);const a=kp[typeof r.value];i._zod.onattach.push(o=>{const g=o._zod.bag,k=(r.inclusive?g.maximum:g.exclusiveMaximum)??Number.POSITIVE_INFINITY;r.value<k&&(r.inclusive?g.maximum=r.value:g.exclusiveMaximum=r.value)}),i._zod.check=o=>{(r.inclusive?o.value<=r.value:o.value<r.value)||o.issues.push({origin:a,code:"too_big",maximum:typeof r.value=="object"?r.value.getTime():r.value,input:o.value,inclusive:r.inclusive,inst:i,continue:!r.abort})}}),Ap=fe("$ZodCheckGreaterThan",(i,r)=>{zt.init(i,r);const a=kp[typeof r.value];i._zod.onattach.push(o=>{const g=o._zod.bag,k=(r.inclusive?g.minimum:g.exclusiveMinimum)??Number.NEGATIVE_INFINITY;r.value>k&&(r.inclusive?g.minimum=r.value:g.exclusiveMinimum=r.value)}),i._zod.check=o=>{(r.inclusive?o.value>=r.value:o.value>r.value)||o.issues.push({origin:a,code:"too_small",minimum:typeof r.value=="object"?r.value.getTime():r.value,input:o.value,inclusive:r.inclusive,inst:i,continue:!r.abort})}}),uS=fe("$ZodCheckMultipleOf",(i,r)=>{zt.init(i,r),i._zod.onattach.push(a=>{var o;(o=a._zod.bag).multipleOf??(o.multipleOf=r.value)}),i._zod.check=a=>{if(typeof a.value!=typeof r.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof a.value=="bigint"?a.value%r.value===BigInt(0):m1(a.value,r.value)===0)||a.issues.push({origin:typeof a.value,code:"not_multiple_of",divisor:r.value,input:a.value,inst:i,continue:!r.abort})}}),hS=fe("$ZodCheckNumberFormat",(i,r)=>{var T;zt.init(i,r),r.format=r.format||"float64";const a=(T=r.format)==null?void 0:T.includes("int"),o=a?"int":"number",[g,k]=y1[r.format];i._zod.onattach.push(c=>{const u=c._zod.bag;u.format=r.format,u.minimum=g,u.maximum=k,a&&(u.pattern=aS)}),i._zod.check=c=>{const u=c.value;if(a){if(!Number.isInteger(u)){c.issues.push({expected:o,format:r.format,code:"invalid_type",continue:!1,input:u,inst:i});return}if(!Number.isSafeInteger(u)){u>0?c.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:i,origin:o,inclusive:!0,continue:!r.abort}):c.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:i,origin:o,inclusive:!0,continue:!r.abort});return}}u<g&&c.issues.push({origin:"number",input:u,code:"too_small",minimum:g,inclusive:!0,inst:i,continue:!r.abort}),u>k&&c.issues.push({origin:"number",input:u,code:"too_big",maximum:k,inclusive:!0,inst:i,continue:!r.abort})}}),fS=fe("$ZodCheckMaxLength",(i,r)=>{var a;zt.init(i,r),(a=i._zod.def).when??(a.when=o=>{const g=o.value;return!Du(g)&&g.length!==void 0}),i._zod.onattach.push(o=>{const g=o._zod.bag.maximum??Number.POSITIVE_INFINITY;r.maximum<g&&(o._zod.bag.maximum=r.maximum)}),i._zod.check=o=>{const g=o.value;if(g.length<=r.maximum)return;const T=Mu(g);o.issues.push({origin:T,code:"too_big",maximum:r.maximum,inclusive:!0,input:g,inst:i,continue:!r.abort})}}),dS=fe("$ZodCheckMinLength",(i,r)=>{var a;zt.init(i,r),(a=i._zod.def).when??(a.when=o=>{const g=o.value;return!Du(g)&&g.length!==void 0}),i._zod.onattach.push(o=>{const g=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;r.minimum>g&&(o._zod.bag.minimum=r.minimum)}),i._zod.check=o=>{const g=o.value;if(g.length>=r.minimum)return;const T=Mu(g);o.issues.push({origin:T,code:"too_small",minimum:r.minimum,inclusive:!0,input:g,inst:i,continue:!r.abort})}}),mS=fe("$ZodCheckLengthEquals",(i,r)=>{var a;zt.init(i,r),(a=i._zod.def).when??(a.when=o=>{const g=o.value;return!Du(g)&&g.length!==void 0}),i._zod.onattach.push(o=>{const g=o._zod.bag;g.minimum=r.length,g.maximum=r.length,g.length=r.length}),i._zod.check=o=>{const g=o.value,k=g.length;if(k===r.length)return;const T=Mu(g),c=k>r.length;o.issues.push({origin:T,...c?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length},inclusive:!0,exact:!0,input:o.value,inst:i,continue:!r.abort})}}),No=fe("$ZodCheckStringFormat",(i,r)=>{var a,o;zt.init(i,r),i._zod.onattach.push(g=>{const k=g._zod.bag;k.format=r.format,r.pattern&&(k.patterns??(k.patterns=new Set),k.patterns.add(r.pattern))}),r.pattern?(a=i._zod).check??(a.check=g=>{r.pattern.lastIndex=0,!r.pattern.test(g.value)&&g.issues.push({origin:"string",code:"invalid_format",format:r.format,input:g.value,...r.pattern?{pattern:r.pattern.toString()}:{},inst:i,continue:!r.abort})}):(o=i._zod).check??(o.check=()=>{})}),_S=fe("$ZodCheckRegex",(i,r)=>{No.init(i,r),i._zod.check=a=>{r.pattern.lastIndex=0,!r.pattern.test(a.value)&&a.issues.push({origin:"string",code:"invalid_format",format:"regex",input:a.value,pattern:r.pattern.toString(),inst:i,continue:!r.abort})}}),pS=fe("$ZodCheckLowerCase",(i,r)=>{r.pattern??(r.pattern=lS),No.init(i,r)}),vS=fe("$ZodCheckUpperCase",(i,r)=>{r.pattern??(r.pattern=cS),No.init(i,r)}),gS=fe("$ZodCheckIncludes",(i,r)=>{zt.init(i,r);const a=Oo(r.includes),o=new RegExp(typeof r.position=="number"?`^.{${r.position}}${a}`:a);r.pattern=o,i._zod.onattach.push(g=>{const k=g._zod.bag;k.patterns??(k.patterns=new Set),k.patterns.add(o)}),i._zod.check=g=>{g.value.includes(r.includes,r.position)||g.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:r.includes,input:g.value,inst:i,continue:!r.abort})}}),yS=fe("$ZodCheckStartsWith",(i,r)=>{zt.init(i,r);const a=new RegExp(`^${Oo(r.prefix)}.*`);r.pattern??(r.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(r.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:r.prefix,input:o.value,inst:i,continue:!r.abort})}}),bS=fe("$ZodCheckEndsWith",(i,r)=>{zt.init(i,r);const a=new RegExp(`.*${Oo(r.suffix)}$`);r.pattern??(r.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(r.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:r.suffix,input:o.value,inst:i,continue:!r.abort})}}),SS=fe("$ZodCheckOverwrite",(i,r)=>{zt.init(i,r),i._zod.check=a=>{a.value=r.tx(a.value)}});class xS{constructor(r=[]){this.content=[],this.indent=0,this&&(this.args=r)}indented(r){this.indent+=1,r(this),this.indent-=1}write(r){if(typeof r=="function"){r(this,{execution:"sync"}),r(this,{execution:"async"});return}const o=r.split(`
|
|
256
|
+
`).filter(T=>T),g=Math.min(...o.map(T=>T.length-T.trimStart().length)),k=o.map(T=>T.slice(g)).map(T=>" ".repeat(this.indent*2)+T);for(const T of k)this.content.push(T)}compile(){const r=Function,a=this==null?void 0:this.args,g=[...((this==null?void 0:this.content)??[""]).map(k=>` ${k}`)];return new r(...a,g.join(`
|
|
257
|
+
`))}}const CS={major:4,minor:3,patch:6},nt=fe("$ZodType",(i,r)=>{var g;var a;i??(i={}),i._zod.def=r,i._zod.bag=i._zod.bag||{},i._zod.version=CS;const o=[...i._zod.def.checks??[]];i._zod.traits.has("$ZodCheck")&&o.unshift(i);for(const k of o)for(const T of k._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 k=(c,u,h)=>{let y=Mr(c),d;for(const C of u){if(C._zod.def.when){if(!C._zod.def.when(c))continue}else if(y)continue;const E=c.issues.length,O=C._zod.check(c);if(O instanceof Promise&&(h==null?void 0:h.async)===!1)throw new Nr;if(d||O instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await O,c.issues.length!==E&&(y||(y=Mr(c,E)))});else{if(c.issues.length===E)continue;y||(y=Mr(c,E))}}return d?d.then(()=>c):c},T=(c,u,h)=>{if(Mr(c))return c.aborted=!0,c;const y=k(u,o,h);if(y instanceof Promise){if(h.async===!1)throw new Nr;return y.then(d=>i._zod.parse(d,h))}return i._zod.parse(y,h)};i._zod.run=(c,u)=>{if(u.skipChecks)return i._zod.parse(c,u);if(u.direction==="backward"){const y=i._zod.parse({value:c.value,issues:[]},{...u,skipChecks:!0});return y instanceof Promise?y.then(d=>T(d,c,u)):T(y,c,u)}const h=i._zod.parse(c,u);if(h instanceof Promise){if(u.async===!1)throw new Nr;return h.then(y=>k(y,o,u))}return k(h,o,u)}}$e(i,"~standard",()=>({validate:k=>{var T;try{const c=R1(i,k);return c.success?{value:c.data}:{issues:(T=c.error)==null?void 0:T.issues}}catch{return D1(i,k).then(u=>{var h;return u.success?{value:u.data}:{issues:(h=u.error)==null?void 0:h.issues}})}},vendor:"zod",version:1}))}),ju=fe("$ZodString",(i,r)=>{var a;nt.init(i,r),i._zod.pattern=[...((a=i==null?void 0:i._zod.bag)==null?void 0:a.patterns)??[]].pop()??nS(i._zod.bag),i._zod.parse=(o,g)=>{if(r.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}}),Qe=fe("$ZodStringFormat",(i,r)=>{No.init(i,r),ju.init(i,r)}),wS=fe("$ZodGUID",(i,r)=>{r.pattern??(r.pattern=K1),Qe.init(i,r)}),ES=fe("$ZodUUID",(i,r)=>{if(r.version){const o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[r.version];if(o===void 0)throw new Error(`Invalid UUID version: "${r.version}"`);r.pattern??(r.pattern=s_(o))}else r.pattern??(r.pattern=s_());Qe.init(i,r)}),kS=fe("$ZodEmail",(i,r)=>{r.pattern??(r.pattern=V1),Qe.init(i,r)}),TS=fe("$ZodURL",(i,r)=>{Qe.init(i,r),i._zod.check=a=>{try{const o=a.value.trim(),g=new URL(o);r.hostname&&(r.hostname.lastIndex=0,r.hostname.test(g.hostname)||a.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:r.hostname.source,input:a.value,inst:i,continue:!r.abort})),r.protocol&&(r.protocol.lastIndex=0,r.protocol.test(g.protocol.endsWith(":")?g.protocol.slice(0,-1):g.protocol)||a.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:r.protocol.source,input:a.value,inst:i,continue:!r.abort})),r.normalize?a.value=g.href:a.value=o;return}catch{a.issues.push({code:"invalid_format",format:"url",input:a.value,inst:i,continue:!r.abort})}}}),AS=fe("$ZodEmoji",(i,r)=>{r.pattern??(r.pattern=Y1()),Qe.init(i,r)}),RS=fe("$ZodNanoID",(i,r)=>{r.pattern??(r.pattern=q1),Qe.init(i,r)}),DS=fe("$ZodCUID",(i,r)=>{r.pattern??(r.pattern=U1),Qe.init(i,r)}),OS=fe("$ZodCUID2",(i,r)=>{r.pattern??(r.pattern=I1),Qe.init(i,r)}),MS=fe("$ZodULID",(i,r)=>{r.pattern??(r.pattern=P1),Qe.init(i,r)}),LS=fe("$ZodXID",(i,r)=>{r.pattern??(r.pattern=$1),Qe.init(i,r)}),NS=fe("$ZodKSUID",(i,r)=>{r.pattern??(r.pattern=Z1),Qe.init(i,r)}),jS=fe("$ZodISODateTime",(i,r)=>{r.pattern??(r.pattern=rS(r)),Qe.init(i,r)}),BS=fe("$ZodISODate",(i,r)=>{r.pattern??(r.pattern=iS),Qe.init(i,r)}),zS=fe("$ZodISOTime",(i,r)=>{r.pattern??(r.pattern=sS(r)),Qe.init(i,r)}),HS=fe("$ZodISODuration",(i,r)=>{r.pattern??(r.pattern=F1),Qe.init(i,r)}),US=fe("$ZodIPv4",(i,r)=>{r.pattern??(r.pattern=W1),Qe.init(i,r),i._zod.bag.format="ipv4"}),IS=fe("$ZodIPv6",(i,r)=>{r.pattern??(r.pattern=X1),Qe.init(i,r),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:!r.abort})}}}),PS=fe("$ZodCIDRv4",(i,r)=>{r.pattern??(r.pattern=J1),Qe.init(i,r)}),$S=fe("$ZodCIDRv6",(i,r)=>{r.pattern??(r.pattern=Q1),Qe.init(i,r),i._zod.check=a=>{const o=a.value.split("/");try{if(o.length!==2)throw new Error;const[g,k]=o;if(!k)throw new Error;const T=Number(k);if(`${T}`!==k)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:!r.abort})}}});function Rp(i){if(i==="")return!0;if(i.length%4!==0)return!1;try{return atob(i),!0}catch{return!1}}const ZS=fe("$ZodBase64",(i,r)=>{r.pattern??(r.pattern=eS),Qe.init(i,r),i._zod.bag.contentEncoding="base64",i._zod.check=a=>{Rp(a.value)||a.issues.push({code:"invalid_format",format:"base64",input:a.value,inst:i,continue:!r.abort})}});function qS(i){if(!xp.test(i))return!1;const r=i.replace(/[-_]/g,o=>o==="-"?"+":"/"),a=r.padEnd(Math.ceil(r.length/4)*4,"=");return Rp(a)}const FS=fe("$ZodBase64URL",(i,r)=>{r.pattern??(r.pattern=xp),Qe.init(i,r),i._zod.bag.contentEncoding="base64url",i._zod.check=a=>{qS(a.value)||a.issues.push({code:"invalid_format",format:"base64url",input:a.value,inst:i,continue:!r.abort})}}),KS=fe("$ZodE164",(i,r)=>{r.pattern??(r.pattern=tS),Qe.init(i,r)});function VS(i,r=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||r&&(!("alg"in g)||g.alg!==r))}catch{return!1}}const GS=fe("$ZodJWT",(i,r)=>{Qe.init(i,r),i._zod.check=a=>{VS(a.value,r.alg)||a.issues.push({code:"invalid_format",format:"jwt",input:a.value,inst:i,continue:!r.abort})}}),Dp=fe("$ZodNumber",(i,r)=>{nt.init(i,r),i._zod.pattern=i._zod.bag.pattern??Ep,i._zod.parse=(a,o)=>{if(r.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 k=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,...k?{received:k}:{}}),a}}),YS=fe("$ZodNumberFormat",(i,r)=>{hS.init(i,r),Dp.init(i,r)}),WS=fe("$ZodBoolean",(i,r)=>{nt.init(i,r),i._zod.pattern=oS,i._zod.parse=(a,o)=>{if(r.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}}),XS=fe("$ZodUnknown",(i,r)=>{nt.init(i,r),i._zod.parse=a=>a}),JS=fe("$ZodNever",(i,r)=>{nt.init(i,r),i._zod.parse=(a,o)=>(a.issues.push({expected:"never",code:"invalid_type",input:a.value,inst:i}),a)});function r_(i,r,a){i.issues.length&&r.issues.push(...Lr(a,i.issues)),r.value[a]=i.value}const QS=fe("$ZodArray",(i,r)=>{nt.init(i,r),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 k=[];for(let T=0;T<g.length;T++){const c=g[T],u=r.element._zod.run({value:c,issues:[]},o);u instanceof Promise?k.push(u.then(h=>r_(h,a,T))):r_(u,a,T)}return k.length?Promise.all(k).then(()=>a):a}});function Co(i,r,a,o,g){if(i.issues.length){if(g&&!(a in o))return;r.issues.push(...Lr(a,i.issues))}i.value===void 0?a in o&&(r.value[a]=void 0):r.value[a]=i.value}function Op(i){var o,g,k,T;const r=Object.keys(i.shape);for(const c of r)if(!((T=(k=(g=(o=i.shape)==null?void 0:o[c])==null?void 0:g._zod)==null?void 0:k.traits)!=null&&T.has("$ZodType")))throw new Error(`Invalid element at key "${c}": expected a Zod schema`);const a=g1(i.shape);return{...i,keys:r,keySet:new Set(r),numKeys:r.length,optionalKeys:new Set(a)}}function Mp(i,r,a,o,g,k){const T=[],c=g.keySet,u=g.catchall._zod,h=u.def.type,y=u.optout==="optional";for(const d in r){if(c.has(d))continue;if(h==="never"){T.push(d);continue}const C=u.run({value:r[d],issues:[]},o);C instanceof Promise?i.push(C.then(E=>Co(E,a,d,r,y))):Co(C,a,d,r,y)}return T.length&&a.issues.push({code:"unrecognized_keys",keys:T,input:r,inst:k}),i.length?Promise.all(i).then(()=>a):a}const ex=fe("$ZodObject",(i,r)=>{nt.init(i,r);const a=Object.getOwnPropertyDescriptor(r,"shape");if(!(a!=null&&a.get)){const c=r.shape;Object.defineProperty(r,"shape",{get:()=>{const u={...c};return Object.defineProperty(r,"shape",{value:u}),u}})}const o=Ru(()=>Op(r));$e(i._zod,"propValues",()=>{const c=r.shape,u={};for(const h in c){const y=c[h]._zod;if(y.values){u[h]??(u[h]=new Set);for(const d of y.values)u[h].add(d)}}return u});const g=xo,k=r.catchall;let T;i._zod.parse=(c,u)=>{T??(T=o.value);const h=c.value;if(!g(h))return c.issues.push({expected:"object",code:"invalid_type",input:h,inst:i}),c;c.value={};const y=[],d=T.shape;for(const C of T.keys){const E=d[C],O=E._zod.optout==="optional",x=E._zod.run({value:h[C],issues:[]},u);x instanceof Promise?y.push(x.then(m=>Co(m,c,C,h,O))):Co(x,c,C,h,O)}return k?Mp(y,h,c,u,o.value,i):y.length?Promise.all(y).then(()=>c):c}}),tx=fe("$ZodObjectJIT",(i,r)=>{ex.init(i,r);const a=i._zod.parse,o=Ru(()=>Op(r)),g=C=>{var v;const E=new xS(["shape","payload","ctx"]),O=o.value,x=S=>{const R=i_(S);return`shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`};E.write("const input = payload.value;");const m=Object.create(null);let p=0;for(const S of O.keys)m[S]=`key_${p++}`;E.write("const newResult = {};");for(const S of O.keys){const R=m[S],A=i_(S),M=C[S],w=((v=M==null?void 0:M._zod)==null?void 0:v.optout)==="optional";E.write(`const ${R} = ${x(S)};`),w?E.write(`
|
|
258
|
+
if (${R}.issues.length) {
|
|
259
|
+
if (${A} in input) {
|
|
260
|
+
payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
|
|
261
|
+
...iss,
|
|
262
|
+
path: iss.path ? [${A}, ...iss.path] : [${A}]
|
|
263
|
+
})));
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
if (${R}.value === undefined) {
|
|
268
|
+
if (${A} in input) {
|
|
269
|
+
newResult[${A}] = undefined;
|
|
270
|
+
}
|
|
271
|
+
} else {
|
|
272
|
+
newResult[${A}] = ${R}.value;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
`):E.write(`
|
|
276
|
+
if (${R}.issues.length) {
|
|
277
|
+
payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
|
|
278
|
+
...iss,
|
|
279
|
+
path: iss.path ? [${A}, ...iss.path] : [${A}]
|
|
280
|
+
})));
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
if (${R}.value === undefined) {
|
|
284
|
+
if (${A} in input) {
|
|
285
|
+
newResult[${A}] = undefined;
|
|
286
|
+
}
|
|
287
|
+
} else {
|
|
288
|
+
newResult[${A}] = ${R}.value;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
`)}E.write("payload.value = newResult;"),E.write("return payload;");const f=E.compile();return(S,R)=>f(C,S,R)};let k;const T=xo,c=!_p.jitless,h=c&&p1.value,y=r.catchall;let d;i._zod.parse=(C,E)=>{d??(d=o.value);const O=C.value;return T(O)?c&&h&&(E==null?void 0:E.async)===!1&&E.jitless!==!0?(k||(k=g(r.shape)),C=k(C,E),y?Mp([],O,C,E,d,i):C):a(C,E):(C.issues.push({expected:"object",code:"invalid_type",input:O,inst:i}),C)}});function n_(i,r,a,o){for(const k of i)if(k.issues.length===0)return r.value=k.value,r;const g=i.filter(k=>!Mr(k));return g.length===1?(r.value=g[0].value,g[0]):(r.issues.push({code:"invalid_union",input:r.value,inst:a,errors:i.map(k=>k.issues.map(T=>gs(T,o,vs())))}),r)}const ix=fe("$ZodUnion",(i,r)=>{nt.init(i,r),$e(i._zod,"optin",()=>r.options.some(g=>g._zod.optin==="optional")?"optional":void 0),$e(i._zod,"optout",()=>r.options.some(g=>g._zod.optout==="optional")?"optional":void 0),$e(i._zod,"values",()=>{if(r.options.every(g=>g._zod.values))return new Set(r.options.flatMap(g=>Array.from(g._zod.values)))}),$e(i._zod,"pattern",()=>{if(r.options.every(g=>g._zod.pattern)){const g=r.options.map(k=>k._zod.pattern);return new RegExp(`^(${g.map(k=>Ou(k.source)).join("|")})$`)}});const a=r.options.length===1,o=r.options[0]._zod.run;i._zod.parse=(g,k)=>{if(a)return o(g,k);let T=!1;const c=[];for(const u of r.options){const h=u._zod.run({value:g.value,issues:[]},k);if(h instanceof Promise)c.push(h),T=!0;else{if(h.issues.length===0)return h;c.push(h)}}return T?Promise.all(c).then(u=>n_(u,g,i,k)):n_(c,g,i,k)}}),sx=fe("$ZodIntersection",(i,r)=>{nt.init(i,r),i._zod.parse=(a,o)=>{const g=a.value,k=r.left._zod.run({value:g,issues:[]},o),T=r.right._zod.run({value:g,issues:[]},o);return k instanceof Promise||T instanceof Promise?Promise.all([k,T]).then(([u,h])=>a_(a,u,h)):a_(a,k,T)}});function pu(i,r){if(i===r)return{valid:!0,data:i};if(i instanceof Date&&r instanceof Date&&+i==+r)return{valid:!0,data:i};if(jr(i)&&jr(r)){const a=Object.keys(r),o=Object.keys(i).filter(k=>a.indexOf(k)!==-1),g={...i,...r};for(const k of o){const T=pu(i[k],r[k]);if(!T.valid)return{valid:!1,mergeErrorPath:[k,...T.mergeErrorPath]};g[k]=T.data}return{valid:!0,data:g}}if(Array.isArray(i)&&Array.isArray(r)){if(i.length!==r.length)return{valid:!1,mergeErrorPath:[]};const a=[];for(let o=0;o<i.length;o++){const g=i[o],k=r[o],T=pu(g,k);if(!T.valid)return{valid:!1,mergeErrorPath:[o,...T.mergeErrorPath]};a.push(T.data)}return{valid:!0,data:a}}return{valid:!1,mergeErrorPath:[]}}function a_(i,r,a){const o=new Map;let g;for(const c of r.issues)if(c.code==="unrecognized_keys"){g??(g=c);for(const u of c.keys)o.has(u)||o.set(u,{}),o.get(u).l=!0}else i.issues.push(c);for(const c of a.issues)if(c.code==="unrecognized_keys")for(const u of c.keys)o.has(u)||o.set(u,{}),o.get(u).r=!0;else i.issues.push(c);const k=[...o].filter(([,c])=>c.l&&c.r).map(([c])=>c);if(k.length&&g&&i.issues.push({...g,keys:k}),Mr(i))return i;const T=pu(r.value,a.value);if(!T.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(T.mergeErrorPath)}`);return i.value=T.data,i}const rx=fe("$ZodRecord",(i,r)=>{nt.init(i,r),i._zod.parse=(a,o)=>{const g=a.value;if(!jr(g))return a.issues.push({expected:"record",code:"invalid_type",input:g,inst:i}),a;const k=[],T=r.keyType._zod.values;if(T){a.value={};const c=new Set;for(const h of T)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){c.add(typeof h=="number"?h.toString():h);const y=r.valueType._zod.run({value:g[h],issues:[]},o);y instanceof Promise?k.push(y.then(d=>{d.issues.length&&a.issues.push(...Lr(h,d.issues)),a.value[h]=d.value})):(y.issues.length&&a.issues.push(...Lr(h,y.issues)),a.value[h]=y.value)}let u;for(const h in g)c.has(h)||(u=u??[],u.push(h));u&&u.length>0&&a.issues.push({code:"unrecognized_keys",input:g,inst:i,keys:u})}else{a.value={};for(const c of Reflect.ownKeys(g)){if(c==="__proto__")continue;let u=r.keyType._zod.run({value:c,issues:[]},o);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof c=="string"&&Ep.test(c)&&u.issues.length){const d=r.keyType._zod.run({value:Number(c),issues:[]},o);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(u=d)}if(u.issues.length){r.mode==="loose"?a.value[c]=g[c]:a.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(d=>gs(d,o,vs())),input:c,path:[c],inst:i});continue}const y=r.valueType._zod.run({value:g[c],issues:[]},o);y instanceof Promise?k.push(y.then(d=>{d.issues.length&&a.issues.push(...Lr(c,d.issues)),a.value[u.value]=d.value})):(y.issues.length&&a.issues.push(...Lr(c,y.issues)),a.value[u.value]=y.value)}}return k.length?Promise.all(k).then(()=>a):a}}),nx=fe("$ZodEnum",(i,r)=>{nt.init(i,r);const a=pp(r.entries),o=new Set(a);i._zod.values=o,i._zod.pattern=new RegExp(`^(${a.filter(g=>v1.has(typeof g)).map(g=>typeof g=="string"?Oo(g):g.toString()).join("|")})$`),i._zod.parse=(g,k)=>{const T=g.value;return o.has(T)||g.issues.push({code:"invalid_value",values:a,input:T,inst:i}),g}}),ax=fe("$ZodTransform",(i,r)=>{nt.init(i,r),i._zod.parse=(a,o)=>{if(o.direction==="backward")throw new mp(i.constructor.name);const g=r.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 Nr;return a.value=g,a}});function o_(i,r){return i.issues.length&&r===void 0?{issues:[],value:void 0}:i}const Lp=fe("$ZodOptional",(i,r)=>{nt.init(i,r),i._zod.optin="optional",i._zod.optout="optional",$e(i._zod,"values",()=>r.innerType._zod.values?new Set([...r.innerType._zod.values,void 0]):void 0),$e(i._zod,"pattern",()=>{const a=r.innerType._zod.pattern;return a?new RegExp(`^(${Ou(a.source)})?$`):void 0}),i._zod.parse=(a,o)=>{if(r.innerType._zod.optin==="optional"){const g=r.innerType._zod.run(a,o);return g instanceof Promise?g.then(k=>o_(k,a.value)):o_(g,a.value)}return a.value===void 0?a:r.innerType._zod.run(a,o)}}),ox=fe("$ZodExactOptional",(i,r)=>{Lp.init(i,r),$e(i._zod,"values",()=>r.innerType._zod.values),$e(i._zod,"pattern",()=>r.innerType._zod.pattern),i._zod.parse=(a,o)=>r.innerType._zod.run(a,o)}),lx=fe("$ZodNullable",(i,r)=>{nt.init(i,r),$e(i._zod,"optin",()=>r.innerType._zod.optin),$e(i._zod,"optout",()=>r.innerType._zod.optout),$e(i._zod,"pattern",()=>{const a=r.innerType._zod.pattern;return a?new RegExp(`^(${Ou(a.source)}|null)$`):void 0}),$e(i._zod,"values",()=>r.innerType._zod.values?new Set([...r.innerType._zod.values,null]):void 0),i._zod.parse=(a,o)=>a.value===null?a:r.innerType._zod.run(a,o)}),cx=fe("$ZodDefault",(i,r)=>{nt.init(i,r),i._zod.optin="optional",$e(i._zod,"values",()=>r.innerType._zod.values),i._zod.parse=(a,o)=>{if(o.direction==="backward")return r.innerType._zod.run(a,o);if(a.value===void 0)return a.value=r.defaultValue,a;const g=r.innerType._zod.run(a,o);return g instanceof Promise?g.then(k=>l_(k,r)):l_(g,r)}});function l_(i,r){return i.value===void 0&&(i.value=r.defaultValue),i}const ux=fe("$ZodPrefault",(i,r)=>{nt.init(i,r),i._zod.optin="optional",$e(i._zod,"values",()=>r.innerType._zod.values),i._zod.parse=(a,o)=>(o.direction==="backward"||a.value===void 0&&(a.value=r.defaultValue),r.innerType._zod.run(a,o))}),hx=fe("$ZodNonOptional",(i,r)=>{nt.init(i,r),$e(i._zod,"values",()=>{const a=r.innerType._zod.values;return a?new Set([...a].filter(o=>o!==void 0)):void 0}),i._zod.parse=(a,o)=>{const g=r.innerType._zod.run(a,o);return g instanceof Promise?g.then(k=>c_(k,i)):c_(g,i)}});function c_(i,r){return!i.issues.length&&i.value===void 0&&i.issues.push({code:"invalid_type",expected:"nonoptional",input:i.value,inst:r}),i}const fx=fe("$ZodCatch",(i,r)=>{nt.init(i,r),$e(i._zod,"optin",()=>r.innerType._zod.optin),$e(i._zod,"optout",()=>r.innerType._zod.optout),$e(i._zod,"values",()=>r.innerType._zod.values),i._zod.parse=(a,o)=>{if(o.direction==="backward")return r.innerType._zod.run(a,o);const g=r.innerType._zod.run(a,o);return g instanceof Promise?g.then(k=>(a.value=k.value,k.issues.length&&(a.value=r.catchValue({...a,error:{issues:k.issues.map(T=>gs(T,o,vs()))},input:a.value}),a.issues=[]),a)):(a.value=g.value,g.issues.length&&(a.value=r.catchValue({...a,error:{issues:g.issues.map(k=>gs(k,o,vs()))},input:a.value}),a.issues=[]),a)}}),dx=fe("$ZodPipe",(i,r)=>{nt.init(i,r),$e(i._zod,"values",()=>r.in._zod.values),$e(i._zod,"optin",()=>r.in._zod.optin),$e(i._zod,"optout",()=>r.out._zod.optout),$e(i._zod,"propValues",()=>r.in._zod.propValues),i._zod.parse=(a,o)=>{if(o.direction==="backward"){const k=r.out._zod.run(a,o);return k instanceof Promise?k.then(T=>mo(T,r.in,o)):mo(k,r.in,o)}const g=r.in._zod.run(a,o);return g instanceof Promise?g.then(k=>mo(k,r.out,o)):mo(g,r.out,o)}});function mo(i,r,a){return i.issues.length?(i.aborted=!0,i):r._zod.run({value:i.value,issues:i.issues},a)}const mx=fe("$ZodReadonly",(i,r)=>{nt.init(i,r),$e(i._zod,"propValues",()=>r.innerType._zod.propValues),$e(i._zod,"values",()=>r.innerType._zod.values),$e(i._zod,"optin",()=>{var a,o;return(o=(a=r.innerType)==null?void 0:a._zod)==null?void 0:o.optin}),$e(i._zod,"optout",()=>{var a,o;return(o=(a=r.innerType)==null?void 0:a._zod)==null?void 0:o.optout}),i._zod.parse=(a,o)=>{if(o.direction==="backward")return r.innerType._zod.run(a,o);const g=r.innerType._zod.run(a,o);return g instanceof Promise?g.then(u_):u_(g)}});function u_(i){return i.value=Object.freeze(i.value),i}const _x=fe("$ZodCustom",(i,r)=>{zt.init(i,r),nt.init(i,r),i._zod.parse=(a,o)=>a,i._zod.check=a=>{const o=a.value,g=r.fn(o);if(g instanceof Promise)return g.then(k=>h_(k,a,o,i));h_(g,a,o,i)}});function h_(i,r,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),r.issues.push(Pn(g))}}var f_;class px{constructor(){this._map=new WeakMap,this._idmap=new Map}add(r,...a){const o=a[0];return this._map.set(r,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,r),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(r){const a=this._map.get(r);return a&&typeof a=="object"&&"id"in a&&this._idmap.delete(a.id),this._map.delete(r),this}get(r){const a=r._zod.parent;if(a){const o={...this.get(a)??{}};delete o.id;const g={...o,...this._map.get(r)};return Object.keys(g).length?g:void 0}return this._map.get(r)}has(r){return this._map.has(r)}}function vx(){return new px}(f_=globalThis).__zod_globalRegistry??(f_.__zod_globalRegistry=vx());const Hn=globalThis.__zod_globalRegistry;function gx(i,r){return new i({type:"string",...be(r)})}function yx(i,r){return new i({type:"string",format:"email",check:"string_format",abort:!1,...be(r)})}function d_(i,r){return new i({type:"string",format:"guid",check:"string_format",abort:!1,...be(r)})}function bx(i,r){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,...be(r)})}function Sx(i,r){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...be(r)})}function xx(i,r){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...be(r)})}function Cx(i,r){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...be(r)})}function wx(i,r){return new i({type:"string",format:"url",check:"string_format",abort:!1,...be(r)})}function Ex(i,r){return new i({type:"string",format:"emoji",check:"string_format",abort:!1,...be(r)})}function kx(i,r){return new i({type:"string",format:"nanoid",check:"string_format",abort:!1,...be(r)})}function Tx(i,r){return new i({type:"string",format:"cuid",check:"string_format",abort:!1,...be(r)})}function Ax(i,r){return new i({type:"string",format:"cuid2",check:"string_format",abort:!1,...be(r)})}function Rx(i,r){return new i({type:"string",format:"ulid",check:"string_format",abort:!1,...be(r)})}function Dx(i,r){return new i({type:"string",format:"xid",check:"string_format",abort:!1,...be(r)})}function Ox(i,r){return new i({type:"string",format:"ksuid",check:"string_format",abort:!1,...be(r)})}function Mx(i,r){return new i({type:"string",format:"ipv4",check:"string_format",abort:!1,...be(r)})}function Lx(i,r){return new i({type:"string",format:"ipv6",check:"string_format",abort:!1,...be(r)})}function Nx(i,r){return new i({type:"string",format:"cidrv4",check:"string_format",abort:!1,...be(r)})}function jx(i,r){return new i({type:"string",format:"cidrv6",check:"string_format",abort:!1,...be(r)})}function Bx(i,r){return new i({type:"string",format:"base64",check:"string_format",abort:!1,...be(r)})}function zx(i,r){return new i({type:"string",format:"base64url",check:"string_format",abort:!1,...be(r)})}function Hx(i,r){return new i({type:"string",format:"e164",check:"string_format",abort:!1,...be(r)})}function Ux(i,r){return new i({type:"string",format:"jwt",check:"string_format",abort:!1,...be(r)})}function Ix(i,r){return new i({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...be(r)})}function Px(i,r){return new i({type:"string",format:"date",check:"string_format",...be(r)})}function $x(i,r){return new i({type:"string",format:"time",check:"string_format",precision:null,...be(r)})}function Zx(i,r){return new i({type:"string",format:"duration",check:"string_format",...be(r)})}function qx(i,r){return new i({type:"number",checks:[],...be(r)})}function Fx(i,r){return new i({type:"number",check:"number_format",abort:!1,format:"safeint",...be(r)})}function Kx(i,r){return new i({type:"boolean",...be(r)})}function Vx(i){return new i({type:"unknown"})}function Gx(i,r){return new i({type:"never",...be(r)})}function m_(i,r){return new Tp({check:"less_than",...be(r),value:i,inclusive:!1})}function nu(i,r){return new Tp({check:"less_than",...be(r),value:i,inclusive:!0})}function __(i,r){return new Ap({check:"greater_than",...be(r),value:i,inclusive:!1})}function au(i,r){return new Ap({check:"greater_than",...be(r),value:i,inclusive:!0})}function p_(i,r){return new uS({check:"multiple_of",...be(r),value:i})}function Np(i,r){return new fS({check:"max_length",...be(r),maximum:i})}function wo(i,r){return new dS({check:"min_length",...be(r),minimum:i})}function jp(i,r){return new mS({check:"length_equals",...be(r),length:i})}function Yx(i,r){return new _S({check:"string_format",format:"regex",...be(r),pattern:i})}function Wx(i){return new pS({check:"string_format",format:"lowercase",...be(i)})}function Xx(i){return new vS({check:"string_format",format:"uppercase",...be(i)})}function Jx(i,r){return new gS({check:"string_format",format:"includes",...be(r),includes:i})}function Qx(i,r){return new yS({check:"string_format",format:"starts_with",...be(r),prefix:i})}function eC(i,r){return new bS({check:"string_format",format:"ends_with",...be(r),suffix:i})}function Ur(i){return new SS({check:"overwrite",tx:i})}function tC(i){return Ur(r=>r.normalize(i))}function iC(){return Ur(i=>i.trim())}function sC(){return Ur(i=>i.toLowerCase())}function rC(){return Ur(i=>i.toUpperCase())}function nC(){return Ur(i=>_1(i))}function aC(i,r,a){return new i({type:"array",element:r,...be(a)})}function oC(i,r,a){return new i({type:"custom",check:"custom",fn:r,...be(a)})}function lC(i){const r=cC(a=>(a.addIssue=o=>{if(typeof o=="string")a.issues.push(Pn(o,a.value,r._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=r),g.continue??(g.continue=!r._zod.def.abort),a.issues.push(Pn(g))}},i(a.value,a)));return r}function cC(i,r){const a=new zt({check:"custom",...be(r)});return a._zod.check=i,a}function Bp(i){let r=(i==null?void 0:i.target)??"draft-2020-12";return r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),{processors:i.processors??{},metadataRegistry:(i==null?void 0:i.metadata)??Hn,target:r,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 _t(i,r,a={path:[],schemaPath:[]}){var y,d;var o;const g=i._zod.def,k=r.seen.get(i);if(k)return k.count++,a.schemaPath.includes(i)&&(k.cycle=a.path),k.schema;const T={schema:{},count:1,cycle:void 0,path:a.path};r.seen.set(i,T);const c=(d=(y=i._zod).toJSONSchema)==null?void 0:d.call(y);if(c)T.schema=c;else{const C={...a,schemaPath:[...a.schemaPath,i],path:a.path};if(i._zod.processJSONSchema)i._zod.processJSONSchema(r,T.schema,C);else{const O=T.schema,x=r.processors[g.type];if(!x)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${g.type}`);x(i,r,O,C)}const E=i._zod.parent;E&&(T.ref||(T.ref=E),_t(E,r,C),r.seen.get(E).isParent=!0)}const u=r.metadataRegistry.get(i);return u&&Object.assign(T.schema,u),r.io==="input"&&Tt(i)&&(delete T.schema.examples,delete T.schema.default),r.io==="input"&&T.schema._prefault&&((o=T.schema).default??(o.default=T.schema._prefault)),delete T.schema._prefault,r.seen.get(i).schema}function zp(i,r){var T,c,u,h;const a=i.seen.get(r);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 d=(T=i.metadataRegistry.get(y[0]))==null?void 0:T.id;if(d){const C=o.get(d);if(C&&C!==y[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(d,y[0])}}const g=y=>{var x;const d=i.target==="draft-2020-12"?"$defs":"definitions";if(i.external){const m=(x=i.external.registry.get(y[0]))==null?void 0:x.id,p=i.external.uri??(v=>v);if(m)return{ref:p(m)};const f=y[1].defId??y[1].schema.id??`schema${i.counter++}`;return y[1].defId=f,{defId:f,ref:`${p("__shared")}#/${d}/${f}`}}if(y[1]===a)return{ref:"#"};const E=`#/${d}/`,O=y[1].schema.id??`__schema${i.counter++}`;return{defId:O,ref:E+O}},k=y=>{if(y[1].schema.$ref)return;const d=y[1],{ref:C,defId:E}=g(y);d.def={...d.schema},E&&(d.defId=E);const O=d.schema;for(const x in O)delete O[x];O.$ref=C};if(i.cycles==="throw")for(const y of i.seen.entries()){const d=y[1];if(d.cycle)throw new Error(`Cycle detected: #/${(c=d.cycle)==null?void 0:c.join("/")}/<root>
|
|
292
|
+
|
|
293
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const y of i.seen.entries()){const d=y[1];if(r===y[0]){k(y);continue}if(i.external){const E=(u=i.external.registry.get(y[0]))==null?void 0:u.id;if(r!==y[0]&&E){k(y);continue}}if((h=i.metadataRegistry.get(y[0]))==null?void 0:h.id){k(y);continue}if(d.cycle){k(y);continue}if(d.count>1&&i.reused==="ref"){k(y);continue}}}function Hp(i,r){var T,c,u;const a=i.seen.get(r);if(!a)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=h=>{const y=i.seen.get(h);if(y.ref===null)return;const d=y.def??y.schema,C={...d},E=y.ref;if(y.ref=null,E){o(E);const x=i.seen.get(E),m=x.schema;if(m.$ref&&(i.target==="draft-07"||i.target==="draft-04"||i.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(m)):Object.assign(d,m),Object.assign(d,C),h._zod.parent===E)for(const f in d)f==="$ref"||f==="allOf"||f in C||delete d[f];if(m.$ref&&x.def)for(const f in d)f==="$ref"||f==="allOf"||f in x.def&&JSON.stringify(d[f])===JSON.stringify(x.def[f])&&delete d[f]}const O=h._zod.parent;if(O&&O!==E){o(O);const x=i.seen.get(O);if(x!=null&&x.schema.$ref&&(d.$ref=x.schema.$ref,x.def))for(const m in d)m==="$ref"||m==="allOf"||m in x.def&&JSON.stringify(d[m])===JSON.stringify(x.def[m])&&delete d[m]}i.override({zodSchema:h,jsonSchema:d,path:y.path??[]})};for(const h of[...i.seen.entries()].reverse())o(h[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 h=(c=i.external.registry.get(r))==null?void 0:c.id;if(!h)throw new Error("Schema is missing an `id` property");g.$id=i.external.uri(h)}Object.assign(g,a.def??a.schema);const k=((u=i.external)==null?void 0:u.defs)??{};for(const h of i.seen.entries()){const y=h[1];y.def&&y.defId&&(k[y.defId]=y.def)}i.external||Object.keys(k).length>0&&(i.target==="draft-2020-12"?g.$defs=k:g.definitions=k);try{const h=JSON.parse(JSON.stringify(g));return Object.defineProperty(h,"~standard",{value:{...r["~standard"],jsonSchema:{input:Eo(r,"input",i.processors),output:Eo(r,"output",i.processors)}},enumerable:!1,writable:!1}),h}catch{throw new Error("Error converting schema to JSON.")}}function Tt(i,r){const a=r??{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 Tt(o.element,a);if(o.type==="set")return Tt(o.valueType,a);if(o.type==="lazy")return Tt(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 Tt(o.innerType,a);if(o.type==="intersection")return Tt(o.left,a)||Tt(o.right,a);if(o.type==="record"||o.type==="map")return Tt(o.keyType,a)||Tt(o.valueType,a);if(o.type==="pipe")return Tt(o.in,a)||Tt(o.out,a);if(o.type==="object"){for(const g in o.shape)if(Tt(o.shape[g],a))return!0;return!1}if(o.type==="union"){for(const g of o.options)if(Tt(g,a))return!0;return!1}if(o.type==="tuple"){for(const g of o.items)if(Tt(g,a))return!0;return!!(o.rest&&Tt(o.rest,a))}return!1}const uC=(i,r={})=>a=>{const o=Bp({...a,processors:r});return _t(i,o),zp(o,i),Hp(o,i)},Eo=(i,r,a={})=>o=>{const{libraryOptions:g,target:k}=o??{},T=Bp({...g??{},target:k,io:r,processors:a});return _t(i,T),zp(T,i),Hp(T,i)},hC={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},fC=(i,r,a,o)=>{const g=a;g.type="string";const{minimum:k,maximum:T,format:c,patterns:u,contentEncoding:h}=i._zod.bag;if(typeof k=="number"&&(g.minLength=k),typeof T=="number"&&(g.maxLength=T),c&&(g.format=hC[c]??c,g.format===""&&delete g.format,c==="time"&&delete g.format),h&&(g.contentEncoding=h),u&&u.size>0){const y=[...u];y.length===1?g.pattern=y[0].source:y.length>1&&(g.allOf=[...y.map(d=>({...r.target==="draft-07"||r.target==="draft-04"||r.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},dC=(i,r,a,o)=>{const g=a,{minimum:k,maximum:T,format:c,multipleOf:u,exclusiveMaximum:h,exclusiveMinimum:y}=i._zod.bag;typeof c=="string"&&c.includes("int")?g.type="integer":g.type="number",typeof y=="number"&&(r.target==="draft-04"||r.target==="openapi-3.0"?(g.minimum=y,g.exclusiveMinimum=!0):g.exclusiveMinimum=y),typeof k=="number"&&(g.minimum=k,typeof y=="number"&&r.target!=="draft-04"&&(y>=k?delete g.minimum:delete g.exclusiveMinimum)),typeof h=="number"&&(r.target==="draft-04"||r.target==="openapi-3.0"?(g.maximum=h,g.exclusiveMaximum=!0):g.exclusiveMaximum=h),typeof T=="number"&&(g.maximum=T,typeof h=="number"&&r.target!=="draft-04"&&(h<=T?delete g.maximum:delete g.exclusiveMaximum)),typeof u=="number"&&(g.multipleOf=u)},mC=(i,r,a,o)=>{a.type="boolean"},_C=(i,r,a,o)=>{a.not={}},pC=(i,r,a,o)=>{},vC=(i,r,a,o)=>{const g=i._zod.def,k=pp(g.entries);k.every(T=>typeof T=="number")&&(a.type="number"),k.every(T=>typeof T=="string")&&(a.type="string"),a.enum=k},gC=(i,r,a,o)=>{if(r.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},yC=(i,r,a,o)=>{if(r.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},bC=(i,r,a,o)=>{const g=a,k=i._zod.def,{minimum:T,maximum:c}=i._zod.bag;typeof T=="number"&&(g.minItems=T),typeof c=="number"&&(g.maxItems=c),g.type="array",g.items=_t(k.element,r,{...o,path:[...o.path,"items"]})},SC=(i,r,a,o)=>{var h;const g=a,k=i._zod.def;g.type="object",g.properties={};const T=k.shape;for(const y in T)g.properties[y]=_t(T[y],r,{...o,path:[...o.path,"properties",y]});const c=new Set(Object.keys(T)),u=new Set([...c].filter(y=>{const d=k.shape[y]._zod;return r.io==="input"?d.optin===void 0:d.optout===void 0}));u.size>0&&(g.required=Array.from(u)),((h=k.catchall)==null?void 0:h._zod.def.type)==="never"?g.additionalProperties=!1:k.catchall?k.catchall&&(g.additionalProperties=_t(k.catchall,r,{...o,path:[...o.path,"additionalProperties"]})):r.io==="output"&&(g.additionalProperties=!1)},xC=(i,r,a,o)=>{const g=i._zod.def,k=g.inclusive===!1,T=g.options.map((c,u)=>_t(c,r,{...o,path:[...o.path,k?"oneOf":"anyOf",u]}));k?a.oneOf=T:a.anyOf=T},CC=(i,r,a,o)=>{const g=i._zod.def,k=_t(g.left,r,{...o,path:[...o.path,"allOf",0]}),T=_t(g.right,r,{...o,path:[...o.path,"allOf",1]}),c=h=>"allOf"in h&&Object.keys(h).length===1,u=[...c(k)?k.allOf:[k],...c(T)?T.allOf:[T]];a.allOf=u},wC=(i,r,a,o)=>{const g=a,k=i._zod.def;g.type="object";const T=k.keyType,c=T._zod.bag,u=c==null?void 0:c.patterns;if(k.mode==="loose"&&u&&u.size>0){const y=_t(k.valueType,r,{...o,path:[...o.path,"patternProperties","*"]});g.patternProperties={};for(const d of u)g.patternProperties[d.source]=y}else(r.target==="draft-07"||r.target==="draft-2020-12")&&(g.propertyNames=_t(k.keyType,r,{...o,path:[...o.path,"propertyNames"]})),g.additionalProperties=_t(k.valueType,r,{...o,path:[...o.path,"additionalProperties"]});const h=T._zod.values;if(h){const y=[...h].filter(d=>typeof d=="string"||typeof d=="number");y.length>0&&(g.required=y)}},EC=(i,r,a,o)=>{const g=i._zod.def,k=_t(g.innerType,r,o),T=r.seen.get(i);r.target==="openapi-3.0"?(T.ref=g.innerType,a.nullable=!0):a.anyOf=[k,{type:"null"}]},kC=(i,r,a,o)=>{const g=i._zod.def;_t(g.innerType,r,o);const k=r.seen.get(i);k.ref=g.innerType},TC=(i,r,a,o)=>{const g=i._zod.def;_t(g.innerType,r,o);const k=r.seen.get(i);k.ref=g.innerType,a.default=JSON.parse(JSON.stringify(g.defaultValue))},AC=(i,r,a,o)=>{const g=i._zod.def;_t(g.innerType,r,o);const k=r.seen.get(i);k.ref=g.innerType,r.io==="input"&&(a._prefault=JSON.parse(JSON.stringify(g.defaultValue)))},RC=(i,r,a,o)=>{const g=i._zod.def;_t(g.innerType,r,o);const k=r.seen.get(i);k.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},DC=(i,r,a,o)=>{const g=i._zod.def,k=r.io==="input"?g.in._zod.def.type==="transform"?g.out:g.in:g.out;_t(k,r,o);const T=r.seen.get(i);T.ref=k},OC=(i,r,a,o)=>{const g=i._zod.def;_t(g.innerType,r,o);const k=r.seen.get(i);k.ref=g.innerType,a.readOnly=!0},Up=(i,r,a,o)=>{const g=i._zod.def;_t(g.innerType,r,o);const k=r.seen.get(i);k.ref=g.innerType},MC=fe("ZodISODateTime",(i,r)=>{jS.init(i,r),it.init(i,r)});function LC(i){return Ix(MC,i)}const NC=fe("ZodISODate",(i,r)=>{BS.init(i,r),it.init(i,r)});function jC(i){return Px(NC,i)}const BC=fe("ZodISOTime",(i,r)=>{zS.init(i,r),it.init(i,r)});function zC(i){return $x(BC,i)}const HC=fe("ZodISODuration",(i,r)=>{HS.init(i,r),it.init(i,r)});function UC(i){return Zx(HC,i)}const IC=(i,r)=>{bp.init(i,r),i.name="ZodError",Object.defineProperties(i,{format:{value:a=>A1(i,a)},flatten:{value:a=>T1(i,a)},addIssue:{value:a=>{i.issues.push(a),i.message=JSON.stringify(i.issues,_u,2)}},addIssues:{value:a=>{i.issues.push(...a),i.message=JSON.stringify(i.issues,_u,2)}},isEmpty:{get(){return i.issues.length===0}}})},ai=fe("ZodError",IC,{Parent:Error}),PC=Lu(ai),$C=Nu(ai),ZC=Mo(ai),qC=Lo(ai),FC=O1(ai),KC=M1(ai),VC=L1(ai),GC=N1(ai),YC=j1(ai),WC=B1(ai),XC=z1(ai),JC=H1(ai),at=fe("ZodType",(i,r)=>(nt.init(i,r),Object.assign(i["~standard"],{jsonSchema:{input:Eo(i,"input"),output:Eo(i,"output")}}),i.toJSONSchema=uC(i,{}),i.def=r,i.type=r.type,Object.defineProperty(i,"_def",{value:r}),i.check=(...a)=>i.clone(bs(r,{checks:[...r.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)=>Ss(i,a,o),i.brand=()=>i,i.register=((a,o)=>(a.add(i,o),i)),i.parse=(a,o)=>PC(i,a,o,{callee:i.parse}),i.safeParse=(a,o)=>ZC(i,a,o),i.parseAsync=async(a,o)=>$C(i,a,o,{callee:i.parseAsync}),i.safeParseAsync=async(a,o)=>qC(i,a,o),i.spa=i.safeParseAsync,i.encode=(a,o)=>FC(i,a,o),i.decode=(a,o)=>KC(i,a,o),i.encodeAsync=async(a,o)=>VC(i,a,o),i.decodeAsync=async(a,o)=>GC(i,a,o),i.safeEncode=(a,o)=>YC(i,a,o),i.safeDecode=(a,o)=>WC(i,a,o),i.safeEncodeAsync=async(a,o)=>XC(i,a,o),i.safeDecodeAsync=async(a,o)=>JC(i,a,o),i.refine=(a,o)=>i.check(F2(a,o)),i.superRefine=a=>i.check(K2(a)),i.overwrite=a=>i.check(Ur(a)),i.optional=()=>y_(i),i.exactOptional=()=>M2(i),i.nullable=()=>b_(i),i.nullish=()=>y_(b_(i)),i.nonoptional=a=>H2(i,a),i.array=()=>Vn(i),i.or=a=>E2([i,a]),i.and=a=>T2(i,a),i.transform=a=>S_(i,D2(a)),i.default=a=>j2(i,a),i.prefault=a=>z2(i,a),i.catch=a=>I2(i,a),i.pipe=a=>S_(i,a),i.readonly=()=>Z2(i),i.describe=a=>{const o=i.clone();return Hn.add(o,{description:a}),o},Object.defineProperty(i,"description",{get(){var a;return(a=Hn.get(i))==null?void 0:a.description},configurable:!0}),i.meta=(...a)=>{if(a.length===0)return Hn.get(i);const o=i.clone();return Hn.add(o,a[0]),o},i.isOptional=()=>i.safeParse(void 0).success,i.isNullable=()=>i.safeParse(null).success,i.apply=a=>a(i),i)),Ip=fe("_ZodString",(i,r)=>{ju.init(i,r),at.init(i,r),i._zod.processJSONSchema=(o,g,k)=>fC(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(Yx(...o)),i.includes=(...o)=>i.check(Jx(...o)),i.startsWith=(...o)=>i.check(Qx(...o)),i.endsWith=(...o)=>i.check(eC(...o)),i.min=(...o)=>i.check(wo(...o)),i.max=(...o)=>i.check(Np(...o)),i.length=(...o)=>i.check(jp(...o)),i.nonempty=(...o)=>i.check(wo(1,...o)),i.lowercase=o=>i.check(Wx(o)),i.uppercase=o=>i.check(Xx(o)),i.trim=()=>i.check(iC()),i.normalize=(...o)=>i.check(tC(...o)),i.toLowerCase=()=>i.check(sC()),i.toUpperCase=()=>i.check(rC()),i.slugify=()=>i.check(nC())}),QC=fe("ZodString",(i,r)=>{ju.init(i,r),Ip.init(i,r),i.email=a=>i.check(yx(e2,a)),i.url=a=>i.check(wx(t2,a)),i.jwt=a=>i.check(Ux(p2,a)),i.emoji=a=>i.check(Ex(i2,a)),i.guid=a=>i.check(d_(v_,a)),i.uuid=a=>i.check(bx(_o,a)),i.uuidv4=a=>i.check(Sx(_o,a)),i.uuidv6=a=>i.check(xx(_o,a)),i.uuidv7=a=>i.check(Cx(_o,a)),i.nanoid=a=>i.check(kx(s2,a)),i.guid=a=>i.check(d_(v_,a)),i.cuid=a=>i.check(Tx(r2,a)),i.cuid2=a=>i.check(Ax(n2,a)),i.ulid=a=>i.check(Rx(a2,a)),i.base64=a=>i.check(Bx(d2,a)),i.base64url=a=>i.check(zx(m2,a)),i.xid=a=>i.check(Dx(o2,a)),i.ksuid=a=>i.check(Ox(l2,a)),i.ipv4=a=>i.check(Mx(c2,a)),i.ipv6=a=>i.check(Lx(u2,a)),i.cidrv4=a=>i.check(Nx(h2,a)),i.cidrv6=a=>i.check(jx(f2,a)),i.e164=a=>i.check(Hx(_2,a)),i.datetime=a=>i.check(LC(a)),i.date=a=>i.check(jC(a)),i.time=a=>i.check(zC(a)),i.duration=a=>i.check(UC(a))});function Ae(i){return gx(QC,i)}const it=fe("ZodStringFormat",(i,r)=>{Qe.init(i,r),Ip.init(i,r)}),e2=fe("ZodEmail",(i,r)=>{kS.init(i,r),it.init(i,r)}),v_=fe("ZodGUID",(i,r)=>{wS.init(i,r),it.init(i,r)}),_o=fe("ZodUUID",(i,r)=>{ES.init(i,r),it.init(i,r)}),t2=fe("ZodURL",(i,r)=>{TS.init(i,r),it.init(i,r)}),i2=fe("ZodEmoji",(i,r)=>{AS.init(i,r),it.init(i,r)}),s2=fe("ZodNanoID",(i,r)=>{RS.init(i,r),it.init(i,r)}),r2=fe("ZodCUID",(i,r)=>{DS.init(i,r),it.init(i,r)}),n2=fe("ZodCUID2",(i,r)=>{OS.init(i,r),it.init(i,r)}),a2=fe("ZodULID",(i,r)=>{MS.init(i,r),it.init(i,r)}),o2=fe("ZodXID",(i,r)=>{LS.init(i,r),it.init(i,r)}),l2=fe("ZodKSUID",(i,r)=>{NS.init(i,r),it.init(i,r)}),c2=fe("ZodIPv4",(i,r)=>{US.init(i,r),it.init(i,r)}),u2=fe("ZodIPv6",(i,r)=>{IS.init(i,r),it.init(i,r)}),h2=fe("ZodCIDRv4",(i,r)=>{PS.init(i,r),it.init(i,r)}),f2=fe("ZodCIDRv6",(i,r)=>{$S.init(i,r),it.init(i,r)}),d2=fe("ZodBase64",(i,r)=>{ZS.init(i,r),it.init(i,r)}),m2=fe("ZodBase64URL",(i,r)=>{FS.init(i,r),it.init(i,r)}),_2=fe("ZodE164",(i,r)=>{KS.init(i,r),it.init(i,r)}),p2=fe("ZodJWT",(i,r)=>{GS.init(i,r),it.init(i,r)}),Pp=fe("ZodNumber",(i,r)=>{Dp.init(i,r),at.init(i,r),i._zod.processJSONSchema=(o,g,k)=>dC(i,o,g),i.gt=(o,g)=>i.check(__(o,g)),i.gte=(o,g)=>i.check(au(o,g)),i.min=(o,g)=>i.check(au(o,g)),i.lt=(o,g)=>i.check(m_(o,g)),i.lte=(o,g)=>i.check(nu(o,g)),i.max=(o,g)=>i.check(nu(o,g)),i.int=o=>i.check(g_(o)),i.safe=o=>i.check(g_(o)),i.positive=o=>i.check(__(0,o)),i.nonnegative=o=>i.check(au(0,o)),i.negative=o=>i.check(m_(0,o)),i.nonpositive=o=>i.check(nu(0,o)),i.multipleOf=(o,g)=>i.check(p_(o,g)),i.step=(o,g)=>i.check(p_(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 xe(i){return qx(Pp,i)}const v2=fe("ZodNumberFormat",(i,r)=>{YS.init(i,r),Pp.init(i,r)});function g_(i){return Fx(v2,i)}const g2=fe("ZodBoolean",(i,r)=>{WS.init(i,r),at.init(i,r),i._zod.processJSONSchema=(a,o,g)=>mC(i,a,o)});function Ii(i){return Kx(g2,i)}const y2=fe("ZodUnknown",(i,r)=>{XS.init(i,r),at.init(i,r),i._zod.processJSONSchema=(a,o,g)=>pC()});function ko(){return Vx(y2)}const b2=fe("ZodNever",(i,r)=>{JS.init(i,r),at.init(i,r),i._zod.processJSONSchema=(a,o,g)=>_C(i,a,o)});function S2(i){return Gx(b2,i)}const x2=fe("ZodArray",(i,r)=>{QS.init(i,r),at.init(i,r),i._zod.processJSONSchema=(a,o,g)=>bC(i,a,o,g),i.element=r.element,i.min=(a,o)=>i.check(wo(a,o)),i.nonempty=a=>i.check(wo(1,a)),i.max=(a,o)=>i.check(Np(a,o)),i.length=(a,o)=>i.check(jp(a,o)),i.unwrap=()=>i.element});function Vn(i,r){return aC(x2,i,r)}const C2=fe("ZodObject",(i,r)=>{tx.init(i,r),at.init(i,r),i._zod.processJSONSchema=(a,o,g)=>SC(i,a,o,g),$e(i,"shape",()=>r.shape),i.keyof=()=>Br(Object.keys(i._zod.def.shape)),i.catchall=a=>i.clone({...i._zod.def,catchall:a}),i.passthrough=()=>i.clone({...i._zod.def,catchall:ko()}),i.loose=()=>i.clone({...i._zod.def,catchall:ko()}),i.strict=()=>i.clone({...i._zod.def,catchall:S2()}),i.strip=()=>i.clone({...i._zod.def,catchall:void 0}),i.extend=a=>x1(i,a),i.safeExtend=a=>C1(i,a),i.merge=a=>w1(i,a),i.pick=a=>b1(i,a),i.omit=a=>S1(i,a),i.partial=(...a)=>E1($p,i,a[0]),i.required=(...a)=>k1(Zp,i,a[0])});function Xe(i,r){const a={type:"object",shape:i??{},...be(r)};return new C2(a)}const w2=fe("ZodUnion",(i,r)=>{ix.init(i,r),at.init(i,r),i._zod.processJSONSchema=(a,o,g)=>xC(i,a,o,g),i.options=r.options});function E2(i,r){return new w2({type:"union",options:i,...be(r)})}const k2=fe("ZodIntersection",(i,r)=>{sx.init(i,r),at.init(i,r),i._zod.processJSONSchema=(a,o,g)=>CC(i,a,o,g)});function T2(i,r){return new k2({type:"intersection",left:i,right:r})}const A2=fe("ZodRecord",(i,r)=>{rx.init(i,r),at.init(i,r),i._zod.processJSONSchema=(a,o,g)=>wC(i,a,o,g),i.keyType=r.keyType,i.valueType=r.valueType});function jo(i,r,a){return new A2({type:"record",keyType:i,valueType:r,...be(a)})}const vu=fe("ZodEnum",(i,r)=>{nx.init(i,r),at.init(i,r),i._zod.processJSONSchema=(o,g,k)=>vC(i,o,g),i.enum=r.entries,i.options=Object.values(r.entries);const a=new Set(Object.keys(r.entries));i.extract=(o,g)=>{const k={};for(const T of o)if(a.has(T))k[T]=r.entries[T];else throw new Error(`Key ${T} not found in enum`);return new vu({...r,checks:[],...be(g),entries:k})},i.exclude=(o,g)=>{const k={...r.entries};for(const T of o)if(a.has(T))delete k[T];else throw new Error(`Key ${T} not found in enum`);return new vu({...r,checks:[],...be(g),entries:k})}});function Br(i,r){const a=Array.isArray(i)?Object.fromEntries(i.map(o=>[o,o])):i;return new vu({type:"enum",entries:a,...be(r)})}const R2=fe("ZodTransform",(i,r)=>{ax.init(i,r),at.init(i,r),i._zod.processJSONSchema=(a,o,g)=>yC(i,a),i._zod.parse=(a,o)=>{if(o.direction==="backward")throw new mp(i.constructor.name);a.addIssue=k=>{if(typeof k=="string")a.issues.push(Pn(k,a.value,r));else{const T=k;T.fatal&&(T.continue=!1),T.code??(T.code="custom"),T.input??(T.input=a.value),T.inst??(T.inst=i),a.issues.push(Pn(T))}};const g=r.transform(a.value,a);return g instanceof Promise?g.then(k=>(a.value=k,a)):(a.value=g,a)}});function D2(i){return new R2({type:"transform",transform:i})}const $p=fe("ZodOptional",(i,r)=>{Lp.init(i,r),at.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Up(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function y_(i){return new $p({type:"optional",innerType:i})}const O2=fe("ZodExactOptional",(i,r)=>{ox.init(i,r),at.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Up(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function M2(i){return new O2({type:"optional",innerType:i})}const L2=fe("ZodNullable",(i,r)=>{lx.init(i,r),at.init(i,r),i._zod.processJSONSchema=(a,o,g)=>EC(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function b_(i){return new L2({type:"nullable",innerType:i})}const N2=fe("ZodDefault",(i,r)=>{cx.init(i,r),at.init(i,r),i._zod.processJSONSchema=(a,o,g)=>TC(i,a,o,g),i.unwrap=()=>i._zod.def.innerType,i.removeDefault=i.unwrap});function j2(i,r){return new N2({type:"default",innerType:i,get defaultValue(){return typeof r=="function"?r():gp(r)}})}const B2=fe("ZodPrefault",(i,r)=>{ux.init(i,r),at.init(i,r),i._zod.processJSONSchema=(a,o,g)=>AC(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function z2(i,r){return new B2({type:"prefault",innerType:i,get defaultValue(){return typeof r=="function"?r():gp(r)}})}const Zp=fe("ZodNonOptional",(i,r)=>{hx.init(i,r),at.init(i,r),i._zod.processJSONSchema=(a,o,g)=>kC(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function H2(i,r){return new Zp({type:"nonoptional",innerType:i,...be(r)})}const U2=fe("ZodCatch",(i,r)=>{fx.init(i,r),at.init(i,r),i._zod.processJSONSchema=(a,o,g)=>RC(i,a,o,g),i.unwrap=()=>i._zod.def.innerType,i.removeCatch=i.unwrap});function I2(i,r){return new U2({type:"catch",innerType:i,catchValue:typeof r=="function"?r:()=>r})}const P2=fe("ZodPipe",(i,r)=>{dx.init(i,r),at.init(i,r),i._zod.processJSONSchema=(a,o,g)=>DC(i,a,o,g),i.in=r.in,i.out=r.out});function S_(i,r){return new P2({type:"pipe",in:i,out:r})}const $2=fe("ZodReadonly",(i,r)=>{mx.init(i,r),at.init(i,r),i._zod.processJSONSchema=(a,o,g)=>OC(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function Z2(i){return new $2({type:"readonly",innerType:i})}const q2=fe("ZodCustom",(i,r)=>{_x.init(i,r),at.init(i,r),i._zod.processJSONSchema=(a,o,g)=>gC(i,a)});function F2(i,r={}){return oC(q2,i,r)}function K2(i){return lC(i)}const Bu=Br(["idle","working","compacting","context_warning","waiting_for_input","permission_prompt","plan_mode","ask_question","bash_approval","settings","error","unknown"]),zu=Xe({ok:Ii()}),V2=Xe({id:Ae(),name:Ae(),createdAt:xe(),lastUsedAt:xe(),rateLimit:xe()}),G2=Xe({id:Ae(),name:Ae(),key:Ae()}),Y2=zu.extend({delivered:Ii(),attempts:xe()}),W2=Xe({status:Ae(),version:Ae(),uptime:xe(),sessions:Xe({active:xe(),total:xe()}),timestamp:Ae()}),Bo=Xe({id:Ae(),windowId:Ae(),windowName:Ae(),workDir:Ae(),claudeSessionId:Ae().optional(),jsonlPath:Ae().optional(),byteOffset:xe(),monitorOffset:xe(),status:Bu,createdAt:xe(),lastActivity:xe(),stallThresholdMs:xe(),permissionMode:Ae(),autoApprove:Ii().optional(),settingsPatched:Ii().optional(),promptDelivery:Xe({delivered:Ii(),attempts:xe()}).optional(),actionHints:jo(Ae(),Xe({method:Ae(),url:Ae(),description:Ae()})).optional()}),X2=Xe({sessions:Vn(Bo),pagination:Xe({page:xe(),limit:xe(),total:xe(),totalPages:xe()})}),J2=Xe({alive:Ii(),windowExists:Ii(),claudeRunning:Ii(),paneCommand:Ae().nullable(),status:Bu,hasTranscript:Ii(),lastActivity:xe(),lastActivityAgo:xe(),sessionAge:xe(),details:Ae(),actionHints:jo(Ae(),Xe({method:Ae(),url:Ae(),description:Ae()})).optional()}),Q2=Xe({durationSec:xe(),messages:xe(),toolCalls:xe(),approvals:xe(),autoApprovals:xe(),statusChanges:Vn(Ae())}),ps=Xe({min:xe().nullable(),max:xe().nullable(),avg:xe().nullable(),count:xe()}),ew=Xe({sessionId:Ae(),realtime:Xe({hook_latency_ms:xe().nullable(),state_change_detection_ms:xe().nullable(),permission_response_ms:xe().nullable()}).nullable(),aggregated:Xe({hook_latency_ms:ps,state_change_detection_ms:ps,permission_response_ms:ps,channel_delivery_ms:ps}).nullable()}),tw=Xe({role:Br(["user","assistant","system"]),contentType:Br(["text","thinking","tool_use","tool_result","tool_error","permission_request","progress"]),text:Ae(),toolName:Ae().optional(),toolUseId:Ae().optional(),timestamp:Ae().optional()}),iw=Xe({messages:Vn(tw),status:Bu,statusText:Ae().nullable(),interactiveContent:Ae().nullable()}),sw=Xe({uptime:xe(),sessions:Xe({total_created:xe(),currently_active:xe(),completed:xe(),failed:xe(),avg_duration_sec:xe(),avg_messages_per_session:xe()}),auto_approvals:xe(),webhooks_sent:xe(),webhooks_failed:xe(),screenshots_taken:xe(),pipelines_created:xe(),batches_created:xe(),prompt_delivery:Xe({sent:xe(),delivered:xe(),failed:xe(),success_rate:xe().nullable()}),latency:Xe({hook_latency_ms:ps,state_change_detection_ms:ps,permission_response_ms:ps,channel_delivery_ms:ps})}),rw=Br(["status","message","approval","ended","heartbeat","stall","dead","system","hook","subagent_start","subagent_stop","verification"]),nw=Xe({event:rw,sessionId:Ae(),timestamp:Ae(),data:jo(Ae(),ko())}),aw=Br(["session_status_change","session_message","session_approval","session_ended","session_created","session_stall","session_dead","session_subagent_start","session_subagent_stop","session_verification"]),ow=Xe({event:aw,sessionId:Ae(),timestamp:Ae(),data:jo(Ae(),ko())}),lw=3e4,cw=300*1e3;class To{constructor(r,a,o={}){mt(this,"eventSource",null);mt(this,"consecutiveFailures",0);mt(this,"failStartTime",null);mt(this,"destroyed",!1);mt(this,"gaveUp",!1);mt(this,"reconnectTimer",null);mt(this,"url");mt(this,"callbacks");mt(this,"onMessage");this.url=r,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 r,a;this.destroyed||(this.consecutiveFailures=0,this.failStartTime=null,this.gaveUp=!1,(a=(r=this.callbacks).onOpen)==null||a.call(r))},this.eventSource.onerror=()=>{var a,o,g,k,T,c,u;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>=cw){this.gaveUp||(this.gaveUp=!0,(g=(o=this.callbacks).onGiveUp)==null||g.call(o),(T=(k=this.callbacks).onClose)==null||T.call(k));return}this.consecutiveFailures++;const r=Math.min(lw,1e3*Math.pow(2,this.consecutiveFailures-1));(u=(c=this.callbacks).onReconnecting)==null||u.call(c,this.consecutiveFailures,r),this.reconnectTimer=setTimeout(()=>this.connect(),r)})}close(){var r;this.destroyed=!0,this.reconnectTimer&&clearTimeout(this.reconnectTimer),(r=this.eventSource)==null||r.close(),this.eventSource=null}}const uw="",x_=["idle","working","compacting","context_warning","waiting_for_input","permission_prompt","plan_mode","ask_question","bash_approval","settings","error","unknown"];function hw(i){if(!i)return{};if(i instanceof Headers){const r={};return i.forEach((a,o)=>{r[o]=a}),r}return i}function fw(i,r,a){const o=r.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 dw(i){return!(i.name==="AbortError"||!i.message||i.message.includes("HTTP "))}async function Ue(i,r={}){const a=localStorage.getItem("aegis_token"),o={"Content-Type":"application/json",...a?{Authorization:`Bearer ${a}`}:{},...hw(r.headers)},{retries:g=0,schema:k,schemaContext:T,...c}=r;let u=null;for(let h=0;h<=g;h++)try{const y=await fetch(`${uw}${i}`,{...c,headers:o});if(!y.ok){const C=await y.json().catch(()=>({error:y.statusText})),E=new Error(C.error??`HTTP ${y.status}`);throw E.statusCode=y.status,E}const d=await y.json();return k?fw(d,k,T??i):d}catch(y){if(u=y,h<g&&dw(u))await new Promise(d=>setTimeout(d,1e3*Math.pow(2,h)));else throw u}throw u}function mw(){return Ue("/v1/health",{schema:W2,schemaContext:"getHealth"})}function _w(){return Ue("/v1/metrics",{schema:sw,schemaContext:"getMetrics"})}function gu(i={}){const r=new URLSearchParams;i.page!==void 0&&r.set("page",String(i.page)),i.limit!==void 0&&r.set("limit",String(i.limit)),i.status&&r.set("status",i.status);const a=r.toString(),o=a?`/v1/sessions?${a}`:"/v1/sessions";return Ue(o,{schema:X2,schemaContext:"getSessions"})}async function pw(){const i={all:0},[r,...a]=await Promise.all([gu({page:1,limit:1}),...x_.map(o=>gu({page:1,limit:1,status:o}))]);return i.all=r.pagination.total,x_.forEach((o,g)=>{var k;i[o]=((k=a[g])==null?void 0:k.pagination.total)??0}),i}function vw(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}`,{schema:Bo,schemaContext:"getSession"})}function C_(i){const{signal:r,...a}=i;return Ue("/v1/sessions",{method:"POST",body:JSON.stringify(a),signal:r,schema:Bo,schemaContext:"createSession"})}function yu(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}`,{method:"DELETE",schema:zu,schemaContext:"killSession"})}function gw(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/health`,{schema:J2,schemaContext:"getSessionHealth"})}function yw(){return Ue("/v1/sessions/health")}function bw(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/read`,{schema:iw,schemaContext:"getSessionMessages"})}function Sw(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/metrics`,{schema:Q2,schemaContext:"getSessionMetrics"})}function xw(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/latency`,{schema:ew,schemaContext:"getSessionLatency"})}function Cw(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/pane`)}function ww(i,r){return Ue(`/v1/sessions/${encodeURIComponent(i)}/send`,{method:"POST",body:JSON.stringify({text:r}),schema:Y2,schemaContext:"sendMessage"})}function qp(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/approve`,{method:"POST"})}function Ew(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/reject`,{method:"POST"})}function bu(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/interrupt`,{method:"POST"})}function kw(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/escape`,{method:"POST"})}function Tw(i,r={}){return Ue(`/v1/sessions/${encodeURIComponent(i)}/fork`,{method:"POST",body:JSON.stringify(r),schema:Bo,schemaContext:"forkSession"})}const w_=3,Aw=1e3;async function Fp(i,r){for(let a=0;a<w_;a++){if(r!=null&&r.aborted)throw new DOMException("Aborted","AbortError");try{return await zw(r)}catch{if(r!=null&&r.aborted)throw new DOMException("Aborted","AbortError");if(a<w_-1){const o=Aw*Math.pow(2,a);await new Promise(g=>{const k=setTimeout(g,o);r==null||r.addEventListener("abort",()=>{clearTimeout(k),g(void 0)},{once:!0})})}}}throw i==null||i(),new Error("Real-time updates unavailable")}function Kp(i,r,a,o){const g=`/v1/sessions/${encodeURIComponent(i)}/events`;let k=null,T=!1;const c=new AbortController;return a?Fp(o==null?void 0:o.onGiveUp,c.signal).then(u=>{if(T)return;const h=`${g}?token=${encodeURIComponent(u.token)}`;k=new To(h,r,o)}).catch(()=>{}):k=new To(g,r,o),()=>{T=!0,c.abort(),k==null||k.close()}}function Rw(i,r,a){const o="/v1/events";let g=null,k=!1;const T=new AbortController,c=u=>{try{const h=ow.safeParse(JSON.parse(u.data));if(!h.success){console.warn("Global SSE event failed validation",h.error.message);return}i(h.data)}catch{}};return r?Fp(a==null?void 0:a.onGiveUp,T.signal).then(u=>{if(k)return;const h=`${o}?token=${encodeURIComponent(u.token)}`;g=new To(h,c,a)}).catch(()=>{}):g=new To(o,c,a),()=>{var u;k=!0,T.abort(),(u=a==null?void 0:a.onClose)==null||u.call(a),g==null||g.close()}}function Dw(i,r){return Ue(`/v1/sessions/${encodeURIComponent(i)}/command`,{method:"POST",body:JSON.stringify({command:r})})}function Ow(i,r){return Ue(`/v1/sessions/${encodeURIComponent(i)}/bash`,{method:"POST",body:JSON.stringify({command:r})})}function Mw(i){return Ue(`/v1/sessions/${encodeURIComponent(i)}/screenshot`,{method:"POST"})}function Lw(i){const{signal:r,...a}=i;return Ue("/v1/sessions/batch",{method:"POST",signal:r,body:JSON.stringify(a)})}function Nw(i){return Ue("/v1/pipelines",{method:"POST",body:JSON.stringify(i)})}function jw(){return Ue("/v1/pipelines")}function Bw(i){return Ue(`/v1/pipelines/${encodeURIComponent(i)}`)}function zw(i){return Ue("/v1/auth/sse-token",{method:"POST",signal:i})}function Hw(i){return Ue("/v1/auth/keys",{method:"POST",body:JSON.stringify({name:i}),schema:G2,schemaContext:"createAuthKey"})}function Uw(){return Ue("/v1/auth/keys",{schema:Vn(V2),schemaContext:"getAuthKeys"})}function Iw(i){return Ue(`/v1/auth/keys/${encodeURIComponent(i)}`,{method:"DELETE",schema:zu,schemaContext:"revokeAuthKey"})}function Pw(i){return Ue("/v1/templates",{method:"POST",body:JSON.stringify(i)})}function $w(){return Ue("/v1/templates")}const po=new Map;let Zw=0;const Si=dp(i=>({toasts:[],addToast:(r,a,o)=>{const g=`toast-${++Zw}`,k=setTimeout(()=>{po.delete(g),i(T=>({toasts:T.toasts.filter(c=>c.id!==g)}))},4e3);return po.set(g,k),i(T=>({toasts:[...T.toasts,{id:g,type:r,title:a,description:o}]})),g},removeToast:r=>{const a=po.get(r);a&&(clearTimeout(a),po.delete(r)),i(o=>({toasts:o.toasts.filter(g=>g.id!==r)}))}})),qw={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 Fw({id:i,type:r,title:a,description:o}){const g=Si(k=>k.removeToast);return b.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 ${qw[r]}`,children:[b.jsxs("div",{className:"flex-1 min-w-0",children:[b.jsx("p",{className:"text-sm font-medium",children:a}),o&&b.jsx("p",{className:"mt-0.5 text-xs opacity-80",children:o})]}),b.jsx("button",{onClick:()=>g(i),className:"shrink-0 rounded p-0.5 opacity-60 hover:opacity-100 transition-opacity","aria-label":"Dismiss",children:b.jsx(Kn,{className:"h-3.5 w-3.5"})})]})}function Kw(){const i=Si(r=>r.toasts);return i.length===0?null:b.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(r=>b.jsx("div",{className:"pointer-events-auto",children:b.jsx(Fw,{id:r.id,type:r.type,title:r.title,description:r.description})},r.id))})}const Vw=[{to:"/",label:"Overview",icon:Nb},{to:"/pipelines",label:"Pipelines",icon:op},{to:"/auth/keys",label:"Auth Keys",icon:mu}],Gw=5,Yw=1e3;function Ww(){const i=et(h=>h.sseConnected),r=et(h=>h.setSseConnected),a=et(h=>h.sseError),o=et(h=>h.setSseError),g=et(h=>h.addActivity),k=et(h=>h.token),T=P.useRef(null),[c,u]=P.useState(0);return P.useEffect(()=>{let h=!1,y,d=null;function C(E){if(!h)try{y=Rw(O=>{O.sessionId&&g(O)},k,{onOpen:()=>{T.current&&(clearTimeout(T.current),T.current=null),r(!0),o(null),u(0)},onClose:()=>{T.current=setTimeout(()=>{r(!1)},2e3)},onGiveUp:()=>{o("SSE connection failed — real-time updates unavailable"),r(!1)}})}catch(O){if(console.error("Failed to subscribe to global SSE (attempt %d):",E+1,O),E<Gw){const x=Yw*Math.pow(2,E);u(E+1),d=setTimeout(()=>C(E+1),x)}else o("SSE subscription failed after retries — real-time updates unavailable"),r(!1)}}return C(0),()=>{h=!0,T.current&&clearTimeout(T.current),d&&clearTimeout(d),y==null||y()}},[r,o,g,k]),b.jsxs("div",{className:"flex h-screen overflow-hidden bg-void",children:[b.jsxs("aside",{className:"flex w-56 flex-col border-r border-void-lighter bg-void-light shrink-0",children:[b.jsxs("div",{className:"flex items-center gap-2 px-4 py-5 border-b border-void-lighter",children:[b.jsx(Xb,{className:"h-6 w-6 text-blue-500"}),b.jsx("span",{className:"text-lg font-semibold tracking-tight text-gray-100",children:"Aegis"})]}),b.jsxs("nav",{className:"flex flex-col gap-1 px-2 py-4 flex-1",children:[Vw.map(({to:h,label:y,icon:d})=>b.jsxs(rp,{to:h,end:h==="/",className:({isActive:C})=>`flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm font-medium transition-colors ${C?"bg-cyan/10 text-cyan":"text-gray-400 hover:bg-void-lighter hover:text-gray-200"}`,children:[b.jsx(d,{className:"h-4 w-4"}),y]},h)),b.jsx("div",{className:"mt-4 border-t border-void-lighter pt-4 opacity-40",children:b.jsxs("button",{type:"button",disabled:!0,"aria-disabled":"true",title:"Sessions navigation is not available yet",className:"flex w-full items-center gap-2.5 rounded-lg px-3 py-2 text-left text-sm text-gray-500",children:[b.jsx(t1,{className:"h-4 w-4"}),"Sessions"]})})]})]}),b.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[b.jsxs("header",{className:"flex items-center justify-between border-b border-void-lighter bg-void-light px-6 py-3 shrink-0",children:[b.jsx("h1",{className:"text-sm font-medium text-gray-300",children:"Aegis Dashboard"}),b.jsx("div",{className:"flex items-center gap-3",children:b.jsx("div",{className:"flex items-center gap-1.5 text-xs text-gray-500",title:a??void 0,children:a?b.jsxs(b.Fragment,{children:[b.jsx(fp,{className:"h-3 w-3 text-amber-500"}),b.jsxs("span",{className:"text-amber-500",children:["SSE Error",c>0?` (retry ${c})`:""]})]}):b.jsxs(b.Fragment,{children:[b.jsx("span",{className:`status-dot ${i?"status-dot--idle":""}`,style:i?void 0:{backgroundColor:"#666"}}),i?"SSE Live":"SSE Off"]})})})]}),b.jsx("main",{className:"flex-1 overflow-auto p-6",children:b.jsx(wy,{})})]}),b.jsx(Kw,{})]})}function Xw(i){if(i<0)return"0s";const r=Math.floor(i/3600),a=Math.floor(i%3600/60);return r>0&&a>0?`${r}h ${a}m`:r>0?`${r}h`:a>0?`${a}m`:`${Math.floor(i)}s`}function Zs(i){const r=Date.now()-i;if(r<0)return"just now";const a=Math.floor(r/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 Jw(i){if(i<0)return"0s";const r=Math.floor(i/1e3);if(r<60)return`${r}s`;const a=Math.floor(r/60),o=r%60;if(a<60)return`${a}m ${o.toString().padStart(2,"0")}s`;const g=Math.floor(a/60),k=a%60;return`${g}h ${k.toString().padStart(2,"0")}m`}const Qw=15e3,eE=6e4;function tE(i){return new Date(i).toLocaleString()}function iE(i){return i.length<=12?"•".repeat(i.length):`${i.slice(0,8)}${"•".repeat(Math.max(8,i.length-12))}${i.slice(-4)}`}function sE(){const[i,r]=P.useState([]),[a,o]=P.useState(!0),[g,k]=P.useState(null),[T,c]=P.useState(""),[u,h]=P.useState(!1),[y,d]=P.useState(!1),[C,E]=P.useState(null),[O,x]=P.useState(null),[m,p]=P.useState(!1),f=Si(M=>M.addToast),v=P.useCallback(async(M=!1)=>{M?d(!0):o(!0);try{const w=await Uw();r(w.slice().sort((N,I)=>I.createdAt-N.createdAt)),k(null)}catch(w){const N=w instanceof Error?w.message:"Failed to load auth keys";k(N),f("error","Failed to load auth keys",N)}finally{M?d(!1):o(!1)}},[f]);P.useEffect(()=>{v();const M=setInterval(()=>{v(!0)},Qw);return()=>clearInterval(M)},[v]),P.useEffect(()=>{if(!O)return;const M=setTimeout(()=>{x(null),p(!1)},eE);return()=>clearTimeout(M)},[O]);async function S(M){M.preventDefault();const w=T.trim();if(w){h(!0);try{const N=await Hw(w);x(N),p(!1),c(""),f("success","Auth key created","Store the secret now. It is only shown once."),await v(!0)}catch(N){f("error","Failed to create auth key",N instanceof Error?N.message:void 0)}finally{h(!1)}}}async function R(){var M;if(O)try{if(!((M=navigator.clipboard)!=null&&M.writeText))throw new Error("Clipboard access is unavailable in this browser");await navigator.clipboard.writeText(O.key),f("success","Auth key copied")}catch(w){f("warning","Failed to copy auth key",w instanceof Error?w.message:void 0)}}async function A(M,w){if(window.confirm(`Revoke auth key "${w}"? This cannot be undone.`)){E(M);try{await Iw(M),r(N=>N.filter(I=>I.id!==M)),(O==null?void 0:O.id)===M&&(x(null),p(!1)),f("success","Auth key revoked")}catch(N){f("error","Failed to revoke auth key",N instanceof Error?N.message:void 0)}finally{E(null)}}}return b.jsxs("div",{className:"flex flex-col gap-6",children:[b.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[b.jsxs("div",{children:[b.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"Auth Keys"}),b.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Create, review, and revoke dashboard API keys without exposing stored secrets."})]}),b.jsxs("button",{type:"button",onClick:()=>void v(!0),disabled:y,className:"flex min-h-[44px] items-center justify-center gap-2 rounded border border-[#1a1a2e] bg-[#111118] px-3 py-2 text-xs font-medium text-gray-300 transition-colors hover:border-[#00e5ff]/30 hover:text-[#00e5ff] disabled:cursor-not-allowed disabled:opacity-60",children:[b.jsx(hp,{className:`h-3.5 w-3.5 ${y?"animate-spin":""}`}),"Refresh"]})]}),b.jsxs("div",{className:"grid gap-6 xl:grid-cols-[minmax(0,360px)_minmax(0,1fr)]",children:[b.jsxs("section",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-5",children:[b.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-gray-100",children:[b.jsx(Fn,{className:"h-4 w-4 text-[#00e5ff]"}),"Create Key"]}),b.jsx("p",{className:"mt-2 text-sm text-gray-500",children:"New secrets are never persisted in the dashboard and are cleared from view after one minute."}),b.jsxs("form",{className:"mt-4 space-y-4",onSubmit:S,children:[b.jsxs("div",{children:[b.jsx("label",{className:"mb-1.5 block text-xs font-medium text-gray-400",htmlFor:"auth-key-name",children:"Key Name"}),b.jsx("input",{id:"auth-key-name",type:"text",value:T,onChange:M=>c(M.target.value),placeholder:"ops-primary",className:"min-h-[44px] w-full rounded border border-[#1a1a2e] bg-[#0a0a0f] px-3 py-2.5 text-sm text-gray-200 placeholder-gray-600 focus:border-[#00e5ff] focus:outline-none"})]}),b.jsxs("button",{type:"submit",disabled:u||!T.trim(),className:"flex min-h-[44px] w-full items-center justify-center gap-2 rounded border border-[#00e5ff]/30 bg-[#00e5ff]/10 px-3 py-2 text-sm font-medium text-[#00e5ff] transition-colors hover:bg-[#00e5ff]/20 disabled:cursor-not-allowed disabled:opacity-60",children:[b.jsx(mu,{className:"h-4 w-4"}),u?"Creating…":"Create Auth Key"]})]}),O?b.jsxs("div",{className:"mt-5 rounded-lg border border-emerald-500/20 bg-emerald-500/5 p-4",role:"status",children:[b.jsxs("div",{className:"flex items-start justify-between gap-3",children:[b.jsxs("div",{children:[b.jsx("h3",{className:"text-sm font-semibold text-emerald-300",children:"Store this key now"}),b.jsx("p",{className:"mt-1 text-xs text-emerald-200/80",children:"This secret is shown once and is hidden by default."})]}),b.jsx("button",{type:"button",onClick:()=>{x(null),p(!1)},className:"text-xs font-medium text-emerald-200/80 transition-colors hover:text-emerald-200",children:"Dismiss"})]}),b.jsxs("dl",{className:"mt-4 space-y-3 text-sm text-gray-200",children:[b.jsxs("div",{children:[b.jsx("dt",{className:"text-xs uppercase tracking-wide text-gray-500",children:"Name"}),b.jsx("dd",{className:"mt-1 font-medium text-gray-100",children:O.name})]}),b.jsxs("div",{children:[b.jsx("dt",{className:"text-xs uppercase tracking-wide text-gray-500",children:"Secret"}),b.jsx("dd",{className:"mt-1 rounded border border-[#1a1a2e] bg-[#0a0a0f] px-3 py-2 font-mono text-xs text-[#9af5ff]",children:m?O.key:iE(O.key)})]})]}),b.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[b.jsxs("button",{type:"button",onClick:()=>p(M=>!M),className:"flex min-h-[40px] items-center gap-2 rounded border border-[#1a1a2e] bg-[#0a0a0f] px-3 py-2 text-xs font-medium text-gray-300 transition-colors hover:border-[#00e5ff]/30 hover:text-[#00e5ff]",children:[m?b.jsx(Tb,{className:"h-3.5 w-3.5"}):b.jsx(Rb,{className:"h-3.5 w-3.5"}),m?"Hide secret":"Reveal secret"]}),b.jsxs("button",{type:"button",onClick:()=>void R(),className:"flex min-h-[40px] items-center gap-2 rounded border border-[#1a1a2e] bg-[#0a0a0f] px-3 py-2 text-xs font-medium text-gray-300 transition-colors hover:border-[#00e5ff]/30 hover:text-[#00e5ff]",children:[b.jsx(Cb,{className:"h-3.5 w-3.5"}),"Copy secret"]})]})]}):null]}),b.jsxs("section",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-5",children:[b.jsx("div",{className:"flex items-center justify-between gap-3 border-b border-[#1a1a2e] pb-4",children:b.jsxs("div",{children:[b.jsx("h3",{className:"text-sm font-semibold text-gray-100",children:"Existing Keys"}),b.jsxs("p",{className:"mt-1 text-xs text-gray-500",children:[i.length," key",i.length===1?"":"s"," configured"]})]})}),a?b.jsx("div",{className:"flex min-h-[240px] items-center justify-center text-sm text-gray-500",children:b.jsx("div",{className:"animate-pulse",children:"Loading auth keys…"})}):g?b.jsxs("div",{className:"mt-4 rounded-lg border border-amber-500/20 bg-amber-500/5 p-4 text-sm text-amber-200",children:[b.jsx("p",{className:"font-medium",children:"Unable to load auth keys"}),b.jsx("p",{className:"mt-1 text-amber-200/80",children:g}),b.jsx("button",{type:"button",onClick:()=>void v(),className:"mt-4 rounded border border-amber-500/30 px-3 py-2 text-xs font-medium text-amber-200 transition-colors hover:bg-amber-500/10",children:"Retry"})]}):i.length===0?b.jsxs("div",{className:"flex min-h-[240px] flex-col items-center justify-center rounded-lg border border-dashed border-[#1a1a2e] bg-[#0a0a0f] px-6 text-center",children:[b.jsx(mu,{className:"h-8 w-8 text-gray-600"}),b.jsx("p",{className:"mt-4 text-sm font-medium text-gray-300",children:"No auth keys yet"}),b.jsx("p",{className:"mt-1 max-w-md text-sm text-gray-500",children:"Create a key to grant API access without sharing the dashboard bearer token."})]}):b.jsx("div",{className:"mt-4 space-y-3",children:i.map(M=>b.jsx("article",{className:"rounded-lg border border-[#1a1a2e] bg-[#0a0a0f] p-4",children:b.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[b.jsxs("div",{className:"min-w-0",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx("span",{className:"truncate font-medium text-gray-100",children:M.name}),b.jsx("span",{className:"rounded-full border border-[#1a1a2e] bg-[#111118] px-2 py-0.5 font-mono text-[11px] text-gray-500",children:M.id})]}),b.jsxs("p",{className:"mt-2 text-sm text-gray-400",children:["Created ",b.jsx("span",{title:tE(M.createdAt),children:Zs(M.createdAt)})]})]}),b.jsxs("button",{type:"button",onClick:()=>void A(M.id,M.name),disabled:C===M.id,className:"flex min-h-[40px] items-center justify-center gap-2 rounded border border-red-500/20 bg-red-500/5 px-3 py-2 text-xs font-medium text-red-300 transition-colors hover:bg-red-500/10 disabled:cursor-not-allowed disabled:opacity-60",children:[b.jsx(Au,{className:"h-3.5 w-3.5"}),C===M.id?"Revoking…":"Revoke"]})]})},M.id))})]})]})]})}function hi({label:i,value:r,icon:a,suffix:o}){return b.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-4",children:[b.jsxs("div",{className:"mb-2 flex items-center gap-2 text-sm text-[#888]",children:[a,i]}),b.jsxs("div",{className:"font-mono text-2xl text-[#3b82f6]",children:[r,o&&b.jsx("span",{className:"ml-1 text-base text-[#666]",children:o})]})]})}function rE(){var O,x,m;const i=et(p=>p.metrics),r=et(p=>p.sseConnected),a=et(p=>p.setMetrics),[o,g]=P.useState(null),k=P.useCallback(async()=>{try{const[p,f]=await Promise.all([_w(),mw()]);a(p),g(f)}catch(p){Si.getState().addToast("error","Failed to load metrics",p instanceof Error?p.message:void 0)}},[a]);P.useEffect(()=>{if(k(),r)return;const p=setInterval(k,1e4);return()=>clearInterval(p)},[k,r]);const T=(i==null?void 0:i.sessions.currently_active)??(o==null?void 0:o.sessions.active)??0,c=(i==null?void 0:i.sessions.total_created)??(o==null?void 0:o.sessions.total)??0,u=i==null?void 0:i.prompt_delivery.success_rate,h=(o==null?void 0:o.uptime)??(i==null?void 0:i.uptime)??0,y=((O=i==null?void 0:i.latency)==null?void 0:O.hook_latency_ms.avg)??null,d=((x=i==null?void 0:i.latency)==null?void 0:x.permission_response_ms.avg)??null,C=((m=i==null?void 0:i.latency)==null?void 0:m.channel_delivery_ms.avg)??null,E=p=>p===null?"—":`${Math.round(p)} ms`;return b.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-3 xl:grid-cols-4",children:[b.jsx(hi,{label:"Active Sessions",value:T,icon:b.jsx(op,{className:"h-4 w-4"})}),b.jsx(hi,{label:"Total Created",value:c,icon:b.jsx(Mb,{className:"h-4 w-4"})}),b.jsx(hi,{label:"Delivery Rate",value:u!=null?u.toFixed(1):"—",suffix:"%",icon:b.jsx(u1,{className:"h-4 w-4"})}),b.jsx(hi,{label:"Avg Hook Latency",value:E(y),icon:b.jsx(ho,{className:"h-4 w-4"})}),b.jsx(hi,{label:"Avg Permission Latency",value:E(d),icon:b.jsx(ho,{className:"h-4 w-4"})}),b.jsx(hi,{label:"Avg Channel Latency",value:E(C),icon:b.jsx(ho,{className:"h-4 w-4"})}),b.jsx(hi,{label:"Uptime",value:Xw(h),icon:b.jsx(ho,{className:"h-4 w-4"})})]})}const E_={idle:"#10b981",working:"#3b82f6",permission_prompt:"#f59e0b",bash_approval:"#f59e0b",plan_mode:"#ff8800",ask_question:"#ef4444",settings:"#3b82f6",error:"#ff0000",compacting:"#f59e0b",context_warning:"#f59e0b",waiting_for_input:"#f59e0b",unknown:"#666666"},nE=new Set(["working","permission_prompt","bash_approval","ask_question"]),k_={idle:"Idle",working:"Working",permission_prompt:"Permission prompt",bash_approval:"Bash approval",plan_mode:"Plan mode",ask_question:"Awaiting question",settings:"Settings",error:"Error",compacting:"Compacting",context_warning:"Context warning",waiting_for_input:"Waiting for input",unknown:"Unknown"};function zo({status:i}){const r=E_[i]??E_.unknown,a=nE.has(i),o=k_[i]??k_.unknown;return b.jsx("span",{role:"img","aria-label":`Status: ${o}`,title:o,style:{display:"inline-block",width:8,height:8,borderRadius:"50%",backgroundColor:r,boxShadow:`0 0 6px ${r}66`,animation:a?"pulse 1.5s ease-in-out infinite":void 0}})}const aE=5e3,T_=20,A_=100,oE={all:0,idle:0,working:0,compacting:0,context_warning:0,waiting_for_input:0,permission_prompt:0,plan_mode:0,ask_question:0,bash_approval:0,settings:0,error:0,unknown:0},R_=["all","idle","working","compacting","context_warning","waiting_for_input","permission_prompt","plan_mode","ask_question","bash_approval","settings","error","unknown"],Vp=i=>i.status==="permission_prompt"||i.status==="bash_approval",Gp=(i,r=40)=>i.length>r?`…${i.slice(i.length-r+1)}`:i;function D_(i){return i==="all"?"All":i.split("_").map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")}function lE(i,r){return r?`${i.windowName} ${i.id} ${i.workDir}`.toLowerCase().includes(r):!0}function cE(i,r){return i.id===r.id&&i.windowName===r.windowName&&i.workDir===r.workDir&&i.status===r.status&&i.createdAt===r.createdAt&&i.lastActivity===r.lastActivity&&i.permissionMode===r.permissionMode}function Yp(i,r){return cE(i.session,r.session)&&i.isAlive===r.isAlive&&i.selected===r.selected&&i.currentAction===r.currentAction}const uE=P.memo(function({session:r,isAlive:a,selected:o,currentAction:g,onToggleSelect:k,onApprove:T,onInterrupt:c,onKill:u}){return b.jsxs("div",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-4 transition-colors active:bg-[#1a1a2e]/50",children:[b.jsxs("div",{className:"mb-2 flex items-start justify-between gap-3",children:[b.jsxs("label",{className:"flex min-w-0 flex-1 items-center gap-3 text-sm text-gray-200",children:[b.jsx("input",{type:"checkbox","aria-label":`Select session ${r.windowName||r.id}`,checked:o,onChange:h=>k(r.id,h.target.checked),className:"h-4 w-4 rounded border border-void-lighter bg-void text-cyan focus:ring-1 focus:ring-cyan"}),b.jsxs("div",{className:"min-w-0",children:[b.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[b.jsx(zo,{status:r.status}),b.jsx(fi,{to:`/sessions/${encodeURIComponent(r.id)}`,className:"truncate font-medium text-gray-200 transition-colors hover:text-cyan",children:r.windowName||r.id}),!a&&b.jsx(So,{className:"h-3.5 w-3.5 shrink-0 text-red-400"})]}),b.jsx("div",{className:"mt-1 truncate font-mono text-xs text-gray-500",children:Gp(r.workDir,50)})]})]}),b.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[Vp(r)&&b.jsx("button",{onClick:h=>T(h,r.id),disabled:g==="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:b.jsx(up,{className:"h-4 w-4"})}),b.jsx("button",{onClick:h=>c(h,r.id),disabled:g==="interrupt"||g==="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:b.jsx(lp,{className:"h-4 w-4"})}),b.jsx("button",{onClick:h=>u(h,r.id),disabled:g==="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:b.jsx(So,{className:"h-4 w-4"})})]})]}),b.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs text-gray-500",children:[b.jsxs("span",{children:["Age: ",Zs(r.createdAt)]}),b.jsxs("span",{children:["Active: ",Zs(r.lastActivity)]}),r.permissionMode&&r.permissionMode!=="default"?b.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-green-900/30 px-2 py-0.5 text-green-400",children:[b.jsx(cp,{className:"h-3 w-3"})," ",r.permissionMode]}):b.jsx("span",{className:"inline-flex items-center gap-1 rounded-full bg-void-lighter px-2 py-0.5 text-gray-500",children:"default"})]})]})},Yp),hE=P.memo(function({session:r,isAlive:a,selected:o,currentAction:g,onToggleSelect:k,onApprove:T,onInterrupt:c,onKill:u}){return b.jsxs("tr",{className:"border-b border-void-lighter/50 transition-colors hover:border-l-2 hover:border-l-cyan",children:[b.jsx("td",{className:"px-4 py-3",children:b.jsx("input",{type:"checkbox","aria-label":`Select session ${r.windowName||r.id}`,checked:o,onChange:h=>k(r.id,h.target.checked),className:"h-4 w-4 rounded border border-void-lighter bg-void text-cyan focus:ring-1 focus:ring-cyan"})}),b.jsx("td",{className:"px-4 py-3",children:b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx(zo,{status:r.status}),!a&&b.jsx(So,{className:"h-3.5 w-3.5 text-red-400"})]})}),b.jsx("td",{className:"px-4 py-3",children:b.jsx(fi,{to:`/sessions/${encodeURIComponent(r.id)}`,className:"font-medium text-gray-200 transition-colors hover:text-cyan",children:r.windowName||r.id})}),b.jsx("td",{className:"max-w-[200px] truncate px-4 py-3 font-mono text-xs text-gray-400",title:r.workDir,children:Gp(r.workDir)}),b.jsx("td",{className:"whitespace-nowrap px-4 py-3 text-gray-400",children:Zs(r.createdAt)}),b.jsx("td",{className:"whitespace-nowrap px-4 py-3 text-gray-400",children:Zs(r.lastActivity)}),b.jsx("td",{className:"px-4 py-3",children:r.permissionMode&&r.permissionMode!=="default"?b.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:[b.jsx(cp,{className:"h-3 w-3"}),r.permissionMode]}):b.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"})}),b.jsx("td",{className:"px-4 py-3",children:b.jsxs("div",{className:"flex items-center gap-1.5",children:[Vp(r)&&b.jsx("button",{onClick:h=>T(h,r.id),disabled:g==="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:b.jsx(up,{className:"h-3 w-3"})}),b.jsx("button",{onClick:h=>c(h,r.id),disabled:g==="interrupt"||g==="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:b.jsx(lp,{className:"h-3 w-3"})}),b.jsx("button",{onClick:h=>u(h,r.id),disabled:g==="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:b.jsx(So,{className:"h-3 w-3"})})]})})]})},Yp);function fE(){const i=et(B=>B.sessions),r=et(B=>B.healthMap),a=et(B=>B.sseConnected),o=et(B=>B.setSessionsAndHealth),g=Si(B=>B.addToast),[k,T]=P.useState({}),[c,u]=P.useState([]),[h,y]=P.useState(null),[d,C]=P.useState("all"),[E,O]=P.useState(oE),[x,m]=P.useState(""),p=P.useDeferredValue(x.trim().toLowerCase()),[f,v]=P.useState({page:1,limit:T_,total:0,totalPages:0}),[S,R]=P.useState(1),[A,M]=P.useState(!0),[w,N]=P.useState(!1),I=P.useCallback(async()=>{M(!0);try{const B=p.length>0,$=gu({page:B?1:S,limit:B?A_:T_,status:d==="all"?void 0:d}),[Y,re]=await Promise.all([$,pw()]),he=B?Y.sessions.filter(H=>lE(H,p)):Y.sessions;let V={};try{const H=await yw(),ce=new Set(he.map(oe=>oe.id));for(const[oe,me]of Object.entries(H))ce.has(oe)&&(V[oe]={alive:me.alive,loading:!1})}catch{}o(he,V),O(re),N(B&&Y.pagination.total>Y.sessions.length),v(B?{page:1,limit:he.length,total:he.length,totalPages:he.length>0?1:0}:Y.pagination)}catch(B){g("error","Failed to fetch sessions",B instanceof Error?B.message:void 0)}finally{M(!1)}},[g,p,S,o,d]);P.useEffect(()=>{if(I(),a)return;const B=setInterval(I,aE);return()=>clearInterval(B)},[I,a]),P.useEffect(()=>{const B=new Set(i.map($=>$.id));u($=>$.filter(Y=>B.has(Y)))},[i]);const q=P.useCallback(async(B,$,Y)=>{T(re=>({...re,[B]:$}));try{await Y()}finally{T(re=>({...re,[B]:null}))}},[]),K=P.useCallback(async(B,$)=>{B.preventDefault(),await q($,"approve",async()=>{try{await qp($),await I()}catch(Y){g("error","Approve failed",Y instanceof Error?Y.message:void 0)}})},[g,I,q]),Z=P.useCallback(async(B,$)=>{B.preventDefault(),await q($,"interrupt",async()=>{try{await bu($),await I()}catch(Y){g("error","Interrupt failed",Y instanceof Error?Y.message:void 0)}})},[g,I,q]),J=P.useCallback(async(B,$)=>{B.preventDefault(),confirm("Kill this session?")&&await q($,"kill",async()=>{try{await yu($),await I()}catch(Y){g("error","Failed to kill session",Y instanceof Error?Y.message:void 0)}})},[g,I,q]),ee=P.useCallback((B,$)=>{u(Y=>$?Y.includes(B)?Y:[...Y,B]:Y.filter(re=>re!==B))},[]),F=P.useCallback(B=>{if(!B){u([]);return}u(i.map($=>$.id))},[i]),Q=P.useCallback(async B=>{if(c.length!==0&&!(B==="kill"&&!confirm(`Kill ${c.length} selected session${c.length===1?"":"s"}?`))){y(B),T($=>{const Y={...$};for(const re of c)Y[re]=B;return Y});try{const $=await Promise.allSettled(c.map(he=>B==="interrupt"?bu(he):yu(he))),Y=$.filter(he=>he.status==="fulfilled").length,re=$.length-Y;Y>0&&g("success",B==="interrupt"?"Bulk interrupt complete":"Bulk kill complete",`${Y} session${Y===1?"":"s"} updated.`),re>0&&g("warning",`Some sessions failed to ${B}`,`${re} session${re===1?"":"s"} could not be updated.`),u([]),await I()}finally{y(null),T($=>{const Y={...$};for(const re of c)Y[re]=null;return Y})}}},[g,I,c]),ne=P.useMemo(()=>new Set(c),[c]),j=P.useMemo(()=>i.map(B=>{const $=r[B.id];return{session:B,isAlive:$?$.alive:!0,selected:ne.has(B.id),currentAction:k[B.id]??null}}),[k,r,ne,i]),U=i.length>0&&i.every(B=>ne.has(B.id)),L=d!=="all"||p.length>0;return A&&i.length===0?b.jsx("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-12 text-center",children:b.jsx("p",{className:"text-gray-500",children:"Loading sessions..."})}):b.jsxs("div",{className:"space-y-4",children:[b.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-4",children:[b.jsxs("div",{className:"flex flex-col gap-4 xl:flex-row xl:items-start xl:justify-between",children:[b.jsxs("div",{className:"flex-1 space-y-3",children:[b.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-center",children:[b.jsxs("label",{className:"flex min-w-0 flex-1 items-center gap-2 rounded-md border border-void-lighter bg-void px-3 py-2 text-sm text-gray-300 focus-within:border-cyan",children:[b.jsx(Kb,{className:"h-4 w-4 text-gray-500"}),b.jsx("input",{value:x,onChange:B=>{m(B.target.value),R(1)},placeholder:"Search by session name or work directory",className:"w-full bg-transparent text-sm text-gray-100 outline-none placeholder:text-gray-500","aria-label":"Search sessions"})]}),b.jsxs("label",{className:"flex items-center gap-2 text-sm text-gray-400",children:[b.jsx("span",{children:"Status"}),b.jsx("select",{value:d,onChange:B=>{C(B.target.value),R(1)},"aria-label":"Filter by status",className:"rounded-md border border-void-lighter bg-void px-3 py-2 text-sm text-gray-100 outline-none focus:border-cyan",children:R_.map(B=>b.jsxs("option",{value:B,children:[D_(B)," (",E[B]??0,")"]},B))})]})]}),b.jsx("div",{className:"flex flex-wrap gap-2",children:R_.filter(B=>B==="all"||(E[B]??0)>0).map(B=>{const $=d===B;return b.jsxs("button",{type:"button",onClick:()=>{C(B),R(1)},className:`rounded-full border px-3 py-1 text-xs transition-colors ${$?"border-cyan bg-cyan/10 text-cyan":"border-void-lighter bg-void text-gray-400 hover:border-cyan/40 hover:text-gray-200"}`,children:[D_(B)," ",b.jsx("span",{className:"text-gray-500",children:E[B]??0})]},B)})})]}),b.jsxs("div",{className:"text-right text-xs text-gray-500",children:[b.jsxs("div",{children:["Showing ",b.jsx("span",{className:"text-gray-300",children:i.length}),p.length>0?` matching session${i.length===1?"":"s"}`:` of ${f.total} session${f.total===1?"":"s"}`]}),w&&b.jsxs("div",{className:"mt-1 text-amber-400",children:["Search scans the first ",A_," sessions in the selected status."]})]})]}),c.length>0&&b.jsxs("div",{className:"mt-4 flex flex-col gap-3 rounded-md border border-cyan/20 bg-cyan/5 p-3 lg:flex-row lg:items-center lg:justify-between",children:[b.jsxs("div",{className:"text-sm text-gray-300",children:[c.length," session",c.length===1?"":"s"," selected"]}),b.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[b.jsx("button",{type:"button",onClick:()=>Q("interrupt"),disabled:h!==null,className:"rounded-md bg-yellow-900/30 px-3 py-2 text-sm font-medium text-yellow-300 transition-colors hover:bg-yellow-900/50 disabled:pointer-events-none disabled:opacity-40",children:"Interrupt Selected"}),b.jsx("button",{type:"button",onClick:()=>Q("kill"),disabled:h!==null,className:"rounded-md bg-red-900/30 px-3 py-2 text-sm font-medium text-red-300 transition-colors hover:bg-red-900/50 disabled:pointer-events-none disabled:opacity-40",children:"Kill Selected"}),b.jsx("button",{type:"button",onClick:()=>u([]),disabled:h!==null,className:"rounded-md border border-void-lighter px-3 py-2 text-sm text-gray-400 transition-colors hover:border-gray-500 hover:text-gray-200 disabled:pointer-events-none disabled:opacity-40",children:"Clear"})]})]})]}),i.length===0?b.jsx("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-12 text-center",children:b.jsx("p",{className:"text-gray-400",children:L?"No sessions match the current filter.":"No active sessions"})}):b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"space-y-3 md:hidden",children:[b.jsxs("div",{className:"flex items-center justify-between rounded-md border border-void-lighter bg-[#111118] px-4 py-3 text-sm text-gray-400",children:[b.jsxs("label",{className:"flex items-center gap-2",children:[b.jsx("input",{type:"checkbox","aria-label":"Select all visible sessions",checked:U,onChange:B=>F(B.target.checked),className:"h-4 w-4 rounded border border-void-lighter bg-void text-cyan focus:ring-1 focus:ring-cyan"}),"Select visible"]}),b.jsxs("span",{children:[i.length," visible"]})]}),j.map(B=>b.jsx(uE,{session:B.session,isAlive:B.isAlive,selected:B.selected,currentAction:B.currentAction,onToggleSelect:ee,onApprove:K,onInterrupt:Z,onKill:J},B.session.id))]}),b.jsx("div",{className:"hidden overflow-x-auto rounded-lg border border-void-lighter bg-[#111118] md:block",children:b.jsxs("table",{className:"w-full text-left text-sm",children:[b.jsx("thead",{children:b.jsxs("tr",{className:"border-b border-void-lighter text-[#666]",children:[b.jsx("th",{className:"px-4 py-3 font-medium",children:b.jsx("input",{type:"checkbox","aria-label":"Select all visible sessions",checked:U,onChange:B=>F(B.target.checked),className:"h-4 w-4 rounded border border-void-lighter bg-void text-cyan focus:ring-1 focus:ring-cyan"})}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"Status"}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"Name"}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"WorkDir"}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"Age"}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"Last Activity"}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"Permission"}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"Actions"})]})}),b.jsx("tbody",{children:j.map(B=>b.jsx(hE,{session:B.session,isAlive:B.isAlive,selected:B.selected,currentAction:B.currentAction,onToggleSelect:ee,onApprove:K,onInterrupt:Z,onKill:J},B.session.id))})]})}),p.length===0&&f.totalPages>1&&b.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-void-lighter bg-[#111118] px-4 py-3 text-sm text-gray-400",children:[b.jsxs("span",{children:["Page ",f.page," of ",f.totalPages]}),b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsxs("button",{type:"button",onClick:()=>R(B=>Math.max(1,B-1)),disabled:f.page<=1,className:"flex items-center gap-1 rounded-md border border-void-lighter px-3 py-2 transition-colors hover:border-gray-500 hover:text-gray-200 disabled:pointer-events-none disabled:opacity-40",children:[b.jsx(mb,{className:"h-4 w-4"})," Previous"]}),b.jsxs("button",{type:"button",onClick:()=>R(B=>Math.min(f.totalPages,B+1)),disabled:f.page>=f.totalPages,className:"flex items-center gap-1 rounded-md border border-void-lighter px-3 py-2 transition-colors hover:border-gray-500 hover:text-gray-200 disabled:pointer-events-none disabled:opacity-40",children:["Next ",b.jsx(pb,{className:"h-4 w-4"})]})]})]})]})]})}const ou={session_status_change:{icon:hp,label:"Status",color:"#3b82f6"},session_message:{icon:zb,label:"Message",color:"#10b981"},session_approval:{icon:Jm,label:"Approval",color:"#f59e0b"},session_ended:{icon:Zb,label:"Ended",color:"#ef4444"},session_created:{icon:yb,label:"Created",color:"#6366f1"},session_stall:{icon:fp,label:"Stall",color:"#d97706"},session_dead:{icon:Qb,label:"Dead",color:"#dc2626"},session_subagent_start:{icon:o1,label:"Subagent",color:"#3b82f6"},session_subagent_stop:{icon:n1,label:"Subagent Done",color:"#10b981"},session_verification:{icon:Jm,label:"Verification",color:"#0891b2"}};function ms(i,r="unknown"){return typeof i=="string"?i:r}function dE(i){const r=i.data;switch(i.event){case"session_status_change":{const a=ms(r.status),o=typeof r.detail=="string"?`: ${r.detail}`:"";return`Status -> ${a}${o}`}case"session_message":{const a=r.role==="user"?"User":r.role==="assistant"?"Claude":"System",o=typeof r.text=="string"?r.text:JSON.stringify(r.text??"");return`${a}: ${O_(o,80)}`}case"session_approval":{const a=typeof r.prompt=="string"?r.prompt:JSON.stringify(r.prompt??"");return`Approval needed: ${O_(a,80)}`}case"session_ended":return`Session ended: ${ms(r.reason)}`;case"session_created":return`Created in ${ms(r.workDir,"unknown dir")}`;case"session_stall":return`Session stalled: ${ms(r.stallType)}`;case"session_dead":return`Session dead: ${ms(r.stallType)}`;case"session_subagent_start":return`Subagent started: ${ms(r.name)}`;case"session_subagent_stop":return`Subagent finished: ${ms(r.name)}`;case"session_verification":return`Verification: ${ms(r.summary??r.status,"completed")}`;default:return JSON.stringify(r)}}function O_(i,r){return i.length>r?i.slice(0,r)+"...":i}function mE(i){try{return new Date(i).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return""}}function _E(){const i=et(h=>h.activities),r=et(h=>h.activityFilterSession),a=et(h=>h.activityFilterType),o=et(h=>h.setActivityFilterSession),g=et(h=>h.setActivityFilterType),k=et(h=>h.sessions),T=P.useMemo(()=>i.filter(h=>!(r&&h.sessionId!==r||a&&h.event!==a)),[i,r,a]),c=P.useMemo(()=>{const h=new Map;for(const y of k)h.set(y.id,y.windowName??y.id.slice(0,8));return h},[k]),u=h=>c.get(h)??(h??"unknown").slice(0,8);return b.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg w-full",children:[b.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:[b.jsx("h3",{className:"text-sm font-semibold text-gray-200",children:"Activity Stream"}),b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsxs("select",{value:r??"",onChange:h=>o(h.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-[#3b82f6]",children:[b.jsx("option",{value:"",children:"All sessions"}),k.map(h=>b.jsx("option",{value:h.id,children:h.windowName||h.id.slice(0,8)},h.id))]}),b.jsxs("select",{value:a??"",onChange:h=>g(h.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-[#3b82f6]",children:[b.jsx("option",{value:"",children:"All types"}),Object.entries(ou).map(([h,y])=>b.jsx("option",{value:h,children:y.label},h))]}),(r||a)&&b.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:b.jsx(Kn,{className:"h-4 w-4"})})]})]}),b.jsxs("div",{className:"max-h-[360px] overflow-y-auto divide-y divide-[#1a1a2e]/50",children:[T.length===0&&b.jsx("div",{className:"px-4 py-8 text-center text-sm text-[#555]",children:"No activity yet"}),T.map((h,y)=>{const d=ou[h.event]??ou.session_status_change,C=d.icon;return b.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:[b.jsx(C,{className:"h-4 w-4 mt-0.5 shrink-0",style:{color:d.color}}),b.jsxs("div",{className:"flex-1 min-w-0",children:[b.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2",children:[b.jsx("span",{className:"text-xs font-medium text-gray-300 truncate",children:u(h.sessionId)}),b.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider px-1.5 py-0.5 rounded hidden sm:inline-block",style:{backgroundColor:`${d.color}15`,color:d.color},children:d.label})]}),b.jsx("p",{className:"text-xs text-gray-500 mt-0.5 font-mono truncate",children:dE(h)})]}),b.jsx("span",{className:"text-[10px] text-[#444] shrink-0 tabular-nums mt-0.5",children:mE(h.timestamp)})]},`${h.sessionId}-${h.timestamp}-${y}`)})]})]})}let pE=0;function jn(){return{workDir:"",name:"",prompt:"",_key:pE++}}function vE({open:i,onClose:r}){const a=Ro(),o=P.useRef(null),g=P.useRef(null),k=P.useCallback(()=>{Q(),r()},[r]),T=P.useRef(null);P.useEffect(()=>{if(!i)return;const $=Y=>{var re;Y.key==="Escape"&&((re=g.current)==null||re.abort(),k())};return window.addEventListener("keydown",$),()=>window.removeEventListener("keydown",$)},[i,k]),P.useEffect(()=>{if(!i)return;const $=T.current;if(!$)return;const Y='input, textarea, select, button, [tabindex]:not([tabindex="-1"])',re=he=>{if(he.key!=="Tab")return;const V=Array.from($.querySelectorAll(Y));if(V.length===0)return;const H=V[0],ce=V[V.length-1];he.shiftKey?document.activeElement===H&&(he.preventDefault(),ce.focus()):document.activeElement===ce&&(he.preventDefault(),H.focus())};return $.addEventListener("keydown",re),()=>$.removeEventListener("keydown",re)},[i]),P.useEffect(()=>{if(i){const $=setTimeout(()=>{var Y;return(Y=o.current)==null?void 0:Y.focus()},50);return()=>clearTimeout($)}},[i]);const[c,u]=P.useState([]),[h,y]=P.useState(!1);P.useEffect(()=>{i&&(y(!0),$w().then(u).catch(()=>u([])).finally(()=>y(!1)))},[i]);const[d,C]=P.useState(""),[E,O]=P.useState(""),[x,m]=P.useState(""),[p,f]=P.useState("default"),[v,S]=P.useState(!1),[R,A]=P.useState(null),[M,w]=P.useState("single"),[N,I]=P.useState(""),[q,K]=P.useState([jn(),jn()]),[Z,J]=P.useState(""),[ee,F]=P.useState(null);function Q(){C(""),O(""),m(""),f("default"),S(!1),A(null),K([jn(),jn()]),J(""),F(null),w("single"),I("")}function ne(){q.length>=10||K([...q,jn()])}function j($){q.length<=1||K(q.filter((Y,re)=>re!==$))}function U($,Y,re){K(q.map((he,V)=>V===$?{...he,[Y]:re}:he))}async function L($){var he;$.preventDefault(),A(null),F(null);const Y=q.filter(V=>V.workDir.trim());if(Y.length===0){A("At least one working directory is required");return}S(!0),(he=g.current)==null||he.abort();const re=new AbortController;g.current=re;try{const V=await Lw({sessions:Y.map(H=>({workDir:H.workDir.trim(),name:H.name.trim()||void 0,prompt:H.prompt.trim()||Z.trim()||void 0,permissionMode:p})),signal:re.signal});F(V)}catch(V){if(re.signal.aborted)return;A(V instanceof Error?V.message:"Failed to create sessions")}finally{g.current===re&&(g.current=null,S(!1))}}if(!i)return null;async function B($){var re;if($.preventDefault(),A(null),!d.trim()){A("Working directory is required");return}S(!0),(re=g.current)==null||re.abort();const Y=new AbortController;g.current=Y;try{const he=await C_({workDir:d.trim(),name:E.trim()||void 0,prompt:x.trim()||void 0,permissionMode:p,signal:Y.signal});Q(),r(),a(`/sessions/${he.id}`)}catch(he){if(Y.signal.aborted)return;A(he instanceof Error?he.message:"Failed to create session")}finally{g.current===Y&&(g.current=null,S(!1))}}return b.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[b.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:k}),b.jsxs("div",{ref:T,role:"dialog","aria-modal":"true","aria-label":"Create new session",className:`relative w-full ${M==="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:[b.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-5 py-4 border-b border-[#1a1a2e]",children:[b.jsxs("div",{className:"flex items-center gap-4",children:[b.jsx("h2",{className:"text-sm font-semibold text-gray-100",children:"New Session"}),b.jsxs("div",{className:"flex rounded bg-[#0a0a0f] p-0.5",children:[b.jsx("button",{type:"button",onClick:()=>w("single"),className:`px-3 py-1 text-xs rounded transition-colors ${M==="single"?"bg-[#3b82f6]/10 text-[#3b82f6]":"text-gray-500 hover:text-gray-300"}`,children:"Single"}),b.jsx("button",{type:"button",onClick:()=>w("batch"),className:`px-3 py-1 text-xs rounded transition-colors ${M==="batch"?"bg-[#3b82f6]/10 text-[#3b82f6]":"text-gray-500 hover:text-gray-300"}`,children:"Batch"}),c.length>0&&b.jsx("button",{type:"button",onClick:()=>w("template"),className:`px-3 py-1 text-xs rounded transition-colors ${M==="template"?"bg-[#00e5ff]/10 text-[#00e5ff]":"text-gray-500 hover:text-gray-300"}`,children:"Template"})]})]}),b.jsx("button",{onClick:k,className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-gray-300 transition-colors",children:b.jsx(Kn,{className:"h-4 w-4"})})]}),M==="single"&&b.jsxs("form",{onSubmit:B,className:"p-4 sm:p-5 space-y-4",children:[b.jsxs("div",{children:[b.jsxs("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:["Working Directory ",b.jsx("span",{className:"text-[#ef4444]",children:"*"})]}),b.jsx("input",{type:"text",ref:o,value:d,onChange:$=>C($.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-[#3b82f6] font-mono"})]}),b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Session Name"}),b.jsx("input",{type:"text",value:E,onChange:$=>O($.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-[#3b82f6]"})]}),b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Initial Prompt"}),b.jsx("textarea",{value:x,onChange:$=>m($.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-[#3b82f6] resize-none"})]}),b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Permission Mode"}),b.jsxs("select",{value:p,onChange:$=>f($.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-[#3b82f6]",children:[b.jsx("option",{value:"default",children:"default - asks for everything"}),b.jsx("option",{value:"plan",children:"plan - auto-reads, asks for writes"}),b.jsx("option",{value:"acceptEdits",children:"acceptEdits - auto-edits, asks for bash"}),b.jsx("option",{value:"bypassPermissions",children:"bypassPermissions - never asks"}),b.jsx("option",{value:"auto",children:"auto - auto-approve in sandbox"})]})]}),R&&b.jsx("div",{className:"text-xs text-[#ef4444] bg-[#ef4444]/10 border border-[#ef4444]/20 rounded px-3 py-2",children:R}),b.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[b.jsx("button",{type:"button",onClick:k,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"}),b.jsxs("button",{type:"submit",disabled:v||!d.trim(),className:"min-h-[44px] flex items-center gap-1.5 px-4 py-2.5 text-xs font-medium rounded bg-[#3b82f6]/10 hover:bg-[#3b82f6]/20 text-[#3b82f6] border border-[#3b82f6]/30 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[v&&b.jsx(Un,{className:"h-3 w-3 animate-spin"}),"Create Session"]})]})]}),M==="batch"&&!ee&&b.jsxs("form",{onSubmit:L,className:"p-4 sm:p-5 space-y-4",children:[b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Shared Prompt"}),b.jsx("textarea",{value:Z,onChange:$=>J($.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-[#3b82f6] resize-none"})]}),b.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 text-xs font-medium text-gray-500 px-1",children:[b.jsxs("span",{children:["Working Directory ",b.jsx("span",{className:"text-[#ef4444]",children:"*"})]}),b.jsx("span",{children:"Name"}),b.jsx("span",{children:"Prompt (override)"}),b.jsx("span",{})]}),b.jsx("div",{className:"space-y-2",children:q.map(($,Y)=>b.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 items-start",children:[b.jsx("input",{type:"text",value:$.workDir,onChange:re=>U(Y,"workDir",re.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-[#3b82f6] font-mono"}),b.jsx("input",{type:"text",value:$.name,onChange:re=>U(Y,"name",re.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-[#3b82f6]"}),b.jsx("input",{type:"text",value:$.prompt,onChange:re=>U(Y,"prompt",re.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-[#3b82f6]"}),b.jsx("button",{type:"button",onClick:()=>j(Y),disabled:q.length<=1,className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-[#ef4444] transition-colors disabled:opacity-30 disabled:cursor-not-allowed",children:b.jsx(Au,{className:"h-3.5 w-3.5"})})]},$._key))}),q.length<10&&b.jsxs("button",{type:"button",onClick:ne,className:"flex items-center gap-1.5 text-xs text-gray-500 hover:text-gray-300 transition-colors",children:[b.jsx(Fn,{className:"h-3.5 w-3.5"}),"Add session"]}),b.jsxs("div",{children:[b.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Permission Mode"}),b.jsxs("select",{value:p,onChange:$=>f($.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-[#3b82f6]",children:[b.jsx("option",{value:"default",children:"default - asks for everything"}),b.jsx("option",{value:"plan",children:"plan - auto-reads, asks for writes"}),b.jsx("option",{value:"acceptEdits",children:"acceptEdits - auto-edits, asks for bash"}),b.jsx("option",{value:"bypassPermissions",children:"bypassPermissions - never asks"}),b.jsx("option",{value:"auto",children:"auto - auto-approve in sandbox"})]})]}),R&&b.jsx("div",{className:"text-xs text-[#ef4444] bg-[#ef4444]/10 border border-[#ef4444]/20 rounded px-3 py-2",children:R}),b.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[b.jsx("button",{type:"button",onClick:k,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"}),b.jsxs("button",{type:"submit",disabled:v||!q.some($=>$.workDir.trim()),className:"min-h-[44px] flex items-center gap-1.5 px-4 py-2.5 text-xs font-medium rounded bg-[#3b82f6]/10 hover:bg-[#3b82f6]/20 text-[#3b82f6] border border-[#3b82f6]/30 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[v&&b.jsx(Un,{className:"h-3 w-3 animate-spin"}),"Create ",q.filter($=>$.workDir.trim()).length," Session(s)"]})]})]}),M==="template"&&b.jsxs("form",{onSubmit:async $=>{var he;$.preventDefault(),A(null);const Y=c.find(V=>V.id===N);if(!Y){A("Please select a template");return}S(!0),(he=g.current)==null||he.abort();const re=new AbortController;g.current=re;try{const V=await C_({workDir:Y.workDir,prompt:Y.prompt,claudeCommand:Y.claudeCommand,env:Y.env,stallThresholdMs:Y.stallThresholdMs,permissionMode:Y.permissionMode,autoApprove:Y.autoApprove,signal:re.signal});Q(),r(),a(`/sessions/${V.id}`)}catch(V){if(re.signal.aborted)return;A(V instanceof Error?V.message:"Failed to create session from template")}finally{g.current===re&&(g.current=null,S(!1))}},className:"p-4 sm:p-5 space-y-4",children:[b.jsxs("div",{children:[b.jsx("label",{htmlFor:"template-select",className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Select Template"}),h?b.jsx("div",{className:"text-xs text-gray-500 italic",children:"Loading templates…"}):c.length===0?b.jsx("div",{className:"text-xs text-gray-500 italic",children:"No templates available"}):b.jsxs("select",{id:"template-select",value:N,onChange:$=>I($.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:[b.jsx("option",{value:"",children:"— Choose a template —"}),c.map($=>b.jsxs("option",{value:$.id,children:[$.name," ",$.description?`— ${$.description}`:""]},$.id))]})]}),R&&b.jsx("div",{className:"text-xs text-[#ff3366] bg-[#ff3366]/10 border border-[#ff3366]/20 rounded px-3 py-2",children:R}),N&&c.find($=>$.id===N)&&(()=>{const $=c.find(Y=>Y.id===N);return b.jsxs("div",{className:"text-xs space-y-1 p-3 bg-[#0a0a0f] rounded border border-[#1a1a2e]",children:[b.jsxs("div",{className:"text-gray-400",children:[b.jsx("strong",{children:"WorkDir:"})," ",b.jsx("span",{className:"font-mono text-gray-500",children:$.workDir})]}),$.stallThresholdMs&&b.jsxs("div",{className:"text-gray-400",children:[b.jsx("strong",{children:"Stall Threshold:"})," ",b.jsxs("span",{className:"text-gray-500",children:[$.stallThresholdMs,"ms"]})]}),$.permissionMode&&$.permissionMode!=="default"&&b.jsxs("div",{className:"text-gray-400",children:[b.jsx("strong",{children:"Permission Mode:"})," ",b.jsx("span",{className:"text-gray-500",children:$.permissionMode})]})]})})(),b.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[b.jsx("button",{type:"button",onClick:k,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"}),b.jsxs("button",{type:"submit",disabled:v||!N,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:[v&&b.jsx(Un,{className:"h-3 w-3 animate-spin"}),"Create from Template"]})]})]}),ee&&b.jsxs("div",{className:"p-4 sm:p-5 space-y-4",children:[b.jsxs("div",{className:"flex items-center gap-3",children:[ee.created>0&&b.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:[ee.created," created"]}),ee.failed>0&&b.jsxs("span",{className:"text-xs font-medium text-[#ef4444] bg-[#ef4444]/10 border border-[#ef4444]/20 rounded px-3 py-1.5",children:[ee.failed," failed"]})]}),ee.sessions.length>0&&b.jsxs("div",{className:"space-y-1",children:[b.jsx("p",{className:"text-xs font-medium text-gray-400",children:"Created sessions"}),b.jsx("ul",{className:"space-y-1",children:ee.sessions.map($=>b.jsx("li",{children:b.jsxs("button",{type:"button",onClick:()=>{k(),a(`/sessions/${$.id}`)},className:"text-xs text-[#3b82f6] hover:underline font-mono",children:[$.id.slice(0,8),"...",$.name?` - ${$.name}`:""]})},$.id))})]}),ee.errors.length>0&&b.jsxs("div",{className:"space-y-1",children:[b.jsx("p",{className:"text-xs font-medium text-gray-400",children:"Errors"}),b.jsx("ul",{className:"space-y-1",children:ee.errors.map(($,Y)=>b.jsx("li",{className:"text-xs text-[#ef4444]",children:$},Y))})]}),b.jsx("div",{className:"flex justify-end pt-2",children:b.jsx("button",{type:"button",onClick:k,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 gE(){const[i,r]=P.useState(!1);return b.jsxs("div",{className:"flex flex-col gap-6",children:[b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsxs("div",{children:[b.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"Overview"}),b.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Aegis session monitoring and metrics"})]}),b.jsxs("button",{onClick:()=>r(!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:[b.jsx(Fn,{className:"h-3.5 w-3.5"}),"New Session"]})]}),b.jsx(rE,{}),b.jsxs("div",{children:[b.jsx("h3",{className:"mb-3 text-lg font-semibold text-gray-200",children:"Sessions"}),b.jsx(fE,{})]}),b.jsx(_E,{}),b.jsx(vE,{open:i,onClose:()=>r(!1)})]})}function M_(i){return i instanceof Error&&"statusCode"in i}function yE(i){const r=et(j=>j.token),a=Si(j=>j.addToast),[o,g]=P.useState(null),[k,T]=P.useState(null),[c,u]=P.useState(!1),[h,y]=P.useState(!0),[d,C]=P.useState(""),[E,O]=P.useState(!0),[x,m]=P.useState(null),[p,f]=P.useState(!0),[v,S]=P.useState(null),[R,A]=P.useState(!0),M=P.useRef(i);M.current=i;const w=P.useRef(!1),N=P.useRef(0),I=P.useRef(void 0),q=P.useRef(void 0),K=P.useCallback(async()=>{try{const[j,U]=await Promise.allSettled([vw(M.current),gw(M.current)]);if(j.status==="rejected"&&M_(j.reason)&&j.reason.statusCode===404||U.status==="rejected"&&M_(U.reason)&&U.reason.statusCode===404){u(!0);return}j.status==="fulfilled"&&g(j.value),U.status==="fulfilled"&&T(U.value)}catch(j){a("error","Failed to load session",j instanceof Error?j.message:void 0)}finally{y(!1)}},[a]);I.current=K;const Z=P.useCallback(async()=>{if(w.current)return;const j=M.current;try{const U=await Cw(j);w.current||C(U.pane??"")}catch(U){a("warning","Failed to load terminal pane",U instanceof Error?U.message:void 0)}finally{w.current||O(!1)}try{const U=await Sw(j);w.current||m(U)}catch(U){a("warning","Failed to load session metrics",U instanceof Error?U.message:void 0)}finally{w.current||f(!1)}try{const U=await xw(j);w.current||S(U)}catch(U){a("warning","Failed to load session latency",U instanceof Error?U.message:void 0)}finally{w.current||A(!1)}},[a]);q.current=Z;const J=P.useRef(void 0),ee=P.useRef(void 0),F=P.useCallback(()=>{J.current&&(clearTimeout(J.current),J.current=void 0),ee.current&&(clearTimeout(ee.current),ee.current=void 0)},[]);P.useEffect(()=>(w.current=!1,N.current++,y(!0),O(!0),f(!0),A(!0),K(),Z(),()=>{w.current=!0,F()}),[i,K,Z,F]);const Q=P.useCallback(()=>{J.current&&clearTimeout(J.current);const j=N.current;J.current=setTimeout(()=>{var U;N.current===j&&((U=q.current)==null||U.call(q))},1e3)},[]),ne=P.useCallback(()=>{ee.current&&clearTimeout(ee.current);const j=N.current;ee.current=setTimeout(()=>{var U;N.current===j&&((U=I.current)==null||U.call(I))},1e3)},[]);return P.useEffect(()=>{if(!i)return;let j=!0;const U=Kp(i,L=>{var B,$;if(j)try{const Y=nw.safeParse(JSON.parse(L.data));if(!Y.success){console.warn("SSE event failed validation",Y.error.message);return}switch(Y.data.event){case"status":case"approval":case"stall":case"dead":ne(),Q();break;case"message":Q();break;case"ended":(B=I.current)==null||B.call(I),($=q.current)==null||$.call(q);break}}catch{}},r);return()=>{j=!1,F(),U()}},[i,r,ne,Q,F]),{session:o,health:k,notFound:c,loading:h,paneContent:d,paneLoading:E,metrics:x,metricsLoading:p,latency:v,latencyLoading:R,refetchPaneAndMetrics:Z}}const bE={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 L_(i,r){if(i.length<=r)return i;const a=i.slice(0,Math.ceil(r/2)-1),o=i.slice(-(Math.floor(r/2)-2));return`${a}…${o}`}function N_(i){return new Date(i).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function SE({session:i,health:r,onApprove:a,onReject:o,onInterrupt:g,onKill:k,onSaveTemplate:T}){const[c,u]=P.useState(!1),h=r.status==="permission_prompt"||r.status==="bash_approval";return b.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg p-3 sm:p-4",children:[b.jsxs("div",{className:"flex items-start gap-3 mb-3",children:[b.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[b.jsx(zo,{status:r.status}),b.jsx("span",{className:"text-sm font-medium text-[#e0e0e0]",children:bE[r.status]})]}),b.jsxs("div",{className:"flex-1 min-w-0",children:[b.jsx("h1",{className:"text-base sm:text-lg font-semibold text-[#e0e0e0] truncate",children:i.windowName||"Untitled Session"}),b.jsx("div",{className:"text-xs text-[#555] font-mono truncate mt-0.5",children:L_(i.workDir,40)})]}),b.jsxs("div",{className:"hidden sm:flex items-center gap-2 shrink-0",children:[i.permissionMode&&i.permissionMode!=="default"&&b.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider px-2 py-0.5 rounded bg-[#003322] text-[#10b981] border border-[#10b981]/30",children:i.permissionMode}),r.alive?b.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"}):b.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider px-2 py-0.5 rounded bg-[#331111] text-[#ef4444] border border-[#ef4444]/30",children:"Dead"})]})]}),b.jsxs("div",{className:"flex items-center gap-3 sm:gap-4 text-[11px] text-[#555] mb-3 flex-wrap",children:[b.jsxs("span",{children:["Created: ",N_(i.createdAt)]}),b.jsxs("span",{className:"hidden sm:inline",children:["Last activity: ",N_(i.lastActivity)]}),b.jsxs("span",{className:"font-mono hidden sm:inline",children:["ID: ",L_(i.id,16)]}),r.details&&b.jsx("span",{className:"text-[#888] italic",children:r.details})]}),b.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h&&b.jsxs(b.Fragment,{children:[b.jsx("button",{onClick:a,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#003322] hover:bg-[#004433] text-[#10b981] border border-[#10b981]/30 transition-colors",children:"Approve"}),b.jsx("button",{onClick:o,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#331111] hover:bg-[#442222] text-[#ef4444] border border-[#ef4444]/30 transition-colors",children:"Reject"})]}),b.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"}),b.jsx("button",{onClick:T,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",title:"Save this session as a template",children:"Save as Template"}),c?b.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[b.jsx("span",{className:"text-xs text-[#ef4444]",children:"Confirm kill?"}),b.jsx("button",{onClick:()=>{k==null||k(),u(!1)},className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#331111] text-[#ef4444] border border-[#ef4444]/30 transition-colors",children:"Yes, Kill"}),b.jsx("button",{onClick:()=>u(!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"})]}):b.jsx("button",{onClick:()=>u(!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"})]})]})}var lu={exports:{}},j_;function xE(){return j_||(j_=1,(function(i,r){(function(a,o){i.exports=o()})(globalThis,(()=>(()=>{var a={4567:function(T,c,u){var h=this&&this.__decorate||function(f,v,S,R){var A,M=arguments.length,w=M<3?v:R===null?R=Object.getOwnPropertyDescriptor(v,S):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(f,v,S,R);else for(var N=f.length-1;N>=0;N--)(A=f[N])&&(w=(M<3?A(w):M>3?A(v,S,w):A(v,S))||w);return M>3&&w&&Object.defineProperty(v,S,w),w},y=this&&this.__param||function(f,v){return function(S,R){v(S,R,f)}};Object.defineProperty(c,"__esModule",{value:!0}),c.AccessibilityManager=void 0;const d=u(9042),C=u(9924),E=u(844),O=u(4725),x=u(2585),m=u(3656);let p=c.AccessibilityManager=class extends E.Disposable{constructor(f,v,S,R){super(),this._terminal=f,this._coreBrowserService=S,this._renderService=R,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let A=0;A<this._terminal.rows;A++)this._rowElements[A]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[A]);if(this._topBoundaryFocusListener=A=>this._handleBoundaryFocus(A,0),this._bottomBoundaryFocusListener=A=>this._handleBoundaryFocus(A,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 C.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((A=>this._handleResize(A.rows)))),this.register(this._terminal.onRender((A=>this._refreshRows(A.start,A.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((A=>this._handleChar(A)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
294
|
+
`)))),this.register(this._terminal.onA11yTab((A=>this._handleTab(A)))),this.register(this._terminal.onKey((A=>this._handleKey(A.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,m.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,E.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(f){for(let v=0;v<f;v++)this._handleChar(" ")}_handleChar(f){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==f&&(this._charsToAnnounce+=f):this._charsToAnnounce+=f,f===`
|
|
295
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.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,v){this._liveRegionDebouncer.refresh(f,v,this._terminal.rows)}_renderRows(f,v){const S=this._terminal.buffer,R=S.lines.length.toString();for(let A=f;A<=v;A++){const M=S.lines.get(S.ydisp+A),w=[],N=(M==null?void 0:M.translateToString(!0,void 0,void 0,w))||"",I=(S.ydisp+A+1).toString(),q=this._rowElements[A];q&&(N.length===0?(q.innerText=" ",this._rowColumns.set(q,[0,1])):(q.textContent=N,this._rowColumns.set(q,w)),q.setAttribute("aria-posinset",I),q.setAttribute("aria-setsize",R))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(f,v){const S=f.target,R=this._rowElements[v===0?1:this._rowElements.length-2];if(S.getAttribute("aria-posinset")===(v===0?"1":`${this._terminal.buffer.lines.length}`)||f.relatedTarget!==R)return;let A,M;if(v===0?(A=S,M=this._rowElements.pop(),this._rowContainer.removeChild(M)):(A=this._rowElements.shift(),M=S,this._rowContainer.removeChild(A)),A.removeEventListener("focus",this._topBoundaryFocusListener),M.removeEventListener("focus",this._bottomBoundaryFocusListener),v===0){const w=this._createAccessibilityTreeNode();this._rowElements.unshift(w),this._rowContainer.insertAdjacentElement("afterbegin",w)}else{const w=this._createAccessibilityTreeNode();this._rowElements.push(w),this._rowContainer.appendChild(w)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(v===0?-1:1),this._rowElements[v===0?1:this._rowElements.length-2].focus(),f.preventDefault(),f.stopImmediatePropagation()}_handleSelectionChange(){var N;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 v={node:f.anchorNode,offset:f.anchorOffset},S={node:f.focusNode,offset:f.focusOffset};if((v.node.compareDocumentPosition(S.node)&Node.DOCUMENT_POSITION_PRECEDING||v.node===S.node&&v.offset>S.offset)&&([v,S]=[S,v]),v.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(v={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(v.node))return;const R=this._rowElements.slice(-1)[0];if(S.node.compareDocumentPosition(R)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(S={node:R,offset:((N=R.textContent)==null?void 0:N.length)??0}),!this._rowContainer.contains(S.node))return;const A=({node:I,offset:q})=>{const K=I instanceof Text?I.parentNode:I;let Z=parseInt(K==null?void 0:K.getAttribute("aria-posinset"),10)-1;if(isNaN(Z))return console.warn("row is invalid. Race condition?"),null;const J=this._rowColumns.get(K);if(!J)return console.warn("columns is null. Race condition?"),null;let ee=q<J.length?J[q]:J.slice(-1)[0]+1;return ee>=this._terminal.cols&&(++Z,ee=0),{row:Z,column:ee}},M=A(v),w=A(S);if(M&&w){if(M.row>w.row||M.row===w.row&&M.column>=w.column)throw new Error("invalid range");this._terminal.select(M.column,M.row,(w.row-M.row)*this._terminal.cols-M.column+w.column)}}_handleResize(f){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let v=this._rowContainer.children.length;v<this._terminal.rows;v++)this._rowElements[v]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[v]);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`}};c.AccessibilityManager=p=h([y(1,x.IInstantiationService),y(2,O.ICoreBrowserService),y(3,O.IRenderService)],p)},3614:(T,c)=>{function u(C){return C.replace(/\r?\n/g,"\r")}function h(C,E){return E?"\x1B[200~"+C+"\x1B[201~":C}function y(C,E,O,x){C=h(C=u(C),O.decPrivateModes.bracketedPasteMode&&x.rawOptions.ignoreBracketedPasteMode!==!0),O.triggerDataEvent(C,!0),E.value=""}function d(C,E,O){const x=O.getBoundingClientRect(),m=C.clientX-x.left-10,p=C.clientY-x.top-10;E.style.width="20px",E.style.height="20px",E.style.left=`${m}px`,E.style.top=`${p}px`,E.style.zIndex="1000",E.focus()}Object.defineProperty(c,"__esModule",{value:!0}),c.rightClickHandler=c.moveTextAreaUnderMouseCursor=c.paste=c.handlePasteEvent=c.copyHandler=c.bracketTextForPaste=c.prepareTextForTerminal=void 0,c.prepareTextForTerminal=u,c.bracketTextForPaste=h,c.copyHandler=function(C,E){C.clipboardData&&C.clipboardData.setData("text/plain",E.selectionText),C.preventDefault()},c.handlePasteEvent=function(C,E,O,x){C.stopPropagation(),C.clipboardData&&y(C.clipboardData.getData("text/plain"),E,O,x)},c.paste=y,c.moveTextAreaUnderMouseCursor=d,c.rightClickHandler=function(C,E,O,x,m){d(C,E,O),m&&x.rightClickSelect(C),E.value=x.selectionText,E.select()}},7239:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ColorContrastCache=void 0;const h=u(1505);c.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(y,d,C){this._css.set(y,d,C)}getCss(y,d){return this._css.get(y,d)}setColor(y,d,C){this._color.set(y,d,C)}getColor(y,d){return this._color.get(y,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.addDisposableDomListener=void 0,c.addDisposableDomListener=function(u,h,y,d){u.addEventListener(h,y,d);let C=!1;return{dispose:()=>{C||(C=!0,u.removeEventListener(h,y,d))}}}},3551:function(T,c,u){var h=this&&this.__decorate||function(p,f,v,S){var R,A=arguments.length,M=A<3?f:S===null?S=Object.getOwnPropertyDescriptor(f,v):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(p,f,v,S);else for(var w=p.length-1;w>=0;w--)(R=p[w])&&(M=(A<3?R(M):A>3?R(f,v,M):R(f,v))||M);return A>3&&M&&Object.defineProperty(f,v,M),M},y=this&&this.__param||function(p,f){return function(v,S){f(v,S,p)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Linkifier=void 0;const d=u(3656),C=u(8460),E=u(844),O=u(2585),x=u(4725);let m=c.Linkifier=class extends E.Disposable{get currentLink(){return this._currentLink}constructor(p,f,v,S,R){super(),this._element=p,this._mouseService=f,this._renderService=v,this._bufferService=S,this._linkProviderService=R,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new C.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new C.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,E.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,E.toDisposable)((()=>{var A;this._lastMouseEvent=void 0,(A=this._activeProviderReplies)==null||A.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,d.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,d.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(p){this._lastMouseEvent=p;const f=this._positionFromMouseEvent(p,this._element,this._mouseService);if(!f)return;this._isMouseOut=!1;const v=p.composedPath();for(let S=0;S<v.length;S++){const R=v[S];if(R.classList.contains("xterm"))break;if(R.classList.contains("xterm-hover"))return}this._lastBufferCell&&f.x===this._lastBufferCell.x&&f.y===this._lastBufferCell.y||(this._handleHover(f),this._lastBufferCell=f)}_handleHover(p){if(this._activeLine!==p.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(p,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,p)||(this._clearCurrentLink(),this._askForLink(p,!0))}_askForLink(p,f){var S,R;this._activeProviderReplies&&f||((S=this._activeProviderReplies)==null||S.forEach((A=>{A==null||A.forEach((M=>{M.link.dispose&&M.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=p.y);let v=!1;for(const[A,M]of this._linkProviderService.linkProviders.entries())f?(R=this._activeProviderReplies)!=null&&R.get(A)&&(v=this._checkLinkProviderResult(A,p,v)):M.provideLinks(p.y,(w=>{var I,q;if(this._isMouseOut)return;const N=w==null?void 0:w.map((K=>({link:K})));(I=this._activeProviderReplies)==null||I.set(A,N),v=this._checkLinkProviderResult(A,p,v),((q=this._activeProviderReplies)==null?void 0:q.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(p.y,this._activeProviderReplies)}))}_removeIntersectingLinks(p,f){const v=new Set;for(let S=0;S<f.size;S++){const R=f.get(S);if(R)for(let A=0;A<R.length;A++){const M=R[A],w=M.link.range.start.y<p?0:M.link.range.start.x,N=M.link.range.end.y>p?this._bufferService.cols:M.link.range.end.x;for(let I=w;I<=N;I++){if(v.has(I)){R.splice(A--,1);break}v.add(I)}}}}_checkLinkProviderResult(p,f,v){var A;if(!this._activeProviderReplies)return v;const S=this._activeProviderReplies.get(p);let R=!1;for(let M=0;M<p;M++)this._activeProviderReplies.has(M)&&!this._activeProviderReplies.get(M)||(R=!0);if(!R&&S){const M=S.find((w=>this._linkAtPosition(w.link,f)));M&&(v=!0,this._handleNewLink(M))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!v)for(let M=0;M<this._activeProviderReplies.size;M++){const w=(A=this._activeProviderReplies.get(M))==null?void 0:A.find((N=>this._linkAtPosition(N.link,f)));if(w){v=!0,this._handleNewLink(w);break}}return v}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(p){if(!this._currentLink)return;const f=this._positionFromMouseEvent(p,this._element,this._mouseService);f&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,f)&&this._currentLink.link.activate(p,this._currentLink.link.text)}_clearCurrentLink(p,f){this._currentLink&&this._lastMouseEvent&&(!p||!f||this._currentLink.link.range.start.y>=p&&this._currentLink.link.range.end.y<=f)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,E.disposeArray)(this._linkCacheDisposables))}_handleNewLink(p){if(!this._lastMouseEvent)return;const f=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);f&&this._linkAtPosition(p.link,f)&&(this._currentLink=p,this._currentLink.state={decorations:{underline:p.link.decorations===void 0||p.link.decorations.underline,pointerCursor:p.link.decorations===void 0||p.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,p.link,this._lastMouseEvent),p.link.decorations={},Object.defineProperties(p.link.decorations,{pointerCursor:{get:()=>{var v,S;return(S=(v=this._currentLink)==null?void 0:v.state)==null?void 0:S.decorations.pointerCursor},set:v=>{var S;(S=this._currentLink)!=null&&S.state&&this._currentLink.state.decorations.pointerCursor!==v&&(this._currentLink.state.decorations.pointerCursor=v,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",v))}},underline:{get:()=>{var v,S;return(S=(v=this._currentLink)==null?void 0:v.state)==null?void 0:S.decorations.underline},set:v=>{var S,R,A;(S=this._currentLink)!=null&&S.state&&((A=(R=this._currentLink)==null?void 0:R.state)==null?void 0:A.decorations.underline)!==v&&(this._currentLink.state.decorations.underline=v,this._currentLink.state.isHovered&&this._fireUnderlineEvent(p.link,v))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((v=>{if(!this._currentLink)return;const S=v.start===0?0:v.start+1+this._bufferService.buffer.ydisp,R=this._bufferService.buffer.ydisp+1+v.end;if(this._currentLink.link.range.start.y>=S&&this._currentLink.link.range.end.y<=R&&(this._clearCurrentLink(S,R),this._lastMouseEvent)){const A=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);A&&this._askForLink(A,!1)}}))))}_linkHover(p,f,v){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&&p.classList.add("xterm-cursor-pointer")),f.hover&&f.hover(v,f.text)}_fireUnderlineEvent(p,f){const v=p.range,S=this._bufferService.buffer.ydisp,R=this._createLinkUnderlineEvent(v.start.x-1,v.start.y-S-1,v.end.x,v.end.y-S-1,void 0);(f?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(R)}_linkLeave(p,f,v){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&&p.classList.remove("xterm-cursor-pointer")),f.leave&&f.leave(v,f.text)}_linkAtPosition(p,f){const v=p.range.start.y*this._bufferService.cols+p.range.start.x,S=p.range.end.y*this._bufferService.cols+p.range.end.x,R=f.y*this._bufferService.cols+f.x;return v<=R&&R<=S}_positionFromMouseEvent(p,f,v){const S=v.getCoords(p,f,this._bufferService.cols,this._bufferService.rows);if(S)return{x:S[0],y:S[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(p,f,v,S,R){return{x1:p,y1:f,x2:v,y2:S,cols:this._bufferService.cols,fg:R}}};c.Linkifier=m=h([y(1,x.IMouseService),y(2,x.IRenderService),y(3,O.IBufferService),y(4,x.ILinkProviderService)],m)},9042:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.tooMuchOutput=c.promptLabel=void 0,c.promptLabel="Terminal input",c.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(T,c,u){var h=this&&this.__decorate||function(x,m,p,f){var v,S=arguments.length,R=S<3?m:f===null?f=Object.getOwnPropertyDescriptor(m,p):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(x,m,p,f);else for(var A=x.length-1;A>=0;A--)(v=x[A])&&(R=(S<3?v(R):S>3?v(m,p,R):v(m,p))||R);return S>3&&R&&Object.defineProperty(m,p,R),R},y=this&&this.__param||function(x,m){return function(p,f){m(p,f,x)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkProvider=void 0;const d=u(511),C=u(2585);let E=c.OscLinkProvider=class{constructor(x,m,p){this._bufferService=x,this._optionsService=m,this._oscLinkService=p}provideLinks(x,m){var N;const p=this._bufferService.buffer.lines.get(x-1);if(!p)return void m(void 0);const f=[],v=this._optionsService.rawOptions.linkHandler,S=new d.CellData,R=p.getTrimmedLength();let A=-1,M=-1,w=!1;for(let I=0;I<R;I++)if(M!==-1||p.hasContent(I)){if(p.loadCell(I,S),S.hasExtendedAttrs()&&S.extended.urlId){if(M===-1){M=I,A=S.extended.urlId;continue}w=S.extended.urlId!==A}else M!==-1&&(w=!0);if(w||M!==-1&&I===R-1){const q=(N=this._oscLinkService.getLinkData(A))==null?void 0:N.uri;if(q){const K={start:{x:M+1,y:x},end:{x:I+(w||I!==R-1?0:1),y:x}};let Z=!1;if(!(v!=null&&v.allowNonHttpProtocols))try{const J=new URL(q);["http:","https:"].includes(J.protocol)||(Z=!0)}catch{Z=!0}Z||f.push({text:q,range:K,activate:(J,ee)=>v?v.activate(J,ee,K):O(0,ee),hover:(J,ee)=>{var F;return(F=v==null?void 0:v.hover)==null?void 0:F.call(v,J,ee,K)},leave:(J,ee)=>{var F;return(F=v==null?void 0:v.leave)==null?void 0:F.call(v,J,ee,K)}})}w=!1,S.hasExtendedAttrs()&&S.extended.urlId?(M=I,A=S.extended.urlId):(M=-1,A=-1)}}m(f)}};function O(x,m){if(confirm(`Do you want to navigate to ${m}?
|
|
296
|
+
|
|
297
|
+
WARNING: This link could potentially be dangerous`)){const p=window.open();if(p){try{p.opener=null}catch{}p.location.href=m}else console.warn("Opening link blocked as opener could not be cleared")}}c.OscLinkProvider=E=h([y(0,C.IBufferService),y(1,C.IOptionsService),y(2,C.IOscLinkService)],E)},6193:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.RenderDebouncer=void 0,c.RenderDebouncer=class{constructor(u,h){this._renderCallback=u,this._coreBrowserService=h,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(u,h,y){this._rowCount=y,u=u!==void 0?u:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const u=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,h),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Terminal=void 0;const h=u(3614),y=u(3656),d=u(3551),C=u(9042),E=u(3730),O=u(1680),x=u(3107),m=u(5744),p=u(2950),f=u(1296),v=u(428),S=u(4269),R=u(5114),A=u(8934),M=u(3230),w=u(9312),N=u(4725),I=u(6731),q=u(8055),K=u(8969),Z=u(8460),J=u(844),ee=u(6114),F=u(8437),Q=u(2584),ne=u(7399),j=u(5941),U=u(9074),L=u(2585),B=u(5435),$=u(4567),Y=u(779);class re extends K.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(V={}){super(V),this.browser=ee,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new J.MutableDisposable),this._onCursorMove=this.register(new Z.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new Z.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new Z.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new Z.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new Z.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new Z.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new Z.EventEmitter),this._onBlur=this.register(new Z.EventEmitter),this._onA11yCharEmitter=this.register(new Z.EventEmitter),this._onA11yTabEmitter=this.register(new Z.EventEmitter),this._onWillOpen=this.register(new Z.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(U.DecorationService),this._instantiationService.setService(L.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Y.LinkProviderService),this._instantiationService.setService(N.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(E.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((H,ce)=>this.refresh(H,ce)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((H=>this._reportWindowsOptions(H)))),this.register(this._inputHandler.onColor((H=>this._handleColorEvent(H)))),this.register((0,Z.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,Z.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,Z.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,Z.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((H=>this._afterResize(H.cols,H.rows)))),this.register((0,J.toDisposable)((()=>{var H,ce;this._customKeyEventHandler=void 0,(ce=(H=this.element)==null?void 0:H.parentNode)==null||ce.removeChild(this.element)})))}_handleColorEvent(V){if(this._themeService)for(const H of V){let ce,oe="";switch(H.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;"+H.index}switch(H.type){case 0:const me=q.color.toColorRGB(ce==="ansi"?this._themeService.colors.ansi[H.index]:this._themeService.colors[ce]);this.coreService.triggerDataEvent(`${Q.C0.ESC}]${oe};${(0,j.toRgbString)(me)}${Q.C1_ESCAPED.ST}`);break;case 1:if(ce==="ansi")this._themeService.modifyColors((_e=>_e.ansi[H.index]=q.channels.toColor(...H.color)));else{const _e=ce;this._themeService.modifyColors((Te=>Te[_e]=q.channels.toColor(...H.color)))}break;case 2:this._themeService.restoreColor(H.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(V){V?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance($.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(V){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Q.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var V;return(V=this.textarea)==null?void 0:V.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Q.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 V=this.buffer.ybase+this.buffer.y,H=this.buffer.lines.get(V);if(!H)return;const ce=Math.min(this.buffer.x,this.cols-1),oe=this._renderService.dimensions.css.cell.height,me=H.getWidth(ce),_e=this._renderService.dimensions.css.cell.width*me,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=_e+"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",(H=>{this.hasSelection()&&(0,h.copyHandler)(H,this._selectionService)})));const V=H=>(0,h.handlePasteEvent)(H,this.textarea,this.coreService,this.optionsService);this.register((0,y.addDisposableDomListener)(this.textarea,"paste",V)),this.register((0,y.addDisposableDomListener)(this.element,"paste",V)),ee.isFirefox?this.register((0,y.addDisposableDomListener)(this.element,"mousedown",(H=>{H.button===2&&(0,h.rightClickHandler)(H,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,y.addDisposableDomListener)(this.element,"contextmenu",(H=>{(0,h.rightClickHandler)(H,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),ee.isLinux&&this.register((0,y.addDisposableDomListener)(this.element,"auxclick",(H=>{H.button===1&&(0,h.moveTextAreaUnderMouseCursor)(H,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,y.addDisposableDomListener)(this.textarea,"keyup",(V=>this._keyUp(V)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keydown",(V=>this._keyDown(V)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keypress",(V=>this._keyPress(V)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionupdate",(V=>this._compositionHelper.compositionupdate(V)))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,y.addDisposableDomListener)(this.textarea,"input",(V=>this._inputEvent(V)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(V){var ce;if(!V)throw new Error("Terminal requires a parent element.");if(V.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=V.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"),V.appendChild(this.element);const H=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),H.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),H.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",C.promptLabel),ee.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(R.CoreBrowserService,this.textarea,V.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(N.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(v.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(N.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(I.ThemeService),this._instantiationService.setService(N.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(S.CharacterJoinerService),this._instantiationService.setService(N.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(M.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(N.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(p.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(A.MouseService),this._instantiationService.setService(N.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(d.Linkifier,this.screenElement)),this.element.appendChild(H);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(O.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(w.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(N.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(x.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($.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(oe=>this._handleScreenReaderModeOptionChange(oe)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(m.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(oe=>{!this._overviewRulerRenderer&&oe&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(m.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 V=this,H=this.element;function ce(_e){const Te=V._mouseService.getMouseReportCoords(_e,V.screenElement);if(!Te)return!1;let je,Ze;switch(_e.overrideType||_e.type){case"mousemove":Ze=32,_e.buttons===void 0?(je=3,_e.button!==void 0&&(je=_e.button<3?_e.button:3)):je=1&_e.buttons?0:4&_e.buttons?1:2&_e.buttons?2:3;break;case"mouseup":Ze=0,je=_e.button<3?_e.button:3;break;case"mousedown":Ze=1,je=_e.button<3?_e.button:3;break;case"wheel":if(V._customWheelEventHandler&&V._customWheelEventHandler(_e)===!1||V.viewport.getLinesScrolled(_e)===0)return!1;Ze=_e.deltaY<0?0:1,je=4;break;default:return!1}return!(Ze===void 0||je===void 0||je>4)&&V.coreMouseService.triggerMouseEvent({col:Te.col,row:Te.row,x:Te.x,y:Te.y,button:je,action:Ze,ctrl:_e.ctrlKey,alt:_e.altKey,shift:_e.shiftKey})}const oe={mouseup:null,wheel:null,mousedrag:null,mousemove:null},me={mouseup:_e=>(ce(_e),_e.buttons||(this._document.removeEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.removeEventListener("mousemove",oe.mousedrag)),this.cancel(_e)),wheel:_e=>(ce(_e),this.cancel(_e,!0)),mousedrag:_e=>{_e.buttons&&ce(_e)},mousemove:_e=>{_e.buttons||ce(_e)}};this.register(this.coreMouseService.onProtocolChange((_e=>{_e?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(_e)),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&_e?oe.mousemove||(H.addEventListener("mousemove",me.mousemove),oe.mousemove=me.mousemove):(H.removeEventListener("mousemove",oe.mousemove),oe.mousemove=null),16&_e?oe.wheel||(H.addEventListener("wheel",me.wheel,{passive:!1}),oe.wheel=me.wheel):(H.removeEventListener("wheel",oe.wheel),oe.wheel=null),2&_e?oe.mouseup||(oe.mouseup=me.mouseup):(this._document.removeEventListener("mouseup",oe.mouseup),oe.mouseup=null),4&_e?oe.mousedrag||(oe.mousedrag=me.mousedrag):(this._document.removeEventListener("mousemove",oe.mousedrag),oe.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,y.addDisposableDomListener)(H,"mousedown",(_e=>{if(_e.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(_e))return ce(_e),oe.mouseup&&this._document.addEventListener("mouseup",oe.mouseup),oe.mousedrag&&this._document.addEventListener("mousemove",oe.mousedrag),this.cancel(_e)}))),this.register((0,y.addDisposableDomListener)(H,"wheel",(_e=>{if(!oe.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(_e)===!1)return!1;if(!this.buffer.hasScrollback){const Te=this.viewport.getLinesScrolled(_e);if(Te===0)return;const je=Q.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(_e.deltaY<0?"A":"B");let Ze="";for(let ct=0;ct<Math.abs(Te);ct++)Ze+=je;return this.coreService.triggerDataEvent(Ze,!0),this.cancel(_e,!0)}return this.viewport.handleWheel(_e)?this.cancel(_e):void 0}}),{passive:!1})),this.register((0,y.addDisposableDomListener)(H,"touchstart",(_e=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(_e),this.cancel(_e)}),{passive:!0})),this.register((0,y.addDisposableDomListener)(H,"touchmove",(_e=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(_e)?void 0:this.cancel(_e)}),{passive:!1}))}refresh(V,H){var ce;(ce=this._renderService)==null||ce.refreshRows(V,H)}updateCursorStyle(V){var H;(H=this._selectionService)!=null&&H.shouldColumnSelect(V)?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(V,H,ce=0){var oe;ce===1?(super.scrollLines(V,H,ce),this.refresh(0,this.rows-1)):(oe=this.viewport)==null||oe.scrollLines(V)}paste(V){(0,h.paste)(V,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(V){this._customKeyEventHandler=V}attachCustomWheelEventHandler(V){this._customWheelEventHandler=V}registerLinkProvider(V){return this._linkProviderService.registerLinkProvider(V)}registerCharacterJoiner(V){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const H=this._characterJoinerService.register(V);return this.refresh(0,this.rows-1),H}deregisterCharacterJoiner(V){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(V)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(V){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+V)}registerDecoration(V){return this._decorationService.registerDecoration(V)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(V,H,ce){this._selectionService.setSelection(V,H,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 V;(V=this._selectionService)==null||V.clearSelection()}selectAll(){var V;(V=this._selectionService)==null||V.selectAll()}selectLines(V,H){var ce;(ce=this._selectionService)==null||ce.selectLines(V,H)}_keyDown(V){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(V)===!1)return!1;const H=this.browser.isMac&&this.options.macOptionIsMeta&&V.altKey;if(!H&&!this._compositionHelper.keydown(V))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;H||V.key!=="Dead"&&V.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ce=(0,ne.evaluateKeyboardEvent)(V,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(V),ce.type===3||ce.type===2){const oe=this.rows-1;return this.scrollLines(ce.type===2?-oe:oe),this.cancel(V,!0)}return ce.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,V)||(ce.cancel&&this.cancel(V,!0),!ce.key||!!(V.key&&!V.ctrlKey&&!V.altKey&&!V.metaKey&&V.key.length===1&&V.key.charCodeAt(0)>=65&&V.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ce.key!==Q.C0.ETX&&ce.key!==Q.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ce.key,domEvent:V}),this._showCursor(),this.coreService.triggerDataEvent(ce.key,!0),!this.optionsService.rawOptions.screenReaderMode||V.altKey||V.ctrlKey?this.cancel(V,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(V,H){const ce=V.isMac&&!this.options.macOptionIsMeta&&H.altKey&&!H.ctrlKey&&!H.metaKey||V.isWindows&&H.altKey&&H.ctrlKey&&!H.metaKey||V.isWindows&&H.getModifierState("AltGraph");return H.type==="keypress"?ce:ce&&(!H.keyCode||H.keyCode>47)}_keyUp(V){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(V)===!1||((function(H){return H.keyCode===16||H.keyCode===17||H.keyCode===18})(V)||this.focus(),this.updateCursorStyle(V),this._keyPressHandled=!1)}_keyPress(V){let H;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(V)===!1)return!1;if(this.cancel(V),V.charCode)H=V.charCode;else if(V.which===null||V.which===void 0)H=V.keyCode;else{if(V.which===0||V.charCode===0)return!1;H=V.which}return!(!H||(V.altKey||V.ctrlKey||V.metaKey)&&!this._isThirdLevelShift(this.browser,V)||(H=String.fromCharCode(H),this._onKey.fire({key:H,domEvent:V}),this._showCursor(),this.coreService.triggerDataEvent(H,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(V){if(V.data&&V.inputType==="insertText"&&(!V.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const H=V.data;return this.coreService.triggerDataEvent(H,!0),this.cancel(V),!0}return!1}resize(V,H){V!==this.cols||H!==this.rows?super.resize(V,H):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(V,H){var ce,oe;(ce=this._charSizeService)==null||ce.measure(),(oe=this.viewport)==null||oe.syncScrollArea(!0)}clear(){var V;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 H=1;H<this.rows;H++)this.buffer.lines.push(this.buffer.getBlankLine(F.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(V=this.viewport)==null||V.reset(),this.refresh(0,this.rows-1)}}reset(){var H,ce;this.options.rows=this.rows,this.options.cols=this.cols;const V=this._customKeyEventHandler;this._setup(),super.reset(),(H=this._selectionService)==null||H.reset(),this._decorationService.reset(),(ce=this.viewport)==null||ce.reset(),this._customKeyEventHandler=V,this.refresh(0,this.rows-1)}clearTextureAtlas(){var V;(V=this._renderService)==null||V.clearTextureAtlas()}_reportFocus(){var V;(V=this.element)!=null&&V.classList.contains("focus")?this.coreService.triggerDataEvent(Q.C0.ESC+"[I"):this.coreService.triggerDataEvent(Q.C0.ESC+"[O")}_reportWindowsOptions(V){if(this._renderService)switch(V){case B.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const H=this._renderService.dimensions.css.canvas.width.toFixed(0),ce=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${Q.C0.ESC}[4;${ce};${H}t`);break;case B.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const oe=this._renderService.dimensions.css.cell.width.toFixed(0),me=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${Q.C0.ESC}[6;${me};${oe}t`)}}cancel(V,H){if(this.options.cancelEvents||H)return V.preventDefault(),V.stopPropagation(),!1}}c.Terminal=re},9924:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.TimeBasedDebouncer=void 0,c.TimeBasedDebouncer=class{constructor(u,h=1e3){this._renderCallback=u,this._debounceThresholdMS=h,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,h,y){this._rowCount=y,u=u!==void 0?u:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h;const d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const C=d-this._lastRefreshMs,E=this._debounceThresholdMS-C;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),E)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,h)}}},1680:function(T,c,u){var h=this&&this.__decorate||function(p,f,v,S){var R,A=arguments.length,M=A<3?f:S===null?S=Object.getOwnPropertyDescriptor(f,v):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(p,f,v,S);else for(var w=p.length-1;w>=0;w--)(R=p[w])&&(M=(A<3?R(M):A>3?R(f,v,M):R(f,v))||M);return A>3&&M&&Object.defineProperty(f,v,M),M},y=this&&this.__param||function(p,f){return function(v,S){f(v,S,p)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Viewport=void 0;const d=u(3656),C=u(4725),E=u(8460),O=u(844),x=u(2585);let m=c.Viewport=class extends O.Disposable{constructor(p,f,v,S,R,A,M,w){super(),this._viewportElement=p,this._scrollArea=f,this._bufferService=v,this._optionsService=S,this._charSizeService=R,this._renderService=A,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 E.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,d.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((N=>this._activeBuffer=N.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((N=>this._renderDimensions=N))),this._handleThemeChange(w.colors),this.register(w.onChangeColors((N=>this._handleThemeChange(N)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(p){this._viewportElement.style.backgroundColor=p.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(p){if(p)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 p=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==p&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=p),this._refreshAnimationFrame=null}syncScrollArea(p=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(p);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(p)}_handleScroll(p){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 p=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(p*(this._smoothScrollState.target-this._smoothScrollState.origin)),p<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(p,f){const v=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(f<0&&this._viewportElement.scrollTop!==0||f>0&&v<this._lastRecordedBufferHeight)||(p.cancelable&&p.preventDefault(),!1)}handleWheel(p){const f=this._getPixelsScrolled(p);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(p,f))}scrollLines(p){if(p!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const f=p*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:p,suppressScrollEvent:!1})}_getPixelsScrolled(p){if(p.deltaY===0||p.shiftKey)return 0;let f=this._applyScrollModifier(p.deltaY,p);return p.deltaMode===WheelEvent.DOM_DELTA_LINE?f*=this._currentRowHeight:p.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(f*=this._currentRowHeight*this._bufferService.rows),f}getBufferElements(p,f){var w;let v,S="";const R=[],A=f??this._bufferService.buffer.lines.length,M=this._bufferService.buffer.lines;for(let N=p;N<A;N++){const I=M.get(N);if(!I)continue;const q=(w=M.get(N+1))==null?void 0:w.isWrapped;if(S+=I.translateToString(!q),!q||N===M.length-1){const K=document.createElement("div");K.textContent=S,R.push(K),S.length>0&&(v=K),S=""}}return{bufferElements:R,cursorElement:v}}getLinesScrolled(p){if(p.deltaY===0||p.shiftKey)return 0;let f=this._applyScrollModifier(p.deltaY,p);return p.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):p.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(f*=this._bufferService.rows),f}_applyScrollModifier(p,f){const v=this._optionsService.rawOptions.fastScrollModifier;return v==="alt"&&f.altKey||v==="ctrl"&&f.ctrlKey||v==="shift"&&f.shiftKey?p*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:p*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(p){this._lastTouchY=p.touches[0].pageY}handleTouchMove(p){const f=this._lastTouchY-p.touches[0].pageY;return this._lastTouchY=p.touches[0].pageY,f!==0&&(this._viewportElement.scrollTop+=f,this._bubbleScroll(p,f))}};c.Viewport=m=h([y(2,x.IBufferService),y(3,x.IOptionsService),y(4,C.ICharSizeService),y(5,C.IRenderService),y(6,C.ICoreBrowserService),y(7,C.IThemeService)],m)},3107:function(T,c,u){var h=this&&this.__decorate||function(x,m,p,f){var v,S=arguments.length,R=S<3?m:f===null?f=Object.getOwnPropertyDescriptor(m,p):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(x,m,p,f);else for(var A=x.length-1;A>=0;A--)(v=x[A])&&(R=(S<3?v(R):S>3?v(m,p,R):v(m,p))||R);return S>3&&R&&Object.defineProperty(m,p,R),R},y=this&&this.__param||function(x,m){return function(p,f){m(p,f,x)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferDecorationRenderer=void 0;const d=u(4725),C=u(844),E=u(2585);let O=c.BufferDecorationRenderer=class extends C.Disposable{constructor(x,m,p,f,v){super(),this._screenElement=x,this._bufferService=m,this._coreBrowserService=p,this._decorationService=f,this._renderService=v,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,C.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 x of this._decorationService.decorations)this._renderDecoration(x);this._dimensionsChanged=!1}_renderDecoration(x){this._refreshStyle(x),this._dimensionsChanged&&this._refreshXPosition(x)}_createElement(x){var f;const m=this._coreBrowserService.mainDocument.createElement("div");m.classList.add("xterm-decoration"),m.classList.toggle("xterm-decoration-top-layer",((f=x==null?void 0:x.options)==null?void 0:f.layer)==="top"),m.style.width=`${Math.round((x.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,m.style.height=(x.options.height||1)*this._renderService.dimensions.css.cell.height+"px",m.style.top=(x.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",m.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const p=x.options.x??0;return p&&p>this._bufferService.cols&&(m.style.display="none"),this._refreshXPosition(x,m),m}_refreshStyle(x){const m=x.marker.line-this._bufferService.buffers.active.ydisp;if(m<0||m>=this._bufferService.rows)x.element&&(x.element.style.display="none",x.onRenderEmitter.fire(x.element));else{let p=this._decorationElements.get(x);p||(p=this._createElement(x),x.element=p,this._decorationElements.set(x,p),this._container.appendChild(p),x.onDispose((()=>{this._decorationElements.delete(x),p.remove()}))),p.style.top=m*this._renderService.dimensions.css.cell.height+"px",p.style.display=this._altBufferIsActive?"none":"block",x.onRenderEmitter.fire(p)}}_refreshXPosition(x,m=x.element){if(!m)return;const p=x.options.x??0;(x.options.anchor||"left")==="right"?m.style.right=p?p*this._renderService.dimensions.css.cell.width+"px":"":m.style.left=p?p*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(x){var m;(m=this._decorationElements.get(x))==null||m.remove(),this._decorationElements.delete(x),x.dispose()}};c.BufferDecorationRenderer=O=h([y(1,E.IBufferService),y(2,d.ICoreBrowserService),y(3,E.IDecorationService),y(4,d.IRenderService)],O)},5871:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ColorZoneStore=void 0,c.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(u){if(u.options.overviewRulerOptions){for(const h of this._zones)if(h.color===u.options.overviewRulerOptions.color&&h.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(h,u.marker.line))return;if(this._lineAdjacentToZone(h,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(h,u.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=u.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=u.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=u.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=u.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:u.options.overviewRulerOptions.color,position:u.options.overviewRulerOptions.position,startBufferLine:u.marker.line,endBufferLine:u.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(u){this._linePadding=u}_lineIntersectsZone(u,h){return h>=u.startBufferLine&&h<=u.endBufferLine}_lineAdjacentToZone(u,h,y){return h>=u.startBufferLine-this._linePadding[y||"full"]&&h<=u.endBufferLine+this._linePadding[y||"full"]}_addLineToZone(u,h){u.startBufferLine=Math.min(u.startBufferLine,h),u.endBufferLine=Math.max(u.endBufferLine,h)}}},5744:function(T,c,u){var h=this&&this.__decorate||function(v,S,R,A){var M,w=arguments.length,N=w<3?S:A===null?A=Object.getOwnPropertyDescriptor(S,R):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(v,S,R,A);else for(var I=v.length-1;I>=0;I--)(M=v[I])&&(N=(w<3?M(N):w>3?M(S,R,N):M(S,R))||N);return w>3&&N&&Object.defineProperty(S,R,N),N},y=this&&this.__param||function(v,S){return function(R,A){S(R,A,v)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OverviewRulerRenderer=void 0;const d=u(5871),C=u(4725),E=u(844),O=u(2585),x={full:0,left:0,center:0,right:0},m={full:0,left:0,center:0,right:0},p={full:0,left:0,center:0,right:0};let f=c.OverviewRulerRenderer=class extends E.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(v,S,R,A,M,w,N){var q;super(),this._viewportElement=v,this._screenElement=S,this._bufferService=R,this._decorationService=A,this._renderService=M,this._optionsService=w,this._coreBrowserService=N,this._colorZoneStore=new d.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(),(q=this._viewportElement.parentElement)==null||q.insertBefore(this._canvas,this._viewportElement);const I=this._canvas.getContext("2d");if(!I)throw new Error("Ctx cannot be null");this._ctx=I,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,E.toDisposable)((()=>{var K;(K=this._canvas)==null||K.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 v=Math.floor(this._canvas.width/3),S=Math.ceil(this._canvas.width/3);m.full=this._canvas.width,m.left=v,m.center=S,m.right=v,this._refreshDrawHeightConstants(),p.full=0,p.left=0,p.center=m.left,p.right=m.left+m.center}_refreshDrawHeightConstants(){x.full=Math.round(2*this._coreBrowserService.dpr);const v=this._canvas.height/this._bufferService.buffer.lines.length,S=Math.round(Math.max(Math.min(v,12),6)*this._coreBrowserService.dpr);x.left=S,x.center=S,x.right=S}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.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 v=this._colorZoneStore.zones;for(const S of v)S.position!=="full"&&this._renderColorZone(S);for(const S of v)S.position==="full"&&this._renderColorZone(S);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(v){this._ctx.fillStyle=v.color,this._ctx.fillRect(p[v.position||"full"],Math.round((this._canvas.height-1)*(v.startBufferLine/this._bufferService.buffers.active.lines.length)-x[v.position||"full"]/2),m[v.position||"full"],Math.round((this._canvas.height-1)*((v.endBufferLine-v.startBufferLine)/this._bufferService.buffers.active.lines.length)+x[v.position||"full"]))}_queueRefresh(v,S){this._shouldUpdateDimensions=v||this._shouldUpdateDimensions,this._shouldUpdateAnchor=S||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};c.OverviewRulerRenderer=f=h([y(2,O.IBufferService),y(3,O.IDecorationService),y(4,C.IRenderService),y(5,O.IOptionsService),y(6,C.ICoreBrowserService)],f)},2950:function(T,c,u){var h=this&&this.__decorate||function(x,m,p,f){var v,S=arguments.length,R=S<3?m:f===null?f=Object.getOwnPropertyDescriptor(m,p):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(x,m,p,f);else for(var A=x.length-1;A>=0;A--)(v=x[A])&&(R=(S<3?v(R):S>3?v(m,p,R):v(m,p))||R);return S>3&&R&&Object.defineProperty(m,p,R),R},y=this&&this.__param||function(x,m){return function(p,f){m(p,f,x)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CompositionHelper=void 0;const d=u(4725),C=u(2585),E=u(2584);let O=c.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(x,m,p,f,v,S){this._textarea=x,this._compositionView=m,this._bufferService=p,this._optionsService=f,this._coreService=v,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(x){this._compositionView.textContent=x.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(x){if(this._isComposing||this._isSendingComposition){if(x.keyCode===229||x.keyCode===16||x.keyCode===17||x.keyCode===18)return!1;this._finalizeComposition(!1)}return x.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(x){if(this._compositionView.classList.remove("active"),this._isComposing=!1,x){const m={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let p;this._isSendingComposition=!1,m.start+=this._dataAlreadySent.length,p=this._isComposing?this._textarea.value.substring(m.start,m.end):this._textarea.value.substring(m.start),p.length>0&&this._coreService.triggerDataEvent(p,!0)}}),0)}else{this._isSendingComposition=!1;const m=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(m,!0)}}_handleAnyTextareaChanges(){const x=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const m=this._textarea.value,p=m.replace(x,"");this._dataAlreadySent=p,m.length>x.length?this._coreService.triggerDataEvent(p,!0):m.length<x.length?this._coreService.triggerDataEvent(`${E.C0.DEL}`,!0):m.length===x.length&&m!==x&&this._coreService.triggerDataEvent(m,!0)}}),0)}updateCompositionElements(x){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const m=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),p=this._renderService.dimensions.css.cell.height,f=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,v=m*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=v+"px",this._compositionView.style.top=f+"px",this._compositionView.style.height=p+"px",this._compositionView.style.lineHeight=p+"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=v+"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"}x||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};c.CompositionHelper=O=h([y(2,C.IBufferService),y(3,C.IOptionsService),y(4,C.ICoreService),y(5,d.IRenderService)],O)},9806:(T,c)=>{function u(h,y,d){const C=d.getBoundingClientRect(),E=h.getComputedStyle(d),O=parseInt(E.getPropertyValue("padding-left")),x=parseInt(E.getPropertyValue("padding-top"));return[y.clientX-C.left-O,y.clientY-C.top-x]}Object.defineProperty(c,"__esModule",{value:!0}),c.getCoords=c.getCoordsRelativeToElement=void 0,c.getCoordsRelativeToElement=u,c.getCoords=function(h,y,d,C,E,O,x,m,p){if(!O)return;const f=u(h,y,d);return f?(f[0]=Math.ceil((f[0]+(p?x/2:0))/x),f[1]=Math.ceil(f[1]/m),f[0]=Math.min(Math.max(f[0],1),C+(p?1:0)),f[1]=Math.min(Math.max(f[1],1),E),f):void 0}},9504:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.moveToCellSequence=void 0;const h=u(2584);function y(m,p,f,v){const S=m-d(m,f),R=p-d(p,f),A=Math.abs(S-R)-(function(M,w,N){let I=0;const q=M-d(M,N),K=w-d(w,N);for(let Z=0;Z<Math.abs(q-K);Z++){const J=C(M,w)==="A"?-1:1,ee=N.buffer.lines.get(q+J*Z);ee!=null&&ee.isWrapped&&I++}return I})(m,p,f);return x(A,O(C(m,p),v))}function d(m,p){let f=0,v=p.buffer.lines.get(m),S=v==null?void 0:v.isWrapped;for(;S&&m>=0&&m<p.rows;)f++,v=p.buffer.lines.get(--m),S=v==null?void 0:v.isWrapped;return f}function C(m,p){return m>p?"A":"B"}function E(m,p,f,v,S,R){let A=m,M=p,w="";for(;A!==f||M!==v;)A+=S?1:-1,S&&A>R.cols-1?(w+=R.buffer.translateBufferLineToString(M,!1,m,A),A=0,m=0,M++):!S&&A<0&&(w+=R.buffer.translateBufferLineToString(M,!1,0,m+1),A=R.cols-1,m=A,M--);return w+R.buffer.translateBufferLineToString(M,!1,m,A)}function O(m,p){const f=p?"O":"[";return h.C0.ESC+f+m}function x(m,p){m=Math.floor(m);let f="";for(let v=0;v<m;v++)f+=p;return f}c.moveToCellSequence=function(m,p,f,v){const S=f.buffer.x,R=f.buffer.y;if(!f.buffer.hasScrollback)return(function(w,N,I,q,K,Z){return y(N,q,K,Z).length===0?"":x(E(w,N,w,N-d(N,K),!1,K).length,O("D",Z))})(S,R,0,p,f,v)+y(R,p,f,v)+(function(w,N,I,q,K,Z){let J;J=y(N,q,K,Z).length>0?q-d(q,K):N;const ee=q,F=(function(Q,ne,j,U,L,B){let $;return $=y(j,U,L,B).length>0?U-d(U,L):ne,Q<j&&$<=U||Q>=j&&$<U?"C":"D"})(w,N,I,q,K,Z);return x(E(w,J,I,ee,F==="C",K).length,O(F,Z))})(S,R,m,p,f,v);let A;if(R===p)return A=S>m?"D":"C",x(Math.abs(S-m),O(A,v));A=R>p?"D":"C";const M=Math.abs(R-p);return x((function(w,N){return N.cols-w})(R>p?m:S,f)+(M-1)*f.cols+1+((R>p?S:m)-1),O(A,v))}},1296:function(T,c,u){var h=this&&this.__decorate||function(Z,J,ee,F){var Q,ne=arguments.length,j=ne<3?J:F===null?F=Object.getOwnPropertyDescriptor(J,ee):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(Z,J,ee,F);else for(var U=Z.length-1;U>=0;U--)(Q=Z[U])&&(j=(ne<3?Q(j):ne>3?Q(J,ee,j):Q(J,ee))||j);return ne>3&&j&&Object.defineProperty(J,ee,j),j},y=this&&this.__param||function(Z,J){return function(ee,F){J(ee,F,Z)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRenderer=void 0;const d=u(3787),C=u(2550),E=u(2223),O=u(6171),x=u(6052),m=u(4725),p=u(8055),f=u(8460),v=u(844),S=u(2585),R="xterm-dom-renderer-owner-",A="xterm-rows",M="xterm-fg-",w="xterm-bg-",N="xterm-focus",I="xterm-selection";let q=1,K=c.DomRenderer=class extends v.Disposable{constructor(Z,J,ee,F,Q,ne,j,U,L,B,$,Y,re){super(),this._terminal=Z,this._document=J,this._element=ee,this._screenElement=F,this._viewportElement=Q,this._helperContainer=ne,this._linkifier2=j,this._charSizeService=L,this._optionsService=B,this._bufferService=$,this._coreBrowserService=Y,this._themeService=re,this._terminalClass=q++,this._rowElements=[],this._selectionRenderModel=(0,x.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new f.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(A),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(I),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,O.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((he=>this._injectCss(he)))),this._injectCss(this._themeService.colors),this._rowFactory=U.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(R+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((he=>this._handleLinkHover(he)))),this.register(this._linkifier2.onHideLinkUnderline((he=>this._handleLinkLeave(he)))),this.register((0,v.toDisposable)((()=>{this._element.classList.remove(R+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new C.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 Z=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*Z,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*Z),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/Z),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/Z),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 ee of this._rowElements)ee.style.width=`${this.dimensions.css.canvas.width}px`,ee.style.height=`${this.dimensions.css.cell.height}px`,ee.style.lineHeight=`${this.dimensions.css.cell.height}px`,ee.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const J=`${this._terminalSelector} .${A} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=J,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(Z){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let J=`${this._terminalSelector} .${A} { color: ${Z.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;J+=`${this._terminalSelector} .${A} .xterm-dim { color: ${p.color.multiplyOpacity(Z.foreground,.5).css};}`,J+=`${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 ee=`blink_underline_${this._terminalClass}`,F=`blink_bar_${this._terminalClass}`,Q=`blink_block_${this._terminalClass}`;J+=`@keyframes ${ee} { 50% { border-bottom-style: hidden; }}`,J+=`@keyframes ${F} { 50% { box-shadow: none; }}`,J+=`@keyframes ${Q} { 0% { background-color: ${Z.cursor.css}; color: ${Z.cursorAccent.css}; } 50% { background-color: inherit; color: ${Z.cursor.css}; }}`,J+=`${this._terminalSelector} .${A}.${N} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${ee} 1s step-end infinite;}${this._terminalSelector} .${A}.${N} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${F} 1s step-end infinite;}${this._terminalSelector} .${A}.${N} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${Q} 1s step-end infinite;}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-block { background-color: ${Z.cursor.css}; color: ${Z.cursorAccent.css};}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${Z.cursor.css} !important; color: ${Z.cursorAccent.css} !important;}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${Z.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${Z.cursor.css} inset;}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${Z.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,J+=`${this._terminalSelector} .${I} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${I} div { position: absolute; background-color: ${Z.selectionBackgroundOpaque.css};}${this._terminalSelector} .${I} div { position: absolute; background-color: ${Z.selectionInactiveBackgroundOpaque.css};}`;for(const[ne,j]of Z.ansi.entries())J+=`${this._terminalSelector} .${M}${ne} { color: ${j.css}; }${this._terminalSelector} .${M}${ne}.xterm-dim { color: ${p.color.multiplyOpacity(j,.5).css}; }${this._terminalSelector} .${w}${ne} { background-color: ${j.css}; }`;J+=`${this._terminalSelector} .${M}${E.INVERTED_DEFAULT_COLOR} { color: ${p.color.opaque(Z.background).css}; }${this._terminalSelector} .${M}${E.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${p.color.multiplyOpacity(p.color.opaque(Z.background),.5).css}; }${this._terminalSelector} .${w}${E.INVERTED_DEFAULT_COLOR} { background-color: ${Z.foreground.css}; }`,this._themeStyleElement.textContent=J}_setDefaultSpacing(){const Z=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${Z}px`,this._rowFactory.defaultSpacing=Z}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(Z,J){for(let ee=this._rowElements.length;ee<=J;ee++){const F=this._document.createElement("div");this._rowContainer.appendChild(F),this._rowElements.push(F)}for(;this._rowElements.length>J;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(Z,J){this._refreshRowElements(Z,J),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(N),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(N),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(Z,J,ee){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(Z,J,ee),this.renderRows(0,this._bufferService.rows-1),!Z||!J)return;this._selectionRenderModel.update(this._terminal,Z,J,ee);const F=this._selectionRenderModel.viewportStartRow,Q=this._selectionRenderModel.viewportEndRow,ne=this._selectionRenderModel.viewportCappedStartRow,j=this._selectionRenderModel.viewportCappedEndRow;if(ne>=this._bufferService.rows||j<0)return;const U=this._document.createDocumentFragment();if(ee){const L=Z[0]>J[0];U.appendChild(this._createSelectionElement(ne,L?J[0]:Z[0],L?Z[0]:J[0],j-ne+1))}else{const L=F===ne?Z[0]:0,B=ne===Q?J[0]:this._bufferService.cols;U.appendChild(this._createSelectionElement(ne,L,B));const $=j-ne-1;if(U.appendChild(this._createSelectionElement(ne+1,0,this._bufferService.cols,$)),ne!==j){const Y=Q===j?J[0]:this._bufferService.cols;U.appendChild(this._createSelectionElement(j,0,Y))}}this._selectionContainer.appendChild(U)}_createSelectionElement(Z,J,ee,F=1){const Q=this._document.createElement("div"),ne=J*this.dimensions.css.cell.width;let j=this.dimensions.css.cell.width*(ee-J);return ne+j>this.dimensions.css.canvas.width&&(j=this.dimensions.css.canvas.width-ne),Q.style.height=F*this.dimensions.css.cell.height+"px",Q.style.top=Z*this.dimensions.css.cell.height+"px",Q.style.left=`${ne}px`,Q.style.width=`${j}px`,Q}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 Z of this._rowElements)Z.replaceChildren()}renderRows(Z,J){const ee=this._bufferService.buffer,F=ee.ybase+ee.y,Q=Math.min(ee.x,this._bufferService.cols-1),ne=this._optionsService.rawOptions.cursorBlink,j=this._optionsService.rawOptions.cursorStyle,U=this._optionsService.rawOptions.cursorInactiveStyle;for(let L=Z;L<=J;L++){const B=L+ee.ydisp,$=this._rowElements[L],Y=ee.lines.get(B);if(!$||!Y)break;$.replaceChildren(...this._rowFactory.createRow(Y,B,B===F,j,U,Q,ne,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${R}${this._terminalClass}`}_handleLinkHover(Z){this._setCellUnderline(Z.x1,Z.x2,Z.y1,Z.y2,Z.cols,!0)}_handleLinkLeave(Z){this._setCellUnderline(Z.x1,Z.x2,Z.y1,Z.y2,Z.cols,!1)}_setCellUnderline(Z,J,ee,F,Q,ne){ee<0&&(Z=0),F<0&&(J=0);const j=this._bufferService.rows-1;ee=Math.max(Math.min(ee,j),0),F=Math.max(Math.min(F,j),0),Q=Math.min(Q,this._bufferService.cols);const U=this._bufferService.buffer,L=U.ybase+U.y,B=Math.min(U.x,Q-1),$=this._optionsService.rawOptions.cursorBlink,Y=this._optionsService.rawOptions.cursorStyle,re=this._optionsService.rawOptions.cursorInactiveStyle;for(let he=ee;he<=F;++he){const V=he+U.ydisp,H=this._rowElements[he],ce=U.lines.get(V);if(!H||!ce)break;H.replaceChildren(...this._rowFactory.createRow(ce,V,V===L,Y,re,B,$,this.dimensions.css.cell.width,this._widthCache,ne?he===ee?Z:0:-1,ne?(he===F?J:Q)-1:-1))}}};c.DomRenderer=K=h([y(7,S.IInstantiationService),y(8,m.ICharSizeService),y(9,S.IOptionsService),y(10,S.IBufferService),y(11,m.ICoreBrowserService),y(12,m.IThemeService)],K)},3787:function(T,c,u){var h=this&&this.__decorate||function(A,M,w,N){var I,q=arguments.length,K=q<3?M:N===null?N=Object.getOwnPropertyDescriptor(M,w):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")K=Reflect.decorate(A,M,w,N);else for(var Z=A.length-1;Z>=0;Z--)(I=A[Z])&&(K=(q<3?I(K):q>3?I(M,w,K):I(M,w))||K);return q>3&&K&&Object.defineProperty(M,w,K),K},y=this&&this.__param||function(A,M){return function(w,N){M(w,N,A)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRendererRowFactory=void 0;const d=u(2223),C=u(643),E=u(511),O=u(2585),x=u(8055),m=u(4725),p=u(4269),f=u(6171),v=u(3734);let S=c.DomRendererRowFactory=class{constructor(A,M,w,N,I,q,K){this._document=A,this._characterJoinerService=M,this._optionsService=w,this._coreBrowserService=N,this._coreService=I,this._decorationService=q,this._themeService=K,this._workCell=new E.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(A,M,w){this._selectionStart=A,this._selectionEnd=M,this._columnSelectMode=w}createRow(A,M,w,N,I,q,K,Z,J,ee,F){const Q=[],ne=this._characterJoinerService.getJoinedCharacters(M),j=this._themeService.colors;let U,L=A.getNoBgTrimmedLength();w&&L<q+1&&(L=q+1);let B=0,$="",Y=0,re=0,he=0,V=!1,H=0,ce=!1,oe=0;const me=[],_e=ee!==-1&&F!==-1;for(let Te=0;Te<L;Te++){A.loadCell(Te,this._workCell);let je=this._workCell.getWidth();if(je===0)continue;let Ze=!1,ct=Te,Ce=this._workCell;if(ne.length>0&&Te===ne[0][0]){Ze=!0;const Ge=ne.shift();Ce=new p.JoinedCellData(this._workCell,A.translateToString(!0,Ge[0],Ge[1]),Ge[1]-Ge[0]),ct=Ge[1]-1,je=Ce.getWidth()}const pe=this._isCellInSelection(Te,M),At=w&&Te===q,mi=_e&&Te>=ee&&Te<=F;let xs=!1;this._decorationService.forEachDecorationAtCell(Te,M,void 0,(Ge=>{xs=!0}));let Fs=Ce.getChars()||C.WHITESPACE_CELL_CHAR;if(Fs===" "&&(Ce.isUnderline()||Ce.isOverline())&&(Fs=" "),oe=je*Z-J.get(Fs,Ce.isBold(),Ce.isItalic()),U){if(B&&(pe&&ce||!pe&&!ce&&Ce.bg===Y)&&(pe&&ce&&j.selectionForeground||Ce.fg===re)&&Ce.extended.ext===he&&mi===V&&oe===H&&!At&&!Ze&&!xs){Ce.isInvisible()?$+=C.WHITESPACE_CELL_CHAR:$+=Fs,B++;continue}B&&(U.textContent=$),U=this._document.createElement("span"),B=0,$=""}else U=this._document.createElement("span");if(Y=Ce.bg,re=Ce.fg,he=Ce.extended.ext,V=mi,H=oe,ce=pe,Ze&&q>=Te&&q<=ct&&(q=Te),!this._coreService.isCursorHidden&&At&&this._coreService.isCursorInitialized){if(me.push("xterm-cursor"),this._coreBrowserService.isFocused)K&&me.push("xterm-cursor-blink"),me.push(N==="bar"?"xterm-cursor-bar":N==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(I)switch(I){case"outline":me.push("xterm-cursor-outline");break;case"block":me.push("xterm-cursor-block");break;case"bar":me.push("xterm-cursor-bar");break;case"underline":me.push("xterm-cursor-underline")}}if(Ce.isBold()&&me.push("xterm-bold"),Ce.isItalic()&&me.push("xterm-italic"),Ce.isDim()&&me.push("xterm-dim"),$=Ce.isInvisible()?C.WHITESPACE_CELL_CHAR:Ce.getChars()||C.WHITESPACE_CELL_CHAR,Ce.isUnderline()&&(me.push(`xterm-underline-${Ce.extended.underlineStyle}`),$===" "&&($=" "),!Ce.isUnderlineColorDefault()))if(Ce.isUnderlineColorRGB())U.style.textDecorationColor=`rgb(${v.AttributeData.toColorRGB(Ce.getUnderlineColor()).join(",")})`;else{let Ge=Ce.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Ce.isBold()&&Ge<8&&(Ge+=8),U.style.textDecorationColor=j.ansi[Ge].css}Ce.isOverline()&&(me.push("xterm-overline"),$===" "&&($=" ")),Ce.isStrikethrough()&&me.push("xterm-strikethrough"),mi&&(U.style.textDecoration="underline");let Rt=Ce.getFgColor(),pt=Ce.getFgColorMode(),Gt=Ce.getBgColor(),$i=Ce.getBgColorMode();const Ks=!!Ce.isInverse();if(Ks){const Ge=Rt;Rt=Gt,Gt=Ge;const ws=pt;pt=$i,$i=ws}let Ht,Vs,oi,Cs=!1;switch(this._decorationService.forEachDecorationAtCell(Te,M,void 0,(Ge=>{Ge.options.layer!=="top"&&Cs||(Ge.backgroundColorRGB&&($i=50331648,Gt=Ge.backgroundColorRGB.rgba>>8&16777215,Ht=Ge.backgroundColorRGB),Ge.foregroundColorRGB&&(pt=50331648,Rt=Ge.foregroundColorRGB.rgba>>8&16777215,Vs=Ge.foregroundColorRGB),Cs=Ge.options.layer==="top")})),!Cs&&pe&&(Ht=this._coreBrowserService.isFocused?j.selectionBackgroundOpaque:j.selectionInactiveBackgroundOpaque,Gt=Ht.rgba>>8&16777215,$i=50331648,Cs=!0,j.selectionForeground&&(pt=50331648,Rt=j.selectionForeground.rgba>>8&16777215,Vs=j.selectionForeground)),Cs&&me.push("xterm-decoration-top"),$i){case 16777216:case 33554432:oi=j.ansi[Gt],me.push(`xterm-bg-${Gt}`);break;case 50331648:oi=x.channels.toColor(Gt>>16,Gt>>8&255,255&Gt),this._addStyle(U,`background-color:#${R((Gt>>>0).toString(16),"0",6)}`);break;default:Ks?(oi=j.foreground,me.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):oi=j.background}switch(Ht||Ce.isDim()&&(Ht=x.color.multiplyOpacity(oi,.5)),pt){case 16777216:case 33554432:Ce.isBold()&&Rt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Rt+=8),this._applyMinimumContrast(U,oi,j.ansi[Rt],Ce,Ht,void 0)||me.push(`xterm-fg-${Rt}`);break;case 50331648:const Ge=x.channels.toColor(Rt>>16&255,Rt>>8&255,255&Rt);this._applyMinimumContrast(U,oi,Ge,Ce,Ht,Vs)||this._addStyle(U,`color:#${R(Rt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(U,oi,j.foreground,Ce,Ht,Vs)||Ks&&me.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}me.length&&(U.className=me.join(" "),me.length=0),At||Ze||xs?U.textContent=$:B++,oe!==this.defaultSpacing&&(U.style.letterSpacing=`${oe}px`),Q.push(U),Te=ct}return U&&B&&(U.textContent=$),Q}_applyMinimumContrast(A,M,w,N,I,q){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,f.treatGlyphAsBackgroundColor)(N.getCode()))return!1;const K=this._getContrastCache(N);let Z;if(I||q||(Z=K.getColor(M.rgba,w.rgba)),Z===void 0){const J=this._optionsService.rawOptions.minimumContrastRatio/(N.isDim()?2:1);Z=x.color.ensureContrastRatio(I||M,q||w,J),K.setColor((I||M).rgba,(q||w).rgba,Z??null)}return!!Z&&(this._addStyle(A,`color:${Z.css}`),!0)}_getContrastCache(A){return A.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(A,M){A.setAttribute("style",`${A.getAttribute("style")||""}${M};`)}_isCellInSelection(A,M){const w=this._selectionStart,N=this._selectionEnd;return!(!w||!N)&&(this._columnSelectMode?w[0]<=N[0]?A>=w[0]&&M>=w[1]&&A<N[0]&&M<=N[1]:A<w[0]&&M>=w[1]&&A>=N[0]&&M<=N[1]:M>w[1]&&M<N[1]||w[1]===N[1]&&M===w[1]&&A>=w[0]&&A<N[0]||w[1]<N[1]&&M===N[1]&&A<N[0]||w[1]<N[1]&&M===w[1]&&A>=w[0])}};function R(A,M,w){for(;A.length<w;)A=M+A;return A}c.DomRendererRowFactory=S=h([y(1,m.ICharacterJoinerService),y(2,O.IOptionsService),y(3,m.ICoreBrowserService),y(4,O.ICoreService),y(5,O.IDecorationService),y(6,m.IThemeService)],S)},2550:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WidthCache=void 0,c.WidthCache=class{constructor(u,h){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const y=u.createElement("span");y.classList.add("xterm-char-measure-element");const d=u.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontWeight="bold";const C=u.createElement("span");C.classList.add("xterm-char-measure-element"),C.style.fontStyle="italic";const E=u.createElement("span");E.classList.add("xterm-char-measure-element"),E.style.fontWeight="bold",E.style.fontStyle="italic",this._measureElements=[y,d,C,E],this._container.appendChild(y),this._container.appendChild(d),this._container.appendChild(C),this._container.appendChild(E),h.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(u,h,y,d){u===this._font&&h===this._fontSize&&y===this._weight&&d===this._weightBold||(this._font=u,this._fontSize=h,this._weight=y,this._weightBold=d,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${y}`,this._measureElements[1].style.fontWeight=`${d}`,this._measureElements[2].style.fontWeight=`${y}`,this._measureElements[3].style.fontWeight=`${d}`,this.clear())}get(u,h,y){let d=0;if(!h&&!y&&u.length===1&&(d=u.charCodeAt(0))<256){if(this._flat[d]!==-9999)return this._flat[d];const O=this._measure(u,0);return O>0&&(this._flat[d]=O),O}let C=u;h&&(C+="B"),y&&(C+="I");let E=this._holey.get(C);if(E===void 0){let O=0;h&&(O|=1),y&&(O|=2),E=this._measure(u,O),E>0&&this._holey.set(C,E)}return E}_measure(u,h){const y=this._measureElements[h];return y.textContent=u.repeat(32),y.offsetWidth/32}}},2223:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.TEXT_BASELINE=c.DIM_OPACITY=c.INVERTED_DEFAULT_COLOR=void 0;const h=u(6114);c.INVERTED_DEFAULT_COLOR=257,c.DIM_OPACITY=.5,c.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(T,c)=>{function u(y){return 57508<=y&&y<=57558}function h(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(c,"__esModule",{value:!0}),c.computeNextVariantOffset=c.createRenderDimensions=c.treatGlyphAsBackgroundColor=c.allowRescaling=c.isEmoji=c.isRestrictedPowerlineGlyph=c.isPowerlineGlyph=c.throwIfFalsy=void 0,c.throwIfFalsy=function(y){if(!y)throw new Error("value must not be falsy");return y},c.isPowerlineGlyph=u,c.isRestrictedPowerlineGlyph=function(y){return 57520<=y&&y<=57527},c.isEmoji=h,c.allowRescaling=function(y,d,C,E){return d===1&&C>Math.ceil(1.5*E)&&y!==void 0&&y>255&&!h(y)&&!u(y)&&!(function(O){return 57344<=O&&O<=63743})(y)},c.treatGlyphAsBackgroundColor=function(y){return u(y)||(function(d){return 9472<=d&&d<=9631})(y)},c.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}}}},c.computeNextVariantOffset=function(y,d,C=0){return(y-(2*Math.round(d)-C))%(2*Math.round(d))}},6052:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.createSelectionRenderModel=void 0;class u{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(y,d,C,E=!1){if(this.selectionStart=d,this.selectionEnd=C,!d||!C||d[0]===C[0]&&d[1]===C[1])return void this.clear();const O=y.buffers.active.ydisp,x=d[1]-O,m=C[1]-O,p=Math.max(x,0),f=Math.min(m,y.rows-1);p>=y.rows||f<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=E,this.viewportStartRow=x,this.viewportEndRow=m,this.viewportCappedStartRow=p,this.viewportCappedEndRow=f,this.startCol=d[0],this.endCol=C[0])}isCellSelected(y,d,C){return!!this.hasSelection&&(C-=y.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?d>=this.startCol&&C>=this.viewportCappedStartRow&&d<this.endCol&&C<=this.viewportCappedEndRow:d<this.startCol&&C>=this.viewportCappedStartRow&&d>=this.endCol&&C<=this.viewportCappedEndRow:C>this.viewportStartRow&&C<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&C===this.viewportStartRow&&d>=this.startCol&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&C===this.viewportEndRow&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&C===this.viewportStartRow&&d>=this.startCol)}}c.createSelectionRenderModel=function(){return new u}},456:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionModel=void 0,c.SelectionModel=class{constructor(u){this._bufferService=u,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,h=this.selectionEnd;return!(!u||!h)&&(u[1]>h[1]||u[1]===h[1]&&u[0]>h[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(T,c,u){var h=this&&this.__decorate||function(f,v,S,R){var A,M=arguments.length,w=M<3?v:R===null?R=Object.getOwnPropertyDescriptor(v,S):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(f,v,S,R);else for(var N=f.length-1;N>=0;N--)(A=f[N])&&(w=(M<3?A(w):M>3?A(v,S,w):A(v,S))||w);return M>3&&w&&Object.defineProperty(v,S,w),w},y=this&&this.__param||function(f,v){return function(S,R){v(S,R,f)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharSizeService=void 0;const d=u(2585),C=u(8460),E=u(844);let O=c.CharSizeService=class extends E.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(f,v,S){super(),this._optionsService=S,this.width=0,this.height=0,this._onCharSizeChange=this.register(new C.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new p(this._optionsService))}catch{this._measureStrategy=this.register(new m(f,v,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())}};c.CharSizeService=O=h([y(2,d.IOptionsService)],O);class x extends E.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(v,S){v!==void 0&&v>0&&S!==void 0&&S>0&&(this._result.width=v,this._result.height=S)}}class m extends x{constructor(v,S,R){super(),this._document=v,this._parentElement=S,this._optionsService=R,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class p extends x{constructor(v){super(),this._optionsService=v,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 v=this._ctx.measureText("W");return this._validateAndSet(v.width,v.fontBoundingBoxAscent+v.fontBoundingBoxDescent),this._result}}},4269:function(T,c,u){var h=this&&this.__decorate||function(p,f,v,S){var R,A=arguments.length,M=A<3?f:S===null?S=Object.getOwnPropertyDescriptor(f,v):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(p,f,v,S);else for(var w=p.length-1;w>=0;w--)(R=p[w])&&(M=(A<3?R(M):A>3?R(f,v,M):R(f,v))||M);return A>3&&M&&Object.defineProperty(f,v,M),M},y=this&&this.__param||function(p,f){return function(v,S){f(v,S,p)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharacterJoinerService=c.JoinedCellData=void 0;const d=u(3734),C=u(643),E=u(511),O=u(2585);class x extends d.AttributeData{constructor(f,v,S){super(),this.content=0,this.combinedData="",this.fg=f.fg,this.bg=f.bg,this.combinedData=v,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()]}}c.JoinedCellData=x;let m=c.CharacterJoinerService=class Wp{constructor(f){this._bufferService=f,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new E.CellData}register(f){const v={id:this._nextCharacterJoinerId++,handler:f};return this._characterJoiners.push(v),v.id}deregister(f){for(let v=0;v<this._characterJoiners.length;v++)if(this._characterJoiners[v].id===f)return this._characterJoiners.splice(v,1),!0;return!1}getJoinedCharacters(f){if(this._characterJoiners.length===0)return[];const v=this._bufferService.buffer.lines.get(f);if(!v||v.length===0)return[];const S=[],R=v.translateToString(!0);let A=0,M=0,w=0,N=v.getFg(0),I=v.getBg(0);for(let q=0;q<v.getTrimmedLength();q++)if(v.loadCell(q,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==N||this._workCell.bg!==I){if(q-A>1){const K=this._getJoinedRanges(R,w,M,v,A);for(let Z=0;Z<K.length;Z++)S.push(K[Z])}A=q,w=M,N=this._workCell.fg,I=this._workCell.bg}M+=this._workCell.getChars().length||C.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-A>1){const q=this._getJoinedRanges(R,w,M,v,A);for(let K=0;K<q.length;K++)S.push(q[K])}return S}_getJoinedRanges(f,v,S,R,A){const M=f.substring(v,S);let w=[];try{w=this._characterJoiners[0].handler(M)}catch(N){console.error(N)}for(let N=1;N<this._characterJoiners.length;N++)try{const I=this._characterJoiners[N].handler(M);for(let q=0;q<I.length;q++)Wp._mergeRanges(w,I[q])}catch(I){console.error(I)}return this._stringRangesToCellRanges(w,R,A),w}_stringRangesToCellRanges(f,v,S){let R=0,A=!1,M=0,w=f[R];if(w){for(let N=S;N<this._bufferService.cols;N++){const I=v.getWidth(N),q=v.getString(N).length||C.WHITESPACE_CELL_CHAR.length;if(I!==0){if(!A&&w[0]<=M&&(w[0]=N,A=!0),w[1]<=M){if(w[1]=N,w=f[++R],!w)break;w[0]<=M?(w[0]=N,A=!0):A=!1}M+=q}}w&&(w[1]=this._bufferService.cols)}}static _mergeRanges(f,v){let S=!1;for(let R=0;R<f.length;R++){const A=f[R];if(S){if(v[1]<=A[0])return f[R-1][1]=v[1],f;if(v[1]<=A[1])return f[R-1][1]=Math.max(v[1],A[1]),f.splice(R,1),f;f.splice(R,1),R--}else{if(v[1]<=A[0])return f.splice(R,0,v),f;if(v[1]<=A[1])return A[0]=Math.min(v[0],A[0]),f;v[0]<A[1]&&(A[0]=Math.min(v[0],A[0]),S=!0)}}return S?f[f.length-1][1]=v[1]:f.push(v),f}};c.CharacterJoinerService=m=h([y(0,O.IBufferService)],m)},5114:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreBrowserService=void 0;const h=u(844),y=u(8460),d=u(3656);class C extends h.Disposable{constructor(x,m,p){super(),this._textarea=x,this._window=m,this.mainDocument=p,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new E(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(x){this._window!==x&&(this._window=x,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}}c.CoreBrowserService=C;class E extends h.Disposable{constructor(x){super(),this._parentWindow=x,this._windowResizeListener=this.register(new h.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,h.toDisposable)((()=>this.clearListener())))}setWindow(x){this._parentWindow=x,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,d.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var x;this._outerListener&&((x=this._resolutionMediaMatchList)==null||x.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,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.LinkProviderService=void 0;const h=u(844);class y extends h.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,h.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(C){return this.linkProviders.push(C),{dispose:()=>{const E=this.linkProviders.indexOf(C);E!==-1&&this.linkProviders.splice(E,1)}}}}c.LinkProviderService=y},8934:function(T,c,u){var h=this&&this.__decorate||function(O,x,m,p){var f,v=arguments.length,S=v<3?x:p===null?p=Object.getOwnPropertyDescriptor(x,m):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(O,x,m,p);else for(var R=O.length-1;R>=0;R--)(f=O[R])&&(S=(v<3?f(S):v>3?f(x,m,S):f(x,m))||S);return v>3&&S&&Object.defineProperty(x,m,S),S},y=this&&this.__param||function(O,x){return function(m,p){x(m,p,O)}};Object.defineProperty(c,"__esModule",{value:!0}),c.MouseService=void 0;const d=u(4725),C=u(9806);let E=c.MouseService=class{constructor(O,x){this._renderService=O,this._charSizeService=x}getCoords(O,x,m,p,f){return(0,C.getCoords)(window,O,x,m,p,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,f)}getMouseReportCoords(O,x){const m=(0,C.getCoordsRelativeToElement)(window,O,x);if(this._charSizeService.hasValidSize)return m[0]=Math.min(Math.max(m[0],0),this._renderService.dimensions.css.canvas.width-1),m[1]=Math.min(Math.max(m[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(m[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(m[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(m[0]),y:Math.floor(m[1])}}};c.MouseService=E=h([y(0,d.IRenderService),y(1,d.ICharSizeService)],E)},3230:function(T,c,u){var h=this&&this.__decorate||function(f,v,S,R){var A,M=arguments.length,w=M<3?v:R===null?R=Object.getOwnPropertyDescriptor(v,S):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(f,v,S,R);else for(var N=f.length-1;N>=0;N--)(A=f[N])&&(w=(M<3?A(w):M>3?A(v,S,w):A(v,S))||w);return M>3&&w&&Object.defineProperty(v,S,w),w},y=this&&this.__param||function(f,v){return function(S,R){v(S,R,f)}};Object.defineProperty(c,"__esModule",{value:!0}),c.RenderService=void 0;const d=u(6193),C=u(4725),E=u(8460),O=u(844),x=u(7226),m=u(2585);let p=c.RenderService=class extends O.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(f,v,S,R,A,M,w,N){super(),this._rowCount=f,this._charSizeService=R,this._renderer=this.register(new O.MutableDisposable),this._pausedResizeTask=new x.DebouncedIdleTask,this._observerDisposable=this.register(new O.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 E.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new E.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new E.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new E.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new d.RenderDebouncer(((I,q)=>this._renderRows(I,q)),w),this.register(this._renderDebouncer),this.register(w.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(M.onResize((()=>this._fullRefresh()))),this.register(M.buffers.onBufferActivate((()=>{var I;return(I=this._renderer.value)==null?void 0:I.clear()}))),this.register(S.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(A.onDecorationRegistered((()=>this._fullRefresh()))),this.register(A.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(N.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(w.window,v),this.register(w.onWindowChange((I=>this._registerIntersectionObserver(I,v))))}_registerIntersectionObserver(f,v){if("IntersectionObserver"in f){const S=new f.IntersectionObserver((R=>this._handleIntersectionChange(R[R.length-1])),{threshold:0});S.observe(v),this._observerDisposable.value=(0,O.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,v,S=!1){this._isPaused?this._needsFullRefresh=!0:(S||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(f,v,this._rowCount))}_renderRows(f,v){this._renderer.value&&(f=Math.min(f,this._rowCount-1),v=Math.min(v,this._rowCount-1),this._renderer.value.renderRows(f,v),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:v}),this._onRender.fire({start:f,end:v}),this._isNextRenderRedrawOnly=!0)}resize(f,v){this._rowCount=v,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((v=>this.refreshRows(v.start,v.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,v;this._renderer.value&&((v=(f=this._renderer.value).clearTextureAtlas)==null||v.call(f),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(f,v){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var S;return(S=this._renderer.value)==null?void 0:S.handleResize(f,v)})):this._renderer.value.handleResize(f,v),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,v,S){var R;this._selectionState.start=f,this._selectionState.end=v,this._selectionState.columnSelectMode=S,(R=this._renderer.value)==null||R.handleSelectionChanged(f,v,S)}handleCursorMove(){var f;(f=this._renderer.value)==null||f.handleCursorMove()}clear(){var f;(f=this._renderer.value)==null||f.clear()}};c.RenderService=p=h([y(2,m.IOptionsService),y(3,C.ICharSizeService),y(4,m.IDecorationService),y(5,m.IBufferService),y(6,C.ICoreBrowserService),y(7,C.IThemeService)],p)},9312:function(T,c,u){var h=this&&this.__decorate||function(w,N,I,q){var K,Z=arguments.length,J=Z<3?N:q===null?q=Object.getOwnPropertyDescriptor(N,I):q;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")J=Reflect.decorate(w,N,I,q);else for(var ee=w.length-1;ee>=0;ee--)(K=w[ee])&&(J=(Z<3?K(J):Z>3?K(N,I,J):K(N,I))||J);return Z>3&&J&&Object.defineProperty(N,I,J),J},y=this&&this.__param||function(w,N){return function(I,q){N(I,q,w)}};Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionService=void 0;const d=u(9806),C=u(9504),E=u(456),O=u(4725),x=u(8460),m=u(844),p=u(6114),f=u(4841),v=u(511),S=u(2585),R=" ",A=new RegExp(R,"g");let M=c.SelectionService=class extends m.Disposable{constructor(w,N,I,q,K,Z,J,ee,F){super(),this._element=w,this._screenElement=N,this._linkifier=I,this._bufferService=q,this._coreService=K,this._mouseService=Z,this._optionsService=J,this._renderService=ee,this._coreBrowserService=F,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new v.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new x.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new x.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new x.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new x.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=Q=>this._handleMouseMove(Q),this._mouseUpListener=Q=>this._handleMouseUp(Q),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((Q=>this._handleTrim(Q))),this.register(this._bufferService.buffers.onBufferActivate((Q=>this._handleBufferActivate(Q)))),this.enable(),this._model=new E.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,m.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 w=this._model.finalSelectionStart,N=this._model.finalSelectionEnd;return!(!w||!N||w[0]===N[0]&&w[1]===N[1])}get selectionText(){const w=this._model.finalSelectionStart,N=this._model.finalSelectionEnd;if(!w||!N)return"";const I=this._bufferService.buffer,q=[];if(this._activeSelectionMode===3){if(w[0]===N[0])return"";const K=w[0]<N[0]?w[0]:N[0],Z=w[0]<N[0]?N[0]:w[0];for(let J=w[1];J<=N[1];J++){const ee=I.translateBufferLineToString(J,!0,K,Z);q.push(ee)}}else{const K=w[1]===N[1]?N[0]:void 0;q.push(I.translateBufferLineToString(w[1],!0,w[0],K));for(let Z=w[1]+1;Z<=N[1]-1;Z++){const J=I.lines.get(Z),ee=I.translateBufferLineToString(Z,!0);J!=null&&J.isWrapped?q[q.length-1]+=ee:q.push(ee)}if(w[1]!==N[1]){const Z=I.lines.get(N[1]),J=I.translateBufferLineToString(N[1],!0,0,N[0]);Z&&Z.isWrapped?q[q.length-1]+=J:q.push(J)}}return q.map((K=>K.replace(A," "))).join(p.isWindows?`\r
|
|
298
|
+
`:`
|
|
299
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(w){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),p.isLinux&&w&&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(w){const N=this._getMouseBufferCoords(w),I=this._model.finalSelectionStart,q=this._model.finalSelectionEnd;return!!(I&&q&&N)&&this._areCoordsInSelection(N,I,q)}isCellInSelection(w,N){const I=this._model.finalSelectionStart,q=this._model.finalSelectionEnd;return!(!I||!q)&&this._areCoordsInSelection([w,N],I,q)}_areCoordsInSelection(w,N,I){return w[1]>N[1]&&w[1]<I[1]||N[1]===I[1]&&w[1]===N[1]&&w[0]>=N[0]&&w[0]<I[0]||N[1]<I[1]&&w[1]===I[1]&&w[0]<I[0]||N[1]<I[1]&&w[1]===N[1]&&w[0]>=N[0]}_selectWordAtCursor(w,N){var K,Z;const I=(Z=(K=this._linkifier.currentLink)==null?void 0:K.link)==null?void 0:Z.range;if(I)return this._model.selectionStart=[I.start.x-1,I.start.y-1],this._model.selectionStartLength=(0,f.getRangeLength)(I,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const q=this._getMouseBufferCoords(w);return!!q&&(this._selectWordAt(q,N),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(w,N){this._model.clearSelection(),w=Math.max(w,0),N=Math.min(N,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,w],this._model.selectionEnd=[this._bufferService.cols,N],this.refresh(),this._onSelectionChange.fire()}_handleTrim(w){this._model.handleTrim(w)&&this.refresh()}_getMouseBufferCoords(w){const N=this._mouseService.getCoords(w,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(N)return N[0]--,N[1]--,N[1]+=this._bufferService.buffer.ydisp,N}_getMouseEventScrollAmount(w){let N=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,w,this._screenElement)[1];const I=this._renderService.dimensions.css.canvas.height;return N>=0&&N<=I?0:(N>I&&(N-=I),N=Math.min(Math.max(N,-50),50),N/=50,N/Math.abs(N)+Math.round(14*N))}shouldForceSelection(w){return p.isMac?w.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:w.shiftKey}handleMouseDown(w){if(this._mouseDownTimeStamp=w.timeStamp,(w.button!==2||!this.hasSelection)&&w.button===0){if(!this._enabled){if(!this.shouldForceSelection(w))return;w.stopPropagation()}w.preventDefault(),this._dragScrollAmount=0,this._enabled&&w.shiftKey?this._handleIncrementalClick(w):w.detail===1?this._handleSingleClick(w):w.detail===2?this._handleDoubleClick(w):w.detail===3&&this._handleTripleClick(w),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(w){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(w))}_handleSingleClick(w){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(w)?3:0,this._model.selectionStart=this._getMouseBufferCoords(w),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const N=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);N&&N.length!==this._model.selectionStart[0]&&N.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(w){this._selectWordAtCursor(w,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(w){const N=this._getMouseBufferCoords(w);N&&(this._activeSelectionMode=2,this._selectLineAt(N[1]))}shouldColumnSelect(w){return w.altKey&&!(p.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(w){if(w.stopImmediatePropagation(),!this._model.selectionStart)return;const N=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(w),!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(w),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const I=this._bufferService.buffer;if(this._model.selectionEnd[1]<I.lines.length){const q=I.lines.get(this._model.selectionEnd[1]);q&&q.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}N&&N[0]===this._model.selectionEnd[0]&&N[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 w=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(w.ydisp+this._bufferService.rows,w.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=w.ydisp),this.refresh()}}_handleMouseUp(w){const N=w.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&N<500&&w.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const I=this._mouseService.getCoords(w,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(I&&I[0]!==void 0&&I[1]!==void 0){const q=(0,C.moveToCellSequence)(I[0]-1,I[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(q,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const w=this._model.finalSelectionStart,N=this._model.finalSelectionEnd,I=!(!w||!N||w[0]===N[0]&&w[1]===N[1]);I?w&&N&&(this._oldSelectionStart&&this._oldSelectionEnd&&w[0]===this._oldSelectionStart[0]&&w[1]===this._oldSelectionStart[1]&&N[0]===this._oldSelectionEnd[0]&&N[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(w,N,I)):this._oldHasSelection&&this._fireOnSelectionChange(w,N,I)}_fireOnSelectionChange(w,N,I){this._oldSelectionStart=w,this._oldSelectionEnd=N,this._oldHasSelection=I,this._onSelectionChange.fire()}_handleBufferActivate(w){this.clearSelection(),this._trimListener.dispose(),this._trimListener=w.activeBuffer.lines.onTrim((N=>this._handleTrim(N)))}_convertViewportColToCharacterIndex(w,N){let I=N;for(let q=0;N>=q;q++){const K=w.loadCell(q,this._workCell).getChars().length;this._workCell.getWidth()===0?I--:K>1&&N!==q&&(I+=K-1)}return I}setSelection(w,N,I){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[w,N],this._model.selectionStartLength=I,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(w){this._isClickInSelection(w)||(this._selectWordAtCursor(w,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(w,N,I=!0,q=!0){if(w[0]>=this._bufferService.cols)return;const K=this._bufferService.buffer,Z=K.lines.get(w[1]);if(!Z)return;const J=K.translateBufferLineToString(w[1],!1);let ee=this._convertViewportColToCharacterIndex(Z,w[0]),F=ee;const Q=w[0]-ee;let ne=0,j=0,U=0,L=0;if(J.charAt(ee)===" "){for(;ee>0&&J.charAt(ee-1)===" ";)ee--;for(;F<J.length&&J.charAt(F+1)===" ";)F++}else{let Y=w[0],re=w[0];Z.getWidth(Y)===0&&(ne++,Y--),Z.getWidth(re)===2&&(j++,re++);const he=Z.getString(re).length;for(he>1&&(L+=he-1,F+=he-1);Y>0&&ee>0&&!this._isCharWordSeparator(Z.loadCell(Y-1,this._workCell));){Z.loadCell(Y-1,this._workCell);const V=this._workCell.getChars().length;this._workCell.getWidth()===0?(ne++,Y--):V>1&&(U+=V-1,ee-=V-1),ee--,Y--}for(;re<Z.length&&F+1<J.length&&!this._isCharWordSeparator(Z.loadCell(re+1,this._workCell));){Z.loadCell(re+1,this._workCell);const V=this._workCell.getChars().length;this._workCell.getWidth()===2?(j++,re++):V>1&&(L+=V-1,F+=V-1),F++,re++}}F++;let B=ee+Q-ne+U,$=Math.min(this._bufferService.cols,F-ee+ne+j-U-L);if(N||J.slice(ee,F).trim()!==""){if(I&&B===0&&Z.getCodePoint(0)!==32){const Y=K.lines.get(w[1]-1);if(Y&&Z.isWrapped&&Y.getCodePoint(this._bufferService.cols-1)!==32){const re=this._getWordAt([this._bufferService.cols-1,w[1]-1],!1,!0,!1);if(re){const he=this._bufferService.cols-re.start;B-=he,$+=he}}}if(q&&B+$===this._bufferService.cols&&Z.getCodePoint(this._bufferService.cols-1)!==32){const Y=K.lines.get(w[1]+1);if(Y!=null&&Y.isWrapped&&Y.getCodePoint(0)!==32){const re=this._getWordAt([0,w[1]+1],!1,!1,!0);re&&($+=re.length)}}return{start:B,length:$}}}_selectWordAt(w,N){const I=this._getWordAt(w,N);if(I){for(;I.start<0;)I.start+=this._bufferService.cols,w[1]--;this._model.selectionStart=[I.start,w[1]],this._model.selectionStartLength=I.length}}_selectToWordAt(w){const N=this._getWordAt(w,!0);if(N){let I=w[1];for(;N.start<0;)N.start+=this._bufferService.cols,I--;if(!this._model.areSelectionValuesReversed())for(;N.start+N.length>this._bufferService.cols;)N.length-=this._bufferService.cols,I++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?N.start:N.start+N.length,I]}}_isCharWordSeparator(w){return w.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(w.getChars())>=0}_selectLineAt(w){const N=this._bufferService.buffer.getWrappedRangeForLine(w),I={start:{x:0,y:N.first},end:{x:this._bufferService.cols-1,y:N.last}};this._model.selectionStart=[0,N.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,f.getRangeLength)(I,this._bufferService.cols)}};c.SelectionService=M=h([y(3,S.IBufferService),y(4,S.ICoreService),y(5,O.IMouseService),y(6,S.IOptionsService),y(7,O.IRenderService),y(8,O.ICoreBrowserService)],M)},4725:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ILinkProviderService=c.IThemeService=c.ICharacterJoinerService=c.ISelectionService=c.IRenderService=c.IMouseService=c.ICoreBrowserService=c.ICharSizeService=void 0;const h=u(8343);c.ICharSizeService=(0,h.createDecorator)("CharSizeService"),c.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),c.IMouseService=(0,h.createDecorator)("MouseService"),c.IRenderService=(0,h.createDecorator)("RenderService"),c.ISelectionService=(0,h.createDecorator)("SelectionService"),c.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),c.IThemeService=(0,h.createDecorator)("ThemeService"),c.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(T,c,u){var h=this&&this.__decorate||function(M,w,N,I){var q,K=arguments.length,Z=K<3?w:I===null?I=Object.getOwnPropertyDescriptor(w,N):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Z=Reflect.decorate(M,w,N,I);else for(var J=M.length-1;J>=0;J--)(q=M[J])&&(Z=(K<3?q(Z):K>3?q(w,N,Z):q(w,N))||Z);return K>3&&Z&&Object.defineProperty(w,N,Z),Z},y=this&&this.__param||function(M,w){return function(N,I){w(N,I,M)}};Object.defineProperty(c,"__esModule",{value:!0}),c.ThemeService=c.DEFAULT_ANSI_COLORS=void 0;const d=u(7239),C=u(8055),E=u(8460),O=u(844),x=u(2585),m=C.css.toColor("#ffffff"),p=C.css.toColor("#000000"),f=C.css.toColor("#ffffff"),v=C.css.toColor("#000000"),S={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};c.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const M=[C.css.toColor("#2e3436"),C.css.toColor("#cc0000"),C.css.toColor("#4e9a06"),C.css.toColor("#c4a000"),C.css.toColor("#3465a4"),C.css.toColor("#75507b"),C.css.toColor("#06989a"),C.css.toColor("#d3d7cf"),C.css.toColor("#555753"),C.css.toColor("#ef2929"),C.css.toColor("#8ae234"),C.css.toColor("#fce94f"),C.css.toColor("#729fcf"),C.css.toColor("#ad7fa8"),C.css.toColor("#34e2e2"),C.css.toColor("#eeeeec")],w=[0,95,135,175,215,255];for(let N=0;N<216;N++){const I=w[N/36%6|0],q=w[N/6%6|0],K=w[N%6];M.push({css:C.channels.toCss(I,q,K),rgba:C.channels.toRgba(I,q,K)})}for(let N=0;N<24;N++){const I=8+10*N;M.push({css:C.channels.toCss(I,I,I),rgba:C.channels.toRgba(I,I,I)})}return M})());let R=c.ThemeService=class extends O.Disposable{get colors(){return this._colors}constructor(M){super(),this._optionsService=M,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new E.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:m,background:p,cursor:f,cursorAccent:v,selectionForeground:void 0,selectionBackgroundTransparent:S,selectionBackgroundOpaque:C.color.blend(p,S),selectionInactiveBackgroundTransparent:S,selectionInactiveBackgroundOpaque:C.color.blend(p,S),ansi:c.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 w=this._colors;if(w.foreground=A(M.foreground,m),w.background=A(M.background,p),w.cursor=A(M.cursor,f),w.cursorAccent=A(M.cursorAccent,v),w.selectionBackgroundTransparent=A(M.selectionBackground,S),w.selectionBackgroundOpaque=C.color.blend(w.background,w.selectionBackgroundTransparent),w.selectionInactiveBackgroundTransparent=A(M.selectionInactiveBackground,w.selectionBackgroundTransparent),w.selectionInactiveBackgroundOpaque=C.color.blend(w.background,w.selectionInactiveBackgroundTransparent),w.selectionForeground=M.selectionForeground?A(M.selectionForeground,C.NULL_COLOR):void 0,w.selectionForeground===C.NULL_COLOR&&(w.selectionForeground=void 0),C.color.isOpaque(w.selectionBackgroundTransparent)&&(w.selectionBackgroundTransparent=C.color.opacity(w.selectionBackgroundTransparent,.3)),C.color.isOpaque(w.selectionInactiveBackgroundTransparent)&&(w.selectionInactiveBackgroundTransparent=C.color.opacity(w.selectionInactiveBackgroundTransparent,.3)),w.ansi=c.DEFAULT_ANSI_COLORS.slice(),w.ansi[0]=A(M.black,c.DEFAULT_ANSI_COLORS[0]),w.ansi[1]=A(M.red,c.DEFAULT_ANSI_COLORS[1]),w.ansi[2]=A(M.green,c.DEFAULT_ANSI_COLORS[2]),w.ansi[3]=A(M.yellow,c.DEFAULT_ANSI_COLORS[3]),w.ansi[4]=A(M.blue,c.DEFAULT_ANSI_COLORS[4]),w.ansi[5]=A(M.magenta,c.DEFAULT_ANSI_COLORS[5]),w.ansi[6]=A(M.cyan,c.DEFAULT_ANSI_COLORS[6]),w.ansi[7]=A(M.white,c.DEFAULT_ANSI_COLORS[7]),w.ansi[8]=A(M.brightBlack,c.DEFAULT_ANSI_COLORS[8]),w.ansi[9]=A(M.brightRed,c.DEFAULT_ANSI_COLORS[9]),w.ansi[10]=A(M.brightGreen,c.DEFAULT_ANSI_COLORS[10]),w.ansi[11]=A(M.brightYellow,c.DEFAULT_ANSI_COLORS[11]),w.ansi[12]=A(M.brightBlue,c.DEFAULT_ANSI_COLORS[12]),w.ansi[13]=A(M.brightMagenta,c.DEFAULT_ANSI_COLORS[13]),w.ansi[14]=A(M.brightCyan,c.DEFAULT_ANSI_COLORS[14]),w.ansi[15]=A(M.brightWhite,c.DEFAULT_ANSI_COLORS[15]),M.extendedAnsi){const N=Math.min(w.ansi.length-16,M.extendedAnsi.length);for(let I=0;I<N;I++)w.ansi[I+16]=A(M.extendedAnsi[I],c.DEFAULT_ANSI_COLORS[I+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 w=0;w<this._restoreColors.ansi.length;++w)this._colors.ansi[w]=this._restoreColors.ansi[w]}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 A(M,w){if(M!==void 0)try{return C.css.toColor(M)}catch{}return w}c.ThemeService=R=h([y(0,x.IOptionsService)],R)},6349:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CircularList=void 0;const h=u(8460),y=u(844);class d extends y.Disposable{constructor(E){super(),this._maxLength=E,this.onDeleteEmitter=this.register(new h.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new h.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new h.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(E){if(this._maxLength===E)return;const O=new Array(E);for(let x=0;x<Math.min(E,this.length);x++)O[x]=this._array[this._getCyclicIndex(x)];this._array=O,this._maxLength=E,this._startIndex=0}get length(){return this._length}set length(E){if(E>this._length)for(let O=this._length;O<E;O++)this._array[O]=void 0;this._length=E}get(E){return this._array[this._getCyclicIndex(E)]}set(E,O){this._array[this._getCyclicIndex(E)]=O}push(E){this._array[this._getCyclicIndex(this._length)]=E,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(E,O,...x){if(O){for(let m=E;m<this._length-O;m++)this._array[this._getCyclicIndex(m)]=this._array[this._getCyclicIndex(m+O)];this._length-=O,this.onDeleteEmitter.fire({index:E,amount:O})}for(let m=this._length-1;m>=E;m--)this._array[this._getCyclicIndex(m+x.length)]=this._array[this._getCyclicIndex(m)];for(let m=0;m<x.length;m++)this._array[this._getCyclicIndex(E+m)]=x[m];if(x.length&&this.onInsertEmitter.fire({index:E,amount:x.length}),this._length+x.length>this._maxLength){const m=this._length+x.length-this._maxLength;this._startIndex+=m,this._length=this._maxLength,this.onTrimEmitter.fire(m)}else this._length+=x.length}trimStart(E){E>this._length&&(E=this._length),this._startIndex+=E,this._length-=E,this.onTrimEmitter.fire(E)}shiftElements(E,O,x){if(!(O<=0)){if(E<0||E>=this._length)throw new Error("start argument out of range");if(E+x<0)throw new Error("Cannot shift elements in list beyond index 0");if(x>0){for(let p=O-1;p>=0;p--)this.set(E+p+x,this.get(E+p));const m=E+O+x-this._length;if(m>0)for(this._length+=m;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let m=0;m<O;m++)this.set(E+m+x,this.get(E+m))}}_getCyclicIndex(E){return(this._startIndex+E)%this._maxLength}}c.CircularList=d},1439:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.clone=void 0,c.clone=function u(h,y=5){if(typeof h!="object")return h;const d=Array.isArray(h)?[]:{};for(const C in h)d[C]=y<=1?h[C]:h[C]&&u(h[C],y-1);return d}},8055:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.contrastRatio=c.toPaddedHex=c.rgba=c.rgb=c.css=c.color=c.channels=c.NULL_COLOR=void 0;let u=0,h=0,y=0,d=0;var C,E,O,x,m;function p(v){const S=v.toString(16);return S.length<2?"0"+S:S}function f(v,S){return v<S?(S+.05)/(v+.05):(v+.05)/(S+.05)}c.NULL_COLOR={css:"#00000000",rgba:0},(function(v){v.toCss=function(S,R,A,M){return M!==void 0?`#${p(S)}${p(R)}${p(A)}${p(M)}`:`#${p(S)}${p(R)}${p(A)}`},v.toRgba=function(S,R,A,M=255){return(S<<24|R<<16|A<<8|M)>>>0},v.toColor=function(S,R,A,M){return{css:v.toCss(S,R,A,M),rgba:v.toRgba(S,R,A,M)}}})(C||(c.channels=C={})),(function(v){function S(R,A){return d=Math.round(255*A),[u,h,y]=m.toChannels(R.rgba),{css:C.toCss(u,h,y,d),rgba:C.toRgba(u,h,y,d)}}v.blend=function(R,A){if(d=(255&A.rgba)/255,d===1)return{css:A.css,rgba:A.rgba};const M=A.rgba>>24&255,w=A.rgba>>16&255,N=A.rgba>>8&255,I=R.rgba>>24&255,q=R.rgba>>16&255,K=R.rgba>>8&255;return u=I+Math.round((M-I)*d),h=q+Math.round((w-q)*d),y=K+Math.round((N-K)*d),{css:C.toCss(u,h,y),rgba:C.toRgba(u,h,y)}},v.isOpaque=function(R){return(255&R.rgba)==255},v.ensureContrastRatio=function(R,A,M){const w=m.ensureContrastRatio(R.rgba,A.rgba,M);if(w)return C.toColor(w>>24&255,w>>16&255,w>>8&255)},v.opaque=function(R){const A=(255|R.rgba)>>>0;return[u,h,y]=m.toChannels(A),{css:C.toCss(u,h,y),rgba:A}},v.opacity=S,v.multiplyOpacity=function(R,A){return d=255&R.rgba,S(R,d*A/255)},v.toColorRGB=function(R){return[R.rgba>>24&255,R.rgba>>16&255,R.rgba>>8&255]}})(E||(c.color=E={})),(function(v){let S,R;try{const A=document.createElement("canvas");A.width=1,A.height=1;const M=A.getContext("2d",{willReadFrequently:!0});M&&(S=M,S.globalCompositeOperation="copy",R=S.createLinearGradient(0,0,1,1))}catch{}v.toColor=function(A){if(A.match(/#[\da-f]{3,8}/i))switch(A.length){case 4:return u=parseInt(A.slice(1,2).repeat(2),16),h=parseInt(A.slice(2,3).repeat(2),16),y=parseInt(A.slice(3,4).repeat(2),16),C.toColor(u,h,y);case 5:return u=parseInt(A.slice(1,2).repeat(2),16),h=parseInt(A.slice(2,3).repeat(2),16),y=parseInt(A.slice(3,4).repeat(2),16),d=parseInt(A.slice(4,5).repeat(2),16),C.toColor(u,h,y,d);case 7:return{css:A,rgba:(parseInt(A.slice(1),16)<<8|255)>>>0};case 9:return{css:A,rgba:parseInt(A.slice(1),16)>>>0}}const M=A.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(M)return u=parseInt(M[1]),h=parseInt(M[2]),y=parseInt(M[3]),d=Math.round(255*(M[5]===void 0?1:parseFloat(M[5]))),C.toColor(u,h,y,d);if(!S||!R)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=R,S.fillStyle=A,typeof S.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(S.fillRect(0,0,1,1),[u,h,y,d]=S.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:C.toRgba(u,h,y,d),css:A}}})(O||(c.css=O={})),(function(v){function S(R,A,M){const w=R/255,N=A/255,I=M/255;return .2126*(w<=.03928?w/12.92:Math.pow((w+.055)/1.055,2.4))+.7152*(N<=.03928?N/12.92:Math.pow((N+.055)/1.055,2.4))+.0722*(I<=.03928?I/12.92:Math.pow((I+.055)/1.055,2.4))}v.relativeLuminance=function(R){return S(R>>16&255,R>>8&255,255&R)},v.relativeLuminance2=S})(x||(c.rgb=x={})),(function(v){function S(A,M,w){const N=A>>24&255,I=A>>16&255,q=A>>8&255;let K=M>>24&255,Z=M>>16&255,J=M>>8&255,ee=f(x.relativeLuminance2(K,Z,J),x.relativeLuminance2(N,I,q));for(;ee<w&&(K>0||Z>0||J>0);)K-=Math.max(0,Math.ceil(.1*K)),Z-=Math.max(0,Math.ceil(.1*Z)),J-=Math.max(0,Math.ceil(.1*J)),ee=f(x.relativeLuminance2(K,Z,J),x.relativeLuminance2(N,I,q));return(K<<24|Z<<16|J<<8|255)>>>0}function R(A,M,w){const N=A>>24&255,I=A>>16&255,q=A>>8&255;let K=M>>24&255,Z=M>>16&255,J=M>>8&255,ee=f(x.relativeLuminance2(K,Z,J),x.relativeLuminance2(N,I,q));for(;ee<w&&(K<255||Z<255||J<255);)K=Math.min(255,K+Math.ceil(.1*(255-K))),Z=Math.min(255,Z+Math.ceil(.1*(255-Z))),J=Math.min(255,J+Math.ceil(.1*(255-J))),ee=f(x.relativeLuminance2(K,Z,J),x.relativeLuminance2(N,I,q));return(K<<24|Z<<16|J<<8|255)>>>0}v.blend=function(A,M){if(d=(255&M)/255,d===1)return M;const w=M>>24&255,N=M>>16&255,I=M>>8&255,q=A>>24&255,K=A>>16&255,Z=A>>8&255;return u=q+Math.round((w-q)*d),h=K+Math.round((N-K)*d),y=Z+Math.round((I-Z)*d),C.toRgba(u,h,y)},v.ensureContrastRatio=function(A,M,w){const N=x.relativeLuminance(A>>8),I=x.relativeLuminance(M>>8);if(f(N,I)<w){if(I<N){const Z=S(A,M,w),J=f(N,x.relativeLuminance(Z>>8));if(J<w){const ee=R(A,M,w);return J>f(N,x.relativeLuminance(ee>>8))?Z:ee}return Z}const q=R(A,M,w),K=f(N,x.relativeLuminance(q>>8));if(K<w){const Z=S(A,M,w);return K>f(N,x.relativeLuminance(Z>>8))?q:Z}return q}},v.reduceLuminance=S,v.increaseLuminance=R,v.toChannels=function(A){return[A>>24&255,A>>16&255,A>>8&255,255&A]}})(m||(c.rgba=m={})),c.toPaddedHex=p,c.contrastRatio=f},8969:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreTerminal=void 0;const h=u(844),y=u(2585),d=u(4348),C=u(7866),E=u(744),O=u(7302),x=u(6975),m=u(8460),p=u(1753),f=u(1480),v=u(7994),S=u(9282),R=u(5435),A=u(5981),M=u(2660);let w=!1;class N extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new m.EventEmitter),this._onScroll.event((q=>{var K;(K=this._onScrollApi)==null||K.fire(q.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(q){for(const K in q)this.optionsService.options[K]=q[K]}constructor(q){super(),this._windowsWrappingHeuristics=this.register(new h.MutableDisposable),this._onBinary=this.register(new m.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new m.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new m.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new m.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new m.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new m.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new O.OptionsService(q)),this._instantiationService.setService(y.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(E.BufferService)),this._instantiationService.setService(y.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(C.LogService)),this._instantiationService.setService(y.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(x.CoreService)),this._instantiationService.setService(y.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(p.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(v.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 R.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,m.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,m.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,m.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,m.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((K=>{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((K=>{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 A.WriteBuffer(((K,Z)=>this._inputHandler.parse(K,Z)))),this.register((0,m.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(q,K){this._writeBuffer.write(q,K)}writeSync(q,K){this._logService.logLevel<=y.LogLevelEnum.WARN&&!w&&(this._logService.warn("writeSync is unreliable and will be removed soon."),w=!0),this._writeBuffer.writeSync(q,K)}input(q,K=!0){this.coreService.triggerDataEvent(q,K)}resize(q,K){isNaN(q)||isNaN(K)||(q=Math.max(q,E.MINIMUM_COLS),K=Math.max(K,E.MINIMUM_ROWS),this._bufferService.resize(q,K))}scroll(q,K=!1){this._bufferService.scroll(q,K)}scrollLines(q,K,Z){this._bufferService.scrollLines(q,K,Z)}scrollPages(q){this.scrollLines(q*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(q){const K=q-this._bufferService.buffer.ydisp;K!==0&&this.scrollLines(K)}registerEscHandler(q,K){return this._inputHandler.registerEscHandler(q,K)}registerDcsHandler(q,K){return this._inputHandler.registerDcsHandler(q,K)}registerCsiHandler(q,K){return this._inputHandler.registerCsiHandler(q,K)}registerOscHandler(q,K){return this._inputHandler.registerOscHandler(q,K)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let q=!1;const K=this.optionsService.rawOptions.windowsPty;K&&K.buildNumber!==void 0&&K.buildNumber!==void 0?q=K.backend==="conpty"&&K.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(q=!0),q?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const q=[];q.push(this.onLineFeed(S.updateWindowsModeWrappedState.bind(null,this._bufferService))),q.push(this.registerCsiHandler({final:"H"},(()=>((0,S.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const K of q)K.dispose()}))}}}c.CoreTerminal=N},8460:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.runAndSubscribe=c.forwardEvent=c.EventEmitter=void 0,c.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===u)return void this._listeners.splice(h,1)}}})),this._event}fire(u,h){const y=[];for(let d=0;d<this._listeners.length;d++)y.push(this._listeners[d]);for(let d=0;d<y.length;d++)y[d].call(void 0,u,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},c.forwardEvent=function(u,h){return u((y=>h.fire(y)))},c.runAndSubscribe=function(u,h){return h(void 0),u((y=>h(y)))}},5435:function(T,c,u){var h=this&&this.__decorate||function(ne,j,U,L){var B,$=arguments.length,Y=$<3?j:L===null?L=Object.getOwnPropertyDescriptor(j,U):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Y=Reflect.decorate(ne,j,U,L);else for(var re=ne.length-1;re>=0;re--)(B=ne[re])&&(Y=($<3?B(Y):$>3?B(j,U,Y):B(j,U))||Y);return $>3&&Y&&Object.defineProperty(j,U,Y),Y},y=this&&this.__param||function(ne,j){return function(U,L){j(U,L,ne)}};Object.defineProperty(c,"__esModule",{value:!0}),c.InputHandler=c.WindowsOptionsReportType=void 0;const d=u(2584),C=u(7116),E=u(2015),O=u(844),x=u(482),m=u(8437),p=u(8460),f=u(643),v=u(511),S=u(3734),R=u(2585),A=u(1480),M=u(6242),w=u(6351),N=u(5941),I={"(":0,")":1,"*":2,"+":3,"-":1,".":2},q=131072;function K(ne,j){if(ne>24)return j.setWinLines||!1;switch(ne){case 1:return!!j.restoreWin;case 2:return!!j.minimizeWin;case 3:return!!j.setWinPosition;case 4:return!!j.setWinSizePixels;case 5:return!!j.raiseWin;case 6:return!!j.lowerWin;case 7:return!!j.refreshWin;case 8:return!!j.setWinSizeChars;case 9:return!!j.maximizeWin;case 10:return!!j.fullscreenWin;case 11:return!!j.getWinState;case 13:return!!j.getWinPosition;case 14:return!!j.getWinSizePixels;case 15:return!!j.getScreenSizePixels;case 16:return!!j.getCellSizePixels;case 18:return!!j.getWinSizeChars;case 19:return!!j.getScreenSizeChars;case 20:return!!j.getIconTitle;case 21:return!!j.getWinTitle;case 22:return!!j.pushTitle;case 23:return!!j.popTitle;case 24:return!!j.setWinLines}return!1}var Z;(function(ne){ne[ne.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",ne[ne.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(Z||(c.WindowsOptionsReportType=Z={}));let J=0;class ee extends O.Disposable{getAttrData(){return this._curAttrData}constructor(j,U,L,B,$,Y,re,he,V=new E.EscapeSequenceParser){super(),this._bufferService=j,this._charsetService=U,this._coreService=L,this._logService=B,this._optionsService=$,this._oscLinkService=Y,this._coreMouseService=re,this._unicodeService=he,this._parser=V,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new x.StringToUtf32,this._utf8Decoder=new x.Utf8ToUtf32,this._workCell=new v.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=m.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=m.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new p.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new p.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new p.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new p.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new p.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new p.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new p.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new p.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new p.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new p.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new p.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new p.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new p.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 F(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((H=>this._activeBuffer=H.activeBuffer))),this._parser.setCsiHandlerFallback(((H,ce)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(H),params:ce.toArray()})})),this._parser.setEscHandlerFallback((H=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(H)})})),this._parser.setExecuteHandlerFallback((H=>{this._logService.debug("Unknown EXECUTE code: ",{code:H})})),this._parser.setOscHandlerFallback(((H,ce,oe)=>{this._logService.debug("Unknown OSC code: ",{identifier:H,action:ce,data:oe})})),this._parser.setDcsHandlerFallback(((H,ce,oe)=>{ce==="HOOK"&&(oe=oe.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(H),action:ce,payload:oe})})),this._parser.setPrintHandler(((H,ce,oe)=>this.print(H,ce,oe))),this._parser.registerCsiHandler({final:"@"},(H=>this.insertChars(H))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(H=>this.scrollLeft(H))),this._parser.registerCsiHandler({final:"A"},(H=>this.cursorUp(H))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(H=>this.scrollRight(H))),this._parser.registerCsiHandler({final:"B"},(H=>this.cursorDown(H))),this._parser.registerCsiHandler({final:"C"},(H=>this.cursorForward(H))),this._parser.registerCsiHandler({final:"D"},(H=>this.cursorBackward(H))),this._parser.registerCsiHandler({final:"E"},(H=>this.cursorNextLine(H))),this._parser.registerCsiHandler({final:"F"},(H=>this.cursorPrecedingLine(H))),this._parser.registerCsiHandler({final:"G"},(H=>this.cursorCharAbsolute(H))),this._parser.registerCsiHandler({final:"H"},(H=>this.cursorPosition(H))),this._parser.registerCsiHandler({final:"I"},(H=>this.cursorForwardTab(H))),this._parser.registerCsiHandler({final:"J"},(H=>this.eraseInDisplay(H,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(H=>this.eraseInDisplay(H,!0))),this._parser.registerCsiHandler({final:"K"},(H=>this.eraseInLine(H,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(H=>this.eraseInLine(H,!0))),this._parser.registerCsiHandler({final:"L"},(H=>this.insertLines(H))),this._parser.registerCsiHandler({final:"M"},(H=>this.deleteLines(H))),this._parser.registerCsiHandler({final:"P"},(H=>this.deleteChars(H))),this._parser.registerCsiHandler({final:"S"},(H=>this.scrollUp(H))),this._parser.registerCsiHandler({final:"T"},(H=>this.scrollDown(H))),this._parser.registerCsiHandler({final:"X"},(H=>this.eraseChars(H))),this._parser.registerCsiHandler({final:"Z"},(H=>this.cursorBackwardTab(H))),this._parser.registerCsiHandler({final:"`"},(H=>this.charPosAbsolute(H))),this._parser.registerCsiHandler({final:"a"},(H=>this.hPositionRelative(H))),this._parser.registerCsiHandler({final:"b"},(H=>this.repeatPrecedingCharacter(H))),this._parser.registerCsiHandler({final:"c"},(H=>this.sendDeviceAttributesPrimary(H))),this._parser.registerCsiHandler({prefix:">",final:"c"},(H=>this.sendDeviceAttributesSecondary(H))),this._parser.registerCsiHandler({final:"d"},(H=>this.linePosAbsolute(H))),this._parser.registerCsiHandler({final:"e"},(H=>this.vPositionRelative(H))),this._parser.registerCsiHandler({final:"f"},(H=>this.hVPosition(H))),this._parser.registerCsiHandler({final:"g"},(H=>this.tabClear(H))),this._parser.registerCsiHandler({final:"h"},(H=>this.setMode(H))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(H=>this.setModePrivate(H))),this._parser.registerCsiHandler({final:"l"},(H=>this.resetMode(H))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(H=>this.resetModePrivate(H))),this._parser.registerCsiHandler({final:"m"},(H=>this.charAttributes(H))),this._parser.registerCsiHandler({final:"n"},(H=>this.deviceStatus(H))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(H=>this.deviceStatusPrivate(H))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(H=>this.softReset(H))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(H=>this.setCursorStyle(H))),this._parser.registerCsiHandler({final:"r"},(H=>this.setScrollRegion(H))),this._parser.registerCsiHandler({final:"s"},(H=>this.saveCursor(H))),this._parser.registerCsiHandler({final:"t"},(H=>this.windowOptions(H))),this._parser.registerCsiHandler({final:"u"},(H=>this.restoreCursor(H))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(H=>this.insertColumns(H))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(H=>this.deleteColumns(H))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(H=>this.selectProtected(H))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(H=>this.requestMode(H,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(H=>this.requestMode(H,!1))),this._parser.setExecuteHandler(d.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(d.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(d.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(d.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(d.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(d.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(d.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(d.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(d.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new M.OscHandler((H=>(this.setTitle(H),this.setIconName(H),!0)))),this._parser.registerOscHandler(1,new M.OscHandler((H=>this.setIconName(H)))),this._parser.registerOscHandler(2,new M.OscHandler((H=>this.setTitle(H)))),this._parser.registerOscHandler(4,new M.OscHandler((H=>this.setOrReportIndexedColor(H)))),this._parser.registerOscHandler(8,new M.OscHandler((H=>this.setHyperlink(H)))),this._parser.registerOscHandler(10,new M.OscHandler((H=>this.setOrReportFgColor(H)))),this._parser.registerOscHandler(11,new M.OscHandler((H=>this.setOrReportBgColor(H)))),this._parser.registerOscHandler(12,new M.OscHandler((H=>this.setOrReportCursorColor(H)))),this._parser.registerOscHandler(104,new M.OscHandler((H=>this.restoreIndexedColor(H)))),this._parser.registerOscHandler(110,new M.OscHandler((H=>this.restoreFgColor(H)))),this._parser.registerOscHandler(111,new M.OscHandler((H=>this.restoreBgColor(H)))),this._parser.registerOscHandler(112,new M.OscHandler((H=>this.restoreCursorColor(H)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const H in C.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:H},(()=>this.selectCharset("("+H))),this._parser.registerEscHandler({intermediates:")",final:H},(()=>this.selectCharset(")"+H))),this._parser.registerEscHandler({intermediates:"*",final:H},(()=>this.selectCharset("*"+H))),this._parser.registerEscHandler({intermediates:"+",final:H},(()=>this.selectCharset("+"+H))),this._parser.registerEscHandler({intermediates:"-",final:H},(()=>this.selectCharset("-"+H))),this._parser.registerEscHandler({intermediates:".",final:H},(()=>this.selectCharset("."+H))),this._parser.registerEscHandler({intermediates:"/",final:H},(()=>this.selectCharset("/"+H)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((H=>(this._logService.error("Parsing error: ",H),H))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new w.DcsHandler(((H,ce)=>this.requestStatusString(H,ce))))}_preserveStack(j,U,L,B){this._parseStack.paused=!0,this._parseStack.cursorStartX=j,this._parseStack.cursorStartY=U,this._parseStack.decodedLength=L,this._parseStack.position=B}_logSlowResolvingAsync(j){this._logService.logLevel<=R.LogLevelEnum.WARN&&Promise.race([j,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(j,U){let L,B=this._activeBuffer.x,$=this._activeBuffer.y,Y=0;const re=this._parseStack.paused;if(re){if(L=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,U))return this._logSlowResolvingAsync(L),L;B=this._parseStack.cursorStartX,$=this._parseStack.cursorStartY,this._parseStack.paused=!1,j.length>q&&(Y=this._parseStack.position+q)}if(this._logService.logLevel<=R.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof j=="string"?` "${j}"`:` "${Array.prototype.map.call(j,(H=>String.fromCharCode(H))).join("")}"`),typeof j=="string"?j.split("").map((H=>H.charCodeAt(0))):j),this._parseBuffer.length<j.length&&this._parseBuffer.length<q&&(this._parseBuffer=new Uint32Array(Math.min(j.length,q))),re||this._dirtyRowTracker.clearRange(),j.length>q)for(let H=Y;H<j.length;H+=q){const ce=H+q<j.length?H+q:j.length,oe=typeof j=="string"?this._stringDecoder.decode(j.substring(H,ce),this._parseBuffer):this._utf8Decoder.decode(j.subarray(H,ce),this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,oe))return this._preserveStack(B,$,oe,H),this._logSlowResolvingAsync(L),L}else if(!re){const H=typeof j=="string"?this._stringDecoder.decode(j,this._parseBuffer):this._utf8Decoder.decode(j,this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,H))return this._preserveStack(B,$,H,0),this._logSlowResolvingAsync(L),L}this._activeBuffer.x===B&&this._activeBuffer.y===$||this._onCursorMove.fire();const he=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),V=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);V<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(V,this._bufferService.rows-1),Math.min(he,this._bufferService.rows-1))}print(j,U,L){let B,$;const Y=this._charsetService.charset,re=this._optionsService.rawOptions.screenReaderMode,he=this._bufferService.cols,V=this._coreService.decPrivateModes.wraparound,H=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 me=this._parser.precedingJoinState;for(let _e=U;_e<L;++_e){if(B=j[_e],B<127&&Y){const ct=Y[String.fromCharCode(B)];ct&&(B=ct.charCodeAt(0))}const Te=this._unicodeService.charProperties(B,me);$=A.UnicodeService.extractWidth(Te);const je=A.UnicodeService.extractShouldJoin(Te),Ze=je?A.UnicodeService.extractWidth(me):0;if(me=Te,re&&this._onA11yChar.fire((0,x.stringFromCodePoint)(B)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+$-Ze>he){if(V){const ct=oe;let Ce=this._activeBuffer.x-Ze;for(this._activeBuffer.x=Ze,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),Ze>0&&oe instanceof m.BufferLine&&oe.copyCellsFrom(ct,Ce,0,Ze,!1);Ce<he;)ct.setCellFromCodepoint(Ce++,0,1,ce)}else if(this._activeBuffer.x=he-1,$===2)continue}if(je&&this._activeBuffer.x){const ct=oe.getWidth(this._activeBuffer.x-1)?1:2;oe.addCodepointToCell(this._activeBuffer.x-ct,B,$);for(let Ce=$-Ze;--Ce>=0;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,ce)}else if(H&&(oe.insertCells(this._activeBuffer.x,$-Ze,this._activeBuffer.getNullCell(ce)),oe.getWidth(he-1)===2&&oe.setCellFromCodepoint(he-1,f.NULL_CELL_CODE,f.NULL_CELL_WIDTH,ce)),oe.setCellFromCodepoint(this._activeBuffer.x++,B,$,ce),$>0)for(;--$;)oe.setCellFromCodepoint(this._activeBuffer.x++,0,0,ce)}this._parser.precedingJoinState=me,this._activeBuffer.x<he&&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(j,U){return j.final!=="t"||j.prefix||j.intermediates?this._parser.registerCsiHandler(j,U):this._parser.registerCsiHandler(j,(L=>!K(L.params[0],this._optionsService.rawOptions.windowOptions)||U(L)))}registerDcsHandler(j,U){return this._parser.registerDcsHandler(j,new w.DcsHandler(U))}registerEscHandler(j,U){return this._parser.registerEscHandler(j,U)}registerOscHandler(j,U){return this._parser.registerOscHandler(j,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 j;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&&((j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&j.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 j=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-j),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(j=this._bufferService.cols-1){this._activeBuffer.x=Math.min(j,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(j,U){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=j,this._activeBuffer.y=this._activeBuffer.scrollTop+U):(this._activeBuffer.x=j,this._activeBuffer.y=U),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(j,U){this._restrictCursor(),this._setCursor(this._activeBuffer.x+j,this._activeBuffer.y+U)}cursorUp(j){const U=this._activeBuffer.y-this._activeBuffer.scrollTop;return U>=0?this._moveCursor(0,-Math.min(U,j.params[0]||1)):this._moveCursor(0,-(j.params[0]||1)),!0}cursorDown(j){const U=this._activeBuffer.scrollBottom-this._activeBuffer.y;return U>=0?this._moveCursor(0,Math.min(U,j.params[0]||1)):this._moveCursor(0,j.params[0]||1),!0}cursorForward(j){return this._moveCursor(j.params[0]||1,0),!0}cursorBackward(j){return this._moveCursor(-(j.params[0]||1),0),!0}cursorNextLine(j){return this.cursorDown(j),this._activeBuffer.x=0,!0}cursorPrecedingLine(j){return this.cursorUp(j),this._activeBuffer.x=0,!0}cursorCharAbsolute(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(j){return this._setCursor(j.length>=2?(j.params[1]||1)-1:0,(j.params[0]||1)-1),!0}charPosAbsolute(j){return this._setCursor((j.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(j){return this._moveCursor(j.params[0]||1,0),!0}linePosAbsolute(j){return this._setCursor(this._activeBuffer.x,(j.params[0]||1)-1),!0}vPositionRelative(j){return this._moveCursor(0,j.params[0]||1),!0}hVPosition(j){return this.cursorPosition(j),!0}tabClear(j){const U=j.params[0];return U===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:U===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let U=j.params[0]||1;for(;U--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(j){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let U=j.params[0]||1;for(;U--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(j){const U=j.params[0];return U===1&&(this._curAttrData.bg|=536870912),U!==2&&U!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(j,U,L,B=!1,$=!1){const Y=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);Y.replaceCells(U,L,this._activeBuffer.getNullCell(this._eraseAttrData()),$),B&&(Y.isWrapped=!1)}_resetBufferLine(j,U=!1){const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+j);L&&(L.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),U),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+j),L.isWrapped=!1)}eraseInDisplay(j,U=!1){let L;switch(this._restrictCursor(this._bufferService.cols),j.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 B=this._activeBuffer.lines.length-this._bufferService.rows;B>0&&(this._activeBuffer.lines.trimStart(B),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-B,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-B,0),this._onScroll.fire(0))}return!0}eraseInLine(j,U=!1){switch(this._restrictCursor(this._bufferService.cols),j.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(j){this._restrictCursor();let U=j.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,B=this._bufferService.rows-1-this._activeBuffer.scrollBottom,$=this._bufferService.rows-1+this._activeBuffer.ybase-B+1;for(;U--;)this._activeBuffer.lines.splice($-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(j){this._restrictCursor();let U=j.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 B;for(B=this._bufferService.rows-1-this._activeBuffer.scrollBottom,B=this._bufferService.rows-1+this._activeBuffer.ybase-B;U--;)this._activeBuffer.lines.splice(L,1),this._activeBuffer.lines.splice(B,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(j){this._restrictCursor();const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return U&&(U.insertCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(j){this._restrictCursor();const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return U&&(U.deleteCells(this._activeBuffer.x,j.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(j){let U=j.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(j){let U=j.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(m.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=j.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);B.deleteCells(0,U,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=j.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);B.insertCells(0,U,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=j.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);B.insertCells(this._activeBuffer.x,U,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(j){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const U=j.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);B.deleteCells(this._activeBuffer.x,U,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(j){this._restrictCursor();const U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return U&&(U.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(j.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(j){const U=this._parser.precedingJoinState;if(!U)return!0;const L=j.params[0]||1,B=A.UnicodeService.extractWidth(U),$=this._activeBuffer.x-B,Y=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString($),re=new Uint32Array(Y.length*L);let he=0;for(let H=0;H<Y.length;){const ce=Y.codePointAt(H)||0;re[he++]=ce,H+=ce>65535?2:1}let V=he;for(let H=1;H<L;++H)re.copyWithin(V,0,he),V+=he;return this.print(re,0,V),!0}sendDeviceAttributesPrimary(j){return j.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(j){return j.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(j.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(j){return(this._optionsService.rawOptions.termName+"").indexOf(j)===0}setMode(j){for(let U=0;U<j.length;U++)switch(j.params[U]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(j){for(let U=0;U<j.length;U++)switch(j.params[U]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,C.DEFAULT_CHARSET),this._charsetService.setgCharset(1,C.DEFAULT_CHARSET),this._charsetService.setgCharset(2,C.DEFAULT_CHARSET),this._charsetService.setgCharset(3,C.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(j){for(let U=0;U<j.length;U++)switch(j.params[U]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(j){for(let U=0;U<j.length;U++)switch(j.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(),j.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(j,U){const L=this._coreService.decPrivateModes,{activeProtocol:B,activeEncoding:$}=this._coreMouseService,Y=this._coreService,{buffers:re,cols:he}=this._bufferService,{active:V,alt:H}=re,ce=this._optionsService.rawOptions,oe=je=>je?1:2,me=j.params[0];return _e=me,Te=U?me===2?4:me===4?oe(Y.modes.insertMode):me===12?3:me===20?oe(ce.convertEol):0:me===1?oe(L.applicationCursorKeys):me===3?ce.windowOptions.setWinLines?he===80?2:he===132?1:0:0:me===6?oe(L.origin):me===7?oe(L.wraparound):me===8?3:me===9?oe(B==="X10"):me===12?oe(ce.cursorBlink):me===25?oe(!Y.isCursorHidden):me===45?oe(L.reverseWraparound):me===66?oe(L.applicationKeypad):me===67?4:me===1e3?oe(B==="VT200"):me===1002?oe(B==="DRAG"):me===1003?oe(B==="ANY"):me===1004?oe(L.sendFocus):me===1005?4:me===1006?oe($==="SGR"):me===1015?4:me===1016?oe($==="SGR_PIXELS"):me===1048?1:me===47||me===1047||me===1049?oe(V===H):me===2004?oe(L.bracketedPasteMode):0,Y.triggerDataEvent(`${d.C0.ESC}[${U?"":"?"}${_e};${Te}$y`),!0;var _e,Te}_updateAttrColor(j,U,L,B,$){return U===2?(j|=50331648,j&=-16777216,j|=S.AttributeData.fromColorRGB([L,B,$])):U===5&&(j&=-50331904,j|=33554432|255&L),j}_extractColor(j,U,L){const B=[0,0,-1,0,0,0];let $=0,Y=0;do{if(B[Y+$]=j.params[U+Y],j.hasSubParams(U+Y)){const re=j.getSubParams(U+Y);let he=0;do B[1]===5&&($=1),B[Y+he+1+$]=re[he];while(++he<re.length&&he+Y+1+$<B.length);break}if(B[1]===5&&Y+$>=2||B[1]===2&&Y+$>=5)break;B[1]&&($=1)}while(++Y+U<j.length&&Y+$<B.length);for(let re=2;re<B.length;++re)B[re]===-1&&(B[re]=0);switch(B[0]){case 38:L.fg=this._updateAttrColor(L.fg,B[1],B[3],B[4],B[5]);break;case 48:L.bg=this._updateAttrColor(L.bg,B[1],B[3],B[4],B[5]);break;case 58:L.extended=L.extended.clone(),L.extended.underlineColor=this._updateAttrColor(L.extended.underlineColor,B[1],B[3],B[4],B[5])}return Y}_processUnderline(j,U){U.extended=U.extended.clone(),(!~j||j>5)&&(j=1),U.extended.underlineStyle=j,U.fg|=268435456,j===0&&(U.fg&=-268435457),U.updateExtended()}_processSGR0(j){j.fg=m.DEFAULT_ATTR_DATA.fg,j.bg=m.DEFAULT_ATTR_DATA.bg,j.extended=j.extended.clone(),j.extended.underlineStyle=0,j.extended.underlineColor&=-67108864,j.updateExtended()}charAttributes(j){if(j.length===1&&j.params[0]===0)return this._processSGR0(this._curAttrData),!0;const U=j.length;let L;const B=this._curAttrData;for(let $=0;$<U;$++)L=j.params[$],L>=30&&L<=37?(B.fg&=-50331904,B.fg|=16777216|L-30):L>=40&&L<=47?(B.bg&=-50331904,B.bg|=16777216|L-40):L>=90&&L<=97?(B.fg&=-50331904,B.fg|=16777224|L-90):L>=100&&L<=107?(B.bg&=-50331904,B.bg|=16777224|L-100):L===0?this._processSGR0(B):L===1?B.fg|=134217728:L===3?B.bg|=67108864:L===4?(B.fg|=268435456,this._processUnderline(j.hasSubParams($)?j.getSubParams($)[0]:1,B)):L===5?B.fg|=536870912:L===7?B.fg|=67108864:L===8?B.fg|=1073741824:L===9?B.fg|=2147483648:L===2?B.bg|=134217728:L===21?this._processUnderline(2,B):L===22?(B.fg&=-134217729,B.bg&=-134217729):L===23?B.bg&=-67108865:L===24?(B.fg&=-268435457,this._processUnderline(0,B)):L===25?B.fg&=-536870913:L===27?B.fg&=-67108865:L===28?B.fg&=-1073741825:L===29?B.fg&=2147483647:L===39?(B.fg&=-67108864,B.fg|=16777215&m.DEFAULT_ATTR_DATA.fg):L===49?(B.bg&=-67108864,B.bg|=16777215&m.DEFAULT_ATTR_DATA.bg):L===38||L===48||L===58?$+=this._extractColor(j,$,B):L===53?B.bg|=1073741824:L===55?B.bg&=-1073741825:L===59?(B.extended=B.extended.clone(),B.extended.underlineColor=-1,B.updateExtended()):L===100?(B.fg&=-67108864,B.fg|=16777215&m.DEFAULT_ATTR_DATA.fg,B.bg&=-67108864,B.bg|=16777215&m.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",L);return!0}deviceStatus(j){switch(j.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const U=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${U};${L}R`)}return!0}deviceStatusPrivate(j){if(j.params[0]===6){const U=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${U};${L}R`)}return!0}softReset(j){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=m.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(j){const U=j.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(j){const U=j.params[0]||1;let L;return(j.length<2||(L=j.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(j){if(!K(j.params[0],this._optionsService.rawOptions.windowOptions))return!0;const U=j.length>1?j.params[1]:0;switch(j.params[0]){case 14:U!==2&&this._onRequestWindowsOptionsReport.fire(Z.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(Z.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.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(j){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(j){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(j){return this._windowTitle=j,this._onTitleChange.fire(j),!0}setIconName(j){return this._iconName=j,!0}setOrReportIndexedColor(j){const U=[],L=j.split(";");for(;L.length>1;){const B=L.shift(),$=L.shift();if(/^\d+$/.exec(B)){const Y=parseInt(B);if(Q(Y))if($==="?")U.push({type:0,index:Y});else{const re=(0,N.parseColor)($);re&&U.push({type:1,index:Y,color:re})}}}return U.length&&this._onColor.fire(U),!0}setHyperlink(j){const U=j.split(";");return!(U.length<2)&&(U[1]?this._createHyperlink(U[0],U[1]):!U[0]&&this._finishHyperlink())}_createHyperlink(j,U){this._getCurrentLinkId()&&this._finishHyperlink();const L=j.split(":");let B;const $=L.findIndex((Y=>Y.startsWith("id=")));return $!==-1&&(B=L[$].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:B,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(j,U){const L=j.split(";");for(let B=0;B<L.length&&!(U>=this._specialColors.length);++B,++U)if(L[B]==="?")this._onColor.fire([{type:0,index:this._specialColors[U]}]);else{const $=(0,N.parseColor)(L[B]);$&&this._onColor.fire([{type:1,index:this._specialColors[U],color:$}])}return!0}setOrReportFgColor(j){return this._setOrReportSpecialColor(j,0)}setOrReportBgColor(j){return this._setOrReportSpecialColor(j,1)}setOrReportCursorColor(j){return this._setOrReportSpecialColor(j,2)}restoreIndexedColor(j){if(!j)return this._onColor.fire([{type:2}]),!0;const U=[],L=j.split(";");for(let B=0;B<L.length;++B)if(/^\d+$/.exec(L[B])){const $=parseInt(L[B]);Q($)&&U.push({type:2,index:$})}return U.length&&this._onColor.fire(U),!0}restoreFgColor(j){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(j){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(j){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,C.DEFAULT_CHARSET),!0}selectCharset(j){return j.length!==2?(this.selectDefaultCharset(),!0):(j[0]==="/"||this._charsetService.setgCharset(I[j[0]],C.CHARSETS[j[1]]||C.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 j=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,j,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=m.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=m.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(j){return this._charsetService.setgLevel(j),!0}screenAlignmentPattern(){const j=new v.CellData;j.content=4194373,j.fg=this._curAttrData.fg,j.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,B=this._activeBuffer.lines.get(L);B&&(B.fill(j),B.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(j,U){const L=this._bufferService.buffer,B=this._optionsService.rawOptions;return($=>(this._coreService.triggerDataEvent(`${d.C0.ESC}${$}${d.C0.ESC}\\`),!0))(j==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:j==='"p'?'P1$r61;1"p':j==="r"?`P1$r${L.scrollTop+1};${L.scrollBottom+1}r`:j==="m"?"P1$r0m":j===" q"?`P1$r${{block:2,underline:4,bar:6}[B.cursorStyle]-(B.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(j,U){this._dirtyRowTracker.markRangeDirty(j,U)}}c.InputHandler=ee;let F=class{constructor(ne){this._bufferService=ne,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(ne){ne<this.start?this.start=ne:ne>this.end&&(this.end=ne)}markRangeDirty(ne,j){ne>j&&(J=ne,ne=j,j=J),ne<this.start&&(this.start=ne),j>this.end&&(this.end=j)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Q(ne){return 0<=ne&&ne<256}F=h([y(0,R.IBufferService)],F)},844:(T,c)=>{function u(h){for(const y of h)y.dispose();h.length=0}Object.defineProperty(c,"__esModule",{value:!0}),c.getDisposeArrayDisposable=c.disposeArray=c.toDisposable=c.MutableDisposable=c.Disposable=void 0,c.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const y=this._disposables.indexOf(h);y!==-1&&this._disposables.splice(y,1)}},c.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){var y;this._isDisposed||h===this._value||((y=this._value)==null||y.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){var h;this._isDisposed=!0,(h=this._value)==null||h.dispose(),this._value=void 0}},c.toDisposable=function(h){return{dispose:h}},c.disposeArray=u,c.getDisposeArrayDisposable=function(h){return{dispose:()=>u(h)}}},1505:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.FourKeyMap=c.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(y,d,C){this._data[y]||(this._data[y]={}),this._data[y][d]=C}get(y,d){return this._data[y]?this._data[y][d]:void 0}clear(){this._data={}}}c.TwoKeyMap=u,c.FourKeyMap=class{constructor(){this._data=new u}set(h,y,d,C,E){this._data.get(h,y)||this._data.set(h,y,new u),this._data.get(h,y).set(d,C,E)}get(h,y,d,C){var E;return(E=this._data.get(h,y))==null?void 0:E.get(d,C)}clear(){this._data.clear()}}},6114:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.isChromeOS=c.isLinux=c.isWindows=c.isIphone=c.isIpad=c.isMac=c.getSafariVersion=c.isSafari=c.isLegacyEdge=c.isFirefox=c.isNode=void 0,c.isNode=typeof process<"u"&&"title"in process;const u=c.isNode?"node":navigator.userAgent,h=c.isNode?"node":navigator.platform;c.isFirefox=u.includes("Firefox"),c.isLegacyEdge=u.includes("Edge"),c.isSafari=/^((?!chrome|android).)*safari/i.test(u),c.getSafariVersion=function(){if(!c.isSafari)return 0;const y=u.match(/Version\/(\d+)/);return y===null||y.length<2?0:parseInt(y[1])},c.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),c.isIpad=h==="iPad",c.isIphone=h==="iPhone",c.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),c.isLinux=h.indexOf("Linux")>=0,c.isChromeOS=/\bCrOS\b/.test(u)},6106:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.SortedList=void 0;let u=0;c.SortedList=class{constructor(h){this._getKey=h,this._array=[]}clear(){this._array.length=0}insert(h){this._array.length!==0?(u=this._search(this._getKey(h)),this._array.splice(u,0,h)):this._array.push(h)}delete(h){if(this._array.length===0)return!1;const y=this._getKey(h);if(y===void 0||(u=this._search(y),u===-1)||this._getKey(this._array[u])!==y)return!1;do if(this._array[u]===h)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===y);return!1}*getKeyIterator(h){if(this._array.length!==0&&(u=this._search(h),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===h))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===h)}forEachByKey(h,y){if(this._array.length!==0&&(u=this._search(h),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===h))do y(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===h)}values(){return[...this._array].values()}_search(h){let y=0,d=this._array.length-1;for(;d>=y;){let C=y+d>>1;const E=this._getKey(this._array[C]);if(E>h)d=C-1;else{if(!(E<h)){for(;C>0&&this._getKey(this._array[C-1])===h;)C--;return C}y=C+1}}return y}}},7226:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DebouncedIdleTask=c.IdleTaskQueue=c.PriorityTaskQueue=void 0;const h=u(6114);class y{constructor(){this._tasks=[],this._i=0}enqueue(E){this._tasks.push(E),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(E){this._idleCallback=void 0;let O=0,x=0,m=E.timeRemaining(),p=0;for(;this._i<this._tasks.length;){if(O=Date.now(),this._tasks[this._i]()||this._i++,O=Math.max(1,Date.now()-O),x=Math.max(O,x),p=E.timeRemaining(),1.5*x>p)return m-O<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(m-O))}ms`),void this._start();m=p}this.clear()}}class d extends y{_requestCallback(E){return setTimeout((()=>E(this._createDeadline(16))))}_cancelCallback(E){clearTimeout(E)}_createDeadline(E){const O=Date.now()+E;return{timeRemaining:()=>Math.max(0,O-Date.now())}}}c.PriorityTaskQueue=d,c.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends y{_requestCallback(C){return requestIdleCallback(C)}_cancelCallback(C){cancelIdleCallback(C)}}:d,c.DebouncedIdleTask=class{constructor(){this._queue=new c.IdleTaskQueue}set(C){this._queue.clear(),this._queue.enqueue(C)}flush(){this._queue.flush()}}},9282:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.updateWindowsModeWrappedState=void 0;const h=u(643);c.updateWindowsModeWrappedState=function(y){const d=y.buffer.lines.get(y.buffer.ybase+y.buffer.y-1),C=d==null?void 0:d.get(y.cols-1),E=y.buffer.lines.get(y.buffer.ybase+y.buffer.y);E&&C&&(E.isWrapped=C[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&C[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ExtendedAttrs=c.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new u;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}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}}c.AttributeData=u;class h{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}get underlineVariantOffset(){const d=(3758096384&this._ext)>>29;return d<0?4294967288^d:d}set underlineVariantOffset(d){this._ext&=536870911,this._ext|=d<<29&3758096384}constructor(d=0,C=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=C}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}c.ExtendedAttrs=h},9092:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Buffer=c.MAX_BUFFER_SIZE=void 0;const h=u(6349),y=u(7226),d=u(3734),C=u(8437),E=u(4634),O=u(511),x=u(643),m=u(4863),p=u(7116);c.MAX_BUFFER_SIZE=4294967295,c.Buffer=class{constructor(f,v,S){this._hasScrollback=f,this._optionsService=v,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=C.DEFAULT_ATTR_DATA.clone(),this.savedCharset=p.DEFAULT_CHARSET,this.markers=[],this._nullCell=O.CellData.fromCharData([0,x.NULL_CELL_CHAR,x.NULL_CELL_WIDTH,x.NULL_CELL_CODE]),this._whitespaceCell=O.CellData.fromCharData([0,x.WHITESPACE_CELL_CHAR,x.WHITESPACE_CELL_WIDTH,x.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 h.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 d.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 d.ExtendedAttrs),this._whitespaceCell}getBlankLine(f,v){return new C.BufferLine(this._bufferService.cols,this.getNullCell(f),v)}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 v=f+this._optionsService.rawOptions.scrollback;return v>c.MAX_BUFFER_SIZE?c.MAX_BUFFER_SIZE:v}fillViewportRows(f){if(this.lines.length===0){f===void 0&&(f=C.DEFAULT_ATTR_DATA);let v=this._rows;for(;v--;)this.lines.push(this.getBlankLine(f))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(f,v){const S=this.getNullCell(C.DEFAULT_ATTR_DATA);let R=0;const A=this._getCorrectBufferLength(v);if(A>this.lines.maxLength&&(this.lines.maxLength=A),this.lines.length>0){if(this._cols<f)for(let w=0;w<this.lines.length;w++)R+=+this.lines.get(w).resize(f,S);let M=0;if(this._rows<v)for(let w=this._rows;w<v;w++)this.lines.length<v+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new C.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 C.BufferLine(f,S)));else for(let w=this._rows;w>v;w--)this.lines.length>v+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(A<this.lines.maxLength){const w=this.lines.length-A;w>0&&(this.lines.trimStart(w),this.ybase=Math.max(this.ybase-w,0),this.ydisp=Math.max(this.ydisp-w,0),this.savedY=Math.max(this.savedY-w,0)),this.lines.maxLength=A}this.x=Math.min(this.x,f-1),this.y=Math.min(this.y,v-1),M&&(this.y+=M),this.savedX=Math.min(this.savedX,f-1),this.scrollTop=0}if(this.scrollBottom=v-1,this._isReflowEnabled&&(this._reflow(f,v),this._cols>f))for(let M=0;M<this.lines.length;M++)R+=+this.lines.get(M).resize(f,S);this._cols=f,this._rows=v,this._memoryCleanupQueue.clear(),R>.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 v=0;for(;this._memoryCleanupPosition<this.lines.length;)if(v+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),v>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,v){this._cols!==f&&(f>this._cols?this._reflowLarger(f,v):this._reflowSmaller(f,v))}_reflowLarger(f,v){const S=(0,E.reflowLargerGetLinesToRemove)(this.lines,this._cols,f,this.ybase+this.y,this.getNullCell(C.DEFAULT_ATTR_DATA));if(S.length>0){const R=(0,E.reflowLargerCreateNewLayout)(this.lines,S);(0,E.reflowLargerApplyNewLayout)(this.lines,R.layout),this._reflowLargerAdjustViewport(f,v,R.countRemoved)}}_reflowLargerAdjustViewport(f,v,S){const R=this.getNullCell(C.DEFAULT_ATTR_DATA);let A=S;for(;A-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<v&&this.lines.push(new C.BufferLine(f,R))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-S,0)}_reflowSmaller(f,v){const S=this.getNullCell(C.DEFAULT_ATTR_DATA),R=[];let A=0;for(let M=this.lines.length-1;M>=0;M--){let w=this.lines.get(M);if(!w||!w.isWrapped&&w.getTrimmedLength()<=f)continue;const N=[w];for(;w.isWrapped&&M>0;)w=this.lines.get(--M),N.unshift(w);const I=this.ybase+this.y;if(I>=M&&I<M+N.length)continue;const q=N[N.length-1].getTrimmedLength(),K=(0,E.reflowSmallerGetNewLineLengths)(N,this._cols,f),Z=K.length-N.length;let J;J=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+Z):Math.max(0,this.lines.length-this.lines.maxLength+Z);const ee=[];for(let L=0;L<Z;L++){const B=this.getBlankLine(C.DEFAULT_ATTR_DATA,!0);ee.push(B)}ee.length>0&&(R.push({start:M+N.length+A,newLines:ee}),A+=ee.length),N.push(...ee);let F=K.length-1,Q=K[F];Q===0&&(F--,Q=K[F]);let ne=N.length-Z-1,j=q;for(;ne>=0;){const L=Math.min(j,Q);if(N[F]===void 0)break;if(N[F].copyCellsFrom(N[ne],j-L,Q-L,L,!0),Q-=L,Q===0&&(F--,Q=K[F]),j-=L,j===0){ne--;const B=Math.max(ne,0);j=(0,E.getWrappedLineTrimmedLength)(N,B,this._cols)}}for(let L=0;L<N.length;L++)K[L]<f&&N[L].setCell(K[L],S);let U=Z-J;for(;U-- >0;)this.ybase===0?this.y<v-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+A)-v&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+Z,this.ybase+v-1)}if(R.length>0){const M=[],w=[];for(let F=0;F<this.lines.length;F++)w.push(this.lines.get(F));const N=this.lines.length;let I=N-1,q=0,K=R[q];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+A);let Z=0;for(let F=Math.min(this.lines.maxLength-1,N+A-1);F>=0;F--)if(K&&K.start>I+Z){for(let Q=K.newLines.length-1;Q>=0;Q--)this.lines.set(F--,K.newLines[Q]);F++,M.push({index:I+1,amount:K.newLines.length}),Z+=K.newLines.length,K=R[++q]}else this.lines.set(F,w[I--]);let J=0;for(let F=M.length-1;F>=0;F--)M[F].index+=J,this.lines.onInsertEmitter.fire(M[F]),J+=M[F].amount;const ee=Math.max(0,N+A-this.lines.maxLength);ee>0&&this.lines.onTrimEmitter.fire(ee)}}translateBufferLineToString(f,v,S=0,R){const A=this.lines.get(f);return A?A.translateToString(v,S,R):""}getWrappedRangeForLine(f){let v=f,S=f;for(;v>0&&this.lines.get(v).isWrapped;)v--;for(;S+1<this.lines.length&&this.lines.get(S+1).isWrapped;)S++;return{first:v,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 v=0;v<this.markers.length;v++)this.markers[v].line===f&&(this.markers[v].dispose(),this.markers.splice(v--,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 v=new m.Marker(f);return this.markers.push(v),v.register(this.lines.onTrim((S=>{v.line-=S,v.line<0&&v.dispose()}))),v.register(this.lines.onInsert((S=>{v.line>=S.index&&(v.line+=S.amount)}))),v.register(this.lines.onDelete((S=>{v.line>=S.index&&v.line<S.index+S.amount&&v.dispose(),v.line>S.index&&(v.line-=S.amount)}))),v.register(v.onDispose((()=>this._removeMarker(v)))),v}_removeMarker(f){this._isClearing||this.markers.splice(this.markers.indexOf(f),1)}}},8437:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLine=c.DEFAULT_ATTR_DATA=void 0;const h=u(3734),y=u(511),d=u(643),C=u(482);c.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let E=0;class O{constructor(m,p,f=!1){this.isWrapped=f,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*m);const v=p||y.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let S=0;S<m;++S)this.setCell(S,v);this.length=m}get(m){const p=this._data[3*m+0],f=2097151&p;return[this._data[3*m+1],2097152&p?this._combined[m]:f?(0,C.stringFromCodePoint)(f):"",p>>22,2097152&p?this._combined[m].charCodeAt(this._combined[m].length-1):f]}set(m,p){this._data[3*m+1]=p[d.CHAR_DATA_ATTR_INDEX],p[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[m]=p[1],this._data[3*m+0]=2097152|m|p[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*m+0]=p[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|p[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(m){return this._data[3*m+0]>>22}hasWidth(m){return 12582912&this._data[3*m+0]}getFg(m){return this._data[3*m+1]}getBg(m){return this._data[3*m+2]}hasContent(m){return 4194303&this._data[3*m+0]}getCodePoint(m){const p=this._data[3*m+0];return 2097152&p?this._combined[m].charCodeAt(this._combined[m].length-1):2097151&p}isCombined(m){return 2097152&this._data[3*m+0]}getString(m){const p=this._data[3*m+0];return 2097152&p?this._combined[m]:2097151&p?(0,C.stringFromCodePoint)(2097151&p):""}isProtected(m){return 536870912&this._data[3*m+2]}loadCell(m,p){return E=3*m,p.content=this._data[E+0],p.fg=this._data[E+1],p.bg=this._data[E+2],2097152&p.content&&(p.combinedData=this._combined[m]),268435456&p.bg&&(p.extended=this._extendedAttrs[m]),p}setCell(m,p){2097152&p.content&&(this._combined[m]=p.combinedData),268435456&p.bg&&(this._extendedAttrs[m]=p.extended),this._data[3*m+0]=p.content,this._data[3*m+1]=p.fg,this._data[3*m+2]=p.bg}setCellFromCodepoint(m,p,f,v){268435456&v.bg&&(this._extendedAttrs[m]=v.extended),this._data[3*m+0]=p|f<<22,this._data[3*m+1]=v.fg,this._data[3*m+2]=v.bg}addCodepointToCell(m,p,f){let v=this._data[3*m+0];2097152&v?this._combined[m]+=(0,C.stringFromCodePoint)(p):2097151&v?(this._combined[m]=(0,C.stringFromCodePoint)(2097151&v)+(0,C.stringFromCodePoint)(p),v&=-2097152,v|=2097152):v=p|4194304,f&&(v&=-12582913,v|=f<<22),this._data[3*m+0]=v}insertCells(m,p,f){if((m%=this.length)&&this.getWidth(m-1)===2&&this.setCellFromCodepoint(m-1,0,1,f),p<this.length-m){const v=new y.CellData;for(let S=this.length-m-p-1;S>=0;--S)this.setCell(m+p+S,this.loadCell(m+S,v));for(let S=0;S<p;++S)this.setCell(m+S,f)}else for(let v=m;v<this.length;++v)this.setCell(v,f);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,f)}deleteCells(m,p,f){if(m%=this.length,p<this.length-m){const v=new y.CellData;for(let S=0;S<this.length-m-p;++S)this.setCell(m+S,this.loadCell(m+p+S,v));for(let S=this.length-p;S<this.length;++S)this.setCell(S,f)}else for(let v=m;v<this.length;++v)this.setCell(v,f);m&&this.getWidth(m-1)===2&&this.setCellFromCodepoint(m-1,0,1,f),this.getWidth(m)!==0||this.hasContent(m)||this.setCellFromCodepoint(m,0,1,f)}replaceCells(m,p,f,v=!1){if(v)for(m&&this.getWidth(m-1)===2&&!this.isProtected(m-1)&&this.setCellFromCodepoint(m-1,0,1,f),p<this.length&&this.getWidth(p-1)===2&&!this.isProtected(p)&&this.setCellFromCodepoint(p,0,1,f);m<p&&m<this.length;)this.isProtected(m)||this.setCell(m,f),m++;else for(m&&this.getWidth(m-1)===2&&this.setCellFromCodepoint(m-1,0,1,f),p<this.length&&this.getWidth(p-1)===2&&this.setCellFromCodepoint(p,0,1,f);m<p&&m<this.length;)this.setCell(m++,f)}resize(m,p){if(m===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const f=3*m;if(m>this.length){if(this._data.buffer.byteLength>=4*f)this._data=new Uint32Array(this._data.buffer,0,f);else{const v=new Uint32Array(f);v.set(this._data),this._data=v}for(let v=this.length;v<m;++v)this.setCell(v,p)}else{this._data=this._data.subarray(0,f);const v=Object.keys(this._combined);for(let R=0;R<v.length;R++){const A=parseInt(v[R],10);A>=m&&delete this._combined[A]}const S=Object.keys(this._extendedAttrs);for(let R=0;R<S.length;R++){const A=parseInt(S[R],10);A>=m&&delete this._extendedAttrs[A]}}return this.length=m,4*f*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const m=new Uint32Array(this._data.length);return m.set(this._data),this._data=m,1}return 0}fill(m,p=!1){if(p)for(let f=0;f<this.length;++f)this.isProtected(f)||this.setCell(f,m);else{this._combined={},this._extendedAttrs={};for(let f=0;f<this.length;++f)this.setCell(f,m)}}copyFrom(m){this.length!==m.length?this._data=new Uint32Array(m._data):this._data.set(m._data),this.length=m.length,this._combined={};for(const p in m._combined)this._combined[p]=m._combined[p];this._extendedAttrs={};for(const p in m._extendedAttrs)this._extendedAttrs[p]=m._extendedAttrs[p];this.isWrapped=m.isWrapped}clone(){const m=new O(0);m._data=new Uint32Array(this._data),m.length=this.length;for(const p in this._combined)m._combined[p]=this._combined[p];for(const p in this._extendedAttrs)m._extendedAttrs[p]=this._extendedAttrs[p];return m.isWrapped=this.isWrapped,m}getTrimmedLength(){for(let m=this.length-1;m>=0;--m)if(4194303&this._data[3*m+0])return m+(this._data[3*m+0]>>22);return 0}getNoBgTrimmedLength(){for(let m=this.length-1;m>=0;--m)if(4194303&this._data[3*m+0]||50331648&this._data[3*m+2])return m+(this._data[3*m+0]>>22);return 0}copyCellsFrom(m,p,f,v,S){const R=m._data;if(S)for(let M=v-1;M>=0;M--){for(let w=0;w<3;w++)this._data[3*(f+M)+w]=R[3*(p+M)+w];268435456&R[3*(p+M)+2]&&(this._extendedAttrs[f+M]=m._extendedAttrs[p+M])}else for(let M=0;M<v;M++){for(let w=0;w<3;w++)this._data[3*(f+M)+w]=R[3*(p+M)+w];268435456&R[3*(p+M)+2]&&(this._extendedAttrs[f+M]=m._extendedAttrs[p+M])}const A=Object.keys(m._combined);for(let M=0;M<A.length;M++){const w=parseInt(A[M],10);w>=p&&(this._combined[w-p+f]=m._combined[w])}}translateToString(m,p,f,v){p=p??0,f=f??this.length,m&&(f=Math.min(f,this.getTrimmedLength())),v&&(v.length=0);let S="";for(;p<f;){const R=this._data[3*p+0],A=2097151&R,M=2097152&R?this._combined[p]:A?(0,C.stringFromCodePoint)(A):d.WHITESPACE_CELL_CHAR;if(S+=M,v)for(let w=0;w<M.length;++w)v.push(p);p+=R>>22||1}return v&&v.push(p),S}}c.BufferLine=O},4841:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.getRangeLength=void 0,c.getRangeLength=function(u,h){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return h*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(T,c)=>{function u(h,y,d){if(y===h.length-1)return h[y].getTrimmedLength();const C=!h[y].hasContent(d-1)&&h[y].getWidth(d-1)===1,E=h[y+1].getWidth(0)===2;return C&&E?d-1:d}Object.defineProperty(c,"__esModule",{value:!0}),c.getWrappedLineTrimmedLength=c.reflowSmallerGetNewLineLengths=c.reflowLargerApplyNewLayout=c.reflowLargerCreateNewLayout=c.reflowLargerGetLinesToRemove=void 0,c.reflowLargerGetLinesToRemove=function(h,y,d,C,E){const O=[];for(let x=0;x<h.length-1;x++){let m=x,p=h.get(++m);if(!p.isWrapped)continue;const f=[h.get(x)];for(;m<h.length&&p.isWrapped;)f.push(p),p=h.get(++m);if(C>=x&&C<m){x+=f.length-1;continue}let v=0,S=u(f,v,y),R=1,A=0;for(;R<f.length;){const w=u(f,R,y),N=w-A,I=d-S,q=Math.min(N,I);f[v].copyCellsFrom(f[R],A,S,q,!1),S+=q,S===d&&(v++,S=0),A+=q,A===w&&(R++,A=0),S===0&&v!==0&&f[v-1].getWidth(d-1)===2&&(f[v].copyCellsFrom(f[v-1],d-1,S++,1,!1),f[v-1].setCell(d-1,E))}f[v].replaceCells(S,d,E);let M=0;for(let w=f.length-1;w>0&&(w>v||f[w].getTrimmedLength()===0);w--)M++;M>0&&(O.push(x+f.length-M),O.push(M)),x+=f.length-1}return O},c.reflowLargerCreateNewLayout=function(h,y){const d=[];let C=0,E=y[C],O=0;for(let x=0;x<h.length;x++)if(E===x){const m=y[++C];h.onDeleteEmitter.fire({index:x-O,amount:m}),x+=m-1,O+=m,E=y[++C]}else d.push(x);return{layout:d,countRemoved:O}},c.reflowLargerApplyNewLayout=function(h,y){const d=[];for(let C=0;C<y.length;C++)d.push(h.get(y[C]));for(let C=0;C<d.length;C++)h.set(C,d[C]);h.length=y.length},c.reflowSmallerGetNewLineLengths=function(h,y,d){const C=[],E=h.map(((p,f)=>u(h,f,y))).reduce(((p,f)=>p+f));let O=0,x=0,m=0;for(;m<E;){if(E-m<d){C.push(E-m);break}O+=d;const p=u(h,x,y);O>p&&(O-=p,x++);const f=h[x].getWidth(O-1)===2;f&&O--;const v=f?d-1:d;C.push(v),m+=v}return C},c.getWrappedLineTrimmedLength=u},5295:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferSet=void 0;const h=u(8460),y=u(844),d=u(9092);class C extends y.Disposable{constructor(O,x){super(),this._optionsService=O,this._bufferService=x,this._onBufferActivate=this.register(new h.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 d.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new d.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(O){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(O),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(O,x){this._normal.resize(O,x),this._alt.resize(O,x),this.setupTabStops(O)}setupTabStops(O){this._normal.setupTabStops(O),this._alt.setupTabStops(O)}}c.BufferSet=C},511:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CellData=void 0;const h=u(482),y=u(643),d=u(3734);class C extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(O){const x=new C;return x.setFromCharData(O),x}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,h.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(O){this.fg=O[y.CHAR_DATA_ATTR_INDEX],this.bg=0;let x=!1;if(O[y.CHAR_DATA_CHAR_INDEX].length>2)x=!0;else if(O[y.CHAR_DATA_CHAR_INDEX].length===2){const m=O[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=m&&m<=56319){const p=O[y.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=p&&p<=57343?this.content=1024*(m-55296)+p-56320+65536|O[y.CHAR_DATA_WIDTH_INDEX]<<22:x=!0}else x=!0}else this.content=O[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|O[y.CHAR_DATA_WIDTH_INDEX]<<22;x&&(this.combinedData=O[y.CHAR_DATA_CHAR_INDEX],this.content=2097152|O[y.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}c.CellData=C},643:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WHITESPACE_CELL_CODE=c.WHITESPACE_CELL_WIDTH=c.WHITESPACE_CELL_CHAR=c.NULL_CELL_CODE=c.NULL_CELL_WIDTH=c.NULL_CELL_CHAR=c.CHAR_DATA_CODE_INDEX=c.CHAR_DATA_WIDTH_INDEX=c.CHAR_DATA_CHAR_INDEX=c.CHAR_DATA_ATTR_INDEX=c.DEFAULT_EXT=c.DEFAULT_ATTR=c.DEFAULT_COLOR=void 0,c.DEFAULT_COLOR=0,c.DEFAULT_ATTR=256|c.DEFAULT_COLOR<<9,c.DEFAULT_EXT=0,c.CHAR_DATA_ATTR_INDEX=0,c.CHAR_DATA_CHAR_INDEX=1,c.CHAR_DATA_WIDTH_INDEX=2,c.CHAR_DATA_CODE_INDEX=3,c.NULL_CELL_CHAR="",c.NULL_CELL_WIDTH=1,c.NULL_CELL_CODE=0,c.WHITESPACE_CELL_CHAR=" ",c.WHITESPACE_CELL_WIDTH=1,c.WHITESPACE_CELL_CODE=32},4863:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Marker=void 0;const h=u(8460),y=u(844);class d{get id(){return this._id}constructor(E){this.line=E,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new h.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(E){return this._disposables.push(E),E}}c.Marker=d,d._nextId=1},7116:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DEFAULT_CHARSET=c.CHARSETS=void 0,c.CHARSETS={},c.DEFAULT_CHARSET=c.CHARSETS.B,c.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:"≥","{":"π","|":"≠","}":"£","~":"·"},c.CHARSETS.A={"#":"£"},c.CHARSETS.B=void 0,c.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},c.CHARSETS.C=c.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},c.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},c.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},c.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},c.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},c.CHARSETS.E=c.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},c.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},c.CHARSETS.H=c.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},c.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(T,c)=>{var u,h,y;Object.defineProperty(c,"__esModule",{value:!0}),c.C1_ESCAPED=c.C1=c.C0=void 0,(function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT=" ",d.LF=`
|
|
300
|
+
`,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""})(u||(c.C0=u={})),(function(d){d.PAD="",d.HOP="",d.BPH="",d.NBH="",d.IND="",d.NEL="
",d.SSA="",d.ESA="",d.HTS="",d.HTJ="",d.VTS="",d.PLD="",d.PLU="",d.RI="",d.SS2="",d.SS3="",d.DCS="",d.PU1="",d.PU2="",d.STS="",d.CCH="",d.MW="",d.SPA="",d.EPA="",d.SOS="",d.SGCI="",d.SCI="",d.CSI="",d.ST="",d.OSC="",d.PM="",d.APC=""})(h||(c.C1=h={})),(function(d){d.ST=`${u.ESC}\\`})(y||(c.C1_ESCAPED=y={}))},7399:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.evaluateKeyboardEvent=void 0;const h=u(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:["'",'"']};c.evaluateKeyboardEvent=function(d,C,E,O){const x={type:0,cancel:!1,key:void 0},m=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?x.key=C?h.C0.ESC+"OA":h.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?x.key=C?h.C0.ESC+"OD":h.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?x.key=C?h.C0.ESC+"OC":h.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(x.key=C?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:x.key=d.ctrlKey?"\b":h.C0.DEL,d.altKey&&(x.key=h.C0.ESC+x.key);break;case 9:if(d.shiftKey){x.key=h.C0.ESC+"[Z";break}x.key=h.C0.HT,x.cancel=!0;break;case 13:x.key=d.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,x.cancel=!0;break;case 27:x.key=h.C0.ESC,d.altKey&&(x.key=h.C0.ESC+h.C0.ESC),x.cancel=!0;break;case 37:if(d.metaKey)break;m?(x.key=h.C0.ESC+"[1;"+(m+1)+"D",x.key===h.C0.ESC+"[1;3D"&&(x.key=h.C0.ESC+(E?"b":"[1;5D"))):x.key=C?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(d.metaKey)break;m?(x.key=h.C0.ESC+"[1;"+(m+1)+"C",x.key===h.C0.ESC+"[1;3C"&&(x.key=h.C0.ESC+(E?"f":"[1;5C"))):x.key=C?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(d.metaKey)break;m?(x.key=h.C0.ESC+"[1;"+(m+1)+"A",E||x.key!==h.C0.ESC+"[1;3A"||(x.key=h.C0.ESC+"[1;5A")):x.key=C?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(d.metaKey)break;m?(x.key=h.C0.ESC+"[1;"+(m+1)+"B",E||x.key!==h.C0.ESC+"[1;3B"||(x.key=h.C0.ESC+"[1;5B")):x.key=C?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(x.key=h.C0.ESC+"[2~");break;case 46:x.key=m?h.C0.ESC+"[3;"+(m+1)+"~":h.C0.ESC+"[3~";break;case 36:x.key=m?h.C0.ESC+"[1;"+(m+1)+"H":C?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:x.key=m?h.C0.ESC+"[1;"+(m+1)+"F":C?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:d.shiftKey?x.type=2:d.ctrlKey?x.key=h.C0.ESC+"[5;"+(m+1)+"~":x.key=h.C0.ESC+"[5~";break;case 34:d.shiftKey?x.type=3:d.ctrlKey?x.key=h.C0.ESC+"[6;"+(m+1)+"~":x.key=h.C0.ESC+"[6~";break;case 112:x.key=m?h.C0.ESC+"[1;"+(m+1)+"P":h.C0.ESC+"OP";break;case 113:x.key=m?h.C0.ESC+"[1;"+(m+1)+"Q":h.C0.ESC+"OQ";break;case 114:x.key=m?h.C0.ESC+"[1;"+(m+1)+"R":h.C0.ESC+"OR";break;case 115:x.key=m?h.C0.ESC+"[1;"+(m+1)+"S":h.C0.ESC+"OS";break;case 116:x.key=m?h.C0.ESC+"[15;"+(m+1)+"~":h.C0.ESC+"[15~";break;case 117:x.key=m?h.C0.ESC+"[17;"+(m+1)+"~":h.C0.ESC+"[17~";break;case 118:x.key=m?h.C0.ESC+"[18;"+(m+1)+"~":h.C0.ESC+"[18~";break;case 119:x.key=m?h.C0.ESC+"[19;"+(m+1)+"~":h.C0.ESC+"[19~";break;case 120:x.key=m?h.C0.ESC+"[20;"+(m+1)+"~":h.C0.ESC+"[20~";break;case 121:x.key=m?h.C0.ESC+"[21;"+(m+1)+"~":h.C0.ESC+"[21~";break;case 122:x.key=m?h.C0.ESC+"[23;"+(m+1)+"~":h.C0.ESC+"[23~";break;case 123:x.key=m?h.C0.ESC+"[24;"+(m+1)+"~":h.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(E&&!O||!d.altKey||d.metaKey)!E||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?x.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(x.key=h.C0.US),d.key==="@"&&(x.key=h.C0.NUL)):d.keyCode===65&&(x.type=1);else{const p=y[d.keyCode],f=p==null?void 0:p[d.shiftKey?1:0];if(f)x.key=h.C0.ESC+f;else if(d.keyCode>=65&&d.keyCode<=90){const v=d.ctrlKey?d.keyCode-64:d.keyCode+32;let S=String.fromCharCode(v);d.shiftKey&&(S=S.toUpperCase()),x.key=h.C0.ESC+S}else if(d.keyCode===32)x.key=h.C0.ESC+(d.ctrlKey?h.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let v=d.code.slice(3,4);d.shiftKey||(v=v.toLowerCase()),x.key=h.C0.ESC+v,x.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?x.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?x.key=h.C0.NUL:d.keyCode>=51&&d.keyCode<=55?x.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?x.key=h.C0.DEL:d.keyCode===219?x.key=h.C0.ESC:d.keyCode===220?x.key=h.C0.FS:d.keyCode===221&&(x.key=h.C0.GS)}return x}},482:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Utf8ToUtf32=c.StringToUtf32=c.utf32ToString=c.stringFromCodePoint=void 0,c.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},c.utf32ToString=function(u,h=0,y=u.length){let d="";for(let C=h;C<y;++C){let E=u[C];E>65535?(E-=65536,d+=String.fromCharCode(55296+(E>>10))+String.fromCharCode(E%1024+56320)):d+=String.fromCharCode(E)}return d},c.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,h){const y=u.length;if(!y)return 0;let d=0,C=0;if(this._interim){const E=u.charCodeAt(C++);56320<=E&&E<=57343?h[d++]=1024*(this._interim-55296)+E-56320+65536:(h[d++]=this._interim,h[d++]=E),this._interim=0}for(let E=C;E<y;++E){const O=u.charCodeAt(E);if(55296<=O&&O<=56319){if(++E>=y)return this._interim=O,d;const x=u.charCodeAt(E);56320<=x&&x<=57343?h[d++]=1024*(O-55296)+x-56320+65536:(h[d++]=O,h[d++]=x)}else O!==65279&&(h[d++]=O)}return d}},c.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,h){const y=u.length;if(!y)return 0;let d,C,E,O,x=0,m=0,p=0;if(this.interim[0]){let S=!1,R=this.interim[0];R&=(224&R)==192?31:(240&R)==224?15:7;let A,M=0;for(;(A=63&this.interim[++M])&&M<4;)R<<=6,R|=A;const w=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,N=w-M;for(;p<N;){if(p>=y)return 0;if(A=u[p++],(192&A)!=128){p--,S=!0;break}this.interim[M++]=A,R<<=6,R|=63&A}S||(w===2?R<128?p--:h[x++]=R:w===3?R<2048||R>=55296&&R<=57343||R===65279||(h[x++]=R):R<65536||R>1114111||(h[x++]=R)),this.interim.fill(0)}const f=y-4;let v=p;for(;v<y;){for(;!(!(v<f)||128&(d=u[v])||128&(C=u[v+1])||128&(E=u[v+2])||128&(O=u[v+3]));)h[x++]=d,h[x++]=C,h[x++]=E,h[x++]=O,v+=4;if(d=u[v++],d<128)h[x++]=d;else if((224&d)==192){if(v>=y)return this.interim[0]=d,x;if(C=u[v++],(192&C)!=128){v--;continue}if(m=(31&d)<<6|63&C,m<128){v--;continue}h[x++]=m}else if((240&d)==224){if(v>=y)return this.interim[0]=d,x;if(C=u[v++],(192&C)!=128){v--;continue}if(v>=y)return this.interim[0]=d,this.interim[1]=C,x;if(E=u[v++],(192&E)!=128){v--;continue}if(m=(15&d)<<12|(63&C)<<6|63&E,m<2048||m>=55296&&m<=57343||m===65279)continue;h[x++]=m}else if((248&d)==240){if(v>=y)return this.interim[0]=d,x;if(C=u[v++],(192&C)!=128){v--;continue}if(v>=y)return this.interim[0]=d,this.interim[1]=C,x;if(E=u[v++],(192&E)!=128){v--;continue}if(v>=y)return this.interim[0]=d,this.interim[1]=C,this.interim[2]=E,x;if(O=u[v++],(192&O)!=128){v--;continue}if(m=(7&d)<<18|(63&C)<<12|(63&E)<<6|63&O,m<65536||m>1114111)continue;h[x++]=m}}return x}}},225:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV6=void 0;const h=u(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]],d=[[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 C;c.UnicodeV6=class{constructor(){if(this.version="6",!C){C=new Uint8Array(65536),C.fill(1),C[0]=0,C.fill(0,1,32),C.fill(0,127,160),C.fill(2,4352,4448),C[9001]=2,C[9002]=2,C.fill(2,11904,42192),C[12351]=1,C.fill(2,44032,55204),C.fill(2,63744,64256),C.fill(2,65040,65050),C.fill(2,65072,65136),C.fill(2,65280,65377),C.fill(2,65504,65511);for(let E=0;E<y.length;++E)C.fill(0,y[E][0],y[E][1]+1)}}wcwidth(E){return E<32?0:E<127?1:E<65536?C[E]:(function(O,x){let m,p=0,f=x.length-1;if(O<x[0][0]||O>x[f][1])return!1;for(;f>=p;)if(m=p+f>>1,O>x[m][1])p=m+1;else{if(!(O<x[m][0]))return!0;f=m-1}return!1})(E,d)?0:E>=131072&&E<=196605||E>=196608&&E<=262141?2:1}charProperties(E,O){let x=this.wcwidth(E),m=x===0&&O!==0;if(m){const p=h.UnicodeService.extractWidth(O);p===0?m=!1:p>x&&(x=p)}return h.UnicodeService.createPropertyValue(0,x,m)}}},5981:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WriteBuffer=void 0;const h=u(8460),y=u(844);class d extends y.Disposable{constructor(E){super(),this._action=E,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(E,O){if(O!==void 0&&this._syncCalls>O)return void(this._syncCalls=0);if(this._pendingData+=E.length,this._writeBuffer.push(E),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let x;for(this._isSyncWriting=!0;x=this._writeBuffer.shift();){this._action(x);const m=this._callbacks.shift();m&&m()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(E,O){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+=E.length,this._writeBuffer.push(E),this._callbacks.push(O),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=E.length,this._writeBuffer.push(E),this._callbacks.push(O)}_innerWrite(E=0,O=!0){const x=E||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const m=this._writeBuffer[this._bufferOffset],p=this._action(m,O);if(p){const v=S=>Date.now()-x>=12?setTimeout((()=>this._innerWrite(0,S))):this._innerWrite(x,S);return void p.catch((S=>(queueMicrotask((()=>{throw S})),Promise.resolve(!1)))).then(v)}const f=this._callbacks[this._bufferOffset];if(f&&f(),this._bufferOffset++,this._pendingData-=m.length,Date.now()-x>=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()}}c.WriteBuffer=d},5941:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.toRgbString=c.parseColor=void 0;const u=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,h=/^[\da-f]+$/;function y(d,C){const E=d.toString(16),O=E.length<2?"0"+E:E;switch(C){case 4:return E[0];case 8:return O;case 12:return(O+O).slice(0,3);default:return O+O}}c.parseColor=function(d){if(!d)return;let C=d.toLowerCase();if(C.indexOf("rgb:")===0){C=C.slice(4);const E=u.exec(C);if(E){const O=E[1]?15:E[4]?255:E[7]?4095:65535;return[Math.round(parseInt(E[1]||E[4]||E[7]||E[10],16)/O*255),Math.round(parseInt(E[2]||E[5]||E[8]||E[11],16)/O*255),Math.round(parseInt(E[3]||E[6]||E[9]||E[12],16)/O*255)]}}else if(C.indexOf("#")===0&&(C=C.slice(1),h.exec(C)&&[3,6,9,12].includes(C.length))){const E=C.length/3,O=[0,0,0];for(let x=0;x<3;++x){const m=parseInt(C.slice(E*x,E*x+E),16);O[x]=E===1?m<<4:E===2?m:E===3?m>>4:m>>8}return O}},c.toRgbString=function(d,C=16){const[E,O,x]=d;return`rgb:${y(E,C)}/${y(O,C)}/${y(x,C)}`}},5770:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.PAYLOAD_LIMIT=void 0,c.PAYLOAD_LIMIT=1e7},6351:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DcsHandler=c.DcsParser=void 0;const h=u(482),y=u(8742),d=u(5770),C=[];c.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=C,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=C}registerHandler(O,x){this._handlers[O]===void 0&&(this._handlers[O]=[]);const m=this._handlers[O];return m.push(x),{dispose:()=>{const p=m.indexOf(x);p!==-1&&m.splice(p,1)}}}clearHandler(O){this._handlers[O]&&delete this._handlers[O]}setHandlerFallback(O){this._handlerFb=O}reset(){if(this._active.length)for(let O=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;O>=0;--O)this._active[O].unhook(!1);this._stack.paused=!1,this._active=C,this._ident=0}hook(O,x){if(this.reset(),this._ident=O,this._active=this._handlers[O]||C,this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].hook(x);else this._handlerFb(this._ident,"HOOK",x)}put(O,x,m){if(this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].put(O,x,m);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(O,x,m))}unhook(O,x=!0){if(this._active.length){let m=!1,p=this._active.length-1,f=!1;if(this._stack.paused&&(p=this._stack.loopPosition-1,m=x,f=this._stack.fallThrough,this._stack.paused=!1),!f&&m===!1){for(;p>=0&&(m=this._active[p].unhook(O),m!==!0);p--)if(m instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!1,m;p--}for(;p>=0;p--)if(m=this._active[p].unhook(!1),m instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!0,m}else this._handlerFb(this._ident,"UNHOOK",O);this._active=C,this._ident=0}};const E=new y.Params;E.addParam(0),c.DcsHandler=class{constructor(O){this._handler=O,this._data="",this._params=E,this._hitLimit=!1}hook(O){this._params=O.length>1||O.params[0]?O.clone():E,this._data="",this._hitLimit=!1}put(O,x,m){this._hitLimit||(this._data+=(0,h.utf32ToString)(O,x,m),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(O){let x=!1;if(this._hitLimit)x=!1;else if(O&&(x=this._handler(this._data,this._params),x instanceof Promise))return x.then((m=>(this._params=E,this._data="",this._hitLimit=!1,m)));return this._params=E,this._data="",this._hitLimit=!1,x}}},2015:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.EscapeSequenceParser=c.VT500_TRANSITION_TABLE=c.TransitionTable=void 0;const h=u(844),y=u(8742),d=u(6242),C=u(6351);class E{constructor(p){this.table=new Uint8Array(p)}setDefault(p,f){this.table.fill(p<<4|f)}add(p,f,v,S){this.table[f<<8|p]=v<<4|S}addMany(p,f,v,S){for(let R=0;R<p.length;R++)this.table[f<<8|p[R]]=v<<4|S}}c.TransitionTable=E;const O=160;c.VT500_TRANSITION_TABLE=(function(){const m=new E(4095),p=Array.apply(null,Array(256)).map(((M,w)=>w)),f=(M,w)=>p.slice(M,w),v=f(32,127),S=f(0,24);S.push(25),S.push.apply(S,f(28,32));const R=f(0,14);let A;for(A in m.setDefault(1,0),m.addMany(v,0,2,0),R)m.addMany([24,26,153,154],A,3,0),m.addMany(f(128,144),A,3,0),m.addMany(f(144,152),A,3,0),m.add(156,A,0,0),m.add(27,A,11,1),m.add(157,A,4,8),m.addMany([152,158,159],A,0,7),m.add(155,A,11,3),m.add(144,A,11,9);return m.addMany(S,0,3,0),m.addMany(S,1,3,1),m.add(127,1,0,1),m.addMany(S,8,0,8),m.addMany(S,3,3,3),m.add(127,3,0,3),m.addMany(S,4,3,4),m.add(127,4,0,4),m.addMany(S,6,3,6),m.addMany(S,5,3,5),m.add(127,5,0,5),m.addMany(S,2,3,2),m.add(127,2,0,2),m.add(93,1,4,8),m.addMany(v,8,5,8),m.add(127,8,5,8),m.addMany([156,27,24,26,7],8,6,0),m.addMany(f(28,32),8,0,8),m.addMany([88,94,95],1,0,7),m.addMany(v,7,0,7),m.addMany(S,7,0,7),m.add(156,7,0,0),m.add(127,7,0,7),m.add(91,1,11,3),m.addMany(f(64,127),3,7,0),m.addMany(f(48,60),3,8,4),m.addMany([60,61,62,63],3,9,4),m.addMany(f(48,60),4,8,4),m.addMany(f(64,127),4,7,0),m.addMany([60,61,62,63],4,0,6),m.addMany(f(32,64),6,0,6),m.add(127,6,0,6),m.addMany(f(64,127),6,0,0),m.addMany(f(32,48),3,9,5),m.addMany(f(32,48),5,9,5),m.addMany(f(48,64),5,0,6),m.addMany(f(64,127),5,7,0),m.addMany(f(32,48),4,9,5),m.addMany(f(32,48),1,9,2),m.addMany(f(32,48),2,9,2),m.addMany(f(48,127),2,10,0),m.addMany(f(48,80),1,10,0),m.addMany(f(81,88),1,10,0),m.addMany([89,90,92],1,10,0),m.addMany(f(96,127),1,10,0),m.add(80,1,11,9),m.addMany(S,9,0,9),m.add(127,9,0,9),m.addMany(f(28,32),9,0,9),m.addMany(f(32,48),9,9,12),m.addMany(f(48,60),9,8,10),m.addMany([60,61,62,63],9,9,10),m.addMany(S,11,0,11),m.addMany(f(32,128),11,0,11),m.addMany(f(28,32),11,0,11),m.addMany(S,10,0,10),m.add(127,10,0,10),m.addMany(f(28,32),10,0,10),m.addMany(f(48,60),10,8,10),m.addMany([60,61,62,63],10,0,11),m.addMany(f(32,48),10,9,12),m.addMany(S,12,0,12),m.add(127,12,0,12),m.addMany(f(28,32),12,0,12),m.addMany(f(32,48),12,9,12),m.addMany(f(48,64),12,0,11),m.addMany(f(64,127),12,12,13),m.addMany(f(64,127),10,12,13),m.addMany(f(64,127),9,12,13),m.addMany(S,13,13,13),m.addMany(v,13,13,13),m.add(127,13,0,13),m.addMany([27,156,24,26],13,14,0),m.add(O,0,2,0),m.add(O,8,5,8),m.add(O,6,0,6),m.add(O,11,0,11),m.add(O,13,13,13),m})();class x extends h.Disposable{constructor(p=c.VT500_TRANSITION_TABLE){super(),this._transitions=p,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,v,S)=>{},this._executeHandlerFb=f=>{},this._csiHandlerFb=(f,v)=>{},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,h.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new C.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(p,f=[64,126]){let v=0;if(p.prefix){if(p.prefix.length>1)throw new Error("only one byte as prefix supported");if(v=p.prefix.charCodeAt(0),v&&60>v||v>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(p.intermediates){if(p.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let R=0;R<p.intermediates.length;++R){const A=p.intermediates.charCodeAt(R);if(32>A||A>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");v<<=8,v|=A}}if(p.final.length!==1)throw new Error("final must be a single byte");const S=p.final.charCodeAt(0);if(f[0]>S||S>f[1])throw new Error(`final must be in range ${f[0]} .. ${f[1]}`);return v<<=8,v|=S,v}identToString(p){const f=[];for(;p;)f.push(String.fromCharCode(255&p)),p>>=8;return f.reverse().join("")}setPrintHandler(p){this._printHandler=p}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(p,f){const v=this._identifier(p,[48,126]);this._escHandlers[v]===void 0&&(this._escHandlers[v]=[]);const S=this._escHandlers[v];return S.push(f),{dispose:()=>{const R=S.indexOf(f);R!==-1&&S.splice(R,1)}}}clearEscHandler(p){this._escHandlers[this._identifier(p,[48,126])]&&delete this._escHandlers[this._identifier(p,[48,126])]}setEscHandlerFallback(p){this._escHandlerFb=p}setExecuteHandler(p,f){this._executeHandlers[p.charCodeAt(0)]=f}clearExecuteHandler(p){this._executeHandlers[p.charCodeAt(0)]&&delete this._executeHandlers[p.charCodeAt(0)]}setExecuteHandlerFallback(p){this._executeHandlerFb=p}registerCsiHandler(p,f){const v=this._identifier(p);this._csiHandlers[v]===void 0&&(this._csiHandlers[v]=[]);const S=this._csiHandlers[v];return S.push(f),{dispose:()=>{const R=S.indexOf(f);R!==-1&&S.splice(R,1)}}}clearCsiHandler(p){this._csiHandlers[this._identifier(p)]&&delete this._csiHandlers[this._identifier(p)]}setCsiHandlerFallback(p){this._csiHandlerFb=p}registerDcsHandler(p,f){return this._dcsParser.registerHandler(this._identifier(p),f)}clearDcsHandler(p){this._dcsParser.clearHandler(this._identifier(p))}setDcsHandlerFallback(p){this._dcsParser.setHandlerFallback(p)}registerOscHandler(p,f){return this._oscParser.registerHandler(p,f)}clearOscHandler(p){this._oscParser.clearHandler(p)}setOscHandlerFallback(p){this._oscParser.setHandlerFallback(p)}setErrorHandler(p){this._errorHandler=p}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(p,f,v,S,R){this._parseStack.state=p,this._parseStack.handlers=f,this._parseStack.handlerPos=v,this._parseStack.transition=S,this._parseStack.chunkPos=R}parse(p,f,v){let S,R=0,A=0,M=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,M=this._parseStack.chunkPos+1;else{if(v===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const w=this._parseStack.handlers;let N=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(v===!1&&N>-1){for(;N>=0&&(S=w[N](this._params),S!==!0);N--)if(S instanceof Promise)return this._parseStack.handlerPos=N,S}this._parseStack.handlers=[];break;case 4:if(v===!1&&N>-1){for(;N>=0&&(S=w[N](),S!==!0);N--)if(S instanceof Promise)return this._parseStack.handlerPos=N,S}this._parseStack.handlers=[];break;case 6:if(R=p[this._parseStack.chunkPos],S=this._dcsParser.unhook(R!==24&&R!==26,v),S)return S;R===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(R=p[this._parseStack.chunkPos],S=this._oscParser.end(R!==24&&R!==26,v),S)return S;R===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 w=M;w<f;++w){switch(R=p[w],A=this._transitions.table[this.currentState<<8|(R<160?R:O)],A>>4){case 2:for(let Z=w+1;;++Z){if(Z>=f||(R=p[Z])<32||R>126&&R<O){this._printHandler(p,w,Z),w=Z-1;break}if(++Z>=f||(R=p[Z])<32||R>126&&R<O){this._printHandler(p,w,Z),w=Z-1;break}if(++Z>=f||(R=p[Z])<32||R>126&&R<O){this._printHandler(p,w,Z),w=Z-1;break}if(++Z>=f||(R=p[Z])<32||R>126&&R<O){this._printHandler(p,w,Z),w=Z-1;break}}break;case 3:this._executeHandlers[R]?this._executeHandlers[R]():this._executeHandlerFb(R),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:w,code:R,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const N=this._csiHandlers[this._collect<<8|R];let I=N?N.length-1:-1;for(;I>=0&&(S=N[I](this._params),S!==!0);I--)if(S instanceof Promise)return this._preserveStack(3,N,I,A,w),S;I<0&&this._csiHandlerFb(this._collect<<8|R,this._params),this.precedingJoinState=0;break;case 8:do switch(R){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(R-48)}while(++w<f&&(R=p[w])>47&&R<60);w--;break;case 9:this._collect<<=8,this._collect|=R;break;case 10:const q=this._escHandlers[this._collect<<8|R];let K=q?q.length-1:-1;for(;K>=0&&(S=q[K](),S!==!0);K--)if(S instanceof Promise)return this._preserveStack(4,q,K,A,w),S;K<0&&this._escHandlerFb(this._collect<<8|R),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|R,this._params);break;case 13:for(let Z=w+1;;++Z)if(Z>=f||(R=p[Z])===24||R===26||R===27||R>127&&R<O){this._dcsParser.put(p,w,Z),w=Z-1;break}break;case 14:if(S=this._dcsParser.unhook(R!==24&&R!==26),S)return this._preserveStack(6,[],0,A,w),S;R===27&&(A|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let Z=w+1;;Z++)if(Z>=f||(R=p[Z])<32||R>127&&R<O){this._oscParser.put(p,w,Z),w=Z-1;break}break;case 6:if(S=this._oscParser.end(R!==24&&R!==26),S)return this._preserveStack(5,[],0,A,w),S;R===27&&(A|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&A}}}c.EscapeSequenceParser=x},6242:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OscHandler=c.OscParser=void 0;const h=u(5770),y=u(482),d=[];c.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(C,E){this._handlers[C]===void 0&&(this._handlers[C]=[]);const O=this._handlers[C];return O.push(E),{dispose:()=>{const x=O.indexOf(E);x!==-1&&O.splice(x,1)}}}clearHandler(C){this._handlers[C]&&delete this._handlers[C]}setHandlerFallback(C){this._handlerFb=C}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let C=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;C>=0;--C)this._active[C].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let C=this._active.length-1;C>=0;C--)this._active[C].start();else this._handlerFb(this._id,"START")}_put(C,E,O){if(this._active.length)for(let x=this._active.length-1;x>=0;x--)this._active[x].put(C,E,O);else this._handlerFb(this._id,"PUT",(0,y.utf32ToString)(C,E,O))}start(){this.reset(),this._state=1}put(C,E,O){if(this._state!==3){if(this._state===1)for(;E<O;){const x=C[E++];if(x===59){this._state=2,this._start();break}if(x<48||57<x)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+x-48}this._state===2&&O-E>0&&this._put(C,E,O)}}end(C,E=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let O=!1,x=this._active.length-1,m=!1;if(this._stack.paused&&(x=this._stack.loopPosition-1,O=E,m=this._stack.fallThrough,this._stack.paused=!1),!m&&O===!1){for(;x>=0&&(O=this._active[x].end(C),O!==!0);x--)if(O instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!1,O;x--}for(;x>=0;x--)if(O=this._active[x].end(!1),O instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!0,O}else this._handlerFb(this._id,"END",C);this._active=d,this._id=-1,this._state=0}}},c.OscHandler=class{constructor(C){this._handler=C,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(C,E,O){this._hitLimit||(this._data+=(0,y.utf32ToString)(C,E,O),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(C){let E=!1;if(this._hitLimit)E=!1;else if(C&&(E=this._handler(this._data),E instanceof Promise))return E.then((O=>(this._data="",this._hitLimit=!1,O)));return this._data="",this._hitLimit=!1,E}}},8742:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Params=void 0;const u=2147483647;class h{static fromArray(d){const C=new h;if(!d.length)return C;for(let E=Array.isArray(d[0])?1:0;E<d.length;++E){const O=d[E];if(Array.isArray(O))for(let x=0;x<O.length;++x)C.addSubParam(O[x]);else C.addParam(O)}return C}constructor(d=32,C=32){if(this.maxLength=d,this.maxSubParamsLength=C,C>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(C),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new h(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let C=0;C<this.length;++C){d.push(this.params[C]);const E=this._subParamsIdx[C]>>8,O=255&this._subParamsIdx[C];O-E>0&&d.push(Array.prototype.slice.call(this._subParams,E,O))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>u?u:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>u?u:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const C=this._subParamsIdx[d]>>8,E=255&this._subParamsIdx[d];return E-C>0?this._subParams.subarray(C,E):null}getSubParamsAll(){const d={};for(let C=0;C<this.length;++C){const E=this._subParamsIdx[C]>>8,O=255&this._subParamsIdx[C];O-E>0&&(d[C]=this._subParams.slice(E,O))}return d}addDigit(d){let C;if(this._rejectDigits||!(C=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const E=this._digitIsSub?this._subParams:this.params,O=E[C-1];E[C-1]=~O?Math.min(10*O+d,u):d}}c.Params=h},5741:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.AddonManager=void 0,c.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,h){const y={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(y),h.dispose=()=>this._wrappedAddonDispose(y),h.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let h=-1;for(let y=0;y<this._addons.length;y++)if(this._addons[y]===u){h=y;break}if(h===-1)throw new Error("Could not dispose an addon that has not been loaded");u.isDisposed=!0,u.dispose.apply(u.instance),this._addons.splice(h,1)}}},8771:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferApiView=void 0;const h=u(3785),y=u(511);c.BufferApiView=class{constructor(d,C){this._buffer=d,this.type=C}init(d){return this._buffer=d,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(d){const C=this._buffer.lines.get(d);if(C)return new h.BufferLineApiView(C)}getNullCell(){return new y.CellData}}},3785:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLineApiView=void 0;const h=u(511);c.BufferLineApiView=class{constructor(y){this._line=y}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(y,d){if(!(y<0||y>=this._line.length))return d?(this._line.loadCell(y,d),d):this._line.loadCell(y,new h.CellData)}translateToString(y,d,C){return this._line.translateToString(y,d,C)}}},8285:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferNamespaceApi=void 0;const h=u(8771),y=u(8460),d=u(844);class C extends d.Disposable{constructor(O){super(),this._core=O,this._onBufferChange=this.register(new y.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new h.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new h.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)}}c.BufferNamespaceApi=C},7975:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ParserApi=void 0,c.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,h){return this._core.registerCsiHandler(u,(y=>h(y.toArray())))}addCsiHandler(u,h){return this.registerCsiHandler(u,h)}registerDcsHandler(u,h){return this._core.registerDcsHandler(u,((y,d)=>h(y,d.toArray())))}addDcsHandler(u,h){return this.registerDcsHandler(u,h)}registerEscHandler(u,h){return this._core.registerEscHandler(u,h)}addEscHandler(u,h){return this.registerEscHandler(u,h)}registerOscHandler(u,h){return this._core.registerOscHandler(u,h)}addOscHandler(u,h){return this.registerOscHandler(u,h)}}},7090:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeApi=void 0,c.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(T,c,u){var h=this&&this.__decorate||function(m,p,f,v){var S,R=arguments.length,A=R<3?p:v===null?v=Object.getOwnPropertyDescriptor(p,f):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(m,p,f,v);else for(var M=m.length-1;M>=0;M--)(S=m[M])&&(A=(R<3?S(A):R>3?S(p,f,A):S(p,f))||A);return R>3&&A&&Object.defineProperty(p,f,A),A},y=this&&this.__param||function(m,p){return function(f,v){p(f,v,m)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferService=c.MINIMUM_ROWS=c.MINIMUM_COLS=void 0;const d=u(8460),C=u(844),E=u(5295),O=u(2585);c.MINIMUM_COLS=2,c.MINIMUM_ROWS=1;let x=c.BufferService=class extends C.Disposable{get buffer(){return this.buffers.active}constructor(m){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(m.rawOptions.cols||0,c.MINIMUM_COLS),this.rows=Math.max(m.rawOptions.rows||0,c.MINIMUM_ROWS),this.buffers=this.register(new E.BufferSet(m,this))}resize(m,p){this.cols=m,this.rows=p,this.buffers.resize(m,p),this._onResize.fire({cols:m,rows:p})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(m,p=!1){const f=this.buffer;let v;v=this._cachedBlankLine,v&&v.length===this.cols&&v.getFg(0)===m.fg&&v.getBg(0)===m.bg||(v=f.getBlankLine(m,p),this._cachedBlankLine=v),v.isWrapped=p;const S=f.ybase+f.scrollTop,R=f.ybase+f.scrollBottom;if(f.scrollTop===0){const A=f.lines.isFull;R===f.lines.length-1?A?f.lines.recycle().copyFrom(v):f.lines.push(v.clone()):f.lines.splice(R+1,0,v.clone()),A?this.isUserScrolling&&(f.ydisp=Math.max(f.ydisp-1,0)):(f.ybase++,this.isUserScrolling||f.ydisp++)}else{const A=R-S+1;f.lines.shiftElements(S+1,A-1,-1),f.lines.set(R,v.clone())}this.isUserScrolling||(f.ydisp=f.ybase),this._onScroll.fire(f.ydisp)}scrollLines(m,p,f){const v=this.buffer;if(m<0){if(v.ydisp===0)return;this.isUserScrolling=!0}else m+v.ydisp>=v.ybase&&(this.isUserScrolling=!1);const S=v.ydisp;v.ydisp=Math.max(Math.min(v.ydisp+m,v.ybase),0),S!==v.ydisp&&(p||this._onScroll.fire(v.ydisp))}};c.BufferService=x=h([y(0,O.IOptionsService)],x)},7994:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CharsetService=void 0,c.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,h){this._charsets[u]=h,this.glevel===u&&(this.charset=h)}}},1753:function(T,c,u){var h=this&&this.__decorate||function(v,S,R,A){var M,w=arguments.length,N=w<3?S:A===null?A=Object.getOwnPropertyDescriptor(S,R):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(v,S,R,A);else for(var I=v.length-1;I>=0;I--)(M=v[I])&&(N=(w<3?M(N):w>3?M(S,R,N):M(S,R))||N);return w>3&&N&&Object.defineProperty(S,R,N),N},y=this&&this.__param||function(v,S){return function(R,A){S(R,A,v)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreMouseService=void 0;const d=u(2585),C=u(8460),E=u(844),O={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:v=>v.button!==4&&v.action===1&&(v.ctrl=!1,v.alt=!1,v.shift=!1,!0)},VT200:{events:19,restrict:v=>v.action!==32},DRAG:{events:23,restrict:v=>v.action!==32||v.button!==3},ANY:{events:31,restrict:v=>!0}};function x(v,S){let R=(v.ctrl?16:0)|(v.shift?4:0)|(v.alt?8:0);return v.button===4?(R|=64,R|=v.action):(R|=3&v.button,4&v.button&&(R|=64),8&v.button&&(R|=128),v.action===32?R|=32:v.action!==0||S||(R|=3)),R}const m=String.fromCharCode,p={DEFAULT:v=>{const S=[x(v,!1)+32,v.col+32,v.row+32];return S[0]>255||S[1]>255||S[2]>255?"":`\x1B[M${m(S[0])}${m(S[1])}${m(S[2])}`},SGR:v=>{const S=v.action===0&&v.button!==4?"m":"M";return`\x1B[<${x(v,!0)};${v.col};${v.row}${S}`},SGR_PIXELS:v=>{const S=v.action===0&&v.button!==4?"m":"M";return`\x1B[<${x(v,!0)};${v.x};${v.y}${S}`}};let f=c.CoreMouseService=class extends E.Disposable{constructor(v,S){super(),this._bufferService=v,this._coreService=S,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new C.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const R of Object.keys(O))this.addProtocol(R,O[R]);for(const R of Object.keys(p))this.addEncoding(R,p[R]);this.reset()}addProtocol(v,S){this._protocols[v]=S}addEncoding(v,S){this._encodings[v]=S}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(v){if(!this._protocols[v])throw new Error(`unknown protocol "${v}"`);this._activeProtocol=v,this._onProtocolChange.fire(this._protocols[v].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(v){if(!this._encodings[v])throw new Error(`unknown encoding "${v}"`);this._activeEncoding=v}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(v){if(v.col<0||v.col>=this._bufferService.cols||v.row<0||v.row>=this._bufferService.rows||v.button===4&&v.action===32||v.button===3&&v.action!==32||v.button!==4&&(v.action===2||v.action===3)||(v.col++,v.row++,v.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,v,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(v))return!1;const S=this._encodings[this._activeEncoding](v);return S&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(S):this._coreService.triggerDataEvent(S,!0)),this._lastEvent=v,!0}explainEvents(v){return{down:!!(1&v),up:!!(2&v),drag:!!(4&v),move:!!(8&v),wheel:!!(16&v)}}_equalEvents(v,S,R){if(R){if(v.x!==S.x||v.y!==S.y)return!1}else if(v.col!==S.col||v.row!==S.row)return!1;return v.button===S.button&&v.action===S.action&&v.ctrl===S.ctrl&&v.alt===S.alt&&v.shift===S.shift}};c.CoreMouseService=f=h([y(0,d.IBufferService),y(1,d.ICoreService)],f)},6975:function(T,c,u){var h=this&&this.__decorate||function(f,v,S,R){var A,M=arguments.length,w=M<3?v:R===null?R=Object.getOwnPropertyDescriptor(v,S):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(f,v,S,R);else for(var N=f.length-1;N>=0;N--)(A=f[N])&&(w=(M<3?A(w):M>3?A(v,S,w):A(v,S))||w);return M>3&&w&&Object.defineProperty(v,S,w),w},y=this&&this.__param||function(f,v){return function(S,R){v(S,R,f)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreService=void 0;const d=u(1439),C=u(8460),E=u(844),O=u(2585),x=Object.freeze({insertMode:!1}),m=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let p=c.CoreService=class extends E.Disposable{constructor(f,v,S){super(),this._bufferService=f,this._logService=v,this._optionsService=S,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new C.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new C.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new C.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new C.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(x),this.decPrivateModes=(0,d.clone)(m)}reset(){this.modes=(0,d.clone)(x),this.decPrivateModes=(0,d.clone)(m)}triggerDataEvent(f,v=!1){if(this._optionsService.rawOptions.disableStdin)return;const S=this._bufferService.buffer;v&&this._optionsService.rawOptions.scrollOnUserInput&&S.ybase!==S.ydisp&&this._onRequestScrollToBottom.fire(),v&&this._onUserInput.fire(),this._logService.debug(`sending data "${f}"`,(()=>f.split("").map((R=>R.charCodeAt(0))))),this._onData.fire(f)}triggerBinaryEvent(f){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${f}"`,(()=>f.split("").map((v=>v.charCodeAt(0))))),this._onBinary.fire(f))}};c.CoreService=p=h([y(0,O.IBufferService),y(1,O.ILogService),y(2,O.IOptionsService)],p)},9074:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DecorationService=void 0;const h=u(8055),y=u(8460),d=u(844),C=u(6106);let E=0,O=0;class x extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new C.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,d.toDisposable)((()=>this.reset())))}registerDecoration(f){if(f.marker.isDisposed)return;const v=new m(f);if(v){const S=v.marker.onDispose((()=>v.dispose()));v.onDispose((()=>{v&&(this._decorations.delete(v)&&this._onDecorationRemoved.fire(v),S.dispose())})),this._decorations.insert(v),this._onDecorationRegistered.fire(v)}return v}reset(){for(const f of this._decorations.values())f.dispose();this._decorations.clear()}*getDecorationsAtCell(f,v,S){let R=0,A=0;for(const M of this._decorations.getKeyIterator(v))R=M.options.x??0,A=R+(M.options.width??1),f>=R&&f<A&&(!S||(M.options.layer??"bottom")===S)&&(yield M)}forEachDecorationAtCell(f,v,S,R){this._decorations.forEachByKey(v,(A=>{E=A.options.x??0,O=E+(A.options.width??1),f>=E&&f<O&&(!S||(A.options.layer??"bottom")===S)&&R(A)}))}}c.DecorationService=x;class m extends d.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=h.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=h.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,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.InstantiationService=c.ServiceCollection=void 0;const h=u(2585),y=u(8343);class d{constructor(...E){this._entries=new Map;for(const[O,x]of E)this.set(O,x)}set(E,O){const x=this._entries.get(E);return this._entries.set(E,O),x}forEach(E){for(const[O,x]of this._entries.entries())E(O,x)}has(E){return this._entries.has(E)}get(E){return this._entries.get(E)}}c.ServiceCollection=d,c.InstantiationService=class{constructor(){this._services=new d,this._services.set(h.IInstantiationService,this)}setService(C,E){this._services.set(C,E)}getService(C){return this._services.get(C)}createInstance(C,...E){const O=(0,y.getServiceDependencies)(C).sort(((p,f)=>p.index-f.index)),x=[];for(const p of O){const f=this._services.get(p.id);if(!f)throw new Error(`[createInstance] ${C.name} depends on UNKNOWN service ${p.id}.`);x.push(f)}const m=O.length>0?O[0].index:E.length;if(E.length!==m)throw new Error(`[createInstance] First service dependency of ${C.name} at position ${m+1} conflicts with ${E.length} static arguments`);return new C(...E,...x)}}},7866:function(T,c,u){var h=this&&this.__decorate||function(m,p,f,v){var S,R=arguments.length,A=R<3?p:v===null?v=Object.getOwnPropertyDescriptor(p,f):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(m,p,f,v);else for(var M=m.length-1;M>=0;M--)(S=m[M])&&(A=(R<3?S(A):R>3?S(p,f,A):S(p,f))||A);return R>3&&A&&Object.defineProperty(p,f,A),A},y=this&&this.__param||function(m,p){return function(f,v){p(f,v,m)}};Object.defineProperty(c,"__esModule",{value:!0}),c.traceCall=c.setTraceLogger=c.LogService=void 0;const d=u(844),C=u(2585),E={trace:C.LogLevelEnum.TRACE,debug:C.LogLevelEnum.DEBUG,info:C.LogLevelEnum.INFO,warn:C.LogLevelEnum.WARN,error:C.LogLevelEnum.ERROR,off:C.LogLevelEnum.OFF};let O,x=c.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(m){super(),this._optionsService=m,this._logLevel=C.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),O=this}_updateLogLevel(){this._logLevel=E[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(m){for(let p=0;p<m.length;p++)typeof m[p]=="function"&&(m[p]=m[p]())}_log(m,p,f){this._evalLazyOptionalParams(f),m.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+p,...f)}trace(m,...p){var f;this._logLevel<=C.LogLevelEnum.TRACE&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.trace.bind(this._optionsService.options.logger))??console.log,m,p)}debug(m,...p){var f;this._logLevel<=C.LogLevelEnum.DEBUG&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.debug.bind(this._optionsService.options.logger))??console.log,m,p)}info(m,...p){var f;this._logLevel<=C.LogLevelEnum.INFO&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.info.bind(this._optionsService.options.logger))??console.info,m,p)}warn(m,...p){var f;this._logLevel<=C.LogLevelEnum.WARN&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.warn.bind(this._optionsService.options.logger))??console.warn,m,p)}error(m,...p){var f;this._logLevel<=C.LogLevelEnum.ERROR&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.error.bind(this._optionsService.options.logger))??console.error,m,p)}};c.LogService=x=h([y(0,C.IOptionsService)],x),c.setTraceLogger=function(m){O=m},c.traceCall=function(m,p,f){if(typeof f.value!="function")throw new Error("not supported");const v=f.value;f.value=function(...S){if(O.logLevel!==C.LogLevelEnum.TRACE)return v.apply(this,S);O.trace(`GlyphRenderer#${v.name}(${S.map((A=>JSON.stringify(A))).join(", ")})`);const R=v.apply(this,S);return O.trace(`GlyphRenderer#${v.name} return`,R),R}}},7302:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OptionsService=c.DEFAULT_OPTIONS=void 0;const h=u(8460),y=u(844),d=u(6114);c.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:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const C=["normal","bold","100","200","300","400","500","600","700","800","900"];class E extends y.Disposable{constructor(x){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const m={...c.DEFAULT_OPTIONS};for(const p in x)if(p in m)try{const f=x[p];m[p]=this._sanitizeAndValidateOption(p,f)}catch(f){console.error(f)}this.rawOptions=m,this.options={...m},this._setupOptions(),this.register((0,y.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(x,m){return this.onOptionChange((p=>{p===x&&m(this.rawOptions[x])}))}onMultipleOptionChange(x,m){return this.onOptionChange((p=>{x.indexOf(p)!==-1&&m()}))}_setupOptions(){const x=p=>{if(!(p in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${p}"`);return this.rawOptions[p]},m=(p,f)=>{if(!(p in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${p}"`);f=this._sanitizeAndValidateOption(p,f),this.rawOptions[p]!==f&&(this.rawOptions[p]=f,this._onOptionChange.fire(p))};for(const p in this.rawOptions){const f={get:x.bind(this,p),set:m.bind(this,p)};Object.defineProperty(this.options,p,f)}}_sanitizeAndValidateOption(x,m){switch(x){case"cursorStyle":if(m||(m=c.DEFAULT_OPTIONS[x]),!(function(p){return p==="block"||p==="underline"||p==="bar"})(m))throw new Error(`"${m}" is not a valid value for ${x}`);break;case"wordSeparator":m||(m=c.DEFAULT_OPTIONS[x]);break;case"fontWeight":case"fontWeightBold":if(typeof m=="number"&&1<=m&&m<=1e3)break;m=C.includes(m)?m:c.DEFAULT_OPTIONS[x];break;case"cursorWidth":m=Math.floor(m);case"lineHeight":case"tabStopWidth":if(m<1)throw new Error(`${x} cannot be less than 1, value: ${m}`);break;case"minimumContrastRatio":m=Math.max(1,Math.min(21,Math.round(10*m)/10));break;case"scrollback":if((m=Math.min(m,4294967295))<0)throw new Error(`${x} cannot be less than 0, value: ${m}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(m<=0)throw new Error(`${x} cannot be less than or equal to 0, value: ${m}`);break;case"rows":case"cols":if(!m&&m!==0)throw new Error(`${x} must be numeric, value: ${m}`);break;case"windowsPty":m=m??{}}return m}}c.OptionsService=E},2660:function(T,c,u){var h=this&&this.__decorate||function(E,O,x,m){var p,f=arguments.length,v=f<3?O:m===null?m=Object.getOwnPropertyDescriptor(O,x):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(E,O,x,m);else for(var S=E.length-1;S>=0;S--)(p=E[S])&&(v=(f<3?p(v):f>3?p(O,x,v):p(O,x))||v);return f>3&&v&&Object.defineProperty(O,x,v),v},y=this&&this.__param||function(E,O){return function(x,m){O(x,m,E)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkService=void 0;const d=u(2585);let C=c.OscLinkService=class{constructor(E){this._bufferService=E,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(E){const O=this._bufferService.buffer;if(E.id===void 0){const S=O.addMarker(O.ybase+O.y),R={data:E,id:this._nextId++,lines:[S]};return S.onDispose((()=>this._removeMarkerFromLink(R,S))),this._dataByLinkId.set(R.id,R),R.id}const x=E,m=this._getEntryIdKey(x),p=this._entriesWithId.get(m);if(p)return this.addLineToLink(p.id,O.ybase+O.y),p.id;const f=O.addMarker(O.ybase+O.y),v={id:this._nextId++,key:this._getEntryIdKey(x),data:x,lines:[f]};return f.onDispose((()=>this._removeMarkerFromLink(v,f))),this._entriesWithId.set(v.key,v),this._dataByLinkId.set(v.id,v),v.id}addLineToLink(E,O){const x=this._dataByLinkId.get(E);if(x&&x.lines.every((m=>m.line!==O))){const m=this._bufferService.buffer.addMarker(O);x.lines.push(m),m.onDispose((()=>this._removeMarkerFromLink(x,m)))}}getLinkData(E){var O;return(O=this._dataByLinkId.get(E))==null?void 0:O.data}_getEntryIdKey(E){return`${E.id};;${E.uri}`}_removeMarkerFromLink(E,O){const x=E.lines.indexOf(O);x!==-1&&(E.lines.splice(x,1),E.lines.length===0&&(E.data.id!==void 0&&this._entriesWithId.delete(E.key),this._dataByLinkId.delete(E.id)))}};c.OscLinkService=C=h([y(0,d.IBufferService)],C)},8343:(T,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.createDecorator=c.getServiceDependencies=c.serviceRegistry=void 0;const u="di$target",h="di$dependencies";c.serviceRegistry=new Map,c.getServiceDependencies=function(y){return y[h]||[]},c.createDecorator=function(y){if(c.serviceRegistry.has(y))return c.serviceRegistry.get(y);const d=function(C,E,O){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(x,m,p){m[u]===m?m[h].push({id:x,index:p}):(m[h]=[{id:x,index:p}],m[u]=m)})(d,C,O)};return d.toString=()=>y,c.serviceRegistry.set(y,d),d}},2585:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.IDecorationService=c.IUnicodeService=c.IOscLinkService=c.IOptionsService=c.ILogService=c.LogLevelEnum=c.IInstantiationService=c.ICharsetService=c.ICoreService=c.ICoreMouseService=c.IBufferService=void 0;const h=u(8343);var y;c.IBufferService=(0,h.createDecorator)("BufferService"),c.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),c.ICoreService=(0,h.createDecorator)("CoreService"),c.ICharsetService=(0,h.createDecorator)("CharsetService"),c.IInstantiationService=(0,h.createDecorator)("InstantiationService"),(function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"})(y||(c.LogLevelEnum=y={})),c.ILogService=(0,h.createDecorator)("LogService"),c.IOptionsService=(0,h.createDecorator)("OptionsService"),c.IOscLinkService=(0,h.createDecorator)("OscLinkService"),c.IUnicodeService=(0,h.createDecorator)("UnicodeService"),c.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(T,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeService=void 0;const h=u(8460),y=u(225);class d{static extractShouldJoin(E){return(1&E)!=0}static extractWidth(E){return E>>1&3}static extractCharKind(E){return E>>3}static createPropertyValue(E,O,x=!1){return(16777215&E)<<3|(3&O)<<1|(x?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const E=new y.UnicodeV6;this.register(E),this._active=E.version,this._activeProvider=E}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(E){if(!this._providers[E])throw new Error(`unknown Unicode version "${E}"`);this._active=E,this._activeProvider=this._providers[E],this._onChange.fire(E)}register(E){this._providers[E.version]=E}wcwidth(E){return this._activeProvider.wcwidth(E)}getStringCellWidth(E){let O=0,x=0;const m=E.length;for(let p=0;p<m;++p){let f=E.charCodeAt(p);if(55296<=f&&f<=56319){if(++p>=m)return O+this.wcwidth(f);const R=E.charCodeAt(p);56320<=R&&R<=57343?f=1024*(f-55296)+R-56320+65536:O+=this.wcwidth(R)}const v=this.charProperties(f,x);let S=d.extractWidth(v);d.extractShouldJoin(v)&&(S-=d.extractWidth(x)),O+=S,x=v}return O}charProperties(E,O){return this._activeProvider.charProperties(E,O)}}c.UnicodeService=d}},o={};function g(T){var c=o[T];if(c!==void 0)return c.exports;var u=o[T]={exports:{}};return a[T].call(u.exports,u,u.exports,g),u.exports}var k={};return(()=>{var T=k;Object.defineProperty(T,"__esModule",{value:!0}),T.Terminal=void 0;const c=g(9042),u=g(3236),h=g(844),y=g(5741),d=g(8285),C=g(7975),E=g(7090),O=["cols","rows"];class x extends h.Disposable{constructor(p){super(),this._core=this.register(new u.Terminal(p)),this._addonManager=this.register(new y.AddonManager),this._publicOptions={...this._core.options};const f=S=>this._core.options[S],v=(S,R)=>{this._checkReadonlyOptions(S),this._core.options[S]=R};for(const S in this._core.options){const R={get:f.bind(this,S),set:v.bind(this,S)};Object.defineProperty(this._publicOptions,S,R)}}_checkReadonlyOptions(p){if(O.includes(p))throw new Error(`Option "${p}" 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 C.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new E.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 d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const p=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:p.applicationCursorKeys,applicationKeypadMode:p.applicationKeypad,bracketedPasteMode:p.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:f,originMode:p.origin,reverseWraparoundMode:p.reverseWraparound,sendFocusMode:p.sendFocus,wraparoundMode:p.wraparound}}get options(){return this._publicOptions}set options(p){for(const f in p)this._publicOptions[f]=p[f]}blur(){this._core.blur()}focus(){this._core.focus()}input(p,f=!0){this._core.input(p,f)}resize(p,f){this._verifyIntegers(p,f),this._core.resize(p,f)}open(p){this._core.open(p)}attachCustomKeyEventHandler(p){this._core.attachCustomKeyEventHandler(p)}attachCustomWheelEventHandler(p){this._core.attachCustomWheelEventHandler(p)}registerLinkProvider(p){return this._core.registerLinkProvider(p)}registerCharacterJoiner(p){return this._checkProposedApi(),this._core.registerCharacterJoiner(p)}deregisterCharacterJoiner(p){this._checkProposedApi(),this._core.deregisterCharacterJoiner(p)}registerMarker(p=0){return this._verifyIntegers(p),this._core.registerMarker(p)}registerDecoration(p){return this._checkProposedApi(),this._verifyPositiveIntegers(p.x??0,p.width??0,p.height??0),this._core.registerDecoration(p)}hasSelection(){return this._core.hasSelection()}select(p,f,v){this._verifyIntegers(p,f,v),this._core.select(p,f,v)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(p,f){this._verifyIntegers(p,f),this._core.selectLines(p,f)}dispose(){super.dispose()}scrollLines(p){this._verifyIntegers(p),this._core.scrollLines(p)}scrollPages(p){this._verifyIntegers(p),this._core.scrollPages(p)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(p){this._verifyIntegers(p),this._core.scrollToLine(p)}clear(){this._core.clear()}write(p,f){this._core.write(p,f)}writeln(p,f){this._core.write(p),this._core.write(`\r
|
|
301
|
+
`,f)}paste(p){this._core.paste(p)}refresh(p,f){this._verifyIntegers(p,f),this._core.refresh(p,f)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(p){this._addonManager.loadAddon(this,p)}static get strings(){return c}_verifyIntegers(...p){for(const f of p)if(f===1/0||isNaN(f)||f%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...p){for(const f of p)if(f&&(f===1/0||isNaN(f)||f%1!=0||f<0))throw new Error("This API only accepts positive integers")}}T.Terminal=x})(),k})()))})(lu)),lu.exports}var CE=xE(),cu={exports:{}},B_;function wE(){return B_||(B_=1,(function(i,r){(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 k=this._terminal._core;this._terminal.rows===g.rows&&this._terminal.cols===g.cols||(k._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,k=g._renderService.dimensions;if(k.css.cell.width===0||k.css.cell.height===0)return;const T=this._terminal.options.scrollback===0?0:g.viewport.scrollBarWidth,c=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(c.getPropertyValue("height")),h=Math.max(0,parseInt(c.getPropertyValue("width"))),y=window.getComputedStyle(this._terminal.element),d=u-(parseInt(y.getPropertyValue("padding-top"))+parseInt(y.getPropertyValue("padding-bottom"))),C=h-(parseInt(y.getPropertyValue("padding-right"))+parseInt(y.getPropertyValue("padding-left")))-T;return{cols:Math.max(2,Math.floor(C/k.css.cell.width)),rows:Math.max(1,Math.floor(d/k.css.cell.height))}}}})(),a})()))})(cu)),cu.exports}var EE=wE();const kE=3e4,TE=300*1e3;class AE{constructor(r,a,o){mt(this,"ws",null);mt(this,"consecutiveFailures",0);mt(this,"failStartTime",null);mt(this,"destroyed",!1);mt(this,"reconnectTimer",null);mt(this,"url");mt(this,"authToken");mt(this,"callbacks");this.url=r,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 r,a,o;this.destroyed||(this.consecutiveFailures=0,this.failStartTime=null,this.authToken&&((r=this.ws)==null?void 0:r.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=r=>{if(!this.destroyed)try{this.callbacks.onMessage(JSON.parse(r.data))}catch{}},this.ws.onclose=()=>{this.destroyed||(this.ws=null,this.scheduleReconnect())},this.ws.onerror=()=>{this.destroyed}}}scheduleReconnect(){var a,o,g,k,T,c;if(this.destroyed)return;if(this.failStartTime===null&&(this.failStartTime=Date.now()),Date.now()-this.failStartTime>=TE){(o=(a=this.callbacks).onGiveUp)==null||o.call(a),(k=(g=this.callbacks).onClose)==null||k.call(g);return}this.consecutiveFailures++;const r=Math.min(kE,1e3*Math.pow(2,this.consecutiveFailures-1));(c=(T=this.callbacks).onReconnecting)==null||c.call(T,this.consecutiveFailures,r),this.reconnectTimer=setTimeout(()=>this.connect(),r)}send(r){var a;((a=this.ws)==null?void 0:a.readyState)===WebSocket.OPEN&&this.ws.send(JSON.stringify(r))}close(){var r;this.destroyed=!0,this.reconnectTimer&&clearTimeout(this.reconnectTimer),(r=this.ws)==null||r.close(),this.ws=null}}const vo=1e3;function uu(i){return`${i.timestamp??""}:${i.role}:${i.contentType}:${i.text.length}:${i.text.slice(0,80)}`}function z_(i){const r=i.role==="assistant"?"Agent":i.role==="user"?"You":i.role,a=i.contentType==="tool_use"?"[Tool]":i.contentType==="tool_result"?"[Result]":i.contentType==="thinking"?"[Thinking]":"",g=`\x1B[36m${a?`${r} ${a}`:r}\x1B[0m:`,k=i.text.split(`
|
|
302
|
+
`)[0].slice(0,200)+(i.text.length>200?"…":"");return`${g} ${k}`}function RE({sessionId:i,status:r}){const a=et(w=>w.token),o=P.useRef(null),g=P.useRef(null),k=P.useRef(null),T=P.useRef(null),c=P.useRef(r),u=P.useRef(""),[h,y]=P.useState([]),[d,C]=P.useState(!0),[E,O]=P.useState({thinking:!1,tool_use:!0,tool_result:!0}),x=P.useRef(new Set),[m,p]=P.useState("connecting"),[f,v]=P.useState(null);P.useEffect(()=>{c.current=r},[r]);const S=P.useMemo(()=>h.filter(w=>w.role==="user"?!0:!(w.contentType==="thinking"&&!E.thinking||w.contentType==="tool_use"&&!E.tool_use||w.contentType==="tool_result"&&!E.tool_result)),[h,E]);P.useEffect(()=>{let w=!1;return bw(i).then(N=>{if(!w){const I=N.messages??[],q=I.length>vo?I.slice(I.length-vo):I;y(q),x.current=new Set(q.map(uu))}}).finally(()=>{w||C(!1)}),()=>{w=!0}},[i]),P.useEffect(()=>{const w=Kp(i,N=>{try{const I=JSON.parse(N.data);if(I.event!=="message")return;const q=I.data;y(K=>{const Z=uu(q);if(x.current.has(Z))return K;x.current.add(Z);const J=[...K,q];if(J.length>vo){const ee=J.length-vo,F=J.slice(ee);for(let Q=0;Q<ee;Q++)x.current.delete(uu(J[Q]));return F}return J})}catch{}},a);return()=>w()},[i,a]),P.useEffect(()=>{if(!o.current)return;const w=new CE.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:2e3}),N=new EE.FitAddon;w.loadAddon(N),w.open(o.current),N.fit(),g.current=w,k.current=N;const I=new ResizeObserver(()=>{var Z;N.fit();const{cols:q,rows:K}=w;(Z=T.current)==null||Z.send({type:"resize",cols:q,rows:K})});return o.current&&I.observe(o.current),()=>{I.disconnect(),w.dispose(),g.current=null,k.current=null}},[]),P.useEffect(()=>{var I;const w=g.current;if(!w||d)return;if(w.reset(),S.length>0){w.writeln("\x1B[33m╔═══════════════════════════════════════════════════════════╗\x1B[0m"),w.writeln("\x1B[33m║ SESSION TRANSCRIPT ║\x1B[0m"),w.writeln("\x1B[33m╚═══════════════════════════════════════════════════════════╝\x1B[0m"),w.writeln("");for(const q of S)w.writeln(z_(q));w.writeln(""),w.writeln("\x1B[33m╔═══════════════════════════════════════════════════════════╗\x1B[0m"),w.writeln("\x1B[33m║ LIVE TERMINAL OUTPUT ║\x1B[0m"),w.writeln("\x1B[33m╚═══════════════════════════════════════════════════════════╝\x1B[0m"),w.writeln("")}const N=u.current;N&&w.write(N),(I=k.current)==null||I.fit()},[S,d]),P.useEffect(()=>{const N=(()=>{const q=window.location.origin,K=`/v1/sessions/${encodeURIComponent(i)}/terminal`;return`${q.replace(/^http/,"ws")}${K}`})(),I=new AE(N,{onMessage:q=>{const K=q,Z=g.current;if(Z)switch(K.type){case"pane":{const J=u.current,ee=K.content;if(J&&ee.startsWith(J))Z.write(ee.slice(J.length));else{u.current=ee;const F=g.current;if(F){if(F.reset(),S.length>0){F.writeln("\x1B[33m╔═══════════════════════════════════════════════════════════╗\x1B[0m"),F.writeln("\x1B[33m║ SESSION TRANSCRIPT ║\x1B[0m"),F.writeln("\x1B[33m╚═══════════════════════════════════════════════════════════╝\x1B[0m"),F.writeln("");for(const Q of S)F.writeln(z_(Q));F.writeln(""),F.writeln("\x1B[33m╔═══════════════════════════════════════════════════════════╗\x1B[0m"),F.writeln("\x1B[33m║ LIVE TERMINAL OUTPUT ║\x1B[0m"),F.writeln("\x1B[33m╚═══════════════════════════════════════════════════════════╝\x1B[0m"),F.writeln("")}F.write(ee)}}u.current=ee,v(null);break}case"status":break;case"error":v(K.message);break}},onOpen:()=>{var K;p("connected"),v(null);const q=g.current;k.current&&q&&((K=T.current)==null||K.send({type:"resize",cols:q.cols,rows:q.rows}))},onReconnecting:()=>{p("reconnecting")},onGiveUp:()=>{p("disconnected")},onClose:()=>{p("disconnected")}},a??void 0);return T.current=I,()=>{T.current=null,I.close()}},[i,a,S]),P.useEffect(()=>{const w=g.current;if(!w)return;const N=w.onData(I=>{var q;(q=T.current)==null||q.send({type:"input",text:I})});return()=>{N.dispose()}},[]);const R=P.useCallback(w=>{O(N=>({...N,[w]:!N[w]}))},[]),A=r==="working",M=m==="connected";return b.jsxs("div",{className:"flex flex-col h-full bg-[#111118] border border-[#1a1a2e] rounded-lg overflow-hidden",children:[b.jsxs("div",{className:"flex items-center justify-between px-4 py-2 text-xs border-b border-[#1a1a2e] bg-[#0a0a0f] shrink-0 flex-wrap gap-2",children:[b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx("span",{className:"text-[10px] text-[#555] uppercase tracking-wider",children:"Filter:"}),["thinking","tool_use","tool_result"].map(w=>b.jsx("button",{onClick:()=>R(w),"aria-pressed":E[w],className:`text-xs px-2 py-0.5 rounded border transition-colors ${E[w]?"border-[#00e5ff]/40 text-[#00e5ff] bg-[#00e5ff]/10":"border-[#1a1a2e] text-[#555] hover:text-[#888]"}`,children:w==="tool_use"?"Tools":w==="tool_result"?"Results":w},w)),b.jsxs("span",{className:"text-[10px] text-[#444]",children:[S.length," / ",h.length," messages"]})]}),b.jsxs("div",{className:"flex items-center gap-3 ml-auto",children:[b.jsxs("div",{className:"flex items-center gap-1.5",children:[b.jsx("span",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:M?"#00e5ff":m==="reconnecting"?"#ffaa00":"#666",boxShadow:M?"0 0 4px #00e5ff40":"none",animation:m==="reconnecting"?"pulse 1s ease-in-out infinite":"none"}}),b.jsx("span",{className:"text-[10px] text-[#555] uppercase",children:m==="connecting"?"connecting…":m==="reconnecting"?"reconnecting…":m==="connected"?"ws live":"disconnected"})]}),b.jsxs("div",{className:"flex items-center gap-1.5",children:[b.jsx("span",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:A?"#00ff88":"#888",boxShadow:A?"0 0 4px #00ff88":"none"}}),b.jsx("span",{className:"text-[10px] text-[#555] uppercase",children:A?"active":"idle"})]})]})]}),f&&b.jsx("div",{className:"px-4 py-2 text-xs text-[#ff3366] bg-[#ff336610] border-b border-[#ff336620]",children:f}),b.jsx("div",{ref:o,className:"flex-1 overflow-hidden"})]})}function DE({metrics:i,loading:r}){if(r||!i)return b.jsx("div",{className:"flex items-center justify-center h-48 text-[#555] text-sm animate-pulse",children:"Loading metrics…"});const a=[{label:"Duration",value:Jw(i.durationSec*1e3),icon:"â±",color:"#3b82f6"},{label:"Messages",value:i.messages.toString(),icon:"💬",color:"#3b82f6"},{label:"Tool Calls",value:i.toolCalls.toString(),icon:"🔧",color:"#3b82f6"},{label:"Approvals",value:i.approvals.toString(),icon:"✅",color:"#10b981"},{label:"Auto-approvals",value:i.autoApprovals.toString(),icon:"âš¡",color:"#f59e0b"},{label:"Status Changes",value:i.statusChanges.length.toString(),icon:"🔄",color:"#8888ff"}];return b.jsxs("div",{className:"space-y-4",children:[b.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3",children:a.map(o=>b.jsxs("div",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-4 transition-colors duration-150 hover:border-[#3b82f6]/30",children:[b.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[b.jsx("span",{className:"text-base",children:o.icon}),b.jsx("span",{className:"text-[10px] text-[#888] uppercase tracking-wider",children:o.label})]}),b.jsx("div",{className:"text-2xl font-semibold font-mono tabular-nums",style:{color:o.color},children:o.value})]},o.label))}),i.statusChanges.length>0&&b.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg p-4",children:[b.jsx("h3",{className:"text-xs text-[#888] uppercase tracking-wider mb-3",children:"Status Changes"}),b.jsx("div",{className:"flex flex-wrap gap-2",children:i.statusChanges.map((o,g)=>b.jsx("div",{className:"text-xs font-mono text-[#555] bg-[#0a0a0f] px-2 py-1 rounded border border-[#1a1a2e]",children:o},g))})]})]})}function hu(i){return i===null?"--":`${Math.round(i)} ms`}function OE(i){return i===null?"0%":`${Math.min(100,Math.round(i/500*100))}%`}function ME({latency:i,loading:r}){var o,g,k;if(r)return b.jsx("div",{className:"flex items-center justify-center h-36 text-[#555] text-sm animate-pulse",children:"Loading latency metrics..."});if(!i||!i.aggregated)return b.jsx("div",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-4 text-sm text-[#888]",children:"No latency samples yet."});const a=[{label:"State Change Detection",latest:((o=i.realtime)==null?void 0:o.state_change_detection_ms)??null,avg:i.aggregated.state_change_detection_ms.avg,max:i.aggregated.state_change_detection_ms.max,count:i.aggregated.state_change_detection_ms.count},{label:"Channel Delivery",latest:null,avg:i.aggregated.channel_delivery_ms.avg,max:i.aggregated.channel_delivery_ms.max,count:i.aggregated.channel_delivery_ms.count},{label:"Permission Response",latest:((g=i.realtime)==null?void 0:g.permission_response_ms)??null,avg:i.aggregated.permission_response_ms.avg,max:i.aggregated.permission_response_ms.max,count:i.aggregated.permission_response_ms.count},{label:"Hook Processing",latest:((k=i.realtime)==null?void 0:k.hook_latency_ms)??null,avg:i.aggregated.hook_latency_ms.avg,max:i.aggregated.hook_latency_ms.max,count:i.aggregated.hook_latency_ms.count}];return b.jsxs("div",{className:"space-y-3",children:[b.jsx("h3",{className:"text-xs text-[#888] uppercase tracking-wider",children:"Latency"}),b.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:a.map(T=>b.jsxs("div",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-4",children:[b.jsxs("div",{className:"flex items-center justify-between text-xs text-[#888] uppercase tracking-wider",children:[b.jsx("span",{children:T.label}),b.jsxs("span",{children:[T.count," sample",T.count===1?"":"s"]})]}),b.jsx("div",{className:"mt-3 h-1.5 rounded bg-[#1a1a2e] overflow-hidden",children:b.jsx("div",{className:"h-full bg-[#00e5ff]/70 transition-all duration-300",style:{width:OE(T.avg)}})}),b.jsxs("div",{className:"mt-3 grid grid-cols-3 gap-2 text-xs font-mono text-[#bbb]",children:[b.jsxs("div",{children:[b.jsx("div",{className:"text-[#666] mb-1",children:"Latest"}),b.jsx("div",{className:"text-[#00e5ff]",children:hu(T.latest)})]}),b.jsxs("div",{children:[b.jsx("div",{className:"text-[#666] mb-1",children:"Avg"}),b.jsx("div",{className:"text-[#00ff88]",children:hu(T.avg)})]}),b.jsxs("div",{children:[b.jsx("div",{className:"text-[#666] mb-1",children:"Max"}),b.jsx("div",{className:"text-[#ffaa00]",children:hu(T.max)})]})]})]},T.label))})]})}const LE=new Set(["bypassPermissions","dontAsk","acceptEdits","plan","auto"]);function NE({prompt:i,permissionMode:r,onApprove:a,onReject:o}){const[g,k]=P.useState(!1);return r&&r!=="default"&&LE.has(r)?b.jsx("div",{className:"flex items-center gap-2 px-4 py-2 bg-[#003322]/50 border border-[#10b981]/30 rounded-lg text-sm",children:b.jsxs("span",{className:"text-[#10b981] font-semibold text-xs uppercase tracking-wider",children:["AUTO-APPROVED (",r,")"]})}):b.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-[#f59e0b]/40 rounded-lg",children:[b.jsxs("div",{className:"flex items-center gap-3 sm:gap-2 min-w-0",children:[b.jsx("span",{className:"text-[#f59e0b] text-lg shrink-0",children:"âš "}),b.jsxs("div",{className:"flex-1 min-w-0",children:[b.jsx("div",{className:"text-xs text-[#f59e0b] font-semibold uppercase tracking-wider mb-0.5",children:"Permission Required"}),b.jsxs("div",{className:`text-sm text-[#e0e0e0] font-mono cursor-pointer ${g?"":"truncate"}`,onClick:()=>k(!g),title:g?void 0:"Click to expand",children:[i,!g&&i.length>60&&b.jsx("span",{className:"text-[#888] ml-1",children:"..."})]})]})]}),b.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[b.jsx("button",{onClick:a,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#003322] hover:bg-[#004433] text-[#10b981] border border-[#10b981]/30 transition-colors",children:"Approve"}),b.jsx("button",{onClick:o,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#331111] hover:bg-[#442222] text-[#ef4444] border border-[#ef4444]/30 transition-colors",children:"Reject"})]})]})}function jE({open:i,onClose:r,sessionId:a}){const o=P.useRef(null),g=P.useRef(null),[k,T]=P.useState(""),[c,u]=P.useState(""),[h,y]=P.useState(!1),[d,C]=P.useState(null),E=Si(m=>m.addToast),O=P.useCallback(()=>{T(""),u(""),C(null),y(!1),r()},[r]);P.useEffect(()=>{if(!i)return;const m=p=>{var f;p.key==="Escape"&&((f=o.current)==null||f.abort(),O())};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[i,O]),P.useEffect(()=>{if(!i)return;const m=g.current;if(!m)return;const p='input, textarea, button, [tabindex]:not([tabindex="-1"])',f=v=>{if(v.key!=="Tab")return;const S=Array.from(m.querySelectorAll(p));if(S.length===0)return;const R=S[0],A=S[S.length-1];v.shiftKey?document.activeElement===R&&(v.preventDefault(),A.focus()):document.activeElement===A&&(v.preventDefault(),R.focus())};return m.addEventListener("keydown",f),()=>m.removeEventListener("keydown",f)},[i]);async function x(m){var f;if(m.preventDefault(),C(null),!k.trim()){C("Template name is required");return}y(!0),(f=o.current)==null||f.abort();const p=new AbortController;o.current=p;try{await Pw({name:k.trim(),description:c.trim()||void 0,sessionId:a}),E("success","Template saved",`"${k.trim()}" created successfully`),O()}catch(v){if(p.signal.aborted)return;C(v instanceof Error?v.message:"Failed to save template")}finally{o.current===p&&(o.current=null,y(!1))}}return i?b.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[b.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:O}),b.jsxs("div",{ref:g,role:"dialog","aria-modal":"true","aria-label":"Save session as template",className:"relative w-full max-w-md mx-4 bg-[#111118] border border-[#1a1a2e] rounded-lg shadow-2xl max-h-[90vh] overflow-y-auto",children:[b.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-5 py-4 border-b border-[#1a1a2e]",children:[b.jsx("h2",{className:"text-sm font-semibold text-gray-100",children:"Save as Template"}),b.jsx("button",{onClick:O,className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-gray-300 transition-colors",children:b.jsx(Kn,{className:"h-4 w-4"})})]}),b.jsxs("form",{onSubmit:x,className:"p-4 sm:p-5 space-y-4",children:[d&&b.jsx("div",{className:"p-3 rounded bg-red-500/10 border border-red-500/20 text-red-400 text-sm",children:d}),b.jsxs("div",{children:[b.jsx("label",{htmlFor:"template-name",className:"block text-xs font-medium text-gray-300 mb-1.5",children:"Template Name *"}),b.jsx("input",{id:"template-name",type:"text",value:k,onChange:m=>T(m.target.value),placeholder:"My template name",className:"w-full px-3 py-2 text-sm rounded bg-[#0a0a0f] border border-[#1a1a2e] text-gray-100 placeholder-gray-600 focus:outline-none focus:border-[#00e5ff] transition-colors",disabled:h})]}),b.jsxs("div",{children:[b.jsx("label",{htmlFor:"template-desc",className:"block text-xs font-medium text-gray-300 mb-1.5",children:"Description (optional)"}),b.jsx("textarea",{id:"template-desc",value:c,onChange:m=>u(m.target.value),placeholder:"What is this template for?",rows:3,className:"w-full px-3 py-2 text-sm rounded bg-[#0a0a0f] border border-[#1a1a2e] text-gray-100 placeholder-gray-600 focus:outline-none focus:border-[#00e5ff] transition-colors resize-none",disabled:h})]}),b.jsxs("div",{className:"flex gap-2 pt-2",children:[b.jsx("button",{type:"button",onClick:O,disabled:h,className:"flex-1 px-3 py-2 text-xs font-medium rounded bg-[#0a0a0f] border border-[#1a1a2e] text-gray-300 hover:text-gray-100 hover:border-[#333] transition-colors disabled:opacity-50",children:"Cancel"}),b.jsx("button",{type:"submit",disabled:h,className:"flex-1 px-3 py-2 text-xs font-medium rounded bg-[#00e5ff]/10 hover:bg-[#00e5ff]/20 text-[#00e5ff] border border-[#00e5ff]/30 transition-colors disabled:opacity-50 flex items-center justify-center gap-2",children:h?b.jsxs(b.Fragment,{children:[b.jsx(Un,{className:"h-3.5 w-3.5 animate-spin"}),"Saving…"]}):"Save Template"})]})]})]})]}):null}const BE=[{id:"session",label:"Session"},{id:"metrics",label:"Metrics"}],H_=["/clear","/compact","/cost","/config"];function zE(){const{id:i}=X_(),r=Ro(),[a,o]=P.useState("session"),[g,k]=P.useState(!1),{session:T,health:c,notFound:u,loading:h,metrics:y,metricsLoading:d,latency:C,latencyLoading:E}=yE(i??""),[O,x]=P.useState(""),[m,p]=P.useState(!1),[f,v]=P.useState(H_[0]),[S,R]=P.useState(!1),[A,M]=P.useState(""),[w,N]=P.useState(!1),[I,q]=P.useState(!1),[K,Z]=P.useState(!1),[J,ee]=P.useState(!1),[F,Q]=P.useState(null),ne=P.useRef(null),j=P.useRef(!1),U=Si(pe=>pe.addToast);if(h)return b.jsx("div",{className:"min-h-screen bg-[#0a0a0f] flex items-center justify-center text-[#555] text-sm",children:b.jsx("div",{className:"animate-pulse",children:"Loading session…"})});if(u||!T||!c)return b.jsxs("div",{className:"min-h-screen bg-[#0a0a0f] flex flex-col items-center justify-center text-[#555]",children:[b.jsx("div",{className:"text-6xl mb-4",children:"404"}),b.jsx("div",{className:"text-lg mb-6 text-[#e0e0e0]",children:"Session not found"}),b.jsx(fi,{to:"/",className:"text-sm text-[#00e5ff] hover:underline",children:"← Back to Overview"})]});const L=T,B=c,$=B.status==="permission_prompt"||B.status==="bash_approval";function Y(){qp(L.id).catch(pe=>U("error","Approve failed",pe instanceof Error?pe.message:void 0))}function re(){Ew(L.id).catch(pe=>U("error","Reject failed",pe instanceof Error?pe.message:void 0))}function he(){bu(L.id).catch(pe=>U("error","Interrupt failed",pe instanceof Error?pe.message:void 0))}async function V(){try{const pe=await Tw(L.id,{name:void 0});U("success","Session forked",`New session ${pe.id.slice(0,8)} created`),r(`/session/${pe.id}`)}catch(pe){U("error","Fork failed",pe instanceof Error?pe.message:void 0)}}function H(){kw(L.id).catch(pe=>U("error","Escape failed",pe instanceof Error?pe.message:void 0))}async function ce(){try{await yu(L.id),r("/")}catch(pe){U("error","Failed to kill session",pe instanceof Error?pe.message:void 0)}}async function oe(){if(!K){Z(!0);try{const pe=await Mw(L.id);Q({image:pe.image,mimeType:pe.mimeType,capturedAt:Date.now()}),U("success","Screenshot captured")}catch(pe){(typeof pe=="object"&&pe!==null&&"statusCode"in pe?pe.statusCode:void 0)===501?(ee(!0),U("warning","Screenshot unavailable","Playwright is not installed on the server.")):U("error","Screenshot failed",pe instanceof Error?pe.message:void 0)}finally{Z(!1)}}}async function me(){var At;const pe=O.trim();if(pe&&!j.current){j.current=!0,p(!0);try{await ww(L.id,pe),x("")}catch(mi){U("error","Failed to send message",mi instanceof Error?mi.message:void 0)}finally{p(!1),j.current=!1,(At=ne.current)==null||At.focus()}}}function _e(){var pe;x(f),(pe=ne.current)==null||pe.focus()}async function Te(){if(!(!f||S)){R(!0);try{await Dw(L.id,f),x("")}catch(pe){U("error","Failed to send slash command",pe instanceof Error?pe.message:void 0)}finally{R(!1)}}}async function je(){const pe=A.trim();if(!(!pe||I)){q(!0);try{await Ow(L.id,pe),M(""),N(!1)}catch(At){U("error","Failed to send bash command",At instanceof Error?At.message:void 0)}finally{q(!1)}}}function Ze(){A.trim()&&N(!0)}function ct(pe){M(pe),w&&N(!1)}function Ce(pe){pe.key==="Enter"&&!pe.shiftKey&&(pe.preventDefault(),me())}return b.jsxs("div",{className:"min-h-screen bg-[#0a0a0f]",children:[b.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:[b.jsxs("nav",{className:"text-xs text-[#555] flex items-center gap-1",children:[b.jsx(fi,{to:"/",className:"hover:text-[#00e5ff] transition-colors",children:"Overview"}),b.jsx("span",{className:"text-[#333]",children:"/"}),b.jsx("span",{className:"text-[#e0e0e0] truncate max-w-[160px] sm:max-w-xs",children:L.windowName||L.id})]}),b.jsx(SE,{session:L,health:B,onApprove:Y,onReject:re,onInterrupt:he,onFork:V,onKill:ce,onSaveTemplate:()=>k(!0)}),b.jsx("div",{className:"flex border-b border-[#1a1a2e]",role:"tablist",children:BE.map(pe=>b.jsxs("button",{id:`tab-${pe.id}`,onClick:()=>o(pe.id),role:"tab","aria-selected":a===pe.id,"aria-controls":`panel-${pe.id}`,tabIndex:a===pe.id?0:-1,className:`flex-1 min-h-[44px] text-sm font-medium transition-colors relative ${a===pe.id?"text-[#00e5ff]":"text-[#555] hover:text-[#888]"}`,children:[pe.label,a===pe.id&&b.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-[#00e5ff]"})]},pe.id))}),b.jsxs("div",{className:"bg-[#0a0a0f] rounded-lg min-h-[300px] sm:min-h-[400px]",children:[$&&b.jsx("div",{className:"p-3 sm:p-4 pb-0",children:b.jsx(NE,{prompt:B.details,permissionMode:L.permissionMode,onApprove:Y,onReject:re})}),a==="session"&&b.jsx("div",{id:"panel-session",role:"tabpanel","aria-labelledby":"tab-session",tabIndex:0,className:"h-[calc(100vh-380px)] sm:h-[calc(100vh-420px)] min-h-[250px] sm:min-h-[300px]",children:b.jsx(RE,{sessionId:L.id,status:B.status})}),a==="metrics"&&b.jsxs("div",{id:"panel-metrics",role:"tabpanel","aria-labelledby":"tab-metrics",tabIndex:0,className:"p-3 sm:p-4",children:[b.jsx(DE,{metrics:y,loading:d}),b.jsx("div",{className:"mt-4",children:b.jsx(ME,{latency:C,loading:E})})]})]}),b.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg p-3",children:[b.jsxs("div",{className:"flex items-center gap-2",children:[b.jsx("label",{htmlFor:"session-message-input",className:"sr-only",children:"Session message input"}),b.jsx("input",{id:"session-message-input",ref:ne,type:"text",value:O,onChange:pe=>x(pe.target.value),onKeyDown:Ce,placeholder:"Send a message to Claude…",disabled:m||!B.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"}),b.jsx("button",{onClick:me,disabled:m||!O.trim()||!B.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:b.jsx(Gb,{className:"h-4 w-4"})})]}),b.jsxs("div",{className:"flex flex-wrap items-center gap-2 mt-2 pt-2 border-t border-[#1a1a2e]/50",children:[b.jsx("label",{className:"sr-only",htmlFor:"slash-command-select",children:"Common slash command"}),b.jsx("select",{id:"slash-command-select",value:f,onChange:pe=>v(pe.target.value),disabled:S||!B.alive,className:"min-h-[44px] rounded border border-[#1a1a2e] bg-[#0a0a0f] px-3 py-2 text-xs font-medium text-gray-200 focus:outline-none focus:border-[#00e5ff] disabled:opacity-50",children:H_.map(pe=>b.jsx("option",{value:pe,children:pe},pe))}),b.jsx("button",{onClick:_e,disabled:S||!B.alive,className:"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 disabled:opacity-30 disabled:cursor-not-allowed",title:"Insert selected slash command into the message input",children:"Insert Slash"}),b.jsx("button",{onClick:Te,disabled:S||!B.alive,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#002a33] hover:bg-[#003744] text-[#00e5ff] border border-[#00e5ff]/30 transition-colors disabled:opacity-30 disabled:cursor-not-allowed",title:"Send selected slash command immediately",children:S?"Sending Slash…":"Run Slash"}),b.jsx("label",{className:"sr-only",htmlFor:"bash-command-input",children:"Bash command"}),b.jsx("input",{id:"bash-command-input",type:"text",value:A,onChange:pe=>ct(pe.target.value),placeholder:"Bash command (requires confirmation)…",disabled:I||!B.alive,className:"min-h-[44px] min-w-[220px] flex-1 rounded border border-[#1a1a2e] bg-[#0a0a0f] px-3 py-2 text-xs text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#ffaa00] font-mono disabled:opacity-50"}),w?b.jsxs(b.Fragment,{children:[b.jsx("span",{className:"text-[11px] text-[#ffaa00] italic",children:"Confirm bash command execution."}),b.jsx("button",{onClick:je,disabled:I||!A.trim()||!B.alive,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#3a2e00] hover:bg-[#4a3900] text-[#ffaa00] border border-[#ffaa00]/30 transition-colors disabled:opacity-30 disabled:cursor-not-allowed",title:"Send bash command",children:I?"Sending Bash…":"Confirm Bash"}),b.jsx("button",{onClick:()=>N(!1),disabled:I,className:"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 disabled:opacity-30 disabled:cursor-not-allowed",children:"Cancel Bash"})]}):b.jsx("button",{onClick:Ze,disabled:I||!A.trim()||!B.alive,className:"min-h-[44px] px-3 py-2 text-xs font-medium rounded bg-[#2b2200] hover:bg-[#3a2e00] text-[#ffaa00] border border-[#ffaa00]/30 transition-colors disabled:opacity-30 disabled:cursor-not-allowed",title:"Review bash command before sending",children:"Review Bash"}),!J&&b.jsxs("button",{onClick:oe,disabled:K||!B.alive,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 disabled:opacity-40 disabled:cursor-not-allowed",title:"Capture screenshot",children:[b.jsx(fb,{className:"h-3.5 w-3.5"}),K?"Capturing…":"Screenshot"]}),b.jsxs("button",{onClick:he,"aria-label":"Interrupt session with Ctrl+C",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:[b.jsx(Ub,{className:"h-3.5 w-3.5"}),"Interrupt"]}),b.jsxs("button",{onClick:H,"aria-label":"Send Escape to session",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:[b.jsx(Eb,{className:"h-3.5 w-3.5"}),"Escape"]})]}),F&&b.jsxs("div",{className:"mt-3 rounded-lg border border-[#1a1a2e] bg-[#0a0a0f] p-3",children:[b.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[b.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-gray-400",children:"Latest screenshot"}),b.jsx("span",{className:"text-[11px] text-gray-500",children:new Date(F.capturedAt).toLocaleTimeString()})]}),b.jsx("img",{src:F.image,alt:"Session screenshot preview",className:"max-h-[420px] w-full rounded border border-[#1a1a2e] object-contain bg-black"}),b.jsx("div",{className:"mt-2 text-[11px] text-gray-500",children:F.mimeType??"image/png"})]})]})]}),b.jsx(jE,{open:g,onClose:()=>k(!1),sessionId:i??""})]})}const HE={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"},UE=new Set(["running"]);function Xp({status:i}){const r=HE[i]??"bg-gray-500/10 text-gray-500 border-gray-500/30",a=UE.has(i);return b.jsxs("span",{className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs font-medium ${r}`,children:[a&&b.jsxs("span",{className:"relative flex h-2 w-2",children:[b.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75 bg-current"}),b.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-current"})]}),i]})}let IE=0;function Bn(){return{workDir:"",name:"",prompt:"",_key:IE++}}function PE({open:i,onClose:r}){const a=Ro(),o=P.useRef(null),g=P.useRef(null),[k,T]=P.useState(""),[c,u]=P.useState([Bn(),Bn()]),[h,y]=P.useState(!1),[d,C]=P.useState(null),E=P.useCallback(()=>{O(),r()},[r]);function O(){T(""),u([Bn(),Bn()]),y(!1),C(null)}P.useEffect(()=>{if(!i)return;const S=R=>{R.key==="Escape"&&E()};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[i,E]),P.useEffect(()=>{if(!i)return;const S=o.current;if(!S)return;const R='input, textarea, select, button, [tabindex]:not([tabindex="-1"])',A=M=>{if(M.key!=="Tab")return;const w=Array.from(S.querySelectorAll(R));if(w.length===0)return;const N=w[0],I=w[w.length-1];M.shiftKey?document.activeElement===N&&(M.preventDefault(),I.focus()):document.activeElement===I&&(M.preventDefault(),N.focus())};return S.addEventListener("keydown",A),()=>S.removeEventListener("keydown",A)},[i]),P.useEffect(()=>{if(i){const S=setTimeout(()=>{var R;return(R=g.current)==null?void 0:R.focus()},50);return()=>clearTimeout(S)}},[i]);function x(){c.length>=10||u([...c,Bn()])}function m(S){c.length<=1||u(c.filter((R,A)=>A!==S))}function p(S,R,A){u(c.map((M,w)=>w===S?{...M,[R]:A}:M))}async function f(S){S.preventDefault(),C(null);const R=c.filter(A=>A.workDir.trim());if(!k.trim()){C("Pipeline name is required");return}if(R.length===0){C("At least one step with a working directory is required");return}y(!0);try{const A=await Nw({name:k.trim(),workDir:R[0].workDir.trim(),stages:R.map(M=>({workDir:M.workDir.trim(),name:M.name.trim()||void 0,prompt:M.prompt.trim()||void 0}))});O(),r(),a(`/pipelines/${A.id}`)}catch(A){C(A instanceof Error?A.message:"Failed to create pipeline")}finally{y(!1)}}if(!i)return null;const v=k.trim()&&c.some(S=>S.workDir.trim());return b.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[b.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:E}),b.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:[b.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-5 py-4 border-b border-[#1a1a2e]",children:[b.jsx("h2",{className:"text-sm font-semibold text-gray-100",children:"New Pipeline"}),b.jsx("button",{onClick:E,className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-gray-300 transition-colors",children:b.jsx(Kn,{className:"h-4 w-4"})})]}),b.jsxs("form",{onSubmit:f,className:"p-4 sm:p-5 space-y-4",children:[b.jsxs("div",{children:[b.jsxs("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:["Pipeline Name ",b.jsx("span",{className:"text-[#ef4444]",children:"*"})]}),b.jsx("input",{type:"text",ref:g,value:k,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-[#3b82f6]"})]}),b.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 text-xs font-medium text-gray-500 px-1",children:[b.jsxs("span",{children:["Working Directory ",b.jsx("span",{className:"text-[#ef4444]",children:"*"})]}),b.jsx("span",{children:"Name"}),b.jsx("span",{children:"Prompt"}),b.jsx("span",{})]}),b.jsx("div",{className:"space-y-2",children:c.map((S,R)=>b.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 items-start",children:[b.jsx("input",{type:"text",value:S.workDir,onChange:A=>p(R,"workDir",A.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-[#3b82f6] font-mono"}),b.jsx("input",{type:"text",value:S.name,onChange:A=>p(R,"name",A.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-[#3b82f6]"}),b.jsx("input",{type:"text",value:S.prompt,onChange:A=>p(R,"prompt",A.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-[#3b82f6]"}),b.jsx("button",{type:"button",onClick:()=>m(R),disabled:c.length<=1,"aria-label":`Remove step ${R+1}`,className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-gray-500 hover:text-[#ef4444] transition-colors disabled:opacity-30 disabled:cursor-not-allowed",children:b.jsx(Au,{className:"h-3.5 w-3.5"})})]},S._key))}),c.length<10&&b.jsxs("button",{type:"button",onClick:x,className:"flex items-center gap-1.5 text-xs text-gray-500 hover:text-gray-300 transition-colors",children:[b.jsx(Fn,{className:"h-3.5 w-3.5"}),"Add Step"]}),d&&b.jsx("div",{className:"text-xs text-[#ef4444] bg-[#ef4444]/10 border border-[#ef4444]/20 rounded px-3 py-2",children:d}),b.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[b.jsx("button",{type:"button",onClick:E,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"}),b.jsxs("button",{type:"submit",disabled:h||!v,className:"min-h-[44px] flex items-center gap-1.5 px-4 py-2.5 text-xs font-medium rounded bg-[#3b82f6]/10 hover:bg-[#3b82f6]/20 text-[#3b82f6] border border-[#3b82f6]/30 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[h&&b.jsx(Un,{className:"h-3 w-3 animate-spin"}),"Create Pipeline"]})]})]})]})]})}const $E=5e3,ZE=3e4,qE=6e4;function FE(){const[i,r]=P.useState([]),[a,o]=P.useState(!0),[g,k]=P.useState(!1),T=et(y=>y.sseConnected),c=Si(y=>y.addToast),u=P.useCallback(async()=>{try{const y=await jw();return r(y),!0}catch(y){return c("error","Failed to fetch pipelines",y instanceof Error?y.message:void 0),!1}finally{o(!1)}},[c]);P.useEffect(()=>{let y,d=!1,C=0;const E=async()=>{if(d)return;const O=await u();if(d)return;const x=T?ZE:$E;let m=x;if(O)C=0;else{C+=1;const p=2**C;m=Math.min(x*p,qE)}y=setTimeout(()=>{E()},m)};return E(),()=>{d=!0,y&&clearTimeout(y)}},[u,T]);const h={total:i.length,running:i.filter(y=>y.status==="running").length,completed:i.filter(y=>y.status==="completed").length,failed:i.filter(y=>y.status==="failed").length};return a?b.jsx("div",{className:"flex items-center justify-center min-h-[50vh] text-gray-500 text-sm",children:b.jsx("div",{className:"animate-pulse",children:"Loading pipelines…"})}):b.jsxs("div",{className:"flex flex-col gap-6",children:[b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsxs("div",{children:[b.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"Pipelines"}),b.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Manage and monitor session pipelines"})]}),b.jsxs("button",{onClick:()=>k(!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:[b.jsx(Fn,{className:"h-3.5 w-3.5"}),"New Pipeline"]})]}),b.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[b.jsx(hi,{label:"Total",value:h.total}),b.jsx(hi,{label:"Running",value:h.running}),b.jsx(hi,{label:"Completed",value:h.completed}),b.jsx(hi,{label:"Failed",value:h.failed})]}),i.length===0?b.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-12 text-center",children:[b.jsx("p",{className:"text-gray-500",children:"No pipelines yet"}),b.jsx("p",{className:"mt-1 text-xs text-gray-600",children:"Create a pipeline to run sessions in sequence"})]}):b.jsx("div",{className:"space-y-3",children:i.map(y=>b.jsx(fi,{to:`/pipelines/${y.id}`,className:"block rounded-lg border border-[#1a1a2e] bg-[#111118] p-4 hover:border-[#00e5ff]/30 transition-colors",children:b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[b.jsx("span",{className:"font-medium text-gray-200 truncate",children:y.name}),b.jsx(Xp,{status:y.status})]}),b.jsxs("div",{className:"flex items-center gap-4 text-xs text-gray-500 shrink-0 ml-4",children:[b.jsxs("span",{children:[y.stages.length," step",y.stages.length!==1?"s":""]}),b.jsx("span",{children:Zs(y.createdAt)})]})]})},y.id))}),b.jsx(PE,{open:g,onClose:()=>k(!1)})]})}const KE=3e3,VE=3e4,GE=6e4;function YE(){const{id:i}=X_(),[r,a]=P.useState(null),[o,g]=P.useState(!0),[k,T]=P.useState(!1),c=et(y=>y.sseConnected),u=Si(y=>y.addToast),h=P.useCallback(async()=>{if(!i)return!1;try{const y=await Bw(i);return a(y),T(!1),!0}catch(y){const d=y;return d.statusCode===404?T(!0):u("error","Failed to fetch pipeline",d.message),!1}finally{g(!1)}},[i,u]);return P.useEffect(()=>{let y,d=!1,C=0;const E=async()=>{if(d)return;const O=await h();if(d)return;const x=c?VE:KE;let m=x;if(O)C=0;else{C+=1;const p=2**C;m=Math.min(x*p,GE)}y=setTimeout(()=>{E()},m)};return E(),()=>{d=!0,y&&clearTimeout(y)}},[h,c]),o?b.jsx("div",{className:"flex items-center justify-center min-h-[50vh] text-gray-500 text-sm",children:b.jsx("div",{className:"animate-pulse",children:"Loading pipeline…"})}):k||!r?b.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[50vh] text-gray-500",children:[b.jsx("div",{className:"text-6xl mb-4",children:"404"}),b.jsx("div",{className:"text-lg mb-6 text-gray-200",children:"Pipeline not found"}),b.jsx(fi,{to:"/pipelines",className:"text-sm text-[#00e5ff] hover:underline",children:"← Back to Pipelines"})]}):b.jsxs("div",{className:"flex flex-col gap-6",children:[b.jsxs("nav",{className:"text-xs text-gray-500 flex items-center gap-1",children:[b.jsx(fi,{to:"/pipelines",className:"hover:text-[#00e5ff] transition-colors",children:"Pipelines"}),b.jsx("span",{className:"text-gray-700",children:"/"}),b.jsx("span",{className:"text-gray-200 truncate max-w-xs",children:r.name})]}),b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:r.name}),b.jsx(Xp,{status:r.status})]}),b.jsxs("div",{className:"text-xs text-gray-500",children:["Created ",Zs(r.createdAt)]})]}),b.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118]",children:[b.jsx("div",{className:"px-4 py-3 border-b border-void-lighter",children:b.jsxs("h3",{className:"text-sm font-semibold text-gray-200",children:["Steps (",r.stages.length,")"]})}),r.stages.length===0?b.jsx("div",{className:"p-8 text-center text-gray-500 text-sm",children:"No steps yet"}):b.jsxs("table",{className:"w-full text-left text-sm",children:[b.jsx("thead",{children:b.jsxs("tr",{className:"border-b border-void-lighter text-gray-600",children:[b.jsx("th",{className:"px-4 py-3 font-medium w-16",children:"#"}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"Status"}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"Name"}),b.jsx("th",{className:"px-4 py-3 font-medium",children:"Session"})]})}),b.jsx("tbody",{children:r.stages.map((y,d)=>b.jsxs("tr",{className:"border-b border-void-lighter/50 transition-colors hover:border-l-2 hover:border-l-cyan",children:[b.jsxs("td",{className:"px-4 py-3 text-gray-500 font-mono text-xs",children:["#",d+1]}),b.jsx("td",{className:"px-4 py-3",children:b.jsx(zo,{status:y.status})}),b.jsx("td",{className:"px-4 py-3",children:y.sessionId?b.jsx(fi,{to:`/sessions/${encodeURIComponent(y.sessionId)}`,className:"font-medium text-gray-200 hover:text-cyan transition-colors",children:y.name}):b.jsx("span",{className:"font-medium text-gray-200",children:y.name})}),b.jsx("td",{className:"px-4 py-3 font-mono text-xs text-gray-400",children:y.sessionId??"—"})]},y.name))})]})]})]})}function WE(){return b.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 text-center",children:[b.jsx("h1",{className:"text-6xl font-bold text-gray-500",children:"404"}),b.jsx("p",{className:"text-lg text-gray-400",children:"Page not found"}),b.jsx(fi,{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 XE(){return b.jsx(nb,{children:b.jsx(ky,{children:b.jsxs(_s,{element:b.jsx(Ww,{}),children:[b.jsx(_s,{path:"/",element:b.jsx(gE,{})}),b.jsx(_s,{path:"/auth/keys",element:b.jsx(sE,{})}),b.jsx(_s,{path:"/sessions/:id",element:b.jsx(zE,{})}),b.jsx(_s,{path:"/pipelines",element:b.jsx(FE,{})}),b.jsx(_s,{path:"/pipelines/:id",element:b.jsx(YE,{})}),b.jsx(_s,{path:"*",element:b.jsx(WE,{})})]})})})}k0.createRoot(document.getElementById("root")).render(b.jsx(zn.StrictMode,{children:b.jsx(Wy,{basename:"/dashboard",children:b.jsx(XE,{})})}));
|