aegis-bridge 2.10.2 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dashboard/dist/assets/index-CDoGaFnn.js +302 -0
- package/dashboard/dist/assets/index-DmYSvvmE.css +32 -0
- package/dashboard/dist/index.html +2 -2
- package/dist/question-manager.d.ts +54 -0
- package/dist/question-manager.js +80 -0
- package/dist/server.js +29 -0
- package/dist/session.d.ts +1 -1
- package/dist/session.js +7 -26
- package/package.json +1 -1
- package/dashboard/dist/assets/index-DHKvv3aG.css +0 -32
- package/dashboard/dist/assets/index-DcdhTO7b.js +0 -302
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
var _0=Object.defineProperty;var p0=(i,r,a)=>r in i?_0(i,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[r]=a;var dt=(i,r,a)=>p0(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 I_(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Yc={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 v0(){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 l in g)l!=="key"&&(k[l]=g[l])}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 g0(){return Bm||(Bm=1,Yc.exports=v0()),Yc.exports}var C=g0(),Wc={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 y0(){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"),l=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),x=Symbol.iterator;function E(L){return L===null||typeof L!="object"?null:(L=x&&L[x]||L["@@iterator"],typeof L=="function"?L:null)}var M={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,_={};function p(L,z,V){this.props=L,this.context=z,this.refs=_,this.updater=V||M}p.prototype.isReactComponent={},p.prototype.setState=function(L,z){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,z,"setState")},p.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function f(){}f.prototype=p.prototype;function v(L,z,V){this.props=L,this.context=z,this.refs=_,this.updater=V||M}var b=v.prototype=new f;b.constructor=v,S(b,p.prototype),b.isPureReactComponent=!0;var R=Array.isArray;function A(){}var O={H:null,A:null,T:null,S:null},w=Object.prototype.hasOwnProperty;function j(L,z,V){var Q=V.ref;return{$$typeof:i,type:L,key:z,ref:Q!==void 0?Q:null,props:V}}function I(L,z){return j(L.type,z,L.props)}function Z(L){return typeof L=="object"&&L!==null&&L.$$typeof===i}function K(L){var z={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(V){return z[V]})}var $=/\/+/g;function X(L,z){return typeof L=="object"&&L!==null&&L.key!=null?K(""+L.key):z.toString(36)}function re(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(A,A):(L.status="pending",L.then(function(z){L.status==="pending"&&(L.status="fulfilled",L.value=z)},function(z){L.status==="pending"&&(L.status="rejected",L.reason=z)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function q(L,z,V,Q,fe){var de=typeof L;(de==="undefined"||de==="boolean")&&(L=null);var G=!1;if(L===null)G=!0;else switch(de){case"bigint":case"string":case"number":G=!0;break;case"object":switch(L.$$typeof){case i:case r:G=!0;break;case y:return G=L._init,q(G(L._payload),z,V,Q,fe)}}if(G)return fe=fe(L),G=Q===""?"."+X(L,0):Q,R(fe)?(V="",G!=null&&(V=G.replace($,"$&/")+"/"),q(fe,z,V,"",function(ae){return ae})):fe!=null&&(Z(fe)&&(fe=I(fe,V+(fe.key==null||L&&L.key===fe.key?"":(""+fe.key).replace($,"$&/")+"/")+G)),z.push(fe)),1;G=0;var U=Q===""?".":Q+":";if(R(L))for(var le=0;le<L.length;le++)Q=L[le],de=U+X(Q,le),G+=q(Q,z,V,de,fe);else if(le=E(L),typeof le=="function")for(L=le.call(L),le=0;!(Q=L.next()).done;)Q=Q.value,de=U+X(Q,le++),G+=q(Q,z,V,de,fe);else if(de==="object"){if(typeof L.then=="function")return q(re(L),z,V,Q,fe);throw z=String(L),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.")}return G}function ee(L,z,V){if(L==null)return L;var Q=[],fe=0;return q(L,Q,"","",function(de){return z.call(V,de,fe++)}),Q}function J(L){if(L._status===-1){var z=L._result;z=z(),z.then(function(V){(L._status===0||L._status===-1)&&(L._status=1,L._result=V)},function(V){(L._status===0||L._status===-1)&&(L._status=2,L._result=V)}),L._status===-1&&(L._status=0,L._result=z)}if(L._status===1)return L._result.default;throw L._result}var N=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var z=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(z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},B={map:ee,forEach:function(L,z,V){ee(L,function(){z.apply(this,arguments)},V)},count:function(L){var z=0;return ee(L,function(){z++}),z},toArray:function(L){return ee(L,function(z){return z})||[]},only:function(L){if(!Z(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return we.Activity=d,we.Children=B,we.Component=p,we.Fragment=a,we.Profiler=g,we.PureComponent=v,we.StrictMode=o,we.Suspense=h,we.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,we.__COMPILER_RUNTIME={__proto__:null,c:function(L){return O.H.useMemoCache(L)}},we.cache=function(L){return function(){return L.apply(null,arguments)}},we.cacheSignal=function(){return null},we.cloneElement=function(L,z,V){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var Q=S({},L.props),fe=L.key;if(z!=null)for(de in z.key!==void 0&&(fe=""+z.key),z)!w.call(z,de)||de==="key"||de==="__self"||de==="__source"||de==="ref"&&z.ref===void 0||(Q[de]=z[de]);var de=arguments.length-2;if(de===1)Q.children=V;else if(1<de){for(var G=Array(de),U=0;U<de;U++)G[U]=arguments[U+2];Q.children=G}return j(L.type,fe,Q)},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,z,V){var Q,fe={},de=null;if(z!=null)for(Q in z.key!==void 0&&(de=""+z.key),z)w.call(z,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(fe[Q]=z[Q]);var G=arguments.length-2;if(G===1)fe.children=V;else if(1<G){for(var U=Array(G),le=0;le<G;le++)U[le]=arguments[le+2];fe.children=U}if(L&&L.defaultProps)for(Q in G=L.defaultProps,G)fe[Q]===void 0&&(fe[Q]=G[Q]);return j(L,de,fe)},we.createRef=function(){return{current:null}},we.forwardRef=function(L){return{$$typeof:l,render:L}},we.isValidElement=Z,we.lazy=function(L){return{$$typeof:y,_payload:{_status:-1,_result:L},_init:J}},we.memo=function(L,z){return{$$typeof:u,type:L,compare:z===void 0?null:z}},we.startTransition=function(L){var z=O.T,V={};O.T=V;try{var Q=L(),fe=O.S;fe!==null&&fe(V,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(A,N)}catch(de){N(de)}finally{z!==null&&V.types!==null&&(z.types=V.types),O.T=z}},we.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},we.use=function(L){return O.H.use(L)},we.useActionState=function(L,z,V){return O.H.useActionState(L,z,V)},we.useCallback=function(L,z){return O.H.useCallback(L,z)},we.useContext=function(L){return O.H.useContext(L)},we.useDebugValue=function(){},we.useDeferredValue=function(L,z){return O.H.useDeferredValue(L,z)},we.useEffect=function(L,z){return O.H.useEffect(L,z)},we.useEffectEvent=function(L){return O.H.useEffectEvent(L)},we.useId=function(){return O.H.useId()},we.useImperativeHandle=function(L,z,V){return O.H.useImperativeHandle(L,z,V)},we.useInsertionEffect=function(L,z){return O.H.useInsertionEffect(L,z)},we.useLayoutEffect=function(L,z){return O.H.useLayoutEffect(L,z)},we.useMemo=function(L,z){return O.H.useMemo(L,z)},we.useOptimistic=function(L,z){return O.H.useOptimistic(L,z)},we.useReducer=function(L,z,V){return O.H.useReducer(L,z,V)},we.useRef=function(L){return O.H.useRef(L)},we.useState=function(L){return O.H.useState(L)},we.useSyncExternalStore=function(L,z,V){return O.H.useSyncExternalStore(L,z,V)},we.useTransition=function(){return O.H.useTransition()},we.version="19.2.4",we}var Hm;function Su(){return Hm||(Hm=1,Wc.exports=y0()),Wc.exports}var P=Su();const zn=I_(P);var Xc={exports:{}},Ln={},Jc={exports:{}},Qc={};/**
|
|
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 b0(){return Um||(Um=1,(function(i){function r(q,ee){var J=q.length;q.push(ee);e:for(;0<J;){var N=J-1>>>1,B=q[N];if(0<g(B,ee))q[N]=ee,q[J]=B,J=N;else break e}}function a(q){return q.length===0?null:q[0]}function o(q){if(q.length===0)return null;var ee=q[0],J=q.pop();if(J!==ee){q[0]=J;e:for(var N=0,B=q.length,L=B>>>1;N<L;){var z=2*(N+1)-1,V=q[z],Q=z+1,fe=q[Q];if(0>g(V,J))Q<B&&0>g(fe,V)?(q[N]=fe,q[Q]=J,N=Q):(q[N]=V,q[z]=J,N=z);else if(Q<B&&0>g(fe,J))q[N]=fe,q[Q]=J,N=Q;else break e}}return ee}function g(q,ee){var J=q.sortIndex-ee.sortIndex;return J!==0?J:q.id-ee.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,l=T.now();i.unstable_now=function(){return T.now()-l}}var h=[],u=[],y=1,d=null,x=3,E=!1,M=!1,S=!1,_=!1,p=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;function b(q){for(var ee=a(u);ee!==null;){if(ee.callback===null)o(u);else if(ee.startTime<=q)o(u),ee.sortIndex=ee.expirationTime,r(h,ee);else break;ee=a(u)}}function R(q){if(S=!1,b(q),!M)if(a(h)!==null)M=!0,A||(A=!0,K());else{var ee=a(u);ee!==null&&re(R,ee.startTime-q)}}var A=!1,O=-1,w=5,j=-1;function I(){return _?!0:!(i.unstable_now()-j<w)}function Z(){if(_=!1,A){var q=i.unstable_now();j=q;var ee=!0;try{e:{M=!1,S&&(S=!1,f(O),O=-1),E=!0;var J=x;try{t:{for(b(q),d=a(h);d!==null&&!(d.expirationTime>q&&I());){var N=d.callback;if(typeof N=="function"){d.callback=null,x=d.priorityLevel;var B=N(d.expirationTime<=q);if(q=i.unstable_now(),typeof B=="function"){d.callback=B,b(q),ee=!0;break t}d===a(h)&&o(h),b(q)}else o(h);d=a(h)}if(d!==null)ee=!0;else{var L=a(u);L!==null&&re(R,L.startTime-q),ee=!1}}break e}finally{d=null,x=J,E=!1}ee=void 0}}finally{ee?K():A=!1}}}var K;if(typeof v=="function")K=function(){v(Z)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,X=$.port2;$.port1.onmessage=Z,K=function(){X.postMessage(null)}}else K=function(){p(Z,0)};function re(q,ee){O=p(function(){q(i.unstable_now())},ee)}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(q){q.callback=null},i.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):w=0<q?Math.floor(1e3/q):5},i.unstable_getCurrentPriorityLevel=function(){return x},i.unstable_next=function(q){switch(x){case 1:case 2:case 3:var ee=3;break;default:ee=x}var J=x;x=ee;try{return q()}finally{x=J}},i.unstable_requestPaint=function(){_=!0},i.unstable_runWithPriority=function(q,ee){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var J=x;x=q;try{return ee()}finally{x=J}},i.unstable_scheduleCallback=function(q,ee,J){var N=i.unstable_now();switch(typeof J=="object"&&J!==null?(J=J.delay,J=typeof J=="number"&&0<J?N+J:N):J=N,q){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=J+B,q={id:y++,callback:ee,priorityLevel:q,startTime:J,expirationTime:B,sortIndex:-1},J>N?(q.sortIndex=J,r(u,q),a(h)===null&&q===a(u)&&(S?(f(O),O=-1):S=!0,re(R,J-N))):(q.sortIndex=B,r(h,q),M||E||(M=!0,A||(A=!0,K()))),q},i.unstable_shouldYield=I,i.unstable_wrapCallback=function(q){var ee=x;return function(){var J=x;x=ee;try{return q.apply(this,arguments)}finally{x=J}}}})(Qc)),Qc}var Im;function S0(){return Im||(Im=1,Jc.exports=b0()),Jc.exports}var eu={exports:{}},wt={};/**
|
|
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 $m;function x0(){if($m)return wt;$m=1;var i=Su();function r(h){var u="https://react.dev/errors/"+h;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)u+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+h+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var o={d:{f:a,r:function(){throw Error(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(h,u,y){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:g,key:d==null?null:""+d,children:h,containerInfo:u,implementation:y}}var T=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(h,u){if(h==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return wt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,wt.createPortal=function(h,u){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)throw Error(r(299));return k(h,u,null,y)},wt.flushSync=function(h){var u=T.T,y=o.p;try{if(T.T=null,o.p=2,h)return h()}finally{T.T=u,o.p=y,o.d.f()}},wt.preconnect=function(h,u){typeof h=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,o.d.C(h,u))},wt.prefetchDNS=function(h){typeof h=="string"&&o.d.D(h)},wt.preinit=function(h,u){if(typeof h=="string"&&u&&typeof u.as=="string"){var y=u.as,d=l(y,u.crossOrigin),x=typeof u.integrity=="string"?u.integrity:void 0,E=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;y==="style"?o.d.S(h,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:d,integrity:x,fetchPriority:E}):y==="script"&&o.d.X(h,{crossOrigin:d,integrity:x,fetchPriority:E,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},wt.preinitModule=function(h,u){if(typeof h=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var y=l(u.as,u.crossOrigin);o.d.M(h,{crossOrigin:y,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0})}}else u==null&&o.d.M(h)},wt.preload=function(h,u){if(typeof h=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var y=u.as,d=l(y,u.crossOrigin);o.d.L(h,y,{crossOrigin:d,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0,type:typeof u.type=="string"?u.type:void 0,fetchPriority:typeof u.fetchPriority=="string"?u.fetchPriority:void 0,referrerPolicy:typeof u.referrerPolicy=="string"?u.referrerPolicy:void 0,imageSrcSet:typeof u.imageSrcSet=="string"?u.imageSrcSet:void 0,imageSizes:typeof u.imageSizes=="string"?u.imageSizes:void 0,media:typeof u.media=="string"?u.media:void 0})}},wt.preloadModule=function(h,u){if(typeof h=="string")if(u){var y=l(u.as,u.crossOrigin);o.d.m(h,{as:typeof u.as=="string"&&u.as!=="script"?u.as:void 0,crossOrigin:y,integrity:typeof u.integrity=="string"?u.integrity:void 0})}else o.d.m(h)},wt.requestFormReset=function(h){o.d.r(h)},wt.unstable_batchedUpdates=function(h,u){return h(u)},wt.useFormState=function(h,u,y){return T.H.useFormState(h,u,y)},wt.useFormStatus=function(){return T.H.useHostTransitionStatus()},wt.version="19.2.4",wt}var Pm;function C0(){if(Pm)return eu.exports;Pm=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(),eu.exports=x0(),eu.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 w0(){if(Zm)return Ln;Zm=1;var i=S0(),r=Su(),a=C0();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 l(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function h(e){if(k(e)!==e)throw Error(o(188))}function u(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 c=s.return;if(c===null)break;var m=c.alternate;if(m===null){if(n=c.return,n!==null){s=n;continue}break}if(c.child===m.child){for(m=c.child;m;){if(m===s)return h(c),e;if(m===n)return h(c),t;m=m.sibling}throw Error(o(188))}if(s.return!==n.return)s=c,n=m;else{for(var D=!1,H=c.child;H;){if(H===s){D=!0,s=c,n=m;break}if(H===n){D=!0,n=c,s=m;break}H=H.sibling}if(!D){for(H=m.child;H;){if(H===s){D=!0,s=m,n=c;break}if(H===n){D=!0,n=m,s=c;break}H=H.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,x=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),M=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),v=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),Z=Symbol.iterator;function K(e){return e===null||typeof e!="object"?null:(e=Z&&e[Z]||e["@@iterator"],typeof e=="function"?e:null)}var $=Symbol.for("react.client.reference");function X(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===$?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case S:return"Fragment";case p:return"Profiler";case _:return"StrictMode";case R:return"Suspense";case A:return"SuspenseList";case j:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case M:return"Portal";case v:return e.displayName||"Context";case f:return(e._context.displayName||"Context")+".Consumer";case b:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case O:return t=e.displayName||null,t!==null?t:X(e.type)||"Memo";case w:t=e._payload,e=e._init;try{return X(e(t))}catch{}}return null}var re=Array.isArray,q=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J={pending:!1,data:null,method:null,action:null},N=[],B=-1;function L(e){return{current:e}}function z(e){0>B||(e.current=N[B],N[B]=null,B--)}function V(e,t){B++,N[B]=e.current,e.current=t}var Q=L(null),fe=L(null),de=L(null),G=L(null);function U(e,t){switch(V(de,t),V(fe,e),V(Q,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}}z(Q),V(Q,e)}function le(){z(Q),z(fe),z(de)}function ae(e){e.memoizedState!==null&&V(G,e);var t=Q.current,s=nm(t,e.type);t!==s&&(V(fe,e),V(Q,s))}function pe(e){fe.current===e&&(z(Q),z(fe)),G.current===e&&(z(G),Rn._currentValue=J)}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 me(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 he=function(){throw Error()};if(Object.defineProperty(he.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(he,[])}catch(ne){var se=ne}Reflect.construct(e,[],he)}else{try{he.call()}catch(ne){se=ne}e.call(he.prototype)}}else{try{throw Error()}catch(ne){se=ne}(he=e())&&typeof he.catch=="function"&&he.catch(function(){})}}catch(ne){if(ne&&se&&typeof ne.stack=="string")return[ne.stack,se.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=n.DetermineComponentFrameRoot(),D=m[0],H=m[1];if(D&&H){var F=D.split(`
|
|
44
|
+
`),ie=H.split(`
|
|
45
|
+
`);for(c=n=0;n<F.length&&!F[n].includes("DetermineComponentFrameRoot");)n++;for(;c<ie.length&&!ie[c].includes("DetermineComponentFrameRoot");)c++;if(n===F.length||c===ie.length)for(n=F.length-1,c=ie.length-1;1<=n&&0<=c&&F[n]!==ie[c];)c--;for(;1<=n&&0<=c;n--,c--)if(F[n]!==ie[c]){if(n!==1||c!==1)do if(n--,c--,0>c||F[n]!==ie[c]){var oe=`
|
|
46
|
+
`+F[n].replace(" at new "," at ");return e.displayName&&oe.includes("<anonymous>")&&(oe=oe.replace("<anonymous>",e.displayName)),oe}while(1<=n&&0<=c);break}}}finally{Ze=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?je(s):""}function Se(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 me(e.type,!1);case 11:return me(e.type.render,!1);case 1:return me(e.type,!0);case 31:return je("Activity");default:return""}}function ni(e){try{var t="",s=null;do t+=Se(e,s),s=e,e=e.return;while(e);return t}catch(n){return`
|
|
47
|
+
Error generating stack: `+n.message+`
|
|
48
|
+
`+n.stack}}var ys=Object.prototype.hasOwnProperty,bs=i.unstable_scheduleCallback,Ss=i.unstable_cancelCallback,Fs=i.unstable_shouldYield,Tt=i.unstable_requestPaint,_t=i.unstable_now,Kt=i.unstable_getCurrentPriorityLevel,Ii=i.unstable_ImmediatePriority,Ks=i.unstable_UserBlockingPriority,Bt=i.unstable_NormalPriority,Vs=i.unstable_LowPriority,ai=i.unstable_IdlePriority,xs=i.log,Ge=i.unstable_setDisableYieldValue,Cs=null,zt=null;function $i(e){if(typeof xs=="function"&&Ge(e),zt&&typeof zt.setStrictMode=="function")try{zt.setStrictMode(Cs,e)}catch{}}var Ht=Math.clz32?Math.clz32:tv,Qp=Math.log,ev=Math.LN2;function tv(e){return e>>>=0,e===0?32:31-(Qp(e)/ev|0)|0}var Vn=256,Gn=262144,Yn=4194304;function ws(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 Wn(e,t,s){var n=e.pendingLanes;if(n===0)return 0;var c=0,m=e.suspendedLanes,D=e.pingedLanes;e=e.warmLanes;var H=n&134217727;return H!==0?(n=H&~m,n!==0?c=ws(n):(D&=H,D!==0?c=ws(D):s||(s=H&~e,s!==0&&(c=ws(s))))):(H=n&~m,H!==0?c=ws(H):D!==0?c=ws(D):s||(s=n&~e,s!==0&&(c=ws(s)))),c===0?0:t!==0&&t!==c&&(t&m)===0&&(m=c&-c,s=t&-t,m>=s||m===32&&(s&4194048)!==0)?t:c}function Ir(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function iv(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=Yn;return Yn<<=1,(Yn&62914560)===0&&(Yn=4194304),e}function zo(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function $r(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function sv(e,t,s,n,c,m){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 H=e.entanglements,F=e.expirationTimes,ie=e.hiddenUpdates;for(s=D&~s;0<s;){var oe=31-Ht(s),he=1<<oe;H[oe]=0,F[oe]=-1;var se=ie[oe];if(se!==null)for(ie[oe]=null,oe=0;oe<se.length;oe++){var ne=se[oe];ne!==null&&(ne.lane&=-536870913)}s&=~he}n!==0&&Uu(e,n,0),m!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=m&~(D&~t))}function Uu(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-Ht(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-Ht(s),c=1<<n;c&t|e[n]&t&&(e[n]|=t),s&=~c}}function $u(e,t){var s=t&-t;return s=(s&42)!==0?1:Ho(s),(s&(e.suspendedLanes|t))!==0?0:s}function Ho(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 Uo(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Pu(){var e=ee.p;return e!==0?e:(e=window.event,e===void 0?32:Rm(e.type))}function Zu(e,t){var s=ee.p;try{return ee.p=e,t()}finally{ee.p=s}}var Pi=Math.random().toString(36).slice(2),yt="__reactFiber$"+Pi,Rt="__reactProps$"+Pi,Gs="__reactContainer$"+Pi,Io="__reactEvents$"+Pi,rv="__reactListeners$"+Pi,nv="__reactHandles$"+Pi,qu="__reactResources$"+Pi,Pr="__reactMarker$"+Pi;function $o(e){delete e[yt],delete e[Rt],delete e[Io],delete e[rv],delete e[nv]}function Ys(e){var t=e[yt];if(t)return t;for(var s=e.parentNode;s;){if(t=s[Gs]||s[yt]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=fm(e);e!==null;){if(s=e[yt])return s;e=fm(e)}return t}e=s,s=e.parentNode}return null}function Ws(e){if(e=e[yt]||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 vt(e){e[Pr]=!0}var Fu=new Set,Ku={};function Es(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 av=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 ov(e){return ys.call(Gu,e)?!0:ys.call(Vu,e)?!1:av.test(e)?Gu[e]=!0:(Vu[e]=!0,!1)}function Xn(e,t,s){if(ov(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 Jn(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 yi(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 Vt(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 lv(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 c=n.get,m=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(D){s=""+D,m.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 Po(e){if(!e._valueTracker){var t=Yu(e)?"checked":"value";e._valueTracker=lv(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 Qn(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 cv=/[\n"\\]/g;function Gt(e){return e.replace(cv,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Zo(e,t,s,n,c,m,D,H){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=""+Vt(t)):e.value!==""+Vt(t)&&(e.value=""+Vt(t)):D!=="submit"&&D!=="reset"||e.removeAttribute("value"),t!=null?qo(e,D,Vt(t)):s!=null?qo(e,D,Vt(s)):n!=null&&e.removeAttribute("value"),c==null&&m!=null&&(e.defaultChecked=!!m),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),H!=null&&typeof H!="function"&&typeof H!="symbol"&&typeof H!="boolean"?e.name=""+Vt(H):e.removeAttribute("name")}function Xu(e,t,s,n,c,m,D,H){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(e.type=m),t!=null||s!=null){if(!(m!=="submit"&&m!=="reset"||t!=null)){Po(e);return}s=s!=null?""+Vt(s):"",t=t!=null?""+Vt(t):s,H||t===e.value||(e.value=t),e.defaultValue=t}n=n??c,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=H?e.checked:!!n,e.defaultChecked=!!n,D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(e.name=D),Po(e)}function qo(e,t,s){t==="number"&&Qn(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function Qs(e,t,s,n){if(e=e.options,t){t={};for(var c=0;c<s.length;c++)t["$"+s[c]]=!0;for(s=0;s<e.length;s++)c=t.hasOwnProperty("$"+e[s].value),e[s].selected!==c&&(e[s].selected=c),c&&n&&(e[s].defaultSelected=!0)}else{for(s=""+Vt(s),t=null,c=0;c<e.length;c++){if(e[c].value===s){e[c].selected=!0,n&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function Ju(e,t,s){if(t!=null&&(t=""+Vt(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+Vt(s):""}function Qu(e,t,s,n){if(t==null){if(n!=null){if(s!=null)throw Error(o(92));if(re(n)){if(1<n.length)throw Error(o(93));n=n[0]}s=n}s==null&&(s=""),t=s}s=Vt(t),e.defaultValue=s,n=e.textContent,n===s&&n!==""&&n!==null&&(e.value=n),Po(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 uv=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||uv.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 c in t)n=t[c],t.hasOwnProperty(c)&&s[c]!==n&&eh(e,c,n)}else for(var m in t)t.hasOwnProperty(m)&&eh(e,m,t[m])}function Fo(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 hv=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"]]),fv=/^[\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 ea(e){return fv.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function bi(){}var Ko=null;function Vo(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[Rt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Zo(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="'+Gt(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var n=s[t];if(n!==e&&n.form===e.form){var c=n[Rt]||null;if(!c)throw Error(o(90));Zo(n,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.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 Go=!1;function sh(e,t,s){if(Go)return e(t,s);Go=!0;try{var n=e(t);return n}finally{if(Go=!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[Rt]||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 Si=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Yo=!1;if(Si)try{var Fr={};Object.defineProperty(Fr,"passive",{get:function(){Yo=!0}}),window.addEventListener("test",Fr,Fr),window.removeEventListener("test",Fr,Fr)}catch{Yo=!1}var Zi=null,Wo=null,ta=null;function rh(){if(ta)return ta;var e,t=Wo,s=t.length,n,c="value"in Zi?Zi.value:Zi.textContent,m=c.length;for(e=0;e<s&&t[e]===c[e];e++);var D=s-e;for(n=1;n<=D&&t[s-n]===c[m-n];n++);return ta=c.slice(e,1<n?1-n:void 0)}function ia(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 sa(){return!0}function nh(){return!1}function At(e){function t(s,n,c,m,D){this._reactName=s,this._targetInst=c,this.type=n,this.nativeEvent=m,this.target=D,this.currentTarget=null;for(var H in e)e.hasOwnProperty(H)&&(s=e[H],this[H]=s?s(m):m[H]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?sa: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=sa)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=sa)},persist:function(){},isPersistent:sa}),t}var ks={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ra=At(ks),Kr=d({},ks,{view:0,detail:0}),dv=At(Kr),Xo,Jo,Vr,na=d({},Kr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:el,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"?(Xo=e.screenX-Vr.screenX,Jo=e.screenY-Vr.screenY):Jo=Xo=0,Vr=e),Xo)},movementY:function(e){return"movementY"in e?e.movementY:Jo}}),ah=At(na),mv=d({},na,{dataTransfer:0}),_v=At(mv),pv=d({},Kr,{relatedTarget:0}),Qo=At(pv),vv=d({},ks,{animationName:0,elapsedTime:0,pseudoElement:0}),gv=At(vv),yv=d({},ks,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),bv=At(yv),Sv=d({},ks,{data:0}),oh=At(Sv),xv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Cv={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"},wv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ev(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=wv[e])?!!t[e]:!1}function el(){return Ev}var kv=d({},Kr,{key:function(e){if(e.key){var t=xv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ia(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Cv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:el,charCode:function(e){return e.type==="keypress"?ia(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ia(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Tv=At(kv),Rv=d({},na,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),lh=At(Rv),Av=d({},Kr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:el}),Dv=At(Av),Ov=d({},ks,{propertyName:0,elapsedTime:0,pseudoElement:0}),Mv=At(Ov),Lv=d({},na,{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}),Nv=At(Lv),jv=d({},ks,{newState:0,oldState:0}),Bv=At(jv),zv=[9,13,27,32],tl=Si&&"CompositionEvent"in window,Gr=null;Si&&"documentMode"in document&&(Gr=document.documentMode);var Hv=Si&&"TextEvent"in window&&!Gr,ch=Si&&(!tl||Gr&&8<Gr&&11>=Gr),uh=" ",hh=!1;function fh(e,t){switch(e){case"keyup":return zv.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 Uv(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 Iv(e,t){if(sr)return e==="compositionend"||!tl&&fh(e,t)?(e=rh(),ta=Wo=Zi=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 $v={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"?!!$v[e.type]:t==="textarea"}function _h(e,t,s,n){tr?ir?ir.push(n):ir=[n]:tr=n,t=Ga(t,"onChange"),0<t.length&&(s=new ra("onChange","change",null,s,n),e.push({event:s,listeners:t}))}var Yr=null,Wr=null;function Pv(e){Jd(e,0)}function aa(e){var t=Zr(e);if(Wu(t))return e}function ph(e,t){if(e==="change")return t}var vh=!1;if(Si){var il;if(Si){var sl="oninput"in document;if(!sl){var gh=document.createElement("div");gh.setAttribute("oninput","return;"),sl=typeof gh.oninput=="function"}il=sl}else il=!1;vh=il&&(!document.documentMode||9<document.documentMode)}function yh(){Yr&&(Yr.detachEvent("onpropertychange",bh),Wr=Yr=null)}function bh(e){if(e.propertyName==="value"&&aa(Wr)){var t=[];_h(t,Wr,e,Vo(e)),sh(Pv,t)}}function Zv(e,t,s){e==="focusin"?(yh(),Yr=t,Wr=s,Yr.attachEvent("onpropertychange",bh)):e==="focusout"&&yh()}function qv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return aa(Wr)}function Fv(e,t){if(e==="click")return aa(t)}function Kv(e,t){if(e==="input"||e==="change")return aa(t)}function Vv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ut=typeof Object.is=="function"?Object.is:Vv;function Xr(e,t){if(Ut(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 c=s[n];if(!ys.call(t,c)||!Ut(e[c],t[c]))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=Qn(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=Qn(e.document)}return t}function rl(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 Gv=Si&&"documentMode"in document&&11>=document.documentMode,rr=null,nl=null,Jr=null,al=!1;function Eh(e,t,s){var n=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;al||rr==null||rr!==Qn(n)||(n=rr,"selectionStart"in n&&rl(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=Ga(nl,"onSelect"),0<n.length&&(t=new ra("onSelect","select",null,t,s),e.push({event:t,listeners:n}),t.target=rr)))}function Ts(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var nr={animationend:Ts("Animation","AnimationEnd"),animationiteration:Ts("Animation","AnimationIteration"),animationstart:Ts("Animation","AnimationStart"),transitionrun:Ts("Transition","TransitionRun"),transitionstart:Ts("Transition","TransitionStart"),transitioncancel:Ts("Transition","TransitionCancel"),transitionend:Ts("Transition","TransitionEnd")},ol={},kh={};Si&&(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(ol[e])return ol[e];if(!nr[e])return e;var t=nr[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in kh)return ol[e]=t[s];return e}var Th=Rs("animationend"),Rh=Rs("animationiteration"),Ah=Rs("animationstart"),Yv=Rs("transitionrun"),Wv=Rs("transitionstart"),Xv=Rs("transitioncancel"),Dh=Rs("transitionend"),Oh=new Map,ll="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(" ");ll.push("scrollEnd");function oi(e,t){Oh.set(e,t),Es(t,[e])}var oa=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)},Yt=[],ar=0,cl=0;function la(){for(var e=ar,t=cl=ar=0;t<e;){var s=Yt[t];Yt[t++]=null;var n=Yt[t];Yt[t++]=null;var c=Yt[t];Yt[t++]=null;var m=Yt[t];if(Yt[t++]=null,n!==null&&c!==null){var D=n.pending;D===null?c.next=c:(c.next=D.next,D.next=c),n.pending=c}m!==0&&Mh(s,c,m)}}function ca(e,t,s,n){Yt[ar++]=e,Yt[ar++]=t,Yt[ar++]=s,Yt[ar++]=n,cl|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function ul(e,t,s,n){return ca(e,t,s,n),ua(e)}function As(e,t){return ca(e,null,null,t),ua(e)}function Mh(e,t,s){e.lanes|=s;var n=e.alternate;n!==null&&(n.lanes|=s);for(var c=!1,m=e.return;m!==null;)m.childLanes|=s,n=m.alternate,n!==null&&(n.childLanes|=s),m.tag===22&&(e=m.stateNode,e===null||e._visibility&1||(c=!0)),e=m,m=m.return;return e.tag===3?(m=e.stateNode,c&&t!==null&&(c=31-Ht(s),e=m.hiddenUpdates,n=e[c],n===null?e[c]=[t]:n.push(t),t.lane=s|536870912),m):null}function ua(e){if(50<Sn)throw Sn=0,yc=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 Jv(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 It(e,t,s,n){return new Jv(e,t,s,n)}function hl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function xi(e,t){var s=e.alternate;return s===null?(s=It(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 ha(e,t,s,n,c,m){var D=0;if(n=e,typeof e=="function")hl(e)&&(D=1);else if(typeof e=="string")D=s0(e,s,Q.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case j:return e=It(31,s,t,c),e.elementType=j,e.lanes=m,e;case S:return Ds(s.children,c,m,t);case _:D=8,c|=24;break;case p:return e=It(12,s,t,c|2),e.elementType=p,e.lanes=m,e;case R:return e=It(13,s,t,c),e.elementType=R,e.lanes=m,e;case A:return e=It(19,s,t,c),e.elementType=A,e.lanes=m,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case v:D=10;break e;case f:D=9;break e;case b:D=11;break e;case O: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=It(D,s,t,c),t.elementType=e,t.type=n,t.lanes=m,t}function Ds(e,t,s,n){return e=It(7,e,n,t),e.lanes=s,e}function fl(e,t,s){return e=It(6,e,null,t),e.lanes=s,e}function Nh(e){var t=It(18,null,null,0);return t.stateNode=e,t}function dl(e,t,s){return t=It(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 Wt(e,t){if(typeof e=="object"&&e!==null){var s=jh.get(e);return s!==void 0?s:(t={value:e,source:t,stack:ni(t)},jh.set(e,t),t)}return{value:e,source:t,stack:ni(t)}}var lr=[],cr=0,fa=null,Qr=0,Xt=[],Jt=0,qi=null,di=1,mi="";function Ci(e,t){lr[cr++]=Qr,lr[cr++]=fa,fa=e,Qr=t}function Bh(e,t,s){Xt[Jt++]=di,Xt[Jt++]=mi,Xt[Jt++]=qi,qi=e;var n=di;e=mi;var c=32-Ht(n)-1;n&=~(1<<c),s+=1;var m=32-Ht(t)+c;if(30<m){var D=c-c%5;m=(n&(1<<D)-1).toString(32),n>>=D,c-=D,di=1<<32-Ht(t)+c|s<<c|n,mi=m+e}else di=1<<m|s<<c|n,mi=e}function ml(e){e.return!==null&&(Ci(e,1),Bh(e,1,0))}function _l(e){for(;e===fa;)fa=lr[--cr],lr[cr]=null,Qr=lr[--cr],lr[cr]=null;for(;e===qi;)qi=Xt[--Jt],Xt[Jt]=null,mi=Xt[--Jt],Xt[Jt]=null,di=Xt[--Jt],Xt[Jt]=null}function zh(e,t){Xt[Jt++]=di,Xt[Jt++]=mi,Xt[Jt++]=qi,di=t.id,mi=t.overflow,qi=e}var bt=null,Ye=null,Le=!1,Fi=null,Qt=!1,pl=Error(o(519));function Ki(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw en(Wt(t,e)),pl}function Hh(e){var t=e.stateNode,s=e.type,n=e.memoizedProps;switch(t[yt]=e,t[Rt]=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=bi),t=!0):t=!1,t||Ki(e,!0)}function Uh(e){for(bt=e.return;bt;)switch(bt.tag){case 5:case 31:case 13:Qt=!1;return;case 27:case 3:Qt=!0;return;default:bt=bt.return}}function ur(e){if(e!==bt)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")||Nc(e.type,e.memoizedProps)),s=!s),s&&Ye&&Ki(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,as(e.type)?(e=Uc,Uc=null,Ye=e):Ye=t):Ye=bt?ti(e.stateNode.nextSibling):null;return!0}function Os(){Ye=bt=null,Le=!1}function vl(){var e=Fi;return e!==null&&(Lt===null?Lt=e:Lt.push.apply(Lt,e),Fi=null),e}function en(e){Fi===null?Fi=[e]:Fi.push(e)}var gl=L(null),Ms=null,wi=null;function Vi(e,t,s){V(gl,t._currentValue),t._currentValue=s}function Ei(e){e._currentValue=gl.current,z(gl)}function yl(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 bl(e,t,s,n){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var m=c.dependencies;if(m!==null){var D=c.child;m=m.firstContext;e:for(;m!==null;){var H=m;m=c;for(var F=0;F<t.length;F++)if(H.context===t[F]){m.lanes|=s,H=m.alternate,H!==null&&(H.lanes|=s),yl(m.return,s,e),n||(D=null);break e}m=H.next}}else if(c.tag===18){if(D=c.return,D===null)throw Error(o(341));D.lanes|=s,m=D.alternate,m!==null&&(m.lanes|=s),yl(D,s,e),D=null}else D=c.child;if(D!==null)D.return=c;else for(D=c;D!==null;){if(D===e){D=null;break}if(c=D.sibling,c!==null){c.return=D.return,D=c;break}D=D.return}c=D}}function hr(e,t,s,n){e=null;for(var c=t,m=!1;c!==null;){if(!m){if((c.flags&524288)!==0)m=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var D=c.alternate;if(D===null)throw Error(o(387));if(D=D.memoizedProps,D!==null){var H=c.type;Ut(c.pendingProps.value,D.value)||(e!==null?e.push(H):e=[H])}}else if(c===G.current){if(D=c.alternate,D===null)throw Error(o(387));D.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(Rn):e=[Rn])}c=c.return}e!==null&&bl(t,e,s,n),t.flags|=262144}function da(e){for(e=e.firstContext;e!==null;){if(!Ut(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ls(e){Ms=e,wi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function St(e){return Ih(Ms,e)}function ma(e,t){return Ms===null&&Ls(e),Ih(e,t)}function Ih(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},wi===null){if(e===null)throw Error(o(308));wi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else wi=wi.next=t;return s}var Qv=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()})}},eg=i.unstable_scheduleCallback,tg=i.unstable_NormalPriority,ct={$$typeof:v,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Sl(){return{controller:new Qv,data:new Map,refCount:0}}function tn(e){e.refCount--,e.refCount===0&&eg(tg,function(){e.controller.abort()})}var sn=null,xl=0,fr=0,dr=null;function ig(e,t){if(sn===null){var s=sn=[];xl=0,fr=Ec(),dr={status:"pending",value:void 0,then:function(n){s.push(n)}}}return xl++,t.then($h,$h),t}function $h(){if(--xl===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 sg(e,t){var s=[],n={status:"pending",value:null,reason:null,then:function(c){s.push(c)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var c=0;c<s.length;c++)(0,s[c])(t)},function(c){for(n.status="rejected",n.reason=c,c=0;c<s.length;c++)(0,s[c])(void 0)}),n}var Ph=q.S;q.S=function(e,t){kd=_t(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&ig(e,t),Ph!==null&&Ph(e,t)};var Ns=L(null);function Cl(){var e=Ns.current;return e!==null?e:Ve.pooledCache}function _a(e,t){t===null?V(Ns,Ns.current):V(Ns,t.pool)}function Zh(){var e=Cl();return e===null?null:{parent:ct._currentValue,pool:e}}var mr=Error(o(460)),wl=Error(o(474)),pa=Error(o(542)),va={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(bi,bi),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(bi,bi);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 c=t;c.status="fulfilled",c.value=n}},function(n){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Vh(e),e}throw Bs=t,mr}}function js(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Bs=s,mr):s}}var Bs=null;function Kh(){if(Bs===null)throw Error(o(459));var e=Bs;return Bs=null,e}function Vh(e){if(e===mr||e===pa)throw Error(o(483))}var _r=null,rn=0;function ga(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 ya(e,t){throw t.$$typeof===x?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(W,Y){if(e){var te=W.deletions;te===null?(W.deletions=[Y],W.flags|=16):te.push(Y)}}function s(W,Y){if(!e)return null;for(;Y!==null;)t(W,Y),Y=Y.sibling;return null}function n(W){for(var Y=new Map;W!==null;)W.key!==null?Y.set(W.key,W):Y.set(W.index,W),W=W.sibling;return Y}function c(W,Y){return W=xi(W,Y),W.index=0,W.sibling=null,W}function m(W,Y,te){return W.index=te,e?(te=W.alternate,te!==null?(te=te.index,te<Y?(W.flags|=67108866,Y):te):(W.flags|=67108866,Y)):(W.flags|=1048576,Y)}function D(W){return e&&W.alternate===null&&(W.flags|=67108866),W}function H(W,Y,te,ce){return Y===null||Y.tag!==6?(Y=fl(te,W.mode,ce),Y.return=W,Y):(Y=c(Y,te),Y.return=W,Y)}function F(W,Y,te,ce){var ye=te.type;return ye===S?oe(W,Y,te.props.children,ce,te.key):Y!==null&&(Y.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===w&&js(ye)===Y.type)?(Y=c(Y,te.props),nn(Y,te),Y.return=W,Y):(Y=ha(te.type,te.key,te.props,null,W.mode,ce),nn(Y,te),Y.return=W,Y)}function ie(W,Y,te,ce){return Y===null||Y.tag!==4||Y.stateNode.containerInfo!==te.containerInfo||Y.stateNode.implementation!==te.implementation?(Y=dl(te,W.mode,ce),Y.return=W,Y):(Y=c(Y,te.children||[]),Y.return=W,Y)}function oe(W,Y,te,ce,ye){return Y===null||Y.tag!==7?(Y=Ds(te,W.mode,ce,ye),Y.return=W,Y):(Y=c(Y,te),Y.return=W,Y)}function he(W,Y,te){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Y=fl(""+Y,W.mode,te),Y.return=W,Y;if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case E:return te=ha(Y.type,Y.key,Y.props,null,W.mode,te),nn(te,Y),te.return=W,te;case M:return Y=dl(Y,W.mode,te),Y.return=W,Y;case w:return Y=js(Y),he(W,Y,te)}if(re(Y)||K(Y))return Y=Ds(Y,W.mode,te,null),Y.return=W,Y;if(typeof Y.then=="function")return he(W,ga(Y),te);if(Y.$$typeof===v)return he(W,ma(W,Y),te);ya(W,Y)}return null}function se(W,Y,te,ce){var ye=Y!==null?Y.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return ye!==null?null:H(W,Y,""+te,ce);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case E:return te.key===ye?F(W,Y,te,ce):null;case M:return te.key===ye?ie(W,Y,te,ce):null;case w:return te=js(te),se(W,Y,te,ce)}if(re(te)||K(te))return ye!==null?null:oe(W,Y,te,ce,null);if(typeof te.then=="function")return se(W,Y,ga(te),ce);if(te.$$typeof===v)return se(W,Y,ma(W,te),ce);ya(W,te)}return null}function ne(W,Y,te,ce,ye){if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return W=W.get(te)||null,H(Y,W,""+ce,ye);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case E:return W=W.get(ce.key===null?te:ce.key)||null,F(Y,W,ce,ye);case M:return W=W.get(ce.key===null?te:ce.key)||null,ie(Y,W,ce,ye);case w:return ce=js(ce),ne(W,Y,te,ce,ye)}if(re(ce)||K(ce))return W=W.get(te)||null,oe(Y,W,ce,ye,null);if(typeof ce.then=="function")return ne(W,Y,te,ga(ce),ye);if(ce.$$typeof===v)return ne(W,Y,te,ma(Y,ce),ye);ya(Y,ce)}return null}function ve(W,Y,te,ce){for(var ye=null,Be=null,ge=Y,ke=Y=0,Me=null;ge!==null&&ke<te.length;ke++){ge.index>ke?(Me=ge,ge=null):Me=ge.sibling;var ze=se(W,ge,te[ke],ce);if(ze===null){ge===null&&(ge=Me);break}e&&ge&&ze.alternate===null&&t(W,ge),Y=m(ze,Y,ke),Be===null?ye=ze:Be.sibling=ze,Be=ze,ge=Me}if(ke===te.length)return s(W,ge),Le&&Ci(W,ke),ye;if(ge===null){for(;ke<te.length;ke++)ge=he(W,te[ke],ce),ge!==null&&(Y=m(ge,Y,ke),Be===null?ye=ge:Be.sibling=ge,Be=ge);return Le&&Ci(W,ke),ye}for(ge=n(ge);ke<te.length;ke++)Me=ne(ge,W,ke,te[ke],ce),Me!==null&&(e&&Me.alternate!==null&&ge.delete(Me.key===null?ke:Me.key),Y=m(Me,Y,ke),Be===null?ye=Me:Be.sibling=Me,Be=Me);return e&&ge.forEach(function(hs){return t(W,hs)}),Le&&Ci(W,ke),ye}function xe(W,Y,te,ce){if(te==null)throw Error(o(151));for(var ye=null,Be=null,ge=Y,ke=Y=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 hs=se(W,ge,ze.value,ce);if(hs===null){ge===null&&(ge=Me);break}e&&ge&&hs.alternate===null&&t(W,ge),Y=m(hs,Y,ke),Be===null?ye=hs:Be.sibling=hs,Be=hs,ge=Me}if(ze.done)return s(W,ge),Le&&Ci(W,ke),ye;if(ge===null){for(;!ze.done;ke++,ze=te.next())ze=he(W,ze.value,ce),ze!==null&&(Y=m(ze,Y,ke),Be===null?ye=ze:Be.sibling=ze,Be=ze);return Le&&Ci(W,ke),ye}for(ge=n(ge);!ze.done;ke++,ze=te.next())ze=ne(ge,W,ke,ze.value,ce),ze!==null&&(e&&ze.alternate!==null&&ge.delete(ze.key===null?ke:ze.key),Y=m(ze,Y,ke),Be===null?ye=ze:Be.sibling=ze,Be=ze);return e&&ge.forEach(function(m0){return t(W,m0)}),Le&&Ci(W,ke),ye}function Ke(W,Y,te,ce){if(typeof te=="object"&&te!==null&&te.type===S&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case E:e:{for(var ye=te.key;Y!==null;){if(Y.key===ye){if(ye=te.type,ye===S){if(Y.tag===7){s(W,Y.sibling),ce=c(Y,te.props.children),ce.return=W,W=ce;break e}}else if(Y.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===w&&js(ye)===Y.type){s(W,Y.sibling),ce=c(Y,te.props),nn(ce,te),ce.return=W,W=ce;break e}s(W,Y);break}else t(W,Y);Y=Y.sibling}te.type===S?(ce=Ds(te.props.children,W.mode,ce,te.key),ce.return=W,W=ce):(ce=ha(te.type,te.key,te.props,null,W.mode,ce),nn(ce,te),ce.return=W,W=ce)}return D(W);case M:e:{for(ye=te.key;Y!==null;){if(Y.key===ye)if(Y.tag===4&&Y.stateNode.containerInfo===te.containerInfo&&Y.stateNode.implementation===te.implementation){s(W,Y.sibling),ce=c(Y,te.children||[]),ce.return=W,W=ce;break e}else{s(W,Y);break}else t(W,Y);Y=Y.sibling}ce=dl(te,W.mode,ce),ce.return=W,W=ce}return D(W);case w:return te=js(te),Ke(W,Y,te,ce)}if(re(te))return ve(W,Y,te,ce);if(K(te)){if(ye=K(te),typeof ye!="function")throw Error(o(150));return te=ye.call(te),xe(W,Y,te,ce)}if(typeof te.then=="function")return Ke(W,Y,ga(te),ce);if(te.$$typeof===v)return Ke(W,Y,ma(W,te),ce);ya(W,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,Y!==null&&Y.tag===6?(s(W,Y.sibling),ce=c(Y,te),ce.return=W,W=ce):(s(W,Y),ce=fl(te,W.mode,ce),ce.return=W,W=ce),D(W)):s(W,Y)}return function(W,Y,te,ce){try{rn=0;var ye=Ke(W,Y,te,ce);return _r=null,ye}catch(ge){if(ge===mr||ge===pa)throw ge;var Be=It(29,ge,null,W.mode);return Be.lanes=ce,Be.return=W,Be}finally{}}}var zs=Gh(!0),Yh=Gh(!1),Gi=!1;function El(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function kl(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 Yi(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Wi(e,t,s){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(He&2)!==0){var c=n.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),n.pending=t,t=ua(e),Mh(e,null,s),t}return ca(e,n,t,s),ua(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 Tl(e,t){var s=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,s===n)){var c=null,m=null;if(s=s.firstBaseUpdate,s!==null){do{var D={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};m===null?c=m=D:m=m.next=D,s=s.next}while(s!==null);m===null?c=m=t:m=m.next=t}else c=m=t;s={baseState:n.baseState,firstBaseUpdate:c,lastBaseUpdate:m,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 c=e.updateQueue;Gi=!1;var m=c.firstBaseUpdate,D=c.lastBaseUpdate,H=c.shared.pending;if(H!==null){c.shared.pending=null;var F=H,ie=F.next;F.next=null,D===null?m=ie:D.next=ie,D=F;var oe=e.alternate;oe!==null&&(oe=oe.updateQueue,H=oe.lastBaseUpdate,H!==D&&(H===null?oe.firstBaseUpdate=ie:H.next=ie,oe.lastBaseUpdate=F))}if(m!==null){var he=c.baseState;D=0,oe=ie=F=null,H=m;do{var se=H.lane&-536870913,ne=se!==H.lane;if(ne?(Oe&se)===se:(n&se)===se){se!==0&&se===fr&&(Rl=!0),oe!==null&&(oe=oe.next={lane:0,tag:H.tag,payload:H.payload,callback:null,next:null});e:{var ve=e,xe=H;se=t;var Ke=s;switch(xe.tag){case 1:if(ve=xe.payload,typeof ve=="function"){he=ve.call(Ke,he,se);break e}he=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=xe.payload,se=typeof ve=="function"?ve.call(Ke,he,se):ve,se==null)break e;he=d({},he,se);break e;case 2:Gi=!0}}se=H.callback,se!==null&&(e.flags|=64,ne&&(e.flags|=8192),ne=c.callbacks,ne===null?c.callbacks=[se]:ne.push(se))}else ne={lane:se,tag:H.tag,payload:H.payload,callback:H.callback,next:null},oe===null?(ie=oe=ne,F=he):oe=oe.next=ne,D|=se;if(H=H.next,H===null){if(H=c.shared.pending,H===null)break;ne=H,H=ne.next,ne.next=null,c.lastBaseUpdate=ne,c.shared.pending=null}}while(!0);oe===null&&(F=he),c.baseState=F,c.firstBaseUpdate=ie,c.lastBaseUpdate=oe,m===null&&(c.shared.lanes=0),ts|=D,e.lanes=D,e.memoizedState=he}}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),ba=L(0);function Jh(e,t){e=Ni,V(ba,e),V(pr,t),Ni=e|t.baseLanes}function Al(){V(ba,Ni),V(pr,pr.current)}function Dl(){Ni=ba.current,z(pr),z(ba)}var $t=L(null),ei=null;function Xi(e){var t=e.alternate;V(at,at.current&1),V($t,e),ei===null&&(t===null||pr.current!==null||t.memoizedState!==null)&&(ei=e)}function Ol(e){V(at,at.current),V($t,e),ei===null&&(ei=e)}function Qh(e){e.tag===22?(V(at,at.current),V($t,e),ei===null&&(ei=e)):Ji()}function Ji(){V(at,at.current),V($t,$t.current)}function Pt(e){z($t),ei===e&&(ei=null),z(at)}var at=L(0);function Sa(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||zc(s)||Hc(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 ki=0,Ee=null,qe=null,ut=null,xa=!1,vr=!1,Hs=!1,Ca=0,cn=0,gr=null,rg=0;function it(){throw Error(o(321))}function Ml(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!Ut(e[s],t[s]))return!1;return!0}function Ll(e,t,s,n,c,m){return ki=m,Ee=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,q.H=e===null||e.memoizedState===null?zf:Gl,Hs=!1,m=s(n,c),Hs=!1,vr&&(m=tf(t,s,n,c)),ef(e),m}function ef(e){q.H=fn;var t=qe!==null&&qe.next!==null;if(ki=0,ut=qe=Ee=null,xa=!1,cn=0,gr=null,t)throw Error(o(300));e===null||ht||(e=e.dependencies,e!==null&&da(e)&&(ht=!0))}function tf(e,t,s,n){Ee=e;var c=0;do{if(vr&&(gr=null),cn=0,vr=!1,25<=c)throw Error(o(301));if(c+=1,ut=qe=null,e.updateQueue!=null){var m=e.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}q.H=Hf,m=t(s,n)}while(vr);return m}function ng(){var e=q.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 Nl(){var e=Ca!==0;return Ca=0,e}function jl(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function Bl(e){if(xa){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}xa=!1}ki=0,ut=qe=Ee=null,vr=!1,cn=Ca=0,gr=null}function Et(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ut===null?Ee.memoizedState=ut=e:ut=ut.next=e,ut}function ot(){if(qe===null){var e=Ee.alternate;e=e!==null?e.memoizedState:null}else e=qe.next;var t=ut===null?Ee.memoizedState:ut.next;if(t!==null)ut=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},ut===null?Ee.memoizedState=ut=e:ut=ut.next=e}return ut}function wa(){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,(ut===null?t.memoizedState:ut.next)===null&&(t=t.alternate,q.H=t===null||t.memoizedState===null?zf:Gl),e}function Ea(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return un(e);if(e.$$typeof===v)return St(e)}throw Error(o(438,String(e)))}function zl(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(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=wa(),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 Ti(e,t){return typeof t=="function"?t(e):t}function ka(e){var t=ot();return Hl(t,qe,e)}function Hl(e,t,s){var n=e.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=s;var c=e.baseQueue,m=n.pending;if(m!==null){if(c!==null){var D=c.next;c.next=m.next,m.next=D}t.baseQueue=c=m,n.pending=null}if(m=e.baseState,c===null)e.memoizedState=m;else{t=c.next;var H=D=null,F=null,ie=t,oe=!1;do{var he=ie.lane&-536870913;if(he!==ie.lane?(Oe&he)===he:(ki&he)===he){var se=ie.revertLane;if(se===0)F!==null&&(F=F.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),he===fr&&(oe=!0);else if((ki&se)===se){ie=ie.next,se===fr&&(oe=!0);continue}else he={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},F===null?(H=F=he,D=m):F=F.next=he,Ee.lanes|=se,ts|=se;he=ie.action,Hs&&s(m,he),m=ie.hasEagerState?ie.eagerState:s(m,he)}else se={lane:he,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},F===null?(H=F=se,D=m):F=F.next=se,Ee.lanes|=he,ts|=he;ie=ie.next}while(ie!==null&&ie!==t);if(F===null?D=m:F.next=H,!Ut(m,e.memoizedState)&&(ht=!0,oe&&(s=dr,s!==null)))throw s;e.memoizedState=m,e.baseState=D,e.baseQueue=F,n.lastRenderedState=m}return c===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function Ul(e){var t=ot(),s=t.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=e;var n=s.dispatch,c=s.pending,m=t.memoizedState;if(c!==null){s.pending=null;var D=c=c.next;do m=e(m,D.action),D=D.next;while(D!==c);Ut(m,t.memoizedState)||(ht=!0),t.memoizedState=m,t.baseQueue===null&&(t.baseState=m),s.lastRenderedState=m}return[m,n]}function sf(e,t,s){var n=Ee,c=ot(),m=Le;if(m){if(s===void 0)throw Error(o(407));s=s()}else s=t();var D=!Ut((qe||c).memoizedState,s);if(D&&(c.memoizedState=s,ht=!0),c=c.queue,Pl(af.bind(null,n,c,e),[e]),c.getSnapshot!==t||D||ut!==null&&ut.memoizedState.tag&1){if(n.flags|=2048,yr(9,{destroy:void 0},nf.bind(null,n,c,s,t),null),Ve===null)throw Error(o(349));m||(ki&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=wa(),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!Ut(e,s)}catch{return!0}}function lf(e){var t=As(e,2);t!==null&&Nt(t,e,2)}function Il(e){var t=Et();if(typeof e=="function"){var s=e;if(e=s(),Hs){$i(!0);try{s()}finally{$i(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ti,lastRenderedState:e},t}function cf(e,t,s,n){return e.baseState=s,Hl(e,qe,typeof n=="function"?n:Ti)}function ag(e,t,s,n,c){if(Aa(e))throw Error(o(485));if(e=t.action,e!==null){var m={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(D){m.listeners.push(D)}};q.T!==null?s(!0):m.isTransition=!1,n(m),s=t.pending,s===null?(m.next=t.pending=m,uf(t,m)):(m.next=s.next,t.pending=s.next=m)}}function uf(e,t){var s=t.action,n=t.payload,c=e.state;if(t.isTransition){var m=q.T,D={};q.T=D;try{var H=s(c,n),F=q.S;F!==null&&F(D,H),hf(e,t,H)}catch(ie){$l(e,t,ie)}finally{m!==null&&D.types!==null&&(m.types=D.types),q.T=m}}else try{m=s(c,n),hf(e,t,m)}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 c=Ye,m=Qt;c.nodeType!==8;){if(!m){c=null;break t}if(c=ti(c.nextSibling),c===null){c=null;break t}}m=c.data,c=m==="F!"||m==="F"?c:null}if(c){Ye=ti(c.nextSibling),n=c.data==="F!";break e}}Ki(n)}n=!1}n&&(t=s[0])}}return s=Et(),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=Il(!1),m=Vl.bind(null,Ee,!1,n.queue),n=Et(),c={state:t,dispatch:null,action:e,pending:null},n.queue=c,s=ag.bind(null,Ee,c,m,s),c.dispatch=s,n.memoizedState=e,[t,s,!1]}function pf(e){var t=ot();return vf(t,qe,e)}function vf(e,t,s){if(t=Hl(e,t,mf)[0],e=ka(Ti)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=un(t)}catch(D){throw D===mr?pa:D}else n=t;t=ot();var c=t.queue,m=c.dispatch;return s!==t.memoizedState&&(Ee.flags|=2048,yr(9,{destroy:void 0},og.bind(null,c,s),null)),[n,m,e]}function og(e,t){e.action=t}function gf(e){var t=ot(),s=qe;if(s!==null)return vf(t,s,e);ot(),t=t.memoizedState,s=ot();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=wa(),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 ot().memoizedState}function Ta(e,t,s,n){var c=Et();Ee.flags|=e,c.memoizedState=yr(1|t,{destroy:void 0},s,n===void 0?null:n)}function Ra(e,t,s,n){var c=ot();n=n===void 0?null:n;var m=c.memoizedState.inst;qe!==null&&n!==null&&Ml(n,qe.memoizedState.deps)?c.memoizedState=yr(t,m,s,n):(Ee.flags|=e,c.memoizedState=yr(1|t,m,s,n))}function bf(e,t){Ta(8390656,8,e,t)}function Pl(e,t){Ra(2048,8,e,t)}function lg(e){Ee.flags|=4;var t=Ee.updateQueue;if(t===null)t=wa(),Ee.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function Sf(e){var t=ot().memoizedState;return lg({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 Zl(){}function kf(e,t){var s=ot();t=t===void 0?null:t;var n=s.memoizedState;return t!==null&&Ml(t,n[1])?n[0]:(s.memoizedState=[e,t],e)}function Tf(e,t){var s=ot();t=t===void 0?null:t;var n=s.memoizedState;if(t!==null&&Ml(t,n[1]))return n[0];if(n=e(),Hs){$i(!0);try{e()}finally{$i(!1)}}return s.memoizedState=[n,t],n}function ql(e,t,s){return s===void 0||(ki&1073741824)!==0&&(Oe&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=Rd(),Ee.lanes|=e,ts|=e,s)}function Rf(e,t,s,n){return Ut(s,t)?s:pr.current!==null?(e=ql(e,s,n),Ut(e,t)||(ht=!0),e):(ki&42)===0||(ki&1073741824)!==0&&(Oe&261930)===0?(ht=!0,e.memoizedState=s):(e=Rd(),Ee.lanes|=e,ts|=e,t)}function Af(e,t,s,n,c){var m=ee.p;ee.p=m!==0&&8>m?m:8;var D=q.T,H={};q.T=H,Vl(e,!1,t,s);try{var F=c(),ie=q.S;if(ie!==null&&ie(H,F),F!==null&&typeof F=="object"&&typeof F.then=="function"){var oe=sg(F,n);hn(e,t,oe,Ft(e))}else hn(e,t,n,Ft(e))}catch(he){hn(e,t,{then:function(){},status:"rejected",reason:he},Ft())}finally{ee.p=m,D!==null&&H.types!==null&&(D.types=H.types),q.T=D}}function cg(){}function Fl(e,t,s,n){if(e.tag!==5)throw Error(o(476));var c=Df(e).queue;Af(e,c,t,J,s===null?cg:function(){return Of(e),s(n)})}function Df(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:J,baseState:J,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ti,lastRenderedState:J},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ti,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,{},Ft())}function Kl(){return St(Rn)}function Mf(){return ot().memoizedState}function Lf(){return ot().memoizedState}function ug(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=Ft();e=Yi(s);var n=Wi(t,e,s);n!==null&&(Nt(n,t,s),an(n,t,s)),t={cache:Sl()},e.payload=t;return}t=t.return}}function hg(e,t,s){var n=Ft();s={lane:n,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Aa(e)?jf(t,s):(s=ul(e,t,s,n),s!==null&&(Nt(s,e,n),Bf(s,t,n)))}function Nf(e,t,s){var n=Ft();hn(e,t,s,n)}function hn(e,t,s,n){var c={lane:n,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Aa(e))jf(t,c);else{var m=e.alternate;if(e.lanes===0&&(m===null||m.lanes===0)&&(m=t.lastRenderedReducer,m!==null))try{var D=t.lastRenderedState,H=m(D,s);if(c.hasEagerState=!0,c.eagerState=H,Ut(H,D))return ca(e,t,c,0),Ve===null&&la(),!1}catch{}finally{}if(s=ul(e,t,c,n),s!==null)return Nt(s,e,n),Bf(s,t,n),!0}return!1}function Vl(e,t,s,n){if(n={lane:2,revertLane:Ec(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Aa(e)){if(t)throw Error(o(479))}else t=ul(e,s,n,2),t!==null&&Nt(t,e,2)}function Aa(e){var t=e.alternate;return e===Ee||t!==null&&t===Ee}function jf(e,t){vr=xa=!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:St,use:Ea,useCallback:it,useContext:it,useEffect:it,useImperativeHandle:it,useLayoutEffect:it,useInsertionEffect:it,useMemo:it,useReducer:it,useRef:it,useState:it,useDebugValue:it,useDeferredValue:it,useTransition:it,useSyncExternalStore:it,useId:it,useHostTransitionStatus:it,useFormState:it,useActionState:it,useOptimistic:it,useMemoCache:it,useCacheRefresh:it};fn.useEffectEvent=it;var zf={readContext:St,use:Ea,useCallback:function(e,t){return Et().memoizedState=[e,t===void 0?null:t],e},useContext:St,useEffect:bf,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,Ta(4194308,4,wf.bind(null,t,e),s)},useLayoutEffect:function(e,t){return Ta(4194308,4,e,t)},useInsertionEffect:function(e,t){Ta(4,2,e,t)},useMemo:function(e,t){var s=Et();t=t===void 0?null:t;var n=e();if(Hs){$i(!0);try{e()}finally{$i(!1)}}return s.memoizedState=[n,t],n},useReducer:function(e,t,s){var n=Et();if(s!==void 0){var c=s(t);if(Hs){$i(!0);try{s(t)}finally{$i(!1)}}}else c=t;return n.memoizedState=n.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},n.queue=e,e=e.dispatch=hg.bind(null,Ee,e),[n.memoizedState,e]},useRef:function(e){var t=Et();return e={current:e},t.memoizedState=e},useState:function(e){e=Il(e);var t=e.queue,s=Nf.bind(null,Ee,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:Zl,useDeferredValue:function(e,t){var s=Et();return ql(s,e,t)},useTransition:function(){var e=Il(!1);return e=Af.bind(null,Ee,e.queue,!0,!1),Et().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var n=Ee,c=Et();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)}c.memoizedState=s;var m={value:s,getSnapshot:t};return c.queue=m,bf(af.bind(null,n,m,e),[e]),n.flags|=2048,yr(9,{destroy:void 0},nf.bind(null,n,m,s,t),null),s},useId:function(){var e=Et(),t=Ve.identifierPrefix;if(Le){var s=mi,n=di;s=(n&~(1<<32-Ht(n)-1)).toString(32)+s,t="_"+t+"R_"+s,s=Ca++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=rg++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Kl,useFormState:_f,useActionState:_f,useOptimistic:function(e){var t=Et();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=Vl.bind(null,Ee,!0,s),s.dispatch=t,[e,t]},useMemoCache:zl,useCacheRefresh:function(){return Et().memoizedState=ug.bind(null,Ee)},useEffectEvent:function(e){var t=Et(),s={impl:e};return t.memoizedState=s,function(){if((He&2)!==0)throw Error(o(440));return s.impl.apply(void 0,arguments)}}},Gl={readContext:St,use:Ea,useCallback:kf,useContext:St,useEffect:Pl,useImperativeHandle:Ef,useInsertionEffect:xf,useLayoutEffect:Cf,useMemo:Tf,useReducer:ka,useRef:yf,useState:function(){return ka(Ti)},useDebugValue:Zl,useDeferredValue:function(e,t){var s=ot();return Rf(s,qe.memoizedState,e,t)},useTransition:function(){var e=ka(Ti)[0],t=ot().memoizedState;return[typeof e=="boolean"?e:un(e),t]},useSyncExternalStore:sf,useId:Mf,useHostTransitionStatus:Kl,useFormState:pf,useActionState:pf,useOptimistic:function(e,t){var s=ot();return cf(s,qe,e,t)},useMemoCache:zl,useCacheRefresh:Lf};Gl.useEffectEvent=Sf;var Hf={readContext:St,use:Ea,useCallback:kf,useContext:St,useEffect:Pl,useImperativeHandle:Ef,useInsertionEffect:xf,useLayoutEffect:Cf,useMemo:Tf,useReducer:Ul,useRef:yf,useState:function(){return Ul(Ti)},useDebugValue:Zl,useDeferredValue:function(e,t){var s=ot();return qe===null?ql(s,e,t):Rf(s,qe.memoizedState,e,t)},useTransition:function(){var e=Ul(Ti)[0],t=ot().memoizedState;return[typeof e=="boolean"?e:un(e),t]},useSyncExternalStore:sf,useId:Mf,useHostTransitionStatus:Kl,useFormState:gf,useActionState:gf,useOptimistic:function(e,t){var s=ot();return qe!==null?cf(s,qe,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:zl,useCacheRefresh:Lf};Hf.useEffectEvent=Sf;function Yl(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 Wl={enqueueSetState:function(e,t,s){e=e._reactInternals;var n=Ft(),c=Yi(n);c.payload=t,s!=null&&(c.callback=s),t=Wi(e,c,n),t!==null&&(Nt(t,e,n),an(t,e,n))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var n=Ft(),c=Yi(n);c.tag=1,c.payload=t,s!=null&&(c.callback=s),t=Wi(e,c,n),t!==null&&(Nt(t,e,n),an(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=Ft(),n=Yi(s);n.tag=2,t!=null&&(n.callback=t),t=Wi(e,n,s),t!==null&&(Nt(t,e,s),an(t,e,s))}};function Uf(e,t,s,n,c,m,D){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,m,D):t.prototype&&t.prototype.isPureReactComponent?!Xr(s,n)||!Xr(c,m):!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&&Wl.enqueueReplaceState(t,t.state,null)}function Us(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 c in e)s[c]===void 0&&(s[c]=e[c])}return s}function $f(e){oa(e)}function Pf(e){console.error(e)}function Zf(e){oa(e)}function Da(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(c){setTimeout(function(){throw c})}}function Xl(e,t,s){return s=Yi(s),s.tag=3,s.payload={element:null},s.callback=function(){Da(e,t)},s}function Ff(e){return e=Yi(e),e.tag=3,e}function Kf(e,t,s,n){var c=s.type.getDerivedStateFromError;if(typeof c=="function"){var m=n.value;e.payload=function(){return c(m)},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 c!="function"&&(is===null?is=new Set([this]):is.add(this));var H=n.stack;this.componentDidCatch(n.value,{componentStack:H!==null?H:""})})}function fg(e,t,s,n,c){if(s.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=s.alternate,t!==null&&hr(t,s,c,!0),s=$t.current,s!==null){switch(s.tag){case 31:case 13:return ei===null?Pa():s.alternate===null&&st===0&&(st=3),s.flags&=-257,s.flags|=65536,s.lanes=c,n===va?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([n]):t.add(n),xc(e,n,c)),!1;case 22:return s.flags|=65536,n===va?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)),xc(e,n,c)),!1}throw Error(o(435,s.tag))}return xc(e,n,c),Pa(),!1}if(Le)return t=$t.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,n!==pl&&(e=Error(o(422),{cause:n}),en(Wt(e,s)))):(n!==pl&&(t=Error(o(423),{cause:n}),en(Wt(t,s))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,n=Wt(n,s),c=Xl(e.stateNode,n,c),Tl(e,c),st!==4&&(st=2)),!1;var m=Error(o(520),{cause:n});if(m=Wt(m,s),bn===null?bn=[m]:bn.push(m),st!==4&&(st=2),t===null)return!0;n=Wt(n,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=c&-c,s.lanes|=e,e=Xl(s.stateNode,n,e),Tl(s,e),!1;case 1:if(t=s.type,m=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(is===null||!is.has(m))))return s.flags|=65536,c&=-c,s.lanes|=c,c=Ff(c),Kf(c,e,s,n),Tl(s,c),!1}s=s.return}while(s!==null);return!1}var Jl=Error(o(461)),ht=!1;function xt(e,t,s,n){t.child=e===null?Yh(t,null,s,n):zs(t,e.child,s,n)}function Vf(e,t,s,n,c){s=s.render;var m=t.ref;if("ref"in n){var D={};for(var H in n)H!=="ref"&&(D[H]=n[H])}else D=n;return Ls(t),n=Ll(e,t,s,D,m,c),H=Nl(),e!==null&&!ht?(jl(e,t,c),Ri(e,t,c)):(Le&&H&&ml(t),t.flags|=1,xt(e,t,n,c),t.child)}function Gf(e,t,s,n,c){if(e===null){var m=s.type;return typeof m=="function"&&!hl(m)&&m.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=m,Yf(e,t,m,n,c)):(e=ha(s.type,null,n,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(m=e.child,!ac(e,c)){var D=m.memoizedProps;if(s=s.compare,s=s!==null?s:Xr,s(D,n)&&e.ref===t.ref)return Ri(e,t,c)}return t.flags|=1,e=xi(m,n),e.ref=t.ref,e.return=t,t.child=e}function Yf(e,t,s,n,c){if(e!==null){var m=e.memoizedProps;if(Xr(m,n)&&e.ref===t.ref)if(ht=!1,t.pendingProps=n=m,ac(e,c))(e.flags&131072)!==0&&(ht=!0);else return t.lanes=e.lanes,Ri(e,t,c)}return Ql(e,t,s,n,c)}function Wf(e,t,s,n){var c=n.children,m=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(m=m!==null?m.baseLanes|s:s,e!==null){for(n=t.child=e.child,c=0;n!==null;)c=c|n.lanes|n.childLanes,n=n.sibling;n=c&~m}else n=0,t.child=null;return Xf(e,t,m,s,n)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&_a(t,m!==null?m.cachePool:null),m!==null?Jh(t,m):Al(),Qh(t);else return n=t.lanes=536870912,Xf(e,t,m!==null?m.baseLanes|s:s,s,n)}else m!==null?(_a(t,m.cachePool),Jh(t,m),Ji(),t.memoizedState=null):(e!==null&&_a(t,null),Al(),Ji());return xt(e,t,c,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,c){var m=Cl();return m=m===null?null:{parent:ct._currentValue,pool:m},t.memoizedState={baseLanes:s,cachePool:m},e!==null&&_a(t,null),Al(),Qh(t),e!==null&&hr(e,t,n,!0),t.childLanes=c,null}function Oa(e,t){return t=La({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 zs(t,e.child,null,s),e=Oa(t,t.pendingProps),e.flags|=2,Pt(t),t.memoizedState=null,e}function dg(e,t,s){var n=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Le){if(n.mode==="hidden")return e=Oa(t,n),t.lanes=536870912,dn(null,e);if(Ol(t),(e=Ye)?(e=um(e,Qt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:qi!==null?{id:di,overflow:mi}:null,retryLane:536870912,hydrationErrors:null},s=Nh(e),s.return=t,t.child=s,bt=t,Ye=null)):e=null,e===null)throw Ki(t);return t.lanes=536870912,null}return Oa(t,n)}var m=e.memoizedState;if(m!==null){var D=m.dehydrated;if(Ol(t),c)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(ht||hr(e,t,s,!1),c=(s&e.childLanes)!==0,ht||c){if(n=Ve,n!==null&&(D=$u(n,s),D!==0&&D!==m.retryLane))throw m.retryLane=D,As(e,D),Nt(n,e,D),Jl;Pa(),t=Jf(e,t,s)}else e=m.treeContext,Ye=ti(D.nextSibling),bt=t,Le=!0,Fi=null,Qt=!1,e!==null&&zh(t,e),t=Oa(t,n),t.flags|=4096;return t}return e=xi(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Ma(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 Ql(e,t,s,n,c){return Ls(t),s=Ll(e,t,s,n,void 0,c),n=Nl(),e!==null&&!ht?(jl(e,t,c),Ri(e,t,c)):(Le&&n&&ml(t),t.flags|=1,xt(e,t,s,c),t.child)}function Qf(e,t,s,n,c,m){return Ls(t),t.updateQueue=null,s=tf(t,n,s,c),ef(e),n=Nl(),e!==null&&!ht?(jl(e,t,m),Ri(e,t,m)):(Le&&n&&ml(t),t.flags|=1,xt(e,t,s,m),t.child)}function ed(e,t,s,n,c){if(Ls(t),t.stateNode===null){var m=or,D=s.contextType;typeof D=="object"&&D!==null&&(m=St(D)),m=new s(n,m),t.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=Wl,t.stateNode=m,m._reactInternals=t,m=t.stateNode,m.props=n,m.state=t.memoizedState,m.refs={},El(t),D=s.contextType,m.context=typeof D=="object"&&D!==null?St(D):or,m.state=t.memoizedState,D=s.getDerivedStateFromProps,typeof D=="function"&&(Yl(t,s,D,n),m.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(D=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),D!==m.state&&Wl.enqueueReplaceState(m,m.state,null),ln(t,n,m,c),on(),m.state=t.memoizedState),typeof m.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){m=t.stateNode;var H=t.memoizedProps,F=Us(s,H);m.props=F;var ie=m.context,oe=s.contextType;D=or,typeof oe=="object"&&oe!==null&&(D=St(oe));var he=s.getDerivedStateFromProps;oe=typeof he=="function"||typeof m.getSnapshotBeforeUpdate=="function",H=t.pendingProps!==H,oe||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(H||ie!==D)&&If(t,m,n,D),Gi=!1;var se=t.memoizedState;m.state=se,ln(t,n,m,c),on(),ie=t.memoizedState,H||se!==ie||Gi?(typeof he=="function"&&(Yl(t,s,he,n),ie=t.memoizedState),(F=Gi||Uf(t,s,F,n,se,ie,D))?(oe||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(t.flags|=4194308)):(typeof m.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=ie),m.props=n,m.state=ie,m.context=D,n=F):(typeof m.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{m=t.stateNode,kl(e,t),D=t.memoizedProps,oe=Us(s,D),m.props=oe,he=t.pendingProps,se=m.context,ie=s.contextType,F=or,typeof ie=="object"&&ie!==null&&(F=St(ie)),H=s.getDerivedStateFromProps,(ie=typeof H=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(D!==he||se!==F)&&If(t,m,n,F),Gi=!1,se=t.memoizedState,m.state=se,ln(t,n,m,c),on();var ne=t.memoizedState;D!==he||se!==ne||Gi||e!==null&&e.dependencies!==null&&da(e.dependencies)?(typeof H=="function"&&(Yl(t,s,H,n),ne=t.memoizedState),(oe=Gi||Uf(t,s,oe,n,se,ne,F)||e!==null&&e.dependencies!==null&&da(e.dependencies))?(ie||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(n,ne,F),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(n,ne,F)),typeof m.componentDidUpdate=="function"&&(t.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof m.componentDidUpdate!="function"||D===e.memoizedProps&&se===e.memoizedState||(t.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||D===e.memoizedProps&&se===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=ne),m.props=n,m.state=ne,m.context=F,n=oe):(typeof m.componentDidUpdate!="function"||D===e.memoizedProps&&se===e.memoizedState||(t.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||D===e.memoizedProps&&se===e.memoizedState||(t.flags|=1024),n=!1)}return m=n,Ma(e,t),n=(t.flags&128)!==0,m||n?(m=t.stateNode,s=n&&typeof s.getDerivedStateFromError!="function"?null:m.render(),t.flags|=1,e!==null&&n?(t.child=zs(t,e.child,null,c),t.child=zs(t,null,s,c)):xt(e,t,s,c),t.memoizedState=m.state,e=t.child):e=Ri(e,t,c),e}function td(e,t,s,n){return Os(),t.flags|=256,xt(e,t,s,n),t.child}var ec={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function tc(e){return{baseLanes:e,cachePool:Zh()}}function ic(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=qt),e}function id(e,t,s){var n=t.pendingProps,c=!1,m=(t.flags&128)!==0,D;if((D=m)||(D=e!==null&&e.memoizedState===null?!1:(at.current&2)!==0),D&&(c=!0,t.flags&=-129),D=(t.flags&32)!==0,t.flags&=-33,e===null){if(Le){if(c?Xi(t):Ji(),(e=Ye)?(e=um(e,Qt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:qi!==null?{id:di,overflow:mi}:null,retryLane:536870912,hydrationErrors:null},s=Nh(e),s.return=t,t.child=s,bt=t,Ye=null)):e=null,e===null)throw Ki(t);return Hc(e)?t.lanes=32:t.lanes=536870912,null}var H=n.children;return n=n.fallback,c?(Ji(),c=t.mode,H=La({mode:"hidden",children:H},c),n=Ds(n,c,s,null),H.return=t,n.return=t,H.sibling=n,t.child=H,n=t.child,n.memoizedState=tc(s),n.childLanes=ic(e,D,s),t.memoizedState=ec,dn(null,n)):(Xi(t),sc(t,H))}var F=e.memoizedState;if(F!==null&&(H=F.dehydrated,H!==null)){if(m)t.flags&256?(Xi(t),t.flags&=-257,t=rc(e,t,s)):t.memoizedState!==null?(Ji(),t.child=e.child,t.flags|=128,t=null):(Ji(),H=n.fallback,c=t.mode,n=La({mode:"visible",children:n.children},c),H=Ds(H,c,s,null),H.flags|=2,n.return=t,H.return=t,n.sibling=H,t.child=n,zs(t,e.child,null,s),n=t.child,n.memoizedState=tc(s),n.childLanes=ic(e,D,s),t.memoizedState=ec,t=dn(null,n));else if(Xi(t),Hc(H)){if(D=H.nextSibling&&H.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=rc(e,t,s)}else if(ht||hr(e,t,s,!1),D=(s&e.childLanes)!==0,ht||D){if(D=Ve,D!==null&&(n=$u(D,s),n!==0&&n!==F.retryLane))throw F.retryLane=n,As(e,n),Nt(D,e,n),Jl;zc(H)||Pa(),t=rc(e,t,s)}else zc(H)?(t.flags|=192,t.child=e.child,t=null):(e=F.treeContext,Ye=ti(H.nextSibling),bt=t,Le=!0,Fi=null,Qt=!1,e!==null&&zh(t,e),t=sc(t,n.children),t.flags|=4096);return t}return c?(Ji(),H=n.fallback,c=t.mode,F=e.child,ie=F.sibling,n=xi(F,{mode:"hidden",children:n.children}),n.subtreeFlags=F.subtreeFlags&65011712,ie!==null?H=xi(ie,H):(H=Ds(H,c,s,null),H.flags|=2),H.return=t,n.return=t,n.sibling=H,t.child=n,dn(null,n),n=t.child,H=e.child.memoizedState,H===null?H=tc(s):(c=H.cachePool,c!==null?(F=ct._currentValue,c=c.parent!==F?{parent:F,pool:F}:c):c=Zh(),H={baseLanes:H.baseLanes|s,cachePool:c}),n.memoizedState=H,n.childLanes=ic(e,D,s),t.memoizedState=ec,dn(e.child,n)):(Xi(t),s=e.child,e=s.sibling,s=xi(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 sc(e,t){return t=La({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function La(e,t){return e=It(22,e,null,t),e.lanes=0,e}function rc(e,t,s){return zs(t,e.child,null,s),e=sc(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),yl(e.return,t,s)}function nc(e,t,s,n,c,m){var D=e.memoizedState;D===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:s,tailMode:c,treeForkCount:m}:(D.isBackwards=t,D.rendering=null,D.renderingStartTime=0,D.last=n,D.tail=s,D.tailMode=c,D.treeForkCount=m)}function rd(e,t,s){var n=t.pendingProps,c=n.revealOrder,m=n.tail;n=n.children;var D=at.current,H=(D&2)!==0;if(H?(D=D&1|2,t.flags|=128):D&=1,V(at,D),xt(e,t,n,s),n=Le?Qr:0,!H&&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(c){case"forwards":for(s=t.child,c=null;s!==null;)e=s.alternate,e!==null&&Sa(e)===null&&(c=s),s=s.sibling;s=c,s===null?(c=t.child,t.child=null):(c=s.sibling,s.sibling=null),nc(t,!1,c,s,m,n);break;case"backwards":case"unstable_legacy-backwards":for(s=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&Sa(e)===null){t.child=c;break}e=c.sibling,c.sibling=s,s=c,c=e}nc(t,!0,s,null,m,n);break;case"together":nc(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function Ri(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),ts|=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=xi(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=xi(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function ac(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&da(e)))}function mg(e,t,s){switch(t.tag){case 3:U(t,t.stateNode.containerInfo),Vi(t,ct,e.memoizedState.cache),Os();break;case 27:case 5:ae(t);break;case 4:U(t,t.stateNode.containerInfo);break;case 10:Vi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ol(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(Xi(t),t.flags|=128,null):(s&t.child.childLanes)!==0?id(e,t,s):(Xi(t),e=Ri(e,t,s),e!==null?e.sibling:null);Xi(t);break;case 19:var c=(e.flags&128)!==0;if(n=(s&t.childLanes)!==0,n||(hr(e,t,s,!1),n=(s&t.childLanes)!==0),c){if(n)return rd(e,t,s);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),V(at,at.current),n)break;return null;case 22:return t.lanes=0,Wf(e,t,s,t.pendingProps);case 24:Vi(t,ct,e.memoizedState.cache)}return Ri(e,t,s)}function nd(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)ht=!0;else{if(!ac(e,s)&&(t.flags&128)===0)return ht=!1,mg(e,t,s);ht=(e.flags&131072)!==0}else ht=!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=js(t.elementType),t.type=e,typeof e=="function")hl(e)?(n=Us(e,n),t.tag=1,t=ed(null,t,e,n,s)):(t.tag=0,t=Ql(null,t,e,n,s));else{if(e!=null){var c=e.$$typeof;if(c===b){t.tag=11,t=Vf(null,t,e,n,s);break e}else if(c===O){t.tag=14,t=Gf(null,t,e,n,s);break e}}throw t=X(e)||e,Error(o(306,t,""))}}return t;case 0:return Ql(e,t,t.type,t.pendingProps,s);case 1:return n=t.type,c=Us(n,t.pendingProps),ed(e,t,n,c,s);case 3:e:{if(U(t,t.stateNode.containerInfo),e===null)throw Error(o(387));n=t.pendingProps;var m=t.memoizedState;c=m.element,kl(e,t),ln(t,n,null,s);var D=t.memoizedState;if(n=D.cache,Vi(t,ct,n),n!==m.cache&&bl(t,[ct],s,!0),on(),n=D.element,m.isDehydrated)if(m={element:n,isDehydrated:!1,cache:D.cache},t.updateQueue.baseState=m,t.memoizedState=m,t.flags&256){t=td(e,t,n,s);break e}else if(n!==c){c=Wt(Error(o(424)),t),en(c),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=ti(e.firstChild),bt=t,Le=!0,Fi=null,Qt=!0,s=Yh(t,null,n,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(Os(),n===c){t=Ri(e,t,s);break e}xt(e,t,n,s)}t=t.child}return t;case 26:return Ma(e,t),e===null?(s=pm(t.type,null,t.pendingProps,null))?t.memoizedState=s:Le||(s=t.type,e=t.pendingProps,n=Ya(de.current).createElement(s),n[yt]=t,n[Rt]=e,Ct(n,s,e),vt(n),t.stateNode=n):t.memoizedState=pm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ae(t),e===null&&Le&&(n=t.stateNode=dm(t.type,t.pendingProps,de.current),bt=t,Qt=!0,c=Ye,as(t.type)?(Uc=c,Ye=ti(n.firstChild)):Ye=c),xt(e,t,t.pendingProps.children,s),Ma(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Le&&((c=n=Ye)&&(n=qg(n,t.type,t.pendingProps,Qt),n!==null?(t.stateNode=n,bt=t,Ye=ti(n.firstChild),Qt=!1,c=!0):c=!1),c||Ki(t)),ae(t),c=t.type,m=t.pendingProps,D=e!==null?e.memoizedProps:null,n=m.children,Nc(c,m)?n=null:D!==null&&Nc(c,D)&&(t.flags|=32),t.memoizedState!==null&&(c=Ll(e,t,ng,null,null,s),Rn._currentValue=c),Ma(e,t),xt(e,t,n,s),t.child;case 6:return e===null&&Le&&((e=s=Ye)&&(s=Fg(s,t.pendingProps,Qt),s!==null?(t.stateNode=s,bt=t,Ye=null,e=!0):e=!1),e||Ki(t)),null;case 13:return id(e,t,s);case 4:return U(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=zs(t,null,n,s):xt(e,t,n,s),t.child;case 11:return Vf(e,t,t.type,t.pendingProps,s);case 7:return xt(e,t,t.pendingProps,s),t.child;case 8:return xt(e,t,t.pendingProps.children,s),t.child;case 12:return xt(e,t,t.pendingProps.children,s),t.child;case 10:return n=t.pendingProps,Vi(t,t.type,n.value),xt(e,t,n.children,s),t.child;case 9:return c=t.type._context,n=t.pendingProps.children,Ls(t),c=St(c),n=n(c),t.flags|=1,xt(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 dg(e,t,s);case 22:return Wf(e,t,s,t.pendingProps);case 24:return Ls(t),n=St(ct),e===null?(c=Cl(),c===null&&(c=Ve,m=Sl(),c.pooledCache=m,m.refCount++,m!==null&&(c.pooledCacheLanes|=s),c=m),t.memoizedState={parent:n,cache:c},El(t),Vi(t,ct,c)):((e.lanes&s)!==0&&(kl(e,t),ln(t,null,null,s),on()),c=e.memoizedState,m=t.memoizedState,c.parent!==n?(c={parent:n,cache:n},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),Vi(t,ct,n)):(n=m.cache,Vi(t,ct,n),n!==c.cache&&bl(t,[ct],s,!0))),xt(e,t,t.pendingProps.children,s),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function Ai(e){e.flags|=4}function oc(e,t,s,n,c){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(Md())e.flags|=8192;else throw Bs=va,wl}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 Bs=va,wl}function Na(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 c=e.child;c!==null;)s|=c.lanes|c.childLanes,n|=c.subtreeFlags&65011712,n|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)s|=c.lanes|c.childLanes,n|=c.subtreeFlags,n|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=n,e.childLanes=s,t}function _g(e,t,s){var n=t.pendingProps;switch(_l(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),Ei(ct),le(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(ur(t)?Ai(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,vl())),We(t),null;case 26:var c=t.type,m=t.memoizedState;return e===null?(Ai(t),m!==null?(We(t),ad(t,m)):(We(t),oc(t,c,null,n,s))):m?m!==e.memoizedState?(Ai(t),We(t),ad(t,m)):(We(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&Ai(t),We(t),oc(t,c,e,n,s)),null;case 27:if(pe(t),s=de.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Ai(t);else{if(!n){if(t.stateNode===null)throw Error(o(166));return We(t),null}e=Q.current,ur(t)?Hh(t):(e=dm(c,n,s),t.stateNode=e,Ai(t))}return We(t),null;case 5:if(pe(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Ai(t);else{if(!n){if(t.stateNode===null)throw Error(o(166));return We(t),null}if(m=Q.current,ur(t))Hh(t);else{var D=Ya(de.current);switch(m){case 1:m=D.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:m=D.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":m=D.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":m=D.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":m=D.createElement("div"),m.innerHTML="<script><\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof n.is=="string"?D.createElement("select",{is:n.is}):D.createElement("select"),n.multiple?m.multiple=!0:n.size&&(m.size=n.size);break;default:m=typeof n.is=="string"?D.createElement(c,{is:n.is}):D.createElement(c)}}m[yt]=t,m[Rt]=n;e:for(D=t.child;D!==null;){if(D.tag===5||D.tag===6)m.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=m;e:switch(Ct(m,c,n),c){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&Ai(t)}}return We(t),oc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&Ai(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(o(166));if(e=de.current,ur(t)){if(e=t.stateNode,s=t.memoizedProps,n=null,c=bt,c!==null)switch(c.tag){case 27:case 5:n=c.memoizedProps}e[yt]=t,e=!!(e.nodeValue===s||n!==null&&n.suppressHydrationWarning===!0||im(e.nodeValue,s)),e||Ki(t,!0)}else e=Ya(e).createTextNode(n),e[yt]=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[yt]=t}else Os(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;We(t),e=!1}else s=vl(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(Pt(t),t):(Pt(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(c=ur(t),n!==null&&n.dehydrated!==null){if(e===null){if(!c)throw Error(o(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(o(317));c[yt]=t}else Os(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;We(t),c=!1}else c=vl(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(Pt(t),t):(Pt(t),null)}return Pt(t),(t.flags&128)!==0?(t.lanes=s,t):(s=n!==null,e=e!==null&&e.memoizedState!==null,s&&(n=t.child,c=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(c=n.alternate.memoizedState.cachePool.pool),m=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(m=n.memoizedState.cachePool.pool),m!==c&&(n.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),Na(t,t.updateQueue),We(t),null);case 4:return le(),e===null&&Ac(t.stateNode.containerInfo),We(t),null;case 10:return Ei(t.type),We(t),null;case 19:if(z(at),n=t.memoizedState,n===null)return We(t),null;if(c=(t.flags&128)!==0,m=n.rendering,m===null)if(c)mn(n,!1);else{if(st!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(m=Sa(e),m!==null){for(t.flags|=128,mn(n,!1),e=m.updateQueue,t.updateQueue=e,Na(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)Lh(s,e),s=s.sibling;return V(at,at.current&1|2),Le&&Ci(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&_t()>Ua&&(t.flags|=128,c=!0,mn(n,!1),t.lanes=4194304)}else{if(!c)if(e=Sa(m),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,Na(t,e),mn(n,!0),n.tail===null&&n.tailMode==="hidden"&&!m.alternate&&!Le)return We(t),null}else 2*_t()-n.renderingStartTime>Ua&&s!==536870912&&(t.flags|=128,c=!0,mn(n,!1),t.lanes=4194304);n.isBackwards?(m.sibling=t.child,t.child=m):(e=n.last,e!==null?e.sibling=m:t.child=m,n.last=m)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=_t(),e.sibling=null,s=at.current,V(at,c?s&1|2:s&1),Le&&Ci(t,n.treeForkCount),e):(We(t),null);case 22:case 23:return Pt(t),Dl(),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&&Na(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&&z(Ns),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Ei(ct),We(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function pg(e,t){switch(_l(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ei(ct),le(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return pe(t),null;case 31:if(t.memoizedState!==null){if(Pt(t),t.alternate===null)throw Error(o(340));Os()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Pt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Os()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return z(at),null;case 4:return le(),null;case 10:return Ei(t.type),null;case 22:case 23:return Pt(t),Dl(),e!==null&&z(Ns),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ei(ct),null;case 25:return null;default:return null}}function od(e,t){switch(_l(t),t.tag){case 3:Ei(ct),le();break;case 26:case 27:case 5:pe(t);break;case 4:le();break;case 31:t.memoizedState!==null&&Pt(t);break;case 13:Pt(t);break;case 19:z(at);break;case 10:Ei(t.type);break;case 22:case 23:Pt(t),Dl(),e!==null&&z(Ns);break;case 24:Ei(ct)}}function _n(e,t){try{var s=t.updateQueue,n=s!==null?s.lastEffect:null;if(n!==null){var c=n.next;s=c;do{if((s.tag&e)===e){n=void 0;var m=s.create,D=s.inst;n=m(),D.destroy=n}s=s.next}while(s!==c)}}catch(H){Ie(t,t.return,H)}}function Qi(e,t,s){try{var n=t.updateQueue,c=n!==null?n.lastEffect:null;if(c!==null){var m=c.next;n=m;do{if((n.tag&e)===e){var D=n.inst,H=D.destroy;if(H!==void 0){D.destroy=void 0,c=t;var F=s,ie=H;try{ie()}catch(oe){Ie(c,F,oe)}}}n=n.next}while(n!==m)}}catch(oe){Ie(t,t.return,oe)}}function ld(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{Xh(t,s)}catch(n){Ie(e,e.return,n)}}}function cd(e,t,s){s.props=Us(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(n){Ie(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(c){Ie(e,t,c)}}function _i(e,t){var s=e.ref,n=e.refCleanup;if(s!==null)if(typeof n=="function")try{n()}catch(c){Ie(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(c){Ie(e,t,c)}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(c){Ie(e,e.return,c)}}function lc(e,t,s){try{var n=e.stateNode;Hg(n,e.type,s,t),n[Rt]=t}catch(c){Ie(e,e.return,c)}}function hd(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&as(e.type)||e.tag===4}function cc(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&&as(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 uc(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=bi));else if(n!==4&&(n===27&&as(e.type)&&(s=e.stateNode,t=null),e=e.child,e!==null))for(uc(e,t,s),e=e.sibling;e!==null;)uc(e,t,s),e=e.sibling}function ja(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&&as(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(ja(e,t,s),e=e.sibling;e!==null;)ja(e,t,s),e=e.sibling}function fd(e){var t=e.stateNode,s=e.memoizedProps;try{for(var n=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);Ct(t,n,s),t[yt]=e,t[Rt]=s}catch(m){Ie(e,e.return,m)}}var Di=!1,ft=!1,hc=!1,dd=typeof WeakSet=="function"?WeakSet:Set,gt=null;function vg(e,t){if(e=e.containerInfo,Mc=io,e=wh(e),rl(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 c=n.anchorOffset,m=n.focusNode;n=n.focusOffset;try{s.nodeType,m.nodeType}catch{s=null;break e}var D=0,H=-1,F=-1,ie=0,oe=0,he=e,se=null;t:for(;;){for(var ne;he!==s||c!==0&&he.nodeType!==3||(H=D+c),he!==m||n!==0&&he.nodeType!==3||(F=D+n),he.nodeType===3&&(D+=he.nodeValue.length),(ne=he.firstChild)!==null;)se=he,he=ne;for(;;){if(he===e)break t;if(se===s&&++ie===c&&(H=D),se===m&&++oe===n&&(F=D),(ne=he.nextSibling)!==null)break;he=se,se=he.parentNode}he=ne}s=H===-1||F===-1?null:{start:H,end:F}}else s=null}s=s||{start:0,end:0}}else s=null;for(Lc={focusedElem:e,selectionRange:s},io=!1,gt=t;gt!==null;)if(t=gt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,gt=e;else for(;gt!==null;){switch(t=gt,m=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++)c=e[s],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&m!==null){e=void 0,s=t,c=m.memoizedProps,m=m.memoizedState,n=s.stateNode;try{var ve=Us(s.type,c);e=n.getSnapshotBeforeUpdate(ve,m),n.__reactInternalSnapshotBeforeUpdate=e}catch(xe){Ie(s,s.return,xe)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,s=e.nodeType,s===9)Bc(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Bc(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,gt=e;break}gt=t.return}}function md(e,t,s){var n=s.flags;switch(s.tag){case 0:case 11:case 15:Mi(e,s),n&4&&_n(5,s);break;case 1:if(Mi(e,s),n&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(D){Ie(s,s.return,D)}else{var c=Us(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(D){Ie(s,s.return,D)}}n&64&&ld(s),n&512&&pn(s,s.return);break;case 3:if(Mi(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){Ie(s,s.return,D)}}break;case 27:t===null&&n&4&&fd(s);case 26:case 5:Mi(e,s),t===null&&n&4&&ud(s),n&512&&pn(s,s.return);break;case 12:Mi(e,s);break;case 31:Mi(e,s),n&4&&vd(e,s);break;case 13:Mi(e,s),n&4&&gd(e,s),n&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=kg.bind(null,s),Kg(e,s))));break;case 22:if(n=s.memoizedState!==null||Di,!n){t=t!==null&&t.memoizedState!==null||ft,c=Di;var m=ft;Di=n,(ft=t)&&!m?Li(e,s,(s.subtreeFlags&8772)!==0):Mi(e,s),Di=c,ft=m}break;case 30:break;default:Mi(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,Dt=!1;function Oi(e,t,s){for(s=s.child;s!==null;)pd(e,t,s),s=s.sibling}function pd(e,t,s){if(zt&&typeof zt.onCommitFiberUnmount=="function")try{zt.onCommitFiberUnmount(Cs,s)}catch{}switch(s.tag){case 26:ft||_i(s,t),Oi(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:ft||_i(s,t);var n=Je,c=Dt;as(s.type)&&(Je=s.stateNode,Dt=!1),Oi(e,t,s),En(s.stateNode),Je=n,Dt=c;break;case 5:ft||_i(s,t);case 6:if(n=Je,c=Dt,Je=null,Oi(e,t,s),Je=n,Dt=c,Je!==null)if(Dt)try{(Je.nodeType===9?Je.body:Je.nodeName==="HTML"?Je.ownerDocument.body:Je).removeChild(s.stateNode)}catch(m){Ie(s,t,m)}else try{Je.removeChild(s.stateNode)}catch(m){Ie(s,t,m)}break;case 18:Je!==null&&(Dt?(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,c=Dt,Je=s.stateNode.containerInfo,Dt=!0,Oi(e,t,s),Je=n,Dt=c;break;case 0:case 11:case 14:case 15:Qi(2,s,t),ft||Qi(4,s,t),Oi(e,t,s);break;case 1:ft||(_i(s,t),n=s.stateNode,typeof n.componentWillUnmount=="function"&&cd(s,t,n)),Oi(e,t,s);break;case 21:Oi(e,t,s);break;case 22:ft=(n=ft)||s.memoizedState!==null,Oi(e,t,s),ft=n;break;default:Oi(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){Ie(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){Ie(t,t.return,s)}}function gg(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 Ba(e,t){var s=gg(e);t.forEach(function(n){if(!s.has(n)){s.add(n);var c=Tg.bind(null,e,n);n.then(c,c)}})}function Ot(e,t){var s=t.deletions;if(s!==null)for(var n=0;n<s.length;n++){var c=s[n],m=e,D=t,H=D;e:for(;H!==null;){switch(H.tag){case 27:if(as(H.type)){Je=H.stateNode,Dt=!1;break e}break;case 5:Je=H.stateNode,Dt=!1;break e;case 3:case 4:Je=H.stateNode.containerInfo,Dt=!0;break e}H=H.return}if(Je===null)throw Error(o(160));pd(m,D,c),Je=null,Dt=!1,m=c.alternate,m!==null&&(m.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)yd(t,e),t=t.sibling}var li=null;function yd(e,t){var s=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ot(t,e),Mt(e),n&4&&(Qi(3,e,e.return),_n(3,e),Qi(5,e,e.return));break;case 1:Ot(t,e),Mt(e),n&512&&(ft||s===null||_i(s,s.return)),n&64&&Di&&(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 c=li;if(Ot(t,e),Mt(e),n&512&&(ft||s===null||_i(s,s.return)),n&4){var m=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,c=c.ownerDocument||c;t:switch(n){case"title":m=c.getElementsByTagName("title")[0],(!m||m[Pr]||m[yt]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=c.createElement(n),c.head.insertBefore(m,c.querySelector("head > title"))),Ct(m,n,s),m[yt]=e,vt(m),n=m;break e;case"link":var D=ym("link","href",c).get(n+(s.href||""));if(D){for(var H=0;H<D.length;H++)if(m=D[H],m.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&m.getAttribute("rel")===(s.rel==null?null:s.rel)&&m.getAttribute("title")===(s.title==null?null:s.title)&&m.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){D.splice(H,1);break t}}m=c.createElement(n),Ct(m,n,s),c.head.appendChild(m);break;case"meta":if(D=ym("meta","content",c).get(n+(s.content||""))){for(H=0;H<D.length;H++)if(m=D[H],m.getAttribute("content")===(s.content==null?null:""+s.content)&&m.getAttribute("name")===(s.name==null?null:s.name)&&m.getAttribute("property")===(s.property==null?null:s.property)&&m.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&m.getAttribute("charset")===(s.charSet==null?null:s.charSet)){D.splice(H,1);break t}}m=c.createElement(n),Ct(m,n,s),c.head.appendChild(m);break;default:throw Error(o(468,n))}m[yt]=e,vt(m),n=m}e.stateNode=n}else bm(c,e.type,e.stateNode);else e.stateNode=gm(c,n,e.memoizedProps);else m!==n?(m===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):m.count--,n===null?bm(c,e.type,e.stateNode):gm(c,n,e.memoizedProps)):n===null&&e.stateNode!==null&&lc(e,e.memoizedProps,s.memoizedProps)}break;case 27:Ot(t,e),Mt(e),n&512&&(ft||s===null||_i(s,s.return)),s!==null&&n&4&&lc(e,e.memoizedProps,s.memoizedProps);break;case 5:if(Ot(t,e),Mt(e),n&512&&(ft||s===null||_i(s,s.return)),e.flags&32){c=e.stateNode;try{er(c,"")}catch(ve){Ie(e,e.return,ve)}}n&4&&e.stateNode!=null&&(c=e.memoizedProps,lc(e,c,s!==null?s.memoizedProps:c)),n&1024&&(hc=!0);break;case 6:if(Ot(t,e),Mt(e),n&4){if(e.stateNode===null)throw Error(o(162));n=e.memoizedProps,s=e.stateNode;try{s.nodeValue=n}catch(ve){Ie(e,e.return,ve)}}break;case 3:if(Ja=null,c=li,li=Wa(t.containerInfo),Ot(t,e),li=c,Mt(e),n&4&&s!==null&&s.memoizedState.isDehydrated)try{Or(t.containerInfo)}catch(ve){Ie(e,e.return,ve)}hc&&(hc=!1,bd(e));break;case 4:n=li,li=Wa(e.stateNode.containerInfo),Ot(t,e),Mt(e),li=n;break;case 12:Ot(t,e),Mt(e);break;case 31:Ot(t,e),Mt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Ba(e,n)));break;case 13:Ot(t,e),Mt(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Ha=_t()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Ba(e,n)));break;case 22:c=e.memoizedState!==null;var F=s!==null&&s.memoizedState!==null,ie=Di,oe=ft;if(Di=ie||c,ft=oe||F,Ot(t,e),ft=oe,Di=ie,Mt(e),n&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(s===null||F||Di||ft||Is(e)),s=null,t=e;;){if(t.tag===5||t.tag===26){if(s===null){F=s=t;try{if(m=F.stateNode,c)D=m.style,typeof D.setProperty=="function"?D.setProperty("display","none","important"):D.display="none";else{H=F.stateNode;var he=F.memoizedProps.style,se=he!=null&&he.hasOwnProperty("display")?he.display:null;H.style.display=se==null||typeof se=="boolean"?"":(""+se).trim()}}catch(ve){Ie(F,F.return,ve)}}}else if(t.tag===6){if(s===null){F=t;try{F.stateNode.nodeValue=c?"":F.memoizedProps}catch(ve){Ie(F,F.return,ve)}}}else if(t.tag===18){if(s===null){F=t;try{var ne=F.stateNode;c?cm(ne,!0):cm(F.stateNode,!1)}catch(ve){Ie(F,F.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,Ba(e,s))));break;case 19:Ot(t,e),Mt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,Ba(e,n)));break;case 30:break;case 21:break;default:Ot(t,e),Mt(e)}}function Mt(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 c=s.stateNode,m=cc(e);ja(e,m,c);break;case 5:var D=s.stateNode;s.flags&32&&(er(D,""),s.flags&=-33);var H=cc(e);ja(e,H,D);break;case 3:case 4:var F=s.stateNode.containerInfo,ie=cc(e);uc(e,ie,F);break;default:throw Error(o(161))}}catch(oe){Ie(e,e.return,oe)}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 Mi(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)md(e,t.alternate,t),t=t.sibling}function Is(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Qi(4,t,t.return),Is(t);break;case 1:_i(t,t.return);var s=t.stateNode;typeof s.componentWillUnmount=="function"&&cd(t,t.return,s),Is(t);break;case 27:En(t.stateNode);case 26:case 5:_i(t,t.return),Is(t);break;case 22:t.memoizedState===null&&Is(t);break;case 30:Is(t);break;default:Is(t)}e=e.sibling}}function Li(e,t,s){for(s=s&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,c=e,m=t,D=m.flags;switch(m.tag){case 0:case 11:case 15:Li(c,m,s),_n(4,m);break;case 1:if(Li(c,m,s),n=m,c=n.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(ie){Ie(n,n.return,ie)}if(n=m,c=n.updateQueue,c!==null){var H=n.stateNode;try{var F=c.shared.hiddenCallbacks;if(F!==null)for(c.shared.hiddenCallbacks=null,c=0;c<F.length;c++)Wh(F[c],H)}catch(ie){Ie(n,n.return,ie)}}s&&D&64&&ld(m),pn(m,m.return);break;case 27:fd(m);case 26:case 5:Li(c,m,s),s&&n===null&&D&4&&ud(m),pn(m,m.return);break;case 12:Li(c,m,s);break;case 31:Li(c,m,s),s&&D&4&&vd(c,m);break;case 13:Li(c,m,s),s&&D&4&&gd(c,m);break;case 22:m.memoizedState===null&&Li(c,m,s),pn(m,m.return);break;case 30:break;default:Li(c,m,s)}t=t.sibling}}function fc(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 dc(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 ci(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 c=t.flags;switch(t.tag){case 0:case 11:case 15:ci(e,t,s,n),c&2048&&_n(9,t);break;case 1:ci(e,t,s,n);break;case 3:ci(e,t,s,n),c&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(c&2048){ci(e,t,s,n),e=t.stateNode;try{var m=t.memoizedProps,D=m.id,H=m.onPostCommit;typeof H=="function"&&H(D,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(F){Ie(t,t.return,F)}}else ci(e,t,s,n);break;case 31:ci(e,t,s,n);break;case 13:ci(e,t,s,n);break;case 23:break;case 22:m=t.stateNode,D=t.alternate,t.memoizedState!==null?m._visibility&2?ci(e,t,s,n):vn(e,t):m._visibility&2?ci(e,t,s,n):(m._visibility|=2,br(e,t,s,n,(t.subtreeFlags&10256)!==0||!1)),c&2048&&fc(D,t);break;case 24:ci(e,t,s,n),c&2048&&dc(t.alternate,t);break;default:ci(e,t,s,n)}}function br(e,t,s,n,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var m=e,D=t,H=s,F=n,ie=D.flags;switch(D.tag){case 0:case 11:case 15:br(m,D,H,F,c),_n(8,D);break;case 23:break;case 22:var oe=D.stateNode;D.memoizedState!==null?oe._visibility&2?br(m,D,H,F,c):vn(m,D):(oe._visibility|=2,br(m,D,H,F,c)),c&&ie&2048&&fc(D.alternate,D);break;case 24:br(m,D,H,F,c),c&&ie&2048&&dc(D.alternate,D);break;default:br(m,D,H,F,c)}t=t.sibling}}function vn(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,n=t,c=n.flags;switch(n.tag){case 22:vn(s,n),c&2048&&fc(n.alternate,n);break;case 24:vn(s,n),c&2048&&dc(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&&r0(s,li,e.memoizedState,e.memoizedProps);break;case 5:Sr(e,t,s);break;case 3:case 4:var n=li;li=Wa(e.stateNode.containerInfo),Sr(e,t,s),li=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];gt=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&&Qi(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,za(e)):yn(e);break;default:yn(e)}}function za(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];gt=n,Ed(n,e)}Cd(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Qi(8,t,t.return),za(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,za(t));break;default:za(t)}e=e.sibling}}function Ed(e,t){for(;gt!==null;){var s=gt;switch(s.tag){case 0:case 11:case 15:Qi(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,gt=n;else e:for(s=e;gt!==null;){n=gt;var c=n.sibling,m=n.return;if(_d(n),n===s){gt=null;break e}if(c!==null){c.return=m,gt=c;break e}gt=m}}}var yg={getCacheForType:function(e){var t=St(ct),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return St(ct).controller.signal}},bg=typeof WeakMap=="function"?WeakMap:Map,He=0,Ve=null,Ae=null,Oe=0,Ue=0,Zt=null,es=!1,xr=!1,mc=!1,Ni=0,st=0,ts=0,$s=0,_c=0,qt=0,Cr=0,bn=null,Lt=null,pc=!1,Ha=0,kd=0,Ua=1/0,Ia=null,is=null,pt=0,ss=null,wr=null,ji=0,vc=0,gc=null,Td=null,Sn=0,yc=null;function Ft(){return(He&2)!==0&&Oe!==0?Oe&-Oe:q.T!==null?Ec():Pu()}function Rd(){if(qt===0)if((Oe&536870912)===0||Le){var e=Gn;Gn<<=1,(Gn&3932160)===0&&(Gn=262144),qt=e}else qt=536870912;return e=$t.current,e!==null&&(e.flags|=32),qt}function Nt(e,t,s){(e===Ve&&(Ue===2||Ue===9)||e.cancelPendingCommit!==null)&&(Er(e,0),rs(e,Oe,qt,!1)),$r(e,s),((He&2)===0||e!==Ve)&&(e===Ve&&((He&2)===0&&($s|=s),st===4&&rs(e,Oe,qt,!1)),pi(e))}function Ad(e,t,s){if((He&6)!==0)throw Error(o(327));var n=!s&&(t&127)===0&&(t&e.expiredLanes)===0||Ir(e,t),c=n?Cg(e,t):Sc(e,t,!0),m=n;do{if(c===0){xr&&!n&&rs(e,t,0,!1);break}else{if(s=e.current.alternate,m&&!Sg(s)){c=Sc(e,t,!1),m=!1;continue}if(c===2){if(m=t,e.errorRecoveryDisabledLanes&m)var D=0;else D=e.pendingLanes&-536870913,D=D!==0?D:D&536870912?536870912:0;if(D!==0){t=D;e:{var H=e;c=bn;var F=H.current.memoizedState.isDehydrated;if(F&&(Er(H,D).flags|=256),D=Sc(H,D,!1),D!==2){if(mc&&!F){H.errorRecoveryDisabledLanes|=m,$s|=m,c=4;break e}m=Lt,Lt=c,m!==null&&(Lt===null?Lt=m:Lt.push.apply(Lt,m))}c=D}if(m=!1,c!==2)continue}}if(c===1){Er(e,0),rs(e,t,0,!0);break}e:{switch(n=e,m=c,m){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:rs(n,t,qt,!es);break e;case 2:Lt=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(c=Ha+300-_t(),10<c)){if(rs(n,t,qt,!es),Wn(n,0,!0)!==0)break e;ji=t,n.timeoutHandle=am(Dd.bind(null,n,s,Lt,Ia,pc,t,qt,$s,Cr,es,m,"Throttled",-0,0),c);break e}Dd(n,s,Lt,Ia,pc,t,qt,$s,Cr,es,m,null,-0,0)}}break}while(!0);pi(e)}function Dd(e,t,s,n,c,m,D,H,F,ie,oe,he,se,ne){if(e.timeoutHandle=-1,he=t.subtreeFlags,he&8192||(he&16785408)===16785408){he={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:bi},xd(t,m,he);var ve=(m&62914560)===m?Ha-_t():(m&4194048)===m?kd-_t():0;if(ve=n0(he,ve),ve!==null){ji=m,e.cancelPendingCommit=ve(Hd.bind(null,e,t,m,s,n,c,D,H,F,oe,he,null,se,ne)),rs(e,m,D,!ie);return}}Hd(e,t,m,s,n,c,D,H,F)}function Sg(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 c=s[n],m=c.getSnapshot;c=c.value;try{if(!Ut(m(),c))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 rs(e,t,s,n){t&=~_c,t&=~$s,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var c=t;0<c;){var m=31-Ht(c),D=1<<m;n[m]=-1,c&=~D}s!==0&&Uu(e,s,t)}function $a(){return(He&6)===0?(xn(0),!1):!0}function bc(){if(Ae!==null){if(Ue===0)var e=Ae.return;else e=Ae,wi=Ms=null,Bl(e),_r=null,rn=0,e=Ae;for(;e!==null;)od(e.alternate,e),e=e.return;Ae=null}}function Er(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,$g(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),ji=0,bc(),Ve=e,Ae=s=xi(e.current,null),Oe=t,Ue=0,Zt=null,es=!1,xr=Ir(e,t),mc=!1,Cr=qt=_c=$s=ts=st=0,Lt=bn=null,pc=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var c=31-Ht(n),m=1<<c;t|=e[c],n&=~m}return Ni=t,la(),s}function Od(e,t){Ee=null,q.H=fn,t===mr||t===pa?(t=Kh(),Ue=3):t===wl?(t=Kh(),Ue=4):Ue=t===Jl?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Zt=t,Ae===null&&(st=1,Da(e,Wt(t,e.current)))}function Md(){var e=$t.current;return e===null?!0:(Oe&4194048)===Oe?ei===null:(Oe&62914560)===Oe||(Oe&536870912)!==0?e===ei:!1}function Ld(){var e=q.H;return q.H=fn,e===null?fn:e}function Nd(){var e=q.A;return q.A=yg,e}function Pa(){st=4,es||(Oe&4194048)!==Oe&&$t.current!==null||(xr=!0),(ts&134217727)===0&&($s&134217727)===0||Ve===null||rs(Ve,Oe,qt,!1)}function Sc(e,t,s){var n=He;He|=2;var c=Ld(),m=Nd();(Ve!==e||Oe!==t)&&(Ia=null,Er(e,t)),t=!1;var D=st;e:do try{if(Ue!==0&&Ae!==null){var H=Ae,F=Zt;switch(Ue){case 8:bc(),D=6;break e;case 3:case 2:case 9:case 6:$t.current===null&&(t=!0);var ie=Ue;if(Ue=0,Zt=null,kr(e,H,F,ie),s&&xr){D=0;break e}break;default:ie=Ue,Ue=0,Zt=null,kr(e,H,F,ie)}}xg(),D=st;break}catch(oe){Od(e,oe)}while(!0);return t&&e.shellSuspendCounter++,wi=Ms=null,He=n,q.H=c,q.A=m,Ae===null&&(Ve=null,Oe=0,la()),D}function xg(){for(;Ae!==null;)jd(Ae)}function Cg(e,t){var s=He;He|=2;var n=Ld(),c=Nd();Ve!==e||Oe!==t?(Ia=null,Ua=_t()+500,Er(e,t)):xr=Ir(e,t);e:do try{if(Ue!==0&&Ae!==null){t=Ae;var m=Zt;t:switch(Ue){case 1:Ue=0,Zt=null,kr(e,t,m,1);break;case 2:case 9:if(qh(m)){Ue=0,Zt=null,Bd(t);break}t=function(){Ue!==2&&Ue!==9||Ve!==e||(Ue=7),pi(e)},m.then(t,t);break e;case 3:Ue=7;break e;case 4:Ue=5;break e;case 7:qh(m)?(Ue=0,Zt=null,Bd(t)):(Ue=0,Zt=null,kr(e,t,m,7));break;case 5:var D=null;switch(Ae.tag){case 26:D=Ae.memoizedState;case 5:case 27:var H=Ae;if(D?Sm(D):H.stateNode.complete){Ue=0,Zt=null;var F=H.sibling;if(F!==null)Ae=F;else{var ie=H.return;ie!==null?(Ae=ie,Za(ie)):Ae=null}break t}}Ue=0,Zt=null,kr(e,t,m,5);break;case 6:Ue=0,Zt=null,kr(e,t,m,6);break;case 8:bc(),st=6;break e;default:throw Error(o(462))}}wg();break}catch(oe){Od(e,oe)}while(!0);return wi=Ms=null,q.H=n,q.A=c,He=s,Ae!==null?0:(Ve=null,Oe=0,la(),st)}function wg(){for(;Ae!==null&&!Fs();)jd(Ae)}function jd(e){var t=nd(e.alternate,e,Ni);e.memoizedProps=e.pendingProps,t===null?Za(e):Ae=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:Bl(t);default:od(s,t),t=Ae=Lh(t,Ni),t=nd(s,t,Ni)}e.memoizedProps=e.pendingProps,t===null?Za(e):Ae=t}function kr(e,t,s,n){wi=Ms=null,Bl(t),_r=null,rn=0;var c=t.return;try{if(fg(e,c,t,s,Oe)){st=1,Da(e,Wt(s,e.current)),Ae=null;return}}catch(m){if(c!==null)throw Ae=c,m;st=1,Da(e,Wt(s,e.current)),Ae=null;return}t.flags&32768?(Le||n===1?e=!0:xr||(Oe&536870912)!==0?e=!1:(es=e=!0,(n===2||n===9||n===3||n===6)&&(n=$t.current,n!==null&&n.tag===13&&(n.flags|=16384))),zd(t,e)):Za(t)}function Za(e){var t=e;do{if((t.flags&32768)!==0){zd(t,es);return}e=t.return;var s=_g(t.alternate,t,Ni);if(s!==null){Ae=s;return}if(t=t.sibling,t!==null){Ae=t;return}Ae=t=e}while(t!==null);st===0&&(st=5)}function zd(e,t){do{var s=pg(e.alternate,e);if(s!==null){s.flags&=32767,Ae=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){Ae=e;return}Ae=e=s}while(e!==null);st=6,Ae=null}function Hd(e,t,s,n,c,m,D,H,F){e.cancelPendingCommit=null;do qa();while(pt!==0);if((He&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(m=t.lanes|t.childLanes,m|=cl,sv(e,s,m,D,H,F),e===Ve&&(Ae=Ve=null,Oe=0),wr=t,ss=e,ji=s,vc=m,gc=c,Td=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Rg(Bt,function(){return Zd(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=q.T,q.T=null,c=ee.p,ee.p=2,D=He,He|=4;try{vg(e,t,s)}finally{He=D,ee.p=c,q.T=n}}pt=1,Ud(),Id(),$d()}}function Ud(){if(pt===1){pt=0;var e=ss,t=wr,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=q.T,q.T=null;var n=ee.p;ee.p=2;var c=He;He|=4;try{yd(t,e);var m=Lc,D=wh(e.containerInfo),H=m.focusedElem,F=m.selectionRange;if(D!==H&&H&&H.ownerDocument&&Ch(H.ownerDocument.documentElement,H)){if(F!==null&&rl(H)){var ie=F.start,oe=F.end;if(oe===void 0&&(oe=ie),"selectionStart"in H)H.selectionStart=ie,H.selectionEnd=Math.min(oe,H.value.length);else{var he=H.ownerDocument||document,se=he&&he.defaultView||window;if(se.getSelection){var ne=se.getSelection(),ve=H.textContent.length,xe=Math.min(F.start,ve),Ke=F.end===void 0?xe:Math.min(F.end,ve);!ne.extend&&xe>Ke&&(D=Ke,Ke=xe,xe=D);var W=xh(H,xe),Y=xh(H,Ke);if(W&&Y&&(ne.rangeCount!==1||ne.anchorNode!==W.node||ne.anchorOffset!==W.offset||ne.focusNode!==Y.node||ne.focusOffset!==Y.offset)){var te=he.createRange();te.setStart(W.node,W.offset),ne.removeAllRanges(),xe>Ke?(ne.addRange(te),ne.extend(Y.node,Y.offset)):(te.setEnd(Y.node,Y.offset),ne.addRange(te))}}}}for(he=[],ne=H;ne=ne.parentNode;)ne.nodeType===1&&he.push({element:ne,left:ne.scrollLeft,top:ne.scrollTop});for(typeof H.focus=="function"&&H.focus(),H=0;H<he.length;H++){var ce=he[H];ce.element.scrollLeft=ce.left,ce.element.scrollTop=ce.top}}io=!!Mc,Lc=Mc=null}finally{He=c,ee.p=n,q.T=s}}e.current=t,pt=2}}function Id(){if(pt===2){pt=0;var e=ss,t=wr,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=q.T,q.T=null;var n=ee.p;ee.p=2;var c=He;He|=4;try{md(e,t.alternate,t)}finally{He=c,ee.p=n,q.T=s}}pt=3}}function $d(){if(pt===4||pt===3){pt=0,Tt();var e=ss,t=wr,s=ji,n=Td;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?pt=5:(pt=0,wr=ss=null,Pd(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(is=null),Uo(s),t=t.stateNode,zt&&typeof zt.onCommitFiberRoot=="function")try{zt.onCommitFiberRoot(Cs,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=q.T,c=ee.p,ee.p=2,q.T=null;try{for(var m=e.onRecoverableError,D=0;D<n.length;D++){var H=n[D];m(H.value,{componentStack:H.stack})}}finally{q.T=t,ee.p=c}}(ji&3)!==0&&qa(),pi(e),c=e.pendingLanes,(s&261930)!==0&&(c&42)!==0?e===yc?Sn++:(Sn=0,yc=e):Sn=0,xn(0)}}function Pd(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,tn(t)))}function qa(){return Ud(),Id(),$d(),Zd()}function Zd(){if(pt!==5)return!1;var e=ss,t=vc;vc=0;var s=Uo(ji),n=q.T,c=ee.p;try{ee.p=32>s?32:s,q.T=null,s=gc,gc=null;var m=ss,D=ji;if(pt=0,wr=ss=null,ji=0,(He&6)!==0)throw Error(o(331));var H=He;if(He|=4,wd(m.current),Sd(m,m.current,D,s),He=H,xn(0,!1),zt&&typeof zt.onPostCommitFiberRoot=="function")try{zt.onPostCommitFiberRoot(Cs,m)}catch{}return!0}finally{ee.p=c,q.T=n,Pd(e,t)}}function qd(e,t,s){t=Wt(s,t),t=Xl(e.stateNode,t,2),e=Wi(e,t,2),e!==null&&($r(e,2),pi(e))}function Ie(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"&&(is===null||!is.has(n))){e=Wt(s,e),s=Ff(2),n=Wi(t,s,2),n!==null&&(Kf(s,n,t,e),$r(n,2),pi(n));break}}t=t.return}}function xc(e,t,s){var n=e.pingCache;if(n===null){n=e.pingCache=new bg;var c=new Set;n.set(t,c)}else c=n.get(t),c===void 0&&(c=new Set,n.set(t,c));c.has(s)||(mc=!0,c.add(s),e=Eg.bind(null,e,t,s),t.then(e,e))}function Eg(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&&(st===4||st===3&&(Oe&62914560)===Oe&&300>_t()-Ha?(He&2)===0&&Er(e,0):_c|=s,Cr===Oe&&(Cr=0)),pi(e)}function Fd(e,t){t===0&&(t=Hu()),e=As(e,t),e!==null&&($r(e,t),pi(e))}function kg(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),Fd(e,s)}function Tg(e,t){var s=0;switch(e.tag){case 31:case 13:var n=e.stateNode,c=e.memoizedState;c!==null&&(s=c.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(o(314))}n!==null&&n.delete(t),Fd(e,s)}function Rg(e,t){return bs(e,t)}var Fa=null,Tr=null,Cc=!1,Ka=!1,wc=!1,ns=0;function pi(e){e!==Tr&&e.next===null&&(Tr===null?Fa=Tr=e:Tr=Tr.next=e),Ka=!0,Cc||(Cc=!0,Dg())}function xn(e,t){if(!wc&&Ka){wc=!0;do for(var s=!1,n=Fa;n!==null;){if(e!==0){var c=n.pendingLanes;if(c===0)var m=0;else{var D=n.suspendedLanes,H=n.pingedLanes;m=(1<<31-Ht(42|e)+1)-1,m&=c&~(D&~H),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(s=!0,Yd(n,m))}else m=Oe,m=Wn(n,n===Ve?m:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(m&3)===0||Ir(n,m)||(s=!0,Yd(n,m));n=n.next}while(s);wc=!1}}function Ag(){Kd()}function Kd(){Ka=Cc=!1;var e=0;ns!==0&&Ig()&&(e=ns);for(var t=_t(),s=null,n=Fa;n!==null;){var c=n.next,m=Vd(n,t);m===0?(n.next=null,s===null?Fa=c:s.next=c,c===null&&(Tr=s)):(s=n,(e!==0||(m&3)!==0)&&(Ka=!0)),n=c}pt!==0&&pt!==5||xn(e),ns!==0&&(ns=0)}function Vd(e,t){for(var s=e.suspendedLanes,n=e.pingedLanes,c=e.expirationTimes,m=e.pendingLanes&-62914561;0<m;){var D=31-Ht(m),H=1<<D,F=c[D];F===-1?((H&s)===0||(H&n)!==0)&&(c[D]=iv(H,t)):F<=t&&(e.expiredLanes|=H),m&=~H}if(t=Ve,s=Oe,s=Wn(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,s===0||e===t&&(Ue===2||Ue===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&Ss(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&&Ss(n),Uo(s)){case 2:case 8:s=Ks;break;case 32:s=Bt;break;case 268435456:s=ai;break;default:s=Bt}return n=Gd.bind(null,e),s=bs(s,n),e.callbackPriority=t,e.callbackNode=s,t}return n!==null&&n!==null&&Ss(n),e.callbackPriority=2,e.callbackNode=null,2}function Gd(e,t){if(pt!==0&&pt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(qa()&&e.callbackNode!==s)return null;var n=Oe;return n=Wn(e,e===Ve?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(Ad(e,n,t),Vd(e,_t()),e.callbackNode!=null&&e.callbackNode===s?Gd.bind(null,e):null)}function Yd(e,t){if(qa())return null;Ad(e,t,!0)}function Dg(){Pg(function(){(He&6)!==0?bs(Ii,Ag):Kd()})}function Ec(){if(ns===0){var e=fr;e===0&&(e=Vn,Vn<<=1,(Vn&261888)===0&&(Vn=256)),ns=e}return ns}function Wd(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ea(""+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 Og(e,t,s,n,c){if(t==="submit"&&s&&s.stateNode===c){var m=Wd((c[Rt]||null).action),D=n.submitter;D&&(t=(t=D[Rt]||null)?Wd(t.formAction):D.getAttribute("formAction"),t!==null&&(m=t,D=null));var H=new ra("action","action",null,n,c);e.push({event:H,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(ns!==0){var F=D?Xd(c,D):new FormData(c);Fl(s,{pending:!0,data:F,method:c.method,action:m},null,F)}}else typeof m=="function"&&(H.preventDefault(),F=D?Xd(c,D):new FormData(c),Fl(s,{pending:!0,data:F,method:c.method,action:m},m,F))},currentTarget:c}]})}}for(var kc=0;kc<ll.length;kc++){var Tc=ll[kc],Mg=Tc.toLowerCase(),Lg=Tc[0].toUpperCase()+Tc.slice(1);oi(Mg,"on"+Lg)}oi(Th,"onAnimationEnd"),oi(Rh,"onAnimationIteration"),oi(Ah,"onAnimationStart"),oi("dblclick","onDoubleClick"),oi("focusin","onFocus"),oi("focusout","onBlur"),oi(Yv,"onTransitionRun"),oi(Wv,"onTransitionStart"),oi(Xv,"onTransitionCancel"),oi(Dh,"onTransitionEnd"),Js("onMouseEnter",["mouseout","mouseover"]),Js("onMouseLeave",["mouseout","mouseover"]),Js("onPointerEnter",["pointerout","pointerover"]),Js("onPointerLeave",["pointerout","pointerover"]),Es("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Es("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Es("onBeforeInput",["compositionend","keypress","textInput","paste"]),Es("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Es("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Es("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(" "),Ng=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],c=n.event;n=n.listeners;e:{var m=void 0;if(t)for(var D=n.length-1;0<=D;D--){var H=n[D],F=H.instance,ie=H.currentTarget;if(H=H.listener,F!==m&&c.isPropagationStopped())break e;m=H,c.currentTarget=ie;try{m(c)}catch(oe){oa(oe)}c.currentTarget=null,m=F}else for(D=0;D<n.length;D++){if(H=n[D],F=H.instance,ie=H.currentTarget,H=H.listener,F!==m&&c.isPropagationStopped())break e;m=H,c.currentTarget=ie;try{m(c)}catch(oe){oa(oe)}c.currentTarget=null,m=F}}}}function De(e,t){var s=t[Io];s===void 0&&(s=t[Io]=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 Va="_reactListening"+Math.random().toString(36).slice(2);function Ac(e){if(!e[Va]){e[Va]=!0,Fu.forEach(function(s){s!=="selectionchange"&&(Ng.has(s)||Rc(s,!1,e),Rc(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Va]||(t[Va]=!0,Rc("selectionchange",!1,t))}}function Qd(e,t,s,n){switch(Rm(t)){case 2:var c=l0;break;case 8:c=c0;break;default:c=qc}s=c.bind(null,t,s,e),c=void 0,!Yo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),n?c!==void 0?e.addEventListener(t,s,{capture:!0,passive:c}):e.addEventListener(t,s,!0):c!==void 0?e.addEventListener(t,s,{passive:c}):e.addEventListener(t,s,!1)}function Dc(e,t,s,n,c){var m=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 H=n.stateNode.containerInfo;if(H===c)break;if(D===4)for(D=n.return;D!==null;){var F=D.tag;if((F===3||F===4)&&D.stateNode.containerInfo===c)return;D=D.return}for(;H!==null;){if(D=Ys(H),D===null)return;if(F=D.tag,F===5||F===6||F===26||F===27){n=m=D;continue e}H=H.parentNode}}n=n.return}sh(function(){var ie=m,oe=Vo(s),he=[];e:{var se=Oh.get(e);if(se!==void 0){var ne=ra,ve=e;switch(e){case"keypress":if(ia(s)===0)break e;case"keydown":case"keyup":ne=Tv;break;case"focusin":ve="focus",ne=Qo;break;case"focusout":ve="blur",ne=Qo;break;case"beforeblur":case"afterblur":ne=Qo;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":ne=ah;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ne=_v;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=Dv;break;case Th:case Rh:case Ah:ne=gv;break;case Dh:ne=Mv;break;case"scroll":case"scrollend":ne=dv;break;case"wheel":ne=Nv;break;case"copy":case"cut":case"paste":ne=bv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ne=lh;break;case"toggle":case"beforetoggle":ne=Bv}var xe=(t&4)!==0,Ke=!xe&&(e==="scroll"||e==="scrollend"),W=xe?se!==null?se+"Capture":null:se;xe=[];for(var Y=ie,te;Y!==null;){var ce=Y;if(te=ce.stateNode,ce=ce.tag,ce!==5&&ce!==26&&ce!==27||te===null||W===null||(ce=qr(Y,W),ce!=null&&xe.push(wn(Y,ce,te))),Ke)break;Y=Y.return}0<xe.length&&(se=new ne(se,ve,null,s,oe),he.push({event:se,listeners:xe}))}}if((t&7)===0){e:{if(se=e==="mouseover"||e==="pointerover",ne=e==="mouseout"||e==="pointerout",se&&s!==Ko&&(ve=s.relatedTarget||s.fromElement)&&(Ys(ve)||ve[Gs]))break e;if((ne||se)&&(se=oe.window===oe?oe:(se=oe.ownerDocument)?se.defaultView||se.parentWindow:window,ne?(ve=s.relatedTarget||s.toElement,ne=ie,ve=ve?Ys(ve):null,ve!==null&&(Ke=k(ve),xe=ve.tag,ve!==Ke||xe!==5&&xe!==27&&xe!==6)&&(ve=null)):(ne=null,ve=ie),ne!==ve)){if(xe=ah,ce="onMouseLeave",W="onMouseEnter",Y="mouse",(e==="pointerout"||e==="pointerover")&&(xe=lh,ce="onPointerLeave",W="onPointerEnter",Y="pointer"),Ke=ne==null?se:Zr(ne),te=ve==null?se:Zr(ve),se=new xe(ce,Y+"leave",ne,s,oe),se.target=Ke,se.relatedTarget=te,ce=null,Ys(oe)===ie&&(xe=new xe(W,Y+"enter",ve,s,oe),xe.target=te,xe.relatedTarget=Ke,ce=xe),Ke=ce,ne&&ve)t:{for(xe=jg,W=ne,Y=ve,te=0,ce=W;ce;ce=xe(ce))te++;ce=0;for(var ye=Y;ye;ye=xe(ye))ce++;for(;0<te-ce;)W=xe(W),te--;for(;0<ce-te;)Y=xe(Y),ce--;for(;te--;){if(W===Y||Y!==null&&W===Y.alternate){xe=W;break t}W=xe(W),Y=xe(Y)}xe=null}else xe=null;ne!==null&&em(he,se,ne,xe,!1),ve!==null&&Ke!==null&&em(he,Ke,ve,xe,!0)}}e:{if(se=ie?Zr(ie):window,ne=se.nodeName&&se.nodeName.toLowerCase(),ne==="select"||ne==="input"&&se.type==="file")var Be=ph;else if(mh(se))if(vh)Be=Kv;else{Be=qv;var ge=Zv}else ne=se.nodeName,!ne||ne.toLowerCase()!=="input"||se.type!=="checkbox"&&se.type!=="radio"?ie&&Fo(ie.elementType)&&(Be=ph):Be=Fv;if(Be&&(Be=Be(e,ie))){_h(he,Be,s,oe);break e}ge&&ge(e,se,ie),e==="focusout"&&ie&&se.type==="number"&&ie.memoizedProps.value!=null&&qo(se,"number",se.value)}switch(ge=ie?Zr(ie):window,e){case"focusin":(mh(ge)||ge.contentEditable==="true")&&(rr=ge,nl=ie,Jr=null);break;case"focusout":Jr=nl=rr=null;break;case"mousedown":al=!0;break;case"contextmenu":case"mouseup":case"dragend":al=!1,Eh(he,s,oe);break;case"selectionchange":if(Gv)break;case"keydown":case"keyup":Eh(he,s,oe)}var ke;if(tl)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()):(Zi=oe,Wo="value"in Zi?Zi.value:Zi.textContent,sr=!0)),ge=Ga(ie,Me),0<ge.length&&(Me=new oh(Me,e,null,s,oe),he.push({event:Me,listeners:ge}),ke?Me.data=ke:(ke=dh(s),ke!==null&&(Me.data=ke)))),(ke=Hv?Uv(e,s):Iv(e,s))&&(Me=Ga(ie,"onBeforeInput"),0<Me.length&&(ge=new oh("onBeforeInput","beforeinput",null,s,oe),he.push({event:ge,listeners:Me}),ge.data=ke)),Og(he,e,ie,s,oe)}Jd(he,t)})}function wn(e,t,s){return{instance:e,listener:t,currentTarget:s}}function Ga(e,t){for(var s=t+"Capture",n=[];e!==null;){var c=e,m=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||m===null||(c=qr(e,s),c!=null&&n.unshift(wn(e,c,m)),c=qr(e,t),c!=null&&n.push(wn(e,c,m))),e.tag===3)return n;e=e.return}return[]}function jg(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,c){for(var m=t._reactName,D=[];s!==null&&s!==n;){var H=s,F=H.alternate,ie=H.stateNode;if(H=H.tag,F!==null&&F===n)break;H!==5&&H!==26&&H!==27||ie===null||(F=ie,c?(ie=qr(s,m),ie!=null&&D.unshift(wn(s,ie,F))):c||(ie=qr(s,m),ie!=null&&D.push(wn(s,ie,F)))),s=s.return}D.length!==0&&e.push({event:t,listeners:D})}var Bg=/\r\n?/g,zg=/\u0000|\uFFFD/g;function tm(e){return(typeof e=="string"?e:""+e).replace(Bg,`
|
|
49
|
+
`).replace(zg,"")}function im(e,t){return t=tm(t),tm(e)===t}function Fe(e,t,s,n,c,m){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":Jn(e,"class",n);break;case"tabIndex":Jn(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":Jn(e,s,n);break;case"style":th(e,n,m);break;case"data":if(t!=="object"){Jn(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=ea(""+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 m=="function"&&(s==="formAction"?(t!=="input"&&Fe(e,t,"name",c.name,c,null),Fe(e,t,"formEncType",c.formEncType,c,null),Fe(e,t,"formMethod",c.formMethod,c,null),Fe(e,t,"formTarget",c.formTarget,c,null)):(Fe(e,t,"encType",c.encType,c,null),Fe(e,t,"method",c.method,c,null),Fe(e,t,"target",c.target,c,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(s);break}n=ea(""+n),e.setAttribute(s,n);break;case"onClick":n!=null&&(e.onclick=bi);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(c.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=ea(""+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),Xn(e,"popover",n);break;case"xlinkActuate":yi(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":yi(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":yi(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":yi(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":yi(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":yi(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":yi(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":yi(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":yi(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":Xn(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=hv.get(s)||s,Xn(e,s,n))}}function Oc(e,t,s,n,c,m){switch(s){case"style":th(e,n,m);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(o(61));if(s=n.__html,s!=null){if(c.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=bi);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"&&(c=s.endsWith("Capture"),t=s.slice(2,c?s.length-7:void 0),m=e[Rt]||null,m=m!=null?m[s]:null,typeof m=="function"&&e.removeEventListener(t,m,c),typeof n=="function")){typeof m!="function"&&m!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(t,n,c);break e}s in e?e[s]=n:n===!0?e.setAttribute(s,""):Xn(e,s,n)}}}function Ct(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,c=!1,m;for(m in s)if(s.hasOwnProperty(m)){var D=s[m];if(D!=null)switch(m){case"src":n=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Fe(e,t,m,D,s,null)}}c&&Fe(e,t,"srcSet",s.srcSet,s,null),n&&Fe(e,t,"src",s.src,s,null);return;case"input":De("invalid",e);var H=m=D=c=null,F=null,ie=null;for(n in s)if(s.hasOwnProperty(n)){var oe=s[n];if(oe!=null)switch(n){case"name":c=oe;break;case"type":D=oe;break;case"checked":F=oe;break;case"defaultChecked":ie=oe;break;case"value":m=oe;break;case"defaultValue":H=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(o(137,t));break;default:Fe(e,t,n,oe,s,null)}}Xu(e,m,H,F,ie,D,c,!1);return;case"select":De("invalid",e),n=D=m=null;for(c in s)if(s.hasOwnProperty(c)&&(H=s[c],H!=null))switch(c){case"value":m=H;break;case"defaultValue":D=H;break;case"multiple":n=H;default:Fe(e,t,c,H,s,null)}t=m,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),m=c=n=null;for(D in s)if(s.hasOwnProperty(D)&&(H=s[D],H!=null))switch(D){case"value":n=H;break;case"defaultValue":c=H;break;case"children":m=H;break;case"dangerouslySetInnerHTML":if(H!=null)throw Error(o(91));break;default:Fe(e,t,D,H,s,null)}Qu(e,n,c,m);return;case"option":for(F in s)if(s.hasOwnProperty(F)&&(n=s[F],n!=null))switch(F){case"selected":e.selected=n&&typeof n!="function"&&typeof n!="symbol";break;default:Fe(e,t,F,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(Fo(t)){for(oe in s)s.hasOwnProperty(oe)&&(n=s[oe],n!==void 0&&Oc(e,t,oe,n,s,void 0));return}}for(H in s)s.hasOwnProperty(H)&&(n=s[H],n!=null&&Fe(e,t,H,n,s,null))}function Hg(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 c=null,m=null,D=null,H=null,F=null,ie=null,oe=null;for(ne in s){var he=s[ne];if(s.hasOwnProperty(ne)&&he!=null)switch(ne){case"checked":break;case"value":break;case"defaultValue":F=he;default:n.hasOwnProperty(ne)||Fe(e,t,ne,null,n,he)}}for(var se in n){var ne=n[se];if(he=s[se],n.hasOwnProperty(se)&&(ne!=null||he!=null))switch(se){case"type":m=ne;break;case"name":c=ne;break;case"checked":ie=ne;break;case"defaultChecked":oe=ne;break;case"value":D=ne;break;case"defaultValue":H=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(o(137,t));break;default:ne!==he&&Fe(e,t,se,ne,n,he)}}Zo(e,D,H,F,ie,oe,m,c);return;case"select":ne=D=H=se=null;for(m in s)if(F=s[m],s.hasOwnProperty(m)&&F!=null)switch(m){case"value":break;case"multiple":ne=F;default:n.hasOwnProperty(m)||Fe(e,t,m,null,n,F)}for(c in n)if(m=n[c],F=s[c],n.hasOwnProperty(c)&&(m!=null||F!=null))switch(c){case"value":se=m;break;case"defaultValue":H=m;break;case"multiple":D=m;default:m!==F&&Fe(e,t,c,m,n,F)}t=H,s=D,n=ne,se!=null?Qs(e,!!s,se,!1):!!n!=!!s&&(t!=null?Qs(e,!!s,t,!0):Qs(e,!!s,s?[]:"",!1));return;case"textarea":ne=se=null;for(H in s)if(c=s[H],s.hasOwnProperty(H)&&c!=null&&!n.hasOwnProperty(H))switch(H){case"value":break;case"children":break;default:Fe(e,t,H,null,n,c)}for(D in n)if(c=n[D],m=s[D],n.hasOwnProperty(D)&&(c!=null||m!=null))switch(D){case"value":se=c;break;case"defaultValue":ne=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(o(91));break;default:c!==m&&Fe(e,t,D,c,n,m)}Ju(e,se,ne);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(F in n)if(se=n[F],ne=s[F],n.hasOwnProperty(F)&&se!==ne&&(se!=null||ne!=null))switch(F){case"selected":e.selected=se&&typeof se!="function"&&typeof se!="symbol";break;default:Fe(e,t,F,se,n,ne)}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 xe in s)se=s[xe],s.hasOwnProperty(xe)&&se!=null&&!n.hasOwnProperty(xe)&&Fe(e,t,xe,null,n,se);for(ie in n)if(se=n[ie],ne=s[ie],n.hasOwnProperty(ie)&&se!==ne&&(se!=null||ne!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(o(137,t));break;default:Fe(e,t,ie,se,n,ne)}return;default:if(Fo(t)){for(var Ke in s)se=s[Ke],s.hasOwnProperty(Ke)&&se!==void 0&&!n.hasOwnProperty(Ke)&&Oc(e,t,Ke,void 0,n,se);for(oe in n)se=n[oe],ne=s[oe],!n.hasOwnProperty(oe)||se===ne||se===void 0&&ne===void 0||Oc(e,t,oe,se,n,ne);return}}for(var W in s)se=s[W],s.hasOwnProperty(W)&&se!=null&&!n.hasOwnProperty(W)&&Fe(e,t,W,null,n,se);for(he in n)se=n[he],ne=s[he],!n.hasOwnProperty(he)||se===ne||se==null&&ne==null||Fe(e,t,he,se,n,ne)}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 Ug(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,s=performance.getEntriesByType("resource"),n=0;n<s.length;n++){var c=s[n],m=c.transferSize,D=c.initiatorType,H=c.duration;if(m&&H&&sm(D)){for(D=0,H=c.responseEnd,n+=1;n<s.length;n++){var F=s[n],ie=F.startTime;if(ie>H)break;var oe=F.transferSize,he=F.initiatorType;oe&&sm(he)&&(F=F.responseEnd,D+=oe*(F<H?1:(H-ie)/(F-ie)))}if(--n,t+=8*(m+D)/(c.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Mc=null,Lc=null;function Ya(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 Nc(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 jc=null;function Ig(){var e=window.event;return e&&e.type==="popstate"?e===jc?!1:(jc=e,!0):(jc=null,!1)}var am=typeof setTimeout=="function"?setTimeout:void 0,$g=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(Zg)}:am;function Zg(e){setTimeout(function(){throw e})}function as(e){return e==="head"}function lm(e,t){var s=t,n=0;do{var c=s.nextSibling;if(e.removeChild(s),c&&c.nodeType===8)if(s=c.data,s==="/$"||s==="/&"){if(n===0){e.removeChild(c),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 m=s.firstChild;m;){var D=m.nextSibling,H=m.nodeName;m[Pr]||H==="SCRIPT"||H==="STYLE"||H==="LINK"&&m.rel.toLowerCase()==="stylesheet"||s.removeChild(m),m=D}}else s==="body"&&En(e.ownerDocument.body);s=c}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 Bc(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":Bc(s),$o(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function qg(e,t,s,n){for(;e.nodeType===1;){var c=s;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[Pr])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(m=e.getAttribute("rel"),m==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(m!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(m=e.getAttribute("src"),(m!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&m&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var m=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===m)return e}else return e;if(e=ti(e.nextSibling),e===null)break}return null}function Fg(e,t,s){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=ti(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=ti(e.nextSibling),e===null))return null;return e}function zc(e){return e.data==="$?"||e.data==="$~"}function Hc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Kg(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 ti(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 Uc=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 ti(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=Ya(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 ii=new Map,mm=new Set;function Wa(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Bi=ee.d;ee.d={f:Vg,r:Gg,D:Yg,C:Wg,L:Xg,m:Jg,X:e0,S:Qg,M:t0};function Vg(){var e=Bi.f(),t=$a();return e||t}function Gg(e){var t=Ws(e);t!==null&&t.tag===5&&t.type==="form"?Of(t):Bi.r(e)}var Rr=typeof document>"u"?null:document;function _m(e,t,s){var n=Rr;if(n&&typeof t=="string"&&t){var c=Gt(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof s=="string"&&(c+='[crossorigin="'+s+'"]'),mm.has(c)||(mm.add(c),e={rel:e,crossOrigin:s,href:t},n.querySelector(c)===null&&(t=n.createElement("link"),Ct(t,"link",e),vt(t),n.head.appendChild(t)))}}function Yg(e){Bi.D(e),_m("dns-prefetch",e,null)}function Wg(e,t){Bi.C(e,t),_m("preconnect",e,t)}function Xg(e,t,s){Bi.L(e,t,s);var n=Rr;if(n&&e&&t){var c='link[rel="preload"][as="'+Gt(t)+'"]';t==="image"&&s&&s.imageSrcSet?(c+='[imagesrcset="'+Gt(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(c+='[imagesizes="'+Gt(s.imageSizes)+'"]')):c+='[href="'+Gt(e)+'"]';var m=c;switch(t){case"style":m=Ar(e);break;case"script":m=Dr(e)}ii.has(m)||(e=d({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),ii.set(m,e),n.querySelector(c)!==null||t==="style"&&n.querySelector(kn(m))||t==="script"&&n.querySelector(Tn(m))||(t=n.createElement("link"),Ct(t,"link",e),vt(t),n.head.appendChild(t)))}}function Jg(e,t){Bi.m(e,t);var s=Rr;if(s&&e){var n=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+Gt(n)+'"][href="'+Gt(e)+'"]',m=c;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=Dr(e)}if(!ii.has(m)&&(e=d({rel:"modulepreload",href:e},t),ii.set(m,e),s.querySelector(c)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Tn(m)))return}n=s.createElement("link"),Ct(n,"link",e),vt(n),s.head.appendChild(n)}}}function Qg(e,t,s){Bi.S(e,t,s);var n=Rr;if(n&&e){var c=Xs(n).hoistableStyles,m=Ar(e);t=t||"default";var D=c.get(m);if(!D){var H={loading:0,preload:null};if(D=n.querySelector(kn(m)))H.loading=5;else{e=d({rel:"stylesheet",href:e,"data-precedence":t},s),(s=ii.get(m))&&Ic(e,s);var F=D=n.createElement("link");vt(F),Ct(F,"link",e),F._p=new Promise(function(ie,oe){F.onload=ie,F.onerror=oe}),F.addEventListener("load",function(){H.loading|=1}),F.addEventListener("error",function(){H.loading|=2}),H.loading|=4,Xa(D,t,n)}D={type:"stylesheet",instance:D,count:1,state:H},c.set(m,D)}}}function e0(e,t){Bi.X(e,t);var s=Rr;if(s&&e){var n=Xs(s).hoistableScripts,c=Dr(e),m=n.get(c);m||(m=s.querySelector(Tn(c)),m||(e=d({src:e,async:!0},t),(t=ii.get(c))&&$c(e,t),m=s.createElement("script"),vt(m),Ct(m,"link",e),s.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},n.set(c,m))}}function t0(e,t){Bi.M(e,t);var s=Rr;if(s&&e){var n=Xs(s).hoistableScripts,c=Dr(e),m=n.get(c);m||(m=s.querySelector(Tn(c)),m||(e=d({src:e,async:!0,type:"module"},t),(t=ii.get(c))&&$c(e,t),m=s.createElement("script"),vt(m),Ct(m,"link",e),s.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},n.set(c,m))}}function pm(e,t,s,n){var c=(c=de.current)?Wa(c):null;if(!c)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(t=Ar(s.href),s=Xs(c).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=Ar(s.href);var m=Xs(c).hoistableStyles,D=m.get(e);if(D||(c=c.ownerDocument||c,D={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(e,D),(m=c.querySelector(kn(e)))&&!m._p&&(D.instance=m,D.state.loading=5),ii.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},ii.set(e,s),m||i0(c,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(c).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 Ar(e){return'href="'+Gt(e)+'"'}function kn(e){return'link[rel="stylesheet"]['+e+"]"}function vm(e){return d({},e,{"data-precedence":e.precedence,precedence:null})}function i0(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}),Ct(t,"link",s),vt(t),e.head.appendChild(t))}function Dr(e){return'[src="'+Gt(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~="'+Gt(s.href)+'"]');if(n)return t.instance=n,vt(n),n;var c=d({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),vt(n),Ct(n,"style",c),Xa(n,s.precedence,e),t.instance=n;case"stylesheet":c=Ar(s.href);var m=e.querySelector(kn(c));if(m)return t.state.loading|=4,t.instance=m,vt(m),m;n=vm(s),(c=ii.get(c))&&Ic(n,c),m=(e.ownerDocument||e).createElement("link"),vt(m);var D=m;return D._p=new Promise(function(H,F){D.onload=H,D.onerror=F}),Ct(m,"link",n),t.state.loading|=4,Xa(m,s.precedence,e),t.instance=m;case"script":return m=Dr(s.src),(c=e.querySelector(Tn(m)))?(t.instance=c,vt(c),c):(n=s,(c=ii.get(m))&&(n=d({},s),$c(n,c)),e=e.ownerDocument||e,c=e.createElement("script"),vt(c),Ct(c,"link",n),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,Xa(n,s.precedence,e));return t.instance}function Xa(e,t,s){for(var n=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=n.length?n[n.length-1]:null,m=c,D=0;D<n.length;D++){var H=n[D];if(H.dataset.precedence===t)m=H;else if(m!==c)break}m?m.parentNode.insertBefore(e,m.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function Ic(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 Ja=null;function ym(e,t,s){if(Ja===null){var n=new Map,c=Ja=new Map;c.set(s,n)}else c=Ja,n=c.get(s),n||(n=new Map,c.set(s,n));if(n.has(e))return n;for(n.set(e,null),s=s.getElementsByTagName(e),c=0;c<s.length;c++){var m=s[c];if(!(m[Pr]||m[yt]||e==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var D=m.getAttribute(t)||"";D=e+D;var H=n.get(D);H?H.push(m):n.set(D,[m])}}return n}function bm(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function s0(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 r0(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 c=Ar(n.href),m=t.querySelector(kn(c));if(m){t=m._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Qa.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=m,vt(m);return}m=t.ownerDocument||t,n=vm(n),(c=ii.get(c))&&Ic(n,c),m=m.createElement("link"),vt(m);var D=m;D._p=new Promise(function(H,F){D.onload=H,D.onerror=F}),Ct(m,"link",n),s.instance=m}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=Qa.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var Pc=0;function n0(e,t){return e.stylesheets&&e.count===0&&to(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var n=setTimeout(function(){if(e.stylesheets&&to(e,e.stylesheets),e.unsuspend){var m=e.unsuspend;e.unsuspend=null,m()}},6e4+t);0<e.imgBytes&&Pc===0&&(Pc=62500*Ug());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&to(e,e.stylesheets),e.unsuspend)){var m=e.unsuspend;e.unsuspend=null,m()}},(e.imgBytes>Pc?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(c)}}:null}function Qa(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)to(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var eo=null;function to(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,eo=new Map,t.forEach(a0,e),eo=null,Qa.call(e))}function a0(e,t){if(!(t.state.loading&4)){var s=eo.get(e);if(s)var n=s.get(null);else{s=new Map,eo.set(e,s);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<c.length;m++){var D=c[m];(D.nodeName==="LINK"||D.getAttribute("media")!=="not all")&&(s.set(D.dataset.precedence,D),n=D)}n&&s.set(null,n)}c=t.instance,D=c.getAttribute("data-precedence"),m=s.get(D)||n,m===n&&s.set(null,c),s.set(D,c),this.count++,n=Qa.bind(this),c.addEventListener("load",n),c.addEventListener("error",n),m?m.parentNode.insertBefore(c,m.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var Rn={$$typeof:v,Provider:null,Consumer:null,_currentValue:J,_currentValue2:J,_threadCount:0};function o0(e,t,s,n,c,m,D,H,F){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=zo(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zo(0),this.hiddenUpdates=zo(null),this.identifierPrefix=n,this.onUncaughtError=c,this.onCaughtError=m,this.onRecoverableError=D,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=F,this.incompleteTransitions=new Map}function xm(e,t,s,n,c,m,D,H,F,ie,oe,he){return e=new o0(e,t,s,D,F,ie,oe,he,H),t=1,m===!0&&(t|=24),m=It(3,null,null,t),e.current=m,m.stateNode=e,t=Sl(),t.refCount++,e.pooledCache=t,t.refCount++,m.memoizedState={element:n,isDehydrated:s,cache:t},El(m),e}function Cm(e){return e?(e=or,e):or}function wm(e,t,s,n,c,m){c=Cm(c),n.context===null?n.context=c:n.pendingContext=c,n=Yi(t),n.payload={element:s},m=m===void 0?null:m,m!==null&&(n.callback=m),s=Wi(e,n,t),s!==null&&(Nt(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 Zc(e,t){Em(e,t),(e=e.alternate)&&Em(e,t)}function km(e){if(e.tag===13||e.tag===31){var t=As(e,67108864);t!==null&&Nt(t,e,67108864),Zc(e,67108864)}}function Tm(e){if(e.tag===13||e.tag===31){var t=Ft();t=Ho(t);var s=As(e,t);s!==null&&Nt(s,e,t),Zc(e,t)}}var io=!0;function l0(e,t,s,n){var c=q.T;q.T=null;var m=ee.p;try{ee.p=2,qc(e,t,s,n)}finally{ee.p=m,q.T=c}}function c0(e,t,s,n){var c=q.T;q.T=null;var m=ee.p;try{ee.p=8,qc(e,t,s,n)}finally{ee.p=m,q.T=c}}function qc(e,t,s,n){if(io){var c=Fc(n);if(c===null)Dc(e,t,n,so,s),Am(e,n);else if(h0(c,e,t,s,n))n.stopPropagation();else if(Am(e,n),t&4&&-1<u0.indexOf(e)){for(;c!==null;){var m=Ws(c);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var D=ws(m.pendingLanes);if(D!==0){var H=m;for(H.pendingLanes|=2,H.entangledLanes|=2;D;){var F=1<<31-Ht(D);H.entanglements[1]|=F,D&=~F}pi(m),(He&6)===0&&(Ua=_t()+500,xn(0))}}break;case 31:case 13:H=As(m,2),H!==null&&Nt(H,m,2),$a(),Zc(m,2)}if(m=Fc(n),m===null&&Dc(e,t,n,so,s),m===c)break;c=m}c!==null&&n.stopPropagation()}else Dc(e,t,n,null,s)}}function Fc(e){return e=Vo(e),Kc(e)}var so=null;function Kc(e){if(so=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=l(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 so=e,null}function Rm(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(Kt()){case Ii:return 2;case Ks:return 8;case Bt:case Vs:return 32;case ai:return 268435456;default:return 32}default:return 32}}var Vc=!1,os=null,ls=null,cs=null,An=new Map,Dn=new Map,us=[],u0="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 Am(e,t){switch(e){case"focusin":case"focusout":os=null;break;case"dragenter":case"dragleave":ls=null;break;case"mouseover":case"mouseout":cs=null;break;case"pointerover":case"pointerout":An.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Dn.delete(t.pointerId)}}function On(e,t,s,n,c,m){return e===null||e.nativeEvent!==m?(e={blockedOn:t,domEventName:s,eventSystemFlags:n,nativeEvent:m,targetContainers:[c]},t!==null&&(t=Ws(t),t!==null&&km(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function h0(e,t,s,n,c){switch(t){case"focusin":return os=On(os,e,t,s,n,c),!0;case"dragenter":return ls=On(ls,e,t,s,n,c),!0;case"mouseover":return cs=On(cs,e,t,s,n,c),!0;case"pointerover":var m=c.pointerId;return An.set(m,On(An.get(m)||null,e,t,s,n,c)),!0;case"gotpointercapture":return m=c.pointerId,Dn.set(m,On(Dn.get(m)||null,e,t,s,n,c)),!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=l(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 ro(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=Fc(e.nativeEvent);if(s===null){s=e.nativeEvent;var n=new s.constructor(s.type,s);Ko=n,s.target.dispatchEvent(n),Ko=null}else return t=Ws(s),t!==null&&km(t),e.blockedOn=s,!1;t.shift()}return!0}function Om(e,t,s){ro(e)&&s.delete(t)}function f0(){Vc=!1,os!==null&&ro(os)&&(os=null),ls!==null&&ro(ls)&&(ls=null),cs!==null&&ro(cs)&&(cs=null),An.forEach(Om),Dn.forEach(Om)}function no(e,t){e.blockedOn===t&&(e.blockedOn=null,Vc||(Vc=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,f0)))}var ao=null;function Mm(e){ao!==e&&(ao=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){ao===e&&(ao=null);for(var t=0;t<e.length;t+=3){var s=e[t],n=e[t+1],c=e[t+2];if(typeof n!="function"){if(Kc(n||s)===null)continue;break}var m=Ws(s);m!==null&&(e.splice(t,3),t-=3,Fl(m,{pending:!0,data:c,method:s.method,action:n},n,c))}}))}function Or(e){function t(F){return no(F,e)}os!==null&&no(os,e),ls!==null&&no(ls,e),cs!==null&&no(cs,e),An.forEach(t),Dn.forEach(t);for(var s=0;s<us.length;s++){var n=us[s];n.blockedOn===e&&(n.blockedOn=null)}for(;0<us.length&&(s=us[0],s.blockedOn===null);)Dm(s),s.blockedOn===null&&us.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(n=0;n<s.length;n+=3){var c=s[n],m=s[n+1],D=c[Rt]||null;if(typeof m=="function")D||Mm(s);else if(D){var H=null;if(m&&m.hasAttribute("formAction")){if(c=m,D=m[Rt]||null)H=D.formAction;else if(Kc(c)!==null)continue}else H=D.action;typeof H=="function"?s[n+1]=H:(s.splice(n,3),n-=3),Mm(s)}}}function Lm(){function e(m){m.canIntercept&&m.info==="react-transition"&&m.intercept({handler:function(){return new Promise(function(D){return c=D})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),n||setTimeout(s,20)}function s(){if(!n&&!navigation.transition){var m=navigation.currentEntry;m&&m.url!=null&&navigation.navigate(m.url,{state:m.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(s,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function Gc(e){this._internalRoot=e}oo.prototype.render=Gc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var s=t.current,n=Ft();wm(s,n,e,t,null,null)},oo.prototype.unmount=Gc.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 oo(e){this._internalRoot=e}oo.prototype.unstable_scheduleHydration=function(e){if(e){var t=Pu();e={blockedOn:null,target:e,priority:t};for(var s=0;s<us.length&&t!==0&&t<us[s].priority;s++);us.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"));ee.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=u(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var d0={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:q,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var lo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!lo.isDisabled&&lo.supportsFiber)try{Cs=lo.inject(d0),zt=lo}catch{}}return Ln.createRoot=function(e,t){if(!g(e))throw Error(o(299));var s=!1,n="",c=$f,m=Pf,D=Zf;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(m=t.onCaughtError),t.onRecoverableError!==void 0&&(D=t.onRecoverableError)),t=xm(e,1,!1,null,null,s,n,null,c,m,D,Lm),e[Gs]=t.current,Ac(e),new Gc(t)},Ln.hydrateRoot=function(e,t,s){if(!g(e))throw Error(o(299));var n=!1,c="",m=$f,D=Pf,H=Zf,F=null;return s!=null&&(s.unstable_strictMode===!0&&(n=!0),s.identifierPrefix!==void 0&&(c=s.identifierPrefix),s.onUncaughtError!==void 0&&(m=s.onUncaughtError),s.onCaughtError!==void 0&&(D=s.onCaughtError),s.onRecoverableError!==void 0&&(H=s.onRecoverableError),s.formState!==void 0&&(F=s.formState)),t=xm(e,1,!0,t,s??null,n,c,F,m,D,H,Lm),t.context=Cm(null),s=t.current,n=Ft(),n=Ho(n),c=Yi(n),c.callback=null,Wi(s,c,n),s=n,t.current.lanes=s,$r(t,s),pi(t),e[Gs]=t.current,Ac(e),new oo(t)},Ln.version="19.2.4",Ln}var qm;function E0(){if(qm)return Xc.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(),Xc.exports=w0(),Xc.exports}var k0=E0();const T0=I_(k0);/**
|
|
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 R0(i={}){function r(o,g){var u;let k=(u=g.state)==null?void 0:u.masked,{pathname:T,search:l,hash:h}=k||o.location;return hu("",{pathname:T,search:l,hash:h},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 D0(r,a,null,i)}function et(i,r){if(i===!1||i===null||typeof i>"u")throw new Error(r)}function gi(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 hu(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 D0(i,r,a,o={}){let{window:g=document.defaultView,v5Compat:k=!1}=o,T=g.history,l="POP",h=null,u=y();u==null&&(u=0,T.replaceState({...T.state,idx:u},""));function y(){return(T.state||{idx:null}).idx}function d(){l="POP";let _=y(),p=_==null?null:_-u;u=_,h&&h({action:l,location:S.location,delta:p})}function x(_,p){l="PUSH";let f=Km(_)?_:hu(S.location,_,p);u=y()+1;let v=Vm(f,u),b=S.createHref(f.unstable_mask||f);try{T.pushState(v,"",b)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;g.location.assign(b)}k&&h&&h({action:l,location:S.location,delta:1})}function E(_,p){l="REPLACE";let f=Km(_)?_:hu(S.location,_,p);u=y();let v=Vm(f,u),b=S.createHref(f.unstable_mask||f);T.replaceState(v,"",b),k&&h&&h({action:l,location:S.location,delta:0})}function M(_){return O0(_)}let S={get action(){return l},get location(){return i(g,T)},listen(_){if(h)throw new Error("A history only accepts one active listener");return g.addEventListener(Fm,d),h=_,()=>{g.removeEventListener(Fm,d),h=null}},createHref(_){return r(g,_)},createURL:M,encodeLocation(_){let p=M(_);return{pathname:p.pathname,search:p.search,hash:p.hash}},push:x,replace:E,go(_){return T.go(_)}};return S}function O0(i,r=!1){let a="http://localhost";typeof window<"u"&&(a=window.location.origin!=="null"?window.location.origin:window.location.href),et(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,r,a="/"){return M0(i,r,a,!1)}function M0(i,r,a,o){let g=typeof r=="string"?zr(r):r,k=Hi(g.pathname||"/",a);if(k==null)return null;let T=P_(i);L0(T);let l=null;for(let h=0;l==null&&h<T.length;++h){let u=q0(k);l=P0(T[h],u,o)}return l}function P_(i,r=[],a=[],o="",g=!1){let k=(T,l,h=g,u)=>{let y={relativePath:u===void 0?T.path||"":u,caseSensitive:T.caseSensitive===!0,childrenIndex:l,route:T};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(o)&&h)return;et(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=vi([o,y.relativePath]),x=a.concat(y);T.children&&T.children.length>0&&(et(T.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),P_(T.children,r,x,d,h)),!(T.path==null&&!T.index)&&r.push({path:d,score:I0(d,T.index),routesMeta:x})};return i.forEach((T,l)=>{var h;if(T.path===""||!((h=T.path)!=null&&h.includes("?")))k(T,l);else for(let u of Z_(T.path))k(T,l,!0,u)}),r}function Z_(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=Z_(o.join("/")),l=[];return l.push(...T.map(h=>h===""?k:[k,h].join("/"))),g&&l.push(...T),l.map(h=>i.startsWith("/")&&h===""?"/":h)}function L0(i){i.sort((r,a)=>r.score!==a.score?a.score-r.score:$0(r.routesMeta.map(o=>o.childrenIndex),a.routesMeta.map(o=>o.childrenIndex)))}var N0=/^:[\w-]+$/,j0=3,B0=2,z0=1,H0=10,U0=-2,Gm=i=>i==="*";function I0(i,r){let a=i.split("/"),o=a.length;return a.some(Gm)&&(o+=U0),r&&(o+=B0),a.filter(g=>!Gm(g)).reduce((g,k)=>g+(N0.test(k)?j0:k===""?z0:H0),o)}function $0(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 l=0;l<o.length;++l){let h=o[l],u=l===o.length-1,y=k==="/"?r:r.slice(k.length)||"/",d=go({path:h.relativePath,caseSensitive:h.caseSensitive,end:u},y),x=h.route;if(!d&&u&&a&&!o[o.length-1].route.index&&(d=go({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},y)),!d)return null;Object.assign(g,d.params),T.push({params:g,pathname:vi([k,d.pathname]),pathnameBase:G0(vi([k,d.pathnameBase])),route:x}),d.pathnameBase!=="/"&&(k=vi([k,d.pathnameBase]))}return T}function go(i,r){typeof i=="string"&&(i={path:i,caseSensitive:!1,end:!0});let[a,o]=Z0(i.path,i.caseSensitive,i.end),g=r.match(a);if(!g)return null;let k=g[0],T=k.replace(/(.)\/+$/,"$1"),l=g.slice(1);return{params:o.reduce((u,{paramName:y,isOptional:d},x)=>{if(y==="*"){let M=l[x]||"";T=k.slice(0,k.length-M.length).replace(/(.)\/+$/,"$1")}const E=l[x];return d&&!E?u[y]=void 0:u[y]=(E||"").replace(/%2F/g,"/"),u},{}),pathname:k,pathnameBase:T,pattern:i}}function Z0(i,r=!1,a=!0){gi(i==="*"||!i.endsWith("*")||i.endsWith("/*"),`Route path "${i}" will be treated as if it were "${i.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${i.replace(/\*$/,"/*")}".`);let o=[],g="^"+i.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(T,l,h,u,y)=>{if(o.push({paramName:l,isOptional:h!=null}),h){let d=y.charAt(u+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 q0(i){try{return i.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return gi(!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 Hi(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 F0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function K0(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:Y0(o),hash:W0(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 tu(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 V0(i){return i.filter((r,a)=>a===0||r.route.path&&r.route.path.length>0)}function q_(i){let r=V0(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},et(!g.pathname||!g.pathname.includes("?"),tu("?","pathname","search",g)),et(!g.pathname||!g.pathname.includes("#"),tu("#","pathname","hash",g)),et(!g.search||!g.search.includes("#"),tu("#","search","hash",g)));let k=i===""||g.pathname==="",T=k?"/":g.pathname,l;if(T==null)l=a;else{let d=r.length-1;if(!o&&T.startsWith("..")){let x=T.split("/");for(;x[0]==="..";)x.shift(),d-=1;g.pathname=x.join("/")}l=d>=0?r[d]:"/"}let h=K0(g,l),u=T&&T!=="/"&&T.endsWith("/"),y=(k||T===".")&&a.endsWith("/");return!h.pathname.endsWith("/")&&(u||y)&&(h.pathname+="/"),h}var vi=i=>i.join("/").replace(/\/\/+/g,"/"),G0=i=>i.replace(/\/+$/,"").replace(/^\/*/,"/"),Y0=i=>!i||i==="?"?"":i.startsWith("?")?i:"?"+i,W0=i=>!i||i==="#"?"":i.startsWith("#")?i:"#"+i,X0=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 J0(i){return i!=null&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.internal=="boolean"&&"data"in i}function Q0(i){return i.map(r=>r.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var F_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function K_(i,r){let a=i;if(typeof a!="string"||!F0.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let o=a,g=!1;if(F_)try{let k=new URL(window.location.href),T=a.startsWith("//")?new URL(k.protocol+a):new URL(a),l=Hi(T.pathname,r);T.origin===k.origin&&l!=null?a=l+T.search+T.hash:g=!0}catch{gi(!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 V_=["POST","PUT","PATCH","DELETE"];new Set(V_);var ey=["GET",...V_];new Set(ey);var Hr=P.createContext(null);Hr.displayName="DataRouter";var ko=P.createContext(null);ko.displayName="DataRouterState";var ty=P.createContext(!1),G_=P.createContext({isTransitioning:!1});G_.displayName="ViewTransition";var iy=P.createContext(new Map);iy.displayName="Fetchers";var sy=P.createContext(null);sy.displayName="Await";var si=P.createContext(null);si.displayName="Navigation";var Pn=P.createContext(null);Pn.displayName="Location";var fi=P.createContext({outlet:null,matches:[],isDataRoute:!1});fi.displayName="Route";var Cu=P.createContext(null);Cu.displayName="RouteError";var Y_="REACT_ROUTER_ERROR",ry="REDIRECT",ny="ROUTE_ERROR_RESPONSE";function ay(i){if(i.startsWith(`${Y_}:${ry}:{`))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 oy(i){if(i.startsWith(`${Y_}:${ny}:{`))try{let r=JSON.parse(i.slice(40));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string")return new X0(r.status,r.statusText,r.data)}catch{}}function ly(i,{relative:r}={}){et(Zn(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:o}=P.useContext(si),{hash:g,pathname:k,search:T}=qn(i,{relative:r}),l=k;return a!=="/"&&(l=k==="/"?a:vi([a,k])),o.createHref({pathname:l,search:T,hash:g})}function Zn(){return P.useContext(Pn)!=null}function ps(){return et(Zn(),"useLocation() may be used only in the context of a <Router> component."),P.useContext(Pn).location}var W_="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function X_(i){P.useContext(si).static||P.useLayoutEffect(i)}function To(){let{isDataRoute:i}=P.useContext(fi);return i?Cy():cy()}function cy(){et(Zn(),"useNavigate() may be used only in the context of a <Router> component.");let i=P.useContext(Hr),{basename:r,navigator:a}=P.useContext(si),{matches:o}=P.useContext(fi),{pathname:g}=ps(),k=JSON.stringify(q_(o)),T=P.useRef(!1);return X_(()=>{T.current=!0}),P.useCallback((h,u={})=>{if(gi(T.current,W_),!T.current)return;if(typeof h=="number"){a.go(h);return}let y=xu(h,JSON.parse(k),g,u.relative==="path");i==null&&r!=="/"&&(y.pathname=y.pathname==="/"?r:vi([r,y.pathname])),(u.replace?a.replace:a.push)(y,u.state,u)},[r,a,k,g,i])}var uy=P.createContext(null);function hy(i){let r=P.useContext(fi).outlet;return P.useMemo(()=>r&&P.createElement(uy.Provider,{value:i},r),[r,i])}function J_(){let{matches:i}=P.useContext(fi),r=i[i.length-1];return r?r.params:{}}function qn(i,{relative:r}={}){let{matches:a}=P.useContext(fi),{pathname:o}=ps(),g=JSON.stringify(q_(a));return P.useMemo(()=>xu(i,JSON.parse(g),o,r==="path"),[i,g,o,r])}function fy(i,r){return Q_(i,r)}function Q_(i,r,a){var _;et(Zn(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=P.useContext(si),{matches:g}=P.useContext(fi),k=g[g.length-1],T=k?k.params:{},l=k?k.pathname:"/",h=k?k.pathnameBase:"/",u=k&&k.route;{let p=u&&u.path||"";tp(l,!u||p.endsWith("*")||p.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${l}" (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=ps(),d;if(r){let p=typeof r=="string"?zr(r):r;et(h==="/"||((_=p.pathname)==null?void 0:_.startsWith(h)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${h}" but pathname "${p.pathname}" was given in the \`location\` prop.`),d=p}else d=y;let x=d.pathname||"/",E=x;if(h!=="/"){let p=h.replace(/^\//,"").split("/");E="/"+x.replace(/^\//,"").split("/").slice(p.length).join("/")}let M=$_(i,{pathname:E});gi(u||M!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),gi(M==null||M[M.length-1].route.element!==void 0||M[M.length-1].route.Component!==void 0||M[M.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 S=vy(M&&M.map(p=>Object.assign({},p,{params:Object.assign({},T,p.params),pathname:vi([h,o.encodeLocation?o.encodeLocation(p.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:p.pathname]),pathnameBase:p.pathnameBase==="/"?h:vi([h,o.encodeLocation?o.encodeLocation(p.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:p.pathnameBase])})),g,a);return r&&S?P.createElement(Pn.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...d},navigationType:"POP"}},S):S}function dy(){let i=xy(),r=J0(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 my=P.createElement(dy,null),ep=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=oy(i.digest);a&&(i=a)}let r=i!==void 0?P.createElement(fi.Provider,{value:this.props.routeContext},P.createElement(Cu.Provider,{value:i,children:this.props.component})):this.props.children;return this.context?P.createElement(_y,{error:i},r):r}};ep.contextType=ty;var iu=new WeakMap;function _y({children:i,error:r}){let{basename:a}=P.useContext(si);if(typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){let o=ay(r.digest);if(o){let g=iu.get(r);if(g)throw g;let k=K_(o.location,a);if(F_&&!iu.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 iu.set(r,T),T}return P.createElement("meta",{httpEquiv:"refresh",content:`0;url=${k.absoluteURL||k.to}`})}}return i}function py({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(fi.Provider,{value:i},a)}function vy(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);et(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,l=-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)&&(l=y),d.route.id){let{loaderData:x,errors:E}=o,M=d.route.loader&&!x.hasOwnProperty(d.route.id)&&(!E||E[d.route.id]===void 0);if(d.route.lazy||M){a.isStatic&&(T=!0),l>=0?g=g.slice(0,l+1):g=[g[0]];break}}}}let h=a==null?void 0:a.onError,u=o&&h?(y,d)=>{var x,E;h(y,{location:o.location,params:((E=(x=o.matches)==null?void 0:x[0])==null?void 0:E.params)??{},unstable_pattern:Q0(o.matches),errorInfo:d})}:void 0;return g.reduceRight((y,d,x)=>{let E,M=!1,S=null,_=null;o&&(E=k&&d.route.id?k[d.route.id]:void 0,S=d.route.errorElement||my,T&&(l<0&&x===0?(tp("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),M=!0,_=null):l===x&&(M=!0,_=d.route.hydrateFallbackElement||null)));let p=r.concat(g.slice(0,x+1)),f=()=>{let v;return E?v=S:M?v=_:d.route.Component?v=P.createElement(d.route.Component,null):d.route.element?v=d.route.element:v=y,P.createElement(py,{match:d,routeContext:{outlet:y,matches:p,isDataRoute:o!=null},children:v})};return o&&(d.route.ErrorBoundary||d.route.errorElement||x===0)?P.createElement(ep,{location:o.location,revalidation:o.revalidation,component:S,error:E,children:f(),routeContext:{outlet:null,matches:p,isDataRoute:!0},onError:u}):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 gy(i){let r=P.useContext(Hr);return et(r,wu(i)),r}function yy(i){let r=P.useContext(ko);return et(r,wu(i)),r}function by(i){let r=P.useContext(fi);return et(r,wu(i)),r}function Eu(i){let r=by(i),a=r.matches[r.matches.length-1];return et(a.route.id,`${i} can only be used on routes that contain a unique "id"`),a.route.id}function Sy(){return Eu("useRouteId")}function xy(){var o;let i=P.useContext(Cu),r=yy("useRouteError"),a=Eu("useRouteError");return i!==void 0?i:(o=r.errors)==null?void 0:o[a]}function Cy(){let{router:i}=gy("useNavigate"),r=Eu("useNavigate"),a=P.useRef(!1);return X_(()=>{a.current=!0}),P.useCallback(async(g,k={})=>{gi(a.current,W_),a.current&&(typeof g=="number"?await i.navigate(g):await i.navigate(g,{fromRouteId:r,...k}))},[i,r])}var Wm={};function tp(i,r,a){!r&&!Wm[i]&&(Wm[i]=!0,gi(!1,a))}P.memo(wy);function wy({routes:i,future:r,state:a,isStatic:o,onError:g}){return Q_(i,void 0,{state:a,isStatic:o,onError:g})}function Ey(i){return hy(i.context)}function fs(i){et(!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 ky({basename:i="/",children:r=null,location:a,navigationType:o="POP",navigator:g,static:k=!1,unstable_useTransitions:T}){et(!Zn(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=i.replace(/^\/*/,"/"),h=P.useMemo(()=>({basename:l,navigator:g,static:k,unstable_useTransitions:T,future:{}}),[l,g,k,T]);typeof a=="string"&&(a=zr(a));let{pathname:u="/",search:y="",hash:d="",state:x=null,key:E="default",unstable_mask:M}=a,S=P.useMemo(()=>{let _=Hi(u,l);return _==null?null:{location:{pathname:_,search:y,hash:d,state:x,key:E,unstable_mask:M},navigationType:o}},[l,u,y,d,x,E,o,M]);return gi(S!=null,`<Router basename="${l}"> is not able to match the URL "${u}${y}${d}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:P.createElement(si.Provider,{value:h},P.createElement(Pn.Provider,{children:r,value:S}))}function Ty({children:i,location:r}){return fy(fu(i),r)}function fu(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,fu(o.props.children,k));return}et(o.type===fs,`[${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>`),et(!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=fu(o.props.children,k)),a.push(T)}),a}var po="get",vo="application/x-www-form-urlencoded";function Ro(i){return typeof HTMLElement<"u"&&i instanceof HTMLElement}function Ry(i){return Ro(i)&&i.tagName.toLowerCase()==="button"}function Ay(i){return Ro(i)&&i.tagName.toLowerCase()==="form"}function Dy(i){return Ro(i)&&i.tagName.toLowerCase()==="input"}function Oy(i){return!!(i.metaKey||i.altKey||i.ctrlKey||i.shiftKey)}function My(i,r){return i.button===0&&(!r||r==="_self")&&!Oy(i)}var co=null;function Ly(){if(co===null)try{new FormData(document.createElement("form"),0),co=!1}catch{co=!0}return co}var Ny=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function su(i){return i!=null&&!Ny.has(i)?(gi(!1,`"${i}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${vo}"`),null):i}function jy(i,r){let a,o,g,k,T;if(Ay(i)){let l=i.getAttribute("action");o=l?Hi(l,r):null,a=i.getAttribute("method")||po,g=su(i.getAttribute("enctype"))||vo,k=new FormData(i)}else if(Ry(i)||Dy(i)&&(i.type==="submit"||i.type==="image")){let l=i.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=i.getAttribute("formaction")||l.getAttribute("action");if(o=h?Hi(h,r):null,a=i.getAttribute("formmethod")||l.getAttribute("method")||po,g=su(i.getAttribute("formenctype"))||su(l.getAttribute("enctype"))||vo,k=new FormData(l,i),!Ly()){let{name:u,type:y,value:d}=i;if(y==="image"){let x=u?`${u}.`:"";k.append(`${x}x`,"0"),k.append(`${x}y`,"0")}else u&&k.append(u,d)}}else{if(Ro(i))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=po,o=null,g=vo,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 By(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&&Hi(g.pathname,r)==="/"?g.pathname=`${r.replace(/\/$/,"")}/_root.${o}`:g.pathname=`${g.pathname.replace(/\/$/,"")}.${o}`,g}async function zy(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 Hy(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 Uy(i,r,a){let o=await Promise.all(i.map(async g=>{let k=r.routes[g.route.id];if(k){let T=await zy(k,a);return T.links?T.links():[]}return[]}));return Zy(o.flat(1).filter(Hy).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=(h,u)=>a[u]?h.route.id!==a[u].route.id:!0,l=(h,u)=>{var y;return a[u].pathname!==h.pathname||((y=a[u].route.path)==null?void 0:y.endsWith("*"))&&a[u].params["*"]!==h.params["*"]};return k==="assets"?r.filter((h,u)=>T(h,u)||l(h,u)):k==="data"?r.filter((h,u)=>{var d;let y=o.routes[h.route.id];if(!y||!y.hasLoader)return!1;if(T(h,u)||l(h,u))return!0;if(h.route.shouldRevalidate){let x=h.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:h.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function Iy(i,r,{includeHydrateFallback:a}={}){return $y(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 $y(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 Zy(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 ip(){let i=P.useContext(Hr);return ku(i,"You must render this element inside a <DataRouterContext.Provider> element"),i}function qy(){let i=P.useContext(ko);return ku(i,"You must render this element inside a <DataRouterStateContext.Provider> element"),i}var Tu=P.createContext(void 0);Tu.displayName="FrameworkContext";function sp(){let i=P.useContext(Tu);return ku(i,"You must render this element inside a <HydratedRouter> element"),i}function Fy(i,r){let a=P.useContext(Tu),[o,g]=P.useState(!1),[k,T]=P.useState(!1),{onFocus:l,onBlur:h,onMouseEnter:u,onMouseLeave:y,onTouchStart:d}=r,x=P.useRef(null);P.useEffect(()=>{if(i==="render"&&T(!0),i==="viewport"){let S=p=>{p.forEach(f=>{T(f.isIntersecting)})},_=new IntersectionObserver(S,{threshold:.5});return x.current&&_.observe(x.current),()=>{_.disconnect()}}},[i]),P.useEffect(()=>{if(o){let S=setTimeout(()=>{T(!0)},100);return()=>{clearTimeout(S)}}},[o]);let E=()=>{g(!0)},M=()=>{g(!1),T(!1)};return a?i!=="intent"?[k,x,{}]:[k,x,{onFocus:Nn(l,E),onBlur:Nn(h,M),onMouseEnter:Nn(u,E),onMouseLeave:Nn(y,M),onTouchStart:Nn(d,E)}]:[!1,x,{}]}function Nn(i,r){return a=>{i&&i(a),a.defaultPrevented||r(a)}}function Ky({page:i,...r}){let{router:a}=ip(),o=P.useMemo(()=>$_(a.routes,i,a.basename),[a.routes,i,a.basename]);return o?P.createElement(Gy,{page:i,matches:o,...r}):null}function Vy(i){let{manifest:r,routeModules:a}=sp(),[o,g]=P.useState([]);return P.useEffect(()=>{let k=!1;return Uy(i,r,a).then(T=>{k||g(T)}),()=>{k=!0}},[i,r,a]),o}function Gy({page:i,matches:r,...a}){let o=ps(),{future:g,manifest:k,routeModules:T}=sp(),{basename:l}=ip(),{loaderData:h,matches:u}=qy(),y=P.useMemo(()=>Xm(i,r,u,k,o,"data"),[i,r,u,k,o]),d=P.useMemo(()=>Xm(i,r,u,k,o,"assets"),[i,r,u,k,o]),x=P.useMemo(()=>{if(i===o.pathname+o.search+o.hash)return[];let S=new Set,_=!1;if(r.forEach(f=>{var b;let v=k.routes[f.route.id];!v||!v.hasLoader||(!y.some(R=>R.route.id===f.route.id)&&f.route.id in h&&((b=T[f.route.id])!=null&&b.shouldRevalidate)||v.hasClientLoader?_=!0:S.add(f.route.id))}),S.size===0)return[];let p=By(i,l,g.unstable_trailingSlashAwareDataRequests,"data");return _&&S.size>0&&p.searchParams.set("_routes",r.filter(f=>S.has(f.route.id)).map(f=>f.route.id).join(",")),[p.pathname+p.search]},[l,g.unstable_trailingSlashAwareDataRequests,h,o,k,y,r,i,T]),E=P.useMemo(()=>Iy(d,k),[d,k]),M=Vy(d);return P.createElement(P.Fragment,null,x.map(S=>P.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...a})),E.map(S=>P.createElement("link",{key:S,rel:"modulepreload",href:S,...a})),M.map(({key:S,link:_})=>P.createElement("link",{key:S,nonce:a.nonce,..._,crossOrigin:_.crossOrigin??a.crossOrigin})))}function Yy(...i){return r=>{i.forEach(a=>{typeof a=="function"?a(r):a!=null&&(a.current=r)})}}var Wy=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Wy&&(window.__reactRouterVersion="7.13.2")}catch{}function Xy({basename:i,children:r,unstable_useTransitions:a,window:o}){let g=P.useRef();g.current==null&&(g.current=R0({window:o,v5Compat:!0}));let k=g.current,[T,l]=P.useState({action:k.action,location:k.location}),h=P.useCallback(u=>{a===!1?l(u):P.startTransition(()=>l(u))},[a]);return P.useLayoutEffect(()=>k.listen(h),[k,h]),P.createElement(ky,{basename:i,children:r,location:T.location,navigationType:T.action,navigator:k,unstable_useTransitions:a})}var rp=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,hi=P.forwardRef(function({onClick:r,discover:a="render",prefetch:o="none",relative:g,reloadDocument:k,replace:T,unstable_mask:l,state:h,target:u,to:y,preventScrollReset:d,viewTransition:x,unstable_defaultShouldRevalidate:E,...M},S){let{basename:_,navigator:p,unstable_useTransitions:f}=P.useContext(si),v=typeof y=="string"&&rp.test(y),b=K_(y,_);y=b.to;let R=ly(y,{relative:g}),A=ps(),O=null;if(l){let re=xu(l,[],A.unstable_mask?A.unstable_mask.pathname:"/",!0);_!=="/"&&(re.pathname=re.pathname==="/"?_:vi([_,re.pathname])),O=p.createHref(re)}let[w,j,I]=Fy(o,M),Z=e1(y,{replace:T,unstable_mask:l,state:h,target:u,preventScrollReset:d,relative:g,viewTransition:x,unstable_defaultShouldRevalidate:E,unstable_useTransitions:f});function K(re){r&&r(re),re.defaultPrevented||Z(re)}let $=!(b.isExternal||k),X=P.createElement("a",{...M,...I,href:($?O:void 0)||b.absoluteURL||R,onClick:$?K:r,ref:Yy(S,j),target:u,"data-discover":!v&&a==="render"?"true":void 0});return w&&!v?P.createElement(P.Fragment,null,X,P.createElement(Ky,{page:R})):X});hi.displayName="Link";var np=P.forwardRef(function({"aria-current":r="page",caseSensitive:a=!1,className:o="",end:g=!1,style:k,to:T,viewTransition:l,children:h,...u},y){let d=qn(T,{relative:u.relative}),x=ps(),E=P.useContext(ko),{navigator:M,basename:S}=P.useContext(si),_=E!=null&&n1(d)&&l===!0,p=M.encodeLocation?M.encodeLocation(d).pathname:d.pathname,f=x.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&&S&&(v=Hi(v,S)||v);const b=p!=="/"&&p.endsWith("/")?p.length-1:p.length;let R=f===p||!g&&f.startsWith(p)&&f.charAt(b)==="/",A=v!=null&&(v===p||!g&&v.startsWith(p)&&v.charAt(p.length)==="/"),O={isActive:R,isPending:A,isTransitioning:_},w=R?r:void 0,j;typeof o=="function"?j=o(O):j=[o,R?"active":null,A?"pending":null,_?"transitioning":null].filter(Boolean).join(" ");let I=typeof k=="function"?k(O):k;return P.createElement(hi,{...u,"aria-current":w,className:j,ref:y,style:I,to:T,viewTransition:l},typeof h=="function"?h(O):h)});np.displayName="NavLink";var Jy=P.forwardRef(({discover:i="render",fetcherKey:r,navigate:a,reloadDocument:o,replace:g,state:k,method:T=po,action:l,onSubmit:h,relative:u,preventScrollReset:y,viewTransition:d,unstable_defaultShouldRevalidate:x,...E},M)=>{let{unstable_useTransitions:S}=P.useContext(si),_=s1(),p=r1(l,{relative:u}),f=T.toLowerCase()==="get"?"get":"post",v=typeof l=="string"&&rp.test(l),b=R=>{if(h&&h(R),R.defaultPrevented)return;R.preventDefault();let A=R.nativeEvent.submitter,O=(A==null?void 0:A.getAttribute("formmethod"))||T,w=()=>_(A||R.currentTarget,{fetcherKey:r,method:O,navigate:a,replace:g,state:k,relative:u,preventScrollReset:y,viewTransition:d,unstable_defaultShouldRevalidate:x});S&&a!==!1?P.startTransition(()=>w()):w()};return P.createElement("form",{ref:M,method:f,action:p,onSubmit:o?h:b,...E,"data-discover":!v&&i==="render"?"true":void 0})});Jy.displayName="Form";function Qy(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ap(i){let r=P.useContext(Hr);return et(r,Qy(i)),r}function e1(i,{target:r,replace:a,unstable_mask:o,state:g,preventScrollReset:k,relative:T,viewTransition:l,unstable_defaultShouldRevalidate:h,unstable_useTransitions:u}={}){let y=To(),d=ps(),x=qn(i,{relative:T});return P.useCallback(E=>{if(My(E,r)){E.preventDefault();let M=a!==void 0?a:In(d)===In(x),S=()=>y(i,{replace:M,unstable_mask:o,state:g,preventScrollReset:k,relative:T,viewTransition:l,unstable_defaultShouldRevalidate:h});u?P.startTransition(()=>S()):S()}},[d,y,x,a,o,g,r,i,k,T,l,h,u])}var t1=0,i1=()=>`__${String(++t1)}__`;function s1(){let{router:i}=ap("useSubmit"),{basename:r}=P.useContext(si),a=Sy(),o=i.fetch,g=i.navigate;return P.useCallback(async(k,T={})=>{let{action:l,method:h,encType:u,formData:y,body:d}=jy(k,r);if(T.navigate===!1){let x=T.fetcherKey||i1();await o(x,a,T.action||l,{unstable_defaultShouldRevalidate:T.unstable_defaultShouldRevalidate,preventScrollReset:T.preventScrollReset,formData:y,body:d,formMethod:T.method||h,formEncType:T.encType||u,flushSync:T.flushSync})}else await g(T.action||l,{unstable_defaultShouldRevalidate:T.unstable_defaultShouldRevalidate,preventScrollReset:T.preventScrollReset,formData:y,body:d,formMethod:T.method||h,formEncType:T.encType||u,replace:T.replace,state:T.state,fromRouteId:a,flushSync:T.flushSync,viewTransition:T.viewTransition})},[o,g,r,a])}function r1(i,{relative:r}={}){let{basename:a}=P.useContext(si),o=P.useContext(fi);et(o,"useFormAction must be used inside a RouteContext");let[g]=o.matches.slice(-1),k={...qn(i||".",{relative:r})},T=ps();if(i==null){k.search=T.search;let l=new URLSearchParams(k.search),h=l.getAll("index");if(h.some(y=>y==="")){l.delete("index"),h.filter(d=>d).forEach(d=>l.append("index",d));let y=l.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:vi([a,k.pathname])),In(k)}function n1(i,{relative:r}={}){let a=P.useContext(G_);et(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=ap("useViewTransitionState"),g=qn(i,{relative:r});if(!a.isTransitioning)return!1;let k=Hi(a.currentLocation.pathname,o)||a.currentLocation.pathname,T=Hi(a.nextLocation.pathname,o)||a.nextLocation.pathname;return go(g.pathname,T)!=null||go(g.pathname,k)!=null}class a1 extends P.Component{constructor(){super(...arguments);dt(this,"state",{hasError:!1,error:null});dt(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?C.jsxs("div",{className:"min-h-screen bg-[#0a0a0f] flex flex-col items-center justify-center text-center px-4",children:[C.jsx("div",{className:"text-6xl mb-4",children:"⚠"}),C.jsx("h1",{className:"text-lg text-[#e0e0e0] mb-2",children:"Something went wrong"}),C.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."}),C.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 o1=i=>i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),op=(...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 l1={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 c1=P.forwardRef(({color:i="currentColor",size:r=24,strokeWidth:a=2,absoluteStrokeWidth:o,className:g="",children:k,iconNode:T,...l},h)=>P.createElement("svg",{ref:h,...l1,width:r,height:r,stroke:i,strokeWidth:o?Number(a)*24/Number(r):a,className:op("lucide",g),...l},[...T.map(([u,y])=>P.createElement(u,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(c1,{ref:k,iconNode:r,className:op(`lucide-${o1(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 u1=[["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"}]],lp=Ne("Activity",u1);/**
|
|
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 h1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]],cp=Ne("Ban",h1);/**
|
|
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 f1=[["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"}]],d1=Ne("Camera",f1);/**
|
|
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 m1=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],_1=Ne("ChevronLeft",m1);/**
|
|
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 p1=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],v1=Ne("ChevronRight",p1);/**
|
|
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 g1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],up=Ne("CircleCheck",g1);/**
|
|
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 y1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],b1=Ne("CirclePlus",y1);/**
|
|
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 S1=[["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"}]],yo=Ne("CircleX",S1);/**
|
|
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 x1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],Hn=Ne("Clock",x1);/**
|
|
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 C1=[["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"}]],w1=Ne("Copy",C1);/**
|
|
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 E1=[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]],k1=Ne("CornerDownLeft",E1);/**
|
|
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 T1=[["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"}]],R1=Ne("EyeOff",T1);/**
|
|
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 A1=[["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"}]],D1=Ne("Eye",A1);/**
|
|
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 O1=[["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"}]],du=Ne("KeyRound",O1);/**
|
|
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 M1=[["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"}]],L1=Ne("Layers",M1);/**
|
|
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 N1=[["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"}]],j1=Ne("LayoutDashboard",N1);/**
|
|
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 B1=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],mu=Ne("LoaderCircle",B1);/**
|
|
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 z1=[["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"}]],H1=Ne("MessageSquare",z1);/**
|
|
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 U1=[["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"}]],I1=Ne("Octagon",U1);/**
|
|
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 $1=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],hp=Ne("Play",$1);/**
|
|
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 P1=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Fn=Ne("Plus",P1);/**
|
|
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 Z1=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],q1=Ne("Power",Z1);/**
|
|
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 F1=[["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"}]],fp=Ne("RefreshCw",F1);/**
|
|
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 K1=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],V1=Ne("Search",K1);/**
|
|
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 G1=[["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"}]],Y1=Ne("Send",G1);/**
|
|
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 W1=[["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"}]],X1=Ne("ShieldAlert",W1);/**
|
|
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 J1=[["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"}]],Q1=Ne("Shield",J1);/**
|
|
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 eb=[["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"}]],tb=Ne("Skull",eb);/**
|
|
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 ib=[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]],sb=Ne("Terminal",ib);/**
|
|
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 rb=[["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"}]],Ru=Ne("Trash2",rb);/**
|
|
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 nb=[["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"}]],dp=Ne("TriangleAlert",nb);/**
|
|
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 ab=[["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"}]],ob=Ne("UserCheck",ab);/**
|
|
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 lb=[["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"}]],cb=Ne("Users",lb);/**
|
|
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 ub=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ao=Ne("X",ub);/**
|
|
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 hb=[["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"}]],fb=Ne("Zap",hb),Jm=i=>{let r;const a=new Set,o=(u,y)=>{const d=typeof u=="function"?u(r):u;if(!Object.is(d,r)){const x=r;r=y??(typeof d!="object"||d===null)?d:Object.assign({},r,d),a.forEach(E=>E(r,x))}},g=()=>r,l={setState:o,getState:g,getInitialState:()=>h,subscribe:u=>(a.add(u),()=>a.delete(u))},h=r=i(o,g,l);return l},db=(i=>i?Jm(i):Jm),mb=i=>i;function _b(i,r=mb){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 Qm=i=>{const r=db(i),a=o=>_b(r,o);return Object.assign(a,r),a},mp=(i=>i?Qm(i):Qm),lt=mp(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 ue(i,r,a){function o(l,h){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:h,constr:T,traits:new Set},enumerable:!1}),l._zod.traits.has(i))return;l._zod.traits.add(i),r(l,h);const u=T.prototype,y=Object.keys(u);for(let d=0;d<y.length;d++){const x=y[d];x in l||(l[x]=u[x].bind(l))}}const g=(a==null?void 0:a.Parent)??Object;class k extends g{}Object.defineProperty(k,"name",{value:i});function T(l){var h;const u=a!=null&&a.Parent?new k:this;o(u,l),(h=u._zod).deferred??(h.deferred=[]);for(const y of u._zod.deferred)y();return u}return Object.defineProperty(T,"init",{value:o}),Object.defineProperty(T,Symbol.hasInstance,{value:l=>{var h,u;return a!=null&&a.Parent&&l instanceof a.Parent?!0:(u=(h=l==null?void 0:l._zod)==null?void 0:h.traits)==null?void 0:u.has(i)}}),Object.defineProperty(T,"name",{value:i}),T}class Nr extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class _p extends Error{constructor(r){super(`Encountered unidirectional transform during encode: ${r}`),this.name="ZodEncodeError"}}const pp={};function ms(i){return pp}function vp(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 Au(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 pb(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 h=o.match(/\d?e-(\d?)/);h!=null&&h[1]&&(g=Number.parseInt(h[1]))}const k=a>g?a:g,T=Number.parseInt(i.toFixed(k).replace(".","")),l=Number.parseInt(r.toFixed(k).replace(".",""));return T%l/10**k}const e_=Symbol("evaluating");function $e(i,r,a){let o;Object.defineProperty(i,r,{get(){if(o!==e_)return o===void 0&&(o=e_,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 vs(...i){const r={};for(const a of i){const o=Object.getOwnPropertyDescriptors(a);Object.assign(r,o)}return Object.defineProperties({},r)}function t_(i){return JSON.stringify(i)}function vb(i){return i.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const gp="captureStackTrace"in Error?Error.captureStackTrace:(...i)=>{};function bo(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}const gb=Au(()=>{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(bo(i)===!1)return!1;const r=i.constructor;if(r===void 0||typeof r!="function")return!0;const a=r.prototype;return!(bo(a)===!1||Object.prototype.hasOwnProperty.call(a,"isPrototypeOf")===!1)}function yp(i){return jr(i)?{...i}:Array.isArray(i)?[...i]:i}const yb=new Set(["string","number","symbol"]);function Do(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function gs(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 bb(i){return Object.keys(i).filter(r=>i[r]._zod.optin==="optional"&&i[r]._zod.optout==="optional")}const Sb={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 xb(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=vs(i._zod.def,{get shape(){const T={};for(const l in r){if(!(l in a.shape))throw new Error(`Unrecognized key: "${l}"`);r[l]&&(T[l]=a.shape[l])}return qs(this,"shape",T),T},checks:[]});return gs(i,k)}function Cb(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=vs(i._zod.def,{get shape(){const T={...i._zod.def.shape};for(const l in r){if(!(l in a.shape))throw new Error(`Unrecognized key: "${l}"`);r[l]&&delete T[l]}return qs(this,"shape",T),T},checks:[]});return gs(i,k)}function wb(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=vs(i._zod.def,{get shape(){const k={...i._zod.def.shape,...r};return qs(this,"shape",k),k}});return gs(i,g)}function Eb(i,r){if(!jr(r))throw new Error("Invalid input to safeExtend: expected a plain object");const a=vs(i._zod.def,{get shape(){const o={...i._zod.def.shape,...r};return qs(this,"shape",o),o}});return gs(i,a)}function kb(i,r){const a=vs(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 gs(i,a)}function Tb(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=vs(r._zod.def,{get shape(){const l=r._zod.def.shape,h={...l};if(a)for(const u in a){if(!(u in l))throw new Error(`Unrecognized key: "${u}"`);a[u]&&(h[u]=i?new i({type:"optional",innerType:l[u]}):l[u])}else for(const u in l)h[u]=i?new i({type:"optional",innerType:l[u]}):l[u];return qs(this,"shape",h),h},checks:[]});return gs(r,T)}function Rb(i,r,a){const o=vs(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 gs(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 uo(i){return typeof i=="string"?i:i==null?void 0:i.message}function _s(i,r,a){var g,k,T,l,h,u;const o={...i,path:i.path??[]};if(!i.message){const y=uo((T=(k=(g=i.inst)==null?void 0:g._zod.def)==null?void 0:k.error)==null?void 0:T.call(k,i))??uo((l=r==null?void 0:r.error)==null?void 0:l.call(r,i))??uo((h=a.customError)==null?void 0:h.call(a,i))??uo((u=a.localeError)==null?void 0:u.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 $n(...i){const[r,a,o]=i;return typeof r=="string"?{message:r,code:"custom",input:a,inst:o}:{...r}}const bp=(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})},Sp=ue("$ZodError",bp),xp=ue("$ZodError",bp,{Parent:Error});function Ab(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 Db(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,l=0;for(;l<k.path.length;){const h=k.path[l];l===k.path.length-1?(T[h]=T[h]||{_errors:[]},T[h]._errors.push(r(k))):T[h]=T[h]||{_errors:[]},T=T[h],l++}}};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 l=new((g==null?void 0:g.Err)??i)(T.issues.map(h=>_s(h,k,ms())));throw gp(l,g==null?void 0:g.callee),l}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 l=new((g==null?void 0:g.Err)??i)(T.issues.map(h=>_s(h,k,ms())));throw gp(l,g==null?void 0:g.callee),l}return T.value},Oo=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??Sp)(k.issues.map(T=>_s(T,g,ms())))}:{success:!0,data:k.value}},Ob=Oo(xp),Mo=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=>_s(T,g,ms())))}:{success:!0,data:k.value}},Mb=Mo(xp),Lb=i=>(r,a,o)=>{const g=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Lu(i)(r,a,g)},Nb=i=>(r,a,o)=>Lu(i)(r,a,o),jb=i=>async(r,a,o)=>{const g=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Nu(i)(r,a,g)},Bb=i=>async(r,a,o)=>Nu(i)(r,a,o),zb=i=>(r,a,o)=>{const g=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Oo(i)(r,a,g)},Hb=i=>(r,a,o)=>Oo(i)(r,a,o),Ub=i=>async(r,a,o)=>{const g=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return Mo(i)(r,a,g)},Ib=i=>async(r,a,o)=>Mo(i)(r,a,o),$b=/^[cC][^\s-]{8,}$/,Pb=/^[0-9a-z]+$/,Zb=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,qb=/^[0-9a-vA-V]{20}$/,Fb=/^[A-Za-z0-9]{27}$/,Kb=/^[a-zA-Z0-9_-]{21}$/,Vb=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Gb=/^([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})$/,i_=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)$/,Yb=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Wb="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Xb(){return new RegExp(Wb,"u")}const Jb=/^(?:(?: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])$/,Qb=/^(([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}|:))$/,eS=/^((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])$/,tS=/^(([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])$/,iS=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Cp=/^[A-Za-z0-9_-]*$/,sS=/^\+[1-9]\d{6,14}$/,wp="(?:(?:\\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])))",rS=new RegExp(`^${wp}$`);function Ep(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 nS(i){return new RegExp(`^${Ep(i)}$`)}function aS(i){const r=Ep({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(`^${wp}T(?:${o})$`)}const oS=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}$`)},lS=/^-?\d+$/,kp=/^-?\d+(?:\.\d+)?$/,cS=/^(?:true|false)$/i,uS=/^[^A-Z]*$/,hS=/^[^a-z]*$/,jt=ue("$ZodCheck",(i,r)=>{var a;i._zod??(i._zod={}),i._zod.def=r,(a=i._zod).onattach??(a.onattach=[])}),Tp={number:"number",bigint:"bigint",object:"date"},Rp=ue("$ZodCheckLessThan",(i,r)=>{jt.init(i,r);const a=Tp[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=ue("$ZodCheckGreaterThan",(i,r)=>{jt.init(i,r);const a=Tp[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})}}),fS=ue("$ZodCheckMultipleOf",(i,r)=>{jt.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):pb(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})}}),dS=ue("$ZodCheckNumberFormat",(i,r)=>{var T;jt.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]=Sb[r.format];i._zod.onattach.push(l=>{const h=l._zod.bag;h.format=r.format,h.minimum=g,h.maximum=k,a&&(h.pattern=lS)}),i._zod.check=l=>{const h=l.value;if(a){if(!Number.isInteger(h)){l.issues.push({expected:o,format:r.format,code:"invalid_type",continue:!1,input:h,inst:i});return}if(!Number.isSafeInteger(h)){h>0?l.issues.push({input:h,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:i,origin:o,inclusive:!0,continue:!r.abort}):l.issues.push({input:h,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:i,origin:o,inclusive:!0,continue:!r.abort});return}}h<g&&l.issues.push({origin:"number",input:h,code:"too_small",minimum:g,inclusive:!0,inst:i,continue:!r.abort}),h>k&&l.issues.push({origin:"number",input:h,code:"too_big",maximum:k,inclusive:!0,inst:i,continue:!r.abort})}}),mS=ue("$ZodCheckMaxLength",(i,r)=>{var a;jt.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})}}),_S=ue("$ZodCheckMinLength",(i,r)=>{var a;jt.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})}}),pS=ue("$ZodCheckLengthEquals",(i,r)=>{var a;jt.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),l=k>r.length;o.issues.push({origin:T,...l?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length},inclusive:!0,exact:!0,input:o.value,inst:i,continue:!r.abort})}}),Lo=ue("$ZodCheckStringFormat",(i,r)=>{var a,o;jt.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=()=>{})}),vS=ue("$ZodCheckRegex",(i,r)=>{Lo.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})}}),gS=ue("$ZodCheckLowerCase",(i,r)=>{r.pattern??(r.pattern=uS),Lo.init(i,r)}),yS=ue("$ZodCheckUpperCase",(i,r)=>{r.pattern??(r.pattern=hS),Lo.init(i,r)}),bS=ue("$ZodCheckIncludes",(i,r)=>{jt.init(i,r);const a=Do(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})}}),SS=ue("$ZodCheckStartsWith",(i,r)=>{jt.init(i,r);const a=new RegExp(`^${Do(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})}}),xS=ue("$ZodCheckEndsWith",(i,r)=>{jt.init(i,r);const a=new RegExp(`.*${Do(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})}}),CS=ue("$ZodCheckOverwrite",(i,r)=>{jt.init(i,r),i._zod.check=a=>{a.value=r.tx(a.value)}});class wS{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 ES={major:4,minor:3,patch:6},rt=ue("$ZodType",(i,r)=>{var g;var a;i??(i={}),i._zod.def=r,i._zod.bag=i._zod.bag||{},i._zod.version=ES;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=(l,h,u)=>{let y=Mr(l),d;for(const x of h){if(x._zod.def.when){if(!x._zod.def.when(l))continue}else if(y)continue;const E=l.issues.length,M=x._zod.check(l);if(M instanceof Promise&&(u==null?void 0:u.async)===!1)throw new Nr;if(d||M instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await M,l.issues.length!==E&&(y||(y=Mr(l,E)))});else{if(l.issues.length===E)continue;y||(y=Mr(l,E))}}return d?d.then(()=>l):l},T=(l,h,u)=>{if(Mr(l))return l.aborted=!0,l;const y=k(h,o,u);if(y instanceof Promise){if(u.async===!1)throw new Nr;return y.then(d=>i._zod.parse(d,u))}return i._zod.parse(y,u)};i._zod.run=(l,h)=>{if(h.skipChecks)return i._zod.parse(l,h);if(h.direction==="backward"){const y=i._zod.parse({value:l.value,issues:[]},{...h,skipChecks:!0});return y instanceof Promise?y.then(d=>T(d,l,h)):T(y,l,h)}const u=i._zod.parse(l,h);if(u instanceof Promise){if(h.async===!1)throw new Nr;return u.then(y=>k(y,o,h))}return k(u,o,h)}}$e(i,"~standard",()=>({validate:k=>{var T;try{const l=Ob(i,k);return l.success?{value:l.data}:{issues:(T=l.error)==null?void 0:T.issues}}catch{return Mb(i,k).then(h=>{var u;return h.success?{value:h.data}:{issues:(u=h.error)==null?void 0:u.issues}})}},vendor:"zod",version:1}))}),ju=ue("$ZodString",(i,r)=>{var a;rt.init(i,r),i._zod.pattern=[...((a=i==null?void 0:i._zod.bag)==null?void 0:a.patterns)??[]].pop()??oS(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=ue("$ZodStringFormat",(i,r)=>{Lo.init(i,r),ju.init(i,r)}),kS=ue("$ZodGUID",(i,r)=>{r.pattern??(r.pattern=Gb),Qe.init(i,r)}),TS=ue("$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=i_(o))}else r.pattern??(r.pattern=i_());Qe.init(i,r)}),RS=ue("$ZodEmail",(i,r)=>{r.pattern??(r.pattern=Yb),Qe.init(i,r)}),AS=ue("$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})}}}),DS=ue("$ZodEmoji",(i,r)=>{r.pattern??(r.pattern=Xb()),Qe.init(i,r)}),OS=ue("$ZodNanoID",(i,r)=>{r.pattern??(r.pattern=Kb),Qe.init(i,r)}),MS=ue("$ZodCUID",(i,r)=>{r.pattern??(r.pattern=$b),Qe.init(i,r)}),LS=ue("$ZodCUID2",(i,r)=>{r.pattern??(r.pattern=Pb),Qe.init(i,r)}),NS=ue("$ZodULID",(i,r)=>{r.pattern??(r.pattern=Zb),Qe.init(i,r)}),jS=ue("$ZodXID",(i,r)=>{r.pattern??(r.pattern=qb),Qe.init(i,r)}),BS=ue("$ZodKSUID",(i,r)=>{r.pattern??(r.pattern=Fb),Qe.init(i,r)}),zS=ue("$ZodISODateTime",(i,r)=>{r.pattern??(r.pattern=aS(r)),Qe.init(i,r)}),HS=ue("$ZodISODate",(i,r)=>{r.pattern??(r.pattern=rS),Qe.init(i,r)}),US=ue("$ZodISOTime",(i,r)=>{r.pattern??(r.pattern=nS(r)),Qe.init(i,r)}),IS=ue("$ZodISODuration",(i,r)=>{r.pattern??(r.pattern=Vb),Qe.init(i,r)}),$S=ue("$ZodIPv4",(i,r)=>{r.pattern??(r.pattern=Jb),Qe.init(i,r),i._zod.bag.format="ipv4"}),PS=ue("$ZodIPv6",(i,r)=>{r.pattern??(r.pattern=Qb),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})}}}),ZS=ue("$ZodCIDRv4",(i,r)=>{r.pattern??(r.pattern=eS),Qe.init(i,r)}),qS=ue("$ZodCIDRv6",(i,r)=>{r.pattern??(r.pattern=tS),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 Dp(i){if(i==="")return!0;if(i.length%4!==0)return!1;try{return atob(i),!0}catch{return!1}}const FS=ue("$ZodBase64",(i,r)=>{r.pattern??(r.pattern=iS),Qe.init(i,r),i._zod.bag.contentEncoding="base64",i._zod.check=a=>{Dp(a.value)||a.issues.push({code:"invalid_format",format:"base64",input:a.value,inst:i,continue:!r.abort})}});function KS(i){if(!Cp.test(i))return!1;const r=i.replace(/[-_]/g,o=>o==="-"?"+":"/"),a=r.padEnd(Math.ceil(r.length/4)*4,"=");return Dp(a)}const VS=ue("$ZodBase64URL",(i,r)=>{r.pattern??(r.pattern=Cp),Qe.init(i,r),i._zod.bag.contentEncoding="base64url",i._zod.check=a=>{KS(a.value)||a.issues.push({code:"invalid_format",format:"base64url",input:a.value,inst:i,continue:!r.abort})}}),GS=ue("$ZodE164",(i,r)=>{r.pattern??(r.pattern=sS),Qe.init(i,r)});function YS(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 WS=ue("$ZodJWT",(i,r)=>{Qe.init(i,r),i._zod.check=a=>{YS(a.value,r.alg)||a.issues.push({code:"invalid_format",format:"jwt",input:a.value,inst:i,continue:!r.abort})}}),Op=ue("$ZodNumber",(i,r)=>{rt.init(i,r),i._zod.pattern=i._zod.bag.pattern??kp,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}}),XS=ue("$ZodNumberFormat",(i,r)=>{dS.init(i,r),Op.init(i,r)}),JS=ue("$ZodBoolean",(i,r)=>{rt.init(i,r),i._zod.pattern=cS,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}}),QS=ue("$ZodUnknown",(i,r)=>{rt.init(i,r),i._zod.parse=a=>a}),ex=ue("$ZodNever",(i,r)=>{rt.init(i,r),i._zod.parse=(a,o)=>(a.issues.push({expected:"never",code:"invalid_type",input:a.value,inst:i}),a)});function s_(i,r,a){i.issues.length&&r.issues.push(...Lr(a,i.issues)),r.value[a]=i.value}const tx=ue("$ZodArray",(i,r)=>{rt.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 l=g[T],h=r.element._zod.run({value:l,issues:[]},o);h instanceof Promise?k.push(h.then(u=>s_(u,a,T))):s_(h,a,T)}return k.length?Promise.all(k).then(()=>a):a}});function So(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 Mp(i){var o,g,k,T;const r=Object.keys(i.shape);for(const l of r)if(!((T=(k=(g=(o=i.shape)==null?void 0:o[l])==null?void 0:g._zod)==null?void 0:k.traits)!=null&&T.has("$ZodType")))throw new Error(`Invalid element at key "${l}": expected a Zod schema`);const a=bb(i.shape);return{...i,keys:r,keySet:new Set(r),numKeys:r.length,optionalKeys:new Set(a)}}function Lp(i,r,a,o,g,k){const T=[],l=g.keySet,h=g.catchall._zod,u=h.def.type,y=h.optout==="optional";for(const d in r){if(l.has(d))continue;if(u==="never"){T.push(d);continue}const x=h.run({value:r[d],issues:[]},o);x instanceof Promise?i.push(x.then(E=>So(E,a,d,r,y))):So(x,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 ix=ue("$ZodObject",(i,r)=>{rt.init(i,r);const a=Object.getOwnPropertyDescriptor(r,"shape");if(!(a!=null&&a.get)){const l=r.shape;Object.defineProperty(r,"shape",{get:()=>{const h={...l};return Object.defineProperty(r,"shape",{value:h}),h}})}const o=Au(()=>Mp(r));$e(i._zod,"propValues",()=>{const l=r.shape,h={};for(const u in l){const y=l[u]._zod;if(y.values){h[u]??(h[u]=new Set);for(const d of y.values)h[u].add(d)}}return h});const g=bo,k=r.catchall;let T;i._zod.parse=(l,h)=>{T??(T=o.value);const u=l.value;if(!g(u))return l.issues.push({expected:"object",code:"invalid_type",input:u,inst:i}),l;l.value={};const y=[],d=T.shape;for(const x of T.keys){const E=d[x],M=E._zod.optout==="optional",S=E._zod.run({value:u[x],issues:[]},h);S instanceof Promise?y.push(S.then(_=>So(_,l,x,u,M))):So(S,l,x,u,M)}return k?Lp(y,u,l,h,o.value,i):y.length?Promise.all(y).then(()=>l):l}}),sx=ue("$ZodObjectJIT",(i,r)=>{ix.init(i,r);const a=i._zod.parse,o=Au(()=>Mp(r)),g=x=>{var v;const E=new wS(["shape","payload","ctx"]),M=o.value,S=b=>{const R=t_(b);return`shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`};E.write("const input = payload.value;");const _=Object.create(null);let p=0;for(const b of M.keys)_[b]=`key_${p++}`;E.write("const newResult = {};");for(const b of M.keys){const R=_[b],A=t_(b),O=x[b],w=((v=O==null?void 0:O._zod)==null?void 0:v.optout)==="optional";E.write(`const ${R} = ${S(b)};`),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(b,R)=>f(x,b,R)};let k;const T=bo,l=!pp.jitless,u=l&&gb.value,y=r.catchall;let d;i._zod.parse=(x,E)=>{d??(d=o.value);const M=x.value;return T(M)?l&&u&&(E==null?void 0:E.async)===!1&&E.jitless!==!0?(k||(k=g(r.shape)),x=k(x,E),y?Lp([],M,x,E,d,i):x):a(x,E):(x.issues.push({expected:"object",code:"invalid_type",input:M,inst:i}),x)}});function r_(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=>_s(T,o,ms())))}),r)}const rx=ue("$ZodUnion",(i,r)=>{rt.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 l=[];for(const h of r.options){const u=h._zod.run({value:g.value,issues:[]},k);if(u instanceof Promise)l.push(u),T=!0;else{if(u.issues.length===0)return u;l.push(u)}}return T?Promise.all(l).then(h=>r_(h,g,i,k)):r_(l,g,i,k)}}),nx=ue("$ZodIntersection",(i,r)=>{rt.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(([h,u])=>n_(a,h,u)):n_(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 n_(i,r,a){const o=new Map;let g;for(const l of r.issues)if(l.code==="unrecognized_keys"){g??(g=l);for(const h of l.keys)o.has(h)||o.set(h,{}),o.get(h).l=!0}else i.issues.push(l);for(const l of a.issues)if(l.code==="unrecognized_keys")for(const h of l.keys)o.has(h)||o.set(h,{}),o.get(h).r=!0;else i.issues.push(l);const k=[...o].filter(([,l])=>l.l&&l.r).map(([l])=>l);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 ax=ue("$ZodRecord",(i,r)=>{rt.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 l=new Set;for(const u of T)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){l.add(typeof u=="number"?u.toString():u);const y=r.valueType._zod.run({value:g[u],issues:[]},o);y instanceof Promise?k.push(y.then(d=>{d.issues.length&&a.issues.push(...Lr(u,d.issues)),a.value[u]=d.value})):(y.issues.length&&a.issues.push(...Lr(u,y.issues)),a.value[u]=y.value)}let h;for(const u in g)l.has(u)||(h=h??[],h.push(u));h&&h.length>0&&a.issues.push({code:"unrecognized_keys",input:g,inst:i,keys:h})}else{a.value={};for(const l of Reflect.ownKeys(g)){if(l==="__proto__")continue;let h=r.keyType._zod.run({value:l,issues:[]},o);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&kp.test(l)&&h.issues.length){const d=r.keyType._zod.run({value:Number(l),issues:[]},o);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(h=d)}if(h.issues.length){r.mode==="loose"?a.value[l]=g[l]:a.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(d=>_s(d,o,ms())),input:l,path:[l],inst:i});continue}const y=r.valueType._zod.run({value:g[l],issues:[]},o);y instanceof Promise?k.push(y.then(d=>{d.issues.length&&a.issues.push(...Lr(l,d.issues)),a.value[h.value]=d.value})):(y.issues.length&&a.issues.push(...Lr(l,y.issues)),a.value[h.value]=y.value)}}return k.length?Promise.all(k).then(()=>a):a}}),ox=ue("$ZodEnum",(i,r)=>{rt.init(i,r);const a=vp(r.entries),o=new Set(a);i._zod.values=o,i._zod.pattern=new RegExp(`^(${a.filter(g=>yb.has(typeof g)).map(g=>typeof g=="string"?Do(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}}),lx=ue("$ZodTransform",(i,r)=>{rt.init(i,r),i._zod.parse=(a,o)=>{if(o.direction==="backward")throw new _p(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 a_(i,r){return i.issues.length&&r===void 0?{issues:[],value:void 0}:i}const Np=ue("$ZodOptional",(i,r)=>{rt.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=>a_(k,a.value)):a_(g,a.value)}return a.value===void 0?a:r.innerType._zod.run(a,o)}}),cx=ue("$ZodExactOptional",(i,r)=>{Np.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)}),ux=ue("$ZodNullable",(i,r)=>{rt.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)}),hx=ue("$ZodDefault",(i,r)=>{rt.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=>o_(k,r)):o_(g,r)}});function o_(i,r){return i.value===void 0&&(i.value=r.defaultValue),i}const fx=ue("$ZodPrefault",(i,r)=>{rt.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))}),dx=ue("$ZodNonOptional",(i,r)=>{rt.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=>l_(k,i)):l_(g,i)}});function l_(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 mx=ue("$ZodCatch",(i,r)=>{rt.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=>_s(T,o,ms()))},input:a.value}),a.issues=[]),a)):(a.value=g.value,g.issues.length&&(a.value=r.catchValue({...a,error:{issues:g.issues.map(k=>_s(k,o,ms()))},input:a.value}),a.issues=[]),a)}}),_x=ue("$ZodPipe",(i,r)=>{rt.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=>ho(T,r.in,o)):ho(k,r.in,o)}const g=r.in._zod.run(a,o);return g instanceof Promise?g.then(k=>ho(k,r.out,o)):ho(g,r.out,o)}});function ho(i,r,a){return i.issues.length?(i.aborted=!0,i):r._zod.run({value:i.value,issues:i.issues},a)}const px=ue("$ZodReadonly",(i,r)=>{rt.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(c_):c_(g)}});function c_(i){return i.value=Object.freeze(i.value),i}const vx=ue("$ZodCustom",(i,r)=>{jt.init(i,r),rt.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=>u_(k,a,o,i));u_(g,a,o,i)}});function u_(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($n(g))}}var h_;class gx{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 yx(){return new gx}(h_=globalThis).__zod_globalRegistry??(h_.__zod_globalRegistry=yx());const Un=globalThis.__zod_globalRegistry;function bx(i,r){return new i({type:"string",...be(r)})}function Sx(i,r){return new i({type:"string",format:"email",check:"string_format",abort:!1,...be(r)})}function f_(i,r){return new i({type:"string",format:"guid",check:"string_format",abort:!1,...be(r)})}function xx(i,r){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,...be(r)})}function Cx(i,r){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...be(r)})}function wx(i,r){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...be(r)})}function Ex(i,r){return new i({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...be(r)})}function kx(i,r){return new i({type:"string",format:"url",check:"string_format",abort:!1,...be(r)})}function Tx(i,r){return new i({type:"string",format:"emoji",check:"string_format",abort:!1,...be(r)})}function Rx(i,r){return new i({type:"string",format:"nanoid",check:"string_format",abort:!1,...be(r)})}function Ax(i,r){return new i({type:"string",format:"cuid",check:"string_format",abort:!1,...be(r)})}function Dx(i,r){return new i({type:"string",format:"cuid2",check:"string_format",abort:!1,...be(r)})}function Ox(i,r){return new i({type:"string",format:"ulid",check:"string_format",abort:!1,...be(r)})}function Mx(i,r){return new i({type:"string",format:"xid",check:"string_format",abort:!1,...be(r)})}function Lx(i,r){return new i({type:"string",format:"ksuid",check:"string_format",abort:!1,...be(r)})}function Nx(i,r){return new i({type:"string",format:"ipv4",check:"string_format",abort:!1,...be(r)})}function jx(i,r){return new i({type:"string",format:"ipv6",check:"string_format",abort:!1,...be(r)})}function Bx(i,r){return new i({type:"string",format:"cidrv4",check:"string_format",abort:!1,...be(r)})}function zx(i,r){return new i({type:"string",format:"cidrv6",check:"string_format",abort:!1,...be(r)})}function Hx(i,r){return new i({type:"string",format:"base64",check:"string_format",abort:!1,...be(r)})}function Ux(i,r){return new i({type:"string",format:"base64url",check:"string_format",abort:!1,...be(r)})}function Ix(i,r){return new i({type:"string",format:"e164",check:"string_format",abort:!1,...be(r)})}function $x(i,r){return new i({type:"string",format:"jwt",check:"string_format",abort:!1,...be(r)})}function Px(i,r){return new i({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...be(r)})}function Zx(i,r){return new i({type:"string",format:"date",check:"string_format",...be(r)})}function qx(i,r){return new i({type:"string",format:"time",check:"string_format",precision:null,...be(r)})}function Fx(i,r){return new i({type:"string",format:"duration",check:"string_format",...be(r)})}function Kx(i,r){return new i({type:"number",checks:[],...be(r)})}function Vx(i,r){return new i({type:"number",check:"number_format",abort:!1,format:"safeint",...be(r)})}function Gx(i,r){return new i({type:"boolean",...be(r)})}function Yx(i){return new i({type:"unknown"})}function Wx(i,r){return new i({type:"never",...be(r)})}function d_(i,r){return new Rp({check:"less_than",...be(r),value:i,inclusive:!1})}function ru(i,r){return new Rp({check:"less_than",...be(r),value:i,inclusive:!0})}function m_(i,r){return new Ap({check:"greater_than",...be(r),value:i,inclusive:!1})}function nu(i,r){return new Ap({check:"greater_than",...be(r),value:i,inclusive:!0})}function __(i,r){return new fS({check:"multiple_of",...be(r),value:i})}function jp(i,r){return new mS({check:"max_length",...be(r),maximum:i})}function xo(i,r){return new _S({check:"min_length",...be(r),minimum:i})}function Bp(i,r){return new pS({check:"length_equals",...be(r),length:i})}function Xx(i,r){return new vS({check:"string_format",format:"regex",...be(r),pattern:i})}function Jx(i){return new gS({check:"string_format",format:"lowercase",...be(i)})}function Qx(i){return new yS({check:"string_format",format:"uppercase",...be(i)})}function eC(i,r){return new bS({check:"string_format",format:"includes",...be(r),includes:i})}function tC(i,r){return new SS({check:"string_format",format:"starts_with",...be(r),prefix:i})}function iC(i,r){return new xS({check:"string_format",format:"ends_with",...be(r),suffix:i})}function Ur(i){return new CS({check:"overwrite",tx:i})}function sC(i){return Ur(r=>r.normalize(i))}function rC(){return Ur(i=>i.trim())}function nC(){return Ur(i=>i.toLowerCase())}function aC(){return Ur(i=>i.toUpperCase())}function oC(){return Ur(i=>vb(i))}function lC(i,r,a){return new i({type:"array",element:r,...be(a)})}function cC(i,r,a){return new i({type:"custom",check:"custom",fn:r,...be(a)})}function uC(i){const r=hC(a=>(a.addIssue=o=>{if(typeof o=="string")a.issues.push($n(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($n(g))}},i(a.value,a)));return r}function hC(i,r){const a=new jt({check:"custom",...be(r)});return a._zod.check=i,a}function zp(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)??Un,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 mt(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 l=(d=(y=i._zod).toJSONSchema)==null?void 0:d.call(y);if(l)T.schema=l;else{const x={...a,schemaPath:[...a.schemaPath,i],path:a.path};if(i._zod.processJSONSchema)i._zod.processJSONSchema(r,T.schema,x);else{const M=T.schema,S=r.processors[g.type];if(!S)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${g.type}`);S(i,r,M,x)}const E=i._zod.parent;E&&(T.ref||(T.ref=E),mt(E,r,x),r.seen.get(E).isParent=!0)}const h=r.metadataRegistry.get(i);return h&&Object.assign(T.schema,h),r.io==="input"&&kt(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 Hp(i,r){var T,l,h,u;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 x=o.get(d);if(x&&x!==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 S;const d=i.target==="draft-2020-12"?"$defs":"definitions";if(i.external){const _=(S=i.external.registry.get(y[0]))==null?void 0:S.id,p=i.external.uri??(v=>v);if(_)return{ref:p(_)};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}/`,M=y[1].schema.id??`__schema${i.counter++}`;return{defId:M,ref:E+M}},k=y=>{if(y[1].schema.$ref)return;const d=y[1],{ref:x,defId:E}=g(y);d.def={...d.schema},E&&(d.defId=E);const M=d.schema;for(const S in M)delete M[S];M.$ref=x};if(i.cycles==="throw")for(const y of i.seen.entries()){const d=y[1];if(d.cycle)throw new Error(`Cycle detected: #/${(l=d.cycle)==null?void 0:l.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=(h=i.external.registry.get(y[0]))==null?void 0:h.id;if(r!==y[0]&&E){k(y);continue}}if((u=i.metadataRegistry.get(y[0]))==null?void 0:u.id){k(y);continue}if(d.cycle){k(y);continue}if(d.count>1&&i.reused==="ref"){k(y);continue}}}function Up(i,r){var T,l,h;const a=i.seen.get(r);if(!a)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=u=>{const y=i.seen.get(u);if(y.ref===null)return;const d=y.def??y.schema,x={...d},E=y.ref;if(y.ref=null,E){o(E);const S=i.seen.get(E),_=S.schema;if(_.$ref&&(i.target==="draft-07"||i.target==="draft-04"||i.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(_)):Object.assign(d,_),Object.assign(d,x),u._zod.parent===E)for(const f in d)f==="$ref"||f==="allOf"||f in x||delete d[f];if(_.$ref&&S.def)for(const f in d)f==="$ref"||f==="allOf"||f in S.def&&JSON.stringify(d[f])===JSON.stringify(S.def[f])&&delete d[f]}const M=u._zod.parent;if(M&&M!==E){o(M);const S=i.seen.get(M);if(S!=null&&S.schema.$ref&&(d.$ref=S.schema.$ref,S.def))for(const _ in d)_==="$ref"||_==="allOf"||_ in S.def&&JSON.stringify(d[_])===JSON.stringify(S.def[_])&&delete d[_]}i.override({zodSchema:u,jsonSchema:d,path:y.path??[]})};for(const u of[...i.seen.entries()].reverse())o(u[0]);const g={};if(i.target==="draft-2020-12"?g.$schema="https://json-schema.org/draft/2020-12/schema":i.target==="draft-07"?g.$schema="http://json-schema.org/draft-07/schema#":i.target==="draft-04"?g.$schema="http://json-schema.org/draft-04/schema#":i.target,(T=i.external)!=null&&T.uri){const u=(l=i.external.registry.get(r))==null?void 0:l.id;if(!u)throw new Error("Schema is missing an `id` property");g.$id=i.external.uri(u)}Object.assign(g,a.def??a.schema);const k=((h=i.external)==null?void 0:h.defs)??{};for(const u of i.seen.entries()){const y=u[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 u=JSON.parse(JSON.stringify(g));return Object.defineProperty(u,"~standard",{value:{...r["~standard"],jsonSchema:{input:Co(r,"input",i.processors),output:Co(r,"output",i.processors)}},enumerable:!1,writable:!1}),u}catch{throw new Error("Error converting schema to JSON.")}}function kt(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 kt(o.element,a);if(o.type==="set")return kt(o.valueType,a);if(o.type==="lazy")return kt(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 kt(o.innerType,a);if(o.type==="intersection")return kt(o.left,a)||kt(o.right,a);if(o.type==="record"||o.type==="map")return kt(o.keyType,a)||kt(o.valueType,a);if(o.type==="pipe")return kt(o.in,a)||kt(o.out,a);if(o.type==="object"){for(const g in o.shape)if(kt(o.shape[g],a))return!0;return!1}if(o.type==="union"){for(const g of o.options)if(kt(g,a))return!0;return!1}if(o.type==="tuple"){for(const g of o.items)if(kt(g,a))return!0;return!!(o.rest&&kt(o.rest,a))}return!1}const fC=(i,r={})=>a=>{const o=zp({...a,processors:r});return mt(i,o),Hp(o,i),Up(o,i)},Co=(i,r,a={})=>o=>{const{libraryOptions:g,target:k}=o??{},T=zp({...g??{},target:k,io:r,processors:a});return mt(i,T),Hp(T,i),Up(T,i)},dC={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},mC=(i,r,a,o)=>{const g=a;g.type="string";const{minimum:k,maximum:T,format:l,patterns:h,contentEncoding:u}=i._zod.bag;if(typeof k=="number"&&(g.minLength=k),typeof T=="number"&&(g.maxLength=T),l&&(g.format=dC[l]??l,g.format===""&&delete g.format,l==="time"&&delete g.format),u&&(g.contentEncoding=u),h&&h.size>0){const y=[...h];y.length===1?g.pattern=y[0].source:y.length>1&&(g.allOf=[...y.map(d=>({...r.target==="draft-07"||r.target==="draft-04"||r.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},_C=(i,r,a,o)=>{const g=a,{minimum:k,maximum:T,format:l,multipleOf:h,exclusiveMaximum:u,exclusiveMinimum:y}=i._zod.bag;typeof l=="string"&&l.includes("int")?g.type="integer":g.type="number",typeof y=="number"&&(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 u=="number"&&(r.target==="draft-04"||r.target==="openapi-3.0"?(g.maximum=u,g.exclusiveMaximum=!0):g.exclusiveMaximum=u),typeof T=="number"&&(g.maximum=T,typeof u=="number"&&r.target!=="draft-04"&&(u<=T?delete g.maximum:delete g.exclusiveMaximum)),typeof h=="number"&&(g.multipleOf=h)},pC=(i,r,a,o)=>{a.type="boolean"},vC=(i,r,a,o)=>{a.not={}},gC=(i,r,a,o)=>{},yC=(i,r,a,o)=>{const g=i._zod.def,k=vp(g.entries);k.every(T=>typeof T=="number")&&(a.type="number"),k.every(T=>typeof T=="string")&&(a.type="string"),a.enum=k},bC=(i,r,a,o)=>{if(r.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},SC=(i,r,a,o)=>{if(r.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},xC=(i,r,a,o)=>{const g=a,k=i._zod.def,{minimum:T,maximum:l}=i._zod.bag;typeof T=="number"&&(g.minItems=T),typeof l=="number"&&(g.maxItems=l),g.type="array",g.items=mt(k.element,r,{...o,path:[...o.path,"items"]})},CC=(i,r,a,o)=>{var u;const g=a,k=i._zod.def;g.type="object",g.properties={};const T=k.shape;for(const y in T)g.properties[y]=mt(T[y],r,{...o,path:[...o.path,"properties",y]});const l=new Set(Object.keys(T)),h=new Set([...l].filter(y=>{const d=k.shape[y]._zod;return r.io==="input"?d.optin===void 0:d.optout===void 0}));h.size>0&&(g.required=Array.from(h)),((u=k.catchall)==null?void 0:u._zod.def.type)==="never"?g.additionalProperties=!1:k.catchall?k.catchall&&(g.additionalProperties=mt(k.catchall,r,{...o,path:[...o.path,"additionalProperties"]})):r.io==="output"&&(g.additionalProperties=!1)},wC=(i,r,a,o)=>{const g=i._zod.def,k=g.inclusive===!1,T=g.options.map((l,h)=>mt(l,r,{...o,path:[...o.path,k?"oneOf":"anyOf",h]}));k?a.oneOf=T:a.anyOf=T},EC=(i,r,a,o)=>{const g=i._zod.def,k=mt(g.left,r,{...o,path:[...o.path,"allOf",0]}),T=mt(g.right,r,{...o,path:[...o.path,"allOf",1]}),l=u=>"allOf"in u&&Object.keys(u).length===1,h=[...l(k)?k.allOf:[k],...l(T)?T.allOf:[T]];a.allOf=h},kC=(i,r,a,o)=>{const g=a,k=i._zod.def;g.type="object";const T=k.keyType,l=T._zod.bag,h=l==null?void 0:l.patterns;if(k.mode==="loose"&&h&&h.size>0){const y=mt(k.valueType,r,{...o,path:[...o.path,"patternProperties","*"]});g.patternProperties={};for(const d of h)g.patternProperties[d.source]=y}else(r.target==="draft-07"||r.target==="draft-2020-12")&&(g.propertyNames=mt(k.keyType,r,{...o,path:[...o.path,"propertyNames"]})),g.additionalProperties=mt(k.valueType,r,{...o,path:[...o.path,"additionalProperties"]});const u=T._zod.values;if(u){const y=[...u].filter(d=>typeof d=="string"||typeof d=="number");y.length>0&&(g.required=y)}},TC=(i,r,a,o)=>{const g=i._zod.def,k=mt(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"}]},RC=(i,r,a,o)=>{const g=i._zod.def;mt(g.innerType,r,o);const k=r.seen.get(i);k.ref=g.innerType},AC=(i,r,a,o)=>{const g=i._zod.def;mt(g.innerType,r,o);const k=r.seen.get(i);k.ref=g.innerType,a.default=JSON.parse(JSON.stringify(g.defaultValue))},DC=(i,r,a,o)=>{const g=i._zod.def;mt(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)))},OC=(i,r,a,o)=>{const g=i._zod.def;mt(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},MC=(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;mt(k,r,o);const T=r.seen.get(i);T.ref=k},LC=(i,r,a,o)=>{const g=i._zod.def;mt(g.innerType,r,o);const k=r.seen.get(i);k.ref=g.innerType,a.readOnly=!0},Ip=(i,r,a,o)=>{const g=i._zod.def;mt(g.innerType,r,o);const k=r.seen.get(i);k.ref=g.innerType},NC=ue("ZodISODateTime",(i,r)=>{zS.init(i,r),tt.init(i,r)});function jC(i){return Px(NC,i)}const BC=ue("ZodISODate",(i,r)=>{HS.init(i,r),tt.init(i,r)});function zC(i){return Zx(BC,i)}const HC=ue("ZodISOTime",(i,r)=>{US.init(i,r),tt.init(i,r)});function UC(i){return qx(HC,i)}const IC=ue("ZodISODuration",(i,r)=>{IS.init(i,r),tt.init(i,r)});function $C(i){return Fx(IC,i)}const PC=(i,r)=>{Sp.init(i,r),i.name="ZodError",Object.defineProperties(i,{format:{value:a=>Db(i,a)},flatten:{value:a=>Ab(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}}})},ri=ue("ZodError",PC,{Parent:Error}),ZC=Lu(ri),qC=Nu(ri),FC=Oo(ri),KC=Mo(ri),VC=Lb(ri),GC=Nb(ri),YC=jb(ri),WC=Bb(ri),XC=zb(ri),JC=Hb(ri),QC=Ub(ri),e2=Ib(ri),nt=ue("ZodType",(i,r)=>(rt.init(i,r),Object.assign(i["~standard"],{jsonSchema:{input:Co(i,"input"),output:Co(i,"output")}}),i.toJSONSchema=fC(i,{}),i.def=r,i.type=r.type,Object.defineProperty(i,"_def",{value:r}),i.check=(...a)=>i.clone(vs(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)=>gs(i,a,o),i.brand=()=>i,i.register=((a,o)=>(a.add(i,o),i)),i.parse=(a,o)=>ZC(i,a,o,{callee:i.parse}),i.safeParse=(a,o)=>FC(i,a,o),i.parseAsync=async(a,o)=>qC(i,a,o,{callee:i.parseAsync}),i.safeParseAsync=async(a,o)=>KC(i,a,o),i.spa=i.safeParseAsync,i.encode=(a,o)=>VC(i,a,o),i.decode=(a,o)=>GC(i,a,o),i.encodeAsync=async(a,o)=>YC(i,a,o),i.decodeAsync=async(a,o)=>WC(i,a,o),i.safeEncode=(a,o)=>XC(i,a,o),i.safeDecode=(a,o)=>JC(i,a,o),i.safeEncodeAsync=async(a,o)=>QC(i,a,o),i.safeDecodeAsync=async(a,o)=>e2(i,a,o),i.refine=(a,o)=>i.check(V2(a,o)),i.superRefine=a=>i.check(G2(a)),i.overwrite=a=>i.check(Ur(a)),i.optional=()=>g_(i),i.exactOptional=()=>N2(i),i.nullable=()=>y_(i),i.nullish=()=>g_(y_(i)),i.nonoptional=a=>I2(i,a),i.array=()=>Kn(i),i.or=a=>T2([i,a]),i.and=a=>A2(i,a),i.transform=a=>b_(i,M2(a)),i.default=a=>z2(i,a),i.prefault=a=>U2(i,a),i.catch=a=>P2(i,a),i.pipe=a=>b_(i,a),i.readonly=()=>F2(i),i.describe=a=>{const o=i.clone();return Un.add(o,{description:a}),o},Object.defineProperty(i,"description",{get(){var a;return(a=Un.get(i))==null?void 0:a.description},configurable:!0}),i.meta=(...a)=>{if(a.length===0)return Un.get(i);const o=i.clone();return Un.add(o,a[0]),o},i.isOptional=()=>i.safeParse(void 0).success,i.isNullable=()=>i.safeParse(null).success,i.apply=a=>a(i),i)),$p=ue("_ZodString",(i,r)=>{ju.init(i,r),nt.init(i,r),i._zod.processJSONSchema=(o,g,k)=>mC(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(Xx(...o)),i.includes=(...o)=>i.check(eC(...o)),i.startsWith=(...o)=>i.check(tC(...o)),i.endsWith=(...o)=>i.check(iC(...o)),i.min=(...o)=>i.check(xo(...o)),i.max=(...o)=>i.check(jp(...o)),i.length=(...o)=>i.check(Bp(...o)),i.nonempty=(...o)=>i.check(xo(1,...o)),i.lowercase=o=>i.check(Jx(o)),i.uppercase=o=>i.check(Qx(o)),i.trim=()=>i.check(rC()),i.normalize=(...o)=>i.check(sC(...o)),i.toLowerCase=()=>i.check(nC()),i.toUpperCase=()=>i.check(aC()),i.slugify=()=>i.check(oC())}),t2=ue("ZodString",(i,r)=>{ju.init(i,r),$p.init(i,r),i.email=a=>i.check(Sx(i2,a)),i.url=a=>i.check(kx(s2,a)),i.jwt=a=>i.check($x(g2,a)),i.emoji=a=>i.check(Tx(r2,a)),i.guid=a=>i.check(f_(p_,a)),i.uuid=a=>i.check(xx(fo,a)),i.uuidv4=a=>i.check(Cx(fo,a)),i.uuidv6=a=>i.check(wx(fo,a)),i.uuidv7=a=>i.check(Ex(fo,a)),i.nanoid=a=>i.check(Rx(n2,a)),i.guid=a=>i.check(f_(p_,a)),i.cuid=a=>i.check(Ax(a2,a)),i.cuid2=a=>i.check(Dx(o2,a)),i.ulid=a=>i.check(Ox(l2,a)),i.base64=a=>i.check(Hx(_2,a)),i.base64url=a=>i.check(Ux(p2,a)),i.xid=a=>i.check(Mx(c2,a)),i.ksuid=a=>i.check(Lx(u2,a)),i.ipv4=a=>i.check(Nx(h2,a)),i.ipv6=a=>i.check(jx(f2,a)),i.cidrv4=a=>i.check(Bx(d2,a)),i.cidrv6=a=>i.check(zx(m2,a)),i.e164=a=>i.check(Ix(v2,a)),i.datetime=a=>i.check(jC(a)),i.date=a=>i.check(zC(a)),i.time=a=>i.check(UC(a)),i.duration=a=>i.check($C(a))});function Re(i){return bx(t2,i)}const tt=ue("ZodStringFormat",(i,r)=>{Qe.init(i,r),$p.init(i,r)}),i2=ue("ZodEmail",(i,r)=>{RS.init(i,r),tt.init(i,r)}),p_=ue("ZodGUID",(i,r)=>{kS.init(i,r),tt.init(i,r)}),fo=ue("ZodUUID",(i,r)=>{TS.init(i,r),tt.init(i,r)}),s2=ue("ZodURL",(i,r)=>{AS.init(i,r),tt.init(i,r)}),r2=ue("ZodEmoji",(i,r)=>{DS.init(i,r),tt.init(i,r)}),n2=ue("ZodNanoID",(i,r)=>{OS.init(i,r),tt.init(i,r)}),a2=ue("ZodCUID",(i,r)=>{MS.init(i,r),tt.init(i,r)}),o2=ue("ZodCUID2",(i,r)=>{LS.init(i,r),tt.init(i,r)}),l2=ue("ZodULID",(i,r)=>{NS.init(i,r),tt.init(i,r)}),c2=ue("ZodXID",(i,r)=>{jS.init(i,r),tt.init(i,r)}),u2=ue("ZodKSUID",(i,r)=>{BS.init(i,r),tt.init(i,r)}),h2=ue("ZodIPv4",(i,r)=>{$S.init(i,r),tt.init(i,r)}),f2=ue("ZodIPv6",(i,r)=>{PS.init(i,r),tt.init(i,r)}),d2=ue("ZodCIDRv4",(i,r)=>{ZS.init(i,r),tt.init(i,r)}),m2=ue("ZodCIDRv6",(i,r)=>{qS.init(i,r),tt.init(i,r)}),_2=ue("ZodBase64",(i,r)=>{FS.init(i,r),tt.init(i,r)}),p2=ue("ZodBase64URL",(i,r)=>{VS.init(i,r),tt.init(i,r)}),v2=ue("ZodE164",(i,r)=>{GS.init(i,r),tt.init(i,r)}),g2=ue("ZodJWT",(i,r)=>{WS.init(i,r),tt.init(i,r)}),Pp=ue("ZodNumber",(i,r)=>{Op.init(i,r),nt.init(i,r),i._zod.processJSONSchema=(o,g,k)=>_C(i,o,g),i.gt=(o,g)=>i.check(m_(o,g)),i.gte=(o,g)=>i.check(nu(o,g)),i.min=(o,g)=>i.check(nu(o,g)),i.lt=(o,g)=>i.check(d_(o,g)),i.lte=(o,g)=>i.check(ru(o,g)),i.max=(o,g)=>i.check(ru(o,g)),i.int=o=>i.check(v_(o)),i.safe=o=>i.check(v_(o)),i.positive=o=>i.check(m_(0,o)),i.nonnegative=o=>i.check(nu(0,o)),i.negative=o=>i.check(d_(0,o)),i.nonpositive=o=>i.check(ru(0,o)),i.multipleOf=(o,g)=>i.check(__(o,g)),i.step=(o,g)=>i.check(__(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 Ce(i){return Kx(Pp,i)}const y2=ue("ZodNumberFormat",(i,r)=>{XS.init(i,r),Pp.init(i,r)});function v_(i){return Vx(y2,i)}const b2=ue("ZodBoolean",(i,r)=>{JS.init(i,r),nt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>pC(i,a,o)});function zi(i){return Gx(b2,i)}const S2=ue("ZodUnknown",(i,r)=>{QS.init(i,r),nt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>gC()});function wo(){return Yx(S2)}const x2=ue("ZodNever",(i,r)=>{ex.init(i,r),nt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>vC(i,a,o)});function C2(i){return Wx(x2,i)}const w2=ue("ZodArray",(i,r)=>{tx.init(i,r),nt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>xC(i,a,o,g),i.element=r.element,i.min=(a,o)=>i.check(xo(a,o)),i.nonempty=a=>i.check(xo(1,a)),i.max=(a,o)=>i.check(jp(a,o)),i.length=(a,o)=>i.check(Bp(a,o)),i.unwrap=()=>i.element});function Kn(i,r){return lC(w2,i,r)}const E2=ue("ZodObject",(i,r)=>{sx.init(i,r),nt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>CC(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:wo()}),i.loose=()=>i.clone({...i._zod.def,catchall:wo()}),i.strict=()=>i.clone({...i._zod.def,catchall:C2()}),i.strip=()=>i.clone({...i._zod.def,catchall:void 0}),i.extend=a=>wb(i,a),i.safeExtend=a=>Eb(i,a),i.merge=a=>kb(i,a),i.pick=a=>xb(i,a),i.omit=a=>Cb(i,a),i.partial=(...a)=>Tb(Zp,i,a[0]),i.required=(...a)=>Rb(qp,i,a[0])});function Xe(i,r){const a={type:"object",shape:i??{},...be(r)};return new E2(a)}const k2=ue("ZodUnion",(i,r)=>{rx.init(i,r),nt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>wC(i,a,o,g),i.options=r.options});function T2(i,r){return new k2({type:"union",options:i,...be(r)})}const R2=ue("ZodIntersection",(i,r)=>{nx.init(i,r),nt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>EC(i,a,o,g)});function A2(i,r){return new R2({type:"intersection",left:i,right:r})}const D2=ue("ZodRecord",(i,r)=>{ax.init(i,r),nt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>kC(i,a,o,g),i.keyType=r.keyType,i.valueType=r.valueType});function No(i,r,a){return new D2({type:"record",keyType:i,valueType:r,...be(a)})}const vu=ue("ZodEnum",(i,r)=>{ox.init(i,r),nt.init(i,r),i._zod.processJSONSchema=(o,g,k)=>yC(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 O2=ue("ZodTransform",(i,r)=>{lx.init(i,r),nt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>SC(i,a),i._zod.parse=(a,o)=>{if(o.direction==="backward")throw new _p(i.constructor.name);a.addIssue=k=>{if(typeof k=="string")a.issues.push($n(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($n(T))}};const g=r.transform(a.value,a);return g instanceof Promise?g.then(k=>(a.value=k,a)):(a.value=g,a)}});function M2(i){return new O2({type:"transform",transform:i})}const Zp=ue("ZodOptional",(i,r)=>{Np.init(i,r),nt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Ip(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function g_(i){return new Zp({type:"optional",innerType:i})}const L2=ue("ZodExactOptional",(i,r)=>{cx.init(i,r),nt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>Ip(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function N2(i){return new L2({type:"optional",innerType:i})}const j2=ue("ZodNullable",(i,r)=>{ux.init(i,r),nt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>TC(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function y_(i){return new j2({type:"nullable",innerType:i})}const B2=ue("ZodDefault",(i,r)=>{hx.init(i,r),nt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>AC(i,a,o,g),i.unwrap=()=>i._zod.def.innerType,i.removeDefault=i.unwrap});function z2(i,r){return new B2({type:"default",innerType:i,get defaultValue(){return typeof r=="function"?r():yp(r)}})}const H2=ue("ZodPrefault",(i,r)=>{fx.init(i,r),nt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>DC(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function U2(i,r){return new H2({type:"prefault",innerType:i,get defaultValue(){return typeof r=="function"?r():yp(r)}})}const qp=ue("ZodNonOptional",(i,r)=>{dx.init(i,r),nt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>RC(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function I2(i,r){return new qp({type:"nonoptional",innerType:i,...be(r)})}const $2=ue("ZodCatch",(i,r)=>{mx.init(i,r),nt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>OC(i,a,o,g),i.unwrap=()=>i._zod.def.innerType,i.removeCatch=i.unwrap});function P2(i,r){return new $2({type:"catch",innerType:i,catchValue:typeof r=="function"?r:()=>r})}const Z2=ue("ZodPipe",(i,r)=>{_x.init(i,r),nt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>MC(i,a,o,g),i.in=r.in,i.out=r.out});function b_(i,r){return new Z2({type:"pipe",in:i,out:r})}const q2=ue("ZodReadonly",(i,r)=>{px.init(i,r),nt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>LC(i,a,o,g),i.unwrap=()=>i._zod.def.innerType});function F2(i){return new q2({type:"readonly",innerType:i})}const K2=ue("ZodCustom",(i,r)=>{vx.init(i,r),nt.init(i,r),i._zod.processJSONSchema=(a,o,g)=>bC(i,a)});function V2(i,r={}){return cC(K2,i,r)}function G2(i){return uC(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:zi()}),Y2=Xe({id:Re(),name:Re(),createdAt:Ce(),lastUsedAt:Ce(),rateLimit:Ce()}),W2=Xe({id:Re(),name:Re(),key:Re()}),X2=zu.extend({delivered:zi(),attempts:Ce()}),J2=Xe({status:Re(),version:Re(),uptime:Ce(),sessions:Xe({active:Ce(),total:Ce()}),timestamp:Re()}),jo=Xe({id:Re(),windowId:Re(),windowName:Re(),workDir:Re(),claudeSessionId:Re().optional(),jsonlPath:Re().optional(),byteOffset:Ce(),monitorOffset:Ce(),status:Bu,createdAt:Ce(),lastActivity:Ce(),stallThresholdMs:Ce(),permissionMode:Re(),autoApprove:zi().optional(),settingsPatched:zi().optional(),promptDelivery:Xe({delivered:zi(),attempts:Ce()}).optional(),actionHints:No(Re(),Xe({method:Re(),url:Re(),description:Re()})).optional()}),Q2=Xe({sessions:Kn(jo),pagination:Xe({page:Ce(),limit:Ce(),total:Ce(),totalPages:Ce()})}),ew=Xe({alive:zi(),windowExists:zi(),claudeRunning:zi(),paneCommand:Re().nullable(),status:Bu,hasTranscript:zi(),lastActivity:Ce(),lastActivityAgo:Ce(),sessionAge:Ce(),details:Re(),actionHints:No(Re(),Xe({method:Re(),url:Re(),description:Re()})).optional()}),tw=Xe({durationSec:Ce(),messages:Ce(),toolCalls:Ce(),approvals:Ce(),autoApprovals:Ce(),statusChanges:Kn(Re())}),ds=Xe({min:Ce().nullable(),max:Ce().nullable(),avg:Ce().nullable(),count:Ce()}),iw=Xe({sessionId:Re(),realtime:Xe({hook_latency_ms:Ce().nullable(),state_change_detection_ms:Ce().nullable(),permission_response_ms:Ce().nullable()}).nullable(),aggregated:Xe({hook_latency_ms:ds,state_change_detection_ms:ds,permission_response_ms:ds,channel_delivery_ms:ds}).nullable()}),sw=Xe({role:Br(["user","assistant","system"]),contentType:Br(["text","thinking","tool_use","tool_result","permission_request"]),text:Re(),toolName:Re().optional(),toolUseId:Re().optional(),timestamp:Re().optional()}),rw=Xe({messages:Kn(sw),status:Bu,statusText:Re().nullable(),interactiveContent:Re().nullable()}),nw=Xe({uptime:Ce(),sessions:Xe({total_created:Ce(),currently_active:Ce(),completed:Ce(),failed:Ce(),avg_duration_sec:Ce(),avg_messages_per_session:Ce()}),auto_approvals:Ce(),webhooks_sent:Ce(),webhooks_failed:Ce(),screenshots_taken:Ce(),pipelines_created:Ce(),batches_created:Ce(),prompt_delivery:Xe({sent:Ce(),delivered:Ce(),failed:Ce(),success_rate:Ce().nullable()}),latency:Xe({hook_latency_ms:ds,state_change_detection_ms:ds,permission_response_ms:ds,channel_delivery_ms:ds})}),aw=Br(["status","message","approval","ended","heartbeat","stall","dead","system","hook","subagent_start","subagent_stop"]),ow=Xe({event:aw,sessionId:Re(),timestamp:Re(),data:No(Re(),wo()).optional()}),lw=Br(["session_status_change","session_message","session_approval","session_ended","session_created","session_stall","session_dead","session_subagent_start","session_subagent_stop"]),cw=Xe({event:lw,sessionId:Re(),timestamp:Re(),data:No(Re(),wo())}),uw=3e4,hw=300*1e3;class Eo{constructor(r,a,o={}){dt(this,"eventSource",null);dt(this,"consecutiveFailures",0);dt(this,"failStartTime",null);dt(this,"destroyed",!1);dt(this,"gaveUp",!1);dt(this,"reconnectTimer",null);dt(this,"url");dt(this,"callbacks");dt(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,l,h;if(this.destroyed)return;if((a=this.eventSource)==null||a.close(),this.eventSource=null,this.failStartTime===null&&(this.failStartTime=Date.now()),Date.now()-this.failStartTime>=hw){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(uw,1e3*Math.pow(2,this.consecutiveFailures-1));(h=(l=this.callbacks).onReconnecting)==null||h.call(l,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 fw="",S_=["idle","working","compacting","context_warning","waiting_for_input","permission_prompt","plan_mode","ask_question","bash_approval","settings","error","unknown"];function dw(i){if(!i)return{};if(i instanceof Headers){const r={};return i.forEach((a,o)=>{r[o]=a}),r}return i}function mw(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 _w(i){return!(i.name==="AbortError"||!i.message||i.message.includes("HTTP "))}async function Pe(i,r={}){const a=localStorage.getItem("aegis_token"),o={"Content-Type":"application/json",...a?{Authorization:`Bearer ${a}`}:{},...dw(r.headers)},{retries:g=0,schema:k,schemaContext:T,...l}=r;let h=null;for(let u=0;u<=g;u++)try{const y=await fetch(`${fw}${i}`,{...l,headers:o});if(!y.ok){const x=await y.json().catch(()=>({error:y.statusText})),E=new Error(x.error??`HTTP ${y.status}`);throw E.statusCode=y.status,E}const d=await y.json();return k?mw(d,k,T??i):d}catch(y){if(h=y,u<g&&_w(h))await new Promise(d=>setTimeout(d,1e3*Math.pow(2,u)));else throw h}throw h}function pw(){return Pe("/v1/health",{schema:J2,schemaContext:"getHealth"})}function vw(){return Pe("/v1/metrics",{schema:nw,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 Pe(o,{schema:Q2,schemaContext:"getSessions"})}async function gw(){const i={all:0},[r,...a]=await Promise.all([gu({page:1,limit:1}),...S_.map(o=>gu({page:1,limit:1,status:o}))]);return i.all=r.pagination.total,S_.forEach((o,g)=>{var k;i[o]=((k=a[g])==null?void 0:k.pagination.total)??0}),i}function yw(i){return Pe(`/v1/sessions/${encodeURIComponent(i)}`,{schema:jo,schemaContext:"getSession"})}function bw(i){const{signal:r,...a}=i;return Pe("/v1/sessions",{method:"POST",body:JSON.stringify(a),signal:r,schema:jo,schemaContext:"createSession"})}function yu(i){return Pe(`/v1/sessions/${encodeURIComponent(i)}`,{method:"DELETE",schema:zu,schemaContext:"killSession"})}function Sw(i){return Pe(`/v1/sessions/${encodeURIComponent(i)}/health`,{schema:ew,schemaContext:"getSessionHealth"})}function xw(){return Pe("/v1/sessions/health")}function Cw(i){return Pe(`/v1/sessions/${encodeURIComponent(i)}/read`,{schema:rw,schemaContext:"getSessionMessages"})}function ww(i){return Pe(`/v1/sessions/${encodeURIComponent(i)}/metrics`,{schema:tw,schemaContext:"getSessionMetrics"})}function Ew(i){return Pe(`/v1/sessions/${encodeURIComponent(i)}/latency`,{schema:iw,schemaContext:"getSessionLatency"})}function kw(i){return Pe(`/v1/sessions/${encodeURIComponent(i)}/pane`)}function Tw(i,r){return Pe(`/v1/sessions/${encodeURIComponent(i)}/send`,{method:"POST",body:JSON.stringify({text:r}),schema:X2,schemaContext:"sendMessage"})}function Fp(i){return Pe(`/v1/sessions/${encodeURIComponent(i)}/approve`,{method:"POST"})}function Rw(i){return Pe(`/v1/sessions/${encodeURIComponent(i)}/reject`,{method:"POST"})}function bu(i){return Pe(`/v1/sessions/${encodeURIComponent(i)}/interrupt`,{method:"POST"})}function Aw(i){return Pe(`/v1/sessions/${encodeURIComponent(i)}/escape`,{method:"POST"})}function Dw(i,r={}){return Pe(`/v1/sessions/${encodeURIComponent(i)}/fork`,{method:"POST",body:JSON.stringify(r),schema:jo,schemaContext:"forkSession"})}const x_=3,Ow=1e3;async function Kp(i,r){for(let a=0;a<x_;a++){if(r!=null&&r.aborted)throw new DOMException("Aborted","AbortError");try{return await Iw(r)}catch{if(r!=null&&r.aborted)throw new DOMException("Aborted","AbortError");if(a<x_-1){const o=Ow*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 Vp(i,r,a,o){const g=`/v1/sessions/${encodeURIComponent(i)}/events`;let k=null,T=!1;const l=new AbortController;return a?Kp(o==null?void 0:o.onGiveUp,l.signal).then(h=>{if(T)return;const u=`${g}?token=${encodeURIComponent(h.token)}`;k=new Eo(u,r,o)}).catch(()=>{}):k=new Eo(g,r,o),()=>{T=!0,l.abort(),k==null||k.close()}}function Mw(i,r,a){const o="/v1/events";let g=null,k=!1;const T=new AbortController,l=h=>{try{const u=cw.safeParse(JSON.parse(h.data));if(!u.success){console.warn("Global SSE event failed validation",u.error.message);return}i(u.data)}catch{}};return r?Kp(a==null?void 0:a.onGiveUp,T.signal).then(h=>{if(k)return;const u=`${o}?token=${encodeURIComponent(h.token)}`;g=new Eo(u,l,a)}).catch(()=>{}):g=new Eo(o,l,a),()=>{var h;k=!0,T.abort(),(h=a==null?void 0:a.onClose)==null||h.call(a),g==null||g.close()}}function Lw(i,r){return Pe(`/v1/sessions/${encodeURIComponent(i)}/command`,{method:"POST",body:JSON.stringify({command:r})})}function Nw(i,r){return Pe(`/v1/sessions/${encodeURIComponent(i)}/bash`,{method:"POST",body:JSON.stringify({command:r})})}function jw(i){return Pe(`/v1/sessions/${encodeURIComponent(i)}/screenshot`,{method:"POST"})}function Bw(i){const{signal:r,...a}=i;return Pe("/v1/sessions/batch",{method:"POST",signal:r,body:JSON.stringify(a)})}function zw(i){return Pe("/v1/pipelines",{method:"POST",body:JSON.stringify(i)})}function Hw(){return Pe("/v1/pipelines")}function Uw(i){return Pe(`/v1/pipelines/${encodeURIComponent(i)}`)}function Iw(i){return Pe("/v1/auth/sse-token",{method:"POST",signal:i})}function $w(i){return Pe("/v1/auth/keys",{method:"POST",body:JSON.stringify({name:i}),schema:W2,schemaContext:"createAuthKey"})}function Pw(){return Pe("/v1/auth/keys",{schema:Kn(Y2),schemaContext:"getAuthKeys"})}function Zw(i){return Pe(`/v1/auth/keys/${encodeURIComponent(i)}`,{method:"DELETE",schema:zu,schemaContext:"revokeAuthKey"})}const mo=new Map;let qw=0;const Ui=mp(i=>({toasts:[],addToast:(r,a,o)=>{const g=`toast-${++qw}`,k=setTimeout(()=>{mo.delete(g),i(T=>({toasts:T.toasts.filter(l=>l.id!==g)}))},4e3);return mo.set(g,k),i(T=>({toasts:[...T.toasts,{id:g,type:r,title:a,description:o}]})),g},removeToast:r=>{const a=mo.get(r);a&&(clearTimeout(a),mo.delete(r)),i(o=>({toasts:o.toasts.filter(g=>g.id!==r)}))}})),Fw={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 Kw({id:i,type:r,title:a,description:o}){const g=Ui(k=>k.removeToast);return C.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 ${Fw[r]}`,children:[C.jsxs("div",{className:"flex-1 min-w-0",children:[C.jsx("p",{className:"text-sm font-medium",children:a}),o&&C.jsx("p",{className:"mt-0.5 text-xs opacity-80",children:o})]}),C.jsx("button",{onClick:()=>g(i),className:"shrink-0 rounded p-0.5 opacity-60 hover:opacity-100 transition-opacity","aria-label":"Dismiss",children:C.jsx(Ao,{className:"h-3.5 w-3.5"})})]})}function Vw(){const i=Ui(r=>r.toasts);return i.length===0?null:C.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=>C.jsx("div",{className:"pointer-events-auto",children:C.jsx(Kw,{id:r.id,type:r.type,title:r.title,description:r.description})},r.id))})}const Gw=[{to:"/",label:"Overview",icon:j1},{to:"/pipelines",label:"Pipelines",icon:lp},{to:"/auth/keys",label:"Auth Keys",icon:du}],Yw=5,Ww=1e3;function Xw(){const i=lt(u=>u.sseConnected),r=lt(u=>u.setSseConnected),a=lt(u=>u.sseError),o=lt(u=>u.setSseError),g=lt(u=>u.addActivity),k=lt(u=>u.token),T=P.useRef(null),[l,h]=P.useState(0);return P.useEffect(()=>{let u=!1,y,d=null;function x(E){if(!u)try{y=Mw(M=>{M.sessionId&&g(M)},k,{onOpen:()=>{T.current&&(clearTimeout(T.current),T.current=null),r(!0),o(null),h(0)},onClose:()=>{T.current=setTimeout(()=>{r(!1)},2e3)},onGiveUp:()=>{o("SSE connection failed — real-time updates unavailable"),r(!1)}})}catch(M){if(console.error("Failed to subscribe to global SSE (attempt %d):",E+1,M),E<Yw){const S=Ww*Math.pow(2,E);h(E+1),d=setTimeout(()=>x(E+1),S)}else o("SSE subscription failed after retries — real-time updates unavailable"),r(!1)}}return x(0),()=>{u=!0,T.current&&clearTimeout(T.current),d&&clearTimeout(d),y==null||y()}},[r,o,g,k]),C.jsxs("div",{className:"flex h-screen overflow-hidden bg-void",children:[C.jsxs("aside",{className:"flex w-56 flex-col border-r border-void-lighter bg-void-light shrink-0",children:[C.jsxs("div",{className:"flex items-center gap-2 px-4 py-5 border-b border-void-lighter",children:[C.jsx(Q1,{className:"h-6 w-6 text-blue-500"}),C.jsx("span",{className:"text-lg font-semibold tracking-tight text-gray-100",children:"Aegis"})]}),C.jsxs("nav",{className:"flex flex-col gap-1 px-2 py-4 flex-1",children:[Gw.map(({to:u,label:y,icon:d})=>C.jsxs(np,{to:u,end:u==="/",className:({isActive:x})=>`flex items-center gap-2.5 rounded-lg px-3 py-2 text-sm font-medium transition-colors ${x?"bg-cyan/10 text-cyan":"text-gray-400 hover:bg-void-lighter hover:text-gray-200"}`,children:[C.jsx(d,{className:"h-4 w-4"}),y]},u)),C.jsx("div",{className:"mt-4 border-t border-void-lighter pt-4 opacity-40",children:C.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:[C.jsx(sb,{className:"h-4 w-4"}),"Sessions"]})})]})]}),C.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[C.jsxs("header",{className:"flex items-center justify-between border-b border-void-lighter bg-void-light px-6 py-3 shrink-0",children:[C.jsx("h1",{className:"text-sm font-medium text-gray-300",children:"Aegis Dashboard"}),C.jsx("div",{className:"flex items-center gap-3",children:C.jsx("div",{className:"flex items-center gap-1.5 text-xs text-gray-500",title:a??void 0,children:a?C.jsxs(C.Fragment,{children:[C.jsx(dp,{className:"h-3 w-3 text-amber-500"}),C.jsxs("span",{className:"text-amber-500",children:["SSE Error",l>0?` (retry ${l})`:""]})]}):C.jsxs(C.Fragment,{children:[C.jsx("span",{className:`status-dot ${i?"status-dot--idle":""}`,style:i?void 0:{backgroundColor:"#666"}}),i?"SSE Live":"SSE Off"]})})})]}),C.jsx("main",{className:"flex-1 overflow-auto p-6",children:C.jsx(Ey,{})})]}),C.jsx(Vw,{})]})}function Jw(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 Qw(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 eE=15e3,tE=6e4;function iE(i){return new Date(i).toLocaleString()}function sE(i){return i.length<=12?"•".repeat(i.length):`${i.slice(0,8)}${"•".repeat(Math.max(8,i.length-12))}${i.slice(-4)}`}function rE(){const[i,r]=P.useState([]),[a,o]=P.useState(!0),[g,k]=P.useState(null),[T,l]=P.useState(""),[h,u]=P.useState(!1),[y,d]=P.useState(!1),[x,E]=P.useState(null),[M,S]=P.useState(null),[_,p]=P.useState(!1),f=Ui(O=>O.addToast),v=P.useCallback(async(O=!1)=>{O?d(!0):o(!0);try{const w=await Pw();r(w.slice().sort((j,I)=>I.createdAt-j.createdAt)),k(null)}catch(w){const j=w instanceof Error?w.message:"Failed to load auth keys";k(j),f("error","Failed to load auth keys",j)}finally{O?d(!1):o(!1)}},[f]);P.useEffect(()=>{v();const O=setInterval(()=>{v(!0)},eE);return()=>clearInterval(O)},[v]),P.useEffect(()=>{if(!M)return;const O=setTimeout(()=>{S(null),p(!1)},tE);return()=>clearTimeout(O)},[M]);async function b(O){O.preventDefault();const w=T.trim();if(w){u(!0);try{const j=await $w(w);S(j),p(!1),l(""),f("success","Auth key created","Store the secret now. It is only shown once."),await v(!0)}catch(j){f("error","Failed to create auth key",j instanceof Error?j.message:void 0)}finally{u(!1)}}}async function R(){var O;if(M)try{if(!((O=navigator.clipboard)!=null&&O.writeText))throw new Error("Clipboard access is unavailable in this browser");await navigator.clipboard.writeText(M.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(O,w){if(window.confirm(`Revoke auth key "${w}"? This cannot be undone.`)){E(O);try{await Zw(O),r(j=>j.filter(I=>I.id!==O)),(M==null?void 0:M.id)===O&&(S(null),p(!1)),f("success","Auth key revoked")}catch(j){f("error","Failed to revoke auth key",j instanceof Error?j.message:void 0)}finally{E(null)}}}return C.jsxs("div",{className:"flex flex-col gap-6",children:[C.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[C.jsxs("div",{children:[C.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"Auth Keys"}),C.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Create, review, and revoke dashboard API keys without exposing stored secrets."})]}),C.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:[C.jsx(fp,{className:`h-3.5 w-3.5 ${y?"animate-spin":""}`}),"Refresh"]})]}),C.jsxs("div",{className:"grid gap-6 xl:grid-cols-[minmax(0,360px)_minmax(0,1fr)]",children:[C.jsxs("section",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-5",children:[C.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-gray-100",children:[C.jsx(Fn,{className:"h-4 w-4 text-[#00e5ff]"}),"Create Key"]}),C.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."}),C.jsxs("form",{className:"mt-4 space-y-4",onSubmit:b,children:[C.jsxs("div",{children:[C.jsx("label",{className:"mb-1.5 block text-xs font-medium text-gray-400",htmlFor:"auth-key-name",children:"Key Name"}),C.jsx("input",{id:"auth-key-name",type:"text",value:T,onChange:O=>l(O.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"})]}),C.jsxs("button",{type:"submit",disabled:h||!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:[C.jsx(du,{className:"h-4 w-4"}),h?"Creating…":"Create Auth Key"]})]}),M?C.jsxs("div",{className:"mt-5 rounded-lg border border-emerald-500/20 bg-emerald-500/5 p-4",role:"status",children:[C.jsxs("div",{className:"flex items-start justify-between gap-3",children:[C.jsxs("div",{children:[C.jsx("h3",{className:"text-sm font-semibold text-emerald-300",children:"Store this key now"}),C.jsx("p",{className:"mt-1 text-xs text-emerald-200/80",children:"This secret is shown once and is hidden by default."})]}),C.jsx("button",{type:"button",onClick:()=>{S(null),p(!1)},className:"text-xs font-medium text-emerald-200/80 transition-colors hover:text-emerald-200",children:"Dismiss"})]}),C.jsxs("dl",{className:"mt-4 space-y-3 text-sm text-gray-200",children:[C.jsxs("div",{children:[C.jsx("dt",{className:"text-xs uppercase tracking-wide text-gray-500",children:"Name"}),C.jsx("dd",{className:"mt-1 font-medium text-gray-100",children:M.name})]}),C.jsxs("div",{children:[C.jsx("dt",{className:"text-xs uppercase tracking-wide text-gray-500",children:"Secret"}),C.jsx("dd",{className:"mt-1 rounded border border-[#1a1a2e] bg-[#0a0a0f] px-3 py-2 font-mono text-xs text-[#9af5ff]",children:_?M.key:sE(M.key)})]})]}),C.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[C.jsxs("button",{type:"button",onClick:()=>p(O=>!O),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:[_?C.jsx(R1,{className:"h-3.5 w-3.5"}):C.jsx(D1,{className:"h-3.5 w-3.5"}),_?"Hide secret":"Reveal secret"]}),C.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:[C.jsx(w1,{className:"h-3.5 w-3.5"}),"Copy secret"]})]})]}):null]}),C.jsxs("section",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-5",children:[C.jsx("div",{className:"flex items-center justify-between gap-3 border-b border-[#1a1a2e] pb-4",children:C.jsxs("div",{children:[C.jsx("h3",{className:"text-sm font-semibold text-gray-100",children:"Existing Keys"}),C.jsxs("p",{className:"mt-1 text-xs text-gray-500",children:[i.length," key",i.length===1?"":"s"," configured"]})]})}),a?C.jsx("div",{className:"flex min-h-[240px] items-center justify-center text-sm text-gray-500",children:C.jsx("div",{className:"animate-pulse",children:"Loading auth keys…"})}):g?C.jsxs("div",{className:"mt-4 rounded-lg border border-amber-500/20 bg-amber-500/5 p-4 text-sm text-amber-200",children:[C.jsx("p",{className:"font-medium",children:"Unable to load auth keys"}),C.jsx("p",{className:"mt-1 text-amber-200/80",children:g}),C.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?C.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:[C.jsx(du,{className:"h-8 w-8 text-gray-600"}),C.jsx("p",{className:"mt-4 text-sm font-medium text-gray-300",children:"No auth keys yet"}),C.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."})]}):C.jsx("div",{className:"mt-4 space-y-3",children:i.map(O=>C.jsx("article",{className:"rounded-lg border border-[#1a1a2e] bg-[#0a0a0f] p-4",children:C.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[C.jsxs("div",{className:"min-w-0",children:[C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("span",{className:"truncate font-medium text-gray-100",children:O.name}),C.jsx("span",{className:"rounded-full border border-[#1a1a2e] bg-[#111118] px-2 py-0.5 font-mono text-[11px] text-gray-500",children:O.id})]}),C.jsxs("p",{className:"mt-2 text-sm text-gray-400",children:["Created ",C.jsx("span",{title:iE(O.createdAt),children:Zs(O.createdAt)})]})]}),C.jsxs("button",{type:"button",onClick:()=>void A(O.id,O.name),disabled:x===O.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:[C.jsx(Ru,{className:"h-3.5 w-3.5"}),x===O.id?"Revoking…":"Revoke"]})]})},O.id))})]})]})]})}function ui({label:i,value:r,icon:a,suffix:o}){return C.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-4",children:[C.jsxs("div",{className:"mb-2 flex items-center gap-2 text-sm text-[#888]",children:[a,i]}),C.jsxs("div",{className:"font-mono text-2xl text-[#3b82f6]",children:[r,o&&C.jsx("span",{className:"ml-1 text-base text-[#666]",children:o})]})]})}function nE(){var M,S,_;const i=lt(p=>p.metrics),r=lt(p=>p.sseConnected),a=lt(p=>p.setMetrics),[o,g]=P.useState(null),k=P.useCallback(async()=>{try{const[p,f]=await Promise.all([vw(),pw()]);a(p),g(f)}catch(p){Ui.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,l=(i==null?void 0:i.sessions.total_created)??(o==null?void 0:o.sessions.total)??0,h=i==null?void 0:i.prompt_delivery.success_rate,u=(o==null?void 0:o.uptime)??(i==null?void 0:i.uptime)??0,y=((M=i==null?void 0:i.latency)==null?void 0:M.hook_latency_ms.avg)??null,d=((S=i==null?void 0:i.latency)==null?void 0:S.permission_response_ms.avg)??null,x=((_=i==null?void 0:i.latency)==null?void 0:_.channel_delivery_ms.avg)??null,E=p=>p===null?"—":`${Math.round(p)} ms`;return C.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-3 xl:grid-cols-4",children:[C.jsx(ui,{label:"Active Sessions",value:T,icon:C.jsx(lp,{className:"h-4 w-4"})}),C.jsx(ui,{label:"Total Created",value:l,icon:C.jsx(L1,{className:"h-4 w-4"})}),C.jsx(ui,{label:"Delivery Rate",value:h!=null?h.toFixed(1):"—",suffix:"%",icon:C.jsx(fb,{className:"h-4 w-4"})}),C.jsx(ui,{label:"Avg Hook Latency",value:E(y),icon:C.jsx(Hn,{className:"h-4 w-4"})}),C.jsx(ui,{label:"Avg Permission Latency",value:E(d),icon:C.jsx(Hn,{className:"h-4 w-4"})}),C.jsx(ui,{label:"Avg Channel Latency",value:E(x),icon:C.jsx(Hn,{className:"h-4 w-4"})}),C.jsx(ui,{label:"Uptime",value:Jw(u),icon:C.jsx(Hn,{className:"h-4 w-4"})})]})}const C_={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"},aE=new Set(["working","permission_prompt","bash_approval","ask_question"]),w_={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 Bo({status:i}){const r=C_[i]??C_.unknown,a=aE.has(i),o=w_[i]??w_.unknown;return C.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 oE=5e3,E_=20,k_=100,lE={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},T_=["all","idle","working","compacting","context_warning","waiting_for_input","permission_prompt","plan_mode","ask_question","bash_approval","settings","error","unknown"],Gp=i=>i.status==="permission_prompt"||i.status==="bash_approval",Yp=(i,r=40)=>i.length>r?`…${i.slice(i.length-r+1)}`:i;function R_(i){return i==="all"?"All":i.split("_").map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")}function cE(i,r){return r?`${i.windowName} ${i.id} ${i.workDir}`.toLowerCase().includes(r):!0}function uE(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 Wp(i,r){return uE(i.session,r.session)&&i.isAlive===r.isAlive&&i.selected===r.selected&&i.currentAction===r.currentAction}const hE=P.memo(function({session:r,isAlive:a,selected:o,currentAction:g,onToggleSelect:k,onApprove:T,onInterrupt:l,onKill:h}){return C.jsxs("div",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-4 transition-colors active:bg-[#1a1a2e]/50",children:[C.jsxs("div",{className:"mb-2 flex items-start justify-between gap-3",children:[C.jsxs("label",{className:"flex min-w-0 flex-1 items-center gap-3 text-sm text-gray-200",children:[C.jsx("input",{type:"checkbox","aria-label":`Select session ${r.windowName||r.id}`,checked:o,onChange:u=>k(r.id,u.target.checked),className:"h-4 w-4 rounded border border-void-lighter bg-void text-cyan focus:ring-1 focus:ring-cyan"}),C.jsxs("div",{className:"min-w-0",children:[C.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[C.jsx(Bo,{status:r.status}),C.jsx(hi,{to:`/sessions/${encodeURIComponent(r.id)}`,className:"truncate font-medium text-gray-200 transition-colors hover:text-cyan",children:r.windowName||r.id}),!a&&C.jsx(yo,{className:"h-3.5 w-3.5 shrink-0 text-red-400"})]}),C.jsx("div",{className:"mt-1 truncate font-mono text-xs text-gray-500",children:Yp(r.workDir,50)})]})]}),C.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[Gp(r)&&C.jsx("button",{onClick:u=>T(u,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:C.jsx(hp,{className:"h-4 w-4"})}),C.jsx("button",{onClick:u=>l(u,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:C.jsx(cp,{className:"h-4 w-4"})}),C.jsx("button",{onClick:u=>h(u,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:C.jsx(yo,{className:"h-4 w-4"})})]})]}),C.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs text-gray-500",children:[C.jsxs("span",{children:["Age: ",Zs(r.createdAt)]}),C.jsxs("span",{children:["Active: ",Zs(r.lastActivity)]}),r.permissionMode&&r.permissionMode!=="default"?C.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-green-900/30 px-2 py-0.5 text-green-400",children:[C.jsx(up,{className:"h-3 w-3"})," ",r.permissionMode]}):C.jsx("span",{className:"inline-flex items-center gap-1 rounded-full bg-void-lighter px-2 py-0.5 text-gray-500",children:"default"})]})]})},Wp),fE=P.memo(function({session:r,isAlive:a,selected:o,currentAction:g,onToggleSelect:k,onApprove:T,onInterrupt:l,onKill:h}){return C.jsxs("tr",{className:"border-b border-void-lighter/50 transition-colors hover:border-l-2 hover:border-l-cyan",children:[C.jsx("td",{className:"px-4 py-3",children:C.jsx("input",{type:"checkbox","aria-label":`Select session ${r.windowName||r.id}`,checked:o,onChange:u=>k(r.id,u.target.checked),className:"h-4 w-4 rounded border border-void-lighter bg-void text-cyan focus:ring-1 focus:ring-cyan"})}),C.jsx("td",{className:"px-4 py-3",children:C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx(Bo,{status:r.status}),!a&&C.jsx(yo,{className:"h-3.5 w-3.5 text-red-400"})]})}),C.jsx("td",{className:"px-4 py-3",children:C.jsx(hi,{to:`/sessions/${encodeURIComponent(r.id)}`,className:"font-medium text-gray-200 transition-colors hover:text-cyan",children:r.windowName||r.id})}),C.jsx("td",{className:"max-w-[200px] truncate px-4 py-3 font-mono text-xs text-gray-400",title:r.workDir,children:Yp(r.workDir)}),C.jsx("td",{className:"whitespace-nowrap px-4 py-3 text-gray-400",children:Zs(r.createdAt)}),C.jsx("td",{className:"whitespace-nowrap px-4 py-3 text-gray-400",children:Zs(r.lastActivity)}),C.jsx("td",{className:"px-4 py-3",children:r.permissionMode&&r.permissionMode!=="default"?C.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:[C.jsx(up,{className:"h-3 w-3"}),r.permissionMode]}):C.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"})}),C.jsx("td",{className:"px-4 py-3",children:C.jsxs("div",{className:"flex items-center gap-1.5",children:[Gp(r)&&C.jsx("button",{onClick:u=>T(u,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:C.jsx(hp,{className:"h-3 w-3"})}),C.jsx("button",{onClick:u=>l(u,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:C.jsx(cp,{className:"h-3 w-3"})}),C.jsx("button",{onClick:u=>h(u,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:C.jsx(yo,{className:"h-3 w-3"})})]})})]})},Wp);function dE(){const i=lt(B=>B.sessions),r=lt(B=>B.healthMap),a=lt(B=>B.sseConnected),o=lt(B=>B.setSessionsAndHealth),g=Ui(B=>B.addToast),[k,T]=P.useState({}),[l,h]=P.useState([]),[u,y]=P.useState(null),[d,x]=P.useState("all"),[E,M]=P.useState(lE),[S,_]=P.useState(""),p=P.useDeferredValue(S.trim().toLowerCase()),[f,v]=P.useState({page:1,limit:E_,total:0,totalPages:0}),[b,R]=P.useState(1),[A,O]=P.useState(!0),[w,j]=P.useState(!1),I=P.useCallback(async()=>{O(!0);try{const B=p.length>0,L=gu({page:B?1:b,limit:B?k_:E_,status:d==="all"?void 0:d}),[z,V]=await Promise.all([L,gw()]),Q=B?z.sessions.filter(de=>cE(de,p)):z.sessions;let fe={};try{const de=await xw(),G=new Set(Q.map(U=>U.id));for(const[U,le]of Object.entries(de))G.has(U)&&(fe[U]={alive:le.alive,loading:!1})}catch{}o(Q,fe),M(V),j(B&&z.pagination.total>z.sessions.length),v(B?{page:1,limit:Q.length,total:Q.length,totalPages:Q.length>0?1:0}:z.pagination)}catch(B){g("error","Failed to fetch sessions",B instanceof Error?B.message:void 0)}finally{O(!1)}},[g,p,b,o,d]);P.useEffect(()=>{if(I(),a)return;const B=setInterval(I,oE);return()=>clearInterval(B)},[I,a]),P.useEffect(()=>{const B=new Set(i.map(L=>L.id));h(L=>L.filter(z=>B.has(z)))},[i]);const Z=P.useCallback(async(B,L,z)=>{T(V=>({...V,[B]:L}));try{await z()}finally{T(V=>({...V,[B]:null}))}},[]),K=P.useCallback(async(B,L)=>{B.preventDefault(),await Z(L,"approve",async()=>{try{await Fp(L),await I()}catch(z){g("error","Approve failed",z instanceof Error?z.message:void 0)}})},[g,I,Z]),$=P.useCallback(async(B,L)=>{B.preventDefault(),await Z(L,"interrupt",async()=>{try{await bu(L),await I()}catch(z){g("error","Interrupt failed",z instanceof Error?z.message:void 0)}})},[g,I,Z]),X=P.useCallback(async(B,L)=>{B.preventDefault(),confirm("Kill this session?")&&await Z(L,"kill",async()=>{try{await yu(L),await I()}catch(z){g("error","Failed to kill session",z instanceof Error?z.message:void 0)}})},[g,I,Z]),re=P.useCallback((B,L)=>{h(z=>L?z.includes(B)?z:[...z,B]:z.filter(V=>V!==B))},[]),q=P.useCallback(B=>{if(!B){h([]);return}h(i.map(L=>L.id))},[i]),ee=P.useCallback(async B=>{if(l.length!==0&&!(B==="kill"&&!confirm(`Kill ${l.length} selected session${l.length===1?"":"s"}?`))){y(B),T(L=>{const z={...L};for(const V of l)z[V]=B;return z});try{const L=await Promise.allSettled(l.map(Q=>B==="interrupt"?bu(Q):yu(Q))),z=L.filter(Q=>Q.status==="fulfilled").length,V=L.length-z;z>0&&g("success",B==="interrupt"?"Bulk interrupt complete":"Bulk kill complete",`${z} session${z===1?"":"s"} updated.`),V>0&&g("warning",`Some sessions failed to ${B}`,`${V} session${V===1?"":"s"} could not be updated.`),h([]),await I()}finally{y(null),T(L=>{const z={...L};for(const V of l)z[V]=null;return z})}}},[g,I,l]),J=i.length>0&&i.every(B=>l.includes(B.id)),N=d!=="all"||p.length>0;return A&&i.length===0?C.jsx("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-12 text-center",children:C.jsx("p",{className:"text-gray-500",children:"Loading sessions..."})}):C.jsxs("div",{className:"space-y-4",children:[C.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-4",children:[C.jsxs("div",{className:"flex flex-col gap-4 xl:flex-row xl:items-start xl:justify-between",children:[C.jsxs("div",{className:"flex-1 space-y-3",children:[C.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-center",children:[C.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:[C.jsx(V1,{className:"h-4 w-4 text-gray-500"}),C.jsx("input",{value:S,onChange:B=>{_(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"})]}),C.jsxs("label",{className:"flex items-center gap-2 text-sm text-gray-400",children:[C.jsx("span",{children:"Status"}),C.jsx("select",{value:d,onChange:B=>{x(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:T_.map(B=>C.jsxs("option",{value:B,children:[R_(B)," (",E[B]??0,")"]},B))})]})]}),C.jsx("div",{className:"flex flex-wrap gap-2",children:T_.filter(B=>B==="all"||(E[B]??0)>0).map(B=>{const L=d===B;return C.jsxs("button",{type:"button",onClick:()=>{x(B),R(1)},className:`rounded-full border px-3 py-1 text-xs transition-colors ${L?"border-cyan bg-cyan/10 text-cyan":"border-void-lighter bg-void text-gray-400 hover:border-cyan/40 hover:text-gray-200"}`,children:[R_(B)," ",C.jsx("span",{className:"text-gray-500",children:E[B]??0})]},B)})})]}),C.jsxs("div",{className:"text-right text-xs text-gray-500",children:[C.jsxs("div",{children:["Showing ",C.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&&C.jsxs("div",{className:"mt-1 text-amber-400",children:["Search scans the first ",k_," sessions in the selected status."]})]})]}),l.length>0&&C.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:[C.jsxs("div",{className:"text-sm text-gray-300",children:[l.length," session",l.length===1?"":"s"," selected"]}),C.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[C.jsx("button",{type:"button",onClick:()=>ee("interrupt"),disabled:u!==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"}),C.jsx("button",{type:"button",onClick:()=>ee("kill"),disabled:u!==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"}),C.jsx("button",{type:"button",onClick:()=>h([]),disabled:u!==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?C.jsx("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-12 text-center",children:C.jsx("p",{className:"text-gray-400",children:N?"No sessions match the current filter.":"No active sessions"})}):C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:"space-y-3 md:hidden",children:[C.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:[C.jsxs("label",{className:"flex items-center gap-2",children:[C.jsx("input",{type:"checkbox","aria-label":"Select all visible sessions",checked:J,onChange:B=>q(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"]}),C.jsxs("span",{children:[i.length," visible"]})]}),i.map(B=>{const L=r[B.id],z=L?L.alive:!0;return C.jsx(hE,{session:B,isAlive:z,selected:l.includes(B.id),currentAction:k[B.id]??null,onToggleSelect:re,onApprove:K,onInterrupt:$,onKill:X},B.id)})]}),C.jsx("div",{className:"hidden overflow-x-auto rounded-lg border border-void-lighter bg-[#111118] md:block",children:C.jsxs("table",{className:"w-full text-left text-sm",children:[C.jsx("thead",{children:C.jsxs("tr",{className:"border-b border-void-lighter text-[#666]",children:[C.jsx("th",{className:"px-4 py-3 font-medium",children:C.jsx("input",{type:"checkbox","aria-label":"Select all visible sessions",checked:J,onChange:B=>q(B.target.checked),className:"h-4 w-4 rounded border border-void-lighter bg-void text-cyan focus:ring-1 focus:ring-cyan"})}),C.jsx("th",{className:"px-4 py-3 font-medium",children:"Status"}),C.jsx("th",{className:"px-4 py-3 font-medium",children:"Name"}),C.jsx("th",{className:"px-4 py-3 font-medium",children:"WorkDir"}),C.jsx("th",{className:"px-4 py-3 font-medium",children:"Age"}),C.jsx("th",{className:"px-4 py-3 font-medium",children:"Last Activity"}),C.jsx("th",{className:"px-4 py-3 font-medium",children:"Permission"}),C.jsx("th",{className:"px-4 py-3 font-medium",children:"Actions"})]})}),C.jsx("tbody",{children:i.map(B=>{const L=r[B.id],z=L?L.alive:!0;return C.jsx(fE,{session:B,isAlive:z,selected:l.includes(B.id),currentAction:k[B.id]??null,onToggleSelect:re,onApprove:K,onInterrupt:$,onKill:X},B.id)})})]})}),p.length===0&&f.totalPages>1&&C.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:[C.jsxs("span",{children:["Page ",f.page," of ",f.totalPages]}),C.jsxs("div",{className:"flex items-center gap-2",children:[C.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:[C.jsx(_1,{className:"h-4 w-4"})," Previous"]}),C.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 ",C.jsx(v1,{className:"h-4 w-4"})]})]})]})]})]})}const au={session_status_change:{icon:fp,label:"Status",color:"#3b82f6"},session_message:{icon:H1,label:"Message",color:"#10b981"},session_approval:{icon:X1,label:"Approval",color:"#f59e0b"},session_ended:{icon:q1,label:"Ended",color:"#ef4444"},session_created:{icon:b1,label:"Created",color:"#6366f1"},session_stall:{icon:dp,label:"Stall",color:"#d97706"},session_dead:{icon:tb,label:"Dead",color:"#dc2626"},session_subagent_start:{icon:cb,label:"Subagent",color:"#3b82f6"},session_subagent_stop:{icon:ob,label:"Subagent Done",color:"#10b981"}};function Ps(i,r="unknown"){return typeof i=="string"?i:r}function mE(i){const r=i.data;switch(i.event){case"session_status_change":{const a=Ps(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}: ${A_(o,80)}`}case"session_approval":{const a=typeof r.prompt=="string"?r.prompt:JSON.stringify(r.prompt??"");return`Approval needed: ${A_(a,80)}`}case"session_ended":return`Session ended: ${Ps(r.reason)}`;case"session_created":return`Created in ${Ps(r.workDir,"unknown dir")}`;case"session_stall":return`Session stalled: ${Ps(r.stallType)}`;case"session_dead":return`Session dead: ${Ps(r.stallType)}`;case"session_subagent_start":return`Subagent started: ${Ps(r.name)}`;case"session_subagent_stop":return`Subagent finished: ${Ps(r.name)}`;default:return JSON.stringify(r)}}function A_(i,r){return i.length>r?i.slice(0,r)+"...":i}function _E(i){try{return new Date(i).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return""}}function pE(){const i=lt(u=>u.activities),r=lt(u=>u.activityFilterSession),a=lt(u=>u.activityFilterType),o=lt(u=>u.setActivityFilterSession),g=lt(u=>u.setActivityFilterType),k=lt(u=>u.sessions),T=P.useMemo(()=>i.filter(u=>!(r&&u.sessionId!==r||a&&u.event!==a)),[i,r,a]),l=P.useMemo(()=>{const u=new Map;for(const y of k)u.set(y.id,y.windowName??y.id.slice(0,8));return u},[k]),h=u=>l.get(u)??(u??"unknown").slice(0,8);return C.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg w-full",children:[C.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:[C.jsx("h3",{className:"text-sm font-semibold text-gray-200",children:"Activity Stream"}),C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsxs("select",{value:r??"",onChange:u=>o(u.target.value||null),className:"min-h-[44px] text-xs bg-[#0a0a0f] border border-[#1a1a2e] rounded px-2 py-2 text-gray-400 focus:outline-none focus:border-[#3b82f6]",children:[C.jsx("option",{value:"",children:"All sessions"}),k.map(u=>C.jsx("option",{value:u.id,children:u.windowName||u.id.slice(0,8)},u.id))]}),C.jsxs("select",{value:a??"",onChange:u=>g(u.target.value||null),className:"min-h-[44px] text-xs bg-[#0a0a0f] border border-[#1a1a2e] rounded px-2 py-2 text-gray-400 focus:outline-none focus:border-[#3b82f6]",children:[C.jsx("option",{value:"",children:"All types"}),Object.entries(au).map(([u,y])=>C.jsx("option",{value:u,children:y.label},u))]}),(r||a)&&C.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:C.jsx(Ao,{className:"h-4 w-4"})})]})]}),C.jsxs("div",{className:"max-h-[360px] overflow-y-auto divide-y divide-[#1a1a2e]/50",children:[T.length===0&&C.jsx("div",{className:"px-4 py-8 text-center text-sm text-[#555]",children:"No activity yet"}),T.map((u,y)=>{const d=au[u.event]??au.session_status_change,x=d.icon;return C.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:[C.jsx(x,{className:"h-4 w-4 mt-0.5 shrink-0",style:{color:d.color}}),C.jsxs("div",{className:"flex-1 min-w-0",children:[C.jsxs("div",{className:"flex items-center gap-1.5 sm:gap-2",children:[C.jsx("span",{className:"text-xs font-medium text-gray-300 truncate",children:h(u.sessionId)}),C.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})]}),C.jsx("p",{className:"text-xs text-gray-500 mt-0.5 font-mono truncate",children:mE(u)})]}),C.jsx("span",{className:"text-[10px] text-[#444] shrink-0 tabular-nums mt-0.5",children:_E(u.timestamp)})]},`${u.sessionId}-${u.timestamp}-${y}`)})]})]})}const D_=[{label:"15m",seconds:900},{label:"1h",seconds:3600},{label:"4h",seconds:14400},{label:"8h",seconds:480*60}];function O_({value:i,onChange:r}){const a=i!==void 0&&!D_.some(l=>l.seconds===i),[o,g]=P.useState(a?String(Math.floor((i??0)/60)):"");function k(l){r(l),g("")}function T(l){const h=l.target.value;if(g(h),!h.trim())r(void 0);else{const u=parseInt(h,10);!isNaN(u)&&u>0&&r(u*60)}}return C.jsxs("div",{className:"space-y-3",children:[C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx(Hn,{className:"h-4 w-4 text-gray-500"}),C.jsxs("label",{className:"block text-xs font-medium text-gray-400",children:["Session TTL ",C.jsx("span",{className:"text-gray-600",children:"(optional)"})]})]}),C.jsx("div",{className:"grid grid-cols-4 gap-2",children:D_.map(l=>C.jsx("button",{type:"button",onClick:()=>k(l.seconds),className:`py-2 px-2 text-xs rounded transition-colors border ${i===l.seconds?"bg-[#00e5ff]/10 border-[#00e5ff] text-[#00e5ff]":"border-[#1a1a2e] text-gray-400 hover:text-gray-300 hover:border-[#2a2a3e]"}`,children:l.label},l.label))}),C.jsxs("div",{children:[C.jsx("input",{type:"number",value:o,onChange:T,placeholder:"Custom minutes…",min:"1",className:"w-full min-h-[44px] px-3 py-2.5 text-sm bg-[#0a0a0f] border border-[#1a1a2e] rounded text-gray-200 placeholder-gray-600 focus:outline-none focus:border-[#00e5ff]"}),o&&!isNaN(parseInt(o,10))&&C.jsx("p",{className:"text-xs text-gray-500 mt-1",children:M_(parseInt(o,10)*60)})]}),i!==void 0&&C.jsxs("p",{className:"text-xs text-gray-500",children:["TTL: ",M_(i)]})]})}function M_(i){if(i<60)return`${i}s`;if(i<3600)return`${Math.floor(i/60)}m`;const r=Math.floor(i/3600),a=Math.floor(i%3600/60);return a>0?`${r}h ${a}m`:`${r}h`}let vE=0;function jn(){return{workDir:"",name:"",prompt:"",_key:vE++}}function gE({open:i,onClose:r}){const a=To(),o=P.useRef(null),g=P.useRef(null),k=P.useCallback(()=>{re(),r()},[r]),T=P.useRef(null);P.useEffect(()=>{if(!i)return;const L=z=>{var V;z.key==="Escape"&&((V=g.current)==null||V.abort(),k())};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[i,k]),P.useEffect(()=>{if(!i)return;const L=T.current;if(!L)return;const z='input, textarea, select, button, [tabindex]:not([tabindex="-1"])',V=Q=>{if(Q.key!=="Tab")return;const fe=Array.from(L.querySelectorAll(z));if(fe.length===0)return;const de=fe[0],G=fe[fe.length-1];Q.shiftKey?document.activeElement===de&&(Q.preventDefault(),G.focus()):document.activeElement===G&&(Q.preventDefault(),de.focus())};return L.addEventListener("keydown",V),()=>L.removeEventListener("keydown",V)},[i]),P.useEffect(()=>{if(i){const L=setTimeout(()=>{var z;return(z=o.current)==null?void 0:z.focus()},50);return()=>clearTimeout(L)}},[i]);const[l,h]=P.useState(""),[u,y]=P.useState(""),[d,x]=P.useState(""),[E,M]=P.useState("default"),[S,_]=P.useState(void 0),[p,f]=P.useState(!1),[v,b]=P.useState(null),[R,A]=P.useState("single"),[O,w]=P.useState([jn(),jn()]),[j,I]=P.useState(""),[Z,K]=P.useState(void 0),[$,X]=P.useState(null);function re(){h(""),y(""),x(""),M("default"),_(void 0),f(!1),b(null),w([jn(),jn()]),I(""),K(void 0),X(null),A("single")}function q(){O.length>=10||w([...O,jn()])}function ee(L){O.length<=1||w(O.filter((z,V)=>V!==L))}function J(L,z,V){w(O.map((Q,fe)=>fe===L?{...Q,[z]:V}:Q))}async function N(L){var Q;L.preventDefault(),b(null),X(null);const z=O.filter(fe=>fe.workDir.trim());if(z.length===0){b("At least one working directory is required");return}f(!0),(Q=g.current)==null||Q.abort();const V=new AbortController;g.current=V;try{const fe=await Bw({sessions:z.map(de=>({workDir:de.workDir.trim(),name:de.name.trim()||void 0,prompt:de.prompt.trim()||j.trim()||void 0,permissionMode:E,ttl_seconds:Z})),signal:V.signal});X(fe)}catch(fe){if(V.signal.aborted)return;b(fe instanceof Error?fe.message:"Failed to create sessions")}finally{g.current===V&&(g.current=null,f(!1))}}if(!i)return null;async function B(L){var V;if(L.preventDefault(),b(null),!l.trim()){b("Working directory is required");return}f(!0),(V=g.current)==null||V.abort();const z=new AbortController;g.current=z;try{const Q=await bw({workDir:l.trim(),name:u.trim()||void 0,prompt:d.trim()||void 0,permissionMode:E,ttl_seconds:S,signal:z.signal});re(),r(),a(`/sessions/${Q.id}`)}catch(Q){if(z.signal.aborted)return;b(Q instanceof Error?Q.message:"Failed to create session")}finally{g.current===z&&(g.current=null,f(!1))}}return C.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[C.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:k}),C.jsxs("div",{ref:T,role:"dialog","aria-modal":"true","aria-label":"Create new session",className:`relative w-full ${R==="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:[C.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-5 py-4 border-b border-[#1a1a2e]",children:[C.jsxs("div",{className:"flex items-center gap-4",children:[C.jsx("h2",{className:"text-sm font-semibold text-gray-100",children:"New Session"}),C.jsxs("div",{className:"flex rounded bg-[#0a0a0f] p-0.5",children:[C.jsx("button",{type:"button",onClick:()=>A("single"),className:`px-3 py-1 text-xs rounded transition-colors ${R==="single"?"bg-[#3b82f6]/10 text-[#3b82f6]":"text-gray-500 hover:text-gray-300"}`,children:"Single"}),C.jsx("button",{type:"button",onClick:()=>A("batch"),className:`px-3 py-1 text-xs rounded transition-colors ${R==="batch"?"bg-[#3b82f6]/10 text-[#3b82f6]":"text-gray-500 hover:text-gray-300"}`,children:"Batch"})]})]}),C.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:C.jsx(Ao,{className:"h-4 w-4"})})]}),R==="single"&&C.jsxs("form",{onSubmit:B,className:"p-4 sm:p-5 space-y-4",children:[C.jsxs("div",{children:[C.jsxs("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:["Working Directory ",C.jsx("span",{className:"text-[#ef4444]",children:"*"})]}),C.jsx("input",{type:"text",ref:o,value:l,onChange:L=>h(L.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"})]}),C.jsxs("div",{children:[C.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Session Name"}),C.jsx("input",{type:"text",value:u,onChange:L=>y(L.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]"})]}),C.jsxs("div",{children:[C.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Initial Prompt"}),C.jsx("textarea",{value:d,onChange:L=>x(L.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"})]}),C.jsxs("div",{children:[C.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Permission Mode"}),C.jsxs("select",{value:E,onChange:L=>M(L.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:[C.jsx("option",{value:"default",children:"default - asks for everything"}),C.jsx("option",{value:"plan",children:"plan - auto-reads, asks for writes"}),C.jsx("option",{value:"acceptEdits",children:"acceptEdits - auto-edits, asks for bash"}),C.jsx("option",{value:"bypassPermissions",children:"bypassPermissions - never asks"}),C.jsx("option",{value:"auto",children:"auto - auto-approve in sandbox"})]})]}),C.jsx(O_,{value:S,onChange:_}),v&&C.jsx("div",{className:"text-xs text-[#ef4444] bg-[#ef4444]/10 border border-[#ef4444]/20 rounded px-3 py-2",children:v}),C.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[C.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"}),C.jsxs("button",{type:"submit",disabled:p||!l.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:[p&&C.jsx(mu,{className:"h-3 w-3 animate-spin"}),"Create Session"]})]})]}),R==="batch"&&!$&&C.jsxs("form",{onSubmit:N,className:"p-4 sm:p-5 space-y-4",children:[C.jsxs("div",{children:[C.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Shared Prompt"}),C.jsx("textarea",{value:j,onChange:L=>I(L.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"})]}),C.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 text-xs font-medium text-gray-500 px-1",children:[C.jsxs("span",{children:["Working Directory ",C.jsx("span",{className:"text-[#ef4444]",children:"*"})]}),C.jsx("span",{children:"Name"}),C.jsx("span",{children:"Prompt (override)"}),C.jsx("span",{})]}),C.jsx("div",{className:"space-y-2",children:O.map((L,z)=>C.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 items-start",children:[C.jsx("input",{type:"text",value:L.workDir,onChange:V=>J(z,"workDir",V.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"}),C.jsx("input",{type:"text",value:L.name,onChange:V=>J(z,"name",V.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]"}),C.jsx("input",{type:"text",value:L.prompt,onChange:V=>J(z,"prompt",V.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]"}),C.jsx("button",{type:"button",onClick:()=>ee(z),disabled:O.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:C.jsx(Ru,{className:"h-3.5 w-3.5"})})]},L._key))}),O.length<10&&C.jsxs("button",{type:"button",onClick:q,className:"flex items-center gap-1.5 text-xs text-gray-500 hover:text-gray-300 transition-colors",children:[C.jsx(Fn,{className:"h-3.5 w-3.5"}),"Add session"]}),C.jsxs("div",{children:[C.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Permission Mode"}),C.jsxs("select",{value:E,onChange:L=>M(L.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:[C.jsx("option",{value:"default",children:"default - asks for everything"}),C.jsx("option",{value:"plan",children:"plan - auto-reads, asks for writes"}),C.jsx("option",{value:"acceptEdits",children:"acceptEdits - auto-edits, asks for bash"}),C.jsx("option",{value:"bypassPermissions",children:"bypassPermissions - never asks"}),C.jsx("option",{value:"auto",children:"auto - auto-approve in sandbox"})]})]}),C.jsx(O_,{value:Z,onChange:K}),v&&C.jsx("div",{className:"text-xs text-[#ef4444] bg-[#ef4444]/10 border border-[#ef4444]/20 rounded px-3 py-2",children:v}),C.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[C.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"}),C.jsxs("button",{type:"submit",disabled:p||!O.some(L=>L.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:[p&&C.jsx(mu,{className:"h-3 w-3 animate-spin"}),"Create ",O.filter(L=>L.workDir.trim()).length," Session(s)"]})]})]}),$&&C.jsxs("div",{className:"p-4 sm:p-5 space-y-4",children:[C.jsxs("div",{className:"flex items-center gap-3",children:[$.created>0&&C.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:[$.created," created"]}),$.failed>0&&C.jsxs("span",{className:"text-xs font-medium text-[#ef4444] bg-[#ef4444]/10 border border-[#ef4444]/20 rounded px-3 py-1.5",children:[$.failed," failed"]})]}),$.sessions.length>0&&C.jsxs("div",{className:"space-y-1",children:[C.jsx("p",{className:"text-xs font-medium text-gray-400",children:"Created sessions"}),C.jsx("ul",{className:"space-y-1",children:$.sessions.map(L=>C.jsx("li",{children:C.jsxs("button",{type:"button",onClick:()=>{k(),a(`/sessions/${L.id}`)},className:"text-xs text-[#3b82f6] hover:underline font-mono",children:[L.id.slice(0,8),"...",L.name?` - ${L.name}`:""]})},L.id))})]}),$.errors.length>0&&C.jsxs("div",{className:"space-y-1",children:[C.jsx("p",{className:"text-xs font-medium text-gray-400",children:"Errors"}),C.jsx("ul",{className:"space-y-1",children:$.errors.map((L,z)=>C.jsx("li",{className:"text-xs text-[#ef4444]",children:L},z))})]}),C.jsx("div",{className:"flex justify-end pt-2",children:C.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 yE(){const[i,r]=P.useState(!1);return C.jsxs("div",{className:"flex flex-col gap-6",children:[C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsxs("div",{children:[C.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"Overview"}),C.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Aegis session monitoring and metrics"})]}),C.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:[C.jsx(Fn,{className:"h-3.5 w-3.5"}),"New Session"]})]}),C.jsx(nE,{}),C.jsxs("div",{children:[C.jsx("h3",{className:"mb-3 text-lg font-semibold text-gray-200",children:"Sessions"}),C.jsx(dE,{})]}),C.jsx(pE,{}),C.jsx(gE,{open:i,onClose:()=>r(!1)})]})}function L_(i){return i instanceof Error&&"statusCode"in i}function bE(i){const r=lt(J=>J.token),a=Ui(J=>J.addToast),[o,g]=P.useState(null),[k,T]=P.useState(null),[l,h]=P.useState(!1),[u,y]=P.useState(!0),[d,x]=P.useState(""),[E,M]=P.useState(!0),[S,_]=P.useState(null),[p,f]=P.useState(!0),[v,b]=P.useState(null),[R,A]=P.useState(!0),O=P.useRef(i);O.current=i;const w=P.useRef(!1),j=P.useRef(0),I=P.useRef(void 0),Z=P.useRef(void 0),K=P.useCallback(async()=>{try{const[J,N]=await Promise.allSettled([yw(O.current),Sw(O.current)]);if(J.status==="rejected"&&L_(J.reason)&&J.reason.statusCode===404||N.status==="rejected"&&L_(N.reason)&&N.reason.statusCode===404){h(!0);return}J.status==="fulfilled"&&g(J.value),N.status==="fulfilled"&&T(N.value)}catch(J){a("error","Failed to load session",J instanceof Error?J.message:void 0)}finally{y(!1)}},[a]);I.current=K;const $=P.useCallback(async()=>{if(w.current)return;const J=O.current;try{const N=await kw(J);w.current||x(N.pane??"")}catch(N){a("warning","Failed to load terminal pane",N instanceof Error?N.message:void 0)}finally{w.current||M(!1)}try{const N=await ww(J);w.current||_(N)}catch(N){a("warning","Failed to load session metrics",N instanceof Error?N.message:void 0)}finally{w.current||f(!1)}try{const N=await Ew(J);w.current||b(N)}catch(N){a("warning","Failed to load session latency",N instanceof Error?N.message:void 0)}finally{w.current||A(!1)}},[a]);Z.current=$,P.useEffect(()=>(w.current=!1,j.current++,y(!0),M(!0),f(!0),A(!0),K(),$(),()=>{w.current=!0,X.current&&clearTimeout(X.current),re.current&&clearTimeout(re.current)}),[i,K,$]);const X=P.useRef(void 0),re=P.useRef(void 0),q=P.useCallback(()=>{X.current&&clearTimeout(X.current);const J=j.current;X.current=setTimeout(()=>{var N;j.current===J&&((N=Z.current)==null||N.call(Z))},1e3)},[]),ee=P.useCallback(()=>{re.current&&clearTimeout(re.current);const J=j.current;re.current=setTimeout(()=>{var N;j.current===J&&((N=I.current)==null||N.call(I))},1e3)},[]);return P.useEffect(()=>{if(!i)return;const J=Vp(i,N=>{var B,L;try{const z=ow.safeParse(JSON.parse(N.data));if(!z.success){console.warn("SSE event failed validation",z.error.message);return}switch(z.data.event){case"status":case"approval":case"stall":case"dead":ee(),q();break;case"message":q();break;case"ended":(B=I.current)==null||B.call(I),(L=Z.current)==null||L.call(Z);break}}catch{}},r);return()=>J()},[i,r,ee,q]),{session:o,health:k,notFound:l,loading:u,paneContent:d,paneLoading:E,metrics:S,metricsLoading:p,latency:v,latencyLoading:R,refetchPaneAndMetrics:$}}const SE={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 N_(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 j_(i){return new Date(i).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function xE({session:i,health:r,onApprove:a,onReject:o,onInterrupt:g,onFork:k,onKill:T}){const[l,h]=P.useState(!1),u=r.status==="permission_prompt"||r.status==="bash_approval";return C.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg p-3 sm:p-4",children:[C.jsxs("div",{className:"flex items-start gap-3 mb-3",children:[C.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[C.jsx(Bo,{status:r.status}),C.jsx("span",{className:"text-sm font-medium text-[#e0e0e0]",children:SE[r.status]})]}),C.jsxs("div",{className:"flex-1 min-w-0",children:[C.jsx("h1",{className:"text-base sm:text-lg font-semibold text-[#e0e0e0] truncate",children:i.windowName||"Untitled Session"}),C.jsx("div",{className:"text-xs text-[#555] font-mono truncate mt-0.5",children:N_(i.workDir,40)})]}),C.jsxs("div",{className:"hidden sm:flex items-center gap-2 shrink-0",children:[i.permissionMode&&i.permissionMode!=="default"&&C.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?C.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"}):C.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"})]})]}),C.jsxs("div",{className:"flex items-center gap-3 sm:gap-4 text-[11px] text-[#555] mb-3 flex-wrap",children:[C.jsxs("span",{children:["Created: ",j_(i.createdAt)]}),C.jsxs("span",{className:"hidden sm:inline",children:["Last activity: ",j_(i.lastActivity)]}),C.jsxs("span",{className:"font-mono hidden sm:inline",children:["ID: ",N_(i.id,16)]}),r.details&&C.jsx("span",{className:"text-[#888] italic",children:r.details})]}),C.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u&&C.jsxs(C.Fragment,{children:[C.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"}),C.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"})]}),C.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"}),C.jsx("button",{onClick:k,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:"Fork"}),l?C.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[C.jsx("span",{className:"text-xs text-[#ef4444]",children:"Confirm kill?"}),C.jsx("button",{onClick:()=>{T==null||T(),h(!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"}),C.jsx("button",{onClick:()=>h(!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"})]}):C.jsx("button",{onClick:()=>h(!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 ou={exports:{}},B_;function CE(){return B_||(B_=1,(function(i,r){(function(a,o){i.exports=o()})(globalThis,(()=>(()=>{var a={4567:function(T,l,h){var u=this&&this.__decorate||function(f,v,b,R){var A,O=arguments.length,w=O<3?v:R===null?R=Object.getOwnPropertyDescriptor(v,b):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(f,v,b,R);else for(var j=f.length-1;j>=0;j--)(A=f[j])&&(w=(O<3?A(w):O>3?A(v,b,w):A(v,b))||w);return O>3&&w&&Object.defineProperty(v,b,w),w},y=this&&this.__param||function(f,v){return function(b,R){v(b,R,f)}};Object.defineProperty(l,"__esModule",{value:!0}),l.AccessibilityManager=void 0;const d=h(9042),x=h(9924),E=h(844),M=h(4725),S=h(2585),_=h(3656);let p=l.AccessibilityManager=class extends E.Disposable{constructor(f,v,b,R){super(),this._terminal=f,this._coreBrowserService=b,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 x.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,_.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 b=this._terminal.buffer,R=b.lines.length.toString();for(let A=f;A<=v;A++){const O=b.lines.get(b.ydisp+A),w=[],j=(O==null?void 0:O.translateToString(!0,void 0,void 0,w))||"",I=(b.ydisp+A+1).toString(),Z=this._rowElements[A];Z&&(j.length===0?(Z.innerText=" ",this._rowColumns.set(Z,[0,1])):(Z.textContent=j,this._rowColumns.set(Z,w)),Z.setAttribute("aria-posinset",I),Z.setAttribute("aria-setsize",R))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(f,v){const b=f.target,R=this._rowElements[v===0?1:this._rowElements.length-2];if(b.getAttribute("aria-posinset")===(v===0?"1":`${this._terminal.buffer.lines.length}`)||f.relatedTarget!==R)return;let A,O;if(v===0?(A=b,O=this._rowElements.pop(),this._rowContainer.removeChild(O)):(A=this._rowElements.shift(),O=b,this._rowContainer.removeChild(A)),A.removeEventListener("focus",this._topBoundaryFocusListener),O.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 j;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},b={node:f.focusNode,offset:f.focusOffset};if((v.node.compareDocumentPosition(b.node)&Node.DOCUMENT_POSITION_PRECEDING||v.node===b.node&&v.offset>b.offset)&&([v,b]=[b,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(b.node.compareDocumentPosition(R)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(b={node:R,offset:((j=R.textContent)==null?void 0:j.length)??0}),!this._rowContainer.contains(b.node))return;const A=({node:I,offset:Z})=>{const K=I instanceof Text?I.parentNode:I;let $=parseInt(K==null?void 0:K.getAttribute("aria-posinset"),10)-1;if(isNaN($))return console.warn("row is invalid. Race condition?"),null;const X=this._rowColumns.get(K);if(!X)return console.warn("columns is null. Race condition?"),null;let re=Z<X.length?X[Z]:X.slice(-1)[0]+1;return re>=this._terminal.cols&&(++$,re=0),{row:$,column:re}},O=A(v),w=A(b);if(O&&w){if(O.row>w.row||O.row===w.row&&O.column>=w.column)throw new Error("invalid range");this._terminal.select(O.column,O.row,(w.row-O.row)*this._terminal.cols-O.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`}};l.AccessibilityManager=p=u([y(1,S.IInstantiationService),y(2,M.ICoreBrowserService),y(3,M.IRenderService)],p)},3614:(T,l)=>{function h(x){return x.replace(/\r?\n/g,"\r")}function u(x,E){return E?"\x1B[200~"+x+"\x1B[201~":x}function y(x,E,M,S){x=u(x=h(x),M.decPrivateModes.bracketedPasteMode&&S.rawOptions.ignoreBracketedPasteMode!==!0),M.triggerDataEvent(x,!0),E.value=""}function d(x,E,M){const S=M.getBoundingClientRect(),_=x.clientX-S.left-10,p=x.clientY-S.top-10;E.style.width="20px",E.style.height="20px",E.style.left=`${_}px`,E.style.top=`${p}px`,E.style.zIndex="1000",E.focus()}Object.defineProperty(l,"__esModule",{value:!0}),l.rightClickHandler=l.moveTextAreaUnderMouseCursor=l.paste=l.handlePasteEvent=l.copyHandler=l.bracketTextForPaste=l.prepareTextForTerminal=void 0,l.prepareTextForTerminal=h,l.bracketTextForPaste=u,l.copyHandler=function(x,E){x.clipboardData&&x.clipboardData.setData("text/plain",E.selectionText),x.preventDefault()},l.handlePasteEvent=function(x,E,M,S){x.stopPropagation(),x.clipboardData&&y(x.clipboardData.getData("text/plain"),E,M,S)},l.paste=y,l.moveTextAreaUnderMouseCursor=d,l.rightClickHandler=function(x,E,M,S,_){d(x,E,M),_&&S.rightClickSelect(x),E.value=S.selectionText,E.select()}},7239:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorContrastCache=void 0;const u=h(1505);l.ColorContrastCache=class{constructor(){this._color=new u.TwoKeyMap,this._css=new u.TwoKeyMap}setCss(y,d,x){this._css.set(y,d,x)}getCss(y,d){return this._css.get(y,d)}setColor(y,d,x){this._color.set(y,d,x)}getColor(y,d){return this._color.get(y,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.addDisposableDomListener=void 0,l.addDisposableDomListener=function(h,u,y,d){h.addEventListener(u,y,d);let x=!1;return{dispose:()=>{x||(x=!0,h.removeEventListener(u,y,d))}}}},3551:function(T,l,h){var u=this&&this.__decorate||function(p,f,v,b){var R,A=arguments.length,O=A<3?f:b===null?b=Object.getOwnPropertyDescriptor(f,v):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(p,f,v,b);else for(var w=p.length-1;w>=0;w--)(R=p[w])&&(O=(A<3?R(O):A>3?R(f,v,O):R(f,v))||O);return A>3&&O&&Object.defineProperty(f,v,O),O},y=this&&this.__param||function(p,f){return function(v,b){f(v,b,p)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Linkifier=void 0;const d=h(3656),x=h(8460),E=h(844),M=h(2585),S=h(4725);let _=l.Linkifier=class extends E.Disposable{get currentLink(){return this._currentLink}constructor(p,f,v,b,R){super(),this._element=p,this._mouseService=f,this._renderService=v,this._bufferService=b,this._linkProviderService=R,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new x.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new x.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 b=0;b<v.length;b++){const R=v[b];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 b,R;this._activeProviderReplies&&f||((b=this._activeProviderReplies)==null||b.forEach((A=>{A==null||A.forEach((O=>{O.link.dispose&&O.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=p.y);let v=!1;for(const[A,O]of this._linkProviderService.linkProviders.entries())f?(R=this._activeProviderReplies)!=null&&R.get(A)&&(v=this._checkLinkProviderResult(A,p,v)):O.provideLinks(p.y,(w=>{var I,Z;if(this._isMouseOut)return;const j=w==null?void 0:w.map((K=>({link:K})));(I=this._activeProviderReplies)==null||I.set(A,j),v=this._checkLinkProviderResult(A,p,v),((Z=this._activeProviderReplies)==null?void 0:Z.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(p.y,this._activeProviderReplies)}))}_removeIntersectingLinks(p,f){const v=new Set;for(let b=0;b<f.size;b++){const R=f.get(b);if(R)for(let A=0;A<R.length;A++){const O=R[A],w=O.link.range.start.y<p?0:O.link.range.start.x,j=O.link.range.end.y>p?this._bufferService.cols:O.link.range.end.x;for(let I=w;I<=j;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 b=this._activeProviderReplies.get(p);let R=!1;for(let O=0;O<p;O++)this._activeProviderReplies.has(O)&&!this._activeProviderReplies.get(O)||(R=!0);if(!R&&b){const O=b.find((w=>this._linkAtPosition(w.link,f)));O&&(v=!0,this._handleNewLink(O))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!v)for(let O=0;O<this._activeProviderReplies.size;O++){const w=(A=this._activeProviderReplies.get(O))==null?void 0:A.find((j=>this._linkAtPosition(j.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,b;return(b=(v=this._currentLink)==null?void 0:v.state)==null?void 0:b.decorations.pointerCursor},set:v=>{var b;(b=this._currentLink)!=null&&b.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,b;return(b=(v=this._currentLink)==null?void 0:v.state)==null?void 0:b.decorations.underline},set:v=>{var b,R,A;(b=this._currentLink)!=null&&b.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 b=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>=b&&this._currentLink.link.range.end.y<=R&&(this._clearCurrentLink(b,R),this._lastMouseEvent)){const A=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);A&&this._askForLink(A,!1)}}))))}_linkHover(p,f,v){var b;(b=this._currentLink)!=null&&b.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,b=this._bufferService.buffer.ydisp,R=this._createLinkUnderlineEvent(v.start.x-1,v.start.y-b-1,v.end.x,v.end.y-b-1,void 0);(f?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(R)}_linkLeave(p,f,v){var b;(b=this._currentLink)!=null&&b.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,b=p.range.end.y*this._bufferService.cols+p.range.end.x,R=f.y*this._bufferService.cols+f.x;return v<=R&&R<=b}_positionFromMouseEvent(p,f,v){const b=v.getCoords(p,f,this._bufferService.cols,this._bufferService.rows);if(b)return{x:b[0],y:b[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(p,f,v,b,R){return{x1:p,y1:f,x2:v,y2:b,cols:this._bufferService.cols,fg:R}}};l.Linkifier=_=u([y(1,S.IMouseService),y(2,S.IRenderService),y(3,M.IBufferService),y(4,S.ILinkProviderService)],_)},9042:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.tooMuchOutput=l.promptLabel=void 0,l.promptLabel="Terminal input",l.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(T,l,h){var u=this&&this.__decorate||function(S,_,p,f){var v,b=arguments.length,R=b<3?_:f===null?f=Object.getOwnPropertyDescriptor(_,p):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(S,_,p,f);else for(var A=S.length-1;A>=0;A--)(v=S[A])&&(R=(b<3?v(R):b>3?v(_,p,R):v(_,p))||R);return b>3&&R&&Object.defineProperty(_,p,R),R},y=this&&this.__param||function(S,_){return function(p,f){_(p,f,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkProvider=void 0;const d=h(511),x=h(2585);let E=l.OscLinkProvider=class{constructor(S,_,p){this._bufferService=S,this._optionsService=_,this._oscLinkService=p}provideLinks(S,_){var j;const p=this._bufferService.buffer.lines.get(S-1);if(!p)return void _(void 0);const f=[],v=this._optionsService.rawOptions.linkHandler,b=new d.CellData,R=p.getTrimmedLength();let A=-1,O=-1,w=!1;for(let I=0;I<R;I++)if(O!==-1||p.hasContent(I)){if(p.loadCell(I,b),b.hasExtendedAttrs()&&b.extended.urlId){if(O===-1){O=I,A=b.extended.urlId;continue}w=b.extended.urlId!==A}else O!==-1&&(w=!0);if(w||O!==-1&&I===R-1){const Z=(j=this._oscLinkService.getLinkData(A))==null?void 0:j.uri;if(Z){const K={start:{x:O+1,y:S},end:{x:I+(w||I!==R-1?0:1),y:S}};let $=!1;if(!(v!=null&&v.allowNonHttpProtocols))try{const X=new URL(Z);["http:","https:"].includes(X.protocol)||($=!0)}catch{$=!0}$||f.push({text:Z,range:K,activate:(X,re)=>v?v.activate(X,re,K):M(0,re),hover:(X,re)=>{var q;return(q=v==null?void 0:v.hover)==null?void 0:q.call(v,X,re,K)},leave:(X,re)=>{var q;return(q=v==null?void 0:v.leave)==null?void 0:q.call(v,X,re,K)}})}w=!1,b.hasExtendedAttrs()&&b.extended.urlId?(O=I,A=b.extended.urlId):(O=-1,A=-1)}}_(f)}};function M(S,_){if(confirm(`Do you want to navigate to ${_}?
|
|
296
|
+
|
|
297
|
+
WARNING: This link could potentially be dangerous`)){const p=window.open();if(p){try{p.opener=null}catch{}p.location.href=_}else console.warn("Opening link blocked as opener could not be cleared")}}l.OscLinkProvider=E=u([y(0,x.IBufferService),y(1,x.IOptionsService),y(2,x.IOscLinkService)],E)},6193:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.RenderDebouncer=void 0,l.RenderDebouncer=class{constructor(h,u){this._renderCallback=h,this._coreBrowserService=u,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(h){return this._refreshCallbacks.push(h),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(h,u,y){this._rowCount=y,h=h!==void 0?h:0,u=u!==void 0?u:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,h):h,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,u):u,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const h=Math.max(this._rowStart,0),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(h,u),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const h of this._refreshCallbacks)h(0);this._refreshCallbacks=[]}}},3236:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const u=h(3614),y=h(3656),d=h(3551),x=h(9042),E=h(3730),M=h(1680),S=h(3107),_=h(5744),p=h(2950),f=h(1296),v=h(428),b=h(4269),R=h(5114),A=h(8934),O=h(3230),w=h(9312),j=h(4725),I=h(6731),Z=h(8055),K=h(8969),$=h(8460),X=h(844),re=h(6114),q=h(8437),ee=h(2584),J=h(7399),N=h(5941),B=h(9074),L=h(2585),z=h(5435),V=h(4567),Q=h(779);class fe 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(G={}){super(G),this.browser=re,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new X.MutableDisposable),this._onCursorMove=this.register(new $.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new $.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new $.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new $.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new $.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new $.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new $.EventEmitter),this._onBlur=this.register(new $.EventEmitter),this._onA11yCharEmitter=this.register(new $.EventEmitter),this._onA11yTabEmitter=this.register(new $.EventEmitter),this._onWillOpen=this.register(new $.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(B.DecorationService),this._instantiationService.setService(L.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Q.LinkProviderService),this._instantiationService.setService(j.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(E.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((U,le)=>this.refresh(U,le)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((U=>this._reportWindowsOptions(U)))),this.register(this._inputHandler.onColor((U=>this._handleColorEvent(U)))),this.register((0,$.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,$.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,$.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,$.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((U=>this._afterResize(U.cols,U.rows)))),this.register((0,X.toDisposable)((()=>{var U,le;this._customKeyEventHandler=void 0,(le=(U=this.element)==null?void 0:U.parentNode)==null||le.removeChild(this.element)})))}_handleColorEvent(G){if(this._themeService)for(const U of G){let le,ae="";switch(U.index){case 256:le="foreground",ae="10";break;case 257:le="background",ae="11";break;case 258:le="cursor",ae="12";break;default:le="ansi",ae="4;"+U.index}switch(U.type){case 0:const pe=Z.color.toColorRGB(le==="ansi"?this._themeService.colors.ansi[U.index]:this._themeService.colors[le]);this.coreService.triggerDataEvent(`${ee.C0.ESC}]${ae};${(0,N.toRgbString)(pe)}${ee.C1_ESCAPED.ST}`);break;case 1:if(le==="ansi")this._themeService.modifyColors((_e=>_e.ansi[U.index]=Z.channels.toColor(...U.color)));else{const _e=le;this._themeService.modifyColors((Te=>Te[_e]=Z.channels.toColor(...U.color)))}break;case 2:this._themeService.restoreColor(U.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(G){G?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(V.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(G){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ee.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var G;return(G=this.textarea)==null?void 0:G.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ee.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 G=this.buffer.ybase+this.buffer.y,U=this.buffer.lines.get(G);if(!U)return;const le=Math.min(this.buffer.x,this.cols-1),ae=this._renderService.dimensions.css.cell.height,pe=U.getWidth(le),_e=this._renderService.dimensions.css.cell.width*pe,Te=this.buffer.y*this._renderService.dimensions.css.cell.height,je=le*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=ae+"px",this.textarea.style.lineHeight=ae+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,y.addDisposableDomListener)(this.element,"copy",(U=>{this.hasSelection()&&(0,u.copyHandler)(U,this._selectionService)})));const G=U=>(0,u.handlePasteEvent)(U,this.textarea,this.coreService,this.optionsService);this.register((0,y.addDisposableDomListener)(this.textarea,"paste",G)),this.register((0,y.addDisposableDomListener)(this.element,"paste",G)),re.isFirefox?this.register((0,y.addDisposableDomListener)(this.element,"mousedown",(U=>{U.button===2&&(0,u.rightClickHandler)(U,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,y.addDisposableDomListener)(this.element,"contextmenu",(U=>{(0,u.rightClickHandler)(U,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),re.isLinux&&this.register((0,y.addDisposableDomListener)(this.element,"auxclick",(U=>{U.button===1&&(0,u.moveTextAreaUnderMouseCursor)(U,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,y.addDisposableDomListener)(this.textarea,"keyup",(G=>this._keyUp(G)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keydown",(G=>this._keyDown(G)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keypress",(G=>this._keyPress(G)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionupdate",(G=>this._compositionHelper.compositionupdate(G)))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,y.addDisposableDomListener)(this.textarea,"input",(G=>this._inputEvent(G)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(G){var le;if(!G)throw new Error("Terminal requires a parent element.");if(G.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((le=this.element)==null?void 0:le.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=G.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"),G.appendChild(this.element);const U=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),U.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",(ae=>this.updateCursorStyle(ae)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),U.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",x.promptLabel),re.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(R.CoreBrowserService,this.textarea,G.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(j.ICoreBrowserService,this._coreBrowserService),this.register((0,y.addDisposableDomListener)(this.textarea,"focus",(ae=>this._handleTextAreaFocus(ae)))),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(j.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(I.ThemeService),this._instantiationService.setService(j.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(b.CharacterJoinerService),this._instantiationService.setService(j.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(O.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(j.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ae=>this._onRender.fire(ae)))),this.onResize((ae=>this._renderService.resize(ae.cols,ae.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(j.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(d.Linkifier,this.screenElement)),this.element.appendChild(U);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(M.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ae=>this.scrollLines(ae.amount,ae.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(j.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ae=>this.scrollLines(ae.amount,ae.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ae=>this._renderService.handleSelectionChanged(ae.start,ae.end,ae.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ae=>{this.textarea.value=ae,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ae=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,y.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(S.BufferDecorationRenderer,this.screenElement)),this.register((0,y.addDisposableDomListener)(this.element,"mousedown",(ae=>this._selectionService.handleMouseDown(ae)))),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(V.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(ae=>this._handleScreenReaderModeOptionChange(ae)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(_.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ae=>{!this._overviewRulerRenderer&&ae&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(_.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(f.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const G=this,U=this.element;function le(_e){const Te=G._mouseService.getMouseReportCoords(_e,G.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(G._customWheelEventHandler&&G._customWheelEventHandler(_e)===!1||G.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)&&G.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 ae={mouseup:null,wheel:null,mousedrag:null,mousemove:null},pe={mouseup:_e=>(le(_e),_e.buttons||(this._document.removeEventListener("mouseup",ae.mouseup),ae.mousedrag&&this._document.removeEventListener("mousemove",ae.mousedrag)),this.cancel(_e)),wheel:_e=>(le(_e),this.cancel(_e,!0)),mousedrag:_e=>{_e.buttons&&le(_e)},mousemove:_e=>{_e.buttons||le(_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?ae.mousemove||(U.addEventListener("mousemove",pe.mousemove),ae.mousemove=pe.mousemove):(U.removeEventListener("mousemove",ae.mousemove),ae.mousemove=null),16&_e?ae.wheel||(U.addEventListener("wheel",pe.wheel,{passive:!1}),ae.wheel=pe.wheel):(U.removeEventListener("wheel",ae.wheel),ae.wheel=null),2&_e?ae.mouseup||(ae.mouseup=pe.mouseup):(this._document.removeEventListener("mouseup",ae.mouseup),ae.mouseup=null),4&_e?ae.mousedrag||(ae.mousedrag=pe.mousedrag):(this._document.removeEventListener("mousemove",ae.mousedrag),ae.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,y.addDisposableDomListener)(U,"mousedown",(_e=>{if(_e.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(_e))return le(_e),ae.mouseup&&this._document.addEventListener("mouseup",ae.mouseup),ae.mousedrag&&this._document.addEventListener("mousemove",ae.mousedrag),this.cancel(_e)}))),this.register((0,y.addDisposableDomListener)(U,"wheel",(_e=>{if(!ae.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=ee.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(_e.deltaY<0?"A":"B");let Ze="";for(let me=0;me<Math.abs(Te);me++)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)(U,"touchstart",(_e=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(_e),this.cancel(_e)}),{passive:!0})),this.register((0,y.addDisposableDomListener)(U,"touchmove",(_e=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(_e)?void 0:this.cancel(_e)}),{passive:!1}))}refresh(G,U){var le;(le=this._renderService)==null||le.refreshRows(G,U)}updateCursorStyle(G){var U;(U=this._selectionService)!=null&&U.shouldColumnSelect(G)?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(G,U,le=0){var ae;le===1?(super.scrollLines(G,U,le),this.refresh(0,this.rows-1)):(ae=this.viewport)==null||ae.scrollLines(G)}paste(G){(0,u.paste)(G,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(G){this._customKeyEventHandler=G}attachCustomWheelEventHandler(G){this._customWheelEventHandler=G}registerLinkProvider(G){return this._linkProviderService.registerLinkProvider(G)}registerCharacterJoiner(G){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const U=this._characterJoinerService.register(G);return this.refresh(0,this.rows-1),U}deregisterCharacterJoiner(G){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(G)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(G){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+G)}registerDecoration(G){return this._decorationService.registerDecoration(G)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(G,U,le){this._selectionService.setSelection(G,U,le)}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 G;(G=this._selectionService)==null||G.clearSelection()}selectAll(){var G;(G=this._selectionService)==null||G.selectAll()}selectLines(G,U){var le;(le=this._selectionService)==null||le.selectLines(G,U)}_keyDown(G){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(G)===!1)return!1;const U=this.browser.isMac&&this.options.macOptionIsMeta&&G.altKey;if(!U&&!this._compositionHelper.keydown(G))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;U||G.key!=="Dead"&&G.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const le=(0,J.evaluateKeyboardEvent)(G,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(G),le.type===3||le.type===2){const ae=this.rows-1;return this.scrollLines(le.type===2?-ae:ae),this.cancel(G,!0)}return le.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,G)||(le.cancel&&this.cancel(G,!0),!le.key||!!(G.key&&!G.ctrlKey&&!G.altKey&&!G.metaKey&&G.key.length===1&&G.key.charCodeAt(0)>=65&&G.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(le.key!==ee.C0.ETX&&le.key!==ee.C0.CR||(this.textarea.value=""),this._onKey.fire({key:le.key,domEvent:G}),this._showCursor(),this.coreService.triggerDataEvent(le.key,!0),!this.optionsService.rawOptions.screenReaderMode||G.altKey||G.ctrlKey?this.cancel(G,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(G,U){const le=G.isMac&&!this.options.macOptionIsMeta&&U.altKey&&!U.ctrlKey&&!U.metaKey||G.isWindows&&U.altKey&&U.ctrlKey&&!U.metaKey||G.isWindows&&U.getModifierState("AltGraph");return U.type==="keypress"?le:le&&(!U.keyCode||U.keyCode>47)}_keyUp(G){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(G)===!1||((function(U){return U.keyCode===16||U.keyCode===17||U.keyCode===18})(G)||this.focus(),this.updateCursorStyle(G),this._keyPressHandled=!1)}_keyPress(G){let U;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(G)===!1)return!1;if(this.cancel(G),G.charCode)U=G.charCode;else if(G.which===null||G.which===void 0)U=G.keyCode;else{if(G.which===0||G.charCode===0)return!1;U=G.which}return!(!U||(G.altKey||G.ctrlKey||G.metaKey)&&!this._isThirdLevelShift(this.browser,G)||(U=String.fromCharCode(U),this._onKey.fire({key:U,domEvent:G}),this._showCursor(),this.coreService.triggerDataEvent(U,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(G){if(G.data&&G.inputType==="insertText"&&(!G.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const U=G.data;return this.coreService.triggerDataEvent(U,!0),this.cancel(G),!0}return!1}resize(G,U){G!==this.cols||U!==this.rows?super.resize(G,U):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(G,U){var le,ae;(le=this._charSizeService)==null||le.measure(),(ae=this.viewport)==null||ae.syncScrollArea(!0)}clear(){var G;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 U=1;U<this.rows;U++)this.buffer.lines.push(this.buffer.getBlankLine(q.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(G=this.viewport)==null||G.reset(),this.refresh(0,this.rows-1)}}reset(){var U,le;this.options.rows=this.rows,this.options.cols=this.cols;const G=this._customKeyEventHandler;this._setup(),super.reset(),(U=this._selectionService)==null||U.reset(),this._decorationService.reset(),(le=this.viewport)==null||le.reset(),this._customKeyEventHandler=G,this.refresh(0,this.rows-1)}clearTextureAtlas(){var G;(G=this._renderService)==null||G.clearTextureAtlas()}_reportFocus(){var G;(G=this.element)!=null&&G.classList.contains("focus")?this.coreService.triggerDataEvent(ee.C0.ESC+"[I"):this.coreService.triggerDataEvent(ee.C0.ESC+"[O")}_reportWindowsOptions(G){if(this._renderService)switch(G){case z.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const U=this._renderService.dimensions.css.canvas.width.toFixed(0),le=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${ee.C0.ESC}[4;${le};${U}t`);break;case z.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ae=this._renderService.dimensions.css.cell.width.toFixed(0),pe=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${ee.C0.ESC}[6;${pe};${ae}t`)}}cancel(G,U){if(this.options.cancelEvents||U)return G.preventDefault(),G.stopPropagation(),!1}}l.Terminal=fe},9924:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TimeBasedDebouncer=void 0,l.TimeBasedDebouncer=class{constructor(h,u=1e3){this._renderCallback=h,this._debounceThresholdMS=u,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(h,u,y){this._rowCount=y,h=h!==void 0?h:0,u=u!==void 0?u:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,h):h,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,u):u;const d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const x=d-this._lastRefreshMs,E=this._debounceThresholdMS-x;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 h=Math.max(this._rowStart,0),u=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(h,u)}}},1680:function(T,l,h){var u=this&&this.__decorate||function(p,f,v,b){var R,A=arguments.length,O=A<3?f:b===null?b=Object.getOwnPropertyDescriptor(f,v):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(p,f,v,b);else for(var w=p.length-1;w>=0;w--)(R=p[w])&&(O=(A<3?R(O):A>3?R(f,v,O):R(f,v))||O);return A>3&&O&&Object.defineProperty(f,v,O),O},y=this&&this.__param||function(p,f){return function(v,b){f(v,b,p)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Viewport=void 0;const d=h(3656),x=h(4725),E=h(8460),M=h(844),S=h(2585);let _=l.Viewport=class extends M.Disposable{constructor(p,f,v,b,R,A,O,w){super(),this._viewportElement=p,this._scrollArea=f,this._bufferService=v,this._optionsService=b,this._charSizeService=R,this._renderService=A,this._coreBrowserService=O,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((j=>this._activeBuffer=j.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((j=>this._renderDimensions=j))),this._handleThemeChange(w.colors),this.register(w.onChangeColors((j=>this._handleThemeChange(j)))),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,b="";const R=[],A=f??this._bufferService.buffer.lines.length,O=this._bufferService.buffer.lines;for(let j=p;j<A;j++){const I=O.get(j);if(!I)continue;const Z=(w=O.get(j+1))==null?void 0:w.isWrapped;if(b+=I.translateToString(!Z),!Z||j===O.length-1){const K=document.createElement("div");K.textContent=b,R.push(K),b.length>0&&(v=K),b=""}}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))}};l.Viewport=_=u([y(2,S.IBufferService),y(3,S.IOptionsService),y(4,x.ICharSizeService),y(5,x.IRenderService),y(6,x.ICoreBrowserService),y(7,x.IThemeService)],_)},3107:function(T,l,h){var u=this&&this.__decorate||function(S,_,p,f){var v,b=arguments.length,R=b<3?_:f===null?f=Object.getOwnPropertyDescriptor(_,p):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(S,_,p,f);else for(var A=S.length-1;A>=0;A--)(v=S[A])&&(R=(b<3?v(R):b>3?v(_,p,R):v(_,p))||R);return b>3&&R&&Object.defineProperty(_,p,R),R},y=this&&this.__param||function(S,_){return function(p,f){_(p,f,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferDecorationRenderer=void 0;const d=h(4725),x=h(844),E=h(2585);let M=l.BufferDecorationRenderer=class extends x.Disposable{constructor(S,_,p,f,v){super(),this._screenElement=S,this._bufferService=_,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((b=>this._removeDecoration(b)))),this.register((0,x.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 S of this._decorationService.decorations)this._renderDecoration(S);this._dimensionsChanged=!1}_renderDecoration(S){this._refreshStyle(S),this._dimensionsChanged&&this._refreshXPosition(S)}_createElement(S){var f;const _=this._coreBrowserService.mainDocument.createElement("div");_.classList.add("xterm-decoration"),_.classList.toggle("xterm-decoration-top-layer",((f=S==null?void 0:S.options)==null?void 0:f.layer)==="top"),_.style.width=`${Math.round((S.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,_.style.height=(S.options.height||1)*this._renderService.dimensions.css.cell.height+"px",_.style.top=(S.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",_.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const p=S.options.x??0;return p&&p>this._bufferService.cols&&(_.style.display="none"),this._refreshXPosition(S,_),_}_refreshStyle(S){const _=S.marker.line-this._bufferService.buffers.active.ydisp;if(_<0||_>=this._bufferService.rows)S.element&&(S.element.style.display="none",S.onRenderEmitter.fire(S.element));else{let p=this._decorationElements.get(S);p||(p=this._createElement(S),S.element=p,this._decorationElements.set(S,p),this._container.appendChild(p),S.onDispose((()=>{this._decorationElements.delete(S),p.remove()}))),p.style.top=_*this._renderService.dimensions.css.cell.height+"px",p.style.display=this._altBufferIsActive?"none":"block",S.onRenderEmitter.fire(p)}}_refreshXPosition(S,_=S.element){if(!_)return;const p=S.options.x??0;(S.options.anchor||"left")==="right"?_.style.right=p?p*this._renderService.dimensions.css.cell.width+"px":"":_.style.left=p?p*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(S){var _;(_=this._decorationElements.get(S))==null||_.remove(),this._decorationElements.delete(S),S.dispose()}};l.BufferDecorationRenderer=M=u([y(1,E.IBufferService),y(2,d.ICoreBrowserService),y(3,E.IDecorationService),y(4,d.IRenderService)],M)},5871:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorZoneStore=void 0,l.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(h){if(h.options.overviewRulerOptions){for(const u of this._zones)if(u.color===h.options.overviewRulerOptions.color&&u.position===h.options.overviewRulerOptions.position){if(this._lineIntersectsZone(u,h.marker.line))return;if(this._lineAdjacentToZone(u,h.marker.line,h.options.overviewRulerOptions.position))return void this._addLineToZone(u,h.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=h.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=h.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=h.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=h.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:h.options.overviewRulerOptions.color,position:h.options.overviewRulerOptions.position,startBufferLine:h.marker.line,endBufferLine:h.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(h){this._linePadding=h}_lineIntersectsZone(h,u){return u>=h.startBufferLine&&u<=h.endBufferLine}_lineAdjacentToZone(h,u,y){return u>=h.startBufferLine-this._linePadding[y||"full"]&&u<=h.endBufferLine+this._linePadding[y||"full"]}_addLineToZone(h,u){h.startBufferLine=Math.min(h.startBufferLine,u),h.endBufferLine=Math.max(h.endBufferLine,u)}}},5744:function(T,l,h){var u=this&&this.__decorate||function(v,b,R,A){var O,w=arguments.length,j=w<3?b:A===null?A=Object.getOwnPropertyDescriptor(b,R):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(v,b,R,A);else for(var I=v.length-1;I>=0;I--)(O=v[I])&&(j=(w<3?O(j):w>3?O(b,R,j):O(b,R))||j);return w>3&&j&&Object.defineProperty(b,R,j),j},y=this&&this.__param||function(v,b){return function(R,A){b(R,A,v)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OverviewRulerRenderer=void 0;const d=h(5871),x=h(4725),E=h(844),M=h(2585),S={full:0,left:0,center:0,right:0},_={full:0,left:0,center:0,right:0},p={full:0,left:0,center:0,right:0};let f=l.OverviewRulerRenderer=class extends E.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(v,b,R,A,O,w,j){var Z;super(),this._viewportElement=v,this._screenElement=b,this._bufferService=R,this._decorationService=A,this._renderService=O,this._optionsService=w,this._coreBrowserService=j,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(),(Z=this._viewportElement.parentElement)==null||Z.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),b=Math.ceil(this._canvas.width/3);_.full=this._canvas.width,_.left=v,_.center=b,_.right=v,this._refreshDrawHeightConstants(),p.full=0,p.left=0,p.center=_.left,p.right=_.left+_.center}_refreshDrawHeightConstants(){S.full=Math.round(2*this._coreBrowserService.dpr);const v=this._canvas.height/this._bufferService.buffer.lines.length,b=Math.round(Math.max(Math.min(v,12),6)*this._coreBrowserService.dpr);S.left=b,S.center=b,S.right=b}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*S.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 b of this._decorationService.decorations)this._colorZoneStore.addDecoration(b);this._ctx.lineWidth=1;const v=this._colorZoneStore.zones;for(const b of v)b.position!=="full"&&this._renderColorZone(b);for(const b of v)b.position==="full"&&this._renderColorZone(b);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)-S[v.position||"full"]/2),_[v.position||"full"],Math.round((this._canvas.height-1)*((v.endBufferLine-v.startBufferLine)/this._bufferService.buffers.active.lines.length)+S[v.position||"full"]))}_queueRefresh(v,b){this._shouldUpdateDimensions=v||this._shouldUpdateDimensions,this._shouldUpdateAnchor=b||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};l.OverviewRulerRenderer=f=u([y(2,M.IBufferService),y(3,M.IDecorationService),y(4,x.IRenderService),y(5,M.IOptionsService),y(6,x.ICoreBrowserService)],f)},2950:function(T,l,h){var u=this&&this.__decorate||function(S,_,p,f){var v,b=arguments.length,R=b<3?_:f===null?f=Object.getOwnPropertyDescriptor(_,p):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(S,_,p,f);else for(var A=S.length-1;A>=0;A--)(v=S[A])&&(R=(b<3?v(R):b>3?v(_,p,R):v(_,p))||R);return b>3&&R&&Object.defineProperty(_,p,R),R},y=this&&this.__param||function(S,_){return function(p,f){_(p,f,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CompositionHelper=void 0;const d=h(4725),x=h(2585),E=h(2584);let M=l.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(S,_,p,f,v,b){this._textarea=S,this._compositionView=_,this._bufferService=p,this._optionsService=f,this._coreService=v,this._renderService=b,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(S){this._compositionView.textContent=S.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(S){if(this._isComposing||this._isSendingComposition){if(S.keyCode===229||S.keyCode===16||S.keyCode===17||S.keyCode===18)return!1;this._finalizeComposition(!1)}return S.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(S){if(this._compositionView.classList.remove("active"),this._isComposing=!1,S){const _={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let p;this._isSendingComposition=!1,_.start+=this._dataAlreadySent.length,p=this._isComposing?this._textarea.value.substring(_.start,_.end):this._textarea.value.substring(_.start),p.length>0&&this._coreService.triggerDataEvent(p,!0)}}),0)}else{this._isSendingComposition=!1;const _=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(_,!0)}}_handleAnyTextareaChanges(){const S=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const _=this._textarea.value,p=_.replace(S,"");this._dataAlreadySent=p,_.length>S.length?this._coreService.triggerDataEvent(p,!0):_.length<S.length?this._coreService.triggerDataEvent(`${E.C0.DEL}`,!0):_.length===S.length&&_!==S&&this._coreService.triggerDataEvent(_,!0)}}),0)}updateCompositionElements(S){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const _=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=_*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 b=this._compositionView.getBoundingClientRect();this._textarea.style.left=v+"px",this._textarea.style.top=f+"px",this._textarea.style.width=Math.max(b.width,1)+"px",this._textarea.style.height=Math.max(b.height,1)+"px",this._textarea.style.lineHeight=b.height+"px"}S||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};l.CompositionHelper=M=u([y(2,x.IBufferService),y(3,x.IOptionsService),y(4,x.ICoreService),y(5,d.IRenderService)],M)},9806:(T,l)=>{function h(u,y,d){const x=d.getBoundingClientRect(),E=u.getComputedStyle(d),M=parseInt(E.getPropertyValue("padding-left")),S=parseInt(E.getPropertyValue("padding-top"));return[y.clientX-x.left-M,y.clientY-x.top-S]}Object.defineProperty(l,"__esModule",{value:!0}),l.getCoords=l.getCoordsRelativeToElement=void 0,l.getCoordsRelativeToElement=h,l.getCoords=function(u,y,d,x,E,M,S,_,p){if(!M)return;const f=h(u,y,d);return f?(f[0]=Math.ceil((f[0]+(p?S/2:0))/S),f[1]=Math.ceil(f[1]/_),f[0]=Math.min(Math.max(f[0],1),x+(p?1:0)),f[1]=Math.min(Math.max(f[1],1),E),f):void 0}},9504:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.moveToCellSequence=void 0;const u=h(2584);function y(_,p,f,v){const b=_-d(_,f),R=p-d(p,f),A=Math.abs(b-R)-(function(O,w,j){let I=0;const Z=O-d(O,j),K=w-d(w,j);for(let $=0;$<Math.abs(Z-K);$++){const X=x(O,w)==="A"?-1:1,re=j.buffer.lines.get(Z+X*$);re!=null&&re.isWrapped&&I++}return I})(_,p,f);return S(A,M(x(_,p),v))}function d(_,p){let f=0,v=p.buffer.lines.get(_),b=v==null?void 0:v.isWrapped;for(;b&&_>=0&&_<p.rows;)f++,v=p.buffer.lines.get(--_),b=v==null?void 0:v.isWrapped;return f}function x(_,p){return _>p?"A":"B"}function E(_,p,f,v,b,R){let A=_,O=p,w="";for(;A!==f||O!==v;)A+=b?1:-1,b&&A>R.cols-1?(w+=R.buffer.translateBufferLineToString(O,!1,_,A),A=0,_=0,O++):!b&&A<0&&(w+=R.buffer.translateBufferLineToString(O,!1,0,_+1),A=R.cols-1,_=A,O--);return w+R.buffer.translateBufferLineToString(O,!1,_,A)}function M(_,p){const f=p?"O":"[";return u.C0.ESC+f+_}function S(_,p){_=Math.floor(_);let f="";for(let v=0;v<_;v++)f+=p;return f}l.moveToCellSequence=function(_,p,f,v){const b=f.buffer.x,R=f.buffer.y;if(!f.buffer.hasScrollback)return(function(w,j,I,Z,K,$){return y(j,Z,K,$).length===0?"":S(E(w,j,w,j-d(j,K),!1,K).length,M("D",$))})(b,R,0,p,f,v)+y(R,p,f,v)+(function(w,j,I,Z,K,$){let X;X=y(j,Z,K,$).length>0?Z-d(Z,K):j;const re=Z,q=(function(ee,J,N,B,L,z){let V;return V=y(N,B,L,z).length>0?B-d(B,L):J,ee<N&&V<=B||ee>=N&&V<B?"C":"D"})(w,j,I,Z,K,$);return S(E(w,X,I,re,q==="C",K).length,M(q,$))})(b,R,_,p,f,v);let A;if(R===p)return A=b>_?"D":"C",S(Math.abs(b-_),M(A,v));A=R>p?"D":"C";const O=Math.abs(R-p);return S((function(w,j){return j.cols-w})(R>p?_:b,f)+(O-1)*f.cols+1+((R>p?b:_)-1),M(A,v))}},1296:function(T,l,h){var u=this&&this.__decorate||function($,X,re,q){var ee,J=arguments.length,N=J<3?X:q===null?q=Object.getOwnPropertyDescriptor(X,re):q;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate($,X,re,q);else for(var B=$.length-1;B>=0;B--)(ee=$[B])&&(N=(J<3?ee(N):J>3?ee(X,re,N):ee(X,re))||N);return J>3&&N&&Object.defineProperty(X,re,N),N},y=this&&this.__param||function($,X){return function(re,q){X(re,q,$)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRenderer=void 0;const d=h(3787),x=h(2550),E=h(2223),M=h(6171),S=h(6052),_=h(4725),p=h(8055),f=h(8460),v=h(844),b=h(2585),R="xterm-dom-renderer-owner-",A="xterm-rows",O="xterm-fg-",w="xterm-bg-",j="xterm-focus",I="xterm-selection";let Z=1,K=l.DomRenderer=class extends v.Disposable{constructor($,X,re,q,ee,J,N,B,L,z,V,Q,fe){super(),this._terminal=$,this._document=X,this._element=re,this._screenElement=q,this._viewportElement=ee,this._helperContainer=J,this._linkifier2=N,this._charSizeService=L,this._optionsService=z,this._bufferService=V,this._coreBrowserService=Q,this._themeService=fe,this._terminalClass=Z++,this._rowElements=[],this._selectionRenderModel=(0,S.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,M.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((de=>this._injectCss(de)))),this._injectCss(this._themeService.colors),this._rowFactory=B.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((de=>this._handleLinkHover(de)))),this.register(this._linkifier2.onHideLinkUnderline((de=>this._handleLinkLeave(de)))),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 x.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 $=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*$,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*$),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/$),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/$),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const re of this._rowElements)re.style.width=`${this.dimensions.css.canvas.width}px`,re.style.height=`${this.dimensions.css.cell.height}px`,re.style.lineHeight=`${this.dimensions.css.cell.height}px`,re.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const X=`${this._terminalSelector} .${A} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=X,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($){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let X=`${this._terminalSelector} .${A} { color: ${$.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;X+=`${this._terminalSelector} .${A} .xterm-dim { color: ${p.color.multiplyOpacity($.foreground,.5).css};}`,X+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const re=`blink_underline_${this._terminalClass}`,q=`blink_bar_${this._terminalClass}`,ee=`blink_block_${this._terminalClass}`;X+=`@keyframes ${re} { 50% { border-bottom-style: hidden; }}`,X+=`@keyframes ${q} { 50% { box-shadow: none; }}`,X+=`@keyframes ${ee} { 0% { background-color: ${$.cursor.css}; color: ${$.cursorAccent.css}; } 50% { background-color: inherit; color: ${$.cursor.css}; }}`,X+=`${this._terminalSelector} .${A}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${re} 1s step-end infinite;}${this._terminalSelector} .${A}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${q} 1s step-end infinite;}${this._terminalSelector} .${A}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${ee} 1s step-end infinite;}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-block { background-color: ${$.cursor.css}; color: ${$.cursorAccent.css};}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${$.cursor.css} !important; color: ${$.cursorAccent.css} !important;}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${$.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${$.cursor.css} inset;}${this._terminalSelector} .${A} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${$.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,X+=`${this._terminalSelector} .${I} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${I} div { position: absolute; background-color: ${$.selectionBackgroundOpaque.css};}${this._terminalSelector} .${I} div { position: absolute; background-color: ${$.selectionInactiveBackgroundOpaque.css};}`;for(const[J,N]of $.ansi.entries())X+=`${this._terminalSelector} .${O}${J} { color: ${N.css}; }${this._terminalSelector} .${O}${J}.xterm-dim { color: ${p.color.multiplyOpacity(N,.5).css}; }${this._terminalSelector} .${w}${J} { background-color: ${N.css}; }`;X+=`${this._terminalSelector} .${O}${E.INVERTED_DEFAULT_COLOR} { color: ${p.color.opaque($.background).css}; }${this._terminalSelector} .${O}${E.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${p.color.multiplyOpacity(p.color.opaque($.background),.5).css}; }${this._terminalSelector} .${w}${E.INVERTED_DEFAULT_COLOR} { background-color: ${$.foreground.css}; }`,this._themeStyleElement.textContent=X}_setDefaultSpacing(){const $=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${$}px`,this._rowFactory.defaultSpacing=$}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements($,X){for(let re=this._rowElements.length;re<=X;re++){const q=this._document.createElement("div");this._rowContainer.appendChild(q),this._rowElements.push(q)}for(;this._rowElements.length>X;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize($,X){this._refreshRowElements($,X),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(j),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(j),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged($,X,re){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged($,X,re),this.renderRows(0,this._bufferService.rows-1),!$||!X)return;this._selectionRenderModel.update(this._terminal,$,X,re);const q=this._selectionRenderModel.viewportStartRow,ee=this._selectionRenderModel.viewportEndRow,J=this._selectionRenderModel.viewportCappedStartRow,N=this._selectionRenderModel.viewportCappedEndRow;if(J>=this._bufferService.rows||N<0)return;const B=this._document.createDocumentFragment();if(re){const L=$[0]>X[0];B.appendChild(this._createSelectionElement(J,L?X[0]:$[0],L?$[0]:X[0],N-J+1))}else{const L=q===J?$[0]:0,z=J===ee?X[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(J,L,z));const V=N-J-1;if(B.appendChild(this._createSelectionElement(J+1,0,this._bufferService.cols,V)),J!==N){const Q=ee===N?X[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(N,0,Q))}}this._selectionContainer.appendChild(B)}_createSelectionElement($,X,re,q=1){const ee=this._document.createElement("div"),J=X*this.dimensions.css.cell.width;let N=this.dimensions.css.cell.width*(re-X);return J+N>this.dimensions.css.canvas.width&&(N=this.dimensions.css.canvas.width-J),ee.style.height=q*this.dimensions.css.cell.height+"px",ee.style.top=$*this.dimensions.css.cell.height+"px",ee.style.left=`${J}px`,ee.style.width=`${N}px`,ee}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 $ of this._rowElements)$.replaceChildren()}renderRows($,X){const re=this._bufferService.buffer,q=re.ybase+re.y,ee=Math.min(re.x,this._bufferService.cols-1),J=this._optionsService.rawOptions.cursorBlink,N=this._optionsService.rawOptions.cursorStyle,B=this._optionsService.rawOptions.cursorInactiveStyle;for(let L=$;L<=X;L++){const z=L+re.ydisp,V=this._rowElements[L],Q=re.lines.get(z);if(!V||!Q)break;V.replaceChildren(...this._rowFactory.createRow(Q,z,z===q,N,B,ee,J,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${R}${this._terminalClass}`}_handleLinkHover($){this._setCellUnderline($.x1,$.x2,$.y1,$.y2,$.cols,!0)}_handleLinkLeave($){this._setCellUnderline($.x1,$.x2,$.y1,$.y2,$.cols,!1)}_setCellUnderline($,X,re,q,ee,J){re<0&&($=0),q<0&&(X=0);const N=this._bufferService.rows-1;re=Math.max(Math.min(re,N),0),q=Math.max(Math.min(q,N),0),ee=Math.min(ee,this._bufferService.cols);const B=this._bufferService.buffer,L=B.ybase+B.y,z=Math.min(B.x,ee-1),V=this._optionsService.rawOptions.cursorBlink,Q=this._optionsService.rawOptions.cursorStyle,fe=this._optionsService.rawOptions.cursorInactiveStyle;for(let de=re;de<=q;++de){const G=de+B.ydisp,U=this._rowElements[de],le=B.lines.get(G);if(!U||!le)break;U.replaceChildren(...this._rowFactory.createRow(le,G,G===L,Q,fe,z,V,this.dimensions.css.cell.width,this._widthCache,J?de===re?$:0:-1,J?(de===q?X:ee)-1:-1))}}};l.DomRenderer=K=u([y(7,b.IInstantiationService),y(8,_.ICharSizeService),y(9,b.IOptionsService),y(10,b.IBufferService),y(11,_.ICoreBrowserService),y(12,_.IThemeService)],K)},3787:function(T,l,h){var u=this&&this.__decorate||function(A,O,w,j){var I,Z=arguments.length,K=Z<3?O:j===null?j=Object.getOwnPropertyDescriptor(O,w):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")K=Reflect.decorate(A,O,w,j);else for(var $=A.length-1;$>=0;$--)(I=A[$])&&(K=(Z<3?I(K):Z>3?I(O,w,K):I(O,w))||K);return Z>3&&K&&Object.defineProperty(O,w,K),K},y=this&&this.__param||function(A,O){return function(w,j){O(w,j,A)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRendererRowFactory=void 0;const d=h(2223),x=h(643),E=h(511),M=h(2585),S=h(8055),_=h(4725),p=h(4269),f=h(6171),v=h(3734);let b=l.DomRendererRowFactory=class{constructor(A,O,w,j,I,Z,K){this._document=A,this._characterJoinerService=O,this._optionsService=w,this._coreBrowserService=j,this._coreService=I,this._decorationService=Z,this._themeService=K,this._workCell=new E.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(A,O,w){this._selectionStart=A,this._selectionEnd=O,this._columnSelectMode=w}createRow(A,O,w,j,I,Z,K,$,X,re,q){const ee=[],J=this._characterJoinerService.getJoinedCharacters(O),N=this._themeService.colors;let B,L=A.getNoBgTrimmedLength();w&&L<Z+1&&(L=Z+1);let z=0,V="",Q=0,fe=0,de=0,G=!1,U=0,le=!1,ae=0;const pe=[],_e=re!==-1&&q!==-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,me=Te,Se=this._workCell;if(J.length>0&&Te===J[0][0]){Ze=!0;const Ge=J.shift();Se=new p.JoinedCellData(this._workCell,A.translateToString(!0,Ge[0],Ge[1]),Ge[1]-Ge[0]),me=Ge[1]-1,je=Se.getWidth()}const ni=this._isCellInSelection(Te,O),ys=w&&Te===Z,bs=_e&&Te>=re&&Te<=q;let Ss=!1;this._decorationService.forEachDecorationAtCell(Te,O,void 0,(Ge=>{Ss=!0}));let Fs=Se.getChars()||x.WHITESPACE_CELL_CHAR;if(Fs===" "&&(Se.isUnderline()||Se.isOverline())&&(Fs=" "),ae=je*$-X.get(Fs,Se.isBold(),Se.isItalic()),B){if(z&&(ni&&le||!ni&&!le&&Se.bg===Q)&&(ni&&le&&N.selectionForeground||Se.fg===fe)&&Se.extended.ext===de&&bs===G&&ae===U&&!ys&&!Ze&&!Ss){Se.isInvisible()?V+=x.WHITESPACE_CELL_CHAR:V+=Fs,z++;continue}z&&(B.textContent=V),B=this._document.createElement("span"),z=0,V=""}else B=this._document.createElement("span");if(Q=Se.bg,fe=Se.fg,de=Se.extended.ext,G=bs,U=ae,le=ni,Ze&&Z>=Te&&Z<=me&&(Z=Te),!this._coreService.isCursorHidden&&ys&&this._coreService.isCursorInitialized){if(pe.push("xterm-cursor"),this._coreBrowserService.isFocused)K&&pe.push("xterm-cursor-blink"),pe.push(j==="bar"?"xterm-cursor-bar":j==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(I)switch(I){case"outline":pe.push("xterm-cursor-outline");break;case"block":pe.push("xterm-cursor-block");break;case"bar":pe.push("xterm-cursor-bar");break;case"underline":pe.push("xterm-cursor-underline")}}if(Se.isBold()&&pe.push("xterm-bold"),Se.isItalic()&&pe.push("xterm-italic"),Se.isDim()&&pe.push("xterm-dim"),V=Se.isInvisible()?x.WHITESPACE_CELL_CHAR:Se.getChars()||x.WHITESPACE_CELL_CHAR,Se.isUnderline()&&(pe.push(`xterm-underline-${Se.extended.underlineStyle}`),V===" "&&(V=" "),!Se.isUnderlineColorDefault()))if(Se.isUnderlineColorRGB())B.style.textDecorationColor=`rgb(${v.AttributeData.toColorRGB(Se.getUnderlineColor()).join(",")})`;else{let Ge=Se.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Se.isBold()&&Ge<8&&(Ge+=8),B.style.textDecorationColor=N.ansi[Ge].css}Se.isOverline()&&(pe.push("xterm-overline"),V===" "&&(V=" ")),Se.isStrikethrough()&&pe.push("xterm-strikethrough"),bs&&(B.style.textDecoration="underline");let Tt=Se.getFgColor(),_t=Se.getFgColorMode(),Kt=Se.getBgColor(),Ii=Se.getBgColorMode();const Ks=!!Se.isInverse();if(Ks){const Ge=Tt;Tt=Kt,Kt=Ge;const Cs=_t;_t=Ii,Ii=Cs}let Bt,Vs,ai,xs=!1;switch(this._decorationService.forEachDecorationAtCell(Te,O,void 0,(Ge=>{Ge.options.layer!=="top"&&xs||(Ge.backgroundColorRGB&&(Ii=50331648,Kt=Ge.backgroundColorRGB.rgba>>8&16777215,Bt=Ge.backgroundColorRGB),Ge.foregroundColorRGB&&(_t=50331648,Tt=Ge.foregroundColorRGB.rgba>>8&16777215,Vs=Ge.foregroundColorRGB),xs=Ge.options.layer==="top")})),!xs&&ni&&(Bt=this._coreBrowserService.isFocused?N.selectionBackgroundOpaque:N.selectionInactiveBackgroundOpaque,Kt=Bt.rgba>>8&16777215,Ii=50331648,xs=!0,N.selectionForeground&&(_t=50331648,Tt=N.selectionForeground.rgba>>8&16777215,Vs=N.selectionForeground)),xs&&pe.push("xterm-decoration-top"),Ii){case 16777216:case 33554432:ai=N.ansi[Kt],pe.push(`xterm-bg-${Kt}`);break;case 50331648:ai=S.channels.toColor(Kt>>16,Kt>>8&255,255&Kt),this._addStyle(B,`background-color:#${R((Kt>>>0).toString(16),"0",6)}`);break;default:Ks?(ai=N.foreground,pe.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):ai=N.background}switch(Bt||Se.isDim()&&(Bt=S.color.multiplyOpacity(ai,.5)),_t){case 16777216:case 33554432:Se.isBold()&&Tt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Tt+=8),this._applyMinimumContrast(B,ai,N.ansi[Tt],Se,Bt,void 0)||pe.push(`xterm-fg-${Tt}`);break;case 50331648:const Ge=S.channels.toColor(Tt>>16&255,Tt>>8&255,255&Tt);this._applyMinimumContrast(B,ai,Ge,Se,Bt,Vs)||this._addStyle(B,`color:#${R(Tt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(B,ai,N.foreground,Se,Bt,Vs)||Ks&&pe.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}pe.length&&(B.className=pe.join(" "),pe.length=0),ys||Ze||Ss?B.textContent=V:z++,ae!==this.defaultSpacing&&(B.style.letterSpacing=`${ae}px`),ee.push(B),Te=me}return B&&z&&(B.textContent=V),ee}_applyMinimumContrast(A,O,w,j,I,Z){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,f.treatGlyphAsBackgroundColor)(j.getCode()))return!1;const K=this._getContrastCache(j);let $;if(I||Z||($=K.getColor(O.rgba,w.rgba)),$===void 0){const X=this._optionsService.rawOptions.minimumContrastRatio/(j.isDim()?2:1);$=S.color.ensureContrastRatio(I||O,Z||w,X),K.setColor((I||O).rgba,(Z||w).rgba,$??null)}return!!$&&(this._addStyle(A,`color:${$.css}`),!0)}_getContrastCache(A){return A.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(A,O){A.setAttribute("style",`${A.getAttribute("style")||""}${O};`)}_isCellInSelection(A,O){const w=this._selectionStart,j=this._selectionEnd;return!(!w||!j)&&(this._columnSelectMode?w[0]<=j[0]?A>=w[0]&&O>=w[1]&&A<j[0]&&O<=j[1]:A<w[0]&&O>=w[1]&&A>=j[0]&&O<=j[1]:O>w[1]&&O<j[1]||w[1]===j[1]&&O===w[1]&&A>=w[0]&&A<j[0]||w[1]<j[1]&&O===j[1]&&A<j[0]||w[1]<j[1]&&O===w[1]&&A>=w[0])}};function R(A,O,w){for(;A.length<w;)A=O+A;return A}l.DomRendererRowFactory=b=u([y(1,_.ICharacterJoinerService),y(2,M.IOptionsService),y(3,_.ICoreBrowserService),y(4,M.ICoreService),y(5,M.IDecorationService),y(6,_.IThemeService)],b)},2550:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WidthCache=void 0,l.WidthCache=class{constructor(h,u){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=h.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const y=h.createElement("span");y.classList.add("xterm-char-measure-element");const d=h.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontWeight="bold";const x=h.createElement("span");x.classList.add("xterm-char-measure-element"),x.style.fontStyle="italic";const E=h.createElement("span");E.classList.add("xterm-char-measure-element"),E.style.fontWeight="bold",E.style.fontStyle="italic",this._measureElements=[y,d,x,E],this._container.appendChild(y),this._container.appendChild(d),this._container.appendChild(x),this._container.appendChild(E),u.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(h,u,y,d){h===this._font&&u===this._fontSize&&y===this._weight&&d===this._weightBold||(this._font=h,this._fontSize=u,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(h,u,y){let d=0;if(!u&&!y&&h.length===1&&(d=h.charCodeAt(0))<256){if(this._flat[d]!==-9999)return this._flat[d];const M=this._measure(h,0);return M>0&&(this._flat[d]=M),M}let x=h;u&&(x+="B"),y&&(x+="I");let E=this._holey.get(x);if(E===void 0){let M=0;u&&(M|=1),y&&(M|=2),E=this._measure(h,M),E>0&&this._holey.set(x,E)}return E}_measure(h,u){const y=this._measureElements[u];return y.textContent=h.repeat(32),y.offsetWidth/32}}},2223:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TEXT_BASELINE=l.DIM_OPACITY=l.INVERTED_DEFAULT_COLOR=void 0;const u=h(6114);l.INVERTED_DEFAULT_COLOR=257,l.DIM_OPACITY=.5,l.TEXT_BASELINE=u.isFirefox||u.isLegacyEdge?"bottom":"ideographic"},6171:(T,l)=>{function h(y){return 57508<=y&&y<=57558}function u(y){return y>=128512&&y<=128591||y>=127744&&y<=128511||y>=128640&&y<=128767||y>=9728&&y<=9983||y>=9984&&y<=10175||y>=65024&&y<=65039||y>=129280&&y<=129535||y>=127462&&y<=127487}Object.defineProperty(l,"__esModule",{value:!0}),l.computeNextVariantOffset=l.createRenderDimensions=l.treatGlyphAsBackgroundColor=l.allowRescaling=l.isEmoji=l.isRestrictedPowerlineGlyph=l.isPowerlineGlyph=l.throwIfFalsy=void 0,l.throwIfFalsy=function(y){if(!y)throw new Error("value must not be falsy");return y},l.isPowerlineGlyph=h,l.isRestrictedPowerlineGlyph=function(y){return 57520<=y&&y<=57527},l.isEmoji=u,l.allowRescaling=function(y,d,x,E){return d===1&&x>Math.ceil(1.5*E)&&y!==void 0&&y>255&&!u(y)&&!h(y)&&!(function(M){return 57344<=M&&M<=63743})(y)},l.treatGlyphAsBackgroundColor=function(y){return h(y)||(function(d){return 9472<=d&&d<=9631})(y)},l.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},l.computeNextVariantOffset=function(y,d,x=0){return(y-(2*Math.round(d)-x))%(2*Math.round(d))}},6052:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createSelectionRenderModel=void 0;class h{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(y,d,x,E=!1){if(this.selectionStart=d,this.selectionEnd=x,!d||!x||d[0]===x[0]&&d[1]===x[1])return void this.clear();const M=y.buffers.active.ydisp,S=d[1]-M,_=x[1]-M,p=Math.max(S,0),f=Math.min(_,y.rows-1);p>=y.rows||f<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=E,this.viewportStartRow=S,this.viewportEndRow=_,this.viewportCappedStartRow=p,this.viewportCappedEndRow=f,this.startCol=d[0],this.endCol=x[0])}isCellSelected(y,d,x){return!!this.hasSelection&&(x-=y.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?d>=this.startCol&&x>=this.viewportCappedStartRow&&d<this.endCol&&x<=this.viewportCappedEndRow:d<this.startCol&&x>=this.viewportCappedStartRow&&d>=this.endCol&&x<=this.viewportCappedEndRow:x>this.viewportStartRow&&x<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&x===this.viewportStartRow&&d>=this.startCol&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&x===this.viewportEndRow&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&x===this.viewportStartRow&&d>=this.startCol)}}l.createSelectionRenderModel=function(){return new h}},456:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionModel=void 0,l.SelectionModel=class{constructor(h){this._bufferService=h,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const h=this.selectionStart[0]+this.selectionStartLength;return h>this._bufferService.cols?h%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(h/this._bufferService.cols)-1]:[h%this._bufferService.cols,this.selectionStart[1]+Math.floor(h/this._bufferService.cols)]:[h,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const h=this.selectionStart[0]+this.selectionStartLength;return h>this._bufferService.cols?[h%this._bufferService.cols,this.selectionStart[1]+Math.floor(h/this._bufferService.cols)]:[Math.max(h,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const h=this.selectionStart,u=this.selectionEnd;return!(!h||!u)&&(h[1]>u[1]||h[1]===u[1]&&h[0]>u[0])}handleTrim(h){return this.selectionStart&&(this.selectionStart[1]-=h),this.selectionEnd&&(this.selectionEnd[1]-=h),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(T,l,h){var u=this&&this.__decorate||function(f,v,b,R){var A,O=arguments.length,w=O<3?v:R===null?R=Object.getOwnPropertyDescriptor(v,b):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(f,v,b,R);else for(var j=f.length-1;j>=0;j--)(A=f[j])&&(w=(O<3?A(w):O>3?A(v,b,w):A(v,b))||w);return O>3&&w&&Object.defineProperty(v,b,w),w},y=this&&this.__param||function(f,v){return function(b,R){v(b,R,f)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharSizeService=void 0;const d=h(2585),x=h(8460),E=h(844);let M=l.CharSizeService=class extends E.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(f,v,b){super(),this._optionsService=b,this.width=0,this.height=0,this._onCharSizeChange=this.register(new x.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new p(this._optionsService))}catch{this._measureStrategy=this.register(new _(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())}};l.CharSizeService=M=u([y(2,d.IOptionsService)],M);class S extends E.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(v,b){v!==void 0&&v>0&&b!==void 0&&b>0&&(this._result.width=v,this._result.height=b)}}class _ extends S{constructor(v,b,R){super(),this._document=v,this._parentElement=b,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 S{constructor(v){super(),this._optionsService=v,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const b=this._ctx.measureText("W");if(!("width"in b&&"fontBoundingBoxAscent"in b&&"fontBoundingBoxDescent"in b))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,l,h){var u=this&&this.__decorate||function(p,f,v,b){var R,A=arguments.length,O=A<3?f:b===null?b=Object.getOwnPropertyDescriptor(f,v):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(p,f,v,b);else for(var w=p.length-1;w>=0;w--)(R=p[w])&&(O=(A<3?R(O):A>3?R(f,v,O):R(f,v))||O);return A>3&&O&&Object.defineProperty(f,v,O),O},y=this&&this.__param||function(p,f){return function(v,b){f(v,b,p)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharacterJoinerService=l.JoinedCellData=void 0;const d=h(3734),x=h(643),E=h(511),M=h(2585);class S extends d.AttributeData{constructor(f,v,b){super(),this.content=0,this.combinedData="",this.fg=f.fg,this.bg=f.bg,this.combinedData=v,this._width=b}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(f){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.JoinedCellData=S;let _=l.CharacterJoinerService=class Xp{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 b=[],R=v.translateToString(!0);let A=0,O=0,w=0,j=v.getFg(0),I=v.getBg(0);for(let Z=0;Z<v.getTrimmedLength();Z++)if(v.loadCell(Z,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==j||this._workCell.bg!==I){if(Z-A>1){const K=this._getJoinedRanges(R,w,O,v,A);for(let $=0;$<K.length;$++)b.push(K[$])}A=Z,w=O,j=this._workCell.fg,I=this._workCell.bg}O+=this._workCell.getChars().length||x.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-A>1){const Z=this._getJoinedRanges(R,w,O,v,A);for(let K=0;K<Z.length;K++)b.push(Z[K])}return b}_getJoinedRanges(f,v,b,R,A){const O=f.substring(v,b);let w=[];try{w=this._characterJoiners[0].handler(O)}catch(j){console.error(j)}for(let j=1;j<this._characterJoiners.length;j++)try{const I=this._characterJoiners[j].handler(O);for(let Z=0;Z<I.length;Z++)Xp._mergeRanges(w,I[Z])}catch(I){console.error(I)}return this._stringRangesToCellRanges(w,R,A),w}_stringRangesToCellRanges(f,v,b){let R=0,A=!1,O=0,w=f[R];if(w){for(let j=b;j<this._bufferService.cols;j++){const I=v.getWidth(j),Z=v.getString(j).length||x.WHITESPACE_CELL_CHAR.length;if(I!==0){if(!A&&w[0]<=O&&(w[0]=j,A=!0),w[1]<=O){if(w[1]=j,w=f[++R],!w)break;w[0]<=O?(w[0]=j,A=!0):A=!1}O+=Z}}w&&(w[1]=this._bufferService.cols)}}static _mergeRanges(f,v){let b=!1;for(let R=0;R<f.length;R++){const A=f[R];if(b){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]),b=!0)}}return b?f[f.length-1][1]=v[1]:f.push(v),f}};l.CharacterJoinerService=_=u([y(0,M.IBufferService)],_)},5114:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreBrowserService=void 0;const u=h(844),y=h(8460),d=h(3656);class x extends u.Disposable{constructor(S,_,p){super(),this._textarea=S,this._window=_,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(S){this._window!==S&&(this._window=S,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}l.CoreBrowserService=x;class E extends u.Disposable{constructor(S){super(),this._parentWindow=S,this._windowResizeListener=this.register(new u.MutableDisposable),this._onDprChange=this.register(new y.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,u.toDisposable)((()=>this.clearListener())))}setWindow(S){this._parentWindow=S,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 S;this._outerListener&&((S=this._resolutionMediaMatchList)==null||S.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.LinkProviderService=void 0;const u=h(844);class y extends u.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,u.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(x){return this.linkProviders.push(x),{dispose:()=>{const E=this.linkProviders.indexOf(x);E!==-1&&this.linkProviders.splice(E,1)}}}}l.LinkProviderService=y},8934:function(T,l,h){var u=this&&this.__decorate||function(M,S,_,p){var f,v=arguments.length,b=v<3?S:p===null?p=Object.getOwnPropertyDescriptor(S,_):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(M,S,_,p);else for(var R=M.length-1;R>=0;R--)(f=M[R])&&(b=(v<3?f(b):v>3?f(S,_,b):f(S,_))||b);return v>3&&b&&Object.defineProperty(S,_,b),b},y=this&&this.__param||function(M,S){return function(_,p){S(_,p,M)}};Object.defineProperty(l,"__esModule",{value:!0}),l.MouseService=void 0;const d=h(4725),x=h(9806);let E=l.MouseService=class{constructor(M,S){this._renderService=M,this._charSizeService=S}getCoords(M,S,_,p,f){return(0,x.getCoords)(window,M,S,_,p,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,f)}getMouseReportCoords(M,S){const _=(0,x.getCoordsRelativeToElement)(window,M,S);if(this._charSizeService.hasValidSize)return _[0]=Math.min(Math.max(_[0],0),this._renderService.dimensions.css.canvas.width-1),_[1]=Math.min(Math.max(_[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(_[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(_[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(_[0]),y:Math.floor(_[1])}}};l.MouseService=E=u([y(0,d.IRenderService),y(1,d.ICharSizeService)],E)},3230:function(T,l,h){var u=this&&this.__decorate||function(f,v,b,R){var A,O=arguments.length,w=O<3?v:R===null?R=Object.getOwnPropertyDescriptor(v,b):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(f,v,b,R);else for(var j=f.length-1;j>=0;j--)(A=f[j])&&(w=(O<3?A(w):O>3?A(v,b,w):A(v,b))||w);return O>3&&w&&Object.defineProperty(v,b,w),w},y=this&&this.__param||function(f,v){return function(b,R){v(b,R,f)}};Object.defineProperty(l,"__esModule",{value:!0}),l.RenderService=void 0;const d=h(6193),x=h(4725),E=h(8460),M=h(844),S=h(7226),_=h(2585);let p=l.RenderService=class extends M.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(f,v,b,R,A,O,w,j){super(),this._rowCount=f,this._charSizeService=R,this._renderer=this.register(new M.MutableDisposable),this._pausedResizeTask=new S.DebouncedIdleTask,this._observerDisposable=this.register(new M.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,Z)=>this._renderRows(I,Z)),w),this.register(this._renderDebouncer),this.register(w.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(O.onResize((()=>this._fullRefresh()))),this.register(O.buffers.onBufferActivate((()=>{var I;return(I=this._renderer.value)==null?void 0:I.clear()}))),this.register(b.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(A.onDecorationRegistered((()=>this._fullRefresh()))),this.register(A.onDecorationRemoved((()=>this._fullRefresh()))),this.register(b.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(O.cols,O.rows),this._fullRefresh()}))),this.register(b.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(O.buffer.y,O.buffer.y,!0)))),this.register(j.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 b=new f.IntersectionObserver((R=>this._handleIntersectionChange(R[R.length-1])),{threshold:0});b.observe(v),this._observerDisposable.value=(0,M.toDisposable)((()=>b.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,b=!1){this._isPaused?this._needsFullRefresh=!0:(b||(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 b;return(b=this._renderer.value)==null?void 0:b.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,b){var R;this._selectionState.start=f,this._selectionState.end=v,this._selectionState.columnSelectMode=b,(R=this._renderer.value)==null||R.handleSelectionChanged(f,v,b)}handleCursorMove(){var f;(f=this._renderer.value)==null||f.handleCursorMove()}clear(){var f;(f=this._renderer.value)==null||f.clear()}};l.RenderService=p=u([y(2,_.IOptionsService),y(3,x.ICharSizeService),y(4,_.IDecorationService),y(5,_.IBufferService),y(6,x.ICoreBrowserService),y(7,x.IThemeService)],p)},9312:function(T,l,h){var u=this&&this.__decorate||function(w,j,I,Z){var K,$=arguments.length,X=$<3?j:Z===null?Z=Object.getOwnPropertyDescriptor(j,I):Z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")X=Reflect.decorate(w,j,I,Z);else for(var re=w.length-1;re>=0;re--)(K=w[re])&&(X=($<3?K(X):$>3?K(j,I,X):K(j,I))||X);return $>3&&X&&Object.defineProperty(j,I,X),X},y=this&&this.__param||function(w,j){return function(I,Z){j(I,Z,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionService=void 0;const d=h(9806),x=h(9504),E=h(456),M=h(4725),S=h(8460),_=h(844),p=h(6114),f=h(4841),v=h(511),b=h(2585),R=" ",A=new RegExp(R,"g");let O=l.SelectionService=class extends _.Disposable{constructor(w,j,I,Z,K,$,X,re,q){super(),this._element=w,this._screenElement=j,this._linkifier=I,this._bufferService=Z,this._coreService=K,this._mouseService=$,this._optionsService=X,this._renderService=re,this._coreBrowserService=q,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 S.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new S.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new S.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new S.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=ee=>this._handleMouseMove(ee),this._mouseUpListener=ee=>this._handleMouseUp(ee),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((ee=>this._handleTrim(ee))),this.register(this._bufferService.buffers.onBufferActivate((ee=>this._handleBufferActivate(ee)))),this.enable(),this._model=new E.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,_.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const w=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;return!(!w||!j||w[0]===j[0]&&w[1]===j[1])}get selectionText(){const w=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;if(!w||!j)return"";const I=this._bufferService.buffer,Z=[];if(this._activeSelectionMode===3){if(w[0]===j[0])return"";const K=w[0]<j[0]?w[0]:j[0],$=w[0]<j[0]?j[0]:w[0];for(let X=w[1];X<=j[1];X++){const re=I.translateBufferLineToString(X,!0,K,$);Z.push(re)}}else{const K=w[1]===j[1]?j[0]:void 0;Z.push(I.translateBufferLineToString(w[1],!0,w[0],K));for(let $=w[1]+1;$<=j[1]-1;$++){const X=I.lines.get($),re=I.translateBufferLineToString($,!0);X!=null&&X.isWrapped?Z[Z.length-1]+=re:Z.push(re)}if(w[1]!==j[1]){const $=I.lines.get(j[1]),X=I.translateBufferLineToString(j[1],!0,0,j[0]);$&&$.isWrapped?Z[Z.length-1]+=X:Z.push(X)}}return Z.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 j=this._getMouseBufferCoords(w),I=this._model.finalSelectionStart,Z=this._model.finalSelectionEnd;return!!(I&&Z&&j)&&this._areCoordsInSelection(j,I,Z)}isCellInSelection(w,j){const I=this._model.finalSelectionStart,Z=this._model.finalSelectionEnd;return!(!I||!Z)&&this._areCoordsInSelection([w,j],I,Z)}_areCoordsInSelection(w,j,I){return w[1]>j[1]&&w[1]<I[1]||j[1]===I[1]&&w[1]===j[1]&&w[0]>=j[0]&&w[0]<I[0]||j[1]<I[1]&&w[1]===I[1]&&w[0]<I[0]||j[1]<I[1]&&w[1]===j[1]&&w[0]>=j[0]}_selectWordAtCursor(w,j){var K,$;const I=($=(K=this._linkifier.currentLink)==null?void 0:K.link)==null?void 0:$.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 Z=this._getMouseBufferCoords(w);return!!Z&&(this._selectWordAt(Z,j),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(w,j){this._model.clearSelection(),w=Math.max(w,0),j=Math.min(j,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,w],this._model.selectionEnd=[this._bufferService.cols,j],this.refresh(),this._onSelectionChange.fire()}_handleTrim(w){this._model.handleTrim(w)&&this.refresh()}_getMouseBufferCoords(w){const j=this._mouseService.getCoords(w,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(j)return j[0]--,j[1]--,j[1]+=this._bufferService.buffer.ydisp,j}_getMouseEventScrollAmount(w){let j=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,w,this._screenElement)[1];const I=this._renderService.dimensions.css.canvas.height;return j>=0&&j<=I?0:(j>I&&(j-=I),j=Math.min(Math.max(j,-50),50),j/=50,j/Math.abs(j)+Math.round(14*j))}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 j=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);j&&j.length!==this._model.selectionStart[0]&&j.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(w){this._selectWordAtCursor(w,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(w){const j=this._getMouseBufferCoords(w);j&&(this._activeSelectionMode=2,this._selectLineAt(j[1]))}shouldColumnSelect(w){return w.altKey&&!(p.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(w){if(w.stopImmediatePropagation(),!this._model.selectionStart)return;const j=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 Z=I.lines.get(this._model.selectionEnd[1]);Z&&Z.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}j&&j[0]===this._model.selectionEnd[0]&&j[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 j=w.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&j<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 Z=(0,x.moveToCellSequence)(I[0]-1,I[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(Z,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const w=this._model.finalSelectionStart,j=this._model.finalSelectionEnd,I=!(!w||!j||w[0]===j[0]&&w[1]===j[1]);I?w&&j&&(this._oldSelectionStart&&this._oldSelectionEnd&&w[0]===this._oldSelectionStart[0]&&w[1]===this._oldSelectionStart[1]&&j[0]===this._oldSelectionEnd[0]&&j[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(w,j,I)):this._oldHasSelection&&this._fireOnSelectionChange(w,j,I)}_fireOnSelectionChange(w,j,I){this._oldSelectionStart=w,this._oldSelectionEnd=j,this._oldHasSelection=I,this._onSelectionChange.fire()}_handleBufferActivate(w){this.clearSelection(),this._trimListener.dispose(),this._trimListener=w.activeBuffer.lines.onTrim((j=>this._handleTrim(j)))}_convertViewportColToCharacterIndex(w,j){let I=j;for(let Z=0;j>=Z;Z++){const K=w.loadCell(Z,this._workCell).getChars().length;this._workCell.getWidth()===0?I--:K>1&&j!==Z&&(I+=K-1)}return I}setSelection(w,j,I){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[w,j],this._model.selectionStartLength=I,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(w){this._isClickInSelection(w)||(this._selectWordAtCursor(w,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(w,j,I=!0,Z=!0){if(w[0]>=this._bufferService.cols)return;const K=this._bufferService.buffer,$=K.lines.get(w[1]);if(!$)return;const X=K.translateBufferLineToString(w[1],!1);let re=this._convertViewportColToCharacterIndex($,w[0]),q=re;const ee=w[0]-re;let J=0,N=0,B=0,L=0;if(X.charAt(re)===" "){for(;re>0&&X.charAt(re-1)===" ";)re--;for(;q<X.length&&X.charAt(q+1)===" ";)q++}else{let Q=w[0],fe=w[0];$.getWidth(Q)===0&&(J++,Q--),$.getWidth(fe)===2&&(N++,fe++);const de=$.getString(fe).length;for(de>1&&(L+=de-1,q+=de-1);Q>0&&re>0&&!this._isCharWordSeparator($.loadCell(Q-1,this._workCell));){$.loadCell(Q-1,this._workCell);const G=this._workCell.getChars().length;this._workCell.getWidth()===0?(J++,Q--):G>1&&(B+=G-1,re-=G-1),re--,Q--}for(;fe<$.length&&q+1<X.length&&!this._isCharWordSeparator($.loadCell(fe+1,this._workCell));){$.loadCell(fe+1,this._workCell);const G=this._workCell.getChars().length;this._workCell.getWidth()===2?(N++,fe++):G>1&&(L+=G-1,q+=G-1),q++,fe++}}q++;let z=re+ee-J+B,V=Math.min(this._bufferService.cols,q-re+J+N-B-L);if(j||X.slice(re,q).trim()!==""){if(I&&z===0&&$.getCodePoint(0)!==32){const Q=K.lines.get(w[1]-1);if(Q&&$.isWrapped&&Q.getCodePoint(this._bufferService.cols-1)!==32){const fe=this._getWordAt([this._bufferService.cols-1,w[1]-1],!1,!0,!1);if(fe){const de=this._bufferService.cols-fe.start;z-=de,V+=de}}}if(Z&&z+V===this._bufferService.cols&&$.getCodePoint(this._bufferService.cols-1)!==32){const Q=K.lines.get(w[1]+1);if(Q!=null&&Q.isWrapped&&Q.getCodePoint(0)!==32){const fe=this._getWordAt([0,w[1]+1],!1,!1,!0);fe&&(V+=fe.length)}}return{start:z,length:V}}}_selectWordAt(w,j){const I=this._getWordAt(w,j);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 j=this._getWordAt(w,!0);if(j){let I=w[1];for(;j.start<0;)j.start+=this._bufferService.cols,I--;if(!this._model.areSelectionValuesReversed())for(;j.start+j.length>this._bufferService.cols;)j.length-=this._bufferService.cols,I++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?j.start:j.start+j.length,I]}}_isCharWordSeparator(w){return w.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(w.getChars())>=0}_selectLineAt(w){const j=this._bufferService.buffer.getWrappedRangeForLine(w),I={start:{x:0,y:j.first},end:{x:this._bufferService.cols-1,y:j.last}};this._model.selectionStart=[0,j.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,f.getRangeLength)(I,this._bufferService.cols)}};l.SelectionService=O=u([y(3,b.IBufferService),y(4,b.ICoreService),y(5,M.IMouseService),y(6,b.IOptionsService),y(7,M.IRenderService),y(8,M.ICoreBrowserService)],O)},4725:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ILinkProviderService=l.IThemeService=l.ICharacterJoinerService=l.ISelectionService=l.IRenderService=l.IMouseService=l.ICoreBrowserService=l.ICharSizeService=void 0;const u=h(8343);l.ICharSizeService=(0,u.createDecorator)("CharSizeService"),l.ICoreBrowserService=(0,u.createDecorator)("CoreBrowserService"),l.IMouseService=(0,u.createDecorator)("MouseService"),l.IRenderService=(0,u.createDecorator)("RenderService"),l.ISelectionService=(0,u.createDecorator)("SelectionService"),l.ICharacterJoinerService=(0,u.createDecorator)("CharacterJoinerService"),l.IThemeService=(0,u.createDecorator)("ThemeService"),l.ILinkProviderService=(0,u.createDecorator)("LinkProviderService")},6731:function(T,l,h){var u=this&&this.__decorate||function(O,w,j,I){var Z,K=arguments.length,$=K<3?w:I===null?I=Object.getOwnPropertyDescriptor(w,j):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(O,w,j,I);else for(var X=O.length-1;X>=0;X--)(Z=O[X])&&($=(K<3?Z($):K>3?Z(w,j,$):Z(w,j))||$);return K>3&&$&&Object.defineProperty(w,j,$),$},y=this&&this.__param||function(O,w){return function(j,I){w(j,I,O)}};Object.defineProperty(l,"__esModule",{value:!0}),l.ThemeService=l.DEFAULT_ANSI_COLORS=void 0;const d=h(7239),x=h(8055),E=h(8460),M=h(844),S=h(2585),_=x.css.toColor("#ffffff"),p=x.css.toColor("#000000"),f=x.css.toColor("#ffffff"),v=x.css.toColor("#000000"),b={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};l.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const O=[x.css.toColor("#2e3436"),x.css.toColor("#cc0000"),x.css.toColor("#4e9a06"),x.css.toColor("#c4a000"),x.css.toColor("#3465a4"),x.css.toColor("#75507b"),x.css.toColor("#06989a"),x.css.toColor("#d3d7cf"),x.css.toColor("#555753"),x.css.toColor("#ef2929"),x.css.toColor("#8ae234"),x.css.toColor("#fce94f"),x.css.toColor("#729fcf"),x.css.toColor("#ad7fa8"),x.css.toColor("#34e2e2"),x.css.toColor("#eeeeec")],w=[0,95,135,175,215,255];for(let j=0;j<216;j++){const I=w[j/36%6|0],Z=w[j/6%6|0],K=w[j%6];O.push({css:x.channels.toCss(I,Z,K),rgba:x.channels.toRgba(I,Z,K)})}for(let j=0;j<24;j++){const I=8+10*j;O.push({css:x.channels.toCss(I,I,I),rgba:x.channels.toRgba(I,I,I)})}return O})());let R=l.ThemeService=class extends M.Disposable{get colors(){return this._colors}constructor(O){super(),this._optionsService=O,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:_,background:p,cursor:f,cursorAccent:v,selectionForeground:void 0,selectionBackgroundTransparent:b,selectionBackgroundOpaque:x.color.blend(p,b),selectionInactiveBackgroundTransparent:b,selectionInactiveBackgroundOpaque:x.color.blend(p,b),ansi:l.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(O={}){const w=this._colors;if(w.foreground=A(O.foreground,_),w.background=A(O.background,p),w.cursor=A(O.cursor,f),w.cursorAccent=A(O.cursorAccent,v),w.selectionBackgroundTransparent=A(O.selectionBackground,b),w.selectionBackgroundOpaque=x.color.blend(w.background,w.selectionBackgroundTransparent),w.selectionInactiveBackgroundTransparent=A(O.selectionInactiveBackground,w.selectionBackgroundTransparent),w.selectionInactiveBackgroundOpaque=x.color.blend(w.background,w.selectionInactiveBackgroundTransparent),w.selectionForeground=O.selectionForeground?A(O.selectionForeground,x.NULL_COLOR):void 0,w.selectionForeground===x.NULL_COLOR&&(w.selectionForeground=void 0),x.color.isOpaque(w.selectionBackgroundTransparent)&&(w.selectionBackgroundTransparent=x.color.opacity(w.selectionBackgroundTransparent,.3)),x.color.isOpaque(w.selectionInactiveBackgroundTransparent)&&(w.selectionInactiveBackgroundTransparent=x.color.opacity(w.selectionInactiveBackgroundTransparent,.3)),w.ansi=l.DEFAULT_ANSI_COLORS.slice(),w.ansi[0]=A(O.black,l.DEFAULT_ANSI_COLORS[0]),w.ansi[1]=A(O.red,l.DEFAULT_ANSI_COLORS[1]),w.ansi[2]=A(O.green,l.DEFAULT_ANSI_COLORS[2]),w.ansi[3]=A(O.yellow,l.DEFAULT_ANSI_COLORS[3]),w.ansi[4]=A(O.blue,l.DEFAULT_ANSI_COLORS[4]),w.ansi[5]=A(O.magenta,l.DEFAULT_ANSI_COLORS[5]),w.ansi[6]=A(O.cyan,l.DEFAULT_ANSI_COLORS[6]),w.ansi[7]=A(O.white,l.DEFAULT_ANSI_COLORS[7]),w.ansi[8]=A(O.brightBlack,l.DEFAULT_ANSI_COLORS[8]),w.ansi[9]=A(O.brightRed,l.DEFAULT_ANSI_COLORS[9]),w.ansi[10]=A(O.brightGreen,l.DEFAULT_ANSI_COLORS[10]),w.ansi[11]=A(O.brightYellow,l.DEFAULT_ANSI_COLORS[11]),w.ansi[12]=A(O.brightBlue,l.DEFAULT_ANSI_COLORS[12]),w.ansi[13]=A(O.brightMagenta,l.DEFAULT_ANSI_COLORS[13]),w.ansi[14]=A(O.brightCyan,l.DEFAULT_ANSI_COLORS[14]),w.ansi[15]=A(O.brightWhite,l.DEFAULT_ANSI_COLORS[15]),O.extendedAnsi){const j=Math.min(w.ansi.length-16,O.extendedAnsi.length);for(let I=0;I<j;I++)w.ansi[I+16]=A(O.extendedAnsi[I],l.DEFAULT_ANSI_COLORS[I+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(O){this._restoreColor(O),this._onChangeColors.fire(this.colors)}_restoreColor(O){if(O!==void 0)switch(O){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[O]=this._restoreColors.ansi[O]}else for(let w=0;w<this._restoreColors.ansi.length;++w)this._colors.ansi[w]=this._restoreColors.ansi[w]}modifyColors(O){O(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(O,w){if(O!==void 0)try{return x.css.toColor(O)}catch{}return w}l.ThemeService=R=u([y(0,S.IOptionsService)],R)},6349:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CircularList=void 0;const u=h(8460),y=h(844);class d extends y.Disposable{constructor(E){super(),this._maxLength=E,this.onDeleteEmitter=this.register(new u.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new u.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new u.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(E){if(this._maxLength===E)return;const M=new Array(E);for(let S=0;S<Math.min(E,this.length);S++)M[S]=this._array[this._getCyclicIndex(S)];this._array=M,this._maxLength=E,this._startIndex=0}get length(){return this._length}set length(E){if(E>this._length)for(let M=this._length;M<E;M++)this._array[M]=void 0;this._length=E}get(E){return this._array[this._getCyclicIndex(E)]}set(E,M){this._array[this._getCyclicIndex(E)]=M}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,M,...S){if(M){for(let _=E;_<this._length-M;_++)this._array[this._getCyclicIndex(_)]=this._array[this._getCyclicIndex(_+M)];this._length-=M,this.onDeleteEmitter.fire({index:E,amount:M})}for(let _=this._length-1;_>=E;_--)this._array[this._getCyclicIndex(_+S.length)]=this._array[this._getCyclicIndex(_)];for(let _=0;_<S.length;_++)this._array[this._getCyclicIndex(E+_)]=S[_];if(S.length&&this.onInsertEmitter.fire({index:E,amount:S.length}),this._length+S.length>this._maxLength){const _=this._length+S.length-this._maxLength;this._startIndex+=_,this._length=this._maxLength,this.onTrimEmitter.fire(_)}else this._length+=S.length}trimStart(E){E>this._length&&(E=this._length),this._startIndex+=E,this._length-=E,this.onTrimEmitter.fire(E)}shiftElements(E,M,S){if(!(M<=0)){if(E<0||E>=this._length)throw new Error("start argument out of range");if(E+S<0)throw new Error("Cannot shift elements in list beyond index 0");if(S>0){for(let p=M-1;p>=0;p--)this.set(E+p+S,this.get(E+p));const _=E+M+S-this._length;if(_>0)for(this._length+=_;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let _=0;_<M;_++)this.set(E+_+S,this.get(E+_))}}_getCyclicIndex(E){return(this._startIndex+E)%this._maxLength}}l.CircularList=d},1439:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.clone=void 0,l.clone=function h(u,y=5){if(typeof u!="object")return u;const d=Array.isArray(u)?[]:{};for(const x in u)d[x]=y<=1?u[x]:u[x]&&h(u[x],y-1);return d}},8055:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.contrastRatio=l.toPaddedHex=l.rgba=l.rgb=l.css=l.color=l.channels=l.NULL_COLOR=void 0;let h=0,u=0,y=0,d=0;var x,E,M,S,_;function p(v){const b=v.toString(16);return b.length<2?"0"+b:b}function f(v,b){return v<b?(b+.05)/(v+.05):(v+.05)/(b+.05)}l.NULL_COLOR={css:"#00000000",rgba:0},(function(v){v.toCss=function(b,R,A,O){return O!==void 0?`#${p(b)}${p(R)}${p(A)}${p(O)}`:`#${p(b)}${p(R)}${p(A)}`},v.toRgba=function(b,R,A,O=255){return(b<<24|R<<16|A<<8|O)>>>0},v.toColor=function(b,R,A,O){return{css:v.toCss(b,R,A,O),rgba:v.toRgba(b,R,A,O)}}})(x||(l.channels=x={})),(function(v){function b(R,A){return d=Math.round(255*A),[h,u,y]=_.toChannels(R.rgba),{css:x.toCss(h,u,y,d),rgba:x.toRgba(h,u,y,d)}}v.blend=function(R,A){if(d=(255&A.rgba)/255,d===1)return{css:A.css,rgba:A.rgba};const O=A.rgba>>24&255,w=A.rgba>>16&255,j=A.rgba>>8&255,I=R.rgba>>24&255,Z=R.rgba>>16&255,K=R.rgba>>8&255;return h=I+Math.round((O-I)*d),u=Z+Math.round((w-Z)*d),y=K+Math.round((j-K)*d),{css:x.toCss(h,u,y),rgba:x.toRgba(h,u,y)}},v.isOpaque=function(R){return(255&R.rgba)==255},v.ensureContrastRatio=function(R,A,O){const w=_.ensureContrastRatio(R.rgba,A.rgba,O);if(w)return x.toColor(w>>24&255,w>>16&255,w>>8&255)},v.opaque=function(R){const A=(255|R.rgba)>>>0;return[h,u,y]=_.toChannels(A),{css:x.toCss(h,u,y),rgba:A}},v.opacity=b,v.multiplyOpacity=function(R,A){return d=255&R.rgba,b(R,d*A/255)},v.toColorRGB=function(R){return[R.rgba>>24&255,R.rgba>>16&255,R.rgba>>8&255]}})(E||(l.color=E={})),(function(v){let b,R;try{const A=document.createElement("canvas");A.width=1,A.height=1;const O=A.getContext("2d",{willReadFrequently:!0});O&&(b=O,b.globalCompositeOperation="copy",R=b.createLinearGradient(0,0,1,1))}catch{}v.toColor=function(A){if(A.match(/#[\da-f]{3,8}/i))switch(A.length){case 4:return h=parseInt(A.slice(1,2).repeat(2),16),u=parseInt(A.slice(2,3).repeat(2),16),y=parseInt(A.slice(3,4).repeat(2),16),x.toColor(h,u,y);case 5:return h=parseInt(A.slice(1,2).repeat(2),16),u=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),x.toColor(h,u,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 O=A.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(O)return h=parseInt(O[1]),u=parseInt(O[2]),y=parseInt(O[3]),d=Math.round(255*(O[5]===void 0?1:parseFloat(O[5]))),x.toColor(h,u,y,d);if(!b||!R)throw new Error("css.toColor: Unsupported css format");if(b.fillStyle=R,b.fillStyle=A,typeof b.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(b.fillRect(0,0,1,1),[h,u,y,d]=b.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:x.toRgba(h,u,y,d),css:A}}})(M||(l.css=M={})),(function(v){function b(R,A,O){const w=R/255,j=A/255,I=O/255;return .2126*(w<=.03928?w/12.92:Math.pow((w+.055)/1.055,2.4))+.7152*(j<=.03928?j/12.92:Math.pow((j+.055)/1.055,2.4))+.0722*(I<=.03928?I/12.92:Math.pow((I+.055)/1.055,2.4))}v.relativeLuminance=function(R){return b(R>>16&255,R>>8&255,255&R)},v.relativeLuminance2=b})(S||(l.rgb=S={})),(function(v){function b(A,O,w){const j=A>>24&255,I=A>>16&255,Z=A>>8&255;let K=O>>24&255,$=O>>16&255,X=O>>8&255,re=f(S.relativeLuminance2(K,$,X),S.relativeLuminance2(j,I,Z));for(;re<w&&(K>0||$>0||X>0);)K-=Math.max(0,Math.ceil(.1*K)),$-=Math.max(0,Math.ceil(.1*$)),X-=Math.max(0,Math.ceil(.1*X)),re=f(S.relativeLuminance2(K,$,X),S.relativeLuminance2(j,I,Z));return(K<<24|$<<16|X<<8|255)>>>0}function R(A,O,w){const j=A>>24&255,I=A>>16&255,Z=A>>8&255;let K=O>>24&255,$=O>>16&255,X=O>>8&255,re=f(S.relativeLuminance2(K,$,X),S.relativeLuminance2(j,I,Z));for(;re<w&&(K<255||$<255||X<255);)K=Math.min(255,K+Math.ceil(.1*(255-K))),$=Math.min(255,$+Math.ceil(.1*(255-$))),X=Math.min(255,X+Math.ceil(.1*(255-X))),re=f(S.relativeLuminance2(K,$,X),S.relativeLuminance2(j,I,Z));return(K<<24|$<<16|X<<8|255)>>>0}v.blend=function(A,O){if(d=(255&O)/255,d===1)return O;const w=O>>24&255,j=O>>16&255,I=O>>8&255,Z=A>>24&255,K=A>>16&255,$=A>>8&255;return h=Z+Math.round((w-Z)*d),u=K+Math.round((j-K)*d),y=$+Math.round((I-$)*d),x.toRgba(h,u,y)},v.ensureContrastRatio=function(A,O,w){const j=S.relativeLuminance(A>>8),I=S.relativeLuminance(O>>8);if(f(j,I)<w){if(I<j){const $=b(A,O,w),X=f(j,S.relativeLuminance($>>8));if(X<w){const re=R(A,O,w);return X>f(j,S.relativeLuminance(re>>8))?$:re}return $}const Z=R(A,O,w),K=f(j,S.relativeLuminance(Z>>8));if(K<w){const $=b(A,O,w);return K>f(j,S.relativeLuminance($>>8))?Z:$}return Z}},v.reduceLuminance=b,v.increaseLuminance=R,v.toChannels=function(A){return[A>>24&255,A>>16&255,A>>8&255,255&A]}})(_||(l.rgba=_={})),l.toPaddedHex=p,l.contrastRatio=f},8969:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreTerminal=void 0;const u=h(844),y=h(2585),d=h(4348),x=h(7866),E=h(744),M=h(7302),S=h(6975),_=h(8460),p=h(1753),f=h(1480),v=h(7994),b=h(9282),R=h(5435),A=h(5981),O=h(2660);let w=!1;class j extends u.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new _.EventEmitter),this._onScroll.event((Z=>{var K;(K=this._onScrollApi)==null||K.fire(Z.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(Z){for(const K in Z)this.optionsService.options[K]=Z[K]}constructor(Z){super(),this._windowsWrappingHeuristics=this.register(new u.MutableDisposable),this._onBinary=this.register(new _.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new _.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new _.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new _.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new _.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new _.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new M.OptionsService(Z)),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(x.LogService)),this._instantiationService.setService(y.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(S.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(O.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,_.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,_.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,_.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,_.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((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,$)=>this._inputHandler.parse(K,$)))),this.register((0,_.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(Z,K){this._writeBuffer.write(Z,K)}writeSync(Z,K){this._logService.logLevel<=y.LogLevelEnum.WARN&&!w&&(this._logService.warn("writeSync is unreliable and will be removed soon."),w=!0),this._writeBuffer.writeSync(Z,K)}input(Z,K=!0){this.coreService.triggerDataEvent(Z,K)}resize(Z,K){isNaN(Z)||isNaN(K)||(Z=Math.max(Z,E.MINIMUM_COLS),K=Math.max(K,E.MINIMUM_ROWS),this._bufferService.resize(Z,K))}scroll(Z,K=!1){this._bufferService.scroll(Z,K)}scrollLines(Z,K,$){this._bufferService.scrollLines(Z,K,$)}scrollPages(Z){this.scrollLines(Z*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(Z){const K=Z-this._bufferService.buffer.ydisp;K!==0&&this.scrollLines(K)}registerEscHandler(Z,K){return this._inputHandler.registerEscHandler(Z,K)}registerDcsHandler(Z,K){return this._inputHandler.registerDcsHandler(Z,K)}registerCsiHandler(Z,K){return this._inputHandler.registerCsiHandler(Z,K)}registerOscHandler(Z,K){return this._inputHandler.registerOscHandler(Z,K)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let Z=!1;const K=this.optionsService.rawOptions.windowsPty;K&&K.buildNumber!==void 0&&K.buildNumber!==void 0?Z=K.backend==="conpty"&&K.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(Z=!0),Z?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const Z=[];Z.push(this.onLineFeed(b.updateWindowsModeWrappedState.bind(null,this._bufferService))),Z.push(this.registerCsiHandler({final:"H"},(()=>((0,b.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,u.toDisposable)((()=>{for(const K of Z)K.dispose()}))}}}l.CoreTerminal=j},8460:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.runAndSubscribe=l.forwardEvent=l.EventEmitter=void 0,l.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=h=>(this._listeners.push(h),{dispose:()=>{if(!this._disposed){for(let u=0;u<this._listeners.length;u++)if(this._listeners[u]===h)return void this._listeners.splice(u,1)}}})),this._event}fire(h,u){const y=[];for(let 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,h,u)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},l.forwardEvent=function(h,u){return h((y=>u.fire(y)))},l.runAndSubscribe=function(h,u){return u(void 0),h((y=>u(y)))}},5435:function(T,l,h){var u=this&&this.__decorate||function(J,N,B,L){var z,V=arguments.length,Q=V<3?N:L===null?L=Object.getOwnPropertyDescriptor(N,B):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Q=Reflect.decorate(J,N,B,L);else for(var fe=J.length-1;fe>=0;fe--)(z=J[fe])&&(Q=(V<3?z(Q):V>3?z(N,B,Q):z(N,B))||Q);return V>3&&Q&&Object.defineProperty(N,B,Q),Q},y=this&&this.__param||function(J,N){return function(B,L){N(B,L,J)}};Object.defineProperty(l,"__esModule",{value:!0}),l.InputHandler=l.WindowsOptionsReportType=void 0;const d=h(2584),x=h(7116),E=h(2015),M=h(844),S=h(482),_=h(8437),p=h(8460),f=h(643),v=h(511),b=h(3734),R=h(2585),A=h(1480),O=h(6242),w=h(6351),j=h(5941),I={"(":0,")":1,"*":2,"+":3,"-":1,".":2},Z=131072;function K(J,N){if(J>24)return N.setWinLines||!1;switch(J){case 1:return!!N.restoreWin;case 2:return!!N.minimizeWin;case 3:return!!N.setWinPosition;case 4:return!!N.setWinSizePixels;case 5:return!!N.raiseWin;case 6:return!!N.lowerWin;case 7:return!!N.refreshWin;case 8:return!!N.setWinSizeChars;case 9:return!!N.maximizeWin;case 10:return!!N.fullscreenWin;case 11:return!!N.getWinState;case 13:return!!N.getWinPosition;case 14:return!!N.getWinSizePixels;case 15:return!!N.getScreenSizePixels;case 16:return!!N.getCellSizePixels;case 18:return!!N.getWinSizeChars;case 19:return!!N.getScreenSizeChars;case 20:return!!N.getIconTitle;case 21:return!!N.getWinTitle;case 22:return!!N.pushTitle;case 23:return!!N.popTitle;case 24:return!!N.setWinLines}return!1}var $;(function(J){J[J.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",J[J.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})($||(l.WindowsOptionsReportType=$={}));let X=0;class re extends M.Disposable{getAttrData(){return this._curAttrData}constructor(N,B,L,z,V,Q,fe,de,G=new E.EscapeSequenceParser){super(),this._bufferService=N,this._charsetService=B,this._coreService=L,this._logService=z,this._optionsService=V,this._oscLinkService=Q,this._coreMouseService=fe,this._unicodeService=de,this._parser=G,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new S.StringToUtf32,this._utf8Decoder=new S.Utf8ToUtf32,this._workCell=new v.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=_.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=_.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new 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 q(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((U=>this._activeBuffer=U.activeBuffer))),this._parser.setCsiHandlerFallback(((U,le)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(U),params:le.toArray()})})),this._parser.setEscHandlerFallback((U=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(U)})})),this._parser.setExecuteHandlerFallback((U=>{this._logService.debug("Unknown EXECUTE code: ",{code:U})})),this._parser.setOscHandlerFallback(((U,le,ae)=>{this._logService.debug("Unknown OSC code: ",{identifier:U,action:le,data:ae})})),this._parser.setDcsHandlerFallback(((U,le,ae)=>{le==="HOOK"&&(ae=ae.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(U),action:le,payload:ae})})),this._parser.setPrintHandler(((U,le,ae)=>this.print(U,le,ae))),this._parser.registerCsiHandler({final:"@"},(U=>this.insertChars(U))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(U=>this.scrollLeft(U))),this._parser.registerCsiHandler({final:"A"},(U=>this.cursorUp(U))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(U=>this.scrollRight(U))),this._parser.registerCsiHandler({final:"B"},(U=>this.cursorDown(U))),this._parser.registerCsiHandler({final:"C"},(U=>this.cursorForward(U))),this._parser.registerCsiHandler({final:"D"},(U=>this.cursorBackward(U))),this._parser.registerCsiHandler({final:"E"},(U=>this.cursorNextLine(U))),this._parser.registerCsiHandler({final:"F"},(U=>this.cursorPrecedingLine(U))),this._parser.registerCsiHandler({final:"G"},(U=>this.cursorCharAbsolute(U))),this._parser.registerCsiHandler({final:"H"},(U=>this.cursorPosition(U))),this._parser.registerCsiHandler({final:"I"},(U=>this.cursorForwardTab(U))),this._parser.registerCsiHandler({final:"J"},(U=>this.eraseInDisplay(U,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(U=>this.eraseInDisplay(U,!0))),this._parser.registerCsiHandler({final:"K"},(U=>this.eraseInLine(U,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(U=>this.eraseInLine(U,!0))),this._parser.registerCsiHandler({final:"L"},(U=>this.insertLines(U))),this._parser.registerCsiHandler({final:"M"},(U=>this.deleteLines(U))),this._parser.registerCsiHandler({final:"P"},(U=>this.deleteChars(U))),this._parser.registerCsiHandler({final:"S"},(U=>this.scrollUp(U))),this._parser.registerCsiHandler({final:"T"},(U=>this.scrollDown(U))),this._parser.registerCsiHandler({final:"X"},(U=>this.eraseChars(U))),this._parser.registerCsiHandler({final:"Z"},(U=>this.cursorBackwardTab(U))),this._parser.registerCsiHandler({final:"`"},(U=>this.charPosAbsolute(U))),this._parser.registerCsiHandler({final:"a"},(U=>this.hPositionRelative(U))),this._parser.registerCsiHandler({final:"b"},(U=>this.repeatPrecedingCharacter(U))),this._parser.registerCsiHandler({final:"c"},(U=>this.sendDeviceAttributesPrimary(U))),this._parser.registerCsiHandler({prefix:">",final:"c"},(U=>this.sendDeviceAttributesSecondary(U))),this._parser.registerCsiHandler({final:"d"},(U=>this.linePosAbsolute(U))),this._parser.registerCsiHandler({final:"e"},(U=>this.vPositionRelative(U))),this._parser.registerCsiHandler({final:"f"},(U=>this.hVPosition(U))),this._parser.registerCsiHandler({final:"g"},(U=>this.tabClear(U))),this._parser.registerCsiHandler({final:"h"},(U=>this.setMode(U))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(U=>this.setModePrivate(U))),this._parser.registerCsiHandler({final:"l"},(U=>this.resetMode(U))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(U=>this.resetModePrivate(U))),this._parser.registerCsiHandler({final:"m"},(U=>this.charAttributes(U))),this._parser.registerCsiHandler({final:"n"},(U=>this.deviceStatus(U))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(U=>this.deviceStatusPrivate(U))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(U=>this.softReset(U))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(U=>this.setCursorStyle(U))),this._parser.registerCsiHandler({final:"r"},(U=>this.setScrollRegion(U))),this._parser.registerCsiHandler({final:"s"},(U=>this.saveCursor(U))),this._parser.registerCsiHandler({final:"t"},(U=>this.windowOptions(U))),this._parser.registerCsiHandler({final:"u"},(U=>this.restoreCursor(U))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(U=>this.insertColumns(U))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(U=>this.deleteColumns(U))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(U=>this.selectProtected(U))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(U=>this.requestMode(U,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(U=>this.requestMode(U,!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 O.OscHandler((U=>(this.setTitle(U),this.setIconName(U),!0)))),this._parser.registerOscHandler(1,new O.OscHandler((U=>this.setIconName(U)))),this._parser.registerOscHandler(2,new O.OscHandler((U=>this.setTitle(U)))),this._parser.registerOscHandler(4,new O.OscHandler((U=>this.setOrReportIndexedColor(U)))),this._parser.registerOscHandler(8,new O.OscHandler((U=>this.setHyperlink(U)))),this._parser.registerOscHandler(10,new O.OscHandler((U=>this.setOrReportFgColor(U)))),this._parser.registerOscHandler(11,new O.OscHandler((U=>this.setOrReportBgColor(U)))),this._parser.registerOscHandler(12,new O.OscHandler((U=>this.setOrReportCursorColor(U)))),this._parser.registerOscHandler(104,new O.OscHandler((U=>this.restoreIndexedColor(U)))),this._parser.registerOscHandler(110,new O.OscHandler((U=>this.restoreFgColor(U)))),this._parser.registerOscHandler(111,new O.OscHandler((U=>this.restoreBgColor(U)))),this._parser.registerOscHandler(112,new O.OscHandler((U=>this.restoreCursorColor(U)))),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 U in x.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:U},(()=>this.selectCharset("("+U))),this._parser.registerEscHandler({intermediates:")",final:U},(()=>this.selectCharset(")"+U))),this._parser.registerEscHandler({intermediates:"*",final:U},(()=>this.selectCharset("*"+U))),this._parser.registerEscHandler({intermediates:"+",final:U},(()=>this.selectCharset("+"+U))),this._parser.registerEscHandler({intermediates:"-",final:U},(()=>this.selectCharset("-"+U))),this._parser.registerEscHandler({intermediates:".",final:U},(()=>this.selectCharset("."+U))),this._parser.registerEscHandler({intermediates:"/",final:U},(()=>this.selectCharset("/"+U)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((U=>(this._logService.error("Parsing error: ",U),U))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new w.DcsHandler(((U,le)=>this.requestStatusString(U,le))))}_preserveStack(N,B,L,z){this._parseStack.paused=!0,this._parseStack.cursorStartX=N,this._parseStack.cursorStartY=B,this._parseStack.decodedLength=L,this._parseStack.position=z}_logSlowResolvingAsync(N){this._logService.logLevel<=R.LogLevelEnum.WARN&&Promise.race([N,new Promise(((B,L)=>setTimeout((()=>L("#SLOW_TIMEOUT")),5e3)))]).catch((B=>{if(B!=="#SLOW_TIMEOUT")throw B;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(N,B){let L,z=this._activeBuffer.x,V=this._activeBuffer.y,Q=0;const fe=this._parseStack.paused;if(fe){if(L=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,B))return this._logSlowResolvingAsync(L),L;z=this._parseStack.cursorStartX,V=this._parseStack.cursorStartY,this._parseStack.paused=!1,N.length>Z&&(Q=this._parseStack.position+Z)}if(this._logService.logLevel<=R.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof N=="string"?` "${N}"`:` "${Array.prototype.map.call(N,(U=>String.fromCharCode(U))).join("")}"`),typeof N=="string"?N.split("").map((U=>U.charCodeAt(0))):N),this._parseBuffer.length<N.length&&this._parseBuffer.length<Z&&(this._parseBuffer=new Uint32Array(Math.min(N.length,Z))),fe||this._dirtyRowTracker.clearRange(),N.length>Z)for(let U=Q;U<N.length;U+=Z){const le=U+Z<N.length?U+Z:N.length,ae=typeof N=="string"?this._stringDecoder.decode(N.substring(U,le),this._parseBuffer):this._utf8Decoder.decode(N.subarray(U,le),this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,ae))return this._preserveStack(z,V,ae,U),this._logSlowResolvingAsync(L),L}else if(!fe){const U=typeof N=="string"?this._stringDecoder.decode(N,this._parseBuffer):this._utf8Decoder.decode(N,this._parseBuffer);if(L=this._parser.parse(this._parseBuffer,U))return this._preserveStack(z,V,U,0),this._logSlowResolvingAsync(L),L}this._activeBuffer.x===z&&this._activeBuffer.y===V||this._onCursorMove.fire();const de=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),G=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);G<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(G,this._bufferService.rows-1),Math.min(de,this._bufferService.rows-1))}print(N,B,L){let z,V;const Q=this._charsetService.charset,fe=this._optionsService.rawOptions.screenReaderMode,de=this._bufferService.cols,G=this._coreService.decPrivateModes.wraparound,U=this._coreService.modes.insertMode,le=this._curAttrData;let ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&L-B>0&&ae.getWidth(this._activeBuffer.x-1)===2&&ae.setCellFromCodepoint(this._activeBuffer.x-1,0,1,le);let pe=this._parser.precedingJoinState;for(let _e=B;_e<L;++_e){if(z=N[_e],z<127&&Q){const me=Q[String.fromCharCode(z)];me&&(z=me.charCodeAt(0))}const Te=this._unicodeService.charProperties(z,pe);V=A.UnicodeService.extractWidth(Te);const je=A.UnicodeService.extractShouldJoin(Te),Ze=je?A.UnicodeService.extractWidth(pe):0;if(pe=Te,fe&&this._onA11yChar.fire((0,S.stringFromCodePoint)(z)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+V-Ze>de){if(G){const me=ae;let Se=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),ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ze>0&&ae instanceof _.BufferLine&&ae.copyCellsFrom(me,Se,0,Ze,!1);Se<de;)me.setCellFromCodepoint(Se++,0,1,le)}else if(this._activeBuffer.x=de-1,V===2)continue}if(je&&this._activeBuffer.x){const me=ae.getWidth(this._activeBuffer.x-1)?1:2;ae.addCodepointToCell(this._activeBuffer.x-me,z,V);for(let Se=V-Ze;--Se>=0;)ae.setCellFromCodepoint(this._activeBuffer.x++,0,0,le)}else if(U&&(ae.insertCells(this._activeBuffer.x,V-Ze,this._activeBuffer.getNullCell(le)),ae.getWidth(de-1)===2&&ae.setCellFromCodepoint(de-1,f.NULL_CELL_CODE,f.NULL_CELL_WIDTH,le)),ae.setCellFromCodepoint(this._activeBuffer.x++,z,V,le),V>0)for(;--V;)ae.setCellFromCodepoint(this._activeBuffer.x++,0,0,le)}this._parser.precedingJoinState=pe,this._activeBuffer.x<de&&L-B>0&&ae.getWidth(this._activeBuffer.x)===0&&!ae.hasContent(this._activeBuffer.x)&&ae.setCellFromCodepoint(this._activeBuffer.x,0,1,le),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(N,B){return N.final!=="t"||N.prefix||N.intermediates?this._parser.registerCsiHandler(N,B):this._parser.registerCsiHandler(N,(L=>!K(L.params[0],this._optionsService.rawOptions.windowOptions)||B(L)))}registerDcsHandler(N,B){return this._parser.registerDcsHandler(N,new w.DcsHandler(B))}registerEscHandler(N,B){return this._parser.registerEscHandler(N,B)}registerOscHandler(N,B){return this._parser.registerOscHandler(N,new O.OscHandler(B))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var N;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&N.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);B.hasWidth(this._activeBuffer.x)&&!B.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const N=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-N),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(N=this._bufferService.cols-1){this._activeBuffer.x=Math.min(N,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(N,B){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=N,this._activeBuffer.y=this._activeBuffer.scrollTop+B):(this._activeBuffer.x=N,this._activeBuffer.y=B),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(N,B){this._restrictCursor(),this._setCursor(this._activeBuffer.x+N,this._activeBuffer.y+B)}cursorUp(N){const B=this._activeBuffer.y-this._activeBuffer.scrollTop;return B>=0?this._moveCursor(0,-Math.min(B,N.params[0]||1)):this._moveCursor(0,-(N.params[0]||1)),!0}cursorDown(N){const B=this._activeBuffer.scrollBottom-this._activeBuffer.y;return B>=0?this._moveCursor(0,Math.min(B,N.params[0]||1)):this._moveCursor(0,N.params[0]||1),!0}cursorForward(N){return this._moveCursor(N.params[0]||1,0),!0}cursorBackward(N){return this._moveCursor(-(N.params[0]||1),0),!0}cursorNextLine(N){return this.cursorDown(N),this._activeBuffer.x=0,!0}cursorPrecedingLine(N){return this.cursorUp(N),this._activeBuffer.x=0,!0}cursorCharAbsolute(N){return this._setCursor((N.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(N){return this._setCursor(N.length>=2?(N.params[1]||1)-1:0,(N.params[0]||1)-1),!0}charPosAbsolute(N){return this._setCursor((N.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(N){return this._moveCursor(N.params[0]||1,0),!0}linePosAbsolute(N){return this._setCursor(this._activeBuffer.x,(N.params[0]||1)-1),!0}vPositionRelative(N){return this._moveCursor(0,N.params[0]||1),!0}hVPosition(N){return this.cursorPosition(N),!0}tabClear(N){const B=N.params[0];return B===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:B===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(N){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=N.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(N){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=N.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(N){const B=N.params[0];return B===1&&(this._curAttrData.bg|=536870912),B!==2&&B!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(N,B,L,z=!1,V=!1){const Q=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);Q.replaceCells(B,L,this._activeBuffer.getNullCell(this._eraseAttrData()),V),z&&(Q.isWrapped=!1)}_resetBufferLine(N,B=!1){const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);L&&(L.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),B),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+N),L.isWrapped=!1)}eraseInDisplay(N,B=!1){let L;switch(this._restrictCursor(this._bufferService.cols),N.params[0]){case 0:for(L=this._activeBuffer.y,this._dirtyRowTracker.markDirty(L),this._eraseInBufferLine(L++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);L<this._bufferService.rows;L++)this._resetBufferLine(L,B);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,B),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(L+1).isWrapped=!1);L--;)this._resetBufferLine(L,B);this._dirtyRowTracker.markDirty(0);break;case 2:for(L=this._bufferService.rows,this._dirtyRowTracker.markDirty(L-1);L--;)this._resetBufferLine(L,B);this._dirtyRowTracker.markDirty(0);break;case 3:const z=this._activeBuffer.lines.length-this._bufferService.rows;z>0&&(this._activeBuffer.lines.trimStart(z),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-z,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-z,0),this._onScroll.fire(0))}return!0}eraseInLine(N,B=!1){switch(this._restrictCursor(this._bufferService.cols),N.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,B);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,B)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(N){this._restrictCursor();let B=N.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=this._activeBuffer.ybase+this._activeBuffer.y,z=this._bufferService.rows-1-this._activeBuffer.scrollBottom,V=this._bufferService.rows-1+this._activeBuffer.ybase-z+1;for(;B--;)this._activeBuffer.lines.splice(V-1,1),this._activeBuffer.lines.splice(L,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(N){this._restrictCursor();let B=N.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=this._activeBuffer.ybase+this._activeBuffer.y;let z;for(z=this._bufferService.rows-1-this._activeBuffer.scrollBottom,z=this._bufferService.rows-1+this._activeBuffer.ybase-z;B--;)this._activeBuffer.lines.splice(L,1),this._activeBuffer.lines.splice(z,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(N){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.insertCells(this._activeBuffer.x,N.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(N){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.deleteCells(this._activeBuffer.x,N.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(N){let B=N.params[0]||1;for(;B--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(N){let B=N.params[0]||1;for(;B--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(_.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=N.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);z.deleteCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=N.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);z.insertCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=N.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);z.insertCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=N.params[0]||1;for(let L=this._activeBuffer.scrollTop;L<=this._activeBuffer.scrollBottom;++L){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);z.deleteCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),z.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(N){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(N.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(N){const B=this._parser.precedingJoinState;if(!B)return!0;const L=N.params[0]||1,z=A.UnicodeService.extractWidth(B),V=this._activeBuffer.x-z,Q=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(V),fe=new Uint32Array(Q.length*L);let de=0;for(let U=0;U<Q.length;){const le=Q.codePointAt(U)||0;fe[de++]=le,U+=le>65535?2:1}let G=de;for(let U=1;U<L;++U)fe.copyWithin(G,0,de),G+=de;return this.print(fe,0,G),!0}sendDeviceAttributesPrimary(N){return N.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(N){return N.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(N.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(N){return(this._optionsService.rawOptions.termName+"").indexOf(N)===0}setMode(N){for(let B=0;B<N.length;B++)switch(N.params[B]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(N){for(let B=0;B<N.length;B++)switch(N.params[B]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,x.DEFAULT_CHARSET),this._charsetService.setgCharset(1,x.DEFAULT_CHARSET),this._charsetService.setgCharset(2,x.DEFAULT_CHARSET),this._charsetService.setgCharset(3,x.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(N){for(let B=0;B<N.length;B++)switch(N.params[B]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(N){for(let B=0;B<N.length;B++)switch(N.params[B]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),N.params[B]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(N,B){const L=this._coreService.decPrivateModes,{activeProtocol:z,activeEncoding:V}=this._coreMouseService,Q=this._coreService,{buffers:fe,cols:de}=this._bufferService,{active:G,alt:U}=fe,le=this._optionsService.rawOptions,ae=je=>je?1:2,pe=N.params[0];return _e=pe,Te=B?pe===2?4:pe===4?ae(Q.modes.insertMode):pe===12?3:pe===20?ae(le.convertEol):0:pe===1?ae(L.applicationCursorKeys):pe===3?le.windowOptions.setWinLines?de===80?2:de===132?1:0:0:pe===6?ae(L.origin):pe===7?ae(L.wraparound):pe===8?3:pe===9?ae(z==="X10"):pe===12?ae(le.cursorBlink):pe===25?ae(!Q.isCursorHidden):pe===45?ae(L.reverseWraparound):pe===66?ae(L.applicationKeypad):pe===67?4:pe===1e3?ae(z==="VT200"):pe===1002?ae(z==="DRAG"):pe===1003?ae(z==="ANY"):pe===1004?ae(L.sendFocus):pe===1005?4:pe===1006?ae(V==="SGR"):pe===1015?4:pe===1016?ae(V==="SGR_PIXELS"):pe===1048?1:pe===47||pe===1047||pe===1049?ae(G===U):pe===2004?ae(L.bracketedPasteMode):0,Q.triggerDataEvent(`${d.C0.ESC}[${B?"":"?"}${_e};${Te}$y`),!0;var _e,Te}_updateAttrColor(N,B,L,z,V){return B===2?(N|=50331648,N&=-16777216,N|=b.AttributeData.fromColorRGB([L,z,V])):B===5&&(N&=-50331904,N|=33554432|255&L),N}_extractColor(N,B,L){const z=[0,0,-1,0,0,0];let V=0,Q=0;do{if(z[Q+V]=N.params[B+Q],N.hasSubParams(B+Q)){const fe=N.getSubParams(B+Q);let de=0;do z[1]===5&&(V=1),z[Q+de+1+V]=fe[de];while(++de<fe.length&&de+Q+1+V<z.length);break}if(z[1]===5&&Q+V>=2||z[1]===2&&Q+V>=5)break;z[1]&&(V=1)}while(++Q+B<N.length&&Q+V<z.length);for(let fe=2;fe<z.length;++fe)z[fe]===-1&&(z[fe]=0);switch(z[0]){case 38:L.fg=this._updateAttrColor(L.fg,z[1],z[3],z[4],z[5]);break;case 48:L.bg=this._updateAttrColor(L.bg,z[1],z[3],z[4],z[5]);break;case 58:L.extended=L.extended.clone(),L.extended.underlineColor=this._updateAttrColor(L.extended.underlineColor,z[1],z[3],z[4],z[5])}return Q}_processUnderline(N,B){B.extended=B.extended.clone(),(!~N||N>5)&&(N=1),B.extended.underlineStyle=N,B.fg|=268435456,N===0&&(B.fg&=-268435457),B.updateExtended()}_processSGR0(N){N.fg=_.DEFAULT_ATTR_DATA.fg,N.bg=_.DEFAULT_ATTR_DATA.bg,N.extended=N.extended.clone(),N.extended.underlineStyle=0,N.extended.underlineColor&=-67108864,N.updateExtended()}charAttributes(N){if(N.length===1&&N.params[0]===0)return this._processSGR0(this._curAttrData),!0;const B=N.length;let L;const z=this._curAttrData;for(let V=0;V<B;V++)L=N.params[V],L>=30&&L<=37?(z.fg&=-50331904,z.fg|=16777216|L-30):L>=40&&L<=47?(z.bg&=-50331904,z.bg|=16777216|L-40):L>=90&&L<=97?(z.fg&=-50331904,z.fg|=16777224|L-90):L>=100&&L<=107?(z.bg&=-50331904,z.bg|=16777224|L-100):L===0?this._processSGR0(z):L===1?z.fg|=134217728:L===3?z.bg|=67108864:L===4?(z.fg|=268435456,this._processUnderline(N.hasSubParams(V)?N.getSubParams(V)[0]:1,z)):L===5?z.fg|=536870912:L===7?z.fg|=67108864:L===8?z.fg|=1073741824:L===9?z.fg|=2147483648:L===2?z.bg|=134217728:L===21?this._processUnderline(2,z):L===22?(z.fg&=-134217729,z.bg&=-134217729):L===23?z.bg&=-67108865:L===24?(z.fg&=-268435457,this._processUnderline(0,z)):L===25?z.fg&=-536870913:L===27?z.fg&=-67108865:L===28?z.fg&=-1073741825:L===29?z.fg&=2147483647:L===39?(z.fg&=-67108864,z.fg|=16777215&_.DEFAULT_ATTR_DATA.fg):L===49?(z.bg&=-67108864,z.bg|=16777215&_.DEFAULT_ATTR_DATA.bg):L===38||L===48||L===58?V+=this._extractColor(N,V,z):L===53?z.bg|=1073741824:L===55?z.bg&=-1073741825:L===59?(z.extended=z.extended.clone(),z.extended.underlineColor=-1,z.updateExtended()):L===100?(z.fg&=-67108864,z.fg|=16777215&_.DEFAULT_ATTR_DATA.fg,z.bg&=-67108864,z.bg|=16777215&_.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",L);return!0}deviceStatus(N){switch(N.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const B=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${B};${L}R`)}return!0}deviceStatusPrivate(N){if(N.params[0]===6){const B=this._activeBuffer.y+1,L=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${B};${L}R`)}return!0}softReset(N){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=_.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(N){const B=N.params[0]||1;switch(B){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=B%2==1;return this._optionsService.options.cursorBlink=L,!0}setScrollRegion(N){const B=N.params[0]||1;let L;return(N.length<2||(L=N.params[1])>this._bufferService.rows||L===0)&&(L=this._bufferService.rows),L>B&&(this._activeBuffer.scrollTop=B-1,this._activeBuffer.scrollBottom=L-1,this._setCursor(0,0)),!0}windowOptions(N){if(!K(N.params[0],this._optionsService.rawOptions.windowOptions))return!0;const B=N.length>1?N.params[1]:0;switch(N.params[0]){case 14:B!==2&&this._onRequestWindowsOptionsReport.fire($.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire($.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:B!==0&&B!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),B!==0&&B!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:B!==0&&B!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),B!==0&&B!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(N){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(N){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(N){return this._windowTitle=N,this._onTitleChange.fire(N),!0}setIconName(N){return this._iconName=N,!0}setOrReportIndexedColor(N){const B=[],L=N.split(";");for(;L.length>1;){const z=L.shift(),V=L.shift();if(/^\d+$/.exec(z)){const Q=parseInt(z);if(ee(Q))if(V==="?")B.push({type:0,index:Q});else{const fe=(0,j.parseColor)(V);fe&&B.push({type:1,index:Q,color:fe})}}}return B.length&&this._onColor.fire(B),!0}setHyperlink(N){const B=N.split(";");return!(B.length<2)&&(B[1]?this._createHyperlink(B[0],B[1]):!B[0]&&this._finishHyperlink())}_createHyperlink(N,B){this._getCurrentLinkId()&&this._finishHyperlink();const L=N.split(":");let z;const V=L.findIndex((Q=>Q.startsWith("id=")));return V!==-1&&(z=L[V].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:z,uri:B}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(N,B){const L=N.split(";");for(let z=0;z<L.length&&!(B>=this._specialColors.length);++z,++B)if(L[z]==="?")this._onColor.fire([{type:0,index:this._specialColors[B]}]);else{const V=(0,j.parseColor)(L[z]);V&&this._onColor.fire([{type:1,index:this._specialColors[B],color:V}])}return!0}setOrReportFgColor(N){return this._setOrReportSpecialColor(N,0)}setOrReportBgColor(N){return this._setOrReportSpecialColor(N,1)}setOrReportCursorColor(N){return this._setOrReportSpecialColor(N,2)}restoreIndexedColor(N){if(!N)return this._onColor.fire([{type:2}]),!0;const B=[],L=N.split(";");for(let z=0;z<L.length;++z)if(/^\d+$/.exec(L[z])){const V=parseInt(L[z]);ee(V)&&B.push({type:2,index:V})}return B.length&&this._onColor.fire(B),!0}restoreFgColor(N){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(N){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(N){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,x.DEFAULT_CHARSET),!0}selectCharset(N){return N.length!==2?(this.selectDefaultCharset(),!0):(N[0]==="/"||this._charsetService.setgCharset(I[N[0]],x.CHARSETS[N[1]]||x.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const N=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,N,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=_.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=_.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(N){return this._charsetService.setgLevel(N),!0}screenAlignmentPattern(){const N=new v.CellData;N.content=4194373,N.fg=this._curAttrData.fg,N.bg=this._curAttrData.bg,this._setCursor(0,0);for(let B=0;B<this._bufferService.rows;++B){const L=this._activeBuffer.ybase+this._activeBuffer.y+B,z=this._activeBuffer.lines.get(L);z&&(z.fill(N),z.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(N,B){const L=this._bufferService.buffer,z=this._optionsService.rawOptions;return(V=>(this._coreService.triggerDataEvent(`${d.C0.ESC}${V}${d.C0.ESC}\\`),!0))(N==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:N==='"p'?'P1$r61;1"p':N==="r"?`P1$r${L.scrollTop+1};${L.scrollBottom+1}r`:N==="m"?"P1$r0m":N===" q"?`P1$r${{block:2,underline:4,bar:6}[z.cursorStyle]-(z.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(N,B){this._dirtyRowTracker.markRangeDirty(N,B)}}l.InputHandler=re;let q=class{constructor(J){this._bufferService=J,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(J){J<this.start?this.start=J:J>this.end&&(this.end=J)}markRangeDirty(J,N){J>N&&(X=J,J=N,N=X),J<this.start&&(this.start=J),N>this.end&&(this.end=N)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function ee(J){return 0<=J&&J<256}q=u([y(0,R.IBufferService)],q)},844:(T,l)=>{function h(u){for(const y of u)y.dispose();u.length=0}Object.defineProperty(l,"__esModule",{value:!0}),l.getDisposeArrayDisposable=l.disposeArray=l.toDisposable=l.MutableDisposable=l.Disposable=void 0,l.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const u of this._disposables)u.dispose();this._disposables.length=0}register(u){return this._disposables.push(u),u}unregister(u){const y=this._disposables.indexOf(u);y!==-1&&this._disposables.splice(y,1)}},l.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(u){var y;this._isDisposed||u===this._value||((y=this._value)==null||y.dispose(),this._value=u)}clear(){this.value=void 0}dispose(){var u;this._isDisposed=!0,(u=this._value)==null||u.dispose(),this._value=void 0}},l.toDisposable=function(u){return{dispose:u}},l.disposeArray=h,l.getDisposeArrayDisposable=function(u){return{dispose:()=>h(u)}}},1505:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.FourKeyMap=l.TwoKeyMap=void 0;class h{constructor(){this._data={}}set(y,d,x){this._data[y]||(this._data[y]={}),this._data[y][d]=x}get(y,d){return this._data[y]?this._data[y][d]:void 0}clear(){this._data={}}}l.TwoKeyMap=h,l.FourKeyMap=class{constructor(){this._data=new h}set(u,y,d,x,E){this._data.get(u,y)||this._data.set(u,y,new h),this._data.get(u,y).set(d,x,E)}get(u,y,d,x){var E;return(E=this._data.get(u,y))==null?void 0:E.get(d,x)}clear(){this._data.clear()}}},6114:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.isChromeOS=l.isLinux=l.isWindows=l.isIphone=l.isIpad=l.isMac=l.getSafariVersion=l.isSafari=l.isLegacyEdge=l.isFirefox=l.isNode=void 0,l.isNode=typeof process<"u"&&"title"in process;const h=l.isNode?"node":navigator.userAgent,u=l.isNode?"node":navigator.platform;l.isFirefox=h.includes("Firefox"),l.isLegacyEdge=h.includes("Edge"),l.isSafari=/^((?!chrome|android).)*safari/i.test(h),l.getSafariVersion=function(){if(!l.isSafari)return 0;const y=h.match(/Version\/(\d+)/);return y===null||y.length<2?0:parseInt(y[1])},l.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(u),l.isIpad=u==="iPad",l.isIphone=u==="iPhone",l.isWindows=["Windows","Win16","Win32","WinCE"].includes(u),l.isLinux=u.indexOf("Linux")>=0,l.isChromeOS=/\bCrOS\b/.test(h)},6106:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SortedList=void 0;let h=0;l.SortedList=class{constructor(u){this._getKey=u,this._array=[]}clear(){this._array.length=0}insert(u){this._array.length!==0?(h=this._search(this._getKey(u)),this._array.splice(h,0,u)):this._array.push(u)}delete(u){if(this._array.length===0)return!1;const y=this._getKey(u);if(y===void 0||(h=this._search(y),h===-1)||this._getKey(this._array[h])!==y)return!1;do if(this._array[h]===u)return this._array.splice(h,1),!0;while(++h<this._array.length&&this._getKey(this._array[h])===y);return!1}*getKeyIterator(u){if(this._array.length!==0&&(h=this._search(u),!(h<0||h>=this._array.length)&&this._getKey(this._array[h])===u))do yield this._array[h];while(++h<this._array.length&&this._getKey(this._array[h])===u)}forEachByKey(u,y){if(this._array.length!==0&&(h=this._search(u),!(h<0||h>=this._array.length)&&this._getKey(this._array[h])===u))do y(this._array[h]);while(++h<this._array.length&&this._getKey(this._array[h])===u)}values(){return[...this._array].values()}_search(u){let y=0,d=this._array.length-1;for(;d>=y;){let x=y+d>>1;const E=this._getKey(this._array[x]);if(E>u)d=x-1;else{if(!(E<u)){for(;x>0&&this._getKey(this._array[x-1])===u;)x--;return x}y=x+1}}return y}}},7226:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DebouncedIdleTask=l.IdleTaskQueue=l.PriorityTaskQueue=void 0;const u=h(6114);class y{constructor(){this._tasks=[],this._i=0}enqueue(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 M=0,S=0,_=E.timeRemaining(),p=0;for(;this._i<this._tasks.length;){if(M=Date.now(),this._tasks[this._i]()||this._i++,M=Math.max(1,Date.now()-M),S=Math.max(M,S),p=E.timeRemaining(),1.5*S>p)return _-M<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(_-M))}ms`),void this._start();_=p}this.clear()}}class d extends y{_requestCallback(E){return setTimeout((()=>E(this._createDeadline(16))))}_cancelCallback(E){clearTimeout(E)}_createDeadline(E){const M=Date.now()+E;return{timeRemaining:()=>Math.max(0,M-Date.now())}}}l.PriorityTaskQueue=d,l.IdleTaskQueue=!u.isNode&&"requestIdleCallback"in window?class extends y{_requestCallback(x){return requestIdleCallback(x)}_cancelCallback(x){cancelIdleCallback(x)}}:d,l.DebouncedIdleTask=class{constructor(){this._queue=new l.IdleTaskQueue}set(x){this._queue.clear(),this._queue.enqueue(x)}flush(){this._queue.flush()}}},9282:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.updateWindowsModeWrappedState=void 0;const u=h(643);l.updateWindowsModeWrappedState=function(y){const d=y.buffer.lines.get(y.buffer.ybase+y.buffer.y-1),x=d==null?void 0:d.get(y.cols-1),E=y.buffer.lines.get(y.buffer.ybase+y.buffer.y);E&&x&&(E.isWrapped=x[u.CHAR_DATA_CODE_INDEX]!==u.NULL_CELL_CODE&&x[u.CHAR_DATA_CODE_INDEX]!==u.WHITESPACE_CELL_CODE)}},3734:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ExtendedAttrs=l.AttributeData=void 0;class h{constructor(){this.fg=0,this.bg=0,this.extended=new u}static toColorRGB(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 h;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}}l.AttributeData=h;class u{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,x=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=x}clone(){return new u(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}l.ExtendedAttrs=u},9092:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Buffer=l.MAX_BUFFER_SIZE=void 0;const u=h(6349),y=h(7226),d=h(3734),x=h(8437),E=h(4634),M=h(511),S=h(643),_=h(4863),p=h(7116);l.MAX_BUFFER_SIZE=4294967295,l.Buffer=class{constructor(f,v,b){this._hasScrollback=f,this._optionsService=v,this._bufferService=b,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=x.DEFAULT_ATTR_DATA.clone(),this.savedCharset=p.DEFAULT_CHARSET,this.markers=[],this._nullCell=M.CellData.fromCharData([0,S.NULL_CELL_CHAR,S.NULL_CELL_WIDTH,S.NULL_CELL_CODE]),this._whitespaceCell=M.CellData.fromCharData([0,S.WHITESPACE_CELL_CHAR,S.WHITESPACE_CELL_WIDTH,S.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new y.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(f){return f?(this._nullCell.fg=f.fg,this._nullCell.bg=f.bg,this._nullCell.extended=f.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new 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 x.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>l.MAX_BUFFER_SIZE?l.MAX_BUFFER_SIZE:v}fillViewportRows(f){if(this.lines.length===0){f===void 0&&(f=x.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 u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(f,v){const b=this.getNullCell(x.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,b);let O=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 x.BufferLine(f,b)):this.ybase>0&&this.lines.length<=this.ybase+this.y+O+1?(this.ybase--,O++,this.ydisp>0&&this.ydisp--):this.lines.push(new x.BufferLine(f,b)));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),O&&(this.y+=O),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 O=0;O<this.lines.length;O++)R+=+this.lines.get(O).resize(f,b);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 b=(0,E.reflowLargerGetLinesToRemove)(this.lines,this._cols,f,this.ybase+this.y,this.getNullCell(x.DEFAULT_ATTR_DATA));if(b.length>0){const R=(0,E.reflowLargerCreateNewLayout)(this.lines,b);(0,E.reflowLargerApplyNewLayout)(this.lines,R.layout),this._reflowLargerAdjustViewport(f,v,R.countRemoved)}}_reflowLargerAdjustViewport(f,v,b){const R=this.getNullCell(x.DEFAULT_ATTR_DATA);let A=b;for(;A-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<v&&this.lines.push(new x.BufferLine(f,R))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-b,0)}_reflowSmaller(f,v){const b=this.getNullCell(x.DEFAULT_ATTR_DATA),R=[];let A=0;for(let O=this.lines.length-1;O>=0;O--){let w=this.lines.get(O);if(!w||!w.isWrapped&&w.getTrimmedLength()<=f)continue;const j=[w];for(;w.isWrapped&&O>0;)w=this.lines.get(--O),j.unshift(w);const I=this.ybase+this.y;if(I>=O&&I<O+j.length)continue;const Z=j[j.length-1].getTrimmedLength(),K=(0,E.reflowSmallerGetNewLineLengths)(j,this._cols,f),$=K.length-j.length;let X;X=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+$):Math.max(0,this.lines.length-this.lines.maxLength+$);const re=[];for(let L=0;L<$;L++){const z=this.getBlankLine(x.DEFAULT_ATTR_DATA,!0);re.push(z)}re.length>0&&(R.push({start:O+j.length+A,newLines:re}),A+=re.length),j.push(...re);let q=K.length-1,ee=K[q];ee===0&&(q--,ee=K[q]);let J=j.length-$-1,N=Z;for(;J>=0;){const L=Math.min(N,ee);if(j[q]===void 0)break;if(j[q].copyCellsFrom(j[J],N-L,ee-L,L,!0),ee-=L,ee===0&&(q--,ee=K[q]),N-=L,N===0){J--;const z=Math.max(J,0);N=(0,E.getWrappedLineTrimmedLength)(j,z,this._cols)}}for(let L=0;L<j.length;L++)K[L]<f&&j[L].setCell(K[L],b);let B=$-X;for(;B-- >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+$,this.ybase+v-1)}if(R.length>0){const O=[],w=[];for(let q=0;q<this.lines.length;q++)w.push(this.lines.get(q));const j=this.lines.length;let I=j-1,Z=0,K=R[Z];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+A);let $=0;for(let q=Math.min(this.lines.maxLength-1,j+A-1);q>=0;q--)if(K&&K.start>I+$){for(let ee=K.newLines.length-1;ee>=0;ee--)this.lines.set(q--,K.newLines[ee]);q++,O.push({index:I+1,amount:K.newLines.length}),$+=K.newLines.length,K=R[++Z]}else this.lines.set(q,w[I--]);let X=0;for(let q=O.length-1;q>=0;q--)O[q].index+=X,this.lines.onInsertEmitter.fire(O[q]),X+=O[q].amount;const re=Math.max(0,j+A-this.lines.maxLength);re>0&&this.lines.onTrimEmitter.fire(re)}}translateBufferLineToString(f,v,b=0,R){const A=this.lines.get(f);return A?A.translateToString(v,b,R):""}getWrappedRangeForLine(f){let v=f,b=f;for(;v>0&&this.lines.get(v).isWrapped;)v--;for(;b+1<this.lines.length&&this.lines.get(b+1).isWrapped;)b++;return{first:v,last:b}}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 _.Marker(f);return this.markers.push(v),v.register(this.lines.onTrim((b=>{v.line-=b,v.line<0&&v.dispose()}))),v.register(this.lines.onInsert((b=>{v.line>=b.index&&(v.line+=b.amount)}))),v.register(this.lines.onDelete((b=>{v.line>=b.index&&v.line<b.index+b.amount&&v.dispose(),v.line>b.index&&(v.line-=b.amount)}))),v.register(v.onDispose((()=>this._removeMarker(v)))),v}_removeMarker(f){this._isClearing||this.markers.splice(this.markers.indexOf(f),1)}}},8437:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLine=l.DEFAULT_ATTR_DATA=void 0;const u=h(3734),y=h(511),d=h(643),x=h(482);l.DEFAULT_ATTR_DATA=Object.freeze(new u.AttributeData);let E=0;class M{constructor(_,p,f=!1){this.isWrapped=f,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*_);const v=p||y.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let b=0;b<_;++b)this.setCell(b,v);this.length=_}get(_){const p=this._data[3*_+0],f=2097151&p;return[this._data[3*_+1],2097152&p?this._combined[_]:f?(0,x.stringFromCodePoint)(f):"",p>>22,2097152&p?this._combined[_].charCodeAt(this._combined[_].length-1):f]}set(_,p){this._data[3*_+1]=p[d.CHAR_DATA_ATTR_INDEX],p[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[_]=p[1],this._data[3*_+0]=2097152|_|p[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*_+0]=p[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|p[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(_){return this._data[3*_+0]>>22}hasWidth(_){return 12582912&this._data[3*_+0]}getFg(_){return this._data[3*_+1]}getBg(_){return this._data[3*_+2]}hasContent(_){return 4194303&this._data[3*_+0]}getCodePoint(_){const p=this._data[3*_+0];return 2097152&p?this._combined[_].charCodeAt(this._combined[_].length-1):2097151&p}isCombined(_){return 2097152&this._data[3*_+0]}getString(_){const p=this._data[3*_+0];return 2097152&p?this._combined[_]:2097151&p?(0,x.stringFromCodePoint)(2097151&p):""}isProtected(_){return 536870912&this._data[3*_+2]}loadCell(_,p){return E=3*_,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[_]),268435456&p.bg&&(p.extended=this._extendedAttrs[_]),p}setCell(_,p){2097152&p.content&&(this._combined[_]=p.combinedData),268435456&p.bg&&(this._extendedAttrs[_]=p.extended),this._data[3*_+0]=p.content,this._data[3*_+1]=p.fg,this._data[3*_+2]=p.bg}setCellFromCodepoint(_,p,f,v){268435456&v.bg&&(this._extendedAttrs[_]=v.extended),this._data[3*_+0]=p|f<<22,this._data[3*_+1]=v.fg,this._data[3*_+2]=v.bg}addCodepointToCell(_,p,f){let v=this._data[3*_+0];2097152&v?this._combined[_]+=(0,x.stringFromCodePoint)(p):2097151&v?(this._combined[_]=(0,x.stringFromCodePoint)(2097151&v)+(0,x.stringFromCodePoint)(p),v&=-2097152,v|=2097152):v=p|4194304,f&&(v&=-12582913,v|=f<<22),this._data[3*_+0]=v}insertCells(_,p,f){if((_%=this.length)&&this.getWidth(_-1)===2&&this.setCellFromCodepoint(_-1,0,1,f),p<this.length-_){const v=new y.CellData;for(let b=this.length-_-p-1;b>=0;--b)this.setCell(_+p+b,this.loadCell(_+b,v));for(let b=0;b<p;++b)this.setCell(_+b,f)}else for(let v=_;v<this.length;++v)this.setCell(v,f);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,f)}deleteCells(_,p,f){if(_%=this.length,p<this.length-_){const v=new y.CellData;for(let b=0;b<this.length-_-p;++b)this.setCell(_+b,this.loadCell(_+p+b,v));for(let b=this.length-p;b<this.length;++b)this.setCell(b,f)}else for(let v=_;v<this.length;++v)this.setCell(v,f);_&&this.getWidth(_-1)===2&&this.setCellFromCodepoint(_-1,0,1,f),this.getWidth(_)!==0||this.hasContent(_)||this.setCellFromCodepoint(_,0,1,f)}replaceCells(_,p,f,v=!1){if(v)for(_&&this.getWidth(_-1)===2&&!this.isProtected(_-1)&&this.setCellFromCodepoint(_-1,0,1,f),p<this.length&&this.getWidth(p-1)===2&&!this.isProtected(p)&&this.setCellFromCodepoint(p,0,1,f);_<p&&_<this.length;)this.isProtected(_)||this.setCell(_,f),_++;else for(_&&this.getWidth(_-1)===2&&this.setCellFromCodepoint(_-1,0,1,f),p<this.length&&this.getWidth(p-1)===2&&this.setCellFromCodepoint(p,0,1,f);_<p&&_<this.length;)this.setCell(_++,f)}resize(_,p){if(_===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const f=3*_;if(_>this.length){if(this._data.buffer.byteLength>=4*f)this._data=new Uint32Array(this._data.buffer,0,f);else{const v=new Uint32Array(f);v.set(this._data),this._data=v}for(let v=this.length;v<_;++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>=_&&delete this._combined[A]}const b=Object.keys(this._extendedAttrs);for(let R=0;R<b.length;R++){const A=parseInt(b[R],10);A>=_&&delete this._extendedAttrs[A]}}return this.length=_,4*f*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const _=new Uint32Array(this._data.length);return _.set(this._data),this._data=_,1}return 0}fill(_,p=!1){if(p)for(let f=0;f<this.length;++f)this.isProtected(f)||this.setCell(f,_);else{this._combined={},this._extendedAttrs={};for(let f=0;f<this.length;++f)this.setCell(f,_)}}copyFrom(_){this.length!==_.length?this._data=new Uint32Array(_._data):this._data.set(_._data),this.length=_.length,this._combined={};for(const p in _._combined)this._combined[p]=_._combined[p];this._extendedAttrs={};for(const p in _._extendedAttrs)this._extendedAttrs[p]=_._extendedAttrs[p];this.isWrapped=_.isWrapped}clone(){const _=new M(0);_._data=new Uint32Array(this._data),_.length=this.length;for(const p in this._combined)_._combined[p]=this._combined[p];for(const p in this._extendedAttrs)_._extendedAttrs[p]=this._extendedAttrs[p];return _.isWrapped=this.isWrapped,_}getTrimmedLength(){for(let _=this.length-1;_>=0;--_)if(4194303&this._data[3*_+0])return _+(this._data[3*_+0]>>22);return 0}getNoBgTrimmedLength(){for(let _=this.length-1;_>=0;--_)if(4194303&this._data[3*_+0]||50331648&this._data[3*_+2])return _+(this._data[3*_+0]>>22);return 0}copyCellsFrom(_,p,f,v,b){const R=_._data;if(b)for(let O=v-1;O>=0;O--){for(let w=0;w<3;w++)this._data[3*(f+O)+w]=R[3*(p+O)+w];268435456&R[3*(p+O)+2]&&(this._extendedAttrs[f+O]=_._extendedAttrs[p+O])}else for(let O=0;O<v;O++){for(let w=0;w<3;w++)this._data[3*(f+O)+w]=R[3*(p+O)+w];268435456&R[3*(p+O)+2]&&(this._extendedAttrs[f+O]=_._extendedAttrs[p+O])}const A=Object.keys(_._combined);for(let O=0;O<A.length;O++){const w=parseInt(A[O],10);w>=p&&(this._combined[w-p+f]=_._combined[w])}}translateToString(_,p,f,v){p=p??0,f=f??this.length,_&&(f=Math.min(f,this.getTrimmedLength())),v&&(v.length=0);let b="";for(;p<f;){const R=this._data[3*p+0],A=2097151&R,O=2097152&R?this._combined[p]:A?(0,x.stringFromCodePoint)(A):d.WHITESPACE_CELL_CHAR;if(b+=O,v)for(let w=0;w<O.length;++w)v.push(p);p+=R>>22||1}return v&&v.push(p),b}}l.BufferLine=M},4841:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.getRangeLength=void 0,l.getRangeLength=function(h,u){if(h.start.y>h.end.y)throw new Error(`Buffer range end (${h.end.x}, ${h.end.y}) cannot be before start (${h.start.x}, ${h.start.y})`);return u*(h.end.y-h.start.y)+(h.end.x-h.start.x+1)}},4634:(T,l)=>{function h(u,y,d){if(y===u.length-1)return u[y].getTrimmedLength();const x=!u[y].hasContent(d-1)&&u[y].getWidth(d-1)===1,E=u[y+1].getWidth(0)===2;return x&&E?d-1:d}Object.defineProperty(l,"__esModule",{value:!0}),l.getWrappedLineTrimmedLength=l.reflowSmallerGetNewLineLengths=l.reflowLargerApplyNewLayout=l.reflowLargerCreateNewLayout=l.reflowLargerGetLinesToRemove=void 0,l.reflowLargerGetLinesToRemove=function(u,y,d,x,E){const M=[];for(let S=0;S<u.length-1;S++){let _=S,p=u.get(++_);if(!p.isWrapped)continue;const f=[u.get(S)];for(;_<u.length&&p.isWrapped;)f.push(p),p=u.get(++_);if(x>=S&&x<_){S+=f.length-1;continue}let v=0,b=h(f,v,y),R=1,A=0;for(;R<f.length;){const w=h(f,R,y),j=w-A,I=d-b,Z=Math.min(j,I);f[v].copyCellsFrom(f[R],A,b,Z,!1),b+=Z,b===d&&(v++,b=0),A+=Z,A===w&&(R++,A=0),b===0&&v!==0&&f[v-1].getWidth(d-1)===2&&(f[v].copyCellsFrom(f[v-1],d-1,b++,1,!1),f[v-1].setCell(d-1,E))}f[v].replaceCells(b,d,E);let O=0;for(let w=f.length-1;w>0&&(w>v||f[w].getTrimmedLength()===0);w--)O++;O>0&&(M.push(S+f.length-O),M.push(O)),S+=f.length-1}return M},l.reflowLargerCreateNewLayout=function(u,y){const d=[];let x=0,E=y[x],M=0;for(let S=0;S<u.length;S++)if(E===S){const _=y[++x];u.onDeleteEmitter.fire({index:S-M,amount:_}),S+=_-1,M+=_,E=y[++x]}else d.push(S);return{layout:d,countRemoved:M}},l.reflowLargerApplyNewLayout=function(u,y){const d=[];for(let x=0;x<y.length;x++)d.push(u.get(y[x]));for(let x=0;x<d.length;x++)u.set(x,d[x]);u.length=y.length},l.reflowSmallerGetNewLineLengths=function(u,y,d){const x=[],E=u.map(((p,f)=>h(u,f,y))).reduce(((p,f)=>p+f));let M=0,S=0,_=0;for(;_<E;){if(E-_<d){x.push(E-_);break}M+=d;const p=h(u,S,y);M>p&&(M-=p,S++);const f=u[S].getWidth(M-1)===2;f&&M--;const v=f?d-1:d;x.push(v),_+=v}return x},l.getWrappedLineTrimmedLength=h},5295:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferSet=void 0;const u=h(8460),y=h(844),d=h(9092);class x extends y.Disposable{constructor(M,S){super(),this._optionsService=M,this._bufferService=S,this._onBufferActivate=this.register(new u.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new 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(M){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(M),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(M,S){this._normal.resize(M,S),this._alt.resize(M,S),this.setupTabStops(M)}setupTabStops(M){this._normal.setupTabStops(M),this._alt.setupTabStops(M)}}l.BufferSet=x},511:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CellData=void 0;const u=h(482),y=h(643),d=h(3734);class x extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(M){const S=new x;return S.setFromCharData(M),S}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,u.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(M){this.fg=M[y.CHAR_DATA_ATTR_INDEX],this.bg=0;let S=!1;if(M[y.CHAR_DATA_CHAR_INDEX].length>2)S=!0;else if(M[y.CHAR_DATA_CHAR_INDEX].length===2){const _=M[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=_&&_<=56319){const p=M[y.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=p&&p<=57343?this.content=1024*(_-55296)+p-56320+65536|M[y.CHAR_DATA_WIDTH_INDEX]<<22:S=!0}else S=!0}else this.content=M[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|M[y.CHAR_DATA_WIDTH_INDEX]<<22;S&&(this.combinedData=M[y.CHAR_DATA_CHAR_INDEX],this.content=2097152|M[y.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.CellData=x},643:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WHITESPACE_CELL_CODE=l.WHITESPACE_CELL_WIDTH=l.WHITESPACE_CELL_CHAR=l.NULL_CELL_CODE=l.NULL_CELL_WIDTH=l.NULL_CELL_CHAR=l.CHAR_DATA_CODE_INDEX=l.CHAR_DATA_WIDTH_INDEX=l.CHAR_DATA_CHAR_INDEX=l.CHAR_DATA_ATTR_INDEX=l.DEFAULT_EXT=l.DEFAULT_ATTR=l.DEFAULT_COLOR=void 0,l.DEFAULT_COLOR=0,l.DEFAULT_ATTR=256|l.DEFAULT_COLOR<<9,l.DEFAULT_EXT=0,l.CHAR_DATA_ATTR_INDEX=0,l.CHAR_DATA_CHAR_INDEX=1,l.CHAR_DATA_WIDTH_INDEX=2,l.CHAR_DATA_CODE_INDEX=3,l.NULL_CELL_CHAR="",l.NULL_CELL_WIDTH=1,l.NULL_CELL_CODE=0,l.WHITESPACE_CELL_CHAR=" ",l.WHITESPACE_CELL_WIDTH=1,l.WHITESPACE_CELL_CODE=32},4863:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Marker=void 0;const u=h(8460),y=h(844);class 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 u.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,y.disposeArray)(this._disposables),this._disposables.length=0)}register(E){return this._disposables.push(E),E}}l.Marker=d,d._nextId=1},7116:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DEFAULT_CHARSET=l.CHARSETS=void 0,l.CHARSETS={},l.DEFAULT_CHARSET=l.CHARSETS.B,l.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},l.CHARSETS.A={"#":"£"},l.CHARSETS.B=void 0,l.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},l.CHARSETS.C=l.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},l.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},l.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},l.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},l.CHARSETS.E=l.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},l.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},l.CHARSETS.H=l.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(T,l)=>{var h,u,y;Object.defineProperty(l,"__esModule",{value:!0}),l.C1_ESCAPED=l.C1=l.C0=void 0,(function(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=""})(h||(l.C0=h={})),(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=""})(u||(l.C1=u={})),(function(d){d.ST=`${h.ESC}\\`})(y||(l.C1_ESCAPED=y={}))},7399:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.evaluateKeyboardEvent=void 0;const u=h(2584),y={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};l.evaluateKeyboardEvent=function(d,x,E,M){const S={type:0,cancel:!1,key:void 0},_=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?S.key=x?u.C0.ESC+"OA":u.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?S.key=x?u.C0.ESC+"OD":u.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?S.key=x?u.C0.ESC+"OC":u.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(S.key=x?u.C0.ESC+"OB":u.C0.ESC+"[B");break;case 8:S.key=d.ctrlKey?"\b":u.C0.DEL,d.altKey&&(S.key=u.C0.ESC+S.key);break;case 9:if(d.shiftKey){S.key=u.C0.ESC+"[Z";break}S.key=u.C0.HT,S.cancel=!0;break;case 13:S.key=d.altKey?u.C0.ESC+u.C0.CR:u.C0.CR,S.cancel=!0;break;case 27:S.key=u.C0.ESC,d.altKey&&(S.key=u.C0.ESC+u.C0.ESC),S.cancel=!0;break;case 37:if(d.metaKey)break;_?(S.key=u.C0.ESC+"[1;"+(_+1)+"D",S.key===u.C0.ESC+"[1;3D"&&(S.key=u.C0.ESC+(E?"b":"[1;5D"))):S.key=x?u.C0.ESC+"OD":u.C0.ESC+"[D";break;case 39:if(d.metaKey)break;_?(S.key=u.C0.ESC+"[1;"+(_+1)+"C",S.key===u.C0.ESC+"[1;3C"&&(S.key=u.C0.ESC+(E?"f":"[1;5C"))):S.key=x?u.C0.ESC+"OC":u.C0.ESC+"[C";break;case 38:if(d.metaKey)break;_?(S.key=u.C0.ESC+"[1;"+(_+1)+"A",E||S.key!==u.C0.ESC+"[1;3A"||(S.key=u.C0.ESC+"[1;5A")):S.key=x?u.C0.ESC+"OA":u.C0.ESC+"[A";break;case 40:if(d.metaKey)break;_?(S.key=u.C0.ESC+"[1;"+(_+1)+"B",E||S.key!==u.C0.ESC+"[1;3B"||(S.key=u.C0.ESC+"[1;5B")):S.key=x?u.C0.ESC+"OB":u.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(S.key=u.C0.ESC+"[2~");break;case 46:S.key=_?u.C0.ESC+"[3;"+(_+1)+"~":u.C0.ESC+"[3~";break;case 36:S.key=_?u.C0.ESC+"[1;"+(_+1)+"H":x?u.C0.ESC+"OH":u.C0.ESC+"[H";break;case 35:S.key=_?u.C0.ESC+"[1;"+(_+1)+"F":x?u.C0.ESC+"OF":u.C0.ESC+"[F";break;case 33:d.shiftKey?S.type=2:d.ctrlKey?S.key=u.C0.ESC+"[5;"+(_+1)+"~":S.key=u.C0.ESC+"[5~";break;case 34:d.shiftKey?S.type=3:d.ctrlKey?S.key=u.C0.ESC+"[6;"+(_+1)+"~":S.key=u.C0.ESC+"[6~";break;case 112:S.key=_?u.C0.ESC+"[1;"+(_+1)+"P":u.C0.ESC+"OP";break;case 113:S.key=_?u.C0.ESC+"[1;"+(_+1)+"Q":u.C0.ESC+"OQ";break;case 114:S.key=_?u.C0.ESC+"[1;"+(_+1)+"R":u.C0.ESC+"OR";break;case 115:S.key=_?u.C0.ESC+"[1;"+(_+1)+"S":u.C0.ESC+"OS";break;case 116:S.key=_?u.C0.ESC+"[15;"+(_+1)+"~":u.C0.ESC+"[15~";break;case 117:S.key=_?u.C0.ESC+"[17;"+(_+1)+"~":u.C0.ESC+"[17~";break;case 118:S.key=_?u.C0.ESC+"[18;"+(_+1)+"~":u.C0.ESC+"[18~";break;case 119:S.key=_?u.C0.ESC+"[19;"+(_+1)+"~":u.C0.ESC+"[19~";break;case 120:S.key=_?u.C0.ESC+"[20;"+(_+1)+"~":u.C0.ESC+"[20~";break;case 121:S.key=_?u.C0.ESC+"[21;"+(_+1)+"~":u.C0.ESC+"[21~";break;case 122:S.key=_?u.C0.ESC+"[23;"+(_+1)+"~":u.C0.ESC+"[23~";break;case 123:S.key=_?u.C0.ESC+"[24;"+(_+1)+"~":u.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(E&&!M||!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?S.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(S.key=u.C0.US),d.key==="@"&&(S.key=u.C0.NUL)):d.keyCode===65&&(S.type=1);else{const p=y[d.keyCode],f=p==null?void 0:p[d.shiftKey?1:0];if(f)S.key=u.C0.ESC+f;else if(d.keyCode>=65&&d.keyCode<=90){const v=d.ctrlKey?d.keyCode-64:d.keyCode+32;let b=String.fromCharCode(v);d.shiftKey&&(b=b.toUpperCase()),S.key=u.C0.ESC+b}else if(d.keyCode===32)S.key=u.C0.ESC+(d.ctrlKey?u.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let v=d.code.slice(3,4);d.shiftKey||(v=v.toLowerCase()),S.key=u.C0.ESC+v,S.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?S.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?S.key=u.C0.NUL:d.keyCode>=51&&d.keyCode<=55?S.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?S.key=u.C0.DEL:d.keyCode===219?S.key=u.C0.ESC:d.keyCode===220?S.key=u.C0.FS:d.keyCode===221&&(S.key=u.C0.GS)}return S}},482:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Utf8ToUtf32=l.StringToUtf32=l.utf32ToString=l.stringFromCodePoint=void 0,l.stringFromCodePoint=function(h){return h>65535?(h-=65536,String.fromCharCode(55296+(h>>10))+String.fromCharCode(h%1024+56320)):String.fromCharCode(h)},l.utf32ToString=function(h,u=0,y=h.length){let d="";for(let x=u;x<y;++x){let E=h[x];E>65535?(E-=65536,d+=String.fromCharCode(55296+(E>>10))+String.fromCharCode(E%1024+56320)):d+=String.fromCharCode(E)}return d},l.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(h,u){const y=h.length;if(!y)return 0;let d=0,x=0;if(this._interim){const E=h.charCodeAt(x++);56320<=E&&E<=57343?u[d++]=1024*(this._interim-55296)+E-56320+65536:(u[d++]=this._interim,u[d++]=E),this._interim=0}for(let E=x;E<y;++E){const M=h.charCodeAt(E);if(55296<=M&&M<=56319){if(++E>=y)return this._interim=M,d;const S=h.charCodeAt(E);56320<=S&&S<=57343?u[d++]=1024*(M-55296)+S-56320+65536:(u[d++]=M,u[d++]=S)}else M!==65279&&(u[d++]=M)}return d}},l.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(h,u){const y=h.length;if(!y)return 0;let d,x,E,M,S=0,_=0,p=0;if(this.interim[0]){let b=!1,R=this.interim[0];R&=(224&R)==192?31:(240&R)==224?15:7;let A,O=0;for(;(A=63&this.interim[++O])&&O<4;)R<<=6,R|=A;const w=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,j=w-O;for(;p<j;){if(p>=y)return 0;if(A=h[p++],(192&A)!=128){p--,b=!0;break}this.interim[O++]=A,R<<=6,R|=63&A}b||(w===2?R<128?p--:u[S++]=R:w===3?R<2048||R>=55296&&R<=57343||R===65279||(u[S++]=R):R<65536||R>1114111||(u[S++]=R)),this.interim.fill(0)}const f=y-4;let v=p;for(;v<y;){for(;!(!(v<f)||128&(d=h[v])||128&(x=h[v+1])||128&(E=h[v+2])||128&(M=h[v+3]));)u[S++]=d,u[S++]=x,u[S++]=E,u[S++]=M,v+=4;if(d=h[v++],d<128)u[S++]=d;else if((224&d)==192){if(v>=y)return this.interim[0]=d,S;if(x=h[v++],(192&x)!=128){v--;continue}if(_=(31&d)<<6|63&x,_<128){v--;continue}u[S++]=_}else if((240&d)==224){if(v>=y)return this.interim[0]=d,S;if(x=h[v++],(192&x)!=128){v--;continue}if(v>=y)return this.interim[0]=d,this.interim[1]=x,S;if(E=h[v++],(192&E)!=128){v--;continue}if(_=(15&d)<<12|(63&x)<<6|63&E,_<2048||_>=55296&&_<=57343||_===65279)continue;u[S++]=_}else if((248&d)==240){if(v>=y)return this.interim[0]=d,S;if(x=h[v++],(192&x)!=128){v--;continue}if(v>=y)return this.interim[0]=d,this.interim[1]=x,S;if(E=h[v++],(192&E)!=128){v--;continue}if(v>=y)return this.interim[0]=d,this.interim[1]=x,this.interim[2]=E,S;if(M=h[v++],(192&M)!=128){v--;continue}if(_=(7&d)<<18|(63&x)<<12|(63&E)<<6|63&M,_<65536||_>1114111)continue;u[S++]=_}}return S}}},225:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeV6=void 0;const u=h(1480),y=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],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 x;l.UnicodeV6=class{constructor(){if(this.version="6",!x){x=new Uint8Array(65536),x.fill(1),x[0]=0,x.fill(0,1,32),x.fill(0,127,160),x.fill(2,4352,4448),x[9001]=2,x[9002]=2,x.fill(2,11904,42192),x[12351]=1,x.fill(2,44032,55204),x.fill(2,63744,64256),x.fill(2,65040,65050),x.fill(2,65072,65136),x.fill(2,65280,65377),x.fill(2,65504,65511);for(let E=0;E<y.length;++E)x.fill(0,y[E][0],y[E][1]+1)}}wcwidth(E){return E<32?0:E<127?1:E<65536?x[E]:(function(M,S){let _,p=0,f=S.length-1;if(M<S[0][0]||M>S[f][1])return!1;for(;f>=p;)if(_=p+f>>1,M>S[_][1])p=_+1;else{if(!(M<S[_][0]))return!0;f=_-1}return!1})(E,d)?0:E>=131072&&E<=196605||E>=196608&&E<=262141?2:1}charProperties(E,M){let S=this.wcwidth(E),_=S===0&&M!==0;if(_){const p=u.UnicodeService.extractWidth(M);p===0?_=!1:p>S&&(S=p)}return u.UnicodeService.createPropertyValue(0,S,_)}}},5981:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WriteBuffer=void 0;const u=h(8460),y=h(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 u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(E,M){if(M!==void 0&&this._syncCalls>M)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 S;for(this._isSyncWriting=!0;S=this._writeBuffer.shift();){this._action(S);const _=this._callbacks.shift();_&&_()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(E,M){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(M),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=E.length,this._writeBuffer.push(E),this._callbacks.push(M)}_innerWrite(E=0,M=!0){const S=E||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const _=this._writeBuffer[this._bufferOffset],p=this._action(_,M);if(p){const v=b=>Date.now()-S>=12?setTimeout((()=>this._innerWrite(0,b))):this._innerWrite(S,b);return void p.catch((b=>(queueMicrotask((()=>{throw b})),Promise.resolve(!1)))).then(v)}const f=this._callbacks[this._bufferOffset];if(f&&f(),this._bufferOffset++,this._pendingData-=_.length,Date.now()-S>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}l.WriteBuffer=d},5941:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.toRgbString=l.parseColor=void 0;const h=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,u=/^[\da-f]+$/;function y(d,x){const E=d.toString(16),M=E.length<2?"0"+E:E;switch(x){case 4:return E[0];case 8:return M;case 12:return(M+M).slice(0,3);default:return M+M}}l.parseColor=function(d){if(!d)return;let x=d.toLowerCase();if(x.indexOf("rgb:")===0){x=x.slice(4);const E=h.exec(x);if(E){const M=E[1]?15:E[4]?255:E[7]?4095:65535;return[Math.round(parseInt(E[1]||E[4]||E[7]||E[10],16)/M*255),Math.round(parseInt(E[2]||E[5]||E[8]||E[11],16)/M*255),Math.round(parseInt(E[3]||E[6]||E[9]||E[12],16)/M*255)]}}else if(x.indexOf("#")===0&&(x=x.slice(1),u.exec(x)&&[3,6,9,12].includes(x.length))){const E=x.length/3,M=[0,0,0];for(let S=0;S<3;++S){const _=parseInt(x.slice(E*S,E*S+E),16);M[S]=E===1?_<<4:E===2?_:E===3?_>>4:_>>8}return M}},l.toRgbString=function(d,x=16){const[E,M,S]=d;return`rgb:${y(E,x)}/${y(M,x)}/${y(S,x)}`}},5770:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.PAYLOAD_LIMIT=void 0,l.PAYLOAD_LIMIT=1e7},6351:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DcsHandler=l.DcsParser=void 0;const u=h(482),y=h(8742),d=h(5770),x=[];l.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=x,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=x}registerHandler(M,S){this._handlers[M]===void 0&&(this._handlers[M]=[]);const _=this._handlers[M];return _.push(S),{dispose:()=>{const p=_.indexOf(S);p!==-1&&_.splice(p,1)}}}clearHandler(M){this._handlers[M]&&delete this._handlers[M]}setHandlerFallback(M){this._handlerFb=M}reset(){if(this._active.length)for(let M=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;M>=0;--M)this._active[M].unhook(!1);this._stack.paused=!1,this._active=x,this._ident=0}hook(M,S){if(this.reset(),this._ident=M,this._active=this._handlers[M]||x,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].hook(S);else this._handlerFb(this._ident,"HOOK",S)}put(M,S,_){if(this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].put(M,S,_);else this._handlerFb(this._ident,"PUT",(0,u.utf32ToString)(M,S,_))}unhook(M,S=!0){if(this._active.length){let _=!1,p=this._active.length-1,f=!1;if(this._stack.paused&&(p=this._stack.loopPosition-1,_=S,f=this._stack.fallThrough,this._stack.paused=!1),!f&&_===!1){for(;p>=0&&(_=this._active[p].unhook(M),_!==!0);p--)if(_ instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!1,_;p--}for(;p>=0;p--)if(_=this._active[p].unhook(!1),_ instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=p,this._stack.fallThrough=!0,_}else this._handlerFb(this._ident,"UNHOOK",M);this._active=x,this._ident=0}};const E=new y.Params;E.addParam(0),l.DcsHandler=class{constructor(M){this._handler=M,this._data="",this._params=E,this._hitLimit=!1}hook(M){this._params=M.length>1||M.params[0]?M.clone():E,this._data="",this._hitLimit=!1}put(M,S,_){this._hitLimit||(this._data+=(0,u.utf32ToString)(M,S,_),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(M){let S=!1;if(this._hitLimit)S=!1;else if(M&&(S=this._handler(this._data,this._params),S instanceof Promise))return S.then((_=>(this._params=E,this._data="",this._hitLimit=!1,_)));return this._params=E,this._data="",this._hitLimit=!1,S}}},2015:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.EscapeSequenceParser=l.VT500_TRANSITION_TABLE=l.TransitionTable=void 0;const u=h(844),y=h(8742),d=h(6242),x=h(6351);class E{constructor(p){this.table=new Uint8Array(p)}setDefault(p,f){this.table.fill(p<<4|f)}add(p,f,v,b){this.table[f<<8|p]=v<<4|b}addMany(p,f,v,b){for(let R=0;R<p.length;R++)this.table[f<<8|p[R]]=v<<4|b}}l.TransitionTable=E;const M=160;l.VT500_TRANSITION_TABLE=(function(){const _=new E(4095),p=Array.apply(null,Array(256)).map(((O,w)=>w)),f=(O,w)=>p.slice(O,w),v=f(32,127),b=f(0,24);b.push(25),b.push.apply(b,f(28,32));const R=f(0,14);let A;for(A in _.setDefault(1,0),_.addMany(v,0,2,0),R)_.addMany([24,26,153,154],A,3,0),_.addMany(f(128,144),A,3,0),_.addMany(f(144,152),A,3,0),_.add(156,A,0,0),_.add(27,A,11,1),_.add(157,A,4,8),_.addMany([152,158,159],A,0,7),_.add(155,A,11,3),_.add(144,A,11,9);return _.addMany(b,0,3,0),_.addMany(b,1,3,1),_.add(127,1,0,1),_.addMany(b,8,0,8),_.addMany(b,3,3,3),_.add(127,3,0,3),_.addMany(b,4,3,4),_.add(127,4,0,4),_.addMany(b,6,3,6),_.addMany(b,5,3,5),_.add(127,5,0,5),_.addMany(b,2,3,2),_.add(127,2,0,2),_.add(93,1,4,8),_.addMany(v,8,5,8),_.add(127,8,5,8),_.addMany([156,27,24,26,7],8,6,0),_.addMany(f(28,32),8,0,8),_.addMany([88,94,95],1,0,7),_.addMany(v,7,0,7),_.addMany(b,7,0,7),_.add(156,7,0,0),_.add(127,7,0,7),_.add(91,1,11,3),_.addMany(f(64,127),3,7,0),_.addMany(f(48,60),3,8,4),_.addMany([60,61,62,63],3,9,4),_.addMany(f(48,60),4,8,4),_.addMany(f(64,127),4,7,0),_.addMany([60,61,62,63],4,0,6),_.addMany(f(32,64),6,0,6),_.add(127,6,0,6),_.addMany(f(64,127),6,0,0),_.addMany(f(32,48),3,9,5),_.addMany(f(32,48),5,9,5),_.addMany(f(48,64),5,0,6),_.addMany(f(64,127),5,7,0),_.addMany(f(32,48),4,9,5),_.addMany(f(32,48),1,9,2),_.addMany(f(32,48),2,9,2),_.addMany(f(48,127),2,10,0),_.addMany(f(48,80),1,10,0),_.addMany(f(81,88),1,10,0),_.addMany([89,90,92],1,10,0),_.addMany(f(96,127),1,10,0),_.add(80,1,11,9),_.addMany(b,9,0,9),_.add(127,9,0,9),_.addMany(f(28,32),9,0,9),_.addMany(f(32,48),9,9,12),_.addMany(f(48,60),9,8,10),_.addMany([60,61,62,63],9,9,10),_.addMany(b,11,0,11),_.addMany(f(32,128),11,0,11),_.addMany(f(28,32),11,0,11),_.addMany(b,10,0,10),_.add(127,10,0,10),_.addMany(f(28,32),10,0,10),_.addMany(f(48,60),10,8,10),_.addMany([60,61,62,63],10,0,11),_.addMany(f(32,48),10,9,12),_.addMany(b,12,0,12),_.add(127,12,0,12),_.addMany(f(28,32),12,0,12),_.addMany(f(32,48),12,9,12),_.addMany(f(48,64),12,0,11),_.addMany(f(64,127),12,12,13),_.addMany(f(64,127),10,12,13),_.addMany(f(64,127),9,12,13),_.addMany(b,13,13,13),_.addMany(v,13,13,13),_.add(127,13,0,13),_.addMany([27,156,24,26],13,14,0),_.add(M,0,2,0),_.add(M,8,5,8),_.add(M,6,0,6),_.add(M,11,0,11),_.add(M,13,13,13),_})();class S extends u.Disposable{constructor(p=l.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,b)=>{},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,u.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 x.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 b=p.final.charCodeAt(0);if(f[0]>b||b>f[1])throw new Error(`final must be in range ${f[0]} .. ${f[1]}`);return v<<=8,v|=b,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 b=this._escHandlers[v];return b.push(f),{dispose:()=>{const R=b.indexOf(f);R!==-1&&b.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 b=this._csiHandlers[v];return b.push(f),{dispose:()=>{const R=b.indexOf(f);R!==-1&&b.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,b,R){this._parseStack.state=p,this._parseStack.handlers=f,this._parseStack.handlerPos=v,this._parseStack.transition=b,this._parseStack.chunkPos=R}parse(p,f,v){let b,R=0,A=0,O=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,O=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 j=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(v===!1&&j>-1){for(;j>=0&&(b=w[j](this._params),b!==!0);j--)if(b instanceof Promise)return this._parseStack.handlerPos=j,b}this._parseStack.handlers=[];break;case 4:if(v===!1&&j>-1){for(;j>=0&&(b=w[j](),b!==!0);j--)if(b instanceof Promise)return this._parseStack.handlerPos=j,b}this._parseStack.handlers=[];break;case 6:if(R=p[this._parseStack.chunkPos],b=this._dcsParser.unhook(R!==24&&R!==26,v),b)return b;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],b=this._oscParser.end(R!==24&&R!==26,v),b)return b;R===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,O=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let w=O;w<f;++w){switch(R=p[w],A=this._transitions.table[this.currentState<<8|(R<160?R:M)],A>>4){case 2:for(let $=w+1;;++$){if($>=f||(R=p[$])<32||R>126&&R<M){this._printHandler(p,w,$),w=$-1;break}if(++$>=f||(R=p[$])<32||R>126&&R<M){this._printHandler(p,w,$),w=$-1;break}if(++$>=f||(R=p[$])<32||R>126&&R<M){this._printHandler(p,w,$),w=$-1;break}if(++$>=f||(R=p[$])<32||R>126&&R<M){this._printHandler(p,w,$),w=$-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 j=this._csiHandlers[this._collect<<8|R];let I=j?j.length-1:-1;for(;I>=0&&(b=j[I](this._params),b!==!0);I--)if(b instanceof Promise)return this._preserveStack(3,j,I,A,w),b;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 Z=this._escHandlers[this._collect<<8|R];let K=Z?Z.length-1:-1;for(;K>=0&&(b=Z[K](),b!==!0);K--)if(b instanceof Promise)return this._preserveStack(4,Z,K,A,w),b;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 $=w+1;;++$)if($>=f||(R=p[$])===24||R===26||R===27||R>127&&R<M){this._dcsParser.put(p,w,$),w=$-1;break}break;case 14:if(b=this._dcsParser.unhook(R!==24&&R!==26),b)return this._preserveStack(6,[],0,A,w),b;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 $=w+1;;$++)if($>=f||(R=p[$])<32||R>127&&R<M){this._oscParser.put(p,w,$),w=$-1;break}break;case 6:if(b=this._oscParser.end(R!==24&&R!==26),b)return this._preserveStack(5,[],0,A,w),b;R===27&&(A|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&A}}}l.EscapeSequenceParser=S},6242:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OscHandler=l.OscParser=void 0;const u=h(5770),y=h(482),d=[];l.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(x,E){this._handlers[x]===void 0&&(this._handlers[x]=[]);const M=this._handlers[x];return M.push(E),{dispose:()=>{const S=M.indexOf(E);S!==-1&&M.splice(S,1)}}}clearHandler(x){this._handlers[x]&&delete this._handlers[x]}setHandlerFallback(x){this._handlerFb=x}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let x=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;x>=0;--x)this._active[x].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 x=this._active.length-1;x>=0;x--)this._active[x].start();else this._handlerFb(this._id,"START")}_put(x,E,M){if(this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].put(x,E,M);else this._handlerFb(this._id,"PUT",(0,y.utf32ToString)(x,E,M))}start(){this.reset(),this._state=1}put(x,E,M){if(this._state!==3){if(this._state===1)for(;E<M;){const S=x[E++];if(S===59){this._state=2,this._start();break}if(S<48||57<S)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+S-48}this._state===2&&M-E>0&&this._put(x,E,M)}}end(x,E=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let M=!1,S=this._active.length-1,_=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,M=E,_=this._stack.fallThrough,this._stack.paused=!1),!_&&M===!1){for(;S>=0&&(M=this._active[S].end(x),M!==!0);S--)if(M instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!1,M;S--}for(;S>=0;S--)if(M=this._active[S].end(!1),M instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!0,M}else this._handlerFb(this._id,"END",x);this._active=d,this._id=-1,this._state=0}}},l.OscHandler=class{constructor(x){this._handler=x,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(x,E,M){this._hitLimit||(this._data+=(0,y.utf32ToString)(x,E,M),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(x){let E=!1;if(this._hitLimit)E=!1;else if(x&&(E=this._handler(this._data),E instanceof Promise))return E.then((M=>(this._data="",this._hitLimit=!1,M)));return this._data="",this._hitLimit=!1,E}}},8742:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Params=void 0;const h=2147483647;class u{static fromArray(d){const x=new u;if(!d.length)return x;for(let E=Array.isArray(d[0])?1:0;E<d.length;++E){const M=d[E];if(Array.isArray(M))for(let S=0;S<M.length;++S)x.addSubParam(M[S]);else x.addParam(M)}return x}constructor(d=32,x=32){if(this.maxLength=d,this.maxSubParamsLength=x,x>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(x),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new u(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 x=0;x<this.length;++x){d.push(this.params[x]);const E=this._subParamsIdx[x]>>8,M=255&this._subParamsIdx[x];M-E>0&&d.push(Array.prototype.slice.call(this._subParams,E,M))}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>h?h: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>h?h:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const x=this._subParamsIdx[d]>>8,E=255&this._subParamsIdx[d];return E-x>0?this._subParams.subarray(x,E):null}getSubParamsAll(){const d={};for(let x=0;x<this.length;++x){const E=this._subParamsIdx[x]>>8,M=255&this._subParamsIdx[x];M-E>0&&(d[x]=this._subParams.slice(E,M))}return d}addDigit(d){let x;if(this._rejectDigits||!(x=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const E=this._digitIsSub?this._subParams:this.params,M=E[x-1];E[x-1]=~M?Math.min(10*M+d,h):d}}l.Params=u},5741:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.AddonManager=void 0,l.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let h=this._addons.length-1;h>=0;h--)this._addons[h].instance.dispose()}loadAddon(h,u){const y={instance:u,dispose:u.dispose,isDisposed:!1};this._addons.push(y),u.dispose=()=>this._wrappedAddonDispose(y),u.activate(h)}_wrappedAddonDispose(h){if(h.isDisposed)return;let u=-1;for(let y=0;y<this._addons.length;y++)if(this._addons[y]===h){u=y;break}if(u===-1)throw new Error("Could not dispose an addon that has not been loaded");h.isDisposed=!0,h.dispose.apply(h.instance),this._addons.splice(u,1)}}},8771:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferApiView=void 0;const u=h(3785),y=h(511);l.BufferApiView=class{constructor(d,x){this._buffer=d,this.type=x}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 x=this._buffer.lines.get(d);if(x)return new u.BufferLineApiView(x)}getNullCell(){return new y.CellData}}},3785:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLineApiView=void 0;const u=h(511);l.BufferLineApiView=class{constructor(y){this._line=y}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(y,d){if(!(y<0||y>=this._line.length))return d?(this._line.loadCell(y,d),d):this._line.loadCell(y,new u.CellData)}translateToString(y,d,x){return this._line.translateToString(y,d,x)}}},8285:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferNamespaceApi=void 0;const u=h(8771),y=h(8460),d=h(844);class x extends d.Disposable{constructor(M){super(),this._core=M,this._onBufferChange=this.register(new y.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new u.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new u.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}l.BufferNamespaceApi=x},7975:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ParserApi=void 0,l.ParserApi=class{constructor(h){this._core=h}registerCsiHandler(h,u){return this._core.registerCsiHandler(h,(y=>u(y.toArray())))}addCsiHandler(h,u){return this.registerCsiHandler(h,u)}registerDcsHandler(h,u){return this._core.registerDcsHandler(h,((y,d)=>u(y,d.toArray())))}addDcsHandler(h,u){return this.registerDcsHandler(h,u)}registerEscHandler(h,u){return this._core.registerEscHandler(h,u)}addEscHandler(h,u){return this.registerEscHandler(h,u)}registerOscHandler(h,u){return this._core.registerOscHandler(h,u)}addOscHandler(h,u){return this.registerOscHandler(h,u)}}},7090:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeApi=void 0,l.UnicodeApi=class{constructor(h){this._core=h}register(h){this._core.unicodeService.register(h)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(h){this._core.unicodeService.activeVersion=h}}},744:function(T,l,h){var u=this&&this.__decorate||function(_,p,f,v){var b,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(_,p,f,v);else for(var O=_.length-1;O>=0;O--)(b=_[O])&&(A=(R<3?b(A):R>3?b(p,f,A):b(p,f))||A);return R>3&&A&&Object.defineProperty(p,f,A),A},y=this&&this.__param||function(_,p){return function(f,v){p(f,v,_)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferService=l.MINIMUM_ROWS=l.MINIMUM_COLS=void 0;const d=h(8460),x=h(844),E=h(5295),M=h(2585);l.MINIMUM_COLS=2,l.MINIMUM_ROWS=1;let S=l.BufferService=class extends x.Disposable{get buffer(){return this.buffers.active}constructor(_){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(_.rawOptions.cols||0,l.MINIMUM_COLS),this.rows=Math.max(_.rawOptions.rows||0,l.MINIMUM_ROWS),this.buffers=this.register(new E.BufferSet(_,this))}resize(_,p){this.cols=_,this.rows=p,this.buffers.resize(_,p),this._onResize.fire({cols:_,rows:p})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(_,p=!1){const f=this.buffer;let v;v=this._cachedBlankLine,v&&v.length===this.cols&&v.getFg(0)===_.fg&&v.getBg(0)===_.bg||(v=f.getBlankLine(_,p),this._cachedBlankLine=v),v.isWrapped=p;const b=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-b+1;f.lines.shiftElements(b+1,A-1,-1),f.lines.set(R,v.clone())}this.isUserScrolling||(f.ydisp=f.ybase),this._onScroll.fire(f.ydisp)}scrollLines(_,p,f){const v=this.buffer;if(_<0){if(v.ydisp===0)return;this.isUserScrolling=!0}else _+v.ydisp>=v.ybase&&(this.isUserScrolling=!1);const b=v.ydisp;v.ydisp=Math.max(Math.min(v.ydisp+_,v.ybase),0),b!==v.ydisp&&(p||this._onScroll.fire(v.ydisp))}};l.BufferService=S=u([y(0,M.IOptionsService)],S)},7994:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CharsetService=void 0,l.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(h){this.glevel=h,this.charset=this._charsets[h]}setgCharset(h,u){this._charsets[h]=u,this.glevel===h&&(this.charset=u)}}},1753:function(T,l,h){var u=this&&this.__decorate||function(v,b,R,A){var O,w=arguments.length,j=w<3?b:A===null?A=Object.getOwnPropertyDescriptor(b,R):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(v,b,R,A);else for(var I=v.length-1;I>=0;I--)(O=v[I])&&(j=(w<3?O(j):w>3?O(b,R,j):O(b,R))||j);return w>3&&j&&Object.defineProperty(b,R,j),j},y=this&&this.__param||function(v,b){return function(R,A){b(R,A,v)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreMouseService=void 0;const d=h(2585),x=h(8460),E=h(844),M={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 S(v,b){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||b||(R|=3)),R}const _=String.fromCharCode,p={DEFAULT:v=>{const b=[S(v,!1)+32,v.col+32,v.row+32];return b[0]>255||b[1]>255||b[2]>255?"":`\x1B[M${_(b[0])}${_(b[1])}${_(b[2])}`},SGR:v=>{const b=v.action===0&&v.button!==4?"m":"M";return`\x1B[<${S(v,!0)};${v.col};${v.row}${b}`},SGR_PIXELS:v=>{const b=v.action===0&&v.button!==4?"m":"M";return`\x1B[<${S(v,!0)};${v.x};${v.y}${b}`}};let f=l.CoreMouseService=class extends E.Disposable{constructor(v,b){super(),this._bufferService=v,this._coreService=b,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new x.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const R of Object.keys(M))this.addProtocol(R,M[R]);for(const R of Object.keys(p))this.addEncoding(R,p[R]);this.reset()}addProtocol(v,b){this._protocols[v]=b}addEncoding(v,b){this._encodings[v]=b}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 b=this._encodings[this._activeEncoding](v);return b&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(b):this._coreService.triggerDataEvent(b,!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,b,R){if(R){if(v.x!==b.x||v.y!==b.y)return!1}else if(v.col!==b.col||v.row!==b.row)return!1;return v.button===b.button&&v.action===b.action&&v.ctrl===b.ctrl&&v.alt===b.alt&&v.shift===b.shift}};l.CoreMouseService=f=u([y(0,d.IBufferService),y(1,d.ICoreService)],f)},6975:function(T,l,h){var u=this&&this.__decorate||function(f,v,b,R){var A,O=arguments.length,w=O<3?v:R===null?R=Object.getOwnPropertyDescriptor(v,b):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(f,v,b,R);else for(var j=f.length-1;j>=0;j--)(A=f[j])&&(w=(O<3?A(w):O>3?A(v,b,w):A(v,b))||w);return O>3&&w&&Object.defineProperty(v,b,w),w},y=this&&this.__param||function(f,v){return function(b,R){v(b,R,f)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreService=void 0;const d=h(1439),x=h(8460),E=h(844),M=h(2585),S=Object.freeze({insertMode:!1}),_=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let p=l.CoreService=class extends E.Disposable{constructor(f,v,b){super(),this._bufferService=f,this._logService=v,this._optionsService=b,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new x.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new x.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new x.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new x.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(S),this.decPrivateModes=(0,d.clone)(_)}reset(){this.modes=(0,d.clone)(S),this.decPrivateModes=(0,d.clone)(_)}triggerDataEvent(f,v=!1){if(this._optionsService.rawOptions.disableStdin)return;const b=this._bufferService.buffer;v&&this._optionsService.rawOptions.scrollOnUserInput&&b.ybase!==b.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))}};l.CoreService=p=u([y(0,M.IBufferService),y(1,M.ILogService),y(2,M.IOptionsService)],p)},9074:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DecorationService=void 0;const u=h(8055),y=h(8460),d=h(844),x=h(6106);let E=0,M=0;class S extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new x.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 _(f);if(v){const b=v.marker.onDispose((()=>v.dispose()));v.onDispose((()=>{v&&(this._decorations.delete(v)&&this._onDecorationRemoved.fire(v),b.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,b){let R=0,A=0;for(const O of this._decorations.getKeyIterator(v))R=O.options.x??0,A=R+(O.options.width??1),f>=R&&f<A&&(!b||(O.options.layer??"bottom")===b)&&(yield O)}forEachDecorationAtCell(f,v,b,R){this._decorations.forEachByKey(v,(A=>{E=A.options.x??0,M=E+(A.options.width??1),f>=E&&f<M&&(!b||(A.options.layer??"bottom")===b)&&R(A)}))}}l.DecorationService=S;class _ extends d.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=u.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=u.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(f){super(),this.options=f,this.onRenderEmitter=this.register(new y.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new y.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=f.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.InstantiationService=l.ServiceCollection=void 0;const u=h(2585),y=h(8343);class d{constructor(...E){this._entries=new Map;for(const[M,S]of E)this.set(M,S)}set(E,M){const S=this._entries.get(E);return this._entries.set(E,M),S}forEach(E){for(const[M,S]of this._entries.entries())E(M,S)}has(E){return this._entries.has(E)}get(E){return this._entries.get(E)}}l.ServiceCollection=d,l.InstantiationService=class{constructor(){this._services=new d,this._services.set(u.IInstantiationService,this)}setService(x,E){this._services.set(x,E)}getService(x){return this._services.get(x)}createInstance(x,...E){const M=(0,y.getServiceDependencies)(x).sort(((p,f)=>p.index-f.index)),S=[];for(const p of M){const f=this._services.get(p.id);if(!f)throw new Error(`[createInstance] ${x.name} depends on UNKNOWN service ${p.id}.`);S.push(f)}const _=M.length>0?M[0].index:E.length;if(E.length!==_)throw new Error(`[createInstance] First service dependency of ${x.name} at position ${_+1} conflicts with ${E.length} static arguments`);return new x(...E,...S)}}},7866:function(T,l,h){var u=this&&this.__decorate||function(_,p,f,v){var b,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(_,p,f,v);else for(var O=_.length-1;O>=0;O--)(b=_[O])&&(A=(R<3?b(A):R>3?b(p,f,A):b(p,f))||A);return R>3&&A&&Object.defineProperty(p,f,A),A},y=this&&this.__param||function(_,p){return function(f,v){p(f,v,_)}};Object.defineProperty(l,"__esModule",{value:!0}),l.traceCall=l.setTraceLogger=l.LogService=void 0;const d=h(844),x=h(2585),E={trace:x.LogLevelEnum.TRACE,debug:x.LogLevelEnum.DEBUG,info:x.LogLevelEnum.INFO,warn:x.LogLevelEnum.WARN,error:x.LogLevelEnum.ERROR,off:x.LogLevelEnum.OFF};let M,S=l.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(_){super(),this._optionsService=_,this._logLevel=x.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),M=this}_updateLogLevel(){this._logLevel=E[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(_){for(let p=0;p<_.length;p++)typeof _[p]=="function"&&(_[p]=_[p]())}_log(_,p,f){this._evalLazyOptionalParams(f),_.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+p,...f)}trace(_,...p){var f;this._logLevel<=x.LogLevelEnum.TRACE&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.trace.bind(this._optionsService.options.logger))??console.log,_,p)}debug(_,...p){var f;this._logLevel<=x.LogLevelEnum.DEBUG&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.debug.bind(this._optionsService.options.logger))??console.log,_,p)}info(_,...p){var f;this._logLevel<=x.LogLevelEnum.INFO&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.info.bind(this._optionsService.options.logger))??console.info,_,p)}warn(_,...p){var f;this._logLevel<=x.LogLevelEnum.WARN&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.warn.bind(this._optionsService.options.logger))??console.warn,_,p)}error(_,...p){var f;this._logLevel<=x.LogLevelEnum.ERROR&&this._log(((f=this._optionsService.options.logger)==null?void 0:f.error.bind(this._optionsService.options.logger))??console.error,_,p)}};l.LogService=S=u([y(0,x.IOptionsService)],S),l.setTraceLogger=function(_){M=_},l.traceCall=function(_,p,f){if(typeof f.value!="function")throw new Error("not supported");const v=f.value;f.value=function(...b){if(M.logLevel!==x.LogLevelEnum.TRACE)return v.apply(this,b);M.trace(`GlyphRenderer#${v.name}(${b.map((A=>JSON.stringify(A))).join(", ")})`);const R=v.apply(this,b);return M.trace(`GlyphRenderer#${v.name} return`,R),R}}},7302:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OptionsService=l.DEFAULT_OPTIONS=void 0;const u=h(8460),y=h(844),d=h(6114);l.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const x=["normal","bold","100","200","300","400","500","600","700","800","900"];class E extends y.Disposable{constructor(S){super(),this._onOptionChange=this.register(new u.EventEmitter),this.onOptionChange=this._onOptionChange.event;const _={...l.DEFAULT_OPTIONS};for(const p in S)if(p in _)try{const f=S[p];_[p]=this._sanitizeAndValidateOption(p,f)}catch(f){console.error(f)}this.rawOptions=_,this.options={..._},this._setupOptions(),this.register((0,y.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(S,_){return this.onOptionChange((p=>{p===S&&_(this.rawOptions[S])}))}onMultipleOptionChange(S,_){return this.onOptionChange((p=>{S.indexOf(p)!==-1&&_()}))}_setupOptions(){const S=p=>{if(!(p in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${p}"`);return this.rawOptions[p]},_=(p,f)=>{if(!(p in l.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:S.bind(this,p),set:_.bind(this,p)};Object.defineProperty(this.options,p,f)}}_sanitizeAndValidateOption(S,_){switch(S){case"cursorStyle":if(_||(_=l.DEFAULT_OPTIONS[S]),!(function(p){return p==="block"||p==="underline"||p==="bar"})(_))throw new Error(`"${_}" is not a valid value for ${S}`);break;case"wordSeparator":_||(_=l.DEFAULT_OPTIONS[S]);break;case"fontWeight":case"fontWeightBold":if(typeof _=="number"&&1<=_&&_<=1e3)break;_=x.includes(_)?_:l.DEFAULT_OPTIONS[S];break;case"cursorWidth":_=Math.floor(_);case"lineHeight":case"tabStopWidth":if(_<1)throw new Error(`${S} cannot be less than 1, value: ${_}`);break;case"minimumContrastRatio":_=Math.max(1,Math.min(21,Math.round(10*_)/10));break;case"scrollback":if((_=Math.min(_,4294967295))<0)throw new Error(`${S} cannot be less than 0, value: ${_}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(_<=0)throw new Error(`${S} cannot be less than or equal to 0, value: ${_}`);break;case"rows":case"cols":if(!_&&_!==0)throw new Error(`${S} must be numeric, value: ${_}`);break;case"windowsPty":_=_??{}}return _}}l.OptionsService=E},2660:function(T,l,h){var u=this&&this.__decorate||function(E,M,S,_){var p,f=arguments.length,v=f<3?M:_===null?_=Object.getOwnPropertyDescriptor(M,S):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(E,M,S,_);else for(var b=E.length-1;b>=0;b--)(p=E[b])&&(v=(f<3?p(v):f>3?p(M,S,v):p(M,S))||v);return f>3&&v&&Object.defineProperty(M,S,v),v},y=this&&this.__param||function(E,M){return function(S,_){M(S,_,E)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkService=void 0;const d=h(2585);let x=l.OscLinkService=class{constructor(E){this._bufferService=E,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(E){const M=this._bufferService.buffer;if(E.id===void 0){const b=M.addMarker(M.ybase+M.y),R={data:E,id:this._nextId++,lines:[b]};return b.onDispose((()=>this._removeMarkerFromLink(R,b))),this._dataByLinkId.set(R.id,R),R.id}const S=E,_=this._getEntryIdKey(S),p=this._entriesWithId.get(_);if(p)return this.addLineToLink(p.id,M.ybase+M.y),p.id;const f=M.addMarker(M.ybase+M.y),v={id:this._nextId++,key:this._getEntryIdKey(S),data:S,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,M){const S=this._dataByLinkId.get(E);if(S&&S.lines.every((_=>_.line!==M))){const _=this._bufferService.buffer.addMarker(M);S.lines.push(_),_.onDispose((()=>this._removeMarkerFromLink(S,_)))}}getLinkData(E){var M;return(M=this._dataByLinkId.get(E))==null?void 0:M.data}_getEntryIdKey(E){return`${E.id};;${E.uri}`}_removeMarkerFromLink(E,M){const S=E.lines.indexOf(M);S!==-1&&(E.lines.splice(S,1),E.lines.length===0&&(E.data.id!==void 0&&this._entriesWithId.delete(E.key),this._dataByLinkId.delete(E.id)))}};l.OscLinkService=x=u([y(0,d.IBufferService)],x)},8343:(T,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createDecorator=l.getServiceDependencies=l.serviceRegistry=void 0;const h="di$target",u="di$dependencies";l.serviceRegistry=new Map,l.getServiceDependencies=function(y){return y[u]||[]},l.createDecorator=function(y){if(l.serviceRegistry.has(y))return l.serviceRegistry.get(y);const d=function(x,E,M){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(S,_,p){_[h]===_?_[u].push({id:S,index:p}):(_[u]=[{id:S,index:p}],_[h]=_)})(d,x,M)};return d.toString=()=>y,l.serviceRegistry.set(y,d),d}},2585:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.IDecorationService=l.IUnicodeService=l.IOscLinkService=l.IOptionsService=l.ILogService=l.LogLevelEnum=l.IInstantiationService=l.ICharsetService=l.ICoreService=l.ICoreMouseService=l.IBufferService=void 0;const u=h(8343);var y;l.IBufferService=(0,u.createDecorator)("BufferService"),l.ICoreMouseService=(0,u.createDecorator)("CoreMouseService"),l.ICoreService=(0,u.createDecorator)("CoreService"),l.ICharsetService=(0,u.createDecorator)("CharsetService"),l.IInstantiationService=(0,u.createDecorator)("InstantiationService"),(function(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||(l.LogLevelEnum=y={})),l.ILogService=(0,u.createDecorator)("LogService"),l.IOptionsService=(0,u.createDecorator)("OptionsService"),l.IOscLinkService=(0,u.createDecorator)("OscLinkService"),l.IUnicodeService=(0,u.createDecorator)("UnicodeService"),l.IDecorationService=(0,u.createDecorator)("DecorationService")},1480:(T,l,h)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeService=void 0;const u=h(8460),y=h(225);class d{static extractShouldJoin(E){return(1&E)!=0}static extractWidth(E){return E>>1&3}static extractCharKind(E){return E>>3}static createPropertyValue(E,M,S=!1){return(16777215&E)<<3|(3&M)<<1|(S?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new u.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 M=0,S=0;const _=E.length;for(let p=0;p<_;++p){let f=E.charCodeAt(p);if(55296<=f&&f<=56319){if(++p>=_)return M+this.wcwidth(f);const R=E.charCodeAt(p);56320<=R&&R<=57343?f=1024*(f-55296)+R-56320+65536:M+=this.wcwidth(R)}const v=this.charProperties(f,S);let b=d.extractWidth(v);d.extractShouldJoin(v)&&(b-=d.extractWidth(S)),M+=b,S=v}return M}charProperties(E,M){return this._activeProvider.charProperties(E,M)}}l.UnicodeService=d}},o={};function g(T){var l=o[T];if(l!==void 0)return l.exports;var h=o[T]={exports:{}};return a[T].call(h.exports,h,h.exports,g),h.exports}var k={};return(()=>{var T=k;Object.defineProperty(T,"__esModule",{value:!0}),T.Terminal=void 0;const l=g(9042),h=g(3236),u=g(844),y=g(5741),d=g(8285),x=g(7975),E=g(7090),M=["cols","rows"];class S extends u.Disposable{constructor(p){super(),this._core=this.register(new h.Terminal(p)),this._addonManager=this.register(new y.AddonManager),this._publicOptions={...this._core.options};const f=b=>this._core.options[b],v=(b,R)=>{this._checkReadonlyOptions(b),this._core.options[b]=R};for(const b in this._core.options){const R={get:f.bind(this,b),set:v.bind(this,b)};Object.defineProperty(this._publicOptions,b,R)}}_checkReadonlyOptions(p){if(M.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 x.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 l}_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=S})(),k})()))})(ou)),ou.exports}var wE=CE(),lu={exports:{}},z_;function EE(){return z_||(z_=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,l=window.getComputedStyle(this._terminal.element.parentElement),h=parseInt(l.getPropertyValue("height")),u=Math.max(0,parseInt(l.getPropertyValue("width"))),y=window.getComputedStyle(this._terminal.element),d=h-(parseInt(y.getPropertyValue("padding-top"))+parseInt(y.getPropertyValue("padding-bottom"))),x=u-(parseInt(y.getPropertyValue("padding-right"))+parseInt(y.getPropertyValue("padding-left")))-T;return{cols:Math.max(2,Math.floor(x/k.css.cell.width)),rows:Math.max(1,Math.floor(d/k.css.cell.height))}}}})(),a})()))})(lu)),lu.exports}var kE=EE();const TE=3e4,RE=300*1e3;class AE{constructor(r,a,o){dt(this,"ws",null);dt(this,"consecutiveFailures",0);dt(this,"failStartTime",null);dt(this,"destroyed",!1);dt(this,"reconnectTimer",null);dt(this,"url");dt(this,"authToken");dt(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,l;if(this.destroyed)return;if(this.failStartTime===null&&(this.failStartTime=Date.now()),Date.now()-this.failStartTime>=RE){(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(TE,1e3*Math.pow(2,this.consecutiveFailures-1));(l=(T=this.callbacks).onReconnecting)==null||l.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 _o=1e3;function cu(i){return`${i.timestamp??""}:${i.role}:${i.contentType}:${i.text.length}:${i.text.slice(0,80)}`}function H_(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 DE({sessionId:i,status:r}){const a=lt(w=>w.token),o=P.useRef(null),g=P.useRef(null),k=P.useRef(null),T=P.useRef(null),l=P.useRef(r),h=P.useRef(""),[u,y]=P.useState([]),[d,x]=P.useState(!0),[E,M]=P.useState({thinking:!1,tool_use:!0,tool_result:!0}),S=P.useRef(new Set),[_,p]=P.useState("connecting"),[f,v]=P.useState(null);P.useEffect(()=>{l.current=r},[r]);const b=P.useMemo(()=>u.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)),[u,E]);P.useEffect(()=>{let w=!1;return Cw(i).then(j=>{if(!w){const I=j.messages??[],Z=I.length>_o?I.slice(I.length-_o):I;y(Z),S.current=new Set(Z.map(cu))}}).finally(()=>{w||x(!1)}),()=>{w=!0}},[i]),P.useEffect(()=>{const w=Vp(i,j=>{try{const I=JSON.parse(j.data);if(I.event!=="message")return;const Z=I.data;y(K=>{const $=cu(Z);if(S.current.has($))return K;S.current.add($);const X=[...K,Z];if(X.length>_o){const re=X.length-_o,q=X.slice(re);for(let ee=0;ee<re;ee++)S.current.delete(cu(X[ee]));return q}return X})}catch{}},a);return()=>w()},[i,a]),P.useEffect(()=>{if(!o.current)return;const w=new wE.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}),j=new kE.FitAddon;w.loadAddon(j),w.open(o.current),j.fit(),g.current=w,k.current=j;const I=new ResizeObserver(()=>{var $;j.fit();const{cols:Z,rows:K}=w;($=T.current)==null||$.send({type:"resize",cols:Z,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(),b.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 Z of b)w.writeln(H_(Z));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 j=h.current;j&&w.write(j),(I=k.current)==null||I.fit()},[b,d]),P.useEffect(()=>{const j=(()=>{const Z=window.location.origin,K=`/v1/sessions/${encodeURIComponent(i)}/terminal`;return`${Z.replace(/^http/,"ws")}${K}`})(),I=new AE(j,{onMessage:Z=>{const K=Z,$=g.current;if($)switch(K.type){case"pane":{const X=h.current,re=K.content;if(X&&re.startsWith(X))$.write(re.slice(X.length));else{h.current=re;const q=g.current;if(q){if(q.reset(),b.length>0){q.writeln("\x1B[33m╔═══════════════════════════════════════════════════════════╗\x1B[0m"),q.writeln("\x1B[33m║ SESSION TRANSCRIPT ║\x1B[0m"),q.writeln("\x1B[33m╚═══════════════════════════════════════════════════════════╝\x1B[0m"),q.writeln("");for(const ee of b)q.writeln(H_(ee));q.writeln(""),q.writeln("\x1B[33m╔═══════════════════════════════════════════════════════════╗\x1B[0m"),q.writeln("\x1B[33m║ LIVE TERMINAL OUTPUT ║\x1B[0m"),q.writeln("\x1B[33m╚═══════════════════════════════════════════════════════════╝\x1B[0m"),q.writeln("")}q.write(re)}}h.current=re,v(null);break}case"status":break;case"error":v(K.message);break}},onOpen:()=>{var K;p("connected"),v(null);const Z=g.current;k.current&&Z&&((K=T.current)==null||K.send({type:"resize",cols:Z.cols,rows:Z.rows}))},onReconnecting:()=>{p("reconnecting")},onGiveUp:()=>{p("disconnected")},onClose:()=>{p("disconnected")}},a??void 0);return T.current=I,()=>{T.current=null,I.close()}},[i,a,b]),P.useEffect(()=>{const w=g.current;if(!w)return;const j=w.onData(I=>{var Z;(Z=T.current)==null||Z.send({type:"input",text:I})});return()=>{j.dispose()}},[]);const R=P.useCallback(w=>{M(j=>({...j,[w]:!j[w]}))},[]),A=r==="working",O=_==="connected";return C.jsxs("div",{className:"flex flex-col h-full bg-[#111118] border border-[#1a1a2e] rounded-lg overflow-hidden",children:[C.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:[C.jsxs("div",{className:"flex items-center gap-3",children:[C.jsx("span",{className:"text-[10px] text-[#555] uppercase tracking-wider",children:"Filter:"}),["thinking","tool_use","tool_result"].map(w=>C.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)),C.jsxs("span",{className:"text-[10px] text-[#444]",children:[b.length," / ",u.length," messages"]})]}),C.jsxs("div",{className:"flex items-center gap-3 ml-auto",children:[C.jsxs("div",{className:"flex items-center gap-1.5",children:[C.jsx("span",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:O?"#00e5ff":_==="reconnecting"?"#ffaa00":"#666",boxShadow:O?"0 0 4px #00e5ff40":"none",animation:_==="reconnecting"?"pulse 1s ease-in-out infinite":"none"}}),C.jsx("span",{className:"text-[10px] text-[#555] uppercase",children:_==="connecting"?"connecting…":_==="reconnecting"?"reconnecting…":_==="connected"?"ws live":"disconnected"})]}),C.jsxs("div",{className:"flex items-center gap-1.5",children:[C.jsx("span",{className:"w-1.5 h-1.5 rounded-full",style:{backgroundColor:A?"#00ff88":"#888",boxShadow:A?"0 0 4px #00ff88":"none"}}),C.jsx("span",{className:"text-[10px] text-[#555] uppercase",children:A?"active":"idle"})]})]})]}),f&&C.jsx("div",{className:"px-4 py-2 text-xs text-[#ff3366] bg-[#ff336610] border-b border-[#ff336620]",children:f}),C.jsx("div",{ref:o,className:"flex-1 overflow-hidden"})]})}function OE({metrics:i,loading:r}){if(r||!i)return C.jsx("div",{className:"flex items-center justify-center h-48 text-[#555] text-sm animate-pulse",children:"Loading metrics…"});const a=[{label:"Duration",value:Qw(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 C.jsxs("div",{className:"space-y-4",children:[C.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3",children:a.map(o=>C.jsxs("div",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-4 transition-colors duration-150 hover:border-[#3b82f6]/30",children:[C.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[C.jsx("span",{className:"text-base",children:o.icon}),C.jsx("span",{className:"text-[10px] text-[#888] uppercase tracking-wider",children:o.label})]}),C.jsx("div",{className:"text-2xl font-semibold font-mono tabular-nums",style:{color:o.color},children:o.value})]},o.label))}),i.statusChanges.length>0&&C.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg p-4",children:[C.jsx("h3",{className:"text-xs text-[#888] uppercase tracking-wider mb-3",children:"Status Changes"}),C.jsx("div",{className:"flex flex-wrap gap-2",children:i.statusChanges.map((o,g)=>C.jsx("div",{className:"text-xs font-mono text-[#555] bg-[#0a0a0f] px-2 py-1 rounded border border-[#1a1a2e]",children:o},g))})]})]})}function uu(i){return i===null?"--":`${Math.round(i)} ms`}function ME(i){return i===null?"0%":`${Math.min(100,Math.round(i/500*100))}%`}function LE({latency:i,loading:r}){var o,g,k;if(r)return C.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 C.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 C.jsxs("div",{className:"space-y-3",children:[C.jsx("h3",{className:"text-xs text-[#888] uppercase tracking-wider",children:"Latency"}),C.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:a.map(T=>C.jsxs("div",{className:"rounded-lg border border-[#1a1a2e] bg-[#111118] p-4",children:[C.jsxs("div",{className:"flex items-center justify-between text-xs text-[#888] uppercase tracking-wider",children:[C.jsx("span",{children:T.label}),C.jsxs("span",{children:[T.count," sample",T.count===1?"":"s"]})]}),C.jsx("div",{className:"mt-3 h-1.5 rounded bg-[#1a1a2e] overflow-hidden",children:C.jsx("div",{className:"h-full bg-[#00e5ff]/70 transition-all duration-300",style:{width:ME(T.avg)}})}),C.jsxs("div",{className:"mt-3 grid grid-cols-3 gap-2 text-xs font-mono text-[#bbb]",children:[C.jsxs("div",{children:[C.jsx("div",{className:"text-[#666] mb-1",children:"Latest"}),C.jsx("div",{className:"text-[#00e5ff]",children:uu(T.latest)})]}),C.jsxs("div",{children:[C.jsx("div",{className:"text-[#666] mb-1",children:"Avg"}),C.jsx("div",{className:"text-[#00ff88]",children:uu(T.avg)})]}),C.jsxs("div",{children:[C.jsx("div",{className:"text-[#666] mb-1",children:"Max"}),C.jsx("div",{className:"text-[#ffaa00]",children:uu(T.max)})]})]})]},T.label))})]})}const NE=new Set(["bypassPermissions","dontAsk","acceptEdits","plan","auto"]);function jE({prompt:i,permissionMode:r,onApprove:a,onReject:o}){const[g,k]=P.useState(!1);return r&&r!=="default"&&NE.has(r)?C.jsx("div",{className:"flex items-center gap-2 px-4 py-2 bg-[#003322]/50 border border-[#10b981]/30 rounded-lg text-sm",children:C.jsxs("span",{className:"text-[#10b981] font-semibold text-xs uppercase tracking-wider",children:["AUTO-APPROVED (",r,")"]})}):C.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:[C.jsxs("div",{className:"flex items-center gap-3 sm:gap-2 min-w-0",children:[C.jsx("span",{className:"text-[#f59e0b] text-lg shrink-0",children:"âš "}),C.jsxs("div",{className:"flex-1 min-w-0",children:[C.jsx("div",{className:"text-xs text-[#f59e0b] font-semibold uppercase tracking-wider mb-0.5",children:"Permission Required"}),C.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&&C.jsx("span",{className:"text-[#888] ml-1",children:"..."})]})]})]}),C.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[C.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"}),C.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"})]})]})}const BE=[{id:"session",label:"Session"},{id:"metrics",label:"Metrics"}],U_=["/clear","/compact","/cost","/config"];function zE(){const{id:i}=J_(),r=To(),[a,o]=P.useState("session"),{session:g,health:k,notFound:T,loading:l,metrics:h,metricsLoading:u,latency:y,latencyLoading:d}=bE(i??""),[x,E]=P.useState(""),[M,S]=P.useState(!1),[_,p]=P.useState(U_[0]),[f,v]=P.useState(!1),[b,R]=P.useState(""),[A,O]=P.useState(!1),[w,j]=P.useState(!1),[I,Z]=P.useState(!1),[K,$]=P.useState(!1),[X,re]=P.useState(null),q=P.useRef(null),ee=P.useRef(!1),J=Ui(me=>me.addToast);if(l)return C.jsx("div",{className:"min-h-screen bg-[#0a0a0f] flex items-center justify-center text-[#555] text-sm",children:C.jsx("div",{className:"animate-pulse",children:"Loading session…"})});if(T||!g||!k)return C.jsxs("div",{className:"min-h-screen bg-[#0a0a0f] flex flex-col items-center justify-center text-[#555]",children:[C.jsx("div",{className:"text-6xl mb-4",children:"404"}),C.jsx("div",{className:"text-lg mb-6 text-[#e0e0e0]",children:"Session not found"}),C.jsx(hi,{to:"/",className:"text-sm text-[#00e5ff] hover:underline",children:"← Back to Overview"})]});const N=g,B=k,L=B.status==="permission_prompt"||B.status==="bash_approval";function z(){Fp(N.id).catch(me=>J("error","Approve failed",me instanceof Error?me.message:void 0))}function V(){Rw(N.id).catch(me=>J("error","Reject failed",me instanceof Error?me.message:void 0))}function Q(){bu(N.id).catch(me=>J("error","Interrupt failed",me instanceof Error?me.message:void 0))}async function fe(){try{const me=await Dw(N.id,{name:void 0});J("success","Session forked",`New session ${me.id.slice(0,8)} created`),r(`/session/${me.id}`)}catch(me){J("error","Fork failed",me instanceof Error?me.message:void 0)}}function de(){Aw(N.id).catch(me=>J("error","Escape failed",me instanceof Error?me.message:void 0))}async function G(){try{await yu(N.id),r("/")}catch(me){J("error","Failed to kill session",me instanceof Error?me.message:void 0)}}async function U(){if(!I){Z(!0);try{const me=await jw(N.id);re({image:me.image,mimeType:me.mimeType,capturedAt:Date.now()}),J("success","Screenshot captured")}catch(me){(typeof me=="object"&&me!==null&&"statusCode"in me?me.statusCode:void 0)===501?($(!0),J("warning","Screenshot unavailable","Playwright is not installed on the server.")):J("error","Screenshot failed",me instanceof Error?me.message:void 0)}finally{Z(!1)}}}async function le(){var Se;const me=x.trim();if(me&&!ee.current){ee.current=!0,S(!0);try{await Tw(N.id,me),E("")}catch(ni){J("error","Failed to send message",ni instanceof Error?ni.message:void 0)}finally{S(!1),ee.current=!1,(Se=q.current)==null||Se.focus()}}}function ae(){var me;E(_),(me=q.current)==null||me.focus()}async function pe(){if(!(!_||f)){v(!0);try{await Lw(N.id,_),E("")}catch(me){J("error","Failed to send slash command",me instanceof Error?me.message:void 0)}finally{v(!1)}}}async function _e(){const me=b.trim();if(!(!me||w)){j(!0);try{await Nw(N.id,me),R(""),O(!1)}catch(Se){J("error","Failed to send bash command",Se instanceof Error?Se.message:void 0)}finally{j(!1)}}}function Te(){b.trim()&&O(!0)}function je(me){R(me),A&&O(!1)}function Ze(me){me.key==="Enter"&&!me.shiftKey&&(me.preventDefault(),le())}return C.jsx("div",{className:"min-h-screen bg-[#0a0a0f]",children:C.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:[C.jsxs("nav",{className:"text-xs text-[#555] flex items-center gap-1",children:[C.jsx(hi,{to:"/",className:"hover:text-[#00e5ff] transition-colors",children:"Overview"}),C.jsx("span",{className:"text-[#333]",children:"/"}),C.jsx("span",{className:"text-[#e0e0e0] truncate max-w-[160px] sm:max-w-xs",children:N.windowName||N.id})]}),C.jsx(xE,{session:N,health:B,onApprove:z,onReject:V,onInterrupt:Q,onFork:fe,onKill:G}),C.jsx("div",{className:"flex border-b border-[#1a1a2e]",role:"tablist",children:BE.map(me=>C.jsxs("button",{id:`tab-${me.id}`,onClick:()=>o(me.id),role:"tab","aria-selected":a===me.id,"aria-controls":`panel-${me.id}`,tabIndex:a===me.id?0:-1,className:`flex-1 min-h-[44px] text-sm font-medium transition-colors relative ${a===me.id?"text-[#00e5ff]":"text-[#555] hover:text-[#888]"}`,children:[me.label,a===me.id&&C.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-[#00e5ff]"})]},me.id))}),C.jsxs("div",{className:"bg-[#0a0a0f] rounded-lg min-h-[300px] sm:min-h-[400px]",children:[L&&C.jsx("div",{className:"p-3 sm:p-4 pb-0",children:C.jsx(jE,{prompt:B.details,permissionMode:N.permissionMode,onApprove:z,onReject:V})}),a==="session"&&C.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:C.jsx(DE,{sessionId:N.id,status:B.status})}),a==="metrics"&&C.jsxs("div",{id:"panel-metrics",role:"tabpanel","aria-labelledby":"tab-metrics",tabIndex:0,className:"p-3 sm:p-4",children:[C.jsx(OE,{metrics:h,loading:u}),C.jsx("div",{className:"mt-4",children:C.jsx(LE,{latency:y,loading:d})})]})]}),C.jsxs("div",{className:"bg-[#111118] border border-[#1a1a2e] rounded-lg p-3",children:[C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("label",{htmlFor:"session-message-input",className:"sr-only",children:"Session message input"}),C.jsx("input",{id:"session-message-input",ref:q,type:"text",value:x,onChange:me=>E(me.target.value),onKeyDown:Ze,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"}),C.jsx("button",{onClick:le,disabled:M||!x.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:C.jsx(Y1,{className:"h-4 w-4"})})]}),C.jsxs("div",{className:"flex flex-wrap items-center gap-2 mt-2 pt-2 border-t border-[#1a1a2e]/50",children:[C.jsx("label",{className:"sr-only",htmlFor:"slash-command-select",children:"Common slash command"}),C.jsx("select",{id:"slash-command-select",value:_,onChange:me=>p(me.target.value),disabled:f||!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:U_.map(me=>C.jsx("option",{value:me,children:me},me))}),C.jsx("button",{onClick:ae,disabled:f||!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"}),C.jsx("button",{onClick:pe,disabled:f||!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:f?"Sending Slash…":"Run Slash"}),C.jsx("label",{className:"sr-only",htmlFor:"bash-command-input",children:"Bash command"}),C.jsx("input",{id:"bash-command-input",type:"text",value:b,onChange:me=>je(me.target.value),placeholder:"Bash command (requires confirmation)…",disabled:w||!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"}),A?C.jsxs(C.Fragment,{children:[C.jsx("span",{className:"text-[11px] text-[#ffaa00] italic",children:"Confirm bash command execution."}),C.jsx("button",{onClick:_e,disabled:w||!b.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:w?"Sending Bash…":"Confirm Bash"}),C.jsx("button",{onClick:()=>O(!1),disabled:w,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"})]}):C.jsx("button",{onClick:Te,disabled:w||!b.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"}),!K&&C.jsxs("button",{onClick:U,disabled:I||!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:[C.jsx(d1,{className:"h-3.5 w-3.5"}),I?"Capturing…":"Screenshot"]}),C.jsxs("button",{onClick:Q,"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:[C.jsx(I1,{className:"h-3.5 w-3.5"}),"Interrupt"]}),C.jsxs("button",{onClick:de,"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:[C.jsx(k1,{className:"h-3.5 w-3.5"}),"Escape"]})]}),X&&C.jsxs("div",{className:"mt-3 rounded-lg border border-[#1a1a2e] bg-[#0a0a0f] p-3",children:[C.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[C.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wide text-gray-400",children:"Latest screenshot"}),C.jsx("span",{className:"text-[11px] text-gray-500",children:new Date(X.capturedAt).toLocaleTimeString()})]}),C.jsx("img",{src:X.image,alt:"Session screenshot preview",className:"max-h-[420px] w-full rounded border border-[#1a1a2e] object-contain bg-black"}),C.jsx("div",{className:"mt-2 text-[11px] text-gray-500",children:X.mimeType??"image/png"})]})]})]})})}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 Jp({status:i}){const r=HE[i]??"bg-gray-500/10 text-gray-500 border-gray-500/30",a=UE.has(i);return C.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&&C.jsxs("span",{className:"relative flex h-2 w-2",children:[C.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full opacity-75 bg-current"}),C.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 $E({open:i,onClose:r}){const a=To(),o=P.useRef(null),g=P.useRef(null),[k,T]=P.useState(""),[l,h]=P.useState([Bn(),Bn()]),[u,y]=P.useState(!1),[d,x]=P.useState(null),E=P.useCallback(()=>{M(),r()},[r]);function M(){T(""),h([Bn(),Bn()]),y(!1),x(null)}P.useEffect(()=>{if(!i)return;const b=R=>{R.key==="Escape"&&E()};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[i,E]),P.useEffect(()=>{if(!i)return;const b=o.current;if(!b)return;const R='input, textarea, select, button, [tabindex]:not([tabindex="-1"])',A=O=>{if(O.key!=="Tab")return;const w=Array.from(b.querySelectorAll(R));if(w.length===0)return;const j=w[0],I=w[w.length-1];O.shiftKey?document.activeElement===j&&(O.preventDefault(),I.focus()):document.activeElement===I&&(O.preventDefault(),j.focus())};return b.addEventListener("keydown",A),()=>b.removeEventListener("keydown",A)},[i]),P.useEffect(()=>{if(i){const b=setTimeout(()=>{var R;return(R=g.current)==null?void 0:R.focus()},50);return()=>clearTimeout(b)}},[i]);function S(){l.length>=10||h([...l,Bn()])}function _(b){l.length<=1||h(l.filter((R,A)=>A!==b))}function p(b,R,A){h(l.map((O,w)=>w===b?{...O,[R]:A}:O))}async function f(b){b.preventDefault(),x(null);const R=l.filter(A=>A.workDir.trim());if(!k.trim()){x("Pipeline name is required");return}if(R.length===0){x("At least one step with a working directory is required");return}y(!0);try{const A=await zw({name:k.trim(),workDir:R[0].workDir.trim(),stages:R.map(O=>({workDir:O.workDir.trim(),name:O.name.trim()||void 0,prompt:O.prompt.trim()||void 0}))});M(),r(),a(`/pipelines/${A.id}`)}catch(A){x(A instanceof Error?A.message:"Failed to create pipeline")}finally{y(!1)}}if(!i)return null;const v=k.trim()&&l.some(b=>b.workDir.trim());return C.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[C.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:E}),C.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:[C.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-5 py-4 border-b border-[#1a1a2e]",children:[C.jsx("h2",{className:"text-sm font-semibold text-gray-100",children:"New Pipeline"}),C.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:C.jsx(Ao,{className:"h-4 w-4"})})]}),C.jsxs("form",{onSubmit:f,className:"p-4 sm:p-5 space-y-4",children:[C.jsxs("div",{children:[C.jsxs("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:["Pipeline Name ",C.jsx("span",{className:"text-[#ef4444]",children:"*"})]}),C.jsx("input",{type:"text",ref:g,value:k,onChange:b=>T(b.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]"})]}),C.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 text-xs font-medium text-gray-500 px-1",children:[C.jsxs("span",{children:["Working Directory ",C.jsx("span",{className:"text-[#ef4444]",children:"*"})]}),C.jsx("span",{children:"Name"}),C.jsx("span",{children:"Prompt"}),C.jsx("span",{})]}),C.jsx("div",{className:"space-y-2",children:l.map((b,R)=>C.jsxs("div",{className:"grid grid-cols-[1fr_120px_1fr_44px] gap-2 items-start",children:[C.jsx("input",{type:"text",value:b.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"}),C.jsx("input",{type:"text",value:b.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]"}),C.jsx("input",{type:"text",value:b.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]"}),C.jsx("button",{type:"button",onClick:()=>_(R),disabled:l.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:C.jsx(Ru,{className:"h-3.5 w-3.5"})})]},b._key))}),l.length<10&&C.jsxs("button",{type:"button",onClick:S,className:"flex items-center gap-1.5 text-xs text-gray-500 hover:text-gray-300 transition-colors",children:[C.jsx(Fn,{className:"h-3.5 w-3.5"}),"Add Step"]}),d&&C.jsx("div",{className:"text-xs text-[#ef4444] bg-[#ef4444]/10 border border-[#ef4444]/20 rounded px-3 py-2",children:d}),C.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[C.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"}),C.jsxs("button",{type:"submit",disabled:u||!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:[u&&C.jsx(mu,{className:"h-3 w-3 animate-spin"}),"Create Pipeline"]})]})]})]})]})}const PE=5e3,ZE=6e4;function qE(){const[i,r]=P.useState([]),[a,o]=P.useState(!0),[g,k]=P.useState(!1),T=Ui(u=>u.addToast),l=P.useCallback(async()=>{try{const u=await Hw();return r(u),!0}catch(u){return T("error","Failed to fetch pipelines",u instanceof Error?u.message:void 0),!1}finally{o(!1)}},[T]);P.useEffect(()=>{let u,y=!1,d=0;const x=async()=>{if(y||(await l()?d=0:d+=1,y))return;const M=d>0?2**d:1,S=Math.min(PE*M,ZE);u=setTimeout(()=>{x()},S)};return x(),()=>{y=!0,u&&clearTimeout(u)}},[l]);const h={total:i.length,running:i.filter(u=>u.status==="running").length,completed:i.filter(u=>u.status==="completed").length,failed:i.filter(u=>u.status==="failed").length};return a?C.jsx("div",{className:"flex items-center justify-center min-h-[50vh] text-gray-500 text-sm",children:C.jsx("div",{className:"animate-pulse",children:"Loading pipelines…"})}):C.jsxs("div",{className:"flex flex-col gap-6",children:[C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsxs("div",{children:[C.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:"Pipelines"}),C.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Manage and monitor session pipelines"})]}),C.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:[C.jsx(Fn,{className:"h-3.5 w-3.5"}),"New Pipeline"]})]}),C.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[C.jsx(ui,{label:"Total",value:h.total}),C.jsx(ui,{label:"Running",value:h.running}),C.jsx(ui,{label:"Completed",value:h.completed}),C.jsx(ui,{label:"Failed",value:h.failed})]}),i.length===0?C.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118] p-12 text-center",children:[C.jsx("p",{className:"text-gray-500",children:"No pipelines yet"}),C.jsx("p",{className:"mt-1 text-xs text-gray-600",children:"Create a pipeline to run sessions in sequence"})]}):C.jsx("div",{className:"space-y-3",children:i.map(u=>C.jsx(hi,{to:`/pipelines/${u.id}`,className:"block rounded-lg border border-[#1a1a2e] bg-[#111118] p-4 hover:border-[#00e5ff]/30 transition-colors",children:C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[C.jsx("span",{className:"font-medium text-gray-200 truncate",children:u.name}),C.jsx(Jp,{status:u.status})]}),C.jsxs("div",{className:"flex items-center gap-4 text-xs text-gray-500 shrink-0 ml-4",children:[C.jsxs("span",{children:[u.stages.length," step",u.stages.length!==1?"s":""]}),C.jsx("span",{children:Zs(u.createdAt)})]})]})},u.id))}),C.jsx($E,{open:g,onClose:()=>k(!1)})]})}const FE=3e3,KE=6e4;function VE(){const{id:i}=J_(),[r,a]=P.useState(null),[o,g]=P.useState(!0),[k,T]=P.useState(!1),l=Ui(u=>u.addToast),h=P.useCallback(async()=>{if(!i)return!1;try{const u=await Uw(i);return a(u),T(!1),!0}catch(u){const y=u;return y.statusCode===404?T(!0):l("error","Failed to fetch pipeline",y.message),!1}finally{g(!1)}},[i,l]);return P.useEffect(()=>{let u,y=!1,d=0;const x=async()=>{if(y||(await h()?d=0:d+=1,y))return;const M=d>0?2**d:1,S=Math.min(FE*M,KE);u=setTimeout(()=>{x()},S)};return x(),()=>{y=!0,u&&clearTimeout(u)}},[h]),o?C.jsx("div",{className:"flex items-center justify-center min-h-[50vh] text-gray-500 text-sm",children:C.jsx("div",{className:"animate-pulse",children:"Loading pipeline…"})}):k||!r?C.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[50vh] text-gray-500",children:[C.jsx("div",{className:"text-6xl mb-4",children:"404"}),C.jsx("div",{className:"text-lg mb-6 text-gray-200",children:"Pipeline not found"}),C.jsx(hi,{to:"/pipelines",className:"text-sm text-[#00e5ff] hover:underline",children:"← Back to Pipelines"})]}):C.jsxs("div",{className:"flex flex-col gap-6",children:[C.jsxs("nav",{className:"text-xs text-gray-500 flex items-center gap-1",children:[C.jsx(hi,{to:"/pipelines",className:"hover:text-[#00e5ff] transition-colors",children:"Pipelines"}),C.jsx("span",{className:"text-gray-700",children:"/"}),C.jsx("span",{className:"text-gray-200 truncate max-w-xs",children:r.name})]}),C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsxs("div",{className:"flex items-center gap-3",children:[C.jsx("h2",{className:"text-2xl font-bold text-gray-100",children:r.name}),C.jsx(Jp,{status:r.status})]}),C.jsxs("div",{className:"text-xs text-gray-500",children:["Created ",Zs(r.createdAt)]})]}),C.jsxs("div",{className:"rounded-lg border border-void-lighter bg-[#111118]",children:[C.jsx("div",{className:"px-4 py-3 border-b border-void-lighter",children:C.jsxs("h3",{className:"text-sm font-semibold text-gray-200",children:["Steps (",r.stages.length,")"]})}),r.stages.length===0?C.jsx("div",{className:"p-8 text-center text-gray-500 text-sm",children:"No steps yet"}):C.jsxs("table",{className:"w-full text-left text-sm",children:[C.jsx("thead",{children:C.jsxs("tr",{className:"border-b border-void-lighter text-gray-600",children:[C.jsx("th",{className:"px-4 py-3 font-medium w-16",children:"#"}),C.jsx("th",{className:"px-4 py-3 font-medium",children:"Status"}),C.jsx("th",{className:"px-4 py-3 font-medium",children:"Name"}),C.jsx("th",{className:"px-4 py-3 font-medium",children:"Session"})]})}),C.jsx("tbody",{children:r.stages.map((u,y)=>C.jsxs("tr",{className:"border-b border-void-lighter/50 transition-colors hover:border-l-2 hover:border-l-cyan",children:[C.jsxs("td",{className:"px-4 py-3 text-gray-500 font-mono text-xs",children:["#",y+1]}),C.jsx("td",{className:"px-4 py-3",children:C.jsx(Bo,{status:u.status})}),C.jsx("td",{className:"px-4 py-3",children:u.sessionId?C.jsx(hi,{to:`/sessions/${encodeURIComponent(u.sessionId)}`,className:"font-medium text-gray-200 hover:text-cyan transition-colors",children:u.name}):C.jsx("span",{className:"font-medium text-gray-200",children:u.name})}),C.jsx("td",{className:"px-4 py-3 font-mono text-xs text-gray-400",children:u.sessionId??"—"})]},u.name))})]})]})]})}function GE(){return C.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-4 text-center",children:[C.jsx("h1",{className:"text-6xl font-bold text-gray-500",children:"404"}),C.jsx("p",{className:"text-lg text-gray-400",children:"Page not found"}),C.jsx(hi,{to:"/",className:"mt-2 rounded-lg bg-cyan px-4 py-2 text-sm font-medium text-void transition-colors hover:bg-cyan/80",children:"Back to Dashboard"})]})}function YE(){return C.jsx(a1,{children:C.jsx(Ty,{children:C.jsxs(fs,{element:C.jsx(Xw,{}),children:[C.jsx(fs,{path:"/",element:C.jsx(yE,{})}),C.jsx(fs,{path:"/auth/keys",element:C.jsx(rE,{})}),C.jsx(fs,{path:"/sessions/:id",element:C.jsx(zE,{})}),C.jsx(fs,{path:"/pipelines",element:C.jsx(qE,{})}),C.jsx(fs,{path:"/pipelines/:id",element:C.jsx(VE,{})}),C.jsx(fs,{path:"*",element:C.jsx(GE,{})})]})})})}T0.createRoot(document.getElementById("root")).render(C.jsx(zn.StrictMode,{children:C.jsx(Xy,{basename:"/dashboard",children:C.jsx(YE,{})})}));
|