kanna-code 0.6.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/index-BQedIo87.css +32 -0
- package/dist/client/assets/index-BnsoKj0W.js +498 -0
- package/dist/client/index.html +2 -2
- package/package.json +2 -1
- package/src/server/external-open.test.ts +60 -0
- package/src/server/external-open.ts +203 -50
- package/src/server/terminal-manager.test.ts +56 -22
- package/src/server/terminal-manager.ts +2 -0
- package/src/server/ws-router.ts +1 -1
- package/src/shared/protocol.ts +15 -1
- package/dist/client/assets/index-C4BaFDD7.css +0 -32
- package/dist/client/assets/index-CAUb9qP0.js +0 -478
|
@@ -1,478 +0,0 @@
|
|
|
1
|
-
var AN=Object.defineProperty;var mS=e=>{throw TypeError(e)};var DN=(e,t,n)=>t in e?AN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Vt=(e,t,n)=>DN(e,typeof t!="symbol"?t+"":t,n),gS=(e,t,n)=>t.has(e)||mS("Cannot "+n);var uc=(e,t,n)=>(gS(e,t,"read from private field"),n?n.call(e):t.get(e)),vS=(e,t,n)=>t.has(e)?mS("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),_S=(e,t,n,r)=>(gS(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);function NN(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const l=Object.getOwnPropertyDescriptor(r,s);l&&Object.defineProperty(e,s,l.get?l:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const a of l.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(s){if(s.ep)return;s.ep=!0;const l=n(s);fetch(s.href,l)}})();function pf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var lg={exports:{}},hc={};/**
|
|
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 yS;function ON(){if(yS)return hc;yS=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,l){var a=null;if(l!==void 0&&(a=""+l),s.key!==void 0&&(a=""+s.key),"key"in s){l={};for(var u in s)u!=="key"&&(l[u]=s[u])}else l=s;return s=l.ref,{$$typeof:e,type:r,key:a,ref:s!==void 0?s:null,props:l}}return hc.Fragment=t,hc.jsx=n,hc.jsxs=n,hc}var bS;function LN(){return bS||(bS=1,lg.exports=ON()),lg.exports}var v=LN(),ag={exports:{}},Le={};/**
|
|
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 xS;function zN(){if(xS)return Le;xS=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),a=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),_=Symbol.iterator;function b(I){return I===null||typeof I!="object"?null:(I=_&&I[_]||I["@@iterator"],typeof I=="function"?I:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,C={};function k(I,Y,M){this.props=I,this.context=Y,this.refs=C,this.updater=M||S}k.prototype.isReactComponent={},k.prototype.setState=function(I,Y){if(typeof I!="object"&&typeof I!="function"&&I!=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,I,Y,"setState")},k.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function T(){}T.prototype=k.prototype;function R(I,Y,M){this.props=I,this.context=Y,this.refs=C,this.updater=M||S}var D=R.prototype=new T;D.constructor=R,w(D,k.prototype),D.isPureReactComponent=!0;var z=Array.isArray;function L(){}var O={H:null,A:null,T:null,S:null},B=Object.prototype.hasOwnProperty;function X(I,Y,M){var Z=M.ref;return{$$typeof:e,type:I,key:Y,ref:Z!==void 0?Z:null,props:M}}function P(I,Y){return X(I.type,Y,I.props)}function q(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function H(I){var Y={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(M){return Y[M]})}var U=/\/+/g;function V(I,Y){return typeof I=="object"&&I!==null&&I.key!=null?H(""+I.key):Y.toString(36)}function F(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(L,L):(I.status="pending",I.then(function(Y){I.status==="pending"&&(I.status="fulfilled",I.value=Y)},function(Y){I.status==="pending"&&(I.status="rejected",I.reason=Y)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function j(I,Y,M,Z,ae){var se=typeof I;(se==="undefined"||se==="boolean")&&(I=null);var pe=!1;if(I===null)pe=!0;else switch(se){case"bigint":case"string":case"number":pe=!0;break;case"object":switch(I.$$typeof){case e:case t:pe=!0;break;case m:return pe=I._init,j(pe(I._payload),Y,M,Z,ae)}}if(pe)return ae=ae(I),pe=Z===""?"."+V(I,0):Z,z(ae)?(M="",pe!=null&&(M=pe.replace(U,"$&/")+"/"),j(ae,Y,M,"",function(Ee){return Ee})):ae!=null&&(q(ae)&&(ae=P(ae,M+(ae.key==null||I&&I.key===ae.key?"":(""+ae.key).replace(U,"$&/")+"/")+pe)),Y.push(ae)),1;pe=0;var ke=Z===""?".":Z+":";if(z(I))for(var me=0;me<I.length;me++)Z=I[me],se=ke+V(Z,me),pe+=j(Z,Y,M,se,ae);else if(me=b(I),typeof me=="function")for(I=me.call(I),me=0;!(Z=I.next()).done;)Z=Z.value,se=ke+V(Z,me++),pe+=j(Z,Y,M,se,ae);else if(se==="object"){if(typeof I.then=="function")return j(F(I),Y,M,Z,ae);throw Y=String(I),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return pe}function K(I,Y,M){if(I==null)return I;var Z=[],ae=0;return j(I,Z,"","",function(se){return Y.call(M,se,ae++)}),Z}function $(I){if(I._status===-1){var Y=I._result;Y=Y(),Y.then(function(M){(I._status===0||I._status===-1)&&(I._status=1,I._result=M)},function(M){(I._status===0||I._status===-1)&&(I._status=2,I._result=M)}),I._status===-1&&(I._status=0,I._result=Y)}if(I._status===1)return I._result.default;throw I._result}var J=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof I=="object"&&I!==null&&typeof I.message=="string"?String(I.message):String(I),error:I});if(!window.dispatchEvent(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)},A={map:K,forEach:function(I,Y,M){K(I,function(){Y.apply(this,arguments)},M)},count:function(I){var Y=0;return K(I,function(){Y++}),Y},toArray:function(I){return K(I,function(Y){return Y})||[]},only:function(I){if(!q(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return Le.Activity=p,Le.Children=A,Le.Component=k,Le.Fragment=n,Le.Profiler=s,Le.PureComponent=R,Le.StrictMode=r,Le.Suspense=h,Le.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,Le.__COMPILER_RUNTIME={__proto__:null,c:function(I){return O.H.useMemoCache(I)}},Le.cache=function(I){return function(){return I.apply(null,arguments)}},Le.cacheSignal=function(){return null},Le.cloneElement=function(I,Y,M){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var Z=w({},I.props),ae=I.key;if(Y!=null)for(se in Y.key!==void 0&&(ae=""+Y.key),Y)!B.call(Y,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&Y.ref===void 0||(Z[se]=Y[se]);var se=arguments.length-2;if(se===1)Z.children=M;else if(1<se){for(var pe=Array(se),ke=0;ke<se;ke++)pe[ke]=arguments[ke+2];Z.children=pe}return X(I.type,ae,Z)},Le.createContext=function(I){return I={$$typeof:a,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:l,_context:I},I},Le.createElement=function(I,Y,M){var Z,ae={},se=null;if(Y!=null)for(Z in Y.key!==void 0&&(se=""+Y.key),Y)B.call(Y,Z)&&Z!=="key"&&Z!=="__self"&&Z!=="__source"&&(ae[Z]=Y[Z]);var pe=arguments.length-2;if(pe===1)ae.children=M;else if(1<pe){for(var ke=Array(pe),me=0;me<pe;me++)ke[me]=arguments[me+2];ae.children=ke}if(I&&I.defaultProps)for(Z in pe=I.defaultProps,pe)ae[Z]===void 0&&(ae[Z]=pe[Z]);return X(I,se,ae)},Le.createRef=function(){return{current:null}},Le.forwardRef=function(I){return{$$typeof:u,render:I}},Le.isValidElement=q,Le.lazy=function(I){return{$$typeof:m,_payload:{_status:-1,_result:I},_init:$}},Le.memo=function(I,Y){return{$$typeof:d,type:I,compare:Y===void 0?null:Y}},Le.startTransition=function(I){var Y=O.T,M={};O.T=M;try{var Z=I(),ae=O.S;ae!==null&&ae(M,Z),typeof Z=="object"&&Z!==null&&typeof Z.then=="function"&&Z.then(L,J)}catch(se){J(se)}finally{Y!==null&&M.types!==null&&(Y.types=M.types),O.T=Y}},Le.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},Le.use=function(I){return O.H.use(I)},Le.useActionState=function(I,Y,M){return O.H.useActionState(I,Y,M)},Le.useCallback=function(I,Y){return O.H.useCallback(I,Y)},Le.useContext=function(I){return O.H.useContext(I)},Le.useDebugValue=function(){},Le.useDeferredValue=function(I,Y){return O.H.useDeferredValue(I,Y)},Le.useEffect=function(I,Y){return O.H.useEffect(I,Y)},Le.useEffectEvent=function(I){return O.H.useEffectEvent(I)},Le.useId=function(){return O.H.useId()},Le.useImperativeHandle=function(I,Y,M){return O.H.useImperativeHandle(I,Y,M)},Le.useInsertionEffect=function(I,Y){return O.H.useInsertionEffect(I,Y)},Le.useLayoutEffect=function(I,Y){return O.H.useLayoutEffect(I,Y)},Le.useMemo=function(I,Y){return O.H.useMemo(I,Y)},Le.useOptimistic=function(I,Y){return O.H.useOptimistic(I,Y)},Le.useReducer=function(I,Y,M){return O.H.useReducer(I,Y,M)},Le.useRef=function(I){return O.H.useRef(I)},Le.useState=function(I){return O.H.useState(I)},Le.useSyncExternalStore=function(I,Y,M){return O.H.useSyncExternalStore(I,Y,M)},Le.useTransition=function(){return O.H.useTransition()},Le.version="19.2.1",Le}var SS;function F_(){return SS||(SS=1,ag.exports=zN()),ag.exports}var x=F_();const pt=pf(x),sk=NN({__proto__:null,default:pt},[x]);var cg={exports:{}},dc={},ug={exports:{}},hg={};/**
|
|
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 wS;function BN(){return wS||(wS=1,(function(e){function t(j,K){var $=j.length;j.push(K);e:for(;0<$;){var J=$-1>>>1,A=j[J];if(0<s(A,K))j[J]=K,j[$]=A,$=J;else break e}}function n(j){return j.length===0?null:j[0]}function r(j){if(j.length===0)return null;var K=j[0],$=j.pop();if($!==K){j[0]=$;e:for(var J=0,A=j.length,I=A>>>1;J<I;){var Y=2*(J+1)-1,M=j[Y],Z=Y+1,ae=j[Z];if(0>s(M,$))Z<A&&0>s(ae,M)?(j[J]=ae,j[Z]=$,J=Z):(j[J]=M,j[Y]=$,J=Y);else if(Z<A&&0>s(ae,$))j[J]=ae,j[Z]=$,J=Z;else break e}}return K}function s(j,K){var $=j.sortIndex-K.sortIndex;return $!==0?$:j.id-K.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var a=Date,u=a.now();e.unstable_now=function(){return a.now()-u}}var h=[],d=[],m=1,p=null,_=3,b=!1,S=!1,w=!1,C=!1,k=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function D(j){for(var K=n(d);K!==null;){if(K.callback===null)r(d);else if(K.startTime<=j)r(d),K.sortIndex=K.expirationTime,t(h,K);else break;K=n(d)}}function z(j){if(w=!1,D(j),!S)if(n(h)!==null)S=!0,L||(L=!0,H());else{var K=n(d);K!==null&&F(z,K.startTime-j)}}var L=!1,O=-1,B=5,X=-1;function P(){return C?!0:!(e.unstable_now()-X<B)}function q(){if(C=!1,L){var j=e.unstable_now();X=j;var K=!0;try{e:{S=!1,w&&(w=!1,T(O),O=-1),b=!0;var $=_;try{t:{for(D(j),p=n(h);p!==null&&!(p.expirationTime>j&&P());){var J=p.callback;if(typeof J=="function"){p.callback=null,_=p.priorityLevel;var A=J(p.expirationTime<=j);if(j=e.unstable_now(),typeof A=="function"){p.callback=A,D(j),K=!0;break t}p===n(h)&&r(h),D(j)}else r(h);p=n(h)}if(p!==null)K=!0;else{var I=n(d);I!==null&&F(z,I.startTime-j),K=!1}}break e}finally{p=null,_=$,b=!1}K=void 0}}finally{K?H():L=!1}}}var H;if(typeof R=="function")H=function(){R(q)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,V=U.port2;U.port1.onmessage=q,H=function(){V.postMessage(null)}}else H=function(){k(q,0)};function F(j,K){O=k(function(){j(e.unstable_now())},K)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(j){j.callback=null},e.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<j?Math.floor(1e3/j):5},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_next=function(j){switch(_){case 1:case 2:case 3:var K=3;break;default:K=_}var $=_;_=K;try{return j()}finally{_=$}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(j,K){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var $=_;_=j;try{return K()}finally{_=$}},e.unstable_scheduleCallback=function(j,K,$){var J=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?J+$:J):$=J,j){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=$+A,j={id:m++,callback:K,priorityLevel:j,startTime:$,expirationTime:A,sortIndex:-1},$>J?(j.sortIndex=$,t(d,j),n(h)===null&&j===n(d)&&(w?(T(O),O=-1):w=!0,F(z,$-J))):(j.sortIndex=A,t(h,j),S||b||(S=!0,L||(L=!0,H()))),j},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(j){var K=_;return function(){var $=_;_=K;try{return j.apply(this,arguments)}finally{_=$}}}})(hg)),hg}var CS;function jN(){return CS||(CS=1,ug.exports=BN()),ug.exports}var dg={exports:{}},En={};/**
|
|
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 kS;function PN(){if(kS)return En;kS=1;var e=F_();function t(h){var d="https://react.dev/errors/"+h;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)d+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+h+"; visit "+d+" 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(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function l(h,d,m){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:p==null?null:""+p,children:h,containerInfo:d,implementation:m}}var a=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(h,d){if(h==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return En.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,En.createPortal=function(h,d){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(t(299));return l(h,d,null,m)},En.flushSync=function(h){var d=a.T,m=r.p;try{if(a.T=null,r.p=2,h)return h()}finally{a.T=d,r.p=m,r.d.f()}},En.preconnect=function(h,d){typeof h=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(h,d))},En.prefetchDNS=function(h){typeof h=="string"&&r.d.D(h)},En.preinit=function(h,d){if(typeof h=="string"&&d&&typeof d.as=="string"){var m=d.as,p=u(m,d.crossOrigin),_=typeof d.integrity=="string"?d.integrity:void 0,b=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;m==="style"?r.d.S(h,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:p,integrity:_,fetchPriority:b}):m==="script"&&r.d.X(h,{crossOrigin:p,integrity:_,fetchPriority:b,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},En.preinitModule=function(h,d){if(typeof h=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var m=u(d.as,d.crossOrigin);r.d.M(h,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(h)},En.preload=function(h,d){if(typeof h=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var m=d.as,p=u(m,d.crossOrigin);r.d.L(h,m,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},En.preloadModule=function(h,d){if(typeof h=="string")if(d){var m=u(d.as,d.crossOrigin);r.d.m(h,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(h)},En.requestFormReset=function(h){r.d.r(h)},En.unstable_batchedUpdates=function(h,d){return h(d)},En.useFormState=function(h,d,m){return a.H.useFormState(h,d,m)},En.useFormStatus=function(){return a.H.useHostTransitionStatus()},En.version="19.2.1",En}var ES;function ok(){if(ES)return dg.exports;ES=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),dg.exports=PN(),dg.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 RS;function IN(){if(RS)return dc;RS=1;var e=jN(),t=F_(),n=ok();function r(i){var o="https://react.dev/errors/"+i;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)o+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+i+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function l(i){var o=i,c=i;if(i.alternate)for(;o.return;)o=o.return;else{i=o;do o=i,(o.flags&4098)!==0&&(c=o.return),i=o.return;while(i)}return o.tag===3?c:null}function a(i){if(i.tag===13){var o=i.memoizedState;if(o===null&&(i=i.alternate,i!==null&&(o=i.memoizedState)),o!==null)return o.dehydrated}return null}function u(i){if(i.tag===31){var o=i.memoizedState;if(o===null&&(i=i.alternate,i!==null&&(o=i.memoizedState)),o!==null)return o.dehydrated}return null}function h(i){if(l(i)!==i)throw Error(r(188))}function d(i){var o=i.alternate;if(!o){if(o=l(i),o===null)throw Error(r(188));return o!==i?null:i}for(var c=i,f=o;;){var g=c.return;if(g===null)break;var y=g.alternate;if(y===null){if(f=g.return,f!==null){c=f;continue}break}if(g.child===y.child){for(y=g.child;y;){if(y===c)return h(g),i;if(y===f)return h(g),o;y=y.sibling}throw Error(r(188))}if(c.return!==f.return)c=g,f=y;else{for(var E=!1,N=g.child;N;){if(N===c){E=!0,c=g,f=y;break}if(N===f){E=!0,f=g,c=y;break}N=N.sibling}if(!E){for(N=y.child;N;){if(N===c){E=!0,c=y,f=g;break}if(N===f){E=!0,f=y,c=g;break}N=N.sibling}if(!E)throw Error(r(189))}}if(c.alternate!==f)throw Error(r(190))}if(c.tag!==3)throw Error(r(188));return c.stateNode.current===c?i:o}function m(i){var o=i.tag;if(o===5||o===26||o===27||o===6)return i;for(i=i.child;i!==null;){if(o=m(i),o!==null)return o;i=i.sibling}return null}var p=Object.assign,_=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),R=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),X=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),q=Symbol.iterator;function H(i){return i===null||typeof i!="object"?null:(i=q&&i[q]||i["@@iterator"],typeof i=="function"?i:null)}var U=Symbol.for("react.client.reference");function V(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===U?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case w:return"Fragment";case k:return"Profiler";case C:return"StrictMode";case z:return"Suspense";case L:return"SuspenseList";case X:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case S:return"Portal";case R:return i.displayName||"Context";case T:return(i._context.displayName||"Context")+".Consumer";case D:var o=i.render;return i=i.displayName,i||(i=o.displayName||o.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case O:return o=i.displayName||null,o!==null?o:V(i.type)||"Memo";case B:o=i._payload,i=i._init;try{return V(i(o))}catch{}}return null}var F=Array.isArray,j=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$={pending:!1,data:null,method:null,action:null},J=[],A=-1;function I(i){return{current:i}}function Y(i){0>A||(i.current=J[A],J[A]=null,A--)}function M(i,o){A++,J[A]=i.current,i.current=o}var Z=I(null),ae=I(null),se=I(null),pe=I(null);function ke(i,o){switch(M(se,o),M(ae,i),M(Z,null),o.nodeType){case 9:case 11:i=(i=o.documentElement)&&(i=i.namespaceURI)?P1(i):0;break;default:if(i=o.tagName,o=o.namespaceURI)o=P1(o),i=I1(o,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}Y(Z),M(Z,i)}function me(){Y(Z),Y(ae),Y(se)}function Ee(i){i.memoizedState!==null&&M(pe,i);var o=Z.current,c=I1(o,i.type);o!==c&&(M(ae,i),M(Z,c))}function et(i){ae.current===i&&(Y(Z),Y(ae)),pe.current===i&&(Y(pe),oc._currentValue=$)}var Ge,Me;function Xe(i){if(Ge===void 0)try{throw Error()}catch(c){var o=c.stack.trim().match(/\n( *(at )?)/);Ge=o&&o[1]||"",Me=-1<c.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+Ge+i+Me}var dn=!1;function fn(i,o){if(!i||dn)return"";dn=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var f={DetermineComponentFrameRoot:function(){try{if(o){var ue=function(){throw Error()};if(Object.defineProperty(ue.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ue,[])}catch(ie){var re=ie}Reflect.construct(i,[],ue)}else{try{ue.call()}catch(ie){re=ie}i.call(ue.prototype)}}else{try{throw Error()}catch(ie){re=ie}(ue=i())&&typeof ue.catch=="function"&&ue.catch(function(){})}}catch(ie){if(ie&&re&&typeof ie.stack=="string")return[ie.stack,re.stack]}return[null,null]}};f.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var g=Object.getOwnPropertyDescriptor(f.DetermineComponentFrameRoot,"name");g&&g.configurable&&Object.defineProperty(f.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=f.DetermineComponentFrameRoot(),E=y[0],N=y[1];if(E&&N){var W=E.split(`
|
|
44
|
-
`),te=N.split(`
|
|
45
|
-
`);for(g=f=0;f<W.length&&!W[f].includes("DetermineComponentFrameRoot");)f++;for(;g<te.length&&!te[g].includes("DetermineComponentFrameRoot");)g++;if(f===W.length||g===te.length)for(f=W.length-1,g=te.length-1;1<=f&&0<=g&&W[f]!==te[g];)g--;for(;1<=f&&0<=g;f--,g--)if(W[f]!==te[g]){if(f!==1||g!==1)do if(f--,g--,0>g||W[f]!==te[g]){var oe=`
|
|
46
|
-
`+W[f].replace(" at new "," at ");return i.displayName&&oe.includes("<anonymous>")&&(oe=oe.replace("<anonymous>",i.displayName)),oe}while(1<=f&&0<=g);break}}}finally{dn=!1,Error.prepareStackTrace=c}return(c=i?i.displayName||i.name:"")?Xe(c):""}function Hr(i,o){switch(i.tag){case 26:case 27:case 5:return Xe(i.type);case 16:return Xe("Lazy");case 13:return i.child!==o&&o!==null?Xe("Suspense Fallback"):Xe("Suspense");case 19:return Xe("SuspenseList");case 0:case 15:return fn(i.type,!1);case 11:return fn(i.type.render,!1);case 1:return fn(i.type,!0);case 31:return Xe("Activity");default:return""}}function Fr(i){try{var o="",c=null;do o+=Hr(i,c),c=i,i=i.return;while(i);return o}catch(f){return`
|
|
47
|
-
Error generating stack: `+f.message+`
|
|
48
|
-
`+f.stack}}var pn=Object.prototype.hasOwnProperty,mn=e.unstable_scheduleCallback,vr=e.unstable_cancelCallback,ni=e.unstable_shouldYield,ls=e.unstable_requestPaint,Tt=e.unstable_now,as=e.unstable_getCurrentPriorityLevel,le=e.unstable_ImmediatePriority,ne=e.unstable_UserBlockingPriority,de=e.unstable_NormalPriority,ve=e.unstable_LowPriority,Ce=e.unstable_IdlePriority,Pe=e.log,nr=e.unstable_setDisableYieldValue,gn=null,At=null;function Qt(i){if(typeof Pe=="function"&&nr(i),At&&typeof At.setStrictMode=="function")try{At.setStrictMode(gn,i)}catch{}}var rt=Math.clz32?Math.clz32:Zf,ri=Math.log,Hn=Math.LN2;function Zf(i){return i>>>=0,i===0?32:31-(ri(i)/Hn|0)|0}var Yo=256,Xo=262144,Dt=4194304;function Nt(i){var o=i&42;if(o!==0)return o;switch(i&-i){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 i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function Jt(i,o,c){var f=i.pendingLanes;if(f===0)return 0;var g=0,y=i.suspendedLanes,E=i.pingedLanes;i=i.warmLanes;var N=f&134217727;return N!==0?(f=N&~y,f!==0?g=Nt(f):(E&=N,E!==0?g=Nt(E):c||(c=N&~i,c!==0&&(g=Nt(c))))):(N=f&~y,N!==0?g=Nt(N):E!==0?g=Nt(E):c||(c=f&~i,c!==0&&(g=Nt(c)))),g===0?0:o!==0&&o!==g&&(o&y)===0&&(y=g&-g,c=o&-o,y>=c||y===32&&(c&4194048)!==0)?o:g}function Fn(i,o){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&o)===0}function Un(i,o){switch(i){case 1:case 2:case 4:case 8:case 64:return o+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 o+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 kn(){var i=Dt;return Dt<<=1,(Dt&62914560)===0&&(Dt=4194304),i}function $n(i){for(var o=[],c=0;31>c;c++)o.push(i);return o}function _r(i,o){i.pendingLanes|=o,o!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function Wt(i,o,c,f,g,y){var E=i.pendingLanes;i.pendingLanes=c,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=c,i.entangledLanes&=c,i.errorRecoveryDisabledLanes&=c,i.shellSuspendCounter=0;var N=i.entanglements,W=i.expirationTimes,te=i.hiddenUpdates;for(c=E&~c;0<c;){var oe=31-rt(c),ue=1<<oe;N[oe]=0,W[oe]=-1;var re=te[oe];if(re!==null)for(te[oe]=null,oe=0;oe<re.length;oe++){var ie=re[oe];ie!==null&&(ie.lane&=-536870913)}c&=~ue}f!==0&&Ur(i,f,0),y!==0&&g===0&&i.tag!==0&&(i.suspendedLanes|=y&~(E&~o))}function Ur(i,o,c){i.pendingLanes|=o,i.suspendedLanes&=~o;var f=31-rt(o);i.entangledLanes|=o,i.entanglements[f]=i.entanglements[f]|1073741824|c&261930}function rr(i,o){var c=i.entangledLanes|=o;for(i=i.entanglements;c;){var f=31-rt(c),g=1<<f;g&o|i[f]&o&&(i[f]|=o),c&=~g}}function yr(i,o){var c=o&-o;return c=(c&42)!==0?1:Ri(c),(c&(i.suspendedLanes|o))!==0?0:c}function Ri(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=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:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function Mi(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function $r(){var i=K.p;return i!==0?i:(i=window.event,i===void 0?32:aS(i.type))}function cs(i,o){var c=K.p;try{return K.p=i,o()}finally{K.p=c}}var br=Math.random().toString(36).slice(2),vn="__reactFiber$"+br,Wn="__reactProps$"+br,Zo="__reactContainer$"+br,Qf="__reactEvents$"+br,yA="__reactListeners$"+br,bA="__reactHandles$"+br,kb="__reactResources$"+br,xa="__reactMarker$"+br;function Jf(i){delete i[vn],delete i[Wn],delete i[Qf],delete i[yA],delete i[bA]}function Qo(i){var o=i[vn];if(o)return o;for(var c=i.parentNode;c;){if(o=c[Zo]||c[vn]){if(c=o.alternate,o.child!==null||c!==null&&c.child!==null)for(i=V1(i);i!==null;){if(c=i[vn])return c;i=V1(i)}return o}i=c,c=i.parentNode}return null}function Jo(i){if(i=i[vn]||i[Zo]){var o=i.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return i}return null}function Sa(i){var o=i.tag;if(o===5||o===26||o===27||o===6)return i.stateNode;throw Error(r(33))}function el(i){var o=i[kb];return o||(o=i[kb]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function en(i){i[xa]=!0}var Eb=new Set,Rb={};function ro(i,o){tl(i,o),tl(i+"Capture",o)}function tl(i,o){for(Rb[i]=o,i=0;i<o.length;i++)Eb.add(o[i])}var xA=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]*$"),Mb={},Tb={};function SA(i){return pn.call(Tb,i)?!0:pn.call(Mb,i)?!1:xA.test(i)?Tb[i]=!0:(Mb[i]=!0,!1)}function Ou(i,o,c){if(SA(o))if(c===null)i.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":i.removeAttribute(o);return;case"boolean":var f=o.toLowerCase().slice(0,5);if(f!=="data-"&&f!=="aria-"){i.removeAttribute(o);return}}i.setAttribute(o,""+c)}}function Lu(i,o,c){if(c===null)i.removeAttribute(o);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(o);return}i.setAttribute(o,""+c)}}function Ti(i,o,c,f){if(f===null)i.removeAttribute(c);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(c);return}i.setAttributeNS(o,c,""+f)}}function xr(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Ab(i){var o=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function wA(i,o,c){var f=Object.getOwnPropertyDescriptor(i.constructor.prototype,o);if(!i.hasOwnProperty(o)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var g=f.get,y=f.set;return Object.defineProperty(i,o,{configurable:!0,get:function(){return g.call(this)},set:function(E){c=""+E,y.call(this,E)}}),Object.defineProperty(i,o,{enumerable:f.enumerable}),{getValue:function(){return c},setValue:function(E){c=""+E},stopTracking:function(){i._valueTracker=null,delete i[o]}}}}function ep(i){if(!i._valueTracker){var o=Ab(i)?"checked":"value";i._valueTracker=wA(i,o,""+i[o])}}function Db(i){if(!i)return!1;var o=i._valueTracker;if(!o)return!0;var c=o.getValue(),f="";return i&&(f=Ab(i)?i.checked?"true":"false":i.value),i=f,i!==c?(o.setValue(i),!0):!1}function zu(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var CA=/[\n"\\]/g;function Sr(i){return i.replace(CA,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function tp(i,o,c,f,g,y,E,N){i.name="",E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?i.type=E:i.removeAttribute("type"),o!=null?E==="number"?(o===0&&i.value===""||i.value!=o)&&(i.value=""+xr(o)):i.value!==""+xr(o)&&(i.value=""+xr(o)):E!=="submit"&&E!=="reset"||i.removeAttribute("value"),o!=null?np(i,E,xr(o)):c!=null?np(i,E,xr(c)):f!=null&&i.removeAttribute("value"),g==null&&y!=null&&(i.defaultChecked=!!y),g!=null&&(i.checked=g&&typeof g!="function"&&typeof g!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?i.name=""+xr(N):i.removeAttribute("name")}function Nb(i,o,c,f,g,y,E,N){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(i.type=y),o!=null||c!=null){if(!(y!=="submit"&&y!=="reset"||o!=null)){ep(i);return}c=c!=null?""+xr(c):"",o=o!=null?""+xr(o):c,N||o===i.value||(i.value=o),i.defaultValue=o}f=f??g,f=typeof f!="function"&&typeof f!="symbol"&&!!f,i.checked=N?i.checked:!!f,i.defaultChecked=!!f,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(i.name=E),ep(i)}function np(i,o,c){o==="number"&&zu(i.ownerDocument)===i||i.defaultValue===""+c||(i.defaultValue=""+c)}function nl(i,o,c,f){if(i=i.options,o){o={};for(var g=0;g<c.length;g++)o["$"+c[g]]=!0;for(c=0;c<i.length;c++)g=o.hasOwnProperty("$"+i[c].value),i[c].selected!==g&&(i[c].selected=g),g&&f&&(i[c].defaultSelected=!0)}else{for(c=""+xr(c),o=null,g=0;g<i.length;g++){if(i[g].value===c){i[g].selected=!0,f&&(i[g].defaultSelected=!0);return}o!==null||i[g].disabled||(o=i[g])}o!==null&&(o.selected=!0)}}function Ob(i,o,c){if(o!=null&&(o=""+xr(o),o!==i.value&&(i.value=o),c==null)){i.defaultValue!==o&&(i.defaultValue=o);return}i.defaultValue=c!=null?""+xr(c):""}function Lb(i,o,c,f){if(o==null){if(f!=null){if(c!=null)throw Error(r(92));if(F(f)){if(1<f.length)throw Error(r(93));f=f[0]}c=f}c==null&&(c=""),o=c}c=xr(o),i.defaultValue=c,f=i.textContent,f===c&&f!==""&&f!==null&&(i.value=f),ep(i)}function rl(i,o){if(o){var c=i.firstChild;if(c&&c===i.lastChild&&c.nodeType===3){c.nodeValue=o;return}}i.textContent=o}var kA=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 zb(i,o,c){var f=o.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?f?i.setProperty(o,""):o==="float"?i.cssFloat="":i[o]="":f?i.setProperty(o,c):typeof c!="number"||c===0||kA.has(o)?o==="float"?i.cssFloat=c:i[o]=(""+c).trim():i[o]=c+"px"}function Bb(i,o,c){if(o!=null&&typeof o!="object")throw Error(r(62));if(i=i.style,c!=null){for(var f in c)!c.hasOwnProperty(f)||o!=null&&o.hasOwnProperty(f)||(f.indexOf("--")===0?i.setProperty(f,""):f==="float"?i.cssFloat="":i[f]="");for(var g in o)f=o[g],o.hasOwnProperty(g)&&c[g]!==f&&zb(i,g,f)}else for(var y in o)o.hasOwnProperty(y)&&zb(i,y,o[y])}function rp(i){if(i.indexOf("-")===-1)return!1;switch(i){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 EA=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"]]),RA=/^[\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 Bu(i){return RA.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function Ai(){}var ip=null;function sp(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var il=null,sl=null;function jb(i){var o=Jo(i);if(o&&(i=o.stateNode)){var c=i[Wn]||null;e:switch(i=o.stateNode,o.type){case"input":if(tp(i,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),o=c.name,c.type==="radio"&&o!=null){for(c=i;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+Sr(""+o)+'"][type="radio"]'),o=0;o<c.length;o++){var f=c[o];if(f!==i&&f.form===i.form){var g=f[Wn]||null;if(!g)throw Error(r(90));tp(f,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(o=0;o<c.length;o++)f=c[o],f.form===i.form&&Db(f)}break e;case"textarea":Ob(i,c.value,c.defaultValue);break e;case"select":o=c.value,o!=null&&nl(i,!!c.multiple,o,!1)}}}var op=!1;function Pb(i,o,c){if(op)return i(o,c);op=!0;try{var f=i(o);return f}finally{if(op=!1,(il!==null||sl!==null)&&(wh(),il&&(o=il,i=sl,sl=il=null,jb(o),i)))for(o=0;o<i.length;o++)jb(i[o])}}function wa(i,o){var c=i.stateNode;if(c===null)return null;var f=c[Wn]||null;if(f===null)return null;c=f[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(f=!f.disabled)||(i=i.type,f=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!f;break e;default:i=!1}if(i)return null;if(c&&typeof c!="function")throw Error(r(231,o,typeof c));return c}var Di=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),lp=!1;if(Di)try{var Ca={};Object.defineProperty(Ca,"passive",{get:function(){lp=!0}}),window.addEventListener("test",Ca,Ca),window.removeEventListener("test",Ca,Ca)}catch{lp=!1}var us=null,ap=null,ju=null;function Ib(){if(ju)return ju;var i,o=ap,c=o.length,f,g="value"in us?us.value:us.textContent,y=g.length;for(i=0;i<c&&o[i]===g[i];i++);var E=c-i;for(f=1;f<=E&&o[c-f]===g[y-f];f++);return ju=g.slice(i,1<f?1-f:void 0)}function Pu(i){var o=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&o===13&&(i=13)):i=o,i===10&&(i=13),32<=i||i===13?i:0}function Iu(){return!0}function Hb(){return!1}function qn(i){function o(c,f,g,y,E){this._reactName=c,this._targetInst=g,this.type=f,this.nativeEvent=y,this.target=E,this.currentTarget=null;for(var N in i)i.hasOwnProperty(N)&&(c=i[N],this[N]=c?c(y):y[N]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Iu:Hb,this.isPropagationStopped=Hb,this}return p(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=Iu)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=Iu)},persist:function(){},isPersistent:Iu}),o}var io={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Hu=qn(io),ka=p({},io,{view:0,detail:0}),MA=qn(ka),cp,up,Ea,Fu=p({},ka,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:dp,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Ea&&(Ea&&i.type==="mousemove"?(cp=i.screenX-Ea.screenX,up=i.screenY-Ea.screenY):up=cp=0,Ea=i),cp)},movementY:function(i){return"movementY"in i?i.movementY:up}}),Fb=qn(Fu),TA=p({},Fu,{dataTransfer:0}),AA=qn(TA),DA=p({},ka,{relatedTarget:0}),hp=qn(DA),NA=p({},io,{animationName:0,elapsedTime:0,pseudoElement:0}),OA=qn(NA),LA=p({},io,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),zA=qn(LA),BA=p({},io,{data:0}),Ub=qn(BA),jA={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},PA={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"},IA={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function HA(i){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(i):(i=IA[i])?!!o[i]:!1}function dp(){return HA}var FA=p({},ka,{key:function(i){if(i.key){var o=jA[i.key]||i.key;if(o!=="Unidentified")return o}return i.type==="keypress"?(i=Pu(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?PA[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:dp,charCode:function(i){return i.type==="keypress"?Pu(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Pu(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),UA=qn(FA),$A=p({},Fu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),$b=qn($A),WA=p({},ka,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:dp}),qA=qn(WA),VA=p({},io,{propertyName:0,elapsedTime:0,pseudoElement:0}),KA=qn(VA),GA=p({},Fu,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),YA=qn(GA),XA=p({},io,{newState:0,oldState:0}),ZA=qn(XA),QA=[9,13,27,32],fp=Di&&"CompositionEvent"in window,Ra=null;Di&&"documentMode"in document&&(Ra=document.documentMode);var JA=Di&&"TextEvent"in window&&!Ra,Wb=Di&&(!fp||Ra&&8<Ra&&11>=Ra),qb=" ",Vb=!1;function Kb(i,o){switch(i){case"keyup":return QA.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Gb(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var ol=!1;function eD(i,o){switch(i){case"compositionend":return Gb(o);case"keypress":return o.which!==32?null:(Vb=!0,qb);case"textInput":return i=o.data,i===qb&&Vb?null:i;default:return null}}function tD(i,o){if(ol)return i==="compositionend"||!fp&&Kb(i,o)?(i=Ib(),ju=ap=us=null,ol=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return Wb&&o.locale!=="ko"?null:o.data;default:return null}}var nD={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 Yb(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o==="input"?!!nD[i.type]:o==="textarea"}function Xb(i,o,c,f){il?sl?sl.push(f):sl=[f]:il=f,o=Ah(o,"onChange"),0<o.length&&(c=new Hu("onChange","change",null,c,f),i.push({event:c,listeners:o}))}var Ma=null,Ta=null;function rD(i){N1(i,0)}function Uu(i){var o=Sa(i);if(Db(o))return i}function Zb(i,o){if(i==="change")return o}var Qb=!1;if(Di){var pp;if(Di){var mp="oninput"in document;if(!mp){var Jb=document.createElement("div");Jb.setAttribute("oninput","return;"),mp=typeof Jb.oninput=="function"}pp=mp}else pp=!1;Qb=pp&&(!document.documentMode||9<document.documentMode)}function e0(){Ma&&(Ma.detachEvent("onpropertychange",t0),Ta=Ma=null)}function t0(i){if(i.propertyName==="value"&&Uu(Ta)){var o=[];Xb(o,Ta,i,sp(i)),Pb(rD,o)}}function iD(i,o,c){i==="focusin"?(e0(),Ma=o,Ta=c,Ma.attachEvent("onpropertychange",t0)):i==="focusout"&&e0()}function sD(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Uu(Ta)}function oD(i,o){if(i==="click")return Uu(o)}function lD(i,o){if(i==="input"||i==="change")return Uu(o)}function aD(i,o){return i===o&&(i!==0||1/i===1/o)||i!==i&&o!==o}var ir=typeof Object.is=="function"?Object.is:aD;function Aa(i,o){if(ir(i,o))return!0;if(typeof i!="object"||i===null||typeof o!="object"||o===null)return!1;var c=Object.keys(i),f=Object.keys(o);if(c.length!==f.length)return!1;for(f=0;f<c.length;f++){var g=c[f];if(!pn.call(o,g)||!ir(i[g],o[g]))return!1}return!0}function n0(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function r0(i,o){var c=n0(i);i=0;for(var f;c;){if(c.nodeType===3){if(f=i+c.textContent.length,i<=o&&f>=o)return{node:c,offset:o-i};i=f}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=n0(c)}}function i0(i,o){return i&&o?i===o?!0:i&&i.nodeType===3?!1:o&&o.nodeType===3?i0(i,o.parentNode):"contains"in i?i.contains(o):i.compareDocumentPosition?!!(i.compareDocumentPosition(o)&16):!1:!1}function s0(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var o=zu(i.document);o instanceof i.HTMLIFrameElement;){try{var c=typeof o.contentWindow.location.href=="string"}catch{c=!1}if(c)i=o.contentWindow;else break;o=zu(i.document)}return o}function gp(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o&&(o==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||o==="textarea"||i.contentEditable==="true")}var cD=Di&&"documentMode"in document&&11>=document.documentMode,ll=null,vp=null,Da=null,_p=!1;function o0(i,o,c){var f=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;_p||ll==null||ll!==zu(f)||(f=ll,"selectionStart"in f&&gp(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),Da&&Aa(Da,f)||(Da=f,f=Ah(vp,"onSelect"),0<f.length&&(o=new Hu("onSelect","select",null,o,c),i.push({event:o,listeners:f}),o.target=ll)))}function so(i,o){var c={};return c[i.toLowerCase()]=o.toLowerCase(),c["Webkit"+i]="webkit"+o,c["Moz"+i]="moz"+o,c}var al={animationend:so("Animation","AnimationEnd"),animationiteration:so("Animation","AnimationIteration"),animationstart:so("Animation","AnimationStart"),transitionrun:so("Transition","TransitionRun"),transitionstart:so("Transition","TransitionStart"),transitioncancel:so("Transition","TransitionCancel"),transitionend:so("Transition","TransitionEnd")},yp={},l0={};Di&&(l0=document.createElement("div").style,"AnimationEvent"in window||(delete al.animationend.animation,delete al.animationiteration.animation,delete al.animationstart.animation),"TransitionEvent"in window||delete al.transitionend.transition);function oo(i){if(yp[i])return yp[i];if(!al[i])return i;var o=al[i],c;for(c in o)if(o.hasOwnProperty(c)&&c in l0)return yp[i]=o[c];return i}var a0=oo("animationend"),c0=oo("animationiteration"),u0=oo("animationstart"),uD=oo("transitionrun"),hD=oo("transitionstart"),dD=oo("transitioncancel"),h0=oo("transitionend"),d0=new Map,bp="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(" ");bp.push("scrollEnd");function Wr(i,o){d0.set(i,o),ro(o,[i])}var $u=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},wr=[],cl=0,xp=0;function Wu(){for(var i=cl,o=xp=cl=0;o<i;){var c=wr[o];wr[o++]=null;var f=wr[o];wr[o++]=null;var g=wr[o];wr[o++]=null;var y=wr[o];if(wr[o++]=null,f!==null&&g!==null){var E=f.pending;E===null?g.next=g:(g.next=E.next,E.next=g),f.pending=g}y!==0&&f0(c,g,y)}}function qu(i,o,c,f){wr[cl++]=i,wr[cl++]=o,wr[cl++]=c,wr[cl++]=f,xp|=f,i.lanes|=f,i=i.alternate,i!==null&&(i.lanes|=f)}function Sp(i,o,c,f){return qu(i,o,c,f),Vu(i)}function lo(i,o){return qu(i,null,null,o),Vu(i)}function f0(i,o,c){i.lanes|=c;var f=i.alternate;f!==null&&(f.lanes|=c);for(var g=!1,y=i.return;y!==null;)y.childLanes|=c,f=y.alternate,f!==null&&(f.childLanes|=c),y.tag===22&&(i=y.stateNode,i===null||i._visibility&1||(g=!0)),i=y,y=y.return;return i.tag===3?(y=i.stateNode,g&&o!==null&&(g=31-rt(c),i=y.hiddenUpdates,f=i[g],f===null?i[g]=[o]:f.push(o),o.lane=c|536870912),y):null}function Vu(i){if(50<Ja)throw Ja=0,Dm=null,Error(r(185));for(var o=i.return;o!==null;)i=o,o=i.return;return i.tag===3?i.stateNode:null}var ul={};function fD(i,o,c,f){this.tag=i,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function sr(i,o,c,f){return new fD(i,o,c,f)}function wp(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Ni(i,o){var c=i.alternate;return c===null?(c=sr(i.tag,o,i.key,i.mode),c.elementType=i.elementType,c.type=i.type,c.stateNode=i.stateNode,c.alternate=i,i.alternate=c):(c.pendingProps=o,c.type=i.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=i.flags&65011712,c.childLanes=i.childLanes,c.lanes=i.lanes,c.child=i.child,c.memoizedProps=i.memoizedProps,c.memoizedState=i.memoizedState,c.updateQueue=i.updateQueue,o=i.dependencies,c.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},c.sibling=i.sibling,c.index=i.index,c.ref=i.ref,c.refCleanup=i.refCleanup,c}function p0(i,o){i.flags&=65011714;var c=i.alternate;return c===null?(i.childLanes=0,i.lanes=o,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=c.childLanes,i.lanes=c.lanes,i.child=c.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=c.memoizedProps,i.memoizedState=c.memoizedState,i.updateQueue=c.updateQueue,i.type=c.type,o=c.dependencies,i.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),i}function Ku(i,o,c,f,g,y){var E=0;if(f=i,typeof i=="function")wp(i)&&(E=1);else if(typeof i=="string")E=_N(i,c,Z.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case X:return i=sr(31,c,o,g),i.elementType=X,i.lanes=y,i;case w:return ao(c.children,g,y,o);case C:E=8,g|=24;break;case k:return i=sr(12,c,o,g|2),i.elementType=k,i.lanes=y,i;case z:return i=sr(13,c,o,g),i.elementType=z,i.lanes=y,i;case L:return i=sr(19,c,o,g),i.elementType=L,i.lanes=y,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case R:E=10;break e;case T:E=9;break e;case D:E=11;break e;case O:E=14;break e;case B:E=16,f=null;break e}E=29,c=Error(r(130,i===null?"null":typeof i,"")),f=null}return o=sr(E,c,o,g),o.elementType=i,o.type=f,o.lanes=y,o}function ao(i,o,c,f){return i=sr(7,i,f,o),i.lanes=c,i}function Cp(i,o,c){return i=sr(6,i,null,o),i.lanes=c,i}function m0(i){var o=sr(18,null,null,0);return o.stateNode=i,o}function kp(i,o,c){return o=sr(4,i.children!==null?i.children:[],i.key,o),o.lanes=c,o.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},o}var g0=new WeakMap;function Cr(i,o){if(typeof i=="object"&&i!==null){var c=g0.get(i);return c!==void 0?c:(o={value:i,source:o,stack:Fr(o)},g0.set(i,o),o)}return{value:i,source:o,stack:Fr(o)}}var hl=[],dl=0,Gu=null,Na=0,kr=[],Er=0,hs=null,ii=1,si="";function Oi(i,o){hl[dl++]=Na,hl[dl++]=Gu,Gu=i,Na=o}function v0(i,o,c){kr[Er++]=ii,kr[Er++]=si,kr[Er++]=hs,hs=i;var f=ii;i=si;var g=32-rt(f)-1;f&=~(1<<g),c+=1;var y=32-rt(o)+g;if(30<y){var E=g-g%5;y=(f&(1<<E)-1).toString(32),f>>=E,g-=E,ii=1<<32-rt(o)+g|c<<g|f,si=y+i}else ii=1<<y|c<<g|f,si=i}function Ep(i){i.return!==null&&(Oi(i,1),v0(i,1,0))}function Rp(i){for(;i===Gu;)Gu=hl[--dl],hl[dl]=null,Na=hl[--dl],hl[dl]=null;for(;i===hs;)hs=kr[--Er],kr[Er]=null,si=kr[--Er],kr[Er]=null,ii=kr[--Er],kr[Er]=null}function _0(i,o){kr[Er++]=ii,kr[Er++]=si,kr[Er++]=hs,ii=o.id,si=o.overflow,hs=i}var _n=null,mt=null,Ye=!1,ds=null,Rr=!1,Mp=Error(r(519));function fs(i){var o=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Oa(Cr(o,i)),Mp}function y0(i){var o=i.stateNode,c=i.type,f=i.memoizedProps;switch(o[vn]=i,o[Wn]=f,c){case"dialog":$e("cancel",o),$e("close",o);break;case"iframe":case"object":case"embed":$e("load",o);break;case"video":case"audio":for(c=0;c<tc.length;c++)$e(tc[c],o);break;case"source":$e("error",o);break;case"img":case"image":case"link":$e("error",o),$e("load",o);break;case"details":$e("toggle",o);break;case"input":$e("invalid",o),Nb(o,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0);break;case"select":$e("invalid",o);break;case"textarea":$e("invalid",o),Lb(o,f.value,f.defaultValue,f.children)}c=f.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||o.textContent===""+c||f.suppressHydrationWarning===!0||B1(o.textContent,c)?(f.popover!=null&&($e("beforetoggle",o),$e("toggle",o)),f.onScroll!=null&&$e("scroll",o),f.onScrollEnd!=null&&$e("scrollend",o),f.onClick!=null&&(o.onclick=Ai),o=!0):o=!1,o||fs(i,!0)}function b0(i){for(_n=i.return;_n;)switch(_n.tag){case 5:case 31:case 13:Rr=!1;return;case 27:case 3:Rr=!0;return;default:_n=_n.return}}function fl(i){if(i!==_n)return!1;if(!Ye)return b0(i),Ye=!0,!1;var o=i.tag,c;if((c=o!==3&&o!==27)&&((c=o===5)&&(c=i.type,c=!(c!=="form"&&c!=="button")||Vm(i.type,i.memoizedProps)),c=!c),c&&mt&&fs(i),b0(i),o===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));mt=q1(i)}else if(o===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));mt=q1(i)}else o===27?(o=mt,Rs(i.type)?(i=Zm,Zm=null,mt=i):mt=o):mt=_n?Tr(i.stateNode.nextSibling):null;return!0}function co(){mt=_n=null,Ye=!1}function Tp(){var i=ds;return i!==null&&(Yn===null?Yn=i:Yn.push.apply(Yn,i),ds=null),i}function Oa(i){ds===null?ds=[i]:ds.push(i)}var Ap=I(null),uo=null,Li=null;function ps(i,o,c){M(Ap,o._currentValue),o._currentValue=c}function zi(i){i._currentValue=Ap.current,Y(Ap)}function Dp(i,o,c){for(;i!==null;){var f=i.alternate;if((i.childLanes&o)!==o?(i.childLanes|=o,f!==null&&(f.childLanes|=o)):f!==null&&(f.childLanes&o)!==o&&(f.childLanes|=o),i===c)break;i=i.return}}function Np(i,o,c,f){var g=i.child;for(g!==null&&(g.return=i);g!==null;){var y=g.dependencies;if(y!==null){var E=g.child;y=y.firstContext;e:for(;y!==null;){var N=y;y=g;for(var W=0;W<o.length;W++)if(N.context===o[W]){y.lanes|=c,N=y.alternate,N!==null&&(N.lanes|=c),Dp(y.return,c,i),f||(E=null);break e}y=N.next}}else if(g.tag===18){if(E=g.return,E===null)throw Error(r(341));E.lanes|=c,y=E.alternate,y!==null&&(y.lanes|=c),Dp(E,c,i),E=null}else E=g.child;if(E!==null)E.return=g;else for(E=g;E!==null;){if(E===i){E=null;break}if(g=E.sibling,g!==null){g.return=E.return,E=g;break}E=E.return}g=E}}function pl(i,o,c,f){i=null;for(var g=o,y=!1;g!==null;){if(!y){if((g.flags&524288)!==0)y=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var E=g.alternate;if(E===null)throw Error(r(387));if(E=E.memoizedProps,E!==null){var N=g.type;ir(g.pendingProps.value,E.value)||(i!==null?i.push(N):i=[N])}}else if(g===pe.current){if(E=g.alternate,E===null)throw Error(r(387));E.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(i!==null?i.push(oc):i=[oc])}g=g.return}i!==null&&Np(o,i,c,f),o.flags|=262144}function Yu(i){for(i=i.firstContext;i!==null;){if(!ir(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function ho(i){uo=i,Li=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function yn(i){return x0(uo,i)}function Xu(i,o){return uo===null&&ho(i),x0(i,o)}function x0(i,o){var c=o._currentValue;if(o={context:o,memoizedValue:c,next:null},Li===null){if(i===null)throw Error(r(308));Li=o,i.dependencies={lanes:0,firstContext:o},i.flags|=524288}else Li=Li.next=o;return c}var pD=typeof AbortController<"u"?AbortController:function(){var i=[],o=this.signal={aborted:!1,addEventListener:function(c,f){i.push(f)}};this.abort=function(){o.aborted=!0,i.forEach(function(c){return c()})}},mD=e.unstable_scheduleCallback,gD=e.unstable_NormalPriority,jt={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Op(){return{controller:new pD,data:new Map,refCount:0}}function La(i){i.refCount--,i.refCount===0&&mD(gD,function(){i.controller.abort()})}var za=null,Lp=0,ml=0,gl=null;function vD(i,o){if(za===null){var c=za=[];Lp=0,ml=jm(),gl={status:"pending",value:void 0,then:function(f){c.push(f)}}}return Lp++,o.then(S0,S0),o}function S0(){if(--Lp===0&&za!==null){gl!==null&&(gl.status="fulfilled");var i=za;za=null,ml=0,gl=null;for(var o=0;o<i.length;o++)(0,i[o])()}}function _D(i,o){var c=[],f={status:"pending",value:null,reason:null,then:function(g){c.push(g)}};return i.then(function(){f.status="fulfilled",f.value=o;for(var g=0;g<c.length;g++)(0,c[g])(o)},function(g){for(f.status="rejected",f.reason=g,g=0;g<c.length;g++)(0,c[g])(void 0)}),f}var w0=j.S;j.S=function(i,o){o1=Tt(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&vD(i,o),w0!==null&&w0(i,o)};var fo=I(null);function zp(){var i=fo.current;return i!==null?i:ht.pooledCache}function Zu(i,o){o===null?M(fo,fo.current):M(fo,o.pool)}function C0(){var i=zp();return i===null?null:{parent:jt._currentValue,pool:i}}var vl=Error(r(460)),Bp=Error(r(474)),Qu=Error(r(542)),Ju={then:function(){}};function k0(i){return i=i.status,i==="fulfilled"||i==="rejected"}function E0(i,o,c){switch(c=i[c],c===void 0?i.push(o):c!==o&&(o.then(Ai,Ai),o=c),o.status){case"fulfilled":return o.value;case"rejected":throw i=o.reason,M0(i),i;default:if(typeof o.status=="string")o.then(Ai,Ai);else{if(i=ht,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=o,i.status="pending",i.then(function(f){if(o.status==="pending"){var g=o;g.status="fulfilled",g.value=f}},function(f){if(o.status==="pending"){var g=o;g.status="rejected",g.reason=f}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw i=o.reason,M0(i),i}throw mo=o,vl}}function po(i){try{var o=i._init;return o(i._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(mo=c,vl):c}}var mo=null;function R0(){if(mo===null)throw Error(r(459));var i=mo;return mo=null,i}function M0(i){if(i===vl||i===Qu)throw Error(r(483))}var _l=null,Ba=0;function eh(i){var o=Ba;return Ba+=1,_l===null&&(_l=[]),E0(_l,i,o)}function ja(i,o){o=o.props.ref,i.ref=o!==void 0?o:null}function th(i,o){throw o.$$typeof===_?Error(r(525)):(i=Object.prototype.toString.call(o),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":i)))}function T0(i){function o(Q,G){if(i){var ee=Q.deletions;ee===null?(Q.deletions=[G],Q.flags|=16):ee.push(G)}}function c(Q,G){if(!i)return null;for(;G!==null;)o(Q,G),G=G.sibling;return null}function f(Q){for(var G=new Map;Q!==null;)Q.key!==null?G.set(Q.key,Q):G.set(Q.index,Q),Q=Q.sibling;return G}function g(Q,G){return Q=Ni(Q,G),Q.index=0,Q.sibling=null,Q}function y(Q,G,ee){return Q.index=ee,i?(ee=Q.alternate,ee!==null?(ee=ee.index,ee<G?(Q.flags|=67108866,G):ee):(Q.flags|=67108866,G)):(Q.flags|=1048576,G)}function E(Q){return i&&Q.alternate===null&&(Q.flags|=67108866),Q}function N(Q,G,ee,ce){return G===null||G.tag!==6?(G=Cp(ee,Q.mode,ce),G.return=Q,G):(G=g(G,ee),G.return=Q,G)}function W(Q,G,ee,ce){var Re=ee.type;return Re===w?oe(Q,G,ee.props.children,ce,ee.key):G!==null&&(G.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===B&&po(Re)===G.type)?(G=g(G,ee.props),ja(G,ee),G.return=Q,G):(G=Ku(ee.type,ee.key,ee.props,null,Q.mode,ce),ja(G,ee),G.return=Q,G)}function te(Q,G,ee,ce){return G===null||G.tag!==4||G.stateNode.containerInfo!==ee.containerInfo||G.stateNode.implementation!==ee.implementation?(G=kp(ee,Q.mode,ce),G.return=Q,G):(G=g(G,ee.children||[]),G.return=Q,G)}function oe(Q,G,ee,ce,Re){return G===null||G.tag!==7?(G=ao(ee,Q.mode,ce,Re),G.return=Q,G):(G=g(G,ee),G.return=Q,G)}function ue(Q,G,ee){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return G=Cp(""+G,Q.mode,ee),G.return=Q,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case b:return ee=Ku(G.type,G.key,G.props,null,Q.mode,ee),ja(ee,G),ee.return=Q,ee;case S:return G=kp(G,Q.mode,ee),G.return=Q,G;case B:return G=po(G),ue(Q,G,ee)}if(F(G)||H(G))return G=ao(G,Q.mode,ee,null),G.return=Q,G;if(typeof G.then=="function")return ue(Q,eh(G),ee);if(G.$$typeof===R)return ue(Q,Xu(Q,G),ee);th(Q,G)}return null}function re(Q,G,ee,ce){var Re=G!==null?G.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return Re!==null?null:N(Q,G,""+ee,ce);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case b:return ee.key===Re?W(Q,G,ee,ce):null;case S:return ee.key===Re?te(Q,G,ee,ce):null;case B:return ee=po(ee),re(Q,G,ee,ce)}if(F(ee)||H(ee))return Re!==null?null:oe(Q,G,ee,ce,null);if(typeof ee.then=="function")return re(Q,G,eh(ee),ce);if(ee.$$typeof===R)return re(Q,G,Xu(Q,ee),ce);th(Q,ee)}return null}function ie(Q,G,ee,ce,Re){if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return Q=Q.get(ee)||null,N(G,Q,""+ce,Re);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case b:return Q=Q.get(ce.key===null?ee:ce.key)||null,W(G,Q,ce,Re);case S:return Q=Q.get(ce.key===null?ee:ce.key)||null,te(G,Q,ce,Re);case B:return ce=po(ce),ie(Q,G,ee,ce,Re)}if(F(ce)||H(ce))return Q=Q.get(ee)||null,oe(G,Q,ce,Re,null);if(typeof ce.then=="function")return ie(Q,G,ee,eh(ce),Re);if(ce.$$typeof===R)return ie(Q,G,ee,Xu(G,ce),Re);th(G,ce)}return null}function be(Q,G,ee,ce){for(var Re=null,Qe=null,we=G,Be=G=0,Ve=null;we!==null&&Be<ee.length;Be++){we.index>Be?(Ve=we,we=null):Ve=we.sibling;var Je=re(Q,we,ee[Be],ce);if(Je===null){we===null&&(we=Ve);break}i&&we&&Je.alternate===null&&o(Q,we),G=y(Je,G,Be),Qe===null?Re=Je:Qe.sibling=Je,Qe=Je,we=Ve}if(Be===ee.length)return c(Q,we),Ye&&Oi(Q,Be),Re;if(we===null){for(;Be<ee.length;Be++)we=ue(Q,ee[Be],ce),we!==null&&(G=y(we,G,Be),Qe===null?Re=we:Qe.sibling=we,Qe=we);return Ye&&Oi(Q,Be),Re}for(we=f(we);Be<ee.length;Be++)Ve=ie(we,Q,Be,ee[Be],ce),Ve!==null&&(i&&Ve.alternate!==null&&we.delete(Ve.key===null?Be:Ve.key),G=y(Ve,G,Be),Qe===null?Re=Ve:Qe.sibling=Ve,Qe=Ve);return i&&we.forEach(function(Ns){return o(Q,Ns)}),Ye&&Oi(Q,Be),Re}function De(Q,G,ee,ce){if(ee==null)throw Error(r(151));for(var Re=null,Qe=null,we=G,Be=G=0,Ve=null,Je=ee.next();we!==null&&!Je.done;Be++,Je=ee.next()){we.index>Be?(Ve=we,we=null):Ve=we.sibling;var Ns=re(Q,we,Je.value,ce);if(Ns===null){we===null&&(we=Ve);break}i&&we&&Ns.alternate===null&&o(Q,we),G=y(Ns,G,Be),Qe===null?Re=Ns:Qe.sibling=Ns,Qe=Ns,we=Ve}if(Je.done)return c(Q,we),Ye&&Oi(Q,Be),Re;if(we===null){for(;!Je.done;Be++,Je=ee.next())Je=ue(Q,Je.value,ce),Je!==null&&(G=y(Je,G,Be),Qe===null?Re=Je:Qe.sibling=Je,Qe=Je);return Ye&&Oi(Q,Be),Re}for(we=f(we);!Je.done;Be++,Je=ee.next())Je=ie(we,Q,Be,Je.value,ce),Je!==null&&(i&&Je.alternate!==null&&we.delete(Je.key===null?Be:Je.key),G=y(Je,G,Be),Qe===null?Re=Je:Qe.sibling=Je,Qe=Je);return i&&we.forEach(function(TN){return o(Q,TN)}),Ye&&Oi(Q,Be),Re}function at(Q,G,ee,ce){if(typeof ee=="object"&&ee!==null&&ee.type===w&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case b:e:{for(var Re=ee.key;G!==null;){if(G.key===Re){if(Re=ee.type,Re===w){if(G.tag===7){c(Q,G.sibling),ce=g(G,ee.props.children),ce.return=Q,Q=ce;break e}}else if(G.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===B&&po(Re)===G.type){c(Q,G.sibling),ce=g(G,ee.props),ja(ce,ee),ce.return=Q,Q=ce;break e}c(Q,G);break}else o(Q,G);G=G.sibling}ee.type===w?(ce=ao(ee.props.children,Q.mode,ce,ee.key),ce.return=Q,Q=ce):(ce=Ku(ee.type,ee.key,ee.props,null,Q.mode,ce),ja(ce,ee),ce.return=Q,Q=ce)}return E(Q);case S:e:{for(Re=ee.key;G!==null;){if(G.key===Re)if(G.tag===4&&G.stateNode.containerInfo===ee.containerInfo&&G.stateNode.implementation===ee.implementation){c(Q,G.sibling),ce=g(G,ee.children||[]),ce.return=Q,Q=ce;break e}else{c(Q,G);break}else o(Q,G);G=G.sibling}ce=kp(ee,Q.mode,ce),ce.return=Q,Q=ce}return E(Q);case B:return ee=po(ee),at(Q,G,ee,ce)}if(F(ee))return be(Q,G,ee,ce);if(H(ee)){if(Re=H(ee),typeof Re!="function")throw Error(r(150));return ee=Re.call(ee),De(Q,G,ee,ce)}if(typeof ee.then=="function")return at(Q,G,eh(ee),ce);if(ee.$$typeof===R)return at(Q,G,Xu(Q,ee),ce);th(Q,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint"?(ee=""+ee,G!==null&&G.tag===6?(c(Q,G.sibling),ce=g(G,ee),ce.return=Q,Q=ce):(c(Q,G),ce=Cp(ee,Q.mode,ce),ce.return=Q,Q=ce),E(Q)):c(Q,G)}return function(Q,G,ee,ce){try{Ba=0;var Re=at(Q,G,ee,ce);return _l=null,Re}catch(we){if(we===vl||we===Qu)throw we;var Qe=sr(29,we,null,Q.mode);return Qe.lanes=ce,Qe.return=Q,Qe}finally{}}}var go=T0(!0),A0=T0(!1),ms=!1;function jp(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Pp(i,o){i=i.updateQueue,o.updateQueue===i&&(o.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function gs(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function vs(i,o,c){var f=i.updateQueue;if(f===null)return null;if(f=f.shared,(tt&2)!==0){var g=f.pending;return g===null?o.next=o:(o.next=g.next,g.next=o),f.pending=o,o=Vu(i),f0(i,null,c),o}return qu(i,f,o,c),Vu(i)}function Pa(i,o,c){if(o=o.updateQueue,o!==null&&(o=o.shared,(c&4194048)!==0)){var f=o.lanes;f&=i.pendingLanes,c|=f,o.lanes=c,rr(i,c)}}function Ip(i,o){var c=i.updateQueue,f=i.alternate;if(f!==null&&(f=f.updateQueue,c===f)){var g=null,y=null;if(c=c.firstBaseUpdate,c!==null){do{var E={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};y===null?g=y=E:y=y.next=E,c=c.next}while(c!==null);y===null?g=y=o:y=y.next=o}else g=y=o;c={baseState:f.baseState,firstBaseUpdate:g,lastBaseUpdate:y,shared:f.shared,callbacks:f.callbacks},i.updateQueue=c;return}i=c.lastBaseUpdate,i===null?c.firstBaseUpdate=o:i.next=o,c.lastBaseUpdate=o}var Hp=!1;function Ia(){if(Hp){var i=gl;if(i!==null)throw i}}function Ha(i,o,c,f){Hp=!1;var g=i.updateQueue;ms=!1;var y=g.firstBaseUpdate,E=g.lastBaseUpdate,N=g.shared.pending;if(N!==null){g.shared.pending=null;var W=N,te=W.next;W.next=null,E===null?y=te:E.next=te,E=W;var oe=i.alternate;oe!==null&&(oe=oe.updateQueue,N=oe.lastBaseUpdate,N!==E&&(N===null?oe.firstBaseUpdate=te:N.next=te,oe.lastBaseUpdate=W))}if(y!==null){var ue=g.baseState;E=0,oe=te=W=null,N=y;do{var re=N.lane&-536870913,ie=re!==N.lane;if(ie?(qe&re)===re:(f&re)===re){re!==0&&re===ml&&(Hp=!0),oe!==null&&(oe=oe.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var be=i,De=N;re=o;var at=c;switch(De.tag){case 1:if(be=De.payload,typeof be=="function"){ue=be.call(at,ue,re);break e}ue=be;break e;case 3:be.flags=be.flags&-65537|128;case 0:if(be=De.payload,re=typeof be=="function"?be.call(at,ue,re):be,re==null)break e;ue=p({},ue,re);break e;case 2:ms=!0}}re=N.callback,re!==null&&(i.flags|=64,ie&&(i.flags|=8192),ie=g.callbacks,ie===null?g.callbacks=[re]:ie.push(re))}else ie={lane:re,tag:N.tag,payload:N.payload,callback:N.callback,next:null},oe===null?(te=oe=ie,W=ue):oe=oe.next=ie,E|=re;if(N=N.next,N===null){if(N=g.shared.pending,N===null)break;ie=N,N=ie.next,ie.next=null,g.lastBaseUpdate=ie,g.shared.pending=null}}while(!0);oe===null&&(W=ue),g.baseState=W,g.firstBaseUpdate=te,g.lastBaseUpdate=oe,y===null&&(g.shared.lanes=0),Ss|=E,i.lanes=E,i.memoizedState=ue}}function D0(i,o){if(typeof i!="function")throw Error(r(191,i));i.call(o)}function N0(i,o){var c=i.callbacks;if(c!==null)for(i.callbacks=null,i=0;i<c.length;i++)D0(c[i],o)}var yl=I(null),nh=I(0);function O0(i,o){i=Wi,M(nh,i),M(yl,o),Wi=i|o.baseLanes}function Fp(){M(nh,Wi),M(yl,yl.current)}function Up(){Wi=nh.current,Y(yl),Y(nh)}var or=I(null),Mr=null;function _s(i){var o=i.alternate;M(Ot,Ot.current&1),M(or,i),Mr===null&&(o===null||yl.current!==null||o.memoizedState!==null)&&(Mr=i)}function $p(i){M(Ot,Ot.current),M(or,i),Mr===null&&(Mr=i)}function L0(i){i.tag===22?(M(Ot,Ot.current),M(or,i),Mr===null&&(Mr=i)):ys()}function ys(){M(Ot,Ot.current),M(or,or.current)}function lr(i){Y(or),Mr===i&&(Mr=null),Y(Ot)}var Ot=I(0);function rh(i){for(var o=i;o!==null;){if(o.tag===13){var c=o.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||Ym(c)||Xm(c)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var Bi=0,ze=null,ot=null,Pt=null,ih=!1,bl=!1,vo=!1,sh=0,Fa=0,xl=null,yD=0;function Ct(){throw Error(r(321))}function Wp(i,o){if(o===null)return!1;for(var c=0;c<o.length&&c<i.length;c++)if(!ir(i[c],o[c]))return!1;return!0}function qp(i,o,c,f,g,y){return Bi=y,ze=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,j.H=i===null||i.memoizedState===null?vx:om,vo=!1,y=c(f,g),vo=!1,bl&&(y=B0(o,c,f,g)),z0(i),y}function z0(i){j.H=Wa;var o=ot!==null&&ot.next!==null;if(Bi=0,Pt=ot=ze=null,ih=!1,Fa=0,xl=null,o)throw Error(r(300));i===null||It||(i=i.dependencies,i!==null&&Yu(i)&&(It=!0))}function B0(i,o,c,f){ze=i;var g=0;do{if(bl&&(xl=null),Fa=0,bl=!1,25<=g)throw Error(r(301));if(g+=1,Pt=ot=null,i.updateQueue!=null){var y=i.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}j.H=_x,y=o(c,f)}while(bl);return y}function bD(){var i=j.H,o=i.useState()[0];return o=typeof o.then=="function"?Ua(o):o,i=i.useState()[0],(ot!==null?ot.memoizedState:null)!==i&&(ze.flags|=1024),o}function Vp(){var i=sh!==0;return sh=0,i}function Kp(i,o,c){o.updateQueue=i.updateQueue,o.flags&=-2053,i.lanes&=~c}function Gp(i){if(ih){for(i=i.memoizedState;i!==null;){var o=i.queue;o!==null&&(o.pending=null),i=i.next}ih=!1}Bi=0,Pt=ot=ze=null,bl=!1,Fa=sh=0,xl=null}function Dn(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pt===null?ze.memoizedState=Pt=i:Pt=Pt.next=i,Pt}function Lt(){if(ot===null){var i=ze.alternate;i=i!==null?i.memoizedState:null}else i=ot.next;var o=Pt===null?ze.memoizedState:Pt.next;if(o!==null)Pt=o,ot=i;else{if(i===null)throw ze.alternate===null?Error(r(467)):Error(r(310));ot=i,i={memoizedState:ot.memoizedState,baseState:ot.baseState,baseQueue:ot.baseQueue,queue:ot.queue,next:null},Pt===null?ze.memoizedState=Pt=i:Pt=Pt.next=i}return Pt}function oh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ua(i){var o=Fa;return Fa+=1,xl===null&&(xl=[]),i=E0(xl,i,o),o=ze,(Pt===null?o.memoizedState:Pt.next)===null&&(o=o.alternate,j.H=o===null||o.memoizedState===null?vx:om),i}function lh(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Ua(i);if(i.$$typeof===R)return yn(i)}throw Error(r(438,String(i)))}function Yp(i){var o=null,c=ze.updateQueue;if(c!==null&&(o=c.memoCache),o==null){var f=ze.alternate;f!==null&&(f=f.updateQueue,f!==null&&(f=f.memoCache,f!=null&&(o={data:f.data.map(function(g){return g.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),c===null&&(c=oh(),ze.updateQueue=c),c.memoCache=o,c=o.data[o.index],c===void 0)for(c=o.data[o.index]=Array(i),f=0;f<i;f++)c[f]=P;return o.index++,c}function ji(i,o){return typeof o=="function"?o(i):o}function ah(i){var o=Lt();return Xp(o,ot,i)}function Xp(i,o,c){var f=i.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=c;var g=i.baseQueue,y=f.pending;if(y!==null){if(g!==null){var E=g.next;g.next=y.next,y.next=E}o.baseQueue=g=y,f.pending=null}if(y=i.baseState,g===null)i.memoizedState=y;else{o=g.next;var N=E=null,W=null,te=o,oe=!1;do{var ue=te.lane&-536870913;if(ue!==te.lane?(qe&ue)===ue:(Bi&ue)===ue){var re=te.revertLane;if(re===0)W!==null&&(W=W.next={lane:0,revertLane:0,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),ue===ml&&(oe=!0);else if((Bi&re)===re){te=te.next,re===ml&&(oe=!0);continue}else ue={lane:0,revertLane:te.revertLane,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},W===null?(N=W=ue,E=y):W=W.next=ue,ze.lanes|=re,Ss|=re;ue=te.action,vo&&c(y,ue),y=te.hasEagerState?te.eagerState:c(y,ue)}else re={lane:ue,revertLane:te.revertLane,gesture:te.gesture,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},W===null?(N=W=re,E=y):W=W.next=re,ze.lanes|=ue,Ss|=ue;te=te.next}while(te!==null&&te!==o);if(W===null?E=y:W.next=N,!ir(y,i.memoizedState)&&(It=!0,oe&&(c=gl,c!==null)))throw c;i.memoizedState=y,i.baseState=E,i.baseQueue=W,f.lastRenderedState=y}return g===null&&(f.lanes=0),[i.memoizedState,f.dispatch]}function Zp(i){var o=Lt(),c=o.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=i;var f=c.dispatch,g=c.pending,y=o.memoizedState;if(g!==null){c.pending=null;var E=g=g.next;do y=i(y,E.action),E=E.next;while(E!==g);ir(y,o.memoizedState)||(It=!0),o.memoizedState=y,o.baseQueue===null&&(o.baseState=y),c.lastRenderedState=y}return[y,f]}function j0(i,o,c){var f=ze,g=Lt(),y=Ye;if(y){if(c===void 0)throw Error(r(407));c=c()}else c=o();var E=!ir((ot||g).memoizedState,c);if(E&&(g.memoizedState=c,It=!0),g=g.queue,em(H0.bind(null,f,g,i),[i]),g.getSnapshot!==o||E||Pt!==null&&Pt.memoizedState.tag&1){if(f.flags|=2048,Sl(9,{destroy:void 0},I0.bind(null,f,g,c,o),null),ht===null)throw Error(r(349));y||(Bi&127)!==0||P0(f,o,c)}return c}function P0(i,o,c){i.flags|=16384,i={getSnapshot:o,value:c},o=ze.updateQueue,o===null?(o=oh(),ze.updateQueue=o,o.stores=[i]):(c=o.stores,c===null?o.stores=[i]:c.push(i))}function I0(i,o,c,f){o.value=c,o.getSnapshot=f,F0(o)&&U0(i)}function H0(i,o,c){return c(function(){F0(o)&&U0(i)})}function F0(i){var o=i.getSnapshot;i=i.value;try{var c=o();return!ir(i,c)}catch{return!0}}function U0(i){var o=lo(i,2);o!==null&&Xn(o,i,2)}function Qp(i){var o=Dn();if(typeof i=="function"){var c=i;if(i=c(),vo){Qt(!0);try{c()}finally{Qt(!1)}}}return o.memoizedState=o.baseState=i,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ji,lastRenderedState:i},o}function $0(i,o,c,f){return i.baseState=c,Xp(i,ot,typeof f=="function"?f:ji)}function xD(i,o,c,f,g){if(hh(i))throw Error(r(485));if(i=o.action,i!==null){var y={payload:g,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(E){y.listeners.push(E)}};j.T!==null?c(!0):y.isTransition=!1,f(y),c=o.pending,c===null?(y.next=o.pending=y,W0(o,y)):(y.next=c.next,o.pending=c.next=y)}}function W0(i,o){var c=o.action,f=o.payload,g=i.state;if(o.isTransition){var y=j.T,E={};j.T=E;try{var N=c(g,f),W=j.S;W!==null&&W(E,N),q0(i,o,N)}catch(te){Jp(i,o,te)}finally{y!==null&&E.types!==null&&(y.types=E.types),j.T=y}}else try{y=c(g,f),q0(i,o,y)}catch(te){Jp(i,o,te)}}function q0(i,o,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(f){V0(i,o,f)},function(f){return Jp(i,o,f)}):V0(i,o,c)}function V0(i,o,c){o.status="fulfilled",o.value=c,K0(o),i.state=c,o=i.pending,o!==null&&(c=o.next,c===o?i.pending=null:(c=c.next,o.next=c,W0(i,c)))}function Jp(i,o,c){var f=i.pending;if(i.pending=null,f!==null){f=f.next;do o.status="rejected",o.reason=c,K0(o),o=o.next;while(o!==f)}i.action=null}function K0(i){i=i.listeners;for(var o=0;o<i.length;o++)(0,i[o])()}function G0(i,o){return o}function Y0(i,o){if(Ye){var c=ht.formState;if(c!==null){e:{var f=ze;if(Ye){if(mt){t:{for(var g=mt,y=Rr;g.nodeType!==8;){if(!y){g=null;break t}if(g=Tr(g.nextSibling),g===null){g=null;break t}}y=g.data,g=y==="F!"||y==="F"?g:null}if(g){mt=Tr(g.nextSibling),f=g.data==="F!";break e}}fs(f)}f=!1}f&&(o=c[0])}}return c=Dn(),c.memoizedState=c.baseState=o,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:G0,lastRenderedState:o},c.queue=f,c=px.bind(null,ze,f),f.dispatch=c,f=Qp(!1),y=sm.bind(null,ze,!1,f.queue),f=Dn(),g={state:o,dispatch:null,action:i,pending:null},f.queue=g,c=xD.bind(null,ze,g,y,c),g.dispatch=c,f.memoizedState=i,[o,c,!1]}function X0(i){var o=Lt();return Z0(o,ot,i)}function Z0(i,o,c){if(o=Xp(i,o,G0)[0],i=ah(ji)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var f=Ua(o)}catch(E){throw E===vl?Qu:E}else f=o;o=Lt();var g=o.queue,y=g.dispatch;return c!==o.memoizedState&&(ze.flags|=2048,Sl(9,{destroy:void 0},SD.bind(null,g,c),null)),[f,y,i]}function SD(i,o){i.action=o}function Q0(i){var o=Lt(),c=ot;if(c!==null)return Z0(o,c,i);Lt(),o=o.memoizedState,c=Lt();var f=c.queue.dispatch;return c.memoizedState=i,[o,f,!1]}function Sl(i,o,c,f){return i={tag:i,create:c,deps:f,inst:o,next:null},o=ze.updateQueue,o===null&&(o=oh(),ze.updateQueue=o),c=o.lastEffect,c===null?o.lastEffect=i.next=i:(f=c.next,c.next=i,i.next=f,o.lastEffect=i),i}function J0(){return Lt().memoizedState}function ch(i,o,c,f){var g=Dn();ze.flags|=i,g.memoizedState=Sl(1|o,{destroy:void 0},c,f===void 0?null:f)}function uh(i,o,c,f){var g=Lt();f=f===void 0?null:f;var y=g.memoizedState.inst;ot!==null&&f!==null&&Wp(f,ot.memoizedState.deps)?g.memoizedState=Sl(o,y,c,f):(ze.flags|=i,g.memoizedState=Sl(1|o,y,c,f))}function ex(i,o){ch(8390656,8,i,o)}function em(i,o){uh(2048,8,i,o)}function wD(i){ze.flags|=4;var o=ze.updateQueue;if(o===null)o=oh(),ze.updateQueue=o,o.events=[i];else{var c=o.events;c===null?o.events=[i]:c.push(i)}}function tx(i){var o=Lt().memoizedState;return wD({ref:o,nextImpl:i}),function(){if((tt&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}function nx(i,o){return uh(4,2,i,o)}function rx(i,o){return uh(4,4,i,o)}function ix(i,o){if(typeof o=="function"){i=i();var c=o(i);return function(){typeof c=="function"?c():o(null)}}if(o!=null)return i=i(),o.current=i,function(){o.current=null}}function sx(i,o,c){c=c!=null?c.concat([i]):null,uh(4,4,ix.bind(null,o,i),c)}function tm(){}function ox(i,o){var c=Lt();o=o===void 0?null:o;var f=c.memoizedState;return o!==null&&Wp(o,f[1])?f[0]:(c.memoizedState=[i,o],i)}function lx(i,o){var c=Lt();o=o===void 0?null:o;var f=c.memoizedState;if(o!==null&&Wp(o,f[1]))return f[0];if(f=i(),vo){Qt(!0);try{i()}finally{Qt(!1)}}return c.memoizedState=[f,o],f}function nm(i,o,c){return c===void 0||(Bi&1073741824)!==0&&(qe&261930)===0?i.memoizedState=o:(i.memoizedState=c,i=a1(),ze.lanes|=i,Ss|=i,c)}function ax(i,o,c,f){return ir(c,o)?c:yl.current!==null?(i=nm(i,c,f),ir(i,o)||(It=!0),i):(Bi&42)===0||(Bi&1073741824)!==0&&(qe&261930)===0?(It=!0,i.memoizedState=c):(i=a1(),ze.lanes|=i,Ss|=i,o)}function cx(i,o,c,f,g){var y=K.p;K.p=y!==0&&8>y?y:8;var E=j.T,N={};j.T=N,sm(i,!1,o,c);try{var W=g(),te=j.S;if(te!==null&&te(N,W),W!==null&&typeof W=="object"&&typeof W.then=="function"){var oe=_D(W,f);$a(i,o,oe,ur(i))}else $a(i,o,f,ur(i))}catch(ue){$a(i,o,{then:function(){},status:"rejected",reason:ue},ur())}finally{K.p=y,E!==null&&N.types!==null&&(E.types=N.types),j.T=E}}function CD(){}function rm(i,o,c,f){if(i.tag!==5)throw Error(r(476));var g=ux(i).queue;cx(i,g,o,$,c===null?CD:function(){return hx(i),c(f)})}function ux(i){var o=i.memoizedState;if(o!==null)return o;o={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ji,lastRenderedState:$},next:null};var c={};return o.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ji,lastRenderedState:c},next:null},i.memoizedState=o,i=i.alternate,i!==null&&(i.memoizedState=o),o}function hx(i){var o=ux(i);o.next===null&&(o=i.alternate.memoizedState),$a(i,o.next.queue,{},ur())}function im(){return yn(oc)}function dx(){return Lt().memoizedState}function fx(){return Lt().memoizedState}function kD(i){for(var o=i.return;o!==null;){switch(o.tag){case 24:case 3:var c=ur();i=gs(c);var f=vs(o,i,c);f!==null&&(Xn(f,o,c),Pa(f,o,c)),o={cache:Op()},i.payload=o;return}o=o.return}}function ED(i,o,c){var f=ur();c={lane:f,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},hh(i)?mx(o,c):(c=Sp(i,o,c,f),c!==null&&(Xn(c,i,f),gx(c,o,f)))}function px(i,o,c){var f=ur();$a(i,o,c,f)}function $a(i,o,c,f){var g={lane:f,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(hh(i))mx(o,g);else{var y=i.alternate;if(i.lanes===0&&(y===null||y.lanes===0)&&(y=o.lastRenderedReducer,y!==null))try{var E=o.lastRenderedState,N=y(E,c);if(g.hasEagerState=!0,g.eagerState=N,ir(N,E))return qu(i,o,g,0),ht===null&&Wu(),!1}catch{}finally{}if(c=Sp(i,o,g,f),c!==null)return Xn(c,i,f),gx(c,o,f),!0}return!1}function sm(i,o,c,f){if(f={lane:2,revertLane:jm(),gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},hh(i)){if(o)throw Error(r(479))}else o=Sp(i,c,f,2),o!==null&&Xn(o,i,2)}function hh(i){var o=i.alternate;return i===ze||o!==null&&o===ze}function mx(i,o){bl=ih=!0;var c=i.pending;c===null?o.next=o:(o.next=c.next,c.next=o),i.pending=o}function gx(i,o,c){if((c&4194048)!==0){var f=o.lanes;f&=i.pendingLanes,c|=f,o.lanes=c,rr(i,c)}}var Wa={readContext:yn,use:lh,useCallback:Ct,useContext:Ct,useEffect:Ct,useImperativeHandle:Ct,useLayoutEffect:Ct,useInsertionEffect:Ct,useMemo:Ct,useReducer:Ct,useRef:Ct,useState:Ct,useDebugValue:Ct,useDeferredValue:Ct,useTransition:Ct,useSyncExternalStore:Ct,useId:Ct,useHostTransitionStatus:Ct,useFormState:Ct,useActionState:Ct,useOptimistic:Ct,useMemoCache:Ct,useCacheRefresh:Ct};Wa.useEffectEvent=Ct;var vx={readContext:yn,use:lh,useCallback:function(i,o){return Dn().memoizedState=[i,o===void 0?null:o],i},useContext:yn,useEffect:ex,useImperativeHandle:function(i,o,c){c=c!=null?c.concat([i]):null,ch(4194308,4,ix.bind(null,o,i),c)},useLayoutEffect:function(i,o){return ch(4194308,4,i,o)},useInsertionEffect:function(i,o){ch(4,2,i,o)},useMemo:function(i,o){var c=Dn();o=o===void 0?null:o;var f=i();if(vo){Qt(!0);try{i()}finally{Qt(!1)}}return c.memoizedState=[f,o],f},useReducer:function(i,o,c){var f=Dn();if(c!==void 0){var g=c(o);if(vo){Qt(!0);try{c(o)}finally{Qt(!1)}}}else g=o;return f.memoizedState=f.baseState=g,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:g},f.queue=i,i=i.dispatch=ED.bind(null,ze,i),[f.memoizedState,i]},useRef:function(i){var o=Dn();return i={current:i},o.memoizedState=i},useState:function(i){i=Qp(i);var o=i.queue,c=px.bind(null,ze,o);return o.dispatch=c,[i.memoizedState,c]},useDebugValue:tm,useDeferredValue:function(i,o){var c=Dn();return nm(c,i,o)},useTransition:function(){var i=Qp(!1);return i=cx.bind(null,ze,i.queue,!0,!1),Dn().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,o,c){var f=ze,g=Dn();if(Ye){if(c===void 0)throw Error(r(407));c=c()}else{if(c=o(),ht===null)throw Error(r(349));(qe&127)!==0||P0(f,o,c)}g.memoizedState=c;var y={value:c,getSnapshot:o};return g.queue=y,ex(H0.bind(null,f,y,i),[i]),f.flags|=2048,Sl(9,{destroy:void 0},I0.bind(null,f,y,c,o),null),c},useId:function(){var i=Dn(),o=ht.identifierPrefix;if(Ye){var c=si,f=ii;c=(f&~(1<<32-rt(f)-1)).toString(32)+c,o="_"+o+"R_"+c,c=sh++,0<c&&(o+="H"+c.toString(32)),o+="_"}else c=yD++,o="_"+o+"r_"+c.toString(32)+"_";return i.memoizedState=o},useHostTransitionStatus:im,useFormState:Y0,useActionState:Y0,useOptimistic:function(i){var o=Dn();o.memoizedState=o.baseState=i;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=c,o=sm.bind(null,ze,!0,c),c.dispatch=o,[i,o]},useMemoCache:Yp,useCacheRefresh:function(){return Dn().memoizedState=kD.bind(null,ze)},useEffectEvent:function(i){var o=Dn(),c={impl:i};return o.memoizedState=c,function(){if((tt&2)!==0)throw Error(r(440));return c.impl.apply(void 0,arguments)}}},om={readContext:yn,use:lh,useCallback:ox,useContext:yn,useEffect:em,useImperativeHandle:sx,useInsertionEffect:nx,useLayoutEffect:rx,useMemo:lx,useReducer:ah,useRef:J0,useState:function(){return ah(ji)},useDebugValue:tm,useDeferredValue:function(i,o){var c=Lt();return ax(c,ot.memoizedState,i,o)},useTransition:function(){var i=ah(ji)[0],o=Lt().memoizedState;return[typeof i=="boolean"?i:Ua(i),o]},useSyncExternalStore:j0,useId:dx,useHostTransitionStatus:im,useFormState:X0,useActionState:X0,useOptimistic:function(i,o){var c=Lt();return $0(c,ot,i,o)},useMemoCache:Yp,useCacheRefresh:fx};om.useEffectEvent=tx;var _x={readContext:yn,use:lh,useCallback:ox,useContext:yn,useEffect:em,useImperativeHandle:sx,useInsertionEffect:nx,useLayoutEffect:rx,useMemo:lx,useReducer:Zp,useRef:J0,useState:function(){return Zp(ji)},useDebugValue:tm,useDeferredValue:function(i,o){var c=Lt();return ot===null?nm(c,i,o):ax(c,ot.memoizedState,i,o)},useTransition:function(){var i=Zp(ji)[0],o=Lt().memoizedState;return[typeof i=="boolean"?i:Ua(i),o]},useSyncExternalStore:j0,useId:dx,useHostTransitionStatus:im,useFormState:Q0,useActionState:Q0,useOptimistic:function(i,o){var c=Lt();return ot!==null?$0(c,ot,i,o):(c.baseState=i,[i,c.queue.dispatch])},useMemoCache:Yp,useCacheRefresh:fx};_x.useEffectEvent=tx;function lm(i,o,c,f){o=i.memoizedState,c=c(f,o),c=c==null?o:p({},o,c),i.memoizedState=c,i.lanes===0&&(i.updateQueue.baseState=c)}var am={enqueueSetState:function(i,o,c){i=i._reactInternals;var f=ur(),g=gs(f);g.payload=o,c!=null&&(g.callback=c),o=vs(i,g,f),o!==null&&(Xn(o,i,f),Pa(o,i,f))},enqueueReplaceState:function(i,o,c){i=i._reactInternals;var f=ur(),g=gs(f);g.tag=1,g.payload=o,c!=null&&(g.callback=c),o=vs(i,g,f),o!==null&&(Xn(o,i,f),Pa(o,i,f))},enqueueForceUpdate:function(i,o){i=i._reactInternals;var c=ur(),f=gs(c);f.tag=2,o!=null&&(f.callback=o),o=vs(i,f,c),o!==null&&(Xn(o,i,c),Pa(o,i,c))}};function yx(i,o,c,f,g,y,E){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(f,y,E):o.prototype&&o.prototype.isPureReactComponent?!Aa(c,f)||!Aa(g,y):!0}function bx(i,o,c,f){i=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(c,f),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(c,f),o.state!==i&&am.enqueueReplaceState(o,o.state,null)}function _o(i,o){var c=o;if("ref"in o){c={};for(var f in o)f!=="ref"&&(c[f]=o[f])}if(i=i.defaultProps){c===o&&(c=p({},c));for(var g in i)c[g]===void 0&&(c[g]=i[g])}return c}function xx(i){$u(i)}function Sx(i){console.error(i)}function wx(i){$u(i)}function dh(i,o){try{var c=i.onUncaughtError;c(o.value,{componentStack:o.stack})}catch(f){setTimeout(function(){throw f})}}function Cx(i,o,c){try{var f=i.onCaughtError;f(c.value,{componentStack:c.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function cm(i,o,c){return c=gs(c),c.tag=3,c.payload={element:null},c.callback=function(){dh(i,o)},c}function kx(i){return i=gs(i),i.tag=3,i}function Ex(i,o,c,f){var g=c.type.getDerivedStateFromError;if(typeof g=="function"){var y=f.value;i.payload=function(){return g(y)},i.callback=function(){Cx(o,c,f)}}var E=c.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(i.callback=function(){Cx(o,c,f),typeof g!="function"&&(ws===null?ws=new Set([this]):ws.add(this));var N=f.stack;this.componentDidCatch(f.value,{componentStack:N!==null?N:""})})}function RD(i,o,c,f,g){if(c.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){if(o=c.alternate,o!==null&&pl(o,c,g,!0),c=or.current,c!==null){switch(c.tag){case 31:case 13:return Mr===null?Ch():c.alternate===null&&kt===0&&(kt=3),c.flags&=-257,c.flags|=65536,c.lanes=g,f===Ju?c.flags|=16384:(o=c.updateQueue,o===null?c.updateQueue=new Set([f]):o.add(f),Lm(i,f,g)),!1;case 22:return c.flags|=65536,f===Ju?c.flags|=16384:(o=c.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([f])},c.updateQueue=o):(c=o.retryQueue,c===null?o.retryQueue=new Set([f]):c.add(f)),Lm(i,f,g)),!1}throw Error(r(435,c.tag))}return Lm(i,f,g),Ch(),!1}if(Ye)return o=or.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=g,f!==Mp&&(i=Error(r(422),{cause:f}),Oa(Cr(i,c)))):(f!==Mp&&(o=Error(r(423),{cause:f}),Oa(Cr(o,c))),i=i.current.alternate,i.flags|=65536,g&=-g,i.lanes|=g,f=Cr(f,c),g=cm(i.stateNode,f,g),Ip(i,g),kt!==4&&(kt=2)),!1;var y=Error(r(520),{cause:f});if(y=Cr(y,c),Qa===null?Qa=[y]:Qa.push(y),kt!==4&&(kt=2),o===null)return!0;f=Cr(f,c),c=o;do{switch(c.tag){case 3:return c.flags|=65536,i=g&-g,c.lanes|=i,i=cm(c.stateNode,f,i),Ip(c,i),!1;case 1:if(o=c.type,y=c.stateNode,(c.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(ws===null||!ws.has(y))))return c.flags|=65536,g&=-g,c.lanes|=g,g=kx(g),Ex(g,i,c,f),Ip(c,g),!1}c=c.return}while(c!==null);return!1}var um=Error(r(461)),It=!1;function bn(i,o,c,f){o.child=i===null?A0(o,null,c,f):go(o,i.child,c,f)}function Rx(i,o,c,f,g){c=c.render;var y=o.ref;if("ref"in f){var E={};for(var N in f)N!=="ref"&&(E[N]=f[N])}else E=f;return ho(o),f=qp(i,o,c,E,y,g),N=Vp(),i!==null&&!It?(Kp(i,o,g),Pi(i,o,g)):(Ye&&N&&Ep(o),o.flags|=1,bn(i,o,f,g),o.child)}function Mx(i,o,c,f,g){if(i===null){var y=c.type;return typeof y=="function"&&!wp(y)&&y.defaultProps===void 0&&c.compare===null?(o.tag=15,o.type=y,Tx(i,o,y,f,g)):(i=Ku(c.type,null,f,o,o.mode,g),i.ref=o.ref,i.return=o,o.child=i)}if(y=i.child,!_m(i,g)){var E=y.memoizedProps;if(c=c.compare,c=c!==null?c:Aa,c(E,f)&&i.ref===o.ref)return Pi(i,o,g)}return o.flags|=1,i=Ni(y,f),i.ref=o.ref,i.return=o,o.child=i}function Tx(i,o,c,f,g){if(i!==null){var y=i.memoizedProps;if(Aa(y,f)&&i.ref===o.ref)if(It=!1,o.pendingProps=f=y,_m(i,g))(i.flags&131072)!==0&&(It=!0);else return o.lanes=i.lanes,Pi(i,o,g)}return hm(i,o,c,f,g)}function Ax(i,o,c,f){var g=f.children,y=i!==null?i.memoizedState:null;if(i===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),f.mode==="hidden"){if((o.flags&128)!==0){if(y=y!==null?y.baseLanes|c:c,i!==null){for(f=o.child=i.child,g=0;f!==null;)g=g|f.lanes|f.childLanes,f=f.sibling;f=g&~y}else f=0,o.child=null;return Dx(i,o,y,c,f)}if((c&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},i!==null&&Zu(o,y!==null?y.cachePool:null),y!==null?O0(o,y):Fp(),L0(o);else return f=o.lanes=536870912,Dx(i,o,y!==null?y.baseLanes|c:c,c,f)}else y!==null?(Zu(o,y.cachePool),O0(o,y),ys(),o.memoizedState=null):(i!==null&&Zu(o,null),Fp(),ys());return bn(i,o,g,c),o.child}function qa(i,o){return i!==null&&i.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function Dx(i,o,c,f,g){var y=zp();return y=y===null?null:{parent:jt._currentValue,pool:y},o.memoizedState={baseLanes:c,cachePool:y},i!==null&&Zu(o,null),Fp(),L0(o),i!==null&&pl(i,o,f,!0),o.childLanes=g,null}function fh(i,o){return o=mh({mode:o.mode,children:o.children},i.mode),o.ref=i.ref,i.child=o,o.return=i,o}function Nx(i,o,c){return go(o,i.child,null,c),i=fh(o,o.pendingProps),i.flags|=2,lr(o),o.memoizedState=null,i}function MD(i,o,c){var f=o.pendingProps,g=(o.flags&128)!==0;if(o.flags&=-129,i===null){if(Ye){if(f.mode==="hidden")return i=fh(o,f),o.lanes=536870912,qa(null,i);if($p(o),(i=mt)?(i=W1(i,Rr),i=i!==null&&i.data==="&"?i:null,i!==null&&(o.memoizedState={dehydrated:i,treeContext:hs!==null?{id:ii,overflow:si}:null,retryLane:536870912,hydrationErrors:null},c=m0(i),c.return=o,o.child=c,_n=o,mt=null)):i=null,i===null)throw fs(o);return o.lanes=536870912,null}return fh(o,f)}var y=i.memoizedState;if(y!==null){var E=y.dehydrated;if($p(o),g)if(o.flags&256)o.flags&=-257,o=Nx(i,o,c);else if(o.memoizedState!==null)o.child=i.child,o.flags|=128,o=null;else throw Error(r(558));else if(It||pl(i,o,c,!1),g=(c&i.childLanes)!==0,It||g){if(f=ht,f!==null&&(E=yr(f,c),E!==0&&E!==y.retryLane))throw y.retryLane=E,lo(i,E),Xn(f,i,E),um;Ch(),o=Nx(i,o,c)}else i=y.treeContext,mt=Tr(E.nextSibling),_n=o,Ye=!0,ds=null,Rr=!1,i!==null&&_0(o,i),o=fh(o,f),o.flags|=4096;return o}return i=Ni(i.child,{mode:f.mode,children:f.children}),i.ref=o.ref,o.child=i,i.return=o,i}function ph(i,o){var c=o.ref;if(c===null)i!==null&&i.ref!==null&&(o.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(r(284));(i===null||i.ref!==c)&&(o.flags|=4194816)}}function hm(i,o,c,f,g){return ho(o),c=qp(i,o,c,f,void 0,g),f=Vp(),i!==null&&!It?(Kp(i,o,g),Pi(i,o,g)):(Ye&&f&&Ep(o),o.flags|=1,bn(i,o,c,g),o.child)}function Ox(i,o,c,f,g,y){return ho(o),o.updateQueue=null,c=B0(o,f,c,g),z0(i),f=Vp(),i!==null&&!It?(Kp(i,o,y),Pi(i,o,y)):(Ye&&f&&Ep(o),o.flags|=1,bn(i,o,c,y),o.child)}function Lx(i,o,c,f,g){if(ho(o),o.stateNode===null){var y=ul,E=c.contextType;typeof E=="object"&&E!==null&&(y=yn(E)),y=new c(f,y),o.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=am,o.stateNode=y,y._reactInternals=o,y=o.stateNode,y.props=f,y.state=o.memoizedState,y.refs={},jp(o),E=c.contextType,y.context=typeof E=="object"&&E!==null?yn(E):ul,y.state=o.memoizedState,E=c.getDerivedStateFromProps,typeof E=="function"&&(lm(o,c,E,f),y.state=o.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(E=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),E!==y.state&&am.enqueueReplaceState(y,y.state,null),Ha(o,f,y,g),Ia(),y.state=o.memoizedState),typeof y.componentDidMount=="function"&&(o.flags|=4194308),f=!0}else if(i===null){y=o.stateNode;var N=o.memoizedProps,W=_o(c,N);y.props=W;var te=y.context,oe=c.contextType;E=ul,typeof oe=="object"&&oe!==null&&(E=yn(oe));var ue=c.getDerivedStateFromProps;oe=typeof ue=="function"||typeof y.getSnapshotBeforeUpdate=="function",N=o.pendingProps!==N,oe||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(N||te!==E)&&bx(o,y,f,E),ms=!1;var re=o.memoizedState;y.state=re,Ha(o,f,y,g),Ia(),te=o.memoizedState,N||re!==te||ms?(typeof ue=="function"&&(lm(o,c,ue,f),te=o.memoizedState),(W=ms||yx(o,c,W,f,re,te,E))?(oe||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(o.flags|=4194308)):(typeof y.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=f,o.memoizedState=te),y.props=f,y.state=te,y.context=E,f=W):(typeof y.componentDidMount=="function"&&(o.flags|=4194308),f=!1)}else{y=o.stateNode,Pp(i,o),E=o.memoizedProps,oe=_o(c,E),y.props=oe,ue=o.pendingProps,re=y.context,te=c.contextType,W=ul,typeof te=="object"&&te!==null&&(W=yn(te)),N=c.getDerivedStateFromProps,(te=typeof N=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(E!==ue||re!==W)&&bx(o,y,f,W),ms=!1,re=o.memoizedState,y.state=re,Ha(o,f,y,g),Ia();var ie=o.memoizedState;E!==ue||re!==ie||ms||i!==null&&i.dependencies!==null&&Yu(i.dependencies)?(typeof N=="function"&&(lm(o,c,N,f),ie=o.memoizedState),(oe=ms||yx(o,c,oe,f,re,ie,W)||i!==null&&i.dependencies!==null&&Yu(i.dependencies))?(te||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(f,ie,W),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(f,ie,W)),typeof y.componentDidUpdate=="function"&&(o.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof y.componentDidUpdate!="function"||E===i.memoizedProps&&re===i.memoizedState||(o.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||E===i.memoizedProps&&re===i.memoizedState||(o.flags|=1024),o.memoizedProps=f,o.memoizedState=ie),y.props=f,y.state=ie,y.context=W,f=oe):(typeof y.componentDidUpdate!="function"||E===i.memoizedProps&&re===i.memoizedState||(o.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||E===i.memoizedProps&&re===i.memoizedState||(o.flags|=1024),f=!1)}return y=f,ph(i,o),f=(o.flags&128)!==0,y||f?(y=o.stateNode,c=f&&typeof c.getDerivedStateFromError!="function"?null:y.render(),o.flags|=1,i!==null&&f?(o.child=go(o,i.child,null,g),o.child=go(o,null,c,g)):bn(i,o,c,g),o.memoizedState=y.state,i=o.child):i=Pi(i,o,g),i}function zx(i,o,c,f){return co(),o.flags|=256,bn(i,o,c,f),o.child}var dm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function fm(i){return{baseLanes:i,cachePool:C0()}}function pm(i,o,c){return i=i!==null?i.childLanes&~c:0,o&&(i|=cr),i}function Bx(i,o,c){var f=o.pendingProps,g=!1,y=(o.flags&128)!==0,E;if((E=y)||(E=i!==null&&i.memoizedState===null?!1:(Ot.current&2)!==0),E&&(g=!0,o.flags&=-129),E=(o.flags&32)!==0,o.flags&=-33,i===null){if(Ye){if(g?_s(o):ys(),(i=mt)?(i=W1(i,Rr),i=i!==null&&i.data!=="&"?i:null,i!==null&&(o.memoizedState={dehydrated:i,treeContext:hs!==null?{id:ii,overflow:si}:null,retryLane:536870912,hydrationErrors:null},c=m0(i),c.return=o,o.child=c,_n=o,mt=null)):i=null,i===null)throw fs(o);return Xm(i)?o.lanes=32:o.lanes=536870912,null}var N=f.children;return f=f.fallback,g?(ys(),g=o.mode,N=mh({mode:"hidden",children:N},g),f=ao(f,g,c,null),N.return=o,f.return=o,N.sibling=f,o.child=N,f=o.child,f.memoizedState=fm(c),f.childLanes=pm(i,E,c),o.memoizedState=dm,qa(null,f)):(_s(o),mm(o,N))}var W=i.memoizedState;if(W!==null&&(N=W.dehydrated,N!==null)){if(y)o.flags&256?(_s(o),o.flags&=-257,o=gm(i,o,c)):o.memoizedState!==null?(ys(),o.child=i.child,o.flags|=128,o=null):(ys(),N=f.fallback,g=o.mode,f=mh({mode:"visible",children:f.children},g),N=ao(N,g,c,null),N.flags|=2,f.return=o,N.return=o,f.sibling=N,o.child=f,go(o,i.child,null,c),f=o.child,f.memoizedState=fm(c),f.childLanes=pm(i,E,c),o.memoizedState=dm,o=qa(null,f));else if(_s(o),Xm(N)){if(E=N.nextSibling&&N.nextSibling.dataset,E)var te=E.dgst;E=te,f=Error(r(419)),f.stack="",f.digest=E,Oa({value:f,source:null,stack:null}),o=gm(i,o,c)}else if(It||pl(i,o,c,!1),E=(c&i.childLanes)!==0,It||E){if(E=ht,E!==null&&(f=yr(E,c),f!==0&&f!==W.retryLane))throw W.retryLane=f,lo(i,f),Xn(E,i,f),um;Ym(N)||Ch(),o=gm(i,o,c)}else Ym(N)?(o.flags|=192,o.child=i.child,o=null):(i=W.treeContext,mt=Tr(N.nextSibling),_n=o,Ye=!0,ds=null,Rr=!1,i!==null&&_0(o,i),o=mm(o,f.children),o.flags|=4096);return o}return g?(ys(),N=f.fallback,g=o.mode,W=i.child,te=W.sibling,f=Ni(W,{mode:"hidden",children:f.children}),f.subtreeFlags=W.subtreeFlags&65011712,te!==null?N=Ni(te,N):(N=ao(N,g,c,null),N.flags|=2),N.return=o,f.return=o,f.sibling=N,o.child=f,qa(null,f),f=o.child,N=i.child.memoizedState,N===null?N=fm(c):(g=N.cachePool,g!==null?(W=jt._currentValue,g=g.parent!==W?{parent:W,pool:W}:g):g=C0(),N={baseLanes:N.baseLanes|c,cachePool:g}),f.memoizedState=N,f.childLanes=pm(i,E,c),o.memoizedState=dm,qa(i.child,f)):(_s(o),c=i.child,i=c.sibling,c=Ni(c,{mode:"visible",children:f.children}),c.return=o,c.sibling=null,i!==null&&(E=o.deletions,E===null?(o.deletions=[i],o.flags|=16):E.push(i)),o.child=c,o.memoizedState=null,c)}function mm(i,o){return o=mh({mode:"visible",children:o},i.mode),o.return=i,i.child=o}function mh(i,o){return i=sr(22,i,null,o),i.lanes=0,i}function gm(i,o,c){return go(o,i.child,null,c),i=mm(o,o.pendingProps.children),i.flags|=2,o.memoizedState=null,i}function jx(i,o,c){i.lanes|=o;var f=i.alternate;f!==null&&(f.lanes|=o),Dp(i.return,o,c)}function vm(i,o,c,f,g,y){var E=i.memoizedState;E===null?i.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:f,tail:c,tailMode:g,treeForkCount:y}:(E.isBackwards=o,E.rendering=null,E.renderingStartTime=0,E.last=f,E.tail=c,E.tailMode=g,E.treeForkCount=y)}function Px(i,o,c){var f=o.pendingProps,g=f.revealOrder,y=f.tail;f=f.children;var E=Ot.current,N=(E&2)!==0;if(N?(E=E&1|2,o.flags|=128):E&=1,M(Ot,E),bn(i,o,f,c),f=Ye?Na:0,!N&&i!==null&&(i.flags&128)!==0)e:for(i=o.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&jx(i,c,o);else if(i.tag===19)jx(i,c,o);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===o)break e;for(;i.sibling===null;){if(i.return===null||i.return===o)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(g){case"forwards":for(c=o.child,g=null;c!==null;)i=c.alternate,i!==null&&rh(i)===null&&(g=c),c=c.sibling;c=g,c===null?(g=o.child,o.child=null):(g=c.sibling,c.sibling=null),vm(o,!1,g,c,y,f);break;case"backwards":case"unstable_legacy-backwards":for(c=null,g=o.child,o.child=null;g!==null;){if(i=g.alternate,i!==null&&rh(i)===null){o.child=g;break}i=g.sibling,g.sibling=c,c=g,g=i}vm(o,!0,c,null,y,f);break;case"together":vm(o,!1,null,null,void 0,f);break;default:o.memoizedState=null}return o.child}function Pi(i,o,c){if(i!==null&&(o.dependencies=i.dependencies),Ss|=o.lanes,(c&o.childLanes)===0)if(i!==null){if(pl(i,o,c,!1),(c&o.childLanes)===0)return null}else return null;if(i!==null&&o.child!==i.child)throw Error(r(153));if(o.child!==null){for(i=o.child,c=Ni(i,i.pendingProps),o.child=c,c.return=o;i.sibling!==null;)i=i.sibling,c=c.sibling=Ni(i,i.pendingProps),c.return=o;c.sibling=null}return o.child}function _m(i,o){return(i.lanes&o)!==0?!0:(i=i.dependencies,!!(i!==null&&Yu(i)))}function TD(i,o,c){switch(o.tag){case 3:ke(o,o.stateNode.containerInfo),ps(o,jt,i.memoizedState.cache),co();break;case 27:case 5:Ee(o);break;case 4:ke(o,o.stateNode.containerInfo);break;case 10:ps(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,$p(o),null;break;case 13:var f=o.memoizedState;if(f!==null)return f.dehydrated!==null?(_s(o),o.flags|=128,null):(c&o.child.childLanes)!==0?Bx(i,o,c):(_s(o),i=Pi(i,o,c),i!==null?i.sibling:null);_s(o);break;case 19:var g=(i.flags&128)!==0;if(f=(c&o.childLanes)!==0,f||(pl(i,o,c,!1),f=(c&o.childLanes)!==0),g){if(f)return Px(i,o,c);o.flags|=128}if(g=o.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),M(Ot,Ot.current),f)break;return null;case 22:return o.lanes=0,Ax(i,o,c,o.pendingProps);case 24:ps(o,jt,i.memoizedState.cache)}return Pi(i,o,c)}function Ix(i,o,c){if(i!==null)if(i.memoizedProps!==o.pendingProps)It=!0;else{if(!_m(i,c)&&(o.flags&128)===0)return It=!1,TD(i,o,c);It=(i.flags&131072)!==0}else It=!1,Ye&&(o.flags&1048576)!==0&&v0(o,Na,o.index);switch(o.lanes=0,o.tag){case 16:e:{var f=o.pendingProps;if(i=po(o.elementType),o.type=i,typeof i=="function")wp(i)?(f=_o(i,f),o.tag=1,o=Lx(null,o,i,f,c)):(o.tag=0,o=hm(null,o,i,f,c));else{if(i!=null){var g=i.$$typeof;if(g===D){o.tag=11,o=Rx(null,o,i,f,c);break e}else if(g===O){o.tag=14,o=Mx(null,o,i,f,c);break e}}throw o=V(i)||i,Error(r(306,o,""))}}return o;case 0:return hm(i,o,o.type,o.pendingProps,c);case 1:return f=o.type,g=_o(f,o.pendingProps),Lx(i,o,f,g,c);case 3:e:{if(ke(o,o.stateNode.containerInfo),i===null)throw Error(r(387));f=o.pendingProps;var y=o.memoizedState;g=y.element,Pp(i,o),Ha(o,f,null,c);var E=o.memoizedState;if(f=E.cache,ps(o,jt,f),f!==y.cache&&Np(o,[jt],c,!0),Ia(),f=E.element,y.isDehydrated)if(y={element:f,isDehydrated:!1,cache:E.cache},o.updateQueue.baseState=y,o.memoizedState=y,o.flags&256){o=zx(i,o,f,c);break e}else if(f!==g){g=Cr(Error(r(424)),o),Oa(g),o=zx(i,o,f,c);break e}else{switch(i=o.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(mt=Tr(i.firstChild),_n=o,Ye=!0,ds=null,Rr=!0,c=A0(o,null,f,c),o.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling}else{if(co(),f===g){o=Pi(i,o,c);break e}bn(i,o,f,c)}o=o.child}return o;case 26:return ph(i,o),i===null?(c=X1(o.type,null,o.pendingProps,null))?o.memoizedState=c:Ye||(c=o.type,i=o.pendingProps,f=Dh(se.current).createElement(c),f[vn]=o,f[Wn]=i,xn(f,c,i),en(f),o.stateNode=f):o.memoizedState=X1(o.type,i.memoizedProps,o.pendingProps,i.memoizedState),null;case 27:return Ee(o),i===null&&Ye&&(f=o.stateNode=K1(o.type,o.pendingProps,se.current),_n=o,Rr=!0,g=mt,Rs(o.type)?(Zm=g,mt=Tr(f.firstChild)):mt=g),bn(i,o,o.pendingProps.children,c),ph(i,o),i===null&&(o.flags|=4194304),o.child;case 5:return i===null&&Ye&&((g=f=mt)&&(f=sN(f,o.type,o.pendingProps,Rr),f!==null?(o.stateNode=f,_n=o,mt=Tr(f.firstChild),Rr=!1,g=!0):g=!1),g||fs(o)),Ee(o),g=o.type,y=o.pendingProps,E=i!==null?i.memoizedProps:null,f=y.children,Vm(g,y)?f=null:E!==null&&Vm(g,E)&&(o.flags|=32),o.memoizedState!==null&&(g=qp(i,o,bD,null,null,c),oc._currentValue=g),ph(i,o),bn(i,o,f,c),o.child;case 6:return i===null&&Ye&&((i=c=mt)&&(c=oN(c,o.pendingProps,Rr),c!==null?(o.stateNode=c,_n=o,mt=null,i=!0):i=!1),i||fs(o)),null;case 13:return Bx(i,o,c);case 4:return ke(o,o.stateNode.containerInfo),f=o.pendingProps,i===null?o.child=go(o,null,f,c):bn(i,o,f,c),o.child;case 11:return Rx(i,o,o.type,o.pendingProps,c);case 7:return bn(i,o,o.pendingProps,c),o.child;case 8:return bn(i,o,o.pendingProps.children,c),o.child;case 12:return bn(i,o,o.pendingProps.children,c),o.child;case 10:return f=o.pendingProps,ps(o,o.type,f.value),bn(i,o,f.children,c),o.child;case 9:return g=o.type._context,f=o.pendingProps.children,ho(o),g=yn(g),f=f(g),o.flags|=1,bn(i,o,f,c),o.child;case 14:return Mx(i,o,o.type,o.pendingProps,c);case 15:return Tx(i,o,o.type,o.pendingProps,c);case 19:return Px(i,o,c);case 31:return MD(i,o,c);case 22:return Ax(i,o,c,o.pendingProps);case 24:return ho(o),f=yn(jt),i===null?(g=zp(),g===null&&(g=ht,y=Op(),g.pooledCache=y,y.refCount++,y!==null&&(g.pooledCacheLanes|=c),g=y),o.memoizedState={parent:f,cache:g},jp(o),ps(o,jt,g)):((i.lanes&c)!==0&&(Pp(i,o),Ha(o,null,null,c),Ia()),g=i.memoizedState,y=o.memoizedState,g.parent!==f?(g={parent:f,cache:f},o.memoizedState=g,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=g),ps(o,jt,f)):(f=y.cache,ps(o,jt,f),f!==g.cache&&Np(o,[jt],c,!0))),bn(i,o,o.pendingProps.children,c),o.child;case 29:throw o.pendingProps}throw Error(r(156,o.tag))}function Ii(i){i.flags|=4}function ym(i,o,c,f,g){if((o=(i.mode&32)!==0)&&(o=!1),o){if(i.flags|=16777216,(g&335544128)===g)if(i.stateNode.complete)i.flags|=8192;else if(d1())i.flags|=8192;else throw mo=Ju,Bp}else i.flags&=-16777217}function Hx(i,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!tS(o))if(d1())i.flags|=8192;else throw mo=Ju,Bp}function gh(i,o){o!==null&&(i.flags|=4),i.flags&16384&&(o=i.tag!==22?kn():536870912,i.lanes|=o,El|=o)}function Va(i,o){if(!Ye)switch(i.tailMode){case"hidden":o=i.tail;for(var c=null;o!==null;)o.alternate!==null&&(c=o),o=o.sibling;c===null?i.tail=null:c.sibling=null;break;case"collapsed":c=i.tail;for(var f=null;c!==null;)c.alternate!==null&&(f=c),c=c.sibling;f===null?o||i.tail===null?i.tail=null:i.tail.sibling=null:f.sibling=null}}function gt(i){var o=i.alternate!==null&&i.alternate.child===i.child,c=0,f=0;if(o)for(var g=i.child;g!==null;)c|=g.lanes|g.childLanes,f|=g.subtreeFlags&65011712,f|=g.flags&65011712,g.return=i,g=g.sibling;else for(g=i.child;g!==null;)c|=g.lanes|g.childLanes,f|=g.subtreeFlags,f|=g.flags,g.return=i,g=g.sibling;return i.subtreeFlags|=f,i.childLanes=c,o}function AD(i,o,c){var f=o.pendingProps;switch(Rp(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return gt(o),null;case 1:return gt(o),null;case 3:return c=o.stateNode,f=null,i!==null&&(f=i.memoizedState.cache),o.memoizedState.cache!==f&&(o.flags|=2048),zi(jt),me(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(i===null||i.child===null)&&(fl(o)?Ii(o):i===null||i.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,Tp())),gt(o),null;case 26:var g=o.type,y=o.memoizedState;return i===null?(Ii(o),y!==null?(gt(o),Hx(o,y)):(gt(o),ym(o,g,null,f,c))):y?y!==i.memoizedState?(Ii(o),gt(o),Hx(o,y)):(gt(o),o.flags&=-16777217):(i=i.memoizedProps,i!==f&&Ii(o),gt(o),ym(o,g,i,f,c)),null;case 27:if(et(o),c=se.current,g=o.type,i!==null&&o.stateNode!=null)i.memoizedProps!==f&&Ii(o);else{if(!f){if(o.stateNode===null)throw Error(r(166));return gt(o),null}i=Z.current,fl(o)?y0(o):(i=K1(g,f,c),o.stateNode=i,Ii(o))}return gt(o),null;case 5:if(et(o),g=o.type,i!==null&&o.stateNode!=null)i.memoizedProps!==f&&Ii(o);else{if(!f){if(o.stateNode===null)throw Error(r(166));return gt(o),null}if(y=Z.current,fl(o))y0(o);else{var E=Dh(se.current);switch(y){case 1:y=E.createElementNS("http://www.w3.org/2000/svg",g);break;case 2:y=E.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;default:switch(g){case"svg":y=E.createElementNS("http://www.w3.org/2000/svg",g);break;case"math":y=E.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;case"script":y=E.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof f.is=="string"?E.createElement("select",{is:f.is}):E.createElement("select"),f.multiple?y.multiple=!0:f.size&&(y.size=f.size);break;default:y=typeof f.is=="string"?E.createElement(g,{is:f.is}):E.createElement(g)}}y[vn]=o,y[Wn]=f;e:for(E=o.child;E!==null;){if(E.tag===5||E.tag===6)y.appendChild(E.stateNode);else if(E.tag!==4&&E.tag!==27&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===o)break e;for(;E.sibling===null;){if(E.return===null||E.return===o)break e;E=E.return}E.sibling.return=E.return,E=E.sibling}o.stateNode=y;e:switch(xn(y,g,f),g){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}f&&Ii(o)}}return gt(o),ym(o,o.type,i===null?null:i.memoizedProps,o.pendingProps,c),null;case 6:if(i&&o.stateNode!=null)i.memoizedProps!==f&&Ii(o);else{if(typeof f!="string"&&o.stateNode===null)throw Error(r(166));if(i=se.current,fl(o)){if(i=o.stateNode,c=o.memoizedProps,f=null,g=_n,g!==null)switch(g.tag){case 27:case 5:f=g.memoizedProps}i[vn]=o,i=!!(i.nodeValue===c||f!==null&&f.suppressHydrationWarning===!0||B1(i.nodeValue,c)),i||fs(o,!0)}else i=Dh(i).createTextNode(f),i[vn]=o,o.stateNode=i}return gt(o),null;case 31:if(c=o.memoizedState,i===null||i.memoizedState!==null){if(f=fl(o),c!==null){if(i===null){if(!f)throw Error(r(318));if(i=o.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[vn]=o}else co(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;gt(o),i=!1}else c=Tp(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=c),i=!0;if(!i)return o.flags&256?(lr(o),o):(lr(o),null);if((o.flags&128)!==0)throw Error(r(558))}return gt(o),null;case 13:if(f=o.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(g=fl(o),f!==null&&f.dehydrated!==null){if(i===null){if(!g)throw Error(r(318));if(g=o.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(r(317));g[vn]=o}else co(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;gt(o),g=!1}else g=Tp(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=g),g=!0;if(!g)return o.flags&256?(lr(o),o):(lr(o),null)}return lr(o),(o.flags&128)!==0?(o.lanes=c,o):(c=f!==null,i=i!==null&&i.memoizedState!==null,c&&(f=o.child,g=null,f.alternate!==null&&f.alternate.memoizedState!==null&&f.alternate.memoizedState.cachePool!==null&&(g=f.alternate.memoizedState.cachePool.pool),y=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(y=f.memoizedState.cachePool.pool),y!==g&&(f.flags|=2048)),c!==i&&c&&(o.child.flags|=8192),gh(o,o.updateQueue),gt(o),null);case 4:return me(),i===null&&Fm(o.stateNode.containerInfo),gt(o),null;case 10:return zi(o.type),gt(o),null;case 19:if(Y(Ot),f=o.memoizedState,f===null)return gt(o),null;if(g=(o.flags&128)!==0,y=f.rendering,y===null)if(g)Va(f,!1);else{if(kt!==0||i!==null&&(i.flags&128)!==0)for(i=o.child;i!==null;){if(y=rh(i),y!==null){for(o.flags|=128,Va(f,!1),i=y.updateQueue,o.updateQueue=i,gh(o,i),o.subtreeFlags=0,i=c,c=o.child;c!==null;)p0(c,i),c=c.sibling;return M(Ot,Ot.current&1|2),Ye&&Oi(o,f.treeForkCount),o.child}i=i.sibling}f.tail!==null&&Tt()>xh&&(o.flags|=128,g=!0,Va(f,!1),o.lanes=4194304)}else{if(!g)if(i=rh(y),i!==null){if(o.flags|=128,g=!0,i=i.updateQueue,o.updateQueue=i,gh(o,i),Va(f,!0),f.tail===null&&f.tailMode==="hidden"&&!y.alternate&&!Ye)return gt(o),null}else 2*Tt()-f.renderingStartTime>xh&&c!==536870912&&(o.flags|=128,g=!0,Va(f,!1),o.lanes=4194304);f.isBackwards?(y.sibling=o.child,o.child=y):(i=f.last,i!==null?i.sibling=y:o.child=y,f.last=y)}return f.tail!==null?(i=f.tail,f.rendering=i,f.tail=i.sibling,f.renderingStartTime=Tt(),i.sibling=null,c=Ot.current,M(Ot,g?c&1|2:c&1),Ye&&Oi(o,f.treeForkCount),i):(gt(o),null);case 22:case 23:return lr(o),Up(),f=o.memoizedState!==null,i!==null?i.memoizedState!==null!==f&&(o.flags|=8192):f&&(o.flags|=8192),f?(c&536870912)!==0&&(o.flags&128)===0&&(gt(o),o.subtreeFlags&6&&(o.flags|=8192)):gt(o),c=o.updateQueue,c!==null&&gh(o,c.retryQueue),c=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),f=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(f=o.memoizedState.cachePool.pool),f!==c&&(o.flags|=2048),i!==null&&Y(fo),null;case 24:return c=null,i!==null&&(c=i.memoizedState.cache),o.memoizedState.cache!==c&&(o.flags|=2048),zi(jt),gt(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function DD(i,o){switch(Rp(o),o.tag){case 1:return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 3:return zi(jt),me(),i=o.flags,(i&65536)!==0&&(i&128)===0?(o.flags=i&-65537|128,o):null;case 26:case 27:case 5:return et(o),null;case 31:if(o.memoizedState!==null){if(lr(o),o.alternate===null)throw Error(r(340));co()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 13:if(lr(o),i=o.memoizedState,i!==null&&i.dehydrated!==null){if(o.alternate===null)throw Error(r(340));co()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 19:return Y(Ot),null;case 4:return me(),null;case 10:return zi(o.type),null;case 22:case 23:return lr(o),Up(),i!==null&&Y(fo),i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 24:return zi(jt),null;case 25:return null;default:return null}}function Fx(i,o){switch(Rp(o),o.tag){case 3:zi(jt),me();break;case 26:case 27:case 5:et(o);break;case 4:me();break;case 31:o.memoizedState!==null&&lr(o);break;case 13:lr(o);break;case 19:Y(Ot);break;case 10:zi(o.type);break;case 22:case 23:lr(o),Up(),i!==null&&Y(fo);break;case 24:zi(jt)}}function Ka(i,o){try{var c=o.updateQueue,f=c!==null?c.lastEffect:null;if(f!==null){var g=f.next;c=g;do{if((c.tag&i)===i){f=void 0;var y=c.create,E=c.inst;f=y(),E.destroy=f}c=c.next}while(c!==g)}}catch(N){st(o,o.return,N)}}function bs(i,o,c){try{var f=o.updateQueue,g=f!==null?f.lastEffect:null;if(g!==null){var y=g.next;f=y;do{if((f.tag&i)===i){var E=f.inst,N=E.destroy;if(N!==void 0){E.destroy=void 0,g=o;var W=c,te=N;try{te()}catch(oe){st(g,W,oe)}}}f=f.next}while(f!==y)}}catch(oe){st(o,o.return,oe)}}function Ux(i){var o=i.updateQueue;if(o!==null){var c=i.stateNode;try{N0(o,c)}catch(f){st(i,i.return,f)}}}function $x(i,o,c){c.props=_o(i.type,i.memoizedProps),c.state=i.memoizedState;try{c.componentWillUnmount()}catch(f){st(i,o,f)}}function Ga(i,o){try{var c=i.ref;if(c!==null){switch(i.tag){case 26:case 27:case 5:var f=i.stateNode;break;case 30:f=i.stateNode;break;default:f=i.stateNode}typeof c=="function"?i.refCleanup=c(f):c.current=f}}catch(g){st(i,o,g)}}function oi(i,o){var c=i.ref,f=i.refCleanup;if(c!==null)if(typeof f=="function")try{f()}catch(g){st(i,o,g)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(g){st(i,o,g)}else c.current=null}function Wx(i){var o=i.type,c=i.memoizedProps,f=i.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":c.autoFocus&&f.focus();break e;case"img":c.src?f.src=c.src:c.srcSet&&(f.srcset=c.srcSet)}}catch(g){st(i,i.return,g)}}function bm(i,o,c){try{var f=i.stateNode;JD(f,i.type,c,o),f[Wn]=o}catch(g){st(i,i.return,g)}}function qx(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Rs(i.type)||i.tag===4}function xm(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||qx(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&Rs(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Sm(i,o,c){var f=i.tag;if(f===5||f===6)i=i.stateNode,o?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(i,o):(o=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,o.appendChild(i),c=c._reactRootContainer,c!=null||o.onclick!==null||(o.onclick=Ai));else if(f!==4&&(f===27&&Rs(i.type)&&(c=i.stateNode,o=null),i=i.child,i!==null))for(Sm(i,o,c),i=i.sibling;i!==null;)Sm(i,o,c),i=i.sibling}function vh(i,o,c){var f=i.tag;if(f===5||f===6)i=i.stateNode,o?c.insertBefore(i,o):c.appendChild(i);else if(f!==4&&(f===27&&Rs(i.type)&&(c=i.stateNode),i=i.child,i!==null))for(vh(i,o,c),i=i.sibling;i!==null;)vh(i,o,c),i=i.sibling}function Vx(i){var o=i.stateNode,c=i.memoizedProps;try{for(var f=i.type,g=o.attributes;g.length;)o.removeAttributeNode(g[0]);xn(o,f,c),o[vn]=i,o[Wn]=c}catch(y){st(i,i.return,y)}}var Hi=!1,Ht=!1,wm=!1,Kx=typeof WeakSet=="function"?WeakSet:Set,tn=null;function ND(i,o){if(i=i.containerInfo,Wm=Ph,i=s0(i),gp(i)){if("selectionStart"in i)var c={start:i.selectionStart,end:i.selectionEnd};else e:{c=(c=i.ownerDocument)&&c.defaultView||window;var f=c.getSelection&&c.getSelection();if(f&&f.rangeCount!==0){c=f.anchorNode;var g=f.anchorOffset,y=f.focusNode;f=f.focusOffset;try{c.nodeType,y.nodeType}catch{c=null;break e}var E=0,N=-1,W=-1,te=0,oe=0,ue=i,re=null;t:for(;;){for(var ie;ue!==c||g!==0&&ue.nodeType!==3||(N=E+g),ue!==y||f!==0&&ue.nodeType!==3||(W=E+f),ue.nodeType===3&&(E+=ue.nodeValue.length),(ie=ue.firstChild)!==null;)re=ue,ue=ie;for(;;){if(ue===i)break t;if(re===c&&++te===g&&(N=E),re===y&&++oe===f&&(W=E),(ie=ue.nextSibling)!==null)break;ue=re,re=ue.parentNode}ue=ie}c=N===-1||W===-1?null:{start:N,end:W}}else c=null}c=c||{start:0,end:0}}else c=null;for(qm={focusedElem:i,selectionRange:c},Ph=!1,tn=o;tn!==null;)if(o=tn,i=o.child,(o.subtreeFlags&1028)!==0&&i!==null)i.return=o,tn=i;else for(;tn!==null;){switch(o=tn,y=o.alternate,i=o.flags,o.tag){case 0:if((i&4)!==0&&(i=o.updateQueue,i=i!==null?i.events:null,i!==null))for(c=0;c<i.length;c++)g=i[c],g.ref.impl=g.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&y!==null){i=void 0,c=o,g=y.memoizedProps,y=y.memoizedState,f=c.stateNode;try{var be=_o(c.type,g);i=f.getSnapshotBeforeUpdate(be,y),f.__reactInternalSnapshotBeforeUpdate=i}catch(De){st(c,c.return,De)}}break;case 3:if((i&1024)!==0){if(i=o.stateNode.containerInfo,c=i.nodeType,c===9)Gm(i);else if(c===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Gm(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=o.sibling,i!==null){i.return=o.return,tn=i;break}tn=o.return}}function Gx(i,o,c){var f=c.flags;switch(c.tag){case 0:case 11:case 15:Ui(i,c),f&4&&Ka(5,c);break;case 1:if(Ui(i,c),f&4)if(i=c.stateNode,o===null)try{i.componentDidMount()}catch(E){st(c,c.return,E)}else{var g=_o(c.type,o.memoizedProps);o=o.memoizedState;try{i.componentDidUpdate(g,o,i.__reactInternalSnapshotBeforeUpdate)}catch(E){st(c,c.return,E)}}f&64&&Ux(c),f&512&&Ga(c,c.return);break;case 3:if(Ui(i,c),f&64&&(i=c.updateQueue,i!==null)){if(o=null,c.child!==null)switch(c.child.tag){case 27:case 5:o=c.child.stateNode;break;case 1:o=c.child.stateNode}try{N0(i,o)}catch(E){st(c,c.return,E)}}break;case 27:o===null&&f&4&&Vx(c);case 26:case 5:Ui(i,c),o===null&&f&4&&Wx(c),f&512&&Ga(c,c.return);break;case 12:Ui(i,c);break;case 31:Ui(i,c),f&4&&Zx(i,c);break;case 13:Ui(i,c),f&4&&Qx(i,c),f&64&&(i=c.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(c=FD.bind(null,c),lN(i,c))));break;case 22:if(f=c.memoizedState!==null||Hi,!f){o=o!==null&&o.memoizedState!==null||Ht,g=Hi;var y=Ht;Hi=f,(Ht=o)&&!y?$i(i,c,(c.subtreeFlags&8772)!==0):Ui(i,c),Hi=g,Ht=y}break;case 30:break;default:Ui(i,c)}}function Yx(i){var o=i.alternate;o!==null&&(i.alternate=null,Yx(o)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(o=i.stateNode,o!==null&&Jf(o)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var _t=null,Vn=!1;function Fi(i,o,c){for(c=c.child;c!==null;)Xx(i,o,c),c=c.sibling}function Xx(i,o,c){if(At&&typeof At.onCommitFiberUnmount=="function")try{At.onCommitFiberUnmount(gn,c)}catch{}switch(c.tag){case 26:Ht||oi(c,o),Fi(i,o,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:Ht||oi(c,o);var f=_t,g=Vn;Rs(c.type)&&(_t=c.stateNode,Vn=!1),Fi(i,o,c),rc(c.stateNode),_t=f,Vn=g;break;case 5:Ht||oi(c,o);case 6:if(f=_t,g=Vn,_t=null,Fi(i,o,c),_t=f,Vn=g,_t!==null)if(Vn)try{(_t.nodeType===9?_t.body:_t.nodeName==="HTML"?_t.ownerDocument.body:_t).removeChild(c.stateNode)}catch(y){st(c,o,y)}else try{_t.removeChild(c.stateNode)}catch(y){st(c,o,y)}break;case 18:_t!==null&&(Vn?(i=_t,U1(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,c.stateNode),Ll(i)):U1(_t,c.stateNode));break;case 4:f=_t,g=Vn,_t=c.stateNode.containerInfo,Vn=!0,Fi(i,o,c),_t=f,Vn=g;break;case 0:case 11:case 14:case 15:bs(2,c,o),Ht||bs(4,c,o),Fi(i,o,c);break;case 1:Ht||(oi(c,o),f=c.stateNode,typeof f.componentWillUnmount=="function"&&$x(c,o,f)),Fi(i,o,c);break;case 21:Fi(i,o,c);break;case 22:Ht=(f=Ht)||c.memoizedState!==null,Fi(i,o,c),Ht=f;break;default:Fi(i,o,c)}}function Zx(i,o){if(o.memoizedState===null&&(i=o.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{Ll(i)}catch(c){st(o,o.return,c)}}}function Qx(i,o){if(o.memoizedState===null&&(i=o.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Ll(i)}catch(c){st(o,o.return,c)}}function OD(i){switch(i.tag){case 31:case 13:case 19:var o=i.stateNode;return o===null&&(o=i.stateNode=new Kx),o;case 22:return i=i.stateNode,o=i._retryCache,o===null&&(o=i._retryCache=new Kx),o;default:throw Error(r(435,i.tag))}}function _h(i,o){var c=OD(i);o.forEach(function(f){if(!c.has(f)){c.add(f);var g=UD.bind(null,i,f);f.then(g,g)}})}function Kn(i,o){var c=o.deletions;if(c!==null)for(var f=0;f<c.length;f++){var g=c[f],y=i,E=o,N=E;e:for(;N!==null;){switch(N.tag){case 27:if(Rs(N.type)){_t=N.stateNode,Vn=!1;break e}break;case 5:_t=N.stateNode,Vn=!1;break e;case 3:case 4:_t=N.stateNode.containerInfo,Vn=!0;break e}N=N.return}if(_t===null)throw Error(r(160));Xx(y,E,g),_t=null,Vn=!1,y=g.alternate,y!==null&&(y.return=null),g.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)Jx(o,i),o=o.sibling}var qr=null;function Jx(i,o){var c=i.alternate,f=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:Kn(o,i),Gn(i),f&4&&(bs(3,i,i.return),Ka(3,i),bs(5,i,i.return));break;case 1:Kn(o,i),Gn(i),f&512&&(Ht||c===null||oi(c,c.return)),f&64&&Hi&&(i=i.updateQueue,i!==null&&(f=i.callbacks,f!==null&&(c=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=c===null?f:c.concat(f))));break;case 26:var g=qr;if(Kn(o,i),Gn(i),f&512&&(Ht||c===null||oi(c,c.return)),f&4){var y=c!==null?c.memoizedState:null;if(f=i.memoizedState,c===null)if(f===null)if(i.stateNode===null){e:{f=i.type,c=i.memoizedProps,g=g.ownerDocument||g;t:switch(f){case"title":y=g.getElementsByTagName("title")[0],(!y||y[xa]||y[vn]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=g.createElement(f),g.head.insertBefore(y,g.querySelector("head > title"))),xn(y,f,c),y[vn]=i,en(y),f=y;break e;case"link":var E=J1("link","href",g).get(f+(c.href||""));if(E){for(var N=0;N<E.length;N++)if(y=E[N],y.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&y.getAttribute("rel")===(c.rel==null?null:c.rel)&&y.getAttribute("title")===(c.title==null?null:c.title)&&y.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){E.splice(N,1);break t}}y=g.createElement(f),xn(y,f,c),g.head.appendChild(y);break;case"meta":if(E=J1("meta","content",g).get(f+(c.content||""))){for(N=0;N<E.length;N++)if(y=E[N],y.getAttribute("content")===(c.content==null?null:""+c.content)&&y.getAttribute("name")===(c.name==null?null:c.name)&&y.getAttribute("property")===(c.property==null?null:c.property)&&y.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&y.getAttribute("charset")===(c.charSet==null?null:c.charSet)){E.splice(N,1);break t}}y=g.createElement(f),xn(y,f,c),g.head.appendChild(y);break;default:throw Error(r(468,f))}y[vn]=i,en(y),f=y}i.stateNode=f}else eS(g,i.type,i.stateNode);else i.stateNode=Q1(g,f,i.memoizedProps);else y!==f?(y===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):y.count--,f===null?eS(g,i.type,i.stateNode):Q1(g,f,i.memoizedProps)):f===null&&i.stateNode!==null&&bm(i,i.memoizedProps,c.memoizedProps)}break;case 27:Kn(o,i),Gn(i),f&512&&(Ht||c===null||oi(c,c.return)),c!==null&&f&4&&bm(i,i.memoizedProps,c.memoizedProps);break;case 5:if(Kn(o,i),Gn(i),f&512&&(Ht||c===null||oi(c,c.return)),i.flags&32){g=i.stateNode;try{rl(g,"")}catch(be){st(i,i.return,be)}}f&4&&i.stateNode!=null&&(g=i.memoizedProps,bm(i,g,c!==null?c.memoizedProps:g)),f&1024&&(wm=!0);break;case 6:if(Kn(o,i),Gn(i),f&4){if(i.stateNode===null)throw Error(r(162));f=i.memoizedProps,c=i.stateNode;try{c.nodeValue=f}catch(be){st(i,i.return,be)}}break;case 3:if(Lh=null,g=qr,qr=Nh(o.containerInfo),Kn(o,i),qr=g,Gn(i),f&4&&c!==null&&c.memoizedState.isDehydrated)try{Ll(o.containerInfo)}catch(be){st(i,i.return,be)}wm&&(wm=!1,e1(i));break;case 4:f=qr,qr=Nh(i.stateNode.containerInfo),Kn(o,i),Gn(i),qr=f;break;case 12:Kn(o,i),Gn(i);break;case 31:Kn(o,i),Gn(i),f&4&&(f=i.updateQueue,f!==null&&(i.updateQueue=null,_h(i,f)));break;case 13:Kn(o,i),Gn(i),i.child.flags&8192&&i.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(bh=Tt()),f&4&&(f=i.updateQueue,f!==null&&(i.updateQueue=null,_h(i,f)));break;case 22:g=i.memoizedState!==null;var W=c!==null&&c.memoizedState!==null,te=Hi,oe=Ht;if(Hi=te||g,Ht=oe||W,Kn(o,i),Ht=oe,Hi=te,Gn(i),f&8192)e:for(o=i.stateNode,o._visibility=g?o._visibility&-2:o._visibility|1,g&&(c===null||W||Hi||Ht||yo(i)),c=null,o=i;;){if(o.tag===5||o.tag===26){if(c===null){W=c=o;try{if(y=W.stateNode,g)E=y.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{N=W.stateNode;var ue=W.memoizedProps.style,re=ue!=null&&ue.hasOwnProperty("display")?ue.display:null;N.style.display=re==null||typeof re=="boolean"?"":(""+re).trim()}}catch(be){st(W,W.return,be)}}}else if(o.tag===6){if(c===null){W=o;try{W.stateNode.nodeValue=g?"":W.memoizedProps}catch(be){st(W,W.return,be)}}}else if(o.tag===18){if(c===null){W=o;try{var ie=W.stateNode;g?$1(ie,!0):$1(W.stateNode,!1)}catch(be){st(W,W.return,be)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===i)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break e;for(;o.sibling===null;){if(o.return===null||o.return===i)break e;c===o&&(c=null),o=o.return}c===o&&(c=null),o.sibling.return=o.return,o=o.sibling}f&4&&(f=i.updateQueue,f!==null&&(c=f.retryQueue,c!==null&&(f.retryQueue=null,_h(i,c))));break;case 19:Kn(o,i),Gn(i),f&4&&(f=i.updateQueue,f!==null&&(i.updateQueue=null,_h(i,f)));break;case 30:break;case 21:break;default:Kn(o,i),Gn(i)}}function Gn(i){var o=i.flags;if(o&2){try{for(var c,f=i.return;f!==null;){if(qx(f)){c=f;break}f=f.return}if(c==null)throw Error(r(160));switch(c.tag){case 27:var g=c.stateNode,y=xm(i);vh(i,y,g);break;case 5:var E=c.stateNode;c.flags&32&&(rl(E,""),c.flags&=-33);var N=xm(i);vh(i,N,E);break;case 3:case 4:var W=c.stateNode.containerInfo,te=xm(i);Sm(i,te,W);break;default:throw Error(r(161))}}catch(oe){st(i,i.return,oe)}i.flags&=-3}o&4096&&(i.flags&=-4097)}function e1(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var o=i;e1(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),i=i.sibling}}function Ui(i,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)Gx(i,o.alternate,o),o=o.sibling}function yo(i){for(i=i.child;i!==null;){var o=i;switch(o.tag){case 0:case 11:case 14:case 15:bs(4,o,o.return),yo(o);break;case 1:oi(o,o.return);var c=o.stateNode;typeof c.componentWillUnmount=="function"&&$x(o,o.return,c),yo(o);break;case 27:rc(o.stateNode);case 26:case 5:oi(o,o.return),yo(o);break;case 22:o.memoizedState===null&&yo(o);break;case 30:yo(o);break;default:yo(o)}i=i.sibling}}function $i(i,o,c){for(c=c&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var f=o.alternate,g=i,y=o,E=y.flags;switch(y.tag){case 0:case 11:case 15:$i(g,y,c),Ka(4,y);break;case 1:if($i(g,y,c),f=y,g=f.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(te){st(f,f.return,te)}if(f=y,g=f.updateQueue,g!==null){var N=f.stateNode;try{var W=g.shared.hiddenCallbacks;if(W!==null)for(g.shared.hiddenCallbacks=null,g=0;g<W.length;g++)D0(W[g],N)}catch(te){st(f,f.return,te)}}c&&E&64&&Ux(y),Ga(y,y.return);break;case 27:Vx(y);case 26:case 5:$i(g,y,c),c&&f===null&&E&4&&Wx(y),Ga(y,y.return);break;case 12:$i(g,y,c);break;case 31:$i(g,y,c),c&&E&4&&Zx(g,y);break;case 13:$i(g,y,c),c&&E&4&&Qx(g,y);break;case 22:y.memoizedState===null&&$i(g,y,c),Ga(y,y.return);break;case 30:break;default:$i(g,y,c)}o=o.sibling}}function Cm(i,o){var c=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),i=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(i=o.memoizedState.cachePool.pool),i!==c&&(i!=null&&i.refCount++,c!=null&&La(c))}function km(i,o){i=null,o.alternate!==null&&(i=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==i&&(o.refCount++,i!=null&&La(i))}function Vr(i,o,c,f){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)t1(i,o,c,f),o=o.sibling}function t1(i,o,c,f){var g=o.flags;switch(o.tag){case 0:case 11:case 15:Vr(i,o,c,f),g&2048&&Ka(9,o);break;case 1:Vr(i,o,c,f);break;case 3:Vr(i,o,c,f),g&2048&&(i=null,o.alternate!==null&&(i=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==i&&(o.refCount++,i!=null&&La(i)));break;case 12:if(g&2048){Vr(i,o,c,f),i=o.stateNode;try{var y=o.memoizedProps,E=y.id,N=y.onPostCommit;typeof N=="function"&&N(E,o.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(W){st(o,o.return,W)}}else Vr(i,o,c,f);break;case 31:Vr(i,o,c,f);break;case 13:Vr(i,o,c,f);break;case 23:break;case 22:y=o.stateNode,E=o.alternate,o.memoizedState!==null?y._visibility&2?Vr(i,o,c,f):Ya(i,o):y._visibility&2?Vr(i,o,c,f):(y._visibility|=2,wl(i,o,c,f,(o.subtreeFlags&10256)!==0||!1)),g&2048&&Cm(E,o);break;case 24:Vr(i,o,c,f),g&2048&&km(o.alternate,o);break;default:Vr(i,o,c,f)}}function wl(i,o,c,f,g){for(g=g&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var y=i,E=o,N=c,W=f,te=E.flags;switch(E.tag){case 0:case 11:case 15:wl(y,E,N,W,g),Ka(8,E);break;case 23:break;case 22:var oe=E.stateNode;E.memoizedState!==null?oe._visibility&2?wl(y,E,N,W,g):Ya(y,E):(oe._visibility|=2,wl(y,E,N,W,g)),g&&te&2048&&Cm(E.alternate,E);break;case 24:wl(y,E,N,W,g),g&&te&2048&&km(E.alternate,E);break;default:wl(y,E,N,W,g)}o=o.sibling}}function Ya(i,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var c=i,f=o,g=f.flags;switch(f.tag){case 22:Ya(c,f),g&2048&&Cm(f.alternate,f);break;case 24:Ya(c,f),g&2048&&km(f.alternate,f);break;default:Ya(c,f)}o=o.sibling}}var Xa=8192;function Cl(i,o,c){if(i.subtreeFlags&Xa)for(i=i.child;i!==null;)n1(i,o,c),i=i.sibling}function n1(i,o,c){switch(i.tag){case 26:Cl(i,o,c),i.flags&Xa&&i.memoizedState!==null&&yN(c,qr,i.memoizedState,i.memoizedProps);break;case 5:Cl(i,o,c);break;case 3:case 4:var f=qr;qr=Nh(i.stateNode.containerInfo),Cl(i,o,c),qr=f;break;case 22:i.memoizedState===null&&(f=i.alternate,f!==null&&f.memoizedState!==null?(f=Xa,Xa=16777216,Cl(i,o,c),Xa=f):Cl(i,o,c));break;default:Cl(i,o,c)}}function r1(i){var o=i.alternate;if(o!==null&&(i=o.child,i!==null)){o.child=null;do o=i.sibling,i.sibling=null,i=o;while(i!==null)}}function Za(i){var o=i.deletions;if((i.flags&16)!==0){if(o!==null)for(var c=0;c<o.length;c++){var f=o[c];tn=f,s1(f,i)}r1(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)i1(i),i=i.sibling}function i1(i){switch(i.tag){case 0:case 11:case 15:Za(i),i.flags&2048&&bs(9,i,i.return);break;case 3:Za(i);break;case 12:Za(i);break;case 22:var o=i.stateNode;i.memoizedState!==null&&o._visibility&2&&(i.return===null||i.return.tag!==13)?(o._visibility&=-3,yh(i)):Za(i);break;default:Za(i)}}function yh(i){var o=i.deletions;if((i.flags&16)!==0){if(o!==null)for(var c=0;c<o.length;c++){var f=o[c];tn=f,s1(f,i)}r1(i)}for(i=i.child;i!==null;){switch(o=i,o.tag){case 0:case 11:case 15:bs(8,o,o.return),yh(o);break;case 22:c=o.stateNode,c._visibility&2&&(c._visibility&=-3,yh(o));break;default:yh(o)}i=i.sibling}}function s1(i,o){for(;tn!==null;){var c=tn;switch(c.tag){case 0:case 11:case 15:bs(8,c,o);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var f=c.memoizedState.cachePool.pool;f!=null&&f.refCount++}break;case 24:La(c.memoizedState.cache)}if(f=c.child,f!==null)f.return=c,tn=f;else e:for(c=i;tn!==null;){f=tn;var g=f.sibling,y=f.return;if(Yx(f),f===c){tn=null;break e}if(g!==null){g.return=y,tn=g;break e}tn=y}}}var LD={getCacheForType:function(i){var o=yn(jt),c=o.data.get(i);return c===void 0&&(c=i(),o.data.set(i,c)),c},cacheSignal:function(){return yn(jt).controller.signal}},zD=typeof WeakMap=="function"?WeakMap:Map,tt=0,ht=null,Ue=null,qe=0,it=0,ar=null,xs=!1,kl=!1,Em=!1,Wi=0,kt=0,Ss=0,bo=0,Rm=0,cr=0,El=0,Qa=null,Yn=null,Mm=!1,bh=0,o1=0,xh=1/0,Sh=null,ws=null,qt=0,Cs=null,Rl=null,qi=0,Tm=0,Am=null,l1=null,Ja=0,Dm=null;function ur(){return(tt&2)!==0&&qe!==0?qe&-qe:j.T!==null?jm():$r()}function a1(){if(cr===0)if((qe&536870912)===0||Ye){var i=Xo;Xo<<=1,(Xo&3932160)===0&&(Xo=262144),cr=i}else cr=536870912;return i=or.current,i!==null&&(i.flags|=32),cr}function Xn(i,o,c){(i===ht&&(it===2||it===9)||i.cancelPendingCommit!==null)&&(Ml(i,0),ks(i,qe,cr,!1)),_r(i,c),((tt&2)===0||i!==ht)&&(i===ht&&((tt&2)===0&&(bo|=c),kt===4&&ks(i,qe,cr,!1)),li(i))}function c1(i,o,c){if((tt&6)!==0)throw Error(r(327));var f=!c&&(o&127)===0&&(o&i.expiredLanes)===0||Fn(i,o),g=f?PD(i,o):Om(i,o,!0),y=f;do{if(g===0){kl&&!f&&ks(i,o,0,!1);break}else{if(c=i.current.alternate,y&&!BD(c)){g=Om(i,o,!1),y=!1;continue}if(g===2){if(y=o,i.errorRecoveryDisabledLanes&y)var E=0;else E=i.pendingLanes&-536870913,E=E!==0?E:E&536870912?536870912:0;if(E!==0){o=E;e:{var N=i;g=Qa;var W=N.current.memoizedState.isDehydrated;if(W&&(Ml(N,E).flags|=256),E=Om(N,E,!1),E!==2){if(Em&&!W){N.errorRecoveryDisabledLanes|=y,bo|=y,g=4;break e}y=Yn,Yn=g,y!==null&&(Yn===null?Yn=y:Yn.push.apply(Yn,y))}g=E}if(y=!1,g!==2)continue}}if(g===1){Ml(i,0),ks(i,o,0,!0);break}e:{switch(f=i,y=g,y){case 0:case 1:throw Error(r(345));case 4:if((o&4194048)!==o)break;case 6:ks(f,o,cr,!xs);break e;case 2:Yn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((o&62914560)===o&&(g=bh+300-Tt(),10<g)){if(ks(f,o,cr,!xs),Jt(f,0,!0)!==0)break e;qi=o,f.timeoutHandle=H1(u1.bind(null,f,c,Yn,Sh,Mm,o,cr,bo,El,xs,y,"Throttled",-0,0),g);break e}u1(f,c,Yn,Sh,Mm,o,cr,bo,El,xs,y,null,-0,0)}}break}while(!0);li(i)}function u1(i,o,c,f,g,y,E,N,W,te,oe,ue,re,ie){if(i.timeoutHandle=-1,ue=o.subtreeFlags,ue&8192||(ue&16785408)===16785408){ue={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ai},n1(o,y,ue);var be=(y&62914560)===y?bh-Tt():(y&4194048)===y?o1-Tt():0;if(be=bN(ue,be),be!==null){qi=y,i.cancelPendingCommit=be(_1.bind(null,i,o,y,c,f,g,E,N,W,oe,ue,null,re,ie)),ks(i,y,E,!te);return}}_1(i,o,y,c,f,g,E,N,W)}function BD(i){for(var o=i;;){var c=o.tag;if((c===0||c===11||c===15)&&o.flags&16384&&(c=o.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var f=0;f<c.length;f++){var g=c[f],y=g.getSnapshot;g=g.value;try{if(!ir(y(),g))return!1}catch{return!1}}if(c=o.child,o.subtreeFlags&16384&&c!==null)c.return=o,o=c;else{if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function ks(i,o,c,f){o&=~Rm,o&=~bo,i.suspendedLanes|=o,i.pingedLanes&=~o,f&&(i.warmLanes|=o),f=i.expirationTimes;for(var g=o;0<g;){var y=31-rt(g),E=1<<y;f[y]=-1,g&=~E}c!==0&&Ur(i,c,o)}function wh(){return(tt&6)===0?(ec(0),!1):!0}function Nm(){if(Ue!==null){if(it===0)var i=Ue.return;else i=Ue,Li=uo=null,Gp(i),_l=null,Ba=0,i=Ue;for(;i!==null;)Fx(i.alternate,i),i=i.return;Ue=null}}function Ml(i,o){var c=i.timeoutHandle;c!==-1&&(i.timeoutHandle=-1,nN(c)),c=i.cancelPendingCommit,c!==null&&(i.cancelPendingCommit=null,c()),qi=0,Nm(),ht=i,Ue=c=Ni(i.current,null),qe=o,it=0,ar=null,xs=!1,kl=Fn(i,o),Em=!1,El=cr=Rm=bo=Ss=kt=0,Yn=Qa=null,Mm=!1,(o&8)!==0&&(o|=o&32);var f=i.entangledLanes;if(f!==0)for(i=i.entanglements,f&=o;0<f;){var g=31-rt(f),y=1<<g;o|=i[g],f&=~y}return Wi=o,Wu(),c}function h1(i,o){ze=null,j.H=Wa,o===vl||o===Qu?(o=R0(),it=3):o===Bp?(o=R0(),it=4):it=o===um?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,ar=o,Ue===null&&(kt=1,dh(i,Cr(o,i.current)))}function d1(){var i=or.current;return i===null?!0:(qe&4194048)===qe?Mr===null:(qe&62914560)===qe||(qe&536870912)!==0?i===Mr:!1}function f1(){var i=j.H;return j.H=Wa,i===null?Wa:i}function p1(){var i=j.A;return j.A=LD,i}function Ch(){kt=4,xs||(qe&4194048)!==qe&&or.current!==null||(kl=!0),(Ss&134217727)===0&&(bo&134217727)===0||ht===null||ks(ht,qe,cr,!1)}function Om(i,o,c){var f=tt;tt|=2;var g=f1(),y=p1();(ht!==i||qe!==o)&&(Sh=null,Ml(i,o)),o=!1;var E=kt;e:do try{if(it!==0&&Ue!==null){var N=Ue,W=ar;switch(it){case 8:Nm(),E=6;break e;case 3:case 2:case 9:case 6:or.current===null&&(o=!0);var te=it;if(it=0,ar=null,Tl(i,N,W,te),c&&kl){E=0;break e}break;default:te=it,it=0,ar=null,Tl(i,N,W,te)}}jD(),E=kt;break}catch(oe){h1(i,oe)}while(!0);return o&&i.shellSuspendCounter++,Li=uo=null,tt=f,j.H=g,j.A=y,Ue===null&&(ht=null,qe=0,Wu()),E}function jD(){for(;Ue!==null;)m1(Ue)}function PD(i,o){var c=tt;tt|=2;var f=f1(),g=p1();ht!==i||qe!==o?(Sh=null,xh=Tt()+500,Ml(i,o)):kl=Fn(i,o);e:do try{if(it!==0&&Ue!==null){o=Ue;var y=ar;t:switch(it){case 1:it=0,ar=null,Tl(i,o,y,1);break;case 2:case 9:if(k0(y)){it=0,ar=null,g1(o);break}o=function(){it!==2&&it!==9||ht!==i||(it=7),li(i)},y.then(o,o);break e;case 3:it=7;break e;case 4:it=5;break e;case 7:k0(y)?(it=0,ar=null,g1(o)):(it=0,ar=null,Tl(i,o,y,7));break;case 5:var E=null;switch(Ue.tag){case 26:E=Ue.memoizedState;case 5:case 27:var N=Ue;if(E?tS(E):N.stateNode.complete){it=0,ar=null;var W=N.sibling;if(W!==null)Ue=W;else{var te=N.return;te!==null?(Ue=te,kh(te)):Ue=null}break t}}it=0,ar=null,Tl(i,o,y,5);break;case 6:it=0,ar=null,Tl(i,o,y,6);break;case 8:Nm(),kt=6;break e;default:throw Error(r(462))}}ID();break}catch(oe){h1(i,oe)}while(!0);return Li=uo=null,j.H=f,j.A=g,tt=c,Ue!==null?0:(ht=null,qe=0,Wu(),kt)}function ID(){for(;Ue!==null&&!ni();)m1(Ue)}function m1(i){var o=Ix(i.alternate,i,Wi);i.memoizedProps=i.pendingProps,o===null?kh(i):Ue=o}function g1(i){var o=i,c=o.alternate;switch(o.tag){case 15:case 0:o=Ox(c,o,o.pendingProps,o.type,void 0,qe);break;case 11:o=Ox(c,o,o.pendingProps,o.type.render,o.ref,qe);break;case 5:Gp(o);default:Fx(c,o),o=Ue=p0(o,Wi),o=Ix(c,o,Wi)}i.memoizedProps=i.pendingProps,o===null?kh(i):Ue=o}function Tl(i,o,c,f){Li=uo=null,Gp(o),_l=null,Ba=0;var g=o.return;try{if(RD(i,g,o,c,qe)){kt=1,dh(i,Cr(c,i.current)),Ue=null;return}}catch(y){if(g!==null)throw Ue=g,y;kt=1,dh(i,Cr(c,i.current)),Ue=null;return}o.flags&32768?(Ye||f===1?i=!0:kl||(qe&536870912)!==0?i=!1:(xs=i=!0,(f===2||f===9||f===3||f===6)&&(f=or.current,f!==null&&f.tag===13&&(f.flags|=16384))),v1(o,i)):kh(o)}function kh(i){var o=i;do{if((o.flags&32768)!==0){v1(o,xs);return}i=o.return;var c=AD(o.alternate,o,Wi);if(c!==null){Ue=c;return}if(o=o.sibling,o!==null){Ue=o;return}Ue=o=i}while(o!==null);kt===0&&(kt=5)}function v1(i,o){do{var c=DD(i.alternate,i);if(c!==null){c.flags&=32767,Ue=c;return}if(c=i.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!o&&(i=i.sibling,i!==null)){Ue=i;return}Ue=i=c}while(i!==null);kt=6,Ue=null}function _1(i,o,c,f,g,y,E,N,W){i.cancelPendingCommit=null;do Eh();while(qt!==0);if((tt&6)!==0)throw Error(r(327));if(o!==null){if(o===i.current)throw Error(r(177));if(y=o.lanes|o.childLanes,y|=xp,Wt(i,c,y,E,N,W),i===ht&&(Ue=ht=null,qe=0),Rl=o,Cs=i,qi=c,Tm=y,Am=g,l1=f,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,$D(de,function(){return w1(),null})):(i.callbackNode=null,i.callbackPriority=0),f=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||f){f=j.T,j.T=null,g=K.p,K.p=2,E=tt,tt|=4;try{ND(i,o,c)}finally{tt=E,K.p=g,j.T=f}}qt=1,y1(),b1(),x1()}}function y1(){if(qt===1){qt=0;var i=Cs,o=Rl,c=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||c){c=j.T,j.T=null;var f=K.p;K.p=2;var g=tt;tt|=4;try{Jx(o,i);var y=qm,E=s0(i.containerInfo),N=y.focusedElem,W=y.selectionRange;if(E!==N&&N&&N.ownerDocument&&i0(N.ownerDocument.documentElement,N)){if(W!==null&&gp(N)){var te=W.start,oe=W.end;if(oe===void 0&&(oe=te),"selectionStart"in N)N.selectionStart=te,N.selectionEnd=Math.min(oe,N.value.length);else{var ue=N.ownerDocument||document,re=ue&&ue.defaultView||window;if(re.getSelection){var ie=re.getSelection(),be=N.textContent.length,De=Math.min(W.start,be),at=W.end===void 0?De:Math.min(W.end,be);!ie.extend&&De>at&&(E=at,at=De,De=E);var Q=r0(N,De),G=r0(N,at);if(Q&&G&&(ie.rangeCount!==1||ie.anchorNode!==Q.node||ie.anchorOffset!==Q.offset||ie.focusNode!==G.node||ie.focusOffset!==G.offset)){var ee=ue.createRange();ee.setStart(Q.node,Q.offset),ie.removeAllRanges(),De>at?(ie.addRange(ee),ie.extend(G.node,G.offset)):(ee.setEnd(G.node,G.offset),ie.addRange(ee))}}}}for(ue=[],ie=N;ie=ie.parentNode;)ie.nodeType===1&&ue.push({element:ie,left:ie.scrollLeft,top:ie.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<ue.length;N++){var ce=ue[N];ce.element.scrollLeft=ce.left,ce.element.scrollTop=ce.top}}Ph=!!Wm,qm=Wm=null}finally{tt=g,K.p=f,j.T=c}}i.current=o,qt=2}}function b1(){if(qt===2){qt=0;var i=Cs,o=Rl,c=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||c){c=j.T,j.T=null;var f=K.p;K.p=2;var g=tt;tt|=4;try{Gx(i,o.alternate,o)}finally{tt=g,K.p=f,j.T=c}}qt=3}}function x1(){if(qt===4||qt===3){qt=0,ls();var i=Cs,o=Rl,c=qi,f=l1;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?qt=5:(qt=0,Rl=Cs=null,S1(i,i.pendingLanes));var g=i.pendingLanes;if(g===0&&(ws=null),Mi(c),o=o.stateNode,At&&typeof At.onCommitFiberRoot=="function")try{At.onCommitFiberRoot(gn,o,void 0,(o.current.flags&128)===128)}catch{}if(f!==null){o=j.T,g=K.p,K.p=2,j.T=null;try{for(var y=i.onRecoverableError,E=0;E<f.length;E++){var N=f[E];y(N.value,{componentStack:N.stack})}}finally{j.T=o,K.p=g}}(qi&3)!==0&&Eh(),li(i),g=i.pendingLanes,(c&261930)!==0&&(g&42)!==0?i===Dm?Ja++:(Ja=0,Dm=i):Ja=0,ec(0)}}function S1(i,o){(i.pooledCacheLanes&=o)===0&&(o=i.pooledCache,o!=null&&(i.pooledCache=null,La(o)))}function Eh(){return y1(),b1(),x1(),w1()}function w1(){if(qt!==5)return!1;var i=Cs,o=Tm;Tm=0;var c=Mi(qi),f=j.T,g=K.p;try{K.p=32>c?32:c,j.T=null,c=Am,Am=null;var y=Cs,E=qi;if(qt=0,Rl=Cs=null,qi=0,(tt&6)!==0)throw Error(r(331));var N=tt;if(tt|=4,i1(y.current),t1(y,y.current,E,c),tt=N,ec(0,!1),At&&typeof At.onPostCommitFiberRoot=="function")try{At.onPostCommitFiberRoot(gn,y)}catch{}return!0}finally{K.p=g,j.T=f,S1(i,o)}}function C1(i,o,c){o=Cr(c,o),o=cm(i.stateNode,o,2),i=vs(i,o,2),i!==null&&(_r(i,2),li(i))}function st(i,o,c){if(i.tag===3)C1(i,i,c);else for(;o!==null;){if(o.tag===3){C1(o,i,c);break}else if(o.tag===1){var f=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(ws===null||!ws.has(f))){i=Cr(c,i),c=kx(2),f=vs(o,c,2),f!==null&&(Ex(c,f,o,i),_r(f,2),li(f));break}}o=o.return}}function Lm(i,o,c){var f=i.pingCache;if(f===null){f=i.pingCache=new zD;var g=new Set;f.set(o,g)}else g=f.get(o),g===void 0&&(g=new Set,f.set(o,g));g.has(c)||(Em=!0,g.add(c),i=HD.bind(null,i,o,c),o.then(i,i))}function HD(i,o,c){var f=i.pingCache;f!==null&&f.delete(o),i.pingedLanes|=i.suspendedLanes&c,i.warmLanes&=~c,ht===i&&(qe&c)===c&&(kt===4||kt===3&&(qe&62914560)===qe&&300>Tt()-bh?(tt&2)===0&&Ml(i,0):Rm|=c,El===qe&&(El=0)),li(i)}function k1(i,o){o===0&&(o=kn()),i=lo(i,o),i!==null&&(_r(i,o),li(i))}function FD(i){var o=i.memoizedState,c=0;o!==null&&(c=o.retryLane),k1(i,c)}function UD(i,o){var c=0;switch(i.tag){case 31:case 13:var f=i.stateNode,g=i.memoizedState;g!==null&&(c=g.retryLane);break;case 19:f=i.stateNode;break;case 22:f=i.stateNode._retryCache;break;default:throw Error(r(314))}f!==null&&f.delete(o),k1(i,c)}function $D(i,o){return mn(i,o)}var Rh=null,Al=null,zm=!1,Mh=!1,Bm=!1,Es=0;function li(i){i!==Al&&i.next===null&&(Al===null?Rh=Al=i:Al=Al.next=i),Mh=!0,zm||(zm=!0,qD())}function ec(i,o){if(!Bm&&Mh){Bm=!0;do for(var c=!1,f=Rh;f!==null;){if(i!==0){var g=f.pendingLanes;if(g===0)var y=0;else{var E=f.suspendedLanes,N=f.pingedLanes;y=(1<<31-rt(42|i)+1)-1,y&=g&~(E&~N),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(c=!0,T1(f,y))}else y=qe,y=Jt(f,f===ht?y:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),(y&3)===0||Fn(f,y)||(c=!0,T1(f,y));f=f.next}while(c);Bm=!1}}function WD(){E1()}function E1(){Mh=zm=!1;var i=0;Es!==0&&tN()&&(i=Es);for(var o=Tt(),c=null,f=Rh;f!==null;){var g=f.next,y=R1(f,o);y===0?(f.next=null,c===null?Rh=g:c.next=g,g===null&&(Al=c)):(c=f,(i!==0||(y&3)!==0)&&(Mh=!0)),f=g}qt!==0&&qt!==5||ec(i),Es!==0&&(Es=0)}function R1(i,o){for(var c=i.suspendedLanes,f=i.pingedLanes,g=i.expirationTimes,y=i.pendingLanes&-62914561;0<y;){var E=31-rt(y),N=1<<E,W=g[E];W===-1?((N&c)===0||(N&f)!==0)&&(g[E]=Un(N,o)):W<=o&&(i.expiredLanes|=N),y&=~N}if(o=ht,c=qe,c=Jt(i,i===o?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),f=i.callbackNode,c===0||i===o&&(it===2||it===9)||i.cancelPendingCommit!==null)return f!==null&&f!==null&&vr(f),i.callbackNode=null,i.callbackPriority=0;if((c&3)===0||Fn(i,c)){if(o=c&-c,o===i.callbackPriority)return o;switch(f!==null&&vr(f),Mi(c)){case 2:case 8:c=ne;break;case 32:c=de;break;case 268435456:c=Ce;break;default:c=de}return f=M1.bind(null,i),c=mn(c,f),i.callbackPriority=o,i.callbackNode=c,o}return f!==null&&f!==null&&vr(f),i.callbackPriority=2,i.callbackNode=null,2}function M1(i,o){if(qt!==0&&qt!==5)return i.callbackNode=null,i.callbackPriority=0,null;var c=i.callbackNode;if(Eh()&&i.callbackNode!==c)return null;var f=qe;return f=Jt(i,i===ht?f:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),f===0?null:(c1(i,f,o),R1(i,Tt()),i.callbackNode!=null&&i.callbackNode===c?M1.bind(null,i):null)}function T1(i,o){if(Eh())return null;c1(i,o,!0)}function qD(){rN(function(){(tt&6)!==0?mn(le,WD):E1()})}function jm(){if(Es===0){var i=ml;i===0&&(i=Yo,Yo<<=1,(Yo&261888)===0&&(Yo=256)),Es=i}return Es}function A1(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Bu(""+i)}function D1(i,o){var c=o.ownerDocument.createElement("input");return c.name=o.name,c.value=o.value,i.id&&c.setAttribute("form",i.id),o.parentNode.insertBefore(c,o),i=new FormData(i),c.parentNode.removeChild(c),i}function VD(i,o,c,f,g){if(o==="submit"&&c&&c.stateNode===g){var y=A1((g[Wn]||null).action),E=f.submitter;E&&(o=(o=E[Wn]||null)?A1(o.formAction):E.getAttribute("formAction"),o!==null&&(y=o,E=null));var N=new Hu("action","action",null,f,g);i.push({event:N,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if(Es!==0){var W=E?D1(g,E):new FormData(g);rm(c,{pending:!0,data:W,method:g.method,action:y},null,W)}}else typeof y=="function"&&(N.preventDefault(),W=E?D1(g,E):new FormData(g),rm(c,{pending:!0,data:W,method:g.method,action:y},y,W))},currentTarget:g}]})}}for(var Pm=0;Pm<bp.length;Pm++){var Im=bp[Pm],KD=Im.toLowerCase(),GD=Im[0].toUpperCase()+Im.slice(1);Wr(KD,"on"+GD)}Wr(a0,"onAnimationEnd"),Wr(c0,"onAnimationIteration"),Wr(u0,"onAnimationStart"),Wr("dblclick","onDoubleClick"),Wr("focusin","onFocus"),Wr("focusout","onBlur"),Wr(uD,"onTransitionRun"),Wr(hD,"onTransitionStart"),Wr(dD,"onTransitionCancel"),Wr(h0,"onTransitionEnd"),tl("onMouseEnter",["mouseout","mouseover"]),tl("onMouseLeave",["mouseout","mouseover"]),tl("onPointerEnter",["pointerout","pointerover"]),tl("onPointerLeave",["pointerout","pointerover"]),ro("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ro("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ro("onBeforeInput",["compositionend","keypress","textInput","paste"]),ro("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ro("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ro("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var tc="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(" "),YD=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(tc));function N1(i,o){o=(o&4)!==0;for(var c=0;c<i.length;c++){var f=i[c],g=f.event;f=f.listeners;e:{var y=void 0;if(o)for(var E=f.length-1;0<=E;E--){var N=f[E],W=N.instance,te=N.currentTarget;if(N=N.listener,W!==y&&g.isPropagationStopped())break e;y=N,g.currentTarget=te;try{y(g)}catch(oe){$u(oe)}g.currentTarget=null,y=W}else for(E=0;E<f.length;E++){if(N=f[E],W=N.instance,te=N.currentTarget,N=N.listener,W!==y&&g.isPropagationStopped())break e;y=N,g.currentTarget=te;try{y(g)}catch(oe){$u(oe)}g.currentTarget=null,y=W}}}}function $e(i,o){var c=o[Qf];c===void 0&&(c=o[Qf]=new Set);var f=i+"__bubble";c.has(f)||(O1(o,i,2,!1),c.add(f))}function Hm(i,o,c){var f=0;o&&(f|=4),O1(c,i,f,o)}var Th="_reactListening"+Math.random().toString(36).slice(2);function Fm(i){if(!i[Th]){i[Th]=!0,Eb.forEach(function(c){c!=="selectionchange"&&(YD.has(c)||Hm(c,!1,i),Hm(c,!0,i))});var o=i.nodeType===9?i:i.ownerDocument;o===null||o[Th]||(o[Th]=!0,Hm("selectionchange",!1,o))}}function O1(i,o,c,f){switch(aS(o)){case 2:var g=wN;break;case 8:g=CN;break;default:g=ng}c=g.bind(null,o,c,i),g=void 0,!lp||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(g=!0),f?g!==void 0?i.addEventListener(o,c,{capture:!0,passive:g}):i.addEventListener(o,c,!0):g!==void 0?i.addEventListener(o,c,{passive:g}):i.addEventListener(o,c,!1)}function Um(i,o,c,f,g){var y=f;if((o&1)===0&&(o&2)===0&&f!==null)e:for(;;){if(f===null)return;var E=f.tag;if(E===3||E===4){var N=f.stateNode.containerInfo;if(N===g)break;if(E===4)for(E=f.return;E!==null;){var W=E.tag;if((W===3||W===4)&&E.stateNode.containerInfo===g)return;E=E.return}for(;N!==null;){if(E=Qo(N),E===null)return;if(W=E.tag,W===5||W===6||W===26||W===27){f=y=E;continue e}N=N.parentNode}}f=f.return}Pb(function(){var te=y,oe=sp(c),ue=[];e:{var re=d0.get(i);if(re!==void 0){var ie=Hu,be=i;switch(i){case"keypress":if(Pu(c)===0)break e;case"keydown":case"keyup":ie=UA;break;case"focusin":be="focus",ie=hp;break;case"focusout":be="blur",ie=hp;break;case"beforeblur":case"afterblur":ie=hp;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ie=Fb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=AA;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=qA;break;case a0:case c0:case u0:ie=OA;break;case h0:ie=KA;break;case"scroll":case"scrollend":ie=MA;break;case"wheel":ie=YA;break;case"copy":case"cut":case"paste":ie=zA;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=$b;break;case"toggle":case"beforetoggle":ie=ZA}var De=(o&4)!==0,at=!De&&(i==="scroll"||i==="scrollend"),Q=De?re!==null?re+"Capture":null:re;De=[];for(var G=te,ee;G!==null;){var ce=G;if(ee=ce.stateNode,ce=ce.tag,ce!==5&&ce!==26&&ce!==27||ee===null||Q===null||(ce=wa(G,Q),ce!=null&&De.push(nc(G,ce,ee))),at)break;G=G.return}0<De.length&&(re=new ie(re,be,null,c,oe),ue.push({event:re,listeners:De}))}}if((o&7)===0){e:{if(re=i==="mouseover"||i==="pointerover",ie=i==="mouseout"||i==="pointerout",re&&c!==ip&&(be=c.relatedTarget||c.fromElement)&&(Qo(be)||be[Zo]))break e;if((ie||re)&&(re=oe.window===oe?oe:(re=oe.ownerDocument)?re.defaultView||re.parentWindow:window,ie?(be=c.relatedTarget||c.toElement,ie=te,be=be?Qo(be):null,be!==null&&(at=l(be),De=be.tag,be!==at||De!==5&&De!==27&&De!==6)&&(be=null)):(ie=null,be=te),ie!==be)){if(De=Fb,ce="onMouseLeave",Q="onMouseEnter",G="mouse",(i==="pointerout"||i==="pointerover")&&(De=$b,ce="onPointerLeave",Q="onPointerEnter",G="pointer"),at=ie==null?re:Sa(ie),ee=be==null?re:Sa(be),re=new De(ce,G+"leave",ie,c,oe),re.target=at,re.relatedTarget=ee,ce=null,Qo(oe)===te&&(De=new De(Q,G+"enter",be,c,oe),De.target=ee,De.relatedTarget=at,ce=De),at=ce,ie&&be)t:{for(De=XD,Q=ie,G=be,ee=0,ce=Q;ce;ce=De(ce))ee++;ce=0;for(var Re=G;Re;Re=De(Re))ce++;for(;0<ee-ce;)Q=De(Q),ee--;for(;0<ce-ee;)G=De(G),ce--;for(;ee--;){if(Q===G||G!==null&&Q===G.alternate){De=Q;break t}Q=De(Q),G=De(G)}De=null}else De=null;ie!==null&&L1(ue,re,ie,De,!1),be!==null&&at!==null&&L1(ue,at,be,De,!0)}}e:{if(re=te?Sa(te):window,ie=re.nodeName&&re.nodeName.toLowerCase(),ie==="select"||ie==="input"&&re.type==="file")var Qe=Zb;else if(Yb(re))if(Qb)Qe=lD;else{Qe=sD;var we=iD}else ie=re.nodeName,!ie||ie.toLowerCase()!=="input"||re.type!=="checkbox"&&re.type!=="radio"?te&&rp(te.elementType)&&(Qe=Zb):Qe=oD;if(Qe&&(Qe=Qe(i,te))){Xb(ue,Qe,c,oe);break e}we&&we(i,re,te),i==="focusout"&&te&&re.type==="number"&&te.memoizedProps.value!=null&&np(re,"number",re.value)}switch(we=te?Sa(te):window,i){case"focusin":(Yb(we)||we.contentEditable==="true")&&(ll=we,vp=te,Da=null);break;case"focusout":Da=vp=ll=null;break;case"mousedown":_p=!0;break;case"contextmenu":case"mouseup":case"dragend":_p=!1,o0(ue,c,oe);break;case"selectionchange":if(cD)break;case"keydown":case"keyup":o0(ue,c,oe)}var Be;if(fp)e:{switch(i){case"compositionstart":var Ve="onCompositionStart";break e;case"compositionend":Ve="onCompositionEnd";break e;case"compositionupdate":Ve="onCompositionUpdate";break e}Ve=void 0}else ol?Kb(i,c)&&(Ve="onCompositionEnd"):i==="keydown"&&c.keyCode===229&&(Ve="onCompositionStart");Ve&&(Wb&&c.locale!=="ko"&&(ol||Ve!=="onCompositionStart"?Ve==="onCompositionEnd"&&ol&&(Be=Ib()):(us=oe,ap="value"in us?us.value:us.textContent,ol=!0)),we=Ah(te,Ve),0<we.length&&(Ve=new Ub(Ve,i,null,c,oe),ue.push({event:Ve,listeners:we}),Be?Ve.data=Be:(Be=Gb(c),Be!==null&&(Ve.data=Be)))),(Be=JA?eD(i,c):tD(i,c))&&(Ve=Ah(te,"onBeforeInput"),0<Ve.length&&(we=new Ub("onBeforeInput","beforeinput",null,c,oe),ue.push({event:we,listeners:Ve}),we.data=Be)),VD(ue,i,te,c,oe)}N1(ue,o)})}function nc(i,o,c){return{instance:i,listener:o,currentTarget:c}}function Ah(i,o){for(var c=o+"Capture",f=[];i!==null;){var g=i,y=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||y===null||(g=wa(i,c),g!=null&&f.unshift(nc(i,g,y)),g=wa(i,o),g!=null&&f.push(nc(i,g,y))),i.tag===3)return f;i=i.return}return[]}function XD(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function L1(i,o,c,f,g){for(var y=o._reactName,E=[];c!==null&&c!==f;){var N=c,W=N.alternate,te=N.stateNode;if(N=N.tag,W!==null&&W===f)break;N!==5&&N!==26&&N!==27||te===null||(W=te,g?(te=wa(c,y),te!=null&&E.unshift(nc(c,te,W))):g||(te=wa(c,y),te!=null&&E.push(nc(c,te,W)))),c=c.return}E.length!==0&&i.push({event:o,listeners:E})}var ZD=/\r\n?/g,QD=/\u0000|\uFFFD/g;function z1(i){return(typeof i=="string"?i:""+i).replace(ZD,`
|
|
49
|
-
`).replace(QD,"")}function B1(i,o){return o=z1(o),z1(i)===o}function lt(i,o,c,f,g,y){switch(c){case"children":typeof f=="string"?o==="body"||o==="textarea"&&f===""||rl(i,f):(typeof f=="number"||typeof f=="bigint")&&o!=="body"&&rl(i,""+f);break;case"className":Lu(i,"class",f);break;case"tabIndex":Lu(i,"tabindex",f);break;case"dir":case"role":case"viewBox":case"width":case"height":Lu(i,c,f);break;case"style":Bb(i,f,y);break;case"data":if(o!=="object"){Lu(i,"data",f);break}case"src":case"href":if(f===""&&(o!=="a"||c!=="href")){i.removeAttribute(c);break}if(f==null||typeof f=="function"||typeof f=="symbol"||typeof f=="boolean"){i.removeAttribute(c);break}f=Bu(""+f),i.setAttribute(c,f);break;case"action":case"formAction":if(typeof f=="function"){i.setAttribute(c,"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 y=="function"&&(c==="formAction"?(o!=="input"&<(i,o,"name",g.name,g,null),lt(i,o,"formEncType",g.formEncType,g,null),lt(i,o,"formMethod",g.formMethod,g,null),lt(i,o,"formTarget",g.formTarget,g,null)):(lt(i,o,"encType",g.encType,g,null),lt(i,o,"method",g.method,g,null),lt(i,o,"target",g.target,g,null)));if(f==null||typeof f=="symbol"||typeof f=="boolean"){i.removeAttribute(c);break}f=Bu(""+f),i.setAttribute(c,f);break;case"onClick":f!=null&&(i.onclick=Ai);break;case"onScroll":f!=null&&$e("scroll",i);break;case"onScrollEnd":f!=null&&$e("scrollend",i);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(r(61));if(c=f.__html,c!=null){if(g.children!=null)throw Error(r(60));i.innerHTML=c}}break;case"multiple":i.multiple=f&&typeof f!="function"&&typeof f!="symbol";break;case"muted":i.muted=f&&typeof f!="function"&&typeof f!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(f==null||typeof f=="function"||typeof f=="boolean"||typeof f=="symbol"){i.removeAttribute("xlink:href");break}c=Bu(""+f),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":f!=null&&typeof f!="function"&&typeof f!="symbol"?i.setAttribute(c,""+f):i.removeAttribute(c);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":f&&typeof f!="function"&&typeof f!="symbol"?i.setAttribute(c,""):i.removeAttribute(c);break;case"capture":case"download":f===!0?i.setAttribute(c,""):f!==!1&&f!=null&&typeof f!="function"&&typeof f!="symbol"?i.setAttribute(c,f):i.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":f!=null&&typeof f!="function"&&typeof f!="symbol"&&!isNaN(f)&&1<=f?i.setAttribute(c,f):i.removeAttribute(c);break;case"rowSpan":case"start":f==null||typeof f=="function"||typeof f=="symbol"||isNaN(f)?i.removeAttribute(c):i.setAttribute(c,f);break;case"popover":$e("beforetoggle",i),$e("toggle",i),Ou(i,"popover",f);break;case"xlinkActuate":Ti(i,"http://www.w3.org/1999/xlink","xlink:actuate",f);break;case"xlinkArcrole":Ti(i,"http://www.w3.org/1999/xlink","xlink:arcrole",f);break;case"xlinkRole":Ti(i,"http://www.w3.org/1999/xlink","xlink:role",f);break;case"xlinkShow":Ti(i,"http://www.w3.org/1999/xlink","xlink:show",f);break;case"xlinkTitle":Ti(i,"http://www.w3.org/1999/xlink","xlink:title",f);break;case"xlinkType":Ti(i,"http://www.w3.org/1999/xlink","xlink:type",f);break;case"xmlBase":Ti(i,"http://www.w3.org/XML/1998/namespace","xml:base",f);break;case"xmlLang":Ti(i,"http://www.w3.org/XML/1998/namespace","xml:lang",f);break;case"xmlSpace":Ti(i,"http://www.w3.org/XML/1998/namespace","xml:space",f);break;case"is":Ou(i,"is",f);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=EA.get(c)||c,Ou(i,c,f))}}function $m(i,o,c,f,g,y){switch(c){case"style":Bb(i,f,y);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(r(61));if(c=f.__html,c!=null){if(g.children!=null)throw Error(r(60));i.innerHTML=c}}break;case"children":typeof f=="string"?rl(i,f):(typeof f=="number"||typeof f=="bigint")&&rl(i,""+f);break;case"onScroll":f!=null&&$e("scroll",i);break;case"onScrollEnd":f!=null&&$e("scrollend",i);break;case"onClick":f!=null&&(i.onclick=Ai);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Rb.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(g=c.endsWith("Capture"),o=c.slice(2,g?c.length-7:void 0),y=i[Wn]||null,y=y!=null?y[c]:null,typeof y=="function"&&i.removeEventListener(o,y,g),typeof f=="function")){typeof y!="function"&&y!==null&&(c in i?i[c]=null:i.hasAttribute(c)&&i.removeAttribute(c)),i.addEventListener(o,f,g);break e}c in i?i[c]=f:f===!0?i.setAttribute(c,""):Ou(i,c,f)}}}function xn(i,o,c){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":$e("error",i),$e("load",i);var f=!1,g=!1,y;for(y in c)if(c.hasOwnProperty(y)){var E=c[y];if(E!=null)switch(y){case"src":f=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:lt(i,o,y,E,c,null)}}g&<(i,o,"srcSet",c.srcSet,c,null),f&<(i,o,"src",c.src,c,null);return;case"input":$e("invalid",i);var N=y=E=g=null,W=null,te=null;for(f in c)if(c.hasOwnProperty(f)){var oe=c[f];if(oe!=null)switch(f){case"name":g=oe;break;case"type":E=oe;break;case"checked":W=oe;break;case"defaultChecked":te=oe;break;case"value":y=oe;break;case"defaultValue":N=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(r(137,o));break;default:lt(i,o,f,oe,c,null)}}Nb(i,y,N,W,te,E,g,!1);return;case"select":$e("invalid",i),f=E=y=null;for(g in c)if(c.hasOwnProperty(g)&&(N=c[g],N!=null))switch(g){case"value":y=N;break;case"defaultValue":E=N;break;case"multiple":f=N;default:lt(i,o,g,N,c,null)}o=y,c=E,i.multiple=!!f,o!=null?nl(i,!!f,o,!1):c!=null&&nl(i,!!f,c,!0);return;case"textarea":$e("invalid",i),y=g=f=null;for(E in c)if(c.hasOwnProperty(E)&&(N=c[E],N!=null))switch(E){case"value":f=N;break;case"defaultValue":g=N;break;case"children":y=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(r(91));break;default:lt(i,o,E,N,c,null)}Lb(i,f,g,y);return;case"option":for(W in c)if(c.hasOwnProperty(W)&&(f=c[W],f!=null))switch(W){case"selected":i.selected=f&&typeof f!="function"&&typeof f!="symbol";break;default:lt(i,o,W,f,c,null)}return;case"dialog":$e("beforetoggle",i),$e("toggle",i),$e("cancel",i),$e("close",i);break;case"iframe":case"object":$e("load",i);break;case"video":case"audio":for(f=0;f<tc.length;f++)$e(tc[f],i);break;case"image":$e("error",i),$e("load",i);break;case"details":$e("toggle",i);break;case"embed":case"source":case"link":$e("error",i),$e("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(te in c)if(c.hasOwnProperty(te)&&(f=c[te],f!=null))switch(te){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:lt(i,o,te,f,c,null)}return;default:if(rp(o)){for(oe in c)c.hasOwnProperty(oe)&&(f=c[oe],f!==void 0&&$m(i,o,oe,f,c,void 0));return}}for(N in c)c.hasOwnProperty(N)&&(f=c[N],f!=null&<(i,o,N,f,c,null))}function JD(i,o,c,f){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var g=null,y=null,E=null,N=null,W=null,te=null,oe=null;for(ie in c){var ue=c[ie];if(c.hasOwnProperty(ie)&&ue!=null)switch(ie){case"checked":break;case"value":break;case"defaultValue":W=ue;default:f.hasOwnProperty(ie)||lt(i,o,ie,null,f,ue)}}for(var re in f){var ie=f[re];if(ue=c[re],f.hasOwnProperty(re)&&(ie!=null||ue!=null))switch(re){case"type":y=ie;break;case"name":g=ie;break;case"checked":te=ie;break;case"defaultChecked":oe=ie;break;case"value":E=ie;break;case"defaultValue":N=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(r(137,o));break;default:ie!==ue&<(i,o,re,ie,f,ue)}}tp(i,E,N,W,te,oe,y,g);return;case"select":ie=E=N=re=null;for(y in c)if(W=c[y],c.hasOwnProperty(y)&&W!=null)switch(y){case"value":break;case"multiple":ie=W;default:f.hasOwnProperty(y)||lt(i,o,y,null,f,W)}for(g in f)if(y=f[g],W=c[g],f.hasOwnProperty(g)&&(y!=null||W!=null))switch(g){case"value":re=y;break;case"defaultValue":N=y;break;case"multiple":E=y;default:y!==W&<(i,o,g,y,f,W)}o=N,c=E,f=ie,re!=null?nl(i,!!c,re,!1):!!f!=!!c&&(o!=null?nl(i,!!c,o,!0):nl(i,!!c,c?[]:"",!1));return;case"textarea":ie=re=null;for(N in c)if(g=c[N],c.hasOwnProperty(N)&&g!=null&&!f.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:lt(i,o,N,null,f,g)}for(E in f)if(g=f[E],y=c[E],f.hasOwnProperty(E)&&(g!=null||y!=null))switch(E){case"value":re=g;break;case"defaultValue":ie=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(r(91));break;default:g!==y&<(i,o,E,g,f,y)}Ob(i,re,ie);return;case"option":for(var be in c)if(re=c[be],c.hasOwnProperty(be)&&re!=null&&!f.hasOwnProperty(be))switch(be){case"selected":i.selected=!1;break;default:lt(i,o,be,null,f,re)}for(W in f)if(re=f[W],ie=c[W],f.hasOwnProperty(W)&&re!==ie&&(re!=null||ie!=null))switch(W){case"selected":i.selected=re&&typeof re!="function"&&typeof re!="symbol";break;default:lt(i,o,W,re,f,ie)}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 De in c)re=c[De],c.hasOwnProperty(De)&&re!=null&&!f.hasOwnProperty(De)&<(i,o,De,null,f,re);for(te in f)if(re=f[te],ie=c[te],f.hasOwnProperty(te)&&re!==ie&&(re!=null||ie!=null))switch(te){case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(r(137,o));break;default:lt(i,o,te,re,f,ie)}return;default:if(rp(o)){for(var at in c)re=c[at],c.hasOwnProperty(at)&&re!==void 0&&!f.hasOwnProperty(at)&&$m(i,o,at,void 0,f,re);for(oe in f)re=f[oe],ie=c[oe],!f.hasOwnProperty(oe)||re===ie||re===void 0&&ie===void 0||$m(i,o,oe,re,f,ie);return}}for(var Q in c)re=c[Q],c.hasOwnProperty(Q)&&re!=null&&!f.hasOwnProperty(Q)&<(i,o,Q,null,f,re);for(ue in f)re=f[ue],ie=c[ue],!f.hasOwnProperty(ue)||re===ie||re==null&&ie==null||lt(i,o,ue,re,f,ie)}function j1(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function eN(){if(typeof performance.getEntriesByType=="function"){for(var i=0,o=0,c=performance.getEntriesByType("resource"),f=0;f<c.length;f++){var g=c[f],y=g.transferSize,E=g.initiatorType,N=g.duration;if(y&&N&&j1(E)){for(E=0,N=g.responseEnd,f+=1;f<c.length;f++){var W=c[f],te=W.startTime;if(te>N)break;var oe=W.transferSize,ue=W.initiatorType;oe&&j1(ue)&&(W=W.responseEnd,E+=oe*(W<N?1:(N-te)/(W-te)))}if(--f,o+=8*(y+E)/(g.duration/1e3),i++,10<i)break}}if(0<i)return o/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var Wm=null,qm=null;function Dh(i){return i.nodeType===9?i:i.ownerDocument}function P1(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function I1(i,o){if(i===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&o==="foreignObject"?0:i}function Vm(i,o){return i==="textarea"||i==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var Km=null;function tN(){var i=window.event;return i&&i.type==="popstate"?i===Km?!1:(Km=i,!0):(Km=null,!1)}var H1=typeof setTimeout=="function"?setTimeout:void 0,nN=typeof clearTimeout=="function"?clearTimeout:void 0,F1=typeof Promise=="function"?Promise:void 0,rN=typeof queueMicrotask=="function"?queueMicrotask:typeof F1<"u"?function(i){return F1.resolve(null).then(i).catch(iN)}:H1;function iN(i){setTimeout(function(){throw i})}function Rs(i){return i==="head"}function U1(i,o){var c=o,f=0;do{var g=c.nextSibling;if(i.removeChild(c),g&&g.nodeType===8)if(c=g.data,c==="/$"||c==="/&"){if(f===0){i.removeChild(g),Ll(o);return}f--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")f++;else if(c==="html")rc(i.ownerDocument.documentElement);else if(c==="head"){c=i.ownerDocument.head,rc(c);for(var y=c.firstChild;y;){var E=y.nextSibling,N=y.nodeName;y[xa]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&y.rel.toLowerCase()==="stylesheet"||c.removeChild(y),y=E}}else c==="body"&&rc(i.ownerDocument.body);c=g}while(c);Ll(o)}function $1(i,o){var c=i;i=0;do{var f=c.nextSibling;if(c.nodeType===1?o?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(o?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),f&&f.nodeType===8)if(c=f.data,c==="/$"){if(i===0)break;i--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||i++;c=f}while(c)}function Gm(i){var o=i.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var c=o;switch(o=o.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":Gm(c),Jf(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}i.removeChild(c)}}function sN(i,o,c,f){for(;i.nodeType===1;){var g=c;if(i.nodeName.toLowerCase()!==o.toLowerCase()){if(!f&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(f){if(!i[xa])switch(o){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(y=i.getAttribute("rel"),y==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(y!==g.rel||i.getAttribute("href")!==(g.href==null||g.href===""?null:g.href)||i.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin)||i.getAttribute("title")!==(g.title==null?null:g.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(y=i.getAttribute("src"),(y!==(g.src==null?null:g.src)||i.getAttribute("type")!==(g.type==null?null:g.type)||i.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin))&&y&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(o==="input"&&i.type==="hidden"){var y=g.name==null?null:""+g.name;if(g.type==="hidden"&&i.getAttribute("name")===y)return i}else return i;if(i=Tr(i.nextSibling),i===null)break}return null}function oN(i,o,c){if(o==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!c||(i=Tr(i.nextSibling),i===null))return null;return i}function W1(i,o){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!o||(i=Tr(i.nextSibling),i===null))return null;return i}function Ym(i){return i.data==="$?"||i.data==="$~"}function Xm(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function lN(i,o){var c=i.ownerDocument;if(i.data==="$~")i._reactRetry=o;else if(i.data!=="$?"||c.readyState!=="loading")o();else{var f=function(){o(),c.removeEventListener("DOMContentLoaded",f)};c.addEventListener("DOMContentLoaded",f),i._reactRetry=f}}function Tr(i){for(;i!=null;i=i.nextSibling){var o=i.nodeType;if(o===1||o===3)break;if(o===8){if(o=i.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return i}var Zm=null;function q1(i){i=i.nextSibling;for(var o=0;i;){if(i.nodeType===8){var c=i.data;if(c==="/$"||c==="/&"){if(o===0)return Tr(i.nextSibling);o--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||o++}i=i.nextSibling}return null}function V1(i){i=i.previousSibling;for(var o=0;i;){if(i.nodeType===8){var c=i.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(o===0)return i;o--}else c!=="/$"&&c!=="/&"||o++}i=i.previousSibling}return null}function K1(i,o,c){switch(o=Dh(c),i){case"html":if(i=o.documentElement,!i)throw Error(r(452));return i;case"head":if(i=o.head,!i)throw Error(r(453));return i;case"body":if(i=o.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function rc(i){for(var o=i.attributes;o.length;)i.removeAttributeNode(o[0]);Jf(i)}var Ar=new Map,G1=new Set;function Nh(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Vi=K.d;K.d={f:aN,r:cN,D:uN,C:hN,L:dN,m:fN,X:mN,S:pN,M:gN};function aN(){var i=Vi.f(),o=wh();return i||o}function cN(i){var o=Jo(i);o!==null&&o.tag===5&&o.type==="form"?hx(o):Vi.r(i)}var Dl=typeof document>"u"?null:document;function Y1(i,o,c){var f=Dl;if(f&&typeof o=="string"&&o){var g=Sr(o);g='link[rel="'+i+'"][href="'+g+'"]',typeof c=="string"&&(g+='[crossorigin="'+c+'"]'),G1.has(g)||(G1.add(g),i={rel:i,crossOrigin:c,href:o},f.querySelector(g)===null&&(o=f.createElement("link"),xn(o,"link",i),en(o),f.head.appendChild(o)))}}function uN(i){Vi.D(i),Y1("dns-prefetch",i,null)}function hN(i,o){Vi.C(i,o),Y1("preconnect",i,o)}function dN(i,o,c){Vi.L(i,o,c);var f=Dl;if(f&&i&&o){var g='link[rel="preload"][as="'+Sr(o)+'"]';o==="image"&&c&&c.imageSrcSet?(g+='[imagesrcset="'+Sr(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(g+='[imagesizes="'+Sr(c.imageSizes)+'"]')):g+='[href="'+Sr(i)+'"]';var y=g;switch(o){case"style":y=Nl(i);break;case"script":y=Ol(i)}Ar.has(y)||(i=p({rel:"preload",href:o==="image"&&c&&c.imageSrcSet?void 0:i,as:o},c),Ar.set(y,i),f.querySelector(g)!==null||o==="style"&&f.querySelector(ic(y))||o==="script"&&f.querySelector(sc(y))||(o=f.createElement("link"),xn(o,"link",i),en(o),f.head.appendChild(o)))}}function fN(i,o){Vi.m(i,o);var c=Dl;if(c&&i){var f=o&&typeof o.as=="string"?o.as:"script",g='link[rel="modulepreload"][as="'+Sr(f)+'"][href="'+Sr(i)+'"]',y=g;switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=Ol(i)}if(!Ar.has(y)&&(i=p({rel:"modulepreload",href:i},o),Ar.set(y,i),c.querySelector(g)===null)){switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(sc(y)))return}f=c.createElement("link"),xn(f,"link",i),en(f),c.head.appendChild(f)}}}function pN(i,o,c){Vi.S(i,o,c);var f=Dl;if(f&&i){var g=el(f).hoistableStyles,y=Nl(i);o=o||"default";var E=g.get(y);if(!E){var N={loading:0,preload:null};if(E=f.querySelector(ic(y)))N.loading=5;else{i=p({rel:"stylesheet",href:i,"data-precedence":o},c),(c=Ar.get(y))&&Qm(i,c);var W=E=f.createElement("link");en(W),xn(W,"link",i),W._p=new Promise(function(te,oe){W.onload=te,W.onerror=oe}),W.addEventListener("load",function(){N.loading|=1}),W.addEventListener("error",function(){N.loading|=2}),N.loading|=4,Oh(E,o,f)}E={type:"stylesheet",instance:E,count:1,state:N},g.set(y,E)}}}function mN(i,o){Vi.X(i,o);var c=Dl;if(c&&i){var f=el(c).hoistableScripts,g=Ol(i),y=f.get(g);y||(y=c.querySelector(sc(g)),y||(i=p({src:i,async:!0},o),(o=Ar.get(g))&&Jm(i,o),y=c.createElement("script"),en(y),xn(y,"link",i),c.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},f.set(g,y))}}function gN(i,o){Vi.M(i,o);var c=Dl;if(c&&i){var f=el(c).hoistableScripts,g=Ol(i),y=f.get(g);y||(y=c.querySelector(sc(g)),y||(i=p({src:i,async:!0,type:"module"},o),(o=Ar.get(g))&&Jm(i,o),y=c.createElement("script"),en(y),xn(y,"link",i),c.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},f.set(g,y))}}function X1(i,o,c,f){var g=(g=se.current)?Nh(g):null;if(!g)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(o=Nl(c.href),c=el(g).hoistableStyles,f=c.get(o),f||(f={type:"style",instance:null,count:0,state:null},c.set(o,f)),f):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){i=Nl(c.href);var y=el(g).hoistableStyles,E=y.get(i);if(E||(g=g.ownerDocument||g,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(i,E),(y=g.querySelector(ic(i)))&&!y._p&&(E.instance=y,E.state.loading=5),Ar.has(i)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},Ar.set(i,c),y||vN(g,i,c,E.state))),o&&f===null)throw Error(r(528,""));return E}if(o&&f!==null)throw Error(r(529,""));return null;case"script":return o=c.async,c=c.src,typeof c=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=Ol(c),c=el(g).hoistableScripts,f=c.get(o),f||(f={type:"script",instance:null,count:0,state:null},c.set(o,f)),f):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function Nl(i){return'href="'+Sr(i)+'"'}function ic(i){return'link[rel="stylesheet"]['+i+"]"}function Z1(i){return p({},i,{"data-precedence":i.precedence,precedence:null})}function vN(i,o,c,f){i.querySelector('link[rel="preload"][as="style"]['+o+"]")?f.loading=1:(o=i.createElement("link"),f.preload=o,o.addEventListener("load",function(){return f.loading|=1}),o.addEventListener("error",function(){return f.loading|=2}),xn(o,"link",c),en(o),i.head.appendChild(o))}function Ol(i){return'[src="'+Sr(i)+'"]'}function sc(i){return"script[async]"+i}function Q1(i,o,c){if(o.count++,o.instance===null)switch(o.type){case"style":var f=i.querySelector('style[data-href~="'+Sr(c.href)+'"]');if(f)return o.instance=f,en(f),f;var g=p({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return f=(i.ownerDocument||i).createElement("style"),en(f),xn(f,"style",g),Oh(f,c.precedence,i),o.instance=f;case"stylesheet":g=Nl(c.href);var y=i.querySelector(ic(g));if(y)return o.state.loading|=4,o.instance=y,en(y),y;f=Z1(c),(g=Ar.get(g))&&Qm(f,g),y=(i.ownerDocument||i).createElement("link"),en(y);var E=y;return E._p=new Promise(function(N,W){E.onload=N,E.onerror=W}),xn(y,"link",f),o.state.loading|=4,Oh(y,c.precedence,i),o.instance=y;case"script":return y=Ol(c.src),(g=i.querySelector(sc(y)))?(o.instance=g,en(g),g):(f=c,(g=Ar.get(y))&&(f=p({},c),Jm(f,g)),i=i.ownerDocument||i,g=i.createElement("script"),en(g),xn(g,"link",f),i.head.appendChild(g),o.instance=g);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(f=o.instance,o.state.loading|=4,Oh(f,c.precedence,i));return o.instance}function Oh(i,o,c){for(var f=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=f.length?f[f.length-1]:null,y=g,E=0;E<f.length;E++){var N=f[E];if(N.dataset.precedence===o)y=N;else if(y!==g)break}y?y.parentNode.insertBefore(i,y.nextSibling):(o=c.nodeType===9?c.head:c,o.insertBefore(i,o.firstChild))}function Qm(i,o){i.crossOrigin==null&&(i.crossOrigin=o.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=o.referrerPolicy),i.title==null&&(i.title=o.title)}function Jm(i,o){i.crossOrigin==null&&(i.crossOrigin=o.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=o.referrerPolicy),i.integrity==null&&(i.integrity=o.integrity)}var Lh=null;function J1(i,o,c){if(Lh===null){var f=new Map,g=Lh=new Map;g.set(c,f)}else g=Lh,f=g.get(c),f||(f=new Map,g.set(c,f));if(f.has(i))return f;for(f.set(i,null),c=c.getElementsByTagName(i),g=0;g<c.length;g++){var y=c[g];if(!(y[xa]||y[vn]||i==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var E=y.getAttribute(o)||"";E=i+E;var N=f.get(E);N?N.push(y):f.set(E,[y])}}return f}function eS(i,o,c){i=i.ownerDocument||i,i.head.insertBefore(c,o==="title"?i.querySelector("head > title"):null)}function _N(i,o,c){if(c===1||o.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;switch(o.rel){case"stylesheet":return i=o.disabled,typeof o.precedence=="string"&&i==null;default:return!0}case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function tS(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function yN(i,o,c,f){if(c.type==="stylesheet"&&(typeof f.media!="string"||matchMedia(f.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var g=Nl(f.href),y=o.querySelector(ic(g));if(y){o=y._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(i.count++,i=zh.bind(i),o.then(i,i)),c.state.loading|=4,c.instance=y,en(y);return}y=o.ownerDocument||o,f=Z1(f),(g=Ar.get(g))&&Qm(f,g),y=y.createElement("link"),en(y);var E=y;E._p=new Promise(function(N,W){E.onload=N,E.onerror=W}),xn(y,"link",f),c.instance=y}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(c,o),(o=c.state.preload)&&(c.state.loading&3)===0&&(i.count++,c=zh.bind(i),o.addEventListener("load",c),o.addEventListener("error",c))}}var eg=0;function bN(i,o){return i.stylesheets&&i.count===0&&jh(i,i.stylesheets),0<i.count||0<i.imgCount?function(c){var f=setTimeout(function(){if(i.stylesheets&&jh(i,i.stylesheets),i.unsuspend){var y=i.unsuspend;i.unsuspend=null,y()}},6e4+o);0<i.imgBytes&&eg===0&&(eg=62500*eN());var g=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&jh(i,i.stylesheets),i.unsuspend)){var y=i.unsuspend;i.unsuspend=null,y()}},(i.imgBytes>eg?50:800)+o);return i.unsuspend=c,function(){i.unsuspend=null,clearTimeout(f),clearTimeout(g)}}:null}function zh(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)jh(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Bh=null;function jh(i,o){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Bh=new Map,o.forEach(xN,i),Bh=null,zh.call(i))}function xN(i,o){if(!(o.state.loading&4)){var c=Bh.get(i);if(c)var f=c.get(null);else{c=new Map,Bh.set(i,c);for(var g=i.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<g.length;y++){var E=g[y];(E.nodeName==="LINK"||E.getAttribute("media")!=="not all")&&(c.set(E.dataset.precedence,E),f=E)}f&&c.set(null,f)}g=o.instance,E=g.getAttribute("data-precedence"),y=c.get(E)||f,y===f&&c.set(null,g),c.set(E,g),this.count++,f=zh.bind(this),g.addEventListener("load",f),g.addEventListener("error",f),y?y.parentNode.insertBefore(g,y.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(g,i.firstChild)),o.state.loading|=4}}var oc={$$typeof:R,Provider:null,Consumer:null,_currentValue:$,_currentValue2:$,_threadCount:0};function SN(i,o,c,f,g,y,E,N,W){this.tag=1,this.containerInfo=i,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=$n(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$n(0),this.hiddenUpdates=$n(null),this.identifierPrefix=f,this.onUncaughtError=g,this.onCaughtError=y,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=W,this.incompleteTransitions=new Map}function nS(i,o,c,f,g,y,E,N,W,te,oe,ue){return i=new SN(i,o,c,E,W,te,oe,ue,N),o=1,y===!0&&(o|=24),y=sr(3,null,null,o),i.current=y,y.stateNode=i,o=Op(),o.refCount++,i.pooledCache=o,o.refCount++,y.memoizedState={element:f,isDehydrated:c,cache:o},jp(y),i}function rS(i){return i?(i=ul,i):ul}function iS(i,o,c,f,g,y){g=rS(g),f.context===null?f.context=g:f.pendingContext=g,f=gs(o),f.payload={element:c},y=y===void 0?null:y,y!==null&&(f.callback=y),c=vs(i,f,o),c!==null&&(Xn(c,i,o),Pa(c,i,o))}function sS(i,o){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var c=i.retryLane;i.retryLane=c!==0&&c<o?c:o}}function tg(i,o){sS(i,o),(i=i.alternate)&&sS(i,o)}function oS(i){if(i.tag===13||i.tag===31){var o=lo(i,67108864);o!==null&&Xn(o,i,67108864),tg(i,67108864)}}function lS(i){if(i.tag===13||i.tag===31){var o=ur();o=Ri(o);var c=lo(i,o);c!==null&&Xn(c,i,o),tg(i,o)}}var Ph=!0;function wN(i,o,c,f){var g=j.T;j.T=null;var y=K.p;try{K.p=2,ng(i,o,c,f)}finally{K.p=y,j.T=g}}function CN(i,o,c,f){var g=j.T;j.T=null;var y=K.p;try{K.p=8,ng(i,o,c,f)}finally{K.p=y,j.T=g}}function ng(i,o,c,f){if(Ph){var g=rg(f);if(g===null)Um(i,o,f,Ih,c),cS(i,f);else if(EN(g,i,o,c,f))f.stopPropagation();else if(cS(i,f),o&4&&-1<kN.indexOf(i)){for(;g!==null;){var y=Jo(g);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var E=Nt(y.pendingLanes);if(E!==0){var N=y;for(N.pendingLanes|=2,N.entangledLanes|=2;E;){var W=1<<31-rt(E);N.entanglements[1]|=W,E&=~W}li(y),(tt&6)===0&&(xh=Tt()+500,ec(0))}}break;case 31:case 13:N=lo(y,2),N!==null&&Xn(N,y,2),wh(),tg(y,2)}if(y=rg(f),y===null&&Um(i,o,f,Ih,c),y===g)break;g=y}g!==null&&f.stopPropagation()}else Um(i,o,f,null,c)}}function rg(i){return i=sp(i),ig(i)}var Ih=null;function ig(i){if(Ih=null,i=Qo(i),i!==null){var o=l(i);if(o===null)i=null;else{var c=o.tag;if(c===13){if(i=a(o),i!==null)return i;i=null}else if(c===31){if(i=u(o),i!==null)return i;i=null}else if(c===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;i=null}else o!==i&&(i=null)}}return Ih=i,null}function aS(i){switch(i){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(as()){case le:return 2;case ne:return 8;case de:case ve:return 32;case Ce:return 268435456;default:return 32}default:return 32}}var sg=!1,Ms=null,Ts=null,As=null,lc=new Map,ac=new Map,Ds=[],kN="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 cS(i,o){switch(i){case"focusin":case"focusout":Ms=null;break;case"dragenter":case"dragleave":Ts=null;break;case"mouseover":case"mouseout":As=null;break;case"pointerover":case"pointerout":lc.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":ac.delete(o.pointerId)}}function cc(i,o,c,f,g,y){return i===null||i.nativeEvent!==y?(i={blockedOn:o,domEventName:c,eventSystemFlags:f,nativeEvent:y,targetContainers:[g]},o!==null&&(o=Jo(o),o!==null&&oS(o)),i):(i.eventSystemFlags|=f,o=i.targetContainers,g!==null&&o.indexOf(g)===-1&&o.push(g),i)}function EN(i,o,c,f,g){switch(o){case"focusin":return Ms=cc(Ms,i,o,c,f,g),!0;case"dragenter":return Ts=cc(Ts,i,o,c,f,g),!0;case"mouseover":return As=cc(As,i,o,c,f,g),!0;case"pointerover":var y=g.pointerId;return lc.set(y,cc(lc.get(y)||null,i,o,c,f,g)),!0;case"gotpointercapture":return y=g.pointerId,ac.set(y,cc(ac.get(y)||null,i,o,c,f,g)),!0}return!1}function uS(i){var o=Qo(i.target);if(o!==null){var c=l(o);if(c!==null){if(o=c.tag,o===13){if(o=a(c),o!==null){i.blockedOn=o,cs(i.priority,function(){lS(c)});return}}else if(o===31){if(o=u(c),o!==null){i.blockedOn=o,cs(i.priority,function(){lS(c)});return}}else if(o===3&&c.stateNode.current.memoizedState.isDehydrated){i.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Hh(i){if(i.blockedOn!==null)return!1;for(var o=i.targetContainers;0<o.length;){var c=rg(i.nativeEvent);if(c===null){c=i.nativeEvent;var f=new c.constructor(c.type,c);ip=f,c.target.dispatchEvent(f),ip=null}else return o=Jo(c),o!==null&&oS(o),i.blockedOn=c,!1;o.shift()}return!0}function hS(i,o,c){Hh(i)&&c.delete(o)}function RN(){sg=!1,Ms!==null&&Hh(Ms)&&(Ms=null),Ts!==null&&Hh(Ts)&&(Ts=null),As!==null&&Hh(As)&&(As=null),lc.forEach(hS),ac.forEach(hS)}function Fh(i,o){i.blockedOn===o&&(i.blockedOn=null,sg||(sg=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,RN)))}var Uh=null;function dS(i){Uh!==i&&(Uh=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Uh===i&&(Uh=null);for(var o=0;o<i.length;o+=3){var c=i[o],f=i[o+1],g=i[o+2];if(typeof f!="function"){if(ig(f||c)===null)continue;break}var y=Jo(c);y!==null&&(i.splice(o,3),o-=3,rm(y,{pending:!0,data:g,method:c.method,action:f},f,g))}}))}function Ll(i){function o(W){return Fh(W,i)}Ms!==null&&Fh(Ms,i),Ts!==null&&Fh(Ts,i),As!==null&&Fh(As,i),lc.forEach(o),ac.forEach(o);for(var c=0;c<Ds.length;c++){var f=Ds[c];f.blockedOn===i&&(f.blockedOn=null)}for(;0<Ds.length&&(c=Ds[0],c.blockedOn===null);)uS(c),c.blockedOn===null&&Ds.shift();if(c=(i.ownerDocument||i).$$reactFormReplay,c!=null)for(f=0;f<c.length;f+=3){var g=c[f],y=c[f+1],E=g[Wn]||null;if(typeof y=="function")E||dS(c);else if(E){var N=null;if(y&&y.hasAttribute("formAction")){if(g=y,E=y[Wn]||null)N=E.formAction;else if(ig(g)!==null)continue}else N=E.action;typeof N=="function"?c[f+1]=N:(c.splice(f,3),f-=3),dS(c)}}}function fS(){function i(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(E){return g=E})},focusReset:"manual",scroll:"manual"})}function o(){g!==null&&(g(),g=null),f||setTimeout(c,20)}function c(){if(!f&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var f=!1,g=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(c,100),function(){f=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),g!==null&&(g(),g=null)}}}function og(i){this._internalRoot=i}$h.prototype.render=og.prototype.render=function(i){var o=this._internalRoot;if(o===null)throw Error(r(409));var c=o.current,f=ur();iS(c,f,i,o,null,null)},$h.prototype.unmount=og.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var o=i.containerInfo;iS(i.current,2,null,i,null,null),wh(),o[Zo]=null}};function $h(i){this._internalRoot=i}$h.prototype.unstable_scheduleHydration=function(i){if(i){var o=$r();i={blockedOn:null,target:i,priority:o};for(var c=0;c<Ds.length&&o!==0&&o<Ds[c].priority;c++);Ds.splice(c,0,i),c===0&&uS(i)}};var pS=t.version;if(pS!=="19.2.1")throw Error(r(527,pS,"19.2.1"));K.findDOMNode=function(i){var o=i._reactInternals;if(o===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=d(o),i=i!==null?m(i):null,i=i===null?null:i.stateNode,i};var MN={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Wh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Wh.isDisabled&&Wh.supportsFiber)try{gn=Wh.inject(MN),At=Wh}catch{}}return dc.createRoot=function(i,o){if(!s(i))throw Error(r(299));var c=!1,f="",g=xx,y=Sx,E=wx;return o!=null&&(o.unstable_strictMode===!0&&(c=!0),o.identifierPrefix!==void 0&&(f=o.identifierPrefix),o.onUncaughtError!==void 0&&(g=o.onUncaughtError),o.onCaughtError!==void 0&&(y=o.onCaughtError),o.onRecoverableError!==void 0&&(E=o.onRecoverableError)),o=nS(i,1,!1,null,null,c,f,null,g,y,E,fS),i[Zo]=o.current,Fm(i),new og(o)},dc.hydrateRoot=function(i,o,c){if(!s(i))throw Error(r(299));var f=!1,g="",y=xx,E=Sx,N=wx,W=null;return c!=null&&(c.unstable_strictMode===!0&&(f=!0),c.identifierPrefix!==void 0&&(g=c.identifierPrefix),c.onUncaughtError!==void 0&&(y=c.onUncaughtError),c.onCaughtError!==void 0&&(E=c.onCaughtError),c.onRecoverableError!==void 0&&(N=c.onRecoverableError),c.formState!==void 0&&(W=c.formState)),o=nS(i,1,!0,o,c??null,f,g,W,y,E,N,fS),o.context=rS(null),c=o.current,f=ur(),f=Ri(f),g=gs(f),g.callback=null,vs(c,g,f),c=f,o.current.lanes=c,_r(o,c),li(o),i[Zo]=o.current,Fm(i),new $h(o)},dc.version="19.2.1",dc}var MS;function HN(){if(MS)return cg.exports;MS=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),cg.exports=IN(),cg.exports}var FN=HN();/**
|
|
50
|
-
* react-router v7.13.1
|
|
51
|
-
*
|
|
52
|
-
* Copyright (c) Remix Software Inc.
|
|
53
|
-
*
|
|
54
|
-
* This source code is licensed under the MIT license found in the
|
|
55
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
-
*
|
|
57
|
-
* @license MIT
|
|
58
|
-
*/var TS="popstate";function AS(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function UN(e={}){function t(r,s){var d;let l=(d=s.state)==null?void 0:d.masked,{pathname:a,search:u,hash:h}=l||r.location;return gv("",{pathname:a,search:u,hash:h},s.state&&s.state.usr||null,s.state&&s.state.key||"default",l?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,s){return typeof s=="string"?s:Wc(s)}return WN(t,n,null,e)}function wt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function bi(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function $N(){return Math.random().toString(36).substring(2,10)}function DS(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function gv(e,t,n=null,r,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?ca(t):t,state:n,key:t&&t.key||r||$N(),unstable_mask:s}}function Wc({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function ca(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function WN(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:l=!1}=r,a=s.history,u="POP",h=null,d=m();d==null&&(d=0,a.replaceState({...a.state,idx:d},""));function m(){return(a.state||{idx:null}).idx}function p(){u="POP";let C=m(),k=C==null?null:C-d;d=C,h&&h({action:u,location:w.location,delta:k})}function _(C,k){u="PUSH";let T=AS(C)?C:gv(w.location,C,k);d=m()+1;let R=DS(T,d),D=w.createHref(T.unstable_mask||T);try{a.pushState(R,"",D)}catch(z){if(z instanceof DOMException&&z.name==="DataCloneError")throw z;s.location.assign(D)}l&&h&&h({action:u,location:w.location,delta:1})}function b(C,k){u="REPLACE";let T=AS(C)?C:gv(w.location,C,k);d=m();let R=DS(T,d),D=w.createHref(T.unstable_mask||T);a.replaceState(R,"",D),l&&h&&h({action:u,location:w.location,delta:0})}function S(C){return qN(C)}let w={get action(){return u},get location(){return e(s,a)},listen(C){if(h)throw new Error("A history only accepts one active listener");return s.addEventListener(TS,p),h=C,()=>{s.removeEventListener(TS,p),h=null}},createHref(C){return t(s,C)},createURL:S,encodeLocation(C){let k=S(C);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:_,replace:b,go(C){return a.go(C)}};return w}function qN(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),wt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Wc(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function lk(e,t,n="/"){return VN(e,t,n,!1)}function VN(e,t,n,r){let s=typeof t=="string"?ca(t):t,l=Qi(s.pathname||"/",n);if(l==null)return null;let a=ak(e);KN(a);let u=null;for(let h=0;u==null&&h<a.length;++h){let d=i3(l);u=n3(a[h],d,r)}return u}function ak(e,t=[],n=[],r="",s=!1){let l=(a,u,h=s,d)=>{let m={relativePath:d===void 0?a.path||"":d,caseSensitive:a.caseSensitive===!0,childrenIndex:u,route:a};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(r)&&h)return;wt(m.relativePath.startsWith(r),`Absolute route path "${m.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(r.length)}let p=vi([r,m.relativePath]),_=n.concat(m);a.children&&a.children.length>0&&(wt(a.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),ak(a.children,t,_,p,h)),!(a.path==null&&!a.index)&&t.push({path:p,score:e3(p,a.index),routesMeta:_})};return e.forEach((a,u)=>{var h;if(a.path===""||!((h=a.path)!=null&&h.includes("?")))l(a,u);else for(let d of ck(a.path))l(a,u,!0,d)}),t}function ck(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),l=n.replace(/\?$/,"");if(r.length===0)return s?[l,""]:[l];let a=ck(r.join("/")),u=[];return u.push(...a.map(h=>h===""?l:[l,h].join("/"))),s&&u.push(...a),u.map(h=>e.startsWith("/")&&h===""?"/":h)}function KN(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:t3(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var GN=/^:[\w-]+$/,YN=3,XN=2,ZN=1,QN=10,JN=-2,NS=e=>e==="*";function e3(e,t){let n=e.split("/"),r=n.length;return n.some(NS)&&(r+=JN),t&&(r+=XN),n.filter(s=>!NS(s)).reduce((s,l)=>s+(GN.test(l)?YN:l===""?ZN:QN),r)}function t3(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function n3(e,t,n=!1){let{routesMeta:r}=e,s={},l="/",a=[];for(let u=0;u<r.length;++u){let h=r[u],d=u===r.length-1,m=l==="/"?t:t.slice(l.length)||"/",p=Pd({path:h.relativePath,caseSensitive:h.caseSensitive,end:d},m),_=h.route;if(!p&&d&&n&&!r[r.length-1].route.index&&(p=Pd({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},m)),!p)return null;Object.assign(s,p.params),a.push({params:s,pathname:vi([l,p.pathname]),pathnameBase:a3(vi([l,p.pathnameBase])),route:_}),p.pathnameBase!=="/"&&(l=vi([l,p.pathnameBase]))}return a}function Pd(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=r3(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let l=s[0],a=l.replace(/(.)\/+$/,"$1"),u=s.slice(1);return{params:r.reduce((d,{paramName:m,isOptional:p},_)=>{if(m==="*"){let S=u[_]||"";a=l.slice(0,l.length-S.length).replace(/(.)\/+$/,"$1")}const b=u[_];return p&&!b?d[m]=void 0:d[m]=(b||"").replace(/%2F/g,"/"),d},{}),pathname:l,pathnameBase:a,pattern:e}}function r3(e,t=!1,n=!0){bi(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,u,h,d,m)=>{if(r.push({paramName:u,isOptional:h!=null}),h){let p=m.charAt(d+a.length);return p&&p!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function i3(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return bi(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Qi(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var s3=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function o3(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?ca(e):e,l;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?l=OS(n.substring(1),"/"):l=OS(n,t)):l=t,{pathname:l,search:c3(r),hash:u3(s)}}function OS(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function fg(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function l3(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function uk(e){let t=l3(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function U_(e,t,n,r=!1){let s;typeof e=="string"?s=ca(e):(s={...e},wt(!s.pathname||!s.pathname.includes("?"),fg("?","pathname","search",s)),wt(!s.pathname||!s.pathname.includes("#"),fg("#","pathname","hash",s)),wt(!s.search||!s.search.includes("#"),fg("#","search","hash",s)));let l=e===""||s.pathname==="",a=l?"/":s.pathname,u;if(a==null)u=n;else{let p=t.length-1;if(!r&&a.startsWith("..")){let _=a.split("/");for(;_[0]==="..";)_.shift(),p-=1;s.pathname=_.join("/")}u=p>=0?t[p]:"/"}let h=o3(s,u),d=a&&a!=="/"&&a.endsWith("/"),m=(l||a===".")&&n.endsWith("/");return!h.pathname.endsWith("/")&&(d||m)&&(h.pathname+="/"),h}var vi=e=>e.join("/").replace(/\/\/+/g,"/"),a3=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),c3=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,u3=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,h3=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function d3(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function f3(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var hk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function dk(e,t){let n=e;if(typeof n!="string"||!s3.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,s=!1;if(hk)try{let l=new URL(window.location.href),a=n.startsWith("//")?new URL(l.protocol+n):new URL(n),u=Qi(a.pathname,t);a.origin===l.origin&&u!=null?n=u+a.search+a.hash:s=!0}catch{bi(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:s,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var fk=["POST","PUT","PATCH","DELETE"];new Set(fk);var p3=["GET",...fk];new Set(p3);var ua=x.createContext(null);ua.displayName="DataRouter";var mf=x.createContext(null);mf.displayName="DataRouterState";var m3=x.createContext(!1),pk=x.createContext({isTransitioning:!1});pk.displayName="ViewTransition";var g3=x.createContext(new Map);g3.displayName="Fetchers";var v3=x.createContext(null);v3.displayName="Await";var Pr=x.createContext(null);Pr.displayName="Navigation";var cu=x.createContext(null);cu.displayName="Location";var ei=x.createContext({outlet:null,matches:[],isDataRoute:!1});ei.displayName="Route";var $_=x.createContext(null);$_.displayName="RouteError";var mk="REACT_ROUTER_ERROR",_3="REDIRECT",y3="ROUTE_ERROR_RESPONSE";function b3(e){if(e.startsWith(`${mk}:${_3}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function x3(e){if(e.startsWith(`${mk}:${y3}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new h3(t.status,t.statusText,t.data)}catch{}}function S3(e,{relative:t}={}){wt(uu(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=x.useContext(Pr),{hash:s,pathname:l,search:a}=hu(e,{relative:t}),u=l;return n!=="/"&&(u=l==="/"?n:vi([n,l])),r.createHref({pathname:u,search:a,hash:s})}function uu(){return x.useContext(cu)!=null}function Ci(){return wt(uu(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(cu).location}var gk="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function vk(e){x.useContext(Pr).static||x.useLayoutEffect(e)}function W_(){let{isDataRoute:e}=x.useContext(ei);return e?j3():w3()}function w3(){wt(uu(),"useNavigate() may be used only in the context of a <Router> component.");let e=x.useContext(ua),{basename:t,navigator:n}=x.useContext(Pr),{matches:r}=x.useContext(ei),{pathname:s}=Ci(),l=JSON.stringify(uk(r)),a=x.useRef(!1);return vk(()=>{a.current=!0}),x.useCallback((h,d={})=>{if(bi(a.current,gk),!a.current)return;if(typeof h=="number"){n.go(h);return}let m=U_(h,JSON.parse(l),s,d.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:vi([t,m.pathname])),(d.replace?n.replace:n.push)(m,d.state,d)},[t,n,l,s,e])}var _k=x.createContext(null);function q_(){return x.useContext(_k)}function C3(e){let t=x.useContext(ei).outlet;return x.useMemo(()=>t&&x.createElement(_k.Provider,{value:e},t),[t,e])}function k3(){let{matches:e}=x.useContext(ei),t=e[e.length-1];return t?t.params:{}}function hu(e,{relative:t}={}){let{matches:n}=x.useContext(ei),{pathname:r}=Ci(),s=JSON.stringify(uk(n));return x.useMemo(()=>U_(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function E3(e,t){return yk(e,t)}function yk(e,t,n){var C;wt(uu(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=x.useContext(Pr),{matches:s}=x.useContext(ei),l=s[s.length-1],a=l?l.params:{},u=l?l.pathname:"/",h=l?l.pathnameBase:"/",d=l&&l.route;{let k=d&&d.path||"";xk(u,!d||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${k}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
59
|
-
|
|
60
|
-
Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let m=Ci(),p;if(t){let k=typeof t=="string"?ca(t):t;wt(h==="/"||((C=k.pathname)==null?void 0:C.startsWith(h)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${h}" but pathname "${k.pathname}" was given in the \`location\` prop.`),p=k}else p=m;let _=p.pathname||"/",b=_;if(h!=="/"){let k=h.replace(/^\//,"").split("/");b="/"+_.replace(/^\//,"").split("/").slice(k.length).join("/")}let S=lk(e,{pathname:b});bi(d||S!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),bi(S==null||S[S.length-1].route.element!==void 0||S[S.length-1].route.Component!==void 0||S[S.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let w=D3(S&&S.map(k=>Object.assign({},k,{params:Object.assign({},a,k.params),pathname:vi([h,r.encodeLocation?r.encodeLocation(k.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?h:vi([h,r.encodeLocation?r.encodeLocation(k.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),s,n);return t&&w?x.createElement(cu.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...p},navigationType:"POP"}},w):w}function R3(){let e=B3(),t=d3(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:r},l={padding:"2px 4px",backgroundColor:r},a=null;return console.error("Error handled by React Router default ErrorBoundary:",e),a=x.createElement(x.Fragment,null,x.createElement("p",null,"💿 Hey developer 👋"),x.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",x.createElement("code",{style:l},"ErrorBoundary")," or"," ",x.createElement("code",{style:l},"errorElement")," prop on your route.")),x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},t),n?x.createElement("pre",{style:s},n):null,a)}var M3=x.createElement(R3,null),bk=class extends x.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=x3(e.digest);n&&(e=n)}let t=e!==void 0?x.createElement(ei.Provider,{value:this.props.routeContext},x.createElement($_.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?x.createElement(T3,{error:e},t):t}};bk.contextType=m3;var pg=new WeakMap;function T3({children:e,error:t}){let{basename:n}=x.useContext(Pr);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=b3(t.digest);if(r){let s=pg.get(t);if(s)throw s;let l=dk(r.location,n);if(hk&&!pg.get(t))if(l.isExternal||r.reloadDocument)window.location.href=l.absoluteURL||l.to;else{const a=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(l.to,{replace:r.replace}));throw pg.set(t,a),a}return x.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l.absoluteURL||l.to}`})}}return e}function A3({routeContext:e,match:t,children:n}){let r=x.useContext(ua);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),x.createElement(ei.Provider,{value:e},n)}function D3(e,t=[],n){let r=n==null?void 0:n.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let s=e,l=r==null?void 0:r.errors;if(l!=null){let m=s.findIndex(p=>p.route.id&&(l==null?void 0:l[p.route.id])!==void 0);wt(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),s=s.slice(0,Math.min(s.length,m+1))}let a=!1,u=-1;if(n&&r){a=r.renderFallback;for(let m=0;m<s.length;m++){let p=s[m];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(u=m),p.route.id){let{loaderData:_,errors:b}=r,S=p.route.loader&&!_.hasOwnProperty(p.route.id)&&(!b||b[p.route.id]===void 0);if(p.route.lazy||S){n.isStatic&&(a=!0),u>=0?s=s.slice(0,u+1):s=[s[0]];break}}}}let h=n==null?void 0:n.onError,d=r&&h?(m,p)=>{var _,b;h(m,{location:r.location,params:((b=(_=r.matches)==null?void 0:_[0])==null?void 0:b.params)??{},unstable_pattern:f3(r.matches),errorInfo:p})}:void 0;return s.reduceRight((m,p,_)=>{let b,S=!1,w=null,C=null;r&&(b=l&&p.route.id?l[p.route.id]:void 0,w=p.route.errorElement||M3,a&&(u<0&&_===0?(xk("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,C=null):u===_&&(S=!0,C=p.route.hydrateFallbackElement||null)));let k=t.concat(s.slice(0,_+1)),T=()=>{let R;return b?R=w:S?R=C:p.route.Component?R=x.createElement(p.route.Component,null):p.route.element?R=p.route.element:R=m,x.createElement(A3,{match:p,routeContext:{outlet:m,matches:k,isDataRoute:r!=null},children:R})};return r&&(p.route.ErrorBoundary||p.route.errorElement||_===0)?x.createElement(bk,{location:r.location,revalidation:r.revalidation,component:w,error:b,children:T(),routeContext:{outlet:null,matches:k,isDataRoute:!0},onError:d}):T()},null)}function V_(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function N3(e){let t=x.useContext(ua);return wt(t,V_(e)),t}function O3(e){let t=x.useContext(mf);return wt(t,V_(e)),t}function L3(e){let t=x.useContext(ei);return wt(t,V_(e)),t}function K_(e){let t=L3(e),n=t.matches[t.matches.length-1];return wt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function z3(){return K_("useRouteId")}function B3(){var r;let e=x.useContext($_),t=O3("useRouteError"),n=K_("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function j3(){let{router:e}=N3("useNavigate"),t=K_("useNavigate"),n=x.useRef(!1);return vk(()=>{n.current=!0}),x.useCallback(async(s,l={})=>{bi(n.current,gk),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...l}))},[e,t])}var LS={};function xk(e,t,n){!t&&!LS[e]&&(LS[e]=!0,bi(!1,n))}x.memo(P3);function P3({routes:e,future:t,state:n,isStatic:r,onError:s}){return yk(e,void 0,{state:n,isStatic:r,onError:s})}function I3(e){return C3(e.context)}function Rc(e){wt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function H3({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:l=!1,unstable_useTransitions:a}){wt(!uu(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),h=x.useMemo(()=>({basename:u,navigator:s,static:l,unstable_useTransitions:a,future:{}}),[u,s,l,a]);typeof n=="string"&&(n=ca(n));let{pathname:d="/",search:m="",hash:p="",state:_=null,key:b="default",unstable_mask:S}=n,w=x.useMemo(()=>{let C=Qi(d,u);return C==null?null:{location:{pathname:C,search:m,hash:p,state:_,key:b,unstable_mask:S},navigationType:r}},[u,d,m,p,_,b,r,S]);return bi(w!=null,`<Router basename="${u}"> is not able to match the URL "${d}${m}${p}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:x.createElement(Pr.Provider,{value:h},x.createElement(cu.Provider,{children:t,value:w}))}function F3({children:e,location:t}){return E3(vv(e),t)}function vv(e,t=[]){let n=[];return x.Children.forEach(e,(r,s)=>{if(!x.isValidElement(r))return;let l=[...t,s];if(r.type===x.Fragment){n.push.apply(n,vv(r.props.children,l));return}wt(r.type===Rc,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),wt(!r.props.index||!r.props.children,"An index route cannot have child routes.");let a={id:r.props.id||l.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=vv(r.props.children,l)),n.push(a)}),n}var wd="get",Cd="application/x-www-form-urlencoded";function gf(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function U3(e){return gf(e)&&e.tagName.toLowerCase()==="button"}function $3(e){return gf(e)&&e.tagName.toLowerCase()==="form"}function W3(e){return gf(e)&&e.tagName.toLowerCase()==="input"}function q3(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function V3(e,t){return e.button===0&&(!t||t==="_self")&&!q3(e)}var qh=null;function K3(){if(qh===null)try{new FormData(document.createElement("form"),0),qh=!1}catch{qh=!0}return qh}var G3=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function mg(e){return e!=null&&!G3.has(e)?(bi(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Cd}"`),null):e}function Y3(e,t){let n,r,s,l,a;if($3(e)){let u=e.getAttribute("action");r=u?Qi(u,t):null,n=e.getAttribute("method")||wd,s=mg(e.getAttribute("enctype"))||Cd,l=new FormData(e)}else if(U3(e)||W3(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=e.getAttribute("formaction")||u.getAttribute("action");if(r=h?Qi(h,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||wd,s=mg(e.getAttribute("formenctype"))||mg(u.getAttribute("enctype"))||Cd,l=new FormData(u,e),!K3()){let{name:d,type:m,value:p}=e;if(m==="image"){let _=d?`${d}.`:"";l.append(`${_}x`,"0"),l.append(`${_}y`,"0")}else d&&l.append(d,p)}}else{if(gf(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=wd,r=null,s=Cd,a=e}return l&&s==="text/plain"&&(a=l,l=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:l,body:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function G_(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function X3(e,t,n,r){let s=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${r}`:s.pathname=`${s.pathname}.${r}`:s.pathname==="/"?s.pathname=`_root.${r}`:t&&Qi(s.pathname,t)==="/"?s.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${r}`,s}async function Z3(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Q3(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function J3(e,t,n){let r=await Promise.all(e.map(async s=>{let l=t.routes[s.route.id];if(l){let a=await Z3(l,n);return a.links?a.links():[]}return[]}));return r4(r.flat(1).filter(Q3).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function zS(e,t,n,r,s,l){let a=(h,d)=>n[d]?h.route.id!==n[d].route.id:!0,u=(h,d)=>{var m;return n[d].pathname!==h.pathname||((m=n[d].route.path)==null?void 0:m.endsWith("*"))&&n[d].params["*"]!==h.params["*"]};return l==="assets"?t.filter((h,d)=>a(h,d)||u(h,d)):l==="data"?t.filter((h,d)=>{var p;let m=r.routes[h.route.id];if(!m||!m.hasLoader)return!1;if(a(h,d)||u(h,d))return!0;if(h.route.shouldRevalidate){let _=h.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((p=n[0])==null?void 0:p.params)||{},nextUrl:new URL(e,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof _=="boolean")return _}return!0}):[]}function e4(e,t,{includeHydrateFallback:n}={}){return t4(e.map(r=>{let s=t.routes[r.route.id];if(!s)return[];let l=[s.module];return s.clientActionModule&&(l=l.concat(s.clientActionModule)),s.clientLoaderModule&&(l=l.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(l=l.concat(s.hydrateFallbackModule)),s.imports&&(l=l.concat(s.imports)),l}).flat(1))}function t4(e){return[...new Set(e)]}function n4(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function r4(e,t){let n=new Set;return new Set(t),e.reduce((r,s)=>{let l=JSON.stringify(n4(s));return n.has(l)||(n.add(l),r.push({key:l,link:s})),r},[])}function Sk(){let e=x.useContext(ua);return G_(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function i4(){let e=x.useContext(mf);return G_(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Y_=x.createContext(void 0);Y_.displayName="FrameworkContext";function wk(){let e=x.useContext(Y_);return G_(e,"You must render this element inside a <HydratedRouter> element"),e}function s4(e,t){let n=x.useContext(Y_),[r,s]=x.useState(!1),[l,a]=x.useState(!1),{onFocus:u,onBlur:h,onMouseEnter:d,onMouseLeave:m,onTouchStart:p}=t,_=x.useRef(null);x.useEffect(()=>{if(e==="render"&&a(!0),e==="viewport"){let w=k=>{k.forEach(T=>{a(T.isIntersecting)})},C=new IntersectionObserver(w,{threshold:.5});return _.current&&C.observe(_.current),()=>{C.disconnect()}}},[e]),x.useEffect(()=>{if(r){let w=setTimeout(()=>{a(!0)},100);return()=>{clearTimeout(w)}}},[r]);let b=()=>{s(!0)},S=()=>{s(!1),a(!1)};return n?e!=="intent"?[l,_,{}]:[l,_,{onFocus:fc(u,b),onBlur:fc(h,S),onMouseEnter:fc(d,b),onMouseLeave:fc(m,S),onTouchStart:fc(p,b)}]:[!1,_,{}]}function fc(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function o4({page:e,...t}){let{router:n}=Sk(),r=x.useMemo(()=>lk(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?x.createElement(a4,{page:e,matches:r,...t}):null}function l4(e){let{manifest:t,routeModules:n}=wk(),[r,s]=x.useState([]);return x.useEffect(()=>{let l=!1;return J3(e,t,n).then(a=>{l||s(a)}),()=>{l=!0}},[e,t,n]),r}function a4({page:e,matches:t,...n}){let r=Ci(),{future:s,manifest:l,routeModules:a}=wk(),{basename:u}=Sk(),{loaderData:h,matches:d}=i4(),m=x.useMemo(()=>zS(e,t,d,l,r,"data"),[e,t,d,l,r]),p=x.useMemo(()=>zS(e,t,d,l,r,"assets"),[e,t,d,l,r]),_=x.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let w=new Set,C=!1;if(t.forEach(T=>{var D;let R=l.routes[T.route.id];!R||!R.hasLoader||(!m.some(z=>z.route.id===T.route.id)&&T.route.id in h&&((D=a[T.route.id])!=null&&D.shouldRevalidate)||R.hasClientLoader?C=!0:w.add(T.route.id))}),w.size===0)return[];let k=X3(e,u,s.unstable_trailingSlashAwareDataRequests,"data");return C&&w.size>0&&k.searchParams.set("_routes",t.filter(T=>w.has(T.route.id)).map(T=>T.route.id).join(",")),[k.pathname+k.search]},[u,s.unstable_trailingSlashAwareDataRequests,h,r,l,m,t,e,a]),b=x.useMemo(()=>e4(p,l),[p,l]),S=l4(p);return x.createElement(x.Fragment,null,_.map(w=>x.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...n})),b.map(w=>x.createElement("link",{key:w,rel:"modulepreload",href:w,...n})),S.map(({key:w,link:C})=>x.createElement("link",{key:w,nonce:n.nonce,...C,crossOrigin:C.crossOrigin??n.crossOrigin})))}function c4(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var u4=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{u4&&(window.__reactRouterVersion="7.13.1")}catch{}function h4({basename:e,children:t,unstable_useTransitions:n,window:r}){let s=x.useRef();s.current==null&&(s.current=UN({window:r,v5Compat:!0}));let l=s.current,[a,u]=x.useState({action:l.action,location:l.location}),h=x.useCallback(d=>{n===!1?u(d):x.startTransition(()=>u(d))},[n]);return x.useLayoutEffect(()=>l.listen(h),[l,h]),x.createElement(H3,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:l,unstable_useTransitions:n})}var Ck=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,kk=x.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:s,reloadDocument:l,replace:a,unstable_mask:u,state:h,target:d,to:m,preventScrollReset:p,viewTransition:_,unstable_defaultShouldRevalidate:b,...S},w){let{basename:C,navigator:k,unstable_useTransitions:T}=x.useContext(Pr),R=typeof m=="string"&&Ck.test(m),D=dk(m,C);m=D.to;let z=S3(m,{relative:s}),L=Ci(),O=null;if(u){let F=U_(u,[],L.unstable_mask?L.unstable_mask.pathname:"/",!0);C!=="/"&&(F.pathname=F.pathname==="/"?C:vi([C,F.pathname])),O=k.createHref(F)}let[B,X,P]=s4(r,S),q=m4(m,{replace:a,unstable_mask:u,state:h,target:d,preventScrollReset:p,relative:s,viewTransition:_,unstable_defaultShouldRevalidate:b,unstable_useTransitions:T});function H(F){t&&t(F),F.defaultPrevented||q(F)}let U=!(D.isExternal||l),V=x.createElement("a",{...S,...P,href:(U?O:void 0)||D.absoluteURL||z,onClick:U?H:t,ref:c4(w,X),target:d,"data-discover":!R&&n==="render"?"true":void 0});return B&&!R?x.createElement(x.Fragment,null,V,x.createElement(o4,{page:z})):V});kk.displayName="Link";var d4=x.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:s=!1,style:l,to:a,viewTransition:u,children:h,...d},m){let p=hu(a,{relative:d.relative}),_=Ci(),b=x.useContext(mf),{navigator:S,basename:w}=x.useContext(Pr),C=b!=null&&b4(p)&&u===!0,k=S.encodeLocation?S.encodeLocation(p).pathname:p.pathname,T=_.pathname,R=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(T=T.toLowerCase(),R=R?R.toLowerCase():null,k=k.toLowerCase()),R&&w&&(R=Qi(R,w)||R);const D=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let z=T===k||!s&&T.startsWith(k)&&T.charAt(D)==="/",L=R!=null&&(R===k||!s&&R.startsWith(k)&&R.charAt(k.length)==="/"),O={isActive:z,isPending:L,isTransitioning:C},B=z?t:void 0,X;typeof r=="function"?X=r(O):X=[r,z?"active":null,L?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let P=typeof l=="function"?l(O):l;return x.createElement(kk,{...d,"aria-current":B,className:X,ref:m,style:P,to:a,viewTransition:u},typeof h=="function"?h(O):h)});d4.displayName="NavLink";var f4=x.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:s,state:l,method:a=wd,action:u,onSubmit:h,relative:d,preventScrollReset:m,viewTransition:p,unstable_defaultShouldRevalidate:_,...b},S)=>{let{unstable_useTransitions:w}=x.useContext(Pr),C=_4(),k=y4(u,{relative:d}),T=a.toLowerCase()==="get"?"get":"post",R=typeof u=="string"&&Ck.test(u),D=z=>{if(h&&h(z),z.defaultPrevented)return;z.preventDefault();let L=z.nativeEvent.submitter,O=(L==null?void 0:L.getAttribute("formmethod"))||a,B=()=>C(L||z.currentTarget,{fetcherKey:t,method:O,navigate:n,replace:s,state:l,relative:d,preventScrollReset:m,viewTransition:p,unstable_defaultShouldRevalidate:_});w&&n!==!1?x.startTransition(()=>B()):B()};return x.createElement("form",{ref:S,method:T,action:k,onSubmit:r?h:D,...b,"data-discover":!R&&e==="render"?"true":void 0})});f4.displayName="Form";function p4(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ek(e){let t=x.useContext(ua);return wt(t,p4(e)),t}function m4(e,{target:t,replace:n,unstable_mask:r,state:s,preventScrollReset:l,relative:a,viewTransition:u,unstable_defaultShouldRevalidate:h,unstable_useTransitions:d}={}){let m=W_(),p=Ci(),_=hu(e,{relative:a});return x.useCallback(b=>{if(V3(b,t)){b.preventDefault();let S=n!==void 0?n:Wc(p)===Wc(_),w=()=>m(e,{replace:S,unstable_mask:r,state:s,preventScrollReset:l,relative:a,viewTransition:u,unstable_defaultShouldRevalidate:h});d?x.startTransition(()=>w()):w()}},[p,m,_,n,r,s,t,e,l,a,u,h,d])}var g4=0,v4=()=>`__${String(++g4)}__`;function _4(){let{router:e}=Ek("useSubmit"),{basename:t}=x.useContext(Pr),n=z3(),r=e.fetch,s=e.navigate;return x.useCallback(async(l,a={})=>{let{action:u,method:h,encType:d,formData:m,body:p}=Y3(l,t);if(a.navigate===!1){let _=a.fetcherKey||v4();await r(_,n,a.action||u,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:m,body:p,formMethod:a.method||h,formEncType:a.encType||d,flushSync:a.flushSync})}else await s(a.action||u,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:m,body:p,formMethod:a.method||h,formEncType:a.encType||d,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,s,t,n])}function y4(e,{relative:t}={}){let{basename:n}=x.useContext(Pr),r=x.useContext(ei);wt(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),l={...hu(e||".",{relative:t})},a=Ci();if(e==null){l.search=a.search;let u=new URLSearchParams(l.search),h=u.getAll("index");if(h.some(m=>m==="")){u.delete("index"),h.filter(p=>p).forEach(p=>u.append("index",p));let m=u.toString();l.search=m?`?${m}`:""}}return(!e||e===".")&&s.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(l.pathname=l.pathname==="/"?n:vi([n,l.pathname])),Wc(l)}function b4(e,{relative:t}={}){let n=x.useContext(pk);wt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Ek("useViewTransitionState"),s=hu(e,{relative:t});if(!n.isTransitioning)return!1;let l=Qi(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=Qi(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Pd(s.pathname,a)!=null||Pd(s.pathname,l)!=null}var $s=ok();const x4=pf($s);function Rk(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=Rk(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Mk(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Rk(e))&&(r&&(r+=" "),r+=t);return r}const BS=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,jS=Mk,S4=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return jS(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:l}=t,a=Object.keys(s).map(d=>{const m=n==null?void 0:n[d],p=l==null?void 0:l[d];if(m===null)return null;const _=BS(m)||BS(p);return s[d][_]}),u=n&&Object.entries(n).reduce((d,m)=>{let[p,_]=m;return _===void 0||(d[p]=_),d},{}),h=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,m)=>{let{class:p,className:_,...b}=m;return Object.entries(b).every(S=>{let[w,C]=S;return Array.isArray(C)?C.includes({...l,...u}[w]):{...l,...u}[w]===C})?[...d,p,_]:d},[]);return jS(e,a,h,n==null?void 0:n.class,n==null?void 0:n.className)},w4=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},C4=(e,t)=>({classGroupId:e,validator:t}),Tk=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Id="-",PS=[],k4="arbitrary..",E4=e=>{const t=M4(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return R4(a);const u=a.split(Id),h=u[0]===""&&u.length>1?1:0;return Ak(u,h,t)},getConflictingClassGroupIds:(a,u)=>{if(u){const h=r[a],d=n[a];return h?d?w4(d,h):h:d||PS}return n[a]||PS}}},Ak=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],l=n.nextPart.get(s);if(l){const d=Ak(e,t+1,l);if(d)return d}const a=n.validators;if(a===null)return;const u=t===0?e.join(Id):e.slice(t).join(Id),h=a.length;for(let d=0;d<h;d++){const m=a[d];if(m.validator(u))return m.classGroupId}},R4=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?k4+r:void 0})(),M4=e=>{const{theme:t,classGroups:n}=e;return T4(n,t)},T4=(e,t)=>{const n=Tk();for(const r in e){const s=e[r];X_(s,n,r,t)}return n},X_=(e,t,n,r)=>{const s=e.length;for(let l=0;l<s;l++){const a=e[l];A4(a,t,n,r)}},A4=(e,t,n,r)=>{if(typeof e=="string"){D4(e,t,n);return}if(typeof e=="function"){N4(e,t,n,r);return}O4(e,t,n,r)},D4=(e,t,n)=>{const r=e===""?t:Dk(t,e);r.classGroupId=n},N4=(e,t,n,r)=>{if(L4(e)){X_(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(C4(n,e))},O4=(e,t,n,r)=>{const s=Object.entries(e),l=s.length;for(let a=0;a<l;a++){const[u,h]=s[a];X_(h,Dk(t,u),n,r)}},Dk=(e,t)=>{let n=e;const r=t.split(Id),s=r.length;for(let l=0;l<s;l++){const a=r[l];let u=n.nextPart.get(a);u||(u=Tk(),n.nextPart.set(a,u)),n=u}return n},L4=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,z4=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const s=(l,a)=>{n[l]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(l){let a=n[l];if(a!==void 0)return a;if((a=r[l])!==void 0)return s(l,a),a},set(l,a){l in n?n[l]=a:s(l,a)}}},_v="!",IS=":",B4=[],HS=(e,t,n,r,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:s}),j4=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const l=[];let a=0,u=0,h=0,d;const m=s.length;for(let w=0;w<m;w++){const C=s[w];if(a===0&&u===0){if(C===IS){l.push(s.slice(h,w)),h=w+1;continue}if(C==="/"){d=w;continue}}C==="["?a++:C==="]"?a--:C==="("?u++:C===")"&&u--}const p=l.length===0?s:s.slice(h);let _=p,b=!1;p.endsWith(_v)?(_=p.slice(0,-1),b=!0):p.startsWith(_v)&&(_=p.slice(1),b=!0);const S=d&&d>h?d-h:void 0;return HS(l,b,_,S)};if(t){const s=t+IS,l=r;r=a=>a.startsWith(s)?l(a.slice(s.length)):HS(B4,!1,a,void 0,!0)}if(n){const s=r;r=l=>n({className:l,parseClassName:s})}return r},P4=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let s=[];for(let l=0;l<n.length;l++){const a=n[l],u=a[0]==="[",h=t.has(a);u||h?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(a)):s.push(a)}return s.length>0&&(s.sort(),r.push(...s)),r}},I4=e=>({cache:z4(e.cacheSize),parseClassName:j4(e),sortModifiers:P4(e),...E4(e)}),H4=/\s+/,F4=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:l}=t,a=[],u=e.trim().split(H4);let h="";for(let d=u.length-1;d>=0;d-=1){const m=u[d],{isExternal:p,modifiers:_,hasImportantModifier:b,baseClassName:S,maybePostfixModifierPosition:w}=n(m);if(p){h=m+(h.length>0?" "+h:h);continue}let C=!!w,k=r(C?S.substring(0,w):S);if(!k){if(!C){h=m+(h.length>0?" "+h:h);continue}if(k=r(S),!k){h=m+(h.length>0?" "+h:h);continue}C=!1}const T=_.length===0?"":_.length===1?_[0]:l(_).join(":"),R=b?T+_v:T,D=R+k;if(a.indexOf(D)>-1)continue;a.push(D);const z=s(k,C);for(let L=0;L<z.length;++L){const O=z[L];a.push(R+O)}h=m+(h.length>0?" "+h:h)}return h},U4=(...e)=>{let t=0,n,r,s="";for(;t<e.length;)(n=e[t++])&&(r=Nk(n))&&(s&&(s+=" "),s+=r);return s},Nk=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Nk(e[r]))&&(n&&(n+=" "),n+=t);return n},$4=(e,...t)=>{let n,r,s,l;const a=h=>{const d=t.reduce((m,p)=>p(m),e());return n=I4(d),r=n.cache.get,s=n.cache.set,l=u,u(h)},u=h=>{const d=r(h);if(d)return d;const m=F4(h,n);return s(h,m),m};return l=a,(...h)=>l(U4(...h))},W4=[],Kt=e=>{const t=n=>n[e]||W4;return t.isThemeGetter=!0,t},Ok=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Lk=/^\((?:(\w[\w-]*):)?(.+)\)$/i,q4=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,V4=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,K4=/\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$/,G4=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Y4=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,X4=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Os=e=>q4.test(e),He=e=>!!e&&!Number.isNaN(Number(e)),Ls=e=>!!e&&Number.isInteger(Number(e)),gg=e=>e.endsWith("%")&&He(e.slice(0,-1)),Ki=e=>V4.test(e),zk=()=>!0,Z4=e=>K4.test(e)&&!G4.test(e),Z_=()=>!1,Q4=e=>Y4.test(e),J4=e=>X4.test(e),eO=e=>!xe(e)&&!Se(e),tO=e=>Zs(e,Pk,Z_),xe=e=>Ok.test(e),xo=e=>Zs(e,Ik,Z4),FS=e=>Zs(e,cO,He),nO=e=>Zs(e,Fk,zk),rO=e=>Zs(e,Hk,Z_),US=e=>Zs(e,Bk,Z_),iO=e=>Zs(e,jk,J4),Vh=e=>Zs(e,Uk,Q4),Se=e=>Lk.test(e),pc=e=>Uo(e,Ik),sO=e=>Uo(e,Hk),$S=e=>Uo(e,Bk),oO=e=>Uo(e,Pk),lO=e=>Uo(e,jk),Kh=e=>Uo(e,Uk,!0),aO=e=>Uo(e,Fk,!0),Zs=(e,t,n)=>{const r=Ok.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Uo=(e,t,n=!1)=>{const r=Lk.exec(e);return r?r[1]?t(r[1]):n:!1},Bk=e=>e==="position"||e==="percentage",jk=e=>e==="image"||e==="url",Pk=e=>e==="length"||e==="size"||e==="bg-size",Ik=e=>e==="length",cO=e=>e==="number",Hk=e=>e==="family-name",Fk=e=>e==="number"||e==="weight",Uk=e=>e==="shadow",uO=()=>{const e=Kt("color"),t=Kt("font"),n=Kt("text"),r=Kt("font-weight"),s=Kt("tracking"),l=Kt("leading"),a=Kt("breakpoint"),u=Kt("container"),h=Kt("spacing"),d=Kt("radius"),m=Kt("shadow"),p=Kt("inset-shadow"),_=Kt("text-shadow"),b=Kt("drop-shadow"),S=Kt("blur"),w=Kt("perspective"),C=Kt("aspect"),k=Kt("ease"),T=Kt("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],z=()=>[...D(),Se,xe],L=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto","contain","none"],B=()=>[Se,xe,h],X=()=>[Os,"full","auto",...B()],P=()=>[Ls,"none","subgrid",Se,xe],q=()=>["auto",{span:["full",Ls,Se,xe]},Ls,Se,xe],H=()=>[Ls,"auto",Se,xe],U=()=>["auto","min","max","fr",Se,xe],V=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],F=()=>["start","end","center","stretch","center-safe","end-safe"],j=()=>["auto",...B()],K=()=>[Os,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...B()],$=()=>[Os,"screen","full","dvw","lvw","svw","min","max","fit",...B()],J=()=>[Os,"screen","full","lh","dvh","lvh","svh","min","max","fit",...B()],A=()=>[e,Se,xe],I=()=>[...D(),$S,US,{position:[Se,xe]}],Y=()=>["no-repeat",{repeat:["","x","y","space","round"]}],M=()=>["auto","cover","contain",oO,tO,{size:[Se,xe]}],Z=()=>[gg,pc,xo],ae=()=>["","none","full",d,Se,xe],se=()=>["",He,pc,xo],pe=()=>["solid","dashed","dotted","double"],ke=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],me=()=>[He,gg,$S,US],Ee=()=>["","none",S,Se,xe],et=()=>["none",He,Se,xe],Ge=()=>["none",He,Se,xe],Me=()=>[He,Se,xe],Xe=()=>[Os,"full",...B()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ki],breakpoint:[Ki],color:[zk],container:[Ki],"drop-shadow":[Ki],ease:["in","out","in-out"],font:[eO],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ki],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ki],shadow:[Ki],spacing:["px",He],text:[Ki],"text-shadow":[Ki],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Os,xe,Se,C]}],container:["container"],columns:[{columns:[He,xe,Se,u]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"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:z()}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:X()}],"inset-x":[{"inset-x":X()}],"inset-y":[{"inset-y":X()}],start:[{"inset-s":X(),start:X()}],end:[{"inset-e":X(),end:X()}],"inset-bs":[{"inset-bs":X()}],"inset-be":[{"inset-be":X()}],top:[{top:X()}],right:[{right:X()}],bottom:[{bottom:X()}],left:[{left:X()}],visibility:["visible","invisible","collapse"],z:[{z:[Ls,"auto",Se,xe]}],basis:[{basis:[Os,"full","auto",u,...B()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[He,Os,"auto","initial","none",xe]}],grow:[{grow:["",He,Se,xe]}],shrink:[{shrink:["",He,Se,xe]}],order:[{order:[Ls,"first","last","none",Se,xe]}],"grid-cols":[{"grid-cols":P()}],"col-start-end":[{col:q()}],"col-start":[{"col-start":H()}],"col-end":[{"col-end":H()}],"grid-rows":[{"grid-rows":P()}],"row-start-end":[{row:q()}],"row-start":[{"row-start":H()}],"row-end":[{"row-end":H()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":U()}],"auto-rows":[{"auto-rows":U()}],gap:[{gap:B()}],"gap-x":[{"gap-x":B()}],"gap-y":[{"gap-y":B()}],"justify-content":[{justify:[...V(),"normal"]}],"justify-items":[{"justify-items":[...F(),"normal"]}],"justify-self":[{"justify-self":["auto",...F()]}],"align-content":[{content:["normal",...V()]}],"align-items":[{items:[...F(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...F(),{baseline:["","last"]}]}],"place-content":[{"place-content":V()}],"place-items":[{"place-items":[...F(),"baseline"]}],"place-self":[{"place-self":["auto",...F()]}],p:[{p:B()}],px:[{px:B()}],py:[{py:B()}],ps:[{ps:B()}],pe:[{pe:B()}],pbs:[{pbs:B()}],pbe:[{pbe:B()}],pt:[{pt:B()}],pr:[{pr:B()}],pb:[{pb:B()}],pl:[{pl:B()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mbs:[{mbs:j()}],mbe:[{mbe:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":B()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":B()}],"space-y-reverse":["space-y-reverse"],size:[{size:K()}],"inline-size":[{inline:["auto",...$()]}],"min-inline-size":[{"min-inline":["auto",...$()]}],"max-inline-size":[{"max-inline":["none",...$()]}],"block-size":[{block:["auto",...J()]}],"min-block-size":[{"min-block":["auto",...J()]}],"max-block-size":[{"max-block":["none",...J()]}],w:[{w:[u,"screen",...K()]}],"min-w":[{"min-w":[u,"screen","none",...K()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[a]},...K()]}],h:[{h:["screen","lh",...K()]}],"min-h":[{"min-h":["screen","lh","none",...K()]}],"max-h":[{"max-h":["screen","lh",...K()]}],"font-size":[{text:["base",n,pc,xo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,aO,nO]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",gg,xe]}],"font-family":[{font:[sO,rO,t]}],"font-features":[{"font-features":[xe]}],"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:[s,Se,xe]}],"line-clamp":[{"line-clamp":[He,"none",Se,FS]}],leading:[{leading:[l,...B()]}],"list-image":[{"list-image":["none",Se,xe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Se,xe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...pe(),"wavy"]}],"text-decoration-thickness":[{decoration:[He,"from-font","auto",Se,xo]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[He,"auto",Se,xe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Se,xe]}],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",Se,xe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:Y()}],"bg-size":[{bg:M()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ls,Se,xe],radial:["",Se,xe],conic:[Ls,Se,xe]},lO,iO]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:Z()}],"gradient-via-pos":[{via:Z()}],"gradient-to-pos":[{to:Z()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:ae()}],"rounded-s":[{"rounded-s":ae()}],"rounded-e":[{"rounded-e":ae()}],"rounded-t":[{"rounded-t":ae()}],"rounded-r":[{"rounded-r":ae()}],"rounded-b":[{"rounded-b":ae()}],"rounded-l":[{"rounded-l":ae()}],"rounded-ss":[{"rounded-ss":ae()}],"rounded-se":[{"rounded-se":ae()}],"rounded-ee":[{"rounded-ee":ae()}],"rounded-es":[{"rounded-es":ae()}],"rounded-tl":[{"rounded-tl":ae()}],"rounded-tr":[{"rounded-tr":ae()}],"rounded-br":[{"rounded-br":ae()}],"rounded-bl":[{"rounded-bl":ae()}],"border-w":[{border:se()}],"border-w-x":[{"border-x":se()}],"border-w-y":[{"border-y":se()}],"border-w-s":[{"border-s":se()}],"border-w-e":[{"border-e":se()}],"border-w-bs":[{"border-bs":se()}],"border-w-be":[{"border-be":se()}],"border-w-t":[{"border-t":se()}],"border-w-r":[{"border-r":se()}],"border-w-b":[{"border-b":se()}],"border-w-l":[{"border-l":se()}],"divide-x":[{"divide-x":se()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":se()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...pe(),"hidden","none"]}],"divide-style":[{divide:[...pe(),"hidden","none"]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-bs":[{"border-bs":A()}],"border-color-be":[{"border-be":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...pe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[He,Se,xe]}],"outline-w":[{outline:["",He,pc,xo]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",m,Kh,Vh]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",p,Kh,Vh]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[He,xo]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":se()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",_,Kh,Vh]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[He,Se,xe]}],"mix-blend":[{"mix-blend":[...ke(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ke()}],"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":[He]}],"mask-image-linear-from-pos":[{"mask-linear-from":me()}],"mask-image-linear-to-pos":[{"mask-linear-to":me()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":me()}],"mask-image-t-to-pos":[{"mask-t-to":me()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":me()}],"mask-image-r-to-pos":[{"mask-r-to":me()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":me()}],"mask-image-b-to-pos":[{"mask-b-to":me()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":me()}],"mask-image-l-to-pos":[{"mask-l-to":me()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":me()}],"mask-image-x-to-pos":[{"mask-x-to":me()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":me()}],"mask-image-y-to-pos":[{"mask-y-to":me()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[Se,xe]}],"mask-image-radial-from-pos":[{"mask-radial-from":me()}],"mask-image-radial-to-pos":[{"mask-radial-to":me()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"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":D()}],"mask-image-conic-pos":[{"mask-conic":[He]}],"mask-image-conic-from-pos":[{"mask-conic-from":me()}],"mask-image-conic-to-pos":[{"mask-conic-to":me()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:Y()}],"mask-size":[{mask:M()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Se,xe]}],filter:[{filter:["","none",Se,xe]}],blur:[{blur:Ee()}],brightness:[{brightness:[He,Se,xe]}],contrast:[{contrast:[He,Se,xe]}],"drop-shadow":[{"drop-shadow":["","none",b,Kh,Vh]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",He,Se,xe]}],"hue-rotate":[{"hue-rotate":[He,Se,xe]}],invert:[{invert:["",He,Se,xe]}],saturate:[{saturate:[He,Se,xe]}],sepia:[{sepia:["",He,Se,xe]}],"backdrop-filter":[{"backdrop-filter":["","none",Se,xe]}],"backdrop-blur":[{"backdrop-blur":Ee()}],"backdrop-brightness":[{"backdrop-brightness":[He,Se,xe]}],"backdrop-contrast":[{"backdrop-contrast":[He,Se,xe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",He,Se,xe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[He,Se,xe]}],"backdrop-invert":[{"backdrop-invert":["",He,Se,xe]}],"backdrop-opacity":[{"backdrop-opacity":[He,Se,xe]}],"backdrop-saturate":[{"backdrop-saturate":[He,Se,xe]}],"backdrop-sepia":[{"backdrop-sepia":["",He,Se,xe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":B()}],"border-spacing-x":[{"border-spacing-x":B()}],"border-spacing-y":[{"border-spacing-y":B()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Se,xe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[He,"initial",Se,xe]}],ease:[{ease:["linear","initial",k,Se,xe]}],delay:[{delay:[He,Se,xe]}],animate:[{animate:["none",T,Se,xe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Se,xe]}],"perspective-origin":[{"perspective-origin":z()}],rotate:[{rotate:et()}],"rotate-x":[{"rotate-x":et()}],"rotate-y":[{"rotate-y":et()}],"rotate-z":[{"rotate-z":et()}],scale:[{scale:Ge()}],"scale-x":[{"scale-x":Ge()}],"scale-y":[{"scale-y":Ge()}],"scale-z":[{"scale-z":Ge()}],"scale-3d":["scale-3d"],skew:[{skew:Me()}],"skew-x":[{"skew-x":Me()}],"skew-y":[{"skew-y":Me()}],transform:[{transform:[Se,xe,"","none","gpu","cpu"]}],"transform-origin":[{origin:z()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Xe()}],"translate-x":[{"translate-x":Xe()}],"translate-y":[{"translate-y":Xe()}],"translate-z":[{"translate-z":Xe()}],"translate-none":["translate-none"],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"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",Se,xe]}],"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":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mbs":[{"scroll-mbs":B()}],"scroll-mbe":[{"scroll-mbe":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pbs":[{"scroll-pbs":B()}],"scroll-pbe":[{"scroll-pbe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"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",Se,xe]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[He,pc,xo,FS]}],stroke:[{stroke:["none",...A()]}],"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"]}},hO=$4(uO);function ye(...e){return hO(Mk(e))}function WS(e){return e.startsWith("chatId:")?e.slice(7):e}const dO=S4("touch-manipulation inline-flex items-center justify-center whitespace-nowrap cursor-pointer rounded-md text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none",{variants:{variant:{default:"bg-primary text-primary-foreground disabled:bg-primary/50 disabled:text-primary-foreground/90 hover:bg-primary/90",juicy:"bg-logo text-primary-foreground disabled:text-primary-foreground/50 hover:bg-logo/90",destructive:"bg-destructive/80 dark:text-white",outline:"border disabled:bg-transparent disabled:text-foreground/50 border-inpu disabled:border-input/90 bg-card hover:bg-muted hover:text-accent-foreground",secondary:"bg-transparent border border-border text-secondary-foreground hover:text-secondary-foreground/60 disabled:text-secondary-foreground/50",ghost:"hover:bg-accent dark:hover:bg-card hover:text-accent-foreground text-muted-foreground disabled:text-muted-foreground/50 border border-border/0 hover:border-border",link:"text-primary disabled:text-primary/50 underline-offset-4 hover:underline",none:""},size:{default:"h-10 px-4 rounded-full py-2",sm:"h-9 rounded-full px-3",lg:"h-11 rounded-full px-8",icon:"h-10 w-10 rounded-lg","icon-sm":"h-5.5 w-5.5 rounded-md"}},defaultVariants:{variant:"default",size:"default"}}),Ke=x.forwardRef(({className:e,variant:t,size:n,...r},s)=>v.jsx("button",{className:ye(dO({variant:t,size:n,className:e})),ref:s,...r}));Ke.displayName="Button";function Ne(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function qS(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Q_(...e){return t=>{let n=!1;const r=e.map(s=>{const l=qS(s,t);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let s=0;s<r.length;s++){const l=r[s];typeof l=="function"?l():qS(e[s],null)}}}}function Bt(...e){return x.useCallback(Q_(...e),e)}function fO(e,t){const n=x.createContext(t),r=l=>{const{children:a,...u}=l,h=x.useMemo(()=>u,Object.values(u));return v.jsx(n.Provider,{value:h,children:a})};r.displayName=e+"Provider";function s(l){const a=x.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${l}\` must be used within \`${e}\``)}return[r,s]}function Qs(e,t=[]){let n=[];function r(l,a){const u=x.createContext(a),h=n.length;n=[...n,a];const d=p=>{var k;const{scope:_,children:b,...S}=p,w=((k=_==null?void 0:_[e])==null?void 0:k[h])||u,C=x.useMemo(()=>S,Object.values(S));return v.jsx(w.Provider,{value:C,children:b})};d.displayName=l+"Provider";function m(p,_){var w;const b=((w=_==null?void 0:_[e])==null?void 0:w[h])||u,S=x.useContext(b);if(S)return S;if(a!==void 0)return a;throw new Error(`\`${p}\` must be used within \`${l}\``)}return[d,m]}const s=()=>{const l=n.map(a=>x.createContext(a));return function(u){const h=(u==null?void 0:u[e])||l;return x.useMemo(()=>({[`__scope${e}`]:{...u,[e]:h}}),[u,h])}};return s.scopeName=e,[r,pO(s,...t)]}function pO(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(l){const a=r.reduce((u,{useScope:h,scopeName:d})=>{const p=h(l)[`__scope${d}`];return{...u,...p}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}var Ks=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},mO=sk[" useId ".trim().toString()]||(()=>{}),gO=0;function Kl(e){const[t,n]=x.useState(mO());return Ks(()=>{n(r=>r??String(gO++))},[e]),t?`radix-${t}`:""}var vO=sk[" useInsertionEffect ".trim().toString()]||Ks;function vf({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,l,a]=_O({defaultProp:t,onChange:n}),u=e!==void 0,h=u?e:s;{const m=x.useRef(e!==void 0);x.useEffect(()=>{const p=m.current;p!==u&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${u?"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.`),m.current=u},[u,r])}const d=x.useCallback(m=>{var p;if(u){const _=yO(m)?m(e):m;_!==e&&((p=a.current)==null||p.call(a,_))}else l(m)},[u,e,l,a]);return[h,d]}function _O({defaultProp:e,onChange:t}){const[n,r]=x.useState(e),s=x.useRef(n),l=x.useRef(t);return vO(()=>{l.current=t},[t]),x.useEffect(()=>{var a;s.current!==n&&((a=l.current)==null||a.call(l,n),s.current=n)},[n,s]),[n,r,l]}function yO(e){return typeof e=="function"}function ea(e){const t=bO(e),n=x.forwardRef((r,s)=>{const{children:l,...a}=r,u=x.Children.toArray(l),h=u.find(SO);if(h){const d=h.props.children,m=u.map(p=>p===h?x.Children.count(d)>1?x.Children.only(null):x.isValidElement(d)?d.props.children:null:p);return v.jsx(t,{...a,ref:s,children:x.isValidElement(d)?x.cloneElement(d,void 0,m):null})}return v.jsx(t,{...a,ref:s,children:l})});return n.displayName=`${e}.Slot`,n}function bO(e){const t=x.forwardRef((n,r)=>{const{children:s,...l}=n;if(x.isValidElement(s)){const a=CO(s),u=wO(l,s.props);return s.type!==x.Fragment&&(u.ref=r?Q_(r,a):a),x.cloneElement(s,u)}return x.Children.count(s)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var $k=Symbol("radix.slottable");function xO(e){const t=({children:n})=>v.jsx(v.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=$k,t}function SO(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===$k}function wO(e,t){const n={...t};for(const r in t){const s=e[r],l=t[r];/^on[A-Z]/.test(r)?s&&l?n[r]=(...u)=>{const h=l(...u);return s(...u),h}:s&&(n[r]=s):r==="style"?n[r]={...s,...l}:r==="className"&&(n[r]=[s,l].filter(Boolean).join(" "))}return{...e,...n}}function CO(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var kO=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],bt=kO.reduce((e,t)=>{const n=ea(`Primitive.${t}`),r=x.forwardRef((s,l)=>{const{asChild:a,...u}=s,h=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),v.jsx(h,{...u,ref:l})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Wk(e,t){e&&$s.flushSync(()=>e.dispatchEvent(t))}function xi(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function EO(e,t=globalThis==null?void 0:globalThis.document){const n=xi(e);x.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var RO="DismissableLayer",yv="dismissableLayer.update",MO="dismissableLayer.pointerDownOutside",TO="dismissableLayer.focusOutside",VS,qk=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),du=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:l,onInteractOutside:a,onDismiss:u,...h}=e,d=x.useContext(qk),[m,p]=x.useState(null),_=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=x.useState({}),S=Bt(t,O=>p(O)),w=Array.from(d.layers),[C]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),k=w.indexOf(C),T=m?w.indexOf(m):-1,R=d.layersWithOutsidePointerEventsDisabled.size>0,D=T>=k,z=NO(O=>{const B=O.target,X=[...d.branches].some(P=>P.contains(B));!D||X||(s==null||s(O),a==null||a(O),O.defaultPrevented||u==null||u())},_),L=OO(O=>{const B=O.target;[...d.branches].some(P=>P.contains(B))||(l==null||l(O),a==null||a(O),O.defaultPrevented||u==null||u())},_);return EO(O=>{T===d.layers.size-1&&(r==null||r(O),!O.defaultPrevented&&u&&(O.preventDefault(),u()))},_),x.useEffect(()=>{if(m)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(VS=_.body.style.pointerEvents,_.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(m)),d.layers.add(m),KS(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(_.body.style.pointerEvents=VS)}},[m,_,n,d]),x.useEffect(()=>()=>{m&&(d.layers.delete(m),d.layersWithOutsidePointerEventsDisabled.delete(m),KS())},[m,d]),x.useEffect(()=>{const O=()=>b({});return document.addEventListener(yv,O),()=>document.removeEventListener(yv,O)},[]),v.jsx(bt.div,{...h,ref:S,style:{pointerEvents:R?D?"auto":"none":void 0,...e.style},onFocusCapture:Ne(e.onFocusCapture,L.onFocusCapture),onBlurCapture:Ne(e.onBlurCapture,L.onBlurCapture),onPointerDownCapture:Ne(e.onPointerDownCapture,z.onPointerDownCapture)})});du.displayName=RO;var AO="DismissableLayerBranch",DO=x.forwardRef((e,t)=>{const n=x.useContext(qk),r=x.useRef(null),s=Bt(t,r);return x.useEffect(()=>{const l=r.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),v.jsx(bt.div,{...e,ref:s})});DO.displayName=AO;function NO(e,t=globalThis==null?void 0:globalThis.document){const n=xi(e),r=x.useRef(!1),s=x.useRef(()=>{});return x.useEffect(()=>{const l=u=>{if(u.target&&!r.current){let h=function(){Vk(MO,n,d,{discrete:!0})};const d={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=h,t.addEventListener("click",s.current,{once:!0})):h()}else t.removeEventListener("click",s.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",l),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function OO(e,t=globalThis==null?void 0:globalThis.document){const n=xi(e),r=x.useRef(!1);return x.useEffect(()=>{const s=l=>{l.target&&!r.current&&Vk(TO,n,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function KS(){const e=new CustomEvent(yv);document.dispatchEvent(e)}function Vk(e,t,n,{discrete:r}){const s=n.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?Wk(s,l):s.dispatchEvent(l)}var vg="focusScope.autoFocusOnMount",_g="focusScope.autoFocusOnUnmount",GS={bubbles:!1,cancelable:!0},LO="FocusScope",_f=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:l,...a}=e,[u,h]=x.useState(null),d=xi(s),m=xi(l),p=x.useRef(null),_=Bt(t,w=>h(w)),b=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let w=function(R){if(b.paused||!u)return;const D=R.target;u.contains(D)?p.current=D:Is(p.current,{select:!0})},C=function(R){if(b.paused||!u)return;const D=R.relatedTarget;D!==null&&(u.contains(D)||Is(p.current,{select:!0}))},k=function(R){if(document.activeElement===document.body)for(const z of R)z.removedNodes.length>0&&Is(u)};document.addEventListener("focusin",w),document.addEventListener("focusout",C);const T=new MutationObserver(k);return u&&T.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",C),T.disconnect()}}},[r,u,b.paused]),x.useEffect(()=>{if(u){XS.add(b);const w=document.activeElement;if(!u.contains(w)){const k=new CustomEvent(vg,GS);u.addEventListener(vg,d),u.dispatchEvent(k),k.defaultPrevented||(zO(HO(Kk(u)),{select:!0}),document.activeElement===w&&Is(u))}return()=>{u.removeEventListener(vg,d),setTimeout(()=>{const k=new CustomEvent(_g,GS);u.addEventListener(_g,m),u.dispatchEvent(k),k.defaultPrevented||Is(w??document.body,{select:!0}),u.removeEventListener(_g,m),XS.remove(b)},0)}}},[u,d,m,b]);const S=x.useCallback(w=>{if(!n&&!r||b.paused)return;const C=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,k=document.activeElement;if(C&&k){const T=w.currentTarget,[R,D]=BO(T);R&&D?!w.shiftKey&&k===D?(w.preventDefault(),n&&Is(R,{select:!0})):w.shiftKey&&k===R&&(w.preventDefault(),n&&Is(D,{select:!0})):k===T&&w.preventDefault()}},[n,r,b.paused]);return v.jsx(bt.div,{tabIndex:-1,...a,ref:_,onKeyDown:S})});_f.displayName=LO;function zO(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Is(r,{select:t}),document.activeElement!==n)return}function BO(e){const t=Kk(e),n=YS(t,e),r=YS(t.reverse(),e);return[n,r]}function Kk(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function YS(e,t){for(const n of e)if(!jO(n,{upTo:t}))return n}function jO(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function PO(e){return e instanceof HTMLInputElement&&"select"in e}function Is(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&PO(e)&&t&&e.select()}}var XS=IO();function IO(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=ZS(e,t),e.unshift(t)},remove(t){var n;e=ZS(e,t),(n=e[0])==null||n.resume()}}}function ZS(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function HO(e){return e.filter(t=>t.tagName!=="A")}var FO="Portal",fu=x.forwardRef((e,t)=>{var u;const{container:n,...r}=e,[s,l]=x.useState(!1);Ks(()=>l(!0),[]);const a=n||s&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return a?x4.createPortal(v.jsx(bt.div,{...r,ref:t}),a):null});fu.displayName=FO;function UO(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var Ir=e=>{const{present:t,children:n}=e,r=$O(t),s=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),l=Bt(r.ref,WO(s));return typeof n=="function"||r.isPresent?x.cloneElement(s,{ref:l}):null};Ir.displayName="Presence";function $O(e){const[t,n]=x.useState(),r=x.useRef(null),s=x.useRef(e),l=x.useRef("none"),a=e?"mounted":"unmounted",[u,h]=UO(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const d=Gh(r.current);l.current=u==="mounted"?d:"none"},[u]),Ks(()=>{const d=r.current,m=s.current;if(m!==e){const _=l.current,b=Gh(d);e?h("MOUNT"):b==="none"||(d==null?void 0:d.display)==="none"?h("UNMOUNT"):h(m&&_!==b?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,h]),Ks(()=>{if(t){let d;const m=t.ownerDocument.defaultView??window,p=b=>{const w=Gh(r.current).includes(CSS.escape(b.animationName));if(b.target===t&&w&&(h("ANIMATION_END"),!s.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",d=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},_=b=>{b.target===t&&(l.current=Gh(r.current))};return t.addEventListener("animationstart",_),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{m.clearTimeout(d),t.removeEventListener("animationstart",_),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else h("ANIMATION_END")},[t,h]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:x.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function Gh(e){return(e==null?void 0:e.animationName)||"none"}function WO(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var yg=0;function J_(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??QS()),document.body.insertAdjacentElement("beforeend",e[1]??QS()),yg++,()=>{yg===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),yg--}},[])}function QS(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var fi=function(){return fi=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},fi.apply(this,arguments)};function Gk(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function qO(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,l;r<s;r++)(l||!(r in t))&&(l||(l=Array.prototype.slice.call(t,0,r)),l[r]=t[r]);return e.concat(l||Array.prototype.slice.call(t))}var kd="right-scroll-bar-position",Ed="width-before-scroll-bar",VO="with-scroll-bars-hidden",KO="--removed-body-scroll-bar-size";function bg(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function GO(e,t){var n=x.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var YO=typeof window<"u"?x.useLayoutEffect:x.useEffect,JS=new WeakMap;function XO(e,t){var n=GO(null,function(r){return e.forEach(function(s){return bg(s,r)})});return YO(function(){var r=JS.get(n);if(r){var s=new Set(r),l=new Set(e),a=n.current;s.forEach(function(u){l.has(u)||bg(u,null)}),l.forEach(function(u){s.has(u)||bg(u,a)})}JS.set(n,e)},[e]),n}function ZO(e){return e}function QO(e,t){t===void 0&&(t=ZO);var n=[],r=!1,s={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]:e},useMedium:function(l){var a=t(l,r);return n.push(a),function(){n=n.filter(function(u){return u!==a})}},assignSyncMedium:function(l){for(r=!0;n.length;){var a=n;n=[],a.forEach(l)}n={push:function(u){return l(u)},filter:function(){return n}}},assignMedium:function(l){r=!0;var a=[];if(n.length){var u=n;n=[],u.forEach(l),a=n}var h=function(){var m=a;a=[],m.forEach(l)},d=function(){return Promise.resolve().then(h)};d(),n={push:function(m){a.push(m),d()},filter:function(m){return a=a.filter(m),n}}}};return s}function JO(e){e===void 0&&(e={});var t=QO(null);return t.options=fi({async:!0,ssr:!1},e),t}var Yk=function(e){var t=e.sideCar,n=Gk(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return x.createElement(r,fi({},n))};Yk.isSideCarExport=!0;function eL(e,t){return e.useMedium(t),Yk}var Xk=JO(),xg=function(){},yf=x.forwardRef(function(e,t){var n=x.useRef(null),r=x.useState({onScrollCapture:xg,onWheelCapture:xg,onTouchMoveCapture:xg}),s=r[0],l=r[1],a=e.forwardProps,u=e.children,h=e.className,d=e.removeScrollBar,m=e.enabled,p=e.shards,_=e.sideCar,b=e.noRelative,S=e.noIsolation,w=e.inert,C=e.allowPinchZoom,k=e.as,T=k===void 0?"div":k,R=e.gapMode,D=Gk(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),z=_,L=XO([n,t]),O=fi(fi({},D),s);return x.createElement(x.Fragment,null,m&&x.createElement(z,{sideCar:Xk,removeScrollBar:d,shards:p,noRelative:b,noIsolation:S,inert:w,setCallbacks:l,allowPinchZoom:!!C,lockRef:n,gapMode:R}),a?x.cloneElement(x.Children.only(u),fi(fi({},O),{ref:L})):x.createElement(T,fi({},O,{className:h,ref:L}),u))});yf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};yf.classNames={fullWidth:Ed,zeroRight:kd};var tL=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function nL(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=tL();return t&&e.setAttribute("nonce",t),e}function rL(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function iL(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var sL=function(){var e=0,t=null;return{add:function(n){e==0&&(t=nL())&&(rL(t,n),iL(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},oL=function(){var e=sL();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Zk=function(){var e=oL(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},lL={left:0,top:0,right:0,gap:0},Sg=function(e){return parseInt(e||"",10)||0},aL=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[Sg(n),Sg(r),Sg(s)]},cL=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return lL;var t=aL(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},uL=Zk(),Gl="data-scroll-locked",hL=function(e,t,n,r){var s=e.left,l=e.top,a=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
|
61
|
-
.`.concat(VO,` {
|
|
62
|
-
overflow: hidden `).concat(r,`;
|
|
63
|
-
padding-right: `).concat(u,"px ").concat(r,`;
|
|
64
|
-
}
|
|
65
|
-
body[`).concat(Gl,`] {
|
|
66
|
-
overflow: hidden `).concat(r,`;
|
|
67
|
-
overscroll-behavior: contain;
|
|
68
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
69
|
-
padding-left: `.concat(s,`px;
|
|
70
|
-
padding-top: `).concat(l,`px;
|
|
71
|
-
padding-right: `).concat(a,`px;
|
|
72
|
-
margin-left:0;
|
|
73
|
-
margin-top:0;
|
|
74
|
-
margin-right: `).concat(u,"px ").concat(r,`;
|
|
75
|
-
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.`).concat(kd,` {
|
|
79
|
-
right: `).concat(u,"px ").concat(r,`;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.`).concat(Ed,` {
|
|
83
|
-
margin-right: `).concat(u,"px ").concat(r,`;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
.`).concat(kd," .").concat(kd,` {
|
|
87
|
-
right: 0 `).concat(r,`;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.`).concat(Ed," .").concat(Ed,` {
|
|
91
|
-
margin-right: 0 `).concat(r,`;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
body[`).concat(Gl,`] {
|
|
95
|
-
`).concat(KO,": ").concat(u,`px;
|
|
96
|
-
}
|
|
97
|
-
`)},ew=function(){var e=parseInt(document.body.getAttribute(Gl)||"0",10);return isFinite(e)?e:0},dL=function(){x.useEffect(function(){return document.body.setAttribute(Gl,(ew()+1).toString()),function(){var e=ew()-1;e<=0?document.body.removeAttribute(Gl):document.body.setAttribute(Gl,e.toString())}},[])},fL=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;dL();var l=x.useMemo(function(){return cL(s)},[s]);return x.createElement(uL,{styles:hL(l,!t,s,n?"":"!important")})},bv=!1;if(typeof window<"u")try{var Yh=Object.defineProperty({},"passive",{get:function(){return bv=!0,!0}});window.addEventListener("test",Yh,Yh),window.removeEventListener("test",Yh,Yh)}catch{bv=!1}var zl=bv?{passive:!1}:!1,pL=function(e){return e.tagName==="TEXTAREA"},Qk=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!pL(e)&&n[t]==="visible")},mL=function(e){return Qk(e,"overflowY")},gL=function(e){return Qk(e,"overflowX")},tw=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=Jk(e,r);if(s){var l=eE(e,r),a=l[1],u=l[2];if(a>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},vL=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},_L=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Jk=function(e,t){return e==="v"?mL(t):gL(t)},eE=function(e,t){return e==="v"?vL(t):_L(t)},yL=function(e,t){return e==="h"&&t==="rtl"?-1:1},bL=function(e,t,n,r,s){var l=yL(e,window.getComputedStyle(t).direction),a=l*r,u=n.target,h=t.contains(u),d=!1,m=a>0,p=0,_=0;do{if(!u)break;var b=eE(e,u),S=b[0],w=b[1],C=b[2],k=w-C-l*S;(S||k)&&Jk(e,u)&&(p+=k,_+=S);var T=u.parentNode;u=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}while(!h&&u!==document.body||h&&(t.contains(u)||t===u));return(m&&Math.abs(p)<1||!m&&Math.abs(_)<1)&&(d=!0),d},Xh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},nw=function(e){return[e.deltaX,e.deltaY]},rw=function(e){return e&&"current"in e?e.current:e},xL=function(e,t){return e[0]===t[0]&&e[1]===t[1]},SL=function(e){return`
|
|
98
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
99
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
100
|
-
`)},wL=0,Bl=[];function CL(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),s=x.useState(wL++)[0],l=x.useState(Zk)[0],a=x.useRef(e);x.useEffect(function(){a.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var w=qO([e.lockRef.current],(e.shards||[]).map(rw),!0).filter(Boolean);return w.forEach(function(C){return C.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),w.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var u=x.useCallback(function(w,C){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!a.current.allowPinchZoom;var k=Xh(w),T=n.current,R="deltaX"in w?w.deltaX:T[0]-k[0],D="deltaY"in w?w.deltaY:T[1]-k[1],z,L=w.target,O=Math.abs(R)>Math.abs(D)?"h":"v";if("touches"in w&&O==="h"&&L.type==="range")return!1;var B=window.getSelection(),X=B&&B.anchorNode,P=X?X===L||X.contains(L):!1;if(P)return!1;var q=tw(O,L);if(!q)return!0;if(q?z=O:(z=O==="v"?"h":"v",q=tw(O,L)),!q)return!1;if(!r.current&&"changedTouches"in w&&(R||D)&&(r.current=z),!z)return!0;var H=r.current||z;return bL(H,C,w,H==="h"?R:D)},[]),h=x.useCallback(function(w){var C=w;if(!(!Bl.length||Bl[Bl.length-1]!==l)){var k="deltaY"in C?nw(C):Xh(C),T=t.current.filter(function(z){return z.name===C.type&&(z.target===C.target||C.target===z.shadowParent)&&xL(z.delta,k)})[0];if(T&&T.should){C.cancelable&&C.preventDefault();return}if(!T){var R=(a.current.shards||[]).map(rw).filter(Boolean).filter(function(z){return z.contains(C.target)}),D=R.length>0?u(C,R[0]):!a.current.noIsolation;D&&C.cancelable&&C.preventDefault()}}},[]),d=x.useCallback(function(w,C,k,T){var R={name:w,delta:C,target:k,should:T,shadowParent:kL(k)};t.current.push(R),setTimeout(function(){t.current=t.current.filter(function(D){return D!==R})},1)},[]),m=x.useCallback(function(w){n.current=Xh(w),r.current=void 0},[]),p=x.useCallback(function(w){d(w.type,nw(w),w.target,u(w,e.lockRef.current))},[]),_=x.useCallback(function(w){d(w.type,Xh(w),w.target,u(w,e.lockRef.current))},[]);x.useEffect(function(){return Bl.push(l),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:_}),document.addEventListener("wheel",h,zl),document.addEventListener("touchmove",h,zl),document.addEventListener("touchstart",m,zl),function(){Bl=Bl.filter(function(w){return w!==l}),document.removeEventListener("wheel",h,zl),document.removeEventListener("touchmove",h,zl),document.removeEventListener("touchstart",m,zl)}},[]);var b=e.removeScrollBar,S=e.inert;return x.createElement(x.Fragment,null,S?x.createElement(l,{styles:SL(s)}):null,b?x.createElement(fL,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function kL(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const EL=eL(Xk,CL);var bf=x.forwardRef(function(e,t){return x.createElement(yf,fi({},e,{ref:t,sideCar:EL}))});bf.classNames=yf.classNames;var RL=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},jl=new WeakMap,Zh=new WeakMap,Qh={},wg=0,tE=function(e){return e&&(e.host||tE(e.parentNode))},ML=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=tE(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},TL=function(e,t,n,r){var s=ML(t,Array.isArray(e)?e:[e]);Qh[n]||(Qh[n]=new WeakMap);var l=Qh[n],a=[],u=new Set,h=new Set(s),d=function(p){!p||u.has(p)||(u.add(p),d(p.parentNode))};s.forEach(d);var m=function(p){!p||h.has(p)||Array.prototype.forEach.call(p.children,function(_){if(u.has(_))m(_);else try{var b=_.getAttribute(r),S=b!==null&&b!=="false",w=(jl.get(_)||0)+1,C=(l.get(_)||0)+1;jl.set(_,w),l.set(_,C),a.push(_),w===1&&S&&Zh.set(_,!0),C===1&&_.setAttribute(n,"true"),S||_.setAttribute(r,"true")}catch(k){console.error("aria-hidden: cannot operate on ",_,k)}})};return m(t),u.clear(),wg++,function(){a.forEach(function(p){var _=jl.get(p)-1,b=l.get(p)-1;jl.set(p,_),l.set(p,b),_||(Zh.has(p)||p.removeAttribute(r),Zh.delete(p)),b||p.removeAttribute(n)}),wg--,wg||(jl=new WeakMap,jl=new WeakMap,Zh=new WeakMap,Qh={})}},ey=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=RL(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),TL(r,s,n,"aria-hidden")):function(){return null}},xf="Dialog",[nE]=Qs(xf),[AL,ti]=nE(xf),rE=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:l,modal:a=!0}=e,u=x.useRef(null),h=x.useRef(null),[d,m]=vf({prop:r,defaultProp:s??!1,onChange:l,caller:xf});return v.jsx(AL,{scope:t,triggerRef:u,contentRef:h,contentId:Kl(),titleId:Kl(),descriptionId:Kl(),open:d,onOpenChange:m,onOpenToggle:x.useCallback(()=>m(p=>!p),[m]),modal:a,children:n})};rE.displayName=xf;var iE="DialogTrigger",DL=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ti(iE,n),l=Bt(t,s.triggerRef);return v.jsx(bt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":ry(s.open),...r,ref:l,onClick:Ne(e.onClick,s.onOpenToggle)})});DL.displayName=iE;var ty="DialogPortal",[NL,sE]=nE(ty,{forceMount:void 0}),oE=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,l=ti(ty,t);return v.jsx(NL,{scope:t,forceMount:n,children:x.Children.map(r,a=>v.jsx(Ir,{present:n||l.open,children:v.jsx(fu,{asChild:!0,container:s,children:a})}))})};oE.displayName=ty;var Hd="DialogOverlay",lE=x.forwardRef((e,t)=>{const n=sE(Hd,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,l=ti(Hd,e.__scopeDialog);return l.modal?v.jsx(Ir,{present:r||l.open,children:v.jsx(LL,{...s,ref:t})}):null});lE.displayName=Hd;var OL=ea("DialogOverlay.RemoveScroll"),LL=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ti(Hd,n);return v.jsx(bf,{as:OL,allowPinchZoom:!0,shards:[s.contentRef],children:v.jsx(bt.div,{"data-state":ry(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Oo="DialogContent",aE=x.forwardRef((e,t)=>{const n=sE(Oo,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,l=ti(Oo,e.__scopeDialog);return v.jsx(Ir,{present:r||l.open,children:l.modal?v.jsx(zL,{...s,ref:t}):v.jsx(BL,{...s,ref:t})})});aE.displayName=Oo;var zL=x.forwardRef((e,t)=>{const n=ti(Oo,e.__scopeDialog),r=x.useRef(null),s=Bt(t,n.contentRef,r);return x.useEffect(()=>{const l=r.current;if(l)return ey(l)},[]),v.jsx(cE,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ne(e.onCloseAutoFocus,l=>{var a;l.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Ne(e.onPointerDownOutside,l=>{const a=l.detail.originalEvent,u=a.button===0&&a.ctrlKey===!0;(a.button===2||u)&&l.preventDefault()}),onFocusOutside:Ne(e.onFocusOutside,l=>l.preventDefault())})}),BL=x.forwardRef((e,t)=>{const n=ti(Oo,e.__scopeDialog),r=x.useRef(!1),s=x.useRef(!1);return v.jsx(cE,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var a,u;(a=e.onCloseAutoFocus)==null||a.call(e,l),l.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),l.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:l=>{var h,d;(h=e.onInteractOutside)==null||h.call(e,l),l.defaultPrevented||(r.current=!0,l.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=l.target;((d=n.triggerRef.current)==null?void 0:d.contains(a))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&s.current&&l.preventDefault()}})}),cE=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:l,...a}=e,u=ti(Oo,n),h=x.useRef(null),d=Bt(t,h);return J_(),v.jsxs(v.Fragment,{children:[v.jsx(_f,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:l,children:v.jsx(du,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":ry(u.open),...a,ref:d,onDismiss:()=>u.onOpenChange(!1)})}),v.jsxs(v.Fragment,{children:[v.jsx(jL,{titleId:u.titleId}),v.jsx(IL,{contentRef:h,descriptionId:u.descriptionId})]})]})}),ny="DialogTitle",uE=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ti(ny,n);return v.jsx(bt.h2,{id:s.titleId,...r,ref:t})});uE.displayName=ny;var hE="DialogDescription",dE=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ti(hE,n);return v.jsx(bt.p,{id:s.descriptionId,...r,ref:t})});dE.displayName=hE;var fE="DialogClose",pE=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=ti(fE,n);return v.jsx(bt.button,{type:"button",...r,ref:t,onClick:Ne(e.onClick,()=>s.onOpenChange(!1))})});pE.displayName=fE;function ry(e){return e?"open":"closed"}var mE="DialogTitleWarning",[DX,gE]=fO(mE,{contentName:Oo,titleName:ny,docsSlug:"dialog"}),jL=({titleId:e})=>{const t=gE(mE),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
101
|
-
|
|
102
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
103
|
-
|
|
104
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},PL="DialogDescriptionWarning",IL=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${gE(PL).contentName}}.`;return x.useEffect(()=>{var l;const s=(l=e.current)==null?void 0:l.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},HL=rE,FL=oE,vE=lE,_E=aE,UL=uE,$L=dE,WL=pE;/**
|
|
105
|
-
* @license lucide-react v0.562.0 - ISC
|
|
106
|
-
*
|
|
107
|
-
* This source code is licensed under the ISC license.
|
|
108
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
109
|
-
*/const qL=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),VL=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),iw=e=>{const t=VL(e);return t.charAt(0).toUpperCase()+t.slice(1)},yE=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),KL=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
|
|
110
|
-
* @license lucide-react v0.562.0 - ISC
|
|
111
|
-
*
|
|
112
|
-
* This source code is licensed under the ISC license.
|
|
113
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
114
|
-
*/var GL={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"};/**
|
|
115
|
-
* @license lucide-react v0.562.0 - ISC
|
|
116
|
-
*
|
|
117
|
-
* This source code is licensed under the ISC license.
|
|
118
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
119
|
-
*/const YL=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:l,iconNode:a,...u},h)=>x.createElement("svg",{ref:h,...GL,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:yE("lucide",s),...!l&&!KL(u)&&{"aria-hidden":"true"},...u},[...a.map(([d,m])=>x.createElement(d,m)),...Array.isArray(l)?l:[l]]));/**
|
|
120
|
-
* @license lucide-react v0.562.0 - ISC
|
|
121
|
-
*
|
|
122
|
-
* This source code is licensed under the ISC license.
|
|
123
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
124
|
-
*/const Te=(e,t)=>{const n=x.forwardRef(({className:r,...s},l)=>x.createElement(YL,{ref:l,iconNode:t,className:yE(`lucide-${qL(iw(e))}`,`lucide-${e}`,r),...s}));return n.displayName=iw(e),n};/**
|
|
125
|
-
* @license lucide-react v0.562.0 - ISC
|
|
126
|
-
*
|
|
127
|
-
* This source code is licensed under the ISC license.
|
|
128
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
129
|
-
*/const XL=[["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"}]],ZL=Te("archive",XL);/**
|
|
130
|
-
* @license lucide-react v0.562.0 - ISC
|
|
131
|
-
*
|
|
132
|
-
* This source code is licensed under the ISC license.
|
|
133
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
134
|
-
*/const QL=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],JL=Te("arrow-down-to-line",QL);/**
|
|
135
|
-
* @license lucide-react v0.562.0 - ISC
|
|
136
|
-
*
|
|
137
|
-
* This source code is licensed under the ISC license.
|
|
138
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
139
|
-
*/const ez=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],tz=Te("arrow-down",ez);/**
|
|
140
|
-
* @license lucide-react v0.562.0 - ISC
|
|
141
|
-
*
|
|
142
|
-
* This source code is licensed under the ISC license.
|
|
143
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
144
|
-
*/const nz=[["path",{d:"M8 3 4 7l4 4",key:"9rb6wj"}],["path",{d:"M4 7h16",key:"6tx8e3"}],["path",{d:"m16 21 4-4-4-4",key:"siv7j2"}],["path",{d:"M20 17H4",key:"h6l3hr"}]],rz=Te("arrow-left-right",nz);/**
|
|
145
|
-
* @license lucide-react v0.562.0 - ISC
|
|
146
|
-
*
|
|
147
|
-
* This source code is licensed under the ISC license.
|
|
148
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
149
|
-
*/const iz=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],sz=Te("arrow-up",iz);/**
|
|
150
|
-
* @license lucide-react v0.562.0 - ISC
|
|
151
|
-
*
|
|
152
|
-
* This source code is licensed under the ISC license.
|
|
153
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
154
|
-
*/const oz=[["path",{d:"M12 6v12",key:"1vza4d"}],["path",{d:"M17.196 9 6.804 15",key:"1ah31z"}],["path",{d:"m6.804 9 10.392 6",key:"1b6pxd"}]],lz=Te("asterisk",oz);/**
|
|
155
|
-
* @license lucide-react v0.562.0 - ISC
|
|
156
|
-
*
|
|
157
|
-
* This source code is licensed under the ISC license.
|
|
158
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
159
|
-
*/const az=[["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"}]],sw=Te("brain",az);/**
|
|
160
|
-
* @license lucide-react v0.562.0 - ISC
|
|
161
|
-
*
|
|
162
|
-
* This source code is licensed under the ISC license.
|
|
163
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
164
|
-
*/const cz=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],uz=Te("check-check",cz);/**
|
|
165
|
-
* @license lucide-react v0.562.0 - ISC
|
|
166
|
-
*
|
|
167
|
-
* This source code is licensed under the ISC license.
|
|
168
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
169
|
-
*/const hz=[["path",{d:"M20 4L9 15",key:"1qkx8z"}],["path",{d:"M21 19L3 19",key:"100sma"}],["path",{d:"M9 15L4 10",key:"9zxff7"}]],dz=Te("check-line",hz);/**
|
|
170
|
-
* @license lucide-react v0.562.0 - ISC
|
|
171
|
-
*
|
|
172
|
-
* This source code is licensed under the ISC license.
|
|
173
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
174
|
-
*/const fz=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Lo=Te("check",fz);/**
|
|
175
|
-
* @license lucide-react v0.562.0 - ISC
|
|
176
|
-
*
|
|
177
|
-
* This source code is licensed under the ISC license.
|
|
178
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
179
|
-
*/const pz=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],mz=Te("chevron-down",pz);/**
|
|
180
|
-
* @license lucide-react v0.562.0 - ISC
|
|
181
|
-
*
|
|
182
|
-
* This source code is licensed under the ISC license.
|
|
183
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
184
|
-
*/const gz=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],vz=Te("chevron-left",gz);/**
|
|
185
|
-
* @license lucide-react v0.562.0 - ISC
|
|
186
|
-
*
|
|
187
|
-
* This source code is licensed under the ISC license.
|
|
188
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
189
|
-
*/const _z=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ji=Te("chevron-right",_z);/**
|
|
190
|
-
* @license lucide-react v0.562.0 - ISC
|
|
191
|
-
*
|
|
192
|
-
* This source code is licensed under the ISC license.
|
|
193
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
194
|
-
*/const yz=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]],bz=Te("circle-slash",yz);/**
|
|
195
|
-
* @license lucide-react v0.562.0 - ISC
|
|
196
|
-
*
|
|
197
|
-
* This source code is licensed under the ISC license.
|
|
198
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
199
|
-
*/const xz=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Sz=Te("circle",xz);/**
|
|
200
|
-
* @license lucide-react v0.562.0 - ISC
|
|
201
|
-
*
|
|
202
|
-
* This source code is licensed under the ISC license.
|
|
203
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
204
|
-
*/const wz=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],ow=Te("code-xml",wz);/**
|
|
205
|
-
* @license lucide-react v0.562.0 - ISC
|
|
206
|
-
*
|
|
207
|
-
* This source code is licensed under the ISC license.
|
|
208
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
209
|
-
*/const Cz=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],kz=Te("code",Cz);/**
|
|
210
|
-
* @license lucide-react v0.562.0 - ISC
|
|
211
|
-
*
|
|
212
|
-
* This source code is licensed under the ISC license.
|
|
213
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
214
|
-
*/const Ez=[["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"}]],Sf=Te("copy",Ez);/**
|
|
215
|
-
* @license lucide-react v0.562.0 - ISC
|
|
216
|
-
*
|
|
217
|
-
* This source code is licensed under the ISC license.
|
|
218
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
219
|
-
*/const Rz=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],Mz=Te("corner-down-left",Rz);/**
|
|
220
|
-
* @license lucide-react v0.562.0 - ISC
|
|
221
|
-
*
|
|
222
|
-
* This source code is licensed under the ISC license.
|
|
223
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
224
|
-
*/const Tz=[["path",{d:"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21",key:"g5wo59"}],["path",{d:"m5.082 11.09 8.828 8.828",key:"1wx5vj"}]],Az=Te("eraser",Tz);/**
|
|
225
|
-
* @license lucide-react v0.562.0 - ISC
|
|
226
|
-
*
|
|
227
|
-
* This source code is licensed under the ISC license.
|
|
228
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
229
|
-
*/const Dz=[["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"}]],Nz=Te("file-pen",Dz);/**
|
|
230
|
-
* @license lucide-react v0.562.0 - ISC
|
|
231
|
-
*
|
|
232
|
-
* This source code is licensed under the ISC license.
|
|
233
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
234
|
-
*/const Oz=[["path",{d:"M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35",key:"17jvcc"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M14 19h6",key:"bvotb8"}],["path",{d:"M17 16v6",key:"18yu1i"}]],Lz=Te("file-plus-corner",Oz);/**
|
|
235
|
-
* @license lucide-react v0.562.0 - ISC
|
|
236
|
-
*
|
|
237
|
-
* This source code is licensed under the ISC license.
|
|
238
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
239
|
-
*/const zz=[["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"}]],Bz=Te("file",zz);/**
|
|
240
|
-
* @license lucide-react v0.562.0 - ISC
|
|
241
|
-
*
|
|
242
|
-
* This source code is licensed under the ISC license.
|
|
243
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
244
|
-
*/const jz=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"M12 16.5A4.5 4.5 0 1 1 7.5 12 4.5 4.5 0 1 1 12 7.5a4.5 4.5 0 1 1 4.5 4.5 4.5 4.5 0 1 1-4.5 4.5",key:"14wa3c"}],["path",{d:"M12 7.5V9",key:"1oy5b0"}],["path",{d:"M7.5 12H9",key:"eltsq1"}],["path",{d:"M16.5 12H15",key:"vk5kw4"}],["path",{d:"M12 16.5V15",key:"k7eayi"}],["path",{d:"m8 8 1.88 1.88",key:"nxy4qf"}],["path",{d:"M14.12 9.88 16 8",key:"1lst6k"}],["path",{d:"m8 16 1.88-1.88",key:"h2eex1"}],["path",{d:"M14.12 14.12 16 16",key:"uqkrx3"}]],zc=Te("flower",jz);/**
|
|
245
|
-
* @license lucide-react v0.562.0 - ISC
|
|
246
|
-
*
|
|
247
|
-
* This source code is licensed under the ISC license.
|
|
248
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
249
|
-
*/const Pz=[["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"}]],bE=Te("folder-open",Pz);/**
|
|
250
|
-
* @license lucide-react v0.562.0 - ISC
|
|
251
|
-
*
|
|
252
|
-
* This source code is licensed under the ISC license.
|
|
253
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
254
|
-
*/const Iz=[["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"}]],Hz=Te("folder",Iz);/**
|
|
255
|
-
* @license lucide-react v0.562.0 - ISC
|
|
256
|
-
*
|
|
257
|
-
* This source code is licensed under the ISC license.
|
|
258
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
259
|
-
*/const Fz=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],Jh=Te("gauge",Fz);/**
|
|
260
|
-
* @license lucide-react v0.562.0 - ISC
|
|
261
|
-
*
|
|
262
|
-
* This source code is licensed under the ISC license.
|
|
263
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
264
|
-
*/const Uz=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],$z=Te("info",Uz);/**
|
|
265
|
-
* @license lucide-react v0.562.0 - ISC
|
|
266
|
-
*
|
|
267
|
-
* This source code is licensed under the ISC license.
|
|
268
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
269
|
-
*/const Wz=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]],qz=Te("list-checks",Wz);/**
|
|
270
|
-
* @license lucide-react v0.562.0 - ISC
|
|
271
|
-
*
|
|
272
|
-
* This source code is licensed under the ISC license.
|
|
273
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
274
|
-
*/const Vz=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]],Fd=Te("list-todo",Vz);/**
|
|
275
|
-
* @license lucide-react v0.562.0 - ISC
|
|
276
|
-
*
|
|
277
|
-
* This source code is licensed under the ISC license.
|
|
278
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
279
|
-
*/const Kz=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Js=Te("loader-circle",Kz);/**
|
|
280
|
-
* @license lucide-react v0.562.0 - ISC
|
|
281
|
-
*
|
|
282
|
-
* This source code is licensed under the ISC license.
|
|
283
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
284
|
-
*/const Gz=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]],lw=Te("lock-open",Gz);/**
|
|
285
|
-
* @license lucide-react v0.562.0 - ISC
|
|
286
|
-
*
|
|
287
|
-
* This source code is licensed under the ISC license.
|
|
288
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
289
|
-
*/const Yz=[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]],aw=Te("map",Yz);/**
|
|
290
|
-
* @license lucide-react v0.562.0 - ISC
|
|
291
|
-
*
|
|
292
|
-
* This source code is licensed under the ISC license.
|
|
293
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
294
|
-
*/const Xz=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],xE=Te("menu",Xz);/**
|
|
295
|
-
* @license lucide-react v0.562.0 - ISC
|
|
296
|
-
*
|
|
297
|
-
* This source code is licensed under the ISC license.
|
|
298
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
299
|
-
*/const Zz=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],SE=Te("message-circle-question-mark",Zz);/**
|
|
300
|
-
* @license lucide-react v0.562.0 - ISC
|
|
301
|
-
*
|
|
302
|
-
* This source code is licensed under the ISC license.
|
|
303
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
304
|
-
*/const Qz=[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]],wE=Te("minimize",Qz);/**
|
|
305
|
-
* @license lucide-react v0.562.0 - ISC
|
|
306
|
-
*
|
|
307
|
-
* This source code is licensed under the ISC license.
|
|
308
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
309
|
-
*/const Jz=[["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"}]],CE=Te("monitor",Jz);/**
|
|
310
|
-
* @license lucide-react v0.562.0 - ISC
|
|
311
|
-
*
|
|
312
|
-
* This source code is licensed under the ISC license.
|
|
313
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
314
|
-
*/const e6=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],xv=Te("panel-left",e6);/**
|
|
315
|
-
* @license lucide-react v0.562.0 - ISC
|
|
316
|
-
*
|
|
317
|
-
* This source code is licensed under the ISC license.
|
|
318
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
319
|
-
*/const t6=[["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"}]],kE=Te("pencil",t6);/**
|
|
320
|
-
* @license lucide-react v0.562.0 - ISC
|
|
321
|
-
*
|
|
322
|
-
* This source code is licensed under the ISC license.
|
|
323
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
324
|
-
*/const n6=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],iy=Te("plus",n6);/**
|
|
325
|
-
* @license lucide-react v0.562.0 - ISC
|
|
326
|
-
*
|
|
327
|
-
* This source code is licensed under the ISC license.
|
|
328
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
329
|
-
*/const r6=[["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"}]],cw=Te("rotate-ccw",r6);/**
|
|
330
|
-
* @license lucide-react v0.562.0 - ISC
|
|
331
|
-
*
|
|
332
|
-
* This source code is licensed under the ISC license.
|
|
333
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
334
|
-
*/const i6=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Cg=Te("search",i6);/**
|
|
335
|
-
* @license lucide-react v0.562.0 - ISC
|
|
336
|
-
*
|
|
337
|
-
* This source code is licensed under the ISC license.
|
|
338
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
339
|
-
*/const s6=[["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"}]],o6=Te("send",s6);/**
|
|
340
|
-
* @license lucide-react v0.562.0 - ISC
|
|
341
|
-
*
|
|
342
|
-
* This source code is licensed under the ISC license.
|
|
343
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
344
|
-
*/const l6=[["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"}]],EE=Te("settings",l6);/**
|
|
345
|
-
* @license lucide-react v0.562.0 - ISC
|
|
346
|
-
*
|
|
347
|
-
* This source code is licensed under the ISC license.
|
|
348
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
349
|
-
*/const a6=[["path",{d:"M22 2 2 22",key:"y4kqgn"}]],c6=Te("slash",a6);/**
|
|
350
|
-
* @license lucide-react v0.562.0 - ISC
|
|
351
|
-
*
|
|
352
|
-
* This source code is licensed under the ISC license.
|
|
353
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
354
|
-
*/const u6=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],qc=Te("sparkles",u6);/**
|
|
355
|
-
* @license lucide-react v0.562.0 - ISC
|
|
356
|
-
*
|
|
357
|
-
* This source code is licensed under the ISC license.
|
|
358
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
359
|
-
*/const h6=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],sy=Te("square-pen",h6);/**
|
|
360
|
-
* @license lucide-react v0.562.0 - ISC
|
|
361
|
-
*
|
|
362
|
-
* This source code is licensed under the ISC license.
|
|
363
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
364
|
-
*/const d6=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],f6=Te("square-x",d6);/**
|
|
365
|
-
* @license lucide-react v0.562.0 - ISC
|
|
366
|
-
*
|
|
367
|
-
* This source code is licensed under the ISC license.
|
|
368
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
369
|
-
*/const p6=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],oy=Te("terminal",p6);/**
|
|
370
|
-
* @license lucide-react v0.562.0 - ISC
|
|
371
|
-
*
|
|
372
|
-
* This source code is licensed under the ISC license.
|
|
373
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
374
|
-
*/const m6=[["rect",{width:"18",height:"12",x:"3",y:"8",rx:"1",key:"158fvp"}],["path",{d:"M10 8V5c0-.6-.4-1-1-1H6a1 1 0 0 0-1 1v3",key:"s0042v"}],["path",{d:"M19 8V5c0-.6-.4-1-1-1h-3a1 1 0 0 0-1 1v3",key:"9wmeh2"}]],g6=Te("toy-brick",m6);/**
|
|
375
|
-
* @license lucide-react v0.562.0 - ISC
|
|
376
|
-
*
|
|
377
|
-
* This source code is licensed under the ISC license.
|
|
378
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
379
|
-
*/const v6=[["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"}]],_6=Te("trash-2",v6);/**
|
|
380
|
-
* @license lucide-react v0.562.0 - ISC
|
|
381
|
-
*
|
|
382
|
-
* This source code is licensed under the ISC license.
|
|
383
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
384
|
-
*/const y6=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],ly=Te("user-round",y6);/**
|
|
385
|
-
* @license lucide-react v0.562.0 - ISC
|
|
386
|
-
*
|
|
387
|
-
* This source code is licensed under the ISC license.
|
|
388
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
389
|
-
*/const b6=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],pu=Te("x",b6);/**
|
|
390
|
-
* @license lucide-react v0.562.0 - ISC
|
|
391
|
-
*
|
|
392
|
-
* This source code is licensed under the ISC license.
|
|
393
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
394
|
-
*/const x6=[["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"}]],Ud=Te("zap",x6),Vc="data-focus-fallback-ignore",RE="data-allow-focus-retain",$d="kanna:restore-chat-input-focus",ay="data-chat-input",Sv="data-chat-selection-zone";function ta(e,t){return!!(e!=null&&e.closest(`[${t}]`))}function ME(e){var n;const t=e;return t!=null&&t.matches?t.matches("input:not([type='checkbox']):not([type='radio']):not([type='button']):not([type='submit']):not([type='reset']), textarea, select")||t.isContentEditable||((n=t.getAttribute)==null?void 0:n.call(t,"role"))==="textbox"?!0:ta(e,RE):!1}function S6(e){const t=e;return t!=null&&t.matches?ME(e)||(t.tabIndex??-1)>=0||t.matches("button, a[href], summary")?!0:ta(e,RE):!1}function uw(e){return!!e.querySelector(`[${Vc}][data-state='open']`)}function w6(e){return ta(e,ay)}function hw(e){return ta(e,Sv)}function C6(e){return e?!e.isCollapsed&&e.toString().trim().length>0:!1}function k6(e,t){if(!e)return!1;const n=Array.from(t.querySelectorAll(`textarea[${ay}]`)).filter(a=>!a.disabled);if(n.length===0)return!1;const r=n.indexOf(e),s=r>=0?(r+1)%n.length:0,l=n[s];return l?(l.focus({preventScroll:!0}),!0):!1}function E6(e){const{activeElement:t,fallback:n,hasActiveOverlay:r,canCancel:s,defaultPrevented:l}=e;return!(l||!n||n.disabled||r||t===n||w6(t)||s)}function R6(e){const{activeElement:t,pointerStartTarget:n,pointerEndTarget:r,root:s,fallback:l,hasActiveOverlay:a,hasActiveSelection:u}=e,h=r??n;return!s||!l||l.disabled||!h||!s.contains(h)||ta(h,Vc)||a||t===l||ta(t,Vc)||u&&(hw(n)||hw(h))||ME(t)?!1:t&&t===h?!0:!S6(t)}const TE=HL,M6=FL,AE=x.forwardRef(({className:e,...t},n)=>v.jsx(vE,{ref:n,className:ye("fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));AE.displayName=vE.displayName;const T6={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"},cy=x.forwardRef(({className:e,children:t,size:n="md",...r},s)=>v.jsxs(M6,{children:[v.jsx(AE,{}),v.jsxs(_E,{ref:s,[Vc]:"",onCloseAutoFocus:l=>{var a;l.preventDefault(),window.dispatchEvent(new Event($d)),(a=r.onCloseAutoFocus)==null||a.call(r,l)},className:ye("fixed left-1/2 top-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 rounded-xl border border-border bg-background shadow-xl duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]","max-h-[85vh] flex flex-col",T6[n],e),...r,children:[t,v.jsxs(WL,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[v.jsx(pu,{className:"h-4 w-4"}),v.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));cy.displayName=_E.displayName;function DE({className:e,...t}){return v.jsx(UL,{className:ye("text-lg font-medium leading-none tracking-tight",e),...t})}function A6({className:e,...t}){return v.jsx($L,{className:ye("text-sm text-muted-foreground",e),...t})}function NE({className:e,...t}){return v.jsx("div",{className:ye("flex-1 min-h-0 overflow-y-auto px-4 pb-4 pt-3.5",e),...t})}function OE({className:e,...t}){return v.jsx("div",{className:ye("shrink-0 flex justify-end gap-2 border-t border-border bg-background p-2 rounded-b-xl",e),...t})}const LE=x.createContext(null);function D6({children:e}){const[t,n]=x.useState(null),[r,s]=x.useState(""),l=x.useRef(null);x.useEffect(()=>{(t==null?void 0:t.kind)==="prompt"&&(s(t.options.initialValue??""),setTimeout(()=>{var m,p;(m=l.current)==null||m.focus(),(p=l.current)==null||p.select()},0))},[t]);const a=x.useCallback(()=>{n(null),s("")},[]),u=x.useCallback(m=>new Promise(p=>{n({kind:"confirm",options:m,resolve:p})}),[]),h=x.useCallback(m=>new Promise(p=>{n({kind:"prompt",options:m,resolve:p})}),[]),d=x.useMemo(()=>({confirm:u,prompt:h}),[u,h]);return v.jsxs(LE.Provider,{value:d,children:[e,v.jsx(TE,{open:t!==null,onOpenChange:m=>{m||!t||(t.kind==="confirm"?t.resolve(!1):t.resolve(null),a())},children:v.jsx(cy,{size:"sm",children:t?v.jsxs(v.Fragment,{children:[v.jsxs(NE,{className:"space-y-4",children:[v.jsx(DE,{children:t.options.title}),t.options.description?v.jsx(A6,{children:t.options.description}):null,t.kind==="prompt"?v.jsx("input",{ref:l,type:"text",value:r,onChange:m=>s(m.target.value),onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),t.resolve(r.trim()||null),a())},className:"w-full px-3 py-2 text-sm border border-border rounded-md bg-background outline-none",placeholder:t.options.placeholder}):null]}),v.jsxs(OE,{children:[v.jsx(Ke,{variant:"ghost",size:"sm",onClick:()=>{t.kind==="confirm"?t.resolve(!1):t.resolve(null),a()},children:t.options.cancelLabel??"Cancel"}),v.jsx(Ke,{variant:t.kind==="confirm"?t.options.confirmVariant??"default":"secondary",size:"sm",onClick:()=>{t.kind==="confirm"?t.resolve(!0):t.resolve(r.trim()||null),a()},disabled:t.kind==="prompt"&&!r.trim(),children:t.options.confirmLabel??"Confirm"})]})]}):null})})]})}function N6(){const e=x.useContext(LE);if(!e)throw new Error("useAppDialog must be used within AppDialogProvider");return e}const O6=["top","right","bottom","left"],Gs=Math.min,pr=Math.max,Wd=Math.round,ed=Math.floor,_i=e=>({x:e,y:e}),L6={left:"right",right:"left",bottom:"top",top:"bottom"};function wv(e,t,n){return pr(e,Gs(t,n))}function es(e,t){return typeof e=="function"?e(t):e}function ts(e){return e.split("-")[0]}function ha(e){return e.split("-")[1]}function uy(e){return e==="x"?"y":"x"}function hy(e){return e==="y"?"height":"width"}function pi(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function dy(e){return uy(pi(e))}function z6(e,t,n){n===void 0&&(n=!1);const r=ha(e),s=dy(e),l=hy(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(a=qd(a)),[a,qd(a)]}function B6(e){const t=qd(e);return[Cv(e),t,Cv(t)]}function Cv(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const dw=["left","right"],fw=["right","left"],j6=["top","bottom"],P6=["bottom","top"];function I6(e,t,n){switch(e){case"top":case"bottom":return n?t?fw:dw:t?dw:fw;case"left":case"right":return t?j6:P6;default:return[]}}function H6(e,t,n,r){const s=ha(e);let l=I6(ts(e),n==="start",r);return s&&(l=l.map(a=>a+"-"+s),t&&(l=l.concat(l.map(Cv)))),l}function qd(e){const t=ts(e);return L6[t]+e.slice(t.length)}function F6(e){return{top:0,right:0,bottom:0,left:0,...e}}function zE(e){return typeof e!="number"?F6(e):{top:e,right:e,bottom:e,left:e}}function Vd(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function pw(e,t,n){let{reference:r,floating:s}=e;const l=pi(t),a=dy(t),u=hy(a),h=ts(t),d=l==="y",m=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,_=r[u]/2-s[u]/2;let b;switch(h){case"top":b={x:m,y:r.y-s.height};break;case"bottom":b={x:m,y:r.y+r.height};break;case"right":b={x:r.x+r.width,y:p};break;case"left":b={x:r.x-s.width,y:p};break;default:b={x:r.x,y:r.y}}switch(ha(t)){case"start":b[a]-=_*(n&&d?-1:1);break;case"end":b[a]+=_*(n&&d?-1:1);break}return b}async function U6(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:l,rects:a,elements:u,strategy:h}=e,{boundary:d="clippingAncestors",rootBoundary:m="viewport",elementContext:p="floating",altBoundary:_=!1,padding:b=0}=es(t,e),S=zE(b),C=u[_?p==="floating"?"reference":"floating":p],k=Vd(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(C)))==null||n?C:C.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(u.floating)),boundary:d,rootBoundary:m,strategy:h})),T=p==="floating"?{x:r,y:s,width:a.floating.width,height:a.floating.height}:a.reference,R=await(l.getOffsetParent==null?void 0:l.getOffsetParent(u.floating)),D=await(l.isElement==null?void 0:l.isElement(R))?await(l.getScale==null?void 0:l.getScale(R))||{x:1,y:1}:{x:1,y:1},z=Vd(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:T,offsetParent:R,strategy:h}):T);return{top:(k.top-z.top+S.top)/D.y,bottom:(z.bottom-k.bottom+S.bottom)/D.y,left:(k.left-z.left+S.left)/D.x,right:(z.right-k.right+S.right)/D.x}}const $6=50,W6=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:l=[],platform:a}=n,u=a.detectOverflow?a:{...a,detectOverflow:U6},h=await(a.isRTL==null?void 0:a.isRTL(t));let d=await a.getElementRects({reference:e,floating:t,strategy:s}),{x:m,y:p}=pw(d,r,h),_=r,b=0;const S={};for(let w=0;w<l.length;w++){const C=l[w];if(!C)continue;const{name:k,fn:T}=C,{x:R,y:D,data:z,reset:L}=await T({x:m,y:p,initialPlacement:r,placement:_,strategy:s,middlewareData:S,rects:d,platform:u,elements:{reference:e,floating:t}});m=R??m,p=D??p,S[k]={...S[k],...z},L&&b<$6&&(b++,typeof L=="object"&&(L.placement&&(_=L.placement),L.rects&&(d=L.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:s}):L.rects),{x:m,y:p}=pw(d,_,h)),w=-1)}return{x:m,y:p,placement:_,strategy:s,middlewareData:S}},q6=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:l,platform:a,elements:u,middlewareData:h}=t,{element:d,padding:m=0}=es(e,t)||{};if(d==null)return{};const p=zE(m),_={x:n,y:r},b=dy(s),S=hy(b),w=await a.getDimensions(d),C=b==="y",k=C?"top":"left",T=C?"bottom":"right",R=C?"clientHeight":"clientWidth",D=l.reference[S]+l.reference[b]-_[b]-l.floating[S],z=_[b]-l.reference[b],L=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let O=L?L[R]:0;(!O||!await(a.isElement==null?void 0:a.isElement(L)))&&(O=u.floating[R]||l.floating[S]);const B=D/2-z/2,X=O/2-w[S]/2-1,P=Gs(p[k],X),q=Gs(p[T],X),H=P,U=O-w[S]-q,V=O/2-w[S]/2+B,F=wv(H,V,U),j=!h.arrow&&ha(s)!=null&&V!==F&&l.reference[S]/2-(V<H?P:q)-w[S]/2<0,K=j?V<H?V-H:V-U:0;return{[b]:_[b]+K,data:{[b]:F,centerOffset:V-F-K,...j&&{alignmentOffset:K}},reset:j}}}),V6=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:l,rects:a,initialPlacement:u,platform:h,elements:d}=t,{mainAxis:m=!0,crossAxis:p=!0,fallbackPlacements:_,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:w=!0,...C}=es(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const k=ts(s),T=pi(u),R=ts(u)===u,D=await(h.isRTL==null?void 0:h.isRTL(d.floating)),z=_||(R||!w?[qd(u)]:B6(u)),L=S!=="none";!_&&L&&z.push(...H6(u,w,S,D));const O=[u,...z],B=await h.detectOverflow(t,C),X=[];let P=((r=l.flip)==null?void 0:r.overflows)||[];if(m&&X.push(B[k]),p){const V=z6(s,a,D);X.push(B[V[0]],B[V[1]])}if(P=[...P,{placement:s,overflows:X}],!X.every(V=>V<=0)){var q,H;const V=(((q=l.flip)==null?void 0:q.index)||0)+1,F=O[V];if(F&&(!(p==="alignment"?T!==pi(F):!1)||P.every($=>pi($.placement)===T?$.overflows[0]>0:!0)))return{data:{index:V,overflows:P},reset:{placement:F}};let j=(H=P.filter(K=>K.overflows[0]<=0).sort((K,$)=>K.overflows[1]-$.overflows[1])[0])==null?void 0:H.placement;if(!j)switch(b){case"bestFit":{var U;const K=(U=P.filter($=>{if(L){const J=pi($.placement);return J===T||J==="y"}return!0}).map($=>[$.placement,$.overflows.filter(J=>J>0).reduce((J,A)=>J+A,0)]).sort(($,J)=>$[1]-J[1])[0])==null?void 0:U[0];K&&(j=K);break}case"initialPlacement":j=u;break}if(s!==j)return{reset:{placement:j}}}return{}}}};function mw(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function gw(e){return O6.some(t=>e[t]>=0)}const K6=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:s="referenceHidden",...l}=es(e,t);switch(s){case"referenceHidden":{const a=await r.detectOverflow(t,{...l,elementContext:"reference"}),u=mw(a,n.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:gw(u)}}}case"escaped":{const a=await r.detectOverflow(t,{...l,altBoundary:!0}),u=mw(a,n.floating);return{data:{escapedOffsets:u,escaped:gw(u)}}}default:return{}}}}},BE=new Set(["left","top"]);async function G6(e,t){const{placement:n,platform:r,elements:s}=e,l=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=ts(n),u=ha(n),h=pi(n)==="y",d=BE.has(a)?-1:1,m=l&&h?-1:1,p=es(t,e);let{mainAxis:_,crossAxis:b,alignmentAxis:S}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return u&&typeof S=="number"&&(b=u==="end"?S*-1:S),h?{x:b*m,y:_*d}:{x:_*d,y:b*m}}const Y6=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:l,placement:a,middlewareData:u}=t,h=await G6(t,e);return a===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:s+h.x,y:l+h.y,data:{...h,placement:a}}}}},X6=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s,platform:l}=t,{mainAxis:a=!0,crossAxis:u=!1,limiter:h={fn:k=>{let{x:T,y:R}=k;return{x:T,y:R}}},...d}=es(e,t),m={x:n,y:r},p=await l.detectOverflow(t,d),_=pi(ts(s)),b=uy(_);let S=m[b],w=m[_];if(a){const k=b==="y"?"top":"left",T=b==="y"?"bottom":"right",R=S+p[k],D=S-p[T];S=wv(R,S,D)}if(u){const k=_==="y"?"top":"left",T=_==="y"?"bottom":"right",R=w+p[k],D=w-p[T];w=wv(R,w,D)}const C=h.fn({...t,[b]:S,[_]:w});return{...C,data:{x:C.x-n,y:C.y-r,enabled:{[b]:a,[_]:u}}}}}},Z6=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:l,middlewareData:a}=t,{offset:u=0,mainAxis:h=!0,crossAxis:d=!0}=es(e,t),m={x:n,y:r},p=pi(s),_=uy(p);let b=m[_],S=m[p];const w=es(u,t),C=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(h){const R=_==="y"?"height":"width",D=l.reference[_]-l.floating[R]+C.mainAxis,z=l.reference[_]+l.reference[R]-C.mainAxis;b<D?b=D:b>z&&(b=z)}if(d){var k,T;const R=_==="y"?"width":"height",D=BE.has(ts(s)),z=l.reference[p]-l.floating[R]+(D&&((k=a.offset)==null?void 0:k[p])||0)+(D?0:C.crossAxis),L=l.reference[p]+l.reference[R]+(D?0:((T=a.offset)==null?void 0:T[p])||0)-(D?C.crossAxis:0);S<z?S=z:S>L&&(S=L)}return{[_]:b,[p]:S}}}},Q6=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:l,platform:a,elements:u}=t,{apply:h=()=>{},...d}=es(e,t),m=await a.detectOverflow(t,d),p=ts(s),_=ha(s),b=pi(s)==="y",{width:S,height:w}=l.floating;let C,k;p==="top"||p==="bottom"?(C=p,k=_===(await(a.isRTL==null?void 0:a.isRTL(u.floating))?"start":"end")?"left":"right"):(k=p,C=_==="end"?"top":"bottom");const T=w-m.top-m.bottom,R=S-m.left-m.right,D=Gs(w-m[C],T),z=Gs(S-m[k],R),L=!t.middlewareData.shift;let O=D,B=z;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(B=R),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=T),L&&!_){const P=pr(m.left,0),q=pr(m.right,0),H=pr(m.top,0),U=pr(m.bottom,0);b?B=S-2*(P!==0||q!==0?P+q:pr(m.left,m.right)):O=w-2*(H!==0||U!==0?H+U:pr(m.top,m.bottom))}await h({...t,availableWidth:B,availableHeight:O});const X=await a.getDimensions(u.floating);return S!==X.width||w!==X.height?{reset:{rects:!0}}:{}}}};function wf(){return typeof window<"u"}function da(e){return jE(e)?(e.nodeName||"").toLowerCase():"#document"}function mr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ki(e){var t;return(t=(jE(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function jE(e){return wf()?e instanceof Node||e instanceof mr(e).Node:!1}function Zr(e){return wf()?e instanceof Element||e instanceof mr(e).Element:!1}function rs(e){return wf()?e instanceof HTMLElement||e instanceof mr(e).HTMLElement:!1}function vw(e){return!wf()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof mr(e).ShadowRoot}function mu(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=Qr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&s!=="inline"&&s!=="contents"}function J6(e){return/^(table|td|th)$/.test(da(e))}function Cf(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const eB=/transform|translate|scale|rotate|perspective|filter/,tB=/paint|layout|strict|content/,So=e=>!!e&&e!=="none";let kg;function fy(e){const t=Zr(e)?Qr(e):e;return So(t.transform)||So(t.translate)||So(t.scale)||So(t.rotate)||So(t.perspective)||!py()&&(So(t.backdropFilter)||So(t.filter))||eB.test(t.willChange||"")||tB.test(t.contain||"")}function nB(e){let t=Ys(e);for(;rs(t)&&!na(t);){if(fy(t))return t;if(Cf(t))return null;t=Ys(t)}return null}function py(){return kg==null&&(kg=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),kg}function na(e){return/^(html|body|#document)$/.test(da(e))}function Qr(e){return mr(e).getComputedStyle(e)}function kf(e){return Zr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ys(e){if(da(e)==="html")return e;const t=e.assignedSlot||e.parentNode||vw(e)&&e.host||ki(e);return vw(t)?t.host:t}function PE(e){const t=Ys(e);return na(t)?e.ownerDocument?e.ownerDocument.body:e.body:rs(t)&&mu(t)?t:PE(t)}function Kc(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=PE(e),l=s===((r=e.ownerDocument)==null?void 0:r.body),a=mr(s);if(l){const u=kv(a);return t.concat(a,a.visualViewport||[],mu(s)?s:[],u&&n?Kc(u):[])}else return t.concat(s,Kc(s,[],n))}function kv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function IE(e){const t=Qr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=rs(e),l=s?e.offsetWidth:n,a=s?e.offsetHeight:r,u=Wd(n)!==l||Wd(r)!==a;return u&&(n=l,r=a),{width:n,height:r,$:u}}function my(e){return Zr(e)?e:e.contextElement}function Yl(e){const t=my(e);if(!rs(t))return _i(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:l}=IE(t);let a=(l?Wd(n.width):n.width)/r,u=(l?Wd(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!u||!Number.isFinite(u))&&(u=1),{x:a,y:u}}const rB=_i(0);function HE(e){const t=mr(e);return!py()||!t.visualViewport?rB:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function iB(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==mr(e)?!1:t}function zo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),l=my(e);let a=_i(1);t&&(r?Zr(r)&&(a=Yl(r)):a=Yl(e));const u=iB(l,n,r)?HE(l):_i(0);let h=(s.left+u.x)/a.x,d=(s.top+u.y)/a.y,m=s.width/a.x,p=s.height/a.y;if(l){const _=mr(l),b=r&&Zr(r)?mr(r):r;let S=_,w=kv(S);for(;w&&r&&b!==S;){const C=Yl(w),k=w.getBoundingClientRect(),T=Qr(w),R=k.left+(w.clientLeft+parseFloat(T.paddingLeft))*C.x,D=k.top+(w.clientTop+parseFloat(T.paddingTop))*C.y;h*=C.x,d*=C.y,m*=C.x,p*=C.y,h+=R,d+=D,S=mr(w),w=kv(S)}}return Vd({width:m,height:p,x:h,y:d})}function Ef(e,t){const n=kf(e).scrollLeft;return t?t.left+n:zo(ki(e)).left+n}function FE(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Ef(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function sB(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const l=s==="fixed",a=ki(r),u=t?Cf(t.floating):!1;if(r===a||u&&l)return n;let h={scrollLeft:0,scrollTop:0},d=_i(1);const m=_i(0),p=rs(r);if((p||!p&&!l)&&((da(r)!=="body"||mu(a))&&(h=kf(r)),p)){const b=zo(r);d=Yl(r),m.x=b.x+r.clientLeft,m.y=b.y+r.clientTop}const _=a&&!p&&!l?FE(a,h):_i(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-h.scrollLeft*d.x+m.x+_.x,y:n.y*d.y-h.scrollTop*d.y+m.y+_.y}}function oB(e){return Array.from(e.getClientRects())}function lB(e){const t=ki(e),n=kf(e),r=e.ownerDocument.body,s=pr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),l=pr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Ef(e);const u=-n.scrollTop;return Qr(r).direction==="rtl"&&(a+=pr(t.clientWidth,r.clientWidth)-s),{width:s,height:l,x:a,y:u}}const _w=25;function aB(e,t){const n=mr(e),r=ki(e),s=n.visualViewport;let l=r.clientWidth,a=r.clientHeight,u=0,h=0;if(s){l=s.width,a=s.height;const m=py();(!m||m&&t==="fixed")&&(u=s.offsetLeft,h=s.offsetTop)}const d=Ef(r);if(d<=0){const m=r.ownerDocument,p=m.body,_=getComputedStyle(p),b=m.compatMode==="CSS1Compat"&&parseFloat(_.marginLeft)+parseFloat(_.marginRight)||0,S=Math.abs(r.clientWidth-p.clientWidth-b);S<=_w&&(l-=S)}else d<=_w&&(l+=d);return{width:l,height:a,x:u,y:h}}function cB(e,t){const n=zo(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,l=rs(e)?Yl(e):_i(1),a=e.clientWidth*l.x,u=e.clientHeight*l.y,h=s*l.x,d=r*l.y;return{width:a,height:u,x:h,y:d}}function yw(e,t,n){let r;if(t==="viewport")r=aB(e,n);else if(t==="document")r=lB(ki(e));else if(Zr(t))r=cB(t,n);else{const s=HE(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Vd(r)}function UE(e,t){const n=Ys(e);return n===t||!Zr(n)||na(n)?!1:Qr(n).position==="fixed"||UE(n,t)}function uB(e,t){const n=t.get(e);if(n)return n;let r=Kc(e,[],!1).filter(u=>Zr(u)&&da(u)!=="body"),s=null;const l=Qr(e).position==="fixed";let a=l?Ys(e):e;for(;Zr(a)&&!na(a);){const u=Qr(a),h=fy(a);!h&&u.position==="fixed"&&(s=null),(l?!h&&!s:!h&&u.position==="static"&&!!s&&(s.position==="absolute"||s.position==="fixed")||mu(a)&&!h&&UE(e,a))?r=r.filter(m=>m!==a):s=u,a=Ys(a)}return t.set(e,r),r}function hB(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const a=[...n==="clippingAncestors"?Cf(t)?[]:uB(t,this._c):[].concat(n),r],u=yw(t,a[0],s);let h=u.top,d=u.right,m=u.bottom,p=u.left;for(let _=1;_<a.length;_++){const b=yw(t,a[_],s);h=pr(b.top,h),d=Gs(b.right,d),m=Gs(b.bottom,m),p=pr(b.left,p)}return{width:d-p,height:m-h,x:p,y:h}}function dB(e){const{width:t,height:n}=IE(e);return{width:t,height:n}}function fB(e,t,n){const r=rs(t),s=ki(t),l=n==="fixed",a=zo(e,!0,l,t);let u={scrollLeft:0,scrollTop:0};const h=_i(0);function d(){h.x=Ef(s)}if(r||!r&&!l)if((da(t)!=="body"||mu(s))&&(u=kf(t)),r){const b=zo(t,!0,l,t);h.x=b.x+t.clientLeft,h.y=b.y+t.clientTop}else s&&d();l&&!r&&s&&d();const m=s&&!r&&!l?FE(s,u):_i(0),p=a.left+u.scrollLeft-h.x-m.x,_=a.top+u.scrollTop-h.y-m.y;return{x:p,y:_,width:a.width,height:a.height}}function Eg(e){return Qr(e).position==="static"}function bw(e,t){if(!rs(e)||Qr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ki(e)===n&&(n=n.ownerDocument.body),n}function $E(e,t){const n=mr(e);if(Cf(e))return n;if(!rs(e)){let s=Ys(e);for(;s&&!na(s);){if(Zr(s)&&!Eg(s))return s;s=Ys(s)}return n}let r=bw(e,t);for(;r&&J6(r)&&Eg(r);)r=bw(r,t);return r&&na(r)&&Eg(r)&&!fy(r)?n:r||nB(e)||n}const pB=async function(e){const t=this.getOffsetParent||$E,n=this.getDimensions,r=await n(e.floating);return{reference:fB(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function mB(e){return Qr(e).direction==="rtl"}const gB={convertOffsetParentRelativeRectToViewportRelativeRect:sB,getDocumentElement:ki,getClippingRect:hB,getOffsetParent:$E,getElementRects:pB,getClientRects:oB,getDimensions:dB,getScale:Yl,isElement:Zr,isRTL:mB};function WE(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function vB(e,t){let n=null,r;const s=ki(e);function l(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function a(u,h){u===void 0&&(u=!1),h===void 0&&(h=1),l();const d=e.getBoundingClientRect(),{left:m,top:p,width:_,height:b}=d;if(u||t(),!_||!b)return;const S=ed(p),w=ed(s.clientWidth-(m+_)),C=ed(s.clientHeight-(p+b)),k=ed(m),R={rootMargin:-S+"px "+-w+"px "+-C+"px "+-k+"px",threshold:pr(0,Gs(1,h))||1};let D=!0;function z(L){const O=L[0].intersectionRatio;if(O!==h){if(!D)return a();O?a(!1,O):r=setTimeout(()=>{a(!1,1e-7)},1e3)}O===1&&!WE(d,e.getBoundingClientRect())&&a(),D=!1}try{n=new IntersectionObserver(z,{...R,root:s.ownerDocument})}catch{n=new IntersectionObserver(z,R)}n.observe(e)}return a(!0),l}function _B(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:l=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:h=!1}=r,d=my(e),m=s||l?[...d?Kc(d):[],...t?Kc(t):[]]:[];m.forEach(k=>{s&&k.addEventListener("scroll",n,{passive:!0}),l&&k.addEventListener("resize",n)});const p=d&&u?vB(d,n):null;let _=-1,b=null;a&&(b=new ResizeObserver(k=>{let[T]=k;T&&T.target===d&&b&&t&&(b.unobserve(t),cancelAnimationFrame(_),_=requestAnimationFrame(()=>{var R;(R=b)==null||R.observe(t)})),n()}),d&&!h&&b.observe(d),t&&b.observe(t));let S,w=h?zo(e):null;h&&C();function C(){const k=zo(e);w&&!WE(w,k)&&n(),w=k,S=requestAnimationFrame(C)}return n(),()=>{var k;m.forEach(T=>{s&&T.removeEventListener("scroll",n),l&&T.removeEventListener("resize",n)}),p==null||p(),(k=b)==null||k.disconnect(),b=null,h&&cancelAnimationFrame(S)}}const yB=Y6,bB=X6,xB=V6,SB=Q6,wB=K6,xw=q6,CB=Z6,kB=(e,t,n)=>{const r=new Map,s={platform:gB,...n},l={...s.platform,_c:r};return W6(e,t,{...s,platform:l})};var EB=typeof document<"u",RB=function(){},Rd=EB?x.useLayoutEffect:RB;function Kd(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Kd(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const l=s[r];if(!(l==="_owner"&&e.$$typeof)&&!Kd(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function qE(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Sw(e,t){const n=qE(e);return Math.round(t*n)/n}function Rg(e){const t=x.useRef(e);return Rd(()=>{t.current=e}),t}function MB(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:l,floating:a}={},transform:u=!0,whileElementsMounted:h,open:d}=e,[m,p]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[_,b]=x.useState(r);Kd(_,r)||b(r);const[S,w]=x.useState(null),[C,k]=x.useState(null),T=x.useCallback($=>{$!==L.current&&(L.current=$,w($))},[]),R=x.useCallback($=>{$!==O.current&&(O.current=$,k($))},[]),D=l||S,z=a||C,L=x.useRef(null),O=x.useRef(null),B=x.useRef(m),X=h!=null,P=Rg(h),q=Rg(s),H=Rg(d),U=x.useCallback(()=>{if(!L.current||!O.current)return;const $={placement:t,strategy:n,middleware:_};q.current&&($.platform=q.current),kB(L.current,O.current,$).then(J=>{const A={...J,isPositioned:H.current!==!1};V.current&&!Kd(B.current,A)&&(B.current=A,$s.flushSync(()=>{p(A)}))})},[_,t,n,q,H]);Rd(()=>{d===!1&&B.current.isPositioned&&(B.current.isPositioned=!1,p($=>({...$,isPositioned:!1})))},[d]);const V=x.useRef(!1);Rd(()=>(V.current=!0,()=>{V.current=!1}),[]),Rd(()=>{if(D&&(L.current=D),z&&(O.current=z),D&&z){if(P.current)return P.current(D,z,U);U()}},[D,z,U,P,X]);const F=x.useMemo(()=>({reference:L,floating:O,setReference:T,setFloating:R}),[T,R]),j=x.useMemo(()=>({reference:D,floating:z}),[D,z]),K=x.useMemo(()=>{const $={position:n,left:0,top:0};if(!j.floating)return $;const J=Sw(j.floating,m.x),A=Sw(j.floating,m.y);return u?{...$,transform:"translate("+J+"px, "+A+"px)",...qE(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:J,top:A}},[n,u,j.floating,m.x,m.y]);return x.useMemo(()=>({...m,update:U,refs:F,elements:j,floatingStyles:K}),[m,U,F,j,K])}const TB=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?xw({element:r.current,padding:s}).fn(n):{}:r?xw({element:r,padding:s}).fn(n):{}}}},AB=(e,t)=>{const n=yB(e);return{name:n.name,fn:n.fn,options:[e,t]}},DB=(e,t)=>{const n=bB(e);return{name:n.name,fn:n.fn,options:[e,t]}},NB=(e,t)=>({fn:CB(e).fn,options:[e,t]}),OB=(e,t)=>{const n=xB(e);return{name:n.name,fn:n.fn,options:[e,t]}},LB=(e,t)=>{const n=SB(e);return{name:n.name,fn:n.fn,options:[e,t]}},zB=(e,t)=>{const n=wB(e);return{name:n.name,fn:n.fn,options:[e,t]}},BB=(e,t)=>{const n=TB(e);return{name:n.name,fn:n.fn,options:[e,t]}};var jB="Arrow",VE=x.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...l}=e;return v.jsx(bt.svg,{...l,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:v.jsx("polygon",{points:"0,0 30,0 15,10"})})});VE.displayName=jB;var PB=VE;function IB(e){const[t,n]=x.useState(void 0);return Ks(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const l=s[0];let a,u;if("borderBoxSize"in l){const h=l.borderBoxSize,d=Array.isArray(h)?h[0]:h;a=d.inlineSize,u=d.blockSize}else a=e.offsetWidth,u=e.offsetHeight;n({width:a,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var gy="Popper",[KE,fa]=Qs(gy),[HB,GE]=KE(gy),YE=e=>{const{__scopePopper:t,children:n}=e,[r,s]=x.useState(null);return v.jsx(HB,{scope:t,anchor:r,onAnchorChange:s,children:n})};YE.displayName=gy;var XE="PopperAnchor",ZE=x.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,l=GE(XE,n),a=x.useRef(null),u=Bt(t,a),h=x.useRef(null);return x.useEffect(()=>{const d=h.current;h.current=(r==null?void 0:r.current)||a.current,d!==h.current&&l.onAnchorChange(h.current)}),r?null:v.jsx(bt.div,{...s,ref:u})});ZE.displayName=XE;var vy="PopperContent",[FB,UB]=KE(vy),QE=x.forwardRef((e,t)=>{var pe,ke,me,Ee,et,Ge;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:l="center",alignOffset:a=0,arrowPadding:u=0,avoidCollisions:h=!0,collisionBoundary:d=[],collisionPadding:m=0,sticky:p="partial",hideWhenDetached:_=!1,updatePositionStrategy:b="optimized",onPlaced:S,...w}=e,C=GE(vy,n),[k,T]=x.useState(null),R=Bt(t,Me=>T(Me)),[D,z]=x.useState(null),L=IB(D),O=(L==null?void 0:L.width)??0,B=(L==null?void 0:L.height)??0,X=r+(l!=="center"?"-"+l:""),P=typeof m=="number"?m:{top:0,right:0,bottom:0,left:0,...m},q=Array.isArray(d)?d:[d],H=q.length>0,U={padding:P,boundary:q.filter(WB),altBoundary:H},{refs:V,floatingStyles:F,placement:j,isPositioned:K,middlewareData:$}=MB({strategy:"fixed",placement:X,whileElementsMounted:(...Me)=>_B(...Me,{animationFrame:b==="always"}),elements:{reference:C.anchor},middleware:[AB({mainAxis:s+B,alignmentAxis:a}),h&&DB({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?NB():void 0,...U}),h&&OB({...U}),LB({...U,apply:({elements:Me,rects:Xe,availableWidth:dn,availableHeight:fn})=>{const{width:Hr,height:Fr}=Xe.reference,pn=Me.floating.style;pn.setProperty("--radix-popper-available-width",`${dn}px`),pn.setProperty("--radix-popper-available-height",`${fn}px`),pn.setProperty("--radix-popper-anchor-width",`${Hr}px`),pn.setProperty("--radix-popper-anchor-height",`${Fr}px`)}}),D&&BB({element:D,padding:u}),qB({arrowWidth:O,arrowHeight:B}),_&&zB({strategy:"referenceHidden",...U})]}),[J,A]=tR(j),I=xi(S);Ks(()=>{K&&(I==null||I())},[K,I]);const Y=(pe=$.arrow)==null?void 0:pe.x,M=(ke=$.arrow)==null?void 0:ke.y,Z=((me=$.arrow)==null?void 0:me.centerOffset)!==0,[ae,se]=x.useState();return Ks(()=>{k&&se(window.getComputedStyle(k).zIndex)},[k]),v.jsx("div",{ref:V.setFloating,"data-radix-popper-content-wrapper":"",style:{...F,transform:K?F.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ae,"--radix-popper-transform-origin":[(Ee=$.transformOrigin)==null?void 0:Ee.x,(et=$.transformOrigin)==null?void 0:et.y].join(" "),...((Ge=$.hide)==null?void 0:Ge.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:v.jsx(FB,{scope:n,placedSide:J,onArrowChange:z,arrowX:Y,arrowY:M,shouldHideArrow:Z,children:v.jsx(bt.div,{"data-side":J,"data-align":A,...w,ref:R,style:{...w.style,animation:K?void 0:"none"}})})})});QE.displayName=vy;var JE="PopperArrow",$B={top:"bottom",right:"left",bottom:"top",left:"right"},eR=x.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,l=UB(JE,r),a=$B[l.placedSide];return v.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:v.jsx(PB,{...s,ref:n,style:{...s.style,display:"block"}})})});eR.displayName=JE;function WB(e){return e!==null}var qB=e=>({name:"transformOrigin",options:e,fn(t){var C,k,T;const{placement:n,rects:r,middlewareData:s}=t,a=((C=s.arrow)==null?void 0:C.centerOffset)!==0,u=a?0:e.arrowWidth,h=a?0:e.arrowHeight,[d,m]=tR(n),p={start:"0%",center:"50%",end:"100%"}[m],_=(((k=s.arrow)==null?void 0:k.x)??0)+u/2,b=(((T=s.arrow)==null?void 0:T.y)??0)+h/2;let S="",w="";return d==="bottom"?(S=a?p:`${_}px`,w=`${-h}px`):d==="top"?(S=a?p:`${_}px`,w=`${r.floating.height+h}px`):d==="right"?(S=`${-h}px`,w=a?p:`${b}px`):d==="left"&&(S=`${r.floating.width+h}px`,w=a?p:`${b}px`),{data:{x:S,y:w}}}});function tR(e){const[t,n="center"]=e.split("-");return[t,n]}var _y=YE,Rf=ZE,yy=QE,by=eR,VB=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"}),KB="VisuallyHidden",nR=x.forwardRef((e,t)=>v.jsx(bt.span,{...e,ref:t,style:{...VB,...e.style}}));nR.displayName=KB;var GB=nR,[Mf]=Qs("Tooltip",[fa]),Tf=fa(),rR="TooltipProvider",YB=700,Ev="tooltip.open",[XB,xy]=Mf(rR),iR=e=>{const{__scopeTooltip:t,delayDuration:n=YB,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:l}=e,a=x.useRef(!0),u=x.useRef(!1),h=x.useRef(0);return x.useEffect(()=>{const d=h.current;return()=>window.clearTimeout(d)},[]),v.jsx(XB,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:x.useCallback(()=>{window.clearTimeout(h.current),a.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:x.useCallback(d=>{u.current=d},[]),disableHoverableContent:s,children:l})};iR.displayName=rR;var Gc="Tooltip",[ZB,gu]=Mf(Gc),sR=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:l,disableHoverableContent:a,delayDuration:u}=e,h=xy(Gc,e.__scopeTooltip),d=Tf(t),[m,p]=x.useState(null),_=Kl(),b=x.useRef(0),S=a??h.disableHoverableContent,w=u??h.delayDuration,C=x.useRef(!1),[k,T]=vf({prop:r,defaultProp:s??!1,onChange:O=>{O?(h.onOpen(),document.dispatchEvent(new CustomEvent(Ev))):h.onClose(),l==null||l(O)},caller:Gc}),R=x.useMemo(()=>k?C.current?"delayed-open":"instant-open":"closed",[k]),D=x.useCallback(()=>{window.clearTimeout(b.current),b.current=0,C.current=!1,T(!0)},[T]),z=x.useCallback(()=>{window.clearTimeout(b.current),b.current=0,T(!1)},[T]),L=x.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{C.current=!0,T(!0),b.current=0},w)},[w,T]);return x.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]),v.jsx(_y,{...d,children:v.jsx(ZB,{scope:t,contentId:_,open:k,stateAttribute:R,trigger:m,onTriggerChange:p,onTriggerEnter:x.useCallback(()=>{h.isOpenDelayedRef.current?L():D()},[h.isOpenDelayedRef,L,D]),onTriggerLeave:x.useCallback(()=>{S?z():(window.clearTimeout(b.current),b.current=0)},[z,S]),onOpen:D,onClose:z,disableHoverableContent:S,children:n})})};sR.displayName=Gc;var Rv="TooltipTrigger",oR=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=gu(Rv,n),l=xy(Rv,n),a=Tf(n),u=x.useRef(null),h=Bt(t,u,s.onTriggerChange),d=x.useRef(!1),m=x.useRef(!1),p=x.useCallback(()=>d.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),v.jsx(Rf,{asChild:!0,...a,children:v.jsx(bt.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:h,onPointerMove:Ne(e.onPointerMove,_=>{_.pointerType!=="touch"&&!m.current&&!l.isPointerInTransitRef.current&&(s.onTriggerEnter(),m.current=!0)}),onPointerLeave:Ne(e.onPointerLeave,()=>{s.onTriggerLeave(),m.current=!1}),onPointerDown:Ne(e.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Ne(e.onFocus,()=>{d.current||s.onOpen()}),onBlur:Ne(e.onBlur,s.onClose),onClick:Ne(e.onClick,s.onClose)})})});oR.displayName=Rv;var Sy="TooltipPortal",[QB,JB]=Mf(Sy,{forceMount:void 0}),lR=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,l=gu(Sy,t);return v.jsx(QB,{scope:t,forceMount:n,children:v.jsx(Ir,{present:n||l.open,children:v.jsx(fu,{asChild:!0,container:s,children:r})})})};lR.displayName=Sy;var ra="TooltipContent",aR=x.forwardRef((e,t)=>{const n=JB(ra,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...l}=e,a=gu(ra,e.__scopeTooltip);return v.jsx(Ir,{present:r||a.open,children:a.disableHoverableContent?v.jsx(cR,{side:s,...l,ref:t}):v.jsx(ej,{side:s,...l,ref:t})})}),ej=x.forwardRef((e,t)=>{const n=gu(ra,e.__scopeTooltip),r=xy(ra,e.__scopeTooltip),s=x.useRef(null),l=Bt(t,s),[a,u]=x.useState(null),{trigger:h,onClose:d}=n,m=s.current,{onPointerInTransitChange:p}=r,_=x.useCallback(()=>{u(null),p(!1)},[p]),b=x.useCallback((S,w)=>{const C=S.currentTarget,k={x:S.clientX,y:S.clientY},T=sj(k,C.getBoundingClientRect()),R=oj(k,T),D=lj(w.getBoundingClientRect()),z=cj([...R,...D]);u(z),p(!0)},[p]);return x.useEffect(()=>()=>_(),[_]),x.useEffect(()=>{if(h&&m){const S=C=>b(C,m),w=C=>b(C,h);return h.addEventListener("pointerleave",S),m.addEventListener("pointerleave",w),()=>{h.removeEventListener("pointerleave",S),m.removeEventListener("pointerleave",w)}}},[h,m,b,_]),x.useEffect(()=>{if(a){const S=w=>{const C=w.target,k={x:w.clientX,y:w.clientY},T=(h==null?void 0:h.contains(C))||(m==null?void 0:m.contains(C)),R=!aj(k,a);T?_():R&&(_(),d())};return document.addEventListener("pointermove",S),()=>document.removeEventListener("pointermove",S)}},[h,m,a,d,_]),v.jsx(cR,{...e,ref:l})}),[tj,nj]=Mf(Gc,{isInside:!1}),rj=xO("TooltipContent"),cR=x.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:l,onPointerDownOutside:a,...u}=e,h=gu(ra,n),d=Tf(n),{onClose:m}=h;return x.useEffect(()=>(document.addEventListener(Ev,m),()=>document.removeEventListener(Ev,m)),[m]),x.useEffect(()=>{if(h.trigger){const p=_=>{const b=_.target;b!=null&&b.contains(h.trigger)&&m()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[h.trigger,m]),v.jsx(du,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:a,onFocusOutside:p=>p.preventDefault(),onDismiss:m,children:v.jsxs(yy,{"data-state":h.stateAttribute,...d,...u,ref:t,style:{...u.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:[v.jsx(rj,{children:r}),v.jsx(tj,{scope:n,isInside:!0,children:v.jsx(GB,{id:h.contentId,role:"tooltip",children:s||r})})]})})});aR.displayName=ra;var uR="TooltipArrow",ij=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Tf(n);return nj(uR,n).isInside?null:v.jsx(by,{...s,...r,ref:t})});ij.displayName=uR;function sj(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),l=Math.abs(t.left-e.x);switch(Math.min(n,r,s,l)){case l:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function oj(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function lj(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function aj(e,t){const{x:n,y:r}=e;let s=!1;for(let l=0,a=t.length-1;l<t.length;a=l++){const u=t[l],h=t[a],d=u.x,m=u.y,p=h.x,_=h.y;m>r!=_>r&&n<(p-d)*(r-m)/(_-m)+d&&(s=!s)}return s}function cj(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),uj(t)}function uj(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const l=t[t.length-1],a=t[t.length-2];if((l.x-a.x)*(s.y-a.y)>=(l.y-a.y)*(s.x-a.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const l=n[n.length-1],a=n[n.length-2];if((l.x-a.x)*(s.y-a.y)>=(l.y-a.y)*(s.x-a.x))n.pop();else break}n.push(s)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var hj=iR,dj=sR,fj=oR,pj=lR,hR=aR;const mj=hj,Yc=dj,Xc=fj,ia=x.forwardRef(({className:e,sideOffset:t=4,...n},r)=>v.jsx(pj,{children:v.jsx(hR,{ref:r,sideOffset:t,className:ye("z-50 overflow-hidden rounded-md bg-card text-card-foreground border border-border px-3 py-1.5 text-xs animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 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",e),...n})}));ia.displayName=hR.displayName;const gj="0.6.1",vj={version:gj},Ln="Kanna",ww="kanna",dR=`kanna/${vj.version}`,_j="[kanna]",yj=`~/${Ln}`;function td(e){return e?`${ww} ${e}`:ww}const Af=({children:e,className:t,shimmerWidth:n=100,animate:r=!0,...s})=>v.jsx("span",{style:{"--shiny-width":`${Math.min(n,100)}px`},className:ye("mx-auto max-w-md text-foreground/50",r?["animate-shiny-text [background-size:var(--shiny-width)_100%] bg-clip-text [background-position:0_0] bg-no-repeat [transition:background-position_1s_cubic-bezier(.6,.6,0,1)_infinite]","bg-gradient-to-r from-transparent via-black/80 via-50% to-transparent dark:via-white/80"]:["text-neutral"],t),...s,children:e});function Mv(e){return e.split(/[\s_-]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" ")}const bj=[/^(?:\/usr\/bin\/env\s+)?(?:\/bin\/)?(?:bash|zsh|sh)\s+(?:-[a-zA-Z]*c|-c)\s+(['"])([\s\S]*)\1$/,/^(?:\/usr\/bin\/env\s+)?(?:\/bin\/)?(?:bash|zsh|sh)\s+(?:-[a-zA-Z]*c|-c)\s+(.+)$/,/^(?:\/usr\/bin\/env\s+)?(?:cmd(?:\.exe)?)\s+\/c\s+(['"])([\s\S]*)\1$/i,/^(?:\/usr\/bin\/env\s+)?(?:cmd(?:\.exe)?)\s+\/c\s+(.+)$/i,/^(?:\/usr\/bin\/env\s+)?(?:powershell(?:\.exe)?|pwsh)\s+(?:-NoProfile\s+)?-Command\s+(['"])([\s\S]*)\1$/i,/^(?:\/usr\/bin\/env\s+)?(?:powershell(?:\.exe)?|pwsh)\s+(?:-NoProfile\s+)?-Command\s+(.+)$/i];function xj(e){const t=e.trim();for(const n of bj){const r=t.match(n);if(!r)continue;const s=(r[2]??r[1]??"").trim();if(s)return s}return t}function fR(e){return e.split("/").pop()||e}function Sj(e,t){if(e===void 0)return null;const n=Math.max(0,t-e),r=6e4,s=60*r,l=24*s,a=7*l;return n<r?"now":n<s?`${Math.floor(n/r)}m`:n<l?`${Math.floor(n/s)}h`:n<a?`${Math.floor(n/l)}d`:`${Math.floor(n/a)}w`}const wj=new Set(["starting","running"]);function Cj({chat:e,activeChatId:t,nowMs:n,onSelectChat:r,onDeleteChat:s}){const l=Sj(e.lastMessageAt,n);return v.jsxs("div",{"data-chat-id":WS(e.chatId),className:ye("group flex items-center gap-2 pl-2.5 pr-0.5 py-0.5 rounded-lg cursor-pointer border-border/0 hover:border-border hover:bg-muted/20 active:scale-[0.985] border transition-all",t===WS(e.chatId)?"bg-muted hover:bg-muted border-border":"border-border/0 dark:hover:border-slate-400/10 "),onClick:()=>r(e.chatId),children:[wj.has(e.status)?v.jsx(Js,{className:"size-3.5 flex-shrink-0 animate-spin text-muted-foreground"}):e.status==="waiting_for_user"?v.jsx("div",{className:"relative ",children:v.jsxs("div",{className:" rounded-full z-0 size-3.5 flex items-center justify-center ",children:[v.jsx("div",{className:"absolute rounded-full z-0 size-2.5 bg-blue-400/80 animate-ping"}),v.jsx("div",{className:" rounded-full z-0 size-2.5 bg-blue-400 ring-2 ring-muted/20 dark:ring-muted/50"})]})}):null,v.jsx("span",{className:"text-sm truncate flex-1 translate-y-[-0.5px]",children:e.status!=="idle"&&e.status!=="waiting_for_user"?v.jsx(Af,{animate:e.status==="running",shimmerWidth:Math.max(20,e.title.length*3),children:e.title}):e.title}),v.jsxs("div",{className:"relative h-7 w-7 mr-[2px] shrink-0",children:[l?v.jsx("span",{className:"hidden md:flex absolute inset-0 items-center justify-end pr-1 text-[11px] text-muted-foreground opacity-50 transition-opacity group-hover:opacity-0",children:l}):null,v.jsx(Ke,{variant:"ghost",size:"icon",className:ye("absolute inset-0 h-7 w-7 opacity-100 cursor-pointer rounded-sm hover:!bg-transparent !border-0",l?"md:opacity-0 md:group-hover:opacity-100":"opacity-100 md:opacity-0 md:group-hover:opacity-100"),onClick:a=>{a.stopPropagation(),s(e.chatId)},title:"Delete chat",children:v.jsx(ZL,{className:"size-3.5"})})]})]},e._id)}function kj(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return x.useMemo(()=>r=>{t.forEach(s=>s(r))},t)}const Df=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function pa(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function wy(e){return"nodeType"in e}function er(e){var t,n;return e?pa(e)?e:wy(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Cy(e){const{Document:t}=er(e);return e instanceof t}function vu(e){return pa(e)?!1:e instanceof er(e).HTMLElement}function pR(e){return e instanceof er(e).SVGElement}function ma(e){return e?pa(e)?e.document:wy(e)?Cy(e)?e:vu(e)||pR(e)?e.ownerDocument:document:document:document}const Si=Df?x.useLayoutEffect:x.useEffect;function ky(e){const t=x.useRef(e);return Si(()=>{t.current=e}),x.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return t.current==null?void 0:t.current(...r)},[])}function Ej(){const e=x.useRef(null),t=x.useCallback((r,s)=>{e.current=setInterval(r,s)},[]),n=x.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Zc(e,t){t===void 0&&(t=[e]);const n=x.useRef(e);return Si(()=>{n.current!==e&&(n.current=e)},t),n}function _u(e,t){const n=x.useRef();return x.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Gd(e){const t=ky(e),n=x.useRef(null),r=x.useCallback(s=>{s!==n.current&&(t==null||t(s,n.current)),n.current=s},[]);return[n,r]}function Tv(e){const t=x.useRef();return x.useEffect(()=>{t.current=e},[e]),t.current}let Mg={};function yu(e,t){return x.useMemo(()=>{if(t)return t;const n=Mg[e]==null?0:Mg[e]+1;return Mg[e]=n,e+"-"+n},[e,t])}function mR(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return r.reduce((l,a)=>{const u=Object.entries(a);for(const[h,d]of u){const m=l[h];m!=null&&(l[h]=m+e*d)}return l},{...t})}}const Xl=mR(1),Yd=mR(-1);function Rj(e){return"clientX"in e&&"clientY"in e}function Ey(e){if(!e)return!1;const{KeyboardEvent:t}=er(e.target);return t&&e instanceof t}function Mj(e){if(!e)return!1;const{TouchEvent:t}=er(e.target);return t&&e instanceof t}function Av(e){if(Mj(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Rj(e)?{x:e.clientX,y:e.clientY}:null}const Qc=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Qc.Translate.toString(e),Qc.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Cw="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Tj(e){return e.matches(Cw)?e:e.querySelector(Cw)}const Aj={display:"none"};function Dj(e){let{id:t,value:n}=e;return pt.createElement("div",{id:t,style:Aj},n)}function Nj(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return pt.createElement("div",{id:t,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function Oj(){const[e,t]=x.useState("");return{announce:x.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const gR=x.createContext(null);function Lj(e){const t=x.useContext(gR);x.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function zj(){const[e]=x.useState(()=>new Set),t=x.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[x.useCallback(r=>{let{type:s,event:l}=r;e.forEach(a=>{var u;return(u=a[s])==null?void 0:u.call(a,l)})},[e]),t]}const Bj={draggable:`
|
|
395
|
-
To pick up a draggable item, press the space bar.
|
|
396
|
-
While dragging, use the arrow keys to move the item.
|
|
397
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
398
|
-
`},jj={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Pj(e){let{announcements:t=jj,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=Bj}=e;const{announce:l,announcement:a}=Oj(),u=yu("DndLiveRegion"),[h,d]=x.useState(!1);if(x.useEffect(()=>{d(!0)},[]),Lj(x.useMemo(()=>({onDragStart(p){let{active:_}=p;l(t.onDragStart({active:_}))},onDragMove(p){let{active:_,over:b}=p;t.onDragMove&&l(t.onDragMove({active:_,over:b}))},onDragOver(p){let{active:_,over:b}=p;l(t.onDragOver({active:_,over:b}))},onDragEnd(p){let{active:_,over:b}=p;l(t.onDragEnd({active:_,over:b}))},onDragCancel(p){let{active:_,over:b}=p;l(t.onDragCancel({active:_,over:b}))}}),[l,t])),!h)return null;const m=pt.createElement(pt.Fragment,null,pt.createElement(Dj,{id:r,value:s.draggable}),pt.createElement(Nj,{id:u,announcement:a}));return n?$s.createPortal(m,n):m}var Xt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Xt||(Xt={}));function Xd(){}function kw(e,t){return x.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Ij(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return x.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const Jr=Object.freeze({x:0,y:0});function Hj(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Fj(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Uj(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function $j(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Ew(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const Wj=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=Ew(t,t.left,t.top),l=[];for(const a of r){const{id:u}=a,h=n.get(u);if(h){const d=Hj(Ew(h),s);l.push({id:u,data:{droppableContainer:a,value:d}})}}return l.sort(Fj)};function qj(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),s=Math.min(t.left+t.width,e.left+e.width),l=Math.min(t.top+t.height,e.top+e.height),a=s-r,u=l-n;if(r<s&&n<l){const h=t.width*t.height,d=e.width*e.height,m=a*u,p=m/(h+d-m);return Number(p.toFixed(4))}return 0}const Vj=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=[];for(const l of r){const{id:a}=l,u=n.get(a);if(u){const h=qj(u,t);h>0&&s.push({id:a,data:{droppableContainer:l,value:h}})}}return s.sort(Uj)};function Kj(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function vR(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Jr}function Gj(e){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),l=1;l<r;l++)s[l-1]=arguments[l];return s.reduce((a,u)=>({...a,top:a.top+e*u.y,bottom:a.bottom+e*u.y,left:a.left+e*u.x,right:a.right+e*u.x}),{...n})}}const Yj=Gj(1);function Xj(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Zj(e,t,n){const r=Xj(t);if(!r)return e;const{scaleX:s,scaleY:l,x:a,y:u}=r,h=e.left-a-(1-s)*parseFloat(n),d=e.top-u-(1-l)*parseFloat(n.slice(n.indexOf(" ")+1)),m=s?e.width/s:e.width,p=l?e.height/l:e.height;return{width:m,height:p,top:d,right:h+m,bottom:d+p,left:h}}const Qj={ignoreTransform:!1};function ga(e,t){t===void 0&&(t=Qj);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:m}=er(e).getComputedStyle(e);d&&(n=Zj(n,d,m))}const{top:r,left:s,width:l,height:a,bottom:u,right:h}=n;return{top:r,left:s,width:l,height:a,bottom:u,right:h}}function Rw(e){return ga(e,{ignoreTransform:!0})}function Jj(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function eP(e,t){return t===void 0&&(t=er(e).getComputedStyle(e)),t.position==="fixed"}function tP(e,t){t===void 0&&(t=er(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const l=t[s];return typeof l=="string"?n.test(l):!1})}function Ry(e,t){const n=[];function r(s){if(t!=null&&n.length>=t||!s)return n;if(Cy(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!vu(s)||pR(s)||n.includes(s))return n;const l=er(e).getComputedStyle(s);return s!==e&&tP(s,l)&&n.push(s),eP(s,l)?n:r(s.parentNode)}return e?r(e):n}function _R(e){const[t]=Ry(e,1);return t??null}function Tg(e){return!Df||!e?null:pa(e)?e:wy(e)?Cy(e)||e===ma(e).scrollingElement?window:vu(e)?e:null:null}function yR(e){return pa(e)?e.scrollX:e.scrollLeft}function bR(e){return pa(e)?e.scrollY:e.scrollTop}function Dv(e){return{x:yR(e),y:bR(e)}}var rn;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(rn||(rn={}));function xR(e){return!Df||!e?!1:e===document.scrollingElement}function SR(e){const t={x:0,y:0},n=xR(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},s=e.scrollTop<=t.y,l=e.scrollLeft<=t.x,a=e.scrollTop>=r.y,u=e.scrollLeft>=r.x;return{isTop:s,isLeft:l,isBottom:a,isRight:u,maxScroll:r,minScroll:t}}const nP={x:.2,y:.2};function rP(e,t,n,r,s){let{top:l,left:a,right:u,bottom:h}=n;r===void 0&&(r=10),s===void 0&&(s=nP);const{isTop:d,isBottom:m,isLeft:p,isRight:_}=SR(e),b={x:0,y:0},S={x:0,y:0},w={height:t.height*s.y,width:t.width*s.x};return!d&&l<=t.top+w.height?(b.y=rn.Backward,S.y=r*Math.abs((t.top+w.height-l)/w.height)):!m&&h>=t.bottom-w.height&&(b.y=rn.Forward,S.y=r*Math.abs((t.bottom-w.height-h)/w.height)),!_&&u>=t.right-w.width?(b.x=rn.Forward,S.x=r*Math.abs((t.right-w.width-u)/w.width)):!p&&a<=t.left+w.width&&(b.x=rn.Backward,S.x=r*Math.abs((t.left+w.width-a)/w.width)),{direction:b,speed:S}}function iP(e){if(e===document.scrollingElement){const{innerWidth:l,innerHeight:a}=window;return{top:0,left:0,right:l,bottom:a,width:l,height:a}}const{top:t,left:n,right:r,bottom:s}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:s,width:e.clientWidth,height:e.clientHeight}}function wR(e){return e.reduce((t,n)=>Xl(t,Dv(n)),Jr)}function sP(e){return e.reduce((t,n)=>t+yR(n),0)}function oP(e){return e.reduce((t,n)=>t+bR(n),0)}function lP(e,t){if(t===void 0&&(t=ga),!e)return;const{top:n,left:r,bottom:s,right:l}=t(e);_R(e)&&(s<=0||l<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const aP=[["x",["left","right"],sP],["y",["top","bottom"],oP]];class My{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Ry(n),s=wR(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[l,a,u]of aP)for(const h of a)Object.defineProperty(this,h,{get:()=>{const d=u(r),m=s[l]-d;return this.rect[h]+m},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Bc{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var s;(s=this.target)==null||s.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function cP(e){const{EventTarget:t}=er(e);return e instanceof t?e:ma(e)}function Ag(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var Or;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Or||(Or={}));function Mw(e){e.preventDefault()}function uP(e){e.stopPropagation()}var nt;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(nt||(nt={}));const CR={start:[nt.Space,nt.Enter],cancel:[nt.Esc],end:[nt.Space,nt.Enter,nt.Tab]},hP=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case nt.Right:return{...n,x:n.x+25};case nt.Left:return{...n,x:n.x-25};case nt.Down:return{...n,y:n.y+25};case nt.Up:return{...n,y:n.y-25}}};class Ty{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Bc(ma(n)),this.windowListeners=new Bc(er(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Or.Resize,this.handleCancel),this.windowListeners.add(Or.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Or.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&lP(r),n(Jr)}handleKeyDown(t){if(Ey(t)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:l=CR,coordinateGetter:a=hP,scrollBehavior:u="smooth"}=s,{code:h}=t;if(l.end.includes(h)){this.handleEnd(t);return}if(l.cancel.includes(h)){this.handleCancel(t);return}const{collisionRect:d}=r.current,m=d?{x:d.left,y:d.top}:Jr;this.referenceCoordinates||(this.referenceCoordinates=m);const p=a(t,{active:n,context:r.current,currentCoordinates:m});if(p){const _=Yd(p,m),b={x:0,y:0},{scrollableAncestors:S}=r.current;for(const w of S){const C=t.code,{isTop:k,isRight:T,isLeft:R,isBottom:D,maxScroll:z,minScroll:L}=SR(w),O=iP(w),B={x:Math.min(C===nt.Right?O.right-O.width/2:O.right,Math.max(C===nt.Right?O.left:O.left+O.width/2,p.x)),y:Math.min(C===nt.Down?O.bottom-O.height/2:O.bottom,Math.max(C===nt.Down?O.top:O.top+O.height/2,p.y))},X=C===nt.Right&&!T||C===nt.Left&&!R,P=C===nt.Down&&!D||C===nt.Up&&!k;if(X&&B.x!==p.x){const q=w.scrollLeft+_.x,H=C===nt.Right&&q<=z.x||C===nt.Left&&q>=L.x;if(H&&!_.y){w.scrollTo({left:q,behavior:u});return}H?b.x=w.scrollLeft-q:b.x=C===nt.Right?w.scrollLeft-z.x:w.scrollLeft-L.x,b.x&&w.scrollBy({left:-b.x,behavior:u});break}else if(P&&B.y!==p.y){const q=w.scrollTop+_.y,H=C===nt.Down&&q<=z.y||C===nt.Up&&q>=L.y;if(H&&!_.x){w.scrollTo({top:q,behavior:u});return}H?b.y=w.scrollTop-q:b.y=C===nt.Down?w.scrollTop-z.y:w.scrollTop-L.y,b.y&&w.scrollBy({top:-b.y,behavior:u});break}}this.handleMove(t,Xl(Yd(p,this.referenceCoordinates),b))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Ty.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=CR,onActivation:s}=t,{active:l}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const u=l.activatorNode.current;return u&&e.target!==u?!1:(e.preventDefault(),s==null||s({event:e.nativeEvent}),!0)}return!1}}];function Tw(e){return!!(e&&"distance"in e)}function Aw(e){return!!(e&&"delay"in e)}class Ay{constructor(t,n,r){var s;r===void 0&&(r=cP(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:l}=t,{target:a}=l;this.props=t,this.events=n,this.document=ma(a),this.documentListeners=new Bc(this.document),this.listeners=new Bc(r),this.windowListeners=new Bc(er(a)),this.initialCoordinates=(s=Av(l))!=null?s:Jr,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Or.Resize,this.handleCancel),this.windowListeners.add(Or.DragStart,Mw),this.windowListeners.add(Or.VisibilityChange,this.handleCancel),this.windowListeners.add(Or.ContextMenu,Mw),this.documentListeners.add(Or.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Aw(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Tw(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:s}=this.props;s(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Or.Click,uP,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Or.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:s,props:l}=this,{onMove:a,options:{activationConstraint:u}}=l;if(!s)return;const h=(n=Av(t))!=null?n:Jr,d=Yd(s,h);if(!r&&u){if(Tw(u)){if(u.tolerance!=null&&Ag(d,u.tolerance))return this.handleCancel();if(Ag(d,u.distance))return this.handleStart()}if(Aw(u)&&Ag(d,u.tolerance))return this.handleCancel();this.handlePending(u,d);return}t.cancelable&&t.preventDefault(),a(h)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===nt.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const dP={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Dy extends Ay{constructor(t){const{event:n}=t,r=ma(n.target);super(t,dP,r)}}Dy.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const fP={move:{name:"mousemove"},end:{name:"mouseup"}};var Nv;(function(e){e[e.RightClick=2]="RightClick"})(Nv||(Nv={}));class pP extends Ay{constructor(t){super(t,fP,ma(t.event.target))}}pP.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Nv.RightClick?!1:(r==null||r({event:n}),!0)}}];const Dg={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class mP extends Ay{constructor(t){super(t,Dg)}static setup(){return window.addEventListener(Dg.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Dg.move.name,t)};function t(){}}}mP.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:s}=n;return s.length>1?!1:(r==null||r({event:n}),!0)}}];var jc;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(jc||(jc={}));var Zd;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Zd||(Zd={}));function gP(e){let{acceleration:t,activator:n=jc.Pointer,canScroll:r,draggingRect:s,enabled:l,interval:a=5,order:u=Zd.TreeOrder,pointerCoordinates:h,scrollableAncestors:d,scrollableAncestorRects:m,delta:p,threshold:_}=e;const b=_P({delta:p,disabled:!l}),[S,w]=Ej(),C=x.useRef({x:0,y:0}),k=x.useRef({x:0,y:0}),T=x.useMemo(()=>{switch(n){case jc.Pointer:return h?{top:h.y,bottom:h.y,left:h.x,right:h.x}:null;case jc.DraggableRect:return s}},[n,s,h]),R=x.useRef(null),D=x.useCallback(()=>{const L=R.current;if(!L)return;const O=C.current.x*k.current.x,B=C.current.y*k.current.y;L.scrollBy(O,B)},[]),z=x.useMemo(()=>u===Zd.TreeOrder?[...d].reverse():d,[u,d]);x.useEffect(()=>{if(!l||!d.length||!T){w();return}for(const L of z){if((r==null?void 0:r(L))===!1)continue;const O=d.indexOf(L),B=m[O];if(!B)continue;const{direction:X,speed:P}=rP(L,B,T,t,_);for(const q of["x","y"])b[q][X[q]]||(P[q]=0,X[q]=0);if(P.x>0||P.y>0){w(),R.current=L,S(D,a),C.current=P,k.current=X;return}}C.current={x:0,y:0},k.current={x:0,y:0},w()},[t,D,r,w,l,a,JSON.stringify(T),JSON.stringify(b),S,d,z,m,JSON.stringify(_)])}const vP={x:{[rn.Backward]:!1,[rn.Forward]:!1},y:{[rn.Backward]:!1,[rn.Forward]:!1}};function _P(e){let{delta:t,disabled:n}=e;const r=Tv(t);return _u(s=>{if(n||!r||!s)return vP;const l={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[rn.Backward]:s.x[rn.Backward]||l.x===-1,[rn.Forward]:s.x[rn.Forward]||l.x===1},y:{[rn.Backward]:s.y[rn.Backward]||l.y===-1,[rn.Forward]:s.y[rn.Forward]||l.y===1}}},[n,t,r])}function yP(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return _u(s=>{var l;return t==null?null:(l=r??s)!=null?l:null},[r,t])}function bP(e,t){return x.useMemo(()=>e.reduce((n,r)=>{const{sensor:s}=r,l=s.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,r)}));return[...n,...l]},[]),[e,t])}var Jc;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Jc||(Jc={}));var Ov;(function(e){e.Optimized="optimized"})(Ov||(Ov={}));const Dw=new Map;function xP(e,t){let{dragging:n,dependencies:r,config:s}=t;const[l,a]=x.useState(null),{frequency:u,measure:h,strategy:d}=s,m=x.useRef(e),p=C(),_=Zc(p),b=x.useCallback(function(k){k===void 0&&(k=[]),!_.current&&a(T=>T===null?k:T.concat(k.filter(R=>!T.includes(R))))},[_]),S=x.useRef(null),w=_u(k=>{if(p&&!n)return Dw;if(!k||k===Dw||m.current!==e||l!=null){const T=new Map;for(let R of e){if(!R)continue;if(l&&l.length>0&&!l.includes(R.id)&&R.rect.current){T.set(R.id,R.rect.current);continue}const D=R.node.current,z=D?new My(h(D),D):null;R.rect.current=z,z&&T.set(R.id,z)}return T}return k},[e,l,n,p,h]);return x.useEffect(()=>{m.current=e},[e]),x.useEffect(()=>{p||b()},[n,p]),x.useEffect(()=>{l&&l.length>0&&a(null)},[JSON.stringify(l)]),x.useEffect(()=>{p||typeof u!="number"||S.current!==null||(S.current=setTimeout(()=>{b(),S.current=null},u))},[u,p,b,...r]),{droppableRects:w,measureDroppableContainers:b,measuringScheduled:l!=null};function C(){switch(d){case Jc.Always:return!1;case Jc.BeforeDragging:return n;default:return!n}}}function kR(e,t){return _u(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function SP(e,t){return kR(e,t)}function wP(e){let{callback:t,disabled:n}=e;const r=ky(t),s=x.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:l}=window;return new l(r)},[r,n]);return x.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function Nf(e){let{callback:t,disabled:n}=e;const r=ky(t),s=x.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:l}=window;return new l(r)},[n]);return x.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function CP(e){return new My(ga(e),e)}function Nw(e,t,n){t===void 0&&(t=CP);const[r,s]=x.useState(null);function l(){s(h=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=h??n)!=null?d:null}const m=t(e);return JSON.stringify(h)===JSON.stringify(m)?h:m})}const a=wP({callback(h){if(e)for(const d of h){const{type:m,target:p}=d;if(m==="childList"&&p instanceof HTMLElement&&p.contains(e)){l();break}}}}),u=Nf({callback:l});return Si(()=>{l(),e?(u==null||u.observe(e),a==null||a.observe(document.body,{childList:!0,subtree:!0})):(u==null||u.disconnect(),a==null||a.disconnect())},[e]),r}function kP(e){const t=kR(e);return vR(e,t)}const Ow=[];function EP(e){const t=x.useRef(e),n=_u(r=>e?r&&r!==Ow&&e&&t.current&&e.parentNode===t.current.parentNode?r:Ry(e):Ow,[e]);return x.useEffect(()=>{t.current=e},[e]),n}function RP(e){const[t,n]=x.useState(null),r=x.useRef(e),s=x.useCallback(l=>{const a=Tg(l.target);a&&n(u=>u?(u.set(a,Dv(a)),new Map(u)):null)},[]);return x.useEffect(()=>{const l=r.current;if(e!==l){a(l);const u=e.map(h=>{const d=Tg(h);return d?(d.addEventListener("scroll",s,{passive:!0}),[d,Dv(d)]):null}).filter(h=>h!=null);n(u.length?new Map(u):null),r.current=e}return()=>{a(e),a(l)};function a(u){u.forEach(h=>{const d=Tg(h);d==null||d.removeEventListener("scroll",s)})}},[s,e]),x.useMemo(()=>e.length?t?Array.from(t.values()).reduce((l,a)=>Xl(l,a),Jr):wR(e):Jr,[e,t])}function Lw(e,t){t===void 0&&(t=[]);const n=x.useRef(null);return x.useEffect(()=>{n.current=null},t),x.useEffect(()=>{const r=e!==Jr;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Yd(e,n.current):Jr}function MP(e){x.useEffect(()=>{if(!Df)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function TP(e,t){return x.useMemo(()=>e.reduce((n,r)=>{let{eventName:s,handler:l}=r;return n[s]=a=>{l(a,t)},n},{}),[e,t])}function ER(e){return x.useMemo(()=>e?Jj(e):null,[e])}const zw=[];function AP(e,t){t===void 0&&(t=ga);const[n]=e,r=ER(n?er(n):null),[s,l]=x.useState(zw);function a(){l(()=>e.length?e.map(h=>xR(h)?r:new My(t(h),h)):zw)}const u=Nf({callback:a});return Si(()=>{u==null||u.disconnect(),a(),e.forEach(h=>u==null?void 0:u.observe(h))},[e]),s}function DP(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return vu(t)?t:e}function NP(e){let{measure:t}=e;const[n,r]=x.useState(null),s=x.useCallback(d=>{for(const{target:m}of d)if(vu(m)){r(p=>{const _=t(m);return p?{...p,width:_.width,height:_.height}:_});break}},[t]),l=Nf({callback:s}),a=x.useCallback(d=>{const m=DP(d);l==null||l.disconnect(),m&&(l==null||l.observe(m)),r(m?t(m):null)},[t,l]),[u,h]=Gd(a);return x.useMemo(()=>({nodeRef:u,rect:n,setRef:h}),[n,u,h])}const OP=[{sensor:Dy,options:{}},{sensor:Ty,options:{}}],LP={current:{}},Md={draggable:{measure:Rw},droppable:{measure:Rw,strategy:Jc.WhileDragging,frequency:Ov.Optimized},dragOverlay:{measure:ga}};class Pc extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const zP={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Pc,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Xd},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Md,measureDroppableContainers:Xd,windowRect:null,measuringScheduled:!1},BP={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Xd,draggableNodes:new Map,over:null,measureDroppableContainers:Xd},Of=x.createContext(BP),RR=x.createContext(zP);function jP(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Pc}}}function PP(e,t){switch(t.type){case Xt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Xt.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Xt.DragEnd:case Xt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Xt.RegisterDroppable:{const{element:n}=t,{id:r}=n,s=new Pc(e.droppable.containers);return s.set(r,n),{...e,droppable:{...e.droppable,containers:s}}}case Xt.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=t,l=e.droppable.containers.get(n);if(!l||r!==l.key)return e;const a=new Pc(e.droppable.containers);return a.set(n,{...l,disabled:s}),{...e,droppable:{...e.droppable,containers:a}}}case Xt.UnregisterDroppable:{const{id:n,key:r}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const l=new Pc(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function IP(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:s}=x.useContext(Of),l=Tv(r),a=Tv(n==null?void 0:n.id);return x.useEffect(()=>{if(!t&&!r&&l&&a!=null){if(!Ey(l)||document.activeElement===l.target)return;const u=s.get(a);if(!u)return;const{activatorNode:h,node:d}=u;if(!h.current&&!d.current)return;requestAnimationFrame(()=>{for(const m of[h.current,d.current]){if(!m)continue;const p=Tj(m);if(p){p.focus();break}}})}},[r,t,s,a,l]),null}function HP(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((s,l)=>l({transform:s,...r}),n):n}function FP(e){return x.useMemo(()=>({draggable:{...Md.draggable,...e==null?void 0:e.draggable},droppable:{...Md.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Md.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function UP(e){let{activeNode:t,measure:n,initialRect:r,config:s=!0}=e;const l=x.useRef(!1),{x:a,y:u}=typeof s=="boolean"?{x:s,y:s}:s;Si(()=>{if(!a&&!u||!t){l.current=!1;return}if(l.current||!r)return;const d=t==null?void 0:t.node.current;if(!d||d.isConnected===!1)return;const m=n(d),p=vR(m,r);if(a||(p.x=0),u||(p.y=0),l.current=!0,Math.abs(p.x)>0||Math.abs(p.y)>0){const _=_R(d);_&&_.scrollBy({top:p.y,left:p.x})}},[t,a,u,r,n])}const MR=x.createContext({...Jr,scaleX:1,scaleY:1});var Hs;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Hs||(Hs={}));const $P=x.memo(function(t){var n,r,s,l;let{id:a,accessibility:u,autoScroll:h=!0,children:d,sensors:m=OP,collisionDetection:p=Vj,measuring:_,modifiers:b,...S}=t;const w=x.useReducer(PP,void 0,jP),[C,k]=w,[T,R]=zj(),[D,z]=x.useState(Hs.Uninitialized),L=D===Hs.Initialized,{draggable:{active:O,nodes:B,translate:X},droppable:{containers:P}}=C,q=O!=null?B.get(O):null,H=x.useRef({initial:null,translated:null}),U=x.useMemo(()=>{var Dt;return O!=null?{id:O,data:(Dt=q==null?void 0:q.data)!=null?Dt:LP,rect:H}:null},[O,q]),V=x.useRef(null),[F,j]=x.useState(null),[K,$]=x.useState(null),J=Zc(S,Object.values(S)),A=yu("DndDescribedBy",a),I=x.useMemo(()=>P.getEnabled(),[P]),Y=FP(_),{droppableRects:M,measureDroppableContainers:Z,measuringScheduled:ae}=xP(I,{dragging:L,dependencies:[X.x,X.y],config:Y.droppable}),se=yP(B,O),pe=x.useMemo(()=>K?Av(K):null,[K]),ke=Xo(),me=SP(se,Y.draggable.measure);UP({activeNode:O!=null?B.get(O):null,config:ke.layoutShiftCompensation,initialRect:me,measure:Y.draggable.measure});const Ee=Nw(se,Y.draggable.measure,me),et=Nw(se?se.parentElement:null),Ge=x.useRef({activatorEvent:null,active:null,activeNode:se,collisionRect:null,collisions:null,droppableRects:M,draggableNodes:B,draggingNode:null,draggingNodeRect:null,droppableContainers:P,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Me=P.getNodeFor((n=Ge.current.over)==null?void 0:n.id),Xe=NP({measure:Y.dragOverlay.measure}),dn=(r=Xe.nodeRef.current)!=null?r:se,fn=L?(s=Xe.rect)!=null?s:Ee:null,Hr=!!(Xe.nodeRef.current&&Xe.rect),Fr=kP(Hr?null:Ee),pn=ER(dn?er(dn):null),mn=EP(L?Me??se:null),vr=AP(mn),ni=HP(b,{transform:{x:X.x-Fr.x,y:X.y-Fr.y,scaleX:1,scaleY:1},activatorEvent:K,active:U,activeNodeRect:Ee,containerNodeRect:et,draggingNodeRect:fn,over:Ge.current.over,overlayNodeRect:Xe.rect,scrollableAncestors:mn,scrollableAncestorRects:vr,windowRect:pn}),ls=pe?Xl(pe,X):null,Tt=RP(mn),as=Lw(Tt),le=Lw(Tt,[Ee]),ne=Xl(ni,as),de=fn?Yj(fn,ni):null,ve=U&&de?p({active:U,collisionRect:de,droppableRects:M,droppableContainers:I,pointerCoordinates:ls}):null,Ce=$j(ve,"id"),[Pe,nr]=x.useState(null),gn=Hr?ni:Xl(ni,le),At=Kj(gn,(l=Pe==null?void 0:Pe.rect)!=null?l:null,Ee),Qt=x.useRef(null),rt=x.useCallback((Dt,Nt)=>{let{sensor:Jt,options:Fn}=Nt;if(V.current==null)return;const Un=B.get(V.current);if(!Un)return;const kn=Dt.nativeEvent,$n=new Jt({active:V.current,activeNode:Un,event:kn,options:Fn,context:Ge,onAbort(Wt){if(!B.get(Wt))return;const{onDragAbort:rr}=J.current,yr={id:Wt};rr==null||rr(yr),T({type:"onDragAbort",event:yr})},onPending(Wt,Ur,rr,yr){if(!B.get(Wt))return;const{onDragPending:Mi}=J.current,$r={id:Wt,constraint:Ur,initialCoordinates:rr,offset:yr};Mi==null||Mi($r),T({type:"onDragPending",event:$r})},onStart(Wt){const Ur=V.current;if(Ur==null)return;const rr=B.get(Ur);if(!rr)return;const{onDragStart:yr}=J.current,Ri={activatorEvent:kn,active:{id:Ur,data:rr.data,rect:H}};$s.unstable_batchedUpdates(()=>{yr==null||yr(Ri),z(Hs.Initializing),k({type:Xt.DragStart,initialCoordinates:Wt,active:Ur}),T({type:"onDragStart",event:Ri}),j(Qt.current),$(kn)})},onMove(Wt){k({type:Xt.DragMove,coordinates:Wt})},onEnd:_r(Xt.DragEnd),onCancel:_r(Xt.DragCancel)});Qt.current=$n;function _r(Wt){return async function(){const{active:rr,collisions:yr,over:Ri,scrollAdjustedTranslate:Mi}=Ge.current;let $r=null;if(rr&&Mi){const{cancelDrop:cs}=J.current;$r={activatorEvent:kn,active:rr,collisions:yr,delta:Mi,over:Ri},Wt===Xt.DragEnd&&typeof cs=="function"&&await Promise.resolve(cs($r))&&(Wt=Xt.DragCancel)}V.current=null,$s.unstable_batchedUpdates(()=>{k({type:Wt}),z(Hs.Uninitialized),nr(null),j(null),$(null),Qt.current=null;const cs=Wt===Xt.DragEnd?"onDragEnd":"onDragCancel";if($r){const br=J.current[cs];br==null||br($r),T({type:cs,event:$r})}})}}},[B]),ri=x.useCallback((Dt,Nt)=>(Jt,Fn)=>{const Un=Jt.nativeEvent,kn=B.get(Fn);if(V.current!==null||!kn||Un.dndKit||Un.defaultPrevented)return;const $n={active:kn};Dt(Jt,Nt.options,$n)===!0&&(Un.dndKit={capturedBy:Nt.sensor},V.current=Fn,rt(Jt,Nt))},[B,rt]),Hn=bP(m,ri);MP(m),Si(()=>{Ee&&D===Hs.Initializing&&z(Hs.Initialized)},[Ee,D]),x.useEffect(()=>{const{onDragMove:Dt}=J.current,{active:Nt,activatorEvent:Jt,collisions:Fn,over:Un}=Ge.current;if(!Nt||!Jt)return;const kn={active:Nt,activatorEvent:Jt,collisions:Fn,delta:{x:ne.x,y:ne.y},over:Un};$s.unstable_batchedUpdates(()=>{Dt==null||Dt(kn),T({type:"onDragMove",event:kn})})},[ne.x,ne.y]),x.useEffect(()=>{const{active:Dt,activatorEvent:Nt,collisions:Jt,droppableContainers:Fn,scrollAdjustedTranslate:Un}=Ge.current;if(!Dt||V.current==null||!Nt||!Un)return;const{onDragOver:kn}=J.current,$n=Fn.get(Ce),_r=$n&&$n.rect.current?{id:$n.id,rect:$n.rect.current,data:$n.data,disabled:$n.disabled}:null,Wt={active:Dt,activatorEvent:Nt,collisions:Jt,delta:{x:Un.x,y:Un.y},over:_r};$s.unstable_batchedUpdates(()=>{nr(_r),kn==null||kn(Wt),T({type:"onDragOver",event:Wt})})},[Ce]),Si(()=>{Ge.current={activatorEvent:K,active:U,activeNode:se,collisionRect:de,collisions:ve,droppableRects:M,draggableNodes:B,draggingNode:dn,draggingNodeRect:fn,droppableContainers:P,over:Pe,scrollableAncestors:mn,scrollAdjustedTranslate:ne},H.current={initial:fn,translated:de}},[U,se,ve,de,B,dn,fn,M,P,Pe,mn,ne]),gP({...ke,delta:X,draggingRect:de,pointerCoordinates:ls,scrollableAncestors:mn,scrollableAncestorRects:vr});const Zf=x.useMemo(()=>({active:U,activeNode:se,activeNodeRect:Ee,activatorEvent:K,collisions:ve,containerNodeRect:et,dragOverlay:Xe,draggableNodes:B,droppableContainers:P,droppableRects:M,over:Pe,measureDroppableContainers:Z,scrollableAncestors:mn,scrollableAncestorRects:vr,measuringConfiguration:Y,measuringScheduled:ae,windowRect:pn}),[U,se,Ee,K,ve,et,Xe,B,P,M,Pe,Z,mn,vr,Y,ae,pn]),Yo=x.useMemo(()=>({activatorEvent:K,activators:Hn,active:U,activeNodeRect:Ee,ariaDescribedById:{draggable:A},dispatch:k,draggableNodes:B,over:Pe,measureDroppableContainers:Z}),[K,Hn,U,Ee,k,A,B,Pe,Z]);return pt.createElement(gR.Provider,{value:R},pt.createElement(Of.Provider,{value:Yo},pt.createElement(RR.Provider,{value:Zf},pt.createElement(MR.Provider,{value:At},d)),pt.createElement(IP,{disabled:(u==null?void 0:u.restoreFocus)===!1})),pt.createElement(Pj,{...u,hiddenTextDescribedById:A}));function Xo(){const Dt=(F==null?void 0:F.autoScrollEnabled)===!1,Nt=typeof h=="object"?h.enabled===!1:h===!1,Jt=L&&!Dt&&!Nt;return typeof h=="object"?{...h,enabled:Jt}:{enabled:Jt}}}),WP=x.createContext(null),Bw="button",qP="Draggable";function VP(e){let{id:t,data:n,disabled:r=!1,attributes:s}=e;const l=yu(qP),{activators:a,activatorEvent:u,active:h,activeNodeRect:d,ariaDescribedById:m,draggableNodes:p,over:_}=x.useContext(Of),{role:b=Bw,roleDescription:S="draggable",tabIndex:w=0}=s??{},C=(h==null?void 0:h.id)===t,k=x.useContext(C?MR:WP),[T,R]=Gd(),[D,z]=Gd(),L=TP(a,t),O=Zc(n);Si(()=>(p.set(t,{id:t,key:l,node:T,activatorNode:D,data:O}),()=>{const X=p.get(t);X&&X.key===l&&p.delete(t)}),[p,t]);const B=x.useMemo(()=>({role:b,tabIndex:w,"aria-disabled":r,"aria-pressed":C&&b===Bw?!0:void 0,"aria-roledescription":S,"aria-describedby":m.draggable}),[r,b,w,C,S,m.draggable]);return{active:h,activatorEvent:u,activeNodeRect:d,attributes:B,isDragging:C,listeners:r?void 0:L,node:T,over:_,setNodeRef:R,setActivatorNodeRef:z,transform:k}}function KP(){return x.useContext(RR)}const GP="Droppable",YP={timeout:25};function XP(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:s}=e;const l=yu(GP),{active:a,dispatch:u,over:h,measureDroppableContainers:d}=x.useContext(Of),m=x.useRef({disabled:n}),p=x.useRef(!1),_=x.useRef(null),b=x.useRef(null),{disabled:S,updateMeasurementsFor:w,timeout:C}={...YP,...s},k=Zc(w??r),T=x.useCallback(()=>{if(!p.current){p.current=!0;return}b.current!=null&&clearTimeout(b.current),b.current=setTimeout(()=>{d(Array.isArray(k.current)?k.current:[k.current]),b.current=null},C)},[C]),R=Nf({callback:T,disabled:S||!a}),D=x.useCallback((B,X)=>{R&&(X&&(R.unobserve(X),p.current=!1),B&&R.observe(B))},[R]),[z,L]=Gd(D),O=Zc(t);return x.useEffect(()=>{!R||!z.current||(R.disconnect(),p.current=!1,R.observe(z.current))},[z,R]),x.useEffect(()=>(u({type:Xt.RegisterDroppable,element:{id:r,key:l,disabled:n,node:z,rect:_,data:O}}),()=>u({type:Xt.UnregisterDroppable,key:l,id:r})),[r]),x.useEffect(()=>{n!==m.current.disabled&&(u({type:Xt.SetDroppableDisabled,id:r,key:l,disabled:n}),m.current.disabled=n)},[r,l,n,u]),{active:a,rect:_,isOver:(h==null?void 0:h.id)===r,node:z,over:h,setNodeRef:L}}function Ny(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function ZP(e,t){return e.reduce((n,r,s)=>{const l=t.get(r);return l&&(n[s]=l),n},Array(e.length))}function nd(e){return e!==null&&e>=0}function QP(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function JP(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const TR=e=>{let{rects:t,activeIndex:n,overIndex:r,index:s}=e;const l=Ny(t,r,n),a=t[s],u=l[s];return!u||!a?null:{x:u.left-a.left,y:u.top-a.top,scaleX:u.width/a.width,scaleY:u.height/a.height}},rd={scaleX:1,scaleY:1},e8=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:s,rects:l,overIndex:a}=e;const u=(t=l[n])!=null?t:r;if(!u)return null;if(s===n){const d=l[a];return d?{x:0,y:n<a?d.top+d.height-(u.top+u.height):d.top-u.top,...rd}:null}const h=t8(l,s,n);return s>n&&s<=a?{x:0,y:-u.height-h,...rd}:s<n&&s>=a?{x:0,y:u.height+h,...rd}:{x:0,y:0,...rd}};function t8(e,t,n){const r=e[t],s=e[t-1],l=e[t+1];return r?n<t?s?r.top-(s.top+s.height):l?l.top-(r.top+r.height):0:l?l.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const AR="Sortable",DR=pt.createContext({activeIndex:-1,containerId:AR,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:TR,disabled:{draggable:!1,droppable:!1}});function n8(e){let{children:t,id:n,items:r,strategy:s=TR,disabled:l=!1}=e;const{active:a,dragOverlay:u,droppableRects:h,over:d,measureDroppableContainers:m}=KP(),p=yu(AR,n),_=u.rect!==null,b=x.useMemo(()=>r.map(L=>typeof L=="object"&&"id"in L?L.id:L),[r]),S=a!=null,w=a?b.indexOf(a.id):-1,C=d?b.indexOf(d.id):-1,k=x.useRef(b),T=!QP(b,k.current),R=C!==-1&&w===-1||T,D=JP(l);Si(()=>{T&&S&&m(b)},[T,b,S,m]),x.useEffect(()=>{k.current=b},[b]);const z=x.useMemo(()=>({activeIndex:w,containerId:p,disabled:D,disableTransforms:R,items:b,overIndex:C,useDragOverlay:_,sortedRects:ZP(b,h),strategy:s}),[w,p,D.draggable,D.droppable,R,b,C,h,_,s]);return pt.createElement(DR.Provider,{value:z},t)}const r8=e=>{let{id:t,items:n,activeIndex:r,overIndex:s}=e;return Ny(n,r,s).indexOf(t)},i8=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:s,items:l,newIndex:a,previousItems:u,previousContainerId:h,transition:d}=e;return!d||!r||u!==l&&s===a?!1:n?!0:a!==s&&t===h},s8={duration:200,easing:"ease"},NR="transform",o8=Qc.Transition.toString({property:NR,duration:0,easing:"linear"}),l8={roleDescription:"sortable"};function a8(e){let{disabled:t,index:n,node:r,rect:s}=e;const[l,a]=x.useState(null),u=x.useRef(n);return Si(()=>{if(!t&&n!==u.current&&r.current){const h=s.current;if(h){const d=ga(r.current,{ignoreTransform:!0}),m={x:h.left-d.left,y:h.top-d.top,scaleX:h.width/d.width,scaleY:h.height/d.height};(m.x||m.y)&&a(m)}}n!==u.current&&(u.current=n)},[t,n,r,s]),x.useEffect(()=>{l&&a(null)},[l]),l}function c8(e){let{animateLayoutChanges:t=i8,attributes:n,disabled:r,data:s,getNewIndex:l=r8,id:a,strategy:u,resizeObserverConfig:h,transition:d=s8}=e;const{items:m,containerId:p,activeIndex:_,disabled:b,disableTransforms:S,sortedRects:w,overIndex:C,useDragOverlay:k,strategy:T}=x.useContext(DR),R=u8(r,b),D=m.indexOf(a),z=x.useMemo(()=>({sortable:{containerId:p,index:D,items:m},...s}),[p,s,D,m]),L=x.useMemo(()=>m.slice(m.indexOf(a)),[m,a]),{rect:O,node:B,isOver:X,setNodeRef:P}=XP({id:a,data:z,disabled:R.droppable,resizeObserverConfig:{updateMeasurementsFor:L,...h}}),{active:q,activatorEvent:H,activeNodeRect:U,attributes:V,setNodeRef:F,listeners:j,isDragging:K,over:$,setActivatorNodeRef:J,transform:A}=VP({id:a,data:z,attributes:{...l8,...n},disabled:R.draggable}),I=kj(P,F),Y=!!q,M=Y&&!S&&nd(_)&&nd(C),Z=!k&&K,ae=Z&&M?A:null,pe=M?ae??(u??T)({rects:w,activeNodeRect:U,activeIndex:_,overIndex:C,index:D}):null,ke=nd(_)&&nd(C)?l({id:a,items:m,activeIndex:_,overIndex:C}):D,me=q==null?void 0:q.id,Ee=x.useRef({activeId:me,items:m,newIndex:ke,containerId:p}),et=m!==Ee.current.items,Ge=t({active:q,containerId:p,isDragging:K,isSorting:Y,id:a,index:D,items:m,newIndex:Ee.current.newIndex,previousItems:Ee.current.items,previousContainerId:Ee.current.containerId,transition:d,wasDragging:Ee.current.activeId!=null}),Me=a8({disabled:!Ge,index:D,node:B,rect:O});return x.useEffect(()=>{Y&&Ee.current.newIndex!==ke&&(Ee.current.newIndex=ke),p!==Ee.current.containerId&&(Ee.current.containerId=p),m!==Ee.current.items&&(Ee.current.items=m)},[Y,ke,p,m]),x.useEffect(()=>{if(me===Ee.current.activeId)return;if(me!=null&&Ee.current.activeId==null){Ee.current.activeId=me;return}const dn=setTimeout(()=>{Ee.current.activeId=me},50);return()=>clearTimeout(dn)},[me]),{active:q,activeIndex:_,attributes:V,data:z,rect:O,index:D,newIndex:ke,items:m,isOver:X,isSorting:Y,isDragging:K,listeners:j,node:B,overIndex:C,over:$,setNodeRef:I,setActivatorNodeRef:J,setDroppableNodeRef:P,setDraggableNodeRef:F,transform:Me??pe,transition:Xe()};function Xe(){if(Me||et&&Ee.current.newIndex===D)return o8;if(!(Z&&!Ey(H)||!d)&&(Y||Ge))return Qc.Transition.toString({...d,property:NR})}}function u8(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}nt.Down,nt.Right,nt.Up,nt.Left;function OR(e){const t=e+"CollectionProvider",[n,r]=Qs(t),[s,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=w=>{const{scope:C,children:k}=w,T=pt.useRef(null),R=pt.useRef(new Map).current;return v.jsx(s,{scope:C,itemMap:R,collectionRef:T,children:k})};a.displayName=t;const u=e+"CollectionSlot",h=ea(u),d=pt.forwardRef((w,C)=>{const{scope:k,children:T}=w,R=l(u,k),D=Bt(C,R.collectionRef);return v.jsx(h,{ref:D,children:T})});d.displayName=u;const m=e+"CollectionItemSlot",p="data-radix-collection-item",_=ea(m),b=pt.forwardRef((w,C)=>{const{scope:k,children:T,...R}=w,D=pt.useRef(null),z=Bt(C,D),L=l(m,k);return pt.useEffect(()=>(L.itemMap.set(D,{ref:D,...R}),()=>void L.itemMap.delete(D))),v.jsx(_,{[p]:"",ref:z,children:T})});b.displayName=m;function S(w){const C=l(e+"CollectionConsumer",w);return pt.useCallback(()=>{const T=C.collectionRef.current;if(!T)return[];const R=Array.from(T.querySelectorAll(`[${p}]`));return Array.from(C.itemMap.values()).sort((L,O)=>R.indexOf(L.ref.current)-R.indexOf(O.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:a,Slot:d,ItemSlot:b},S,r]}var h8=x.createContext(void 0);function LR(e){const t=x.useContext(h8);return e||t||"ltr"}var Ng="rovingFocusGroup.onEntryFocus",d8={bubbles:!1,cancelable:!0},bu="RovingFocusGroup",[Lv,zR,f8]=OR(bu),[p8,BR]=Qs(bu,[f8]),[m8,g8]=p8(bu),jR=x.forwardRef((e,t)=>v.jsx(Lv.Provider,{scope:e.__scopeRovingFocusGroup,children:v.jsx(Lv.Slot,{scope:e.__scopeRovingFocusGroup,children:v.jsx(v8,{...e,ref:t})})}));jR.displayName=bu;var v8=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:l,currentTabStopId:a,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:h,onEntryFocus:d,preventScrollOnEntryFocus:m=!1,...p}=e,_=x.useRef(null),b=Bt(t,_),S=LR(l),[w,C]=vf({prop:a,defaultProp:u??null,onChange:h,caller:bu}),[k,T]=x.useState(!1),R=xi(d),D=zR(n),z=x.useRef(!1),[L,O]=x.useState(0);return x.useEffect(()=>{const B=_.current;if(B)return B.addEventListener(Ng,R),()=>B.removeEventListener(Ng,R)},[R]),v.jsx(m8,{scope:n,orientation:r,dir:S,loop:s,currentTabStopId:w,onItemFocus:x.useCallback(B=>C(B),[C]),onItemShiftTab:x.useCallback(()=>T(!0),[]),onFocusableItemAdd:x.useCallback(()=>O(B=>B+1),[]),onFocusableItemRemove:x.useCallback(()=>O(B=>B-1),[]),children:v.jsx(bt.div,{tabIndex:k||L===0?-1:0,"data-orientation":r,...p,ref:b,style:{outline:"none",...e.style},onMouseDown:Ne(e.onMouseDown,()=>{z.current=!0}),onFocus:Ne(e.onFocus,B=>{const X=!z.current;if(B.target===B.currentTarget&&X&&!k){const P=new CustomEvent(Ng,d8);if(B.currentTarget.dispatchEvent(P),!P.defaultPrevented){const q=D().filter(j=>j.focusable),H=q.find(j=>j.active),U=q.find(j=>j.id===w),F=[H,U,...q].filter(Boolean).map(j=>j.ref.current);HR(F,m)}}z.current=!1}),onBlur:Ne(e.onBlur,()=>T(!1))})})}),PR="RovingFocusGroupItem",IR=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:l,children:a,...u}=e,h=Kl(),d=l||h,m=g8(PR,n),p=m.currentTabStopId===d,_=zR(n),{onFocusableItemAdd:b,onFocusableItemRemove:S,currentTabStopId:w}=m;return x.useEffect(()=>{if(r)return b(),()=>S()},[r,b,S]),v.jsx(Lv.ItemSlot,{scope:n,id:d,focusable:r,active:s,children:v.jsx(bt.span,{tabIndex:p?0:-1,"data-orientation":m.orientation,...u,ref:t,onMouseDown:Ne(e.onMouseDown,C=>{r?m.onItemFocus(d):C.preventDefault()}),onFocus:Ne(e.onFocus,()=>m.onItemFocus(d)),onKeyDown:Ne(e.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){m.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const k=b8(C,m.orientation,m.dir);if(k!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let R=_().filter(D=>D.focusable).map(D=>D.ref.current);if(k==="last")R.reverse();else if(k==="prev"||k==="next"){k==="prev"&&R.reverse();const D=R.indexOf(C.currentTarget);R=m.loop?x8(R,D+1):R.slice(D+1)}setTimeout(()=>HR(R))}}),children:typeof a=="function"?a({isCurrentTabStop:p,hasTabStop:w!=null}):a})})});IR.displayName=PR;var _8={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function y8(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function b8(e,t,n){const r=y8(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return _8[r]}function HR(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function x8(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var S8=jR,w8=IR,zv=["Enter"," "],C8=["ArrowDown","PageUp","Home"],FR=["ArrowUp","PageDown","End"],k8=[...C8,...FR],E8={ltr:[...zv,"ArrowRight"],rtl:[...zv,"ArrowLeft"]},R8={ltr:["ArrowLeft"],rtl:["ArrowRight"]},xu="Menu",[eu,M8,T8]=OR(xu),[$o,UR]=Qs(xu,[T8,fa,BR]),Lf=fa(),$R=BR(),[A8,Wo]=$o(xu),[D8,Su]=$o(xu),WR=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:l,modal:a=!0}=e,u=Lf(t),[h,d]=x.useState(null),m=x.useRef(!1),p=xi(l),_=LR(s);return x.useEffect(()=>{const b=()=>{m.current=!0,document.addEventListener("pointerdown",S,{capture:!0,once:!0}),document.addEventListener("pointermove",S,{capture:!0,once:!0})},S=()=>m.current=!1;return document.addEventListener("keydown",b,{capture:!0}),()=>{document.removeEventListener("keydown",b,{capture:!0}),document.removeEventListener("pointerdown",S,{capture:!0}),document.removeEventListener("pointermove",S,{capture:!0})}},[]),v.jsx(_y,{...u,children:v.jsx(A8,{scope:t,open:n,onOpenChange:p,content:h,onContentChange:d,children:v.jsx(D8,{scope:t,onClose:x.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:m,dir:_,modal:a,children:r})})})};WR.displayName=xu;var N8="MenuAnchor",Oy=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Lf(n);return v.jsx(Rf,{...s,...r,ref:t})});Oy.displayName=N8;var Ly="MenuPortal",[O8,qR]=$o(Ly,{forceMount:void 0}),VR=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,l=Wo(Ly,t);return v.jsx(O8,{scope:t,forceMount:n,children:v.jsx(Ir,{present:n||l.open,children:v.jsx(fu,{asChild:!0,container:s,children:r})})})};VR.displayName=Ly;var Br="MenuContent",[L8,zy]=$o(Br),KR=x.forwardRef((e,t)=>{const n=qR(Br,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,l=Wo(Br,e.__scopeMenu),a=Su(Br,e.__scopeMenu);return v.jsx(eu.Provider,{scope:e.__scopeMenu,children:v.jsx(Ir,{present:r||l.open,children:v.jsx(eu.Slot,{scope:e.__scopeMenu,children:a.modal?v.jsx(z8,{...s,ref:t}):v.jsx(B8,{...s,ref:t})})})})}),z8=x.forwardRef((e,t)=>{const n=Wo(Br,e.__scopeMenu),r=x.useRef(null),s=Bt(t,r);return x.useEffect(()=>{const l=r.current;if(l)return ey(l)},[]),v.jsx(By,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ne(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),B8=x.forwardRef((e,t)=>{const n=Wo(Br,e.__scopeMenu);return v.jsx(By,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),j8=ea("MenuContent.ScrollLock"),By=x.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:l,onCloseAutoFocus:a,disableOutsidePointerEvents:u,onEntryFocus:h,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:_,onDismiss:b,disableOutsideScroll:S,...w}=e,C=Wo(Br,n),k=Su(Br,n),T=Lf(n),R=$R(n),D=M8(n),[z,L]=x.useState(null),O=x.useRef(null),B=Bt(t,O,C.onContentChange),X=x.useRef(0),P=x.useRef(""),q=x.useRef(0),H=x.useRef(null),U=x.useRef("right"),V=x.useRef(0),F=S?bf:x.Fragment,j=S?{as:j8,allowPinchZoom:!0}:void 0,K=J=>{var pe,ke;const A=P.current+J,I=D().filter(me=>!me.disabled),Y=document.activeElement,M=(pe=I.find(me=>me.ref.current===Y))==null?void 0:pe.textValue,Z=I.map(me=>me.textValue),ae=Y8(Z,A,M),se=(ke=I.find(me=>me.textValue===ae))==null?void 0:ke.ref.current;(function me(Ee){P.current=Ee,window.clearTimeout(X.current),Ee!==""&&(X.current=window.setTimeout(()=>me(""),1e3))})(A),se&&setTimeout(()=>se.focus())};x.useEffect(()=>()=>window.clearTimeout(X.current),[]),J_();const $=x.useCallback(J=>{var I,Y;return U.current===((I=H.current)==null?void 0:I.side)&&Z8(J,(Y=H.current)==null?void 0:Y.area)},[]);return v.jsx(L8,{scope:n,searchRef:P,onItemEnter:x.useCallback(J=>{$(J)&&J.preventDefault()},[$]),onItemLeave:x.useCallback(J=>{var A;$(J)||((A=O.current)==null||A.focus(),L(null))},[$]),onTriggerLeave:x.useCallback(J=>{$(J)&&J.preventDefault()},[$]),pointerGraceTimerRef:q,onPointerGraceIntentChange:x.useCallback(J=>{H.current=J},[]),children:v.jsx(F,{...j,children:v.jsx(_f,{asChild:!0,trapped:s,onMountAutoFocus:Ne(l,J=>{var A;J.preventDefault(),(A=O.current)==null||A.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:v.jsx(du,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:_,onDismiss:b,children:v.jsx(S8,{asChild:!0,...R,dir:k.dir,orientation:"vertical",loop:r,currentTabStopId:z,onCurrentTabStopIdChange:L,onEntryFocus:Ne(h,J=>{k.isUsingKeyboardRef.current||J.preventDefault()}),preventScrollOnEntryFocus:!0,children:v.jsx(yy,{role:"menu","aria-orientation":"vertical","data-state":cM(C.open),"data-radix-menu-content":"",dir:k.dir,...T,...w,ref:B,style:{outline:"none",...w.style},onKeyDown:Ne(w.onKeyDown,J=>{const I=J.target.closest("[data-radix-menu-content]")===J.currentTarget,Y=J.ctrlKey||J.altKey||J.metaKey,M=J.key.length===1;I&&(J.key==="Tab"&&J.preventDefault(),!Y&&M&&K(J.key));const Z=O.current;if(J.target!==Z||!k8.includes(J.key))return;J.preventDefault();const se=D().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);FR.includes(J.key)&&se.reverse(),K8(se)}),onBlur:Ne(e.onBlur,J=>{J.currentTarget.contains(J.target)||(window.clearTimeout(X.current),P.current="")}),onPointerMove:Ne(e.onPointerMove,tu(J=>{const A=J.target,I=V.current!==J.clientX;if(J.currentTarget.contains(A)&&I){const Y=J.clientX>V.current?"right":"left";U.current=Y,V.current=J.clientX}}))})})})})})})});KR.displayName=Br;var P8="MenuGroup",jy=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return v.jsx(bt.div,{role:"group",...r,ref:t})});jy.displayName=P8;var I8="MenuLabel",GR=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return v.jsx(bt.div,{...r,ref:t})});GR.displayName=I8;var Qd="MenuItem",jw="menu.itemSelect",zf=x.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,l=x.useRef(null),a=Su(Qd,e.__scopeMenu),u=zy(Qd,e.__scopeMenu),h=Bt(t,l),d=x.useRef(!1),m=()=>{const p=l.current;if(!n&&p){const _=new CustomEvent(jw,{bubbles:!0,cancelable:!0});p.addEventListener(jw,b=>r==null?void 0:r(b),{once:!0}),Wk(p,_),_.defaultPrevented?d.current=!1:a.onClose()}};return v.jsx(YR,{...s,ref:h,disabled:n,onClick:Ne(e.onClick,m),onPointerDown:p=>{var _;(_=e.onPointerDown)==null||_.call(e,p),d.current=!0},onPointerUp:Ne(e.onPointerUp,p=>{var _;d.current||(_=p.currentTarget)==null||_.click()}),onKeyDown:Ne(e.onKeyDown,p=>{const _=u.searchRef.current!=="";n||_&&p.key===" "||zv.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})});zf.displayName=Qd;var YR=x.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...l}=e,a=zy(Qd,n),u=$R(n),h=x.useRef(null),d=Bt(t,h),[m,p]=x.useState(!1),[_,b]=x.useState("");return x.useEffect(()=>{const S=h.current;S&&b((S.textContent??"").trim())},[l.children]),v.jsx(eu.ItemSlot,{scope:n,disabled:r,textValue:s??_,children:v.jsx(w8,{asChild:!0,...u,focusable:!r,children:v.jsx(bt.div,{role:"menuitem","data-highlighted":m?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...l,ref:d,onPointerMove:Ne(e.onPointerMove,tu(S=>{r?a.onItemLeave(S):(a.onItemEnter(S),S.defaultPrevented||S.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ne(e.onPointerLeave,tu(S=>a.onItemLeave(S))),onFocus:Ne(e.onFocus,()=>p(!0)),onBlur:Ne(e.onBlur,()=>p(!1))})})})}),H8="MenuCheckboxItem",XR=x.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return v.jsx(tM,{scope:e.__scopeMenu,checked:n,children:v.jsx(zf,{role:"menuitemcheckbox","aria-checked":Jd(n)?"mixed":n,...s,ref:t,"data-state":Iy(n),onSelect:Ne(s.onSelect,()=>r==null?void 0:r(Jd(n)?!0:!n),{checkForDefaultPrevented:!1})})})});XR.displayName=H8;var ZR="MenuRadioGroup",[F8,U8]=$o(ZR,{value:void 0,onValueChange:()=>{}}),QR=x.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,l=xi(r);return v.jsx(F8,{scope:e.__scopeMenu,value:n,onValueChange:l,children:v.jsx(jy,{...s,ref:t})})});QR.displayName=ZR;var JR="MenuRadioItem",eM=x.forwardRef((e,t)=>{const{value:n,...r}=e,s=U8(JR,e.__scopeMenu),l=n===s.value;return v.jsx(tM,{scope:e.__scopeMenu,checked:l,children:v.jsx(zf,{role:"menuitemradio","aria-checked":l,...r,ref:t,"data-state":Iy(l),onSelect:Ne(r.onSelect,()=>{var a;return(a=s.onValueChange)==null?void 0:a.call(s,n)},{checkForDefaultPrevented:!1})})})});eM.displayName=JR;var Py="MenuItemIndicator",[tM,$8]=$o(Py,{checked:!1}),nM=x.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,l=$8(Py,n);return v.jsx(Ir,{present:r||Jd(l.checked)||l.checked===!0,children:v.jsx(bt.span,{...s,ref:t,"data-state":Iy(l.checked)})})});nM.displayName=Py;var W8="MenuSeparator",rM=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return v.jsx(bt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});rM.displayName=W8;var q8="MenuArrow",iM=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Lf(n);return v.jsx(by,{...s,...r,ref:t})});iM.displayName=q8;var V8="MenuSub",[NX,sM]=$o(V8),Mc="MenuSubTrigger",oM=x.forwardRef((e,t)=>{const n=Wo(Mc,e.__scopeMenu),r=Su(Mc,e.__scopeMenu),s=sM(Mc,e.__scopeMenu),l=zy(Mc,e.__scopeMenu),a=x.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:h}=l,d={__scopeMenu:e.__scopeMenu},m=x.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return x.useEffect(()=>m,[m]),x.useEffect(()=>{const p=u.current;return()=>{window.clearTimeout(p),h(null)}},[u,h]),v.jsx(Oy,{asChild:!0,...d,children:v.jsx(YR,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":cM(n.open),...e,ref:Q_(t,s.onTriggerChange),onClick:p=>{var _;(_=e.onClick)==null||_.call(e,p),!(e.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ne(e.onPointerMove,tu(p=>{l.onItemEnter(p),!p.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(l.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),m()},100))})),onPointerLeave:Ne(e.onPointerLeave,tu(p=>{var b,S;m();const _=(b=n.content)==null?void 0:b.getBoundingClientRect();if(_){const w=(S=n.content)==null?void 0:S.dataset.side,C=w==="right",k=C?-5:5,T=_[C?"left":"right"],R=_[C?"right":"left"];l.onPointerGraceIntentChange({area:[{x:p.clientX+k,y:p.clientY},{x:T,y:_.top},{x:R,y:_.top},{x:R,y:_.bottom},{x:T,y:_.bottom}],side:w}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(p),p.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:Ne(e.onKeyDown,p=>{var b;const _=l.searchRef.current!=="";e.disabled||_&&p.key===" "||E8[r.dir].includes(p.key)&&(n.onOpenChange(!0),(b=n.content)==null||b.focus(),p.preventDefault())})})})});oM.displayName=Mc;var lM="MenuSubContent",aM=x.forwardRef((e,t)=>{const n=qR(Br,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,l=Wo(Br,e.__scopeMenu),a=Su(Br,e.__scopeMenu),u=sM(lM,e.__scopeMenu),h=x.useRef(null),d=Bt(t,h);return v.jsx(eu.Provider,{scope:e.__scopeMenu,children:v.jsx(Ir,{present:r||l.open,children:v.jsx(eu.Slot,{scope:e.__scopeMenu,children:v.jsx(By,{id:u.contentId,"aria-labelledby":u.triggerId,...s,ref:d,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:m=>{var p;a.isUsingKeyboardRef.current&&((p=h.current)==null||p.focus()),m.preventDefault()},onCloseAutoFocus:m=>m.preventDefault(),onFocusOutside:Ne(e.onFocusOutside,m=>{m.target!==u.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:Ne(e.onEscapeKeyDown,m=>{a.onClose(),m.preventDefault()}),onKeyDown:Ne(e.onKeyDown,m=>{var b;const p=m.currentTarget.contains(m.target),_=R8[a.dir].includes(m.key);p&&_&&(l.onOpenChange(!1),(b=u.trigger)==null||b.focus(),m.preventDefault())})})})})})});aM.displayName=lM;function cM(e){return e?"open":"closed"}function Jd(e){return e==="indeterminate"}function Iy(e){return Jd(e)?"indeterminate":e?"checked":"unchecked"}function K8(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function G8(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Y8(e,t,n){const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,l=n?e.indexOf(n):-1;let a=G8(e,Math.max(l,0));s.length===1&&(a=a.filter(d=>d!==n));const h=a.find(d=>d.toLowerCase().startsWith(s.toLowerCase()));return h!==n?h:void 0}function X8(e,t){const{x:n,y:r}=e;let s=!1;for(let l=0,a=t.length-1;l<t.length;a=l++){const u=t[l],h=t[a],d=u.x,m=u.y,p=h.x,_=h.y;m>r!=_>r&&n<(p-d)*(r-m)/(_-m)+d&&(s=!s)}return s}function Z8(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return X8(n,t)}function tu(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Q8=WR,J8=Oy,eI=VR,tI=KR,nI=jy,rI=GR,iI=zf,sI=XR,oI=QR,lI=eM,aI=nM,cI=rM,uI=iM,hI=oM,dI=aM,Hy="ContextMenu",[fI]=Qs(Hy,[UR]),jn=UR(),[pI,uM]=fI(Hy),hM=e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,dir:s,modal:l=!0}=e,[a,u]=x.useState(!1),h=jn(t),d=xi(r),m=x.useCallback(p=>{u(p),d(p)},[d]);return v.jsx(pI,{scope:t,open:a,onOpenChange:m,modal:l,children:v.jsx(Q8,{...h,dir:s,open:a,onOpenChange:m,modal:l,children:n})})};hM.displayName=Hy;var dM="ContextMenuTrigger",fM=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,disabled:r=!1,...s}=e,l=uM(dM,n),a=jn(n),u=x.useRef({x:0,y:0}),h=x.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...u.current})}),d=x.useRef(0),m=x.useCallback(()=>window.clearTimeout(d.current),[]),p=_=>{u.current={x:_.clientX,y:_.clientY},l.onOpenChange(!0)};return x.useEffect(()=>m,[m]),x.useEffect(()=>void(r&&m()),[r,m]),v.jsxs(v.Fragment,{children:[v.jsx(J8,{...a,virtualRef:h}),v.jsx(bt.span,{"data-state":l.open?"open":"closed","data-disabled":r?"":void 0,...s,ref:t,style:{WebkitTouchCallout:"none",...e.style},onContextMenu:r?e.onContextMenu:Ne(e.onContextMenu,_=>{m(),p(_),_.preventDefault()}),onPointerDown:r?e.onPointerDown:Ne(e.onPointerDown,id(_=>{m(),d.current=window.setTimeout(()=>p(_),700)})),onPointerMove:r?e.onPointerMove:Ne(e.onPointerMove,id(m)),onPointerCancel:r?e.onPointerCancel:Ne(e.onPointerCancel,id(m)),onPointerUp:r?e.onPointerUp:Ne(e.onPointerUp,id(m))})]})});fM.displayName=dM;var mI="ContextMenuPortal",pM=e=>{const{__scopeContextMenu:t,...n}=e,r=jn(t);return v.jsx(eI,{...r,...n})};pM.displayName=mI;var mM="ContextMenuContent",gM=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=uM(mM,n),l=jn(n),a=x.useRef(!1);return v.jsx(tI,{...l,...r,ref:t,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:u=>{var h;(h=e.onCloseAutoFocus)==null||h.call(e,u),!u.defaultPrevented&&a.current&&u.preventDefault(),a.current=!1},onInteractOutside:u=>{var h;(h=e.onInteractOutside)==null||h.call(e,u),!u.defaultPrevented&&!s.modal&&(a.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});gM.displayName=mM;var gI="ContextMenuGroup",vI=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=jn(n);return v.jsx(nI,{...s,...r,ref:t})});vI.displayName=gI;var _I="ContextMenuLabel",yI=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=jn(n);return v.jsx(rI,{...s,...r,ref:t})});yI.displayName=_I;var bI="ContextMenuItem",vM=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=jn(n);return v.jsx(iI,{...s,...r,ref:t})});vM.displayName=bI;var xI="ContextMenuCheckboxItem",SI=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=jn(n);return v.jsx(sI,{...s,...r,ref:t})});SI.displayName=xI;var wI="ContextMenuRadioGroup",CI=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=jn(n);return v.jsx(oI,{...s,...r,ref:t})});CI.displayName=wI;var kI="ContextMenuRadioItem",EI=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=jn(n);return v.jsx(lI,{...s,...r,ref:t})});EI.displayName=kI;var RI="ContextMenuItemIndicator",MI=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=jn(n);return v.jsx(aI,{...s,...r,ref:t})});MI.displayName=RI;var TI="ContextMenuSeparator",AI=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=jn(n);return v.jsx(cI,{...s,...r,ref:t})});AI.displayName=TI;var DI="ContextMenuArrow",NI=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=jn(n);return v.jsx(uI,{...s,...r,ref:t})});NI.displayName=DI;var OI="ContextMenuSubTrigger",LI=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=jn(n);return v.jsx(hI,{...s,...r,ref:t})});LI.displayName=OI;var zI="ContextMenuSubContent",BI=x.forwardRef((e,t)=>{const{__scopeContextMenu:n,...r}=e,s=jn(n);return v.jsx(dI,{...s,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});BI.displayName=zI;function id(e){return t=>t.pointerType!=="mouse"?e(t):void 0}var jI=hM,PI=fM,II=pM,_M=gM,yM=vM;const HI=jI,FI=PI,bM=x.forwardRef(({className:e,...t},n)=>v.jsx(II,{children:v.jsx(_M,{ref:n,className:ye("z-50 min-w-[170px] overflow-hidden rounded-xl border border-border bg-background p-1 shadow-lg outline-hidden animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",e),...t})}));bM.displayName=_M.displayName;const xM=x.forwardRef(({className:e,...t},n)=>v.jsx(yM,{ref:n,className:ye("relative flex cursor-default select-none items-center gap-2.5 rounded-lg px-3 py-2 text-xs font-medium outline-hidden transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));xM.displayName=yM.displayName;function UI({onRemove:e,children:t}){return v.jsxs(HI,{children:[v.jsx(FI,{asChild:!0,children:t}),v.jsx(bM,{children:v.jsxs(xM,{onSelect:n=>{n.stopPropagation(),e()},className:"text-destructive dark:text-red-400 hover:bg-destructive/10 focus:bg-destructive/10 dark:hover:bg-red-500/20 dark:focus:bg-red-500/20",children:[v.jsx(_6,{className:"h-4 w-4"}),v.jsx("span",{className:"text-xs font-medium",children:"Remove"})]})})]})}function $I({group:e,collapsedSections:t,expandedGroups:n,onToggleSection:r,onToggleExpandedGroup:s,renderChatRow:l,chatsPerProject:a,onNewLocalChat:u,onRemoveProject:h,isConnected:d,startingLocalPath:m}){const{groupKey:p,localPath:_,chats:b}=e,S=n.has(p),w=S?b:b.slice(0,a),C=b.length>a,{attributes:k,listeners:T,setNodeRef:R,setActivatorNodeRef:D,transform:z,transition:L,isDragging:O}=c8({id:p}),B={transform:Qc.Translate.toString(z),transition:L},X=v.jsxs("div",{ref:D,className:ye("sticky top-0 bg-background dark:bg-card z-10 relative p-[10px] flex items-center justify-between","cursor-grab active:cursor-grabbing",O&&"cursor-grabbing"),onClick:()=>r(p),...T,children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"relative size-3.5 shrink-0 cursor-pointer",children:t.has(p)?v.jsx(Ji,{className:"translate-y-[1px] size-3.5 shrink-0 text-slate-400 transition-all duration-200"}):v.jsxs(v.Fragment,{children:[v.jsx(bE,{className:"absolute inset-0 translate-y-[1px] size-3.5 shrink-0 text-slate-400 dark:text-slate-500 transition-all duration-200 group-hover/section:opacity-0"}),v.jsx(Ji,{className:"absolute inset-0 translate-y-[1px] size-3.5 shrink-0 rotate-90 text-slate-400 opacity-0 transition-all duration-200 group-hover/section:opacity-100"})]})}),v.jsxs(Yc,{children:[v.jsx(Xc,{asChild:!0,children:v.jsx("span",{className:"truncate max-w-[150px] whitespace-nowrap text-sm text-slate-500 dark:text-slate-400",children:fR(_)})}),v.jsx(ia,{side:"right",sideOffset:4,children:_})]})]}),u&&v.jsxs(Yc,{children:[v.jsx(Xc,{asChild:!0,children:v.jsx(Ke,{variant:"ghost",size:"icon",className:ye("h-5.5 w-5.5 absolute right-2 !rounded opacity-100 md:opacity-0 md:group-hover/section:opacity-100",(!d||m===_)&&"opacity-50 cursor-not-allowed"),disabled:!d||m===_,onClick:P=>{P.stopPropagation(),u(_)},children:m===_?v.jsx(Js,{className:"size-4 text-slate-500 dark:text-slate-400 animate-spin"}):v.jsx(sy,{className:"size-3.5 text-slate-500 dark:text-slate-400"})})}),v.jsx(ia,{side:"right",sideOffset:4,children:d?"New chat":`Start ${Ln} to connect`})]})]});return v.jsxs("div",{ref:R,style:B,className:ye("group/section",O&&"opacity-50 shadow-lg z-50 relative"),...k,children:[h?v.jsx(UI,{onRemove:()=>h(p),children:X}):X,!t.has(p)&&(w.length>0||C)&&v.jsxs("div",{className:"space-y-[2px] mb-2 ",children:[w.map(l),C&&v.jsx("button",{onClick:()=>s(p),className:"pl-2.5 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:S?"Show less":`Show more (${b.length-a})`})]})]})}function WI({projectGroups:e,collapsedSections:t,expandedGroups:n,onToggleSection:r,onToggleExpandedGroup:s,renderChatRow:l,chatsPerProject:a,onNewLocalChat:u,onRemoveProject:h,onReorderGroups:d,isConnected:m,startingLocalPath:p}){const _=Ij(kw(Dy,{activationConstraint:{distance:8}}),kw(Ty)),b=x.useMemo(()=>e.map(k=>k.groupKey),[e]),S=x.useRef(null);function w(k){const T=k.active.id;t.has(T)?S.current=null:(S.current=T,r(T))}function C(k){const{active:T,over:R}=k;if(R&&T.id!==R.id&&d){const D=b.indexOf(T.id),z=b.indexOf(R.id);if(D!==-1&&z!==-1){const L=Ny(b,D,z);d(L)}}if(S.current){const D=S.current;S.current=null,requestAnimationFrame(()=>r(D))}}return v.jsx($P,{sensors:_,collisionDetection:Wj,onDragStart:w,onDragEnd:C,children:v.jsx(n8,{items:b,strategy:e8,children:e.map(k=>v.jsx($I,{group:k,collapsedSections:t,expandedGroups:n,onToggleSection:r,onToggleExpandedGroup:s,renderChatRow:l,chatsPerProject:a,onNewLocalChat:u,onRemoveProject:h,isConnected:m,startingLocalPath:p},k.groupKey))})})}const Pw=e=>{let t;const n=new Set,r=(d,m)=>{const p=typeof d=="function"?d(t):d;if(!Object.is(p,t)){const _=t;t=m??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(b=>b(t,_))}},s=()=>t,u={setState:r,getState:s,getInitialState:()=>h,subscribe:d=>(n.add(d),()=>n.delete(d))},h=t=e(r,s,u);return u},qI=(e=>e?Pw(e):Pw),VI=e=>e;function KI(e,t=VI){const n=pt.useSyncExternalStore(e.subscribe,pt.useCallback(()=>t(e.getState()),[e,t]),pt.useCallback(()=>t(e.getInitialState()),[e,t]));return pt.useDebugValue(n),n}const GI=e=>{const t=qI(e),n=r=>KI(t,r);return Object.assign(n,t),n},wu=(e=>GI);function YI(e,t){let n;try{n=e()}catch{return}return{getItem:s=>{var l;const a=h=>h===null?null:JSON.parse(h,void 0),u=(l=n.getItem(s))!=null?l:null;return u instanceof Promise?u.then(a):a(u)},setItem:(s,l)=>n.setItem(s,JSON.stringify(l,void 0)),removeItem:s=>n.removeItem(s)}}const Bv=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Bv(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Bv(r)(n)}}}},XI=(e,t)=>(n,r,s)=>{let l={storage:YI(()=>window.localStorage),partialize:C=>C,version:0,merge:(C,k)=>({...k,...C}),...t},a=!1,u=0;const h=new Set,d=new Set;let m=l.storage;if(!m)return e((...C)=>{console.warn(`[zustand persist middleware] Unable to update item '${l.name}', the given storage is currently unavailable.`),n(...C)},r,s);const p=()=>{const C=l.partialize({...r()});return m.setItem(l.name,{state:C,version:l.version})},_=s.setState;s.setState=(C,k)=>(_(C,k),p());const b=e((...C)=>(n(...C),p()),r,s);s.getInitialState=()=>b;let S;const w=()=>{var C,k;if(!m)return;const T=++u;a=!1,h.forEach(D=>{var z;return D((z=r())!=null?z:b)});const R=((k=l.onRehydrateStorage)==null?void 0:k.call(l,(C=r())!=null?C:b))||void 0;return Bv(m.getItem.bind(m))(l.name).then(D=>{if(D)if(typeof D.version=="number"&&D.version!==l.version){if(l.migrate){const z=l.migrate(D.state,D.version);return z instanceof Promise?z.then(L=>[!0,L]):[!0,z]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,D.state];return[!1,void 0]}).then(D=>{var z;if(T!==u)return;const[L,O]=D;if(S=l.merge(O,(z=r())!=null?z:b),n(S,!0),L)return p()}).then(()=>{T===u&&(R==null||R(S,void 0),S=r(),a=!0,d.forEach(D=>D(S)))}).catch(D=>{T===u&&(R==null||R(void 0,D))})};return s.persist={setOptions:C=>{l={...l,...C},C.storage&&(m=C.storage)},clearStorage:()=>{m==null||m.removeItem(l.name)},getOptions:()=>l,rehydrate:()=>w(),hasHydrated:()=>a,onHydrate:C=>(h.add(C),()=>{h.delete(C)}),onFinishHydration:C=>(d.add(C),()=>{d.delete(C)})},l.skipHydration||w(),S||b},Cu=XI,Iw=wu()(Cu(e=>({order:[],setOrder:t=>e({order:t})}),{name:"project-group-order"}));function ZI({data:e,activeChatId:t,connectionStatus:n,ready:r,open:s,collapsed:l,showMobileOpenButton:a,onOpen:u,onClose:h,onCollapse:d,onExpand:m,onCreateChat:p,onDeleteChat:_,onRemoveProject:b}){const S=Ci(),w=W_(),C=x.useRef(null),[k,T]=x.useState(new Set),[R,D]=x.useState(new Set),[z,L]=x.useState(()=>Date.now()),O=10,B=Iw(Z=>Z.order),X=Iw(Z=>Z.setOrder),P=x.useMemo(()=>{if(B.length===0)return e.projectGroups;const Z=new Map(e.projectGroups.map(pe=>[pe.groupKey,pe])),ae=B.filter(pe=>Z.has(pe)).map(pe=>Z.get(pe)),se=new Set(B);for(const pe of e.projectGroups)se.has(pe.groupKey)||ae.push(pe);return ae},[e.projectGroups,B]),q=x.useCallback(Z=>X(Z),[X]),H=x.useMemo(()=>new Map(e.projectGroups.map(Z=>[Z.localPath,Z.groupKey])),[e.projectGroups]),U=x.useMemo(()=>e.projectGroups.reduce((Z,ae)=>Z+ae.chats.length,0),[e.projectGroups]),V=x.useCallback(Z=>{T(ae=>{const se=new Set(ae);return se.has(Z)?se.delete(Z):se.add(Z),se})},[]),F=x.useCallback(Z=>{D(ae=>{const se=new Set(ae);return se.has(Z)?se.delete(Z):se.add(Z),se})},[]),j=x.useCallback(Z=>v.jsx(Cj,{chat:Z,activeChatId:t,nowMs:z,onSelectChat:ae=>w(`/chat/${ae}`),onDeleteChat:()=>_(Z)},Z._id),[t,w,z,_]);x.useEffect(()=>{const Z=window.setInterval(()=>{L(Date.now())},3e4);return()=>window.clearInterval(Z)},[]),x.useEffect(()=>{!t||!C.current||requestAnimationFrame(()=>{const Z=C.current,ae=Z==null?void 0:Z.querySelector(`[data-chat-id="${t}"]`);if(!ae||!Z)return;const se=ae.getBoundingClientRect(),pe=Z.getBoundingClientRect();if(se.top<pe.top+38){const ke=se.top-pe.top+Z.scrollTop;Z.scrollTo({top:ke-38,behavior:"smooth"})}else if(se.bottom>pe.bottom){const ke=se.top+se.height/2-pe.top+Z.scrollTop,me=Z.clientHeight/2;Z.scrollTo({top:ke-me,behavior:"smooth"})}})},[t,U]);const K=U>0,$=S.pathname==="/",J=S.pathname==="/settings",A=$||J,I=n==="connecting"||!r,Y=I?"Connecting":n==="connected"?"Connected":"Disconnected",M=n==="connected"?"bg-emerald-500":"bg-amber-500";return v.jsxs(v.Fragment,{children:[!s&&a&&v.jsx(Ke,{variant:"ghost",size:"icon",className:"fixed top-3 left-3 z-50 md:hidden",onClick:u,children:v.jsx(xE,{className:"h-5 w-5"})}),l&&A&&v.jsx("div",{className:"hidden md:flex fixed left-0 top-0 h-full z-40 items-start pt-4 pl-5 border-l border-border/0",children:v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx(zc,{className:"size-6 text-logo"}),v.jsx(Ke,{variant:"ghost",size:"icon",onClick:m,title:"Expand sidebar",children:v.jsx(xv,{className:"h-5 w-5"})})]})}),v.jsxs("div",{"data-sidebar":"open",className:ye("fixed inset-0 z-50 bg-background dark:bg-card flex flex-col h-[100dvh] select-none","md:relative md:inset-auto md:w-[275px] md:mr-0 md:h-[calc(100dvh-16px)] md:my-2 md:ml-2 md:border md:border-border md:rounded-2xl",s?"flex":"hidden md:flex",l&&"md:hidden"),children:[v.jsxs("div",{className:" pl-3 pr-[7px] h-[64px] max-h-[64px] md:h-[55px] md:max-h-[55px] border-b flex items-center justify-between",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsxs("button",{type:"button",onClick:d,title:"Collapse sidebar",className:"hidden md:flex group/sidebar-collapse relative items-center justify-center h-5 w-5 sm:h-6 sm:w-6",children:[v.jsx(zc,{className:"absolute inset-0.5 h-4 w-4 sm:h-5 sm:w-5 text-logo transition-all duration-200 ease-out opacity-100 scale-100 group-hover/sidebar-collapse:opacity-0 group-hover/sidebar-collapse:scale-0"}),v.jsx(xv,{className:"absolute inset-0 h-4 w-4 sm:h-6 sm:w-6 text-slate-500 dark:text-slate-400 transition-all duration-200 ease-out opacity-0 scale-0 group-hover/sidebar-collapse:opacity-100 group-hover/sidebar-collapse:scale-80 hover:opacity-50"})]}),v.jsx(zc,{className:"h-5 w-5 sm:h-6 sm:w-6 text-logo md:hidden"}),v.jsx("span",{className:"font-logo text-base uppercase sm:text-md text-slate-600 dark:text-slate-100",children:Ln})]}),v.jsxs("div",{className:"flex items-center",children:[v.jsx(Ke,{variant:"ghost",size:"icon",onClick:()=>{w("/"),h()},title:"New project",children:v.jsx(iy,{className:"size-4"})}),v.jsx(Ke,{variant:"ghost",size:"icon",className:"md:hidden",onClick:h,children:v.jsx(pu,{className:"h-5 w-5"})})]})]}),v.jsx("div",{ref:C,className:"flex-1 min-h-0 overflow-y-auto scrollbar-hide",style:{WebkitOverflowScrolling:"touch"},children:v.jsxs("div",{className:"p-[7px]",children:[!K&&I?v.jsx("div",{className:"space-y-5 px-1 pt-3",children:[0,1,2].map(Z=>v.jsxs("div",{className:"space-y-2 animate-pulse",children:[v.jsx("div",{className:"h-4 w-28 rounded bg-muted"}),v.jsx("div",{className:"space-y-1",children:[0,1,2].map(ae=>v.jsxs("div",{className:"flex items-center gap-2 rounded-md px-3 py-2",children:[v.jsx("div",{className:"h-3.5 w-3.5 rounded-full bg-muted"}),v.jsx("div",{className:ye("h-3.5 rounded bg-muted",ae===0?"w-32":ae===1?"w-40":"w-28")})]},ae))})]},Z))}):null,!K&&!I&&e.projectGroups.length===0?v.jsx("p",{className:"text-sm text-slate-400 p-2 mt-6 text-center",children:"No conversations yet"}):null,v.jsx(WI,{projectGroups:P,onReorderGroups:q,collapsedSections:k,expandedGroups:R,onToggleSection:V,onToggleExpandedGroup:F,renderChatRow:j,chatsPerProject:O,onNewLocalChat:Z=>{const ae=H.get(Z);ae&&p(ae)},onRemoveProject:b,isConnected:n==="connected"})]})}),v.jsx("div",{className:"border-t border-border p-2",children:v.jsx("button",{type:"button",onClick:()=>{w("/settings"),h()},className:ye("w-full rounded-xl rounded-t-md border px-3 py-2 text-left transition-colors",J?"bg-muted border-border":"border-border/0 hover:bg-muted hover:border-border active:bg-muted/80"),children:v.jsxs("div",{className:"flex items- justify-between gap-2",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(EE,{className:"h-4 w-4 text-muted-foreground"}),v.jsx("span",{className:"text-sm",children:"Settings"})]}),v.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[v.jsx("span",{children:Y}),I?v.jsx(Js,{className:"h-2 w-2 animate-spin"}):v.jsx("span",{className:ye("h-2 w-2 rounded-full",M)})]})]})})})]}),s?v.jsx("div",{className:"fixed inset-0 bg-black/40 z-40 md:hidden",onClick:h}):null]})}const Fy=[{id:"low",label:"Low"},{id:"medium",label:"Medium"},{id:"high",label:"High"},{id:"max",label:"Max"}],SM=[{id:"minimal",label:"Minimal"},{id:"low",label:"Low"},{id:"medium",label:"Medium"},{id:"high",label:"High"},{id:"xhigh",label:"XHigh"}],wM={reasoningEffort:"high"},jv={reasoningEffort:"high",fastMode:!1};function Hw(e){return Fy.some(t=>t.id===e)}function Fw(e){return SM.some(t=>t.id===e)}const QI=[{id:"claude",label:"Claude",defaultModel:"opus",defaultEffort:"high",supportsPlanMode:!0,models:[{id:"opus",label:"Opus",supportsEffort:!0},{id:"sonnet",label:"Sonnet",supportsEffort:!0},{id:"haiku",label:"Haiku",supportsEffort:!0}],efforts:[...Fy]},{id:"codex",label:"Codex",defaultModel:"gpt-5.4",supportsPlanMode:!0,models:[{id:"gpt-5.4",label:"GPT-5.4",supportsEffort:!1},{id:"gpt-5.3-codex",label:"GPT-5.3 Codex",supportsEffort:!1},{id:"gpt-5.3-codex-spark",label:"GPT-5.3 Codex Spark",supportsEffort:!1}],efforts:[]}];var Bf="Popover",[CM]=Qs(Bf,[fa]),ku=fa(),[JI,eo]=CM(Bf),kM=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:l,modal:a=!1}=e,u=ku(t),h=x.useRef(null),[d,m]=x.useState(!1),[p,_]=vf({prop:r,defaultProp:s??!1,onChange:l,caller:Bf});return v.jsx(_y,{...u,children:v.jsx(JI,{scope:t,contentId:Kl(),triggerRef:h,open:p,onOpenChange:_,onOpenToggle:x.useCallback(()=>_(b=>!b),[_]),hasCustomAnchor:d,onCustomAnchorAdd:x.useCallback(()=>m(!0),[]),onCustomAnchorRemove:x.useCallback(()=>m(!1),[]),modal:a,children:n})})};kM.displayName=Bf;var EM="PopoverAnchor",e9=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=eo(EM,n),l=ku(n),{onCustomAnchorAdd:a,onCustomAnchorRemove:u}=s;return x.useEffect(()=>(a(),()=>u()),[a,u]),v.jsx(Rf,{...l,...r,ref:t})});e9.displayName=EM;var RM="PopoverTrigger",MM=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=eo(RM,n),l=ku(n),a=Bt(t,s.triggerRef),u=v.jsx(bt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":OM(s.open),...r,ref:a,onClick:Ne(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?u:v.jsx(Rf,{asChild:!0,...l,children:u})});MM.displayName=RM;var Uy="PopoverPortal",[t9,n9]=CM(Uy,{forceMount:void 0}),TM=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,l=eo(Uy,t);return v.jsx(t9,{scope:t,forceMount:n,children:v.jsx(Ir,{present:n||l.open,children:v.jsx(fu,{asChild:!0,container:s,children:r})})})};TM.displayName=Uy;var sa="PopoverContent",AM=x.forwardRef((e,t)=>{const n=n9(sa,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,l=eo(sa,e.__scopePopover);return v.jsx(Ir,{present:r||l.open,children:l.modal?v.jsx(i9,{...s,ref:t}):v.jsx(s9,{...s,ref:t})})});AM.displayName=sa;var r9=ea("PopoverContent.RemoveScroll"),i9=x.forwardRef((e,t)=>{const n=eo(sa,e.__scopePopover),r=x.useRef(null),s=Bt(t,r),l=x.useRef(!1);return x.useEffect(()=>{const a=r.current;if(a)return ey(a)},[]),v.jsx(bf,{as:r9,allowPinchZoom:!0,children:v.jsx(DM,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ne(e.onCloseAutoFocus,a=>{var u;a.preventDefault(),l.current||(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Ne(e.onPointerDownOutside,a=>{const u=a.detail.originalEvent,h=u.button===0&&u.ctrlKey===!0,d=u.button===2||h;l.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:Ne(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),s9=x.forwardRef((e,t)=>{const n=eo(sa,e.__scopePopover),r=x.useRef(!1),s=x.useRef(!1);return v.jsx(DM,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var a,u;(a=e.onCloseAutoFocus)==null||a.call(e,l),l.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),l.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:l=>{var h,d;(h=e.onInteractOutside)==null||h.call(e,l),l.defaultPrevented||(r.current=!0,l.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=l.target;((d=n.triggerRef.current)==null?void 0:d.contains(a))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&s.current&&l.preventDefault()}})}),DM=x.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:l,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:d,onInteractOutside:m,...p}=e,_=eo(sa,n),b=ku(n);return J_(),v.jsx(_f,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:l,children:v.jsx(du,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:m,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:d,onDismiss:()=>_.onOpenChange(!1),children:v.jsx(yy,{"data-state":OM(_.open),role:"dialog",id:_.contentId,...b,...p,ref:t,style:{...p.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)"}})})})}),NM="PopoverClose",o9=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=eo(NM,n);return v.jsx(bt.button,{type:"button",...r,ref:t,onClick:Ne(e.onClick,()=>s.onOpenChange(!1))})});o9.displayName=NM;var l9="PopoverArrow",a9=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=ku(n);return v.jsx(by,{...s,...r,ref:t})});a9.displayName=l9;function OM(e){return e?"open":"closed"}var c9=kM,u9=MM,h9=TM,LM=AM;const d9=c9,f9=u9,zM=x.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},s)=>v.jsx(h9,{children:v.jsx(LM,{ref:s,align:t,sideOffset:n,[Vc]:"",onCloseAutoFocus:l=>{var a;l.preventDefault(),window.dispatchEvent(new Event($d)),(a=r.onCloseAutoFocus)==null||a.call(r,l)},className:ye("z-50 w-72 rounded-xl border border-border bg-background p-4 shadow-lg outline-hidden animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 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",e),...r})}));zM.displayName=LM.displayName;const BM=x.forwardRef(({className:e,...t},n)=>v.jsx("textarea",{"data-gramm":"false","data-gramm_editor":"false","data-enable-grammarly":"false","data-1p-ignore":!0,autoComplete:"off",className:ye("flex w-full rounded-lg border border-border bg-background px-2.5 py-2 text-sm placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));BM.displayName="Textarea";function p9(){const[e,t]=x.useState(()=>{if(typeof window>"u")return!1;const n=navigator.standalone===!0,r=window.matchMedia("(display-mode: standalone)").matches;return n||r});return x.useEffect(()=>{const n=window.matchMedia("(display-mode: standalone)"),r=s=>{t(s.matches||navigator.standalone===!0)};return n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[]),e}const m9=wu()(Cu((e,t)=>({drafts:{},setDraft:(n,r)=>e(s=>{if(!r){const{[n]:l,...a}=s.drafts;return{drafts:a}}return{drafts:{...s.drafts,[n]:r}}}),clearDraft:n=>e(r=>{const{[n]:s,...l}=r.drafts;return{drafts:l}}),getDraft:n=>t().drafts[n]??""}),{name:"chat-input-drafts"}));function g9(e){return e==="gpt-5-codex"?"gpt-5.3-codex":e??"gpt-5.4"}function v9(e){var n;const t=(n=e==null?void 0:e.modelOptions)==null?void 0:n.reasoningEffort;return{model:(e==null?void 0:e.model)??"opus",modelOptions:{reasoningEffort:Hw(t)?t:Hw(e==null?void 0:e.effort)?e.effort:wM.reasoningEffort}}}function _9(e){var n,r;const t=(n=e==null?void 0:e.modelOptions)==null?void 0:n.reasoningEffort;return{model:g9(e==null?void 0:e.model),modelOptions:{reasoningEffort:Fw(t)?t:Fw(e==null?void 0:e.effort)?e.effort:jv.reasoningEffort,fastMode:typeof((r=e==null?void 0:e.modelOptions)==null?void 0:r.fastMode)=="boolean"?e.modelOptions.fastMode:jv.fastMode}}}const jM=wu()(Cu(e=>({provider:"claude",planMode:!1,preferences:{claude:{model:"opus",modelOptions:{...wM}},codex:{model:"gpt-5.4",modelOptions:{...jv}}},setProvider:t=>e({provider:t}),setModel:(t,n)=>e(r=>({preferences:{...r.preferences,[t]:{...r.preferences[t],model:n,modelOptions:t==="claude"&&n!=="opus"&&r.preferences.claude.modelOptions.reasoningEffort==="max"?{reasoningEffort:"high"}:r.preferences[t].modelOptions}}})),setModelOptions:(t,n)=>e(r=>({preferences:{...r.preferences,[t]:{...r.preferences[t],modelOptions:{...r.preferences[t].modelOptions,...n}}}})),setPlanMode:t=>e({planMode:t})}),{name:"chat-preferences",version:2,migrate:e=>{var n,r;const t=e;return{provider:(t==null?void 0:t.provider)??"claude",planMode:(t==null?void 0:t.planMode)??!1,preferences:{claude:v9((n=t==null?void 0:t.preferences)==null?void 0:n.claude),codex:_9((r=t==null?void 0:t.preferences)==null?void 0:r.codex)}}}}));function wo({onClick:e,selected:t,icon:n,label:r,description:s,disabled:l}){return v.jsxs("button",{onClick:e,disabled:l,className:ye("w-full flex items-center gap-2 p-2 border border-border/0 rounded-lg text-left transition-opacity",t?"bg-muted border-border":"hover:opacity-60",l&&"opacity-40 cursor-not-allowed"),children:[n,v.jsxs("div",{children:[v.jsx("div",{className:"text-sm font-medium",children:r}),s?v.jsx("div",{className:"text-xs text-muted-foreground",children:s}):null]})]})}function mc({trigger:e,triggerClassName:t,disabled:n=!1,children:r}){const[s,l]=x.useState(!1);return n?v.jsx("button",{disabled:!0,className:ye("flex items-center gap-1.5 px-2 py-1 text-sm rounded-md text-muted-foreground [&>svg]:shrink-0 opacity-70 cursor-default",t),children:e}):v.jsxs(d9,{open:s,onOpenChange:l,children:[v.jsx(f9,{asChild:!0,children:v.jsx("button",{className:ye("flex items-center gap-1.5 px-2 py-1 text-sm rounded-md transition-colors text-muted-foreground [&>svg]:shrink-0","hover:bg-muted/50",t),children:e})}),v.jsx(zM,{align:"center",className:"w-64 p-1",children:v.jsx("div",{className:"space-y-1",children:typeof r=="function"?r(()=>l(!1)):r})})]})}function y9({className:e,...t}){return v.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:ye("shrink-0",e),...t,children:v.jsx("path",{d:"M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.5409Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z"})})}function b9({className:e,...t}){return v.jsx("svg",{viewBox:"0 0 158.7128 157.296",fill:"currentColor","aria-hidden":"true",className:ye("shrink-0",e),...t,children:v.jsx("path",{d:"M60.8734 57.2556V42.3124c0-1.2586.4722-2.2029 1.5728-2.8314l30.0443-17.3023c4.0899-2.3593 8.9662-3.4599 13.9988-3.4599 18.8759 0 30.8307 14.6289 30.8307 30.2006 0 1.1007 0 2.3593-.158 3.6178l-31.1446-18.2467c-1.8872-1.1006-3.7754-1.1006-5.6629 0L60.8734 57.2556Zm70.1542 58.2005V79.7487c0-2.2028-.9446-3.7756-2.8318-4.8763l-39.481-22.9651 12.8982-7.3934c1.1007-.6285 2.0453-.6285 3.1458 0l30.0441 17.3024c8.6523 5.0341 14.4708 15.7296 14.4708 26.1107 0 11.9539-7.0769 22.965-18.2461 27.527ZM51.593 83.9964l-12.8982-7.5497c-1.1007-.6285-1.5728-1.5728-1.5728-2.8314V39.0105c0-16.8303 12.8982-29.5722 30.3585-29.5722 6.607 0 12.7403 2.2029 17.9324 6.1349l-30.987 17.9324c-1.8871 1.1007-2.8314 2.6735-2.8314 4.8764v45.6159ZM79.3562 100.0403 60.8733 89.6592V67.6383l18.4829-10.3811 18.4812 10.3811v22.0209l-18.4812 10.3811Zm11.8757 47.8188c-6.607 0-12.7403-2.2031-17.9324-6.1344l30.9866-17.9333c1.8872-1.1005 2.8318-2.6728 2.8318-4.8759v-45.616l13.0564 7.5498c1.1005.6285 1.5723 1.5728 1.5723 2.8314v34.6051c0 16.8297-13.0564 29.5723-30.5147 29.5723ZM53.9522 112.7822 23.9079 95.4798c-8.652-5.0343-14.471-15.7296-14.471-26.1107 0-12.1119 7.2356-22.9652 18.403-27.5272v35.8634c0 2.2028.9443 3.7756 2.8314 4.8763l39.3248 22.8068-12.8982 7.3938c-1.1007.6287-2.045.6287-3.1456 0ZM52.2229 138.5791c-17.7745 0-30.8306-13.3713-30.8306-29.8871 0-1.2585.1578-2.5169.3143-3.7754l30.987 17.9323c1.8871 1.1005 3.7757 1.1005 5.6628 0l39.4811-22.807v14.9435c0 1.2585-.4721 2.2021-1.5728 2.8308l-30.0443 17.3025c-4.0898 2.359-8.9662 3.4605-13.9989 3.4605h.0014ZM91.2319 157.296c19.0327 0 34.9188-13.5272 38.5383-31.4594 17.6164-4.562 28.9425-21.0779 28.9425-37.908 0-11.0112-4.719-21.7066-13.2133-29.4143.7867-3.3035 1.2595-6.607 1.2595-9.909 0-22.4929-18.2471-39.3247-39.3251-39.3247-4.2461 0-8.3363.6285-12.4262 2.045-7.0792-6.9213-16.8318-11.3254-27.5271-11.3254-19.0331 0-34.9191 13.5268-38.5384 31.4591C11.3255 36.0212 0 52.5373 0 69.3675c0 11.0112 4.7184 21.7065 13.2125 29.4142-.7865 3.3035-1.2586 6.6067-1.2586 9.9092 0 22.4923 18.2466 39.3241 39.3248 39.3241 4.2462 0 8.3362-.6277 12.426-2.0441 7.0776 6.921 16.8302 11.3251 27.5271 11.3251Z"})})}const Uw={claude:y9,codex:b9},$w={opus:sw,sonnet:qc,haiku:Ud,"gpt-5.4":sw,"gpt-5.3-codex":qc,"gpt-5.3-codex-spark":Ud},x9=x.forwardRef(function({onSubmit:t,onCancel:n,disabled:r,canCancel:s,chatId:l,activeProvider:a,availableProviders:u},h){var I,Y;const{getDraft:d,setDraft:m,clearDraft:p}=m9(),{provider:_,preferences:b,planMode:S,setProvider:w,setModel:C,setModelOptions:k,setPlanMode:T}=jM(),[R,D]=x.useState(()=>l?d(l):""),z=x.useRef(null),L=p9(),O=a??_,B=u.find(M=>M.id===O)??u[0],X=b[O],P=a!==null,q=(B==null?void 0:B.supportsPlanMode)??!1,H=O==="claude"?b.claude.modelOptions.reasoningEffort:b.codex.modelOptions.reasoningEffort,U=b.codex.modelOptions.fastMode,V=O==="claude"?Fy:SM,F=x.useCallback(()=>{const M=z.current;M&&(M.style.height="auto",M.style.height=`${M.scrollHeight}px`)},[]);x.useEffect(()=>{F()},[R,F]),x.useEffect(()=>(window.addEventListener("resize",F),()=>window.removeEventListener("resize",F)),[F]),x.useEffect(()=>{var M;(M=z.current)==null||M.focus()},[l]),x.useEffect(()=>{if(h){if(typeof h=="function"){h(z.current);return}h.current=z.current}},[h]);function j(M){if(O==="claude"){k("claude",{reasoningEffort:M});return}k("codex",{reasoningEffort:M})}async function K(){if(!R.trim())return;const M=R;D(""),l&&p(l),z.current&&(z.current.style.height="auto");try{await t(M,{provider:O,model:X.model,modelOptions:O==="claude"?{claude:{...b.claude.modelOptions}}:{codex:{...b.codex.modelOptions}},planMode:q?S:!1})}catch(Z){console.error("[ChatInput] Submit failed:",Z),D(M),l&&m(l,M)}}function $(M){if(M.key==="Tab"&&!M.shiftKey){M.preventDefault(),k6(z.current,document);return}if(M.key==="Tab"&&M.shiftKey&&q){M.preventDefault(),T(!S);return}if(M.key==="Escape"&&s){M.preventDefault(),n==null||n();return}const Z="ontouchstart"in window||navigator.maxTouchPoints>0;M.key==="Enter"&&!M.shiftKey&&!s&&!Z&&(M.preventDefault(),K())}const J=Uw[O],A=$w[X.model]??qc;return v.jsxs("div",{className:ye("p-3 pt-0 md:pb-2",L&&"px-5 pb-5"),children:[v.jsxs("div",{className:"flex items-end gap-2 max-w-[840px] mx-auto border dark:bg-card/40 backdrop-blur-lg border-border rounded-[29px] pr-1.5",children:[v.jsx(BM,{ref:z,placeholder:"Build something...",value:R,autoFocus:!0,[ay]:"",rows:1,onChange:M=>{D(M.target.value),l&&m(l,M.target.value),F()},onKeyDown:$,disabled:r,className:"flex-1 text-base p-3 md:p-4 pl-4.5 md:pl-6 resize-none max-h-[200px] outline-none bg-transparent border-0 shadow-none"}),v.jsx(Ke,{type:"button",onPointerDown:M=>{M.preventDefault(),s?n==null||n():!r&&R.trim()&&K()},disabled:!s&&(r||!R.trim()),size:"icon",className:"flex-shrink-0 bg-slate-600 text-white dark:bg-white dark:text-slate-900 rounded-full cursor-pointer h-10 w-10 md:h-11 md:w-11 mb-1 -mr-0.5 md:mr-0 md:mb-1.5 touch-manipulation disabled:bg-white/60 disabled:text-slate-700",children:s?v.jsx("div",{className:"w-3 h-3 md:w-4 md:h-4 rounded-xs bg-current"}):v.jsx(sz,{className:"h-5 w-5 md:h-6 md:w-6"})})]}),v.jsxs("div",{className:"flex justify-center items-center gap-0.5 max-w-[840px] mx-auto mt-2 animate-fade-in",children:[v.jsx(mc,{disabled:P,trigger:v.jsxs(v.Fragment,{children:[v.jsx(J,{className:"h-3.5 w-3.5"}),v.jsx("span",{children:(B==null?void 0:B.label)??O})]}),children:M=>u.map(Z=>{const ae=Uw[Z.id];return v.jsx(wo,{onClick:()=>{w(Z.id),M()},selected:O===Z.id,icon:v.jsx(ae,{className:"h-4 w-4 text-muted-foreground"}),label:Z.label},Z.id)})}),v.jsx(mc,{trigger:v.jsxs(v.Fragment,{children:[v.jsx(A,{className:"h-3.5 w-3.5"}),v.jsx("span",{children:((I=B.models.find(M=>M.id===X.model))==null?void 0:I.label)??X.model})]}),children:M=>B.models.map(Z=>{const ae=$w[Z.id]??qc;return v.jsx(wo,{onClick:()=>{C(O,Z.id),M()},selected:X.model===Z.id,icon:v.jsx(ae,{className:"h-4 w-4 text-muted-foreground"}),label:Z.label},Z.id)})}),v.jsx(mc,{trigger:v.jsxs(v.Fragment,{children:[v.jsx(Jh,{className:"h-3.5 w-3.5"}),v.jsx("span",{children:((Y=V.find(M=>M.id===H))==null?void 0:Y.label)??H})]}),children:M=>V.map(Z=>v.jsx(wo,{onClick:()=>{j(Z.id),M()},selected:H===Z.id,icon:v.jsx(Jh,{className:"h-4 w-4 text-muted-foreground"}),label:Z.label,disabled:O==="claude"&&Z.id==="max"&&X.model!=="opus"},Z.id))}),O==="codex"?v.jsx(mc,{trigger:v.jsxs(v.Fragment,{children:[U?v.jsx(Ud,{className:"h-3.5 w-3.5"}):v.jsx(Jh,{className:"h-3.5 w-3.5"}),v.jsx("span",{children:U?"Fast Mode":"Standard"})]}),triggerClassName:U?"text-emerald-500 dark:text-emerald-400":void 0,children:M=>v.jsxs(v.Fragment,{children:[v.jsx(wo,{onClick:()=>{k("codex",{fastMode:!1}),M()},selected:!U,icon:v.jsx(Jh,{className:"h-4 w-4 text-muted-foreground"}),label:"Standard"}),v.jsx(wo,{onClick:()=>{k("codex",{fastMode:!0}),M()},selected:U,icon:v.jsx(Ud,{className:"h-4 w-4 text-muted-foreground"}),label:"Fast Mode"})]})}):null,q?v.jsx(mc,{trigger:v.jsxs(v.Fragment,{children:[S?v.jsx(Fd,{className:"h-3.5 w-3.5"}):v.jsx(lw,{className:"h-3.5 w-3.5"}),v.jsx("span",{children:S?"Plan Mode":"Full Access"})]}),triggerClassName:S?"text-blue-400 dark:text-blue-300":void 0,children:M=>v.jsxs(v.Fragment,{children:[v.jsx(wo,{onClick:()=>{T(!1),M()},selected:!S,icon:v.jsx(lw,{className:"h-4 w-4 text-muted-foreground"}),label:"Full Access",description:"Execution without approval"}),v.jsx(wo,{onClick:()=>{T(!0),M()},selected:S,icon:v.jsx(Fd,{className:"h-4 w-4 text-muted-foreground"}),label:"Plan Mode",description:"Review a plan before execution"})]})}):null]})]})}),S9=x.memo(x9),PM=x.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:ye("bg-card text-card-foreground",e),...t}));PM.displayName="Card";const IM=x.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:ye("flex flex-col space-y-1.5 p-2",e),...t}));IM.displayName="CardHeader";const w9=x.forwardRef(({className:e,...t},n)=>v.jsx("h3",{ref:n,className:ye("text-2xl font-semibold leading-none tracking-tight",e),...t}));w9.displayName="CardTitle";const C9=x.forwardRef(({className:e,...t},n)=>v.jsx("p",{ref:n,className:ye("text-sm text-muted-foreground",e),...t}));C9.displayName="CardDescription";const HM=x.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:ye("p-6 pt-0",e),...t}));HM.displayName="CardContent";const k9=x.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:ye("flex items-center p-6 pt-0",e),...t}));k9.displayName="CardFooter";function E9({sidebarCollapsed:e,onOpenSidebar:t,onExpandSidebar:n,onNewChat:r,localPath:s,embeddedTerminalVisible:l=!1,onToggleEmbeddedTerminal:a,onOpenExternal:u}){return v.jsx(IM,{className:ye("absolute top-0 md:top-2 left-0 right-0 z-10 px-2.5 pr-4 border-border/0 md:pb-0 flex items-center justify-center",e?"md:px-2.5 md:pr-4":"md:px-4 md:pr-4","backdrop-blur-lg md:backdrop-blur-none bg-gradient-to-b from-background md:from-transparent border-b border-x-0 md:border-x border-border md:border-none"),children:v.jsxs("div",{className:"relative flex items-center gap-2 w-full",children:[v.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0 border-l border-border/0",children:[v.jsx(Ke,{variant:"ghost",size:"icon",className:"md:hidden",onClick:t,children:v.jsx(xE,{className:"h-5 w-5"})}),e&&v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"flex items-center justify-center w-[40px] h-[40px]",children:v.jsx(zc,{className:"h-4 w-4 sm:h-5 sm:w-5 text-logo ml-1 hidden md:block"})}),v.jsx(Ke,{variant:"ghost",size:"icon",className:"hidden md:flex",onClick:n,title:"Expand sidebar",children:v.jsx(xv,{className:"h-5 w-5"})})]}),v.jsx(Ke,{variant:"ghost",size:"icon",onClick:r,title:"Compose",children:v.jsx(sy,{className:"h-5 w-5"})})]}),v.jsx("div",{className:"flex-1 min-w-0"}),v.jsx("div",{className:"flex items-center gap-1 flex-shrink-0",children:s&&(u||a)&&v.jsxs(v.Fragment,{children:[u?v.jsx(Ke,{variant:"ghost",size:"icon",onClick:()=>u("open_finder"),title:"Open in Finder",className:"border border-border/0",children:v.jsx(bE,{className:"h-4.5 w-4.5"})}):null,a?v.jsxs(Yc,{children:[v.jsx(Xc,{asChild:!0,children:v.jsx(Ke,{variant:"ghost",size:"icon",onClick:a,className:ye("border border-border/0",l&&"text-white"),children:v.jsx(oy,{className:"h-4.5 w-4.5"})})}),v.jsx(ia,{side:"bottom",children:"Cmd+J"})]}):null,u?v.jsx(Ke,{variant:"ghost",size:"icon",onClick:()=>u("open_editor"),title:"Open in Cursor",className:"border border-border/0",children:v.jsx(kz,{className:"h-4.5 w-4.5"})}):null]})})]})})}function R9(e,t){const n=getComputedStyle(e),r=parseFloat(n.fontSize);return t*r}function M9(e,t){const n=getComputedStyle(e.ownerDocument.body),r=parseFloat(n.fontSize);return t*r}function T9(e){return e/100*window.innerHeight}function A9(e){return e/100*window.innerWidth}function D9(e){switch(typeof e){case"number":return[e,"px"];case"string":{const t=parseFloat(e);return e.endsWith("%")?[t,"%"]:e.endsWith("px")?[t,"px"]:e.endsWith("rem")?[t,"rem"]:e.endsWith("em")?[t,"em"]:e.endsWith("vh")?[t,"vh"]:e.endsWith("vw")?[t,"vw"]:[t,"%"]}}}function Tc({groupSize:e,panelElement:t,styleProp:n}){let r;const[s,l]=D9(n);switch(l){case"%":{r=s/100*e;break}case"px":{r=s;break}case"rem":{r=M9(t,s);break}case"em":{r=R9(t,s);break}case"vh":{r=T9(s);break}case"vw":{r=A9(s);break}}return r}function Jn(e){return parseFloat(e.toFixed(3))}function oa({group:e}){const{orientation:t,panels:n}=e;return n.reduce((r,s)=>(r+=t==="horizontal"?s.element.offsetWidth:s.element.offsetHeight,r),0)}function Pv(e){const{panels:t}=e,n=oa({group:e});return n===0?t.map(r=>({groupResizeBehavior:r.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:r.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:r.panelConstraints.disabled,minSize:0,maxSize:100,panelId:r.id})):t.map(r=>{const{element:s,panelConstraints:l}=r;let a=0;if(l.collapsedSize!==void 0){const m=Tc({groupSize:n,panelElement:s,styleProp:l.collapsedSize});a=Jn(m/n*100)}let u;if(l.defaultSize!==void 0){const m=Tc({groupSize:n,panelElement:s,styleProp:l.defaultSize});u=Jn(m/n*100)}let h=0;if(l.minSize!==void 0){const m=Tc({groupSize:n,panelElement:s,styleProp:l.minSize});h=Jn(m/n*100)}let d=100;if(l.maxSize!==void 0){const m=Tc({groupSize:n,panelElement:s,styleProp:l.maxSize});d=Jn(m/n*100)}return{groupResizeBehavior:l.groupResizeBehavior,collapsedSize:a,collapsible:l.collapsible===!0,defaultSize:u,disabled:l.disabled,minSize:h,maxSize:d,panelId:r.id}})}function ut(e,t="Assertion error"){if(!e)throw Error(t)}function Iv(e,t){return Array.from(t).sort(e==="horizontal"?N9:O9)}function N9(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function O9(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function FM(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function UM(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function L9({orientation:e,rects:t,targetRect:n}){const r={x:n.x+n.width/2,y:n.y+n.height/2};let s,l=Number.MAX_VALUE;for(const a of t){const{x:u,y:h}=UM(r,a),d=e==="horizontal"?u:h;d<l&&(l=d,s=a)}return ut(s,"No rect found"),s}let sd;function z9(){return sd===void 0&&(typeof matchMedia=="function"?sd=!!matchMedia("(pointer:coarse)").matches:sd=!1),sd}function $M(e){const{element:t,orientation:n,panels:r,separators:s}=e,l=Iv(n,Array.from(t.children).filter(FM).map(S=>({element:S}))).map(({element:S})=>S),a=[];let u=!1,h=!1,d=-1,m=-1,p=0,_,b=[];{let S=-1;for(const w of l)w.hasAttribute("data-panel")&&(S++,w.ariaDisabled===null&&(p++,d===-1&&(d=S),m=S))}if(p>1){let S=-1;for(const w of l)if(w.hasAttribute("data-panel")){S++;const C=r.find(k=>k.element===w);if(C){if(_){const k=_.element.getBoundingClientRect(),T=w.getBoundingClientRect();let R;if(h){const D=n==="horizontal"?new DOMRect(k.right,k.top,0,k.height):new DOMRect(k.left,k.bottom,k.width,0),z=n==="horizontal"?new DOMRect(T.left,T.top,0,T.height):new DOMRect(T.left,T.top,T.width,0);switch(b.length){case 0:{R=[D,z];break}case 1:{const L=b[0],O=L9({orientation:n,rects:[k,T],targetRect:L.element.getBoundingClientRect()});R=[L,O===k?z:D];break}default:{R=b;break}}}else b.length?R=b:R=[n==="horizontal"?new DOMRect(k.right,T.top,T.left-k.right,T.height):new DOMRect(T.left,k.bottom,T.width,T.top-k.bottom)];for(const D of R){let z="width"in D?D:D.element.getBoundingClientRect();const L=z9()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(z.width<L){const B=L-z.width;z=new DOMRect(z.x-B/2,z.y,z.width+B,z.height)}if(z.height<L){const B=L-z.height;z=new DOMRect(z.x,z.y-B/2,z.width,z.height+B)}const O=S<=d||S>m;!u&&!O&&a.push({group:e,groupSize:oa({group:e}),panels:[_,C],separator:"width"in D?void 0:D,rect:z}),u=!1}}h=!1,_=C,b=[]}}else if(w.hasAttribute("data-separator")){w.ariaDisabled!==null&&(u=!0);const C=s.find(k=>k.element===w);C?b.push(C):(_=void 0,b=[])}else h=!0}return a}var Us,tk;let WM=(tk=class{constructor(){vS(this,Us,{})}addListener(t,n){const r=uc(this,Us)[t];return r===void 0?uc(this,Us)[t]=[n]:r.includes(n)||r.push(n),()=>{this.removeListener(t,n)}}emit(t,n){const r=uc(this,Us)[t];if(r!==void 0)if(r.length===1)r[0].call(null,n);else{let s=!1,l=null;const a=Array.from(r);for(let u=0;u<a.length;u++){const h=a[u];try{h.call(null,n)}catch(d){l===null&&(s=!0,l=d)}}if(s)throw l}}removeAllListeners(){_S(this,Us,{})}removeListener(t,n){const r=uc(this,Us)[t];if(r!==void 0){const s=r.indexOf(n);s>=0&&r.splice(s,1)}}},Us=new WeakMap,tk),mi=new Map;const qM=new WM;function B9(e){mi=new Map(mi),mi.delete(e)}function Ww(e,t){for(const[n]of mi)if(n.id===e)return n}function qs(e,t){for(const[n,r]of mi)if(n.id===e)return r;if(t)throw Error(`Could not find data for Group with id ${e}`)}function qo(){return mi}function $y(e,t){return qM.addListener("groupChange",n=>{n.group.id===e&&t(n)})}function ns(e,t){const n=mi.get(e);mi=new Map(mi),mi.set(e,t),qM.emit("groupChange",{group:e,prev:n,next:t})}function j9(e,t,n){let r,s={x:1/0,y:1/0};for(const l of t){const a=UM(n,l.rect);switch(e){case"horizontal":{a.x<=s.x&&(r=l,s=a);break}case"vertical":{a.y<=s.y&&(r=l,s=a);break}}}return r?{distance:s,hitRegion:r}:void 0}function P9(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function I9(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:Kw(e),b:Kw(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();ut(r,"Stacking order can only be calculated for elements with a common ancestor");const s={a:Vw(qw(n.a)),b:Vw(qw(n.b))};if(s.a===s.b){const l=r.childNodes,a={a:n.a.at(-1),b:n.b.at(-1)};let u=l.length;for(;u--;){const h=l[u];if(h===a.a)return 1;if(h===a.b)return-1}}return Math.sign(s.a-s.b)}const H9=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function F9(e){const t=getComputedStyle(VM(e)??e).display;return t==="flex"||t==="inline-flex"}function U9(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||F9(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||H9.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function qw(e){let t=e.length;for(;t--;){const n=e[t];if(ut(n,"Missing node"),U9(n))return n}return null}function Vw(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Kw(e){const t=[];for(;e;)t.push(e),e=VM(e);return t}function VM(e){const{parentNode:t}=e;return P9(t)?t.host:t}function $9(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function W9({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!FM(n)||n.contains(e)||e.contains(n))return!0;if(I9(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if($9(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function Wy(e,t){const n=[];return t.forEach((r,s)=>{if(s.disabled)return;const l=$M(s),a=j9(s.orientation,l,{x:e.clientX,y:e.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&W9({groupElement:s.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function q9(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function zn(e,t,n=0){return Math.abs(Jn(e)-Jn(t))<=n}function di(e,t){return zn(e,t)?0:e>t?1:-1}function Wl({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){const{collapsedSize:s=0,collapsible:l,disabled:a,maxSize:u=100,minSize:h=0}=t;if(a&&!e)return n;if(di(r,h)<0)if(l){const d=(s+h)/2;di(r,d)<0?r=s:r=h}else r=h;return r=Math.min(u,r),r=Jn(r),r}function nu({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:s,trigger:l}){if(zn(e,0))return t;const a=l==="imperative-api",u=Object.values(t),h=Object.values(s),d=[...u],[m,p]=r;ut(m!=null,"Invalid first pivot index"),ut(p!=null,"Invalid second pivot index");let _=0;switch(l){case"keyboard":{{const w=e<0?p:m,C=n[w];ut(C,`Panel constraints not found for index ${w}`);const{collapsedSize:k=0,collapsible:T,minSize:R=0}=C;if(T){const D=u[w];if(ut(D!=null,`Previous layout not found for panel index ${w}`),zn(D,k)){const z=R-D;di(z,Math.abs(e))>0&&(e=e<0?0-z:z)}}}{const w=e<0?m:p,C=n[w];ut(C,`No panel constraints found for index ${w}`);const{collapsedSize:k=0,collapsible:T,minSize:R=0}=C;if(T){const D=u[w];if(ut(D!=null,`Previous layout not found for panel index ${w}`),zn(D,R)){const z=D-k;di(z,Math.abs(e))>0&&(e=e<0?0-z:z)}}}break}default:{const w=e<0?p:m,C=n[w];ut(C,`Panel constraints not found for index ${w}`);const k=u[w],{collapsible:T,collapsedSize:R,minSize:D}=C;if(T&&di(k,D)<0)if(e>0){const z=D-R,L=z/2,O=k+e;di(O,D)<0&&(e=di(e,L)<=0?0:z)}else{const z=D-R,L=100-z/2,O=k-e;di(O,D)<0&&(e=di(100+e,L)>0?0:-z)}break}}{const w=e<0?1:-1;let C=e<0?p:m,k=0;for(;;){const R=u[C];ut(R!=null,`Previous layout not found for panel index ${C}`);const D=Wl({overrideDisabledPanels:a,panelConstraints:n[C],prevSize:R,size:100})-R;if(k+=D,C+=w,C<0||C>=n.length)break}const T=Math.min(Math.abs(e),Math.abs(k));e=e<0?0-T:T}{let w=e<0?m:p;for(;w>=0&&w<n.length;){const C=Math.abs(e)-Math.abs(_),k=u[w];ut(k!=null,`Previous layout not found for panel index ${w}`);const T=k-C,R=Wl({overrideDisabledPanels:a,panelConstraints:n[w],prevSize:k,size:T});if(!zn(k,R)&&(_+=k-R,d[w]=R,_.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?w--:w++}}if(q9(h,d))return s;{const w=e<0?p:m,C=u[w];ut(C!=null,`Previous layout not found for panel index ${w}`);const k=C+_,T=Wl({overrideDisabledPanels:a,panelConstraints:n[w],prevSize:C,size:k});if(d[w]=T,!zn(T,k)){let R=k-T,D=e<0?p:m;for(;D>=0&&D<n.length;){const z=d[D];ut(z!=null,`Previous layout not found for panel index ${D}`);const L=z+R,O=Wl({overrideDisabledPanels:a,panelConstraints:n[D],prevSize:z,size:L});if(zn(z,O)||(R-=O-z,d[D]=O),zn(R,0))break;e>0?D--:D++}}}const b=Object.values(d).reduce((w,C)=>C+w,0);if(!zn(b,100,.1))return s;const S=Object.keys(s);return d.reduce((w,C,k)=>(w[S[k]]=C,w),{})}function Bo(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(t[n]===void 0||di(e[n],t[n])!==0)return!1;return!0}function jo({layout:e,panelConstraints:t}){const n=Object.values(e),r=[...n],s=r.reduce((u,h)=>u+h,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(u=>`${u}%`).join(", ")}`);if(!zn(s,100)&&r.length>0)for(let u=0;u<t.length;u++){const h=r[u];ut(h!=null,`No layout data found for index ${u}`);const d=100/s*h;r[u]=d}let l=0;for(let u=0;u<t.length;u++){const h=n[u];ut(h!=null,`No layout data found for index ${u}`);const d=r[u];ut(d!=null,`No layout data found for index ${u}`);const m=Wl({overrideDisabledPanels:!0,panelConstraints:t[u],prevSize:h,size:d});d!=m&&(l+=d-m,r[u]=m)}if(!zn(l,0))for(let u=0;u<t.length;u++){const h=r[u];ut(h!=null,`No layout data found for index ${u}`);const d=h+l,m=Wl({overrideDisabledPanels:!0,panelConstraints:t[u],prevSize:h,size:d});if(h!==m&&(l-=m-h,r[u]=m,zn(l,0)))break}const a=Object.keys(e);return r.reduce((u,h,d)=>(u[a[d]]=h,u),{})}function KM({groupId:e,panelId:t}){const n=()=>{const u=qo();for(const[h,{defaultLayoutDeferred:d,derivedPanelConstraints:m,layout:p,groupSize:_,separatorToPanels:b}]of u)if(h.id===e)return{defaultLayoutDeferred:d,derivedPanelConstraints:m,group:h,groupSize:_,layout:p,separatorToPanels:b};throw Error(`Group ${e} not found`)},r=()=>{const u=n().derivedPanelConstraints.find(h=>h.panelId===t);if(u!==void 0)return u;throw Error(`Panel constraints not found for Panel ${t}`)},s=()=>{const u=n().group.panels.find(h=>h.id===t);if(u!==void 0)return u;throw Error(`Layout not found for Panel ${t}`)},l=()=>{const u=n().layout[t];if(u!==void 0)return u;throw Error(`Layout not found for Panel ${t}`)},a=u=>{const h=l();if(u===h)return;const{defaultLayoutDeferred:d,derivedPanelConstraints:m,group:p,groupSize:_,layout:b,separatorToPanels:S}=n(),w=p.panels.findIndex(R=>R.id===t),C=w===p.panels.length-1,k=nu({delta:C?h-u:u-h,initialLayout:b,panelConstraints:m,pivotIndices:C?[w-1,w]:[w,w+1],prevLayout:b,trigger:"imperative-api"}),T=jo({layout:k,panelConstraints:m});Bo(b,T)||ns(p,{defaultLayoutDeferred:d,derivedPanelConstraints:m,groupSize:_,layout:T,separatorToPanels:S})};return{collapse:()=>{const{collapsible:u,collapsedSize:h}=r(),{mutableValues:d}=s(),m=l();u&&m!==h&&(d.expandToSize=m,a(h))},expand:()=>{const{collapsible:u,collapsedSize:h,minSize:d}=r(),{mutableValues:m}=s(),p=l();if(u&&p===h){let _=m.expandToSize??d;_===0&&(_=1),a(_)}},getSize:()=>{const{group:u}=n(),h=l(),{element:d}=s(),m=u.orientation==="horizontal"?d.offsetWidth:d.offsetHeight;return{asPercentage:h,inPixels:m}},isCollapsed:()=>{const{collapsible:u,collapsedSize:h}=r(),d=l();return u&&zn(h,d)},resize:u=>{const{group:h}=n(),{element:d}=s(),m=oa({group:h}),p=Tc({groupSize:m,panelElement:d,styleProp:u}),_=Jn(p/m*100);a(_)}}}function Gw(e){if(e.defaultPrevented)return;const t=qo();Wy(e,t).forEach(n=>{if(n.separator){const r=n.panels.find(s=>s.panelConstraints.defaultSize!==void 0);if(r){const s=r.panelConstraints.defaultSize,l=KM({groupId:n.group.id,panelId:r.id});l&&s!==void 0&&(l.resize(s),e.preventDefault())}}})}function Td(e){const t=qo();for(const[n]of t)if(n.separators.some(r=>r.element===e))return n;throw Error("Could not find parent Group for separator element")}function GM({groupId:e}){const t=()=>{const n=qo();for(const[r,s]of n)if(r.id===e)return{group:r,...s};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:n,layout:r}=t();return n?{}:r},setLayout(n){const{defaultLayoutDeferred:r,derivedPanelConstraints:s,group:l,groupSize:a,layout:u,separatorToPanels:h}=t(),d=jo({layout:n,panelConstraints:s});return r?u:(Bo(u,d)||ns(l,{defaultLayoutDeferred:r,derivedPanelConstraints:s,groupSize:a,layout:d,separatorToPanels:h}),d)}}}function Co(e,t){const n=Td(e),r=qs(n.id,!0),s=n.separators.find(m=>m.element===e);ut(s,"Matching separator not found");const l=r.separatorToPanels.get(s);ut(l,"Matching panels not found");const a=l.map(m=>n.panels.indexOf(m)),u=GM({groupId:n.id}).getLayout(),h=nu({delta:t,initialLayout:u,panelConstraints:r.derivedPanelConstraints,pivotIndices:a,prevLayout:u,trigger:"keyboard"}),d=jo({layout:h,panelConstraints:r.derivedPanelConstraints});Bo(u,d)||ns(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:d,separatorToPanels:r.separatorToPanels})}function Yw(e){if(e.defaultPrevented)return;const t=e.currentTarget,n=Td(t);if(!n.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&Co(t,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&Co(t,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&Co(t,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&Co(t,-5);break}case"End":{e.preventDefault(),Co(t,100);break}case"Enter":{e.preventDefault();const r=Td(t),s=qs(r.id,!0),{derivedPanelConstraints:l,layout:a,separatorToPanels:u}=s,h=r.separators.find(_=>_.element===t);ut(h,"Matching separator not found");const d=u.get(h);ut(d,"Matching panels not found");const m=d[0],p=l.find(_=>_.panelId===m.id);if(ut(p,"Panel metadata not found"),p.collapsible){const _=a[m.id],b=p.collapsedSize===_?r.mutableState.expandedPanelSizes[m.id]??p.minSize:p.collapsedSize;Co(t,b-_)}break}case"F6":{e.preventDefault();const r=Td(t).separators.map(a=>a.element),s=Array.from(r).findIndex(a=>a===e.currentTarget);ut(s!==null,"Index not found");const l=e.shiftKey?s>0?s-1:r.length-1:s+1<r.length?s+1:0;r[l].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),Co(t,-100);break}}}let Zl={cursorFlags:0,state:"inactive"};const qy=new WM;function Po(){return Zl}function V9(e){return qy.addListener("change",e)}function K9(e){const t=Zl,n={...Zl};n.cursorFlags=e,Zl=n,qy.emit("change",{prev:t,next:n})}function Ql(e){const t=Zl;Zl=e,qy.emit("change",{prev:t,next:e})}function Xw(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=qo(),n=Wy(e,t),r=new Map;let s=!1;n.forEach(l=>{l.separator&&(s||(s=!0,l.separator.element.focus({preventScroll:!0})));const a=t.get(l.group);a&&r.set(l.group,a.layout)}),Ql({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),n.length&&e.preventDefault()}const G9=e=>e,Og=()=>{},YM=1,XM=2,ZM=4,QM=8,Zw=3,Qw=12;let od;function Jw(){return od===void 0&&(od=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(od=!0)),od}function Y9({cursorFlags:e,groups:t,state:n}){let r=0,s=0;switch(n){case"active":case"hover":t.forEach(l=>{if(!l.mutableState.disableCursor)switch(l.orientation){case"horizontal":{r++;break}case"vertical":{s++;break}}})}if(!(r===0&&s===0)){switch(n){case"active":{if(e&&Jw()){const l=(e&YM)!==0,a=(e&XM)!==0,u=(e&ZM)!==0,h=(e&QM)!==0;if(l)return u?"se-resize":h?"ne-resize":"e-resize";if(a)return u?"sw-resize":h?"nw-resize":"w-resize";if(u)return"s-resize";if(h)return"n-resize"}break}}return Jw()?r>0&&s>0?"move":r>0?"ew-resize":"ns-resize":r>0&&s>0?"grab":r>0?"col-resize":"row-resize"}}const eC=new WeakMap;function Vy(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=eC.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(n));const r=Po();switch(r.state){case"active":case"hover":{const s=Y9({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(a=>a.group),state:r.state}),l=`*, *:hover {cursor: ${s} !important; }`;if(t===l)return;t=l,s?n.cssRules.length===0?n.insertRule(l):n.replaceSync(l):n.cssRules.length===1&&n.deleteRule(0);break}case"inactive":{t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}}eC.set(e,{prevStyle:t,styleSheet:n})}function JM({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:s,pointerDownAtPoint:l,prevCursorFlags:a}){let u=0;n.forEach(d=>{const{group:m,groupSize:p}=d,{orientation:_,panels:b}=m,{disableCursor:S}=m.mutableState;let w=0;l?_==="horizontal"?w=(t.clientX-l.x)/p*100:w=(t.clientY-l.y)/p*100:_==="horizontal"?w=t.clientX<0?-100:100:w=t.clientY<0?-100:100;const C=r.get(m),k=s.get(m);if(!C||!k)return;const{defaultLayoutDeferred:T,derivedPanelConstraints:R,groupSize:D,layout:z,separatorToPanels:L}=k;if(R&&z&&L){const O=nu({delta:w,initialLayout:C,panelConstraints:R,pivotIndices:d.panels.map(B=>b.indexOf(B)),prevLayout:z,trigger:"mouse-or-touch"});if(Bo(O,z)){if(w!==0&&!S)switch(_){case"horizontal":{u|=w<0?YM:XM;break}case"vertical":{u|=w<0?ZM:QM;break}}}else ns(d.group,{defaultLayoutDeferred:T,derivedPanelConstraints:R,groupSize:D,layout:O,separatorToPanels:L})}});let h=0;t.movementX===0?h|=a&Zw:h|=u&Zw,t.movementY===0?h|=a&Qw:h|=u&Qw,K9(h),Vy(e)}function tC(e){const t=qo(),n=Po();switch(n.state){case"active":JM({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}}function nC(e){if(e.defaultPrevented)return;const t=Po(),n=qo();switch(t.state){case"active":{if(e.buttons===0){Ql({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(r=>{const s=qs(r.group.id,!0);ns(r.group,s)});return}JM({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const r=Wy(e,n);r.length===0?t.state!=="inactive"&&Ql({cursorFlags:0,state:"inactive"}):Ql({cursorFlags:0,hitRegions:r,state:"hover"}),Vy(e.currentTarget);break}}}function rC(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(Po().state){case"hover":Ql({cursorFlags:0,state:"inactive"})}}function iC(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=Po();switch(t.state){case"active":Ql({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(Vy(e.currentTarget),t.hitRegions.forEach(n=>{const r=qs(n.group.id,!0);ns(n.group,r)}),e.preventDefault())}}function sC(e){let t=0,n=0;const r={};for(const l of e)if(l.defaultSize!==void 0){t++;const a=Jn(l.defaultSize);n+=a,r[l.panelId]=a}else r[l.panelId]=void 0;const s=e.length-t;if(s!==0){const l=Jn((100-n)/s);for(const a of e)a.defaultSize===void 0&&(r[a.panelId]=l)}return r}function X9(e,t,n){if(!n[0])return;const r=e.panels.find(h=>h.element===t);if(!r||!r.onResize)return;const s=oa({group:e}),l=e.orientation==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,a=r.mutableValues.prevSize,u={asPercentage:Jn(l/s*100),inPixels:l};r.mutableValues.prevSize=u,r.onResize(u,r.id,a)}function Z9(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Q9({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let s=0,l=0,a=!1;const u=new Map,h=[];for(const p of e.panels){const _=r[p.id]??0;switch(p.panelConstraints.groupResizeBehavior){case"preserve-pixel-size":{a=!0;const b=_/100*n,S=Jn(b/t*100);u.set(p.id,S),s+=S;break}case"preserve-relative-size":default:{h.push(p.id),l+=_;break}}}if(!a||h.length===0)return r;const d=100-s,m={...r};if(u.forEach((p,_)=>{m[_]=p}),l>0)for(const p of h){const _=r[p]??0;m[p]=Jn(_/l*d)}else{const p=Jn(d/h.length);for(const _ of h)m[_]=p}return m}function J9(e,t){const n=e.map(s=>s.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(const s of n)if(!r.includes(s))return!1;return!0}const Pl=new Map;function e7(e){let t=!0;ut(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,s=new Set,l=new n(S=>{for(const w of S){const{borderBoxSize:C,target:k}=w;if(k===e.element){if(t){const T=oa({group:e});if(T===0)return;const R=qs(e.id);if(!R)return;const D=Pv(e),z=R.defaultLayoutDeferred?sC(D):R.layout,L=Q9({group:e,nextGroupSize:T,prevGroupSize:R.groupSize,prevLayout:z}),O=jo({layout:L,panelConstraints:D});if(!R.defaultLayoutDeferred&&Bo(R.layout,O)&&Z9(R.derivedPanelConstraints,D)&&R.groupSize===T)return;ns(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:D,groupSize:T,layout:O,separatorToPanels:R.separatorToPanels})}}else X9(e,k,C)}});l.observe(e.element),e.panels.forEach(S=>{ut(!r.has(S.id),`Panel ids must be unique; id "${S.id}" was used more than once`),r.add(S.id),S.onResize&&l.observe(S.element)});const a=oa({group:e}),u=Pv(e),h=e.panels.map(({id:S})=>S).join(",");let d=e.mutableState.defaultLayout;d&&(J9(e.panels,d)||(d=void 0));const m=e.mutableState.layouts[h]??d??sC(u),p=jo({layout:m,panelConstraints:u}),_=e.element.ownerDocument;Pl.set(_,(Pl.get(_)??0)+1);const b=new Map;return $M(e).forEach(S=>{S.separator&&b.set(S.separator,S.panels)}),ns(e,{defaultLayoutDeferred:a===0,derivedPanelConstraints:u,groupSize:a,layout:p,separatorToPanels:b}),e.separators.forEach(S=>{ut(!s.has(S.id),`Separator ids must be unique; id "${S.id}" was used more than once`),s.add(S.id),S.element.addEventListener("keydown",Yw)}),Pl.get(_)===1&&(_.addEventListener("dblclick",Gw,!0),_.addEventListener("pointerdown",Xw,!0),_.addEventListener("pointerleave",tC),_.addEventListener("pointermove",nC),_.addEventListener("pointerout",rC),_.addEventListener("pointerup",iC,!0)),function(){t=!1,Pl.set(_,Math.max(0,(Pl.get(_)??0)-1)),B9(e),e.separators.forEach(S=>{S.element.removeEventListener("keydown",Yw)}),Pl.get(_)||(_.removeEventListener("dblclick",Gw,!0),_.removeEventListener("pointerdown",Xw,!0),_.removeEventListener("pointerleave",tC),_.removeEventListener("pointermove",nC),_.removeEventListener("pointerout",rC),_.removeEventListener("pointerup",iC,!0)),l.disconnect()}}function t7(){const[e,t]=x.useState({}),n=x.useCallback(()=>t({}),[]);return[e,n]}function Ky(e){const t=x.useId();return`${e??t}`}const Vo=typeof window<"u"?x.useLayoutEffect:x.useEffect;function Ic(e){const t=x.useRef(e);return Vo(()=>{t.current=e},[e]),x.useCallback((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[t])}function Gy(...e){return Ic(t=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(t);break}case"object":{n.current=t;break}}})})}function Yy(e){const t=x.useRef({...e});return Vo(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const eT=x.createContext(null);function n7(e,t){const n=x.useRef({getLayout:()=>({}),setLayout:G9});x.useImperativeHandle(t,()=>n.current,[]),Vo(()=>{Object.assign(n.current,GM({groupId:e}))})}function tT({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:s,elementRef:l,groupRef:a,id:u,onLayoutChange:h,onLayoutChanged:d,orientation:m="horizontal",resizeTargetMinimumSize:p={coarse:20,fine:10},style:_,...b}){const S=x.useRef({onLayoutChange:{},onLayoutChanged:{}}),w=Ic(q=>{Bo(S.current.onLayoutChange,q)||(S.current.onLayoutChange=q,h==null||h(q))}),C=Ic(q=>{Bo(S.current.onLayoutChanged,q)||(S.current.onLayoutChanged=q,d==null||d(q))}),k=Ky(u),T=x.useRef(null),[R,D]=t7(),z=x.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:p,separators:[]}),L=Gy(T,l);n7(k,a);const O=Ic((q,H)=>{const U=Po(),V=Ww(q),F=qs(q);if(F){let j=!1;switch(U.state){case"active":{j=U.hitRegions.some(K=>K.group===V);break}}return{flexGrow:F.layout[H]??1,pointerEvents:j?"none":void 0}}return{flexGrow:(n==null?void 0:n[H])??1}}),B=Yy({defaultLayout:n,disableCursor:r}),X=x.useMemo(()=>({get disableCursor(){return!!B.disableCursor},getPanelStyles:O,id:k,orientation:m,registerPanel:q=>{const H=z.current;return H.panels=Iv(m,[...H.panels,q]),D(),()=>{H.panels=H.panels.filter(U=>U!==q),D()}},registerSeparator:q=>{const H=z.current;return H.separators=Iv(m,[...H.separators,q]),D(),()=>{H.separators=H.separators.filter(U=>U!==q),D()}},togglePanelDisabled:(q,H)=>{const U=z.current.panels.find(j=>j.id===q);U&&(U.panelConstraints.disabled=H);const V=Ww(k),F=qs(k);V&&F&&ns(V,{...F,derivedPanelConstraints:Pv(V)})},toggleSeparatorDisabled:(q,H)=>{const U=z.current.separators.find(V=>V.id===q);U&&(U.disabled=H)}}),[O,k,D,m,B]),P=x.useRef(null);return Vo(()=>{const q=T.current;if(q===null)return;const H=z.current;let U;if(B.defaultLayout!==void 0&&Object.keys(B.defaultLayout).length===H.panels.length){U={};for(const A of H.panels){const I=B.defaultLayout[A.id];I!==void 0&&(U[A.id]=I)}}const V={disabled:!!s,element:q,id:k,mutableState:{defaultLayout:U,disableCursor:!!B.disableCursor,expandedPanelSizes:z.current.lastExpandedPanelSizes,layouts:z.current.layouts},orientation:m,panels:H.panels,resizeTargetMinimumSize:H.resizeTargetMinimumSize,separators:H.separators};P.current=V;const F=e7(V),{defaultLayoutDeferred:j,derivedPanelConstraints:K,layout:$}=qs(V.id,!0);!j&&K.length>0&&(w($),C($));const J=$y(k,A=>{const{defaultLayoutDeferred:I,derivedPanelConstraints:Y,layout:M}=A.next;if(I||Y.length===0)return;const Z=V.panels.map(({id:se})=>se).join(",");V.mutableState.layouts[Z]=M,Y.forEach(se=>{if(se.collapsible){const{layout:pe}=A.prev??{};if(pe){const ke=zn(se.collapsedSize,M[se.panelId]),me=zn(se.collapsedSize,pe[se.panelId]);ke&&!me&&(V.mutableState.expandedPanelSizes[se.panelId]=pe[se.panelId])}}});const ae=Po().state!=="active";w(M),ae&&C(M)});return()=>{P.current=null,F(),J()}},[s,k,C,w,m,R,B]),x.useEffect(()=>{const q=P.current;q&&(q.mutableState.defaultLayout=n,q.mutableState.disableCursor=!!r)}),v.jsx(eT.Provider,{value:X,children:v.jsx("div",{...b,className:t,"data-group":!0,"data-testid":k,id:k,ref:L,style:{height:"100%",width:"100%",overflow:"hidden",..._,display:"flex",flexDirection:m==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:m==="horizontal"?"pan-y":"pan-x"},children:e})})}tT.displayName="Group";function Xy(){const e=x.useContext(eT);return ut(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function r7(e,t){const{id:n}=Xy(),r=x.useRef({collapse:Og,expand:Og,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:Og});x.useImperativeHandle(t,()=>r.current,[]),Vo(()=>{Object.assign(r.current,KM({groupId:n,panelId:e}))})}function nT({children:e,className:t,collapsedSize:n="0%",collapsible:r=!1,defaultSize:s,disabled:l,elementRef:a,groupResizeBehavior:u="preserve-relative-size",id:h,maxSize:d="100%",minSize:m="0%",onResize:p,panelRef:_,style:b,...S}){const w=!!h,C=Ky(h),k=Yy({disabled:l}),T=x.useRef(null),R=Gy(T,a),{getPanelStyles:D,id:z,orientation:L,registerPanel:O,togglePanelDisabled:B}=Xy(),X=p!==null,P=Ic((H,U,V)=>{p==null||p(H,h,V)});Vo(()=>{const H=T.current;if(H!==null){const U={element:H,id:C,idIsStable:w,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:X?P:void 0,panelConstraints:{groupResizeBehavior:u,collapsedSize:n,collapsible:r,defaultSize:s,disabled:k.disabled,maxSize:d,minSize:m}};return O(U)}},[u,n,r,s,X,C,w,d,m,P,O,k]),x.useEffect(()=>{B(C,!!l)},[l,C,B]),r7(C,_);const q=x.useSyncExternalStore(H=>$y(z,H),()=>JSON.stringify(D(z,C)),()=>JSON.stringify(D(z,C)));return v.jsx("div",{...S,"aria-disabled":l||void 0,"data-panel":!0,"data-testid":C,id:C,ref:R,style:{...i7,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...JSON.parse(q)},children:v.jsx("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...b,touchAction:L==="horizontal"?"pan-y":"pan-x"},children:e})})}nT.displayName="Panel";const i7={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function s7({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let s,l;const a=e[n],u=t.find(h=>h.panelId===n);if(u){const h=u.maxSize,d=u.collapsible?u.collapsedSize:u.minSize,m=[r,r+1];l=jo({layout:nu({delta:d-a,initialLayout:e,panelConstraints:t,pivotIndices:m,prevLayout:e}),panelConstraints:t})[n],s=jo({layout:nu({delta:h-a,initialLayout:e,panelConstraints:t,pivotIndices:m,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:s,valueMin:l,valueNow:a}}function rT({children:e,className:t,disabled:n,elementRef:r,id:s,style:l,...a}){const u=Ky(s),h=Yy({disabled:n}),[d,m]=x.useState({}),[p,_]=x.useState("inactive"),b=x.useRef(null),S=Gy(b,r),{disableCursor:w,id:C,orientation:k,registerSeparator:T,toggleSeparatorDisabled:R}=Xy(),D=k==="horizontal"?"vertical":"horizontal";Vo(()=>{const L=b.current;if(L!==null){const O={disabled:h.disabled,element:L,id:u},B=T(O),X=V9(q=>{_(q.next.state!=="inactive"&&q.next.hitRegions.some(H=>H.separator===O)?q.next.state:"inactive")}),P=$y(C,q=>{const{derivedPanelConstraints:H,layout:U,separatorToPanels:V}=q.next,F=V.get(O);if(F){const j=F[0],K=F.indexOf(j);m(s7({layout:U,panelConstraints:H,panelId:j.id,panelIndex:K}))}});return()=>{X(),P(),B()}}},[C,u,T,h]),x.useEffect(()=>{R(u,!!n)},[n,u,R]);let z;return n&&!w&&(z="not-allowed"),v.jsx("div",{...a,"aria-controls":d.valueControls,"aria-disabled":n||void 0,"aria-orientation":D,"aria-valuemax":d.valueMax,"aria-valuemin":d.valueMin,"aria-valuenow":d.valueNow,children:e,className:t,"data-separator":n?"disabled":p,"data-testid":u,id:u,ref:S,role:"separator",style:{flexBasis:"auto",cursor:z,...l,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:n?void 0:0})}rT.displayName="Separator";const iT=({className:e,...t})=>v.jsx(tT,{className:ye("flex h-full w-full",e),...t}),Hv=e=>v.jsx(nT,{...e}),sT=({withHandle:e,orientation:t,className:n,...r})=>v.jsx(rT,{className:ye("relative flex items-center justify-center bg-transparent focus-visible:outline-none",t==="vertical"?"h-2 w-full -my-1 cursor-row-resize before:absolute before:inset-x-0 before:top-1/2 before:h-0.5 before:-translate-y-1/2 before:bg-border":"h-full w-2 -mx-1 cursor-col-resize before:absolute before:inset-y-0 before:left-1/2 before:w-px before:-translate-x-1/2 before:bg-border",n),...r,children:v.jsx("span",{className:"sr-only",children:t==="vertical"?"Resize rows":"Resize columns"})});/**
|
|
399
|
-
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
400
|
-
* @license MIT
|
|
401
|
-
*
|
|
402
|
-
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
403
|
-
* @license MIT
|
|
404
|
-
*
|
|
405
|
-
* Originally forked from (with the author's permission):
|
|
406
|
-
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
407
|
-
* http://bellard.org/jslinux/
|
|
408
|
-
* Copyright (c) 2011 Fabrice Bellard
|
|
409
|
-
*/var o7=2,l7=1,a7=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){var p;if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:((p=this._terminal.options.overviewRuler)==null?void 0:p.width)||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue("height")),s=Math.max(0,parseInt(n.getPropertyValue("width"))),l=window.getComputedStyle(this._terminal.element),a={top:parseInt(l.getPropertyValue("padding-top")),bottom:parseInt(l.getPropertyValue("padding-bottom")),right:parseInt(l.getPropertyValue("padding-right")),left:parseInt(l.getPropertyValue("padding-left"))},u=a.top+a.bottom,h=a.right+a.left,d=r-u,m=s-h-t;return{cols:Math.max(o7,Math.floor(m/e.css.cell.width)),rows:Math.max(l7,Math.floor(d/e.css.cell.height))}}};/**
|
|
410
|
-
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
411
|
-
* @license MIT
|
|
412
|
-
*
|
|
413
|
-
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
414
|
-
* @license MIT
|
|
415
|
-
*
|
|
416
|
-
* Originally forked from (with the author's permission):
|
|
417
|
-
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
418
|
-
* http://bellard.org/jslinux/
|
|
419
|
-
* Copyright (c) 2011 Fabrice Bellard
|
|
420
|
-
*/var sn=0,on=0,ln=0,Et=0,Mn;(e=>{function t(s,l,a,u){return u!==void 0?`#${ko(s)}${ko(l)}${ko(a)}${ko(u)}`:`#${ko(s)}${ko(l)}${ko(a)}`}e.toCss=t;function n(s,l,a,u=255){return(s<<24|l<<16|a<<8|u)>>>0}e.toRgba=n;function r(s,l,a,u){return{css:e.toCss(s,l,a,u),rgba:e.toRgba(s,l,a,u)}}e.toColor=r})(Mn||(Mn={}));var c7;(e=>{function t(h,d){if(Et=(d.rgba&255)/255,Et===1)return{css:d.css,rgba:d.rgba};let m=d.rgba>>24&255,p=d.rgba>>16&255,_=d.rgba>>8&255,b=h.rgba>>24&255,S=h.rgba>>16&255,w=h.rgba>>8&255;sn=b+Math.round((m-b)*Et),on=S+Math.round((p-S)*Et),ln=w+Math.round((_-w)*Et);let C=Mn.toCss(sn,on,ln),k=Mn.toRgba(sn,on,ln);return{css:C,rgba:k}}e.blend=t;function n(h){return(h.rgba&255)===255}e.isOpaque=n;function r(h,d,m){let p=Ad.ensureContrastRatio(h.rgba,d.rgba,m);if(p)return Mn.toColor(p>>24&255,p>>16&255,p>>8&255)}e.ensureContrastRatio=r;function s(h){let d=(h.rgba|255)>>>0;return[sn,on,ln]=Ad.toChannels(d),{css:Mn.toCss(sn,on,ln),rgba:d}}e.opaque=s;function l(h,d){return Et=Math.round(d*255),[sn,on,ln]=Ad.toChannels(h.rgba),{css:Mn.toCss(sn,on,ln,Et),rgba:Mn.toRgba(sn,on,ln,Et)}}e.opacity=l;function a(h,d){return Et=h.rgba&255,l(h,Et*d/255)}e.multiplyOpacity=a;function u(h){return[h.rgba>>24&255,h.rgba>>16&255,h.rgba>>8&255]}e.toColorRGB=u})(c7||(c7={}));var Sn;(e=>{let t,n;try{let s=document.createElement("canvas");s.width=1,s.height=1;let l=s.getContext("2d",{willReadFrequently:!0});l&&(t=l,t.globalCompositeOperation="copy",n=t.createLinearGradient(0,0,1,1))}catch{}function r(s){if(s.match(/#[\da-f]{3,8}/i))switch(s.length){case 4:return sn=parseInt(s.slice(1,2).repeat(2),16),on=parseInt(s.slice(2,3).repeat(2),16),ln=parseInt(s.slice(3,4).repeat(2),16),Mn.toColor(sn,on,ln);case 5:return sn=parseInt(s.slice(1,2).repeat(2),16),on=parseInt(s.slice(2,3).repeat(2),16),ln=parseInt(s.slice(3,4).repeat(2),16),Et=parseInt(s.slice(4,5).repeat(2),16),Mn.toColor(sn,on,ln,Et);case 7:return{css:s,rgba:(parseInt(s.slice(1),16)<<8|255)>>>0};case 9:return{css:s,rgba:parseInt(s.slice(1),16)>>>0}}let l=s.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(l)return sn=parseInt(l[1]),on=parseInt(l[2]),ln=parseInt(l[3]),Et=Math.round((l[5]===void 0?1:parseFloat(l[5]))*255),Mn.toColor(sn,on,ln,Et);if(!t||!n)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=n,t.fillStyle=s,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[sn,on,ln,Et]=t.getImageData(0,0,1,1).data,Et!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Mn.toRgba(sn,on,ln,Et),css:s}}e.toColor=r})(Sn||(Sn={}));var Nn;(e=>{function t(r){return n(r>>16&255,r>>8&255,r&255)}e.relativeLuminance=t;function n(r,s,l){let a=r/255,u=s/255,h=l/255,d=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4),m=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4),p=h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4);return d*.2126+m*.7152+p*.0722}e.relativeLuminance2=n})(Nn||(Nn={}));var Ad;(e=>{function t(a,u){if(Et=(u&255)/255,Et===1)return u;let h=u>>24&255,d=u>>16&255,m=u>>8&255,p=a>>24&255,_=a>>16&255,b=a>>8&255;return sn=p+Math.round((h-p)*Et),on=_+Math.round((d-_)*Et),ln=b+Math.round((m-b)*Et),Mn.toRgba(sn,on,ln)}e.blend=t;function n(a,u,h){let d=Nn.relativeLuminance(a>>8),m=Nn.relativeLuminance(u>>8);if(Gi(d,m)<h){if(m<d){let b=r(a,u,h),S=Gi(d,Nn.relativeLuminance(b>>8));if(S<h){let w=s(a,u,h),C=Gi(d,Nn.relativeLuminance(w>>8));return S>C?b:w}return b}let p=s(a,u,h),_=Gi(d,Nn.relativeLuminance(p>>8));if(_<h){let b=r(a,u,h),S=Gi(d,Nn.relativeLuminance(b>>8));return _>S?p:b}return p}}e.ensureContrastRatio=n;function r(a,u,h){let d=a>>24&255,m=a>>16&255,p=a>>8&255,_=u>>24&255,b=u>>16&255,S=u>>8&255,w=Gi(Nn.relativeLuminance2(_,b,S),Nn.relativeLuminance2(d,m,p));for(;w<h&&(_>0||b>0||S>0);)_-=Math.max(0,Math.ceil(_*.1)),b-=Math.max(0,Math.ceil(b*.1)),S-=Math.max(0,Math.ceil(S*.1)),w=Gi(Nn.relativeLuminance2(_,b,S),Nn.relativeLuminance2(d,m,p));return(_<<24|b<<16|S<<8|255)>>>0}e.reduceLuminance=r;function s(a,u,h){let d=a>>24&255,m=a>>16&255,p=a>>8&255,_=u>>24&255,b=u>>16&255,S=u>>8&255,w=Gi(Nn.relativeLuminance2(_,b,S),Nn.relativeLuminance2(d,m,p));for(;w<h&&(_<255||b<255||S<255);)_=Math.min(255,_+Math.ceil((255-_)*.1)),b=Math.min(255,b+Math.ceil((255-b)*.1)),S=Math.min(255,S+Math.ceil((255-S)*.1)),w=Gi(Nn.relativeLuminance2(_,b,S),Nn.relativeLuminance2(d,m,p));return(_<<24|b<<16|S<<8|255)>>>0}e.increaseLuminance=s;function l(a){return[a>>24&255,a>>16&255,a>>8&255,a&255]}e.toChannels=l})(Ad||(Ad={}));function ko(e){let t=e.toString(16);return t.length<2?"0"+t:t}function Gi(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var u7=Object.freeze((()=>{let e=[Sn.toColor("#2e3436"),Sn.toColor("#cc0000"),Sn.toColor("#4e9a06"),Sn.toColor("#c4a000"),Sn.toColor("#3465a4"),Sn.toColor("#75507b"),Sn.toColor("#06989a"),Sn.toColor("#d3d7cf"),Sn.toColor("#555753"),Sn.toColor("#ef2929"),Sn.toColor("#8ae234"),Sn.toColor("#fce94f"),Sn.toColor("#729fcf"),Sn.toColor("#ad7fa8"),Sn.toColor("#34e2e2"),Sn.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let n=0;n<216;n++){let r=t[n/36%6|0],s=t[n/6%6|0],l=t[n%6];e.push({css:Mn.toCss(r,s,l),rgba:Mn.toRgba(r,s,l)})}for(let n=0;n<24;n++){let r=8+n*10;e.push({css:Mn.toCss(r,r,r),rgba:Mn.toRgba(r,r,r)})}return e})());function oC(e,t,n){return Math.max(t,Math.min(e,n))}function h7(e){switch(e){case"&":return"&";case"<":return"<"}return e}var oT=class{constructor(t){this._buffer=t}serialize(t,n){let r=this._buffer.getNullCell(),s=this._buffer.getNullCell(),l=r,a=t.start.y,u=t.end.y,h=t.start.x,d=t.end.x;this._beforeSerialize(u-a,a,u);for(let m=a;m<=u;m++){let p=this._buffer.getLine(m);if(p){let _=m===t.start.y?h:0,b=m===t.end.y?d:p.length;for(let S=_;S<b;S++){let w=p.getCell(S,l===r?s:r);if(!w){console.warn(`Can't get cell at row=${m}, col=${S}`);continue}this._nextCell(w,l,m,S),l=w}}this._rowEnd(m,m===u)}return this._afterSerialize(),this._serializeString(n)}_nextCell(t,n,r,s){}_rowEnd(t,n){}_beforeSerialize(t,n,r){}_afterSerialize(){}_serializeString(t){return""}};function lT(e,t){return e.getFgColorMode()===t.getFgColorMode()&&e.getFgColor()===t.getFgColor()}function Xi(e,t){return e.getBgColorMode()===t.getBgColorMode()&&e.getBgColor()===t.getBgColor()}function aT(e,t){return e.isInverse()===t.isInverse()&&e.isBold()===t.isBold()&&e.isUnderline()===t.isUnderline()&&e.isOverline()===t.isOverline()&&e.isBlink()===t.isBlink()&&e.isInvisible()===t.isInvisible()&&e.isItalic()===t.isItalic()&&e.isDim()===t.isDim()&&e.isStrikethrough()===t.isStrikethrough()}var d7=class extends oT{constructor(e,t){super(e),this._terminal=t,this._rowIndex=0,this._allRows=new Array,this._allRowSeparators=new Array,this._currentRow="",this._nullCellCount=0,this._cursorStyle=this._buffer.getNullCell(),this._cursorStyleRow=0,this._cursorStyleCol=0,this._backgroundCell=this._buffer.getNullCell(),this._firstRow=0,this._lastCursorRow=0,this._lastCursorCol=0,this._lastContentCursorRow=0,this._lastContentCursorCol=0,this._thisRowLastChar=this._buffer.getNullCell(),this._thisRowLastSecondChar=this._buffer.getNullCell(),this._nextRowFirstChar=this._buffer.getNullCell()}_beforeSerialize(e,t,n){this._allRows=new Array(e),this._lastContentCursorRow=t,this._lastCursorRow=t,this._firstRow=t}_rowEnd(e,t){var r;this._nullCellCount>0&&!Xi(this._cursorStyle,this._backgroundCell)&&(this._currentRow+=`\x1B[${this._nullCellCount}X`);let n="";if(!t){e-this._firstRow>=this._terminal.rows&&((r=this._buffer.getLine(this._cursorStyleRow))==null||r.getCell(this._cursorStyleCol,this._backgroundCell));let s=this._buffer.getLine(e),l=this._buffer.getLine(e+1);if(!l.isWrapped)n=`\r
|
|
421
|
-
`,this._lastCursorRow=e+1,this._lastCursorCol=0;else{n="";let a=s.getCell(s.length-1,this._thisRowLastChar),u=s.getCell(s.length-2,this._thisRowLastSecondChar),h=l.getCell(0,this._nextRowFirstChar),d=h.getWidth()>1,m=!1;(h.getChars()&&d?this._nullCellCount<=1:this._nullCellCount<=0)&&((a.getChars()||a.getWidth()===0)&&Xi(a,h)&&(m=!0),d&&(u.getChars()||u.getWidth()===0)&&Xi(a,h)&&Xi(u,h)&&(m=!0)),m||(n="-".repeat(this._nullCellCount+1),n+="\x1B[1D\x1B[1X",this._nullCellCount>0&&(n+="\x1B[A",n+=`\x1B[${s.length-this._nullCellCount}C`,n+=`\x1B[${this._nullCellCount}X`,n+=`\x1B[${s.length-this._nullCellCount}D`,n+="\x1B[B"),this._lastContentCursorRow=e+1,this._lastContentCursorCol=0,this._lastCursorRow=e+1,this._lastCursorCol=0)}}this._allRows[this._rowIndex]=this._currentRow,this._allRowSeparators[this._rowIndex++]=n,this._currentRow="",this._nullCellCount=0}_diffStyle(e,t){let n=[],r=!lT(e,t),s=!Xi(e,t),l=!aT(e,t);if(r||s||l)if(e.isAttributeDefault())t.isAttributeDefault()||n.push(0);else{if(r){let a=e.getFgColor();e.isFgRGB()?n.push(38,2,a>>>16&255,a>>>8&255,a&255):e.isFgPalette()?a>=16?n.push(38,5,a):n.push(a&8?90+(a&7):30+(a&7)):n.push(39)}if(s){let a=e.getBgColor();e.isBgRGB()?n.push(48,2,a>>>16&255,a>>>8&255,a&255):e.isBgPalette()?a>=16?n.push(48,5,a):n.push(a&8?100+(a&7):40+(a&7)):n.push(49)}l&&(e.isInverse()!==t.isInverse()&&n.push(e.isInverse()?7:27),e.isBold()!==t.isBold()&&n.push(e.isBold()?1:22),e.isUnderline()!==t.isUnderline()&&n.push(e.isUnderline()?4:24),e.isOverline()!==t.isOverline()&&n.push(e.isOverline()?53:55),e.isBlink()!==t.isBlink()&&n.push(e.isBlink()?5:25),e.isInvisible()!==t.isInvisible()&&n.push(e.isInvisible()?8:28),e.isItalic()!==t.isItalic()&&n.push(e.isItalic()?3:23),e.isDim()!==t.isDim()&&n.push(e.isDim()?2:22),e.isStrikethrough()!==t.isStrikethrough()&&n.push(e.isStrikethrough()?9:29))}return n}_nextCell(e,t,n,r){if(e.getWidth()===0)return;let s=e.getChars()==="",l=this._diffStyle(e,this._cursorStyle);if(s?!Xi(this._cursorStyle,e):l.length>0){this._nullCellCount>0&&(Xi(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._lastContentCursorRow=this._lastCursorRow=n,this._lastContentCursorCol=this._lastCursorCol=r,this._currentRow+=`\x1B[${l.join(";")}m`;let a=this._buffer.getLine(n);a!==void 0&&(a.getCell(r,this._cursorStyle),this._cursorStyleRow=n,this._cursorStyleCol=r)}s?this._nullCellCount+=e.getWidth():(this._nullCellCount>0&&(Xi(this._cursorStyle,this._backgroundCell)?this._currentRow+=`\x1B[${this._nullCellCount}C`:(this._currentRow+=`\x1B[${this._nullCellCount}X`,this._currentRow+=`\x1B[${this._nullCellCount}C`),this._nullCellCount=0),this._currentRow+=e.getChars(),this._lastContentCursorRow=this._lastCursorRow=n,this._lastContentCursorCol=this._lastCursorCol=r+e.getWidth())}_serializeString(e){let t=this._allRows.length;this._buffer.length-this._firstRow<=this._terminal.rows&&(t=this._lastContentCursorRow+1-this._firstRow,this._lastCursorCol=this._lastContentCursorCol,this._lastCursorRow=this._lastContentCursorRow);let n="";for(let l=0;l<t;l++)n+=this._allRows[l],l+1<t&&(n+=this._allRowSeparators[l]);if(!e){let l=this._buffer.baseY+this._buffer.cursorY,a=this._buffer.cursorX,u=l!==this._lastCursorRow||a!==this._lastCursorCol,h=d=>{d>0?n+=`\x1B[${d}C`:d<0&&(n+=`\x1B[${-d}D`)};u&&((d=>{d>0?n+=`\x1B[${d}B`:d<0&&(n+=`\x1B[${-d}A`)})(l-this._lastCursorRow),h(a-this._lastCursorCol))}let r=this._terminal._core._inputHandler._curAttrData,s=this._diffStyle(r,this._cursorStyle);return s.length>0&&(n+=`\x1B[${s.join(";")}m`),n}},f7=class{activate(t){this._terminal=t}_serializeBufferByScrollback(t,n,r){let s=n.length,l=r===void 0?s:oC(r+t.rows,0,s);return this._serializeBufferByRange(t,n,{start:s-l,end:s-1},!1)}_serializeBufferByRange(t,n,r,s){return new d7(n,t).serialize({start:{x:0,y:typeof r.start=="number"?r.start:r.start.line},end:{x:t.cols,y:typeof r.end=="number"?r.end:r.end.line}},s)}_serializeBufferAsHTML(t,n){var h;let r=t.buffer.active,s=new p7(r,t,n),l=n.onlySelection??!1,a=n.range;if(a)return s.serialize({start:{x:a.startCol,y:(a.startLine,a.startLine)},end:{x:t.cols,y:(a.endLine,a.endLine)}});if(!l){let d=r.length,m=n.scrollback,p=m===void 0?d:oC(m+t.rows,0,d);return s.serialize({start:{x:0,y:d-p},end:{x:t.cols,y:d-1}})}let u=(h=this._terminal)==null?void 0:h.getSelectionPosition();return u!==void 0?s.serialize({start:{x:u.start.x,y:u.start.y},end:{x:u.end.x,y:u.end.y}}):""}_serializeModes(t){let n="",r=t.modes;if(r.applicationCursorKeysMode&&(n+="\x1B[?1h"),r.applicationKeypadMode&&(n+="\x1B[?66h"),r.bracketedPasteMode&&(n+="\x1B[?2004h"),r.insertMode&&(n+="\x1B[4h"),r.originMode&&(n+="\x1B[?6h"),r.reverseWraparoundMode&&(n+="\x1B[?45h"),r.sendFocusMode&&(n+="\x1B[?1004h"),r.wraparoundMode===!1&&(n+="\x1B[?7l"),r.mouseTrackingMode!=="none")switch(r.mouseTrackingMode){case"x10":n+="\x1B[?9h";break;case"vt200":n+="\x1B[?1000h";break;case"drag":n+="\x1B[?1002h";break;case"any":n+="\x1B[?1003h";break}return n}serialize(t){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");let n=t!=null&&t.range?this._serializeBufferByRange(this._terminal,this._terminal.buffer.normal,t.range,!0):this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.normal,t==null?void 0:t.scrollback);if(!(t!=null&&t.excludeAltBuffer)&&this._terminal.buffer.active.type==="alternate"){let r=this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.alternate,void 0);n+=`\x1B[?1049h\x1B[H${r}`}return t!=null&&t.excludeModes||(n+=this._serializeModes(this._terminal)),n}serializeAsHTML(t){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");return this._serializeBufferAsHTML(this._terminal,t||{})}dispose(){}},p7=class extends oT{constructor(t,n,r){super(t),this._terminal=n,this._options=r,this._currentRow="",this._htmlContent="",n._core._themeService?this._ansiColors=n._core._themeService.colors.ansi:this._ansiColors=u7}_padStart(t,n,r){return n=n>>0,r=r??" ",t.length>n?t:(n-=t.length,n>r.length&&(r+=r.repeat(n/r.length)),r.slice(0,n)+t)}_beforeSerialize(t,n,r){var u,h;this._htmlContent+="<html><body><!--StartFragment--><pre>";let s="#000000",l="#ffffff";(this._options.includeGlobalBackground??!1)&&(s=((u=this._terminal.options.theme)==null?void 0:u.foreground)??"#ffffff",l=((h=this._terminal.options.theme)==null?void 0:h.background)??"#000000");let a=[];a.push("color: "+s+";"),a.push("background-color: "+l+";"),a.push("font-family: "+this._terminal.options.fontFamily+";"),a.push("font-size: "+this._terminal.options.fontSize+"px;"),this._htmlContent+="<div style='"+a.join(" ")+"'>"}_afterSerialize(){this._htmlContent+="</div>",this._htmlContent+="</pre><!--EndFragment--></body></html>"}_rowEnd(t,n){this._htmlContent+="<div><span>"+this._currentRow+"</span></div>",this._currentRow=""}_getHexColor(t,n){let r=n?t.getFgColor():t.getBgColor();if(n?t.isFgRGB():t.isBgRGB())return"#"+[r>>16&255,r>>8&255,r&255].map(s=>this._padStart(s.toString(16),2,"0")).join("");if(n?t.isFgPalette():t.isBgPalette())return this._ansiColors[r].css}_diffStyle(t,n){let r=[],s=!lT(t,n),l=!Xi(t,n),a=!aT(t,n);if(s||l||a){let u=this._getHexColor(t,!0);u&&r.push("color: "+u+";");let h=this._getHexColor(t,!1);return h&&r.push("background-color: "+h+";"),t.isInverse()&&r.push("color: #000000; background-color: #BFBFBF;"),t.isBold()&&r.push("font-weight: bold;"),t.isUnderline()&&t.isOverline()?r.push("text-decoration: overline underline;"):t.isUnderline()?r.push("text-decoration: underline;"):t.isOverline()&&r.push("text-decoration: overline;"),t.isBlink()&&r.push("text-decoration: blink;"),t.isInvisible()&&r.push("visibility: hidden;"),t.isItalic()&&r.push("font-style: italic;"),t.isDim()&&r.push("opacity: 0.5;"),t.isStrikethrough()&&r.push("text-decoration: line-through;"),r}}_nextCell(t,n,r,s){if(t.getWidth()===0)return;let l=t.getChars()==="",a=this._diffStyle(t,n);a&&(this._currentRow+=a.length===0?"</span><span>":"</span><span style='"+a.join(" ")+"'>"),l?this._currentRow+=" ":this._currentRow+=h7(t.getChars())}_serializeString(){return this._htmlContent}};/**
|
|
422
|
-
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
423
|
-
* @license MIT
|
|
424
|
-
*
|
|
425
|
-
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
426
|
-
* @license MIT
|
|
427
|
-
*
|
|
428
|
-
* Originally forked from (with the author's permission):
|
|
429
|
-
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
430
|
-
* http://bellard.org/jslinux/
|
|
431
|
-
* Copyright (c) 2011 Fabrice Bellard
|
|
432
|
-
*/var cT=Object.defineProperty,m7=Object.getOwnPropertyDescriptor,g7=(e,t)=>{for(var n in t)cT(e,n,{get:t[n],enumerable:!0})},Mt=(e,t,n,r)=>{for(var s=r>1?void 0:r?m7(t,n):t,l=e.length-1,a;l>=0;l--)(a=e[l])&&(s=(r?a(t,n,s):a(s))||s);return r&&s&&cT(t,n,s),s},_e=(e,t)=>(n,r)=>t(n,r,e),lC="Terminal input",Fv={get:()=>lC,set:e=>lC=e},aC="Too much output to announce, navigate to rows manually to read",Uv={get:()=>aC,set:e=>aC=e};function v7(e){return e.replace(/\r?\n/g,"\r")}function _7(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function y7(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function b7(e,t,n,r){if(e.stopPropagation(),e.clipboardData){let s=e.clipboardData.getData("text/plain");uT(s,t,n,r)}}function uT(e,t,n,r){e=v7(e),e=_7(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=""}function hT(e,t,n){let r=n.getBoundingClientRect(),s=e.clientX-r.left-10,l=e.clientY-r.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${s}px`,t.style.top=`${l}px`,t.style.zIndex="1000",t.focus()}function cC(e,t,n,r,s){hT(e,t,n),s&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function Fs(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function jf(e,t=0,n=e.length){let r="";for(let s=t;s<n;++s){let l=e[s];l>65535?(l-=65536,r+=String.fromCharCode((l>>10)+55296)+String.fromCharCode(l%1024+56320)):r+=String.fromCharCode(l)}return r}var x7=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,s=0;if(this._interim){let l=e.charCodeAt(s++);56320<=l&&l<=57343?t[r++]=(this._interim-55296)*1024+l-56320+65536:(t[r++]=this._interim,t[r++]=l),this._interim=0}for(let l=s;l<n;++l){let a=e.charCodeAt(l);if(55296<=a&&a<=56319){if(++l>=n)return this._interim=a,r;let u=e.charCodeAt(l);56320<=u&&u<=57343?t[r++]=(a-55296)*1024+u-56320+65536:(t[r++]=a,t[r++]=u);continue}a!==65279&&(t[r++]=a)}return r}},S7=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,s,l,a,u,h=0,d=0;if(this.interim[0]){let _=!1,b=this.interim[0];b&=(b&224)===192?31:(b&240)===224?15:7;let S=0,w;for(;(w=this.interim[++S]&63)&&S<4;)b<<=6,b|=w;let C=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,k=C-S;for(;d<k;){if(d>=n)return 0;if(w=e[d++],(w&192)!==128){d--,_=!0;break}else this.interim[S++]=w,b<<=6,b|=w&63}_||(C===2?b<128?d--:t[r++]=b:C===3?b<2048||b>=55296&&b<=57343||b===65279||(t[r++]=b):b<65536||b>1114111||(t[r++]=b)),this.interim.fill(0)}let m=n-4,p=d;for(;p<n;){for(;p<m&&!((s=e[p])&128)&&!((l=e[p+1])&128)&&!((a=e[p+2])&128)&&!((u=e[p+3])&128);)t[r++]=s,t[r++]=l,t[r++]=a,t[r++]=u,p+=4;if(s=e[p++],s<128)t[r++]=s;else if((s&224)===192){if(p>=n)return this.interim[0]=s,r;if(l=e[p++],(l&192)!==128){p--;continue}if(h=(s&31)<<6|l&63,h<128){p--;continue}t[r++]=h}else if((s&240)===224){if(p>=n)return this.interim[0]=s,r;if(l=e[p++],(l&192)!==128){p--;continue}if(p>=n)return this.interim[0]=s,this.interim[1]=l,r;if(a=e[p++],(a&192)!==128){p--;continue}if(h=(s&15)<<12|(l&63)<<6|a&63,h<2048||h>=55296&&h<=57343||h===65279)continue;t[r++]=h}else if((s&248)===240){if(p>=n)return this.interim[0]=s,r;if(l=e[p++],(l&192)!==128){p--;continue}if(p>=n)return this.interim[0]=s,this.interim[1]=l,r;if(a=e[p++],(a&192)!==128){p--;continue}if(p>=n)return this.interim[0]=s,this.interim[1]=l,this.interim[2]=a,r;if(u=e[p++],(u&192)!==128){p--;continue}if(h=(s&7)<<18|(l&63)<<12|(a&63)<<6|u&63,h<65536||h>1114111)continue;t[r++]=h}}return r}},dT="",Ws=" ",Eu=class fT{constructor(){this.fg=0,this.bg=0,this.extended=new ef}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new fT;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},ef=class pT{constructor(t=0,n=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=n}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new pT(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},jr=class mT extends Eu{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new ef,this.combinedData=""}static fromCharData(t){let n=new mT;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Fs(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let n=!1;if(t[1].length>2)n=!0;else if(t[1].length===2){let r=t[1].charCodeAt(0);if(55296<=r&&r<=56319){let s=t[1].charCodeAt(1);56320<=s&&s<=57343?this.content=(r-55296)*1024+s-56320+65536|t[2]<<22:n=!0}else n=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;n&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},uC="di$target",$v="di$dependencies",Lg=new Map;function w7(e){return e[$v]||[]}function hn(e){if(Lg.has(e))return Lg.get(e);let t=function(n,r,s){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");C7(t,n,s)};return t._id=e,Lg.set(e,t),t}function C7(e,t,n){t[uC]===t?t[$v].push({id:e,index:n}):(t[$v]=[{id:e,index:n}],t[uC]=t)}var Pn=hn("BufferService"),gT=hn("CoreMouseService"),Ko=hn("CoreService"),k7=hn("CharsetService"),Zy=hn("InstantiationService"),vT=hn("LogService"),In=hn("OptionsService"),_T=hn("OscLinkService"),E7=hn("UnicodeService"),Ru=hn("DecorationService"),Wv=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){var m;let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],s=this._optionsService.rawOptions.linkHandler,l=new jr,a=n.getTrimmedLength(),u=-1,h=-1,d=!1;for(let p=0;p<a;p++)if(!(h===-1&&!n.hasContent(p))){if(n.loadCell(p,l),l.hasExtendedAttrs()&&l.extended.urlId)if(h===-1){h=p,u=l.extended.urlId;continue}else d=l.extended.urlId!==u;else h!==-1&&(d=!0);if(d||h!==-1&&p===a-1){let _=(m=this._oscLinkService.getLinkData(u))==null?void 0:m.uri;if(_){let b={start:{x:h+1,y:e},end:{x:p+(!d&&p===a-1?1:0),y:e}},S=!1;if(!(s!=null&&s.allowNonHttpProtocols))try{let w=new URL(_);["http:","https:"].includes(w.protocol)||(S=!0)}catch{S=!0}S||r.push({text:_,range:b,activate:(w,C)=>s?s.activate(w,C,b):R7(w,C),hover:(w,C)=>{var k;return(k=s==null?void 0:s.hover)==null?void 0:k.call(s,w,C,b)},leave:(w,C)=>{var k;return(k=s==null?void 0:s.leave)==null?void 0:k.call(s,w,C,b)}})}d=!1,l.hasExtendedAttrs()&&l.extended.urlId?(h=p,u=l.extended.urlId):(h=-1,u=-1)}}t(r)}};Wv=Mt([_e(0,Pn),_e(1,In),_e(2,_T)],Wv);function R7(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
433
|
-
|
|
434
|
-
WARNING: This link could potentially be dangerous`)){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var Pf=hn("CharSizeService"),is=hn("CoreBrowserService"),Qy=hn("MouseService"),ss=hn("RenderService"),M7=hn("SelectionService"),yT=hn("CharacterJoinerService"),va=hn("ThemeService"),bT=hn("LinkProviderService"),T7=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?hC.isErrorNoTelemetry(e)?new hC(e.message+`
|
|
435
|
-
|
|
436
|
-
`+e.stack):new Error(e.message+`
|
|
437
|
-
|
|
438
|
-
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},A7=new T7;function Dd(e){D7(e)||A7.onUnexpectedError(e)}var qv="Canceled";function D7(e){return e instanceof N7?!0:e instanceof Error&&e.name===qv&&e.message===qv}var N7=class extends Error{constructor(){super(qv),this.name=this.message}};function O7(e){return new Error(`Illegal argument: ${e}`)}var hC=class Vv extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof Vv)return t;let n=new Vv;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},Kv=class xT extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,xT.prototype)}};function hr(e,t=0){return e[e.length-(1+t)]}var L7;(e=>{function t(l){return l<0}e.isLessThan=t;function n(l){return l<=0}e.isLessThanOrEqual=n;function r(l){return l>0}e.isGreaterThan=r;function s(l){return l===0}e.isNeitherLessOrGreaterThan=s,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(L7||(L7={}));function z7(e,t){let n=this,r=!1,s;return function(){return r||(r=!0,t||(s=e.apply(n,arguments))),s}}var ST;(e=>{function t(D){return D&&typeof D=="object"&&typeof D[Symbol.iterator]=="function"}e.is=t;let n=Object.freeze([]);function r(){return n}e.empty=r;function*s(D){yield D}e.single=s;function l(D){return t(D)?D:s(D)}e.wrap=l;function a(D){return D||n}e.from=a;function*u(D){for(let z=D.length-1;z>=0;z--)yield D[z]}e.reverse=u;function h(D){return!D||D[Symbol.iterator]().next().done===!0}e.isEmpty=h;function d(D){return D[Symbol.iterator]().next().value}e.first=d;function m(D,z){let L=0;for(let O of D)if(z(O,L++))return!0;return!1}e.some=m;function p(D,z){for(let L of D)if(z(L))return L}e.find=p;function*_(D,z){for(let L of D)z(L)&&(yield L)}e.filter=_;function*b(D,z){let L=0;for(let O of D)yield z(O,L++)}e.map=b;function*S(D,z){let L=0;for(let O of D)yield*z(O,L++)}e.flatMap=S;function*w(...D){for(let z of D)yield*z}e.concat=w;function C(D,z,L){let O=L;for(let B of D)O=z(O,B);return O}e.reduce=C;function*k(D,z,L=D.length){for(z<0&&(z+=D.length),L<0?L+=D.length:L>D.length&&(L=D.length);z<L;z++)yield D[z]}e.slice=k;function T(D,z=Number.POSITIVE_INFINITY){let L=[];if(z===0)return[L,D];let O=D[Symbol.iterator]();for(let B=0;B<z;B++){let X=O.next();if(X.done)return[L,e.empty()];L.push(X.value)}return[L,{[Symbol.iterator](){return O}}]}e.consume=T;async function R(D){let z=[];for await(let L of D)z.push(L);return Promise.resolve(z)}e.asyncToArray=R})(ST||(ST={}));function Io(e){if(ST.is(e)){let t=[];for(let n of e)if(n)try{n.dispose()}catch(r){t.push(r)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function B7(...e){return yt(()=>Io(e))}function yt(e){return{dispose:z7(()=>{e()})}}var wT=class CT{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Io(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?CT.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};wT.DISABLE_DISPOSED_WARNING=!1;var Vs=wT,Fe=class{constructor(){this._store=new Vs,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};Fe.None=Object.freeze({dispose(){}});var la=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)==null||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)==null||e.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},Zi=typeof window=="object"?window:globalThis,Gv=class Yv{constructor(t){this.element=t,this.next=Yv.Undefined,this.prev=Yv.Undefined}};Gv.Undefined=new Gv(void 0);var xt=Gv,dC=class{constructor(){this._first=xt.Undefined,this._last=xt.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===xt.Undefined}clear(){let e=this._first;for(;e!==xt.Undefined;){let t=e.next;e.prev=xt.Undefined,e.next=xt.Undefined,e=t}this._first=xt.Undefined,this._last=xt.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new xt(e);if(this._first===xt.Undefined)this._first=n,this._last=n;else if(t){let s=this._last;this._last=n,n.prev=s,s.next=n}else{let s=this._first;this._first=n,n.next=s,s.prev=n}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(n))}}shift(){if(this._first!==xt.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==xt.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==xt.Undefined&&e.next!==xt.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===xt.Undefined&&e.next===xt.Undefined?(this._first=xt.Undefined,this._last=xt.Undefined):e.next===xt.Undefined?(this._last=this._last.prev,this._last.next=xt.Undefined):e.prev===xt.Undefined&&(this._first=this._first.next,this._first.prev=xt.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==xt.Undefined;)yield e.element,e=e.next}},j7=globalThis.performance&&typeof globalThis.performance.now=="function",P7=class kT{static create(t){return new kT(t)}constructor(t){this._now=j7&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},Cn;(e=>{e.None=()=>Fe.None;function t(H,U){return p(H,()=>{},0,void 0,!0,void 0,U)}e.defer=t;function n(H){return(U,V=null,F)=>{let j=!1,K;return K=H($=>{if(!j)return K?K.dispose():j=!0,U.call(V,$)},null,F),j&&K.dispose(),K}}e.once=n;function r(H,U,V){return d((F,j=null,K)=>H($=>F.call(j,U($)),null,K),V)}e.map=r;function s(H,U,V){return d((F,j=null,K)=>H($=>{U($),F.call(j,$)},null,K),V)}e.forEach=s;function l(H,U,V){return d((F,j=null,K)=>H($=>U($)&&F.call(j,$),null,K),V)}e.filter=l;function a(H){return H}e.signal=a;function u(...H){return(U,V=null,F)=>{let j=B7(...H.map(K=>K($=>U.call(V,$))));return m(j,F)}}e.any=u;function h(H,U,V,F){let j=V;return r(H,K=>(j=U(j,K),j),F)}e.reduce=h;function d(H,U){let V,F={onWillAddFirstListener(){V=H(j.fire,j)},onDidRemoveLastListener(){V==null||V.dispose()}},j=new ge(F);return U==null||U.add(j),j.event}function m(H,U){return U instanceof Array?U.push(H):U&&U.add(H),H}function p(H,U,V=100,F=!1,j=!1,K,$){let J,A,I,Y=0,M,Z={leakWarningThreshold:K,onWillAddFirstListener(){J=H(se=>{Y++,A=U(A,se),F&&!I&&(ae.fire(A),A=void 0),M=()=>{let pe=A;A=void 0,I=void 0,(!F||Y>1)&&ae.fire(pe),Y=0},typeof V=="number"?(clearTimeout(I),I=setTimeout(M,V)):I===void 0&&(I=0,queueMicrotask(M))})},onWillRemoveListener(){j&&Y>0&&(M==null||M())},onDidRemoveLastListener(){M=void 0,J.dispose()}},ae=new ge(Z);return $==null||$.add(ae),ae.event}e.debounce=p;function _(H,U=0,V){return e.debounce(H,(F,j)=>F?(F.push(j),F):[j],U,void 0,!0,void 0,V)}e.accumulate=_;function b(H,U=(F,j)=>F===j,V){let F=!0,j;return l(H,K=>{let $=F||!U(K,j);return F=!1,j=K,$},V)}e.latch=b;function S(H,U,V){return[e.filter(H,U,V),e.filter(H,F=>!U(F),V)]}e.split=S;function w(H,U=!1,V=[],F){let j=V.slice(),K=H(A=>{j?j.push(A):J.fire(A)});F&&F.add(K);let $=()=>{j==null||j.forEach(A=>J.fire(A)),j=null},J=new ge({onWillAddFirstListener(){K||(K=H(A=>J.fire(A)),F&&F.add(K))},onDidAddFirstListener(){j&&(U?setTimeout($):$())},onDidRemoveLastListener(){K&&K.dispose(),K=null}});return F&&F.add(J),J.event}e.buffer=w;function C(H,U){return(V,F,j)=>{let K=U(new T);return H(function($){let J=K.evaluate($);J!==k&&V.call(F,J)},void 0,j)}}e.chain=C;let k=Symbol("HaltChainable");class T{constructor(){this.steps=[]}map(U){return this.steps.push(U),this}forEach(U){return this.steps.push(V=>(U(V),V)),this}filter(U){return this.steps.push(V=>U(V)?V:k),this}reduce(U,V){let F=V;return this.steps.push(j=>(F=U(F,j),F)),this}latch(U=(V,F)=>V===F){let V=!0,F;return this.steps.push(j=>{let K=V||!U(j,F);return V=!1,F=j,K?j:k}),this}evaluate(U){for(let V of this.steps)if(U=V(U),U===k)break;return U}}function R(H,U,V=F=>F){let F=(...J)=>$.fire(V(...J)),j=()=>H.on(U,F),K=()=>H.removeListener(U,F),$=new ge({onWillAddFirstListener:j,onDidRemoveLastListener:K});return $.event}e.fromNodeEventEmitter=R;function D(H,U,V=F=>F){let F=(...J)=>$.fire(V(...J)),j=()=>H.addEventListener(U,F),K=()=>H.removeEventListener(U,F),$=new ge({onWillAddFirstListener:j,onDidRemoveLastListener:K});return $.event}e.fromDOMEventEmitter=D;function z(H){return new Promise(U=>n(H)(U))}e.toPromise=z;function L(H){let U=new ge;return H.then(V=>{U.fire(V)},()=>{U.fire(void 0)}).finally(()=>{U.dispose()}),U.event}e.fromPromise=L;function O(H,U){return H(V=>U.fire(V))}e.forward=O;function B(H,U,V){return U(V),H(F=>U(F))}e.runAndSubscribe=B;class X{constructor(U,V){this._observable=U,this._counter=0,this._hasChanged=!1;let F={onWillAddFirstListener:()=>{U.addObserver(this)},onDidRemoveLastListener:()=>{U.removeObserver(this)}};this.emitter=new ge(F),V&&V.add(this.emitter)}beginUpdate(U){this._counter++}handlePossibleChange(U){}handleChange(U,V){this._hasChanged=!0}endUpdate(U){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function P(H,U){return new X(H,U).emitter.event}e.fromObservable=P;function q(H){return(U,V,F)=>{let j=0,K=!1,$={beginUpdate(){j++},endUpdate(){j--,j===0&&(H.reportChanges(),K&&(K=!1,U.call(V)))},handlePossibleChange(){},handleChange(){K=!0}};H.addObserver($),H.reportChanges();let J={dispose(){H.removeObserver($)}};return F instanceof Vs?F.add(J):Array.isArray(F)&&F.push(J),J}}e.fromObservableLight=q})(Cn||(Cn={}));var Xv=class Zv{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${Zv._idPool++}`,Zv.all.add(this)}start(t){this._stopWatch=new P7,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};Xv.all=new Set,Xv._idPool=0;var I7=Xv,H7=-1,ET=class RT{constructor(t,n,r=(RT._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=n,this.name=r,this._warnCountdown=0}dispose(){var t;(t=this._stacks)==null||t.clear()}check(t,n){let r=this.threshold;if(r<=0||n<r)return;this._stacks||(this._stacks=new Map);let s=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,s+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=r*.5;let[l,a]=this.getMostFrequentStack(),u=`[${this.name}] potential listener LEAK detected, having ${n} listeners already. MOST frequent listener (${a}):`;console.warn(u),console.warn(l);let h=new $7(u,l);this._errorHandler(h)}return()=>{let l=this._stacks.get(t.value)||0;this._stacks.set(t.value,l-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,n=0;for(let[r,s]of this._stacks)(!t||n<s)&&(t=[r,s],n=s);return t}};ET._idPool=1;var F7=ET,U7=class MT{constructor(t){this.value=t}static create(){let t=new Error;return new MT(t.stack??"")}print(){console.warn(this.value.split(`
|
|
439
|
-
`).slice(2).join(`
|
|
440
|
-
`))}},$7=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},W7=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},q7=0,zg=class{constructor(e){this.value=e,this.id=q7++}},V7=2,K7,ge=class{constructor(e){var t,n,r,s;this._size=0,this._options=e,this._leakageMon=(t=this._options)!=null&&t.leakWarningThreshold?new F7((e==null?void 0:e.onListenerError)??Dd,((n=this._options)==null?void 0:n.leakWarningThreshold)??H7):void 0,this._perfMon=(r=this._options)!=null&&r._profName?new I7(this._options._profName):void 0,this._deliveryQueue=(s=this._options)==null?void 0:s.deliveryQueue}dispose(){var e,t,n,r;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)==null?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(n=(t=this._options)==null?void 0:t.onDidRemoveLastListener)==null||n.call(t),(r=this._leakageMon)==null||r.dispose())}get event(){return this._event??(this._event=(e,t,n)=>{var a,u,h,d,m;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let p=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(p);let _=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],b=new W7(`${p}. HINT: Stack shows most frequent listener (${_[1]}-times)`,_[0]);return(((a=this._options)==null?void 0:a.onListenerError)||Dd)(b),Fe.None}if(this._disposed)return Fe.None;t&&(e=e.bind(t));let r=new zg(e),s;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=U7.create(),s=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof zg?(this._deliveryQueue??(this._deliveryQueue=new G7),this._listeners=[this._listeners,r]):this._listeners.push(r):((h=(u=this._options)==null?void 0:u.onWillAddFirstListener)==null||h.call(u,this),this._listeners=r,(m=(d=this._options)==null?void 0:d.onDidAddFirstListener)==null||m.call(d,this)),this._size++;let l=yt(()=>{s==null||s(),this._removeListener(r)});return n instanceof Vs?n.add(l):Array.isArray(n)&&n.push(l),l}),this._event}_removeListener(e){var s,l,a,u;if((l=(s=this._options)==null?void 0:s.onWillRemoveListener)==null||l.call(s,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(u=(a=this._options)==null?void 0:a.onDidRemoveLastListener)==null||u.call(a,this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);if(n===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[n]=void 0;let r=this._deliveryQueue.current===this;if(this._size*V7<=t.length){let h=0;for(let d=0;d<t.length;d++)t[d]?t[h++]=t[d]:r&&(this._deliveryQueue.end--,h<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=h}}_deliver(e,t){var r;if(!e)return;let n=((r=this._options)==null?void 0:r.onListenerError)||Dd;if(!n){e.value(t);return}try{e.value(t)}catch(s){n(s)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){var t,n,r,s;if((t=this._deliveryQueue)!=null&&t.current&&(this._deliverQueue(this._deliveryQueue),(n=this._perfMon)==null||n.stop()),(r=this._perfMon)==null||r.start(this._size),this._listeners)if(this._listeners instanceof zg)this._deliver(this._listeners,e);else{let l=this._deliveryQueue;l.enqueue(this,e,this._listeners.length),this._deliverQueue(l)}(s=this._perfMon)==null||s.stop()}hasListeners(){return this._size>0}},G7=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Qv=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new ge,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new ge,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,n){if(this.getZoomLevel(n)===t)return;let r=this.getWindowId(n);this.mapWindowIdToZoomLevel.set(r,t),this._onDidChangeZoomLevel.fire(r)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,n){this.mapWindowIdToZoomFactor.set(this.getWindowId(n),t)}setFullscreen(t,n){if(this.isFullscreen(n)===t)return;let r=this.getWindowId(n);this.mapWindowIdToFullScreen.set(r,t),this._onDidChangeFullscreen.fire(r)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};Qv.INSTANCE=new Qv;var Jy=Qv;function Y7(e,t,n){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",n)}Jy.INSTANCE.onDidChangeZoomLevel;function X7(e){return Jy.INSTANCE.getZoomFactor(e)}Jy.INSTANCE.onDidChangeFullscreen;var _a=typeof navigator=="object"?navigator.userAgent:"",Jv=_a.indexOf("Firefox")>=0,Z7=_a.indexOf("AppleWebKit")>=0,eb=_a.indexOf("Chrome")>=0,Q7=!eb&&_a.indexOf("Safari")>=0;_a.indexOf("Electron/")>=0;_a.indexOf("Android")>=0;var Bg=!1;if(typeof Zi.matchMedia=="function"){let e=Zi.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=Zi.matchMedia("(display-mode: fullscreen)");Bg=e.matches,Y7(Zi,e,({matches:n})=>{Bg&&t.matches||(Bg=n)})}var ql="en",e_=!1,t_=!1,Nd=!1,TT=!1,ld,Od=ql,fC=ql,J7,Yr,No=globalThis,wn,nk;typeof No.vscode<"u"&&typeof No.vscode.process<"u"?wn=No.vscode.process:typeof process<"u"&&typeof((nk=process==null?void 0:process.versions)==null?void 0:nk.node)=="string"&&(wn=process);var rk,eH=typeof((rk=wn==null?void 0:wn.versions)==null?void 0:rk.electron)=="string",tH=eH&&(wn==null?void 0:wn.type)==="renderer",ik;if(typeof wn=="object"){e_=wn.platform==="win32",t_=wn.platform==="darwin",Nd=wn.platform==="linux",Nd&&wn.env.SNAP&&wn.env.SNAP_REVISION,wn.env.CI||wn.env.BUILD_ARTIFACTSTAGINGDIRECTORY,ld=ql,Od=ql;let e=wn.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);ld=t.userLocale,fC=t.osLocale,Od=t.resolvedLanguage||ql,J7=(ik=t.languagePack)==null?void 0:ik.translationsConfigFile}catch{}TT=!0}else typeof navigator=="object"&&!tH?(Yr=navigator.userAgent,e_=Yr.indexOf("Windows")>=0,t_=Yr.indexOf("Macintosh")>=0,(Yr.indexOf("Macintosh")>=0||Yr.indexOf("iPad")>=0||Yr.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Nd=Yr.indexOf("Linux")>=0,(Yr==null?void 0:Yr.indexOf("Mobi"))>=0,Od=globalThis._VSCODE_NLS_LANGUAGE||ql,ld=navigator.language.toLowerCase(),fC=ld):console.error("Unable to resolve platform.");var AT=e_,yi=t_,nH=Nd,pC=TT,wi=Yr,zs=Od,rH;(e=>{function t(){return zs}e.value=t;function n(){return zs.length===2?zs==="en":zs.length>=3?zs[0]==="e"&&zs[1]==="n"&&zs[2]==="-":!1}e.isDefaultVariant=n;function r(){return zs==="en"}e.isDefault=r})(rH||(rH={}));var iH=typeof No.postMessage=="function"&&!No.importScripts;(()=>{if(iH){let e=[];No.addEventListener("message",n=>{if(n.data&&n.data.vscodeScheduleAsyncWork)for(let r=0,s=e.length;r<s;r++){let l=e[r];if(l.id===n.data.vscodeScheduleAsyncWork){e.splice(r,1),l.callback();return}}});let t=0;return n=>{let r=++t;e.push({id:r,callback:n}),No.postMessage({vscodeScheduleAsyncWork:r},"*")}}return e=>setTimeout(e)})();var sH=!!(wi&&wi.indexOf("Chrome")>=0);wi&&wi.indexOf("Firefox")>=0;!sH&&wi&&wi.indexOf("Safari")>=0;wi&&wi.indexOf("Edg/")>=0;wi&&wi.indexOf("Android")>=0;var Il=typeof navigator=="object"?navigator:{};pC||document.queryCommandSupported&&document.queryCommandSupported("copy")||Il&&Il.clipboard&&Il.clipboard.writeText,pC||Il&&Il.clipboard&&Il.clipboard.readText;var tb=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},jg=new tb,mC=new tb,gC=new tb,oH=new Array(230),DT;(e=>{function t(u){return jg.keyCodeToStr(u)}e.toString=t;function n(u){return jg.strToKeyCode(u)}e.fromString=n;function r(u){return mC.keyCodeToStr(u)}e.toUserSettingsUS=r;function s(u){return gC.keyCodeToStr(u)}e.toUserSettingsGeneral=s;function l(u){return mC.strToKeyCode(u)||gC.strToKeyCode(u)}e.fromUserSettings=l;function a(u){if(u>=98&&u<=113)return null;switch(u){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return jg.keyCodeToStr(u)}e.toElectronAccelerator=a})(DT||(DT={}));var lH=class NT{constructor(t,n,r,s,l){this.ctrlKey=t,this.shiftKey=n,this.altKey=r,this.metaKey=s,this.keyCode=l}equals(t){return t instanceof NT&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",n=this.shiftKey?"1":"0",r=this.altKey?"1":"0",s=this.metaKey?"1":"0";return`K${t}${n}${r}${s}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new aH([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},aH=class{constructor(e){if(e.length===0)throw O7("chords");this.chords=e}getHashCode(){let e="";for(let t=0,n=this.chords.length;t<n;t++)t!==0&&(e+=";"),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};function cH(e){if(e.charCode){let n=String.fromCharCode(e.charCode).toUpperCase();return DT.fromString(n)}let t=e.keyCode;if(t===3)return 7;if(Jv)switch(t){case 59:return 85;case 60:if(nH)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(yi)return 57;break}else if(Z7&&(yi&&t===93||!yi&&t===92))return 57;return oH[t]||0}var uH=yi?256:2048,hH=512,dH=1024,fH=yi?2048:256,vC=class{constructor(e){var n;this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=(n=t.getModifierState)==null?void 0:n.call(t,"AltGraph"),this.keyCode=cH(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=uH),this.altKey&&(t|=hH),this.shiftKey&&(t|=dH),this.metaKey&&(t|=fH),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new lH(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},_C=new WeakMap;function pH(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,n=e.parent.location;if(t.origin!=="null"&&n.origin!=="null"&&t.origin!==n.origin)return null}catch{return null}return e.parent}var mH=class{static getSameOriginWindowChain(e){let t=_C.get(e);if(!t){t=[],_C.set(e,t);let n=e,r;do r=pH(n),r?t.push({window:new WeakRef(n),iframeElement:n.frameElement||null}):t.push({window:new WeakRef(n),iframeElement:null}),n=r;while(n)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let n=0,r=0,s=this.getSameOriginWindowChain(e);for(let l of s){let a=l.window.deref();if(n+=(a==null?void 0:a.scrollY)??0,r+=(a==null?void 0:a.scrollX)??0,a===t||!l.iframeElement)break;let u=l.iframeElement.getBoundingClientRect();n+=u.top,r+=u.left}return{top:n,left:r}}},ad=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type==="dblclick"&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX=="number"?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let n=mH.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},yC=class{constructor(e,t=0,n=0){var s;this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=t;let r=!1;if(eb){let l=navigator.userAgent.match(/Chrome\/(\d+)/);r=(l?parseInt(l[1]):123)<=122}if(e){let l=e,a=e,u=((s=e.view)==null?void 0:s.devicePixelRatio)||1;if(typeof l.wheelDeltaY<"u")r?this.deltaY=l.wheelDeltaY/(120*u):this.deltaY=l.wheelDeltaY/120;else if(typeof a.VERTICAL_AXIS<"u"&&a.axis===a.VERTICAL_AXIS)this.deltaY=-a.detail/3;else if(e.type==="wheel"){let h=e;h.deltaMode===h.DOM_DELTA_LINE?Jv&&!yi?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof l.wheelDeltaX<"u")Q7&&AT?this.deltaX=-(l.wheelDeltaX/120):r?this.deltaX=l.wheelDeltaX/(120*u):this.deltaX=l.wheelDeltaX/120;else if(typeof a.HORIZONTAL_AXIS<"u"&&a.axis===a.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let h=e;h.deltaMode===h.DOM_DELTA_LINE?Jv&&!yi?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(r?this.deltaY=e.wheelDelta/(120*u):this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)==null||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)==null||e.stopPropagation()}},OT=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}),gH;(e=>{function t(n){return n===e.None||n===e.Cancelled||n instanceof vH?!0:!n||typeof n!="object"?!1:typeof n.isCancellationRequested=="boolean"&&typeof n.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Cn.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:OT})})(gH||(gH={}));var vH=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?OT:(this._emitter||(this._emitter=new ge),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},nb=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new Kv("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new Kv("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},_H=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){var e;(e=this.disposable)==null||e.dispose(),this.disposable=void 0}cancelAndSet(e,t,n=globalThis){if(this.isDisposed)throw new Kv("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let r=n.setInterval(()=>{e()},t);this.disposable=yt(()=>{n.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},yH;(e=>{async function t(r){let s,l=await Promise.all(r.map(a=>a.then(u=>u,u=>{s||(s=u)})));if(typeof s<"u")throw s;return l}e.settled=t;function n(r){return new Promise(async(s,l)=>{try{await r(s,l)}catch(a){l(a)}})}e.withAsyncBody=n})(yH||(yH={}));var bC=class Nr{static fromArray(t){return new Nr(n=>{n.emitMany(t)})}static fromPromise(t){return new Nr(async n=>{n.emitMany(await t)})}static fromPromises(t){return new Nr(async n=>{await Promise.all(t.map(async r=>n.emitOne(await r)))})}static merge(t){return new Nr(async n=>{await Promise.all(t.map(async r=>{for await(let s of r)n.emitOne(s)}))})}constructor(t,n){this._state=0,this._results=[],this._error=null,this._onReturn=n,this._onStateChanged=new ge,queueMicrotask(async()=>{let r={emitOne:s=>this.emitOne(s),emitMany:s=>this.emitMany(s),reject:s=>this.reject(s)};try{await Promise.resolve(t(r)),this.resolve()}catch(s){this.reject(s)}finally{r.emitOne=void 0,r.emitMany=void 0,r.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await Cn.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>{var n;return(n=this._onReturn)==null||n.call(this),{done:!0,value:void 0}}}}static map(t,n){return new Nr(async r=>{for await(let s of t)r.emitOne(n(s))})}map(t){return Nr.map(this,t)}static filter(t,n){return new Nr(async r=>{for await(let s of t)n(s)&&r.emitOne(s)})}filter(t){return Nr.filter(this,t)}static coalesce(t){return Nr.filter(t,n=>!!n)}coalesce(){return Nr.coalesce(this)}static async toPromise(t){let n=[];for await(let r of t)n.push(r);return n}toPromise(){return Nr.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};bC.EMPTY=bC.fromArray([]);var{getWindow:gi,getWindowId:bH,onDidRegisterWindow:xH}=(function(){let e=new Map,t={window:Zi,disposables:new Vs};e.set(Zi.vscodeWindowId,t);let n=new ge,r=new ge,s=new ge;function l(a,u){return(typeof a=="number"?e.get(a):void 0)??(u?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:s.event,onDidUnregisterWindow:r.event,registerWindow(a){if(e.has(a.vscodeWindowId))return Fe.None;let u=new Vs,h={window:a,disposables:u.add(new Vs)};return e.set(a.vscodeWindowId,h),u.add(yt(()=>{e.delete(a.vscodeWindowId),r.fire(a)})),u.add(Oe(a,nn.BEFORE_UNLOAD,()=>{s.fire(a)})),n.fire(h),u},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(a){return a.vscodeWindowId},hasWindow(a){return e.has(a)},getWindowById:l,getWindow(a){var d;let u=a;if((d=u==null?void 0:u.ownerDocument)!=null&&d.defaultView)return u.ownerDocument.defaultView.window;let h=a;return h!=null&&h.view?h.view.window:Zi},getDocument(a){return gi(a).document}}})(),SH=class{constructor(e,t,n,r){this._node=e,this._type=t,this._handler=n,this._options=r||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function Oe(e,t,n,r){return new SH(e,t,n,r)}var xC=function(e,t,n,r){return Oe(e,t,n,r)},rb,wH=class extends _H{constructor(e){super(),this.defaultTarget=e&&gi(e)}cancelAndSet(e,t,n){return super.cancelAndSet(e,t,n??this.defaultTarget)}},SC=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){Dd(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,n=new Map,r=new Map,s=l=>{n.set(l,!1);let a=e.get(l)??[];for(t.set(l,a),e.set(l,[]),r.set(l,!0);a.length>0;)a.sort(SC.sort),a.shift().execute();r.set(l,!1)};rb=(l,a,u=0)=>{let h=bH(l),d=new SC(a,u),m=e.get(h);return m||(m=[],e.set(h,m)),m.push(d),n.get(h)||(n.set(h,!0),l.requestAnimationFrame(()=>s(h))),d}})();function CH(e){let t=e.getBoundingClientRect(),n=gi(e);return{left:t.left+n.scrollX,top:t.top+n.scrollY,width:t.width,height:t.height}}var nn={CLICK:"click",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",CHANGE:"change",FOCUS:"focus",BLUR:"blur",INPUT:"input"},kH=class{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){let t=Zn(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=Zn(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=Zn(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=Zn(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=Zn(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=Zn(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=Zn(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=Zn(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=Zn(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=Zn(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=Zn(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=Zn(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=Zn(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=Zn(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function Zn(e){return typeof e=="number"?`${e}px`:e}function Hc(e){return new kH(e)}var LT=class{constructor(){this._hooks=new Vs,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,n,r,s){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=s;let l=e;try{e.setPointerCapture(t),this._hooks.add(yt(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{l=gi(e)}this._hooks.add(Oe(l,nn.POINTER_MOVE,a=>{if(a.buttons!==n){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(Oe(l,nn.POINTER_UP,a=>this.stopMonitoring(!0)))}};function EH(e,t,n){let r=null,s=null;if(typeof n.value=="function"?(r="value",s=n.value,s.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof n.get=="function"&&(r="get",s=n.get),!s)throw new Error("not supported");let l=`$memoize$${t}`;n[r]=function(...a){return this.hasOwnProperty(l)||Object.defineProperty(this,l,{configurable:!1,enumerable:!1,writable:!1,value:s.apply(this,a)}),this[l]}}var ui;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(ui||(ui={}));var Ac=class Rn extends Fe{constructor(){super(),this.dispatched=!1,this.targets=new dC,this.ignoreTargets=new dC,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Cn.runAndSubscribe(xH,({window:t,disposables:n})=>{n.add(Oe(t.document,"touchstart",r=>this.onTouchStart(r),{passive:!1})),n.add(Oe(t.document,"touchend",r=>this.onTouchEnd(t,r))),n.add(Oe(t.document,"touchmove",r=>this.onTouchMove(r),{passive:!1}))},{window:Zi,disposables:this._store}))}static addTarget(t){if(!Rn.isTouchDevice())return Fe.None;Rn.INSTANCE||(Rn.INSTANCE=new Rn);let n=Rn.INSTANCE.targets.push(t);return yt(n)}static ignoreTarget(t){if(!Rn.isTouchDevice())return Fe.None;Rn.INSTANCE||(Rn.INSTANCE=new Rn);let n=Rn.INSTANCE.ignoreTargets.push(t);return yt(n)}static isTouchDevice(){return"ontouchstart"in Zi||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let n=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let r=0,s=t.targetTouches.length;r<s;r++){let l=t.targetTouches.item(r);this.activeTouches[l.identifier]={id:l.identifier,initialTarget:l.target,initialTimeStamp:n,initialPageX:l.pageX,initialPageY:l.pageY,rollingTimestamps:[n],rollingPageX:[l.pageX],rollingPageY:[l.pageY]};let a=this.newGestureEvent(ui.Start,l.target);a.pageX=l.pageX,a.pageY=l.pageY,this.dispatchEvent(a)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,n){let r=Date.now(),s=Object.keys(this.activeTouches).length;for(let l=0,a=n.changedTouches.length;l<a;l++){let u=n.changedTouches.item(l);if(!this.activeTouches.hasOwnProperty(String(u.identifier))){console.warn("move of an UNKNOWN touch",u);continue}let h=this.activeTouches[u.identifier],d=Date.now()-h.initialTimeStamp;if(d<Rn.HOLD_DELAY&&Math.abs(h.initialPageX-hr(h.rollingPageX))<30&&Math.abs(h.initialPageY-hr(h.rollingPageY))<30){let m=this.newGestureEvent(ui.Tap,h.initialTarget);m.pageX=hr(h.rollingPageX),m.pageY=hr(h.rollingPageY),this.dispatchEvent(m)}else if(d>=Rn.HOLD_DELAY&&Math.abs(h.initialPageX-hr(h.rollingPageX))<30&&Math.abs(h.initialPageY-hr(h.rollingPageY))<30){let m=this.newGestureEvent(ui.Contextmenu,h.initialTarget);m.pageX=hr(h.rollingPageX),m.pageY=hr(h.rollingPageY),this.dispatchEvent(m)}else if(s===1){let m=hr(h.rollingPageX),p=hr(h.rollingPageY),_=hr(h.rollingTimestamps)-h.rollingTimestamps[0],b=m-h.rollingPageX[0],S=p-h.rollingPageY[0],w=[...this.targets].filter(C=>h.initialTarget instanceof Node&&C.contains(h.initialTarget));this.inertia(t,w,r,Math.abs(b)/_,b>0?1:-1,m,Math.abs(S)/_,S>0?1:-1,p)}this.dispatchEvent(this.newGestureEvent(ui.End,h.initialTarget)),delete this.activeTouches[u.identifier]}this.dispatched&&(n.preventDefault(),n.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,n){let r=document.createEvent("CustomEvent");return r.initEvent(t,!1,!0),r.initialTarget=n,r.tapCount=0,r}dispatchEvent(t){if(t.type===ui.Tap){let n=new Date().getTime(),r=0;n-this._lastSetTapCountTime>Rn.CLEAR_TAP_COUNT_TIME?r=1:r=2,this._lastSetTapCountTime=n,t.tapCount=r}else(t.type===ui.Change||t.type===ui.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let r of this.ignoreTargets)if(r.contains(t.initialTarget))return;let n=[];for(let r of this.targets)if(r.contains(t.initialTarget)){let s=0,l=t.initialTarget;for(;l&&l!==r;)s++,l=l.parentElement;n.push([s,r])}n.sort((r,s)=>r[0]-s[0]);for(let[r,s]of n)s.dispatchEvent(t),this.dispatched=!0}}inertia(t,n,r,s,l,a,u,h,d){this.handle=rb(t,()=>{let m=Date.now(),p=m-r,_=0,b=0,S=!0;s+=Rn.SCROLL_FRICTION*p,u+=Rn.SCROLL_FRICTION*p,s>0&&(S=!1,_=l*s*p),u>0&&(S=!1,b=h*u*p);let w=this.newGestureEvent(ui.Change);w.translationX=_,w.translationY=b,n.forEach(C=>C.dispatchEvent(w)),S||this.inertia(t,n,m,s,l,a+_,u,h,d+b)})}onTouchMove(t){let n=Date.now();for(let r=0,s=t.changedTouches.length;r<s;r++){let l=t.changedTouches.item(r);if(!this.activeTouches.hasOwnProperty(String(l.identifier))){console.warn("end of an UNKNOWN touch",l);continue}let a=this.activeTouches[l.identifier],u=this.newGestureEvent(ui.Change,a.initialTarget);u.translationX=l.pageX-hr(a.rollingPageX),u.translationY=l.pageY-hr(a.rollingPageY),u.pageX=l.pageX,u.pageY=l.pageY,this.dispatchEvent(u),a.rollingPageX.length>3&&(a.rollingPageX.shift(),a.rollingPageY.shift(),a.rollingTimestamps.shift()),a.rollingPageX.push(l.pageX),a.rollingPageY.push(l.pageY),a.rollingTimestamps.push(n)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};Ac.SCROLL_FRICTION=-.005,Ac.HOLD_DELAY=700,Ac.CLEAR_TAP_COUNT_TIME=400,Mt([EH],Ac,"isTouchDevice",1);var RH=Ac,ib=class extends Fe{onclick(e,t){this._register(Oe(e,nn.CLICK,n=>t(new ad(gi(e),n))))}onmousedown(e,t){this._register(Oe(e,nn.MOUSE_DOWN,n=>t(new ad(gi(e),n))))}onmouseover(e,t){this._register(Oe(e,nn.MOUSE_OVER,n=>t(new ad(gi(e),n))))}onmouseleave(e,t){this._register(Oe(e,nn.MOUSE_LEAVE,n=>t(new ad(gi(e),n))))}onkeydown(e,t){this._register(Oe(e,nn.KEY_DOWN,n=>t(new vC(n))))}onkeyup(e,t){this._register(Oe(e,nn.KEY_UP,n=>t(new vC(n))))}oninput(e,t){this._register(Oe(e,nn.INPUT,t))}onblur(e,t){this._register(Oe(e,nn.BLUR,t))}onfocus(e,t){this._register(Oe(e,nn.FOCUS,t))}onchange(e,t){this._register(Oe(e,nn.CHANGE,t))}ignoreGesture(e){return RH.ignoreTarget(e)}},wC=11,MH=class extends ib{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width=wC+"px",this.domNode.style.height=wC+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new LT),this._register(xC(this.bgDomNode,nn.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(xC(this.domNode,nn.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new wH),this._pointerdownScheduleRepeatTimer=this._register(new nb)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,gi(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,n=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},TH=class n_{constructor(t,n,r,s,l,a,u){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(n=n|0,r=r|0,s=s|0,l=l|0,a=a|0,u=u|0),this.rawScrollLeft=s,this.rawScrollTop=u,n<0&&(n=0),s+n>r&&(s=r-n),s<0&&(s=0),l<0&&(l=0),u+l>a&&(u=a-l),u<0&&(u=0),this.width=n,this.scrollWidth=r,this.scrollLeft=s,this.height=l,this.scrollHeight=a,this.scrollTop=u}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,n){return new n_(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,n?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,n?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new n_(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,n){let r=this.width!==t.width,s=this.scrollWidth!==t.scrollWidth,l=this.scrollLeft!==t.scrollLeft,a=this.height!==t.height,u=this.scrollHeight!==t.scrollHeight,h=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:n,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:r,scrollWidthChanged:s,scrollLeftChanged:l,heightChanged:a,scrollHeightChanged:u,scrollTopChanged:h}}},AH=class extends Fe{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new ge),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new TH(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){var r;let n=this._state.withScrollDimensions(e,t);this._setState(n,!!this._smoothScrolling),(r=this._smoothScrolling)==null||r.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;let r;t?r=new kC(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):r=this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=r}else{let n=this._state.withScrollPosition(e);this._smoothScrolling=kC.start(this._state,n,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let n=this._state;n.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(n,t)))}},CC=class{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}};function Pg(e,t){let n=t-e;return function(r){return e+n*OH(r)}}function DH(e,t,n){return function(r){return r<n?e(r/n):t((r-n)/(1-n))}}var kC=class r_{constructor(t,n,r,s){this.from=t,this.to=n,this.duration=s,this.startTime=r,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(t,n,r){if(Math.abs(t-n)>2.5*r){let s,l;return t<n?(s=t+.75*r,l=n-.75*r):(s=t-.75*r,l=n+.75*r),DH(Pg(t,s),Pg(l,n),.33)}return Pg(t,n)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(t){this.to=t.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(t){let n=(t-this.startTime)/this.duration;if(n<1){let r=this.scrollLeft(n),s=this.scrollTop(n);return new CC(r,s,!1)}return new CC(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,n,r){return r_.start(t,n,r)}static start(t,n,r){r=r+10;let s=Date.now()-10;return new r_(t,n,s,r)}};function NH(e){return Math.pow(e,3)}function OH(e){return 1-NH(1-e)}var LH=class extends Fe{constructor(e,t,n){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new nb)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{var e;(e=this._domNode)==null||e.setClassName(this._visibleClassName)},0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)==null||t.setClassName(this._invisibleClassName+(e?" fade":"")))}},zH=140,zT=class extends ib{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new LH(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new LT),this._shouldRender=!0,this.domNode=Hc(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(Oe(this.domNode.domNode,nn.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new MH(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,n,r){this.slider=Hc(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof n=="number"&&this.slider.setWidth(n),typeof r=="number"&&this.slider.setHeight(r),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Oe(this.slider.domNode,nn.POINTER_DOWN,s=>{s.button===0&&(s.preventDefault(),this._sliderPointerDown(s))})),this.onclick(this.slider.domNode,s=>{s.leftButton&&s.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,n=t+this._scrollbarState.getSliderPosition(),r=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),s=this._sliderPointerPosition(e);n<=s&&s<=r?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,n;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,n=e.offsetY;else{let s=CH(this.domNode.domNode);t=e.pageX-s.left,n=e.pageY-s.top}let r=this._pointerDownRelativePosition(t,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(r):this._scrollbarState.getDesiredScrollPositionFromOffset(r)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),r=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,s=>{let l=this._sliderOrthogonalPointerPosition(s),a=Math.abs(l-n);if(AT&&a>zH){this._setDesiredScrollPositionNow(r.getScrollPosition());return}let u=this._sliderPointerPosition(s)-t;this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(u))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},BT=class i_{constructor(t,n,r,s,l,a){this._scrollbarSize=Math.round(n),this._oppositeScrollbarSize=Math.round(r),this._arrowSize=Math.round(t),this._visibleSize=s,this._scrollSize=l,this._scrollPosition=a,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new i_(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let n=Math.round(t);return this._visibleSize!==n?(this._visibleSize=n,this._refreshComputedValues(),!0):!1}setScrollSize(t){let n=Math.round(t);return this._scrollSize!==n?(this._scrollSize=n,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let n=Math.round(t);return this._scrollPosition!==n?(this._scrollPosition=n,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,n,r,s,l){let a=Math.max(0,r-t),u=Math.max(0,a-2*n),h=s>0&&s>r;if(!h)return{computedAvailableSize:Math.round(a),computedIsNeeded:h,computedSliderSize:Math.round(u),computedSliderRatio:0,computedSliderPosition:0};let d=Math.round(Math.max(20,Math.floor(r*u/s))),m=(u-d)/(s-r),p=l*m;return{computedAvailableSize:Math.round(a),computedIsNeeded:h,computedSliderSize:Math.round(d),computedSliderRatio:m,computedSliderPosition:Math.round(p)}}_refreshComputedValues(){let t=i_._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(t){if(!this._computedIsNeeded)return 0;let n=t-this._arrowSize-this._computedSliderSize/2;return Math.round(n/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let n=t-this._arrowSize,r=this._scrollPosition;return n<this._computedSliderPosition?r-=this._visibleSize:r+=this._visibleSize,r}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let n=this._computedSliderPosition+t;return Math.round(n/this._computedSliderRatio)}},BH=class extends zT{constructor(e,t,n){let r=e.getScrollDimensions(),s=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new BT(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,r.width,r.scrollWidth,s.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},jH=class extends zT{constructor(e,t,n){let r=e.getScrollDimensions(),s=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new BT(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,r.height,r.scrollHeight,s.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},PH=500,EC=50,IH=class{constructor(e,t,n){this.timestamp=e,this.deltaX=t,this.deltaY=n,this.score=0}},s_=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let t=1,n=0,r=1,s=this._rear;do{let l=s===this._front?t:Math.pow(2,-r);if(t-=l,n+=this._memory[s].score*l,s===this._front)break;s=(this._capacity+s-1)%this._capacity,r++}while(!0);return n<=.5}acceptStandardWheelEvent(t){if(eb){let n=gi(t.browserEvent),r=X7(n);this.accept(Date.now(),t.deltaX*r,t.deltaY*r)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,n,r){let s=null,l=new IH(t,n,r);this._front===-1&&this._rear===-1?(this._memory[0]=l,this._front=0,this._rear=0):(s=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=l),l.score=this._computeScore(l,s)}_computeScore(t,n){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let r=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(r+=.25),n){let s=Math.abs(t.deltaX),l=Math.abs(t.deltaY),a=Math.abs(n.deltaX),u=Math.abs(n.deltaY),h=Math.max(Math.min(s,a),1),d=Math.max(Math.min(l,u),1),m=Math.max(s,a),p=Math.max(l,u);m%h===0&&p%d===0&&(r-=.5)}return Math.min(Math.max(r,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};s_.INSTANCE=new s_;var HH=s_,FH=class extends ib{constructor(e,t,n){super(),this._onScroll=this._register(new ge),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new ge),this.onWillScroll=this._onWillScroll.event,this._options=$H(t),this._scrollable=n,this._register(this._scrollable.onScroll(s=>{this._onWillScroll.fire(s),this._onDidScroll(s),this._onScroll.fire(s)}));let r={onMouseWheel:s=>this._onMouseWheel(s),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new jH(this._scrollable,this._options,r)),this._horizontalScrollbar=this._register(new BH(this._scrollable,this._options,r)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=Hc(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Hc(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Hc(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,s=>this._onMouseOver(s)),this.onmouseleave(this._listenOnDomNode,s=>this._onMouseLeave(s)),this._hideTimeout=this._register(new nb),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=Io(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,yi&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new yC(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Io(this._mouseWheelToDispose),e)){let t=n=>{this._onMouseWheel(new yC(n))};this._mouseWheelToDispose.push(Oe(this._listenOnDomNode,nn.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){var s;if((s=e.browserEvent)!=null&&s.defaultPrevented)return;let t=HH.INSTANCE;t.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let l=e.deltaY*this._options.mouseWheelScrollSensitivity,a=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&a+l===0?a=l=0:Math.abs(l)>=Math.abs(a)?a=0:l=0),this._options.flipAxes&&([l,a]=[a,l]);let u=!yi&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||u)&&!a&&(a=l,l=0),e.browserEvent&&e.browserEvent.altKey&&(a=a*this._options.fastScrollSensitivity,l=l*this._options.fastScrollSensitivity);let h=this._scrollable.getFutureScrollPosition(),d={};if(l){let m=EC*l,p=h.scrollTop-(m<0?Math.floor(m):Math.ceil(m));this._verticalScrollbar.writeScrollPosition(d,p)}if(a){let m=EC*a,p=h.scrollLeft-(m<0?Math.floor(m):Math.ceil(m));this._horizontalScrollbar.writeScrollPosition(d,p)}d=this._scrollable.validateScrollPosition(d),(h.scrollLeft!==d.scrollLeft||h.scrollTop!==d.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(d):this._scrollable.setScrollPositionNow(d),n=!0)}let r=n;!r&&this._options.alwaysConsumeMouseWheel&&(r=!0),!r&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(r=!0),r&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,n=e.scrollLeft>0,r=n?" left":"",s=t?" top":"",l=n||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${r}`),this._topShadowDomNode.setClassName(`shadow${s}`),this._topLeftShadowDomNode.setClassName(`shadow${l}${s}${r}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),PH)}},UH=class extends FH{constructor(e,t,n){super(e,t,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function $H(e){let t={lazyRender:typeof e.lazyRender<"u"?e.lazyRender:!1,className:typeof e.className<"u"?e.className:"",useShadows:typeof e.useShadows<"u"?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<"u"?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<"u"?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<"u"?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<"u"?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<"u"?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<"u"?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<"u"?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<"u"?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<"u"?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<"u"?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<"u"?e.listenOnDomNode:null,horizontal:typeof e.horizontal<"u"?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<"u"?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<"u"?e.horizontalHasArrows:!1,vertical:typeof e.vertical<"u"?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<"u"?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<"u"?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<"u"?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<"u"?e.scrollByPage:!1};return t.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:t.verticalScrollbarSize,yi&&(t.className+=" mac"),t}var o_=class extends Fe{constructor(e,t,n,r,s,l,a,u){super(),this._bufferService=n,this._optionsService=a,this._renderService=u,this._onRequestScrollLines=this._register(new ge),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let h=this._register(new AH({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:d=>rb(r.window,d)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{h.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new UH(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},h)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(s.onProtocolChange(d=>{this._scrollableElement.updateOptions({handleMouseWheel:!(d&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(Cn.runAndSubscribe(l.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=l.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(yt(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=r.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(yt(()=>this._styleElement.remove())),this._register(Cn.runAndSubscribe(l.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${l.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${l.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${l.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
|
|
441
|
-
`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(d=>this._handleScroll(d)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){var e;return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:((e=this._optionsService.rawOptions.overviewRuler)==null?void 0:e.width)||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),n=t-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}};o_=Mt([_e(2,Pn),_e(3,is),_e(4,gT),_e(5,va),_e(6,In),_e(7,ss)],o_);var l_=class extends Fe{constructor(e,t,n,r,s){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=n,this._decorationService=r,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(l=>this._removeDecoration(l))),this._register(yt(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){var r;let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",((r=e==null?void 0:e.options)==null?void 0:r.layer)==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose(()=>{this._decorationElements.delete(e),n.remove()})),n.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(n.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,n.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(n)}}_refreshXPosition(e,t=e.element){if(!t)return;let n=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=n?`${n*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=n?`${n*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){var t;(t=this._decorationElements.get(e))==null||t.remove(),this._decorationElements.delete(e),e.dispose()}};l_=Mt([_e(1,Pn),_e(2,is),_e(3,Ru),_e(4,ss)],l_);var WH=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(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,n){return t>=e.startBufferLine-this._linePadding[n||"full"]&&t<=e.endBufferLine+this._linePadding[n||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},ai={full:0,left:0,center:0,right:0},Bs={full:0,left:0,center:0,right:0},gc={full:0,left:0,center:0,right:0},tf=class extends Fe{constructor(e,t,n,r,s,l,a,u){var d;super(),this._viewportElement=e,this._screenElement=t,this._bufferService=n,this._decorationService=r,this._renderService=s,this._optionsService=l,this._themeService=a,this._coreBrowserService=u,this._colorZoneStore=new WH,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(),(d=this._viewportElement.parentElement)==null||d.insertBefore(this._canvas,this._viewportElement),this._register(yt(()=>{var m;return(m=this._canvas)==null?void 0:m.remove()}));let h=this._canvas.getContext("2d");if(h)this._ctx=h;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),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())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){var e;return((e=this._optionsService.options.overviewRuler)==null?void 0:e.width)||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);Bs.full=this._canvas.width,Bs.left=e,Bs.center=t,Bs.right=e,this._refreshDrawHeightConstants(),gc.full=1,gc.left=1,gc.center=1+Bs.left,gc.right=1+Bs.left+Bs.center}_refreshDrawHeightConstants(){ai.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);ai.left=t,ai.center=t,ai.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*ai.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*ai.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*ai.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*ai.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(let t of this._decorationService.decorations)this._colorZoneStore.addDecoration(t);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!=="full"&&this._renderColorZone(t);for(let t of e)t.position==="full"&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(gc[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-ai[e.position||"full"]/2),Bs[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+ai[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};tf=Mt([_e(2,Pn),_e(3,Ru),_e(4,ss),_e(5,In),_e(6,va),_e(7,is)],tf);var he;(e=>(e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="\x07",e.BS="\b",e.HT=" ",e.LF=`
|
|
442
|
-
`,e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="\x1B",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""))(he||(he={}));var Ld;(e=>(e.PAD="",e.HOP="",e.BPH="",e.NBH="",e.IND="",e.NEL="
",e.SSA="",e.ESA="",e.HTS="",e.HTJ="",e.VTS="",e.PLD="",e.PLU="",e.RI="",e.SS2="",e.SS3="",e.DCS="",e.PU1="",e.PU2="",e.STS="",e.CCH="",e.MW="",e.SPA="",e.EPA="",e.SOS="",e.SGCI="",e.SCI="",e.CSI="",e.ST="",e.OSC="",e.PM="",e.APC=""))(Ld||(Ld={}));var jT;(e=>e.ST=`${he.ESC}\\`)(jT||(jT={}));var a_=class{constructor(e,t,n,r,s,l){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=r,this._coreService=s,this._renderService=l,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let n;t.start+=this._dataAlreadySent.length,this._isComposing?n=this._textarea.value.substring(t.start,this._compositionPosition.start):n=this._textarea.value.substring(t.start),n.length>0&&this._coreService.triggerDataEvent(n,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,n=t.replace(e,"");this._dataAlreadySent=n,t.length>e.length?this._coreService.triggerDataEvent(n,!0):t.length<e.length?this._coreService.triggerDataEvent(`${he.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),n=this._renderService.dimensions.css.cell.height,r=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,s=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=s+"px",this._compositionView.style.top=r+"px",this._compositionView.style.height=n+"px",this._compositionView.style.lineHeight=n+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let l=this._compositionView.getBoundingClientRect();this._textarea.style.left=s+"px",this._textarea.style.top=r+"px",this._textarea.style.width=Math.max(l.width,1)+"px",this._textarea.style.height=Math.max(l.height,1)+"px",this._textarea.style.lineHeight=l.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};a_=Mt([_e(2,Pn),_e(3,In),_e(4,Ko),_e(5,ss)],a_);var an=0,cn=0,un=0,Rt=0,RC={css:"#00000000",rgba:0},$t;(e=>{function t(s,l,a,u){return u!==void 0?`#${Eo(s)}${Eo(l)}${Eo(a)}${Eo(u)}`:`#${Eo(s)}${Eo(l)}${Eo(a)}`}e.toCss=t;function n(s,l,a,u=255){return(s<<24|l<<16|a<<8|u)>>>0}e.toRgba=n;function r(s,l,a,u){return{css:e.toCss(s,l,a,u),rgba:e.toRgba(s,l,a,u)}}e.toColor=r})($t||($t={}));var vt;(e=>{function t(h,d){if(Rt=(d.rgba&255)/255,Rt===1)return{css:d.css,rgba:d.rgba};let m=d.rgba>>24&255,p=d.rgba>>16&255,_=d.rgba>>8&255,b=h.rgba>>24&255,S=h.rgba>>16&255,w=h.rgba>>8&255;an=b+Math.round((m-b)*Rt),cn=S+Math.round((p-S)*Rt),un=w+Math.round((_-w)*Rt);let C=$t.toCss(an,cn,un),k=$t.toRgba(an,cn,un);return{css:C,rgba:k}}e.blend=t;function n(h){return(h.rgba&255)===255}e.isOpaque=n;function r(h,d,m){let p=zd.ensureContrastRatio(h.rgba,d.rgba,m);if(p)return $t.toColor(p>>24&255,p>>16&255,p>>8&255)}e.ensureContrastRatio=r;function s(h){let d=(h.rgba|255)>>>0;return[an,cn,un]=zd.toChannels(d),{css:$t.toCss(an,cn,un),rgba:d}}e.opaque=s;function l(h,d){return Rt=Math.round(d*255),[an,cn,un]=zd.toChannels(h.rgba),{css:$t.toCss(an,cn,un,Rt),rgba:$t.toRgba(an,cn,un,Rt)}}e.opacity=l;function a(h,d){return Rt=h.rgba&255,l(h,Rt*d/255)}e.multiplyOpacity=a;function u(h){return[h.rgba>>24&255,h.rgba>>16&255,h.rgba>>8&255]}e.toColorRGB=u})(vt||(vt={}));var St;(e=>{let t,n;try{let s=document.createElement("canvas");s.width=1,s.height=1;let l=s.getContext("2d",{willReadFrequently:!0});l&&(t=l,t.globalCompositeOperation="copy",n=t.createLinearGradient(0,0,1,1))}catch{}function r(s){if(s.match(/#[\da-f]{3,8}/i))switch(s.length){case 4:return an=parseInt(s.slice(1,2).repeat(2),16),cn=parseInt(s.slice(2,3).repeat(2),16),un=parseInt(s.slice(3,4).repeat(2),16),$t.toColor(an,cn,un);case 5:return an=parseInt(s.slice(1,2).repeat(2),16),cn=parseInt(s.slice(2,3).repeat(2),16),un=parseInt(s.slice(3,4).repeat(2),16),Rt=parseInt(s.slice(4,5).repeat(2),16),$t.toColor(an,cn,un,Rt);case 7:return{css:s,rgba:(parseInt(s.slice(1),16)<<8|255)>>>0};case 9:return{css:s,rgba:parseInt(s.slice(1),16)>>>0}}let l=s.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(l)return an=parseInt(l[1]),cn=parseInt(l[2]),un=parseInt(l[3]),Rt=Math.round((l[5]===void 0?1:parseFloat(l[5]))*255),$t.toColor(an,cn,un,Rt);if(!t||!n)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=n,t.fillStyle=s,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[an,cn,un,Rt]=t.getImageData(0,0,1,1).data,Rt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:$t.toRgba(an,cn,un,Rt),css:s}}e.toColor=r})(St||(St={}));var On;(e=>{function t(r){return n(r>>16&255,r>>8&255,r&255)}e.relativeLuminance=t;function n(r,s,l){let a=r/255,u=s/255,h=l/255,d=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4),m=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4),p=h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4);return d*.2126+m*.7152+p*.0722}e.relativeLuminance2=n})(On||(On={}));var zd;(e=>{function t(a,u){if(Rt=(u&255)/255,Rt===1)return u;let h=u>>24&255,d=u>>16&255,m=u>>8&255,p=a>>24&255,_=a>>16&255,b=a>>8&255;return an=p+Math.round((h-p)*Rt),cn=_+Math.round((d-_)*Rt),un=b+Math.round((m-b)*Rt),$t.toRgba(an,cn,un)}e.blend=t;function n(a,u,h){let d=On.relativeLuminance(a>>8),m=On.relativeLuminance(u>>8);if(Yi(d,m)<h){if(m<d){let b=r(a,u,h),S=Yi(d,On.relativeLuminance(b>>8));if(S<h){let w=s(a,u,h),C=Yi(d,On.relativeLuminance(w>>8));return S>C?b:w}return b}let p=s(a,u,h),_=Yi(d,On.relativeLuminance(p>>8));if(_<h){let b=r(a,u,h),S=Yi(d,On.relativeLuminance(b>>8));return _>S?p:b}return p}}e.ensureContrastRatio=n;function r(a,u,h){let d=a>>24&255,m=a>>16&255,p=a>>8&255,_=u>>24&255,b=u>>16&255,S=u>>8&255,w=Yi(On.relativeLuminance2(_,b,S),On.relativeLuminance2(d,m,p));for(;w<h&&(_>0||b>0||S>0);)_-=Math.max(0,Math.ceil(_*.1)),b-=Math.max(0,Math.ceil(b*.1)),S-=Math.max(0,Math.ceil(S*.1)),w=Yi(On.relativeLuminance2(_,b,S),On.relativeLuminance2(d,m,p));return(_<<24|b<<16|S<<8|255)>>>0}e.reduceLuminance=r;function s(a,u,h){let d=a>>24&255,m=a>>16&255,p=a>>8&255,_=u>>24&255,b=u>>16&255,S=u>>8&255,w=Yi(On.relativeLuminance2(_,b,S),On.relativeLuminance2(d,m,p));for(;w<h&&(_<255||b<255||S<255);)_=Math.min(255,_+Math.ceil((255-_)*.1)),b=Math.min(255,b+Math.ceil((255-b)*.1)),S=Math.min(255,S+Math.ceil((255-S)*.1)),w=Yi(On.relativeLuminance2(_,b,S),On.relativeLuminance2(d,m,p));return(_<<24|b<<16|S<<8|255)>>>0}e.increaseLuminance=s;function l(a){return[a>>24&255,a>>16&255,a>>8&255,a&255]}e.toChannels=l})(zd||(zd={}));function Eo(e){let t=e.toString(16);return t.length<2?"0"+t:t}function Yi(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var qH=class extends Eu{constructor(e,t,n){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},nf=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new jr}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let n=[],r=t.translateToString(!0),s=0,l=0,a=0,u=t.getFg(0),h=t.getBg(0);for(let d=0;d<t.getTrimmedLength();d++)if(t.loadCell(d,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==u||this._workCell.bg!==h){if(d-s>1){let m=this._getJoinedRanges(r,a,l,t,s);for(let p=0;p<m.length;p++)n.push(m[p])}s=d,a=l,u=this._workCell.fg,h=this._workCell.bg}l+=this._workCell.getChars().length||Ws.length}if(this._bufferService.cols-s>1){let d=this._getJoinedRanges(r,a,l,t,s);for(let m=0;m<d.length;m++)n.push(d[m])}return n}_getJoinedRanges(e,t,n,r,s){let l=e.substring(t,n),a=[];try{a=this._characterJoiners[0].handler(l)}catch(u){console.error(u)}for(let u=1;u<this._characterJoiners.length;u++)try{let h=this._characterJoiners[u].handler(l);for(let d=0;d<h.length;d++)nf._mergeRanges(a,h[d])}catch(h){console.error(h)}return this._stringRangesToCellRanges(a,r,s),a}_stringRangesToCellRanges(e,t,n){let r=0,s=!1,l=0,a=e[r];if(a){for(let u=n;u<this._bufferService.cols;u++){let h=t.getWidth(u),d=t.getString(u).length||Ws.length;if(h!==0){if(!s&&a[0]<=l&&(a[0]=u,s=!0),a[1]<=l){if(a[1]=u,a=e[++r],!a)break;a[0]<=l?(a[0]=u,s=!0):s=!1}l+=d}}a&&(a[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let n=!1;for(let r=0;r<e.length;r++){let s=e[r];if(n){if(t[1]<=s[0])return e[r-1][1]=t[1],e;if(t[1]<=s[1])return e[r-1][1]=Math.max(t[1],s[1]),e.splice(r,1),e;e.splice(r,1),r--}else{if(t[1]<=s[0])return e.splice(r,0,t),e;if(t[1]<=s[1])return s[0]=Math.min(t[0],s[0]),e;t[0]<s[1]&&(s[0]=Math.min(t[0],s[0]),n=!0);continue}}return n?e[e.length-1][1]=t[1]:e.push(t),e}};nf=Mt([_e(0,Pn)],nf);function VH(e){return 57508<=e&&e<=57558}function KH(e){return 9472<=e&&e<=9631}function GH(e){return VH(e)||KH(e)}function YH(){return{css:{canvas:cd(),cell:cd()},device:{canvas:cd(),cell:cd(),char:{width:0,height:0,left:0,top:0}}}}function cd(){return{width:0,height:0}}var c_=class{constructor(e,t,n,r,s,l,a){this._document=e,this._characterJoinerService=t,this._optionsService=n,this._coreBrowserService=r,this._coreService=s,this._decorationService=l,this._themeService=a,this._workCell=new jr,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,n){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=n}createRow(e,t,n,r,s,l,a,u,h,d,m){let p=[],_=this._characterJoinerService.getJoinedCharacters(t),b=this._themeService.colors,S=e.getNoBgTrimmedLength();n&&S<l+1&&(S=l+1);let w,C=0,k="",T=0,R=0,D=0,z=0,L=!1,O=0,B=!1,X=0,P=0,q=[],H=d!==-1&&m!==-1;for(let U=0;U<S;U++){e.loadCell(U,this._workCell);let V=this._workCell.getWidth();if(V===0)continue;let F=!1,j=U>=P,K=U,$=this._workCell;if(_.length>0&&U===_[0][0]&&j){let Me=_.shift(),Xe=this._isCellInSelection(Me[0],t);for(T=Me[0]+1;T<Me[1];T++)j&&(j=Xe===this._isCellInSelection(T,t));j&&(j=!n||l<Me[0]||l>=Me[1]),j?(F=!0,$=new qH(this._workCell,e.translateToString(!0,Me[0],Me[1]),Me[1]-Me[0]),K=Me[1]-1,V=$.getWidth()):P=Me[1]}let J=this._isCellInSelection(U,t),A=n&&U===l,I=H&&U>=d&&U<=m,Y=!1;this._decorationService.forEachDecorationAtCell(U,t,void 0,Me=>{Y=!0});let M=$.getChars()||Ws;if(M===" "&&($.isUnderline()||$.isOverline())&&(M=" "),X=V*u-h.get(M,$.isBold(),$.isItalic()),!w)w=this._document.createElement("span");else if(C&&(J&&B||!J&&!B&&$.bg===R)&&(J&&B&&b.selectionForeground||$.fg===D)&&$.extended.ext===z&&I===L&&X===O&&!A&&!F&&!Y&&j){$.isInvisible()?k+=Ws:k+=M,C++;continue}else C&&(w.textContent=k),w=this._document.createElement("span"),C=0,k="";if(R=$.bg,D=$.fg,z=$.extended.ext,L=I,O=X,B=J,F&&l>=U&&l<=K&&(l=U),!this._coreService.isCursorHidden&&A&&this._coreService.isCursorInitialized){if(q.push("xterm-cursor"),this._coreBrowserService.isFocused)a&&q.push("xterm-cursor-blink"),q.push(r==="bar"?"xterm-cursor-bar":r==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(s)switch(s){case"outline":q.push("xterm-cursor-outline");break;case"block":q.push("xterm-cursor-block");break;case"bar":q.push("xterm-cursor-bar");break;case"underline":q.push("xterm-cursor-underline");break}}if($.isBold()&&q.push("xterm-bold"),$.isItalic()&&q.push("xterm-italic"),$.isDim()&&q.push("xterm-dim"),$.isInvisible()?k=Ws:k=$.getChars()||Ws,$.isUnderline()&&(q.push(`xterm-underline-${$.extended.underlineStyle}`),k===" "&&(k=" "),!$.isUnderlineColorDefault()))if($.isUnderlineColorRGB())w.style.textDecorationColor=`rgb(${Eu.toColorRGB($.getUnderlineColor()).join(",")})`;else{let Me=$.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&$.isBold()&&Me<8&&(Me+=8),w.style.textDecorationColor=b.ansi[Me].css}$.isOverline()&&(q.push("xterm-overline"),k===" "&&(k=" ")),$.isStrikethrough()&&q.push("xterm-strikethrough"),I&&(w.style.textDecoration="underline");let Z=$.getFgColor(),ae=$.getFgColorMode(),se=$.getBgColor(),pe=$.getBgColorMode(),ke=!!$.isInverse();if(ke){let Me=Z;Z=se,se=Me;let Xe=ae;ae=pe,pe=Xe}let me,Ee,et=!1;this._decorationService.forEachDecorationAtCell(U,t,void 0,Me=>{Me.options.layer!=="top"&&et||(Me.backgroundColorRGB&&(pe=50331648,se=Me.backgroundColorRGB.rgba>>8&16777215,me=Me.backgroundColorRGB),Me.foregroundColorRGB&&(ae=50331648,Z=Me.foregroundColorRGB.rgba>>8&16777215,Ee=Me.foregroundColorRGB),et=Me.options.layer==="top")}),!et&&J&&(me=this._coreBrowserService.isFocused?b.selectionBackgroundOpaque:b.selectionInactiveBackgroundOpaque,se=me.rgba>>8&16777215,pe=50331648,et=!0,b.selectionForeground&&(ae=50331648,Z=b.selectionForeground.rgba>>8&16777215,Ee=b.selectionForeground)),et&&q.push("xterm-decoration-top");let Ge;switch(pe){case 16777216:case 33554432:Ge=b.ansi[se],q.push(`xterm-bg-${se}`);break;case 50331648:Ge=$t.toColor(se>>16,se>>8&255,se&255),this._addStyle(w,`background-color:#${MC((se>>>0).toString(16),"0",6)}`);break;case 0:default:ke?(Ge=b.foreground,q.push("xterm-bg-257")):Ge=b.background}switch(me||$.isDim()&&(me=vt.multiplyOpacity(Ge,.5)),ae){case 16777216:case 33554432:$.isBold()&&Z<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Z+=8),this._applyMinimumContrast(w,Ge,b.ansi[Z],$,me,void 0)||q.push(`xterm-fg-${Z}`);break;case 50331648:let Me=$t.toColor(Z>>16&255,Z>>8&255,Z&255);this._applyMinimumContrast(w,Ge,Me,$,me,Ee)||this._addStyle(w,`color:#${MC(Z.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(w,Ge,b.foreground,$,me,Ee)||ke&&q.push("xterm-fg-257")}q.length&&(w.className=q.join(" "),q.length=0),!A&&!F&&!Y&&j?C++:w.textContent=k,X!==this.defaultSpacing&&(w.style.letterSpacing=`${X}px`),p.push(w),U=K}return w&&C&&(w.textContent=k),p}_applyMinimumContrast(e,t,n,r,s,l){if(this._optionsService.rawOptions.minimumContrastRatio===1||GH(r.getCode()))return!1;let a=this._getContrastCache(r),u;if(!s&&!l&&(u=a.getColor(t.rgba,n.rgba)),u===void 0){let h=this._optionsService.rawOptions.minimumContrastRatio/(r.isDim()?2:1);u=vt.ensureContrastRatio(s||t,l||n,h),a.setColor((s||t).rgba,(l||n).rgba,u??null)}return u?(this._addStyle(e,`color:${u.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){let n=this._selectionStart,r=this._selectionEnd;return!n||!r?!1:this._columnSelectMode?n[0]<=r[0]?e>=n[0]&&t>=n[1]&&e<r[0]&&t<=r[1]:e<n[0]&&t>=n[1]&&e>=r[0]&&t<=r[1]:t>n[1]&&t<r[1]||n[1]===r[1]&&t===n[1]&&e>=n[0]&&e<r[0]||n[1]<r[1]&&t===r[1]&&e<r[0]||n[1]<r[1]&&t===n[1]&&e>=n[0]}};c_=Mt([_e(1,yT),_e(2,In),_e(3,is),_e(4,Ko),_e(5,Ru),_e(6,va)],c_);function MC(e,t,n){for(;e.length<n;)e=t+e;return e}var XH=class{constructor(e,t){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=e.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";let n=e.createElement("span");n.classList.add("xterm-char-measure-element");let r=e.createElement("span");r.classList.add("xterm-char-measure-element"),r.style.fontWeight="bold";let s=e.createElement("span");s.classList.add("xterm-char-measure-element"),s.style.fontStyle="italic";let l=e.createElement("span");l.classList.add("xterm-char-measure-element"),l.style.fontWeight="bold",l.style.fontStyle="italic",this._measureElements=[n,r,s,l],this._container.appendChild(n),this._container.appendChild(r),this._container.appendChild(s),this._container.appendChild(l),t.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(e,t,n,r){e===this._font&&t===this._fontSize&&n===this._weight&&r===this._weightBold||(this._font=e,this._fontSize=t,this._weight=n,this._weightBold=r,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${r}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${r}`,this.clear())}get(e,t,n){let r=0;if(!t&&!n&&e.length===1&&(r=e.charCodeAt(0))<256){if(this._flat[r]!==-9999)return this._flat[r];let a=this._measure(e,0);return a>0&&(this._flat[r]=a),a}let s=e;t&&(s+="B"),n&&(s+="I");let l=this._holey.get(s);if(l===void 0){let a=0;t&&(a|=1),n&&(a|=2),l=this._measure(e,a),l>0&&this._holey.set(s,l)}return l}_measure(e,t){let n=this._measureElements[t];return n.textContent=e.repeat(32),n.offsetWidth/32}},ZH=class{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(e,t,n,r=!1){if(this.selectionStart=t,this.selectionEnd=n,!t||!n||t[0]===n[0]&&t[1]===n[1]){this.clear();return}let s=e.buffers.active.ydisp,l=t[1]-s,a=n[1]-s,u=Math.max(l,0),h=Math.min(a,e.rows-1);if(u>=e.rows||h<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=r,this.viewportStartRow=l,this.viewportEndRow=a,this.viewportCappedStartRow=u,this.viewportCappedEndRow=h,this.startCol=t[0],this.endCol=n[0]}isCellSelected(e,t,n){return this.hasSelection?(n-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&n>=this.viewportCappedStartRow&&t<this.endCol&&n<=this.viewportCappedEndRow:t<this.startCol&&n>=this.viewportCappedStartRow&&t>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol):!1}};function QH(){return new ZH}var Ig="xterm-dom-renderer-owner-",Dr="xterm-rows",ud="xterm-fg-",TC="xterm-bg-",vc="xterm-focus",hd="xterm-selection",JH=1,u_=class extends Fe{constructor(e,t,n,r,s,l,a,u,h,d,m,p,_,b){super(),this._terminal=e,this._document=t,this._element=n,this._screenElement=r,this._viewportElement=s,this._helperContainer=l,this._linkifier2=a,this._charSizeService=h,this._optionsService=d,this._bufferService=m,this._coreService=p,this._coreBrowserService=_,this._themeService=b,this._terminalClass=JH++,this._rowElements=[],this._selectionRenderModel=QH(),this.onRequestRedraw=this._register(new ge).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(Dr),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(hd),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=YH(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(S=>this._injectCss(S))),this._injectCss(this._themeService.colors),this._rowFactory=u.createInstance(c_,document),this._element.classList.add(Ig+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(S=>this._handleLinkHover(S))),this._register(this._linkifier2.onHideLinkUnderline(S=>this._handleLinkLeave(S))),this._register(yt(()=>{this._element.classList.remove(Ig+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new XH(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(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),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/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),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(let n of this._rowElements)n.style.width=`${this.dimensions.css.canvas.width}px`,n.style.height=`${this.dimensions.css.cell.height}px`,n.style.lineHeight=`${this.dimensions.css.cell.height}px`,n.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${Dr} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,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(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${Dr} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${Dr} .xterm-dim { color: ${vt.multiplyOpacity(e.foreground,.5).css};}`,t+=`${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;}`;let n=`blink_underline_${this._terminalClass}`,r=`blink_bar_${this._terminalClass}`,s=`blink_block_${this._terminalClass}`;t+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${r} { 50% { box-shadow: none; }}`,t+=`@keyframes ${s} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${Dr}.${vc} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${Dr}.${vc} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${Dr}.${vc} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${Dr} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${Dr} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${Dr} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${Dr} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${Dr} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${hd} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${hd} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${hd} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[l,a]of e.ansi.entries())t+=`${this._terminalSelector} .${ud}${l} { color: ${a.css}; }${this._terminalSelector} .${ud}${l}.xterm-dim { color: ${vt.multiplyOpacity(a,.5).css}; }${this._terminalSelector} .${TC}${l} { background-color: ${a.css}; }`;t+=`${this._terminalSelector} .${ud}257 { color: ${vt.opaque(e.background).css}; }${this._terminalSelector} .${ud}257.xterm-dim { color: ${vt.multiplyOpacity(vt.opaque(e.background),.5).css}; }${this._terminalSelector} .${TC}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let n=this._rowElements.length;n<=t;n++){let r=this._document.createElement("div");this._rowContainer.appendChild(r),this._rowElements.push(r)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),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(vc),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(vc),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,n){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,n),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,n),!this._selectionRenderModel.hasSelection))return;let r=this._selectionRenderModel.viewportStartRow,s=this._selectionRenderModel.viewportEndRow,l=this._selectionRenderModel.viewportCappedStartRow,a=this._selectionRenderModel.viewportCappedEndRow,u=this._document.createDocumentFragment();if(n){let h=e[0]>t[0];u.appendChild(this._createSelectionElement(l,h?t[0]:e[0],h?e[0]:t[0],a-l+1))}else{let h=r===l?e[0]:0,d=l===s?t[0]:this._bufferService.cols;u.appendChild(this._createSelectionElement(l,h,d));let m=a-l-1;if(u.appendChild(this._createSelectionElement(l+1,0,this._bufferService.cols,m)),l!==a){let p=s===a?t[0]:this._bufferService.cols;u.appendChild(this._createSelectionElement(a,0,p))}}this._selectionContainer.appendChild(u)}_createSelectionElement(e,t,n,r=1){let s=this._document.createElement("div"),l=t*this.dimensions.css.cell.width,a=this.dimensions.css.cell.width*(n-t);return l+a>this.dimensions.css.canvas.width&&(a=this.dimensions.css.canvas.width-l),s.style.height=`${r*this.dimensions.css.cell.height}px`,s.style.top=`${e*this.dimensions.css.cell.height}px`,s.style.left=`${l}px`,s.style.width=`${a}px`,s}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(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let n=this._bufferService.buffer,r=n.ybase+n.y,s=Math.min(n.x,this._bufferService.cols-1),l=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,a=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,u=this._optionsService.rawOptions.cursorInactiveStyle;for(let h=e;h<=t;h++){let d=h+n.ydisp,m=this._rowElements[h],p=n.lines.get(d);if(!m||!p)break;m.replaceChildren(...this._rowFactory.createRow(p,d,d===r,a,u,s,l,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Ig}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,n,r,s,l){n<0&&(e=0),r<0&&(t=0);let a=this._bufferService.rows-1;n=Math.max(Math.min(n,a),0),r=Math.max(Math.min(r,a),0),s=Math.min(s,this._bufferService.cols);let u=this._bufferService.buffer,h=u.ybase+u.y,d=Math.min(u.x,s-1),m=this._optionsService.rawOptions.cursorBlink,p=this._optionsService.rawOptions.cursorStyle,_=this._optionsService.rawOptions.cursorInactiveStyle;for(let b=n;b<=r;++b){let S=b+u.ydisp,w=this._rowElements[b],C=u.lines.get(S);if(!w||!C)break;w.replaceChildren(...this._rowFactory.createRow(C,S,S===h,p,_,d,m,this.dimensions.css.cell.width,this._widthCache,l?b===n?e:0:-1,l?(b===r?t:s)-1:-1))}}};u_=Mt([_e(7,Zy),_e(8,Pf),_e(9,In),_e(10,Pn),_e(11,Ko),_e(12,is),_e(13,va)],u_);var h_=class extends Fe{constructor(e,t,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new ge),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new tF(this._optionsService))}catch{this._measureStrategy=this._register(new eF(e,t,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};h_=Mt([_e(2,In)],h_);var PT=class extends Fe{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},eF=class extends PT{constructor(e,t,n){super(),this._document=e,this._parentElement=t,this._optionsService=n,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}},tF=class extends PT{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let t=this._ctx.measureText("W");if(!("width"in t&&"fontBoundingBoxAscent"in t&&"fontBoundingBoxDescent"in t))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},nF=class extends Fe{constructor(e,t,n){super(),this._textarea=e,this._window=t,this.mainDocument=n,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new rF(this._window)),this._onDprChange=this._register(new ge),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new ge),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(r=>this._screenDprMonitor.setWindow(r))),this._register(Cn.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Oe(this._textarea,"focus",()=>this._isFocused=!0)),this._register(Oe(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,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}},rF=class extends Fe{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new la),this._onDprChange=this._register(new ge),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(yt(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Oe(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var e;this._outerListener&&((e=this._resolutionMediaMatchList)==null||e.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)}},iF=class extends Fe{constructor(){super(),this.linkProviders=[],this._register(yt(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function sb(e,t,n){let r=n.getBoundingClientRect(),s=e.getComputedStyle(n),l=parseInt(s.getPropertyValue("padding-left")),a=parseInt(s.getPropertyValue("padding-top"));return[t.clientX-r.left-l,t.clientY-r.top-a]}function sF(e,t,n,r,s,l,a,u,h){if(!l)return;let d=sb(e,t,n);if(d)return d[0]=Math.ceil((d[0]+(h?a/2:0))/a),d[1]=Math.ceil(d[1]/u),d[0]=Math.min(Math.max(d[0],1),r+(h?1:0)),d[1]=Math.min(Math.max(d[1],1),s),d}var d_=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,n,r,s){return sF(window,e,t,n,r,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,s)}getMouseReportCoords(e,t){let n=sb(window,e,t);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};d_=Mt([_e(0,ss),_e(1,Pf)],d_);var oF=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,t,n){this._rowCount=n,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t,!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){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},IT={};g7(IT,{getSafariVersion:()=>aF,isChromeOS:()=>$T,isFirefox:()=>HT,isIpad:()=>cF,isIphone:()=>uF,isLegacyEdge:()=>lF,isLinux:()=>ob,isMac:()=>rf,isNode:()=>If,isSafari:()=>FT,isWindows:()=>UT});var If=typeof process<"u"&&"title"in process,Mu=If?"node":navigator.userAgent,Tu=If?"node":navigator.platform,HT=Mu.includes("Firefox"),lF=Mu.includes("Edge"),FT=/^((?!chrome|android).)*safari/i.test(Mu);function aF(){if(!FT)return 0;let e=Mu.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var rf=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(Tu),cF=Tu==="iPad",uF=Tu==="iPhone",UT=["Windows","Win16","Win32","WinCE"].includes(Tu),ob=Tu.indexOf("Linux")>=0,$T=/\bCrOS\b/.test(Mu),WT=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(e){this._idleCallback=void 0;let t=0,n=0,r=e.timeRemaining(),s=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),n=Math.max(t,n),s=e.timeRemaining(),n*1.5>s){r-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-t))}ms`),this._start();return}r=s}this.clear()}},hF=class extends WT{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},dF=class extends WT{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},sf=!If&&"requestIdleCallback"in window?dF:hF,fF=class{constructor(){this._queue=new sf}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},f_=class extends Fe{constructor(e,t,n,r,s,l,a,u,h){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=r,this._coreService=s,this._coreBrowserService=u,this._renderer=this._register(new la),this._pausedResizeTask=new fF,this._observerDisposable=this._register(new la),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 ge),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new ge),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new ge),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new ge),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new oF((d,m)=>this._renderRows(d,m),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new pF(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(yt(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(a.onResize(()=>this._fullRefresh())),this._register(a.buffers.onBufferActivate(()=>{var d;return(d=this._renderer.value)==null?void 0:d.clear()})),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(l.onDecorationRegistered(()=>this._fullRefresh())),this._register(l.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(a.cols,a.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(a.buffer.y,a.buffer.y,!0))),this._register(h.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(d=>this._registerIntersectionObserver(d,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let n=new e.IntersectionObserver(r=>this._handleIntersectionChange(r[r.length-1]),{threshold:0});n.observe(t),this._observerDisposable.value=yt(()=>n.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.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(e,t,n=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let r=this._syncOutputHandler.flush();r&&(e=Math.min(e,r.start),t=Math.max(t,r.end)),n||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,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(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(t=>this.refreshRows(t.start,t.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var e,t;this._renderer.value&&((t=(e=this._renderer.value).clearTextureAtlas)==null||t.call(e),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var n;return(n=this._renderer.value)==null?void 0:n.handleResize(e,t)}):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){var e;(e=this._renderer.value)==null||e.handleCharSizeChanged()}handleBlur(){var e;(e=this._renderer.value)==null||e.handleBlur()}handleFocus(){var e;(e=this._renderer.value)==null||e.handleFocus()}handleSelectionChanged(e,t,n){var r;this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=n,(r=this._renderer.value)==null||r.handleSelectionChanged(e,t,n)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};f_=Mt([_e(2,In),_e(3,Pf),_e(4,Ko),_e(5,Ru),_e(6,Pn),_e(7,is),_e(8,va)],f_);var pF=class{constructor(e,t,n){this._coreBrowserService=e,this._coreService=t,this._onTimeout=n,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function mF(e,t,n,r){let s=n.buffer.x,l=n.buffer.y;if(!n.buffer.hasScrollback)return _F(s,l,e,t,n,r)+Hf(l,t,n,r)+yF(s,l,e,t,n,r);let a;if(l===t)return a=s>e?"D":"C",iu(Math.abs(s-e),ru(a,r));a=l>t?"D":"C";let u=Math.abs(l-t),h=vF(l>t?e:s,n)+(u-1)*n.cols+1+gF(l>t?s:e);return iu(h,ru(a,r))}function gF(e,t){return e-1}function vF(e,t){return t.cols-e}function _F(e,t,n,r,s,l){return Hf(t,r,s,l).length===0?"":iu(VT(e,t,e,t-Ho(t,s),!1,s).length,ru("D",l))}function Hf(e,t,n,r){let s=e-Ho(e,n),l=t-Ho(t,n),a=Math.abs(s-l)-bF(e,t,n);return iu(a,ru(qT(e,t),r))}function yF(e,t,n,r,s,l){let a;Hf(t,r,s,l).length>0?a=r-Ho(r,s):a=t;let u=r,h=xF(e,t,n,r,s,l);return iu(VT(e,a,n,u,h==="C",s).length,ru(h,l))}function bF(e,t,n){var a;let r=0,s=e-Ho(e,n),l=t-Ho(t,n);for(let u=0;u<Math.abs(s-l);u++){let h=qT(e,t)==="A"?-1:1;(a=n.buffer.lines.get(s+h*u))!=null&&a.isWrapped&&r++}return r}function Ho(e,t){let n=0,r=t.buffer.lines.get(e),s=r==null?void 0:r.isWrapped;for(;s&&e>=0&&e<t.rows;)n++,r=t.buffer.lines.get(--e),s=r==null?void 0:r.isWrapped;return n}function xF(e,t,n,r,s,l){let a;return Hf(n,r,s,l).length>0?a=r-Ho(r,s):a=t,e<n&&a<=r||e>=n&&a<r?"C":"D"}function qT(e,t){return e>t?"A":"B"}function VT(e,t,n,r,s,l){let a=e,u=t,h="";for(;(a!==n||u!==r)&&u>=0&&u<l.buffer.lines.length;)a+=s?1:-1,s&&a>l.cols-1?(h+=l.buffer.translateBufferLineToString(u,!1,e,a),a=0,e=0,u++):!s&&a<0&&(h+=l.buffer.translateBufferLineToString(u,!1,0,e+1),a=l.cols-1,e=a,u--);return h+l.buffer.translateBufferLineToString(u,!1,e,a)}function ru(e,t){let n=t?"O":"[";return he.ESC+n+e}function iu(e,t){e=Math.floor(e);let n="";for(let r=0;r<e;r++)n+=t;return n}var SF=class{constructor(e){this._bufferService=e,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.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()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function AC(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var Hg=50,wF=15,CF=50,kF=500,EF=" ",RF=new RegExp(EF,"g"),p_=class extends Fe{constructor(e,t,n,r,s,l,a,u,h){super(),this._element=e,this._screenElement=t,this._linkifier=n,this._bufferService=r,this._coreService=s,this._mouseService=l,this._optionsService=a,this._renderService=u,this._coreBrowserService=h,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new jr,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new ge),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new ge),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new ge),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new ge),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=d=>this._handleMouseMove(d),this._mouseUpListener=d=>this._handleMouseUp(d),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(d=>this._handleTrim(d)),this._register(this._bufferService.buffers.onBufferActivate(d=>this._handleBufferActivate(d))),this.enable(),this._model=new SF(this._bufferService),this._activeSelectionMode=0,this._register(yt(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(d=>{d.rowsChanged&&this.clearSelection()}))}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(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";let n=this._bufferService.buffer,r=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let s=e[0]<t[0]?e[0]:t[0],l=e[0]<t[0]?t[0]:e[0];for(let a=e[1];a<=t[1];a++){let u=n.translateBufferLineToString(a,!0,s,l);r.push(u)}}else{let s=e[1]===t[1]?t[0]:void 0;r.push(n.translateBufferLineToString(e[1],!0,e[0],s));for(let l=e[1]+1;l<=t[1]-1;l++){let a=n.lines.get(l),u=n.translateBufferLineToString(l,!0);a!=null&&a.isWrapped?r[r.length-1]+=u:r.push(u)}if(e[1]!==t[1]){let l=n.lines.get(t[1]),a=n.translateBufferLineToString(t[1],!0,0,t[0]);l&&l.isWrapped?r[r.length-1]+=a:r.push(a)}}return r.map(s=>s.replace(RF," ")).join(UT?`\r
|
|
443
|
-
`:`
|
|
444
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),ob&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r||!t?!1:this._areCoordsInSelection(t,n,r)}isCellInSelection(e,t){let n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r?!1:this._areCoordsInSelection([e,t],n,r)}_areCoordsInSelection(e,t,n){return e[1]>t[1]&&e[1]<n[1]||t[1]===n[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<n[0]||t[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||t[1]<n[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){var s,l;let n=(l=(s=this._linkifier.currentLink)==null?void 0:s.link)==null?void 0:l.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=AC(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let r=this._getMouseBufferCoords(e);return r?(this._selectWordAt(r,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=sb(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=n?0:(t>n&&(t-=n),t=Math.min(Math.max(t,-Hg),Hg),t/=Hg,t/Math.abs(t)+Math.round(t*(wF-1)))}shouldForceSelection(e){return rf?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),CF)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(rf&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let n=this._bufferService.buffer;if(this._model.selectionEnd[1]<n.lines.length){let r=n.lines.get(this._model.selectionEnd[1]);r&&r.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!t||t[0]!==this._model.selectionEnd[0]||t[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});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<kF&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let n=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(n&&n[0]!==void 0&&n[1]!==void 0){let r=mF(n[0]-1,n[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(r,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,n=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!n){this._oldHasSelection&&this._fireOnSelectionChange(e,t,n);return}!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,n)}_fireOnSelectionChange(e,t,n){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=n,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let n=t;for(let r=0;t>=r;r++){let s=e.loadCell(r,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:s>1&&t!==r&&(n+=s-1)}return n}setSelection(e,t,n){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=n,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,n=!0,r=!0){if(e[0]>=this._bufferService.cols)return;let s=this._bufferService.buffer,l=s.lines.get(e[1]);if(!l)return;let a=s.translateBufferLineToString(e[1],!1),u=this._convertViewportColToCharacterIndex(l,e[0]),h=u,d=e[0]-u,m=0,p=0,_=0,b=0;if(a.charAt(u)===" "){for(;u>0&&a.charAt(u-1)===" ";)u--;for(;h<a.length&&a.charAt(h+1)===" ";)h++}else{let C=e[0],k=e[0];l.getWidth(C)===0&&(m++,C--),l.getWidth(k)===2&&(p++,k++);let T=l.getString(k).length;for(T>1&&(b+=T-1,h+=T-1);C>0&&u>0&&!this._isCharWordSeparator(l.loadCell(C-1,this._workCell));){l.loadCell(C-1,this._workCell);let R=this._workCell.getChars().length;this._workCell.getWidth()===0?(m++,C--):R>1&&(_+=R-1,u-=R-1),u--,C--}for(;k<l.length&&h+1<a.length&&!this._isCharWordSeparator(l.loadCell(k+1,this._workCell));){l.loadCell(k+1,this._workCell);let R=this._workCell.getChars().length;this._workCell.getWidth()===2?(p++,k++):R>1&&(b+=R-1,h+=R-1),h++,k++}}h++;let S=u+d-m+_,w=Math.min(this._bufferService.cols,h-u+m+p-_-b);if(!(!t&&a.slice(u,h).trim()==="")){if(n&&S===0&&l.getCodePoint(0)!==32){let C=s.lines.get(e[1]-1);if(C&&l.isWrapped&&C.getCodePoint(this._bufferService.cols-1)!==32){let k=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(k){let T=this._bufferService.cols-k.start;S-=T,w+=T}}}if(r&&S+w===this._bufferService.cols&&l.getCodePoint(this._bufferService.cols-1)!==32){let C=s.lines.get(e[1]+1);if(C!=null&&C.isWrapped&&C.getCodePoint(0)!==32){let k=this._getWordAt([0,e[1]+1],!1,!1,!0);k&&(w+=k.length)}}return{start:S,length:w}}}_selectWordAt(e,t){let n=this._getWordAt(e,t);if(n){for(;n.start<0;)n.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[n.start,e[1]],this._model.selectionStartLength=n.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let n=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,n--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,n++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,n]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),n={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=AC(n,this._bufferService.cols)}};p_=Mt([_e(3,Pn),_e(4,Ko),_e(5,Qy),_e(6,In),_e(7,ss),_e(8,is)],p_);var DC=class{constructor(){this._data={}}set(e,t,n){this._data[e]||(this._data[e]={}),this._data[e][t]=n}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},NC=class{constructor(){this._color=new DC,this._css=new DC}setCss(e,t,n){this._css.set(e,t,n)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,n){this._color.set(e,t,n)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},Gt=Object.freeze((()=>{let e=[St.toColor("#2e3436"),St.toColor("#cc0000"),St.toColor("#4e9a06"),St.toColor("#c4a000"),St.toColor("#3465a4"),St.toColor("#75507b"),St.toColor("#06989a"),St.toColor("#d3d7cf"),St.toColor("#555753"),St.toColor("#ef2929"),St.toColor("#8ae234"),St.toColor("#fce94f"),St.toColor("#729fcf"),St.toColor("#ad7fa8"),St.toColor("#34e2e2"),St.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let n=0;n<216;n++){let r=t[n/36%6|0],s=t[n/6%6|0],l=t[n%6];e.push({css:$t.toCss(r,s,l),rgba:$t.toRgba(r,s,l)})}for(let n=0;n<24;n++){let r=8+n*10;e.push({css:$t.toCss(r,r,r),rgba:$t.toRgba(r,r,r)})}return e})()),Mo=St.toColor("#ffffff"),Dc=St.toColor("#000000"),OC=St.toColor("#ffffff"),LC=Dc,_c={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},MF=Mo,m_=class extends Fe{constructor(e){super(),this._optionsService=e,this._contrastCache=new NC,this._halfContrastCache=new NC,this._onChangeColors=this._register(new ge),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:Mo,background:Dc,cursor:OC,cursorAccent:LC,selectionForeground:void 0,selectionBackgroundTransparent:_c,selectionBackgroundOpaque:vt.blend(Dc,_c),selectionInactiveBackgroundTransparent:_c,selectionInactiveBackgroundOpaque:vt.blend(Dc,_c),scrollbarSliderBackground:vt.opacity(Mo,.2),scrollbarSliderHoverBackground:vt.opacity(Mo,.4),scrollbarSliderActiveBackground:vt.opacity(Mo,.5),overviewRulerBorder:Mo,ansi:Gt.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)))}get colors(){return this._colors}_setTheme(e={}){let t=this._colors;if(t.foreground=ct(e.foreground,Mo),t.background=ct(e.background,Dc),t.cursor=vt.blend(t.background,ct(e.cursor,OC)),t.cursorAccent=vt.blend(t.background,ct(e.cursorAccent,LC)),t.selectionBackgroundTransparent=ct(e.selectionBackground,_c),t.selectionBackgroundOpaque=vt.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=ct(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=vt.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?ct(e.selectionForeground,RC):void 0,t.selectionForeground===RC&&(t.selectionForeground=void 0),vt.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=vt.opacity(t.selectionBackgroundTransparent,.3)),vt.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=vt.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=ct(e.scrollbarSliderBackground,vt.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=ct(e.scrollbarSliderHoverBackground,vt.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=ct(e.scrollbarSliderActiveBackground,vt.opacity(t.foreground,.5)),t.overviewRulerBorder=ct(e.overviewRulerBorder,MF),t.ansi=Gt.slice(),t.ansi[0]=ct(e.black,Gt[0]),t.ansi[1]=ct(e.red,Gt[1]),t.ansi[2]=ct(e.green,Gt[2]),t.ansi[3]=ct(e.yellow,Gt[3]),t.ansi[4]=ct(e.blue,Gt[4]),t.ansi[5]=ct(e.magenta,Gt[5]),t.ansi[6]=ct(e.cyan,Gt[6]),t.ansi[7]=ct(e.white,Gt[7]),t.ansi[8]=ct(e.brightBlack,Gt[8]),t.ansi[9]=ct(e.brightRed,Gt[9]),t.ansi[10]=ct(e.brightGreen,Gt[10]),t.ansi[11]=ct(e.brightYellow,Gt[11]),t.ansi[12]=ct(e.brightBlue,Gt[12]),t.ansi[13]=ct(e.brightMagenta,Gt[13]),t.ansi[14]=ct(e.brightCyan,Gt[14]),t.ansi[15]=ct(e.brightWhite,Gt[15]),e.extendedAnsi){let n=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let r=0;r<n;r++)t.ansi[r+16]=ct(e.extendedAnsi[r],Gt[r+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e===void 0){for(let t=0;t<this._restoreColors.ansi.length;++t)this._colors.ansi[t]=this._restoreColors.ansi[t];return}switch(e){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[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(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()}}};m_=Mt([_e(0,In)],m_);function ct(e,t){if(e!==void 0)try{return St.toColor(e)}catch{}return t}var TF=class{constructor(...e){this._entries=new Map;for(let[t,n]of e)this.set(t,n)}set(e,t){let n=this._entries.get(e);return this._entries.set(e,t),n}forEach(e){for(let[t,n]of this._entries.entries())e(t,n)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},AF=class{constructor(){this._services=new TF,this._services.set(Zy,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let n=w7(e).sort((l,a)=>l.index-a.index),r=[];for(let l of n){let a=this._services.get(l.id);if(!a)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${l.id._id}.`);r.push(a)}let s=n.length>0?n[0].index:t.length;if(t.length!==s)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${s+1} conflicts with ${t.length} static arguments`);return new e(...t,...r)}},DF={trace:0,debug:1,info:2,warn:3,error:4,off:5},NF="xterm.js: ",g_=class extends Fe{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=DF[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?"":NF)+t,...n)}trace(e,...t){var n;this._logLevel<=0&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.trace.bind(this._optionsService.options.logger))??console.log,e,t)}debug(e,...t){var n;this._logLevel<=1&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.debug.bind(this._optionsService.options.logger))??console.log,e,t)}info(e,...t){var n;this._logLevel<=2&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.info.bind(this._optionsService.options.logger))??console.info,e,t)}warn(e,...t){var n;this._logLevel<=3&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.warn.bind(this._optionsService.options.logger))??console.warn,e,t)}error(e,...t){var n;this._logLevel<=4&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.error.bind(this._optionsService.options.logger))??console.error,e,t)}};g_=Mt([_e(0,In)],g_);var zC=class extends Fe{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new ge),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new ge),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new ge),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=new Array(e);for(let n=0;n<Math.min(e,this.length);n++)t[n]=this._array[this._getCyclicIndex(n)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,t,...n){if(t){for(let r=e;r<this._length-t;r++)this._array[this._getCyclicIndex(r)]=this._array[this._getCyclicIndex(r+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let r=this._length-1;r>=e;r--)this._array[this._getCyclicIndex(r+n.length)]=this._array[this._getCyclicIndex(r)];for(let r=0;r<n.length;r++)this._array[this._getCyclicIndex(e+r)]=n[r];if(n.length&&this.onInsertEmitter.fire({index:e,amount:n.length}),this._length+n.length>this._maxLength){let r=this._length+n.length-this._maxLength;this._startIndex+=r,this._length=this._maxLength,this.onTrimEmitter.fire(r)}else this._length+=n.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,n){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+n<0)throw new Error("Cannot shift elements in list beyond index 0");if(n>0){for(let s=t-1;s>=0;s--)this.set(e+s+n,this.get(e+s));let r=e+t+n-this._length;if(r>0)for(this._length+=r;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let r=0;r<t;r++)this.set(e+r+n,this.get(e+r))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},Ie=3,Ut=Object.freeze(new Eu),dd=0,Fg=2,Nc=class KT{constructor(t,n,r=!1){this.isWrapped=r,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*Ie);let s=n||jr.fromCharData([0,dT,1,0]);for(let l=0;l<t;++l)this.setCell(l,s);this.length=t}get(t){let n=this._data[t*Ie+0],r=n&2097151;return[this._data[t*Ie+1],n&2097152?this._combined[t]:r?Fs(r):"",n>>22,n&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):r]}set(t,n){this._data[t*Ie+1]=n[0],n[1].length>1?(this._combined[t]=n[1],this._data[t*Ie+0]=t|2097152|n[2]<<22):this._data[t*Ie+0]=n[1].charCodeAt(0)|n[2]<<22}getWidth(t){return this._data[t*Ie+0]>>22}hasWidth(t){return this._data[t*Ie+0]&12582912}getFg(t){return this._data[t*Ie+1]}getBg(t){return this._data[t*Ie+2]}hasContent(t){return this._data[t*Ie+0]&4194303}getCodePoint(t){let n=this._data[t*Ie+0];return n&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):n&2097151}isCombined(t){return this._data[t*Ie+0]&2097152}getString(t){let n=this._data[t*Ie+0];return n&2097152?this._combined[t]:n&2097151?Fs(n&2097151):""}isProtected(t){return this._data[t*Ie+2]&536870912}loadCell(t,n){return dd=t*Ie,n.content=this._data[dd+0],n.fg=this._data[dd+1],n.bg=this._data[dd+2],n.content&2097152&&(n.combinedData=this._combined[t]),n.bg&268435456&&(n.extended=this._extendedAttrs[t]),n}setCell(t,n){n.content&2097152&&(this._combined[t]=n.combinedData),n.bg&268435456&&(this._extendedAttrs[t]=n.extended),this._data[t*Ie+0]=n.content,this._data[t*Ie+1]=n.fg,this._data[t*Ie+2]=n.bg}setCellFromCodepoint(t,n,r,s){s.bg&268435456&&(this._extendedAttrs[t]=s.extended),this._data[t*Ie+0]=n|r<<22,this._data[t*Ie+1]=s.fg,this._data[t*Ie+2]=s.bg}addCodepointToCell(t,n,r){let s=this._data[t*Ie+0];s&2097152?this._combined[t]+=Fs(n):s&2097151?(this._combined[t]=Fs(s&2097151)+Fs(n),s&=-2097152,s|=2097152):s=n|1<<22,r&&(s&=-12582913,s|=r<<22),this._data[t*Ie+0]=s}insertCells(t,n,r){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),n<this.length-t){let s=new jr;for(let l=this.length-t-n-1;l>=0;--l)this.setCell(t+n+l,this.loadCell(t+l,s));for(let l=0;l<n;++l)this.setCell(t+l,r)}else for(let s=t;s<this.length;++s)this.setCell(s,r);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,r)}deleteCells(t,n,r){if(t%=this.length,n<this.length-t){let s=new jr;for(let l=0;l<this.length-t-n;++l)this.setCell(t+l,this.loadCell(t+n+l,s));for(let l=this.length-n;l<this.length;++l)this.setCell(l,r)}else for(let s=t;s<this.length;++s)this.setCell(s,r);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,r)}replaceCells(t,n,r,s=!1){if(s){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,r),n<this.length&&this.getWidth(n-1)===2&&!this.isProtected(n)&&this.setCellFromCodepoint(n,0,1,r);t<n&&t<this.length;)this.isProtected(t)||this.setCell(t,r),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),n<this.length&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n,0,1,r);t<n&&t<this.length;)this.setCell(t++,r)}resize(t,n){if(t===this.length)return this._data.length*4*Fg<this._data.buffer.byteLength;let r=t*Ie;if(t>this.length){if(this._data.buffer.byteLength>=r*4)this._data=new Uint32Array(this._data.buffer,0,r);else{let s=new Uint32Array(r);s.set(this._data),this._data=s}for(let s=this.length;s<t;++s)this.setCell(s,n)}else{this._data=this._data.subarray(0,r);let s=Object.keys(this._combined);for(let a=0;a<s.length;a++){let u=parseInt(s[a],10);u>=t&&delete this._combined[u]}let l=Object.keys(this._extendedAttrs);for(let a=0;a<l.length;a++){let u=parseInt(l[a],10);u>=t&&delete this._extendedAttrs[u]}}return this.length=t,r*4*Fg<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*Fg<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,n=!1){if(n){for(let r=0;r<this.length;++r)this.isProtected(r)||this.setCell(r,t);return}this._combined={},this._extendedAttrs={};for(let r=0;r<this.length;++r)this.setCell(r,t)}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(let n in t._combined)this._combined[n]=t._combined[n];this._extendedAttrs={};for(let n in t._extendedAttrs)this._extendedAttrs[n]=t._extendedAttrs[n];this.isWrapped=t.isWrapped}clone(){let t=new KT(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let n in this._combined)t._combined[n]=this._combined[n];for(let n in this._extendedAttrs)t._extendedAttrs[n]=this._extendedAttrs[n];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Ie+0]&4194303)return t+(this._data[t*Ie+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Ie+0]&4194303||this._data[t*Ie+2]&50331648)return t+(this._data[t*Ie+0]>>22);return 0}copyCellsFrom(t,n,r,s,l){let a=t._data;if(l)for(let h=s-1;h>=0;h--){for(let d=0;d<Ie;d++)this._data[(r+h)*Ie+d]=a[(n+h)*Ie+d];a[(n+h)*Ie+2]&268435456&&(this._extendedAttrs[r+h]=t._extendedAttrs[n+h])}else for(let h=0;h<s;h++){for(let d=0;d<Ie;d++)this._data[(r+h)*Ie+d]=a[(n+h)*Ie+d];a[(n+h)*Ie+2]&268435456&&(this._extendedAttrs[r+h]=t._extendedAttrs[n+h])}let u=Object.keys(t._combined);for(let h=0;h<u.length;h++){let d=parseInt(u[h],10);d>=n&&(this._combined[d-n+r]=t._combined[d])}}translateToString(t,n,r,s){n=n??0,r=r??this.length,t&&(r=Math.min(r,this.getTrimmedLength())),s&&(s.length=0);let l="";for(;n<r;){let a=this._data[n*Ie+0],u=a&2097151,h=a&2097152?this._combined[n]:u?Fs(u):Ws;if(l+=h,s)for(let d=0;d<h.length;++d)s.push(n);n+=a>>22||1}return s&&s.push(n),l}};function OF(e,t,n,r,s,l){let a=[];for(let u=0;u<e.length-1;u++){let h=u,d=e.get(++h);if(!d.isWrapped)continue;let m=[e.get(u)];for(;h<e.length&&d.isWrapped;)m.push(d),d=e.get(++h);if(!l&&r>=u&&r<h){u+=m.length-1;continue}let p=0,_=su(m,p,t),b=1,S=0;for(;b<m.length;){let C=su(m,b,t),k=C-S,T=n-_,R=Math.min(k,T);m[p].copyCellsFrom(m[b],S,_,R,!1),_+=R,_===n&&(p++,_=0),S+=R,S===C&&(b++,S=0),_===0&&p!==0&&m[p-1].getWidth(n-1)===2&&(m[p].copyCellsFrom(m[p-1],n-1,_++,1,!1),m[p-1].setCell(n-1,s))}m[p].replaceCells(_,n,s);let w=0;for(let C=m.length-1;C>0&&(C>p||m[C].getTrimmedLength()===0);C--)w++;w>0&&(a.push(u+m.length-w),a.push(w)),u+=m.length-1}return a}function LF(e,t){let n=[],r=0,s=t[r],l=0;for(let a=0;a<e.length;a++)if(s===a){let u=t[++r];e.onDeleteEmitter.fire({index:a-l,amount:u}),a+=u-1,l+=u,s=t[++r]}else n.push(a);return{layout:n,countRemoved:l}}function zF(e,t){let n=[];for(let r=0;r<t.length;r++)n.push(e.get(t[r]));for(let r=0;r<n.length;r++)e.set(r,n[r]);e.length=t.length}function BF(e,t,n){let r=[],s=e.map((h,d)=>su(e,d,t)).reduce((h,d)=>h+d),l=0,a=0,u=0;for(;u<s;){if(s-u<n){r.push(s-u);break}l+=n;let h=su(e,a,t);l>h&&(l-=h,a++);let d=e[a].getWidth(l-1)===2;d&&l--;let m=d?n-1:n;r.push(m),u+=m}return r}function su(e,t,n){if(t===e.length-1)return e[t].getTrimmedLength();let r=!e[t].hasContent(n-1)&&e[t].getWidth(n-1)===1,s=e[t+1].getWidth(0)===2;return r&&s?n-1:n}var GT=class YT{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=YT._nextId++,this._onDispose=this.register(new ge),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),Io(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};GT._nextId=1;var jF=GT,Zt={},To=Zt.B;Zt[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:"≥","{":"π","|":"≠","}":"£","~":"·"};Zt.A={"#":"£"};Zt.B=void 0;Zt[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};Zt.C=Zt[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Zt.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};Zt.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};Zt.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};Zt.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};Zt.E=Zt[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};Zt.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};Zt.H=Zt[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Zt["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var BC=4294967295,jC=class{constructor(e,t,n){this._hasScrollback=e,this._optionsService=t,this._bufferService=n,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=Ut.clone(),this.savedCharset=To,this.markers=[],this._nullCell=jr.fromCharData([0,dT,1,0]),this._whitespaceCell=jr.fromCharData([0,Ws,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new sf,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new zC(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new ef),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new ef),this._whitespaceCell}getBlankLine(e,t){return new Nc(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let t=e+this._optionsService.rawOptions.scrollback;return t>BC?BC:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=Ut);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new zC(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let n=this.getNullCell(Ut),r=0,s=this._getCorrectBufferLength(t);if(s>this.lines.maxLength&&(this.lines.maxLength=s),this.lines.length>0){if(this._cols<e)for(let a=0;a<this.lines.length;a++)r+=+this.lines.get(a).resize(e,n);let l=0;if(this._rows<t)for(let a=this._rows;a<t;a++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new Nc(e,n)):this.ybase>0&&this.lines.length<=this.ybase+this.y+l+1?(this.ybase--,l++,this.ydisp>0&&this.ydisp--):this.lines.push(new Nc(e,n)));else for(let a=this._rows;a>t;a--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(s<this.lines.maxLength){let a=this.lines.length-s;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=s}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),l&&(this.y+=l),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let l=0;l<this.lines.length;l++)r+=+this.lines.get(l).resize(e,n);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),r>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let n=this._optionsService.rawOptions.reflowCursorLine,r=OF(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(Ut),n);if(r.length>0){let s=LF(this.lines,r);zF(this.lines,s.layout),this._reflowLargerAdjustViewport(e,t,s.countRemoved)}}_reflowLargerAdjustViewport(e,t,n){let r=this.getNullCell(Ut),s=n;for(;s-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new Nc(e,r))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-n,0)}_reflowSmaller(e,t){let n=this._optionsService.rawOptions.reflowCursorLine,r=this.getNullCell(Ut),s=[],l=0;for(let a=this.lines.length-1;a>=0;a--){let u=this.lines.get(a);if(!u||!u.isWrapped&&u.getTrimmedLength()<=e)continue;let h=[u];for(;u.isWrapped&&a>0;)u=this.lines.get(--a),h.unshift(u);if(!n){let R=this.ybase+this.y;if(R>=a&&R<a+h.length)continue}let d=h[h.length-1].getTrimmedLength(),m=BF(h,this._cols,e),p=m.length-h.length,_;this.ybase===0&&this.y!==this.lines.length-1?_=Math.max(0,this.y-this.lines.maxLength+p):_=Math.max(0,this.lines.length-this.lines.maxLength+p);let b=[];for(let R=0;R<p;R++){let D=this.getBlankLine(Ut,!0);b.push(D)}b.length>0&&(s.push({start:a+h.length+l,newLines:b}),l+=b.length),h.push(...b);let S=m.length-1,w=m[S];w===0&&(S--,w=m[S]);let C=h.length-p-1,k=d;for(;C>=0;){let R=Math.min(k,w);if(h[S]===void 0)break;if(h[S].copyCellsFrom(h[C],k-R,w-R,R,!0),w-=R,w===0&&(S--,w=m[S]),k-=R,k===0){C--;let D=Math.max(C,0);k=su(h,D,this._cols)}}for(let R=0;R<h.length;R++)m[R]<e&&h[R].setCell(m[R],r);let T=p-_;for(;T-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+l)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+p,this.ybase+t-1)}if(s.length>0){let a=[],u=[];for(let w=0;w<this.lines.length;w++)u.push(this.lines.get(w));let h=this.lines.length,d=h-1,m=0,p=s[m];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+l);let _=0;for(let w=Math.min(this.lines.maxLength-1,h+l-1);w>=0;w--)if(p&&p.start>d+_){for(let C=p.newLines.length-1;C>=0;C--)this.lines.set(w--,p.newLines[C]);w++,a.push({index:d+1,amount:p.newLines.length}),_+=p.newLines.length,p=s[++m]}else this.lines.set(w,u[d--]);let b=0;for(let w=a.length-1;w>=0;w--)a[w].index+=b,this.lines.onInsertEmitter.fire(a[w]),b+=a[w].amount;let S=Math.max(0,h+l-this.lines.maxLength);S>0&&this.lines.onTrimEmitter.fire(S)}}translateBufferLineToString(e,t,n=0,r){let s=this.lines.get(e);return s?s.translateToString(t,n,r):""}getWrappedRangeForLine(e){let t=e,n=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;n+1<this.lines.length&&this.lines.get(n+1).isWrapped;)n++;return{first:t,last:n}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let t=new jF(e);return this.markers.push(t),t.register(this.lines.onTrim(n=>{t.line-=n,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(n=>{t.line>=n.index&&(t.line+=n.amount)})),t.register(this.lines.onDelete(n=>{t.line>=n.index&&t.line<n.index+n.amount&&t.dispose(),t.line>n.index&&(t.line-=n.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},PF=class extends Fe{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new ge),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 jC(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new jC(!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(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),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(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},XT=2,ZT=1,v_=class extends Fe{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new ge),this.onResize=this._onResize.event,this._onScroll=this._register(new ge),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,XT),this.rows=Math.max(e.rawOptions.rows||0,ZT),this.buffers=this._register(new PF(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let n=this.cols!==e,r=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:n,rowsChanged:r})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let n=this.buffer,r;r=this._cachedBlankLine,(!r||r.length!==this.cols||r.getFg(0)!==e.fg||r.getBg(0)!==e.bg)&&(r=n.getBlankLine(e,t),this._cachedBlankLine=r),r.isWrapped=t;let s=n.ybase+n.scrollTop,l=n.ybase+n.scrollBottom;if(n.scrollTop===0){let a=n.lines.isFull;l===n.lines.length-1?a?n.lines.recycle().copyFrom(r):n.lines.push(r.clone()):n.lines.splice(l+1,0,r.clone()),a?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{let a=l-s+1;n.lines.shiftElements(s+1,a-1,-1),n.lines.set(l,r.clone())}this.isUserScrolling||(n.ydisp=n.ybase),this._onScroll.fire(n.ydisp)}scrollLines(e,t){let n=this.buffer;if(e<0){if(n.ydisp===0)return;this.isUserScrolling=!0}else e+n.ydisp>=n.ybase&&(this.isUserScrolling=!1);let r=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+e,n.ybase),0),r!==n.ydisp&&(t||this._onScroll.fire(n.ydisp))}};v_=Mt([_e(0,In)],v_);var Hl={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:rf,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},IF=["normal","bold","100","200","300","400","500","600","700","800","900"],HF=class extends Fe{constructor(e){super(),this._onOptionChange=this._register(new ge),this.onOptionChange=this._onOptionChange.event;let t={...Hl};for(let n in e)if(n in t)try{let r=e[n];t[n]=this._sanitizeAndValidateOption(n,r)}catch(r){console.error(r)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(yt(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(n=>{n===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(n=>{e.indexOf(n)!==-1&&t()})}_setupOptions(){let e=n=>{if(!(n in Hl))throw new Error(`No option with key "${n}"`);return this.rawOptions[n]},t=(n,r)=>{if(!(n in Hl))throw new Error(`No option with key "${n}"`);r=this._sanitizeAndValidateOption(n,r),this.rawOptions[n]!==r&&(this.rawOptions[n]=r,this._onOptionChange.fire(n))};for(let n in this.rawOptions){let r={get:e.bind(this,n),set:t.bind(this,n)};Object.defineProperty(this.options,n,r)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=Hl[e]),!FF(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=Hl[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=IF.includes(t)?t:Hl[e];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${e} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case"scrollback":if(t=Math.min(t,4294967295),t<0)throw new Error(`${e} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${e} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{};break}return t}};function FF(e){return e==="block"||e==="underline"||e==="bar"}function Oc(e,t=5){if(typeof e!="object")return e;let n=Array.isArray(e)?[]:{};for(let r in e)n[r]=t<=1?e[r]:e[r]&&Oc(e[r],t-1);return n}var PC=Object.freeze({insertMode:!1}),IC=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),__=class extends Fe{constructor(e,t,n){super(),this._bufferService=e,this._logService=t,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new ge),this.onData=this._onData.event,this._onUserInput=this._register(new ge),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new ge),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new ge),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=Oc(PC),this.decPrivateModes=Oc(IC)}reset(){this.modes=Oc(PC),this.decPrivateModes=Oc(IC)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let n=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(r=>r.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(t=>t.charCodeAt(0))),this._onBinary.fire(e))}};__=Mt([_e(0,Pn),_e(1,vT),_e(2,In)],__);var HC={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function Ug(e,t){let n=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(n|=64,n|=e.action):(n|=e.button&3,e.button&4&&(n|=64),e.button&8&&(n|=128),e.action===32?n|=32:e.action===0&&!t&&(n|=3)),n}var $g=String.fromCharCode,FC={DEFAULT:e=>{let t=[Ug(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${$g(t[0])}${$g(t[1])}${$g(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Ug(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Ug(e,!0)};${e.x};${e.y}${t}`}},y_=class extends Fe{constructor(e,t,n){super(),this._bufferService=e,this._coreService=t,this._optionsService=n,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new ge),this.onProtocolChange=this._onProtocolChange.event;for(let r of Object.keys(HC))this.addProtocol(r,HC[r]);for(let r of Object.keys(FC))this.addEncoding(r,FC[r]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,n){if(e.deltaY===0||e.shiftKey||t===void 0||n===void 0)return 0;let r=t/n,s=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(s/=r+0,Math.abs(e.deltaY)<50&&(s*=.3),this._wheelPartialScroll+=s,s=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._bufferService.rows),s}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,n){if(n){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};y_=Mt([_e(0,Pn),_e(1,Ko),_e(2,In)],y_);var Wg=[[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]],UF=[[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]],Yt;function $F(e,t){let n=0,r=t.length-1,s;if(e<t[0][0]||e>t[r][1])return!1;for(;r>=n;)if(s=n+r>>1,e>t[s][1])n=s+1;else if(e<t[s][0])r=s-1;else return!0;return!1}var WF=class{constructor(){if(this.version="6",!Yt){Yt=new Uint8Array(65536),Yt.fill(1),Yt[0]=0,Yt.fill(0,1,32),Yt.fill(0,127,160),Yt.fill(2,4352,4448),Yt[9001]=2,Yt[9002]=2,Yt.fill(2,11904,42192),Yt[12351]=1,Yt.fill(2,44032,55204),Yt.fill(2,63744,64256),Yt.fill(2,65040,65050),Yt.fill(2,65072,65136),Yt.fill(2,65280,65377),Yt.fill(2,65504,65511);for(let e=0;e<Wg.length;++e)Yt.fill(0,Wg[e][0],Wg[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?Yt[e]:$F(e,UF)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let n=this.wcwidth(e),r=n===0&&t!==0;if(r){let s=Do.extractWidth(t);s===0?r=!1:s>n&&(n=s)}return Do.createPropertyValue(0,n,r)}},Do=class Bd{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new ge,this.onChange=this._onChange.event;let t=new WF;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,n,r=!1){return(t&16777215)<<3|(n&3)<<1|(r?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let n=0,r=0,s=t.length;for(let l=0;l<s;++l){let a=t.charCodeAt(l);if(55296<=a&&a<=56319){if(++l>=s)return n+this.wcwidth(a);let d=t.charCodeAt(l);56320<=d&&d<=57343?a=(a-55296)*1024+d-56320+65536:n+=this.wcwidth(d)}let u=this.charProperties(a,r),h=Bd.extractWidth(u);Bd.extractShouldJoin(u)&&(h-=Bd.extractWidth(r)),n+=h,r=u}return n}charProperties(t,n){return this._activeProvider.charProperties(t,n)}},qF=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function UC(e){var r;let t=(r=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1))==null?void 0:r.get(e.cols-1),n=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);n&&t&&(n.isWrapped=t[3]!==0&&t[3]!==32)}var yc=2147483647,VF=256,QT=class b_{constructor(t=32,n=32){if(this.maxLength=t,this.maxSubParamsLength=n,n>VF)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(n),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let n=new b_;if(!t.length)return n;for(let r=Array.isArray(t[0])?1:0;r<t.length;++r){let s=t[r];if(Array.isArray(s))for(let l=0;l<s.length;++l)n.addSubParam(s[l]);else n.addParam(s)}return n}clone(){let t=new b_(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let t=[];for(let n=0;n<this.length;++n){t.push(this.params[n]);let r=this._subParamsIdx[n]>>8,s=this._subParamsIdx[n]&255;s-r>0&&t.push(Array.prototype.slice.call(this._subParams,r,s))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>yc?yc:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>yc?yc:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let n=this._subParamsIdx[t]>>8,r=this._subParamsIdx[t]&255;return r-n>0?this._subParams.subarray(n,r):null}getSubParamsAll(){let t={};for(let n=0;n<this.length;++n){let r=this._subParamsIdx[n]>>8,s=this._subParamsIdx[n]&255;s-r>0&&(t[n]=this._subParams.slice(r,s))}return t}addDigit(t){let n;if(this._rejectDigits||!(n=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let r=this._digitIsSub?this._subParams:this.params,s=r[n-1];r[n-1]=~s?Math.min(s*10+t,yc):t}},bc=[],KF=class{constructor(){this._state=0,this._active=bc,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let r=n.indexOf(t);r!==-1&&n.splice(r,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=bc}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=bc,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||bc,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,n){if(!this._active.length)this._handlerFb(this._id,"PUT",jf(e,t,n));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n)}start(){this.reset(),this._state=1}put(e,t,n){if(this._state!==3){if(this._state===1)for(;t<n;){let r=e[t++];if(r===59){this._state=2,this._start();break}if(r<48||57<r){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+r-48}this._state===2&&n-t>0&&this._put(e,t,n)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let n=!1,r=this._active.length-1,s=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,s=this._stack.fallThrough,this._stack.paused=!1),!s&&n===!1){for(;r>=0&&(n=this._active[r].end(e),n!==!0);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].end(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}this._active=bc,this._id=-1,this._state=0}}},dr=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=jf(e,t,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(n=>(this._data="",this._hitLimit=!1,n));return this._data="",this._hitLimit=!1,t}},xc=[],GF=class{constructor(){this._handlers=Object.create(null),this._active=xc,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=xc}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let r=n.indexOf(t);r!==-1&&n.splice(r,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=xc,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||xc,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(t)}put(e,t,n){if(!this._active.length)this._handlerFb(this._ident,"PUT",jf(e,t,n));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let n=!1,r=this._active.length-1,s=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,s=this._stack.fallThrough,this._stack.paused=!1),!s&&n===!1){for(;r>=0&&(n=this._active[r].unhook(e),n!==!0);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}this._active=xc,this._ident=0}},Lc=new QT;Lc.addParam(0);var $C=class{constructor(e){this._handler=e,this._data="",this._params=Lc,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():Lc,this._data="",this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=jf(e,t,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(n=>(this._params=Lc,this._data="",this._hitLimit=!1,n));return this._params=Lc,this._data="",this._hitLimit=!1,t}},YF=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,n,r){this.table[t<<8|e]=n<<4|r}addMany(e,t,n,r){for(let s=0;s<e.length;s++)this.table[t<<8|e[s]]=n<<4|r}},Lr=160,XF=(function(){let e=new YF(4095),t=Array.apply(null,Array(256)).map((u,h)=>h),n=(u,h)=>t.slice(u,h),r=n(32,127),s=n(0,24);s.push(25),s.push.apply(s,n(28,32));let l=n(0,14),a;e.setDefault(1,0),e.addMany(r,0,2,0);for(a in l)e.addMany([24,26,153,154],a,3,0),e.addMany(n(128,144),a,3,0),e.addMany(n(144,152),a,3,0),e.add(156,a,0,0),e.add(27,a,11,1),e.add(157,a,4,8),e.addMany([152,158,159],a,0,7),e.add(155,a,11,3),e.add(144,a,11,9);return e.addMany(s,0,3,0),e.addMany(s,1,3,1),e.add(127,1,0,1),e.addMany(s,8,0,8),e.addMany(s,3,3,3),e.add(127,3,0,3),e.addMany(s,4,3,4),e.add(127,4,0,4),e.addMany(s,6,3,6),e.addMany(s,5,3,5),e.add(127,5,0,5),e.addMany(s,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(r,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(n(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(r,7,0,7),e.addMany(s,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(n(64,127),3,7,0),e.addMany(n(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(n(48,60),4,8,4),e.addMany(n(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(n(32,64),6,0,6),e.add(127,6,0,6),e.addMany(n(64,127),6,0,0),e.addMany(n(32,48),3,9,5),e.addMany(n(32,48),5,9,5),e.addMany(n(48,64),5,0,6),e.addMany(n(64,127),5,7,0),e.addMany(n(32,48),4,9,5),e.addMany(n(32,48),1,9,2),e.addMany(n(32,48),2,9,2),e.addMany(n(48,127),2,10,0),e.addMany(n(48,80),1,10,0),e.addMany(n(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(n(96,127),1,10,0),e.add(80,1,11,9),e.addMany(s,9,0,9),e.add(127,9,0,9),e.addMany(n(28,32),9,0,9),e.addMany(n(32,48),9,9,12),e.addMany(n(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(s,11,0,11),e.addMany(n(32,128),11,0,11),e.addMany(n(28,32),11,0,11),e.addMany(s,10,0,10),e.add(127,10,0,10),e.addMany(n(28,32),10,0,10),e.addMany(n(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(n(32,48),10,9,12),e.addMany(s,12,0,12),e.add(127,12,0,12),e.addMany(n(28,32),12,0,12),e.addMany(n(32,48),12,9,12),e.addMany(n(48,64),12,0,11),e.addMany(n(64,127),12,12,13),e.addMany(n(64,127),10,12,13),e.addMany(n(64,127),9,12,13),e.addMany(s,13,13,13),e.addMany(r,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(Lr,0,2,0),e.add(Lr,8,5,8),e.add(Lr,6,0,6),e.add(Lr,11,0,11),e.add(Lr,13,13,13),e})(),ZF=class extends Fe{constructor(e=XF){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new QT,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,n,r)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,n)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(yt(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new KF),this._dcsParser=this._register(new GF),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let n=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(n=e.prefix.charCodeAt(0),n&&60>n||n>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let s=0;s<e.intermediates.length;++s){let l=e.intermediates.charCodeAt(s);if(32>l||l>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");n<<=8,n|=l}}if(e.final.length!==1)throw new Error("final must be a single byte");let r=e.final.charCodeAt(0);if(t[0]>r||r>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return n<<=8,n|=r,n}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let n=this._identifier(e,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);let r=this._escHandlers[n];return r.push(t),{dispose:()=>{let s=r.indexOf(t);s!==-1&&r.splice(s,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let n=this._identifier(e);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);let r=this._csiHandlers[n];return r.push(t),{dispose:()=>{let s=r.indexOf(t);s!==-1&&r.splice(s,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}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(e,t,n,r,s){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=n,this._parseStack.transition=r,this._parseStack.chunkPos=s}parse(e,t,n){let r=0,s=0,l=0,a;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,l=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let u=this._parseStack.handlers,h=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&h>-1){for(;h>=0&&(a=u[h](this._params),a!==!0);h--)if(a instanceof Promise)return this._parseStack.handlerPos=h,a}this._parseStack.handlers=[];break;case 4:if(n===!1&&h>-1){for(;h>=0&&(a=u[h](),a!==!0);h--)if(a instanceof Promise)return this._parseStack.handlerPos=h,a}this._parseStack.handlers=[];break;case 6:if(r=e[this._parseStack.chunkPos],a=this._dcsParser.unhook(r!==24&&r!==26,n),a)return a;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(r=e[this._parseStack.chunkPos],a=this._oscParser.end(r!==24&&r!==26,n),a)return a;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,l=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let u=l;u<t;++u){switch(r=e[u],s=this._transitions.table[this.currentState<<8|(r<160?r:Lr)],s>>4){case 2:for(let _=u+1;;++_){if(_>=t||(r=e[_])<32||r>126&&r<Lr){this._printHandler(e,u,_),u=_-1;break}if(++_>=t||(r=e[_])<32||r>126&&r<Lr){this._printHandler(e,u,_),u=_-1;break}if(++_>=t||(r=e[_])<32||r>126&&r<Lr){this._printHandler(e,u,_),u=_-1;break}if(++_>=t||(r=e[_])<32||r>126&&r<Lr){this._printHandler(e,u,_),u=_-1;break}}break;case 3:this._executeHandlers[r]?this._executeHandlers[r]():this._executeHandlerFb(r),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:u,code:r,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let h=this._csiHandlers[this._collect<<8|r],d=h?h.length-1:-1;for(;d>=0&&(a=h[d](this._params),a!==!0);d--)if(a instanceof Promise)return this._preserveStack(3,h,d,s,u),a;d<0&&this._csiHandlerFb(this._collect<<8|r,this._params),this.precedingJoinState=0;break;case 8:do switch(r){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(r-48)}while(++u<t&&(r=e[u])>47&&r<60);u--;break;case 9:this._collect<<=8,this._collect|=r;break;case 10:let m=this._escHandlers[this._collect<<8|r],p=m?m.length-1:-1;for(;p>=0&&(a=m[p](),a!==!0);p--)if(a instanceof Promise)return this._preserveStack(4,m,p,s,u),a;p<0&&this._escHandlerFb(this._collect<<8|r),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|r,this._params);break;case 13:for(let _=u+1;;++_)if(_>=t||(r=e[_])===24||r===26||r===27||r>127&&r<Lr){this._dcsParser.put(e,u,_),u=_-1;break}break;case 14:if(a=this._dcsParser.unhook(r!==24&&r!==26),a)return this._preserveStack(6,[],0,s,u),a;r===27&&(s|=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+1;;_++)if(_>=t||(r=e[_])<32||r>127&&r<Lr){this._oscParser.put(e,u,_),u=_-1;break}break;case 6:if(a=this._oscParser.end(r!==24&&r!==26),a)return this._preserveStack(5,[],0,s,u),a;r===27&&(s|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=s&15}}},QF=/^([\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})$/,JF=/^[\da-f]+$/;function WC(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let n=QF.exec(t);if(n){let r=n[1]?15:n[4]?255:n[7]?4095:65535;return[Math.round(parseInt(n[1]||n[4]||n[7]||n[10],16)/r*255),Math.round(parseInt(n[2]||n[5]||n[8]||n[11],16)/r*255),Math.round(parseInt(n[3]||n[6]||n[9]||n[12],16)/r*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),JF.exec(t)&&[3,6,9,12].includes(t.length))){let n=t.length/3,r=[0,0,0];for(let s=0;s<3;++s){let l=parseInt(t.slice(n*s,n*s+n),16);r[s]=n===1?l<<4:n===2?l:n===3?l>>4:l>>8}return r}}function qg(e,t){let n=e.toString(16),r=n.length<2?"0"+n:n;switch(t){case 4:return n[0];case 8:return r;case 12:return(r+r).slice(0,3);default:return r+r}}function eU(e,t=16){let[n,r,s]=e;return`rgb:${qg(n,t)}/${qg(r,t)}/${qg(s,t)}`}var tU={"(":0,")":1,"*":2,"+":3,"-":1,".":2},js=131072,qC=10;function VC(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var KC=5e3,GC=0,nU=class extends Fe{constructor(e,t,n,r,s,l,a,u,h=new ZF){super(),this._bufferService=e,this._charsetService=t,this._coreService=n,this._logService=r,this._optionsService=s,this._oscLinkService=l,this._coreMouseService=a,this._unicodeService=u,this._parser=h,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new x7,this._utf8Decoder=new S7,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=Ut.clone(),this._eraseAttrDataInternal=Ut.clone(),this._onRequestBell=this._register(new ge),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new ge),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new ge),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new ge),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new ge),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new ge),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new ge),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new ge),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new ge),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new ge),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new ge),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new ge),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new ge),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 x_(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(d=>this._activeBuffer=d.activeBuffer)),this._parser.setCsiHandlerFallback((d,m)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(d),params:m.toArray()})}),this._parser.setEscHandlerFallback(d=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(d)})}),this._parser.setExecuteHandlerFallback(d=>{this._logService.debug("Unknown EXECUTE code: ",{code:d})}),this._parser.setOscHandlerFallback((d,m,p)=>{this._logService.debug("Unknown OSC code: ",{identifier:d,action:m,data:p})}),this._parser.setDcsHandlerFallback((d,m,p)=>{m==="HOOK"&&(p=p.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(d),action:m,payload:p})}),this._parser.setPrintHandler((d,m,p)=>this.print(d,m,p)),this._parser.registerCsiHandler({final:"@"},d=>this.insertChars(d)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},d=>this.scrollLeft(d)),this._parser.registerCsiHandler({final:"A"},d=>this.cursorUp(d)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},d=>this.scrollRight(d)),this._parser.registerCsiHandler({final:"B"},d=>this.cursorDown(d)),this._parser.registerCsiHandler({final:"C"},d=>this.cursorForward(d)),this._parser.registerCsiHandler({final:"D"},d=>this.cursorBackward(d)),this._parser.registerCsiHandler({final:"E"},d=>this.cursorNextLine(d)),this._parser.registerCsiHandler({final:"F"},d=>this.cursorPrecedingLine(d)),this._parser.registerCsiHandler({final:"G"},d=>this.cursorCharAbsolute(d)),this._parser.registerCsiHandler({final:"H"},d=>this.cursorPosition(d)),this._parser.registerCsiHandler({final:"I"},d=>this.cursorForwardTab(d)),this._parser.registerCsiHandler({final:"J"},d=>this.eraseInDisplay(d,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},d=>this.eraseInDisplay(d,!0)),this._parser.registerCsiHandler({final:"K"},d=>this.eraseInLine(d,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},d=>this.eraseInLine(d,!0)),this._parser.registerCsiHandler({final:"L"},d=>this.insertLines(d)),this._parser.registerCsiHandler({final:"M"},d=>this.deleteLines(d)),this._parser.registerCsiHandler({final:"P"},d=>this.deleteChars(d)),this._parser.registerCsiHandler({final:"S"},d=>this.scrollUp(d)),this._parser.registerCsiHandler({final:"T"},d=>this.scrollDown(d)),this._parser.registerCsiHandler({final:"X"},d=>this.eraseChars(d)),this._parser.registerCsiHandler({final:"Z"},d=>this.cursorBackwardTab(d)),this._parser.registerCsiHandler({final:"`"},d=>this.charPosAbsolute(d)),this._parser.registerCsiHandler({final:"a"},d=>this.hPositionRelative(d)),this._parser.registerCsiHandler({final:"b"},d=>this.repeatPrecedingCharacter(d)),this._parser.registerCsiHandler({final:"c"},d=>this.sendDeviceAttributesPrimary(d)),this._parser.registerCsiHandler({prefix:">",final:"c"},d=>this.sendDeviceAttributesSecondary(d)),this._parser.registerCsiHandler({final:"d"},d=>this.linePosAbsolute(d)),this._parser.registerCsiHandler({final:"e"},d=>this.vPositionRelative(d)),this._parser.registerCsiHandler({final:"f"},d=>this.hVPosition(d)),this._parser.registerCsiHandler({final:"g"},d=>this.tabClear(d)),this._parser.registerCsiHandler({final:"h"},d=>this.setMode(d)),this._parser.registerCsiHandler({prefix:"?",final:"h"},d=>this.setModePrivate(d)),this._parser.registerCsiHandler({final:"l"},d=>this.resetMode(d)),this._parser.registerCsiHandler({prefix:"?",final:"l"},d=>this.resetModePrivate(d)),this._parser.registerCsiHandler({final:"m"},d=>this.charAttributes(d)),this._parser.registerCsiHandler({final:"n"},d=>this.deviceStatus(d)),this._parser.registerCsiHandler({prefix:"?",final:"n"},d=>this.deviceStatusPrivate(d)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},d=>this.softReset(d)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},d=>this.setCursorStyle(d)),this._parser.registerCsiHandler({final:"r"},d=>this.setScrollRegion(d)),this._parser.registerCsiHandler({final:"s"},d=>this.saveCursor(d)),this._parser.registerCsiHandler({final:"t"},d=>this.windowOptions(d)),this._parser.registerCsiHandler({final:"u"},d=>this.restoreCursor(d)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},d=>this.insertColumns(d)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},d=>this.deleteColumns(d)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},d=>this.selectProtected(d)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},d=>this.requestMode(d,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},d=>this.requestMode(d,!1)),this._parser.setExecuteHandler(he.BEL,()=>this.bell()),this._parser.setExecuteHandler(he.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(he.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(he.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(he.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(he.BS,()=>this.backspace()),this._parser.setExecuteHandler(he.HT,()=>this.tab()),this._parser.setExecuteHandler(he.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(he.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(Ld.IND,()=>this.index()),this._parser.setExecuteHandler(Ld.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(Ld.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new dr(d=>(this.setTitle(d),this.setIconName(d),!0))),this._parser.registerOscHandler(1,new dr(d=>this.setIconName(d))),this._parser.registerOscHandler(2,new dr(d=>this.setTitle(d))),this._parser.registerOscHandler(4,new dr(d=>this.setOrReportIndexedColor(d))),this._parser.registerOscHandler(8,new dr(d=>this.setHyperlink(d))),this._parser.registerOscHandler(10,new dr(d=>this.setOrReportFgColor(d))),this._parser.registerOscHandler(11,new dr(d=>this.setOrReportBgColor(d))),this._parser.registerOscHandler(12,new dr(d=>this.setOrReportCursorColor(d))),this._parser.registerOscHandler(104,new dr(d=>this.restoreIndexedColor(d))),this._parser.registerOscHandler(110,new dr(d=>this.restoreFgColor(d))),this._parser.registerOscHandler(111,new dr(d=>this.restoreBgColor(d))),this._parser.registerOscHandler(112,new dr(d=>this.restoreCursorColor(d))),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(let d in Zt)this._parser.registerEscHandler({intermediates:"(",final:d},()=>this.selectCharset("("+d)),this._parser.registerEscHandler({intermediates:")",final:d},()=>this.selectCharset(")"+d)),this._parser.registerEscHandler({intermediates:"*",final:d},()=>this.selectCharset("*"+d)),this._parser.registerEscHandler({intermediates:"+",final:d},()=>this.selectCharset("+"+d)),this._parser.registerEscHandler({intermediates:"-",final:d},()=>this.selectCharset("-"+d)),this._parser.registerEscHandler({intermediates:".",final:d},()=>this.selectCharset("."+d)),this._parser.registerEscHandler({intermediates:"/",final:d},()=>this.selectCharset("/"+d));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(d=>(this._logService.error("Parsing error: ",d),d)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new $C((d,m)=>this.requestStatusString(d,m)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,n,r){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=n,this._parseStack.position=r}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,n)=>setTimeout(()=>n("#SLOW_TIMEOUT"),KC))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${KC} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let n,r=this._activeBuffer.x,s=this._activeBuffer.y,l=0,a=this._parseStack.paused;if(a){if(n=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(n),n;r=this._parseStack.cursorStartX,s=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>js&&(l=this._parseStack.position+js)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,d=>String.fromCharCode(d)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(d=>d.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<js&&(this._parseBuffer=new Uint32Array(Math.min(e.length,js))),a||this._dirtyRowTracker.clearRange(),e.length>js)for(let d=l;d<e.length;d+=js){let m=d+js<e.length?d+js:e.length,p=typeof e=="string"?this._stringDecoder.decode(e.substring(d,m),this._parseBuffer):this._utf8Decoder.decode(e.subarray(d,m),this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,p))return this._preserveStack(r,s,p,d),this._logSlowResolvingAsync(n),n}else if(!a){let d=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,d))return this._preserveStack(r,s,d,0),this._logSlowResolvingAsync(n),n}(this._activeBuffer.x!==r||this._activeBuffer.y!==s)&&this._onCursorMove.fire();let u=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),h=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);h<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(h,this._bufferService.rows-1),end:Math.min(u,this._bufferService.rows-1)})}print(e,t,n){let r,s,l=this._charsetService.charset,a=this._optionsService.rawOptions.screenReaderMode,u=this._bufferService.cols,h=this._coreService.decPrivateModes.wraparound,d=this._coreService.modes.insertMode,m=this._curAttrData,p=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&n-t>0&&p.getWidth(this._activeBuffer.x-1)===2&&p.setCellFromCodepoint(this._activeBuffer.x-1,0,1,m);let _=this._parser.precedingJoinState;for(let b=t;b<n;++b){if(r=e[b],r<127&&l){let k=l[String.fromCharCode(r)];k&&(r=k.charCodeAt(0))}let S=this._unicodeService.charProperties(r,_);s=Do.extractWidth(S);let w=Do.extractShouldJoin(S),C=w?Do.extractWidth(_):0;if(_=S,a&&this._onA11yChar.fire(Fs(r)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+s-C>u){if(h){let k=p,T=this._activeBuffer.x-C;for(this._activeBuffer.x=C,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),p=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),C>0&&p instanceof Nc&&p.copyCellsFrom(k,T,0,C,!1);T<u;)k.setCellFromCodepoint(T++,0,1,m)}else if(this._activeBuffer.x=u-1,s===2)continue}if(w&&this._activeBuffer.x){let k=p.getWidth(this._activeBuffer.x-1)?1:2;p.addCodepointToCell(this._activeBuffer.x-k,r,s);for(let T=s-C;--T>=0;)p.setCellFromCodepoint(this._activeBuffer.x++,0,0,m);continue}if(d&&(p.insertCells(this._activeBuffer.x,s-C,this._activeBuffer.getNullCell(m)),p.getWidth(u-1)===2&&p.setCellFromCodepoint(u-1,0,1,m)),p.setCellFromCodepoint(this._activeBuffer.x++,r,s,m),s>0)for(;--s;)p.setCellFromCodepoint(this._activeBuffer.x++,0,0,m)}this._parser.precedingJoinState=_,this._activeBuffer.x<u&&n-t>0&&p.getWidth(this._activeBuffer.x)===0&&!p.hasContent(this._activeBuffer.x)&&p.setCellFromCodepoint(this._activeBuffer.x,0,1,m),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,n=>VC(n.params[0],this._optionsService.rawOptions.windowOptions)?t(n):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new $C(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new dr(t))}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 e;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&&((e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&e.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);t.hasWidth(this._activeBuffer.x)&&!t.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,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(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,n,r=!1,s=!1){let l=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);l.replaceCells(t,n,this._activeBuffer.getNullCell(this._eraseAttrData()),s),r&&(l.isWrapped=!1)}_resetBufferLine(e,t=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n&&(n.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),n.isWrapped=!1)}eraseInDisplay(e,t=!1){var r;this._restrictCursor(this._bufferService.cols);let n;switch(e.params[0]){case 0:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);n<this._bufferService.rows;n++)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(n);break;case 1:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(n+1).isWrapped=!1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(n=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,n-1);n--&&!((r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n))!=null&&r.getTrimmedLength()););for(;n>=0;n--)this._bufferService.scroll(this._eraseAttrData())}else{for(n=this._bufferService.rows,this._dirtyRowTracker.markDirty(n-1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let s=this._activeBuffer.lines.length-this._bufferService.rows;s>0&&(this._activeBuffer.lines.trimStart(s),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-s,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-s,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,s=this._bufferService.rows-1+this._activeBuffer.ybase-r+1;for(;t--;)this._activeBuffer.lines.splice(s-1,1),this._activeBuffer.lines.splice(n,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,r;for(r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r=this._bufferService.rows-1+this._activeBuffer.ybase-r;t--;)this._activeBuffer.lines.splice(n,1),this._activeBuffer.lines.splice(r,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)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(e){let t=e.params[0]||1;for(;t--;)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(Ut));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);r.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);r.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);r.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let n=this._activeBuffer.scrollTop;n<=this._activeBuffer.scrollBottom;++n){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+n);r.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),r.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let n=e.params[0]||1,r=Do.extractWidth(t),s=this._activeBuffer.x-r,l=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(s),a=new Uint32Array(l.length*n),u=0;for(let d=0;d<l.length;){let m=l.codePointAt(d)||0;a[u++]=m,d+=m>65535?2:1}let h=u;for(let d=1;d<n;++d)a.copyWithin(h,0,u),h+=u;return this.print(a,0,h),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(he.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(he.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(he.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(he.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(he.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,To),this._charsetService.setgCharset(1,To),this._charsetService.setgCharset(2,To),this._charsetService.setgCharset(3,To);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(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0;break}return!0}resetMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){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:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[t]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0);break}return!0}requestMode(e,t){(w=>(w[w.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",w[w.SET=1]="SET",w[w.RESET=2]="RESET",w[w.PERMANENTLY_SET=3]="PERMANENTLY_SET",w[w.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(void 0||(n={}));let r=this._coreService.decPrivateModes,{activeProtocol:s,activeEncoding:l}=this._coreMouseService,a=this._coreService,{buffers:u,cols:h}=this._bufferService,{active:d,alt:m}=u,p=this._optionsService.rawOptions,_=(w,C)=>(a.triggerDataEvent(`${he.ESC}[${t?"":"?"}${w};${C}$y`),!0),b=w=>w?1:2,S=e.params[0];return t?S===2?_(S,4):S===4?_(S,b(a.modes.insertMode)):S===12?_(S,3):S===20?_(S,b(p.convertEol)):_(S,0):S===1?_(S,b(r.applicationCursorKeys)):S===3?_(S,p.windowOptions.setWinLines?h===80?2:h===132?1:0:0):S===6?_(S,b(r.origin)):S===7?_(S,b(r.wraparound)):S===8?_(S,3):S===9?_(S,b(s==="X10")):S===12?_(S,b(p.cursorBlink)):S===25?_(S,b(!a.isCursorHidden)):S===45?_(S,b(r.reverseWraparound)):S===66?_(S,b(r.applicationKeypad)):S===67?_(S,4):S===1e3?_(S,b(s==="VT200")):S===1002?_(S,b(s==="DRAG")):S===1003?_(S,b(s==="ANY")):S===1004?_(S,b(r.sendFocus)):S===1005?_(S,4):S===1006?_(S,b(l==="SGR")):S===1015?_(S,4):S===1016?_(S,b(l==="SGR_PIXELS")):S===1048?_(S,1):S===47||S===1047||S===1049?_(S,b(d===m)):S===2004?_(S,b(r.bracketedPasteMode)):S===2026?_(S,b(r.synchronizedOutput)):_(S,0)}_updateAttrColor(e,t,n,r,s){return t===2?(e|=50331648,e&=-16777216,e|=Eu.fromColorRGB([n,r,s])):t===5&&(e&=-50331904,e|=33554432|n&255),e}_extractColor(e,t,n){let r=[0,0,-1,0,0,0],s=0,l=0;do{if(r[l+s]=e.params[t+l],e.hasSubParams(t+l)){let a=e.getSubParams(t+l),u=0;do r[1]===5&&(s=1),r[l+u+1+s]=a[u];while(++u<a.length&&u+l+1+s<r.length);break}if(r[1]===5&&l+s>=2||r[1]===2&&l+s>=5)break;r[1]&&(s=1)}while(++l+t<e.length&&l+s<r.length);for(let a=2;a<r.length;++a)r[a]===-1&&(r[a]=0);switch(r[0]){case 38:n.fg=this._updateAttrColor(n.fg,r[1],r[3],r[4],r[5]);break;case 48:n.bg=this._updateAttrColor(n.bg,r[1],r[3],r[4],r[5]);break;case 58:n.extended=n.extended.clone(),n.extended.underlineColor=this._updateAttrColor(n.extended.underlineColor,r[1],r[3],r[4],r[5])}return l}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=Ut.fg,e.bg=Ut.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,n,r=this._curAttrData;for(let s=0;s<t;s++)n=e.params[s],n>=30&&n<=37?(r.fg&=-50331904,r.fg|=16777216|n-30):n>=40&&n<=47?(r.bg&=-50331904,r.bg|=16777216|n-40):n>=90&&n<=97?(r.fg&=-50331904,r.fg|=16777216|n-90|8):n>=100&&n<=107?(r.bg&=-50331904,r.bg|=16777216|n-100|8):n===0?this._processSGR0(r):n===1?r.fg|=134217728:n===3?r.bg|=67108864:n===4?(r.fg|=268435456,this._processUnderline(e.hasSubParams(s)?e.getSubParams(s)[0]:1,r)):n===5?r.fg|=536870912:n===7?r.fg|=67108864:n===8?r.fg|=1073741824:n===9?r.fg|=2147483648:n===2?r.bg|=134217728:n===21?this._processUnderline(2,r):n===22?(r.fg&=-134217729,r.bg&=-134217729):n===23?r.bg&=-67108865:n===24?(r.fg&=-268435457,this._processUnderline(0,r)):n===25?r.fg&=-536870913:n===27?r.fg&=-67108865:n===28?r.fg&=-1073741825:n===29?r.fg&=2147483647:n===39?(r.fg&=-67108864,r.fg|=Ut.fg&16777215):n===49?(r.bg&=-67108864,r.bg|=Ut.bg&16777215):n===38||n===48||n===58?s+=this._extractColor(e,s,r):n===53?r.bg|=1073741824:n===55?r.bg&=-1073741825:n===59?(r.extended=r.extended.clone(),r.extended.underlineColor=-1,r.updateExtended()):n===100?(r.fg&=-67108864,r.fg|=Ut.fg&16777215,r.bg&=-67108864,r.bg|=Ut.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",n);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${he.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${he.ESC}[${t};${n}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let t=this._activeBuffer.y+1,n=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${he.ESC}[?${t};${n}R`);break}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=Ut.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(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let n=t%2===1;this._coreService.decPrivateModes.cursorBlink=n}return!0}setScrollRegion(e){let t=e.params[0]||1,n;return(e.length<2||(n=e.params[1])>this._bufferService.rows||n===0)&&(n=this._bufferService.rows),n>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=n-1,this._setCursor(0,0)),!0}windowOptions(e){if(!VC(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${he.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>qC&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>qC&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){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(e){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(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],n=e.split(";");for(;n.length>1;){let r=n.shift(),s=n.shift();if(/^\d+$/.exec(r)){let l=parseInt(r);if(YC(l))if(s==="?")t.push({type:0,index:l});else{let a=WC(s);a&&t.push({type:1,index:l,color:a})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let n=e.slice(0,t).trim(),r=e.slice(t+1);return r?this._createHyperlink(n,r):n.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let n=e.split(":"),r,s=n.findIndex(l=>l.startsWith("id="));return s!==-1&&(r=n[s].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:r,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let n=e.split(";");for(let r=0;r<n.length&&!(t>=this._specialColors.length);++r,++t)if(n[r]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let s=WC(n[r]);s&&this._onColor.fire([{type:1,index:this._specialColors[t],color:s}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],n=e.split(";");for(let r=0;r<n.length;++r)if(/^\d+$/.exec(n[r])){let s=parseInt(n[r]);YC(s)&&t.push({type:2,index:s})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){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,To),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(tU[e[0]],Zt[e[1]]||To),!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){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,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=Ut.clone(),this._eraseAttrDataInternal=Ut.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new jr;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let n=this._activeBuffer.ybase+this._activeBuffer.y+t,r=this._activeBuffer.lines.get(n);r&&(r.fill(e),r.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let n=a=>(this._coreService.triggerDataEvent(`${he.ESC}${a}${he.ESC}\\`),!0),r=this._bufferService.buffer,s=this._optionsService.rawOptions;return n(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${r.scrollTop+1};${r.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[s.cursorStyle]-(s.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},x_=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(GC=e,e=t,t=GC),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};x_=Mt([_e(0,Pn)],x_);function YC(e){return 0<=e&&e<256}var rU=5e7,XC=12,iU=50,sU=class extends Fe{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new ge),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let n;for(;n=this._writeBuffer.shift();){this._action(n);let r=this._callbacks.shift();r&&r()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>rU)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let n=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let r=this._writeBuffer[this._bufferOffset],s=this._action(r,t);if(s){let a=u=>performance.now()-n>=XC?setTimeout(()=>this._innerWrite(0,u)):this._innerWrite(n,u);s.catch(u=>(queueMicrotask(()=>{throw u}),Promise.resolve(!1))).then(a);return}let l=this._callbacks[this._bufferOffset];if(l&&l(),this._bufferOffset++,this._pendingData-=r.length,performance.now()-n>=XC)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>iU&&(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()}},S_=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let u=t.addMarker(t.ybase+t.y),h={data:e,id:this._nextId++,lines:[u]};return u.onDispose(()=>this._removeMarkerFromLink(h,u)),this._dataByLinkId.set(h.id,h),h.id}let n=e,r=this._getEntryIdKey(n),s=this._entriesWithId.get(r);if(s)return this.addLineToLink(s.id,t.ybase+t.y),s.id;let l=t.addMarker(t.ybase+t.y),a={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[l]};return l.onDispose(()=>this._removeMarkerFromLink(a,l)),this._entriesWithId.set(a.key,a),this._dataByLinkId.set(a.id,a),a.id}addLineToLink(e,t){let n=this._dataByLinkId.get(e);if(n&&n.lines.every(r=>r.line!==t)){let r=this._bufferService.buffer.addMarker(t);n.lines.push(r),r.onDispose(()=>this._removeMarkerFromLink(n,r))}}getLinkData(e){var t;return(t=this._dataByLinkId.get(e))==null?void 0:t.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let n=e.lines.indexOf(t);n!==-1&&(e.lines.splice(n,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};S_=Mt([_e(0,Pn)],S_);var ZC=!1,oU=class extends Fe{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new la),this._onBinary=this._register(new ge),this.onBinary=this._onBinary.event,this._onData=this._register(new ge),this.onData=this._onData.event,this._onLineFeed=this._register(new ge),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new ge),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new ge),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new ge),this._instantiationService=new AF,this.optionsService=this._register(new HF(e)),this._instantiationService.setService(In,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(v_)),this._instantiationService.setService(Pn,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(g_)),this._instantiationService.setService(vT,this._logService),this.coreService=this._register(this._instantiationService.createInstance(__)),this._instantiationService.setService(Ko,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(y_)),this._instantiationService.setService(gT,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Do)),this._instantiationService.setService(E7,this.unicodeService),this._charsetService=this._instantiationService.createInstance(qF),this._instantiationService.setService(k7,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(S_),this._instantiationService.setService(_T,this._oscLinkService),this._inputHandler=this._register(new nU(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(Cn.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(Cn.forward(this._bufferService.onResize,this._onResize)),this._register(Cn.forward(this.coreService.onData,this._onData)),this._register(Cn.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),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}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new sU((t,n)=>this._inputHandler.parse(t,n))),this._register(Cn.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new ge),this._onScroll.event(e=>{var t;(t=this._onScrollApi)==null||t.fire(e.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(e){for(let t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!ZC&&(this._logService.warn("writeSync is unreliable and will be removed soon."),ZC=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,XT),t=Math.max(t,ZT),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend==="conpty"&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(UC.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(UC(this._bufferService),!1))),this._windowsWrappingHeuristics.value=yt(()=>{for(let t of e)t.dispose()})}}},lU={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:["'",'"']};function aU(e,t,n,r){var a;let s={type:0,cancel:!1,key:void 0},l=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?s.key=he.ESC+"OA":s.key=he.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?s.key=he.ESC+"OD":s.key=he.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?s.key=he.ESC+"OC":s.key=he.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?s.key=he.ESC+"OB":s.key=he.ESC+"[B");break;case 8:s.key=e.ctrlKey?"\b":he.DEL,e.altKey&&(s.key=he.ESC+s.key);break;case 9:if(e.shiftKey){s.key=he.ESC+"[Z";break}s.key=he.HT,s.cancel=!0;break;case 13:s.key=e.altKey?he.ESC+he.CR:he.CR,s.cancel=!0;break;case 27:s.key=he.ESC,e.altKey&&(s.key=he.ESC+he.ESC),s.cancel=!0;break;case 37:if(e.metaKey)break;l?s.key=he.ESC+"[1;"+(l+1)+"D":t?s.key=he.ESC+"OD":s.key=he.ESC+"[D";break;case 39:if(e.metaKey)break;l?s.key=he.ESC+"[1;"+(l+1)+"C":t?s.key=he.ESC+"OC":s.key=he.ESC+"[C";break;case 38:if(e.metaKey)break;l?s.key=he.ESC+"[1;"+(l+1)+"A":t?s.key=he.ESC+"OA":s.key=he.ESC+"[A";break;case 40:if(e.metaKey)break;l?s.key=he.ESC+"[1;"+(l+1)+"B":t?s.key=he.ESC+"OB":s.key=he.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(s.key=he.ESC+"[2~");break;case 46:l?s.key=he.ESC+"[3;"+(l+1)+"~":s.key=he.ESC+"[3~";break;case 36:l?s.key=he.ESC+"[1;"+(l+1)+"H":t?s.key=he.ESC+"OH":s.key=he.ESC+"[H";break;case 35:l?s.key=he.ESC+"[1;"+(l+1)+"F":t?s.key=he.ESC+"OF":s.key=he.ESC+"[F";break;case 33:e.shiftKey?s.type=2:e.ctrlKey?s.key=he.ESC+"[5;"+(l+1)+"~":s.key=he.ESC+"[5~";break;case 34:e.shiftKey?s.type=3:e.ctrlKey?s.key=he.ESC+"[6;"+(l+1)+"~":s.key=he.ESC+"[6~";break;case 112:l?s.key=he.ESC+"[1;"+(l+1)+"P":s.key=he.ESC+"OP";break;case 113:l?s.key=he.ESC+"[1;"+(l+1)+"Q":s.key=he.ESC+"OQ";break;case 114:l?s.key=he.ESC+"[1;"+(l+1)+"R":s.key=he.ESC+"OR";break;case 115:l?s.key=he.ESC+"[1;"+(l+1)+"S":s.key=he.ESC+"OS";break;case 116:l?s.key=he.ESC+"[15;"+(l+1)+"~":s.key=he.ESC+"[15~";break;case 117:l?s.key=he.ESC+"[17;"+(l+1)+"~":s.key=he.ESC+"[17~";break;case 118:l?s.key=he.ESC+"[18;"+(l+1)+"~":s.key=he.ESC+"[18~";break;case 119:l?s.key=he.ESC+"[19;"+(l+1)+"~":s.key=he.ESC+"[19~";break;case 120:l?s.key=he.ESC+"[20;"+(l+1)+"~":s.key=he.ESC+"[20~";break;case 121:l?s.key=he.ESC+"[21;"+(l+1)+"~":s.key=he.ESC+"[21~";break;case 122:l?s.key=he.ESC+"[23;"+(l+1)+"~":s.key=he.ESC+"[23~";break;case 123:l?s.key=he.ESC+"[24;"+(l+1)+"~":s.key=he.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?s.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?s.key=he.NUL:e.keyCode>=51&&e.keyCode<=55?s.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?s.key=he.DEL:e.keyCode===219?s.key=he.ESC:e.keyCode===220?s.key=he.FS:e.keyCode===221&&(s.key=he.GS);else if((!n||r)&&e.altKey&&!e.metaKey){let u=(a=lU[e.keyCode])==null?void 0:a[e.shiftKey?1:0];if(u)s.key=he.ESC+u;else if(e.keyCode>=65&&e.keyCode<=90){let h=e.ctrlKey?e.keyCode-64:e.keyCode+32,d=String.fromCharCode(h);e.shiftKey&&(d=d.toUpperCase()),s.key=he.ESC+d}else if(e.keyCode===32)s.key=he.ESC+(e.ctrlKey?he.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let h=e.code.slice(3,4);e.shiftKey||(h=h.toLowerCase()),s.key=he.ESC+h,s.cancel=!0}}else n&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(s.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?s.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(s.key=he.US),e.key==="@"&&(s.key=he.NUL));break}return s}var zt=0,cU=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new sf,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new sf,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((s,l)=>this._getKey(s)-this._getKey(l)),t=0,n=0,r=new Array(this._array.length+this._insertedValues.length);for(let s=0;s<r.length;s++)n>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[n])?(r[s]=e[t],t++):r[s]=this._array[n++];this._array=r,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(zt=this._search(t),zt===-1)||this._getKey(this._array[zt])!==t)return!1;do if(this._array[zt]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(zt),!0;while(++zt<this._array.length&&this._getKey(this._array[zt])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((s,l)=>s-l),t=0,n=new Array(this._array.length-e.length),r=0;for(let s=0;s<this._array.length;s++)e[t]===s?t++:n[r++]=this._array[s];this._array=n,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(zt=this._search(e),!(zt<0||zt>=this._array.length)&&this._getKey(this._array[zt])===e))do yield this._array[zt];while(++zt<this._array.length&&this._getKey(this._array[zt])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(zt=this._search(e),!(zt<0||zt>=this._array.length)&&this._getKey(this._array[zt])===e))do t(this._array[zt]);while(++zt<this._array.length&&this._getKey(this._array[zt])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,n=this._array.length-1;for(;n>=t;){let r=t+n>>1,s=this._getKey(this._array[r]);if(s>e)n=r-1;else if(s<e)t=r+1;else{for(;r>0&&this._getKey(this._array[r-1])===e;)r--;return r}}return t}},Vg=0,QC=0,uU=class extends Fe{constructor(){super(),this._decorations=new cU(e=>e==null?void 0:e.marker.line),this._onDecorationRegistered=this._register(new ge),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new ge),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(yt(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new hU(e);if(t){let n=t.marker.onDispose(()=>t.dispose()),r=t.onDispose(()=>{r.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),n.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,n){let r=0,s=0;for(let l of this._decorations.getKeyIterator(t))r=l.options.x??0,s=r+(l.options.width??1),e>=r&&e<s&&(!n||(l.options.layer??"bottom")===n)&&(yield l)}forEachDecorationAtCell(e,t,n,r){this._decorations.forEachByKey(t,s=>{Vg=s.options.x??0,QC=Vg+(s.options.width??1),e>=Vg&&e<QC&&(!n||(s.options.layer??"bottom")===n)&&r(s)})}},hU=class extends Vs{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new ge),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new ge),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=St.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=St.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},dU=1e3,fU=class{constructor(e,t=dU){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,n){this._rowCount=n,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t;let r=performance.now();if(r-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=r,this._innerRefresh();else if(!this._additionalRefreshRequested){let s=r-this._lastRefreshMs,l=this._debounceThresholdMS-s;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},l)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},JC=20,of=class extends Fe{constructor(e,t,n,r){super(),this._terminal=e,this._coreBrowserService=n,this._renderService=r,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let s=this._coreBrowserService.mainDocument;this._accessibilityContainer=s.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=s.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let l=0;l<this._terminal.rows;l++)this._rowElements[l]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[l]);if(this._topBoundaryFocusListener=l=>this._handleBoundaryFocus(l,0),this._bottomBoundaryFocusListener=l=>this._handleBoundaryFocus(l,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=s.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new fU(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(l=>this._handleResize(l.rows))),this._register(this._terminal.onRender(l=>this._refreshRows(l.start,l.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(l=>this._handleChar(l))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
445
|
-
`))),this._register(this._terminal.onA11yTab(l=>this._handleTab(l))),this._register(this._terminal.onKey(l=>this._handleKey(l.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(Oe(s,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(yt(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<JC+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
446
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===JC+1&&(this._liveRegion.textContent+=Uv.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let n=this._terminal.buffer,r=n.lines.length.toString();for(let s=e;s<=t;s++){let l=n.lines.get(n.ydisp+s),a=[],u=(l==null?void 0:l.translateToString(!0,void 0,void 0,a))||"",h=(n.ydisp+s+1).toString(),d=this._rowElements[s];d&&(u.length===0?(d.textContent=" ",this._rowColumns.set(d,[0,1])):(d.textContent=u,this._rowColumns.set(d,a)),d.setAttribute("aria-posinset",h),d.setAttribute("aria-setsize",r),this._alignRowWidth(d))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let n=e.target,r=this._rowElements[t===0?1:this._rowElements.length-2],s=n.getAttribute("aria-posinset"),l=t===0?"1":`${this._terminal.buffer.lines.length}`;if(s===l||e.relatedTarget!==r)return;let a,u;if(t===0?(a=n,u=this._rowElements.pop(),this._rowContainer.removeChild(u)):(a=this._rowElements.shift(),u=n,this._rowContainer.removeChild(a)),a.removeEventListener("focus",this._topBoundaryFocusListener),u.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let h=this._createAccessibilityTreeNode();this._rowElements.unshift(h),this._rowContainer.insertAdjacentElement("afterbegin",h)}else{let h=this._createAccessibilityTreeNode();this._rowElements.push(h),this._rowContainer.appendChild(h)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){var u;if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let t={node:e.anchorNode,offset:e.anchorOffset},n={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===n.node&&t.offset>n.offset)&&([t,n]=[n,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let r=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(r)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:r,offset:((u=r.textContent)==null?void 0:u.length)??0}),!this._rowContainer.contains(n.node))return;let s=({node:h,offset:d})=>{let m=h instanceof Text?h.parentNode:h,p=parseInt(m==null?void 0:m.getAttribute("aria-posinset"),10)-1;if(isNaN(p))return console.warn("row is invalid. Race condition?"),null;let _=this._rowColumns.get(m);if(!_)return console.warn("columns is null. Race condition?"),null;let b=d<_.length?_[d]:_.slice(-1)[0]+1;return b>=this._terminal.cols&&(++p,b=0),{row:p,column:b}},l=s(t),a=s(n);if(!(!l||!a)){if(l.row>a.row||l.row===a.row&&l.column>=a.column)throw new Error("invalid range");this._terminal.select(l.column,l.row,(a.row-l.row)*this._terminal.cols-l.column+a.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){var s,l;e.style.transform="";let t=e.getBoundingClientRect().width,n=(l=(s=this._rowColumns.get(e))==null?void 0:s.slice(-1))==null?void 0:l[0];if(!n)return;let r=n*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${r/t})`}};of=Mt([_e(1,Zy),_e(2,is),_e(3,ss)],of);var w_=class extends Fe{constructor(e,t,n,r,s){super(),this._element=e,this._mouseService=t,this._renderService=n,this._bufferService=r,this._linkProviderService=s,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new ge),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new ge),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(yt(()=>{var l;Io(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,(l=this._activeProviderReplies)==null||l.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(Oe(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Oe(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(Oe(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(Oe(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let n=e.composedPath();for(let r=0;r<n.length;r++){let s=n[r];if(s.classList.contains("xterm"))break;if(s.classList.contains("xterm-hover"))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){var r,s;(!this._activeProviderReplies||!t)&&((r=this._activeProviderReplies)==null||r.forEach(l=>{l==null||l.forEach(a=>{a.link.dispose&&a.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(let[l,a]of this._linkProviderService.linkProviders.entries())t?(s=this._activeProviderReplies)!=null&&s.get(l)&&(n=this._checkLinkProviderResult(l,e,n)):a.provideLinks(e.y,u=>{var d,m;if(this._isMouseOut)return;let h=u==null?void 0:u.map(p=>({link:p}));(d=this._activeProviderReplies)==null||d.set(l,h),n=this._checkLinkProviderResult(l,e,n),((m=this._activeProviderReplies)==null?void 0:m.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let n=new Set;for(let r=0;r<t.size;r++){let s=t.get(r);if(s)for(let l=0;l<s.length;l++){let a=s[l],u=a.link.range.start.y<e?0:a.link.range.start.x,h=a.link.range.end.y>e?this._bufferService.cols:a.link.range.end.x;for(let d=u;d<=h;d++){if(n.has(d)){s.splice(l--,1);break}n.add(d)}}}}_checkLinkProviderResult(e,t,n){var l;if(!this._activeProviderReplies)return n;let r=this._activeProviderReplies.get(e),s=!1;for(let a=0;a<e;a++)(!this._activeProviderReplies.has(a)||this._activeProviderReplies.get(a))&&(s=!0);if(!s&&r){let a=r.find(u=>this._linkAtPosition(u.link,t));a&&(n=!0,this._handleNewLink(a))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let a=0;a<this._activeProviderReplies.size;a++){let u=(l=this._activeProviderReplies.get(a))==null?void 0:l.find(h=>this._linkAtPosition(h.link,t));if(u){n=!0,this._handleNewLink(u);break}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&pU(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,Io(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>{var n,r;return(r=(n=this._currentLink)==null?void 0:n.state)==null?void 0:r.decorations.pointerCursor},set:n=>{var r;(r=this._currentLink)!=null&&r.state&&this._currentLink.state.decorations.pointerCursor!==n&&(this._currentLink.state.decorations.pointerCursor=n,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",n))}},underline:{get:()=>{var n,r;return(r=(n=this._currentLink)==null?void 0:n.state)==null?void 0:r.decorations.underline},set:n=>{var r,s,l;(r=this._currentLink)!=null&&r.state&&((l=(s=this._currentLink)==null?void 0:s.state)==null?void 0:l.decorations.underline)!==n&&(this._currentLink.state.decorations.underline=n,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,n))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(n=>{if(!this._currentLink)return;let r=n.start===0?0:n.start+1+this._bufferService.buffer.ydisp,s=this._bufferService.buffer.ydisp+1+n.end;if(this._currentLink.link.range.start.y>=r&&this._currentLink.link.range.end.y<=s&&(this._clearCurrentLink(r,s),this._lastMouseEvent)){let l=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);l&&this._askForLink(l,!1)}})))}_linkHover(e,t,n){var r;(r=this._currentLink)!=null&&r.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(n,t.text)}_fireUnderlineEvent(e,t){let n=e.range,r=this._bufferService.buffer.ydisp,s=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-r-1,n.end.x,n.end.y-r-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(s)}_linkLeave(e,t,n){var r;(r=this._currentLink)!=null&&r.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(n,t.text)}_linkAtPosition(e,t){let n=e.range.start.y*this._bufferService.cols+e.range.start.x,r=e.range.end.y*this._bufferService.cols+e.range.end.x,s=t.y*this._bufferService.cols+t.x;return n<=s&&s<=r}_positionFromMouseEvent(e,t,n){let r=n.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(r)return{x:r[0],y:r[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,n,r,s){return{x1:e,y1:t,x2:n,y2:r,cols:this._bufferService.cols,fg:s}}};w_=Mt([_e(1,Qy),_e(2,ss),_e(3,Pn),_e(4,bT)],w_);function pU(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var mU=class extends oU{constructor(e={}){super(e),this._linkifier=this._register(new la),this.browser=IT,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new la),this._onCursorMove=this._register(new ge),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new ge),this.onKey=this._onKey.event,this._onRender=this._register(new ge),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new ge),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new ge),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new ge),this.onBell=this._onBell.event,this._onFocus=this._register(new ge),this._onBlur=this._register(new ge),this._onA11yCharEmitter=this._register(new ge),this._onA11yTabEmitter=this._register(new ge),this._onWillOpen=this._register(new ge),this._setup(),this._decorationService=this._instantiationService.createInstance(uU),this._instantiationService.setService(Ru,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(iF),this._instantiationService.setService(bT,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(Wv)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh((t==null?void 0:t.start)??0,(t==null?void 0:t.end)??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(t=>this._reportWindowsOptions(t))),this._register(this._inputHandler.onColor(t=>this._handleColorEvent(t))),this._register(Cn.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(Cn.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(Cn.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(Cn.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(yt(()=>{var t,n;this._customKeyEventHandler=void 0,(n=(t=this.element)==null?void 0:t.parentNode)==null||n.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}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}_handleColorEvent(e){if(this._themeService)for(let t of e){let n,r="";switch(t.index){case 256:n="foreground",r="10";break;case 257:n="background",r="11";break;case 258:n="cursor",r="12";break;default:n="ansi",r="4;"+t.index}switch(t.type){case 0:let s=vt.toColorRGB(n==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[n]);this.coreService.triggerDataEvent(`${he.ESC}]${r};${eU(s)}${jT.ST}`);break;case 1:if(n==="ansi")this._themeService.modifyColors(l=>l.ansi[t.index]=$t.toColor(...t.color));else{let l=n;this._themeService.modifyColors(a=>a[l]=$t.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(of,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(he.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var e;return(e=this.textarea)==null?void 0:e.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(he.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let n=Math.min(this.buffer.x,this.cols-1),r=this._renderService.dimensions.css.cell.height,s=t.getWidth(n),l=this._renderService.dimensions.css.cell.width*s,a=this.buffer.y*this._renderService.dimensions.css.cell.height,u=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=u+"px",this.textarea.style.top=a+"px",this.textarea.style.width=l+"px",this.textarea.style.height=r+"px",this.textarea.style.lineHeight=r+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(Oe(this.element,"copy",t=>{this.hasSelection()&&y7(t,this._selectionService)}));let e=t=>b7(t,this.textarea,this.coreService,this.optionsService);this._register(Oe(this.textarea,"paste",e)),this._register(Oe(this.element,"paste",e)),HT?this._register(Oe(this.element,"mousedown",t=>{t.button===2&&cC(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Oe(this.element,"contextmenu",t=>{cC(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),ob&&this._register(Oe(this.element,"auxclick",t=>{t.button===1&&hT(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Oe(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(Oe(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(Oe(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(Oe(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(Oe(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(Oe(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(Oe(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){var s;if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((s=this.element)==null?void 0:s.ownerDocument.defaultView)&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.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"),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(Oe(this.screenElement,"mousemove",l=>this.updateCursorStyle(l))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let n=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",Fv.get()),$T||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._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>n.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(nF,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(is,this._coreBrowserService),this._register(Oe(this.textarea,"focus",l=>this._handleTextAreaFocus(l))),this._register(Oe(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(h_,this._document,this._helperContainer),this._instantiationService.setService(Pf,this._charSizeService),this._themeService=this._instantiationService.createInstance(m_),this._instantiationService.setService(va,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(nf),this._instantiationService.setService(yT,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(f_,this.rows,this.screenElement)),this._instantiationService.setService(ss,this._renderService),this._register(this._renderService.onRenderedViewportChange(l=>this._onRender.fire(l))),this.onResize(l=>this._renderService.resize(l.cols,l.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(a_,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(d_),this._instantiationService.setService(Qy,this._mouseService);let r=this._linkifier.value=this._register(this._instantiationService.createInstance(w_,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),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._viewport=this._register(this._instantiationService.createInstance(o_,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(l=>{super.scrollLines(l,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(p_,this.element,this.screenElement,r)),this._instantiationService.setService(M7,this._selectionService),this._register(this._selectionService.onRequestScrollLines(l=>this.scrollLines(l.amount,l.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(l=>this._renderService.handleSelectionChanged(l.start,l.end,l.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(l=>{this.textarea.value=l,this.textarea.focus(),this.textarea.select()})),this._register(Cn.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{var l;this._selectionService.refresh(),(l=this._viewport)==null||l.queueSync()})),this._register(this._instantiationService.createInstance(l_,this.screenElement)),this._register(Oe(this.element,"mousedown",l=>this._selectionService.handleMouseDown(l))),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(of,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",l=>this._handleScreenReaderModeOptionChange(l))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(tf,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",l=>{!this._overviewRulerRenderer&&l&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(tf,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(u_,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function n(l){var d,m,p,_,b;let a=e._mouseService.getMouseReportCoords(l,e.screenElement);if(!a)return!1;let u,h;switch(l.overrideType||l.type){case"mousemove":h=32,l.buttons===void 0?(u=3,l.button!==void 0&&(u=l.button<3?l.button:3)):u=l.buttons&1?0:l.buttons&4?1:l.buttons&2?2:3;break;case"mouseup":h=0,u=l.button<3?l.button:3;break;case"mousedown":h=1,u=l.button<3?l.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(l)===!1)return!1;let S=l.deltaY;if(S===0||e.coreMouseService.consumeWheelEvent(l,(_=(p=(m=(d=e._renderService)==null?void 0:d.dimensions)==null?void 0:m.device)==null?void 0:p.cell)==null?void 0:_.height,(b=e._coreBrowserService)==null?void 0:b.dpr)===0)return!1;h=S<0?0:1,u=4;break;default:return!1}return h===void 0||u===void 0||u>4?!1:e.coreMouseService.triggerMouseEvent({col:a.col,row:a.row,x:a.x,y:a.y,button:u,action:h,ctrl:l.ctrlKey,alt:l.altKey,shift:l.shiftKey})}let r={mouseup:null,wheel:null,mousedrag:null,mousemove:null},s={mouseup:l=>(n(l),l.buttons||(this._document.removeEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.removeEventListener("mousemove",r.mousedrag)),this.cancel(l)),wheel:l=>(n(l),this.cancel(l,!0)),mousedrag:l=>{l.buttons&&n(l)},mousemove:l=>{l.buttons||n(l)}};this._register(this.coreMouseService.onProtocolChange(l=>{l?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(l)),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()),l&8?r.mousemove||(t.addEventListener("mousemove",s.mousemove),r.mousemove=s.mousemove):(t.removeEventListener("mousemove",r.mousemove),r.mousemove=null),l&16?r.wheel||(t.addEventListener("wheel",s.wheel,{passive:!1}),r.wheel=s.wheel):(t.removeEventListener("wheel",r.wheel),r.wheel=null),l&2?r.mouseup||(r.mouseup=s.mouseup):(this._document.removeEventListener("mouseup",r.mouseup),r.mouseup=null),l&4?r.mousedrag||(r.mousedrag=s.mousedrag):(this._document.removeEventListener("mousemove",r.mousedrag),r.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Oe(t,"mousedown",l=>{if(l.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(l)))return n(l),r.mouseup&&this._document.addEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.addEventListener("mousemove",r.mousedrag),this.cancel(l)})),this._register(Oe(t,"wheel",l=>{var a,u,h,d,m;if(!r.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(l)===!1)return!1;if(!this.buffer.hasScrollback){if(l.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(l,(d=(h=(u=(a=e._renderService)==null?void 0:a.dimensions)==null?void 0:u.device)==null?void 0:h.cell)==null?void 0:d.height,(m=e._coreBrowserService)==null?void 0:m.dpr)===0)return this.cancel(l,!0);let p=he.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(l.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(p,!0),this.cancel(l,!0)}}},{passive:!1}))}refresh(e,t){var n;(n=this._renderService)==null||n.refreshRows(e,t)}updateCursorStyle(e){var t;(t=this._selectionService)!=null&&t.shouldColumnSelect(e)?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(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){uT(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,n){this._selectionService.setSelection(e,t,n)}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 e;(e=this._selectionService)==null||e.clearSelection()}selectAll(){var e;(e=this._selectionService)==null||e.selectAll()}selectLines(e,t){var n;(n=this._selectionService)==null||n.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let n=aU(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),n.type===3||n.type===2){let r=this.rows-1;return this.scrollLines(n.type===2?-r:r),this.cancel(e,!0)}if(n.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(n.cancel&&this.cancel(e,!0),!n.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((n.key===he.ETX||n.key===he.CR)&&(this.textarea.value=""),this._onKey.fire({key:n.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(n.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let n=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return t.type==="keypress"?n:n&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(gU(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){var n;(n=this._charSizeService)==null||n.measure()}clear(){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 e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(Ut));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){var t;this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),(t=this._selectionService)==null||t.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){var e;(e=this._renderService)==null||e.clearTextureAtlas()}_reportFocus(){var e;(e=this.element)!=null&&e.classList.contains("focus")?this.coreService.triggerDataEvent(he.ESC+"[I"):this.coreService.triggerDataEvent(he.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),n=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${he.ESC}[4;${n};${t}t`);break;case 1:let r=this._renderService.dimensions.css.cell.width.toFixed(0),s=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${he.ESC}[6;${s};${r}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function gU(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var vU=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let n={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(n),t.dispose=()=>this._wrappedAddonDispose(n),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let n=0;n<this._addons.length;n++)if(this._addons[n]===e){t=n;break}if(t===-1)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},_U=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new jr)}translateToString(e,t,n){return this._line.translateToString(e,t,n)}},e2=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,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(e){let t=this._buffer.lines.get(e);if(t)return new _U(t)}getNullCell(){return new jr}},yU=class extends Fe{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new ge),this.onBufferChange=this._onBufferChange.event,this._normal=new e2(this._core.buffers.normal,"normal"),this._alternate=new e2(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)}},bU=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,n=>t(n.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(n,r)=>t(n,r.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},xU=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},SU=["cols","rows"],ci=0,wU=class extends Fe{constructor(e){super(),this._core=this._register(new mU(e)),this._addonManager=this._register(new vU),this._publicOptions={...this._core.options};let t=r=>this._core.options[r],n=(r,s)=>{this._checkReadonlyOptions(r),this._core.options[r]=s};for(let r in this._core.options){let s={get:t.bind(this,r),set:n.bind(this,r)};Object.defineProperty(this._publicOptions,r,s)}}_checkReadonlyOptions(e){if(SU.includes(e))throw new Error(`Option "${e}" 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 bU(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new xU(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 yU(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,n){this._verifyIntegers(e,t,n),this._core.select(e,t,n)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
|
|
447
|
-
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return Fv.get()},set promptLabel(e){Fv.set(e)},get tooMuchOutput(){return Uv.get()},set tooMuchOutput(e){Uv.set(e)}}}_verifyIntegers(...e){for(ci of e)if(ci===1/0||isNaN(ci)||ci%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(ci of e)if(ci&&(ci===1/0||isNaN(ci)||ci%1!==0||ci<0))throw new Error("This API only accepts positive integers")}};const JT="lever-theme",e5=x.createContext(void 0),CU=e=>e==="light"||e==="dark"||e==="system",t5=()=>typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",t2=e=>{if(typeof document>"u")return;const t=e==="system"?t5():e;document.documentElement.classList.toggle("dark",t==="dark")},kU=()=>{if(typeof window>"u")return"system";const e=window.localStorage.getItem(JT);return CU(e)?e:"system"};function EU({children:e}){const[t,n]=x.useState(kU);x.useEffect(()=>{t2(t),typeof window<"u"&&window.localStorage.setItem(JT,t)},[t]),x.useEffect(()=>{if(t!=="system")return;const s=window.matchMedia("(prefers-color-scheme: dark)"),l=()=>t2("system");return s.addEventListener?(s.addEventListener("change",l),()=>s.removeEventListener("change",l)):(s.addListener(l),()=>s.removeListener(l))},[t]);const r=x.useMemo(()=>{const s=t==="system"?t5():t;return{theme:t,resolvedTheme:s,setTheme:n}},[t]);return v.jsx(e5.Provider,{value:r,children:e})}function RU(){const e=x.useContext(e5);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}const MU={foreground:"#0f172a",background:"transparent",cursor:"rgba(15,23,42,0.5)",cursorAccent:"#ffffff",selectionBackground:"rgba(221,228,236,0.55)",selectionInactiveBackground:"rgba(221,228,236,0.38)",black:"#0f172a",red:"#dc2626",green:"#16a34a",yellow:"#ca8a04",blue:"#2563eb",magenta:"#9333ea",cyan:"#0891b2",white:"#94a3b8",brightBlack:"#475569",brightRed:"#ef4444",brightGreen:"#22c55e",brightYellow:"#eab308",brightBlue:"#3b82f6",brightMagenta:"#a855f7",brightCyan:"#06b6d4",brightWhite:"#e2e8f0"},TU={foreground:"#f8fafc",background:"transparent",cursor:"rgba(248,250,252,0.5)",cursorAccent:"#0f172a",selectionBackground:"rgba(248,250,252,0.28)",selectionInactiveBackground:"rgba(248,250,252,0.18)",black:"#0f172a",red:"#f87171",green:"#4ade80",yellow:"#facc15",blue:"#60a5fa",magenta:"#c084fc",cyan:"#22d3ee",white:"#cbd5e1",brightBlack:"#64748b",brightRed:"#fca5a5",brightGreen:"#86efac",brightYellow:"#fde047",brightBlue:"#93c5fd",brightMagenta:"#d8b4fe",brightCyan:"#67e8f9",brightWhite:"#f8fafc"};function n5(e){return{cols:Math.max(1,e.cols||80),rows:Math.max(1,e.rows||24)}}function fd(e){e.refresh(0,Math.max(0,e.rows-1))}function pd(e,t,n,r,s){t.fit();const l=n5(e);return n.current&&n.current.cols===l.cols&&n.current.rows===l.rows||(n.current=l,r&&s(l.cols,l.rows)),l}function AU({projectId:e,terminalId:t,socket:n,scrollback:r,connectionStatus:s,clearVersion:l=0,onPathChange:a}){const{resolvedTheme:u}=RU(),h=x.useRef(null),d=x.useRef(null),m=x.useRef(null),p=x.useRef(null),_=x.useRef(!1),b=x.useRef(0),S=x.useRef(null),w=x.useRef(null),[C,k]=x.useState(null),[T,R]=x.useState(null),D=u==="dark"?TU:MU,z=(O,B)=>{n.command({type:"terminal.resize",terminalId:t,cols:O,rows:B}).catch(()=>{})},L=()=>{const O=()=>{const B=d.current,X=m.current;!B||!X||!_.current||pd(B,X,w,!0,z)};requestAnimationFrame(()=>{O(),setTimeout(O,0)})};return x.useEffect(()=>{const O=new wU({scrollback:r,cursorBlink:!0,convertEol:!1,allowTransparency:!0,fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",fontSize:13,theme:D}),B=new a7,X=new f7;O.loadAddon(B),O.loadAddon(X),d.current=O,m.current=B;const P=h.current;P&&(O.open(P),p.current&&O.write(p.current),pd(O,B,w,!1,()=>{}),fd(O),L());const q=O.onData(V=>{n.command({type:"terminal.input",terminalId:t,data:V}).catch(F=>{R(F instanceof Error?F.message:String(F))})}),H=O.onResize(({cols:V,rows:F})=>{if(!_.current)return;const j={cols:V,rows:F};w.current&&w.current.cols===V&&w.current.rows===F||(w.current=j,z(V,F))}),U=new ResizeObserver(()=>{const V=d.current,F=m.current;!V||!F||pd(V,F,w,_.current,(j,K)=>{n.command({type:"terminal.resize",terminalId:t,cols:j,rows:K}).catch(()=>{})})});return P&&U.observe(P),()=>{U.disconnect(),H.dispose(),q.dispose(),p.current=X.serialize(),O.dispose(),d.current=null,m.current=null}},[r,n,t,D]),x.useEffect(()=>{const O=d.current;O&&(O.options.scrollback=r)},[r]),x.useEffect(()=>{const O=d.current;O&&(O.options.theme=D,fd(O))},[D]),x.useEffect(()=>{if(l===0)return;const O=d.current;O&&(_.current=!1,b.current+=1,S.current=null,p.current=null,k(null),R(null),O.reset(),fd(O),n.command({type:"terminal.close",terminalId:t}).catch(B=>{R(B instanceof Error?B.message:String(B))}))},[l,n,t]),x.useEffect(()=>{a==null||a((C==null?void 0:C.cwd)??null)},[C==null?void 0:C.cwd,a]),x.useEffect(()=>{const O=P=>{const q=d.current;if(!q)return;const H=JSON.stringify({cwd:P.cwd,shell:P.shell,cols:P.cols,rows:P.rows,scrollback:P.scrollback,status:P.status,exitCode:P.exitCode,serializedState:P.serializedState});if(S.current===H){k({cwd:P.cwd,shell:P.shell,status:P.status,exitCode:P.exitCode}),p.current=P.serializedState||null;return}S.current=H,k({cwd:P.cwd,shell:P.shell,status:P.status,exitCode:P.exitCode}),p.current=P.serializedState||null,q.options.scrollback=P.scrollback,q.reset(),P.serializedState&&q.write(P.serializedState),fd(q)},B=()=>{const P=d.current;if(!P)return;const q=n5(P);w.current=q,n.command({type:"terminal.create",projectId:e,terminalId:t,cols:q.cols,rows:q.rows,scrollback:r}).then(H=>{_.current=!0,R(null),H&&O(H),L()}).catch(H=>{R(H instanceof Error?H.message:String(H))})},X=()=>{const P=++b.current,q=()=>{if(b.current!==P)return;const H=d.current,U=m.current,V=h.current;if(!H||!U||!V)return;pd(H,U,w,!1,()=>{});const F=V.getBoundingClientRect();if(F.width<=0||F.height<=0){requestAnimationFrame(q);return}B()};requestAnimationFrame(()=>{requestAnimationFrame(q)})};return X(),n.subscribeTerminal(t,{onSnapshot:P=>{if(!P){_.current=!1,S.current=null,s==="connected"&&X();return}_.current=!0,R(null),O(P),L()},onEvent:P=>{const q=d.current;if(q){if(P.type==="terminal.output"){q.write(P.data);return}P.type==="terminal.exit"&&k(H=>({cwd:(H==null?void 0:H.cwd)??"",shell:(H==null?void 0:H.shell)??"",status:"exited",exitCode:P.exitCode}))}}})},[s,e,r,n,t]),v.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden pb-4",children:[v.jsx("div",{ref:h,className:"kanna-terminal min-h-0 min-w-0 flex-1 overflow-hidden py-1 pl-3 pr-3 w-full"}),T?v.jsxs("div",{className:"px-3 py-1 text-xs text-destructive",children:["Terminal error: ",T]}):null]})}const DU=24;function r5(e){return e+DU}function NU(e,t){return Math.max(1,e)*r5(t)}function OU({projectId:e,layout:t,socket:n,connectionStatus:r,scrollback:s,minColumnWidth:l,onAddTerminal:a,onRemoveTerminal:u,onTerminalLayout:h}){const d=x.useRef(null),m=x.useRef({}),p=x.useRef([]),[_,b]=x.useState(0),[S,w]=x.useState({}),[C,k]=x.useState({});x.useLayoutEffect(()=>{const O=d.current;if(!O)return;const B=()=>{b(O.getBoundingClientRect().width)},X=new ResizeObserver(B);return X.observe(O),B(),()=>X.disconnect()},[]);const T=t.terminals.length,R=r5(l),D=NU(T,l),z=Math.max(_,D),L=x.useMemo(()=>t.terminals.map(O=>O.id).join(":"),[t.terminals]);return x.useLayoutEffect(()=>{const O=p.current,B=t.terminals.map(q=>q.id),X=B.find(q=>!O.includes(q));if(p.current=B,!X||O.length===0)return;const P=m.current[X];P&&P.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},[t.terminals]),v.jsx("div",{className:"flex h-full min-h-0 flex-col bg-transparent",children:v.jsx("div",{ref:d,className:"min-h-0 flex-1 overflow-x-auto overflow-y-hidden",children:v.jsx("div",{className:"h-full min-h-0",style:{width:z||"100%"},children:v.jsx(iT,{orientation:"horizontal",className:"h-full min-h-0",onLayoutChanged:O=>h(e,t.terminals.map(B=>O[B.id]??B.size)),children:t.terminals.map((O,B)=>v.jsxs(x.Fragment,{children:[v.jsx(Hv,{id:O.id,defaultSize:`${O.size}%`,minSize:`${R}px`,className:"min-h-0 overflow-hidden",style:{minWidth:R},children:v.jsxs("div",{ref:X=>{m.current[O.id]=X},className:"flex h-full min-h-0 min-w-0 flex-col border-r border-border bg-transparent last:border-r-0",style:{minWidth:R},children:[v.jsxs("div",{className:"flex items-center gap-2 px-3 pr-2 pt-2 pb-1",children:[v.jsx("div",{className:"min-w-0 flex-1 text-left",children:v.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[v.jsx("div",{className:"shrink-0 text-sm font-medium",children:"Terminal"}),v.jsx("div",{className:"min-w-0 truncate text-xs text-muted-foreground",children:S[O.id]??""})]})}),v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx(Ke,{variant:"ghost",size:"icon-sm","aria-label":"Clear terminal",onClick:()=>k(X=>({...X,[O.id]:(X[O.id]??0)+1})),children:v.jsx(Az,{className:"size-3.5"})}),v.jsx(Ke,{variant:"ghost",size:"icon-sm","aria-label":"Add terminal to the right",onClick:()=>a(e,O.id),children:v.jsx(iy,{className:"size-3.5"})}),v.jsx(Ke,{variant:"ghost",size:"icon-sm","aria-label":"Archive terminal",onClick:()=>u(e,O.id),children:v.jsx(pu,{className:"size-3.5"})})]})]}),v.jsx(AU,{projectId:e,terminalId:O.id,socket:n,scrollback:s,connectionStatus:r,clearVersion:C[O.id]??0,onPathChange:X=>w(P=>P[O.id]===X?P:{...P,[O.id]:X})})]})}),B<t.terminals.length-1?v.jsx(sT,{withHandle:!0,orientation:"horizontal"}):null]},O.id))},L)})})})}const C_={Task:Fd,TaskOutput:Fd,Bash:oy,Glob:Cg,Grep:Cg,ExitPlanMode:aw,Read:Bz,Edit:Nz,Write:Lz,NotebookEdit:kE,WebFetch:JL,TodoWrite:dz,WebSearch:Cg,KillShell:f6,AskUserQuestion:SE,Skill:qc,EnterPlanMode:aw},i5=g6;function s5(e){return C_[e]?C_[e]:i5}function to({children:e,className:t}){return v.jsx("div",{className:ye("flex gap-3 justify-start items-center",t),children:e})}function LU({children:e,className:t}){return v.jsx("div",{className:ye("flex items-center gap-1.5 text-xs",t),children:e})}function Xs({children:e,className:t}){return v.jsx("span",{className:ye("font-medium text-foreground/80",t),children:e})}function zU({children:e}){return v.jsx("span",{className:"text-muted-foreground",children:e})}function Ff({children:e,expandedContent:t,defaultExpanded:n=!1}){const[r,s]=x.useState(n);return v.jsxs("div",{className:"flex flex-col w-full",children:[v.jsxs("button",{onClick:()=>s(!r),className:`group/expandable-row cursor-pointer grid grid-cols-[auto_1fr] items-center gap-1 text-sm ${r?"":"hover:opacity-60 transition-opacity"}`,children:[v.jsx("div",{className:"grid grid-cols-[auto_1fr] items-center gap-1.5",children:e}),v.jsx(Ji,{className:`h-4.5 w-4.5 text-muted-icon translate-y-[0.5px] transition-all duration-200 opacity-0 group-hover/expandable-row:opacity-100 ${r?"rotate-90 opacity-100":""}`})]}),r&&t]})}function n2({label:e,children:t,copyText:n}){const[r,s]=x.useState(!1),l=n??lf(t),a=x.useCallback(async()=>{await navigator.clipboard.writeText(l),s(!0),setTimeout(()=>s(!1),2e3)},[l]);return v.jsxs("div",{children:[v.jsx("span",{className:"font-medium text-muted-foreground",children:e}),v.jsxs("div",{className:"relative group/codeblock",children:[v.jsx("pre",{className:"my-1 text-xs font-mono whitespace-no-wrap break-all bg-muted border border-border rounded-lg p-2 max-h-64 overflow-auto w-full",children:t}),v.jsx(Ke,{variant:"ghost",size:"icon",className:ye("absolute top-[4px] right-[4px] z-10 h-6.5 w-6.5 rounded-sm text-muted-foreground opacity-0 group-hover/codeblock:opacity-100 transition-opacity",!r&&"hover:text-foreground",r&&"hover:!bg-transparent hover:!border-transparent"),onClick:a,children:r?v.jsx(Lo,{className:"h-3.5 w-3.5 text-green-400"}):v.jsx(Sf,{className:"h-4 w-4"})})]})]})}function o5({children:e,icon:t,className:n}){return v.jsxs("span",{className:ye("inline-flex items-center gap-1 px-2 py-1 bg-muted border border-border rounded-full",n),children:[t&&v.jsx(t,{className:"h-3 w-3 text-muted-foreground"}),e]})}function Uf({children:e,className:t}){return v.jsxs("div",{className:ye("grid grid-cols-[auto_1fr] gap-2 min-w-0",t),children:[v.jsx("div",{className:" min-w-5 flex flex-col relative items-center justify-center",children:v.jsx("div",{className:"min-h-full w-[1px] bg-muted-foreground/20"})}),v.jsx("div",{className:"-ml-[1px] min-w-0 overflow-hidden",children:e})]})}function lf(e){if(typeof e=="string")return e;if(typeof e=="number")return String(e);if(Array.isArray(e))return e.map(lf).join("");if(e&&typeof e=="object"&&"props"in e){const t=e.props;return lf(t.children)}return""}function r2(e,t){return x.isValidElement(e)?x.cloneElement(e,{className:ye(e.props.className,t)}):e}const $f={h1:({children:e})=>v.jsx("h1",{className:"text-[20px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h2:({children:e})=>v.jsx("h2",{className:"text-[18px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h3:({children:e})=>v.jsx("h3",{className:"text-[16px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h4:({children:e})=>v.jsx("h4",{className:"text-[16px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h5:({children:e})=>v.jsx("h5",{className:"text-[16px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),h6:({children:e})=>v.jsx("h6",{className:"text-[16px] font-normal leading-tight mt-5 mb-3 first:mt-0 last:mb-0",children:e}),pre:({children:e,...t})=>{const[n,r]=x.useState(!1),s=lf(e),l=async()=>{await navigator.clipboard.writeText(s),r(!0),setTimeout(()=>r(!1),2e3)};return v.jsxs("div",{className:"relative overflow-x-auto max-w-full min-w-0 no-code-highlight group/pre",children:[v.jsx("pre",{className:"min-w-0 rounded-xl py-2.5 px-3.5 [.no-pre-highlight_&]:bg-background",...t,children:e}),v.jsx(Ke,{variant:"ghost",size:"icon",className:ye("absolute top-[35px] -translate-y-[50%] -translate-x-[1px] rounded-md right-1.5 h-8 w-8 text-muted-foreground opacity-0 group-hover/pre:opacity-100 transition-opacity",!n&&"hover:text-foreground",n&&"hover:!bg-transparent hover:!border-transparent"),onClick:l,children:n?v.jsx(Lo,{className:"h-4 w-4 text-green-400"}):v.jsx(Sf,{className:"h-4 w-4"})})]})},code:({children:e,className:t,...n})=>t?v.jsx("code",{className:"block text-xs whitespace-pre",...n,children:e}):v.jsx("code",{className:"break-all px-1 bg-border/60 dark:[.no-pre-highlight_&]:bg-background dark:[.text-pretty_&]:bg-neutral [.no-code-highlight_&]:!bg-transparent py-0.5 rounded text-sm whitespace-wrap",...n,children:e}),table:({children:e,...t})=>v.jsx("div",{className:"border border-border rounded-xl overflow-x-auto",children:v.jsx("table",{className:"table-auto min-w-full divide-y divide-border bg-background",...t,children:e})}),tbody:({children:e,...t})=>v.jsx("tbody",{className:"divide-y divide-border",...t,children:e}),th:({children:e,...t})=>v.jsx("th",{className:"text-left text-xs uppercase text-muted-foreground tracking-wider p-2 pl-0 first:pl-3 bg-muted dark:bg-card [&_*]:font-semibold",...t,children:e}),td:({children:e,...t})=>v.jsx("td",{className:"text-left p-2 pl-0 first:pl-3 [&_*]:font-normal ",...t,children:e}),p:({children:e,...t})=>v.jsx("p",{className:"break-words mt-5 mb-3 first:mt-0 last:mb-0",...t,children:e}),blockquote:({children:e,...t})=>(()=>{const n=x.Children.toArray(e),r=n[0];r!==void 0&&(n[0]=r2(r,"mt-0"));const s=n.length-1,l=n[s];return l!==void 0&&(n[s]=r2(l,"mb-0")),v.jsx("blockquote",{className:"my-2 mt-5 mb-3 first:mt-0 last:mb-0 border-l-2 border-border/80 pl-2 text-muted-foreground",...t,children:n})})(),a:({children:e,...t})=>v.jsx("a",{className:"transition-all underline decoration-2 text-orange-500 decoration-orange-500/50 hover:text-orange-500/70 dark:text-logo dark:decoration-logo/70 dark:hover:text-logo/60 dark:hover:decoration-logo/40 ",target:"_blank",rel:"noopener noreferrer",...t,children:e})},BU={...$f},jU={connecting:"Connecting...",acquiring_sandbox:"Booting...",initializing:"Initializing...",starting:"Starting...",running:"Running...",waiting_for_user:"Waiting...",failed:"Failed"};function PU({status:e}){const t=(e?jU[e]:void 0)||"Processing...",n=e==="failed";return v.jsx(to,{className:"ml-[1px]",children:v.jsxs(LU,{children:[n?v.jsx(pu,{className:"size-4.5 text-red-500"}):v.jsx(Js,{className:"size-4.5 animate-spin text-muted-icon"}),v.jsx(Af,{className:"ml-[1px] text-sm",shimmerWidth:44,children:t})]})})}const l5=x.forwardRef(({className:e,children:t,...n},r)=>v.jsx("div",{ref:r,className:ye("relative overflow-y-auto overscroll-contain touch-pan-y scrollbar-hide",e),style:{WebkitOverflowScrolling:"touch"},...n,children:t}));l5.displayName="ScrollArea";const a5=[68,32];function IU(){return{isVisible:!1,mainSizes:[...a5],terminals:[],nextTerminalIndex:0}}function HU(e,t){return e[t]??IU()}function Kg(e){if(e.length===0)return[];const t=e.reduce((n,r)=>n+Math.max(r,0),0);return!Number.isFinite(t)||t<=0?Array.from({length:e.length},()=>100/e.length):e.map(n=>Math.max(n,0)/t*100)}function FU(e){let t=e,n="";do n=String.fromCharCode(65+t%26)+n,t=Math.floor(t/26)-1;while(t>=0);return`Terminal ${n}`}function UU(e){if(e.length===0)return e;const t=e.length+1;return e.map(n=>({...n,size:n.size*e.length/t}))}function Sc(e,t,n){return{...e,[t]:n(HU(e,t))}}const Ao=wu()(Cu(e=>({projects:{},addTerminal:(t,n)=>e(r=>({projects:Sc(r.projects,t,s=>{var h,d;const l=UU(s.terminals),a={id:((d=(h=globalThis.crypto)==null?void 0:h.randomUUID)==null?void 0:d.call(h))??`terminal-${Date.now()}-${s.nextTerminalIndex}`,title:FU(s.nextTerminalIndex),size:100/(l.length+1)},u=n?Math.max(l.findIndex(m=>m.id===n)+1,0):l.length;return{...s,isVisible:!0,nextTerminalIndex:s.nextTerminalIndex+1,terminals:[...l.slice(0,u),a,...l.slice(u)]}})})),removeTerminal:(t,n)=>e(r=>({projects:Sc(r.projects,t,s=>{const l=s.terminals.filter(u=>u.id!==n);if(l.length===0)return{...s,isVisible:!1,terminals:[]};const a=Kg(l.map(u=>u.size));return{...s,terminals:l.map((u,h)=>({...u,size:a[h]??100/l.length}))}})})),toggleVisibility:t=>e(n=>({projects:Sc(n.projects,t,r=>({...r,isVisible:r.terminals.length>0?!r.isVisible:!1}))})),setMainSizes:(t,n)=>e(r=>{if(n.length!==2)return r;const s=Kg(n);return{projects:Sc(r.projects,t,l=>({...l,mainSizes:s}))}}),setTerminalSizes:(t,n)=>e(r=>({projects:Sc(r.projects,t,s=>{if(n.length!==s.terminals.length)return s;const l=Kg(n);return{...s,terminals:s.terminals.map((a,u)=>({...a,size:l[u]??a.size}))}})})),clearProject:t=>e(n=>{const{[t]:r,...s}=n.projects;return{projects:s}})}),{name:"terminal-layouts",version:1})),$U={isVisible:!1,mainSizes:[...a5],terminals:[],nextTerminalIndex:0},af=1e3,k_=500,E_=5e3,ou=450,R_=250,M_=900;function i2(e){return Number.isFinite(e)?Math.min(E_,Math.max(k_,Math.round(e))):af}function s2(e){return Number.isFinite(e)?Math.min(M_,Math.max(R_,Math.round(e))):ou}const Vl=wu()(Cu(e=>({scrollbackLines:af,minColumnWidth:ou,setScrollbackLines:t=>e({scrollbackLines:i2(t)}),setMinColumnWidth:t=>e({minColumnWidth:s2(t)})}),{name:"terminal-preferences",version:2,migrate:e=>{const t=e;return{scrollbackLines:i2((t==null?void 0:t.scrollbackLines)??af),minColumnWidth:s2((t==null?void 0:t.minColumnWidth)??ou)}}}));function WU(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const qU=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,VU=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,KU={};function o2(e,t){return(KU.jsx?VU:qU).test(e)}const GU=/[ \t\n\f\r]/g;function YU(e){return typeof e=="object"?e.type==="text"?l2(e.value):!1:l2(e)}function l2(e){return e.replace(GU,"")===""}class Au{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Au.prototype.normal={};Au.prototype.property={};Au.prototype.space=void 0;function c5(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new Au(n,r,t)}function T_(e){return e.toLowerCase()}class tr{constructor(t,n){this.attribute=n,this.property=t}}tr.prototype.attribute="";tr.prototype.booleanish=!1;tr.prototype.boolean=!1;tr.prototype.commaOrSpaceSeparated=!1;tr.prototype.commaSeparated=!1;tr.prototype.defined=!1;tr.prototype.mustUseProperty=!1;tr.prototype.number=!1;tr.prototype.overloadedBoolean=!1;tr.prototype.property="";tr.prototype.spaceSeparated=!1;tr.prototype.space=void 0;let XU=0;const je=Go(),Ft=Go(),A_=Go(),fe=Go(),ft=Go(),Jl=Go(),fr=Go();function Go(){return 2**++XU}const D_=Object.freeze(Object.defineProperty({__proto__:null,boolean:je,booleanish:Ft,commaOrSpaceSeparated:fr,commaSeparated:Jl,number:fe,overloadedBoolean:A_,spaceSeparated:ft},Symbol.toStringTag,{value:"Module"})),Gg=Object.keys(D_);class lb extends tr{constructor(t,n,r,s){let l=-1;if(super(t,n),a2(this,"space",s),typeof r=="number")for(;++l<Gg.length;){const a=Gg[l];a2(this,Gg[l],(r&D_[a])===D_[a])}}}lb.prototype.defined=!0;function a2(e,t,n){n&&(e[t]=n)}function ya(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const l=new lb(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),t[r]=l,n[T_(r)]=r,n[T_(l.attribute)]=r}return new Au(t,n,e.space)}const u5=ya({properties:{ariaActiveDescendant:null,ariaAtomic:Ft,ariaAutoComplete:null,ariaBusy:Ft,ariaChecked:Ft,ariaColCount:fe,ariaColIndex:fe,ariaColSpan:fe,ariaControls:ft,ariaCurrent:null,ariaDescribedBy:ft,ariaDetails:null,ariaDisabled:Ft,ariaDropEffect:ft,ariaErrorMessage:null,ariaExpanded:Ft,ariaFlowTo:ft,ariaGrabbed:Ft,ariaHasPopup:null,ariaHidden:Ft,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ft,ariaLevel:fe,ariaLive:null,ariaModal:Ft,ariaMultiLine:Ft,ariaMultiSelectable:Ft,ariaOrientation:null,ariaOwns:ft,ariaPlaceholder:null,ariaPosInSet:fe,ariaPressed:Ft,ariaReadOnly:Ft,ariaRelevant:null,ariaRequired:Ft,ariaRoleDescription:ft,ariaRowCount:fe,ariaRowIndex:fe,ariaRowSpan:fe,ariaSelected:Ft,ariaSetSize:fe,ariaSort:null,ariaValueMax:fe,ariaValueMin:fe,ariaValueNow:fe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function h5(e,t){return t in e?e[t]:t}function d5(e,t){return h5(e,t.toLowerCase())}const ZU=ya({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Jl,acceptCharset:ft,accessKey:ft,action:null,allow:null,allowFullScreen:je,allowPaymentRequest:je,allowUserMedia:je,alt:null,as:null,async:je,autoCapitalize:null,autoComplete:ft,autoFocus:je,autoPlay:je,blocking:ft,capture:null,charSet:null,checked:je,cite:null,className:ft,cols:fe,colSpan:null,content:null,contentEditable:Ft,controls:je,controlsList:ft,coords:fe|Jl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:je,defer:je,dir:null,dirName:null,disabled:je,download:A_,draggable:Ft,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:je,formTarget:null,headers:ft,height:fe,hidden:A_,high:fe,href:null,hrefLang:null,htmlFor:ft,httpEquiv:ft,id:null,imageSizes:null,imageSrcSet:null,inert:je,inputMode:null,integrity:null,is:null,isMap:je,itemId:null,itemProp:ft,itemRef:ft,itemScope:je,itemType:ft,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:je,low:fe,manifest:null,max:null,maxLength:fe,media:null,method:null,min:null,minLength:fe,multiple:je,muted:je,name:null,nonce:null,noModule:je,noValidate:je,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:je,optimum:fe,pattern:null,ping:ft,placeholder:null,playsInline:je,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:je,referrerPolicy:null,rel:ft,required:je,reversed:je,rows:fe,rowSpan:fe,sandbox:ft,scope:null,scoped:je,seamless:je,selected:je,shadowRootClonable:je,shadowRootDelegatesFocus:je,shadowRootMode:null,shape:null,size:fe,sizes:null,slot:null,span:fe,spellCheck:Ft,src:null,srcDoc:null,srcLang:null,srcSet:null,start:fe,step:null,style:null,tabIndex:fe,target:null,title:null,translate:null,type:null,typeMustMatch:je,useMap:null,value:Ft,width:fe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ft,axis:null,background:null,bgColor:null,border:fe,borderColor:null,bottomMargin:fe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:je,declare:je,event:null,face:null,frame:null,frameBorder:null,hSpace:fe,leftMargin:fe,link:null,longDesc:null,lowSrc:null,marginHeight:fe,marginWidth:fe,noResize:je,noHref:je,noShade:je,noWrap:je,object:null,profile:null,prompt:null,rev:null,rightMargin:fe,rules:null,scheme:null,scrolling:Ft,standby:null,summary:null,text:null,topMargin:fe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:fe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:je,disableRemotePlayback:je,prefix:null,property:null,results:fe,security:null,unselectable:null},space:"html",transform:d5}),QU=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:fe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:fe,amplitude:fe,arabicForm:null,ascent:fe,attributeName:null,attributeType:null,azimuth:fe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:fe,by:null,calcMode:null,capHeight:fe,className:ft,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:fe,diffuseConstant:fe,direction:null,display:null,dur:null,divisor:fe,dominantBaseline:null,download:je,dx:null,dy:null,edgeMode:null,editable:null,elevation:fe,enableBackground:null,end:null,event:null,exponent:fe,externalResourcesRequired:null,fill:null,fillOpacity:fe,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:Jl,g2:Jl,glyphName:Jl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:fe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:fe,horizOriginX:fe,horizOriginY:fe,id:null,ideographic:fe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:fe,k:fe,k1:fe,k2:fe,k3:fe,k4:fe,kernelMatrix:fr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:fe,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:fe,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:fe,overlineThickness:fe,paintOrder:null,panose1:null,path:null,pathLength:fe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ft,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:fe,pointsAtY:fe,pointsAtZ:fe,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:fe,specularExponent:fe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:fe,strikethroughThickness:fe,string:null,stroke:null,strokeDashArray:fr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:fe,strokeOpacity:fe,strokeWidth:null,style:null,surfaceScale:fe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:fr,tabIndex:fe,tableValues:null,target:null,targetX:fe,targetY:fe,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:fe,underlineThickness:fe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:fe,values:null,vAlphabetic:fe,vMathematical:fe,vectorEffect:null,vHanging:fe,vIdeographic:fe,version:null,vertAdvY:fe,vertOriginX:fe,vertOriginY:fe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:fe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:h5}),f5=ya({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),p5=ya({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:d5}),m5=ya({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),JU={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"},e$=/[A-Z]/g,c2=/-[a-z]/g,t$=/^data[-\w.:]+$/i;function n$(e,t){const n=T_(t);let r=t,s=tr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&t$.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(c2,i$);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!c2.test(l)){let a=l.replace(e$,r$);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}s=lb}return new s(r,t)}function r$(e){return"-"+e.toLowerCase()}function i$(e){return e.charAt(1).toUpperCase()}const s$=c5([u5,ZU,f5,p5,m5],"html"),ab=c5([u5,QU,f5,p5,m5],"svg");function o$(e){return e.join(" ").trim()}var Fl={},Yg,u2;function l$(){if(u2)return Yg;u2=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,u=/^\s+|\s+$/g,h=`
|
|
448
|
-
`,d="/",m="*",p="",_="comment",b="declaration";function S(C,k){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];k=k||{};var T=1,R=1;function D(V){var F=V.match(t);F&&(T+=F.length);var j=V.lastIndexOf(h);R=~j?V.length-j:R+V.length}function z(){var V={line:T,column:R};return function(F){return F.position=new L(V),X(),F}}function L(V){this.start=V,this.end={line:T,column:R},this.source=k.source}L.prototype.content=C;function O(V){var F=new Error(k.source+":"+T+":"+R+": "+V);if(F.reason=V,F.filename=k.source,F.line=T,F.column=R,F.source=C,!k.silent)throw F}function B(V){var F=V.exec(C);if(F){var j=F[0];return D(j),C=C.slice(j.length),F}}function X(){B(n)}function P(V){var F;for(V=V||[];F=q();)F!==!1&&V.push(F);return V}function q(){var V=z();if(!(d!=C.charAt(0)||m!=C.charAt(1))){for(var F=2;p!=C.charAt(F)&&(m!=C.charAt(F)||d!=C.charAt(F+1));)++F;if(F+=2,p===C.charAt(F-1))return O("End of comment missing");var j=C.slice(2,F-2);return R+=2,D(j),C=C.slice(F),R+=2,V({type:_,comment:j})}}function H(){var V=z(),F=B(r);if(F){if(q(),!B(s))return O("property missing ':'");var j=B(l),K=V({type:b,property:w(F[0].replace(e,p)),value:j?w(j[0].replace(e,p)):p});return B(a),K}}function U(){var V=[];P(V);for(var F;F=H();)F!==!1&&(V.push(F),P(V));return V}return X(),U()}function w(C){return C?C.replace(u,p):p}return Yg=S,Yg}var h2;function a$(){if(h2)return Fl;h2=1;var e=Fl&&Fl.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Fl,"__esModule",{value:!0}),Fl.default=n;const t=e(l$());function n(r,s){let l=null;if(!r||typeof r!="string")return l;const a=(0,t.default)(r),u=typeof s=="function";return a.forEach(h=>{if(h.type!=="declaration")return;const{property:d,value:m}=h;u?s(d,m,h):m&&(l=l||{},l[d]=m)}),l}return Fl}var wc={},d2;function c$(){if(d2)return wc;d2=1,Object.defineProperty(wc,"__esModule",{value:!0}),wc.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,l=function(d){return!d||n.test(d)||e.test(d)},a=function(d,m){return m.toUpperCase()},u=function(d,m){return"".concat(m,"-")},h=function(d,m){return m===void 0&&(m={}),l(d)?d:(d=d.toLowerCase(),m.reactCompat?d=d.replace(s,u):d=d.replace(r,u),d.replace(t,a))};return wc.camelCase=h,wc}var Cc,f2;function u$(){if(f2)return Cc;f2=1;var e=Cc&&Cc.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(a$()),n=c$();function r(s,l){var a={};return!s||typeof s!="string"||(0,t.default)(s,function(u,h){u&&h&&(a[(0,n.camelCase)(u,l)]=h)}),a}return r.default=r,Cc=r,Cc}var h$=u$();const d$=pf(h$),g5=v5("end"),cb=v5("start");function v5(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};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 f$(e){const t=cb(e),n=g5(e);if(t&&n)return{start:t,end:n}}function Fc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?p2(e.position):"start"in e||"end"in e?p2(e):"line"in e||"column"in e?N_(e):""}function N_(e){return m2(e&&e.line)+":"+m2(e&&e.column)}function p2(e){return N_(e&&e.start)+"-"+N_(e&&e.end)}function m2(e){return e&&typeof e=="number"?e:1}class An extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",l={},a=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?s=t:!l.cause&&t&&(a=!0,s=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof r=="string"){const h=r.indexOf(":");h===-1?l.ruleId=r:(l.source=r.slice(0,h),l.ruleId=r.slice(h+1))}if(!l.place&&l.ancestors&&l.ancestors){const h=l.ancestors[l.ancestors.length-1];h&&(l.place=h.position)}const u=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=u?u.line:void 0,this.name=Fc(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=a&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}An.prototype.file="";An.prototype.name="";An.prototype.reason="";An.prototype.message="";An.prototype.stack="";An.prototype.column=void 0;An.prototype.line=void 0;An.prototype.ancestors=void 0;An.prototype.cause=void 0;An.prototype.fatal=void 0;An.prototype.place=void 0;An.prototype.ruleId=void 0;An.prototype.source=void 0;const ub={}.hasOwnProperty,p$=new Map,m$=/[A-Z]/g,g$=new Set(["table","tbody","thead","tfoot","tr"]),v$=new Set(["td","th"]),_5="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function _$(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=E$(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=k$(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?ab:s$,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=y5(s,e,void 0);return l&&typeof l!="string"?l:s.create(e,s.Fragment,{children:l||void 0},void 0)}function y5(e,t,n){if(t.type==="element")return y$(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return b$(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return S$(e,t,n);if(t.type==="mdxjsEsm")return x$(e,t);if(t.type==="root")return w$(e,t,n);if(t.type==="text")return C$(e,t)}function y$(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=ab,e.schema=s),e.ancestors.push(t);const l=x5(e,t.tagName,!1),a=R$(e,t);let u=db(e,t);return g$.has(t.tagName)&&(u=u.filter(function(h){return typeof h=="string"?!YU(h):!0})),b5(e,a,l,t),hb(a,u),e.ancestors.pop(),e.schema=r,e.create(t,l,a,n)}function b$(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}lu(e,t.position)}function x$(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);lu(e,t.position)}function S$(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=ab,e.schema=s),e.ancestors.push(t);const l=t.name===null?e.Fragment:x5(e,t.name,!0),a=M$(e,t),u=db(e,t);return b5(e,a,l,t),hb(a,u),e.ancestors.pop(),e.schema=r,e.create(t,l,a,n)}function w$(e,t,n){const r={};return hb(r,db(e,t)),e.create(t,e.Fragment,r,n)}function C$(e,t){return t.value}function b5(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function hb(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function k$(e,t,n){return r;function r(s,l,a,u){const d=Array.isArray(a.children)?n:t;return u?d(l,a,u):d(l,a)}}function E$(e,t){return n;function n(r,s,l,a){const u=Array.isArray(l.children),h=cb(r);return t(s,l,a,u,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function R$(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&ub.call(t.properties,s)){const l=T$(e,s,t.properties[s]);if(l){const[a,u]=l;e.tableCellAlignToStyle&&a==="align"&&typeof u=="string"&&v$.has(t.tagName)?r=u:n[a]=u}}if(r){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function M$(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const a=l.expression;a.type;const u=a.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else lu(e,t.position);else{const s=r.name;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const u=r.value.data.estree.body[0];u.type,l=e.evaluater.evaluateExpression(u.expression)}else lu(e,t.position);else l=r.value===null?!0:r.value;n[s]=l}return n}function db(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:p$;for(;++r<t.children.length;){const l=t.children[r];let a;if(e.passKeys){const h=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(h){const d=s.get(h)||0;a=h+"-"+d,s.set(h,d+1)}}const u=y5(e,l,a);u!==void 0&&n.push(u)}return n}function T$(e,t,n){const r=n$(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?WU(n):o$(n)),r.property==="style"){let s=typeof n=="object"?n:A$(e,String(n));return e.stylePropertyNameCase==="css"&&(s=D$(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?JU[r.property]||r.property:r.attribute,n]}}function A$(e,t){try{return d$(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new An("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=_5+"#cannot-parse-style-attribute",s}}function x5(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let l=-1,a;for(;++l<s.length;){const u=o2(s[l])?{type:"Identifier",name:s[l]}:{type:"Literal",value:s[l]};a=a?{type:"MemberExpression",object:a,property:u,computed:!!(l&&u.type==="Literal"),optional:!1}:u}r=a}else r=o2(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return ub.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);lu(e)}function lu(e,t){const n=new An("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=_5+"#cannot-handle-mdx-estrees-without-createevaluater",n}function D$(e){const t={};let n;for(n in e)ub.call(e,n)&&(t[N$(n)]=e[n]);return t}function N$(e){let t=e.replace(m$,O$);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function O$(e){return"-"+e.toLowerCase()}const Xg={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"]},L$={};function fb(e,t){const n=L$,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return S5(e,r,s)}function S5(e,t,n){if(z$(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return g2(e.children,t,n)}return Array.isArray(e)?g2(e,t,n):""}function g2(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=S5(e[s],t,n);return r.join("")}function z$(e){return!!(e&&typeof e=="object")}const v2=document.createElement("i");function pb(e){const t="&"+e+";";v2.innerHTML=t;const n=v2.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function gr(e,t,n,r){const s=e.length;let l=0,a;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);l<r.length;)a=r.slice(l,l+1e4),a.unshift(t,0),e.splice(...a),l+=1e4,t+=1e4}function zr(e,t){return e.length>0?(gr(e,e.length,0,t),e):t}const _2={}.hasOwnProperty;function w5(e){const t={};let n=-1;for(;++n<e.length;)B$(t,e[n]);return t}function B$(e,t){let n;for(n in t){const s=(_2.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let a;if(l)for(a in l){_2.call(s,a)||(s[a]=[]);const u=l[a];j$(s[a],Array.isArray(u)?u:u?[u]:[])}}}function j$(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);gr(e,0,0,r)}function C5(e,t){const n=Number.parseInt(e,t);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 Xr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Bn=no(/[A-Za-z]/),Tn=no(/[\dA-Za-z]/),P$=no(/[#-'*+\--9=?A-Z^-~]/);function cf(e){return e!==null&&(e<32||e===127)}const O_=no(/\d/),I$=no(/[\dA-Fa-f]/),H$=no(/[!-/:-@[-`{-~]/);function Ae(e){return e!==null&&e<-2}function dt(e){return e!==null&&(e<0||e===32)}function We(e){return e===-2||e===-1||e===32}const Wf=no(new RegExp("\\p{P}|\\p{S}","u")),Fo=no(/\s/);function no(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ba(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const l=e.charCodeAt(n);let a="";if(l===37&&Tn(e.charCodeAt(n+1))&&Tn(e.charCodeAt(n+2)))s=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(a=String.fromCharCode(l));else if(l>55295&&l<57344){const u=e.charCodeAt(n+1);l<56320&&u>56319&&u<57344?(a=String.fromCharCode(l,u),s=1):a="�"}else a=String.fromCharCode(l);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+s+1,a=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function Ze(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let l=0;return a;function a(h){return We(h)?(e.enter(n),u(h)):t(h)}function u(h){return We(h)&&l++<s?(e.consume(h),u):(e.exit(n),t(h))}}const F$={tokenize:U$};function U$(e){const t=e.attempt(this.parser.constructs.contentInitial,r,s);let n;return t;function r(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Ze(e,t,"linePrefix")}function s(u){return e.enter("paragraph"),l(u)}function l(u){const h=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=h),n=h,a(u)}function a(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return Ae(u)?(e.consume(u),e.exit("chunkText"),l):(e.consume(u),a)}}const $$={tokenize:W$},y2={tokenize:q$};function W$(e){const t=this,n=[];let r=0,s,l,a;return u;function u(R){if(r<n.length){const D=n[r];return t.containerState=D[1],e.attempt(D[0].continuation,h,d)(R)}return d(R)}function h(R){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&T();const D=t.events.length;let z=D,L;for(;z--;)if(t.events[z][0]==="exit"&&t.events[z][1].type==="chunkFlow"){L=t.events[z][1].end;break}k(r);let O=D;for(;O<t.events.length;)t.events[O][1].end={...L},O++;return gr(t.events,z+1,0,t.events.slice(D)),t.events.length=O,d(R)}return u(R)}function d(R){if(r===n.length){if(!s)return _(R);if(s.currentConstruct&&s.currentConstruct.concrete)return S(R);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(y2,m,p)(R)}function m(R){return s&&T(),k(r),_(R)}function p(R){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,S(R)}function _(R){return t.containerState={},e.attempt(y2,b,S)(R)}function b(R){return r++,n.push([t.currentConstruct,t.containerState]),_(R)}function S(R){if(R===null){s&&T(),k(0),e.consume(R);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:l}),w(R)}function w(R){if(R===null){C(e.exit("chunkFlow"),!0),k(0),e.consume(R);return}return Ae(R)?(e.consume(R),C(e.exit("chunkFlow")),r=0,t.interrupt=void 0,u):(e.consume(R),w)}function C(R,D){const z=t.sliceStream(R);if(D&&z.push(null),R.previous=l,l&&(l.next=R),l=R,s.defineSkip(R.start),s.write(z),t.parser.lazy[R.start.line]){let L=s.events.length;for(;L--;)if(s.events[L][1].start.offset<a&&(!s.events[L][1].end||s.events[L][1].end.offset>a))return;const O=t.events.length;let B=O,X,P;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){if(X){P=t.events[B][1].end;break}X=!0}for(k(r),L=O;L<t.events.length;)t.events[L][1].end={...P},L++;gr(t.events,B+1,0,t.events.slice(O)),t.events.length=L}}function k(R){let D=n.length;for(;D-- >R;){const z=n[D];t.containerState=z[1],z[0].exit.call(t,e)}n.length=R}function T(){s.write([null]),l=void 0,s=void 0,t.containerState._closeFlow=void 0}}function q$(e,t,n){return Ze(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function aa(e){if(e===null||dt(e)||Fo(e))return 1;if(Wf(e))return 2}function qf(e,t,n){const r=[];let s=-1;for(;++s<e.length;){const l=e[s].resolveAll;l&&!r.includes(l)&&(t=l(t,n),r.push(l))}return t}const L_={name:"attention",resolveAll:V$,tokenize:K$};function V$(e,t){let n=-1,r,s,l,a,u,h,d,m;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;h=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p={...e[r][1].end},_={...e[n][1].start};b2(p,-h),b2(_,h),a={type:h>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},u={type:h>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:_},l={type:h>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:h>1?"strong":"emphasis",start:{...a.start},end:{...u.end}},e[r][1].end={...a.start},e[n][1].start={...u.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=zr(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=zr(d,[["enter",s,t],["enter",a,t],["exit",a,t],["enter",l,t]]),d=zr(d,qf(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=zr(d,[["exit",l,t],["enter",u,t],["exit",u,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,d=zr(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,gr(e,r-1,n-r+3,d),n=r+d.length-m-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function K$(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=aa(r);let l;return a;function a(h){return l=h,e.enter("attentionSequence"),u(h)}function u(h){if(h===l)return e.consume(h),u;const d=e.exit("attentionSequence"),m=aa(h),p=!m||m===2&&s||n.includes(h),_=!s||s===2&&m||n.includes(r);return d._open=!!(l===42?p:p&&(s||!_)),d._close=!!(l===42?_:_&&(m||!p)),t(h)}}function b2(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const G$={name:"autolink",tokenize:Y$};function Y$(e,t,n){let r=0;return s;function s(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(b){return Bn(b)?(e.consume(b),a):b===64?n(b):d(b)}function a(b){return b===43||b===45||b===46||Tn(b)?(r=1,u(b)):d(b)}function u(b){return b===58?(e.consume(b),r=0,h):(b===43||b===45||b===46||Tn(b))&&r++<32?(e.consume(b),u):(r=0,d(b))}function h(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):b===null||b===32||b===60||cf(b)?n(b):(e.consume(b),h)}function d(b){return b===64?(e.consume(b),m):P$(b)?(e.consume(b),d):n(b)}function m(b){return Tn(b)?p(b):n(b)}function p(b){return b===46?(e.consume(b),r=0,m):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):_(b)}function _(b){if((b===45||Tn(b))&&r++<63){const S=b===45?_:p;return e.consume(b),S}return n(b)}}const Du={partial:!0,tokenize:X$};function X$(e,t,n){return r;function r(l){return We(l)?Ze(e,s,"linePrefix")(l):s(l)}function s(l){return l===null||Ae(l)?t(l):n(l)}}const k5={continuation:{tokenize:Q$},exit:J$,name:"blockQuote",tokenize:Z$};function Z$(e,t,n){const r=this;return s;function s(a){if(a===62){const u=r.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),l}return n(a)}function l(a){return We(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function Q$(e,t,n){const r=this;return s;function s(a){return We(a)?Ze(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):l(a)}function l(a){return e.attempt(k5,t,n)(a)}}function J$(e){e.exit("blockQuote")}const E5={name:"characterEscape",tokenize:eW};function eW(e,t,n){return r;function r(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),s}function s(l){return H$(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const R5={name:"characterReference",tokenize:tW};function tW(e,t,n){const r=this;let s=0,l,a;return u;function u(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),h}function h(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),l=31,a=Tn,m(p))}function d(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,a=I$,m):(e.enter("characterReferenceValue"),l=7,a=O_,m(p))}function m(p){if(p===59&&s){const _=e.exit("characterReferenceValue");return a===Tn&&!pb(r.sliceSerialize(_))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(p)&&s++<l?(e.consume(p),m):n(p)}}const x2={partial:!0,tokenize:rW},S2={concrete:!0,name:"codeFenced",tokenize:nW};function nW(e,t,n){const r=this,s={partial:!0,tokenize:z};let l=0,a=0,u;return h;function h(L){return d(L)}function d(L){const O=r.events[r.events.length-1];return l=O&&O[1].type==="linePrefix"?O[2].sliceSerialize(O[1],!0).length:0,u=L,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(L)}function m(L){return L===u?(a++,e.consume(L),m):a<3?n(L):(e.exit("codeFencedFenceSequence"),We(L)?Ze(e,p,"whitespace")(L):p(L))}function p(L){return L===null||Ae(L)?(e.exit("codeFencedFence"),r.interrupt?t(L):e.check(x2,w,D)(L)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),_(L))}function _(L){return L===null||Ae(L)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(L)):We(L)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ze(e,b,"whitespace")(L)):L===96&&L===u?n(L):(e.consume(L),_)}function b(L){return L===null||Ae(L)?p(L):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(L))}function S(L){return L===null||Ae(L)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(L)):L===96&&L===u?n(L):(e.consume(L),S)}function w(L){return e.attempt(s,D,C)(L)}function C(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),k}function k(L){return l>0&&We(L)?Ze(e,T,"linePrefix",l+1)(L):T(L)}function T(L){return L===null||Ae(L)?e.check(x2,w,D)(L):(e.enter("codeFlowValue"),R(L))}function R(L){return L===null||Ae(L)?(e.exit("codeFlowValue"),T(L)):(e.consume(L),R)}function D(L){return e.exit("codeFenced"),t(L)}function z(L,O,B){let X=0;return P;function P(F){return L.enter("lineEnding"),L.consume(F),L.exit("lineEnding"),q}function q(F){return L.enter("codeFencedFence"),We(F)?Ze(L,H,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):H(F)}function H(F){return F===u?(L.enter("codeFencedFenceSequence"),U(F)):B(F)}function U(F){return F===u?(X++,L.consume(F),U):X>=a?(L.exit("codeFencedFenceSequence"),We(F)?Ze(L,V,"whitespace")(F):V(F)):B(F)}function V(F){return F===null||Ae(F)?(L.exit("codeFencedFence"),O(F)):B(F)}}}function rW(e,t,n){const r=this;return s;function s(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),l)}function l(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const Zg={name:"codeIndented",tokenize:sW},iW={partial:!0,tokenize:oW};function sW(e,t,n){const r=this;return s;function s(d){return e.enter("codeIndented"),Ze(e,l,"linePrefix",5)(d)}function l(d){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?a(d):n(d)}function a(d){return d===null?h(d):Ae(d)?e.attempt(iW,a,h)(d):(e.enter("codeFlowValue"),u(d))}function u(d){return d===null||Ae(d)?(e.exit("codeFlowValue"),a(d)):(e.consume(d),u)}function h(d){return e.exit("codeIndented"),t(d)}}function oW(e,t,n){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?n(a):Ae(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):Ze(e,l,"linePrefix",5)(a)}function l(a){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(a):Ae(a)?s(a):n(a)}}const lW={name:"codeText",previous:cW,resolve:aW,tokenize:uW};function aW(e){let t=e.length-4,n=3,r,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)s===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(s=r):(r===t||e[r][1].type==="lineEnding")&&(e[s][1].type="codeTextData",r!==s+2&&(e[s][1].end=e[r-1][1].end,e.splice(s+2,r-s-2),t-=r-s-2,r=s+2),s=void 0);return e}function cW(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function uW(e,t,n){let r=0,s,l;return a;function a(p){return e.enter("codeText"),e.enter("codeTextSequence"),u(p)}function u(p){return p===96?(e.consume(p),r++,u):(e.exit("codeTextSequence"),h(p))}function h(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),h):p===96?(l=e.enter("codeTextSequence"),s=0,m(p)):Ae(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),h):(e.enter("codeTextData"),d(p))}function d(p){return p===null||p===32||p===96||Ae(p)?(e.exit("codeTextData"),h(p)):(e.consume(p),d)}function m(p){return p===96?(e.consume(p),s++,m):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(l.type="codeTextData",d(p))}}class hW{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const s=n||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&kc(this.left,r),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),kc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),kc(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);kc(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);kc(this.left,n.reverse())}}}function kc(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function M5(e){const t={};let n=-1,r,s,l,a,u,h,d;const m=new hW(e);for(;++n<m.length;){for(;n in t;)n=t[n];if(r=m.get(n),n&&r[1].type==="chunkFlow"&&m.get(n-1)[1].type==="listItemPrefix"&&(h=r[1]._tokenizer.events,l=0,l<h.length&&h[l][1].type==="lineEndingBlank"&&(l+=2),l<h.length&&h[l][1].type==="content"))for(;++l<h.length&&h[l][1].type!=="content";)h[l][1].type==="chunkText"&&(h[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,dW(m,n)),n=t[n],d=!0);else if(r[1]._container){for(l=n,s=void 0;l--;)if(a=m.get(l),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(s&&(m.get(s)[1].type="lineEndingBlank"),a[1].type="lineEnding",s=l);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;s&&(r[1].end={...m.get(s)[1].start},u=m.slice(s,n),u.unshift(r),m.splice(s,n-s+1,u))}}return gr(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!d}function dW(e,t){const n=e.get(t)[1],r=e.get(t)[2];let s=t-1;const l=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const u=a.events,h=[],d={};let m,p,_=-1,b=n,S=0,w=0;const C=[w];for(;b;){for(;e.get(++s)[1]!==b;);l.push(s),b._tokenizer||(m=r.sliceStream(b),b.next||m.push(null),p&&a.defineSkip(b.start),b._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(m),b._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),p=b,b=b.next}for(b=n;++_<u.length;)u[_][0]==="exit"&&u[_-1][0]==="enter"&&u[_][1].type===u[_-1][1].type&&u[_][1].start.line!==u[_][1].end.line&&(w=_+1,C.push(w),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(a.events=[],b?(b._tokenizer=void 0,b.previous=void 0):C.pop(),_=C.length;_--;){const k=u.slice(C[_],C[_+1]),T=l.pop();h.push([T,T+k.length-1]),e.splice(T,2,k)}for(h.reverse(),_=-1;++_<h.length;)d[S+h[_][0]]=S+h[_][1],S+=h[_][1]-h[_][0]-1;return d}const fW={resolve:mW,tokenize:gW},pW={partial:!0,tokenize:vW};function mW(e){return M5(e),e}function gW(e,t){let n;return r;function r(u){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(u)}function s(u){return u===null?l(u):Ae(u)?e.check(pW,a,l)(u):(e.consume(u),s)}function l(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function a(u){return e.consume(u),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function vW(e,t,n){const r=this;return s;function s(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Ze(e,l,"linePrefix")}function l(a){if(a===null||Ae(a))return n(a);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function T5(e,t,n,r,s,l,a,u,h){const d=h||Number.POSITIVE_INFINITY;let m=0;return p;function p(k){return k===60?(e.enter(r),e.enter(s),e.enter(l),e.consume(k),e.exit(l),_):k===null||k===32||k===41||cf(k)?n(k):(e.enter(r),e.enter(a),e.enter(u),e.enter("chunkString",{contentType:"string"}),w(k))}function _(k){return k===62?(e.enter(l),e.consume(k),e.exit(l),e.exit(s),e.exit(r),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),b(k))}function b(k){return k===62?(e.exit("chunkString"),e.exit(u),_(k)):k===null||k===60||Ae(k)?n(k):(e.consume(k),k===92?S:b)}function S(k){return k===60||k===62||k===92?(e.consume(k),b):b(k)}function w(k){return!m&&(k===null||k===41||dt(k))?(e.exit("chunkString"),e.exit(u),e.exit(a),e.exit(r),t(k)):m<d&&k===40?(e.consume(k),m++,w):k===41?(e.consume(k),m--,w):k===null||k===32||k===40||cf(k)?n(k):(e.consume(k),k===92?C:w)}function C(k){return k===40||k===41||k===92?(e.consume(k),w):w(k)}}function A5(e,t,n,r,s,l){const a=this;let u=0,h;return d;function d(b){return e.enter(r),e.enter(s),e.consume(b),e.exit(s),e.enter(l),m}function m(b){return u>999||b===null||b===91||b===93&&!h||b===94&&!u&&"_hiddenFootnoteSupport"in a.parser.constructs?n(b):b===93?(e.exit(l),e.enter(s),e.consume(b),e.exit(s),e.exit(r),t):Ae(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===null||b===91||b===93||Ae(b)||u++>999?(e.exit("chunkString"),m(b)):(e.consume(b),h||(h=!We(b)),b===92?_:p)}function _(b){return b===91||b===92||b===93?(e.consume(b),u++,p):p(b)}}function D5(e,t,n,r,s,l){let a;return u;function u(_){return _===34||_===39||_===40?(e.enter(r),e.enter(s),e.consume(_),e.exit(s),a=_===40?41:_,h):n(_)}function h(_){return _===a?(e.enter(s),e.consume(_),e.exit(s),e.exit(r),t):(e.enter(l),d(_))}function d(_){return _===a?(e.exit(l),h(a)):_===null?n(_):Ae(_)?(e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),Ze(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(_))}function m(_){return _===a||_===null||Ae(_)?(e.exit("chunkString"),d(_)):(e.consume(_),_===92?p:m)}function p(_){return _===a||_===92?(e.consume(_),m):m(_)}}function Uc(e,t){let n;return r;function r(s){return Ae(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):We(s)?Ze(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const _W={name:"definition",tokenize:bW},yW={partial:!0,tokenize:xW};function bW(e,t,n){const r=this;let s;return l;function l(b){return e.enter("definition"),a(b)}function a(b){return A5.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function u(b){return s=Xr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),h):n(b)}function h(b){return dt(b)?Uc(e,d)(b):d(b)}function d(b){return T5(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function m(b){return e.attempt(yW,p,p)(b)}function p(b){return We(b)?Ze(e,_,"whitespace")(b):_(b)}function _(b){return b===null||Ae(b)?(e.exit("definition"),r.parser.defined.push(s),t(b)):n(b)}}function xW(e,t,n){return r;function r(u){return dt(u)?Uc(e,s)(u):n(u)}function s(u){return D5(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function l(u){return We(u)?Ze(e,a,"whitespace")(u):a(u)}function a(u){return u===null||Ae(u)?t(u):n(u)}}const SW={name:"hardBreakEscape",tokenize:wW};function wW(e,t,n){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),s}function s(l){return Ae(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const CW={name:"headingAtx",resolve:kW,tokenize:EW};function kW(e,t){let n=e.length-2,r=3,s,l;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},l={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},gr(e,r,n-r+1,[["enter",s,t],["enter",l,t],["exit",l,t],["exit",s,t]])),e}function EW(e,t,n){let r=0;return s;function s(m){return e.enter("atxHeading"),l(m)}function l(m){return e.enter("atxHeadingSequence"),a(m)}function a(m){return m===35&&r++<6?(e.consume(m),a):m===null||dt(m)?(e.exit("atxHeadingSequence"),u(m)):n(m)}function u(m){return m===35?(e.enter("atxHeadingSequence"),h(m)):m===null||Ae(m)?(e.exit("atxHeading"),t(m)):We(m)?Ze(e,u,"whitespace")(m):(e.enter("atxHeadingText"),d(m))}function h(m){return m===35?(e.consume(m),h):(e.exit("atxHeadingSequence"),u(m))}function d(m){return m===null||m===35||dt(m)?(e.exit("atxHeadingText"),u(m)):(e.consume(m),d)}}const RW=["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"],w2=["pre","script","style","textarea"],MW={concrete:!0,name:"htmlFlow",resolveTo:DW,tokenize:NW},TW={partial:!0,tokenize:LW},AW={partial:!0,tokenize:OW};function DW(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function NW(e,t,n){const r=this;let s,l,a,u,h;return d;function d(M){return m(M)}function m(M){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(M),p}function p(M){return M===33?(e.consume(M),_):M===47?(e.consume(M),l=!0,w):M===63?(e.consume(M),s=3,r.interrupt?t:A):Bn(M)?(e.consume(M),a=String.fromCharCode(M),C):n(M)}function _(M){return M===45?(e.consume(M),s=2,b):M===91?(e.consume(M),s=5,u=0,S):Bn(M)?(e.consume(M),s=4,r.interrupt?t:A):n(M)}function b(M){return M===45?(e.consume(M),r.interrupt?t:A):n(M)}function S(M){const Z="CDATA[";return M===Z.charCodeAt(u++)?(e.consume(M),u===Z.length?r.interrupt?t:H:S):n(M)}function w(M){return Bn(M)?(e.consume(M),a=String.fromCharCode(M),C):n(M)}function C(M){if(M===null||M===47||M===62||dt(M)){const Z=M===47,ae=a.toLowerCase();return!Z&&!l&&w2.includes(ae)?(s=1,r.interrupt?t(M):H(M)):RW.includes(a.toLowerCase())?(s=6,Z?(e.consume(M),k):r.interrupt?t(M):H(M)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(M):l?T(M):R(M))}return M===45||Tn(M)?(e.consume(M),a+=String.fromCharCode(M),C):n(M)}function k(M){return M===62?(e.consume(M),r.interrupt?t:H):n(M)}function T(M){return We(M)?(e.consume(M),T):P(M)}function R(M){return M===47?(e.consume(M),P):M===58||M===95||Bn(M)?(e.consume(M),D):We(M)?(e.consume(M),R):P(M)}function D(M){return M===45||M===46||M===58||M===95||Tn(M)?(e.consume(M),D):z(M)}function z(M){return M===61?(e.consume(M),L):We(M)?(e.consume(M),z):R(M)}function L(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),h=M,O):We(M)?(e.consume(M),L):B(M)}function O(M){return M===h?(e.consume(M),h=null,X):M===null||Ae(M)?n(M):(e.consume(M),O)}function B(M){return M===null||M===34||M===39||M===47||M===60||M===61||M===62||M===96||dt(M)?z(M):(e.consume(M),B)}function X(M){return M===47||M===62||We(M)?R(M):n(M)}function P(M){return M===62?(e.consume(M),q):n(M)}function q(M){return M===null||Ae(M)?H(M):We(M)?(e.consume(M),q):n(M)}function H(M){return M===45&&s===2?(e.consume(M),j):M===60&&s===1?(e.consume(M),K):M===62&&s===4?(e.consume(M),I):M===63&&s===3?(e.consume(M),A):M===93&&s===5?(e.consume(M),J):Ae(M)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(TW,Y,U)(M)):M===null||Ae(M)?(e.exit("htmlFlowData"),U(M)):(e.consume(M),H)}function U(M){return e.check(AW,V,Y)(M)}function V(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),F}function F(M){return M===null||Ae(M)?U(M):(e.enter("htmlFlowData"),H(M))}function j(M){return M===45?(e.consume(M),A):H(M)}function K(M){return M===47?(e.consume(M),a="",$):H(M)}function $(M){if(M===62){const Z=a.toLowerCase();return w2.includes(Z)?(e.consume(M),I):H(M)}return Bn(M)&&a.length<8?(e.consume(M),a+=String.fromCharCode(M),$):H(M)}function J(M){return M===93?(e.consume(M),A):H(M)}function A(M){return M===62?(e.consume(M),I):M===45&&s===2?(e.consume(M),A):H(M)}function I(M){return M===null||Ae(M)?(e.exit("htmlFlowData"),Y(M)):(e.consume(M),I)}function Y(M){return e.exit("htmlFlow"),t(M)}}function OW(e,t,n){const r=this;return s;function s(a){return Ae(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),l):n(a)}function l(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function LW(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Du,t,n)}}const zW={name:"htmlText",tokenize:BW};function BW(e,t,n){const r=this;let s,l,a;return u;function u(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),h}function h(A){return A===33?(e.consume(A),d):A===47?(e.consume(A),z):A===63?(e.consume(A),R):Bn(A)?(e.consume(A),B):n(A)}function d(A){return A===45?(e.consume(A),m):A===91?(e.consume(A),l=0,S):Bn(A)?(e.consume(A),T):n(A)}function m(A){return A===45?(e.consume(A),b):n(A)}function p(A){return A===null?n(A):A===45?(e.consume(A),_):Ae(A)?(a=p,K(A)):(e.consume(A),p)}function _(A){return A===45?(e.consume(A),b):p(A)}function b(A){return A===62?j(A):A===45?_(A):p(A)}function S(A){const I="CDATA[";return A===I.charCodeAt(l++)?(e.consume(A),l===I.length?w:S):n(A)}function w(A){return A===null?n(A):A===93?(e.consume(A),C):Ae(A)?(a=w,K(A)):(e.consume(A),w)}function C(A){return A===93?(e.consume(A),k):w(A)}function k(A){return A===62?j(A):A===93?(e.consume(A),k):w(A)}function T(A){return A===null||A===62?j(A):Ae(A)?(a=T,K(A)):(e.consume(A),T)}function R(A){return A===null?n(A):A===63?(e.consume(A),D):Ae(A)?(a=R,K(A)):(e.consume(A),R)}function D(A){return A===62?j(A):R(A)}function z(A){return Bn(A)?(e.consume(A),L):n(A)}function L(A){return A===45||Tn(A)?(e.consume(A),L):O(A)}function O(A){return Ae(A)?(a=O,K(A)):We(A)?(e.consume(A),O):j(A)}function B(A){return A===45||Tn(A)?(e.consume(A),B):A===47||A===62||dt(A)?X(A):n(A)}function X(A){return A===47?(e.consume(A),j):A===58||A===95||Bn(A)?(e.consume(A),P):Ae(A)?(a=X,K(A)):We(A)?(e.consume(A),X):j(A)}function P(A){return A===45||A===46||A===58||A===95||Tn(A)?(e.consume(A),P):q(A)}function q(A){return A===61?(e.consume(A),H):Ae(A)?(a=q,K(A)):We(A)?(e.consume(A),q):X(A)}function H(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),s=A,U):Ae(A)?(a=H,K(A)):We(A)?(e.consume(A),H):(e.consume(A),V)}function U(A){return A===s?(e.consume(A),s=void 0,F):A===null?n(A):Ae(A)?(a=U,K(A)):(e.consume(A),U)}function V(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||dt(A)?X(A):(e.consume(A),V)}function F(A){return A===47||A===62||dt(A)?X(A):n(A)}function j(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function K(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),$}function $(A){return We(A)?Ze(e,J,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):J(A)}function J(A){return e.enter("htmlTextData"),a(A)}}const mb={name:"labelEnd",resolveAll:HW,resolveTo:FW,tokenize:UW},jW={tokenize:$W},PW={tokenize:WW},IW={tokenize:qW};function HW(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const s=r.type==="labelImage"?4:2;r.type="data",t+=s}}return e.length!==n.length&&gr(e,0,e.length,n),e}function FW(e,t){let n=e.length,r=0,s,l,a,u;for(;n--;)if(s=e[n][1],l){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(l=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(a=n);const h={type:e[l][1].type==="labelLink"?"link":"image",start:{...e[l][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[l][1].start},end:{...e[a][1].end}},m={type:"labelText",start:{...e[l+r+2][1].end},end:{...e[a-2][1].start}};return u=[["enter",h,t],["enter",d,t]],u=zr(u,e.slice(l+1,l+r+3)),u=zr(u,[["enter",m,t]]),u=zr(u,qf(t.parser.constructs.insideSpan.null,e.slice(l+r+4,a-3),t)),u=zr(u,[["exit",m,t],e[a-2],e[a-1],["exit",d,t]]),u=zr(u,e.slice(a+1)),u=zr(u,[["exit",h,t]]),gr(e,l,e.length,u),e}function UW(e,t,n){const r=this;let s=r.events.length,l,a;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){l=r.events[s][1];break}return u;function u(_){return l?l._inactive?p(_):(a=r.parser.defined.includes(Xr(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(_),e.exit("labelMarker"),e.exit("labelEnd"),h):n(_)}function h(_){return _===40?e.attempt(jW,m,a?m:p)(_):_===91?e.attempt(PW,m,a?d:p)(_):a?m(_):p(_)}function d(_){return e.attempt(IW,m,p)(_)}function m(_){return t(_)}function p(_){return l._balanced=!0,n(_)}}function $W(e,t,n){return r;function r(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),s}function s(p){return dt(p)?Uc(e,l)(p):l(p)}function l(p){return p===41?m(p):T5(e,a,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function a(p){return dt(p)?Uc(e,h)(p):m(p)}function u(p){return n(p)}function h(p){return p===34||p===39||p===40?D5(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):m(p)}function d(p){return dt(p)?Uc(e,m)(p):m(p)}function m(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):n(p)}}function WW(e,t,n){const r=this;return s;function s(u){return A5.call(r,e,l,a,"reference","referenceMarker","referenceString")(u)}function l(u){return r.parser.defined.includes(Xr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function a(u){return n(u)}}function qW(e,t,n){return r;function r(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),s}function s(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}const VW={name:"labelStartImage",resolveAll:mb.resolveAll,tokenize:KW};function KW(e,t,n){const r=this;return s;function s(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),l}function l(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),a):n(u)}function a(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const GW={name:"labelStartLink",resolveAll:mb.resolveAll,tokenize:YW};function YW(e,t,n){const r=this;return s;function s(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),l}function l(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const Qg={name:"lineEnding",tokenize:XW};function XW(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ze(e,t,"linePrefix")}}const jd={name:"thematicBreak",tokenize:ZW};function ZW(e,t,n){let r=0,s;return l;function l(d){return e.enter("thematicBreak"),a(d)}function a(d){return s=d,u(d)}function u(d){return d===s?(e.enter("thematicBreakSequence"),h(d)):r>=3&&(d===null||Ae(d))?(e.exit("thematicBreak"),t(d)):n(d)}function h(d){return d===s?(e.consume(d),r++,h):(e.exit("thematicBreakSequence"),We(d)?Ze(e,u,"whitespace")(d):u(d))}}const Qn={continuation:{tokenize:tq},exit:rq,name:"list",tokenize:eq},QW={partial:!0,tokenize:iq},JW={partial:!0,tokenize:nq};function eq(e,t,n){const r=this,s=r.events[r.events.length-1];let l=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,a=0;return u;function u(b){const S=r.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!r.containerState.marker||b===r.containerState.marker:O_(b)){if(r.containerState.type||(r.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(jd,n,d)(b):d(b);if(!r.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(b)}return n(b)}function h(b){return O_(b)&&++a<10?(e.consume(b),h):(!r.interrupt||a<2)&&(r.containerState.marker?b===r.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),d(b)):n(b)}function d(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||b,e.check(Du,r.interrupt?n:m,e.attempt(QW,_,p))}function m(b){return r.containerState.initialBlankLine=!0,l++,_(b)}function p(b){return We(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),_):n(b)}function _(b){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function tq(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Du,s,l);function s(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ze(e,t,"listItemIndent",r.containerState.size+1)(u)}function l(u){return r.containerState.furtherBlankLines||!We(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(JW,t,a)(u))}function a(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ze(e,e.attempt(Qn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function nq(e,t,n){const r=this;return Ze(e,s,"listItemIndent",r.containerState.size+1);function s(l){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(l):n(l)}}function rq(e){e.exit(this.containerState.type)}function iq(e,t,n){const r=this;return Ze(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(l){const a=r.events[r.events.length-1];return!We(l)&&a&&a[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const C2={name:"setextUnderline",resolveTo:sq,tokenize:oq};function sq(e,t){let n=e.length,r,s,l;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!l&&e[n][1].type==="definition"&&(l=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",l?(e.splice(s,0,["enter",a,t]),e.splice(l+1,0,["exit",e[r][1],t]),e[r][1].end={...e[l][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function oq(e,t,n){const r=this;let s;return l;function l(d){let m=r.events.length,p;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){p=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),s=d,a(d)):n(d)}function a(d){return e.enter("setextHeadingLineSequence"),u(d)}function u(d){return d===s?(e.consume(d),u):(e.exit("setextHeadingLineSequence"),We(d)?Ze(e,h,"lineSuffix")(d):h(d))}function h(d){return d===null||Ae(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const lq={tokenize:aq};function aq(e){const t=this,n=e.attempt(Du,r,e.attempt(this.parser.constructs.flowInitial,s,Ze(e,e.attempt(this.parser.constructs.flow,s,e.attempt(fW,s)),"linePrefix")));return n;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const cq={resolveAll:O5()},uq=N5("string"),hq=N5("text");function N5(e){return{resolveAll:O5(e==="text"?dq:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],l=n.attempt(s,a,u);return a;function a(m){return d(m)?l(m):u(m)}function u(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),h}function h(m){return d(m)?(n.exit("data"),l(m)):(n.consume(m),h)}function d(m){if(m===null)return!0;const p=s[m];let _=-1;if(p)for(;++_<p.length;){const b=p[_];if(!b.previous||b.previous.call(r,r.previous))return!0}return!1}}}function O5(e){return t;function t(n,r){let s=-1,l;for(;++s<=n.length;)l===void 0?n[s]&&n[s][1].type==="data"&&(l=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==l+2&&(n[l][1].end=n[s-1][1].end,n.splice(l+2,s-l-2),s=l+2),l=void 0);return e?e(n,r):n}}function dq(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],s=t.sliceStream(r);let l=s.length,a=-1,u=0,h;for(;l--;){const d=s[l];if(typeof d=="string"){for(a=d.length;d.charCodeAt(a-1)===32;)u++,a--;if(a)break;a=-1}else if(d===-2)h=!0,u++;else if(d!==-1){l++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(u=0),u){const d={type:n===e.length||h||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:l?a:r.start._bufferIndex+a,_index:r.start._index+l,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(e.splice(n,0,["enter",d,t],["exit",d,t]),n+=2)}n++}return e}const fq={42:Qn,43:Qn,45:Qn,48:Qn,49:Qn,50:Qn,51:Qn,52:Qn,53:Qn,54:Qn,55:Qn,56:Qn,57:Qn,62:k5},pq={91:_W},mq={[-2]:Zg,[-1]:Zg,32:Zg},gq={35:CW,42:jd,45:[C2,jd],60:MW,61:C2,95:jd,96:S2,126:S2},vq={38:R5,92:E5},_q={[-5]:Qg,[-4]:Qg,[-3]:Qg,33:VW,38:R5,42:L_,60:[G$,zW],91:GW,92:[SW,E5],93:mb,95:L_,96:lW},yq={null:[L_,cq]},bq={null:[42,95]},xq={null:[]},Sq=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:bq,contentInitial:pq,disable:xq,document:fq,flow:gq,flowInitial:mq,insideSpan:yq,string:vq,text:_q},Symbol.toStringTag,{value:"Module"}));function wq(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},l=[];let a=[],u=[];const h={attempt:O(z),check:O(L),consume:T,enter:R,exit:D,interrupt:O(L,{interrupt:!0})},d={code:null,containerState:{},defineSkip:w,events:[],now:S,parser:e,previous:null,sliceSerialize:_,sliceStream:b,write:p};let m=t.tokenize.call(d,h);return t.resolveAll&&l.push(t),d;function p(q){return a=zr(a,q),C(),a[a.length-1]!==null?[]:(B(t,0),d.events=qf(l,d.events,d),d.events)}function _(q,H){return kq(b(q),H)}function b(q){return Cq(a,q)}function S(){const{_bufferIndex:q,_index:H,line:U,column:V,offset:F}=r;return{_bufferIndex:q,_index:H,line:U,column:V,offset:F}}function w(q){s[q.line]=q.column,P()}function C(){let q;for(;r._index<a.length;){const H=a[r._index];if(typeof H=="string")for(q=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===q&&r._bufferIndex<H.length;)k(H.charCodeAt(r._bufferIndex));else k(H)}}function k(q){m=m(q)}function T(q){Ae(q)?(r.line++,r.column=1,r.offset+=q===-3?2:1,P()):q!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=q}function R(q,H){const U=H||{};return U.type=q,U.start=S(),d.events.push(["enter",U,d]),u.push(U),U}function D(q){const H=u.pop();return H.end=S(),d.events.push(["exit",H,d]),H}function z(q,H){B(q,H.from)}function L(q,H){H.restore()}function O(q,H){return U;function U(V,F,j){let K,$,J,A;return Array.isArray(V)?Y(V):"tokenize"in V?Y([V]):I(V);function I(se){return pe;function pe(ke){const me=ke!==null&&se[ke],Ee=ke!==null&&se.null,et=[...Array.isArray(me)?me:me?[me]:[],...Array.isArray(Ee)?Ee:Ee?[Ee]:[]];return Y(et)(ke)}}function Y(se){return K=se,$=0,se.length===0?j:M(se[$])}function M(se){return pe;function pe(ke){return A=X(),J=se,se.partial||(d.currentConstruct=se),se.name&&d.parser.constructs.disable.null.includes(se.name)?ae():se.tokenize.call(H?Object.assign(Object.create(d),H):d,h,Z,ae)(ke)}}function Z(se){return q(J,A),F}function ae(se){return A.restore(),++$<K.length?M(K[$]):j}}}function B(q,H){q.resolveAll&&!l.includes(q)&&l.push(q),q.resolve&&gr(d.events,H,d.events.length-H,q.resolve(d.events.slice(H),d)),q.resolveTo&&(d.events=q.resolveTo(d.events,d))}function X(){const q=S(),H=d.previous,U=d.currentConstruct,V=d.events.length,F=Array.from(u);return{from:V,restore:j};function j(){r=q,d.previous=H,d.currentConstruct=U,d.events.length=V,u=F,P()}}function P(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function Cq(e,t){const n=t.start._index,r=t.start._bufferIndex,s=t.end._index,l=t.end._bufferIndex;let a;if(n===s)a=[e[n].slice(r,l)];else{if(a=e.slice(n,s),r>-1){const u=a[0];typeof u=="string"?a[0]=u.slice(r):a.shift()}l>0&&a.push(e[s].slice(0,l))}return a}function kq(e,t){let n=-1;const r=[];let s;for(;++n<e.length;){const l=e[n];let a;if(typeof l=="string")a=l;else switch(l){case-5:{a="\r";break}case-4:{a=`
|
|
449
|
-
`;break}case-3:{a=`\r
|
|
450
|
-
`;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&s)continue;a=" ";break}default:a=String.fromCharCode(l)}s=l===-2,r.push(a)}return r.join("")}function Eq(e){const r={constructs:w5([Sq,...(e||{}).extensions||[]]),content:s(F$),defined:[],document:s($$),flow:s(lq),lazy:{},string:s(uq),text:s(hq)};return r;function s(l){return a;function a(u){return wq(r,l,u)}}}function Rq(e){for(;!M5(e););return e}const k2=/[\0\t\n\r]/g;function Mq(){let e=1,t="",n=!0,r;return s;function s(l,a,u){const h=[];let d,m,p,_,b;for(l=t+(typeof l=="string"?l.toString():new TextDecoder(a||void 0).decode(l)),p=0,t="",n&&(l.charCodeAt(0)===65279&&p++,n=void 0);p<l.length;){if(k2.lastIndex=p,d=k2.exec(l),_=d&&d.index!==void 0?d.index:l.length,b=l.charCodeAt(_),!d){t=l.slice(p);break}if(b===10&&p===_&&r)h.push(-3),r=void 0;else switch(r&&(h.push(-5),r=void 0),p<_&&(h.push(l.slice(p,_)),e+=_-p),b){case 0:{h.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,h.push(-2);e++<m;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:r=!0,e=1}p=_+1}return u&&(r&&h.push(-5),t&&h.push(t),h.push(null)),h}}const Tq=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Aq(e){return e.replace(Tq,Dq)}function Dq(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),l=s===120||s===88;return C5(n.slice(l?2:1),l?16:10)}return pb(n)||e}const L5={}.hasOwnProperty;function Nq(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Oq(n)(Rq(Eq(n).document().write(Mq()(e,t,!0))))}function Oq(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(pn),autolinkProtocol:X,autolinkEmail:X,atxHeading:l(dn),blockQuote:l(Ee),characterEscape:X,characterReference:X,codeFenced:l(et),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:l(et,a),codeText:l(Ge,a),codeTextData:X,data:X,codeFlowValue:X,definition:l(Me),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:l(Xe),hardBreakEscape:l(fn),hardBreakTrailing:l(fn),htmlFlow:l(Hr,a),htmlFlowData:X,htmlText:l(Hr,a),htmlTextData:X,image:l(Fr),label:a,link:l(pn),listItem:l(vr),listItemValue:_,listOrdered:l(mn,p),listUnordered:l(mn),paragraph:l(ni),reference:M,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:l(dn),strong:l(ls),thematicBreak:l(as)},exit:{atxHeading:h(),atxHeadingSequence:z,autolink:h(),autolinkEmail:me,autolinkProtocol:ke,blockQuote:h(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:ae,characterReferenceMarkerNumeric:ae,characterReferenceValue:se,characterReference:pe,codeFenced:h(C),codeFencedFence:w,codeFencedFenceInfo:b,codeFencedFenceMeta:S,codeFlowValue:P,codeIndented:h(k),codeText:h(F),codeTextData:P,data:P,definition:h(),definitionDestinationString:D,definitionLabelString:T,definitionTitleString:R,emphasis:h(),hardBreakEscape:h(H),hardBreakTrailing:h(H),htmlFlow:h(U),htmlFlowData:P,htmlText:h(V),htmlTextData:P,image:h(K),label:J,labelText:$,lineEnding:q,link:h(j),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:Z,resourceDestinationString:A,resourceTitleString:I,resource:Y,setextHeading:h(B),setextHeadingLineSequence:O,setextHeadingText:L,strong:h(),thematicBreak:h()}};z5(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(le){let ne={type:"root",children:[]};const de={stack:[ne],tokenStack:[],config:t,enter:u,exit:d,buffer:a,resume:m,data:n},ve=[];let Ce=-1;for(;++Ce<le.length;)if(le[Ce][1].type==="listOrdered"||le[Ce][1].type==="listUnordered")if(le[Ce][0]==="enter")ve.push(Ce);else{const Pe=ve.pop();Ce=s(le,Pe,Ce)}for(Ce=-1;++Ce<le.length;){const Pe=t[le[Ce][0]];L5.call(Pe,le[Ce][1].type)&&Pe[le[Ce][1].type].call(Object.assign({sliceSerialize:le[Ce][2].sliceSerialize},de),le[Ce][1])}if(de.tokenStack.length>0){const Pe=de.tokenStack[de.tokenStack.length-1];(Pe[1]||E2).call(de,void 0,Pe[0])}for(ne.position={start:Ps(le.length>0?le[0][1].start:{line:1,column:1,offset:0}),end:Ps(le.length>0?le[le.length-2][1].end:{line:1,column:1,offset:0})},Ce=-1;++Ce<t.transforms.length;)ne=t.transforms[Ce](ne)||ne;return ne}function s(le,ne,de){let ve=ne-1,Ce=-1,Pe=!1,nr,gn,At,Qt;for(;++ve<=de;){const rt=le[ve];switch(rt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{rt[0]==="enter"?Ce++:Ce--,Qt=void 0;break}case"lineEndingBlank":{rt[0]==="enter"&&(nr&&!Qt&&!Ce&&!At&&(At=ve),Qt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Qt=void 0}if(!Ce&&rt[0]==="enter"&&rt[1].type==="listItemPrefix"||Ce===-1&&rt[0]==="exit"&&(rt[1].type==="listUnordered"||rt[1].type==="listOrdered")){if(nr){let ri=ve;for(gn=void 0;ri--;){const Hn=le[ri];if(Hn[1].type==="lineEnding"||Hn[1].type==="lineEndingBlank"){if(Hn[0]==="exit")continue;gn&&(le[gn][1].type="lineEndingBlank",Pe=!0),Hn[1].type="lineEnding",gn=ri}else if(!(Hn[1].type==="linePrefix"||Hn[1].type==="blockQuotePrefix"||Hn[1].type==="blockQuotePrefixWhitespace"||Hn[1].type==="blockQuoteMarker"||Hn[1].type==="listItemIndent"))break}At&&(!gn||At<gn)&&(nr._spread=!0),nr.end=Object.assign({},gn?le[gn][1].start:rt[1].end),le.splice(gn||ve,0,["exit",nr,rt[2]]),ve++,de++}if(rt[1].type==="listItemPrefix"){const ri={type:"listItem",_spread:!1,start:Object.assign({},rt[1].start),end:void 0};nr=ri,le.splice(ve,0,["enter",ri,rt[2]]),ve++,de++,At=void 0,Qt=!0}}}return le[ne][1]._spread=Pe,de}function l(le,ne){return de;function de(ve){u.call(this,le(ve),ve),ne&&ne.call(this,ve)}}function a(){this.stack.push({type:"fragment",children:[]})}function u(le,ne,de){this.stack[this.stack.length-1].children.push(le),this.stack.push(le),this.tokenStack.push([ne,de||void 0]),le.position={start:Ps(ne.start),end:void 0}}function h(le){return ne;function ne(de){le&&le.call(this,de),d.call(this,de)}}function d(le,ne){const de=this.stack.pop(),ve=this.tokenStack.pop();if(ve)ve[0].type!==le.type&&(ne?ne.call(this,le,ve[0]):(ve[1]||E2).call(this,le,ve[0]));else throw new Error("Cannot close `"+le.type+"` ("+Fc({start:le.start,end:le.end})+"): it’s not open");de.position.end=Ps(le.end)}function m(){return fb(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function _(le){if(this.data.expectingFirstListItemValue){const ne=this.stack[this.stack.length-2];ne.start=Number.parseInt(this.sliceSerialize(le),10),this.data.expectingFirstListItemValue=void 0}}function b(){const le=this.resume(),ne=this.stack[this.stack.length-1];ne.lang=le}function S(){const le=this.resume(),ne=this.stack[this.stack.length-1];ne.meta=le}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const le=this.resume(),ne=this.stack[this.stack.length-1];ne.value=le.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function k(){const le=this.resume(),ne=this.stack[this.stack.length-1];ne.value=le.replace(/(\r?\n|\r)$/g,"")}function T(le){const ne=this.resume(),de=this.stack[this.stack.length-1];de.label=ne,de.identifier=Xr(this.sliceSerialize(le)).toLowerCase()}function R(){const le=this.resume(),ne=this.stack[this.stack.length-1];ne.title=le}function D(){const le=this.resume(),ne=this.stack[this.stack.length-1];ne.url=le}function z(le){const ne=this.stack[this.stack.length-1];if(!ne.depth){const de=this.sliceSerialize(le).length;ne.depth=de}}function L(){this.data.setextHeadingSlurpLineEnding=!0}function O(le){const ne=this.stack[this.stack.length-1];ne.depth=this.sliceSerialize(le).codePointAt(0)===61?1:2}function B(){this.data.setextHeadingSlurpLineEnding=void 0}function X(le){const de=this.stack[this.stack.length-1].children;let ve=de[de.length-1];(!ve||ve.type!=="text")&&(ve=Tt(),ve.position={start:Ps(le.start),end:void 0},de.push(ve)),this.stack.push(ve)}function P(le){const ne=this.stack.pop();ne.value+=this.sliceSerialize(le),ne.position.end=Ps(le.end)}function q(le){const ne=this.stack[this.stack.length-1];if(this.data.atHardBreak){const de=ne.children[ne.children.length-1];de.position.end=Ps(le.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(ne.type)&&(X.call(this,le),P.call(this,le))}function H(){this.data.atHardBreak=!0}function U(){const le=this.resume(),ne=this.stack[this.stack.length-1];ne.value=le}function V(){const le=this.resume(),ne=this.stack[this.stack.length-1];ne.value=le}function F(){const le=this.resume(),ne=this.stack[this.stack.length-1];ne.value=le}function j(){const le=this.stack[this.stack.length-1];if(this.data.inReference){const ne=this.data.referenceType||"shortcut";le.type+="Reference",le.referenceType=ne,delete le.url,delete le.title}else delete le.identifier,delete le.label;this.data.referenceType=void 0}function K(){const le=this.stack[this.stack.length-1];if(this.data.inReference){const ne=this.data.referenceType||"shortcut";le.type+="Reference",le.referenceType=ne,delete le.url,delete le.title}else delete le.identifier,delete le.label;this.data.referenceType=void 0}function $(le){const ne=this.sliceSerialize(le),de=this.stack[this.stack.length-2];de.label=Aq(ne),de.identifier=Xr(ne).toLowerCase()}function J(){const le=this.stack[this.stack.length-1],ne=this.resume(),de=this.stack[this.stack.length-1];if(this.data.inReference=!0,de.type==="link"){const ve=le.children;de.children=ve}else de.alt=ne}function A(){const le=this.resume(),ne=this.stack[this.stack.length-1];ne.url=le}function I(){const le=this.resume(),ne=this.stack[this.stack.length-1];ne.title=le}function Y(){this.data.inReference=void 0}function M(){this.data.referenceType="collapsed"}function Z(le){const ne=this.resume(),de=this.stack[this.stack.length-1];de.label=ne,de.identifier=Xr(this.sliceSerialize(le)).toLowerCase(),this.data.referenceType="full"}function ae(le){this.data.characterReferenceType=le.type}function se(le){const ne=this.sliceSerialize(le),de=this.data.characterReferenceType;let ve;de?(ve=C5(ne,de==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ve=pb(ne);const Ce=this.stack[this.stack.length-1];Ce.value+=ve}function pe(le){const ne=this.stack.pop();ne.position.end=Ps(le.end)}function ke(le){P.call(this,le);const ne=this.stack[this.stack.length-1];ne.url=this.sliceSerialize(le)}function me(le){P.call(this,le);const ne=this.stack[this.stack.length-1];ne.url="mailto:"+this.sliceSerialize(le)}function Ee(){return{type:"blockquote",children:[]}}function et(){return{type:"code",lang:null,meta:null,value:""}}function Ge(){return{type:"inlineCode",value:""}}function Me(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Xe(){return{type:"emphasis",children:[]}}function dn(){return{type:"heading",depth:0,children:[]}}function fn(){return{type:"break"}}function Hr(){return{type:"html",value:""}}function Fr(){return{type:"image",title:null,url:"",alt:null}}function pn(){return{type:"link",title:null,url:"",children:[]}}function mn(le){return{type:"list",ordered:le.type==="listOrdered",start:null,spread:le._spread,children:[]}}function vr(le){return{type:"listItem",spread:le._spread,checked:null,children:[]}}function ni(){return{type:"paragraph",children:[]}}function ls(){return{type:"strong",children:[]}}function Tt(){return{type:"text",value:""}}function as(){return{type:"thematicBreak"}}}function Ps(e){return{line:e.line,column:e.column,offset:e.offset}}function z5(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?z5(e,r):Lq(e,r)}}function Lq(e,t){let n;for(n in t)if(L5.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function E2(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Fc({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Fc({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Fc({start:t.start,end:t.end})+") is still open")}function zq(e){const t=this;t.parser=n;function n(r){return Nq(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Bq(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function jq(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
451
|
-
`}]}function Pq(e,t){const n=t.value?t.value+`
|
|
452
|
-
`:"",r={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function Iq(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Hq(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Fq(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=ba(r.toLowerCase()),l=e.footnoteOrder.indexOf(r);let a,u=e.footnoteCounts.get(r);u===void 0?(u=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=l+1,u+=1,e.footnoteCounts.set(r,u);const h={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,h);const d={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(t,d),e.applyData(t,d)}function Uq(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $q(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function B5(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const s=e.all(t),l=s[0];l&&l.type==="text"?l.value="["+l.value:s.unshift({type:"text",value:"["});const a=s[s.length-1];return a&&a.type==="text"?a.value+=r:s.push({type:"text",value:r}),s}function Wq(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return B5(e,t);const s={src:ba(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const l={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,l),e.applyData(t,l)}function qq(e,t){const n={src:ba(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Vq(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Kq(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return B5(e,t);const s={href:ba(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const l={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function Gq(e,t){const n={href:ba(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Yq(e,t,n){const r=e.all(t),s=n?Xq(n):j5(t),l={},a=[];if(typeof t.checked=="boolean"){const m=r[0];let p;m&&m.type==="element"&&m.tagName==="p"?p=m:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let u=-1;for(;++u<r.length;){const m=r[u];(s||u!==0||m.type!=="element"||m.tagName!=="p")&&a.push({type:"text",value:`
|
|
453
|
-
`}),m.type==="element"&&m.tagName==="p"&&!s?a.push(...m.children):a.push(m)}const h=r[r.length-1];h&&(s||h.type!=="element"||h.tagName!=="p")&&a.push({type:"text",value:`
|
|
454
|
-
`});const d={type:"element",tagName:"li",properties:l,children:a};return e.patch(t,d),e.applyData(t,d)}function Xq(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=j5(n[r])}return t}function j5(e){const t=e.spread;return t??e.children.length>1}function Zq(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<r.length;){const a=r[s];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const l={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,l),e.applyData(t,l)}function Qq(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Jq(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function eV(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function tV(e,t){const n=e.all(t),r=n.shift(),s=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),s.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},u=cb(t.children[1]),h=g5(t.children[t.children.length-1]);u&&h&&(a.position={start:u,end:h}),s.push(a)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,l),e.applyData(t,l)}function nV(e,t,n){const r=n?n.children:void 0,l=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,u=a?a.length:t.children.length;let h=-1;const d=[];for(;++h<u;){const p=t.children[h],_={},b=a?a[h]:void 0;b&&(_.align=b);let S={type:"element",tagName:l,properties:_,children:[]};p&&(S.children=e.all(p),e.patch(p,S),S=e.applyData(p,S)),d.push(S)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,m),e.applyData(t,m)}function rV(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const R2=9,M2=32;function iV(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const l=[];for(;r;)l.push(T2(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return l.push(T2(t.slice(s),s>0,!1)),l.join("")}function T2(e,t,n){let r=0,s=e.length;if(t){let l=e.codePointAt(r);for(;l===R2||l===M2;)r++,l=e.codePointAt(r)}if(n){let l=e.codePointAt(s-1);for(;l===R2||l===M2;)s--,l=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function sV(e,t){const n={type:"text",value:iV(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function oV(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const lV={blockquote:Bq,break:jq,code:Pq,delete:Iq,emphasis:Hq,footnoteReference:Fq,heading:Uq,html:$q,imageReference:Wq,image:qq,inlineCode:Vq,linkReference:Kq,link:Gq,listItem:Yq,list:Zq,paragraph:Qq,root:Jq,strong:eV,table:tV,tableCell:rV,tableRow:nV,text:sV,thematicBreak:oV,toml:md,yaml:md,definition:md,footnoteDefinition:md};function md(){}const P5=-1,Vf=0,$c=1,uf=2,gb=3,vb=4,_b=5,yb=6,I5=7,H5=8,A2=typeof self=="object"?self:globalThis,aV=(e,t)=>{const n=(s,l)=>(e.set(l,s),s),r=s=>{if(e.has(s))return e.get(s);const[l,a]=t[s];switch(l){case Vf:case P5:return n(a,s);case $c:{const u=n([],s);for(const h of a)u.push(r(h));return u}case uf:{const u=n({},s);for(const[h,d]of a)u[r(h)]=r(d);return u}case gb:return n(new Date(a),s);case vb:{const{source:u,flags:h}=a;return n(new RegExp(u,h),s)}case _b:{const u=n(new Map,s);for(const[h,d]of a)u.set(r(h),r(d));return u}case yb:{const u=n(new Set,s);for(const h of a)u.add(r(h));return u}case I5:{const{name:u,message:h}=a;return n(new A2[u](h),s)}case H5:return n(BigInt(a),s);case"BigInt":return n(Object(BigInt(a)),s);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:u}=new Uint8Array(a);return n(new DataView(u),a)}}return n(new A2[l](a),s)};return r},D2=e=>aV(new Map,e)(0),Ul="",{toString:cV}={},{keys:uV}=Object,Ec=e=>{const t=typeof e;if(t!=="object"||!e)return[Vf,t];const n=cV.call(e).slice(8,-1);switch(n){case"Array":return[$c,Ul];case"Object":return[uf,Ul];case"Date":return[gb,Ul];case"RegExp":return[vb,Ul];case"Map":return[_b,Ul];case"Set":return[yb,Ul];case"DataView":return[$c,n]}return n.includes("Array")?[$c,n]:n.includes("Error")?[I5,n]:[uf,n]},gd=([e,t])=>e===Vf&&(t==="function"||t==="symbol"),hV=(e,t,n,r)=>{const s=(a,u)=>{const h=r.push(a)-1;return n.set(u,h),h},l=a=>{if(n.has(a))return n.get(a);let[u,h]=Ec(a);switch(u){case Vf:{let m=a;switch(h){case"bigint":u=H5,m=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);m=null;break;case"undefined":return s([P5],a)}return s([u,m],a)}case $c:{if(h){let _=a;return h==="DataView"?_=new Uint8Array(a.buffer):h==="ArrayBuffer"&&(_=new Uint8Array(a)),s([h,[..._]],a)}const m=[],p=s([u,m],a);for(const _ of a)m.push(l(_));return p}case uf:{if(h)switch(h){case"BigInt":return s([h,a.toString()],a);case"Boolean":case"Number":case"String":return s([h,a.valueOf()],a)}if(t&&"toJSON"in a)return l(a.toJSON());const m=[],p=s([u,m],a);for(const _ of uV(a))(e||!gd(Ec(a[_])))&&m.push([l(_),l(a[_])]);return p}case gb:return s([u,a.toISOString()],a);case vb:{const{source:m,flags:p}=a;return s([u,{source:m,flags:p}],a)}case _b:{const m=[],p=s([u,m],a);for(const[_,b]of a)(e||!(gd(Ec(_))||gd(Ec(b))))&&m.push([l(_),l(b)]);return p}case yb:{const m=[],p=s([u,m],a);for(const _ of a)(e||!gd(Ec(_)))&&m.push(l(_));return p}}const{message:d}=a;return s([u,{name:h,message:d}],a)};return l},N2=(e,{json:t,lossy:n}={})=>{const r=[];return hV(!(t||n),!!t,new Map,r)(e),r},hf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?D2(N2(e,t)):structuredClone(e):(e,t)=>D2(N2(e,t));function dV(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function fV(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function pV(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||dV,r=e.options.footnoteBackLabel||fV,s=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let h=-1;for(;++h<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[h]);if(!d)continue;const m=e.all(d),p=String(d.identifier).toUpperCase(),_=ba(p.toLowerCase());let b=0;const S=[],w=e.footnoteCounts.get(p);for(;w!==void 0&&++b<=w;){S.length>0&&S.push({type:"text",value:" "});let T=typeof n=="string"?n:n(h,b);typeof T=="string"&&(T={type:"text",value:T}),S.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+_+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(h,b),className:["data-footnote-backref"]},children:Array.isArray(T)?T:[T]})}const C=m[m.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const T=C.children[C.children.length-1];T&&T.type==="text"?T.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...S)}else m.push(...S);const k={type:"element",tagName:"li",properties:{id:t+"fn-"+_},children:e.wrap(m,!0)};e.patch(d,k),u.push(k)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...hf(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
455
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
|
|
456
|
-
`}]}}const Kf=(function(e){if(e==null)return _V;if(typeof e=="function")return Gf(e);if(typeof e=="object")return Array.isArray(e)?mV(e):gV(e);if(typeof e=="string")return vV(e);throw new Error("Expected function, string, or object as test")});function mV(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Kf(e[n]);return Gf(r);function r(...s){let l=-1;for(;++l<t.length;)if(t[l].apply(this,s))return!0;return!1}}function gV(e){const t=e;return Gf(n);function n(r){const s=r;let l;for(l in e)if(s[l]!==t[l])return!1;return!0}}function vV(e){return Gf(t);function t(n){return n&&n.type===e}}function Gf(e){return t;function t(n,r,s){return!!(yV(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function _V(){return!0}function yV(e){return e!==null&&typeof e=="object"&&"type"in e}const F5=[],bV=!0,z_=!1,xV="skip";function U5(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const l=Kf(s),a=r?-1:1;u(e,void 0,[])();function u(h,d,m){const p=h&&typeof h=="object"?h:{};if(typeof p.type=="string"){const b=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(_,"name",{value:"node ("+(h.type+(b?"<"+b+">":""))+")"})}return _;function _(){let b=F5,S,w,C;if((!t||l(h,d,m[m.length-1]||void 0))&&(b=SV(n(h,m)),b[0]===z_))return b;if("children"in h&&h.children){const k=h;if(k.children&&b[0]!==xV)for(w=(r?k.children.length:-1)+a,C=m.concat(k);w>-1&&w<k.children.length;){const T=k.children[w];if(S=u(T,w,C)(),S[0]===z_)return S;w=typeof S[1]=="number"?S[1]:w+a}}return b}}}function SV(e){return Array.isArray(e)?e:typeof e=="number"?[bV,e]:e==null?F5:[e]}function bb(e,t,n,r){let s,l,a;typeof t=="function"&&typeof n!="function"?(l=void 0,a=t,s=n):(l=t,a=n,s=r),U5(e,l,u,s);function u(h,d){const m=d[d.length-1],p=m?m.children.indexOf(h):void 0;return a(h,p,m)}}const B_={}.hasOwnProperty,wV={};function CV(e,t){const n=t||wV,r=new Map,s=new Map,l=new Map,a={...lV,...n.handlers},u={all:d,applyData:EV,definitionById:r,footnoteById:s,footnoteCounts:l,footnoteOrder:[],handlers:a,one:h,options:n,patch:kV,wrap:MV};return bb(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const p=m.type==="definition"?r:s,_=String(m.identifier).toUpperCase();p.has(_)||p.set(_,m)}}),u;function h(m,p){const _=m.type,b=u.handlers[_];if(B_.call(u.handlers,_)&&b)return b(u,m,p);if(u.options.passThrough&&u.options.passThrough.includes(_)){if("children"in m){const{children:w,...C}=m,k=hf(C);return k.children=u.all(m),k}return hf(m)}return(u.options.unknownHandler||RV)(u,m,p)}function d(m){const p=[];if("children"in m){const _=m.children;let b=-1;for(;++b<_.length;){const S=u.one(_[b],m);if(S){if(b&&_[b-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=O2(S.value)),!Array.isArray(S)&&S.type==="element")){const w=S.children[0];w&&w.type==="text"&&(w.value=O2(w.value))}Array.isArray(S)?p.push(...S):p.push(S)}}}return p}}function kV(e,t){e.position&&(t.position=f$(e))}function EV(e,t){let n=t;if(e&&e.data){const r=e.data.hName,s=e.data.hChildren,l=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&l&&Object.assign(n.properties,hf(l)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function RV(e,t){const n=t.data||{},r="value"in t&&!(B_.call(n,"hProperties")||B_.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function MV(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
457
|
-
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
458
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
459
|
-
`}),n}function O2(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function L2(e,t){const n=CV(e,t),r=n.one(e,void 0),s=pV(n),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&l.children.push({type:"text",value:`
|
|
460
|
-
`},s),l}function TV(e,t){return e&&"run"in e?async function(n,r){const s=L2(n,{file:r,...t});await e.run(s,r)}:function(n,r){return L2(n,{file:r,...e||t})}}function z2(e){if(e)throw e}var Jg,B2;function AV(){if(B2)return Jg;B2=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},l=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var m=e.call(d,"constructor"),p=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!m&&!p)return!1;var _;for(_ in d);return typeof _>"u"||e.call(d,_)},a=function(d,m){n&&m.name==="__proto__"?n(d,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):d[m.name]=m.newValue},u=function(d,m){if(m==="__proto__")if(e.call(d,m)){if(r)return r(d,m).value}else return;return d[m]};return Jg=function h(){var d,m,p,_,b,S,w=arguments[0],C=1,k=arguments.length,T=!1;for(typeof w=="boolean"&&(T=w,w=arguments[1]||{},C=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});C<k;++C)if(d=arguments[C],d!=null)for(m in d)p=u(w,m),_=u(d,m),w!==_&&(T&&_&&(l(_)||(b=s(_)))?(b?(b=!1,S=p&&s(p)?p:[]):S=p&&l(p)?p:{},a(w,{name:m,newValue:h(T,S,_)})):typeof _<"u"&&a(w,{name:m,newValue:_}));return w},Jg}var DV=AV();const ev=pf(DV);function j_(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function NV(){const e=[],t={run:n,use:r};return t;function n(...s){let l=-1;const a=s.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);u(null,...s);function u(h,...d){const m=e[++l];let p=-1;if(h){a(h);return}for(;++p<s.length;)(d[p]===null||d[p]===void 0)&&(d[p]=s[p]);s=d,m?OV(m,u)(...d):a(null,...d)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function OV(e,t){let n;return r;function r(...a){const u=e.length>a.length;let h;u&&a.push(s);try{h=e.apply(this,a)}catch(d){const m=d;if(u&&n)throw m;return s(m)}u||(h&&h.then&&typeof h.then=="function"?h.then(l,s):h instanceof Error?s(h):l(h))}function s(a,...u){n||(n=!0,t(a,...u))}function l(a){s(null,a)}}const hi={basename:LV,dirname:zV,extname:BV,join:jV,sep:"/"};function LV(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Nu(e);let n=0,r=-1,s=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(l){n=s+1;break}}else r<0&&(l=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,u=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(l){n=s+1;break}}else a<0&&(l=!0,a=s+1),u>-1&&(e.codePointAt(s)===t.codePointAt(u--)?u<0&&(r=s):(u=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function zV(e){if(Nu(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function BV(e){Nu(e);let t=e.length,n=-1,r=0,s=-1,l=0,a;for(;t--;){const u=e.codePointAt(t);if(u===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),u===46?s<0?s=t:l!==1&&(l=1):s>-1&&(l=-1)}return s<0||n<0||l===0||l===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function jV(...e){let t=-1,n;for(;++t<e.length;)Nu(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":PV(n)}function PV(e){Nu(e);const t=e.codePointAt(0)===47;let n=IV(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function IV(e,t){let n="",r=0,s=-1,l=0,a=-1,u,h;for(;++a<=e.length;){if(a<e.length)u=e.codePointAt(a);else{if(u===47)break;u=47}if(u===47){if(!(s===a-1||l===1))if(s!==a-1&&l===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(h=n.lastIndexOf("/"),h!==n.length-1){h<0?(n="",r=0):(n=n.slice(0,h),r=n.length-1-n.lastIndexOf("/")),s=a,l=0;continue}}else if(n.length>0){n="",r=0,s=a,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,a):n=e.slice(s+1,a),r=a-s-1;s=a,l=0}else u===46&&l>-1?l++:l=-1}return n}function Nu(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const HV={cwd:FV};function FV(){return"/"}function P_(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function UV(e){if(typeof e=="string")e=new URL(e);else if(!P_(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return $V(e)}function $V(e){if(e.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 t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const tv=["history","path","basename","stem","extname","dirname"];class $5{constructor(t){let n;t?P_(t)?n={path:t}:typeof t=="string"||WV(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":HV.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<tv.length;){const l=tv[r];l in n&&n[l]!==void 0&&n[l]!==null&&(this[l]=l==="history"?[...n[l]]:n[l])}let s;for(s in n)tv.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?hi.basename(this.path):void 0}set basename(t){rv(t,"basename"),nv(t,"basename"),this.path=hi.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?hi.dirname(this.path):void 0}set dirname(t){j2(this.basename,"dirname"),this.path=hi.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?hi.extname(this.path):void 0}set extname(t){if(nv(t,"extname"),j2(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=hi.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){P_(t)&&(t=UV(t)),rv(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?hi.basename(this.path,this.extname):void 0}set stem(t){rv(t,"stem"),nv(t,"stem"),this.path=hi.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const s=this.message(t,n,r);throw s.fatal=!0,s}info(t,n,r){const s=this.message(t,n,r);return s.fatal=void 0,s}message(t,n,r){const s=new An(t,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function nv(e,t){if(e&&e.includes(hi.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+hi.sep+"`")}function rv(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function j2(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function WV(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const qV=(function(e){const r=this.constructor.prototype,s=r[e],l=function(){return s.apply(l,arguments)};return Object.setPrototypeOf(l,r),l}),VV={}.hasOwnProperty;class xb extends qV{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=NV()}copy(){const t=new xb;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(ev(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(ov("data",this.frozen),this.namespace[t]=n,this):VV.call(this.namespace,t)&&this.namespace[t]||void 0:t?(ov("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=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 s=n.call(t,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=vd(t),r=this.parser||this.Parser;return iv("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),iv("process",this.parser||this.Parser),sv("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(l,a){const u=vd(t),h=r.parse(u);r.run(h,u,function(m,p,_){if(m||!p||!_)return d(m);const b=p,S=r.stringify(b,_);YV(S)?_.value=S:_.result=S,d(m,_)});function d(m,p){m||!p?a(m):l?l(p):n(void 0,p)}}}processSync(t){let n=!1,r;return this.freeze(),iv("processSync",this.parser||this.Parser),sv("processSync",this.compiler||this.Compiler),this.process(t,s),I2("processSync","process",n),r;function s(l,a){n=!0,z2(l),r=a}}run(t,n,r){P2(t),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?l(void 0,r):new Promise(l);function l(a,u){const h=vd(n);s.run(t,h,d);function d(m,p,_){const b=p||t;m?u(m):a?a(b):r(void 0,b,_)}}}runSync(t,n){let r=!1,s;return this.run(t,n,l),I2("runSync","run",r),s;function l(a,u){z2(a),s=u,r=!0}}stringify(t,n){this.freeze();const r=vd(n),s=this.compiler||this.Compiler;return sv("stringify",s),P2(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(ov("use",this.frozen),t!=null)if(typeof t=="function")h(t,n);else if(typeof t=="object")Array.isArray(t)?u(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function l(d){if(typeof d=="function")h(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[m,...p]=d;h(m,p)}else a(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function a(d){if(!("plugins"in d)&&!("settings"in d))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");u(d.plugins),d.settings&&(s.settings=ev(!0,s.settings,d.settings))}function u(d){let m=-1;if(d!=null)if(Array.isArray(d))for(;++m<d.length;){const p=d[m];l(p)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function h(d,m){let p=-1,_=-1;for(;++p<r.length;)if(r[p][0]===d){_=p;break}if(_===-1)r.push([d,...m]);else if(m.length>0){let[b,...S]=m;const w=r[_][1];j_(w)&&j_(b)&&(b=ev(!0,w,b)),r[_]=[d,b,...S]}}}}const KV=new xb().freeze();function iv(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function sv(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ov(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function P2(e){if(!j_(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function I2(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function vd(e){return GV(e)?e:new $5(e)}function GV(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function YV(e){return typeof e=="string"||XV(e)}function XV(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const ZV="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",H2=[],F2={allowDangerousHtml:!0},QV=/^(https?|ircs?|mailto|xmpp)$/i,JV=[{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 Yf(e){const t=eK(e),n=tK(e);return nK(t.runSync(t.parse(n),n),e)}function eK(e){const t=e.rehypePlugins||H2,n=e.remarkPlugins||H2,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...F2}:F2;return KV().use(zq).use(n).use(TV,r).use(t)}function tK(e){const t=e.children||"",n=new $5;return typeof t=="string"&&(n.value=t),n}function nK(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,l=t.disallowedElements,a=t.skipHtml,u=t.unwrapDisallowed,h=t.urlTransform||rK;for(const m of JV)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+ZV+m.id,void 0);return bb(e,d),_$(e,{Fragment:v.Fragment,components:s,ignoreInvalidStyle:!0,jsx:v.jsx,jsxs:v.jsxs,passKeys:!0,passNode:!0});function d(m,p,_){if(m.type==="raw"&&_&&typeof p=="number")return a?_.children.splice(p,1):_.children[p]={type:"text",value:m.value},p;if(m.type==="element"){let b;for(b in Xg)if(Object.hasOwn(Xg,b)&&Object.hasOwn(m.properties,b)){const S=m.properties[b],w=Xg[b];(w===null||w.includes(m.tagName))&&(m.properties[b]=h(String(S||""),b,m))}}if(m.type==="element"){let b=n?!n.includes(m.tagName):l?l.includes(m.tagName):!1;if(!b&&r&&typeof p=="number"&&(b=!r(m,p,_)),b&&_&&typeof p=="number")return u&&m.children?_.children.splice(p,1,...m.children):_.children.splice(p,1),p}}}function rK(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||r!==-1&&t>r||QV.test(e.slice(0,t))?e:""}function U2(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(t);for(;s!==-1;)r++,s=n.indexOf(t,s+t.length);return r}function iK(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function sK(e,t,n){const s=Kf((n||{}).ignore||[]),l=oK(t);let a=-1;for(;++a<l.length;)U5(e,"text",u);function u(d,m){let p=-1,_;for(;++p<m.length;){const b=m[p],S=_?_.children:void 0;if(s(b,S?S.indexOf(b):void 0,_))return;_=b}if(_)return h(d,m)}function h(d,m){const p=m[m.length-1],_=l[a][0],b=l[a][1];let S=0;const C=p.children.indexOf(d);let k=!1,T=[];_.lastIndex=0;let R=_.exec(d.value);for(;R;){const D=R.index,z={index:R.index,input:R.input,stack:[...m,d]};let L=b(...R,z);if(typeof L=="string"&&(L=L.length>0?{type:"text",value:L}:void 0),L===!1?_.lastIndex=D+1:(S!==D&&T.push({type:"text",value:d.value.slice(S,D)}),Array.isArray(L)?T.push(...L):L&&T.push(L),S=D+R[0].length,k=!0),!_.global)break;R=_.exec(d.value)}return k?(S<d.value.length&&T.push({type:"text",value:d.value.slice(S)}),p.children.splice(C,1,...T)):T=[d],C+T.length}}function oK(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const s=n[r];t.push([lK(s[0]),aK(s[1])])}return t}function lK(e){return typeof e=="string"?new RegExp(iK(e),"g"):e}function aK(e){return typeof e=="function"?e:function(){return e}}const lv="phrasing",av=["autolink","link","image","label"];function cK(){return{transforms:[gK],enter:{literalAutolink:hK,literalAutolinkEmail:cv,literalAutolinkHttp:cv,literalAutolinkWww:cv},exit:{literalAutolink:mK,literalAutolinkEmail:pK,literalAutolinkHttp:dK,literalAutolinkWww:fK}}}function uK(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:lv,notInConstruct:av},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:lv,notInConstruct:av},{character:":",before:"[ps]",after:"\\/",inConstruct:lv,notInConstruct:av}]}}function hK(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function cv(e){this.config.enter.autolinkProtocol.call(this,e)}function dK(e){this.config.exit.autolinkProtocol.call(this,e)}function fK(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function pK(e){this.config.exit.autolinkEmail.call(this,e)}function mK(e){this.exit(e)}function gK(e){sK(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,vK],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),_K]],{ignore:["link","linkReference"]})}function vK(e,t,n,r,s){let l="";if(!W5(s)||(/^w/i.test(t)&&(n=t+n,t="",l="http://"),!yK(n)))return!1;const a=bK(n+r);if(!a[0])return!1;const u={type:"link",title:null,url:l+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[u,{type:"text",value:a[1]}]:u}function _K(e,t,n,r){return!W5(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function yK(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function bK(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const s=U2(e,"(");let l=U2(e,")");for(;r!==-1&&s>l;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),l++;return[e,n]}function W5(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Fo(n)||Wf(n))&&(!t||n!==47)}q5.peek=TK;function xK(){this.buffer()}function SK(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function wK(){this.buffer()}function CK(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function kK(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Xr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function EK(e){this.exit(e)}function RK(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Xr(this.sliceSerialize(e)).toLowerCase(),n.label=t}function MK(e){this.exit(e)}function TK(){return"["}function q5(e,t,n,r){const s=n.createTracker(r);let l=s.move("[^");const a=n.enter("footnoteReference"),u=n.enter("reference");return l+=s.move(n.safe(n.associationId(e),{after:"]",before:l})),u(),a(),l+=s.move("]"),l}function AK(){return{enter:{gfmFootnoteCallString:xK,gfmFootnoteCall:SK,gfmFootnoteDefinitionLabelString:wK,gfmFootnoteDefinition:CK},exit:{gfmFootnoteCallString:kK,gfmFootnoteCall:EK,gfmFootnoteDefinitionLabelString:RK,gfmFootnoteDefinition:MK}}}function DK(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:q5},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,l,a){const u=l.createTracker(a);let h=u.move("[^");const d=l.enter("footnoteDefinition"),m=l.enter("label");return h+=u.move(l.safe(l.associationId(r),{before:h,after:"]"})),m(),h+=u.move("]:"),r.children&&r.children.length>0&&(u.shift(4),h+=u.move((t?`
|
|
461
|
-
`:" ")+l.indentLines(l.containerFlow(r,u.current()),t?V5:NK))),d(),h}}function NK(e,t,n){return t===0?e:V5(e,t,n)}function V5(e,t,n){return(n?"":" ")+e}const OK=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];K5.peek=PK;function LK(){return{canContainEols:["delete"],enter:{strikethrough:BK},exit:{strikethrough:jK}}}function zK(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:OK}],handlers:{delete:K5}}}function BK(e){this.enter({type:"delete",children:[]},e)}function jK(e){this.exit(e)}function K5(e,t,n,r){const s=n.createTracker(r),l=n.enter("strikethrough");let a=s.move("~~");return a+=n.containerPhrasing(e,{...s.current(),before:a,after:"~"}),a+=s.move("~~"),l(),a}function PK(){return"~"}function IK(e){return e.length}function HK(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||IK,l=[],a=[],u=[],h=[];let d=0,m=-1;for(;++m<e.length;){const w=[],C=[];let k=-1;for(e[m].length>d&&(d=e[m].length);++k<e[m].length;){const T=FK(e[m][k]);if(n.alignDelimiters!==!1){const R=s(T);C[k]=R,(h[k]===void 0||R>h[k])&&(h[k]=R)}w.push(T)}a[m]=w,u[m]=C}let p=-1;if(typeof r=="object"&&"length"in r)for(;++p<d;)l[p]=$2(r[p]);else{const w=$2(r);for(;++p<d;)l[p]=w}p=-1;const _=[],b=[];for(;++p<d;){const w=l[p];let C="",k="";w===99?(C=":",k=":"):w===108?C=":":w===114&&(k=":");let T=n.alignDelimiters===!1?1:Math.max(1,h[p]-C.length-k.length);const R=C+"-".repeat(T)+k;n.alignDelimiters!==!1&&(T=C.length+T+k.length,T>h[p]&&(h[p]=T),b[p]=T),_[p]=R}a.splice(1,0,_),u.splice(1,0,b),m=-1;const S=[];for(;++m<a.length;){const w=a[m],C=u[m];p=-1;const k=[];for(;++p<d;){const T=w[p]||"";let R="",D="";if(n.alignDelimiters!==!1){const z=h[p]-(C[p]||0),L=l[p];L===114?R=" ".repeat(z):L===99?z%2?(R=" ".repeat(z/2+.5),D=" ".repeat(z/2-.5)):(R=" ".repeat(z/2),D=R):D=" ".repeat(z)}n.delimiterStart!==!1&&!p&&k.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&T==="")&&(n.delimiterStart!==!1||p)&&k.push(" "),n.alignDelimiters!==!1&&k.push(R),k.push(T),n.alignDelimiters!==!1&&k.push(D),n.padding!==!1&&k.push(" "),(n.delimiterEnd!==!1||p!==d-1)&&k.push("|")}S.push(n.delimiterEnd===!1?k.join("").replace(/ +$/,""):k.join(""))}return S.join(`
|
|
462
|
-
`)}function FK(e){return e==null?"":String(e)}function $2(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function UK(e,t,n,r){const s=n.enter("blockquote"),l=n.createTracker(r);l.move("> "),l.shift(2);const a=n.indentLines(n.containerFlow(e,l.current()),$K);return s(),a}function $K(e,t,n){return">"+(n?"":" ")+e}function WK(e,t){return W2(e,t.inConstruct,!0)&&!W2(e,t.notInConstruct,!1)}function W2(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function q2(e,t,n,r){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
|
|
463
|
-
`&&WK(n.stack,n.unsafe[s]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
464
|
-
`}function qK(e,t){const n=String(e);let r=n.indexOf(t),s=r,l=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===s?++l>a&&(a=l):l=1,s=r+t.length,r=n.indexOf(t,s);return a}function VK(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function KK(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function GK(e,t,n,r){const s=KK(n),l=e.value||"",a=s==="`"?"GraveAccent":"Tilde";if(VK(e,n)){const p=n.enter("codeIndented"),_=n.indentLines(l,YK);return p(),_}const u=n.createTracker(r),h=s.repeat(Math.max(qK(l,s)+1,3)),d=n.enter("codeFenced");let m=u.move(h);if(e.lang){const p=n.enter(`codeFencedLang${a}`);m+=u.move(n.safe(e.lang,{before:m,after:" ",encode:["`"],...u.current()})),p()}if(e.lang&&e.meta){const p=n.enter(`codeFencedMeta${a}`);m+=u.move(" "),m+=u.move(n.safe(e.meta,{before:m,after:`
|
|
465
|
-
`,encode:["`"],...u.current()})),p()}return m+=u.move(`
|
|
466
|
-
`),l&&(m+=u.move(l+`
|
|
467
|
-
`)),m+=u.move(h),d(),m}function YK(e,t,n){return(n?"":" ")+e}function Sb(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function XK(e,t,n,r){const s=Sb(n),l=s==='"'?"Quote":"Apostrophe",a=n.enter("definition");let u=n.enter("label");const h=n.createTracker(r);let d=h.move("[");return d+=h.move(n.safe(n.associationId(e),{before:d,after:"]",...h.current()})),d+=h.move("]: "),u(),!e.url||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),d+=h.move("<"),d+=h.move(n.safe(e.url,{before:d,after:">",...h.current()})),d+=h.move(">")):(u=n.enter("destinationRaw"),d+=h.move(n.safe(e.url,{before:d,after:e.title?" ":`
|
|
468
|
-
`,...h.current()}))),u(),e.title&&(u=n.enter(`title${l}`),d+=h.move(" "+s),d+=h.move(n.safe(e.title,{before:d,after:s,...h.current()})),d+=h.move(s),u()),a(),d}function ZK(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function au(e){return"&#x"+e.toString(16).toUpperCase()+";"}function df(e,t,n){const r=aa(e),s=aa(t);return r===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}G5.peek=QK;function G5(e,t,n,r){const s=ZK(n),l=n.enter("emphasis"),a=n.createTracker(r),u=a.move(s);let h=a.move(n.containerPhrasing(e,{after:s,before:u,...a.current()}));const d=h.charCodeAt(0),m=df(r.before.charCodeAt(r.before.length-1),d,s);m.inside&&(h=au(d)+h.slice(1));const p=h.charCodeAt(h.length-1),_=df(r.after.charCodeAt(0),p,s);_.inside&&(h=h.slice(0,-1)+au(p));const b=a.move(s);return l(),n.attentionEncodeSurroundingInfo={after:_.outside,before:m.outside},u+h+b}function QK(e,t,n){return n.options.emphasis||"*"}function JK(e,t){let n=!1;return bb(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,z_}),!!((!e.depth||e.depth<3)&&fb(e)&&(t.options.setext||n))}function eG(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),l=n.createTracker(r);if(JK(e,n)){const m=n.enter("headingSetext"),p=n.enter("phrasing"),_=n.containerPhrasing(e,{...l.current(),before:`
|
|
469
|
-
`,after:`
|
|
470
|
-
`});return p(),m(),_+`
|
|
471
|
-
`+(s===1?"=":"-").repeat(_.length-(Math.max(_.lastIndexOf("\r"),_.lastIndexOf(`
|
|
472
|
-
`))+1))}const a="#".repeat(s),u=n.enter("headingAtx"),h=n.enter("phrasing");l.move(a+" ");let d=n.containerPhrasing(e,{before:"# ",after:`
|
|
473
|
-
`,...l.current()});return/^[\t ]/.test(d)&&(d=au(d.charCodeAt(0))+d.slice(1)),d=d?a+" "+d:a,n.options.closeAtx&&(d+=" "+a),h(),u(),d}Y5.peek=tG;function Y5(e){return e.value||""}function tG(){return"<"}X5.peek=nG;function X5(e,t,n,r){const s=Sb(n),l=s==='"'?"Quote":"Apostrophe",a=n.enter("image");let u=n.enter("label");const h=n.createTracker(r);let d=h.move("![");return d+=h.move(n.safe(e.alt,{before:d,after:"]",...h.current()})),d+=h.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),d+=h.move("<"),d+=h.move(n.safe(e.url,{before:d,after:">",...h.current()})),d+=h.move(">")):(u=n.enter("destinationRaw"),d+=h.move(n.safe(e.url,{before:d,after:e.title?" ":")",...h.current()}))),u(),e.title&&(u=n.enter(`title${l}`),d+=h.move(" "+s),d+=h.move(n.safe(e.title,{before:d,after:s,...h.current()})),d+=h.move(s),u()),d+=h.move(")"),a(),d}function nG(){return"!"}Z5.peek=rG;function Z5(e,t,n,r){const s=e.referenceType,l=n.enter("imageReference");let a=n.enter("label");const u=n.createTracker(r);let h=u.move("![");const d=n.safe(e.alt,{before:h,after:"]",...u.current()});h+=u.move(d+"]["),a();const m=n.stack;n.stack=[],a=n.enter("reference");const p=n.safe(n.associationId(e),{before:h,after:"]",...u.current()});return a(),n.stack=m,l(),s==="full"||!d||d!==p?h+=u.move(p+"]"):s==="shortcut"?h=h.slice(0,-1):h+=u.move("]"),h}function rG(){return"!"}Q5.peek=iG;function Q5(e,t,n){let r=e.value||"",s="`",l=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++l<n.unsafe.length;){const a=n.unsafe[l],u=n.compilePattern(a);let h;if(a.atBreak)for(;h=u.exec(r);){let d=h.index;r.charCodeAt(d)===10&&r.charCodeAt(d-1)===13&&d--,r=r.slice(0,d)+" "+r.slice(h.index+1)}}return s+r+s}function iG(){return"`"}function J5(e,t){const n=fb(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}eA.peek=sG;function eA(e,t,n,r){const s=Sb(n),l=s==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let u,h;if(J5(e,n)){const m=n.stack;n.stack=[],u=n.enter("autolink");let p=a.move("<");return p+=a.move(n.containerPhrasing(e,{before:p,after:">",...a.current()})),p+=a.move(">"),u(),n.stack=m,p}u=n.enter("link"),h=n.enter("label");let d=a.move("[");return d+=a.move(n.containerPhrasing(e,{before:d,after:"](",...a.current()})),d+=a.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=n.enter("destinationLiteral"),d+=a.move("<"),d+=a.move(n.safe(e.url,{before:d,after:">",...a.current()})),d+=a.move(">")):(h=n.enter("destinationRaw"),d+=a.move(n.safe(e.url,{before:d,after:e.title?" ":")",...a.current()}))),h(),e.title&&(h=n.enter(`title${l}`),d+=a.move(" "+s),d+=a.move(n.safe(e.title,{before:d,after:s,...a.current()})),d+=a.move(s),h()),d+=a.move(")"),u(),d}function sG(e,t,n){return J5(e,n)?"<":"["}tA.peek=oG;function tA(e,t,n,r){const s=e.referenceType,l=n.enter("linkReference");let a=n.enter("label");const u=n.createTracker(r);let h=u.move("[");const d=n.containerPhrasing(e,{before:h,after:"]",...u.current()});h+=u.move(d+"]["),a();const m=n.stack;n.stack=[],a=n.enter("reference");const p=n.safe(n.associationId(e),{before:h,after:"]",...u.current()});return a(),n.stack=m,l(),s==="full"||!d||d!==p?h+=u.move(p+"]"):s==="shortcut"?h=h.slice(0,-1):h+=u.move("]"),h}function oG(){return"["}function wb(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function lG(e){const t=wb(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function aG(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function nA(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function cG(e,t,n,r){const s=n.enter("list"),l=n.bulletCurrent;let a=e.ordered?aG(n):wb(n);const u=e.ordered?a==="."?")":".":lG(n);let h=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&m&&(!m.children||!m.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&&(h=!0),nA(n)===a&&m){let p=-1;for(;++p<e.children.length;){const _=e.children[p];if(_&&_.type==="listItem"&&_.children&&_.children[0]&&_.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(a=u),n.bulletCurrent=a;const d=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=l,s(),d}function uG(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function hG(e,t,n,r){const s=uG(n);let l=n.bulletCurrent||wb(n);t&&t.type==="list"&&t.ordered&&(l=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+l);let a=l.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const u=n.createTracker(r);u.move(l+" ".repeat(a-l.length)),u.shift(a);const h=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,u.current()),m);return h(),d;function m(p,_,b){return _?(b?"":" ".repeat(a))+p:(b?l:l+" ".repeat(a-l.length))+p}}function dG(e,t,n,r){const s=n.enter("paragraph"),l=n.enter("phrasing"),a=n.containerPhrasing(e,r);return l(),s(),a}const fG=Kf(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function pG(e,t,n,r){return(e.children.some(function(a){return fG(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function mG(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}rA.peek=gG;function rA(e,t,n,r){const s=mG(n),l=n.enter("strong"),a=n.createTracker(r),u=a.move(s+s);let h=a.move(n.containerPhrasing(e,{after:s,before:u,...a.current()}));const d=h.charCodeAt(0),m=df(r.before.charCodeAt(r.before.length-1),d,s);m.inside&&(h=au(d)+h.slice(1));const p=h.charCodeAt(h.length-1),_=df(r.after.charCodeAt(0),p,s);_.inside&&(h=h.slice(0,-1)+au(p));const b=a.move(s+s);return l(),n.attentionEncodeSurroundingInfo={after:_.outside,before:m.outside},u+h+b}function gG(e,t,n){return n.options.strong||"*"}function vG(e,t,n,r){return n.safe(e.value,r)}function _G(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function yG(e,t,n){const r=(nA(n)+(n.options.ruleSpaces?" ":"")).repeat(_G(n));return n.options.ruleSpaces?r.slice(0,-1):r}const iA={blockquote:UK,break:q2,code:GK,definition:XK,emphasis:G5,hardBreak:q2,heading:eG,html:Y5,image:X5,imageReference:Z5,inlineCode:Q5,link:eA,linkReference:tA,list:cG,listItem:hG,paragraph:dG,root:pG,strong:rA,text:vG,thematicBreak:yG};function bG(){return{enter:{table:xG,tableData:V2,tableHeader:V2,tableRow:wG},exit:{codeText:CG,table:SG,tableData:uv,tableHeader:uv,tableRow:uv}}}function xG(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function SG(e){this.exit(e),this.data.inTable=void 0}function wG(e){this.enter({type:"tableRow",children:[]},e)}function uv(e){this.exit(e)}function V2(e){this.enter({type:"tableCell",children:[]},e)}function CG(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,kG));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function kG(e,t){return t==="|"?t:e}function EG(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,l=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
474
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:_,table:a,tableCell:h,tableRow:u}};function a(b,S,w,C){return d(m(b,w,C),b.align)}function u(b,S,w,C){const k=p(b,w,C),T=d([k]);return T.slice(0,T.indexOf(`
|
|
475
|
-
`))}function h(b,S,w,C){const k=w.enter("tableCell"),T=w.enter("phrasing"),R=w.containerPhrasing(b,{...C,before:l,after:l});return T(),k(),R}function d(b,S){return HK(b,{align:S,alignDelimiters:r,padding:n,stringLength:s})}function m(b,S,w){const C=b.children;let k=-1;const T=[],R=S.enter("table");for(;++k<C.length;)T[k]=p(C[k],S,w);return R(),T}function p(b,S,w){const C=b.children;let k=-1;const T=[],R=S.enter("tableRow");for(;++k<C.length;)T[k]=h(C[k],b,S,w);return R(),T}function _(b,S,w){let C=iA.inlineCode(b,S,w);return w.stack.includes("tableCell")&&(C=C.replace(/\|/g,"\\$&")),C}}function RG(){return{exit:{taskListCheckValueChecked:K2,taskListCheckValueUnchecked:K2,paragraph:TG}}}function MG(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:AG}}}function K2(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function TG(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const s=t.children;let l=-1,a;for(;++l<s.length;){const u=s[l];if(u.type==="paragraph"){a=u;break}}a===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(e)}function AG(e,t,n,r){const s=e.children[0],l=typeof e.checked=="boolean"&&s&&s.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",u=n.createTracker(r);l&&u.move(a);let h=iA.listItem(e,t,n,{...r,...u.current()});return l&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),h;function d(m){return m+a}}function DG(){return[cK(),AK(),LK(),bG(),RG()]}function NG(e){return{extensions:[uK(),DK(e),zK(),EG(e),MG()]}}const OG={tokenize:IG,partial:!0},sA={tokenize:HG,partial:!0},oA={tokenize:FG,partial:!0},lA={tokenize:UG,partial:!0},LG={tokenize:$G,partial:!0},aA={name:"wwwAutolink",tokenize:jG,previous:uA},cA={name:"protocolAutolink",tokenize:PG,previous:hA},os={name:"emailAutolink",tokenize:BG,previous:dA},Ei={};function zG(){return{text:Ei}}let Ro=48;for(;Ro<123;)Ei[Ro]=os,Ro++,Ro===58?Ro=65:Ro===91&&(Ro=97);Ei[43]=os;Ei[45]=os;Ei[46]=os;Ei[95]=os;Ei[72]=[os,cA];Ei[104]=[os,cA];Ei[87]=[os,aA];Ei[119]=[os,aA];function BG(e,t,n){const r=this;let s,l;return a;function a(p){return!I_(p)||!dA.call(r,r.previous)||Cb(r.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),u(p))}function u(p){return I_(p)?(e.consume(p),u):p===64?(e.consume(p),h):n(p)}function h(p){return p===46?e.check(LG,m,d)(p):p===45||p===95||Tn(p)?(l=!0,e.consume(p),h):m(p)}function d(p){return e.consume(p),s=!0,h}function m(p){return l&&s&&Bn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function jG(e,t,n){const r=this;return s;function s(a){return a!==87&&a!==119||!uA.call(r,r.previous)||Cb(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(OG,e.attempt(sA,e.attempt(oA,l),n),n)(a))}function l(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function PG(e,t,n){const r=this;let s="",l=!1;return a;function a(p){return(p===72||p===104)&&hA.call(r,r.previous)&&!Cb(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(p),e.consume(p),u):n(p)}function u(p){if(Bn(p)&&s.length<5)return s+=String.fromCodePoint(p),e.consume(p),u;if(p===58){const _=s.toLowerCase();if(_==="http"||_==="https")return e.consume(p),h}return n(p)}function h(p){return p===47?(e.consume(p),l?d:(l=!0,h)):n(p)}function d(p){return p===null||cf(p)||dt(p)||Fo(p)||Wf(p)?n(p):e.attempt(sA,e.attempt(oA,m),n)(p)}function m(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function IG(e,t,n){let r=0;return s;function s(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),s):a===46&&r===3?(e.consume(a),l):n(a)}function l(a){return a===null?n(a):t(a)}}function HG(e,t,n){let r,s,l;return a;function a(d){return d===46||d===95?e.check(lA,h,u)(d):d===null||dt(d)||Fo(d)||d!==45&&Wf(d)?h(d):(l=!0,e.consume(d),a)}function u(d){return d===95?r=!0:(s=r,r=void 0),e.consume(d),a}function h(d){return s||r||!l?n(d):t(d)}}function FG(e,t){let n=0,r=0;return s;function s(a){return a===40?(n++,e.consume(a),s):a===41&&r<n?l(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(lA,t,l)(a):a===null||dt(a)||Fo(a)?t(a):(e.consume(a),s)}function l(a){return a===41&&r++,e.consume(a),s}}function UG(e,t,n){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(e.consume(u),r):u===38?(e.consume(u),l):u===93?(e.consume(u),s):u===60||u===null||dt(u)||Fo(u)?t(u):n(u)}function s(u){return u===null||u===40||u===91||dt(u)||Fo(u)?t(u):r(u)}function l(u){return Bn(u)?a(u):n(u)}function a(u){return u===59?(e.consume(u),r):Bn(u)?(e.consume(u),a):n(u)}}function $G(e,t,n){return r;function r(l){return e.consume(l),s}function s(l){return Tn(l)?n(l):t(l)}}function uA(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||dt(e)}function hA(e){return!Bn(e)}function dA(e){return!(e===47||I_(e))}function I_(e){return e===43||e===45||e===46||e===95||Tn(e)}function Cb(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const WG={tokenize:QG,partial:!0};function qG(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:YG,continuation:{tokenize:XG},exit:ZG}},text:{91:{name:"gfmFootnoteCall",tokenize:GG},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:VG,resolveTo:KG}}}}function VG(e,t,n){const r=this;let s=r.events.length;const l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const h=r.events[s][1];if(h.type==="labelImage"){a=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return u;function u(h){if(!a||!a._balanced)return n(h);const d=Xr(r.sliceSerialize({start:a.end,end:r.now()}));return d.codePointAt(0)!==94||!l.includes(d.slice(1))?n(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),t(h))}}function KG(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},u=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",l,t],["enter",a,t],["exit",a,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...u),e}function GG(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l=0,a;return u;function u(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),h}function h(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(p){if(l>999||p===93&&!a||p===null||p===91||dt(p))return n(p);if(p===93){e.exit("chunkString");const _=e.exit("gfmFootnoteCallString");return s.includes(Xr(r.sliceSerialize(_)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return dt(p)||(a=!0),l++,e.consume(p),p===92?m:d}function m(p){return p===91||p===92||p===93?(e.consume(p),l++,d):d(p)}}function YG(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l,a=0,u;return h;function h(S){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(S){return S===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):n(S)}function m(S){if(a>999||S===93&&!u||S===null||S===91||dt(S))return n(S);if(S===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return l=Xr(r.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),_}return dt(S)||(u=!0),a++,e.consume(S),S===92?p:m}function p(S){return S===91||S===92||S===93?(e.consume(S),a++,m):m(S)}function _(S){return S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),s.includes(l)||s.push(l),Ze(e,b,"gfmFootnoteDefinitionWhitespace")):n(S)}function b(S){return t(S)}}function XG(e,t,n){return e.check(Du,t,e.attempt(WG,t,n))}function ZG(e){e.exit("gfmFootnoteDefinition")}function QG(e,t,n){const r=this;return Ze(e,s,"gfmFootnoteDefinitionIndent",5);function s(l){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(l):n(l)}}function JG(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:l,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,u){let h=-1;for(;++h<a.length;)if(a[h][0]==="enter"&&a[h][1].type==="strikethroughSequenceTemporary"&&a[h][1]._close){let d=h;for(;d--;)if(a[d][0]==="exit"&&a[d][1].type==="strikethroughSequenceTemporary"&&a[d][1]._open&&a[h][1].end.offset-a[h][1].start.offset===a[d][1].end.offset-a[d][1].start.offset){a[h][1].type="strikethroughSequence",a[d][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},a[d][1].start),end:Object.assign({},a[h][1].end)},p={type:"strikethroughText",start:Object.assign({},a[d][1].end),end:Object.assign({},a[h][1].start)},_=[["enter",m,u],["enter",a[d][1],u],["exit",a[d][1],u],["enter",p,u]],b=u.parser.constructs.insideSpan.null;b&&gr(_,_.length,0,qf(b,a.slice(d+1,h),u)),gr(_,_.length,0,[["exit",p,u],["enter",a[h][1],u],["exit",a[h][1],u],["exit",m,u]]),gr(a,d-1,h-d+3,_),h=d+_.length-2;break}}for(h=-1;++h<a.length;)a[h][1].type==="strikethroughSequenceTemporary"&&(a[h][1].type="data");return a}function l(a,u,h){const d=this.previous,m=this.events;let p=0;return _;function _(S){return d===126&&m[m.length-1][1].type!=="characterEscape"?h(S):(a.enter("strikethroughSequenceTemporary"),b(S))}function b(S){const w=aa(d);if(S===126)return p>1?h(S):(a.consume(S),p++,b);if(p<2&&!n)return h(S);const C=a.exit("strikethroughSequenceTemporary"),k=aa(S);return C._open=!k||k===2&&!!w,C._close=!w||w===2&&!!k,u(S)}}}class eY{constructor(){this.map=[]}add(t,n,r){tY(this,t,n,r)}consume(t){if(this.map.sort(function(l,a){return l[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let s=r.pop();for(;s;){for(const l of s)t.push(l);s=r.pop()}this.map.length=0}}function tY(e,t,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...r);return}s+=1}e.map.push([t,n,r])}}function nY(e,t){let n=!1;const r=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const l=r.length-1;r[l]=r[l]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function rY(){return{flow:{null:{name:"table",tokenize:iY,resolveAll:sY}}}}function iY(e,t,n){const r=this;let s=0,l=0,a;return u;function u(P){let q=r.events.length-1;for(;q>-1;){const V=r.events[q][1].type;if(V==="lineEnding"||V==="linePrefix")q--;else break}const H=q>-1?r.events[q][1].type:null,U=H==="tableHead"||H==="tableRow"?L:h;return U===L&&r.parser.lazy[r.now().line]?n(P):U(P)}function h(P){return e.enter("tableHead"),e.enter("tableRow"),d(P)}function d(P){return P===124||(a=!0,l+=1),m(P)}function m(P){return P===null?n(P):Ae(P)?l>1?(l=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),b):n(P):We(P)?Ze(e,m,"whitespace")(P):(l+=1,a&&(a=!1,s+=1),P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),a=!0,m):(e.enter("data"),p(P)))}function p(P){return P===null||P===124||dt(P)?(e.exit("data"),m(P)):(e.consume(P),P===92?_:p)}function _(P){return P===92||P===124?(e.consume(P),p):p(P)}function b(P){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(P):(e.enter("tableDelimiterRow"),a=!1,We(P)?Ze(e,S,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):S(P))}function S(P){return P===45||P===58?C(P):P===124?(a=!0,e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),w):z(P)}function w(P){return We(P)?Ze(e,C,"whitespace")(P):C(P)}function C(P){return P===58?(l+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),k):P===45?(l+=1,k(P)):P===null||Ae(P)?D(P):z(P)}function k(P){return P===45?(e.enter("tableDelimiterFiller"),T(P)):z(P)}function T(P){return P===45?(e.consume(P),T):P===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),R):(e.exit("tableDelimiterFiller"),R(P))}function R(P){return We(P)?Ze(e,D,"whitespace")(P):D(P)}function D(P){return P===124?S(P):P===null||Ae(P)?!a||s!==l?z(P):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(P)):z(P)}function z(P){return n(P)}function L(P){return e.enter("tableRow"),O(P)}function O(P){return P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),O):P===null||Ae(P)?(e.exit("tableRow"),t(P)):We(P)?Ze(e,O,"whitespace")(P):(e.enter("data"),B(P))}function B(P){return P===null||P===124||dt(P)?(e.exit("data"),O(P)):(e.consume(P),P===92?X:B)}function X(P){return P===92||P===124?(e.consume(P),B):B(P)}}function sY(e,t){let n=-1,r=!0,s=0,l=[0,0,0,0],a=[0,0,0,0],u=!1,h=0,d,m,p;const _=new eY;for(;++n<e.length;){const b=e[n],S=b[1];b[0]==="enter"?S.type==="tableHead"?(u=!1,h!==0&&(G2(_,t,h,d,m),m=void 0,h=0),d={type:"table",start:Object.assign({},S.start),end:Object.assign({},S.end)},_.add(n,0,[["enter",d,t]])):S.type==="tableRow"||S.type==="tableDelimiterRow"?(r=!0,p=void 0,l=[0,0,0,0],a=[0,n+1,0,0],u&&(u=!1,m={type:"tableBody",start:Object.assign({},S.start),end:Object.assign({},S.end)},_.add(n,0,[["enter",m,t]])),s=S.type==="tableDelimiterRow"?2:m?3:1):s&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(l[1]!==0&&(a[0]=a[1],p=_d(_,t,l,s,void 0,p),l=[0,0,0,0]),a[2]=n)):S.type==="tableCellDivider"&&(r?r=!1:(l[1]!==0&&(a[0]=a[1],p=_d(_,t,l,s,void 0,p)),l=a,a=[l[1],n,0,0])):S.type==="tableHead"?(u=!0,h=n):S.type==="tableRow"||S.type==="tableDelimiterRow"?(h=n,l[1]!==0?(a[0]=a[1],p=_d(_,t,l,s,n,p)):a[1]!==0&&(p=_d(_,t,a,s,n,p)),s=0):s&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")&&(a[3]=n)}for(h!==0&&G2(_,t,h,d,m),_.consume(t.events),n=-1;++n<t.events.length;){const b=t.events[n];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=nY(t.events,n))}return e}function _d(e,t,n,r,s,l){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(l.end=Object.assign({},$l(t.events,n[0])),e.add(n[0],0,[["exit",l,t]]));const h=$l(t.events,n[1]);if(l={type:a,start:Object.assign({},h),end:Object.assign({},h)},e.add(n[1],0,[["enter",l,t]]),n[2]!==0){const d=$l(t.events,n[2]),m=$l(t.events,n[3]),p={type:u,start:Object.assign({},d),end:Object.assign({},m)};if(e.add(n[2],0,[["enter",p,t]]),r!==2){const _=t.events[n[2]],b=t.events[n[3]];if(_[1].end=Object.assign({},b[1].end),_[1].type="chunkText",_[1].contentType="text",n[3]>n[2]+1){const S=n[2]+1,w=n[3]-n[2]-1;e.add(S,w,[])}}e.add(n[3]+1,0,[["exit",p,t]])}return s!==void 0&&(l.end=Object.assign({},$l(t.events,s)),e.add(s,0,[["exit",l,t]]),l=void 0),l}function G2(e,t,n,r,s){const l=[],a=$l(t.events,n);s&&(s.end=Object.assign({},a),l.push(["exit",s,t])),r.end=Object.assign({},a),l.push(["exit",r,t]),e.add(n+1,0,l)}function $l(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const oY={name:"tasklistCheck",tokenize:aY};function lY(){return{text:{91:oY}}}function aY(e,t,n){const r=this;return s;function s(h){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),l)}function l(h){return dt(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),a):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),a):n(h)}function a(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),u):n(h)}function u(h){return Ae(h)?t(h):We(h)?e.check({tokenize:cY},t,n)(h):n(h)}}function cY(e,t,n){return Ze(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function uY(e){return w5([zG(),qG(),JG(e),rY(),lY()])}const hY={};function Xf(e){const t=this,n=e||hY,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),l=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(uY(n)),l.push(DG()),a.push(NG(n))}function dY({content:e}){return v.jsx("div",{className:"flex gap-2 justify-end",children:v.jsx("div",{className:"max-w-[85%] sm:max-w-[80%] rounded-[20px] py-1.5 px-3.5 bg-muted text-primary border border-border prose prose-sm prose-invert [&_p]:whitespace-pre-line",children:v.jsx(Yf,{remarkPlugins:[Xf],components:$f,children:e})})})}function fY({json:e}){return v.jsx("div",{className:"flex gap-3 justify-start",children:v.jsx("div",{className:"flex-1 max-w-[90%]",children:v.jsx("pre",{className:"text-xs font-mono whitespace-pre-wrap break-words bg-muted rounded-lg p-3 overflow-auto max-h-96",children:e})})})}function fA({title:e,count:t,children:n,badge:r}){const[s,l]=x.useState(!1);return t===0?null:v.jsxs("div",{className:"flex flex-col gap-1.5",children:[v.jsxs("button",{onClick:()=>l(!s),className:"flex items-center gap-1 cursor-pointer group/section hover:opacity-60 transition-opacity",children:[v.jsx(Ji,{className:ye("h-3.5 w-3.5 text-muted-foreground transition-transform duration-200",s&&"rotate-90")}),v.jsx("span",{className:"text-muted-foreground font-medium",children:e}),v.jsx("span",{className:"text-muted-foreground/60",children:t}),r]}),s&&v.jsx("div",{className:"ml-5",children:n})]})}function hv({title:e,items:t,icon:n,getIcon:r}){return t.length===0?null:v.jsx(fA,{title:e,count:t.length,children:v.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.map(s=>v.jsx(o5,{icon:r?r(s):n,children:s},s))})})}function pY(e){const t=e.match(/^mcp__([^_]+)__(.+)$/);return t?{server:t[1],tool:t[2]}:null}function pA({status:e}){const t=e==="connected"?"bg-emerald-500":e==="pending"?"bg-yellow-500":"bg-red-500";return v.jsx("span",{className:ye("inline-block h-2 w-2 rounded-full shrink-0",t)})}function mY(e){switch(e){case"connected":return"Connected";case"failed":return"Failed";case"needs-auth":return"Needs auth";case"pending":return"Connecting...";case"disabled":return"Disabled";default:return e}}function Y2({server:e}){const[t,n]=x.useState(!1),r=e.status==="connected";return v.jsxs("div",{className:"flex flex-col gap-1.5",children:[v.jsxs("button",{onClick:()=>r&&e.tools.length>0&&n(!t),className:ye("flex items-center gap-1.5",r&&e.tools.length>0&&"cursor-pointer hover:opacity-60 transition-opacity"),children:[r&&e.tools.length>0&&v.jsx(Ji,{className:ye("h-3 w-3 text-muted-foreground transition-transform duration-200",t&&"rotate-90")}),v.jsx(pA,{status:e.status}),v.jsx("span",{className:"text-muted-foreground font-medium",children:Mv(e.name)}),r?v.jsxs("span",{className:"text-muted-foreground/50",children:[e.tools.length," tools"]}):v.jsx("span",{className:"text-muted-foreground/50",children:mY(e.status)})]}),!r&&e.error&&v.jsx("span",{className:"text-destructive ml-5",children:e.error}),t&&e.tools.length>0&&v.jsx("div",{className:"flex flex-wrap gap-1.5 ml-5",children:e.tools.map(s=>v.jsx(o5,{icon:s5(`mcp__${e.name}__${s}`),children:s},s))})]})}function gY({servers:e}){if(e.length===0)return null;const t=e.filter(s=>s.status==="connected"),n=e.filter(s=>s.status!=="connected"),r=n.length>0?v.jsxs("span",{className:"flex items-center gap-1 ml-1",children:[v.jsx(pA,{status:"failed"}),v.jsxs("span",{className:"text-muted-foreground/60",children:[n.length," disconnected"]})]}):null;return v.jsx(fA,{title:"MCP Servers",count:e.length,badge:r,children:v.jsxs("div",{className:"flex flex-col gap-2",children:[t.map(s=>v.jsx(Y2,{server:s},s.name)),n.map(s=>v.jsx(Y2,{server:s},s.name))]})})}function vY({rawJson:e}){const[t,n]=x.useState(!1);return v.jsxs("div",{className:"flex flex-col gap-1.5",children:[v.jsxs("button",{onClick:()=>n(!t),className:"flex items-center gap-1 cursor-pointer group/section hover:opacity-60 transition-opacity",children:[v.jsx(Ji,{className:ye("h-3.5 w-3.5 text-muted-foreground transition-transform duration-200",t&&"rotate-90")}),v.jsx("span",{className:"text-muted-foreground font-medium",children:"Raw Message"})]}),t&&v.jsx("pre",{className:"ml-5 text-xs whitespace-pre-wrap break-all border border-border rounded-md p-3 overflow-x-auto max-h-96 overflow-y-auto",children:e})]})}function _Y({message:e,rawJson:t}){const{coreTools:n,mcpServersWithTools:r}=x.useMemo(()=>{const s=new Map,l=[];for(const u of e.tools){const h=pY(u);if(h){const d=s.get(h.server)||[];d.push(h.tool),s.set(h.server,d)}else l.push(u)}const a=e.mcpServers.map(u=>({name:u.name,status:u.status,error:u.error,tools:s.get(u.name)||[]}));return{coreTools:l,mcpServersWithTools:a}},[e.tools,e.mcpServers]);return v.jsx(to,{children:v.jsxs(Ff,{expandedContent:v.jsx(Uf,{className:"my-4 text-xs",children:v.jsxs("div",{className:"flex flex-col gap-3",children:[v.jsx(zU,{children:e.model}),v.jsx(hv,{title:"Tools",items:n,getIcon:s=>C_[s]??i5}),v.jsx(hv,{title:"Agents",items:e.agents,icon:ly}),v.jsx(hv,{title:"Commands",items:e.slashCommands,icon:c6}),v.jsx(gY,{servers:r}),t&&v.jsx(vY,{rawJson:t})]})}),children:[v.jsx(lz,{className:"h-5 w-5 text-logo"}),v.jsx(Xs,{children:"Session Started"})]})})}function yY({message:e}){return v.jsx(to,{className:"hidden",children:v.jsxs(Ff,{expandedContent:v.jsx(Uf,{className:"my-4 text-xs",children:v.jsx("pre",{className:"font-mono whitespace-pre-wrap break-all bg-muted border border-border rounded-lg p-2 max-h-64 overflow-auto",children:JSON.stringify(e.accountInfo,null,2)})}),children:[v.jsx("div",{className:"size-5 flex justify-center items-center ",children:v.jsx(ly,{className:"h-4 w-4 text-muted-foreground"})}),v.jsx(Xs,{children:"Account"})]})})}function bY({message:e}){return v.jsx("div",{className:"text-pretty prose prose-sm dark:prose-invert px-0.5 w-full max-w-full space-y-4",children:v.jsx(Yf,{remarkPlugins:[Xf],components:$f,children:e.text})})}function xY({question:e,currentIndex:t,totalQuestions:n,onBack:r,children:s}){const l=r&&t>0;return v.jsxs("div",{className:"rounded-2xl border border-border overflow-hidden",children:[v.jsxs("div",{className:"relative",children:[v.jsxs("h3",{className:"font-medium text-foreground text-sm p-3 px-4 bg-card border-b border-border text-foreground flex flex-row items-center gap-2",children:[l?v.jsx("button",{onClick:r,className:" text-muted-foreground hover:opacity-60 transition-all flex items-center",children:v.jsx(vz,{className:"h-4 w-4 -ml-0.5",strokeWidth:3})}):n>1?v.jsxs("span",{className:"font-bold text-muted-foreground whitespace-nowrap",children:[t+1," of ",n]}):null,e]}),n>1&&v.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-border",children:v.jsx("div",{className:"h-full bg-muted-foreground/40 transition-all duration-300",style:{width:`${t/n*100}%`}})})]}),s]})}function X2({label:e,description:t}){return v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"text-foreground text-sm",children:e}),t&&v.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:t})]})}function mA({selected:e,multiSelect:t,onClick:n}){return v.jsx("button",{type:"button",onClick:n,className:ye("flex-shrink-0 w-5 h-5 border-1 flex items-center justify-center",t?"rounded":"rounded-full",e?"border-slate-500/0 bg-foreground":"border-muted-foreground/50 bg-background",n&&e&&"cursor-pointer"),children:e&&v.jsx(Lo,{strokeWidth:3,className:"translate-y-[0.5px] h-3 w-3 text-white dark:text-background"})})}function SY({option:e,selected:t,multiSelect:n,onClick:r,isLast:s}){const l="w-full text-left p-3 pt-2.5 pl-4 pr-5 bg-background",a=s?"":"border-b border-border";return r?v.jsx("button",{onClick:r,className:ye(l,a,"transition-all cursor-pointer"),children:v.jsxs("div",{className:"flex items-center justify-between gap-3",children:[v.jsx("div",{className:"flex-1 min-w-0",children:v.jsx(X2,{label:e.label,description:e.description})}),v.jsx(mA,{selected:t,multiSelect:n})]})}):v.jsx("div",{className:ye(l,a),children:v.jsx(X2,{label:e.label,description:e.description})})}function wY(e){return e==null?void 0:e.answers}function Kr(e){return e.id||e.question}function CY({message:e,onSubmit:t,isLatest:n}){var j,K;const r=e.input.questions,s=!!e.result,l=wY(e.result),a=((j=e.result)==null?void 0:j.discarded)===!0,[u,h]=x.useState(0),[d,m]=x.useState({}),[p,_]=x.useState({}),[b,S]=x.useState(l??null),[w,C]=x.useState(s),k=($,J)=>{var Z;const A=(Z=p[$])==null?void 0:Z.trim(),I=d[$]||"",Y=J||r.find(ae=>Kr(ae)===$);if(Y!=null&&Y.multiSelect)return[I,A].filter(Boolean).flatMap(ae=>ae.split(", ").filter(Boolean));const M=A||I;return M?[M]:[]},T=$=>{const J=d[Kr($)]||"";return $.multiSelect?J.split(", ").filter(Boolean):[J]},R=($,J)=>{const A=Kr($);if($.multiSelect){const I=d[A]?d[A].split(", ").filter(Boolean):[],Y=I.includes(J)?I.filter(M=>M!==J):[...I,J];m({...d,[A]:Y.join(", ")})}else m({...d,[A]:J}),_({...p,[A]:""}),u<r.length-1&&setTimeout(()=>h(u+1),150)},D=($,J)=>{const A=Kr($);_({...p,[A]:J}),J&&!$.multiSelect&&m({...d,[A]:""})},z=$=>{const J=Kr($);$.multiSelect&&p[J]&&_({...p,[J]:""})},L=r.every($=>k(Kr($),$).length>0),O=r[u],B=u===r.length-1,X=O&&k(Kr(O),O).length>0,P=()=>{u<r.length-1&&h(u+1)},q=()=>{u>0&&h(u-1)},H=()=>{if(!L)return;const $={};for(const J of r){const A=Kr(J);$[A]=k(A,J)}S($),C(!0),t(e.toolId,r,$)},U=$=>{if($.key==="Enter"&&!(!O||!X)){if($.preventDefault(),B){H();return}P()}};if(w||s){const $=l||b||{};return v.jsx("div",{className:"w-full",children:v.jsxs("div",{className:"rounded-2xl border border-border overflow-hidden",children:[v.jsxs("div",{className:"font-medium text-sm p-3 px-4 pr-5 bg-muted border-b border-border flex flex-row items-center justify-between",children:[v.jsxs("p",{children:["Question",r.length!==1?"s":""]}),v.jsx("p",{className:"",children:a?"Discarded":"Answers"})]}),r.map((J,A)=>{const I=$[Kr(J)]||$[J.question]||[],Y=A===r.length-1;return v.jsxs("div",{className:ye("w-full p-3 pt-2.5 pl-4 pr-5 bg-background flex items-center justify-between gap-3",!Y&&"border-b border-border"),children:[v.jsx("div",{className:"text-sm text-pretty",children:J.question}),I.length>0&&v.jsx("div",{className:"text-sm font-medium text-right max-w-[50%] text-pretty",children:I.join(", ")}),I.length===0&&v.jsx("div",{className:"text-sm font-medium text-right italic",children:a?"Discarded":"No Response"})]},Kr(J))})]})})}if(!n)return v.jsx("div",{className:"w-full py-2",children:v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(SE,{className:"h-4 w-4 text-muted-foreground"}),v.jsx("span",{className:"text-sm text-muted-foreground",children:"Questions pending (newer question active)"})]})});if(!O)return null;const V=T(O),F=p[Kr(O)]||"";return v.jsxs("div",{className:"w-full space-y-3",children:[v.jsxs(xY,{question:O.question,currentIndex:u,totalQuestions:r.length,onBack:u>0?q:void 0,children:[(K=O.options)==null?void 0:K.map($=>v.jsx(SY,{option:$,selected:V.includes($.label),multiSelect:O.multiSelect,onClick:()=>R(O,$.label)},$.label)),v.jsx("div",{className:"transition-all bg-background",children:v.jsxs("div",{className:"flex pr-5 items-center justify-between gap-3",children:[v.jsx("input",{type:"text",value:F,onChange:$=>D(O,$.target.value),onKeyDown:U,placeholder:"Other...",className:"flex-1 px-3 !py-1 pl-4 min-h-[55px] min-w-0 text-sm bg-transparent outline-none text-foreground placeholder:text-muted-foreground"}),v.jsx(mA,{selected:!!F,multiSelect:O.multiSelect,onClick:O.multiSelect&&F?()=>z(O):void 0})]})})]}),v.jsxs("div",{className:"flex justify-end gap-2 mx-2",children:[!B&&X&&(O.multiSelect||!!F)&&v.jsx(Ke,{size:"sm",onClick:P,children:"Next"}),B&&v.jsx(Ke,{size:"sm",onClick:H,disabled:!L,className:ye(!L&&"opacity-50 cursor-not-allowed","rounded-full"),children:"Submit"})]})]})}function kY({message:e,onConfirm:t,isLatest:n}){const r=!!e.result,[s,l]=x.useState(!1),[a,u]=x.useState(!1),[h,d]=x.useState(!1),[m,p]=x.useState(""),_=x.useRef(null),b=e.input;x.useEffect(()=>{h&&_.current&&_.current.focus()},[h]);const S=async()=>{b!=null&&b.plan&&(await navigator.clipboard.writeText(b.plan),u(!0),setTimeout(()=>u(!1),2e3))},w=r?e.result:null,C=(w==null?void 0:w.discarded)===!0;return v.jsxs("div",{className:"flex flex-col gap-3",children:[v.jsxs("div",{className:"relative rounded-2xl border border-border overflow-hidden group/plan",children:[(b==null?void 0:b.plan)&&v.jsx(Ke,{variant:"ghost",size:"icon",className:ye("absolute top-2 right-2 z-10 h-8 w-8 rounded-md text-muted-foreground opacity-0 group-hover/plan:opacity-100 transition-opacity",!a&&"hover:text-foreground",a&&"hover:!bg-transparent hover:!border-transparent"),onClick:S,children:a?v.jsx(Lo,{className:"h-4 w-4 text-green-400"}):v.jsx(Sf,{className:"h-4 w-4"})}),v.jsxs("div",{className:ye("!pt-5 !pb-0 px-4 md:py-4.5 md:px-5.5 bg-muted dark:bg-card overflow-scroll no-pre-highlight transition-all",r&&!s?"max-h-[min(400px,40vh)] ":"",r?"hover:!pb-[32px]":""),children:[r&&v.jsxs(Ke,{variant:"ghost",className:"absolute z-10 bottom-2 pr-2.5 !pl-3.5 h-[34px] inline-flex gap-1 text-sm left-[50%] -translate-x-[50%] text-muted-foreground backdrop-blur-sm hover:text-foreground opacity-0 group-hover/plan:opacity-100 transition-all rounded-full border border-border",onClick:()=>l(!s),children:[s?"Show Less":"Show More",v.jsx(mz,{className:`size-3.5 transition-transform ${s?"rotate-180":""}`})]}),b!=null&&b.plan?v.jsxs("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:[v.jsx(Yf,{remarkPlugins:[Xf],components:BU,children:b.plan}),v.jsx("div",{className:"mt-5"})]}):v.jsx("p",{className:"text-sm text-muted-foreground",children:"No plan provided"})]})]}),r?v.jsx("div",{className:"flex justify-end mx-2",children:v.jsxs("span",{className:"pl-4 inline text-sm font-medium bg-background text-foreground/60 border border-border py-1.5 px-3 rounded-[20px] leading-relaxed max-w-[85%] sm:max-w-[80%]",children:[v.jsx("em",{children:C?"Discarded":w!=null&&w.clearContext?"Approved & Cleared Context":w!=null&&w.confirmed?"Approved":w!=null&&w.message?`Adjusted: "${w.message}"`:"Adjusted Plan"}),v.jsx(Mz,{className:"inline h-4 w-4 ml-1.5 -mt-0.5"})]})}):n?v.jsxs("div",{className:"flex flex-col gap-3",children:[!h&&v.jsxs("div",{className:"flex flex-col md:flex-row items-stretch md:items-center justify-end gap-2 mx-2",children:[v.jsxs(Ke,{size:"sm",onClick:()=>t(e.toolId,!0,!0),className:"rounded-full bg-primary text-background pr-4 md:order-last",children:[v.jsx(uz,{className:"h-4 w-4 mr-1.5"}),"Approve & Clear"]}),v.jsxs("div",{className:"flex items-stretch md:items-center gap-2 md:contents",children:[v.jsxs(Ke,{size:"sm",variant:"outline",onClick:()=>d(!0),className:"rounded-full border-border flex-1 md:flex-initial md:order-first",children:[v.jsx(kE,{className:"h-4 w-4 mr-1.5"}),"Suggest Edits"]}),v.jsxs(Ke,{size:"sm",variant:"outline",onClick:()=>t(e.toolId,!0),className:"rounded-full border-border flex-1 md:flex-initial",children:[v.jsx(Lo,{className:"h-4 w-4 mr-1.5"}),"Approve"]})]})]}),h&&v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx("textarea",{ref:_,value:m,onChange:k=>p(k.target.value),onKeyDown:k=>{k.key==="Enter"&&!k.shiftKey&&m.trim()&&(k.preventDefault(),t(e.toolId,!1,void 0,m.trim())),k.key==="Escape"&&(d(!1),p(""))},placeholder:"Describe what you'd like to change...",rows:3,className:"w-full rounded-2xl border border-border bg-muted dark:bg-card px-4 py-3 text-sm text-foreground placeholder:text-muted-foreground resize-none outline-none"}),v.jsxs("div",{className:"flex items-center justify-end gap-2 mx-2",children:[v.jsx(Ke,{size:"sm",variant:"ghost",onClick:()=>{d(!1),p("")},className:"rounded-full text-muted-foreground",children:"Cancel"}),v.jsxs(Ke,{size:"sm",disabled:!m.trim(),onClick:()=>t(e.toolId,!1,void 0,m.trim()),className:"rounded-full bg-primary text-background disabled:opacity-50 disabled:pointer-events-none",children:[v.jsx(o6,{className:"h-4 w-4 mr-1.5"}),"Adjust Plan"]})]})]})]}):v.jsx("div",{className:"flex justify-end mx-2",children:v.jsx("span",{className:"inline text-sm text-muted-foreground italic",children:"Plan pending (newer prompt active)"})})]})}const EY={completed:{Icon:Lo,iconClass:"text-emerald-500",textClass:"text-muted-foreground"},in_progress:{Icon:Js,iconClass:"text-foreground animate-spin",textClass:"text-foreground font-medium"},pending:{Icon:Sz,iconClass:"text-muted-foreground",textClass:"text-muted-foreground"}};function RY({message:e}){const t=e.input.todos;return t.length?v.jsx("div",{className:"w-full",children:v.jsxs("div",{className:"rounded-2xl border border-border overflow-hidden",children:[v.jsxs("h3",{className:"font-medium text-foreground text-sm p-3 px-4 bg-card border-b border-border flex items-center gap-2",children:[v.jsx(qz,{className:"h-4 w-4 text-muted-foreground"}),"Progress"]}),v.jsx("div",{children:t.map((n,r)=>{const s=r===t.length-1,{Icon:l,iconClass:a,textClass:u}=EY[n.status];return v.jsxs("div",{className:ye("flex items-center gap-3 px-4 py-2.5 bg-background",!s&&"border-b border-border"),children:[v.jsx(l,{className:ye("h-4 w-4 flex-shrink-0",a)}),v.jsx("span",{className:ye("text-sm",u),children:n.status==="in_progress"?n.activeForm:n.content})]},r)})})]})}):null}function dv(e,t){if(!e)return"";if(t){const n=t.endsWith("/")?t:`${t}/`;if(e.startsWith(n))return e.slice(n.length);if(e===t)return""}return e.replace(/^\/home\/user\/workspace\//,"")}function MY(e){const t=e.split(`
|
|
476
|
-
`),n=/^\s*(\d+)→(.*)$/;return t.map(r=>{const s=r.match(n);return s?{lineNumber:parseInt(s[1],10),content:s[2]}:{lineNumber:null,content:r}})}function TY(e){return e.replace(/<[^>]+>/g,"")}function AY(e,t){const n=e.split(`
|
|
477
|
-
`),r=t.split(`
|
|
478
|
-
`),s=DY(n,r),l=NY(n,r,s);return OY(l)}function DY(e,t){const n=e.length,r=t.length,s=Array.from({length:n+1},()=>Array(r+1).fill(0));for(let l=1;l<=n;l++)for(let a=1;a<=r;a++)s[l][a]=e[l-1]===t[a-1]?s[l-1][a-1]+1:Math.max(s[l-1][a],s[l][a-1]);return s}function NY(e,t,n){const r=[];let s=e.length,l=t.length;for(;s>0||l>0;)s>0&&l>0&&e[s-1]===t[l-1]?(r.push({type:"context",text:e[s-1],oldIdx:s,newIdx:l}),s--,l--):l>0&&(s===0||n[s][l-1]>=n[s-1][l])?(r.push({type:"added",text:t[l-1],oldIdx:s,newIdx:l}),l--):(r.push({type:"removed",text:e[s-1],oldIdx:s,newIdx:l}),s--);return r.reverse()}function OY(e){return e.map(t=>{const n=t.type==="removed"?"-":t.type==="added"?"+":" ";return{type:t.type,content:`${n}${t.text}`}})}function fv({content:e,isDiff:t=!1,oldString:n,newString:r}){const s=x.useMemo(()=>t&&n!==void 0&&r!==void 0?AY(n,r):[],[t,n,r]),l=x.useMemo(()=>t?[]:MY(e),[e,t]),a=x.useMemo(()=>l.some(u=>u.lineNumber!==null),[l]);return t&&s.length>0?v.jsx("div",{className:"my-1 rounded-lg border border-border overflow-hidden",children:v.jsx("div",{className:"overflow-auto max-h-64 md:max-h-[50vh]",children:v.jsx("table",{className:"w-full border-collapse text-xs font-mono",children:v.jsx("tbody",{children:s.map((u,h)=>{const d=u.type==="removed"?"bg-red-500/10 dark:bg-red-500/15":u.type==="added"?"bg-green-500/10 dark:bg-green-500/15":"",m=u.type==="removed"?"text-red-700 dark:text-red-400":u.type==="added"?"text-green-700 dark:text-green-400":"text-foreground";return v.jsxs("tr",{className:d,children:[v.jsx("td",{className:`px-2 py-0 select-none w-0 whitespace-nowrap ${u.type==="removed"?"text-red-500/50":u.type==="added"?"text-green-500/50":"text-muted-foreground/50"}`,children:u.type==="removed"?"-":u.type==="added"?"+":" "}),v.jsx("td",{className:`px-2 py-0 whitespace-pre select-all ${m}`,children:u.content.slice(1)})]},h)})})})})}):v.jsx("div",{className:"my-1 rounded-lg border border-border overflow-hidden",children:v.jsx("div",{className:"overflow-auto max-h-64 md:max-h-[50vh]",children:v.jsx("table",{className:"w-full border-collapse text-xs font-mono",children:v.jsx("tbody",{children:l.map((u,h)=>v.jsxs("tr",{children:[a&&v.jsx("td",{className:"px-2 py-0 select-none w-0 whitespace-nowrap text-muted-foreground/50 text-right",children:u.lineNumber!==null?u.lineNumber:""}),v.jsx("td",{className:"px-2 py-0 whitespace-pre select-all text-foreground",children:TY(u.content)})]},h))})})})})}function gA({message:e,isLoading:t=!1,localPath:n}){var S;const r=e.result!==void 0,s=!r&&t,l=x.useMemo(()=>{if(e.toolKind==="skill")return e.input.skill;if(e.toolKind==="glob")return`Search files ${e.input.pattern==="**/*"?"in all directories":`matching ${e.input.pattern}`}`;if(e.toolKind==="grep"){const w=e.input.pattern,C=e.input.outputMode;return C==="count"?`Count \`${w}\` occurrences`:C==="content"?`Find \`${w}\` in text`:`Find \`${w}\` in files`}return e.toolKind==="bash"?e.input.description||(e.input.command?xj(e.input.command):"Bash"):e.toolKind==="web_search"?e.input.query||"Web Search":e.toolKind==="read_file"?`Read ${dv(e.input.filePath,n)}`:e.toolKind==="write_file"?`Write ${dv(e.input.filePath,n)}`:e.toolKind==="edit_file"?`Edit ${dv(e.input.filePath,n)}`:e.toolKind==="mcp_generic"?`${Mv(e.input.tool)} from ${Mv(e.input.server)}`:e.toolKind==="subagent_task"&&e.input.subagentType||e.toolName},[e.input,e.toolName,n]),a=x.useMemo(()=>e.toolKind==="subagent_task",[e.toolKind]),u=x.useMemo(()=>{if(e.toolKind==="skill")return e.input.skill},[e.input,e.toolKind]),h=e.toolKind==="bash",d=e.toolKind==="write_file",m=e.toolKind==="edit_file",p=e.toolKind==="read_file",_=x.useMemo(()=>{if(typeof e.result=="string")return e.result;if(!e.result)return"";if(typeof e.result=="object"&&e.result!==null&&"content"in e.result){const w=e.result.content;if(typeof w=="string")return w}return JSON.stringify(e.result,null,2)},[e.result]),b=x.useMemo(()=>{switch(e.toolKind){case"bash":return e.input.command;case"write_file":return e.input.content;default:return JSON.stringify(e.input,null,2)}},[e]);return v.jsx(to,{className:"w-full",children:v.jsxs(Ff,{expandedContent:v.jsx(Uf,{className:"my-4 text-sm",children:v.jsxs("div",{className:"flex flex-col gap-2",children:[m?v.jsx(fv,{content:"",isDiff:!0,oldString:e.input.oldString,newString:e.input.newString}):!p&&!d&&v.jsx(n2,{label:h?v.jsxs("span",{className:"flex items-center gap-2 w-full",children:[v.jsx("span",{children:"Command"}),!!e.input.timeoutMs&&v.jsxs("span",{className:"text-muted-foreground",children:["timeout: ",String(e.input.timeoutMs),"ms"]}),!!e.input.runInBackground&&v.jsx("span",{className:"text-muted-foreground",children:"background"})]}):d?"Contents":"Input",copyText:b,children:b}),r&&p&&!e.isError&&v.jsx(fv,{content:_}),d&&!e.isError&&v.jsx(fv,{content:e.input.content}),r&&!p&&!(d&&!e.isError)&&!(m&&!e.isError)&&v.jsx(n2,{label:e.isError?"Error":"Result",copyText:_,children:_})]})}),children:[v.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:(()=>{if(e.isError)return v.jsx(pu,{className:"size-4 text-destructive"});if(a)return v.jsx(ly,{className:"size-4 text-muted-icon"});const w=s5(e.toolName);return v.jsx(w,{className:"size-4 text-muted-icon"})})()}),v.jsx(Xs,{className:"text-left transition-opacity duration-200 truncate",children:v.jsx(Af,{animate:s,shimmerWidth:Math.max(20,(((S=u||l)==null?void 0:S.length)??33)*3),children:u||l})})]})})}function LY({message:e}){const t=n=>{if(n<1e3)return`${n}ms`;const r=Math.floor(n/1e3),s=Math.floor(r/3600),l=Math.floor(r%3600/60),a=r%60;return s>0?`${s}h${l>0?` ${l}m`:""}`:l>0?`${l}m${a>0?` ${a}s`:""}`:`${a}s`};return v.jsxs(to,{className:`px-0.5 text-xs tracking-wide ${e.durationMs>6e4?"":"hidden"}`,children:[v.jsx("div",{className:"w-full h-[1px] bg-border"}),v.jsxs(Xs,{className:"whitespace-nowrap text-[11px] tracking-widest text-muted-foreground/60 uppercase flex-shrink-0",children:["Worked for ",t(e.durationMs)]}),v.jsx("div",{className:"w-full h-[1px] bg-border"})]})}function zY({message:e}){return v.jsx("div",{className:"flex items-center justify-end gap-2 text-sm text-muted-foreground my-3",children:v.jsxs("div",{className:"inline-flex gap-1.5 items-center justify-center whitespace-nowrap text-sm font-medium bg-background text-foreground/60 border border-border h-9 pl-1 pr-4 rounded-full",children:[v.jsx(bz,{className:"h-4 w-4 ml-1.5"}),v.jsx("em",{children:"Interrupted"})]})})}function ff({size:e=4}){return v.jsxs("svg",{className:"flex-1",viewBox:`0 0 100 ${e}`,preserveAspectRatio:"none",style:{height:`${e}px`},children:[v.jsx("pattern",{id:"zigzag",width:e,height:e,patternUnits:"userSpaceOnUse",children:v.jsx("path",{d:`M0 ${e} L${e/2} 0 L${e} ${e}`,fill:"none",stroke:"currentColor",strokeWidth:"0.5",className:"text-muted-foreground/30",style:{stroke:"currentColor"}})}),v.jsx("rect",{width:"100%",height:e,fill:"url(#zigzag)",className:"text-muted-foreground/30"})]})}function BY(){return v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx(ff,{}),v.jsx("span",{className:"text-[11px] tracking-widest text-muted-foreground uppercase flex-shrink-0",children:"Compacted"}),v.jsx(ff,{})]})}function jY(){return v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx(ff,{}),v.jsx("span",{className:"text-[11px] tracking-widest text-muted-foreground uppercase flex-shrink-0",children:"Context Cleared"}),v.jsx(ff,{})]})}function PY({message:e}){return v.jsx(to,{children:v.jsxs(Ff,{expandedContent:v.jsx(Uf,{className:"my-4 text-xs",children:v.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none",children:v.jsx(Yf,{remarkPlugins:[Xf],components:$f,children:e.summary})})}),children:[v.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:v.jsx(wE,{className:"h-4.5 w-4.5 text-muted-foreground"})}),v.jsx(Xs,{children:"Summarized"})]})})}const IY={compacting:"Compacting..."};function HY({message:e}){const t=IY[e.status]||e.status;return v.jsxs(to,{className:"grid grid-cols-[auto_1fr] items-center gap-1.5 text-sm animate-pulse",children:[v.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:v.jsx(wE,{className:"h-4.5 w-4.5 text-muted-foreground"})}),v.jsx(Xs,{className:"text-left transition-opacity duration-200 truncate",children:t})]})}const FY={read_file:{key:"read",singular:"read",plural:"reads"},edit_file:{key:"edit",singular:"edit",plural:"edits"},write_file:{key:"write",singular:"write",plural:"writes"},bash:{key:"bash",singular:"command",plural:"commands"},grep:{key:"grep",singular:"search",plural:"searches"},glob:{key:"glob",singular:"glob",plural:"globs"},subagent_task:{key:"task",singular:"agent",plural:"agents"},web_search:{key:"websearch",singular:"web search",plural:"web searches"},skill:{key:"skill",singular:"skill",plural:"skills"},todo_write:{key:"todo",singular:"todo update",plural:"todo updates"}},UY={key:"other",singular:"tool call",plural:"tool calls"};function $Y(e){return FY[e]??UY}function WY(e){const t=new Map,n=[];for(const r of e){const s=r.toolKind,l=$Y(s),a=t.get(l.key);a?a.count++:(t.set(l.key,{category:l,count:1}),n.push(l.key))}return n.map(r=>{const{category:s,count:l}=t.get(r);return`${l} ${l===1?s.singular:s.plural}`}).join(", ")}function qY({messages:e,isLoading:t,localPath:n}){const[r,s]=x.useState(!1),l=x.useMemo(()=>WY(e),[e]),u=e.some(h=>h.result===void 0)&&t;return v.jsx(to,{className:"w-full",children:v.jsxs("div",{className:"flex flex-col w-full",children:[v.jsx("button",{onClick:()=>s(!r),className:`group cursor-pointer grid grid-cols-[auto_1fr] items-center gap-1 text-sm ${!r&&!u?"hover:opacity-60 transition-opacity":""}`,children:v.jsxs("div",{className:"grid grid-cols-[auto_1fr] items-center gap-1.5",children:[v.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:v.jsx(Ji,{className:`h-4.5 w-4.5 text-muted-icon transition-all duration-200 ${r?"rotate-90":""}`})}),v.jsx(Xs,{className:"text-left",children:v.jsx(Af,{animate:u,children:l})})]})}),r&&v.jsxs("div",{className:"my-4 flex flex-col gap-3",children:[e.map(h=>v.jsx(gA,{message:h,isLoading:t,localPath:n},h.id)),e.length>5&&v.jsx("button",{onClick:()=>s(!1),className:"cursor-pointer grid grid-cols-[auto_1fr] items-center gap-1 text-xs hover:opacity-80 transition-opacity",children:v.jsxs("div",{className:"grid grid-cols-[auto_1fr] items-center gap-1.5",children:[v.jsx("div",{className:"w-5 h-5 relative flex items-center justify-center",children:v.jsx(Ji,{className:"h-4.5 w-4.5 text-muted-icon -rotate-90"})}),v.jsx(Xs,{className:"text-left",children:"Collapse"})]})})]})]})})}const VY=new Set(["AskUserQuestion","ExitPlanMode","TodoWrite"]);function Z2(e){if(e.kind!=="tool")return!1;const t=e.toolName;return!VY.has(t)}function KY(e){const t=[];let n=0;for(;n<e.length;){const r=e[n];if(Z2(r)){const s=[r],l=n;for(n+=1;n<e.length&&Z2(e[n]);)s.push(e[n]),n+=1;s.length>=2?t.push({type:"tool-group",messages:s,startIndex:l}):t.push({type:"single",message:r,index:l});continue}t.push({type:"single",message:r,index:n}),n+=1}return t}function GY({messages:e,isLoading:t,localPath:n,latestToolIds:r,onAskUserQuestionSubmit:s,onExitPlanModeConfirm:l}){const a=x.useMemo(()=>KY(e),[e]);function u(h,d){if(h.kind==="user_prompt")return v.jsx(dY,{content:h.content},h.id);switch(h.kind){case"unknown":return v.jsx(fY,{json:h.json},h.id);case"system_init":return e.findIndex(p=>p.kind==="system_init")===d?v.jsx(_Y,{message:h,rawJson:h.debugRaw},h.id):null;case"account_info":return e.findIndex(p=>p.kind==="account_info")===d?v.jsx(yY,{message:h},h.id):null;case"assistant_text":return v.jsx(bY,{message:h},h.id);case"tool":return h.toolKind==="ask_user_question"?v.jsx(CY,{message:h,onSubmit:s,isLatest:h.id===r.AskUserQuestion},h.id):h.toolKind==="exit_plan_mode"?v.jsx(kY,{message:h,onConfirm:l,isLatest:h.id===r.ExitPlanMode},h.id):h.toolKind==="todo_write"?h.id!==r.TodoWrite?null:v.jsx(RY,{message:h},h.id):v.jsx(gA,{message:h,isLoading:t,localPath:n},h.id);case"result":{const m=e[d+1],p=e[d-1];return(m==null?void 0:m.kind)==="context_cleared"||(p==null?void 0:p.kind)==="context_cleared"?null:v.jsx(LY,{message:h},h.id)}case"interrupted":return v.jsx(zY,{message:h},h.id);case"compact_boundary":return v.jsx(BY,{},h.id);case"context_cleared":return v.jsx(jY,{},h.id);case"compact_summary":return v.jsx(PY,{message:h},h.id);case"status":return d===e.length-1?v.jsx(HY,{message:h},h.id):null}}return v.jsx(v.Fragment,{children:a.map(h=>{if(h.type==="tool-group")return v.jsx("div",{className:"group relative",[Sv]:"",children:v.jsx(qY,{messages:h.messages,isLoading:t,localPath:n})},`group-${h.startIndex}`);const d=u(h.message,h.index);return d?v.jsx("div",{id:`msg-${h.message.id}`,className:"group relative",[Sv]:"",children:d},h.message.id):null})})}function YY({rootRef:e,fallbackRef:t,enabled:n,canCancel:r}){x.useEffect(()=>{if(!n)return;let s=0,l=null;const a=p=>{const _=p instanceof Element?p:null,b=e.current,S=t.current;if(!R6({activeElement:document.activeElement,pointerStartTarget:l,pointerEndTarget:_,root:b,fallback:S,hasActiveOverlay:uw(document),hasActiveSelection:C6(window.getSelection())})){l=null;return}S==null||S.focus({preventScroll:!0}),l=null},u=p=>{cancelAnimationFrame(s),l=p.target instanceof Element?p.target:null},h=p=>{cancelAnimationFrame(s),s=window.requestAnimationFrame(()=>{a(p.target)})},d=()=>{l=null;const p=t.current;!p||p.disabled||p.focus({preventScroll:!0})},m=p=>{if(p.key!=="Escape")return;const _=t.current;E6({activeElement:document.activeElement,fallback:_,hasActiveOverlay:uw(document),canCancel:r,defaultPrevented:p.defaultPrevented})&&(p.preventDefault(),_==null||_.focus({preventScroll:!0}))};return window.addEventListener("pointerdown",u,!0),window.addEventListener("pointerup",h,!0),window.addEventListener("keydown",m,!0),window.addEventListener($d,d),()=>{cancelAnimationFrame(s),window.removeEventListener("pointerdown",u,!0),window.removeEventListener("pointerup",h,!0),window.removeEventListener("keydown",m,!0),window.removeEventListener($d,d)}},[r,n,t,e])}const yd="What are we building?",XY=19,ZY=72;function QY(){var T,R,D,z,L,O;const e=q_(),t=x.useRef(null),n=x.useRef(null),[r,s]=x.useState(""),l=((T=e.runtime)==null?void 0:T.projectId)??null,u=Ao(B=>l?B.projects[l]:void 0)??$U,h=Ao(B=>B.addTerminal),d=Ao(B=>B.removeTerminal),m=Ao(B=>B.toggleVisibility),p=Ao(B=>B.setMainSizes),_=Ao(B=>B.setTerminalSizes),b=Vl(B=>B.scrollbackLines),S=Vl(B=>B.minColumnWidth),w=u.terminals.length>0,C=!!(l&&u.isVisible&&w);YY({rootRef:t,fallbackRef:n,enabled:e.hasSelectedProject&&((R=e.runtime)==null?void 0:R.status)!=="waiting_for_user",canCancel:e.canCancel}),x.useEffect(()=>{if(e.messages.length!==0)return;s("");let B=0;const X=window.setInterval(()=>{B+=1,s(yd.slice(0,B)),B>=yd.length&&window.clearInterval(X)},XY);return()=>window.clearInterval(X)},[e.activeChatId,e.messages.length]),x.useEffect(()=>{function B(X){if(l&&!(!X.metaKey||X.key.toLowerCase()!=="j")){if(X.preventDefault(),w){m(l);return}h(l)}}return window.addEventListener("keydown",B),()=>window.removeEventListener("keydown",B)},[h,w,l,m]),x.useEffect(()=>{if(e.messages.length===0)return;const B=window.requestAnimationFrame(()=>{const X=e.scrollRef.current;X&&X.scrollTo({top:X.scrollHeight,behavior:"auto"})});return()=>window.cancelAnimationFrame(B)},[C,e.messages.length,e.scrollRef]);const k=v.jsxs(PM,{ref:t,className:"bg-background h-full flex flex-col overflow-hidden border-0 rounded-none relative",children:[v.jsxs(HM,{className:"flex flex-1 min-h-0 flex-col p-0 overflow-hidden relative",children:[v.jsx(E9,{sidebarCollapsed:e.sidebarCollapsed,onOpenSidebar:e.openSidebar,onExpandSidebar:e.expandSidebar,onNewChat:e.handleCompose,localPath:e.navbarLocalPath,embeddedTerminalVisible:C,onToggleEmbeddedTerminal:l?()=>{if(w){m(l);return}h(l)}:void 0,onOpenExternal:B=>{e.handleOpenExternal(B)}}),v.jsxs(l5,{ref:e.scrollRef,onScroll:e.updateScrollState,className:"flex-1 min-h-0 px-4 scroll-pt-[72px]",children:[e.messages.length===0?v.jsx("div",{style:{height:e.transcriptPaddingBottom},"aria-hidden":"true"}):null,e.messages.length>0?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"animate-fade-in space-y-5 pt-[72px] max-w-[800px] mx-auto",children:[v.jsx(GY,{messages:e.messages,isLoading:e.isProcessing,localPath:(D=e.runtime)==null?void 0:D.localPath,latestToolIds:e.latestToolIds,onAskUserQuestionSubmit:e.handleAskUserQuestion,onExitPlanModeConfirm:e.handleExitPlanMode}),e.isProcessing?v.jsx(PU,{status:(z=e.runtime)==null?void 0:z.status}):null,e.commandError?v.jsx("div",{className:"text-sm text-destructive border border-destructive/20 bg-destructive/5 rounded-xl px-4 py-3",children:e.commandError}):null]}),v.jsx("div",{style:{height:e.transcriptPaddingBottom+96},"aria-hidden":"true"})]}):null]}),e.messages.length===0?v.jsx("div",{className:"pointer-events-none absolute inset-x-4 animate-fade-in",style:{top:ZY,bottom:e.transcriptPaddingBottom},children:v.jsx("div",{className:"mx-auto flex h-full max-w-[800px] items-center justify-center",children:v.jsxs("div",{className:"flex flex-col items-center justify-center text-muted-foreground gap-4 opacity-70",children:[v.jsx(zc,{strokeWidth:1.5,className:"size-8 text-muted-foreground kanna-empty-state-flower"}),v.jsx("div",{className:"text-base font-normal text-muted-foreground text-center max-w-xs flex items-center kanna-empty-state-text","aria-label":yd,children:v.jsxs("span",{className:"relative inline-grid place-items-start",children:[v.jsxs("span",{className:"invisible col-start-1 row-start-1 whitespace-pre flex items-center",children:[v.jsx("span",{children:yd}),v.jsx("span",{className:"kanna-typewriter-cursor-slot","aria-hidden":"true"})]}),v.jsxs("span",{className:"col-start-1 row-start-1 whitespace-pre flex items-center",children:[v.jsx("span",{children:r}),v.jsx("span",{className:"kanna-typewriter-cursor-slot","aria-hidden":"true",children:v.jsx("span",{className:"kanna-typewriter-cursor"})})]})]})})]})})},e.activeChatId??"new-chat"):null,v.jsx("div",{style:{bottom:e.transcriptPaddingBottom-36},className:ye("absolute left-1/2 -translate-x-1/2 z-10 transition-all",e.showScrollButton?"scale-100 duration-300 ease-[cubic-bezier(0.34,1.56,0.64,1)]":"scale-60 duration-300 ease-out pointer-events-none blur-sm opacity-0"),children:v.jsx("button",{onClick:e.scrollToBottom,className:"flex items-center transition-colors gap-1.5 px-2 bg-white hover:bg-muted border border-border rounded-full aspect-square cursor-pointer text-sm text-primary hover:text-foreground dark:bg-slate-700 dark:hover:bg-slate-600 dark:text-slate-100 dark:border-slate-600",children:v.jsx(tz,{className:"h-5 w-5"})})})]}),v.jsx("div",{className:"absolute bottom-0 left-0 right-0 z-20 pointer-events-none",children:v.jsx("div",{className:"bg-gradient-to-t from-background via-background pointer-events-auto",ref:e.inputRef,children:v.jsx(S9,{ref:n,onSubmit:e.handleSend,onCancel:()=>{e.handleCancel()},disabled:!e.hasSelectedProject||((L=e.runtime)==null?void 0:L.status)==="waiting_for_user",canCancel:e.canCancel,chatId:e.activeChatId,activeProvider:((O=e.runtime)==null?void 0:O.provider)??null,availableProviders:e.availableProviders},e.activeChatId??"new-chat")})})]});return v.jsx("div",{className:"flex-1 flex flex-col min-w-0 relative",children:C&&l?v.jsxs(iT,{orientation:"vertical",className:"flex-1 min-h-0",onLayoutChanged:B=>p(l,[B.chat,B.terminal]),children:[v.jsx(Hv,{id:"chat",defaultSize:`${u.mainSizes[0]}%`,minSize:"25%",className:"min-h-0",children:k}),v.jsx(sT,{withHandle:!0,orientation:"vertical"}),v.jsx(Hv,{id:"terminal",defaultSize:`${u.mainSizes[1]}%`,minSize:"0%",className:"min-h-0",children:v.jsx(OU,{projectId:l,layout:u,onAddTerminal:h,socket:e.socket,connectionStatus:e.connectionStatus,scrollback:b,minColumnWidth:S,onRemoveTerminal:(B,X)=>{e.socket.command({type:"terminal.close",terminalId:X}).catch(()=>{}),d(B,X)},onTerminalLayout:_})})]},l):k})}function H_({narrow:e=!1,title:t,subtitle:n,icon:r=CE}){return v.jsxs("div",{className:ye("w-full",e?"max-w-2xl px-6 pt-16 mx-auto":"px-6 pt-16 mb-10"),children:[v.jsxs("div",{className:ye("flex items-center gap-1 mb-2",e&&"justify-center"),children:[v.jsx("div",{className:"p-2 pl-0 rounded-lg",children:v.jsx(r,{className:"h-6 w-6 text-muted-foreground"})}),v.jsx("h1",{className:"text-2xl font-semibold text-foreground",children:t})]}),n&&v.jsx("p",{className:ye("text-muted-foreground",e&&"mb-10 text-center"),children:n})]})}const JY={sm:"text-sm px-2.5 py-1",md:"text-sm px-3 py-1.5"};function eX({value:e,onValueChange:t,options:n,size:r="md",className:s,optionClassName:l}){return v.jsx("div",{className:ye("inline-flex items-center rounded-full border border-border p-0.5 ",s),children:n.map(a=>{const u=a.value===e,h=a.icon,d=h?x.isValidElement(h)?h:(()=>{const p=h;return v.jsx(p,{className:r==="sm"?"h-3.5 w-3.5":"h-4 w-4"})})():null,m=v.jsxs("button",{type:"button",onClick:()=>t(a.value),disabled:a.disabled,"aria-pressed":u,className:ye("rounded-full border transition-colors",h?"grid grid-cols-[auto_auto] items-center gap-2":"inline-flex items-center gap-1.5",JY[r],u?"bg-white dark:bg-muted text-slate-900 dark:text-slate-200 border-slate-300 dark:border-white/10 bg-slate-200 ":"border-transparent text-slate-800 hover:text-slate-900 dark:text-muted-foreground dark:hover:text-foreground",a.disabled&&"opacity-50 pointer-events-none",l),children:[d,v.jsx("span",{children:a.label})]},a.value);return a.tooltip?v.jsxs(Yc,{children:[v.jsx(Xc,{asChild:!0,children:m}),v.jsx(ia,{children:a.tooltip})]},a.value):m})})}function tX(e){return e.toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")}function nX({open:e,onOpenChange:t,onConfirm:n}){const[r,s]=x.useState("new"),[l,a]=x.useState(""),[u,h]=x.useState(""),d=x.useRef(null),m=x.useRef(null);x.useEffect(()=>{e&&(s("new"),a(""),h(""),setTimeout(()=>{var C;return(C=d.current)==null?void 0:C.focus()},0))},[e]),x.useEffect(()=>{e&&setTimeout(()=>{var C,k;r==="new"?(C=d.current)==null||C.focus():(k=m.current)==null||k.focus()},0)},[r,e]);const p=tX(l),_=p?`${yj}/${p}`:"",b=u.trim(),S=r==="new"?!!p:!!b,w=()=>{if(S){if(r==="new")n({mode:"new",localPath:_,title:l.trim()});else{const C=b.split("/").pop()||b;n({mode:"existing",localPath:b,title:C})}t(!1)}};return v.jsx(TE,{open:e,onOpenChange:t,children:v.jsxs(cy,{size:"sm",children:[v.jsxs(NE,{className:"space-y-4",children:[v.jsx(DE,{children:"Add Project"}),v.jsx(eX,{value:r,onValueChange:s,options:[{value:"new",label:"New Folder"},{value:"existing",label:"Existing Path"}],className:"w-full",optionClassName:"flex-1 justify-center"}),r==="new"?v.jsxs("div",{className:"space-y-2",children:[v.jsx("input",{ref:d,type:"text",value:l,onChange:C=>a(C.target.value),onKeyDown:C=>{C.key==="Enter"&&w(),C.key==="Escape"&&t(!1)},className:"w-full px-3 py-2 text-sm border border-border rounded-md bg-background outline-none",placeholder:"Project name"}),_&&v.jsx("p",{className:"text-xs text-muted-foreground font-mono",children:_})]}):v.jsxs("div",{className:"space-y-2",children:[v.jsx("input",{ref:m,type:"text",value:u,onChange:C=>h(C.target.value),onKeyDown:C=>{C.key==="Enter"&&w(),C.key==="Escape"&&t(!1)},className:"w-full px-3 py-2 text-sm border border-border rounded-md bg-background outline-none",placeholder:"~/Projects/my-app"}),v.jsx("p",{className:"text-xs text-muted-foreground",children:"The folder will be created if it doesn't exist."})]})]}),v.jsxs(OE,{children:[v.jsx(Ke,{variant:"ghost",size:"sm",onClick:()=>t(!1),children:"Cancel"}),v.jsx(Ke,{variant:"secondary",size:"sm",onClick:w,disabled:!S,children:"Create"})]})]})})}function rX({text:e}){const[t,n]=x.useState(!1);async function r(){await navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)}return v.jsx(Ke,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>void r(),children:t?v.jsx(Lo,{className:"h-4 w-4 text-green-400"}):v.jsx(Sf,{className:"h-4 w-4"})})}function Q2({children:e}){return v.jsxs("div",{className:"grid grid-cols-[1fr_auto] items-center group bg-background border border-border text-foreground rounded-xl p-1.5 pl-3 font-mono text-sm",children:[v.jsxs("pre",{className:"inline-flex items-center gap-2 overflow-x-auto",children:[v.jsx(Ji,{className:"inline h-4 w-4 opacity-40"}),v.jsx("code",{children:e})]}),v.jsx(rX,{text:e})]})}function bd({children:e}){return v.jsx("div",{className:"bg-card border border-border rounded-2xl p-4",children:e})}function pv({children:e}){return v.jsx("h2",{className:"text-[13px] font-medium text-muted-foreground uppercase tracking-wider mb-3",children:e})}function mv({icon:e,title:t,subtitle:n,iconClassName:r}){return v.jsxs("div",{className:"flex flex-col items-center gap-0",children:[v.jsx("div",{className:"p-3 mb-2 rounded-xl bg-background border border-border",children:v.jsx(e,{className:r||"h-8 w-8 text-muted-foreground"})}),v.jsx("span",{className:"text-sm font-medium",children:t}),v.jsx("span",{className:"text-xs text-muted-foreground",children:n})]})}function J2(){return v.jsx(rz,{className:"h-4 w-4 text-muted-foreground"})}function ek({number:e,title:t,children:n}){return v.jsx("div",{className:"flex gap-4",children:v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsxs("div",{className:"grid grid-cols-[auto_1fr] items-baseline gap-3",children:[v.jsxs("div",{className:"flex-shrink-0 flex items-center justify-center font-medium text-logo",children:[e,"."]}),v.jsx("h3",{className:"font-medium text-foreground mb-2",children:t})]}),v.jsx("div",{className:"text-muted-foreground text-sm space-y-3",children:n})]})})}function iX({localPath:e,loading:t,onClick:n}){return v.jsxs(Yc,{children:[v.jsx(Xc,{asChild:!0,children:v.jsxs("button",{className:ye("border border-border hover:border-primary/30 group rounded-lg bg-card px-4 py-3 flex items-center gap-3 w-full text-left hover:bg-muted/50 transition-colors",t&&"opacity-50 cursor-not-allowed"),disabled:t,onClick:n,children:[v.jsx(Hz,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),v.jsx("span",{className:"font-medium text-foreground truncate flex-1",children:fR(e)}),t?v.jsx(Js,{className:"h-4 w-4 text-muted-foreground group-hover:text-primary animate-spin flex-shrink-0"}):v.jsx(sy,{className:"h-4 w-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0"})]})}),v.jsx(ia,{children:v.jsx("p",{children:e})})]})}function sX({connectionStatus:e,ready:t,snapshot:n,startingLocalPath:r,commandError:s,onOpenProject:l,onCreateProject:a}){const[u,h]=x.useState(!1),d=x.useMemo(()=>(n==null?void 0:n.projects)??[],[n==null?void 0:n.projects]),m=e==="connecting"||!t,p=e==="connected"&&t;return v.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-y-auto",children:[p?v.jsxs(v.Fragment,{children:[v.jsx(H_,{title:(n==null?void 0:n.machine.displayName)??"Local Projects",subtitle:`${Ln} is connected, choose a project below to get started.`}),v.jsxs("div",{className:"w-full px-6 mb-10",children:[v.jsxs("div",{className:"flex items-baseline justify-between mb-3",children:[v.jsx("h2",{className:"text-[13px] font-medium text-muted-foreground uppercase tracking-wider",children:"Projects"}),v.jsxs(Ke,{variant:"default",size:"sm",onClick:()=>h(!0),children:[v.jsx(iy,{className:"h-4 w-4 mr-1.5"}),"Add Project"]})]}),d.length>0?v.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-4 3xl:grid-cols-5 gap-2",children:d.map(_=>v.jsx(iX,{localPath:_.localPath,loading:r===_.localPath,onClick:()=>{l(_.localPath)}},_.localPath))}):v.jsx(bd,{children:v.jsx("p",{className:"text-sm text-muted-foreground",children:"No local projects discovered yet. Open one with Claude or Codex, or create a new project here."})}),s?v.jsx("div",{className:"text-sm text-destructive border border-destructive/20 bg-destructive/5 rounded-xl px-4 py-3 mt-4",children:s}):null]})]}):v.jsxs(v.Fragment,{children:[v.jsx(H_,{narrow:!0,icon:ow,title:m?`Connecting ${Ln}`:`Connect ${Ln}`,subtitle:m?`${Ln} is starting up and loading your local projects.`:`Run ${Ln} directly on your machine with full access to your local files and agent project history.`}),v.jsxs("div",{className:"max-w-2xl w-full mx-auto pb-12 px-6",children:[v.jsx(pv,{children:"Status"}),v.jsx("div",{className:"mb-8",children:v.jsx(bd,{children:v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx(Js,{className:"h-4 w-4 text-muted-foreground animate-spin"}),v.jsx("span",{className:"text-sm text-muted-foreground",children:m?`Connecting to your local ${Ln} server...`:v.jsxs(v.Fragment,{children:["Not connected. Run ",v.jsx("code",{className:"bg-background border border-border rounded-md mx-0.5 p-1 font-mono text-xs text-foreground",children:td()})," from any terminal on this machine."]})})]})})}),m?null:v.jsxs("div",{className:"mb-10",children:[v.jsx(pv,{children:"How it works"}),v.jsx(bd,{children:v.jsxs("div",{className:"flex items-center justify-around gap-6 py-4 px-2",children:[v.jsx(mv,{icon:oy,title:`${Ln} CLI`,subtitle:"On Your Machine"}),v.jsx(J2,{}),v.jsx(mv,{icon:CE,title:`${Ln} Server`,subtitle:"Local WebSocket"}),v.jsx(J2,{}),v.jsx(mv,{icon:ow,title:`${Ln} UI`,subtitle:"Project Chat"})]})})]}),m?null:v.jsxs("div",{className:"mb-10",children:[v.jsx(pv,{children:"Setup"}),v.jsx(bd,{children:v.jsxs("div",{className:"space-y-4",children:[v.jsxs(ek,{number:1,title:`Start ${Ln}`,children:[v.jsx("p",{children:"Run this command in your terminal:"}),v.jsx(Q2,{children:td()})]}),v.jsxs(ek,{number:2,title:"Open the local UI",children:[v.jsxs("p",{children:[Ln," serves the app locally and opens the Local Projects page in an app-style browser window."]}),v.jsx(Q2,{children:"http://localhost:3210/local"})]}),v.jsxs("div",{className:"mt-8",children:[v.jsx("h3",{className:"text-sm font-medium text-muted-foreground uppercase tracking-wider mb-4",children:"Notes"}),v.jsxs("div",{className:"space-y-3 text-sm",children:[v.jsxs("div",{className:"flex gap-4",children:[v.jsx("code",{className:"font-mono text-foreground whitespace-nowrap",children:td("").trim()}),v.jsx("span",{className:"text-muted-foreground",children:"Start in the current directory"})]}),v.jsxs("div",{className:"flex gap-4",children:[v.jsx("code",{className:"font-mono text-foreground whitespace-nowrap",children:td("--no-open")}),v.jsx("span",{className:"text-muted-foreground",children:"Start the server without opening the browser"})]})]})]})]})})]})]})]}),v.jsx(nX,{open:u,onOpenChange:h,onConfirm:_=>{a(_)}}),v.jsx("div",{className:"py-4 text-center",children:v.jsxs("span",{className:"text-xs text-muted-foreground/50",children:["v",dR.split("/")[1]]})})]})}function oX(){const e=q_();return v.jsx("div",{className:"flex-1 flex flex-col min-w-0 relative",children:v.jsx(sX,{connectionStatus:e.connectionStatus,ready:e.localProjectsReady,snapshot:e.localProjects,startingLocalPath:e.startingLocalPath,commandError:e.commandError,onOpenProject:e.handleOpenLocalProject,onCreateProject:e.handleCreateProject})})}function xd({title:e,description:t,value:n}){return v.jsxs("div",{className:"rounded-2xl border border-border bg-card p-4",children:[v.jsx("div",{className:"mb-1 text-sm font-medium text-foreground",children:e}),v.jsx("div",{className:"mb-3 text-sm text-muted-foreground",children:t}),v.jsx("div",{className:"rounded-xl border border-border bg-background px-3 py-2 font-mono text-sm text-foreground",children:n})]})}function lX(){var S,w,C;const e=q_(),t=e.connectionStatus==="connecting"||!e.localProjectsReady,n=((S=e.localProjects)==null?void 0:S.machine.displayName)??"Settings",r=Vl(k=>k.scrollbackLines),s=Vl(k=>k.minColumnWidth),l=Vl(k=>k.setScrollbackLines),a=Vl(k=>k.setMinColumnWidth),[u,h]=x.useState(String(r)),[d,m]=x.useState(String(s));x.useEffect(()=>{h(String(r))},[r]),x.useEffect(()=>{m(String(s))},[s]);function p(){const k=Number(u);if(!Number.isFinite(k)){h(String(r));return}l(k)}function _(){const k=Number(d);if(!Number.isFinite(k)){m(String(s));return}a(k)}function b(k,T){k.key==="Enter"&&(T(),k.currentTarget.blur())}return v.jsxs("div",{className:"flex-1 min-w-0 overflow-y-auto bg-background",children:[v.jsx(H_,{icon:EE,title:n,subtitle:t?"Kanna is starting up and loading your local environment settings.":"Kanna is connected. Configure app details and review your local environment."}),v.jsxs("div",{className:"w-full px-6 pb-10",children:[v.jsx("div",{className:"mb-3 flex items-baseline justify-between",children:v.jsx("h2",{className:"text-[13px] font-medium uppercase tracking-wider text-muted-foreground",children:"Settings"})}),t?v.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-border bg-card px-4 py-4 text-sm text-muted-foreground",children:[v.jsx(Js,{className:"h-4 w-4 animate-spin"}),v.jsx("span",{children:"Loading machine settings…"})]}):v.jsxs("div",{className:"grid grid-cols-1 gap-3 lg:grid-cols-2",children:[v.jsx(xd,{title:"Machine",description:"The local machine currently connected to Kanna.",value:((w=e.localProjects)==null?void 0:w.machine.displayName)??"Unavailable"}),v.jsx(xd,{title:"Connection",description:"Current connection state for the local Kanna runtime.",value:e.connectionStatus}),v.jsx(xd,{title:"Projects Indexed",description:"Number of local projects currently available in the app.",value:String(((C=e.localProjects)==null?void 0:C.projects.length)??0)}),v.jsx(xd,{title:"App Version",description:"Current Kanna desktop client build.",value:dR.split("/")[1]??"unknown"}),v.jsxs("div",{className:"rounded-2xl border border-border bg-card p-4",children:[v.jsxs("div",{className:"mb-3 flex items-start justify-between gap-3",children:[v.jsxs("div",{children:[v.jsx("div",{className:"mb-1 text-sm font-medium text-foreground",children:"Terminal Scrollback"}),v.jsx("div",{className:"text-sm text-muted-foreground",children:"Number of lines retained for embedded terminal history."})]}),v.jsxs(Ke,{variant:"ghost",size:"sm",onClick:()=>l(af),children:[v.jsx(cw,{className:"size-3.5"}),"Restore Default"]})]}),v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("input",{type:"number",min:k_,max:E_,step:100,value:u,onChange:k=>h(k.target.value),onBlur:p,onKeyDown:k=>b(k,p),className:"w-32 rounded-xl border border-border bg-background px-3 py-2 font-mono text-sm text-foreground outline-none ring-0"}),v.jsxs("div",{className:"text-xs text-muted-foreground",children:[k_,"-",E_," lines"]})]})]}),v.jsxs("div",{className:"rounded-2xl border border-border bg-card p-4",children:[v.jsxs("div",{className:"mb-3 flex items-start justify-between gap-3",children:[v.jsxs("div",{children:[v.jsx("div",{className:"mb-1 text-sm font-medium text-foreground",children:"Terminal Min Column Width"}),v.jsx("div",{className:"text-sm text-muted-foreground",children:"Minimum width for each embedded terminal pane before resize is constrained."})]}),v.jsxs(Ke,{variant:"ghost",size:"sm",onClick:()=>a(ou),children:[v.jsx(cw,{className:"size-3.5"}),"Restore Default"]})]}),v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("input",{type:"number",min:R_,max:M_,step:10,value:d,onChange:k=>m(k.target.value),onBlur:_,onKeyDown:k=>b(k,_),className:"w-32 rounded-xl border border-border bg-background px-3 py-2 font-mono text-sm text-foreground outline-none ring-0"}),v.jsxs("div",{className:"text-xs text-muted-foreground",children:[R_,"-",M_," px",s===ou?" default":""]})]})]})]}),e.commandError?v.jsxs("div",{className:"mt-4 flex items-start gap-3 rounded-2xl border border-destructive/20 bg-destructive/5 px-4 py-3 text-sm text-destructive",children:[v.jsx($z,{className:"mt-0.5 h-4 w-4 flex-shrink-0"}),v.jsx("span",{children:e.commandError})]}):null]})]})}function Sd(e){return!e||typeof e!="object"||Array.isArray(e)?null:e}function aX(e){if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return e}}function cX(e,t){const n=aX(t);switch(e.toolKind){case"ask_user_question":{const s=Sd(n),l=Sd(s==null?void 0:s.answers)??(s||{});return{answers:Object.fromEntries(Object.entries(l).map(([a,u])=>Array.isArray(u)?[a,u.map(h=>String(h))]:u&&typeof u=="object"&&Array.isArray(u.answers)?[a,u.answers.map(h=>String(h))]:u==null||u===""?[a,[]]:[a,[String(u)]])),...(s==null?void 0:s.discarded)===!0?{discarded:!0}:{}}}case"exit_plan_mode":{const s=Sd(n);return{confirmed:typeof(s==null?void 0:s.confirmed)=="boolean"?s.confirmed:void 0,clearContext:typeof(s==null?void 0:s.clearContext)=="boolean"?s.clearContext:void 0,message:typeof(s==null?void 0:s.message)=="string"?s.message:void 0,...(s==null?void 0:s.discarded)===!0?{discarded:!0}:{}}}case"read_file":if(typeof n=="string")return n;const r=Sd(n);return{content:typeof(r==null?void 0:r.content)=="string"?r.content:JSON.stringify(n,null,2)};default:return n}}function vA(e){return new Date(e).toISOString()}function Gr(e){return{id:e._id,messageId:e.messageId,timestamp:vA(e.createdAt),hidden:e.hidden}}function uX(e){return{id:e._id,messageId:e.messageId,hidden:e.hidden,kind:"tool",toolKind:e.tool.toolKind,toolName:e.tool.toolName,toolId:e.tool.toolId,input:e.tool.input,timestamp:vA(e.createdAt)}}function hX(e){if(e.debugRaw)try{return JSON.parse(e.debugRaw).tool_use_result}catch{return}}function dX(e){const t=new Map,n=[];for(const r of e)switch(r.kind){case"user_prompt":n.push({...Gr(r),kind:"user_prompt",content:r.content});break;case"system_init":n.push({...Gr(r),kind:"system_init",provider:r.provider,model:r.model,tools:r.tools,agents:r.agents,slashCommands:r.slashCommands,mcpServers:r.mcpServers,debugRaw:r.debugRaw});break;case"account_info":n.push({...Gr(r),kind:"account_info",accountInfo:r.accountInfo});break;case"assistant_text":n.push({...Gr(r),kind:"assistant_text",text:r.text});break;case"tool_call":{const s=uX(r);t.set(r.tool.toolId,{hydrated:s,normalized:r.tool}),n.push(s);break}case"tool_result":{const s=t.get(r.toolId);if(s){const l=s.normalized.toolKind==="ask_user_question"||s.normalized.toolKind==="exit_plan_mode"?hX(r)??r.content:r.content;s.hydrated.result=cX(s.normalized,l),s.hydrated.rawResult=l,s.hydrated.isError=r.isError}break}case"result":n.push({...Gr(r),kind:"result",success:!r.isError,cancelled:r.subtype==="cancelled",result:r.result,durationMs:r.durationMs,costUsd:r.costUsd});break;case"status":n.push({...Gr(r),kind:"status",status:r.status});break;case"compact_boundary":n.push({...Gr(r),kind:"compact_boundary"});break;case"compact_summary":n.push({...Gr(r),kind:"compact_summary",summary:r.summary});break;case"context_cleared":n.push({...Gr(r),kind:"context_cleared"});break;case"interrupted":n.push({...Gr(r),kind:"interrupted"});break;default:n.push({...Gr(r),kind:"unknown",json:JSON.stringify(r,null,2)});break}return n}const fX=["AskUserQuestion","ExitPlanMode","TodoWrite"],pX=new Set(["TodoWrite"]);function mX(e,t){for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(r.kind!=="tool")continue;const s=r;if(s.toolName===t&&!s.result)return s.id}return null}function gX(e,t){for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(r.kind!=="tool")continue;const s=r;if(s.toolName===t)return s.id}return null}function vX(e){const t={};for(const n of fX)t[n]=pX.has(n)?gX(e,n):mX(e,n);return t}function _X(e){return e==="starting"||e==="running"||e==="waiting_for_user"}function yX(e){return e==="starting"||e==="running"||e==="waiting_for_user"}const bX=25e3,xX=15e3,SX=4e3;class wX{constructor(t){Vt(this,"url");Vt(this,"ws",null);Vt(this,"started",!1);Vt(this,"reconnectTimer",null);Vt(this,"reconnectDelayMs",750);Vt(this,"subscriptions",new Map);Vt(this,"pending",new Map);Vt(this,"outboundQueue",[]);Vt(this,"statusListeners",new Set);Vt(this,"heartbeatTimer",null);Vt(this,"pingTimeoutTimer",null);Vt(this,"pingPromise",null);Vt(this,"lastOpenAt",0);Vt(this,"lastMessageAt",0);Vt(this,"reconnectImmediatelyOnClose",!1);Vt(this,"handleWindowFocus",()=>{this.ensureHealthyConnection()});Vt(this,"handleVisibilityChange",()=>{if(document.visibilityState==="visible"){this.startHeartbeat(),this.ensureHealthyConnection();return}this.stopHeartbeat()});Vt(this,"handleOnline",()=>{this.ensureHealthyConnection()});this.url=t}start(){this.started||(this.started=!0,window.addEventListener("focus",this.handleWindowFocus),window.addEventListener("online",this.handleOnline),document.addEventListener("visibilitychange",this.handleVisibilityChange),this.connect())}dispose(){var t;this.started=!1,this.reconnectTimer&&(window.clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.stopHeartbeat(),this.clearPingState(),window.removeEventListener("focus",this.handleWindowFocus),window.removeEventListener("online",this.handleOnline),document.removeEventListener("visibilitychange",this.handleVisibilityChange),(t=this.ws)==null||t.close(),this.ws=null;for(const n of this.pending.values())n.reject(new Error("Socket disposed"));this.pending.clear()}onStatus(t){return this.statusListeners.add(t),t(this.getStatus()),()=>{this.statusListeners.delete(t)}}subscribe(t,n){const r=crypto.randomUUID();return this.subscriptions.set(r,{topic:t,listener:n}),this.enqueue({v:1,type:"subscribe",id:r,topic:t}),()=>{this.subscriptions.delete(r),this.enqueue({v:1,type:"unsubscribe",id:r})}}subscribeTerminal(t,n){const r=crypto.randomUUID(),s={type:"terminal",terminalId:t};return this.subscriptions.set(r,{topic:s,listener:n.onSnapshot,eventListener:n.onEvent}),this.enqueue({v:1,type:"subscribe",id:r,topic:s}),()=>{this.subscriptions.delete(r),this.enqueue({v:1,type:"unsubscribe",id:r})}}command(t){const n=crypto.randomUUID(),r={v:1,type:"command",id:n,command:t};return new Promise((s,l)=>{this.pending.set(n,{resolve:s,reject:l}),this.enqueue(r)})}ensureHealthyConnection(){return!this.ws||this.ws.readyState===WebSocket.CLOSED||this.ws.readyState===WebSocket.CLOSING?(this.reconnectNow(),Promise.resolve()):this.ws.readyState===WebSocket.CONNECTING||!this.isConnectionStale()?Promise.resolve():this.sendPing()}connect(){this.started&&(this.emitStatus("connecting"),this.ws=new WebSocket(this.url),this.ws.addEventListener("open",()=>{this.reconnectDelayMs=750,this.reconnectImmediatelyOnClose=!1,this.lastOpenAt=Date.now(),this.lastMessageAt=this.lastOpenAt,this.emitStatus("connected"),this.startHeartbeat();for(const[t,n]of this.subscriptions.entries())this.sendNow({v:1,type:"subscribe",id:t,topic:n.topic});for(;this.outboundQueue.length>0;){const t=this.outboundQueue.shift();t&&this.sendNow(t)}}),this.ws.addEventListener("message",t=>{var r;this.lastMessageAt=Date.now();let n;try{n=JSON.parse(String(t.data))}catch{return}if(n.type==="snapshot"){const s=this.subscriptions.get(n.id);s==null||s.listener(n.snapshot.data);return}if(n.type==="event"){const s=this.subscriptions.get(n.id);(r=s==null?void 0:s.eventListener)==null||r.call(s,n.event);return}if(n.type==="ack"){const s=this.pending.get(n.id);if(!s)return;this.pending.delete(n.id),s.resolve(n.result);return}if(n.type==="error"){if(!n.id){console.error(_j,n.message);return}const s=this.pending.get(n.id);if(!s)return;this.pending.delete(n.id),s.reject(new Error(n.message))}}),this.ws.addEventListener("close",()=>{if(!this.started)return;const t=this.reconnectImmediatelyOnClose;this.reconnectImmediatelyOnClose=!1,this.stopHeartbeat(),this.clearPingState(),this.emitStatus("disconnected");for(const n of this.pending.values())n.reject(new Error("Disconnected"));if(this.pending.clear(),t){this.connect();return}this.scheduleReconnect()}))}scheduleReconnect(){this.reconnectTimer===null&&(this.reconnectTimer=window.setTimeout(()=>{this.reconnectTimer=null,this.connect(),this.reconnectDelayMs=Math.min(this.reconnectDelayMs*2,5e3)},this.reconnectDelayMs))}getStatus(){var t,n;return((t=this.ws)==null?void 0:t.readyState)===WebSocket.OPEN?"connected":((n=this.ws)==null?void 0:n.readyState)===WebSocket.CONNECTING?"connecting":"disconnected"}emitStatus(t){for(const n of this.statusListeners)n(t)}isConnectionStale(){const t=Math.max(this.lastMessageAt,this.lastOpenAt);return t>0&&Date.now()-t>=bX}sendPing(){if(this.pingPromise)return this.pingPromise;const t=this.command({type:"system.ping"}).then(()=>{this.clearPingState()}).catch(n=>{throw this.clearPingState(),this.reconnectNow(),n});return this.pingTimeoutTimer=window.setTimeout(()=>{this.clearPingState(),this.reconnectNow()},SX),this.pingPromise=t,t}reconnectNow(){if(this.reconnectTimer!==null&&(window.clearTimeout(this.reconnectTimer),this.reconnectTimer=null),!this.ws||this.ws.readyState===WebSocket.CLOSED){this.connect();return}this.ws.readyState!==WebSocket.CONNECTING&&(this.reconnectImmediatelyOnClose=!0,this.ws.close())}startHeartbeat(){document.visibilityState==="visible"&&this.heartbeatTimer===null&&(this.heartbeatTimer=window.setInterval(()=>{var t;if(document.visibilityState!=="visible"){this.stopHeartbeat();return}((t=this.ws)==null?void 0:t.readyState)===WebSocket.OPEN&&this.ensureHealthyConnection()},xX))}stopHeartbeat(){this.heartbeatTimer!==null&&(window.clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}clearPingState(){this.pingTimeoutTimer!==null&&(window.clearTimeout(this.pingTimeoutTimer),this.pingTimeoutTimer=null),this.pingPromise=null}enqueue(t){var n;if(((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN){this.sendNow(t);return}this.outboundQueue.push(t)}sendNow(t){var n;(n=this.ws)==null||n.send(JSON.stringify(t))}}function CX(e,t){var r;const n=e.find(s=>s.chats.some(l=>l.chatId===t));return n?((r=n.chats.find(s=>s.chatId!==t))==null?void 0:r.chatId)??null:null}function kX(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function EX(){const e=x.useRef(null);return e.current||(e.current=new wX(kX())),x.useEffect(()=>{const t=e.current;return t==null||t.start(),()=>{t==null||t.dispose()}},[]),e.current}function RX(e){var Tt,as,le;const t=W_(),n=EX(),r=N6(),[s,l]=x.useState({projectGroups:[]}),[a,u]=x.useState(null),[h,d]=x.useState(null),[m,p]=x.useState("connecting"),[_,b]=x.useState(!1),[S,w]=x.useState(!1),[C,k]=x.useState(!1),[T,R]=x.useState(null),[D,z]=x.useState(!1),[L,O]=x.useState(!1),[B,X]=x.useState(148),[P,q]=x.useState(!0),[H,U]=x.useState(null),[V,F]=x.useState(null),[j,K]=x.useState(null),$=x.useRef(null),J=x.useRef(null);x.useEffect(()=>n.onStatus(p),[n]),x.useEffect(()=>n.subscribe({type:"sidebar"},ne=>{l(ne),b(!0),U(null)}),[n]),x.useEffect(()=>n.subscribe({type:"local-projects"},ne=>{u(ne),w(!0),U(null)}),[n]),x.useEffect(()=>{if(!e){d(null),k(!0);return}return k(!1),n.subscribe({type:"chat",chatId:e},ne=>{d(ne),k(!0),U(null)})},[e,n]),x.useEffect(()=>{if(T)return;const ne=s.projectGroups[0];ne&&R(ne.groupKey)},[T,s.projectGroups]),x.useEffect(()=>{if(!e||!_||!C)return;if(s.projectGroups.some(de=>de.chats.some(ve=>ve.chatId===e))){j===e&&K(null);return}j!==e&&t("/")},[e,C,t,j,s.projectGroups,_]),x.useEffect(()=>{h&&(R(h.runtime.projectId),j===h.runtime.chatId&&K(null))},[h,j]),x.useLayoutEffect(()=>{const ne=J.current;if(!ne)return;const de=new ResizeObserver(()=>{X(ne.getBoundingClientRect().height)});return de.observe(ne),X(ne.getBoundingClientRect().height),()=>de.disconnect()},[]);const A=x.useMemo(()=>dX((h==null?void 0:h.messages)??[]),[h==null?void 0:h.messages]),I=x.useMemo(()=>vX(A),[A]),Y=(h==null?void 0:h.runtime)??null,M=(h==null?void 0:h.availableProviders)??QI,Z=yX(Y==null?void 0:Y.status),ae=_X(Y==null?void 0:Y.status),se=B+48,pe=!P&&A.length>0,ke=((Tt=a==null?void 0:a.projects[0])==null?void 0:Tt.localPath)??null,me=(Y==null?void 0:Y.localPath)??ke??((as=s.projectGroups[0])==null?void 0:as.localPath),Ee=!!(T??(Y==null?void 0:Y.projectId)??((le=s.projectGroups[0])==null?void 0:le.groupKey)??ke);x.useEffect(()=>{const ne=$.current;if(!ne)return;ne.scrollHeight-ne.scrollTop-ne.clientHeight<120&&ne.scrollTo({top:ne.scrollHeight,behavior:"smooth"})},[e,A.length,Y==null?void 0:Y.status]);function et(){const ne=$.current;if(!ne)return;const de=ne.scrollHeight-ne.scrollTop-ne.clientHeight;q(de<24)}function Ge(){const ne=$.current;ne&&ne.scrollTo({top:ne.scrollHeight,behavior:"smooth"})}async function Me(ne){try{const de=await n.command({type:"chat.create",projectId:ne});R(ne),K(de.chatId),t(`/chat/${de.chatId}`),z(!1)}catch(de){U(de instanceof Error?de.message:String(de))}}async function Xe(ne){try{F(ne);const de=await n.command({type:"project.open",localPath:ne});R(de.projectId);const ve=await n.command({type:"chat.create",projectId:de.projectId});K(ve.chatId),t(`/chat/${ve.chatId}`),z(!1),U(null)}catch(de){U(de instanceof Error?de.message:String(de))}finally{F(null)}}async function dn(ne){try{F(ne.localPath);const de=await n.command(ne.mode==="new"?{type:"project.create",localPath:ne.localPath,title:ne.title}:{type:"project.open",localPath:ne.localPath});R(de.projectId);const ve=await n.command({type:"chat.create",projectId:de.projectId});K(ve.chatId),t(`/chat/${ve.chatId}`),z(!1),U(null)}catch(de){U(de instanceof Error?de.message:String(de))}finally{F(null)}}async function fn(ne,de){var ve;try{let Ce=T??((ve=s.projectGroups[0])==null?void 0:ve.groupKey)??null;if(!e&&!Ce&&ke&&(Ce=(await n.command({type:"project.open",localPath:ke})).projectId,R(Ce)),!e&&!Ce)throw new Error("Open a project first");const Pe=await n.command({type:"chat.send",chatId:e??void 0,projectId:e?void 0:Ce??void 0,provider:de==null?void 0:de.provider,content:ne,model:de==null?void 0:de.model,modelOptions:de==null?void 0:de.modelOptions,planMode:de==null?void 0:de.planMode});!e&&Pe.chatId&&(K(Pe.chatId),t(`/chat/${Pe.chatId}`)),U(null)}catch(Ce){throw U(Ce instanceof Error?Ce.message:String(Ce)),Ce}}async function Hr(){if(e)try{await n.command({type:"chat.cancel",chatId:e})}catch(ne){U(ne instanceof Error?ne.message:String(ne))}}async function Fr(ne){if(await r.confirm({title:"Delete Chat",description:`Delete "${ne.title}"? This cannot be undone.`,confirmLabel:"Delete",confirmVariant:"destructive"}))try{if(await n.command({type:"chat.delete",chatId:ne.chatId}),ne.chatId===e){const ve=CX(s.projectGroups,ne.chatId);t(ve?`/chat/${ve}`:"/")}}catch(ve){U(ve instanceof Error?ve.message:String(ve))}}async function pn(ne){const de=s.projectGroups.find(Pe=>Pe.groupKey===ne);if(!de)return;const ve=de.localPath.split("/").filter(Boolean).pop()??de.localPath;if(await r.confirm({title:"Remove",description:`Remove "${ve}" from the sidebar? Existing chats will be removed from ${Ln}.`,confirmLabel:"Remove",confirmVariant:"destructive"}))try{await n.command({type:"project.remove",projectId:ne}),Ao.getState().clearProject(ne),(Y==null?void 0:Y.projectId)===ne&&t("/"),U(null)}catch(Pe){U(Pe instanceof Error?Pe.message:String(Pe))}}async function mn(ne){var ve,Ce;const de=(Y==null?void 0:Y.localPath)??((ve=a==null?void 0:a.projects[0])==null?void 0:ve.localPath)??((Ce=s.projectGroups[0])==null?void 0:Ce.localPath);if(de)try{await n.command({type:"system.openExternal",action:ne,localPath:de})}catch(Pe){U(Pe instanceof Error?Pe.message:String(Pe))}}function vr(){var ve,Ce;const ne=T??((ve=s.projectGroups[0])==null?void 0:ve.groupKey);if(ne){Me(ne);return}const de=(Ce=a==null?void 0:a.projects[0])==null?void 0:Ce.localPath;if(de){Xe(de);return}t("/")}async function ni(ne,de,ve){if(e)try{await n.command({type:"chat.respondTool",chatId:e,toolUseId:ne,result:{questions:de,answers:ve}})}catch(Ce){U(Ce instanceof Error?Ce.message:String(Ce))}}async function ls(ne,de,ve,Ce){if(e){de&&jM.getState().setPlanMode(!1);try{await n.command({type:"chat.respondTool",chatId:e,toolUseId:ne,result:{confirmed:de,...ve?{clearContext:!0}:{},...Ce?{message:Ce}:{}}})}catch(Pe){U(Pe instanceof Error?Pe.message:String(Pe))}}}return{socket:n,activeChatId:e,sidebarData:s,localProjects:a,chatSnapshot:h,connectionStatus:m,sidebarReady:_,localProjectsReady:S,commandError:H,startingLocalPath:V,sidebarOpen:D,sidebarCollapsed:L,scrollRef:$,inputRef:J,messages:A,latestToolIds:I,runtime:Y,availableProviders:M,isProcessing:Z,canCancel:ae,transcriptPaddingBottom:se,showScrollButton:pe,navbarLocalPath:me,hasSelectedProject:Ee,openSidebar:()=>z(!0),closeSidebar:()=>z(!1),collapseSidebar:()=>O(!0),expandSidebar:()=>O(!1),updateScrollState:et,scrollToBottom:Ge,handleCreateChat:Me,handleOpenLocalProject:Xe,handleCreateProject:dn,handleSend:fn,handleCancel:Hr,handleDeleteChat:Fr,handleRemoveProject:pn,handleOpenExternal:mn,handleCompose:vr,handleAskUserQuestion:ni,handleExitPlanMode:ls}}function MX(){const e=Ci(),t=k3(),n=RX(t.chatId??null),r=e.pathname==="/"||e.pathname==="/settings";return v.jsxs("div",{className:"flex h-[100dvh] min-h-[100dvh] overflow-hidden",children:[v.jsx(ZI,{data:n.sidebarData,activeChatId:n.activeChatId,connectionStatus:n.connectionStatus,ready:n.sidebarReady,open:n.sidebarOpen,collapsed:n.sidebarCollapsed,showMobileOpenButton:r,onOpen:n.openSidebar,onClose:n.closeSidebar,onCollapse:n.collapseSidebar,onExpand:n.expandSidebar,onCreateChat:s=>{n.handleCreateChat(s)},onDeleteChat:s=>{n.handleDeleteChat(s)},onRemoveProject:s=>{n.handleRemoveProject(s)}}),v.jsx(I3,{context:n})]})}function TX(){return v.jsx(mj,{children:v.jsx(D6,{children:v.jsx(F3,{children:v.jsxs(Rc,{element:v.jsx(MX,{}),children:[v.jsx(Rc,{path:"/",element:v.jsx(oX,{})}),v.jsx(Rc,{path:"/settings",element:v.jsx(lX,{})}),v.jsx(Rc,{path:"/chat/:chatId",element:v.jsx(QY,{})})]})})})})}const _A=document.getElementById("root");if(!_A)throw new Error("Missing #root");FN.createRoot(_A).render(v.jsx(x.StrictMode,{children:v.jsx(h4,{children:v.jsx(EU,{children:v.jsx(TX,{})})})}));
|