@jean2/client 0.6.7 → 0.6.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,578 @@
1
+ function n4(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in t)){const a=Object.getOwnPropertyDescriptor(r,o);a&&Object.defineProperty(t,o,a.get?a:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const c of a.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(o){if(o.ep)return;o.ep=!0;const a=n(o);fetch(o.href,a)}})();function Gd(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Fp={exports:{}},Ul={};/**
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 oy;function r4(){if(oy)return Ul;oy=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,o,a){var c=null;if(a!==void 0&&(c=""+a),o.key!==void 0&&(c=""+o.key),"key"in o){a={};for(var l in o)l!=="key"&&(a[l]=o[l])}else a=o;return o=a.ref,{$$typeof:t,type:r,key:c,ref:o!==void 0?o:null,props:a}}return Ul.Fragment=e,Ul.jsx=n,Ul.jsxs=n,Ul}var ay;function s4(){return ay||(ay=1,Fp.exports=r4()),Fp.exports}var m=s4(),Hp={exports:{}},st={};/**
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 ly;function i4(){if(ly)return st;ly=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),c=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),_=Symbol.iterator;function x(z){return z===null||typeof z!="object"?null:(z=_&&z[_]||z["@@iterator"],typeof z=="function"?z:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,v={};function b(z,F,B){this.props=z,this.context=F,this.refs=v,this.updater=B||C}b.prototype.isReactComponent={},b.prototype.setState=function(z,F){if(typeof z!="object"&&typeof z!="function"&&z!=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,z,F,"setState")},b.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function y(){}y.prototype=b.prototype;function S(z,F,B){this.props=z,this.context=F,this.refs=v,this.updater=B||C}var k=S.prototype=new y;k.constructor=S,w(k,b.prototype),k.isPureReactComponent=!0;var T=Array.isArray;function R(){}var D={H:null,A:null,T:null,S:null},A=Object.prototype.hasOwnProperty;function j(z,F,B){var Y=B.ref;return{$$typeof:t,type:z,key:F,ref:Y!==void 0?Y:null,props:B}}function O(z,F){return j(z.type,F,z.props)}function P(z){return typeof z=="object"&&z!==null&&z.$$typeof===t}function $(z){var F={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(B){return F[B]})}var U=/\/+/g;function W(z,F){return typeof z=="object"&&z!==null&&z.key!=null?$(""+z.key):F.toString(36)}function K(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(R,R):(z.status="pending",z.then(function(F){z.status==="pending"&&(z.status="fulfilled",z.value=F)},function(F){z.status==="pending"&&(z.status="rejected",z.reason=F)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function V(z,F,B,Y,ee){var J=typeof z;(J==="undefined"||J==="boolean")&&(z=null);var G=!1;if(z===null)G=!0;else switch(J){case"bigint":case"string":case"number":G=!0;break;case"object":switch(z.$$typeof){case t:case e:G=!0;break;case p:return G=z._init,V(G(z._payload),F,B,Y,ee)}}if(G)return ee=ee(z),G=Y===""?"."+W(z,0):Y,T(ee)?(B="",G!=null&&(B=G.replace(U,"$&/")+"/"),V(ee,F,B,"",function(re){return re})):ee!=null&&(P(ee)&&(ee=O(ee,B+(ee.key==null||z&&z.key===ee.key?"":(""+ee.key).replace(U,"$&/")+"/")+G)),F.push(ee)),1;G=0;var q=Y===""?".":Y+":";if(T(z))for(var te=0;te<z.length;te++)Y=z[te],J=q+W(Y,te),G+=V(Y,F,B,J,ee);else if(te=x(z),typeof te=="function")for(z=te.call(z),te=0;!(Y=z.next()).done;)Y=Y.value,J=q+W(Y,te++),G+=V(Y,F,B,J,ee);else if(J==="object"){if(typeof z.then=="function")return V(K(z),F,B,Y,ee);throw F=String(z),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.")}return G}function Q(z,F,B){if(z==null)return z;var Y=[],ee=0;return V(z,Y,"","",function(J){return F.call(B,J,ee++)}),Y}function X(z){if(z._status===-1){var F=z._result;F=F(),F.then(function(B){(z._status===0||z._status===-1)&&(z._status=1,z._result=B)},function(B){(z._status===0||z._status===-1)&&(z._status=2,z._result=B)}),z._status===-1&&(z._status=0,z._result=F)}if(z._status===1)return z._result.default;throw z._result}var I=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var F=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z=="object"&&z!==null&&typeof z.message=="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent(F))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)},L={map:Q,forEach:function(z,F,B){Q(z,function(){F.apply(this,arguments)},B)},count:function(z){var F=0;return Q(z,function(){F++}),F},toArray:function(z){return Q(z,function(F){return F})||[]},only:function(z){if(!P(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return st.Activity=h,st.Children=L,st.Component=b,st.Fragment=n,st.Profiler=o,st.PureComponent=S,st.StrictMode=r,st.Suspense=u,st.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,st.__COMPILER_RUNTIME={__proto__:null,c:function(z){return D.H.useMemoCache(z)}},st.cache=function(z){return function(){return z.apply(null,arguments)}},st.cacheSignal=function(){return null},st.cloneElement=function(z,F,B){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var Y=w({},z.props),ee=z.key;if(F!=null)for(J in F.key!==void 0&&(ee=""+F.key),F)!A.call(F,J)||J==="key"||J==="__self"||J==="__source"||J==="ref"&&F.ref===void 0||(Y[J]=F[J]);var J=arguments.length-2;if(J===1)Y.children=B;else if(1<J){for(var G=Array(J),q=0;q<J;q++)G[q]=arguments[q+2];Y.children=G}return j(z.type,ee,Y)},st.createContext=function(z){return z={$$typeof:c,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:a,_context:z},z},st.createElement=function(z,F,B){var Y,ee={},J=null;if(F!=null)for(Y in F.key!==void 0&&(J=""+F.key),F)A.call(F,Y)&&Y!=="key"&&Y!=="__self"&&Y!=="__source"&&(ee[Y]=F[Y]);var G=arguments.length-2;if(G===1)ee.children=B;else if(1<G){for(var q=Array(G),te=0;te<G;te++)q[te]=arguments[te+2];ee.children=q}if(z&&z.defaultProps)for(Y in G=z.defaultProps,G)ee[Y]===void 0&&(ee[Y]=G[Y]);return j(z,J,ee)},st.createRef=function(){return{current:null}},st.forwardRef=function(z){return{$$typeof:l,render:z}},st.isValidElement=P,st.lazy=function(z){return{$$typeof:p,_payload:{_status:-1,_result:z},_init:X}},st.memo=function(z,F){return{$$typeof:f,type:z,compare:F===void 0?null:F}},st.startTransition=function(z){var F=D.T,B={};D.T=B;try{var Y=z(),ee=D.S;ee!==null&&ee(B,Y),typeof Y=="object"&&Y!==null&&typeof Y.then=="function"&&Y.then(R,I)}catch(J){I(J)}finally{F!==null&&B.types!==null&&(F.types=B.types),D.T=F}},st.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},st.use=function(z){return D.H.use(z)},st.useActionState=function(z,F,B){return D.H.useActionState(z,F,B)},st.useCallback=function(z,F){return D.H.useCallback(z,F)},st.useContext=function(z){return D.H.useContext(z)},st.useDebugValue=function(){},st.useDeferredValue=function(z,F){return D.H.useDeferredValue(z,F)},st.useEffect=function(z,F){return D.H.useEffect(z,F)},st.useEffectEvent=function(z){return D.H.useEffectEvent(z)},st.useId=function(){return D.H.useId()},st.useImperativeHandle=function(z,F,B){return D.H.useImperativeHandle(z,F,B)},st.useInsertionEffect=function(z,F){return D.H.useInsertionEffect(z,F)},st.useLayoutEffect=function(z,F){return D.H.useLayoutEffect(z,F)},st.useMemo=function(z,F){return D.H.useMemo(z,F)},st.useOptimistic=function(z,F){return D.H.useOptimistic(z,F)},st.useReducer=function(z,F,B){return D.H.useReducer(z,F,B)},st.useRef=function(z){return D.H.useRef(z)},st.useState=function(z){return D.H.useState(z)},st.useSyncExternalStore=function(z,F,B){return D.H.useSyncExternalStore(z,F,B)},st.useTransition=function(){return D.H.useTransition()},st.version="19.2.4",st}var cy;function Kd(){return cy||(cy=1,Hp.exports=i4()),Hp.exports}var N=Kd();const Tn=Gd(N),$x=n4({__proto__:null,default:Tn},[N]);var Up={exports:{}},$l={},$p={exports:{}},qp={};/**
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 uy;function o4(){return uy||(uy=1,(function(t){function e(V,Q){var X=V.length;V.push(Q);e:for(;0<X;){var I=X-1>>>1,L=V[I];if(0<o(L,Q))V[I]=Q,V[X]=L,X=I;else break e}}function n(V){return V.length===0?null:V[0]}function r(V){if(V.length===0)return null;var Q=V[0],X=V.pop();if(X!==Q){V[0]=X;e:for(var I=0,L=V.length,z=L>>>1;I<z;){var F=2*(I+1)-1,B=V[F],Y=F+1,ee=V[Y];if(0>o(B,X))Y<L&&0>o(ee,B)?(V[I]=ee,V[Y]=X,I=Y):(V[I]=B,V[F]=X,I=F);else if(Y<L&&0>o(ee,X))V[I]=ee,V[Y]=X,I=Y;else break e}}return Q}function o(V,Q){var X=V.sortIndex-Q.sortIndex;return X!==0?X:V.id-Q.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var c=Date,l=c.now();t.unstable_now=function(){return c.now()-l}}var u=[],f=[],p=1,h=null,_=3,x=!1,C=!1,w=!1,v=!1,b=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function k(V){for(var Q=n(f);Q!==null;){if(Q.callback===null)r(f);else if(Q.startTime<=V)r(f),Q.sortIndex=Q.expirationTime,e(u,Q);else break;Q=n(f)}}function T(V){if(w=!1,k(V),!C)if(n(u)!==null)C=!0,R||(R=!0,$());else{var Q=n(f);Q!==null&&K(T,Q.startTime-V)}}var R=!1,D=-1,A=5,j=-1;function O(){return v?!0:!(t.unstable_now()-j<A)}function P(){if(v=!1,R){var V=t.unstable_now();j=V;var Q=!0;try{e:{C=!1,w&&(w=!1,y(D),D=-1),x=!0;var X=_;try{t:{for(k(V),h=n(u);h!==null&&!(h.expirationTime>V&&O());){var I=h.callback;if(typeof I=="function"){h.callback=null,_=h.priorityLevel;var L=I(h.expirationTime<=V);if(V=t.unstable_now(),typeof L=="function"){h.callback=L,k(V),Q=!0;break t}h===n(u)&&r(u),k(V)}else r(u);h=n(u)}if(h!==null)Q=!0;else{var z=n(f);z!==null&&K(T,z.startTime-V),Q=!1}}break e}finally{h=null,_=X,x=!1}Q=void 0}}finally{Q?$():R=!1}}}var $;if(typeof S=="function")$=function(){S(P)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,W=U.port2;U.port1.onmessage=P,$=function(){W.postMessage(null)}}else $=function(){b(P,0)};function K(V,Q){D=b(function(){V(t.unstable_now())},Q)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(V){V.callback=null},t.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<V?Math.floor(1e3/V):5},t.unstable_getCurrentPriorityLevel=function(){return _},t.unstable_next=function(V){switch(_){case 1:case 2:case 3:var Q=3;break;default:Q=_}var X=_;_=Q;try{return V()}finally{_=X}},t.unstable_requestPaint=function(){v=!0},t.unstable_runWithPriority=function(V,Q){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var X=_;_=V;try{return Q()}finally{_=X}},t.unstable_scheduleCallback=function(V,Q,X){var I=t.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?I+X:I):X=I,V){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=X+L,V={id:p++,callback:Q,priorityLevel:V,startTime:X,expirationTime:L,sortIndex:-1},X>I?(V.sortIndex=X,e(f,V),n(u)===null&&V===n(f)&&(w?(y(D),D=-1):w=!0,K(T,X-I))):(V.sortIndex=L,e(u,V),C||x||(C=!0,R||(R=!0,$()))),V},t.unstable_shouldYield=O,t.unstable_wrapCallback=function(V){var Q=_;return function(){var X=_;_=Q;try{return V.apply(this,arguments)}finally{_=X}}}})(qp)),qp}var dy;function a4(){return dy||(dy=1,$p.exports=o4()),$p.exports}var Vp={exports:{}},Ln={};/**
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 fy;function l4(){if(fy)return Ln;fy=1;var t=Kd();function e(u){var f="https://react.dev/errors/"+u;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)f+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+u+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");function a(u,f,p){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:h==null?null:""+h,children:u,containerInfo:f,implementation:p}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(u,f){if(u==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return Ln.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Ln.createPortal=function(u,f){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(e(299));return a(u,f,null,p)},Ln.flushSync=function(u){var f=c.T,p=r.p;try{if(c.T=null,r.p=2,u)return u()}finally{c.T=f,r.p=p,r.d.f()}},Ln.preconnect=function(u,f){typeof u=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(u,f))},Ln.prefetchDNS=function(u){typeof u=="string"&&r.d.D(u)},Ln.preinit=function(u,f){if(typeof u=="string"&&f&&typeof f.as=="string"){var p=f.as,h=l(p,f.crossOrigin),_=typeof f.integrity=="string"?f.integrity:void 0,x=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;p==="style"?r.d.S(u,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:h,integrity:_,fetchPriority:x}):p==="script"&&r.d.X(u,{crossOrigin:h,integrity:_,fetchPriority:x,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},Ln.preinitModule=function(u,f){if(typeof u=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var p=l(f.as,f.crossOrigin);r.d.M(u,{crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(u)},Ln.preload=function(u,f){if(typeof u=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var p=f.as,h=l(p,f.crossOrigin);r.d.L(u,p,{crossOrigin:h,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},Ln.preloadModule=function(u,f){if(typeof u=="string")if(f){var p=l(f.as,f.crossOrigin);r.d.m(u,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:p,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(u)},Ln.requestFormReset=function(u){r.d.r(u)},Ln.unstable_batchedUpdates=function(u,f){return u(f)},Ln.useFormState=function(u,f,p){return c.H.useFormState(u,f,p)},Ln.useFormStatus=function(){return c.H.useHostTransitionStatus()},Ln.version="19.2.4",Ln}var hy;function qx(){if(hy)return Vp.exports;hy=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Vp.exports=l4(),Vp.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 py;function c4(){if(py)return $l;py=1;var t=a4(),e=Kd(),n=qx();function r(s){var i="https://react.dev/errors/"+s;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)i+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+s+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function a(s){var i=s,d=s;if(s.alternate)for(;i.return;)i=i.return;else{s=i;do i=s,(i.flags&4098)!==0&&(d=i.return),s=i.return;while(s)}return i.tag===3?d:null}function c(s){if(s.tag===13){var i=s.memoizedState;if(i===null&&(s=s.alternate,s!==null&&(i=s.memoizedState)),i!==null)return i.dehydrated}return null}function l(s){if(s.tag===31){var i=s.memoizedState;if(i===null&&(s=s.alternate,s!==null&&(i=s.memoizedState)),i!==null)return i.dehydrated}return null}function u(s){if(a(s)!==s)throw Error(r(188))}function f(s){var i=s.alternate;if(!i){if(i=a(s),i===null)throw Error(r(188));return i!==s?null:s}for(var d=s,g=i;;){var E=d.return;if(E===null)break;var M=E.alternate;if(M===null){if(g=E.return,g!==null){d=g;continue}break}if(E.child===M.child){for(M=E.child;M;){if(M===d)return u(E),s;if(M===g)return u(E),i;M=M.sibling}throw Error(r(188))}if(d.return!==g.return)d=E,g=M;else{for(var H=!1,Z=E.child;Z;){if(Z===d){H=!0,d=E,g=M;break}if(Z===g){H=!0,g=E,d=M;break}Z=Z.sibling}if(!H){for(Z=M.child;Z;){if(Z===d){H=!0,d=M,g=E;break}if(Z===g){H=!0,g=M,d=E;break}Z=Z.sibling}if(!H)throw Error(r(189))}}if(d.alternate!==g)throw Error(r(190))}if(d.tag!==3)throw Error(r(188));return d.stateNode.current===d?s:i}function p(s){var i=s.tag;if(i===5||i===26||i===27||i===6)return s;for(s=s.child;s!==null;){if(i=p(s),i!==null)return i;s=s.sibling}return null}var h=Object.assign,_=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),y=Symbol.for("react.consumer"),S=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),O=Symbol.for("react.memo_cache_sentinel"),P=Symbol.iterator;function $(s){return s===null||typeof s!="object"?null:(s=P&&s[P]||s["@@iterator"],typeof s=="function"?s:null)}var U=Symbol.for("react.client.reference");function W(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===U?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case w:return"Fragment";case b:return"Profiler";case v:return"StrictMode";case T:return"Suspense";case R:return"SuspenseList";case j:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case C:return"Portal";case S:return s.displayName||"Context";case y:return(s._context.displayName||"Context")+".Consumer";case k:var i=s.render;return s=s.displayName,s||(s=i.displayName||i.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case D:return i=s.displayName||null,i!==null?i:W(s.type)||"Memo";case A:i=s._payload,s=s._init;try{return W(s(i))}catch{}}return null}var K=Array.isArray,V=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X={pending:!1,data:null,method:null,action:null},I=[],L=-1;function z(s){return{current:s}}function F(s){0>L||(s.current=I[L],I[L]=null,L--)}function B(s,i){L++,I[L]=s.current,s.current=i}var Y=z(null),ee=z(null),J=z(null),G=z(null);function q(s,i){switch(B(J,i),B(ee,s),B(Y,null),i.nodeType){case 9:case 11:s=(s=i.documentElement)&&(s=s.namespaceURI)?T_(s):0;break;default:if(s=i.tagName,i=i.namespaceURI)i=T_(i),s=N_(i,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}F(Y),B(Y,s)}function te(){F(Y),F(ee),F(J)}function re(s){s.memoizedState!==null&&B(G,s);var i=Y.current,d=N_(i,s.type);i!==d&&(B(ee,s),B(Y,d))}function oe(s){ee.current===s&&(F(Y),F(ee)),G.current===s&&(F(G),zl._currentValue=X)}var se,ye;function Ee(s){if(se===void 0)try{throw Error()}catch(d){var i=d.stack.trim().match(/\n( *(at )?)/);se=i&&i[1]||"",ye=-1<d.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+se+s+ye}var Ae=!1;function Be(s,i){if(!s||Ae)return"";Ae=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(i){var xe=function(){throw Error()};if(Object.defineProperty(xe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(xe,[])}catch(me){var fe=me}Reflect.construct(s,[],xe)}else{try{xe.call()}catch(me){fe=me}s.call(xe.prototype)}}else{try{throw Error()}catch(me){fe=me}(xe=s())&&typeof xe.catch=="function"&&xe.catch(function(){})}}catch(me){if(me&&fe&&typeof me.stack=="string")return[me.stack,fe.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var E=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");E&&E.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var M=g.DetermineComponentFrameRoot(),H=M[0],Z=M[1];if(H&&Z){var ne=H.split(`
44
+ `),de=Z.split(`
45
+ `);for(E=g=0;g<ne.length&&!ne[g].includes("DetermineComponentFrameRoot");)g++;for(;E<de.length&&!de[E].includes("DetermineComponentFrameRoot");)E++;if(g===ne.length||E===de.length)for(g=ne.length-1,E=de.length-1;1<=g&&0<=E&&ne[g]!==de[E];)E--;for(;1<=g&&0<=E;g--,E--)if(ne[g]!==de[E]){if(g!==1||E!==1)do if(g--,E--,0>E||ne[g]!==de[E]){var _e=`
46
+ `+ne[g].replace(" at new "," at ");return s.displayName&&_e.includes("<anonymous>")&&(_e=_e.replace("<anonymous>",s.displayName)),_e}while(1<=g&&0<=E);break}}}finally{Ae=!1,Error.prepareStackTrace=d}return(d=s?s.displayName||s.name:"")?Ee(d):""}function le(s,i){switch(s.tag){case 26:case 27:case 5:return Ee(s.type);case 16:return Ee("Lazy");case 13:return s.child!==i&&i!==null?Ee("Suspense Fallback"):Ee("Suspense");case 19:return Ee("SuspenseList");case 0:case 15:return Be(s.type,!1);case 11:return Be(s.type.render,!1);case 1:return Be(s.type,!0);case 31:return Ee("Activity");default:return""}}function Ce(s){try{var i="",d=null;do i+=le(s,d),d=s,s=s.return;while(s);return i}catch(g){return`
47
+ Error generating stack: `+g.message+`
48
+ `+g.stack}}var ge=Object.prototype.hasOwnProperty,Oe=t.unstable_scheduleCallback,He=t.unstable_cancelCallback,rt=t.unstable_shouldYield,Qe=t.unstable_requestPaint,Ne=t.unstable_now,Ge=t.unstable_getCurrentPriorityLevel,ce=t.unstable_ImmediatePriority,ve=t.unstable_UserBlockingPriority,Te=t.unstable_NormalPriority,je=t.unstable_LowPriority,Le=t.unstable_IdlePriority,Je=t.log,Ue=t.unstable_setDisableYieldValue,Pe=null,Re=null;function Ke(s){if(typeof Je=="function"&&Ue(s),Re&&typeof Re.setStrictMode=="function")try{Re.setStrictMode(Pe,s)}catch{}}var we=Math.clz32?Math.clz32:gt,De=Math.log,$e=Math.LN2;function gt(s){return s>>>=0,s===0?32:31-(De(s)/$e|0)|0}var It=256,Et=262144,Zt=4194304;function qt(s){var i=s&42;if(i!==0)return i;switch(s&-s){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 s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function tt(s,i,d){var g=s.pendingLanes;if(g===0)return 0;var E=0,M=s.suspendedLanes,H=s.pingedLanes;s=s.warmLanes;var Z=g&134217727;return Z!==0?(g=Z&~M,g!==0?E=qt(g):(H&=Z,H!==0?E=qt(H):d||(d=Z&~s,d!==0&&(E=qt(d))))):(Z=g&~M,Z!==0?E=qt(Z):H!==0?E=qt(H):d||(d=g&~s,d!==0&&(E=qt(d)))),E===0?0:i!==0&&i!==E&&(i&M)===0&&(M=E&-E,d=i&-i,M>=d||M===32&&(d&4194048)!==0)?i:E}function vt(s,i){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&i)===0}function Vt(s,i){switch(s){case 1:case 2:case 4:case 8:case 64:return i+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 i+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 Ht(){var s=Zt;return Zt<<=1,(Zt&62914560)===0&&(Zt=4194304),s}function Wt(s){for(var i=[],d=0;31>d;d++)i.push(s);return i}function Sn(s,i){s.pendingLanes|=i,i!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function jr(s,i,d,g,E,M){var H=s.pendingLanes;s.pendingLanes=d,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=d,s.entangledLanes&=d,s.errorRecoveryDisabledLanes&=d,s.shellSuspendCounter=0;var Z=s.entanglements,ne=s.expirationTimes,de=s.hiddenUpdates;for(d=H&~d;0<d;){var _e=31-we(d),xe=1<<_e;Z[_e]=0,ne[_e]=-1;var fe=de[_e];if(fe!==null)for(de[_e]=null,_e=0;_e<fe.length;_e++){var me=fe[_e];me!==null&&(me.lane&=-536870913)}d&=~xe}g!==0&&zn(s,g,0),M!==0&&E===0&&s.tag!==0&&(s.suspendedLanes|=M&~(H&~i))}function zn(s,i,d){s.pendingLanes|=i,s.suspendedLanes&=~i;var g=31-we(i);s.entangledLanes|=i,s.entanglements[g]=s.entanglements[g]|1073741824|d&261930}function Wn(s,i){var d=s.entangledLanes|=i;for(s=s.entanglements;d;){var g=31-we(d),E=1<<g;E&i|s[g]&i&&(s[g]|=i),d&=~E}}function Gn(s,i){var d=i&-i;return d=(d&42)!==0?1:Gt(d),(d&(s.suspendedLanes|i))!==0?0:d}function Gt(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=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:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function dn(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function gn(){var s=Q.p;return s!==0?s:(s=window.event,s===void 0?32:J_(s.type))}function Or(s,i){var d=Q.p;try{return Q.p=s,i()}finally{Q.p=d}}var Mn=Math.random().toString(36).slice(2),jt="__reactFiber$"+Mn,Ut="__reactProps$"+Mn,Dn="__reactContainer$"+Mn,Bn="__reactEvents$"+Mn,Us="__reactListeners$"+Mn,Lr="__reactHandles$"+Mn,Xr="__reactResources$"+Mn,Fn="__reactMarker$"+Mn;function Qr(s){delete s[jt],delete s[Ut],delete s[Bn],delete s[Us],delete s[Lr]}function yr(s){var i=s[jt];if(i)return i;for(var d=s.parentNode;d;){if(i=d[Dn]||d[jt]){if(d=i.alternate,i.child!==null||d!==null&&d.child!==null)for(s=P_(s);s!==null;){if(d=s[jt])return d;s=P_(s)}return i}s=d,d=s.parentNode}return null}function vn(s){if(s=s[jt]||s[Dn]){var i=s.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return s}return null}function wn(s){var i=s.tag;if(i===5||i===26||i===27||i===6)return s.stateNode;throw Error(r(33))}function Hn(s){var i=s[Xr];return i||(i=s[Xr]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function _t(s){s[Fn]=!0}var Kn=new Set,jn={};function fn(s,i){Kt(s,i),Kt(s+"Capture",i)}function Kt(s,i){for(jn[s]=i,s=0;s<i.length;s++)Kn.add(i[s])}var Ir=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]*$"),Zr={},Jr={};function Pr(s){return ge.call(Jr,s)?!0:ge.call(Zr,s)?!1:Ir.test(s)?Jr[s]=!0:(Zr[s]=!0,!1)}function Yn(s,i,d){if(Pr(i))if(d===null)s.removeAttribute(i);else{switch(typeof d){case"undefined":case"function":case"symbol":s.removeAttribute(i);return;case"boolean":var g=i.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){s.removeAttribute(i);return}}s.setAttribute(i,""+d)}}function rr(s,i,d){if(d===null)s.removeAttribute(i);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(i);return}s.setAttribute(i,""+d)}}function Cn(s,i,d,g){if(g===null)s.removeAttribute(d);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(d);return}s.setAttributeNS(i,d,""+g)}}function Jt(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function rn(s){var i=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function sn(s,i,d){var g=Object.getOwnPropertyDescriptor(s.constructor.prototype,i);if(!s.hasOwnProperty(i)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var E=g.get,M=g.set;return Object.defineProperty(s,i,{configurable:!0,get:function(){return E.call(this)},set:function(H){d=""+H,M.call(this,H)}}),Object.defineProperty(s,i,{enumerable:g.enumerable}),{getValue:function(){return d},setValue:function(H){d=""+H},stopTracking:function(){s._valueTracker=null,delete s[i]}}}}function $s(s){if(!s._valueTracker){var i=rn(s)?"checked":"value";s._valueTracker=sn(s,i,""+s[i])}}function Eo(s){if(!s)return!1;var i=s._valueTracker;if(!i)return!0;var d=i.getValue(),g="";return s&&(g=rn(s)?s.checked?"true":"false":s.value),s=g,s!==d?(i.setValue(s),!0):!1}function Ao(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var $f=/[\n"\\]/g;function _n(s){return s.replace($f,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Qa(s,i,d,g,E,M,H,Z){s.name="",H!=null&&typeof H!="function"&&typeof H!="symbol"&&typeof H!="boolean"?s.type=H:s.removeAttribute("type"),i!=null?H==="number"?(i===0&&s.value===""||s.value!=i)&&(s.value=""+Jt(i)):s.value!==""+Jt(i)&&(s.value=""+Jt(i)):H!=="submit"&&H!=="reset"||s.removeAttribute("value"),i!=null?Li(s,H,Jt(i)):d!=null?Li(s,H,Jt(d)):g!=null&&s.removeAttribute("value"),E==null&&M!=null&&(s.defaultChecked=!!M),E!=null&&(s.checked=E&&typeof E!="function"&&typeof E!="symbol"),Z!=null&&typeof Z!="function"&&typeof Z!="symbol"&&typeof Z!="boolean"?s.name=""+Jt(Z):s.removeAttribute("name")}function Oi(s,i,d,g,E,M,H,Z){if(M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"&&(s.type=M),i!=null||d!=null){if(!(M!=="submit"&&M!=="reset"||i!=null)){$s(s);return}d=d!=null?""+Jt(d):"",i=i!=null?""+Jt(i):d,Z||i===s.value||(s.value=i),s.defaultValue=i}g=g!=null?g:E,g=typeof g!="function"&&typeof g!="symbol"&&!!g,s.checked=Z?s.checked:!!g,s.defaultChecked=!!g,H!=null&&typeof H!="function"&&typeof H!="symbol"&&typeof H!="boolean"&&(s.name=H),$s(s)}function Li(s,i,d){i==="number"&&Ao(s.ownerDocument)===s||s.defaultValue===""+d||(s.defaultValue=""+d)}function qs(s,i,d,g){if(s=s.options,i){i={};for(var E=0;E<d.length;E++)i["$"+d[E]]=!0;for(d=0;d<s.length;d++)E=i.hasOwnProperty("$"+s[d].value),s[d].selected!==E&&(s[d].selected=E),E&&g&&(s[d].defaultSelected=!0)}else{for(d=""+Jt(d),i=null,E=0;E<s.length;E++){if(s[E].value===d){s[E].selected=!0,g&&(s[E].defaultSelected=!0);return}i!==null||s[E].disabled||(i=s[E])}i!==null&&(i.selected=!0)}}function Za(s,i,d){if(i!=null&&(i=""+Jt(i),i!==s.value&&(s.value=i),d==null)){s.defaultValue!==i&&(s.defaultValue=i);return}s.defaultValue=d!=null?""+Jt(d):""}function Hc(s,i,d,g){if(i==null){if(g!=null){if(d!=null)throw Error(r(92));if(K(g)){if(1<g.length)throw Error(r(93));g=g[0]}d=g}d==null&&(d=""),i=d}d=Jt(i),s.defaultValue=d,g=s.textContent,g===d&&g!==""&&g!==null&&(s.value=g),$s(s)}function Vs(s,i){if(i){var d=s.firstChild;if(d&&d===s.lastChild&&d.nodeType===3){d.nodeValue=i;return}}s.textContent=i}var qf=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 Uc(s,i,d){var g=i.indexOf("--")===0;d==null||typeof d=="boolean"||d===""?g?s.setProperty(i,""):i==="float"?s.cssFloat="":s[i]="":g?s.setProperty(i,d):typeof d!="number"||d===0||qf.has(i)?i==="float"?s.cssFloat=d:s[i]=(""+d).trim():s[i]=d+"px"}function $c(s,i,d){if(i!=null&&typeof i!="object")throw Error(r(62));if(s=s.style,d!=null){for(var g in d)!d.hasOwnProperty(g)||i!=null&&i.hasOwnProperty(g)||(g.indexOf("--")===0?s.setProperty(g,""):g==="float"?s.cssFloat="":s[g]="");for(var E in i)g=i[E],i.hasOwnProperty(E)&&d[E]!==g&&Uc(s,E,g)}else for(var M in i)i.hasOwnProperty(M)&&Uc(s,M,i[M])}function ps(s){if(s.indexOf("-")===-1)return!1;switch(s){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 qc=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"]]),Ro=/^[\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 Ii(s){return Ro.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function br(){}var To=null;function Ja(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Ws=null,Gs=null;function el(s){var i=vn(s);if(i&&(s=i.stateNode)){var d=s[Ut]||null;e:switch(s=i.stateNode,i.type){case"input":if(Qa(s,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name),i=d.name,d.type==="radio"&&i!=null){for(d=s;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll('input[name="'+_n(""+i)+'"][type="radio"]'),i=0;i<d.length;i++){var g=d[i];if(g!==s&&g.form===s.form){var E=g[Ut]||null;if(!E)throw Error(r(90));Qa(g,E.value,E.defaultValue,E.defaultValue,E.checked,E.defaultChecked,E.type,E.name)}}for(i=0;i<d.length;i++)g=d[i],g.form===s.form&&Eo(g)}break e;case"textarea":Za(s,d.value,d.defaultValue);break e;case"select":i=d.value,i!=null&&qs(s,!!d.multiple,i,!1)}}}var tl=!1;function Vc(s,i,d){if(tl)return s(i,d);tl=!0;try{var g=s(i);return g}finally{if(tl=!1,(Ws!==null||Gs!==null)&&(Lu(),Ws&&(i=Ws,s=Gs,Gs=Ws=null,el(i),s)))for(i=0;i<s.length;i++)el(s[i])}}function Pi(s,i){var d=s.stateNode;if(d===null)return null;var g=d[Ut]||null;if(g===null)return null;d=g[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(s=s.type,g=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!g;break e;default:s=!1}if(s)return null;if(d&&typeof d!="function")throw Error(r(231,i,typeof d));return d}var zr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),nl=!1;if(zr)try{var zi={};Object.defineProperty(zi,"passive",{get:function(){nl=!0}}),window.addEventListener("test",zi,zi),window.removeEventListener("test",zi,zi)}catch{nl=!1}var Br=null,rl=null,No=null;function Wc(){if(No)return No;var s,i=rl,d=i.length,g,E="value"in Br?Br.value:Br.textContent,M=E.length;for(s=0;s<d&&i[s]===E[s];s++);var H=d-s;for(g=1;g<=H&&i[d-g]===E[M-g];g++);return No=E.slice(s,1<g?1-g:void 0)}function Mo(s){var i=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&i===13&&(s=13)):s=i,s===10&&(s=13),32<=s||s===13?s:0}function Do(){return!0}function Gc(){return!1}function On(s){function i(d,g,E,M,H){this._reactName=d,this._targetInst=E,this.type=g,this.nativeEvent=M,this.target=H,this.currentTarget=null;for(var Z in s)s.hasOwnProperty(Z)&&(d=s[Z],this[Z]=d?d(M):M[Z]);return this.isDefaultPrevented=(M.defaultPrevented!=null?M.defaultPrevented:M.returnValue===!1)?Do:Gc,this.isPropagationStopped=Gc,this}return h(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=Do)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=Do)},persist:function(){},isPersistent:Do}),i}var ms={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},jo=On(ms),Bi=h({},ms,{view:0,detail:0}),Vf=On(Bi),sl,Oo,Fi,Hi=h({},Bi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$i,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==Fi&&(Fi&&s.type==="mousemove"?(sl=s.screenX-Fi.screenX,Oo=s.screenY-Fi.screenY):Oo=sl=0,Fi=s),sl)},movementY:function(s){return"movementY"in s?s.movementY:Oo}}),Kc=On(Hi),Lo=h({},Hi,{dataTransfer:0}),Yc=On(Lo),Xc=h({},Bi,{relatedTarget:0}),Io=On(Xc),Qc=h({},ms,{animationName:0,elapsedTime:0,pseudoElement:0}),Zc=On(Qc),pe=h({},ms,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),At=On(pe),zt=h({},ms,{data:0}),bt=On(zt),en={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wt={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"},Ct={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ui(s){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(s):(s=Ct[s])?!!i[s]:!1}function $i(){return Ui}var qi=h({},Bi,{key:function(s){if(s.key){var i=en[s.key]||s.key;if(i!=="Unidentified")return i}return s.type==="keypress"?(s=Mo(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?wt[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$i,charCode:function(s){return s.type==="keypress"?Mo(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Mo(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),Jc=On(qi),mE=h({},Hi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ov=On(mE),gE=h({},Bi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$i}),vE=On(gE),_E=h({},ms,{propertyName:0,elapsedTime:0,pseudoElement:0}),yE=On(_E),bE=h({},Hi,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),xE=On(bE),SE=h({},ms,{newState:0,oldState:0}),wE=On(SE),CE=[9,13,27,32],Wf=zr&&"CompositionEvent"in window,il=null;zr&&"documentMode"in document&&(il=document.documentMode);var kE=zr&&"TextEvent"in window&&!il,Lv=zr&&(!Wf||il&&8<il&&11>=il),Iv=" ",Pv=!1;function zv(s,i){switch(s){case"keyup":return CE.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bv(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Po=!1;function EE(s,i){switch(s){case"compositionend":return Bv(i);case"keypress":return i.which!==32?null:(Pv=!0,Iv);case"textInput":return s=i.data,s===Iv&&Pv?null:s;default:return null}}function AE(s,i){if(Po)return s==="compositionend"||!Wf&&zv(s,i)?(s=Wc(),No=rl=Br=null,Po=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Lv&&i.locale!=="ko"?null:i.data;default:return null}}var RE={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 Fv(s){var i=s&&s.nodeName&&s.nodeName.toLowerCase();return i==="input"?!!RE[s.type]:i==="textarea"}function Hv(s,i,d,g){Ws?Gs?Gs.push(g):Gs=[g]:Ws=g,i=Uu(i,"onChange"),0<i.length&&(d=new jo("onChange","change",null,d,g),s.push({event:d,listeners:i}))}var ol=null,al=null;function TE(s){w_(s,0)}function eu(s){var i=wn(s);if(Eo(i))return s}function Uv(s,i){if(s==="change")return i}var $v=!1;if(zr){var Gf;if(zr){var Kf="oninput"in document;if(!Kf){var qv=document.createElement("div");qv.setAttribute("oninput","return;"),Kf=typeof qv.oninput=="function"}Gf=Kf}else Gf=!1;$v=Gf&&(!document.documentMode||9<document.documentMode)}function Vv(){ol&&(ol.detachEvent("onpropertychange",Wv),al=ol=null)}function Wv(s){if(s.propertyName==="value"&&eu(al)){var i=[];Hv(i,al,s,Ja(s)),Vc(TE,i)}}function NE(s,i,d){s==="focusin"?(Vv(),ol=i,al=d,ol.attachEvent("onpropertychange",Wv)):s==="focusout"&&Vv()}function ME(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return eu(al)}function DE(s,i){if(s==="click")return eu(i)}function jE(s,i){if(s==="input"||s==="change")return eu(i)}function OE(s,i){return s===i&&(s!==0||1/s===1/i)||s!==s&&i!==i}var sr=typeof Object.is=="function"?Object.is:OE;function ll(s,i){if(sr(s,i))return!0;if(typeof s!="object"||s===null||typeof i!="object"||i===null)return!1;var d=Object.keys(s),g=Object.keys(i);if(d.length!==g.length)return!1;for(g=0;g<d.length;g++){var E=d[g];if(!ge.call(i,E)||!sr(s[E],i[E]))return!1}return!0}function Gv(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function Kv(s,i){var d=Gv(s);s=0;for(var g;d;){if(d.nodeType===3){if(g=s+d.textContent.length,s<=i&&g>=i)return{node:d,offset:i-s};s=g}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=Gv(d)}}function Yv(s,i){return s&&i?s===i?!0:s&&s.nodeType===3?!1:i&&i.nodeType===3?Yv(s,i.parentNode):"contains"in s?s.contains(i):s.compareDocumentPosition?!!(s.compareDocumentPosition(i)&16):!1:!1}function Xv(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var i=Ao(s.document);i instanceof s.HTMLIFrameElement;){try{var d=typeof i.contentWindow.location.href=="string"}catch{d=!1}if(d)s=i.contentWindow;else break;i=Ao(s.document)}return i}function Yf(s){var i=s&&s.nodeName&&s.nodeName.toLowerCase();return i&&(i==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||i==="textarea"||s.contentEditable==="true")}var LE=zr&&"documentMode"in document&&11>=document.documentMode,zo=null,Xf=null,cl=null,Qf=!1;function Qv(s,i,d){var g=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;Qf||zo==null||zo!==Ao(g)||(g=zo,"selectionStart"in g&&Yf(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),cl&&ll(cl,g)||(cl=g,g=Uu(Xf,"onSelect"),0<g.length&&(i=new jo("onSelect","select",null,i,d),s.push({event:i,listeners:g}),i.target=zo)))}function Vi(s,i){var d={};return d[s.toLowerCase()]=i.toLowerCase(),d["Webkit"+s]="webkit"+i,d["Moz"+s]="moz"+i,d}var Bo={animationend:Vi("Animation","AnimationEnd"),animationiteration:Vi("Animation","AnimationIteration"),animationstart:Vi("Animation","AnimationStart"),transitionrun:Vi("Transition","TransitionRun"),transitionstart:Vi("Transition","TransitionStart"),transitioncancel:Vi("Transition","TransitionCancel"),transitionend:Vi("Transition","TransitionEnd")},Zf={},Zv={};zr&&(Zv=document.createElement("div").style,"AnimationEvent"in window||(delete Bo.animationend.animation,delete Bo.animationiteration.animation,delete Bo.animationstart.animation),"TransitionEvent"in window||delete Bo.transitionend.transition);function Wi(s){if(Zf[s])return Zf[s];if(!Bo[s])return s;var i=Bo[s],d;for(d in i)if(i.hasOwnProperty(d)&&d in Zv)return Zf[s]=i[d];return s}var Jv=Wi("animationend"),e1=Wi("animationiteration"),t1=Wi("animationstart"),IE=Wi("transitionrun"),PE=Wi("transitionstart"),zE=Wi("transitioncancel"),n1=Wi("transitionend"),r1=new Map,Jf="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(" ");Jf.push("scrollEnd");function Fr(s,i){r1.set(s,i),fn(i,[s])}var tu=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},xr=[],Fo=0,eh=0;function nu(){for(var s=Fo,i=eh=Fo=0;i<s;){var d=xr[i];xr[i++]=null;var g=xr[i];xr[i++]=null;var E=xr[i];xr[i++]=null;var M=xr[i];if(xr[i++]=null,g!==null&&E!==null){var H=g.pending;H===null?E.next=E:(E.next=H.next,H.next=E),g.pending=E}M!==0&&s1(d,E,M)}}function ru(s,i,d,g){xr[Fo++]=s,xr[Fo++]=i,xr[Fo++]=d,xr[Fo++]=g,eh|=g,s.lanes|=g,s=s.alternate,s!==null&&(s.lanes|=g)}function th(s,i,d,g){return ru(s,i,d,g),su(s)}function Gi(s,i){return ru(s,null,null,i),su(s)}function s1(s,i,d){s.lanes|=d;var g=s.alternate;g!==null&&(g.lanes|=d);for(var E=!1,M=s.return;M!==null;)M.childLanes|=d,g=M.alternate,g!==null&&(g.childLanes|=d),M.tag===22&&(s=M.stateNode,s===null||s._visibility&1||(E=!0)),s=M,M=M.return;return s.tag===3?(M=s.stateNode,E&&i!==null&&(E=31-we(d),s=M.hiddenUpdates,g=s[E],g===null?s[E]=[i]:g.push(i),i.lane=d|536870912),M):null}function su(s){if(50<Ml)throw Ml=0,up=null,Error(r(185));for(var i=s.return;i!==null;)s=i,i=s.return;return s.tag===3?s.stateNode:null}var Ho={};function BE(s,i,d,g){this.tag=s,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ir(s,i,d,g){return new BE(s,i,d,g)}function nh(s){return s=s.prototype,!(!s||!s.isReactComponent)}function gs(s,i){var d=s.alternate;return d===null?(d=ir(s.tag,i,s.key,s.mode),d.elementType=s.elementType,d.type=s.type,d.stateNode=s.stateNode,d.alternate=s,s.alternate=d):(d.pendingProps=i,d.type=s.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=s.flags&65011712,d.childLanes=s.childLanes,d.lanes=s.lanes,d.child=s.child,d.memoizedProps=s.memoizedProps,d.memoizedState=s.memoizedState,d.updateQueue=s.updateQueue,i=s.dependencies,d.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},d.sibling=s.sibling,d.index=s.index,d.ref=s.ref,d.refCleanup=s.refCleanup,d}function i1(s,i){s.flags&=65011714;var d=s.alternate;return d===null?(s.childLanes=0,s.lanes=i,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=d.childLanes,s.lanes=d.lanes,s.child=d.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=d.memoizedProps,s.memoizedState=d.memoizedState,s.updateQueue=d.updateQueue,s.type=d.type,i=d.dependencies,s.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),s}function iu(s,i,d,g,E,M){var H=0;if(g=s,typeof s=="function")nh(s)&&(H=1);else if(typeof s=="string")H=q3(s,d,Y.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case j:return s=ir(31,d,i,E),s.elementType=j,s.lanes=M,s;case w:return Ki(d.children,E,M,i);case v:H=8,E|=24;break;case b:return s=ir(12,d,i,E|2),s.elementType=b,s.lanes=M,s;case T:return s=ir(13,d,i,E),s.elementType=T,s.lanes=M,s;case R:return s=ir(19,d,i,E),s.elementType=R,s.lanes=M,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case S:H=10;break e;case y:H=9;break e;case k:H=11;break e;case D:H=14;break e;case A:H=16,g=null;break e}H=29,d=Error(r(130,s===null?"null":typeof s,"")),g=null}return i=ir(H,d,i,E),i.elementType=s,i.type=g,i.lanes=M,i}function Ki(s,i,d,g){return s=ir(7,s,g,i),s.lanes=d,s}function rh(s,i,d){return s=ir(6,s,null,i),s.lanes=d,s}function o1(s){var i=ir(18,null,null,0);return i.stateNode=s,i}function sh(s,i,d){return i=ir(4,s.children!==null?s.children:[],s.key,i),i.lanes=d,i.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},i}var a1=new WeakMap;function Sr(s,i){if(typeof s=="object"&&s!==null){var d=a1.get(s);return d!==void 0?d:(i={value:s,source:i,stack:Ce(i)},a1.set(s,i),i)}return{value:s,source:i,stack:Ce(i)}}var Uo=[],$o=0,ou=null,ul=0,wr=[],Cr=0,Ks=null,es=1,ts="";function vs(s,i){Uo[$o++]=ul,Uo[$o++]=ou,ou=s,ul=i}function l1(s,i,d){wr[Cr++]=es,wr[Cr++]=ts,wr[Cr++]=Ks,Ks=s;var g=es;s=ts;var E=32-we(g)-1;g&=~(1<<E),d+=1;var M=32-we(i)+E;if(30<M){var H=E-E%5;M=(g&(1<<H)-1).toString(32),g>>=H,E-=H,es=1<<32-we(i)+E|d<<E|g,ts=M+s}else es=1<<M|d<<E|g,ts=s}function ih(s){s.return!==null&&(vs(s,1),l1(s,1,0))}function oh(s){for(;s===ou;)ou=Uo[--$o],Uo[$o]=null,ul=Uo[--$o],Uo[$o]=null;for(;s===Ks;)Ks=wr[--Cr],wr[Cr]=null,ts=wr[--Cr],wr[Cr]=null,es=wr[--Cr],wr[Cr]=null}function c1(s,i){wr[Cr++]=es,wr[Cr++]=ts,wr[Cr++]=Ks,es=i.id,ts=i.overflow,Ks=s}var kn=null,Bt=null,mt=!1,Ys=null,kr=!1,ah=Error(r(519));function Xs(s){var i=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw dl(Sr(i,s)),ah}function u1(s){var i=s.stateNode,d=s.type,g=s.memoizedProps;switch(i[jt]=s,i[Ut]=g,d){case"dialog":dt("cancel",i),dt("close",i);break;case"iframe":case"object":case"embed":dt("load",i);break;case"video":case"audio":for(d=0;d<jl.length;d++)dt(jl[d],i);break;case"source":dt("error",i);break;case"img":case"image":case"link":dt("error",i),dt("load",i);break;case"details":dt("toggle",i);break;case"input":dt("invalid",i),Oi(i,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":dt("invalid",i);break;case"textarea":dt("invalid",i),Hc(i,g.value,g.defaultValue,g.children)}d=g.children,typeof d!="string"&&typeof d!="number"&&typeof d!="bigint"||i.textContent===""+d||g.suppressHydrationWarning===!0||A_(i.textContent,d)?(g.popover!=null&&(dt("beforetoggle",i),dt("toggle",i)),g.onScroll!=null&&dt("scroll",i),g.onScrollEnd!=null&&dt("scrollend",i),g.onClick!=null&&(i.onclick=br),i=!0):i=!1,i||Xs(s,!0)}function d1(s){for(kn=s.return;kn;)switch(kn.tag){case 5:case 31:case 13:kr=!1;return;case 27:case 3:kr=!0;return;default:kn=kn.return}}function qo(s){if(s!==kn)return!1;if(!mt)return d1(s),mt=!0,!1;var i=s.tag,d;if((d=i!==3&&i!==27)&&((d=i===5)&&(d=s.type,d=!(d!=="form"&&d!=="button")||kp(s.type,s.memoizedProps)),d=!d),d&&Bt&&Xs(s),d1(s),i===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));Bt=I_(s)}else if(i===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));Bt=I_(s)}else i===27?(i=Bt,ui(s.type)?(s=Np,Np=null,Bt=s):Bt=i):Bt=kn?Ar(s.stateNode.nextSibling):null;return!0}function Yi(){Bt=kn=null,mt=!1}function lh(){var s=Ys;return s!==null&&(Jn===null?Jn=s:Jn.push.apply(Jn,s),Ys=null),s}function dl(s){Ys===null?Ys=[s]:Ys.push(s)}var ch=z(null),Xi=null,_s=null;function Qs(s,i,d){B(ch,i._currentValue),i._currentValue=d}function ys(s){s._currentValue=ch.current,F(ch)}function uh(s,i,d){for(;s!==null;){var g=s.alternate;if((s.childLanes&i)!==i?(s.childLanes|=i,g!==null&&(g.childLanes|=i)):g!==null&&(g.childLanes&i)!==i&&(g.childLanes|=i),s===d)break;s=s.return}}function dh(s,i,d,g){var E=s.child;for(E!==null&&(E.return=s);E!==null;){var M=E.dependencies;if(M!==null){var H=E.child;M=M.firstContext;e:for(;M!==null;){var Z=M;M=E;for(var ne=0;ne<i.length;ne++)if(Z.context===i[ne]){M.lanes|=d,Z=M.alternate,Z!==null&&(Z.lanes|=d),uh(M.return,d,s),g||(H=null);break e}M=Z.next}}else if(E.tag===18){if(H=E.return,H===null)throw Error(r(341));H.lanes|=d,M=H.alternate,M!==null&&(M.lanes|=d),uh(H,d,s),H=null}else H=E.child;if(H!==null)H.return=E;else for(H=E;H!==null;){if(H===s){H=null;break}if(E=H.sibling,E!==null){E.return=H.return,H=E;break}H=H.return}E=H}}function Vo(s,i,d,g){s=null;for(var E=i,M=!1;E!==null;){if(!M){if((E.flags&524288)!==0)M=!0;else if((E.flags&262144)!==0)break}if(E.tag===10){var H=E.alternate;if(H===null)throw Error(r(387));if(H=H.memoizedProps,H!==null){var Z=E.type;sr(E.pendingProps.value,H.value)||(s!==null?s.push(Z):s=[Z])}}else if(E===G.current){if(H=E.alternate,H===null)throw Error(r(387));H.memoizedState.memoizedState!==E.memoizedState.memoizedState&&(s!==null?s.push(zl):s=[zl])}E=E.return}s!==null&&dh(i,s,d,g),i.flags|=262144}function au(s){for(s=s.firstContext;s!==null;){if(!sr(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function Qi(s){Xi=s,_s=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function En(s){return f1(Xi,s)}function lu(s,i){return Xi===null&&Qi(s),f1(s,i)}function f1(s,i){var d=i._currentValue;if(i={context:i,memoizedValue:d,next:null},_s===null){if(s===null)throw Error(r(308));_s=i,s.dependencies={lanes:0,firstContext:i},s.flags|=524288}else _s=_s.next=i;return d}var FE=typeof AbortController<"u"?AbortController:function(){var s=[],i=this.signal={aborted:!1,addEventListener:function(d,g){s.push(g)}};this.abort=function(){i.aborted=!0,s.forEach(function(d){return d()})}},HE=t.unstable_scheduleCallback,UE=t.unstable_NormalPriority,on={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function fh(){return{controller:new FE,data:new Map,refCount:0}}function fl(s){s.refCount--,s.refCount===0&&HE(UE,function(){s.controller.abort()})}var hl=null,hh=0,Wo=0,Go=null;function $E(s,i){if(hl===null){var d=hl=[];hh=0,Wo=gp(),Go={status:"pending",value:void 0,then:function(g){d.push(g)}}}return hh++,i.then(h1,h1),i}function h1(){if(--hh===0&&hl!==null){Go!==null&&(Go.status="fulfilled");var s=hl;hl=null,Wo=0,Go=null;for(var i=0;i<s.length;i++)(0,s[i])()}}function qE(s,i){var d=[],g={status:"pending",value:null,reason:null,then:function(E){d.push(E)}};return s.then(function(){g.status="fulfilled",g.value=i;for(var E=0;E<d.length;E++)(0,d[E])(i)},function(E){for(g.status="rejected",g.reason=E,E=0;E<d.length;E++)(0,d[E])(void 0)}),g}var p1=V.S;V.S=function(s,i){Q0=Ne(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&$E(s,i),p1!==null&&p1(s,i)};var Zi=z(null);function ph(){var s=Zi.current;return s!==null?s:Ot.pooledCache}function cu(s,i){i===null?B(Zi,Zi.current):B(Zi,i.pool)}function m1(){var s=ph();return s===null?null:{parent:on._currentValue,pool:s}}var Ko=Error(r(460)),mh=Error(r(474)),uu=Error(r(542)),du={then:function(){}};function g1(s){return s=s.status,s==="fulfilled"||s==="rejected"}function v1(s,i,d){switch(d=s[d],d===void 0?s.push(i):d!==i&&(i.then(br,br),i=d),i.status){case"fulfilled":return i.value;case"rejected":throw s=i.reason,y1(s),s;default:if(typeof i.status=="string")i.then(br,br);else{if(s=Ot,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=i,s.status="pending",s.then(function(g){if(i.status==="pending"){var E=i;E.status="fulfilled",E.value=g}},function(g){if(i.status==="pending"){var E=i;E.status="rejected",E.reason=g}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw s=i.reason,y1(s),s}throw eo=i,Ko}}function Ji(s){try{var i=s._init;return i(s._payload)}catch(d){throw d!==null&&typeof d=="object"&&typeof d.then=="function"?(eo=d,Ko):d}}var eo=null;function _1(){if(eo===null)throw Error(r(459));var s=eo;return eo=null,s}function y1(s){if(s===Ko||s===uu)throw Error(r(483))}var Yo=null,pl=0;function fu(s){var i=pl;return pl+=1,Yo===null&&(Yo=[]),v1(Yo,s,i)}function ml(s,i){i=i.props.ref,s.ref=i!==void 0?i:null}function hu(s,i){throw i.$$typeof===_?Error(r(525)):(s=Object.prototype.toString.call(i),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":s)))}function b1(s){function i(ae,ie){if(s){var ue=ae.deletions;ue===null?(ae.deletions=[ie],ae.flags|=16):ue.push(ie)}}function d(ae,ie){if(!s)return null;for(;ie!==null;)i(ae,ie),ie=ie.sibling;return null}function g(ae){for(var ie=new Map;ae!==null;)ae.key!==null?ie.set(ae.key,ae):ie.set(ae.index,ae),ae=ae.sibling;return ie}function E(ae,ie){return ae=gs(ae,ie),ae.index=0,ae.sibling=null,ae}function M(ae,ie,ue){return ae.index=ue,s?(ue=ae.alternate,ue!==null?(ue=ue.index,ue<ie?(ae.flags|=67108866,ie):ue):(ae.flags|=67108866,ie)):(ae.flags|=1048576,ie)}function H(ae){return s&&ae.alternate===null&&(ae.flags|=67108866),ae}function Z(ae,ie,ue,be){return ie===null||ie.tag!==6?(ie=rh(ue,ae.mode,be),ie.return=ae,ie):(ie=E(ie,ue),ie.return=ae,ie)}function ne(ae,ie,ue,be){var Ze=ue.type;return Ze===w?_e(ae,ie,ue.props.children,be,ue.key):ie!==null&&(ie.elementType===Ze||typeof Ze=="object"&&Ze!==null&&Ze.$$typeof===A&&Ji(Ze)===ie.type)?(ie=E(ie,ue.props),ml(ie,ue),ie.return=ae,ie):(ie=iu(ue.type,ue.key,ue.props,null,ae.mode,be),ml(ie,ue),ie.return=ae,ie)}function de(ae,ie,ue,be){return ie===null||ie.tag!==4||ie.stateNode.containerInfo!==ue.containerInfo||ie.stateNode.implementation!==ue.implementation?(ie=sh(ue,ae.mode,be),ie.return=ae,ie):(ie=E(ie,ue.children||[]),ie.return=ae,ie)}function _e(ae,ie,ue,be,Ze){return ie===null||ie.tag!==7?(ie=Ki(ue,ae.mode,be,Ze),ie.return=ae,ie):(ie=E(ie,ue),ie.return=ae,ie)}function xe(ae,ie,ue){if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return ie=rh(""+ie,ae.mode,ue),ie.return=ae,ie;if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case x:return ue=iu(ie.type,ie.key,ie.props,null,ae.mode,ue),ml(ue,ie),ue.return=ae,ue;case C:return ie=sh(ie,ae.mode,ue),ie.return=ae,ie;case A:return ie=Ji(ie),xe(ae,ie,ue)}if(K(ie)||$(ie))return ie=Ki(ie,ae.mode,ue,null),ie.return=ae,ie;if(typeof ie.then=="function")return xe(ae,fu(ie),ue);if(ie.$$typeof===S)return xe(ae,lu(ae,ie),ue);hu(ae,ie)}return null}function fe(ae,ie,ue,be){var Ze=ie!==null?ie.key:null;if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return Ze!==null?null:Z(ae,ie,""+ue,be);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case x:return ue.key===Ze?ne(ae,ie,ue,be):null;case C:return ue.key===Ze?de(ae,ie,ue,be):null;case A:return ue=Ji(ue),fe(ae,ie,ue,be)}if(K(ue)||$(ue))return Ze!==null?null:_e(ae,ie,ue,be,null);if(typeof ue.then=="function")return fe(ae,ie,fu(ue),be);if(ue.$$typeof===S)return fe(ae,ie,lu(ae,ue),be);hu(ae,ue)}return null}function me(ae,ie,ue,be,Ze){if(typeof be=="string"&&be!==""||typeof be=="number"||typeof be=="bigint")return ae=ae.get(ue)||null,Z(ie,ae,""+be,Ze);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case x:return ae=ae.get(be.key===null?ue:be.key)||null,ne(ie,ae,be,Ze);case C:return ae=ae.get(be.key===null?ue:be.key)||null,de(ie,ae,be,Ze);case A:return be=Ji(be),me(ae,ie,ue,be,Ze)}if(K(be)||$(be))return ae=ae.get(ue)||null,_e(ie,ae,be,Ze,null);if(typeof be.then=="function")return me(ae,ie,ue,fu(be),Ze);if(be.$$typeof===S)return me(ae,ie,ue,lu(ie,be),Ze);hu(ie,be)}return null}function qe(ae,ie,ue,be){for(var Ze=null,xt=null,Ye=ie,ot=ie=0,pt=null;Ye!==null&&ot<ue.length;ot++){Ye.index>ot?(pt=Ye,Ye=null):pt=Ye.sibling;var St=fe(ae,Ye,ue[ot],be);if(St===null){Ye===null&&(Ye=pt);break}s&&Ye&&St.alternate===null&&i(ae,Ye),ie=M(St,ie,ot),xt===null?Ze=St:xt.sibling=St,xt=St,Ye=pt}if(ot===ue.length)return d(ae,Ye),mt&&vs(ae,ot),Ze;if(Ye===null){for(;ot<ue.length;ot++)Ye=xe(ae,ue[ot],be),Ye!==null&&(ie=M(Ye,ie,ot),xt===null?Ze=Ye:xt.sibling=Ye,xt=Ye);return mt&&vs(ae,ot),Ze}for(Ye=g(Ye);ot<ue.length;ot++)pt=me(Ye,ae,ot,ue[ot],be),pt!==null&&(s&&pt.alternate!==null&&Ye.delete(pt.key===null?ot:pt.key),ie=M(pt,ie,ot),xt===null?Ze=pt:xt.sibling=pt,xt=pt);return s&&Ye.forEach(function(mi){return i(ae,mi)}),mt&&vs(ae,ot),Ze}function nt(ae,ie,ue,be){if(ue==null)throw Error(r(151));for(var Ze=null,xt=null,Ye=ie,ot=ie=0,pt=null,St=ue.next();Ye!==null&&!St.done;ot++,St=ue.next()){Ye.index>ot?(pt=Ye,Ye=null):pt=Ye.sibling;var mi=fe(ae,Ye,St.value,be);if(mi===null){Ye===null&&(Ye=pt);break}s&&Ye&&mi.alternate===null&&i(ae,Ye),ie=M(mi,ie,ot),xt===null?Ze=mi:xt.sibling=mi,xt=mi,Ye=pt}if(St.done)return d(ae,Ye),mt&&vs(ae,ot),Ze;if(Ye===null){for(;!St.done;ot++,St=ue.next())St=xe(ae,St.value,be),St!==null&&(ie=M(St,ie,ot),xt===null?Ze=St:xt.sibling=St,xt=St);return mt&&vs(ae,ot),Ze}for(Ye=g(Ye);!St.done;ot++,St=ue.next())St=me(Ye,ae,ot,St.value,be),St!==null&&(s&&St.alternate!==null&&Ye.delete(St.key===null?ot:St.key),ie=M(St,ie,ot),xt===null?Ze=St:xt.sibling=St,xt=St);return s&&Ye.forEach(function(t4){return i(ae,t4)}),mt&&vs(ae,ot),Ze}function Dt(ae,ie,ue,be){if(typeof ue=="object"&&ue!==null&&ue.type===w&&ue.key===null&&(ue=ue.props.children),typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case x:e:{for(var Ze=ue.key;ie!==null;){if(ie.key===Ze){if(Ze=ue.type,Ze===w){if(ie.tag===7){d(ae,ie.sibling),be=E(ie,ue.props.children),be.return=ae,ae=be;break e}}else if(ie.elementType===Ze||typeof Ze=="object"&&Ze!==null&&Ze.$$typeof===A&&Ji(Ze)===ie.type){d(ae,ie.sibling),be=E(ie,ue.props),ml(be,ue),be.return=ae,ae=be;break e}d(ae,ie);break}else i(ae,ie);ie=ie.sibling}ue.type===w?(be=Ki(ue.props.children,ae.mode,be,ue.key),be.return=ae,ae=be):(be=iu(ue.type,ue.key,ue.props,null,ae.mode,be),ml(be,ue),be.return=ae,ae=be)}return H(ae);case C:e:{for(Ze=ue.key;ie!==null;){if(ie.key===Ze)if(ie.tag===4&&ie.stateNode.containerInfo===ue.containerInfo&&ie.stateNode.implementation===ue.implementation){d(ae,ie.sibling),be=E(ie,ue.children||[]),be.return=ae,ae=be;break e}else{d(ae,ie);break}else i(ae,ie);ie=ie.sibling}be=sh(ue,ae.mode,be),be.return=ae,ae=be}return H(ae);case A:return ue=Ji(ue),Dt(ae,ie,ue,be)}if(K(ue))return qe(ae,ie,ue,be);if($(ue)){if(Ze=$(ue),typeof Ze!="function")throw Error(r(150));return ue=Ze.call(ue),nt(ae,ie,ue,be)}if(typeof ue.then=="function")return Dt(ae,ie,fu(ue),be);if(ue.$$typeof===S)return Dt(ae,ie,lu(ae,ue),be);hu(ae,ue)}return typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint"?(ue=""+ue,ie!==null&&ie.tag===6?(d(ae,ie.sibling),be=E(ie,ue),be.return=ae,ae=be):(d(ae,ie),be=rh(ue,ae.mode,be),be.return=ae,ae=be),H(ae)):d(ae,ie)}return function(ae,ie,ue,be){try{pl=0;var Ze=Dt(ae,ie,ue,be);return Yo=null,Ze}catch(Ye){if(Ye===Ko||Ye===uu)throw Ye;var xt=ir(29,Ye,null,ae.mode);return xt.lanes=be,xt.return=ae,xt}finally{}}}var to=b1(!0),x1=b1(!1),Zs=!1;function gh(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function vh(s,i){s=s.updateQueue,i.updateQueue===s&&(i.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function Js(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function ei(s,i,d){var g=s.updateQueue;if(g===null)return null;if(g=g.shared,(kt&2)!==0){var E=g.pending;return E===null?i.next=i:(i.next=E.next,E.next=i),g.pending=i,i=su(s),s1(s,null,d),i}return ru(s,g,i,d),su(s)}function gl(s,i,d){if(i=i.updateQueue,i!==null&&(i=i.shared,(d&4194048)!==0)){var g=i.lanes;g&=s.pendingLanes,d|=g,i.lanes=d,Wn(s,d)}}function _h(s,i){var d=s.updateQueue,g=s.alternate;if(g!==null&&(g=g.updateQueue,d===g)){var E=null,M=null;if(d=d.firstBaseUpdate,d!==null){do{var H={lane:d.lane,tag:d.tag,payload:d.payload,callback:null,next:null};M===null?E=M=H:M=M.next=H,d=d.next}while(d!==null);M===null?E=M=i:M=M.next=i}else E=M=i;d={baseState:g.baseState,firstBaseUpdate:E,lastBaseUpdate:M,shared:g.shared,callbacks:g.callbacks},s.updateQueue=d;return}s=d.lastBaseUpdate,s===null?d.firstBaseUpdate=i:s.next=i,d.lastBaseUpdate=i}var yh=!1;function vl(){if(yh){var s=Go;if(s!==null)throw s}}function _l(s,i,d,g){yh=!1;var E=s.updateQueue;Zs=!1;var M=E.firstBaseUpdate,H=E.lastBaseUpdate,Z=E.shared.pending;if(Z!==null){E.shared.pending=null;var ne=Z,de=ne.next;ne.next=null,H===null?M=de:H.next=de,H=ne;var _e=s.alternate;_e!==null&&(_e=_e.updateQueue,Z=_e.lastBaseUpdate,Z!==H&&(Z===null?_e.firstBaseUpdate=de:Z.next=de,_e.lastBaseUpdate=ne))}if(M!==null){var xe=E.baseState;H=0,_e=de=ne=null,Z=M;do{var fe=Z.lane&-536870913,me=fe!==Z.lane;if(me?(ht&fe)===fe:(g&fe)===fe){fe!==0&&fe===Wo&&(yh=!0),_e!==null&&(_e=_e.next={lane:0,tag:Z.tag,payload:Z.payload,callback:null,next:null});e:{var qe=s,nt=Z;fe=i;var Dt=d;switch(nt.tag){case 1:if(qe=nt.payload,typeof qe=="function"){xe=qe.call(Dt,xe,fe);break e}xe=qe;break e;case 3:qe.flags=qe.flags&-65537|128;case 0:if(qe=nt.payload,fe=typeof qe=="function"?qe.call(Dt,xe,fe):qe,fe==null)break e;xe=h({},xe,fe);break e;case 2:Zs=!0}}fe=Z.callback,fe!==null&&(s.flags|=64,me&&(s.flags|=8192),me=E.callbacks,me===null?E.callbacks=[fe]:me.push(fe))}else me={lane:fe,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null},_e===null?(de=_e=me,ne=xe):_e=_e.next=me,H|=fe;if(Z=Z.next,Z===null){if(Z=E.shared.pending,Z===null)break;me=Z,Z=me.next,me.next=null,E.lastBaseUpdate=me,E.shared.pending=null}}while(!0);_e===null&&(ne=xe),E.baseState=ne,E.firstBaseUpdate=de,E.lastBaseUpdate=_e,M===null&&(E.shared.lanes=0),ii|=H,s.lanes=H,s.memoizedState=xe}}function S1(s,i){if(typeof s!="function")throw Error(r(191,s));s.call(i)}function w1(s,i){var d=s.callbacks;if(d!==null)for(s.callbacks=null,s=0;s<d.length;s++)S1(d[s],i)}var Xo=z(null),pu=z(0);function C1(s,i){s=Rs,B(pu,s),B(Xo,i),Rs=s|i.baseLanes}function bh(){B(pu,Rs),B(Xo,Xo.current)}function xh(){Rs=pu.current,F(Xo),F(pu)}var or=z(null),Er=null;function ti(s){var i=s.alternate;B(tn,tn.current&1),B(or,s),Er===null&&(i===null||Xo.current!==null||i.memoizedState!==null)&&(Er=s)}function Sh(s){B(tn,tn.current),B(or,s),Er===null&&(Er=s)}function k1(s){s.tag===22?(B(tn,tn.current),B(or,s),Er===null&&(Er=s)):ni()}function ni(){B(tn,tn.current),B(or,or.current)}function ar(s){F(or),Er===s&&(Er=null),F(tn)}var tn=z(0);function mu(s){for(var i=s;i!==null;){if(i.tag===13){var d=i.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||Rp(d)||Tp(d)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break;for(;i.sibling===null;){if(i.return===null||i.return===s)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var bs=0,it=null,Nt=null,an=null,gu=!1,Qo=!1,no=!1,vu=0,yl=0,Zo=null,VE=0;function Yt(){throw Error(r(321))}function wh(s,i){if(i===null)return!1;for(var d=0;d<i.length&&d<s.length;d++)if(!sr(s[d],i[d]))return!1;return!0}function Ch(s,i,d,g,E,M){return bs=M,it=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,V.H=s===null||s.memoizedState===null?l0:Bh,no=!1,M=d(g,E),no=!1,Qo&&(M=A1(i,d,g,E)),E1(s),M}function E1(s){V.H=Sl;var i=Nt!==null&&Nt.next!==null;if(bs=0,an=Nt=it=null,gu=!1,yl=0,Zo=null,i)throw Error(r(300));s===null||ln||(s=s.dependencies,s!==null&&au(s)&&(ln=!0))}function A1(s,i,d,g){it=s;var E=0;do{if(Qo&&(Zo=null),yl=0,Qo=!1,25<=E)throw Error(r(301));if(E+=1,an=Nt=null,s.updateQueue!=null){var M=s.updateQueue;M.lastEffect=null,M.events=null,M.stores=null,M.memoCache!=null&&(M.memoCache.index=0)}V.H=c0,M=i(d,g)}while(Qo);return M}function WE(){var s=V.H,i=s.useState()[0];return i=typeof i.then=="function"?bl(i):i,s=s.useState()[0],(Nt!==null?Nt.memoizedState:null)!==s&&(it.flags|=1024),i}function kh(){var s=vu!==0;return vu=0,s}function Eh(s,i,d){i.updateQueue=s.updateQueue,i.flags&=-2053,s.lanes&=~d}function Ah(s){if(gu){for(s=s.memoizedState;s!==null;){var i=s.queue;i!==null&&(i.pending=null),s=s.next}gu=!1}bs=0,an=Nt=it=null,Qo=!1,yl=vu=0,Zo=null}function Un(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return an===null?it.memoizedState=an=s:an=an.next=s,an}function nn(){if(Nt===null){var s=it.alternate;s=s!==null?s.memoizedState:null}else s=Nt.next;var i=an===null?it.memoizedState:an.next;if(i!==null)an=i,Nt=s;else{if(s===null)throw it.alternate===null?Error(r(467)):Error(r(310));Nt=s,s={memoizedState:Nt.memoizedState,baseState:Nt.baseState,baseQueue:Nt.baseQueue,queue:Nt.queue,next:null},an===null?it.memoizedState=an=s:an=an.next=s}return an}function _u(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function bl(s){var i=yl;return yl+=1,Zo===null&&(Zo=[]),s=v1(Zo,s,i),i=it,(an===null?i.memoizedState:an.next)===null&&(i=i.alternate,V.H=i===null||i.memoizedState===null?l0:Bh),s}function yu(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return bl(s);if(s.$$typeof===S)return En(s)}throw Error(r(438,String(s)))}function Rh(s){var i=null,d=it.updateQueue;if(d!==null&&(i=d.memoCache),i==null){var g=it.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(i={data:g.data.map(function(E){return E.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),d===null&&(d=_u(),it.updateQueue=d),d.memoCache=i,d=i.data[i.index],d===void 0)for(d=i.data[i.index]=Array(s),g=0;g<s;g++)d[g]=O;return i.index++,d}function xs(s,i){return typeof i=="function"?i(s):i}function bu(s){var i=nn();return Th(i,Nt,s)}function Th(s,i,d){var g=s.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=d;var E=s.baseQueue,M=g.pending;if(M!==null){if(E!==null){var H=E.next;E.next=M.next,M.next=H}i.baseQueue=E=M,g.pending=null}if(M=s.baseState,E===null)s.memoizedState=M;else{i=E.next;var Z=H=null,ne=null,de=i,_e=!1;do{var xe=de.lane&-536870913;if(xe!==de.lane?(ht&xe)===xe:(bs&xe)===xe){var fe=de.revertLane;if(fe===0)ne!==null&&(ne=ne.next={lane:0,revertLane:0,gesture:null,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null}),xe===Wo&&(_e=!0);else if((bs&fe)===fe){de=de.next,fe===Wo&&(_e=!0);continue}else xe={lane:0,revertLane:de.revertLane,gesture:null,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},ne===null?(Z=ne=xe,H=M):ne=ne.next=xe,it.lanes|=fe,ii|=fe;xe=de.action,no&&d(M,xe),M=de.hasEagerState?de.eagerState:d(M,xe)}else fe={lane:xe,revertLane:de.revertLane,gesture:de.gesture,action:de.action,hasEagerState:de.hasEagerState,eagerState:de.eagerState,next:null},ne===null?(Z=ne=fe,H=M):ne=ne.next=fe,it.lanes|=xe,ii|=xe;de=de.next}while(de!==null&&de!==i);if(ne===null?H=M:ne.next=Z,!sr(M,s.memoizedState)&&(ln=!0,_e&&(d=Go,d!==null)))throw d;s.memoizedState=M,s.baseState=H,s.baseQueue=ne,g.lastRenderedState=M}return E===null&&(g.lanes=0),[s.memoizedState,g.dispatch]}function Nh(s){var i=nn(),d=i.queue;if(d===null)throw Error(r(311));d.lastRenderedReducer=s;var g=d.dispatch,E=d.pending,M=i.memoizedState;if(E!==null){d.pending=null;var H=E=E.next;do M=s(M,H.action),H=H.next;while(H!==E);sr(M,i.memoizedState)||(ln=!0),i.memoizedState=M,i.baseQueue===null&&(i.baseState=M),d.lastRenderedState=M}return[M,g]}function R1(s,i,d){var g=it,E=nn(),M=mt;if(M){if(d===void 0)throw Error(r(407));d=d()}else d=i();var H=!sr((Nt||E).memoizedState,d);if(H&&(E.memoizedState=d,ln=!0),E=E.queue,jh(M1.bind(null,g,E,s),[s]),E.getSnapshot!==i||H||an!==null&&an.memoizedState.tag&1){if(g.flags|=2048,Jo(9,{destroy:void 0},N1.bind(null,g,E,d,i),null),Ot===null)throw Error(r(349));M||(bs&127)!==0||T1(g,i,d)}return d}function T1(s,i,d){s.flags|=16384,s={getSnapshot:i,value:d},i=it.updateQueue,i===null?(i=_u(),it.updateQueue=i,i.stores=[s]):(d=i.stores,d===null?i.stores=[s]:d.push(s))}function N1(s,i,d,g){i.value=d,i.getSnapshot=g,D1(i)&&j1(s)}function M1(s,i,d){return d(function(){D1(i)&&j1(s)})}function D1(s){var i=s.getSnapshot;s=s.value;try{var d=i();return!sr(s,d)}catch{return!0}}function j1(s){var i=Gi(s,2);i!==null&&er(i,s,2)}function Mh(s){var i=Un();if(typeof s=="function"){var d=s;if(s=d(),no){Ke(!0);try{d()}finally{Ke(!1)}}}return i.memoizedState=i.baseState=s,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xs,lastRenderedState:s},i}function O1(s,i,d,g){return s.baseState=d,Th(s,Nt,typeof g=="function"?g:xs)}function GE(s,i,d,g,E){if(wu(s))throw Error(r(485));if(s=i.action,s!==null){var M={payload:E,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(H){M.listeners.push(H)}};V.T!==null?d(!0):M.isTransition=!1,g(M),d=i.pending,d===null?(M.next=i.pending=M,L1(i,M)):(M.next=d.next,i.pending=d.next=M)}}function L1(s,i){var d=i.action,g=i.payload,E=s.state;if(i.isTransition){var M=V.T,H={};V.T=H;try{var Z=d(E,g),ne=V.S;ne!==null&&ne(H,Z),I1(s,i,Z)}catch(de){Dh(s,i,de)}finally{M!==null&&H.types!==null&&(M.types=H.types),V.T=M}}else try{M=d(E,g),I1(s,i,M)}catch(de){Dh(s,i,de)}}function I1(s,i,d){d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(function(g){P1(s,i,g)},function(g){return Dh(s,i,g)}):P1(s,i,d)}function P1(s,i,d){i.status="fulfilled",i.value=d,z1(i),s.state=d,i=s.pending,i!==null&&(d=i.next,d===i?s.pending=null:(d=d.next,i.next=d,L1(s,d)))}function Dh(s,i,d){var g=s.pending;if(s.pending=null,g!==null){g=g.next;do i.status="rejected",i.reason=d,z1(i),i=i.next;while(i!==g)}s.action=null}function z1(s){s=s.listeners;for(var i=0;i<s.length;i++)(0,s[i])()}function B1(s,i){return i}function F1(s,i){if(mt){var d=Ot.formState;if(d!==null){e:{var g=it;if(mt){if(Bt){t:{for(var E=Bt,M=kr;E.nodeType!==8;){if(!M){E=null;break t}if(E=Ar(E.nextSibling),E===null){E=null;break t}}M=E.data,E=M==="F!"||M==="F"?E:null}if(E){Bt=Ar(E.nextSibling),g=E.data==="F!";break e}}Xs(g)}g=!1}g&&(i=d[0])}}return d=Un(),d.memoizedState=d.baseState=i,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:B1,lastRenderedState:i},d.queue=g,d=i0.bind(null,it,g),g.dispatch=d,g=Mh(!1),M=zh.bind(null,it,!1,g.queue),g=Un(),E={state:i,dispatch:null,action:s,pending:null},g.queue=E,d=GE.bind(null,it,E,M,d),E.dispatch=d,g.memoizedState=s,[i,d,!1]}function H1(s){var i=nn();return U1(i,Nt,s)}function U1(s,i,d){if(i=Th(s,i,B1)[0],s=bu(xs)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var g=bl(i)}catch(H){throw H===Ko?uu:H}else g=i;i=nn();var E=i.queue,M=E.dispatch;return d!==i.memoizedState&&(it.flags|=2048,Jo(9,{destroy:void 0},KE.bind(null,E,d),null)),[g,M,s]}function KE(s,i){s.action=i}function $1(s){var i=nn(),d=Nt;if(d!==null)return U1(i,d,s);nn(),i=i.memoizedState,d=nn();var g=d.queue.dispatch;return d.memoizedState=s,[i,g,!1]}function Jo(s,i,d,g){return s={tag:s,create:d,deps:g,inst:i,next:null},i=it.updateQueue,i===null&&(i=_u(),it.updateQueue=i),d=i.lastEffect,d===null?i.lastEffect=s.next=s:(g=d.next,d.next=s,s.next=g,i.lastEffect=s),s}function q1(){return nn().memoizedState}function xu(s,i,d,g){var E=Un();it.flags|=s,E.memoizedState=Jo(1|i,{destroy:void 0},d,g===void 0?null:g)}function Su(s,i,d,g){var E=nn();g=g===void 0?null:g;var M=E.memoizedState.inst;Nt!==null&&g!==null&&wh(g,Nt.memoizedState.deps)?E.memoizedState=Jo(i,M,d,g):(it.flags|=s,E.memoizedState=Jo(1|i,M,d,g))}function V1(s,i){xu(8390656,8,s,i)}function jh(s,i){Su(2048,8,s,i)}function YE(s){it.flags|=4;var i=it.updateQueue;if(i===null)i=_u(),it.updateQueue=i,i.events=[s];else{var d=i.events;d===null?i.events=[s]:d.push(s)}}function W1(s){var i=nn().memoizedState;return YE({ref:i,nextImpl:s}),function(){if((kt&2)!==0)throw Error(r(440));return i.impl.apply(void 0,arguments)}}function G1(s,i){return Su(4,2,s,i)}function K1(s,i){return Su(4,4,s,i)}function Y1(s,i){if(typeof i=="function"){s=s();var d=i(s);return function(){typeof d=="function"?d():i(null)}}if(i!=null)return s=s(),i.current=s,function(){i.current=null}}function X1(s,i,d){d=d!=null?d.concat([s]):null,Su(4,4,Y1.bind(null,i,s),d)}function Oh(){}function Q1(s,i){var d=nn();i=i===void 0?null:i;var g=d.memoizedState;return i!==null&&wh(i,g[1])?g[0]:(d.memoizedState=[s,i],s)}function Z1(s,i){var d=nn();i=i===void 0?null:i;var g=d.memoizedState;if(i!==null&&wh(i,g[1]))return g[0];if(g=s(),no){Ke(!0);try{s()}finally{Ke(!1)}}return d.memoizedState=[g,i],g}function Lh(s,i,d){return d===void 0||(bs&1073741824)!==0&&(ht&261930)===0?s.memoizedState=i:(s.memoizedState=d,s=J0(),it.lanes|=s,ii|=s,d)}function J1(s,i,d,g){return sr(d,i)?d:Xo.current!==null?(s=Lh(s,d,g),sr(s,i)||(ln=!0),s):(bs&42)===0||(bs&1073741824)!==0&&(ht&261930)===0?(ln=!0,s.memoizedState=d):(s=J0(),it.lanes|=s,ii|=s,i)}function e0(s,i,d,g,E){var M=Q.p;Q.p=M!==0&&8>M?M:8;var H=V.T,Z={};V.T=Z,zh(s,!1,i,d);try{var ne=E(),de=V.S;if(de!==null&&de(Z,ne),ne!==null&&typeof ne=="object"&&typeof ne.then=="function"){var _e=qE(ne,g);xl(s,i,_e,ur(s))}else xl(s,i,g,ur(s))}catch(xe){xl(s,i,{then:function(){},status:"rejected",reason:xe},ur())}finally{Q.p=M,H!==null&&Z.types!==null&&(H.types=Z.types),V.T=H}}function XE(){}function Ih(s,i,d,g){if(s.tag!==5)throw Error(r(476));var E=t0(s).queue;e0(s,E,i,X,d===null?XE:function(){return n0(s),d(g)})}function t0(s){var i=s.memoizedState;if(i!==null)return i;i={memoizedState:X,baseState:X,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xs,lastRenderedState:X},next:null};var d={};return i.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xs,lastRenderedState:d},next:null},s.memoizedState=i,s=s.alternate,s!==null&&(s.memoizedState=i),i}function n0(s){var i=t0(s);i.next===null&&(i=s.alternate.memoizedState),xl(s,i.next.queue,{},ur())}function Ph(){return En(zl)}function r0(){return nn().memoizedState}function s0(){return nn().memoizedState}function QE(s){for(var i=s.return;i!==null;){switch(i.tag){case 24:case 3:var d=ur();s=Js(d);var g=ei(i,s,d);g!==null&&(er(g,i,d),gl(g,i,d)),i={cache:fh()},s.payload=i;return}i=i.return}}function ZE(s,i,d){var g=ur();d={lane:g,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},wu(s)?o0(i,d):(d=th(s,i,d,g),d!==null&&(er(d,s,g),a0(d,i,g)))}function i0(s,i,d){var g=ur();xl(s,i,d,g)}function xl(s,i,d,g){var E={lane:g,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null};if(wu(s))o0(i,E);else{var M=s.alternate;if(s.lanes===0&&(M===null||M.lanes===0)&&(M=i.lastRenderedReducer,M!==null))try{var H=i.lastRenderedState,Z=M(H,d);if(E.hasEagerState=!0,E.eagerState=Z,sr(Z,H))return ru(s,i,E,0),Ot===null&&nu(),!1}catch{}finally{}if(d=th(s,i,E,g),d!==null)return er(d,s,g),a0(d,i,g),!0}return!1}function zh(s,i,d,g){if(g={lane:2,revertLane:gp(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},wu(s)){if(i)throw Error(r(479))}else i=th(s,d,g,2),i!==null&&er(i,s,2)}function wu(s){var i=s.alternate;return s===it||i!==null&&i===it}function o0(s,i){Qo=gu=!0;var d=s.pending;d===null?i.next=i:(i.next=d.next,d.next=i),s.pending=i}function a0(s,i,d){if((d&4194048)!==0){var g=i.lanes;g&=s.pendingLanes,d|=g,i.lanes=d,Wn(s,d)}}var Sl={readContext:En,use:yu,useCallback:Yt,useContext:Yt,useEffect:Yt,useImperativeHandle:Yt,useLayoutEffect:Yt,useInsertionEffect:Yt,useMemo:Yt,useReducer:Yt,useRef:Yt,useState:Yt,useDebugValue:Yt,useDeferredValue:Yt,useTransition:Yt,useSyncExternalStore:Yt,useId:Yt,useHostTransitionStatus:Yt,useFormState:Yt,useActionState:Yt,useOptimistic:Yt,useMemoCache:Yt,useCacheRefresh:Yt};Sl.useEffectEvent=Yt;var l0={readContext:En,use:yu,useCallback:function(s,i){return Un().memoizedState=[s,i===void 0?null:i],s},useContext:En,useEffect:V1,useImperativeHandle:function(s,i,d){d=d!=null?d.concat([s]):null,xu(4194308,4,Y1.bind(null,i,s),d)},useLayoutEffect:function(s,i){return xu(4194308,4,s,i)},useInsertionEffect:function(s,i){xu(4,2,s,i)},useMemo:function(s,i){var d=Un();i=i===void 0?null:i;var g=s();if(no){Ke(!0);try{s()}finally{Ke(!1)}}return d.memoizedState=[g,i],g},useReducer:function(s,i,d){var g=Un();if(d!==void 0){var E=d(i);if(no){Ke(!0);try{d(i)}finally{Ke(!1)}}}else E=i;return g.memoizedState=g.baseState=E,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:E},g.queue=s,s=s.dispatch=ZE.bind(null,it,s),[g.memoizedState,s]},useRef:function(s){var i=Un();return s={current:s},i.memoizedState=s},useState:function(s){s=Mh(s);var i=s.queue,d=i0.bind(null,it,i);return i.dispatch=d,[s.memoizedState,d]},useDebugValue:Oh,useDeferredValue:function(s,i){var d=Un();return Lh(d,s,i)},useTransition:function(){var s=Mh(!1);return s=e0.bind(null,it,s.queue,!0,!1),Un().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,i,d){var g=it,E=Un();if(mt){if(d===void 0)throw Error(r(407));d=d()}else{if(d=i(),Ot===null)throw Error(r(349));(ht&127)!==0||T1(g,i,d)}E.memoizedState=d;var M={value:d,getSnapshot:i};return E.queue=M,V1(M1.bind(null,g,M,s),[s]),g.flags|=2048,Jo(9,{destroy:void 0},N1.bind(null,g,M,d,i),null),d},useId:function(){var s=Un(),i=Ot.identifierPrefix;if(mt){var d=ts,g=es;d=(g&~(1<<32-we(g)-1)).toString(32)+d,i="_"+i+"R_"+d,d=vu++,0<d&&(i+="H"+d.toString(32)),i+="_"}else d=VE++,i="_"+i+"r_"+d.toString(32)+"_";return s.memoizedState=i},useHostTransitionStatus:Ph,useFormState:F1,useActionState:F1,useOptimistic:function(s){var i=Un();i.memoizedState=i.baseState=s;var d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=d,i=zh.bind(null,it,!0,d),d.dispatch=i,[s,i]},useMemoCache:Rh,useCacheRefresh:function(){return Un().memoizedState=QE.bind(null,it)},useEffectEvent:function(s){var i=Un(),d={impl:s};return i.memoizedState=d,function(){if((kt&2)!==0)throw Error(r(440));return d.impl.apply(void 0,arguments)}}},Bh={readContext:En,use:yu,useCallback:Q1,useContext:En,useEffect:jh,useImperativeHandle:X1,useInsertionEffect:G1,useLayoutEffect:K1,useMemo:Z1,useReducer:bu,useRef:q1,useState:function(){return bu(xs)},useDebugValue:Oh,useDeferredValue:function(s,i){var d=nn();return J1(d,Nt.memoizedState,s,i)},useTransition:function(){var s=bu(xs)[0],i=nn().memoizedState;return[typeof s=="boolean"?s:bl(s),i]},useSyncExternalStore:R1,useId:r0,useHostTransitionStatus:Ph,useFormState:H1,useActionState:H1,useOptimistic:function(s,i){var d=nn();return O1(d,Nt,s,i)},useMemoCache:Rh,useCacheRefresh:s0};Bh.useEffectEvent=W1;var c0={readContext:En,use:yu,useCallback:Q1,useContext:En,useEffect:jh,useImperativeHandle:X1,useInsertionEffect:G1,useLayoutEffect:K1,useMemo:Z1,useReducer:Nh,useRef:q1,useState:function(){return Nh(xs)},useDebugValue:Oh,useDeferredValue:function(s,i){var d=nn();return Nt===null?Lh(d,s,i):J1(d,Nt.memoizedState,s,i)},useTransition:function(){var s=Nh(xs)[0],i=nn().memoizedState;return[typeof s=="boolean"?s:bl(s),i]},useSyncExternalStore:R1,useId:r0,useHostTransitionStatus:Ph,useFormState:$1,useActionState:$1,useOptimistic:function(s,i){var d=nn();return Nt!==null?O1(d,Nt,s,i):(d.baseState=s,[s,d.queue.dispatch])},useMemoCache:Rh,useCacheRefresh:s0};c0.useEffectEvent=W1;function Fh(s,i,d,g){i=s.memoizedState,d=d(g,i),d=d==null?i:h({},i,d),s.memoizedState=d,s.lanes===0&&(s.updateQueue.baseState=d)}var Hh={enqueueSetState:function(s,i,d){s=s._reactInternals;var g=ur(),E=Js(g);E.payload=i,d!=null&&(E.callback=d),i=ei(s,E,g),i!==null&&(er(i,s,g),gl(i,s,g))},enqueueReplaceState:function(s,i,d){s=s._reactInternals;var g=ur(),E=Js(g);E.tag=1,E.payload=i,d!=null&&(E.callback=d),i=ei(s,E,g),i!==null&&(er(i,s,g),gl(i,s,g))},enqueueForceUpdate:function(s,i){s=s._reactInternals;var d=ur(),g=Js(d);g.tag=2,i!=null&&(g.callback=i),i=ei(s,g,d),i!==null&&(er(i,s,d),gl(i,s,d))}};function u0(s,i,d,g,E,M,H){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(g,M,H):i.prototype&&i.prototype.isPureReactComponent?!ll(d,g)||!ll(E,M):!0}function d0(s,i,d,g){s=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(d,g),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(d,g),i.state!==s&&Hh.enqueueReplaceState(i,i.state,null)}function ro(s,i){var d=i;if("ref"in i){d={};for(var g in i)g!=="ref"&&(d[g]=i[g])}if(s=s.defaultProps){d===i&&(d=h({},d));for(var E in s)d[E]===void 0&&(d[E]=s[E])}return d}function f0(s){tu(s)}function h0(s){console.error(s)}function p0(s){tu(s)}function Cu(s,i){try{var d=s.onUncaughtError;d(i.value,{componentStack:i.stack})}catch(g){setTimeout(function(){throw g})}}function m0(s,i,d){try{var g=s.onCaughtError;g(d.value,{componentStack:d.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(E){setTimeout(function(){throw E})}}function Uh(s,i,d){return d=Js(d),d.tag=3,d.payload={element:null},d.callback=function(){Cu(s,i)},d}function g0(s){return s=Js(s),s.tag=3,s}function v0(s,i,d,g){var E=d.type.getDerivedStateFromError;if(typeof E=="function"){var M=g.value;s.payload=function(){return E(M)},s.callback=function(){m0(i,d,g)}}var H=d.stateNode;H!==null&&typeof H.componentDidCatch=="function"&&(s.callback=function(){m0(i,d,g),typeof E!="function"&&(oi===null?oi=new Set([this]):oi.add(this));var Z=g.stack;this.componentDidCatch(g.value,{componentStack:Z!==null?Z:""})})}function JE(s,i,d,g,E){if(d.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(i=d.alternate,i!==null&&Vo(i,d,E,!0),d=or.current,d!==null){switch(d.tag){case 31:case 13:return Er===null?Iu():d.alternate===null&&Xt===0&&(Xt=3),d.flags&=-257,d.flags|=65536,d.lanes=E,g===du?d.flags|=16384:(i=d.updateQueue,i===null?d.updateQueue=new Set([g]):i.add(g),hp(s,g,E)),!1;case 22:return d.flags|=65536,g===du?d.flags|=16384:(i=d.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([g])},d.updateQueue=i):(d=i.retryQueue,d===null?i.retryQueue=new Set([g]):d.add(g)),hp(s,g,E)),!1}throw Error(r(435,d.tag))}return hp(s,g,E),Iu(),!1}if(mt)return i=or.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=E,g!==ah&&(s=Error(r(422),{cause:g}),dl(Sr(s,d)))):(g!==ah&&(i=Error(r(423),{cause:g}),dl(Sr(i,d))),s=s.current.alternate,s.flags|=65536,E&=-E,s.lanes|=E,g=Sr(g,d),E=Uh(s.stateNode,g,E),_h(s,E),Xt!==4&&(Xt=2)),!1;var M=Error(r(520),{cause:g});if(M=Sr(M,d),Nl===null?Nl=[M]:Nl.push(M),Xt!==4&&(Xt=2),i===null)return!0;g=Sr(g,d),d=i;do{switch(d.tag){case 3:return d.flags|=65536,s=E&-E,d.lanes|=s,s=Uh(d.stateNode,g,s),_h(d,s),!1;case 1:if(i=d.type,M=d.stateNode,(d.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||M!==null&&typeof M.componentDidCatch=="function"&&(oi===null||!oi.has(M))))return d.flags|=65536,E&=-E,d.lanes|=E,E=g0(E),v0(E,s,d,g),_h(d,E),!1}d=d.return}while(d!==null);return!1}var $h=Error(r(461)),ln=!1;function An(s,i,d,g){i.child=s===null?x1(i,null,d,g):to(i,s.child,d,g)}function _0(s,i,d,g,E){d=d.render;var M=i.ref;if("ref"in g){var H={};for(var Z in g)Z!=="ref"&&(H[Z]=g[Z])}else H=g;return Qi(i),g=Ch(s,i,d,H,M,E),Z=kh(),s!==null&&!ln?(Eh(s,i,E),Ss(s,i,E)):(mt&&Z&&ih(i),i.flags|=1,An(s,i,g,E),i.child)}function y0(s,i,d,g,E){if(s===null){var M=d.type;return typeof M=="function"&&!nh(M)&&M.defaultProps===void 0&&d.compare===null?(i.tag=15,i.type=M,b0(s,i,M,g,E)):(s=iu(d.type,null,g,i,i.mode,E),s.ref=i.ref,s.return=i,i.child=s)}if(M=s.child,!Qh(s,E)){var H=M.memoizedProps;if(d=d.compare,d=d!==null?d:ll,d(H,g)&&s.ref===i.ref)return Ss(s,i,E)}return i.flags|=1,s=gs(M,g),s.ref=i.ref,s.return=i,i.child=s}function b0(s,i,d,g,E){if(s!==null){var M=s.memoizedProps;if(ll(M,g)&&s.ref===i.ref)if(ln=!1,i.pendingProps=g=M,Qh(s,E))(s.flags&131072)!==0&&(ln=!0);else return i.lanes=s.lanes,Ss(s,i,E)}return qh(s,i,d,g,E)}function x0(s,i,d,g){var E=g.children,M=s!==null?s.memoizedState:null;if(s===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((i.flags&128)!==0){if(M=M!==null?M.baseLanes|d:d,s!==null){for(g=i.child=s.child,E=0;g!==null;)E=E|g.lanes|g.childLanes,g=g.sibling;g=E&~M}else g=0,i.child=null;return S0(s,i,M,d,g)}if((d&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},s!==null&&cu(i,M!==null?M.cachePool:null),M!==null?C1(i,M):bh(),k1(i);else return g=i.lanes=536870912,S0(s,i,M!==null?M.baseLanes|d:d,d,g)}else M!==null?(cu(i,M.cachePool),C1(i,M),ni(),i.memoizedState=null):(s!==null&&cu(i,null),bh(),ni());return An(s,i,E,d),i.child}function wl(s,i){return s!==null&&s.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function S0(s,i,d,g,E){var M=ph();return M=M===null?null:{parent:on._currentValue,pool:M},i.memoizedState={baseLanes:d,cachePool:M},s!==null&&cu(i,null),bh(),k1(i),s!==null&&Vo(s,i,g,!0),i.childLanes=E,null}function ku(s,i){return i=Au({mode:i.mode,children:i.children},s.mode),i.ref=s.ref,s.child=i,i.return=s,i}function w0(s,i,d){return to(i,s.child,null,d),s=ku(i,i.pendingProps),s.flags|=2,ar(i),i.memoizedState=null,s}function e3(s,i,d){var g=i.pendingProps,E=(i.flags&128)!==0;if(i.flags&=-129,s===null){if(mt){if(g.mode==="hidden")return s=ku(i,g),i.lanes=536870912,wl(null,s);if(Sh(i),(s=Bt)?(s=L_(s,kr),s=s!==null&&s.data==="&"?s:null,s!==null&&(i.memoizedState={dehydrated:s,treeContext:Ks!==null?{id:es,overflow:ts}:null,retryLane:536870912,hydrationErrors:null},d=o1(s),d.return=i,i.child=d,kn=i,Bt=null)):s=null,s===null)throw Xs(i);return i.lanes=536870912,null}return ku(i,g)}var M=s.memoizedState;if(M!==null){var H=M.dehydrated;if(Sh(i),E)if(i.flags&256)i.flags&=-257,i=w0(s,i,d);else if(i.memoizedState!==null)i.child=s.child,i.flags|=128,i=null;else throw Error(r(558));else if(ln||Vo(s,i,d,!1),E=(d&s.childLanes)!==0,ln||E){if(g=Ot,g!==null&&(H=Gn(g,d),H!==0&&H!==M.retryLane))throw M.retryLane=H,Gi(s,H),er(g,s,H),$h;Iu(),i=w0(s,i,d)}else s=M.treeContext,Bt=Ar(H.nextSibling),kn=i,mt=!0,Ys=null,kr=!1,s!==null&&c1(i,s),i=ku(i,g),i.flags|=4096;return i}return s=gs(s.child,{mode:g.mode,children:g.children}),s.ref=i.ref,i.child=s,s.return=i,s}function Eu(s,i){var d=i.ref;if(d===null)s!==null&&s.ref!==null&&(i.flags|=4194816);else{if(typeof d!="function"&&typeof d!="object")throw Error(r(284));(s===null||s.ref!==d)&&(i.flags|=4194816)}}function qh(s,i,d,g,E){return Qi(i),d=Ch(s,i,d,g,void 0,E),g=kh(),s!==null&&!ln?(Eh(s,i,E),Ss(s,i,E)):(mt&&g&&ih(i),i.flags|=1,An(s,i,d,E),i.child)}function C0(s,i,d,g,E,M){return Qi(i),i.updateQueue=null,d=A1(i,g,d,E),E1(s),g=kh(),s!==null&&!ln?(Eh(s,i,M),Ss(s,i,M)):(mt&&g&&ih(i),i.flags|=1,An(s,i,d,M),i.child)}function k0(s,i,d,g,E){if(Qi(i),i.stateNode===null){var M=Ho,H=d.contextType;typeof H=="object"&&H!==null&&(M=En(H)),M=new d(g,M),i.memoizedState=M.state!==null&&M.state!==void 0?M.state:null,M.updater=Hh,i.stateNode=M,M._reactInternals=i,M=i.stateNode,M.props=g,M.state=i.memoizedState,M.refs={},gh(i),H=d.contextType,M.context=typeof H=="object"&&H!==null?En(H):Ho,M.state=i.memoizedState,H=d.getDerivedStateFromProps,typeof H=="function"&&(Fh(i,d,H,g),M.state=i.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof M.getSnapshotBeforeUpdate=="function"||typeof M.UNSAFE_componentWillMount!="function"&&typeof M.componentWillMount!="function"||(H=M.state,typeof M.componentWillMount=="function"&&M.componentWillMount(),typeof M.UNSAFE_componentWillMount=="function"&&M.UNSAFE_componentWillMount(),H!==M.state&&Hh.enqueueReplaceState(M,M.state,null),_l(i,g,M,E),vl(),M.state=i.memoizedState),typeof M.componentDidMount=="function"&&(i.flags|=4194308),g=!0}else if(s===null){M=i.stateNode;var Z=i.memoizedProps,ne=ro(d,Z);M.props=ne;var de=M.context,_e=d.contextType;H=Ho,typeof _e=="object"&&_e!==null&&(H=En(_e));var xe=d.getDerivedStateFromProps;_e=typeof xe=="function"||typeof M.getSnapshotBeforeUpdate=="function",Z=i.pendingProps!==Z,_e||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(Z||de!==H)&&d0(i,M,g,H),Zs=!1;var fe=i.memoizedState;M.state=fe,_l(i,g,M,E),vl(),de=i.memoizedState,Z||fe!==de||Zs?(typeof xe=="function"&&(Fh(i,d,xe,g),de=i.memoizedState),(ne=Zs||u0(i,d,ne,g,fe,de,H))?(_e||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"&&(i.flags|=4194308)):(typeof M.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=g,i.memoizedState=de),M.props=g,M.state=de,M.context=H,g=ne):(typeof M.componentDidMount=="function"&&(i.flags|=4194308),g=!1)}else{M=i.stateNode,vh(s,i),H=i.memoizedProps,_e=ro(d,H),M.props=_e,xe=i.pendingProps,fe=M.context,de=d.contextType,ne=Ho,typeof de=="object"&&de!==null&&(ne=En(de)),Z=d.getDerivedStateFromProps,(de=typeof Z=="function"||typeof M.getSnapshotBeforeUpdate=="function")||typeof M.UNSAFE_componentWillReceiveProps!="function"&&typeof M.componentWillReceiveProps!="function"||(H!==xe||fe!==ne)&&d0(i,M,g,ne),Zs=!1,fe=i.memoizedState,M.state=fe,_l(i,g,M,E),vl();var me=i.memoizedState;H!==xe||fe!==me||Zs||s!==null&&s.dependencies!==null&&au(s.dependencies)?(typeof Z=="function"&&(Fh(i,d,Z,g),me=i.memoizedState),(_e=Zs||u0(i,d,_e,g,fe,me,ne)||s!==null&&s.dependencies!==null&&au(s.dependencies))?(de||typeof M.UNSAFE_componentWillUpdate!="function"&&typeof M.componentWillUpdate!="function"||(typeof M.componentWillUpdate=="function"&&M.componentWillUpdate(g,me,ne),typeof M.UNSAFE_componentWillUpdate=="function"&&M.UNSAFE_componentWillUpdate(g,me,ne)),typeof M.componentDidUpdate=="function"&&(i.flags|=4),typeof M.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof M.componentDidUpdate!="function"||H===s.memoizedProps&&fe===s.memoizedState||(i.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||H===s.memoizedProps&&fe===s.memoizedState||(i.flags|=1024),i.memoizedProps=g,i.memoizedState=me),M.props=g,M.state=me,M.context=ne,g=_e):(typeof M.componentDidUpdate!="function"||H===s.memoizedProps&&fe===s.memoizedState||(i.flags|=4),typeof M.getSnapshotBeforeUpdate!="function"||H===s.memoizedProps&&fe===s.memoizedState||(i.flags|=1024),g=!1)}return M=g,Eu(s,i),g=(i.flags&128)!==0,M||g?(M=i.stateNode,d=g&&typeof d.getDerivedStateFromError!="function"?null:M.render(),i.flags|=1,s!==null&&g?(i.child=to(i,s.child,null,E),i.child=to(i,null,d,E)):An(s,i,d,E),i.memoizedState=M.state,s=i.child):s=Ss(s,i,E),s}function E0(s,i,d,g){return Yi(),i.flags|=256,An(s,i,d,g),i.child}var Vh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Wh(s){return{baseLanes:s,cachePool:m1()}}function Gh(s,i,d){return s=s!==null?s.childLanes&~d:0,i&&(s|=cr),s}function A0(s,i,d){var g=i.pendingProps,E=!1,M=(i.flags&128)!==0,H;if((H=M)||(H=s!==null&&s.memoizedState===null?!1:(tn.current&2)!==0),H&&(E=!0,i.flags&=-129),H=(i.flags&32)!==0,i.flags&=-33,s===null){if(mt){if(E?ti(i):ni(),(s=Bt)?(s=L_(s,kr),s=s!==null&&s.data!=="&"?s:null,s!==null&&(i.memoizedState={dehydrated:s,treeContext:Ks!==null?{id:es,overflow:ts}:null,retryLane:536870912,hydrationErrors:null},d=o1(s),d.return=i,i.child=d,kn=i,Bt=null)):s=null,s===null)throw Xs(i);return Tp(s)?i.lanes=32:i.lanes=536870912,null}var Z=g.children;return g=g.fallback,E?(ni(),E=i.mode,Z=Au({mode:"hidden",children:Z},E),g=Ki(g,E,d,null),Z.return=i,g.return=i,Z.sibling=g,i.child=Z,g=i.child,g.memoizedState=Wh(d),g.childLanes=Gh(s,H,d),i.memoizedState=Vh,wl(null,g)):(ti(i),Kh(i,Z))}var ne=s.memoizedState;if(ne!==null&&(Z=ne.dehydrated,Z!==null)){if(M)i.flags&256?(ti(i),i.flags&=-257,i=Yh(s,i,d)):i.memoizedState!==null?(ni(),i.child=s.child,i.flags|=128,i=null):(ni(),Z=g.fallback,E=i.mode,g=Au({mode:"visible",children:g.children},E),Z=Ki(Z,E,d,null),Z.flags|=2,g.return=i,Z.return=i,g.sibling=Z,i.child=g,to(i,s.child,null,d),g=i.child,g.memoizedState=Wh(d),g.childLanes=Gh(s,H,d),i.memoizedState=Vh,i=wl(null,g));else if(ti(i),Tp(Z)){if(H=Z.nextSibling&&Z.nextSibling.dataset,H)var de=H.dgst;H=de,g=Error(r(419)),g.stack="",g.digest=H,dl({value:g,source:null,stack:null}),i=Yh(s,i,d)}else if(ln||Vo(s,i,d,!1),H=(d&s.childLanes)!==0,ln||H){if(H=Ot,H!==null&&(g=Gn(H,d),g!==0&&g!==ne.retryLane))throw ne.retryLane=g,Gi(s,g),er(H,s,g),$h;Rp(Z)||Iu(),i=Yh(s,i,d)}else Rp(Z)?(i.flags|=192,i.child=s.child,i=null):(s=ne.treeContext,Bt=Ar(Z.nextSibling),kn=i,mt=!0,Ys=null,kr=!1,s!==null&&c1(i,s),i=Kh(i,g.children),i.flags|=4096);return i}return E?(ni(),Z=g.fallback,E=i.mode,ne=s.child,de=ne.sibling,g=gs(ne,{mode:"hidden",children:g.children}),g.subtreeFlags=ne.subtreeFlags&65011712,de!==null?Z=gs(de,Z):(Z=Ki(Z,E,d,null),Z.flags|=2),Z.return=i,g.return=i,g.sibling=Z,i.child=g,wl(null,g),g=i.child,Z=s.child.memoizedState,Z===null?Z=Wh(d):(E=Z.cachePool,E!==null?(ne=on._currentValue,E=E.parent!==ne?{parent:ne,pool:ne}:E):E=m1(),Z={baseLanes:Z.baseLanes|d,cachePool:E}),g.memoizedState=Z,g.childLanes=Gh(s,H,d),i.memoizedState=Vh,wl(s.child,g)):(ti(i),d=s.child,s=d.sibling,d=gs(d,{mode:"visible",children:g.children}),d.return=i,d.sibling=null,s!==null&&(H=i.deletions,H===null?(i.deletions=[s],i.flags|=16):H.push(s)),i.child=d,i.memoizedState=null,d)}function Kh(s,i){return i=Au({mode:"visible",children:i},s.mode),i.return=s,s.child=i}function Au(s,i){return s=ir(22,s,null,i),s.lanes=0,s}function Yh(s,i,d){return to(i,s.child,null,d),s=Kh(i,i.pendingProps.children),s.flags|=2,i.memoizedState=null,s}function R0(s,i,d){s.lanes|=i;var g=s.alternate;g!==null&&(g.lanes|=i),uh(s.return,i,d)}function Xh(s,i,d,g,E,M){var H=s.memoizedState;H===null?s.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:g,tail:d,tailMode:E,treeForkCount:M}:(H.isBackwards=i,H.rendering=null,H.renderingStartTime=0,H.last=g,H.tail=d,H.tailMode=E,H.treeForkCount=M)}function T0(s,i,d){var g=i.pendingProps,E=g.revealOrder,M=g.tail;g=g.children;var H=tn.current,Z=(H&2)!==0;if(Z?(H=H&1|2,i.flags|=128):H&=1,B(tn,H),An(s,i,g,d),g=mt?ul:0,!Z&&s!==null&&(s.flags&128)!==0)e:for(s=i.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&R0(s,d,i);else if(s.tag===19)R0(s,d,i);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break e;for(;s.sibling===null;){if(s.return===null||s.return===i)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(E){case"forwards":for(d=i.child,E=null;d!==null;)s=d.alternate,s!==null&&mu(s)===null&&(E=d),d=d.sibling;d=E,d===null?(E=i.child,i.child=null):(E=d.sibling,d.sibling=null),Xh(i,!1,E,d,M,g);break;case"backwards":case"unstable_legacy-backwards":for(d=null,E=i.child,i.child=null;E!==null;){if(s=E.alternate,s!==null&&mu(s)===null){i.child=E;break}s=E.sibling,E.sibling=d,d=E,E=s}Xh(i,!0,d,null,M,g);break;case"together":Xh(i,!1,null,null,void 0,g);break;default:i.memoizedState=null}return i.child}function Ss(s,i,d){if(s!==null&&(i.dependencies=s.dependencies),ii|=i.lanes,(d&i.childLanes)===0)if(s!==null){if(Vo(s,i,d,!1),(d&i.childLanes)===0)return null}else return null;if(s!==null&&i.child!==s.child)throw Error(r(153));if(i.child!==null){for(s=i.child,d=gs(s,s.pendingProps),i.child=d,d.return=i;s.sibling!==null;)s=s.sibling,d=d.sibling=gs(s,s.pendingProps),d.return=i;d.sibling=null}return i.child}function Qh(s,i){return(s.lanes&i)!==0?!0:(s=s.dependencies,!!(s!==null&&au(s)))}function t3(s,i,d){switch(i.tag){case 3:q(i,i.stateNode.containerInfo),Qs(i,on,s.memoizedState.cache),Yi();break;case 27:case 5:re(i);break;case 4:q(i,i.stateNode.containerInfo);break;case 10:Qs(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Sh(i),null;break;case 13:var g=i.memoizedState;if(g!==null)return g.dehydrated!==null?(ti(i),i.flags|=128,null):(d&i.child.childLanes)!==0?A0(s,i,d):(ti(i),s=Ss(s,i,d),s!==null?s.sibling:null);ti(i);break;case 19:var E=(s.flags&128)!==0;if(g=(d&i.childLanes)!==0,g||(Vo(s,i,d,!1),g=(d&i.childLanes)!==0),E){if(g)return T0(s,i,d);i.flags|=128}if(E=i.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),B(tn,tn.current),g)break;return null;case 22:return i.lanes=0,x0(s,i,d,i.pendingProps);case 24:Qs(i,on,s.memoizedState.cache)}return Ss(s,i,d)}function N0(s,i,d){if(s!==null)if(s.memoizedProps!==i.pendingProps)ln=!0;else{if(!Qh(s,d)&&(i.flags&128)===0)return ln=!1,t3(s,i,d);ln=(s.flags&131072)!==0}else ln=!1,mt&&(i.flags&1048576)!==0&&l1(i,ul,i.index);switch(i.lanes=0,i.tag){case 16:e:{var g=i.pendingProps;if(s=Ji(i.elementType),i.type=s,typeof s=="function")nh(s)?(g=ro(s,g),i.tag=1,i=k0(null,i,s,g,d)):(i.tag=0,i=qh(null,i,s,g,d));else{if(s!=null){var E=s.$$typeof;if(E===k){i.tag=11,i=_0(null,i,s,g,d);break e}else if(E===D){i.tag=14,i=y0(null,i,s,g,d);break e}}throw i=W(s)||s,Error(r(306,i,""))}}return i;case 0:return qh(s,i,i.type,i.pendingProps,d);case 1:return g=i.type,E=ro(g,i.pendingProps),k0(s,i,g,E,d);case 3:e:{if(q(i,i.stateNode.containerInfo),s===null)throw Error(r(387));g=i.pendingProps;var M=i.memoizedState;E=M.element,vh(s,i),_l(i,g,null,d);var H=i.memoizedState;if(g=H.cache,Qs(i,on,g),g!==M.cache&&dh(i,[on],d,!0),vl(),g=H.element,M.isDehydrated)if(M={element:g,isDehydrated:!1,cache:H.cache},i.updateQueue.baseState=M,i.memoizedState=M,i.flags&256){i=E0(s,i,g,d);break e}else if(g!==E){E=Sr(Error(r(424)),i),dl(E),i=E0(s,i,g,d);break e}else{switch(s=i.stateNode.containerInfo,s.nodeType){case 9:s=s.body;break;default:s=s.nodeName==="HTML"?s.ownerDocument.body:s}for(Bt=Ar(s.firstChild),kn=i,mt=!0,Ys=null,kr=!0,d=x1(i,null,g,d),i.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling}else{if(Yi(),g===E){i=Ss(s,i,d);break e}An(s,i,g,d)}i=i.child}return i;case 26:return Eu(s,i),s===null?(d=H_(i.type,null,i.pendingProps,null))?i.memoizedState=d:mt||(d=i.type,s=i.pendingProps,g=$u(J.current).createElement(d),g[jt]=i,g[Ut]=s,Rn(g,d,s),_t(g),i.stateNode=g):i.memoizedState=H_(i.type,s.memoizedProps,i.pendingProps,s.memoizedState),null;case 27:return re(i),s===null&&mt&&(g=i.stateNode=z_(i.type,i.pendingProps,J.current),kn=i,kr=!0,E=Bt,ui(i.type)?(Np=E,Bt=Ar(g.firstChild)):Bt=E),An(s,i,i.pendingProps.children,d),Eu(s,i),s===null&&(i.flags|=4194304),i.child;case 5:return s===null&&mt&&((E=g=Bt)&&(g=M3(g,i.type,i.pendingProps,kr),g!==null?(i.stateNode=g,kn=i,Bt=Ar(g.firstChild),kr=!1,E=!0):E=!1),E||Xs(i)),re(i),E=i.type,M=i.pendingProps,H=s!==null?s.memoizedProps:null,g=M.children,kp(E,M)?g=null:H!==null&&kp(E,H)&&(i.flags|=32),i.memoizedState!==null&&(E=Ch(s,i,WE,null,null,d),zl._currentValue=E),Eu(s,i),An(s,i,g,d),i.child;case 6:return s===null&&mt&&((s=d=Bt)&&(d=D3(d,i.pendingProps,kr),d!==null?(i.stateNode=d,kn=i,Bt=null,s=!0):s=!1),s||Xs(i)),null;case 13:return A0(s,i,d);case 4:return q(i,i.stateNode.containerInfo),g=i.pendingProps,s===null?i.child=to(i,null,g,d):An(s,i,g,d),i.child;case 11:return _0(s,i,i.type,i.pendingProps,d);case 7:return An(s,i,i.pendingProps,d),i.child;case 8:return An(s,i,i.pendingProps.children,d),i.child;case 12:return An(s,i,i.pendingProps.children,d),i.child;case 10:return g=i.pendingProps,Qs(i,i.type,g.value),An(s,i,g.children,d),i.child;case 9:return E=i.type._context,g=i.pendingProps.children,Qi(i),E=En(E),g=g(E),i.flags|=1,An(s,i,g,d),i.child;case 14:return y0(s,i,i.type,i.pendingProps,d);case 15:return b0(s,i,i.type,i.pendingProps,d);case 19:return T0(s,i,d);case 31:return e3(s,i,d);case 22:return x0(s,i,d,i.pendingProps);case 24:return Qi(i),g=En(on),s===null?(E=ph(),E===null&&(E=Ot,M=fh(),E.pooledCache=M,M.refCount++,M!==null&&(E.pooledCacheLanes|=d),E=M),i.memoizedState={parent:g,cache:E},gh(i),Qs(i,on,E)):((s.lanes&d)!==0&&(vh(s,i),_l(i,null,null,d),vl()),E=s.memoizedState,M=i.memoizedState,E.parent!==g?(E={parent:g,cache:g},i.memoizedState=E,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=E),Qs(i,on,g)):(g=M.cache,Qs(i,on,g),g!==E.cache&&dh(i,[on],d,!0))),An(s,i,i.pendingProps.children,d),i.child;case 29:throw i.pendingProps}throw Error(r(156,i.tag))}function ws(s){s.flags|=4}function Zh(s,i,d,g,E){if((i=(s.mode&32)!==0)&&(i=!1),i){if(s.flags|=16777216,(E&335544128)===E)if(s.stateNode.complete)s.flags|=8192;else if(r_())s.flags|=8192;else throw eo=du,mh}else s.flags&=-16777217}function M0(s,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!W_(i))if(r_())s.flags|=8192;else throw eo=du,mh}function Ru(s,i){i!==null&&(s.flags|=4),s.flags&16384&&(i=s.tag!==22?Ht():536870912,s.lanes|=i,ra|=i)}function Cl(s,i){if(!mt)switch(s.tailMode){case"hidden":i=s.tail;for(var d=null;i!==null;)i.alternate!==null&&(d=i),i=i.sibling;d===null?s.tail=null:d.sibling=null;break;case"collapsed":d=s.tail;for(var g=null;d!==null;)d.alternate!==null&&(g=d),d=d.sibling;g===null?i||s.tail===null?s.tail=null:s.tail.sibling=null:g.sibling=null}}function Ft(s){var i=s.alternate!==null&&s.alternate.child===s.child,d=0,g=0;if(i)for(var E=s.child;E!==null;)d|=E.lanes|E.childLanes,g|=E.subtreeFlags&65011712,g|=E.flags&65011712,E.return=s,E=E.sibling;else for(E=s.child;E!==null;)d|=E.lanes|E.childLanes,g|=E.subtreeFlags,g|=E.flags,E.return=s,E=E.sibling;return s.subtreeFlags|=g,s.childLanes=d,i}function n3(s,i,d){var g=i.pendingProps;switch(oh(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ft(i),null;case 1:return Ft(i),null;case 3:return d=i.stateNode,g=null,s!==null&&(g=s.memoizedState.cache),i.memoizedState.cache!==g&&(i.flags|=2048),ys(on),te(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(s===null||s.child===null)&&(qo(i)?ws(i):s===null||s.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,lh())),Ft(i),null;case 26:var E=i.type,M=i.memoizedState;return s===null?(ws(i),M!==null?(Ft(i),M0(i,M)):(Ft(i),Zh(i,E,null,g,d))):M?M!==s.memoizedState?(ws(i),Ft(i),M0(i,M)):(Ft(i),i.flags&=-16777217):(s=s.memoizedProps,s!==g&&ws(i),Ft(i),Zh(i,E,s,g,d)),null;case 27:if(oe(i),d=J.current,E=i.type,s!==null&&i.stateNode!=null)s.memoizedProps!==g&&ws(i);else{if(!g){if(i.stateNode===null)throw Error(r(166));return Ft(i),null}s=Y.current,qo(i)?u1(i):(s=z_(E,g,d),i.stateNode=s,ws(i))}return Ft(i),null;case 5:if(oe(i),E=i.type,s!==null&&i.stateNode!=null)s.memoizedProps!==g&&ws(i);else{if(!g){if(i.stateNode===null)throw Error(r(166));return Ft(i),null}if(M=Y.current,qo(i))u1(i);else{var H=$u(J.current);switch(M){case 1:M=H.createElementNS("http://www.w3.org/2000/svg",E);break;case 2:M=H.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;default:switch(E){case"svg":M=H.createElementNS("http://www.w3.org/2000/svg",E);break;case"math":M=H.createElementNS("http://www.w3.org/1998/Math/MathML",E);break;case"script":M=H.createElement("div"),M.innerHTML="<script><\/script>",M=M.removeChild(M.firstChild);break;case"select":M=typeof g.is=="string"?H.createElement("select",{is:g.is}):H.createElement("select"),g.multiple?M.multiple=!0:g.size&&(M.size=g.size);break;default:M=typeof g.is=="string"?H.createElement(E,{is:g.is}):H.createElement(E)}}M[jt]=i,M[Ut]=g;e:for(H=i.child;H!==null;){if(H.tag===5||H.tag===6)M.appendChild(H.stateNode);else if(H.tag!==4&&H.tag!==27&&H.child!==null){H.child.return=H,H=H.child;continue}if(H===i)break e;for(;H.sibling===null;){if(H.return===null||H.return===i)break e;H=H.return}H.sibling.return=H.return,H=H.sibling}i.stateNode=M;e:switch(Rn(M,E,g),E){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&ws(i)}}return Ft(i),Zh(i,i.type,s===null?null:s.memoizedProps,i.pendingProps,d),null;case 6:if(s&&i.stateNode!=null)s.memoizedProps!==g&&ws(i);else{if(typeof g!="string"&&i.stateNode===null)throw Error(r(166));if(s=J.current,qo(i)){if(s=i.stateNode,d=i.memoizedProps,g=null,E=kn,E!==null)switch(E.tag){case 27:case 5:g=E.memoizedProps}s[jt]=i,s=!!(s.nodeValue===d||g!==null&&g.suppressHydrationWarning===!0||A_(s.nodeValue,d)),s||Xs(i,!0)}else s=$u(s).createTextNode(g),s[jt]=i,i.stateNode=s}return Ft(i),null;case 31:if(d=i.memoizedState,s===null||s.memoizedState!==null){if(g=qo(i),d!==null){if(s===null){if(!g)throw Error(r(318));if(s=i.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[jt]=i}else Yi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Ft(i),s=!1}else d=lh(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=d),s=!0;if(!s)return i.flags&256?(ar(i),i):(ar(i),null);if((i.flags&128)!==0)throw Error(r(558))}return Ft(i),null;case 13:if(g=i.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(E=qo(i),g!==null&&g.dehydrated!==null){if(s===null){if(!E)throw Error(r(318));if(E=i.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(r(317));E[jt]=i}else Yi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Ft(i),E=!1}else E=lh(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=E),E=!0;if(!E)return i.flags&256?(ar(i),i):(ar(i),null)}return ar(i),(i.flags&128)!==0?(i.lanes=d,i):(d=g!==null,s=s!==null&&s.memoizedState!==null,d&&(g=i.child,E=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(E=g.alternate.memoizedState.cachePool.pool),M=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(M=g.memoizedState.cachePool.pool),M!==E&&(g.flags|=2048)),d!==s&&d&&(i.child.flags|=8192),Ru(i,i.updateQueue),Ft(i),null);case 4:return te(),s===null&&bp(i.stateNode.containerInfo),Ft(i),null;case 10:return ys(i.type),Ft(i),null;case 19:if(F(tn),g=i.memoizedState,g===null)return Ft(i),null;if(E=(i.flags&128)!==0,M=g.rendering,M===null)if(E)Cl(g,!1);else{if(Xt!==0||s!==null&&(s.flags&128)!==0)for(s=i.child;s!==null;){if(M=mu(s),M!==null){for(i.flags|=128,Cl(g,!1),s=M.updateQueue,i.updateQueue=s,Ru(i,s),i.subtreeFlags=0,s=d,d=i.child;d!==null;)i1(d,s),d=d.sibling;return B(tn,tn.current&1|2),mt&&vs(i,g.treeForkCount),i.child}s=s.sibling}g.tail!==null&&Ne()>ju&&(i.flags|=128,E=!0,Cl(g,!1),i.lanes=4194304)}else{if(!E)if(s=mu(M),s!==null){if(i.flags|=128,E=!0,s=s.updateQueue,i.updateQueue=s,Ru(i,s),Cl(g,!0),g.tail===null&&g.tailMode==="hidden"&&!M.alternate&&!mt)return Ft(i),null}else 2*Ne()-g.renderingStartTime>ju&&d!==536870912&&(i.flags|=128,E=!0,Cl(g,!1),i.lanes=4194304);g.isBackwards?(M.sibling=i.child,i.child=M):(s=g.last,s!==null?s.sibling=M:i.child=M,g.last=M)}return g.tail!==null?(s=g.tail,g.rendering=s,g.tail=s.sibling,g.renderingStartTime=Ne(),s.sibling=null,d=tn.current,B(tn,E?d&1|2:d&1),mt&&vs(i,g.treeForkCount),s):(Ft(i),null);case 22:case 23:return ar(i),xh(),g=i.memoizedState!==null,s!==null?s.memoizedState!==null!==g&&(i.flags|=8192):g&&(i.flags|=8192),g?(d&536870912)!==0&&(i.flags&128)===0&&(Ft(i),i.subtreeFlags&6&&(i.flags|=8192)):Ft(i),d=i.updateQueue,d!==null&&Ru(i,d.retryQueue),d=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(d=s.memoizedState.cachePool.pool),g=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(g=i.memoizedState.cachePool.pool),g!==d&&(i.flags|=2048),s!==null&&F(Zi),null;case 24:return d=null,s!==null&&(d=s.memoizedState.cache),i.memoizedState.cache!==d&&(i.flags|=2048),ys(on),Ft(i),null;case 25:return null;case 30:return null}throw Error(r(156,i.tag))}function r3(s,i){switch(oh(i),i.tag){case 1:return s=i.flags,s&65536?(i.flags=s&-65537|128,i):null;case 3:return ys(on),te(),s=i.flags,(s&65536)!==0&&(s&128)===0?(i.flags=s&-65537|128,i):null;case 26:case 27:case 5:return oe(i),null;case 31:if(i.memoizedState!==null){if(ar(i),i.alternate===null)throw Error(r(340));Yi()}return s=i.flags,s&65536?(i.flags=s&-65537|128,i):null;case 13:if(ar(i),s=i.memoizedState,s!==null&&s.dehydrated!==null){if(i.alternate===null)throw Error(r(340));Yi()}return s=i.flags,s&65536?(i.flags=s&-65537|128,i):null;case 19:return F(tn),null;case 4:return te(),null;case 10:return ys(i.type),null;case 22:case 23:return ar(i),xh(),s!==null&&F(Zi),s=i.flags,s&65536?(i.flags=s&-65537|128,i):null;case 24:return ys(on),null;case 25:return null;default:return null}}function D0(s,i){switch(oh(i),i.tag){case 3:ys(on),te();break;case 26:case 27:case 5:oe(i);break;case 4:te();break;case 31:i.memoizedState!==null&&ar(i);break;case 13:ar(i);break;case 19:F(tn);break;case 10:ys(i.type);break;case 22:case 23:ar(i),xh(),s!==null&&F(Zi);break;case 24:ys(on)}}function kl(s,i){try{var d=i.updateQueue,g=d!==null?d.lastEffect:null;if(g!==null){var E=g.next;d=E;do{if((d.tag&s)===s){g=void 0;var M=d.create,H=d.inst;g=M(),H.destroy=g}d=d.next}while(d!==E)}}catch(Z){Tt(i,i.return,Z)}}function ri(s,i,d){try{var g=i.updateQueue,E=g!==null?g.lastEffect:null;if(E!==null){var M=E.next;g=M;do{if((g.tag&s)===s){var H=g.inst,Z=H.destroy;if(Z!==void 0){H.destroy=void 0,E=i;var ne=d,de=Z;try{de()}catch(_e){Tt(E,ne,_e)}}}g=g.next}while(g!==M)}}catch(_e){Tt(i,i.return,_e)}}function j0(s){var i=s.updateQueue;if(i!==null){var d=s.stateNode;try{w1(i,d)}catch(g){Tt(s,s.return,g)}}}function O0(s,i,d){d.props=ro(s.type,s.memoizedProps),d.state=s.memoizedState;try{d.componentWillUnmount()}catch(g){Tt(s,i,g)}}function El(s,i){try{var d=s.ref;if(d!==null){switch(s.tag){case 26:case 27:case 5:var g=s.stateNode;break;case 30:g=s.stateNode;break;default:g=s.stateNode}typeof d=="function"?s.refCleanup=d(g):d.current=g}}catch(E){Tt(s,i,E)}}function ns(s,i){var d=s.ref,g=s.refCleanup;if(d!==null)if(typeof g=="function")try{g()}catch(E){Tt(s,i,E)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof d=="function")try{d(null)}catch(E){Tt(s,i,E)}else d.current=null}function L0(s){var i=s.type,d=s.memoizedProps,g=s.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":d.autoFocus&&g.focus();break e;case"img":d.src?g.src=d.src:d.srcSet&&(g.srcset=d.srcSet)}}catch(E){Tt(s,s.return,E)}}function Jh(s,i,d){try{var g=s.stateNode;k3(g,s.type,d,i),g[Ut]=i}catch(E){Tt(s,s.return,E)}}function I0(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&ui(s.type)||s.tag===4}function ep(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||I0(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&ui(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function tp(s,i,d){var g=s.tag;if(g===5||g===6)s=s.stateNode,i?(d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d).insertBefore(s,i):(i=d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d,i.appendChild(s),d=d._reactRootContainer,d!=null||i.onclick!==null||(i.onclick=br));else if(g!==4&&(g===27&&ui(s.type)&&(d=s.stateNode,i=null),s=s.child,s!==null))for(tp(s,i,d),s=s.sibling;s!==null;)tp(s,i,d),s=s.sibling}function Tu(s,i,d){var g=s.tag;if(g===5||g===6)s=s.stateNode,i?d.insertBefore(s,i):d.appendChild(s);else if(g!==4&&(g===27&&ui(s.type)&&(d=s.stateNode),s=s.child,s!==null))for(Tu(s,i,d),s=s.sibling;s!==null;)Tu(s,i,d),s=s.sibling}function P0(s){var i=s.stateNode,d=s.memoizedProps;try{for(var g=s.type,E=i.attributes;E.length;)i.removeAttributeNode(E[0]);Rn(i,g,d),i[jt]=s,i[Ut]=d}catch(M){Tt(s,s.return,M)}}var Cs=!1,cn=!1,np=!1,z0=typeof WeakSet=="function"?WeakSet:Set,yn=null;function s3(s,i){if(s=s.containerInfo,wp=Xu,s=Xv(s),Yf(s)){if("selectionStart"in s)var d={start:s.selectionStart,end:s.selectionEnd};else e:{d=(d=s.ownerDocument)&&d.defaultView||window;var g=d.getSelection&&d.getSelection();if(g&&g.rangeCount!==0){d=g.anchorNode;var E=g.anchorOffset,M=g.focusNode;g=g.focusOffset;try{d.nodeType,M.nodeType}catch{d=null;break e}var H=0,Z=-1,ne=-1,de=0,_e=0,xe=s,fe=null;t:for(;;){for(var me;xe!==d||E!==0&&xe.nodeType!==3||(Z=H+E),xe!==M||g!==0&&xe.nodeType!==3||(ne=H+g),xe.nodeType===3&&(H+=xe.nodeValue.length),(me=xe.firstChild)!==null;)fe=xe,xe=me;for(;;){if(xe===s)break t;if(fe===d&&++de===E&&(Z=H),fe===M&&++_e===g&&(ne=H),(me=xe.nextSibling)!==null)break;xe=fe,fe=xe.parentNode}xe=me}d=Z===-1||ne===-1?null:{start:Z,end:ne}}else d=null}d=d||{start:0,end:0}}else d=null;for(Cp={focusedElem:s,selectionRange:d},Xu=!1,yn=i;yn!==null;)if(i=yn,s=i.child,(i.subtreeFlags&1028)!==0&&s!==null)s.return=i,yn=s;else for(;yn!==null;){switch(i=yn,M=i.alternate,s=i.flags,i.tag){case 0:if((s&4)!==0&&(s=i.updateQueue,s=s!==null?s.events:null,s!==null))for(d=0;d<s.length;d++)E=s[d],E.ref.impl=E.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&M!==null){s=void 0,d=i,E=M.memoizedProps,M=M.memoizedState,g=d.stateNode;try{var qe=ro(d.type,E);s=g.getSnapshotBeforeUpdate(qe,M),g.__reactInternalSnapshotBeforeUpdate=s}catch(nt){Tt(d,d.return,nt)}}break;case 3:if((s&1024)!==0){if(s=i.stateNode.containerInfo,d=s.nodeType,d===9)Ap(s);else if(d===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":Ap(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(r(163))}if(s=i.sibling,s!==null){s.return=i.return,yn=s;break}yn=i.return}}function B0(s,i,d){var g=d.flags;switch(d.tag){case 0:case 11:case 15:Es(s,d),g&4&&kl(5,d);break;case 1:if(Es(s,d),g&4)if(s=d.stateNode,i===null)try{s.componentDidMount()}catch(H){Tt(d,d.return,H)}else{var E=ro(d.type,i.memoizedProps);i=i.memoizedState;try{s.componentDidUpdate(E,i,s.__reactInternalSnapshotBeforeUpdate)}catch(H){Tt(d,d.return,H)}}g&64&&j0(d),g&512&&El(d,d.return);break;case 3:if(Es(s,d),g&64&&(s=d.updateQueue,s!==null)){if(i=null,d.child!==null)switch(d.child.tag){case 27:case 5:i=d.child.stateNode;break;case 1:i=d.child.stateNode}try{w1(s,i)}catch(H){Tt(d,d.return,H)}}break;case 27:i===null&&g&4&&P0(d);case 26:case 5:Es(s,d),i===null&&g&4&&L0(d),g&512&&El(d,d.return);break;case 12:Es(s,d);break;case 31:Es(s,d),g&4&&U0(s,d);break;case 13:Es(s,d),g&4&&$0(s,d),g&64&&(s=d.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(d=h3.bind(null,d),j3(s,d))));break;case 22:if(g=d.memoizedState!==null||Cs,!g){i=i!==null&&i.memoizedState!==null||cn,E=Cs;var M=cn;Cs=g,(cn=i)&&!M?As(s,d,(d.subtreeFlags&8772)!==0):Es(s,d),Cs=E,cn=M}break;case 30:break;default:Es(s,d)}}function F0(s){var i=s.alternate;i!==null&&(s.alternate=null,F0(i)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(i=s.stateNode,i!==null&&Qr(i)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var $t=null,Xn=!1;function ks(s,i,d){for(d=d.child;d!==null;)H0(s,i,d),d=d.sibling}function H0(s,i,d){if(Re&&typeof Re.onCommitFiberUnmount=="function")try{Re.onCommitFiberUnmount(Pe,d)}catch{}switch(d.tag){case 26:cn||ns(d,i),ks(s,i,d),d.memoizedState?d.memoizedState.count--:d.stateNode&&(d=d.stateNode,d.parentNode.removeChild(d));break;case 27:cn||ns(d,i);var g=$t,E=Xn;ui(d.type)&&($t=d.stateNode,Xn=!1),ks(s,i,d),Ll(d.stateNode),$t=g,Xn=E;break;case 5:cn||ns(d,i);case 6:if(g=$t,E=Xn,$t=null,ks(s,i,d),$t=g,Xn=E,$t!==null)if(Xn)try{($t.nodeType===9?$t.body:$t.nodeName==="HTML"?$t.ownerDocument.body:$t).removeChild(d.stateNode)}catch(M){Tt(d,i,M)}else try{$t.removeChild(d.stateNode)}catch(M){Tt(d,i,M)}break;case 18:$t!==null&&(Xn?(s=$t,j_(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,d.stateNode),da(s)):j_($t,d.stateNode));break;case 4:g=$t,E=Xn,$t=d.stateNode.containerInfo,Xn=!0,ks(s,i,d),$t=g,Xn=E;break;case 0:case 11:case 14:case 15:ri(2,d,i),cn||ri(4,d,i),ks(s,i,d);break;case 1:cn||(ns(d,i),g=d.stateNode,typeof g.componentWillUnmount=="function"&&O0(d,i,g)),ks(s,i,d);break;case 21:ks(s,i,d);break;case 22:cn=(g=cn)||d.memoizedState!==null,ks(s,i,d),cn=g;break;default:ks(s,i,d)}}function U0(s,i){if(i.memoizedState===null&&(s=i.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{da(s)}catch(d){Tt(i,i.return,d)}}}function $0(s,i){if(i.memoizedState===null&&(s=i.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{da(s)}catch(d){Tt(i,i.return,d)}}function i3(s){switch(s.tag){case 31:case 13:case 19:var i=s.stateNode;return i===null&&(i=s.stateNode=new z0),i;case 22:return s=s.stateNode,i=s._retryCache,i===null&&(i=s._retryCache=new z0),i;default:throw Error(r(435,s.tag))}}function Nu(s,i){var d=i3(s);i.forEach(function(g){if(!d.has(g)){d.add(g);var E=p3.bind(null,s,g);g.then(E,E)}})}function Qn(s,i){var d=i.deletions;if(d!==null)for(var g=0;g<d.length;g++){var E=d[g],M=s,H=i,Z=H;e:for(;Z!==null;){switch(Z.tag){case 27:if(ui(Z.type)){$t=Z.stateNode,Xn=!1;break e}break;case 5:$t=Z.stateNode,Xn=!1;break e;case 3:case 4:$t=Z.stateNode.containerInfo,Xn=!0;break e}Z=Z.return}if($t===null)throw Error(r(160));H0(M,H,E),$t=null,Xn=!1,M=E.alternate,M!==null&&(M.return=null),E.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)q0(i,s),i=i.sibling}var Hr=null;function q0(s,i){var d=s.alternate,g=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:Qn(i,s),Zn(s),g&4&&(ri(3,s,s.return),kl(3,s),ri(5,s,s.return));break;case 1:Qn(i,s),Zn(s),g&512&&(cn||d===null||ns(d,d.return)),g&64&&Cs&&(s=s.updateQueue,s!==null&&(g=s.callbacks,g!==null&&(d=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=d===null?g:d.concat(g))));break;case 26:var E=Hr;if(Qn(i,s),Zn(s),g&512&&(cn||d===null||ns(d,d.return)),g&4){var M=d!==null?d.memoizedState:null;if(g=s.memoizedState,d===null)if(g===null)if(s.stateNode===null){e:{g=s.type,d=s.memoizedProps,E=E.ownerDocument||E;t:switch(g){case"title":M=E.getElementsByTagName("title")[0],(!M||M[Fn]||M[jt]||M.namespaceURI==="http://www.w3.org/2000/svg"||M.hasAttribute("itemprop"))&&(M=E.createElement(g),E.head.insertBefore(M,E.querySelector("head > title"))),Rn(M,g,d),M[jt]=s,_t(M),g=M;break e;case"link":var H=q_("link","href",E).get(g+(d.href||""));if(H){for(var Z=0;Z<H.length;Z++)if(M=H[Z],M.getAttribute("href")===(d.href==null||d.href===""?null:d.href)&&M.getAttribute("rel")===(d.rel==null?null:d.rel)&&M.getAttribute("title")===(d.title==null?null:d.title)&&M.getAttribute("crossorigin")===(d.crossOrigin==null?null:d.crossOrigin)){H.splice(Z,1);break t}}M=E.createElement(g),Rn(M,g,d),E.head.appendChild(M);break;case"meta":if(H=q_("meta","content",E).get(g+(d.content||""))){for(Z=0;Z<H.length;Z++)if(M=H[Z],M.getAttribute("content")===(d.content==null?null:""+d.content)&&M.getAttribute("name")===(d.name==null?null:d.name)&&M.getAttribute("property")===(d.property==null?null:d.property)&&M.getAttribute("http-equiv")===(d.httpEquiv==null?null:d.httpEquiv)&&M.getAttribute("charset")===(d.charSet==null?null:d.charSet)){H.splice(Z,1);break t}}M=E.createElement(g),Rn(M,g,d),E.head.appendChild(M);break;default:throw Error(r(468,g))}M[jt]=s,_t(M),g=M}s.stateNode=g}else V_(E,s.type,s.stateNode);else s.stateNode=$_(E,g,s.memoizedProps);else M!==g?(M===null?d.stateNode!==null&&(d=d.stateNode,d.parentNode.removeChild(d)):M.count--,g===null?V_(E,s.type,s.stateNode):$_(E,g,s.memoizedProps)):g===null&&s.stateNode!==null&&Jh(s,s.memoizedProps,d.memoizedProps)}break;case 27:Qn(i,s),Zn(s),g&512&&(cn||d===null||ns(d,d.return)),d!==null&&g&4&&Jh(s,s.memoizedProps,d.memoizedProps);break;case 5:if(Qn(i,s),Zn(s),g&512&&(cn||d===null||ns(d,d.return)),s.flags&32){E=s.stateNode;try{Vs(E,"")}catch(qe){Tt(s,s.return,qe)}}g&4&&s.stateNode!=null&&(E=s.memoizedProps,Jh(s,E,d!==null?d.memoizedProps:E)),g&1024&&(np=!0);break;case 6:if(Qn(i,s),Zn(s),g&4){if(s.stateNode===null)throw Error(r(162));g=s.memoizedProps,d=s.stateNode;try{d.nodeValue=g}catch(qe){Tt(s,s.return,qe)}}break;case 3:if(Wu=null,E=Hr,Hr=qu(i.containerInfo),Qn(i,s),Hr=E,Zn(s),g&4&&d!==null&&d.memoizedState.isDehydrated)try{da(i.containerInfo)}catch(qe){Tt(s,s.return,qe)}np&&(np=!1,V0(s));break;case 4:g=Hr,Hr=qu(s.stateNode.containerInfo),Qn(i,s),Zn(s),Hr=g;break;case 12:Qn(i,s),Zn(s);break;case 31:Qn(i,s),Zn(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Nu(s,g)));break;case 13:Qn(i,s),Zn(s),s.child.flags&8192&&s.memoizedState!==null!=(d!==null&&d.memoizedState!==null)&&(Du=Ne()),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Nu(s,g)));break;case 22:E=s.memoizedState!==null;var ne=d!==null&&d.memoizedState!==null,de=Cs,_e=cn;if(Cs=de||E,cn=_e||ne,Qn(i,s),cn=_e,Cs=de,Zn(s),g&8192)e:for(i=s.stateNode,i._visibility=E?i._visibility&-2:i._visibility|1,E&&(d===null||ne||Cs||cn||so(s)),d=null,i=s;;){if(i.tag===5||i.tag===26){if(d===null){ne=d=i;try{if(M=ne.stateNode,E)H=M.style,typeof H.setProperty=="function"?H.setProperty("display","none","important"):H.display="none";else{Z=ne.stateNode;var xe=ne.memoizedProps.style,fe=xe!=null&&xe.hasOwnProperty("display")?xe.display:null;Z.style.display=fe==null||typeof fe=="boolean"?"":(""+fe).trim()}}catch(qe){Tt(ne,ne.return,qe)}}}else if(i.tag===6){if(d===null){ne=i;try{ne.stateNode.nodeValue=E?"":ne.memoizedProps}catch(qe){Tt(ne,ne.return,qe)}}}else if(i.tag===18){if(d===null){ne=i;try{var me=ne.stateNode;E?O_(me,!0):O_(ne.stateNode,!1)}catch(qe){Tt(ne,ne.return,qe)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===s)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;d===i&&(d=null),i=i.return}d===i&&(d=null),i.sibling.return=i.return,i=i.sibling}g&4&&(g=s.updateQueue,g!==null&&(d=g.retryQueue,d!==null&&(g.retryQueue=null,Nu(s,d))));break;case 19:Qn(i,s),Zn(s),g&4&&(g=s.updateQueue,g!==null&&(s.updateQueue=null,Nu(s,g)));break;case 30:break;case 21:break;default:Qn(i,s),Zn(s)}}function Zn(s){var i=s.flags;if(i&2){try{for(var d,g=s.return;g!==null;){if(I0(g)){d=g;break}g=g.return}if(d==null)throw Error(r(160));switch(d.tag){case 27:var E=d.stateNode,M=ep(s);Tu(s,M,E);break;case 5:var H=d.stateNode;d.flags&32&&(Vs(H,""),d.flags&=-33);var Z=ep(s);Tu(s,Z,H);break;case 3:case 4:var ne=d.stateNode.containerInfo,de=ep(s);tp(s,de,ne);break;default:throw Error(r(161))}}catch(_e){Tt(s,s.return,_e)}s.flags&=-3}i&4096&&(s.flags&=-4097)}function V0(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var i=s;V0(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),s=s.sibling}}function Es(s,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)B0(s,i.alternate,i),i=i.sibling}function so(s){for(s=s.child;s!==null;){var i=s;switch(i.tag){case 0:case 11:case 14:case 15:ri(4,i,i.return),so(i);break;case 1:ns(i,i.return);var d=i.stateNode;typeof d.componentWillUnmount=="function"&&O0(i,i.return,d),so(i);break;case 27:Ll(i.stateNode);case 26:case 5:ns(i,i.return),so(i);break;case 22:i.memoizedState===null&&so(i);break;case 30:so(i);break;default:so(i)}s=s.sibling}}function As(s,i,d){for(d=d&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var g=i.alternate,E=s,M=i,H=M.flags;switch(M.tag){case 0:case 11:case 15:As(E,M,d),kl(4,M);break;case 1:if(As(E,M,d),g=M,E=g.stateNode,typeof E.componentDidMount=="function")try{E.componentDidMount()}catch(de){Tt(g,g.return,de)}if(g=M,E=g.updateQueue,E!==null){var Z=g.stateNode;try{var ne=E.shared.hiddenCallbacks;if(ne!==null)for(E.shared.hiddenCallbacks=null,E=0;E<ne.length;E++)S1(ne[E],Z)}catch(de){Tt(g,g.return,de)}}d&&H&64&&j0(M),El(M,M.return);break;case 27:P0(M);case 26:case 5:As(E,M,d),d&&g===null&&H&4&&L0(M),El(M,M.return);break;case 12:As(E,M,d);break;case 31:As(E,M,d),d&&H&4&&U0(E,M);break;case 13:As(E,M,d),d&&H&4&&$0(E,M);break;case 22:M.memoizedState===null&&As(E,M,d),El(M,M.return);break;case 30:break;default:As(E,M,d)}i=i.sibling}}function rp(s,i){var d=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(d=s.memoizedState.cachePool.pool),s=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(s=i.memoizedState.cachePool.pool),s!==d&&(s!=null&&s.refCount++,d!=null&&fl(d))}function sp(s,i){s=null,i.alternate!==null&&(s=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==s&&(i.refCount++,s!=null&&fl(s))}function Ur(s,i,d,g){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)W0(s,i,d,g),i=i.sibling}function W0(s,i,d,g){var E=i.flags;switch(i.tag){case 0:case 11:case 15:Ur(s,i,d,g),E&2048&&kl(9,i);break;case 1:Ur(s,i,d,g);break;case 3:Ur(s,i,d,g),E&2048&&(s=null,i.alternate!==null&&(s=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==s&&(i.refCount++,s!=null&&fl(s)));break;case 12:if(E&2048){Ur(s,i,d,g),s=i.stateNode;try{var M=i.memoizedProps,H=M.id,Z=M.onPostCommit;typeof Z=="function"&&Z(H,i.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(ne){Tt(i,i.return,ne)}}else Ur(s,i,d,g);break;case 31:Ur(s,i,d,g);break;case 13:Ur(s,i,d,g);break;case 23:break;case 22:M=i.stateNode,H=i.alternate,i.memoizedState!==null?M._visibility&2?Ur(s,i,d,g):Al(s,i):M._visibility&2?Ur(s,i,d,g):(M._visibility|=2,ea(s,i,d,g,(i.subtreeFlags&10256)!==0||!1)),E&2048&&rp(H,i);break;case 24:Ur(s,i,d,g),E&2048&&sp(i.alternate,i);break;default:Ur(s,i,d,g)}}function ea(s,i,d,g,E){for(E=E&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var M=s,H=i,Z=d,ne=g,de=H.flags;switch(H.tag){case 0:case 11:case 15:ea(M,H,Z,ne,E),kl(8,H);break;case 23:break;case 22:var _e=H.stateNode;H.memoizedState!==null?_e._visibility&2?ea(M,H,Z,ne,E):Al(M,H):(_e._visibility|=2,ea(M,H,Z,ne,E)),E&&de&2048&&rp(H.alternate,H);break;case 24:ea(M,H,Z,ne,E),E&&de&2048&&sp(H.alternate,H);break;default:ea(M,H,Z,ne,E)}i=i.sibling}}function Al(s,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var d=s,g=i,E=g.flags;switch(g.tag){case 22:Al(d,g),E&2048&&rp(g.alternate,g);break;case 24:Al(d,g),E&2048&&sp(g.alternate,g);break;default:Al(d,g)}i=i.sibling}}var Rl=8192;function ta(s,i,d){if(s.subtreeFlags&Rl)for(s=s.child;s!==null;)G0(s,i,d),s=s.sibling}function G0(s,i,d){switch(s.tag){case 26:ta(s,i,d),s.flags&Rl&&s.memoizedState!==null&&V3(d,Hr,s.memoizedState,s.memoizedProps);break;case 5:ta(s,i,d);break;case 3:case 4:var g=Hr;Hr=qu(s.stateNode.containerInfo),ta(s,i,d),Hr=g;break;case 22:s.memoizedState===null&&(g=s.alternate,g!==null&&g.memoizedState!==null?(g=Rl,Rl=16777216,ta(s,i,d),Rl=g):ta(s,i,d));break;default:ta(s,i,d)}}function K0(s){var i=s.alternate;if(i!==null&&(s=i.child,s!==null)){i.child=null;do i=s.sibling,s.sibling=null,s=i;while(s!==null)}}function Tl(s){var i=s.deletions;if((s.flags&16)!==0){if(i!==null)for(var d=0;d<i.length;d++){var g=i[d];yn=g,X0(g,s)}K0(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)Y0(s),s=s.sibling}function Y0(s){switch(s.tag){case 0:case 11:case 15:Tl(s),s.flags&2048&&ri(9,s,s.return);break;case 3:Tl(s);break;case 12:Tl(s);break;case 22:var i=s.stateNode;s.memoizedState!==null&&i._visibility&2&&(s.return===null||s.return.tag!==13)?(i._visibility&=-3,Mu(s)):Tl(s);break;default:Tl(s)}}function Mu(s){var i=s.deletions;if((s.flags&16)!==0){if(i!==null)for(var d=0;d<i.length;d++){var g=i[d];yn=g,X0(g,s)}K0(s)}for(s=s.child;s!==null;){switch(i=s,i.tag){case 0:case 11:case 15:ri(8,i,i.return),Mu(i);break;case 22:d=i.stateNode,d._visibility&2&&(d._visibility&=-3,Mu(i));break;default:Mu(i)}s=s.sibling}}function X0(s,i){for(;yn!==null;){var d=yn;switch(d.tag){case 0:case 11:case 15:ri(8,d,i);break;case 23:case 22:if(d.memoizedState!==null&&d.memoizedState.cachePool!==null){var g=d.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:fl(d.memoizedState.cache)}if(g=d.child,g!==null)g.return=d,yn=g;else e:for(d=s;yn!==null;){g=yn;var E=g.sibling,M=g.return;if(F0(g),g===d){yn=null;break e}if(E!==null){E.return=M,yn=E;break e}yn=M}}}var o3={getCacheForType:function(s){var i=En(on),d=i.data.get(s);return d===void 0&&(d=s(),i.data.set(s,d)),d},cacheSignal:function(){return En(on).controller.signal}},a3=typeof WeakMap=="function"?WeakMap:Map,kt=0,Ot=null,ut=null,ht=0,Rt=0,lr=null,si=!1,na=!1,ip=!1,Rs=0,Xt=0,ii=0,io=0,op=0,cr=0,ra=0,Nl=null,Jn=null,ap=!1,Du=0,Q0=0,ju=1/0,Ou=null,oi=null,hn=0,ai=null,sa=null,Ts=0,lp=0,cp=null,Z0=null,Ml=0,up=null;function ur(){return(kt&2)!==0&&ht!==0?ht&-ht:V.T!==null?gp():gn()}function J0(){if(cr===0)if((ht&536870912)===0||mt){var s=Et;Et<<=1,(Et&3932160)===0&&(Et=262144),cr=s}else cr=536870912;return s=or.current,s!==null&&(s.flags|=32),cr}function er(s,i,d){(s===Ot&&(Rt===2||Rt===9)||s.cancelPendingCommit!==null)&&(ia(s,0),li(s,ht,cr,!1)),Sn(s,d),((kt&2)===0||s!==Ot)&&(s===Ot&&((kt&2)===0&&(io|=d),Xt===4&&li(s,ht,cr,!1)),rs(s))}function e_(s,i,d){if((kt&6)!==0)throw Error(r(327));var g=!d&&(i&127)===0&&(i&s.expiredLanes)===0||vt(s,i),E=g?u3(s,i):fp(s,i,!0),M=g;do{if(E===0){na&&!g&&li(s,i,0,!1);break}else{if(d=s.current.alternate,M&&!l3(d)){E=fp(s,i,!1),M=!1;continue}if(E===2){if(M=i,s.errorRecoveryDisabledLanes&M)var H=0;else H=s.pendingLanes&-536870913,H=H!==0?H:H&536870912?536870912:0;if(H!==0){i=H;e:{var Z=s;E=Nl;var ne=Z.current.memoizedState.isDehydrated;if(ne&&(ia(Z,H).flags|=256),H=fp(Z,H,!1),H!==2){if(ip&&!ne){Z.errorRecoveryDisabledLanes|=M,io|=M,E=4;break e}M=Jn,Jn=E,M!==null&&(Jn===null?Jn=M:Jn.push.apply(Jn,M))}E=H}if(M=!1,E!==2)continue}}if(E===1){ia(s,0),li(s,i,0,!0);break}e:{switch(g=s,M=E,M){case 0:case 1:throw Error(r(345));case 4:if((i&4194048)!==i)break;case 6:li(g,i,cr,!si);break e;case 2:Jn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((i&62914560)===i&&(E=Du+300-Ne(),10<E)){if(li(g,i,cr,!si),tt(g,0,!0)!==0)break e;Ts=i,g.timeoutHandle=M_(t_.bind(null,g,d,Jn,Ou,ap,i,cr,io,ra,si,M,"Throttled",-0,0),E);break e}t_(g,d,Jn,Ou,ap,i,cr,io,ra,si,M,null,-0,0)}}break}while(!0);rs(s)}function t_(s,i,d,g,E,M,H,Z,ne,de,_e,xe,fe,me){if(s.timeoutHandle=-1,xe=i.subtreeFlags,xe&8192||(xe&16785408)===16785408){xe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:br},G0(i,M,xe);var qe=(M&62914560)===M?Du-Ne():(M&4194048)===M?Q0-Ne():0;if(qe=W3(xe,qe),qe!==null){Ts=M,s.cancelPendingCommit=qe(c_.bind(null,s,i,M,d,g,E,H,Z,ne,_e,xe,null,fe,me)),li(s,M,H,!de);return}}c_(s,i,M,d,g,E,H,Z,ne)}function l3(s){for(var i=s;;){var d=i.tag;if((d===0||d===11||d===15)&&i.flags&16384&&(d=i.updateQueue,d!==null&&(d=d.stores,d!==null)))for(var g=0;g<d.length;g++){var E=d[g],M=E.getSnapshot;E=E.value;try{if(!sr(M(),E))return!1}catch{return!1}}if(d=i.child,i.subtreeFlags&16384&&d!==null)d.return=i,i=d;else{if(i===s)break;for(;i.sibling===null;){if(i.return===null||i.return===s)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function li(s,i,d,g){i&=~op,i&=~io,s.suspendedLanes|=i,s.pingedLanes&=~i,g&&(s.warmLanes|=i),g=s.expirationTimes;for(var E=i;0<E;){var M=31-we(E),H=1<<M;g[M]=-1,E&=~H}d!==0&&zn(s,d,i)}function Lu(){return(kt&6)===0?(Dl(0),!1):!0}function dp(){if(ut!==null){if(Rt===0)var s=ut.return;else s=ut,_s=Xi=null,Ah(s),Yo=null,pl=0,s=ut;for(;s!==null;)D0(s.alternate,s),s=s.return;ut=null}}function ia(s,i){var d=s.timeoutHandle;d!==-1&&(s.timeoutHandle=-1,R3(d)),d=s.cancelPendingCommit,d!==null&&(s.cancelPendingCommit=null,d()),Ts=0,dp(),Ot=s,ut=d=gs(s.current,null),ht=i,Rt=0,lr=null,si=!1,na=vt(s,i),ip=!1,ra=cr=op=io=ii=Xt=0,Jn=Nl=null,ap=!1,(i&8)!==0&&(i|=i&32);var g=s.entangledLanes;if(g!==0)for(s=s.entanglements,g&=i;0<g;){var E=31-we(g),M=1<<E;i|=s[E],g&=~M}return Rs=i,nu(),d}function n_(s,i){it=null,V.H=Sl,i===Ko||i===uu?(i=_1(),Rt=3):i===mh?(i=_1(),Rt=4):Rt=i===$h?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,lr=i,ut===null&&(Xt=1,Cu(s,Sr(i,s.current)))}function r_(){var s=or.current;return s===null?!0:(ht&4194048)===ht?Er===null:(ht&62914560)===ht||(ht&536870912)!==0?s===Er:!1}function s_(){var s=V.H;return V.H=Sl,s===null?Sl:s}function i_(){var s=V.A;return V.A=o3,s}function Iu(){Xt=4,si||(ht&4194048)!==ht&&or.current!==null||(na=!0),(ii&134217727)===0&&(io&134217727)===0||Ot===null||li(Ot,ht,cr,!1)}function fp(s,i,d){var g=kt;kt|=2;var E=s_(),M=i_();(Ot!==s||ht!==i)&&(Ou=null,ia(s,i)),i=!1;var H=Xt;e:do try{if(Rt!==0&&ut!==null){var Z=ut,ne=lr;switch(Rt){case 8:dp(),H=6;break e;case 3:case 2:case 9:case 6:or.current===null&&(i=!0);var de=Rt;if(Rt=0,lr=null,oa(s,Z,ne,de),d&&na){H=0;break e}break;default:de=Rt,Rt=0,lr=null,oa(s,Z,ne,de)}}c3(),H=Xt;break}catch(_e){n_(s,_e)}while(!0);return i&&s.shellSuspendCounter++,_s=Xi=null,kt=g,V.H=E,V.A=M,ut===null&&(Ot=null,ht=0,nu()),H}function c3(){for(;ut!==null;)o_(ut)}function u3(s,i){var d=kt;kt|=2;var g=s_(),E=i_();Ot!==s||ht!==i?(Ou=null,ju=Ne()+500,ia(s,i)):na=vt(s,i);e:do try{if(Rt!==0&&ut!==null){i=ut;var M=lr;t:switch(Rt){case 1:Rt=0,lr=null,oa(s,i,M,1);break;case 2:case 9:if(g1(M)){Rt=0,lr=null,a_(i);break}i=function(){Rt!==2&&Rt!==9||Ot!==s||(Rt=7),rs(s)},M.then(i,i);break e;case 3:Rt=7;break e;case 4:Rt=5;break e;case 7:g1(M)?(Rt=0,lr=null,a_(i)):(Rt=0,lr=null,oa(s,i,M,7));break;case 5:var H=null;switch(ut.tag){case 26:H=ut.memoizedState;case 5:case 27:var Z=ut;if(H?W_(H):Z.stateNode.complete){Rt=0,lr=null;var ne=Z.sibling;if(ne!==null)ut=ne;else{var de=Z.return;de!==null?(ut=de,Pu(de)):ut=null}break t}}Rt=0,lr=null,oa(s,i,M,5);break;case 6:Rt=0,lr=null,oa(s,i,M,6);break;case 8:dp(),Xt=6;break e;default:throw Error(r(462))}}d3();break}catch(_e){n_(s,_e)}while(!0);return _s=Xi=null,V.H=g,V.A=E,kt=d,ut!==null?0:(Ot=null,ht=0,nu(),Xt)}function d3(){for(;ut!==null&&!rt();)o_(ut)}function o_(s){var i=N0(s.alternate,s,Rs);s.memoizedProps=s.pendingProps,i===null?Pu(s):ut=i}function a_(s){var i=s,d=i.alternate;switch(i.tag){case 15:case 0:i=C0(d,i,i.pendingProps,i.type,void 0,ht);break;case 11:i=C0(d,i,i.pendingProps,i.type.render,i.ref,ht);break;case 5:Ah(i);default:D0(d,i),i=ut=i1(i,Rs),i=N0(d,i,Rs)}s.memoizedProps=s.pendingProps,i===null?Pu(s):ut=i}function oa(s,i,d,g){_s=Xi=null,Ah(i),Yo=null,pl=0;var E=i.return;try{if(JE(s,E,i,d,ht)){Xt=1,Cu(s,Sr(d,s.current)),ut=null;return}}catch(M){if(E!==null)throw ut=E,M;Xt=1,Cu(s,Sr(d,s.current)),ut=null;return}i.flags&32768?(mt||g===1?s=!0:na||(ht&536870912)!==0?s=!1:(si=s=!0,(g===2||g===9||g===3||g===6)&&(g=or.current,g!==null&&g.tag===13&&(g.flags|=16384))),l_(i,s)):Pu(i)}function Pu(s){var i=s;do{if((i.flags&32768)!==0){l_(i,si);return}s=i.return;var d=n3(i.alternate,i,Rs);if(d!==null){ut=d;return}if(i=i.sibling,i!==null){ut=i;return}ut=i=s}while(i!==null);Xt===0&&(Xt=5)}function l_(s,i){do{var d=r3(s.alternate,s);if(d!==null){d.flags&=32767,ut=d;return}if(d=s.return,d!==null&&(d.flags|=32768,d.subtreeFlags=0,d.deletions=null),!i&&(s=s.sibling,s!==null)){ut=s;return}ut=s=d}while(s!==null);Xt=6,ut=null}function c_(s,i,d,g,E,M,H,Z,ne){s.cancelPendingCommit=null;do zu();while(hn!==0);if((kt&6)!==0)throw Error(r(327));if(i!==null){if(i===s.current)throw Error(r(177));if(M=i.lanes|i.childLanes,M|=eh,jr(s,d,M,H,Z,ne),s===Ot&&(ut=Ot=null,ht=0),sa=i,ai=s,Ts=d,lp=M,cp=E,Z0=g,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,m3(Te,function(){return p_(),null})):(s.callbackNode=null,s.callbackPriority=0),g=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||g){g=V.T,V.T=null,E=Q.p,Q.p=2,H=kt,kt|=4;try{s3(s,i,d)}finally{kt=H,Q.p=E,V.T=g}}hn=1,u_(),d_(),f_()}}function u_(){if(hn===1){hn=0;var s=ai,i=sa,d=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||d){d=V.T,V.T=null;var g=Q.p;Q.p=2;var E=kt;kt|=4;try{q0(i,s);var M=Cp,H=Xv(s.containerInfo),Z=M.focusedElem,ne=M.selectionRange;if(H!==Z&&Z&&Z.ownerDocument&&Yv(Z.ownerDocument.documentElement,Z)){if(ne!==null&&Yf(Z)){var de=ne.start,_e=ne.end;if(_e===void 0&&(_e=de),"selectionStart"in Z)Z.selectionStart=de,Z.selectionEnd=Math.min(_e,Z.value.length);else{var xe=Z.ownerDocument||document,fe=xe&&xe.defaultView||window;if(fe.getSelection){var me=fe.getSelection(),qe=Z.textContent.length,nt=Math.min(ne.start,qe),Dt=ne.end===void 0?nt:Math.min(ne.end,qe);!me.extend&&nt>Dt&&(H=Dt,Dt=nt,nt=H);var ae=Kv(Z,nt),ie=Kv(Z,Dt);if(ae&&ie&&(me.rangeCount!==1||me.anchorNode!==ae.node||me.anchorOffset!==ae.offset||me.focusNode!==ie.node||me.focusOffset!==ie.offset)){var ue=xe.createRange();ue.setStart(ae.node,ae.offset),me.removeAllRanges(),nt>Dt?(me.addRange(ue),me.extend(ie.node,ie.offset)):(ue.setEnd(ie.node,ie.offset),me.addRange(ue))}}}}for(xe=[],me=Z;me=me.parentNode;)me.nodeType===1&&xe.push({element:me,left:me.scrollLeft,top:me.scrollTop});for(typeof Z.focus=="function"&&Z.focus(),Z=0;Z<xe.length;Z++){var be=xe[Z];be.element.scrollLeft=be.left,be.element.scrollTop=be.top}}Xu=!!wp,Cp=wp=null}finally{kt=E,Q.p=g,V.T=d}}s.current=i,hn=2}}function d_(){if(hn===2){hn=0;var s=ai,i=sa,d=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||d){d=V.T,V.T=null;var g=Q.p;Q.p=2;var E=kt;kt|=4;try{B0(s,i.alternate,i)}finally{kt=E,Q.p=g,V.T=d}}hn=3}}function f_(){if(hn===4||hn===3){hn=0,Qe();var s=ai,i=sa,d=Ts,g=Z0;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?hn=5:(hn=0,sa=ai=null,h_(s,s.pendingLanes));var E=s.pendingLanes;if(E===0&&(oi=null),dn(d),i=i.stateNode,Re&&typeof Re.onCommitFiberRoot=="function")try{Re.onCommitFiberRoot(Pe,i,void 0,(i.current.flags&128)===128)}catch{}if(g!==null){i=V.T,E=Q.p,Q.p=2,V.T=null;try{for(var M=s.onRecoverableError,H=0;H<g.length;H++){var Z=g[H];M(Z.value,{componentStack:Z.stack})}}finally{V.T=i,Q.p=E}}(Ts&3)!==0&&zu(),rs(s),E=s.pendingLanes,(d&261930)!==0&&(E&42)!==0?s===up?Ml++:(Ml=0,up=s):Ml=0,Dl(0)}}function h_(s,i){(s.pooledCacheLanes&=i)===0&&(i=s.pooledCache,i!=null&&(s.pooledCache=null,fl(i)))}function zu(){return u_(),d_(),f_(),p_()}function p_(){if(hn!==5)return!1;var s=ai,i=lp;lp=0;var d=dn(Ts),g=V.T,E=Q.p;try{Q.p=32>d?32:d,V.T=null,d=cp,cp=null;var M=ai,H=Ts;if(hn=0,sa=ai=null,Ts=0,(kt&6)!==0)throw Error(r(331));var Z=kt;if(kt|=4,Y0(M.current),W0(M,M.current,H,d),kt=Z,Dl(0,!1),Re&&typeof Re.onPostCommitFiberRoot=="function")try{Re.onPostCommitFiberRoot(Pe,M)}catch{}return!0}finally{Q.p=E,V.T=g,h_(s,i)}}function m_(s,i,d){i=Sr(d,i),i=Uh(s.stateNode,i,2),s=ei(s,i,2),s!==null&&(Sn(s,2),rs(s))}function Tt(s,i,d){if(s.tag===3)m_(s,s,d);else for(;i!==null;){if(i.tag===3){m_(i,s,d);break}else if(i.tag===1){var g=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(oi===null||!oi.has(g))){s=Sr(d,s),d=g0(2),g=ei(i,d,2),g!==null&&(v0(d,g,i,s),Sn(g,2),rs(g));break}}i=i.return}}function hp(s,i,d){var g=s.pingCache;if(g===null){g=s.pingCache=new a3;var E=new Set;g.set(i,E)}else E=g.get(i),E===void 0&&(E=new Set,g.set(i,E));E.has(d)||(ip=!0,E.add(d),s=f3.bind(null,s,i,d),i.then(s,s))}function f3(s,i,d){var g=s.pingCache;g!==null&&g.delete(i),s.pingedLanes|=s.suspendedLanes&d,s.warmLanes&=~d,Ot===s&&(ht&d)===d&&(Xt===4||Xt===3&&(ht&62914560)===ht&&300>Ne()-Du?(kt&2)===0&&ia(s,0):op|=d,ra===ht&&(ra=0)),rs(s)}function g_(s,i){i===0&&(i=Ht()),s=Gi(s,i),s!==null&&(Sn(s,i),rs(s))}function h3(s){var i=s.memoizedState,d=0;i!==null&&(d=i.retryLane),g_(s,d)}function p3(s,i){var d=0;switch(s.tag){case 31:case 13:var g=s.stateNode,E=s.memoizedState;E!==null&&(d=E.retryLane);break;case 19:g=s.stateNode;break;case 22:g=s.stateNode._retryCache;break;default:throw Error(r(314))}g!==null&&g.delete(i),g_(s,d)}function m3(s,i){return Oe(s,i)}var Bu=null,aa=null,pp=!1,Fu=!1,mp=!1,ci=0;function rs(s){s!==aa&&s.next===null&&(aa===null?Bu=aa=s:aa=aa.next=s),Fu=!0,pp||(pp=!0,v3())}function Dl(s,i){if(!mp&&Fu){mp=!0;do for(var d=!1,g=Bu;g!==null;){if(s!==0){var E=g.pendingLanes;if(E===0)var M=0;else{var H=g.suspendedLanes,Z=g.pingedLanes;M=(1<<31-we(42|s)+1)-1,M&=E&~(H&~Z),M=M&201326741?M&201326741|1:M?M|2:0}M!==0&&(d=!0,b_(g,M))}else M=ht,M=tt(g,g===Ot?M:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(M&3)===0||vt(g,M)||(d=!0,b_(g,M));g=g.next}while(d);mp=!1}}function g3(){v_()}function v_(){Fu=pp=!1;var s=0;ci!==0&&A3()&&(s=ci);for(var i=Ne(),d=null,g=Bu;g!==null;){var E=g.next,M=__(g,i);M===0?(g.next=null,d===null?Bu=E:d.next=E,E===null&&(aa=d)):(d=g,(s!==0||(M&3)!==0)&&(Fu=!0)),g=E}hn!==0&&hn!==5||Dl(s),ci!==0&&(ci=0)}function __(s,i){for(var d=s.suspendedLanes,g=s.pingedLanes,E=s.expirationTimes,M=s.pendingLanes&-62914561;0<M;){var H=31-we(M),Z=1<<H,ne=E[H];ne===-1?((Z&d)===0||(Z&g)!==0)&&(E[H]=Vt(Z,i)):ne<=i&&(s.expiredLanes|=Z),M&=~Z}if(i=Ot,d=ht,d=tt(s,s===i?d:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g=s.callbackNode,d===0||s===i&&(Rt===2||Rt===9)||s.cancelPendingCommit!==null)return g!==null&&g!==null&&He(g),s.callbackNode=null,s.callbackPriority=0;if((d&3)===0||vt(s,d)){if(i=d&-d,i===s.callbackPriority)return i;switch(g!==null&&He(g),dn(d)){case 2:case 8:d=ve;break;case 32:d=Te;break;case 268435456:d=Le;break;default:d=Te}return g=y_.bind(null,s),d=Oe(d,g),s.callbackPriority=i,s.callbackNode=d,i}return g!==null&&g!==null&&He(g),s.callbackPriority=2,s.callbackNode=null,2}function y_(s,i){if(hn!==0&&hn!==5)return s.callbackNode=null,s.callbackPriority=0,null;var d=s.callbackNode;if(zu()&&s.callbackNode!==d)return null;var g=ht;return g=tt(s,s===Ot?g:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),g===0?null:(e_(s,g,i),__(s,Ne()),s.callbackNode!=null&&s.callbackNode===d?y_.bind(null,s):null)}function b_(s,i){if(zu())return null;e_(s,i,!0)}function v3(){T3(function(){(kt&6)!==0?Oe(ce,g3):v_()})}function gp(){if(ci===0){var s=Wo;s===0&&(s=It,It<<=1,(It&261888)===0&&(It=256)),ci=s}return ci}function x_(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:Ii(""+s)}function S_(s,i){var d=i.ownerDocument.createElement("input");return d.name=i.name,d.value=i.value,s.id&&d.setAttribute("form",s.id),i.parentNode.insertBefore(d,i),s=new FormData(s),d.parentNode.removeChild(d),s}function _3(s,i,d,g,E){if(i==="submit"&&d&&d.stateNode===E){var M=x_((E[Ut]||null).action),H=g.submitter;H&&(i=(i=H[Ut]||null)?x_(i.formAction):H.getAttribute("formAction"),i!==null&&(M=i,H=null));var Z=new jo("action","action",null,g,E);s.push({event:Z,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(ci!==0){var ne=H?S_(E,H):new FormData(E);Ih(d,{pending:!0,data:ne,method:E.method,action:M},null,ne)}}else typeof M=="function"&&(Z.preventDefault(),ne=H?S_(E,H):new FormData(E),Ih(d,{pending:!0,data:ne,method:E.method,action:M},M,ne))},currentTarget:E}]})}}for(var vp=0;vp<Jf.length;vp++){var _p=Jf[vp],y3=_p.toLowerCase(),b3=_p[0].toUpperCase()+_p.slice(1);Fr(y3,"on"+b3)}Fr(Jv,"onAnimationEnd"),Fr(e1,"onAnimationIteration"),Fr(t1,"onAnimationStart"),Fr("dblclick","onDoubleClick"),Fr("focusin","onFocus"),Fr("focusout","onBlur"),Fr(IE,"onTransitionRun"),Fr(PE,"onTransitionStart"),Fr(zE,"onTransitionCancel"),Fr(n1,"onTransitionEnd"),Kt("onMouseEnter",["mouseout","mouseover"]),Kt("onMouseLeave",["mouseout","mouseover"]),Kt("onPointerEnter",["pointerout","pointerover"]),Kt("onPointerLeave",["pointerout","pointerover"]),fn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),fn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),fn("onBeforeInput",["compositionend","keypress","textInput","paste"]),fn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),fn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),fn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var jl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),x3=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(jl));function w_(s,i){i=(i&4)!==0;for(var d=0;d<s.length;d++){var g=s[d],E=g.event;g=g.listeners;e:{var M=void 0;if(i)for(var H=g.length-1;0<=H;H--){var Z=g[H],ne=Z.instance,de=Z.currentTarget;if(Z=Z.listener,ne!==M&&E.isPropagationStopped())break e;M=Z,E.currentTarget=de;try{M(E)}catch(_e){tu(_e)}E.currentTarget=null,M=ne}else for(H=0;H<g.length;H++){if(Z=g[H],ne=Z.instance,de=Z.currentTarget,Z=Z.listener,ne!==M&&E.isPropagationStopped())break e;M=Z,E.currentTarget=de;try{M(E)}catch(_e){tu(_e)}E.currentTarget=null,M=ne}}}}function dt(s,i){var d=i[Bn];d===void 0&&(d=i[Bn]=new Set);var g=s+"__bubble";d.has(g)||(C_(i,s,2,!1),d.add(g))}function yp(s,i,d){var g=0;i&&(g|=4),C_(d,s,g,i)}var Hu="_reactListening"+Math.random().toString(36).slice(2);function bp(s){if(!s[Hu]){s[Hu]=!0,Kn.forEach(function(d){d!=="selectionchange"&&(x3.has(d)||yp(d,!1,s),yp(d,!0,s))});var i=s.nodeType===9?s:s.ownerDocument;i===null||i[Hu]||(i[Hu]=!0,yp("selectionchange",!1,i))}}function C_(s,i,d,g){switch(J_(i)){case 2:var E=Y3;break;case 8:E=X3;break;default:E=Lp}d=E.bind(null,i,d,s),E=void 0,!nl||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(E=!0),g?E!==void 0?s.addEventListener(i,d,{capture:!0,passive:E}):s.addEventListener(i,d,!0):E!==void 0?s.addEventListener(i,d,{passive:E}):s.addEventListener(i,d,!1)}function xp(s,i,d,g,E){var M=g;if((i&1)===0&&(i&2)===0&&g!==null)e:for(;;){if(g===null)return;var H=g.tag;if(H===3||H===4){var Z=g.stateNode.containerInfo;if(Z===E)break;if(H===4)for(H=g.return;H!==null;){var ne=H.tag;if((ne===3||ne===4)&&H.stateNode.containerInfo===E)return;H=H.return}for(;Z!==null;){if(H=yr(Z),H===null)return;if(ne=H.tag,ne===5||ne===6||ne===26||ne===27){g=M=H;continue e}Z=Z.parentNode}}g=g.return}Vc(function(){var de=M,_e=Ja(d),xe=[];e:{var fe=r1.get(s);if(fe!==void 0){var me=jo,qe=s;switch(s){case"keypress":if(Mo(d)===0)break e;case"keydown":case"keyup":me=Jc;break;case"focusin":qe="focus",me=Io;break;case"focusout":qe="blur",me=Io;break;case"beforeblur":case"afterblur":me=Io;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":me=Kc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=Yc;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=vE;break;case Jv:case e1:case t1:me=Zc;break;case n1:me=yE;break;case"scroll":case"scrollend":me=Vf;break;case"wheel":me=xE;break;case"copy":case"cut":case"paste":me=At;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=Ov;break;case"toggle":case"beforetoggle":me=wE}var nt=(i&4)!==0,Dt=!nt&&(s==="scroll"||s==="scrollend"),ae=nt?fe!==null?fe+"Capture":null:fe;nt=[];for(var ie=de,ue;ie!==null;){var be=ie;if(ue=be.stateNode,be=be.tag,be!==5&&be!==26&&be!==27||ue===null||ae===null||(be=Pi(ie,ae),be!=null&&nt.push(Ol(ie,be,ue))),Dt)break;ie=ie.return}0<nt.length&&(fe=new me(fe,qe,null,d,_e),xe.push({event:fe,listeners:nt}))}}if((i&7)===0){e:{if(fe=s==="mouseover"||s==="pointerover",me=s==="mouseout"||s==="pointerout",fe&&d!==To&&(qe=d.relatedTarget||d.fromElement)&&(yr(qe)||qe[Dn]))break e;if((me||fe)&&(fe=_e.window===_e?_e:(fe=_e.ownerDocument)?fe.defaultView||fe.parentWindow:window,me?(qe=d.relatedTarget||d.toElement,me=de,qe=qe?yr(qe):null,qe!==null&&(Dt=a(qe),nt=qe.tag,qe!==Dt||nt!==5&&nt!==27&&nt!==6)&&(qe=null)):(me=null,qe=de),me!==qe)){if(nt=Kc,be="onMouseLeave",ae="onMouseEnter",ie="mouse",(s==="pointerout"||s==="pointerover")&&(nt=Ov,be="onPointerLeave",ae="onPointerEnter",ie="pointer"),Dt=me==null?fe:wn(me),ue=qe==null?fe:wn(qe),fe=new nt(be,ie+"leave",me,d,_e),fe.target=Dt,fe.relatedTarget=ue,be=null,yr(_e)===de&&(nt=new nt(ae,ie+"enter",qe,d,_e),nt.target=ue,nt.relatedTarget=Dt,be=nt),Dt=be,me&&qe)t:{for(nt=S3,ae=me,ie=qe,ue=0,be=ae;be;be=nt(be))ue++;be=0;for(var Ze=ie;Ze;Ze=nt(Ze))be++;for(;0<ue-be;)ae=nt(ae),ue--;for(;0<be-ue;)ie=nt(ie),be--;for(;ue--;){if(ae===ie||ie!==null&&ae===ie.alternate){nt=ae;break t}ae=nt(ae),ie=nt(ie)}nt=null}else nt=null;me!==null&&k_(xe,fe,me,nt,!1),qe!==null&&Dt!==null&&k_(xe,Dt,qe,nt,!0)}}e:{if(fe=de?wn(de):window,me=fe.nodeName&&fe.nodeName.toLowerCase(),me==="select"||me==="input"&&fe.type==="file")var xt=Uv;else if(Fv(fe))if($v)xt=jE;else{xt=ME;var Ye=NE}else me=fe.nodeName,!me||me.toLowerCase()!=="input"||fe.type!=="checkbox"&&fe.type!=="radio"?de&&ps(de.elementType)&&(xt=Uv):xt=DE;if(xt&&(xt=xt(s,de))){Hv(xe,xt,d,_e);break e}Ye&&Ye(s,fe,de),s==="focusout"&&de&&fe.type==="number"&&de.memoizedProps.value!=null&&Li(fe,"number",fe.value)}switch(Ye=de?wn(de):window,s){case"focusin":(Fv(Ye)||Ye.contentEditable==="true")&&(zo=Ye,Xf=de,cl=null);break;case"focusout":cl=Xf=zo=null;break;case"mousedown":Qf=!0;break;case"contextmenu":case"mouseup":case"dragend":Qf=!1,Qv(xe,d,_e);break;case"selectionchange":if(LE)break;case"keydown":case"keyup":Qv(xe,d,_e)}var ot;if(Wf)e:{switch(s){case"compositionstart":var pt="onCompositionStart";break e;case"compositionend":pt="onCompositionEnd";break e;case"compositionupdate":pt="onCompositionUpdate";break e}pt=void 0}else Po?zv(s,d)&&(pt="onCompositionEnd"):s==="keydown"&&d.keyCode===229&&(pt="onCompositionStart");pt&&(Lv&&d.locale!=="ko"&&(Po||pt!=="onCompositionStart"?pt==="onCompositionEnd"&&Po&&(ot=Wc()):(Br=_e,rl="value"in Br?Br.value:Br.textContent,Po=!0)),Ye=Uu(de,pt),0<Ye.length&&(pt=new bt(pt,s,null,d,_e),xe.push({event:pt,listeners:Ye}),ot?pt.data=ot:(ot=Bv(d),ot!==null&&(pt.data=ot)))),(ot=kE?EE(s,d):AE(s,d))&&(pt=Uu(de,"onBeforeInput"),0<pt.length&&(Ye=new bt("onBeforeInput","beforeinput",null,d,_e),xe.push({event:Ye,listeners:pt}),Ye.data=ot)),_3(xe,s,de,d,_e)}w_(xe,i)})}function Ol(s,i,d){return{instance:s,listener:i,currentTarget:d}}function Uu(s,i){for(var d=i+"Capture",g=[];s!==null;){var E=s,M=E.stateNode;if(E=E.tag,E!==5&&E!==26&&E!==27||M===null||(E=Pi(s,d),E!=null&&g.unshift(Ol(s,E,M)),E=Pi(s,i),E!=null&&g.push(Ol(s,E,M))),s.tag===3)return g;s=s.return}return[]}function S3(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function k_(s,i,d,g,E){for(var M=i._reactName,H=[];d!==null&&d!==g;){var Z=d,ne=Z.alternate,de=Z.stateNode;if(Z=Z.tag,ne!==null&&ne===g)break;Z!==5&&Z!==26&&Z!==27||de===null||(ne=de,E?(de=Pi(d,M),de!=null&&H.unshift(Ol(d,de,ne))):E||(de=Pi(d,M),de!=null&&H.push(Ol(d,de,ne)))),d=d.return}H.length!==0&&s.push({event:i,listeners:H})}var w3=/\r\n?/g,C3=/\u0000|\uFFFD/g;function E_(s){return(typeof s=="string"?s:""+s).replace(w3,`
49
+ `).replace(C3,"")}function A_(s,i){return i=E_(i),E_(s)===i}function Mt(s,i,d,g,E,M){switch(d){case"children":typeof g=="string"?i==="body"||i==="textarea"&&g===""||Vs(s,g):(typeof g=="number"||typeof g=="bigint")&&i!=="body"&&Vs(s,""+g);break;case"className":rr(s,"class",g);break;case"tabIndex":rr(s,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":rr(s,d,g);break;case"style":$c(s,g,M);break;case"data":if(i!=="object"){rr(s,"data",g);break}case"src":case"href":if(g===""&&(i!=="a"||d!=="href")){s.removeAttribute(d);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(d);break}g=Ii(""+g),s.setAttribute(d,g);break;case"action":case"formAction":if(typeof g=="function"){s.setAttribute(d,"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"&&(d==="formAction"?(i!=="input"&&Mt(s,i,"name",E.name,E,null),Mt(s,i,"formEncType",E.formEncType,E,null),Mt(s,i,"formMethod",E.formMethod,E,null),Mt(s,i,"formTarget",E.formTarget,E,null)):(Mt(s,i,"encType",E.encType,E,null),Mt(s,i,"method",E.method,E,null),Mt(s,i,"target",E.target,E,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){s.removeAttribute(d);break}g=Ii(""+g),s.setAttribute(d,g);break;case"onClick":g!=null&&(s.onclick=br);break;case"onScroll":g!=null&&dt("scroll",s);break;case"onScrollEnd":g!=null&&dt("scrollend",s);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(d=g.__html,d!=null){if(E.children!=null)throw Error(r(60));s.innerHTML=d}}break;case"multiple":s.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":s.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){s.removeAttribute("xlink:href");break}d=Ii(""+g),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",d);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(d,""+g):s.removeAttribute(d);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":g&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(d,""):s.removeAttribute(d);break;case"capture":case"download":g===!0?s.setAttribute(d,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?s.setAttribute(d,g):s.removeAttribute(d);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?s.setAttribute(d,g):s.removeAttribute(d);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?s.removeAttribute(d):s.setAttribute(d,g);break;case"popover":dt("beforetoggle",s),dt("toggle",s),Yn(s,"popover",g);break;case"xlinkActuate":Cn(s,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":Cn(s,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":Cn(s,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":Cn(s,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":Cn(s,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":Cn(s,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":Cn(s,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":Cn(s,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":Cn(s,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":Yn(s,"is",g);break;case"innerText":case"textContent":break;default:(!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(d=qc.get(d)||d,Yn(s,d,g))}}function Sp(s,i,d,g,E,M){switch(d){case"style":$c(s,g,M);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(r(61));if(d=g.__html,d!=null){if(E.children!=null)throw Error(r(60));s.innerHTML=d}}break;case"children":typeof g=="string"?Vs(s,g):(typeof g=="number"||typeof g=="bigint")&&Vs(s,""+g);break;case"onScroll":g!=null&&dt("scroll",s);break;case"onScrollEnd":g!=null&&dt("scrollend",s);break;case"onClick":g!=null&&(s.onclick=br);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!jn.hasOwnProperty(d))e:{if(d[0]==="o"&&d[1]==="n"&&(E=d.endsWith("Capture"),i=d.slice(2,E?d.length-7:void 0),M=s[Ut]||null,M=M!=null?M[d]:null,typeof M=="function"&&s.removeEventListener(i,M,E),typeof g=="function")){typeof M!="function"&&M!==null&&(d in s?s[d]=null:s.hasAttribute(d)&&s.removeAttribute(d)),s.addEventListener(i,g,E);break e}d in s?s[d]=g:g===!0?s.setAttribute(d,""):Yn(s,d,g)}}}function Rn(s,i,d){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":dt("error",s),dt("load",s);var g=!1,E=!1,M;for(M in d)if(d.hasOwnProperty(M)){var H=d[M];if(H!=null)switch(M){case"src":g=!0;break;case"srcSet":E=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:Mt(s,i,M,H,d,null)}}E&&Mt(s,i,"srcSet",d.srcSet,d,null),g&&Mt(s,i,"src",d.src,d,null);return;case"input":dt("invalid",s);var Z=M=H=E=null,ne=null,de=null;for(g in d)if(d.hasOwnProperty(g)){var _e=d[g];if(_e!=null)switch(g){case"name":E=_e;break;case"type":H=_e;break;case"checked":ne=_e;break;case"defaultChecked":de=_e;break;case"value":M=_e;break;case"defaultValue":Z=_e;break;case"children":case"dangerouslySetInnerHTML":if(_e!=null)throw Error(r(137,i));break;default:Mt(s,i,g,_e,d,null)}}Oi(s,M,Z,ne,de,H,E,!1);return;case"select":dt("invalid",s),g=H=M=null;for(E in d)if(d.hasOwnProperty(E)&&(Z=d[E],Z!=null))switch(E){case"value":M=Z;break;case"defaultValue":H=Z;break;case"multiple":g=Z;default:Mt(s,i,E,Z,d,null)}i=M,d=H,s.multiple=!!g,i!=null?qs(s,!!g,i,!1):d!=null&&qs(s,!!g,d,!0);return;case"textarea":dt("invalid",s),M=E=g=null;for(H in d)if(d.hasOwnProperty(H)&&(Z=d[H],Z!=null))switch(H){case"value":g=Z;break;case"defaultValue":E=Z;break;case"children":M=Z;break;case"dangerouslySetInnerHTML":if(Z!=null)throw Error(r(91));break;default:Mt(s,i,H,Z,d,null)}Hc(s,g,E,M);return;case"option":for(ne in d)if(d.hasOwnProperty(ne)&&(g=d[ne],g!=null))switch(ne){case"selected":s.selected=g&&typeof g!="function"&&typeof g!="symbol";break;default:Mt(s,i,ne,g,d,null)}return;case"dialog":dt("beforetoggle",s),dt("toggle",s),dt("cancel",s),dt("close",s);break;case"iframe":case"object":dt("load",s);break;case"video":case"audio":for(g=0;g<jl.length;g++)dt(jl[g],s);break;case"image":dt("error",s),dt("load",s);break;case"details":dt("toggle",s);break;case"embed":case"source":case"link":dt("error",s),dt("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(de in d)if(d.hasOwnProperty(de)&&(g=d[de],g!=null))switch(de){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:Mt(s,i,de,g,d,null)}return;default:if(ps(i)){for(_e in d)d.hasOwnProperty(_e)&&(g=d[_e],g!==void 0&&Sp(s,i,_e,g,d,void 0));return}}for(Z in d)d.hasOwnProperty(Z)&&(g=d[Z],g!=null&&Mt(s,i,Z,g,d,null))}function k3(s,i,d,g){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var E=null,M=null,H=null,Z=null,ne=null,de=null,_e=null;for(me in d){var xe=d[me];if(d.hasOwnProperty(me)&&xe!=null)switch(me){case"checked":break;case"value":break;case"defaultValue":ne=xe;default:g.hasOwnProperty(me)||Mt(s,i,me,null,g,xe)}}for(var fe in g){var me=g[fe];if(xe=d[fe],g.hasOwnProperty(fe)&&(me!=null||xe!=null))switch(fe){case"type":M=me;break;case"name":E=me;break;case"checked":de=me;break;case"defaultChecked":_e=me;break;case"value":H=me;break;case"defaultValue":Z=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(r(137,i));break;default:me!==xe&&Mt(s,i,fe,me,g,xe)}}Qa(s,H,Z,ne,de,_e,M,E);return;case"select":me=H=Z=fe=null;for(M in d)if(ne=d[M],d.hasOwnProperty(M)&&ne!=null)switch(M){case"value":break;case"multiple":me=ne;default:g.hasOwnProperty(M)||Mt(s,i,M,null,g,ne)}for(E in g)if(M=g[E],ne=d[E],g.hasOwnProperty(E)&&(M!=null||ne!=null))switch(E){case"value":fe=M;break;case"defaultValue":Z=M;break;case"multiple":H=M;default:M!==ne&&Mt(s,i,E,M,g,ne)}i=Z,d=H,g=me,fe!=null?qs(s,!!d,fe,!1):!!g!=!!d&&(i!=null?qs(s,!!d,i,!0):qs(s,!!d,d?[]:"",!1));return;case"textarea":me=fe=null;for(Z in d)if(E=d[Z],d.hasOwnProperty(Z)&&E!=null&&!g.hasOwnProperty(Z))switch(Z){case"value":break;case"children":break;default:Mt(s,i,Z,null,g,E)}for(H in g)if(E=g[H],M=d[H],g.hasOwnProperty(H)&&(E!=null||M!=null))switch(H){case"value":fe=E;break;case"defaultValue":me=E;break;case"children":break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(r(91));break;default:E!==M&&Mt(s,i,H,E,g,M)}Za(s,fe,me);return;case"option":for(var qe in d)if(fe=d[qe],d.hasOwnProperty(qe)&&fe!=null&&!g.hasOwnProperty(qe))switch(qe){case"selected":s.selected=!1;break;default:Mt(s,i,qe,null,g,fe)}for(ne in g)if(fe=g[ne],me=d[ne],g.hasOwnProperty(ne)&&fe!==me&&(fe!=null||me!=null))switch(ne){case"selected":s.selected=fe&&typeof fe!="function"&&typeof fe!="symbol";break;default:Mt(s,i,ne,fe,g,me)}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 nt in d)fe=d[nt],d.hasOwnProperty(nt)&&fe!=null&&!g.hasOwnProperty(nt)&&Mt(s,i,nt,null,g,fe);for(de in g)if(fe=g[de],me=d[de],g.hasOwnProperty(de)&&fe!==me&&(fe!=null||me!=null))switch(de){case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(r(137,i));break;default:Mt(s,i,de,fe,g,me)}return;default:if(ps(i)){for(var Dt in d)fe=d[Dt],d.hasOwnProperty(Dt)&&fe!==void 0&&!g.hasOwnProperty(Dt)&&Sp(s,i,Dt,void 0,g,fe);for(_e in g)fe=g[_e],me=d[_e],!g.hasOwnProperty(_e)||fe===me||fe===void 0&&me===void 0||Sp(s,i,_e,fe,g,me);return}}for(var ae in d)fe=d[ae],d.hasOwnProperty(ae)&&fe!=null&&!g.hasOwnProperty(ae)&&Mt(s,i,ae,null,g,fe);for(xe in g)fe=g[xe],me=d[xe],!g.hasOwnProperty(xe)||fe===me||fe==null&&me==null||Mt(s,i,xe,fe,g,me)}function R_(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function E3(){if(typeof performance.getEntriesByType=="function"){for(var s=0,i=0,d=performance.getEntriesByType("resource"),g=0;g<d.length;g++){var E=d[g],M=E.transferSize,H=E.initiatorType,Z=E.duration;if(M&&Z&&R_(H)){for(H=0,Z=E.responseEnd,g+=1;g<d.length;g++){var ne=d[g],de=ne.startTime;if(de>Z)break;var _e=ne.transferSize,xe=ne.initiatorType;_e&&R_(xe)&&(ne=ne.responseEnd,H+=_e*(ne<Z?1:(Z-de)/(ne-de)))}if(--g,i+=8*(M+H)/(E.duration/1e3),s++,10<s)break}}if(0<s)return i/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var wp=null,Cp=null;function $u(s){return s.nodeType===9?s:s.ownerDocument}function T_(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function N_(s,i){if(s===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&i==="foreignObject"?0:s}function kp(s,i){return s==="textarea"||s==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var Ep=null;function A3(){var s=window.event;return s&&s.type==="popstate"?s===Ep?!1:(Ep=s,!0):(Ep=null,!1)}var M_=typeof setTimeout=="function"?setTimeout:void 0,R3=typeof clearTimeout=="function"?clearTimeout:void 0,D_=typeof Promise=="function"?Promise:void 0,T3=typeof queueMicrotask=="function"?queueMicrotask:typeof D_<"u"?function(s){return D_.resolve(null).then(s).catch(N3)}:M_;function N3(s){setTimeout(function(){throw s})}function ui(s){return s==="head"}function j_(s,i){var d=i,g=0;do{var E=d.nextSibling;if(s.removeChild(d),E&&E.nodeType===8)if(d=E.data,d==="/$"||d==="/&"){if(g===0){s.removeChild(E),da(i);return}g--}else if(d==="$"||d==="$?"||d==="$~"||d==="$!"||d==="&")g++;else if(d==="html")Ll(s.ownerDocument.documentElement);else if(d==="head"){d=s.ownerDocument.head,Ll(d);for(var M=d.firstChild;M;){var H=M.nextSibling,Z=M.nodeName;M[Fn]||Z==="SCRIPT"||Z==="STYLE"||Z==="LINK"&&M.rel.toLowerCase()==="stylesheet"||d.removeChild(M),M=H}}else d==="body"&&Ll(s.ownerDocument.body);d=E}while(d);da(i)}function O_(s,i){var d=s;s=0;do{var g=d.nextSibling;if(d.nodeType===1?i?(d._stashedDisplay=d.style.display,d.style.display="none"):(d.style.display=d._stashedDisplay||"",d.getAttribute("style")===""&&d.removeAttribute("style")):d.nodeType===3&&(i?(d._stashedText=d.nodeValue,d.nodeValue=""):d.nodeValue=d._stashedText||""),g&&g.nodeType===8)if(d=g.data,d==="/$"){if(s===0)break;s--}else d!=="$"&&d!=="$?"&&d!=="$~"&&d!=="$!"||s++;d=g}while(d)}function Ap(s){var i=s.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var d=i;switch(i=i.nextSibling,d.nodeName){case"HTML":case"HEAD":case"BODY":Ap(d),Qr(d);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(d.rel.toLowerCase()==="stylesheet")continue}s.removeChild(d)}}function M3(s,i,d,g){for(;s.nodeType===1;){var E=d;if(s.nodeName.toLowerCase()!==i.toLowerCase()){if(!g&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(g){if(!s[Fn])switch(i){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(M=s.getAttribute("rel"),M==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(M!==E.rel||s.getAttribute("href")!==(E.href==null||E.href===""?null:E.href)||s.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin)||s.getAttribute("title")!==(E.title==null?null:E.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(M=s.getAttribute("src"),(M!==(E.src==null?null:E.src)||s.getAttribute("type")!==(E.type==null?null:E.type)||s.getAttribute("crossorigin")!==(E.crossOrigin==null?null:E.crossOrigin))&&M&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(i==="input"&&s.type==="hidden"){var M=E.name==null?null:""+E.name;if(E.type==="hidden"&&s.getAttribute("name")===M)return s}else return s;if(s=Ar(s.nextSibling),s===null)break}return null}function D3(s,i,d){if(i==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!d||(s=Ar(s.nextSibling),s===null))return null;return s}function L_(s,i){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!i||(s=Ar(s.nextSibling),s===null))return null;return s}function Rp(s){return s.data==="$?"||s.data==="$~"}function Tp(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function j3(s,i){var d=s.ownerDocument;if(s.data==="$~")s._reactRetry=i;else if(s.data!=="$?"||d.readyState!=="loading")i();else{var g=function(){i(),d.removeEventListener("DOMContentLoaded",g)};d.addEventListener("DOMContentLoaded",g),s._reactRetry=g}}function Ar(s){for(;s!=null;s=s.nextSibling){var i=s.nodeType;if(i===1||i===3)break;if(i===8){if(i=s.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return s}var Np=null;function I_(s){s=s.nextSibling;for(var i=0;s;){if(s.nodeType===8){var d=s.data;if(d==="/$"||d==="/&"){if(i===0)return Ar(s.nextSibling);i--}else d!=="$"&&d!=="$!"&&d!=="$?"&&d!=="$~"&&d!=="&"||i++}s=s.nextSibling}return null}function P_(s){s=s.previousSibling;for(var i=0;s;){if(s.nodeType===8){var d=s.data;if(d==="$"||d==="$!"||d==="$?"||d==="$~"||d==="&"){if(i===0)return s;i--}else d!=="/$"&&d!=="/&"||i++}s=s.previousSibling}return null}function z_(s,i,d){switch(i=$u(d),s){case"html":if(s=i.documentElement,!s)throw Error(r(452));return s;case"head":if(s=i.head,!s)throw Error(r(453));return s;case"body":if(s=i.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}function Ll(s){for(var i=s.attributes;i.length;)s.removeAttributeNode(i[0]);Qr(s)}var Rr=new Map,B_=new Set;function qu(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var Ns=Q.d;Q.d={f:O3,r:L3,D:I3,C:P3,L:z3,m:B3,X:H3,S:F3,M:U3};function O3(){var s=Ns.f(),i=Lu();return s||i}function L3(s){var i=vn(s);i!==null&&i.tag===5&&i.type==="form"?n0(i):Ns.r(s)}var la=typeof document>"u"?null:document;function F_(s,i,d){var g=la;if(g&&typeof i=="string"&&i){var E=_n(i);E='link[rel="'+s+'"][href="'+E+'"]',typeof d=="string"&&(E+='[crossorigin="'+d+'"]'),B_.has(E)||(B_.add(E),s={rel:s,crossOrigin:d,href:i},g.querySelector(E)===null&&(i=g.createElement("link"),Rn(i,"link",s),_t(i),g.head.appendChild(i)))}}function I3(s){Ns.D(s),F_("dns-prefetch",s,null)}function P3(s,i){Ns.C(s,i),F_("preconnect",s,i)}function z3(s,i,d){Ns.L(s,i,d);var g=la;if(g&&s&&i){var E='link[rel="preload"][as="'+_n(i)+'"]';i==="image"&&d&&d.imageSrcSet?(E+='[imagesrcset="'+_n(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(E+='[imagesizes="'+_n(d.imageSizes)+'"]')):E+='[href="'+_n(s)+'"]';var M=E;switch(i){case"style":M=ca(s);break;case"script":M=ua(s)}Rr.has(M)||(s=h({rel:"preload",href:i==="image"&&d&&d.imageSrcSet?void 0:s,as:i},d),Rr.set(M,s),g.querySelector(E)!==null||i==="style"&&g.querySelector(Il(M))||i==="script"&&g.querySelector(Pl(M))||(i=g.createElement("link"),Rn(i,"link",s),_t(i),g.head.appendChild(i)))}}function B3(s,i){Ns.m(s,i);var d=la;if(d&&s){var g=i&&typeof i.as=="string"?i.as:"script",E='link[rel="modulepreload"][as="'+_n(g)+'"][href="'+_n(s)+'"]',M=E;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":M=ua(s)}if(!Rr.has(M)&&(s=h({rel:"modulepreload",href:s},i),Rr.set(M,s),d.querySelector(E)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector(Pl(M)))return}g=d.createElement("link"),Rn(g,"link",s),_t(g),d.head.appendChild(g)}}}function F3(s,i,d){Ns.S(s,i,d);var g=la;if(g&&s){var E=Hn(g).hoistableStyles,M=ca(s);i=i||"default";var H=E.get(M);if(!H){var Z={loading:0,preload:null};if(H=g.querySelector(Il(M)))Z.loading=5;else{s=h({rel:"stylesheet",href:s,"data-precedence":i},d),(d=Rr.get(M))&&Mp(s,d);var ne=H=g.createElement("link");_t(ne),Rn(ne,"link",s),ne._p=new Promise(function(de,_e){ne.onload=de,ne.onerror=_e}),ne.addEventListener("load",function(){Z.loading|=1}),ne.addEventListener("error",function(){Z.loading|=2}),Z.loading|=4,Vu(H,i,g)}H={type:"stylesheet",instance:H,count:1,state:Z},E.set(M,H)}}}function H3(s,i){Ns.X(s,i);var d=la;if(d&&s){var g=Hn(d).hoistableScripts,E=ua(s),M=g.get(E);M||(M=d.querySelector(Pl(E)),M||(s=h({src:s,async:!0},i),(i=Rr.get(E))&&Dp(s,i),M=d.createElement("script"),_t(M),Rn(M,"link",s),d.head.appendChild(M)),M={type:"script",instance:M,count:1,state:null},g.set(E,M))}}function U3(s,i){Ns.M(s,i);var d=la;if(d&&s){var g=Hn(d).hoistableScripts,E=ua(s),M=g.get(E);M||(M=d.querySelector(Pl(E)),M||(s=h({src:s,async:!0,type:"module"},i),(i=Rr.get(E))&&Dp(s,i),M=d.createElement("script"),_t(M),Rn(M,"link",s),d.head.appendChild(M)),M={type:"script",instance:M,count:1,state:null},g.set(E,M))}}function H_(s,i,d,g){var E=(E=J.current)?qu(E):null;if(!E)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof d.precedence=="string"&&typeof d.href=="string"?(i=ca(d.href),d=Hn(E).hoistableStyles,g=d.get(i),g||(g={type:"style",instance:null,count:0,state:null},d.set(i,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(d.rel==="stylesheet"&&typeof d.href=="string"&&typeof d.precedence=="string"){s=ca(d.href);var M=Hn(E).hoistableStyles,H=M.get(s);if(H||(E=E.ownerDocument||E,H={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},M.set(s,H),(M=E.querySelector(Il(s)))&&!M._p&&(H.instance=M,H.state.loading=5),Rr.has(s)||(d={rel:"preload",as:"style",href:d.href,crossOrigin:d.crossOrigin,integrity:d.integrity,media:d.media,hrefLang:d.hrefLang,referrerPolicy:d.referrerPolicy},Rr.set(s,d),M||$3(E,s,d,H.state))),i&&g===null)throw Error(r(528,""));return H}if(i&&g!==null)throw Error(r(529,""));return null;case"script":return i=d.async,d=d.src,typeof d=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=ua(d),d=Hn(E).hoistableScripts,g=d.get(i),g||(g={type:"script",instance:null,count:0,state:null},d.set(i,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function ca(s){return'href="'+_n(s)+'"'}function Il(s){return'link[rel="stylesheet"]['+s+"]"}function U_(s){return h({},s,{"data-precedence":s.precedence,precedence:null})}function $3(s,i,d,g){s.querySelector('link[rel="preload"][as="style"]['+i+"]")?g.loading=1:(i=s.createElement("link"),g.preload=i,i.addEventListener("load",function(){return g.loading|=1}),i.addEventListener("error",function(){return g.loading|=2}),Rn(i,"link",d),_t(i),s.head.appendChild(i))}function ua(s){return'[src="'+_n(s)+'"]'}function Pl(s){return"script[async]"+s}function $_(s,i,d){if(i.count++,i.instance===null)switch(i.type){case"style":var g=s.querySelector('style[data-href~="'+_n(d.href)+'"]');if(g)return i.instance=g,_t(g),g;var E=h({},d,{"data-href":d.href,"data-precedence":d.precedence,href:null,precedence:null});return g=(s.ownerDocument||s).createElement("style"),_t(g),Rn(g,"style",E),Vu(g,d.precedence,s),i.instance=g;case"stylesheet":E=ca(d.href);var M=s.querySelector(Il(E));if(M)return i.state.loading|=4,i.instance=M,_t(M),M;g=U_(d),(E=Rr.get(E))&&Mp(g,E),M=(s.ownerDocument||s).createElement("link"),_t(M);var H=M;return H._p=new Promise(function(Z,ne){H.onload=Z,H.onerror=ne}),Rn(M,"link",g),i.state.loading|=4,Vu(M,d.precedence,s),i.instance=M;case"script":return M=ua(d.src),(E=s.querySelector(Pl(M)))?(i.instance=E,_t(E),E):(g=d,(E=Rr.get(M))&&(g=h({},d),Dp(g,E)),s=s.ownerDocument||s,E=s.createElement("script"),_t(E),Rn(E,"link",g),s.head.appendChild(E),i.instance=E);case"void":return null;default:throw Error(r(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(g=i.instance,i.state.loading|=4,Vu(g,d.precedence,s));return i.instance}function Vu(s,i,d){for(var g=d.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),E=g.length?g[g.length-1]:null,M=E,H=0;H<g.length;H++){var Z=g[H];if(Z.dataset.precedence===i)M=Z;else if(M!==E)break}M?M.parentNode.insertBefore(s,M.nextSibling):(i=d.nodeType===9?d.head:d,i.insertBefore(s,i.firstChild))}function Mp(s,i){s.crossOrigin==null&&(s.crossOrigin=i.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=i.referrerPolicy),s.title==null&&(s.title=i.title)}function Dp(s,i){s.crossOrigin==null&&(s.crossOrigin=i.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=i.referrerPolicy),s.integrity==null&&(s.integrity=i.integrity)}var Wu=null;function q_(s,i,d){if(Wu===null){var g=new Map,E=Wu=new Map;E.set(d,g)}else E=Wu,g=E.get(d),g||(g=new Map,E.set(d,g));if(g.has(s))return g;for(g.set(s,null),d=d.getElementsByTagName(s),E=0;E<d.length;E++){var M=d[E];if(!(M[Fn]||M[jt]||s==="link"&&M.getAttribute("rel")==="stylesheet")&&M.namespaceURI!=="http://www.w3.org/2000/svg"){var H=M.getAttribute(i)||"";H=s+H;var Z=g.get(H);Z?Z.push(M):g.set(H,[M])}}return g}function V_(s,i,d){s=s.ownerDocument||s,s.head.insertBefore(d,i==="title"?s.querySelector("head > title"):null)}function q3(s,i,d){if(d===1||i.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return s=i.disabled,typeof i.precedence=="string"&&s==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function W_(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function V3(s,i,d,g){if(d.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(d.state.loading&4)===0){if(d.instance===null){var E=ca(g.href),M=i.querySelector(Il(E));if(M){i=M._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(s.count++,s=Gu.bind(s),i.then(s,s)),d.state.loading|=4,d.instance=M,_t(M);return}M=i.ownerDocument||i,g=U_(g),(E=Rr.get(E))&&Mp(g,E),M=M.createElement("link"),_t(M);var H=M;H._p=new Promise(function(Z,ne){H.onload=Z,H.onerror=ne}),Rn(M,"link",g),d.instance=M}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(d,i),(i=d.state.preload)&&(d.state.loading&3)===0&&(s.count++,d=Gu.bind(s),i.addEventListener("load",d),i.addEventListener("error",d))}}var jp=0;function W3(s,i){return s.stylesheets&&s.count===0&&Yu(s,s.stylesheets),0<s.count||0<s.imgCount?function(d){var g=setTimeout(function(){if(s.stylesheets&&Yu(s,s.stylesheets),s.unsuspend){var M=s.unsuspend;s.unsuspend=null,M()}},6e4+i);0<s.imgBytes&&jp===0&&(jp=62500*E3());var E=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&Yu(s,s.stylesheets),s.unsuspend)){var M=s.unsuspend;s.unsuspend=null,M()}},(s.imgBytes>jp?50:800)+i);return s.unsuspend=d,function(){s.unsuspend=null,clearTimeout(g),clearTimeout(E)}}:null}function Gu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Yu(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Ku=null;function Yu(s,i){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Ku=new Map,i.forEach(G3,s),Ku=null,Gu.call(s))}function G3(s,i){if(!(i.state.loading&4)){var d=Ku.get(s);if(d)var g=d.get(null);else{d=new Map,Ku.set(s,d);for(var E=s.querySelectorAll("link[data-precedence],style[data-precedence]"),M=0;M<E.length;M++){var H=E[M];(H.nodeName==="LINK"||H.getAttribute("media")!=="not all")&&(d.set(H.dataset.precedence,H),g=H)}g&&d.set(null,g)}E=i.instance,H=E.getAttribute("data-precedence"),M=d.get(H)||g,M===g&&d.set(null,E),d.set(H,E),this.count++,g=Gu.bind(this),E.addEventListener("load",g),E.addEventListener("error",g),M?M.parentNode.insertBefore(E,M.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(E,s.firstChild)),i.state.loading|=4}}var zl={$$typeof:S,Provider:null,Consumer:null,_currentValue:X,_currentValue2:X,_threadCount:0};function K3(s,i,d,g,E,M,H,Z,ne){this.tag=1,this.containerInfo=s,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=Wt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Wt(0),this.hiddenUpdates=Wt(null),this.identifierPrefix=g,this.onUncaughtError=E,this.onCaughtError=M,this.onRecoverableError=H,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ne,this.incompleteTransitions=new Map}function G_(s,i,d,g,E,M,H,Z,ne,de,_e,xe){return s=new K3(s,i,d,H,ne,de,_e,xe,Z),i=1,M===!0&&(i|=24),M=ir(3,null,null,i),s.current=M,M.stateNode=s,i=fh(),i.refCount++,s.pooledCache=i,i.refCount++,M.memoizedState={element:g,isDehydrated:d,cache:i},gh(M),s}function K_(s){return s?(s=Ho,s):Ho}function Y_(s,i,d,g,E,M){E=K_(E),g.context===null?g.context=E:g.pendingContext=E,g=Js(i),g.payload={element:d},M=M===void 0?null:M,M!==null&&(g.callback=M),d=ei(s,g,i),d!==null&&(er(d,s,i),gl(d,s,i))}function X_(s,i){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var d=s.retryLane;s.retryLane=d!==0&&d<i?d:i}}function Op(s,i){X_(s,i),(s=s.alternate)&&X_(s,i)}function Q_(s){if(s.tag===13||s.tag===31){var i=Gi(s,67108864);i!==null&&er(i,s,67108864),Op(s,67108864)}}function Z_(s){if(s.tag===13||s.tag===31){var i=ur();i=Gt(i);var d=Gi(s,i);d!==null&&er(d,s,i),Op(s,i)}}var Xu=!0;function Y3(s,i,d,g){var E=V.T;V.T=null;var M=Q.p;try{Q.p=2,Lp(s,i,d,g)}finally{Q.p=M,V.T=E}}function X3(s,i,d,g){var E=V.T;V.T=null;var M=Q.p;try{Q.p=8,Lp(s,i,d,g)}finally{Q.p=M,V.T=E}}function Lp(s,i,d,g){if(Xu){var E=Ip(g);if(E===null)xp(s,i,g,Qu,d),ey(s,g);else if(Z3(E,s,i,d,g))g.stopPropagation();else if(ey(s,g),i&4&&-1<Q3.indexOf(s)){for(;E!==null;){var M=vn(E);if(M!==null)switch(M.tag){case 3:if(M=M.stateNode,M.current.memoizedState.isDehydrated){var H=qt(M.pendingLanes);if(H!==0){var Z=M;for(Z.pendingLanes|=2,Z.entangledLanes|=2;H;){var ne=1<<31-we(H);Z.entanglements[1]|=ne,H&=~ne}rs(M),(kt&6)===0&&(ju=Ne()+500,Dl(0))}}break;case 31:case 13:Z=Gi(M,2),Z!==null&&er(Z,M,2),Lu(),Op(M,2)}if(M=Ip(g),M===null&&xp(s,i,g,Qu,d),M===E)break;E=M}E!==null&&g.stopPropagation()}else xp(s,i,g,null,d)}}function Ip(s){return s=Ja(s),Pp(s)}var Qu=null;function Pp(s){if(Qu=null,s=yr(s),s!==null){var i=a(s);if(i===null)s=null;else{var d=i.tag;if(d===13){if(s=c(i),s!==null)return s;s=null}else if(d===31){if(s=l(i),s!==null)return s;s=null}else if(d===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;s=null}else i!==s&&(s=null)}}return Qu=s,null}function J_(s){switch(s){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(Ge()){case ce:return 2;case ve:return 8;case Te:case je:return 32;case Le:return 268435456;default:return 32}default:return 32}}var zp=!1,di=null,fi=null,hi=null,Bl=new Map,Fl=new Map,pi=[],Q3="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 ey(s,i){switch(s){case"focusin":case"focusout":di=null;break;case"dragenter":case"dragleave":fi=null;break;case"mouseover":case"mouseout":hi=null;break;case"pointerover":case"pointerout":Bl.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Fl.delete(i.pointerId)}}function Hl(s,i,d,g,E,M){return s===null||s.nativeEvent!==M?(s={blockedOn:i,domEventName:d,eventSystemFlags:g,nativeEvent:M,targetContainers:[E]},i!==null&&(i=vn(i),i!==null&&Q_(i)),s):(s.eventSystemFlags|=g,i=s.targetContainers,E!==null&&i.indexOf(E)===-1&&i.push(E),s)}function Z3(s,i,d,g,E){switch(i){case"focusin":return di=Hl(di,s,i,d,g,E),!0;case"dragenter":return fi=Hl(fi,s,i,d,g,E),!0;case"mouseover":return hi=Hl(hi,s,i,d,g,E),!0;case"pointerover":var M=E.pointerId;return Bl.set(M,Hl(Bl.get(M)||null,s,i,d,g,E)),!0;case"gotpointercapture":return M=E.pointerId,Fl.set(M,Hl(Fl.get(M)||null,s,i,d,g,E)),!0}return!1}function ty(s){var i=yr(s.target);if(i!==null){var d=a(i);if(d!==null){if(i=d.tag,i===13){if(i=c(d),i!==null){s.blockedOn=i,Or(s.priority,function(){Z_(d)});return}}else if(i===31){if(i=l(d),i!==null){s.blockedOn=i,Or(s.priority,function(){Z_(d)});return}}else if(i===3&&d.stateNode.current.memoizedState.isDehydrated){s.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}s.blockedOn=null}function Zu(s){if(s.blockedOn!==null)return!1;for(var i=s.targetContainers;0<i.length;){var d=Ip(s.nativeEvent);if(d===null){d=s.nativeEvent;var g=new d.constructor(d.type,d);To=g,d.target.dispatchEvent(g),To=null}else return i=vn(d),i!==null&&Q_(i),s.blockedOn=d,!1;i.shift()}return!0}function ny(s,i,d){Zu(s)&&d.delete(i)}function J3(){zp=!1,di!==null&&Zu(di)&&(di=null),fi!==null&&Zu(fi)&&(fi=null),hi!==null&&Zu(hi)&&(hi=null),Bl.forEach(ny),Fl.forEach(ny)}function Ju(s,i){s.blockedOn===i&&(s.blockedOn=null,zp||(zp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,J3)))}var ed=null;function ry(s){ed!==s&&(ed=s,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){ed===s&&(ed=null);for(var i=0;i<s.length;i+=3){var d=s[i],g=s[i+1],E=s[i+2];if(typeof g!="function"){if(Pp(g||d)===null)continue;break}var M=vn(d);M!==null&&(s.splice(i,3),i-=3,Ih(M,{pending:!0,data:E,method:d.method,action:g},g,E))}}))}function da(s){function i(ne){return Ju(ne,s)}di!==null&&Ju(di,s),fi!==null&&Ju(fi,s),hi!==null&&Ju(hi,s),Bl.forEach(i),Fl.forEach(i);for(var d=0;d<pi.length;d++){var g=pi[d];g.blockedOn===s&&(g.blockedOn=null)}for(;0<pi.length&&(d=pi[0],d.blockedOn===null);)ty(d),d.blockedOn===null&&pi.shift();if(d=(s.ownerDocument||s).$$reactFormReplay,d!=null)for(g=0;g<d.length;g+=3){var E=d[g],M=d[g+1],H=E[Ut]||null;if(typeof M=="function")H||ry(d);else if(H){var Z=null;if(M&&M.hasAttribute("formAction")){if(E=M,H=M[Ut]||null)Z=H.formAction;else if(Pp(E)!==null)continue}else Z=H.action;typeof Z=="function"?d[g+1]=Z:(d.splice(g,3),g-=3),ry(d)}}}function sy(){function s(M){M.canIntercept&&M.info==="react-transition"&&M.intercept({handler:function(){return new Promise(function(H){return E=H})},focusReset:"manual",scroll:"manual"})}function i(){E!==null&&(E(),E=null),g||setTimeout(d,20)}function d(){if(!g&&!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 g=!1,E=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(d,100),function(){g=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),E!==null&&(E(),E=null)}}}function Bp(s){this._internalRoot=s}td.prototype.render=Bp.prototype.render=function(s){var i=this._internalRoot;if(i===null)throw Error(r(409));var d=i.current,g=ur();Y_(d,g,s,i,null,null)},td.prototype.unmount=Bp.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var i=s.containerInfo;Y_(s.current,2,null,s,null,null),Lu(),i[Dn]=null}};function td(s){this._internalRoot=s}td.prototype.unstable_scheduleHydration=function(s){if(s){var i=gn();s={blockedOn:null,target:s,priority:i};for(var d=0;d<pi.length&&i!==0&&i<pi[d].priority;d++);pi.splice(d,0,s),d===0&&ty(s)}};var iy=e.version;if(iy!=="19.2.4")throw Error(r(527,iy,"19.2.4"));Q.findDOMNode=function(s){var i=s._reactInternals;if(i===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=f(i),s=s!==null?p(s):null,s=s===null?null:s.stateNode,s};var e4={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var nd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!nd.isDisabled&&nd.supportsFiber)try{Pe=nd.inject(e4),Re=nd}catch{}}return $l.createRoot=function(s,i){if(!o(s))throw Error(r(299));var d=!1,g="",E=f0,M=h0,H=p0;return i!=null&&(i.unstable_strictMode===!0&&(d=!0),i.identifierPrefix!==void 0&&(g=i.identifierPrefix),i.onUncaughtError!==void 0&&(E=i.onUncaughtError),i.onCaughtError!==void 0&&(M=i.onCaughtError),i.onRecoverableError!==void 0&&(H=i.onRecoverableError)),i=G_(s,1,!1,null,null,d,g,null,E,M,H,sy),s[Dn]=i.current,bp(s),new Bp(i)},$l.hydrateRoot=function(s,i,d){if(!o(s))throw Error(r(299));var g=!1,E="",M=f0,H=h0,Z=p0,ne=null;return d!=null&&(d.unstable_strictMode===!0&&(g=!0),d.identifierPrefix!==void 0&&(E=d.identifierPrefix),d.onUncaughtError!==void 0&&(M=d.onUncaughtError),d.onCaughtError!==void 0&&(H=d.onCaughtError),d.onRecoverableError!==void 0&&(Z=d.onRecoverableError),d.formState!==void 0&&(ne=d.formState)),i=G_(s,1,!0,i,d!=null?d:null,g,E,ne,M,H,Z,sy),i.context=K_(null),d=i.current,g=ur(),g=Gt(g),E=Js(g),E.callback=null,ei(d,E,g),d=g,i.current.lanes=d,Sn(i,d),rs(i),s[Dn]=i.current,bp(s),new td(i)},$l.version="19.2.4",$l}var my;function u4(){if(my)return Up.exports;my=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Up.exports=c4(),Up.exports}var d4=u4();const gy="jean2-theme",vg="neutral",Vx="system",f4={mode:Vx,scheme:vg,setMode:()=>null,setScheme:()=>null,resolvedMode:"dark"},Wx=N.createContext(f4);function h4(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function vy(t){return t==="system"?h4():t}function p4(t){const e=localStorage.getItem(gy);if(!e||!["light","dark","system"].includes(e))return null;const r={mode:e,scheme:vg};return localStorage.setItem(t,JSON.stringify(r)),localStorage.removeItem(gy),r}function m4({children:t,defaultMode:e=Vx,defaultScheme:n=vg,storageKey:r="jean2-theme-settings",...o}){const[a,c]=N.useState(()=>{const x=p4(r);if(x)return x;const C=localStorage.getItem(r);if(C)try{const w=JSON.parse(C);if(typeof w=="object"&&w!==null&&"mode"in w&&"scheme"in w)return w}catch{}return{mode:e,scheme:n}}),[l,u]=N.useState(()=>vy(a.mode)),f=N.useCallback((x,C)=>{const w=window.document.documentElement,v=vy(x);w.classList.remove("light","dark"),w.classList.remove("neutral","ocean","forest","sunset","amethyst"),w.classList.add(v),w.classList.add(C),u(v)},[]);N.useEffect(()=>{f(a.mode,a.scheme)},[a,f]),N.useEffect(()=>{if(a.mode!=="system")return;const x=window.matchMedia("(prefers-color-scheme: dark)"),C=()=>{f(a.mode,a.scheme)};return x.addEventListener("change",C),()=>x.removeEventListener("change",C)},[a.mode,a.scheme,f]);const p=N.useCallback(x=>{const C={...a,mode:x};c(C),localStorage.setItem(r,JSON.stringify(C))},[a,r]),h=N.useCallback(x=>{const C={...a,scheme:x};c(C),localStorage.setItem(r,JSON.stringify(C))},[a,r]),_={mode:a.mode,scheme:a.scheme,setMode:p,setScheme:h,resolvedMode:l};return m.jsx(Wx.Provider,{...o,value:_,children:t})}const g4=()=>{const t=N.useContext(Wx);if(t===void 0)throw new Error("useTheme must be used within a ThemeProvider");return t};var Wp={exports:{}},Gp={};/**
50
+ * @license React
51
+ * react-compiler-runtime.production.js
52
+ *
53
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
54
+ *
55
+ * This source code is licensed under the MIT license found in the
56
+ * LICENSE file in the root directory of this source tree.
57
+ */var _y;function v4(){if(_y)return Gp;_y=1;var t=Kd().__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return Gp.c=function(e){return t.H.useMemoCache(e)},Gp}var yy;function _4(){return yy||(yy=1,Wp.exports=v4()),Wp.exports}var he=_4();const by=t=>Symbol.iterator in t,xy=t=>"entries"in t,Sy=(t,e)=>{const n=t instanceof Map?t:new Map(t.entries()),r=e instanceof Map?e:new Map(e.entries());if(n.size!==r.size)return!1;for(const[o,a]of n)if(!r.has(o)||!Object.is(a,r.get(o)))return!1;return!0},y4=(t,e)=>{const n=t[Symbol.iterator](),r=e[Symbol.iterator]();let o=n.next(),a=r.next();for(;!o.done&&!a.done;){if(!Object.is(o.value,a.value))return!1;o=n.next(),a=r.next()}return!!o.done&&!!a.done};function b4(t,e){return Object.is(t,e)?!0:typeof t!="object"||t===null||typeof e!="object"||e===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(e)?!1:by(t)&&by(e)?xy(t)&&xy(e)?Sy(t,e):y4(t,e):Sy({entries:()=>Object.entries(t)},{entries:()=>Object.entries(e)})}function oo(t){const e=Tn.useRef(void 0);return n=>{const r=t(n);return b4(e.current,r)?e.current:e.current=r}}const wy=t=>{let e;const n=new Set,r=(f,p)=>{const h=typeof f=="function"?f(e):f;if(!Object.is(h,e)){const _=e;e=(p!=null?p:typeof h!="object"||h===null)?h:Object.assign({},e,h),n.forEach(x=>x(e,_))}},o=()=>e,l={setState:r,getState:o,getInitialState:()=>u,subscribe:f=>(n.add(f),()=>n.delete(f))},u=e=t(r,o,l);return l},x4=(t=>t?wy(t):wy),S4=t=>t;function w4(t,e=S4){const n=Tn.useSyncExternalStore(t.subscribe,Tn.useCallback(()=>e(t.getState()),[t,e]),Tn.useCallback(()=>e(t.getInitialState()),[t,e]));return Tn.useDebugValue(n),n}const Cy=t=>{const e=x4(t),n=r=>w4(e,r);return Object.assign(n,e),n},yc=(t=>t?Cy(t):Cy);function _g(t){return t.role==="assistant"}const Gx=220,yg=256,Kx=512;function wd(t){return Math.max(Gx,Math.min(Kx,t))}const Yd={SESSIONS:"jean2_sessions_panel_width",FILES:"jean2_files_panel_width"};function Xd(t){return wd(t)}function C4(t){if(typeof window>"u")return t;try{const e=localStorage.getItem(Yd.SESSIONS);if(e===null)return t;const n=JSON.parse(e);return typeof n.width!="number"||isNaN(n.width)?t:Xd(n.width)}catch{return t}}function k4(t){if(!(typeof window>"u"))try{const e=Xd(t);localStorage.setItem(Yd.SESSIONS,JSON.stringify({width:e}))}catch(e){console.warn("Error saving sessions panel width:",e)}}function E4(t){if(typeof window>"u")return t;try{const e=localStorage.getItem(Yd.FILES);if(e===null)return t;const n=JSON.parse(e);return typeof n.width!="number"||isNaN(n.width)?t:Xd(n.width)}catch{return t}}function A4(t){if(!(typeof window>"u"))try{const e=Xd(t);localStorage.setItem(Yd.FILES,JSON.stringify({width:e}))}catch(e){console.warn("Error saving files panel width:",e)}}const R4=5e3,Yx="jean2_sidebar_view",T4=()=>{if(typeof window>"u")return"default";const t=localStorage.getItem(Yx);return t==="default"||t==="overview"?t:"default"},N4=()=>C4(yg),M4=()=>E4(yg),Qt=yc(t=>({showSettings:!1,showMCPDialog:!1,showFilesPanel:!1,showTerminalPanel:!1,showAddServer:!1,editServerData:null,sidebarViewMode:T4(),completionState:new Map,sessionsPanelWidth:N4(),filesPanelWidth:M4(),setShowSettings:e=>t({showSettings:e}),setShowMCPDialog:e=>t({showMCPDialog:e}),setShowFilesPanel:e=>t({showFilesPanel:e}),setShowTerminalPanel:e=>t({showTerminalPanel:e}),setShowAddServer:e=>t({showAddServer:e}),setEditServerData:e=>t({editServerData:e}),setSidebarViewMode:e=>{typeof window<"u"&&localStorage.setItem(Yx,e),t({sidebarViewMode:e})},setCompletion:(e,n)=>t(r=>{const o=new Map(r.completionState);return o.set(e,n),{completionState:o}}),clearCompletion:e=>t(n=>{const r=new Map(n.completionState);return r.delete(e),{completionState:r}}),clearAllCompletions:()=>t({completionState:new Map}),setSessionsPanelWidth:e=>{const n=wd(e);k4(n),t({sessionsPanelWidth:n})},setFilesPanelWidth:e=>{const n=wd(e);A4(n),t({filesPanelWidth:n})}})),D4=t=>e=>e.completionState.get(t),ky=R4,j4=yc(t=>({pendingPermissions:[],queuedMessages:{},clearPendingPermissions:()=>t({pendingPermissions:[]}),setPendingPermissions:e=>t({pendingPermissions:e}),mergePendingPermissions:e=>t(n=>{const r=new Set(n.pendingPermissions.map(a=>a.toolCallId)),o=e.filter(a=>!r.has(a.toolCallId));return{pendingPermissions:[...n.pendingPermissions,...o]}}),addPendingPermission:e=>t(n=>({pendingPermissions:[...n.pendingPermissions,e]})),removePendingPermissionByToolCallId:e=>t(n=>({pendingPermissions:n.pendingPermissions.filter(r=>r.toolCallId!==e)})),removePendingPermissionsBySessionId:e=>t(n=>({pendingPermissions:n.pendingPermissions.filter(r=>r.sessionId!==e)})),clearQueuedMessages:()=>t({queuedMessages:{}}),setQueuedMessagesForSession:(e,n)=>t(r=>({queuedMessages:{...r.queuedMessages,[e]:n}})),addQueuedMessage:(e,n)=>t(r=>({queuedMessages:{...r.queuedMessages,[e]:[...r.queuedMessages[e]||[],n]}})),removeQueuedMessageById:(e,n)=>t(r=>({queuedMessages:{...r.queuedMessages,[e]:(r.queuedMessages[e]||[]).filter(o=>o.id!==n)}})),removeQueuedMessagesByIds:(e,n)=>t(r=>({queuedMessages:{...r.queuedMessages,[e]:(r.queuedMessages[e]||[]).filter(o=>!n.includes(o.id))}}))})),Im=yc(t=>({streamingSessionIds:new Set,interruptedSessions:new Set,clearStreamingSessions:()=>t({streamingSessionIds:new Set}),addStreamingSession:e=>t(n=>{if(n.streamingSessionIds.has(e))return n;const r=new Set(n.streamingSessionIds);return r.add(e),{streamingSessionIds:r}}),removeStreamingSession:e=>t(n=>{if(!n.streamingSessionIds.has(e))return n;const r=new Set(n.streamingSessionIds);return r.delete(e),{streamingSessionIds:r}}),replaceStreamingSessions:e=>t({streamingSessionIds:e instanceof Set?e:new Set(e)}),addInterruptedSession:e=>t(n=>{if(n.interruptedSessions.has(e))return n;const r=new Set(n.interruptedSessions);return r.add(e),{interruptedSessions:r}}),removeInterruptedSession:e=>t(n=>{if(!n.interruptedSessions.has(e))return n;const r=new Set(n.interruptedSessions);return r.delete(e),{interruptedSessions:r}}),clearInterruptedSessions:()=>t({interruptedSessions:new Set})})),O4=yc(t=>({sessions:[],currentSession:null,setSessions:e=>t(n=>({sessions:typeof e=="function"?e(n.sessions):e})),addSessionToFront:e=>t(n=>({sessions:[e,...n.sessions]})),updateSession:e=>t(n=>({sessions:n.sessions.map(r=>r.id===e.id?e:r)})),removeSessionById:e=>t(n=>({sessions:n.sessions.filter(r=>r.id!==e)})),setCurrentSession:e=>t({currentSession:e}),clearSessionState:()=>t({sessions:[],currentSession:null})})),ql=yc((t,e)=>({messagesBySession:{},partsBySession:{},setMessagesBySession:n=>t(r=>({messagesBySession:typeof n=="function"?n(r.messagesBySession):n})),setPartsBySession:n=>t(r=>({partsBySession:typeof n=="function"?n(r.partsBySession):n})),getMessagesBySessionKeysCount:()=>Object.keys(e().messagesBySession).length})),mr={SERVERS:"jean2_servers",ACTIVE_SERVER_ID:"jean2_active_server_id",QUICK_CONNECTIONS:"jean2_quick_connections"};function Ds(){try{const t=localStorage.getItem(mr.SERVERS);return t?JSON.parse(t):[]}catch(t){return console.error("Error reading saved servers from localStorage:",t),[]}}function L4(t){return Ds().find(n=>n.id===t)||null}function I4(t){try{const e=Ds();e.push(t),localStorage.setItem(mr.SERVERS,JSON.stringify(e))}catch(e){console.error("Error saving server to localStorage:",e)}}function P4(t,e){try{const n=Ds(),r=n.findIndex(o=>o.id===t);if(r===-1){console.error("Server not found:",t);return}n[r]={...n[r],...e},localStorage.setItem(mr.SERVERS,JSON.stringify(n))}catch(n){console.error("Error updating server in localStorage:",n)}}function z4(t){try{const n=Ds().filter(c=>c.id!==t);localStorage.setItem(mr.SERVERS,JSON.stringify(n));const o=qr().filter(c=>c.serverId!==t);localStorage.setItem(mr.QUICK_CONNECTIONS,JSON.stringify(o)),Xx()===t&&localStorage.removeItem(mr.ACTIVE_SERVER_ID)}catch(e){console.error("Error deleting server from localStorage:",e)}}function Xx(){try{return localStorage.getItem(mr.ACTIVE_SERVER_ID)}catch(t){return console.error("Error reading active server ID from localStorage:",t),null}}function Kp(t){try{localStorage.setItem(mr.ACTIVE_SERVER_ID,t)}catch(e){console.error("Error setting active server ID in localStorage:",e)}}function Ey(){const t=Xx();return t?L4(t):null}function qr(){try{const t=localStorage.getItem(mr.QUICK_CONNECTIONS);return t?JSON.parse(t):[]}catch(t){return console.error("Error reading quick connections from localStorage:",t),[]}}function B4(t){const e=qr(),n=e.reduce((o,a)=>Math.max(o,a.order),-1),r={...t,id:crypto.randomUUID(),order:n+1};e.push(r);try{localStorage.setItem(mr.QUICK_CONNECTIONS,JSON.stringify(e))}catch(o){console.error("Error saving quick connection to localStorage:",o)}return r}function F4(t){try{const n=qr().filter(r=>r.id!==t);localStorage.setItem(mr.QUICK_CONNECTIONS,JSON.stringify(n))}catch(e){console.error("Error removing quick connection from localStorage:",e)}}function H4(t){try{const n=qr().filter(r=>r.workspaceId!==t);localStorage.setItem(mr.QUICK_CONNECTIONS,JSON.stringify(n))}catch(e){console.error("Error removing quick connections for workspace from localStorage:",e)}}function U4(t){try{const e=qr(),n=new Map(e.map(r=>[r.id,r]));t.forEach((r,o)=>{const a=n.get(r);a&&(a.order=o)}),localStorage.setItem(mr.QUICK_CONNECTIONS,JSON.stringify(e))}catch(e){console.error("Error reordering quick connections in localStorage:",e)}}function Qx(t){return/^[a-f0-9]{64}$/.test(t)}function $4(t){return t.length<12?t:`${t.slice(0,4)}...${t.slice(-4)}`}function Cd(t){let e=t.trim();return e=e.replace(/^(https?:\/\/|wss?:\/\/)/i,""),e=e.replace(/\/+$/,""),e}const Zx=N.createContext(null),q4=t=>{const e=he.c(30),{children:n}=t;let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=[],e[0]=r):r=e[0];const[o,a]=N.useState(r),[c,l]=N.useState(null);let u;e[1]===Symbol.for("react.memo_cache_sentinel")?(u=[],e[1]=u):u=e[1];const[f,p]=N.useState(u),[h,_]=N.useState(!1),x=N.useRef(null),C=N.useRef(!1);let w,v;e[2]===Symbol.for("react.memo_cache_sentinel")?(w=()=>{const Y=Ds(),ee=Ey(),J=qr();a(Y),l(ee),p(J)},v=[],e[2]=w,e[3]=v):(w=e[2],v=e[3]),N.useEffect(w,v);let b;e[4]===Symbol.for("react.memo_cache_sentinel")?(b=()=>{C.current=!0},e[4]=b):b=e[4];const y=b;let S;e[5]===Symbol.for("react.memo_cache_sentinel")?(S=(Y,ee,J)=>{const G=Cd(ee),q={id:crypto.randomUUID(),name:Y,url:G,token:J,createdAt:new Date().toISOString()};return I4(q),a(Ds()),Kp(q.id),l(q),q},e[5]=S):S=e[5];const k=S;let T;e[6]!==(c==null?void 0:c.id)?(T=(Y,ee)=>{const J={...ee,...ee.url&&{url:Cd(ee.url)}};P4(Y,J),a(Ds()),(c==null?void 0:c.id)===Y&&l(Ey())},e[6]=c==null?void 0:c.id,e[7]=T):T=e[7];const R=T;let D;e[8]!==(c==null?void 0:c.id)?(D=Y=>{const ee=(c==null?void 0:c.id)===Y;if(z4(Y),a(Ds()),ee){const J=Ds(),G=J.length>0?J[0]:null;G?(Kp(G.id),l(G)):l(null)}p(qr())},e[8]=c==null?void 0:c.id,e[9]=D):D=e[9];const A=D;let j;e[10]!==(c==null?void 0:c.id)||e[11]!==h||e[12]!==o?(j=Y=>(x.current&&(clearTimeout(x.current),x.current=null),h&&(c==null?void 0:c.id)===Y?!1:(h&&_(!1),_(!0),x.current=setTimeout(()=>{Kp(Y);const ee=o.find(J=>J.id===Y)||null;l(ee),_(!1)},100),!0)),e[10]=c==null?void 0:c.id,e[11]=h,e[12]=o,e[13]=j):j=e[13];const O=j;let P;e[14]===Symbol.for("react.memo_cache_sentinel")?(P=()=>{_(!1)},e[14]=P):P=e[14];const $=P;let U;e[15]===Symbol.for("react.memo_cache_sentinel")?(U=(Y,ee,J,G)=>{B4({serverId:Y,serverName:ee,workspaceId:J,workspaceName:G}),p(qr())},e[15]=U):U=e[15];const W=U;let K;e[16]===Symbol.for("react.memo_cache_sentinel")?(K=Y=>{F4(Y),p(qr())},e[16]=K):K=e[16];const V=K;let Q;e[17]===Symbol.for("react.memo_cache_sentinel")?(Q=Y=>{H4(Y),p(qr())},e[17]=Q):Q=e[17];const X=Q;let I;e[18]===Symbol.for("react.memo_cache_sentinel")?(I=Y=>{U4(Y),p(qr())},e[18]=I):I=e[18];const L=I;let z;e[19]!==c||e[20]!==R||e[21]!==h||e[22]!==f||e[23]!==A||e[24]!==o||e[25]!==O?(z={servers:o,activeServer:c,quickConnections:f,isSwitching:h,isAddingServerRef:C,prepareForServerAdd:y,addServer:k,editServer:R,removeServer:A,switchServer:O,clearSwitchingState:$,addToQuickConnections:W,removeFromQuickConnections:V,removeFromQuickConnectionsByWorkspace:X,reorderQuick:L},e[19]=c,e[20]=R,e[21]=h,e[22]=f,e[23]=A,e[24]=o,e[25]=O,e[26]=z):z=e[26];const F=z;let B;return e[27]!==n||e[28]!==F?(B=m.jsx(Zx.Provider,{value:F,children:n}),e[27]=n,e[28]=F,e[29]=B):B=e[29],B},ja=()=>{const t=N.useContext(Zx);if(t===null)throw new Error("useServerContext must be used within a ServerProvider");return t};/**
58
+ * @license lucide-react v0.577.0 - ISC
59
+ *
60
+ * This source code is licensed under the ISC license.
61
+ * See the LICENSE file in the root directory of this source tree.
62
+ */const Jx=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
63
+ * @license lucide-react v0.577.0 - ISC
64
+ *
65
+ * This source code is licensed under the ISC license.
66
+ * See the LICENSE file in the root directory of this source tree.
67
+ */const V4=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
68
+ * @license lucide-react v0.577.0 - ISC
69
+ *
70
+ * This source code is licensed under the ISC license.
71
+ * See the LICENSE file in the root directory of this source tree.
72
+ */const W4=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
73
+ * @license lucide-react v0.577.0 - ISC
74
+ *
75
+ * This source code is licensed under the ISC license.
76
+ * See the LICENSE file in the root directory of this source tree.
77
+ */const Ay=t=>{const e=W4(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
78
+ * @license lucide-react v0.577.0 - ISC
79
+ *
80
+ * This source code is licensed under the ISC license.
81
+ * See the LICENSE file in the root directory of this source tree.
82
+ */var G4={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"};/**
83
+ * @license lucide-react v0.577.0 - ISC
84
+ *
85
+ * This source code is licensed under the ISC license.
86
+ * See the LICENSE file in the root directory of this source tree.
87
+ */const K4=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};/**
88
+ * @license lucide-react v0.577.0 - ISC
89
+ *
90
+ * This source code is licensed under the ISC license.
91
+ * See the LICENSE file in the root directory of this source tree.
92
+ */const Y4=N.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:a,iconNode:c,...l},u)=>N.createElement("svg",{ref:u,...G4,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:Jx("lucide",o),...!a&&!K4(l)&&{"aria-hidden":"true"},...l},[...c.map(([f,p])=>N.createElement(f,p)),...Array.isArray(a)?a:[a]]));/**
93
+ * @license lucide-react v0.577.0 - ISC
94
+ *
95
+ * This source code is licensed under the ISC license.
96
+ * See the LICENSE file in the root directory of this source tree.
97
+ */const ze=(t,e)=>{const n=N.forwardRef(({className:r,...o},a)=>N.createElement(Y4,{ref:a,iconNode:e,className:Jx(`lucide-${V4(Ay(t))}`,`lucide-${t}`,r),...o}));return n.displayName=Ay(t),n};/**
98
+ * @license lucide-react v0.577.0 - ISC
99
+ *
100
+ * This source code is licensed under the ISC license.
101
+ * See the LICENSE file in the root directory of this source tree.
102
+ */const X4=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],Q4=ze("archive",X4);/**
103
+ * @license lucide-react v0.577.0 - ISC
104
+ *
105
+ * This source code is licensed under the ISC license.
106
+ * See the LICENSE file in the root directory of this source tree.
107
+ */const Z4=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],J4=ze("arrow-down",Z4);/**
108
+ * @license lucide-react v0.577.0 - ISC
109
+ *
110
+ * This source code is licensed under the ISC license.
111
+ * See the LICENSE file in the root directory of this source tree.
112
+ */const e5=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],t5=ze("arrow-left",e5);/**
113
+ * @license lucide-react v0.577.0 - ISC
114
+ *
115
+ * This source code is licensed under the ISC license.
116
+ * See the LICENSE file in the root directory of this source tree.
117
+ */const n5=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],r5=ze("bot",n5);/**
118
+ * @license lucide-react v0.577.0 - ISC
119
+ *
120
+ * This source code is licensed under the ISC license.
121
+ * See the LICENSE file in the root directory of this source tree.
122
+ */const s5=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],Pm=ze("box",s5);/**
123
+ * @license lucide-react v0.577.0 - ISC
124
+ *
125
+ * This source code is licensed under the ISC license.
126
+ * See the LICENSE file in the root directory of this source tree.
127
+ */const i5=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],Ry=ze("brain",i5);/**
128
+ * @license lucide-react v0.577.0 - ISC
129
+ *
130
+ * This source code is licensed under the ISC license.
131
+ * See the LICENSE file in the root directory of this source tree.
132
+ */const o5=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ls=ze("check",o5);/**
133
+ * @license lucide-react v0.577.0 - ISC
134
+ *
135
+ * This source code is licensed under the ISC license.
136
+ * See the LICENSE file in the root directory of this source tree.
137
+ */const a5=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Oa=ze("chevron-down",a5);/**
138
+ * @license lucide-react v0.577.0 - ISC
139
+ *
140
+ * This source code is licensed under the ISC license.
141
+ * See the LICENSE file in the root directory of this source tree.
142
+ */const l5=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],c5=ze("chevron-left",l5);/**
143
+ * @license lucide-react v0.577.0 - ISC
144
+ *
145
+ * This source code is licensed under the ISC license.
146
+ * See the LICENSE file in the root directory of this source tree.
147
+ */const u5=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Wr=ze("chevron-right",u5);/**
148
+ * @license lucide-react v0.577.0 - ISC
149
+ *
150
+ * This source code is licensed under the ISC license.
151
+ * See the LICENSE file in the root directory of this source tree.
152
+ */const d5=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],f5=ze("chevron-up",d5);/**
153
+ * @license lucide-react v0.577.0 - ISC
154
+ *
155
+ * This source code is licensed under the ISC license.
156
+ * See the LICENSE file in the root directory of this source tree.
157
+ */const h5=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],eS=ze("chevrons-up-down",h5);/**
158
+ * @license lucide-react v0.577.0 - ISC
159
+ *
160
+ * This source code is licensed under the ISC license.
161
+ * See the LICENSE file in the root directory of this source tree.
162
+ */const p5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],rc=ze("circle-alert",p5);/**
163
+ * @license lucide-react v0.577.0 - ISC
164
+ *
165
+ * This source code is licensed under the ISC license.
166
+ * See the LICENSE file in the root directory of this source tree.
167
+ */const m5=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],bc=ze("circle-check-big",m5);/**
168
+ * @license lucide-react v0.577.0 - ISC
169
+ *
170
+ * This source code is licensed under the ISC license.
171
+ * See the LICENSE file in the root directory of this source tree.
172
+ */const g5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],v5=ze("circle-check",g5);/**
173
+ * @license lucide-react v0.577.0 - ISC
174
+ *
175
+ * This source code is licensed under the ISC license.
176
+ * See the LICENSE file in the root directory of this source tree.
177
+ */const _5=[["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"}]],Qd=ze("circle-x",_5);/**
178
+ * @license lucide-react v0.577.0 - ISC
179
+ *
180
+ * This source code is licensed under the ISC license.
181
+ * See the LICENSE file in the root directory of this source tree.
182
+ */const y5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],b5=ze("circle",y5);/**
183
+ * @license lucide-react v0.577.0 - ISC
184
+ *
185
+ * This source code is licensed under the ISC license.
186
+ * See the LICENSE file in the root directory of this source tree.
187
+ */const x5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],tS=ze("clock",x5);/**
188
+ * @license lucide-react v0.577.0 - ISC
189
+ *
190
+ * This source code is licensed under the ISC license.
191
+ * See the LICENSE file in the root directory of this source tree.
192
+ */const S5=[["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["circle",{cx:"12",cy:"12",r:"8",key:"46899m"}]],w5=ze("cog",S5);/**
193
+ * @license lucide-react v0.577.0 - ISC
194
+ *
195
+ * This source code is licensed under the ISC license.
196
+ * See the LICENSE file in the root directory of this source tree.
197
+ */const C5=[["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"}]],ac=ze("copy",C5);/**
198
+ * @license lucide-react v0.577.0 - ISC
199
+ *
200
+ * This source code is licensed under the ISC license.
201
+ * See the LICENSE file in the root directory of this source tree.
202
+ */const k5=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],Ty=ze("cpu",k5);/**
203
+ * @license lucide-react v0.577.0 - ISC
204
+ *
205
+ * This source code is licensed under the ISC license.
206
+ * See the LICENSE file in the root directory of this source tree.
207
+ */const E5=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],nS=ze("ellipsis",E5);/**
208
+ * @license lucide-react v0.577.0 - ISC
209
+ *
210
+ * This source code is licensed under the ISC license.
211
+ * See the LICENSE file in the root directory of this source tree.
212
+ */const A5=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],zm=ze("external-link",A5);/**
213
+ * @license lucide-react v0.577.0 - ISC
214
+ *
215
+ * This source code is licensed under the ISC license.
216
+ * See the LICENSE file in the root directory of this source tree.
217
+ */const R5=[["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"}]],T5=ze("eye-off",R5);/**
218
+ * @license lucide-react v0.577.0 - ISC
219
+ *
220
+ * This source code is licensed under the ISC license.
221
+ * See the LICENSE file in the root directory of this source tree.
222
+ */const N5=[["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"}]],rS=ze("eye",N5);/**
223
+ * @license lucide-react v0.577.0 - ISC
224
+ *
225
+ * This source code is licensed under the ISC license.
226
+ * See the LICENSE file in the root directory of this source tree.
227
+ */const M5=[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]],D5=ze("file-pen",M5);/**
228
+ * @license lucide-react v0.577.0 - ISC
229
+ *
230
+ * This source code is licensed under the ISC license.
231
+ * See the LICENSE file in the root directory of this source tree.
232
+ */const j5=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],bg=ze("file-text",j5);/**
233
+ * @license lucide-react v0.577.0 - ISC
234
+ *
235
+ * This source code is licensed under the ISC license.
236
+ * See the LICENSE file in the root directory of this source tree.
237
+ */const O5=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],ss=ze("file",O5);/**
238
+ * @license lucide-react v0.577.0 - ISC
239
+ *
240
+ * This source code is licensed under the ISC license.
241
+ * See the LICENSE file in the root directory of this source tree.
242
+ */const L5=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Bm=ze("folder-open",L5);/**
243
+ * @license lucide-react v0.577.0 - ISC
244
+ *
245
+ * This source code is licensed under the ISC license.
246
+ * See the LICENSE file in the root directory of this source tree.
247
+ */const I5=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],js=ze("folder",I5);/**
248
+ * @license lucide-react v0.577.0 - ISC
249
+ *
250
+ * This source code is licensed under the ISC license.
251
+ * See the LICENSE file in the root directory of this source tree.
252
+ */const P5=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],z5=ze("git-branch",P5);/**
253
+ * @license lucide-react v0.577.0 - ISC
254
+ *
255
+ * This source code is licensed under the ISC license.
256
+ * See the LICENSE file in the root directory of this source tree.
257
+ */const B5=[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]],F5=ze("hard-drive",B5);/**
258
+ * @license lucide-react v0.577.0 - ISC
259
+ *
260
+ * This source code is licensed under the ISC license.
261
+ * See the LICENSE file in the root directory of this source tree.
262
+ */const H5=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],U5=ze("info",H5);/**
263
+ * @license lucide-react v0.577.0 - ISC
264
+ *
265
+ * This source code is licensed under the ISC license.
266
+ * See the LICENSE file in the root directory of this source tree.
267
+ */const $5=[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]],q5=ze("keyboard",$5);/**
268
+ * @license lucide-react v0.577.0 - ISC
269
+ *
270
+ * This source code is licensed under the ISC license.
271
+ * See the LICENSE file in the root directory of this source tree.
272
+ */const V5=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],W5=ze("layout-grid",V5);/**
273
+ * @license lucide-react v0.577.0 - ISC
274
+ *
275
+ * This source code is licensed under the ISC license.
276
+ * See the LICENSE file in the root directory of this source tree.
277
+ */const G5=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}],["path",{d:"M14 4h7",key:"3xa0d5"}],["path",{d:"M14 9h7",key:"1icrd9"}],["path",{d:"M14 15h7",key:"1mj8o2"}],["path",{d:"M14 20h7",key:"11slyb"}]],K5=ze("layout-list",G5);/**
278
+ * @license lucide-react v0.577.0 - ISC
279
+ *
280
+ * This source code is licensed under the ISC license.
281
+ * See the LICENSE file in the root directory of this source tree.
282
+ */const Y5=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],X5=ze("link-2",Y5);/**
283
+ * @license lucide-react v0.577.0 - ISC
284
+ *
285
+ * This source code is licensed under the ISC license.
286
+ * See the LICENSE file in the root directory of this source tree.
287
+ */const Q5=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],pr=ze("loader-circle",Q5);/**
288
+ * @license lucide-react v0.577.0 - ISC
289
+ *
290
+ * This source code is licensed under the ISC license.
291
+ * See the LICENSE file in the root directory of this source tree.
292
+ */const Z5=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],J5=ze("lock",Z5);/**
293
+ * @license lucide-react v0.577.0 - ISC
294
+ *
295
+ * This source code is licensed under the ISC license.
296
+ * See the LICENSE file in the root directory of this source tree.
297
+ */const eA=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],tA=ze("message-square",eA);/**
298
+ * @license lucide-react v0.577.0 - ISC
299
+ *
300
+ * This source code is licensed under the ISC license.
301
+ * See the LICENSE file in the root directory of this source tree.
302
+ */const nA=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],sS=ze("minimize-2",nA);/**
303
+ * @license lucide-react v0.577.0 - ISC
304
+ *
305
+ * This source code is licensed under the ISC license.
306
+ * See the LICENSE file in the root directory of this source tree.
307
+ */const rA=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],sA=ze("monitor",rA);/**
308
+ * @license lucide-react v0.577.0 - ISC
309
+ *
310
+ * This source code is licensed under the ISC license.
311
+ * See the LICENSE file in the root directory of this source tree.
312
+ */const iA=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],oA=ze("moon",iA);/**
313
+ * @license lucide-react v0.577.0 - ISC
314
+ *
315
+ * This source code is licensed under the ISC license.
316
+ * See the LICENSE file in the root directory of this source tree.
317
+ */const aA=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],lA=ze("palette",aA);/**
318
+ * @license lucide-react v0.577.0 - ISC
319
+ *
320
+ * This source code is licensed under the ISC license.
321
+ * See the LICENSE file in the root directory of this source tree.
322
+ */const cA=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],uA=ze("panel-left",cA);/**
323
+ * @license lucide-react v0.577.0 - ISC
324
+ *
325
+ * This source code is licensed under the ISC license.
326
+ * See the LICENSE file in the root directory of this source tree.
327
+ */const dA=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],iS=ze("pause",dA);/**
328
+ * @license lucide-react v0.577.0 - ISC
329
+ *
330
+ * This source code is licensed under the ISC license.
331
+ * See the LICENSE file in the root directory of this source tree.
332
+ */const fA=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],hA=ze("pencil",fA);/**
333
+ * @license lucide-react v0.577.0 - ISC
334
+ *
335
+ * This source code is licensed under the ISC license.
336
+ * See the LICENSE file in the root directory of this source tree.
337
+ */const pA=[["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m18 3-4 4h6l-4 4",key:"16psg9"}]],mA=ze("plug-zap",pA);/**
338
+ * @license lucide-react v0.577.0 - ISC
339
+ *
340
+ * This source code is licensed under the ISC license.
341
+ * See the LICENSE file in the root directory of this source tree.
342
+ */const gA=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],vA=ze("plug",gA);/**
343
+ * @license lucide-react v0.577.0 - ISC
344
+ *
345
+ * This source code is licensed under the ISC license.
346
+ * See the LICENSE file in the root directory of this source tree.
347
+ */const _A=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],La=ze("plus",_A);/**
348
+ * @license lucide-react v0.577.0 - ISC
349
+ *
350
+ * This source code is licensed under the ISC license.
351
+ * See the LICENSE file in the root directory of this source tree.
352
+ */const yA=[["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"}]],ho=ze("refresh-cw",yA);/**
353
+ * @license lucide-react v0.577.0 - ISC
354
+ *
355
+ * This source code is licensed under the ISC license.
356
+ * See the LICENSE file in the root directory of this source tree.
357
+ */const bA=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],oS=ze("rotate-ccw",bA);/**
358
+ * @license lucide-react v0.577.0 - ISC
359
+ *
360
+ * This source code is licensed under the ISC license.
361
+ * See the LICENSE file in the root directory of this source tree.
362
+ */const xA=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],xg=ze("search",xA);/**
363
+ * @license lucide-react v0.577.0 - ISC
364
+ *
365
+ * This source code is licensed under the ISC license.
366
+ * See the LICENSE file in the root directory of this source tree.
367
+ */const SA=[["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"}]],wA=ze("send",SA);/**
368
+ * @license lucide-react v0.577.0 - ISC
369
+ *
370
+ * This source code is licensed under the ISC license.
371
+ * See the LICENSE file in the root directory of this source tree.
372
+ */const CA=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],po=ze("server",CA);/**
373
+ * @license lucide-react v0.577.0 - ISC
374
+ *
375
+ * This source code is licensed under the ISC license.
376
+ * See the LICENSE file in the root directory of this source tree.
377
+ */const kA=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],aS=ze("settings",kA);/**
378
+ * @license lucide-react v0.577.0 - ISC
379
+ *
380
+ * This source code is licensed under the ISC license.
381
+ * See the LICENSE file in the root directory of this source tree.
382
+ */const EA=[["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"}]],lS=ze("shield",EA);/**
383
+ * @license lucide-react v0.577.0 - ISC
384
+ *
385
+ * This source code is licensed under the ISC license.
386
+ * See the LICENSE file in the root directory of this source tree.
387
+ */const AA=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],Ny=ze("square-terminal",AA);/**
388
+ * @license lucide-react v0.577.0 - ISC
389
+ *
390
+ * This source code is licensed under the ISC license.
391
+ * See the LICENSE file in the root directory of this source tree.
392
+ */const RA=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],cS=ze("square",RA);/**
393
+ * @license lucide-react v0.577.0 - ISC
394
+ *
395
+ * This source code is licensed under the ISC license.
396
+ * See the LICENSE file in the root directory of this source tree.
397
+ */const TA=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],My=ze("star",TA);/**
398
+ * @license lucide-react v0.577.0 - ISC
399
+ *
400
+ * This source code is licensed under the ISC license.
401
+ * See the LICENSE file in the root directory of this source tree.
402
+ */const NA=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],MA=ze("sun",NA);/**
403
+ * @license lucide-react v0.577.0 - ISC
404
+ *
405
+ * This source code is licensed under the ISC license.
406
+ * See the LICENSE file in the root directory of this source tree.
407
+ */const DA=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Dy=ze("terminal",DA);/**
408
+ * @license lucide-react v0.577.0 - ISC
409
+ *
410
+ * This source code is licensed under the ISC license.
411
+ * See the LICENSE file in the root directory of this source tree.
412
+ */const jA=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Ia=ze("trash-2",jA);/**
413
+ * @license lucide-react v0.577.0 - ISC
414
+ *
415
+ * This source code is licensed under the ISC license.
416
+ * See the LICENSE file in the root directory of this source tree.
417
+ */const OA=[["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"}]],lc=ze("triangle-alert",OA);/**
418
+ * @license lucide-react v0.577.0 - ISC
419
+ *
420
+ * This source code is licensed under the ISC license.
421
+ * See the LICENSE file in the root directory of this source tree.
422
+ */const LA=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],IA=ze("undo-2",LA);/**
423
+ * @license lucide-react v0.577.0 - ISC
424
+ *
425
+ * This source code is licensed under the ISC license.
426
+ * See the LICENSE file in the root directory of this source tree.
427
+ */const PA=[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]],zA=ze("unplug",PA);/**
428
+ * @license lucide-react v0.577.0 - ISC
429
+ *
430
+ * This source code is licensed under the ISC license.
431
+ * See the LICENSE file in the root directory of this source tree.
432
+ */const BA=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],uS=ze("user",BA);/**
433
+ * @license lucide-react v0.577.0 - ISC
434
+ *
435
+ * This source code is licensed under the ISC license.
436
+ * See the LICENSE file in the root directory of this source tree.
437
+ */const FA=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]],HA=ze("volume-2",FA);/**
438
+ * @license lucide-react v0.577.0 - ISC
439
+ *
440
+ * This source code is licensed under the ISC license.
441
+ * See the LICENSE file in the root directory of this source tree.
442
+ */const UA=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]],$A=ze("volume-x",UA);/**
443
+ * @license lucide-react v0.577.0 - ISC
444
+ *
445
+ * This source code is licensed under the ISC license.
446
+ * See the LICENSE file in the root directory of this source tree.
447
+ */const qA=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],dS=ze("wifi-off",qA);/**
448
+ * @license lucide-react v0.577.0 - ISC
449
+ *
450
+ * This source code is licensed under the ISC license.
451
+ * See the LICENSE file in the root directory of this source tree.
452
+ */const VA=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],WA=ze("wifi",VA);/**
453
+ * @license lucide-react v0.577.0 - ISC
454
+ *
455
+ * This source code is licensed under the ISC license.
456
+ * See the LICENSE file in the root directory of this source tree.
457
+ */const GA=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],KA=ze("wrench",GA);/**
458
+ * @license lucide-react v0.577.0 - ISC
459
+ *
460
+ * This source code is licensed under the ISC license.
461
+ * See the LICENSE file in the root directory of this source tree.
462
+ */const YA=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Os=ze("x",YA);/**
463
+ * @license lucide-react v0.577.0 - ISC
464
+ *
465
+ * This source code is licensed under the ISC license.
466
+ * See the LICENSE file in the root directory of this source tree.
467
+ */const XA=[["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"}]],Yp=ze("zap",XA);function fS(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(n=fS(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function Zd(){for(var t,e,n=0,r="",o=arguments.length;n<o;n++)(t=arguments[n])&&(e=fS(t))&&(r&&(r+=" "),r+=e);return r}const jy=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Oy=Zd,Pa=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return Oy(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:a}=e,c=Object.keys(o).map(f=>{const p=n==null?void 0:n[f],h=a==null?void 0:a[f];if(p===null)return null;const _=jy(p)||jy(h);return o[f][_]}),l=n&&Object.entries(n).reduce((f,p)=>{let[h,_]=p;return _===void 0||(f[h]=_),f},{}),u=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((f,p)=>{let{class:h,className:_,...x}=p;return Object.entries(x).every(C=>{let[w,v]=C;return Array.isArray(v)?v.includes({...a,...l}[w]):{...a,...l}[w]===v})?[...f,h,_]:f},[]);return Oy(t,c,u,n==null?void 0:n.class,n==null?void 0:n.className)};var za=qx();const QA=Gd(za);function Ly(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Is(...t){return e=>{let n=!1;const r=t.map(o=>{const a=Ly(o,e);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let o=0;o<r.length;o++){const a=r[o];typeof a=="function"?a():Ly(t[o],null)}}}}function ct(...t){return N.useCallback(Is(...t),t)}function xi(t){const e=ZA(t),n=N.forwardRef((r,o)=>{const{children:a,...c}=r,l=N.Children.toArray(a),u=l.find(eR);if(u){const f=u.props.children,p=l.map(h=>h===u?N.Children.count(f)>1?N.Children.only(null):N.isValidElement(f)?f.props.children:null:h);return m.jsx(e,{...c,ref:o,children:N.isValidElement(f)?N.cloneElement(f,void 0,p):null})}return m.jsx(e,{...c,ref:o,children:a})});return n.displayName=`${t}.Slot`,n}var xc=xi("Slot");function ZA(t){const e=N.forwardRef((n,r)=>{const{children:o,...a}=n;if(N.isValidElement(o)){const c=nR(o),l=tR(a,o.props);return o.type!==N.Fragment&&(l.ref=r?Is(r,c):c),N.cloneElement(o,l)}return N.Children.count(o)>1?N.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var hS=Symbol("radix.slottable");function JA(t){const e=({children:n})=>m.jsx(m.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=hS,e}function eR(t){return N.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===hS}function tR(t,e){const n={...e};for(const r in e){const o=t[r],a=e[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...l)=>{const u=a(...l);return o(...l),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...t,...n}}function nR(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var rR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Xe=rR.reduce((t,e)=>{const n=xi(`Primitive.${e}`),r=N.forwardRef((o,a)=>{const{asChild:c,...l}=o,u=c?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(u,{...l,ref:a})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function pS(t,e){t&&za.flushSync(()=>t.dispatchEvent(e))}var mS=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),sR="VisuallyHidden",gS=N.forwardRef((t,e)=>m.jsx(Xe.span,{...t,ref:e,style:{...mS,...t.style}}));gS.displayName=sR;var iR=gS;function oR(t,e){const n=N.createContext(e),r=a=>{const{children:c,...l}=a,u=N.useMemo(()=>l,Object.values(l));return m.jsx(n.Provider,{value:u,children:c})};r.displayName=t+"Provider";function o(a){const c=N.useContext(n);if(c)return c;if(e!==void 0)return e;throw new Error(`\`${a}\` must be used within \`${t}\``)}return[r,o]}function _r(t,e=[]){let n=[];function r(a,c){const l=N.createContext(c),u=n.length;n=[...n,c];const f=h=>{var b;const{scope:_,children:x,...C}=h,w=((b=_==null?void 0:_[t])==null?void 0:b[u])||l,v=N.useMemo(()=>C,Object.values(C));return m.jsx(w.Provider,{value:v,children:x})};f.displayName=a+"Provider";function p(h,_){var w;const x=((w=_==null?void 0:_[t])==null?void 0:w[u])||l,C=N.useContext(x);if(C)return C;if(c!==void 0)return c;throw new Error(`\`${h}\` must be used within \`${a}\``)}return[f,p]}const o=()=>{const a=n.map(c=>N.createContext(c));return function(l){const u=(l==null?void 0:l[t])||a;return N.useMemo(()=>({[`__scope${t}`]:{...l,[t]:u}}),[l,u])}};return o.scopeName=t,[r,aR(o,...e)]}function aR(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){const c=r.reduce((l,{useScope:u,scopeName:f})=>{const h=u(a)[`__scope${f}`];return{...l,...h}},{});return N.useMemo(()=>({[`__scope${e.scopeName}`]:c}),[c])}};return n.scopeName=e.scopeName,n}function Sg(t){const e=t+"CollectionProvider",[n,r]=_r(e),[o,a]=n(e,{collectionRef:{current:null},itemMap:new Map}),c=w=>{const{scope:v,children:b}=w,y=Tn.useRef(null),S=Tn.useRef(new Map).current;return m.jsx(o,{scope:v,itemMap:S,collectionRef:y,children:b})};c.displayName=e;const l=t+"CollectionSlot",u=xi(l),f=Tn.forwardRef((w,v)=>{const{scope:b,children:y}=w,S=a(l,b),k=ct(v,S.collectionRef);return m.jsx(u,{ref:k,children:y})});f.displayName=l;const p=t+"CollectionItemSlot",h="data-radix-collection-item",_=xi(p),x=Tn.forwardRef((w,v)=>{const{scope:b,children:y,...S}=w,k=Tn.useRef(null),T=ct(v,k),R=a(p,b);return Tn.useEffect(()=>(R.itemMap.set(k,{ref:k,...S}),()=>void R.itemMap.delete(k))),m.jsx(_,{[h]:"",ref:T,children:y})});x.displayName=p;function C(w){const v=a(t+"CollectionConsumer",w);return Tn.useCallback(()=>{const y=v.collectionRef.current;if(!y)return[];const S=Array.from(y.querySelectorAll(`[${h}]`));return Array.from(v.itemMap.values()).sort((R,D)=>S.indexOf(R.ref.current)-S.indexOf(D.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:c,Slot:f,ItemSlot:x},C,r]}function Ie(t,e,{checkForDefaultPrevented:n=!0}={}){return function(o){if(t==null||t(o),n===!1||!o.defaultPrevented)return e==null?void 0:e(o)}}var bn=globalThis!=null&&globalThis.document?N.useLayoutEffect:()=>{},lR=$x[" useInsertionEffect ".trim().toString()]||bn;function Ps({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[o,a,c]=cR({defaultProp:e,onChange:n}),l=t!==void 0,u=l?t:o;{const p=N.useRef(t!==void 0);N.useEffect(()=>{const h=p.current;h!==l&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=l},[l,r])}const f=N.useCallback(p=>{var h;if(l){const _=uR(p)?p(t):p;_!==t&&((h=c.current)==null||h.call(c,_))}else a(p)},[l,t,a,c]);return[u,f]}function cR({defaultProp:t,onChange:e}){const[n,r]=N.useState(t),o=N.useRef(n),a=N.useRef(e);return lR(()=>{a.current=e},[e]),N.useEffect(()=>{var c;o.current!==n&&((c=a.current)==null||c.call(a,n),o.current=n)},[n,o]),[n,r,a]}function uR(t){return typeof t=="function"}function dR(t,e){return N.useReducer((n,r)=>{const o=e[n][r];return o!=null?o:n},t)}var xn=t=>{const{present:e,children:n}=t,r=fR(e),o=typeof n=="function"?n({present:r.isPresent}):N.Children.only(n),a=ct(r.ref,hR(o));return typeof n=="function"||r.isPresent?N.cloneElement(o,{ref:a}):null};xn.displayName="Presence";function fR(t){const[e,n]=N.useState(),r=N.useRef(null),o=N.useRef(t),a=N.useRef("none"),c=t?"mounted":"unmounted",[l,u]=dR(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return N.useEffect(()=>{const f=rd(r.current);a.current=l==="mounted"?f:"none"},[l]),bn(()=>{const f=r.current,p=o.current;if(p!==t){const _=a.current,x=rd(f);t?u("MOUNT"):x==="none"||(f==null?void 0:f.display)==="none"?u("UNMOUNT"):u(p&&_!==x?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,u]),bn(()=>{var f;if(e){let p;const h=(f=e.ownerDocument.defaultView)!=null?f:window,_=C=>{const v=rd(r.current).includes(CSS.escape(C.animationName));if(C.target===e&&v&&(u("ANIMATION_END"),!o.current)){const b=e.style.animationFillMode;e.style.animationFillMode="forwards",p=h.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=b)})}},x=C=>{C.target===e&&(a.current=rd(r.current))};return e.addEventListener("animationstart",x),e.addEventListener("animationcancel",_),e.addEventListener("animationend",_),()=>{h.clearTimeout(p),e.removeEventListener("animationstart",x),e.removeEventListener("animationcancel",_),e.removeEventListener("animationend",_)}}else u("ANIMATION_END")},[e,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:N.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function rd(t){return(t==null?void 0:t.animationName)||"none"}function hR(t){var r,o;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var pR=$x[" useId ".trim().toString()]||(()=>{}),mR=0;function mn(t){const[e,n]=N.useState(pR());return bn(()=>{n(r=>r!=null?r:String(mR++))},[t]),e?`radix-${e}`:""}var Jd="Collapsible",[gR]=_r(Jd),[vR,wg]=gR(Jd),vS=N.forwardRef((t,e)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:a,onOpenChange:c,...l}=t,[u,f]=Ps({prop:r,defaultProp:o!=null?o:!1,onChange:c,caller:Jd});return m.jsx(vR,{scope:n,disabled:a,contentId:mn(),open:u,onOpenToggle:N.useCallback(()=>f(p=>!p),[f]),children:m.jsx(Xe.div,{"data-state":kg(u),"data-disabled":a?"":void 0,...l,ref:e})})});vS.displayName=Jd;var _S="CollapsibleTrigger",yS=N.forwardRef((t,e)=>{const{__scopeCollapsible:n,...r}=t,o=wg(_S,n);return m.jsx(Xe.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":kg(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:e,onClick:Ie(t.onClick,o.onOpenToggle)})});yS.displayName=_S;var Cg="CollapsibleContent",bS=N.forwardRef((t,e)=>{const{forceMount:n,...r}=t,o=wg(Cg,t.__scopeCollapsible);return m.jsx(xn,{present:n||o.open,children:({present:a})=>m.jsx(_R,{...r,ref:e,present:a})})});bS.displayName=Cg;var _R=N.forwardRef((t,e)=>{const{__scopeCollapsible:n,present:r,children:o,...a}=t,c=wg(Cg,n),[l,u]=N.useState(r),f=N.useRef(null),p=ct(e,f),h=N.useRef(0),_=h.current,x=N.useRef(0),C=x.current,w=c.open||l,v=N.useRef(w),b=N.useRef(void 0);return N.useEffect(()=>{const y=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(y)},[]),bn(()=>{const y=f.current;if(y){b.current=b.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";const S=y.getBoundingClientRect();h.current=S.height,x.current=S.width,v.current||(y.style.transitionDuration=b.current.transitionDuration,y.style.animationName=b.current.animationName),u(r)}},[c.open,r]),m.jsx(Xe.div,{"data-state":kg(c.open),"data-disabled":c.disabled?"":void 0,id:c.contentId,hidden:!w,...a,ref:p,style:{"--radix-collapsible-content-height":_?`${_}px`:void 0,"--radix-collapsible-content-width":C?`${C}px`:void 0,...t.style},children:w&&o})});function kg(t){return t?"open":"closed"}var yR=vS,bR=N.createContext(void 0);function Sc(t){const e=N.useContext(bR);return t||e||"ltr"}function Nn(t){const e=N.useRef(t);return N.useEffect(()=>{e.current=t}),N.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function xR(t,e=globalThis==null?void 0:globalThis.document){const n=Nn(t);N.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var SR="DismissableLayer",Fm="dismissableLayer.update",wR="dismissableLayer.pointerDownOutside",CR="dismissableLayer.focusOutside",Iy,xS=N.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ba=N.forwardRef((t,e)=>{var D;const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:c,onDismiss:l,...u}=t,f=N.useContext(xS),[p,h]=N.useState(null),_=(D=p==null?void 0:p.ownerDocument)!=null?D:globalThis==null?void 0:globalThis.document,[,x]=N.useState({}),C=ct(e,A=>h(A)),w=Array.from(f.layers),[v]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),b=w.indexOf(v),y=p?w.indexOf(p):-1,S=f.layersWithOutsidePointerEventsDisabled.size>0,k=y>=b,T=AR(A=>{const j=A.target,O=[...f.branches].some(P=>P.contains(j));!k||O||(o==null||o(A),c==null||c(A),A.defaultPrevented||l==null||l())},_),R=RR(A=>{const j=A.target;[...f.branches].some(P=>P.contains(j))||(a==null||a(A),c==null||c(A),A.defaultPrevented||l==null||l())},_);return xR(A=>{y===f.layers.size-1&&(r==null||r(A),!A.defaultPrevented&&l&&(A.preventDefault(),l()))},_),N.useEffect(()=>{if(p)return n&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(Iy=_.body.style.pointerEvents,_.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),Py(),()=>{n&&f.layersWithOutsidePointerEventsDisabled.size===1&&(_.body.style.pointerEvents=Iy)}},[p,_,n,f]),N.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),Py())},[p,f]),N.useEffect(()=>{const A=()=>x({});return document.addEventListener(Fm,A),()=>document.removeEventListener(Fm,A)},[]),m.jsx(Xe.div,{...u,ref:C,style:{pointerEvents:S?k?"auto":"none":void 0,...t.style},onFocusCapture:Ie(t.onFocusCapture,R.onFocusCapture),onBlurCapture:Ie(t.onBlurCapture,R.onBlurCapture),onPointerDownCapture:Ie(t.onPointerDownCapture,T.onPointerDownCapture)})});Ba.displayName=SR;var kR="DismissableLayerBranch",ER=N.forwardRef((t,e)=>{const n=N.useContext(xS),r=N.useRef(null),o=ct(e,r);return N.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),m.jsx(Xe.div,{...t,ref:o})});ER.displayName=kR;function AR(t,e=globalThis==null?void 0:globalThis.document){const n=Nn(t),r=N.useRef(!1),o=N.useRef(()=>{});return N.useEffect(()=>{const a=l=>{if(l.target&&!r.current){let u=function(){SS(wR,n,f,{discrete:!0})};const f={originalEvent:l};l.pointerType==="touch"?(e.removeEventListener("click",o.current),o.current=u,e.addEventListener("click",o.current,{once:!0})):u()}else e.removeEventListener("click",o.current);r.current=!1},c=window.setTimeout(()=>{e.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(c),e.removeEventListener("pointerdown",a),e.removeEventListener("click",o.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function RR(t,e=globalThis==null?void 0:globalThis.document){const n=Nn(t),r=N.useRef(!1);return N.useEffect(()=>{const o=a=>{a.target&&!r.current&&SS(CR,n,{originalEvent:a},{discrete:!1})};return e.addEventListener("focusin",o),()=>e.removeEventListener("focusin",o)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Py(){const t=new CustomEvent(Fm);document.dispatchEvent(t)}function SS(t,e,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&o.addEventListener(t,e,{once:!0}),r?pS(o,a):o.dispatchEvent(a)}var Xp="focusScope.autoFocusOnMount",Qp="focusScope.autoFocusOnUnmount",zy={bubbles:!1,cancelable:!0},TR="FocusScope",wc=N.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...c}=t,[l,u]=N.useState(null),f=Nn(o),p=Nn(a),h=N.useRef(null),_=ct(e,w=>u(w)),x=N.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;N.useEffect(()=>{if(r){let w=function(S){if(x.paused||!l)return;const k=S.target;l.contains(k)?h.current=k:bi(h.current,{select:!0})},v=function(S){if(x.paused||!l)return;const k=S.relatedTarget;k!==null&&(l.contains(k)||bi(h.current,{select:!0}))},b=function(S){if(document.activeElement===document.body)for(const T of S)T.removedNodes.length>0&&bi(l)};document.addEventListener("focusin",w),document.addEventListener("focusout",v);const y=new MutationObserver(b);return l&&y.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",v),y.disconnect()}}},[r,l,x.paused]),N.useEffect(()=>{if(l){Fy.add(x);const w=document.activeElement;if(!l.contains(w)){const b=new CustomEvent(Xp,zy);l.addEventListener(Xp,f),l.dispatchEvent(b),b.defaultPrevented||(NR(LR(wS(l)),{select:!0}),document.activeElement===w&&bi(l))}return()=>{l.removeEventListener(Xp,f),setTimeout(()=>{const b=new CustomEvent(Qp,zy);l.addEventListener(Qp,p),l.dispatchEvent(b),b.defaultPrevented||bi(w!=null?w:document.body,{select:!0}),l.removeEventListener(Qp,p),Fy.remove(x)},0)}}},[l,f,p,x]);const C=N.useCallback(w=>{if(!n&&!r||x.paused)return;const v=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,b=document.activeElement;if(v&&b){const y=w.currentTarget,[S,k]=MR(y);S&&k?!w.shiftKey&&b===k?(w.preventDefault(),n&&bi(S,{select:!0})):w.shiftKey&&b===S&&(w.preventDefault(),n&&bi(k,{select:!0})):b===y&&w.preventDefault()}},[n,r,x.paused]);return m.jsx(Xe.div,{tabIndex:-1,...c,ref:_,onKeyDown:C})});wc.displayName=TR;function NR(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(bi(r,{select:e}),document.activeElement!==n)return}function MR(t){const e=wS(t),n=By(e,t),r=By(e.reverse(),t);return[n,r]}function wS(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function By(t,e){for(const n of t)if(!DR(n,{upTo:e}))return n}function DR(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function jR(t){return t instanceof HTMLInputElement&&"select"in t}function bi(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&jR(t)&&e&&t.select()}}var Fy=OR();function OR(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=Hy(t,e),t.unshift(e)},remove(e){var n;t=Hy(t,e),(n=t[0])==null||n.resume()}}}function Hy(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function LR(t){return t.filter(e=>e.tagName!=="A")}var IR="Portal",Fa=N.forwardRef((t,e)=>{var l;const{container:n,...r}=t,[o,a]=N.useState(!1);bn(()=>a(!0),[]);const c=n||o&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return c?QA.createPortal(m.jsx(Xe.div,{...r,ref:e}),c):null});Fa.displayName=IR;var Zp=0;function ef(){N.useEffect(()=>{var e,n;const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=t[0])!=null?e:Uy()),document.body.insertAdjacentElement("beforeend",(n=t[1])!=null?n:Uy()),Zp++,()=>{Zp===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),Zp--}},[])}function Uy(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var os=function(){return os=Object.assign||function(e){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},os.apply(this,arguments)};function CS(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]]);return n}function PR(t,e,n){if(n||arguments.length===2)for(var r=0,o=e.length,a;r<o;r++)(a||!(r in e))&&(a||(a=Array.prototype.slice.call(e,0,r)),a[r]=e[r]);return t.concat(a||Array.prototype.slice.call(e))}var gd="right-scroll-bar-position",vd="width-before-scroll-bar",zR="with-scroll-bars-hidden",BR="--removed-body-scroll-bar-size";function Jp(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function FR(t,e){var n=N.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=e,n.facade}var HR=typeof window<"u"?N.useLayoutEffect:N.useEffect,$y=new WeakMap;function UR(t,e){var n=FR(null,function(r){return t.forEach(function(o){return Jp(o,r)})});return HR(function(){var r=$y.get(n);if(r){var o=new Set(r),a=new Set(t),c=n.current;o.forEach(function(l){a.has(l)||Jp(l,null)}),a.forEach(function(l){o.has(l)||Jp(l,c)})}$y.set(n,t)},[t]),n}function $R(t){return t}function qR(t,e){e===void 0&&(e=$R);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(a){var c=e(a,r);return n.push(c),function(){n=n.filter(function(l){return l!==c})}},assignSyncMedium:function(a){for(r=!0;n.length;){var c=n;n=[],c.forEach(a)}n={push:function(l){return a(l)},filter:function(){return n}}},assignMedium:function(a){r=!0;var c=[];if(n.length){var l=n;n=[],l.forEach(a),c=n}var u=function(){var p=c;c=[],p.forEach(a)},f=function(){return Promise.resolve().then(u)};f(),n={push:function(p){c.push(p),f()},filter:function(p){return c=c.filter(p),n}}}};return o}function VR(t){t===void 0&&(t={});var e=qR(null);return e.options=os({async:!0,ssr:!1},t),e}var kS=function(t){var e=t.sideCar,n=CS(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return N.createElement(r,os({},n))};kS.isSideCarExport=!0;function WR(t,e){return t.useMedium(e),kS}var ES=VR(),em=function(){},tf=N.forwardRef(function(t,e){var n=N.useRef(null),r=N.useState({onScrollCapture:em,onWheelCapture:em,onTouchMoveCapture:em}),o=r[0],a=r[1],c=t.forwardProps,l=t.children,u=t.className,f=t.removeScrollBar,p=t.enabled,h=t.shards,_=t.sideCar,x=t.noRelative,C=t.noIsolation,w=t.inert,v=t.allowPinchZoom,b=t.as,y=b===void 0?"div":b,S=t.gapMode,k=CS(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=_,R=UR([n,e]),D=os(os({},k),o);return N.createElement(N.Fragment,null,p&&N.createElement(T,{sideCar:ES,removeScrollBar:f,shards:h,noRelative:x,noIsolation:C,inert:w,setCallbacks:a,allowPinchZoom:!!v,lockRef:n,gapMode:S}),c?N.cloneElement(N.Children.only(l),os(os({},D),{ref:R})):N.createElement(y,os({},D,{className:u,ref:R}),l))});tf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};tf.classNames={fullWidth:vd,zeroRight:gd};var GR=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function KR(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=GR();return e&&t.setAttribute("nonce",e),t}function YR(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function XR(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var QR=function(){var t=0,e=null;return{add:function(n){t==0&&(e=KR())&&(YR(e,n),XR(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},ZR=function(){var t=QR();return function(e,n){N.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},AS=function(){var t=ZR(),e=function(n){var r=n.styles,o=n.dynamic;return t(r,o),null};return e},JR={left:0,top:0,right:0,gap:0},tm=function(t){return parseInt(t||"",10)||0},eT=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],o=e[t==="padding"?"paddingRight":"marginRight"];return[tm(n),tm(r),tm(o)]},tT=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return JR;var e=eT(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},nT=AS(),Sa="data-scroll-locked",rT=function(t,e,n,r){var o=t.left,a=t.top,c=t.right,l=t.gap;return n===void 0&&(n="margin"),`
468
+ .`.concat(zR,` {
469
+ overflow: hidden `).concat(r,`;
470
+ padding-right: `).concat(l,"px ").concat(r,`;
471
+ }
472
+ body[`).concat(Sa,`] {
473
+ overflow: hidden `).concat(r,`;
474
+ overscroll-behavior: contain;
475
+ `).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
476
+ padding-left: `.concat(o,`px;
477
+ padding-top: `).concat(a,`px;
478
+ padding-right: `).concat(c,`px;
479
+ margin-left:0;
480
+ margin-top:0;
481
+ margin-right: `).concat(l,"px ").concat(r,`;
482
+ `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
483
+ }
484
+
485
+ .`).concat(gd,` {
486
+ right: `).concat(l,"px ").concat(r,`;
487
+ }
488
+
489
+ .`).concat(vd,` {
490
+ margin-right: `).concat(l,"px ").concat(r,`;
491
+ }
492
+
493
+ .`).concat(gd," .").concat(gd,` {
494
+ right: 0 `).concat(r,`;
495
+ }
496
+
497
+ .`).concat(vd," .").concat(vd,` {
498
+ margin-right: 0 `).concat(r,`;
499
+ }
500
+
501
+ body[`).concat(Sa,`] {
502
+ `).concat(BR,": ").concat(l,`px;
503
+ }
504
+ `)},qy=function(){var t=parseInt(document.body.getAttribute(Sa)||"0",10);return isFinite(t)?t:0},sT=function(){N.useEffect(function(){return document.body.setAttribute(Sa,(qy()+1).toString()),function(){var t=qy()-1;t<=0?document.body.removeAttribute(Sa):document.body.setAttribute(Sa,t.toString())}},[])},iT=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,o=r===void 0?"margin":r;sT();var a=N.useMemo(function(){return tT(o)},[o]);return N.createElement(nT,{styles:rT(a,!e,o,n?"":"!important")})},Hm=!1;if(typeof window<"u")try{var sd=Object.defineProperty({},"passive",{get:function(){return Hm=!0,!0}});window.addEventListener("test",sd,sd),window.removeEventListener("test",sd,sd)}catch{Hm=!1}var fa=Hm?{passive:!1}:!1,oT=function(t){return t.tagName==="TEXTAREA"},RS=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!oT(t)&&n[e]==="visible")},aT=function(t){return RS(t,"overflowY")},lT=function(t){return RS(t,"overflowX")},Vy=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=TS(t,r);if(o){var a=NS(t,r),c=a[1],l=a[2];if(c>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},cT=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},uT=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},TS=function(t,e){return t==="v"?aT(e):lT(e)},NS=function(t,e){return t==="v"?cT(e):uT(e)},dT=function(t,e){return t==="h"&&e==="rtl"?-1:1},fT=function(t,e,n,r,o){var a=dT(t,window.getComputedStyle(e).direction),c=a*r,l=n.target,u=e.contains(l),f=!1,p=c>0,h=0,_=0;do{if(!l)break;var x=NS(t,l),C=x[0],w=x[1],v=x[2],b=w-v-a*C;(C||b)&&TS(t,l)&&(h+=b,_+=C);var y=l.parentNode;l=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!u&&l!==document.body||u&&(e.contains(l)||e===l));return(p&&Math.abs(h)<1||!p&&Math.abs(_)<1)&&(f=!0),f},id=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Wy=function(t){return[t.deltaX,t.deltaY]},Gy=function(t){return t&&"current"in t?t.current:t},hT=function(t,e){return t[0]===e[0]&&t[1]===e[1]},pT=function(t){return`
505
+ .block-interactivity-`.concat(t,` {pointer-events: none;}
506
+ .allow-interactivity-`).concat(t,` {pointer-events: all;}
507
+ `)},mT=0,ha=[];function gT(t){var e=N.useRef([]),n=N.useRef([0,0]),r=N.useRef(),o=N.useState(mT++)[0],a=N.useState(AS)[0],c=N.useRef(t);N.useEffect(function(){c.current=t},[t]),N.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(o));var w=PR([t.lockRef.current],(t.shards||[]).map(Gy),!0).filter(Boolean);return w.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),w.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[t.inert,t.lockRef.current,t.shards]);var l=N.useCallback(function(w,v){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!c.current.allowPinchZoom;var b=id(w),y=n.current,S="deltaX"in w?w.deltaX:y[0]-b[0],k="deltaY"in w?w.deltaY:y[1]-b[1],T,R=w.target,D=Math.abs(S)>Math.abs(k)?"h":"v";if("touches"in w&&D==="h"&&R.type==="range")return!1;var A=window.getSelection(),j=A&&A.anchorNode,O=j?j===R||j.contains(R):!1;if(O)return!1;var P=Vy(D,R);if(!P)return!0;if(P?T=D:(T=D==="v"?"h":"v",P=Vy(D,R)),!P)return!1;if(!r.current&&"changedTouches"in w&&(S||k)&&(r.current=T),!T)return!0;var $=r.current||T;return fT($,v,w,$==="h"?S:k)},[]),u=N.useCallback(function(w){var v=w;if(!(!ha.length||ha[ha.length-1]!==a)){var b="deltaY"in v?Wy(v):id(v),y=e.current.filter(function(T){return T.name===v.type&&(T.target===v.target||v.target===T.shadowParent)&&hT(T.delta,b)})[0];if(y&&y.should){v.cancelable&&v.preventDefault();return}if(!y){var S=(c.current.shards||[]).map(Gy).filter(Boolean).filter(function(T){return T.contains(v.target)}),k=S.length>0?l(v,S[0]):!c.current.noIsolation;k&&v.cancelable&&v.preventDefault()}}},[]),f=N.useCallback(function(w,v,b,y){var S={name:w,delta:v,target:b,should:y,shadowParent:vT(b)};e.current.push(S),setTimeout(function(){e.current=e.current.filter(function(k){return k!==S})},1)},[]),p=N.useCallback(function(w){n.current=id(w),r.current=void 0},[]),h=N.useCallback(function(w){f(w.type,Wy(w),w.target,l(w,t.lockRef.current))},[]),_=N.useCallback(function(w){f(w.type,id(w),w.target,l(w,t.lockRef.current))},[]);N.useEffect(function(){return ha.push(a),t.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:_}),document.addEventListener("wheel",u,fa),document.addEventListener("touchmove",u,fa),document.addEventListener("touchstart",p,fa),function(){ha=ha.filter(function(w){return w!==a}),document.removeEventListener("wheel",u,fa),document.removeEventListener("touchmove",u,fa),document.removeEventListener("touchstart",p,fa)}},[]);var x=t.removeScrollBar,C=t.inert;return N.createElement(N.Fragment,null,C?N.createElement(a,{styles:pT(o)}):null,x?N.createElement(iT,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function vT(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const _T=WR(ES,gT);var Cc=N.forwardRef(function(t,e){return N.createElement(tf,os({},t,{ref:e,sideCar:_T}))});Cc.classNames=tf.classNames;var yT=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},pa=new WeakMap,od=new WeakMap,ad={},nm=0,MS=function(t){return t&&(t.host||MS(t.parentNode))},bT=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=MS(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},xT=function(t,e,n,r){var o=bT(e,Array.isArray(t)?t:[t]);ad[n]||(ad[n]=new WeakMap);var a=ad[n],c=[],l=new Set,u=new Set(o),f=function(h){!h||l.has(h)||(l.add(h),f(h.parentNode))};o.forEach(f);var p=function(h){!h||u.has(h)||Array.prototype.forEach.call(h.children,function(_){if(l.has(_))p(_);else try{var x=_.getAttribute(r),C=x!==null&&x!=="false",w=(pa.get(_)||0)+1,v=(a.get(_)||0)+1;pa.set(_,w),a.set(_,v),c.push(_),w===1&&C&&od.set(_,!0),v===1&&_.setAttribute(n,"true"),C||_.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",_,b)}})};return p(e),l.clear(),nm++,function(){c.forEach(function(h){var _=pa.get(h)-1,x=a.get(h)-1;pa.set(h,_),a.set(h,x),_||(od.has(h)||h.removeAttribute(r),od.delete(h)),x||h.removeAttribute(n)}),nm--,nm||(pa=new WeakMap,pa=new WeakMap,od=new WeakMap,ad={})}},nf=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),o=yT(t);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),xT(r,o,n,"aria-hidden")):function(){return null}},rf="Dialog",[DS]=_r(rf),[ST,Yr]=DS(rf),jS=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:o,onOpenChange:a,modal:c=!0}=t,l=N.useRef(null),u=N.useRef(null),[f,p]=Ps({prop:r,defaultProp:o!=null?o:!1,onChange:a,caller:rf});return m.jsx(ST,{scope:e,triggerRef:l,contentRef:u,contentId:mn(),titleId:mn(),descriptionId:mn(),open:f,onOpenChange:p,onOpenToggle:N.useCallback(()=>p(h=>!h),[p]),modal:c,children:n})};jS.displayName=rf;var OS="DialogTrigger",LS=N.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=Yr(OS,n),a=ct(e,o.triggerRef);return m.jsx(Xe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Rg(o.open),...r,ref:a,onClick:Ie(t.onClick,o.onOpenToggle)})});LS.displayName=OS;var Eg="DialogPortal",[wT,IS]=DS(Eg,{forceMount:void 0}),PS=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:o}=t,a=Yr(Eg,e);return m.jsx(wT,{scope:e,forceMount:n,children:N.Children.map(r,c=>m.jsx(xn,{present:n||a.open,children:m.jsx(Fa,{asChild:!0,container:o,children:c})}))})};PS.displayName=Eg;var kd="DialogOverlay",zS=N.forwardRef((t,e)=>{const n=IS(kd,t.__scopeDialog),{forceMount:r=n.forceMount,...o}=t,a=Yr(kd,t.__scopeDialog);return a.modal?m.jsx(xn,{present:r||a.open,children:m.jsx(kT,{...o,ref:e})}):null});zS.displayName=kd;var CT=xi("DialogOverlay.RemoveScroll"),kT=N.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=Yr(kd,n);return m.jsx(Cc,{as:CT,allowPinchZoom:!0,shards:[o.contentRef],children:m.jsx(Xe.div,{"data-state":Rg(o.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),mo="DialogContent",BS=N.forwardRef((t,e)=>{const n=IS(mo,t.__scopeDialog),{forceMount:r=n.forceMount,...o}=t,a=Yr(mo,t.__scopeDialog);return m.jsx(xn,{present:r||a.open,children:a.modal?m.jsx(ET,{...o,ref:e}):m.jsx(AT,{...o,ref:e})})});BS.displayName=mo;var ET=N.forwardRef((t,e)=>{const n=Yr(mo,t.__scopeDialog),r=N.useRef(null),o=ct(e,n.contentRef,r);return N.useEffect(()=>{const a=r.current;if(a)return nf(a)},[]),m.jsx(FS,{...t,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ie(t.onCloseAutoFocus,a=>{var c;a.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Ie(t.onPointerDownOutside,a=>{const c=a.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0;(c.button===2||l)&&a.preventDefault()}),onFocusOutside:Ie(t.onFocusOutside,a=>a.preventDefault())})}),AT=N.forwardRef((t,e)=>{const n=Yr(mo,t.__scopeDialog),r=N.useRef(!1),o=N.useRef(!1);return m.jsx(FS,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var c,l;(c=t.onCloseAutoFocus)==null||c.call(t,a),a.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),a.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:a=>{var u,f;(u=t.onInteractOutside)==null||u.call(t,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const c=a.target;((f=n.triggerRef.current)==null?void 0:f.contains(c))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),FS=N.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,...c}=t,l=Yr(mo,n),u=N.useRef(null),f=ct(e,u);return ef(),m.jsxs(m.Fragment,{children:[m.jsx(wc,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a,children:m.jsx(Ba,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Rg(l.open),...c,ref:f,onDismiss:()=>l.onOpenChange(!1)})}),m.jsxs(m.Fragment,{children:[m.jsx(RT,{titleId:l.titleId}),m.jsx(NT,{contentRef:u,descriptionId:l.descriptionId})]})]})}),Ag="DialogTitle",HS=N.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=Yr(Ag,n);return m.jsx(Xe.h2,{id:o.titleId,...r,ref:e})});HS.displayName=Ag;var US="DialogDescription",$S=N.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=Yr(US,n);return m.jsx(Xe.p,{id:o.descriptionId,...r,ref:e})});$S.displayName=US;var qS="DialogClose",VS=N.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,o=Yr(qS,n);return m.jsx(Xe.button,{type:"button",...r,ref:e,onClick:Ie(t.onClick,()=>o.onOpenChange(!1))})});VS.displayName=qS;function Rg(t){return t?"open":"closed"}var WS="DialogTitleWarning",[dq,GS]=oR(WS,{contentName:mo,titleName:Ag,docsSlug:"dialog"}),RT=({titleId:t})=>{const e=GS(WS),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
508
+
509
+ If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
510
+
511
+ For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return N.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},TT="DialogDescriptionWarning",NT=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${GS(TT).contentName}}.`;return N.useEffect(()=>{var a;const o=(a=t.current)==null?void 0:a.getAttribute("aria-describedby");e&&o&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},Tg=jS,MT=LS,Ng=PS,Mg=zS,Dg=BS,KS=HS,YS=$S,sf=VS;function DT(t){const e=N.useRef({value:t,previous:t});return N.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}function jT(t){const[e,n]=N.useState(void 0);return bn(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let c,l;if("borderBoxSize"in a){const u=a.borderBoxSize,f=Array.isArray(u)?u[0]:u;c=f.inlineSize,l=f.blockSize}else c=t.offsetWidth,l=t.offsetHeight;n({width:c,height:l})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}const OT=["top","right","bottom","left"],Si=Math.min,hr=Math.max,Ed=Math.round,ld=Math.floor,cs=t=>({x:t,y:t}),LT={left:"right",right:"left",bottom:"top",top:"bottom"};function Um(t,e,n){return hr(t,Si(e,n))}function zs(t,e){return typeof t=="function"?t(e):t}function Bs(t){return t.split("-")[0]}function Ha(t){return t.split("-")[1]}function jg(t){return t==="x"?"y":"x"}function Og(t){return t==="y"?"height":"width"}function as(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Lg(t){return jg(as(t))}function IT(t,e,n){n===void 0&&(n=!1);const r=Ha(t),o=Lg(t),a=Og(o);let c=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(c=Ad(c)),[c,Ad(c)]}function PT(t){const e=Ad(t);return[$m(t),e,$m(e)]}function $m(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Ky=["left","right"],Yy=["right","left"],zT=["top","bottom"],BT=["bottom","top"];function FT(t,e,n){switch(t){case"top":case"bottom":return n?e?Yy:Ky:e?Ky:Yy;case"left":case"right":return e?zT:BT;default:return[]}}function HT(t,e,n,r){const o=Ha(t);let a=FT(Bs(t),n==="start",r);return o&&(a=a.map(c=>c+"-"+o),e&&(a=a.concat(a.map($m)))),a}function Ad(t){const e=Bs(t);return LT[e]+t.slice(e.length)}function UT(t){return{top:0,right:0,bottom:0,left:0,...t}}function XS(t){return typeof t!="number"?UT(t):{top:t,right:t,bottom:t,left:t}}function Rd(t){const{x:e,y:n,width:r,height:o}=t;return{width:r,height:o,top:n,left:e,right:e+r,bottom:n+o,x:e,y:n}}function Xy(t,e,n){let{reference:r,floating:o}=t;const a=as(e),c=Lg(e),l=Og(c),u=Bs(e),f=a==="y",p=r.x+r.width/2-o.width/2,h=r.y+r.height/2-o.height/2,_=r[l]/2-o[l]/2;let x;switch(u){case"top":x={x:p,y:r.y-o.height};break;case"bottom":x={x:p,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:h};break;case"left":x={x:r.x-o.width,y:h};break;default:x={x:r.x,y:r.y}}switch(Ha(e)){case"start":x[c]-=_*(n&&f?-1:1);break;case"end":x[c]+=_*(n&&f?-1:1);break}return x}async function $T(t,e){var n;e===void 0&&(e={});const{x:r,y:o,platform:a,rects:c,elements:l,strategy:u}=t,{boundary:f="clippingAncestors",rootBoundary:p="viewport",elementContext:h="floating",altBoundary:_=!1,padding:x=0}=zs(e,t),C=XS(x),v=l[_?h==="floating"?"reference":"floating":h],b=Rd(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(v)))==null||n?v:v.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(l.floating)),boundary:f,rootBoundary:p,strategy:u})),y=h==="floating"?{x:r,y:o,width:c.floating.width,height:c.floating.height}:c.reference,S=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating)),k=await(a.isElement==null?void 0:a.isElement(S))?await(a.getScale==null?void 0:a.getScale(S))||{x:1,y:1}:{x:1,y:1},T=Rd(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:S,strategy:u}):y);return{top:(b.top-T.top+C.top)/k.y,bottom:(T.bottom-b.bottom+C.bottom)/k.y,left:(b.left-T.left+C.left)/k.x,right:(T.right-b.right+C.right)/k.x}}const qT=50,VT=async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:c}=n,l=c.detectOverflow?c:{...c,detectOverflow:$T},u=await(c.isRTL==null?void 0:c.isRTL(e));let f=await c.getElementRects({reference:t,floating:e,strategy:o}),{x:p,y:h}=Xy(f,r,u),_=r,x=0;const C={};for(let w=0;w<a.length;w++){const v=a[w];if(!v)continue;const{name:b,fn:y}=v,{x:S,y:k,data:T,reset:R}=await y({x:p,y:h,initialPlacement:r,placement:_,strategy:o,middlewareData:C,rects:f,platform:l,elements:{reference:t,floating:e}});p=S!=null?S:p,h=k!=null?k:h,C[b]={...C[b],...T},R&&x<qT&&(x++,typeof R=="object"&&(R.placement&&(_=R.placement),R.rects&&(f=R.rects===!0?await c.getElementRects({reference:t,floating:e,strategy:o}):R.rects),{x:p,y:h}=Xy(f,_,u)),w=-1)}return{x:p,y:h,placement:_,strategy:o,middlewareData:C}},WT=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:o,rects:a,platform:c,elements:l,middlewareData:u}=e,{element:f,padding:p=0}=zs(t,e)||{};if(f==null)return{};const h=XS(p),_={x:n,y:r},x=Lg(o),C=Og(x),w=await c.getDimensions(f),v=x==="y",b=v?"top":"left",y=v?"bottom":"right",S=v?"clientHeight":"clientWidth",k=a.reference[C]+a.reference[x]-_[x]-a.floating[C],T=_[x]-a.reference[x],R=await(c.getOffsetParent==null?void 0:c.getOffsetParent(f));let D=R?R[S]:0;(!D||!await(c.isElement==null?void 0:c.isElement(R)))&&(D=l.floating[S]||a.floating[C]);const A=k/2-T/2,j=D/2-w[C]/2-1,O=Si(h[b],j),P=Si(h[y],j),$=O,U=D-w[C]-P,W=D/2-w[C]/2+A,K=Um($,W,U),V=!u.arrow&&Ha(o)!=null&&W!==K&&a.reference[C]/2-(W<$?O:P)-w[C]/2<0,Q=V?W<$?W-$:W-U:0;return{[x]:_[x]+Q,data:{[x]:K,centerOffset:W-K-Q,...V&&{alignmentOffset:Q}},reset:V}}}),GT=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:o,middlewareData:a,rects:c,initialPlacement:l,platform:u,elements:f}=e,{mainAxis:p=!0,crossAxis:h=!0,fallbackPlacements:_,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:w=!0,...v}=zs(t,e);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const b=Bs(o),y=as(l),S=Bs(l)===l,k=await(u.isRTL==null?void 0:u.isRTL(f.floating)),T=_||(S||!w?[Ad(l)]:PT(l)),R=C!=="none";!_&&R&&T.push(...HT(l,w,C,k));const D=[l,...T],A=await u.detectOverflow(e,v),j=[];let O=((r=a.flip)==null?void 0:r.overflows)||[];if(p&&j.push(A[b]),h){const W=IT(o,c,k);j.push(A[W[0]],A[W[1]])}if(O=[...O,{placement:o,overflows:j}],!j.every(W=>W<=0)){var P,$;const W=(((P=a.flip)==null?void 0:P.index)||0)+1,K=D[W];if(K&&(!(h==="alignment"?y!==as(K):!1)||O.every(X=>as(X.placement)===y?X.overflows[0]>0:!0)))return{data:{index:W,overflows:O},reset:{placement:K}};let V=($=O.filter(Q=>Q.overflows[0]<=0).sort((Q,X)=>Q.overflows[1]-X.overflows[1])[0])==null?void 0:$.placement;if(!V)switch(x){case"bestFit":{var U;const Q=(U=O.filter(X=>{if(R){const I=as(X.placement);return I===y||I==="y"}return!0}).map(X=>[X.placement,X.overflows.filter(I=>I>0).reduce((I,L)=>I+L,0)]).sort((X,I)=>X[1]-I[1])[0])==null?void 0:U[0];Q&&(V=Q);break}case"initialPlacement":V=l;break}if(o!==V)return{reset:{placement:V}}}return{}}}};function Qy(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Zy(t){return OT.some(e=>t[e]>=0)}const KT=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:r}=e,{strategy:o="referenceHidden",...a}=zs(t,e);switch(o){case"referenceHidden":{const c=await r.detectOverflow(e,{...a,elementContext:"reference"}),l=Qy(c,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:Zy(l)}}}case"escaped":{const c=await r.detectOverflow(e,{...a,altBoundary:!0}),l=Qy(c,n.floating);return{data:{escapedOffsets:l,escaped:Zy(l)}}}default:return{}}}}},QS=new Set(["left","top"]);async function YT(t,e){const{placement:n,platform:r,elements:o}=t,a=await(r.isRTL==null?void 0:r.isRTL(o.floating)),c=Bs(n),l=Ha(n),u=as(n)==="y",f=QS.has(c)?-1:1,p=a&&u?-1:1,h=zs(e,t);let{mainAxis:_,crossAxis:x,alignmentAxis:C}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&typeof C=="number"&&(x=l==="end"?C*-1:C),u?{x:x*p,y:_*f}:{x:_*f,y:x*p}}const XT=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:o,y:a,placement:c,middlewareData:l}=e,u=await YT(e,t);return c===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:a+u.y,data:{...u,placement:c}}}}},QT=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:o,platform:a}=e,{mainAxis:c=!0,crossAxis:l=!1,limiter:u={fn:b=>{let{x:y,y:S}=b;return{x:y,y:S}}},...f}=zs(t,e),p={x:n,y:r},h=await a.detectOverflow(e,f),_=as(Bs(o)),x=jg(_);let C=p[x],w=p[_];if(c){const b=x==="y"?"top":"left",y=x==="y"?"bottom":"right",S=C+h[b],k=C-h[y];C=Um(S,C,k)}if(l){const b=_==="y"?"top":"left",y=_==="y"?"bottom":"right",S=w+h[b],k=w-h[y];w=Um(S,w,k)}const v=u.fn({...e,[x]:C,[_]:w});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[x]:c,[_]:l}}}}}},ZT=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:o,rects:a,middlewareData:c}=e,{offset:l=0,mainAxis:u=!0,crossAxis:f=!0}=zs(t,e),p={x:n,y:r},h=as(o),_=jg(h);let x=p[_],C=p[h];const w=zs(l,e),v=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(u){const S=_==="y"?"height":"width",k=a.reference[_]-a.floating[S]+v.mainAxis,T=a.reference[_]+a.reference[S]-v.mainAxis;x<k?x=k:x>T&&(x=T)}if(f){var b,y;const S=_==="y"?"width":"height",k=QS.has(Bs(o)),T=a.reference[h]-a.floating[S]+(k&&((b=c.offset)==null?void 0:b[h])||0)+(k?0:v.crossAxis),R=a.reference[h]+a.reference[S]+(k?0:((y=c.offset)==null?void 0:y[h])||0)-(k?v.crossAxis:0);C<T?C=T:C>R&&(C=R)}return{[_]:x,[h]:C}}}},JT=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:o,rects:a,platform:c,elements:l}=e,{apply:u=()=>{},...f}=zs(t,e),p=await c.detectOverflow(e,f),h=Bs(o),_=Ha(o),x=as(o)==="y",{width:C,height:w}=a.floating;let v,b;h==="top"||h==="bottom"?(v=h,b=_===(await(c.isRTL==null?void 0:c.isRTL(l.floating))?"start":"end")?"left":"right"):(b=h,v=_==="end"?"top":"bottom");const y=w-p.top-p.bottom,S=C-p.left-p.right,k=Si(w-p[v],y),T=Si(C-p[b],S),R=!e.middlewareData.shift;let D=k,A=T;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(A=S),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(D=y),R&&!_){const O=hr(p.left,0),P=hr(p.right,0),$=hr(p.top,0),U=hr(p.bottom,0);x?A=C-2*(O!==0||P!==0?O+P:hr(p.left,p.right)):D=w-2*($!==0||U!==0?$+U:hr(p.top,p.bottom))}await u({...e,availableWidth:A,availableHeight:D});const j=await c.getDimensions(l.floating);return C!==j.width||w!==j.height?{reset:{rects:!0}}:{}}}};function of(){return typeof window<"u"}function Ua(t){return ZS(t)?(t.nodeName||"").toLowerCase():"#document"}function gr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ds(t){var e;return(e=(ZS(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function ZS(t){return of()?t instanceof Node||t instanceof gr(t).Node:!1}function Gr(t){return of()?t instanceof Element||t instanceof gr(t).Element:!1}function Fs(t){return of()?t instanceof HTMLElement||t instanceof gr(t).HTMLElement:!1}function Jy(t){return!of()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof gr(t).ShadowRoot}function kc(t){const{overflow:e,overflowX:n,overflowY:r,display:o}=Kr(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&o!=="inline"&&o!=="contents"}function e6(t){return/^(table|td|th)$/.test(Ua(t))}function af(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const t6=/transform|translate|scale|rotate|perspective|filter/,n6=/paint|layout|strict|content/,ao=t=>!!t&&t!=="none";let rm;function Ig(t){const e=Gr(t)?Kr(t):t;return ao(e.transform)||ao(e.translate)||ao(e.scale)||ao(e.rotate)||ao(e.perspective)||!Pg()&&(ao(e.backdropFilter)||ao(e.filter))||t6.test(e.willChange||"")||n6.test(e.contain||"")}function r6(t){let e=wi(t);for(;Fs(e)&&!Aa(e);){if(Ig(e))return e;if(af(e))return null;e=wi(e)}return null}function Pg(){return rm==null&&(rm=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),rm}function Aa(t){return/^(html|body|#document)$/.test(Ua(t))}function Kr(t){return gr(t).getComputedStyle(t)}function lf(t){return Gr(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function wi(t){if(Ua(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Jy(t)&&t.host||ds(t);return Jy(e)?e.host:e}function JS(t){const e=wi(t);return Aa(e)?t.ownerDocument?t.ownerDocument.body:t.body:Fs(e)&&kc(e)?e:JS(e)}function cc(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const o=JS(t),a=o===((r=t.ownerDocument)==null?void 0:r.body),c=gr(o);if(a){const l=qm(c);return e.concat(c,c.visualViewport||[],kc(o)?o:[],l&&n?cc(l):[])}else return e.concat(o,cc(o,[],n))}function qm(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function e2(t){const e=Kr(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const o=Fs(t),a=o?t.offsetWidth:n,c=o?t.offsetHeight:r,l=Ed(n)!==a||Ed(r)!==c;return l&&(n=a,r=c),{width:n,height:r,$:l}}function zg(t){return Gr(t)?t:t.contextElement}function wa(t){const e=zg(t);if(!Fs(e))return cs(1);const n=e.getBoundingClientRect(),{width:r,height:o,$:a}=e2(e);let c=(a?Ed(n.width):n.width)/r,l=(a?Ed(n.height):n.height)/o;return(!c||!Number.isFinite(c))&&(c=1),(!l||!Number.isFinite(l))&&(l=1),{x:c,y:l}}const s6=cs(0);function t2(t){const e=gr(t);return!Pg()||!e.visualViewport?s6:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function i6(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==gr(t)?!1:e}function go(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const o=t.getBoundingClientRect(),a=zg(t);let c=cs(1);e&&(r?Gr(r)&&(c=wa(r)):c=wa(t));const l=i6(a,n,r)?t2(a):cs(0);let u=(o.left+l.x)/c.x,f=(o.top+l.y)/c.y,p=o.width/c.x,h=o.height/c.y;if(a){const _=gr(a),x=r&&Gr(r)?gr(r):r;let C=_,w=qm(C);for(;w&&r&&x!==C;){const v=wa(w),b=w.getBoundingClientRect(),y=Kr(w),S=b.left+(w.clientLeft+parseFloat(y.paddingLeft))*v.x,k=b.top+(w.clientTop+parseFloat(y.paddingTop))*v.y;u*=v.x,f*=v.y,p*=v.x,h*=v.y,u+=S,f+=k,C=gr(w),w=qm(C)}}return Rd({width:p,height:h,x:u,y:f})}function cf(t,e){const n=lf(t).scrollLeft;return e?e.left+n:go(ds(t)).left+n}function n2(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-cf(t,n),o=n.top+e.scrollTop;return{x:r,y:o}}function o6(t){let{elements:e,rect:n,offsetParent:r,strategy:o}=t;const a=o==="fixed",c=ds(r),l=e?af(e.floating):!1;if(r===c||l&&a)return n;let u={scrollLeft:0,scrollTop:0},f=cs(1);const p=cs(0),h=Fs(r);if((h||!h&&!a)&&((Ua(r)!=="body"||kc(c))&&(u=lf(r)),h)){const x=go(r);f=wa(r),p.x=x.x+r.clientLeft,p.y=x.y+r.clientTop}const _=c&&!h&&!a?n2(c,u):cs(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-u.scrollLeft*f.x+p.x+_.x,y:n.y*f.y-u.scrollTop*f.y+p.y+_.y}}function a6(t){return Array.from(t.getClientRects())}function l6(t){const e=ds(t),n=lf(t),r=t.ownerDocument.body,o=hr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),a=hr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+cf(t);const l=-n.scrollTop;return Kr(r).direction==="rtl"&&(c+=hr(e.clientWidth,r.clientWidth)-o),{width:o,height:a,x:c,y:l}}const eb=25;function c6(t,e){const n=gr(t),r=ds(t),o=n.visualViewport;let a=r.clientWidth,c=r.clientHeight,l=0,u=0;if(o){a=o.width,c=o.height;const p=Pg();(!p||p&&e==="fixed")&&(l=o.offsetLeft,u=o.offsetTop)}const f=cf(r);if(f<=0){const p=r.ownerDocument,h=p.body,_=getComputedStyle(h),x=p.compatMode==="CSS1Compat"&&parseFloat(_.marginLeft)+parseFloat(_.marginRight)||0,C=Math.abs(r.clientWidth-h.clientWidth-x);C<=eb&&(a-=C)}else f<=eb&&(a+=f);return{width:a,height:c,x:l,y:u}}function u6(t,e){const n=go(t,!0,e==="fixed"),r=n.top+t.clientTop,o=n.left+t.clientLeft,a=Fs(t)?wa(t):cs(1),c=t.clientWidth*a.x,l=t.clientHeight*a.y,u=o*a.x,f=r*a.y;return{width:c,height:l,x:u,y:f}}function tb(t,e,n){let r;if(e==="viewport")r=c6(t,n);else if(e==="document")r=l6(ds(t));else if(Gr(e))r=u6(e,n);else{const o=t2(t);r={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return Rd(r)}function r2(t,e){const n=wi(t);return n===e||!Gr(n)||Aa(n)?!1:Kr(n).position==="fixed"||r2(n,e)}function d6(t,e){const n=e.get(t);if(n)return n;let r=cc(t,[],!1).filter(l=>Gr(l)&&Ua(l)!=="body"),o=null;const a=Kr(t).position==="fixed";let c=a?wi(t):t;for(;Gr(c)&&!Aa(c);){const l=Kr(c),u=Ig(c);!u&&l.position==="fixed"&&(o=null),(a?!u&&!o:!u&&l.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||kc(c)&&!u&&r2(t,c))?r=r.filter(p=>p!==c):o=l,c=wi(c)}return e.set(t,r),r}function f6(t){let{element:e,boundary:n,rootBoundary:r,strategy:o}=t;const c=[...n==="clippingAncestors"?af(e)?[]:d6(e,this._c):[].concat(n),r],l=tb(e,c[0],o);let u=l.top,f=l.right,p=l.bottom,h=l.left;for(let _=1;_<c.length;_++){const x=tb(e,c[_],o);u=hr(x.top,u),f=Si(x.right,f),p=Si(x.bottom,p),h=hr(x.left,h)}return{width:f-h,height:p-u,x:h,y:u}}function h6(t){const{width:e,height:n}=e2(t);return{width:e,height:n}}function p6(t,e,n){const r=Fs(e),o=ds(e),a=n==="fixed",c=go(t,!0,a,e);let l={scrollLeft:0,scrollTop:0};const u=cs(0);function f(){u.x=cf(o)}if(r||!r&&!a)if((Ua(e)!=="body"||kc(o))&&(l=lf(e)),r){const x=go(e,!0,a,e);u.x=x.x+e.clientLeft,u.y=x.y+e.clientTop}else o&&f();a&&!r&&o&&f();const p=o&&!r&&!a?n2(o,l):cs(0),h=c.left+l.scrollLeft-u.x-p.x,_=c.top+l.scrollTop-u.y-p.y;return{x:h,y:_,width:c.width,height:c.height}}function sm(t){return Kr(t).position==="static"}function nb(t,e){if(!Fs(t)||Kr(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return ds(t)===n&&(n=n.ownerDocument.body),n}function s2(t,e){const n=gr(t);if(af(t))return n;if(!Fs(t)){let o=wi(t);for(;o&&!Aa(o);){if(Gr(o)&&!sm(o))return o;o=wi(o)}return n}let r=nb(t,e);for(;r&&e6(r)&&sm(r);)r=nb(r,e);return r&&Aa(r)&&sm(r)&&!Ig(r)?n:r||r6(t)||n}const m6=async function(t){const e=this.getOffsetParent||s2,n=this.getDimensions,r=await n(t.floating);return{reference:p6(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function g6(t){return Kr(t).direction==="rtl"}const v6={convertOffsetParentRelativeRectToViewportRelativeRect:o6,getDocumentElement:ds,getClippingRect:f6,getOffsetParent:s2,getElementRects:m6,getClientRects:a6,getDimensions:h6,getScale:wa,isElement:Gr,isRTL:g6};function i2(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function _6(t,e){let n=null,r;const o=ds(t);function a(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function c(l,u){l===void 0&&(l=!1),u===void 0&&(u=1),a();const f=t.getBoundingClientRect(),{left:p,top:h,width:_,height:x}=f;if(l||e(),!_||!x)return;const C=ld(h),w=ld(o.clientWidth-(p+_)),v=ld(o.clientHeight-(h+x)),b=ld(p),S={rootMargin:-C+"px "+-w+"px "+-v+"px "+-b+"px",threshold:hr(0,Si(1,u))||1};let k=!0;function T(R){const D=R[0].intersectionRatio;if(D!==u){if(!k)return c();D?c(!1,D):r=setTimeout(()=>{c(!1,1e-7)},1e3)}D===1&&!i2(f,t.getBoundingClientRect())&&c(),k=!1}try{n=new IntersectionObserver(T,{...S,root:o.ownerDocument})}catch{n=new IntersectionObserver(T,S)}n.observe(t)}return c(!0),a}function y6(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,f=zg(t),p=o||a?[...f?cc(f):[],...e?cc(e):[]]:[];p.forEach(b=>{o&&b.addEventListener("scroll",n,{passive:!0}),a&&b.addEventListener("resize",n)});const h=f&&l?_6(f,n):null;let _=-1,x=null;c&&(x=new ResizeObserver(b=>{let[y]=b;y&&y.target===f&&x&&e&&(x.unobserve(e),cancelAnimationFrame(_),_=requestAnimationFrame(()=>{var S;(S=x)==null||S.observe(e)})),n()}),f&&!u&&x.observe(f),e&&x.observe(e));let C,w=u?go(t):null;u&&v();function v(){const b=go(t);w&&!i2(w,b)&&n(),w=b,C=requestAnimationFrame(v)}return n(),()=>{var b;p.forEach(y=>{o&&y.removeEventListener("scroll",n),a&&y.removeEventListener("resize",n)}),h==null||h(),(b=x)==null||b.disconnect(),x=null,u&&cancelAnimationFrame(C)}}const b6=XT,x6=QT,S6=GT,w6=JT,C6=KT,rb=WT,k6=ZT,E6=(t,e,n)=>{const r=new Map,o={platform:v6,...n},a={...o.platform,_c:r};return VT(t,e,{...o,platform:a})};var A6=typeof document<"u",R6=function(){},_d=A6?N.useLayoutEffect:R6;function Td(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,o;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!Td(t[r],e[r]))return!1;return!0}if(o=Object.keys(t),n=o.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,o[r]))return!1;for(r=n;r--!==0;){const a=o[r];if(!(a==="_owner"&&t.$$typeof)&&!Td(t[a],e[a]))return!1}return!0}return t!==t&&e!==e}function o2(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function sb(t,e){const n=o2(t);return Math.round(e*n)/n}function im(t){const e=N.useRef(t);return _d(()=>{e.current=t}),e}function T6(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:a,floating:c}={},transform:l=!0,whileElementsMounted:u,open:f}=t,[p,h]=N.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[_,x]=N.useState(r);Td(_,r)||x(r);const[C,w]=N.useState(null),[v,b]=N.useState(null),y=N.useCallback(X=>{X!==R.current&&(R.current=X,w(X))},[]),S=N.useCallback(X=>{X!==D.current&&(D.current=X,b(X))},[]),k=a||C,T=c||v,R=N.useRef(null),D=N.useRef(null),A=N.useRef(p),j=u!=null,O=im(u),P=im(o),$=im(f),U=N.useCallback(()=>{if(!R.current||!D.current)return;const X={placement:e,strategy:n,middleware:_};P.current&&(X.platform=P.current),E6(R.current,D.current,X).then(I=>{const L={...I,isPositioned:$.current!==!1};W.current&&!Td(A.current,L)&&(A.current=L,za.flushSync(()=>{h(L)}))})},[_,e,n,P,$]);_d(()=>{f===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,h(X=>({...X,isPositioned:!1})))},[f]);const W=N.useRef(!1);_d(()=>(W.current=!0,()=>{W.current=!1}),[]),_d(()=>{if(k&&(R.current=k),T&&(D.current=T),k&&T){if(O.current)return O.current(k,T,U);U()}},[k,T,U,O,j]);const K=N.useMemo(()=>({reference:R,floating:D,setReference:y,setFloating:S}),[y,S]),V=N.useMemo(()=>({reference:k,floating:T}),[k,T]),Q=N.useMemo(()=>{const X={position:n,left:0,top:0};if(!V.floating)return X;const I=sb(V.floating,p.x),L=sb(V.floating,p.y);return l?{...X,transform:"translate("+I+"px, "+L+"px)",...o2(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:I,top:L}},[n,l,V.floating,p.x,p.y]);return N.useMemo(()=>({...p,update:U,refs:K,elements:V,floatingStyles:Q}),[p,U,K,V,Q])}const N6=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:o}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?rb({element:r.current,padding:o}).fn(n):{}:r?rb({element:r,padding:o}).fn(n):{}}}},M6=(t,e)=>{const n=b6(t);return{name:n.name,fn:n.fn,options:[t,e]}},D6=(t,e)=>{const n=x6(t);return{name:n.name,fn:n.fn,options:[t,e]}},j6=(t,e)=>({fn:k6(t).fn,options:[t,e]}),O6=(t,e)=>{const n=S6(t);return{name:n.name,fn:n.fn,options:[t,e]}},L6=(t,e)=>{const n=w6(t);return{name:n.name,fn:n.fn,options:[t,e]}},I6=(t,e)=>{const n=C6(t);return{name:n.name,fn:n.fn,options:[t,e]}},P6=(t,e)=>{const n=N6(t);return{name:n.name,fn:n.fn,options:[t,e]}};var z6="Arrow",a2=N.forwardRef((t,e)=>{const{children:n,width:r=10,height:o=5,...a}=t;return m.jsx(Xe.svg,{...a,ref:e,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:m.jsx("polygon",{points:"0,0 30,0 15,10"})})});a2.displayName=z6;var B6=a2,Bg="Popper",[l2,Ri]=_r(Bg),[F6,c2]=l2(Bg),u2=t=>{const{__scopePopper:e,children:n}=t,[r,o]=N.useState(null);return m.jsx(F6,{scope:e,anchor:r,onAnchorChange:o,children:n})};u2.displayName=Bg;var d2="PopperAnchor",f2=N.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...o}=t,a=c2(d2,n),c=N.useRef(null),l=ct(e,c),u=N.useRef(null);return N.useEffect(()=>{const f=u.current;u.current=(r==null?void 0:r.current)||c.current,f!==u.current&&a.onAnchorChange(u.current)}),r?null:m.jsx(Xe.div,{...o,ref:l})});f2.displayName=d2;var Fg="PopperContent",[H6,U6]=l2(Fg),h2=N.forwardRef((t,e)=>{var G,q,te,re,oe,se,ye,Ee;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:a="center",alignOffset:c=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:f=[],collisionPadding:p=0,sticky:h="partial",hideWhenDetached:_=!1,updatePositionStrategy:x="optimized",onPlaced:C,...w}=t,v=c2(Fg,n),[b,y]=N.useState(null),S=ct(e,Ae=>y(Ae)),[k,T]=N.useState(null),R=jT(k),D=(G=R==null?void 0:R.width)!=null?G:0,A=(q=R==null?void 0:R.height)!=null?q:0,j=r+(a!=="center"?"-"+a:""),O=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},P=Array.isArray(f)?f:[f],$=P.length>0,U={padding:O,boundary:P.filter(q6),altBoundary:$},{refs:W,floatingStyles:K,placement:V,isPositioned:Q,middlewareData:X}=T6({strategy:"fixed",placement:j,whileElementsMounted:(...Ae)=>y6(...Ae,{animationFrame:x==="always"}),elements:{reference:v.anchor},middleware:[M6({mainAxis:o+A,alignmentAxis:c}),u&&D6({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?j6():void 0,...U}),u&&O6({...U}),L6({...U,apply:({elements:Ae,rects:Be,availableWidth:le,availableHeight:Ce})=>{const{width:ge,height:Oe}=Be.reference,He=Ae.floating.style;He.setProperty("--radix-popper-available-width",`${le}px`),He.setProperty("--radix-popper-available-height",`${Ce}px`),He.setProperty("--radix-popper-anchor-width",`${ge}px`),He.setProperty("--radix-popper-anchor-height",`${Oe}px`)}}),k&&P6({element:k,padding:l}),V6({arrowWidth:D,arrowHeight:A}),_&&I6({strategy:"referenceHidden",...U})]}),[I,L]=g2(V),z=Nn(C);bn(()=>{Q&&(z==null||z())},[Q,z]);const F=(te=X.arrow)==null?void 0:te.x,B=(re=X.arrow)==null?void 0:re.y,Y=((oe=X.arrow)==null?void 0:oe.centerOffset)!==0,[ee,J]=N.useState();return bn(()=>{b&&J(window.getComputedStyle(b).zIndex)},[b]),m.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:Q?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ee,"--radix-popper-transform-origin":[(se=X.transformOrigin)==null?void 0:se.x,(ye=X.transformOrigin)==null?void 0:ye.y].join(" "),...((Ee=X.hide)==null?void 0:Ee.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:m.jsx(H6,{scope:n,placedSide:I,onArrowChange:T,arrowX:F,arrowY:B,shouldHideArrow:Y,children:m.jsx(Xe.div,{"data-side":I,"data-align":L,...w,ref:S,style:{...w.style,animation:Q?void 0:"none"}})})})});h2.displayName=Fg;var p2="PopperArrow",$6={top:"bottom",right:"left",bottom:"top",left:"right"},m2=N.forwardRef(function(e,n){const{__scopePopper:r,...o}=e,a=U6(p2,r),c=$6[a.placedSide];return m.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:m.jsx(B6,{...o,ref:n,style:{...o.style,display:"block"}})})});m2.displayName=p2;function q6(t){return t!==null}var V6=t=>({name:"transformOrigin",options:t,fn(e){var v,b,y,S,k;const{placement:n,rects:r,middlewareData:o}=e,c=((v=o.arrow)==null?void 0:v.centerOffset)!==0,l=c?0:t.arrowWidth,u=c?0:t.arrowHeight,[f,p]=g2(n),h={start:"0%",center:"50%",end:"100%"}[p],_=((y=(b=o.arrow)==null?void 0:b.x)!=null?y:0)+l/2,x=((k=(S=o.arrow)==null?void 0:S.y)!=null?k:0)+u/2;let C="",w="";return f==="bottom"?(C=c?h:`${_}px`,w=`${-u}px`):f==="top"?(C=c?h:`${_}px`,w=`${r.floating.height+u}px`):f==="right"?(C=`${-u}px`,w=c?h:`${x}px`):f==="left"&&(C=`${r.floating.width+u}px`,w=c?h:`${x}px`),{data:{x:C,y:w}}}});function g2(t){const[e,n="center"]=t.split("-");return[e,n]}var uf=u2,Ec=f2,df=h2,ff=m2,om="rovingFocusGroup.onEntryFocus",W6={bubbles:!1,cancelable:!0},Ac="RovingFocusGroup",[Vm,v2,G6]=Sg(Ac),[K6,hf]=_r(Ac,[G6]),[Y6,X6]=K6(Ac),_2=N.forwardRef((t,e)=>m.jsx(Vm.Provider,{scope:t.__scopeRovingFocusGroup,children:m.jsx(Vm.Slot,{scope:t.__scopeRovingFocusGroup,children:m.jsx(Q6,{...t,ref:e})})}));_2.displayName=Ac;var Q6=N.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:a,currentTabStopId:c,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:f,preventScrollOnEntryFocus:p=!1,...h}=t,_=N.useRef(null),x=ct(e,_),C=Sc(a),[w,v]=Ps({prop:c,defaultProp:l!=null?l:null,onChange:u,caller:Ac}),[b,y]=N.useState(!1),S=Nn(f),k=v2(n),T=N.useRef(!1),[R,D]=N.useState(0);return N.useEffect(()=>{const A=_.current;if(A)return A.addEventListener(om,S),()=>A.removeEventListener(om,S)},[S]),m.jsx(Y6,{scope:n,orientation:r,dir:C,loop:o,currentTabStopId:w,onItemFocus:N.useCallback(A=>v(A),[v]),onItemShiftTab:N.useCallback(()=>y(!0),[]),onFocusableItemAdd:N.useCallback(()=>D(A=>A+1),[]),onFocusableItemRemove:N.useCallback(()=>D(A=>A-1),[]),children:m.jsx(Xe.div,{tabIndex:b||R===0?-1:0,"data-orientation":r,...h,ref:x,style:{outline:"none",...t.style},onMouseDown:Ie(t.onMouseDown,()=>{T.current=!0}),onFocus:Ie(t.onFocus,A=>{const j=!T.current;if(A.target===A.currentTarget&&j&&!b){const O=new CustomEvent(om,W6);if(A.currentTarget.dispatchEvent(O),!O.defaultPrevented){const P=k().filter(V=>V.focusable),$=P.find(V=>V.active),U=P.find(V=>V.id===w),K=[$,U,...P].filter(Boolean).map(V=>V.ref.current);x2(K,p)}}T.current=!1}),onBlur:Ie(t.onBlur,()=>y(!1))})})}),y2="RovingFocusGroupItem",b2=N.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:a,children:c,...l}=t,u=mn(),f=a||u,p=X6(y2,n),h=p.currentTabStopId===f,_=v2(n),{onFocusableItemAdd:x,onFocusableItemRemove:C,currentTabStopId:w}=p;return N.useEffect(()=>{if(r)return x(),()=>C()},[r,x,C]),m.jsx(Vm.ItemSlot,{scope:n,id:f,focusable:r,active:o,children:m.jsx(Xe.span,{tabIndex:h?0:-1,"data-orientation":p.orientation,...l,ref:e,onMouseDown:Ie(t.onMouseDown,v=>{r?p.onItemFocus(f):v.preventDefault()}),onFocus:Ie(t.onFocus,()=>p.onItemFocus(f)),onKeyDown:Ie(t.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){p.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const b=eN(v,p.orientation,p.dir);if(b!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let S=_().filter(k=>k.focusable).map(k=>k.ref.current);if(b==="last")S.reverse();else if(b==="prev"||b==="next"){b==="prev"&&S.reverse();const k=S.indexOf(v.currentTarget);S=p.loop?tN(S,k+1):S.slice(k+1)}setTimeout(()=>x2(S))}}),children:typeof c=="function"?c({isCurrentTabStop:h,hasTabStop:w!=null}):c})})});b2.displayName=y2;var Z6={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function J6(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function eN(t,e,n){const r=J6(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Z6[r]}function x2(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function tN(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var S2=_2,w2=b2,Wm=["Enter"," "],nN=["ArrowDown","PageUp","Home"],C2=["ArrowUp","PageDown","End"],rN=[...nN,...C2],sN={ltr:[...Wm,"ArrowRight"],rtl:[...Wm,"ArrowLeft"]},iN={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Rc="Menu",[uc,oN,aN]=Sg(Rc),[xo,k2]=_r(Rc,[aN,Ri,hf]),pf=Ri(),E2=hf(),[lN,So]=xo(Rc),[cN,Tc]=xo(Rc),A2=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:o,onOpenChange:a,modal:c=!0}=t,l=pf(e),[u,f]=N.useState(null),p=N.useRef(!1),h=Nn(a),_=Sc(o);return N.useEffect(()=>{const x=()=>{p.current=!0,document.addEventListener("pointerdown",C,{capture:!0,once:!0}),document.addEventListener("pointermove",C,{capture:!0,once:!0})},C=()=>p.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",C,{capture:!0}),document.removeEventListener("pointermove",C,{capture:!0})}},[]),m.jsx(uf,{...l,children:m.jsx(lN,{scope:e,open:n,onOpenChange:h,content:u,onContentChange:f,children:m.jsx(cN,{scope:e,onClose:N.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:p,dir:_,modal:c,children:r})})})};A2.displayName=Rc;var uN="MenuAnchor",Hg=N.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,o=pf(n);return m.jsx(Ec,{...o,...r,ref:e})});Hg.displayName=uN;var Ug="MenuPortal",[dN,R2]=xo(Ug,{forceMount:void 0}),T2=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:o}=t,a=So(Ug,e);return m.jsx(dN,{scope:e,forceMount:n,children:m.jsx(xn,{present:n||a.open,children:m.jsx(Fa,{asChild:!0,container:o,children:r})})})};T2.displayName=Ug;var Mr="MenuContent",[fN,$g]=xo(Mr),N2=N.forwardRef((t,e)=>{const n=R2(Mr,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,a=So(Mr,t.__scopeMenu),c=Tc(Mr,t.__scopeMenu);return m.jsx(uc.Provider,{scope:t.__scopeMenu,children:m.jsx(xn,{present:r||a.open,children:m.jsx(uc.Slot,{scope:t.__scopeMenu,children:c.modal?m.jsx(hN,{...o,ref:e}):m.jsx(pN,{...o,ref:e})})})})}),hN=N.forwardRef((t,e)=>{const n=So(Mr,t.__scopeMenu),r=N.useRef(null),o=ct(e,r);return N.useEffect(()=>{const a=r.current;if(a)return nf(a)},[]),m.jsx(qg,{...t,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ie(t.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),pN=N.forwardRef((t,e)=>{const n=So(Mr,t.__scopeMenu);return m.jsx(qg,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),mN=xi("MenuContent.ScrollLock"),qg=N.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:c,disableOutsidePointerEvents:l,onEntryFocus:u,onEscapeKeyDown:f,onPointerDownOutside:p,onFocusOutside:h,onInteractOutside:_,onDismiss:x,disableOutsideScroll:C,...w}=t,v=So(Mr,n),b=Tc(Mr,n),y=pf(n),S=E2(n),k=oN(n),[T,R]=N.useState(null),D=N.useRef(null),A=ct(e,D,v.onContentChange),j=N.useRef(0),O=N.useRef(""),P=N.useRef(0),$=N.useRef(null),U=N.useRef("right"),W=N.useRef(0),K=C?Cc:N.Fragment,V=C?{as:mN,allowPinchZoom:!0}:void 0,Q=I=>{var G,q;const L=O.current+I,z=k().filter(te=>!te.disabled),F=document.activeElement,B=(G=z.find(te=>te.ref.current===F))==null?void 0:G.textValue,Y=z.map(te=>te.textValue),ee=AN(Y,L,B),J=(q=z.find(te=>te.textValue===ee))==null?void 0:q.ref.current;(function te(re){O.current=re,window.clearTimeout(j.current),re!==""&&(j.current=window.setTimeout(()=>te(""),1e3))})(L),J&&setTimeout(()=>J.focus())};N.useEffect(()=>()=>window.clearTimeout(j.current),[]),ef();const X=N.useCallback(I=>{var z,F;return U.current===((z=$.current)==null?void 0:z.side)&&TN(I,(F=$.current)==null?void 0:F.area)},[]);return m.jsx(fN,{scope:n,searchRef:O,onItemEnter:N.useCallback(I=>{X(I)&&I.preventDefault()},[X]),onItemLeave:N.useCallback(I=>{var L;X(I)||((L=D.current)==null||L.focus(),R(null))},[X]),onTriggerLeave:N.useCallback(I=>{X(I)&&I.preventDefault()},[X]),pointerGraceTimerRef:P,onPointerGraceIntentChange:N.useCallback(I=>{$.current=I},[]),children:m.jsx(K,{...V,children:m.jsx(wc,{asChild:!0,trapped:o,onMountAutoFocus:Ie(a,I=>{var L;I.preventDefault(),(L=D.current)==null||L.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:m.jsx(Ba,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:f,onPointerDownOutside:p,onFocusOutside:h,onInteractOutside:_,onDismiss:x,children:m.jsx(S2,{asChild:!0,...S,dir:b.dir,orientation:"vertical",loop:r,currentTabStopId:T,onCurrentTabStopIdChange:R,onEntryFocus:Ie(u,I=>{b.isUsingKeyboardRef.current||I.preventDefault()}),preventScrollOnEntryFocus:!0,children:m.jsx(df,{role:"menu","aria-orientation":"vertical","data-state":W2(v.open),"data-radix-menu-content":"",dir:b.dir,...y,...w,ref:A,style:{outline:"none",...w.style},onKeyDown:Ie(w.onKeyDown,I=>{const z=I.target.closest("[data-radix-menu-content]")===I.currentTarget,F=I.ctrlKey||I.altKey||I.metaKey,B=I.key.length===1;z&&(I.key==="Tab"&&I.preventDefault(),!F&&B&&Q(I.key));const Y=D.current;if(I.target!==Y||!rN.includes(I.key))return;I.preventDefault();const J=k().filter(G=>!G.disabled).map(G=>G.ref.current);C2.includes(I.key)&&J.reverse(),kN(J)}),onBlur:Ie(t.onBlur,I=>{I.currentTarget.contains(I.target)||(window.clearTimeout(j.current),O.current="")}),onPointerMove:Ie(t.onPointerMove,dc(I=>{const L=I.target,z=W.current!==I.clientX;if(I.currentTarget.contains(L)&&z){const F=I.clientX>W.current?"right":"left";U.current=F,W.current=I.clientX}}))})})})})})})});N2.displayName=Mr;var gN="MenuGroup",Vg=N.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return m.jsx(Xe.div,{role:"group",...r,ref:e})});Vg.displayName=gN;var vN="MenuLabel",M2=N.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return m.jsx(Xe.div,{...r,ref:e})});M2.displayName=vN;var Nd="MenuItem",ib="menu.itemSelect",mf=N.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...o}=t,a=N.useRef(null),c=Tc(Nd,t.__scopeMenu),l=$g(Nd,t.__scopeMenu),u=ct(e,a),f=N.useRef(!1),p=()=>{const h=a.current;if(!n&&h){const _=new CustomEvent(ib,{bubbles:!0,cancelable:!0});h.addEventListener(ib,x=>r==null?void 0:r(x),{once:!0}),pS(h,_),_.defaultPrevented?f.current=!1:c.onClose()}};return m.jsx(D2,{...o,ref:u,disabled:n,onClick:Ie(t.onClick,p),onPointerDown:h=>{var _;(_=t.onPointerDown)==null||_.call(t,h),f.current=!0},onPointerUp:Ie(t.onPointerUp,h=>{var _;f.current||(_=h.currentTarget)==null||_.click()}),onKeyDown:Ie(t.onKeyDown,h=>{const _=l.searchRef.current!=="";n||_&&h.key===" "||Wm.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});mf.displayName=Nd;var D2=N.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...a}=t,c=$g(Nd,n),l=E2(n),u=N.useRef(null),f=ct(e,u),[p,h]=N.useState(!1),[_,x]=N.useState("");return N.useEffect(()=>{var w;const C=u.current;C&&x(((w=C.textContent)!=null?w:"").trim())},[a.children]),m.jsx(uc.ItemSlot,{scope:n,disabled:r,textValue:o!=null?o:_,children:m.jsx(w2,{asChild:!0,...l,focusable:!r,children:m.jsx(Xe.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:f,onPointerMove:Ie(t.onPointerMove,dc(C=>{r?c.onItemLeave(C):(c.onItemEnter(C),C.defaultPrevented||C.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ie(t.onPointerLeave,dc(C=>c.onItemLeave(C))),onFocus:Ie(t.onFocus,()=>h(!0)),onBlur:Ie(t.onBlur,()=>h(!1))})})})}),_N="MenuCheckboxItem",j2=N.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...o}=t;return m.jsx(z2,{scope:t.__scopeMenu,checked:n,children:m.jsx(mf,{role:"menuitemcheckbox","aria-checked":Md(n)?"mixed":n,...o,ref:e,"data-state":Gg(n),onSelect:Ie(o.onSelect,()=>r==null?void 0:r(Md(n)?!0:!n),{checkForDefaultPrevented:!1})})})});j2.displayName=_N;var O2="MenuRadioGroup",[yN,bN]=xo(O2,{value:void 0,onValueChange:()=>{}}),L2=N.forwardRef((t,e)=>{const{value:n,onValueChange:r,...o}=t,a=Nn(r);return m.jsx(yN,{scope:t.__scopeMenu,value:n,onValueChange:a,children:m.jsx(Vg,{...o,ref:e})})});L2.displayName=O2;var I2="MenuRadioItem",P2=N.forwardRef((t,e)=>{const{value:n,...r}=t,o=bN(I2,t.__scopeMenu),a=n===o.value;return m.jsx(z2,{scope:t.__scopeMenu,checked:a,children:m.jsx(mf,{role:"menuitemradio","aria-checked":a,...r,ref:e,"data-state":Gg(a),onSelect:Ie(r.onSelect,()=>{var c;return(c=o.onValueChange)==null?void 0:c.call(o,n)},{checkForDefaultPrevented:!1})})})});P2.displayName=I2;var Wg="MenuItemIndicator",[z2,xN]=xo(Wg,{checked:!1}),B2=N.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...o}=t,a=xN(Wg,n);return m.jsx(xn,{present:r||Md(a.checked)||a.checked===!0,children:m.jsx(Xe.span,{...o,ref:e,"data-state":Gg(a.checked)})})});B2.displayName=Wg;var SN="MenuSeparator",F2=N.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return m.jsx(Xe.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});F2.displayName=SN;var wN="MenuArrow",H2=N.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,o=pf(n);return m.jsx(ff,{...o,...r,ref:e})});H2.displayName=wN;var CN="MenuSub",[fq,U2]=xo(CN),ec="MenuSubTrigger",$2=N.forwardRef((t,e)=>{const n=So(ec,t.__scopeMenu),r=Tc(ec,t.__scopeMenu),o=U2(ec,t.__scopeMenu),a=$g(ec,t.__scopeMenu),c=N.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:u}=a,f={__scopeMenu:t.__scopeMenu},p=N.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);return N.useEffect(()=>p,[p]),N.useEffect(()=>{const h=l.current;return()=>{window.clearTimeout(h),u(null)}},[l,u]),m.jsx(Hg,{asChild:!0,...f,children:m.jsx(D2,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":W2(n.open),...t,ref:Is(e,o.onTriggerChange),onClick:h=>{var _;(_=t.onClick)==null||_.call(t,h),!(t.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ie(t.onPointerMove,dc(h=>{a.onItemEnter(h),!h.defaultPrevented&&!t.disabled&&!n.open&&!c.current&&(a.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{n.onOpenChange(!0),p()},100))})),onPointerLeave:Ie(t.onPointerLeave,dc(h=>{var x,C;p();const _=(x=n.content)==null?void 0:x.getBoundingClientRect();if(_){const w=(C=n.content)==null?void 0:C.dataset.side,v=w==="right",b=v?-5:5,y=_[v?"left":"right"],S=_[v?"right":"left"];a.onPointerGraceIntentChange({area:[{x:h.clientX+b,y:h.clientY},{x:y,y:_.top},{x:S,y:_.top},{x:S,y:_.bottom},{x:y,y:_.bottom}],side:w}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(h),h.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:Ie(t.onKeyDown,h=>{var x;const _=a.searchRef.current!=="";t.disabled||_&&h.key===" "||sN[r.dir].includes(h.key)&&(n.onOpenChange(!0),(x=n.content)==null||x.focus(),h.preventDefault())})})})});$2.displayName=ec;var q2="MenuSubContent",V2=N.forwardRef((t,e)=>{const n=R2(Mr,t.__scopeMenu),{forceMount:r=n.forceMount,...o}=t,a=So(Mr,t.__scopeMenu),c=Tc(Mr,t.__scopeMenu),l=U2(q2,t.__scopeMenu),u=N.useRef(null),f=ct(e,u);return m.jsx(uc.Provider,{scope:t.__scopeMenu,children:m.jsx(xn,{present:r||a.open,children:m.jsx(uc.Slot,{scope:t.__scopeMenu,children:m.jsx(qg,{id:l.contentId,"aria-labelledby":l.triggerId,...o,ref:f,align:"start",side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{var h;c.isUsingKeyboardRef.current&&((h=u.current)==null||h.focus()),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:Ie(t.onFocusOutside,p=>{p.target!==l.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:Ie(t.onEscapeKeyDown,p=>{c.onClose(),p.preventDefault()}),onKeyDown:Ie(t.onKeyDown,p=>{var x;const h=p.currentTarget.contains(p.target),_=iN[c.dir].includes(p.key);h&&_&&(a.onOpenChange(!1),(x=l.trigger)==null||x.focus(),p.preventDefault())})})})})})});V2.displayName=q2;function W2(t){return t?"open":"closed"}function Md(t){return t==="indeterminate"}function Gg(t){return Md(t)?"indeterminate":t?"checked":"unchecked"}function kN(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function EN(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function AN(t,e,n){const o=e.length>1&&Array.from(e).every(f=>f===e[0])?e[0]:e,a=n?t.indexOf(n):-1;let c=EN(t,Math.max(a,0));o.length===1&&(c=c.filter(f=>f!==n));const u=c.find(f=>f.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function RN(t,e){const{x:n,y:r}=t;let o=!1;for(let a=0,c=e.length-1;a<e.length;c=a++){const l=e[a],u=e[c],f=l.x,p=l.y,h=u.x,_=u.y;p>r!=_>r&&n<(h-f)*(r-p)/(_-p)+f&&(o=!o)}return o}function TN(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return RN(n,e)}function dc(t){return e=>e.pointerType==="mouse"?t(e):void 0}var NN=A2,MN=Hg,DN=T2,jN=N2,ON=Vg,LN=M2,IN=mf,PN=j2,zN=L2,BN=P2,FN=B2,HN=F2,UN=H2,$N=$2,qN=V2,gf="DropdownMenu",[VN]=_r(gf,[k2]),Vn=k2(),[WN,G2]=VN(gf),K2=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:o,defaultOpen:a,onOpenChange:c,modal:l=!0}=t,u=Vn(e),f=N.useRef(null),[p,h]=Ps({prop:o,defaultProp:a!=null?a:!1,onChange:c,caller:gf});return m.jsx(WN,{scope:e,triggerId:mn(),triggerRef:f,contentId:mn(),open:p,onOpenChange:h,onOpenToggle:N.useCallback(()=>h(_=>!_),[h]),modal:l,children:m.jsx(NN,{...u,open:p,onOpenChange:h,dir:r,modal:l,children:n})})};K2.displayName=gf;var Y2="DropdownMenuTrigger",X2=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=t,a=G2(Y2,n),c=Vn(n);return m.jsx(MN,{asChild:!0,...c,children:m.jsx(Xe.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Is(e,a.triggerRef),onPointerDown:Ie(t.onPointerDown,l=>{!r&&l.button===0&&l.ctrlKey===!1&&(a.onOpenToggle(),a.open||l.preventDefault())}),onKeyDown:Ie(t.onKeyDown,l=>{r||(["Enter"," "].includes(l.key)&&a.onOpenToggle(),l.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});X2.displayName=Y2;var GN="DropdownMenuPortal",Q2=t=>{const{__scopeDropdownMenu:e,...n}=t,r=Vn(e);return m.jsx(DN,{...r,...n})};Q2.displayName=GN;var Z2="DropdownMenuContent",J2=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=G2(Z2,n),a=Vn(n),c=N.useRef(!1);return m.jsx(jN,{id:o.contentId,"aria-labelledby":o.triggerId,...a,...r,ref:e,onCloseAutoFocus:Ie(t.onCloseAutoFocus,l=>{var u;c.current||(u=o.triggerRef.current)==null||u.focus(),c.current=!1,l.preventDefault()}),onInteractOutside:Ie(t.onInteractOutside,l=>{const u=l.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0,p=u.button===2||f;(!o.modal||p)&&(c.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});J2.displayName=Z2;var KN="DropdownMenuGroup",YN=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Vn(n);return m.jsx(ON,{...o,...r,ref:e})});YN.displayName=KN;var XN="DropdownMenuLabel",QN=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Vn(n);return m.jsx(LN,{...o,...r,ref:e})});QN.displayName=XN;var ZN="DropdownMenuItem",ew=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Vn(n);return m.jsx(IN,{...o,...r,ref:e})});ew.displayName=ZN;var JN="DropdownMenuCheckboxItem",eM=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Vn(n);return m.jsx(PN,{...o,...r,ref:e})});eM.displayName=JN;var tM="DropdownMenuRadioGroup",nM=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Vn(n);return m.jsx(zN,{...o,...r,ref:e})});nM.displayName=tM;var rM="DropdownMenuRadioItem",sM=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Vn(n);return m.jsx(BN,{...o,...r,ref:e})});sM.displayName=rM;var iM="DropdownMenuItemIndicator",oM=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Vn(n);return m.jsx(FN,{...o,...r,ref:e})});oM.displayName=iM;var aM="DropdownMenuSeparator",lM=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Vn(n);return m.jsx(HN,{...o,...r,ref:e})});lM.displayName=aM;var cM="DropdownMenuArrow",uM=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Vn(n);return m.jsx(UN,{...o,...r,ref:e})});uM.displayName=cM;var dM="DropdownMenuSubTrigger",fM=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Vn(n);return m.jsx($N,{...o,...r,ref:e})});fM.displayName=dM;var hM="DropdownMenuSubContent",pM=N.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,o=Vn(n);return m.jsx(qN,{...o,...r,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});pM.displayName=hM;var mM=K2,gM=X2,vM=Q2,_M=J2,yM=ew,bM="Label",tw=N.forwardRef((t,e)=>m.jsx(Xe.label,{...t,ref:e,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=t.onMouseDown)==null||o.call(t,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));tw.displayName=bM;var xM=tw;function Gm(t,[e,n]){return Math.min(n,Math.max(e,t))}var vf="Popover",[nw]=_r(vf,[Ri]),Nc=Ri(),[SM,Ti]=nw(vf),rw=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:o,onOpenChange:a,modal:c=!1}=t,l=Nc(e),u=N.useRef(null),[f,p]=N.useState(!1),[h,_]=Ps({prop:r,defaultProp:o!=null?o:!1,onChange:a,caller:vf});return m.jsx(uf,{...l,children:m.jsx(SM,{scope:e,contentId:mn(),triggerRef:u,open:h,onOpenChange:_,onOpenToggle:N.useCallback(()=>_(x=>!x),[_]),hasCustomAnchor:f,onCustomAnchorAdd:N.useCallback(()=>p(!0),[]),onCustomAnchorRemove:N.useCallback(()=>p(!1),[]),modal:c,children:n})})};rw.displayName=vf;var sw="PopoverAnchor",iw=N.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,o=Ti(sw,n),a=Nc(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:l}=o;return N.useEffect(()=>(c(),()=>l()),[c,l]),m.jsx(Ec,{...a,...r,ref:e})});iw.displayName=sw;var ow="PopoverTrigger",aw=N.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,o=Ti(ow,n),a=Nc(n),c=ct(e,o.triggerRef),l=m.jsx(Xe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":fw(o.open),...r,ref:c,onClick:Ie(t.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:m.jsx(Ec,{asChild:!0,...a,children:l})});aw.displayName=ow;var Kg="PopoverPortal",[wM,CM]=nw(Kg,{forceMount:void 0}),lw=t=>{const{__scopePopover:e,forceMount:n,children:r,container:o}=t,a=Ti(Kg,e);return m.jsx(wM,{scope:e,forceMount:n,children:m.jsx(xn,{present:n||a.open,children:m.jsx(Fa,{asChild:!0,container:o,children:r})})})};lw.displayName=Kg;var Ra="PopoverContent",cw=N.forwardRef((t,e)=>{const n=CM(Ra,t.__scopePopover),{forceMount:r=n.forceMount,...o}=t,a=Ti(Ra,t.__scopePopover);return m.jsx(xn,{present:r||a.open,children:a.modal?m.jsx(EM,{...o,ref:e}):m.jsx(AM,{...o,ref:e})})});cw.displayName=Ra;var kM=xi("PopoverContent.RemoveScroll"),EM=N.forwardRef((t,e)=>{const n=Ti(Ra,t.__scopePopover),r=N.useRef(null),o=ct(e,r),a=N.useRef(!1);return N.useEffect(()=>{const c=r.current;if(c)return nf(c)},[]),m.jsx(Cc,{as:kM,allowPinchZoom:!0,children:m.jsx(uw,{...t,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ie(t.onCloseAutoFocus,c=>{var l;c.preventDefault(),a.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Ie(t.onPointerDownOutside,c=>{const l=c.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,f=l.button===2||u;a.current=f},{checkForDefaultPrevented:!1}),onFocusOutside:Ie(t.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),AM=N.forwardRef((t,e)=>{const n=Ti(Ra,t.__scopePopover),r=N.useRef(!1),o=N.useRef(!1);return m.jsx(uw,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var c,l;(c=t.onCloseAutoFocus)==null||c.call(t,a),a.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),a.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:a=>{var u,f;(u=t.onInteractOutside)==null||u.call(t,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const c=a.target;((f=n.triggerRef.current)==null?void 0:f.contains(c))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),uw=N.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:p,...h}=t,_=Ti(Ra,n),x=Nc(n);return ef(),m.jsx(wc,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a,children:m.jsx(Ba,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:p,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:f,onDismiss:()=>_.onOpenChange(!1),children:m.jsx(df,{"data-state":fw(_.open),role:"dialog",id:_.contentId,...x,...h,ref:e,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),dw="PopoverClose",RM=N.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,o=Ti(dw,n);return m.jsx(Xe.button,{type:"button",...r,ref:e,onClick:Ie(t.onClick,()=>o.onOpenChange(!1))})});RM.displayName=dw;var TM="PopoverArrow",NM=N.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,o=Nc(n);return m.jsx(ff,{...o,...r,ref:e})});NM.displayName=TM;function fw(t){return t?"open":"closed"}var MM=rw,DM=iw,jM=aw,OM=lw,LM=cw,Yg="Progress",Xg=100,[IM]=_r(Yg),[PM,zM]=IM(Yg),hw=N.forwardRef((t,e)=>{const{__scopeProgress:n,value:r=null,max:o,getValueLabel:a=BM,...c}=t;(o||o===0)&&!ob(o)&&console.error(FM(`${o}`,"Progress"));const l=ob(o)?o:Xg;r!==null&&!ab(r,l)&&console.error(HM(`${r}`,"Progress"));const u=ab(r,l)?r:null,f=Dd(u)?a(u,l):void 0;return m.jsx(PM,{scope:n,value:u,max:l,children:m.jsx(Xe.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":Dd(u)?u:void 0,"aria-valuetext":f,role:"progressbar","data-state":gw(u,l),"data-value":u!=null?u:void 0,"data-max":l,...c,ref:e})})});hw.displayName=Yg;var pw="ProgressIndicator",mw=N.forwardRef((t,e)=>{var a;const{__scopeProgress:n,...r}=t,o=zM(pw,n);return m.jsx(Xe.div,{"data-state":gw(o.value,o.max),"data-value":(a=o.value)!=null?a:void 0,"data-max":o.max,...r,ref:e})});mw.displayName=pw;function BM(t,e){return`${Math.round(t/e*100)}%`}function gw(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function Dd(t){return typeof t=="number"}function ob(t){return Dd(t)&&!isNaN(t)&&t>0}function ab(t,e){return Dd(t)&&!isNaN(t)&&t<=e&&t>=0}function FM(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Xg}\`.`}function HM(t,e){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${e}\`. The \`value\` prop must be:
512
+ - a positive number
513
+ - less than the value passed to \`max\` (or ${Xg} if no \`max\` prop is set)
514
+ - \`null\` or \`undefined\` if the progress is indeterminate.
515
+
516
+ Defaulting to \`null\`.`}var UM=hw,$M=mw;function qM(t,e){return N.useReducer((n,r)=>{const o=e[n][r];return o!=null?o:n},t)}var Qg="ScrollArea",[vw]=_r(Qg),[VM,Dr]=vw(Qg),_w=N.forwardRef((t,e)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:a=600,...c}=t,[l,u]=N.useState(null),[f,p]=N.useState(null),[h,_]=N.useState(null),[x,C]=N.useState(null),[w,v]=N.useState(null),[b,y]=N.useState(0),[S,k]=N.useState(0),[T,R]=N.useState(!1),[D,A]=N.useState(!1),j=ct(e,P=>u(P)),O=Sc(o);return m.jsx(VM,{scope:n,type:r,dir:O,scrollHideDelay:a,scrollArea:l,viewport:f,onViewportChange:p,content:h,onContentChange:_,scrollbarX:x,onScrollbarXChange:C,scrollbarXEnabled:T,onScrollbarXEnabledChange:R,scrollbarY:w,onScrollbarYChange:v,scrollbarYEnabled:D,onScrollbarYEnabledChange:A,onCornerWidthChange:y,onCornerHeightChange:k,children:m.jsx(Xe.div,{dir:O,...c,ref:j,style:{position:"relative","--radix-scroll-area-corner-width":b+"px","--radix-scroll-area-corner-height":S+"px",...t.style}})})});_w.displayName=Qg;var yw="ScrollAreaViewport",bw=N.forwardRef((t,e)=>{const{__scopeScrollArea:n,children:r,nonce:o,...a}=t,c=Dr(yw,n),l=N.useRef(null),u=ct(e,l,c.onViewportChange);return m.jsxs(m.Fragment,{children:[m.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),m.jsx(Xe.div,{"data-radix-scroll-area-viewport":"",...a,ref:u,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...t.style},children:m.jsx("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});bw.displayName=yw;var fs="ScrollAreaScrollbar",xw=N.forwardRef((t,e)=>{const{forceMount:n,...r}=t,o=Dr(fs,t.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:c}=o,l=t.orientation==="horizontal";return N.useEffect(()=>(l?a(!0):c(!0),()=>{l?a(!1):c(!1)}),[l,a,c]),o.type==="hover"?m.jsx(WM,{...r,ref:e,forceMount:n}):o.type==="scroll"?m.jsx(GM,{...r,ref:e,forceMount:n}):o.type==="auto"?m.jsx(Sw,{...r,ref:e,forceMount:n}):o.type==="always"?m.jsx(Zg,{...r,ref:e}):null});xw.displayName=fs;var WM=N.forwardRef((t,e)=>{const{forceMount:n,...r}=t,o=Dr(fs,t.__scopeScrollArea),[a,c]=N.useState(!1);return N.useEffect(()=>{const l=o.scrollArea;let u=0;if(l){const f=()=>{window.clearTimeout(u),c(!0)},p=()=>{u=window.setTimeout(()=>c(!1),o.scrollHideDelay)};return l.addEventListener("pointerenter",f),l.addEventListener("pointerleave",p),()=>{window.clearTimeout(u),l.removeEventListener("pointerenter",f),l.removeEventListener("pointerleave",p)}}},[o.scrollArea,o.scrollHideDelay]),m.jsx(xn,{present:n||a,children:m.jsx(Sw,{"data-state":a?"visible":"hidden",...r,ref:e})})}),GM=N.forwardRef((t,e)=>{const{forceMount:n,...r}=t,o=Dr(fs,t.__scopeScrollArea),a=t.orientation==="horizontal",c=yf(()=>u("SCROLL_END"),100),[l,u]=qM("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return N.useEffect(()=>{if(l==="idle"){const f=window.setTimeout(()=>u("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(f)}},[l,o.scrollHideDelay,u]),N.useEffect(()=>{const f=o.viewport,p=a?"scrollLeft":"scrollTop";if(f){let h=f[p];const _=()=>{const x=f[p];h!==x&&(u("SCROLL"),c()),h=x};return f.addEventListener("scroll",_),()=>f.removeEventListener("scroll",_)}},[o.viewport,a,u,c]),m.jsx(xn,{present:n||l!=="hidden",children:m.jsx(Zg,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:e,onPointerEnter:Ie(t.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:Ie(t.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),Sw=N.forwardRef((t,e)=>{const n=Dr(fs,t.__scopeScrollArea),{forceMount:r,...o}=t,[a,c]=N.useState(!1),l=t.orientation==="horizontal",u=yf(()=>{if(n.viewport){const f=n.viewport.offsetWidth<n.viewport.scrollWidth,p=n.viewport.offsetHeight<n.viewport.scrollHeight;c(l?f:p)}},10);return Ta(n.viewport,u),Ta(n.content,u),m.jsx(xn,{present:r||a,children:m.jsx(Zg,{"data-state":a?"visible":"hidden",...o,ref:e})})}),Zg=N.forwardRef((t,e)=>{const{orientation:n="vertical",...r}=t,o=Dr(fs,t.__scopeScrollArea),a=N.useRef(null),c=N.useRef(0),[l,u]=N.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=Aw(l.viewport,l.content),p={...r,sizes:l,onSizesChange:u,hasThumb:f>0&&f<1,onThumbChange:_=>a.current=_,onThumbPointerUp:()=>c.current=0,onThumbPointerDown:_=>c.current=_};function h(_,x){return JM(_,c.current,l,x)}return n==="horizontal"?m.jsx(KM,{...p,ref:e,onThumbPositionChange:()=>{if(o.viewport&&a.current){const _=o.viewport.scrollLeft,x=lb(_,l,o.dir);a.current.style.transform=`translate3d(${x}px, 0, 0)`}},onWheelScroll:_=>{o.viewport&&(o.viewport.scrollLeft=_)},onDragScroll:_=>{o.viewport&&(o.viewport.scrollLeft=h(_,o.dir))}}):n==="vertical"?m.jsx(YM,{...p,ref:e,onThumbPositionChange:()=>{if(o.viewport&&a.current){const _=o.viewport.scrollTop,x=lb(_,l);a.current.style.transform=`translate3d(0, ${x}px, 0)`}},onWheelScroll:_=>{o.viewport&&(o.viewport.scrollTop=_)},onDragScroll:_=>{o.viewport&&(o.viewport.scrollTop=h(_))}}):null}),KM=N.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...o}=t,a=Dr(fs,t.__scopeScrollArea),[c,l]=N.useState(),u=N.useRef(null),f=ct(e,u,a.onScrollbarXChange);return N.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),m.jsx(Cw,{"data-orientation":"horizontal",...o,ref:f,sizes:n,style:{bottom:0,left:a.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:a.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":_f(n)+"px",...t.style},onThumbPointerDown:p=>t.onThumbPointerDown(p.x),onDragScroll:p=>t.onDragScroll(p.x),onWheelScroll:(p,h)=>{if(a.viewport){const _=a.viewport.scrollLeft+p.deltaX;t.onWheelScroll(_),Tw(_,h)&&p.preventDefault()}},onResize:()=>{u.current&&a.viewport&&c&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:Od(c.paddingLeft),paddingEnd:Od(c.paddingRight)}})}})}),YM=N.forwardRef((t,e)=>{const{sizes:n,onSizesChange:r,...o}=t,a=Dr(fs,t.__scopeScrollArea),[c,l]=N.useState(),u=N.useRef(null),f=ct(e,u,a.onScrollbarYChange);return N.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),m.jsx(Cw,{"data-orientation":"vertical",...o,ref:f,sizes:n,style:{top:0,right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":_f(n)+"px",...t.style},onThumbPointerDown:p=>t.onThumbPointerDown(p.y),onDragScroll:p=>t.onDragScroll(p.y),onWheelScroll:(p,h)=>{if(a.viewport){const _=a.viewport.scrollTop+p.deltaY;t.onWheelScroll(_),Tw(_,h)&&p.preventDefault()}},onResize:()=>{u.current&&a.viewport&&c&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:Od(c.paddingTop),paddingEnd:Od(c.paddingBottom)}})}})}),[XM,ww]=vw(fs),Cw=N.forwardRef((t,e)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:a,onThumbPointerUp:c,onThumbPointerDown:l,onThumbPositionChange:u,onDragScroll:f,onWheelScroll:p,onResize:h,..._}=t,x=Dr(fs,n),[C,w]=N.useState(null),v=ct(e,j=>w(j)),b=N.useRef(null),y=N.useRef(""),S=x.viewport,k=r.content-r.viewport,T=Nn(p),R=Nn(u),D=yf(h,10);function A(j){if(b.current){const O=j.clientX-b.current.left,P=j.clientY-b.current.top;f({x:O,y:P})}}return N.useEffect(()=>{const j=O=>{const P=O.target;(C==null?void 0:C.contains(P))&&T(O,k)};return document.addEventListener("wheel",j,{passive:!1}),()=>document.removeEventListener("wheel",j,{passive:!1})},[S,C,k,T]),N.useEffect(R,[r,R]),Ta(C,D),Ta(x.content,D),m.jsx(XM,{scope:n,scrollbar:C,hasThumb:o,onThumbChange:Nn(a),onThumbPointerUp:Nn(c),onThumbPositionChange:R,onThumbPointerDown:Nn(l),children:m.jsx(Xe.div,{..._,ref:v,style:{position:"absolute",..._.style},onPointerDown:Ie(t.onPointerDown,j=>{j.button===0&&(j.target.setPointerCapture(j.pointerId),b.current=C.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",x.viewport&&(x.viewport.style.scrollBehavior="auto"),A(j))}),onPointerMove:Ie(t.onPointerMove,A),onPointerUp:Ie(t.onPointerUp,j=>{const O=j.target;O.hasPointerCapture(j.pointerId)&&O.releasePointerCapture(j.pointerId),document.body.style.webkitUserSelect=y.current,x.viewport&&(x.viewport.style.scrollBehavior=""),b.current=null})})})}),jd="ScrollAreaThumb",kw=N.forwardRef((t,e)=>{const{forceMount:n,...r}=t,o=ww(jd,t.__scopeScrollArea);return m.jsx(xn,{present:n||o.hasThumb,children:m.jsx(QM,{ref:e,...r})})}),QM=N.forwardRef((t,e)=>{const{__scopeScrollArea:n,style:r,...o}=t,a=Dr(jd,n),c=ww(jd,n),{onThumbPositionChange:l}=c,u=ct(e,h=>c.onThumbChange(h)),f=N.useRef(void 0),p=yf(()=>{f.current&&(f.current(),f.current=void 0)},100);return N.useEffect(()=>{const h=a.viewport;if(h){const _=()=>{if(p(),!f.current){const x=eD(h,l);f.current=x,l()}};return l(),h.addEventListener("scroll",_),()=>h.removeEventListener("scroll",_)}},[a.viewport,p,l]),m.jsx(Xe.div,{"data-state":c.hasThumb?"visible":"hidden",...o,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Ie(t.onPointerDownCapture,h=>{const x=h.target.getBoundingClientRect(),C=h.clientX-x.left,w=h.clientY-x.top;c.onThumbPointerDown({x:C,y:w})}),onPointerUp:Ie(t.onPointerUp,c.onThumbPointerUp)})});kw.displayName=jd;var Jg="ScrollAreaCorner",Ew=N.forwardRef((t,e)=>{const n=Dr(Jg,t.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?m.jsx(ZM,{...t,ref:e}):null});Ew.displayName=Jg;var ZM=N.forwardRef((t,e)=>{const{__scopeScrollArea:n,...r}=t,o=Dr(Jg,n),[a,c]=N.useState(0),[l,u]=N.useState(0),f=!!(a&&l);return Ta(o.scrollbarX,()=>{var h;const p=((h=o.scrollbarX)==null?void 0:h.offsetHeight)||0;o.onCornerHeightChange(p),u(p)}),Ta(o.scrollbarY,()=>{var h;const p=((h=o.scrollbarY)==null?void 0:h.offsetWidth)||0;o.onCornerWidthChange(p),c(p)}),f?m.jsx(Xe.div,{...r,ref:e,style:{width:a,height:l,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function Od(t){return t?parseInt(t,10):0}function Aw(t,e){const n=t/e;return isNaN(n)?0:n}function _f(t){const e=Aw(t.viewport,t.content),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,r=(t.scrollbar.size-n)*e;return Math.max(r,18)}function JM(t,e,n,r="ltr"){const o=_f(n),a=o/2,c=e||a,l=o-c,u=n.scrollbar.paddingStart+c,f=n.scrollbar.size-n.scrollbar.paddingEnd-l,p=n.content-n.viewport,h=r==="ltr"?[0,p]:[p*-1,0];return Rw([u,f],h)(t)}function lb(t,e,n="ltr"){const r=_f(e),o=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,a=e.scrollbar.size-o,c=e.content-e.viewport,l=a-r,u=n==="ltr"?[0,c]:[c*-1,0],f=Gm(t,u);return Rw([0,c],[0,l])(f)}function Rw(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function Tw(t,e){return t>0&&t<e}var eD=(t,e=()=>{})=>{let n={left:t.scrollLeft,top:t.scrollTop},r=0;return(function o(){const a={left:t.scrollLeft,top:t.scrollTop},c=n.left!==a.left,l=n.top!==a.top;(c||l)&&e(),n=a,r=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(r)};function yf(t,e){const n=Nn(t),r=N.useRef(0);return N.useEffect(()=>()=>window.clearTimeout(r.current),[]),N.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,e)},[n,e])}function Ta(t,e){const n=Nn(e);bn(()=>{let r=0;if(t){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(t),()=>{window.cancelAnimationFrame(r),o.unobserve(t)}}},[t,n])}var tD=_w,nD=bw,rD=Ew,sD=[" ","Enter","ArrowUp","ArrowDown"],iD=[" ","Enter"],vo="Select",[bf,xf,oD]=Sg(vo),[$a]=_r(vo,[oD,Ri]),Sf=Ri(),[aD,Ni]=$a(vo),[lD,cD]=$a(vo),Nw=t=>{const{__scopeSelect:e,children:n,open:r,defaultOpen:o,onOpenChange:a,value:c,defaultValue:l,onValueChange:u,dir:f,name:p,autoComplete:h,disabled:_,required:x,form:C}=t,w=Sf(e),[v,b]=N.useState(null),[y,S]=N.useState(null),[k,T]=N.useState(!1),R=Sc(f),[D,A]=Ps({prop:r,defaultProp:o!=null?o:!1,onChange:a,caller:vo}),[j,O]=Ps({prop:c,defaultProp:l,onChange:u,caller:vo}),P=N.useRef(null),$=v?C||!!v.closest("form"):!0,[U,W]=N.useState(new Set),K=Array.from(U).map(V=>V.props.value).join(";");return m.jsx(uf,{...w,children:m.jsxs(aD,{required:x,scope:e,trigger:v,onTriggerChange:b,valueNode:y,onValueNodeChange:S,valueNodeHasChildren:k,onValueNodeHasChildrenChange:T,contentId:mn(),value:j,onValueChange:O,open:D,onOpenChange:A,dir:R,triggerPointerDownPosRef:P,disabled:_,children:[m.jsx(bf.Provider,{scope:e,children:m.jsx(lD,{scope:t.__scopeSelect,onNativeOptionAdd:N.useCallback(V=>{W(Q=>new Set(Q).add(V))},[]),onNativeOptionRemove:N.useCallback(V=>{W(Q=>{const X=new Set(Q);return X.delete(V),X})},[]),children:n})}),$?m.jsxs(eC,{"aria-hidden":!0,required:x,tabIndex:-1,name:p,autoComplete:h,value:j,onChange:V=>O(V.target.value),disabled:_,form:C,children:[j===void 0?m.jsx("option",{value:""}):null,Array.from(U)]},K):null]})})};Nw.displayName=vo;var Mw="SelectTrigger",Dw=N.forwardRef((t,e)=>{const{__scopeSelect:n,disabled:r=!1,...o}=t,a=Sf(n),c=Ni(Mw,n),l=c.disabled||r,u=ct(e,c.onTriggerChange),f=xf(n),p=N.useRef("touch"),[h,_,x]=nC(w=>{const v=f().filter(S=>!S.disabled),b=v.find(S=>S.value===c.value),y=rC(v,w,b);y!==void 0&&c.onValueChange(y.value)}),C=w=>{l||(c.onOpenChange(!0),x()),w&&(c.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})};return m.jsx(Ec,{asChild:!0,...a,children:m.jsx(Xe.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":tC(c.value)?"":void 0,...o,ref:u,onClick:Ie(o.onClick,w=>{w.currentTarget.focus(),p.current!=="mouse"&&C(w)}),onPointerDown:Ie(o.onPointerDown,w=>{p.current=w.pointerType;const v=w.target;v.hasPointerCapture(w.pointerId)&&v.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(C(w),w.preventDefault())}),onKeyDown:Ie(o.onKeyDown,w=>{const v=h.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&_(w.key),!(v&&w.key===" ")&&sD.includes(w.key)&&(C(),w.preventDefault())})})})});Dw.displayName=Mw;var jw="SelectValue",Ow=N.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:o,children:a,placeholder:c="",...l}=t,u=Ni(jw,n),{onValueNodeHasChildrenChange:f}=u,p=a!==void 0,h=ct(e,u.onValueNodeChange);return bn(()=>{f(p)},[f,p]),m.jsx(Xe.span,{...l,ref:h,style:{pointerEvents:"none"},children:tC(u.value)?m.jsx(m.Fragment,{children:c}):a})});Ow.displayName=jw;var uD="SelectIcon",Lw=N.forwardRef((t,e)=>{const{__scopeSelect:n,children:r,...o}=t;return m.jsx(Xe.span,{"aria-hidden":!0,...o,ref:e,children:r||"▼"})});Lw.displayName=uD;var dD="SelectPortal",Iw=t=>m.jsx(Fa,{asChild:!0,...t});Iw.displayName=dD;var _o="SelectContent",Pw=N.forwardRef((t,e)=>{const n=Ni(_o,t.__scopeSelect),[r,o]=N.useState();if(bn(()=>{o(new DocumentFragment)},[]),!n.open){const a=r;return a?za.createPortal(m.jsx(zw,{scope:t.__scopeSelect,children:m.jsx(bf.Slot,{scope:t.__scopeSelect,children:m.jsx("div",{children:t.children})})}),a):null}return m.jsx(Bw,{...t,ref:e})});Pw.displayName=_o;var $r=10,[zw,Mi]=$a(_o),fD="SelectContentImpl",hD=xi("SelectContent.RemoveScroll"),Bw=N.forwardRef((t,e)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:a,onPointerDownOutside:c,side:l,sideOffset:u,align:f,alignOffset:p,arrowPadding:h,collisionBoundary:_,collisionPadding:x,sticky:C,hideWhenDetached:w,avoidCollisions:v,...b}=t,y=Ni(_o,n),[S,k]=N.useState(null),[T,R]=N.useState(null),D=ct(e,G=>k(G)),[A,j]=N.useState(null),[O,P]=N.useState(null),$=xf(n),[U,W]=N.useState(!1),K=N.useRef(!1);N.useEffect(()=>{if(S)return nf(S)},[S]),ef();const V=N.useCallback(G=>{const[q,...te]=$().map(se=>se.ref.current),[re]=te.slice(-1),oe=document.activeElement;for(const se of G)if(se===oe||(se==null||se.scrollIntoView({block:"nearest"}),se===q&&T&&(T.scrollTop=0),se===re&&T&&(T.scrollTop=T.scrollHeight),se==null||se.focus(),document.activeElement!==oe))return},[$,T]),Q=N.useCallback(()=>V([A,S]),[V,A,S]);N.useEffect(()=>{U&&Q()},[U,Q]);const{onOpenChange:X,triggerPointerDownPosRef:I}=y;N.useEffect(()=>{if(S){let G={x:0,y:0};const q=re=>{var oe,se,ye,Ee;G={x:Math.abs(Math.round(re.pageX)-((se=(oe=I.current)==null?void 0:oe.x)!=null?se:0)),y:Math.abs(Math.round(re.pageY)-((Ee=(ye=I.current)==null?void 0:ye.y)!=null?Ee:0))}},te=re=>{G.x<=10&&G.y<=10?re.preventDefault():S.contains(re.target)||X(!1),document.removeEventListener("pointermove",q),I.current=null};return I.current!==null&&(document.addEventListener("pointermove",q),document.addEventListener("pointerup",te,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",q),document.removeEventListener("pointerup",te,{capture:!0})}}},[S,X,I]),N.useEffect(()=>{const G=()=>X(!1);return window.addEventListener("blur",G),window.addEventListener("resize",G),()=>{window.removeEventListener("blur",G),window.removeEventListener("resize",G)}},[X]);const[L,z]=nC(G=>{const q=$().filter(oe=>!oe.disabled),te=q.find(oe=>oe.ref.current===document.activeElement),re=rC(q,G,te);re&&setTimeout(()=>re.ref.current.focus())}),F=N.useCallback((G,q,te)=>{const re=!K.current&&!te;(y.value!==void 0&&y.value===q||re)&&(j(G),re&&(K.current=!0))},[y.value]),B=N.useCallback(()=>S==null?void 0:S.focus(),[S]),Y=N.useCallback((G,q,te)=>{const re=!K.current&&!te;(y.value!==void 0&&y.value===q||re)&&P(G)},[y.value]),ee=r==="popper"?Km:Fw,J=ee===Km?{side:l,sideOffset:u,align:f,alignOffset:p,arrowPadding:h,collisionBoundary:_,collisionPadding:x,sticky:C,hideWhenDetached:w,avoidCollisions:v}:{};return m.jsx(zw,{scope:n,content:S,viewport:T,onViewportChange:R,itemRefCallback:F,selectedItem:A,onItemLeave:B,itemTextRefCallback:Y,focusSelectedItem:Q,selectedItemText:O,position:r,isPositioned:U,searchRef:L,children:m.jsx(Cc,{as:hD,allowPinchZoom:!0,children:m.jsx(wc,{asChild:!0,trapped:y.open,onMountAutoFocus:G=>{G.preventDefault()},onUnmountAutoFocus:Ie(o,G=>{var q;(q=y.trigger)==null||q.focus({preventScroll:!0}),G.preventDefault()}),children:m.jsx(Ba,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:G=>G.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:m.jsx(ee,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:G=>G.preventDefault(),...b,...J,onPlaced:()=>W(!0),ref:D,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:Ie(b.onKeyDown,G=>{const q=G.ctrlKey||G.altKey||G.metaKey;if(G.key==="Tab"&&G.preventDefault(),!q&&G.key.length===1&&z(G.key),["ArrowUp","ArrowDown","Home","End"].includes(G.key)){let re=$().filter(oe=>!oe.disabled).map(oe=>oe.ref.current);if(["ArrowUp","End"].includes(G.key)&&(re=re.slice().reverse()),["ArrowUp","ArrowDown"].includes(G.key)){const oe=G.target,se=re.indexOf(oe);re=re.slice(se+1)}setTimeout(()=>V(re)),G.preventDefault()}})})})})})})});Bw.displayName=fD;var pD="SelectItemAlignedPosition",Fw=N.forwardRef((t,e)=>{const{__scopeSelect:n,onPlaced:r,...o}=t,a=Ni(_o,n),c=Mi(_o,n),[l,u]=N.useState(null),[f,p]=N.useState(null),h=ct(e,D=>p(D)),_=xf(n),x=N.useRef(!1),C=N.useRef(!0),{viewport:w,selectedItem:v,selectedItemText:b,focusSelectedItem:y}=c,S=N.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&f&&w&&v&&b){const D=a.trigger.getBoundingClientRect(),A=f.getBoundingClientRect(),j=a.valueNode.getBoundingClientRect(),O=b.getBoundingClientRect();if(a.dir!=="rtl"){const oe=O.left-A.left,se=j.left-oe,ye=D.left-se,Ee=D.width+ye,Ae=Math.max(Ee,A.width),Be=window.innerWidth-$r,le=Gm(se,[$r,Math.max($r,Be-Ae)]);l.style.minWidth=Ee+"px",l.style.left=le+"px"}else{const oe=A.right-O.right,se=window.innerWidth-j.right-oe,ye=window.innerWidth-D.right-se,Ee=D.width+ye,Ae=Math.max(Ee,A.width),Be=window.innerWidth-$r,le=Gm(se,[$r,Math.max($r,Be-Ae)]);l.style.minWidth=Ee+"px",l.style.right=le+"px"}const P=_(),$=window.innerHeight-$r*2,U=w.scrollHeight,W=window.getComputedStyle(f),K=parseInt(W.borderTopWidth,10),V=parseInt(W.paddingTop,10),Q=parseInt(W.borderBottomWidth,10),X=parseInt(W.paddingBottom,10),I=K+V+U+X+Q,L=Math.min(v.offsetHeight*5,I),z=window.getComputedStyle(w),F=parseInt(z.paddingTop,10),B=parseInt(z.paddingBottom,10),Y=D.top+D.height/2-$r,ee=$-Y,J=v.offsetHeight/2,G=v.offsetTop+J,q=K+V+G,te=I-q;if(q<=Y){const oe=P.length>0&&v===P[P.length-1].ref.current;l.style.bottom="0px";const se=f.clientHeight-w.offsetTop-w.offsetHeight,ye=Math.max(ee,J+(oe?B:0)+se+Q),Ee=q+ye;l.style.height=Ee+"px"}else{const oe=P.length>0&&v===P[0].ref.current;l.style.top="0px";const ye=Math.max(Y,K+w.offsetTop+(oe?F:0)+J)+te;l.style.height=ye+"px",w.scrollTop=q-Y+w.offsetTop}l.style.margin=`${$r}px 0`,l.style.minHeight=L+"px",l.style.maxHeight=$+"px",r==null||r(),requestAnimationFrame(()=>x.current=!0)}},[_,a.trigger,a.valueNode,l,f,w,v,b,a.dir,r]);bn(()=>S(),[S]);const[k,T]=N.useState();bn(()=>{f&&T(window.getComputedStyle(f).zIndex)},[f]);const R=N.useCallback(D=>{D&&C.current===!0&&(S(),y==null||y(),C.current=!1)},[S,y]);return m.jsx(gD,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:x,onScrollButtonChange:R,children:m.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:m.jsx(Xe.div,{...o,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});Fw.displayName=pD;var mD="SelectPopperPosition",Km=N.forwardRef((t,e)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=$r,...a}=t,c=Sf(n);return m.jsx(df,{...c,...a,ref:e,align:r,collisionPadding:o,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Km.displayName=mD;var[gD,ev]=$a(_o,{}),Ym="SelectViewport",Hw=N.forwardRef((t,e)=>{const{__scopeSelect:n,nonce:r,...o}=t,a=Mi(Ym,n),c=ev(Ym,n),l=ct(e,a.onViewportChange),u=N.useRef(0);return m.jsxs(m.Fragment,{children:[m.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),m.jsx(bf.Slot,{scope:n,children:m.jsx(Xe.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Ie(o.onScroll,f=>{const p=f.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:_}=c;if(_!=null&&_.current&&h){const x=Math.abs(u.current-p.scrollTop);if(x>0){const C=window.innerHeight-$r*2,w=parseFloat(h.style.minHeight),v=parseFloat(h.style.height),b=Math.max(w,v);if(b<C){const y=b+x,S=Math.min(C,y),k=y-S;h.style.height=S+"px",h.style.bottom==="0px"&&(p.scrollTop=k>0?k:0,h.style.justifyContent="flex-end")}}}u.current=p.scrollTop})})})]})});Hw.displayName=Ym;var Uw="SelectGroup",[vD,_D]=$a(Uw),$w=N.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,o=mn();return m.jsx(vD,{scope:n,id:o,children:m.jsx(Xe.div,{role:"group","aria-labelledby":o,...r,ref:e})})});$w.displayName=Uw;var qw="SelectLabel",Vw=N.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,o=_D(qw,n);return m.jsx(Xe.div,{id:o.id,...r,ref:e})});Vw.displayName=qw;var Ld="SelectItem",[yD,Ww]=$a(Ld),Gw=N.forwardRef((t,e)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:a,...c}=t,l=Ni(Ld,n),u=Mi(Ld,n),f=l.value===r,[p,h]=N.useState(a!=null?a:""),[_,x]=N.useState(!1),C=ct(e,y=>{var S;return(S=u.itemRefCallback)==null?void 0:S.call(u,y,r,o)}),w=mn(),v=N.useRef("touch"),b=()=>{o||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return m.jsx(yD,{scope:n,value:r,disabled:o,textId:w,isSelected:f,onItemTextChange:N.useCallback(y=>{h(S=>{var k;return S||((k=y==null?void 0:y.textContent)!=null?k:"").trim()})},[]),children:m.jsx(bf.ItemSlot,{scope:n,value:r,disabled:o,textValue:p,children:m.jsx(Xe.div,{role:"option","aria-labelledby":w,"data-highlighted":_?"":void 0,"aria-selected":f&&_,"data-state":f?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...c,ref:C,onFocus:Ie(c.onFocus,()=>x(!0)),onBlur:Ie(c.onBlur,()=>x(!1)),onClick:Ie(c.onClick,()=>{v.current!=="mouse"&&b()}),onPointerUp:Ie(c.onPointerUp,()=>{v.current==="mouse"&&b()}),onPointerDown:Ie(c.onPointerDown,y=>{v.current=y.pointerType}),onPointerMove:Ie(c.onPointerMove,y=>{var S;v.current=y.pointerType,o?(S=u.onItemLeave)==null||S.call(u):v.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ie(c.onPointerLeave,y=>{var S;y.currentTarget===document.activeElement&&((S=u.onItemLeave)==null||S.call(u))}),onKeyDown:Ie(c.onKeyDown,y=>{var k;((k=u.searchRef)==null?void 0:k.current)!==""&&y.key===" "||(iD.includes(y.key)&&b(),y.key===" "&&y.preventDefault())})})})})});Gw.displayName=Ld;var tc="SelectItemText",Kw=N.forwardRef((t,e)=>{const{__scopeSelect:n,className:r,style:o,...a}=t,c=Ni(tc,n),l=Mi(tc,n),u=Ww(tc,n),f=cD(tc,n),[p,h]=N.useState(null),_=ct(e,b=>h(b),u.onItemTextChange,b=>{var y;return(y=l.itemTextRefCallback)==null?void 0:y.call(l,b,u.value,u.disabled)}),x=p==null?void 0:p.textContent,C=N.useMemo(()=>m.jsx("option",{value:u.value,disabled:u.disabled,children:x},u.value),[u.disabled,u.value,x]),{onNativeOptionAdd:w,onNativeOptionRemove:v}=f;return bn(()=>(w(C),()=>v(C)),[w,v,C]),m.jsxs(m.Fragment,{children:[m.jsx(Xe.span,{id:u.textId,...a,ref:_}),u.isSelected&&c.valueNode&&!c.valueNodeHasChildren?za.createPortal(a.children,c.valueNode):null]})});Kw.displayName=tc;var Yw="SelectItemIndicator",Xw=N.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return Ww(Yw,n).isSelected?m.jsx(Xe.span,{"aria-hidden":!0,...r,ref:e}):null});Xw.displayName=Yw;var Xm="SelectScrollUpButton",Qw=N.forwardRef((t,e)=>{const n=Mi(Xm,t.__scopeSelect),r=ev(Xm,t.__scopeSelect),[o,a]=N.useState(!1),c=ct(e,r.onScrollButtonChange);return bn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const f=u.scrollTop>0;a(f)};const u=n.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?m.jsx(Jw,{...t,ref:c,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=n;l&&u&&(l.scrollTop=l.scrollTop-u.offsetHeight)}}):null});Qw.displayName=Xm;var Qm="SelectScrollDownButton",Zw=N.forwardRef((t,e)=>{const n=Mi(Qm,t.__scopeSelect),r=ev(Qm,t.__scopeSelect),[o,a]=N.useState(!1),c=ct(e,r.onScrollButtonChange);return bn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const f=u.scrollHeight-u.clientHeight,p=Math.ceil(u.scrollTop)<f;a(p)};const u=n.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?m.jsx(Jw,{...t,ref:c,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=n;l&&u&&(l.scrollTop=l.scrollTop+u.offsetHeight)}}):null});Zw.displayName=Qm;var Jw=N.forwardRef((t,e)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=t,a=Mi("SelectScrollButton",n),c=N.useRef(null),l=xf(n),u=N.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return N.useEffect(()=>()=>u(),[u]),bn(()=>{var p;const f=l().find(h=>h.ref.current===document.activeElement);(p=f==null?void 0:f.ref.current)==null||p.scrollIntoView({block:"nearest"})},[l]),m.jsx(Xe.div,{"aria-hidden":!0,...o,ref:e,style:{flexShrink:0,...o.style},onPointerDown:Ie(o.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(r,50))}),onPointerMove:Ie(o.onPointerMove,()=>{var f;(f=a.onItemLeave)==null||f.call(a),c.current===null&&(c.current=window.setInterval(r,50))}),onPointerLeave:Ie(o.onPointerLeave,()=>{u()})})}),bD="SelectSeparator",xD=N.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t;return m.jsx(Xe.div,{"aria-hidden":!0,...r,ref:e})});xD.displayName=bD;var Zm="SelectArrow",SD=N.forwardRef((t,e)=>{const{__scopeSelect:n,...r}=t,o=Sf(n),a=Ni(Zm,n),c=Mi(Zm,n);return a.open&&c.position==="popper"?m.jsx(ff,{...o,...r,ref:e}):null});SD.displayName=Zm;var wD="SelectBubbleInput",eC=N.forwardRef(({__scopeSelect:t,value:e,...n},r)=>{const o=N.useRef(null),a=ct(r,o),c=DT(e);return N.useEffect(()=>{const l=o.current;if(!l)return;const u=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(u,"value").set;if(c!==e&&p){const h=new Event("change",{bubbles:!0});p.call(l,e),l.dispatchEvent(h)}},[c,e]),m.jsx(Xe.select,{...n,style:{...mS,...n.style},ref:a,defaultValue:e})});eC.displayName=wD;function tC(t){return t===""||t===void 0}function nC(t){const e=Nn(t),n=N.useRef(""),r=N.useRef(0),o=N.useCallback(c=>{const l=n.current+c;e(l),(function u(f){n.current=f,window.clearTimeout(r.current),f!==""&&(r.current=window.setTimeout(()=>u(""),1e3))})(l)},[e]),a=N.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return N.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,a]}function rC(t,e,n){const o=e.length>1&&Array.from(e).every(f=>f===e[0])?e[0]:e,a=n?t.indexOf(n):-1;let c=CD(t,Math.max(a,0));o.length===1&&(c=c.filter(f=>f!==n));const u=c.find(f=>f.textValue.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}function CD(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var kD=Nw,ED=Dw,AD=Ow,RD=Lw,TD=Iw,ND=Pw,MD=Hw,DD=$w,jD=Vw,OD=Gw,LD=Kw,ID=Xw,PD=Qw,zD=Zw,BD="Separator",cb="horizontal",FD=["horizontal","vertical"],sC=N.forwardRef((t,e)=>{const{decorative:n,orientation:r=cb,...o}=t,a=HD(r)?r:cb,l=n?{role:"none"}:{"aria-orientation":a==="vertical"?a:void 0,role:"separator"};return m.jsx(Xe.div,{"data-orientation":a,...l,...o,ref:e})});sC.displayName=BD;function HD(t){return FD.includes(t)}var UD=sC,wf="Tabs",[$D]=_r(wf,[hf]),iC=hf(),[qD,tv]=$D(wf),oC=N.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:a,orientation:c="horizontal",dir:l,activationMode:u="automatic",...f}=t,p=Sc(l),[h,_]=Ps({prop:r,onChange:o,defaultProp:a!=null?a:"",caller:wf});return m.jsx(qD,{scope:n,baseId:mn(),value:h,onValueChange:_,orientation:c,dir:p,activationMode:u,children:m.jsx(Xe.div,{dir:p,"data-orientation":c,...f,ref:e})})});oC.displayName=wf;var aC="TabsList",lC=N.forwardRef((t,e)=>{const{__scopeTabs:n,loop:r=!0,...o}=t,a=tv(aC,n),c=iC(n);return m.jsx(S2,{asChild:!0,...c,orientation:a.orientation,dir:a.dir,loop:r,children:m.jsx(Xe.div,{role:"tablist","aria-orientation":a.orientation,...o,ref:e})})});lC.displayName=aC;var cC="TabsTrigger",uC=N.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...a}=t,c=tv(cC,n),l=iC(n),u=hC(c.baseId,r),f=pC(c.baseId,r),p=r===c.value;return m.jsx(w2,{asChild:!0,...l,focusable:!o,active:p,children:m.jsx(Xe.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":f,"data-state":p?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:u,...a,ref:e,onMouseDown:Ie(t.onMouseDown,h=>{!o&&h.button===0&&h.ctrlKey===!1?c.onValueChange(r):h.preventDefault()}),onKeyDown:Ie(t.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&c.onValueChange(r)}),onFocus:Ie(t.onFocus,()=>{const h=c.activationMode!=="manual";!p&&!o&&h&&c.onValueChange(r)})})})});uC.displayName=cC;var dC="TabsContent",fC=N.forwardRef((t,e)=>{const{__scopeTabs:n,value:r,forceMount:o,children:a,...c}=t,l=tv(dC,n),u=hC(l.baseId,r),f=pC(l.baseId,r),p=r===l.value,h=N.useRef(p);return N.useEffect(()=>{const _=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(_)},[]),m.jsx(xn,{present:o||p,children:({present:_})=>m.jsx(Xe.div,{"data-state":p?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":u,hidden:!_,id:f,tabIndex:0,...c,ref:e,style:{...t.style,animationDuration:h.current?"0s":void 0},children:_&&a})})});fC.displayName=dC;function hC(t,e){return`${t}-trigger-${e}`}function pC(t,e){return`${t}-content-${e}`}var VD=oC,WD=lC,GD=uC,KD=fC,[Cf]=_r("Tooltip",[Ri]),kf=Ri(),mC="TooltipProvider",YD=700,Jm="tooltip.open",[XD,nv]=Cf(mC),gC=t=>{const{__scopeTooltip:e,delayDuration:n=YD,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:a}=t,c=N.useRef(!0),l=N.useRef(!1),u=N.useRef(0);return N.useEffect(()=>{const f=u.current;return()=>window.clearTimeout(f)},[]),m.jsx(XD,{scope:e,isOpenDelayedRef:c,delayDuration:n,onOpen:N.useCallback(()=>{window.clearTimeout(u.current),c.current=!1},[]),onClose:N.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>c.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:N.useCallback(f=>{l.current=f},[]),disableHoverableContent:o,children:a})};gC.displayName=mC;var fc="Tooltip",[QD,Mc]=Cf(fc),vC=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:o,onOpenChange:a,disableHoverableContent:c,delayDuration:l}=t,u=nv(fc,t.__scopeTooltip),f=kf(e),[p,h]=N.useState(null),_=mn(),x=N.useRef(0),C=c!=null?c:u.disableHoverableContent,w=l!=null?l:u.delayDuration,v=N.useRef(!1),[b,y]=Ps({prop:r,defaultProp:o!=null?o:!1,onChange:D=>{D?(u.onOpen(),document.dispatchEvent(new CustomEvent(Jm))):u.onClose(),a==null||a(D)},caller:fc}),S=N.useMemo(()=>b?v.current?"delayed-open":"instant-open":"closed",[b]),k=N.useCallback(()=>{window.clearTimeout(x.current),x.current=0,v.current=!1,y(!0)},[y]),T=N.useCallback(()=>{window.clearTimeout(x.current),x.current=0,y(!1)},[y]),R=N.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{v.current=!0,y(!0),x.current=0},w)},[w,y]);return N.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),m.jsx(uf,{...f,children:m.jsx(QD,{scope:e,contentId:_,open:b,stateAttribute:S,trigger:p,onTriggerChange:h,onTriggerEnter:N.useCallback(()=>{u.isOpenDelayedRef.current?R():k()},[u.isOpenDelayedRef,R,k]),onTriggerLeave:N.useCallback(()=>{C?T():(window.clearTimeout(x.current),x.current=0)},[T,C]),onOpen:k,onClose:T,disableHoverableContent:C,children:n})})};vC.displayName=fc;var eg="TooltipTrigger",_C=N.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,o=Mc(eg,n),a=nv(eg,n),c=kf(n),l=N.useRef(null),u=ct(e,l,o.onTriggerChange),f=N.useRef(!1),p=N.useRef(!1),h=N.useCallback(()=>f.current=!1,[]);return N.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),m.jsx(Ec,{asChild:!0,...c,children:m.jsx(Xe.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:u,onPointerMove:Ie(t.onPointerMove,_=>{_.pointerType!=="touch"&&!p.current&&!a.isPointerInTransitRef.current&&(o.onTriggerEnter(),p.current=!0)}),onPointerLeave:Ie(t.onPointerLeave,()=>{o.onTriggerLeave(),p.current=!1}),onPointerDown:Ie(t.onPointerDown,()=>{o.open&&o.onClose(),f.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:Ie(t.onFocus,()=>{f.current||o.onOpen()}),onBlur:Ie(t.onBlur,o.onClose),onClick:Ie(t.onClick,o.onClose)})})});_C.displayName=eg;var rv="TooltipPortal",[ZD,JD]=Cf(rv,{forceMount:void 0}),yC=t=>{const{__scopeTooltip:e,forceMount:n,children:r,container:o}=t,a=Mc(rv,e);return m.jsx(ZD,{scope:e,forceMount:n,children:m.jsx(xn,{present:n||a.open,children:m.jsx(Fa,{asChild:!0,container:o,children:r})})})};yC.displayName=rv;var Na="TooltipContent",bC=N.forwardRef((t,e)=>{const n=JD(Na,t.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...a}=t,c=Mc(Na,t.__scopeTooltip);return m.jsx(xn,{present:r||c.open,children:c.disableHoverableContent?m.jsx(xC,{side:o,...a,ref:e}):m.jsx(ej,{side:o,...a,ref:e})})}),ej=N.forwardRef((t,e)=>{const n=Mc(Na,t.__scopeTooltip),r=nv(Na,t.__scopeTooltip),o=N.useRef(null),a=ct(e,o),[c,l]=N.useState(null),{trigger:u,onClose:f}=n,p=o.current,{onPointerInTransitChange:h}=r,_=N.useCallback(()=>{l(null),h(!1)},[h]),x=N.useCallback((C,w)=>{const v=C.currentTarget,b={x:C.clientX,y:C.clientY},y=sj(b,v.getBoundingClientRect()),S=ij(b,y),k=oj(w.getBoundingClientRect()),T=lj([...S,...k]);l(T),h(!0)},[h]);return N.useEffect(()=>()=>_(),[_]),N.useEffect(()=>{if(u&&p){const C=v=>x(v,p),w=v=>x(v,u);return u.addEventListener("pointerleave",C),p.addEventListener("pointerleave",w),()=>{u.removeEventListener("pointerleave",C),p.removeEventListener("pointerleave",w)}}},[u,p,x,_]),N.useEffect(()=>{if(c){const C=w=>{const v=w.target,b={x:w.clientX,y:w.clientY},y=(u==null?void 0:u.contains(v))||(p==null?void 0:p.contains(v)),S=!aj(b,c);y?_():S&&(_(),f())};return document.addEventListener("pointermove",C),()=>document.removeEventListener("pointermove",C)}},[u,p,c,f,_]),m.jsx(xC,{...t,ref:a})}),[tj,nj]=Cf(fc,{isInside:!1}),rj=JA("TooltipContent"),xC=N.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:a,onPointerDownOutside:c,...l}=t,u=Mc(Na,n),f=kf(n),{onClose:p}=u;return N.useEffect(()=>(document.addEventListener(Jm,p),()=>document.removeEventListener(Jm,p)),[p]),N.useEffect(()=>{if(u.trigger){const h=_=>{const x=_.target;x!=null&&x.contains(u.trigger)&&p()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[u.trigger,p]),m.jsx(Ba,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:h=>h.preventDefault(),onDismiss:p,children:m.jsxs(df,{"data-state":u.stateAttribute,...f,...l,ref:e,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[m.jsx(rj,{children:r}),m.jsx(tj,{scope:n,isInside:!0,children:m.jsx(iR,{id:u.contentId,role:"tooltip",children:o||r})})]})})});bC.displayName=Na;var SC="TooltipArrow",wC=N.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,o=kf(n);return nj(SC,n).isInside?null:m.jsx(ff,{...o,...r,ref:e})});wC.displayName=SC;function sj(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),o=Math.abs(e.right-t.x),a=Math.abs(e.left-t.x);switch(Math.min(n,r,o,a)){case a:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function ij(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function oj(t){const{top:e,right:n,bottom:r,left:o}=t;return[{x:o,y:e},{x:n,y:e},{x:n,y:r},{x:o,y:r}]}function aj(t,e){const{x:n,y:r}=t;let o=!1;for(let a=0,c=e.length-1;a<e.length;c=a++){const l=e[a],u=e[c],f=l.x,p=l.y,h=u.x,_=u.y;p>r!=_>r&&n<(h-f)*(r-p)/(_-p)+f&&(o=!o)}return o}function lj(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),cj(e)}function cj(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const o=t[r];for(;e.length>=2;){const a=e[e.length-1],c=e[e.length-2];if((a.x-c.x)*(o.y-c.y)>=(a.y-c.y)*(o.x-c.x))e.pop();else break}e.push(o)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const o=t[r];for(;n.length>=2;){const a=n[n.length-1],c=n[n.length-2];if((a.x-c.x)*(o.y-c.y)>=(a.y-c.y)*(o.x-c.x))n.pop();else break}n.push(o)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var uj=gC,dj=vC,fj=_C,hj=yC,pj=bC,mj=wC;const gj=(t,e)=>{const n=new Array(t.length+e.length);for(let r=0;r<t.length;r++)n[r]=t[r];for(let r=0;r<e.length;r++)n[t.length+r]=e[r];return n},vj=(t,e)=>({classGroupId:t,validator:e}),CC=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),Id="-",ub=[],_j="arbitrary..",yj=t=>{const e=xj(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return bj(c);const l=c.split(Id),u=l[0]===""&&l.length>1?1:0;return kC(l,u,e)},getConflictingClassGroupIds:(c,l)=>{if(l){const u=r[c],f=n[c];return u?f?gj(f,u):u:f||ub}return n[c]||ub}}},kC=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const o=t[e],a=n.nextPart.get(o);if(a){const f=kC(t,e+1,a);if(f)return f}const c=n.validators;if(c===null)return;const l=e===0?t.join(Id):t.slice(e).join(Id),u=c.length;for(let f=0;f<u;f++){const p=c[f];if(p.validator(l))return p.classGroupId}},bj=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),r=e.slice(0,n);return r?_j+r:void 0})(),xj=t=>{const{theme:e,classGroups:n}=t;return Sj(n,e)},Sj=(t,e)=>{const n=CC();for(const r in t){const o=t[r];sv(o,n,r,e)}return n},sv=(t,e,n,r)=>{const o=t.length;for(let a=0;a<o;a++){const c=t[a];wj(c,e,n,r)}},wj=(t,e,n,r)=>{if(typeof t=="string"){Cj(t,e,n);return}if(typeof t=="function"){kj(t,e,n,r);return}Ej(t,e,n,r)},Cj=(t,e,n)=>{const r=t===""?e:EC(e,t);r.classGroupId=n},kj=(t,e,n,r)=>{if(Aj(t)){sv(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(vj(n,t))},Ej=(t,e,n,r)=>{const o=Object.entries(t),a=o.length;for(let c=0;c<a;c++){const[l,u]=o[c];sv(u,EC(e,l),n,r)}},EC=(t,e)=>{let n=t;const r=e.split(Id),o=r.length;for(let a=0;a<o;a++){const c=r[a];let l=n.nextPart.get(c);l||(l=CC(),n.nextPart.set(c,l)),n=l}return n},Aj=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,Rj=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const o=(a,c)=>{n[a]=c,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(a){let c=n[a];if(c!==void 0)return c;if((c=r[a])!==void 0)return o(a,c),c},set(a,c){a in n?n[a]=c:o(a,c)}}},tg="!",db=":",Tj=[],fb=(t,e,n,r,o)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),Nj=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=o=>{const a=[];let c=0,l=0,u=0,f;const p=o.length;for(let w=0;w<p;w++){const v=o[w];if(c===0&&l===0){if(v===db){a.push(o.slice(u,w)),u=w+1;continue}if(v==="/"){f=w;continue}}v==="["?c++:v==="]"?c--:v==="("?l++:v===")"&&l--}const h=a.length===0?o:o.slice(u);let _=h,x=!1;h.endsWith(tg)?(_=h.slice(0,-1),x=!0):h.startsWith(tg)&&(_=h.slice(1),x=!0);const C=f&&f>u?f-u:void 0;return fb(a,x,_,C)};if(e){const o=e+db,a=r;r=c=>c.startsWith(o)?a(c.slice(o.length)):fb(Tj,!1,c,void 0,!0)}if(n){const o=r;r=a=>n({className:a,parseClassName:o})}return r},Mj=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{e.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let a=0;a<n.length;a++){const c=n[a],l=c[0]==="[",u=e.has(c);l||u?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(c)):o.push(c)}return o.length>0&&(o.sort(),r.push(...o)),r}},Dj=t=>({cache:Rj(t.cacheSize),parseClassName:Nj(t),sortModifiers:Mj(t),...yj(t)}),jj=/\s+/,Oj=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:a}=e,c=[],l=t.trim().split(jj);let u="";for(let f=l.length-1;f>=0;f-=1){const p=l[f],{isExternal:h,modifiers:_,hasImportantModifier:x,baseClassName:C,maybePostfixModifierPosition:w}=n(p);if(h){u=p+(u.length>0?" "+u:u);continue}let v=!!w,b=r(v?C.substring(0,w):C);if(!b){if(!v){u=p+(u.length>0?" "+u:u);continue}if(b=r(C),!b){u=p+(u.length>0?" "+u:u);continue}v=!1}const y=_.length===0?"":_.length===1?_[0]:a(_).join(":"),S=x?y+tg:y,k=S+b;if(c.indexOf(k)>-1)continue;c.push(k);const T=o(b,v);for(let R=0;R<T.length;++R){const D=T[R];c.push(S+D)}u=p+(u.length>0?" "+u:u)}return u},Lj=(...t)=>{let e=0,n,r,o="";for(;e<t.length;)(n=t[e++])&&(r=AC(n))&&(o&&(o+=" "),o+=r);return o},AC=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=AC(t[r]))&&(n&&(n+=" "),n+=e);return n},Ij=(t,...e)=>{let n,r,o,a;const c=u=>{const f=e.reduce((p,h)=>h(p),t());return n=Dj(f),r=n.cache.get,o=n.cache.set,a=l,l(u)},l=u=>{const f=r(u);if(f)return f;const p=Oj(u,n);return o(u,p),p};return a=c,(...u)=>a(Lj(...u))},Pj=[],pn=t=>{const e=n=>n[t]||Pj;return e.isThemeGetter=!0,e},RC=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,TC=/^\((?:(\w[\w-]*):)?(.+)\)$/i,zj=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Bj=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Fj=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Hj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Uj=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,$j=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,gi=t=>zj.test(t),lt=t=>!!t&&!Number.isNaN(Number(t)),vi=t=>!!t&&Number.isInteger(Number(t)),am=t=>t.endsWith("%")&&lt(t.slice(0,-1)),Ms=t=>Bj.test(t),NC=()=>!0,qj=t=>Fj.test(t)&&!Hj.test(t),iv=()=>!1,Vj=t=>Uj.test(t),Wj=t=>$j.test(t),Gj=t=>!Ve(t)&&!We(t),Kj=t=>Di(t,jC,iv),Ve=t=>RC.test(t),lo=t=>Di(t,OC,qj),hb=t=>Di(t,nO,lt),Yj=t=>Di(t,IC,NC),Xj=t=>Di(t,LC,iv),pb=t=>Di(t,MC,iv),Qj=t=>Di(t,DC,Wj),cd=t=>Di(t,PC,Vj),We=t=>TC.test(t),Vl=t=>wo(t,OC),Zj=t=>wo(t,LC),mb=t=>wo(t,MC),Jj=t=>wo(t,jC),eO=t=>wo(t,DC),ud=t=>wo(t,PC,!0),tO=t=>wo(t,IC,!0),Di=(t,e,n)=>{const r=RC.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},wo=(t,e,n=!1)=>{const r=TC.exec(t);return r?r[1]?e(r[1]):n:!1},MC=t=>t==="position"||t==="percentage",DC=t=>t==="image"||t==="url",jC=t=>t==="length"||t==="size"||t==="bg-size",OC=t=>t==="length",nO=t=>t==="number",LC=t=>t==="family-name",IC=t=>t==="number"||t==="weight",PC=t=>t==="shadow",rO=()=>{const t=pn("color"),e=pn("font"),n=pn("text"),r=pn("font-weight"),o=pn("tracking"),a=pn("leading"),c=pn("breakpoint"),l=pn("container"),u=pn("spacing"),f=pn("radius"),p=pn("shadow"),h=pn("inset-shadow"),_=pn("text-shadow"),x=pn("drop-shadow"),C=pn("blur"),w=pn("perspective"),v=pn("aspect"),b=pn("ease"),y=pn("animate"),S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],T=()=>[...k(),We,Ve],R=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],A=()=>[We,Ve,u],j=()=>[gi,"full","auto",...A()],O=()=>[vi,"none","subgrid",We,Ve],P=()=>["auto",{span:["full",vi,We,Ve]},vi,We,Ve],$=()=>[vi,"auto",We,Ve],U=()=>["auto","min","max","fr",We,Ve],W=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],K=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...A()],Q=()=>[gi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],X=()=>[gi,"screen","full","dvw","lvw","svw","min","max","fit",...A()],I=()=>[gi,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],L=()=>[t,We,Ve],z=()=>[...k(),mb,pb,{position:[We,Ve]}],F=()=>["no-repeat",{repeat:["","x","y","space","round"]}],B=()=>["auto","cover","contain",Jj,Kj,{size:[We,Ve]}],Y=()=>[am,Vl,lo],ee=()=>["","none","full",f,We,Ve],J=()=>["",lt,Vl,lo],G=()=>["solid","dashed","dotted","double"],q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],te=()=>[lt,am,mb,pb],re=()=>["","none",C,We,Ve],oe=()=>["none",lt,We,Ve],se=()=>["none",lt,We,Ve],ye=()=>[lt,We,Ve],Ee=()=>[gi,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ms],breakpoint:[Ms],color:[NC],container:[Ms],"drop-shadow":[Ms],ease:["in","out","in-out"],font:[Gj],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ms],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ms],shadow:[Ms],spacing:["px",lt],text:[Ms],"text-shadow":[Ms],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",gi,Ve,We,v]}],container:["container"],columns:[{columns:[lt,Ve,We,l]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:T()}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:j()}],"inset-x":[{"inset-x":j()}],"inset-y":[{"inset-y":j()}],start:[{"inset-s":j(),start:j()}],end:[{"inset-e":j(),end:j()}],"inset-bs":[{"inset-bs":j()}],"inset-be":[{"inset-be":j()}],top:[{top:j()}],right:[{right:j()}],bottom:[{bottom:j()}],left:[{left:j()}],visibility:["visible","invisible","collapse"],z:[{z:[vi,"auto",We,Ve]}],basis:[{basis:[gi,"full","auto",l,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[lt,gi,"auto","initial","none",Ve]}],grow:[{grow:["",lt,We,Ve]}],shrink:[{shrink:["",lt,We,Ve]}],order:[{order:[vi,"first","last","none",We,Ve]}],"grid-cols":[{"grid-cols":O()}],"col-start-end":[{col:P()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":O()}],"row-start-end":[{row:P()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":U()}],"auto-rows":[{"auto-rows":U()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...W(),"normal"]}],"justify-items":[{"justify-items":[...K(),"normal"]}],"justify-self":[{"justify-self":["auto",...K()]}],"align-content":[{content:["normal",...W()]}],"align-items":[{items:[...K(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...K(),{baseline:["","last"]}]}],"place-content":[{"place-content":W()}],"place-items":[{"place-items":[...K(),"baseline"]}],"place-self":[{"place-self":["auto",...K()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pbs:[{pbs:A()}],pbe:[{pbe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mbs:[{mbs:V()}],mbe:[{mbe:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:Q()}],"inline-size":[{inline:["auto",...X()]}],"min-inline-size":[{"min-inline":["auto",...X()]}],"max-inline-size":[{"max-inline":["none",...X()]}],"block-size":[{block:["auto",...I()]}],"min-block-size":[{"min-block":["auto",...I()]}],"max-block-size":[{"max-block":["none",...I()]}],w:[{w:[l,"screen",...Q()]}],"min-w":[{"min-w":[l,"screen","none",...Q()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[c]},...Q()]}],h:[{h:["screen","lh",...Q()]}],"min-h":[{"min-h":["screen","lh","none",...Q()]}],"max-h":[{"max-h":["screen","lh",...Q()]}],"font-size":[{text:["base",n,Vl,lo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,tO,Yj]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",am,Ve]}],"font-family":[{font:[Zj,Xj,e]}],"font-features":[{"font-features":[Ve]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,We,Ve]}],"line-clamp":[{"line-clamp":[lt,"none",We,hb]}],leading:[{leading:[a,...A()]}],"list-image":[{"list-image":["none",We,Ve]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",We,Ve]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:[lt,"from-font","auto",We,lo]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[lt,"auto",We,Ve]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",We,Ve]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",We,Ve]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:z()}],"bg-repeat":[{bg:F()}],"bg-size":[{bg:B()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},vi,We,Ve],radial:["",We,Ve],conic:[vi,We,Ve]},eO,Qj]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:Y()}],"gradient-via-pos":[{via:Y()}],"gradient-to-pos":[{to:Y()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:ee()}],"rounded-s":[{"rounded-s":ee()}],"rounded-e":[{"rounded-e":ee()}],"rounded-t":[{"rounded-t":ee()}],"rounded-r":[{"rounded-r":ee()}],"rounded-b":[{"rounded-b":ee()}],"rounded-l":[{"rounded-l":ee()}],"rounded-ss":[{"rounded-ss":ee()}],"rounded-se":[{"rounded-se":ee()}],"rounded-ee":[{"rounded-ee":ee()}],"rounded-es":[{"rounded-es":ee()}],"rounded-tl":[{"rounded-tl":ee()}],"rounded-tr":[{"rounded-tr":ee()}],"rounded-br":[{"rounded-br":ee()}],"rounded-bl":[{"rounded-bl":ee()}],"border-w":[{border:J()}],"border-w-x":[{"border-x":J()}],"border-w-y":[{"border-y":J()}],"border-w-s":[{"border-s":J()}],"border-w-e":[{"border-e":J()}],"border-w-bs":[{"border-bs":J()}],"border-w-be":[{"border-be":J()}],"border-w-t":[{"border-t":J()}],"border-w-r":[{"border-r":J()}],"border-w-b":[{"border-b":J()}],"border-w-l":[{"border-l":J()}],"divide-x":[{"divide-x":J()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":J()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...G(),"hidden","none"]}],"divide-style":[{divide:[...G(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...G(),"none","hidden"]}],"outline-offset":[{"outline-offset":[lt,We,Ve]}],"outline-w":[{outline:["",lt,Vl,lo]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",p,ud,cd]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",h,ud,cd]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:J()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[lt,lo]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":J()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",_,ud,cd]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[lt,We,Ve]}],"mix-blend":[{"mix-blend":[...q(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":q()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[lt]}],"mask-image-linear-from-pos":[{"mask-linear-from":te()}],"mask-image-linear-to-pos":[{"mask-linear-to":te()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":te()}],"mask-image-t-to-pos":[{"mask-t-to":te()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":te()}],"mask-image-r-to-pos":[{"mask-r-to":te()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":te()}],"mask-image-b-to-pos":[{"mask-b-to":te()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":te()}],"mask-image-l-to-pos":[{"mask-l-to":te()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":te()}],"mask-image-x-to-pos":[{"mask-x-to":te()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":te()}],"mask-image-y-to-pos":[{"mask-y-to":te()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[We,Ve]}],"mask-image-radial-from-pos":[{"mask-radial-from":te()}],"mask-image-radial-to-pos":[{"mask-radial-to":te()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":k()}],"mask-image-conic-pos":[{"mask-conic":[lt]}],"mask-image-conic-from-pos":[{"mask-conic-from":te()}],"mask-image-conic-to-pos":[{"mask-conic-to":te()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:z()}],"mask-repeat":[{mask:F()}],"mask-size":[{mask:B()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",We,Ve]}],filter:[{filter:["","none",We,Ve]}],blur:[{blur:re()}],brightness:[{brightness:[lt,We,Ve]}],contrast:[{contrast:[lt,We,Ve]}],"drop-shadow":[{"drop-shadow":["","none",x,ud,cd]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",lt,We,Ve]}],"hue-rotate":[{"hue-rotate":[lt,We,Ve]}],invert:[{invert:["",lt,We,Ve]}],saturate:[{saturate:[lt,We,Ve]}],sepia:[{sepia:["",lt,We,Ve]}],"backdrop-filter":[{"backdrop-filter":["","none",We,Ve]}],"backdrop-blur":[{"backdrop-blur":re()}],"backdrop-brightness":[{"backdrop-brightness":[lt,We,Ve]}],"backdrop-contrast":[{"backdrop-contrast":[lt,We,Ve]}],"backdrop-grayscale":[{"backdrop-grayscale":["",lt,We,Ve]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[lt,We,Ve]}],"backdrop-invert":[{"backdrop-invert":["",lt,We,Ve]}],"backdrop-opacity":[{"backdrop-opacity":[lt,We,Ve]}],"backdrop-saturate":[{"backdrop-saturate":[lt,We,Ve]}],"backdrop-sepia":[{"backdrop-sepia":["",lt,We,Ve]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",We,Ve]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[lt,"initial",We,Ve]}],ease:[{ease:["linear","initial",b,We,Ve]}],delay:[{delay:[lt,We,Ve]}],animate:[{animate:["none",y,We,Ve]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,We,Ve]}],"perspective-origin":[{"perspective-origin":T()}],rotate:[{rotate:oe()}],"rotate-x":[{"rotate-x":oe()}],"rotate-y":[{"rotate-y":oe()}],"rotate-z":[{"rotate-z":oe()}],scale:[{scale:se()}],"scale-x":[{"scale-x":se()}],"scale-y":[{"scale-y":se()}],"scale-z":[{"scale-z":se()}],"scale-3d":["scale-3d"],skew:[{skew:ye()}],"skew-x":[{"skew-x":ye()}],"skew-y":[{"skew-y":ye()}],transform:[{transform:[We,Ve,"","none","gpu","cpu"]}],"transform-origin":[{origin:T()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ee()}],"translate-x":[{"translate-x":Ee()}],"translate-y":[{"translate-y":Ee()}],"translate-z":[{"translate-z":Ee()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",We,Ve]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mbs":[{"scroll-mbs":A()}],"scroll-mbe":[{"scroll-mbe":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pbs":[{"scroll-pbs":A()}],"scroll-pbe":[{"scroll-pbe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",We,Ve]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[lt,Vl,lo,hb]}],stroke:[{stroke:["none",...L()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},sO=Ij(rO);function ke(...t){return sO(Zd(t))}const iO=Pa("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function Fe(t){const e=he.c(16);let n,r,o,a,c;e[0]!==t?({className:n,variant:o,size:a,asChild:c,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=a,e[5]=c):(n=e[1],r=e[2],o=e[3],a=e[4],c=e[5]);const l=o===void 0?"default":o,u=a===void 0?"default":a,p=(c===void 0?!1:c)?xc:"button";let h;e[6]!==n||e[7]!==u||e[8]!==l?(h=ke(iO({variant:l,size:u,className:n})),e[6]=n,e[7]=u,e[8]=l,e[9]=h):h=e[9];let _;return e[10]!==p||e[11]!==r||e[12]!==u||e[13]!==h||e[14]!==l?(_=m.jsx(p,{"data-slot":"button","data-variant":l,"data-size":u,className:h,...r}),e[10]=p,e[11]=r,e[12]=u,e[13]=h,e[14]=l,e[15]=_):_=e[15],_}function Dc(){const t=he.c(1),e=oO;let n;return t[0]===Symbol.for("react.memo_cache_sentinel")?(n={fetchWithAuth:e},t[0]=n):n=t[0],n}async function oO(t,e,n){const r=e===void 0?{}:e,{serverUrl:o,token:a}=n||{};let c=t;t.startsWith("/")&&o&&(c=`http://${o}${t}`);const l=new Headers(r.headers||{});return a&&l.set("Authorization",`Bearer ${a}`),fetch(c,{...r,headers:l})}function aO(...t){return t.map((e,n)=>n===0?e.replace(/\/+$/,""):e.replace(/^\/+|\/+$/g,"")).filter(Boolean).join("/")}function qa(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(Tg,{"data-slot":"dialog",...n}),e[2]=n,e[3]=r):r=e[3],r}function lO(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(Ng,{"data-slot":"dialog-portal",...n}),e[2]=n,e[3]=r):r=e[3],r}function cO(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(sf,{"data-slot":"dialog-close",...n}),e[2]=n,e[3]=r):r=e[3],r}function uO(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=ke("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==r||e[6]!==o?(a=m.jsx(Mg,{"data-slot":"dialog-overlay",className:o,...r}),e[5]=r,e[6]=o,e[7]=a):a=e[7],a}function Va(t){const e=he.c(15);let n,r,o,a;e[0]!==t?({className:r,children:n,showCloseButton:a,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=a):(n=e[1],r=e[2],o=e[3],a=e[4]);const c=a===void 0?!0:a;let l;e[5]===Symbol.for("react.memo_cache_sentinel")?(l=m.jsx(uO,{}),e[5]=l):l=e[5];let u;e[6]!==r?(u=ke("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-background p-4 text-sm ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",r),e[6]=r,e[7]=u):u=e[7];let f;e[8]!==c?(f=c&&m.jsx(sf,{"data-slot":"dialog-close",asChild:!0,children:m.jsxs(Fe,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm",children:[m.jsx(Os,{}),m.jsx("span",{className:"sr-only",children:"Close"})]})}),e[8]=c,e[9]=f):f=e[9];let p;return e[10]!==n||e[11]!==o||e[12]!==u||e[13]!==f?(p=m.jsxs(lO,{children:[l,m.jsxs(Dg,{"data-slot":"dialog-content",className:u,...o,children:[n,f]})]}),e[10]=n,e[11]=o,e[12]=u,e[13]=f,e[14]=p):p=e[14],p}function Wa(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=ke("flex flex-col gap-2",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==r||e[6]!==o?(a=m.jsx("div",{"data-slot":"dialog-header",className:o,...r}),e[5]=r,e[6]=o,e[7]=a):a=e[7],a}function Ef(t){const e=he.c(14);let n,r,o,a;e[0]!==t?({className:r,showCloseButton:a,children:n,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=a):(n=e[1],r=e[2],o=e[3],a=e[4]);const c=a===void 0?!1:a;let l;e[5]!==r?(l=ke("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",r),e[5]=r,e[6]=l):l=e[6];let u;e[7]!==c?(u=c&&m.jsx(sf,{asChild:!0,children:m.jsx(Fe,{variant:"outline",children:"Close"})}),e[7]=c,e[8]=u):u=e[8];let f;return e[9]!==n||e[10]!==o||e[11]!==l||e[12]!==u?(f=m.jsxs("div",{"data-slot":"dialog-footer",className:l,...o,children:[n,u]}),e[9]=n,e[10]=o,e[11]=l,e[12]=u,e[13]=f):f=e[13],f}function Ga(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=ke("text-base leading-none font-medium",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==r||e[6]!==o?(a=m.jsx(KS,{"data-slot":"dialog-title",className:o,...r}),e[5]=r,e[6]=o,e[7]=a):a=e[7],a}function jc(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=ke("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==r||e[6]!==o?(a=m.jsx(YS,{"data-slot":"dialog-description",className:o,...r}),e[5]=r,e[6]=o,e[7]=a):a=e[7],a}function yd(t){const e=he.c(10);let n,r,o;e[0]!==t?({className:n,type:o,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]);let a;e[4]!==n?(a=ke("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",n),e[4]=n,e[5]=a):a=e[5];let c;return e[6]!==r||e[7]!==a||e[8]!==o?(c=m.jsx("input",{type:o,"data-slot":"input",className:a,...r}),e[6]=r,e[7]=a,e[8]=o,e[9]=c):c=e[9],c}const Oc=N.forwardRef((t,e)=>{const n=he.c(16);let r,o,a;n[0]!==t?({className:o,children:r,...a}=t,n[0]=t,n[1]=r,n[2]=o,n[3]=a):(r=n[1],o=n[2],a=n[3]);let c;n[4]!==o?(c=ke("relative overflow-hidden",o),n[4]=o,n[5]=c):c=n[5];let l;n[6]===Symbol.for("react.memo_cache_sentinel")?(l={WebkitOverflowScrolling:"touch"},n[6]=l):l=n[6];let u;n[7]!==r||n[8]!==e?(u=m.jsx(nD,{ref:e,"data-slot":"scroll-area-viewport",className:"size-full min-w-0 rounded-[inherit] outline-none",style:l,children:r}),n[7]=r,n[8]=e,n[9]=u):u=n[9];let f,p;n[10]===Symbol.for("react.memo_cache_sentinel")?(f=m.jsx(dO,{}),p=m.jsx(rD,{}),n[10]=f,n[11]=p):(f=n[10],p=n[11]);let h;return n[12]!==a||n[13]!==c||n[14]!==u?(h=m.jsxs(tD,{"data-slot":"scroll-area",className:c,...a,children:[u,f,p]}),n[12]=a,n[13]=c,n[14]=u,n[15]=h):h=n[15],h});Oc.displayName="ScrollArea";function dO(t){const e=he.c(11);let n,r,o;e[0]!==t?({className:n,orientation:o,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]);const a=o===void 0?"vertical":o;let c;e[4]!==n?(c=ke("flex touch-none p-px transition-colors select-none data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent",n),e[4]=n,e[5]=c):c=e[5];let l;e[6]===Symbol.for("react.memo_cache_sentinel")?(l=m.jsx(kw,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"}),e[6]=l):l=e[6];let u;return e[7]!==a||e[8]!==r||e[9]!==c?(u=m.jsx(xw,{"data-slot":"scroll-area-scrollbar","data-orientation":a,orientation:a,className:c,...r,children:l}),e[7]=a,e[8]=r,e[9]=c,e[10]=u):u=e[10],u}function fO({open:t,onOpenChange:e,onSelect:n,initialPath:r,title:o="Select Folder"}){var B;const[a,c]=N.useState(r||""),[l,u]=N.useState([]),[f,p]=N.useState(!1),[h,_]=N.useState(0),[x,C]=N.useState(null),[w,v]=N.useState(""),[b,y]=N.useState(!1),[S,k]=N.useState([]),[T,R]=N.useState(!1),D=N.useRef(null),A=N.useRef(null),{fetchWithAuth:j}=Dc(),{activeServer:O}=ja(),P=N.useCallback(async Y=>{var ee;p(!0),C(null),_(0),v(""),R(!1);try{const J=await j(`/api/fs/browse?path=${encodeURIComponent(Y)}`,{},{serverUrl:O==null?void 0:O.url,token:O==null?void 0:O.token}),G=await J.json();if(!J.ok)throw new Error(G.message||"Failed to browse directory");const q=G.files.filter(te=>te.type==="directory");u(q),c(G.currentPath),y((ee=G.isRoot)!=null?ee:!1)}catch(J){C(J instanceof Error?J.message:"Failed to load directory"),u([])}finally{p(!1)}},[j,O]),$=N.useCallback(async()=>{try{const ee=await(await j("/api/fs/drives",{},{serverUrl:O==null?void 0:O.url,token:O==null?void 0:O.token})).json();k(ee.drives||[])}catch{}},[j,O]);N.useEffect(()=>{t&&(P(r||""),$())},[t,r,P,$]),N.useEffect(()=>{_(0)},[w]);const U=l.filter(Y=>Y.name.toLowerCase().includes(w.toLowerCase())),W=(B=U[h])!=null?B:null,K=N.useCallback(Y=>aO(a,Y.name),[a]),V=W?K(W):a,Q=!W,X=async()=>{var Y;p(!0),C(null);try{const ee=await j(`/api/fs/parent?path=${encodeURIComponent(a)}`,{},{serverUrl:O==null?void 0:O.url,token:O==null?void 0:O.token}),J=await ee.json();if(!ee.ok)throw new Error(J.message||"Failed to navigate up");const G=J.files.filter(q=>q.type==="directory");u(G),c(J.currentPath),y((Y=J.isRoot)!=null?Y:!1),_(0),v("")}catch(ee){C(ee instanceof Error?ee.message:"Failed to navigate up")}finally{p(!1)}},I=()=>{V&&(n(V),e(!1))},L=Y=>{const ee=K(Y);P(ee)},z=Y=>{if(U.length!==0)switch(Y.key){case"ArrowDown":Y.preventDefault(),_(ee=>Math.min(ee+1,U.length-1));break;case"ArrowRight":U[h]&&(Y.preventDefault(),L(U[h]));break;case"ArrowUp":Y.preventDefault(),_(ee=>Math.max(ee-1,0));break;case"Enter":Y.preventDefault(),I();break;case"Escape":w&&(Y.preventDefault(),v(""));break}};N.useEffect(()=>{if(A.current&&U.length>0){const Y=A.current.children[h];Y&&Y.scrollIntoView({block:"nearest"})}},[h,U.length]),N.useEffect(()=>{t&&setTimeout(()=>{var Y;return(Y=D.current)==null?void 0:Y.focus()},100)},[t]),N.useEffect(()=>{R(!1)},[a]);const F=(Y,ee=50)=>{if(Y.length<=ee)return Y;const J=Y.split(/[/\\]/);return J.length<=2?Y:".../"+J.slice(-2).join("/")};return m.jsx(qa,{open:t,onOpenChange:e,children:m.jsxs(Va,{className:"sm:max-w-lg",onKeyDown:z,children:[m.jsx(Wa,{children:m.jsx(Ga,{children:o})}),m.jsxs("div",{className:"space-y-3",children:[m.jsxs("div",{className:"flex items-center gap-2 p-2 bg-muted rounded-md",children:[m.jsx(Fe,{variant:"ghost",size:"icon",className:"h-7 w-7 flex-shrink-0",onClick:X,disabled:f||!a||b,children:m.jsx(c5,{className:"w-4 h-4"})}),S.length>1&&m.jsxs("div",{className:"relative",children:[m.jsx(Fe,{variant:"ghost",size:"icon",className:"h-7 w-7 flex-shrink-0",onClick:()=>R(Y=>!Y),disabled:f,children:m.jsx(F5,{className:"w-4 h-4"})}),T&&m.jsx("div",{className:"absolute top-full left-0 mt-1 bg-popover border rounded-md shadow-md z-50 min-w-[120px]",children:S.map(Y=>m.jsxs("button",{onClick:()=>{P(Y),R(!1)},className:ke("flex items-center gap-2 w-full px-3 py-1.5 text-sm text-left hover:bg-muted",a===Y&&"bg-primary/20 text-primary font-medium"),children:[m.jsx(js,{className:"w-3.5 h-3.5 text-amber-500"}),Y]},Y))})]}),m.jsx("span",{className:"flex-1 text-sm font-mono truncate",title:V,children:W?m.jsx("span",{className:"text-primary",children:F(K(W),45)}):F(a)||"Home"})]}),m.jsxs("div",{className:"relative",children:[m.jsx(xg,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),m.jsx(yd,{ref:D,placeholder:"Filter folders...",value:w,onChange:Y=>v(Y.target.value),className:"pl-8"})]}),m.jsx(Oc,{className:"h-64 border rounded-md",children:f?m.jsxs("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:[m.jsx(pr,{className:"w-4 h-4 animate-spin mr-2"}),"Loading..."]}):x?m.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-muted-foreground",children:[m.jsx("span",{className:"text-destructive",children:x}),m.jsx(Fe,{variant:"ghost",size:"sm",onClick:()=>P(a),className:"mt-2",children:"Retry"})]}):U.length===0?m.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-muted-foreground text-sm",children:[m.jsx(js,{className:"w-8 h-8 mb-2 opacity-50"}),w?"No matching folders":"No folders in this directory"]}):m.jsx("div",{className:"p-1",ref:A,children:U.map((Y,ee)=>m.jsxs("button",{onClick:()=>_(ee),onDoubleClick:()=>L(Y),className:ke("flex items-center gap-2 w-full px-2 py-1.5 rounded text-sm text-left","hover:bg-muted",ee===h&&"bg-primary/20 text-primary font-medium ring-1 ring-primary/50"),children:[m.jsx(js,{className:"w-4 h-4 text-amber-500 flex-shrink-0"}),m.jsx("span",{className:"truncate flex-1",children:Y.name}),ee===h&&m.jsx(Ls,{className:"w-4 h-4 text-primary"})]},Y.path))})}),x&&m.jsx("p",{className:"text-xs text-destructive",children:x})]}),m.jsxs(Ef,{children:[m.jsx(Fe,{variant:"outline",onClick:()=>e(!1),children:"Cancel"}),m.jsx(Fe,{onClick:I,disabled:!V||f,children:Q?"Use This Folder":"Add Selected Folder"})]})]})})}function ng(t){const e=he.c(26),{open:n,onOpenChange:r,title:o,description:a,confirmLabel:c,cancelLabel:l,onConfirm:u,variant:f}=t,p=c===void 0?"Confirm":c,h=l===void 0?"Cancel":l,_=f===void 0?"default":f;let x;e[0]!==u||e[1]!==r?(x=()=>{u(),r(!1)},e[0]=u,e[1]=r,e[2]=x):x=e[2];const C=x;let w;e[3]!==o?(w=m.jsx(Ga,{children:o}),e[3]=o,e[4]=w):w=e[4];let v;e[5]!==a?(v=m.jsx(jc,{children:a}),e[5]=a,e[6]=v):v=e[6];let b;e[7]!==w||e[8]!==v?(b=m.jsxs(Wa,{children:[w,v]}),e[7]=w,e[8]=v,e[9]=b):b=e[9];let y;e[10]!==h?(y=m.jsx(cO,{asChild:!0,children:m.jsx(Fe,{variant:"outline",children:h})}),e[10]=h,e[11]=y):y=e[11];const S=_==="destructive"?"destructive":"default";let k;e[12]!==p||e[13]!==C||e[14]!==S?(k=m.jsx(Fe,{onClick:C,variant:S,children:p}),e[12]=p,e[13]=C,e[14]=S,e[15]=k):k=e[15];let T;e[16]!==k||e[17]!==y?(T=m.jsxs(Ef,{children:[y,k]}),e[16]=k,e[17]=y,e[18]=T):T=e[18];let R;e[19]!==T||e[20]!==b?(R=m.jsxs(Va,{showCloseButton:!1,children:[b,T]}),e[19]=T,e[20]=b,e[21]=R):R=e[21];let D;return e[22]!==r||e[23]!==n||e[24]!==R?(D=m.jsx(qa,{open:n,onOpenChange:r,children:R}),e[22]=r,e[23]=n,e[24]=R,e[25]=D):D=e[25],D}function zC(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(mM,{"data-slot":"dropdown-menu",...n}),e[2]=n,e[3]=r):r=e[3],r}function BC(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(gM,{"data-slot":"dropdown-menu-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function FC(t){const e=he.c(12);let n,r,o,a;e[0]!==t?({className:n,align:o,sideOffset:a,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=a):(n=e[1],r=e[2],o=e[3],a=e[4]);const c=o===void 0?"start":o,l=a===void 0?4:a;let u;e[5]!==n?(u=ke("z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:overflow-hidden data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",n),e[5]=n,e[6]=u):u=e[6];let f;return e[7]!==c||e[8]!==r||e[9]!==l||e[10]!==u?(f=m.jsx(vM,{children:m.jsx(_M,{"data-slot":"dropdown-menu-content",sideOffset:l,align:c,className:u,...r})}),e[7]=c,e[8]=r,e[9]=l,e[10]=u,e[11]=f):f=e[11],f}function nc(t){const e=he.c(12);let n,r,o,a;e[0]!==t?({className:n,inset:r,variant:a,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=a):(n=e[1],r=e[2],o=e[3],a=e[4]);const c=a===void 0?"default":a;let l;e[5]!==n?(l=ke("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",n),e[5]=n,e[6]=l):l=e[6];let u;return e[7]!==r||e[8]!==o||e[9]!==l||e[10]!==c?(u=m.jsx(yM,{"data-slot":"dropdown-menu-item","data-inset":r,"data-variant":c,className:l,...o}),e[7]=r,e[8]=o,e[9]=l,e[10]=c,e[11]=u):u=e[11],u}var gb=1,hO=.9,pO=.8,mO=.17,lm=.1,cm=.999,gO=.9999,vO=.99,_O=/[\\\/_+.#"@\[\(\{&]/,yO=/[\\\/_+.#"@\[\(\{&]/g,bO=/[\s-]/,HC=/[\s-]/g;function rg(t,e,n,r,o,a,c){if(a===e.length)return o===t.length?gb:vO;var l=`${o},${a}`;if(c[l]!==void 0)return c[l];for(var u=r.charAt(a),f=n.indexOf(u,o),p=0,h,_,x,C;f>=0;)h=rg(t,e,n,r,f+1,a+1,c),h>p&&(f===o?h*=gb:_O.test(t.charAt(f-1))?(h*=pO,x=t.slice(o,f-1).match(yO),x&&o>0&&(h*=Math.pow(cm,x.length))):bO.test(t.charAt(f-1))?(h*=hO,C=t.slice(o,f-1).match(HC),C&&o>0&&(h*=Math.pow(cm,C.length))):(h*=mO,o>0&&(h*=Math.pow(cm,f-o))),t.charAt(f)!==e.charAt(a)&&(h*=gO)),(h<lm&&n.charAt(f-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(f-1)!==r.charAt(a))&&(_=rg(t,e,n,r,f+1,a+2,c),_*lm>h&&(h=_*lm)),h>p&&(p=h),f=n.indexOf(u,f+1);return c[l]=p,p}function vb(t){return t.toLowerCase().replace(HC," ")}function xO(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,rg(t,e,vb(t),vb(e),0,0,{})}var Wl='[cmdk-group=""]',um='[cmdk-group-items=""]',SO='[cmdk-group-heading=""]',UC='[cmdk-item=""]',_b=`${UC}:not([aria-disabled="true"])`,sg="cmdk-item-select",_a="data-value",wO=(t,e,n)=>xO(t,e,n),$C=N.createContext(void 0),Lc=()=>N.useContext($C),qC=N.createContext(void 0),ov=()=>N.useContext(qC),VC=N.createContext(void 0),WC=N.forwardRef((t,e)=>{let n=ya(()=>{var F,B;return{search:"",value:(B=(F=t.value)!=null?F:t.defaultValue)!=null?B:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=ya(()=>new Set),o=ya(()=>new Map),a=ya(()=>new Map),c=ya(()=>new Set),l=GC(t),{label:u,children:f,value:p,onValueChange:h,filter:_,shouldFilter:x,loop:C,disablePointerSelection:w=!1,vimBindings:v=!0,...b}=t,y=mn(),S=mn(),k=mn(),T=N.useRef(null),R=OO();yo(()=>{if(p!==void 0){let F=p.trim();n.current.value=F,D.emit()}},[p]),yo(()=>{R(6,U)},[]);let D=N.useMemo(()=>({subscribe:F=>(c.current.add(F),()=>c.current.delete(F)),snapshot:()=>n.current,setState:(F,B,Y)=>{var ee,J,G,q;if(!Object.is(n.current[F],B)){if(n.current[F]=B,F==="search")$(),O(),R(1,P);else if(F==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let te=document.getElementById(k);te?te.focus():(ee=document.getElementById(y))==null||ee.focus()}if(R(7,()=>{var te;n.current.selectedItemId=(te=W())==null?void 0:te.id,D.emit()}),Y||R(5,U),((J=l.current)==null?void 0:J.value)!==void 0){let te=B!=null?B:"";(q=(G=l.current).onValueChange)==null||q.call(G,te);return}}D.emit()}},emit:()=>{c.current.forEach(F=>F())}}),[]),A=N.useMemo(()=>({value:(F,B,Y)=>{var ee;B!==((ee=a.current.get(F))==null?void 0:ee.value)&&(a.current.set(F,{value:B,keywords:Y}),n.current.filtered.items.set(F,j(B,Y)),R(2,()=>{O(),D.emit()}))},item:(F,B)=>(r.current.add(F),B&&(o.current.has(B)?o.current.get(B).add(F):o.current.set(B,new Set([F]))),R(3,()=>{$(),O(),n.current.value||P(),D.emit()}),()=>{a.current.delete(F),r.current.delete(F),n.current.filtered.items.delete(F);let Y=W();R(4,()=>{$(),(Y==null?void 0:Y.getAttribute("id"))===F&&P(),D.emit()})}),group:F=>(o.current.has(F)||o.current.set(F,new Set),()=>{a.current.delete(F),o.current.delete(F)}),filter:()=>l.current.shouldFilter,label:u||t["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:y,inputId:k,labelId:S,listInnerRef:T}),[]);function j(F,B){var Y,ee;let J=(ee=(Y=l.current)==null?void 0:Y.filter)!=null?ee:wO;return F?J(F,n.current.search,B):0}function O(){if(!n.current.search||l.current.shouldFilter===!1)return;let F=n.current.filtered.items,B=[];n.current.filtered.groups.forEach(ee=>{let J=o.current.get(ee),G=0;J.forEach(q=>{let te=F.get(q);G=Math.max(te,G)}),B.push([ee,G])});let Y=T.current;K().sort((ee,J)=>{var G,q;let te=ee.getAttribute("id"),re=J.getAttribute("id");return((G=F.get(re))!=null?G:0)-((q=F.get(te))!=null?q:0)}).forEach(ee=>{let J=ee.closest(um);J?J.appendChild(ee.parentElement===J?ee:ee.closest(`${um} > *`)):Y.appendChild(ee.parentElement===Y?ee:ee.closest(`${um} > *`))}),B.sort((ee,J)=>J[1]-ee[1]).forEach(ee=>{var J;let G=(J=T.current)==null?void 0:J.querySelector(`${Wl}[${_a}="${encodeURIComponent(ee[0])}"]`);G==null||G.parentElement.appendChild(G)})}function P(){let F=K().find(Y=>Y.getAttribute("aria-disabled")!=="true"),B=F==null?void 0:F.getAttribute(_a);D.setState("value",B||void 0)}function $(){var F,B,Y,ee;if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let J=0;for(let G of r.current){let q=(B=(F=a.current.get(G))==null?void 0:F.value)!=null?B:"",te=(ee=(Y=a.current.get(G))==null?void 0:Y.keywords)!=null?ee:[],re=j(q,te);n.current.filtered.items.set(G,re),re>0&&J++}for(let[G,q]of o.current)for(let te of q)if(n.current.filtered.items.get(te)>0){n.current.filtered.groups.add(G);break}n.current.filtered.count=J}function U(){var F,B,Y;let ee=W();ee&&(((F=ee.parentElement)==null?void 0:F.firstChild)===ee&&((Y=(B=ee.closest(Wl))==null?void 0:B.querySelector(SO))==null||Y.scrollIntoView({block:"nearest"})),ee.scrollIntoView({block:"nearest"}))}function W(){var F;return(F=T.current)==null?void 0:F.querySelector(`${UC}[aria-selected="true"]`)}function K(){var F;return Array.from(((F=T.current)==null?void 0:F.querySelectorAll(_b))||[])}function V(F){let B=K()[F];B&&D.setState("value",B.getAttribute(_a))}function Q(F){var B;let Y=W(),ee=K(),J=ee.findIndex(q=>q===Y),G=ee[J+F];(B=l.current)!=null&&B.loop&&(G=J+F<0?ee[ee.length-1]:J+F===ee.length?ee[0]:ee[J+F]),G&&D.setState("value",G.getAttribute(_a))}function X(F){let B=W(),Y=B==null?void 0:B.closest(Wl),ee;for(;Y&&!ee;)Y=F>0?DO(Y,Wl):jO(Y,Wl),ee=Y==null?void 0:Y.querySelector(_b);ee?D.setState("value",ee.getAttribute(_a)):Q(F)}let I=()=>V(K().length-1),L=F=>{F.preventDefault(),F.metaKey?I():F.altKey?X(1):Q(1)},z=F=>{F.preventDefault(),F.metaKey?V(0):F.altKey?X(-1):Q(-1)};return N.createElement(Xe.div,{ref:e,tabIndex:-1,...b,"cmdk-root":"",onKeyDown:F=>{var B;(B=b.onKeyDown)==null||B.call(b,F);let Y=F.nativeEvent.isComposing||F.keyCode===229;if(!(F.defaultPrevented||Y))switch(F.key){case"n":case"j":{v&&F.ctrlKey&&L(F);break}case"ArrowDown":{L(F);break}case"p":case"k":{v&&F.ctrlKey&&z(F);break}case"ArrowUp":{z(F);break}case"Home":{F.preventDefault(),V(0);break}case"End":{F.preventDefault(),I();break}case"Enter":{F.preventDefault();let ee=W();if(ee){let J=new Event(sg);ee.dispatchEvent(J)}}}}},N.createElement("label",{"cmdk-label":"",htmlFor:A.inputId,id:A.labelId,style:IO},u),Af(t,F=>N.createElement(qC.Provider,{value:D},N.createElement($C.Provider,{value:A},F))))}),CO=N.forwardRef((t,e)=>{var n,r;let o=mn(),a=N.useRef(null),c=N.useContext(VC),l=Lc(),u=GC(t),f=(r=(n=u.current)==null?void 0:n.forceMount)!=null?r:c==null?void 0:c.forceMount;yo(()=>{if(!f)return l.item(o,c==null?void 0:c.id)},[f]);let p=KC(o,a,[t.value,t.children,a],t.keywords),h=ov(),_=Ci(R=>R.value&&R.value===p.current),x=Ci(R=>f||l.filter()===!1?!0:R.search?R.filtered.items.get(o)>0:!0);N.useEffect(()=>{let R=a.current;if(!(!R||t.disabled))return R.addEventListener(sg,C),()=>R.removeEventListener(sg,C)},[x,t.onSelect,t.disabled]);function C(){var R,D;w(),(D=(R=u.current).onSelect)==null||D.call(R,p.current)}function w(){h.setState("value",p.current,!0)}if(!x)return null;let{disabled:v,value:b,onSelect:y,forceMount:S,keywords:k,...T}=t;return N.createElement(Xe.div,{ref:Is(a,e),...T,id:o,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!_,"data-disabled":!!v,"data-selected":!!_,onPointerMove:v||l.getDisablePointerSelection()?void 0:w,onClick:v?void 0:C},t.children)}),kO=N.forwardRef((t,e)=>{let{heading:n,children:r,forceMount:o,...a}=t,c=mn(),l=N.useRef(null),u=N.useRef(null),f=mn(),p=Lc(),h=Ci(x=>o||p.filter()===!1?!0:x.search?x.filtered.groups.has(c):!0);yo(()=>p.group(c),[]),KC(c,l,[t.value,t.heading,u]);let _=N.useMemo(()=>({id:c,forceMount:o}),[o]);return N.createElement(Xe.div,{ref:Is(l,e),...a,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},n&&N.createElement("div",{ref:u,"cmdk-group-heading":"","aria-hidden":!0,id:f},n),Af(t,x=>N.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?f:void 0},N.createElement(VC.Provider,{value:_},x))))}),EO=N.forwardRef((t,e)=>{let{alwaysRender:n,...r}=t,o=N.useRef(null),a=Ci(c=>!c.search);return!n&&!a?null:N.createElement(Xe.div,{ref:Is(o,e),...r,"cmdk-separator":"",role:"separator"})}),AO=N.forwardRef((t,e)=>{let{onValueChange:n,...r}=t,o=t.value!=null,a=ov(),c=Ci(f=>f.search),l=Ci(f=>f.selectedItemId),u=Lc();return N.useEffect(()=>{t.value!=null&&a.setState("search",t.value)},[t.value]),N.createElement(Xe.input,{ref:e,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":u.listId,"aria-labelledby":u.labelId,"aria-activedescendant":l,id:u.inputId,type:"text",value:o?t.value:c,onChange:f=>{o||a.setState("search",f.target.value),n==null||n(f.target.value)}})}),RO=N.forwardRef((t,e)=>{let{children:n,label:r="Suggestions",...o}=t,a=N.useRef(null),c=N.useRef(null),l=Ci(f=>f.selectedItemId),u=Lc();return N.useEffect(()=>{if(c.current&&a.current){let f=c.current,p=a.current,h,_=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let x=f.offsetHeight;p.style.setProperty("--cmdk-list-height",x.toFixed(1)+"px")})});return _.observe(f),()=>{cancelAnimationFrame(h),_.unobserve(f)}}},[]),N.createElement(Xe.div,{ref:Is(a,e),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:u.listId},Af(t,f=>N.createElement("div",{ref:Is(c,u.listInnerRef),"cmdk-list-sizer":""},f)))}),TO=N.forwardRef((t,e)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:a,container:c,...l}=t;return N.createElement(Tg,{open:n,onOpenChange:r},N.createElement(Ng,{container:c},N.createElement(Mg,{"cmdk-overlay":"",className:o}),N.createElement(Dg,{"aria-label":t.label,"cmdk-dialog":"",className:a},N.createElement(WC,{ref:e,...l}))))}),NO=N.forwardRef((t,e)=>Ci(n=>n.filtered.count===0)?N.createElement(Xe.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),MO=N.forwardRef((t,e)=>{let{progress:n,children:r,label:o="Loading...",...a}=t;return N.createElement(Xe.div,{ref:e,...a,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Af(t,c=>N.createElement("div",{"aria-hidden":!0},c)))}),Co=Object.assign(WC,{List:RO,Item:CO,Input:AO,Group:kO,Separator:EO,Dialog:TO,Empty:NO,Loading:MO});function DO(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function jO(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function GC(t){let e=N.useRef(t);return yo(()=>{e.current=t}),e}var yo=typeof window>"u"?N.useEffect:N.useLayoutEffect;function ya(t){let e=N.useRef();return e.current===void 0&&(e.current=t()),e}function Ci(t){let e=ov(),n=()=>t(e.snapshot());return N.useSyncExternalStore(e.subscribe,n,n)}function KC(t,e,n,r=[]){let o=N.useRef(),a=Lc();return yo(()=>{var c;let l=(()=>{var f;for(let p of n){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(f=p.current.textContent)==null?void 0:f.trim():o.current}})(),u=r.map(f=>f.trim());a.value(t,l,u),(c=e.current)==null||c.setAttribute(_a,l),o.current=l}),o}var OO=()=>{let[t,e]=N.useState(),n=ya(()=>new Map);return yo(()=>{n.current.forEach(r=>r()),n.current=new Map},[t]),(r,o)=>{n.current.set(r,o),e({})}};function LO(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function Af({asChild:t,children:e},n){return t&&N.isValidElement(e)?N.cloneElement(LO(e),{ref:e.ref},n(e.props.children)):n(e)}var IO={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function PO(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=ke("flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==r||e[6]!==o?(a=m.jsx("textarea",{"data-slot":"textarea",className:o,...r}),e[5]=r,e[6]=o,e[7]=a):a=e[7],a}function zO(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=ke("group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==r||e[6]!==o?(a=m.jsx("div",{"data-slot":"input-group",role:"group",className:o,...r}),e[5]=r,e[6]=o,e[7]=a):a=e[7],a}const BO=Pa("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]","block-start":"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function FO(t){const e=he.c(11);let n,r,o;e[0]!==t?({className:n,align:o,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]);const a=o===void 0?"inline-start":o;let c;e[4]!==a||e[5]!==n?(c=ke(BO({align:a}),n),e[4]=a,e[5]=n,e[6]=c):c=e[6];let l;return e[7]!==a||e[8]!==r||e[9]!==c?(l=m.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":a,className:c,onClick:HO,...r}),e[7]=a,e[8]=r,e[9]=c,e[10]=l):l=e[10],l}function HO(t){var e,n;t.target.closest("button")||(n=(e=t.currentTarget.parentElement)==null?void 0:e.querySelector("input"))==null||n.focus()}function av(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=ke("flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==r||e[6]!==o?(a=m.jsx(Co,{"data-slot":"command",className:o,...r}),e[5]=r,e[6]=o,e[7]=a):a=e[7],a}function YC(t){const e=he.c(11);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=ke("w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",n),e[3]=n,e[4]=o):o=e[4];let a;e[5]!==r||e[6]!==o?(a=m.jsx(Co.Input,{"data-slot":"command-input",className:o,...r}),e[5]=r,e[6]=o,e[7]=a):a=e[7];let c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c=m.jsx(FO,{children:m.jsx(xg,{className:"size-4 shrink-0 opacity-50"})}),e[8]=c):c=e[8];let l;return e[9]!==a?(l=m.jsx("div",{"data-slot":"command-input-wrapper",className:"p-1 pb-0",children:m.jsxs(zO,{className:"h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!",children:[a,c]})}),e[9]=a,e[10]=l):l=e[10],l}function lv(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=ke("no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==r||e[6]!==o?(a=m.jsx(Co.List,{"data-slot":"command-list",className:o,...r}),e[5]=r,e[6]=o,e[7]=a):a=e[7],a}function cv(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=ke("py-6 text-center text-sm",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==r||e[6]!==o?(a=m.jsx(Co.Empty,{"data-slot":"command-empty",className:o,...r}),e[5]=r,e[6]=o,e[7]=a):a=e[7],a}function hc(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=ke("overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==r||e[6]!==o?(a=m.jsx(Co.Group,{"data-slot":"command-group",className:o,...r}),e[5]=r,e[6]=o,e[7]=a):a=e[7],a}function XC(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=ke("-mx-1 h-px bg-border",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==r||e[6]!==o?(a=m.jsx(Co.Separator,{"data-slot":"command-separator",className:o,...r}),e[5]=r,e[6]=o,e[7]=a):a=e[7],a}function Ca(t){const e=he.c(14);let n,r,o,a;e[0]!==t?({className:r,children:n,showCheck:a,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=a):(n=e[1],r=e[2],o=e[3],a=e[4]);const c=a===void 0?!0:a;let l;e[5]!==r?(l=ke("group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground",r),e[5]=r,e[6]=l):l=e[6];let u;e[7]!==c?(u=c&&m.jsx(Ls,{className:"ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100"}),e[7]=c,e[8]=u):u=e[8];let f;return e[9]!==n||e[10]!==o||e[11]!==l||e[12]!==u?(f=m.jsxs(Co.Item,{"data-slot":"command-item",className:l,...o,children:[n,u]}),e[9]=n,e[10]=o,e[11]=l,e[12]=u,e[13]=f):f=e[13],f}function Rf(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(MM,{"data-slot":"popover",...n}),e[2]=n,e[3]=r):r=e[3],r}function uv(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(jM,{"data-slot":"popover-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function Tf(t){const e=he.c(12);let n,r,o,a;e[0]!==t?({className:n,align:o,sideOffset:a,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=a):(n=e[1],r=e[2],o=e[3],a=e[4]);const c=o===void 0?"center":o,l=a===void 0?4:a;let u;e[5]!==n?(u=ke("z-50 flex w-72 origin-(--radix-popover-content-transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",n),e[5]=n,e[6]=u):u=e[6];let f;return e[7]!==c||e[8]!==r||e[9]!==l||e[10]!==u?(f=m.jsx(OM,{children:m.jsx(LM,{"data-slot":"popover-content",align:c,sideOffset:l,className:u,...r})}),e[7]=c,e[8]=r,e[9]=l,e[10]=u,e[11]=f):f=e[11],f}function UO(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(DM,{"data-slot":"popover-anchor",...n}),e[2]=n,e[3]=r):r=e[3],r}function $O(t){const e=he.c(59),{workspaces:n,activeWorkspace:r,onSelectWorkspace:o,onCreateVirtualWorkspace:a,onCreatePhysicalWorkspace:c,isWorkspaceFavorited:l,onToggleFavorite:u,onDeleteWorkspace:f}=t,[p,h]=N.useState(!1),[_,x]=N.useState(!1),[C,w]=N.useState(null);let v;e[0]!==(r==null?void 0:r.isVirtual)?(v=r!=null&&r.isVirtual?m.jsx(Pm,{className:"size-4 flex-shrink-0 text-muted-foreground"}):m.jsx(js,{className:"size-4 flex-shrink-0 text-muted-foreground"}),e[0]=r==null?void 0:r.isVirtual,e[1]=v):v=e[1];const b=(r==null?void 0:r.name)||"Select workspace";let y;e[2]!==b?(y=m.jsx("span",{className:"truncate",children:b}),e[2]=b,e[3]=y):y=e[3];let S;e[4]!==v||e[5]!==y?(S=m.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[v,y]}),e[4]=v,e[5]=y,e[6]=S):S=e[6];let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=m.jsx(eS,{className:"ml-auto size-4 shrink-0 opacity-50"}),e[7]=k):k=e[7];let T;e[8]!==p||e[9]!==S?(T=m.jsx(uv,{asChild:!0,children:m.jsxs(Fe,{variant:"outline",role:"combobox","aria-expanded":p,"aria-label":"Select workspace",className:"w-full justify-between h-9",children:[S,k]})}),e[8]=p,e[9]=S,e[10]=T):T=e[10];let R;e[11]===Symbol.for("react.memo_cache_sentinel")?(R=m.jsx(YC,{placeholder:"Search workspace..."}),e[11]=R):R=e[11];let D;e[12]===Symbol.for("react.memo_cache_sentinel")?(D=m.jsx(cv,{children:"No workspace found."}),e[12]=D):D=e[12];let A;if(e[13]!==(r==null?void 0:r.id)||e[14]!==l||e[15]!==o||e[16]!==u||e[17]!==n){let J;e[19]!==(r==null?void 0:r.id)||e[20]!==l||e[21]!==o||e[22]!==u?(J=G=>m.jsxs(Ca,{showCheck:!1,onSelect:()=>{o(G),h(!1)},children:[m.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[G.isVirtual?m.jsx(Pm,{className:"size-4 flex-shrink-0 text-muted-foreground"}):m.jsx(js,{className:"size-4 flex-shrink-0 text-muted-foreground"}),m.jsx("span",{className:"truncate",children:G.name})]}),m.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[m.jsx("button",{className:"p-1 rounded hover:bg-secondary transition-colors",onClick:q=>{q.stopPropagation(),u(G.id,G.name)},title:l(G.id)?"Remove from favorites":"Add to favorites",children:l(G.id)?m.jsx(My,{className:"size-4 fill-primary text-primary"}):m.jsx(My,{className:"size-4 text-muted-foreground"})}),m.jsx(Ls,{className:ke("size-4",(r==null?void 0:r.id)===G.id?"opacity-100":"opacity-0")}),m.jsxs(zC,{children:[m.jsx(BC,{asChild:!0,children:m.jsxs("button",{className:"p-1 rounded hover:bg-secondary transition-colors",onClick:qO,children:[m.jsx(nS,{className:"size-4"}),m.jsx("span",{className:"sr-only",children:"Workspace actions"})]})}),m.jsx(FC,{align:"end",children:m.jsxs(nc,{onClick:q=>{q.stopPropagation(),w(G)},className:"text-destructive focus:text-destructive",children:[m.jsx(Ia,{className:"size-4"}),"Delete workspace"]})})]})]})]},G.id),e[19]=r==null?void 0:r.id,e[20]=l,e[21]=o,e[22]=u,e[23]=J):J=e[23],A=n.map(J),e[13]=r==null?void 0:r.id,e[14]=l,e[15]=o,e[16]=u,e[17]=n,e[18]=A}else A=e[18];let j;e[24]!==A?(j=m.jsx(hc,{heading:"Workspaces",children:A}),e[24]=A,e[25]=j):j=e[25];let O;e[26]===Symbol.for("react.memo_cache_sentinel")?(O=m.jsx(XC,{}),e[26]=O):O=e[26];let P;e[27]!==a?(P=()=>{a(),h(!1)},e[27]=a,e[28]=P):P=e[28];let $;e[29]===Symbol.for("react.memo_cache_sentinel")?($=m.jsx(La,{className:"size-4","data-icon":"inline-start"}),e[29]=$):$=e[29];let U;e[30]!==P?(U=m.jsxs(Ca,{onSelect:P,children:[$,"Create virtual workspace"]}),e[30]=P,e[31]=U):U=e[31];let W;e[32]===Symbol.for("react.memo_cache_sentinel")?(W=m.jsxs(Ca,{onSelect:()=>{h(!1),x(!0)},children:[m.jsx(js,{className:"size-4","data-icon":"inline-start"}),"Add existing folder"]}),e[32]=W):W=e[32];let K;e[33]!==U?(K=m.jsxs(hc,{children:[U,W]}),e[33]=U,e[34]=K):K=e[34];let V;e[35]!==j||e[36]!==K?(V=m.jsx(Tf,{className:"w-[240px] p-0 max-h-[80vh]",children:m.jsxs(av,{children:[R,m.jsxs(lv,{className:"max-h-[50vh] overflow-y-auto",children:[D,j,O,K]})]})}),e[35]=j,e[36]=K,e[37]=V):V=e[37];let Q;e[38]!==p||e[39]!==V||e[40]!==T?(Q=m.jsxs(Rf,{open:p,onOpenChange:h,children:[T,V]}),e[38]=p,e[39]=V,e[40]=T,e[41]=Q):Q=e[41];let X;e[42]!==c?(X=J=>{c(J),x(!1)},e[42]=c,e[43]=X):X=e[43];let I;e[44]!==_||e[45]!==X?(I=m.jsx(fO,{open:_,onOpenChange:x,onSelect:X,title:"Select Workspace Folder"}),e[44]=_,e[45]=X,e[46]=I):I=e[46];const L=C!==null;let z;e[47]===Symbol.for("react.memo_cache_sentinel")?(z=J=>!J&&w(null),e[47]=z):z=e[47];const F=C?`Are you sure you want to delete "${C.name}"? This will permanently remove the workspace and all associated Jean data, including sessions, messages, and temporary files. The actual files in "${C.name}" on disk will not be deleted.`:"";let B;e[48]!==f||e[49]!==C?(B=()=>{C&&(f(C.id),w(null))},e[48]=f,e[49]=C,e[50]=B):B=e[50];let Y;e[51]!==L||e[52]!==F||e[53]!==B?(Y=m.jsx(ng,{open:L,onOpenChange:z,title:"Delete Workspace",description:F,confirmLabel:"Delete",variant:"destructive",onConfirm:B}),e[51]=L,e[52]=F,e[53]=B,e[54]=Y):Y=e[54];let ee;return e[55]!==Q||e[56]!==I||e[57]!==Y?(ee=m.jsxs(m.Fragment,{children:[Q,I,Y]}),e[55]=Q,e[56]=I,e[57]=Y,e[58]=ee):ee=e[58],ee}function qO(t){return t.stopPropagation()}function VO(t){const e=he.c(33),{onOpenAddServer:n,onServerSwitch:r}=t,[o,a]=N.useState(!1),{servers:c,activeServer:l,switchServer:u}=ja();let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=m.jsx(po,{className:"size-4 flex-shrink-0 text-muted-foreground"}),e[0]=f):f=e[0];const p=(l==null?void 0:l.name)||"Select server";let h;e[1]!==p?(h=m.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[f,m.jsx("span",{className:"truncate",children:p})]}),e[1]=p,e[2]=h):h=e[2];let _;e[3]===Symbol.for("react.memo_cache_sentinel")?(_=m.jsx(eS,{className:"ml-auto size-4 shrink-0 opacity-50"}),e[3]=_):_=e[3];let x;e[4]!==o||e[5]!==h?(x=m.jsx(uv,{asChild:!0,children:m.jsxs(Fe,{variant:"outline",role:"combobox","aria-expanded":o,"aria-label":"Select server",className:"w-full justify-between h-9",children:[h,_]})}),e[4]=o,e[5]=h,e[6]=x):x=e[6];let C;e[7]===Symbol.for("react.memo_cache_sentinel")?(C=m.jsx(YC,{placeholder:"Search server..."}),e[7]=C):C=e[7];let w;e[8]===Symbol.for("react.memo_cache_sentinel")?(w=m.jsx(cv,{children:"No server found."}),e[8]=w):w=e[8];let v;if(e[9]!==(l==null?void 0:l.id)||e[10]!==r||e[11]!==c||e[12]!==u){let A;e[14]!==(l==null?void 0:l.id)||e[15]!==r||e[16]!==u?(A=j=>m.jsxs(Ca,{onSelect:()=>{u(j.id),r==null||r(),a(!1)},className:"justify-between",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(po,{className:"size-4 text-muted-foreground"}),m.jsx("span",{children:j.name})]}),m.jsx(Ls,{className:ke("size-4",(l==null?void 0:l.id)===j.id?"opacity-100":"opacity-0")})]},j.id),e[14]=l==null?void 0:l.id,e[15]=r,e[16]=u,e[17]=A):A=e[17],v=c.map(A),e[9]=l==null?void 0:l.id,e[10]=r,e[11]=c,e[12]=u,e[13]=v}else v=e[13];let b;e[18]!==v?(b=m.jsx(hc,{heading:"Servers",children:v}),e[18]=v,e[19]=b):b=e[19];let y;e[20]===Symbol.for("react.memo_cache_sentinel")?(y=m.jsx(XC,{}),e[20]=y):y=e[20];let S;e[21]!==n?(S=()=>{n(),a(!1)},e[21]=n,e[22]=S):S=e[22];let k;e[23]===Symbol.for("react.memo_cache_sentinel")?(k=m.jsx(La,{className:"size-4","data-icon":"inline-start"}),e[23]=k):k=e[23];let T;e[24]!==S?(T=m.jsx(hc,{children:m.jsxs(Ca,{onSelect:S,children:[k,"Add Server..."]})}),e[24]=S,e[25]=T):T=e[25];let R;e[26]!==T||e[27]!==b?(R=m.jsx(Tf,{className:"w-[240px] p-0 max-h-[80vh]",children:m.jsxs(av,{children:[C,m.jsxs(lv,{className:"max-h-[50vh] overflow-y-auto",children:[w,b,y,T]})]})}),e[26]=T,e[27]=b,e[28]=R):R=e[28];let D;return e[29]!==o||e[30]!==R||e[31]!==x?(D=m.jsxs(Rf,{open:o,onOpenChange:a,children:[x,R]}),e[29]=o,e[30]=R,e[31]=x,e[32]=D):D=e[32],D}const dm=640,fm=1300;function Ka(){const t=he.c(2),[e,n]=N.useState(void 0);let r,o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const a=window.matchMedia(`(max-width: ${dm-1}px)`),c=()=>{n(window.innerWidth<dm)};return a.addEventListener("change",c),n(window.innerWidth<dm),()=>a.removeEventListener("change",c)},o=[],t[0]=r,t[1]=o):(r=t[0],o=t[1]),N.useEffect(r,o),!!e}function WO(){const t=he.c(2),[e,n]=N.useState(void 0);let r,o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const a=window.matchMedia(`(max-width: ${fm-1}px)`),c=()=>{n(window.innerWidth<fm)};return a.addEventListener("change",c),n(window.innerWidth<fm),()=>a.removeEventListener("change",c)},o=[],t[0]=r,t[1]=o):(r=t[0],o=t[1]),N.useEffect(r,o),!!e}function ls(t){const e=he.c(12);let n,r,o,a;e[0]!==t?({className:n,orientation:o,decorative:a,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=a):(n=e[1],r=e[2],o=e[3],a=e[4]);const c=o===void 0?"horizontal":o,l=a===void 0?!0:a;let u;e[5]!==n?(u=ke("shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",n),e[5]=n,e[6]=u):u=e[6];let f;return e[7]!==l||e[8]!==c||e[9]!==r||e[10]!==u?(f=m.jsx(UD,{"data-slot":"separator",decorative:l,orientation:c,className:u,...r}),e[7]=l,e[8]=c,e[9]=r,e[10]=u,e[11]=f):f=e[11],f}function Nf(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(Tg,{"data-slot":"sheet",...n}),e[2]=n,e[3]=r):r=e[3],r}function GO(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(MT,{"data-slot":"sheet-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function KO(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(Ng,{"data-slot":"sheet-portal",...n}),e[2]=n,e[3]=r):r=e[3],r}function YO(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=ke("fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==r||e[6]!==o?(a=m.jsx(Mg,{"data-slot":"sheet-overlay",className:o,...r}),e[5]=r,e[6]=o,e[7]=a):a=e[7],a}function Mf(t){const e=he.c(24);let n,r,o,a,c,l;e[0]!==t?({className:r,children:n,side:c,showCloseButton:l,style:a,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=a,e[5]=c,e[6]=l):(n=e[1],r=e[2],o=e[3],a=e[4],c=e[5],l=e[6]);const u=c===void 0?"right":c,f=l===void 0?!0:l;let p;e[7]===Symbol.for("react.memo_cache_sentinel")?(p=m.jsx(YO,{}),e[7]=p):p=e[7];let h;e[8]!==r?(h=ke("fixed z-50 flex flex-col gap-4 bg-background bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10",r),e[8]=r,e[9]=h):h=e[9];let _;e[10]!==u?(_=u==="left"||u==="right"?{top:"env(safe-area-inset-top, 0px)",bottom:"env(safe-area-inset-bottom, 0px)",height:"calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px))"}:u==="top"?{top:"env(safe-area-inset-top, 0px)"}:u==="bottom"?{bottom:"env(safe-area-inset-bottom, 0px)"}:void 0,e[10]=u,e[11]=_):_=e[11];const x=_;let C;e[12]!==x||e[13]!==a?(C=x?{...x,...a}:a,e[12]=x,e[13]=a,e[14]=C):C=e[14];const w=C;let v;e[15]!==f?(v=f&&m.jsx(sf,{"data-slot":"sheet-close",asChild:!0,children:m.jsxs(Fe,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm",children:[m.jsx(Os,{}),m.jsx("span",{className:"sr-only",children:"Close"})]})}),e[15]=f,e[16]=v):v=e[16];let b;return e[17]!==n||e[18]!==o||e[19]!==u||e[20]!==h||e[21]!==w||e[22]!==v?(b=m.jsxs(KO,{children:[p,m.jsxs(Dg,{"data-slot":"sheet-content","data-side":u,className:h,style:w,...o,children:[n,v]})]}),e[17]=n,e[18]=o,e[19]=u,e[20]=h,e[21]=w,e[22]=v,e[23]=b):b=e[23],b}function Df(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=ke("flex flex-col gap-0.5 p-4",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==r||e[6]!==o?(a=m.jsx("div",{"data-slot":"sheet-header",className:o,...r}),e[5]=r,e[6]=o,e[7]=a):a=e[7],a}function jf(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=ke("text-base font-medium text-foreground",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==r||e[6]!==o?(a=m.jsx(KS,{"data-slot":"sheet-title",className:o,...r}),e[5]=r,e[6]=o,e[7]=a):a=e[7],a}function XO(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=ke("text-sm text-muted-foreground",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==r||e[6]!==o?(a=m.jsx(YS,{"data-slot":"sheet-description",className:o,...r}),e[5]=r,e[6]=o,e[7]=a):a=e[7],a}function hm(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=ke("animate-pulse rounded-md bg-muted",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==r||e[6]!==o?(a=m.jsx("div",{"data-slot":"skeleton",className:o,...r}),e[5]=r,e[6]=o,e[7]=a):a=e[7],a}function Pd(t){const e=he.c(6);let n,r;e[0]!==t?({delayDuration:r,...n}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);const o=r===void 0?0:r;let a;return e[3]!==o||e[4]!==n?(a=m.jsx(uj,{"data-slot":"tooltip-provider",delayDuration:o,...n}),e[3]=o,e[4]=n,e[5]=a):a=e[5],a}function pc(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(dj,{"data-slot":"tooltip",...n}),e[2]=n,e[3]=r):r=e[3],r}function mc(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(fj,{"data-slot":"tooltip-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function gc(t){const e=he.c(13);let n,r,o,a;e[0]!==t?({className:r,sideOffset:a,children:n,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=a):(n=e[1],r=e[2],o=e[3],a=e[4]);const c=a===void 0?0:a;let l;e[5]!==r?(l=ke("z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",r),e[5]=r,e[6]=l):l=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx(mj,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"}),e[7]=u):u=e[7];let f;return e[8]!==n||e[9]!==o||e[10]!==c||e[11]!==l?(f=m.jsx(hj,{children:m.jsxs(pj,{"data-slot":"tooltip-content",sideOffset:c,className:l,...o,children:[n,u]})}),e[8]=n,e[9]=o,e[10]=c,e[11]=l,e[12]=f):f=e[12],f}const QO="sidebar_state",ZO=3600*24*7,JO="16rem",e8="18rem",t8="3rem",QC=N.createContext(null);function Ic(){const t=N.useContext(QC);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function n8(t){const e=he.c(33);let n,r,o,a,c,l,u;e[0]!==t?({defaultOpen:u,open:o,onOpenChange:c,className:r,style:l,children:n,...a}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=a,e[5]=c,e[6]=l,e[7]=u):(n=e[1],r=e[2],o=e[3],a=e[4],c=e[5],l=e[6],u=e[7]);const f=u===void 0?!0:u,p=Ka(),[h,_]=N.useState(!1),[x,C]=N.useState(f),w=o!=null?o:x;let v;e[8]!==w||e[9]!==c?(v=$=>{const U=typeof $=="function"?$(w):$;c?c(U):C(U),document.cookie=`${QO}=${U}; path=/; max-age=${ZO}`},e[8]=w,e[9]=c,e[10]=v):v=e[10];const b=v;let y;e[11]!==p||e[12]!==b?(y=()=>p?_(s8):b(r8),e[11]=p,e[12]=b,e[13]=y):y=e[13];const S=y,k=w?"expanded":"collapsed";let T;e[14]!==p||e[15]!==w||e[16]!==h||e[17]!==b||e[18]!==k||e[19]!==S?(T={state:k,open:w,setOpen:b,isMobile:p,openMobile:h,setOpenMobile:_,toggleSidebar:S},e[14]=p,e[15]=w,e[16]=h,e[17]=b,e[18]=k,e[19]=S,e[20]=T):T=e[20];const R=T;let D;e[21]!==l?(D={"--sidebar-width":JO,"--sidebar-width-icon":t8,...l},e[21]=l,e[22]=D):D=e[22];const A=D;let j;e[23]!==r?(j=ke("overflow-hidden group/sidebar-wrapper flex h-full w-full has-data-[variant=inset]:bg-sidebar",r),e[23]=r,e[24]=j):j=e[24];let O;e[25]!==n||e[26]!==a||e[27]!==A||e[28]!==j?(O=m.jsx("div",{"data-slot":"sidebar-wrapper",style:A,className:j,...a,children:n}),e[25]=n,e[26]=a,e[27]=A,e[28]=j,e[29]=O):O=e[29];let P;return e[30]!==R||e[31]!==O?(P=m.jsx(QC.Provider,{value:R,children:O}),e[30]=R,e[31]=O,e[32]=P):P=e[32],P}function r8(t){return!t}function s8(t){return!t}function i8(t){const e=he.c(49);let n,r,o,a,c,l,u;e[0]!==t?({side:c,variant:l,collapsible:u,className:r,children:n,dir:o,...a}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=a,e[5]=c,e[6]=l,e[7]=u):(n=e[1],r=e[2],o=e[3],a=e[4],c=e[5],l=e[6],u=e[7]);const f=c===void 0?"left":c,p=l===void 0?"sidebar":l,h=u===void 0?"offcanvas":u,{isMobile:_,state:x,openMobile:C,setOpenMobile:w}=Ic();if(h==="none"){let O;e[8]!==r?(O=ke("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",r),e[8]=r,e[9]=O):O=e[9];let P;return e[10]!==n||e[11]!==a||e[12]!==O?(P=m.jsx("div",{"data-slot":"sidebar",className:O,...a,children:n}),e[10]=n,e[11]=a,e[12]=O,e[13]=P):P=e[13],P}if(_){let O;e[14]===Symbol.for("react.memo_cache_sentinel")?(O={"--sidebar-width":e8},e[14]=O):O=e[14];let P;e[15]===Symbol.for("react.memo_cache_sentinel")?(P=m.jsxs(Df,{className:"sr-only",children:[m.jsx(jf,{children:"Sidebar"}),m.jsx(XO,{children:"Displays the mobile sidebar."})]}),e[15]=P):P=e[15];let $;e[16]!==n?($=m.jsx("div",{className:"flex h-full w-full flex-col",children:n}),e[16]=n,e[17]=$):$=e[17];let U;e[18]!==o||e[19]!==f||e[20]!==$?(U=m.jsxs(Mf,{dir:o,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:O,side:f,children:[P,$]}),e[18]=o,e[19]=f,e[20]=$,e[21]=U):U=e[21];let W;return e[22]!==C||e[23]!==a||e[24]!==w||e[25]!==U?(W=m.jsx(Nf,{open:C,onOpenChange:w,...a,children:U}),e[22]=C,e[23]=a,e[24]=w,e[25]=U,e[26]=W):W=e[26],W}const v=x==="collapsed"?h:"",b=p==="floating"||p==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)";let y;e[27]!==b?(y=ke("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",b),e[27]=b,e[28]=y):y=e[28];let S;e[29]!==y?(S=m.jsx("div",{"data-slot":"sidebar-gap",className:y}),e[29]=y,e[30]=S):S=e[30];const k=p==="floating"||p==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l";let T;e[31]!==r||e[32]!==k?(T=ke("fixed z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",k,r),e[31]=r,e[32]=k,e[33]=T):T=e[33];let R;e[34]===Symbol.for("react.memo_cache_sentinel")?(R={top:"env(safe-area-inset-top, 0)",bottom:"env(safe-area-inset-bottom, 0)",height:"calc(100vh - env(safe-area-inset-top, 0) - env(safe-area-inset-bottom, 0))"},e[34]=R):R=e[34];let D;e[35]!==n?(D=m.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border",children:n}),e[35]=n,e[36]=D):D=e[36];let A;e[37]!==a||e[38]!==f||e[39]!==D||e[40]!==T?(A=m.jsx("div",{"data-slot":"sidebar-container","data-side":f,className:T,style:R,...a,children:D}),e[37]=a,e[38]=f,e[39]=D,e[40]=T,e[41]=A):A=e[41];let j;return e[42]!==f||e[43]!==x||e[44]!==A||e[45]!==v||e[46]!==S||e[47]!==p?(j=m.jsxs("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":x,"data-collapsible":v,"data-variant":p,"data-side":f,"data-slot":"sidebar",children:[S,A]}),e[42]=f,e[43]=x,e[44]=A,e[45]=v,e[46]=S,e[47]=p,e[48]=j):j=e[48],j}function yb(t){const e=he.c(15);let n,r,o;e[0]!==t?({className:n,onClick:r,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]);const{toggleSidebar:a}=Ic();let c;e[4]!==n?(c=ke(n),e[4]=n,e[5]=c):c=e[5];let l;e[6]!==r||e[7]!==a?(l=h=>{r==null||r(h),a()},e[6]=r,e[7]=a,e[8]=l):l=e[8];let u,f;e[9]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx(uA,{}),f=m.jsx("span",{className:"sr-only",children:"Toggle Sidebar"}),e[9]=u,e[10]=f):(u=e[9],f=e[10]);let p;return e[11]!==o||e[12]!==c||e[13]!==l?(p=m.jsxs(Fe,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:c,onClick:l,...o,children:[u,f]}),e[11]=o,e[12]=c,e[13]=l,e[14]=p):p=e[14],p}function o8(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=ke("flex flex-col gap-2 p-2",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==r||e[6]!==o?(a=m.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:o,...r}),e[5]=r,e[6]=o,e[7]=a):a=e[7],a}function a8(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=ke("flex flex-col gap-2 p-2",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==r||e[6]!==o?(a=m.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:o,...r}),e[5]=r,e[6]=o,e[7]=a):a=e[7],a}function l8(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=ke("mx-2 w-auto bg-sidebar-border",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==r||e[6]!==o?(a=m.jsx(ls,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:o,...r}),e[5]=r,e[6]=o,e[7]=a):a=e[7],a}const c8=N.forwardRef((t,e)=>{const n=he.c(9);let r,o;n[0]!==t?({className:r,...o}=t,n[0]=t,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let a;n[3]!==r?(a=ke("no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",r),n[3]=r,n[4]=a):a=n[4];let c;return n[5]!==o||n[6]!==e||n[7]!==a?(c=m.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:a,ref:e,...o}),n[5]=o,n[6]=e,n[7]=a,n[8]=c):c=n[8],c});function zd(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=ke("relative flex w-full min-w-0 flex-col p-2",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==r||e[6]!==o?(a=m.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:o,...r}),e[5]=r,e[6]=o,e[7]=a):a=e[7],a}function Bd(t){const e=he.c(10);let n,r,o;e[0]!==t?({className:n,asChild:o,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]);const c=(o===void 0?!1:o)?xc:"div";let l;e[4]!==n?(l=ke("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",n),e[4]=n,e[5]=l):l=e[5];let u;return e[6]!==c||e[7]!==r||e[8]!==l?(u=m.jsx(c,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:l,...r}),e[6]=c,e[7]=r,e[8]=l,e[9]=u):u=e[9],u}function Fd(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=ke("w-full text-sm",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==r||e[6]!==o?(a=m.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:o,...r}),e[5]=r,e[6]=o,e[7]=a):a=e[7],a}function xa(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=ke("flex w-full min-w-0 flex-col gap-0",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==r||e[6]!==o?(a=m.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:o,...r}),e[5]=r,e[6]=o,e[7]=a):a=e[7],a}function fo(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=ke("group/menu-item relative",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==r||e[6]!==o?(a=m.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:o,...r}),e[5]=r,e[6]=o,e[7]=a):a=e[7],a}const u8=Pa("peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus:ring-1 focus:ring-inset active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function ka(t){const e=he.c(28);let n,r,o,a,c,l,u;e[0]!==t?({asChild:o,isActive:a,variant:c,size:l,tooltip:u,className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=a,e[5]=c,e[6]=l,e[7]=u):(n=e[1],r=e[2],o=e[3],a=e[4],c=e[5],l=e[6],u=e[7]);const f=o===void 0?!1:o,p=a===void 0?!1:a,h=c===void 0?"default":c,_=l===void 0?"default":l,x=f?xc:"button",{isMobile:C,state:w}=Ic();let v;e[8]!==n||e[9]!==_||e[10]!==h?(v=ke(u8({variant:h,size:_}),n),e[8]=n,e[9]=_,e[10]=h,e[11]=v):v=e[11];let b;e[12]!==x||e[13]!==p||e[14]!==r||e[15]!==_||e[16]!==v?(b=m.jsx(x,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":_,"data-active":p,className:v,...r}),e[12]=x,e[13]=p,e[14]=r,e[15]=_,e[16]=v,e[17]=b):b=e[17];const y=b;if(!u)return y;if(typeof u=="string"){let D;e[18]!==u?(D={children:u},e[18]=u,e[19]=D):D=e[19],u=D}let S;e[20]!==y?(S=m.jsx(mc,{asChild:!0,children:y}),e[20]=y,e[21]=S):S=e[21];const k=w!=="collapsed"||C;let T;e[22]!==k||e[23]!==u?(T=m.jsx(gc,{side:"right",align:"center",hidden:k,...u}),e[22]=k,e[23]=u,e[24]=T):T=e[24];let R;return e[25]!==S||e[26]!==T?(R=m.jsxs(pc,{children:[S,T]}),e[25]=S,e[26]=T,e[27]=R):R=e[27],R}function d8(t){const e=he.c(12);let n,r,o,a;e[0]!==t?({className:n,asChild:o,showOnHover:a,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=a):(n=e[1],r=e[2],o=e[3],a=e[4]);const c=o===void 0?!1:o,l=a===void 0?!1:a,u=c?xc:"button",f=l&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-active/menu-button:text-sidebar-accent-foreground aria-expanded:opacity-100 md:opacity-0";let p;e[5]!==n||e[6]!==f?(p=ke("absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus:ring-1 focus:ring-inset md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0",f,n),e[5]=n,e[6]=f,e[7]=p):p=e[7];let h;return e[8]!==u||e[9]!==r||e[10]!==p?(h=m.jsx(u,{"data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:p,...r}),e[8]=u,e[9]=r,e[10]=p,e[11]=h):h=e[11],h}function f8(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=ke("ml-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border pl-2.5 py-0.5 group-data-[collapsible=icon]:hidden",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==r||e[6]!==o?(a=m.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:o,...r}),e[5]=r,e[6]=o,e[7]=a):a=e[7],a}function h8(t){const e=he.c(22);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);const o=Ka(),a=Qt(m8),c=Qt(p8),[l,u]=N.useState(!1),f=N.useRef(!1),p=N.useRef(0),h=N.useRef(0),_=N.useRef(0),x=N.useRef(null),C=N.useRef(null);let w;e[3]!==o?(w=O=>{if(o)return;O.preventDefault(),O.stopPropagation(),f.current=!0,u(!0),p.current=O.clientX,h.current=_.current,document.body.style.cursor="ew-resize",document.body.style.userSelect="none";const P=document.querySelector('[data-slot="sidebar-wrapper"]');x.current=P,P&&(C.current=P.style.getPropertyValue("--sidebar-width")||null,P.classList.add("no-transition"))},e[3]=o,e[4]=w):w=e[4];const v=w;let b,y;e[5]!==a?(b=()=>{_.current=a},y=[a],e[5]=a,e[6]=b,e[7]=y):(b=e[6],y=e[7]),N.useEffect(b,y);let S,k;if(e[8]!==c?(S=()=>{const O=$=>{if(!f.current)return;const U=$.clientX-p.current,W=wd(h.current+U);_.current=W;const K=x.current||document.querySelector('[data-slot="sidebar-wrapper"]');K&&(K.style.setProperty("--sidebar-width",`${Math.round(W)}px`),x.current=K)},P=()=>{if(!f.current)return;f.current=!1,u(!1),document.body.style.cursor="",document.body.style.userSelect="";const $=x.current||document.querySelector('[data-slot="sidebar-wrapper"]');$&&($.classList.remove("no-transition"),C.current!==null?$.style.setProperty("--sidebar-width",C.current):$.style.removeProperty("--sidebar-width")),c(Math.round(_.current))};return document.addEventListener("mousemove",O),document.addEventListener("mouseup",P),()=>{document.removeEventListener("mousemove",O),document.removeEventListener("mouseup",P)}},k=[c],e[8]=c,e[9]=S,e[10]=k):(S=e[9],k=e[10]),N.useEffect(S,k),o)return null;let T;e[11]!==n?(T=ke("absolute top-0 right-0 z-30 h-full w-2 flex cursor-ew-resize items-center justify-center group/sidebar-resize",n),e[11]=n,e[12]=T):T=e[12];const R=l?"bg-primary":"group-active/sidebar-resize:bg-primary";let D;e[13]!==R?(D=ke("h-8 w-0.5 rounded-full transition-colors duration-100","bg-transparent group-hover/sidebar-resize:bg-border",R),e[13]=R,e[14]=D):D=e[14];let A;e[15]!==D?(A=m.jsx("div",{className:D}),e[15]=D,e[16]=A):A=e[16];let j;return e[17]!==v||e[18]!==r||e[19]!==T||e[20]!==A?(j=m.jsx("div",{"data-slot":"sessions-resize-handle",className:T,onMouseDown:v,...r,children:A}),e[17]=v,e[18]=r,e[19]=T,e[20]=A,e[21]=j):j=e[21],j}function p8(t){return t.setSessionsPanelWidth}function m8(t){return t.sessionsPanelWidth}function ki(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(yR,{"data-slot":"collapsible",...n}),e[2]=n,e[3]=r):r=e[3],r}function Ei(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(yS,{"data-slot":"collapsible-trigger",...n}),e[2]=n,e[3]=r):r=e[3],r}function Ai(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(bS,{"data-slot":"collapsible-content",...n}),e[2]=n,e[3]=r):r=e[3],r}const bb=Tn.memo(function(e){const n=he.c(13),{isClosed:r,isEditing:o,onRename:a,onReopen:c,onClose:l,onDelete:u}=e;if(o){let C;return n[0]===Symbol.for("react.memo_cache_sentinel")?(C=m.jsx("div",{className:"shrink-0 size-7"}),n[0]=C):C=n[0],C}let f;n[1]===Symbol.for("react.memo_cache_sentinel")?(f=m.jsx(BC,{asChild:!0,children:m.jsxs(d8,{showOnHover:!0,children:[m.jsx(nS,{className:"size-4"}),m.jsx("span",{className:"sr-only",children:"Session actions"})]})}),n[1]=f):f=n[1];let p;n[2]===Symbol.for("react.memo_cache_sentinel")?(p=m.jsx(hA,{className:"size-4"}),n[2]=p):p=n[2];let h;n[3]!==a?(h=m.jsxs(nc,{onClick:a,children:[p,"Rename"]}),n[3]=a,n[4]=h):h=n[4];let _;n[5]!==r||n[6]!==l||n[7]!==u||n[8]!==c?(_=r?m.jsxs(m.Fragment,{children:[m.jsxs(nc,{onClick:c,children:[m.jsx(oS,{className:"size-4"}),"Restore"]}),m.jsxs(nc,{onClick:u,className:"text-destructive focus:text-destructive",children:[m.jsx(Ia,{className:"size-4"}),"Delete permanently"]})]}):m.jsxs(nc,{onClick:l,children:[m.jsx(Os,{className:"size-4"}),"Archive"]}),n[5]=r,n[6]=l,n[7]=u,n[8]=c,n[9]=_):_=n[9];let x;return n[10]!==h||n[11]!==_?(x=m.jsxs(zC,{children:[f,m.jsxs(FC,{align:"end",children:[h,_]})]}),n[10]=h,n[11]=_,n[12]=x):x=n[12],x}),xb=Tn.memo(function(e){const n=he.c(4),{status:r,isStreaming:o,runningAt:a}=e;if(o||r==="running"||!!a){let u;return n[0]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx(pr,{className:"size-3.5 animate-spin shrink-0"}),n[0]=u):u=n[0],u}if(r==="error"){let u;return n[1]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx(Qd,{className:"size-3.5 shrink-0"}),n[1]=u):u=n[1],u}if(r==="interrupted"){let u;return n[2]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx(iS,{className:"size-3.5 shrink-0"}),n[2]=u):u=n[2],u}let l;return n[3]===Symbol.for("react.memo_cache_sentinel")?(l=m.jsx(bc,{className:"size-3.5 shrink-0"}),n[3]=l):l=n[3],l}),ig=Tn.memo(function t({session:e,childrenMap:n,sessionDerivedValues:r,isActive:o,currentSessionId:a,onResumeSession:c,onCloseSession:l,onReopenSession:u,onDeleteSession:f,onRename:p}){var Q,X;const[h,_]=N.useState(!1),[x,C]=N.useState(e.title||""),w=N.useRef(null),v=(Q=r.get(e.id))!=null?Q:{isStreaming:!1,hasPendingPermission:!1},b=(X=n.get(e.id))!=null?X:[],y=b.length>0,S=e.status==="closed",k=b.some(I=>I.id===a),T=Qt(D4(e.id)),R=Qt(I=>I.clearCompletion),[D,A]=N.useState(()=>Date.now());N.useEffect(()=>{const I=setInterval(()=>A(Date.now()),500);return()=>clearInterval(I)},[]);const j=!!T&&D-T.flashStartedAt<ky,O=(T==null?void 0:T.type)==="flash-then-sticky";N.useEffect(()=>{if(!T||T.type!=="flash-only")return;const I=ky-(D-T.flashStartedAt);if(I<=0){R(e.id);return}const L=setTimeout(()=>{R(e.id)},I);return()=>clearTimeout(L)},[T,e.id,R,D]);const P=j?"animate-completion-flash rounded-md":O?"bg-[oklch(0.85_0.15_145_/_0.15)] rounded-md":"",$=N.useRef(!1);N.useEffect(()=>{h&&w.current?$.current||(w.current.focus(),w.current.select(),$.current=!0):$.current=!1},[h]),N.useEffect(()=>{h||C(e.title||"")},[h,e.title]);const U=()=>{C(e.title||""),_(!0)},W=()=>{const I=x.trim();I&&I!==e.title&&p(e.id,I),_(!1)},K=()=>{_(!1),C(e.title||"")},V=I=>{I.key==="Enter"?(I.preventDefault(),W()):I.key==="Escape"&&(I.preventDefault(),K())};return y?m.jsx(Pd,{delayDuration:300,children:m.jsx(ki,{defaultOpen:o||k,className:"group/collapsible",children:m.jsxs(fo,{children:[m.jsxs("div",{className:"flex items-center w-full",children:[m.jsx(Ei,{asChild:!0,children:m.jsx("button",{className:"flex items-center justify-center rounded-md hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shrink-0 size-7 p-1","aria-label":"Toggle child sessions",children:m.jsx(Wr,{className:"size-4 transition-transform duration-200 [[data-state=open]>&]:rotate-90"})})}),h?m.jsx("input",{ref:w,type:"text",value:x,onChange:I=>C(I.target.value),onKeyDown:V,onBlur:W,"aria-label":`Rename session: ${e.title||"Untitled"}`,className:"flex-1 min-w-0 h-8 px-2 text-sm bg-background border border-input rounded-md focus:outline-none focus:ring-2 focus:ring-ring"}):m.jsx(ka,{"data-session-id":e.id,isActive:o,onClick:()=>c(e.id),className:ke("flex-1 min-w-0",P),children:m.jsxs(pc,{children:[m.jsx(mc,{asChild:!0,children:m.jsxs("span",{className:"truncate flex items-center gap-2",children:[m.jsx(xb,{status:e.subagentStatus,isStreaming:o?v.isStreaming:!1,runningAt:e.runningAt}),v.hasPendingPermission&&m.jsx(lc,{className:"size-3 text-warning shrink-0 animate-pulse"}),e.title||"Untitled"]})}),m.jsx(gc,{side:"right",className:"max-w-xs",children:e.title||"Untitled"})]})}),m.jsx(bb,{isClosed:S,isEditing:h,onRename:U,onReopen:()=>u(e.id),onClose:()=>l(e.id),onDelete:()=>f(e.id)})]}),m.jsx(Ai,{children:m.jsx(f8,{children:b.map(I=>m.jsx(t,{session:I,childrenMap:n,sessionDerivedValues:r,isActive:a===I.id,currentSessionId:a,onResumeSession:c,onCloseSession:l,onReopenSession:u,onDeleteSession:f,onRename:p},I.id))})})]})})}):m.jsx(Pd,{delayDuration:300,children:m.jsx(fo,{children:m.jsxs("div",{className:"flex items-center w-full",children:[m.jsx("div",{className:"shrink-0 size-7 p-1"}),h?m.jsx("input",{ref:w,type:"text",value:x,onChange:I=>C(I.target.value),onKeyDown:V,onBlur:W,"aria-label":`Rename session: ${e.title||"Untitled"}`,className:"flex-1 min-w-0 h-8 px-2 text-sm bg-background border border-input rounded-md focus:outline-none focus:ring-2 focus:ring-ring"}):m.jsx(ka,{"data-session-id":e.id,isActive:o,onClick:()=>c(e.id),className:ke("flex-1 min-w-0",P),children:m.jsxs(pc,{children:[m.jsx(mc,{asChild:!0,children:m.jsxs("span",{className:"truncate flex items-center gap-2",children:[m.jsx(xb,{status:e.subagentStatus,isStreaming:o?v.isStreaming:!1,runningAt:e.runningAt}),v.hasPendingPermission&&m.jsx(lc,{className:"size-3 text-warning shrink-0 animate-pulse"}),e.title||"Untitled"]})}),m.jsx(gc,{side:"right",className:"max-w-xs",children:e.title||"Untitled"})]})}),m.jsx(bb,{isClosed:S,isEditing:h,onRename:U,onReopen:()=>u(e.id),onClose:()=>l(e.id),onDelete:()=>f(e.id)})]})})})}),g8=Pa("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function $n(t){const e=he.c(13);let n,r,o,a;e[0]!==t?({className:n,variant:o,asChild:a,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=a):(n=e[1],r=e[2],o=e[3],a=e[4]);const c=o===void 0?"default":o,u=(a===void 0?!1:a)?xc:"span";let f;e[5]!==n||e[6]!==c?(f=ke(g8({variant:c}),n),e[5]=n,e[6]=c,e[7]=f):f=e[7];let p;return e[8]!==u||e[9]!==r||e[10]!==f||e[11]!==c?(p=m.jsx(u,{"data-slot":"badge","data-variant":c,className:f,...r}),e[8]=u,e[9]=r,e[10]=f,e[11]=c,e[12]=p):p=e[12],p}const v8=Tn.memo(function(e){const n=he.c(43),{allSessions:r,childrenMap:o,sessionDerivedValues:a,currentSession:c,currentSessionId:l,favoritedWorkspaceIds:u,workspaces:f,activeWorkspace:p,onSelectWorkspace:h,onResumeSession:_,onCloseSession:x,onReopenSession:C,onDeleteSession:w,onRenameSession:v,onCreateSessionInWorkspace:b,connected:y}=e;let S;if(n[0]!==u||n[1]!==f){const j=new Map(f.map(_8));S=u.map(O=>j.get(O)).filter(y8),n[0]=u,n[1]=f,n[2]=S}else S=n[2];const k=S;let T;if(n[3]!==r||n[4]!==k){T=new Map;for(const j of k){const O=r.filter(P=>P.workspaceId===j.id&&P.status==="active"&&P.parentId===null).sort(b8);T.set(j.id,O)}n[3]=r,n[4]=k,n[5]=T}else T=n[5];const R=T;if(k.length===0){let j;n[6]===Symbol.for("react.memo_cache_sentinel")?(j=m.jsx(Bd,{children:"Overview"}),n[6]=j):j=n[6];let O;return n[7]===Symbol.for("react.memo_cache_sentinel")?(O=m.jsxs(zd,{children:[j,m.jsx(Fd,{children:m.jsx("div",{className:"px-2 py-8 text-center text-sm text-muted-foreground",children:"Star a workspace to see it here"})})]}),n[7]=O):O=n[7],O}let D;if(n[8]!==(p==null?void 0:p.id)||n[9]!==o||n[10]!==y||n[11]!==(c==null?void 0:c.id)||n[12]!==(c==null?void 0:c.workspaceId)||n[13]!==l||n[14]!==k||n[15]!==x||n[16]!==b||n[17]!==w||n[18]!==v||n[19]!==C||n[20]!==_||n[21]!==h||n[22]!==a||n[23]!==R){let j;n[25]!==(p==null?void 0:p.id)||n[26]!==o||n[27]!==y||n[28]!==(c==null?void 0:c.id)||n[29]!==(c==null?void 0:c.workspaceId)||n[30]!==l||n[31]!==x||n[32]!==b||n[33]!==w||n[34]!==v||n[35]!==C||n[36]!==_||n[37]!==h||n[38]!==a||n[39]!==R?(j=O=>{const P=O.id===(p==null?void 0:p.id),$=(c==null?void 0:c.workspaceId)===O.id,U=R.get(O.id)||[];return m.jsx(ki,{defaultOpen:P,className:"group/collapsible",children:m.jsxs(zd,{children:[m.jsx(Bd,{asChild:!0,children:m.jsxs(Ei,{className:"flex items-center justify-between w-full",onClick:()=>h(O),children:[m.jsxs("span",{className:"flex items-center gap-2",children:[m.jsx(Wr,{className:"size-3 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"}),O.isVirtual?m.jsx(Pm,{className:"size-3.5"}):m.jsx(js,{className:"size-3.5"}),m.jsx("span",{className:$?"truncate text-sidebar-foreground font-medium":"truncate",children:O.name})]}),m.jsx($n,{variant:"secondary",children:U.length})]})}),m.jsx(Ai,{children:m.jsxs(Fd,{children:[m.jsx(xa,{children:m.jsx(fo,{children:m.jsxs(ka,{onClick:()=>b(O.id),disabled:!y,className:"w-full",children:[m.jsx(La,{className:"size-4","data-icon":"inline-start"}),m.jsx("span",{children:"New Chat"})]})})}),m.jsx(l8,{}),m.jsx(xa,{children:U.length===0?m.jsx("div",{className:"px-2 py-1 text-xs text-muted-foreground",children:"(no active sessions)"}):U.map(W=>m.jsx(ig,{session:W,childrenMap:o,sessionDerivedValues:a,isActive:(c==null?void 0:c.id)===W.id,currentSessionId:l,onResumeSession:_,onCloseSession:x,onReopenSession:C,onDeleteSession:w,onRename:v},W.id))})]})})]})},O.id)},n[25]=p==null?void 0:p.id,n[26]=o,n[27]=y,n[28]=c==null?void 0:c.id,n[29]=c==null?void 0:c.workspaceId,n[30]=l,n[31]=x,n[32]=b,n[33]=w,n[34]=v,n[35]=C,n[36]=_,n[37]=h,n[38]=a,n[39]=R,n[40]=j):j=n[40],D=k.map(j),n[8]=p==null?void 0:p.id,n[9]=o,n[10]=y,n[11]=c==null?void 0:c.id,n[12]=c==null?void 0:c.workspaceId,n[13]=l,n[14]=k,n[15]=x,n[16]=b,n[17]=w,n[18]=v,n[19]=C,n[20]=_,n[21]=h,n[22]=a,n[23]=R,n[24]=D}else D=n[24];let A;return n[41]!==D?(A=m.jsx(m.Fragment,{children:D}),n[41]=D,n[42]=A):A=n[42],A});function _8(t){return[t.id,t]}function y8(t){return t!==void 0}function b8(t,e){return new Date(e.updatedAt).getTime()-new Date(t.updatedAt).getTime()}const x8=N.forwardRef((t,e)=>{var qt;const n=he.c(101),{sessions:r,currentSession:o,currentSessionId:a,streamingSessionIds:c,pendingPermissions:l,connected:u,workspaces:f,activeWorkspace:p,allSessions:h,favoritedWorkspaceIds:_,onCreateSession:x,onResumeSession:C,onCloseSession:w,onReopenSession:v,onDeleteSession:b,onRenameSession:y,onSelectWorkspace:S,onCreateVirtualWorkspace:k,onCreatePhysicalWorkspace:T,onDeleteWorkspace:R,onCreateSessionInWorkspace:D,onOpenSettings:A,onOpenMCP:j,onOpenAddServer:O,onServerSwitch:P,onEscape:$}=t,U=Qt(S8),{quickConnections:W,addToQuickConnections:K,removeFromQuickConnections:V,activeServer:Q}=ja();Ic();const X=N.useRef(null),I=N.useRef(null);let L,z;n[0]!==a?(L=()=>{I.current=a},z=[a],n[0]=a,n[1]=L,n[2]=z):(L=n[1],z=n[2]),N.useEffect(L,z);let F;n[3]===Symbol.for("react.memo_cache_sentinel")?(F=()=>{var Ht;const tt=X.current;if(!tt)return;const vt=Array.from(tt.querySelectorAll('[data-sidebar="menu-button"]'));if(vt.length===0){tt.focus();return}const Vt=vt.find(Wt=>Wt.getAttribute("data-session-id")===I.current);Vt?Vt.focus():(Ht=vt[0])==null||Ht.focus()},n[3]=F):F=n[3];const B=F;let Y,ee;n[4]===Symbol.for("react.memo_cache_sentinel")?(Y=()=>({focusSessionPanel:B}),ee=[B],n[4]=Y,n[5]=ee):(Y=n[4],ee=n[5]),N.useImperativeHandle(e,Y,ee);let J;n[6]!==$?(J=tt=>{var Sn,jr,zn,Wn,Gn;const vt=X.current;if(!vt)return;const Vt=document.activeElement;if(Vt instanceof HTMLInputElement||Vt instanceof HTMLTextAreaElement||Vt instanceof HTMLElement&&Vt.contentEditable==="true")return;const Ht=Array.from(vt.querySelectorAll('[data-sidebar="menu-button"]')),Wt=Ht.indexOf(document.activeElement);e:switch(tt.key){case"ArrowDown":{tt.preventDefault();const Gt=Wt<Ht.length-1?Wt+1:0;(Sn=Ht[Gt])==null||Sn.focus();break e}case"ArrowUp":{tt.preventDefault();const Gt=Wt>0?Wt-1:Ht.length-1;(jr=Ht[Gt])==null||jr.focus();break e}case"ArrowRight":{const Gt=(zn=document.activeElement)==null?void 0:zn.parentElement;if(!Gt)break e;const dn=Gt.querySelector('button[aria-label="Toggle child sessions"]');if(!dn)break e;const gn=Gt.closest("[data-state]");(gn==null?void 0:gn.dataset.state)==="closed"&&(tt.preventDefault(),dn.click());break e}case"ArrowLeft":{const Gt=(Wn=document.activeElement)==null?void 0:Wn.parentElement;if(!Gt)break e;const dn=Gt.querySelector('button[aria-label="Toggle child sessions"]');if(!dn)break e;const gn=Gt.closest("[data-state]");(gn==null?void 0:gn.dataset.state)==="open"&&(tt.preventDefault(),dn.click());break e}case"Enter":{document.activeElement instanceof HTMLButtonElement&&document.activeElement.click();break e}case"Escape":tt.preventDefault(),(Gn=document.activeElement)==null||Gn.blur(),$==null||$()}},n[6]=$,n[7]=J):J=n[7];const G=J;let q;if(n[8]!==h){q=new Map;for(const tt of h)if(tt.parentId){const vt=(qt=q.get(tt.parentId))!=null?qt:[];vt.push(tt),q.set(tt.parentId,vt)}n[8]=h,n[9]=q}else q=n[9];const te=q;let re;n[10]!==l?(re=new Set(l.map(w8)),n[10]=l,n[11]=re):re=n[11];const oe=re;let se;if(n[12]!==h||n[13]!==a||n[14]!==oe||n[15]!==c){se=new Map;for(const tt of h){const vt=c.has(tt.id),Vt=oe.has(tt.id),Wt=tt.id===a&&vt||tt.subagentStatus==="running"||!!tt.runningAt;se.set(tt.id,{isStreaming:vt,hasPendingPermission:Vt,isRunning:Wt})}n[12]=h,n[13]=a,n[14]=oe,n[15]=c,n[16]=se}else se=n[16];const ye=se;let Ee,Ae;if(n[17]!==r){const tt=r.filter(C8);Ee=tt.filter(k8),Ae=tt.filter(E8),n[17]=r,n[18]=Ee,n[19]=Ae}else Ee=n[18],Ae=n[19];let Be;n[20]!==Ee||n[21]!==Ae?(Be={activeSessions:Ee,archivedSessions:Ae},n[20]=Ee,n[21]=Ae,n[22]=Be):Be=n[22];const{activeSessions:le,archivedSessions:Ce}=Be;let ge;n[23]!==(Q==null?void 0:Q.id)||n[24]!==W?(ge=tt=>W.some(vt=>vt.workspaceId===tt&&vt.serverId===(Q==null?void 0:Q.id)),n[23]=Q==null?void 0:Q.id,n[24]=W,n[25]=ge):ge=n[25];const Oe=ge;let He;n[26]!==Q||n[27]!==K||n[28]!==W||n[29]!==V?(He=(tt,vt)=>{if(!Q)return;const Vt=W.find(Ht=>Ht.workspaceId===tt&&Ht.serverId===Q.id);Vt?V(Vt.id):K(Q.id,Q.name,tt,vt)},n[26]=Q,n[27]=K,n[28]=W,n[29]=V,n[30]=He):He=n[30];const rt=He;let Qe;n[31]===Symbol.for("react.memo_cache_sentinel")?(Qe=m.jsx(h8,{}),n[31]=Qe):Qe=n[31];let Ne;n[32]!==O||n[33]!==P?(Ne=m.jsx(VO,{onOpenAddServer:O,onServerSwitch:P}),n[32]=O,n[33]=P,n[34]=Ne):Ne=n[34];let Ge;n[35]!==p||n[36]!==rt||n[37]!==Oe||n[38]!==T||n[39]!==k||n[40]!==R||n[41]!==S||n[42]!==U||n[43]!==f?(Ge=U!=="overview"&&m.jsx($O,{workspaces:f,activeWorkspace:p,onSelectWorkspace:S,onCreateVirtualWorkspace:k,onCreatePhysicalWorkspace:T,isWorkspaceFavorited:Oe,onToggleFavorite:rt,onDeleteWorkspace:R}),n[35]=p,n[36]=rt,n[37]=Oe,n[38]=T,n[39]=k,n[40]=R,n[41]=S,n[42]=U,n[43]=f,n[44]=Ge):Ge=n[44];let ce;n[45]!==Ne||n[46]!==Ge?(ce=m.jsxs("div",{className:"p-2 space-y-2",children:[Ne,Ge]}),n[45]=Ne,n[46]=Ge,n[47]=ce):ce=n[47];let ve;n[48]!==u||n[49]!==x||n[50]!==U?(ve=U!=="overview"&&m.jsx(xa,{children:m.jsx(fo,{children:m.jsxs(ka,{onClick:x,disabled:!u,className:"w-full",children:[m.jsx(La,{className:"size-4","data-icon":"inline-start"}),m.jsx("span",{children:"New Chat"})]})})}),n[48]=u,n[49]=x,n[50]=U,n[51]=ve):ve=n[51];let Te;n[52]!==ce||n[53]!==ve?(Te=m.jsxs(o8,{children:[ce,ve]}),n[52]=ce,n[53]=ve,n[54]=Te):Te=n[54];let je;n[55]!==le||n[56]!==p||n[57]!==h||n[58]!==Ce||n[59]!==te||n[60]!==u||n[61]!==o||n[62]!==a||n[63]!==_||n[64]!==w||n[65]!==D||n[66]!==b||n[67]!==y||n[68]!==v||n[69]!==C||n[70]!==S||n[71]!==ye||n[72]!==U||n[73]!==f?(je=U==="overview"?m.jsx(v8,{allSessions:h,childrenMap:te,sessionDerivedValues:ye,currentSession:o,currentSessionId:a,favoritedWorkspaceIds:_,workspaces:f,activeWorkspace:p,onSelectWorkspace:S,onResumeSession:C,onCloseSession:w,onReopenSession:v,onDeleteSession:b,onRenameSession:y,onCreateSessionInWorkspace:D,connected:u}):m.jsxs(m.Fragment,{children:[le.length>0&&m.jsx(ki,{defaultOpen:!0,className:"group/collapsible",children:m.jsxs(zd,{children:[m.jsx(Bd,{asChild:!0,children:m.jsxs(Ei,{className:"flex items-center justify-between w-full",children:[m.jsxs("span",{className:"flex items-center gap-2",children:[m.jsx(Wr,{className:"size-3 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"}),"Active"]}),m.jsx($n,{variant:"secondary",children:le.length})]})}),m.jsx(Ai,{children:m.jsx(Fd,{children:m.jsx(xa,{children:le.map(tt=>m.jsx(ig,{session:tt,childrenMap:te,sessionDerivedValues:ye,isActive:(o==null?void 0:o.id)===tt.id,currentSessionId:a,onResumeSession:C,onCloseSession:w,onReopenSession:v,onDeleteSession:b,onRename:y},tt.id))})})})]})}),Ce.length>0&&m.jsx(ki,{defaultOpen:!0,className:"group/collapsible",children:m.jsxs(zd,{children:[m.jsx(Bd,{asChild:!0,children:m.jsxs(Ei,{className:"flex items-center justify-between w-full",children:[m.jsxs("span",{className:"flex items-center gap-2",children:[m.jsx(Wr,{className:"size-3 transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"}),"Archived"]}),m.jsx($n,{variant:"secondary",children:Ce.length})]})}),m.jsx(Ai,{children:m.jsx(Fd,{children:m.jsx(xa,{children:Ce.map(tt=>m.jsx(ig,{session:tt,childrenMap:te,sessionDerivedValues:ye,isActive:(o==null?void 0:o.id)===tt.id,currentSessionId:a,onResumeSession:C,onCloseSession:w,onReopenSession:v,onDeleteSession:b,onRename:y},tt.id))})})})]})}),le.length===0&&Ce.length===0&&m.jsxs("div",{className:"p-4 text-center text-sm text-muted-foreground",children:["No sessions yet.",m.jsx("br",{}),"Start a new chat to begin."]})]}),n[55]=le,n[56]=p,n[57]=h,n[58]=Ce,n[59]=te,n[60]=u,n[61]=o,n[62]=a,n[63]=_,n[64]=w,n[65]=D,n[66]=b,n[67]=y,n[68]=v,n[69]=C,n[70]=S,n[71]=ye,n[72]=U,n[73]=f,n[74]=je):je=n[74];let Le;n[75]!==G||n[76]!==je?(Le=m.jsx(c8,{ref:X,tabIndex:-1,onKeyDown:G,className:"outline-none",children:je}),n[75]=G,n[76]=je,n[77]=Le):Le=n[77];let Je;n[78]!==u?(Je=u?m.jsx(WA,{className:"size-3.5 text-success"}):m.jsx(dS,{className:"size-3.5 text-destructive"}),n[78]=u,n[79]=Je):Je=n[79];const Ue=u?"Connected":"Disconnected";let Pe;n[80]!==Ue?(Pe=m.jsx("span",{className:"text-xs text-muted-foreground",children:Ue}),n[80]=Ue,n[81]=Pe):Pe=n[81];let Re;n[82]!==Je||n[83]!==Pe?(Re=m.jsx(fo,{children:m.jsxs("div",{className:"flex items-center gap-2 px-2 py-1.5",children:[Je,Pe]})}),n[82]=Je,n[83]=Pe,n[84]=Re):Re=n[84];let Ke,we;n[85]===Symbol.for("react.memo_cache_sentinel")?(Ke=m.jsx(po,{className:"size-4","data-icon":"inline-start"}),we=m.jsx("span",{children:"MCP Servers"}),n[85]=Ke,n[86]=we):(Ke=n[85],we=n[86]);let De;n[87]!==j?(De=m.jsx(fo,{children:m.jsxs(ka,{onClick:j,children:[Ke,we]})}),n[87]=j,n[88]=De):De=n[88];let $e,gt;n[89]===Symbol.for("react.memo_cache_sentinel")?($e=m.jsx(aS,{className:"size-4","data-icon":"inline-start"}),gt=m.jsx("span",{children:"Settings"}),n[89]=$e,n[90]=gt):($e=n[89],gt=n[90]);let It;n[91]!==A?(It=m.jsx(fo,{children:m.jsx("div",{className:"flex items-center gap-1",children:m.jsxs(ka,{onClick:A,children:[$e,gt]})})}),n[91]=A,n[92]=It):It=n[92];let Et;n[93]!==Re||n[94]!==De||n[95]!==It?(Et=m.jsx(a8,{className:"pb-4",children:m.jsxs(xa,{children:[Re,De,It]})}),n[93]=Re,n[94]=De,n[95]=It,n[96]=Et):Et=n[96];let Zt;return n[97]!==Te||n[98]!==Le||n[99]!==Et?(Zt=m.jsxs(i8,{collapsible:"offcanvas",children:[Qe,Te,Le,Et]}),n[97]=Te,n[98]=Le,n[99]=Et,n[100]=Zt):Zt=n[100],Zt});function S8(t){return t.sidebarViewMode}function w8(t){return t.sessionId}function C8(t){return!t.parentId}function k8(t){return t.status==="active"}function E8(t){return t.status==="closed"}function A8(t){const e=he.c(10);let n,r,o;e[0]!==t?({className:n,orientation:o,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]);const a=o===void 0?"horizontal":o;let c;e[4]!==n?(c=ke("group/tabs flex gap-2 data-horizontal:flex-col",n),e[4]=n,e[5]=c):c=e[5];let l;return e[6]!==a||e[7]!==r||e[8]!==c?(l=m.jsx(VD,{"data-slot":"tabs","data-orientation":a,className:c,...r}),e[6]=a,e[7]=r,e[8]=c,e[9]=l):l=e[9],l}const R8=Pa("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function T8(t){const e=he.c(11);let n,r,o;e[0]!==t?({className:n,variant:o,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]);const a=o===void 0?"default":o;let c;e[4]!==n||e[5]!==a?(c=ke(R8({variant:a}),n),e[4]=n,e[5]=a,e[6]=c):c=e[6];let l;return e[7]!==r||e[8]!==c||e[9]!==a?(l=m.jsx(WD,{"data-slot":"tabs-list","data-variant":a,className:c,...r}),e[7]=r,e[8]=c,e[9]=a,e[10]=l):l=e[10],l}function Gl(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=ke("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==r||e[6]!==o?(a=m.jsx(GD,{"data-slot":"tabs-trigger",className:o,...r}),e[5]=r,e[6]=o,e[7]=a):a=e[7],a}function Kl(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=ke("flex-1 text-sm outline-none",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==r||e[6]!==o?(a=m.jsx(KD,{"data-slot":"tabs-content",className:o,...r}),e[5]=r,e[6]=o,e[7]=a):a=e[7],a}function Nr(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=ke("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==r||e[6]!==o?(a=m.jsx(xM,{"data-slot":"label",className:o,...r}),e[5]=r,e[6]=o,e[7]=a):a=e[7],a}function Sb(t){return new Date(t).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function wb(t){const e=he.c(29),{permission:n,onRevoke:r}=t,o=!!n.revokedAt,a=o?"outline":"secondary";let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=m.jsx(lS,{className:"size-3","data-icon":"inline-start"}),e[0]=c):c=e[0];let l;e[1]!==n.permissionType||e[2]!==a?(l=m.jsxs($n,{variant:a,children:[c,n.permissionType]}),e[1]=n.permissionType,e[2]=a,e[3]=l):l=e[3];let u;e[4]!==o?(u=o&&m.jsx($n,{variant:"outline",className:"text-muted-foreground",children:"Revoked"}),e[4]=o,e[5]=u):u=e[5];let f;e[6]!==l||e[7]!==u?(f=m.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l,u]}),e[6]=l,e[7]=u,e[8]=f):f=e[8];let p;e[9]!==n.permissionKey?(p=m.jsx("p",{className:"text-sm font-mono truncate text-muted-foreground",children:n.permissionKey}),e[9]=n.permissionKey,e[10]=p):p=e[10];let h;e[11]!==n.grantedAt?(h=Sb(n.grantedAt),e[11]=n.grantedAt,e[12]=h):h=e[12];let _;e[13]!==n.revokedAt?(_=n.revokedAt&&` • Revoked ${Sb(n.revokedAt)}`,e[13]=n.revokedAt,e[14]=_):_=e[14];let x;e[15]!==h||e[16]!==_?(x=m.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Granted ",h,_]}),e[15]=h,e[16]=_,e[17]=x):x=e[17];let C;e[18]!==f||e[19]!==p||e[20]!==x?(C=m.jsxs("div",{className:"flex-1 min-w-0",children:[f,p,x]}),e[18]=f,e[19]=p,e[20]=x,e[21]=C):C=e[21];let w;e[22]!==o||e[23]!==r||e[24]!==n.id?(w=!o&&m.jsx(Fe,{variant:"ghost",size:"icon",onClick:()=>r(n.id),className:"size-8 text-destructive hover:text-destructive",children:m.jsx(Ia,{className:"size-4"})}),e[22]=o,e[23]=r,e[24]=n.id,e[25]=w):w=e[25];let v;return e[26]!==C||e[27]!==w?(v=m.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border last:border-0",children:[C,w]}),e[26]=C,e[27]=w,e[28]=v):v=e[28],v}function N8(t){const e=he.c(30),{open:n,onOpenChange:r,title:o,description:a,confirmLabel:c,cancelLabel:l,variant:u,onConfirm:f,onCancel:p}=t,h=c===void 0?"Confirm":c,_=l===void 0?"Cancel":l,x=u===void 0?"default":u;let C;e[0]!==p||e[1]!==r?(C=()=>{p==null||p(),r(!1)},e[0]=p,e[1]=r,e[2]=C):C=e[2];const w=C;let v;e[3]!==f||e[4]!==r?(v=()=>{f(),r(!1)},e[3]=f,e[4]=r,e[5]=v):v=e[5];const b=v;let y;e[6]!==o?(y=m.jsx(Ga,{children:o}),e[6]=o,e[7]=y):y=e[7];let S;e[8]!==a?(S=m.jsx(jc,{children:a}),e[8]=a,e[9]=S):S=e[9];let k;e[10]!==y||e[11]!==S?(k=m.jsxs(Wa,{children:[y,S]}),e[10]=y,e[11]=S,e[12]=k):k=e[12];let T;e[13]!==_||e[14]!==w?(T=m.jsx(Fe,{variant:"outline",onClick:w,children:_}),e[13]=_,e[14]=w,e[15]=T):T=e[15];const R=x==="destructive"?"destructive":"default";let D;e[16]!==h||e[17]!==b||e[18]!==R?(D=m.jsx(Fe,{variant:R,onClick:b,children:h}),e[16]=h,e[17]=b,e[18]=R,e[19]=D):D=e[19];let A;e[20]!==D||e[21]!==T?(A=m.jsxs(Ef,{children:[T,D]}),e[20]=D,e[21]=T,e[22]=A):A=e[22];let j;e[23]!==A||e[24]!==k?(j=m.jsxs(Va,{className:"sm:max-w-[425px]",children:[k,A]}),e[23]=A,e[24]=k,e[25]=j):j=e[25];let O;return e[26]!==r||e[27]!==n||e[28]!==j?(O=m.jsx(qa,{open:n,onOpenChange:r,children:j}),e[26]=r,e[27]=n,e[28]=j,e[29]=O):O=e[29],O}function M8(t){const e=he.c(48),{provider:n,onConnect:r,onDisconnect:o}=t,[a,c]=N.useState(!1);let l,u;e[0]!==n.connected||e[1]!==n.error?(l=()=>{(n.error||n.connected)&&c(!1)},u=[n.error,n.connected],e[0]=n.connected,e[1]=n.error,e[2]=l,e[3]=u):(l=e[2],u=e[3]),N.useEffect(l,u);let f,p;e[4]!==n.authorizationUrl?(f=()=>{n.authorizationUrl&&c(!1)},p=[n.authorizationUrl],e[4]=n.authorizationUrl,e[5]=f,e[6]=p):(f=e[5],p=e[6]),N.useEffect(f,p);let h;e[7]!==r?(h=()=>{c(!0),r()},e[7]=r,e[8]=h):h=e[8];const _=h;let x;e[9]!==o?(x=()=>{o()},e[9]=o,e[10]=x):x=e[10];const C=x,w=`size-2 rounded-full ${n.connected?"bg-green-500":"bg-muted-foreground"}`;let v;e[11]!==w?(v=m.jsx("div",{className:w}),e[11]=w,e[12]=v):v=e[12];const b=n.displayName||n.provider;let y;e[13]!==b?(y=m.jsx("span",{className:"text-sm font-medium",children:b}),e[13]=b,e[14]=y):y=e[14];let S;e[15]!==y||e[16]!==v?(S=m.jsxs("div",{className:"flex items-center gap-2",children:[v,y]}),e[15]=y,e[16]=v,e[17]=S):S=e[17];let k;e[18]!==n.connected?(k=n.connected&&m.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected"}),e[18]=n.connected,e[19]=k):k=e[19];let T;e[20]!==S||e[21]!==k?(T=m.jsxs("div",{className:"flex items-center justify-between",children:[S,k]}),e[20]=S,e[21]=k,e[22]=T):T=e[22];let R;e[23]!==n.error?(R=n.error&&m.jsx("p",{className:"text-xs text-destructive",children:n.error}),e[23]=n.error,e[24]=R):R=e[24];let D;e[25]!==n.connected||e[26]!==n.connectedAt?(D=n.connected&&n.connectedAt&&m.jsxs("p",{className:"text-xs text-muted-foreground",children:["Connected ",new Date(n.connectedAt).toLocaleDateString()]}),e[25]=n.connected,e[26]=n.connectedAt,e[27]=D):D=e[27];let A;e[28]!==_||e[29]!==a||e[30]!==n.authorizationUrl||e[31]!==n.connected?(A=!n.connected&&!n.authorizationUrl&&m.jsxs(Fe,{size:"sm",onClick:_,disabled:a,children:[a?m.jsx(pr,{className:"size-3 animate-spin","data-icon":"inline-start"}):null,"Connect"]}),e[28]=_,e[29]=a,e[30]=n.authorizationUrl,e[31]=n.connected,e[32]=A):A=e[32];let j;e[33]!==n.authorizationUrl||e[34]!==n.connected?(j=!n.connected&&n.authorizationUrl&&m.jsxs("div",{className:"flex flex-col gap-2",children:[m.jsx("a",{href:n.authorizationUrl,target:"_blank",rel:"noopener noreferrer",className:"font-mono text-xs text-blue-500 underline break-all",children:n.authorizationUrl}),m.jsxs(Fe,{variant:"outline",size:"sm",onClick:async()=>{try{await navigator.clipboard.writeText(n.authorizationUrl)}catch{}},children:[m.jsx(ac,{className:"size-3","data-icon":"inline-start"}),"Copy URL"]})]}),e[33]=n.authorizationUrl,e[34]=n.connected,e[35]=j):j=e[35];let O;e[36]!==C||e[37]!==n.connected?(O=n.connected&&m.jsxs(Fe,{variant:"destructive",size:"sm",onClick:C,children:[m.jsx(zA,{className:"size-3","data-icon":"inline-start"}),"Disconnect"]}),e[36]=C,e[37]=n.connected,e[38]=O):O=e[38];let P;e[39]!==A||e[40]!==j||e[41]!==O?(P=m.jsxs("div",{className:"flex gap-2",children:[A,j,O]}),e[39]=A,e[40]=j,e[41]=O,e[42]=P):P=e[42];let $;return e[43]!==T||e[44]!==R||e[45]!==D||e[46]!==P?($=m.jsxs("div",{className:"flex flex-col gap-3 rounded-lg border border-border p-4",children:[T,R,D,P]}),e[43]=T,e[44]=R,e[45]=D,e[46]=P,e[47]=$):$=e[47],$}function D8(t){const e=he.c(10),{token:n,onLogout:r}=t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx("span",{className:"text-muted-foreground",children:"Token:"}),e[0]=o):o=e[0];let a;e[1]!==n?(a=$4(n),e[1]=n,e[2]=a):a=e[2];let c;e[3]!==a?(c=m.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[o,m.jsx("code",{className:"font-mono text-foreground bg-background px-1.5 py-0.5 rounded text-[10px]",children:a})]}),e[3]=a,e[4]=c):c=e[4];let l;e[5]!==r?(l=m.jsx(Fe,{variant:"destructive",size:"sm",onClick:r,title:"Disconnect and clear token",children:"Logout"}),e[5]=r,e[6]=l):l=e[6];let u;return e[7]!==c||e[8]!==l?(u=m.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-md bg-muted",children:[c,l]}),e[7]=c,e[8]=l,e[9]=u):u=e[9],u}const Cb="0.6.8";function kb(t){const e=t.trim().match(/^v?(\d+)\.(\d+)\.(\d+)$/);return e?[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3],10)]:null}function j8(t,e){const n=kb(t),r=kb(e);if(!n&&!r)return 0;if(!n)return-1;if(!r)return 1;for(let o=0;o<3;o++)if(n[o]!==r[o])return n[o]-r[o];return 0}function Eb(t,e){return e?j8(t,e)>=0?"up-to-date":"update-available":"unknown"}const ZC="rabbyte-tech/jean2",O8=300*1e3,JC=1e4,Hd=new Map;function ek(t){const e=Hd.get(t);return e?Date.now()-e.timestamp>O8?(Hd.delete(t),null):e.value:null}function tk(t,e){Hd.set(t,{value:e,timestamp:Date.now()})}function L8(){Hd.clear()}async function nk(t,e){const n=new AbortController,r=setTimeout(()=>n.abort(),e);try{return await fetch(t,{signal:n.signal})}finally{clearTimeout(r)}}async function I8(){const t=ek("latest-server");if(t)return t;try{const e=`https://raw.githubusercontent.com/${ZC}/refs/heads/main/packages/server/VERSION`,n=await nk(e,JC);if(!n.ok)return null;const r=(await n.text()).trim();return/^\d+\.\d+\.\d+$/.test(r)?(tk("latest-server",r),r):null}catch{return null}}async function P8(){const t=ek("latest-client");if(t)return t;try{const e=`https://api.github.com/repos/${ZC}/releases?per_page=20`,n=await nk(e,JC);if(!n.ok)return null;const o=(await n.json()).find(c=>c.tag_name.startsWith("client/")&&!c.prerelease);if(!o)return null;const a=o.tag_name.replace(/^client\/v?/,"");return/^\d+\.\d+\.\d+$/.test(a)?(tk("latest-client",a),a):null}catch{return null}}function z8(t){if(!t)return"";const e=Math.floor((Date.now()-t)/1e3);if(e<10)return"just now";if(e<60)return`${e}s ago`;const n=Math.floor(e/60);return n<60?`${n}m ago`:`${Math.floor(n/60)}h ago`}function Ab(t){const e=he.c(3),{status:n}=t;if(n==="up-to-date"){let o;return e[0]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsxs("span",{className:"text-xs text-green-500 flex items-center gap-1",children:[m.jsx("span",{className:"inline-block size-1.5 rounded-full bg-green-500"}),"Up to date"]}),e[0]=o):o=e[0],o}if(n==="update-available"){let o;return e[1]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded-full bg-amber-500/10 text-amber-600 dark:text-amber-400",children:"Update available"}),e[1]=o):o=e[1],o}let r;return e[2]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsx("span",{className:"text-xs text-muted-foreground",children:"Unknown"}),e[2]=r):r=e[2],r}function B8({serverUrl:t,enabled:e}){const n=N.useRef(0),[r,o]=N.useState({serverVersion:null,latestServer:null,latestClient:null,loading:!0,lastChecked:null,fetchError:null}),a=N.useCallback(async(u=!1)=>{u&&L8();const f=++n.current;o(p=>({...p,loading:!0,fetchError:null}));try{const p=await Promise.allSettled([t?fetch(`${t.startsWith("http")?t:`http://${t}`}/api/info`).then(C=>C.ok?C.json():null).then(C=>{var w;return(w=C==null?void 0:C.version)!=null?w:null}):Promise.resolve(null),I8(),P8()]);if(n.current!==f)return;const h=p[0].status==="fulfilled"?p[0].value:null,_=p[1].status==="fulfilled"?p[1].value:null,x=p[2].status==="fulfilled"?p[2].value:null;o({serverVersion:h,latestServer:_,latestClient:x,loading:!1,lastChecked:Date.now(),fetchError:null})}catch{if(n.current!==f)return;o(p=>({...p,loading:!1,fetchError:"Unable to check for updates"}))}},[t]);N.useEffect(()=>{e&&a()},[a,e]);const c=Eb(Cb,r.latestClient),l=t&&r.serverVersion?Eb(r.serverVersion,r.latestServer):"unknown";return m.jsxs("div",{className:"flex flex-col gap-3",children:[m.jsxs("div",{children:[m.jsx(Nr,{className:"text-sm font-medium",children:"Versions"}),m.jsx("p",{className:"text-sm text-muted-foreground",children:"Check for updates to client and server"})]}),m.jsx(ls,{}),m.jsxs("div",{className:"flex flex-col gap-2",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-sm font-medium",children:"Client"}),r.loading?m.jsx(hm,{className:"h-5 w-32"}):m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsxs("span",{className:"text-sm text-muted-foreground",children:["v",Cb]}),m.jsx(Ab,{status:c})]})]}),m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-sm font-medium",children:"Server"}),r.loading?m.jsx(hm,{className:"h-5 w-32"}):r.serverVersion?m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsxs("span",{className:"text-sm text-muted-foreground",children:["v",r.serverVersion]}),m.jsx(Ab,{status:l})]}):m.jsx("span",{className:"text-sm text-muted-foreground",children:"Not connected"})]}),m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("span",{className:"text-sm font-medium",children:"Latest"}),r.loading?m.jsx(hm,{className:"h-5 w-48"}):m.jsxs("span",{className:"text-sm text-muted-foreground",children:[r.latestServer?`v${r.latestServer} (server)`:"",r.latestServer&&r.latestClient&&" · ",r.latestClient?`v${r.latestClient} (client)`:"",!r.latestServer&&!r.latestClient&&"Unknown"]})]})]}),m.jsxs("div",{className:"flex items-center justify-between",children:[r.lastChecked&&!r.loading&&m.jsxs("span",{className:"text-xs text-muted-foreground",children:["Last checked: ",z8(r.lastChecked)]}),m.jsxs(Fe,{variant:"outline",size:"sm",onClick:()=>a(!0),disabled:r.loading,className:"ml-auto",children:[m.jsx(ho,{className:`size-3.5 ${r.loading?"animate-spin":""}`}),"Check for Updates"]})]})]})}const F8={neutral:{label:"Neutral",colors:["bg-zinc-400","bg-zinc-600","bg-zinc-800"]},ocean:{label:"Ocean",colors:["bg-sky-300","bg-sky-500","bg-slate-700"]},forest:{label:"Forest",colors:["bg-emerald-300","bg-emerald-500","bg-green-800"]},sunset:{label:"Sunset",colors:["bg-orange-300","bg-amber-500","bg-orange-800"]},amethyst:{label:"Amethyst",colors:["bg-violet-300","bg-violet-500","bg-purple-800"]}};function Yl(t){const e=he.c(15),{scheme:n,currentScheme:r,onClick:o}=t,a=n===r,c=F8[n];let l;e[0]!==o||e[1]!==n?(l=()=>o(n),e[0]=o,e[1]=n,e[2]=l):l=e[2];const u=`
517
+ flex flex-col items-center gap-1.5 p-2 rounded-lg border transition-all
518
+ ${a?"border-primary bg-primary/5":"border-border bg-transparent hover:bg-muted/50"}
519
+ `,f=c.label;let p;e[3]!==c.colors?(p=c.colors.map(H8),e[3]=c.colors,e[4]=p):p=e[4];let h;e[5]!==p?(h=m.jsx("div",{className:"flex gap-0.5",children:p}),e[5]=p,e[6]=h):h=e[6];let _;e[7]!==n?(_=m.jsx("span",{className:"text-[10px] text-muted-foreground capitalize",children:n}),e[7]=n,e[8]=_):_=e[8];let x;return e[9]!==c.label||e[10]!==l||e[11]!==u||e[12]!==h||e[13]!==_?(x=m.jsxs("button",{type:"button",onClick:l,className:u,title:f,children:[h,_]}),e[9]=c.label,e[10]=l,e[11]=u,e[12]=h,e[13]=_,e[14]=x):x=e[14],x}function H8(t,e){return m.jsx("div",{className:`w-4 h-4 rounded-full ${t}`},e)}function U8(t){var Be;const e=he.c(227),{open:n,onOpenChange:r,permissions:o,onRefreshPermissions:a,onRevokePermission:c,onRevokeAllPermissions:l,apiToken:u,onLogout:f,providerStatuses:p,onConnectProvider:h,onDisconnectProvider:_,chatFinishSoundEnabled:x,onChatFinishSoundEnabledChange:C,permissionSoundEnabled:w,onPermissionSoundEnabledChange:v,serverUrl:b}=t,{mode:y,scheme:S,setMode:k,setScheme:T}=g4(),[R,D]=N.useState(!1),j=((Be=navigator.userAgentData)==null?void 0:Be.platform)==="macOS"||/mac|iphone|ipad|ipod/i.test(navigator.userAgent)?"⌘":"Ctrl";let O,P,$,U,W,K,V,Q,X,I,L,z,F,B,Y,ee,J,G,q;if(e[0]!==u||e[1]!==x||e[2]!==y||e[3]!==C||e[4]!==h||e[5]!==_||e[6]!==f||e[7]!==r||e[8]!==v||e[9]!==a||e[10]!==c||e[11]!==n||e[12]!==w||e[13]!==o||e[14]!==p||e[15]!==S||e[16]!==b||e[17]!==k||e[18]!==T){const le=[{keys:[j,"1"],description:"Open session list"},{keys:[j,"T"],description:"Open terminal"},{keys:[j,"O"],description:"Toggle overview mode"},{keys:[j,"N"],description:"New session"},{keys:[j,"Shift","N"],description:"New window"},{keys:[j,"Shift","F"],description:"Toggle follow/free mode"},{keys:["Shift","Esc"],description:"Close focused panel"},{keys:["Shift","Enter"],description:"New line in input"},{keys:["Enter"],description:"Send message"},{keys:["↑","↓","←","→"],description:"Navigate sessions"},{keys:["Esc"],description:"Focus chat input"},{keys:["Esc","Esc"],description:"Stop streaming (chat input focused)"}];let Ce,ge,Oe,He,rt,Qe,Ne,Ge,ce,ve,Te;if(e[38]!==u||e[39]!==x||e[40]!==y||e[41]!==C||e[42]!==f||e[43]!==r||e[44]!==v||e[45]!==a||e[46]!==c||e[47]!==n||e[48]!==w||e[49]!==o||e[50]!==S||e[51]!==b||e[52]!==k||e[53]!==T){const Pe=o.filter(V8),Re=o.filter(q8);U=qa,I=n,L=r,$=Va,Q="sm:max-w-[700px] max-h-[80vh]",e[77]===Symbol.for("react.memo_cache_sentinel")?(X=m.jsxs(Wa,{children:[m.jsx(Ga,{children:"Settings"}),m.jsx(jc,{children:"Manage your preferences and permissions"})]}),e[77]=X):X=e[77],P=A8,Y="account",ee="mt-4";let Ke;e[78]===Symbol.for("react.memo_cache_sentinel")?(Ke=m.jsxs(Gl,{value:"account",children:[m.jsx(uS,{className:"size-4 sm:size-3","data-icon":"inline-start"}),m.jsx("span",{className:"hidden sm:inline",children:"Account"})]}),e[78]=Ke):Ke=e[78];let we;e[79]===Symbol.for("react.memo_cache_sentinel")?(we=m.jsxs(Gl,{value:"appearance",children:[m.jsx(lA,{className:"size-4 sm:size-3","data-icon":"inline-start"}),m.jsx("span",{className:"hidden sm:inline",children:"Appearance"})]}),e[79]=we):we=e[79];let De,$e;e[80]===Symbol.for("react.memo_cache_sentinel")?(De=m.jsx(lS,{className:"size-4 sm:size-3","data-icon":"inline-start"}),$e=m.jsx("span",{className:"hidden sm:inline",children:"Permissions"}),e[80]=De,e[81]=$e):(De=e[80],$e=e[81]);const gt=Pe.length>0&&m.jsx("span",{className:"absolute -top-0.5 -right-0.5 flex size-3.5 items-center justify-center rounded-full bg-primary text-[8px] font-bold leading-none text-primary-foreground sm:static sm:flex sm:size-auto sm:ml-1.5 sm:px-1.5 sm:py-0.5 sm:text-xs sm:font-medium sm:leading-normal",children:Pe.length});let It;e[82]!==gt?(It=m.jsxs(Gl,{value:"permissions",children:[De,$e,gt]}),e[82]=gt,e[83]=It):It=e[83];let Et;e[84]===Symbol.for("react.memo_cache_sentinel")?(Et=m.jsxs(Gl,{value:"providers",children:[m.jsx(X5,{className:"size-4 sm:size-3","data-icon":"inline-start"}),m.jsx("span",{className:"hidden sm:inline",children:"Providers"})]}),e[84]=Et):Et=e[84];let Zt;e[85]===Symbol.for("react.memo_cache_sentinel")?(Zt=m.jsxs(Gl,{value:"keybinds",children:[m.jsx(q5,{className:"size-4 sm:size-3","data-icon":"inline-start"}),m.jsx("span",{className:"hidden sm:inline",children:"Keybinds"})]}),e[85]=Zt):Zt=e[85],e[86]!==It?(J=m.jsxs(T8,{className:"grid w-full grid-cols-5",children:[Ke,we,It,Et,Zt]}),e[86]=It,e[87]=J):J=e[87];let qt,tt;e[88]===Symbol.for("react.memo_cache_sentinel")?(qt=m.jsx(Nr,{className:"text-sm font-medium",children:"Session"}),tt=m.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Manage your current session"}),e[88]=qt,e[89]=tt):(qt=e[88],tt=e[89]);let vt;e[90]!==u||e[91]!==f?(vt=m.jsxs("div",{children:[qt,tt,u?m.jsx(D8,{token:u,onLogout:f}):m.jsx("p",{className:"text-sm text-muted-foreground",children:"No active session"})]}),e[90]=u,e[91]=f,e[92]=vt):vt=e[92];let Vt;e[93]===Symbol.for("react.memo_cache_sentinel")?(Vt=m.jsx(ls,{}),e[93]=Vt):Vt=e[93];let Ht;e[94]!==n||e[95]!==b?(Ht=m.jsx(B8,{serverUrl:b,enabled:n}),e[94]=n,e[95]=b,e[96]=Ht):Ht=e[96],e[97]!==vt||e[98]!==Ht?(G=m.jsx(Kl,{value:"account",className:"mt-4",children:m.jsxs("div",{className:"flex flex-col gap-4",children:[vt,Vt,Ht]})}),e[97]=vt,e[98]=Ht,e[99]=G):G=e[99];let Wt,Sn;e[100]===Symbol.for("react.memo_cache_sentinel")?(Wt=m.jsx(Nr,{className:"text-sm font-medium",children:"Mode"}),Sn=m.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Choose light, dark, or system theme"}),e[100]=Wt,e[101]=Sn):(Wt=e[100],Sn=e[101]);const jr=y==="light"?"default":"outline";let zn;e[102]!==k?(zn=()=>k("light"),e[102]=k,e[103]=zn):zn=e[103];let Wn;e[104]===Symbol.for("react.memo_cache_sentinel")?(Wn=m.jsx(MA,{className:"size-4","data-icon":"inline-start"}),e[104]=Wn):Wn=e[104];let Gn;e[105]!==jr||e[106]!==zn?(Gn=m.jsxs(Fe,{variant:jr,className:"justify-start",onClick:zn,children:[Wn,"Light"]}),e[105]=jr,e[106]=zn,e[107]=Gn):Gn=e[107];const Gt=y==="dark"?"default":"outline";let dn;e[108]!==k?(dn=()=>k("dark"),e[108]=k,e[109]=dn):dn=e[109];let gn;e[110]===Symbol.for("react.memo_cache_sentinel")?(gn=m.jsx(oA,{className:"size-4","data-icon":"inline-start"}),e[110]=gn):gn=e[110];let Or;e[111]!==Gt||e[112]!==dn?(Or=m.jsxs(Fe,{variant:Gt,className:"justify-start",onClick:dn,children:[gn,"Dark"]}),e[111]=Gt,e[112]=dn,e[113]=Or):Or=e[113];const Mn=y==="system"?"default":"outline";let jt;e[114]!==k?(jt=()=>k("system"),e[114]=k,e[115]=jt):jt=e[115];let Ut;e[116]===Symbol.for("react.memo_cache_sentinel")?(Ut=m.jsx(sA,{className:"size-4","data-icon":"inline-start"}),e[116]=Ut):Ut=e[116];let Dn;e[117]!==Mn||e[118]!==jt?(Dn=m.jsxs(Fe,{variant:Mn,className:"justify-start",onClick:jt,children:[Ut,"System"]}),e[117]=Mn,e[118]=jt,e[119]=Dn):Dn=e[119];let Bn;e[120]!==Gn||e[121]!==Or||e[122]!==Dn?(Bn=m.jsxs("div",{children:[Wt,Sn,m.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[Gn,Or,Dn]})]}),e[120]=Gn,e[121]=Or,e[122]=Dn,e[123]=Bn):Bn=e[123];let Us,Lr;e[124]===Symbol.for("react.memo_cache_sentinel")?(Us=m.jsx(ls,{}),Lr=m.jsx(Nr,{className:"text-sm font-medium mb-3 block",children:"Notification Sounds"}),e[124]=Us,e[125]=Lr):(Us=e[124],Lr=e[125]);let Xr;e[126]===Symbol.for("react.memo_cache_sentinel")?(Xr=m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(HA,{className:"size-4 text-muted-foreground"}),m.jsx("span",{className:"text-sm",children:"Chat completion"})]}),e[126]=Xr):Xr=e[126];let Fn;e[127]!==x||e[128]!==C?(Fn=()=>C(!x),e[127]=x,e[128]=C,e[129]=Fn):Fn=e[129];const Qr=`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${x?"bg-primary":"bg-muted"}`,yr=`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${x?"translate-x-6":"translate-x-1"}`;let vn;e[130]!==yr?(vn=m.jsx("span",{className:yr}),e[130]=yr,e[131]=vn):vn=e[131];let wn;e[132]!==Fn||e[133]!==Qr||e[134]!==vn?(wn=m.jsxs("div",{className:"flex items-center justify-between",children:[Xr,m.jsx("button",{type:"button",onClick:Fn,className:Qr,children:vn})]}),e[132]=Fn,e[133]=Qr,e[134]=vn,e[135]=wn):wn=e[135];let Hn;e[136]===Symbol.for("react.memo_cache_sentinel")?(Hn=m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx($A,{className:"size-4 text-muted-foreground"}),m.jsx("span",{className:"text-sm",children:"Permission requests"})]}),e[136]=Hn):Hn=e[136];let _t;e[137]!==v||e[138]!==w?(_t=()=>v(!w),e[137]=v,e[138]=w,e[139]=_t):_t=e[139];const Kn=`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${w?"bg-primary":"bg-muted"}`,jn=`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${w?"translate-x-6":"translate-x-1"}`;let fn;e[140]!==jn?(fn=m.jsx("span",{className:jn}),e[140]=jn,e[141]=fn):fn=e[141];let Kt;e[142]!==_t||e[143]!==Kn||e[144]!==fn?(Kt=m.jsxs("div",{className:"flex items-center justify-between",children:[Hn,m.jsx("button",{type:"button",onClick:_t,className:Kn,children:fn})]}),e[142]=_t,e[143]=Kn,e[144]=fn,e[145]=Kt):Kt=e[145];let Ir;e[146]!==wn||e[147]!==Kt?(Ir=m.jsxs("div",{children:[Lr,m.jsxs("div",{className:"flex flex-col gap-3",children:[wn,Kt]})]}),e[146]=wn,e[147]=Kt,e[148]=Ir):Ir=e[148];let Zr,Jr,Pr;e[149]===Symbol.for("react.memo_cache_sentinel")?(Zr=m.jsx(ls,{}),Jr=m.jsx(Nr,{className:"text-sm font-medium",children:"Color Scheme"}),Pr=m.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Choose your preferred color palette"}),e[149]=Zr,e[150]=Jr,e[151]=Pr):(Zr=e[149],Jr=e[150],Pr=e[151]);let Yn;e[152]!==S||e[153]!==T?(Yn=m.jsxs("div",{children:[Jr,Pr,m.jsxs("div",{className:"grid grid-cols-5 gap-2",children:[m.jsx(Yl,{scheme:"neutral",currentScheme:S,onClick:T}),m.jsx(Yl,{scheme:"ocean",currentScheme:S,onClick:T}),m.jsx(Yl,{scheme:"forest",currentScheme:S,onClick:T}),m.jsx(Yl,{scheme:"sunset",currentScheme:S,onClick:T}),m.jsx(Yl,{scheme:"amethyst",currentScheme:S,onClick:T})]})]}),e[152]=S,e[153]=T,e[154]=Yn):Yn=e[154],e[155]!==Bn||e[156]!==Ir||e[157]!==Yn?(q=m.jsx(Kl,{value:"appearance",className:"mt-4",children:m.jsxs("div",{className:"flex flex-col gap-4",children:[Bn,Us,Ir,Zr,Yn]})}),e[155]=Bn,e[156]=Ir,e[157]=Yn,e[158]=q):q=e[158],ge=Kl,ve="permissions",Te="mt-4",Ne="flex flex-col gap-4";let rr;e[159]===Symbol.for("react.memo_cache_sentinel")?(rr=m.jsxs("div",{children:[m.jsx(Nr,{className:"text-sm font-medium",children:"Always-allowed Operations"}),m.jsx("p",{className:"text-sm text-muted-foreground",children:"Tools you've approved to run without asking"})]}),e[159]=rr):rr=e[159];let Cn;e[160]===Symbol.for("react.memo_cache_sentinel")?(Cn=m.jsx(ho,{className:"size-4"}),e[160]=Cn):Cn=e[160];let Jt;e[161]!==a?(Jt=m.jsx(Fe,{variant:"outline",size:"icon",onClick:a,className:"size-8",children:Cn}),e[161]=a,e[162]=Jt):Jt=e[162];const rn=Pe.length>0&&m.jsxs(Fe,{variant:"destructive",size:"sm",onClick:()=>D(!0),children:[m.jsx(Ia,{className:"size-4","data-icon":"inline-start"}),"Revoke All"]});e[163]!==Jt||e[164]!==rn?(Ge=m.jsxs("div",{className:"flex items-center justify-between",children:[rr,m.jsxs("div",{className:"flex gap-2",children:[Jt,rn]})]}),e[163]=Jt,e[164]=rn,e[165]=Ge):Ge=e[165],e[166]===Symbol.for("react.memo_cache_sentinel")?(ce=m.jsx(ls,{}),e[166]=ce):ce=e[166],Ce=Oc,Oe="h-[300px]",He=Pe.length===0&&Re.length===0&&m.jsxs("div",{className:"text-center py-8 text-muted-foreground text-sm",children:["No permissions granted yet.",m.jsx("br",{}),'Approve tool requests with "Always allow" to add them here.']}),rt=Pe.length>0&&m.jsxs("div",{className:"mb-4",children:[m.jsxs("h4",{className:"text-xs uppercase text-muted-foreground mb-2 font-medium",children:["Active (",Pe.length,")"]}),Pe.map(sn=>m.jsx(wb,{permission:sn,onRevoke:c},sn.id))]}),Qe=Re.length>0&&m.jsxs("div",{children:[m.jsxs("h4",{className:"text-xs uppercase text-muted-foreground mb-2 font-medium",children:["Revoked (",Re.length,")"]}),Re.map(sn=>m.jsx(wb,{permission:sn,onRevoke:c},sn.id))]}),e[38]=u,e[39]=x,e[40]=y,e[41]=C,e[42]=f,e[43]=r,e[44]=v,e[45]=a,e[46]=c,e[47]=n,e[48]=w,e[49]=o,e[50]=S,e[51]=b,e[52]=k,e[53]=T,e[54]=P,e[55]=$,e[56]=U,e[57]=Ce,e[58]=ge,e[59]=Q,e[60]=X,e[61]=I,e[62]=L,e[63]=Oe,e[64]=He,e[65]=rt,e[66]=Qe,e[67]=Ne,e[68]=Ge,e[69]=ce,e[70]=ve,e[71]=Te,e[72]=Y,e[73]=ee,e[74]=J,e[75]=G,e[76]=q}else P=e[54],$=e[55],U=e[56],Ce=e[57],ge=e[58],Q=e[59],X=e[60],I=e[61],L=e[62],Oe=e[63],He=e[64],rt=e[65],Qe=e[66],Ne=e[67],Ge=e[68],ce=e[69],ve=e[70],Te=e[71],Y=e[72],ee=e[73],J=e[74],G=e[75],q=e[76];let je;e[167]!==Ce||e[168]!==Oe||e[169]!==He||e[170]!==rt||e[171]!==Qe?(je=m.jsxs(Ce,{className:Oe,children:[He,rt,Qe]}),e[167]=Ce,e[168]=Oe,e[169]=He,e[170]=rt,e[171]=Qe,e[172]=je):je=e[172];let Le;e[173]!==Ne||e[174]!==Ge||e[175]!==ce||e[176]!==je?(Le=m.jsxs("div",{className:Ne,children:[Ge,ce,je]}),e[173]=Ne,e[174]=Ge,e[175]=ce,e[176]=je,e[177]=Le):Le=e[177],e[178]!==ge||e[179]!==ve||e[180]!==Te||e[181]!==Le?(K=m.jsx(ge,{value:ve,className:Te,children:Le}),e[178]=ge,e[179]=ve,e[180]=Te,e[181]=Le,e[182]=K):K=e[182];let Je;e[183]===Symbol.for("react.memo_cache_sentinel")?(Je=m.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Connect subscription-based providers to use models without API keys."}),e[183]=Je):Je=e[183];let Ue;if(e[184]!==h||e[185]!==_||e[186]!==p){let Pe;e[188]!==h||e[189]!==_?(Pe=Re=>m.jsx(M8,{provider:Re,onConnect:()=>h(Re.provider),onDisconnect:()=>_(Re.provider)},Re.provider),e[188]=h,e[189]=_,e[190]=Pe):Pe=e[190],Ue=p.map(Pe),e[184]=h,e[185]=_,e[186]=p,e[187]=Ue}else Ue=e[187];e[191]!==Ue?(V=m.jsx(Kl,{value:"providers",className:"mt-4",children:m.jsx("div",{className:"flex flex-col gap-4",children:m.jsxs("div",{children:[Je,m.jsx("div",{className:"flex flex-col gap-3",children:Ue})]})})}),e[191]=Ue,e[192]=V):V=e[192],O=Kl,F="keybinds",B="mt-4",W="flex flex-col gap-2",z=le.map($8),e[0]=u,e[1]=x,e[2]=y,e[3]=C,e[4]=h,e[5]=_,e[6]=f,e[7]=r,e[8]=v,e[9]=a,e[10]=c,e[11]=n,e[12]=w,e[13]=o,e[14]=p,e[15]=S,e[16]=b,e[17]=k,e[18]=T,e[19]=O,e[20]=P,e[21]=$,e[22]=U,e[23]=W,e[24]=K,e[25]=V,e[26]=Q,e[27]=X,e[28]=I,e[29]=L,e[30]=z,e[31]=F,e[32]=B,e[33]=Y,e[34]=ee,e[35]=J,e[36]=G,e[37]=q}else O=e[19],P=e[20],$=e[21],U=e[22],W=e[23],K=e[24],V=e[25],Q=e[26],X=e[27],I=e[28],L=e[29],z=e[30],F=e[31],B=e[32],Y=e[33],ee=e[34],J=e[35],G=e[36],q=e[37];let te;e[193]!==W||e[194]!==z?(te=m.jsx("div",{className:W,children:z}),e[193]=W,e[194]=z,e[195]=te):te=e[195];let re;e[196]!==O||e[197]!==te||e[198]!==F||e[199]!==B?(re=m.jsx(O,{value:F,className:B,children:te}),e[196]=O,e[197]=te,e[198]=F,e[199]=B,e[200]=re):re=e[200];let oe;e[201]!==P||e[202]!==K||e[203]!==V||e[204]!==re||e[205]!==Y||e[206]!==ee||e[207]!==J||e[208]!==G||e[209]!==q?(oe=m.jsxs(P,{defaultValue:Y,className:ee,children:[J,G,q,K,V,re]}),e[201]=P,e[202]=K,e[203]=V,e[204]=re,e[205]=Y,e[206]=ee,e[207]=J,e[208]=G,e[209]=q,e[210]=oe):oe=e[210];let se;e[211]!==$||e[212]!==Q||e[213]!==X||e[214]!==oe?(se=m.jsxs($,{className:Q,children:[X,oe]}),e[211]=$,e[212]=Q,e[213]=X,e[214]=oe,e[215]=se):se=e[215];let ye;e[216]!==l?(ye=()=>{l(),D(!1)},e[216]=l,e[217]=ye):ye=e[217];let Ee;e[218]!==R||e[219]!==ye?(Ee=m.jsx(N8,{open:R,onOpenChange:D,title:"Revoke All Permissions",description:"This will revoke all always-allowed permissions for this workspace. You'll need to approve these tools again when they're used.",confirmLabel:"Revoke All",variant:"destructive",onConfirm:ye}),e[218]=R,e[219]=ye,e[220]=Ee):Ee=e[220];let Ae;return e[221]!==U||e[222]!==I||e[223]!==L||e[224]!==se||e[225]!==Ee?(Ae=m.jsxs(U,{open:I,onOpenChange:L,children:[se,Ee]}),e[221]=U,e[222]=I,e[223]=L,e[224]=se,e[225]=Ee,e[226]=Ae):Ae=e[226],Ae}function $8(t,e){return m.jsxs("div",{className:"flex items-center justify-between py-1",children:[m.jsx("div",{className:"flex items-center gap-1",children:t.keys.map((n,r)=>m.jsxs("span",{children:[m.jsx("kbd",{className:"font-mono bg-muted rounded px-2 py-1 text-xs",children:n}),r<t.keys.length-1&&m.jsx("span",{className:"mx-1 text-muted-foreground",children:"+"})]},r))}),m.jsx("span",{className:"text-sm text-muted-foreground",children:t.description})]},e)}function q8(t){return t.revokedAt}function V8(t){return!t.revokedAt}const W8=Pa("group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current"}},defaultVariants:{variant:"default"}});function bd(t){const e=he.c(10);let n,r,o;e[0]!==t?({className:n,variant:o,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]);let a;e[4]!==n||e[5]!==o?(a=ke(W8({variant:o}),n),e[4]=n,e[5]=o,e[6]=a):a=e[6];let c;return e[7]!==r||e[8]!==a?(c=m.jsx("div",{"data-slot":"alert",role:"alert",className:a,...r}),e[7]=r,e[8]=a,e[9]=c):c=e[9],c}function xd(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=ke("text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==r||e[6]!==o?(a=m.jsx("div",{"data-slot":"alert-description",className:o,...r}),e[5]=r,e[6]=o,e[7]=a):a=e[7],a}function G8(t){const e=he.c(6),{status:n}=t;switch(n.status){case"connected":{let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsxs($n,{variant:"default",className:"bg-green-600",children:[m.jsx(bc,{className:"size-3 mr-1"}),"Connected"]}),e[0]=r):r=e[0],r}case"disabled":{let r;return e[1]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsxs($n,{variant:"secondary",children:[m.jsx(Qd,{className:"size-3 mr-1"}),"Disabled"]}),e[1]=r):r=e[1],r}case"failed":{let r;return e[2]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsxs($n,{variant:"destructive",children:[m.jsx(rc,{className:"size-3 mr-1"}),"Failed"]}),e[2]=r):r=e[2],r}case"needs_auth":{let r;return e[3]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsxs($n,{variant:"outline",className:"border-yellow-500 text-yellow-600",children:[m.jsx(rc,{className:"size-3 mr-1"}),"Needs Auth"]}),e[3]=r):r=e[3],r}case"needs_client_registration":{let r;return e[4]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsxs($n,{variant:"outline",className:"border-orange-500 text-orange-600",children:[m.jsx(rc,{className:"size-3 mr-1"}),"Needs Registration"]}),e[4]=r):r=e[4],r}default:{let r;return e[5]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsx($n,{variant:"secondary",children:"Unknown"}),e[5]=r):r=e[5],r}}}function K8({open:t,onOpenChange:e,workspaceId:n,workspacePath:r,serverUrl:o,apiToken:a}){const{fetchWithAuth:c}=Dc(),[l,u]=N.useState({}),[f,p]=N.useState(!1),[h,_]=N.useState(null),[x,C]=N.useState(null),w=N.useCallback(async()=>{if(n){p(!0),C(null);try{const k=await c(`/api/workspaces/${n}/mcp/status`,{},{serverUrl:o,token:a});if(!k.ok)throw new Error("Failed to load MCP status");const T=await k.json();u(T.status||{})}catch(k){const T=k instanceof Error?k.message:"Unknown error";C(T)}finally{p(!1)}}},[n,c,o,a]);N.useEffect(()=>{t&&n&&w()},[t,n,w]);const v=async k=>{if(n){_(k);try{if(!(await c(`/api/workspaces/${n}/mcp/connect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:k})},{serverUrl:o,token:a})).ok)throw new Error("Failed to connect");await w()}catch(T){const R=T instanceof Error?T.message:"Unknown error";C(R)}finally{_(null)}}},b=async k=>{if(n){_(k);try{if(!(await c(`/api/workspaces/${n}/mcp/disconnect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:k})},{serverUrl:o,token:a})).ok)throw new Error("Failed to disconnect");await w()}catch(T){const R=T instanceof Error?T.message:"Unknown error";C(R)}finally{_(null)}}},y=async k=>{if(n){_(k);try{const T=await c(`/api/workspaces/${n}/mcp/auth`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:k})},{serverUrl:o,token:a});if(!T.ok)throw new Error("Failed to start auth");const R=await T.json();R.authorizationUrl&&window.open(R.authorizationUrl,"_blank"),await w()}catch(T){const R=T instanceof Error?T.message:"Unknown error";C(R)}finally{_(null)}}},S=Object.entries(l);return m.jsx(qa,{open:t,onOpenChange:e,children:m.jsxs(Va,{className:"sm:max-w-[600px] max-h-[80vh]",children:[m.jsxs(Wa,{children:[m.jsxs(Ga,{className:"flex items-center gap-2",children:[m.jsx(po,{className:"size-5"}),"MCP Servers"]}),m.jsx(jc,{children:"Manage Model Context Protocol servers for this workspace"})]}),m.jsxs("div",{className:"mt-4 space-y-4",children:[x&&m.jsxs(bd,{variant:"destructive",children:[m.jsx(rc,{className:"size-4"}),m.jsx(xd,{children:x})]}),m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsxs("p",{className:"text-sm text-muted-foreground",children:["Configure servers in ",m.jsx("code",{className:"text-xs bg-muted px-1 rounded",children:".jean2/mcp.json"})]}),m.jsx(Fe,{variant:"outline",size:"sm",onClick:w,disabled:f,children:m.jsx(ho,{className:`size-4 ${f?"animate-spin":""}`})})]}),m.jsx(Oc,{className:"h-[400px]",children:f&&S.length===0?m.jsx("div",{className:"flex items-center justify-center py-8",children:m.jsx(pr,{className:"size-6 animate-spin text-muted-foreground"})}):S.length===0?m.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[m.jsx(po,{className:"size-12 mx-auto mb-3 opacity-50"}),m.jsx("p",{className:"font-medium",children:"No MCP servers configured"}),m.jsxs("p",{className:"text-sm mt-1",children:["Create ",m.jsx("code",{className:"text-xs bg-muted px-1 rounded",children:".jean2/mcp.json"})," in your workspace to add servers."]})]}):m.jsx("div",{className:"space-y-3",children:S.map(([k,{config:T,status:R}])=>{var D;return m.jsxs("div",{className:"border rounded-lg p-4",children:[m.jsxs("div",{className:"flex items-start justify-between",children:[m.jsxs("div",{className:"flex items-start gap-3",children:[m.jsx(po,{className:"size-5 text-muted-foreground mt-0.5"}),m.jsxs("div",{children:[m.jsx("div",{className:"font-medium",children:k}),m.jsx("div",{className:"text-sm text-muted-foreground",children:(T==null?void 0:T.type)==="local"?m.jsxs("span",{children:["Local - ",((D=T.command)==null?void 0:D[0])||"command"]}):(T==null?void 0:T.type)==="remote"?m.jsxs("span",{className:"flex items-center gap-1",children:["Remote - ",T.url]}):"Unknown type"}),R.status==="failed"&&"error"in R&&m.jsx(bd,{variant:"destructive",className:"mt-2 py-2",children:m.jsx(xd,{className:"text-xs",children:R.error})}),R.status==="needs_client_registration"&&"error"in R&&m.jsx(bd,{className:"mt-2 py-2 border-orange-500",children:m.jsx(xd,{className:"text-xs",children:R.error})})]})]}),m.jsx("div",{className:"flex items-center gap-2",children:m.jsx(G8,{status:R})})]}),m.jsxs("div",{className:"flex items-center gap-2 mt-3 pt-3 border-t",children:[R.status==="connected"&&m.jsxs(Fe,{variant:"outline",size:"sm",onClick:()=>b(k),disabled:h===k,children:[h===k?m.jsx(pr,{className:"size-4 animate-spin"}):m.jsx(mA,{className:"size-4"}),m.jsx("span",{className:"ml-1",children:"Disconnect"})]}),(R.status==="disabled"||R.status==="failed")&&m.jsxs(Fe,{variant:"outline",size:"sm",onClick:()=>v(k),disabled:h===k,children:[h===k?m.jsx(pr,{className:"size-4 animate-spin"}):m.jsx(vA,{className:"size-4"}),m.jsx("span",{className:"ml-1",children:"Connect"})]}),R.status==="needs_auth"&&m.jsxs(Fe,{variant:"default",size:"sm",onClick:()=>y(k),disabled:h===k,children:[h===k?m.jsx(pr,{className:"size-4 animate-spin"}):m.jsx(zm,{className:"size-4"}),m.jsx("span",{className:"ml-1",children:"Authenticate"})]})]})]},k)})})})]})]})})}function Y8(t){const e=he.c(70),{open:n,onOpenChange:r,editServer:o}=t,{prepareForServerAdd:a,addServer:c,editServer:l}=ja(),[u,f]=N.useState(""),[p,h]=N.useState(""),[_,x]=N.useState(""),[C,w]=N.useState(!1),[v,b]=N.useState(null),y=o!=null;let S;e[0]!==o?(S=()=>{o?(f(o.name),h(o.url),x(o.token)):(f(""),h("localhost:8742"),x("")),b(null),w(!1)},e[0]=o,e[1]=S):S=e[1];let k;e[2]!==o||e[3]!==n?(k=[o,n],e[2]=o,e[3]=n,e[4]=k):k=e[4],N.useEffect(S,k);let T;e[5]!==c||e[6]!==o||e[7]!==y||e[8]!==u||e[9]!==r||e[10]!==a||e[11]!==_||e[12]!==l||e[13]!==p?(T=Ae=>{Ae.preventDefault(),b(null);const Be=u.trim(),le=p.trim(),Ce=_.trim();if(!Be){b("Name is required");return}if(!le){b("Server URL is required");return}if(!Ce){b("API token is required");return}if(!Qx(Ce)){b("Token must be 64 hexadecimal characters");return}const ge=Cd(le);y?l(o.id,{name:Be,url:ge,token:Ce}):(a(),c(Be,ge,Ce)),r(!1)},e[5]=c,e[6]=o,e[7]=y,e[8]=u,e[9]=r,e[10]=a,e[11]=_,e[12]=l,e[13]=p,e[14]=T):T=e[14];const R=T,D=y?"Edit Server":"Add Server";let A;e[15]!==D?(A=m.jsx(Ga,{children:D}),e[15]=D,e[16]=A):A=e[16];const j=y?"Update server details":"Enter your server details";let O;e[17]!==j?(O=m.jsx(jc,{children:j}),e[17]=j,e[18]=O):O=e[18];let P;e[19]!==A||e[20]!==O?(P=m.jsxs(Wa,{children:[A,O]}),e[19]=A,e[20]=O,e[21]=P):P=e[21];let $;e[22]===Symbol.for("react.memo_cache_sentinel")?($=m.jsx(Nr,{htmlFor:"server-name",children:"Name"}),e[22]=$):$=e[22];let U;e[23]===Symbol.for("react.memo_cache_sentinel")?(U=Ae=>f(Ae.target.value),e[23]=U):U=e[23];let W;e[24]!==u?(W=m.jsxs("div",{className:"grid gap-2",children:[$,m.jsx(yd,{id:"server-name",value:u,onChange:U,placeholder:"My Server"})]}),e[24]=u,e[25]=W):W=e[25];let K;e[26]===Symbol.for("react.memo_cache_sentinel")?(K=m.jsx(Nr,{htmlFor:"server-url",children:"Server URL"}),e[26]=K):K=e[26];let V;e[27]===Symbol.for("react.memo_cache_sentinel")?(V=Ae=>h(Ae.target.value),e[27]=V):V=e[27];let Q;e[28]!==p?(Q=m.jsxs("div",{className:"grid gap-2",children:[K,m.jsx(yd,{id:"server-url",value:p,onChange:V,placeholder:"localhost:8742"})]}),e[28]=p,e[29]=Q):Q=e[29];let X;e[30]===Symbol.for("react.memo_cache_sentinel")?(X=m.jsx(Nr,{htmlFor:"server-token",children:"API Token"}),e[30]=X):X=e[30];const I=C?"text":"password";let L;e[31]===Symbol.for("react.memo_cache_sentinel")?(L=Ae=>x(Ae.target.value),e[31]=L):L=e[31];let z;e[32]!==I||e[33]!==_?(z=m.jsx(yd,{id:"server-token",type:I,value:_,onChange:L,placeholder:"64-character hex string",className:"pr-10"}),e[32]=I,e[33]=_,e[34]=z):z=e[34];let F;e[35]!==C?(F=()=>w(!C),e[35]=C,e[36]=F):F=e[36];let B;e[37]!==C?(B=C?m.jsx(T5,{className:"size-4 text-muted-foreground"}):m.jsx(rS,{className:"size-4 text-muted-foreground"}),e[37]=C,e[38]=B):B=e[38];let Y;e[39]!==F||e[40]!==B?(Y=m.jsx("button",{type:"button",onClick:F,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 hover:bg-transparent",children:B}),e[39]=F,e[40]=B,e[41]=Y):Y=e[41];let ee;e[42]!==z||e[43]!==Y?(ee=m.jsxs("div",{className:"grid gap-2",children:[X,m.jsxs("div",{className:"relative",children:[z,Y]})]}),e[42]=z,e[43]=Y,e[44]=ee):ee=e[44];let J;e[45]!==v?(J=v&&m.jsx("p",{className:"text-sm text-destructive",children:v}),e[45]=v,e[46]=J):J=e[46];let G;e[47]!==W||e[48]!==Q||e[49]!==ee||e[50]!==J?(G=m.jsxs("div",{className:"grid gap-4 py-4",children:[W,Q,ee,J]}),e[47]=W,e[48]=Q,e[49]=ee,e[50]=J,e[51]=G):G=e[51];let q;e[52]!==r?(q=m.jsx(Fe,{type:"button",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),e[52]=r,e[53]=q):q=e[53];const te=y?"Save":"Add";let re;e[54]!==te?(re=m.jsx(Fe,{type:"submit",children:te}),e[54]=te,e[55]=re):re=e[55];let oe;e[56]!==q||e[57]!==re?(oe=m.jsxs(Ef,{children:[q,re]}),e[56]=q,e[57]=re,e[58]=oe):oe=e[58];let se;e[59]!==R||e[60]!==G||e[61]!==oe?(se=m.jsxs("form",{onSubmit:R,children:[G,oe]}),e[59]=R,e[60]=G,e[61]=oe,e[62]=se):se=e[62];let ye;e[63]!==se||e[64]!==P?(ye=m.jsxs(Va,{className:"sm:max-w-[425px]",children:[P,se]}),e[63]=se,e[64]=P,e[65]=ye):ye=e[65];let Ee;return e[66]!==r||e[67]!==n||e[68]!==ye?(Ee=m.jsx(qa,{open:n,onOpenChange:r,children:ye}),e[66]=r,e[67]=n,e[68]=ye,e[69]=Ee):Ee=e[69],Ee}function X8(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}async function Of(t,e={},n){return window.__TAURI_INTERNALS__.invoke(t,e,n)}function Q8(){return!!(globalThis||window).isTauri}const Z8="/assets/chat-finish-Kb8mnIhV.mp3",J8="/assets/chat-permission-BltPnMpz.mp3",eL={chatFinish:Z8,chatPermission:J8};function tL(){const t=N.useRef(null),e=N.useRef({}),n=N.useRef(!1),r=N.useRef(null),o=N.useRef(0),a=N.useCallback(async()=>{let C=t.current;return(!C||C.state==="closed")&&(C=new AudioContext,t.current=C,e.current={}),C.state==="suspended"&&await C.resume(),C},[]),c=N.useCallback(async(C,w)=>{var v;if(e.current[C])return(v=e.current[C])!=null?v:null;try{const b=await fetch(eL[C]);if(!b.ok)throw new Error(`HTTP ${b.status}`);const y=await b.arrayBuffer(),S=await w.decodeAudioData(y);return e.current[C]=S,S}catch(b){return console.warn("[useNotificationSound] Failed to load",C,b),null}},[]),l=N.useCallback((C,w)=>{try{const v=w.createBufferSource();v.buffer=C,v.connect(w.destination),v.start(0)}catch(v){console.warn("[useNotificationSound] Playback error",v)}},[]),u=N.useCallback(async()=>{if(n.current)return;const C=await a();if(C.state!=="running")return;const w=r.current;if(r.current=null,w){const v=await c(w,C);v&&l(v,C)}n.current=!0},[a,c,l]),f=N.useCallback(()=>{const C=()=>{document.removeEventListener("click",C),document.removeEventListener("keydown",C),document.removeEventListener("touchstart",C),u()};document.addEventListener("click",C),document.addEventListener("keydown",C),document.addEventListener("touchstart",C)},[u]),p=N.useCallback(async C=>{if(n.current){const w=await a();if(w.state!=="running")return;const v=await c(C,w);v&&l(v,w);return}r.current=C,f()},[a,c,l,f]),h=N.useCallback(async C=>{if(Q8()){const w=Date.now();if(w>o.current)try{await Of("play_sound",{soundKey:C});return}catch(v){const b=v instanceof Error?v.message:String(v);console.warn(`[useNotificationSound] Native playback failed for ${C}, error: ${b}`),o.current=w+1e3}}else await p(C)},[p]),_=N.useCallback(()=>{h("chatFinish")},[h]),x=N.useCallback(()=>{h("chatPermission")},[h]);return N.useEffect(()=>()=>{const C=t.current;C&&C.state!=="closed"&&C.close(),t.current=null},[]),{playChatFinishSound:_,playPermissionSound:x,playSound:h}}const nL=(t,e)=>t&&e?`ws://${e}/ws?token=${t}`:null,rL=1e4,sL=3e4,iL=1e3,oL=3e4;function aL({apiToken:t,serverUrl:e,wsRef:n,serverEpochRef:r,currentSessionIdRef:o,clearPendingPermissions:a,handleLogout:c,setWs:l,setConnected:u,setAuthError:f,setConnectionTimedOut:p,setRetryCount:h,setNextRetryIn:_,setReconnectTrigger:x,reconnectTrigger:C,connected:w,connectionTimedOut:v,retryCount:b,onMessage:y}){const S=N.useRef(Date.now());N.useEffect(()=>{if(!t||!e)return;const k=nL(t,e);if(!k)return;const T=new WebSocket(k),R=r.current;return T.onopen=()=>{r.current===R&&(S.current=Date.now(),u(!0),f(null),h(0),p(!1),a(),o.current&&T.send(JSON.stringify({type:"session.resume",sessionId:o.current})),T.send(JSON.stringify({type:"permissions.sync"})))},T.onclose=D=>{r.current===R&&(u(!1),(D.code===1008||D.code===401)&&c())},T.onerror=D=>{r.current===R&&console.error("WebSocket error:",D)},T.onmessage=D=>{if(r.current!==R)return;S.current=Date.now();const A=JSON.parse(D.data);y(A)},l(T),()=>T.close()},[t,e,c,C]),N.useEffect(()=>{if(t&&e&&!w&&!v){const k=setTimeout(()=>{w||p(!0)},rL);return()=>clearTimeout(k)}},[t,e,w,v,p]),N.useEffect(()=>{const k=r.current;if(v&&!w&&t&&e){const T=Math.min(iL*Math.pow(2,b),sL);let R=Math.floor(T/1e3);_(R);const D=setInterval(()=>{R-=1,_(Math.max(0,R))},1e3),A=setTimeout(()=>{r.current===k&&(h(j=>j+1),x(j=>j+1))},T);return()=>{clearInterval(D),clearTimeout(A)}}},[v,w,t,e,b,r,x,_]),N.useEffect(()=>{const k=r.current,T=()=>{if(r.current!==k||document.visibilityState!=="visible")return;const R=n.current;if(!(!R||!t||!e))if(R.readyState===WebSocket.OPEN){if(Date.now()-S.current<oL)return;R.onclose=null,R.close(),u(!1),h(0),p(!1),x(A=>A+1)}else(R.readyState===WebSocket.CLOSED||R.readyState===WebSocket.CLOSING)&&(u(!1),h(0),p(!1),x(D=>D+1))};return document.addEventListener("visibilitychange",T),()=>document.removeEventListener("visibilitychange",T)},[t,e,r,x,u,h,p,S]),N.useEffect(()=>{const k=r.current,T=()=>{if(r.current!==k||!t||!e)return;const R=n.current;R&&R.readyState===WebSocket.OPEN||(u(!1),h(0),p(!1),x(D=>D+1))};return window.addEventListener("online",T),()=>window.removeEventListener("online",T)},[t,e,r,x,u,h,p])}const lL=t=>t?`http://${t}/api`:null;function cL(t){const e=he.c(38),{apiToken:n,serverUrl:r,reconnectTrigger:o,serverEpochRef:a,fetchWithAuth:c,clearSwitchingState:l,setSessions:u,setPreconfigs:f,setPrompts:p,setModels:h,setDefaultModel:_,setProviderStatuses:x,setWorkspaces:C,setActiveWorkspace:w,activeWorkspace:v,setIsLoadingServerData:b,setAuthError:y,pendingWorkspaceIdRef:S}=t,k=N.useRef(null);let T,R;e[0]!==v?(T=()=>{v&&localStorage.setItem("activeWorkspaceId",v.id)},R=[v],e[0]=v,e[1]=T,e[2]=R):(T=e[1],R=e[2]),N.useEffect(T,R);let D;e[3]!==n||e[4]!==l||e[5]!==c||e[6]!==S||e[7]!==a||e[8]!==r||e[9]!==w||e[10]!==y||e[11]!==_||e[12]!==b||e[13]!==h||e[14]!==f||e[15]!==p||e[16]!==x||e[17]!==u||e[18]!==C?(D=()=>{var $;if(!n||!r)return;($=k.current)==null||$.abort(),k.current=new AbortController;const j=k.current.signal,O=lL(r);if(!O)return;const P=a.current;return b(!0),Promise.all([c(`${O}/sessions`,{signal:j}).then(mL),c(`${O}/preconfigs`,{signal:j}).then(pL),c(`${O}/prompts`,{signal:j}).then(hL),c(`${O}/models`,{signal:j}).then(fL),c(`${O}/workspaces`,{signal:j}).then(dL),c(`${O}/providers`,{signal:j}).then(uL)]).then(U=>{const[W,K,V,Q,X,I]=U;if(a.current!==P)return;u(W.sessions||[]),f(K.preconfigs||[]),p(V.prompts||[]),h(Q.models||[]),_(Q.defaultModel||"gpt-4o"),x(I.providers||[]);const L=X.workspaces||[];if(C(L),S.current){const z=L.find(F=>F.id===S.current);z&&w(z),S.current=null}else{const z=localStorage.getItem("activeWorkspaceId"),F=L.find(B=>B.id===z);w(F||L[0])}l(),b(!1)}).catch(U=>{var W;if(U.name==="AbortError"){console.log("Fetch aborted due to server switch");return}console.error("Failed to load server data:",U),b(!1),(W=U.message)!=null&&W.includes("Unauthorized")||y("Failed to connect to server")}),()=>{var U;(U=k.current)==null||U.abort()}},e[3]=n,e[4]=l,e[5]=c,e[6]=S,e[7]=a,e[8]=r,e[9]=w,e[10]=y,e[11]=_,e[12]=b,e[13]=h,e[14]=f,e[15]=p,e[16]=x,e[17]=u,e[18]=C,e[19]=D):D=e[19];let A;e[20]!==n||e[21]!==l||e[22]!==c||e[23]!==S||e[24]!==o||e[25]!==a||e[26]!==r||e[27]!==w||e[28]!==y||e[29]!==_||e[30]!==b||e[31]!==h||e[32]!==f||e[33]!==p||e[34]!==x||e[35]!==u||e[36]!==C?(A=[n,r,o,a,c,l,u,f,p,h,_,x,C,w,b,y,S],e[20]=n,e[21]=l,e[22]=c,e[23]=S,e[24]=o,e[25]=a,e[26]=r,e[27]=w,e[28]=y,e[29]=_,e[30]=b,e[31]=h,e[32]=f,e[33]=p,e[34]=x,e[35]=u,e[36]=C,e[37]=A):A=e[37],N.useEffect(D,A)}function uL(t){return t.json()}function dL(t){return t.json()}function fL(t){return t.json()}function hL(t){return t.json()}function pL(t){return t.json()}function mL(t){return t.json()}function gL(t){const e=he.c(106),{ws:n,currentSession:r,sessions:o,workspaces:a,activeWorkspace:c,currentModel:l,streamingSessionIds:u,isCompacting:f,primaryPreconfigs:p,setCurrentSession:h,setActiveWorkspace:_,setCompactionSuccess:x,setCurrentModel:C,setSelectedVariant:w,removePendingPermissionByToolCallId:v,removePendingPermissionsBySessionId:b,clearStreamingSessions:y,pendingSessionCreateRef:S,partAppendRafRef:k,pendingPartAppendsRef:T,skipFinishSoundSessionIdsRef:R}=t;let D;e[0]!==n?(D=(Re,Ke)=>{n&&n.readyState===WebSocket.OPEN&&n.send(JSON.stringify({type:Re,...Ke}))},e[0]=n,e[1]=D):D=e[1];const A=D;let j;e[2]!==(c==null?void 0:c.id)||e[3]!==k||e[4]!==T||e[5]!==S||e[6]!==A?(j=(Re,Ke)=>{S.current=!0,k.current!==null&&(cancelAnimationFrame(k.current),k.current=null),T.current.clear(),A("session.create",{preconfigId:Re,title:Ke,workspaceId:c==null?void 0:c.id})},e[2]=c==null?void 0:c.id,e[3]=k,e[4]=T,e[5]=S,e[6]=A,e[7]=j):j=e[7];const O=j;let P;e[8]!==(c==null?void 0:c.id)||e[9]!==y||e[10]!==k||e[11]!==T||e[12]!==b||e[13]!==A||e[14]!==o||e[15]!==_||e[16]!==x||e[17]!==h||e[18]!==R||e[19]!==a?(P=Re=>{b(Re),R.current=new Set(Im.getState().streamingSessionIds),y(),x(!1);const Ke=o.find(we=>we.id===Re);if(Ke!=null&&Ke.workspaceId&&Ke.workspaceId!==(c==null?void 0:c.id)){const we=a.find(De=>De.id===Ke.workspaceId);we&&_(we)}k.current!==null&&(cancelAnimationFrame(k.current),k.current=null),T.current.clear(),Ke&&h(Ke),A("session.resume",{sessionId:Re})},e[8]=c==null?void 0:c.id,e[9]=y,e[10]=k,e[11]=T,e[12]=b,e[13]=A,e[14]=o,e[15]=_,e[16]=x,e[17]=h,e[18]=R,e[19]=a,e[20]=P):P=e[20];const $=P;let U;e[21]!==A?(U=Re=>{A("session.close",{sessionId:Re})},e[21]=A,e[22]=U):U=e[22];const W=U;let K;e[23]!==A?(K=(Re,Ke)=>{A("session.revert",{sessionId:Re,messageId:Ke})},e[23]=A,e[24]=K):K=e[24];const V=K;let Q;e[25]!==A?(Q=(Re,Ke)=>{A("session.fork",{sessionId:Re,messageId:Ke})},e[25]=A,e[26]=Q):Q=e[26];const X=Q;let I;e[27]!==A?(I=Re=>{A("session.compact",{sessionId:Re})},e[27]=A,e[28]=I):I=e[28];const L=I;let z;e[29]!==A?(z=Re=>{A("session.reopen",{sessionId:Re})},e[29]=A,e[30]=z):z=e[30];const F=z;let B;e[31]!==A?(B=Re=>{A("session.delete",{sessionId:Re})},e[31]=A,e[32]=B):B=e[32];const Y=B;let ee;e[33]!==r||e[34]!==A?(ee=Re=>{r&&A("session.update",{sessionId:r.id,preconfigId:Re})},e[33]=r,e[34]=A,e[35]=ee):ee=e[35];const J=ee;let G;e[36]!==r||e[37]!==A||e[38]!==C||e[39]!==w?(G=(Re,Ke)=>{C(Re),w(null),r&&A("session.update_model",{sessionId:r.id,modelId:Re,providerId:Ke})},e[36]=r,e[37]=A,e[38]=C,e[39]=w,e[40]=G):G=e[40];const q=G;let te;e[41]!==l||e[42]!==r||e[43]!==A||e[44]!==w?(te=Re=>{r&&(A("session.update_model",{sessionId:r.id,modelId:r.selectedModel||l,providerId:r.selectedProvider||"openai",variant:Re}),w(Re))},e[41]=l,e[42]=r,e[43]=A,e[44]=w,e[45]=te):te=e[45];const re=te;let oe;e[46]!==A?(oe=(Re,Ke)=>{A("session.rename",{sessionId:Re,title:Ke})},e[46]=A,e[47]=oe):oe=e[47];const se=oe;let ye;e[48]!==r||e[49]!==$?(ye=()=>{r!=null&&r.parentId&&$(r.parentId)},e[48]=r,e[49]=$,e[50]=ye):ye=e[50];const Ee=ye;let Ae;e[51]!==A?(Ae=(Re,Ke)=>{A("queue.add",{sessionId:Re,content:Ke})},e[51]=A,e[52]=Ae):Ae=e[52];const Be=Ae;let le;e[53]!==A?(le=Re=>{A("queue.remove",{queueId:Re})},e[53]=A,e[54]=le):le=e[54];const Ce=le;let ge;e[55]!==Be||e[56]!==r||e[57]!==f||e[58]!==A||e[59]!==u?(ge=Re=>{!r||f||(r.runningAt||u.has(r.id)?Be(r.id,Re):A("chat.message",{sessionId:r.id,content:Re}))},e[55]=Be,e[56]=r,e[57]=f,e[58]=A,e[59]=u,e[60]=ge):ge=e[60];const Oe=ge;let He;e[61]!==v||e[62]!==A?(He=(Re,Ke,we)=>{v(Re),A("permission.response",{toolCallId:Re,allowed:Ke,alwaysAllow:we})},e[61]=v,e[62]=A,e[63]=He):He=e[63];const rt=He;let Qe;e[64]!==r||e[65]!==A?(Qe=()=>{r&&A("session.interrupt",{sessionId:r.id})},e[64]=r,e[65]=A,e[66]=Qe):Qe=e[66];const Ne=Qe;let Ge;e[67]!==c||e[68]!==A?(Ge=()=>{c&&A("permission.list",{workspaceId:c.id})},e[67]=c,e[68]=A,e[69]=Ge):Ge=e[69];const ce=Ge;let ve;e[70]!==A?(ve=Re=>{A("provider.connect",{provider:Re})},e[70]=A,e[71]=ve):ve=e[71];const Te=ve;let je;e[72]!==A?(je=Re=>{A("provider.disconnect",{provider:Re})},e[72]=A,e[73]=je):je=e[73];const Le=je;let Je;e[74]!==k||e[75]!==T||e[76]!==S||e[77]!==p||e[78]!==A||e[79]!==_||e[80]!==a?(Je=Re=>{var we;_(a.find(De=>De.id===Re)||null),S.current=!0,k.current!==null&&(cancelAnimationFrame(k.current),k.current=null),T.current.clear();const Ke=(we=p[0])==null?void 0:we.id;A("session.create",{preconfigId:Ke,workspaceId:Re})},e[74]=k,e[75]=T,e[76]=S,e[77]=p,e[78]=A,e[79]=_,e[80]=a,e[81]=Je):Je=e[81];const Ue=Je;let Pe;return e[82]!==Be||e[83]!==W||e[84]!==L||e[85]!==Te||e[86]!==O||e[87]!==Ue||e[88]!==Le||e[89]!==X||e[90]!==Ne||e[91]!==Ee||e[92]!==rt||e[93]!==se||e[94]!==Y||e[95]!==ce||e[96]!==Ce||e[97]!==F||e[98]!==$||e[99]!==V||e[100]!==Oe||e[101]!==A||e[102]!==q||e[103]!==J||e[104]!==re?(Pe={sendMessage:A,createSession:O,resumeSession:$,closeSession:W,reopenSession:F,permanentlyDeleteSession:Y,handleRenameSession:se,revertSession:V,forkSession:X,compactSession:L,addToQueue:Be,removeFromQueue:Ce,sendChatMessage:Oe,handlePermissionResponse:rt,handleInterruptSession:Ne,updateSessionPreconfig:J,updateSessionModel:q,updateSessionVariant:re,handleNavigateBack:Ee,refreshPermissions:ce,connectProvider:Te,disconnectProvider:Le,createSessionInWorkspace:Ue},e[82]=Be,e[83]=W,e[84]=L,e[85]=Te,e[86]=O,e[87]=Ue,e[88]=Le,e[89]=X,e[90]=Ne,e[91]=Ee,e[92]=rt,e[93]=se,e[94]=Y,e[95]=ce,e[96]=Ce,e[97]=F,e[98]=$,e[99]=V,e[100]=Oe,e[101]=A,e[102]=q,e[103]=J,e[104]=re,e[105]=Pe):Pe=e[105],Pe}const vL=400,_L=typeof window<"u"&&("__TAURI_INTERNALS__"in window||"__TAURI__"in window);var Ux;const yL=typeof navigator<"u"&&((Ux=navigator.platform)==null?void 0:Ux.toUpperCase().includes("MAC"))===!0;function bL(){const t=['[data-slot="dialog-overlay"][data-state="open"]','[data-slot="dialog-content"][data-state="open"]','[role="dialog"][data-state="open"]'];for(const n of t)if(document.querySelector(n))return!0;const e=document.querySelectorAll('[role="dialog"]');for(const n of e)if(n instanceof HTMLElement&&xL(n))return!0;return!1}function xL(t){if(!t.isConnected)return!1;const e=window.getComputedStyle(t);return e.display!=="none"&&e.visibility!=="hidden"&&parseFloat(e.opacity)>0&&t.getBoundingClientRect().width>0&&t.getBoundingClientRect().height>0}function SL(){var e,n;const t=document.activeElement;return t?!!((e=t.hasAttribute)!=null&&e.call(t,"data-chat-input")||(n=t.closest)!=null&&n.call(t,'[data-chat-input="true"]')):!1}function wL(t){const e=he.c(5),n=N.useRef(t);let r;e[0]!==t?(r=()=>{n.current=t},e[0]=t,e[1]=r):r=e[1],N.useLayoutEffect(r);let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o={lastEscTime:0,armed:!1},e[2]=o):o=e[2];const a=N.useRef(o);let c,l;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=()=>{const u=f=>{if(f.isComposing||f.repeat||f.key==="Escape"&&bL())return;const{onCloseFocusedPanel:p,onFocusChatInput:h,onStopStreaming:_,onOpenSidebar:x,onOpenTerminal:C,onNewWindow:w,onNewSession:v,onToggleViewMode:b,onToggleAutoFollow:y}=n.current;if(f.shiftKey&&f.key==="Escape"){f.preventDefault(),p();return}if(f.key==="Escape"&&!f.metaKey&&!f.ctrlKey){const R=SL(),D=Date.now(),{lastEscTime:A,armed:j}=a.current,O=D-A;if(R&&j&&O<vL){f.preventDefault(),a.current={lastEscTime:0,armed:!1},_();return}if(R){a.current={lastEscTime:D,armed:!0};return}f.preventDefault(),h();return}const S=f.target,k=S.tagName==="INPUT"||S.tagName==="TEXTAREA"||S.isContentEditable,T=f.metaKey||f.ctrlKey;if(!(k&&!T)){if(!_L||!yL){if(T&&f.code==="Digit1"){f.preventDefault(),x();return}if(T&&f.code==="KeyT"){f.preventDefault(),C();return}}if(T&&f.shiftKey&&f.code==="KeyN"){f.preventDefault(),w();return}if(T&&f.code==="KeyN"){f.preventDefault(),v();return}if(T&&f.code==="KeyO"){f.preventDefault(),b();return}if(T&&f.shiftKey&&f.code==="KeyF"){f.preventDefault(),y();return}}};return window.addEventListener("keydown",u,!0),()=>window.removeEventListener("keydown",u,!0)},l=[],e[3]=c,e[4]=l):(c=e[3],l=e[4]),N.useEffect(c,l)}var Rb;(function(t){t.WINDOW_RESIZED="tauri://resize",t.WINDOW_MOVED="tauri://move",t.WINDOW_CLOSE_REQUESTED="tauri://close-requested",t.WINDOW_DESTROYED="tauri://destroyed",t.WINDOW_FOCUS="tauri://focus",t.WINDOW_BLUR="tauri://blur",t.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",t.WINDOW_THEME_CHANGED="tauri://theme-changed",t.WINDOW_CREATED="tauri://window-created",t.WEBVIEW_CREATED="tauri://webview-created",t.DRAG_ENTER="tauri://drag-enter",t.DRAG_OVER="tauri://drag-over",t.DRAG_DROP="tauri://drag-drop",t.DRAG_LEAVE="tauri://drag-leave"})(Rb||(Rb={}));async function CL(t,e){window.__TAURI_EVENT_PLUGIN_INTERNALS__.unregisterListener(t,e),await Of("plugin:event|unlisten",{event:t,eventId:e})}async function Tb(t,e,n){var r;const o=(r=void 0)!==null&&r!==void 0?r:{kind:"Any"};return Of("plugin:event|listen",{event:t,target:o,handler:X8(e)}).then(a=>async()=>CL(t,a))}function kL(t){const e=he.c(34),{sidebarRef:n,terminalPanelRef:r,chatInputRef:o,activeWorkspace:a,primaryPreconfigs:c,handleInterruptSession:l,handleSidebarViewModeChange:u,createSession:f,setSidebarOpen:p,onToggleAutoFollow:h}=t;let _;e[0]!==p||e[1]!==n?(_=()=>{p(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{var F;(F=n.current)==null||F.focusSessionPanel()})})},e[0]=p,e[1]=n,e[2]=_):_=e[2];const x=_;let C;e[3]!==r?(C=()=>{Qt.getState().setShowTerminalPanel(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{var F;(F=r.current)==null||F.focus()})})},e[3]=r,e[4]=C):C=e[4];const w=C,v=N.useRef(x);let b;e[5]!==x?(b=()=>{v.current=x},e[5]=x,e[6]=b):b=e[6],N.useLayoutEffect(b);const y=N.useRef(w);let S;e[7]!==w?(S=()=>{y.current=w},e[7]=w,e[8]=S):S=e[8],N.useLayoutEffect(S);const k=NL;let T;e[9]!==o?(T=()=>{var F;(F=o.current)==null||F.focus()},e[9]=o,e[10]=T):T=e[10];const R=T;let D;e[11]!==a||e[12]!==f||e[13]!==c?(D=()=>{a&&c[0]&&f(c[0].id)},e[11]=a,e[12]=f,e[13]=c,e[14]=D):D=e[14];const A=D,j=RL;let O;e[15]!==u?(O=()=>{u(AL)},e[15]=u,e[16]=O):O=e[16];const P=O;let $;e[17]!==p?($=()=>{const F=document.activeElement;F!=null&&F.closest("[data-terminal-panel]")?k():F!=null&&F.closest('[data-sidebar="sidebar"]')&&p(!1)},e[17]=p,e[18]=$):$=e[18];const U=$;let W;e[19]!==l?(W=()=>{l()},e[19]=l,e[20]=W):W=e[20];const K=W;let V,Q;e[21]===Symbol.for("react.memo_cache_sentinel")?(V=()=>v.current(),Q=()=>y.current(),e[21]=V,e[22]=Q):(V=e[21],Q=e[22]);let X;e[23]!==h?(X=()=>h==null?void 0:h(),e[23]=h,e[24]=X):X=e[24];let I;e[25]!==R||e[26]!==U||e[27]!==A||e[28]!==K||e[29]!==P||e[30]!==X?(I={onOpenSidebar:V,onOpenTerminal:Q,onNewSession:A,onNewWindow:j,onToggleViewMode:P,onCloseFocusedPanel:U,onFocusChatInput:R,onStopStreaming:K,onToggleAutoFollow:X},e[25]=R,e[26]=U,e[27]=A,e[28]=K,e[29]=P,e[30]=X,e[31]=I):I=e[31],wL(I);let L,z;e[32]===Symbol.for("react.memo_cache_sentinel")?(L=()=>{if(!(typeof window<"u"&&("__TAURI_INTERNALS__"in window||"__TAURI__"in window)))return;let B=!1;const Y=[];return(async()=>{try{const J=await Tb("jean2://accelerator/open-sidebar",()=>{v.current()});if(B){J();return}Y.push(J)}catch(J){console.error("Failed to register open-sidebar accelerator listener:",J)}try{const J=await Tb("jean2://accelerator/open-terminal",()=>{y.current()});if(B){J();return}Y.push(J)}catch(J){console.error("Failed to register open-terminal accelerator listener:",J)}})(),()=>{B=!0,Y.forEach(EL)}},z=[],e[32]=L,e[33]=z):(L=e[32],z=e[33]),N.useLayoutEffect(L,z)}function EL(t){return t()}function AL(t){return t==="overview"?"default":"overview"}function RL(){Of("create_new_window").catch(TL)}function TL(){}function NL(){Qt.getState().setShowTerminalPanel(!1)}function ML(t){const e=he.c(3),{setOpen:n}=Ic();let r;return e[0]!==t||e[1]!==n?(r={...t,setSidebarOpen:n},e[0]=t,e[1]=n,e[2]=r):r=e[2],kL(r),null}function Nb(t){const e=he.c(17),{onServerSwitch:n,onSelectWorkspace:r}=t,[o,a]=N.useState(!1),c=N.useRef(!1),l=Ka(),{quickConnections:u,switchServer:f,removeFromQuickConnections:p,isSwitching:h}=ja(),_=O=>{f(O.serverId)&&(c.current=!0,n==null||n(),O.workspaceId&&r&&r(O.workspaceId))};let x,C;e[0]!==h||e[1]!==o?(x=()=>{!h&&o&&c.current&&(a(!1),c.current=!1)},C=[h,o],e[0]=h,e[1]=o,e[2]=x,e[3]=C):(x=e[2],C=e[3]),N.useEffect(x,C);let w;e[4]!==p?(w=(O,P)=>{O.stopPropagation(),p(P)},e[4]=p,e[5]=w):w=e[5];const v=w,b=()=>m.jsx(av,{children:m.jsx(lv,{className:"max-h-[50vh] overflow-y-auto",children:u.length>0?m.jsx(hc,{heading:"Quick Switch",children:u.map(O=>m.jsxs(Ca,{onSelect:()=>_(O),className:"justify-between",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(po,{className:"size-4 text-muted-foreground"}),m.jsxs("span",{children:[O.serverName,O.workspaceName&&m.jsxs("span",{className:"text-muted-foreground",children:[" / ",O.workspaceName]})]})]}),m.jsx("button",{className:"opacity-0 group-hover:opacity-100 hover:opacity-100 transition-opacity p-1 rounded hover:bg-destructive/10",onClick:P=>v(P,O.id),children:m.jsx(Ia,{className:"size-3 text-destructive"})})]},O.id))}):m.jsx(cv,{className:"py-6",children:m.jsxs("div",{className:"flex flex-col items-center gap-2 text-muted-foreground",children:[m.jsx(Yp,{className:"size-8"}),m.jsx("p",{className:"text-sm font-medium",children:"No favorites yet"}),m.jsx("p",{className:"text-xs",children:"Star a workspace to add it here"})]})})})});if(l){let O;e[6]===Symbol.for("react.memo_cache_sentinel")?(O=m.jsx(GO,{asChild:!0,children:m.jsx(Fe,{variant:"ghost",size:"icon-sm","aria-label":"Quick switch",children:m.jsx(Yp,{className:"size-4"})})}),e[6]=O):O=e[6];let P;return e[7]===Symbol.for("react.memo_cache_sentinel")?(P=m.jsx(Df,{children:m.jsx(jf,{children:"Quick Switch"})}),e[7]=P):P=e[7],m.jsxs(Nf,{open:o,onOpenChange:a,children:[O,m.jsxs(Mf,{side:"bottom",className:"max-h-[80vh]",children:[P,m.jsx("div",{className:"mt-4",children:b()})]})]})}const y=Rf;let S;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=m.jsx(uv,{asChild:!0,children:m.jsx(Fe,{variant:"ghost",size:"icon-sm","aria-label":"Quick switch",children:m.jsx(Yp,{className:"size-4"})})}),e[8]=S):S=e[8];const k=Tf,T="w-[300px] p-0",R="start",D=b();let A;e[9]!==k||e[10]!==D?(A=m.jsx(k,{className:T,align:R,children:D}),e[9]=k,e[10]=D,e[11]=A):A=e[11];let j;return e[12]!==y||e[13]!==o||e[14]!==S||e[15]!==A?(j=m.jsxs(y,{open:o,onOpenChange:a,children:[S,A]}),e[12]=y,e[13]=o,e[14]=S,e[15]=A,e[16]=j):j=e[16],j}function Mb(t){const e=he.c(13),{viewMode:n,onViewModeChange:r}=t;let o;e[0]!==r||e[1]!==n?(o=()=>{r(n==="overview"?"default":"overview")},e[0]=r,e[1]=n,e[2]=o):o=e[2];const a=o,c=n==="overview";let l;e[3]!==c?(l=c?m.jsx(K5,{className:"h-4 w-4"}):m.jsx(W5,{className:"h-4 w-4"}),e[3]=c,e[4]=l):l=e[4];let u;e[5]!==l||e[6]!==a?(u=m.jsx(mc,{asChild:!0,children:m.jsx(Fe,{variant:"ghost",size:"icon-sm",onClick:a,children:l})}),e[5]=l,e[6]=a,e[7]=u):u=e[7];const f=c?"Single workspace":"Overview";let p;e[8]!==f?(p=m.jsx(gc,{children:f}),e[8]=f,e[9]=p):p=e[9];let h;return e[10]!==u||e[11]!==p?(h=m.jsx(Pd,{children:m.jsxs(pc,{children:[u,p]})}),e[10]=u,e[11]=p,e[12]=h):h=e[12],h}function DL(t){const e=he.c(69),{headerTitle:n,isLoggedIn:r,activeWorkspace:o,onServerSwitch:a,onSelectWorkspace:c,onSidebarViewModeChange:l}=t,u=Qt(PL),f=Qt(IL),p=Qt(LL),h=Qt(OL),_=Qt(jL);let x;e[0]!==r?(x=r&&m.jsx(yb,{}),e[0]=r,e[1]=x):x=e[1];let C;e[2]!==n?(C=m.jsx("span",{className:"font-semibold",children:n}),e[2]=n,e[3]=C):C=e[3];let w;e[4]!==x||e[5]!==C?(w=m.jsxs("div",{className:"flex items-center gap-2",children:[x,C]}),e[4]=x,e[5]=C,e[6]=w):w=e[6];let v;e[7]!==r||e[8]!==c||e[9]!==a?(v=r&&m.jsx(Nb,{onServerSwitch:a,onSelectWorkspace:c}),e[7]=r,e[8]=c,e[9]=a,e[10]=v):v=e[10];let b;e[11]!==r||e[12]!==l||e[13]!==u?(b=r&&m.jsx(Mb,{viewMode:u,onViewModeChange:l}),e[11]=r,e[12]=l,e[13]=u,e[14]=b):b=e[14];let y;e[15]!==o||e[16]!==r||e[17]!==h||e[18]!==f?(y=r&&o&&m.jsx(Fe,{variant:"ghost",size:"icon-sm",onClick:()=>h(!f),title:f?"Hide Files":"Show Files",children:m.jsx(Bm,{className:"w-4 h-4"})}),e[15]=o,e[16]=r,e[17]=h,e[18]=f,e[19]=y):y=e[19];let S;e[20]!==o||e[21]!==r||e[22]!==_||e[23]!==p?(S=r&&o&&m.jsx(Fe,{variant:"ghost",size:"icon-sm",onClick:()=>_(!p),title:p?"Hide Terminal":"Show Terminal",children:m.jsx(Ny,{className:"w-4 h-4"})}),e[20]=o,e[21]=r,e[22]=_,e[23]=p,e[24]=S):S=e[24];let k;e[25]!==v||e[26]!==b||e[27]!==y||e[28]!==S?(k=m.jsxs("div",{className:"flex items-center gap-1",children:[v,b,y,S]}),e[25]=v,e[26]=b,e[27]=y,e[28]=S,e[29]=k):k=e[29];let T;e[30]!==w||e[31]!==k?(T=m.jsxs("header",{className:"md:hidden flex items-center justify-between p-3 border-b border-border bg-background sticky top-0 z-10",children:[w,k]}),e[30]=w,e[31]=k,e[32]=T):T=e[32];let R;e[33]!==r?(R=r&&m.jsx(yb,{}),e[33]=r,e[34]=R):R=e[34];let D;e[35]!==n?(D=m.jsx("span",{className:"font-semibold",children:n}),e[35]=n,e[36]=D):D=e[36];let A;e[37]!==R||e[38]!==D?(A=m.jsxs("div",{className:"flex items-center gap-2",children:[R,D]}),e[37]=R,e[38]=D,e[39]=A):A=e[39];let j;e[40]!==r||e[41]!==c||e[42]!==a?(j=r&&m.jsx(Nb,{onServerSwitch:a,onSelectWorkspace:c}),e[40]=r,e[41]=c,e[42]=a,e[43]=j):j=e[43];let O;e[44]!==r||e[45]!==l||e[46]!==u?(O=r&&m.jsx(Mb,{viewMode:u,onViewModeChange:l}),e[44]=r,e[45]=l,e[46]=u,e[47]=O):O=e[47];let P;e[48]!==o||e[49]!==r||e[50]!==h||e[51]!==f?(P=r&&o&&m.jsx(Fe,{variant:"ghost",size:"icon-sm",onClick:()=>h(!f),title:f?"Hide Files":"Show Files",children:m.jsx(Bm,{className:"w-4 h-4"})}),e[48]=o,e[49]=r,e[50]=h,e[51]=f,e[52]=P):P=e[52];let $;e[53]!==o||e[54]!==r||e[55]!==_||e[56]!==p?($=r&&o&&m.jsx(Fe,{variant:"ghost",size:"icon-sm",onClick:()=>_(!p),title:p?"Hide Terminal":"Show Terminal",children:m.jsx(Ny,{className:"w-4 h-4"})}),e[53]=o,e[54]=r,e[55]=_,e[56]=p,e[57]=$):$=e[57];let U;e[58]!==j||e[59]!==O||e[60]!==P||e[61]!==$?(U=m.jsxs("div",{className:"flex items-center gap-2",children:[j,O,P,$]}),e[58]=j,e[59]=O,e[60]=P,e[61]=$,e[62]=U):U=e[62];let W;e[63]!==A||e[64]!==U?(W=m.jsxs("header",{className:"hidden md:flex items-center justify-between p-3 border-b border-border",children:[A,U]}),e[63]=A,e[64]=U,e[65]=W):W=e[65];let K;return e[66]!==W||e[67]!==T?(K=m.jsxs(m.Fragment,{children:[T,W]}),e[66]=W,e[67]=T,e[68]=K):K=e[68],K}function jL(t){return t.setShowTerminalPanel}function OL(t){return t.setShowFilesPanel}function LL(t){return t.showTerminalPanel}function IL(t){return t.showFilesPanel}function PL(t){return t.sidebarViewMode}function zL({cachedTerminal:t}){const e=N.useRef(null);return N.useEffect(()=>{const n=e.current;if(!n)return;const{terminal:r,fitAddon:o}=t;t.isOpened?r.element&&n.appendChild(r.element):(r.open(n),t.isOpened=!0),requestAnimationFrame(()=>{try{o.fit()}catch{}if(r.cols<=1||r.rows<=1){const c=()=>{try{if(o.fit(),r.cols>1&&r.rows>1)return}catch{}requestAnimationFrame(c)};requestAnimationFrame(c)}}),r.focus();const a=new ResizeObserver(()=>{requestAnimationFrame(()=>{try{o.fit()}catch{}})});return a.observe(n),()=>{a.disconnect(),r.element&&r.element.parentElement&&r.element.parentElement.removeChild(r.element)}},[t]),m.jsx("div",{ref:e,className:"w-full h-full",onFocus:()=>t.terminal.focus()})}var pm={exports:{}},Db;function BL(){return Db||(Db=1,(function(t,e){(function(n,r){t.exports=r()})(globalThis,(()=>(()=>{var n={4567:function(c,l,u){var f=this&&this.__decorate||function(y,S,k,T){var R,D=arguments.length,A=D<3?S:T===null?T=Object.getOwnPropertyDescriptor(S,k):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(y,S,k,T);else for(var j=y.length-1;j>=0;j--)(R=y[j])&&(A=(D<3?R(A):D>3?R(S,k,A):R(S,k))||A);return D>3&&A&&Object.defineProperty(S,k,A),A},p=this&&this.__param||function(y,S){return function(k,T){S(k,T,y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.AccessibilityManager=void 0;const h=u(9042),_=u(9924),x=u(844),C=u(4725),w=u(2585),v=u(3656);let b=l.AccessibilityManager=class extends x.Disposable{constructor(y,S,k,T){super(),this._terminal=y,this._coreBrowserService=k,this._renderService=T,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let R=0;R<this._terminal.rows;R++)this._rowElements[R]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[R]);if(this._topBoundaryFocusListener=R=>this._handleBoundaryFocus(R,0),this._bottomBoundaryFocusListener=R=>this._handleBoundaryFocus(R,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new _.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((R=>this._handleResize(R.rows)))),this.register(this._terminal.onRender((R=>this._refreshRows(R.start,R.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((R=>this._handleChar(R)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
520
+ `)))),this.register(this._terminal.onA11yTab((R=>this._handleTab(R)))),this.register(this._terminal.onKey((R=>this._handleKey(R.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,v.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,x.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(y){for(let S=0;S<y;S++)this._handleChar(" ")}_handleChar(y){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==y&&(this._charsToAnnounce+=y):this._charsToAnnounce+=y,y===`
521
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=h.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(y){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(y)||this._charsToConsume.push(y)}_refreshRows(y,S){this._liveRegionDebouncer.refresh(y,S,this._terminal.rows)}_renderRows(y,S){const k=this._terminal.buffer,T=k.lines.length.toString();for(let R=y;R<=S;R++){const D=k.lines.get(k.ydisp+R),A=[],j=(D==null?void 0:D.translateToString(!0,void 0,void 0,A))||"",O=(k.ydisp+R+1).toString(),P=this._rowElements[R];P&&(j.length===0?(P.innerText=" ",this._rowColumns.set(P,[0,1])):(P.textContent=j,this._rowColumns.set(P,A)),P.setAttribute("aria-posinset",O),P.setAttribute("aria-setsize",T))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(y,S){const k=y.target,T=this._rowElements[S===0?1:this._rowElements.length-2];if(k.getAttribute("aria-posinset")===(S===0?"1":`${this._terminal.buffer.lines.length}`)||y.relatedTarget!==T)return;let R,D;if(S===0?(R=k,D=this._rowElements.pop(),this._rowContainer.removeChild(D)):(R=this._rowElements.shift(),D=k,this._rowContainer.removeChild(R)),R.removeEventListener("focus",this._topBoundaryFocusListener),D.removeEventListener("focus",this._bottomBoundaryFocusListener),S===0){const A=this._createAccessibilityTreeNode();this._rowElements.unshift(A),this._rowContainer.insertAdjacentElement("afterbegin",A)}else{const A=this._createAccessibilityTreeNode();this._rowElements.push(A),this._rowContainer.appendChild(A)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(S===0?-1:1),this._rowElements[S===0?1:this._rowElements.length-2].focus(),y.preventDefault(),y.stopImmediatePropagation()}_handleSelectionChange(){var j,O;if(this._rowElements.length===0)return;const y=document.getSelection();if(!y)return;if(y.isCollapsed)return void(this._rowContainer.contains(y.anchorNode)&&this._terminal.clearSelection());if(!y.anchorNode||!y.focusNode)return void console.error("anchorNode and/or focusNode are null");let S={node:y.anchorNode,offset:y.anchorOffset},k={node:y.focusNode,offset:y.focusOffset};if((S.node.compareDocumentPosition(k.node)&Node.DOCUMENT_POSITION_PRECEDING||S.node===k.node&&S.offset>k.offset)&&([S,k]=[k,S]),S.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(S={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(S.node))return;const T=this._rowElements.slice(-1)[0];if(k.node.compareDocumentPosition(T)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(k={node:T,offset:(O=(j=T.textContent)==null?void 0:j.length)!=null?O:0}),!this._rowContainer.contains(k.node))return;const R=({node:P,offset:$})=>{const U=P instanceof Text?P.parentNode:P;let W=parseInt(U==null?void 0:U.getAttribute("aria-posinset"),10)-1;if(isNaN(W))return console.warn("row is invalid. Race condition?"),null;const K=this._rowColumns.get(U);if(!K)return console.warn("columns is null. Race condition?"),null;let V=$<K.length?K[$]:K.slice(-1)[0]+1;return V>=this._terminal.cols&&(++W,V=0),{row:W,column:V}},D=R(S),A=R(k);if(D&&A){if(D.row>A.row||D.row===A.row&&D.column>=A.column)throw new Error("invalid range");this._terminal.select(D.column,D.row,(A.row-D.row)*this._terminal.cols-D.column+A.column)}}_handleResize(y){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let S=this._rowContainer.children.length;S<this._terminal.rows;S++)this._rowElements[S]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[S]);for(;this._rowElements.length>y;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const y=this._coreBrowserService.mainDocument.createElement("div");return y.setAttribute("role","listitem"),y.tabIndex=-1,this._refreshRowDimensions(y),y}_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 y=0;y<this._terminal.rows;y++)this._refreshRowDimensions(this._rowElements[y])}}_refreshRowDimensions(y){y.style.height=`${this._renderService.dimensions.css.cell.height}px`}};l.AccessibilityManager=b=f([p(1,w.IInstantiationService),p(2,C.ICoreBrowserService),p(3,C.IRenderService)],b)},3614:(c,l)=>{function u(_){return _.replace(/\r?\n/g,"\r")}function f(_,x){return x?"\x1B[200~"+_+"\x1B[201~":_}function p(_,x,C,w){_=f(_=u(_),C.decPrivateModes.bracketedPasteMode&&w.rawOptions.ignoreBracketedPasteMode!==!0),C.triggerDataEvent(_,!0),x.value=""}function h(_,x,C){const w=C.getBoundingClientRect(),v=_.clientX-w.left-10,b=_.clientY-w.top-10;x.style.width="20px",x.style.height="20px",x.style.left=`${v}px`,x.style.top=`${b}px`,x.style.zIndex="1000",x.focus()}Object.defineProperty(l,"__esModule",{value:!0}),l.rightClickHandler=l.moveTextAreaUnderMouseCursor=l.paste=l.handlePasteEvent=l.copyHandler=l.bracketTextForPaste=l.prepareTextForTerminal=void 0,l.prepareTextForTerminal=u,l.bracketTextForPaste=f,l.copyHandler=function(_,x){_.clipboardData&&_.clipboardData.setData("text/plain",x.selectionText),_.preventDefault()},l.handlePasteEvent=function(_,x,C,w){_.stopPropagation(),_.clipboardData&&p(_.clipboardData.getData("text/plain"),x,C,w)},l.paste=p,l.moveTextAreaUnderMouseCursor=h,l.rightClickHandler=function(_,x,C,w,v){h(_,x,C),v&&w.rightClickSelect(_),x.value=w.selectionText,x.select()}},7239:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorContrastCache=void 0;const f=u(1505);l.ColorContrastCache=class{constructor(){this._color=new f.TwoKeyMap,this._css=new f.TwoKeyMap}setCss(p,h,_){this._css.set(p,h,_)}getCss(p,h){return this._css.get(p,h)}setColor(p,h,_){this._color.set(p,h,_)}getColor(p,h){return this._color.get(p,h)}clear(){this._color.clear(),this._css.clear()}}},3656:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.addDisposableDomListener=void 0,l.addDisposableDomListener=function(u,f,p,h){u.addEventListener(f,p,h);let _=!1;return{dispose:()=>{_||(_=!0,u.removeEventListener(f,p,h))}}}},3551:function(c,l,u){var f=this&&this.__decorate||function(b,y,S,k){var T,R=arguments.length,D=R<3?y:k===null?k=Object.getOwnPropertyDescriptor(y,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(b,y,S,k);else for(var A=b.length-1;A>=0;A--)(T=b[A])&&(D=(R<3?T(D):R>3?T(y,S,D):T(y,S))||D);return R>3&&D&&Object.defineProperty(y,S,D),D},p=this&&this.__param||function(b,y){return function(S,k){y(S,k,b)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Linkifier=void 0;const h=u(3656),_=u(8460),x=u(844),C=u(2585),w=u(4725);let v=l.Linkifier=class extends x.Disposable{get currentLink(){return this._currentLink}constructor(b,y,S,k,T){super(),this._element=b,this._mouseService=y,this._renderService=S,this._bufferService=k,this._linkProviderService=T,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new _.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new _.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,x.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,x.toDisposable)((()=>{var R;this._lastMouseEvent=void 0,(R=this._activeProviderReplies)==null||R.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,h.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,h.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(b){this._lastMouseEvent=b;const y=this._positionFromMouseEvent(b,this._element,this._mouseService);if(!y)return;this._isMouseOut=!1;const S=b.composedPath();for(let k=0;k<S.length;k++){const T=S[k];if(T.classList.contains("xterm"))break;if(T.classList.contains("xterm-hover"))return}this._lastBufferCell&&y.x===this._lastBufferCell.x&&y.y===this._lastBufferCell.y||(this._handleHover(y),this._lastBufferCell=y)}_handleHover(b){if(this._activeLine!==b.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(b,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,b)||(this._clearCurrentLink(),this._askForLink(b,!0))}_askForLink(b,y){var k,T;this._activeProviderReplies&&y||((k=this._activeProviderReplies)==null||k.forEach((R=>{R==null||R.forEach((D=>{D.link.dispose&&D.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=b.y);let S=!1;for(const[R,D]of this._linkProviderService.linkProviders.entries())y?(T=this._activeProviderReplies)!=null&&T.get(R)&&(S=this._checkLinkProviderResult(R,b,S)):D.provideLinks(b.y,(A=>{var O,P;if(this._isMouseOut)return;const j=A==null?void 0:A.map(($=>({link:$})));(O=this._activeProviderReplies)==null||O.set(R,j),S=this._checkLinkProviderResult(R,b,S),((P=this._activeProviderReplies)==null?void 0:P.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(b.y,this._activeProviderReplies)}))}_removeIntersectingLinks(b,y){const S=new Set;for(let k=0;k<y.size;k++){const T=y.get(k);if(T)for(let R=0;R<T.length;R++){const D=T[R],A=D.link.range.start.y<b?0:D.link.range.start.x,j=D.link.range.end.y>b?this._bufferService.cols:D.link.range.end.x;for(let O=A;O<=j;O++){if(S.has(O)){T.splice(R--,1);break}S.add(O)}}}}_checkLinkProviderResult(b,y,S){var R;if(!this._activeProviderReplies)return S;const k=this._activeProviderReplies.get(b);let T=!1;for(let D=0;D<b;D++)this._activeProviderReplies.has(D)&&!this._activeProviderReplies.get(D)||(T=!0);if(!T&&k){const D=k.find((A=>this._linkAtPosition(A.link,y)));D&&(S=!0,this._handleNewLink(D))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!S)for(let D=0;D<this._activeProviderReplies.size;D++){const A=(R=this._activeProviderReplies.get(D))==null?void 0:R.find((j=>this._linkAtPosition(j.link,y)));if(A){S=!0,this._handleNewLink(A);break}}return S}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(b){if(!this._currentLink)return;const y=this._positionFromMouseEvent(b,this._element,this._mouseService);y&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,y)&&this._currentLink.link.activate(b,this._currentLink.link.text)}_clearCurrentLink(b,y){this._currentLink&&this._lastMouseEvent&&(!b||!y||this._currentLink.link.range.start.y>=b&&this._currentLink.link.range.end.y<=y)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,x.disposeArray)(this._linkCacheDisposables))}_handleNewLink(b){if(!this._lastMouseEvent)return;const y=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);y&&this._linkAtPosition(b.link,y)&&(this._currentLink=b,this._currentLink.state={decorations:{underline:b.link.decorations===void 0||b.link.decorations.underline,pointerCursor:b.link.decorations===void 0||b.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,b.link,this._lastMouseEvent),b.link.decorations={},Object.defineProperties(b.link.decorations,{pointerCursor:{get:()=>{var S,k;return(k=(S=this._currentLink)==null?void 0:S.state)==null?void 0:k.decorations.pointerCursor},set:S=>{var k;(k=this._currentLink)!=null&&k.state&&this._currentLink.state.decorations.pointerCursor!==S&&(this._currentLink.state.decorations.pointerCursor=S,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",S))}},underline:{get:()=>{var S,k;return(k=(S=this._currentLink)==null?void 0:S.state)==null?void 0:k.decorations.underline},set:S=>{var k,T,R;(k=this._currentLink)!=null&&k.state&&((R=(T=this._currentLink)==null?void 0:T.state)==null?void 0:R.decorations.underline)!==S&&(this._currentLink.state.decorations.underline=S,this._currentLink.state.isHovered&&this._fireUnderlineEvent(b.link,S))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((S=>{if(!this._currentLink)return;const k=S.start===0?0:S.start+1+this._bufferService.buffer.ydisp,T=this._bufferService.buffer.ydisp+1+S.end;if(this._currentLink.link.range.start.y>=k&&this._currentLink.link.range.end.y<=T&&(this._clearCurrentLink(k,T),this._lastMouseEvent)){const R=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);R&&this._askForLink(R,!1)}}))))}_linkHover(b,y,S){var k;(k=this._currentLink)!=null&&k.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(y,!0),this._currentLink.state.decorations.pointerCursor&&b.classList.add("xterm-cursor-pointer")),y.hover&&y.hover(S,y.text)}_fireUnderlineEvent(b,y){const S=b.range,k=this._bufferService.buffer.ydisp,T=this._createLinkUnderlineEvent(S.start.x-1,S.start.y-k-1,S.end.x,S.end.y-k-1,void 0);(y?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(T)}_linkLeave(b,y,S){var k;(k=this._currentLink)!=null&&k.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(y,!1),this._currentLink.state.decorations.pointerCursor&&b.classList.remove("xterm-cursor-pointer")),y.leave&&y.leave(S,y.text)}_linkAtPosition(b,y){const S=b.range.start.y*this._bufferService.cols+b.range.start.x,k=b.range.end.y*this._bufferService.cols+b.range.end.x,T=y.y*this._bufferService.cols+y.x;return S<=T&&T<=k}_positionFromMouseEvent(b,y,S){const k=S.getCoords(b,y,this._bufferService.cols,this._bufferService.rows);if(k)return{x:k[0],y:k[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(b,y,S,k,T){return{x1:b,y1:y,x2:S,y2:k,cols:this._bufferService.cols,fg:T}}};l.Linkifier=v=f([p(1,w.IMouseService),p(2,w.IRenderService),p(3,C.IBufferService),p(4,w.ILinkProviderService)],v)},9042:(c,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(c,l,u){var f=this&&this.__decorate||function(w,v,b,y){var S,k=arguments.length,T=k<3?v:y===null?y=Object.getOwnPropertyDescriptor(v,b):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(w,v,b,y);else for(var R=w.length-1;R>=0;R--)(S=w[R])&&(T=(k<3?S(T):k>3?S(v,b,T):S(v,b))||T);return k>3&&T&&Object.defineProperty(v,b,T),T},p=this&&this.__param||function(w,v){return function(b,y){v(b,y,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkProvider=void 0;const h=u(511),_=u(2585);let x=l.OscLinkProvider=class{constructor(w,v,b){this._bufferService=w,this._optionsService=v,this._oscLinkService=b}provideLinks(w,v){var j;const b=this._bufferService.buffer.lines.get(w-1);if(!b)return void v(void 0);const y=[],S=this._optionsService.rawOptions.linkHandler,k=new h.CellData,T=b.getTrimmedLength();let R=-1,D=-1,A=!1;for(let O=0;O<T;O++)if(D!==-1||b.hasContent(O)){if(b.loadCell(O,k),k.hasExtendedAttrs()&&k.extended.urlId){if(D===-1){D=O,R=k.extended.urlId;continue}A=k.extended.urlId!==R}else D!==-1&&(A=!0);if(A||D!==-1&&O===T-1){const P=(j=this._oscLinkService.getLinkData(R))==null?void 0:j.uri;if(P){const $={start:{x:D+1,y:w},end:{x:O+(A||O!==T-1?0:1),y:w}};let U=!1;if(!(S!=null&&S.allowNonHttpProtocols))try{const W=new URL(P);["http:","https:"].includes(W.protocol)||(U=!0)}catch{U=!0}U||y.push({text:P,range:$,activate:(W,K)=>S?S.activate(W,K,$):C(0,K),hover:(W,K)=>{var V;return(V=S==null?void 0:S.hover)==null?void 0:V.call(S,W,K,$)},leave:(W,K)=>{var V;return(V=S==null?void 0:S.leave)==null?void 0:V.call(S,W,K,$)}})}A=!1,k.hasExtendedAttrs()&&k.extended.urlId?(D=O,R=k.extended.urlId):(D=-1,R=-1)}}v(y)}};function C(w,v){if(confirm(`Do you want to navigate to ${v}?
522
+
523
+ WARNING: This link could potentially be dangerous`)){const b=window.open();if(b){try{b.opener=null}catch{}b.location.href=v}else console.warn("Opening link blocked as opener could not be cleared")}}l.OscLinkProvider=x=f([p(0,_.IBufferService),p(1,_.IOptionsService),p(2,_.IOscLinkService)],x)},6193:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.RenderDebouncer=void 0,l.RenderDebouncer=class{constructor(u,f){this._renderCallback=u,this._coreBrowserService=f,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(u,f,p){this._rowCount=p,u=u!==void 0?u:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const u=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,f),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const f=u(3614),p=u(3656),h=u(3551),_=u(9042),x=u(3730),C=u(1680),w=u(3107),v=u(5744),b=u(2950),y=u(1296),S=u(428),k=u(4269),T=u(5114),R=u(8934),D=u(3230),A=u(9312),j=u(4725),O=u(6731),P=u(8055),$=u(8969),U=u(8460),W=u(844),K=u(6114),V=u(8437),Q=u(2584),X=u(7399),I=u(5941),L=u(9074),z=u(2585),F=u(5435),B=u(4567),Y=u(779);class ee extends $.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=K,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new W.MutableDisposable),this._onCursorMove=this.register(new U.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new U.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new U.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new U.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new U.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new U.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new U.EventEmitter),this._onBlur=this.register(new U.EventEmitter),this._onA11yCharEmitter=this.register(new U.EventEmitter),this._onA11yTabEmitter=this.register(new U.EventEmitter),this._onWillOpen=this.register(new U.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(L.DecorationService),this._instantiationService.setService(z.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Y.LinkProviderService),this._instantiationService.setService(j.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(x.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((q,te)=>this.refresh(q,te)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((q=>this._reportWindowsOptions(q)))),this.register(this._inputHandler.onColor((q=>this._handleColorEvent(q)))),this.register((0,U.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,U.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,U.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,U.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((q=>this._afterResize(q.cols,q.rows)))),this.register((0,W.toDisposable)((()=>{var q,te;this._customKeyEventHandler=void 0,(te=(q=this.element)==null?void 0:q.parentNode)==null||te.removeChild(this.element)})))}_handleColorEvent(G){if(this._themeService)for(const q of G){let te,re="";switch(q.index){case 256:te="foreground",re="10";break;case 257:te="background",re="11";break;case 258:te="cursor",re="12";break;default:te="ansi",re="4;"+q.index}switch(q.type){case 0:const oe=P.color.toColorRGB(te==="ansi"?this._themeService.colors.ansi[q.index]:this._themeService.colors[te]);this.coreService.triggerDataEvent(`${Q.C0.ESC}]${re};${(0,I.toRgbString)(oe)}${Q.C1_ESCAPED.ST}`);break;case 1:if(te==="ansi")this._themeService.modifyColors((se=>se.ansi[q.index]=P.channels.toColor(...q.color)));else{const se=te;this._themeService.modifyColors((ye=>ye[se]=P.channels.toColor(...q.color)))}break;case 2:this._themeService.restoreColor(q.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(B.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(G){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Q.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(Q.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const G=this.buffer.ybase+this.buffer.y,q=this.buffer.lines.get(G);if(!q)return;const te=Math.min(this.buffer.x,this.cols-1),re=this._renderService.dimensions.css.cell.height,oe=q.getWidth(te),se=this._renderService.dimensions.css.cell.width*oe,ye=this.buffer.y*this._renderService.dimensions.css.cell.height,Ee=te*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Ee+"px",this.textarea.style.top=ye+"px",this.textarea.style.width=se+"px",this.textarea.style.height=re+"px",this.textarea.style.lineHeight=re+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,p.addDisposableDomListener)(this.element,"copy",(q=>{this.hasSelection()&&(0,f.copyHandler)(q,this._selectionService)})));const G=q=>(0,f.handlePasteEvent)(q,this.textarea,this.coreService,this.optionsService);this.register((0,p.addDisposableDomListener)(this.textarea,"paste",G)),this.register((0,p.addDisposableDomListener)(this.element,"paste",G)),K.isFirefox?this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(q=>{q.button===2&&(0,f.rightClickHandler)(q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,p.addDisposableDomListener)(this.element,"contextmenu",(q=>{(0,f.rightClickHandler)(q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),K.isLinux&&this.register((0,p.addDisposableDomListener)(this.element,"auxclick",(q=>{q.button===1&&(0,f.moveTextAreaUnderMouseCursor)(q,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,p.addDisposableDomListener)(this.textarea,"keyup",(G=>this._keyUp(G)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keydown",(G=>this._keyDown(G)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keypress",(G=>this._keyPress(G)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionupdate",(G=>this._compositionHelper.compositionupdate(G)))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,p.addDisposableDomListener)(this.textarea,"input",(G=>this._inputEvent(G)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(G){var te,re,oe;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"),((te=this.element)==null?void 0:te.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 q=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),q.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,p.addDisposableDomListener)(this.screenElement,"mousemove",(se=>this.updateCursorStyle(se)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),q.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",_.promptLabel),K.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(T.CoreBrowserService,this.textarea,(re=G.ownerDocument.defaultView)!=null?re:window,((oe=this._document)!=null?oe:typeof window<"u")?window.document:null)),this._instantiationService.setService(j.ICoreBrowserService,this._coreBrowserService),this.register((0,p.addDisposableDomListener)(this.textarea,"focus",(se=>this._handleTextAreaFocus(se)))),this.register((0,p.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(S.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(j.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(O.ThemeService),this._instantiationService.setService(j.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(k.CharacterJoinerService),this._instantiationService.setService(j.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(D.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(j.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((se=>this._onRender.fire(se)))),this.onResize((se=>this._renderService.resize(se.cols,se.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(b.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(R.MouseService),this._instantiationService.setService(j.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(h.Linkifier,this.screenElement)),this.element.appendChild(q);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(C.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((se=>this.scrollLines(se.amount,se.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(A.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(j.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((se=>this.scrollLines(se.amount,se.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((se=>this._renderService.handleSelectionChanged(se.start,se.end,se.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((se=>{this.textarea.value=se,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((se=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(w.BufferDecorationRenderer,this.screenElement)),this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(se=>this._selectionService.handleMouseDown(se)))),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(B.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(se=>this._handleScreenReaderModeOptionChange(se)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(se=>{!this._overviewRulerRenderer&&se&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(y.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const G=this,q=this.element;function te(se){const ye=G._mouseService.getMouseReportCoords(se,G.screenElement);if(!ye)return!1;let Ee,Ae;switch(se.overrideType||se.type){case"mousemove":Ae=32,se.buttons===void 0?(Ee=3,se.button!==void 0&&(Ee=se.button<3?se.button:3)):Ee=1&se.buttons?0:4&se.buttons?1:2&se.buttons?2:3;break;case"mouseup":Ae=0,Ee=se.button<3?se.button:3;break;case"mousedown":Ae=1,Ee=se.button<3?se.button:3;break;case"wheel":if(G._customWheelEventHandler&&G._customWheelEventHandler(se)===!1||G.viewport.getLinesScrolled(se)===0)return!1;Ae=se.deltaY<0?0:1,Ee=4;break;default:return!1}return!(Ae===void 0||Ee===void 0||Ee>4)&&G.coreMouseService.triggerMouseEvent({col:ye.col,row:ye.row,x:ye.x,y:ye.y,button:Ee,action:Ae,ctrl:se.ctrlKey,alt:se.altKey,shift:se.shiftKey})}const re={mouseup:null,wheel:null,mousedrag:null,mousemove:null},oe={mouseup:se=>(te(se),se.buttons||(this._document.removeEventListener("mouseup",re.mouseup),re.mousedrag&&this._document.removeEventListener("mousemove",re.mousedrag)),this.cancel(se)),wheel:se=>(te(se),this.cancel(se,!0)),mousedrag:se=>{se.buttons&&te(se)},mousemove:se=>{se.buttons||te(se)}};this.register(this.coreMouseService.onProtocolChange((se=>{se?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(se)),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&se?re.mousemove||(q.addEventListener("mousemove",oe.mousemove),re.mousemove=oe.mousemove):(q.removeEventListener("mousemove",re.mousemove),re.mousemove=null),16&se?re.wheel||(q.addEventListener("wheel",oe.wheel,{passive:!1}),re.wheel=oe.wheel):(q.removeEventListener("wheel",re.wheel),re.wheel=null),2&se?re.mouseup||(re.mouseup=oe.mouseup):(this._document.removeEventListener("mouseup",re.mouseup),re.mouseup=null),4&se?re.mousedrag||(re.mousedrag=oe.mousedrag):(this._document.removeEventListener("mousemove",re.mousedrag),re.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,p.addDisposableDomListener)(q,"mousedown",(se=>{if(se.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(se))return te(se),re.mouseup&&this._document.addEventListener("mouseup",re.mouseup),re.mousedrag&&this._document.addEventListener("mousemove",re.mousedrag),this.cancel(se)}))),this.register((0,p.addDisposableDomListener)(q,"wheel",(se=>{if(!re.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(se)===!1)return!1;if(!this.buffer.hasScrollback){const ye=this.viewport.getLinesScrolled(se);if(ye===0)return;const Ee=Q.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(se.deltaY<0?"A":"B");let Ae="";for(let Be=0;Be<Math.abs(ye);Be++)Ae+=Ee;return this.coreService.triggerDataEvent(Ae,!0),this.cancel(se,!0)}return this.viewport.handleWheel(se)?this.cancel(se):void 0}}),{passive:!1})),this.register((0,p.addDisposableDomListener)(q,"touchstart",(se=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(se),this.cancel(se)}),{passive:!0})),this.register((0,p.addDisposableDomListener)(q,"touchmove",(se=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(se)?void 0:this.cancel(se)}),{passive:!1}))}refresh(G,q){var te;(te=this._renderService)==null||te.refreshRows(G,q)}updateCursorStyle(G){var q;(q=this._selectionService)!=null&&q.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,q,te=0){var re;te===1?(super.scrollLines(G,q,te),this.refresh(0,this.rows-1)):(re=this.viewport)==null||re.scrollLines(G)}paste(G){(0,f.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 q=this._characterJoinerService.register(G);return this.refresh(0,this.rows-1),q}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,q,te){this._selectionService.setSelection(G,q,te)}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,q){var te;(te=this._selectionService)==null||te.selectLines(G,q)}_keyDown(G){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(G)===!1)return!1;const q=this.browser.isMac&&this.options.macOptionIsMeta&&G.altKey;if(!q&&!this._compositionHelper.keydown(G))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;q||G.key!=="Dead"&&G.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const te=(0,X.evaluateKeyboardEvent)(G,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(G),te.type===3||te.type===2){const re=this.rows-1;return this.scrollLines(te.type===2?-re:re),this.cancel(G,!0)}return te.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,G)||(te.cancel&&this.cancel(G,!0),!te.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):(te.key!==Q.C0.ETX&&te.key!==Q.C0.CR||(this.textarea.value=""),this._onKey.fire({key:te.key,domEvent:G}),this._showCursor(),this.coreService.triggerDataEvent(te.key,!0),!this.optionsService.rawOptions.screenReaderMode||G.altKey||G.ctrlKey?this.cancel(G,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(G,q){const te=G.isMac&&!this.options.macOptionIsMeta&&q.altKey&&!q.ctrlKey&&!q.metaKey||G.isWindows&&q.altKey&&q.ctrlKey&&!q.metaKey||G.isWindows&&q.getModifierState("AltGraph");return q.type==="keypress"?te:te&&(!q.keyCode||q.keyCode>47)}_keyUp(G){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(G)===!1||((function(q){return q.keyCode===16||q.keyCode===17||q.keyCode===18})(G)||this.focus(),this.updateCursorStyle(G),this._keyPressHandled=!1)}_keyPress(G){let q;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(G)===!1)return!1;if(this.cancel(G),G.charCode)q=G.charCode;else if(G.which===null||G.which===void 0)q=G.keyCode;else{if(G.which===0||G.charCode===0)return!1;q=G.which}return!(!q||(G.altKey||G.ctrlKey||G.metaKey)&&!this._isThirdLevelShift(this.browser,G)||(q=String.fromCharCode(q),this._onKey.fire({key:q,domEvent:G}),this._showCursor(),this.coreService.triggerDataEvent(q,!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 q=G.data;return this.coreService.triggerDataEvent(q,!0),this.cancel(G),!0}return!1}resize(G,q){G!==this.cols||q!==this.rows?super.resize(G,q):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(G,q){var te,re;(te=this._charSizeService)==null||te.measure(),(re=this.viewport)==null||re.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 q=1;q<this.rows;q++)this.buffer.lines.push(this.buffer.getBlankLine(V.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 q,te;this.options.rows=this.rows,this.options.cols=this.cols;const G=this._customKeyEventHandler;this._setup(),super.reset(),(q=this._selectionService)==null||q.reset(),this._decorationService.reset(),(te=this.viewport)==null||te.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(Q.C0.ESC+"[I"):this.coreService.triggerDataEvent(Q.C0.ESC+"[O")}_reportWindowsOptions(G){if(this._renderService)switch(G){case F.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const q=this._renderService.dimensions.css.canvas.width.toFixed(0),te=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${Q.C0.ESC}[4;${te};${q}t`);break;case F.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const re=this._renderService.dimensions.css.cell.width.toFixed(0),oe=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${Q.C0.ESC}[6;${oe};${re}t`)}}cancel(G,q){if(this.options.cancelEvents||q)return G.preventDefault(),G.stopPropagation(),!1}}l.Terminal=ee},9924:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TimeBasedDebouncer=void 0,l.TimeBasedDebouncer=class{constructor(u,f=1e3){this._renderCallback=u,this._debounceThresholdMS=f,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,f,p){this._rowCount=p,u=u!==void 0?u:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f;const h=Date.now();if(h-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=h,this._innerRefresh();else if(!this._additionalRefreshRequested){const _=h-this._lastRefreshMs,x=this._debounceThresholdMS-_;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),x)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,f)}}},1680:function(c,l,u){var f=this&&this.__decorate||function(b,y,S,k){var T,R=arguments.length,D=R<3?y:k===null?k=Object.getOwnPropertyDescriptor(y,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(b,y,S,k);else for(var A=b.length-1;A>=0;A--)(T=b[A])&&(D=(R<3?T(D):R>3?T(y,S,D):T(y,S))||D);return R>3&&D&&Object.defineProperty(y,S,D),D},p=this&&this.__param||function(b,y){return function(S,k){y(S,k,b)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Viewport=void 0;const h=u(3656),_=u(4725),x=u(8460),C=u(844),w=u(2585);let v=l.Viewport=class extends C.Disposable{constructor(b,y,S,k,T,R,D,A){super(),this._viewportElement=b,this._scrollArea=y,this._bufferService=S,this._optionsService=k,this._charSizeService=T,this._renderService=R,this._coreBrowserService=D,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new x.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,h.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(A.colors),this.register(A.onChangeColors((j=>this._handleThemeChange(j)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(b){this._viewportElement.style.backgroundColor=b.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(b){if(b)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 y=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==y&&(this._lastRecordedBufferHeight=y,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const b=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==b&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=b),this._refreshAnimationFrame=null}syncScrollArea(b=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(b);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(b)}_handleScroll(b){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 y=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:y,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const b=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(b*(this._smoothScrollState.target-this._smoothScrollState.origin)),b<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(b,y){const S=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(y<0&&this._viewportElement.scrollTop!==0||y>0&&S<this._lastRecordedBufferHeight)||(b.cancelable&&b.preventDefault(),!1)}handleWheel(b){const y=this._getPixelsScrolled(b);return y!==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+y:this._smoothScrollState.target+=y,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=y,this._bubbleScroll(b,y))}scrollLines(b){if(b!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const y=b*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+y,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:b,suppressScrollEvent:!1})}_getPixelsScrolled(b){if(b.deltaY===0||b.shiftKey)return 0;let y=this._applyScrollModifier(b.deltaY,b);return b.deltaMode===WheelEvent.DOM_DELTA_LINE?y*=this._currentRowHeight:b.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(y*=this._currentRowHeight*this._bufferService.rows),y}getBufferElements(b,y){var A;let S,k="";const T=[],R=y!=null?y:this._bufferService.buffer.lines.length,D=this._bufferService.buffer.lines;for(let j=b;j<R;j++){const O=D.get(j);if(!O)continue;const P=(A=D.get(j+1))==null?void 0:A.isWrapped;if(k+=O.translateToString(!P),!P||j===D.length-1){const $=document.createElement("div");$.textContent=k,T.push($),k.length>0&&(S=$),k=""}}return{bufferElements:T,cursorElement:S}}getLinesScrolled(b){if(b.deltaY===0||b.shiftKey)return 0;let y=this._applyScrollModifier(b.deltaY,b);return b.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(y/=this._currentRowHeight+0,this._wheelPartialScroll+=y,y=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):b.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(y*=this._bufferService.rows),y}_applyScrollModifier(b,y){const S=this._optionsService.rawOptions.fastScrollModifier;return S==="alt"&&y.altKey||S==="ctrl"&&y.ctrlKey||S==="shift"&&y.shiftKey?b*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:b*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(b){this._lastTouchY=b.touches[0].pageY}handleTouchMove(b){const y=this._lastTouchY-b.touches[0].pageY;return this._lastTouchY=b.touches[0].pageY,y!==0&&(this._viewportElement.scrollTop+=y,this._bubbleScroll(b,y))}};l.Viewport=v=f([p(2,w.IBufferService),p(3,w.IOptionsService),p(4,_.ICharSizeService),p(5,_.IRenderService),p(6,_.ICoreBrowserService),p(7,_.IThemeService)],v)},3107:function(c,l,u){var f=this&&this.__decorate||function(w,v,b,y){var S,k=arguments.length,T=k<3?v:y===null?y=Object.getOwnPropertyDescriptor(v,b):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(w,v,b,y);else for(var R=w.length-1;R>=0;R--)(S=w[R])&&(T=(k<3?S(T):k>3?S(v,b,T):S(v,b))||T);return k>3&&T&&Object.defineProperty(v,b,T),T},p=this&&this.__param||function(w,v){return function(b,y){v(b,y,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferDecorationRenderer=void 0;const h=u(4725),_=u(844),x=u(2585);let C=l.BufferDecorationRenderer=class extends _.Disposable{constructor(w,v,b,y,S){super(),this._screenElement=w,this._bufferService=v,this._coreBrowserService=b,this._decorationService=y,this._renderService=S,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((k=>this._removeDecoration(k)))),this.register((0,_.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 w of this._decorationService.decorations)this._renderDecoration(w);this._dimensionsChanged=!1}_renderDecoration(w){this._refreshStyle(w),this._dimensionsChanged&&this._refreshXPosition(w)}_createElement(w){var y,S;const v=this._coreBrowserService.mainDocument.createElement("div");v.classList.add("xterm-decoration"),v.classList.toggle("xterm-decoration-top-layer",((y=w==null?void 0:w.options)==null?void 0:y.layer)==="top"),v.style.width=`${Math.round((w.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,v.style.height=(w.options.height||1)*this._renderService.dimensions.css.cell.height+"px",v.style.top=(w.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",v.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const b=(S=w.options.x)!=null?S:0;return b&&b>this._bufferService.cols&&(v.style.display="none"),this._refreshXPosition(w,v),v}_refreshStyle(w){const v=w.marker.line-this._bufferService.buffers.active.ydisp;if(v<0||v>=this._bufferService.rows)w.element&&(w.element.style.display="none",w.onRenderEmitter.fire(w.element));else{let b=this._decorationElements.get(w);b||(b=this._createElement(w),w.element=b,this._decorationElements.set(w,b),this._container.appendChild(b),w.onDispose((()=>{this._decorationElements.delete(w),b.remove()}))),b.style.top=v*this._renderService.dimensions.css.cell.height+"px",b.style.display=this._altBufferIsActive?"none":"block",w.onRenderEmitter.fire(b)}}_refreshXPosition(w,v=w.element){var y;if(!v)return;const b=(y=w.options.x)!=null?y:0;(w.options.anchor||"left")==="right"?v.style.right=b?b*this._renderService.dimensions.css.cell.width+"px":"":v.style.left=b?b*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(w){var v;(v=this._decorationElements.get(w))==null||v.remove(),this._decorationElements.delete(w),w.dispose()}};l.BufferDecorationRenderer=C=f([p(1,x.IBufferService),p(2,h.ICoreBrowserService),p(3,x.IDecorationService),p(4,h.IRenderService)],C)},5871:(c,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(u){if(u.options.overviewRulerOptions){for(const f of this._zones)if(f.color===u.options.overviewRulerOptions.color&&f.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(f,u.marker.line))return;if(this._lineAdjacentToZone(f,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(f,u.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=u.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=u.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=u.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=u.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:u.options.overviewRulerOptions.color,position:u.options.overviewRulerOptions.position,startBufferLine:u.marker.line,endBufferLine:u.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(u){this._linePadding=u}_lineIntersectsZone(u,f){return f>=u.startBufferLine&&f<=u.endBufferLine}_lineAdjacentToZone(u,f,p){return f>=u.startBufferLine-this._linePadding[p||"full"]&&f<=u.endBufferLine+this._linePadding[p||"full"]}_addLineToZone(u,f){u.startBufferLine=Math.min(u.startBufferLine,f),u.endBufferLine=Math.max(u.endBufferLine,f)}}},5744:function(c,l,u){var f=this&&this.__decorate||function(S,k,T,R){var D,A=arguments.length,j=A<3?k:R===null?R=Object.getOwnPropertyDescriptor(k,T):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(S,k,T,R);else for(var O=S.length-1;O>=0;O--)(D=S[O])&&(j=(A<3?D(j):A>3?D(k,T,j):D(k,T))||j);return A>3&&j&&Object.defineProperty(k,T,j),j},p=this&&this.__param||function(S,k){return function(T,R){k(T,R,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OverviewRulerRenderer=void 0;const h=u(5871),_=u(4725),x=u(844),C=u(2585),w={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0},b={full:0,left:0,center:0,right:0};let y=l.OverviewRulerRenderer=class extends x.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(S,k,T,R,D,A,j){var P;super(),this._viewportElement=S,this._screenElement=k,this._bufferService=T,this._decorationService=R,this._renderService=D,this._optionsService=A,this._coreBrowserService=j,this._colorZoneStore=new h.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(),(P=this._viewportElement.parentElement)==null||P.insertBefore(this._canvas,this._viewportElement);const O=this._canvas.getContext("2d");if(!O)throw new Error("Ctx cannot be null");this._ctx=O,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,x.toDisposable)((()=>{var $;($=this._canvas)==null||$.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 S=Math.floor(this._canvas.width/3),k=Math.ceil(this._canvas.width/3);v.full=this._canvas.width,v.left=S,v.center=k,v.right=S,this._refreshDrawHeightConstants(),b.full=0,b.left=0,b.center=v.left,b.right=v.left+v.center}_refreshDrawHeightConstants(){w.full=Math.round(2*this._coreBrowserService.dpr);const S=this._canvas.height/this._bufferService.buffer.lines.length,k=Math.round(Math.max(Math.min(S,12),6)*this._coreBrowserService.dpr);w.left=k,w.center=k,w.right=k}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.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 k of this._decorationService.decorations)this._colorZoneStore.addDecoration(k);this._ctx.lineWidth=1;const S=this._colorZoneStore.zones;for(const k of S)k.position!=="full"&&this._renderColorZone(k);for(const k of S)k.position==="full"&&this._renderColorZone(k);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(S){this._ctx.fillStyle=S.color,this._ctx.fillRect(b[S.position||"full"],Math.round((this._canvas.height-1)*(S.startBufferLine/this._bufferService.buffers.active.lines.length)-w[S.position||"full"]/2),v[S.position||"full"],Math.round((this._canvas.height-1)*((S.endBufferLine-S.startBufferLine)/this._bufferService.buffers.active.lines.length)+w[S.position||"full"]))}_queueRefresh(S,k){this._shouldUpdateDimensions=S||this._shouldUpdateDimensions,this._shouldUpdateAnchor=k||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};l.OverviewRulerRenderer=y=f([p(2,C.IBufferService),p(3,C.IDecorationService),p(4,_.IRenderService),p(5,C.IOptionsService),p(6,_.ICoreBrowserService)],y)},2950:function(c,l,u){var f=this&&this.__decorate||function(w,v,b,y){var S,k=arguments.length,T=k<3?v:y===null?y=Object.getOwnPropertyDescriptor(v,b):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(w,v,b,y);else for(var R=w.length-1;R>=0;R--)(S=w[R])&&(T=(k<3?S(T):k>3?S(v,b,T):S(v,b))||T);return k>3&&T&&Object.defineProperty(v,b,T),T},p=this&&this.__param||function(w,v){return function(b,y){v(b,y,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CompositionHelper=void 0;const h=u(4725),_=u(2585),x=u(2584);let C=l.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(w,v,b,y,S,k){this._textarea=w,this._compositionView=v,this._bufferService=b,this._optionsService=y,this._coreService=S,this._renderService=k,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(w){this._compositionView.textContent=w.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(w){if(this._isComposing||this._isSendingComposition){if(w.keyCode===229||w.keyCode===16||w.keyCode===17||w.keyCode===18)return!1;this._finalizeComposition(!1)}return w.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(w){if(this._compositionView.classList.remove("active"),this._isComposing=!1,w){const v={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let b;this._isSendingComposition=!1,v.start+=this._dataAlreadySent.length,b=this._isComposing?this._textarea.value.substring(v.start,v.end):this._textarea.value.substring(v.start),b.length>0&&this._coreService.triggerDataEvent(b,!0)}}),0)}else{this._isSendingComposition=!1;const v=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(v,!0)}}_handleAnyTextareaChanges(){const w=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const v=this._textarea.value,b=v.replace(w,"");this._dataAlreadySent=b,v.length>w.length?this._coreService.triggerDataEvent(b,!0):v.length<w.length?this._coreService.triggerDataEvent(`${x.C0.DEL}`,!0):v.length===w.length&&v!==w&&this._coreService.triggerDataEvent(v,!0)}}),0)}updateCompositionElements(w){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const v=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),b=this._renderService.dimensions.css.cell.height,y=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,S=v*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=S+"px",this._compositionView.style.top=y+"px",this._compositionView.style.height=b+"px",this._compositionView.style.lineHeight=b+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const k=this._compositionView.getBoundingClientRect();this._textarea.style.left=S+"px",this._textarea.style.top=y+"px",this._textarea.style.width=Math.max(k.width,1)+"px",this._textarea.style.height=Math.max(k.height,1)+"px",this._textarea.style.lineHeight=k.height+"px"}w||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};l.CompositionHelper=C=f([p(2,_.IBufferService),p(3,_.IOptionsService),p(4,_.ICoreService),p(5,h.IRenderService)],C)},9806:(c,l)=>{function u(f,p,h){const _=h.getBoundingClientRect(),x=f.getComputedStyle(h),C=parseInt(x.getPropertyValue("padding-left")),w=parseInt(x.getPropertyValue("padding-top"));return[p.clientX-_.left-C,p.clientY-_.top-w]}Object.defineProperty(l,"__esModule",{value:!0}),l.getCoords=l.getCoordsRelativeToElement=void 0,l.getCoordsRelativeToElement=u,l.getCoords=function(f,p,h,_,x,C,w,v,b){if(!C)return;const y=u(f,p,h);return y?(y[0]=Math.ceil((y[0]+(b?w/2:0))/w),y[1]=Math.ceil(y[1]/v),y[0]=Math.min(Math.max(y[0],1),_+(b?1:0)),y[1]=Math.min(Math.max(y[1],1),x),y):void 0}},9504:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.moveToCellSequence=void 0;const f=u(2584);function p(v,b,y,S){const k=v-h(v,y),T=b-h(b,y),R=Math.abs(k-T)-(function(D,A,j){let O=0;const P=D-h(D,j),$=A-h(A,j);for(let U=0;U<Math.abs(P-$);U++){const W=_(D,A)==="A"?-1:1,K=j.buffer.lines.get(P+W*U);K!=null&&K.isWrapped&&O++}return O})(v,b,y);return w(R,C(_(v,b),S))}function h(v,b){let y=0,S=b.buffer.lines.get(v),k=S==null?void 0:S.isWrapped;for(;k&&v>=0&&v<b.rows;)y++,S=b.buffer.lines.get(--v),k=S==null?void 0:S.isWrapped;return y}function _(v,b){return v>b?"A":"B"}function x(v,b,y,S,k,T){let R=v,D=b,A="";for(;R!==y||D!==S;)R+=k?1:-1,k&&R>T.cols-1?(A+=T.buffer.translateBufferLineToString(D,!1,v,R),R=0,v=0,D++):!k&&R<0&&(A+=T.buffer.translateBufferLineToString(D,!1,0,v+1),R=T.cols-1,v=R,D--);return A+T.buffer.translateBufferLineToString(D,!1,v,R)}function C(v,b){const y=b?"O":"[";return f.C0.ESC+y+v}function w(v,b){v=Math.floor(v);let y="";for(let S=0;S<v;S++)y+=b;return y}l.moveToCellSequence=function(v,b,y,S){const k=y.buffer.x,T=y.buffer.y;if(!y.buffer.hasScrollback)return(function(A,j,O,P,$,U){return p(j,P,$,U).length===0?"":w(x(A,j,A,j-h(j,$),!1,$).length,C("D",U))})(k,T,0,b,y,S)+p(T,b,y,S)+(function(A,j,O,P,$,U){let W;W=p(j,P,$,U).length>0?P-h(P,$):j;const K=P,V=(function(Q,X,I,L,z,F){let B;return B=p(I,L,z,F).length>0?L-h(L,z):X,Q<I&&B<=L||Q>=I&&B<L?"C":"D"})(A,j,O,P,$,U);return w(x(A,W,O,K,V==="C",$).length,C(V,U))})(k,T,v,b,y,S);let R;if(T===b)return R=k>v?"D":"C",w(Math.abs(k-v),C(R,S));R=T>b?"D":"C";const D=Math.abs(T-b);return w((function(A,j){return j.cols-A})(T>b?v:k,y)+(D-1)*y.cols+1+((T>b?k:v)-1),C(R,S))}},1296:function(c,l,u){var f=this&&this.__decorate||function(U,W,K,V){var Q,X=arguments.length,I=X<3?W:V===null?V=Object.getOwnPropertyDescriptor(W,K):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(U,W,K,V);else for(var L=U.length-1;L>=0;L--)(Q=U[L])&&(I=(X<3?Q(I):X>3?Q(W,K,I):Q(W,K))||I);return X>3&&I&&Object.defineProperty(W,K,I),I},p=this&&this.__param||function(U,W){return function(K,V){W(K,V,U)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRenderer=void 0;const h=u(3787),_=u(2550),x=u(2223),C=u(6171),w=u(6052),v=u(4725),b=u(8055),y=u(8460),S=u(844),k=u(2585),T="xterm-dom-renderer-owner-",R="xterm-rows",D="xterm-fg-",A="xterm-bg-",j="xterm-focus",O="xterm-selection";let P=1,$=l.DomRenderer=class extends S.Disposable{constructor(U,W,K,V,Q,X,I,L,z,F,B,Y,ee){super(),this._terminal=U,this._document=W,this._element=K,this._screenElement=V,this._viewportElement=Q,this._helperContainer=X,this._linkifier2=I,this._charSizeService=z,this._optionsService=F,this._bufferService=B,this._coreBrowserService=Y,this._themeService=ee,this._terminalClass=P++,this._rowElements=[],this._selectionRenderModel=(0,w.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new y.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(R),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(O),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,C.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((J=>this._injectCss(J)))),this._injectCss(this._themeService.colors),this._rowFactory=L.createInstance(h.DomRendererRowFactory,document),this._element.classList.add(T+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((J=>this._handleLinkHover(J)))),this.register(this._linkifier2.onHideLinkUnderline((J=>this._handleLinkLeave(J)))),this.register((0,S.toDisposable)((()=>{this._element.classList.remove(T+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new _.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 U=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*U,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*U),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/U),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/U),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 K of this._rowElements)K.style.width=`${this.dimensions.css.canvas.width}px`,K.style.height=`${this.dimensions.css.cell.height}px`,K.style.lineHeight=`${this.dimensions.css.cell.height}px`,K.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const W=`${this._terminalSelector} .${R} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=W,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(U){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let W=`${this._terminalSelector} .${R} { color: ${U.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;W+=`${this._terminalSelector} .${R} .xterm-dim { color: ${b.color.multiplyOpacity(U.foreground,.5).css};}`,W+=`${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 K=`blink_underline_${this._terminalClass}`,V=`blink_bar_${this._terminalClass}`,Q=`blink_block_${this._terminalClass}`;W+=`@keyframes ${K} { 50% { border-bottom-style: hidden; }}`,W+=`@keyframes ${V} { 50% { box-shadow: none; }}`,W+=`@keyframes ${Q} { 0% { background-color: ${U.cursor.css}; color: ${U.cursorAccent.css}; } 50% { background-color: inherit; color: ${U.cursor.css}; }}`,W+=`${this._terminalSelector} .${R}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${K} 1s step-end infinite;}${this._terminalSelector} .${R}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${V} 1s step-end infinite;}${this._terminalSelector} .${R}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${Q} 1s step-end infinite;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block { background-color: ${U.cursor.css}; color: ${U.cursorAccent.css};}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${U.cursor.css} !important; color: ${U.cursorAccent.css} !important;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${U.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${U.cursor.css} inset;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${U.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,W+=`${this._terminalSelector} .${O} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${O} div { position: absolute; background-color: ${U.selectionBackgroundOpaque.css};}${this._terminalSelector} .${O} div { position: absolute; background-color: ${U.selectionInactiveBackgroundOpaque.css};}`;for(const[X,I]of U.ansi.entries())W+=`${this._terminalSelector} .${D}${X} { color: ${I.css}; }${this._terminalSelector} .${D}${X}.xterm-dim { color: ${b.color.multiplyOpacity(I,.5).css}; }${this._terminalSelector} .${A}${X} { background-color: ${I.css}; }`;W+=`${this._terminalSelector} .${D}${x.INVERTED_DEFAULT_COLOR} { color: ${b.color.opaque(U.background).css}; }${this._terminalSelector} .${D}${x.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${b.color.multiplyOpacity(b.color.opaque(U.background),.5).css}; }${this._terminalSelector} .${A}${x.INVERTED_DEFAULT_COLOR} { background-color: ${U.foreground.css}; }`,this._themeStyleElement.textContent=W}_setDefaultSpacing(){const U=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${U}px`,this._rowFactory.defaultSpacing=U}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(U,W){for(let K=this._rowElements.length;K<=W;K++){const V=this._document.createElement("div");this._rowContainer.appendChild(V),this._rowElements.push(V)}for(;this._rowElements.length>W;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(U,W){this._refreshRowElements(U,W),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(U,W,K){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(U,W,K),this.renderRows(0,this._bufferService.rows-1),!U||!W)return;this._selectionRenderModel.update(this._terminal,U,W,K);const V=this._selectionRenderModel.viewportStartRow,Q=this._selectionRenderModel.viewportEndRow,X=this._selectionRenderModel.viewportCappedStartRow,I=this._selectionRenderModel.viewportCappedEndRow;if(X>=this._bufferService.rows||I<0)return;const L=this._document.createDocumentFragment();if(K){const z=U[0]>W[0];L.appendChild(this._createSelectionElement(X,z?W[0]:U[0],z?U[0]:W[0],I-X+1))}else{const z=V===X?U[0]:0,F=X===Q?W[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(X,z,F));const B=I-X-1;if(L.appendChild(this._createSelectionElement(X+1,0,this._bufferService.cols,B)),X!==I){const Y=Q===I?W[0]:this._bufferService.cols;L.appendChild(this._createSelectionElement(I,0,Y))}}this._selectionContainer.appendChild(L)}_createSelectionElement(U,W,K,V=1){const Q=this._document.createElement("div"),X=W*this.dimensions.css.cell.width;let I=this.dimensions.css.cell.width*(K-W);return X+I>this.dimensions.css.canvas.width&&(I=this.dimensions.css.canvas.width-X),Q.style.height=V*this.dimensions.css.cell.height+"px",Q.style.top=U*this.dimensions.css.cell.height+"px",Q.style.left=`${X}px`,Q.style.width=`${I}px`,Q}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const U of this._rowElements)U.replaceChildren()}renderRows(U,W){const K=this._bufferService.buffer,V=K.ybase+K.y,Q=Math.min(K.x,this._bufferService.cols-1),X=this._optionsService.rawOptions.cursorBlink,I=this._optionsService.rawOptions.cursorStyle,L=this._optionsService.rawOptions.cursorInactiveStyle;for(let z=U;z<=W;z++){const F=z+K.ydisp,B=this._rowElements[z],Y=K.lines.get(F);if(!B||!Y)break;B.replaceChildren(...this._rowFactory.createRow(Y,F,F===V,I,L,Q,X,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${T}${this._terminalClass}`}_handleLinkHover(U){this._setCellUnderline(U.x1,U.x2,U.y1,U.y2,U.cols,!0)}_handleLinkLeave(U){this._setCellUnderline(U.x1,U.x2,U.y1,U.y2,U.cols,!1)}_setCellUnderline(U,W,K,V,Q,X){K<0&&(U=0),V<0&&(W=0);const I=this._bufferService.rows-1;K=Math.max(Math.min(K,I),0),V=Math.max(Math.min(V,I),0),Q=Math.min(Q,this._bufferService.cols);const L=this._bufferService.buffer,z=L.ybase+L.y,F=Math.min(L.x,Q-1),B=this._optionsService.rawOptions.cursorBlink,Y=this._optionsService.rawOptions.cursorStyle,ee=this._optionsService.rawOptions.cursorInactiveStyle;for(let J=K;J<=V;++J){const G=J+L.ydisp,q=this._rowElements[J],te=L.lines.get(G);if(!q||!te)break;q.replaceChildren(...this._rowFactory.createRow(te,G,G===z,Y,ee,F,B,this.dimensions.css.cell.width,this._widthCache,X?J===K?U:0:-1,X?(J===V?W:Q)-1:-1))}}};l.DomRenderer=$=f([p(7,k.IInstantiationService),p(8,v.ICharSizeService),p(9,k.IOptionsService),p(10,k.IBufferService),p(11,v.ICoreBrowserService),p(12,v.IThemeService)],$)},3787:function(c,l,u){var f=this&&this.__decorate||function(R,D,A,j){var O,P=arguments.length,$=P<3?D:j===null?j=Object.getOwnPropertyDescriptor(D,A):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(R,D,A,j);else for(var U=R.length-1;U>=0;U--)(O=R[U])&&($=(P<3?O($):P>3?O(D,A,$):O(D,A))||$);return P>3&&$&&Object.defineProperty(D,A,$),$},p=this&&this.__param||function(R,D){return function(A,j){D(A,j,R)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRendererRowFactory=void 0;const h=u(2223),_=u(643),x=u(511),C=u(2585),w=u(8055),v=u(4725),b=u(4269),y=u(6171),S=u(3734);let k=l.DomRendererRowFactory=class{constructor(R,D,A,j,O,P,$){this._document=R,this._characterJoinerService=D,this._optionsService=A,this._coreBrowserService=j,this._coreService=O,this._decorationService=P,this._themeService=$,this._workCell=new x.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(R,D,A){this._selectionStart=R,this._selectionEnd=D,this._columnSelectMode=A}createRow(R,D,A,j,O,P,$,U,W,K,V){const Q=[],X=this._characterJoinerService.getJoinedCharacters(D),I=this._themeService.colors;let L,z=R.getNoBgTrimmedLength();A&&z<P+1&&(z=P+1);let F=0,B="",Y=0,ee=0,J=0,G=!1,q=0,te=!1,re=0;const oe=[],se=K!==-1&&V!==-1;for(let ye=0;ye<z;ye++){R.loadCell(ye,this._workCell);let Ee=this._workCell.getWidth();if(Ee===0)continue;let Ae=!1,Be=ye,le=this._workCell;if(X.length>0&&ye===X[0][0]){Ae=!0;const Ue=X.shift();le=new b.JoinedCellData(this._workCell,R.translateToString(!0,Ue[0],Ue[1]),Ue[1]-Ue[0]),Be=Ue[1]-1,Ee=le.getWidth()}const Ce=this._isCellInSelection(ye,D),ge=A&&ye===P,Oe=se&&ye>=K&&ye<=V;let He=!1;this._decorationService.forEachDecorationAtCell(ye,D,void 0,(Ue=>{He=!0}));let rt=le.getChars()||_.WHITESPACE_CELL_CHAR;if(rt===" "&&(le.isUnderline()||le.isOverline())&&(rt=" "),re=Ee*U-W.get(rt,le.isBold(),le.isItalic()),L){if(F&&(Ce&&te||!Ce&&!te&&le.bg===Y)&&(Ce&&te&&I.selectionForeground||le.fg===ee)&&le.extended.ext===J&&Oe===G&&re===q&&!ge&&!Ae&&!He){le.isInvisible()?B+=_.WHITESPACE_CELL_CHAR:B+=rt,F++;continue}F&&(L.textContent=B),L=this._document.createElement("span"),F=0,B=""}else L=this._document.createElement("span");if(Y=le.bg,ee=le.fg,J=le.extended.ext,G=Oe,q=re,te=Ce,Ae&&P>=ye&&P<=Be&&(P=ye),!this._coreService.isCursorHidden&&ge&&this._coreService.isCursorInitialized){if(oe.push("xterm-cursor"),this._coreBrowserService.isFocused)$&&oe.push("xterm-cursor-blink"),oe.push(j==="bar"?"xterm-cursor-bar":j==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(O)switch(O){case"outline":oe.push("xterm-cursor-outline");break;case"block":oe.push("xterm-cursor-block");break;case"bar":oe.push("xterm-cursor-bar");break;case"underline":oe.push("xterm-cursor-underline")}}if(le.isBold()&&oe.push("xterm-bold"),le.isItalic()&&oe.push("xterm-italic"),le.isDim()&&oe.push("xterm-dim"),B=le.isInvisible()?_.WHITESPACE_CELL_CHAR:le.getChars()||_.WHITESPACE_CELL_CHAR,le.isUnderline()&&(oe.push(`xterm-underline-${le.extended.underlineStyle}`),B===" "&&(B=" "),!le.isUnderlineColorDefault()))if(le.isUnderlineColorRGB())L.style.textDecorationColor=`rgb(${S.AttributeData.toColorRGB(le.getUnderlineColor()).join(",")})`;else{let Ue=le.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&le.isBold()&&Ue<8&&(Ue+=8),L.style.textDecorationColor=I.ansi[Ue].css}le.isOverline()&&(oe.push("xterm-overline"),B===" "&&(B=" ")),le.isStrikethrough()&&oe.push("xterm-strikethrough"),Oe&&(L.style.textDecoration="underline");let Qe=le.getFgColor(),Ne=le.getFgColorMode(),Ge=le.getBgColor(),ce=le.getBgColorMode();const ve=!!le.isInverse();if(ve){const Ue=Qe;Qe=Ge,Ge=Ue;const Pe=Ne;Ne=ce,ce=Pe}let Te,je,Le,Je=!1;switch(this._decorationService.forEachDecorationAtCell(ye,D,void 0,(Ue=>{Ue.options.layer!=="top"&&Je||(Ue.backgroundColorRGB&&(ce=50331648,Ge=Ue.backgroundColorRGB.rgba>>8&16777215,Te=Ue.backgroundColorRGB),Ue.foregroundColorRGB&&(Ne=50331648,Qe=Ue.foregroundColorRGB.rgba>>8&16777215,je=Ue.foregroundColorRGB),Je=Ue.options.layer==="top")})),!Je&&Ce&&(Te=this._coreBrowserService.isFocused?I.selectionBackgroundOpaque:I.selectionInactiveBackgroundOpaque,Ge=Te.rgba>>8&16777215,ce=50331648,Je=!0,I.selectionForeground&&(Ne=50331648,Qe=I.selectionForeground.rgba>>8&16777215,je=I.selectionForeground)),Je&&oe.push("xterm-decoration-top"),ce){case 16777216:case 33554432:Le=I.ansi[Ge],oe.push(`xterm-bg-${Ge}`);break;case 50331648:Le=w.channels.toColor(Ge>>16,Ge>>8&255,255&Ge),this._addStyle(L,`background-color:#${T((Ge>>>0).toString(16),"0",6)}`);break;default:ve?(Le=I.foreground,oe.push(`xterm-bg-${h.INVERTED_DEFAULT_COLOR}`)):Le=I.background}switch(Te||le.isDim()&&(Te=w.color.multiplyOpacity(Le,.5)),Ne){case 16777216:case 33554432:le.isBold()&&Qe<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Qe+=8),this._applyMinimumContrast(L,Le,I.ansi[Qe],le,Te,void 0)||oe.push(`xterm-fg-${Qe}`);break;case 50331648:const Ue=w.channels.toColor(Qe>>16&255,Qe>>8&255,255&Qe);this._applyMinimumContrast(L,Le,Ue,le,Te,je)||this._addStyle(L,`color:#${T(Qe.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(L,Le,I.foreground,le,Te,je)||ve&&oe.push(`xterm-fg-${h.INVERTED_DEFAULT_COLOR}`)}oe.length&&(L.className=oe.join(" "),oe.length=0),ge||Ae||He?L.textContent=B:F++,re!==this.defaultSpacing&&(L.style.letterSpacing=`${re}px`),Q.push(L),ye=Be}return L&&F&&(L.textContent=B),Q}_applyMinimumContrast(R,D,A,j,O,P){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,y.treatGlyphAsBackgroundColor)(j.getCode()))return!1;const $=this._getContrastCache(j);let U;if(O||P||(U=$.getColor(D.rgba,A.rgba)),U===void 0){const W=this._optionsService.rawOptions.minimumContrastRatio/(j.isDim()?2:1);U=w.color.ensureContrastRatio(O||D,P||A,W),$.setColor((O||D).rgba,(P||A).rgba,U!=null?U:null)}return!!U&&(this._addStyle(R,`color:${U.css}`),!0)}_getContrastCache(R){return R.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(R,D){R.setAttribute("style",`${R.getAttribute("style")||""}${D};`)}_isCellInSelection(R,D){const A=this._selectionStart,j=this._selectionEnd;return!(!A||!j)&&(this._columnSelectMode?A[0]<=j[0]?R>=A[0]&&D>=A[1]&&R<j[0]&&D<=j[1]:R<A[0]&&D>=A[1]&&R>=j[0]&&D<=j[1]:D>A[1]&&D<j[1]||A[1]===j[1]&&D===A[1]&&R>=A[0]&&R<j[0]||A[1]<j[1]&&D===j[1]&&R<j[0]||A[1]<j[1]&&D===A[1]&&R>=A[0])}};function T(R,D,A){for(;R.length<A;)R=D+R;return R}l.DomRendererRowFactory=k=f([p(1,v.ICharacterJoinerService),p(2,C.IOptionsService),p(3,v.ICoreBrowserService),p(4,C.ICoreService),p(5,C.IDecorationService),p(6,v.IThemeService)],k)},2550:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WidthCache=void 0,l.WidthCache=class{constructor(u,f){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const p=u.createElement("span");p.classList.add("xterm-char-measure-element");const h=u.createElement("span");h.classList.add("xterm-char-measure-element"),h.style.fontWeight="bold";const _=u.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontStyle="italic";const x=u.createElement("span");x.classList.add("xterm-char-measure-element"),x.style.fontWeight="bold",x.style.fontStyle="italic",this._measureElements=[p,h,_,x],this._container.appendChild(p),this._container.appendChild(h),this._container.appendChild(_),this._container.appendChild(x),f.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(u,f,p,h){u===this._font&&f===this._fontSize&&p===this._weight&&h===this._weightBold||(this._font=u,this._fontSize=f,this._weight=p,this._weightBold=h,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${p}`,this._measureElements[1].style.fontWeight=`${h}`,this._measureElements[2].style.fontWeight=`${p}`,this._measureElements[3].style.fontWeight=`${h}`,this.clear())}get(u,f,p){let h=0;if(!f&&!p&&u.length===1&&(h=u.charCodeAt(0))<256){if(this._flat[h]!==-9999)return this._flat[h];const C=this._measure(u,0);return C>0&&(this._flat[h]=C),C}let _=u;f&&(_+="B"),p&&(_+="I");let x=this._holey.get(_);if(x===void 0){let C=0;f&&(C|=1),p&&(C|=2),x=this._measure(u,C),x>0&&this._holey.set(_,x)}return x}_measure(u,f){const p=this._measureElements[f];return p.textContent=u.repeat(32),p.offsetWidth/32}}},2223:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TEXT_BASELINE=l.DIM_OPACITY=l.INVERTED_DEFAULT_COLOR=void 0;const f=u(6114);l.INVERTED_DEFAULT_COLOR=257,l.DIM_OPACITY=.5,l.TEXT_BASELINE=f.isFirefox||f.isLegacyEdge?"bottom":"ideographic"},6171:(c,l)=>{function u(p){return 57508<=p&&p<=57558}function f(p){return p>=128512&&p<=128591||p>=127744&&p<=128511||p>=128640&&p<=128767||p>=9728&&p<=9983||p>=9984&&p<=10175||p>=65024&&p<=65039||p>=129280&&p<=129535||p>=127462&&p<=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(p){if(!p)throw new Error("value must not be falsy");return p},l.isPowerlineGlyph=u,l.isRestrictedPowerlineGlyph=function(p){return 57520<=p&&p<=57527},l.isEmoji=f,l.allowRescaling=function(p,h,_,x){return h===1&&_>Math.ceil(1.5*x)&&p!==void 0&&p>255&&!f(p)&&!u(p)&&!(function(C){return 57344<=C&&C<=63743})(p)},l.treatGlyphAsBackgroundColor=function(p){return u(p)||(function(h){return 9472<=h&&h<=9631})(p)},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(p,h,_=0){return(p-(2*Math.round(h)-_))%(2*Math.round(h))}},6052:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createSelectionRenderModel=void 0;class u{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(p,h,_,x=!1){if(this.selectionStart=h,this.selectionEnd=_,!h||!_||h[0]===_[0]&&h[1]===_[1])return void this.clear();const C=p.buffers.active.ydisp,w=h[1]-C,v=_[1]-C,b=Math.max(w,0),y=Math.min(v,p.rows-1);b>=p.rows||y<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=x,this.viewportStartRow=w,this.viewportEndRow=v,this.viewportCappedStartRow=b,this.viewportCappedEndRow=y,this.startCol=h[0],this.endCol=_[0])}isCellSelected(p,h,_){return!!this.hasSelection&&(_-=p.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?h>=this.startCol&&_>=this.viewportCappedStartRow&&h<this.endCol&&_<=this.viewportCappedEndRow:h<this.startCol&&_>=this.viewportCappedStartRow&&h>=this.endCol&&_<=this.viewportCappedEndRow:_>this.viewportStartRow&&_<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&_===this.viewportStartRow&&h>=this.startCol&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportEndRow&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&_===this.viewportStartRow&&h>=this.startCol)}}l.createSelectionRenderModel=function(){return new u}},456:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionModel=void 0,l.SelectionModel=class{constructor(u){this._bufferService=u,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,f=this.selectionEnd;return!(!u||!f)&&(u[1]>f[1]||u[1]===f[1]&&u[0]>f[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(c,l,u){var f=this&&this.__decorate||function(y,S,k,T){var R,D=arguments.length,A=D<3?S:T===null?T=Object.getOwnPropertyDescriptor(S,k):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(y,S,k,T);else for(var j=y.length-1;j>=0;j--)(R=y[j])&&(A=(D<3?R(A):D>3?R(S,k,A):R(S,k))||A);return D>3&&A&&Object.defineProperty(S,k,A),A},p=this&&this.__param||function(y,S){return function(k,T){S(k,T,y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharSizeService=void 0;const h=u(2585),_=u(8460),x=u(844);let C=l.CharSizeService=class extends x.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(y,S,k){super(),this._optionsService=k,this.width=0,this.height=0,this._onCharSizeChange=this.register(new _.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new b(this._optionsService))}catch{this._measureStrategy=this.register(new v(y,S,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const y=this._measureStrategy.measure();y.width===this.width&&y.height===this.height||(this.width=y.width,this.height=y.height,this._onCharSizeChange.fire())}};l.CharSizeService=C=f([p(2,h.IOptionsService)],C);class w extends x.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(S,k){S!==void 0&&S>0&&k!==void 0&&k>0&&(this._result.width=S,this._result.height=k)}}class v extends w{constructor(S,k,T){super(),this._document=S,this._parentElement=k,this._optionsService=T,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 b extends w{constructor(S){super(),this._optionsService=S,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const k=this._ctx.measureText("W");if(!("width"in k&&"fontBoundingBoxAscent"in k&&"fontBoundingBoxDescent"in k))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const S=this._ctx.measureText("W");return this._validateAndSet(S.width,S.fontBoundingBoxAscent+S.fontBoundingBoxDescent),this._result}}},4269:function(c,l,u){var f=this&&this.__decorate||function(b,y,S,k){var T,R=arguments.length,D=R<3?y:k===null?k=Object.getOwnPropertyDescriptor(y,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(b,y,S,k);else for(var A=b.length-1;A>=0;A--)(T=b[A])&&(D=(R<3?T(D):R>3?T(y,S,D):T(y,S))||D);return R>3&&D&&Object.defineProperty(y,S,D),D},p=this&&this.__param||function(b,y){return function(S,k){y(S,k,b)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharacterJoinerService=l.JoinedCellData=void 0;const h=u(3734),_=u(643),x=u(511),C=u(2585);class w extends h.AttributeData{constructor(y,S,k){super(),this.content=0,this.combinedData="",this.fg=y.fg,this.bg=y.bg,this.combinedData=S,this._width=k}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(y){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.JoinedCellData=w;let v=l.CharacterJoinerService=class rk{constructor(y){this._bufferService=y,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new x.CellData}register(y){const S={id:this._nextCharacterJoinerId++,handler:y};return this._characterJoiners.push(S),S.id}deregister(y){for(let S=0;S<this._characterJoiners.length;S++)if(this._characterJoiners[S].id===y)return this._characterJoiners.splice(S,1),!0;return!1}getJoinedCharacters(y){if(this._characterJoiners.length===0)return[];const S=this._bufferService.buffer.lines.get(y);if(!S||S.length===0)return[];const k=[],T=S.translateToString(!0);let R=0,D=0,A=0,j=S.getFg(0),O=S.getBg(0);for(let P=0;P<S.getTrimmedLength();P++)if(S.loadCell(P,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==j||this._workCell.bg!==O){if(P-R>1){const $=this._getJoinedRanges(T,A,D,S,R);for(let U=0;U<$.length;U++)k.push($[U])}R=P,A=D,j=this._workCell.fg,O=this._workCell.bg}D+=this._workCell.getChars().length||_.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-R>1){const P=this._getJoinedRanges(T,A,D,S,R);for(let $=0;$<P.length;$++)k.push(P[$])}return k}_getJoinedRanges(y,S,k,T,R){const D=y.substring(S,k);let A=[];try{A=this._characterJoiners[0].handler(D)}catch(j){console.error(j)}for(let j=1;j<this._characterJoiners.length;j++)try{const O=this._characterJoiners[j].handler(D);for(let P=0;P<O.length;P++)rk._mergeRanges(A,O[P])}catch(O){console.error(O)}return this._stringRangesToCellRanges(A,T,R),A}_stringRangesToCellRanges(y,S,k){let T=0,R=!1,D=0,A=y[T];if(A){for(let j=k;j<this._bufferService.cols;j++){const O=S.getWidth(j),P=S.getString(j).length||_.WHITESPACE_CELL_CHAR.length;if(O!==0){if(!R&&A[0]<=D&&(A[0]=j,R=!0),A[1]<=D){if(A[1]=j,A=y[++T],!A)break;A[0]<=D?(A[0]=j,R=!0):R=!1}D+=P}}A&&(A[1]=this._bufferService.cols)}}static _mergeRanges(y,S){let k=!1;for(let T=0;T<y.length;T++){const R=y[T];if(k){if(S[1]<=R[0])return y[T-1][1]=S[1],y;if(S[1]<=R[1])return y[T-1][1]=Math.max(S[1],R[1]),y.splice(T,1),y;y.splice(T,1),T--}else{if(S[1]<=R[0])return y.splice(T,0,S),y;if(S[1]<=R[1])return R[0]=Math.min(S[0],R[0]),y;S[0]<R[1]&&(R[0]=Math.min(S[0],R[0]),k=!0)}}return k?y[y.length-1][1]=S[1]:y.push(S),y}};l.CharacterJoinerService=v=f([p(0,C.IBufferService)],v)},5114:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreBrowserService=void 0;const f=u(844),p=u(8460),h=u(3656);class _ extends f.Disposable{constructor(w,v,b){super(),this._textarea=w,this._window=v,this.mainDocument=b,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new x(this._window),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new p.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((y=>this._screenDprMonitor.setWindow(y)))),this.register((0,p.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(w){this._window!==w&&(this._window=w,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=_;class x extends f.Disposable{constructor(w){super(),this._parentWindow=w,this._windowResizeListener=this.register(new f.MutableDisposable),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,f.toDisposable)((()=>this.clearListener())))}setWindow(w){this._parentWindow=w,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,h.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var w;this._outerListener&&((w=this._resolutionMediaMatchList)==null||w.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:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.LinkProviderService=void 0;const f=u(844);class p extends f.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,f.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(_){return this.linkProviders.push(_),{dispose:()=>{const x=this.linkProviders.indexOf(_);x!==-1&&this.linkProviders.splice(x,1)}}}}l.LinkProviderService=p},8934:function(c,l,u){var f=this&&this.__decorate||function(C,w,v,b){var y,S=arguments.length,k=S<3?w:b===null?b=Object.getOwnPropertyDescriptor(w,v):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(C,w,v,b);else for(var T=C.length-1;T>=0;T--)(y=C[T])&&(k=(S<3?y(k):S>3?y(w,v,k):y(w,v))||k);return S>3&&k&&Object.defineProperty(w,v,k),k},p=this&&this.__param||function(C,w){return function(v,b){w(v,b,C)}};Object.defineProperty(l,"__esModule",{value:!0}),l.MouseService=void 0;const h=u(4725),_=u(9806);let x=l.MouseService=class{constructor(C,w){this._renderService=C,this._charSizeService=w}getCoords(C,w,v,b,y){return(0,_.getCoords)(window,C,w,v,b,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,y)}getMouseReportCoords(C,w){const v=(0,_.getCoordsRelativeToElement)(window,C,w);if(this._charSizeService.hasValidSize)return v[0]=Math.min(Math.max(v[0],0),this._renderService.dimensions.css.canvas.width-1),v[1]=Math.min(Math.max(v[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(v[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(v[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(v[0]),y:Math.floor(v[1])}}};l.MouseService=x=f([p(0,h.IRenderService),p(1,h.ICharSizeService)],x)},3230:function(c,l,u){var f=this&&this.__decorate||function(y,S,k,T){var R,D=arguments.length,A=D<3?S:T===null?T=Object.getOwnPropertyDescriptor(S,k):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(y,S,k,T);else for(var j=y.length-1;j>=0;j--)(R=y[j])&&(A=(D<3?R(A):D>3?R(S,k,A):R(S,k))||A);return D>3&&A&&Object.defineProperty(S,k,A),A},p=this&&this.__param||function(y,S){return function(k,T){S(k,T,y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.RenderService=void 0;const h=u(6193),_=u(4725),x=u(8460),C=u(844),w=u(7226),v=u(2585);let b=l.RenderService=class extends C.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(y,S,k,T,R,D,A,j){super(),this._rowCount=y,this._charSizeService=T,this._renderer=this.register(new C.MutableDisposable),this._pausedResizeTask=new w.DebouncedIdleTask,this._observerDisposable=this.register(new C.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new x.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new x.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new x.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new x.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new h.RenderDebouncer(((O,P)=>this._renderRows(O,P)),A),this.register(this._renderDebouncer),this.register(A.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(D.onResize((()=>this._fullRefresh()))),this.register(D.buffers.onBufferActivate((()=>{var O;return(O=this._renderer.value)==null?void 0:O.clear()}))),this.register(k.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(R.onDecorationRegistered((()=>this._fullRefresh()))),this.register(R.onDecorationRemoved((()=>this._fullRefresh()))),this.register(k.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(D.cols,D.rows),this._fullRefresh()}))),this.register(k.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(D.buffer.y,D.buffer.y,!0)))),this.register(j.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(A.window,S),this.register(A.onWindowChange((O=>this._registerIntersectionObserver(O,S))))}_registerIntersectionObserver(y,S){if("IntersectionObserver"in y){const k=new y.IntersectionObserver((T=>this._handleIntersectionChange(T[T.length-1])),{threshold:0});k.observe(S),this._observerDisposable.value=(0,C.toDisposable)((()=>k.disconnect()))}}_handleIntersectionChange(y){this._isPaused=y.isIntersecting===void 0?y.intersectionRatio===0:!y.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(y,S,k=!1){this._isPaused?this._needsFullRefresh=!0:(k||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(y,S,this._rowCount))}_renderRows(y,S){this._renderer.value&&(y=Math.min(y,this._rowCount-1),S=Math.min(S,this._rowCount-1),this._renderer.value.renderRows(y,S),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:y,end:S}),this._onRender.fire({start:y,end:S}),this._isNextRenderRedrawOnly=!0)}resize(y,S){this._rowCount=S,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(y){this._renderer.value=y,this._renderer.value&&(this._renderer.value.onRequestRedraw((S=>this.refreshRows(S.start,S.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(y){return this._renderDebouncer.addRefreshCallback(y)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var y,S;this._renderer.value&&((S=(y=this._renderer.value).clearTextureAtlas)==null||S.call(y),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(y,S){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var k;return(k=this._renderer.value)==null?void 0:k.handleResize(y,S)})):this._renderer.value.handleResize(y,S),this._fullRefresh())}handleCharSizeChanged(){var y;(y=this._renderer.value)==null||y.handleCharSizeChanged()}handleBlur(){var y;(y=this._renderer.value)==null||y.handleBlur()}handleFocus(){var y;(y=this._renderer.value)==null||y.handleFocus()}handleSelectionChanged(y,S,k){var T;this._selectionState.start=y,this._selectionState.end=S,this._selectionState.columnSelectMode=k,(T=this._renderer.value)==null||T.handleSelectionChanged(y,S,k)}handleCursorMove(){var y;(y=this._renderer.value)==null||y.handleCursorMove()}clear(){var y;(y=this._renderer.value)==null||y.clear()}};l.RenderService=b=f([p(2,v.IOptionsService),p(3,_.ICharSizeService),p(4,v.IDecorationService),p(5,v.IBufferService),p(6,_.ICoreBrowserService),p(7,_.IThemeService)],b)},9312:function(c,l,u){var f=this&&this.__decorate||function(A,j,O,P){var $,U=arguments.length,W=U<3?j:P===null?P=Object.getOwnPropertyDescriptor(j,O):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(A,j,O,P);else for(var K=A.length-1;K>=0;K--)($=A[K])&&(W=(U<3?$(W):U>3?$(j,O,W):$(j,O))||W);return U>3&&W&&Object.defineProperty(j,O,W),W},p=this&&this.__param||function(A,j){return function(O,P){j(O,P,A)}};Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionService=void 0;const h=u(9806),_=u(9504),x=u(456),C=u(4725),w=u(8460),v=u(844),b=u(6114),y=u(4841),S=u(511),k=u(2585),T=" ",R=new RegExp(T,"g");let D=l.SelectionService=class extends v.Disposable{constructor(A,j,O,P,$,U,W,K,V){super(),this._element=A,this._screenElement=j,this._linkifier=O,this._bufferService=P,this._coreService=$,this._mouseService=U,this._optionsService=W,this._renderService=K,this._coreBrowserService=V,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new S.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new w.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new w.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new w.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new w.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=Q=>this._handleMouseMove(Q),this._mouseUpListener=Q=>this._handleMouseUp(Q),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((Q=>this._handleTrim(Q))),this.register(this._bufferService.buffers.onBufferActivate((Q=>this._handleBufferActivate(Q)))),this.enable(),this._model=new x.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,v.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 A=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;return!(!A||!j||A[0]===j[0]&&A[1]===j[1])}get selectionText(){const A=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;if(!A||!j)return"";const O=this._bufferService.buffer,P=[];if(this._activeSelectionMode===3){if(A[0]===j[0])return"";const $=A[0]<j[0]?A[0]:j[0],U=A[0]<j[0]?j[0]:A[0];for(let W=A[1];W<=j[1];W++){const K=O.translateBufferLineToString(W,!0,$,U);P.push(K)}}else{const $=A[1]===j[1]?j[0]:void 0;P.push(O.translateBufferLineToString(A[1],!0,A[0],$));for(let U=A[1]+1;U<=j[1]-1;U++){const W=O.lines.get(U),K=O.translateBufferLineToString(U,!0);W!=null&&W.isWrapped?P[P.length-1]+=K:P.push(K)}if(A[1]!==j[1]){const U=O.lines.get(j[1]),W=O.translateBufferLineToString(j[1],!0,0,j[0]);U&&U.isWrapped?P[P.length-1]+=W:P.push(W)}}return P.map(($=>$.replace(R," "))).join(b.isWindows?`\r
524
+ `:`
525
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(A){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),b.isLinux&&A&&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(A){const j=this._getMouseBufferCoords(A),O=this._model.finalSelectionStart,P=this._model.finalSelectionEnd;return!!(O&&P&&j)&&this._areCoordsInSelection(j,O,P)}isCellInSelection(A,j){const O=this._model.finalSelectionStart,P=this._model.finalSelectionEnd;return!(!O||!P)&&this._areCoordsInSelection([A,j],O,P)}_areCoordsInSelection(A,j,O){return A[1]>j[1]&&A[1]<O[1]||j[1]===O[1]&&A[1]===j[1]&&A[0]>=j[0]&&A[0]<O[0]||j[1]<O[1]&&A[1]===O[1]&&A[0]<O[0]||j[1]<O[1]&&A[1]===j[1]&&A[0]>=j[0]}_selectWordAtCursor(A,j){var $,U;const O=(U=($=this._linkifier.currentLink)==null?void 0:$.link)==null?void 0:U.range;if(O)return this._model.selectionStart=[O.start.x-1,O.start.y-1],this._model.selectionStartLength=(0,y.getRangeLength)(O,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const P=this._getMouseBufferCoords(A);return!!P&&(this._selectWordAt(P,j),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(A,j){this._model.clearSelection(),A=Math.max(A,0),j=Math.min(j,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,A],this._model.selectionEnd=[this._bufferService.cols,j],this.refresh(),this._onSelectionChange.fire()}_handleTrim(A){this._model.handleTrim(A)&&this.refresh()}_getMouseBufferCoords(A){const j=this._mouseService.getCoords(A,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(j)return j[0]--,j[1]--,j[1]+=this._bufferService.buffer.ydisp,j}_getMouseEventScrollAmount(A){let j=(0,h.getCoordsRelativeToElement)(this._coreBrowserService.window,A,this._screenElement)[1];const O=this._renderService.dimensions.css.canvas.height;return j>=0&&j<=O?0:(j>O&&(j-=O),j=Math.min(Math.max(j,-50),50),j/=50,j/Math.abs(j)+Math.round(14*j))}shouldForceSelection(A){return b.isMac?A.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:A.shiftKey}handleMouseDown(A){if(this._mouseDownTimeStamp=A.timeStamp,(A.button!==2||!this.hasSelection)&&A.button===0){if(!this._enabled){if(!this.shouldForceSelection(A))return;A.stopPropagation()}A.preventDefault(),this._dragScrollAmount=0,this._enabled&&A.shiftKey?this._handleIncrementalClick(A):A.detail===1?this._handleSingleClick(A):A.detail===2?this._handleDoubleClick(A):A.detail===3&&this._handleTripleClick(A),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(A){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(A))}_handleSingleClick(A){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(A)?3:0,this._model.selectionStart=this._getMouseBufferCoords(A),!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(A){this._selectWordAtCursor(A,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(A){const j=this._getMouseBufferCoords(A);j&&(this._activeSelectionMode=2,this._selectLineAt(j[1]))}shouldColumnSelect(A){return A.altKey&&!(b.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(A){if(A.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(A),!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(A),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const O=this._bufferService.buffer;if(this._model.selectionEnd[1]<O.lines.length){const P=O.lines.get(this._model.selectionEnd[1]);P&&P.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 A=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(A.ydisp+this._bufferService.rows,A.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=A.ydisp),this.refresh()}}_handleMouseUp(A){const j=A.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&j<500&&A.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const O=this._mouseService.getCoords(A,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(O&&O[0]!==void 0&&O[1]!==void 0){const P=(0,_.moveToCellSequence)(O[0]-1,O[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(P,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const A=this._model.finalSelectionStart,j=this._model.finalSelectionEnd,O=!(!A||!j||A[0]===j[0]&&A[1]===j[1]);O?A&&j&&(this._oldSelectionStart&&this._oldSelectionEnd&&A[0]===this._oldSelectionStart[0]&&A[1]===this._oldSelectionStart[1]&&j[0]===this._oldSelectionEnd[0]&&j[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(A,j,O)):this._oldHasSelection&&this._fireOnSelectionChange(A,j,O)}_fireOnSelectionChange(A,j,O){this._oldSelectionStart=A,this._oldSelectionEnd=j,this._oldHasSelection=O,this._onSelectionChange.fire()}_handleBufferActivate(A){this.clearSelection(),this._trimListener.dispose(),this._trimListener=A.activeBuffer.lines.onTrim((j=>this._handleTrim(j)))}_convertViewportColToCharacterIndex(A,j){let O=j;for(let P=0;j>=P;P++){const $=A.loadCell(P,this._workCell).getChars().length;this._workCell.getWidth()===0?O--:$>1&&j!==P&&(O+=$-1)}return O}setSelection(A,j,O){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[A,j],this._model.selectionStartLength=O,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(A){this._isClickInSelection(A)||(this._selectWordAtCursor(A,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(A,j,O=!0,P=!0){if(A[0]>=this._bufferService.cols)return;const $=this._bufferService.buffer,U=$.lines.get(A[1]);if(!U)return;const W=$.translateBufferLineToString(A[1],!1);let K=this._convertViewportColToCharacterIndex(U,A[0]),V=K;const Q=A[0]-K;let X=0,I=0,L=0,z=0;if(W.charAt(K)===" "){for(;K>0&&W.charAt(K-1)===" ";)K--;for(;V<W.length&&W.charAt(V+1)===" ";)V++}else{let Y=A[0],ee=A[0];U.getWidth(Y)===0&&(X++,Y--),U.getWidth(ee)===2&&(I++,ee++);const J=U.getString(ee).length;for(J>1&&(z+=J-1,V+=J-1);Y>0&&K>0&&!this._isCharWordSeparator(U.loadCell(Y-1,this._workCell));){U.loadCell(Y-1,this._workCell);const G=this._workCell.getChars().length;this._workCell.getWidth()===0?(X++,Y--):G>1&&(L+=G-1,K-=G-1),K--,Y--}for(;ee<U.length&&V+1<W.length&&!this._isCharWordSeparator(U.loadCell(ee+1,this._workCell));){U.loadCell(ee+1,this._workCell);const G=this._workCell.getChars().length;this._workCell.getWidth()===2?(I++,ee++):G>1&&(z+=G-1,V+=G-1),V++,ee++}}V++;let F=K+Q-X+L,B=Math.min(this._bufferService.cols,V-K+X+I-L-z);if(j||W.slice(K,V).trim()!==""){if(O&&F===0&&U.getCodePoint(0)!==32){const Y=$.lines.get(A[1]-1);if(Y&&U.isWrapped&&Y.getCodePoint(this._bufferService.cols-1)!==32){const ee=this._getWordAt([this._bufferService.cols-1,A[1]-1],!1,!0,!1);if(ee){const J=this._bufferService.cols-ee.start;F-=J,B+=J}}}if(P&&F+B===this._bufferService.cols&&U.getCodePoint(this._bufferService.cols-1)!==32){const Y=$.lines.get(A[1]+1);if(Y!=null&&Y.isWrapped&&Y.getCodePoint(0)!==32){const ee=this._getWordAt([0,A[1]+1],!1,!1,!0);ee&&(B+=ee.length)}}return{start:F,length:B}}}_selectWordAt(A,j){const O=this._getWordAt(A,j);if(O){for(;O.start<0;)O.start+=this._bufferService.cols,A[1]--;this._model.selectionStart=[O.start,A[1]],this._model.selectionStartLength=O.length}}_selectToWordAt(A){const j=this._getWordAt(A,!0);if(j){let O=A[1];for(;j.start<0;)j.start+=this._bufferService.cols,O--;if(!this._model.areSelectionValuesReversed())for(;j.start+j.length>this._bufferService.cols;)j.length-=this._bufferService.cols,O++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?j.start:j.start+j.length,O]}}_isCharWordSeparator(A){return A.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(A.getChars())>=0}_selectLineAt(A){const j=this._bufferService.buffer.getWrappedRangeForLine(A),O={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,y.getRangeLength)(O,this._bufferService.cols)}};l.SelectionService=D=f([p(3,k.IBufferService),p(4,k.ICoreService),p(5,C.IMouseService),p(6,k.IOptionsService),p(7,C.IRenderService),p(8,C.ICoreBrowserService)],D)},4725:(c,l,u)=>{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 f=u(8343);l.ICharSizeService=(0,f.createDecorator)("CharSizeService"),l.ICoreBrowserService=(0,f.createDecorator)("CoreBrowserService"),l.IMouseService=(0,f.createDecorator)("MouseService"),l.IRenderService=(0,f.createDecorator)("RenderService"),l.ISelectionService=(0,f.createDecorator)("SelectionService"),l.ICharacterJoinerService=(0,f.createDecorator)("CharacterJoinerService"),l.IThemeService=(0,f.createDecorator)("ThemeService"),l.ILinkProviderService=(0,f.createDecorator)("LinkProviderService")},6731:function(c,l,u){var f=this&&this.__decorate||function(D,A,j,O){var P,$=arguments.length,U=$<3?A:O===null?O=Object.getOwnPropertyDescriptor(A,j):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(D,A,j,O);else for(var W=D.length-1;W>=0;W--)(P=D[W])&&(U=($<3?P(U):$>3?P(A,j,U):P(A,j))||U);return $>3&&U&&Object.defineProperty(A,j,U),U},p=this&&this.__param||function(D,A){return function(j,O){A(j,O,D)}};Object.defineProperty(l,"__esModule",{value:!0}),l.ThemeService=l.DEFAULT_ANSI_COLORS=void 0;const h=u(7239),_=u(8055),x=u(8460),C=u(844),w=u(2585),v=_.css.toColor("#ffffff"),b=_.css.toColor("#000000"),y=_.css.toColor("#ffffff"),S=_.css.toColor("#000000"),k={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};l.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const D=[_.css.toColor("#2e3436"),_.css.toColor("#cc0000"),_.css.toColor("#4e9a06"),_.css.toColor("#c4a000"),_.css.toColor("#3465a4"),_.css.toColor("#75507b"),_.css.toColor("#06989a"),_.css.toColor("#d3d7cf"),_.css.toColor("#555753"),_.css.toColor("#ef2929"),_.css.toColor("#8ae234"),_.css.toColor("#fce94f"),_.css.toColor("#729fcf"),_.css.toColor("#ad7fa8"),_.css.toColor("#34e2e2"),_.css.toColor("#eeeeec")],A=[0,95,135,175,215,255];for(let j=0;j<216;j++){const O=A[j/36%6|0],P=A[j/6%6|0],$=A[j%6];D.push({css:_.channels.toCss(O,P,$),rgba:_.channels.toRgba(O,P,$)})}for(let j=0;j<24;j++){const O=8+10*j;D.push({css:_.channels.toCss(O,O,O),rgba:_.channels.toRgba(O,O,O)})}return D})());let T=l.ThemeService=class extends C.Disposable{get colors(){return this._colors}constructor(D){super(),this._optionsService=D,this._contrastCache=new h.ColorContrastCache,this._halfContrastCache=new h.ColorContrastCache,this._onChangeColors=this.register(new x.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:v,background:b,cursor:y,cursorAccent:S,selectionForeground:void 0,selectionBackgroundTransparent:k,selectionBackgroundOpaque:_.color.blend(b,k),selectionInactiveBackgroundTransparent:k,selectionInactiveBackgroundOpaque:_.color.blend(b,k),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(D={}){const A=this._colors;if(A.foreground=R(D.foreground,v),A.background=R(D.background,b),A.cursor=R(D.cursor,y),A.cursorAccent=R(D.cursorAccent,S),A.selectionBackgroundTransparent=R(D.selectionBackground,k),A.selectionBackgroundOpaque=_.color.blend(A.background,A.selectionBackgroundTransparent),A.selectionInactiveBackgroundTransparent=R(D.selectionInactiveBackground,A.selectionBackgroundTransparent),A.selectionInactiveBackgroundOpaque=_.color.blend(A.background,A.selectionInactiveBackgroundTransparent),A.selectionForeground=D.selectionForeground?R(D.selectionForeground,_.NULL_COLOR):void 0,A.selectionForeground===_.NULL_COLOR&&(A.selectionForeground=void 0),_.color.isOpaque(A.selectionBackgroundTransparent)&&(A.selectionBackgroundTransparent=_.color.opacity(A.selectionBackgroundTransparent,.3)),_.color.isOpaque(A.selectionInactiveBackgroundTransparent)&&(A.selectionInactiveBackgroundTransparent=_.color.opacity(A.selectionInactiveBackgroundTransparent,.3)),A.ansi=l.DEFAULT_ANSI_COLORS.slice(),A.ansi[0]=R(D.black,l.DEFAULT_ANSI_COLORS[0]),A.ansi[1]=R(D.red,l.DEFAULT_ANSI_COLORS[1]),A.ansi[2]=R(D.green,l.DEFAULT_ANSI_COLORS[2]),A.ansi[3]=R(D.yellow,l.DEFAULT_ANSI_COLORS[3]),A.ansi[4]=R(D.blue,l.DEFAULT_ANSI_COLORS[4]),A.ansi[5]=R(D.magenta,l.DEFAULT_ANSI_COLORS[5]),A.ansi[6]=R(D.cyan,l.DEFAULT_ANSI_COLORS[6]),A.ansi[7]=R(D.white,l.DEFAULT_ANSI_COLORS[7]),A.ansi[8]=R(D.brightBlack,l.DEFAULT_ANSI_COLORS[8]),A.ansi[9]=R(D.brightRed,l.DEFAULT_ANSI_COLORS[9]),A.ansi[10]=R(D.brightGreen,l.DEFAULT_ANSI_COLORS[10]),A.ansi[11]=R(D.brightYellow,l.DEFAULT_ANSI_COLORS[11]),A.ansi[12]=R(D.brightBlue,l.DEFAULT_ANSI_COLORS[12]),A.ansi[13]=R(D.brightMagenta,l.DEFAULT_ANSI_COLORS[13]),A.ansi[14]=R(D.brightCyan,l.DEFAULT_ANSI_COLORS[14]),A.ansi[15]=R(D.brightWhite,l.DEFAULT_ANSI_COLORS[15]),D.extendedAnsi){const j=Math.min(A.ansi.length-16,D.extendedAnsi.length);for(let O=0;O<j;O++)A.ansi[O+16]=R(D.extendedAnsi[O],l.DEFAULT_ANSI_COLORS[O+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(D){this._restoreColor(D),this._onChangeColors.fire(this.colors)}_restoreColor(D){if(D!==void 0)switch(D){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[D]=this._restoreColors.ansi[D]}else for(let A=0;A<this._restoreColors.ansi.length;++A)this._colors.ansi[A]=this._restoreColors.ansi[A]}modifyColors(D){D(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function R(D,A){if(D!==void 0)try{return _.css.toColor(D)}catch{}return A}l.ThemeService=T=f([p(0,w.IOptionsService)],T)},6349:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CircularList=void 0;const f=u(8460),p=u(844);class h extends p.Disposable{constructor(x){super(),this._maxLength=x,this.onDeleteEmitter=this.register(new f.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new f.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new f.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(x){if(this._maxLength===x)return;const C=new Array(x);for(let w=0;w<Math.min(x,this.length);w++)C[w]=this._array[this._getCyclicIndex(w)];this._array=C,this._maxLength=x,this._startIndex=0}get length(){return this._length}set length(x){if(x>this._length)for(let C=this._length;C<x;C++)this._array[C]=void 0;this._length=x}get(x){return this._array[this._getCyclicIndex(x)]}set(x,C){this._array[this._getCyclicIndex(x)]=C}push(x){this._array[this._getCyclicIndex(this._length)]=x,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(x,C,...w){if(C){for(let v=x;v<this._length-C;v++)this._array[this._getCyclicIndex(v)]=this._array[this._getCyclicIndex(v+C)];this._length-=C,this.onDeleteEmitter.fire({index:x,amount:C})}for(let v=this._length-1;v>=x;v--)this._array[this._getCyclicIndex(v+w.length)]=this._array[this._getCyclicIndex(v)];for(let v=0;v<w.length;v++)this._array[this._getCyclicIndex(x+v)]=w[v];if(w.length&&this.onInsertEmitter.fire({index:x,amount:w.length}),this._length+w.length>this._maxLength){const v=this._length+w.length-this._maxLength;this._startIndex+=v,this._length=this._maxLength,this.onTrimEmitter.fire(v)}else this._length+=w.length}trimStart(x){x>this._length&&(x=this._length),this._startIndex+=x,this._length-=x,this.onTrimEmitter.fire(x)}shiftElements(x,C,w){if(!(C<=0)){if(x<0||x>=this._length)throw new Error("start argument out of range");if(x+w<0)throw new Error("Cannot shift elements in list beyond index 0");if(w>0){for(let b=C-1;b>=0;b--)this.set(x+b+w,this.get(x+b));const v=x+C+w-this._length;if(v>0)for(this._length+=v;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let v=0;v<C;v++)this.set(x+v+w,this.get(x+v))}}_getCyclicIndex(x){return(this._startIndex+x)%this._maxLength}}l.CircularList=h},1439:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.clone=void 0,l.clone=function u(f,p=5){if(typeof f!="object")return f;const h=Array.isArray(f)?[]:{};for(const _ in f)h[_]=p<=1?f[_]:f[_]&&u(f[_],p-1);return h}},8055:(c,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 u=0,f=0,p=0,h=0;var _,x,C,w,v;function b(S){const k=S.toString(16);return k.length<2?"0"+k:k}function y(S,k){return S<k?(k+.05)/(S+.05):(S+.05)/(k+.05)}l.NULL_COLOR={css:"#00000000",rgba:0},(function(S){S.toCss=function(k,T,R,D){return D!==void 0?`#${b(k)}${b(T)}${b(R)}${b(D)}`:`#${b(k)}${b(T)}${b(R)}`},S.toRgba=function(k,T,R,D=255){return(k<<24|T<<16|R<<8|D)>>>0},S.toColor=function(k,T,R,D){return{css:S.toCss(k,T,R,D),rgba:S.toRgba(k,T,R,D)}}})(_||(l.channels=_={})),(function(S){function k(T,R){return h=Math.round(255*R),[u,f,p]=v.toChannels(T.rgba),{css:_.toCss(u,f,p,h),rgba:_.toRgba(u,f,p,h)}}S.blend=function(T,R){if(h=(255&R.rgba)/255,h===1)return{css:R.css,rgba:R.rgba};const D=R.rgba>>24&255,A=R.rgba>>16&255,j=R.rgba>>8&255,O=T.rgba>>24&255,P=T.rgba>>16&255,$=T.rgba>>8&255;return u=O+Math.round((D-O)*h),f=P+Math.round((A-P)*h),p=$+Math.round((j-$)*h),{css:_.toCss(u,f,p),rgba:_.toRgba(u,f,p)}},S.isOpaque=function(T){return(255&T.rgba)==255},S.ensureContrastRatio=function(T,R,D){const A=v.ensureContrastRatio(T.rgba,R.rgba,D);if(A)return _.toColor(A>>24&255,A>>16&255,A>>8&255)},S.opaque=function(T){const R=(255|T.rgba)>>>0;return[u,f,p]=v.toChannels(R),{css:_.toCss(u,f,p),rgba:R}},S.opacity=k,S.multiplyOpacity=function(T,R){return h=255&T.rgba,k(T,h*R/255)},S.toColorRGB=function(T){return[T.rgba>>24&255,T.rgba>>16&255,T.rgba>>8&255]}})(x||(l.color=x={})),(function(S){let k,T;try{const R=document.createElement("canvas");R.width=1,R.height=1;const D=R.getContext("2d",{willReadFrequently:!0});D&&(k=D,k.globalCompositeOperation="copy",T=k.createLinearGradient(0,0,1,1))}catch{}S.toColor=function(R){if(R.match(/#[\da-f]{3,8}/i))switch(R.length){case 4:return u=parseInt(R.slice(1,2).repeat(2),16),f=parseInt(R.slice(2,3).repeat(2),16),p=parseInt(R.slice(3,4).repeat(2),16),_.toColor(u,f,p);case 5:return u=parseInt(R.slice(1,2).repeat(2),16),f=parseInt(R.slice(2,3).repeat(2),16),p=parseInt(R.slice(3,4).repeat(2),16),h=parseInt(R.slice(4,5).repeat(2),16),_.toColor(u,f,p,h);case 7:return{css:R,rgba:(parseInt(R.slice(1),16)<<8|255)>>>0};case 9:return{css:R,rgba:parseInt(R.slice(1),16)>>>0}}const D=R.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(D)return u=parseInt(D[1]),f=parseInt(D[2]),p=parseInt(D[3]),h=Math.round(255*(D[5]===void 0?1:parseFloat(D[5]))),_.toColor(u,f,p,h);if(!k||!T)throw new Error("css.toColor: Unsupported css format");if(k.fillStyle=T,k.fillStyle=R,typeof k.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(k.fillRect(0,0,1,1),[u,f,p,h]=k.getImageData(0,0,1,1).data,h!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:_.toRgba(u,f,p,h),css:R}}})(C||(l.css=C={})),(function(S){function k(T,R,D){const A=T/255,j=R/255,O=D/255;return .2126*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))+.7152*(j<=.03928?j/12.92:Math.pow((j+.055)/1.055,2.4))+.0722*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))}S.relativeLuminance=function(T){return k(T>>16&255,T>>8&255,255&T)},S.relativeLuminance2=k})(w||(l.rgb=w={})),(function(S){function k(R,D,A){const j=R>>24&255,O=R>>16&255,P=R>>8&255;let $=D>>24&255,U=D>>16&255,W=D>>8&255,K=y(w.relativeLuminance2($,U,W),w.relativeLuminance2(j,O,P));for(;K<A&&($>0||U>0||W>0);)$-=Math.max(0,Math.ceil(.1*$)),U-=Math.max(0,Math.ceil(.1*U)),W-=Math.max(0,Math.ceil(.1*W)),K=y(w.relativeLuminance2($,U,W),w.relativeLuminance2(j,O,P));return($<<24|U<<16|W<<8|255)>>>0}function T(R,D,A){const j=R>>24&255,O=R>>16&255,P=R>>8&255;let $=D>>24&255,U=D>>16&255,W=D>>8&255,K=y(w.relativeLuminance2($,U,W),w.relativeLuminance2(j,O,P));for(;K<A&&($<255||U<255||W<255);)$=Math.min(255,$+Math.ceil(.1*(255-$))),U=Math.min(255,U+Math.ceil(.1*(255-U))),W=Math.min(255,W+Math.ceil(.1*(255-W))),K=y(w.relativeLuminance2($,U,W),w.relativeLuminance2(j,O,P));return($<<24|U<<16|W<<8|255)>>>0}S.blend=function(R,D){if(h=(255&D)/255,h===1)return D;const A=D>>24&255,j=D>>16&255,O=D>>8&255,P=R>>24&255,$=R>>16&255,U=R>>8&255;return u=P+Math.round((A-P)*h),f=$+Math.round((j-$)*h),p=U+Math.round((O-U)*h),_.toRgba(u,f,p)},S.ensureContrastRatio=function(R,D,A){const j=w.relativeLuminance(R>>8),O=w.relativeLuminance(D>>8);if(y(j,O)<A){if(O<j){const U=k(R,D,A),W=y(j,w.relativeLuminance(U>>8));if(W<A){const K=T(R,D,A);return W>y(j,w.relativeLuminance(K>>8))?U:K}return U}const P=T(R,D,A),$=y(j,w.relativeLuminance(P>>8));if($<A){const U=k(R,D,A);return $>y(j,w.relativeLuminance(U>>8))?P:U}return P}},S.reduceLuminance=k,S.increaseLuminance=T,S.toChannels=function(R){return[R>>24&255,R>>16&255,R>>8&255,255&R]}})(v||(l.rgba=v={})),l.toPaddedHex=b,l.contrastRatio=y},8969:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreTerminal=void 0;const f=u(844),p=u(2585),h=u(4348),_=u(7866),x=u(744),C=u(7302),w=u(6975),v=u(8460),b=u(1753),y=u(1480),S=u(7994),k=u(9282),T=u(5435),R=u(5981),D=u(2660);let A=!1;class j extends f.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new v.EventEmitter),this._onScroll.event((P=>{var $;($=this._onScrollApi)==null||$.fire(P.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(P){for(const $ in P)this.optionsService.options[$]=P[$]}constructor(P){super(),this._windowsWrappingHeuristics=this.register(new f.MutableDisposable),this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new v.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new v.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new v.EventEmitter),this._instantiationService=new h.InstantiationService,this.optionsService=this.register(new C.OptionsService(P)),this._instantiationService.setService(p.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(x.BufferService)),this._instantiationService.setService(p.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(_.LogService)),this._instantiationService.setService(p.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(w.CoreService)),this._instantiationService.setService(p.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(b.CoreMouseService)),this._instantiationService.setService(p.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(y.UnicodeService)),this._instantiationService.setService(p.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(S.CharsetService),this._instantiationService.setService(p.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(D.OscLinkService),this._instantiationService.setService(p.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new T.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,v.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,v.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,v.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,v.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(($=>{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(($=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new R.WriteBuffer((($,U)=>this._inputHandler.parse($,U)))),this.register((0,v.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(P,$){this._writeBuffer.write(P,$)}writeSync(P,$){this._logService.logLevel<=p.LogLevelEnum.WARN&&!A&&(this._logService.warn("writeSync is unreliable and will be removed soon."),A=!0),this._writeBuffer.writeSync(P,$)}input(P,$=!0){this.coreService.triggerDataEvent(P,$)}resize(P,$){isNaN(P)||isNaN($)||(P=Math.max(P,x.MINIMUM_COLS),$=Math.max($,x.MINIMUM_ROWS),this._bufferService.resize(P,$))}scroll(P,$=!1){this._bufferService.scroll(P,$)}scrollLines(P,$,U){this._bufferService.scrollLines(P,$,U)}scrollPages(P){this.scrollLines(P*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(P){const $=P-this._bufferService.buffer.ydisp;$!==0&&this.scrollLines($)}registerEscHandler(P,$){return this._inputHandler.registerEscHandler(P,$)}registerDcsHandler(P,$){return this._inputHandler.registerDcsHandler(P,$)}registerCsiHandler(P,$){return this._inputHandler.registerCsiHandler(P,$)}registerOscHandler(P,$){return this._inputHandler.registerOscHandler(P,$)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let P=!1;const $=this.optionsService.rawOptions.windowsPty;$&&$.buildNumber!==void 0&&$.buildNumber!==void 0?P=$.backend==="conpty"&&$.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(P=!0),P?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const P=[];P.push(this.onLineFeed(k.updateWindowsModeWrappedState.bind(null,this._bufferService))),P.push(this.registerCsiHandler({final:"H"},(()=>((0,k.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,f.toDisposable)((()=>{for(const $ of P)$.dispose()}))}}}l.CoreTerminal=j},8460:(c,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=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let f=0;f<this._listeners.length;f++)if(this._listeners[f]===u)return void this._listeners.splice(f,1)}}})),this._event}fire(u,f){const p=[];for(let h=0;h<this._listeners.length;h++)p.push(this._listeners[h]);for(let h=0;h<p.length;h++)p[h].call(void 0,u,f)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},l.forwardEvent=function(u,f){return u((p=>f.fire(p)))},l.runAndSubscribe=function(u,f){return f(void 0),u((p=>f(p)))}},5435:function(c,l,u){var f=this&&this.__decorate||function(X,I,L,z){var F,B=arguments.length,Y=B<3?I:z===null?z=Object.getOwnPropertyDescriptor(I,L):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Y=Reflect.decorate(X,I,L,z);else for(var ee=X.length-1;ee>=0;ee--)(F=X[ee])&&(Y=(B<3?F(Y):B>3?F(I,L,Y):F(I,L))||Y);return B>3&&Y&&Object.defineProperty(I,L,Y),Y},p=this&&this.__param||function(X,I){return function(L,z){I(L,z,X)}};Object.defineProperty(l,"__esModule",{value:!0}),l.InputHandler=l.WindowsOptionsReportType=void 0;const h=u(2584),_=u(7116),x=u(2015),C=u(844),w=u(482),v=u(8437),b=u(8460),y=u(643),S=u(511),k=u(3734),T=u(2585),R=u(1480),D=u(6242),A=u(6351),j=u(5941),O={"(":0,")":1,"*":2,"+":3,"-":1,".":2},P=131072;function $(X,I){if(X>24)return I.setWinLines||!1;switch(X){case 1:return!!I.restoreWin;case 2:return!!I.minimizeWin;case 3:return!!I.setWinPosition;case 4:return!!I.setWinSizePixels;case 5:return!!I.raiseWin;case 6:return!!I.lowerWin;case 7:return!!I.refreshWin;case 8:return!!I.setWinSizeChars;case 9:return!!I.maximizeWin;case 10:return!!I.fullscreenWin;case 11:return!!I.getWinState;case 13:return!!I.getWinPosition;case 14:return!!I.getWinSizePixels;case 15:return!!I.getScreenSizePixels;case 16:return!!I.getCellSizePixels;case 18:return!!I.getWinSizeChars;case 19:return!!I.getScreenSizeChars;case 20:return!!I.getIconTitle;case 21:return!!I.getWinTitle;case 22:return!!I.pushTitle;case 23:return!!I.popTitle;case 24:return!!I.setWinLines}return!1}var U;(function(X){X[X.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",X[X.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(U||(l.WindowsOptionsReportType=U={}));let W=0;class K extends C.Disposable{getAttrData(){return this._curAttrData}constructor(I,L,z,F,B,Y,ee,J,G=new x.EscapeSequenceParser){super(),this._bufferService=I,this._charsetService=L,this._coreService=z,this._logService=F,this._optionsService=B,this._oscLinkService=Y,this._coreMouseService=ee,this._unicodeService=J,this._parser=G,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new w.StringToUtf32,this._utf8Decoder=new w.Utf8ToUtf32,this._workCell=new S.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new b.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new b.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new b.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new b.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new b.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new b.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new b.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new b.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new b.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new b.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new b.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new b.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new b.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 V(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((q=>this._activeBuffer=q.activeBuffer))),this._parser.setCsiHandlerFallback(((q,te)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(q),params:te.toArray()})})),this._parser.setEscHandlerFallback((q=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(q)})})),this._parser.setExecuteHandlerFallback((q=>{this._logService.debug("Unknown EXECUTE code: ",{code:q})})),this._parser.setOscHandlerFallback(((q,te,re)=>{this._logService.debug("Unknown OSC code: ",{identifier:q,action:te,data:re})})),this._parser.setDcsHandlerFallback(((q,te,re)=>{te==="HOOK"&&(re=re.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(q),action:te,payload:re})})),this._parser.setPrintHandler(((q,te,re)=>this.print(q,te,re))),this._parser.registerCsiHandler({final:"@"},(q=>this.insertChars(q))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(q=>this.scrollLeft(q))),this._parser.registerCsiHandler({final:"A"},(q=>this.cursorUp(q))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(q=>this.scrollRight(q))),this._parser.registerCsiHandler({final:"B"},(q=>this.cursorDown(q))),this._parser.registerCsiHandler({final:"C"},(q=>this.cursorForward(q))),this._parser.registerCsiHandler({final:"D"},(q=>this.cursorBackward(q))),this._parser.registerCsiHandler({final:"E"},(q=>this.cursorNextLine(q))),this._parser.registerCsiHandler({final:"F"},(q=>this.cursorPrecedingLine(q))),this._parser.registerCsiHandler({final:"G"},(q=>this.cursorCharAbsolute(q))),this._parser.registerCsiHandler({final:"H"},(q=>this.cursorPosition(q))),this._parser.registerCsiHandler({final:"I"},(q=>this.cursorForwardTab(q))),this._parser.registerCsiHandler({final:"J"},(q=>this.eraseInDisplay(q,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(q=>this.eraseInDisplay(q,!0))),this._parser.registerCsiHandler({final:"K"},(q=>this.eraseInLine(q,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(q=>this.eraseInLine(q,!0))),this._parser.registerCsiHandler({final:"L"},(q=>this.insertLines(q))),this._parser.registerCsiHandler({final:"M"},(q=>this.deleteLines(q))),this._parser.registerCsiHandler({final:"P"},(q=>this.deleteChars(q))),this._parser.registerCsiHandler({final:"S"},(q=>this.scrollUp(q))),this._parser.registerCsiHandler({final:"T"},(q=>this.scrollDown(q))),this._parser.registerCsiHandler({final:"X"},(q=>this.eraseChars(q))),this._parser.registerCsiHandler({final:"Z"},(q=>this.cursorBackwardTab(q))),this._parser.registerCsiHandler({final:"`"},(q=>this.charPosAbsolute(q))),this._parser.registerCsiHandler({final:"a"},(q=>this.hPositionRelative(q))),this._parser.registerCsiHandler({final:"b"},(q=>this.repeatPrecedingCharacter(q))),this._parser.registerCsiHandler({final:"c"},(q=>this.sendDeviceAttributesPrimary(q))),this._parser.registerCsiHandler({prefix:">",final:"c"},(q=>this.sendDeviceAttributesSecondary(q))),this._parser.registerCsiHandler({final:"d"},(q=>this.linePosAbsolute(q))),this._parser.registerCsiHandler({final:"e"},(q=>this.vPositionRelative(q))),this._parser.registerCsiHandler({final:"f"},(q=>this.hVPosition(q))),this._parser.registerCsiHandler({final:"g"},(q=>this.tabClear(q))),this._parser.registerCsiHandler({final:"h"},(q=>this.setMode(q))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(q=>this.setModePrivate(q))),this._parser.registerCsiHandler({final:"l"},(q=>this.resetMode(q))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(q=>this.resetModePrivate(q))),this._parser.registerCsiHandler({final:"m"},(q=>this.charAttributes(q))),this._parser.registerCsiHandler({final:"n"},(q=>this.deviceStatus(q))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(q=>this.deviceStatusPrivate(q))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(q=>this.softReset(q))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(q=>this.setCursorStyle(q))),this._parser.registerCsiHandler({final:"r"},(q=>this.setScrollRegion(q))),this._parser.registerCsiHandler({final:"s"},(q=>this.saveCursor(q))),this._parser.registerCsiHandler({final:"t"},(q=>this.windowOptions(q))),this._parser.registerCsiHandler({final:"u"},(q=>this.restoreCursor(q))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(q=>this.insertColumns(q))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(q=>this.deleteColumns(q))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(q=>this.selectProtected(q))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(q=>this.requestMode(q,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(q=>this.requestMode(q,!1))),this._parser.setExecuteHandler(h.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(h.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(h.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(h.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(h.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(h.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(h.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(h.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(h.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new D.OscHandler((q=>(this.setTitle(q),this.setIconName(q),!0)))),this._parser.registerOscHandler(1,new D.OscHandler((q=>this.setIconName(q)))),this._parser.registerOscHandler(2,new D.OscHandler((q=>this.setTitle(q)))),this._parser.registerOscHandler(4,new D.OscHandler((q=>this.setOrReportIndexedColor(q)))),this._parser.registerOscHandler(8,new D.OscHandler((q=>this.setHyperlink(q)))),this._parser.registerOscHandler(10,new D.OscHandler((q=>this.setOrReportFgColor(q)))),this._parser.registerOscHandler(11,new D.OscHandler((q=>this.setOrReportBgColor(q)))),this._parser.registerOscHandler(12,new D.OscHandler((q=>this.setOrReportCursorColor(q)))),this._parser.registerOscHandler(104,new D.OscHandler((q=>this.restoreIndexedColor(q)))),this._parser.registerOscHandler(110,new D.OscHandler((q=>this.restoreFgColor(q)))),this._parser.registerOscHandler(111,new D.OscHandler((q=>this.restoreBgColor(q)))),this._parser.registerOscHandler(112,new D.OscHandler((q=>this.restoreCursorColor(q)))),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 q in _.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:q},(()=>this.selectCharset("("+q))),this._parser.registerEscHandler({intermediates:")",final:q},(()=>this.selectCharset(")"+q))),this._parser.registerEscHandler({intermediates:"*",final:q},(()=>this.selectCharset("*"+q))),this._parser.registerEscHandler({intermediates:"+",final:q},(()=>this.selectCharset("+"+q))),this._parser.registerEscHandler({intermediates:"-",final:q},(()=>this.selectCharset("-"+q))),this._parser.registerEscHandler({intermediates:".",final:q},(()=>this.selectCharset("."+q))),this._parser.registerEscHandler({intermediates:"/",final:q},(()=>this.selectCharset("/"+q)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((q=>(this._logService.error("Parsing error: ",q),q))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new A.DcsHandler(((q,te)=>this.requestStatusString(q,te))))}_preserveStack(I,L,z,F){this._parseStack.paused=!0,this._parseStack.cursorStartX=I,this._parseStack.cursorStartY=L,this._parseStack.decodedLength=z,this._parseStack.position=F}_logSlowResolvingAsync(I){this._logService.logLevel<=T.LogLevelEnum.WARN&&Promise.race([I,new Promise(((L,z)=>setTimeout((()=>z("#SLOW_TIMEOUT")),5e3)))]).catch((L=>{if(L!=="#SLOW_TIMEOUT")throw L;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(I,L){let z,F=this._activeBuffer.x,B=this._activeBuffer.y,Y=0;const ee=this._parseStack.paused;if(ee){if(z=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,L))return this._logSlowResolvingAsync(z),z;F=this._parseStack.cursorStartX,B=this._parseStack.cursorStartY,this._parseStack.paused=!1,I.length>P&&(Y=this._parseStack.position+P)}if(this._logService.logLevel<=T.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof I=="string"?` "${I}"`:` "${Array.prototype.map.call(I,(q=>String.fromCharCode(q))).join("")}"`),typeof I=="string"?I.split("").map((q=>q.charCodeAt(0))):I),this._parseBuffer.length<I.length&&this._parseBuffer.length<P&&(this._parseBuffer=new Uint32Array(Math.min(I.length,P))),ee||this._dirtyRowTracker.clearRange(),I.length>P)for(let q=Y;q<I.length;q+=P){const te=q+P<I.length?q+P:I.length,re=typeof I=="string"?this._stringDecoder.decode(I.substring(q,te),this._parseBuffer):this._utf8Decoder.decode(I.subarray(q,te),this._parseBuffer);if(z=this._parser.parse(this._parseBuffer,re))return this._preserveStack(F,B,re,q),this._logSlowResolvingAsync(z),z}else if(!ee){const q=typeof I=="string"?this._stringDecoder.decode(I,this._parseBuffer):this._utf8Decoder.decode(I,this._parseBuffer);if(z=this._parser.parse(this._parseBuffer,q))return this._preserveStack(F,B,q,0),this._logSlowResolvingAsync(z),z}this._activeBuffer.x===F&&this._activeBuffer.y===B||this._onCursorMove.fire();const J=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(J,this._bufferService.rows-1))}print(I,L,z){let F,B;const Y=this._charsetService.charset,ee=this._optionsService.rawOptions.screenReaderMode,J=this._bufferService.cols,G=this._coreService.decPrivateModes.wraparound,q=this._coreService.modes.insertMode,te=this._curAttrData;let re=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&z-L>0&&re.getWidth(this._activeBuffer.x-1)===2&&re.setCellFromCodepoint(this._activeBuffer.x-1,0,1,te);let oe=this._parser.precedingJoinState;for(let se=L;se<z;++se){if(F=I[se],F<127&&Y){const Be=Y[String.fromCharCode(F)];Be&&(F=Be.charCodeAt(0))}const ye=this._unicodeService.charProperties(F,oe);B=R.UnicodeService.extractWidth(ye);const Ee=R.UnicodeService.extractShouldJoin(ye),Ae=Ee?R.UnicodeService.extractWidth(oe):0;if(oe=ye,ee&&this._onA11yChar.fire((0,w.stringFromCodePoint)(F)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+B-Ae>J){if(G){const Be=re;let le=this._activeBuffer.x-Ae;for(this._activeBuffer.x=Ae,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),re=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ae>0&&re instanceof v.BufferLine&&re.copyCellsFrom(Be,le,0,Ae,!1);le<J;)Be.setCellFromCodepoint(le++,0,1,te)}else if(this._activeBuffer.x=J-1,B===2)continue}if(Ee&&this._activeBuffer.x){const Be=re.getWidth(this._activeBuffer.x-1)?1:2;re.addCodepointToCell(this._activeBuffer.x-Be,F,B);for(let le=B-Ae;--le>=0;)re.setCellFromCodepoint(this._activeBuffer.x++,0,0,te)}else if(q&&(re.insertCells(this._activeBuffer.x,B-Ae,this._activeBuffer.getNullCell(te)),re.getWidth(J-1)===2&&re.setCellFromCodepoint(J-1,y.NULL_CELL_CODE,y.NULL_CELL_WIDTH,te)),re.setCellFromCodepoint(this._activeBuffer.x++,F,B,te),B>0)for(;--B;)re.setCellFromCodepoint(this._activeBuffer.x++,0,0,te)}this._parser.precedingJoinState=oe,this._activeBuffer.x<J&&z-L>0&&re.getWidth(this._activeBuffer.x)===0&&!re.hasContent(this._activeBuffer.x)&&re.setCellFromCodepoint(this._activeBuffer.x,0,1,te),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(I,L){return I.final!=="t"||I.prefix||I.intermediates?this._parser.registerCsiHandler(I,L):this._parser.registerCsiHandler(I,(z=>!$(z.params[0],this._optionsService.rawOptions.windowOptions)||L(z)))}registerDcsHandler(I,L){return this._parser.registerDcsHandler(I,new A.DcsHandler(L))}registerEscHandler(I,L){return this._parser.registerEscHandler(I,L)}registerOscHandler(I,L){return this._parser.registerOscHandler(I,new D.OscHandler(L))}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 I;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&&((I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&I.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);L.hasWidth(this._activeBuffer.x)&&!L.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const I=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-I),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(I=this._bufferService.cols-1){this._activeBuffer.x=Math.min(I,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(I,L){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=I,this._activeBuffer.y=this._activeBuffer.scrollTop+L):(this._activeBuffer.x=I,this._activeBuffer.y=L),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(I,L){this._restrictCursor(),this._setCursor(this._activeBuffer.x+I,this._activeBuffer.y+L)}cursorUp(I){const L=this._activeBuffer.y-this._activeBuffer.scrollTop;return L>=0?this._moveCursor(0,-Math.min(L,I.params[0]||1)):this._moveCursor(0,-(I.params[0]||1)),!0}cursorDown(I){const L=this._activeBuffer.scrollBottom-this._activeBuffer.y;return L>=0?this._moveCursor(0,Math.min(L,I.params[0]||1)):this._moveCursor(0,I.params[0]||1),!0}cursorForward(I){return this._moveCursor(I.params[0]||1,0),!0}cursorBackward(I){return this._moveCursor(-(I.params[0]||1),0),!0}cursorNextLine(I){return this.cursorDown(I),this._activeBuffer.x=0,!0}cursorPrecedingLine(I){return this.cursorUp(I),this._activeBuffer.x=0,!0}cursorCharAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(I){return this._setCursor(I.length>=2?(I.params[1]||1)-1:0,(I.params[0]||1)-1),!0}charPosAbsolute(I){return this._setCursor((I.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(I){return this._moveCursor(I.params[0]||1,0),!0}linePosAbsolute(I){return this._setCursor(this._activeBuffer.x,(I.params[0]||1)-1),!0}vPositionRelative(I){return this._moveCursor(0,I.params[0]||1),!0}hVPosition(I){return this.cursorPosition(I),!0}tabClear(I){const L=I.params[0];return L===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:L===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=I.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(I){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let L=I.params[0]||1;for(;L--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(I){const L=I.params[0];return L===1&&(this._curAttrData.bg|=536870912),L!==2&&L!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(I,L,z,F=!1,B=!1){const Y=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);Y.replaceCells(L,z,this._activeBuffer.getNullCell(this._eraseAttrData()),B),F&&(Y.isWrapped=!1)}_resetBufferLine(I,L=!1){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+I);z&&(z.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),L),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+I),z.isWrapped=!1)}eraseInDisplay(I,L=!1){let z;switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:for(z=this._activeBuffer.y,this._dirtyRowTracker.markDirty(z),this._eraseInBufferLine(z++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);z<this._bufferService.rows;z++)this._resetBufferLine(z,L);this._dirtyRowTracker.markDirty(z);break;case 1:for(z=this._activeBuffer.y,this._dirtyRowTracker.markDirty(z),this._eraseInBufferLine(z,0,this._activeBuffer.x+1,!0,L),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(z+1).isWrapped=!1);z--;)this._resetBufferLine(z,L);this._dirtyRowTracker.markDirty(0);break;case 2:for(z=this._bufferService.rows,this._dirtyRowTracker.markDirty(z-1);z--;)this._resetBufferLine(z,L);this._dirtyRowTracker.markDirty(0);break;case 3:const F=this._activeBuffer.lines.length-this._bufferService.rows;F>0&&(this._activeBuffer.lines.trimStart(F),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-F,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-F,0),this._onScroll.fire(0))}return!0}eraseInLine(I,L=!1){switch(this._restrictCursor(this._bufferService.cols),I.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,L);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,L);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,L)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(I){this._restrictCursor();let L=I.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const z=this._activeBuffer.ybase+this._activeBuffer.y,F=this._bufferService.rows-1-this._activeBuffer.scrollBottom,B=this._bufferService.rows-1+this._activeBuffer.ybase-F+1;for(;L--;)this._activeBuffer.lines.splice(B-1,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}deleteLines(I){this._restrictCursor();let L=I.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const z=this._activeBuffer.ybase+this._activeBuffer.y;let F;for(F=this._bufferService.rows-1-this._activeBuffer.scrollBottom,F=this._bufferService.rows-1+this._activeBuffer.ybase-F;L--;)this._activeBuffer.lines.splice(z,1),this._activeBuffer.lines.splice(F,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(I){this._restrictCursor();const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return L&&(L.insertCells(this._activeBuffer.x,I.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(I){this._restrictCursor();const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return L&&(L.deleteCells(this._activeBuffer.x,I.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(I){let L=I.params[0]||1;for(;L--;)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(I){let L=I.params[0]||1;for(;L--;)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(v.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=I.params[0]||1;for(let z=this._activeBuffer.scrollTop;z<=this._activeBuffer.scrollBottom;++z){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);F.deleteCells(0,L,this._activeBuffer.getNullCell(this._eraseAttrData())),F.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=I.params[0]||1;for(let z=this._activeBuffer.scrollTop;z<=this._activeBuffer.scrollBottom;++z){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);F.insertCells(0,L,this._activeBuffer.getNullCell(this._eraseAttrData())),F.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=I.params[0]||1;for(let z=this._activeBuffer.scrollTop;z<=this._activeBuffer.scrollBottom;++z){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);F.insertCells(this._activeBuffer.x,L,this._activeBuffer.getNullCell(this._eraseAttrData())),F.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(I){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const L=I.params[0]||1;for(let z=this._activeBuffer.scrollTop;z<=this._activeBuffer.scrollBottom;++z){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);F.deleteCells(this._activeBuffer.x,L,this._activeBuffer.getNullCell(this._eraseAttrData())),F.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(I){this._restrictCursor();const L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return L&&(L.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(I.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(I){const L=this._parser.precedingJoinState;if(!L)return!0;const z=I.params[0]||1,F=R.UnicodeService.extractWidth(L),B=this._activeBuffer.x-F,Y=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(B),ee=new Uint32Array(Y.length*z);let J=0;for(let q=0;q<Y.length;){const te=Y.codePointAt(q)||0;ee[J++]=te,q+=te>65535?2:1}let G=J;for(let q=1;q<z;++q)ee.copyWithin(G,0,J),G+=J;return this.print(ee,0,G),!0}sendDeviceAttributesPrimary(I){return I.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(h.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(h.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(I){return I.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(h.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(h.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(I.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(h.C0.ESC+"[>83;40003;0c")),!0}_is(I){return(this._optionsService.rawOptions.termName+"").indexOf(I)===0}setMode(I){for(let L=0;L<I.length;L++)switch(I.params[L]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(I){for(let L=0;L<I.length;L++)switch(I.params[L]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,_.DEFAULT_CHARSET),this._charsetService.setgCharset(1,_.DEFAULT_CHARSET),this._charsetService.setgCharset(2,_.DEFAULT_CHARSET),this._charsetService.setgCharset(3,_.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(I){for(let L=0;L<I.length;L++)switch(I.params[L]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(I){for(let L=0;L<I.length;L++)switch(I.params[L]){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(),I.params[L]===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(I,L){const z=this._coreService.decPrivateModes,{activeProtocol:F,activeEncoding:B}=this._coreMouseService,Y=this._coreService,{buffers:ee,cols:J}=this._bufferService,{active:G,alt:q}=ee,te=this._optionsService.rawOptions,re=Ee=>Ee?1:2,oe=I.params[0];return se=oe,ye=L?oe===2?4:oe===4?re(Y.modes.insertMode):oe===12?3:oe===20?re(te.convertEol):0:oe===1?re(z.applicationCursorKeys):oe===3?te.windowOptions.setWinLines?J===80?2:J===132?1:0:0:oe===6?re(z.origin):oe===7?re(z.wraparound):oe===8?3:oe===9?re(F==="X10"):oe===12?re(te.cursorBlink):oe===25?re(!Y.isCursorHidden):oe===45?re(z.reverseWraparound):oe===66?re(z.applicationKeypad):oe===67?4:oe===1e3?re(F==="VT200"):oe===1002?re(F==="DRAG"):oe===1003?re(F==="ANY"):oe===1004?re(z.sendFocus):oe===1005?4:oe===1006?re(B==="SGR"):oe===1015?4:oe===1016?re(B==="SGR_PIXELS"):oe===1048?1:oe===47||oe===1047||oe===1049?re(G===q):oe===2004?re(z.bracketedPasteMode):0,Y.triggerDataEvent(`${h.C0.ESC}[${L?"":"?"}${se};${ye}$y`),!0;var se,ye}_updateAttrColor(I,L,z,F,B){return L===2?(I|=50331648,I&=-16777216,I|=k.AttributeData.fromColorRGB([z,F,B])):L===5&&(I&=-50331904,I|=33554432|255&z),I}_extractColor(I,L,z){const F=[0,0,-1,0,0,0];let B=0,Y=0;do{if(F[Y+B]=I.params[L+Y],I.hasSubParams(L+Y)){const ee=I.getSubParams(L+Y);let J=0;do F[1]===5&&(B=1),F[Y+J+1+B]=ee[J];while(++J<ee.length&&J+Y+1+B<F.length);break}if(F[1]===5&&Y+B>=2||F[1]===2&&Y+B>=5)break;F[1]&&(B=1)}while(++Y+L<I.length&&Y+B<F.length);for(let ee=2;ee<F.length;++ee)F[ee]===-1&&(F[ee]=0);switch(F[0]){case 38:z.fg=this._updateAttrColor(z.fg,F[1],F[3],F[4],F[5]);break;case 48:z.bg=this._updateAttrColor(z.bg,F[1],F[3],F[4],F[5]);break;case 58:z.extended=z.extended.clone(),z.extended.underlineColor=this._updateAttrColor(z.extended.underlineColor,F[1],F[3],F[4],F[5])}return Y}_processUnderline(I,L){L.extended=L.extended.clone(),(!~I||I>5)&&(I=1),L.extended.underlineStyle=I,L.fg|=268435456,I===0&&(L.fg&=-268435457),L.updateExtended()}_processSGR0(I){I.fg=v.DEFAULT_ATTR_DATA.fg,I.bg=v.DEFAULT_ATTR_DATA.bg,I.extended=I.extended.clone(),I.extended.underlineStyle=0,I.extended.underlineColor&=-67108864,I.updateExtended()}charAttributes(I){if(I.length===1&&I.params[0]===0)return this._processSGR0(this._curAttrData),!0;const L=I.length;let z;const F=this._curAttrData;for(let B=0;B<L;B++)z=I.params[B],z>=30&&z<=37?(F.fg&=-50331904,F.fg|=16777216|z-30):z>=40&&z<=47?(F.bg&=-50331904,F.bg|=16777216|z-40):z>=90&&z<=97?(F.fg&=-50331904,F.fg|=16777224|z-90):z>=100&&z<=107?(F.bg&=-50331904,F.bg|=16777224|z-100):z===0?this._processSGR0(F):z===1?F.fg|=134217728:z===3?F.bg|=67108864:z===4?(F.fg|=268435456,this._processUnderline(I.hasSubParams(B)?I.getSubParams(B)[0]:1,F)):z===5?F.fg|=536870912:z===7?F.fg|=67108864:z===8?F.fg|=1073741824:z===9?F.fg|=2147483648:z===2?F.bg|=134217728:z===21?this._processUnderline(2,F):z===22?(F.fg&=-134217729,F.bg&=-134217729):z===23?F.bg&=-67108865:z===24?(F.fg&=-268435457,this._processUnderline(0,F)):z===25?F.fg&=-536870913:z===27?F.fg&=-67108865:z===28?F.fg&=-1073741825:z===29?F.fg&=2147483647:z===39?(F.fg&=-67108864,F.fg|=16777215&v.DEFAULT_ATTR_DATA.fg):z===49?(F.bg&=-67108864,F.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):z===38||z===48||z===58?B+=this._extractColor(I,B,F):z===53?F.bg|=1073741824:z===55?F.bg&=-1073741825:z===59?(F.extended=F.extended.clone(),F.extended.underlineColor=-1,F.updateExtended()):z===100?(F.fg&=-67108864,F.fg|=16777215&v.DEFAULT_ATTR_DATA.fg,F.bg&=-67108864,F.bg|=16777215&v.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",z);return!0}deviceStatus(I){switch(I.params[0]){case 5:this._coreService.triggerDataEvent(`${h.C0.ESC}[0n`);break;case 6:const L=this._activeBuffer.y+1,z=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[${L};${z}R`)}return!0}deviceStatusPrivate(I){if(I.params[0]===6){const L=this._activeBuffer.y+1,z=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[?${L};${z}R`)}return!0}softReset(I){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=v.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(I){const L=I.params[0]||1;switch(L){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 z=L%2==1;return this._optionsService.options.cursorBlink=z,!0}setScrollRegion(I){const L=I.params[0]||1;let z;return(I.length<2||(z=I.params[1])>this._bufferService.rows||z===0)&&(z=this._bufferService.rows),z>L&&(this._activeBuffer.scrollTop=L-1,this._activeBuffer.scrollBottom=z-1,this._setCursor(0,0)),!0}windowOptions(I){if(!$(I.params[0],this._optionsService.rawOptions.windowOptions))return!0;const L=I.length>1?I.params[1]:0;switch(I.params[0]){case 14:L!==2&&this._onRequestWindowsOptionsReport.fire(U.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(U.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${h.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:L!==0&&L!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),L!==0&&L!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:L!==0&&L!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),L!==0&&L!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(I){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(I){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(I){return this._windowTitle=I,this._onTitleChange.fire(I),!0}setIconName(I){return this._iconName=I,!0}setOrReportIndexedColor(I){const L=[],z=I.split(";");for(;z.length>1;){const F=z.shift(),B=z.shift();if(/^\d+$/.exec(F)){const Y=parseInt(F);if(Q(Y))if(B==="?")L.push({type:0,index:Y});else{const ee=(0,j.parseColor)(B);ee&&L.push({type:1,index:Y,color:ee})}}}return L.length&&this._onColor.fire(L),!0}setHyperlink(I){const L=I.split(";");return!(L.length<2)&&(L[1]?this._createHyperlink(L[0],L[1]):!L[0]&&this._finishHyperlink())}_createHyperlink(I,L){this._getCurrentLinkId()&&this._finishHyperlink();const z=I.split(":");let F;const B=z.findIndex((Y=>Y.startsWith("id=")));return B!==-1&&(F=z[B].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:F,uri:L}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(I,L){const z=I.split(";");for(let F=0;F<z.length&&!(L>=this._specialColors.length);++F,++L)if(z[F]==="?")this._onColor.fire([{type:0,index:this._specialColors[L]}]);else{const B=(0,j.parseColor)(z[F]);B&&this._onColor.fire([{type:1,index:this._specialColors[L],color:B}])}return!0}setOrReportFgColor(I){return this._setOrReportSpecialColor(I,0)}setOrReportBgColor(I){return this._setOrReportSpecialColor(I,1)}setOrReportCursorColor(I){return this._setOrReportSpecialColor(I,2)}restoreIndexedColor(I){if(!I)return this._onColor.fire([{type:2}]),!0;const L=[],z=I.split(";");for(let F=0;F<z.length;++F)if(/^\d+$/.exec(z[F])){const B=parseInt(z[F]);Q(B)&&L.push({type:2,index:B})}return L.length&&this._onColor.fire(L),!0}restoreFgColor(I){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(I){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(I){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,_.DEFAULT_CHARSET),!0}selectCharset(I){return I.length!==2?(this.selectDefaultCharset(),!0):(I[0]==="/"||this._charsetService.setgCharset(O[I[0]],_.CHARSETS[I[1]]||_.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 I=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,I,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=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(I){return this._charsetService.setgLevel(I),!0}screenAlignmentPattern(){const I=new S.CellData;I.content=4194373,I.fg=this._curAttrData.fg,I.bg=this._curAttrData.bg,this._setCursor(0,0);for(let L=0;L<this._bufferService.rows;++L){const z=this._activeBuffer.ybase+this._activeBuffer.y+L,F=this._activeBuffer.lines.get(z);F&&(F.fill(I),F.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(I,L){const z=this._bufferService.buffer,F=this._optionsService.rawOptions;return(B=>(this._coreService.triggerDataEvent(`${h.C0.ESC}${B}${h.C0.ESC}\\`),!0))(I==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:I==='"p'?'P1$r61;1"p':I==="r"?`P1$r${z.scrollTop+1};${z.scrollBottom+1}r`:I==="m"?"P1$r0m":I===" q"?`P1$r${{block:2,underline:4,bar:6}[F.cursorStyle]-(F.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(I,L){this._dirtyRowTracker.markRangeDirty(I,L)}}l.InputHandler=K;let V=class{constructor(X){this._bufferService=X,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(X){X<this.start?this.start=X:X>this.end&&(this.end=X)}markRangeDirty(X,I){X>I&&(W=X,X=I,I=W),X<this.start&&(this.start=X),I>this.end&&(this.end=I)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Q(X){return 0<=X&&X<256}V=f([p(0,T.IBufferService)],V)},844:(c,l)=>{function u(f){for(const p of f)p.dispose();f.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 f of this._disposables)f.dispose();this._disposables.length=0}register(f){return this._disposables.push(f),f}unregister(f){const p=this._disposables.indexOf(f);p!==-1&&this._disposables.splice(p,1)}},l.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(f){var p;this._isDisposed||f===this._value||((p=this._value)==null||p.dispose(),this._value=f)}clear(){this.value=void 0}dispose(){var f;this._isDisposed=!0,(f=this._value)==null||f.dispose(),this._value=void 0}},l.toDisposable=function(f){return{dispose:f}},l.disposeArray=u,l.getDisposeArrayDisposable=function(f){return{dispose:()=>u(f)}}},1505:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.FourKeyMap=l.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(p,h,_){this._data[p]||(this._data[p]={}),this._data[p][h]=_}get(p,h){return this._data[p]?this._data[p][h]:void 0}clear(){this._data={}}}l.TwoKeyMap=u,l.FourKeyMap=class{constructor(){this._data=new u}set(f,p,h,_,x){this._data.get(f,p)||this._data.set(f,p,new u),this._data.get(f,p).set(h,_,x)}get(f,p,h,_){var x;return(x=this._data.get(f,p))==null?void 0:x.get(h,_)}clear(){this._data.clear()}}},6114:(c,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 u=l.isNode?"node":navigator.userAgent,f=l.isNode?"node":navigator.platform;l.isFirefox=u.includes("Firefox"),l.isLegacyEdge=u.includes("Edge"),l.isSafari=/^((?!chrome|android).)*safari/i.test(u),l.getSafariVersion=function(){if(!l.isSafari)return 0;const p=u.match(/Version\/(\d+)/);return p===null||p.length<2?0:parseInt(p[1])},l.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(f),l.isIpad=f==="iPad",l.isIphone=f==="iPhone",l.isWindows=["Windows","Win16","Win32","WinCE"].includes(f),l.isLinux=f.indexOf("Linux")>=0,l.isChromeOS=/\bCrOS\b/.test(u)},6106:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SortedList=void 0;let u=0;l.SortedList=class{constructor(f){this._getKey=f,this._array=[]}clear(){this._array.length=0}insert(f){this._array.length!==0?(u=this._search(this._getKey(f)),this._array.splice(u,0,f)):this._array.push(f)}delete(f){if(this._array.length===0)return!1;const p=this._getKey(f);if(p===void 0||(u=this._search(p),u===-1)||this._getKey(this._array[u])!==p)return!1;do if(this._array[u]===f)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===p);return!1}*getKeyIterator(f){if(this._array.length!==0&&(u=this._search(f),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===f))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===f)}forEachByKey(f,p){if(this._array.length!==0&&(u=this._search(f),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===f))do p(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===f)}values(){return[...this._array].values()}_search(f){let p=0,h=this._array.length-1;for(;h>=p;){let _=p+h>>1;const x=this._getKey(this._array[_]);if(x>f)h=_-1;else{if(!(x<f)){for(;_>0&&this._getKey(this._array[_-1])===f;)_--;return _}p=_+1}}return p}}},7226:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DebouncedIdleTask=l.IdleTaskQueue=l.PriorityTaskQueue=void 0;const f=u(6114);class p{constructor(){this._tasks=[],this._i=0}enqueue(x){this._tasks.push(x),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(x){this._idleCallback=void 0;let C=0,w=0,v=x.timeRemaining(),b=0;for(;this._i<this._tasks.length;){if(C=Date.now(),this._tasks[this._i]()||this._i++,C=Math.max(1,Date.now()-C),w=Math.max(C,w),b=x.timeRemaining(),1.5*w>b)return v-C<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(v-C))}ms`),void this._start();v=b}this.clear()}}class h extends p{_requestCallback(x){return setTimeout((()=>x(this._createDeadline(16))))}_cancelCallback(x){clearTimeout(x)}_createDeadline(x){const C=Date.now()+x;return{timeRemaining:()=>Math.max(0,C-Date.now())}}}l.PriorityTaskQueue=h,l.IdleTaskQueue=!f.isNode&&"requestIdleCallback"in window?class extends p{_requestCallback(_){return requestIdleCallback(_)}_cancelCallback(_){cancelIdleCallback(_)}}:h,l.DebouncedIdleTask=class{constructor(){this._queue=new l.IdleTaskQueue}set(_){this._queue.clear(),this._queue.enqueue(_)}flush(){this._queue.flush()}}},9282:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.updateWindowsModeWrappedState=void 0;const f=u(643);l.updateWindowsModeWrappedState=function(p){const h=p.buffer.lines.get(p.buffer.ybase+p.buffer.y-1),_=h==null?void 0:h.get(p.cols-1),x=p.buffer.lines.get(p.buffer.ybase+p.buffer.y);x&&_&&(x.isWrapped=_[f.CHAR_DATA_CODE_INDEX]!==f.NULL_CELL_CODE&&_[f.CHAR_DATA_CODE_INDEX]!==f.WHITESPACE_CELL_CODE)}},3734:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ExtendedAttrs=l.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new f}static toColorRGB(h){return[h>>>16&255,h>>>8&255,255&h]}static fromColorRGB(h){return(255&h[0])<<16|(255&h[1])<<8|255&h[2]}clone(){const h=new u;return h.fg=this.fg,h.bg=this.bg,h.extended=this.extended.clone(),h}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=u;class f{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(h){this._ext=h}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(h){this._ext&=-469762049,this._ext|=h<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(h){this._ext&=-67108864,this._ext|=67108863&h}get urlId(){return this._urlId}set urlId(h){this._urlId=h}get underlineVariantOffset(){const h=(3758096384&this._ext)>>29;return h<0?4294967288^h:h}set underlineVariantOffset(h){this._ext&=536870911,this._ext|=h<<29&3758096384}constructor(h=0,_=0){this._ext=0,this._urlId=0,this._ext=h,this._urlId=_}clone(){return new f(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}l.ExtendedAttrs=f},9092:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Buffer=l.MAX_BUFFER_SIZE=void 0;const f=u(6349),p=u(7226),h=u(3734),_=u(8437),x=u(4634),C=u(511),w=u(643),v=u(4863),b=u(7116);l.MAX_BUFFER_SIZE=4294967295,l.Buffer=class{constructor(y,S,k){this._hasScrollback=y,this._optionsService=S,this._bufferService=k,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=_.DEFAULT_ATTR_DATA.clone(),this.savedCharset=b.DEFAULT_CHARSET,this.markers=[],this._nullCell=C.CellData.fromCharData([0,w.NULL_CELL_CHAR,w.NULL_CELL_WIDTH,w.NULL_CELL_CODE]),this._whitespaceCell=C.CellData.fromCharData([0,w.WHITESPACE_CELL_CHAR,w.WHITESPACE_CELL_WIDTH,w.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new p.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(y){return y?(this._nullCell.fg=y.fg,this._nullCell.bg=y.bg,this._nullCell.extended=y.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new h.ExtendedAttrs),this._nullCell}getWhitespaceCell(y){return y?(this._whitespaceCell.fg=y.fg,this._whitespaceCell.bg=y.bg,this._whitespaceCell.extended=y.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new h.ExtendedAttrs),this._whitespaceCell}getBlankLine(y,S){return new _.BufferLine(this._bufferService.cols,this.getNullCell(y),S)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const y=this.ybase+this.y-this.ydisp;return y>=0&&y<this._rows}_getCorrectBufferLength(y){if(!this._hasScrollback)return y;const S=y+this._optionsService.rawOptions.scrollback;return S>l.MAX_BUFFER_SIZE?l.MAX_BUFFER_SIZE:S}fillViewportRows(y){if(this.lines.length===0){y===void 0&&(y=_.DEFAULT_ATTR_DATA);let S=this._rows;for(;S--;)this.lines.push(this.getBlankLine(y))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(y,S){const k=this.getNullCell(_.DEFAULT_ATTR_DATA);let T=0;const R=this._getCorrectBufferLength(S);if(R>this.lines.maxLength&&(this.lines.maxLength=R),this.lines.length>0){if(this._cols<y)for(let A=0;A<this.lines.length;A++)T+=+this.lines.get(A).resize(y,k);let D=0;if(this._rows<S)for(let A=this._rows;A<S;A++)this.lines.length<S+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new _.BufferLine(y,k)):this.ybase>0&&this.lines.length<=this.ybase+this.y+D+1?(this.ybase--,D++,this.ydisp>0&&this.ydisp--):this.lines.push(new _.BufferLine(y,k)));else for(let A=this._rows;A>S;A--)this.lines.length>S+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(R<this.lines.maxLength){const A=this.lines.length-R;A>0&&(this.lines.trimStart(A),this.ybase=Math.max(this.ybase-A,0),this.ydisp=Math.max(this.ydisp-A,0),this.savedY=Math.max(this.savedY-A,0)),this.lines.maxLength=R}this.x=Math.min(this.x,y-1),this.y=Math.min(this.y,S-1),D&&(this.y+=D),this.savedX=Math.min(this.savedX,y-1),this.scrollTop=0}if(this.scrollBottom=S-1,this._isReflowEnabled&&(this._reflow(y,S),this._cols>y))for(let D=0;D<this.lines.length;D++)T+=+this.lines.get(D).resize(y,k);this._cols=y,this._rows=S,this._memoryCleanupQueue.clear(),T>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let y=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,y=!1);let S=0;for(;this._memoryCleanupPosition<this.lines.length;)if(S+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),S>100)return!0;return y}get _isReflowEnabled(){const y=this._optionsService.rawOptions.windowsPty;return y&&y.buildNumber?this._hasScrollback&&y.backend==="conpty"&&y.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(y,S){this._cols!==y&&(y>this._cols?this._reflowLarger(y,S):this._reflowSmaller(y,S))}_reflowLarger(y,S){const k=(0,x.reflowLargerGetLinesToRemove)(this.lines,this._cols,y,this.ybase+this.y,this.getNullCell(_.DEFAULT_ATTR_DATA));if(k.length>0){const T=(0,x.reflowLargerCreateNewLayout)(this.lines,k);(0,x.reflowLargerApplyNewLayout)(this.lines,T.layout),this._reflowLargerAdjustViewport(y,S,T.countRemoved)}}_reflowLargerAdjustViewport(y,S,k){const T=this.getNullCell(_.DEFAULT_ATTR_DATA);let R=k;for(;R-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<S&&this.lines.push(new _.BufferLine(y,T))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-k,0)}_reflowSmaller(y,S){const k=this.getNullCell(_.DEFAULT_ATTR_DATA),T=[];let R=0;for(let D=this.lines.length-1;D>=0;D--){let A=this.lines.get(D);if(!A||!A.isWrapped&&A.getTrimmedLength()<=y)continue;const j=[A];for(;A.isWrapped&&D>0;)A=this.lines.get(--D),j.unshift(A);const O=this.ybase+this.y;if(O>=D&&O<D+j.length)continue;const P=j[j.length-1].getTrimmedLength(),$=(0,x.reflowSmallerGetNewLineLengths)(j,this._cols,y),U=$.length-j.length;let W;W=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+U):Math.max(0,this.lines.length-this.lines.maxLength+U);const K=[];for(let z=0;z<U;z++){const F=this.getBlankLine(_.DEFAULT_ATTR_DATA,!0);K.push(F)}K.length>0&&(T.push({start:D+j.length+R,newLines:K}),R+=K.length),j.push(...K);let V=$.length-1,Q=$[V];Q===0&&(V--,Q=$[V]);let X=j.length-U-1,I=P;for(;X>=0;){const z=Math.min(I,Q);if(j[V]===void 0)break;if(j[V].copyCellsFrom(j[X],I-z,Q-z,z,!0),Q-=z,Q===0&&(V--,Q=$[V]),I-=z,I===0){X--;const F=Math.max(X,0);I=(0,x.getWrappedLineTrimmedLength)(j,F,this._cols)}}for(let z=0;z<j.length;z++)$[z]<y&&j[z].setCell($[z],k);let L=U-W;for(;L-- >0;)this.ybase===0?this.y<S-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+R)-S&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+U,this.ybase+S-1)}if(T.length>0){const D=[],A=[];for(let V=0;V<this.lines.length;V++)A.push(this.lines.get(V));const j=this.lines.length;let O=j-1,P=0,$=T[P];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+R);let U=0;for(let V=Math.min(this.lines.maxLength-1,j+R-1);V>=0;V--)if($&&$.start>O+U){for(let Q=$.newLines.length-1;Q>=0;Q--)this.lines.set(V--,$.newLines[Q]);V++,D.push({index:O+1,amount:$.newLines.length}),U+=$.newLines.length,$=T[++P]}else this.lines.set(V,A[O--]);let W=0;for(let V=D.length-1;V>=0;V--)D[V].index+=W,this.lines.onInsertEmitter.fire(D[V]),W+=D[V].amount;const K=Math.max(0,j+R-this.lines.maxLength);K>0&&this.lines.onTrimEmitter.fire(K)}}translateBufferLineToString(y,S,k=0,T){const R=this.lines.get(y);return R?R.translateToString(S,k,T):""}getWrappedRangeForLine(y){let S=y,k=y;for(;S>0&&this.lines.get(S).isWrapped;)S--;for(;k+1<this.lines.length&&this.lines.get(k+1).isWrapped;)k++;return{first:S,last:k}}setupTabStops(y){for(y!=null?this.tabs[y]||(y=this.prevStop(y)):(this.tabs={},y=0);y<this._cols;y+=this._optionsService.rawOptions.tabStopWidth)this.tabs[y]=!0}prevStop(y){for(y==null&&(y=this.x);!this.tabs[--y]&&y>0;);return y>=this._cols?this._cols-1:y<0?0:y}nextStop(y){for(y==null&&(y=this.x);!this.tabs[++y]&&y<this._cols;);return y>=this._cols?this._cols-1:y<0?0:y}clearMarkers(y){this._isClearing=!0;for(let S=0;S<this.markers.length;S++)this.markers[S].line===y&&(this.markers[S].dispose(),this.markers.splice(S--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let y=0;y<this.markers.length;y++)this.markers[y].dispose(),this.markers.splice(y--,1);this._isClearing=!1}addMarker(y){const S=new v.Marker(y);return this.markers.push(S),S.register(this.lines.onTrim((k=>{S.line-=k,S.line<0&&S.dispose()}))),S.register(this.lines.onInsert((k=>{S.line>=k.index&&(S.line+=k.amount)}))),S.register(this.lines.onDelete((k=>{S.line>=k.index&&S.line<k.index+k.amount&&S.dispose(),S.line>k.index&&(S.line-=k.amount)}))),S.register(S.onDispose((()=>this._removeMarker(S)))),S}_removeMarker(y){this._isClearing||this.markers.splice(this.markers.indexOf(y),1)}}},8437:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLine=l.DEFAULT_ATTR_DATA=void 0;const f=u(3734),p=u(511),h=u(643),_=u(482);l.DEFAULT_ATTR_DATA=Object.freeze(new f.AttributeData);let x=0;class C{constructor(v,b,y=!1){this.isWrapped=y,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*v);const S=b||p.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]);for(let k=0;k<v;++k)this.setCell(k,S);this.length=v}get(v){const b=this._data[3*v+0],y=2097151&b;return[this._data[3*v+1],2097152&b?this._combined[v]:y?(0,_.stringFromCodePoint)(y):"",b>>22,2097152&b?this._combined[v].charCodeAt(this._combined[v].length-1):y]}set(v,b){this._data[3*v+1]=b[h.CHAR_DATA_ATTR_INDEX],b[h.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[v]=b[1],this._data[3*v+0]=2097152|v|b[h.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*v+0]=b[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[h.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(v){return this._data[3*v+0]>>22}hasWidth(v){return 12582912&this._data[3*v+0]}getFg(v){return this._data[3*v+1]}getBg(v){return this._data[3*v+2]}hasContent(v){return 4194303&this._data[3*v+0]}getCodePoint(v){const b=this._data[3*v+0];return 2097152&b?this._combined[v].charCodeAt(this._combined[v].length-1):2097151&b}isCombined(v){return 2097152&this._data[3*v+0]}getString(v){const b=this._data[3*v+0];return 2097152&b?this._combined[v]:2097151&b?(0,_.stringFromCodePoint)(2097151&b):""}isProtected(v){return 536870912&this._data[3*v+2]}loadCell(v,b){return x=3*v,b.content=this._data[x+0],b.fg=this._data[x+1],b.bg=this._data[x+2],2097152&b.content&&(b.combinedData=this._combined[v]),268435456&b.bg&&(b.extended=this._extendedAttrs[v]),b}setCell(v,b){2097152&b.content&&(this._combined[v]=b.combinedData),268435456&b.bg&&(this._extendedAttrs[v]=b.extended),this._data[3*v+0]=b.content,this._data[3*v+1]=b.fg,this._data[3*v+2]=b.bg}setCellFromCodepoint(v,b,y,S){268435456&S.bg&&(this._extendedAttrs[v]=S.extended),this._data[3*v+0]=b|y<<22,this._data[3*v+1]=S.fg,this._data[3*v+2]=S.bg}addCodepointToCell(v,b,y){let S=this._data[3*v+0];2097152&S?this._combined[v]+=(0,_.stringFromCodePoint)(b):2097151&S?(this._combined[v]=(0,_.stringFromCodePoint)(2097151&S)+(0,_.stringFromCodePoint)(b),S&=-2097152,S|=2097152):S=b|4194304,y&&(S&=-12582913,S|=y<<22),this._data[3*v+0]=S}insertCells(v,b,y){if((v%=this.length)&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,y),b<this.length-v){const S=new p.CellData;for(let k=this.length-v-b-1;k>=0;--k)this.setCell(v+b+k,this.loadCell(v+k,S));for(let k=0;k<b;++k)this.setCell(v+k,y)}else for(let S=v;S<this.length;++S)this.setCell(S,y);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,y)}deleteCells(v,b,y){if(v%=this.length,b<this.length-v){const S=new p.CellData;for(let k=0;k<this.length-v-b;++k)this.setCell(v+k,this.loadCell(v+b+k,S));for(let k=this.length-b;k<this.length;++k)this.setCell(k,y)}else for(let S=v;S<this.length;++S)this.setCell(S,y);v&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,y),this.getWidth(v)!==0||this.hasContent(v)||this.setCellFromCodepoint(v,0,1,y)}replaceCells(v,b,y,S=!1){if(S)for(v&&this.getWidth(v-1)===2&&!this.isProtected(v-1)&&this.setCellFromCodepoint(v-1,0,1,y),b<this.length&&this.getWidth(b-1)===2&&!this.isProtected(b)&&this.setCellFromCodepoint(b,0,1,y);v<b&&v<this.length;)this.isProtected(v)||this.setCell(v,y),v++;else for(v&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,y),b<this.length&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b,0,1,y);v<b&&v<this.length;)this.setCell(v++,y)}resize(v,b){if(v===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const y=3*v;if(v>this.length){if(this._data.buffer.byteLength>=4*y)this._data=new Uint32Array(this._data.buffer,0,y);else{const S=new Uint32Array(y);S.set(this._data),this._data=S}for(let S=this.length;S<v;++S)this.setCell(S,b)}else{this._data=this._data.subarray(0,y);const S=Object.keys(this._combined);for(let T=0;T<S.length;T++){const R=parseInt(S[T],10);R>=v&&delete this._combined[R]}const k=Object.keys(this._extendedAttrs);for(let T=0;T<k.length;T++){const R=parseInt(k[T],10);R>=v&&delete this._extendedAttrs[R]}}return this.length=v,4*y*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const v=new Uint32Array(this._data.length);return v.set(this._data),this._data=v,1}return 0}fill(v,b=!1){if(b)for(let y=0;y<this.length;++y)this.isProtected(y)||this.setCell(y,v);else{this._combined={},this._extendedAttrs={};for(let y=0;y<this.length;++y)this.setCell(y,v)}}copyFrom(v){this.length!==v.length?this._data=new Uint32Array(v._data):this._data.set(v._data),this.length=v.length,this._combined={};for(const b in v._combined)this._combined[b]=v._combined[b];this._extendedAttrs={};for(const b in v._extendedAttrs)this._extendedAttrs[b]=v._extendedAttrs[b];this.isWrapped=v.isWrapped}clone(){const v=new C(0);v._data=new Uint32Array(this._data),v.length=this.length;for(const b in this._combined)v._combined[b]=this._combined[b];for(const b in this._extendedAttrs)v._extendedAttrs[b]=this._extendedAttrs[b];return v.isWrapped=this.isWrapped,v}getTrimmedLength(){for(let v=this.length-1;v>=0;--v)if(4194303&this._data[3*v+0])return v+(this._data[3*v+0]>>22);return 0}getNoBgTrimmedLength(){for(let v=this.length-1;v>=0;--v)if(4194303&this._data[3*v+0]||50331648&this._data[3*v+2])return v+(this._data[3*v+0]>>22);return 0}copyCellsFrom(v,b,y,S,k){const T=v._data;if(k)for(let D=S-1;D>=0;D--){for(let A=0;A<3;A++)this._data[3*(y+D)+A]=T[3*(b+D)+A];268435456&T[3*(b+D)+2]&&(this._extendedAttrs[y+D]=v._extendedAttrs[b+D])}else for(let D=0;D<S;D++){for(let A=0;A<3;A++)this._data[3*(y+D)+A]=T[3*(b+D)+A];268435456&T[3*(b+D)+2]&&(this._extendedAttrs[y+D]=v._extendedAttrs[b+D])}const R=Object.keys(v._combined);for(let D=0;D<R.length;D++){const A=parseInt(R[D],10);A>=b&&(this._combined[A-b+y]=v._combined[A])}}translateToString(v,b,y,S){b=b!=null?b:0,y=y!=null?y:this.length,v&&(y=Math.min(y,this.getTrimmedLength())),S&&(S.length=0);let k="";for(;b<y;){const T=this._data[3*b+0],R=2097151&T,D=2097152&T?this._combined[b]:R?(0,_.stringFromCodePoint)(R):h.WHITESPACE_CELL_CHAR;if(k+=D,S)for(let A=0;A<D.length;++A)S.push(b);b+=T>>22||1}return S&&S.push(b),k}}l.BufferLine=C},4841:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.getRangeLength=void 0,l.getRangeLength=function(u,f){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return f*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(c,l)=>{function u(f,p,h){if(p===f.length-1)return f[p].getTrimmedLength();const _=!f[p].hasContent(h-1)&&f[p].getWidth(h-1)===1,x=f[p+1].getWidth(0)===2;return _&&x?h-1:h}Object.defineProperty(l,"__esModule",{value:!0}),l.getWrappedLineTrimmedLength=l.reflowSmallerGetNewLineLengths=l.reflowLargerApplyNewLayout=l.reflowLargerCreateNewLayout=l.reflowLargerGetLinesToRemove=void 0,l.reflowLargerGetLinesToRemove=function(f,p,h,_,x){const C=[];for(let w=0;w<f.length-1;w++){let v=w,b=f.get(++v);if(!b.isWrapped)continue;const y=[f.get(w)];for(;v<f.length&&b.isWrapped;)y.push(b),b=f.get(++v);if(_>=w&&_<v){w+=y.length-1;continue}let S=0,k=u(y,S,p),T=1,R=0;for(;T<y.length;){const A=u(y,T,p),j=A-R,O=h-k,P=Math.min(j,O);y[S].copyCellsFrom(y[T],R,k,P,!1),k+=P,k===h&&(S++,k=0),R+=P,R===A&&(T++,R=0),k===0&&S!==0&&y[S-1].getWidth(h-1)===2&&(y[S].copyCellsFrom(y[S-1],h-1,k++,1,!1),y[S-1].setCell(h-1,x))}y[S].replaceCells(k,h,x);let D=0;for(let A=y.length-1;A>0&&(A>S||y[A].getTrimmedLength()===0);A--)D++;D>0&&(C.push(w+y.length-D),C.push(D)),w+=y.length-1}return C},l.reflowLargerCreateNewLayout=function(f,p){const h=[];let _=0,x=p[_],C=0;for(let w=0;w<f.length;w++)if(x===w){const v=p[++_];f.onDeleteEmitter.fire({index:w-C,amount:v}),w+=v-1,C+=v,x=p[++_]}else h.push(w);return{layout:h,countRemoved:C}},l.reflowLargerApplyNewLayout=function(f,p){const h=[];for(let _=0;_<p.length;_++)h.push(f.get(p[_]));for(let _=0;_<h.length;_++)f.set(_,h[_]);f.length=p.length},l.reflowSmallerGetNewLineLengths=function(f,p,h){const _=[],x=f.map(((b,y)=>u(f,y,p))).reduce(((b,y)=>b+y));let C=0,w=0,v=0;for(;v<x;){if(x-v<h){_.push(x-v);break}C+=h;const b=u(f,w,p);C>b&&(C-=b,w++);const y=f[w].getWidth(C-1)===2;y&&C--;const S=y?h-1:h;_.push(S),v+=S}return _},l.getWrappedLineTrimmedLength=u},5295:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferSet=void 0;const f=u(8460),p=u(844),h=u(9092);class _ extends p.Disposable{constructor(C,w){super(),this._optionsService=C,this._bufferService=w,this._onBufferActivate=this.register(new f.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 h.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new h.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(C){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(C),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(C,w){this._normal.resize(C,w),this._alt.resize(C,w),this.setupTabStops(C)}setupTabStops(C){this._normal.setupTabStops(C),this._alt.setupTabStops(C)}}l.BufferSet=_},511:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CellData=void 0;const f=u(482),p=u(643),h=u(3734);class _ extends h.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new h.ExtendedAttrs,this.combinedData=""}static fromCharData(C){const w=new _;return w.setFromCharData(C),w}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,f.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(C){this.fg=C[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let w=!1;if(C[p.CHAR_DATA_CHAR_INDEX].length>2)w=!0;else if(C[p.CHAR_DATA_CHAR_INDEX].length===2){const v=C[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=v&&v<=56319){const b=C[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=b&&b<=57343?this.content=1024*(v-55296)+b-56320+65536|C[p.CHAR_DATA_WIDTH_INDEX]<<22:w=!0}else w=!0}else this.content=C[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|C[p.CHAR_DATA_WIDTH_INDEX]<<22;w&&(this.combinedData=C[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|C[p.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.CellData=_},643:(c,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:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Marker=void 0;const f=u(8460),p=u(844);class h{get id(){return this._id}constructor(x){this.line=x,this.isDisposed=!1,this._disposables=[],this._id=h._nextId++,this._onDispose=this.register(new f.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,p.disposeArray)(this._disposables),this._disposables.length=0)}register(x){return this._disposables.push(x),x}}l.Marker=h,h._nextId=1},7116:(c,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:(c,l)=>{var u,f,p;Object.defineProperty(l,"__esModule",{value:!0}),l.C1_ESCAPED=l.C1=l.C0=void 0,(function(h){h.NUL="\0",h.SOH="",h.STX="",h.ETX="",h.EOT="",h.ENQ="",h.ACK="",h.BEL="\x07",h.BS="\b",h.HT=" ",h.LF=`
526
+ `,h.VT="\v",h.FF="\f",h.CR="\r",h.SO="",h.SI="",h.DLE="",h.DC1="",h.DC2="",h.DC3="",h.DC4="",h.NAK="",h.SYN="",h.ETB="",h.CAN="",h.EM="",h.SUB="",h.ESC="\x1B",h.FS="",h.GS="",h.RS="",h.US="",h.SP=" ",h.DEL=""})(u||(l.C0=u={})),(function(h){h.PAD="€",h.HOP="",h.BPH="‚",h.NBH="ƒ",h.IND="„",h.NEL="…",h.SSA="†",h.ESA="‡",h.HTS="ˆ",h.HTJ="‰",h.VTS="Š",h.PLD="‹",h.PLU="Œ",h.RI="",h.SS2="Ž",h.SS3="",h.DCS="",h.PU1="‘",h.PU2="’",h.STS="“",h.CCH="”",h.MW="•",h.SPA="–",h.EPA="—",h.SOS="˜",h.SGCI="™",h.SCI="š",h.CSI="›",h.ST="œ",h.OSC="",h.PM="ž",h.APC="Ÿ"})(f||(l.C1=f={})),(function(h){h.ST=`${u.ESC}\\`})(p||(l.C1_ESCAPED=p={}))},7399:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.evaluateKeyboardEvent=void 0;const f=u(2584),p={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(h,_,x,C){const w={type:0,cancel:!1,key:void 0},v=(h.shiftKey?1:0)|(h.altKey?2:0)|(h.ctrlKey?4:0)|(h.metaKey?8:0);switch(h.keyCode){case 0:h.key==="UIKeyInputUpArrow"?w.key=_?f.C0.ESC+"OA":f.C0.ESC+"[A":h.key==="UIKeyInputLeftArrow"?w.key=_?f.C0.ESC+"OD":f.C0.ESC+"[D":h.key==="UIKeyInputRightArrow"?w.key=_?f.C0.ESC+"OC":f.C0.ESC+"[C":h.key==="UIKeyInputDownArrow"&&(w.key=_?f.C0.ESC+"OB":f.C0.ESC+"[B");break;case 8:w.key=h.ctrlKey?"\b":f.C0.DEL,h.altKey&&(w.key=f.C0.ESC+w.key);break;case 9:if(h.shiftKey){w.key=f.C0.ESC+"[Z";break}w.key=f.C0.HT,w.cancel=!0;break;case 13:w.key=h.altKey?f.C0.ESC+f.C0.CR:f.C0.CR,w.cancel=!0;break;case 27:w.key=f.C0.ESC,h.altKey&&(w.key=f.C0.ESC+f.C0.ESC),w.cancel=!0;break;case 37:if(h.metaKey)break;v?(w.key=f.C0.ESC+"[1;"+(v+1)+"D",w.key===f.C0.ESC+"[1;3D"&&(w.key=f.C0.ESC+(x?"b":"[1;5D"))):w.key=_?f.C0.ESC+"OD":f.C0.ESC+"[D";break;case 39:if(h.metaKey)break;v?(w.key=f.C0.ESC+"[1;"+(v+1)+"C",w.key===f.C0.ESC+"[1;3C"&&(w.key=f.C0.ESC+(x?"f":"[1;5C"))):w.key=_?f.C0.ESC+"OC":f.C0.ESC+"[C";break;case 38:if(h.metaKey)break;v?(w.key=f.C0.ESC+"[1;"+(v+1)+"A",x||w.key!==f.C0.ESC+"[1;3A"||(w.key=f.C0.ESC+"[1;5A")):w.key=_?f.C0.ESC+"OA":f.C0.ESC+"[A";break;case 40:if(h.metaKey)break;v?(w.key=f.C0.ESC+"[1;"+(v+1)+"B",x||w.key!==f.C0.ESC+"[1;3B"||(w.key=f.C0.ESC+"[1;5B")):w.key=_?f.C0.ESC+"OB":f.C0.ESC+"[B";break;case 45:h.shiftKey||h.ctrlKey||(w.key=f.C0.ESC+"[2~");break;case 46:w.key=v?f.C0.ESC+"[3;"+(v+1)+"~":f.C0.ESC+"[3~";break;case 36:w.key=v?f.C0.ESC+"[1;"+(v+1)+"H":_?f.C0.ESC+"OH":f.C0.ESC+"[H";break;case 35:w.key=v?f.C0.ESC+"[1;"+(v+1)+"F":_?f.C0.ESC+"OF":f.C0.ESC+"[F";break;case 33:h.shiftKey?w.type=2:h.ctrlKey?w.key=f.C0.ESC+"[5;"+(v+1)+"~":w.key=f.C0.ESC+"[5~";break;case 34:h.shiftKey?w.type=3:h.ctrlKey?w.key=f.C0.ESC+"[6;"+(v+1)+"~":w.key=f.C0.ESC+"[6~";break;case 112:w.key=v?f.C0.ESC+"[1;"+(v+1)+"P":f.C0.ESC+"OP";break;case 113:w.key=v?f.C0.ESC+"[1;"+(v+1)+"Q":f.C0.ESC+"OQ";break;case 114:w.key=v?f.C0.ESC+"[1;"+(v+1)+"R":f.C0.ESC+"OR";break;case 115:w.key=v?f.C0.ESC+"[1;"+(v+1)+"S":f.C0.ESC+"OS";break;case 116:w.key=v?f.C0.ESC+"[15;"+(v+1)+"~":f.C0.ESC+"[15~";break;case 117:w.key=v?f.C0.ESC+"[17;"+(v+1)+"~":f.C0.ESC+"[17~";break;case 118:w.key=v?f.C0.ESC+"[18;"+(v+1)+"~":f.C0.ESC+"[18~";break;case 119:w.key=v?f.C0.ESC+"[19;"+(v+1)+"~":f.C0.ESC+"[19~";break;case 120:w.key=v?f.C0.ESC+"[20;"+(v+1)+"~":f.C0.ESC+"[20~";break;case 121:w.key=v?f.C0.ESC+"[21;"+(v+1)+"~":f.C0.ESC+"[21~";break;case 122:w.key=v?f.C0.ESC+"[23;"+(v+1)+"~":f.C0.ESC+"[23~";break;case 123:w.key=v?f.C0.ESC+"[24;"+(v+1)+"~":f.C0.ESC+"[24~";break;default:if(!h.ctrlKey||h.shiftKey||h.altKey||h.metaKey)if(x&&!C||!h.altKey||h.metaKey)!x||h.altKey||h.ctrlKey||h.shiftKey||!h.metaKey?h.key&&!h.ctrlKey&&!h.altKey&&!h.metaKey&&h.keyCode>=48&&h.key.length===1?w.key=h.key:h.key&&h.ctrlKey&&(h.key==="_"&&(w.key=f.C0.US),h.key==="@"&&(w.key=f.C0.NUL)):h.keyCode===65&&(w.type=1);else{const b=p[h.keyCode],y=b==null?void 0:b[h.shiftKey?1:0];if(y)w.key=f.C0.ESC+y;else if(h.keyCode>=65&&h.keyCode<=90){const S=h.ctrlKey?h.keyCode-64:h.keyCode+32;let k=String.fromCharCode(S);h.shiftKey&&(k=k.toUpperCase()),w.key=f.C0.ESC+k}else if(h.keyCode===32)w.key=f.C0.ESC+(h.ctrlKey?f.C0.NUL:" ");else if(h.key==="Dead"&&h.code.startsWith("Key")){let S=h.code.slice(3,4);h.shiftKey||(S=S.toLowerCase()),w.key=f.C0.ESC+S,w.cancel=!0}}else h.keyCode>=65&&h.keyCode<=90?w.key=String.fromCharCode(h.keyCode-64):h.keyCode===32?w.key=f.C0.NUL:h.keyCode>=51&&h.keyCode<=55?w.key=String.fromCharCode(h.keyCode-51+27):h.keyCode===56?w.key=f.C0.DEL:h.keyCode===219?w.key=f.C0.ESC:h.keyCode===220?w.key=f.C0.FS:h.keyCode===221&&(w.key=f.C0.GS)}return w}},482:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Utf8ToUtf32=l.StringToUtf32=l.utf32ToString=l.stringFromCodePoint=void 0,l.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},l.utf32ToString=function(u,f=0,p=u.length){let h="";for(let _=f;_<p;++_){let x=u[_];x>65535?(x-=65536,h+=String.fromCharCode(55296+(x>>10))+String.fromCharCode(x%1024+56320)):h+=String.fromCharCode(x)}return h},l.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,f){const p=u.length;if(!p)return 0;let h=0,_=0;if(this._interim){const x=u.charCodeAt(_++);56320<=x&&x<=57343?f[h++]=1024*(this._interim-55296)+x-56320+65536:(f[h++]=this._interim,f[h++]=x),this._interim=0}for(let x=_;x<p;++x){const C=u.charCodeAt(x);if(55296<=C&&C<=56319){if(++x>=p)return this._interim=C,h;const w=u.charCodeAt(x);56320<=w&&w<=57343?f[h++]=1024*(C-55296)+w-56320+65536:(f[h++]=C,f[h++]=w)}else C!==65279&&(f[h++]=C)}return h}},l.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,f){const p=u.length;if(!p)return 0;let h,_,x,C,w=0,v=0,b=0;if(this.interim[0]){let k=!1,T=this.interim[0];T&=(224&T)==192?31:(240&T)==224?15:7;let R,D=0;for(;(R=63&this.interim[++D])&&D<4;)T<<=6,T|=R;const A=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,j=A-D;for(;b<j;){if(b>=p)return 0;if(R=u[b++],(192&R)!=128){b--,k=!0;break}this.interim[D++]=R,T<<=6,T|=63&R}k||(A===2?T<128?b--:f[w++]=T:A===3?T<2048||T>=55296&&T<=57343||T===65279||(f[w++]=T):T<65536||T>1114111||(f[w++]=T)),this.interim.fill(0)}const y=p-4;let S=b;for(;S<p;){for(;!(!(S<y)||128&(h=u[S])||128&(_=u[S+1])||128&(x=u[S+2])||128&(C=u[S+3]));)f[w++]=h,f[w++]=_,f[w++]=x,f[w++]=C,S+=4;if(h=u[S++],h<128)f[w++]=h;else if((224&h)==192){if(S>=p)return this.interim[0]=h,w;if(_=u[S++],(192&_)!=128){S--;continue}if(v=(31&h)<<6|63&_,v<128){S--;continue}f[w++]=v}else if((240&h)==224){if(S>=p)return this.interim[0]=h,w;if(_=u[S++],(192&_)!=128){S--;continue}if(S>=p)return this.interim[0]=h,this.interim[1]=_,w;if(x=u[S++],(192&x)!=128){S--;continue}if(v=(15&h)<<12|(63&_)<<6|63&x,v<2048||v>=55296&&v<=57343||v===65279)continue;f[w++]=v}else if((248&h)==240){if(S>=p)return this.interim[0]=h,w;if(_=u[S++],(192&_)!=128){S--;continue}if(S>=p)return this.interim[0]=h,this.interim[1]=_,w;if(x=u[S++],(192&x)!=128){S--;continue}if(S>=p)return this.interim[0]=h,this.interim[1]=_,this.interim[2]=x,w;if(C=u[S++],(192&C)!=128){S--;continue}if(v=(7&h)<<18|(63&_)<<12|(63&x)<<6|63&C,v<65536||v>1114111)continue;f[w++]=v}}return w}}},225:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeV6=void 0;const f=u(1480),p=[[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]],h=[[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 _;l.UnicodeV6=class{constructor(){if(this.version="6",!_){_=new Uint8Array(65536),_.fill(1),_[0]=0,_.fill(0,1,32),_.fill(0,127,160),_.fill(2,4352,4448),_[9001]=2,_[9002]=2,_.fill(2,11904,42192),_[12351]=1,_.fill(2,44032,55204),_.fill(2,63744,64256),_.fill(2,65040,65050),_.fill(2,65072,65136),_.fill(2,65280,65377),_.fill(2,65504,65511);for(let x=0;x<p.length;++x)_.fill(0,p[x][0],p[x][1]+1)}}wcwidth(x){return x<32?0:x<127?1:x<65536?_[x]:(function(C,w){let v,b=0,y=w.length-1;if(C<w[0][0]||C>w[y][1])return!1;for(;y>=b;)if(v=b+y>>1,C>w[v][1])b=v+1;else{if(!(C<w[v][0]))return!0;y=v-1}return!1})(x,h)?0:x>=131072&&x<=196605||x>=196608&&x<=262141?2:1}charProperties(x,C){let w=this.wcwidth(x),v=w===0&&C!==0;if(v){const b=f.UnicodeService.extractWidth(C);b===0?v=!1:b>w&&(w=b)}return f.UnicodeService.createPropertyValue(0,w,v)}}},5981:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WriteBuffer=void 0;const f=u(8460),p=u(844);class h extends p.Disposable{constructor(x){super(),this._action=x,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new f.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(x,C){if(C!==void 0&&this._syncCalls>C)return void(this._syncCalls=0);if(this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let w;for(this._isSyncWriting=!0;w=this._writeBuffer.shift();){this._action(w);const v=this._callbacks.shift();v&&v()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(x,C){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(C),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(C)}_innerWrite(x=0,C=!0){const w=x||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const v=this._writeBuffer[this._bufferOffset],b=this._action(v,C);if(b){const S=k=>Date.now()-w>=12?setTimeout((()=>this._innerWrite(0,k))):this._innerWrite(w,k);return void b.catch((k=>(queueMicrotask((()=>{throw k})),Promise.resolve(!1)))).then(S)}const y=this._callbacks[this._bufferOffset];if(y&&y(),this._bufferOffset++,this._pendingData-=v.length,Date.now()-w>=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=h},5941:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.toRgbString=l.parseColor=void 0;const u=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,f=/^[\da-f]+$/;function p(h,_){const x=h.toString(16),C=x.length<2?"0"+x:x;switch(_){case 4:return x[0];case 8:return C;case 12:return(C+C).slice(0,3);default:return C+C}}l.parseColor=function(h){if(!h)return;let _=h.toLowerCase();if(_.indexOf("rgb:")===0){_=_.slice(4);const x=u.exec(_);if(x){const C=x[1]?15:x[4]?255:x[7]?4095:65535;return[Math.round(parseInt(x[1]||x[4]||x[7]||x[10],16)/C*255),Math.round(parseInt(x[2]||x[5]||x[8]||x[11],16)/C*255),Math.round(parseInt(x[3]||x[6]||x[9]||x[12],16)/C*255)]}}else if(_.indexOf("#")===0&&(_=_.slice(1),f.exec(_)&&[3,6,9,12].includes(_.length))){const x=_.length/3,C=[0,0,0];for(let w=0;w<3;++w){const v=parseInt(_.slice(x*w,x*w+x),16);C[w]=x===1?v<<4:x===2?v:x===3?v>>4:v>>8}return C}},l.toRgbString=function(h,_=16){const[x,C,w]=h;return`rgb:${p(x,_)}/${p(C,_)}/${p(w,_)}`}},5770:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.PAYLOAD_LIMIT=void 0,l.PAYLOAD_LIMIT=1e7},6351:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DcsHandler=l.DcsParser=void 0;const f=u(482),p=u(8742),h=u(5770),_=[];l.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=_,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=_}registerHandler(C,w){this._handlers[C]===void 0&&(this._handlers[C]=[]);const v=this._handlers[C];return v.push(w),{dispose:()=>{const b=v.indexOf(w);b!==-1&&v.splice(b,1)}}}clearHandler(C){this._handlers[C]&&delete this._handlers[C]}setHandlerFallback(C){this._handlerFb=C}reset(){if(this._active.length)for(let C=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;C>=0;--C)this._active[C].unhook(!1);this._stack.paused=!1,this._active=_,this._ident=0}hook(C,w){if(this.reset(),this._ident=C,this._active=this._handlers[C]||_,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].hook(w);else this._handlerFb(this._ident,"HOOK",w)}put(C,w,v){if(this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].put(C,w,v);else this._handlerFb(this._ident,"PUT",(0,f.utf32ToString)(C,w,v))}unhook(C,w=!0){if(this._active.length){let v=!1,b=this._active.length-1,y=!1;if(this._stack.paused&&(b=this._stack.loopPosition-1,v=w,y=this._stack.fallThrough,this._stack.paused=!1),!y&&v===!1){for(;b>=0&&(v=this._active[b].unhook(C),v!==!0);b--)if(v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!1,v;b--}for(;b>=0;b--)if(v=this._active[b].unhook(!1),v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=b,this._stack.fallThrough=!0,v}else this._handlerFb(this._ident,"UNHOOK",C);this._active=_,this._ident=0}};const x=new p.Params;x.addParam(0),l.DcsHandler=class{constructor(C){this._handler=C,this._data="",this._params=x,this._hitLimit=!1}hook(C){this._params=C.length>1||C.params[0]?C.clone():x,this._data="",this._hitLimit=!1}put(C,w,v){this._hitLimit||(this._data+=(0,f.utf32ToString)(C,w,v),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(C){let w=!1;if(this._hitLimit)w=!1;else if(C&&(w=this._handler(this._data,this._params),w instanceof Promise))return w.then((v=>(this._params=x,this._data="",this._hitLimit=!1,v)));return this._params=x,this._data="",this._hitLimit=!1,w}}},2015:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.EscapeSequenceParser=l.VT500_TRANSITION_TABLE=l.TransitionTable=void 0;const f=u(844),p=u(8742),h=u(6242),_=u(6351);class x{constructor(b){this.table=new Uint8Array(b)}setDefault(b,y){this.table.fill(b<<4|y)}add(b,y,S,k){this.table[y<<8|b]=S<<4|k}addMany(b,y,S,k){for(let T=0;T<b.length;T++)this.table[y<<8|b[T]]=S<<4|k}}l.TransitionTable=x;const C=160;l.VT500_TRANSITION_TABLE=(function(){const v=new x(4095),b=Array.apply(null,Array(256)).map(((D,A)=>A)),y=(D,A)=>b.slice(D,A),S=y(32,127),k=y(0,24);k.push(25),k.push.apply(k,y(28,32));const T=y(0,14);let R;for(R in v.setDefault(1,0),v.addMany(S,0,2,0),T)v.addMany([24,26,153,154],R,3,0),v.addMany(y(128,144),R,3,0),v.addMany(y(144,152),R,3,0),v.add(156,R,0,0),v.add(27,R,11,1),v.add(157,R,4,8),v.addMany([152,158,159],R,0,7),v.add(155,R,11,3),v.add(144,R,11,9);return v.addMany(k,0,3,0),v.addMany(k,1,3,1),v.add(127,1,0,1),v.addMany(k,8,0,8),v.addMany(k,3,3,3),v.add(127,3,0,3),v.addMany(k,4,3,4),v.add(127,4,0,4),v.addMany(k,6,3,6),v.addMany(k,5,3,5),v.add(127,5,0,5),v.addMany(k,2,3,2),v.add(127,2,0,2),v.add(93,1,4,8),v.addMany(S,8,5,8),v.add(127,8,5,8),v.addMany([156,27,24,26,7],8,6,0),v.addMany(y(28,32),8,0,8),v.addMany([88,94,95],1,0,7),v.addMany(S,7,0,7),v.addMany(k,7,0,7),v.add(156,7,0,0),v.add(127,7,0,7),v.add(91,1,11,3),v.addMany(y(64,127),3,7,0),v.addMany(y(48,60),3,8,4),v.addMany([60,61,62,63],3,9,4),v.addMany(y(48,60),4,8,4),v.addMany(y(64,127),4,7,0),v.addMany([60,61,62,63],4,0,6),v.addMany(y(32,64),6,0,6),v.add(127,6,0,6),v.addMany(y(64,127),6,0,0),v.addMany(y(32,48),3,9,5),v.addMany(y(32,48),5,9,5),v.addMany(y(48,64),5,0,6),v.addMany(y(64,127),5,7,0),v.addMany(y(32,48),4,9,5),v.addMany(y(32,48),1,9,2),v.addMany(y(32,48),2,9,2),v.addMany(y(48,127),2,10,0),v.addMany(y(48,80),1,10,0),v.addMany(y(81,88),1,10,0),v.addMany([89,90,92],1,10,0),v.addMany(y(96,127),1,10,0),v.add(80,1,11,9),v.addMany(k,9,0,9),v.add(127,9,0,9),v.addMany(y(28,32),9,0,9),v.addMany(y(32,48),9,9,12),v.addMany(y(48,60),9,8,10),v.addMany([60,61,62,63],9,9,10),v.addMany(k,11,0,11),v.addMany(y(32,128),11,0,11),v.addMany(y(28,32),11,0,11),v.addMany(k,10,0,10),v.add(127,10,0,10),v.addMany(y(28,32),10,0,10),v.addMany(y(48,60),10,8,10),v.addMany([60,61,62,63],10,0,11),v.addMany(y(32,48),10,9,12),v.addMany(k,12,0,12),v.add(127,12,0,12),v.addMany(y(28,32),12,0,12),v.addMany(y(32,48),12,9,12),v.addMany(y(48,64),12,0,11),v.addMany(y(64,127),12,12,13),v.addMany(y(64,127),10,12,13),v.addMany(y(64,127),9,12,13),v.addMany(k,13,13,13),v.addMany(S,13,13,13),v.add(127,13,0,13),v.addMany([27,156,24,26],13,14,0),v.add(C,0,2,0),v.add(C,8,5,8),v.add(C,6,0,6),v.add(C,11,0,11),v.add(C,13,13,13),v})();class w extends f.Disposable{constructor(b=l.VT500_TRANSITION_TABLE){super(),this._transitions=b,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new p.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(y,S,k)=>{},this._executeHandlerFb=y=>{},this._csiHandlerFb=(y,S)=>{},this._escHandlerFb=y=>{},this._errorHandlerFb=y=>y,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,f.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new h.OscParser),this._dcsParser=this.register(new _.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(b,y=[64,126]){let S=0;if(b.prefix){if(b.prefix.length>1)throw new Error("only one byte as prefix supported");if(S=b.prefix.charCodeAt(0),S&&60>S||S>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(b.intermediates){if(b.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let T=0;T<b.intermediates.length;++T){const R=b.intermediates.charCodeAt(T);if(32>R||R>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");S<<=8,S|=R}}if(b.final.length!==1)throw new Error("final must be a single byte");const k=b.final.charCodeAt(0);if(y[0]>k||k>y[1])throw new Error(`final must be in range ${y[0]} .. ${y[1]}`);return S<<=8,S|=k,S}identToString(b){const y=[];for(;b;)y.push(String.fromCharCode(255&b)),b>>=8;return y.reverse().join("")}setPrintHandler(b){this._printHandler=b}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(b,y){const S=this._identifier(b,[48,126]);this._escHandlers[S]===void 0&&(this._escHandlers[S]=[]);const k=this._escHandlers[S];return k.push(y),{dispose:()=>{const T=k.indexOf(y);T!==-1&&k.splice(T,1)}}}clearEscHandler(b){this._escHandlers[this._identifier(b,[48,126])]&&delete this._escHandlers[this._identifier(b,[48,126])]}setEscHandlerFallback(b){this._escHandlerFb=b}setExecuteHandler(b,y){this._executeHandlers[b.charCodeAt(0)]=y}clearExecuteHandler(b){this._executeHandlers[b.charCodeAt(0)]&&delete this._executeHandlers[b.charCodeAt(0)]}setExecuteHandlerFallback(b){this._executeHandlerFb=b}registerCsiHandler(b,y){const S=this._identifier(b);this._csiHandlers[S]===void 0&&(this._csiHandlers[S]=[]);const k=this._csiHandlers[S];return k.push(y),{dispose:()=>{const T=k.indexOf(y);T!==-1&&k.splice(T,1)}}}clearCsiHandler(b){this._csiHandlers[this._identifier(b)]&&delete this._csiHandlers[this._identifier(b)]}setCsiHandlerFallback(b){this._csiHandlerFb=b}registerDcsHandler(b,y){return this._dcsParser.registerHandler(this._identifier(b),y)}clearDcsHandler(b){this._dcsParser.clearHandler(this._identifier(b))}setDcsHandlerFallback(b){this._dcsParser.setHandlerFallback(b)}registerOscHandler(b,y){return this._oscParser.registerHandler(b,y)}clearOscHandler(b){this._oscParser.clearHandler(b)}setOscHandlerFallback(b){this._oscParser.setHandlerFallback(b)}setErrorHandler(b){this._errorHandler=b}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(b,y,S,k,T){this._parseStack.state=b,this._parseStack.handlers=y,this._parseStack.handlerPos=S,this._parseStack.transition=k,this._parseStack.chunkPos=T}parse(b,y,S){let k,T=0,R=0,D=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,D=this._parseStack.chunkPos+1;else{if(S===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const A=this._parseStack.handlers;let j=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(S===!1&&j>-1){for(;j>=0&&(k=A[j](this._params),k!==!0);j--)if(k instanceof Promise)return this._parseStack.handlerPos=j,k}this._parseStack.handlers=[];break;case 4:if(S===!1&&j>-1){for(;j>=0&&(k=A[j](),k!==!0);j--)if(k instanceof Promise)return this._parseStack.handlerPos=j,k}this._parseStack.handlers=[];break;case 6:if(T=b[this._parseStack.chunkPos],k=this._dcsParser.unhook(T!==24&&T!==26,S),k)return k;T===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(T=b[this._parseStack.chunkPos],k=this._oscParser.end(T!==24&&T!==26,S),k)return k;T===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,D=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let A=D;A<y;++A){switch(T=b[A],R=this._transitions.table[this.currentState<<8|(T<160?T:C)],R>>4){case 2:for(let U=A+1;;++U){if(U>=y||(T=b[U])<32||T>126&&T<C){this._printHandler(b,A,U),A=U-1;break}if(++U>=y||(T=b[U])<32||T>126&&T<C){this._printHandler(b,A,U),A=U-1;break}if(++U>=y||(T=b[U])<32||T>126&&T<C){this._printHandler(b,A,U),A=U-1;break}if(++U>=y||(T=b[U])<32||T>126&&T<C){this._printHandler(b,A,U),A=U-1;break}}break;case 3:this._executeHandlers[T]?this._executeHandlers[T]():this._executeHandlerFb(T),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:A,code:T,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const j=this._csiHandlers[this._collect<<8|T];let O=j?j.length-1:-1;for(;O>=0&&(k=j[O](this._params),k!==!0);O--)if(k instanceof Promise)return this._preserveStack(3,j,O,R,A),k;O<0&&this._csiHandlerFb(this._collect<<8|T,this._params),this.precedingJoinState=0;break;case 8:do switch(T){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(T-48)}while(++A<y&&(T=b[A])>47&&T<60);A--;break;case 9:this._collect<<=8,this._collect|=T;break;case 10:const P=this._escHandlers[this._collect<<8|T];let $=P?P.length-1:-1;for(;$>=0&&(k=P[$](),k!==!0);$--)if(k instanceof Promise)return this._preserveStack(4,P,$,R,A),k;$<0&&this._escHandlerFb(this._collect<<8|T),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|T,this._params);break;case 13:for(let U=A+1;;++U)if(U>=y||(T=b[U])===24||T===26||T===27||T>127&&T<C){this._dcsParser.put(b,A,U),A=U-1;break}break;case 14:if(k=this._dcsParser.unhook(T!==24&&T!==26),k)return this._preserveStack(6,[],0,R,A),k;T===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let U=A+1;;U++)if(U>=y||(T=b[U])<32||T>127&&T<C){this._oscParser.put(b,A,U),A=U-1;break}break;case 6:if(k=this._oscParser.end(T!==24&&T!==26),k)return this._preserveStack(5,[],0,R,A),k;T===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&R}}}l.EscapeSequenceParser=w},6242:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OscHandler=l.OscParser=void 0;const f=u(5770),p=u(482),h=[];l.OscParser=class{constructor(){this._state=0,this._active=h,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(_,x){this._handlers[_]===void 0&&(this._handlers[_]=[]);const C=this._handlers[_];return C.push(x),{dispose:()=>{const w=C.indexOf(x);w!==-1&&C.splice(w,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=h}reset(){if(this._state===2)for(let _=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;_>=0;--_)this._active[_].end(!1);this._stack.paused=!1,this._active=h,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||h,this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].start();else this._handlerFb(this._id,"START")}_put(_,x,C){if(this._active.length)for(let w=this._active.length-1;w>=0;w--)this._active[w].put(_,x,C);else this._handlerFb(this._id,"PUT",(0,p.utf32ToString)(_,x,C))}start(){this.reset(),this._state=1}put(_,x,C){if(this._state!==3){if(this._state===1)for(;x<C;){const w=_[x++];if(w===59){this._state=2,this._start();break}if(w<48||57<w)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+w-48}this._state===2&&C-x>0&&this._put(_,x,C)}}end(_,x=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let C=!1,w=this._active.length-1,v=!1;if(this._stack.paused&&(w=this._stack.loopPosition-1,C=x,v=this._stack.fallThrough,this._stack.paused=!1),!v&&C===!1){for(;w>=0&&(C=this._active[w].end(_),C!==!0);w--)if(C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!1,C;w--}for(;w>=0;w--)if(C=this._active[w].end(!1),C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!0,C}else this._handlerFb(this._id,"END",_);this._active=h,this._id=-1,this._state=0}}},l.OscHandler=class{constructor(_){this._handler=_,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(_,x,C){this._hitLimit||(this._data+=(0,p.utf32ToString)(_,x,C),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(_){let x=!1;if(this._hitLimit)x=!1;else if(_&&(x=this._handler(this._data),x instanceof Promise))return x.then((C=>(this._data="",this._hitLimit=!1,C)));return this._data="",this._hitLimit=!1,x}}},8742:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Params=void 0;const u=2147483647;class f{static fromArray(h){const _=new f;if(!h.length)return _;for(let x=Array.isArray(h[0])?1:0;x<h.length;++x){const C=h[x];if(Array.isArray(C))for(let w=0;w<C.length;++w)_.addSubParam(C[w]);else _.addParam(C)}return _}constructor(h=32,_=32){if(this.maxLength=h,this.maxSubParamsLength=_,_>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(h),this.length=0,this._subParams=new Int32Array(_),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(h),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const h=new f(this.maxLength,this.maxSubParamsLength);return h.params.set(this.params),h.length=this.length,h._subParams.set(this._subParams),h._subParamsLength=this._subParamsLength,h._subParamsIdx.set(this._subParamsIdx),h._rejectDigits=this._rejectDigits,h._rejectSubDigits=this._rejectSubDigits,h._digitIsSub=this._digitIsSub,h}toArray(){const h=[];for(let _=0;_<this.length;++_){h.push(this.params[_]);const x=this._subParamsIdx[_]>>8,C=255&this._subParamsIdx[_];C-x>0&&h.push(Array.prototype.slice.call(this._subParams,x,C))}return h}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(h){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=h>u?u:h}}addSubParam(h){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=h>u?u:h,this._subParamsIdx[this.length-1]++}}hasSubParams(h){return(255&this._subParamsIdx[h])-(this._subParamsIdx[h]>>8)>0}getSubParams(h){const _=this._subParamsIdx[h]>>8,x=255&this._subParamsIdx[h];return x-_>0?this._subParams.subarray(_,x):null}getSubParamsAll(){const h={};for(let _=0;_<this.length;++_){const x=this._subParamsIdx[_]>>8,C=255&this._subParamsIdx[_];C-x>0&&(h[_]=this._subParams.slice(x,C))}return h}addDigit(h){let _;if(this._rejectDigits||!(_=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const x=this._digitIsSub?this._subParams:this.params,C=x[_-1];x[_-1]=~C?Math.min(10*C+h,u):h}}l.Params=f},5741:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.AddonManager=void 0,l.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,f){const p={instance:f,dispose:f.dispose,isDisposed:!1};this._addons.push(p),f.dispose=()=>this._wrappedAddonDispose(p),f.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let f=-1;for(let p=0;p<this._addons.length;p++)if(this._addons[p]===u){f=p;break}if(f===-1)throw new Error("Could not dispose an addon that has not been loaded");u.isDisposed=!0,u.dispose.apply(u.instance),this._addons.splice(f,1)}}},8771:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferApiView=void 0;const f=u(3785),p=u(511);l.BufferApiView=class{constructor(h,_){this._buffer=h,this.type=_}init(h){return this._buffer=h,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(h){const _=this._buffer.lines.get(h);if(_)return new f.BufferLineApiView(_)}getNullCell(){return new p.CellData}}},3785:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLineApiView=void 0;const f=u(511);l.BufferLineApiView=class{constructor(p){this._line=p}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(p,h){if(!(p<0||p>=this._line.length))return h?(this._line.loadCell(p,h),h):this._line.loadCell(p,new f.CellData)}translateToString(p,h,_){return this._line.translateToString(p,h,_)}}},8285:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferNamespaceApi=void 0;const f=u(8771),p=u(8460),h=u(844);class _ extends h.Disposable{constructor(C){super(),this._core=C,this._onBufferChange=this.register(new p.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new f.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new f.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=_},7975:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ParserApi=void 0,l.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,f){return this._core.registerCsiHandler(u,(p=>f(p.toArray())))}addCsiHandler(u,f){return this.registerCsiHandler(u,f)}registerDcsHandler(u,f){return this._core.registerDcsHandler(u,((p,h)=>f(p,h.toArray())))}addDcsHandler(u,f){return this.registerDcsHandler(u,f)}registerEscHandler(u,f){return this._core.registerEscHandler(u,f)}addEscHandler(u,f){return this.registerEscHandler(u,f)}registerOscHandler(u,f){return this._core.registerOscHandler(u,f)}addOscHandler(u,f){return this.registerOscHandler(u,f)}}},7090:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeApi=void 0,l.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(c,l,u){var f=this&&this.__decorate||function(v,b,y,S){var k,T=arguments.length,R=T<3?b:S===null?S=Object.getOwnPropertyDescriptor(b,y):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(v,b,y,S);else for(var D=v.length-1;D>=0;D--)(k=v[D])&&(R=(T<3?k(R):T>3?k(b,y,R):k(b,y))||R);return T>3&&R&&Object.defineProperty(b,y,R),R},p=this&&this.__param||function(v,b){return function(y,S){b(y,S,v)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferService=l.MINIMUM_ROWS=l.MINIMUM_COLS=void 0;const h=u(8460),_=u(844),x=u(5295),C=u(2585);l.MINIMUM_COLS=2,l.MINIMUM_ROWS=1;let w=l.BufferService=class extends _.Disposable{get buffer(){return this.buffers.active}constructor(v){super(),this.isUserScrolling=!1,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(v.rawOptions.cols||0,l.MINIMUM_COLS),this.rows=Math.max(v.rawOptions.rows||0,l.MINIMUM_ROWS),this.buffers=this.register(new x.BufferSet(v,this))}resize(v,b){this.cols=v,this.rows=b,this.buffers.resize(v,b),this._onResize.fire({cols:v,rows:b})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(v,b=!1){const y=this.buffer;let S;S=this._cachedBlankLine,S&&S.length===this.cols&&S.getFg(0)===v.fg&&S.getBg(0)===v.bg||(S=y.getBlankLine(v,b),this._cachedBlankLine=S),S.isWrapped=b;const k=y.ybase+y.scrollTop,T=y.ybase+y.scrollBottom;if(y.scrollTop===0){const R=y.lines.isFull;T===y.lines.length-1?R?y.lines.recycle().copyFrom(S):y.lines.push(S.clone()):y.lines.splice(T+1,0,S.clone()),R?this.isUserScrolling&&(y.ydisp=Math.max(y.ydisp-1,0)):(y.ybase++,this.isUserScrolling||y.ydisp++)}else{const R=T-k+1;y.lines.shiftElements(k+1,R-1,-1),y.lines.set(T,S.clone())}this.isUserScrolling||(y.ydisp=y.ybase),this._onScroll.fire(y.ydisp)}scrollLines(v,b,y){const S=this.buffer;if(v<0){if(S.ydisp===0)return;this.isUserScrolling=!0}else v+S.ydisp>=S.ybase&&(this.isUserScrolling=!1);const k=S.ydisp;S.ydisp=Math.max(Math.min(S.ydisp+v,S.ybase),0),k!==S.ydisp&&(b||this._onScroll.fire(S.ydisp))}};l.BufferService=w=f([p(0,C.IOptionsService)],w)},7994:(c,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(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,f){this._charsets[u]=f,this.glevel===u&&(this.charset=f)}}},1753:function(c,l,u){var f=this&&this.__decorate||function(S,k,T,R){var D,A=arguments.length,j=A<3?k:R===null?R=Object.getOwnPropertyDescriptor(k,T):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(S,k,T,R);else for(var O=S.length-1;O>=0;O--)(D=S[O])&&(j=(A<3?D(j):A>3?D(k,T,j):D(k,T))||j);return A>3&&j&&Object.defineProperty(k,T,j),j},p=this&&this.__param||function(S,k){return function(T,R){k(T,R,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreMouseService=void 0;const h=u(2585),_=u(8460),x=u(844),C={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:S=>S.button!==4&&S.action===1&&(S.ctrl=!1,S.alt=!1,S.shift=!1,!0)},VT200:{events:19,restrict:S=>S.action!==32},DRAG:{events:23,restrict:S=>S.action!==32||S.button!==3},ANY:{events:31,restrict:S=>!0}};function w(S,k){let T=(S.ctrl?16:0)|(S.shift?4:0)|(S.alt?8:0);return S.button===4?(T|=64,T|=S.action):(T|=3&S.button,4&S.button&&(T|=64),8&S.button&&(T|=128),S.action===32?T|=32:S.action!==0||k||(T|=3)),T}const v=String.fromCharCode,b={DEFAULT:S=>{const k=[w(S,!1)+32,S.col+32,S.row+32];return k[0]>255||k[1]>255||k[2]>255?"":`\x1B[M${v(k[0])}${v(k[1])}${v(k[2])}`},SGR:S=>{const k=S.action===0&&S.button!==4?"m":"M";return`\x1B[<${w(S,!0)};${S.col};${S.row}${k}`},SGR_PIXELS:S=>{const k=S.action===0&&S.button!==4?"m":"M";return`\x1B[<${w(S,!0)};${S.x};${S.y}${k}`}};let y=l.CoreMouseService=class extends x.Disposable{constructor(S,k){super(),this._bufferService=S,this._coreService=k,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new _.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const T of Object.keys(C))this.addProtocol(T,C[T]);for(const T of Object.keys(b))this.addEncoding(T,b[T]);this.reset()}addProtocol(S,k){this._protocols[S]=k}addEncoding(S,k){this._encodings[S]=k}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(S){if(!this._protocols[S])throw new Error(`unknown protocol "${S}"`);this._activeProtocol=S,this._onProtocolChange.fire(this._protocols[S].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(S){if(!this._encodings[S])throw new Error(`unknown encoding "${S}"`);this._activeEncoding=S}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(S){if(S.col<0||S.col>=this._bufferService.cols||S.row<0||S.row>=this._bufferService.rows||S.button===4&&S.action===32||S.button===3&&S.action!==32||S.button!==4&&(S.action===2||S.action===3)||(S.col++,S.row++,S.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,S,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(S))return!1;const k=this._encodings[this._activeEncoding](S);return k&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(k):this._coreService.triggerDataEvent(k,!0)),this._lastEvent=S,!0}explainEvents(S){return{down:!!(1&S),up:!!(2&S),drag:!!(4&S),move:!!(8&S),wheel:!!(16&S)}}_equalEvents(S,k,T){if(T){if(S.x!==k.x||S.y!==k.y)return!1}else if(S.col!==k.col||S.row!==k.row)return!1;return S.button===k.button&&S.action===k.action&&S.ctrl===k.ctrl&&S.alt===k.alt&&S.shift===k.shift}};l.CoreMouseService=y=f([p(0,h.IBufferService),p(1,h.ICoreService)],y)},6975:function(c,l,u){var f=this&&this.__decorate||function(y,S,k,T){var R,D=arguments.length,A=D<3?S:T===null?T=Object.getOwnPropertyDescriptor(S,k):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(y,S,k,T);else for(var j=y.length-1;j>=0;j--)(R=y[j])&&(A=(D<3?R(A):D>3?R(S,k,A):R(S,k))||A);return D>3&&A&&Object.defineProperty(S,k,A),A},p=this&&this.__param||function(y,S){return function(k,T){S(k,T,y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreService=void 0;const h=u(1439),_=u(8460),x=u(844),C=u(2585),w=Object.freeze({insertMode:!1}),v=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let b=l.CoreService=class extends x.Disposable{constructor(y,S,k){super(),this._bufferService=y,this._logService=S,this._optionsService=k,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new _.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new _.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new _.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new _.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,h.clone)(w),this.decPrivateModes=(0,h.clone)(v)}reset(){this.modes=(0,h.clone)(w),this.decPrivateModes=(0,h.clone)(v)}triggerDataEvent(y,S=!1){if(this._optionsService.rawOptions.disableStdin)return;const k=this._bufferService.buffer;S&&this._optionsService.rawOptions.scrollOnUserInput&&k.ybase!==k.ydisp&&this._onRequestScrollToBottom.fire(),S&&this._onUserInput.fire(),this._logService.debug(`sending data "${y}"`,(()=>y.split("").map((T=>T.charCodeAt(0))))),this._onData.fire(y)}triggerBinaryEvent(y){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${y}"`,(()=>y.split("").map((S=>S.charCodeAt(0))))),this._onBinary.fire(y))}};l.CoreService=b=f([p(0,C.IBufferService),p(1,C.ILogService),p(2,C.IOptionsService)],b)},9074:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DecorationService=void 0;const f=u(8055),p=u(8460),h=u(844),_=u(6106);let x=0,C=0;class w extends h.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new _.SortedList((y=>y==null?void 0:y.marker.line)),this._onDecorationRegistered=this.register(new p.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new p.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,h.toDisposable)((()=>this.reset())))}registerDecoration(y){if(y.marker.isDisposed)return;const S=new v(y);if(S){const k=S.marker.onDispose((()=>S.dispose()));S.onDispose((()=>{S&&(this._decorations.delete(S)&&this._onDecorationRemoved.fire(S),k.dispose())})),this._decorations.insert(S),this._onDecorationRegistered.fire(S)}return S}reset(){for(const y of this._decorations.values())y.dispose();this._decorations.clear()}*getDecorationsAtCell(y,S,k){var D,A,j;let T=0,R=0;for(const O of this._decorations.getKeyIterator(S))T=(D=O.options.x)!=null?D:0,R=T+((A=O.options.width)!=null?A:1),y>=T&&y<R&&(!k||((j=O.options.layer)!=null?j:"bottom")===k)&&(yield O)}forEachDecorationAtCell(y,S,k,T){this._decorations.forEachByKey(S,(R=>{var D,A,j;x=(D=R.options.x)!=null?D:0,C=x+((A=R.options.width)!=null?A:1),y>=x&&y<C&&(!k||((j=R.options.layer)!=null?j:"bottom")===k)&&T(R)}))}}l.DecorationService=w;class v extends h.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=f.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=f.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(y){super(),this.options=y,this.onRenderEmitter=this.register(new p.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new p.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=y.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.InstantiationService=l.ServiceCollection=void 0;const f=u(2585),p=u(8343);class h{constructor(...x){this._entries=new Map;for(const[C,w]of x)this.set(C,w)}set(x,C){const w=this._entries.get(x);return this._entries.set(x,C),w}forEach(x){for(const[C,w]of this._entries.entries())x(C,w)}has(x){return this._entries.has(x)}get(x){return this._entries.get(x)}}l.ServiceCollection=h,l.InstantiationService=class{constructor(){this._services=new h,this._services.set(f.IInstantiationService,this)}setService(_,x){this._services.set(_,x)}getService(_){return this._services.get(_)}createInstance(_,...x){const C=(0,p.getServiceDependencies)(_).sort(((b,y)=>b.index-y.index)),w=[];for(const b of C){const y=this._services.get(b.id);if(!y)throw new Error(`[createInstance] ${_.name} depends on UNKNOWN service ${b.id}.`);w.push(y)}const v=C.length>0?C[0].index:x.length;if(x.length!==v)throw new Error(`[createInstance] First service dependency of ${_.name} at position ${v+1} conflicts with ${x.length} static arguments`);return new _(...x,...w)}}},7866:function(c,l,u){var f=this&&this.__decorate||function(v,b,y,S){var k,T=arguments.length,R=T<3?b:S===null?S=Object.getOwnPropertyDescriptor(b,y):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(v,b,y,S);else for(var D=v.length-1;D>=0;D--)(k=v[D])&&(R=(T<3?k(R):T>3?k(b,y,R):k(b,y))||R);return T>3&&R&&Object.defineProperty(b,y,R),R},p=this&&this.__param||function(v,b){return function(y,S){b(y,S,v)}};Object.defineProperty(l,"__esModule",{value:!0}),l.traceCall=l.setTraceLogger=l.LogService=void 0;const h=u(844),_=u(2585),x={trace:_.LogLevelEnum.TRACE,debug:_.LogLevelEnum.DEBUG,info:_.LogLevelEnum.INFO,warn:_.LogLevelEnum.WARN,error:_.LogLevelEnum.ERROR,off:_.LogLevelEnum.OFF};let C,w=l.LogService=class extends h.Disposable{get logLevel(){return this._logLevel}constructor(v){super(),this._optionsService=v,this._logLevel=_.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),C=this}_updateLogLevel(){this._logLevel=x[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(v){for(let b=0;b<v.length;b++)typeof v[b]=="function"&&(v[b]=v[b]())}_log(v,b,y){this._evalLazyOptionalParams(y),v.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+b,...y)}trace(v,...b){var y,S;this._logLevel<=_.LogLevelEnum.TRACE&&this._log((S=(y=this._optionsService.options.logger)==null?void 0:y.trace.bind(this._optionsService.options.logger))!=null?S:console.log,v,b)}debug(v,...b){var y,S;this._logLevel<=_.LogLevelEnum.DEBUG&&this._log((S=(y=this._optionsService.options.logger)==null?void 0:y.debug.bind(this._optionsService.options.logger))!=null?S:console.log,v,b)}info(v,...b){var y,S;this._logLevel<=_.LogLevelEnum.INFO&&this._log((S=(y=this._optionsService.options.logger)==null?void 0:y.info.bind(this._optionsService.options.logger))!=null?S:console.info,v,b)}warn(v,...b){var y,S;this._logLevel<=_.LogLevelEnum.WARN&&this._log((S=(y=this._optionsService.options.logger)==null?void 0:y.warn.bind(this._optionsService.options.logger))!=null?S:console.warn,v,b)}error(v,...b){var y,S;this._logLevel<=_.LogLevelEnum.ERROR&&this._log((S=(y=this._optionsService.options.logger)==null?void 0:y.error.bind(this._optionsService.options.logger))!=null?S:console.error,v,b)}};l.LogService=w=f([p(0,_.IOptionsService)],w),l.setTraceLogger=function(v){C=v},l.traceCall=function(v,b,y){if(typeof y.value!="function")throw new Error("not supported");const S=y.value;y.value=function(...k){if(C.logLevel!==_.LogLevelEnum.TRACE)return S.apply(this,k);C.trace(`GlyphRenderer#${S.name}(${k.map((R=>JSON.stringify(R))).join(", ")})`);const T=S.apply(this,k);return C.trace(`GlyphRenderer#${S.name} return`,T),T}}},7302:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OptionsService=l.DEFAULT_OPTIONS=void 0;const f=u(8460),p=u(844),h=u(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:h.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const _=["normal","bold","100","200","300","400","500","600","700","800","900"];class x extends p.Disposable{constructor(w){super(),this._onOptionChange=this.register(new f.EventEmitter),this.onOptionChange=this._onOptionChange.event;const v={...l.DEFAULT_OPTIONS};for(const b in w)if(b in v)try{const y=w[b];v[b]=this._sanitizeAndValidateOption(b,y)}catch(y){console.error(y)}this.rawOptions=v,this.options={...v},this._setupOptions(),this.register((0,p.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(w,v){return this.onOptionChange((b=>{b===w&&v(this.rawOptions[w])}))}onMultipleOptionChange(w,v){return this.onOptionChange((b=>{w.indexOf(b)!==-1&&v()}))}_setupOptions(){const w=b=>{if(!(b in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);return this.rawOptions[b]},v=(b,y)=>{if(!(b in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${b}"`);y=this._sanitizeAndValidateOption(b,y),this.rawOptions[b]!==y&&(this.rawOptions[b]=y,this._onOptionChange.fire(b))};for(const b in this.rawOptions){const y={get:w.bind(this,b),set:v.bind(this,b)};Object.defineProperty(this.options,b,y)}}_sanitizeAndValidateOption(w,v){switch(w){case"cursorStyle":if(v||(v=l.DEFAULT_OPTIONS[w]),!(function(b){return b==="block"||b==="underline"||b==="bar"})(v))throw new Error(`"${v}" is not a valid value for ${w}`);break;case"wordSeparator":v||(v=l.DEFAULT_OPTIONS[w]);break;case"fontWeight":case"fontWeightBold":if(typeof v=="number"&&1<=v&&v<=1e3)break;v=_.includes(v)?v:l.DEFAULT_OPTIONS[w];break;case"cursorWidth":v=Math.floor(v);case"lineHeight":case"tabStopWidth":if(v<1)throw new Error(`${w} cannot be less than 1, value: ${v}`);break;case"minimumContrastRatio":v=Math.max(1,Math.min(21,Math.round(10*v)/10));break;case"scrollback":if((v=Math.min(v,4294967295))<0)throw new Error(`${w} cannot be less than 0, value: ${v}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(v<=0)throw new Error(`${w} cannot be less than or equal to 0, value: ${v}`);break;case"rows":case"cols":if(!v&&v!==0)throw new Error(`${w} must be numeric, value: ${v}`);break;case"windowsPty":v=v!=null?v:{}}return v}}l.OptionsService=x},2660:function(c,l,u){var f=this&&this.__decorate||function(x,C,w,v){var b,y=arguments.length,S=y<3?C:v===null?v=Object.getOwnPropertyDescriptor(C,w):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(x,C,w,v);else for(var k=x.length-1;k>=0;k--)(b=x[k])&&(S=(y<3?b(S):y>3?b(C,w,S):b(C,w))||S);return y>3&&S&&Object.defineProperty(C,w,S),S},p=this&&this.__param||function(x,C){return function(w,v){C(w,v,x)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkService=void 0;const h=u(2585);let _=l.OscLinkService=class{constructor(x){this._bufferService=x,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(x){const C=this._bufferService.buffer;if(x.id===void 0){const k=C.addMarker(C.ybase+C.y),T={data:x,id:this._nextId++,lines:[k]};return k.onDispose((()=>this._removeMarkerFromLink(T,k))),this._dataByLinkId.set(T.id,T),T.id}const w=x,v=this._getEntryIdKey(w),b=this._entriesWithId.get(v);if(b)return this.addLineToLink(b.id,C.ybase+C.y),b.id;const y=C.addMarker(C.ybase+C.y),S={id:this._nextId++,key:this._getEntryIdKey(w),data:w,lines:[y]};return y.onDispose((()=>this._removeMarkerFromLink(S,y))),this._entriesWithId.set(S.key,S),this._dataByLinkId.set(S.id,S),S.id}addLineToLink(x,C){const w=this._dataByLinkId.get(x);if(w&&w.lines.every((v=>v.line!==C))){const v=this._bufferService.buffer.addMarker(C);w.lines.push(v),v.onDispose((()=>this._removeMarkerFromLink(w,v)))}}getLinkData(x){var C;return(C=this._dataByLinkId.get(x))==null?void 0:C.data}_getEntryIdKey(x){return`${x.id};;${x.uri}`}_removeMarkerFromLink(x,C){const w=x.lines.indexOf(C);w!==-1&&(x.lines.splice(w,1),x.lines.length===0&&(x.data.id!==void 0&&this._entriesWithId.delete(x.key),this._dataByLinkId.delete(x.id)))}};l.OscLinkService=_=f([p(0,h.IBufferService)],_)},8343:(c,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createDecorator=l.getServiceDependencies=l.serviceRegistry=void 0;const u="di$target",f="di$dependencies";l.serviceRegistry=new Map,l.getServiceDependencies=function(p){return p[f]||[]},l.createDecorator=function(p){if(l.serviceRegistry.has(p))return l.serviceRegistry.get(p);const h=function(_,x,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(w,v,b){v[u]===v?v[f].push({id:w,index:b}):(v[f]=[{id:w,index:b}],v[u]=v)})(h,_,C)};return h.toString=()=>p,l.serviceRegistry.set(p,h),h}},2585:(c,l,u)=>{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 f=u(8343);var p;l.IBufferService=(0,f.createDecorator)("BufferService"),l.ICoreMouseService=(0,f.createDecorator)("CoreMouseService"),l.ICoreService=(0,f.createDecorator)("CoreService"),l.ICharsetService=(0,f.createDecorator)("CharsetService"),l.IInstantiationService=(0,f.createDecorator)("InstantiationService"),(function(h){h[h.TRACE=0]="TRACE",h[h.DEBUG=1]="DEBUG",h[h.INFO=2]="INFO",h[h.WARN=3]="WARN",h[h.ERROR=4]="ERROR",h[h.OFF=5]="OFF"})(p||(l.LogLevelEnum=p={})),l.ILogService=(0,f.createDecorator)("LogService"),l.IOptionsService=(0,f.createDecorator)("OptionsService"),l.IOscLinkService=(0,f.createDecorator)("OscLinkService"),l.IUnicodeService=(0,f.createDecorator)("UnicodeService"),l.IDecorationService=(0,f.createDecorator)("DecorationService")},1480:(c,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeService=void 0;const f=u(8460),p=u(225);class h{static extractShouldJoin(x){return(1&x)!=0}static extractWidth(x){return x>>1&3}static extractCharKind(x){return x>>3}static createPropertyValue(x,C,w=!1){return(16777215&x)<<3|(3&C)<<1|(w?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new f.EventEmitter,this.onChange=this._onChange.event;const x=new p.UnicodeV6;this.register(x),this._active=x.version,this._activeProvider=x}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(x){if(!this._providers[x])throw new Error(`unknown Unicode version "${x}"`);this._active=x,this._activeProvider=this._providers[x],this._onChange.fire(x)}register(x){this._providers[x.version]=x}wcwidth(x){return this._activeProvider.wcwidth(x)}getStringCellWidth(x){let C=0,w=0;const v=x.length;for(let b=0;b<v;++b){let y=x.charCodeAt(b);if(55296<=y&&y<=56319){if(++b>=v)return C+this.wcwidth(y);const T=x.charCodeAt(b);56320<=T&&T<=57343?y=1024*(y-55296)+T-56320+65536:C+=this.wcwidth(T)}const S=this.charProperties(y,w);let k=h.extractWidth(S);h.extractShouldJoin(S)&&(k-=h.extractWidth(w)),C+=k,w=S}return C}charProperties(x,C){return this._activeProvider.charProperties(x,C)}}l.UnicodeService=h}},r={};function o(c){var l=r[c];if(l!==void 0)return l.exports;var u=r[c]={exports:{}};return n[c].call(u.exports,u,u.exports,o),u.exports}var a={};return(()=>{var c=a;Object.defineProperty(c,"__esModule",{value:!0}),c.Terminal=void 0;const l=o(9042),u=o(3236),f=o(844),p=o(5741),h=o(8285),_=o(7975),x=o(7090),C=["cols","rows"];class w extends f.Disposable{constructor(b){super(),this._core=this.register(new u.Terminal(b)),this._addonManager=this.register(new p.AddonManager),this._publicOptions={...this._core.options};const y=k=>this._core.options[k],S=(k,T)=>{this._checkReadonlyOptions(k),this._core.options[k]=T};for(const k in this._core.options){const T={get:y.bind(this,k),set:S.bind(this,k)};Object.defineProperty(this._publicOptions,k,T)}}_checkReadonlyOptions(b){if(C.includes(b))throw new Error(`Option "${b}" 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 _.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new x.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new h.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const b=this._core.coreService.decPrivateModes;let y="none";switch(this._core.coreMouseService.activeProtocol){case"X10":y="x10";break;case"VT200":y="vt200";break;case"DRAG":y="drag";break;case"ANY":y="any"}return{applicationCursorKeysMode:b.applicationCursorKeys,applicationKeypadMode:b.applicationKeypad,bracketedPasteMode:b.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:y,originMode:b.origin,reverseWraparoundMode:b.reverseWraparound,sendFocusMode:b.sendFocus,wraparoundMode:b.wraparound}}get options(){return this._publicOptions}set options(b){for(const y in b)this._publicOptions[y]=b[y]}blur(){this._core.blur()}focus(){this._core.focus()}input(b,y=!0){this._core.input(b,y)}resize(b,y){this._verifyIntegers(b,y),this._core.resize(b,y)}open(b){this._core.open(b)}attachCustomKeyEventHandler(b){this._core.attachCustomKeyEventHandler(b)}attachCustomWheelEventHandler(b){this._core.attachCustomWheelEventHandler(b)}registerLinkProvider(b){return this._core.registerLinkProvider(b)}registerCharacterJoiner(b){return this._checkProposedApi(),this._core.registerCharacterJoiner(b)}deregisterCharacterJoiner(b){this._checkProposedApi(),this._core.deregisterCharacterJoiner(b)}registerMarker(b=0){return this._verifyIntegers(b),this._core.registerMarker(b)}registerDecoration(b){var y,S,k;return this._checkProposedApi(),this._verifyPositiveIntegers((y=b.x)!=null?y:0,(S=b.width)!=null?S:0,(k=b.height)!=null?k:0),this._core.registerDecoration(b)}hasSelection(){return this._core.hasSelection()}select(b,y,S){this._verifyIntegers(b,y,S),this._core.select(b,y,S)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(b,y){this._verifyIntegers(b,y),this._core.selectLines(b,y)}dispose(){super.dispose()}scrollLines(b){this._verifyIntegers(b),this._core.scrollLines(b)}scrollPages(b){this._verifyIntegers(b),this._core.scrollPages(b)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(b){this._verifyIntegers(b),this._core.scrollToLine(b)}clear(){this._core.clear()}write(b,y){this._core.write(b,y)}writeln(b,y){this._core.write(b),this._core.write(`\r
527
+ `,y)}paste(b){this._core.paste(b)}refresh(b,y){this._verifyIntegers(b,y),this._core.refresh(b,y)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(b){this._addonManager.loadAddon(this,b)}static get strings(){return l}_verifyIntegers(...b){for(const y of b)if(y===1/0||isNaN(y)||y%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...b){for(const y of b)if(y&&(y===1/0||isNaN(y)||y%1!=0||y<0))throw new Error("This API only accepts positive integers")}}c.Terminal=w})(),a})()))})(pm)),pm.exports}var FL=BL(),mm={exports:{}},jb;function HL(){return jb||(jb=1,(function(t,e){(function(n,r){t.exports=r()})(self,(()=>(()=>{var n={};return(()=>{var r=n;Object.defineProperty(r,"__esModule",{value:!0}),r.FitAddon=void 0,r.FitAddon=class{activate(o){this._terminal=o}dispose(){}fit(){const o=this.proposeDimensions();if(!o||!this._terminal||isNaN(o.cols)||isNaN(o.rows))return;const a=this._terminal._core;this._terminal.rows===o.rows&&this._terminal.cols===o.cols||(a._renderService.clear(),this._terminal.resize(o.cols,o.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const o=this._terminal._core,a=o._renderService.dimensions;if(a.css.cell.width===0||a.css.cell.height===0)return;const c=this._terminal.options.scrollback===0?0:o.viewport.scrollBarWidth,l=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(l.getPropertyValue("height")),f=Math.max(0,parseInt(l.getPropertyValue("width"))),p=window.getComputedStyle(this._terminal.element),h=u-(parseInt(p.getPropertyValue("padding-top"))+parseInt(p.getPropertyValue("padding-bottom"))),_=f-(parseInt(p.getPropertyValue("padding-right"))+parseInt(p.getPropertyValue("padding-left")))-c;return{cols:Math.max(2,Math.floor(_/a.css.cell.width)),rows:Math.max(1,Math.floor(h/a.css.cell.height))}}}})(),n})()))})(mm)),mm.exports}var UL=HL(),gm={exports:{}},Ob;function $L(){return Ob||(Ob=1,(function(t,e){(function(n,r){t.exports=r()})(self,(()=>(()=>{var n={6:(c,l)=>{function u(p){try{const h=new URL(p),_=h.password&&h.username?`${h.protocol}//${h.username}:${h.password}@${h.host}`:h.username?`${h.protocol}//${h.username}@${h.host}`:`${h.protocol}//${h.host}`;return p.toLocaleLowerCase().startsWith(_.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(l,"__esModule",{value:!0}),l.LinkComputer=l.WebLinkProvider=void 0,l.WebLinkProvider=class{constructor(p,h,_,x={}){this._terminal=p,this._regex=h,this._handler=_,this._options=x}provideLinks(p,h){const _=f.computeLink(p,this._regex,this._terminal,this._handler);h(this._addCallbacks(_))}_addCallbacks(p){return p.map((h=>(h.leave=this._options.leave,h.hover=(_,x)=>{if(this._options.hover){const{range:C}=h;this._options.hover(_,x,C)}},h)))}};class f{static computeLink(h,_,x,C){const w=new RegExp(_.source,(_.flags||"")+"g"),[v,b]=f._getWindowedLineStrings(h-1,x),y=v.join("");let S;const k=[];for(;S=w.exec(y);){const T=S[0];if(!u(T))continue;const[R,D]=f._mapStrIdx(x,b,0,S.index),[A,j]=f._mapStrIdx(x,R,D,T.length);if(R===-1||D===-1||A===-1||j===-1)continue;const O={start:{x:D+1,y:R+1},end:{x:j,y:A+1}};k.push({range:O,text:T,activate:C})}return k}static _getWindowedLineStrings(h,_){let x,C=h,w=h,v=0,b="";const y=[];if(x=_.buffer.active.getLine(h)){const S=x.translateToString(!0);if(x.isWrapped&&S[0]!==" "){for(v=0;(x=_.buffer.active.getLine(--C))&&v<2048&&(b=x.translateToString(!0),v+=b.length,y.push(b),x.isWrapped&&b.indexOf(" ")===-1););y.reverse()}for(y.push(S),v=0;(x=_.buffer.active.getLine(++w))&&x.isWrapped&&v<2048&&(b=x.translateToString(!0),v+=b.length,y.push(b),b.indexOf(" ")===-1););}return[y,C]}static _mapStrIdx(h,_,x,C){const w=h.buffer.active,v=w.getNullCell();let b=x;for(;C;){const y=w.getLine(_);if(!y)return[-1,-1];for(let S=b;S<y.length;++S){y.getCell(S,v);const k=v.getChars();if(v.getWidth()&&(C-=k.length||1,S===y.length-1&&k==="")){const T=w.getLine(_+1);T&&T.isWrapped&&(T.getCell(0,v),v.getWidth()===2&&(C+=1))}if(C<0)return[_,S]}_++,b=0}return[_,b]}}l.LinkComputer=f}},r={};function o(c){var l=r[c];if(l!==void 0)return l.exports;var u=r[c]={exports:{}};return n[c](u,u.exports,o),u.exports}var a={};return(()=>{var c=a;Object.defineProperty(c,"__esModule",{value:!0}),c.WebLinksAddon=void 0;const l=o(6),u=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function f(p,h){const _=window.open();if(_){try{_.opener=null}catch{}_.location.href=h}else console.warn("Opening link blocked as opener could not be cleared")}c.WebLinksAddon=class{constructor(p=f,h={}){this._handler=p,this._options=h}activate(p){this._terminal=p;const h=this._options,_=h.urlRegex||u;this._linkProvider=this._terminal.registerLinkProvider(new l.WebLinkProvider(this._terminal,_,this._handler,h))}dispose(){var p;(p=this._linkProvider)==null||p.dispose()}}})(),a})()))})(gm)),gm.exports}var qL=$L();const _i={INPUT:1,RESIZE:2,CLOSE:3,OUTPUT:4,EXIT:5,ERROR:6,INIT_ACK:7,TITLE:8};function vm(t,e){const n=new Uint8Array(1+e.length);return n[0]=t,n.set(e,1),n}function VL(){const t=new Map;return{get(e){return t.get(e)},set(e,n){t.set(e,n)},delete(e){t.delete(e)},has(e){return t.has(e)},clear(){t.clear()},dispose(e){const n=t.get(e);n&&(n.terminal.dispose(),t.delete(e))},disposeAll(){for(const e of t.values())e.terminal.dispose();t.clear()}}}function WL(t){const e=new FL.Terminal({cursorBlink:!0,cursorStyle:"bar",fontSize:13,fontFamily:"'Menlo', 'Monaco', 'Courier New', monospace",scrollback:1e3,allowProposedApi:!0,theme:{background:"var(--background)",foreground:"var(--foreground)",cursor:"var(--foreground)",selectionBackground:"var(--accent)"}}),n=new UL.FitAddon,r=new qL.WebLinksAddon;return e.loadAddon(n),e.loadAddon(r),{terminal:e,fitAddon:n}}function GL(t,e){const n=he.c(21),{serverUrl:r,apiToken:o,cwd:a}=e,c=N.useRef(null),l=N.useRef("disconnected"),u=N.useRef(!1),f=N.useRef(0),p=N.useRef(e.onOutput),h=N.useRef(e.onStatusChange),_=N.useRef(e.onExit),x=N.useRef(e.onSessionInit),C=N.useRef(e.onTitleChange),w=N.useRef(r),v=N.useRef(o),b=N.useRef(a),y=N.useRef(e.serverSessionId),S=N.useRef(e.terminal);let k;n[0]!==e.onExit||n[1]!==e.onOutput||n[2]!==e.onSessionInit||n[3]!==e.onStatusChange||n[4]!==e.onTitleChange?(k=()=>{p.current=e.onOutput,h.current=e.onStatusChange,_.current=e.onExit,x.current=e.onSessionInit,C.current=e.onTitleChange},n[0]=e.onExit,n[1]=e.onOutput,n[2]=e.onSessionInit,n[3]=e.onStatusChange,n[4]=e.onTitleChange,n[5]=k):k=n[5],N.useEffect(k);let T,R;n[6]!==o||n[7]!==a||n[8]!==e.serverSessionId||n[9]!==e.terminal||n[10]!==r?(T=()=>{w.current=r,v.current=o,b.current=a,y.current=e.serverSessionId,S.current=e.terminal},R=[r,o,a,e.serverSessionId,e.terminal],n[6]=o,n[7]=a,n[8]=e.serverSessionId,n[9]=e.terminal,n[10]=r,n[11]=T,n[12]=R):(T=n[11],R=n[12]),N.useEffect(T,R);let D;n[13]===Symbol.for("react.memo_cache_sentinel")?(D=X=>{var I;l.current=X,(I=h.current)==null||I.call(h,X)},n[13]=D):D=n[13];const A=D;let j;n[14]===Symbol.for("react.memo_cache_sentinel")?(j=X=>{const I=f.current=f.current+1,L=c.current;L&&(L.onopen=null,L.onclose=null,L.onmessage=null,L.onerror=null,L.close(),c.current=null),X&&S.current&&S.current.clear(),A("connecting");const z=X?`ws://${w.current}/ws/terminal?token=${v.current}&cwd=${encodeURIComponent(b.current)}&sessionId=${X}`:`ws://${w.current}/ws/terminal?token=${v.current}&cwd=${encodeURIComponent(b.current)}`,F=new WebSocket(z);F.binaryType="arraybuffer",F.onopen=()=>{if(f.current!==I){F.close();return}c.current=F},F.onmessage=B=>{var G,q,te,re,oe,se;if(f.current!==I||!(B.data instanceof ArrayBuffer))return;const Y=new Uint8Array(B.data);if(Y.length<1)return;const ee=Y[0],J=Y.slice(1);e:switch(ee){case _i.OUTPUT:{(G=p.current)==null||G.call(p,new TextDecoder().decode(J));break e}case _i.EXIT:{const{exitCode:ye}=JSON.parse(new TextDecoder().decode(J));A("exited"),(q=_.current)==null||q.call(_,ye),F.close();break e}case _i.ERROR:{const{message:ye}=JSON.parse(new TextDecoder().decode(J));console.error("[useTerminal] Server error:",ye),A("disconnected");break e}case _i.INIT_ACK:{const ye=JSON.parse(new TextDecoder().decode(J));(te=x.current)==null||te.call(x,ye),ye.isReconnect&&ye.status==="exited"?(A("exited"),(re=_.current)==null||re.call(_,ye.exitCode)):ye.isReconnect&&ye.inAlternateScreen?(A("connected"),(oe=p.current)==null||oe.call(p,`\r
528
+ \x1B[33m[Reconnected — a full-screen application is running. Press Ctrl+C to exit it.]\x1B[0m\r
529
+ `)):A("connected");break e}case _i.TITLE:{const{title:ye}=JSON.parse(new TextDecoder().decode(J));(se=C.current)==null||se.call(C,ye)}}},F.onclose=()=>{f.current===I&&(c.current=null,(l.current==="connecting"||l.current==="connected")&&A("disconnected"))},F.onerror=KL},n[14]=j):j=n[14];const O=j;let P,$;n[15]!==t?(P=()=>{if(!t)return;u.current=!1;const X=t.onData(L=>{const z=c.current;if(!z||z.readyState!==WebSocket.OPEN)return;const F=new TextEncoder().encode(L);z.send(vm(_i.INPUT,F))}),I=t.onResize(L=>{const{cols:z,rows:F}=L,B=c.current;if(!B||B.readyState!==WebSocket.OPEN)return;const Y=new TextEncoder().encode(JSON.stringify({cols:z,rows:F}));B.send(vm(_i.RESIZE,Y))});return()=>{X.dispose(),I.dispose(),u.current=!0;const L=c.current;L&&(L.onopen=null,L.onclose=null,L.onmessage=null,L.onerror=null,L.close(),c.current=null)}},$=[t],n[15]=t,n[16]=P,n[17]=$):(P=n[16],$=n[17]),N.useEffect(P,$);let U;n[18]===Symbol.for("react.memo_cache_sentinel")?(U=()=>{const X=c.current;X&&(X.onopen=null,X.onclose=null,X.onmessage=null,X.onerror=null,X.close(),c.current=null)},n[18]=U):U=n[18];const W=U;let K;n[19]===Symbol.for("react.memo_cache_sentinel")?(K=()=>{const X=c.current;if(X){try{X.send(vm(_i.CLOSE,new Uint8Array(0)))}catch{}X.close(),c.current=null}u.current=!0},n[19]=K):K=n[19];const V=K;let Q;return n[20]===Symbol.for("react.memo_cache_sentinel")?(Q={connect:O,disconnect:W,destroy:V},n[20]=Q):Q=n[20],Q}function KL(){}function YL(){const t=he.c(2),[e,n]=N.useState(XL);let r,o;return t[0]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{const a=window.visualViewport;if(!a)return;const c=()=>{n({height:a.height,offsetTop:a.offsetTop,scale:a.scale})};return c(),a.addEventListener("resize",c),a.addEventListener("scroll",c),()=>{a.removeEventListener("resize",c),a.removeEventListener("scroll",c)}},o=[],t[0]=r,t[1]=o):(r=t[0],o=t[1]),N.useEffect(r,o),e}function XL(){return{height:typeof window<"u"?window.innerHeight:0,offsetTop:0,scale:1}}const QL=300,ZL=200,JL=.7,e7=N.forwardRef(function({workspaceId:e,workspacePath:n,workspaceName:r,serverUrl:o,apiToken:a,isOpen:c,onClose:l},u){var Ee,Ae,Be;const f=Ka(),p=YL(),[h,_]=N.useState([]),[x,C]=N.useState(null),[w,v]=N.useState(QL),b=N.useRef(!1),y=N.useRef(0),S=N.useRef(0),k=N.useRef(VL()),T=N.useRef(null),R=N.useRef(null),D=N.useRef([]),A=N.useRef(()=>{}),j=N.useRef(!1),O=N.useRef(void 0),P=N.useRef(new Set),$=N.useRef(()=>{});N.useEffect(()=>{D.current=h},[h]);const U=N.useCallback(le=>{switch(le.type){case"snapshot":{const Ce=P.current;if(_(le.sessions.map(ge=>({serverSessionId:ge.id,title:ge.title,status:ge.status==="exited"?"exited":"disconnected",cwd:ge.cwd,shell:ge.shell}))),le.sessions.length>0?C(ge=>ge&&le.sessions.some(Oe=>Oe.id===ge)?ge:le.sessions[0].id):(C(null),j.current||(j.current=!0,$.current())),Ce.size>0){const ge=new Set(le.sessions.map(He=>He.id)),Oe=[...Ce].filter(He=>!ge.has(He));for(const He of Oe)$.current()}break}case"created":{_(Ce=>Ce.some(ge=>ge.serverSessionId===le.session.id)?Ce:[...Ce,{serverSessionId:le.session.id,title:le.session.title,status:"disconnected",cwd:le.session.cwd,shell:le.session.shell}]),C(le.session.id);break}case"destroyed":{_(Ce=>Ce.filter(ge=>ge.serverSessionId!==le.sessionId)),k.current.dispose(le.sessionId),C(Ce=>{if(Ce!==le.sessionId)return Ce;const ge=D.current.filter(Oe=>Oe.serverSessionId!==le.sessionId);return ge.length>0?ge[0].serverSessionId:null});break}case"exited":{_(Ce=>Ce.map(ge=>ge.serverSessionId===le.sessionId?{...ge,status:"exited"}:ge));break}case"title_changed":{_(Ce=>Ce.map(ge=>ge.serverSessionId===le.sessionId?{...ge,title:le.title}:ge));break}case"status_changed":{_(Ce=>Ce.map(ge=>ge.serverSessionId===le.sessionId?{...ge,status:le.status==="exited"?"exited":"connected"}:ge));break}}},[]);N.useEffect(()=>{A.current=U},[U]),N.useEffect(()=>{if(!e||!c||!o||!a){_([]),C(null),P.current=new Set,j.current=!1,T.current&&(T.current.disconnect(),T.current=null),I(null),k.current.disposeAll();const ge=R.current;ge&&(ge.onopen=null,ge.onclose=null,ge.onmessage=null,ge.onerror=null,ge.close(),R.current=null);return}T.current&&(T.current.disconnect(),T.current=null),I(null),k.current.disposeAll(),P.current=new Set(D.current.map(ge=>ge.serverSessionId));const le=`ws://${o}/ws/terminal/events?token=${a}&workspaceId=${encodeURIComponent(e)}`,Ce=new WebSocket(le);return R.current=Ce,Ce.onmessage=ge=>{try{const Oe=JSON.parse(ge.data);A.current(Oe)}catch(Oe){console.error("[TerminalPanel] Failed to parse event:",Oe)}},()=>{const ge=R.current;ge&&(ge.onopen=null,ge.onclose=null,ge.onmessage=null,ge.onerror=null,ge.close(),R.current=null)}},[e,c,o,a]);const W=N.useCallback(le=>Ce=>{const ge=k.current.get(le);ge==null||ge.terminal.write(Ce)},[]),K=N.useCallback(le=>Ce=>{_(ge=>ge.map(Oe=>Oe.serverSessionId===le?{...Oe,status:Ce}:Oe))},[]),V=N.useCallback(le=>Ce=>{const ge=k.current.get(le);ge&&(ge.serverSessionId=Ce.sessionId),_(Oe=>Oe.map(He=>He.serverSessionId===le?{...He,title:Ce.title||He.title}:He))},[]),Q=N.useCallback(le=>Ce=>{_(ge=>ge.map(Oe=>Oe.serverSessionId===le?{...Oe,title:Ce}:Oe))},[]),[X,I]=N.useState(null),{connect:L,disconnect:z,destroy:F}=GL((Ee=X==null?void 0:X.terminal)!=null?Ee:null,X&&o&&a&&n&&X.serverSessionId?{terminal:X.terminal,serverUrl:o,apiToken:a,cwd:(Be=(Ae=h.find(le=>le.serverSessionId===X.serverSessionId))==null?void 0:Ae.cwd)!=null?Be:n,serverSessionId:X.serverSessionId,onOutput:W(X.serverSessionId),onStatusChange:K(X.serverSessionId),onSessionInit:V(X.serverSessionId),onTitleChange:Q(X.serverSessionId)}:{terminal:null,serverUrl:"",apiToken:"",cwd:"",onOutput:()=>{},onStatusChange:()=>{}});N.useEffect(()=>{X&&X.serverSessionId&&(T.current={serverSessionId:X.serverSessionId,disconnect:z,destroy:F},L(X.serverSessionId))},[X,L,z,F]);const B=N.useCallback(()=>{if(!x||!o||!a||!n)return;const le=k.current.get(x);let Ce;if(le)Ce=le;else{const{terminal:ge,fitAddon:Oe}=WL();Ce={terminal:ge,fitAddon:Oe,serverSessionId:x,status:"connecting",isOpened:!1},k.current.set(x,Ce)}T.current&&(T.current.disconnect(),T.current=null),I(Ce)},[x,o,a,n]);N.useEffect(()=>{!c||!x||B()},[c,x,B]);const Y=N.useCallback(async()=>{if(!(!e||!n||!o||!a))try{const le=await fetch(`http://${o}/api/workspaces/${e}/terminals`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify({cwd:n})});le.ok||console.error("[TerminalPanel] Failed to create terminal:",le.statusText)}catch(le){console.error("[TerminalPanel] Failed to create terminal:",le)}},[e,n,o,a]);N.useEffect(()=>{$.current=Y},[Y]);const ee=N.useCallback(async le=>{var Ce;if(!(!e||!o||!a)){((Ce=T.current)==null?void 0:Ce.serverSessionId)===le&&(T.current.destroy(),T.current=null,I(null)),k.current.dispose(le);try{await fetch(`http://${o}/api/workspaces/${e}/terminals/${le}`,{method:"DELETE",headers:{Authorization:`Bearer ${a}`}})}catch(ge){console.error("[TerminalPanel] Failed to destroy terminal:",ge)}}},[e,o,a]);N.useEffect(()=>{O.current!==e&&(O.current=e,j.current=!1)},[e]),N.useEffect(()=>{P.current=new Set},[e]),N.useEffect(()=>()=>{k.current.disposeAll()},[]);const J=N.useCallback(()=>{if(x){const le=k.current.get(x);le==null||le.terminal.focus()}},[x]);N.useImperativeHandle(u,()=>({focus:J}),[J]),N.useEffect(()=>{if(!c||!x)return;const le=setTimeout(J,300);return()=>clearTimeout(le)},[c,x,J]);const G=N.useCallback(le=>{le.preventDefault(),b.current=!0;const Ce="touches"in le?le.touches[0].clientY:le.clientY;y.current=Ce,S.current=w;const ge=He=>{if(!b.current)return;const rt="touches"in He?He.touches[0].clientY:He.clientY,Qe=y.current-rt,Ne=window.innerHeight*JL,Ge=Math.min(Math.max(S.current+Qe,ZL),Ne);v(Ge)},Oe=()=>{b.current=!1,document.removeEventListener("mousemove",ge),document.removeEventListener("mouseup",Oe),document.removeEventListener("touchmove",ge),document.removeEventListener("touchend",Oe)};document.addEventListener("mousemove",ge),document.addEventListener("mouseup",Oe),document.addEventListener("touchmove",ge,{passive:!1}),document.addEventListener("touchend",Oe)},[w]);if(!e||!n||!o||!a)return m.jsx("div",{className:"flex items-center justify-center h-[300px] border-t border-border bg-background text-muted-foreground text-sm",children:"Select a workspace to use the terminal."});const q=r||n.split("/").pop()||"ws",te=h.find(le=>le.serverSessionId===x),re=x?k.current.get(x):null,oe=le=>{switch(le){case"connecting":return"bg-warning";case"connected":return"bg-success";case"disconnected":return"bg-muted-foreground";case"exited":return"bg-error"}},se=()=>m.jsxs("div",{className:"flex items-center gap-0.5 overflow-x-auto px-1 min-h-[32px]",children:[h.map(le=>m.jsxs("div",{className:ke("group flex items-center gap-1.5 px-2 py-1 text-xs cursor-pointer rounded-sm whitespace-nowrap border border-transparent",le.serverSessionId===x?"bg-accent text-accent-foreground border-border":"text-muted-foreground hover:bg-muted"),onClick:()=>C(le.serverSessionId),children:[m.jsx("span",{className:ke("w-1.5 h-1.5 rounded-full shrink-0",oe(le.status))}),m.jsxs("span",{children:[q," ",le.title]}),m.jsx("button",{className:"opacity-0 group-hover:opacity-100 hover:text-destructive transition-opacity ml-0.5",onClick:Ce=>{Ce.stopPropagation(),ee(le.serverSessionId)},children:m.jsx(Os,{className:"w-3 h-3"})})]},le.serverSessionId)),m.jsx(Fe,{variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:Y,title:"New terminal tab",children:m.jsx(La,{className:"w-3.5 h-3.5"})})]}),ye=()=>m.jsx("div",{className:"flex-1 min-h-0 overflow-hidden relative",children:re&&te?m.jsx(zL,{cachedTerminal:re},x):m.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:"No terminal sessions"})});if(f){const Ce=p.height<window.innerHeight*.85?`calc(${p.height}px - env(safe-area-inset-top, 0px))`:Math.min(window.innerHeight*.7,p.height);return c?m.jsx(Nf,{open:c,onOpenChange:ge=>!ge&&l(),children:m.jsxs(Mf,{side:"top",className:"p-0 bg-background [&>button]:hidden flex flex-col",style:{height:Ce},children:[m.jsx(Df,{className:"sr-only",children:m.jsx(jf,{children:"Terminal"})}),m.jsxs("div",{className:"flex items-center justify-between p-2 border-b border-border shrink-0",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(Dy,{className:"w-4 h-4"}),m.jsx("span",{className:"font-semibold text-sm",children:"Terminal"})]}),m.jsx(Fe,{variant:"ghost",size:"icon-sm",onClick:l,children:m.jsx(Os,{className:"w-4 h-4"})})]}),se(),ye()]})}):null}return c?m.jsxs("div",{"data-terminal-panel":"",children:[m.jsx("div",{className:"w-full cursor-ns-resize flex items-center justify-center border-t border-border bg-background select-none shrink-0",style:{height:4},onMouseDown:G,onTouchStart:G,children:m.jsx("div",{className:"w-10 h-0.5 bg-muted-foreground/30 rounded-full"})}),m.jsxs("div",{className:"flex flex-col border-t border-border bg-background overflow-hidden shrink-0",style:{height:w},children:[m.jsxs("div",{className:"flex items-center justify-between px-2 py-1 border-b border-border shrink-0",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(Dy,{className:"w-3.5 h-3.5 text-muted-foreground"}),m.jsx("span",{className:"font-medium text-xs text-muted-foreground",children:"Terminal"})]}),m.jsx(Fe,{variant:"ghost",size:"icon-sm",onClick:l,children:m.jsx(Os,{className:"w-3.5 h-3.5"})})]}),se(),ye()]})]}):null}),t7={".ts":{icon:ss,color:"text-blue-500"},".tsx":{icon:ss,color:"text-blue-500"},".js":{icon:ss,color:"text-yellow-500"},".jsx":{icon:ss,color:"text-yellow-500"},".json":{icon:ss,color:"text-yellow-600"},".md":{icon:ss,color:"text-gray-500"},".css":{icon:ss,color:"text-purple-500"},".html":{icon:ss,color:"text-orange-500"}};function sk({entry:t,workspaceId:e,parentPath:n,depth:r,onFileSelect:o,showHidden:a=!0,serverUrl:c,apiToken:l}){const{fetchWithAuth:u}=Dc(),[f,p]=N.useState(!1),[h,_]=N.useState([]),[x,C]=N.useState(!1),[w,v]=N.useState(!1),b=n?`${n}/${t.path}`:t.path,y=t.type==="directory",S=async()=>{if(!(w||x)){C(!0);try{const O=await(await u(`/api/workspaces/${e}/files?path=${encodeURIComponent(b)}&showHidden=${a}`,{},{serverUrl:c,token:l})).json();_(O.files||[]),v(!0)}catch(j){console.error("Failed to load children:",j)}finally{C(!1)}}},k=j=>{p(j),j&&y&&S()},T=()=>{!y&&o&&o({...t,path:b})},R=t.extension?t7[t.extension]:null,D=y?f?Bm:js:(R==null?void 0:R.icon)||ss,A=y?"text-amber-500":(R==null?void 0:R.color)||"text-muted-foreground";return y?m.jsxs(ki,{open:f,onOpenChange:k,children:[m.jsx(Ei,{asChild:!0,children:m.jsxs("button",{className:ke("flex items-center gap-1.5 w-full min-w-0 overflow-x-hidden px-1.5 py-0.5 rounded text-sm","hover:bg-accent hover:text-accent-foreground","transition-colors text-left"),style:{paddingLeft:`${r*12+6}px`},children:[x?m.jsx(pr,{className:"w-3 h-3 animate-spin shrink-0"}):m.jsx(Wr,{className:ke("w-3 h-3 shrink-0 transition-transform",f&&"rotate-90")}),m.jsx(D,{className:ke("w-4 h-4 shrink-0",A)}),m.jsx("span",{className:"truncate min-w-0 flex-1",children:t.name})]})}),m.jsx(Ai,{children:h.map(j=>m.jsx(sk,{entry:j,workspaceId:e,parentPath:b,depth:r+1,onFileSelect:o,showHidden:a,serverUrl:c,apiToken:l},`${b}/${j.path}`))})]}):m.jsxs("button",{onClick:T,className:ke("flex items-center gap-1.5 w-full min-w-0 overflow-x-hidden px-1.5 py-0.5 rounded text-sm","hover:bg-accent hover:text-accent-foreground","transition-colors text-left"),style:{paddingLeft:`${r*12+6}px`},children:[m.jsx(D,{className:ke("w-4 h-4 shrink-0",A)}),m.jsx("span",{className:"truncate min-w-0 flex-1",children:t.name})]})}function Lb({workspaceId:t,serverUrl:e,apiToken:n,onFileSelect:r,showHidden:o=!0}){const[a,c]=N.useState([]),[l,u]=N.useState(""),[f,p]=N.useState(!0),[h,_]=N.useState(null),{fetchWithAuth:x}=Dc(),C=N.useCallback(async()=>{p(!0),_(null);try{const w=await x(`/api/workspaces/${t}/files?showHidden=${o}`,{},{serverUrl:e,token:n}),v=await w.json();if(!w.ok)throw new Error(v.message||"Failed to load files");c(v.files),u(v.currentPath)}catch(w){_(w instanceof Error?w.message:"Failed to load files")}finally{p(!1)}},[t,o,x,e,n]);return N.useEffect(()=>{C()},[C]),f?m.jsxs("div",{className:"flex items-center justify-center h-32 text-muted-foreground",children:[m.jsx(pr,{className:"w-4 h-4 animate-spin mr-2"}),"Loading files..."]}):h?m.jsxs("div",{className:"p-4 text-sm text-destructive",children:[h,m.jsx(Fe,{variant:"ghost",size:"sm",onClick:C,className:"ml-2",children:m.jsx(ho,{className:"w-3 h-3"})})]}):a.length===0?m.jsxs("div",{className:"p-4 text-sm text-muted-foreground",children:["Empty workspace",m.jsx(Fe,{variant:"ghost",size:"sm",onClick:C,className:"ml-2",children:m.jsx(ho,{className:"w-3 h-3"})})]}):m.jsxs("div",{className:"flex flex-col h-full min-w-0 overflow-hidden",children:[m.jsxs("div",{className:"flex items-center justify-between min-w-0 overflow-hidden px-3 py-2",children:[m.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide truncate min-w-0",children:"Files"}),m.jsx(Fe,{variant:"ghost",size:"icon",className:"h-5 w-5 shrink-0",onClick:C,children:m.jsx(ho,{className:"w-3 h-3"})})]}),m.jsx(Oc,{className:"flex-1 min-h-0 min-w-0",children:m.jsx("div",{className:"px-2 pb-2 min-w-0 overflow-hidden",children:m.jsx("div",{className:"space-y-0.5",children:a.map(w=>m.jsx(sk,{entry:w,workspaceId:t,parentPath:l,depth:0,onFileSelect:r,showHidden:o,serverUrl:e,apiToken:n},w.path))})})})]})}function n7(t){const e=he.c(33),{workspaceId:n,searchQuery:r,selectedIndex:o,onSelect:a,onFilesChange:c,showHidden:l,serverUrl:u,apiToken:f}=t,p=l===void 0?!0:l;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=[],e[0]=h):h=e[0];const[_,x]=N.useState(h),[C,w]=N.useState(!1),[v,b]=N.useState(r),{fetchWithAuth:y}=Dc(),S=N.useRef(0);let k,T;e[1]!==r?(k=()=>{const K=setTimeout(()=>{b(r)},300);return()=>clearTimeout(K)},T=[r],e[1]=r,e[2]=k,e[3]=T):(k=e[2],T=e[3]),N.useEffect(k,T);let R,D;if(e[4]!==f||e[5]!==v||e[6]!==y||e[7]!==c||e[8]!==u||e[9]!==p||e[10]!==n?(R=()=>{if(!v||v.length<2){x([]),c([]);return}const K=S.current=S.current+1;w(!0);const V=new AbortController;return y(`/api/workspaces/${n}/files?search=${encodeURIComponent(v)}&showHidden=${p}`,{signal:V.signal},{serverUrl:u,token:f}).then(s7).then(Q=>{if(K!==S.current)return;const X=Q.files||[];x(X),c(X)}).catch(r7).finally(()=>{K===S.current&&w(!1)}),()=>V.abort()},D=[n,v,c,p,y,u,f],e[4]=f,e[5]=v,e[6]=y,e[7]=c,e[8]=u,e[9]=p,e[10]=n,e[11]=R,e[12]=D):(R=e[11],D=e[12]),N.useEffect(R,D),!r||r.length<2){let K;return e[13]===Symbol.for("react.memo_cache_sentinel")?(K=m.jsx("div",{className:"p-2 text-xs text-muted-foreground",children:"Type at least 2 characters to search files..."}),e[13]=K):K=e[13],K}if(C){let K;return e[14]===Symbol.for("react.memo_cache_sentinel")?(K=m.jsxs("div",{className:"flex items-center justify-center p-4 text-muted-foreground",children:[m.jsx(pr,{className:"w-4 h-4 animate-spin mr-2"}),"Searching..."]}),e[14]=K):K=e[14],K}if(_.length===0){let K;return e[15]!==r?(K=m.jsxs("div",{className:"p-2 text-xs text-muted-foreground",children:['No files found matching "',r,'"']}),e[15]=r,e[16]=K):K=e[16],K}let A;if(e[17]!==_||e[18]!==a||e[19]!==o){let K;e[21]!==a||e[22]!==o?(K=(V,Q)=>m.jsxs("button",{onClick:()=>a(V),className:ke("flex items-center gap-2 w-full px-2 py-1.5 rounded text-sm text-left","hover:bg-muted",Q===o&&"bg-primary/20 text-primary font-medium ring-1 ring-primary/50"),children:[V.type==="directory"?m.jsx(js,{className:"w-4 h-4 text-amber-500 flex-shrink-0"}):m.jsx(ss,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),m.jsx("span",{className:"truncate flex-1",children:V.path}),V.extension&&m.jsx("span",{className:"text-xs text-muted-foreground",children:V.extension})]},V.path),e[21]=a,e[22]=o,e[23]=K):K=e[23],A=_.map(K),e[17]=_,e[18]=a,e[19]=o,e[20]=A}else A=e[20];const j=_.length!==1?"s":"";let O;e[24]===Symbol.for("react.memo_cache_sentinel")?(O=m.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"↑↓"}),e[24]=O):O=e[24];let P;e[25]===Symbol.for("react.memo_cache_sentinel")?(P=m.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"↵"}),e[25]=P):P=e[25];let $;e[26]===Symbol.for("react.memo_cache_sentinel")?($=m.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"esc"}),e[26]=$):$=e[26];let U;e[27]!==_.length||e[28]!==j?(U=m.jsxs("div",{className:"mt-1 pt-1 border-t text-xs text-muted-foreground px-2",children:[_.length," result",j," •",O," navigate",P," select",$," close"]}),e[27]=_.length,e[28]=j,e[29]=U):U=e[29];let W;return e[30]!==U||e[31]!==A?(W=m.jsxs("div",{className:"p-1",children:[A,U]}),e[30]=U,e[31]=A,e[32]=W):W=e[32],W}function r7(t){t.name!=="AbortError"&&console.error("File search failed:",t)}function s7(t){return t.json()}const i7=yg;function o7(t){const e=he.c(56),{workspaceId:n,serverUrl:r,apiToken:o,isOpen:a,width:c,onClose:l}=t,u=Ka(),f=Qt(l7),p=c!=null?c:i7,[h,_]=N.useState(p),[x,C]=N.useState(!1),w=N.useRef(!1),v=N.useRef(0),b=N.useRef(0),y=N.useRef(0);let S,k;e[0]!==p?(S=()=>{w.current||_(p)},k=[p],e[0]=p,e[1]=S,e[2]=k):(S=e[1],k=e[2]),N.useEffect(S,k);const T=a7;let R;e[3]!==h||e[4]!==f?(R=ee=>{ee.preventDefault(),w.current=!0,C(!0);const J="touches"in ee?ee.touches[0].clientX:ee.clientX;v.current=J,b.current=h;const G=te=>{if(!w.current)return;const re="touches"in te?te.touches[0].clientX:te.clientX,oe=v.current-re,se=T(b.current+oe);y.current=se,_(se)},q=()=>{w.current&&(w.current=!1,C(!1),f(y.current),document.removeEventListener("mousemove",G),document.removeEventListener("mouseup",q),document.removeEventListener("touchmove",G),document.removeEventListener("touchend",q))};document.addEventListener("mousemove",G),document.addEventListener("mouseup",q),document.addEventListener("touchmove",G,{passive:!1}),document.addEventListener("touchend",q)},e[3]=h,e[4]=f,e[5]=R):R=e[5];const D=R;if(!n)return null;if(u){let ee;e[6]!==l?(ee=ye=>!ye&&l(),e[6]=l,e[7]=ee):ee=e[7];let J;e[8]===Symbol.for("react.memo_cache_sentinel")?(J=m.jsx(Df,{className:"sr-only",children:m.jsx(jf,{children:"Files"})}),e[8]=J):J=e[8];let G;e[9]===Symbol.for("react.memo_cache_sentinel")?(G=m.jsx("span",{className:"font-semibold text-sm",children:"Files"}),e[9]=G):G=e[9];let q;e[10]===Symbol.for("react.memo_cache_sentinel")?(q=m.jsx(Os,{className:"w-4 h-4"}),e[10]=q):q=e[10];let te;e[11]!==l?(te=m.jsxs("div",{className:"flex items-center justify-between p-3 border-b border-border",children:[G,m.jsx(Fe,{variant:"ghost",size:"icon-sm",onClick:l,children:q})]}),e[11]=l,e[12]=te):te=e[12];let re;e[13]!==o||e[14]!==r||e[15]!==n?(re=m.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-hidden",children:m.jsx(Lb,{workspaceId:n,serverUrl:r,apiToken:o,showHidden:!0},n)}),e[13]=o,e[14]=r,e[15]=n,e[16]=re):re=e[16];let oe;e[17]!==te||e[18]!==re?(oe=m.jsxs(Mf,{side:"right",className:"w-72 p-0 bg-sidebar [&>button]:hidden",children:[J,te,re]}),e[17]=te,e[18]=re,e[19]=oe):oe=e[19];let se;return e[20]!==a||e[21]!==oe||e[22]!==ee?(se=m.jsx(Nf,{open:a,onOpenChange:ee,children:oe}),e[20]=a,e[21]=oe,e[22]=ee,e[23]=se):se=e[23],se}const A=!a&&"w-0";let j;e[24]!==A?(j=ke("relative bg-transparent transition-[width] duration-200 ease-linear",A),e[24]=A,e[25]=j):j=e[25];const O=a?h:0;let P;e[26]!==O?(P={width:O},e[26]=O,e[27]=P):P=e[27];let $;e[28]!==j||e[29]!==P?($=m.jsx("div",{className:j,style:P}),e[28]=j,e[29]=P,e[30]=$):$=e[30];const U=!a&&"translate-x-full",W=x&&"select-none";let K;e[31]!==W||e[32]!==U?(K=ke("fixed right-0 z-10 bg-sidebar border-l border-border flex flex-col overflow-hidden","transform transition-transform duration-200 ease-linear",U,W),e[31]=W,e[32]=U,e[33]=K):K=e[33];let V;e[34]!==h?(V={width:h,top:"env(safe-area-inset-top, 0)",bottom:"env(safe-area-inset-bottom, 0)",height:"calc(100vh - env(safe-area-inset-top, 0) - env(safe-area-inset-bottom, 0))"},e[34]=h,e[35]=V):V=e[35];let Q;e[36]===Symbol.for("react.memo_cache_sentinel")?(Q=m.jsx("div",{className:"w-0.5 h-8 bg-transparent group-hover:bg-border group-active:bg-primary transition-colors rounded-full"}),e[36]=Q):Q=e[36];let X;e[37]!==D?(X=m.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-1 cursor-ew-resize group flex items-center justify-center",onMouseDown:D,onTouchStart:D,children:Q}),e[37]=D,e[38]=X):X=e[38];let I;e[39]===Symbol.for("react.memo_cache_sentinel")?(I=m.jsx("span",{className:"font-semibold text-sm",children:"Files"}),e[39]=I):I=e[39];let L;e[40]===Symbol.for("react.memo_cache_sentinel")?(L=m.jsx(Os,{className:"w-4 h-4"}),e[40]=L):L=e[40];let z;e[41]!==l?(z=m.jsxs("div",{className:"flex items-center justify-between p-3 border-b border-border pl-4",children:[I,m.jsx(Fe,{variant:"ghost",size:"icon-sm",onClick:l,children:L})]}),e[41]=l,e[42]=z):z=e[42];let F;e[43]!==o||e[44]!==r||e[45]!==n?(F=m.jsx("div",{className:"flex flex-1 flex-col min-h-0 overflow-hidden pl-1",children:m.jsx(Lb,{workspaceId:n,serverUrl:r,apiToken:o,showHidden:!0},n)}),e[43]=o,e[44]=r,e[45]=n,e[46]=F):F=e[46];let B;e[47]!==K||e[48]!==V||e[49]!==X||e[50]!==z||e[51]!==F?(B=m.jsxs("div",{className:K,style:V,children:[X,z,F]}),e[47]=K,e[48]=V,e[49]=X,e[50]=z,e[51]=F,e[52]=B):B=e[52];let Y;return e[53]!==B||e[54]!==$?(Y=m.jsxs(m.Fragment,{children:[$,B]}),e[53]=B,e[54]=$,e[55]=Y):Y=e[55],Y}function a7(t){return Math.max(Gx,Math.min(Kx,t))}function l7(t){return t.setFilesPanelWidth}function c7(t){const e=he.c(23),{workspaceId:n,workspacePath:r,workspaceName:o,serverUrl:a,apiToken:c,isLoggedIn:l,terminalPanelRef:u}=t,f=Qt(p7),p=Qt(h7),h=Qt(f7),_=Qt(d7),x=Qt(u7);if(!l)return null;let C;e[0]!==_?(C=()=>_(!1),e[0]=_,e[1]=C):C=e[1];let w;e[2]!==c||e[3]!==x||e[4]!==a||e[5]!==h||e[6]!==C||e[7]!==n?(w=m.jsx(o7,{workspaceId:n,serverUrl:a,apiToken:c,isOpen:h,width:x,onClose:C}),e[2]=c,e[3]=x,e[4]=a,e[5]=h,e[6]=C,e[7]=n,e[8]=w):w=e[8];let v;e[9]!==p?(v=()=>p(!1),e[9]=p,e[10]=v):v=e[10];let b;e[11]!==c||e[12]!==a||e[13]!==f||e[14]!==v||e[15]!==u||e[16]!==n||e[17]!==o||e[18]!==r?(b=m.jsx(e7,{ref:u,workspaceId:n,workspacePath:r,workspaceName:o,serverUrl:a,apiToken:c,isOpen:f,onClose:v}),e[11]=c,e[12]=a,e[13]=f,e[14]=v,e[15]=u,e[16]=n,e[17]=o,e[18]=r,e[19]=b):b=e[19];let y;return e[20]!==w||e[21]!==b?(y=m.jsxs(m.Fragment,{children:[w,b]}),e[20]=w,e[21]=b,e[22]=y):y=e[22],y}function u7(t){return t.filesPanelWidth}function d7(t){return t.setShowFilesPanel}function f7(t){return t.showFilesPanel}function h7(t){return t.setShowTerminalPanel}function p7(t){return t.showTerminalPanel}function Ib(t){const e=he.c(3),{message:n}=t,r=n===void 0?"Connecting to server...":n;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx(pr,{className:"size-8 animate-spin"}),e[0]=o):o=e[0];let a;return e[1]!==r?(a=m.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 text-muted-foreground",children:[o,m.jsx("p",{className:"text-sm",children:r})]}),e[1]=r,e[2]=a):a=e[2],a}const m7=t=>{const e=he.c(26),{serverUrl:n,authError:r,retryCount:o,nextRetryIn:a,onRetry:c,onLogout:l}=t;let u,f;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx(dS,{className:"size-12 text-destructive mb-4"}),f=m.jsx("h2",{className:"text-xl font-semibold text-foreground mb-2",children:"Unable to connect to server"}),e[0]=u,e[1]=f):(u=e[0],f=e[1]);const p=r||"Please check that the server is running.";let h;e[2]!==p?(h=m.jsx("p",{className:"text-sm text-muted-foreground mb-4 max-w-[400px]",children:p}),e[2]=p,e[3]=h):h=e[3];let _;e[4]!==n?(_=n&&m.jsx("p",{className:"text-xs text-muted-foreground mb-6 font-mono bg-muted px-3 py-1.5 rounded",children:n}),e[4]=n,e[5]=_):_=e[5];let x;e[6]!==a?(x=m.jsxs("p",{className:"text-sm text-muted-foreground",children:["Retrying in ",a,"s..."]}),e[6]=a,e[7]=x):x=e[7];let C;e[8]===Symbol.for("react.memo_cache_sentinel")?(C=m.jsx(ho,{className:"size-4 mr-2","data-icon":"inline-start"}),e[8]=C):C=e[8];let w;e[9]!==c?(w=m.jsxs(Fe,{onClick:c,variant:"default",children:[C,"Retry Now"]}),e[9]=c,e[10]=w):w=e[10];let v;e[11]!==l?(v=m.jsx(Fe,{onClick:l,variant:"ghost",children:"Change Server"}),e[11]=l,e[12]=v):v=e[12];let b;e[13]!==w||e[14]!==v?(b=m.jsxs("div",{className:"flex items-center gap-2",children:[w,v]}),e[13]=w,e[14]=v,e[15]=b):b=e[15];let y;e[16]!==o?(y=o>0&&m.jsxs("p",{className:"text-xs text-muted-foreground",children:["Retry attempt: ",o]}),e[16]=o,e[17]=y):y=e[17];let S;e[18]!==b||e[19]!==y||e[20]!==x?(S=m.jsxs("div",{className:"flex flex-col items-center gap-4",children:[x,b,y]}),e[18]=b,e[19]=y,e[20]=x,e[21]=S):S=e[21];let k;return e[22]!==S||e[23]!==h||e[24]!==_?(k=m.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] px-4 text-center",children:[u,f,h,_,S]}),e[22]=S,e[23]=h,e[24]=_,e[25]=k):k=e[25],k};function Pb(t){const e=he.c(40),{onServerAdded:n,error:r}=t,[o,a]=N.useState(""),[c,l]=N.useState("localhost:8742"),[u,f]=N.useState(""),[p,h]=N.useState(!1),[_,x]=N.useState(null);let C;e[0]!==o||e[1]!==n||e[2]!==u||e[3]!==c?(C=I=>{I.preventDefault();const L=o.trim(),z=c.trim(),F=u.trim();if(!L){x("Please enter a server name");return}if(!z){x("Please enter a server URL");return}if(!F){x("Please enter an API token");return}if(!Qx(F)){x("Invalid token format. Token should be 64 hex characters (0-9, a-f).");return}const B=Cd(z),Y={id:crypto.randomUUID(),name:L,url:B,token:F,createdAt:new Date().toISOString()};n(Y)},e[0]=o,e[1]=n,e[2]=u,e[3]=c,e[4]=C):C=e[4];const w=C;let v;e[5]===Symbol.for("react.memo_cache_sentinel")?(v=m.jsxs("div",{className:"px-6 pt-6 pb-4 text-center border-b border-border",children:[m.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Add your first server"}),m.jsx("p",{className:"text-muted-foreground mt-1",children:"Connect to a Jean2 server to get started"})]}),e[5]=v):v=e[5];let b;e[6]===Symbol.for("react.memo_cache_sentinel")?(b=m.jsx("label",{htmlFor:"serverName",className:"text-sm font-medium text-foreground",children:"Server Name"}),e[6]=b):b=e[6];let y;e[7]===Symbol.for("react.memo_cache_sentinel")?(y=I=>{a(I.target.value),x(null)},e[7]=y):y=e[7];let S;e[8]!==o?(S=m.jsxs("div",{className:"space-y-2",children:[b,m.jsx("input",{id:"serverName",type:"text",value:o,onChange:y,placeholder:"Production",className:"w-full px-3 py-2 bg-background border border-input rounded-lg text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent transition-colors"})]}),e[8]=o,e[9]=S):S=e[9];let k;e[10]===Symbol.for("react.memo_cache_sentinel")?(k=m.jsx("label",{htmlFor:"serverUrl",className:"text-sm font-medium text-foreground",children:"Server URL"}),e[10]=k):k=e[10];let T;e[11]===Symbol.for("react.memo_cache_sentinel")?(T=I=>{l(I.target.value),x(null)},e[11]=T):T=e[11];let R;e[12]!==c?(R=m.jsxs("div",{className:"space-y-2",children:[k,m.jsx("input",{id:"serverUrl",type:"text",value:c,onChange:T,placeholder:"localhost:8742",className:"w-full px-3 py-2 bg-background border border-input rounded-lg text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent transition-colors"})]}),e[12]=c,e[13]=R):R=e[13];let D;e[14]===Symbol.for("react.memo_cache_sentinel")?(D=m.jsx("label",{htmlFor:"token",className:"text-sm font-medium text-foreground",children:"API Token"}),e[14]=D):D=e[14];const A=p?"text":"password";let j;e[15]===Symbol.for("react.memo_cache_sentinel")?(j=I=>{f(I.target.value),x(null)},e[15]=j):j=e[15];let O;e[16]!==A||e[17]!==u?(O=m.jsx("input",{id:"token",type:A,value:u,onChange:j,placeholder:"Enter your 64-character token",className:"w-full px-3 py-2 pr-10 bg-background border border-input rounded-lg text-foreground font-mono text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent transition-colors"}),e[16]=A,e[17]=u,e[18]=O):O=e[18];let P;e[19]!==p?(P=()=>h(!p),e[19]=p,e[20]=P):P=e[20];const $=p?"Hide token":"Show token";let U;e[21]!==p?(U=p?m.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"})}):m.jsxs("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]}),e[21]=p,e[22]=U):U=e[22];let W;e[23]!==P||e[24]!==$||e[25]!==U?(W=m.jsx("button",{type:"button",onClick:P,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground transition-colors","aria-label":$,children:U}),e[23]=P,e[24]=$,e[25]=U,e[26]=W):W=e[26];let K;e[27]!==O||e[28]!==W?(K=m.jsxs("div",{className:"space-y-2",children:[D,m.jsxs("div",{className:"relative",children:[O,W]})]}),e[27]=O,e[28]=W,e[29]=K):K=e[29];let V;e[30]!==r||e[31]!==_?(V=(_||r)&&m.jsx("div",{className:"px-3 py-2 bg-destructive/10 border border-destructive/20 rounded-lg text-destructive text-sm",children:_||r}),e[30]=r,e[31]=_,e[32]=V):V=e[32];let Q;e[33]===Symbol.for("react.memo_cache_sentinel")?(Q=m.jsx("button",{type:"submit",className:"w-full py-2.5 bg-primary text-primary-foreground font-medium rounded-lg hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-colors",children:"Add Server"}),e[33]=Q):Q=e[33];let X;return e[34]!==w||e[35]!==K||e[36]!==V||e[37]!==S||e[38]!==R?(X=m.jsx("div",{className:"w-full h-full flex items-center justify-center bg-background dark:bg-gradient-to-br dark:from-muted dark:via-background dark:to-muted p-4",children:m.jsx("div",{className:"w-full max-w-md",children:m.jsxs("div",{className:"bg-card border border-border rounded-xl shadow-2xl overflow-hidden",children:[v,m.jsxs("form",{onSubmit:w,className:"p-6 space-y-4",children:[S,R,K,V,Q]})]})})}),e[34]=w,e[35]=K,e[36]=V,e[37]=S,e[38]=R,e[39]=X):X=e[39],X}function g7(t){const e=he.c(12);let n,r,o;e[0]!==t?({className:n,value:o,...r}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]);let a;e[4]!==n?(a=ke("relative flex h-1 w-full items-center overflow-x-hidden rounded-full bg-muted",n),e[4]=n,e[5]=a):a=e[5];const c=`translateX(-${100-(o||0)}%)`;let l;e[6]!==c?(l=m.jsx($M,{"data-slot":"progress-indicator",className:"size-full flex-1 bg-primary transition-all",style:{transform:c}}),e[6]=c,e[7]=l):l=e[7];let u;return e[8]!==r||e[9]!==a||e[10]!==l?(u=m.jsx(UM,{"data-slot":"progress",className:a,...r,children:l}),e[8]=r,e[9]=a,e[10]=l,e[11]=u):u=e[11],u}function dd(t){return t>=1e6?(t/1e6).toFixed(1)+"M":t>=1e3?(t/1e3).toFixed(1)+"k":t.toString()}function v7(t){return t>=60?"critical":t>=40?"warning":"normal"}function _7(t){const e=he.c(41),{totalTokens:n,contextWindow:r,modelName:o,compact:a}=t,c=n===void 0?0:n,l=r===void 0?0:r,u=a===void 0?!1:a,f=c===0?0:l;let p;e[0]!==f||e[1]!==c?(p=f===0?0:Math.min(100,Math.round(c/f*100)),e[0]=f,e[1]=c,e[2]=p):p=e[2];const h=p;let _;e[3]!==h?(_=v7(h),e[3]=h,e[4]=_):_=e[4];const x=_;if(u){let O;e[5]!==c?(O=dd(c),e[5]=c,e[6]=O):O=e[6];let P;e[7]!==f?(P=dd(f),e[7]=f,e[8]=P):P=e[8];let $;e[9]!==O||e[10]!==P?($=m.jsxs("span",{className:"text-xs font-mono",children:[O,"/",P]}),e[9]=O,e[10]=P,e[11]=$):$=e[11];let U;e[12]===Symbol.for("react.memo_cache_sentinel")?(U=m.jsx(mc,{asChild:!0,children:m.jsx(U5,{className:"size-3 text-muted-foreground cursor-help"})}),e[12]=U):U=e[12];let W;e[13]!==h?(W=m.jsx(Pd,{children:m.jsxs(pc,{children:[U,m.jsx(gc,{side:"bottom",children:m.jsxs("p",{className:"text-xs",children:[h,"% of context window used"]})})]})}),e[13]=h,e[14]=W):W=e[14];let K;return e[15]!==W||e[16]!==$?(K=m.jsxs("div",{className:"flex items-center gap-1.5",children:[$,W]}),e[15]=W,e[16]=$,e[17]=K):K=e[17],K}let C;e[18]===Symbol.for("react.memo_cache_sentinel")?(C=m.jsx("span",{className:"text-xs text-muted-foreground",children:"Tokens:"}),e[18]=C):C=e[18];let w;e[19]!==c?(w=dd(c),e[19]=c,e[20]=w):w=e[20];let v;e[21]!==f?(v=dd(f),e[21]=f,e[22]=v):v=e[22];let b;e[23]!==w||e[24]!==v?(b=m.jsxs("div",{className:"flex items-center gap-2",children:[C,m.jsxs("span",{className:"text-xs font-mono",children:[w,"/",v]})]}),e[23]=w,e[24]=v,e[25]=b):b=e[25];const y=x==="critical"&&"[&>div]:bg-destructive",S=x==="warning"&&"[&>div]:bg-warning",k=x==="normal"&&"[&>div]:bg-primary";let T;e[26]!==y||e[27]!==S||e[28]!==k?(T=ke("h-1 w-20",y,S,k),e[26]=y,e[27]=S,e[28]=k,e[29]=T):T=e[29];let R;e[30]!==h||e[31]!==T?(R=m.jsx(g7,{value:h,className:T}),e[30]=h,e[31]=T,e[32]=R):R=e[32];let D;e[33]!==h?(D=m.jsxs("span",{className:"text-[11px] text-muted-foreground",children:["(",h,"%)"]}),e[33]=h,e[34]=D):D=e[34];let A;e[35]!==R||e[36]!==D?(A=m.jsxs("div",{className:"flex items-center gap-2",children:[R,D]}),e[35]=R,e[36]=D,e[37]=A):A=e[37];let j;return e[38]!==b||e[39]!==A?(j=m.jsx("div",{className:"flex items-center gap-3",children:m.jsxs("div",{className:"flex flex-col gap-1",children:[b,A]})}),e[38]=b,e[39]=A,e[40]=j):j=e[40],j}function dv(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(kD,{"data-slot":"select",...n}),e[2]=n,e[3]=r):r=e[3],r}function y7(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=ke("scroll-my-1 p-1",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==r||e[6]!==o?(a=m.jsx(DD,{"data-slot":"select-group",className:o,...r}),e[5]=r,e[6]=o,e[7]=a):a=e[7],a}function Ma(t){const e=he.c(4);let n;e[0]!==t?({...n}=t,e[0]=t,e[1]=n):n=e[1];let r;return e[2]!==n?(r=m.jsx(AD,{"data-slot":"select-value",...n}),e[2]=n,e[3]=r):r=e[3],r}function fv(t){const e=he.c(13);let n,r,o,a;e[0]!==t?({className:r,size:a,children:n,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=a):(n=e[1],r=e[2],o=e[3],a=e[4]);const c=a===void 0?"default":a;let l;e[5]!==r?(l=ke("flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",r),e[5]=r,e[6]=l):l=e[6];let u;e[7]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx(RD,{asChild:!0,children:m.jsx(Oa,{className:"pointer-events-none size-4 text-muted-foreground"})}),e[7]=u):u=e[7];let f;return e[8]!==n||e[9]!==o||e[10]!==c||e[11]!==l?(f=m.jsxs(ED,{"data-slot":"select-trigger","data-size":c,className:l,...o,children:[n,u]}),e[8]=n,e[9]=o,e[10]=c,e[11]=l,e[12]=f):f=e[12],f}function hv(t){const e=he.c(24);let n,r,o,a,c;e[0]!==t?({className:r,children:n,position:a,align:c,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o,e[4]=a,e[5]=c):(n=e[1],r=e[2],o=e[3],a=e[4],c=e[5]);const l=a===void 0?"item-aligned":a,u=c===void 0?"center":c,f=l==="item-aligned",p=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let h;e[6]!==r||e[7]!==p?(h=ke("relative z-50 max-h-(--radix-select-content-available-height) min-w-36 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",p,r),e[6]=r,e[7]=p,e[8]=h):h=e[8];let _;e[9]===Symbol.for("react.memo_cache_sentinel")?(_=m.jsx(x7,{}),e[9]=_):_=e[9];const x=l==="popper"&&"";let C;e[10]!==x?(C=ke("data-[position=popper]:h-(--radix-select-trigger-height) data-[position=popper]:w-full data-[position=popper]:min-w-(--radix-select-trigger-width)",x),e[10]=x,e[11]=C):C=e[11];let w;e[12]!==n||e[13]!==l||e[14]!==C?(w=m.jsx(MD,{"data-position":l,className:C,children:n}),e[12]=n,e[13]=l,e[14]=C,e[15]=w):w=e[15];let v;e[16]===Symbol.for("react.memo_cache_sentinel")?(v=m.jsx(S7,{}),e[16]=v):v=e[16];let b;return e[17]!==u||e[18]!==l||e[19]!==o||e[20]!==f||e[21]!==h||e[22]!==w?(b=m.jsx(TD,{children:m.jsxs(ND,{"data-slot":"select-content","data-align-trigger":f,className:h,position:l,align:u,...o,children:[_,w,v]})}),e[17]=u,e[18]=l,e[19]=o,e[20]=f,e[21]=h,e[22]=w,e[23]=b):b=e[23],b}function b7(t){const e=he.c(8);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=ke("px-1.5 py-1 text-xs text-muted-foreground",n),e[3]=n,e[4]=o):o=e[4];let a;return e[5]!==r||e[6]!==o?(a=m.jsx(jD,{"data-slot":"select-label",className:o,...r}),e[5]=r,e[6]=o,e[7]=a):a=e[7],a}function Lf(t){const e=he.c(13);let n,r,o;e[0]!==t?({className:r,children:n,...o}=t,e[0]=t,e[1]=n,e[2]=r,e[3]=o):(n=e[1],r=e[2],o=e[3]);let a;e[4]!==r?(a=ke("relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",r),e[4]=r,e[5]=a):a=e[5];let c;e[6]===Symbol.for("react.memo_cache_sentinel")?(c=m.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center",children:m.jsx(ID,{children:m.jsx(Ls,{className:"pointer-events-none"})})}),e[6]=c):c=e[6];let l;e[7]!==n?(l=m.jsx(LD,{children:n}),e[7]=n,e[8]=l):l=e[8];let u;return e[9]!==o||e[10]!==a||e[11]!==l?(u=m.jsxs(OD,{"data-slot":"select-item",className:a,...o,children:[c,l]}),e[9]=o,e[10]=a,e[11]=l,e[12]=u):u=e[12],u}function x7(t){const e=he.c(9);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=ke("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",n),e[3]=n,e[4]=o):o=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx(f5,{}),e[5]=a):a=e[5];let c;return e[6]!==r||e[7]!==o?(c=m.jsx(PD,{"data-slot":"select-scroll-up-button",className:o,...r,children:a}),e[6]=r,e[7]=o,e[8]=c):c=e[8],c}function S7(t){const e=he.c(9);let n,r;e[0]!==t?({className:n,...r}=t,e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]);let o;e[3]!==n?(o=ke("z-10 flex cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",n),e[3]=n,e[4]=o):o=e[4];let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx(Oa,{}),e[5]=a):a=e[5];let c;return e[6]!==r||e[7]!==o?(c=m.jsx(zD,{"data-slot":"select-scroll-down-button",className:o,...r,children:a}),e[6]=r,e[7]=o,e[8]=c):c=e[8],c}function w7(t){switch(t){case"budget":return"$";case"standard":return"$$";case"premium":return"$$$";default:return""}}function C7(t){const e=he.c(45),{models:n,selectedModelId:r,onChangeModel:o,disabled:a,compact:c,iconOnly:l,connectedProviderIds:u,connectableProviderIds:f}=t,p=c===void 0?!1:c,h=l===void 0?!1:l;let _,x,C,w,v,b,y,S,k;if(e[0]!==p||e[1]!==f||e[2]!==u||e[3]!==a||e[4]!==h||e[5]!==n||e[6]!==o||e[7]!==r){const A=n.reduce(k7,{});let j;e[17]!==n||e[18]!==o?(j=K=>{const V=n.find(Q=>Q.id===K);V&&o(K,V.providerId)},e[17]=n,e[18]=o,e[19]=j):j=e[19];const O=j,P=p&&!h;S="flex items-center gap-2",e[20]!==h||e[21]!==P?(k=!h&&m.jsx(Nr,{className:"text-xs text-muted-foreground",children:P?m.jsx(Ty,{className:"size-3.5"}):"Model:"}),e[20]=h,e[21]=P,e[22]=k):k=e[22],x=dv,w=r||"",v=O,b=a;const $=h?"w-9 h-9 px-0 justify-center gap-0 [&>svg:last-child]:hidden [&_[data-slot=select-value]]:hidden":"w-[180px] h-8 text-sm";let U;e[23]!==h?(U=h&&m.jsxs(m.Fragment,{children:[m.jsx(Ty,{className:"size-4"}),m.jsx(Ma,{className:"sr-only"})]}),e[23]=h,e[24]=U):U=e[24];let W;e[25]!==h?(W=!h&&m.jsx(Ma,{placeholder:"Select model"}),e[25]=h,e[26]=W):W=e[26],e[27]!==$||e[28]!==U||e[29]!==W?(y=m.jsxs(fv,{className:$,children:[U,W]}),e[27]=$,e[28]=U,e[29]=W,e[30]=y):y=e[30],_=hv,C=Object.entries(A).map(K=>{const[V,Q]=K;return m.jsxs(y7,{children:[m.jsx(b7,{children:V}),Q.map(X=>m.jsx(Lf,{value:X.id,disabled:(f==null?void 0:f.has(X.providerId))&&!(u!=null&&u.has(X.providerId)),children:m.jsxs("span",{className:"flex items-center gap-2",children:[X.name,m.jsx("span",{className:"text-muted-foreground text-xs",children:w7(X.tier)}),(f==null?void 0:f.has(X.providerId))&&(u==null?void 0:u.has(X.providerId))&&m.jsx($n,{variant:"secondary",className:"text-[10px] px-1 py-0 h-4",children:"Sub"}),(f==null?void 0:f.has(X.providerId))&&!(u!=null&&u.has(X.providerId))&&m.jsx($n,{variant:"outline",className:"text-[10px] px-1 py-0 h-4",children:"OAuth"})]})},X.id))]},V)}),e[0]=p,e[1]=f,e[2]=u,e[3]=a,e[4]=h,e[5]=n,e[6]=o,e[7]=r,e[8]=_,e[9]=x,e[10]=C,e[11]=w,e[12]=v,e[13]=b,e[14]=y,e[15]=S,e[16]=k}else _=e[8],x=e[9],C=e[10],w=e[11],v=e[12],b=e[13],y=e[14],S=e[15],k=e[16];let T;e[31]!==_||e[32]!==C?(T=m.jsx(_,{children:C}),e[31]=_,e[32]=C,e[33]=T):T=e[33];let R;e[34]!==x||e[35]!==T||e[36]!==w||e[37]!==v||e[38]!==b||e[39]!==y?(R=m.jsxs(x,{value:w,onValueChange:v,disabled:b,children:[y,T]}),e[34]=x,e[35]=T,e[36]=w,e[37]=v,e[38]=b,e[39]=y,e[40]=R):R=e[40];let D;return e[41]!==R||e[42]!==S||e[43]!==k?(D=m.jsxs("div",{className:S,children:[k,R]}),e[41]=R,e[42]=S,e[43]=k,e[44]=D):D=e[44],D}function k7(t,e){return t[e.providerName]||(t[e.providerName]=[]),t[e.providerName].push(e),t}const E7={low:"Low",medium:"Medium",high:"High",xhigh:"X-High",minimal:"Minimal",max:"Max"};function A7(t){return E7[t]||t.charAt(0).toUpperCase()+t.slice(1)}function R7(t){const e=he.c(45),{variants:n,selectedVariant:r,onChangeVariant:o,disabled:a,compact:c,iconOnly:l}=t,u=c===void 0?!1:c,f=l===void 0?!1:l,p=u&&!f;if(!n||Object.keys(n).length===0)return null;let h,_,x,C,w,v,b,y,S,k;if(e[0]!==a||e[1]!==f||e[2]!==o||e[3]!==r||e[4]!==p||e[5]!==n){const A=Object.keys(n);let j;e[16]!==o?(j=W=>{o(W==="__none__"?null:W)},e[16]=o,e[17]=j):j=e[17];const O=j;k="flex items-center gap-2",e[18]!==f||e[19]!==p?(x=!f&&m.jsx(Nr,{className:"text-xs text-muted-foreground",children:p?m.jsx(Ry,{className:"size-3.5"}):"Thinking:"}),e[18]=f,e[19]=p,e[20]=x):x=e[20],_=dv,v=r||"__none__",b=O,y=a;const P=f?"w-9 h-9 px-0 justify-center gap-0 [&>svg:last-child]:hidden [&_[data-slot=select-value]]:hidden":"w-[120px] h-8 text-sm";let $;e[21]!==f?($=f&&m.jsxs(m.Fragment,{children:[m.jsx(Ry,{className:"size-4"}),m.jsx(Ma,{className:"sr-only"})]}),e[21]=f,e[22]=$):$=e[22];let U;e[23]!==f?(U=!f&&m.jsx(Ma,{placeholder:"Default"}),e[23]=f,e[24]=U):U=e[24],e[25]!==P||e[26]!==$||e[27]!==U?(S=m.jsxs(fv,{className:P,children:[$,U]}),e[25]=P,e[26]=$,e[27]=U,e[28]=S):S=e[28],h=hv,e[29]===Symbol.for("react.memo_cache_sentinel")?(C=m.jsx(Lf,{value:"__none__",children:"Default"}),e[29]=C):C=e[29],w=A.map(T7),e[0]=a,e[1]=f,e[2]=o,e[3]=r,e[4]=p,e[5]=n,e[6]=h,e[7]=_,e[8]=x,e[9]=C,e[10]=w,e[11]=v,e[12]=b,e[13]=y,e[14]=S,e[15]=k}else h=e[6],_=e[7],x=e[8],C=e[9],w=e[10],v=e[11],b=e[12],y=e[13],S=e[14],k=e[15];let T;e[30]!==h||e[31]!==C||e[32]!==w?(T=m.jsxs(h,{children:[C,w]}),e[30]=h,e[31]=C,e[32]=w,e[33]=T):T=e[33];let R;e[34]!==_||e[35]!==T||e[36]!==v||e[37]!==b||e[38]!==y||e[39]!==S?(R=m.jsxs(_,{value:v,onValueChange:b,disabled:y,children:[S,T]}),e[34]=_,e[35]=T,e[36]=v,e[37]=b,e[38]=y,e[39]=S,e[40]=R):R=e[40];let D;return e[41]!==x||e[42]!==R||e[43]!==k?(D=m.jsxs("div",{className:k,children:[x,R]}),e[41]=x,e[42]=R,e[43]=k,e[44]=D):D=e[44],D}function T7(t){return m.jsx(Lf,{value:t,children:A7(t)},t)}function N7(t){const e=he.c(24),{preconfigs:n,selectedPreconfigId:r,onChangePreconfig:o,disabled:a,compact:c,iconOnly:l}=t,u=c===void 0?!1:c,f=l===void 0?!1:l,p=u&&!f;let h;e[0]!==f||e[1]!==p?(h=!f&&m.jsx(Nr,{className:"text-xs text-muted-foreground",children:p?m.jsx(w5,{className:"size-3.5"}):"Config:"}),e[0]=f,e[1]=p,e[2]=h):h=e[2];const _=r||"",x=f?"w-9 h-9 px-0 justify-center gap-0 [&>svg:last-child]:hidden [&_[data-slot=select-value]]:hidden":"w-[140px] h-8 text-sm";let C;e[3]!==f?(C=f&&m.jsxs(m.Fragment,{children:[m.jsx(aS,{className:"size-4"}),m.jsx(Ma,{className:"sr-only"})]}),e[3]=f,e[4]=C):C=e[4];let w;e[5]!==f?(w=!f&&m.jsx(Ma,{placeholder:"Select config"}),e[5]=f,e[6]=w):w=e[6];let v;e[7]!==x||e[8]!==C||e[9]!==w?(v=m.jsxs(fv,{className:x,children:[C,w]}),e[7]=x,e[8]=C,e[9]=w,e[10]=v):v=e[10];let b;e[11]!==n?(b=n.map(M7),e[11]=n,e[12]=b):b=e[12];let y;e[13]!==b?(y=m.jsx(hv,{children:b}),e[13]=b,e[14]=y):y=e[14];let S;e[15]!==a||e[16]!==o||e[17]!==y||e[18]!==_||e[19]!==v?(S=m.jsxs(dv,{value:_,onValueChange:o,disabled:a,children:[v,y]}),e[15]=a,e[16]=o,e[17]=y,e[18]=_,e[19]=v,e[20]=S):S=e[20];let k;return e[21]!==S||e[22]!==h?(k=m.jsxs("div",{className:"flex items-center gap-2",children:[h,S]}),e[21]=S,e[22]=h,e[23]=k):k=e[23],k}function M7(t){return m.jsxs(Lf,{value:t.id,children:[t.name,t.isDefault&&m.jsx("span",{className:"ml-2 text-muted-foreground text-xs",children:"(default)"})]},t.id)}function D7(t){var Ue;const e=he.c(104),{session:n,preconfigs:r,models:o,usage:a,modelName:c,onChangePreconfig:l,onChangeModel:u,onChangeVariant:f,onRename:p,onNavigateBack:h,isStreaming:_,onInterrupt:x,onCompact:C,isCompacting:w,canCompact:v,connectedProviderIds:b,connectableProviderIds:y,selectedVariant:S,variants:k}=t,[T,R]=N.useState(!1),[D,A]=N.useState(n.title||""),j=N.useRef(null),O=Ka(),P=WO();let $,U;e[0]!==T?($=()=>{T&&j.current&&(j.current.focus(),j.current.select())},U=[T],e[0]=T,e[1]=$,e[2]=U):($=e[1],U=e[2]),N.useEffect($,U);let W;e[3]!==n.title?(W=()=>{A(n.title||""),R(!0)},e[3]=n.title,e[4]=W):W=e[4];const K=W;let V;e[5]!==D||e[6]!==p||e[7]!==n.id||e[8]!==n.title?(V=()=>{const Pe=D.trim();Pe&&Pe!==n.title&&p(n.id,Pe),R(!1)},e[5]=D,e[6]=p,e[7]=n.id,e[8]=n.title,e[9]=V):V=e[9];const Q=V;let X;e[10]!==Q||e[11]!==n.title?(X=Pe=>{Pe.key==="Enter"?Q():Pe.key==="Escape"&&(A(n.title||""),R(!1))},e[10]=Q,e[11]=n.title,e[12]=X):X=e[12];const I=X;let L;e[13]!==c||e[14]!==r||e[15]!==n.preconfigId||e[16]!==n.selectedModel?(L=n.selectedModel||((Ue=r.find(Pe=>Pe.id===n.preconfigId))==null?void 0:Ue.model)||c,e[13]=c,e[14]=r,e[15]=n.preconfigId,e[16]=n.selectedModel,e[17]=L):L=e[17];const z=L;let F;if(e[18]!==o||e[19]!==z){let Pe;e[21]!==z?(Pe=Re=>Re.id===z,e[21]=z,e[22]=Pe):Pe=e[22],F=o.find(Pe),e[18]=o,e[19]=z,e[20]=F}else F=e[20];const B=F,Y=B==null?void 0:B.contextWindow;let ee;e[23]!==h||e[24]!==n.parentId?(ee=n.parentId&&h&&m.jsxs(Fe,{variant:"ghost",size:"sm",onClick:h,className:"h-7",children:[m.jsx(t5,{className:"size-4","data-icon":"inline-start"}),"Back"]}),e[23]=h,e[24]=n.parentId,e[25]=ee):ee=e[25];let J;e[26]!==D||e[27]!==I||e[28]!==K||e[29]!==Q||e[30]!==T||e[31]!==n.title?(J=T?m.jsx("input",{ref:j,type:"text",value:D,onChange:Pe=>A(Pe.target.value),onBlur:Q,onKeyDown:I,className:"text-lg font-semibold bg-background border border-primary rounded px-2 py-0.5 outline-none min-w-0 flex-1",autoFocus:!0}):m.jsx("h2",{className:"text-lg font-semibold cursor-pointer px-2 py-0.5 -mx-2 rounded hover:bg-accent transition-colors truncate min-w-0",onDoubleClick:K,children:n.title||"Untitled Session"}),e[26]=D,e[27]=I,e[28]=K,e[29]=Q,e[30]=T,e[31]=n.title,e[32]=J):J=e[32];let G;e[33]!==n.id?(G=n.id.slice(0,8),e[33]=n.id,e[34]=G):G=e[34];let q;e[35]!==G?(q=m.jsx($n,{variant:"outline",className:"font-mono text-xs",children:G}),e[35]=G,e[36]=q):q=e[36];let te;e[37]!==n.status?(te=n.status==="closed"&&m.jsxs($n,{variant:"secondary",children:[m.jsx(Q4,{className:"size-3","data-icon":"inline-start"}),"Archived"]}),e[37]=n.status,e[38]=te):te=e[38];let re;e[39]!==q||e[40]!==te||e[41]!==ee||e[42]!==J?(re=m.jsx("div",{className:"flex items-center justify-start px-4 py-2 overflow-hidden",children:m.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[ee,J,q,te]})}),e[39]=q,e[40]=te,e[41]=ee,e[42]=J,e[43]=re):re=e[43];let oe;e[44]===Symbol.for("react.memo_cache_sentinel")?(oe=m.jsx(ls,{}),e[44]=oe):oe=e[44];let se;e[45]!==Y||e[46]!==O||e[47]!==c||e[48]!==a.completionTokens||e[49]!==a.promptTokens||e[50]!==a.totalTokens?(se=m.jsx(_7,{promptTokens:a.promptTokens,completionTokens:a.completionTokens,totalTokens:a.totalTokens,contextWindow:Y,modelName:c,compact:O}),e[45]=Y,e[46]=O,e[47]=c,e[48]=a.completionTokens,e[49]=a.promptTokens,e[50]=a.totalTokens,e[51]=se):se=e[51];let ye;e[52]===Symbol.for("react.memo_cache_sentinel")?(ye=m.jsx(ls,{orientation:"vertical",className:"hidden sm:block"}),e[52]=ye):ye=e[52];const Ee=n.status==="closed"||!!n.parentId;let Ae;e[53]!==y||e[54]!==b||e[55]!==P||e[56]!==O||e[57]!==o||e[58]!==u||e[59]!==z||e[60]!==Ee?(Ae=m.jsx(C7,{models:o,selectedModelId:z,onChangeModel:u,disabled:Ee,compact:P,iconOnly:O,connectedProviderIds:b,connectableProviderIds:y}),e[53]=y,e[54]=b,e[55]=P,e[56]=O,e[57]=o,e[58]=u,e[59]=z,e[60]=Ee,e[61]=Ae):Ae=e[61];const Be=n.status==="closed"||!!n.parentId;let le;e[62]!==P||e[63]!==O||e[64]!==f||e[65]!==S||e[66]!==Be||e[67]!==k?(le=m.jsx(R7,{variants:k,selectedVariant:S,onChangeVariant:f,disabled:Be,compact:P,iconOnly:O}),e[62]=P,e[63]=O,e[64]=f,e[65]=S,e[66]=Be,e[67]=k,e[68]=le):le=e[68];const Ce=n.status==="closed"||!!n.parentId;let ge;e[69]!==P||e[70]!==O||e[71]!==l||e[72]!==r||e[73]!==n.preconfigId||e[74]!==Ce?(ge=m.jsx(N7,{preconfigs:r,selectedPreconfigId:n.preconfigId,onChangePreconfig:l,disabled:Ce,compact:P,iconOnly:O}),e[69]=P,e[70]=O,e[71]=l,e[72]=r,e[73]=n.preconfigId,e[74]=Ce,e[75]=ge):ge=e[75];let Oe;e[76]===Symbol.for("react.memo_cache_sentinel")?(Oe=m.jsx(ls,{orientation:"vertical",className:"hidden sm:block"}),e[76]=Oe):Oe=e[76];let He;e[77]!==v||e[78]!==P||e[79]!==w||e[80]!==_||e[81]!==C?(He=C&&m.jsxs(m.Fragment,{children:[m.jsxs(Fe,{variant:"outline",size:P?"icon":"sm",onClick:C,disabled:_||w||!v,title:w?"Compacting...":"Compact older messages",children:[m.jsx(sS,{className:"size-4"}),!P&&m.jsx("span",{className:"ml-1",children:w?"Compacting...":"Compact"})]}),m.jsx(ls,{orientation:"vertical",className:"hidden sm:block"})]}),e[77]=v,e[78]=P,e[79]=w,e[80]=_,e[81]=C,e[82]=He):He=e[82];const rt=_?"destructive":"outline",Qe=P?"icon":"sm",Ne=!x,Ge=_?"":"opacity-60 hover:opacity-100",ce=_?"Interrupt operation":"Interrupt (no active operation)";let ve;e[83]===Symbol.for("react.memo_cache_sentinel")?(ve=m.jsx(cS,{className:"size-4"}),e[83]=ve):ve=e[83];let Te;e[84]!==P?(Te=!P&&m.jsx("span",{className:"ml-1",children:"Stop"}),e[84]=P,e[85]=Te):Te=e[85];let je;e[86]!==x||e[87]!==rt||e[88]!==Qe||e[89]!==Ne||e[90]!==Ge||e[91]!==ce||e[92]!==Te?(je=m.jsxs(Fe,{variant:rt,size:Qe,onClick:x,disabled:Ne,className:Ge,title:ce,children:[ve,Te]}),e[86]=x,e[87]=rt,e[88]=Qe,e[89]=Ne,e[90]=Ge,e[91]=ce,e[92]=Te,e[93]=je):je=e[93];let Le;e[94]!==se||e[95]!==Ae||e[96]!==le||e[97]!==ge||e[98]!==He||e[99]!==je?(Le=m.jsxs("div",{className:"inline-flex align-middle items-center gap-3 sm:gap-4 px-4 py-2 flex-wrap",children:[se,ye,Ae,le,ge,Oe,He,je]}),e[94]=se,e[95]=Ae,e[96]=le,e[97]=ge,e[98]=He,e[99]=je,e[100]=Le):Le=e[100];let Je;return e[101]!==re||e[102]!==Le?(Je=m.jsxs("header",{className:"flex flex-col border-b border-border bg-card",children:[re,oe,Le]}),e[101]=re,e[102]=Le,e[103]=Je):Je=e[103],Je}function j7(t){const e=he.c(25),{prompts:n,query:r,selectedIndex:o,onSelect:a}=t;let c,l,u,f;if(e[0]!==a||e[1]!==n||e[2]!==r||e[3]!==o){f=Symbol.for("react.early_return_sentinel");e:{let v;if(e[8]!==r?(v=y=>y.name.toLowerCase().includes(r.toLowerCase()),e[8]=r,e[9]=v):v=e[9],c=n.filter(v),c.length===0){let y;e[10]!==r?(y=m.jsxs("div",{className:"p-2 text-xs text-muted-foreground",children:['No prompts matching "/',r,'"']}),e[10]=r,e[11]=y):y=e[11],f=y;break e}l="p-1";let b;e[12]!==a||e[13]!==o?(b=(y,S)=>m.jsxs("button",{onClick:()=>a(y),className:ke("flex items-center gap-2 w-full px-2 py-1.5 rounded text-sm text-left","hover:bg-muted",S===o&&"bg-primary/20 text-primary font-medium ring-1 ring-primary/50"),children:[m.jsx(tA,{className:"w-4 h-4 text-muted-foreground flex-shrink-0"}),m.jsxs("div",{className:"flex-1 min-w-0",children:[m.jsxs("div",{className:"font-mono text-xs",children:["/",y.name]}),m.jsx("div",{className:"text-xs text-muted-foreground truncate",children:y.description})]})]},y.name),e[12]=a,e[13]=o,e[14]=b):b=e[14],u=c.map(b)}e[0]=a,e[1]=n,e[2]=r,e[3]=o,e[4]=c,e[5]=l,e[6]=u,e[7]=f}else c=e[4],l=e[5],u=e[6],f=e[7];if(f!==Symbol.for("react.early_return_sentinel"))return f;const p=c.length!==1?"s":"";let h;e[15]===Symbol.for("react.memo_cache_sentinel")?(h=m.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"↑↓"}),e[15]=h):h=e[15];let _;e[16]===Symbol.for("react.memo_cache_sentinel")?(_=m.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"↵"}),e[16]=_):_=e[16];let x;e[17]===Symbol.for("react.memo_cache_sentinel")?(x=m.jsx("kbd",{className:"ml-1 px-1 py-0.5 bg-muted rounded text-[10px]",children:"esc"}),e[17]=x):x=e[17];let C;e[18]!==c.length||e[19]!==p?(C=m.jsxs("div",{className:"mt-1 pt-1 border-t text-xs text-muted-foreground px-2",children:[c.length," prompt",p," •",h," navigate",_," select",x," close"]}),e[18]=c.length,e[19]=p,e[20]=C):C=e[20];let w;return e[21]!==l||e[22]!==u||e[23]!==C?(w=m.jsxs("div",{className:l,children:[u,C]}),e[21]=l,e[22]=u,e[23]=C,e[24]=w):w=e[24],w}function O7(t){const e=he.c(9),{debounceMs:n}=t,[r,o]=N.useState(""),[a,c]=N.useState(!1);let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=[],e[0]=l):l=e[0];const[u,f]=N.useState(l);let p;e[1]===Symbol.for("react.memo_cache_sentinel")?(p=v=>{const b={type:"file",path:v.path,display:v.name};return f(y=>[...y,b]),c(!1),o(""),b},e[1]=p):p=e[1];const h=p,_=L7;let x;e[2]!==u?(x=v=>{const b=/@([^\s@]+)/g,y=[];let S;for(;(S=b.exec(v))!==null;){const k=S[1];u.some(T=>T.path===k)&&!y.some(T=>T.path===k)&&y.push({type:"file",path:k,display:k.split("/").pop()||k})}return y},e[2]=u,e[3]=x):x=e[3];const C=x;let w;return e[4]!==C||e[5]!==u||e[6]!==r||e[7]!==a?(w={query:r,setQuery:o,showAutocomplete:a,setShowAutocomplete:c,mentions:u,handleFileSelect:h,insertMention:_,extractMentions:C},e[4]=C,e[5]=u,e[6]=r,e[7]=a,e[8]=w):w=e[8],w}function L7(t,e,n){const r=t.lastIndexOf("@",e);if(r===-1)return{text:t,cursorPos:e};const o=t.slice(0,r)+`@${n.path}`+t.slice(e),a=r+n.path.length+1;return{text:o,cursorPos:a}}function I7(t,e){return e?t.content.includes("ARG")?t.content.replace("ARG",e):`${t.content}
530
+ ${e}`:t.content}function P7(t){const e=t.trimStart();if(!e.startsWith("/"))return null;const n=e.indexOf(" ");return n===-1?{command:e.slice(1),rest:""}:{command:e.slice(1,n),rest:e.slice(n+1).trim()}}const z7=N.forwardRef(function(e,n){const r=he.c(90),{onSendMessage:o,disabled:a,isStreaming:c,onStopStreaming:l,placeholder:u,workspaceId:f,serverUrl:p,apiToken:h,prompts:_}=e,x=u===void 0?"Type a message...":u;let C;r[0]!==_?(C=_===void 0?[]:_,r[0]=_,r[1]=C):C=r[1];const w=C,[v,b]=N.useState(""),[y,S]=N.useState(0);let k;r[2]===Symbol.for("react.memo_cache_sentinel")?(k=[],r[2]=k):k=r[2];const[T,R]=N.useState(k),[D,A]=N.useState(0),[j,O]=N.useState("none"),[P,$]=N.useState(""),U=N.useRef(null);let W,K;r[3]===Symbol.for("react.memo_cache_sentinel")?(W=()=>({focus:()=>{var we;return(we=U.current)==null?void 0:we.focus()}}),K=[],r[3]=W,r[4]=K):(W=r[3],K=r[4]),N.useImperativeHandle(n,W,K);const V=f||"";let Q;r[5]!==V?(Q={workspaceId:V},r[5]=V,r[6]=Q):Q=r[6];const{query:X,setQuery:I,showAutocomplete:L,setShowAutocomplete:z,handleFileSelect:F,insertMention:B}=O7(Q);let Y;r[7]===Symbol.for("react.memo_cache_sentinel")?(Y=()=>{A(0)},r[7]=Y):Y=r[7];let ee;r[8]!==T||r[9]!==P||r[10]!==w?(ee=[T,P,w],r[8]=T,r[9]=P,r[10]=w,r[11]=ee):ee=r[11],N.useEffect(Y,ee);let J;r[12]===Symbol.for("react.memo_cache_sentinel")?(J=()=>{const we=U.current;we&&(we.style.height="auto",we.style.height=`${Math.min(we.scrollHeight,150)}px`)},r[12]=J):J=r[12];let G;r[13]!==v?(G=[v],r[13]=v,r[14]=G):G=r[14],N.useEffect(J,G);let q;if(r[15]!==P||r[16]!==w){let we;r[18]!==P?(we=De=>De.name.toLowerCase().includes(P.toLowerCase()),r[18]=P,r[19]=we):we=r[19],q=w.filter(we),r[15]=P,r[16]=w,r[17]=q}else q=r[17];const te=q,re=j==="prompts"&&w.length>0,oe=j==="files"&&L&&!!f;let se;r[20]!==I||r[21]!==z?(se=we=>{const De=we.target.value,$e=we.target.selectionStart||0;b(De),S($e);const gt=De.lastIndexOf("/",$e);if(gt!==-1){const Et=gt>0?De[gt-1]:`
531
+ `,Zt=De.slice(gt+1,$e);if((Et===`
532
+ `||Et===" "||Et==="")&&!Zt.includes(" ")){$(Zt),O("prompts");return}}const It=De.lastIndexOf("@",$e);if(It!==-1){const Et=De.slice(It+1,$e);if(!Et.includes(" ")){I(Et),z(!0),O("files");return}}O("none"),z(!1)},r[20]=I,r[21]=z,r[22]=se):se=r[22];const ye=se;let Ee;r[23]!==y||r[24]!==F||r[25]!==v||r[26]!==B||r[27]!==z?(Ee=we=>{const De=F(we),$e=B(v,y,De);b($e.text),O("none"),z(!1),R([]),setTimeout(()=>{U.current&&(U.current.focus(),U.current.setSelectionRange($e.cursorPos,$e.cursorPos))},0)},r[23]=y,r[24]=F,r[25]=v,r[26]=B,r[27]=z,r[28]=Ee):Ee=r[28];const Ae=Ee;let Be;r[29]!==y||r[30]!==v?(Be=we=>{const De=v.lastIndexOf("/",y),$e=v.slice(0,De),gt=v.slice(De+1),It=gt.indexOf(" "),Et=It!==-1?gt.slice(It):"",Zt=`${$e}/${we.name}${Et}`,qt=De+1+we.name.length+0;b(Zt),O("none"),setTimeout(()=>{U.current&&(U.current.focus(),U.current.setSelectionRange(qt,qt))},0)},r[29]=y,r[30]=v,r[31]=Be):Be=r[31];const le=Be;let Ce;r[32]!==a||r[33]!==v||r[34]!==o||r[35]!==w?(Ce=we=>{if(we==null||we.preventDefault(),!v.trim()||a)return;const De=P7(v);if(De){const $e=w.find(gt=>gt.name===De.command);if($e){const gt=I7($e,De.rest);o(gt),b("");return}}o(v.trim()),b("")},r[32]=a,r[33]=v,r[34]=o,r[35]=w,r[36]=Ce):Ce=r[36];const ge=Ce;let Oe;r[37]!==T||r[38]!==te||r[39]!==Ae||r[40]!==le||r[41]!==ge||r[42]!==D||r[43]!==z||r[44]!==oe||r[45]!==re?(Oe=we=>{if(!we.nativeEvent.isComposing){if(re&&te.length>0)switch(we.key){case"ArrowDown":{we.preventDefault(),A(De=>Math.min(De+1,te.length-1));return}case"ArrowUp":{we.preventDefault(),A(B7);return}case"Enter":{if(we.shiftKey)return;we.preventDefault(),te[D]&&le(te[D]);return}case"Tab":{we.preventDefault(),te[D]&&le(te[D]);return}case"Escape":{we.preventDefault(),O("none");return}}if(oe&&T.length>0)switch(we.key){case"ArrowDown":{we.preventDefault(),A(De=>Math.min(De+1,T.length-1));return}case"ArrowUp":{we.preventDefault(),A(F7);return}case"Enter":{we.preventDefault(),T[D]&&Ae(T[D]);return}case"Escape":{we.preventDefault(),z(!1),O("none");return}case"Tab":{we.preventDefault(),T[D]&&Ae(T[D]);return}}we.key==="Enter"&&!we.shiftKey&&(we.preventDefault(),ge())}},r[37]=T,r[38]=te,r[39]=Ae,r[40]=le,r[41]=ge,r[42]=D,r[43]=z,r[44]=oe,r[45]=re,r[46]=Oe):Oe=r[46];const He=Oe;let rt;r[47]===Symbol.for("react.memo_cache_sentinel")?(rt=we=>{R(we)},r[47]=rt):rt=r[47];const Qe=rt;if(c&&l){let we;r[48]===Symbol.for("react.memo_cache_sentinel")?(we=m.jsxs("div",{className:"animate-pulse flex items-center gap-2 text-muted-foreground",children:[m.jsx("div",{className:"size-2 rounded-full bg-primary animate-bounce"}),m.jsx("div",{className:"size-2 rounded-full bg-primary animate-bounce [animation-delay:0.1s]"}),m.jsx("div",{className:"size-2 rounded-full bg-primary animate-bounce [animation-delay:0.2s]"}),m.jsx("span",{className:"text-sm ml-2",children:"Generating..."})]}),r[48]=we):we=r[48];let De;r[49]===Symbol.for("react.memo_cache_sentinel")?(De=m.jsx(cS,{className:"size-4","data-icon":"inline-start"}),r[49]=De):De=r[49];let $e;return r[50]!==l?($e=m.jsx("div",{className:"p-4 border-t border-border bg-card",children:m.jsxs("div",{className:"flex items-center justify-center gap-3",children:[we,m.jsxs(Fe,{variant:"outline",size:"sm",onClick:l,children:[De,"Stop"]})]})}),r[50]=l,r[51]=$e):$e=r[51],$e}const Ne=re||oe;let Ge;r[52]!==z?(Ge=we=>{we||(O("none"),z(!1))},r[52]=z,r[53]=Ge):Ge=r[53];let ce;r[54]===Symbol.for("react.memo_cache_sentinel")?(ce=ke("min-h-[44px] max-h-[150px] resize-none pr-12 chat-input-scrollbar","focus-visible:ring-1"),r[54]=ce):ce=r[54];let ve;r[55]!==a||r[56]!==ye||r[57]!==He||r[58]!==v||r[59]!==x?(ve=m.jsx(UO,{asChild:!0,children:m.jsx(PO,{ref:U,value:v,onChange:ye,onKeyDown:He,placeholder:x,disabled:a,className:ce,rows:1,"data-chat-input":"true"})}),r[55]=a,r[56]=ye,r[57]=He,r[58]=v,r[59]=x,r[60]=ve):ve=r[60];let Te;r[61]!==h||r[62]!==Ae||r[63]!==le||r[64]!==P||r[65]!==w||r[66]!==X||r[67]!==D||r[68]!==p||r[69]!==oe||r[70]!==f?(Te=m.jsx(Tf,{className:"w-72 p-0",align:"start",side:"top",sideOffset:8,onOpenAutoFocus:H7,onCloseAutoFocus:U7,children:oe?m.jsx(n7,{workspaceId:f||"",searchQuery:X,selectedIndex:D,onSelect:Ae,onFilesChange:Qe,serverUrl:p,apiToken:h}):m.jsx(j7,{prompts:w,query:P,selectedIndex:D,onSelect:le})}),r[61]=h,r[62]=Ae,r[63]=le,r[64]=P,r[65]=w,r[66]=X,r[67]=D,r[68]=p,r[69]=oe,r[70]=f,r[71]=Te):Te=r[71];let je;r[72]!==Ne||r[73]!==Ge||r[74]!==ve||r[75]!==Te?(je=m.jsx("div",{className:"flex-1 relative",children:m.jsxs(Rf,{open:Ne,onOpenChange:Ge,children:[ve,Te]})}),r[72]=Ne,r[73]=Ge,r[74]=ve,r[75]=Te,r[76]=je):je=r[76];let Le;r[77]!==a||r[78]!==v?(Le=!v.trim()||a,r[77]=a,r[78]=v,r[79]=Le):Le=r[79];let Je;r[80]===Symbol.for("react.memo_cache_sentinel")?(Je=m.jsx(wA,{className:"size-4"}),r[80]=Je):Je=r[80];let Ue;r[81]!==Le?(Ue=m.jsx(Fe,{type:"submit",disabled:Le,size:"default",className:"h-11",children:Je}),r[81]=Le,r[82]=Ue):Ue=r[82];let Pe;r[83]!==je||r[84]!==Ue?(Pe=m.jsxs("div",{className:"flex gap-3 items-end",children:[je,Ue]}),r[83]=je,r[84]=Ue,r[85]=Pe):Pe=r[85];let Re;r[86]===Symbol.for("react.memo_cache_sentinel")?(Re=m.jsxs("div",{className:"mt-2 text-xs text-muted-foreground text-center hidden sm:flex items-center justify-center gap-1",children:[m.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded text-[10px]",children:"/"}),m.jsx("span",{children:"prompts"}),m.jsx("span",{className:"mx-2",children:"•"}),m.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded text-[10px]",children:"@"}),m.jsx("span",{children:"files"}),m.jsx("span",{className:"mx-2",children:"•"}),m.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded text-[10px]",children:"Enter"}),m.jsx("span",{children:"to send"}),m.jsx("span",{className:"mx-2",children:"•"}),m.jsx("kbd",{className:"px-1.5 py-0.5 bg-muted rounded text-[10px]",children:"Shift + Enter"}),m.jsx("span",{children:"for new line"})]}),r[86]=Re):Re=r[86];let Ke;return r[87]!==ge||r[88]!==Pe?(Ke=m.jsxs("form",{onSubmit:ge,className:"p-4 border-t border-border bg-card",children:[Pe,Re]}),r[87]=ge,r[88]=Pe,r[89]=Ke):Ke=r[89],Ke});function B7(t){return Math.max(t-1,0)}function F7(t){return Math.max(t-1,0)}function H7(t){return t.preventDefault()}function U7(t){return t.preventDefault()}function $7(t){const e=he.c(3),n=N.useRef(t);let r;e[0]!==t?(r=()=>{n.current=t},e[0]=t,e[1]=r):r=e[1],N.useLayoutEffect(r);let o;return e[2]===Symbol.for("react.memo_cache_sentinel")?(o=(...c)=>{const l=c;return n.current(...l)},e[2]=o):o=e[2],o}function ma(t,e,n){var l;let r=(l=n.initialDeps)!=null?l:[],o,a=!0;function c(){var u,f,p;let h;n.key&&((u=n.debug)!=null&&u.call(n))&&(h=Date.now());const _=t();if(!(_.length!==r.length||_.some((w,v)=>r[v]!==w)))return o;r=_;let C;if(n.key&&((f=n.debug)!=null&&f.call(n))&&(C=Date.now()),o=e(..._),n.key&&((p=n.debug)!=null&&p.call(n))){const w=Math.round((Date.now()-h)*100)/100,v=Math.round((Date.now()-C)*100)/100,b=v/16,y=(S,k)=>{for(S=String(S);S.length<k;)S=" "+S;return S};console.info(`%c⏱ ${y(v,5)} /${y(w,5)} ms`,`
533
+ font-size: .6rem;
534
+ font-weight: bold;
535
+ color: hsl(${Math.max(0,Math.min(120-120*b,120))}deg 100% 31%);`,n==null?void 0:n.key)}return n!=null&&n.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(o),a=!1,o}return c.updateDeps=u=>{r=u},c}function zb(t,e){if(t===void 0)throw new Error("Unexpected undefined");return t}const q7=(t,e)=>Math.abs(t-e)<1.01,V7=(t,e,n)=>{let r;return function(...o){t.clearTimeout(r),r=t.setTimeout(()=>e.apply(this,o),n)}},Bb=t=>{const{offsetWidth:e,offsetHeight:n}=t;return{width:e,height:n}},W7=t=>t,G7=t=>{const e=Math.max(t.startIndex-t.overscan,0),n=Math.min(t.endIndex+t.overscan,t.count-1),r=[];for(let o=e;o<=n;o++)r.push(o);return r},K7=(t,e)=>{const n=t.scrollElement;if(!n)return;const r=t.targetWindow;if(!r)return;const o=c=>{const{width:l,height:u}=c;e({width:Math.round(l),height:Math.round(u)})};if(o(Bb(n)),!r.ResizeObserver)return()=>{};const a=new r.ResizeObserver(c=>{const l=()=>{const u=c[0];if(u!=null&&u.borderBoxSize){const f=u.borderBoxSize[0];if(f){o({width:f.inlineSize,height:f.blockSize});return}}o(Bb(n))};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()});return a.observe(n,{box:"border-box"}),()=>{a.unobserve(n)}},Fb={passive:!0},Hb=typeof window>"u"?!0:"onscrollend"in window,Y7=(t,e)=>{const n=t.scrollElement;if(!n)return;const r=t.targetWindow;if(!r)return;let o=0;const a=t.options.useScrollendEvent&&Hb?()=>{}:V7(r,()=>{e(o,!1)},t.options.isScrollingResetDelay),c=p=>()=>{const{horizontal:h,isRtl:_}=t.options;o=h?n.scrollLeft*(_&&-1||1):n.scrollTop,a(),e(o,p)},l=c(!0),u=c(!1);n.addEventListener("scroll",l,Fb);const f=t.options.useScrollendEvent&&Hb;return f&&n.addEventListener("scrollend",u,Fb),()=>{n.removeEventListener("scroll",l),f&&n.removeEventListener("scrollend",u)}},X7=(t,e,n)=>{if(e!=null&&e.borderBoxSize){const r=e.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return t[n.options.horizontal?"offsetWidth":"offsetHeight"]},Q7=(t,{adjustments:e=0,behavior:n},r)=>{var o,a;const c=t+e;(a=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||a.call(o,{[r.options.horizontal?"left":"top"]:c,behavior:n})};class Z7{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var a;var n,r,o;return(a=(o=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:o.call(r))!=null?a:Date.now()},this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(o=>{o.forEach(a=>{const c=()=>{const l=a.target,u=this.indexFromElement(l);if(!l.isConnected){this.observer.unobserve(l);return}this.shouldMeasureDuringScroll(u)&&this.resizeItem(u,this.options.measureElement(l,a,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()})}));return{disconnect:()=>{var o;(o=r())==null||o.disconnect(),n=null},observe:o=>{var a;return(a=r())==null?void 0:a.observe(o,{box:"border-box"})},unobserve:o=>{var a;return(a=r())==null?void 0:a.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,o])=>{typeof o>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:W7,rangeExtractor:G7,onChange:()=>{},measureElement:X7,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,o;(o=(r=this.options).onChange)==null||o.call(r,this,n)},this.maybeNotify=ma(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var o;var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(o=(n=this.scrollElement)==null?void 0:n.window)!=null?o:null,this.elementsCache.forEach(a=>{this.observer.observe(a)}),this.unsubs.push(this.options.observeElementRect(this,a=>{this.scrollRect=a,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(a,c)=>{this.scrollAdjustments=0,this.scrollDirection=c?this.getScrollOffset()<a?"forward":"backward":null,this.scrollOffset=a,this.isScrolling=c,this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.rafId=null,this.getSize=()=>{var n;return this.options.enabled?(this.scrollRect=(n=this.scrollRect)!=null?n:this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0)},this.getScrollOffset=()=>{var n;return this.options.enabled?(this.scrollOffset=(n=this.scrollOffset)!=null?n:typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset,this.scrollOffset):(this.scrollOffset=null,0)},this.getFurthestMeasurement=(n,r)=>{const o=new Map,a=new Map;for(let c=r-1;c>=0;c--){const l=n[c];if(o.has(l.lane))continue;const u=a.get(l.lane);if(u==null||l.end>u.end?a.set(l.lane,l):l.end<u.end&&o.set(l.lane,!0),o.size===this.options.lanes)break}return a.size===this.options.lanes?Array.from(a.values()).sort((c,l)=>c.end===l.end?c.index-l.index:c.end-l.end)[0]:void 0},this.getMeasurementOptions=ma(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(n,r,o,a,c,l)=>(this.prevLanes!==void 0&&this.prevLanes!==l&&(this.lanesChangedFlag=!0),this.prevLanes=l,this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:o,getItemKey:a,enabled:c,lanes:l}),{key:!1}),this.getMeasurements=ma(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:o,getItemKey:a,enabled:c,lanes:l},u)=>{if(!c)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const _ of this.laneAssignments.keys())_>=n&&this.laneAssignments.delete(_);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(_=>{this.itemSizeCache.set(_.key,_.size)}));const f=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1);const p=this.measurementsCache.slice(0,f),h=new Array(l).fill(void 0);for(let _=0;_<f;_++){const x=p[_];x&&(h[x.lane]=_)}for(let _=f;_<n;_++){const x=a(_),C=this.laneAssignments.get(_);let w,v;if(C!==void 0&&this.options.lanes>1){w=C;const k=h[w],T=k!==void 0?p[k]:void 0;v=T?T.end+this.options.gap:r+o}else{const k=this.options.lanes===1?p[_-1]:this.getFurthestMeasurement(p,_);v=k?k.end+this.options.gap:r+o,w=k?k.lane:_%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(_,w)}const b=u.get(x),y=typeof b=="number"?b:this.options.estimateSize(_),S=v+y;p[_]={index:_,start:v,size:y,end:S,key:x,lane:w},h[w]=_}return this.measurementsCache=p,p},{key:!1,debug:()=>this.options.debug}),this.calculateRange=ma(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,o,a)=>this.range=n.length>0&&r>0?J7({measurements:n,outerSize:r,scrollOffset:o,lanes:a}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=ma(()=>{let n=null,r=null;const o=this.calculateRange();return o&&(n=o.startIndex,r=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,o,a,c)=>a===null||c===null?[]:n({startIndex:a,endIndex:c,overscan:r,count:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,o=n.getAttribute(r);return o?parseInt(o,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var a;var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const o=(a=this.scrollState.index)!=null?a:(r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index;if(o!==void 0&&this.range){const c=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),l=Math.max(0,o-c),u=Math.min(this.options.count-1,o+c);return n>=l&&n<=u}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((c,l)=>{c.isConnected||(this.observer.unobserve(c),this.elementsCache.delete(l))});return}const r=this.indexFromElement(n),o=this.options.getItemKey(r),a=this.elementsCache.get(o);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(o,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,r)=>{var u;var o;const a=this.measurementsCache[n];if(!a)return;const c=(u=this.itemSizeCache.get(a.key))!=null?u:a.size,l=r-c;l!==0&&(((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(a,l,this):a.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=l,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(a.index),this.itemSizeCache=new Map(this.itemSizeCache.set(a.key,r)),this.notify(!1))},this.getVirtualItems=ma(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const o=[];for(let a=0,c=n.length;a<c;a++){const l=n[a],u=r[l];o.push(u)}return o},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return zb(r[ik(0,r.length-1,o=>zb(r[o]).start,n)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(n,r,o=0)=>{if(!this.scrollElement)return 0;const a=this.getSize(),c=this.getScrollOffset();r==="auto"&&(r=n>=c+a?"end":"start"),r==="center"?n+=(o-a)/2:r==="end"&&(n-=a);const l=this.getMaxScrollOffset();return Math.max(Math.min(l,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.getSize(),a=this.getScrollOffset(),c=this.measurementsCache[n];if(!c)return;if(r==="auto")if(c.end>=a+o-this.options.scrollPaddingEnd)r="end";else if(c.start<=a+this.options.scrollPaddingStart)r="start";else return[a,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const l=r==="end"?c.end+this.options.scrollPaddingEnd:c.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(l,r,c.size),r]},this.scrollToOffset=(n,{align:r="start",behavior:o="auto"}={})=>{const a=this.getOffsetForAlignment(n,r),c=this.now();this.scrollState={index:null,align:r,behavior:o,startedAt:c,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:r="auto",behavior:o="auto"}={})=>{n=Math.max(0,Math.min(n,this.options.count-1));const a=this.getOffsetForIndex(n,r);if(!a)return;const[c,l]=a,u=this.now();this.scrollState={index:n,align:l,behavior:o,startedAt:u,lastTargetOffset:c,stableFrames:0},this._scrollToOffset(c,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:r="auto"}={})=>{const o=this.getScrollOffset()+n,a=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:a,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{var a;var n;const r=this.getMeasurements();let o;if(r.length===0)o=this.options.paddingStart;else if(this.options.lanes===1)o=(a=(n=r[r.length-1])==null?void 0:n.end)!=null?a:0;else{const c=Array(this.options.lanes).fill(null);let l=r.length-1;for(;l>=0&&c.some(u=>u===null);){const u=r[l];c[u.lane]===null&&(c[u.lane]=u.end),l--}o=Math.max(...c.filter(u=>u!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:o})=>{this.options.scrollToFn(n,{behavior:o,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,o=r?r[0]:this.scrollState.lastTargetOffset,a=1,c=o!==this.scrollState.lastTargetOffset;if(!c&&q7(o,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=a){this.scrollState=null;return}}else this.scrollState.stableFrames=0,c&&(this.scrollState.lastTargetOffset=o,this.scrollState.behavior="auto",this._scrollToOffset(o,{adjustments:void 0,behavior:"auto"}));this.scheduleScrollReconcile()}}const ik=(t,e,n,r)=>{for(;t<=e;){const o=(t+e)/2|0,a=n(o);if(a<r)t=o+1;else if(a>r)e=o-1;else return o}return t>0?t-1:0};function J7({measurements:t,outerSize:e,scrollOffset:n,lanes:r}){const o=t.length-1,a=u=>t[u].start;if(t.length<=r)return{startIndex:0,endIndex:o};let c=ik(0,o,a,n),l=c;if(r===1)for(;l<o&&t[l].end<n+e;)l++;else if(r>1){const u=Array(r).fill(0);for(;l<o&&u.some(p=>p<n+e);){const p=t[l];u[p.lane]=p.end,l++}const f=Array(r).fill(n+e);for(;c>=0&&f.some(p=>p>=n);){const p=t[c];f[p.lane]=p.start,c--}c=Math.max(0,c-c%r),l=Math.min(o,l+(r-1-l%r))}return{startIndex:c,endIndex:l}}const Ub=typeof document<"u"?N.useLayoutEffect:N.useEffect;function eI({useFlushSync:t=!0,...e}){const n=N.useReducer(()=>({}),{})[1],r={...e,onChange:(a,c)=>{var l;t&&c?za.flushSync(n):n(),(l=e.onChange)==null||l.call(e,a,c)}},[o]=N.useState(()=>new Z7(r));return o.setOptions(r),Ub(()=>o._didMount(),[]),Ub(()=>o._willUpdate()),o}function tI(t){return eI({observeElementRect:K7,observeElementOffset:Y7,scrollToFn:Q7,...t})}function nI(t){const e=he.c(47),{message:n,textContent:r,children:o,isQueued:a,onRemove:c,onRevert:l,canRevert:u,onFork:f,canFork:p}=t,h=a===void 0?!1:a,_=u===void 0?!1:u,x=p===void 0?!1:p,[C,w]=N.useState(!1),[v,b]=N.useState(!1),[y,S]=N.useState(!1),k=n.role==="user";let T;e[0]!==r?(T=async()=>{const Y=r||"";await navigator.clipboard.writeText(Y),w(!0),setTimeout(()=>w(!1),2e3)},e[0]=r,e[1]=T):T=e[1];const R=T,D=k?"items-end":"items-start";let A;e[2]!==D?(A=ke("flex flex-col gap-1 animate-slide-up min-w-0",D),e[2]=D,e[3]=A):A=e[3];const j=k?"mr-3":"ml-3";let O;e[4]!==j?(O=ke("flex items-center gap-1.5 text-xs uppercase tracking-wide text-muted-foreground",j),e[4]=j,e[5]=O):O=e[5];let P;e[6]!==x||e[7]!==_||e[8]!==C||e[9]!==R||e[10]!==h||e[11]!==k||e[12]!==n.role||e[13]!==f||e[14]!==l?(P=k?m.jsxs(m.Fragment,{children:[!h&&m.jsxs(m.Fragment,{children:[_&&l&&m.jsx(Fe,{variant:"ghost",size:"icon",onClick:()=>b(!0),className:"size-5 text-muted-foreground hover:text-foreground",title:"Revert to this point",children:m.jsx(IA,{className:"size-3"})}),x&&f&&m.jsx(Fe,{variant:"ghost",size:"icon",onClick:()=>S(!0),className:"size-5 text-muted-foreground hover:text-foreground",title:"Fork from this point",children:m.jsx(z5,{className:"size-3"})}),m.jsx(Fe,{variant:"ghost",size:"icon",onClick:R,className:"size-5 text-muted-foreground hover:text-foreground",children:C?m.jsx(Ls,{className:"size-3"}):m.jsx(ac,{className:"size-3"})})]}),m.jsx(uS,{className:"size-3"}),n.role]}):m.jsxs(m.Fragment,{children:[m.jsx(r5,{className:"size-3"}),n.role,m.jsx(Fe,{variant:"ghost",size:"icon",onClick:R,className:"size-5 text-muted-foreground hover:text-foreground",children:C?m.jsx(Ls,{className:"size-3"}):m.jsx(ac,{className:"size-3"})})]}),e[6]=x,e[7]=_,e[8]=C,e[9]=R,e[10]=h,e[11]=k,e[12]=n.role,e[13]=f,e[14]=l,e[15]=P):P=e[15];let $;e[16]!==O||e[17]!==P?($=m.jsx("div",{className:O,children:P}),e[16]=O,e[17]=P,e[18]=$):$=e[18];const U=k?"max-w-[90%]":"max-w-full",W=h?"bg-muted border-2 border-dashed border-muted-foreground/30 opacity-80":k?"bg-primary text-primary-foreground rounded-br-md":"bg-card text-card-foreground border border-border rounded-bl-md";let K;e[19]!==U||e[20]!==W?(K=ke("rounded-2xl px-4 py-3 relative group min-w-0 overflow-hidden",U,W),e[19]=U,e[20]=W,e[21]=K):K=e[21];let V;e[22]!==h||e[23]!==c?(V=h&&m.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2 pb-2 border-b border-muted-foreground/20",children:[m.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[m.jsx(tS,{className:"size-3 animate-pulse"}),m.jsx("span",{children:"Pending"})]}),c&&m.jsx(Fe,{variant:"ghost",size:"icon",onClick:c,className:"size-6 text-muted-foreground hover:text-destructive hover:bg-destructive/10",title:"Remove from queue",children:m.jsx(Os,{className:"size-3"})})]}),e[22]=h,e[23]=c,e[24]=V):V=e[24];let Q;e[25]!==o?(Q=m.jsx("div",{className:"min-w-0",children:o}),e[25]=o,e[26]=Q):Q=e[26];let X;e[27]!==K||e[28]!==V||e[29]!==Q?(X=m.jsxs("div",{className:K,children:[V,Q]}),e[27]=K,e[28]=V,e[29]=Q,e[30]=X):X=e[30];let I;e[31]!==l?(I=()=>{l==null||l()},e[31]=l,e[32]=I):I=e[32];let L;e[33]!==v||e[34]!==I?(L=m.jsx(ng,{open:v,onOpenChange:b,title:"Revert Conversation",description:"This will delete this message and all messages after it. Are you sure you want to continue?",confirmLabel:"Revert",cancelLabel:"Cancel",onConfirm:I,variant:"destructive"}),e[33]=v,e[34]=I,e[35]=L):L=e[35];let z;e[36]!==f?(z=()=>{f==null||f()},e[36]=f,e[37]=z):z=e[37];let F;e[38]!==y||e[39]!==z?(F=m.jsx(ng,{open:y,onOpenChange:S,title:"Fork Conversation",description:"This will create a new session with messages up to and including this point. The original session will be unchanged.",confirmLabel:"Fork",cancelLabel:"Cancel",onConfirm:z}),e[38]=y,e[39]=z,e[40]=F):F=e[40];let B;return e[41]!==$||e[42]!==X||e[43]!==L||e[44]!==F||e[45]!==A?(B=m.jsxs("div",{className:A,children:[$,X,L,F]}),e[41]=$,e[42]=X,e[43]=L,e[44]=F,e[45]=A,e[46]=B):B=e[46],B}var rI=Object.create,If=Object.defineProperty,sI=Object.defineProperties,iI=Object.getOwnPropertyDescriptor,oI=Object.getOwnPropertyDescriptors,ok=Object.getOwnPropertyNames,Ud=Object.getOwnPropertySymbols,aI=Object.getPrototypeOf,pv=Object.prototype.hasOwnProperty,ak=Object.prototype.propertyIsEnumerable,$b=(t,e,n)=>e in t?If(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,us=(t,e)=>{for(var n in e||(e={}))pv.call(e,n)&&$b(t,n,e[n]);if(Ud)for(var n of Ud(e))ak.call(e,n)&&$b(t,n,e[n]);return t},Pf=(t,e)=>sI(t,oI(e)),lk=(t,e)=>{var n={};for(var r in t)pv.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&Ud)for(var r of Ud(t))e.indexOf(r)<0&&ak.call(t,r)&&(n[r]=t[r]);return n},lI=(t,e)=>function(){return e||(0,t[ok(t)[0]])((e={exports:{}}).exports,e),e.exports},cI=(t,e)=>{for(var n in e)If(t,n,{get:e[n],enumerable:!0})},uI=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of ok(e))!pv.call(t,o)&&o!==n&&If(t,o,{get:()=>e[o],enumerable:!(r=iI(e,o))||r.enumerable});return t},dI=(t,e,n)=>(n=t!=null?rI(aI(t)):{},uI(!t||!t.__esModule?If(n,"default",{value:t,enumerable:!0}):n,t)),fI=lI({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(t,e){var n=(function(){var r=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,o=0,a={},c={util:{encode:function C(w){return w instanceof l?new l(w.type,C(w.content),w.alias):Array.isArray(w)?w.map(C):w.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(C){return Object.prototype.toString.call(C).slice(8,-1)},objId:function(C){return C.__id||Object.defineProperty(C,"__id",{value:++o}),C.__id},clone:function C(w,v){v=v||{};var b,y;switch(c.util.type(w)){case"Object":if(y=c.util.objId(w),v[y])return v[y];b={},v[y]=b;for(var S in w)w.hasOwnProperty(S)&&(b[S]=C(w[S],v));return b;case"Array":return y=c.util.objId(w),v[y]?v[y]:(b=[],v[y]=b,w.forEach(function(k,T){b[T]=C(k,v)}),b);default:return w}},getLanguage:function(C){for(;C;){var w=r.exec(C.className);if(w)return w[1].toLowerCase();C=C.parentElement}return"none"},setLanguage:function(C,w){C.className=C.className.replace(RegExp(r,"gi"),""),C.classList.add("language-"+w)},isActive:function(C,w,v){for(var b="no-"+w;C;){var y=C.classList;if(y.contains(w))return!0;if(y.contains(b))return!1;C=C.parentElement}return!!v}},languages:{plain:a,plaintext:a,text:a,txt:a,extend:function(C,w){var v=c.util.clone(c.languages[C]);for(var b in w)v[b]=w[b];return v},insertBefore:function(C,w,v,b){b=b||c.languages;var y=b[C],S={};for(var k in y)if(y.hasOwnProperty(k)){if(k==w)for(var T in v)v.hasOwnProperty(T)&&(S[T]=v[T]);v.hasOwnProperty(k)||(S[k]=y[k])}var R=b[C];return b[C]=S,c.languages.DFS(c.languages,function(D,A){A===R&&D!=C&&(this[D]=S)}),S},DFS:function C(w,v,b,y){y=y||{};var S=c.util.objId;for(var k in w)if(w.hasOwnProperty(k)){v.call(w,k,w[k],b||k);var T=w[k],R=c.util.type(T);R==="Object"&&!y[S(T)]?(y[S(T)]=!0,C(T,v,null,y)):R==="Array"&&!y[S(T)]&&(y[S(T)]=!0,C(T,v,k,y))}}},plugins:{},highlight:function(C,w,v){var b={code:C,grammar:w,language:v};if(c.hooks.run("before-tokenize",b),!b.grammar)throw new Error('The language "'+b.language+'" has no grammar.');return b.tokens=c.tokenize(b.code,b.grammar),c.hooks.run("after-tokenize",b),l.stringify(c.util.encode(b.tokens),b.language)},tokenize:function(C,w){var v=w.rest;if(v){for(var b in v)w[b]=v[b];delete w.rest}var y=new p;return h(y,y.head,C),f(C,y,w,y.head,0),x(y)},hooks:{all:{},add:function(C,w){var v=c.hooks.all;v[C]=v[C]||[],v[C].push(w)},run:function(C,w){var v=c.hooks.all[C];if(!(!v||!v.length))for(var b=0,y;y=v[b++];)y(w)}},Token:l};function l(C,w,v,b){this.type=C,this.content=w,this.alias=v,this.length=(b||"").length|0}l.stringify=function C(w,v){if(typeof w=="string")return w;if(Array.isArray(w)){var b="";return w.forEach(function(R){b+=C(R,v)}),b}var y={type:w.type,content:C(w.content,v),tag:"span",classes:["token",w.type],attributes:{},language:v},S=w.alias;S&&(Array.isArray(S)?Array.prototype.push.apply(y.classes,S):y.classes.push(S)),c.hooks.run("wrap",y);var k="";for(var T in y.attributes)k+=" "+T+'="'+(y.attributes[T]||"").replace(/"/g,"&quot;")+'"';return"<"+y.tag+' class="'+y.classes.join(" ")+'"'+k+">"+y.content+"</"+y.tag+">"};function u(C,w,v,b){C.lastIndex=w;var y=C.exec(v);if(y&&b&&y[1]){var S=y[1].length;y.index+=S,y[0]=y[0].slice(S)}return y}function f(C,w,v,b,y,S){for(var k in v)if(!(!v.hasOwnProperty(k)||!v[k])){var T=v[k];T=Array.isArray(T)?T:[T];for(var R=0;R<T.length;++R){if(S&&S.cause==k+","+R)return;var D=T[R],A=D.inside,j=!!D.lookbehind,O=!!D.greedy,P=D.alias;if(O&&!D.pattern.global){var $=D.pattern.toString().match(/[imsuy]*$/)[0];D.pattern=RegExp(D.pattern.source,$+"g")}for(var U=D.pattern||D,W=b.next,K=y;W!==w.tail&&!(S&&K>=S.reach);K+=W.value.length,W=W.next){var V=W.value;if(w.length>C.length)return;if(!(V instanceof l)){var Q=1,X;if(O){if(X=u(U,K,C,j),!X||X.index>=C.length)break;var F=X.index,I=X.index+X[0].length,L=K;for(L+=W.value.length;F>=L;)W=W.next,L+=W.value.length;if(L-=W.value.length,K=L,W.value instanceof l)continue;for(var z=W;z!==w.tail&&(L<I||typeof z.value=="string");z=z.next)Q++,L+=z.value.length;Q--,V=C.slice(K,L),X.index-=K}else if(X=u(U,0,V,j),!X)continue;var F=X.index,B=X[0],Y=V.slice(0,F),ee=V.slice(F+B.length),J=K+V.length;S&&J>S.reach&&(S.reach=J);var G=W.prev;Y&&(G=h(w,G,Y),K+=Y.length),_(w,G,Q);var q=new l(k,A?c.tokenize(B,A):B,P,B);if(W=h(w,G,q),ee&&h(w,W,ee),Q>1){var te={cause:k+","+R,reach:J};f(C,w,v,W.prev,K,te),S&&te.reach>S.reach&&(S.reach=te.reach)}}}}}}function p(){var C={value:null,prev:null,next:null},w={value:null,prev:C,next:null};C.next=w,this.head=C,this.tail=w,this.length=0}function h(C,w,v){var b=w.next,y={value:v,prev:w,next:b};return w.next=y,b.prev=y,C.length++,y}function _(C,w,v){for(var b=w.next,y=0;y<v&&b!==C.tail;y++)b=b.next;w.next=b,b.prev=w,C.length-=y}function x(C){for(var w=[],v=C.head.next;v!==C.tail;)w.push(v.value),v=v.next;return w}return c})();e.exports=n,n.default=n}}),Se=dI(fI());Se.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Se.languages.markup.tag.inside["attr-value"].inside.entity=Se.languages.markup.entity,Se.languages.markup.doctype.inside["internal-subset"].inside=Se.languages.markup,Se.hooks.add("wrap",function(t){t.type==="entity"&&(t.attributes.title=t.content.replace(/&amp;/,"&"))}),Object.defineProperty(Se.languages.markup.tag,"addInlined",{value:function(t,r){var n={},n=(n["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Se.languages[r]},n.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}}),r=(n["language-"+r]={pattern:/[\s\S]+/,inside:Se.languages[r]},{});r[t]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:n},Se.languages.insertBefore("markup","cdata",r)}}),Object.defineProperty(Se.languages.markup.tag,"addAttribute",{value:function(t,e){Se.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:Se.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Se.languages.html=Se.languages.markup,Se.languages.mathml=Se.languages.markup,Se.languages.svg=Se.languages.markup,Se.languages.xml=Se.languages.extend("markup",{}),Se.languages.ssml=Se.languages.xml,Se.languages.atom=Se.languages.xml,Se.languages.rss=Se.languages.xml,(function(t){var e={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},n=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,r="(?:[^\\\\-]|"+n.source+")",r=RegExp(r+"-"+r),o={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};t.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:r,inside:{escape:n,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":e,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:n}},"special-escape":e,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":o}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:n,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":o}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}})(Se),Se.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},Se.languages.javascript=Se.languages.extend("clike",{"class-name":[Se.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Se.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Se.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Se.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Se.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Se.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Se.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Se.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Se.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Se.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Se.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Se.languages.markup&&(Se.languages.markup.tag.addInlined("script","javascript"),Se.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Se.languages.js=Se.languages.javascript,Se.languages.actionscript=Se.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),Se.languages.actionscript["class-name"].alias="function",delete Se.languages.actionscript.parameter,delete Se.languages.actionscript["literal-property"],Se.languages.markup&&Se.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:Se.languages.markup}}),(function(t){var e=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};t.languages.coffeescript=t.languages.extend("javascript",{comment:e,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),t.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:e,interpolation:n}}}),t.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:t.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),t.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete t.languages.coffeescript["template-string"],t.languages.coffee=t.languages.coffeescript})(Se),(function(t){var e=t.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(e,"addSupport",{value:function(n,r){(n=typeof n=="string"?[n]:n).forEach(function(o){var a=function(h){h.inside||(h.inside={}),h.inside.rest=r},c="doc-comment";if(l=t.languages[o]){var l,u=l[c];if((u=u||(l=t.languages.insertBefore(o,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[c])instanceof RegExp&&(u=l[c]={pattern:u}),Array.isArray(u))for(var f=0,p=u.length;f<p;f++)u[f]instanceof RegExp&&(u[f]={pattern:u[f]}),a(u[f]);else a(u)}})}}),e.addSupport(["java","javascript","php"],e)})(Se),(function(t){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,e=(t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+e.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css,t.languages.markup);e&&(e.tag.addInlined("style","css"),e.tag.addAttribute("style","css"))})(Se),(function(t){var e=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,e=(t.languages.css.selector={pattern:t.languages.css.selector.pattern,lookbehind:!0,inside:e={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp(`\\[(?:[^[\\]"']|`+e.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[e,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},t.languages.css.atrule.inside["selector-function-argument"].inside=e,t.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};t.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:e,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:e,number:n})})(Se),(function(t){var e=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ ]+"+e.source+")?|"+e.source+"(?:[ ]+"+n.source+")?)",o=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),a=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function c(l,u){u=(u||"").replace(/m/g,"")+"m";var f=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return l});return RegExp(f,u)}t.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return"(?:"+o+"|"+a+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:c(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:c(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:c(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:c(a),lookbehind:!0,greedy:!0},number:{pattern:c(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:e,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},t.languages.yml=t.languages.yaml})(Se),(function(t){var e=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(f){return f=f.replace(/<inner>/g,function(){return e}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+f+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,o=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),a=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source,c=(t.languages.markdown=t.languages.extend("markup",{}),t.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:t.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+o+a+"(?:"+o+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+o+a+")(?:"+o+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:t.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+o+")"+a+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+o+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:t.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(f){["url","bold","italic","strike","code-snippet"].forEach(function(p){f!==p&&(t.languages.markdown[f].inside.content.inside[p]=t.languages.markdown[p])})}),t.hooks.add("after-tokenize",function(f){f.language!=="markdown"&&f.language!=="md"||(function p(h){if(h&&typeof h!="string")for(var _=0,x=h.length;_<x;_++){var C,w=h[_];w.type!=="code"?p(w.content):(C=w.content[1],w=w.content[3],C&&w&&C.type==="code-language"&&w.type==="code-block"&&typeof C.content=="string"&&(C=C.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),C="language-"+(C=(/[a-z][\w-]*/i.exec(C)||[""])[0].toLowerCase()),w.alias?typeof w.alias=="string"?w.alias=[w.alias,C]:w.alias.push(C):w.alias=[C]))}})(f.tokens)}),t.hooks.add("wrap",function(f){if(f.type==="code-block"){for(var p="",h=0,_=f.classes.length;h<_;h++){var x=f.classes[h],x=/language-(.+)/.exec(x);if(x){p=x[1];break}}var C,w=t.languages[p];w?f.content=t.highlight((function(v){return v=v.replace(c,""),v=v.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(b,y){var S;return(y=y.toLowerCase())[0]==="#"?(S=y[1]==="x"?parseInt(y.slice(2),16):Number(y.slice(1)),u(S)):l[y]||b})})(f.content),w,p):p&&p!=="none"&&t.plugins.autoloader&&(C="md-"+new Date().valueOf()+"-"+Math.floor(1e16*Math.random()),f.attributes.id=C,t.plugins.autoloader.loadLanguages(p,function(){var v=document.getElementById(C);v&&(v.innerHTML=t.highlight(v.textContent,t.languages[p],p))}))}}),RegExp(t.languages.markup.tag.pattern.source,"gi")),l={amp:"&",lt:"<",gt:">",quot:'"'},u=String.fromCodePoint||String.fromCharCode;t.languages.md=t.languages.markdown})(Se),Se.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:Se.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},Se.hooks.add("after-tokenize",function(t){if(t.language==="graphql")for(var e=t.tokens.filter(function(C){return typeof C!="string"&&C.type!=="comment"&&C.type!=="scalar"}),n=0;n<e.length;){var r=e[n++];if(r.type==="keyword"&&r.content==="mutation"){var o=[];if(h(["definition-mutation","punctuation"])&&p(1).content==="("){n+=2;var a=_(/^\($/,/^\)$/);if(a===-1)continue;for(;n<a;n++){var c=p(0);c.type==="variable"&&(x(c,"variable-input"),o.push(c.content))}n=a+1}if(h(["punctuation","property-query"])&&p(0).content==="{"&&(n++,x(p(0),"property-mutation"),0<o.length)){var l=_(/^\{$/,/^\}$/);if(l!==-1)for(var u=n;u<l;u++){var f=e[u];f.type==="variable"&&0<=o.indexOf(f.content)&&x(f,"variable-input")}}}}function p(C){return e[n+C]}function h(C,w){w=w||0;for(var v=0;v<C.length;v++){var b=p(v+w);if(!b||b.type!==C[v])return}return 1}function _(C,w){for(var v=1,b=n;b<e.length;b++){var y=e[b],S=y.content;if(y.type==="punctuation"&&typeof S=="string"){if(C.test(S))v++;else if(w.test(S)&&--v===0)return b}}return-1}function x(C,w){var v=C.alias;v?Array.isArray(v)||(C.alias=v=[v]):C.alias=v=[],v.push(w)}}),Se.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},(function(t){var e=t.languages.javascript["template-string"],n=e.pattern.source,r=e.inside.interpolation,o=r.inside["interpolation-punctuation"],a=r.pattern.source;function c(h,_){if(t.languages[h])return{pattern:RegExp("((?:"+_+")\\s*)"+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:h}}}}function l(h,_,x){return h={code:h,grammar:_,language:x},t.hooks.run("before-tokenize",h),h.tokens=t.tokenize(h.code,h.grammar),t.hooks.run("after-tokenize",h),h.tokens}function u(h,_,x){var v=t.tokenize(h,{interpolation:{pattern:RegExp(a),lookbehind:!0}}),C=0,w={},v=l(v.map(function(y){if(typeof y=="string")return y;for(var S,k,y=y.content;h.indexOf((k=C++,S="___"+x.toUpperCase()+"_"+k+"___"))!==-1;);return w[S]=y,S}).join(""),_,x),b=Object.keys(w);return C=0,(function y(S){for(var k=0;k<S.length;k++){if(C>=b.length)return;var T,R,D,A,j,O,P,$=S[k];typeof $=="string"||typeof $.content=="string"?(T=b[C],(P=(O=typeof $=="string"?$:$.content).indexOf(T))!==-1&&(++C,R=O.substring(0,P),j=w[T],D=void 0,(A={})["interpolation-punctuation"]=o,(A=t.tokenize(j,A)).length===3&&((D=[1,1]).push.apply(D,l(A[1],t.languages.javascript,"javascript")),A.splice.apply(A,D)),D=new t.Token("interpolation",A,r.alias,j),A=O.substring(P+T.length),j=[],R&&j.push(R),j.push(D),A&&(y(O=[A]),j.push.apply(j,O)),typeof $=="string"?(S.splice.apply(S,[k,1].concat(j)),k+=j.length-1):$.content=j)):(P=$.content,Array.isArray(P)?y(P):y([P]))}})(v),new t.Token(x,v,"language-"+x,h)}t.languages.javascript["template-string"]=[c("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),c("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),c("svg",/\bsvg/.source),c("markdown",/\b(?:markdown|md)/.source),c("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),c("sql",/\bsql/.source),e].filter(Boolean);var f={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function p(h){return typeof h=="string"?h:Array.isArray(h)?h.map(p).join(""):p(h.content)}t.hooks.add("after-tokenize",function(h){h.language in f&&(function _(x){for(var C=0,w=x.length;C<w;C++){var v,b,y,S=x[C];typeof S!="string"&&(v=S.content,Array.isArray(v)?S.type==="template-string"?(S=v[1],v.length===3&&typeof S!="string"&&S.type==="embedded-code"&&(b=p(S),S=S.alias,S=Array.isArray(S)?S[0]:S,y=t.languages[S])&&(v[1]=u(b,y,S))):_(v):typeof v!="string"&&_([v]))}})(h.tokens)})})(Se),(function(t){t.languages.typescript=t.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),t.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete t.languages.typescript.parameter,delete t.languages.typescript["literal-property"];var e=t.languages.extend("typescript",{});delete e["class-name"],t.languages.typescript["class-name"].inside=e,t.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e}}}}),t.languages.ts=t.languages.typescript})(Se),(function(t){var e=t.languages.javascript,n=/\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source,r="(@(?:arg|argument|param|property)\\s+(?:"+n+"\\s+)?)";t.languages.jsdoc=t.languages.extend("javadoclike",{parameter:{pattern:RegExp(r+/(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),t.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(r+/\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:e,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:<TYPE>\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(/<TYPE>/g,function(){return n})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+n),lookbehind:!0,inside:{string:e.string,number:e.number,boolean:e.boolean,keyword:t.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:e,alias:"language-javascript"}}}}),t.languages.javadoclike.addSupport("javascript",t.languages.jsdoc)})(Se),(function(t){t.languages.flow=t.languages.extend("javascript",{}),t.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:"class-name"}]}),t.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete t.languages.flow.parameter,t.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(t.languages.flow.keyword)||(t.languages.flow.keyword=[t.languages.flow.keyword]),t.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})})(Se),Se.languages.n4js=Se.languages.extend("javascript",{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),Se.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),Se.languages.n4jsd=Se.languages.n4js,(function(t){function e(c,l){return RegExp(c.replace(/<ID>/g,function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source}),l)}t.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+t.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),t.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+t.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),t.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),t.languages.insertBefore("javascript","keyword",{imports:{pattern:e(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:t.languages.javascript},exports:{pattern:e(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:t.languages.javascript}}),t.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),t.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),t.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:e(/(\.\s*)#?<ID>/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var n=["function","function-variable","method","method-variable","property-access"],r=0;r<n.length;r++){var a=n[r],o=t.languages.javascript[a],a=(o=t.util.type(o)==="RegExp"?t.languages.javascript[a]={pattern:o}:o).inside||{};(o.inside=a)["maybe-class-name"]=/^[A-Z][\s\S]*/}})(Se),(function(t){var e=t.util.clone(t.languages.javascript),n=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,r=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,o=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function a(u,f){return u=u.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return o}),RegExp(u,f)}o=a(o).source,t.languages.jsx=t.languages.extend("markup",e),t.languages.jsx.tag.pattern=a(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),t.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,t.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,t.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,t.languages.jsx.tag.inside.comment=e.comment,t.languages.insertBefore("inside","attr-name",{spread:{pattern:a(/<SPREAD>/.source),inside:t.languages.jsx}},t.languages.jsx.tag),t.languages.insertBefore("inside","special-attr",{script:{pattern:a(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:t.languages.jsx}}},t.languages.jsx.tag);function c(u){for(var f=[],p=0;p<u.length;p++){var h=u[p],_=!1;typeof h!="string"&&(h.type==="tag"&&h.content[0]&&h.content[0].type==="tag"?h.content[0].content[0].content==="</"?0<f.length&&f[f.length-1].tagName===l(h.content[0].content[1])&&f.pop():h.content[h.content.length-1].content!=="/>"&&f.push({tagName:l(h.content[0].content[1]),openedBraces:0}):0<f.length&&h.type==="punctuation"&&h.content==="{"?f[f.length-1].openedBraces++:0<f.length&&0<f[f.length-1].openedBraces&&h.type==="punctuation"&&h.content==="}"?f[f.length-1].openedBraces--:_=!0),(_||typeof h=="string")&&0<f.length&&f[f.length-1].openedBraces===0&&(_=l(h),p<u.length-1&&(typeof u[p+1]=="string"||u[p+1].type==="plain-text")&&(_+=l(u[p+1]),u.splice(p+1,1)),0<p&&(typeof u[p-1]=="string"||u[p-1].type==="plain-text")&&(_=l(u[p-1])+_,u.splice(p-1,1),p--),u[p]=new t.Token("plain-text",_,null,_)),h.content&&typeof h.content!="string"&&c(h.content)}}var l=function(u){return u?typeof u=="string"?u:typeof u.content=="string"?u.content:u.content.map(l).join(""):""};t.hooks.add("after-tokenize",function(u){u.language!=="jsx"&&u.language!=="tsx"||c(u.tokens)})})(Se),(function(t){var e=t.util.clone(t.languages.typescript),e=(t.languages.tsx=t.languages.extend("jsx",e),delete t.languages.tsx.parameter,delete t.languages.tsx["literal-property"],t.languages.tsx.tag);e.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+e.pattern.source+")",e.pattern.flags),e.lookbehind=!0})(Se),Se.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},Se.languages.swift["string-literal"].forEach(function(t){t.inside.interpolation.inside=Se.languages.swift}),(function(t){t.languages.kotlin=t.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete t.languages.kotlin["class-name"];var e={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:t.languages.kotlin}};t.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:e},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:e},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete t.languages.kotlin.string,t.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),t.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),t.languages.kt=t.languages.kotlin,t.languages.kts=t.languages.kotlin})(Se),Se.languages.c=Se.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Se.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Se.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Se.languages.c.string],char:Se.languages.c.char,comment:Se.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Se.languages.c}}}}),Se.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete Se.languages.c.boolean,Se.languages.objectivec=Se.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete Se.languages.objectivec["class-name"],Se.languages.objc=Se.languages.objectivec,Se.languages.reason=Se.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),Se.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete Se.languages.reason.function,(function(t){for(var e=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)e=e.replace(/<self>/g,function(){return e});e=e.replace(/<self>/g,function(){return/[^\s\S]/.source}),t.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+e),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},t.languages.rust["closure-params"].inside.rest=t.languages.rust,t.languages.rust.attribute.inside.string=t.languages.rust.string})(Se),Se.languages.go=Se.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),Se.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete Se.languages.go["class-name"],(function(t){var e=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return e.source});t.languages.cpp=t.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return e.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:e,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),t.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),t.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t.languages.cpp}}}}),t.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),t.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:t.languages.extend("cpp",{})}}),t.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},t.languages.cpp["base-clause"])})(Se),Se.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Se.languages.python["string-interpolation"].inside.interpolation.inside.rest=Se.languages.python,Se.languages.py=Se.languages.python,Se.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},Se.languages.webmanifest=Se.languages.json;var Pc={};cI(Pc,{dracula:()=>pI,duotoneDark:()=>gI,duotoneLight:()=>_I,github:()=>bI,gruvboxMaterialDark:()=>YI,gruvboxMaterialLight:()=>QI,jettwaveDark:()=>HI,jettwaveLight:()=>$I,nightOwl:()=>SI,nightOwlLight:()=>CI,oceanicNext:()=>EI,okaidia:()=>RI,oneDark:()=>VI,oneLight:()=>GI,palenight:()=>NI,shadesOfPurple:()=>DI,synthwave84:()=>OI,ultramin:()=>II,vsDark:()=>ck,vsLight:()=>BI});var hI={plain:{color:"#F8F8F2",backgroundColor:"#282A36"},styles:[{types:["prolog","constant","builtin"],style:{color:"rgb(189, 147, 249)"}},{types:["inserted","function"],style:{color:"rgb(80, 250, 123)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["changed"],style:{color:"rgb(255, 184, 108)"}},{types:["punctuation","symbol"],style:{color:"rgb(248, 248, 242)"}},{types:["string","char","tag","selector"],style:{color:"rgb(255, 121, 198)"}},{types:["keyword","variable"],style:{color:"rgb(189, 147, 249)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(98, 114, 164)"}},{types:["attr-name"],style:{color:"rgb(241, 250, 140)"}}]},pI=hI,mI={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},gI=mI,vI={plain:{backgroundColor:"#faf8f5",color:"#728fcb"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#b6ad9a"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#063289"}},{types:["property","function"],style:{color:"#b29762"}},{types:["tag-id","selector","atrule-id"],style:{color:"#2d2006"}},{types:["attr-name"],style:{color:"#896724"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule"],style:{color:"#728fcb"}},{types:["placeholder","variable"],style:{color:"#93abdc"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#896724"}}]},_I=vI,yI={plain:{color:"#393A34",backgroundColor:"#f6f8fa"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"#999988",fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}},{types:["string","attr-value"],style:{color:"#e3116c"}},{types:["punctuation","operator"],style:{color:"#393A34"}},{types:["entity","url","symbol","number","boolean","variable","constant","property","regex","inserted"],style:{color:"#36acaa"}},{types:["atrule","keyword","attr-name","selector"],style:{color:"#00a4db"}},{types:["function","deleted","tag"],style:{color:"#d73a49"}},{types:["function-variable"],style:{color:"#6f42c1"}},{types:["tag","selector","keyword"],style:{color:"#00009f"}}]},bI=yI,xI={plain:{color:"#d6deeb",backgroundColor:"#011627"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(99, 119, 119)",fontStyle:"italic"}},{types:["string","url"],style:{color:"rgb(173, 219, 103)"}},{types:["variable"],style:{color:"rgb(214, 222, 235)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation"],style:{color:"rgb(199, 146, 234)"}},{types:["selector","doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(255, 203, 139)"}},{types:["tag","operator","keyword"],style:{color:"rgb(127, 219, 202)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["property"],style:{color:"rgb(128, 203, 196)"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}}]},SI=xI,wI={plain:{color:"#403f53",backgroundColor:"#FBFBFB"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(72, 118, 214)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(152, 159, 177)",fontStyle:"italic"}},{types:["string","builtin","char","constant","url"],style:{color:"rgb(72, 118, 214)"}},{types:["variable"],style:{color:"rgb(201, 103, 101)"}},{types:["number"],style:{color:"rgb(170, 9, 130)"}},{types:["punctuation"],style:{color:"rgb(153, 76, 195)"}},{types:["function","selector","doctype"],style:{color:"rgb(153, 76, 195)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(17, 17, 17)"}},{types:["tag"],style:{color:"rgb(153, 76, 195)"}},{types:["operator","property","keyword","namespace"],style:{color:"rgb(12, 150, 155)"}},{types:["boolean"],style:{color:"rgb(188, 84, 84)"}}]},CI=wI,dr={char:"#D8DEE9",comment:"#999999",keyword:"#c5a5c5",primitive:"#5a9bcf",string:"#8dc891",variable:"#d7deea",boolean:"#ff8b50",tag:"#fc929e",function:"#79b6f2",className:"#FAC863"},kI={plain:{backgroundColor:"#282c34",color:"#ffffff"},styles:[{types:["attr-name"],style:{color:dr.keyword}},{types:["attr-value"],style:{color:dr.string}},{types:["comment","block-comment","prolog","doctype","cdata","shebang"],style:{color:dr.comment}},{types:["property","number","function-name","constant","symbol","deleted"],style:{color:dr.primitive}},{types:["boolean"],style:{color:dr.boolean}},{types:["tag"],style:{color:dr.tag}},{types:["string"],style:{color:dr.string}},{types:["punctuation"],style:{color:dr.string}},{types:["selector","char","builtin","inserted"],style:{color:dr.char}},{types:["function"],style:{color:dr.function}},{types:["operator","entity","url","variable"],style:{color:dr.variable}},{types:["keyword"],style:{color:dr.keyword}},{types:["atrule","class-name"],style:{color:dr.className}},{types:["important"],style:{fontWeight:"400"}},{types:["bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}}]},EI=kI,AI={plain:{color:"#f8f8f2",backgroundColor:"#272822"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"#f92672",fontStyle:"italic"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"#8292a2",fontStyle:"italic"}},{types:["string","url"],style:{color:"#a6e22e"}},{types:["variable"],style:{color:"#f8f8f2"}},{types:["number"],style:{color:"#ae81ff"}},{types:["builtin","char","constant","function","class-name"],style:{color:"#e6db74"}},{types:["punctuation"],style:{color:"#f8f8f2"}},{types:["selector","doctype"],style:{color:"#a6e22e",fontStyle:"italic"}},{types:["tag","operator","keyword"],style:{color:"#66d9ef"}},{types:["boolean"],style:{color:"#ae81ff"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)",opacity:.7}},{types:["tag","property"],style:{color:"#f92672"}},{types:["attr-name"],style:{color:"#a6e22e !important"}},{types:["doctype"],style:{color:"#8292a2"}},{types:["rule"],style:{color:"#e6db74"}}]},RI=AI,TI={plain:{color:"#bfc7d5",backgroundColor:"#292d3e"},styles:[{types:["comment"],style:{color:"rgb(105, 112, 152)",fontStyle:"italic"}},{types:["string","inserted"],style:{color:"rgb(195, 232, 141)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation","selector"],style:{color:"rgb(199, 146, 234)"}},{types:["variable"],style:{color:"rgb(191, 199, 213)"}},{types:["class-name","attr-name"],style:{color:"rgb(255, 203, 107)"}},{types:["tag","deleted"],style:{color:"rgb(255, 85, 114)"}},{types:["operator"],style:{color:"rgb(137, 221, 255)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["keyword"],style:{fontStyle:"italic"}},{types:["doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}},{types:["url"],style:{color:"rgb(221, 221, 221)"}}]},NI=TI,MI={plain:{color:"#9EFEFF",backgroundColor:"#2D2A55"},styles:[{types:["changed"],style:{color:"rgb(255, 238, 128)"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)"}},{types:["comment"],style:{color:"rgb(179, 98, 255)",fontStyle:"italic"}},{types:["punctuation"],style:{color:"rgb(255, 255, 255)"}},{types:["constant"],style:{color:"rgb(255, 98, 140)"}},{types:["string","url"],style:{color:"rgb(165, 255, 144)"}},{types:["variable"],style:{color:"rgb(255, 238, 128)"}},{types:["number","boolean"],style:{color:"rgb(255, 98, 140)"}},{types:["attr-name"],style:{color:"rgb(255, 180, 84)"}},{types:["keyword","operator","property","namespace","tag","selector","doctype"],style:{color:"rgb(255, 157, 0)"}},{types:["builtin","char","constant","function","class-name"],style:{color:"rgb(250, 208, 0)"}}]},DI=MI,jI={plain:{backgroundColor:"linear-gradient(to bottom, #2a2139 75%, #34294f)",backgroundImage:"#34294f",color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"},styles:[{types:["comment","block-comment","prolog","doctype","cdata"],style:{color:"#495495",fontStyle:"italic"}},{types:["punctuation"],style:{color:"#ccc"}},{types:["tag","attr-name","namespace","number","unit","hexcode","deleted"],style:{color:"#e2777a"}},{types:["property","selector"],style:{color:"#72f1b8",textShadow:"0 0 2px #100c0f, 0 0 10px #257c5575, 0 0 35px #21272475"}},{types:["function-name"],style:{color:"#6196cc"}},{types:["boolean","selector-id","function"],style:{color:"#fdfdfd",textShadow:"0 0 2px #001716, 0 0 3px #03edf975, 0 0 5px #03edf975, 0 0 8px #03edf975"}},{types:["class-name","maybe-class-name","builtin"],style:{color:"#fff5f6",textShadow:"0 0 2px #000, 0 0 10px #fc1f2c75, 0 0 5px #fc1f2c75, 0 0 25px #fc1f2c75"}},{types:["constant","symbol"],style:{color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"}},{types:["important","atrule","keyword","selector-class"],style:{color:"#f4eee4",textShadow:"0 0 2px #393a33, 0 0 8px #f39f0575, 0 0 2px #f39f0575"}},{types:["string","char","attr-value","regex","variable"],style:{color:"#f87c32"}},{types:["parameter"],style:{fontStyle:"italic"}},{types:["entity","url"],style:{color:"#67cdcc"}},{types:["operator"],style:{color:"ffffffee"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["entity"],style:{cursor:"help"}},{types:["inserted"],style:{color:"green"}}]},OI=jI,LI={plain:{color:"#282a2e",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(197, 200, 198)"}},{types:["string","number","builtin","variable"],style:{color:"rgb(150, 152, 150)"}},{types:["class-name","function","tag","attr-name"],style:{color:"rgb(40, 42, 46)"}}]},II=LI,PI={plain:{color:"#9CDCFE",backgroundColor:"#1E1E1E"},styles:[{types:["prolog"],style:{color:"rgb(0, 0, 128)"}},{types:["comment"],style:{color:"rgb(106, 153, 85)"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"rgb(86, 156, 214)"}},{types:["number","inserted"],style:{color:"rgb(181, 206, 168)"}},{types:["constant"],style:{color:"rgb(100, 102, 149)"}},{types:["attr-name","variable"],style:{color:"rgb(156, 220, 254)"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"rgb(206, 145, 120)"}},{types:["selector"],style:{color:"rgb(215, 186, 125)"}},{types:["tag"],style:{color:"rgb(78, 201, 176)"}},{types:["tag"],languages:["markup"],style:{color:"rgb(86, 156, 214)"}},{types:["punctuation","operator"],style:{color:"rgb(212, 212, 212)"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"rgb(220, 220, 170)"}},{types:["class-name"],style:{color:"rgb(78, 201, 176)"}},{types:["char"],style:{color:"rgb(209, 105, 105)"}}]},ck=PI,zI={plain:{color:"#000000",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(0, 128, 0)"}},{types:["builtin"],style:{color:"rgb(0, 112, 193)"}},{types:["number","variable","inserted"],style:{color:"rgb(9, 134, 88)"}},{types:["operator"],style:{color:"rgb(0, 0, 0)"}},{types:["constant","char"],style:{color:"rgb(129, 31, 63)"}},{types:["tag"],style:{color:"rgb(128, 0, 0)"}},{types:["attr-name"],style:{color:"rgb(255, 0, 0)"}},{types:["deleted","string"],style:{color:"rgb(163, 21, 21)"}},{types:["changed","punctuation"],style:{color:"rgb(4, 81, 165)"}},{types:["function","keyword"],style:{color:"rgb(0, 0, 255)"}},{types:["class-name"],style:{color:"rgb(38, 127, 153)"}}]},BI=zI,FI={plain:{color:"#f8fafc",backgroundColor:"#011627"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#569CD6"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#f8fafc"}},{types:["attr-name","variable"],style:{color:"#9CDCFE"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#cbd5e1"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#D4D4D4"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#7dd3fc"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},HI=FI,UI={plain:{color:"#0f172a",backgroundColor:"#f1f5f9"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#0c4a6e"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#0f172a"}},{types:["attr-name","variable"],style:{color:"#0c4a6e"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#64748b"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#475569"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#0e7490"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},$I=UI,qI={plain:{backgroundColor:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(220, 10%, 40%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(220, 14%, 71%)"}},{types:["attr-name","class-name","maybe-class-name","boolean","constant","number","atrule"],style:{color:"hsl(29, 54%, 61%)"}},{types:["keyword"],style:{color:"hsl(286, 60%, 67%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(355, 65%, 65%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value"],style:{color:"hsl(95, 38%, 62%)"}},{types:["variable","operator","function"],style:{color:"hsl(207, 82%, 66%)"}},{types:["url"],style:{color:"hsl(187, 47%, 55%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(220, 14%, 71%)"}}]},VI=qI,WI={plain:{backgroundColor:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(230, 4%, 64%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(230, 8%, 24%)"}},{types:["attr-name","class-name","boolean","constant","number","atrule"],style:{color:"hsl(35, 99%, 36%)"}},{types:["keyword"],style:{color:"hsl(301, 63%, 40%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(5, 74%, 59%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value","punctuation"],style:{color:"hsl(119, 34%, 47%)"}},{types:["variable","operator","function"],style:{color:"hsl(221, 87%, 60%)"}},{types:["url"],style:{color:"hsl(198, 99%, 37%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(230, 8%, 24%)"}}]},GI=WI,KI={plain:{color:"#ebdbb2",backgroundColor:"#292828"},styles:[{types:["imports","class-name","maybe-class-name","constant","doctype","builtin","function"],style:{color:"#d8a657"}},{types:["property-access"],style:{color:"#7daea3"}},{types:["tag"],style:{color:"#e78a4e"}},{types:["attr-name","char","url","regex"],style:{color:"#a9b665"}},{types:["attr-value","string"],style:{color:"#89b482"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#ea6962"}},{types:["entity","number","symbol"],style:{color:"#d3869b"}}]},YI=KI,XI={plain:{color:"#654735",backgroundColor:"#f9f5d7"},styles:[{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#af2528"}},{types:["imports","class-name","maybe-class-name","constant","doctype","builtin"],style:{color:"#b4730e"}},{types:["string","attr-value"],style:{color:"#477a5b"}},{types:["property-access"],style:{color:"#266b79"}},{types:["function","attr-name","char","url"],style:{color:"#72761e"}},{types:["tag"],style:{color:"#b94c07"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["entity","number","symbol"],style:{color:"#924f79"}}]},QI=XI,ZI=t=>N.useCallback(e=>{var n=e,{className:r,style:o,line:a}=n,c=lk(n,["className","style","line"]);const l=Pf(us({},c),{className:Zd("token-line",r)});return typeof t=="object"&&"plain"in t&&(l.style=t.plain),typeof o=="object"&&(l.style=us(us({},l.style||{}),o)),l},[t]),JI=t=>{const e=N.useCallback(({types:n,empty:r})=>{if(t!=null){{if(n.length===1&&n[0]==="plain")return r!=null?{display:"inline-block"}:void 0;if(n.length===1&&r!=null)return t[n[0]]}return Object.assign(r!=null?{display:"inline-block"}:{},...n.map(o=>t[o]))}},[t]);return N.useCallback(n=>{var r=n,{token:o,className:a,style:c}=r,l=lk(r,["token","className","style"]);const u=Pf(us({},l),{className:Zd("token",...o.types,a),children:o.content,style:e(o)});return c!=null&&(u.style=us(us({},u.style||{}),c)),u},[e])},e9=/\r\n|\r|\n/,qb=t=>{t.length===0?t.push({types:["plain"],content:`
536
+ `,empty:!0}):t.length===1&&t[0].content===""&&(t[0].content=`
537
+ `,t[0].empty=!0)},Vb=(t,e)=>{const n=t.length;return n>0&&t[n-1]===e?t:t.concat(e)},t9=t=>{const e=[[]],n=[t],r=[0],o=[t.length];let a=0,c=0,l=[];const u=[l];for(;c>-1;){for(;(a=r[c]++)<o[c];){let f,p=e[c];const _=n[c][a];if(typeof _=="string"?(p=c>0?p:["plain"],f=_):(p=Vb(p,_.type),_.alias&&(p=Vb(p,_.alias)),f=_.content),typeof f!="string"){c++,e.push(p),n.push(f),r.push(0),o.push(f.length);continue}const x=f.split(e9),C=x.length;l.push({types:p,content:x[0]});for(let w=1;w<C;w++)qb(l),u.push(l=[]),l.push({types:p,content:x[w]})}c--,e.pop(),n.pop(),r.pop(),o.pop()}return qb(l),u},Wb=t9,n9=({prism:t,code:e,grammar:n,language:r})=>N.useMemo(()=>{if(n==null)return Wb([e]);const o={code:e,grammar:n,language:r,tokens:[]};return t.hooks.run("before-tokenize",o),o.tokens=t.tokenize(e,n),t.hooks.run("after-tokenize",o),Wb(o.tokens)},[e,n,r,t]),r9=(t,e)=>{const{plain:n}=t,r=t.styles.reduce((o,a)=>{const{languages:c,style:l}=a;return c&&!c.includes(e)||a.types.forEach(u=>{const f=us(us({},o[u]),l);o[u]=f}),o},{});return r.root=n,r.plain=Pf(us({},n),{backgroundColor:void 0}),r},s9=r9,i9=({children:t,language:e,code:n,theme:r,prism:o})=>{const a=e.toLowerCase(),c=s9(r,a),l=ZI(c),u=JI(c),f=o.languages[a],p=n9({prism:o,language:a,code:n,grammar:f});return t({tokens:p,className:`prism-code language-${a}`,style:c!=null?c.root:{},getLineProps:l,getTokenProps:u})},mv=t=>N.createElement(i9,Pf(us({},t),{prism:t.prism||Se,theme:t.theme||ck,code:t.code,language:t.language}));/*! Bundled license information:
538
+
539
+ prismjs/prism.js:
540
+ (**
541
+ * Prism: Lightweight, robust, elegant syntax highlighting
542
+ *
543
+ * @license MIT <https://opensource.org/licenses/MIT>
544
+ * @author Lea Verou <https://lea.verou.me>
545
+ * @namespace
546
+ * @public
547
+ *)
548
+ */const o9=Pc.oneDark;function a9(t){var r;const e=(r=t.split(".").pop())==null?void 0:r.toLowerCase();return{ts:"typescript",tsx:"typescript",js:"javascript",jsx:"javascript",json:"json",md:"markdown",css:"css",html:"html",py:"python",go:"go",rs:"rust",sh:"bash",yaml:"yaml",yml:"yaml"}[e||""]||e||"text"}const l9=N.memo(function(e){const n=he.c(28),{type:r,content:o,lineNumber:a,newLineNumber:c,language:l}=e,u=r==="added"&&"bg-green-500/20",f=r==="removed"&&"bg-red-500/20",p=r==="context"&&"bg-muted/30";let h;n[0]!==u||n[1]!==f||n[2]!==p?(h=ke("flex font-mono text-xs",u,f,p),n[0]=u,n[1]=f,n[2]=p,n[3]=h):h=n[3];const _=h,x=r==="added"&&"text-green-400",C=r==="removed"&&"text-red-400",w=r==="context"&&"text-muted-foreground/50";let v;n[4]!==x||n[5]!==C||n[6]!==w?(v=ke("font-bold w-4 select-none",x,C,w),n[4]=x,n[5]=C,n[6]=w,n[7]=v):v=n[7];const b=v,y=a!=null?a:"";let S;n[8]!==y?(S=m.jsx("span",{className:"w-10 text-right pr-2 text-muted-foreground select-none border-r border-white/10",children:y}),n[8]=y,n[9]=S):S=n[9];const k=c!=null?c:"";let T;n[10]!==k?(T=m.jsx("span",{className:"w-10 text-right pr-2 text-muted-foreground select-none border-r border-white/10",children:k}),n[10]=k,n[11]=T):T=n[11];const R=r==="added"&&"+",D=r==="removed"&&"-",A=r==="context"&&" ";let j;n[12]!==b||n[13]!==R||n[14]!==D||n[15]!==A?(j=m.jsxs("span",{className:b,children:[R,D,A]}),n[12]=b,n[13]=R,n[14]=D,n[15]=A,n[16]=j):j=n[16];let O;n[17]!==o||n[18]!==l?(O=m.jsx(mv,{theme:o9,code:o,language:l,children:c9}),n[17]=o,n[18]=l,n[19]=O):O=n[19];let P;n[20]!==j||n[21]!==O?(P=m.jsxs("span",{className:"pl-2 flex-1 whitespace-pre flex",children:[j,O]}),n[20]=j,n[21]=O,n[22]=P):P=n[22];let $;return n[23]!==S||n[24]!==T||n[25]!==P||n[26]!==_?($=m.jsxs("div",{className:_,children:[S,T,P]}),n[23]=S,n[24]=T,n[25]=P,n[26]=_,n[27]=$):$=n[27],$}),uk=N.memo(function(e){const n=he.c(27),{hunks:r,path:o,language:a,additions:c,deletions:l}=e,[u,f]=N.useState(!0);let p;n[0]!==o||n[1]!==a?(p=a||a9(o),n[0]=o,n[1]=a,n[2]=p):p=n[2];const h=p;let _;n[3]!==u?(_=()=>f(!u),n[3]=u,n[4]=_):_=n[4];let x;n[5]!==u?(x=u?m.jsx(Oa,{className:"size-3"}):m.jsx(Wr,{className:"size-3"}),n[5]=u,n[6]=x):x=n[6];let C;n[7]!==_||n[8]!==x?(C=m.jsx("button",{onClick:_,className:"px-1 py-1 hover:bg-muted rounded",children:x}),n[7]=_,n[8]=x,n[9]=C):C=n[9];let w;n[10]===Symbol.for("react.memo_cache_sentinel")?(w=m.jsx(bg,{className:"size-3"}),n[10]=w):w=n[10];let v;n[11]!==o?(v=m.jsx("span",{className:"font-mono pr-2",children:o}),n[11]=o,n[12]=v):v=n[12];let b;n[13]!==c||n[14]!==l?(b=c!==void 0&&l!==void 0&&m.jsxs("span",{className:"ml-auto mr-2 text-muted-foreground",children:["+",c," -",l]}),n[13]=c,n[14]=l,n[15]=b):b=n[15];let y;n[16]!==C||n[17]!==v||n[18]!==b?(y=m.jsxs("div",{className:"flex items-center gap-2 px-1 bg-muted/50 text-xs text-muted-foreground",children:[C,w,v,b]}),n[16]=C,n[17]=v,n[18]=b,n[19]=y):y=n[19];let S;n[20]!==u||n[21]!==r||n[22]!==h?(S=u&&m.jsx("div",{style:{backgroundColor:"#282c34"},children:r.map((T,R)=>m.jsx("div",{className:"divide-y divide-white/5",children:T.changes.map((D,A)=>m.jsx(l9,{...D,language:h},A))},R))}),n[20]=u,n[21]=r,n[22]=h,n[23]=S):S=n[23];let k;return n[24]!==y||n[25]!==S?(k=m.jsx("div",{className:"visualization-container overflow-x-auto border border-white/10 rounded-md",children:m.jsxs("div",{children:[y,S]})}),n[24]=y,n[25]=S,n[26]=k):k=n[26],k});function c9(t){const{tokens:e,getTokenProps:n}=t;return m.jsx(m.Fragment,{children:e.map((r,o)=>m.jsx("span",{children:r.map((a,c)=>m.jsx("span",{...n({token:a})},c))},o))})}const u9=Pc.oneDark,d9=20;function f9(t){var r;const e=(r=t.split(".").pop())==null?void 0:r.toLowerCase();return{ts:"typescript",tsx:"typescript",js:"javascript",jsx:"javascript",json:"json",md:"markdown",css:"css",html:"html",py:"python",go:"go",rs:"rust",sh:"bash",yaml:"yaml",yml:"yaml"}[e||""]||e||"text"}const h9=N.memo(t=>{const e=he.c(40),{content:n,path:r,language:o,created:a,highlightLines:c}=t;let l;e[0]!==c?(l=c===void 0?[]:c,e[0]=c,e[1]=l):l=e[1];const u=l,[f,p]=N.useState(!1);let h;e[2]!==o||e[3]!==r?(h=o||f9(r),e[2]=o,e[3]=r,e[4]=h):h=e[4];const _=h;let x;e[5]!==u?(x=new Set(u),e[5]=u,e[6]=x):x=e[6];const C=x;let w;e[7]!==n?(w=n.split(`
549
+ `),e[7]=n,e[8]=w):w=e[8];const v=w.length;let b;e[9]!==f?(b=()=>p(!f),e[9]=f,e[10]=b):b=e[10];let y;e[11]!==f?(y=f?m.jsx(Oa,{className:"size-3"}):m.jsx(Wr,{className:"size-3"}),e[11]=f,e[12]=y):y=e[12];let S;e[13]!==b||e[14]!==y?(S=m.jsx("button",{onClick:b,className:"flex items-center gap-2 px-2 py-1 hover:bg-muted",children:y}),e[13]=b,e[14]=y,e[15]=S):S=e[15];let k;e[16]===Symbol.for("react.memo_cache_sentinel")?(k=m.jsx(bg,{className:"size-3"}),e[16]=k):k=e[16];let T;e[17]!==r?(T=m.jsx("span",{className:"font-mono pr-2",children:r}),e[17]=r,e[18]=T):T=e[18];let R;e[19]!==f||e[20]!==v?(R=!f&&m.jsxs("span",{className:"text-xs text-muted-foreground/70",children:[v," lines"]}),e[19]=f,e[20]=v,e[21]=R):R=e[21];let D;e[22]!==a?(D=a===!1?m.jsxs("span",{className:"flex items-center gap-1 text-warning ml-auto mr-2",children:[m.jsx(rc,{className:"size-3"}),"Overwrote"]}):m.jsxs("span",{className:"flex items-center gap-1 text-success ml-auto mr-2",children:[m.jsx(Ls,{className:"size-3"}),"Created"]}),e[22]=a,e[23]=D):D=e[23];let A;e[24]!==T||e[25]!==R||e[26]!==D||e[27]!==S?(A=m.jsxs("div",{className:"flex items-center gap-2 px-1 bg-muted/50 text-xs text-muted-foreground",children:[S,k,T,R,D]}),e[24]=T,e[25]=R,e[26]=D,e[27]=S,e[28]=A):A=e[28];let j;e[29]===Symbol.for("react.memo_cache_sentinel")?(j={backgroundColor:"#282c34"},e[29]=j):j=e[29];let O;e[30]!==f||e[31]!==C?(O=U=>{const{tokens:W,getTokenProps:K}=U,V=f?W:W.slice(0,d9);return m.jsx(m.Fragment,{children:V.map((Q,X)=>m.jsxs("div",{className:`flex font-mono text-xs ${C.has(X+1)?"bg-yellow-500/20":""}`,children:[m.jsx("span",{className:"w-10 text-right pr-2 text-muted-foreground select-none border-r border-white/10",children:X+1}),m.jsx("span",{className:"pl-2 flex-1 whitespace-pre",children:Q.map((I,L)=>m.jsx("span",{...K({token:I})},L))})]},X))})},e[30]=f,e[31]=C,e[32]=O):O=e[32];let P;e[33]!==n||e[34]!==_||e[35]!==O?(P=m.jsx("div",{style:j,children:m.jsx(mv,{theme:u9,code:n,language:_,children:O})}),e[33]=n,e[34]=_,e[35]=O,e[36]=P):P=e[36];let $;return e[37]!==A||e[38]!==P?($=m.jsx("div",{className:"visualization-container overflow-x-auto border border-white/10 rounded-md",children:m.jsxs("div",{children:[A,P]})}),e[37]=A,e[38]=P,e[39]=$):$=e[39],$});function p9(t){const e=he.c(3),{message:n}=t,r=n===void 0?"Success":n;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx(bc,{className:"size-4"}),e[0]=o):o=e[0];let a;return e[1]!==r?(a=m.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[o,m.jsx("span",{className:"break-all",children:r})]}),e[1]=r,e[2]=a):a=e[2],a}const m9={edit:D5,plus:La,trash:Ia,search:xg};function g9(t){const e=he.c(7),{text:n}=t,[r,o]=N.useState(!1);let a;e[0]!==n?(a=async()=>{await navigator.clipboard.writeText(n),o(!0),setTimeout(()=>o(!1),1500)},e[0]=n,e[1]=a):a=e[1];const c=a;let l;e[2]!==r?(l=r?m.jsx("span",{className:"text-success text-xs",children:"Copied!"}):m.jsx(ac,{className:"size-3"}),e[2]=r,e[3]=l):l=e[3];let u;return e[4]!==c||e[5]!==l?(u=m.jsx("button",{onClick:c,className:"text-muted-foreground hover:text-foreground transition-colors",title:"Copy path",children:l}),e[4]=c,e[5]=l,e[6]=u):u=e[6],u}function v9(t){const e=he.c(16),{title:n,groups:r,files:o,total:a}=t;let c;e[0]!==o?(c=o||[],e[0]=o,e[1]=c):c=e[1];let l;e[2]!==c?(l={label:"Files",files:c,icon:void 0},e[2]=c,e[3]=l):l=e[3];const u=l;let f;e[4]!==u||e[5]!==o||e[6]!==r?(f=r||(o?[u]:[]),e[4]=u,e[5]=o,e[6]=r,e[7]=f):f=e[7];const p=f;if(p.length===0)return null;let h;e[8]!==n||e[9]!==a?(h=n&&m.jsxs("div",{className:"text-sm font-medium text-foreground",children:[n,a!==void 0&&m.jsxs("span",{className:"ml-2 text-muted-foreground",children:["(",a," files)"]})]}),e[8]=n,e[9]=a,e[10]=h):h=e[10];let _;e[11]!==p?(_=p.map(_9),e[11]=p,e[12]=_):_=e[12];let x;return e[13]!==h||e[14]!==_?(x=m.jsxs("div",{className:"flex flex-col gap-3",children:[h,_]}),e[13]=h,e[14]=_,e[15]=x):x=e[15],x}function _9(t,e){return m.jsxs("div",{className:"flex flex-col gap-1",children:[m.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[t.icon&&m.jsx("span",{className:"flex items-center",children:(()=>{const n=m9[t.icon];return m.jsx(n,{className:"size-3"})})()}),m.jsx("span",{children:t.label}),m.jsxs("span",{className:"text-muted-foreground/50",children:["(",t.files.length,")"]})]}),m.jsx("div",{className:"flex flex-col gap-0.5 pl-5",children:t.files.map(y9)})]},e)}function y9(t,e){return m.jsxs("div",{className:"flex items-center gap-2 text-xs group",children:[m.jsx(bg,{className:"size-3 text-muted-foreground shrink-0"}),m.jsx("span",{className:"font-mono text-foreground/80 truncate",children:t.path}),t.line!==void 0&&m.jsxs("span",{className:"text-muted-foreground shrink-0",children:[":",t.line]}),t.action&&m.jsx("span",{className:ke("text-xs px-1 rounded shrink-0",t.action==="created"&&"bg-success/20 text-success",t.action==="modified"&&"bg-warning/20 text-warning",t.action==="deleted"&&"bg-destructive/20 text-destructive"),children:t.action}),m.jsx(g9,{text:t.path})]},e)}function b9(t){const e=he.c(15),{command:n,stdout:r,stderr:o,exitCode:a}=t,c=a===0;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=m.jsx("span",{className:"text-muted-foreground",children:"$ "}),e[0]=l):l=e[0];let u;e[1]!==n?(u=m.jsxs("div",{className:"font-mono text-xs text-muted-foreground truncate flex-1 mr-2",children:[l,m.jsx("span",{className:"text-foreground",children:n})]}),e[1]=n,e[2]=u):u=e[2];const f=`text-xs font-mono px-2 py-0.5 rounded ${c?"bg-muted text-muted-foreground":"bg-red-500/20 text-red-400"}`;let p;e[3]!==a||e[4]!==f?(p=m.jsxs("span",{className:f,children:["[",a,"]"]}),e[3]=a,e[4]=f,e[5]=p):p=e[5];let h;e[6]!==u||e[7]!==p?(h=m.jsxs("div",{className:"bg-muted px-3 py-2 flex items-center justify-between",children:[u,p]}),e[6]=u,e[7]=p,e[8]=h):h=e[8];let _;e[9]!==o||e[10]!==r?(_=(r||o)&&m.jsxs("div",{className:"bg-black px-3 py-2 font-mono text-xs overflow-x-auto",children:[r&&m.jsx("pre",{className:"text-gray-300 whitespace-pre-wrap",children:r}),o&&m.jsx("pre",{className:"text-red-400 whitespace-pre-wrap mt-1",children:o})]}),e[9]=o,e[10]=r,e[11]=_):_=e[11];let x;return e[12]!==h||e[13]!==_?(x=m.jsxs("div",{className:"visualization-container border border-white/10 rounded-md overflow-hidden",children:[h,_]}),e[12]=h,e[13]=_,e[14]=x):x=e[14],x}const x9={pending:{icon:b5,color:"text-muted-foreground"},in_progress:{icon:pr,color:"text-warning",animate:!0},completed:{icon:bc,color:"text-success"},cancelled:{icon:Qd,color:"text-destructive"}},S9={high:{label:"high",className:"bg-destructive/20 text-destructive"},medium:{label:"",className:""},low:{label:"low",className:"text-muted-foreground"}};function w9(t){const e=he.c(13),{title:n,items:r}=t;if(r.length===0)return null;let o;e[0]!==r?(o=r.filter(A9),e[0]=r,e[1]=o):o=e[1];const a=o.length;r.filter(E9),r.filter(k9);let c;e[2]!==a||e[3]!==r.length||e[4]!==n?(c=(n||r.length>0)&&m.jsxs("div",{className:"text-sm font-medium text-foreground",children:[n||"Todo List",m.jsxs("span",{className:"ml-2 text-muted-foreground",children:["(",r.length,")"]}),a>0&&m.jsxs("span",{className:"ml-2 text-success text-xs",children:[a," completed"]})]}),e[2]=a,e[3]=r.length,e[4]=n,e[5]=c):c=e[5];let l;e[6]!==r?(l=r.map(C9),e[6]=r,e[7]=l):l=e[7];let u;e[8]!==l?(u=m.jsx("div",{className:"flex flex-col gap-1 w-full",children:l}),e[8]=l,e[9]=u):u=e[9];let f;return e[10]!==c||e[11]!==u?(f=m.jsxs("div",{className:"flex flex-col gap-3 w-full overflow-hidden",children:[c,u]}),e[10]=c,e[11]=u,e[12]=f):f=e[12],f}function C9(t,e){const n=x9[t.status],r=n.icon,o=S9[t.priority];return m.jsxs("div",{className:"flex items-center gap-2 text-sm min-w-0",children:[m.jsx(r,{className:ke("size-4 shrink-0",n.color,n.animate&&"animate-spin")}),m.jsx("span",{className:ke("flex-1 break-all",t.status==="completed"&&"line-through text-muted-foreground",t.status==="cancelled"&&"text-muted-foreground"),children:t.content}),o.label&&t.priority==="high"&&m.jsx("span",{className:ke("text-xs px-1.5 py-0.5 rounded shrink-0",o.className),children:o.label}),t.priority==="low"&&t.status!=="completed"&&t.status!=="cancelled"&&m.jsx("span",{className:"text-xs text-muted-foreground shrink-0",children:o.label})]},e)}function k9(t){return t.status==="pending"}function E9(t){return t.status==="in_progress"}function A9(t){return t.status==="completed"}const R9=N.memo(function(e){const n=he.c(38),{visualization:r}=e;if(!r)return null;switch(r.type){case"diff":{let o;return n[0]!==r.additions||n[1]!==r.deletions||n[2]!==r.hunks||n[3]!==r.language||n[4]!==r.matchInfo||n[5]!==r.path?(o=m.jsx(uk,{path:r.path,hunks:r.hunks,language:r.language,additions:r.additions,deletions:r.deletions,matchInfo:r.matchInfo}),n[0]=r.additions,n[1]=r.deletions,n[2]=r.hunks,n[3]=r.language,n[4]=r.matchInfo,n[5]=r.path,n[6]=o):o=n[6],o}case"diffs":{let o;n[7]!==r.items?(o=r.items.map(T9),n[7]=r.items,n[8]=o):o=n[8];let a;return n[9]!==o?(a=m.jsx("div",{className:"space-y-3",children:o}),n[9]=o,n[10]=a):a=n[10],a}case"code":{let o;return n[11]!==r.content||n[12]!==r.created||n[13]!==r.highlightLines||n[14]!==r.language||n[15]!==r.path?(o=m.jsx(h9,{path:r.path,content:r.content,language:r.language,created:r.created,highlightLines:r.highlightLines}),n[11]=r.content,n[12]=r.created,n[13]=r.highlightLines,n[14]=r.language,n[15]=r.path,n[16]=o):o=n[16],o}case"file-list":{let o;return n[17]!==r.files||n[18]!==r.groups||n[19]!==r.title||n[20]!==r.total?(o=m.jsx(v9,{title:r.title,groups:r.groups,files:r.files,total:r.total}),n[17]=r.files,n[18]=r.groups,n[19]=r.title,n[20]=r.total,n[21]=o):o=n[21],o}case"table":{let o;n[22]!==r.rows?(o=JSON.stringify(r.rows,null,2),n[22]=r.rows,n[23]=o):o=n[23];let a;return n[24]!==o?(a=m.jsx("pre",{className:"text-xs bg-muted/50 border rounded-md p-2 overflow-x-auto",children:o}),n[24]=o,n[25]=a):a=n[25],a}case"markdown":{let o;return n[26]!==r.content?(o=m.jsx("div",{className:"prose prose-sm dark:prose-invert",children:r.content}),n[26]=r.content,n[27]=o):o=n[27],o}case"none":{let o;return n[28]!==r.message?(o=m.jsx(p9,{message:r.message}),n[28]=r.message,n[29]=o):o=n[29],o}case"shell-output":{let o;return n[30]!==r.command||n[31]!==r.exitCode||n[32]!==r.stderr||n[33]!==r.stdout?(o=m.jsx(b9,{command:r.command,stdout:r.stdout,stderr:r.stderr,exitCode:r.exitCode}),n[30]=r.command,n[31]=r.exitCode,n[32]=r.stderr,n[33]=r.stdout,n[34]=o):o=n[34],o}case"todo-list":{let o;return n[35]!==r.items||n[36]!==r.title?(o=m.jsx(w9,{title:r.title,items:r.items}),n[35]=r.items,n[36]=r.title,n[37]=o):o=n[37],o}default:return null}});function T9(t,e){return m.jsx(uk,{path:t.path,hunks:t.hunks,language:t.language,additions:t.additions,deletions:t.deletions,matchInfo:t.matchInfo},`${t.path}-${e}`)}const Gb=1536,Kb=N.memo(function(e){const n=he.c(16),{content:r,className:o}=e,[a,c]=N.useState(!1);let l;n[0]!==r?(l=new Blob([r]),n[0]=r,n[1]=l):l=n[1];const u=l.size,f=u>Gb,p=f?r.slice(0,Gb)+`
550
+ ...`:null;if(!f){let S;return n[2]!==o||n[3]!==r?(S=m.jsx("pre",{className:o,children:r}),n[2]=o,n[3]=r,n[4]=S):S=n[4],S}let h;n[5]!==u?(h=u>1048576?`${(u/1048576).toFixed(1)} MB`:u>1024?`${(u/1024).toFixed(1)} KB`:`${u} bytes`,n[5]=u,n[6]=h):h=n[6];const _=h,x=a?r:p;let C;n[7]!==o||n[8]!==x?(C=m.jsx("pre",{className:o,children:x}),n[7]=o,n[8]=x,n[9]=C):C=n[9];let w;n[10]===Symbol.for("react.memo_cache_sentinel")?(w=()=>c(O9),n[10]=w):w=n[10];const v=a?"Show less":`Show full output (${_})`;let b;n[11]!==v?(b=m.jsx("button",{type:"button",className:"text-xs text-muted-foreground hover:text-foreground mt-1 transition-colors cursor-pointer",onClick:w,children:v}),n[11]=v,n[12]=b):b=n[12];let y;return n[13]!==C||n[14]!==b?(y=m.jsxs("div",{children:[C,b]}),n[13]=C,n[14]=b,n[15]=y):y=n[15],y});function N9(t){switch(t){case"pending":return m.jsx(tS,{className:"size-3 text-warning"});case"running":return m.jsx(pr,{className:"size-3 text-warning animate-spin"});case"completed":return m.jsx(bc,{className:"size-3 text-success"});case"error":return m.jsx(Qd,{className:"size-3 text-destructive"});case"interrupted":return m.jsx(iS,{className:"size-3 text-warning"});default:return null}}function M9(t){if(t&&typeof t=="object"&&"_visualization"in t)return t._visualization}const D9=(t,e)=>{if(t.part!==e.part||t.onNavigateToSubagent!==e.onNavigateToSubagent)return!1;if(t.part.state.status!=="pending")return!0;const r=t.pendingPermissions.find(a=>a.toolCallId===t.part.callId),o=e.pendingPermissions.find(a=>a.toolCallId===e.part.callId);return r===o},j9=N.memo(function({part:e,pendingPermissions:n,onPermissionResponse:r,onNavigateToSubagent:o}){var S;const[a,c]=N.useState(!1),[l,u]=N.useState(!1),f=e.state,p=f.status,h=N.useMemo(()=>{if(!a)return"";try{return JSON.stringify(f.input,null,2)}catch{return String(f.input)}},[f.input,a]),_=N.useMemo(()=>!a||p!=="completed"||!("output"in f)?null:typeof f.output=="string"?f.output:JSON.stringify(f.output,null,2),[p,f,a]),x=p==="completed"&&"output"in f?M9(f.output):void 0,C=p==="pending"?n.find(k=>k.toolCallId===e.callId):void 0,w=C?typeof((S=C.args)==null?void 0:S.command)=="string"?C.args.command:JSON.stringify(C.args,null,2):null;let v=null;if(e.name==="task"){if("childSessionId"in f&&f.childSessionId)v=f.childSessionId;else if(p==="completed"&&"output"in f){const T=(typeof f.output=="string"?f.output:"").match(/task_id:\s*([a-f0-9-]{36})/i);T&&(v=T[1])}}const b=async()=>{if("output"in f){const k=typeof f.output=="string"?f.output:JSON.stringify(f.output,null,2);await navigator.clipboard.writeText(k),u(!0),setTimeout(()=>u(!1),2e3)}},y=(()=>{try{const k=JSON.stringify(f.input);return k.length>50?k.slice(0,47)+"...":k}catch{return String(f.input)}})();return m.jsxs("div",{className:"my-1",children:[m.jsxs(ki,{open:a,onOpenChange:c,children:[m.jsx(Ei,{asChild:!0,children:m.jsxs("div",{className:"flex items-center gap-2 py-1 cursor-pointer hover:text-foreground transition-colors text-muted-foreground",children:[a?m.jsx(Oa,{className:"size-4 text-muted-foreground"}):m.jsx(Wr,{className:"size-4 text-muted-foreground"}),m.jsx(KA,{className:"size-3"}),m.jsx("span",{className:"text-xs truncate max-w-[120px] sm:max-w-none",children:e.name}),!a&&m.jsx("span",{className:"text-xs text-muted-foreground font-mono truncate flex-1 min-w-0 sm:max-w-[200px] hidden sm:block",children:y}),m.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[N9(p),v&&o&&m.jsxs(Fe,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0 sm:w-auto sm:px-2",onClick:k=>{k.stopPropagation(),o(v)},title:"View session",children:[m.jsx(zm,{className:"size-3"}),m.jsx("span",{className:"hidden sm:inline ml-1",children:"View"})]})]})]})}),a&&m.jsx(Ai,{children:m.jsxs("div",{className:"pl-5 pb-2 flex flex-col gap-2",children:[m.jsxs("div",{children:[m.jsx("div",{className:"text-xs uppercase text-muted-foreground mb-1",children:"Input"}),m.jsx(Kb,{content:h,className:"text-xs bg-background border rounded-md p-2 overflow-x-auto whitespace-pre-wrap break-words"})]}),(p==="running"||p==="completed")&&v&&o&&m.jsxs(Fe,{variant:"outline",className:"w-full",size:"sm",onClick:()=>o(v),children:[m.jsx(zm,{className:"size-4","data-icon":"inline-start"}),p==="running"?"Watch Subagent":"View Session"]}),p==="completed"&&_!==null&&m.jsxs("div",{children:[m.jsxs("div",{className:"flex items-center justify-between mb-1",children:[m.jsx("div",{className:"text-xs uppercase text-muted-foreground",children:"Output"}),m.jsx(Fe,{variant:"ghost",size:"icon",onClick:b,className:"size-6",children:l?m.jsx(Ls,{className:"size-3 text-success"}):m.jsx(ac,{className:"size-3"})})]}),m.jsx(Kb,{content:_,className:"text-xs bg-success/10 border border-success/20 rounded-md p-2 overflow-x-auto whitespace-pre-wrap break-words"})]}),p==="error"&&"error"in f&&m.jsxs("div",{children:[m.jsx("div",{className:"text-xs uppercase text-muted-foreground mb-1",children:"Error"}),m.jsx("pre",{className:"text-xs bg-destructive/10 border border-destructive/20 rounded-md p-2 overflow-x-auto whitespace-pre-wrap break-words text-destructive",children:f.error})]})]})})]}),p==="pending"&&C&&m.jsxs("div",{className:"border border-warning/50 bg-warning/10 rounded-md p-3 flex flex-col gap-3 mt-2",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(lc,{className:"size-4 text-warning"}),m.jsx("span",{className:"text-sm font-medium",children:"Permission Required"})]}),C.message&&m.jsx("p",{className:"text-sm",children:C.message}),C.dangerous&&m.jsxs("div",{className:"flex items-center gap-2 text-sm text-destructive font-medium",children:[m.jsx(lc,{className:"size-4"}),"This operation is marked as dangerous"]}),w&&m.jsxs(ki,{children:[m.jsx(Ei,{asChild:!0,children:m.jsxs("button",{className:"flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground transition-colors w-full text-left",children:[m.jsx(Wr,{className:"size-3"}),m.jsx("span",{className:"uppercase tracking-wide",children:"Command"})]})}),m.jsx(Ai,{children:m.jsx("pre",{className:"text-xs bg-background border rounded-md p-2 mt-1 overflow-x-auto whitespace-pre-wrap break-words overflow-wrap-break",children:w})})]}),m.jsxs("div",{className:"flex justify-end gap-2 flex-wrap",children:[m.jsx(Fe,{variant:"outline",size:"sm",onClick:()=>r(e.callId,!1,!1),children:"Deny"}),m.jsx(Fe,{variant:"secondary",size:"sm",onClick:()=>r(e.callId,!0,!1),children:"Approve"}),m.jsx(Fe,{size:"sm",onClick:()=>r(e.callId,!0,!0),children:"Always Allow"})]})]}),p==="completed"&&x&&m.jsx("div",{className:"mt-2",children:m.jsx(R9,{visualization:x})})]})},D9);function O9(t){return!t}function L9(t,e){const n={};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const I9=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,P9=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,z9={};function Yb(t,e){return(z9.jsx?P9:I9).test(t)}const B9=/[ \t\n\f\r]/g;function F9(t){return typeof t=="object"?t.type==="text"?Xb(t.value):!1:Xb(t)}function Xb(t){return t.replace(B9,"")===""}class zc{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}zc.prototype.normal={};zc.prototype.property={};zc.prototype.space=void 0;function dk(t,e){const n={},r={};for(const o of t)Object.assign(n,o.property),Object.assign(r,o.normal);return new zc(n,r,e)}function og(t){return t.toLowerCase()}class nr{constructor(e,n){this.attribute=n,this.property=e}}nr.prototype.attribute="";nr.prototype.booleanish=!1;nr.prototype.boolean=!1;nr.prototype.commaOrSpaceSeparated=!1;nr.prototype.commaSeparated=!1;nr.prototype.defined=!1;nr.prototype.mustUseProperty=!1;nr.prototype.number=!1;nr.prototype.overloadedBoolean=!1;nr.prototype.property="";nr.prototype.spaceSeparated=!1;nr.prototype.space=void 0;let H9=0;const at=ko(),un=ko(),ag=ko(),Me=ko(),Pt=ko(),Ea=ko(),fr=ko();function ko(){return 2**++H9}const lg=Object.freeze(Object.defineProperty({__proto__:null,boolean:at,booleanish:un,commaOrSpaceSeparated:fr,commaSeparated:Ea,number:Me,overloadedBoolean:ag,spaceSeparated:Pt},Symbol.toStringTag,{value:"Module"})),_m=Object.keys(lg);class gv extends nr{constructor(e,n,r,o){let a=-1;if(super(e,n),Qb(this,"space",o),typeof r=="number")for(;++a<_m.length;){const c=_m[a];Qb(this,_m[a],(r&lg[c])===lg[c])}}}gv.prototype.defined=!0;function Qb(t,e,n){n&&(t[e]=n)}function Ya(t){const e={},n={};for(const[r,o]of Object.entries(t.properties)){const a=new gv(r,t.transform(t.attributes||{},r),o,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),e[r]=a,n[og(r)]=r,n[og(a.attribute)]=r}return new zc(e,n,t.space)}const fk=Ya({properties:{ariaActiveDescendant:null,ariaAtomic:un,ariaAutoComplete:null,ariaBusy:un,ariaChecked:un,ariaColCount:Me,ariaColIndex:Me,ariaColSpan:Me,ariaControls:Pt,ariaCurrent:null,ariaDescribedBy:Pt,ariaDetails:null,ariaDisabled:un,ariaDropEffect:Pt,ariaErrorMessage:null,ariaExpanded:un,ariaFlowTo:Pt,ariaGrabbed:un,ariaHasPopup:null,ariaHidden:un,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Pt,ariaLevel:Me,ariaLive:null,ariaModal:un,ariaMultiLine:un,ariaMultiSelectable:un,ariaOrientation:null,ariaOwns:Pt,ariaPlaceholder:null,ariaPosInSet:Me,ariaPressed:un,ariaReadOnly:un,ariaRelevant:null,ariaRequired:un,ariaRoleDescription:Pt,ariaRowCount:Me,ariaRowIndex:Me,ariaRowSpan:Me,ariaSelected:un,ariaSetSize:Me,ariaSort:null,ariaValueMax:Me,ariaValueMin:Me,ariaValueNow:Me,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function hk(t,e){return e in t?t[e]:e}function pk(t,e){return hk(t,e.toLowerCase())}const U9=Ya({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ea,acceptCharset:Pt,accessKey:Pt,action:null,allow:null,allowFullScreen:at,allowPaymentRequest:at,allowUserMedia:at,alt:null,as:null,async:at,autoCapitalize:null,autoComplete:Pt,autoFocus:at,autoPlay:at,blocking:Pt,capture:null,charSet:null,checked:at,cite:null,className:Pt,cols:Me,colSpan:null,content:null,contentEditable:un,controls:at,controlsList:Pt,coords:Me|Ea,crossOrigin:null,data:null,dateTime:null,decoding:null,default:at,defer:at,dir:null,dirName:null,disabled:at,download:ag,draggable:un,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:at,formTarget:null,headers:Pt,height:Me,hidden:ag,high:Me,href:null,hrefLang:null,htmlFor:Pt,httpEquiv:Pt,id:null,imageSizes:null,imageSrcSet:null,inert:at,inputMode:null,integrity:null,is:null,isMap:at,itemId:null,itemProp:Pt,itemRef:Pt,itemScope:at,itemType:Pt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:at,low:Me,manifest:null,max:null,maxLength:Me,media:null,method:null,min:null,minLength:Me,multiple:at,muted:at,name:null,nonce:null,noModule:at,noValidate:at,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:at,optimum:Me,pattern:null,ping:Pt,placeholder:null,playsInline:at,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:at,referrerPolicy:null,rel:Pt,required:at,reversed:at,rows:Me,rowSpan:Me,sandbox:Pt,scope:null,scoped:at,seamless:at,selected:at,shadowRootClonable:at,shadowRootDelegatesFocus:at,shadowRootMode:null,shape:null,size:Me,sizes:null,slot:null,span:Me,spellCheck:un,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Me,step:null,style:null,tabIndex:Me,target:null,title:null,translate:null,type:null,typeMustMatch:at,useMap:null,value:un,width:Me,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Pt,axis:null,background:null,bgColor:null,border:Me,borderColor:null,bottomMargin:Me,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:at,declare:at,event:null,face:null,frame:null,frameBorder:null,hSpace:Me,leftMargin:Me,link:null,longDesc:null,lowSrc:null,marginHeight:Me,marginWidth:Me,noResize:at,noHref:at,noShade:at,noWrap:at,object:null,profile:null,prompt:null,rev:null,rightMargin:Me,rules:null,scheme:null,scrolling:un,standby:null,summary:null,text:null,topMargin:Me,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Me,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:at,disableRemotePlayback:at,prefix:null,property:null,results:Me,security:null,unselectable:null},space:"html",transform:pk}),$9=Ya({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:fr,accentHeight:Me,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Me,amplitude:Me,arabicForm:null,ascent:Me,attributeName:null,attributeType:null,azimuth:Me,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Me,by:null,calcMode:null,capHeight:Me,className:Pt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Me,diffuseConstant:Me,direction:null,display:null,dur:null,divisor:Me,dominantBaseline:null,download:at,dx:null,dy:null,edgeMode:null,editable:null,elevation:Me,enableBackground:null,end:null,event:null,exponent:Me,externalResourcesRequired:null,fill:null,fillOpacity:Me,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ea,g2:Ea,glyphName:Ea,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Me,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Me,horizOriginX:Me,horizOriginY:Me,id:null,ideographic:Me,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Me,k:Me,k1:Me,k2:Me,k3:Me,k4:Me,kernelMatrix:fr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Me,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Me,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Me,overlineThickness:Me,paintOrder:null,panose1:null,path:null,pathLength:Me,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Pt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Me,pointsAtY:Me,pointsAtZ:Me,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:fr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:fr,rev:fr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:fr,requiredFeatures:fr,requiredFonts:fr,requiredFormats:fr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Me,specularExponent:Me,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Me,strikethroughThickness:Me,string:null,stroke:null,strokeDashArray:fr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Me,strokeOpacity:Me,strokeWidth:null,style:null,surfaceScale:Me,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:fr,tabIndex:Me,tableValues:null,target:null,targetX:Me,targetY:Me,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:fr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Me,underlineThickness:Me,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Me,values:null,vAlphabetic:Me,vMathematical:Me,vectorEffect:null,vHanging:Me,vIdeographic:Me,version:null,vertAdvY:Me,vertOriginX:Me,vertOriginY:Me,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Me,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:hk}),mk=Ya({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),gk=Ya({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:pk}),vk=Ya({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),q9={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},V9=/[A-Z]/g,Zb=/-[a-z]/g,W9=/^data[-\w.:]+$/i;function G9(t,e){const n=og(e);let r=e,o=nr;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&W9.test(e)){if(e.charAt(4)==="-"){const a=e.slice(5).replace(Zb,Y9);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=e.slice(4);if(!Zb.test(a)){let c=a.replace(V9,K9);c.charAt(0)!=="-"&&(c="-"+c),e="data"+c}}o=gv}return new o(r,e)}function K9(t){return"-"+t.toLowerCase()}function Y9(t){return t.charAt(1).toUpperCase()}const X9=dk([fk,U9,mk,gk,vk],"html"),vv=dk([fk,$9,mk,gk,vk],"svg");function Q9(t){return t.join(" ").trim()}var ga={},ym,Jb;function Z9(){if(Jb)return ym;Jb=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
551
+ `,f="/",p="*",h="",_="comment",x="declaration";function C(v,b){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];b=b||{};var y=1,S=1;function k(W){var K=W.match(e);K&&(y+=K.length);var V=W.lastIndexOf(u);S=~V?W.length-V:S+W.length}function T(){var W={line:y,column:S};return function(K){return K.position=new R(W),j(),K}}function R(W){this.start=W,this.end={line:y,column:S},this.source=b.source}R.prototype.content=v;function D(W){var K=new Error(b.source+":"+y+":"+S+": "+W);if(K.reason=W,K.filename=b.source,K.line=y,K.column=S,K.source=v,!b.silent)throw K}function A(W){var K=W.exec(v);if(K){var V=K[0];return k(V),v=v.slice(V.length),K}}function j(){A(n)}function O(W){var K;for(W=W||[];K=P();)K!==!1&&W.push(K);return W}function P(){var W=T();if(!(f!=v.charAt(0)||p!=v.charAt(1))){for(var K=2;h!=v.charAt(K)&&(p!=v.charAt(K)||f!=v.charAt(K+1));)++K;if(K+=2,h===v.charAt(K-1))return D("End of comment missing");var V=v.slice(2,K-2);return S+=2,k(V),v=v.slice(K),S+=2,W({type:_,comment:V})}}function $(){var W=T(),K=A(r);if(K){if(P(),!A(o))return D("property missing ':'");var V=A(a),Q=W({type:x,property:w(K[0].replace(t,h)),value:V?w(V[0].replace(t,h)):h});return A(c),Q}}function U(){var W=[];O(W);for(var K;K=$();)K!==!1&&(W.push(K),O(W));return W}return j(),U()}function w(v){return v?v.replace(l,h):h}return ym=C,ym}var ex;function J9(){if(ex)return ga;ex=1;var t=ga&&ga.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ga,"__esModule",{value:!0}),ga.default=n;const e=t(Z9());function n(r,o){let a=null;if(!r||typeof r!="string")return a;const c=(0,e.default)(r),l=typeof o=="function";return c.forEach(u=>{if(u.type!=="declaration")return;const{property:f,value:p}=u;l?o(f,p,u):p&&(a=a||{},a[f]=p)}),a}return ga}var Xl={},tx;function eP(){if(tx)return Xl;tx=1,Object.defineProperty(Xl,"__esModule",{value:!0}),Xl.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,a=function(f){return!f||n.test(f)||t.test(f)},c=function(f,p){return p.toUpperCase()},l=function(f,p){return"".concat(p,"-")},u=function(f,p){return p===void 0&&(p={}),a(f)?f:(f=f.toLowerCase(),p.reactCompat?f=f.replace(o,l):f=f.replace(r,l),f.replace(e,c))};return Xl.camelCase=u,Xl}var Ql,nx;function tP(){if(nx)return Ql;nx=1;var t=Ql&&Ql.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},e=t(J9()),n=eP();function r(o,a){var c={};return!o||typeof o!="string"||(0,e.default)(o,function(l,u){l&&u&&(c[(0,n.camelCase)(l,a)]=u)}),c}return r.default=r,Ql=r,Ql}var nP=tP();const rP=Gd(nP),_k=yk("end"),_v=yk("start");function yk(t){return e;function e(n){const r=n&&n.position&&n.position[t]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function sP(t){const e=_v(t),n=_k(t);if(e&&n)return{start:e,end:n}}function sc(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?rx(t.position):"start"in t||"end"in t?rx(t):"line"in t||"column"in t?cg(t):""}function cg(t){return sx(t&&t.line)+":"+sx(t&&t.column)}function rx(t){return cg(t&&t.start)+"-"+cg(t&&t.end)}function sx(t){return t&&typeof t=="number"?t:1}class Pn extends Error{constructor(e,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let o="",a={},c=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof e=="string"?o=e:!a.cause&&e&&(c=!0,o=e.message,a.cause=e),!a.ruleId&&!a.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?a.ruleId=r:(a.source=r.slice(0,u),a.ruleId=r.slice(u+1))}if(!a.place&&a.ancestors&&a.ancestors){const u=a.ancestors[a.ancestors.length-1];u&&(a.place=u.position)}const l=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=l?l.line:void 0,this.name=sc(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=c&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Pn.prototype.file="";Pn.prototype.name="";Pn.prototype.reason="";Pn.prototype.message="";Pn.prototype.stack="";Pn.prototype.column=void 0;Pn.prototype.line=void 0;Pn.prototype.ancestors=void 0;Pn.prototype.cause=void 0;Pn.prototype.fatal=void 0;Pn.prototype.place=void 0;Pn.prototype.ruleId=void 0;Pn.prototype.source=void 0;const yv={}.hasOwnProperty,iP=new Map,oP=/[A-Z]/g,aP=new Set(["table","tbody","thead","tfoot","tr"]),lP=new Set(["td","th"]),bk="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function cP(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=e.filePath||void 0;let r;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=vP(n,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=gP(n,e.jsx,e.jsxs)}const o={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:r,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?vv:X9,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},a=xk(o,t,void 0);return a&&typeof a!="string"?a:o.create(t,o.Fragment,{children:a||void 0},void 0)}function xk(t,e,n){if(e.type==="element")return uP(t,e,n);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return dP(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return hP(t,e,n);if(e.type==="mdxjsEsm")return fP(t,e);if(e.type==="root")return pP(t,e,n);if(e.type==="text")return mP(t,e)}function uP(t,e,n){const r=t.schema;let o=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=vv,t.schema=o),t.ancestors.push(e);const a=wk(t,e.tagName,!1),c=_P(t,e);let l=xv(t,e);return aP.has(e.tagName)&&(l=l.filter(function(u){return typeof u=="string"?!F9(u):!0})),Sk(t,c,a,e),bv(c,l),t.ancestors.pop(),t.schema=r,t.create(e,a,c,n)}function dP(t,e){if(e.data&&e.data.estree&&t.evaluater){const r=e.data.estree.body[0];return r.type,t.evaluater.evaluateExpression(r.expression)}vc(t,e.position)}function fP(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);vc(t,e.position)}function hP(t,e,n){const r=t.schema;let o=r;e.name==="svg"&&r.space==="html"&&(o=vv,t.schema=o),t.ancestors.push(e);const a=e.name===null?t.Fragment:wk(t,e.name,!0),c=yP(t,e),l=xv(t,e);return Sk(t,c,a,e),bv(c,l),t.ancestors.pop(),t.schema=r,t.create(e,a,c,n)}function pP(t,e,n){const r={};return bv(r,xv(t,e)),t.create(e,t.Fragment,r,n)}function mP(t,e){return e.value}function Sk(t,e,n,r){typeof n!="string"&&n!==t.Fragment&&t.passNode&&(e.node=r)}function bv(t,e){if(e.length>0){const n=e.length>1?e:e[0];n&&(t.children=n)}}function gP(t,e,n){return r;function r(o,a,c,l){const f=Array.isArray(c.children)?n:e;return l?f(a,c,l):f(a,c)}}function vP(t,e){return n;function n(r,o,a,c){const l=Array.isArray(a.children),u=_v(r);return e(o,a,c,l,{columnNumber:u?u.column-1:void 0,fileName:t,lineNumber:u?u.line:void 0},void 0)}}function _P(t,e){const n={};let r,o;for(o in e.properties)if(o!=="children"&&yv.call(e.properties,o)){const a=bP(t,o,e.properties[o]);if(a){const[c,l]=a;t.tableCellAlignToStyle&&c==="align"&&typeof l=="string"&&lP.has(e.tagName)?r=l:n[c]=l}}if(r){const a=n.style||(n.style={});a[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function yP(t,e){const n={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&t.evaluater){const a=r.data.estree.body[0];a.type;const c=a.expression;c.type;const l=c.properties[0];l.type,Object.assign(n,t.evaluater.evaluateExpression(l.argument))}else vc(t,e.position);else{const o=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&t.evaluater){const l=r.value.data.estree.body[0];l.type,a=t.evaluater.evaluateExpression(l.expression)}else vc(t,e.position);else a=r.value===null?!0:r.value;n[o]=a}return n}function xv(t,e){const n=[];let r=-1;const o=t.passKeys?new Map:iP;for(;++r<e.children.length;){const a=e.children[r];let c;if(t.passKeys){const u=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(u){const f=o.get(u)||0;c=u+"-"+f,o.set(u,f+1)}}const l=xk(t,a,c);l!==void 0&&n.push(l)}return n}function bP(t,e,n){const r=G9(t.schema,e);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?L9(n):Q9(n)),r.property==="style"){let o=typeof n=="object"?n:xP(t,String(n));return t.stylePropertyNameCase==="css"&&(o=SP(o)),["style",o]}return[t.elementAttributeNameCase==="react"&&r.space?q9[r.property]||r.property:r.attribute,n]}}function xP(t,e){try{return rP(e,{reactCompat:!0})}catch(n){if(t.ignoreInvalidStyle)return{};const r=n,o=new Pn("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=t.filePath||void 0,o.url=bk+"#cannot-parse-style-attribute",o}}function wk(t,e,n){let r;if(!n)r={type:"Literal",value:e};else if(e.includes(".")){const o=e.split(".");let a=-1,c;for(;++a<o.length;){const l=Yb(o[a])?{type:"Identifier",name:o[a]}:{type:"Literal",value:o[a]};c=c?{type:"MemberExpression",object:c,property:l,computed:!!(a&&l.type==="Literal"),optional:!1}:l}r=c}else r=Yb(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(r.type==="Literal"){const o=r.value;return yv.call(t.components,o)?t.components[o]:o}if(t.evaluater)return t.evaluater.evaluateExpression(r);vc(t)}function vc(t,e){const n=new Pn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=t.filePath||void 0,n.url=bk+"#cannot-handle-mdx-estrees-without-createevaluater",n}function SP(t){const e={};let n;for(n in t)yv.call(t,n)&&(e[wP(n)]=t[n]);return e}function wP(t){let e=t.replace(oP,CP);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function CP(t){return"-"+t.toLowerCase()}const bm={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},kP={};function Sv(t,e){const n=kP,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Ck(t,r,o)}function Ck(t,e,n){if(EP(t)){if("value"in t)return t.type==="html"&&!n?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return ix(t.children,e,n)}return Array.isArray(t)?ix(t,e,n):""}function ix(t,e,n){const r=[];let o=-1;for(;++o<t.length;)r[o]=Ck(t[o],e,n);return r.join("")}function EP(t){return!!(t&&typeof t=="object")}const ox=document.createElement("i");function wv(t){const e="&"+t+";";ox.innerHTML=e;const n=ox.textContent;return n.charCodeAt(n.length-1)===59&&t!=="semi"||n===e?!1:n}function vr(t,e,n,r){const o=t.length;let a=0,c;if(e<0?e=-e>o?0:o+e:e=e>o?o:e,n=n>0?n:0,r.length<1e4)c=Array.from(r),c.unshift(e,n),t.splice(...c);else for(n&&t.splice(e,n);a<r.length;)c=r.slice(a,a+1e4),c.unshift(e,0),t.splice(...c),a+=1e4,e+=1e4}function Tr(t,e){return t.length>0?(vr(t,t.length,0,e),t):e}const ax={}.hasOwnProperty;function kk(t){const e={};let n=-1;for(;++n<t.length;)AP(e,t[n]);return e}function AP(t,e){let n;for(n in e){const o=(ax.call(t,n)?t[n]:void 0)||(t[n]={}),a=e[n];let c;if(a)for(c in a){ax.call(o,c)||(o[c]=[]);const l=a[c];RP(o[c],Array.isArray(l)?l:l?[l]:[])}}}function RP(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);vr(t,0,0,r)}function Ek(t,e){const n=Number.parseInt(t,e);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Vr(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const qn=ji(/[A-Za-z]/),In=ji(/[\dA-Za-z]/),TP=ji(/[#-'*+\--9=?A-Z^-~]/);function $d(t){return t!==null&&(t<32||t===127)}const ug=ji(/\d/),NP=ji(/[\dA-Fa-f]/),MP=ji(/[!-/:-@[-`{-~]/);function et(t){return t!==null&&t<-2}function Lt(t){return t!==null&&(t<0||t===32)}function ft(t){return t===-2||t===-1||t===32}const zf=ji(new RegExp("\\p{P}|\\p{S}","u")),bo=ji(/\s/);function ji(t){return e;function e(n){return n!==null&&n>-1&&t.test(String.fromCharCode(n))}}function Xa(t){const e=[];let n=-1,r=0,o=0;for(;++n<t.length;){const a=t.charCodeAt(n);let c="";if(a===37&&In(t.charCodeAt(n+1))&&In(t.charCodeAt(n+2)))o=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(c=String.fromCharCode(a));else if(a>55295&&a<57344){const l=t.charCodeAt(n+1);a<56320&&l>56319&&l<57344?(c=String.fromCharCode(a,l),o=1):c="�"}else c=String.fromCharCode(a);c&&(e.push(t.slice(r,n),encodeURIComponent(c)),r=n+o+1,c=""),o&&(n+=o,o=0)}return e.join("")+t.slice(r)}function yt(t,e,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let a=0;return c;function c(u){return ft(u)?(t.enter(n),l(u)):e(u)}function l(u){return ft(u)&&a++<o?(t.consume(u),l):(t.exit(n),e(u))}}const DP={tokenize:jP};function jP(t){const e=t.attempt(this.parser.constructs.contentInitial,r,o);let n;return e;function r(l){if(l===null){t.consume(l);return}return t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),yt(t,e,"linePrefix")}function o(l){return t.enter("paragraph"),a(l)}function a(l){const u=t.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,c(l)}function c(l){if(l===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(l);return}return et(l)?(t.consume(l),t.exit("chunkText"),a):(t.consume(l),c)}}const OP={tokenize:LP},lx={tokenize:IP};function LP(t){const e=this,n=[];let r=0,o,a,c;return l;function l(S){if(r<n.length){const k=n[r];return e.containerState=k[1],t.attempt(k[0].continuation,u,f)(S)}return f(S)}function u(S){if(r++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,o&&y();const k=e.events.length;let T=k,R;for(;T--;)if(e.events[T][0]==="exit"&&e.events[T][1].type==="chunkFlow"){R=e.events[T][1].end;break}b(r);let D=k;for(;D<e.events.length;)e.events[D][1].end={...R},D++;return vr(e.events,T+1,0,e.events.slice(k)),e.events.length=D,f(S)}return l(S)}function f(S){if(r===n.length){if(!o)return _(S);if(o.currentConstruct&&o.currentConstruct.concrete)return C(S);e.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(lx,p,h)(S)}function p(S){return o&&y(),b(r),_(S)}function h(S){return e.parser.lazy[e.now().line]=r!==n.length,c=e.now().offset,C(S)}function _(S){return e.containerState={},t.attempt(lx,x,C)(S)}function x(S){return r++,n.push([e.currentConstruct,e.containerState]),_(S)}function C(S){if(S===null){o&&y(),b(0),t.consume(S);return}return o=o||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:a}),w(S)}function w(S){if(S===null){v(t.exit("chunkFlow"),!0),b(0),t.consume(S);return}return et(S)?(t.consume(S),v(t.exit("chunkFlow")),r=0,e.interrupt=void 0,l):(t.consume(S),w)}function v(S,k){const T=e.sliceStream(S);if(k&&T.push(null),S.previous=a,a&&(a.next=S),a=S,o.defineSkip(S.start),o.write(T),e.parser.lazy[S.start.line]){let R=o.events.length;for(;R--;)if(o.events[R][1].start.offset<c&&(!o.events[R][1].end||o.events[R][1].end.offset>c))return;const D=e.events.length;let A=D,j,O;for(;A--;)if(e.events[A][0]==="exit"&&e.events[A][1].type==="chunkFlow"){if(j){O=e.events[A][1].end;break}j=!0}for(b(r),R=D;R<e.events.length;)e.events[R][1].end={...O},R++;vr(e.events,A+1,0,e.events.slice(D)),e.events.length=R}}function b(S){let k=n.length;for(;k-- >S;){const T=n[k];e.containerState=T[1],T[0].exit.call(e,t)}n.length=S}function y(){o.write([null]),a=void 0,o=void 0,e.containerState._closeFlow=void 0}}function IP(t,e,n){return yt(t,t.attempt(this.parser.constructs.document,e,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Da(t){if(t===null||Lt(t)||bo(t))return 1;if(zf(t))return 2}function Bf(t,e,n){const r=[];let o=-1;for(;++o<t.length;){const a=t[o].resolveAll;a&&!r.includes(a)&&(e=a(e,n),r.push(a))}return e}const dg={name:"attention",resolveAll:PP,tokenize:zP};function PP(t,e){let n=-1,r,o,a,c,l,u,f,p;for(;++n<t.length;)if(t[n][0]==="enter"&&t[n][1].type==="attentionSequence"&&t[n][1]._close){for(r=n;r--;)if(t[r][0]==="exit"&&t[r][1].type==="attentionSequence"&&t[r][1]._open&&e.sliceSerialize(t[r][1]).charCodeAt(0)===e.sliceSerialize(t[n][1]).charCodeAt(0)){if((t[r][1]._close||t[n][1]._open)&&(t[n][1].end.offset-t[n][1].start.offset)%3&&!((t[r][1].end.offset-t[r][1].start.offset+t[n][1].end.offset-t[n][1].start.offset)%3))continue;u=t[r][1].end.offset-t[r][1].start.offset>1&&t[n][1].end.offset-t[n][1].start.offset>1?2:1;const h={...t[r][1].end},_={...t[n][1].start};cx(h,-u),cx(_,u),c={type:u>1?"strongSequence":"emphasisSequence",start:h,end:{...t[r][1].end}},l={type:u>1?"strongSequence":"emphasisSequence",start:{...t[n][1].start},end:_},a={type:u>1?"strongText":"emphasisText",start:{...t[r][1].end},end:{...t[n][1].start}},o={type:u>1?"strong":"emphasis",start:{...c.start},end:{...l.end}},t[r][1].end={...c.start},t[n][1].start={...l.end},f=[],t[r][1].end.offset-t[r][1].start.offset&&(f=Tr(f,[["enter",t[r][1],e],["exit",t[r][1],e]])),f=Tr(f,[["enter",o,e],["enter",c,e],["exit",c,e],["enter",a,e]]),f=Tr(f,Bf(e.parser.constructs.insideSpan.null,t.slice(r+1,n),e)),f=Tr(f,[["exit",a,e],["enter",l,e],["exit",l,e],["exit",o,e]]),t[n][1].end.offset-t[n][1].start.offset?(p=2,f=Tr(f,[["enter",t[n][1],e],["exit",t[n][1],e]])):p=0,vr(t,r-1,n-r+3,f),n=r+f.length-p-2;break}}for(n=-1;++n<t.length;)t[n][1].type==="attentionSequence"&&(t[n][1].type="data");return t}function zP(t,e){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=Da(r);let a;return c;function c(u){return a=u,t.enter("attentionSequence"),l(u)}function l(u){if(u===a)return t.consume(u),l;const f=t.exit("attentionSequence"),p=Da(u),h=!p||p===2&&o||n.includes(u),_=!o||o===2&&p||n.includes(r);return f._open=!!(a===42?h:h&&(o||!_)),f._close=!!(a===42?_:_&&(p||!h)),e(u)}}function cx(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const BP={name:"autolink",tokenize:FP};function FP(t,e,n){let r=0;return o;function o(x){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(x),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),a}function a(x){return qn(x)?(t.consume(x),c):x===64?n(x):f(x)}function c(x){return x===43||x===45||x===46||In(x)?(r=1,l(x)):f(x)}function l(x){return x===58?(t.consume(x),r=0,u):(x===43||x===45||x===46||In(x))&&r++<32?(t.consume(x),l):(r=0,f(x))}function u(x){return x===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(x),t.exit("autolinkMarker"),t.exit("autolink"),e):x===null||x===32||x===60||$d(x)?n(x):(t.consume(x),u)}function f(x){return x===64?(t.consume(x),p):TP(x)?(t.consume(x),f):n(x)}function p(x){return In(x)?h(x):n(x)}function h(x){return x===46?(t.consume(x),r=0,p):x===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(x),t.exit("autolinkMarker"),t.exit("autolink"),e):_(x)}function _(x){if((x===45||In(x))&&r++<63){const C=x===45?_:h;return t.consume(x),C}return n(x)}}const Bc={partial:!0,tokenize:HP};function HP(t,e,n){return r;function r(a){return ft(a)?yt(t,o,"linePrefix")(a):o(a)}function o(a){return a===null||et(a)?e(a):n(a)}}const Ak={continuation:{tokenize:$P},exit:qP,name:"blockQuote",tokenize:UP};function UP(t,e,n){const r=this;return o;function o(c){if(c===62){const l=r.containerState;return l.open||(t.enter("blockQuote",{_container:!0}),l.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(c),t.exit("blockQuoteMarker"),a}return n(c)}function a(c){return ft(c)?(t.enter("blockQuotePrefixWhitespace"),t.consume(c),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(c))}}function $P(t,e,n){const r=this;return o;function o(c){return ft(c)?yt(t,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):a(c)}function a(c){return t.attempt(Ak,e,n)(c)}}function qP(t){t.exit("blockQuote")}const Rk={name:"characterEscape",tokenize:VP};function VP(t,e,n){return r;function r(a){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(a),t.exit("escapeMarker"),o}function o(a){return MP(a)?(t.enter("characterEscapeValue"),t.consume(a),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):n(a)}}const Tk={name:"characterReference",tokenize:WP};function WP(t,e,n){const r=this;let o=0,a,c;return l;function l(h){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(h),t.exit("characterReferenceMarker"),u}function u(h){return h===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(h),t.exit("characterReferenceMarkerNumeric"),f):(t.enter("characterReferenceValue"),a=31,c=In,p(h))}function f(h){return h===88||h===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(h),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),a=6,c=NP,p):(t.enter("characterReferenceValue"),a=7,c=ug,p(h))}function p(h){if(h===59&&o){const _=t.exit("characterReferenceValue");return c===In&&!wv(r.sliceSerialize(_))?n(h):(t.enter("characterReferenceMarker"),t.consume(h),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return c(h)&&o++<a?(t.consume(h),p):n(h)}}const ux={partial:!0,tokenize:KP},dx={concrete:!0,name:"codeFenced",tokenize:GP};function GP(t,e,n){const r=this,o={partial:!0,tokenize:T};let a=0,c=0,l;return u;function u(R){return f(R)}function f(R){const D=r.events[r.events.length-1];return a=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,l=R,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),p(R)}function p(R){return R===l?(c++,t.consume(R),p):c<3?n(R):(t.exit("codeFencedFenceSequence"),ft(R)?yt(t,h,"whitespace")(R):h(R))}function h(R){return R===null||et(R)?(t.exit("codeFencedFence"),r.interrupt?e(R):t.check(ux,w,k)(R)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),_(R))}function _(R){return R===null||et(R)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),h(R)):ft(R)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),yt(t,x,"whitespace")(R)):R===96&&R===l?n(R):(t.consume(R),_)}function x(R){return R===null||et(R)?h(R):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),C(R))}function C(R){return R===null||et(R)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),h(R)):R===96&&R===l?n(R):(t.consume(R),C)}function w(R){return t.attempt(o,k,v)(R)}function v(R){return t.enter("lineEnding"),t.consume(R),t.exit("lineEnding"),b}function b(R){return a>0&&ft(R)?yt(t,y,"linePrefix",a+1)(R):y(R)}function y(R){return R===null||et(R)?t.check(ux,w,k)(R):(t.enter("codeFlowValue"),S(R))}function S(R){return R===null||et(R)?(t.exit("codeFlowValue"),y(R)):(t.consume(R),S)}function k(R){return t.exit("codeFenced"),e(R)}function T(R,D,A){let j=0;return O;function O(K){return R.enter("lineEnding"),R.consume(K),R.exit("lineEnding"),P}function P(K){return R.enter("codeFencedFence"),ft(K)?yt(R,$,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(K):$(K)}function $(K){return K===l?(R.enter("codeFencedFenceSequence"),U(K)):A(K)}function U(K){return K===l?(j++,R.consume(K),U):j>=c?(R.exit("codeFencedFenceSequence"),ft(K)?yt(R,W,"whitespace")(K):W(K)):A(K)}function W(K){return K===null||et(K)?(R.exit("codeFencedFence"),D(K)):A(K)}}}function KP(t,e,n){const r=this;return o;function o(c){return c===null?n(c):(t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),a)}function a(c){return r.parser.lazy[r.now().line]?n(c):e(c)}}const xm={name:"codeIndented",tokenize:XP},YP={partial:!0,tokenize:QP};function XP(t,e,n){const r=this;return o;function o(f){return t.enter("codeIndented"),yt(t,a,"linePrefix",5)(f)}function a(f){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?c(f):n(f)}function c(f){return f===null?u(f):et(f)?t.attempt(YP,c,u)(f):(t.enter("codeFlowValue"),l(f))}function l(f){return f===null||et(f)?(t.exit("codeFlowValue"),c(f)):(t.consume(f),l)}function u(f){return t.exit("codeIndented"),e(f)}}function QP(t,e,n){const r=this;return o;function o(c){return r.parser.lazy[r.now().line]?n(c):et(c)?(t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),o):yt(t,a,"linePrefix",5)(c)}function a(c){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?e(c):et(c)?o(c):n(c)}}const ZP={name:"codeText",previous:ez,resolve:JP,tokenize:tz};function JP(t){let e=t.length-4,n=3,r,o;if((t[n][1].type==="lineEnding"||t[n][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(r=n;++r<e;)if(t[r][1].type==="codeTextData"){t[n][1].type="codeTextPadding",t[e][1].type="codeTextPadding",n+=2,e-=2;break}}for(r=n-1,e++;++r<=e;)o===void 0?r!==e&&t[r][1].type!=="lineEnding"&&(o=r):(r===e||t[r][1].type==="lineEnding")&&(t[o][1].type="codeTextData",r!==o+2&&(t[o][1].end=t[r-1][1].end,t.splice(o+2,r-o-2),e-=r-o-2,r=o+2),o=void 0);return t}function ez(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function tz(t,e,n){let r=0,o,a;return c;function c(h){return t.enter("codeText"),t.enter("codeTextSequence"),l(h)}function l(h){return h===96?(t.consume(h),r++,l):(t.exit("codeTextSequence"),u(h))}function u(h){return h===null?n(h):h===32?(t.enter("space"),t.consume(h),t.exit("space"),u):h===96?(a=t.enter("codeTextSequence"),o=0,p(h)):et(h)?(t.enter("lineEnding"),t.consume(h),t.exit("lineEnding"),u):(t.enter("codeTextData"),f(h))}function f(h){return h===null||h===32||h===96||et(h)?(t.exit("codeTextData"),u(h)):(t.consume(h),f)}function p(h){return h===96?(t.consume(h),o++,p):o===r?(t.exit("codeTextSequence"),t.exit("codeText"),e(h)):(a.type="codeTextData",f(h))}}class nz{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,n){const r=n==null?Number.POSITIVE_INFINITY:n;return r<this.left.length?this.left.slice(e,r):e>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(e,n,r){const o=n||0;this.setCursor(Math.trunc(e));const a=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return r&&Zl(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Zl(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Zl(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const n=this.left.splice(e,Number.POSITIVE_INFINITY);Zl(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Zl(this.left,n.reverse())}}}function Zl(t,e){let n=0;if(e.length<1e4)t.push(...e);else for(;n<e.length;)t.push(...e.slice(n,n+1e4)),n+=1e4}function Nk(t){const e={};let n=-1,r,o,a,c,l,u,f;const p=new nz(t);for(;++n<p.length;){for(;n in e;)n=e[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,a=0,a<u.length&&u[a][1].type==="lineEndingBlank"&&(a+=2),a<u.length&&u[a][1].type==="content"))for(;++a<u.length&&u[a][1].type!=="content";)u[a][1].type==="chunkText"&&(u[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(e,rz(p,n)),n=e[n],f=!0);else if(r[1]._container){for(a=n,o=void 0;a--;)if(c=p.get(a),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(o&&(p.get(o)[1].type="lineEndingBlank"),c[1].type="lineEnding",o=a);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;o&&(r[1].end={...p.get(o)[1].start},l=p.slice(o,n),l.unshift(r),p.splice(o,n-o+1,l))}}return vr(t,0,Number.POSITIVE_INFINITY,p.slice(0)),!f}function rz(t,e){const n=t.get(e)[1],r=t.get(e)[2];let o=e-1;const a=[];let c=n._tokenizer;c||(c=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const l=c.events,u=[],f={};let p,h,_=-1,x=n,C=0,w=0;const v=[w];for(;x;){for(;t.get(++o)[1]!==x;);a.push(o),x._tokenizer||(p=r.sliceStream(x),x.next||p.push(null),h&&c.defineSkip(x.start),x._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(p),x._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),h=x,x=x.next}for(x=n;++_<l.length;)l[_][0]==="exit"&&l[_-1][0]==="enter"&&l[_][1].type===l[_-1][1].type&&l[_][1].start.line!==l[_][1].end.line&&(w=_+1,v.push(w),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(c.events=[],x?(x._tokenizer=void 0,x.previous=void 0):v.pop(),_=v.length;_--;){const b=l.slice(v[_],v[_+1]),y=a.pop();u.push([y,y+b.length-1]),t.splice(y,2,b)}for(u.reverse(),_=-1;++_<u.length;)f[C+u[_][0]]=C+u[_][1],C+=u[_][1]-u[_][0]-1;return f}const sz={resolve:oz,tokenize:az},iz={partial:!0,tokenize:lz};function oz(t){return Nk(t),t}function az(t,e){let n;return r;function r(l){return t.enter("content"),n=t.enter("chunkContent",{contentType:"content"}),o(l)}function o(l){return l===null?a(l):et(l)?t.check(iz,c,a)(l):(t.consume(l),o)}function a(l){return t.exit("chunkContent"),t.exit("content"),e(l)}function c(l){return t.consume(l),t.exit("chunkContent"),n.next=t.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,o}}function lz(t,e,n){const r=this;return o;function o(c){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),yt(t,a,"linePrefix")}function a(c){if(c===null||et(c))return n(c);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?e(c):t.interrupt(r.parser.constructs.flow,n,e)(c)}}function Mk(t,e,n,r,o,a,c,l,u){const f=u||Number.POSITIVE_INFINITY;let p=0;return h;function h(b){return b===60?(t.enter(r),t.enter(o),t.enter(a),t.consume(b),t.exit(a),_):b===null||b===32||b===41||$d(b)?n(b):(t.enter(r),t.enter(c),t.enter(l),t.enter("chunkString",{contentType:"string"}),w(b))}function _(b){return b===62?(t.enter(a),t.consume(b),t.exit(a),t.exit(o),t.exit(r),e):(t.enter(l),t.enter("chunkString",{contentType:"string"}),x(b))}function x(b){return b===62?(t.exit("chunkString"),t.exit(l),_(b)):b===null||b===60||et(b)?n(b):(t.consume(b),b===92?C:x)}function C(b){return b===60||b===62||b===92?(t.consume(b),x):x(b)}function w(b){return!p&&(b===null||b===41||Lt(b))?(t.exit("chunkString"),t.exit(l),t.exit(c),t.exit(r),e(b)):p<f&&b===40?(t.consume(b),p++,w):b===41?(t.consume(b),p--,w):b===null||b===32||b===40||$d(b)?n(b):(t.consume(b),b===92?v:w)}function v(b){return b===40||b===41||b===92?(t.consume(b),w):w(b)}}function Dk(t,e,n,r,o,a){const c=this;let l=0,u;return f;function f(x){return t.enter(r),t.enter(o),t.consume(x),t.exit(o),t.enter(a),p}function p(x){return l>999||x===null||x===91||x===93&&!u||x===94&&!l&&"_hiddenFootnoteSupport"in c.parser.constructs?n(x):x===93?(t.exit(a),t.enter(o),t.consume(x),t.exit(o),t.exit(r),e):et(x)?(t.enter("lineEnding"),t.consume(x),t.exit("lineEnding"),p):(t.enter("chunkString",{contentType:"string"}),h(x))}function h(x){return x===null||x===91||x===93||et(x)||l++>999?(t.exit("chunkString"),p(x)):(t.consume(x),u||(u=!ft(x)),x===92?_:h)}function _(x){return x===91||x===92||x===93?(t.consume(x),l++,h):h(x)}}function jk(t,e,n,r,o,a){let c;return l;function l(_){return _===34||_===39||_===40?(t.enter(r),t.enter(o),t.consume(_),t.exit(o),c=_===40?41:_,u):n(_)}function u(_){return _===c?(t.enter(o),t.consume(_),t.exit(o),t.exit(r),e):(t.enter(a),f(_))}function f(_){return _===c?(t.exit(a),u(c)):_===null?n(_):et(_)?(t.enter("lineEnding"),t.consume(_),t.exit("lineEnding"),yt(t,f,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),p(_))}function p(_){return _===c||_===null||et(_)?(t.exit("chunkString"),f(_)):(t.consume(_),_===92?h:p)}function h(_){return _===c||_===92?(t.consume(_),p):p(_)}}function ic(t,e){let n;return r;function r(o){return et(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),n=!0,r):ft(o)?yt(t,r,n?"linePrefix":"lineSuffix")(o):e(o)}}const cz={name:"definition",tokenize:dz},uz={partial:!0,tokenize:fz};function dz(t,e,n){const r=this;let o;return a;function a(x){return t.enter("definition"),c(x)}function c(x){return Dk.call(r,t,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function l(x){return o=Vr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),x===58?(t.enter("definitionMarker"),t.consume(x),t.exit("definitionMarker"),u):n(x)}function u(x){return Lt(x)?ic(t,f)(x):f(x)}function f(x){return Mk(t,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function p(x){return t.attempt(uz,h,h)(x)}function h(x){return ft(x)?yt(t,_,"whitespace")(x):_(x)}function _(x){return x===null||et(x)?(t.exit("definition"),r.parser.defined.push(o),e(x)):n(x)}}function fz(t,e,n){return r;function r(l){return Lt(l)?ic(t,o)(l):n(l)}function o(l){return jk(t,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return ft(l)?yt(t,c,"whitespace")(l):c(l)}function c(l){return l===null||et(l)?e(l):n(l)}}const hz={name:"hardBreakEscape",tokenize:pz};function pz(t,e,n){return r;function r(a){return t.enter("hardBreakEscape"),t.consume(a),o}function o(a){return et(a)?(t.exit("hardBreakEscape"),e(a)):n(a)}}const mz={name:"headingAtx",resolve:gz,tokenize:vz};function gz(t,e){let n=t.length-2,r=3,o,a;return t[r][1].type==="whitespace"&&(r+=2),n-2>r&&t[n][1].type==="whitespace"&&(n-=2),t[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&t[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(o={type:"atxHeadingText",start:t[r][1].start,end:t[n][1].end},a={type:"chunkText",start:t[r][1].start,end:t[n][1].end,contentType:"text"},vr(t,r,n-r+1,[["enter",o,e],["enter",a,e],["exit",a,e],["exit",o,e]])),t}function vz(t,e,n){let r=0;return o;function o(p){return t.enter("atxHeading"),a(p)}function a(p){return t.enter("atxHeadingSequence"),c(p)}function c(p){return p===35&&r++<6?(t.consume(p),c):p===null||Lt(p)?(t.exit("atxHeadingSequence"),l(p)):n(p)}function l(p){return p===35?(t.enter("atxHeadingSequence"),u(p)):p===null||et(p)?(t.exit("atxHeading"),e(p)):ft(p)?yt(t,l,"whitespace")(p):(t.enter("atxHeadingText"),f(p))}function u(p){return p===35?(t.consume(p),u):(t.exit("atxHeadingSequence"),l(p))}function f(p){return p===null||p===35||Lt(p)?(t.exit("atxHeadingText"),l(p)):(t.consume(p),f)}}const _z=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],fx=["pre","script","style","textarea"],yz={concrete:!0,name:"htmlFlow",resolveTo:Sz,tokenize:wz},bz={partial:!0,tokenize:kz},xz={partial:!0,tokenize:Cz};function Sz(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function wz(t,e,n){const r=this;let o,a,c,l,u;return f;function f(B){return p(B)}function p(B){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(B),h}function h(B){return B===33?(t.consume(B),_):B===47?(t.consume(B),a=!0,w):B===63?(t.consume(B),o=3,r.interrupt?e:L):qn(B)?(t.consume(B),c=String.fromCharCode(B),v):n(B)}function _(B){return B===45?(t.consume(B),o=2,x):B===91?(t.consume(B),o=5,l=0,C):qn(B)?(t.consume(B),o=4,r.interrupt?e:L):n(B)}function x(B){return B===45?(t.consume(B),r.interrupt?e:L):n(B)}function C(B){const Y="CDATA[";return B===Y.charCodeAt(l++)?(t.consume(B),l===Y.length?r.interrupt?e:$:C):n(B)}function w(B){return qn(B)?(t.consume(B),c=String.fromCharCode(B),v):n(B)}function v(B){if(B===null||B===47||B===62||Lt(B)){const Y=B===47,ee=c.toLowerCase();return!Y&&!a&&fx.includes(ee)?(o=1,r.interrupt?e(B):$(B)):_z.includes(c.toLowerCase())?(o=6,Y?(t.consume(B),b):r.interrupt?e(B):$(B)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(B):a?y(B):S(B))}return B===45||In(B)?(t.consume(B),c+=String.fromCharCode(B),v):n(B)}function b(B){return B===62?(t.consume(B),r.interrupt?e:$):n(B)}function y(B){return ft(B)?(t.consume(B),y):O(B)}function S(B){return B===47?(t.consume(B),O):B===58||B===95||qn(B)?(t.consume(B),k):ft(B)?(t.consume(B),S):O(B)}function k(B){return B===45||B===46||B===58||B===95||In(B)?(t.consume(B),k):T(B)}function T(B){return B===61?(t.consume(B),R):ft(B)?(t.consume(B),T):S(B)}function R(B){return B===null||B===60||B===61||B===62||B===96?n(B):B===34||B===39?(t.consume(B),u=B,D):ft(B)?(t.consume(B),R):A(B)}function D(B){return B===u?(t.consume(B),u=null,j):B===null||et(B)?n(B):(t.consume(B),D)}function A(B){return B===null||B===34||B===39||B===47||B===60||B===61||B===62||B===96||Lt(B)?T(B):(t.consume(B),A)}function j(B){return B===47||B===62||ft(B)?S(B):n(B)}function O(B){return B===62?(t.consume(B),P):n(B)}function P(B){return B===null||et(B)?$(B):ft(B)?(t.consume(B),P):n(B)}function $(B){return B===45&&o===2?(t.consume(B),V):B===60&&o===1?(t.consume(B),Q):B===62&&o===4?(t.consume(B),z):B===63&&o===3?(t.consume(B),L):B===93&&o===5?(t.consume(B),I):et(B)&&(o===6||o===7)?(t.exit("htmlFlowData"),t.check(bz,F,U)(B)):B===null||et(B)?(t.exit("htmlFlowData"),U(B)):(t.consume(B),$)}function U(B){return t.check(xz,W,F)(B)}function W(B){return t.enter("lineEnding"),t.consume(B),t.exit("lineEnding"),K}function K(B){return B===null||et(B)?U(B):(t.enter("htmlFlowData"),$(B))}function V(B){return B===45?(t.consume(B),L):$(B)}function Q(B){return B===47?(t.consume(B),c="",X):$(B)}function X(B){if(B===62){const Y=c.toLowerCase();return fx.includes(Y)?(t.consume(B),z):$(B)}return qn(B)&&c.length<8?(t.consume(B),c+=String.fromCharCode(B),X):$(B)}function I(B){return B===93?(t.consume(B),L):$(B)}function L(B){return B===62?(t.consume(B),z):B===45&&o===2?(t.consume(B),L):$(B)}function z(B){return B===null||et(B)?(t.exit("htmlFlowData"),F(B)):(t.consume(B),z)}function F(B){return t.exit("htmlFlow"),e(B)}}function Cz(t,e,n){const r=this;return o;function o(c){return et(c)?(t.enter("lineEnding"),t.consume(c),t.exit("lineEnding"),a):n(c)}function a(c){return r.parser.lazy[r.now().line]?n(c):e(c)}}function kz(t,e,n){return r;function r(o){return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),t.attempt(Bc,e,n)}}const Ez={name:"htmlText",tokenize:Az};function Az(t,e,n){const r=this;let o,a,c;return l;function l(L){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(L),u}function u(L){return L===33?(t.consume(L),f):L===47?(t.consume(L),T):L===63?(t.consume(L),S):qn(L)?(t.consume(L),A):n(L)}function f(L){return L===45?(t.consume(L),p):L===91?(t.consume(L),a=0,C):qn(L)?(t.consume(L),y):n(L)}function p(L){return L===45?(t.consume(L),x):n(L)}function h(L){return L===null?n(L):L===45?(t.consume(L),_):et(L)?(c=h,Q(L)):(t.consume(L),h)}function _(L){return L===45?(t.consume(L),x):h(L)}function x(L){return L===62?V(L):L===45?_(L):h(L)}function C(L){const z="CDATA[";return L===z.charCodeAt(a++)?(t.consume(L),a===z.length?w:C):n(L)}function w(L){return L===null?n(L):L===93?(t.consume(L),v):et(L)?(c=w,Q(L)):(t.consume(L),w)}function v(L){return L===93?(t.consume(L),b):w(L)}function b(L){return L===62?V(L):L===93?(t.consume(L),b):w(L)}function y(L){return L===null||L===62?V(L):et(L)?(c=y,Q(L)):(t.consume(L),y)}function S(L){return L===null?n(L):L===63?(t.consume(L),k):et(L)?(c=S,Q(L)):(t.consume(L),S)}function k(L){return L===62?V(L):S(L)}function T(L){return qn(L)?(t.consume(L),R):n(L)}function R(L){return L===45||In(L)?(t.consume(L),R):D(L)}function D(L){return et(L)?(c=D,Q(L)):ft(L)?(t.consume(L),D):V(L)}function A(L){return L===45||In(L)?(t.consume(L),A):L===47||L===62||Lt(L)?j(L):n(L)}function j(L){return L===47?(t.consume(L),V):L===58||L===95||qn(L)?(t.consume(L),O):et(L)?(c=j,Q(L)):ft(L)?(t.consume(L),j):V(L)}function O(L){return L===45||L===46||L===58||L===95||In(L)?(t.consume(L),O):P(L)}function P(L){return L===61?(t.consume(L),$):et(L)?(c=P,Q(L)):ft(L)?(t.consume(L),P):j(L)}function $(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(t.consume(L),o=L,U):et(L)?(c=$,Q(L)):ft(L)?(t.consume(L),$):(t.consume(L),W)}function U(L){return L===o?(t.consume(L),o=void 0,K):L===null?n(L):et(L)?(c=U,Q(L)):(t.consume(L),U)}function W(L){return L===null||L===34||L===39||L===60||L===61||L===96?n(L):L===47||L===62||Lt(L)?j(L):(t.consume(L),W)}function K(L){return L===47||L===62||Lt(L)?j(L):n(L)}function V(L){return L===62?(t.consume(L),t.exit("htmlTextData"),t.exit("htmlText"),e):n(L)}function Q(L){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(L),t.exit("lineEnding"),X}function X(L){return ft(L)?yt(t,I,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):I(L)}function I(L){return t.enter("htmlTextData"),c(L)}}const Cv={name:"labelEnd",resolveAll:Mz,resolveTo:Dz,tokenize:jz},Rz={tokenize:Oz},Tz={tokenize:Lz},Nz={tokenize:Iz};function Mz(t){let e=-1;const n=[];for(;++e<t.length;){const r=t[e][1];if(n.push(t[e]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const o=r.type==="labelImage"?4:2;r.type="data",e+=o}}return t.length!==n.length&&vr(t,0,t.length,n),t}function Dz(t,e){let n=t.length,r=0,o,a,c,l;for(;n--;)if(o=t[n][1],a){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;t[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(c){if(t[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(a=n,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(c=n);const u={type:t[a][1].type==="labelLink"?"link":"image",start:{...t[a][1].start},end:{...t[t.length-1][1].end}},f={type:"label",start:{...t[a][1].start},end:{...t[c][1].end}},p={type:"labelText",start:{...t[a+r+2][1].end},end:{...t[c-2][1].start}};return l=[["enter",u,e],["enter",f,e]],l=Tr(l,t.slice(a+1,a+r+3)),l=Tr(l,[["enter",p,e]]),l=Tr(l,Bf(e.parser.constructs.insideSpan.null,t.slice(a+r+4,c-3),e)),l=Tr(l,[["exit",p,e],t[c-2],t[c-1],["exit",f,e]]),l=Tr(l,t.slice(c+1)),l=Tr(l,[["exit",u,e]]),vr(t,a,t.length,l),t}function jz(t,e,n){const r=this;let o=r.events.length,a,c;for(;o--;)if((r.events[o][1].type==="labelImage"||r.events[o][1].type==="labelLink")&&!r.events[o][1]._balanced){a=r.events[o][1];break}return l;function l(_){return a?a._inactive?h(_):(c=r.parser.defined.includes(Vr(r.sliceSerialize({start:a.end,end:r.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(_),t.exit("labelMarker"),t.exit("labelEnd"),u):n(_)}function u(_){return _===40?t.attempt(Rz,p,c?p:h)(_):_===91?t.attempt(Tz,p,c?f:h)(_):c?p(_):h(_)}function f(_){return t.attempt(Nz,p,h)(_)}function p(_){return e(_)}function h(_){return a._balanced=!0,n(_)}}function Oz(t,e,n){return r;function r(h){return t.enter("resource"),t.enter("resourceMarker"),t.consume(h),t.exit("resourceMarker"),o}function o(h){return Lt(h)?ic(t,a)(h):a(h)}function a(h){return h===41?p(h):Mk(t,c,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function c(h){return Lt(h)?ic(t,u)(h):p(h)}function l(h){return n(h)}function u(h){return h===34||h===39||h===40?jk(t,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):p(h)}function f(h){return Lt(h)?ic(t,p)(h):p(h)}function p(h){return h===41?(t.enter("resourceMarker"),t.consume(h),t.exit("resourceMarker"),t.exit("resource"),e):n(h)}}function Lz(t,e,n){const r=this;return o;function o(l){return Dk.call(r,t,a,c,"reference","referenceMarker","referenceString")(l)}function a(l){return r.parser.defined.includes(Vr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?e(l):n(l)}function c(l){return n(l)}}function Iz(t,e,n){return r;function r(a){return t.enter("reference"),t.enter("referenceMarker"),t.consume(a),t.exit("referenceMarker"),o}function o(a){return a===93?(t.enter("referenceMarker"),t.consume(a),t.exit("referenceMarker"),t.exit("reference"),e):n(a)}}const Pz={name:"labelStartImage",resolveAll:Cv.resolveAll,tokenize:zz};function zz(t,e,n){const r=this;return o;function o(l){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(l),t.exit("labelImageMarker"),a}function a(l){return l===91?(t.enter("labelMarker"),t.consume(l),t.exit("labelMarker"),t.exit("labelImage"),c):n(l)}function c(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):e(l)}}const Bz={name:"labelStartLink",resolveAll:Cv.resolveAll,tokenize:Fz};function Fz(t,e,n){const r=this;return o;function o(c){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(c),t.exit("labelMarker"),t.exit("labelLink"),a}function a(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):e(c)}}const Sm={name:"lineEnding",tokenize:Hz};function Hz(t,e){return n;function n(r){return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),yt(t,e,"linePrefix")}}const Sd={name:"thematicBreak",tokenize:Uz};function Uz(t,e,n){let r=0,o;return a;function a(f){return t.enter("thematicBreak"),c(f)}function c(f){return o=f,l(f)}function l(f){return f===o?(t.enter("thematicBreakSequence"),u(f)):r>=3&&(f===null||et(f))?(t.exit("thematicBreak"),e(f)):n(f)}function u(f){return f===o?(t.consume(f),r++,u):(t.exit("thematicBreakSequence"),ft(f)?yt(t,l,"whitespace")(f):l(f))}}const tr={continuation:{tokenize:Wz},exit:Kz,name:"list",tokenize:Vz},$z={partial:!0,tokenize:Yz},qz={partial:!0,tokenize:Gz};function Vz(t,e,n){const r=this,o=r.events[r.events.length-1];let a=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,c=0;return l;function l(x){const C=r.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(C==="listUnordered"?!r.containerState.marker||x===r.containerState.marker:ug(x)){if(r.containerState.type||(r.containerState.type=C,t.enter(C,{_container:!0})),C==="listUnordered")return t.enter("listItemPrefix"),x===42||x===45?t.check(Sd,n,f)(x):f(x);if(!r.interrupt||x===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),u(x)}return n(x)}function u(x){return ug(x)&&++c<10?(t.consume(x),u):(!r.interrupt||c<2)&&(r.containerState.marker?x===r.containerState.marker:x===41||x===46)?(t.exit("listItemValue"),f(x)):n(x)}function f(x){return t.enter("listItemMarker"),t.consume(x),t.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||x,t.check(Bc,r.interrupt?n:p,t.attempt($z,_,h))}function p(x){return r.containerState.initialBlankLine=!0,a++,_(x)}function h(x){return ft(x)?(t.enter("listItemPrefixWhitespace"),t.consume(x),t.exit("listItemPrefixWhitespace"),_):n(x)}function _(x){return r.containerState.size=a+r.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(x)}}function Wz(t,e,n){const r=this;return r.containerState._closeFlow=void 0,t.check(Bc,o,a);function o(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,yt(t,e,"listItemIndent",r.containerState.size+1)(l)}function a(l){return r.containerState.furtherBlankLines||!ft(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,c(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,t.attempt(qz,e,c)(l))}function c(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,yt(t,t.attempt(tr,e,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function Gz(t,e,n){const r=this;return yt(t,o,"listItemIndent",r.containerState.size+1);function o(a){const c=r.events[r.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===r.containerState.size?e(a):n(a)}}function Kz(t){t.exit(this.containerState.type)}function Yz(t,e,n){const r=this;return yt(t,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(a){const c=r.events[r.events.length-1];return!ft(a)&&c&&c[1].type==="listItemPrefixWhitespace"?e(a):n(a)}}const hx={name:"setextUnderline",resolveTo:Xz,tokenize:Qz};function Xz(t,e){let n=t.length,r,o,a;for(;n--;)if(t[n][0]==="enter"){if(t[n][1].type==="content"){r=n;break}t[n][1].type==="paragraph"&&(o=n)}else t[n][1].type==="content"&&t.splice(n,1),!a&&t[n][1].type==="definition"&&(a=n);const c={type:"setextHeading",start:{...t[r][1].start},end:{...t[t.length-1][1].end}};return t[o][1].type="setextHeadingText",a?(t.splice(o,0,["enter",c,e]),t.splice(a+1,0,["exit",t[r][1],e]),t[r][1].end={...t[a][1].end}):t[r][1]=c,t.push(["exit",c,e]),t}function Qz(t,e,n){const r=this;let o;return a;function a(f){let p=r.events.length,h;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){h=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(t.enter("setextHeadingLine"),o=f,c(f)):n(f)}function c(f){return t.enter("setextHeadingLineSequence"),l(f)}function l(f){return f===o?(t.consume(f),l):(t.exit("setextHeadingLineSequence"),ft(f)?yt(t,u,"lineSuffix")(f):u(f))}function u(f){return f===null||et(f)?(t.exit("setextHeadingLine"),e(f)):n(f)}}const Zz={tokenize:Jz};function Jz(t){const e=this,n=t.attempt(Bc,r,t.attempt(this.parser.constructs.flowInitial,o,yt(t,t.attempt(this.parser.constructs.flow,o,t.attempt(sz,o)),"linePrefix")));return n;function r(a){if(a===null){t.consume(a);return}return t.enter("lineEndingBlank"),t.consume(a),t.exit("lineEndingBlank"),e.currentConstruct=void 0,n}function o(a){if(a===null){t.consume(a);return}return t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),e.currentConstruct=void 0,n}}const eB={resolveAll:Lk()},tB=Ok("string"),nB=Ok("text");function Ok(t){return{resolveAll:Lk(t==="text"?rB:void 0),tokenize:e};function e(n){const r=this,o=this.parser.constructs[t],a=n.attempt(o,c,l);return c;function c(p){return f(p)?a(p):l(p)}function l(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),u}function u(p){return f(p)?(n.exit("data"),a(p)):(n.consume(p),u)}function f(p){if(p===null)return!0;const h=o[p];let _=-1;if(h)for(;++_<h.length;){const x=h[_];if(!x.previous||x.previous.call(r,r.previous))return!0}return!1}}}function Lk(t){return e;function e(n,r){let o=-1,a;for(;++o<=n.length;)a===void 0?n[o]&&n[o][1].type==="data"&&(a=o,o++):(!n[o]||n[o][1].type!=="data")&&(o!==a+2&&(n[a][1].end=n[o-1][1].end,n.splice(a+2,o-a-2),o=a+2),a=void 0);return t?t(n,r):n}}function rB(t,e){let n=0;for(;++n<=t.length;)if((n===t.length||t[n][1].type==="lineEnding")&&t[n-1][1].type==="data"){const r=t[n-1][1],o=e.sliceStream(r);let a=o.length,c=-1,l=0,u;for(;a--;){const f=o[a];if(typeof f=="string"){for(c=f.length;f.charCodeAt(c-1)===32;)l++,c--;if(c)break;c=-1}else if(f===-2)u=!0,l++;else if(f!==-1){a++;break}}if(e._contentTypeTextTrailing&&n===t.length&&(l=0),l){const f={type:n===t.length||u||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?c:r.start._bufferIndex+c,_index:r.start._index+a,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(t.splice(n,0,["enter",f,e],["exit",f,e]),n+=2)}n++}return t}const sB={42:tr,43:tr,45:tr,48:tr,49:tr,50:tr,51:tr,52:tr,53:tr,54:tr,55:tr,56:tr,57:tr,62:Ak},iB={91:cz},oB={[-2]:xm,[-1]:xm,32:xm},aB={35:mz,42:Sd,45:[hx,Sd],60:yz,61:hx,95:Sd,96:dx,126:dx},lB={38:Tk,92:Rk},cB={[-5]:Sm,[-4]:Sm,[-3]:Sm,33:Pz,38:Tk,42:dg,60:[BP,Ez],91:Bz,92:[hz,Rk],93:Cv,95:dg,96:ZP},uB={null:[dg,eB]},dB={null:[42,95]},fB={null:[]},hB=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:dB,contentInitial:iB,disable:fB,document:sB,flow:aB,flowInitial:oB,insideSpan:uB,string:lB,text:cB},Symbol.toStringTag,{value:"Module"}));function pB(t,e,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},a=[];let c=[],l=[];const u={attempt:D(T),check:D(R),consume:y,enter:S,exit:k,interrupt:D(R,{interrupt:!0})},f={code:null,containerState:{},defineSkip:w,events:[],now:C,parser:t,previous:null,sliceSerialize:_,sliceStream:x,write:h};let p=e.tokenize.call(f,u);return e.resolveAll&&a.push(e),f;function h(P){return c=Tr(c,P),v(),c[c.length-1]!==null?[]:(A(e,0),f.events=Bf(a,f.events,f),f.events)}function _(P,$){return gB(x(P),$)}function x(P){return mB(c,P)}function C(){const{_bufferIndex:P,_index:$,line:U,column:W,offset:K}=r;return{_bufferIndex:P,_index:$,line:U,column:W,offset:K}}function w(P){o[P.line]=P.column,O()}function v(){let P;for(;r._index<c.length;){const $=c[r._index];if(typeof $=="string")for(P=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===P&&r._bufferIndex<$.length;)b($.charCodeAt(r._bufferIndex));else b($)}}function b(P){p=p(P)}function y(P){et(P)?(r.line++,r.column=1,r.offset+=P===-3?2:1,O()):P!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===c[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=P}function S(P,$){const U=$||{};return U.type=P,U.start=C(),f.events.push(["enter",U,f]),l.push(U),U}function k(P){const $=l.pop();return $.end=C(),f.events.push(["exit",$,f]),$}function T(P,$){A(P,$.from)}function R(P,$){$.restore()}function D(P,$){return U;function U(W,K,V){let Q,X,I,L;return Array.isArray(W)?F(W):"tokenize"in W?F([W]):z(W);function z(J){return G;function G(q){const te=q!==null&&J[q],re=q!==null&&J.null,oe=[...Array.isArray(te)?te:te?[te]:[],...Array.isArray(re)?re:re?[re]:[]];return F(oe)(q)}}function F(J){return Q=J,X=0,J.length===0?V:B(J[X])}function B(J){return G;function G(q){return L=j(),I=J,J.partial||(f.currentConstruct=J),J.name&&f.parser.constructs.disable.null.includes(J.name)?ee():J.tokenize.call($?Object.assign(Object.create(f),$):f,u,Y,ee)(q)}}function Y(J){return P(I,L),K}function ee(J){return L.restore(),++X<Q.length?B(Q[X]):V}}}function A(P,$){P.resolveAll&&!a.includes(P)&&a.push(P),P.resolve&&vr(f.events,$,f.events.length-$,P.resolve(f.events.slice($),f)),P.resolveTo&&(f.events=P.resolveTo(f.events,f))}function j(){const P=C(),$=f.previous,U=f.currentConstruct,W=f.events.length,K=Array.from(l);return{from:W,restore:V};function V(){r=P,f.previous=$,f.currentConstruct=U,f.events.length=W,l=K,O()}}function O(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function mB(t,e){const n=e.start._index,r=e.start._bufferIndex,o=e.end._index,a=e.end._bufferIndex;let c;if(n===o)c=[t[n].slice(r,a)];else{if(c=t.slice(n,o),r>-1){const l=c[0];typeof l=="string"?c[0]=l.slice(r):c.shift()}a>0&&c.push(t[o].slice(0,a))}return c}function gB(t,e){let n=-1;const r=[];let o;for(;++n<t.length;){const a=t[n];let c;if(typeof a=="string")c=a;else switch(a){case-5:{c="\r";break}case-4:{c=`
552
+ `;break}case-3:{c=`\r
553
+ `;break}case-2:{c=e?" ":" ";break}case-1:{if(!e&&o)continue;c=" ";break}default:c=String.fromCharCode(a)}o=a===-2,r.push(c)}return r.join("")}function vB(t){const r={constructs:kk([hB,...(t||{}).extensions||[]]),content:o(DP),defined:[],document:o(OP),flow:o(Zz),lazy:{},string:o(tB),text:o(nB)};return r;function o(a){return c;function c(l){return pB(r,a,l)}}}function _B(t){for(;!Nk(t););return t}const px=/[\0\t\n\r]/g;function yB(){let t=1,e="",n=!0,r;return o;function o(a,c,l){const u=[];let f,p,h,_,x;for(a=e+(typeof a=="string"?a.toString():new TextDecoder(c||void 0).decode(a)),h=0,e="",n&&(a.charCodeAt(0)===65279&&h++,n=void 0);h<a.length;){if(px.lastIndex=h,f=px.exec(a),_=f&&f.index!==void 0?f.index:a.length,x=a.charCodeAt(_),!f){e=a.slice(h);break}if(x===10&&h===_&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),h<_&&(u.push(a.slice(h,_)),t+=_-h),x){case 0:{u.push(65533),t++;break}case 9:{for(p=Math.ceil(t/4)*4,u.push(-2);t++<p;)u.push(-1);break}case 10:{u.push(-4),t=1;break}default:r=!0,t=1}h=_+1}return l&&(r&&u.push(-5),e&&u.push(e),u.push(null)),u}}const bB=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function xB(t){return t.replace(bB,SB)}function SB(t,e,n){if(e)return e;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),a=o===120||o===88;return Ek(n.slice(a?2:1),a?16:10)}return wv(n)||t}const Ik={}.hasOwnProperty;function wB(t,e,n){return e&&typeof e=="object"&&(n=e,e=void 0),CB(n)(_B(vB(n).document().write(yB()(t,e,!0))))}function CB(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(ge),autolinkProtocol:j,autolinkEmail:j,atxHeading:a(Ae),blockQuote:a(re),characterEscape:j,characterReference:j,codeFenced:a(oe),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:a(oe,c),codeText:a(se,c),codeTextData:j,data:j,codeFlowValue:j,definition:a(ye),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:a(Ee),hardBreakEscape:a(Be),hardBreakTrailing:a(Be),htmlFlow:a(le,c),htmlFlowData:j,htmlText:a(le,c),htmlTextData:j,image:a(Ce),label:c,link:a(ge),listItem:a(He),listItemValue:_,listOrdered:a(Oe,h),listUnordered:a(Oe),paragraph:a(rt),reference:B,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:a(Ae),strong:a(Qe),thematicBreak:a(Ge)},exit:{atxHeading:u(),atxHeadingSequence:T,autolink:u(),autolinkEmail:te,autolinkProtocol:q,blockQuote:u(),characterEscapeValue:O,characterReferenceMarkerHexadecimal:ee,characterReferenceMarkerNumeric:ee,characterReferenceValue:J,characterReference:G,codeFenced:u(v),codeFencedFence:w,codeFencedFenceInfo:x,codeFencedFenceMeta:C,codeFlowValue:O,codeIndented:u(b),codeText:u(K),codeTextData:O,data:O,definition:u(),definitionDestinationString:k,definitionLabelString:y,definitionTitleString:S,emphasis:u(),hardBreakEscape:u($),hardBreakTrailing:u($),htmlFlow:u(U),htmlFlowData:O,htmlText:u(W),htmlTextData:O,image:u(Q),label:I,labelText:X,lineEnding:P,link:u(V),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:Y,resourceDestinationString:L,resourceTitleString:z,resource:F,setextHeading:u(A),setextHeadingLineSequence:D,setextHeadingText:R,strong:u(),thematicBreak:u()}};Pk(e,(t||{}).mdastExtensions||[]);const n={};return r;function r(ce){let ve={type:"root",children:[]};const Te={stack:[ve],tokenStack:[],config:e,enter:l,exit:f,buffer:c,resume:p,data:n},je=[];let Le=-1;for(;++Le<ce.length;)if(ce[Le][1].type==="listOrdered"||ce[Le][1].type==="listUnordered")if(ce[Le][0]==="enter")je.push(Le);else{const Je=je.pop();Le=o(ce,Je,Le)}for(Le=-1;++Le<ce.length;){const Je=e[ce[Le][0]];Ik.call(Je,ce[Le][1].type)&&Je[ce[Le][1].type].call(Object.assign({sliceSerialize:ce[Le][2].sliceSerialize},Te),ce[Le][1])}if(Te.tokenStack.length>0){const Je=Te.tokenStack[Te.tokenStack.length-1];(Je[1]||mx).call(Te,void 0,Je[0])}for(ve.position={start:yi(ce.length>0?ce[0][1].start:{line:1,column:1,offset:0}),end:yi(ce.length>0?ce[ce.length-2][1].end:{line:1,column:1,offset:0})},Le=-1;++Le<e.transforms.length;)ve=e.transforms[Le](ve)||ve;return ve}function o(ce,ve,Te){let je=ve-1,Le=-1,Je=!1,Ue,Pe,Re,Ke;for(;++je<=Te;){const we=ce[je];switch(we[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{we[0]==="enter"?Le++:Le--,Ke=void 0;break}case"lineEndingBlank":{we[0]==="enter"&&(Ue&&!Ke&&!Le&&!Re&&(Re=je),Ke=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ke=void 0}if(!Le&&we[0]==="enter"&&we[1].type==="listItemPrefix"||Le===-1&&we[0]==="exit"&&(we[1].type==="listUnordered"||we[1].type==="listOrdered")){if(Ue){let De=je;for(Pe=void 0;De--;){const $e=ce[De];if($e[1].type==="lineEnding"||$e[1].type==="lineEndingBlank"){if($e[0]==="exit")continue;Pe&&(ce[Pe][1].type="lineEndingBlank",Je=!0),$e[1].type="lineEnding",Pe=De}else if(!($e[1].type==="linePrefix"||$e[1].type==="blockQuotePrefix"||$e[1].type==="blockQuotePrefixWhitespace"||$e[1].type==="blockQuoteMarker"||$e[1].type==="listItemIndent"))break}Re&&(!Pe||Re<Pe)&&(Ue._spread=!0),Ue.end=Object.assign({},Pe?ce[Pe][1].start:we[1].end),ce.splice(Pe||je,0,["exit",Ue,we[2]]),je++,Te++}if(we[1].type==="listItemPrefix"){const De={type:"listItem",_spread:!1,start:Object.assign({},we[1].start),end:void 0};Ue=De,ce.splice(je,0,["enter",De,we[2]]),je++,Te++,Re=void 0,Ke=!0}}}return ce[ve][1]._spread=Je,Te}function a(ce,ve){return Te;function Te(je){l.call(this,ce(je),je),ve&&ve.call(this,je)}}function c(){this.stack.push({type:"fragment",children:[]})}function l(ce,ve,Te){this.stack[this.stack.length-1].children.push(ce),this.stack.push(ce),this.tokenStack.push([ve,Te||void 0]),ce.position={start:yi(ve.start),end:void 0}}function u(ce){return ve;function ve(Te){ce&&ce.call(this,Te),f.call(this,Te)}}function f(ce,ve){const Te=this.stack.pop(),je=this.tokenStack.pop();if(je)je[0].type!==ce.type&&(ve?ve.call(this,ce,je[0]):(je[1]||mx).call(this,ce,je[0]));else throw new Error("Cannot close `"+ce.type+"` ("+sc({start:ce.start,end:ce.end})+"): it’s not open");Te.position.end=yi(ce.end)}function p(){return Sv(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function _(ce){if(this.data.expectingFirstListItemValue){const ve=this.stack[this.stack.length-2];ve.start=Number.parseInt(this.sliceSerialize(ce),10),this.data.expectingFirstListItemValue=void 0}}function x(){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.lang=ce}function C(){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.meta=ce}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ce.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ce.replace(/(\r?\n|\r)$/g,"")}function y(ce){const ve=this.resume(),Te=this.stack[this.stack.length-1];Te.label=ve,Te.identifier=Vr(this.sliceSerialize(ce)).toLowerCase()}function S(){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.title=ce}function k(){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.url=ce}function T(ce){const ve=this.stack[this.stack.length-1];if(!ve.depth){const Te=this.sliceSerialize(ce).length;ve.depth=Te}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function D(ce){const ve=this.stack[this.stack.length-1];ve.depth=this.sliceSerialize(ce).codePointAt(0)===61?1:2}function A(){this.data.setextHeadingSlurpLineEnding=void 0}function j(ce){const Te=this.stack[this.stack.length-1].children;let je=Te[Te.length-1];(!je||je.type!=="text")&&(je=Ne(),je.position={start:yi(ce.start),end:void 0},Te.push(je)),this.stack.push(je)}function O(ce){const ve=this.stack.pop();ve.value+=this.sliceSerialize(ce),ve.position.end=yi(ce.end)}function P(ce){const ve=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Te=ve.children[ve.children.length-1];Te.position.end=yi(ce.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(ve.type)&&(j.call(this,ce),O.call(this,ce))}function $(){this.data.atHardBreak=!0}function U(){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ce}function W(){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ce}function K(){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.value=ce}function V(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const ve=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=ve,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function Q(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const ve=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=ve,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function X(ce){const ve=this.sliceSerialize(ce),Te=this.stack[this.stack.length-2];Te.label=xB(ve),Te.identifier=Vr(ve).toLowerCase()}function I(){const ce=this.stack[this.stack.length-1],ve=this.resume(),Te=this.stack[this.stack.length-1];if(this.data.inReference=!0,Te.type==="link"){const je=ce.children;Te.children=je}else Te.alt=ve}function L(){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.url=ce}function z(){const ce=this.resume(),ve=this.stack[this.stack.length-1];ve.title=ce}function F(){this.data.inReference=void 0}function B(){this.data.referenceType="collapsed"}function Y(ce){const ve=this.resume(),Te=this.stack[this.stack.length-1];Te.label=ve,Te.identifier=Vr(this.sliceSerialize(ce)).toLowerCase(),this.data.referenceType="full"}function ee(ce){this.data.characterReferenceType=ce.type}function J(ce){const ve=this.sliceSerialize(ce),Te=this.data.characterReferenceType;let je;Te?(je=Ek(ve,Te==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):je=wv(ve);const Le=this.stack[this.stack.length-1];Le.value+=je}function G(ce){const ve=this.stack.pop();ve.position.end=yi(ce.end)}function q(ce){O.call(this,ce);const ve=this.stack[this.stack.length-1];ve.url=this.sliceSerialize(ce)}function te(ce){O.call(this,ce);const ve=this.stack[this.stack.length-1];ve.url="mailto:"+this.sliceSerialize(ce)}function re(){return{type:"blockquote",children:[]}}function oe(){return{type:"code",lang:null,meta:null,value:""}}function se(){return{type:"inlineCode",value:""}}function ye(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ee(){return{type:"emphasis",children:[]}}function Ae(){return{type:"heading",depth:0,children:[]}}function Be(){return{type:"break"}}function le(){return{type:"html",value:""}}function Ce(){return{type:"image",title:null,url:"",alt:null}}function ge(){return{type:"link",title:null,url:"",children:[]}}function Oe(ce){return{type:"list",ordered:ce.type==="listOrdered",start:null,spread:ce._spread,children:[]}}function He(ce){return{type:"listItem",spread:ce._spread,checked:null,children:[]}}function rt(){return{type:"paragraph",children:[]}}function Qe(){return{type:"strong",children:[]}}function Ne(){return{type:"text",value:""}}function Ge(){return{type:"thematicBreak"}}}function yi(t){return{line:t.line,column:t.column,offset:t.offset}}function Pk(t,e){let n=-1;for(;++n<e.length;){const r=e[n];Array.isArray(r)?Pk(t,r):kB(t,r)}}function kB(t,e){let n;for(n in e)if(Ik.call(e,n))switch(n){case"canContainEols":{const r=e[n];r&&t[n].push(...r);break}case"transforms":{const r=e[n];r&&t[n].push(...r);break}case"enter":case"exit":{const r=e[n];r&&Object.assign(t[n],r);break}}}function mx(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+sc({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+sc({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+sc({start:e.start,end:e.end})+") is still open")}function EB(t){const e=this;e.parser=n;function n(r){return wB(r,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function AB(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function RB(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
554
+ `}]}function TB(t,e){const n=e.value?e.value+`
555
+ `:"",r={},o=e.lang?e.lang.split(/\s+/):[];o.length>0&&(r.className=["language-"+o[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return e.meta&&(a.data={meta:e.meta}),t.patch(e,a),a=t.applyData(e,a),a={type:"element",tagName:"pre",properties:{},children:[a]},t.patch(e,a),a}function NB(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function MB(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function DB(t,e){const n=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=String(e.identifier).toUpperCase(),o=Xa(r.toLowerCase()),a=t.footnoteOrder.indexOf(r);let c,l=t.footnoteCounts.get(r);l===void 0?(l=0,t.footnoteOrder.push(r),c=t.footnoteOrder.length):c=a+1,l+=1,t.footnoteCounts.set(r,l);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};t.patch(e,u);const f={type:"element",tagName:"sup",properties:{},children:[u]};return t.patch(e,f),t.applyData(e,f)}function jB(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function OB(t,e){if(t.options.allowDangerousHtml){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}}function zk(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+r}];const o=t.all(e),a=o[0];a&&a.type==="text"?a.value="["+a.value:o.unshift({type:"text",value:"["});const c=o[o.length-1];return c&&c.type==="text"?c.value+=r:o.push({type:"text",value:r}),o}function LB(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return zk(t,e);const o={src:Xa(r.url||""),alt:e.alt};r.title!==null&&r.title!==void 0&&(o.title=r.title);const a={type:"element",tagName:"img",properties:o,children:[]};return t.patch(e,a),t.applyData(e,a)}function IB(t,e){const n={src:Xa(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function PB(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function zB(t,e){const n=String(e.identifier).toUpperCase(),r=t.definitionById.get(n);if(!r)return zk(t,e);const o={href:Xa(r.url||"")};r.title!==null&&r.title!==void 0&&(o.title=r.title);const a={type:"element",tagName:"a",properties:o,children:t.all(e)};return t.patch(e,a),t.applyData(e,a)}function BB(t,e){const n={href:Xa(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function FB(t,e,n){const r=t.all(e),o=n?HB(n):Bk(e),a={},c=[];if(typeof e.checked=="boolean"){const p=r[0];let h;p&&p.type==="element"&&p.tagName==="p"?h=p:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let l=-1;for(;++l<r.length;){const p=r[l];(o||l!==0||p.type!=="element"||p.tagName!=="p")&&c.push({type:"text",value:`
556
+ `}),p.type==="element"&&p.tagName==="p"&&!o?c.push(...p.children):c.push(p)}const u=r[r.length-1];u&&(o||u.type!=="element"||u.tagName!=="p")&&c.push({type:"text",value:`
557
+ `});const f={type:"element",tagName:"li",properties:a,children:c};return t.patch(e,f),t.applyData(e,f)}function HB(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let r=-1;for(;!e&&++r<n.length;)e=Bk(n[r])}return e}function Bk(t){const e=t.spread;return e==null?t.children.length>1:e}function UB(t,e){const n={},r=t.all(e);let o=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++o<r.length;){const c=r[o];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(r,!0)};return t.patch(e,a),t.applyData(e,a)}function $B(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function qB(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function VB(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function WB(t,e){const n=t.all(e),r=n.shift(),o=[];if(r){const c={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],c),o.push(c)}if(n.length>0){const c={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},l=_v(e.children[1]),u=_k(e.children[e.children.length-1]);l&&u&&(c.position={start:l,end:u}),o.push(c)}const a={type:"element",tagName:"table",properties:{},children:t.wrap(o,!0)};return t.patch(e,a),t.applyData(e,a)}function GB(t,e,n){const r=n?n.children:void 0,a=(r?r.indexOf(e):1)===0?"th":"td",c=n&&n.type==="table"?n.align:void 0,l=c?c.length:e.children.length;let u=-1;const f=[];for(;++u<l;){const h=e.children[u],_={},x=c?c[u]:void 0;x&&(_.align=x);let C={type:"element",tagName:a,properties:_,children:[]};h&&(C.children=t.all(h),t.patch(h,C),C=t.applyData(h,C)),f.push(C)}const p={type:"element",tagName:"tr",properties:{},children:t.wrap(f,!0)};return t.patch(e,p),t.applyData(e,p)}function KB(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const gx=9,vx=32;function YB(t){const e=String(t),n=/\r?\n|\r/g;let r=n.exec(e),o=0;const a=[];for(;r;)a.push(_x(e.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(e);return a.push(_x(e.slice(o),o>0,!1)),a.join("")}function _x(t,e,n){let r=0,o=t.length;if(e){let a=t.codePointAt(r);for(;a===gx||a===vx;)r++,a=t.codePointAt(r)}if(n){let a=t.codePointAt(o-1);for(;a===gx||a===vx;)o--,a=t.codePointAt(o-1)}return o>r?t.slice(r,o):""}function XB(t,e){const n={type:"text",value:YB(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function QB(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const ZB={blockquote:AB,break:RB,code:TB,delete:NB,emphasis:MB,footnoteReference:DB,heading:jB,html:OB,imageReference:LB,image:IB,inlineCode:PB,linkReference:zB,link:BB,listItem:FB,list:UB,paragraph:$B,root:qB,strong:VB,table:WB,tableCell:KB,tableRow:GB,text:XB,thematicBreak:QB,toml:fd,yaml:fd,definition:fd,footnoteDefinition:fd};function fd(){}const Fk=-1,Ff=0,oc=1,qd=2,kv=3,Ev=4,Av=5,Rv=6,Hk=7,Uk=8,yx=typeof self=="object"?self:globalThis,JB=(t,e)=>{const n=(o,a)=>(t.set(a,o),o),r=o=>{if(t.has(o))return t.get(o);const[a,c]=e[o];switch(a){case Ff:case Fk:return n(c,o);case oc:{const l=n([],o);for(const u of c)l.push(r(u));return l}case qd:{const l=n({},o);for(const[u,f]of c)l[r(u)]=r(f);return l}case kv:return n(new Date(c),o);case Ev:{const{source:l,flags:u}=c;return n(new RegExp(l,u),o)}case Av:{const l=n(new Map,o);for(const[u,f]of c)l.set(r(u),r(f));return l}case Rv:{const l=n(new Set,o);for(const u of c)l.add(r(u));return l}case Hk:{const{name:l,message:u}=c;return n(new yx[l](u),o)}case Uk:return n(BigInt(c),o);case"BigInt":return n(Object(BigInt(c)),o);case"ArrayBuffer":return n(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:l}=new Uint8Array(c);return n(new DataView(l),c)}}return n(new yx[a](c),o)};return r},bx=t=>JB(new Map,t)(0),va="",{toString:eF}={},{keys:tF}=Object,Jl=t=>{const e=typeof t;if(e!=="object"||!t)return[Ff,e];const n=eF.call(t).slice(8,-1);switch(n){case"Array":return[oc,va];case"Object":return[qd,va];case"Date":return[kv,va];case"RegExp":return[Ev,va];case"Map":return[Av,va];case"Set":return[Rv,va];case"DataView":return[oc,n]}return n.includes("Array")?[oc,n]:n.includes("Error")?[Hk,n]:[qd,n]},hd=([t,e])=>t===Ff&&(e==="function"||e==="symbol"),nF=(t,e,n,r)=>{const o=(c,l)=>{const u=r.push(c)-1;return n.set(l,u),u},a=c=>{if(n.has(c))return n.get(c);let[l,u]=Jl(c);switch(l){case Ff:{let p=c;switch(u){case"bigint":l=Uk,p=c.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+u);p=null;break;case"undefined":return o([Fk],c)}return o([l,p],c)}case oc:{if(u){let _=c;return u==="DataView"?_=new Uint8Array(c.buffer):u==="ArrayBuffer"&&(_=new Uint8Array(c)),o([u,[..._]],c)}const p=[],h=o([l,p],c);for(const _ of c)p.push(a(_));return h}case qd:{if(u)switch(u){case"BigInt":return o([u,c.toString()],c);case"Boolean":case"Number":case"String":return o([u,c.valueOf()],c)}if(e&&"toJSON"in c)return a(c.toJSON());const p=[],h=o([l,p],c);for(const _ of tF(c))(t||!hd(Jl(c[_])))&&p.push([a(_),a(c[_])]);return h}case kv:return o([l,c.toISOString()],c);case Ev:{const{source:p,flags:h}=c;return o([l,{source:p,flags:h}],c)}case Av:{const p=[],h=o([l,p],c);for(const[_,x]of c)(t||!(hd(Jl(_))||hd(Jl(x))))&&p.push([a(_),a(x)]);return h}case Rv:{const p=[],h=o([l,p],c);for(const _ of c)(t||!hd(Jl(_)))&&p.push(a(_));return h}}const{message:f}=c;return o([l,{name:u,message:f}],c)};return a},xx=(t,{json:e,lossy:n}={})=>{const r=[];return nF(!(e||n),!!e,new Map,r)(t),r},Vd=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?bx(xx(t,e)):structuredClone(t):(t,e)=>bx(xx(t,e));function rF(t,e){const n=[{type:"text",value:"↩"}];return e>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),n}function sF(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function iF(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=t.options.footnoteBackContent||rF,r=t.options.footnoteBackLabel||sF,o=t.options.footnoteLabel||"Footnotes",a=t.options.footnoteLabelTagName||"h2",c=t.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let u=-1;for(;++u<t.footnoteOrder.length;){const f=t.footnoteById.get(t.footnoteOrder[u]);if(!f)continue;const p=t.all(f),h=String(f.identifier).toUpperCase(),_=Xa(h.toLowerCase());let x=0;const C=[],w=t.footnoteCounts.get(h);for(;w!==void 0&&++x<=w;){C.length>0&&C.push({type:"text",value:" "});let y=typeof n=="string"?n:n(u,x);typeof y=="string"&&(y={type:"text",value:y}),C.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+_+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,x),className:["data-footnote-backref"]},children:Array.isArray(y)?y:[y]})}const v=p[p.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const y=v.children[v.children.length-1];y&&y.type==="text"?y.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...C)}else p.push(...C);const b={type:"element",tagName:"li",properties:{id:e+"fn-"+_},children:t.wrap(p,!0)};t.patch(f,b),l.push(b)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...Vd(c),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
558
+ `},{type:"element",tagName:"ol",properties:{},children:t.wrap(l,!0)},{type:"text",value:`
559
+ `}]}}const Hf=(function(t){if(t==null)return cF;if(typeof t=="function")return Uf(t);if(typeof t=="object")return Array.isArray(t)?oF(t):aF(t);if(typeof t=="string")return lF(t);throw new Error("Expected function, string, or object as test")});function oF(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=Hf(t[n]);return Uf(r);function r(...o){let a=-1;for(;++a<e.length;)if(e[a].apply(this,o))return!0;return!1}}function aF(t){const e=t;return Uf(n);function n(r){const o=r;let a;for(a in t)if(o[a]!==e[a])return!1;return!0}}function lF(t){return Uf(e);function e(n){return n&&n.type===t}}function Uf(t){return e;function e(n,r,o){return!!(uF(n)&&t.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function cF(){return!0}function uF(t){return t!==null&&typeof t=="object"&&"type"in t}const $k=[],dF=!0,fg=!1,fF="skip";function qk(t,e,n,r){let o;typeof e=="function"&&typeof n!="function"?(r=n,n=e):o=e;const a=Hf(o),c=r?-1:1;l(t,void 0,[])();function l(u,f,p){const h=u&&typeof u=="object"?u:{};if(typeof h.type=="string"){const x=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(_,"name",{value:"node ("+(u.type+(x?"<"+x+">":""))+")"})}return _;function _(){let x=$k,C,w,v;if((!e||a(u,f,p[p.length-1]||void 0))&&(x=hF(n(u,p)),x[0]===fg))return x;if("children"in u&&u.children){const b=u;if(b.children&&x[0]!==fF)for(w=(r?b.children.length:-1)+c,v=p.concat(b);w>-1&&w<b.children.length;){const y=b.children[w];if(C=l(y,w,v)(),C[0]===fg)return C;w=typeof C[1]=="number"?C[1]:w+c}}return x}}}function hF(t){return Array.isArray(t)?t:typeof t=="number"?[dF,t]:t==null?$k:[t]}function Tv(t,e,n,r){let o,a,c;typeof e=="function"&&typeof n!="function"?(a=void 0,c=e,o=n):(a=e,c=n,o=r),qk(t,a,l,o);function l(u,f){const p=f[f.length-1],h=p?p.children.indexOf(u):void 0;return c(u,h,p)}}const hg={}.hasOwnProperty,pF={};function mF(t,e){const n=e||pF,r=new Map,o=new Map,a=new Map,c={...ZB,...n.handlers},l={all:f,applyData:vF,definitionById:r,footnoteById:o,footnoteCounts:a,footnoteOrder:[],handlers:c,one:u,options:n,patch:gF,wrap:yF};return Tv(t,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const h=p.type==="definition"?r:o,_=String(p.identifier).toUpperCase();h.has(_)||h.set(_,p)}}),l;function u(p,h){const _=p.type,x=l.handlers[_];if(hg.call(l.handlers,_)&&x)return x(l,p,h);if(l.options.passThrough&&l.options.passThrough.includes(_)){if("children"in p){const{children:w,...v}=p,b=Vd(v);return b.children=l.all(p),b}return Vd(p)}return(l.options.unknownHandler||_F)(l,p,h)}function f(p){const h=[];if("children"in p){const _=p.children;let x=-1;for(;++x<_.length;){const C=l.one(_[x],p);if(C){if(x&&_[x-1].type==="break"&&(!Array.isArray(C)&&C.type==="text"&&(C.value=Sx(C.value)),!Array.isArray(C)&&C.type==="element")){const w=C.children[0];w&&w.type==="text"&&(w.value=Sx(w.value))}Array.isArray(C)?h.push(...C):h.push(C)}}}return h}}function gF(t,e){t.position&&(e.position=sP(t))}function vF(t,e){let n=e;if(t&&t.data){const r=t.data.hName,o=t.data.hChildren,a=t.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const c="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:c}}n.type==="element"&&a&&Object.assign(n.properties,Vd(a)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function _F(t,e){const n=e.data||{},r="value"in e&&!(hg.call(n,"hProperties")||hg.call(n,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function yF(t,e){const n=[];let r=-1;for(e&&n.push({type:"text",value:`
560
+ `});++r<t.length;)r&&n.push({type:"text",value:`
561
+ `}),n.push(t[r]);return e&&t.length>0&&n.push({type:"text",value:`
562
+ `}),n}function Sx(t){let e=0,n=t.charCodeAt(e);for(;n===9||n===32;)e++,n=t.charCodeAt(e);return t.slice(e)}function wx(t,e){const n=mF(t,e),r=n.one(t,void 0),o=iF(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&a.children.push({type:"text",value:`
563
+ `},o),a}function bF(t,e){return t&&"run"in t?async function(n,r){const o=wx(n,{file:r,...e});await t.run(o,r)}:function(n,r){return wx(n,{file:r,...t||e})}}function Cx(t){if(t)throw t}var wm,kx;function xF(){if(kx)return wm;kx=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(f){return typeof Array.isArray=="function"?Array.isArray(f):e.call(f)==="[object Array]"},a=function(f){if(!f||e.call(f)!=="[object Object]")return!1;var p=t.call(f,"constructor"),h=f.constructor&&f.constructor.prototype&&t.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!p&&!h)return!1;var _;for(_ in f);return typeof _>"u"||t.call(f,_)},c=function(f,p){n&&p.name==="__proto__"?n(f,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):f[p.name]=p.newValue},l=function(f,p){if(p==="__proto__")if(t.call(f,p)){if(r)return r(f,p).value}else return;return f[p]};return wm=function u(){var f,p,h,_,x,C,w=arguments[0],v=1,b=arguments.length,y=!1;for(typeof w=="boolean"&&(y=w,w=arguments[1]||{},v=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});v<b;++v)if(f=arguments[v],f!=null)for(p in f)h=l(w,p),_=l(f,p),w!==_&&(y&&_&&(a(_)||(x=o(_)))?(x?(x=!1,C=h&&o(h)?h:[]):C=h&&a(h)?h:{},c(w,{name:p,newValue:u(y,C,_)})):typeof _<"u"&&c(w,{name:p,newValue:_}));return w},wm}var SF=xF();const Cm=Gd(SF);function pg(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function wF(){const t=[],e={run:n,use:r};return e;function n(...o){let a=-1;const c=o.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);l(null,...o);function l(u,...f){const p=t[++a];let h=-1;if(u){c(u);return}for(;++h<o.length;)(f[h]===null||f[h]===void 0)&&(f[h]=o[h]);o=f,p?CF(p,l)(...f):c(null,...f)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return t.push(o),e}}function CF(t,e){let n;return r;function r(...c){const l=t.length>c.length;let u;l&&c.push(o);try{u=t.apply(this,c)}catch(f){const p=f;if(l&&n)throw p;return o(p)}l||(u&&u.then&&typeof u.then=="function"?u.then(a,o):u instanceof Error?o(u):a(u))}function o(c,...l){n||(n=!0,e(c,...l))}function a(c){o(null,c)}}const is={basename:kF,dirname:EF,extname:AF,join:RF,sep:"/"};function kF(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');Fc(t);let n=0,r=-1,o=t.length,a;if(e===void 0||e.length===0||e.length>t.length){for(;o--;)if(t.codePointAt(o)===47){if(a){n=o+1;break}}else r<0&&(a=!0,r=o+1);return r<0?"":t.slice(n,r)}if(e===t)return"";let c=-1,l=e.length-1;for(;o--;)if(t.codePointAt(o)===47){if(a){n=o+1;break}}else c<0&&(a=!0,c=o+1),l>-1&&(t.codePointAt(o)===e.codePointAt(l--)?l<0&&(r=o):(l=-1,r=c));return n===r?r=c:r<0&&(r=t.length),t.slice(n,r)}function EF(t){if(Fc(t),t.length===0)return".";let e=-1,n=t.length,r;for(;--n;)if(t.codePointAt(n)===47){if(r){e=n;break}}else r||(r=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function AF(t){Fc(t);let e=t.length,n=-1,r=0,o=-1,a=0,c;for(;e--;){const l=t.codePointAt(e);if(l===47){if(c){r=e+1;break}continue}n<0&&(c=!0,n=e+1),l===46?o<0?o=e:a!==1&&(a=1):o>-1&&(a=-1)}return o<0||n<0||a===0||a===1&&o===n-1&&o===r+1?"":t.slice(o,n)}function RF(...t){let e=-1,n;for(;++e<t.length;)Fc(t[e]),t[e]&&(n=n===void 0?t[e]:n+"/"+t[e]);return n===void 0?".":TF(n)}function TF(t){Fc(t);const e=t.codePointAt(0)===47;let n=NF(t,!e);return n.length===0&&!e&&(n="."),n.length>0&&t.codePointAt(t.length-1)===47&&(n+="/"),e?"/"+n:n}function NF(t,e){let n="",r=0,o=-1,a=0,c=-1,l,u;for(;++c<=t.length;){if(c<t.length)l=t.codePointAt(c);else{if(l===47)break;l=47}if(l===47){if(!(o===c-1||a===1))if(o!==c-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),o=c,a=0;continue}}else if(n.length>0){n="",r=0,o=c,a=0;continue}}e&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+t.slice(o+1,c):n=t.slice(o+1,c),r=c-o-1;o=c,a=0}else l===46&&a>-1?a++:a=-1}return n}function Fc(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const MF={cwd:DF};function DF(){return"/"}function mg(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function jF(t){if(typeof t=="string")t=new URL(t);else if(!mg(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return OF(t)}function OF(t){if(t.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const e=t.pathname;let n=-1;for(;++n<e.length;)if(e.codePointAt(n)===37&&e.codePointAt(n+1)===50){const r=e.codePointAt(n+2);if(r===70||r===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(e)}const km=["history","path","basename","stem","extname","dirname"];class Vk{constructor(e){let n;e?mg(e)?n={path:e}:typeof e=="string"||LF(e)?n={value:e}:n=e:n={},this.cwd="cwd"in n?"":MF.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<km.length;){const a=km[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let o;for(o in n)km.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?is.basename(this.path):void 0}set basename(e){Am(e,"basename"),Em(e,"basename"),this.path=is.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?is.dirname(this.path):void 0}set dirname(e){Ex(this.basename,"dirname"),this.path=is.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?is.extname(this.path):void 0}set extname(e){if(Em(e,"extname"),Ex(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=is.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){mg(e)&&(e=jF(e)),Am(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?is.basename(this.path,this.extname):void 0}set stem(e){Am(e,"stem"),Em(e,"stem"),this.path=is.join(this.dirname||"",e+(this.extname||""))}fail(e,n,r){const o=this.message(e,n,r);throw o.fatal=!0,o}info(e,n,r){const o=this.message(e,n,r);return o.fatal=void 0,o}message(e,n,r){const o=new Pn(e,n,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function Em(t,e){if(t&&t.includes(is.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+is.sep+"`")}function Am(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function Ex(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function LF(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const IF=(function(t){const r=this.constructor.prototype,o=r[t],a=function(){return o.apply(a,arguments)};return Object.setPrototypeOf(a,r),a}),PF={}.hasOwnProperty;class Nv extends IF{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=wF()}copy(){const e=new Nv;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];e.use(...r)}return e.data(Cm(!0,{},this.namespace)),e}data(e,n){return typeof e=="string"?arguments.length===2?(Nm("data",this.frozen),this.namespace[e]=n,this):PF.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Nm("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const o=n.call(e,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const n=pd(e),r=this.parser||this.Parser;return Rm("parse",r),r(String(n),n)}process(e,n){const r=this;return this.freeze(),Rm("process",this.parser||this.Parser),Tm("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(a,c){const l=pd(e),u=r.parse(l);r.run(u,l,function(p,h,_){if(p||!h||!_)return f(p);const x=h,C=r.stringify(x,_);FF(C)?_.value=C:_.result=C,f(p,_)});function f(p,h){p||!h?c(p):a?a(h):n(void 0,h)}}}processSync(e){let n=!1,r;return this.freeze(),Rm("processSync",this.parser||this.Parser),Tm("processSync",this.compiler||this.Compiler),this.process(e,o),Rx("processSync","process",n),r;function o(a,c){n=!0,Cx(a),r=c}}run(e,n,r){Ax(e),this.freeze();const o=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(c,l){const u=pd(n);o.run(e,u,f);function f(p,h,_){const x=h||e;p?l(p):c?c(x):r(void 0,x,_)}}}runSync(e,n){let r=!1,o;return this.run(e,n,a),Rx("runSync","run",r),o;function a(c,l){Cx(c),o=l,r=!0}}stringify(e,n){this.freeze();const r=pd(n),o=this.compiler||this.Compiler;return Tm("stringify",o),Ax(e),o(e,r)}use(e,...n){const r=this.attachers,o=this.namespace;if(Nm("use",this.frozen),e!=null)if(typeof e=="function")u(e,n);else if(typeof e=="object")Array.isArray(e)?l(e):c(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function a(f){if(typeof f=="function")u(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[p,...h]=f;u(p,h)}else c(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function c(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(f.plugins),f.settings&&(o.settings=Cm(!0,o.settings,f.settings))}function l(f){let p=-1;if(f!=null)if(Array.isArray(f))for(;++p<f.length;){const h=f[p];a(h)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function u(f,p){let h=-1,_=-1;for(;++h<r.length;)if(r[h][0]===f){_=h;break}if(_===-1)r.push([f,...p]);else if(p.length>0){let[x,...C]=p;const w=r[_][1];pg(w)&&pg(x)&&(x=Cm(!0,w,x)),r[_]=[f,x,...C]}}}}const zF=new Nv().freeze();function Rm(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Tm(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Nm(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Ax(t){if(!pg(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Rx(t,e,n){if(!n)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function pd(t){return BF(t)?t:new Vk(t)}function BF(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function FF(t){return typeof t=="string"||HF(t)}function HF(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const UF="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Tx=[],Nx={allowDangerousHtml:!0},$F=/^(https?|ircs?|mailto|xmpp)$/i,qF=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function VF(t){const e=WF(t),n=GF(t);return KF(e.runSync(e.parse(n),n),t)}function WF(t){const e=t.rehypePlugins||Tx,n=t.remarkPlugins||Tx,r=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...Nx}:Nx;return zF().use(EB).use(n).use(bF,r).use(e)}function GF(t){const e=t.children||"",n=new Vk;return typeof e=="string"&&(n.value=e),n}function KF(t,e){const n=e.allowedElements,r=e.allowElement,o=e.components,a=e.disallowedElements,c=e.skipHtml,l=e.unwrapDisallowed,u=e.urlTransform||YF;for(const p of qF)Object.hasOwn(e,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+UF+p.id,void 0);return Tv(t,f),cP(t,{Fragment:m.Fragment,components:o,ignoreInvalidStyle:!0,jsx:m.jsx,jsxs:m.jsxs,passKeys:!0,passNode:!0});function f(p,h,_){if(p.type==="raw"&&_&&typeof h=="number")return c?_.children.splice(h,1):_.children[h]={type:"text",value:p.value},h;if(p.type==="element"){let x;for(x in bm)if(Object.hasOwn(bm,x)&&Object.hasOwn(p.properties,x)){const C=p.properties[x],w=bm[x];(w===null||w.includes(p.tagName))&&(p.properties[x]=u(String(C||""),x,p))}}if(p.type==="element"){let x=n?!n.includes(p.tagName):a?a.includes(p.tagName):!1;if(!x&&r&&typeof h=="number"&&(x=!r(p,h,_)),x&&_&&typeof h=="number")return l&&p.children?_.children.splice(h,1,...p.children):_.children.splice(h,1),h}}}function YF(t){const e=t.indexOf(":"),n=t.indexOf("?"),r=t.indexOf("#"),o=t.indexOf("/");return e===-1||o!==-1&&e>o||n!==-1&&e>n||r!==-1&&e>r||$F.test(t.slice(0,e))?t:""}function Mx(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,o=n.indexOf(e);for(;o!==-1;)r++,o=n.indexOf(e,o+e.length);return r}function XF(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function QF(t,e,n){const o=Hf((n||{}).ignore||[]),a=ZF(e);let c=-1;for(;++c<a.length;)qk(t,"text",l);function l(f,p){let h=-1,_;for(;++h<p.length;){const x=p[h],C=_?_.children:void 0;if(o(x,C?C.indexOf(x):void 0,_))return;_=x}if(_)return u(f,p)}function u(f,p){const h=p[p.length-1],_=a[c][0],x=a[c][1];let C=0;const v=h.children.indexOf(f);let b=!1,y=[];_.lastIndex=0;let S=_.exec(f.value);for(;S;){const k=S.index,T={index:S.index,input:S.input,stack:[...p,f]};let R=x(...S,T);if(typeof R=="string"&&(R=R.length>0?{type:"text",value:R}:void 0),R===!1?_.lastIndex=k+1:(C!==k&&y.push({type:"text",value:f.value.slice(C,k)}),Array.isArray(R)?y.push(...R):R&&y.push(R),C=k+S[0].length,b=!0),!_.global)break;S=_.exec(f.value)}return b?(C<f.value.length&&y.push({type:"text",value:f.value.slice(C)}),h.children.splice(v,1,...y)):y=[f],v+y.length}}function ZF(t){const e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!t[0]||Array.isArray(t[0])?t:[t];let r=-1;for(;++r<n.length;){const o=n[r];e.push([JF(o[0]),eH(o[1])])}return e}function JF(t){return typeof t=="string"?new RegExp(XF(t),"g"):t}function eH(t){return typeof t=="function"?t:function(){return t}}const Mm="phrasing",Dm=["autolink","link","image","label"];function tH(){return{transforms:[lH],enter:{literalAutolink:rH,literalAutolinkEmail:jm,literalAutolinkHttp:jm,literalAutolinkWww:jm},exit:{literalAutolink:aH,literalAutolinkEmail:oH,literalAutolinkHttp:sH,literalAutolinkWww:iH}}}function nH(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Mm,notInConstruct:Dm},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Mm,notInConstruct:Dm},{character:":",before:"[ps]",after:"\\/",inConstruct:Mm,notInConstruct:Dm}]}}function rH(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function jm(t){this.config.enter.autolinkProtocol.call(this,t)}function sH(t){this.config.exit.autolinkProtocol.call(this,t)}function iH(t){this.config.exit.data.call(this,t);const e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function oH(t){this.config.exit.autolinkEmail.call(this,t)}function aH(t){this.exit(t)}function lH(t){QF(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,cH],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),uH]],{ignore:["link","linkReference"]})}function cH(t,e,n,r,o){let a="";if(!Wk(o)||(/^w/i.test(e)&&(n=e+n,e="",a="http://"),!dH(n)))return!1;const c=fH(n+r);if(!c[0])return!1;const l={type:"link",title:null,url:a+e+c[0],children:[{type:"text",value:e+c[0]}]};return c[1]?[l,{type:"text",value:c[1]}]:l}function uH(t,e,n,r){return!Wk(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+n,children:[{type:"text",value:e+"@"+n}]}}function dH(t){const e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function fH(t){const e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let n=e[0],r=n.indexOf(")");const o=Mx(t,"(");let a=Mx(t,")");for(;r!==-1&&o>a;)t+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[t,n]}function Wk(t,e){const n=t.input.charCodeAt(t.index-1);return(t.index===0||bo(n)||zf(n))&&(!e||n!==47)}Gk.peek=xH;function hH(){this.buffer()}function pH(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function mH(){this.buffer()}function gH(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function vH(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Vr(this.sliceSerialize(t)).toLowerCase(),n.label=e}function _H(t){this.exit(t)}function yH(t){const e=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Vr(this.sliceSerialize(t)).toLowerCase(),n.label=e}function bH(t){this.exit(t)}function xH(){return"["}function Gk(t,e,n,r){const o=n.createTracker(r);let a=o.move("[^");const c=n.enter("footnoteReference"),l=n.enter("reference");return a+=o.move(n.safe(n.associationId(t),{after:"]",before:a})),l(),c(),a+=o.move("]"),a}function SH(){return{enter:{gfmFootnoteCallString:hH,gfmFootnoteCall:pH,gfmFootnoteDefinitionLabelString:mH,gfmFootnoteDefinition:gH},exit:{gfmFootnoteCallString:vH,gfmFootnoteCall:_H,gfmFootnoteDefinitionLabelString:yH,gfmFootnoteDefinition:bH}}}function wH(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:n,footnoteReference:Gk},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,o,a,c){const l=a.createTracker(c);let u=l.move("[^");const f=a.enter("footnoteDefinition"),p=a.enter("label");return u+=l.move(a.safe(a.associationId(r),{before:u,after:"]"})),p(),u+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),u+=l.move((e?`
564
+ `:" ")+a.indentLines(a.containerFlow(r,l.current()),e?Kk:CH))),f(),u}}function CH(t,e,n){return e===0?t:Kk(t,e,n)}function Kk(t,e,n){return(n?"":" ")+t}const kH=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Yk.peek=NH;function EH(){return{canContainEols:["delete"],enter:{strikethrough:RH},exit:{strikethrough:TH}}}function AH(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:kH}],handlers:{delete:Yk}}}function RH(t){this.enter({type:"delete",children:[]},t)}function TH(t){this.exit(t)}function Yk(t,e,n,r){const o=n.createTracker(r),a=n.enter("strikethrough");let c=o.move("~~");return c+=n.containerPhrasing(t,{...o.current(),before:c,after:"~"}),c+=o.move("~~"),a(),c}function NH(){return"~"}function MH(t){return t.length}function DH(t,e){const n=e||{},r=(n.align||[]).concat(),o=n.stringLength||MH,a=[],c=[],l=[],u=[];let f=0,p=-1;for(;++p<t.length;){const w=[],v=[];let b=-1;for(t[p].length>f&&(f=t[p].length);++b<t[p].length;){const y=jH(t[p][b]);if(n.alignDelimiters!==!1){const S=o(y);v[b]=S,(u[b]===void 0||S>u[b])&&(u[b]=S)}w.push(y)}c[p]=w,l[p]=v}let h=-1;if(typeof r=="object"&&"length"in r)for(;++h<f;)a[h]=Dx(r[h]);else{const w=Dx(r);for(;++h<f;)a[h]=w}h=-1;const _=[],x=[];for(;++h<f;){const w=a[h];let v="",b="";w===99?(v=":",b=":"):w===108?v=":":w===114&&(b=":");let y=n.alignDelimiters===!1?1:Math.max(1,u[h]-v.length-b.length);const S=v+"-".repeat(y)+b;n.alignDelimiters!==!1&&(y=v.length+y+b.length,y>u[h]&&(u[h]=y),x[h]=y),_[h]=S}c.splice(1,0,_),l.splice(1,0,x),p=-1;const C=[];for(;++p<c.length;){const w=c[p],v=l[p];h=-1;const b=[];for(;++h<f;){const y=w[h]||"";let S="",k="";if(n.alignDelimiters!==!1){const T=u[h]-(v[h]||0),R=a[h];R===114?S=" ".repeat(T):R===99?T%2?(S=" ".repeat(T/2+.5),k=" ".repeat(T/2-.5)):(S=" ".repeat(T/2),k=S):k=" ".repeat(T)}n.delimiterStart!==!1&&!h&&b.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&y==="")&&(n.delimiterStart!==!1||h)&&b.push(" "),n.alignDelimiters!==!1&&b.push(S),b.push(y),n.alignDelimiters!==!1&&b.push(k),n.padding!==!1&&b.push(" "),(n.delimiterEnd!==!1||h!==f-1)&&b.push("|")}C.push(n.delimiterEnd===!1?b.join("").replace(/ +$/,""):b.join(""))}return C.join(`
565
+ `)}function jH(t){return t==null?"":String(t)}function Dx(t){const e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function OH(t,e,n,r){const o=n.enter("blockquote"),a=n.createTracker(r);a.move("> "),a.shift(2);const c=n.indentLines(n.containerFlow(t,a.current()),LH);return o(),c}function LH(t,e,n){return">"+(n?"":" ")+t}function IH(t,e){return jx(t,e.inConstruct,!0)&&!jx(t,e.notInConstruct,!1)}function jx(t,e,n){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return n;let r=-1;for(;++r<e.length;)if(t.includes(e[r]))return!0;return!1}function Ox(t,e,n,r){let o=-1;for(;++o<n.unsafe.length;)if(n.unsafe[o].character===`
566
+ `&&IH(n.stack,n.unsafe[o]))return/[ \t]/.test(r.before)?"":" ";return`\\
567
+ `}function PH(t,e){const n=String(t);let r=n.indexOf(e),o=r,a=0,c=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===o?++a>c&&(c=a):a=1,o=r+e.length,r=n.indexOf(e,o);return c}function zH(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function BH(t){const e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function FH(t,e,n,r){const o=BH(n),a=t.value||"",c=o==="`"?"GraveAccent":"Tilde";if(zH(t,n)){const h=n.enter("codeIndented"),_=n.indentLines(a,HH);return h(),_}const l=n.createTracker(r),u=o.repeat(Math.max(PH(a,o)+1,3)),f=n.enter("codeFenced");let p=l.move(u);if(t.lang){const h=n.enter(`codeFencedLang${c}`);p+=l.move(n.safe(t.lang,{before:p,after:" ",encode:["`"],...l.current()})),h()}if(t.lang&&t.meta){const h=n.enter(`codeFencedMeta${c}`);p+=l.move(" "),p+=l.move(n.safe(t.meta,{before:p,after:`
568
+ `,encode:["`"],...l.current()})),h()}return p+=l.move(`
569
+ `),a&&(p+=l.move(a+`
570
+ `)),p+=l.move(u),f(),p}function HH(t,e,n){return(n?"":" ")+t}function Mv(t){const e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function UH(t,e,n,r){const o=Mv(n),a=o==='"'?"Quote":"Apostrophe",c=n.enter("definition");let l=n.enter("label");const u=n.createTracker(r);let f=u.move("[");return f+=u.move(n.safe(n.associationId(t),{before:f,after:"]",...u.current()})),f+=u.move("]: "),l(),!t.url||/[\0- \u007F]/.test(t.url)?(l=n.enter("destinationLiteral"),f+=u.move("<"),f+=u.move(n.safe(t.url,{before:f,after:">",...u.current()})),f+=u.move(">")):(l=n.enter("destinationRaw"),f+=u.move(n.safe(t.url,{before:f,after:t.title?" ":`
571
+ `,...u.current()}))),l(),t.title&&(l=n.enter(`title${a}`),f+=u.move(" "+o),f+=u.move(n.safe(t.title,{before:f,after:o,...u.current()})),f+=u.move(o),l()),c(),f}function $H(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function _c(t){return"&#x"+t.toString(16).toUpperCase()+";"}function Wd(t,e,n){const r=Da(t),o=Da(e);return r===void 0?o===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Xk.peek=qH;function Xk(t,e,n,r){const o=$H(n),a=n.enter("emphasis"),c=n.createTracker(r),l=c.move(o);let u=c.move(n.containerPhrasing(t,{after:o,before:l,...c.current()}));const f=u.charCodeAt(0),p=Wd(r.before.charCodeAt(r.before.length-1),f,o);p.inside&&(u=_c(f)+u.slice(1));const h=u.charCodeAt(u.length-1),_=Wd(r.after.charCodeAt(0),h,o);_.inside&&(u=u.slice(0,-1)+_c(h));const x=c.move(o);return a(),n.attentionEncodeSurroundingInfo={after:_.outside,before:p.outside},l+u+x}function qH(t,e,n){return n.options.emphasis||"*"}function VH(t,e){let n=!1;return Tv(t,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,fg}),!!((!t.depth||t.depth<3)&&Sv(t)&&(e.options.setext||n))}function WH(t,e,n,r){const o=Math.max(Math.min(6,t.depth||1),1),a=n.createTracker(r);if(VH(t,n)){const p=n.enter("headingSetext"),h=n.enter("phrasing"),_=n.containerPhrasing(t,{...a.current(),before:`
572
+ `,after:`
573
+ `});return h(),p(),_+`
574
+ `+(o===1?"=":"-").repeat(_.length-(Math.max(_.lastIndexOf("\r"),_.lastIndexOf(`
575
+ `))+1))}const c="#".repeat(o),l=n.enter("headingAtx"),u=n.enter("phrasing");a.move(c+" ");let f=n.containerPhrasing(t,{before:"# ",after:`
576
+ `,...a.current()});return/^[\t ]/.test(f)&&(f=_c(f.charCodeAt(0))+f.slice(1)),f=f?c+" "+f:c,n.options.closeAtx&&(f+=" "+c),u(),l(),f}Qk.peek=GH;function Qk(t){return t.value||""}function GH(){return"<"}Zk.peek=KH;function Zk(t,e,n,r){const o=Mv(n),a=o==='"'?"Quote":"Apostrophe",c=n.enter("image");let l=n.enter("label");const u=n.createTracker(r);let f=u.move("![");return f+=u.move(n.safe(t.alt,{before:f,after:"]",...u.current()})),f+=u.move("]("),l(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(l=n.enter("destinationLiteral"),f+=u.move("<"),f+=u.move(n.safe(t.url,{before:f,after:">",...u.current()})),f+=u.move(">")):(l=n.enter("destinationRaw"),f+=u.move(n.safe(t.url,{before:f,after:t.title?" ":")",...u.current()}))),l(),t.title&&(l=n.enter(`title${a}`),f+=u.move(" "+o),f+=u.move(n.safe(t.title,{before:f,after:o,...u.current()})),f+=u.move(o),l()),f+=u.move(")"),c(),f}function KH(){return"!"}Jk.peek=YH;function Jk(t,e,n,r){const o=t.referenceType,a=n.enter("imageReference");let c=n.enter("label");const l=n.createTracker(r);let u=l.move("![");const f=n.safe(t.alt,{before:u,after:"]",...l.current()});u+=l.move(f+"]["),c();const p=n.stack;n.stack=[],c=n.enter("reference");const h=n.safe(n.associationId(t),{before:u,after:"]",...l.current()});return c(),n.stack=p,a(),o==="full"||!f||f!==h?u+=l.move(h+"]"):o==="shortcut"?u=u.slice(0,-1):u+=l.move("]"),u}function YH(){return"!"}eE.peek=XH;function eE(t,e,n){let r=t.value||"",o="`",a=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(r);)o+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){const c=n.unsafe[a],l=n.compilePattern(c);let u;if(c.atBreak)for(;u=l.exec(r);){let f=u.index;r.charCodeAt(f)===10&&r.charCodeAt(f-1)===13&&f--,r=r.slice(0,f)+" "+r.slice(u.index+1)}}return o+r+o}function XH(){return"`"}function tE(t,e){const n=Sv(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(n===t.url||"mailto:"+n===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}nE.peek=QH;function nE(t,e,n,r){const o=Mv(n),a=o==='"'?"Quote":"Apostrophe",c=n.createTracker(r);let l,u;if(tE(t,n)){const p=n.stack;n.stack=[],l=n.enter("autolink");let h=c.move("<");return h+=c.move(n.containerPhrasing(t,{before:h,after:">",...c.current()})),h+=c.move(">"),l(),n.stack=p,h}l=n.enter("link"),u=n.enter("label");let f=c.move("[");return f+=c.move(n.containerPhrasing(t,{before:f,after:"](",...c.current()})),f+=c.move("]("),u(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(u=n.enter("destinationLiteral"),f+=c.move("<"),f+=c.move(n.safe(t.url,{before:f,after:">",...c.current()})),f+=c.move(">")):(u=n.enter("destinationRaw"),f+=c.move(n.safe(t.url,{before:f,after:t.title?" ":")",...c.current()}))),u(),t.title&&(u=n.enter(`title${a}`),f+=c.move(" "+o),f+=c.move(n.safe(t.title,{before:f,after:o,...c.current()})),f+=c.move(o),u()),f+=c.move(")"),l(),f}function QH(t,e,n){return tE(t,n)?"<":"["}rE.peek=ZH;function rE(t,e,n,r){const o=t.referenceType,a=n.enter("linkReference");let c=n.enter("label");const l=n.createTracker(r);let u=l.move("[");const f=n.containerPhrasing(t,{before:u,after:"]",...l.current()});u+=l.move(f+"]["),c();const p=n.stack;n.stack=[],c=n.enter("reference");const h=n.safe(n.associationId(t),{before:u,after:"]",...l.current()});return c(),n.stack=p,a(),o==="full"||!f||f!==h?u+=l.move(h+"]"):o==="shortcut"?u=u.slice(0,-1):u+=l.move("]"),u}function ZH(){return"["}function Dv(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function JH(t){const e=Dv(t),n=t.options.bulletOther;if(!n)return e==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+n+"`) to be different");return n}function eU(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function sE(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function tU(t,e,n,r){const o=n.enter("list"),a=n.bulletCurrent;let c=t.ordered?eU(n):Dv(n);const l=t.ordered?c==="."?")":".":JH(n);let u=e&&n.bulletLastUsed?c===n.bulletLastUsed:!1;if(!t.ordered){const p=t.children?t.children[0]:void 0;if((c==="*"||c==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),sE(n)===c&&p){let h=-1;for(;++h<t.children.length;){const _=t.children[h];if(_&&_.type==="listItem"&&_.children&&_.children[0]&&_.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(c=l),n.bulletCurrent=c;const f=n.containerFlow(t,r);return n.bulletLastUsed=c,n.bulletCurrent=a,o(),f}function nU(t){const e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function rU(t,e,n,r){const o=nU(n);let a=n.bulletCurrent||Dv(n);e&&e.type==="list"&&e.ordered&&(a=(typeof e.start=="number"&&e.start>-1?e.start:1)+(n.options.incrementListMarker===!1?0:e.children.indexOf(t))+a);let c=a.length+1;(o==="tab"||o==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(c=Math.ceil(c/4)*4);const l=n.createTracker(r);l.move(a+" ".repeat(c-a.length)),l.shift(c);const u=n.enter("listItem"),f=n.indentLines(n.containerFlow(t,l.current()),p);return u(),f;function p(h,_,x){return _?(x?"":" ".repeat(c))+h:(x?a:a+" ".repeat(c-a.length))+h}}function sU(t,e,n,r){const o=n.enter("paragraph"),a=n.enter("phrasing"),c=n.containerPhrasing(t,r);return a(),o(),c}const iU=Hf(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function oU(t,e,n,r){return(t.children.some(function(c){return iU(c)})?n.containerPhrasing:n.containerFlow).call(n,t,r)}function aU(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}iE.peek=lU;function iE(t,e,n,r){const o=aU(n),a=n.enter("strong"),c=n.createTracker(r),l=c.move(o+o);let u=c.move(n.containerPhrasing(t,{after:o,before:l,...c.current()}));const f=u.charCodeAt(0),p=Wd(r.before.charCodeAt(r.before.length-1),f,o);p.inside&&(u=_c(f)+u.slice(1));const h=u.charCodeAt(u.length-1),_=Wd(r.after.charCodeAt(0),h,o);_.inside&&(u=u.slice(0,-1)+_c(h));const x=c.move(o+o);return a(),n.attentionEncodeSurroundingInfo={after:_.outside,before:p.outside},l+u+x}function lU(t,e,n){return n.options.strong||"*"}function cU(t,e,n,r){return n.safe(t.value,r)}function uU(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function dU(t,e,n){const r=(sE(n)+(n.options.ruleSpaces?" ":"")).repeat(uU(n));return n.options.ruleSpaces?r.slice(0,-1):r}const oE={blockquote:OH,break:Ox,code:FH,definition:UH,emphasis:Xk,hardBreak:Ox,heading:WH,html:Qk,image:Zk,imageReference:Jk,inlineCode:eE,link:nE,linkReference:rE,list:tU,listItem:rU,paragraph:sU,root:oU,strong:iE,text:cU,thematicBreak:dU};function fU(){return{enter:{table:hU,tableData:Lx,tableHeader:Lx,tableRow:mU},exit:{codeText:gU,table:pU,tableData:Om,tableHeader:Om,tableRow:Om}}}function hU(t){const e=t._align;this.enter({type:"table",align:e.map(function(n){return n==="none"?null:n}),children:[]},t),this.data.inTable=!0}function pU(t){this.exit(t),this.data.inTable=void 0}function mU(t){this.enter({type:"tableRow",children:[]},t)}function Om(t){this.exit(t)}function Lx(t){this.enter({type:"tableCell",children:[]},t)}function gU(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,vU));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function vU(t,e){return e==="|"?e:t}function _U(t){const e=t||{},n=e.tableCellPadding,r=e.tablePipeAlign,o=e.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
577
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:_,table:c,tableCell:u,tableRow:l}};function c(x,C,w,v){return f(p(x,w,v),x.align)}function l(x,C,w,v){const b=h(x,w,v),y=f([b]);return y.slice(0,y.indexOf(`
578
+ `))}function u(x,C,w,v){const b=w.enter("tableCell"),y=w.enter("phrasing"),S=w.containerPhrasing(x,{...v,before:a,after:a});return y(),b(),S}function f(x,C){return DH(x,{align:C,alignDelimiters:r,padding:n,stringLength:o})}function p(x,C,w){const v=x.children;let b=-1;const y=[],S=C.enter("table");for(;++b<v.length;)y[b]=h(v[b],C,w);return S(),y}function h(x,C,w){const v=x.children;let b=-1;const y=[],S=C.enter("tableRow");for(;++b<v.length;)y[b]=u(v[b],x,C,w);return S(),y}function _(x,C,w){let v=oE.inlineCode(x,C,w);return w.stack.includes("tableCell")&&(v=v.replace(/\|/g,"\\$&")),v}}function yU(){return{exit:{taskListCheckValueChecked:Ix,taskListCheckValueUnchecked:Ix,paragraph:xU}}}function bU(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:SU}}}function Ix(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function xU(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const o=e.children;let a=-1,c;for(;++a<o.length;){const l=o[a];if(l.type==="paragraph"){c=l;break}}c===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(t)}function SU(t,e,n,r){const o=t.children[0],a=typeof t.checked=="boolean"&&o&&o.type==="paragraph",c="["+(t.checked?"x":" ")+"] ",l=n.createTracker(r);a&&l.move(c);let u=oE.listItem(t,e,n,{...r,...l.current()});return a&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,f)),u;function f(p){return p+c}}function wU(){return[tH(),SH(),EH(),fU(),yU()]}function CU(t){return{extensions:[nH(),wH(t),AH(),_U(t),bU()]}}const kU={tokenize:MU,partial:!0},aE={tokenize:DU,partial:!0},lE={tokenize:jU,partial:!0},cE={tokenize:OU,partial:!0},EU={tokenize:LU,partial:!0},uE={name:"wwwAutolink",tokenize:TU,previous:fE},dE={name:"protocolAutolink",tokenize:NU,previous:hE},Hs={name:"emailAutolink",tokenize:RU,previous:pE},hs={};function AU(){return{text:hs}}let co=48;for(;co<123;)hs[co]=Hs,co++,co===58?co=65:co===91&&(co=97);hs[43]=Hs;hs[45]=Hs;hs[46]=Hs;hs[95]=Hs;hs[72]=[Hs,dE];hs[104]=[Hs,dE];hs[87]=[Hs,uE];hs[119]=[Hs,uE];function RU(t,e,n){const r=this;let o,a;return c;function c(h){return!gg(h)||!pE.call(r,r.previous)||jv(r.events)?n(h):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),l(h))}function l(h){return gg(h)?(t.consume(h),l):h===64?(t.consume(h),u):n(h)}function u(h){return h===46?t.check(EU,p,f)(h):h===45||h===95||In(h)?(a=!0,t.consume(h),u):p(h)}function f(h){return t.consume(h),o=!0,u}function p(h){return a&&o&&qn(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(h)):n(h)}}function TU(t,e,n){const r=this;return o;function o(c){return c!==87&&c!==119||!fE.call(r,r.previous)||jv(r.events)?n(c):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(kU,t.attempt(aE,t.attempt(lE,a),n),n)(c))}function a(c){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(c)}}function NU(t,e,n){const r=this;let o="",a=!1;return c;function c(h){return(h===72||h===104)&&hE.call(r,r.previous)&&!jv(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),o+=String.fromCodePoint(h),t.consume(h),l):n(h)}function l(h){if(qn(h)&&o.length<5)return o+=String.fromCodePoint(h),t.consume(h),l;if(h===58){const _=o.toLowerCase();if(_==="http"||_==="https")return t.consume(h),u}return n(h)}function u(h){return h===47?(t.consume(h),a?f:(a=!0,u)):n(h)}function f(h){return h===null||$d(h)||Lt(h)||bo(h)||zf(h)?n(h):t.attempt(aE,t.attempt(lE,p),n)(h)}function p(h){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(h)}}function MU(t,e,n){let r=0;return o;function o(c){return(c===87||c===119)&&r<3?(r++,t.consume(c),o):c===46&&r===3?(t.consume(c),a):n(c)}function a(c){return c===null?n(c):e(c)}}function DU(t,e,n){let r,o,a;return c;function c(f){return f===46||f===95?t.check(cE,u,l)(f):f===null||Lt(f)||bo(f)||f!==45&&zf(f)?u(f):(a=!0,t.consume(f),c)}function l(f){return f===95?r=!0:(o=r,r=void 0),t.consume(f),c}function u(f){return o||r||!a?n(f):e(f)}}function jU(t,e){let n=0,r=0;return o;function o(c){return c===40?(n++,t.consume(c),o):c===41&&r<n?a(c):c===33||c===34||c===38||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===60||c===63||c===93||c===95||c===126?t.check(cE,e,a)(c):c===null||Lt(c)||bo(c)?e(c):(t.consume(c),o)}function a(c){return c===41&&r++,t.consume(c),o}}function OU(t,e,n){return r;function r(l){return l===33||l===34||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===63||l===95||l===126?(t.consume(l),r):l===38?(t.consume(l),a):l===93?(t.consume(l),o):l===60||l===null||Lt(l)||bo(l)?e(l):n(l)}function o(l){return l===null||l===40||l===91||Lt(l)||bo(l)?e(l):r(l)}function a(l){return qn(l)?c(l):n(l)}function c(l){return l===59?(t.consume(l),r):qn(l)?(t.consume(l),c):n(l)}}function LU(t,e,n){return r;function r(a){return t.consume(a),o}function o(a){return In(a)?n(a):e(a)}}function fE(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||Lt(t)}function hE(t){return!qn(t)}function pE(t){return!(t===47||gg(t))}function gg(t){return t===43||t===45||t===46||t===95||In(t)}function jv(t){let e=t.length,n=!1;for(;e--;){const r=t[e][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const IU={tokenize:qU,partial:!0};function PU(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:HU,continuation:{tokenize:UU},exit:$U}},text:{91:{name:"gfmFootnoteCall",tokenize:FU},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:zU,resolveTo:BU}}}}function zU(t,e,n){const r=this;let o=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c;for(;o--;){const u=r.events[o][1];if(u.type==="labelImage"){c=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return l;function l(u){if(!c||!c._balanced)return n(u);const f=Vr(r.sliceSerialize({start:c.end,end:r.now()}));return f.codePointAt(0)!==94||!a.includes(f.slice(1))?n(u):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(u),t.exit("gfmFootnoteCallLabelMarker"),e(u))}}function BU(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},t[t.length-1][1].start)},c={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},l=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",o,e],["exit",o,e],["enter",a,e],["enter",c,e],["exit",c,e],["exit",a,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...l),t}function FU(t,e,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,c;return l;function l(h){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(h),t.exit("gfmFootnoteCallLabelMarker"),u}function u(h){return h!==94?n(h):(t.enter("gfmFootnoteCallMarker"),t.consume(h),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",f)}function f(h){if(a>999||h===93&&!c||h===null||h===91||Lt(h))return n(h);if(h===93){t.exit("chunkString");const _=t.exit("gfmFootnoteCallString");return o.includes(Vr(r.sliceSerialize(_)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(h),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(h)}return Lt(h)||(c=!0),a++,t.consume(h),h===92?p:f}function p(h){return h===91||h===92||h===93?(t.consume(h),a++,f):f(h)}}function HU(t,e,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,c=0,l;return u;function u(C){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(C),t.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(C){return C===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(C),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",p):n(C)}function p(C){if(c>999||C===93&&!l||C===null||C===91||Lt(C))return n(C);if(C===93){t.exit("chunkString");const w=t.exit("gfmFootnoteDefinitionLabelString");return a=Vr(r.sliceSerialize(w)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(C),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),_}return Lt(C)||(l=!0),c++,t.consume(C),C===92?h:p}function h(C){return C===91||C===92||C===93?(t.consume(C),c++,p):p(C)}function _(C){return C===58?(t.enter("definitionMarker"),t.consume(C),t.exit("definitionMarker"),o.includes(a)||o.push(a),yt(t,x,"gfmFootnoteDefinitionWhitespace")):n(C)}function x(C){return e(C)}}function UU(t,e,n){return t.check(Bc,e,t.attempt(IU,e,n))}function $U(t){t.exit("gfmFootnoteDefinition")}function qU(t,e,n){const r=this;return yt(t,o,"gfmFootnoteDefinitionIndent",5);function o(a){const c=r.events[r.events.length-1];return c&&c[1].type==="gfmFootnoteDefinitionIndent"&&c[2].sliceSerialize(c[1],!0).length===4?e(a):n(a)}}function VU(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:o};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function o(c,l){let u=-1;for(;++u<c.length;)if(c[u][0]==="enter"&&c[u][1].type==="strikethroughSequenceTemporary"&&c[u][1]._close){let f=u;for(;f--;)if(c[f][0]==="exit"&&c[f][1].type==="strikethroughSequenceTemporary"&&c[f][1]._open&&c[u][1].end.offset-c[u][1].start.offset===c[f][1].end.offset-c[f][1].start.offset){c[u][1].type="strikethroughSequence",c[f][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},c[f][1].start),end:Object.assign({},c[u][1].end)},h={type:"strikethroughText",start:Object.assign({},c[f][1].end),end:Object.assign({},c[u][1].start)},_=[["enter",p,l],["enter",c[f][1],l],["exit",c[f][1],l],["enter",h,l]],x=l.parser.constructs.insideSpan.null;x&&vr(_,_.length,0,Bf(x,c.slice(f+1,u),l)),vr(_,_.length,0,[["exit",h,l],["enter",c[u][1],l],["exit",c[u][1],l],["exit",p,l]]),vr(c,f-1,u-f+3,_),u=f+_.length-2;break}}for(u=-1;++u<c.length;)c[u][1].type==="strikethroughSequenceTemporary"&&(c[u][1].type="data");return c}function a(c,l,u){const f=this.previous,p=this.events;let h=0;return _;function _(C){return f===126&&p[p.length-1][1].type!=="characterEscape"?u(C):(c.enter("strikethroughSequenceTemporary"),x(C))}function x(C){const w=Da(f);if(C===126)return h>1?u(C):(c.consume(C),h++,x);if(h<2&&!n)return u(C);const v=c.exit("strikethroughSequenceTemporary"),b=Da(C);return v._open=!b||b===2&&!!w,v._close=!w||w===2&&!!b,l(C)}}}class WU{constructor(){this.map=[]}add(e,n,r){GU(this,e,n,r)}consume(e){if(this.map.sort(function(a,c){return a[0]-c[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let o=r.pop();for(;o;){for(const a of o)e.push(a);o=r.pop()}this.map.length=0}}function GU(t,e,n,r){let o=0;if(!(n===0&&r.length===0)){for(;o<t.map.length;){if(t.map[o][0]===e){t.map[o][1]+=n,t.map[o][2].push(...r);return}o+=1}t.map.push([e,n,r])}}function KU(t,e){let n=!1;const r=[];for(;e<t.length;){const o=t[e];if(n){if(o[0]==="enter")o[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const a=r.length-1;r[a]=r[a]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return r}function YU(){return{flow:{null:{name:"table",tokenize:XU,resolveAll:QU}}}}function XU(t,e,n){const r=this;let o=0,a=0,c;return l;function l(O){let P=r.events.length-1;for(;P>-1;){const W=r.events[P][1].type;if(W==="lineEnding"||W==="linePrefix")P--;else break}const $=P>-1?r.events[P][1].type:null,U=$==="tableHead"||$==="tableRow"?R:u;return U===R&&r.parser.lazy[r.now().line]?n(O):U(O)}function u(O){return t.enter("tableHead"),t.enter("tableRow"),f(O)}function f(O){return O===124||(c=!0,a+=1),p(O)}function p(O){return O===null?n(O):et(O)?a>1?(a=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(O),t.exit("lineEnding"),x):n(O):ft(O)?yt(t,p,"whitespace")(O):(a+=1,c&&(c=!1,o+=1),O===124?(t.enter("tableCellDivider"),t.consume(O),t.exit("tableCellDivider"),c=!0,p):(t.enter("data"),h(O)))}function h(O){return O===null||O===124||Lt(O)?(t.exit("data"),p(O)):(t.consume(O),O===92?_:h)}function _(O){return O===92||O===124?(t.consume(O),h):h(O)}function x(O){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(O):(t.enter("tableDelimiterRow"),c=!1,ft(O)?yt(t,C,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):C(O))}function C(O){return O===45||O===58?v(O):O===124?(c=!0,t.enter("tableCellDivider"),t.consume(O),t.exit("tableCellDivider"),w):T(O)}function w(O){return ft(O)?yt(t,v,"whitespace")(O):v(O)}function v(O){return O===58?(a+=1,c=!0,t.enter("tableDelimiterMarker"),t.consume(O),t.exit("tableDelimiterMarker"),b):O===45?(a+=1,b(O)):O===null||et(O)?k(O):T(O)}function b(O){return O===45?(t.enter("tableDelimiterFiller"),y(O)):T(O)}function y(O){return O===45?(t.consume(O),y):O===58?(c=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(O),t.exit("tableDelimiterMarker"),S):(t.exit("tableDelimiterFiller"),S(O))}function S(O){return ft(O)?yt(t,k,"whitespace")(O):k(O)}function k(O){return O===124?C(O):O===null||et(O)?!c||o!==a?T(O):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(O)):T(O)}function T(O){return n(O)}function R(O){return t.enter("tableRow"),D(O)}function D(O){return O===124?(t.enter("tableCellDivider"),t.consume(O),t.exit("tableCellDivider"),D):O===null||et(O)?(t.exit("tableRow"),e(O)):ft(O)?yt(t,D,"whitespace")(O):(t.enter("data"),A(O))}function A(O){return O===null||O===124||Lt(O)?(t.exit("data"),D(O)):(t.consume(O),O===92?j:A)}function j(O){return O===92||O===124?(t.consume(O),A):A(O)}}function QU(t,e){let n=-1,r=!0,o=0,a=[0,0,0,0],c=[0,0,0,0],l=!1,u=0,f,p,h;const _=new WU;for(;++n<t.length;){const x=t[n],C=x[1];x[0]==="enter"?C.type==="tableHead"?(l=!1,u!==0&&(Px(_,e,u,f,p),p=void 0,u=0),f={type:"table",start:Object.assign({},C.start),end:Object.assign({},C.end)},_.add(n,0,[["enter",f,e]])):C.type==="tableRow"||C.type==="tableDelimiterRow"?(r=!0,h=void 0,a=[0,0,0,0],c=[0,n+1,0,0],l&&(l=!1,p={type:"tableBody",start:Object.assign({},C.start),end:Object.assign({},C.end)},_.add(n,0,[["enter",p,e]])),o=C.type==="tableDelimiterRow"?2:p?3:1):o&&(C.type==="data"||C.type==="tableDelimiterMarker"||C.type==="tableDelimiterFiller")?(r=!1,c[2]===0&&(a[1]!==0&&(c[0]=c[1],h=md(_,e,a,o,void 0,h),a=[0,0,0,0]),c[2]=n)):C.type==="tableCellDivider"&&(r?r=!1:(a[1]!==0&&(c[0]=c[1],h=md(_,e,a,o,void 0,h)),a=c,c=[a[1],n,0,0])):C.type==="tableHead"?(l=!0,u=n):C.type==="tableRow"||C.type==="tableDelimiterRow"?(u=n,a[1]!==0?(c[0]=c[1],h=md(_,e,a,o,n,h)):c[1]!==0&&(h=md(_,e,c,o,n,h)),o=0):o&&(C.type==="data"||C.type==="tableDelimiterMarker"||C.type==="tableDelimiterFiller")&&(c[3]=n)}for(u!==0&&Px(_,e,u,f,p),_.consume(e.events),n=-1;++n<e.events.length;){const x=e.events[n];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=KU(e.events,n))}return t}function md(t,e,n,r,o,a){const c=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(a.end=Object.assign({},ba(e.events,n[0])),t.add(n[0],0,[["exit",a,e]]));const u=ba(e.events,n[1]);if(a={type:c,start:Object.assign({},u),end:Object.assign({},u)},t.add(n[1],0,[["enter",a,e]]),n[2]!==0){const f=ba(e.events,n[2]),p=ba(e.events,n[3]),h={type:l,start:Object.assign({},f),end:Object.assign({},p)};if(t.add(n[2],0,[["enter",h,e]]),r!==2){const _=e.events[n[2]],x=e.events[n[3]];if(_[1].end=Object.assign({},x[1].end),_[1].type="chunkText",_[1].contentType="text",n[3]>n[2]+1){const C=n[2]+1,w=n[3]-n[2]-1;t.add(C,w,[])}}t.add(n[3]+1,0,[["exit",h,e]])}return o!==void 0&&(a.end=Object.assign({},ba(e.events,o)),t.add(o,0,[["exit",a,e]]),a=void 0),a}function Px(t,e,n,r,o){const a=[],c=ba(e.events,n);o&&(o.end=Object.assign({},c),a.push(["exit",o,e])),r.end=Object.assign({},c),a.push(["exit",r,e]),t.add(n+1,0,a)}function ba(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const ZU={name:"tasklistCheck",tokenize:e$};function JU(){return{text:{91:ZU}}}function e$(t,e,n){const r=this;return o;function o(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),a)}function a(u){return Lt(u)?(t.enter("taskListCheckValueUnchecked"),t.consume(u),t.exit("taskListCheckValueUnchecked"),c):u===88||u===120?(t.enter("taskListCheckValueChecked"),t.consume(u),t.exit("taskListCheckValueChecked"),c):n(u)}function c(u){return u===93?(t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),l):n(u)}function l(u){return et(u)?e(u):ft(u)?t.check({tokenize:t$},e,n)(u):n(u)}}function t$(t,e,n){return yt(t,r,"whitespace");function r(o){return o===null?n(o):e(o)}}function n$(t){return kk([AU(),PU(),VU(t),YU(),JU()])}const r$={};function s$(t){const e=this,n=t||r$,r=e.data(),o=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),c=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);o.push(n$(n)),a.push(wU()),c.push(CU(n))}const i$=Pc.oneDark,o$=Pc.nightOwl,a$=N.memo(function(e){const n=he.c(11),{children:r,className:o,inverted:a}=e,c=a===void 0?!1:a;let l;n[0]!==c?(l={code(x){const{className:C,children:w,...v}=x,b=/language-(\w+)/.exec(C||""),y=b?b[1]:"",S=!y,k=Array.isArray(w)?w.join(""):String(w);return!S&&y?m.jsx("div",{className:"w-full max-w-full overflow-x-auto my-2 min-w-0",children:m.jsx(mv,{theme:c?o$:i$,code:k.trim(),language:y,children:l$})}):m.jsx("code",{className:ke("px-1.5 py-0.5 rounded text-sm font-mono",c?"bg-primary-foreground/20 text-primary-foreground":"bg-muted",C),...v,children:w})},a(x){const{href:C,children:w,...v}=x;return m.jsx("a",{href:C,target:"_blank",rel:"noopener noreferrer",className:ke("underline underline-offset-2 transition-colors",c?"text-primary-foreground/80 hover:text-primary-foreground":"text-primary hover:text-primary/80"),...v,children:w})},p(x){const{children:C}=x;return m.jsx("p",{className:"last:mb-0 leading-relaxed wrap-break-words",children:C})},ul(x){const{children:C}=x;return m.jsx("ul",{className:"list-outside list-disc pl-8",children:C})},ol(x){const{children:C}=x;return m.jsx("ol",{className:"list-outside list-decimal pl-8",children:C})},li(x){const{children:C,className:w}=x,v=w==null?void 0:w.includes("nested");return m.jsx("li",{className:ke("leading-snug",v&&"ml-8"),children:C})},h1(x){const{children:C}=x;return m.jsx("h1",{className:"text-lg font-semibold mb-1.5 mt-3 first:mt-0",children:C})},h2(x){const{children:C}=x;return m.jsx("h2",{className:"text-base font-semibold mb-1.5 mt-2.5 first:mt-0",children:C})},h3(x){const{children:C}=x;return m.jsx("h3",{className:"text-sm font-semibold mb-1 mt-2 first:mt-0",children:C})},blockquote(x){const{children:C}=x;return m.jsx("blockquote",{className:ke("border-l-2 pl-3 my-1.5 italic",c?"border-primary-foreground/40 text-primary-foreground/70":"border-muted-foreground/40 text-muted-foreground"),children:C})},strong(x){const{children:C}=x;return m.jsx("strong",{className:ke("font-semibold",c&&"text-primary-foreground"),children:C})},em(x){const{children:C}=x;return m.jsx("em",{className:"italic",children:C})},hr(){return m.jsx("hr",{className:ke("my-3",c?"border-primary-foreground/30":"border-border")})},table(x){const{children:C}=x;return m.jsx("div",{className:"my-2 overflow-x-auto max-w-full",children:m.jsx("table",{className:"w-full border-collapse text-sm",children:C})})},th(x){const{children:C}=x;return m.jsx("th",{className:ke("border border-border px-2 py-1.5 text-left font-semibold",c?"bg-primary-foreground/10 text-primary-foreground":"bg-muted"),children:C})},td(x){const{children:C}=x;return m.jsx("td",{className:ke("border px-2 py-1.5",c?"border-primary-foreground/20":"border-border"),children:C})}},n[0]=c,n[1]=l):l=n[1];const u=l;let f;n[2]!==o?(f=ke("w-full markdown-render overflow-x-auto wrap-break-words break",o),n[2]=o,n[3]=f):f=n[3];let p;n[4]===Symbol.for("react.memo_cache_sentinel")?(p=[s$],n[4]=p):p=n[4];let h;n[5]!==r||n[6]!==u?(h=m.jsx(VF,{remarkPlugins:p,components:u,children:r}),n[5]=r,n[6]=u,n[7]=h):h=n[7];let _;return n[8]!==f||n[9]!==h?(_=m.jsx("div",{className:f,children:h}),n[8]=f,n[9]=h,n[10]=_):_=n[10],_});function l$(t){const{className:e,style:n,tokens:r,getLineProps:o,getTokenProps:a}=t;return m.jsx("pre",{className:ke("rounded-lg text-sm p-3",e),style:n,children:r.map((c,l)=>m.jsx("div",{...o({line:c}),children:c.map((u,f)=>m.jsx("span",{...a({token:u})},f))},l))})}const Lm=60,zx=300,uo=16;function Bx(t){if(t.length===0)return!1;const e=t[t.length-1];return _g(e.message)&&e.message.status==="streaming"}function Fx(t){return t.filter(e=>e.type==="text").map(e=>e.text).join("")}function c$(t,e){const n=e.findIndex(r=>r.message.id===t);if(n<=0)return null;for(let r=n-1;r>=0;r--){const o=e[r];if(o.message.role==="assistant"&&o.message.status!=="streaming")return o.message.id}return null}function u$(){const t=he.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground bg-muted/50 rounded-lg px-3 py-2 border border-border",children:[m.jsx(sS,{className:"size-4 animate-pulse"}),m.jsx("span",{children:"Compacting conversation..."})]}),t[0]=e):e=t[0],e}function d$(){const t=he.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsxs("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400 bg-green-500/10 rounded-lg px-3 py-2 border border-green-500/20",children:[m.jsx(v5,{className:"size-4"}),m.jsx("span",{children:"Compaction complete"})]}),t[0]=e):e=t[0],e}function f$(t){const e=he.c(8),{message:n,textContent:r,onRetry:o}=t;let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsxs("div",{className:"flex items-center gap-1.5 text-xs uppercase tracking-wide text-destructive ml-3",children:[m.jsx(lc,{className:"size-3"}),"Compaction Failed"]}),e[0]=a):a=e[0];const c=r||n.error||"Compaction failed. The conversation could not be summarized.";let l;e[1]!==c?(l=m.jsx("p",{className:"text-sm text-destructive/90",children:c}),e[1]=c,e[2]=l):l=e[2];let u;e[3]!==o?(u=o&&m.jsxs(Fe,{variant:"outline",size:"sm",onClick:o,className:"mt-2 h-7 text-xs gap-1.5",children:[m.jsx(oS,{className:"size-3"}),"Retry"]}),e[3]=o,e[4]=u):u=e[4];let f;return e[5]!==l||e[6]!==u?(f=m.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[a,m.jsxs("div",{className:"rounded-2xl px-4 py-3 max-w-full bg-destructive/10 border border-destructive/30 rounded-bl-md",children:[l,u]})]}),e[5]=l,e[6]=u,e[7]=f):f=e[7],f}function h$(t){const e=he.c(15),{part:n}=t,[r,o]=N.useState(!1),a=n.overflow?"overflow":n.auto?"auto":"manual";let c;e[0]!==r?(c=()=>o(!r),e[0]=r,e[1]=c):c=e[1];let l;e[2]!==r?(l=r?m.jsx(Oa,{className:"size-3"}):m.jsx(Wr,{className:"size-3"}),e[2]=r,e[3]=l):l=e[3];const u=a==="overflow"?"Context overflow":a==="auto"?"Auto":"Manual";let f;e[4]!==u?(f=m.jsxs("span",{className:"border-b border-dashed border-muted-foreground/40 pb-px",children:[u," compaction"]}),e[4]=u,e[5]=f):f=e[5];let p;e[6]!==c||e[7]!==l||e[8]!==f?(p=m.jsxs("button",{onClick:c,className:"flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:[l,f]}),e[6]=c,e[7]=l,e[8]=f,e[9]=p):p=e[9];let h;e[10]!==r?(h=r&&m.jsx("div",{className:"mt-2 text-xs text-muted-foreground italic",children:"Summary available in the assistant message below"}),e[10]=r,e[11]=h):h=e[11];let _;return e[12]!==p||e[13]!==h?(_=m.jsxs("div",{className:"flex flex-col items-center py-3",children:[p,h]}),e[12]=p,e[13]=h,e[14]=_):_=e[14],_}const p$=N.memo(function(e){const n=he.c(13),{parts:r,pendingPermissions:o,onPermissionResponse:a,onNavigateToSubagent:c,inverted:l}=e,u=l===void 0?!1:l;let f;if(n[0]!==u||n[1]!==c||n[2]!==a||n[3]!==r||n[4]!==o){const h=[...r].sort(v$);let _;n[6]!==u||n[7]!==c||n[8]!==a||n[9]!==o?(_=x=>{switch(x.type){case"text":return m.jsx("div",{className:"min-w-0",children:m.jsx(a$,{inverted:u,children:x.text||"..."})},x.id);case"reasoning":return m.jsx("div",{className:"visualization-container text-muted-foreground text-sm italic border-l-2 border-muted-foreground/30 pl-3 my-2 wrap-break-word",children:x.text},x.id);case"tool":return m.jsx(j9,{part:x,pendingPermissions:o,onPermissionResponse:a,onNavigateToSubagent:c},x.id);case"image":return m.jsx("img",{src:x.url,alt:"",className:"max-w-full rounded-lg mt-2"},x.id);case"file":return m.jsx("div",{className:"mt-2 p-2 bg-muted rounded text-sm",children:x.filename||"unnamed"},x.id);default:return null}},n[6]=u,n[7]=c,n[8]=a,n[9]=o,n[10]=_):_=n[10],f=h.map(_),n[0]=u,n[1]=c,n[2]=a,n[3]=r,n[4]=o,n[5]=f}else f=n[5];let p;return n[11]!==f?(p=m.jsx(m.Fragment,{children:f}),n[11]=f,n[12]=p):p=n[12],p},(t,e)=>{if(t.parts!==e.parts||t.inverted!==e.inverted||t.onPermissionResponse!==e.onPermissionResponse||t.onNavigateToSubagent!==e.onNavigateToSubagent)return!1;if(!t.parts.some(c=>c.type==="tool"&&c.state.status==="pending"))return!0;const r=new Set(t.parts.filter(c=>c.type==="tool").map(c=>c.callId)),o=t.pendingPermissions.filter(c=>r.has(c.toolCallId)),a=e.pendingPermissions.filter(c=>r.has(c.toolCallId));if(o.length!==a.length)return!1;for(let c=0;c<o.length;c++)if(o[c].toolCallId!==a[c].toolCallId)return!1;return!0}),m$=N.memo(function(e){const n=he.c(45),{item:r,messagesWithParts:o,sessionId:a,pendingPermissions:c,onPermissionResponse:l,onNavigateToSubagent:u,onRemoveFromQueue:f,onRevert:p,onFork:h,isMainActiveSession:_,isCompacting:x,onCompact:C}=e,w=_===void 0?!1:_,v=x===void 0?!1:x;let b;n[0]!==r.parts?(b=r.parts.find(_$),n[0]=r.parts,n[1]=b):b=n[1];const y=b;if(_g(r.message)&&r.message.mode==="compact_failed"){const V=r.message;let Q;n[2]!==r.parts?(Q=Fx(r.parts),n[2]=r.parts,n[3]=Q):Q=n[3];const X=w&&!v?C:void 0;let I;return n[4]!==V||n[5]!==Q||n[6]!==X?(I=m.jsx(f$,{message:V,textContent:Q,onRetry:X}),n[4]=V,n[5]=Q,n[6]=X,n[7]=I):I=n[7],I}if(y){let V;return n[8]!==y?(V=m.jsx(h$,{part:y}),n[8]=y,n[9]=V):V=n[9],V}const k=!r.isQueued&&r.message.role==="user";let T;n[10]!==k||n[11]!==r.message||n[12]!==o?(T=k?c$(r.message.id,o):null,n[10]=k,n[11]=r.message,n[12]=o,n[13]=T):T=n[13];const R=T,D=r.message;let A;n[14]!==r.parts?(A=Fx(r.parts),n[14]=r.parts,n[15]=A):A=n[15];let j;n[16]!==r.isQueued||n[17]!==r.queueId||n[18]!==f?(j=r.isQueued?()=>f(r.queueId):void 0,n[16]=r.isQueued,n[17]=r.queueId,n[18]=f,n[19]=j):j=n[19];const O=k&&R!==null;let P;n[20]!==p||n[21]!==R||n[22]!==a?(P=R?()=>p==null?void 0:p(a,R):void 0,n[20]=p,n[21]=R,n[22]=a,n[23]=P):P=n[23];const $=k&&R!==null;let U;n[24]!==r.message||n[25]!==h||n[26]!==R||n[27]!==a?(U=R?()=>h==null?void 0:h(a,r.message.id):void 0,n[24]=r.message,n[25]=h,n[26]=R,n[27]=a,n[28]=U):U=n[28];let W;n[29]!==r.message||n[30]!==r.parts||n[31]!==u||n[32]!==l||n[33]!==c?(W=r.parts.length===0?m.jsx("span",{className:"opacity-50",children:"..."}):m.jsx(p$,{parts:r.parts,pendingPermissions:c,onPermissionResponse:l,onNavigateToSubagent:u,inverted:r.message.role==="user"}),n[29]=r.message,n[30]=r.parts,n[31]=u,n[32]=l,n[33]=c,n[34]=W):W=n[34];let K;return n[35]!==r.isQueued||n[36]!==r.message||n[37]!==$||n[38]!==U||n[39]!==W||n[40]!==A||n[41]!==j||n[42]!==O||n[43]!==P?(K=m.jsx(nI,{message:D,textContent:A,isQueued:r.isQueued,onRemove:j,canRevert:O,onRevert:P,canFork:$,onFork:U,children:W}),n[35]=r.isQueued,n[36]=r.message,n[37]=$,n[38]=U,n[39]=W,n[40]=A,n[41]=j,n[42]=O,n[43]=P,n[44]=K):K=n[44],K});function g$({displayItems:t,messagesWithParts:e,sessionId:n,sessionStatus:r,pendingPermissions:o,isCompacting:a=!1,compactionSuccess:c=!1,onPermissionResponse:l,onNavigateToSubagent:u,onRemoveFromQueue:f,onRevert:p,onFork:h,onCompact:_,isMainActiveSession:x=!1,autoFollow:C=!0,onAutoScrollChange:w,scrollToBottomRef:v}){var z,F;const b=N.useRef(null),[y,S]=N.useState(!1),k=N.useRef(C),T=N.useRef(t.length),R=N.useRef(0),D=N.useRef(!1),A=N.useRef(!1),j=N.useRef(""),O=N.useCallback(B=>{if(B.length===0)return"";const Y=B[B.length-1],J=Y.parts.filter(te=>te.type==="text").reduce((te,re)=>te+re.text.length,0),G=Y.message.id,q=_g(Y.message)?Y.message.status:"n/a";return`${G}:${q}:${Y.parts.length}:${J}`},[]),P=N.useRef(null),$=N.useRef(null),U=N.useRef(new Map),W=N.useRef(t);W.current=t;const K=N.useCallback(B=>{const Y=W.current[B];if(!Y)return Lm+uo;if(Y.message.role==="assistant"){let J=100;return Y.parts.some(te=>{var re,oe;return te.type==="text"&&((re=te.text)==null?void 0:re.includes("```"))||te.type==="tool"&&((oe=te.state.input)==null?void 0:oe.command)})&&(J=180),Y.parts.some(te=>te.type==="tool")&&(J=Math.max(J,150)),Y.parts.some(te=>te.type==="compaction")&&(J=60),Y.message.mode==="compact_failed"&&(J=100),Math.min(Math.max(J+uo,Lm+uo),zx+uo)}const ee=Y.parts.length>1?80:60;return Math.min(Math.max(ee+uo,Lm+uo),zx+uo)},[]);N.useLayoutEffect(()=>{const B=b.current;if(!B)return;const Y=requestAnimationFrame(()=>{B.querySelectorAll("[data-index]").forEach(J=>{const G=J.getAttribute("data-index");if(G===null)return;const q=parseInt(G,10);U.current.set(q,J.offsetHeight)})});return()=>cancelAnimationFrame(Y)},[t.length]);const V=N.useRef(null);N.useLayoutEffect(()=>{const B=b.current;if(!B)return;V.current&&V.current.disconnect();const Y=new ResizeObserver(J=>{J.forEach(G=>{const q=G.target,te=q.getAttribute("data-index");if(te===null)return;const re=parseInt(te,10),oe=q.offsetHeight;U.current.set(re,oe)})});return V.current=Y,B.querySelectorAll("[data-index]").forEach(J=>Y.observe(J)),()=>Y.disconnect()},[t.length]);const Q=tI({count:t.length,getScrollElement:()=>b.current,estimateSize:K,overscan:5,getItemKey:B=>{var ee,J;const Y=t[B];return(J=(ee=Y==null?void 0:Y.message)==null?void 0:ee.id)!=null?J:`fallback-${B}`}});N.useLayoutEffect(()=>{k.current=C,T.current=t.length,R.current=0,D.current=!1,j.current="",t.length!==0&&(Q.scrollToIndex(t.length-1,{align:"end"}),D.current=!0)},[n]),N.useEffect(()=>{const B=b.current;if(!B)return;const Y=ee=>{k.current&&ee.deltaY<0&&(k.current=!1,w==null||w(!1))};return B.addEventListener("wheel",Y,{passive:!1}),()=>B.removeEventListener("wheel",Y)},[w]);const X=$7(()=>{if(A.current)return;const B=b.current;if(B&&k.current){const{scrollTop:Y,scrollHeight:ee,clientHeight:J}=B;ee-Y-J>0&&(A.current=!0,B.scrollTop=ee,requestAnimationFrame(()=>{A.current=!1}))}});N.useLayoutEffect(()=>{S(a)},[a]);const I=O(t);N.useLayoutEffect(()=>{var se;const B=t.length,Y=T.current,ee=B!==Y,J=I,G=J!==j.current;j.current=J;const q=B-1;let te=0;q>=0&&(te=(se=U.current.get(q))!=null?se:0);const re=R.current,oe=q>=0&&te>re&&re>0;if(T.current=B,R.current=te,!(B===0||!ee&&!G&&!oe)){if(Y===0&&B>0&&re===0&&!D.current){Q.scrollToIndex(B-1,{align:"end"}),D.current=!0;return}k.current&&(b.current.scrollTop=b.current.scrollHeight)}},[t.length,I,Q]),N.useEffect(()=>{var G;const B=Q.getVirtualItems(),Y=B.length-1;if(Y<0)return;const ee=B[Y],J=(G=b.current)==null?void 0:G.querySelector(`[data-index="${ee.index}"]`);if(P.current&&P.current.disconnect(),!!J&&($.current=J,!(!Bx(t)||!k.current)))return P.current=new ResizeObserver(q=>{k.current&&Bx(t)&&requestAnimationFrame(()=>{k.current&&(b.current.scrollTop=b.current.scrollHeight)})}),P.current.observe(J),()=>{P.current&&(P.current.disconnect(),P.current=null)}},[t,Q]),N.useEffect(()=>{if(c){const B=setTimeout(()=>{S(!1)},3e3);return()=>clearTimeout(B)}},[c]),N.useLayoutEffect(()=>{v&&(v.current=()=>{k.current=!0,A.current=!0,b.current.scrollTop=b.current.scrollHeight,requestAnimationFrame(()=>{A.current=!1})})},[v]),N.useLayoutEffect(()=>{k.current=C},[C]);const L=Q.getVirtualItems();return m.jsxs("div",{ref:b,className:"flex-1 min-h-0 overflow-y-auto relative chat-transcript-scrollbar",style:{WebkitOverflowScrolling:"touch"},onScroll:X,children:[y&&m.jsx("div",{className:"sticky top-0 z-10 px-4 pt-4",children:m.jsx(u$,{})}),c&&m.jsx("div",{className:"sticky top-0 z-10 px-4 pt-4",children:m.jsx(d$,{})}),r==="closed"&&m.jsx(bd,{className:"mx-4 mt-4",children:m.jsx(xd,{children:"This session is archived. You can reopen it from the sidebar."})}),m.jsx("div",{className:"relative w-full",style:{height:`${Q.getTotalSize()}px`},children:t.length===0?m.jsxs("div",{className:"text-center py-16 text-muted-foreground px-4",children:[m.jsx("p",{className:"text-lg mb-2",children:"Start a conversation"}),m.jsx("p",{className:"text-sm",children:"Send a message below to begin."})]}):m.jsx("div",{className:"absolute top-0 left-0 w-full",style:{transform:`translateY(${(F=(z=L[0])==null?void 0:z.start)!=null?F:0}px)`},children:L.map(B=>{const Y=t[B.index];return m.jsx("div",{"data-index":B.index,ref:Q.measureElement,className:"px-4 py-4",children:m.jsx(m$,{item:Y,messagesWithParts:e,sessionId:n,pendingPermissions:o,onPermissionResponse:l,onNavigateToSubagent:u,onRemoveFromQueue:f,onRevert:p,onFork:h,isMainActiveSession:x,isCompacting:a,onCompact:_})},Y.message.id)})})})]})}function v$(t,e){return t.createdAt-e.createdAt}function _$(t){return t.type==="compaction"}function y$(t,e){const n=t.map(c=>({message:c.message,parts:c.parts,isQueued:!1})),r=e.map(c=>({message:{id:c.id,role:"user",sessionId:c.sessionId,createdAt:c.createdAt},parts:[{id:`${c.id}-part`,messageId:c.id,createdAt:c.createdAt,type:"text",text:c.content}],isQueued:!0,queueId:c.id})),o=[...n].sort((c,l)=>c.message.createdAt-l.message.createdAt),a=[...r].sort((c,l)=>c.message.createdAt-l.message.createdAt);return[...o,...a]}function b$(t){const e=he.c(8),{permissions:n,onPermissionResponse:r}=t;if(n.length===0)return null;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx("div",{className:"text-xs text-muted-foreground uppercase tracking-wide font-medium",children:"Pending Requests"}),e[0]=o):o=e[0];let a;if(e[1]!==r||e[2]!==n){let l;e[4]!==r?(l=u=>{var p;const f=typeof((p=u.args)==null?void 0:p.command)=="string"?u.args.command:JSON.stringify(u.args,null,2);return m.jsxs("div",{className:"p-3 bg-warning/10 border border-warning/30 rounded-lg flex flex-col gap-2",children:[m.jsx("div",{className:"flex items-center gap-2",children:m.jsx("span",{className:"text-sm font-medium",children:u.toolName})}),m.jsx("p",{className:"text-sm",children:u.message}),m.jsxs(ki,{children:[m.jsx(Ei,{asChild:!0,children:m.jsxs("button",{className:"flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground transition-colors w-full text-left",children:[m.jsx(Wr,{className:"size-3"}),m.jsx("span",{className:"uppercase tracking-wide",children:"Command"})]})}),m.jsx(Ai,{children:m.jsx("pre",{className:"text-xs bg-background border rounded-md p-2 mt-1 overflow-x-auto whitespace-pre-wrap break-words",children:f})})]}),m.jsxs("div",{className:"flex justify-end gap-2 flex-wrap",children:[m.jsx(Fe,{variant:"outline",size:"sm",onClick:()=>r(u.toolCallId,!1,!1),children:"Deny"}),m.jsx(Fe,{variant:"secondary",size:"sm",onClick:()=>r(u.toolCallId,!0,!1),children:"Approve"}),m.jsx(Fe,{size:"sm",onClick:()=>r(u.toolCallId,!0,!0),children:"Always Allow"})]})]},u.toolCallId)},e[4]=r,e[5]=l):l=e[5],a=n.map(l),e[1]=r,e[2]=n,e[3]=a}else a=e[3];let c;return e[6]!==a?(c=m.jsxs("div",{className:"border-t border-border bg-muted/30 flex flex-col gap-2 p-4",children:[o,a]}),e[6]=a,e[7]=c):c=e[7],c}function x$(t){const e=he.c(84),{session:n,messagesWithParts:r,queuedMessages:o,preconfigs:a,prompts:c,models:l,connectedProviderIds:u,connectableProviderIds:f,defaultModel:p,onSendMessage:h,onRemoveFromQueue:_,onChangePreconfig:x,onChangeModel:C,onChangeVariant:w,pendingPermissions:v,onPermissionResponse:b,onRename:y,usage:S,modelName:k,onNavigateToSubagent:T,onNavigateBack:R,isStreaming:D,onInterrupt:A,onRevert:j,onFork:O,onCompact:P,isCompacting:$,compactionSuccess:U,serverUrl:W,apiToken:K,selectedVariant:V,variants:Q,inputRef:X,scrollToBottomRef:I,autoFollowToggleRef:L}=t,F=!n.parentId&&n.status==="active",[B,Y]=N.useState(!0);let ee;e[0]!==I?(ee=()=>{Y(Ne=>{var ce;const Ge=!Ne;return Ge&&((ce=I==null?void 0:I.current)==null||ce.call(I)),Ge})},e[0]=I,e[1]=ee):ee=e[1];const J=ee;let G,q;e[2]!==L||e[3]!==J?(G=()=>{L&&(L.current={toggle:()=>{J()}})},q=[L,J],e[2]=L,e[3]=J,e[4]=G,e[5]=q):(G=e[4],q=e[5]),N.useEffect(G,q);let te;e[6]!==r||e[7]!==o?(te=y$(r,o),e[6]=r,e[7]=o,e[8]=te):te=e[8];const re=te;let oe;if(e[9]!==r||e[10]!==v||e[11]!==n.id){let Ne;e[13]!==r||e[14]!==n.id?(Ne=Ge=>Ge.sessionId!==n.id?!1:!r.some(ce=>ce.parts.some(ve=>ve.type==="tool"&&ve.callId===Ge.toolCallId)),e[13]=r,e[14]=n.id,e[15]=Ne):Ne=e[15],oe=v.filter(Ne),e[9]=r,e[10]=v,e[11]=n.id,e[12]=oe}else oe=e[12];const se=oe,ye=r.length>=4;let Ee;e[16]!==f||e[17]!==u||e[18]!==p||e[19]!==$||e[20]!==D||e[21]!==k||e[22]!==l||e[23]!==C||e[24]!==x||e[25]!==w||e[26]!==P||e[27]!==A||e[28]!==R||e[29]!==y||e[30]!==a||e[31]!==V||e[32]!==n||e[33]!==ye||e[34]!==S||e[35]!==Q?(Ee=m.jsx(D7,{session:n,preconfigs:a,models:l,defaultModel:p,usage:S,modelName:k,onChangePreconfig:x,onChangeModel:C,onChangeVariant:w,onRename:y,onNavigateBack:R,isStreaming:D,onInterrupt:A,onCompact:P,isCompacting:$,canCompact:ye,connectedProviderIds:u,connectableProviderIds:f,selectedVariant:V,variants:Q}),e[16]=f,e[17]=u,e[18]=p,e[19]=$,e[20]=D,e[21]=k,e[22]=l,e[23]=C,e[24]=x,e[25]=w,e[26]=P,e[27]=A,e[28]=R,e[29]=y,e[30]=a,e[31]=V,e[32]=n,e[33]=ye,e[34]=S,e[35]=Q,e[36]=Ee):Ee=e[36];let Ae;e[37]!==O||e[38]!==j||e[39]!==B||e[40]!==U||e[41]!==re||e[42]!==$||e[43]!==F||e[44]!==r||e[45]!==P||e[46]!==T||e[47]!==b||e[48]!==_||e[49]!==v||e[50]!==I||e[51]!==n.id||e[52]!==n.status?(Ae=m.jsx(g$,{displayItems:re,messagesWithParts:r,sessionId:n.id,sessionStatus:n.status,pendingPermissions:v,isCompacting:$,compactionSuccess:U,onPermissionResponse:b,onNavigateToSubagent:T,onRemoveFromQueue:_,onRevert:j,onFork:O,onCompact:P,isMainActiveSession:F,autoFollow:B,onAutoScrollChange:Y,scrollToBottomRef:I}),e[37]=O,e[38]=j,e[39]=B,e[40]=U,e[41]=re,e[42]=$,e[43]=F,e[44]=r,e[45]=P,e[46]=T,e[47]=b,e[48]=_,e[49]=v,e[50]=I,e[51]=n.id,e[52]=n.status,e[53]=Ae):Ae=e[53];const Be=B?"Auto-follow enabled (Cmd+Shift+F)":"Auto-follow disabled (Cmd+Shift+F)";let le;e[54]!==B?(le=B?m.jsxs(m.Fragment,{children:[m.jsx(J4,{className:"size-3"}),m.jsx("span",{children:"Follow"})]}):m.jsxs(m.Fragment,{children:[m.jsx(rS,{className:"size-3"}),m.jsx("span",{children:"Free"})]}),e[54]=B,e[55]=le):le=e[55];let Ce;e[56]!==J||e[57]!==le||e[58]!==Be?(Ce=m.jsx("button",{onClick:J,className:"absolute bottom-4 right-4 z-50 flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-full transition-colors cursor-pointer bg-background/80 backdrop-blur-sm hover:bg-background border border-border/50 shadow-sm pointer-events-auto",title:Be,children:le}),e[56]=J,e[57]=le,e[58]=Be,e[59]=Ce):Ce=e[59];let ge;e[60]!==Ce||e[61]!==Ae?(ge=m.jsxs("div",{className:"relative flex flex-col flex-1 min-h-0",children:[Ae,Ce]}),e[60]=Ce,e[61]=Ae,e[62]=ge):ge=e[62];let Oe;e[63]!==b||e[64]!==se?(Oe=se.length>0&&m.jsx(b$,{permissions:se,onPermissionResponse:b}),e[63]=b,e[64]=se,e[65]=Oe):Oe=e[65];let He;e[66]!==K||e[67]!==X||e[68]!==$||e[69]!==h||e[70]!==c||e[71]!==W||e[72]!==n.parentId||e[73]!==n.status||e[74]!==n.workspaceId?(He=n.status==="active"&&!n.parentId&&m.jsx(z7,{ref:X,onSendMessage:h,disabled:$,workspaceId:n.workspaceId,serverUrl:W,apiToken:K,prompts:c}),e[66]=K,e[67]=X,e[68]=$,e[69]=h,e[70]=c,e[71]=W,e[72]=n.parentId,e[73]=n.status,e[74]=n.workspaceId,e[75]=He):He=e[75];let rt;e[76]!==n.parentId?(rt=n.parentId&&m.jsxs("div",{className:"p-4 border-t border-border bg-muted/50 text-center flex items-center justify-center gap-2 text-sm text-muted-foreground",children:[m.jsx(J5,{className:"size-4"}),"This is a subagent session (read-only)"]}),e[76]=n.parentId,e[77]=rt):rt=e[77];let Qe;return e[78]!==ge||e[79]!==Oe||e[80]!==He||e[81]!==rt||e[82]!==Ee?(Qe=m.jsxs("div",{className:"flex flex-col flex-1 min-h-0 relative",children:[Ee,ge,Oe,He,rt]}),e[78]=ge,e[79]=Oe,e[80]=He,e[81]=rt,e[82]=Ee,e[83]=Qe):Qe=e[83],Qe}function S$(t){const e=he.c(84),{servers:n,activeServer:r,isSwitching:o,connected:a,authError:c,connectionTimedOut:l,retryCount:u,nextRetryIn:f,serverUrl:p,currentSession:h,messagesWithParts:_,queuedMessages:x,preconfigs:C,primaryPreconfigs:w,prompts:v,models:b,providerStatuses:y,defaultModel:S,selectedVariant:k,pendingPermissions:T,sessionUsage:R,currentModel:D,streamingSessionIds:A,isCompacting:j,compactionSuccess:O,isPrimarySession:P,inputRef:$,apiToken:U,onFirstServerAdded:W,onRetry:K,onLogout:V,onSendMessage:Q,onRemoveFromQueue:X,onChangePreconfig:I,onChangeModel:L,onChangeVariant:z,onPermissionResponse:F,onRename:B,onNavigateToSubagent:Y,onNavigateBack:ee,onInterrupt:J,onRevert:G,onFork:q,onCompact:te,onClearCompactionSuccess:re,scrollToBottomRef:oe,autoFollowToggleRef:se}=t;let ye;e[0]!==y?(ye=new Set(y.filter(A$).map(E$)),e[0]=y,e[1]=ye):ye=e[1];const Ee=ye;let Ae;e[2]!==y?(Ae=new Set(y.filter(k$).map(C$)),e[2]=y,e[3]=Ae):Ae=e[3];const Be=Ae,le=!!r;let Ce;e[4]!==I?(Ce=De=>{I(De)},e[4]=I,e[5]=Ce):Ce=e[5];const ge=Ce;let Oe;e[6]!==z?(Oe=De=>{z(De)},e[6]=z,e[7]=Oe):Oe=e[7];const He=Oe;let rt;e[8]!==J?(rt=()=>{J()},e[8]=J,e[9]=rt):rt=e[9];const Qe=rt;if(n.length===0){const De=c||void 0;let $e;return e[10]!==W||e[11]!==De?($e=m.jsx(Pb,{onServerAdded:W,error:De}),e[10]=W,e[11]=De,e[12]=$e):$e=e[12],$e}if(!le){const De=c||void 0;let $e;return e[13]!==W||e[14]!==De?($e=m.jsx(Pb,{onServerAdded:W,error:De}),e[13]=W,e[14]=De,e[15]=$e):$e=e[15],$e}if(o){const De=`Connecting to ${(r==null?void 0:r.name)||"server"}...`;let $e;return e[16]!==De?($e=m.jsx("div",{className:"flex flex-col w-full h-full items-center justify-center bg-background gap-4",children:m.jsx(Ib,{message:De})}),e[16]=De,e[17]=$e):$e=e[17],$e}if(!a&&n.length>0){if(l){let gt;return e[18]!==c||e[19]!==f||e[20]!==V||e[21]!==K||e[22]!==u||e[23]!==p?(gt=m.jsx("div",{className:"flex w-full h-full items-center justify-center bg-background",children:m.jsx(m7,{serverUrl:p,authError:c,retryCount:u,nextRetryIn:f,onRetry:K,onLogout:V})}),e[18]=c,e[19]=f,e[20]=V,e[21]=K,e[22]=u,e[23]=p,e[24]=gt):gt=e[24],gt}let De;e[25]===Symbol.for("react.memo_cache_sentinel")?(De=m.jsx(Ib,{}),e[25]=De):De=e[25];let $e;return e[26]!==V?($e=m.jsxs("div",{className:"flex flex-col w-full h-full items-center justify-center bg-background gap-4",children:[De,m.jsx(Fe,{variant:"ghost",size:"sm",onClick:V,className:"text-muted-foreground",children:"Change Server"})]}),e[26]=V,e[27]=$e):$e=e[27],$e}if(!h){let De;return e[28]===Symbol.for("react.memo_cache_sentinel")?(De=m.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-center text-muted-foreground px-6",children:[m.jsx("h2",{className:"mb-2",children:"Select or create a session"}),m.jsx("p",{children:"Choose a session from the sidebar or create a new one to start chatting."})]}),e[28]=De):De=e[28],De}let Ne;e[29]!==_?(Ne=_.filter(w$),e[29]=_,e[30]=Ne):Ne=e[30];const ce=Ne.length>=4;let ve;if(e[31]!==D||e[32]!==b){let De;e[34]!==D?(De=$e=>$e.id===D,e[34]=D,e[35]=De):De=e[35],ve=b.find(De),e[31]=D,e[32]=b,e[33]=ve}else ve=e[33];const Te=ve;let je;e[36]!==h.id||e[37]!==x?(je=x[h.id]||[],e[36]=h.id,e[37]=x,e[38]=je):je=e[38];const Le=P?w:C,Je=Te==null?void 0:Te.variants;let Ue;e[39]!==h.id||e[40]!==h.runningAt||e[41]!==A?(Ue=A.has(h.id)||!!h.runningAt,e[39]=h.id,e[40]=h.runningAt,e[41]=A,e[42]=Ue):Ue=e[42];let Pe;e[43]!==ce||e[44]!==h.id||e[45]!==te?(Pe=ce?()=>te(h.id):void 0,e[43]=ce,e[44]=h.id,e[45]=te,e[46]=Pe):Pe=e[46];const Re=p!=null?p:void 0,Ke=U!=null?U:void 0;let we;return e[47]!==se||e[48]!==O||e[49]!==Be||e[50]!==Ee||e[51]!==D||e[52]!==h||e[53]!==S||e[54]!==ge||e[55]!==He||e[56]!==Qe||e[57]!==$||e[58]!==j||e[59]!==_||e[60]!==b||e[61]!==L||e[62]!==re||e[63]!==q||e[64]!==ee||e[65]!==Y||e[66]!==F||e[67]!==X||e[68]!==B||e[69]!==G||e[70]!==Q||e[71]!==T||e[72]!==v||e[73]!==oe||e[74]!==k||e[75]!==R||e[76]!==Je||e[77]!==Ue||e[78]!==Pe||e[79]!==Re||e[80]!==Ke||e[81]!==je||e[82]!==Le?(we=m.jsx(x$,{inputRef:$,session:h,messagesWithParts:_,queuedMessages:je,preconfigs:Le,prompts:v,models:b,connectedProviderIds:Ee,connectableProviderIds:Be,defaultModel:S,onSendMessage:Q,onRemoveFromQueue:X,onChangePreconfig:ge,onChangeModel:L,onChangeVariant:He,selectedVariant:k,variants:Je,pendingPermissions:T,onPermissionResponse:F,onRename:B,usage:R,modelName:D,onNavigateToSubagent:Y,onNavigateBack:ee,isStreaming:Ue,onInterrupt:Qe,onRevert:G,onFork:q,onCompact:Pe,isCompacting:j,compactionSuccess:O,onClearCompactionSuccess:re,serverUrl:Re,apiToken:Ke,scrollToBottomRef:oe,autoFollowToggleRef:se}),e[47]=se,e[48]=O,e[49]=Be,e[50]=Ee,e[51]=D,e[52]=h,e[53]=S,e[54]=ge,e[55]=He,e[56]=Qe,e[57]=$,e[58]=j,e[59]=_,e[60]=b,e[61]=L,e[62]=re,e[63]=q,e[64]=ee,e[65]=Y,e[66]=F,e[67]=X,e[68]=B,e[69]=G,e[70]=Q,e[71]=T,e[72]=v,e[73]=oe,e[74]=k,e[75]=R,e[76]=Je,e[77]=Ue,e[78]=Pe,e[79]=Re,e[80]=Ke,e[81]=je,e[82]=Le,e[83]=we):we=e[83],we}function w$(t){return t.message.role!=="system"}function C$(t){return t.provider}function k$(t){return t.connectable}function E$(t){return t.provider}function A$(t){return t.connected}function R$(t,e){var C;const{session:n}=t,{setSessions:r,setCurrentSession:o,setMessagesBySession:a,setPartsBySession:c,setSessionUsage:l,setCurrentModel:u,setSelectedVariant:f,pendingSessionCreateRef:p,sessionAccessTimesRef:h,partIdIndexRef:_,defaultModel:x}=e;r(w=>[n,...w]),p.current&&(o(n),a({[n.id]:[]}),c({[n.id]:{}}),_.current.clear(),l({promptTokens:0,completionTokens:0,totalTokens:0}),u(n.selectedModel||x),f((C=n.selectedVariant)!=null?C:null),p.current=!1),h.current.set(n.id,Date.now())}function T$(t,e){var D;const{session:n,messages:r,usage:o,isRunning:a}=t,{setCurrentSession:c,removeInterruptedSession:l,addStreamingSession:u,removeStreamingSession:f,skipFinishSoundSessionIdsRef:p,setMessagesBySession:h,setPartsBySession:_,setSessionUsage:x,setCurrentModel:C,setSelectedVariant:w,sessionAccessTimesRef:v,partIdIndexRef:b,models:y,defaultModel:S,clearCompletion:k}=e;if(c(n),l(n.id),k(n.id),a?u(n.id):(f(n.id),p.current.add(n.id)),r){h({[n.id]:r.map(A=>A.message)}),_(()=>{const A={};A[n.id]={};for(const j of r)A[n.id][j.message.id]=j.parts;return A}),b.current.clear();for(const A of r)for(let j=0;j<A.parts.length;j++)b.current.set(A.parts[j].id,{sessionId:n.id,messageId:A.message.id,index:j})}x(o!=null?o:{promptTokens:0,completionTokens:0,totalTokens:0}),C(n.selectedModel||S),w(n.selectedVariant||null);const T=n.selectedModel||S,R=(D=y.find(A=>A.id===T))==null?void 0:D.variants;n.selectedVariant&&R&&!R[n.selectedVariant]&&w(null),v.current.set(n.id,Date.now())}function N$(t,e){const{sessionId:n}=t,{setSessions:r,setMessagesBySession:o,setPartsBySession:a,setCurrentSession:c,partIdIndexRef:l,partAppendRafRef:u,pendingPartAppendsRef:f,sessionAccessTimesRef:p,currentSessionIdRef:h,clearCompletion:_}=e;r(x=>x.map(C=>C.id===n?{...C,status:"closed"}:C)),_(n),h.current===n&&(u.current!==null&&(cancelAnimationFrame(u.current),u.current=null),f.current.clear()),o(x=>{const C={...x};return delete C[n],C}),a(x=>{const C={...x};return delete C[n],C});for(const[x,C]of l.current)C.sessionId===n&&l.current.delete(x);p.current.delete(n),h.current===n&&c(null)}function M$(t,e){const{session:n}=t,{setSessions:r,setCurrentSession:o,currentSessionIdRef:a}=e;r(c=>c.map(l=>l.id===n.id?n:l)),a.current===n.id&&o(n)}function D$(t,e){const{sessionId:n}=t,{setSessions:r,setMessagesBySession:o,setPartsBySession:a,removeInterruptedSession:c,partIdIndexRef:l,sessionAccessTimesRef:u,setCurrentSession:f,currentSessionIdRef:p,clearCompletion:h}=e;r(_=>_.filter(x=>x.id!==n)),h(n),o(_=>{const x={..._};return delete x[n],x}),a(_=>{const x={..._};return delete x[n],x}),c(n);for(const[_,x]of l.current)x.sessionId===n&&l.current.delete(_);u.current.delete(n),p.current===n&&f(null)}function j$(t,e){const{session:n}=t,{setSessions:r,setCurrentSession:o,setSelectedVariant:a,setCurrentModel:c,currentSessionIdRef:l}=e;r(u=>u.map(f=>f.id===n.id?n:f)),l.current===n.id&&(o(n),n.selectedVariant!==void 0&&a(n.selectedVariant),n.selectedModel&&c(n.selectedModel))}function O$(t,e){const{session:n}=t,{setSessions:r,setCurrentSession:o,currentSessionIdRef:a}=e;r(c=>c.map(l=>l.id===n.id?n:l)),a.current===n.id&&o(n)}function L$(t,e){const{sessionId:n,result:r}=t,{addInterruptedSession:o,skipFinishSoundSessionIdsRef:a,removeStreamingSession:c}=e;o(n),a.current.add(n),c(n),r.cascadedTo.length>0&&console.log(`Session ${n} interrupted. Cascaded to:`,r.cascadedTo)}function I$(t,e){const{sessionId:n,revertedTo:r,removed:o}=t;console.log(`Session ${n} reverted to message ${r.messageId}, removed ${o.messageIds.length} messages`)}function P$(t,e){const{forkedSession:n,messages:r}=t,{setSessions:o,setCurrentSession:a,setMessagesBySession:c,setPartsBySession:l,setSessionUsage:u,sessionAccessTimesRef:f,partIdIndexRef:p,clearCompletion:h}=e;o(_=>[n,..._]),c({[n.id]:r.map(_=>_.message)}),l(()=>{const _={};_[n.id]={};for(const x of r)_[n.id][x.message.id]=x.parts;return _}),p.current.clear();for(const _ of r)for(let x=0;x<_.parts.length;x++)p.current.set(_.parts[x].id,{sessionId:n.id,messageId:_.message.id,index:x});a(n),u({promptTokens:0,completionTokens:0,totalTokens:0}),f.current.set(n.id,Date.now()),h(n.id)}function z$(t,e){const{sessionId:n,messages:r}=t,{setMessagesBySession:o,setPartsBySession:a,partIdIndexRef:c,partAppendRafRef:l,skipFinishSoundSessionIdsRef:u,removeStreamingSession:f,sessionAccessTimesRef:p,flushPendingPartAppends:h,currentSessionIdRef:_,clearCompletion:x}=e;if(_.current===n&&(l.current!==null&&(cancelAnimationFrame(l.current),l.current=null),h()),_.current===n){o({[n]:r.map(C=>C.message)}),a(()=>{const C={};C[n]={};for(const w of r)C[n][w.message.id]=w.parts;return C}),c.current.clear();for(const C of r)for(let w=0;w<C.parts.length;w++)c.current.set(C.parts[w].id,{sessionId:n,messageId:C.message.id,index:w})}u.current.add(n),f(n),p.current.set(n,Date.now()),x(n)}const B$={"session.created":R$,"session.resumed":T$,"session.closed":N$,"session.reopened":M$,"session.deleted":D$,"session.updated":j$,"session.renamed":O$,"session.interrupted":L$,"session.reverted":I$,"session.forked":P$,"session.state":z$};function F$(t,e){const{message:n}=t,{setMessagesBySession:r,setPartsBySession:o,addStreamingSession:a,removeInterruptedSession:c,currentSessionIdRef:l,clearCompletion:u}=e;u(n.sessionId),n.sessionId===l.current&&(r(f=>({...f,[n.sessionId]:[...f[n.sessionId]||[],n]})),o(f=>({...f,[n.sessionId]:{...f[n.sessionId],[n.id]:[]}}))),n.sessionId===l.current&&"status"in n&&n.status==="streaming"&&(a(n.sessionId),c(n.sessionId))}function H$(t,e){const{message:n}=t,{setMessagesBySession:r,removeStreamingSession:o,partAppendRafRef:a,partAppendTimeoutRef:c,flushPendingPartAppends:l,currentSessionIdRef:u,sessionsRef:f,setCompletion:p,chatFinishSoundEnabledRef:h,playChatFinishSound:_}=e;if(n.sessionId===u.current&&("status"in n&&n.status!=="streaming"&&(a.current!==null&&(cancelAnimationFrame(a.current),a.current=null),c.current!==null&&(clearTimeout(c.current),c.current=null),l()),r(x=>({...x,[n.sessionId]:(x[n.sessionId]||[]).map(C=>C.id===n.id?n:C)}))),"status"in n&&n.status!=="streaming"){o(n.sessionId);const x=f.current.find(w=>w.id===n.sessionId);if(x&&x.parentId===null){const w=Date.now();p(n.sessionId,{type:"flash-only",flashStartedAt:w}),h.current&&_()}}}function U$(t,e){const{sessionId:n,part:r}=t,{setPartsBySession:o,partIdIndexRef:a,currentSessionIdRef:c,clearCompletion:l}=e;if(l(n),n===c.current){o(f=>{const p=f[n]||{},h=p[r.messageId]||[];return{...f,[n]:{...p,[r.messageId]:[...h,r]}}});let u=0;for(const f of a.current.values())f.sessionId===n&&f.messageId===r.messageId&&(u=Math.max(u,f.index+1));a.current.set(r.id,{sessionId:n,messageId:r.messageId,index:u})}}function $$(t,e){const{sessionId:n,part:r}=t,{setPartsBySession:o,partIdIndexRef:a,currentSessionIdRef:c,clearCompletion:l}=e;if(l(n),n===c.current){const u=a.current.get(r.id);o(u?f=>{const p=f[u.sessionId];if(!p)return f;const h=p[u.messageId];if(!h)return f;const _=[...h];return _[u.index]=r,{...f,[u.sessionId]:{...p,[u.messageId]:_}}}:f=>{const p=f[n]||{},h=p[r.messageId]||[];return{...f,[n]:{...p,[r.messageId]:h.map(_=>_.id===r.id?r:_)}}})}}function q$(t,e){const{sessionId:n,partId:r,delta:o}=t,{addStreamingSession:a,pendingPartAppendsRef:c,partAppendRafRef:l,lastPartAppendFlushAtRef:u,partAppendTimeoutRef:f,interruptedSessions:p,currentSessionIdRef:h,flushPendingPartAppends:_,clearCompletion:x}=e;if(x(n),n===h.current&&!p.has(n)&&a(n),n===h.current){const C=c.current.get(r);c.current.set(r,(C||"")+o);const v=Date.now()-u.current,b=50;if(v<b){if(f.current===null){const y=b-v;f.current=setTimeout(()=>{f.current=null,l.current===null&&(l.current=requestAnimationFrame(()=>{_()}))},y)}}else l.current===null&&(l.current=requestAnimationFrame(()=>{_()}))}}function V$(t,e){const{sessionId:n,usage:r,model:o}=t,{setSessionUsage:a,setCurrentModel:c,currentSessionIdRef:l}=e;n===l.current&&(a({promptTokens:r.promptTokens,completionTokens:r.completionTokens,totalTokens:r.totalTokens}),c(o))}function W$(t,e){const{sessionId:n}=t,{setCompactionSuccess:r,currentSessionIdRef:o}=e;n===o.current&&r(!0)}function G$(t,e){const{code:n,message:r}=t;console.error("Server error:",n,r)}const K$={"message.created":F$,"message.updated":H$,"part.created":U$,"part.updated":$$,"part.append":q$,"chat.usage":V$,"compaction.complete":W$,error:G$};function Y$(t,e){const{permissions:n}=t,{setPermissions:r}=e;r(n)}function X$(t,e){const{approvals:n}=t,{mergePendingPermissions:r}=e;r(n.map(o=>({toolCallId:o.toolCallId,sessionId:o.sessionId,toolName:o.toolName,args:o.args,permissionType:o.permissionType,permissionKey:o.permissionKey,message:o.message,details:o.details,dangerous:o.dangerous,childSessionId:o.childSessionId,subagentName:o.subagentName})))}function Q$(t,e){const{permissionId:n}=t,{setPermissions:r}=e;r(o=>o.map(a=>a.id===n?{...a,revokedAt:new Date().toISOString()}:a))}function Z$(t,e){const{setPermissions:n}=e;n(r=>{const o=new Date().toISOString();return r.map(a=>({...a,revokedAt:o}))})}function J$(t,e){const{sessionId:n,toolCallId:r,toolName:o,args:a,permissionType:c,permissionKey:l,message:u,details:f,dangerous:p,childSessionId:h,subagentName:_}=t,{addPendingPermission:x,sessionsRef:C,notifiedToolCallIdsRef:w,permissionSoundEnabledRef:v,playPermissionSound:b}=e;x({toolCallId:r,sessionId:n,toolName:o,args:a,permissionType:c,permissionKey:l,message:u,details:f,dangerous:p,childSessionId:h,subagentName:_});const S=C.current.find(k=>k.id===n);(S==null?void 0:S.parentId)===null&&v.current&&!w.current.has(r)&&(b(),w.current.add(r))}function eq(t,e){const{toolCallId:n}=t,{removePendingPermissionByToolCallId:r}=e;r(n)}function tq(t,e){const{sessionId:n,messages:r}=t,{setQueuedMessagesForSession:o}=e;o(n,r)}function nq(t,e){const{sessionId:n,message:r}=t,{addQueuedMessage:o}=e;o(n,r)}function rq(t,e){const{sessionId:n,queueId:r}=t,{removeQueuedMessageById:o}=e;o(n,r)}function sq(t,e){const{sessionId:n,queueId:r}=t,{removeQueuedMessageById:o}=e;o(n,r)}const iq={"permission.list":Y$,"permissions.sync":X$,"permission.revoked":Q$,"permission.all_revoked":Z$,"permission.request":J$,"permission.granted":eq,"queue.list":tq,"queue.added":nq,"queue.removed":rq,"queue.sending":sq};function oq(t,e){const{provider:n,connected:r,authorizationUrl:o,error:a}=t,{setProviderStatuses:c}=e;c(l=>l.find(f=>f.provider===n)?l.map(f=>f.provider===n?{...f,connected:r,authorizationUrl:o,error:a}:f):[...l,{provider:n,connected:r,authorizationUrl:o,error:a}])}function aq(t,e){const{provider:n,connected:r,connectedAt:o,accountId:a}=t,{setProviderStatuses:c}=e;c(l=>l.map(u=>u.provider===n?{...u,connected:r,connectedAt:o,accountId:a}:u))}const lq={"provider.status":oq,"provider.connected":aq},Hx=t=>t?`http://${t}/api`:null;function cq(){var Yc,Xc,Io,Qc,Zc;const{servers:t,activeServer:e,addServer:n,removeServer:r,isSwitching:o,clearSwitchingState:a,quickConnections:c,isAddingServerRef:l,prepareForServerAdd:u,removeFromQuickConnectionsByWorkspace:f}=ja(),{sessions:p,currentSession:h,setSessions:_,setCurrentSession:x,clearSessionState:C}=O4(oo(pe=>({sessions:pe.sessions,currentSession:pe.currentSession,setSessions:pe.setSessions,setCurrentSession:pe.setCurrentSession,clearSessionState:pe.clearSessionState}))),[w,v]=N.useState([]),[b,y]=N.useState([]),{setMessagesBySession:S,setPartsBySession:k}=ql(oo(pe=>({setMessagesBySession:pe.setMessagesBySession,setPartsBySession:pe.setPartsBySession}))),T=h==null?void 0:h.id,R=ql(oo(pe=>T?pe.messagesBySession[T]||[]:[])),D=ql(oo(pe=>T?pe.partsBySession[T]||{}:{})),A=N.useRef({});N.useLayoutEffect(()=>{A.current=ql.getState().messagesBySession});const j=1,O=N.useRef(new Map),P=N.useRef(0),[$,U]=N.useState(null),W=N.useRef(null),K=N.useRef(null),V=N.useRef(null),Q=N.useRef(null),X=N.useRef(null),I=N.useRef(null),L=N.useRef(null),[z,F]=N.useState(!1),B=N.useRef([]),{streamingSessionIds:Y,interruptedSessions:ee,clearStreamingSessions:J,clearInterruptedSessions:G,addStreamingSession:q,removeStreamingSession:te,addInterruptedSession:re,removeInterruptedSession:oe}=Im(oo(pe=>({streamingSessionIds:pe.streamingSessionIds,interruptedSessions:pe.interruptedSessions,clearStreamingSessions:pe.clearStreamingSessions,clearInterruptedSessions:pe.clearInterruptedSessions,addStreamingSession:pe.addStreamingSession,removeStreamingSession:pe.removeStreamingSession,addInterruptedSession:pe.addInterruptedSession,removeInterruptedSession:pe.removeInterruptedSession}))),[se,ye]=N.useState({promptTokens:0,completionTokens:0,totalTokens:0}),[Ee,Ae]=N.useState("gpt-4o"),[Be,le]=N.useState(null),[Ce,ge]=N.useState([]),[Oe,He]=N.useState("gpt-4o");N.useEffect(()=>{var At;const pe=(At=Ce.find(zt=>zt.id===Ee))==null?void 0:At.variants;Be&&pe&&!pe[Be]&&le(null)},[Ee,Be,Ce]);const[rt,Qe]=N.useState([]),[Ne,Ge]=N.useState(null),{showSettings:ce,showMCPDialog:ve,showAddServer:Te,editServerData:je,setShowSettings:Le,setShowMCPDialog:Je,setShowAddServer:Ue,setEditServerData:Pe,setCompletion:Re,clearCompletion:Ke,clearAllCompletions:we}=Qt(oo(pe=>({showSettings:pe.showSettings,showMCPDialog:pe.showMCPDialog,showAddServer:pe.showAddServer,editServerData:pe.editServerData,setShowSettings:pe.setShowSettings,setShowMCPDialog:pe.setShowMCPDialog,setShowAddServer:pe.setShowAddServer,setEditServerData:pe.setEditServerData,setCompletion:pe.setCompletion,clearCompletion:pe.clearCompletion,clearAllCompletions:pe.clearAllCompletions}))),[De,$e]=N.useState(()=>{const pe=localStorage.getItem("jean2_sound_chat_finish_enabled");return pe!==null?pe==="true":!0}),[gt,It]=N.useState(()=>{const pe=localStorage.getItem("jean2_sound_permission_enabled");return pe!==null?pe==="true":!0}),Et=N.useRef(gt);N.useLayoutEffect(()=>{Et.current=gt},[gt]);const[Zt,qt]=N.useState([]),[tt,vt]=N.useState([]),{pendingPermissions:Vt,queuedMessages:Ht,clearPendingPermissions:Wt,clearQueuedMessages:Sn,mergePendingPermissions:jr,addPendingPermission:zn,removePendingPermissionByToolCallId:Wn,removePendingPermissionsBySessionId:Gn,setQueuedMessagesForSession:Gt,addQueuedMessage:dn,removeQueuedMessageById:gn}=j4(oo(pe=>({pendingPermissions:pe.pendingPermissions,queuedMessages:pe.queuedMessages,clearPendingPermissions:pe.clearPendingPermissions,clearQueuedMessages:pe.clearQueuedMessages,mergePendingPermissions:pe.mergePendingPermissions,addPendingPermission:pe.addPendingPermission,removePendingPermissionByToolCallId:pe.removePendingPermissionByToolCallId,removePendingPermissionsBySessionId:pe.removePendingPermissionsBySessionId,setQueuedMessagesForSession:pe.setQueuedMessagesForSession,addQueuedMessage:pe.addQueuedMessage,removeQueuedMessageById:pe.removeQueuedMessageById}))),[Or,Mn]=N.useState(null),[jt,Ut]=N.useState(!1),[Dn,Bn]=N.useState(0),[Us,Lr]=N.useState(0),[Xr,Fn]=N.useState(0),Qr=(Yc=h==null?void 0:h.compacting)!=null?Yc:!1,[yr,vn]=N.useState(!1),wn=N.useRef(new Set),Hn=N.useRef(0),_t=N.useRef(new Map),Kn=N.useRef(new Map),jn=N.useRef(null),fn=N.useRef(0),Kt=N.useRef(null),Ir=N.useCallback(()=>{if(jn.current!==null&&(cancelAnimationFrame(jn.current),jn.current=null),Kt.current!==null&&(clearTimeout(Kt.current),Kt.current=null),Kn.current.size===0)return;const pe=new Map(Kn.current);Kn.current.clear(),fn.current=Date.now(),k(At=>{const zt={...At};let bt=!1;for(const[en,wt]of pe){const Ct=_t.current.get(en);if(!Ct)continue;const Ui=zt[Ct.sessionId];if(!Ui)continue;const $i=Ui[Ct.messageId];if(!$i)continue;const qi=$i[Ct.index];if(!qi||qi.type!=="text"&&qi.type!=="reasoning")continue;bt=!0;const Jc=[...$i];Jc[Ct.index]={...qi,text:qi.text+wt},zt[Ct.sessionId]={...Ui,[Ct.messageId]:Jc}}return bt?zt:At})},[k]),{playChatFinishSound:Zr,playPermissionSound:Jr}=tL(),Pr=N.useRef(new Set),Yn=N.useRef(null),rr=N.useRef(De);N.useLayoutEffect(()=>{rr.current=De},[De]),N.useEffect(()=>{localStorage.setItem("jean2_sound_chat_finish_enabled",String(De))},[De]),N.useEffect(()=>{localStorage.setItem("jean2_sound_permission_enabled",String(gt))},[gt]),N.useLayoutEffect(()=>{const pe=ql.getState().getMessagesBySessionKeysCount();if(pe<=P.current){P.current=pe;return}if(P.current=pe,pe<=j)return;const At=A.current,zt=Object.keys(At);for(;zt.length>j;){let bt=null,en=1/0;for(const wt of zt){if(wt===(h==null?void 0:h.id))continue;const Ct=O.current.get(wt);Ct!==void 0&&Ct<en&&(en=Ct,bt=wt)}if(!bt)break;O.current.delete(bt);for(const[wt,Ct]of _t.current)Ct.sessionId===bt&&_t.current.delete(wt);zt.splice(zt.indexOf(bt),1),S(wt=>{if(!(bt in wt))return wt;const Ct={...wt};return delete Ct[bt],Ct}),k(wt=>{if(!(bt in wt))return wt;const Ct={...wt};return delete Ct[bt],Ct})}},[h,S,k]);const Cn=N.useRef(null),[,Jt]=N.useState(!1),rn=(Xc=e==null?void 0:e.token)!=null?Xc:null,sn=(Io=e==null?void 0:e.url)!=null?Io:null;N.useEffect(()=>{W.current=$},[$]),N.useEffect(()=>{var pe;K.current=(pe=h==null?void 0:h.id)!=null?pe:null},[h]),N.useEffect(()=>{wn.current.clear()},[h==null?void 0:h.id]),N.useLayoutEffect(()=>{B.current=p},[p]);const $s=N.useRef(null),Eo=N.useRef(!1),Ao=N.useCallback(pe=>{var At;(At=$s.current)==null||At.call($s,pe)},[]),$f=N.useCallback(pe=>{u(),n(pe.name,pe.url,pe.token)},[n,u]),_n=N.useCallback(()=>{e&&r(e.id),W.current&&W.current.close(),U(null),F(!1),Ut(!1),Bn(0),Lr(0)},[e,r]),Qa=N.useCallback(()=>{Bn(pe=>pe+1),Ut(!1),Lr(0)},[]),Oi=N.useCallback(()=>{Hn.current+=1,W.current&&W.current.close(),U(null),F(!1),Ut(!1),Bn(0),Lr(0),C(),v([]),S({}),k({}),O.current.clear(),P.current=0,Pr.current=new Set(Im.getState().streamingSessionIds),wn.current.clear(),J(),G(),ye({promptTokens:0,completionTokens:0,totalTokens:0}),Ae("gpt-4o"),ge([]),Qe([]),Ge(null),qt([]),Wt(),Sn(),we(),_t.current.clear(),jn.current!==null&&(cancelAnimationFrame(jn.current),jn.current=null),Kt.current!==null&&(clearTimeout(Kt.current),Kt.current=null),Kn.current.clear(),fn.current=0,Fn(pe=>pe+1)},[]);N.useEffect(()=>{var pe;(e==null?void 0:e.id)!==Cn.current&&l.current&&(l.current=!1,Cn.current=(pe=e==null?void 0:e.id)!=null?pe:null,Oi())},[e,Oi,l]);const Li=N.useCallback(async(pe,At={})=>{if(!rn)throw new Error("No API token available");const zt=new Headers(At.headers||{});zt.set("Authorization",`Bearer ${rn}`);const bt=await fetch(pe,{...At,signal:At.signal,headers:zt});if(bt.status===401)throw Mn("Authentication failed. Your token may have been regenerated."),_n(),new Error("Unauthorized");return bt},[rn,_n]),qs=N.useCallback(pe=>pe!==T?[]:R.map(At=>({message:At,parts:(D[At.id]||[]).sort((zt,bt)=>zt.createdAt-bt.createdAt)})),[T,R,D]);aL({apiToken:rn,serverUrl:sn,wsRef:W,serverEpochRef:Hn,currentSessionIdRef:K,clearPendingPermissions:Wt,handleLogout:_n,setWs:U,setConnected:F,setAuthError:Mn,setConnectionTimedOut:Ut,setRetryCount:Bn,setNextRetryIn:Lr,setReconnectTrigger:Fn,reconnectTrigger:Xr,connected:z,connectionTimedOut:jt,retryCount:Dn,onMessage:Ao}),cL({apiToken:rn,serverUrl:sn,reconnectTrigger:Xr,serverEpochRef:Hn,fetchWithAuth:Li,clearSwitchingState:a,setSessions:_,setPreconfigs:v,setPrompts:y,setModels:ge,setDefaultModel:He,setProviderStatuses:vt,setWorkspaces:Qe,setActiveWorkspace:Ge,activeWorkspace:Ne,setIsLoadingServerData:Jt,setAuthError:Mn,pendingWorkspaceIdRef:Yn});const Za=async(pe,At,zt)=>{const bt=Hx(sn);if(!bt)return;const Ct=(await(await Li(`${bt}/workspaces`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:pe,path:At,isVirtual:zt})})).json()).workspace;return Qe(Ui=>[...Ui,Ct]),Ge(Ct),x(null),Ct},Hc=pe=>{Ge(pe),x(null)},Vs=pe=>{Yn.current=pe},qf=async pe=>{const At=Hx(sn);if(!At)return;const zt=await Li(`${At}/workspaces/${pe}`,{method:"DELETE"});if(!zt.ok){const en=await zt.json().catch(()=>({message:"Failed to delete workspace"}));console.error("Failed to delete workspace:",en.message);return}const{deletedSessions:bt}=await zt.json();f(pe),h&&(h.workspaceId===pe||bt.includes(h.id))&&x(null),_(en=>en.filter(wt=>!bt.includes(wt.id))),S(en=>{const wt={...en};return bt.forEach(Ct=>delete wt[Ct]),wt}),k(en=>{const wt={...en};return bt.forEach(Ct=>delete wt[Ct]),wt}),bt.forEach(en=>O.current.delete(en));for(const[en,wt]of _t.current)bt.includes(wt.sessionId)&&_t.current.delete(en);Qe(en=>{const wt=en.filter(Ct=>Ct.id!==pe);return(Ne==null?void 0:Ne.id)===pe&&Ge(wt[0]||null),wt})},Uc=async()=>{const pe=`Workspace ${rt.length+1}`,At=`~/.jean2/workspaces/${crypto.randomUUID()}`;await Za(pe,At,!0)},$c=async pe=>{const At=pe.split("/").pop()||pe.split("\\").pop()||"Workspace";await Za(At,pe,!1)},ps=N.useMemo(()=>({setSessions:_,setCurrentSession:x,setMessagesBySession:S,setPartsBySession:k,setSessionUsage:ye,setCurrentModel:Ae,setSelectedVariant:le,addStreamingSession:q,removeStreamingSession:te,addInterruptedSession:re,removeInterruptedSession:oe,setQueuedMessagesForSession:Gt,addQueuedMessage:dn,removeQueuedMessageById:gn,clearPendingPermissions:Wt,clearQueuedMessages:Sn,setCompactionSuccess:vn,setCompletion:Re,clearCompletion:Ke,clearAllCompletions:we,pendingSessionCreateRef:Eo,sessionAccessTimesRef:O,partIdIndexRef:_t,partAppendRafRef:jn,pendingPartAppendsRef:Kn,lastPartAppendFlushAtRef:fn,partAppendTimeoutRef:Kt,skipFinishSoundSessionIdsRef:Pr,currentSessionIdRef:K,models:Ce,defaultModel:Oe,interruptedSessions:ee,sessionsRef:B,flushPendingPartAppends:Ir,setProviderStatuses:vt,setPermissions:qt,mergePendingPermissions:jr,addPendingPermission:zn,removePendingPermissionByToolCallId:Wn,notifiedToolCallIdsRef:wn,permissionSoundEnabledRef:Et,playPermissionSound:Jr,chatFinishSoundEnabledRef:rr,playChatFinishSound:Zr}),[_,x,S,k,ye,Ae,le,q,te,re,oe,Gt,dn,gn,Wt,Sn,vn,Eo,O,_t,jn,Kn,fn,Kt,Pr,K,Ce,Oe,ee,B,Ir,vt,qt,jr,zn,Wn,wn,Et,Jr,Re,Ke,we,rr,Zr]),qc=N.useCallback(pe=>{switch(pe.type){case"session.created":case"session.resumed":case"session.closed":case"session.reopened":case"session.deleted":case"session.updated":case"session.renamed":case"session.interrupted":case"session.reverted":case"session.forked":case"session.state":B$[pe.type](pe,ps);break;case"message.created":case"message.updated":case"part.created":case"part.updated":case"part.append":case"chat.usage":case"compaction.complete":case"error":K$[pe.type](pe,ps);break;case"permission.list":case"permissions.sync":case"permission.revoked":case"permission.all_revoked":case"permission.request":case"permission.granted":case"queue.list":case"queue.added":case"queue.removed":case"queue.sending":iq[pe.type](pe,ps);break;case"provider.status":case"provider.connected":lq[pe.type](pe,ps);break;default:{console.warn(`[handleServerMessage] Unknown message type: ${pe.type}`);break}}},[ps]);N.useEffect(()=>{$s.current=qc},[qc]);const Ro=w.filter(pe=>pe.mode!=="subagent"),{sendMessage:Ii,createSession:br,resumeSession:To,closeSession:Ja,reopenSession:Ws,permanentlyDeleteSession:Gs,handleRenameSession:el,revertSession:tl,forkSession:Vc,compactSession:Pi,removeFromQueue:zr,sendChatMessage:nl,handlePermissionResponse:zi,handleInterruptSession:Br,updateSessionPreconfig:rl,updateSessionModel:No,updateSessionVariant:Wc,handleNavigateBack:Mo,refreshPermissions:Do,connectProvider:Gc,disconnectProvider:On,createSessionInWorkspace:ms}=gL({ws:$,currentSession:h,sessions:p,workspaces:rt,activeWorkspace:Ne,currentModel:Ee,streamingSessionIds:Y,isCompacting:Qr,primaryPreconfigs:Ro,setCurrentSession:x,setActiveWorkspace:Ge,setCompactionSuccess:vn,setCurrentModel:Ae,setSelectedVariant:le,removePendingPermissionByToolCallId:Wn,removePendingPermissionsBySessionId:Gn,clearStreamingSessions:J,pendingSessionCreateRef:Eo,partAppendRafRef:jn,pendingPartAppendsRef:Kn,skipFinishSoundSessionIdsRef:Pr}),jo=p.filter(pe=>pe.workspaceId===(Ne==null?void 0:Ne.id)),Bi=c.filter(pe=>pe.serverId===(e==null?void 0:e.id)&&pe.workspaceId).map(pe=>pe.workspaceId),Vf=h?qs(h.id):[],sl=h&&(Qc=Ne==null?void 0:Ne.name)!=null?Qc:"Jean2",Oo=Qt(pe=>pe.setSidebarViewMode),Fi=Qt(pe=>pe.sessionsPanelWidth),Hi=N.useCallback(pe=>{const At=Qt.getState().sidebarViewMode,zt=typeof pe=="function"?pe(At):pe;Oo(zt),requestAnimationFrame(()=>{requestAnimationFrame(()=>{var bt;(bt=X.current)==null||bt.focusSessionPanel()})})},[X,Oo]),Kc=!(h!=null&&h.parentId),Lo=!!e;return m.jsxs(n8,{defaultOpen:!0,style:{"--sidebar-width":`${Fi}px`},children:[m.jsx(ML,{sidebarRef:X,terminalPanelRef:Q,chatInputRef:V,activeWorkspace:Ne,primaryPreconfigs:Ro,handleInterruptSession:Br,handleSidebarViewModeChange:Hi,createSession:br,onToggleAutoFollow:()=>{var pe;return(pe=L.current)==null?void 0:pe.toggle()}}),Lo&&m.jsx(x8,{ref:X,allSessions:p,favoritedWorkspaceIds:Bi,sessions:jo,currentSession:h,currentSessionId:(Zc=h==null?void 0:h.id)!=null?Zc:null,streamingSessionIds:Y,connected:z,workspaces:rt,activeWorkspace:Ne,onCreateSession:()=>{var pe;return br((pe=Ro[0])==null?void 0:pe.id)},onResumeSession:To,onCloseSession:Ja,onReopenSession:Ws,onDeleteSession:Gs,onRenameSession:el,onSelectWorkspace:Hc,onCreateVirtualWorkspace:Uc,onCreatePhysicalWorkspace:$c,onDeleteWorkspace:qf,onOpenSettings:()=>Le(!0),onOpenMCP:()=>Je(!0),onOpenAddServer:()=>Ue(!0),onServerSwitch:Oi,onEscape:()=>{var pe;h&&((pe=V.current)==null||pe.focus())},onCreateSessionInWorkspace:ms,pendingPermissions:Vt}),m.jsxs("main",{className:"flex-1 flex flex-col overflow-hidden",style:{paddingTop:"env(safe-area-inset-top, 0)",paddingBottom:"env(safe-area-inset-bottom, 0)"},children:[m.jsx(DL,{headerTitle:sl,isLoggedIn:Lo,activeWorkspace:Ne,onServerSwitch:Oi,onSelectWorkspace:Vs,onSidebarViewModeChange:Hi}),m.jsx(S$,{servers:t,activeServer:e,isSwitching:o,connected:z,authError:Or,connectionTimedOut:jt,retryCount:Dn,nextRetryIn:Us,serverUrl:sn,currentSession:h,messagesWithParts:Vf,queuedMessages:Ht,preconfigs:w,primaryPreconfigs:Ro,prompts:b,models:Ce,providerStatuses:tt,defaultModel:Oe,selectedVariant:Be,pendingPermissions:Vt,sessionUsage:se,currentModel:Ee,streamingSessionIds:Y,isCompacting:Qr,compactionSuccess:yr,isPrimarySession:Kc,inputRef:V,apiToken:rn,onFirstServerAdded:$f,onRetry:Qa,onLogout:_n,onSendMessage:nl,onRemoveFromQueue:zr,onChangePreconfig:rl,onChangeModel:No,onChangeVariant:Wc,onPermissionResponse:zi,onRename:el,onNavigateToSubagent:To,onNavigateBack:Mo,onInterrupt:Br,onRevert:tl,onFork:Vc,onCompact:Pi,onClearCompactionSuccess:()=>vn(!1),scrollToBottomRef:I,autoFollowToggleRef:L}),m.jsx(c7,{workspaceId:Ne==null?void 0:Ne.id,workspacePath:Ne==null?void 0:Ne.path,workspaceName:Ne==null?void 0:Ne.name,serverUrl:sn!=null?sn:void 0,apiToken:rn!=null?rn:void 0,isLoggedIn:Lo,terminalPanelRef:Q})]}),Lo&&m.jsxs(m.Fragment,{children:[m.jsx(U8,{open:ce,onOpenChange:Le,permissions:Zt,onRefreshPermissions:Do,onRevokePermission:pe=>{Ii("permission.revoke",{permissionId:pe})},onRevokeAllPermissions:()=>{Ii("permission.revoke_all",{workspaceId:Ne==null?void 0:Ne.id})},apiToken:rn,onLogout:_n,providerStatuses:tt,onConnectProvider:Gc,onDisconnectProvider:On,chatFinishSoundEnabled:De,onChatFinishSoundEnabledChange:$e,permissionSoundEnabled:gt,onPermissionSoundEnabledChange:It,serverUrl:sn}),m.jsx(K8,{open:ve,onOpenChange:Je,workspaceId:Ne==null?void 0:Ne.id,workspacePath:Ne==null?void 0:Ne.path,serverUrl:sn!=null?sn:void 0,apiToken:rn!=null?rn:void 0})]}),m.jsx(Y8,{open:Te,onOpenChange:pe=>{Ue(pe),pe||Pe(null)},editServer:je})]})}function uq(){const t=he.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=m.jsx(q4,{children:m.jsx(cq,{})}),t[0]=e):e=t[0],e}d4.createRoot(document.getElementById("root")).render(m.jsx(N.StrictMode,{children:m.jsx(m4,{defaultMode:"system",defaultScheme:"neutral",children:m.jsx(uq,{})})}));