@citadel-labs/beads-ui 2.0.5 → 2.1.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/.claude/skills/beads-board-start/SKILL.md +34 -0
- package/.claude/skills/beads-board-stop/SKILL.md +38 -0
- package/package.json +20 -2
- package/server/dist/assets/index-BNjM8bEC.css +1 -0
- package/server/dist/assets/index-BU8XOdEX.js +75 -0
- package/server/dist/favicon.svg +103 -0
- package/server/dist/index.html +5 -5
- package/server/index.js +51 -4
- package/server/terminal.js +103 -0
- package/server/dist/assets/index-BzxBsA4M.css +0 -1
- package/server/dist/assets/index-CKSk2-yh.js +0 -57
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
function iR(e,t){for(var s=0;s<t.length;s++){const r=t[s];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const l=Object.getOwnPropertyDescriptor(r,o);l&&Object.defineProperty(e,o,l.get?l:{enumerable:!0,get:()=>r[o]})}}}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 o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function s(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(o){if(o.ep)return;o.ep=!0;const l=s(o);fetch(o.href,l)}})();function Ax(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Yf={exports:{}},za={};var pb;function sR(){if(pb)return za;pb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function s(r,o,l){var c=null;if(l!==void 0&&(c=""+l),o.key!==void 0&&(c=""+o.key),"key"in o){l={};for(var h in o)h!=="key"&&(l[h]=o[h])}else l=o;return o=l.ref,{$$typeof:e,type:r,key:c,ref:o!==void 0?o:null,props:l}}return za.Fragment=t,za.jsx=s,za.jsxs=s,za}var gb;function nR(){return gb||(gb=1,Yf.exports=sR()),Yf.exports}var C=nR(),Kf={exports:{}},Ae={};var vb;function rR(){if(vb)return Ae;vb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),c=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),_=Symbol.iterator;function y(N){return N===null||typeof N!="object"?null:(N=_&&N[_]||N["@@iterator"],typeof N=="function"?N:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,E={};function A(N,Z,ne){this.props=N,this.context=Z,this.refs=E,this.updater=ne||b}A.prototype.isReactComponent={},A.prototype.setState=function(N,Z){if(typeof N!="object"&&typeof N!="function"&&N!=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,N,Z,"setState")},A.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function R(){}R.prototype=A.prototype;function M(N,Z,ne){this.props=N,this.context=Z,this.refs=E,this.updater=ne||b}var k=M.prototype=new R;k.constructor=M,S(k,A.prototype),k.isPureReactComponent=!0;var j=Array.isArray;function F(){}var W={H:null,A:null,T:null,S:null},V=Object.prototype.hasOwnProperty;function ee(N,Z,ne){var I=ne.ref;return{$$typeof:e,type:N,key:Z,ref:I!==void 0?I:null,props:ne}}function U(N,Z){return ee(N.type,Z,N.props)}function G(N){return typeof N=="object"&&N!==null&&N.$$typeof===e}function z(N){var Z={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(ne){return Z[ne]})}var L=/\/+/g;function P(N,Z){return typeof N=="object"&&N!==null&&N.key!=null?z(""+N.key):Z.toString(36)}function q(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(F,F):(N.status="pending",N.then(function(Z){N.status==="pending"&&(N.status="fulfilled",N.value=Z)},function(Z){N.status==="pending"&&(N.status="rejected",N.reason=Z)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function T(N,Z,ne,I,O){var Y=typeof N;(Y==="undefined"||Y==="boolean")&&(N=null);var K=!1;if(N===null)K=!0;else switch(Y){case"bigint":case"string":case"number":K=!0;break;case"object":switch(N.$$typeof){case e:case t:K=!0;break;case p:return K=N._init,T(K(N._payload),Z,ne,I,O)}}if(K)return O=O(N),K=I===""?"."+P(N,0):I,j(O)?(ne="",K!=null&&(ne=K.replace(L,"$&/")+"/"),T(O,Z,ne,"",function(ue){return ue})):O!=null&&(G(O)&&(O=U(O,ne+(O.key==null||N&&N.key===O.key?"":(""+O.key).replace(L,"$&/")+"/")+K)),Z.push(O)),1;K=0;var J=I===""?".":I+":";if(j(N))for(var ie=0;ie<N.length;ie++)I=N[ie],Y=J+P(I,ie),K+=T(I,Z,ne,Y,O);else if(ie=y(N),typeof ie=="function")for(N=ie.call(N),ie=0;!(I=N.next()).done;)I=I.value,Y=J+P(I,ie++),K+=T(I,Z,ne,Y,O);else if(Y==="object"){if(typeof N.then=="function")return T(q(N),Z,ne,I,O);throw Z=String(N),Error("Objects are not valid as a React child (found: "+(Z==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":Z)+"). If you meant to render a collection of children, use an array instead.")}return K}function H(N,Z,ne){if(N==null)return N;var I=[],O=0;return T(N,I,"","",function(Y){return Z.call(ne,Y,O++)}),I}function B(N){if(N._status===-1){var Z=N._result;Z=Z(),Z.then(function(ne){(N._status===0||N._status===-1)&&(N._status=1,N._result=ne)},function(ne){(N._status===0||N._status===-1)&&(N._status=2,N._result=ne)}),N._status===-1&&(N._status=0,N._result=Z)}if(N._status===1)return N._result.default;throw N._result}var te=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(Z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},X={map:H,forEach:function(N,Z,ne){H(N,function(){Z.apply(this,arguments)},ne)},count:function(N){var Z=0;return H(N,function(){Z++}),Z},toArray:function(N){return H(N,function(Z){return Z})||[]},only:function(N){if(!G(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return Ae.Activity=v,Ae.Children=X,Ae.Component=A,Ae.Fragment=s,Ae.Profiler=o,Ae.PureComponent=M,Ae.StrictMode=r,Ae.Suspense=f,Ae.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=W,Ae.__COMPILER_RUNTIME={__proto__:null,c:function(N){return W.H.useMemoCache(N)}},Ae.cache=function(N){return function(){return N.apply(null,arguments)}},Ae.cacheSignal=function(){return null},Ae.cloneElement=function(N,Z,ne){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var I=S({},N.props),O=N.key;if(Z!=null)for(Y in Z.key!==void 0&&(O=""+Z.key),Z)!V.call(Z,Y)||Y==="key"||Y==="__self"||Y==="__source"||Y==="ref"&&Z.ref===void 0||(I[Y]=Z[Y]);var Y=arguments.length-2;if(Y===1)I.children=ne;else if(1<Y){for(var K=Array(Y),J=0;J<Y;J++)K[J]=arguments[J+2];I.children=K}return ee(N.type,O,I)},Ae.createContext=function(N){return N={$$typeof:c,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:l,_context:N},N},Ae.createElement=function(N,Z,ne){var I,O={},Y=null;if(Z!=null)for(I in Z.key!==void 0&&(Y=""+Z.key),Z)V.call(Z,I)&&I!=="key"&&I!=="__self"&&I!=="__source"&&(O[I]=Z[I]);var K=arguments.length-2;if(K===1)O.children=ne;else if(1<K){for(var J=Array(K),ie=0;ie<K;ie++)J[ie]=arguments[ie+2];O.children=J}if(N&&N.defaultProps)for(I in K=N.defaultProps,K)O[I]===void 0&&(O[I]=K[I]);return ee(N,Y,O)},Ae.createRef=function(){return{current:null}},Ae.forwardRef=function(N){return{$$typeof:h,render:N}},Ae.isValidElement=G,Ae.lazy=function(N){return{$$typeof:p,_payload:{_status:-1,_result:N},_init:B}},Ae.memo=function(N,Z){return{$$typeof:d,type:N,compare:Z===void 0?null:Z}},Ae.startTransition=function(N){var Z=W.T,ne={};W.T=ne;try{var I=N(),O=W.S;O!==null&&O(ne,I),typeof I=="object"&&I!==null&&typeof I.then=="function"&&I.then(F,te)}catch(Y){te(Y)}finally{Z!==null&&ne.types!==null&&(Z.types=ne.types),W.T=Z}},Ae.unstable_useCacheRefresh=function(){return W.H.useCacheRefresh()},Ae.use=function(N){return W.H.use(N)},Ae.useActionState=function(N,Z,ne){return W.H.useActionState(N,Z,ne)},Ae.useCallback=function(N,Z){return W.H.useCallback(N,Z)},Ae.useContext=function(N){return W.H.useContext(N)},Ae.useDebugValue=function(){},Ae.useDeferredValue=function(N,Z){return W.H.useDeferredValue(N,Z)},Ae.useEffect=function(N,Z){return W.H.useEffect(N,Z)},Ae.useEffectEvent=function(N){return W.H.useEffectEvent(N)},Ae.useId=function(){return W.H.useId()},Ae.useImperativeHandle=function(N,Z,ne){return W.H.useImperativeHandle(N,Z,ne)},Ae.useInsertionEffect=function(N,Z){return W.H.useInsertionEffect(N,Z)},Ae.useLayoutEffect=function(N,Z){return W.H.useLayoutEffect(N,Z)},Ae.useMemo=function(N,Z){return W.H.useMemo(N,Z)},Ae.useOptimistic=function(N,Z){return W.H.useOptimistic(N,Z)},Ae.useReducer=function(N,Z,ne){return W.H.useReducer(N,Z,ne)},Ae.useRef=function(N){return W.H.useRef(N)},Ae.useState=function(N){return W.H.useState(N)},Ae.useSyncExternalStore=function(N,Z,ne){return W.H.useSyncExternalStore(N,Z,ne)},Ae.useTransition=function(){return W.H.useTransition()},Ae.version="19.2.4",Ae}var _b;function lg(){return _b||(_b=1,Kf.exports=rR()),Kf.exports}var x=lg();const Tn=Ax(x),Rx=iR({__proto__:null,default:Tn},[x]);var qf={exports:{}},ja={},Gf={exports:{}},$f={};var yb;function oR(){return yb||(yb=1,(function(e){function t(T,H){var B=T.length;T.push(H);e:for(;0<B;){var te=B-1>>>1,X=T[te];if(0<o(X,H))T[te]=H,T[B]=X,B=te;else break e}}function s(T){return T.length===0?null:T[0]}function r(T){if(T.length===0)return null;var H=T[0],B=T.pop();if(B!==H){T[0]=B;e:for(var te=0,X=T.length,N=X>>>1;te<N;){var Z=2*(te+1)-1,ne=T[Z],I=Z+1,O=T[I];if(0>o(ne,B))I<X&&0>o(O,ne)?(T[te]=O,T[I]=B,te=I):(T[te]=ne,T[Z]=B,te=Z);else if(I<X&&0>o(O,B))T[te]=O,T[I]=B,te=I;else break e}}return H}function o(T,H){var B=T.sortIndex-H.sortIndex;return B!==0?B:T.id-H.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 c=Date,h=c.now();e.unstable_now=function(){return c.now()-h}}var f=[],d=[],p=1,v=null,_=3,y=!1,b=!1,S=!1,E=!1,A=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function k(T){for(var H=s(d);H!==null;){if(H.callback===null)r(d);else if(H.startTime<=T)r(d),H.sortIndex=H.expirationTime,t(f,H);else break;H=s(d)}}function j(T){if(S=!1,k(T),!b)if(s(f)!==null)b=!0,F||(F=!0,z());else{var H=s(d);H!==null&&q(j,H.startTime-T)}}var F=!1,W=-1,V=5,ee=-1;function U(){return E?!0:!(e.unstable_now()-ee<V)}function G(){if(E=!1,F){var T=e.unstable_now();ee=T;var H=!0;try{e:{b=!1,S&&(S=!1,R(W),W=-1),y=!0;var B=_;try{t:{for(k(T),v=s(f);v!==null&&!(v.expirationTime>T&&U());){var te=v.callback;if(typeof te=="function"){v.callback=null,_=v.priorityLevel;var X=te(v.expirationTime<=T);if(T=e.unstable_now(),typeof X=="function"){v.callback=X,k(T),H=!0;break t}v===s(f)&&r(f),k(T)}else r(f);v=s(f)}if(v!==null)H=!0;else{var N=s(d);N!==null&&q(j,N.startTime-T),H=!1}}break e}finally{v=null,_=B,y=!1}H=void 0}}finally{H?z():F=!1}}}var z;if(typeof M=="function")z=function(){M(G)};else if(typeof MessageChannel<"u"){var L=new MessageChannel,P=L.port2;L.port1.onmessage=G,z=function(){P.postMessage(null)}}else z=function(){A(G,0)};function q(T,H){W=A(function(){T(e.unstable_now())},H)}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(T){T.callback=null},e.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):V=0<T?Math.floor(1e3/T):5},e.unstable_getCurrentPriorityLevel=function(){return _},e.unstable_next=function(T){switch(_){case 1:case 2:case 3:var H=3;break;default:H=_}var B=_;_=H;try{return T()}finally{_=B}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(T,H){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var B=_;_=T;try{return H()}finally{_=B}},e.unstable_scheduleCallback=function(T,H,B){var te=e.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?te+B:te):B=te,T){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=B+X,T={id:p++,callback:H,priorityLevel:T,startTime:B,expirationTime:X,sortIndex:-1},B>te?(T.sortIndex=B,t(d,T),s(f)===null&&T===s(d)&&(S?(R(W),W=-1):S=!0,q(j,B-te))):(T.sortIndex=X,t(f,T),b||y||(b=!0,F||(F=!0,z()))),T},e.unstable_shouldYield=U,e.unstable_wrapCallback=function(T){var H=_;return function(){var B=_;_=H;try{return T.apply(this,arguments)}finally{_=B}}}})($f)),$f}var bb;function aR(){return bb||(bb=1,Gf.exports=oR()),Gf.exports}var Xf={exports:{}},qt={};var Sb;function lR(){if(Sb)return qt;Sb=1;var e=lg();function t(f){var d="https://react.dev/errors/"+f;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)d+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+f+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var r={d:{f:s,r:function(){throw Error(t(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},o=Symbol.for("react.portal");function l(f,d,p){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:v==null?null:""+v,children:f,containerInfo:d,implementation:p}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(f,d){if(f==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return qt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,qt.createPortal=function(f,d){var p=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(f,d,null,p)},qt.flushSync=function(f){var d=c.T,p=r.p;try{if(c.T=null,r.p=2,f)return f()}finally{c.T=d,r.p=p,r.d.f()}},qt.preconnect=function(f,d){typeof f=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(f,d))},qt.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},qt.preinit=function(f,d){if(typeof f=="string"&&d&&typeof d.as=="string"){var p=d.as,v=h(p,d.crossOrigin),_=typeof d.integrity=="string"?d.integrity:void 0,y=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;p==="style"?r.d.S(f,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:v,integrity:_,fetchPriority:y}):p==="script"&&r.d.X(f,{crossOrigin:v,integrity:_,fetchPriority:y,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},qt.preinitModule=function(f,d){if(typeof f=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var p=h(d.as,d.crossOrigin);r.d.M(f,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(f)},qt.preload=function(f,d){if(typeof f=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var p=d.as,v=h(p,d.crossOrigin);r.d.L(f,p,{crossOrigin:v,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})}},qt.preloadModule=function(f,d){if(typeof f=="string")if(d){var p=h(d.as,d.crossOrigin);r.d.m(f,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(f)},qt.requestFormReset=function(f){r.d.r(f)},qt.unstable_batchedUpdates=function(f,d){return f(d)},qt.useFormState=function(f,d,p){return c.H.useFormState(f,d,p)},qt.useFormStatus=function(){return c.H.useHostTransitionStatus()},qt.version="19.2.4",qt}var wb;function Mx(){if(wb)return Xf.exports;wb=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(),Xf.exports=lR(),Xf.exports}var xb;function cR(){if(xb)return ja;xb=1;var e=aR(),t=lg(),s=Mx();function r(i){var n="https://react.dev/errors/"+i;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)n+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+i+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function l(i){var n=i,a=i;if(i.alternate)for(;n.return;)n=n.return;else{i=n;do n=i,(n.flags&4098)!==0&&(a=n.return),i=n.return;while(i)}return n.tag===3?a:null}function c(i){if(i.tag===13){var n=i.memoizedState;if(n===null&&(i=i.alternate,i!==null&&(n=i.memoizedState)),n!==null)return n.dehydrated}return null}function h(i){if(i.tag===31){var n=i.memoizedState;if(n===null&&(i=i.alternate,i!==null&&(n=i.memoizedState)),n!==null)return n.dehydrated}return null}function f(i){if(l(i)!==i)throw Error(r(188))}function d(i){var n=i.alternate;if(!n){if(n=l(i),n===null)throw Error(r(188));return n!==i?null:i}for(var a=i,u=n;;){var m=a.return;if(m===null)break;var g=m.alternate;if(g===null){if(u=m.return,u!==null){a=u;continue}break}if(m.child===g.child){for(g=m.child;g;){if(g===a)return f(m),i;if(g===u)return f(m),n;g=g.sibling}throw Error(r(188))}if(a.return!==u.return)a=m,u=g;else{for(var w=!1,D=m.child;D;){if(D===a){w=!0,a=m,u=g;break}if(D===u){w=!0,u=m,a=g;break}D=D.sibling}if(!w){for(D=g.child;D;){if(D===a){w=!0,a=g,u=m;break}if(D===u){w=!0,u=g,a=m;break}D=D.sibling}if(!w)throw Error(r(189))}}if(a.alternate!==u)throw Error(r(190))}if(a.tag!==3)throw Error(r(188));return a.stateNode.current===a?i:n}function p(i){var n=i.tag;if(n===5||n===26||n===27||n===6)return i;for(i=i.child;i!==null;){if(n=p(i),n!==null)return n;i=i.sibling}return null}var v=Object.assign,_=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),M=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),F=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),ee=Symbol.for("react.activity"),U=Symbol.for("react.memo_cache_sentinel"),G=Symbol.iterator;function z(i){return i===null||typeof i!="object"?null:(i=G&&i[G]||i["@@iterator"],typeof i=="function"?i:null)}var L=Symbol.for("react.client.reference");function P(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===L?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case S:return"Fragment";case A:return"Profiler";case E:return"StrictMode";case j:return"Suspense";case F:return"SuspenseList";case ee:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case b:return"Portal";case M:return i.displayName||"Context";case R:return(i._context.displayName||"Context")+".Consumer";case k:var n=i.render;return i=i.displayName,i||(i=n.displayName||n.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case W:return n=i.displayName||null,n!==null?n:P(i.type)||"Memo";case V:n=i._payload,i=i._init;try{return P(i(n))}catch{}}return null}var q=Array.isArray,T=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B={pending:!1,data:null,method:null,action:null},te=[],X=-1;function N(i){return{current:i}}function Z(i){0>X||(i.current=te[X],te[X]=null,X--)}function ne(i,n){X++,te[X]=i.current,i.current=n}var I=N(null),O=N(null),Y=N(null),K=N(null);function J(i,n){switch(ne(Y,n),ne(O,i),ne(I,null),n.nodeType){case 9:case 11:i=(i=n.documentElement)&&(i=i.namespaceURI)?j0(i):0;break;default:if(i=n.tagName,n=n.namespaceURI)n=j0(n),i=H0(n,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}Z(I),ne(I,i)}function ie(){Z(I),Z(O),Z(Y)}function ue(i){i.memoizedState!==null&&ne(K,i);var n=I.current,a=H0(n,i.type);n!==a&&(ne(O,i),ne(I,a))}function me(i){O.current===i&&(Z(I),Z(O)),K.current===i&&(Z(K),Na._currentValue=B)}var _e,xe;function ke(i){if(_e===void 0)try{throw Error()}catch(a){var n=a.stack.trim().match(/\n( *(at )?)/);_e=n&&n[1]||"",xe=-1<a.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+_e+i+xe}var qe=!1;function Xt(i,n){if(!i||qe)return"";qe=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(n){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(le){var ae=le}Reflect.construct(i,[],de)}else{try{de.call()}catch(le){ae=le}i.call(de.prototype)}}else{try{throw Error()}catch(le){ae=le}(de=i())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(le){if(le&&ae&&typeof le.stack=="string")return[le.stack,ae.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=u.DetermineComponentFrameRoot(),w=g[0],D=g[1];if(w&&D){var $=w.split(`
|
|
4
|
+
`),oe=D.split(`
|
|
5
|
+
`);for(m=u=0;u<$.length&&!$[u].includes("DetermineComponentFrameRoot");)u++;for(;m<oe.length&&!oe[m].includes("DetermineComponentFrameRoot");)m++;if(u===$.length||m===oe.length)for(u=$.length-1,m=oe.length-1;1<=u&&0<=m&&$[u]!==oe[m];)m--;for(;1<=u&&0<=m;u--,m--)if($[u]!==oe[m]){if(u!==1||m!==1)do if(u--,m--,0>m||$[u]!==oe[m]){var ce=`
|
|
6
|
+
`+$[u].replace(" at new "," at ");return i.displayName&&ce.includes("<anonymous>")&&(ce=ce.replace("<anonymous>",i.displayName)),ce}while(1<=u&&0<=m);break}}}finally{qe=!1,Error.prepareStackTrace=a}return(a=i?i.displayName||i.name:"")?ke(a):""}function Ri(i,n){switch(i.tag){case 26:case 27:case 5:return ke(i.type);case 16:return ke("Lazy");case 13:return i.child!==n&&n!==null?ke("Suspense Fallback"):ke("Suspense");case 19:return ke("SuspenseList");case 0:case 15:return Xt(i.type,!1);case 11:return Xt(i.type.render,!1);case 1:return Xt(i.type,!0);case 31:return ke("Activity");default:return""}}function Wo(i){try{var n="",a=null;do n+=Ri(i,a),a=i,i=i.return;while(i);return n}catch(u){return`
|
|
7
|
+
Error generating stack: `+u.message+`
|
|
8
|
+
`+u.stack}}var Rh=Object.prototype.hasOwnProperty,Mh=e.unstable_scheduleCallback,Dh=e.unstable_cancelCallback,LT=e.unstable_shouldYield,BT=e.unstable_requestPaint,di=e.unstable_now,PT=e.unstable_getCurrentPriorityLevel,gv=e.unstable_ImmediatePriority,vv=e.unstable_UserBlockingPriority,Dl=e.unstable_NormalPriority,zT=e.unstable_LowPriority,_v=e.unstable_IdlePriority,jT=e.log,HT=e.unstable_setDisableYieldValue,Yo=null,fi=null;function $s(i){if(typeof jT=="function"&&HT(i),fi&&typeof fi.setStrictMode=="function")try{fi.setStrictMode(Yo,i)}catch{}}var mi=Math.clz32?Math.clz32:UT,IT=Math.log,VT=Math.LN2;function UT(i){return i>>>=0,i===0?32:31-(IT(i)/VT|0)|0}var Ol=256,Nl=262144,Ll=4194304;function Fn(i){var n=i&42;if(n!==0)return n;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 Bl(i,n,a){var u=i.pendingLanes;if(u===0)return 0;var m=0,g=i.suspendedLanes,w=i.pingedLanes;i=i.warmLanes;var D=u&134217727;return D!==0?(u=D&~g,u!==0?m=Fn(u):(w&=D,w!==0?m=Fn(w):a||(a=D&~i,a!==0&&(m=Fn(a))))):(D=u&~g,D!==0?m=Fn(D):w!==0?m=Fn(w):a||(a=u&~i,a!==0&&(m=Fn(a)))),m===0?0:n!==0&&n!==m&&(n&g)===0&&(g=m&-m,a=n&-n,g>=a||g===32&&(a&4194048)!==0)?n:m}function Ko(i,n){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&n)===0}function FT(i,n){switch(i){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 yv(){var i=Ll;return Ll<<=1,(Ll&62914560)===0&&(Ll=4194304),i}function Oh(i){for(var n=[],a=0;31>a;a++)n.push(i);return n}function qo(i,n){i.pendingLanes|=n,n!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function WT(i,n,a,u,m,g){var w=i.pendingLanes;i.pendingLanes=a,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=a,i.entangledLanes&=a,i.errorRecoveryDisabledLanes&=a,i.shellSuspendCounter=0;var D=i.entanglements,$=i.expirationTimes,oe=i.hiddenUpdates;for(a=w&~a;0<a;){var ce=31-mi(a),de=1<<ce;D[ce]=0,$[ce]=-1;var ae=oe[ce];if(ae!==null)for(oe[ce]=null,ce=0;ce<ae.length;ce++){var le=ae[ce];le!==null&&(le.lane&=-536870913)}a&=~de}u!==0&&bv(i,u,0),g!==0&&m===0&&i.tag!==0&&(i.suspendedLanes|=g&~(w&~n))}function bv(i,n,a){i.pendingLanes|=n,i.suspendedLanes&=~n;var u=31-mi(n);i.entangledLanes|=n,i.entanglements[u]=i.entanglements[u]|1073741824|a&261930}function Sv(i,n){var a=i.entangledLanes|=n;for(i=i.entanglements;a;){var u=31-mi(a),m=1<<u;m&n|i[u]&n&&(i[u]|=n),a&=~m}}function wv(i,n){var a=n&-n;return a=(a&42)!==0?1:Nh(a),(a&(i.suspendedLanes|n))!==0?0:a}function Nh(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 Lh(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function xv(){var i=H.p;return i!==0?i:(i=window.event,i===void 0?32:lb(i.type))}function Cv(i,n){var a=H.p;try{return H.p=i,n()}finally{H.p=a}}var Xs=Math.random().toString(36).slice(2),jt="__reactFiber$"+Xs,ni="__reactProps$"+Xs,Ar="__reactContainer$"+Xs,Bh="__reactEvents$"+Xs,YT="__reactListeners$"+Xs,KT="__reactHandles$"+Xs,Ev="__reactResources$"+Xs,Go="__reactMarker$"+Xs;function Ph(i){delete i[jt],delete i[ni],delete i[Bh],delete i[YT],delete i[KT]}function Rr(i){var n=i[jt];if(n)return n;for(var a=i.parentNode;a;){if(n=a[Ar]||a[jt]){if(a=n.alternate,n.child!==null||a!==null&&a.child!==null)for(i=K0(i);i!==null;){if(a=i[jt])return a;i=K0(i)}return n}i=a,a=i.parentNode}return null}function Mr(i){if(i=i[jt]||i[Ar]){var n=i.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return i}return null}function $o(i){var n=i.tag;if(n===5||n===26||n===27||n===6)return i.stateNode;throw Error(r(33))}function Dr(i){var n=i[Ev];return n||(n=i[Ev]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Dt(i){i[Go]=!0}var Tv=new Set,kv={};function Wn(i,n){Or(i,n),Or(i+"Capture",n)}function Or(i,n){for(kv[i]=n,i=0;i<n.length;i++)Tv.add(n[i])}var qT=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]*$"),Av={},Rv={};function GT(i){return Rh.call(Rv,i)?!0:Rh.call(Av,i)?!1:qT.test(i)?Rv[i]=!0:(Av[i]=!0,!1)}function Pl(i,n,a){if(GT(n))if(a===null)i.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":i.removeAttribute(n);return;case"boolean":var u=n.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){i.removeAttribute(n);return}}i.setAttribute(n,""+a)}}function zl(i,n,a){if(a===null)i.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(n);return}i.setAttribute(n,""+a)}}function Ss(i,n,a,u){if(u===null)i.removeAttribute(a);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(a);return}i.setAttributeNS(n,a,""+u)}}function Mi(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Mv(i){var n=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function $T(i,n,a){var u=Object.getOwnPropertyDescriptor(i.constructor.prototype,n);if(!i.hasOwnProperty(n)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var m=u.get,g=u.set;return Object.defineProperty(i,n,{configurable:!0,get:function(){return m.call(this)},set:function(w){a=""+w,g.call(this,w)}}),Object.defineProperty(i,n,{enumerable:u.enumerable}),{getValue:function(){return a},setValue:function(w){a=""+w},stopTracking:function(){i._valueTracker=null,delete i[n]}}}}function zh(i){if(!i._valueTracker){var n=Mv(i)?"checked":"value";i._valueTracker=$T(i,n,""+i[n])}}function Dv(i){if(!i)return!1;var n=i._valueTracker;if(!n)return!0;var a=n.getValue(),u="";return i&&(u=Mv(i)?i.checked?"true":"false":i.value),i=u,i!==a?(n.setValue(i),!0):!1}function jl(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 XT=/[\n"\\]/g;function Di(i){return i.replace(XT,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function jh(i,n,a,u,m,g,w,D){i.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?i.type=w:i.removeAttribute("type"),n!=null?w==="number"?(n===0&&i.value===""||i.value!=n)&&(i.value=""+Mi(n)):i.value!==""+Mi(n)&&(i.value=""+Mi(n)):w!=="submit"&&w!=="reset"||i.removeAttribute("value"),n!=null?Hh(i,w,Mi(n)):a!=null?Hh(i,w,Mi(a)):u!=null&&i.removeAttribute("value"),m==null&&g!=null&&(i.defaultChecked=!!g),m!=null&&(i.checked=m&&typeof m!="function"&&typeof m!="symbol"),D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?i.name=""+Mi(D):i.removeAttribute("name")}function Ov(i,n,a,u,m,g,w,D){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(i.type=g),n!=null||a!=null){if(!(g!=="submit"&&g!=="reset"||n!=null)){zh(i);return}a=a!=null?""+Mi(a):"",n=n!=null?""+Mi(n):a,D||n===i.value||(i.value=n),i.defaultValue=n}u=u??m,u=typeof u!="function"&&typeof u!="symbol"&&!!u,i.checked=D?i.checked:!!u,i.defaultChecked=!!u,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(i.name=w),zh(i)}function Hh(i,n,a){n==="number"&&jl(i.ownerDocument)===i||i.defaultValue===""+a||(i.defaultValue=""+a)}function Nr(i,n,a,u){if(i=i.options,n){n={};for(var m=0;m<a.length;m++)n["$"+a[m]]=!0;for(a=0;a<i.length;a++)m=n.hasOwnProperty("$"+i[a].value),i[a].selected!==m&&(i[a].selected=m),m&&u&&(i[a].defaultSelected=!0)}else{for(a=""+Mi(a),n=null,m=0;m<i.length;m++){if(i[m].value===a){i[m].selected=!0,u&&(i[m].defaultSelected=!0);return}n!==null||i[m].disabled||(n=i[m])}n!==null&&(n.selected=!0)}}function Nv(i,n,a){if(n!=null&&(n=""+Mi(n),n!==i.value&&(i.value=n),a==null)){i.defaultValue!==n&&(i.defaultValue=n);return}i.defaultValue=a!=null?""+Mi(a):""}function Lv(i,n,a,u){if(n==null){if(u!=null){if(a!=null)throw Error(r(92));if(q(u)){if(1<u.length)throw Error(r(93));u=u[0]}a=u}a==null&&(a=""),n=a}a=Mi(n),i.defaultValue=a,u=i.textContent,u===a&&u!==""&&u!==null&&(i.value=u),zh(i)}function Lr(i,n){if(n){var a=i.firstChild;if(a&&a===i.lastChild&&a.nodeType===3){a.nodeValue=n;return}}i.textContent=n}var ZT=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 Bv(i,n,a){var u=n.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?u?i.setProperty(n,""):n==="float"?i.cssFloat="":i[n]="":u?i.setProperty(n,a):typeof a!="number"||a===0||ZT.has(n)?n==="float"?i.cssFloat=a:i[n]=(""+a).trim():i[n]=a+"px"}function Pv(i,n,a){if(n!=null&&typeof n!="object")throw Error(r(62));if(i=i.style,a!=null){for(var u in a)!a.hasOwnProperty(u)||n!=null&&n.hasOwnProperty(u)||(u.indexOf("--")===0?i.setProperty(u,""):u==="float"?i.cssFloat="":i[u]="");for(var m in n)u=n[m],n.hasOwnProperty(m)&&a[m]!==u&&Bv(i,m,u)}else for(var g in n)n.hasOwnProperty(g)&&Bv(i,g,n[g])}function Ih(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 QT=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"]]),JT=/^[\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 Hl(i){return JT.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function ws(){}var Vh=null;function Uh(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Br=null,Pr=null;function zv(i){var n=Mr(i);if(n&&(i=n.stateNode)){var a=i[ni]||null;e:switch(i=n.stateNode,n.type){case"input":if(jh(i,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),n=a.name,a.type==="radio"&&n!=null){for(a=i;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Di(""+n)+'"][type="radio"]'),n=0;n<a.length;n++){var u=a[n];if(u!==i&&u.form===i.form){var m=u[ni]||null;if(!m)throw Error(r(90));jh(u,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(n=0;n<a.length;n++)u=a[n],u.form===i.form&&Dv(u)}break e;case"textarea":Nv(i,a.value,a.defaultValue);break e;case"select":n=a.value,n!=null&&Nr(i,!!a.multiple,n,!1)}}}var Fh=!1;function jv(i,n,a){if(Fh)return i(n,a);Fh=!0;try{var u=i(n);return u}finally{if(Fh=!1,(Br!==null||Pr!==null)&&(Tc(),Br&&(n=Br,i=Pr,Pr=Br=null,zv(n),i)))for(n=0;n<i.length;n++)zv(i[n])}}function Xo(i,n){var a=i.stateNode;if(a===null)return null;var u=a[ni]||null;if(u===null)return null;a=u[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(i=i.type,u=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!u;break e;default:i=!1}if(i)return null;if(a&&typeof a!="function")throw Error(r(231,n,typeof a));return a}var xs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Wh=!1;if(xs)try{var Zo={};Object.defineProperty(Zo,"passive",{get:function(){Wh=!0}}),window.addEventListener("test",Zo,Zo),window.removeEventListener("test",Zo,Zo)}catch{Wh=!1}var Zs=null,Yh=null,Il=null;function Hv(){if(Il)return Il;var i,n=Yh,a=n.length,u,m="value"in Zs?Zs.value:Zs.textContent,g=m.length;for(i=0;i<a&&n[i]===m[i];i++);var w=a-i;for(u=1;u<=w&&n[a-u]===m[g-u];u++);return Il=m.slice(i,1<u?1-u:void 0)}function Vl(i){var n=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&n===13&&(i=13)):i=n,i===10&&(i=13),32<=i||i===13?i:0}function Ul(){return!0}function Iv(){return!1}function ri(i){function n(a,u,m,g,w){this._reactName=a,this._targetInst=m,this.type=u,this.nativeEvent=g,this.target=w,this.currentTarget=null;for(var D in i)i.hasOwnProperty(D)&&(a=i[D],this[D]=a?a(g):g[D]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?Ul:Iv,this.isPropagationStopped=Iv,this}return v(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Ul)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Ul)},persist:function(){},isPersistent:Ul}),n}var Yn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fl=ri(Yn),Qo=v({},Yn,{view:0,detail:0}),ek=ri(Qo),Kh,qh,Jo,Wl=v({},Qo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$h,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!==Jo&&(Jo&&i.type==="mousemove"?(Kh=i.screenX-Jo.screenX,qh=i.screenY-Jo.screenY):qh=Kh=0,Jo=i),Kh)},movementY:function(i){return"movementY"in i?i.movementY:qh}}),Vv=ri(Wl),tk=v({},Wl,{dataTransfer:0}),ik=ri(tk),sk=v({},Qo,{relatedTarget:0}),Gh=ri(sk),nk=v({},Yn,{animationName:0,elapsedTime:0,pseudoElement:0}),rk=ri(nk),ok=v({},Yn,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),ak=ri(ok),lk=v({},Yn,{data:0}),Uv=ri(lk),ck={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},uk={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"},hk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function dk(i){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(i):(i=hk[i])?!!n[i]:!1}function $h(){return dk}var fk=v({},Qo,{key:function(i){if(i.key){var n=ck[i.key]||i.key;if(n!=="Unidentified")return n}return i.type==="keypress"?(i=Vl(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?uk[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$h,charCode:function(i){return i.type==="keypress"?Vl(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Vl(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),mk=ri(fk),pk=v({},Wl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Fv=ri(pk),gk=v({},Qo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$h}),vk=ri(gk),_k=v({},Yn,{propertyName:0,elapsedTime:0,pseudoElement:0}),yk=ri(_k),bk=v({},Wl,{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}),Sk=ri(bk),wk=v({},Yn,{newState:0,oldState:0}),xk=ri(wk),Ck=[9,13,27,32],Xh=xs&&"CompositionEvent"in window,ea=null;xs&&"documentMode"in document&&(ea=document.documentMode);var Ek=xs&&"TextEvent"in window&&!ea,Wv=xs&&(!Xh||ea&&8<ea&&11>=ea),Yv=" ",Kv=!1;function qv(i,n){switch(i){case"keyup":return Ck.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Gv(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var zr=!1;function Tk(i,n){switch(i){case"compositionend":return Gv(n);case"keypress":return n.which!==32?null:(Kv=!0,Yv);case"textInput":return i=n.data,i===Yv&&Kv?null:i;default:return null}}function kk(i,n){if(zr)return i==="compositionend"||!Xh&&qv(i,n)?(i=Hv(),Il=Yh=Zs=null,zr=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Wv&&n.locale!=="ko"?null:n.data;default:return null}}var Ak={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 $v(i){var n=i&&i.nodeName&&i.nodeName.toLowerCase();return n==="input"?!!Ak[i.type]:n==="textarea"}function Xv(i,n,a,u){Br?Pr?Pr.push(u):Pr=[u]:Br=u,n=Nc(n,"onChange"),0<n.length&&(a=new Fl("onChange","change",null,a,u),i.push({event:a,listeners:n}))}var ta=null,ia=null;function Rk(i){O0(i,0)}function Yl(i){var n=$o(i);if(Dv(n))return i}function Zv(i,n){if(i==="change")return n}var Qv=!1;if(xs){var Zh;if(xs){var Qh="oninput"in document;if(!Qh){var Jv=document.createElement("div");Jv.setAttribute("oninput","return;"),Qh=typeof Jv.oninput=="function"}Zh=Qh}else Zh=!1;Qv=Zh&&(!document.documentMode||9<document.documentMode)}function e_(){ta&&(ta.detachEvent("onpropertychange",t_),ia=ta=null)}function t_(i){if(i.propertyName==="value"&&Yl(ia)){var n=[];Xv(n,ia,i,Uh(i)),jv(Rk,n)}}function Mk(i,n,a){i==="focusin"?(e_(),ta=n,ia=a,ta.attachEvent("onpropertychange",t_)):i==="focusout"&&e_()}function Dk(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Yl(ia)}function Ok(i,n){if(i==="click")return Yl(n)}function Nk(i,n){if(i==="input"||i==="change")return Yl(n)}function Lk(i,n){return i===n&&(i!==0||1/i===1/n)||i!==i&&n!==n}var pi=typeof Object.is=="function"?Object.is:Lk;function sa(i,n){if(pi(i,n))return!0;if(typeof i!="object"||i===null||typeof n!="object"||n===null)return!1;var a=Object.keys(i),u=Object.keys(n);if(a.length!==u.length)return!1;for(u=0;u<a.length;u++){var m=a[u];if(!Rh.call(n,m)||!pi(i[m],n[m]))return!1}return!0}function i_(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function s_(i,n){var a=i_(i);i=0;for(var u;a;){if(a.nodeType===3){if(u=i+a.textContent.length,i<=n&&u>=n)return{node:a,offset:n-i};i=u}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=i_(a)}}function n_(i,n){return i&&n?i===n?!0:i&&i.nodeType===3?!1:n&&n.nodeType===3?n_(i,n.parentNode):"contains"in i?i.contains(n):i.compareDocumentPosition?!!(i.compareDocumentPosition(n)&16):!1:!1}function r_(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var n=jl(i.document);n instanceof i.HTMLIFrameElement;){try{var a=typeof n.contentWindow.location.href=="string"}catch{a=!1}if(a)i=n.contentWindow;else break;n=jl(i.document)}return n}function Jh(i){var n=i&&i.nodeName&&i.nodeName.toLowerCase();return n&&(n==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||n==="textarea"||i.contentEditable==="true")}var Bk=xs&&"documentMode"in document&&11>=document.documentMode,jr=null,ed=null,na=null,td=!1;function o_(i,n,a){var u=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;td||jr==null||jr!==jl(u)||(u=jr,"selectionStart"in u&&Jh(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),na&&sa(na,u)||(na=u,u=Nc(ed,"onSelect"),0<u.length&&(n=new Fl("onSelect","select",null,n,a),i.push({event:n,listeners:u}),n.target=jr)))}function Kn(i,n){var a={};return a[i.toLowerCase()]=n.toLowerCase(),a["Webkit"+i]="webkit"+n,a["Moz"+i]="moz"+n,a}var Hr={animationend:Kn("Animation","AnimationEnd"),animationiteration:Kn("Animation","AnimationIteration"),animationstart:Kn("Animation","AnimationStart"),transitionrun:Kn("Transition","TransitionRun"),transitionstart:Kn("Transition","TransitionStart"),transitioncancel:Kn("Transition","TransitionCancel"),transitionend:Kn("Transition","TransitionEnd")},id={},a_={};xs&&(a_=document.createElement("div").style,"AnimationEvent"in window||(delete Hr.animationend.animation,delete Hr.animationiteration.animation,delete Hr.animationstart.animation),"TransitionEvent"in window||delete Hr.transitionend.transition);function qn(i){if(id[i])return id[i];if(!Hr[i])return i;var n=Hr[i],a;for(a in n)if(n.hasOwnProperty(a)&&a in a_)return id[i]=n[a];return i}var l_=qn("animationend"),c_=qn("animationiteration"),u_=qn("animationstart"),Pk=qn("transitionrun"),zk=qn("transitionstart"),jk=qn("transitioncancel"),h_=qn("transitionend"),d_=new Map,sd="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(" ");sd.push("scrollEnd");function qi(i,n){d_.set(i,n),Wn(n,[i])}var Kl=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=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(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},Oi=[],Ir=0,nd=0;function ql(){for(var i=Ir,n=nd=Ir=0;n<i;){var a=Oi[n];Oi[n++]=null;var u=Oi[n];Oi[n++]=null;var m=Oi[n];Oi[n++]=null;var g=Oi[n];if(Oi[n++]=null,u!==null&&m!==null){var w=u.pending;w===null?m.next=m:(m.next=w.next,w.next=m),u.pending=m}g!==0&&f_(a,m,g)}}function Gl(i,n,a,u){Oi[Ir++]=i,Oi[Ir++]=n,Oi[Ir++]=a,Oi[Ir++]=u,nd|=u,i.lanes|=u,i=i.alternate,i!==null&&(i.lanes|=u)}function rd(i,n,a,u){return Gl(i,n,a,u),$l(i)}function Gn(i,n){return Gl(i,null,null,n),$l(i)}function f_(i,n,a){i.lanes|=a;var u=i.alternate;u!==null&&(u.lanes|=a);for(var m=!1,g=i.return;g!==null;)g.childLanes|=a,u=g.alternate,u!==null&&(u.childLanes|=a),g.tag===22&&(i=g.stateNode,i===null||i._visibility&1||(m=!0)),i=g,g=g.return;return i.tag===3?(g=i.stateNode,m&&n!==null&&(m=31-mi(a),i=g.hiddenUpdates,u=i[m],u===null?i[m]=[n]:u.push(n),n.lane=a|536870912),g):null}function $l(i){if(50<Ta)throw Ta=0,pf=null,Error(r(185));for(var n=i.return;n!==null;)i=n,n=i.return;return i.tag===3?i.stateNode:null}var Vr={};function Hk(i,n,a,u){this.tag=i,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function gi(i,n,a,u){return new Hk(i,n,a,u)}function od(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Cs(i,n){var a=i.alternate;return a===null?(a=gi(i.tag,n,i.key,i.mode),a.elementType=i.elementType,a.type=i.type,a.stateNode=i.stateNode,a.alternate=i,i.alternate=a):(a.pendingProps=n,a.type=i.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=i.flags&65011712,a.childLanes=i.childLanes,a.lanes=i.lanes,a.child=i.child,a.memoizedProps=i.memoizedProps,a.memoizedState=i.memoizedState,a.updateQueue=i.updateQueue,n=i.dependencies,a.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},a.sibling=i.sibling,a.index=i.index,a.ref=i.ref,a.refCleanup=i.refCleanup,a}function m_(i,n){i.flags&=65011714;var a=i.alternate;return a===null?(i.childLanes=0,i.lanes=n,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=a.childLanes,i.lanes=a.lanes,i.child=a.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=a.memoizedProps,i.memoizedState=a.memoizedState,i.updateQueue=a.updateQueue,i.type=a.type,n=a.dependencies,i.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),i}function Xl(i,n,a,u,m,g){var w=0;if(u=i,typeof i=="function")od(i)&&(w=1);else if(typeof i=="string")w=WA(i,a,I.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case ee:return i=gi(31,a,n,m),i.elementType=ee,i.lanes=g,i;case S:return $n(a.children,m,g,n);case E:w=8,m|=24;break;case A:return i=gi(12,a,n,m|2),i.elementType=A,i.lanes=g,i;case j:return i=gi(13,a,n,m),i.elementType=j,i.lanes=g,i;case F:return i=gi(19,a,n,m),i.elementType=F,i.lanes=g,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case M:w=10;break e;case R:w=9;break e;case k:w=11;break e;case W:w=14;break e;case V:w=16,u=null;break e}w=29,a=Error(r(130,i===null?"null":typeof i,"")),u=null}return n=gi(w,a,n,m),n.elementType=i,n.type=u,n.lanes=g,n}function $n(i,n,a,u){return i=gi(7,i,u,n),i.lanes=a,i}function ad(i,n,a){return i=gi(6,i,null,n),i.lanes=a,i}function p_(i){var n=gi(18,null,null,0);return n.stateNode=i,n}function ld(i,n,a){return n=gi(4,i.children!==null?i.children:[],i.key,n),n.lanes=a,n.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},n}var g_=new WeakMap;function Ni(i,n){if(typeof i=="object"&&i!==null){var a=g_.get(i);return a!==void 0?a:(n={value:i,source:n,stack:Wo(n)},g_.set(i,n),n)}return{value:i,source:n,stack:Wo(n)}}var Ur=[],Fr=0,Zl=null,ra=0,Li=[],Bi=0,Qs=null,ss=1,ns="";function Es(i,n){Ur[Fr++]=ra,Ur[Fr++]=Zl,Zl=i,ra=n}function v_(i,n,a){Li[Bi++]=ss,Li[Bi++]=ns,Li[Bi++]=Qs,Qs=i;var u=ss;i=ns;var m=32-mi(u)-1;u&=~(1<<m),a+=1;var g=32-mi(n)+m;if(30<g){var w=m-m%5;g=(u&(1<<w)-1).toString(32),u>>=w,m-=w,ss=1<<32-mi(n)+m|a<<m|u,ns=g+i}else ss=1<<g|a<<m|u,ns=i}function cd(i){i.return!==null&&(Es(i,1),v_(i,1,0))}function ud(i){for(;i===Zl;)Zl=Ur[--Fr],Ur[Fr]=null,ra=Ur[--Fr],Ur[Fr]=null;for(;i===Qs;)Qs=Li[--Bi],Li[Bi]=null,ns=Li[--Bi],Li[Bi]=null,ss=Li[--Bi],Li[Bi]=null}function __(i,n){Li[Bi++]=ss,Li[Bi++]=ns,Li[Bi++]=Qs,ss=n.id,ns=n.overflow,Qs=i}var Ht=null,tt=null,He=!1,Js=null,Pi=!1,hd=Error(r(519));function en(i){var n=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw oa(Ni(n,i)),hd}function y_(i){var n=i.stateNode,a=i.type,u=i.memoizedProps;switch(n[jt]=i,n[ni]=u,a){case"dialog":Pe("cancel",n),Pe("close",n);break;case"iframe":case"object":case"embed":Pe("load",n);break;case"video":case"audio":for(a=0;a<Aa.length;a++)Pe(Aa[a],n);break;case"source":Pe("error",n);break;case"img":case"image":case"link":Pe("error",n),Pe("load",n);break;case"details":Pe("toggle",n);break;case"input":Pe("invalid",n),Ov(n,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":Pe("invalid",n);break;case"textarea":Pe("invalid",n),Lv(n,u.value,u.defaultValue,u.children)}a=u.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||n.textContent===""+a||u.suppressHydrationWarning===!0||P0(n.textContent,a)?(u.popover!=null&&(Pe("beforetoggle",n),Pe("toggle",n)),u.onScroll!=null&&Pe("scroll",n),u.onScrollEnd!=null&&Pe("scrollend",n),u.onClick!=null&&(n.onclick=ws),n=!0):n=!1,n||en(i,!0)}function b_(i){for(Ht=i.return;Ht;)switch(Ht.tag){case 5:case 31:case 13:Pi=!1;return;case 27:case 3:Pi=!0;return;default:Ht=Ht.return}}function Wr(i){if(i!==Ht)return!1;if(!He)return b_(i),He=!0,!1;var n=i.tag,a;if((a=n!==3&&n!==27)&&((a=n===5)&&(a=i.type,a=!(a!=="form"&&a!=="button")||Mf(i.type,i.memoizedProps)),a=!a),a&&tt&&en(i),b_(i),n===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));tt=Y0(i)}else if(n===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));tt=Y0(i)}else n===27?(n=tt,pn(i.type)?(i=Bf,Bf=null,tt=i):tt=n):tt=Ht?ji(i.stateNode.nextSibling):null;return!0}function Xn(){tt=Ht=null,He=!1}function dd(){var i=Js;return i!==null&&(ci===null?ci=i:ci.push.apply(ci,i),Js=null),i}function oa(i){Js===null?Js=[i]:Js.push(i)}var fd=N(null),Zn=null,Ts=null;function tn(i,n,a){ne(fd,n._currentValue),n._currentValue=a}function ks(i){i._currentValue=fd.current,Z(fd)}function md(i,n,a){for(;i!==null;){var u=i.alternate;if((i.childLanes&n)!==n?(i.childLanes|=n,u!==null&&(u.childLanes|=n)):u!==null&&(u.childLanes&n)!==n&&(u.childLanes|=n),i===a)break;i=i.return}}function pd(i,n,a,u){var m=i.child;for(m!==null&&(m.return=i);m!==null;){var g=m.dependencies;if(g!==null){var w=m.child;g=g.firstContext;e:for(;g!==null;){var D=g;g=m;for(var $=0;$<n.length;$++)if(D.context===n[$]){g.lanes|=a,D=g.alternate,D!==null&&(D.lanes|=a),md(g.return,a,i),u||(w=null);break e}g=D.next}}else if(m.tag===18){if(w=m.return,w===null)throw Error(r(341));w.lanes|=a,g=w.alternate,g!==null&&(g.lanes|=a),md(w,a,i),w=null}else w=m.child;if(w!==null)w.return=m;else for(w=m;w!==null;){if(w===i){w=null;break}if(m=w.sibling,m!==null){m.return=w.return,w=m;break}w=w.return}m=w}}function Yr(i,n,a,u){i=null;for(var m=n,g=!1;m!==null;){if(!g){if((m.flags&524288)!==0)g=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var w=m.alternate;if(w===null)throw Error(r(387));if(w=w.memoizedProps,w!==null){var D=m.type;pi(m.pendingProps.value,w.value)||(i!==null?i.push(D):i=[D])}}else if(m===K.current){if(w=m.alternate,w===null)throw Error(r(387));w.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(i!==null?i.push(Na):i=[Na])}m=m.return}i!==null&&pd(n,i,a,u),n.flags|=262144}function Ql(i){for(i=i.firstContext;i!==null;){if(!pi(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Qn(i){Zn=i,Ts=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function It(i){return S_(Zn,i)}function Jl(i,n){return Zn===null&&Qn(i),S_(i,n)}function S_(i,n){var a=n._currentValue;if(n={context:n,memoizedValue:a,next:null},Ts===null){if(i===null)throw Error(r(308));Ts=n,i.dependencies={lanes:0,firstContext:n},i.flags|=524288}else Ts=Ts.next=n;return a}var Ik=typeof AbortController<"u"?AbortController:function(){var i=[],n=this.signal={aborted:!1,addEventListener:function(a,u){i.push(u)}};this.abort=function(){n.aborted=!0,i.forEach(function(a){return a()})}},Vk=e.unstable_scheduleCallback,Uk=e.unstable_NormalPriority,vt={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function gd(){return{controller:new Ik,data:new Map,refCount:0}}function aa(i){i.refCount--,i.refCount===0&&Vk(Uk,function(){i.controller.abort()})}var la=null,vd=0,Kr=0,qr=null;function Fk(i,n){if(la===null){var a=la=[];vd=0,Kr=Sf(),qr={status:"pending",value:void 0,then:function(u){a.push(u)}}}return vd++,n.then(w_,w_),n}function w_(){if(--vd===0&&la!==null){qr!==null&&(qr.status="fulfilled");var i=la;la=null,Kr=0,qr=null;for(var n=0;n<i.length;n++)(0,i[n])()}}function Wk(i,n){var a=[],u={status:"pending",value:null,reason:null,then:function(m){a.push(m)}};return i.then(function(){u.status="fulfilled",u.value=n;for(var m=0;m<a.length;m++)(0,a[m])(n)},function(m){for(u.status="rejected",u.reason=m,m=0;m<a.length;m++)(0,a[m])(void 0)}),u}var x_=T.S;T.S=function(i,n){o0=di(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&Fk(i,n),x_!==null&&x_(i,n)};var Jn=N(null);function _d(){var i=Jn.current;return i!==null?i:Qe.pooledCache}function ec(i,n){n===null?ne(Jn,Jn.current):ne(Jn,n.pool)}function C_(){var i=_d();return i===null?null:{parent:vt._currentValue,pool:i}}var Gr=Error(r(460)),yd=Error(r(474)),tc=Error(r(542)),ic={then:function(){}};function E_(i){return i=i.status,i==="fulfilled"||i==="rejected"}function T_(i,n,a){switch(a=i[a],a===void 0?i.push(n):a!==n&&(n.then(ws,ws),n=a),n.status){case"fulfilled":return n.value;case"rejected":throw i=n.reason,A_(i),i;default:if(typeof n.status=="string")n.then(ws,ws);else{if(i=Qe,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=n,i.status="pending",i.then(function(u){if(n.status==="pending"){var m=n;m.status="fulfilled",m.value=u}},function(u){if(n.status==="pending"){var m=n;m.status="rejected",m.reason=u}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw i=n.reason,A_(i),i}throw tr=n,Gr}}function er(i){try{var n=i._init;return n(i._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(tr=a,Gr):a}}var tr=null;function k_(){if(tr===null)throw Error(r(459));var i=tr;return tr=null,i}function A_(i){if(i===Gr||i===tc)throw Error(r(483))}var $r=null,ca=0;function sc(i){var n=ca;return ca+=1,$r===null&&($r=[]),T_($r,i,n)}function ua(i,n){n=n.props.ref,i.ref=n!==void 0?n:null}function nc(i,n){throw n.$$typeof===_?Error(r(525)):(i=Object.prototype.toString.call(n),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":i)))}function R_(i){function n(se,Q){if(i){var re=se.deletions;re===null?(se.deletions=[Q],se.flags|=16):re.push(Q)}}function a(se,Q){if(!i)return null;for(;Q!==null;)n(se,Q),Q=Q.sibling;return null}function u(se){for(var Q=new Map;se!==null;)se.key!==null?Q.set(se.key,se):Q.set(se.index,se),se=se.sibling;return Q}function m(se,Q){return se=Cs(se,Q),se.index=0,se.sibling=null,se}function g(se,Q,re){return se.index=re,i?(re=se.alternate,re!==null?(re=re.index,re<Q?(se.flags|=67108866,Q):re):(se.flags|=67108866,Q)):(se.flags|=1048576,Q)}function w(se){return i&&se.alternate===null&&(se.flags|=67108866),se}function D(se,Q,re,he){return Q===null||Q.tag!==6?(Q=ad(re,se.mode,he),Q.return=se,Q):(Q=m(Q,re),Q.return=se,Q)}function $(se,Q,re,he){var Ce=re.type;return Ce===S?ce(se,Q,re.props.children,he,re.key):Q!==null&&(Q.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===V&&er(Ce)===Q.type)?(Q=m(Q,re.props),ua(Q,re),Q.return=se,Q):(Q=Xl(re.type,re.key,re.props,null,se.mode,he),ua(Q,re),Q.return=se,Q)}function oe(se,Q,re,he){return Q===null||Q.tag!==4||Q.stateNode.containerInfo!==re.containerInfo||Q.stateNode.implementation!==re.implementation?(Q=ld(re,se.mode,he),Q.return=se,Q):(Q=m(Q,re.children||[]),Q.return=se,Q)}function ce(se,Q,re,he,Ce){return Q===null||Q.tag!==7?(Q=$n(re,se.mode,he,Ce),Q.return=se,Q):(Q=m(Q,re),Q.return=se,Q)}function de(se,Q,re){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Q=ad(""+Q,se.mode,re),Q.return=se,Q;if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case y:return re=Xl(Q.type,Q.key,Q.props,null,se.mode,re),ua(re,Q),re.return=se,re;case b:return Q=ld(Q,se.mode,re),Q.return=se,Q;case V:return Q=er(Q),de(se,Q,re)}if(q(Q)||z(Q))return Q=$n(Q,se.mode,re,null),Q.return=se,Q;if(typeof Q.then=="function")return de(se,sc(Q),re);if(Q.$$typeof===M)return de(se,Jl(se,Q),re);nc(se,Q)}return null}function ae(se,Q,re,he){var Ce=Q!==null?Q.key:null;if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return Ce!==null?null:D(se,Q,""+re,he);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case y:return re.key===Ce?$(se,Q,re,he):null;case b:return re.key===Ce?oe(se,Q,re,he):null;case V:return re=er(re),ae(se,Q,re,he)}if(q(re)||z(re))return Ce!==null?null:ce(se,Q,re,he,null);if(typeof re.then=="function")return ae(se,Q,sc(re),he);if(re.$$typeof===M)return ae(se,Q,Jl(se,re),he);nc(se,re)}return null}function le(se,Q,re,he,Ce){if(typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint")return se=se.get(re)||null,D(Q,se,""+he,Ce);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case y:return se=se.get(he.key===null?re:he.key)||null,$(Q,se,he,Ce);case b:return se=se.get(he.key===null?re:he.key)||null,oe(Q,se,he,Ce);case V:return he=er(he),le(se,Q,re,he,Ce)}if(q(he)||z(he))return se=se.get(re)||null,ce(Q,se,he,Ce,null);if(typeof he.then=="function")return le(se,Q,re,sc(he),Ce);if(he.$$typeof===M)return le(se,Q,re,Jl(Q,he),Ce);nc(Q,he)}return null}function ve(se,Q,re,he){for(var Ce=null,Ve=null,we=Q,De=Q=0,je=null;we!==null&&De<re.length;De++){we.index>De?(je=we,we=null):je=we.sibling;var Ue=ae(se,we,re[De],he);if(Ue===null){we===null&&(we=je);break}i&&we&&Ue.alternate===null&&n(se,we),Q=g(Ue,Q,De),Ve===null?Ce=Ue:Ve.sibling=Ue,Ve=Ue,we=je}if(De===re.length)return a(se,we),He&&Es(se,De),Ce;if(we===null){for(;De<re.length;De++)we=de(se,re[De],he),we!==null&&(Q=g(we,Q,De),Ve===null?Ce=we:Ve.sibling=we,Ve=we);return He&&Es(se,De),Ce}for(we=u(we);De<re.length;De++)je=le(we,se,De,re[De],he),je!==null&&(i&&je.alternate!==null&&we.delete(je.key===null?De:je.key),Q=g(je,Q,De),Ve===null?Ce=je:Ve.sibling=je,Ve=je);return i&&we.forEach(function(bn){return n(se,bn)}),He&&Es(se,De),Ce}function Ee(se,Q,re,he){if(re==null)throw Error(r(151));for(var Ce=null,Ve=null,we=Q,De=Q=0,je=null,Ue=re.next();we!==null&&!Ue.done;De++,Ue=re.next()){we.index>De?(je=we,we=null):je=we.sibling;var bn=ae(se,we,Ue.value,he);if(bn===null){we===null&&(we=je);break}i&&we&&bn.alternate===null&&n(se,we),Q=g(bn,Q,De),Ve===null?Ce=bn:Ve.sibling=bn,Ve=bn,we=je}if(Ue.done)return a(se,we),He&&Es(se,De),Ce;if(we===null){for(;!Ue.done;De++,Ue=re.next())Ue=de(se,Ue.value,he),Ue!==null&&(Q=g(Ue,Q,De),Ve===null?Ce=Ue:Ve.sibling=Ue,Ve=Ue);return He&&Es(se,De),Ce}for(we=u(we);!Ue.done;De++,Ue=re.next())Ue=le(we,se,De,Ue.value,he),Ue!==null&&(i&&Ue.alternate!==null&&we.delete(Ue.key===null?De:Ue.key),Q=g(Ue,Q,De),Ve===null?Ce=Ue:Ve.sibling=Ue,Ve=Ue);return i&&we.forEach(function(tR){return n(se,tR)}),He&&Es(se,De),Ce}function Xe(se,Q,re,he){if(typeof re=="object"&&re!==null&&re.type===S&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case y:e:{for(var Ce=re.key;Q!==null;){if(Q.key===Ce){if(Ce=re.type,Ce===S){if(Q.tag===7){a(se,Q.sibling),he=m(Q,re.props.children),he.return=se,se=he;break e}}else if(Q.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===V&&er(Ce)===Q.type){a(se,Q.sibling),he=m(Q,re.props),ua(he,re),he.return=se,se=he;break e}a(se,Q);break}else n(se,Q);Q=Q.sibling}re.type===S?(he=$n(re.props.children,se.mode,he,re.key),he.return=se,se=he):(he=Xl(re.type,re.key,re.props,null,se.mode,he),ua(he,re),he.return=se,se=he)}return w(se);case b:e:{for(Ce=re.key;Q!==null;){if(Q.key===Ce)if(Q.tag===4&&Q.stateNode.containerInfo===re.containerInfo&&Q.stateNode.implementation===re.implementation){a(se,Q.sibling),he=m(Q,re.children||[]),he.return=se,se=he;break e}else{a(se,Q);break}else n(se,Q);Q=Q.sibling}he=ld(re,se.mode,he),he.return=se,se=he}return w(se);case V:return re=er(re),Xe(se,Q,re,he)}if(q(re))return ve(se,Q,re,he);if(z(re)){if(Ce=z(re),typeof Ce!="function")throw Error(r(150));return re=Ce.call(re),Ee(se,Q,re,he)}if(typeof re.then=="function")return Xe(se,Q,sc(re),he);if(re.$$typeof===M)return Xe(se,Q,Jl(se,re),he);nc(se,re)}return typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint"?(re=""+re,Q!==null&&Q.tag===6?(a(se,Q.sibling),he=m(Q,re),he.return=se,se=he):(a(se,Q),he=ad(re,se.mode,he),he.return=se,se=he),w(se)):a(se,Q)}return function(se,Q,re,he){try{ca=0;var Ce=Xe(se,Q,re,he);return $r=null,Ce}catch(we){if(we===Gr||we===tc)throw we;var Ve=gi(29,we,null,se.mode);return Ve.lanes=he,Ve.return=se,Ve}}}var ir=R_(!0),M_=R_(!1),sn=!1;function bd(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Sd(i,n){i=i.updateQueue,n.updateQueue===i&&(n.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function nn(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function rn(i,n,a){var u=i.updateQueue;if(u===null)return null;if(u=u.shared,(Fe&2)!==0){var m=u.pending;return m===null?n.next=n:(n.next=m.next,m.next=n),u.pending=n,n=$l(i),f_(i,null,a),n}return Gl(i,u,n,a),$l(i)}function ha(i,n,a){if(n=n.updateQueue,n!==null&&(n=n.shared,(a&4194048)!==0)){var u=n.lanes;u&=i.pendingLanes,a|=u,n.lanes=a,Sv(i,a)}}function wd(i,n){var a=i.updateQueue,u=i.alternate;if(u!==null&&(u=u.updateQueue,a===u)){var m=null,g=null;if(a=a.firstBaseUpdate,a!==null){do{var w={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};g===null?m=g=w:g=g.next=w,a=a.next}while(a!==null);g===null?m=g=n:g=g.next=n}else m=g=n;a={baseState:u.baseState,firstBaseUpdate:m,lastBaseUpdate:g,shared:u.shared,callbacks:u.callbacks},i.updateQueue=a;return}i=a.lastBaseUpdate,i===null?a.firstBaseUpdate=n:i.next=n,a.lastBaseUpdate=n}var xd=!1;function da(){if(xd){var i=qr;if(i!==null)throw i}}function fa(i,n,a,u){xd=!1;var m=i.updateQueue;sn=!1;var g=m.firstBaseUpdate,w=m.lastBaseUpdate,D=m.shared.pending;if(D!==null){m.shared.pending=null;var $=D,oe=$.next;$.next=null,w===null?g=oe:w.next=oe,w=$;var ce=i.alternate;ce!==null&&(ce=ce.updateQueue,D=ce.lastBaseUpdate,D!==w&&(D===null?ce.firstBaseUpdate=oe:D.next=oe,ce.lastBaseUpdate=$))}if(g!==null){var de=m.baseState;w=0,ce=oe=$=null,D=g;do{var ae=D.lane&-536870913,le=ae!==D.lane;if(le?(ze&ae)===ae:(u&ae)===ae){ae!==0&&ae===Kr&&(xd=!0),ce!==null&&(ce=ce.next={lane:0,tag:D.tag,payload:D.payload,callback:null,next:null});e:{var ve=i,Ee=D;ae=n;var Xe=a;switch(Ee.tag){case 1:if(ve=Ee.payload,typeof ve=="function"){de=ve.call(Xe,de,ae);break e}de=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=Ee.payload,ae=typeof ve=="function"?ve.call(Xe,de,ae):ve,ae==null)break e;de=v({},de,ae);break e;case 2:sn=!0}}ae=D.callback,ae!==null&&(i.flags|=64,le&&(i.flags|=8192),le=m.callbacks,le===null?m.callbacks=[ae]:le.push(ae))}else le={lane:ae,tag:D.tag,payload:D.payload,callback:D.callback,next:null},ce===null?(oe=ce=le,$=de):ce=ce.next=le,w|=ae;if(D=D.next,D===null){if(D=m.shared.pending,D===null)break;le=D,D=le.next,le.next=null,m.lastBaseUpdate=le,m.shared.pending=null}}while(!0);ce===null&&($=de),m.baseState=$,m.firstBaseUpdate=oe,m.lastBaseUpdate=ce,g===null&&(m.shared.lanes=0),un|=w,i.lanes=w,i.memoizedState=de}}function D_(i,n){if(typeof i!="function")throw Error(r(191,i));i.call(n)}function O_(i,n){var a=i.callbacks;if(a!==null)for(i.callbacks=null,i=0;i<a.length;i++)D_(a[i],n)}var Xr=N(null),rc=N(0);function N_(i,n){i=Ps,ne(rc,i),ne(Xr,n),Ps=i|n.baseLanes}function Cd(){ne(rc,Ps),ne(Xr,Xr.current)}function Ed(){Ps=rc.current,Z(Xr),Z(rc)}var vi=N(null),zi=null;function on(i){var n=i.alternate;ne(mt,mt.current&1),ne(vi,i),zi===null&&(n===null||Xr.current!==null||n.memoizedState!==null)&&(zi=i)}function Td(i){ne(mt,mt.current),ne(vi,i),zi===null&&(zi=i)}function L_(i){i.tag===22?(ne(mt,mt.current),ne(vi,i),zi===null&&(zi=i)):an()}function an(){ne(mt,mt.current),ne(vi,vi.current)}function _i(i){Z(vi),zi===i&&(zi=null),Z(mt)}var mt=N(0);function oc(i){for(var n=i;n!==null;){if(n.tag===13){var a=n.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Nf(a)||Lf(a)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===i)break;for(;n.sibling===null;){if(n.return===null||n.return===i)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var As=0,Re=null,Ge=null,_t=null,ac=!1,Zr=!1,sr=!1,lc=0,ma=0,Qr=null,Yk=0;function ct(){throw Error(r(321))}function kd(i,n){if(n===null)return!1;for(var a=0;a<n.length&&a<i.length;a++)if(!pi(i[a],n[a]))return!1;return!0}function Ad(i,n,a,u,m,g){return As=g,Re=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,T.H=i===null||i.memoizedState===null?vy:Fd,sr=!1,g=a(u,m),sr=!1,Zr&&(g=P_(n,a,u,m)),B_(i),g}function B_(i){T.H=va;var n=Ge!==null&&Ge.next!==null;if(As=0,_t=Ge=Re=null,ac=!1,ma=0,Qr=null,n)throw Error(r(300));i===null||yt||(i=i.dependencies,i!==null&&Ql(i)&&(yt=!0))}function P_(i,n,a,u){Re=i;var m=0;do{if(Zr&&(Qr=null),ma=0,Zr=!1,25<=m)throw Error(r(301));if(m+=1,_t=Ge=null,i.updateQueue!=null){var g=i.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}T.H=_y,g=n(a,u)}while(Zr);return g}function Kk(){var i=T.H,n=i.useState()[0];return n=typeof n.then=="function"?pa(n):n,i=i.useState()[0],(Ge!==null?Ge.memoizedState:null)!==i&&(Re.flags|=1024),n}function Rd(){var i=lc!==0;return lc=0,i}function Md(i,n,a){n.updateQueue=i.updateQueue,n.flags&=-2053,i.lanes&=~a}function Dd(i){if(ac){for(i=i.memoizedState;i!==null;){var n=i.queue;n!==null&&(n.pending=null),i=i.next}ac=!1}As=0,_t=Ge=Re=null,Zr=!1,ma=lc=0,Qr=null}function Zt(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _t===null?Re.memoizedState=_t=i:_t=_t.next=i,_t}function pt(){if(Ge===null){var i=Re.alternate;i=i!==null?i.memoizedState:null}else i=Ge.next;var n=_t===null?Re.memoizedState:_t.next;if(n!==null)_t=n,Ge=i;else{if(i===null)throw Re.alternate===null?Error(r(467)):Error(r(310));Ge=i,i={memoizedState:Ge.memoizedState,baseState:Ge.baseState,baseQueue:Ge.baseQueue,queue:Ge.queue,next:null},_t===null?Re.memoizedState=_t=i:_t=_t.next=i}return _t}function cc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function pa(i){var n=ma;return ma+=1,Qr===null&&(Qr=[]),i=T_(Qr,i,n),n=Re,(_t===null?n.memoizedState:_t.next)===null&&(n=n.alternate,T.H=n===null||n.memoizedState===null?vy:Fd),i}function uc(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return pa(i);if(i.$$typeof===M)return It(i)}throw Error(r(438,String(i)))}function Od(i){var n=null,a=Re.updateQueue;if(a!==null&&(n=a.memoCache),n==null){var u=Re.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(n={data:u.data.map(function(m){return m.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),a===null&&(a=cc(),Re.updateQueue=a),a.memoCache=n,a=n.data[n.index],a===void 0)for(a=n.data[n.index]=Array(i),u=0;u<i;u++)a[u]=U;return n.index++,a}function Rs(i,n){return typeof n=="function"?n(i):n}function hc(i){var n=pt();return Nd(n,Ge,i)}function Nd(i,n,a){var u=i.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=a;var m=i.baseQueue,g=u.pending;if(g!==null){if(m!==null){var w=m.next;m.next=g.next,g.next=w}n.baseQueue=m=g,u.pending=null}if(g=i.baseState,m===null)i.memoizedState=g;else{n=m.next;var D=w=null,$=null,oe=n,ce=!1;do{var de=oe.lane&-536870913;if(de!==oe.lane?(ze&de)===de:(As&de)===de){var ae=oe.revertLane;if(ae===0)$!==null&&($=$.next={lane:0,revertLane:0,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),de===Kr&&(ce=!0);else if((As&ae)===ae){oe=oe.next,ae===Kr&&(ce=!0);continue}else de={lane:0,revertLane:oe.revertLane,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},$===null?(D=$=de,w=g):$=$.next=de,Re.lanes|=ae,un|=ae;de=oe.action,sr&&a(g,de),g=oe.hasEagerState?oe.eagerState:a(g,de)}else ae={lane:de,revertLane:oe.revertLane,gesture:oe.gesture,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},$===null?(D=$=ae,w=g):$=$.next=ae,Re.lanes|=de,un|=de;oe=oe.next}while(oe!==null&&oe!==n);if($===null?w=g:$.next=D,!pi(g,i.memoizedState)&&(yt=!0,ce&&(a=qr,a!==null)))throw a;i.memoizedState=g,i.baseState=w,i.baseQueue=$,u.lastRenderedState=g}return m===null&&(u.lanes=0),[i.memoizedState,u.dispatch]}function Ld(i){var n=pt(),a=n.queue;if(a===null)throw Error(r(311));a.lastRenderedReducer=i;var u=a.dispatch,m=a.pending,g=n.memoizedState;if(m!==null){a.pending=null;var w=m=m.next;do g=i(g,w.action),w=w.next;while(w!==m);pi(g,n.memoizedState)||(yt=!0),n.memoizedState=g,n.baseQueue===null&&(n.baseState=g),a.lastRenderedState=g}return[g,u]}function z_(i,n,a){var u=Re,m=pt(),g=He;if(g){if(a===void 0)throw Error(r(407));a=a()}else a=n();var w=!pi((Ge||m).memoizedState,a);if(w&&(m.memoizedState=a,yt=!0),m=m.queue,zd(I_.bind(null,u,m,i),[i]),m.getSnapshot!==n||w||_t!==null&&_t.memoizedState.tag&1){if(u.flags|=2048,Jr(9,{destroy:void 0},H_.bind(null,u,m,a,n),null),Qe===null)throw Error(r(349));g||(As&127)!==0||j_(u,n,a)}return a}function j_(i,n,a){i.flags|=16384,i={getSnapshot:n,value:a},n=Re.updateQueue,n===null?(n=cc(),Re.updateQueue=n,n.stores=[i]):(a=n.stores,a===null?n.stores=[i]:a.push(i))}function H_(i,n,a,u){n.value=a,n.getSnapshot=u,V_(n)&&U_(i)}function I_(i,n,a){return a(function(){V_(n)&&U_(i)})}function V_(i){var n=i.getSnapshot;i=i.value;try{var a=n();return!pi(i,a)}catch{return!0}}function U_(i){var n=Gn(i,2);n!==null&&ui(n,i,2)}function Bd(i){var n=Zt();if(typeof i=="function"){var a=i;if(i=a(),sr){$s(!0);try{a()}finally{$s(!1)}}}return n.memoizedState=n.baseState=i,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rs,lastRenderedState:i},n}function F_(i,n,a,u){return i.baseState=a,Nd(i,Ge,typeof u=="function"?u:Rs)}function qk(i,n,a,u,m){if(mc(i))throw Error(r(485));if(i=n.action,i!==null){var g={payload:m,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){g.listeners.push(w)}};T.T!==null?a(!0):g.isTransition=!1,u(g),a=n.pending,a===null?(g.next=n.pending=g,W_(n,g)):(g.next=a.next,n.pending=a.next=g)}}function W_(i,n){var a=n.action,u=n.payload,m=i.state;if(n.isTransition){var g=T.T,w={};T.T=w;try{var D=a(m,u),$=T.S;$!==null&&$(w,D),Y_(i,n,D)}catch(oe){Pd(i,n,oe)}finally{g!==null&&w.types!==null&&(g.types=w.types),T.T=g}}else try{g=a(m,u),Y_(i,n,g)}catch(oe){Pd(i,n,oe)}}function Y_(i,n,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(u){K_(i,n,u)},function(u){return Pd(i,n,u)}):K_(i,n,a)}function K_(i,n,a){n.status="fulfilled",n.value=a,q_(n),i.state=a,n=i.pending,n!==null&&(a=n.next,a===n?i.pending=null:(a=a.next,n.next=a,W_(i,a)))}function Pd(i,n,a){var u=i.pending;if(i.pending=null,u!==null){u=u.next;do n.status="rejected",n.reason=a,q_(n),n=n.next;while(n!==u)}i.action=null}function q_(i){i=i.listeners;for(var n=0;n<i.length;n++)(0,i[n])()}function G_(i,n){return n}function $_(i,n){if(He){var a=Qe.formState;if(a!==null){e:{var u=Re;if(He){if(tt){t:{for(var m=tt,g=Pi;m.nodeType!==8;){if(!g){m=null;break t}if(m=ji(m.nextSibling),m===null){m=null;break t}}g=m.data,m=g==="F!"||g==="F"?m:null}if(m){tt=ji(m.nextSibling),u=m.data==="F!";break e}}en(u)}u=!1}u&&(n=a[0])}}return a=Zt(),a.memoizedState=a.baseState=n,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:G_,lastRenderedState:n},a.queue=u,a=my.bind(null,Re,u),u.dispatch=a,u=Bd(!1),g=Ud.bind(null,Re,!1,u.queue),u=Zt(),m={state:n,dispatch:null,action:i,pending:null},u.queue=m,a=qk.bind(null,Re,m,g,a),m.dispatch=a,u.memoizedState=i,[n,a,!1]}function X_(i){var n=pt();return Z_(n,Ge,i)}function Z_(i,n,a){if(n=Nd(i,n,G_)[0],i=hc(Rs)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var u=pa(n)}catch(w){throw w===Gr?tc:w}else u=n;n=pt();var m=n.queue,g=m.dispatch;return a!==n.memoizedState&&(Re.flags|=2048,Jr(9,{destroy:void 0},Gk.bind(null,m,a),null)),[u,g,i]}function Gk(i,n){i.action=n}function Q_(i){var n=pt(),a=Ge;if(a!==null)return Z_(n,a,i);pt(),n=n.memoizedState,a=pt();var u=a.queue.dispatch;return a.memoizedState=i,[n,u,!1]}function Jr(i,n,a,u){return i={tag:i,create:a,deps:u,inst:n,next:null},n=Re.updateQueue,n===null&&(n=cc(),Re.updateQueue=n),a=n.lastEffect,a===null?n.lastEffect=i.next=i:(u=a.next,a.next=i,i.next=u,n.lastEffect=i),i}function J_(){return pt().memoizedState}function dc(i,n,a,u){var m=Zt();Re.flags|=i,m.memoizedState=Jr(1|n,{destroy:void 0},a,u===void 0?null:u)}function fc(i,n,a,u){var m=pt();u=u===void 0?null:u;var g=m.memoizedState.inst;Ge!==null&&u!==null&&kd(u,Ge.memoizedState.deps)?m.memoizedState=Jr(n,g,a,u):(Re.flags|=i,m.memoizedState=Jr(1|n,g,a,u))}function ey(i,n){dc(8390656,8,i,n)}function zd(i,n){fc(2048,8,i,n)}function $k(i){Re.flags|=4;var n=Re.updateQueue;if(n===null)n=cc(),Re.updateQueue=n,n.events=[i];else{var a=n.events;a===null?n.events=[i]:a.push(i)}}function ty(i){var n=pt().memoizedState;return $k({ref:n,nextImpl:i}),function(){if((Fe&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}function iy(i,n){return fc(4,2,i,n)}function sy(i,n){return fc(4,4,i,n)}function ny(i,n){if(typeof n=="function"){i=i();var a=n(i);return function(){typeof a=="function"?a():n(null)}}if(n!=null)return i=i(),n.current=i,function(){n.current=null}}function ry(i,n,a){a=a!=null?a.concat([i]):null,fc(4,4,ny.bind(null,n,i),a)}function jd(){}function oy(i,n){var a=pt();n=n===void 0?null:n;var u=a.memoizedState;return n!==null&&kd(n,u[1])?u[0]:(a.memoizedState=[i,n],i)}function ay(i,n){var a=pt();n=n===void 0?null:n;var u=a.memoizedState;if(n!==null&&kd(n,u[1]))return u[0];if(u=i(),sr){$s(!0);try{i()}finally{$s(!1)}}return a.memoizedState=[u,n],u}function Hd(i,n,a){return a===void 0||(As&1073741824)!==0&&(ze&261930)===0?i.memoizedState=n:(i.memoizedState=a,i=l0(),Re.lanes|=i,un|=i,a)}function ly(i,n,a,u){return pi(a,n)?a:Xr.current!==null?(i=Hd(i,a,u),pi(i,n)||(yt=!0),i):(As&42)===0||(As&1073741824)!==0&&(ze&261930)===0?(yt=!0,i.memoizedState=a):(i=l0(),Re.lanes|=i,un|=i,n)}function cy(i,n,a,u,m){var g=H.p;H.p=g!==0&&8>g?g:8;var w=T.T,D={};T.T=D,Ud(i,!1,n,a);try{var $=m(),oe=T.S;if(oe!==null&&oe(D,$),$!==null&&typeof $=="object"&&typeof $.then=="function"){var ce=Wk($,u);ga(i,n,ce,Si(i))}else ga(i,n,u,Si(i))}catch(de){ga(i,n,{then:function(){},status:"rejected",reason:de},Si())}finally{H.p=g,w!==null&&D.types!==null&&(w.types=D.types),T.T=w}}function Xk(){}function Id(i,n,a,u){if(i.tag!==5)throw Error(r(476));var m=uy(i).queue;cy(i,m,n,B,a===null?Xk:function(){return hy(i),a(u)})}function uy(i){var n=i.memoizedState;if(n!==null)return n;n={memoizedState:B,baseState:B,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rs,lastRenderedState:B},next:null};var a={};return n.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rs,lastRenderedState:a},next:null},i.memoizedState=n,i=i.alternate,i!==null&&(i.memoizedState=n),n}function hy(i){var n=uy(i);n.next===null&&(n=i.alternate.memoizedState),ga(i,n.next.queue,{},Si())}function Vd(){return It(Na)}function dy(){return pt().memoizedState}function fy(){return pt().memoizedState}function Zk(i){for(var n=i.return;n!==null;){switch(n.tag){case 24:case 3:var a=Si();i=nn(a);var u=rn(n,i,a);u!==null&&(ui(u,n,a),ha(u,n,a)),n={cache:gd()},i.payload=n;return}n=n.return}}function Qk(i,n,a){var u=Si();a={lane:u,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},mc(i)?py(n,a):(a=rd(i,n,a,u),a!==null&&(ui(a,i,u),gy(a,n,u)))}function my(i,n,a){var u=Si();ga(i,n,a,u)}function ga(i,n,a,u){var m={lane:u,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(mc(i))py(n,m);else{var g=i.alternate;if(i.lanes===0&&(g===null||g.lanes===0)&&(g=n.lastRenderedReducer,g!==null))try{var w=n.lastRenderedState,D=g(w,a);if(m.hasEagerState=!0,m.eagerState=D,pi(D,w))return Gl(i,n,m,0),Qe===null&&ql(),!1}catch{}if(a=rd(i,n,m,u),a!==null)return ui(a,i,u),gy(a,n,u),!0}return!1}function Ud(i,n,a,u){if(u={lane:2,revertLane:Sf(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},mc(i)){if(n)throw Error(r(479))}else n=rd(i,a,u,2),n!==null&&ui(n,i,2)}function mc(i){var n=i.alternate;return i===Re||n!==null&&n===Re}function py(i,n){Zr=ac=!0;var a=i.pending;a===null?n.next=n:(n.next=a.next,a.next=n),i.pending=n}function gy(i,n,a){if((a&4194048)!==0){var u=n.lanes;u&=i.pendingLanes,a|=u,n.lanes=a,Sv(i,a)}}var va={readContext:It,use:uc,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};va.useEffectEvent=ct;var vy={readContext:It,use:uc,useCallback:function(i,n){return Zt().memoizedState=[i,n===void 0?null:n],i},useContext:It,useEffect:ey,useImperativeHandle:function(i,n,a){a=a!=null?a.concat([i]):null,dc(4194308,4,ny.bind(null,n,i),a)},useLayoutEffect:function(i,n){return dc(4194308,4,i,n)},useInsertionEffect:function(i,n){dc(4,2,i,n)},useMemo:function(i,n){var a=Zt();n=n===void 0?null:n;var u=i();if(sr){$s(!0);try{i()}finally{$s(!1)}}return a.memoizedState=[u,n],u},useReducer:function(i,n,a){var u=Zt();if(a!==void 0){var m=a(n);if(sr){$s(!0);try{a(n)}finally{$s(!1)}}}else m=n;return u.memoizedState=u.baseState=m,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:m},u.queue=i,i=i.dispatch=Qk.bind(null,Re,i),[u.memoizedState,i]},useRef:function(i){var n=Zt();return i={current:i},n.memoizedState=i},useState:function(i){i=Bd(i);var n=i.queue,a=my.bind(null,Re,n);return n.dispatch=a,[i.memoizedState,a]},useDebugValue:jd,useDeferredValue:function(i,n){var a=Zt();return Hd(a,i,n)},useTransition:function(){var i=Bd(!1);return i=cy.bind(null,Re,i.queue,!0,!1),Zt().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,n,a){var u=Re,m=Zt();if(He){if(a===void 0)throw Error(r(407));a=a()}else{if(a=n(),Qe===null)throw Error(r(349));(ze&127)!==0||j_(u,n,a)}m.memoizedState=a;var g={value:a,getSnapshot:n};return m.queue=g,ey(I_.bind(null,u,g,i),[i]),u.flags|=2048,Jr(9,{destroy:void 0},H_.bind(null,u,g,a,n),null),a},useId:function(){var i=Zt(),n=Qe.identifierPrefix;if(He){var a=ns,u=ss;a=(u&~(1<<32-mi(u)-1)).toString(32)+a,n="_"+n+"R_"+a,a=lc++,0<a&&(n+="H"+a.toString(32)),n+="_"}else a=Yk++,n="_"+n+"r_"+a.toString(32)+"_";return i.memoizedState=n},useHostTransitionStatus:Vd,useFormState:$_,useActionState:$_,useOptimistic:function(i){var n=Zt();n.memoizedState=n.baseState=i;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=a,n=Ud.bind(null,Re,!0,a),a.dispatch=n,[i,n]},useMemoCache:Od,useCacheRefresh:function(){return Zt().memoizedState=Zk.bind(null,Re)},useEffectEvent:function(i){var n=Zt(),a={impl:i};return n.memoizedState=a,function(){if((Fe&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}},Fd={readContext:It,use:uc,useCallback:oy,useContext:It,useEffect:zd,useImperativeHandle:ry,useInsertionEffect:iy,useLayoutEffect:sy,useMemo:ay,useReducer:hc,useRef:J_,useState:function(){return hc(Rs)},useDebugValue:jd,useDeferredValue:function(i,n){var a=pt();return ly(a,Ge.memoizedState,i,n)},useTransition:function(){var i=hc(Rs)[0],n=pt().memoizedState;return[typeof i=="boolean"?i:pa(i),n]},useSyncExternalStore:z_,useId:dy,useHostTransitionStatus:Vd,useFormState:X_,useActionState:X_,useOptimistic:function(i,n){var a=pt();return F_(a,Ge,i,n)},useMemoCache:Od,useCacheRefresh:fy};Fd.useEffectEvent=ty;var _y={readContext:It,use:uc,useCallback:oy,useContext:It,useEffect:zd,useImperativeHandle:ry,useInsertionEffect:iy,useLayoutEffect:sy,useMemo:ay,useReducer:Ld,useRef:J_,useState:function(){return Ld(Rs)},useDebugValue:jd,useDeferredValue:function(i,n){var a=pt();return Ge===null?Hd(a,i,n):ly(a,Ge.memoizedState,i,n)},useTransition:function(){var i=Ld(Rs)[0],n=pt().memoizedState;return[typeof i=="boolean"?i:pa(i),n]},useSyncExternalStore:z_,useId:dy,useHostTransitionStatus:Vd,useFormState:Q_,useActionState:Q_,useOptimistic:function(i,n){var a=pt();return Ge!==null?F_(a,Ge,i,n):(a.baseState=i,[i,a.queue.dispatch])},useMemoCache:Od,useCacheRefresh:fy};_y.useEffectEvent=ty;function Wd(i,n,a,u){n=i.memoizedState,a=a(u,n),a=a==null?n:v({},n,a),i.memoizedState=a,i.lanes===0&&(i.updateQueue.baseState=a)}var Yd={enqueueSetState:function(i,n,a){i=i._reactInternals;var u=Si(),m=nn(u);m.payload=n,a!=null&&(m.callback=a),n=rn(i,m,u),n!==null&&(ui(n,i,u),ha(n,i,u))},enqueueReplaceState:function(i,n,a){i=i._reactInternals;var u=Si(),m=nn(u);m.tag=1,m.payload=n,a!=null&&(m.callback=a),n=rn(i,m,u),n!==null&&(ui(n,i,u),ha(n,i,u))},enqueueForceUpdate:function(i,n){i=i._reactInternals;var a=Si(),u=nn(a);u.tag=2,n!=null&&(u.callback=n),n=rn(i,u,a),n!==null&&(ui(n,i,a),ha(n,i,a))}};function yy(i,n,a,u,m,g,w){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(u,g,w):n.prototype&&n.prototype.isPureReactComponent?!sa(a,u)||!sa(m,g):!0}function by(i,n,a,u){i=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(a,u),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(a,u),n.state!==i&&Yd.enqueueReplaceState(n,n.state,null)}function nr(i,n){var a=n;if("ref"in n){a={};for(var u in n)u!=="ref"&&(a[u]=n[u])}if(i=i.defaultProps){a===n&&(a=v({},a));for(var m in i)a[m]===void 0&&(a[m]=i[m])}return a}function Sy(i){Kl(i)}function wy(i){console.error(i)}function xy(i){Kl(i)}function pc(i,n){try{var a=i.onUncaughtError;a(n.value,{componentStack:n.stack})}catch(u){setTimeout(function(){throw u})}}function Cy(i,n,a){try{var u=i.onCaughtError;u(a.value,{componentStack:a.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function Kd(i,n,a){return a=nn(a),a.tag=3,a.payload={element:null},a.callback=function(){pc(i,n)},a}function Ey(i){return i=nn(i),i.tag=3,i}function Ty(i,n,a,u){var m=a.type.getDerivedStateFromError;if(typeof m=="function"){var g=u.value;i.payload=function(){return m(g)},i.callback=function(){Cy(n,a,u)}}var w=a.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(i.callback=function(){Cy(n,a,u),typeof m!="function"&&(hn===null?hn=new Set([this]):hn.add(this));var D=u.stack;this.componentDidCatch(u.value,{componentStack:D!==null?D:""})})}function Jk(i,n,a,u,m){if(a.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(n=a.alternate,n!==null&&Yr(n,a,m,!0),a=vi.current,a!==null){switch(a.tag){case 31:case 13:return zi===null?kc():a.alternate===null&&ut===0&&(ut=3),a.flags&=-257,a.flags|=65536,a.lanes=m,u===ic?a.flags|=16384:(n=a.updateQueue,n===null?a.updateQueue=new Set([u]):n.add(u),_f(i,u,m)),!1;case 22:return a.flags|=65536,u===ic?a.flags|=16384:(n=a.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([u])},a.updateQueue=n):(a=n.retryQueue,a===null?n.retryQueue=new Set([u]):a.add(u)),_f(i,u,m)),!1}throw Error(r(435,a.tag))}return _f(i,u,m),kc(),!1}if(He)return n=vi.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=m,u!==hd&&(i=Error(r(422),{cause:u}),oa(Ni(i,a)))):(u!==hd&&(n=Error(r(423),{cause:u}),oa(Ni(n,a))),i=i.current.alternate,i.flags|=65536,m&=-m,i.lanes|=m,u=Ni(u,a),m=Kd(i.stateNode,u,m),wd(i,m),ut!==4&&(ut=2)),!1;var g=Error(r(520),{cause:u});if(g=Ni(g,a),Ea===null?Ea=[g]:Ea.push(g),ut!==4&&(ut=2),n===null)return!0;u=Ni(u,a),a=n;do{switch(a.tag){case 3:return a.flags|=65536,i=m&-m,a.lanes|=i,i=Kd(a.stateNode,u,i),wd(a,i),!1;case 1:if(n=a.type,g=a.stateNode,(a.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(hn===null||!hn.has(g))))return a.flags|=65536,m&=-m,a.lanes|=m,m=Ey(m),Ty(m,i,a,u),wd(a,m),!1}a=a.return}while(a!==null);return!1}var qd=Error(r(461)),yt=!1;function Vt(i,n,a,u){n.child=i===null?M_(n,null,a,u):ir(n,i.child,a,u)}function ky(i,n,a,u,m){a=a.render;var g=n.ref;if("ref"in u){var w={};for(var D in u)D!=="ref"&&(w[D]=u[D])}else w=u;return Qn(n),u=Ad(i,n,a,w,g,m),D=Rd(),i!==null&&!yt?(Md(i,n,m),Ms(i,n,m)):(He&&D&&cd(n),n.flags|=1,Vt(i,n,u,m),n.child)}function Ay(i,n,a,u,m){if(i===null){var g=a.type;return typeof g=="function"&&!od(g)&&g.defaultProps===void 0&&a.compare===null?(n.tag=15,n.type=g,Ry(i,n,g,u,m)):(i=Xl(a.type,null,u,n,n.mode,m),i.ref=n.ref,i.return=n,n.child=i)}if(g=i.child,!tf(i,m)){var w=g.memoizedProps;if(a=a.compare,a=a!==null?a:sa,a(w,u)&&i.ref===n.ref)return Ms(i,n,m)}return n.flags|=1,i=Cs(g,u),i.ref=n.ref,i.return=n,n.child=i}function Ry(i,n,a,u,m){if(i!==null){var g=i.memoizedProps;if(sa(g,u)&&i.ref===n.ref)if(yt=!1,n.pendingProps=u=g,tf(i,m))(i.flags&131072)!==0&&(yt=!0);else return n.lanes=i.lanes,Ms(i,n,m)}return Gd(i,n,a,u,m)}function My(i,n,a,u){var m=u.children,g=i!==null?i.memoizedState:null;if(i===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((n.flags&128)!==0){if(g=g!==null?g.baseLanes|a:a,i!==null){for(u=n.child=i.child,m=0;u!==null;)m=m|u.lanes|u.childLanes,u=u.sibling;u=m&~g}else u=0,n.child=null;return Dy(i,n,g,a,u)}if((a&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},i!==null&&ec(n,g!==null?g.cachePool:null),g!==null?N_(n,g):Cd(),L_(n);else return u=n.lanes=536870912,Dy(i,n,g!==null?g.baseLanes|a:a,a,u)}else g!==null?(ec(n,g.cachePool),N_(n,g),an(),n.memoizedState=null):(i!==null&&ec(n,null),Cd(),an());return Vt(i,n,m,a),n.child}function _a(i,n){return i!==null&&i.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Dy(i,n,a,u,m){var g=_d();return g=g===null?null:{parent:vt._currentValue,pool:g},n.memoizedState={baseLanes:a,cachePool:g},i!==null&&ec(n,null),Cd(),L_(n),i!==null&&Yr(i,n,u,!0),n.childLanes=m,null}function gc(i,n){return n=_c({mode:n.mode,children:n.children},i.mode),n.ref=i.ref,i.child=n,n.return=i,n}function Oy(i,n,a){return ir(n,i.child,null,a),i=gc(n,n.pendingProps),i.flags|=2,_i(n),n.memoizedState=null,i}function eA(i,n,a){var u=n.pendingProps,m=(n.flags&128)!==0;if(n.flags&=-129,i===null){if(He){if(u.mode==="hidden")return i=gc(n,u),n.lanes=536870912,_a(null,i);if(Td(n),(i=tt)?(i=W0(i,Pi),i=i!==null&&i.data==="&"?i:null,i!==null&&(n.memoizedState={dehydrated:i,treeContext:Qs!==null?{id:ss,overflow:ns}:null,retryLane:536870912,hydrationErrors:null},a=p_(i),a.return=n,n.child=a,Ht=n,tt=null)):i=null,i===null)throw en(n);return n.lanes=536870912,null}return gc(n,u)}var g=i.memoizedState;if(g!==null){var w=g.dehydrated;if(Td(n),m)if(n.flags&256)n.flags&=-257,n=Oy(i,n,a);else if(n.memoizedState!==null)n.child=i.child,n.flags|=128,n=null;else throw Error(r(558));else if(yt||Yr(i,n,a,!1),m=(a&i.childLanes)!==0,yt||m){if(u=Qe,u!==null&&(w=wv(u,a),w!==0&&w!==g.retryLane))throw g.retryLane=w,Gn(i,w),ui(u,i,w),qd;kc(),n=Oy(i,n,a)}else i=g.treeContext,tt=ji(w.nextSibling),Ht=n,He=!0,Js=null,Pi=!1,i!==null&&__(n,i),n=gc(n,u),n.flags|=4096;return n}return i=Cs(i.child,{mode:u.mode,children:u.children}),i.ref=n.ref,n.child=i,i.return=n,i}function vc(i,n){var a=n.ref;if(a===null)i!==null&&i.ref!==null&&(n.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(r(284));(i===null||i.ref!==a)&&(n.flags|=4194816)}}function Gd(i,n,a,u,m){return Qn(n),a=Ad(i,n,a,u,void 0,m),u=Rd(),i!==null&&!yt?(Md(i,n,m),Ms(i,n,m)):(He&&u&&cd(n),n.flags|=1,Vt(i,n,a,m),n.child)}function Ny(i,n,a,u,m,g){return Qn(n),n.updateQueue=null,a=P_(n,u,a,m),B_(i),u=Rd(),i!==null&&!yt?(Md(i,n,g),Ms(i,n,g)):(He&&u&&cd(n),n.flags|=1,Vt(i,n,a,g),n.child)}function Ly(i,n,a,u,m){if(Qn(n),n.stateNode===null){var g=Vr,w=a.contextType;typeof w=="object"&&w!==null&&(g=It(w)),g=new a(u,g),n.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=Yd,n.stateNode=g,g._reactInternals=n,g=n.stateNode,g.props=u,g.state=n.memoizedState,g.refs={},bd(n),w=a.contextType,g.context=typeof w=="object"&&w!==null?It(w):Vr,g.state=n.memoizedState,w=a.getDerivedStateFromProps,typeof w=="function"&&(Wd(n,a,w,u),g.state=n.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(w=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),w!==g.state&&Yd.enqueueReplaceState(g,g.state,null),fa(n,u,g,m),da(),g.state=n.memoizedState),typeof g.componentDidMount=="function"&&(n.flags|=4194308),u=!0}else if(i===null){g=n.stateNode;var D=n.memoizedProps,$=nr(a,D);g.props=$;var oe=g.context,ce=a.contextType;w=Vr,typeof ce=="object"&&ce!==null&&(w=It(ce));var de=a.getDerivedStateFromProps;ce=typeof de=="function"||typeof g.getSnapshotBeforeUpdate=="function",D=n.pendingProps!==D,ce||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(D||oe!==w)&&by(n,g,u,w),sn=!1;var ae=n.memoizedState;g.state=ae,fa(n,u,g,m),da(),oe=n.memoizedState,D||ae!==oe||sn?(typeof de=="function"&&(Wd(n,a,de,u),oe=n.memoizedState),($=sn||yy(n,a,$,u,ae,oe,w))?(ce||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(n.flags|=4194308)):(typeof g.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=u,n.memoizedState=oe),g.props=u,g.state=oe,g.context=w,u=$):(typeof g.componentDidMount=="function"&&(n.flags|=4194308),u=!1)}else{g=n.stateNode,Sd(i,n),w=n.memoizedProps,ce=nr(a,w),g.props=ce,de=n.pendingProps,ae=g.context,oe=a.contextType,$=Vr,typeof oe=="object"&&oe!==null&&($=It(oe)),D=a.getDerivedStateFromProps,(oe=typeof D=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(w!==de||ae!==$)&&by(n,g,u,$),sn=!1,ae=n.memoizedState,g.state=ae,fa(n,u,g,m),da();var le=n.memoizedState;w!==de||ae!==le||sn||i!==null&&i.dependencies!==null&&Ql(i.dependencies)?(typeof D=="function"&&(Wd(n,a,D,u),le=n.memoizedState),(ce=sn||yy(n,a,ce,u,ae,le,$)||i!==null&&i.dependencies!==null&&Ql(i.dependencies))?(oe||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(u,le,$),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(u,le,$)),typeof g.componentDidUpdate=="function"&&(n.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof g.componentDidUpdate!="function"||w===i.memoizedProps&&ae===i.memoizedState||(n.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||w===i.memoizedProps&&ae===i.memoizedState||(n.flags|=1024),n.memoizedProps=u,n.memoizedState=le),g.props=u,g.state=le,g.context=$,u=ce):(typeof g.componentDidUpdate!="function"||w===i.memoizedProps&&ae===i.memoizedState||(n.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||w===i.memoizedProps&&ae===i.memoizedState||(n.flags|=1024),u=!1)}return g=u,vc(i,n),u=(n.flags&128)!==0,g||u?(g=n.stateNode,a=u&&typeof a.getDerivedStateFromError!="function"?null:g.render(),n.flags|=1,i!==null&&u?(n.child=ir(n,i.child,null,m),n.child=ir(n,null,a,m)):Vt(i,n,a,m),n.memoizedState=g.state,i=n.child):i=Ms(i,n,m),i}function By(i,n,a,u){return Xn(),n.flags|=256,Vt(i,n,a,u),n.child}var $d={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Xd(i){return{baseLanes:i,cachePool:C_()}}function Zd(i,n,a){return i=i!==null?i.childLanes&~a:0,n&&(i|=bi),i}function Py(i,n,a){var u=n.pendingProps,m=!1,g=(n.flags&128)!==0,w;if((w=g)||(w=i!==null&&i.memoizedState===null?!1:(mt.current&2)!==0),w&&(m=!0,n.flags&=-129),w=(n.flags&32)!==0,n.flags&=-33,i===null){if(He){if(m?on(n):an(),(i=tt)?(i=W0(i,Pi),i=i!==null&&i.data!=="&"?i:null,i!==null&&(n.memoizedState={dehydrated:i,treeContext:Qs!==null?{id:ss,overflow:ns}:null,retryLane:536870912,hydrationErrors:null},a=p_(i),a.return=n,n.child=a,Ht=n,tt=null)):i=null,i===null)throw en(n);return Lf(i)?n.lanes=32:n.lanes=536870912,null}var D=u.children;return u=u.fallback,m?(an(),m=n.mode,D=_c({mode:"hidden",children:D},m),u=$n(u,m,a,null),D.return=n,u.return=n,D.sibling=u,n.child=D,u=n.child,u.memoizedState=Xd(a),u.childLanes=Zd(i,w,a),n.memoizedState=$d,_a(null,u)):(on(n),Qd(n,D))}var $=i.memoizedState;if($!==null&&(D=$.dehydrated,D!==null)){if(g)n.flags&256?(on(n),n.flags&=-257,n=Jd(i,n,a)):n.memoizedState!==null?(an(),n.child=i.child,n.flags|=128,n=null):(an(),D=u.fallback,m=n.mode,u=_c({mode:"visible",children:u.children},m),D=$n(D,m,a,null),D.flags|=2,u.return=n,D.return=n,u.sibling=D,n.child=u,ir(n,i.child,null,a),u=n.child,u.memoizedState=Xd(a),u.childLanes=Zd(i,w,a),n.memoizedState=$d,n=_a(null,u));else if(on(n),Lf(D)){if(w=D.nextSibling&&D.nextSibling.dataset,w)var oe=w.dgst;w=oe,u=Error(r(419)),u.stack="",u.digest=w,oa({value:u,source:null,stack:null}),n=Jd(i,n,a)}else if(yt||Yr(i,n,a,!1),w=(a&i.childLanes)!==0,yt||w){if(w=Qe,w!==null&&(u=wv(w,a),u!==0&&u!==$.retryLane))throw $.retryLane=u,Gn(i,u),ui(w,i,u),qd;Nf(D)||kc(),n=Jd(i,n,a)}else Nf(D)?(n.flags|=192,n.child=i.child,n=null):(i=$.treeContext,tt=ji(D.nextSibling),Ht=n,He=!0,Js=null,Pi=!1,i!==null&&__(n,i),n=Qd(n,u.children),n.flags|=4096);return n}return m?(an(),D=u.fallback,m=n.mode,$=i.child,oe=$.sibling,u=Cs($,{mode:"hidden",children:u.children}),u.subtreeFlags=$.subtreeFlags&65011712,oe!==null?D=Cs(oe,D):(D=$n(D,m,a,null),D.flags|=2),D.return=n,u.return=n,u.sibling=D,n.child=u,_a(null,u),u=n.child,D=i.child.memoizedState,D===null?D=Xd(a):(m=D.cachePool,m!==null?($=vt._currentValue,m=m.parent!==$?{parent:$,pool:$}:m):m=C_(),D={baseLanes:D.baseLanes|a,cachePool:m}),u.memoizedState=D,u.childLanes=Zd(i,w,a),n.memoizedState=$d,_a(i.child,u)):(on(n),a=i.child,i=a.sibling,a=Cs(a,{mode:"visible",children:u.children}),a.return=n,a.sibling=null,i!==null&&(w=n.deletions,w===null?(n.deletions=[i],n.flags|=16):w.push(i)),n.child=a,n.memoizedState=null,a)}function Qd(i,n){return n=_c({mode:"visible",children:n},i.mode),n.return=i,i.child=n}function _c(i,n){return i=gi(22,i,null,n),i.lanes=0,i}function Jd(i,n,a){return ir(n,i.child,null,a),i=Qd(n,n.pendingProps.children),i.flags|=2,n.memoizedState=null,i}function zy(i,n,a){i.lanes|=n;var u=i.alternate;u!==null&&(u.lanes|=n),md(i.return,n,a)}function ef(i,n,a,u,m,g){var w=i.memoizedState;w===null?i.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:u,tail:a,tailMode:m,treeForkCount:g}:(w.isBackwards=n,w.rendering=null,w.renderingStartTime=0,w.last=u,w.tail=a,w.tailMode=m,w.treeForkCount=g)}function jy(i,n,a){var u=n.pendingProps,m=u.revealOrder,g=u.tail;u=u.children;var w=mt.current,D=(w&2)!==0;if(D?(w=w&1|2,n.flags|=128):w&=1,ne(mt,w),Vt(i,n,u,a),u=He?ra:0,!D&&i!==null&&(i.flags&128)!==0)e:for(i=n.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&zy(i,a,n);else if(i.tag===19)zy(i,a,n);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break e;for(;i.sibling===null;){if(i.return===null||i.return===n)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(m){case"forwards":for(a=n.child,m=null;a!==null;)i=a.alternate,i!==null&&oc(i)===null&&(m=a),a=a.sibling;a=m,a===null?(m=n.child,n.child=null):(m=a.sibling,a.sibling=null),ef(n,!1,m,a,g,u);break;case"backwards":case"unstable_legacy-backwards":for(a=null,m=n.child,n.child=null;m!==null;){if(i=m.alternate,i!==null&&oc(i)===null){n.child=m;break}i=m.sibling,m.sibling=a,a=m,m=i}ef(n,!0,a,null,g,u);break;case"together":ef(n,!1,null,null,void 0,u);break;default:n.memoizedState=null}return n.child}function Ms(i,n,a){if(i!==null&&(n.dependencies=i.dependencies),un|=n.lanes,(a&n.childLanes)===0)if(i!==null){if(Yr(i,n,a,!1),(a&n.childLanes)===0)return null}else return null;if(i!==null&&n.child!==i.child)throw Error(r(153));if(n.child!==null){for(i=n.child,a=Cs(i,i.pendingProps),n.child=a,a.return=n;i.sibling!==null;)i=i.sibling,a=a.sibling=Cs(i,i.pendingProps),a.return=n;a.sibling=null}return n.child}function tf(i,n){return(i.lanes&n)!==0?!0:(i=i.dependencies,!!(i!==null&&Ql(i)))}function tA(i,n,a){switch(n.tag){case 3:J(n,n.stateNode.containerInfo),tn(n,vt,i.memoizedState.cache),Xn();break;case 27:case 5:ue(n);break;case 4:J(n,n.stateNode.containerInfo);break;case 10:tn(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Td(n),null;break;case 13:var u=n.memoizedState;if(u!==null)return u.dehydrated!==null?(on(n),n.flags|=128,null):(a&n.child.childLanes)!==0?Py(i,n,a):(on(n),i=Ms(i,n,a),i!==null?i.sibling:null);on(n);break;case 19:var m=(i.flags&128)!==0;if(u=(a&n.childLanes)!==0,u||(Yr(i,n,a,!1),u=(a&n.childLanes)!==0),m){if(u)return jy(i,n,a);n.flags|=128}if(m=n.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),ne(mt,mt.current),u)break;return null;case 22:return n.lanes=0,My(i,n,a,n.pendingProps);case 24:tn(n,vt,i.memoizedState.cache)}return Ms(i,n,a)}function Hy(i,n,a){if(i!==null)if(i.memoizedProps!==n.pendingProps)yt=!0;else{if(!tf(i,a)&&(n.flags&128)===0)return yt=!1,tA(i,n,a);yt=(i.flags&131072)!==0}else yt=!1,He&&(n.flags&1048576)!==0&&v_(n,ra,n.index);switch(n.lanes=0,n.tag){case 16:e:{var u=n.pendingProps;if(i=er(n.elementType),n.type=i,typeof i=="function")od(i)?(u=nr(i,u),n.tag=1,n=Ly(null,n,i,u,a)):(n.tag=0,n=Gd(null,n,i,u,a));else{if(i!=null){var m=i.$$typeof;if(m===k){n.tag=11,n=ky(null,n,i,u,a);break e}else if(m===W){n.tag=14,n=Ay(null,n,i,u,a);break e}}throw n=P(i)||i,Error(r(306,n,""))}}return n;case 0:return Gd(i,n,n.type,n.pendingProps,a);case 1:return u=n.type,m=nr(u,n.pendingProps),Ly(i,n,u,m,a);case 3:e:{if(J(n,n.stateNode.containerInfo),i===null)throw Error(r(387));u=n.pendingProps;var g=n.memoizedState;m=g.element,Sd(i,n),fa(n,u,null,a);var w=n.memoizedState;if(u=w.cache,tn(n,vt,u),u!==g.cache&&pd(n,[vt],a,!0),da(),u=w.element,g.isDehydrated)if(g={element:u,isDehydrated:!1,cache:w.cache},n.updateQueue.baseState=g,n.memoizedState=g,n.flags&256){n=By(i,n,u,a);break e}else if(u!==m){m=Ni(Error(r(424)),n),oa(m),n=By(i,n,u,a);break e}else for(i=n.stateNode.containerInfo,i.nodeType===9?i=i.body:i=i.nodeName==="HTML"?i.ownerDocument.body:i,tt=ji(i.firstChild),Ht=n,He=!0,Js=null,Pi=!0,a=M_(n,null,u,a),n.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Xn(),u===m){n=Ms(i,n,a);break e}Vt(i,n,u,a)}n=n.child}return n;case 26:return vc(i,n),i===null?(a=X0(n.type,null,n.pendingProps,null))?n.memoizedState=a:He||(a=n.type,i=n.pendingProps,u=Lc(Y.current).createElement(a),u[jt]=n,u[ni]=i,Ut(u,a,i),Dt(u),n.stateNode=u):n.memoizedState=X0(n.type,i.memoizedProps,n.pendingProps,i.memoizedState),null;case 27:return ue(n),i===null&&He&&(u=n.stateNode=q0(n.type,n.pendingProps,Y.current),Ht=n,Pi=!0,m=tt,pn(n.type)?(Bf=m,tt=ji(u.firstChild)):tt=m),Vt(i,n,n.pendingProps.children,a),vc(i,n),i===null&&(n.flags|=4194304),n.child;case 5:return i===null&&He&&((m=u=tt)&&(u=DA(u,n.type,n.pendingProps,Pi),u!==null?(n.stateNode=u,Ht=n,tt=ji(u.firstChild),Pi=!1,m=!0):m=!1),m||en(n)),ue(n),m=n.type,g=n.pendingProps,w=i!==null?i.memoizedProps:null,u=g.children,Mf(m,g)?u=null:w!==null&&Mf(m,w)&&(n.flags|=32),n.memoizedState!==null&&(m=Ad(i,n,Kk,null,null,a),Na._currentValue=m),vc(i,n),Vt(i,n,u,a),n.child;case 6:return i===null&&He&&((i=a=tt)&&(a=OA(a,n.pendingProps,Pi),a!==null?(n.stateNode=a,Ht=n,tt=null,i=!0):i=!1),i||en(n)),null;case 13:return Py(i,n,a);case 4:return J(n,n.stateNode.containerInfo),u=n.pendingProps,i===null?n.child=ir(n,null,u,a):Vt(i,n,u,a),n.child;case 11:return ky(i,n,n.type,n.pendingProps,a);case 7:return Vt(i,n,n.pendingProps,a),n.child;case 8:return Vt(i,n,n.pendingProps.children,a),n.child;case 12:return Vt(i,n,n.pendingProps.children,a),n.child;case 10:return u=n.pendingProps,tn(n,n.type,u.value),Vt(i,n,u.children,a),n.child;case 9:return m=n.type._context,u=n.pendingProps.children,Qn(n),m=It(m),u=u(m),n.flags|=1,Vt(i,n,u,a),n.child;case 14:return Ay(i,n,n.type,n.pendingProps,a);case 15:return Ry(i,n,n.type,n.pendingProps,a);case 19:return jy(i,n,a);case 31:return eA(i,n,a);case 22:return My(i,n,a,n.pendingProps);case 24:return Qn(n),u=It(vt),i===null?(m=_d(),m===null&&(m=Qe,g=gd(),m.pooledCache=g,g.refCount++,g!==null&&(m.pooledCacheLanes|=a),m=g),n.memoizedState={parent:u,cache:m},bd(n),tn(n,vt,m)):((i.lanes&a)!==0&&(Sd(i,n),fa(n,null,null,a),da()),m=i.memoizedState,g=n.memoizedState,m.parent!==u?(m={parent:u,cache:u},n.memoizedState=m,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=m),tn(n,vt,u)):(u=g.cache,tn(n,vt,u),u!==m.cache&&pd(n,[vt],a,!0))),Vt(i,n,n.pendingProps.children,a),n.child;case 29:throw n.pendingProps}throw Error(r(156,n.tag))}function Ds(i){i.flags|=4}function sf(i,n,a,u,m){if((n=(i.mode&32)!==0)&&(n=!1),n){if(i.flags|=16777216,(m&335544128)===m)if(i.stateNode.complete)i.flags|=8192;else if(d0())i.flags|=8192;else throw tr=ic,yd}else i.flags&=-16777217}function Iy(i,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!tb(n))if(d0())i.flags|=8192;else throw tr=ic,yd}function yc(i,n){n!==null&&(i.flags|=4),i.flags&16384&&(n=i.tag!==22?yv():536870912,i.lanes|=n,so|=n)}function ya(i,n){if(!He)switch(i.tailMode){case"hidden":n=i.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?i.tail=null:a.sibling=null;break;case"collapsed":a=i.tail;for(var u=null;a!==null;)a.alternate!==null&&(u=a),a=a.sibling;u===null?n||i.tail===null?i.tail=null:i.tail.sibling=null:u.sibling=null}}function it(i){var n=i.alternate!==null&&i.alternate.child===i.child,a=0,u=0;if(n)for(var m=i.child;m!==null;)a|=m.lanes|m.childLanes,u|=m.subtreeFlags&65011712,u|=m.flags&65011712,m.return=i,m=m.sibling;else for(m=i.child;m!==null;)a|=m.lanes|m.childLanes,u|=m.subtreeFlags,u|=m.flags,m.return=i,m=m.sibling;return i.subtreeFlags|=u,i.childLanes=a,n}function iA(i,n,a){var u=n.pendingProps;switch(ud(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return it(n),null;case 1:return it(n),null;case 3:return a=n.stateNode,u=null,i!==null&&(u=i.memoizedState.cache),n.memoizedState.cache!==u&&(n.flags|=2048),ks(vt),ie(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(i===null||i.child===null)&&(Wr(n)?Ds(n):i===null||i.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,dd())),it(n),null;case 26:var m=n.type,g=n.memoizedState;return i===null?(Ds(n),g!==null?(it(n),Iy(n,g)):(it(n),sf(n,m,null,u,a))):g?g!==i.memoizedState?(Ds(n),it(n),Iy(n,g)):(it(n),n.flags&=-16777217):(i=i.memoizedProps,i!==u&&Ds(n),it(n),sf(n,m,i,u,a)),null;case 27:if(me(n),a=Y.current,m=n.type,i!==null&&n.stateNode!=null)i.memoizedProps!==u&&Ds(n);else{if(!u){if(n.stateNode===null)throw Error(r(166));return it(n),null}i=I.current,Wr(n)?y_(n):(i=q0(m,u,a),n.stateNode=i,Ds(n))}return it(n),null;case 5:if(me(n),m=n.type,i!==null&&n.stateNode!=null)i.memoizedProps!==u&&Ds(n);else{if(!u){if(n.stateNode===null)throw Error(r(166));return it(n),null}if(g=I.current,Wr(n))y_(n);else{var w=Lc(Y.current);switch(g){case 1:g=w.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:g=w.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":g=w.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":g=w.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":g=w.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof u.is=="string"?w.createElement("select",{is:u.is}):w.createElement("select"),u.multiple?g.multiple=!0:u.size&&(g.size=u.size);break;default:g=typeof u.is=="string"?w.createElement(m,{is:u.is}):w.createElement(m)}}g[jt]=n,g[ni]=u;e:for(w=n.child;w!==null;){if(w.tag===5||w.tag===6)g.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===n)break e;for(;w.sibling===null;){if(w.return===null||w.return===n)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}n.stateNode=g;e:switch(Ut(g,m,u),m){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&Ds(n)}}return it(n),sf(n,n.type,i===null?null:i.memoizedProps,n.pendingProps,a),null;case 6:if(i&&n.stateNode!=null)i.memoizedProps!==u&&Ds(n);else{if(typeof u!="string"&&n.stateNode===null)throw Error(r(166));if(i=Y.current,Wr(n)){if(i=n.stateNode,a=n.memoizedProps,u=null,m=Ht,m!==null)switch(m.tag){case 27:case 5:u=m.memoizedProps}i[jt]=n,i=!!(i.nodeValue===a||u!==null&&u.suppressHydrationWarning===!0||P0(i.nodeValue,a)),i||en(n,!0)}else i=Lc(i).createTextNode(u),i[jt]=n,n.stateNode=i}return it(n),null;case 31:if(a=n.memoizedState,i===null||i.memoizedState!==null){if(u=Wr(n),a!==null){if(i===null){if(!u)throw Error(r(318));if(i=n.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[jt]=n}else Xn(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;it(n),i=!1}else a=dd(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=a),i=!0;if(!i)return n.flags&256?(_i(n),n):(_i(n),null);if((n.flags&128)!==0)throw Error(r(558))}return it(n),null;case 13:if(u=n.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(m=Wr(n),u!==null&&u.dehydrated!==null){if(i===null){if(!m)throw Error(r(318));if(m=n.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(r(317));m[jt]=n}else Xn(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;it(n),m=!1}else m=dd(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=m),m=!0;if(!m)return n.flags&256?(_i(n),n):(_i(n),null)}return _i(n),(n.flags&128)!==0?(n.lanes=a,n):(a=u!==null,i=i!==null&&i.memoizedState!==null,a&&(u=n.child,m=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(m=u.alternate.memoizedState.cachePool.pool),g=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(g=u.memoizedState.cachePool.pool),g!==m&&(u.flags|=2048)),a!==i&&a&&(n.child.flags|=8192),yc(n,n.updateQueue),it(n),null);case 4:return ie(),i===null&&Ef(n.stateNode.containerInfo),it(n),null;case 10:return ks(n.type),it(n),null;case 19:if(Z(mt),u=n.memoizedState,u===null)return it(n),null;if(m=(n.flags&128)!==0,g=u.rendering,g===null)if(m)ya(u,!1);else{if(ut!==0||i!==null&&(i.flags&128)!==0)for(i=n.child;i!==null;){if(g=oc(i),g!==null){for(n.flags|=128,ya(u,!1),i=g.updateQueue,n.updateQueue=i,yc(n,i),n.subtreeFlags=0,i=a,a=n.child;a!==null;)m_(a,i),a=a.sibling;return ne(mt,mt.current&1|2),He&&Es(n,u.treeForkCount),n.child}i=i.sibling}u.tail!==null&&di()>Cc&&(n.flags|=128,m=!0,ya(u,!1),n.lanes=4194304)}else{if(!m)if(i=oc(g),i!==null){if(n.flags|=128,m=!0,i=i.updateQueue,n.updateQueue=i,yc(n,i),ya(u,!0),u.tail===null&&u.tailMode==="hidden"&&!g.alternate&&!He)return it(n),null}else 2*di()-u.renderingStartTime>Cc&&a!==536870912&&(n.flags|=128,m=!0,ya(u,!1),n.lanes=4194304);u.isBackwards?(g.sibling=n.child,n.child=g):(i=u.last,i!==null?i.sibling=g:n.child=g,u.last=g)}return u.tail!==null?(i=u.tail,u.rendering=i,u.tail=i.sibling,u.renderingStartTime=di(),i.sibling=null,a=mt.current,ne(mt,m?a&1|2:a&1),He&&Es(n,u.treeForkCount),i):(it(n),null);case 22:case 23:return _i(n),Ed(),u=n.memoizedState!==null,i!==null?i.memoizedState!==null!==u&&(n.flags|=8192):u&&(n.flags|=8192),u?(a&536870912)!==0&&(n.flags&128)===0&&(it(n),n.subtreeFlags&6&&(n.flags|=8192)):it(n),a=n.updateQueue,a!==null&&yc(n,a.retryQueue),a=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),u=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(u=n.memoizedState.cachePool.pool),u!==a&&(n.flags|=2048),i!==null&&Z(Jn),null;case 24:return a=null,i!==null&&(a=i.memoizedState.cache),n.memoizedState.cache!==a&&(n.flags|=2048),ks(vt),it(n),null;case 25:return null;case 30:return null}throw Error(r(156,n.tag))}function sA(i,n){switch(ud(n),n.tag){case 1:return i=n.flags,i&65536?(n.flags=i&-65537|128,n):null;case 3:return ks(vt),ie(),i=n.flags,(i&65536)!==0&&(i&128)===0?(n.flags=i&-65537|128,n):null;case 26:case 27:case 5:return me(n),null;case 31:if(n.memoizedState!==null){if(_i(n),n.alternate===null)throw Error(r(340));Xn()}return i=n.flags,i&65536?(n.flags=i&-65537|128,n):null;case 13:if(_i(n),i=n.memoizedState,i!==null&&i.dehydrated!==null){if(n.alternate===null)throw Error(r(340));Xn()}return i=n.flags,i&65536?(n.flags=i&-65537|128,n):null;case 19:return Z(mt),null;case 4:return ie(),null;case 10:return ks(n.type),null;case 22:case 23:return _i(n),Ed(),i!==null&&Z(Jn),i=n.flags,i&65536?(n.flags=i&-65537|128,n):null;case 24:return ks(vt),null;case 25:return null;default:return null}}function Vy(i,n){switch(ud(n),n.tag){case 3:ks(vt),ie();break;case 26:case 27:case 5:me(n);break;case 4:ie();break;case 31:n.memoizedState!==null&&_i(n);break;case 13:_i(n);break;case 19:Z(mt);break;case 10:ks(n.type);break;case 22:case 23:_i(n),Ed(),i!==null&&Z(Jn);break;case 24:ks(vt)}}function ba(i,n){try{var a=n.updateQueue,u=a!==null?a.lastEffect:null;if(u!==null){var m=u.next;a=m;do{if((a.tag&i)===i){u=void 0;var g=a.create,w=a.inst;u=g(),w.destroy=u}a=a.next}while(a!==m)}}catch(D){Ye(n,n.return,D)}}function ln(i,n,a){try{var u=n.updateQueue,m=u!==null?u.lastEffect:null;if(m!==null){var g=m.next;u=g;do{if((u.tag&i)===i){var w=u.inst,D=w.destroy;if(D!==void 0){w.destroy=void 0,m=n;var $=a,oe=D;try{oe()}catch(ce){Ye(m,$,ce)}}}u=u.next}while(u!==g)}}catch(ce){Ye(n,n.return,ce)}}function Uy(i){var n=i.updateQueue;if(n!==null){var a=i.stateNode;try{O_(n,a)}catch(u){Ye(i,i.return,u)}}}function Fy(i,n,a){a.props=nr(i.type,i.memoizedProps),a.state=i.memoizedState;try{a.componentWillUnmount()}catch(u){Ye(i,n,u)}}function Sa(i,n){try{var a=i.ref;if(a!==null){switch(i.tag){case 26:case 27:case 5:var u=i.stateNode;break;case 30:u=i.stateNode;break;default:u=i.stateNode}typeof a=="function"?i.refCleanup=a(u):a.current=u}}catch(m){Ye(i,n,m)}}function rs(i,n){var a=i.ref,u=i.refCleanup;if(a!==null)if(typeof u=="function")try{u()}catch(m){Ye(i,n,m)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(m){Ye(i,n,m)}else a.current=null}function Wy(i){var n=i.type,a=i.memoizedProps,u=i.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":a.autoFocus&&u.focus();break e;case"img":a.src?u.src=a.src:a.srcSet&&(u.srcset=a.srcSet)}}catch(m){Ye(i,i.return,m)}}function nf(i,n,a){try{var u=i.stateNode;EA(u,i.type,a,n),u[ni]=n}catch(m){Ye(i,i.return,m)}}function Yy(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&pn(i.type)||i.tag===4}function rf(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Yy(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&&pn(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 of(i,n,a){var u=i.tag;if(u===5||u===6)i=i.stateNode,n?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(i,n):(n=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,n.appendChild(i),a=a._reactRootContainer,a!=null||n.onclick!==null||(n.onclick=ws));else if(u!==4&&(u===27&&pn(i.type)&&(a=i.stateNode,n=null),i=i.child,i!==null))for(of(i,n,a),i=i.sibling;i!==null;)of(i,n,a),i=i.sibling}function bc(i,n,a){var u=i.tag;if(u===5||u===6)i=i.stateNode,n?a.insertBefore(i,n):a.appendChild(i);else if(u!==4&&(u===27&&pn(i.type)&&(a=i.stateNode),i=i.child,i!==null))for(bc(i,n,a),i=i.sibling;i!==null;)bc(i,n,a),i=i.sibling}function Ky(i){var n=i.stateNode,a=i.memoizedProps;try{for(var u=i.type,m=n.attributes;m.length;)n.removeAttributeNode(m[0]);Ut(n,u,a),n[jt]=i,n[ni]=a}catch(g){Ye(i,i.return,g)}}var Os=!1,bt=!1,af=!1,qy=typeof WeakSet=="function"?WeakSet:Set,Ot=null;function nA(i,n){if(i=i.containerInfo,Af=Vc,i=r_(i),Jh(i)){if("selectionStart"in i)var a={start:i.selectionStart,end:i.selectionEnd};else e:{a=(a=i.ownerDocument)&&a.defaultView||window;var u=a.getSelection&&a.getSelection();if(u&&u.rangeCount!==0){a=u.anchorNode;var m=u.anchorOffset,g=u.focusNode;u=u.focusOffset;try{a.nodeType,g.nodeType}catch{a=null;break e}var w=0,D=-1,$=-1,oe=0,ce=0,de=i,ae=null;t:for(;;){for(var le;de!==a||m!==0&&de.nodeType!==3||(D=w+m),de!==g||u!==0&&de.nodeType!==3||($=w+u),de.nodeType===3&&(w+=de.nodeValue.length),(le=de.firstChild)!==null;)ae=de,de=le;for(;;){if(de===i)break t;if(ae===a&&++oe===m&&(D=w),ae===g&&++ce===u&&($=w),(le=de.nextSibling)!==null)break;de=ae,ae=de.parentNode}de=le}a=D===-1||$===-1?null:{start:D,end:$}}else a=null}a=a||{start:0,end:0}}else a=null;for(Rf={focusedElem:i,selectionRange:a},Vc=!1,Ot=n;Ot!==null;)if(n=Ot,i=n.child,(n.subtreeFlags&1028)!==0&&i!==null)i.return=n,Ot=i;else for(;Ot!==null;){switch(n=Ot,g=n.alternate,i=n.flags,n.tag){case 0:if((i&4)!==0&&(i=n.updateQueue,i=i!==null?i.events:null,i!==null))for(a=0;a<i.length;a++)m=i[a],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&g!==null){i=void 0,a=n,m=g.memoizedProps,g=g.memoizedState,u=a.stateNode;try{var ve=nr(a.type,m);i=u.getSnapshotBeforeUpdate(ve,g),u.__reactInternalSnapshotBeforeUpdate=i}catch(Ee){Ye(a,a.return,Ee)}}break;case 3:if((i&1024)!==0){if(i=n.stateNode.containerInfo,a=i.nodeType,a===9)Of(i);else if(a===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Of(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=n.sibling,i!==null){i.return=n.return,Ot=i;break}Ot=n.return}}function Gy(i,n,a){var u=a.flags;switch(a.tag){case 0:case 11:case 15:Ls(i,a),u&4&&ba(5,a);break;case 1:if(Ls(i,a),u&4)if(i=a.stateNode,n===null)try{i.componentDidMount()}catch(w){Ye(a,a.return,w)}else{var m=nr(a.type,n.memoizedProps);n=n.memoizedState;try{i.componentDidUpdate(m,n,i.__reactInternalSnapshotBeforeUpdate)}catch(w){Ye(a,a.return,w)}}u&64&&Uy(a),u&512&&Sa(a,a.return);break;case 3:if(Ls(i,a),u&64&&(i=a.updateQueue,i!==null)){if(n=null,a.child!==null)switch(a.child.tag){case 27:case 5:n=a.child.stateNode;break;case 1:n=a.child.stateNode}try{O_(i,n)}catch(w){Ye(a,a.return,w)}}break;case 27:n===null&&u&4&&Ky(a);case 26:case 5:Ls(i,a),n===null&&u&4&&Wy(a),u&512&&Sa(a,a.return);break;case 12:Ls(i,a);break;case 31:Ls(i,a),u&4&&Zy(i,a);break;case 13:Ls(i,a),u&4&&Qy(i,a),u&64&&(i=a.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(a=fA.bind(null,a),NA(i,a))));break;case 22:if(u=a.memoizedState!==null||Os,!u){n=n!==null&&n.memoizedState!==null||bt,m=Os;var g=bt;Os=u,(bt=n)&&!g?Bs(i,a,(a.subtreeFlags&8772)!==0):Ls(i,a),Os=m,bt=g}break;case 30:break;default:Ls(i,a)}}function $y(i){var n=i.alternate;n!==null&&(i.alternate=null,$y(n)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(n=i.stateNode,n!==null&&Ph(n)),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 nt=null,oi=!1;function Ns(i,n,a){for(a=a.child;a!==null;)Xy(i,n,a),a=a.sibling}function Xy(i,n,a){if(fi&&typeof fi.onCommitFiberUnmount=="function")try{fi.onCommitFiberUnmount(Yo,a)}catch{}switch(a.tag){case 26:bt||rs(a,n),Ns(i,n,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:bt||rs(a,n);var u=nt,m=oi;pn(a.type)&&(nt=a.stateNode,oi=!1),Ns(i,n,a),Ma(a.stateNode),nt=u,oi=m;break;case 5:bt||rs(a,n);case 6:if(u=nt,m=oi,nt=null,Ns(i,n,a),nt=u,oi=m,nt!==null)if(oi)try{(nt.nodeType===9?nt.body:nt.nodeName==="HTML"?nt.ownerDocument.body:nt).removeChild(a.stateNode)}catch(g){Ye(a,n,g)}else try{nt.removeChild(a.stateNode)}catch(g){Ye(a,n,g)}break;case 18:nt!==null&&(oi?(i=nt,U0(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,a.stateNode),ho(i)):U0(nt,a.stateNode));break;case 4:u=nt,m=oi,nt=a.stateNode.containerInfo,oi=!0,Ns(i,n,a),nt=u,oi=m;break;case 0:case 11:case 14:case 15:ln(2,a,n),bt||ln(4,a,n),Ns(i,n,a);break;case 1:bt||(rs(a,n),u=a.stateNode,typeof u.componentWillUnmount=="function"&&Fy(a,n,u)),Ns(i,n,a);break;case 21:Ns(i,n,a);break;case 22:bt=(u=bt)||a.memoizedState!==null,Ns(i,n,a),bt=u;break;default:Ns(i,n,a)}}function Zy(i,n){if(n.memoizedState===null&&(i=n.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{ho(i)}catch(a){Ye(n,n.return,a)}}}function Qy(i,n){if(n.memoizedState===null&&(i=n.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{ho(i)}catch(a){Ye(n,n.return,a)}}function rA(i){switch(i.tag){case 31:case 13:case 19:var n=i.stateNode;return n===null&&(n=i.stateNode=new qy),n;case 22:return i=i.stateNode,n=i._retryCache,n===null&&(n=i._retryCache=new qy),n;default:throw Error(r(435,i.tag))}}function Sc(i,n){var a=rA(i);n.forEach(function(u){if(!a.has(u)){a.add(u);var m=mA.bind(null,i,u);u.then(m,m)}})}function ai(i,n){var a=n.deletions;if(a!==null)for(var u=0;u<a.length;u++){var m=a[u],g=i,w=n,D=w;e:for(;D!==null;){switch(D.tag){case 27:if(pn(D.type)){nt=D.stateNode,oi=!1;break e}break;case 5:nt=D.stateNode,oi=!1;break e;case 3:case 4:nt=D.stateNode.containerInfo,oi=!0;break e}D=D.return}if(nt===null)throw Error(r(160));Xy(g,w,m),nt=null,oi=!1,g=m.alternate,g!==null&&(g.return=null),m.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Jy(n,i),n=n.sibling}var Gi=null;function Jy(i,n){var a=i.alternate,u=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:ai(n,i),li(i),u&4&&(ln(3,i,i.return),ba(3,i),ln(5,i,i.return));break;case 1:ai(n,i),li(i),u&512&&(bt||a===null||rs(a,a.return)),u&64&&Os&&(i=i.updateQueue,i!==null&&(u=i.callbacks,u!==null&&(a=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=a===null?u:a.concat(u))));break;case 26:var m=Gi;if(ai(n,i),li(i),u&512&&(bt||a===null||rs(a,a.return)),u&4){var g=a!==null?a.memoizedState:null;if(u=i.memoizedState,a===null)if(u===null)if(i.stateNode===null){e:{u=i.type,a=i.memoizedProps,m=m.ownerDocument||m;t:switch(u){case"title":g=m.getElementsByTagName("title")[0],(!g||g[Go]||g[jt]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=m.createElement(u),m.head.insertBefore(g,m.querySelector("head > title"))),Ut(g,u,a),g[jt]=i,Dt(g),u=g;break e;case"link":var w=J0("link","href",m).get(u+(a.href||""));if(w){for(var D=0;D<w.length;D++)if(g=w[D],g.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&g.getAttribute("rel")===(a.rel==null?null:a.rel)&&g.getAttribute("title")===(a.title==null?null:a.title)&&g.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){w.splice(D,1);break t}}g=m.createElement(u),Ut(g,u,a),m.head.appendChild(g);break;case"meta":if(w=J0("meta","content",m).get(u+(a.content||""))){for(D=0;D<w.length;D++)if(g=w[D],g.getAttribute("content")===(a.content==null?null:""+a.content)&&g.getAttribute("name")===(a.name==null?null:a.name)&&g.getAttribute("property")===(a.property==null?null:a.property)&&g.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&g.getAttribute("charset")===(a.charSet==null?null:a.charSet)){w.splice(D,1);break t}}g=m.createElement(u),Ut(g,u,a),m.head.appendChild(g);break;default:throw Error(r(468,u))}g[jt]=i,Dt(g),u=g}i.stateNode=u}else eb(m,i.type,i.stateNode);else i.stateNode=Q0(m,u,i.memoizedProps);else g!==u?(g===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):g.count--,u===null?eb(m,i.type,i.stateNode):Q0(m,u,i.memoizedProps)):u===null&&i.stateNode!==null&&nf(i,i.memoizedProps,a.memoizedProps)}break;case 27:ai(n,i),li(i),u&512&&(bt||a===null||rs(a,a.return)),a!==null&&u&4&&nf(i,i.memoizedProps,a.memoizedProps);break;case 5:if(ai(n,i),li(i),u&512&&(bt||a===null||rs(a,a.return)),i.flags&32){m=i.stateNode;try{Lr(m,"")}catch(ve){Ye(i,i.return,ve)}}u&4&&i.stateNode!=null&&(m=i.memoizedProps,nf(i,m,a!==null?a.memoizedProps:m)),u&1024&&(af=!0);break;case 6:if(ai(n,i),li(i),u&4){if(i.stateNode===null)throw Error(r(162));u=i.memoizedProps,a=i.stateNode;try{a.nodeValue=u}catch(ve){Ye(i,i.return,ve)}}break;case 3:if(zc=null,m=Gi,Gi=Bc(n.containerInfo),ai(n,i),Gi=m,li(i),u&4&&a!==null&&a.memoizedState.isDehydrated)try{ho(n.containerInfo)}catch(ve){Ye(i,i.return,ve)}af&&(af=!1,e0(i));break;case 4:u=Gi,Gi=Bc(i.stateNode.containerInfo),ai(n,i),li(i),Gi=u;break;case 12:ai(n,i),li(i);break;case 31:ai(n,i),li(i),u&4&&(u=i.updateQueue,u!==null&&(i.updateQueue=null,Sc(i,u)));break;case 13:ai(n,i),li(i),i.child.flags&8192&&i.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(xc=di()),u&4&&(u=i.updateQueue,u!==null&&(i.updateQueue=null,Sc(i,u)));break;case 22:m=i.memoizedState!==null;var $=a!==null&&a.memoizedState!==null,oe=Os,ce=bt;if(Os=oe||m,bt=ce||$,ai(n,i),bt=ce,Os=oe,li(i),u&8192)e:for(n=i.stateNode,n._visibility=m?n._visibility&-2:n._visibility|1,m&&(a===null||$||Os||bt||rr(i)),a=null,n=i;;){if(n.tag===5||n.tag===26){if(a===null){$=a=n;try{if(g=$.stateNode,m)w=g.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{D=$.stateNode;var de=$.memoizedProps.style,ae=de!=null&&de.hasOwnProperty("display")?de.display:null;D.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(ve){Ye($,$.return,ve)}}}else if(n.tag===6){if(a===null){$=n;try{$.stateNode.nodeValue=m?"":$.memoizedProps}catch(ve){Ye($,$.return,ve)}}}else if(n.tag===18){if(a===null){$=n;try{var le=$.stateNode;m?F0(le,!0):F0($.stateNode,!1)}catch(ve){Ye($,$.return,ve)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===i)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===i)break e;for(;n.sibling===null;){if(n.return===null||n.return===i)break e;a===n&&(a=null),n=n.return}a===n&&(a=null),n.sibling.return=n.return,n=n.sibling}u&4&&(u=i.updateQueue,u!==null&&(a=u.retryQueue,a!==null&&(u.retryQueue=null,Sc(i,a))));break;case 19:ai(n,i),li(i),u&4&&(u=i.updateQueue,u!==null&&(i.updateQueue=null,Sc(i,u)));break;case 30:break;case 21:break;default:ai(n,i),li(i)}}function li(i){var n=i.flags;if(n&2){try{for(var a,u=i.return;u!==null;){if(Yy(u)){a=u;break}u=u.return}if(a==null)throw Error(r(160));switch(a.tag){case 27:var m=a.stateNode,g=rf(i);bc(i,g,m);break;case 5:var w=a.stateNode;a.flags&32&&(Lr(w,""),a.flags&=-33);var D=rf(i);bc(i,D,w);break;case 3:case 4:var $=a.stateNode.containerInfo,oe=rf(i);of(i,oe,$);break;default:throw Error(r(161))}}catch(ce){Ye(i,i.return,ce)}i.flags&=-3}n&4096&&(i.flags&=-4097)}function e0(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var n=i;e0(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),i=i.sibling}}function Ls(i,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Gy(i,n.alternate,n),n=n.sibling}function rr(i){for(i=i.child;i!==null;){var n=i;switch(n.tag){case 0:case 11:case 14:case 15:ln(4,n,n.return),rr(n);break;case 1:rs(n,n.return);var a=n.stateNode;typeof a.componentWillUnmount=="function"&&Fy(n,n.return,a),rr(n);break;case 27:Ma(n.stateNode);case 26:case 5:rs(n,n.return),rr(n);break;case 22:n.memoizedState===null&&rr(n);break;case 30:rr(n);break;default:rr(n)}i=i.sibling}}function Bs(i,n,a){for(a=a&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var u=n.alternate,m=i,g=n,w=g.flags;switch(g.tag){case 0:case 11:case 15:Bs(m,g,a),ba(4,g);break;case 1:if(Bs(m,g,a),u=g,m=u.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(oe){Ye(u,u.return,oe)}if(u=g,m=u.updateQueue,m!==null){var D=u.stateNode;try{var $=m.shared.hiddenCallbacks;if($!==null)for(m.shared.hiddenCallbacks=null,m=0;m<$.length;m++)D_($[m],D)}catch(oe){Ye(u,u.return,oe)}}a&&w&64&&Uy(g),Sa(g,g.return);break;case 27:Ky(g);case 26:case 5:Bs(m,g,a),a&&u===null&&w&4&&Wy(g),Sa(g,g.return);break;case 12:Bs(m,g,a);break;case 31:Bs(m,g,a),a&&w&4&&Zy(m,g);break;case 13:Bs(m,g,a),a&&w&4&&Qy(m,g);break;case 22:g.memoizedState===null&&Bs(m,g,a),Sa(g,g.return);break;case 30:break;default:Bs(m,g,a)}n=n.sibling}}function lf(i,n){var a=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),i=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),i!==a&&(i!=null&&i.refCount++,a!=null&&aa(a))}function cf(i,n){i=null,n.alternate!==null&&(i=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==i&&(n.refCount++,i!=null&&aa(i))}function $i(i,n,a,u){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)t0(i,n,a,u),n=n.sibling}function t0(i,n,a,u){var m=n.flags;switch(n.tag){case 0:case 11:case 15:$i(i,n,a,u),m&2048&&ba(9,n);break;case 1:$i(i,n,a,u);break;case 3:$i(i,n,a,u),m&2048&&(i=null,n.alternate!==null&&(i=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==i&&(n.refCount++,i!=null&&aa(i)));break;case 12:if(m&2048){$i(i,n,a,u),i=n.stateNode;try{var g=n.memoizedProps,w=g.id,D=g.onPostCommit;typeof D=="function"&&D(w,n.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch($){Ye(n,n.return,$)}}else $i(i,n,a,u);break;case 31:$i(i,n,a,u);break;case 13:$i(i,n,a,u);break;case 23:break;case 22:g=n.stateNode,w=n.alternate,n.memoizedState!==null?g._visibility&2?$i(i,n,a,u):wa(i,n):g._visibility&2?$i(i,n,a,u):(g._visibility|=2,eo(i,n,a,u,(n.subtreeFlags&10256)!==0||!1)),m&2048&&lf(w,n);break;case 24:$i(i,n,a,u),m&2048&&cf(n.alternate,n);break;default:$i(i,n,a,u)}}function eo(i,n,a,u,m){for(m=m&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var g=i,w=n,D=a,$=u,oe=w.flags;switch(w.tag){case 0:case 11:case 15:eo(g,w,D,$,m),ba(8,w);break;case 23:break;case 22:var ce=w.stateNode;w.memoizedState!==null?ce._visibility&2?eo(g,w,D,$,m):wa(g,w):(ce._visibility|=2,eo(g,w,D,$,m)),m&&oe&2048&&lf(w.alternate,w);break;case 24:eo(g,w,D,$,m),m&&oe&2048&&cf(w.alternate,w);break;default:eo(g,w,D,$,m)}n=n.sibling}}function wa(i,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var a=i,u=n,m=u.flags;switch(u.tag){case 22:wa(a,u),m&2048&&lf(u.alternate,u);break;case 24:wa(a,u),m&2048&&cf(u.alternate,u);break;default:wa(a,u)}n=n.sibling}}var xa=8192;function to(i,n,a){if(i.subtreeFlags&xa)for(i=i.child;i!==null;)i0(i,n,a),i=i.sibling}function i0(i,n,a){switch(i.tag){case 26:to(i,n,a),i.flags&xa&&i.memoizedState!==null&&YA(a,Gi,i.memoizedState,i.memoizedProps);break;case 5:to(i,n,a);break;case 3:case 4:var u=Gi;Gi=Bc(i.stateNode.containerInfo),to(i,n,a),Gi=u;break;case 22:i.memoizedState===null&&(u=i.alternate,u!==null&&u.memoizedState!==null?(u=xa,xa=16777216,to(i,n,a),xa=u):to(i,n,a));break;default:to(i,n,a)}}function s0(i){var n=i.alternate;if(n!==null&&(i=n.child,i!==null)){n.child=null;do n=i.sibling,i.sibling=null,i=n;while(i!==null)}}function Ca(i){var n=i.deletions;if((i.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var u=n[a];Ot=u,r0(u,i)}s0(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)n0(i),i=i.sibling}function n0(i){switch(i.tag){case 0:case 11:case 15:Ca(i),i.flags&2048&&ln(9,i,i.return);break;case 3:Ca(i);break;case 12:Ca(i);break;case 22:var n=i.stateNode;i.memoizedState!==null&&n._visibility&2&&(i.return===null||i.return.tag!==13)?(n._visibility&=-3,wc(i)):Ca(i);break;default:Ca(i)}}function wc(i){var n=i.deletions;if((i.flags&16)!==0){if(n!==null)for(var a=0;a<n.length;a++){var u=n[a];Ot=u,r0(u,i)}s0(i)}for(i=i.child;i!==null;){switch(n=i,n.tag){case 0:case 11:case 15:ln(8,n,n.return),wc(n);break;case 22:a=n.stateNode,a._visibility&2&&(a._visibility&=-3,wc(n));break;default:wc(n)}i=i.sibling}}function r0(i,n){for(;Ot!==null;){var a=Ot;switch(a.tag){case 0:case 11:case 15:ln(8,a,n);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var u=a.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:aa(a.memoizedState.cache)}if(u=a.child,u!==null)u.return=a,Ot=u;else e:for(a=i;Ot!==null;){u=Ot;var m=u.sibling,g=u.return;if($y(u),u===a){Ot=null;break e}if(m!==null){m.return=g,Ot=m;break e}Ot=g}}}var oA={getCacheForType:function(i){var n=It(vt),a=n.data.get(i);return a===void 0&&(a=i(),n.data.set(i,a)),a},cacheSignal:function(){return It(vt).controller.signal}},aA=typeof WeakMap=="function"?WeakMap:Map,Fe=0,Qe=null,Be=null,ze=0,We=0,yi=null,cn=!1,io=!1,uf=!1,Ps=0,ut=0,un=0,or=0,hf=0,bi=0,so=0,Ea=null,ci=null,df=!1,xc=0,o0=0,Cc=1/0,Ec=null,hn=null,Et=0,dn=null,no=null,zs=0,ff=0,mf=null,a0=null,Ta=0,pf=null;function Si(){return(Fe&2)!==0&&ze!==0?ze&-ze:T.T!==null?Sf():xv()}function l0(){if(bi===0)if((ze&536870912)===0||He){var i=Nl;Nl<<=1,(Nl&3932160)===0&&(Nl=262144),bi=i}else bi=536870912;return i=vi.current,i!==null&&(i.flags|=32),bi}function ui(i,n,a){(i===Qe&&(We===2||We===9)||i.cancelPendingCommit!==null)&&(ro(i,0),fn(i,ze,bi,!1)),qo(i,a),((Fe&2)===0||i!==Qe)&&(i===Qe&&((Fe&2)===0&&(or|=a),ut===4&&fn(i,ze,bi,!1)),os(i))}function c0(i,n,a){if((Fe&6)!==0)throw Error(r(327));var u=!a&&(n&127)===0&&(n&i.expiredLanes)===0||Ko(i,n),m=u?uA(i,n):vf(i,n,!0),g=u;do{if(m===0){io&&!u&&fn(i,n,0,!1);break}else{if(a=i.current.alternate,g&&!lA(a)){m=vf(i,n,!1),g=!1;continue}if(m===2){if(g=n,i.errorRecoveryDisabledLanes&g)var w=0;else w=i.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){n=w;e:{var D=i;m=Ea;var $=D.current.memoizedState.isDehydrated;if($&&(ro(D,w).flags|=256),w=vf(D,w,!1),w!==2){if(uf&&!$){D.errorRecoveryDisabledLanes|=g,or|=g,m=4;break e}g=ci,ci=m,g!==null&&(ci===null?ci=g:ci.push.apply(ci,g))}m=w}if(g=!1,m!==2)continue}}if(m===1){ro(i,0),fn(i,n,0,!0);break}e:{switch(u=i,g=m,g){case 0:case 1:throw Error(r(345));case 4:if((n&4194048)!==n)break;case 6:fn(u,n,bi,!cn);break e;case 2:ci=null;break;case 3:case 5:break;default:throw Error(r(329))}if((n&62914560)===n&&(m=xc+300-di(),10<m)){if(fn(u,n,bi,!cn),Bl(u,0,!0)!==0)break e;zs=n,u.timeoutHandle=I0(u0.bind(null,u,a,ci,Ec,df,n,bi,or,so,cn,g,"Throttled",-0,0),m);break e}u0(u,a,ci,Ec,df,n,bi,or,so,cn,g,null,-0,0)}}break}while(!0);os(i)}function u0(i,n,a,u,m,g,w,D,$,oe,ce,de,ae,le){if(i.timeoutHandle=-1,de=n.subtreeFlags,de&8192||(de&16785408)===16785408){de={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ws},i0(n,g,de);var ve=(g&62914560)===g?xc-di():(g&4194048)===g?o0-di():0;if(ve=KA(de,ve),ve!==null){zs=g,i.cancelPendingCommit=ve(_0.bind(null,i,n,g,a,u,m,w,D,$,ce,de,null,ae,le)),fn(i,g,w,!oe);return}}_0(i,n,g,a,u,m,w,D,$)}function lA(i){for(var n=i;;){var a=n.tag;if((a===0||a===11||a===15)&&n.flags&16384&&(a=n.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var u=0;u<a.length;u++){var m=a[u],g=m.getSnapshot;m=m.value;try{if(!pi(g(),m))return!1}catch{return!1}}if(a=n.child,n.subtreeFlags&16384&&a!==null)a.return=n,n=a;else{if(n===i)break;for(;n.sibling===null;){if(n.return===null||n.return===i)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function fn(i,n,a,u){n&=~hf,n&=~or,i.suspendedLanes|=n,i.pingedLanes&=~n,u&&(i.warmLanes|=n),u=i.expirationTimes;for(var m=n;0<m;){var g=31-mi(m),w=1<<g;u[g]=-1,m&=~w}a!==0&&bv(i,a,n)}function Tc(){return(Fe&6)===0?(ka(0),!1):!0}function gf(){if(Be!==null){if(We===0)var i=Be.return;else i=Be,Ts=Zn=null,Dd(i),$r=null,ca=0,i=Be;for(;i!==null;)Vy(i.alternate,i),i=i.return;Be=null}}function ro(i,n){var a=i.timeoutHandle;a!==-1&&(i.timeoutHandle=-1,AA(a)),a=i.cancelPendingCommit,a!==null&&(i.cancelPendingCommit=null,a()),zs=0,gf(),Qe=i,Be=a=Cs(i.current,null),ze=n,We=0,yi=null,cn=!1,io=Ko(i,n),uf=!1,so=bi=hf=or=un=ut=0,ci=Ea=null,df=!1,(n&8)!==0&&(n|=n&32);var u=i.entangledLanes;if(u!==0)for(i=i.entanglements,u&=n;0<u;){var m=31-mi(u),g=1<<m;n|=i[m],u&=~g}return Ps=n,ql(),a}function h0(i,n){Re=null,T.H=va,n===Gr||n===tc?(n=k_(),We=3):n===yd?(n=k_(),We=4):We=n===qd?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,yi=n,Be===null&&(ut=1,pc(i,Ni(n,i.current)))}function d0(){var i=vi.current;return i===null?!0:(ze&4194048)===ze?zi===null:(ze&62914560)===ze||(ze&536870912)!==0?i===zi:!1}function f0(){var i=T.H;return T.H=va,i===null?va:i}function m0(){var i=T.A;return T.A=oA,i}function kc(){ut=4,cn||(ze&4194048)!==ze&&vi.current!==null||(io=!0),(un&134217727)===0&&(or&134217727)===0||Qe===null||fn(Qe,ze,bi,!1)}function vf(i,n,a){var u=Fe;Fe|=2;var m=f0(),g=m0();(Qe!==i||ze!==n)&&(Ec=null,ro(i,n)),n=!1;var w=ut;e:do try{if(We!==0&&Be!==null){var D=Be,$=yi;switch(We){case 8:gf(),w=6;break e;case 3:case 2:case 9:case 6:vi.current===null&&(n=!0);var oe=We;if(We=0,yi=null,oo(i,D,$,oe),a&&io){w=0;break e}break;default:oe=We,We=0,yi=null,oo(i,D,$,oe)}}cA(),w=ut;break}catch(ce){h0(i,ce)}while(!0);return n&&i.shellSuspendCounter++,Ts=Zn=null,Fe=u,T.H=m,T.A=g,Be===null&&(Qe=null,ze=0,ql()),w}function cA(){for(;Be!==null;)p0(Be)}function uA(i,n){var a=Fe;Fe|=2;var u=f0(),m=m0();Qe!==i||ze!==n?(Ec=null,Cc=di()+500,ro(i,n)):io=Ko(i,n);e:do try{if(We!==0&&Be!==null){n=Be;var g=yi;t:switch(We){case 1:We=0,yi=null,oo(i,n,g,1);break;case 2:case 9:if(E_(g)){We=0,yi=null,g0(n);break}n=function(){We!==2&&We!==9||Qe!==i||(We=7),os(i)},g.then(n,n);break e;case 3:We=7;break e;case 4:We=5;break e;case 7:E_(g)?(We=0,yi=null,g0(n)):(We=0,yi=null,oo(i,n,g,7));break;case 5:var w=null;switch(Be.tag){case 26:w=Be.memoizedState;case 5:case 27:var D=Be;if(w?tb(w):D.stateNode.complete){We=0,yi=null;var $=D.sibling;if($!==null)Be=$;else{var oe=D.return;oe!==null?(Be=oe,Ac(oe)):Be=null}break t}}We=0,yi=null,oo(i,n,g,5);break;case 6:We=0,yi=null,oo(i,n,g,6);break;case 8:gf(),ut=6;break e;default:throw Error(r(462))}}hA();break}catch(ce){h0(i,ce)}while(!0);return Ts=Zn=null,T.H=u,T.A=m,Fe=a,Be!==null?0:(Qe=null,ze=0,ql(),ut)}function hA(){for(;Be!==null&&!LT();)p0(Be)}function p0(i){var n=Hy(i.alternate,i,Ps);i.memoizedProps=i.pendingProps,n===null?Ac(i):Be=n}function g0(i){var n=i,a=n.alternate;switch(n.tag){case 15:case 0:n=Ny(a,n,n.pendingProps,n.type,void 0,ze);break;case 11:n=Ny(a,n,n.pendingProps,n.type.render,n.ref,ze);break;case 5:Dd(n);default:Vy(a,n),n=Be=m_(n,Ps),n=Hy(a,n,Ps)}i.memoizedProps=i.pendingProps,n===null?Ac(i):Be=n}function oo(i,n,a,u){Ts=Zn=null,Dd(n),$r=null,ca=0;var m=n.return;try{if(Jk(i,m,n,a,ze)){ut=1,pc(i,Ni(a,i.current)),Be=null;return}}catch(g){if(m!==null)throw Be=m,g;ut=1,pc(i,Ni(a,i.current)),Be=null;return}n.flags&32768?(He||u===1?i=!0:io||(ze&536870912)!==0?i=!1:(cn=i=!0,(u===2||u===9||u===3||u===6)&&(u=vi.current,u!==null&&u.tag===13&&(u.flags|=16384))),v0(n,i)):Ac(n)}function Ac(i){var n=i;do{if((n.flags&32768)!==0){v0(n,cn);return}i=n.return;var a=iA(n.alternate,n,Ps);if(a!==null){Be=a;return}if(n=n.sibling,n!==null){Be=n;return}Be=n=i}while(n!==null);ut===0&&(ut=5)}function v0(i,n){do{var a=sA(i.alternate,i);if(a!==null){a.flags&=32767,Be=a;return}if(a=i.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!n&&(i=i.sibling,i!==null)){Be=i;return}Be=i=a}while(i!==null);ut=6,Be=null}function _0(i,n,a,u,m,g,w,D,$){i.cancelPendingCommit=null;do Rc();while(Et!==0);if((Fe&6)!==0)throw Error(r(327));if(n!==null){if(n===i.current)throw Error(r(177));if(g=n.lanes|n.childLanes,g|=nd,WT(i,a,g,w,D,$),i===Qe&&(Be=Qe=null,ze=0),no=n,dn=i,zs=a,ff=g,mf=m,a0=u,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,pA(Dl,function(){return x0(),null})):(i.callbackNode=null,i.callbackPriority=0),u=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||u){u=T.T,T.T=null,m=H.p,H.p=2,w=Fe,Fe|=4;try{nA(i,n,a)}finally{Fe=w,H.p=m,T.T=u}}Et=1,y0(),b0(),S0()}}function y0(){if(Et===1){Et=0;var i=dn,n=no,a=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||a){a=T.T,T.T=null;var u=H.p;H.p=2;var m=Fe;Fe|=4;try{Jy(n,i);var g=Rf,w=r_(i.containerInfo),D=g.focusedElem,$=g.selectionRange;if(w!==D&&D&&D.ownerDocument&&n_(D.ownerDocument.documentElement,D)){if($!==null&&Jh(D)){var oe=$.start,ce=$.end;if(ce===void 0&&(ce=oe),"selectionStart"in D)D.selectionStart=oe,D.selectionEnd=Math.min(ce,D.value.length);else{var de=D.ownerDocument||document,ae=de&&de.defaultView||window;if(ae.getSelection){var le=ae.getSelection(),ve=D.textContent.length,Ee=Math.min($.start,ve),Xe=$.end===void 0?Ee:Math.min($.end,ve);!le.extend&&Ee>Xe&&(w=Xe,Xe=Ee,Ee=w);var se=s_(D,Ee),Q=s_(D,Xe);if(se&&Q&&(le.rangeCount!==1||le.anchorNode!==se.node||le.anchorOffset!==se.offset||le.focusNode!==Q.node||le.focusOffset!==Q.offset)){var re=de.createRange();re.setStart(se.node,se.offset),le.removeAllRanges(),Ee>Xe?(le.addRange(re),le.extend(Q.node,Q.offset)):(re.setEnd(Q.node,Q.offset),le.addRange(re))}}}}for(de=[],le=D;le=le.parentNode;)le.nodeType===1&&de.push({element:le,left:le.scrollLeft,top:le.scrollTop});for(typeof D.focus=="function"&&D.focus(),D=0;D<de.length;D++){var he=de[D];he.element.scrollLeft=he.left,he.element.scrollTop=he.top}}Vc=!!Af,Rf=Af=null}finally{Fe=m,H.p=u,T.T=a}}i.current=n,Et=2}}function b0(){if(Et===2){Et=0;var i=dn,n=no,a=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||a){a=T.T,T.T=null;var u=H.p;H.p=2;var m=Fe;Fe|=4;try{Gy(i,n.alternate,n)}finally{Fe=m,H.p=u,T.T=a}}Et=3}}function S0(){if(Et===4||Et===3){Et=0,BT();var i=dn,n=no,a=zs,u=a0;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Et=5:(Et=0,no=dn=null,w0(i,i.pendingLanes));var m=i.pendingLanes;if(m===0&&(hn=null),Lh(a),n=n.stateNode,fi&&typeof fi.onCommitFiberRoot=="function")try{fi.onCommitFiberRoot(Yo,n,void 0,(n.current.flags&128)===128)}catch{}if(u!==null){n=T.T,m=H.p,H.p=2,T.T=null;try{for(var g=i.onRecoverableError,w=0;w<u.length;w++){var D=u[w];g(D.value,{componentStack:D.stack})}}finally{T.T=n,H.p=m}}(zs&3)!==0&&Rc(),os(i),m=i.pendingLanes,(a&261930)!==0&&(m&42)!==0?i===pf?Ta++:(Ta=0,pf=i):Ta=0,ka(0)}}function w0(i,n){(i.pooledCacheLanes&=n)===0&&(n=i.pooledCache,n!=null&&(i.pooledCache=null,aa(n)))}function Rc(){return y0(),b0(),S0(),x0()}function x0(){if(Et!==5)return!1;var i=dn,n=ff;ff=0;var a=Lh(zs),u=T.T,m=H.p;try{H.p=32>a?32:a,T.T=null,a=mf,mf=null;var g=dn,w=zs;if(Et=0,no=dn=null,zs=0,(Fe&6)!==0)throw Error(r(331));var D=Fe;if(Fe|=4,n0(g.current),t0(g,g.current,w,a),Fe=D,ka(0,!1),fi&&typeof fi.onPostCommitFiberRoot=="function")try{fi.onPostCommitFiberRoot(Yo,g)}catch{}return!0}finally{H.p=m,T.T=u,w0(i,n)}}function C0(i,n,a){n=Ni(a,n),n=Kd(i.stateNode,n,2),i=rn(i,n,2),i!==null&&(qo(i,2),os(i))}function Ye(i,n,a){if(i.tag===3)C0(i,i,a);else for(;n!==null;){if(n.tag===3){C0(n,i,a);break}else if(n.tag===1){var u=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(hn===null||!hn.has(u))){i=Ni(a,i),a=Ey(2),u=rn(n,a,2),u!==null&&(Ty(a,u,n,i),qo(u,2),os(u));break}}n=n.return}}function _f(i,n,a){var u=i.pingCache;if(u===null){u=i.pingCache=new aA;var m=new Set;u.set(n,m)}else m=u.get(n),m===void 0&&(m=new Set,u.set(n,m));m.has(a)||(uf=!0,m.add(a),i=dA.bind(null,i,n,a),n.then(i,i))}function dA(i,n,a){var u=i.pingCache;u!==null&&u.delete(n),i.pingedLanes|=i.suspendedLanes&a,i.warmLanes&=~a,Qe===i&&(ze&a)===a&&(ut===4||ut===3&&(ze&62914560)===ze&&300>di()-xc?(Fe&2)===0&&ro(i,0):hf|=a,so===ze&&(so=0)),os(i)}function E0(i,n){n===0&&(n=yv()),i=Gn(i,n),i!==null&&(qo(i,n),os(i))}function fA(i){var n=i.memoizedState,a=0;n!==null&&(a=n.retryLane),E0(i,a)}function mA(i,n){var a=0;switch(i.tag){case 31:case 13:var u=i.stateNode,m=i.memoizedState;m!==null&&(a=m.retryLane);break;case 19:u=i.stateNode;break;case 22:u=i.stateNode._retryCache;break;default:throw Error(r(314))}u!==null&&u.delete(n),E0(i,a)}function pA(i,n){return Mh(i,n)}var Mc=null,ao=null,yf=!1,Dc=!1,bf=!1,mn=0;function os(i){i!==ao&&i.next===null&&(ao===null?Mc=ao=i:ao=ao.next=i),Dc=!0,yf||(yf=!0,vA())}function ka(i,n){if(!bf&&Dc){bf=!0;do for(var a=!1,u=Mc;u!==null;){if(i!==0){var m=u.pendingLanes;if(m===0)var g=0;else{var w=u.suspendedLanes,D=u.pingedLanes;g=(1<<31-mi(42|i)+1)-1,g&=m&~(w&~D),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(a=!0,R0(u,g))}else g=ze,g=Bl(u,u===Qe?g:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(g&3)===0||Ko(u,g)||(a=!0,R0(u,g));u=u.next}while(a);bf=!1}}function gA(){T0()}function T0(){Dc=yf=!1;var i=0;mn!==0&&kA()&&(i=mn);for(var n=di(),a=null,u=Mc;u!==null;){var m=u.next,g=k0(u,n);g===0?(u.next=null,a===null?Mc=m:a.next=m,m===null&&(ao=a)):(a=u,(i!==0||(g&3)!==0)&&(Dc=!0)),u=m}Et!==0&&Et!==5||ka(i),mn!==0&&(mn=0)}function k0(i,n){for(var a=i.suspendedLanes,u=i.pingedLanes,m=i.expirationTimes,g=i.pendingLanes&-62914561;0<g;){var w=31-mi(g),D=1<<w,$=m[w];$===-1?((D&a)===0||(D&u)!==0)&&(m[w]=FT(D,n)):$<=n&&(i.expiredLanes|=D),g&=~D}if(n=Qe,a=ze,a=Bl(i,i===n?a:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),u=i.callbackNode,a===0||i===n&&(We===2||We===9)||i.cancelPendingCommit!==null)return u!==null&&u!==null&&Dh(u),i.callbackNode=null,i.callbackPriority=0;if((a&3)===0||Ko(i,a)){if(n=a&-a,n===i.callbackPriority)return n;switch(u!==null&&Dh(u),Lh(a)){case 2:case 8:a=vv;break;case 32:a=Dl;break;case 268435456:a=_v;break;default:a=Dl}return u=A0.bind(null,i),a=Mh(a,u),i.callbackPriority=n,i.callbackNode=a,n}return u!==null&&u!==null&&Dh(u),i.callbackPriority=2,i.callbackNode=null,2}function A0(i,n){if(Et!==0&&Et!==5)return i.callbackNode=null,i.callbackPriority=0,null;var a=i.callbackNode;if(Rc()&&i.callbackNode!==a)return null;var u=ze;return u=Bl(i,i===Qe?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),u===0?null:(c0(i,u,n),k0(i,di()),i.callbackNode!=null&&i.callbackNode===a?A0.bind(null,i):null)}function R0(i,n){if(Rc())return null;c0(i,n,!0)}function vA(){RA(function(){(Fe&6)!==0?Mh(gv,gA):T0()})}function Sf(){if(mn===0){var i=Kr;i===0&&(i=Ol,Ol<<=1,(Ol&261888)===0&&(Ol=256)),mn=i}return mn}function M0(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Hl(""+i)}function D0(i,n){var a=n.ownerDocument.createElement("input");return a.name=n.name,a.value=n.value,i.id&&a.setAttribute("form",i.id),n.parentNode.insertBefore(a,n),i=new FormData(i),a.parentNode.removeChild(a),i}function _A(i,n,a,u,m){if(n==="submit"&&a&&a.stateNode===m){var g=M0((m[ni]||null).action),w=u.submitter;w&&(n=(n=w[ni]||null)?M0(n.formAction):w.getAttribute("formAction"),n!==null&&(g=n,w=null));var D=new Fl("action","action",null,u,m);i.push({event:D,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(mn!==0){var $=w?D0(m,w):new FormData(m);Id(a,{pending:!0,data:$,method:m.method,action:g},null,$)}}else typeof g=="function"&&(D.preventDefault(),$=w?D0(m,w):new FormData(m),Id(a,{pending:!0,data:$,method:m.method,action:g},g,$))},currentTarget:m}]})}}for(var wf=0;wf<sd.length;wf++){var xf=sd[wf],yA=xf.toLowerCase(),bA=xf[0].toUpperCase()+xf.slice(1);qi(yA,"on"+bA)}qi(l_,"onAnimationEnd"),qi(c_,"onAnimationIteration"),qi(u_,"onAnimationStart"),qi("dblclick","onDoubleClick"),qi("focusin","onFocus"),qi("focusout","onBlur"),qi(Pk,"onTransitionRun"),qi(zk,"onTransitionStart"),qi(jk,"onTransitionCancel"),qi(h_,"onTransitionEnd"),Or("onMouseEnter",["mouseout","mouseover"]),Or("onMouseLeave",["mouseout","mouseover"]),Or("onPointerEnter",["pointerout","pointerover"]),Or("onPointerLeave",["pointerout","pointerover"]),Wn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Wn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Wn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Wn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Wn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Wn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Aa="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(" "),SA=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Aa));function O0(i,n){n=(n&4)!==0;for(var a=0;a<i.length;a++){var u=i[a],m=u.event;u=u.listeners;e:{var g=void 0;if(n)for(var w=u.length-1;0<=w;w--){var D=u[w],$=D.instance,oe=D.currentTarget;if(D=D.listener,$!==g&&m.isPropagationStopped())break e;g=D,m.currentTarget=oe;try{g(m)}catch(ce){Kl(ce)}m.currentTarget=null,g=$}else for(w=0;w<u.length;w++){if(D=u[w],$=D.instance,oe=D.currentTarget,D=D.listener,$!==g&&m.isPropagationStopped())break e;g=D,m.currentTarget=oe;try{g(m)}catch(ce){Kl(ce)}m.currentTarget=null,g=$}}}}function Pe(i,n){var a=n[Bh];a===void 0&&(a=n[Bh]=new Set);var u=i+"__bubble";a.has(u)||(N0(n,i,2,!1),a.add(u))}function Cf(i,n,a){var u=0;n&&(u|=4),N0(a,i,u,n)}var Oc="_reactListening"+Math.random().toString(36).slice(2);function Ef(i){if(!i[Oc]){i[Oc]=!0,Tv.forEach(function(a){a!=="selectionchange"&&(SA.has(a)||Cf(a,!1,i),Cf(a,!0,i))});var n=i.nodeType===9?i:i.ownerDocument;n===null||n[Oc]||(n[Oc]=!0,Cf("selectionchange",!1,n))}}function N0(i,n,a,u){switch(lb(n)){case 2:var m=$A;break;case 8:m=XA;break;default:m=If}a=m.bind(null,n,a,i),m=void 0,!Wh||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(m=!0),u?m!==void 0?i.addEventListener(n,a,{capture:!0,passive:m}):i.addEventListener(n,a,!0):m!==void 0?i.addEventListener(n,a,{passive:m}):i.addEventListener(n,a,!1)}function Tf(i,n,a,u,m){var g=u;if((n&1)===0&&(n&2)===0&&u!==null)e:for(;;){if(u===null)return;var w=u.tag;if(w===3||w===4){var D=u.stateNode.containerInfo;if(D===m)break;if(w===4)for(w=u.return;w!==null;){var $=w.tag;if(($===3||$===4)&&w.stateNode.containerInfo===m)return;w=w.return}for(;D!==null;){if(w=Rr(D),w===null)return;if($=w.tag,$===5||$===6||$===26||$===27){u=g=w;continue e}D=D.parentNode}}u=u.return}jv(function(){var oe=g,ce=Uh(a),de=[];e:{var ae=d_.get(i);if(ae!==void 0){var le=Fl,ve=i;switch(i){case"keypress":if(Vl(a)===0)break e;case"keydown":case"keyup":le=mk;break;case"focusin":ve="focus",le=Gh;break;case"focusout":ve="blur",le=Gh;break;case"beforeblur":case"afterblur":le=Gh;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":le=Vv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":le=ik;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":le=vk;break;case l_:case c_:case u_:le=rk;break;case h_:le=yk;break;case"scroll":case"scrollend":le=ek;break;case"wheel":le=Sk;break;case"copy":case"cut":case"paste":le=ak;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":le=Fv;break;case"toggle":case"beforetoggle":le=xk}var Ee=(n&4)!==0,Xe=!Ee&&(i==="scroll"||i==="scrollend"),se=Ee?ae!==null?ae+"Capture":null:ae;Ee=[];for(var Q=oe,re;Q!==null;){var he=Q;if(re=he.stateNode,he=he.tag,he!==5&&he!==26&&he!==27||re===null||se===null||(he=Xo(Q,se),he!=null&&Ee.push(Ra(Q,he,re))),Xe)break;Q=Q.return}0<Ee.length&&(ae=new le(ae,ve,null,a,ce),de.push({event:ae,listeners:Ee}))}}if((n&7)===0){e:{if(ae=i==="mouseover"||i==="pointerover",le=i==="mouseout"||i==="pointerout",ae&&a!==Vh&&(ve=a.relatedTarget||a.fromElement)&&(Rr(ve)||ve[Ar]))break e;if((le||ae)&&(ae=ce.window===ce?ce:(ae=ce.ownerDocument)?ae.defaultView||ae.parentWindow:window,le?(ve=a.relatedTarget||a.toElement,le=oe,ve=ve?Rr(ve):null,ve!==null&&(Xe=l(ve),Ee=ve.tag,ve!==Xe||Ee!==5&&Ee!==27&&Ee!==6)&&(ve=null)):(le=null,ve=oe),le!==ve)){if(Ee=Vv,he="onMouseLeave",se="onMouseEnter",Q="mouse",(i==="pointerout"||i==="pointerover")&&(Ee=Fv,he="onPointerLeave",se="onPointerEnter",Q="pointer"),Xe=le==null?ae:$o(le),re=ve==null?ae:$o(ve),ae=new Ee(he,Q+"leave",le,a,ce),ae.target=Xe,ae.relatedTarget=re,he=null,Rr(ce)===oe&&(Ee=new Ee(se,Q+"enter",ve,a,ce),Ee.target=re,Ee.relatedTarget=Xe,he=Ee),Xe=he,le&&ve)t:{for(Ee=wA,se=le,Q=ve,re=0,he=se;he;he=Ee(he))re++;he=0;for(var Ce=Q;Ce;Ce=Ee(Ce))he++;for(;0<re-he;)se=Ee(se),re--;for(;0<he-re;)Q=Ee(Q),he--;for(;re--;){if(se===Q||Q!==null&&se===Q.alternate){Ee=se;break t}se=Ee(se),Q=Ee(Q)}Ee=null}else Ee=null;le!==null&&L0(de,ae,le,Ee,!1),ve!==null&&Xe!==null&&L0(de,Xe,ve,Ee,!0)}}e:{if(ae=oe?$o(oe):window,le=ae.nodeName&&ae.nodeName.toLowerCase(),le==="select"||le==="input"&&ae.type==="file")var Ve=Zv;else if($v(ae))if(Qv)Ve=Nk;else{Ve=Dk;var we=Mk}else le=ae.nodeName,!le||le.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?oe&&Ih(oe.elementType)&&(Ve=Zv):Ve=Ok;if(Ve&&(Ve=Ve(i,oe))){Xv(de,Ve,a,ce);break e}we&&we(i,ae,oe),i==="focusout"&&oe&&ae.type==="number"&&oe.memoizedProps.value!=null&&Hh(ae,"number",ae.value)}switch(we=oe?$o(oe):window,i){case"focusin":($v(we)||we.contentEditable==="true")&&(jr=we,ed=oe,na=null);break;case"focusout":na=ed=jr=null;break;case"mousedown":td=!0;break;case"contextmenu":case"mouseup":case"dragend":td=!1,o_(de,a,ce);break;case"selectionchange":if(Bk)break;case"keydown":case"keyup":o_(de,a,ce)}var De;if(Xh)e:{switch(i){case"compositionstart":var je="onCompositionStart";break e;case"compositionend":je="onCompositionEnd";break e;case"compositionupdate":je="onCompositionUpdate";break e}je=void 0}else zr?qv(i,a)&&(je="onCompositionEnd"):i==="keydown"&&a.keyCode===229&&(je="onCompositionStart");je&&(Wv&&a.locale!=="ko"&&(zr||je!=="onCompositionStart"?je==="onCompositionEnd"&&zr&&(De=Hv()):(Zs=ce,Yh="value"in Zs?Zs.value:Zs.textContent,zr=!0)),we=Nc(oe,je),0<we.length&&(je=new Uv(je,i,null,a,ce),de.push({event:je,listeners:we}),De?je.data=De:(De=Gv(a),De!==null&&(je.data=De)))),(De=Ek?Tk(i,a):kk(i,a))&&(je=Nc(oe,"onBeforeInput"),0<je.length&&(we=new Uv("onBeforeInput","beforeinput",null,a,ce),de.push({event:we,listeners:je}),we.data=De)),_A(de,i,oe,a,ce)}O0(de,n)})}function Ra(i,n,a){return{instance:i,listener:n,currentTarget:a}}function Nc(i,n){for(var a=n+"Capture",u=[];i!==null;){var m=i,g=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||g===null||(m=Xo(i,a),m!=null&&u.unshift(Ra(i,m,g)),m=Xo(i,n),m!=null&&u.push(Ra(i,m,g))),i.tag===3)return u;i=i.return}return[]}function wA(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function L0(i,n,a,u,m){for(var g=n._reactName,w=[];a!==null&&a!==u;){var D=a,$=D.alternate,oe=D.stateNode;if(D=D.tag,$!==null&&$===u)break;D!==5&&D!==26&&D!==27||oe===null||($=oe,m?(oe=Xo(a,g),oe!=null&&w.unshift(Ra(a,oe,$))):m||(oe=Xo(a,g),oe!=null&&w.push(Ra(a,oe,$)))),a=a.return}w.length!==0&&i.push({event:n,listeners:w})}var xA=/\r\n?/g,CA=/\u0000|\uFFFD/g;function B0(i){return(typeof i=="string"?i:""+i).replace(xA,`
|
|
9
|
+
`).replace(CA,"")}function P0(i,n){return n=B0(n),B0(i)===n}function $e(i,n,a,u,m,g){switch(a){case"children":typeof u=="string"?n==="body"||n==="textarea"&&u===""||Lr(i,u):(typeof u=="number"||typeof u=="bigint")&&n!=="body"&&Lr(i,""+u);break;case"className":zl(i,"class",u);break;case"tabIndex":zl(i,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":zl(i,a,u);break;case"style":Pv(i,u,g);break;case"data":if(n!=="object"){zl(i,"data",u);break}case"src":case"href":if(u===""&&(n!=="a"||a!=="href")){i.removeAttribute(a);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){i.removeAttribute(a);break}u=Hl(""+u),i.setAttribute(a,u);break;case"action":case"formAction":if(typeof u=="function"){i.setAttribute(a,"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 g=="function"&&(a==="formAction"?(n!=="input"&&$e(i,n,"name",m.name,m,null),$e(i,n,"formEncType",m.formEncType,m,null),$e(i,n,"formMethod",m.formMethod,m,null),$e(i,n,"formTarget",m.formTarget,m,null)):($e(i,n,"encType",m.encType,m,null),$e(i,n,"method",m.method,m,null),$e(i,n,"target",m.target,m,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){i.removeAttribute(a);break}u=Hl(""+u),i.setAttribute(a,u);break;case"onClick":u!=null&&(i.onclick=ws);break;case"onScroll":u!=null&&Pe("scroll",i);break;case"onScrollEnd":u!=null&&Pe("scrollend",i);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(r(61));if(a=u.__html,a!=null){if(m.children!=null)throw Error(r(60));i.innerHTML=a}}break;case"multiple":i.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":i.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){i.removeAttribute("xlink:href");break}a=Hl(""+u),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?i.setAttribute(a,""+u):i.removeAttribute(a);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":u&&typeof u!="function"&&typeof u!="symbol"?i.setAttribute(a,""):i.removeAttribute(a);break;case"capture":case"download":u===!0?i.setAttribute(a,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?i.setAttribute(a,u):i.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?i.setAttribute(a,u):i.removeAttribute(a);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?i.removeAttribute(a):i.setAttribute(a,u);break;case"popover":Pe("beforetoggle",i),Pe("toggle",i),Pl(i,"popover",u);break;case"xlinkActuate":Ss(i,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Ss(i,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Ss(i,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Ss(i,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Ss(i,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Ss(i,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Ss(i,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Ss(i,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Ss(i,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":Pl(i,"is",u);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=QT.get(a)||a,Pl(i,a,u))}}function kf(i,n,a,u,m,g){switch(a){case"style":Pv(i,u,g);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(r(61));if(a=u.__html,a!=null){if(m.children!=null)throw Error(r(60));i.innerHTML=a}}break;case"children":typeof u=="string"?Lr(i,u):(typeof u=="number"||typeof u=="bigint")&&Lr(i,""+u);break;case"onScroll":u!=null&&Pe("scroll",i);break;case"onScrollEnd":u!=null&&Pe("scrollend",i);break;case"onClick":u!=null&&(i.onclick=ws);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!kv.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(m=a.endsWith("Capture"),n=a.slice(2,m?a.length-7:void 0),g=i[ni]||null,g=g!=null?g[a]:null,typeof g=="function"&&i.removeEventListener(n,g,m),typeof u=="function")){typeof g!="function"&&g!==null&&(a in i?i[a]=null:i.hasAttribute(a)&&i.removeAttribute(a)),i.addEventListener(n,u,m);break e}a in i?i[a]=u:u===!0?i.setAttribute(a,""):Pl(i,a,u)}}}function Ut(i,n,a){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Pe("error",i),Pe("load",i);var u=!1,m=!1,g;for(g in a)if(a.hasOwnProperty(g)){var w=a[g];if(w!=null)switch(g){case"src":u=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:$e(i,n,g,w,a,null)}}m&&$e(i,n,"srcSet",a.srcSet,a,null),u&&$e(i,n,"src",a.src,a,null);return;case"input":Pe("invalid",i);var D=g=w=m=null,$=null,oe=null;for(u in a)if(a.hasOwnProperty(u)){var ce=a[u];if(ce!=null)switch(u){case"name":m=ce;break;case"type":w=ce;break;case"checked":$=ce;break;case"defaultChecked":oe=ce;break;case"value":g=ce;break;case"defaultValue":D=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(r(137,n));break;default:$e(i,n,u,ce,a,null)}}Ov(i,g,D,$,oe,w,m,!1);return;case"select":Pe("invalid",i),u=w=g=null;for(m in a)if(a.hasOwnProperty(m)&&(D=a[m],D!=null))switch(m){case"value":g=D;break;case"defaultValue":w=D;break;case"multiple":u=D;default:$e(i,n,m,D,a,null)}n=g,a=w,i.multiple=!!u,n!=null?Nr(i,!!u,n,!1):a!=null&&Nr(i,!!u,a,!0);return;case"textarea":Pe("invalid",i),g=m=u=null;for(w in a)if(a.hasOwnProperty(w)&&(D=a[w],D!=null))switch(w){case"value":u=D;break;case"defaultValue":m=D;break;case"children":g=D;break;case"dangerouslySetInnerHTML":if(D!=null)throw Error(r(91));break;default:$e(i,n,w,D,a,null)}Lv(i,u,m,g);return;case"option":for($ in a)a.hasOwnProperty($)&&(u=a[$],u!=null)&&($==="selected"?i.selected=u&&typeof u!="function"&&typeof u!="symbol":$e(i,n,$,u,a,null));return;case"dialog":Pe("beforetoggle",i),Pe("toggle",i),Pe("cancel",i),Pe("close",i);break;case"iframe":case"object":Pe("load",i);break;case"video":case"audio":for(u=0;u<Aa.length;u++)Pe(Aa[u],i);break;case"image":Pe("error",i),Pe("load",i);break;case"details":Pe("toggle",i);break;case"embed":case"source":case"link":Pe("error",i),Pe("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(oe in a)if(a.hasOwnProperty(oe)&&(u=a[oe],u!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:$e(i,n,oe,u,a,null)}return;default:if(Ih(n)){for(ce in a)a.hasOwnProperty(ce)&&(u=a[ce],u!==void 0&&kf(i,n,ce,u,a,void 0));return}}for(D in a)a.hasOwnProperty(D)&&(u=a[D],u!=null&&$e(i,n,D,u,a,null))}function EA(i,n,a,u){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,g=null,w=null,D=null,$=null,oe=null,ce=null;for(le in a){var de=a[le];if(a.hasOwnProperty(le)&&de!=null)switch(le){case"checked":break;case"value":break;case"defaultValue":$=de;default:u.hasOwnProperty(le)||$e(i,n,le,null,u,de)}}for(var ae in u){var le=u[ae];if(de=a[ae],u.hasOwnProperty(ae)&&(le!=null||de!=null))switch(ae){case"type":g=le;break;case"name":m=le;break;case"checked":oe=le;break;case"defaultChecked":ce=le;break;case"value":w=le;break;case"defaultValue":D=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(r(137,n));break;default:le!==de&&$e(i,n,ae,le,u,de)}}jh(i,w,D,$,oe,ce,g,m);return;case"select":le=w=D=ae=null;for(g in a)if($=a[g],a.hasOwnProperty(g)&&$!=null)switch(g){case"value":break;case"multiple":le=$;default:u.hasOwnProperty(g)||$e(i,n,g,null,u,$)}for(m in u)if(g=u[m],$=a[m],u.hasOwnProperty(m)&&(g!=null||$!=null))switch(m){case"value":ae=g;break;case"defaultValue":D=g;break;case"multiple":w=g;default:g!==$&&$e(i,n,m,g,u,$)}n=D,a=w,u=le,ae!=null?Nr(i,!!a,ae,!1):!!u!=!!a&&(n!=null?Nr(i,!!a,n,!0):Nr(i,!!a,a?[]:"",!1));return;case"textarea":le=ae=null;for(D in a)if(m=a[D],a.hasOwnProperty(D)&&m!=null&&!u.hasOwnProperty(D))switch(D){case"value":break;case"children":break;default:$e(i,n,D,null,u,m)}for(w in u)if(m=u[w],g=a[w],u.hasOwnProperty(w)&&(m!=null||g!=null))switch(w){case"value":ae=m;break;case"defaultValue":le=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(r(91));break;default:m!==g&&$e(i,n,w,m,u,g)}Nv(i,ae,le);return;case"option":for(var ve in a)ae=a[ve],a.hasOwnProperty(ve)&&ae!=null&&!u.hasOwnProperty(ve)&&(ve==="selected"?i.selected=!1:$e(i,n,ve,null,u,ae));for($ in u)ae=u[$],le=a[$],u.hasOwnProperty($)&&ae!==le&&(ae!=null||le!=null)&&($==="selected"?i.selected=ae&&typeof ae!="function"&&typeof ae!="symbol":$e(i,n,$,ae,u,le));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 Ee in a)ae=a[Ee],a.hasOwnProperty(Ee)&&ae!=null&&!u.hasOwnProperty(Ee)&&$e(i,n,Ee,null,u,ae);for(oe in u)if(ae=u[oe],le=a[oe],u.hasOwnProperty(oe)&&ae!==le&&(ae!=null||le!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(r(137,n));break;default:$e(i,n,oe,ae,u,le)}return;default:if(Ih(n)){for(var Xe in a)ae=a[Xe],a.hasOwnProperty(Xe)&&ae!==void 0&&!u.hasOwnProperty(Xe)&&kf(i,n,Xe,void 0,u,ae);for(ce in u)ae=u[ce],le=a[ce],!u.hasOwnProperty(ce)||ae===le||ae===void 0&&le===void 0||kf(i,n,ce,ae,u,le);return}}for(var se in a)ae=a[se],a.hasOwnProperty(se)&&ae!=null&&!u.hasOwnProperty(se)&&$e(i,n,se,null,u,ae);for(de in u)ae=u[de],le=a[de],!u.hasOwnProperty(de)||ae===le||ae==null&&le==null||$e(i,n,de,ae,u,le)}function z0(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function TA(){if(typeof performance.getEntriesByType=="function"){for(var i=0,n=0,a=performance.getEntriesByType("resource"),u=0;u<a.length;u++){var m=a[u],g=m.transferSize,w=m.initiatorType,D=m.duration;if(g&&D&&z0(w)){for(w=0,D=m.responseEnd,u+=1;u<a.length;u++){var $=a[u],oe=$.startTime;if(oe>D)break;var ce=$.transferSize,de=$.initiatorType;ce&&z0(de)&&($=$.responseEnd,w+=ce*($<D?1:(D-oe)/($-oe)))}if(--u,n+=8*(g+w)/(m.duration/1e3),i++,10<i)break}}if(0<i)return n/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var Af=null,Rf=null;function Lc(i){return i.nodeType===9?i:i.ownerDocument}function j0(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 H0(i,n){if(i===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&n==="foreignObject"?0:i}function Mf(i,n){return i==="textarea"||i==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Df=null;function kA(){var i=window.event;return i&&i.type==="popstate"?i===Df?!1:(Df=i,!0):(Df=null,!1)}var I0=typeof setTimeout=="function"?setTimeout:void 0,AA=typeof clearTimeout=="function"?clearTimeout:void 0,V0=typeof Promise=="function"?Promise:void 0,RA=typeof queueMicrotask=="function"?queueMicrotask:typeof V0<"u"?function(i){return V0.resolve(null).then(i).catch(MA)}:I0;function MA(i){setTimeout(function(){throw i})}function pn(i){return i==="head"}function U0(i,n){var a=n,u=0;do{var m=a.nextSibling;if(i.removeChild(a),m&&m.nodeType===8)if(a=m.data,a==="/$"||a==="/&"){if(u===0){i.removeChild(m),ho(n);return}u--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")u++;else if(a==="html")Ma(i.ownerDocument.documentElement);else if(a==="head"){a=i.ownerDocument.head,Ma(a);for(var g=a.firstChild;g;){var w=g.nextSibling,D=g.nodeName;g[Go]||D==="SCRIPT"||D==="STYLE"||D==="LINK"&&g.rel.toLowerCase()==="stylesheet"||a.removeChild(g),g=w}}else a==="body"&&Ma(i.ownerDocument.body);a=m}while(a);ho(n)}function F0(i,n){var a=i;i=0;do{var u=a.nextSibling;if(a.nodeType===1?n?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(n?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),u&&u.nodeType===8)if(a=u.data,a==="/$"){if(i===0)break;i--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||i++;a=u}while(a)}function Of(i){var n=i.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var a=n;switch(n=n.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Of(a),Ph(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}i.removeChild(a)}}function DA(i,n,a,u){for(;i.nodeType===1;){var m=a;if(i.nodeName.toLowerCase()!==n.toLowerCase()){if(!u&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(u){if(!i[Go])switch(n){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(g=i.getAttribute("rel"),g==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(g!==m.rel||i.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||i.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||i.getAttribute("title")!==(m.title==null?null:m.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(g=i.getAttribute("src"),(g!==(m.src==null?null:m.src)||i.getAttribute("type")!==(m.type==null?null:m.type)||i.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&g&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(n==="input"&&i.type==="hidden"){var g=m.name==null?null:""+m.name;if(m.type==="hidden"&&i.getAttribute("name")===g)return i}else return i;if(i=ji(i.nextSibling),i===null)break}return null}function OA(i,n,a){if(n==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!a||(i=ji(i.nextSibling),i===null))return null;return i}function W0(i,n){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!n||(i=ji(i.nextSibling),i===null))return null;return i}function Nf(i){return i.data==="$?"||i.data==="$~"}function Lf(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function NA(i,n){var a=i.ownerDocument;if(i.data==="$~")i._reactRetry=n;else if(i.data!=="$?"||a.readyState!=="loading")n();else{var u=function(){n(),a.removeEventListener("DOMContentLoaded",u)};a.addEventListener("DOMContentLoaded",u),i._reactRetry=u}}function ji(i){for(;i!=null;i=i.nextSibling){var n=i.nodeType;if(n===1||n===3)break;if(n===8){if(n=i.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return i}var Bf=null;function Y0(i){i=i.nextSibling;for(var n=0;i;){if(i.nodeType===8){var a=i.data;if(a==="/$"||a==="/&"){if(n===0)return ji(i.nextSibling);n--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||n++}i=i.nextSibling}return null}function K0(i){i=i.previousSibling;for(var n=0;i;){if(i.nodeType===8){var a=i.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(n===0)return i;n--}else a!=="/$"&&a!=="/&"||n++}i=i.previousSibling}return null}function q0(i,n,a){switch(n=Lc(a),i){case"html":if(i=n.documentElement,!i)throw Error(r(452));return i;case"head":if(i=n.head,!i)throw Error(r(453));return i;case"body":if(i=n.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function Ma(i){for(var n=i.attributes;n.length;)i.removeAttributeNode(n[0]);Ph(i)}var Hi=new Map,G0=new Set;function Bc(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var js=H.d;H.d={f:LA,r:BA,D:PA,C:zA,L:jA,m:HA,X:VA,S:IA,M:UA};function LA(){var i=js.f(),n=Tc();return i||n}function BA(i){var n=Mr(i);n!==null&&n.tag===5&&n.type==="form"?hy(n):js.r(i)}var lo=typeof document>"u"?null:document;function $0(i,n,a){var u=lo;if(u&&typeof n=="string"&&n){var m=Di(n);m='link[rel="'+i+'"][href="'+m+'"]',typeof a=="string"&&(m+='[crossorigin="'+a+'"]'),G0.has(m)||(G0.add(m),i={rel:i,crossOrigin:a,href:n},u.querySelector(m)===null&&(n=u.createElement("link"),Ut(n,"link",i),Dt(n),u.head.appendChild(n)))}}function PA(i){js.D(i),$0("dns-prefetch",i,null)}function zA(i,n){js.C(i,n),$0("preconnect",i,n)}function jA(i,n,a){js.L(i,n,a);var u=lo;if(u&&i&&n){var m='link[rel="preload"][as="'+Di(n)+'"]';n==="image"&&a&&a.imageSrcSet?(m+='[imagesrcset="'+Di(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(m+='[imagesizes="'+Di(a.imageSizes)+'"]')):m+='[href="'+Di(i)+'"]';var g=m;switch(n){case"style":g=co(i);break;case"script":g=uo(i)}Hi.has(g)||(i=v({rel:"preload",href:n==="image"&&a&&a.imageSrcSet?void 0:i,as:n},a),Hi.set(g,i),u.querySelector(m)!==null||n==="style"&&u.querySelector(Da(g))||n==="script"&&u.querySelector(Oa(g))||(n=u.createElement("link"),Ut(n,"link",i),Dt(n),u.head.appendChild(n)))}}function HA(i,n){js.m(i,n);var a=lo;if(a&&i){var u=n&&typeof n.as=="string"?n.as:"script",m='link[rel="modulepreload"][as="'+Di(u)+'"][href="'+Di(i)+'"]',g=m;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=uo(i)}if(!Hi.has(g)&&(i=v({rel:"modulepreload",href:i},n),Hi.set(g,i),a.querySelector(m)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Oa(g)))return}u=a.createElement("link"),Ut(u,"link",i),Dt(u),a.head.appendChild(u)}}}function IA(i,n,a){js.S(i,n,a);var u=lo;if(u&&i){var m=Dr(u).hoistableStyles,g=co(i);n=n||"default";var w=m.get(g);if(!w){var D={loading:0,preload:null};if(w=u.querySelector(Da(g)))D.loading=5;else{i=v({rel:"stylesheet",href:i,"data-precedence":n},a),(a=Hi.get(g))&&Pf(i,a);var $=w=u.createElement("link");Dt($),Ut($,"link",i),$._p=new Promise(function(oe,ce){$.onload=oe,$.onerror=ce}),$.addEventListener("load",function(){D.loading|=1}),$.addEventListener("error",function(){D.loading|=2}),D.loading|=4,Pc(w,n,u)}w={type:"stylesheet",instance:w,count:1,state:D},m.set(g,w)}}}function VA(i,n){js.X(i,n);var a=lo;if(a&&i){var u=Dr(a).hoistableScripts,m=uo(i),g=u.get(m);g||(g=a.querySelector(Oa(m)),g||(i=v({src:i,async:!0},n),(n=Hi.get(m))&&zf(i,n),g=a.createElement("script"),Dt(g),Ut(g,"link",i),a.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},u.set(m,g))}}function UA(i,n){js.M(i,n);var a=lo;if(a&&i){var u=Dr(a).hoistableScripts,m=uo(i),g=u.get(m);g||(g=a.querySelector(Oa(m)),g||(i=v({src:i,async:!0,type:"module"},n),(n=Hi.get(m))&&zf(i,n),g=a.createElement("script"),Dt(g),Ut(g,"link",i),a.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},u.set(m,g))}}function X0(i,n,a,u){var m=(m=Y.current)?Bc(m):null;if(!m)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(n=co(a.href),a=Dr(m).hoistableStyles,u=a.get(n),u||(u={type:"style",instance:null,count:0,state:null},a.set(n,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){i=co(a.href);var g=Dr(m).hoistableStyles,w=g.get(i);if(w||(m=m.ownerDocument||m,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(i,w),(g=m.querySelector(Da(i)))&&!g._p&&(w.instance=g,w.state.loading=5),Hi.has(i)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Hi.set(i,a),g||FA(m,i,a,w.state))),n&&u===null)throw Error(r(528,""));return w}if(n&&u!==null)throw Error(r(529,""));return null;case"script":return n=a.async,a=a.src,typeof a=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=uo(a),a=Dr(m).hoistableScripts,u=a.get(n),u||(u={type:"script",instance:null,count:0,state:null},a.set(n,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function co(i){return'href="'+Di(i)+'"'}function Da(i){return'link[rel="stylesheet"]['+i+"]"}function Z0(i){return v({},i,{"data-precedence":i.precedence,precedence:null})}function FA(i,n,a,u){i.querySelector('link[rel="preload"][as="style"]['+n+"]")?u.loading=1:(n=i.createElement("link"),u.preload=n,n.addEventListener("load",function(){return u.loading|=1}),n.addEventListener("error",function(){return u.loading|=2}),Ut(n,"link",a),Dt(n),i.head.appendChild(n))}function uo(i){return'[src="'+Di(i)+'"]'}function Oa(i){return"script[async]"+i}function Q0(i,n,a){if(n.count++,n.instance===null)switch(n.type){case"style":var u=i.querySelector('style[data-href~="'+Di(a.href)+'"]');if(u)return n.instance=u,Dt(u),u;var m=v({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return u=(i.ownerDocument||i).createElement("style"),Dt(u),Ut(u,"style",m),Pc(u,a.precedence,i),n.instance=u;case"stylesheet":m=co(a.href);var g=i.querySelector(Da(m));if(g)return n.state.loading|=4,n.instance=g,Dt(g),g;u=Z0(a),(m=Hi.get(m))&&Pf(u,m),g=(i.ownerDocument||i).createElement("link"),Dt(g);var w=g;return w._p=new Promise(function(D,$){w.onload=D,w.onerror=$}),Ut(g,"link",u),n.state.loading|=4,Pc(g,a.precedence,i),n.instance=g;case"script":return g=uo(a.src),(m=i.querySelector(Oa(g)))?(n.instance=m,Dt(m),m):(u=a,(m=Hi.get(g))&&(u=v({},a),zf(u,m)),i=i.ownerDocument||i,m=i.createElement("script"),Dt(m),Ut(m,"link",u),i.head.appendChild(m),n.instance=m);case"void":return null;default:throw Error(r(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(u=n.instance,n.state.loading|=4,Pc(u,a.precedence,i));return n.instance}function Pc(i,n,a){for(var u=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=u.length?u[u.length-1]:null,g=m,w=0;w<u.length;w++){var D=u[w];if(D.dataset.precedence===n)g=D;else if(g!==m)break}g?g.parentNode.insertBefore(i,g.nextSibling):(n=a.nodeType===9?a.head:a,n.insertBefore(i,n.firstChild))}function Pf(i,n){i.crossOrigin==null&&(i.crossOrigin=n.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=n.referrerPolicy),i.title==null&&(i.title=n.title)}function zf(i,n){i.crossOrigin==null&&(i.crossOrigin=n.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=n.referrerPolicy),i.integrity==null&&(i.integrity=n.integrity)}var zc=null;function J0(i,n,a){if(zc===null){var u=new Map,m=zc=new Map;m.set(a,u)}else m=zc,u=m.get(a),u||(u=new Map,m.set(a,u));if(u.has(i))return u;for(u.set(i,null),a=a.getElementsByTagName(i),m=0;m<a.length;m++){var g=a[m];if(!(g[Go]||g[jt]||i==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var w=g.getAttribute(n)||"";w=i+w;var D=u.get(w);D?D.push(g):u.set(w,[g])}}return u}function eb(i,n,a){i=i.ownerDocument||i,i.head.insertBefore(a,n==="title"?i.querySelector("head > title"):null)}function WA(i,n,a){if(a===1||n.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(i=n.disabled,typeof n.precedence=="string"&&i==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function tb(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function YA(i,n,a,u){if(a.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var m=co(u.href),g=n.querySelector(Da(m));if(g){n=g._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(i.count++,i=jc.bind(i),n.then(i,i)),a.state.loading|=4,a.instance=g,Dt(g);return}g=n.ownerDocument||n,u=Z0(u),(m=Hi.get(m))&&Pf(u,m),g=g.createElement("link"),Dt(g);var w=g;w._p=new Promise(function(D,$){w.onload=D,w.onerror=$}),Ut(g,"link",u),a.instance=g}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(a,n),(n=a.state.preload)&&(a.state.loading&3)===0&&(i.count++,a=jc.bind(i),n.addEventListener("load",a),n.addEventListener("error",a))}}var jf=0;function KA(i,n){return i.stylesheets&&i.count===0&&Ic(i,i.stylesheets),0<i.count||0<i.imgCount?function(a){var u=setTimeout(function(){if(i.stylesheets&&Ic(i,i.stylesheets),i.unsuspend){var g=i.unsuspend;i.unsuspend=null,g()}},6e4+n);0<i.imgBytes&&jf===0&&(jf=62500*TA());var m=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Ic(i,i.stylesheets),i.unsuspend)){var g=i.unsuspend;i.unsuspend=null,g()}},(i.imgBytes>jf?50:800)+n);return i.unsuspend=a,function(){i.unsuspend=null,clearTimeout(u),clearTimeout(m)}}:null}function jc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ic(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Hc=null;function Ic(i,n){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Hc=new Map,n.forEach(qA,i),Hc=null,jc.call(i))}function qA(i,n){if(!(n.state.loading&4)){var a=Hc.get(i);if(a)var u=a.get(null);else{a=new Map,Hc.set(i,a);for(var m=i.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<m.length;g++){var w=m[g];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(a.set(w.dataset.precedence,w),u=w)}u&&a.set(null,u)}m=n.instance,w=m.getAttribute("data-precedence"),g=a.get(w)||u,g===u&&a.set(null,m),a.set(w,m),this.count++,u=jc.bind(this),m.addEventListener("load",u),m.addEventListener("error",u),g?g.parentNode.insertBefore(m,g.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(m,i.firstChild)),n.state.loading|=4}}var Na={$$typeof:M,Provider:null,Consumer:null,_currentValue:B,_currentValue2:B,_threadCount:0};function GA(i,n,a,u,m,g,w,D,$){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=Oh(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Oh(0),this.hiddenUpdates=Oh(null),this.identifierPrefix=u,this.onUncaughtError=m,this.onCaughtError=g,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=$,this.incompleteTransitions=new Map}function ib(i,n,a,u,m,g,w,D,$,oe,ce,de){return i=new GA(i,n,a,w,$,oe,ce,de,D),n=1,g===!0&&(n|=24),g=gi(3,null,null,n),i.current=g,g.stateNode=i,n=gd(),n.refCount++,i.pooledCache=n,n.refCount++,g.memoizedState={element:u,isDehydrated:a,cache:n},bd(g),i}function sb(i){return i?(i=Vr,i):Vr}function nb(i,n,a,u,m,g){m=sb(m),u.context===null?u.context=m:u.pendingContext=m,u=nn(n),u.payload={element:a},g=g===void 0?null:g,g!==null&&(u.callback=g),a=rn(i,u,n),a!==null&&(ui(a,i,n),ha(a,i,n))}function rb(i,n){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var a=i.retryLane;i.retryLane=a!==0&&a<n?a:n}}function Hf(i,n){rb(i,n),(i=i.alternate)&&rb(i,n)}function ob(i){if(i.tag===13||i.tag===31){var n=Gn(i,67108864);n!==null&&ui(n,i,67108864),Hf(i,67108864)}}function ab(i){if(i.tag===13||i.tag===31){var n=Si();n=Nh(n);var a=Gn(i,n);a!==null&&ui(a,i,n),Hf(i,n)}}var Vc=!0;function $A(i,n,a,u){var m=T.T;T.T=null;var g=H.p;try{H.p=2,If(i,n,a,u)}finally{H.p=g,T.T=m}}function XA(i,n,a,u){var m=T.T;T.T=null;var g=H.p;try{H.p=8,If(i,n,a,u)}finally{H.p=g,T.T=m}}function If(i,n,a,u){if(Vc){var m=Vf(u);if(m===null)Tf(i,n,u,Uc,a),cb(i,u);else if(QA(m,i,n,a,u))u.stopPropagation();else if(cb(i,u),n&4&&-1<ZA.indexOf(i)){for(;m!==null;){var g=Mr(m);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var w=Fn(g.pendingLanes);if(w!==0){var D=g;for(D.pendingLanes|=2,D.entangledLanes|=2;w;){var $=1<<31-mi(w);D.entanglements[1]|=$,w&=~$}os(g),(Fe&6)===0&&(Cc=di()+500,ka(0))}}break;case 31:case 13:D=Gn(g,2),D!==null&&ui(D,g,2),Tc(),Hf(g,2)}if(g=Vf(u),g===null&&Tf(i,n,u,Uc,a),g===m)break;m=g}m!==null&&u.stopPropagation()}else Tf(i,n,u,null,a)}}function Vf(i){return i=Uh(i),Uf(i)}var Uc=null;function Uf(i){if(Uc=null,i=Rr(i),i!==null){var n=l(i);if(n===null)i=null;else{var a=n.tag;if(a===13){if(i=c(n),i!==null)return i;i=null}else if(a===31){if(i=h(n),i!==null)return i;i=null}else if(a===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;i=null}else n!==i&&(i=null)}}return Uc=i,null}function lb(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(PT()){case gv:return 2;case vv:return 8;case Dl:case zT:return 32;case _v:return 268435456;default:return 32}default:return 32}}var Ff=!1,gn=null,vn=null,_n=null,La=new Map,Ba=new Map,yn=[],ZA="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 cb(i,n){switch(i){case"focusin":case"focusout":gn=null;break;case"dragenter":case"dragleave":vn=null;break;case"mouseover":case"mouseout":_n=null;break;case"pointerover":case"pointerout":La.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ba.delete(n.pointerId)}}function Pa(i,n,a,u,m,g){return i===null||i.nativeEvent!==g?(i={blockedOn:n,domEventName:a,eventSystemFlags:u,nativeEvent:g,targetContainers:[m]},n!==null&&(n=Mr(n),n!==null&&ob(n)),i):(i.eventSystemFlags|=u,n=i.targetContainers,m!==null&&n.indexOf(m)===-1&&n.push(m),i)}function QA(i,n,a,u,m){switch(n){case"focusin":return gn=Pa(gn,i,n,a,u,m),!0;case"dragenter":return vn=Pa(vn,i,n,a,u,m),!0;case"mouseover":return _n=Pa(_n,i,n,a,u,m),!0;case"pointerover":var g=m.pointerId;return La.set(g,Pa(La.get(g)||null,i,n,a,u,m)),!0;case"gotpointercapture":return g=m.pointerId,Ba.set(g,Pa(Ba.get(g)||null,i,n,a,u,m)),!0}return!1}function ub(i){var n=Rr(i.target);if(n!==null){var a=l(n);if(a!==null){if(n=a.tag,n===13){if(n=c(a),n!==null){i.blockedOn=n,Cv(i.priority,function(){ab(a)});return}}else if(n===31){if(n=h(a),n!==null){i.blockedOn=n,Cv(i.priority,function(){ab(a)});return}}else if(n===3&&a.stateNode.current.memoizedState.isDehydrated){i.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Fc(i){if(i.blockedOn!==null)return!1;for(var n=i.targetContainers;0<n.length;){var a=Vf(i.nativeEvent);if(a===null){a=i.nativeEvent;var u=new a.constructor(a.type,a);Vh=u,a.target.dispatchEvent(u),Vh=null}else return n=Mr(a),n!==null&&ob(n),i.blockedOn=a,!1;n.shift()}return!0}function hb(i,n,a){Fc(i)&&a.delete(n)}function JA(){Ff=!1,gn!==null&&Fc(gn)&&(gn=null),vn!==null&&Fc(vn)&&(vn=null),_n!==null&&Fc(_n)&&(_n=null),La.forEach(hb),Ba.forEach(hb)}function Wc(i,n){i.blockedOn===n&&(i.blockedOn=null,Ff||(Ff=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,JA)))}var Yc=null;function db(i){Yc!==i&&(Yc=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Yc===i&&(Yc=null);for(var n=0;n<i.length;n+=3){var a=i[n],u=i[n+1],m=i[n+2];if(typeof u!="function"){if(Uf(u||a)===null)continue;break}var g=Mr(a);g!==null&&(i.splice(n,3),n-=3,Id(g,{pending:!0,data:m,method:a.method,action:u},u,m))}}))}function ho(i){function n($){return Wc($,i)}gn!==null&&Wc(gn,i),vn!==null&&Wc(vn,i),_n!==null&&Wc(_n,i),La.forEach(n),Ba.forEach(n);for(var a=0;a<yn.length;a++){var u=yn[a];u.blockedOn===i&&(u.blockedOn=null)}for(;0<yn.length&&(a=yn[0],a.blockedOn===null);)ub(a),a.blockedOn===null&&yn.shift();if(a=(i.ownerDocument||i).$$reactFormReplay,a!=null)for(u=0;u<a.length;u+=3){var m=a[u],g=a[u+1],w=m[ni]||null;if(typeof g=="function")w||db(a);else if(w){var D=null;if(g&&g.hasAttribute("formAction")){if(m=g,w=g[ni]||null)D=w.formAction;else if(Uf(m)!==null)continue}else D=w.action;typeof D=="function"?a[u+1]=D:(a.splice(u,3),u-=3),db(a)}}}function fb(){function i(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(w){return m=w})},focusReset:"manual",scroll:"manual"})}function n(){m!==null&&(m(),m=null),u||setTimeout(a,20)}function a(){if(!u&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,m=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(a,100),function(){u=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),m!==null&&(m(),m=null)}}}function Wf(i){this._internalRoot=i}Kc.prototype.render=Wf.prototype.render=function(i){var n=this._internalRoot;if(n===null)throw Error(r(409));var a=n.current,u=Si();nb(a,u,i,n,null,null)},Kc.prototype.unmount=Wf.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var n=i.containerInfo;nb(i.current,2,null,i,null,null),Tc(),n[Ar]=null}};function Kc(i){this._internalRoot=i}Kc.prototype.unstable_scheduleHydration=function(i){if(i){var n=xv();i={blockedOn:null,target:i,priority:n};for(var a=0;a<yn.length&&n!==0&&n<yn[a].priority;a++);yn.splice(a,0,i),a===0&&ub(i)}};var mb=t.version;if(mb!=="19.2.4")throw Error(r(527,mb,"19.2.4"));H.findDOMNode=function(i){var n=i._reactInternals;if(n===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=d(n),i=i!==null?p(i):null,i=i===null?null:i.stateNode,i};var eR={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:T,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var qc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!qc.isDisabled&&qc.supportsFiber)try{Yo=qc.inject(eR),fi=qc}catch{}}return ja.createRoot=function(i,n){if(!o(i))throw Error(r(299));var a=!1,u="",m=Sy,g=wy,w=xy;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onUncaughtError!==void 0&&(m=n.onUncaughtError),n.onCaughtError!==void 0&&(g=n.onCaughtError),n.onRecoverableError!==void 0&&(w=n.onRecoverableError)),n=ib(i,1,!1,null,null,a,u,null,m,g,w,fb),i[Ar]=n.current,Ef(i),new Wf(n)},ja.hydrateRoot=function(i,n,a){if(!o(i))throw Error(r(299));var u=!1,m="",g=Sy,w=wy,D=xy,$=null;return a!=null&&(a.unstable_strictMode===!0&&(u=!0),a.identifierPrefix!==void 0&&(m=a.identifierPrefix),a.onUncaughtError!==void 0&&(g=a.onUncaughtError),a.onCaughtError!==void 0&&(w=a.onCaughtError),a.onRecoverableError!==void 0&&(D=a.onRecoverableError),a.formState!==void 0&&($=a.formState)),n=ib(i,1,!0,n,a??null,u,m,$,g,w,D,fb),n.context=sb(null),a=n.current,u=Si(),u=Nh(u),m=nn(u),m.callback=null,rn(a,m,u),a=u,n.current.lanes=a,qo(n,a),os(n),i[Ar]=n.current,Ef(i),new Kc(n)},ja.version="19.2.4",ja}var Cb;function uR(){if(Cb)return qf.exports;Cb=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(),qf.exports=cR(),qf.exports}var hR=uR(),yl=Mx();const dR=Ax(yl);function Eb(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Dx(...e){return t=>{let s=!1;const r=e.map(o=>{const l=Eb(o,t);return!s&&typeof l=="function"&&(s=!0),l});if(s)return()=>{for(let o=0;o<r.length;o++){const l=r[o];typeof l=="function"?l():Eb(e[o],null)}}}}function Je(...e){return x.useCallback(Dx(...e),e)}function al(e){const t=mR(e),s=x.forwardRef((r,o)=>{const{children:l,...c}=r,h=x.Children.toArray(l),f=h.find(gR);if(f){const d=f.props.children,p=h.map(v=>v===f?x.Children.count(d)>1?x.Children.only(null):x.isValidElement(d)?d.props.children:null:v);return C.jsx(t,{...c,ref:o,children:x.isValidElement(d)?x.cloneElement(d,void 0,p):null})}return C.jsx(t,{...c,ref:o,children:l})});return s.displayName=`${e}.Slot`,s}var fR=al("Slot");function mR(e){const t=x.forwardRef((s,r)=>{const{children:o,...l}=s;if(x.isValidElement(o)){const c=_R(o),h=vR(l,o.props);return o.type!==x.Fragment&&(h.ref=r?Dx(r,c):c),x.cloneElement(o,h)}return x.Children.count(o)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ox=Symbol("radix.slottable");function pR(e){const t=({children:s})=>C.jsx(C.Fragment,{children:s});return t.displayName=`${e}.Slottable`,t.__radixId=Ox,t}function gR(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ox}function vR(e,t){const s={...t};for(const r in t){const o=e[r],l=t[r];/^on[A-Z]/.test(r)?o&&l?s[r]=(...h)=>{const f=l(...h);return o(...h),f}:o&&(s[r]=o):r==="style"?s[r]={...o,...l}:r==="className"&&(s[r]=[o,l].filter(Boolean).join(" "))}return{...e,...s}}function _R(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var yR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ie=yR.reduce((e,t)=>{const s=al(`Primitive.${t}`),r=x.forwardRef((o,l)=>{const{asChild:c,...h}=o,f=c?s:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),C.jsx(f,{...h,ref:l})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function bR(e,t){e&&yl.flushSync(()=>e.dispatchEvent(t))}var Nx=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),SR="VisuallyHidden",Lx=x.forwardRef((e,t)=>C.jsx(Ie.span,{...e,ref:t,style:{...Nx,...e.style}}));Lx.displayName=SR;var wR=Lx;function Er(e,t=[]){let s=[];function r(l,c){const h=x.createContext(c),f=s.length;s=[...s,c];const d=v=>{const{scope:_,children:y,...b}=v,S=_?.[e]?.[f]||h,E=x.useMemo(()=>b,Object.values(b));return C.jsx(S.Provider,{value:E,children:y})};d.displayName=l+"Provider";function p(v,_){const y=_?.[e]?.[f]||h,b=x.useContext(y);if(b)return b;if(c!==void 0)return c;throw new Error(`\`${v}\` must be used within \`${l}\``)}return[d,p]}const o=()=>{const l=s.map(c=>x.createContext(c));return function(h){const f=h?.[e]||l;return x.useMemo(()=>({[`__scope${e}`]:{...h,[e]:f}}),[h,f])}};return o.scopeName=e,[r,xR(o,...t)]}function xR(...e){const t=e[0];if(e.length===1)return t;const s=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(l){const c=r.reduce((h,{useScope:f,scopeName:d})=>{const v=f(l)[`__scope${d}`];return{...h,...v}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return s.scopeName=t.scopeName,s}function Bx(e){const t=e+"CollectionProvider",[s,r]=Er(t),[o,l]=s(t,{collectionRef:{current:null},itemMap:new Map}),c=S=>{const{scope:E,children:A}=S,R=Tn.useRef(null),M=Tn.useRef(new Map).current;return C.jsx(o,{scope:E,itemMap:M,collectionRef:R,children:A})};c.displayName=t;const h=e+"CollectionSlot",f=al(h),d=Tn.forwardRef((S,E)=>{const{scope:A,children:R}=S,M=l(h,A),k=Je(E,M.collectionRef);return C.jsx(f,{ref:k,children:R})});d.displayName=h;const p=e+"CollectionItemSlot",v="data-radix-collection-item",_=al(p),y=Tn.forwardRef((S,E)=>{const{scope:A,children:R,...M}=S,k=Tn.useRef(null),j=Je(E,k),F=l(p,A);return Tn.useEffect(()=>(F.itemMap.set(k,{ref:k,...M}),()=>{F.itemMap.delete(k)})),C.jsx(_,{[v]:"",ref:j,children:R})});y.displayName=p;function b(S){const E=l(e+"CollectionConsumer",S);return Tn.useCallback(()=>{const R=E.collectionRef.current;if(!R)return[];const M=Array.from(R.querySelectorAll(`[${v}]`));return Array.from(E.itemMap.values()).sort((F,W)=>M.indexOf(F.ref.current)-M.indexOf(W.ref.current))},[E.collectionRef,E.itemMap])}return[{Provider:c,Slot:d,ItemSlot:y},b,r]}function Me(e,t,{checkForDefaultPrevented:s=!0}={}){return function(o){if(e?.(o),s===!1||!o.defaultPrevented)return t?.(o)}}var Yt=globalThis?.document?x.useLayoutEffect:()=>{},CR=Rx[" useInsertionEffect ".trim().toString()]||Yt;function ll({prop:e,defaultProp:t,onChange:s=()=>{},caller:r}){const[o,l,c]=ER({defaultProp:t,onChange:s}),h=e!==void 0,f=h?e:o;{const p=x.useRef(e!==void 0);x.useEffect(()=>{const v=p.current;v!==h&&console.warn(`${r} is changing from ${v?"controlled":"uncontrolled"} to ${h?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=h},[h,r])}const d=x.useCallback(p=>{if(h){const v=TR(p)?p(e):p;v!==e&&c.current?.(v)}else l(p)},[h,e,l,c]);return[f,d]}function ER({defaultProp:e,onChange:t}){const[s,r]=x.useState(e),o=x.useRef(s),l=x.useRef(t);return CR(()=>{l.current=t},[t]),x.useEffect(()=>{o.current!==s&&(l.current?.(s),o.current=s)},[s,o]),[s,r,l]}function TR(e){return typeof e=="function"}function kR(e,t){return x.useReducer((s,r)=>t[s][r]??s,e)}var Pn=e=>{const{present:t,children:s}=e,r=AR(t),o=typeof s=="function"?s({present:r.isPresent}):x.Children.only(s),l=Je(r.ref,RR(o));return typeof s=="function"||r.isPresent?x.cloneElement(o,{ref:l}):null};Pn.displayName="Presence";function AR(e){const[t,s]=x.useState(),r=x.useRef(null),o=x.useRef(e),l=x.useRef("none"),c=e?"mounted":"unmounted",[h,f]=kR(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const d=Gc(r.current);l.current=h==="mounted"?d:"none"},[h]),Yt(()=>{const d=r.current,p=o.current;if(p!==e){const _=l.current,y=Gc(d);e?f("MOUNT"):y==="none"||d?.display==="none"?f("UNMOUNT"):f(p&&_!==y?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,f]),Yt(()=>{if(t){let d;const p=t.ownerDocument.defaultView??window,v=y=>{const S=Gc(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&S&&(f("ANIMATION_END"),!o.current)){const E=t.style.animationFillMode;t.style.animationFillMode="forwards",d=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=E)})}},_=y=>{y.target===t&&(l.current=Gc(r.current))};return t.addEventListener("animationstart",_),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{p.clearTimeout(d),t.removeEventListener("animationstart",_),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(h),ref:x.useCallback(d=>{r.current=d?getComputedStyle(d):null,s(d)},[])}}function Gc(e){return e?.animationName||"none"}function RR(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning;return s?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,s=t&&"isReactWarning"in t&&t.isReactWarning,s?e.props.ref:e.props.ref||e.ref)}var MR=Rx[" useId ".trim().toString()]||(()=>{}),DR=0;function Bo(e){const[t,s]=x.useState(MR());return Yt(()=>{s(r=>r??String(DR++))},[e]),e||(t?`radix-${t}`:"")}var OR=x.createContext(void 0);function oh(e){const t=x.useContext(OR);return e||t||"ltr"}function Jt(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...s)=>t.current?.(...s),[])}function NR(e,t=globalThis?.document){const s=Jt(e);x.useEffect(()=>{const r=o=>{o.key==="Escape"&&s(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[s,t])}var LR="DismissableLayer",Im="dismissableLayer.update",BR="dismissableLayer.pointerDownOutside",PR="dismissableLayer.focusOutside",Tb,Px=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),cg=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:s=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:c,onDismiss:h,...f}=e,d=x.useContext(Px),[p,v]=x.useState(null),_=p?.ownerDocument??globalThis?.document,[,y]=x.useState({}),b=Je(t,W=>v(W)),S=Array.from(d.layers),[E]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),A=S.indexOf(E),R=p?S.indexOf(p):-1,M=d.layersWithOutsidePointerEventsDisabled.size>0,k=R>=A,j=HR(W=>{const V=W.target,ee=[...d.branches].some(U=>U.contains(V));!k||ee||(o?.(W),c?.(W),W.defaultPrevented||h?.())},_),F=IR(W=>{const V=W.target;[...d.branches].some(U=>U.contains(V))||(l?.(W),c?.(W),W.defaultPrevented||h?.())},_);return NR(W=>{R===d.layers.size-1&&(r?.(W),!W.defaultPrevented&&h&&(W.preventDefault(),h()))},_),x.useEffect(()=>{if(p)return s&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Tb=_.body.style.pointerEvents,_.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),kb(),()=>{s&&d.layersWithOutsidePointerEventsDisabled.size===1&&(_.body.style.pointerEvents=Tb)}},[p,_,s,d]),x.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),kb())},[p,d]),x.useEffect(()=>{const W=()=>y({});return document.addEventListener(Im,W),()=>document.removeEventListener(Im,W)},[]),C.jsx(Ie.div,{...f,ref:b,style:{pointerEvents:M?k?"auto":"none":void 0,...e.style},onFocusCapture:Me(e.onFocusCapture,F.onFocusCapture),onBlurCapture:Me(e.onBlurCapture,F.onBlurCapture),onPointerDownCapture:Me(e.onPointerDownCapture,j.onPointerDownCapture)})});cg.displayName=LR;var zR="DismissableLayerBranch",jR=x.forwardRef((e,t)=>{const s=x.useContext(Px),r=x.useRef(null),o=Je(t,r);return x.useEffect(()=>{const l=r.current;if(l)return s.branches.add(l),()=>{s.branches.delete(l)}},[s.branches]),C.jsx(Ie.div,{...e,ref:o})});jR.displayName=zR;function HR(e,t=globalThis?.document){const s=Jt(e),r=x.useRef(!1),o=x.useRef(()=>{});return x.useEffect(()=>{const l=h=>{if(h.target&&!r.current){let f=function(){zx(BR,s,d,{discrete:!0})};const d={originalEvent:h};h.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=f,t.addEventListener("click",o.current,{once:!0})):f()}else t.removeEventListener("click",o.current);r.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",l),t.removeEventListener("click",o.current)}},[t,s]),{onPointerDownCapture:()=>r.current=!0}}function IR(e,t=globalThis?.document){const s=Jt(e),r=x.useRef(!1);return x.useEffect(()=>{const o=l=>{l.target&&!r.current&&zx(PR,s,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,s]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function kb(){const e=new CustomEvent(Im);document.dispatchEvent(e)}function zx(e,t,s,{discrete:r}){const o=s.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:s});t&&o.addEventListener(e,t,{once:!0}),r?bR(o,l):o.dispatchEvent(l)}var Zf="focusScope.autoFocusOnMount",Qf="focusScope.autoFocusOnUnmount",Ab={bubbles:!1,cancelable:!0},VR="FocusScope",jx=x.forwardRef((e,t)=>{const{loop:s=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:l,...c}=e,[h,f]=x.useState(null),d=Jt(o),p=Jt(l),v=x.useRef(null),_=Je(t,S=>f(S)),y=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let S=function(M){if(y.paused||!h)return;const k=M.target;h.contains(k)?v.current=k:kn(v.current,{select:!0})},E=function(M){if(y.paused||!h)return;const k=M.relatedTarget;k!==null&&(h.contains(k)||kn(v.current,{select:!0}))},A=function(M){if(document.activeElement===document.body)for(const j of M)j.removedNodes.length>0&&kn(h)};document.addEventListener("focusin",S),document.addEventListener("focusout",E);const R=new MutationObserver(A);return h&&R.observe(h,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",E),R.disconnect()}}},[r,h,y.paused]),x.useEffect(()=>{if(h){Mb.add(y);const S=document.activeElement;if(!h.contains(S)){const A=new CustomEvent(Zf,Ab);h.addEventListener(Zf,d),h.dispatchEvent(A),A.defaultPrevented||(UR(qR(Hx(h)),{select:!0}),document.activeElement===S&&kn(h))}return()=>{h.removeEventListener(Zf,d),setTimeout(()=>{const A=new CustomEvent(Qf,Ab);h.addEventListener(Qf,p),h.dispatchEvent(A),A.defaultPrevented||kn(S??document.body,{select:!0}),h.removeEventListener(Qf,p),Mb.remove(y)},0)}}},[h,d,p,y]);const b=x.useCallback(S=>{if(!s&&!r||y.paused)return;const E=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,A=document.activeElement;if(E&&A){const R=S.currentTarget,[M,k]=FR(R);M&&k?!S.shiftKey&&A===k?(S.preventDefault(),s&&kn(M,{select:!0})):S.shiftKey&&A===M&&(S.preventDefault(),s&&kn(k,{select:!0})):A===R&&S.preventDefault()}},[s,r,y.paused]);return C.jsx(Ie.div,{tabIndex:-1,...c,ref:_,onKeyDown:b})});jx.displayName=VR;function UR(e,{select:t=!1}={}){const s=document.activeElement;for(const r of e)if(kn(r,{select:t}),document.activeElement!==s)return}function FR(e){const t=Hx(e),s=Rb(t,e),r=Rb(t.reverse(),e);return[s,r]}function Hx(e){const t=[],s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;s.nextNode();)t.push(s.currentNode);return t}function Rb(e,t){for(const s of e)if(!WR(s,{upTo:t}))return s}function WR(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 YR(e){return e instanceof HTMLInputElement&&"select"in e}function kn(e,{select:t=!1}={}){if(e&&e.focus){const s=document.activeElement;e.focus({preventScroll:!0}),e!==s&&YR(e)&&t&&e.select()}}var Mb=KR();function KR(){let e=[];return{add(t){const s=e[0];t!==s&&s?.pause(),e=Db(e,t),e.unshift(t)},remove(t){e=Db(e,t),e[0]?.resume()}}}function Db(e,t){const s=[...e],r=s.indexOf(t);return r!==-1&&s.splice(r,1),s}function qR(e){return e.filter(t=>t.tagName!=="A")}var GR="Portal",ug=x.forwardRef((e,t)=>{const{container:s,...r}=e,[o,l]=x.useState(!1);Yt(()=>l(!0),[]);const c=s||o&&globalThis?.document?.body;return c?dR.createPortal(C.jsx(Ie.div,{...r,ref:t}),c):null});ug.displayName=GR;var Jf=0;function $R(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ob()),document.body.insertAdjacentElement("beforeend",e[1]??Ob()),Jf++,()=>{Jf===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Jf--}},[])}function Ob(){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 hs=function(){return hs=Object.assign||function(t){for(var s,r=1,o=arguments.length;r<o;r++){s=arguments[r];for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&(t[l]=s[l])}return t},hs.apply(this,arguments)};function Ix(e,t){var s={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(s[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(s[r[o]]=e[r[o]]);return s}function XR(e,t,s){if(s||arguments.length===2)for(var r=0,o=t.length,l;r<o;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 pu="right-scroll-bar-position",gu="width-before-scroll-bar",ZR="with-scroll-bars-hidden",QR="--removed-body-scroll-bar-size";function em(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function JR(e,t){var s=x.useState(function(){return{value:e,callback:t,facade:{get current(){return s.value},set current(r){var o=s.value;o!==r&&(s.value=r,s.callback(r,o))}}}})[0];return s.callback=t,s.facade}var eM=typeof window<"u"?x.useLayoutEffect:x.useEffect,Nb=new WeakMap;function tM(e,t){var s=JR(null,function(r){return e.forEach(function(o){return em(o,r)})});return eM(function(){var r=Nb.get(s);if(r){var o=new Set(r),l=new Set(e),c=s.current;o.forEach(function(h){l.has(h)||em(h,null)}),l.forEach(function(h){o.has(h)||em(h,c)})}Nb.set(s,e)},[e]),s}function iM(e){return e}function sM(e,t){t===void 0&&(t=iM);var s=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return s.length?s[s.length-1]:e},useMedium:function(l){var c=t(l,r);return s.push(c),function(){s=s.filter(function(h){return h!==c})}},assignSyncMedium:function(l){for(r=!0;s.length;){var c=s;s=[],c.forEach(l)}s={push:function(h){return l(h)},filter:function(){return s}}},assignMedium:function(l){r=!0;var c=[];if(s.length){var h=s;s=[],h.forEach(l),c=s}var f=function(){var p=c;c=[],p.forEach(l)},d=function(){return Promise.resolve().then(f)};d(),s={push:function(p){c.push(p),d()},filter:function(p){return c=c.filter(p),s}}}};return o}function nM(e){e===void 0&&(e={});var t=sM(null);return t.options=hs({async:!0,ssr:!1},e),t}var Vx=function(e){var t=e.sideCar,s=Ix(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,hs({},s))};Vx.isSideCarExport=!0;function rM(e,t){return e.useMedium(t),Vx}var Ux=nM(),tm=function(){},ah=x.forwardRef(function(e,t){var s=x.useRef(null),r=x.useState({onScrollCapture:tm,onWheelCapture:tm,onTouchMoveCapture:tm}),o=r[0],l=r[1],c=e.forwardProps,h=e.children,f=e.className,d=e.removeScrollBar,p=e.enabled,v=e.shards,_=e.sideCar,y=e.noRelative,b=e.noIsolation,S=e.inert,E=e.allowPinchZoom,A=e.as,R=A===void 0?"div":A,M=e.gapMode,k=Ix(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=_,F=tM([s,t]),W=hs(hs({},k),o);return x.createElement(x.Fragment,null,p&&x.createElement(j,{sideCar:Ux,removeScrollBar:d,shards:v,noRelative:y,noIsolation:b,inert:S,setCallbacks:l,allowPinchZoom:!!E,lockRef:s,gapMode:M}),c?x.cloneElement(x.Children.only(h),hs(hs({},W),{ref:F})):x.createElement(R,hs({},W,{className:f,ref:F}),h))});ah.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ah.classNames={fullWidth:gu,zeroRight:pu};var oM=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function aM(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=oM();return t&&e.setAttribute("nonce",t),e}function lM(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function cM(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var uM=function(){var e=0,t=null;return{add:function(s){e==0&&(t=aM())&&(lM(t,s),cM(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},hM=function(){var e=uM();return function(t,s){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&s])}},Fx=function(){var e=hM(),t=function(s){var r=s.styles,o=s.dynamic;return e(r,o),null};return t},dM={left:0,top:0,right:0,gap:0},im=function(e){return parseInt(e||"",10)||0},fM=function(e){var t=window.getComputedStyle(document.body),s=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[im(s),im(r),im(o)]},mM=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return dM;var t=fM(e),s=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-s+t[2]-t[0])}},pM=Fx(),To="data-scroll-locked",gM=function(e,t,s,r){var o=e.left,l=e.top,c=e.right,h=e.gap;return s===void 0&&(s="margin"),`
|
|
10
|
+
.`.concat(ZR,` {
|
|
11
|
+
overflow: hidden `).concat(r,`;
|
|
12
|
+
padding-right: `).concat(h,"px ").concat(r,`;
|
|
13
|
+
}
|
|
14
|
+
body[`).concat(To,`] {
|
|
15
|
+
overflow: hidden `).concat(r,`;
|
|
16
|
+
overscroll-behavior: contain;
|
|
17
|
+
`).concat([t&&"position: relative ".concat(r,";"),s==="margin"&&`
|
|
18
|
+
padding-left: `.concat(o,`px;
|
|
19
|
+
padding-top: `).concat(l,`px;
|
|
20
|
+
padding-right: `).concat(c,`px;
|
|
21
|
+
margin-left:0;
|
|
22
|
+
margin-top:0;
|
|
23
|
+
margin-right: `).concat(h,"px ").concat(r,`;
|
|
24
|
+
`),s==="padding"&&"padding-right: ".concat(h,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.`).concat(pu,` {
|
|
28
|
+
right: `).concat(h,"px ").concat(r,`;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.`).concat(gu,` {
|
|
32
|
+
margin-right: `).concat(h,"px ").concat(r,`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.`).concat(pu," .").concat(pu,` {
|
|
36
|
+
right: 0 `).concat(r,`;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.`).concat(gu," .").concat(gu,` {
|
|
40
|
+
margin-right: 0 `).concat(r,`;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
body[`).concat(To,`] {
|
|
44
|
+
`).concat(QR,": ").concat(h,`px;
|
|
45
|
+
}
|
|
46
|
+
`)},Lb=function(){var e=parseInt(document.body.getAttribute(To)||"0",10);return isFinite(e)?e:0},vM=function(){x.useEffect(function(){return document.body.setAttribute(To,(Lb()+1).toString()),function(){var e=Lb()-1;e<=0?document.body.removeAttribute(To):document.body.setAttribute(To,e.toString())}},[])},_M=function(e){var t=e.noRelative,s=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;vM();var l=x.useMemo(function(){return mM(o)},[o]);return x.createElement(pM,{styles:gM(l,!t,o,s?"":"!important")})},Vm=!1;if(typeof window<"u")try{var $c=Object.defineProperty({},"passive",{get:function(){return Vm=!0,!0}});window.addEventListener("test",$c,$c),window.removeEventListener("test",$c,$c)}catch{Vm=!1}var fo=Vm?{passive:!1}:!1,yM=function(e){return e.tagName==="TEXTAREA"},Wx=function(e,t){if(!(e instanceof Element))return!1;var s=window.getComputedStyle(e);return s[t]!=="hidden"&&!(s.overflowY===s.overflowX&&!yM(e)&&s[t]==="visible")},bM=function(e){return Wx(e,"overflowY")},SM=function(e){return Wx(e,"overflowX")},Bb=function(e,t){var s=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Yx(e,r);if(o){var l=Kx(e,r),c=l[1],h=l[2];if(c>h)return!0}r=r.parentNode}while(r&&r!==s.body);return!1},wM=function(e){var t=e.scrollTop,s=e.scrollHeight,r=e.clientHeight;return[t,s,r]},xM=function(e){var t=e.scrollLeft,s=e.scrollWidth,r=e.clientWidth;return[t,s,r]},Yx=function(e,t){return e==="v"?bM(t):SM(t)},Kx=function(e,t){return e==="v"?wM(t):xM(t)},CM=function(e,t){return e==="h"&&t==="rtl"?-1:1},EM=function(e,t,s,r,o){var l=CM(e,window.getComputedStyle(t).direction),c=l*r,h=s.target,f=t.contains(h),d=!1,p=c>0,v=0,_=0;do{if(!h)break;var y=Kx(e,h),b=y[0],S=y[1],E=y[2],A=S-E-l*b;(b||A)&&Yx(e,h)&&(v+=A,_+=b);var R=h.parentNode;h=R&&R.nodeType===Node.DOCUMENT_FRAGMENT_NODE?R.host:R}while(!f&&h!==document.body||f&&(t.contains(h)||t===h));return(p&&Math.abs(v)<1||!p&&Math.abs(_)<1)&&(d=!0),d},Xc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Pb=function(e){return[e.deltaX,e.deltaY]},zb=function(e){return e&&"current"in e?e.current:e},TM=function(e,t){return e[0]===t[0]&&e[1]===t[1]},kM=function(e){return`
|
|
47
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
48
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
49
|
+
`)},AM=0,mo=[];function RM(e){var t=x.useRef([]),s=x.useRef([0,0]),r=x.useRef(),o=x.useState(AM++)[0],l=x.useState(Fx)[0],c=x.useRef(e);x.useEffect(function(){c.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var S=XR([e.lockRef.current],(e.shards||[]).map(zb),!0).filter(Boolean);return S.forEach(function(E){return E.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),S.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var h=x.useCallback(function(S,E){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!c.current.allowPinchZoom;var A=Xc(S),R=s.current,M="deltaX"in S?S.deltaX:R[0]-A[0],k="deltaY"in S?S.deltaY:R[1]-A[1],j,F=S.target,W=Math.abs(M)>Math.abs(k)?"h":"v";if("touches"in S&&W==="h"&&F.type==="range")return!1;var V=window.getSelection(),ee=V&&V.anchorNode,U=ee?ee===F||ee.contains(F):!1;if(U)return!1;var G=Bb(W,F);if(!G)return!0;if(G?j=W:(j=W==="v"?"h":"v",G=Bb(W,F)),!G)return!1;if(!r.current&&"changedTouches"in S&&(M||k)&&(r.current=j),!j)return!0;var z=r.current||j;return EM(z,E,S,z==="h"?M:k)},[]),f=x.useCallback(function(S){var E=S;if(!(!mo.length||mo[mo.length-1]!==l)){var A="deltaY"in E?Pb(E):Xc(E),R=t.current.filter(function(j){return j.name===E.type&&(j.target===E.target||E.target===j.shadowParent)&&TM(j.delta,A)})[0];if(R&&R.should){E.cancelable&&E.preventDefault();return}if(!R){var M=(c.current.shards||[]).map(zb).filter(Boolean).filter(function(j){return j.contains(E.target)}),k=M.length>0?h(E,M[0]):!c.current.noIsolation;k&&E.cancelable&&E.preventDefault()}}},[]),d=x.useCallback(function(S,E,A,R){var M={name:S,delta:E,target:A,should:R,shadowParent:MM(A)};t.current.push(M),setTimeout(function(){t.current=t.current.filter(function(k){return k!==M})},1)},[]),p=x.useCallback(function(S){s.current=Xc(S),r.current=void 0},[]),v=x.useCallback(function(S){d(S.type,Pb(S),S.target,h(S,e.lockRef.current))},[]),_=x.useCallback(function(S){d(S.type,Xc(S),S.target,h(S,e.lockRef.current))},[]);x.useEffect(function(){return mo.push(l),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:_}),document.addEventListener("wheel",f,fo),document.addEventListener("touchmove",f,fo),document.addEventListener("touchstart",p,fo),function(){mo=mo.filter(function(S){return S!==l}),document.removeEventListener("wheel",f,fo),document.removeEventListener("touchmove",f,fo),document.removeEventListener("touchstart",p,fo)}},[]);var y=e.removeScrollBar,b=e.inert;return x.createElement(x.Fragment,null,b?x.createElement(l,{styles:kM(o)}):null,y?x.createElement(_M,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function MM(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const DM=rM(Ux,RM);var qx=x.forwardRef(function(e,t){return x.createElement(ah,hs({},e,{ref:t,sideCar:DM}))});qx.classNames=ah.classNames;var OM=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},po=new WeakMap,Zc=new WeakMap,Qc={},sm=0,Gx=function(e){return e&&(e.host||Gx(e.parentNode))},NM=function(e,t){return t.map(function(s){if(e.contains(s))return s;var r=Gx(s);return r&&e.contains(r)?r:(console.error("aria-hidden",s,"in not contained inside",e,". Doing nothing"),null)}).filter(function(s){return!!s})},LM=function(e,t,s,r){var o=NM(t,Array.isArray(e)?e:[e]);Qc[s]||(Qc[s]=new WeakMap);var l=Qc[s],c=[],h=new Set,f=new Set(o),d=function(v){!v||h.has(v)||(h.add(v),d(v.parentNode))};o.forEach(d);var p=function(v){!v||f.has(v)||Array.prototype.forEach.call(v.children,function(_){if(h.has(_))p(_);else try{var y=_.getAttribute(r),b=y!==null&&y!=="false",S=(po.get(_)||0)+1,E=(l.get(_)||0)+1;po.set(_,S),l.set(_,E),c.push(_),S===1&&b&&Zc.set(_,!0),E===1&&_.setAttribute(s,"true"),b||_.setAttribute(r,"true")}catch(A){console.error("aria-hidden: cannot operate on ",_,A)}})};return p(t),h.clear(),sm++,function(){c.forEach(function(v){var _=po.get(v)-1,y=l.get(v)-1;po.set(v,_),l.set(v,y),_||(Zc.has(v)||v.removeAttribute(r),Zc.delete(v)),y||v.removeAttribute(s)}),sm--,sm||(po=new WeakMap,po=new WeakMap,Zc=new WeakMap,Qc={})}},BM=function(e,t,s){s===void 0&&(s="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=OM(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),LM(r,o,s,"aria-hidden")):function(){return null}};function PM(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function zM(e){const[t,s]=x.useState(void 0);return Yt(()=>{if(e){s({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const l=o[0];let c,h;if("borderBoxSize"in l){const f=l.borderBoxSize,d=Array.isArray(f)?f[0]:f;c=d.inlineSize,h=d.blockSize}else c=e.offsetWidth,h=e.offsetHeight;s({width:c,height:h})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else s(void 0)},[e]),t}const jM=["top","right","bottom","left"],Nn=Math.min,Ei=Math.max,Pu=Math.round,Jc=Math.floor,ms=e=>({x:e,y:e}),HM={left:"right",right:"left",bottom:"top",top:"bottom"};function Um(e,t,s){return Ei(e,Nn(t,s))}function Fs(e,t){return typeof e=="function"?e(t):e}function Ws(e){return e.split("-")[0]}function Po(e){return e.split("-")[1]}function hg(e){return e==="x"?"y":"x"}function dg(e){return e==="y"?"height":"width"}function ds(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function fg(e){return hg(ds(e))}function IM(e,t,s){s===void 0&&(s=!1);const r=Po(e),o=fg(e),l=dg(o);let c=o==="x"?r===(s?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(c=zu(c)),[c,zu(c)]}function VM(e){const t=zu(e);return[Fm(e),t,Fm(t)]}function Fm(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const jb=["left","right"],Hb=["right","left"],UM=["top","bottom"],FM=["bottom","top"];function WM(e,t,s){switch(e){case"top":case"bottom":return s?t?Hb:jb:t?jb:Hb;case"left":case"right":return t?UM:FM;default:return[]}}function YM(e,t,s,r){const o=Po(e);let l=WM(Ws(e),s==="start",r);return o&&(l=l.map(c=>c+"-"+o),t&&(l=l.concat(l.map(Fm)))),l}function zu(e){const t=Ws(e);return HM[t]+e.slice(t.length)}function KM(e){return{top:0,right:0,bottom:0,left:0,...e}}function $x(e){return typeof e!="number"?KM(e):{top:e,right:e,bottom:e,left:e}}function ju(e){const{x:t,y:s,width:r,height:o}=e;return{width:r,height:o,top:s,left:t,right:t+r,bottom:s+o,x:t,y:s}}function Ib(e,t,s){let{reference:r,floating:o}=e;const l=ds(t),c=fg(t),h=dg(c),f=Ws(t),d=l==="y",p=r.x+r.width/2-o.width/2,v=r.y+r.height/2-o.height/2,_=r[h]/2-o[h]/2;let y;switch(f){case"top":y={x:p,y:r.y-o.height};break;case"bottom":y={x:p,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:v};break;case"left":y={x:r.x-o.width,y:v};break;default:y={x:r.x,y:r.y}}switch(Po(t)){case"start":y[c]-=_*(s&&d?-1:1);break;case"end":y[c]+=_*(s&&d?-1:1);break}return y}async function qM(e,t){var s;t===void 0&&(t={});const{x:r,y:o,platform:l,rects:c,elements:h,strategy:f}=e,{boundary:d="clippingAncestors",rootBoundary:p="viewport",elementContext:v="floating",altBoundary:_=!1,padding:y=0}=Fs(t,e),b=$x(y),E=h[_?v==="floating"?"reference":"floating":v],A=ju(await l.getClippingRect({element:(s=await(l.isElement==null?void 0:l.isElement(E)))==null||s?E:E.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(h.floating)),boundary:d,rootBoundary:p,strategy:f})),R=v==="floating"?{x:r,y:o,width:c.floating.width,height:c.floating.height}:c.reference,M=await(l.getOffsetParent==null?void 0:l.getOffsetParent(h.floating)),k=await(l.isElement==null?void 0:l.isElement(M))?await(l.getScale==null?void 0:l.getScale(M))||{x:1,y:1}:{x:1,y:1},j=ju(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:R,offsetParent:M,strategy:f}):R);return{top:(A.top-j.top+b.top)/k.y,bottom:(j.bottom-A.bottom+b.bottom)/k.y,left:(A.left-j.left+b.left)/k.x,right:(j.right-A.right+b.right)/k.x}}const GM=50,$M=async(e,t,s)=>{const{placement:r="bottom",strategy:o="absolute",middleware:l=[],platform:c}=s,h=c.detectOverflow?c:{...c,detectOverflow:qM},f=await(c.isRTL==null?void 0:c.isRTL(t));let d=await c.getElementRects({reference:e,floating:t,strategy:o}),{x:p,y:v}=Ib(d,r,f),_=r,y=0;const b={};for(let S=0;S<l.length;S++){const E=l[S];if(!E)continue;const{name:A,fn:R}=E,{x:M,y:k,data:j,reset:F}=await R({x:p,y:v,initialPlacement:r,placement:_,strategy:o,middlewareData:b,rects:d,platform:h,elements:{reference:e,floating:t}});p=M??p,v=k??v,b[A]={...b[A],...j},F&&y<GM&&(y++,typeof F=="object"&&(F.placement&&(_=F.placement),F.rects&&(d=F.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:o}):F.rects),{x:p,y:v}=Ib(d,_,f)),S=-1)}return{x:p,y:v,placement:_,strategy:o,middlewareData:b}},XM=e=>({name:"arrow",options:e,async fn(t){const{x:s,y:r,placement:o,rects:l,platform:c,elements:h,middlewareData:f}=t,{element:d,padding:p=0}=Fs(e,t)||{};if(d==null)return{};const v=$x(p),_={x:s,y:r},y=fg(o),b=dg(y),S=await c.getDimensions(d),E=y==="y",A=E?"top":"left",R=E?"bottom":"right",M=E?"clientHeight":"clientWidth",k=l.reference[b]+l.reference[y]-_[y]-l.floating[b],j=_[y]-l.reference[y],F=await(c.getOffsetParent==null?void 0:c.getOffsetParent(d));let W=F?F[M]:0;(!W||!await(c.isElement==null?void 0:c.isElement(F)))&&(W=h.floating[M]||l.floating[b]);const V=k/2-j/2,ee=W/2-S[b]/2-1,U=Nn(v[A],ee),G=Nn(v[R],ee),z=U,L=W-S[b]-G,P=W/2-S[b]/2+V,q=Um(z,P,L),T=!f.arrow&&Po(o)!=null&&P!==q&&l.reference[b]/2-(P<z?U:G)-S[b]/2<0,H=T?P<z?P-z:P-L:0;return{[y]:_[y]+H,data:{[y]:q,centerOffset:P-q-H,...T&&{alignmentOffset:H}},reset:T}}}),ZM=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var s,r;const{placement:o,middlewareData:l,rects:c,initialPlacement:h,platform:f,elements:d}=t,{mainAxis:p=!0,crossAxis:v=!0,fallbackPlacements:_,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:S=!0,...E}=Fs(e,t);if((s=l.arrow)!=null&&s.alignmentOffset)return{};const A=Ws(o),R=ds(h),M=Ws(h)===h,k=await(f.isRTL==null?void 0:f.isRTL(d.floating)),j=_||(M||!S?[zu(h)]:VM(h)),F=b!=="none";!_&&F&&j.push(...YM(h,S,b,k));const W=[h,...j],V=await f.detectOverflow(t,E),ee=[];let U=((r=l.flip)==null?void 0:r.overflows)||[];if(p&&ee.push(V[A]),v){const P=IM(o,c,k);ee.push(V[P[0]],V[P[1]])}if(U=[...U,{placement:o,overflows:ee}],!ee.every(P=>P<=0)){var G,z;const P=(((G=l.flip)==null?void 0:G.index)||0)+1,q=W[P];if(q&&(!(v==="alignment"?R!==ds(q):!1)||U.every(B=>ds(B.placement)===R?B.overflows[0]>0:!0)))return{data:{index:P,overflows:U},reset:{placement:q}};let T=(z=U.filter(H=>H.overflows[0]<=0).sort((H,B)=>H.overflows[1]-B.overflows[1])[0])==null?void 0:z.placement;if(!T)switch(y){case"bestFit":{var L;const H=(L=U.filter(B=>{if(F){const te=ds(B.placement);return te===R||te==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(te=>te>0).reduce((te,X)=>te+X,0)]).sort((B,te)=>B[1]-te[1])[0])==null?void 0:L[0];H&&(T=H);break}case"initialPlacement":T=h;break}if(o!==T)return{reset:{placement:T}}}return{}}}};function Vb(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ub(e){return jM.some(t=>e[t]>=0)}const QM=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:s,platform:r}=t,{strategy:o="referenceHidden",...l}=Fs(e,t);switch(o){case"referenceHidden":{const c=await r.detectOverflow(t,{...l,elementContext:"reference"}),h=Vb(c,s.reference);return{data:{referenceHiddenOffsets:h,referenceHidden:Ub(h)}}}case"escaped":{const c=await r.detectOverflow(t,{...l,altBoundary:!0}),h=Vb(c,s.floating);return{data:{escapedOffsets:h,escaped:Ub(h)}}}default:return{}}}}},Xx=new Set(["left","top"]);async function JM(e,t){const{placement:s,platform:r,elements:o}=e,l=await(r.isRTL==null?void 0:r.isRTL(o.floating)),c=Ws(s),h=Po(s),f=ds(s)==="y",d=Xx.has(c)?-1:1,p=l&&f?-1:1,v=Fs(t,e);let{mainAxis:_,crossAxis:y,alignmentAxis:b}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return h&&typeof b=="number"&&(y=h==="end"?b*-1:b),f?{x:y*p,y:_*d}:{x:_*d,y:y*p}}const eD=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var s,r;const{x:o,y:l,placement:c,middlewareData:h}=t,f=await JM(t,e);return c===((s=h.offset)==null?void 0:s.placement)&&(r=h.arrow)!=null&&r.alignmentOffset?{}:{x:o+f.x,y:l+f.y,data:{...f,placement:c}}}}},tD=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:s,y:r,placement:o,platform:l}=t,{mainAxis:c=!0,crossAxis:h=!1,limiter:f={fn:A=>{let{x:R,y:M}=A;return{x:R,y:M}}},...d}=Fs(e,t),p={x:s,y:r},v=await l.detectOverflow(t,d),_=ds(Ws(o)),y=hg(_);let b=p[y],S=p[_];if(c){const A=y==="y"?"top":"left",R=y==="y"?"bottom":"right",M=b+v[A],k=b-v[R];b=Um(M,b,k)}if(h){const A=_==="y"?"top":"left",R=_==="y"?"bottom":"right",M=S+v[A],k=S-v[R];S=Um(M,S,k)}const E=f.fn({...t,[y]:b,[_]:S});return{...E,data:{x:E.x-s,y:E.y-r,enabled:{[y]:c,[_]:h}}}}}},iD=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:s,y:r,placement:o,rects:l,middlewareData:c}=t,{offset:h=0,mainAxis:f=!0,crossAxis:d=!0}=Fs(e,t),p={x:s,y:r},v=ds(o),_=hg(v);let y=p[_],b=p[v];const S=Fs(h,t),E=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(f){const M=_==="y"?"height":"width",k=l.reference[_]-l.floating[M]+E.mainAxis,j=l.reference[_]+l.reference[M]-E.mainAxis;y<k?y=k:y>j&&(y=j)}if(d){var A,R;const M=_==="y"?"width":"height",k=Xx.has(Ws(o)),j=l.reference[v]-l.floating[M]+(k&&((A=c.offset)==null?void 0:A[v])||0)+(k?0:E.crossAxis),F=l.reference[v]+l.reference[M]+(k?0:((R=c.offset)==null?void 0:R[v])||0)-(k?E.crossAxis:0);b<j?b=j:b>F&&(b=F)}return{[_]:y,[v]:b}}}},sD=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var s,r;const{placement:o,rects:l,platform:c,elements:h}=t,{apply:f=()=>{},...d}=Fs(e,t),p=await c.detectOverflow(t,d),v=Ws(o),_=Po(o),y=ds(o)==="y",{width:b,height:S}=l.floating;let E,A;v==="top"||v==="bottom"?(E=v,A=_===(await(c.isRTL==null?void 0:c.isRTL(h.floating))?"start":"end")?"left":"right"):(A=v,E=_==="end"?"top":"bottom");const R=S-p.top-p.bottom,M=b-p.left-p.right,k=Nn(S-p[E],R),j=Nn(b-p[A],M),F=!t.middlewareData.shift;let W=k,V=j;if((s=t.middlewareData.shift)!=null&&s.enabled.x&&(V=M),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(W=R),F&&!_){const U=Ei(p.left,0),G=Ei(p.right,0),z=Ei(p.top,0),L=Ei(p.bottom,0);y?V=b-2*(U!==0||G!==0?U+G:Ei(p.left,p.right)):W=S-2*(z!==0||L!==0?z+L:Ei(p.top,p.bottom))}await f({...t,availableWidth:V,availableHeight:W});const ee=await c.getDimensions(h.floating);return b!==ee.width||S!==ee.height?{reset:{rects:!0}}:{}}}};function lh(){return typeof window<"u"}function zo(e){return Zx(e)?(e.nodeName||"").toLowerCase():"#document"}function Ti(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ys(e){var t;return(t=(Zx(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Zx(e){return lh()?e instanceof Node||e instanceof Ti(e).Node:!1}function es(e){return lh()?e instanceof Element||e instanceof Ti(e).Element:!1}function Ks(e){return lh()?e instanceof HTMLElement||e instanceof Ti(e).HTMLElement:!1}function Fb(e){return!lh()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ti(e).ShadowRoot}function bl(e){const{overflow:t,overflowX:s,overflowY:r,display:o}=ts(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+s)&&o!=="inline"&&o!=="contents"}function nD(e){return/^(table|td|th)$/.test(zo(e))}function ch(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const rD=/transform|translate|scale|rotate|perspective|filter/,oD=/paint|layout|strict|content/,ar=e=>!!e&&e!=="none";let nm;function mg(e){const t=es(e)?ts(e):e;return ar(t.transform)||ar(t.translate)||ar(t.scale)||ar(t.rotate)||ar(t.perspective)||!pg()&&(ar(t.backdropFilter)||ar(t.filter))||rD.test(t.willChange||"")||oD.test(t.contain||"")}function aD(e){let t=Ln(e);for(;Ks(t)&&!Ro(t);){if(mg(t))return t;if(ch(t))return null;t=Ln(t)}return null}function pg(){return nm==null&&(nm=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),nm}function Ro(e){return/^(html|body|#document)$/.test(zo(e))}function ts(e){return Ti(e).getComputedStyle(e)}function uh(e){return es(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ln(e){if(zo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Fb(e)&&e.host||ys(e);return Fb(t)?t.host:t}function Qx(e){const t=Ln(e);return Ro(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ks(t)&&bl(t)?t:Qx(t)}function cl(e,t,s){var r;t===void 0&&(t=[]),s===void 0&&(s=!0);const o=Qx(e),l=o===((r=e.ownerDocument)==null?void 0:r.body),c=Ti(o);if(l){const h=Wm(c);return t.concat(c,c.visualViewport||[],bl(o)?o:[],h&&s?cl(h):[])}else return t.concat(o,cl(o,[],s))}function Wm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Jx(e){const t=ts(e);let s=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ks(e),l=o?e.offsetWidth:s,c=o?e.offsetHeight:r,h=Pu(s)!==l||Pu(r)!==c;return h&&(s=l,r=c),{width:s,height:r,$:h}}function gg(e){return es(e)?e:e.contextElement}function ko(e){const t=gg(e);if(!Ks(t))return ms(1);const s=t.getBoundingClientRect(),{width:r,height:o,$:l}=Jx(t);let c=(l?Pu(s.width):s.width)/r,h=(l?Pu(s.height):s.height)/o;return(!c||!Number.isFinite(c))&&(c=1),(!h||!Number.isFinite(h))&&(h=1),{x:c,y:h}}const lD=ms(0);function e1(e){const t=Ti(e);return!pg()||!t.visualViewport?lD:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function cD(e,t,s){return t===void 0&&(t=!1),!s||t&&s!==Ti(e)?!1:t}function br(e,t,s,r){t===void 0&&(t=!1),s===void 0&&(s=!1);const o=e.getBoundingClientRect(),l=gg(e);let c=ms(1);t&&(r?es(r)&&(c=ko(r)):c=ko(e));const h=cD(l,s,r)?e1(l):ms(0);let f=(o.left+h.x)/c.x,d=(o.top+h.y)/c.y,p=o.width/c.x,v=o.height/c.y;if(l){const _=Ti(l),y=r&&es(r)?Ti(r):r;let b=_,S=Wm(b);for(;S&&r&&y!==b;){const E=ko(S),A=S.getBoundingClientRect(),R=ts(S),M=A.left+(S.clientLeft+parseFloat(R.paddingLeft))*E.x,k=A.top+(S.clientTop+parseFloat(R.paddingTop))*E.y;f*=E.x,d*=E.y,p*=E.x,v*=E.y,f+=M,d+=k,b=Ti(S),S=Wm(b)}}return ju({width:p,height:v,x:f,y:d})}function hh(e,t){const s=uh(e).scrollLeft;return t?t.left+s:br(ys(e)).left+s}function t1(e,t){const s=e.getBoundingClientRect(),r=s.left+t.scrollLeft-hh(e,s),o=s.top+t.scrollTop;return{x:r,y:o}}function uD(e){let{elements:t,rect:s,offsetParent:r,strategy:o}=e;const l=o==="fixed",c=ys(r),h=t?ch(t.floating):!1;if(r===c||h&&l)return s;let f={scrollLeft:0,scrollTop:0},d=ms(1);const p=ms(0),v=Ks(r);if((v||!v&&!l)&&((zo(r)!=="body"||bl(c))&&(f=uh(r)),v)){const y=br(r);d=ko(r),p.x=y.x+r.clientLeft,p.y=y.y+r.clientTop}const _=c&&!v&&!l?t1(c,f):ms(0);return{width:s.width*d.x,height:s.height*d.y,x:s.x*d.x-f.scrollLeft*d.x+p.x+_.x,y:s.y*d.y-f.scrollTop*d.y+p.y+_.y}}function hD(e){return Array.from(e.getClientRects())}function dD(e){const t=ys(e),s=uh(e),r=e.ownerDocument.body,o=Ei(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),l=Ei(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-s.scrollLeft+hh(e);const h=-s.scrollTop;return ts(r).direction==="rtl"&&(c+=Ei(t.clientWidth,r.clientWidth)-o),{width:o,height:l,x:c,y:h}}const Wb=25;function fD(e,t){const s=Ti(e),r=ys(e),o=s.visualViewport;let l=r.clientWidth,c=r.clientHeight,h=0,f=0;if(o){l=o.width,c=o.height;const p=pg();(!p||p&&t==="fixed")&&(h=o.offsetLeft,f=o.offsetTop)}const d=hh(r);if(d<=0){const p=r.ownerDocument,v=p.body,_=getComputedStyle(v),y=p.compatMode==="CSS1Compat"&&parseFloat(_.marginLeft)+parseFloat(_.marginRight)||0,b=Math.abs(r.clientWidth-v.clientWidth-y);b<=Wb&&(l-=b)}else d<=Wb&&(l+=d);return{width:l,height:c,x:h,y:f}}function mD(e,t){const s=br(e,!0,t==="fixed"),r=s.top+e.clientTop,o=s.left+e.clientLeft,l=Ks(e)?ko(e):ms(1),c=e.clientWidth*l.x,h=e.clientHeight*l.y,f=o*l.x,d=r*l.y;return{width:c,height:h,x:f,y:d}}function Yb(e,t,s){let r;if(t==="viewport")r=fD(e,s);else if(t==="document")r=dD(ys(e));else if(es(t))r=mD(t,s);else{const o=e1(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ju(r)}function i1(e,t){const s=Ln(e);return s===t||!es(s)||Ro(s)?!1:ts(s).position==="fixed"||i1(s,t)}function pD(e,t){const s=t.get(e);if(s)return s;let r=cl(e,[],!1).filter(h=>es(h)&&zo(h)!=="body"),o=null;const l=ts(e).position==="fixed";let c=l?Ln(e):e;for(;es(c)&&!Ro(c);){const h=ts(c),f=mg(c);!f&&h.position==="fixed"&&(o=null),(l?!f&&!o:!f&&h.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||bl(c)&&!f&&i1(e,c))?r=r.filter(p=>p!==c):o=h,c=Ln(c)}return t.set(e,r),r}function gD(e){let{element:t,boundary:s,rootBoundary:r,strategy:o}=e;const c=[...s==="clippingAncestors"?ch(t)?[]:pD(t,this._c):[].concat(s),r],h=Yb(t,c[0],o);let f=h.top,d=h.right,p=h.bottom,v=h.left;for(let _=1;_<c.length;_++){const y=Yb(t,c[_],o);f=Ei(y.top,f),d=Nn(y.right,d),p=Nn(y.bottom,p),v=Ei(y.left,v)}return{width:d-v,height:p-f,x:v,y:f}}function vD(e){const{width:t,height:s}=Jx(e);return{width:t,height:s}}function _D(e,t,s){const r=Ks(t),o=ys(t),l=s==="fixed",c=br(e,!0,l,t);let h={scrollLeft:0,scrollTop:0};const f=ms(0);function d(){f.x=hh(o)}if(r||!r&&!l)if((zo(t)!=="body"||bl(o))&&(h=uh(t)),r){const y=br(t,!0,l,t);f.x=y.x+t.clientLeft,f.y=y.y+t.clientTop}else o&&d();l&&!r&&o&&d();const p=o&&!r&&!l?t1(o,h):ms(0),v=c.left+h.scrollLeft-f.x-p.x,_=c.top+h.scrollTop-f.y-p.y;return{x:v,y:_,width:c.width,height:c.height}}function rm(e){return ts(e).position==="static"}function Kb(e,t){if(!Ks(e)||ts(e).position==="fixed")return null;if(t)return t(e);let s=e.offsetParent;return ys(e)===s&&(s=s.ownerDocument.body),s}function s1(e,t){const s=Ti(e);if(ch(e))return s;if(!Ks(e)){let o=Ln(e);for(;o&&!Ro(o);){if(es(o)&&!rm(o))return o;o=Ln(o)}return s}let r=Kb(e,t);for(;r&&nD(r)&&rm(r);)r=Kb(r,t);return r&&Ro(r)&&rm(r)&&!mg(r)?s:r||aD(e)||s}const yD=async function(e){const t=this.getOffsetParent||s1,s=this.getDimensions,r=await s(e.floating);return{reference:_D(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function bD(e){return ts(e).direction==="rtl"}const SD={convertOffsetParentRelativeRectToViewportRelativeRect:uD,getDocumentElement:ys,getClippingRect:gD,getOffsetParent:s1,getElementRects:yD,getClientRects:hD,getDimensions:vD,getScale:ko,isElement:es,isRTL:bD};function n1(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function wD(e,t){let s=null,r;const o=ys(e);function l(){var h;clearTimeout(r),(h=s)==null||h.disconnect(),s=null}function c(h,f){h===void 0&&(h=!1),f===void 0&&(f=1),l();const d=e.getBoundingClientRect(),{left:p,top:v,width:_,height:y}=d;if(h||t(),!_||!y)return;const b=Jc(v),S=Jc(o.clientWidth-(p+_)),E=Jc(o.clientHeight-(v+y)),A=Jc(p),M={rootMargin:-b+"px "+-S+"px "+-E+"px "+-A+"px",threshold:Ei(0,Nn(1,f))||1};let k=!0;function j(F){const W=F[0].intersectionRatio;if(W!==f){if(!k)return c();W?c(!1,W):r=setTimeout(()=>{c(!1,1e-7)},1e3)}W===1&&!n1(d,e.getBoundingClientRect())&&c(),k=!1}try{s=new IntersectionObserver(j,{...M,root:o.ownerDocument})}catch{s=new IntersectionObserver(j,M)}s.observe(e)}return c(!0),l}function xD(e,t,s,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:h=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,d=gg(e),p=o||l?[...d?cl(d):[],...t?cl(t):[]]:[];p.forEach(A=>{o&&A.addEventListener("scroll",s,{passive:!0}),l&&A.addEventListener("resize",s)});const v=d&&h?wD(d,s):null;let _=-1,y=null;c&&(y=new ResizeObserver(A=>{let[R]=A;R&&R.target===d&&y&&t&&(y.unobserve(t),cancelAnimationFrame(_),_=requestAnimationFrame(()=>{var M;(M=y)==null||M.observe(t)})),s()}),d&&!f&&y.observe(d),t&&y.observe(t));let b,S=f?br(e):null;f&&E();function E(){const A=br(e);S&&!n1(S,A)&&s(),S=A,b=requestAnimationFrame(E)}return s(),()=>{var A;p.forEach(R=>{o&&R.removeEventListener("scroll",s),l&&R.removeEventListener("resize",s)}),v?.(),(A=y)==null||A.disconnect(),y=null,f&&cancelAnimationFrame(b)}}const CD=eD,ED=tD,TD=ZM,kD=sD,AD=QM,qb=XM,RD=iD,MD=(e,t,s)=>{const r=new Map,o={platform:SD,...s},l={...o.platform,_c:r};return $M(e,t,{...o,platform:l})};var DD=typeof document<"u",OD=function(){},vu=DD?x.useLayoutEffect:OD;function Hu(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 s,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(s=e.length,s!==t.length)return!1;for(r=s;r--!==0;)if(!Hu(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),s=o.length,s!==Object.keys(t).length)return!1;for(r=s;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=s;r--!==0;){const l=o[r];if(!(l==="_owner"&&e.$$typeof)&&!Hu(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function r1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Gb(e,t){const s=r1(e);return Math.round(t*s)/s}function om(e){const t=x.useRef(e);return vu(()=>{t.current=e}),t}function ND(e){e===void 0&&(e={});const{placement:t="bottom",strategy:s="absolute",middleware:r=[],platform:o,elements:{reference:l,floating:c}={},transform:h=!0,whileElementsMounted:f,open:d}=e,[p,v]=x.useState({x:0,y:0,strategy:s,placement:t,middlewareData:{},isPositioned:!1}),[_,y]=x.useState(r);Hu(_,r)||y(r);const[b,S]=x.useState(null),[E,A]=x.useState(null),R=x.useCallback(B=>{B!==F.current&&(F.current=B,S(B))},[]),M=x.useCallback(B=>{B!==W.current&&(W.current=B,A(B))},[]),k=l||b,j=c||E,F=x.useRef(null),W=x.useRef(null),V=x.useRef(p),ee=f!=null,U=om(f),G=om(o),z=om(d),L=x.useCallback(()=>{if(!F.current||!W.current)return;const B={placement:t,strategy:s,middleware:_};G.current&&(B.platform=G.current),MD(F.current,W.current,B).then(te=>{const X={...te,isPositioned:z.current!==!1};P.current&&!Hu(V.current,X)&&(V.current=X,yl.flushSync(()=>{v(X)}))})},[_,t,s,G,z]);vu(()=>{d===!1&&V.current.isPositioned&&(V.current.isPositioned=!1,v(B=>({...B,isPositioned:!1})))},[d]);const P=x.useRef(!1);vu(()=>(P.current=!0,()=>{P.current=!1}),[]),vu(()=>{if(k&&(F.current=k),j&&(W.current=j),k&&j){if(U.current)return U.current(k,j,L);L()}},[k,j,L,U,ee]);const q=x.useMemo(()=>({reference:F,floating:W,setReference:R,setFloating:M}),[R,M]),T=x.useMemo(()=>({reference:k,floating:j}),[k,j]),H=x.useMemo(()=>{const B={position:s,left:0,top:0};if(!T.floating)return B;const te=Gb(T.floating,p.x),X=Gb(T.floating,p.y);return h?{...B,transform:"translate("+te+"px, "+X+"px)",...r1(T.floating)>=1.5&&{willChange:"transform"}}:{position:s,left:te,top:X}},[s,h,T.floating,p.x,p.y]);return x.useMemo(()=>({...p,update:L,refs:q,elements:T,floatingStyles:H}),[p,L,q,T,H])}const LD=e=>{function t(s){return{}.hasOwnProperty.call(s,"current")}return{name:"arrow",options:e,fn(s){const{element:r,padding:o}=typeof e=="function"?e(s):e;return r&&t(r)?r.current!=null?qb({element:r.current,padding:o}).fn(s):{}:r?qb({element:r,padding:o}).fn(s):{}}}},BD=(e,t)=>{const s=CD(e);return{name:s.name,fn:s.fn,options:[e,t]}},PD=(e,t)=>{const s=ED(e);return{name:s.name,fn:s.fn,options:[e,t]}},zD=(e,t)=>({fn:RD(e).fn,options:[e,t]}),jD=(e,t)=>{const s=TD(e);return{name:s.name,fn:s.fn,options:[e,t]}},HD=(e,t)=>{const s=kD(e);return{name:s.name,fn:s.fn,options:[e,t]}},ID=(e,t)=>{const s=AD(e);return{name:s.name,fn:s.fn,options:[e,t]}},VD=(e,t)=>{const s=LD(e);return{name:s.name,fn:s.fn,options:[e,t]}};var UD="Arrow",o1=x.forwardRef((e,t)=>{const{children:s,width:r=10,height:o=5,...l}=e;return C.jsx(Ie.svg,{...l,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?s:C.jsx("polygon",{points:"0,0 30,0 15,10"})})});o1.displayName=UD;var FD=o1,vg="Popper",[a1,dh]=Er(vg),[WD,l1]=a1(vg),c1=e=>{const{__scopePopper:t,children:s}=e,[r,o]=x.useState(null);return C.jsx(WD,{scope:t,anchor:r,onAnchorChange:o,children:s})};c1.displayName=vg;var u1="PopperAnchor",h1=x.forwardRef((e,t)=>{const{__scopePopper:s,virtualRef:r,...o}=e,l=l1(u1,s),c=x.useRef(null),h=Je(t,c),f=x.useRef(null);return x.useEffect(()=>{const d=f.current;f.current=r?.current||c.current,d!==f.current&&l.onAnchorChange(f.current)}),r?null:C.jsx(Ie.div,{...o,ref:h})});h1.displayName=u1;var _g="PopperContent",[YD,KD]=a1(_g),d1=x.forwardRef((e,t)=>{const{__scopePopper:s,side:r="bottom",sideOffset:o=0,align:l="center",alignOffset:c=0,arrowPadding:h=0,avoidCollisions:f=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:v="partial",hideWhenDetached:_=!1,updatePositionStrategy:y="optimized",onPlaced:b,...S}=e,E=l1(_g,s),[A,R]=x.useState(null),M=Je(t,K=>R(K)),[k,j]=x.useState(null),F=zM(k),W=F?.width??0,V=F?.height??0,ee=r+(l!=="center"?"-"+l:""),U=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},G=Array.isArray(d)?d:[d],z=G.length>0,L={padding:U,boundary:G.filter(GD),altBoundary:z},{refs:P,floatingStyles:q,placement:T,isPositioned:H,middlewareData:B}=ND({strategy:"fixed",placement:ee,whileElementsMounted:(...K)=>xD(...K,{animationFrame:y==="always"}),elements:{reference:E.anchor},middleware:[BD({mainAxis:o+V,alignmentAxis:c}),f&&PD({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?zD():void 0,...L}),f&&jD({...L}),HD({...L,apply:({elements:K,rects:J,availableWidth:ie,availableHeight:ue})=>{const{width:me,height:_e}=J.reference,xe=K.floating.style;xe.setProperty("--radix-popper-available-width",`${ie}px`),xe.setProperty("--radix-popper-available-height",`${ue}px`),xe.setProperty("--radix-popper-anchor-width",`${me}px`),xe.setProperty("--radix-popper-anchor-height",`${_e}px`)}}),k&&VD({element:k,padding:h}),$D({arrowWidth:W,arrowHeight:V}),_&&ID({strategy:"referenceHidden",...L})]}),[te,X]=p1(T),N=Jt(b);Yt(()=>{H&&N?.()},[H,N]);const Z=B.arrow?.x,ne=B.arrow?.y,I=B.arrow?.centerOffset!==0,[O,Y]=x.useState();return Yt(()=>{A&&Y(window.getComputedStyle(A).zIndex)},[A]),C.jsx("div",{ref:P.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:H?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:O,"--radix-popper-transform-origin":[B.transformOrigin?.x,B.transformOrigin?.y].join(" "),...B.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:C.jsx(YD,{scope:s,placedSide:te,onArrowChange:j,arrowX:Z,arrowY:ne,shouldHideArrow:I,children:C.jsx(Ie.div,{"data-side":te,"data-align":X,...S,ref:M,style:{...S.style,animation:H?void 0:"none"}})})})});d1.displayName=_g;var f1="PopperArrow",qD={top:"bottom",right:"left",bottom:"top",left:"right"},m1=x.forwardRef(function(t,s){const{__scopePopper:r,...o}=t,l=KD(f1,r),c=qD[l.placedSide];return C.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[c]: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:C.jsx(FD,{...o,ref:s,style:{...o.style,display:"block"}})})});m1.displayName=f1;function GD(e){return e!==null}var $D=e=>({name:"transformOrigin",options:e,fn(t){const{placement:s,rects:r,middlewareData:o}=t,c=o.arrow?.centerOffset!==0,h=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[d,p]=p1(s),v={start:"0%",center:"50%",end:"100%"}[p],_=(o.arrow?.x??0)+h/2,y=(o.arrow?.y??0)+f/2;let b="",S="";return d==="bottom"?(b=c?v:`${_}px`,S=`${-f}px`):d==="top"?(b=c?v:`${_}px`,S=`${r.floating.height+f}px`):d==="right"?(b=`${-f}px`,S=c?v:`${y}px`):d==="left"&&(b=`${r.floating.width+f}px`,S=c?v:`${y}px`),{data:{x:b,y:S}}}});function p1(e){const[t,s="center"]=e.split("-");return[t,s]}var g1=c1,v1=h1,_1=d1,y1=m1,am="rovingFocusGroup.onEntryFocus",XD={bubbles:!1,cancelable:!0},Sl="RovingFocusGroup",[Ym,b1,ZD]=Bx(Sl),[QD,S1]=Er(Sl,[ZD]),[JD,eO]=QD(Sl),w1=x.forwardRef((e,t)=>C.jsx(Ym.Provider,{scope:e.__scopeRovingFocusGroup,children:C.jsx(Ym.Slot,{scope:e.__scopeRovingFocusGroup,children:C.jsx(tO,{...e,ref:t})})}));w1.displayName=Sl;var tO=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:s,orientation:r,loop:o=!1,dir:l,currentTabStopId:c,defaultCurrentTabStopId:h,onCurrentTabStopIdChange:f,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...v}=e,_=x.useRef(null),y=Je(t,_),b=oh(l),[S,E]=ll({prop:c,defaultProp:h??null,onChange:f,caller:Sl}),[A,R]=x.useState(!1),M=Jt(d),k=b1(s),j=x.useRef(!1),[F,W]=x.useState(0);return x.useEffect(()=>{const V=_.current;if(V)return V.addEventListener(am,M),()=>V.removeEventListener(am,M)},[M]),C.jsx(JD,{scope:s,orientation:r,dir:b,loop:o,currentTabStopId:S,onItemFocus:x.useCallback(V=>E(V),[E]),onItemShiftTab:x.useCallback(()=>R(!0),[]),onFocusableItemAdd:x.useCallback(()=>W(V=>V+1),[]),onFocusableItemRemove:x.useCallback(()=>W(V=>V-1),[]),children:C.jsx(Ie.div,{tabIndex:A||F===0?-1:0,"data-orientation":r,...v,ref:y,style:{outline:"none",...e.style},onMouseDown:Me(e.onMouseDown,()=>{j.current=!0}),onFocus:Me(e.onFocus,V=>{const ee=!j.current;if(V.target===V.currentTarget&&ee&&!A){const U=new CustomEvent(am,XD);if(V.currentTarget.dispatchEvent(U),!U.defaultPrevented){const G=k().filter(T=>T.focusable),z=G.find(T=>T.active),L=G.find(T=>T.id===S),q=[z,L,...G].filter(Boolean).map(T=>T.ref.current);E1(q,p)}}j.current=!1}),onBlur:Me(e.onBlur,()=>R(!1))})})}),x1="RovingFocusGroupItem",C1=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:s,focusable:r=!0,active:o=!1,tabStopId:l,children:c,...h}=e,f=Bo(),d=l||f,p=eO(x1,s),v=p.currentTabStopId===d,_=b1(s),{onFocusableItemAdd:y,onFocusableItemRemove:b,currentTabStopId:S}=p;return x.useEffect(()=>{if(r)return y(),()=>b()},[r,y,b]),C.jsx(Ym.ItemSlot,{scope:s,id:d,focusable:r,active:o,children:C.jsx(Ie.span,{tabIndex:v?0:-1,"data-orientation":p.orientation,...h,ref:t,onMouseDown:Me(e.onMouseDown,E=>{r?p.onItemFocus(d):E.preventDefault()}),onFocus:Me(e.onFocus,()=>p.onItemFocus(d)),onKeyDown:Me(e.onKeyDown,E=>{if(E.key==="Tab"&&E.shiftKey){p.onItemShiftTab();return}if(E.target!==E.currentTarget)return;const A=nO(E,p.orientation,p.dir);if(A!==void 0){if(E.metaKey||E.ctrlKey||E.altKey||E.shiftKey)return;E.preventDefault();let M=_().filter(k=>k.focusable).map(k=>k.ref.current);if(A==="last")M.reverse();else if(A==="prev"||A==="next"){A==="prev"&&M.reverse();const k=M.indexOf(E.currentTarget);M=p.loop?rO(M,k+1):M.slice(k+1)}setTimeout(()=>E1(M))}}),children:typeof c=="function"?c({isCurrentTabStop:v,hasTabStop:S!=null}):c})})});C1.displayName=x1;var iO={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function sO(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function nO(e,t,s){const r=sO(e.key,s);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return iO[r]}function E1(e,t=!1){const s=document.activeElement;for(const r of e)if(r===s||(r.focus({preventScroll:t}),document.activeElement!==s))return}function rO(e,t){return e.map((s,r)=>e[(t+r)%e.length])}var oO=w1,aO=C1;function Km(e,[t,s]){return Math.min(s,Math.max(t,e))}function lO(e,t){return x.useReducer((s,r)=>t[s][r]??s,e)}var yg="ScrollArea",[T1]=Er(yg),[cO,Ki]=T1(yg),k1=x.forwardRef((e,t)=>{const{__scopeScrollArea:s,type:r="hover",dir:o,scrollHideDelay:l=600,...c}=e,[h,f]=x.useState(null),[d,p]=x.useState(null),[v,_]=x.useState(null),[y,b]=x.useState(null),[S,E]=x.useState(null),[A,R]=x.useState(0),[M,k]=x.useState(0),[j,F]=x.useState(!1),[W,V]=x.useState(!1),ee=Je(t,G=>f(G)),U=oh(o);return C.jsx(cO,{scope:s,type:r,dir:U,scrollHideDelay:l,scrollArea:h,viewport:d,onViewportChange:p,content:v,onContentChange:_,scrollbarX:y,onScrollbarXChange:b,scrollbarXEnabled:j,onScrollbarXEnabledChange:F,scrollbarY:S,onScrollbarYChange:E,scrollbarYEnabled:W,onScrollbarYEnabledChange:V,onCornerWidthChange:R,onCornerHeightChange:k,children:C.jsx(Ie.div,{dir:U,...c,ref:ee,style:{position:"relative","--radix-scroll-area-corner-width":A+"px","--radix-scroll-area-corner-height":M+"px",...e.style}})})});k1.displayName=yg;var A1="ScrollAreaViewport",R1=x.forwardRef((e,t)=>{const{__scopeScrollArea:s,children:r,nonce:o,...l}=e,c=Ki(A1,s),h=x.useRef(null),f=Je(t,h,c.onViewportChange);return C.jsxs(C.Fragment,{children:[C.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),C.jsx(Ie.div,{"data-radix-scroll-area-viewport":"",...l,ref:f,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...e.style},children:C.jsx("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});R1.displayName=A1;var bs="ScrollAreaScrollbar",M1=x.forwardRef((e,t)=>{const{forceMount:s,...r}=e,o=Ki(bs,e.__scopeScrollArea),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:c}=o,h=e.orientation==="horizontal";return x.useEffect(()=>(h?l(!0):c(!0),()=>{h?l(!1):c(!1)}),[h,l,c]),o.type==="hover"?C.jsx(uO,{...r,ref:t,forceMount:s}):o.type==="scroll"?C.jsx(hO,{...r,ref:t,forceMount:s}):o.type==="auto"?C.jsx(D1,{...r,ref:t,forceMount:s}):o.type==="always"?C.jsx(bg,{...r,ref:t}):null});M1.displayName=bs;var uO=x.forwardRef((e,t)=>{const{forceMount:s,...r}=e,o=Ki(bs,e.__scopeScrollArea),[l,c]=x.useState(!1);return x.useEffect(()=>{const h=o.scrollArea;let f=0;if(h){const d=()=>{window.clearTimeout(f),c(!0)},p=()=>{f=window.setTimeout(()=>c(!1),o.scrollHideDelay)};return h.addEventListener("pointerenter",d),h.addEventListener("pointerleave",p),()=>{window.clearTimeout(f),h.removeEventListener("pointerenter",d),h.removeEventListener("pointerleave",p)}}},[o.scrollArea,o.scrollHideDelay]),C.jsx(Pn,{present:s||l,children:C.jsx(D1,{"data-state":l?"visible":"hidden",...r,ref:t})})}),hO=x.forwardRef((e,t)=>{const{forceMount:s,...r}=e,o=Ki(bs,e.__scopeScrollArea),l=e.orientation==="horizontal",c=mh(()=>f("SCROLL_END"),100),[h,f]=lO("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return x.useEffect(()=>{if(h==="idle"){const d=window.setTimeout(()=>f("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(d)}},[h,o.scrollHideDelay,f]),x.useEffect(()=>{const d=o.viewport,p=l?"scrollLeft":"scrollTop";if(d){let v=d[p];const _=()=>{const y=d[p];v!==y&&(f("SCROLL"),c()),v=y};return d.addEventListener("scroll",_),()=>d.removeEventListener("scroll",_)}},[o.viewport,l,f,c]),C.jsx(Pn,{present:s||h!=="hidden",children:C.jsx(bg,{"data-state":h==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Me(e.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:Me(e.onPointerLeave,()=>f("POINTER_LEAVE"))})})}),D1=x.forwardRef((e,t)=>{const s=Ki(bs,e.__scopeScrollArea),{forceMount:r,...o}=e,[l,c]=x.useState(!1),h=e.orientation==="horizontal",f=mh(()=>{if(s.viewport){const d=s.viewport.offsetWidth<s.viewport.scrollWidth,p=s.viewport.offsetHeight<s.viewport.scrollHeight;c(h?d:p)}},10);return Mo(s.viewport,f),Mo(s.content,f),C.jsx(Pn,{present:r||l,children:C.jsx(bg,{"data-state":l?"visible":"hidden",...o,ref:t})})}),bg=x.forwardRef((e,t)=>{const{orientation:s="vertical",...r}=e,o=Ki(bs,e.__scopeScrollArea),l=x.useRef(null),c=x.useRef(0),[h,f]=x.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=P1(h.viewport,h.content),p={...r,sizes:h,onSizesChange:f,hasThumb:d>0&&d<1,onThumbChange:_=>l.current=_,onThumbPointerUp:()=>c.current=0,onThumbPointerDown:_=>c.current=_};function v(_,y){return vO(_,c.current,h,y)}return s==="horizontal"?C.jsx(dO,{...p,ref:t,onThumbPositionChange:()=>{if(o.viewport&&l.current){const _=o.viewport.scrollLeft,y=$b(_,h,o.dir);l.current.style.transform=`translate3d(${y}px, 0, 0)`}},onWheelScroll:_=>{o.viewport&&(o.viewport.scrollLeft=_)},onDragScroll:_=>{o.viewport&&(o.viewport.scrollLeft=v(_,o.dir))}}):s==="vertical"?C.jsx(fO,{...p,ref:t,onThumbPositionChange:()=>{if(o.viewport&&l.current){const _=o.viewport.scrollTop,y=$b(_,h);l.current.style.transform=`translate3d(0, ${y}px, 0)`}},onWheelScroll:_=>{o.viewport&&(o.viewport.scrollTop=_)},onDragScroll:_=>{o.viewport&&(o.viewport.scrollTop=v(_))}}):null}),dO=x.forwardRef((e,t)=>{const{sizes:s,onSizesChange:r,...o}=e,l=Ki(bs,e.__scopeScrollArea),[c,h]=x.useState(),f=x.useRef(null),d=Je(t,f,l.onScrollbarXChange);return x.useEffect(()=>{f.current&&h(getComputedStyle(f.current))},[f]),C.jsx(N1,{"data-orientation":"horizontal",...o,ref:d,sizes:s,style:{bottom:0,left:l.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:l.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":fh(s)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.x),onDragScroll:p=>e.onDragScroll(p.x),onWheelScroll:(p,v)=>{if(l.viewport){const _=l.viewport.scrollLeft+p.deltaX;e.onWheelScroll(_),j1(_,v)&&p.preventDefault()}},onResize:()=>{f.current&&l.viewport&&c&&r({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:Vu(c.paddingLeft),paddingEnd:Vu(c.paddingRight)}})}})}),fO=x.forwardRef((e,t)=>{const{sizes:s,onSizesChange:r,...o}=e,l=Ki(bs,e.__scopeScrollArea),[c,h]=x.useState(),f=x.useRef(null),d=Je(t,f,l.onScrollbarYChange);return x.useEffect(()=>{f.current&&h(getComputedStyle(f.current))},[f]),C.jsx(N1,{"data-orientation":"vertical",...o,ref:d,sizes:s,style:{top:0,right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":fh(s)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.y),onDragScroll:p=>e.onDragScroll(p.y),onWheelScroll:(p,v)=>{if(l.viewport){const _=l.viewport.scrollTop+p.deltaY;e.onWheelScroll(_),j1(_,v)&&p.preventDefault()}},onResize:()=>{f.current&&l.viewport&&c&&r({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:Vu(c.paddingTop),paddingEnd:Vu(c.paddingBottom)}})}})}),[mO,O1]=T1(bs),N1=x.forwardRef((e,t)=>{const{__scopeScrollArea:s,sizes:r,hasThumb:o,onThumbChange:l,onThumbPointerUp:c,onThumbPointerDown:h,onThumbPositionChange:f,onDragScroll:d,onWheelScroll:p,onResize:v,..._}=e,y=Ki(bs,s),[b,S]=x.useState(null),E=Je(t,ee=>S(ee)),A=x.useRef(null),R=x.useRef(""),M=y.viewport,k=r.content-r.viewport,j=Jt(p),F=Jt(f),W=mh(v,10);function V(ee){if(A.current){const U=ee.clientX-A.current.left,G=ee.clientY-A.current.top;d({x:U,y:G})}}return x.useEffect(()=>{const ee=U=>{const G=U.target;b?.contains(G)&&j(U,k)};return document.addEventListener("wheel",ee,{passive:!1}),()=>document.removeEventListener("wheel",ee,{passive:!1})},[M,b,k,j]),x.useEffect(F,[r,F]),Mo(b,W),Mo(y.content,W),C.jsx(mO,{scope:s,scrollbar:b,hasThumb:o,onThumbChange:Jt(l),onThumbPointerUp:Jt(c),onThumbPositionChange:F,onThumbPointerDown:Jt(h),children:C.jsx(Ie.div,{..._,ref:E,style:{position:"absolute",..._.style},onPointerDown:Me(e.onPointerDown,ee=>{ee.button===0&&(ee.target.setPointerCapture(ee.pointerId),A.current=b.getBoundingClientRect(),R.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",y.viewport&&(y.viewport.style.scrollBehavior="auto"),V(ee))}),onPointerMove:Me(e.onPointerMove,V),onPointerUp:Me(e.onPointerUp,ee=>{const U=ee.target;U.hasPointerCapture(ee.pointerId)&&U.releasePointerCapture(ee.pointerId),document.body.style.webkitUserSelect=R.current,y.viewport&&(y.viewport.style.scrollBehavior=""),A.current=null})})})}),Iu="ScrollAreaThumb",L1=x.forwardRef((e,t)=>{const{forceMount:s,...r}=e,o=O1(Iu,e.__scopeScrollArea);return C.jsx(Pn,{present:s||o.hasThumb,children:C.jsx(pO,{ref:t,...r})})}),pO=x.forwardRef((e,t)=>{const{__scopeScrollArea:s,style:r,...o}=e,l=Ki(Iu,s),c=O1(Iu,s),{onThumbPositionChange:h}=c,f=Je(t,v=>c.onThumbChange(v)),d=x.useRef(void 0),p=mh(()=>{d.current&&(d.current(),d.current=void 0)},100);return x.useEffect(()=>{const v=l.viewport;if(v){const _=()=>{if(p(),!d.current){const y=_O(v,h);d.current=y,h()}};return h(),v.addEventListener("scroll",_),()=>v.removeEventListener("scroll",_)}},[l.viewport,p,h]),C.jsx(Ie.div,{"data-state":c.hasThumb?"visible":"hidden",...o,ref:f,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Me(e.onPointerDownCapture,v=>{const y=v.target.getBoundingClientRect(),b=v.clientX-y.left,S=v.clientY-y.top;c.onThumbPointerDown({x:b,y:S})}),onPointerUp:Me(e.onPointerUp,c.onThumbPointerUp)})});L1.displayName=Iu;var Sg="ScrollAreaCorner",B1=x.forwardRef((e,t)=>{const s=Ki(Sg,e.__scopeScrollArea),r=!!(s.scrollbarX&&s.scrollbarY);return s.type!=="scroll"&&r?C.jsx(gO,{...e,ref:t}):null});B1.displayName=Sg;var gO=x.forwardRef((e,t)=>{const{__scopeScrollArea:s,...r}=e,o=Ki(Sg,s),[l,c]=x.useState(0),[h,f]=x.useState(0),d=!!(l&&h);return Mo(o.scrollbarX,()=>{const p=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(p),f(p)}),Mo(o.scrollbarY,()=>{const p=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(p),c(p)}),d?C.jsx(Ie.div,{...r,ref:t,style:{width:l,height:h,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Vu(e){return e?parseInt(e,10):0}function P1(e,t){const s=e/t;return isNaN(s)?0:s}function fh(e){const t=P1(e.viewport,e.content),s=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-s)*t;return Math.max(r,18)}function vO(e,t,s,r="ltr"){const o=fh(s),l=o/2,c=t||l,h=o-c,f=s.scrollbar.paddingStart+c,d=s.scrollbar.size-s.scrollbar.paddingEnd-h,p=s.content-s.viewport,v=r==="ltr"?[0,p]:[p*-1,0];return z1([f,d],v)(e)}function $b(e,t,s="ltr"){const r=fh(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,l=t.scrollbar.size-o,c=t.content-t.viewport,h=l-r,f=s==="ltr"?[0,c]:[c*-1,0],d=Km(e,f);return z1([0,c],[0,h])(d)}function z1(e,t){return s=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(s-e[0])}}function j1(e,t){return e>0&&e<t}var _O=(e,t=()=>{})=>{let s={left:e.scrollLeft,top:e.scrollTop},r=0;return(function o(){const l={left:e.scrollLeft,top:e.scrollTop},c=s.left!==l.left,h=s.top!==l.top;(c||h)&&t(),s=l,r=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(r)};function mh(e,t){const s=Jt(e),r=x.useRef(0);return x.useEffect(()=>()=>window.clearTimeout(r.current),[]),x.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(s,t)},[s,t])}function Mo(e,t){const s=Jt(t);Yt(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(s)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,s])}var yO=k1,bO=R1,SO=B1,wO=[" ","Enter","ArrowUp","ArrowDown"],xO=[" ","Enter"],Sr="Select",[ph,gh,CO]=Bx(Sr),[jo]=Er(Sr,[CO,dh]),vh=dh(),[EO,zn]=jo(Sr),[TO,kO]=jo(Sr),H1=e=>{const{__scopeSelect:t,children:s,open:r,defaultOpen:o,onOpenChange:l,value:c,defaultValue:h,onValueChange:f,dir:d,name:p,autoComplete:v,disabled:_,required:y,form:b}=e,S=vh(t),[E,A]=x.useState(null),[R,M]=x.useState(null),[k,j]=x.useState(!1),F=oh(d),[W,V]=ll({prop:r,defaultProp:o??!1,onChange:l,caller:Sr}),[ee,U]=ll({prop:c,defaultProp:h,onChange:f,caller:Sr}),G=x.useRef(null),z=E?b||!!E.closest("form"):!0,[L,P]=x.useState(new Set),q=Array.from(L).map(T=>T.props.value).join(";");return C.jsx(g1,{...S,children:C.jsxs(EO,{required:y,scope:t,trigger:E,onTriggerChange:A,valueNode:R,onValueNodeChange:M,valueNodeHasChildren:k,onValueNodeHasChildrenChange:j,contentId:Bo(),value:ee,onValueChange:U,open:W,onOpenChange:V,dir:F,triggerPointerDownPosRef:G,disabled:_,children:[C.jsx(ph.Provider,{scope:t,children:C.jsx(TO,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(T=>{P(H=>new Set(H).add(T))},[]),onNativeOptionRemove:x.useCallback(T=>{P(H=>{const B=new Set(H);return B.delete(T),B})},[]),children:s})}),z?C.jsxs(aC,{"aria-hidden":!0,required:y,tabIndex:-1,name:p,autoComplete:v,value:ee,onChange:T=>U(T.target.value),disabled:_,form:b,children:[ee===void 0?C.jsx("option",{value:""}):null,Array.from(L)]},q):null]})})};H1.displayName=Sr;var I1="SelectTrigger",V1=x.forwardRef((e,t)=>{const{__scopeSelect:s,disabled:r=!1,...o}=e,l=vh(s),c=zn(I1,s),h=c.disabled||r,f=Je(t,c.onTriggerChange),d=gh(s),p=x.useRef("touch"),[v,_,y]=cC(S=>{const E=d().filter(M=>!M.disabled),A=E.find(M=>M.value===c.value),R=uC(E,S,A);R!==void 0&&c.onValueChange(R.value)}),b=S=>{h||(c.onOpenChange(!0),y()),S&&(c.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return C.jsx(v1,{asChild:!0,...l,children:C.jsx(Ie.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:h,"data-disabled":h?"":void 0,"data-placeholder":lC(c.value)?"":void 0,...o,ref:f,onClick:Me(o.onClick,S=>{S.currentTarget.focus(),p.current!=="mouse"&&b(S)}),onPointerDown:Me(o.onPointerDown,S=>{p.current=S.pointerType;const E=S.target;E.hasPointerCapture(S.pointerId)&&E.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(b(S),S.preventDefault())}),onKeyDown:Me(o.onKeyDown,S=>{const E=v.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&_(S.key),!(E&&S.key===" ")&&wO.includes(S.key)&&(b(),S.preventDefault())})})})});V1.displayName=I1;var U1="SelectValue",F1=x.forwardRef((e,t)=>{const{__scopeSelect:s,className:r,style:o,children:l,placeholder:c="",...h}=e,f=zn(U1,s),{onValueNodeHasChildrenChange:d}=f,p=l!==void 0,v=Je(t,f.onValueNodeChange);return Yt(()=>{d(p)},[d,p]),C.jsx(Ie.span,{...h,ref:v,style:{pointerEvents:"none"},children:lC(f.value)?C.jsx(C.Fragment,{children:c}):l})});F1.displayName=U1;var AO="SelectIcon",W1=x.forwardRef((e,t)=>{const{__scopeSelect:s,children:r,...o}=e;return C.jsx(Ie.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});W1.displayName=AO;var RO="SelectPortal",Y1=e=>C.jsx(ug,{asChild:!0,...e});Y1.displayName=RO;var wr="SelectContent",K1=x.forwardRef((e,t)=>{const s=zn(wr,e.__scopeSelect),[r,o]=x.useState();if(Yt(()=>{o(new DocumentFragment)},[]),!s.open){const l=r;return l?yl.createPortal(C.jsx(q1,{scope:e.__scopeSelect,children:C.jsx(ph.Slot,{scope:e.__scopeSelect,children:C.jsx("div",{children:e.children})})}),l):null}return C.jsx(G1,{...e,ref:t})});K1.displayName=wr;var Zi=10,[q1,jn]=jo(wr),MO="SelectContentImpl",DO=al("SelectContent.RemoveScroll"),G1=x.forwardRef((e,t)=>{const{__scopeSelect:s,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:l,onPointerDownOutside:c,side:h,sideOffset:f,align:d,alignOffset:p,arrowPadding:v,collisionBoundary:_,collisionPadding:y,sticky:b,hideWhenDetached:S,avoidCollisions:E,...A}=e,R=zn(wr,s),[M,k]=x.useState(null),[j,F]=x.useState(null),W=Je(t,K=>k(K)),[V,ee]=x.useState(null),[U,G]=x.useState(null),z=gh(s),[L,P]=x.useState(!1),q=x.useRef(!1);x.useEffect(()=>{if(M)return BM(M)},[M]),$R();const T=x.useCallback(K=>{const[J,...ie]=z().map(_e=>_e.ref.current),[ue]=ie.slice(-1),me=document.activeElement;for(const _e of K)if(_e===me||(_e?.scrollIntoView({block:"nearest"}),_e===J&&j&&(j.scrollTop=0),_e===ue&&j&&(j.scrollTop=j.scrollHeight),_e?.focus(),document.activeElement!==me))return},[z,j]),H=x.useCallback(()=>T([V,M]),[T,V,M]);x.useEffect(()=>{L&&H()},[L,H]);const{onOpenChange:B,triggerPointerDownPosRef:te}=R;x.useEffect(()=>{if(M){let K={x:0,y:0};const J=ue=>{K={x:Math.abs(Math.round(ue.pageX)-(te.current?.x??0)),y:Math.abs(Math.round(ue.pageY)-(te.current?.y??0))}},ie=ue=>{K.x<=10&&K.y<=10?ue.preventDefault():M.contains(ue.target)||B(!1),document.removeEventListener("pointermove",J),te.current=null};return te.current!==null&&(document.addEventListener("pointermove",J),document.addEventListener("pointerup",ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",J),document.removeEventListener("pointerup",ie,{capture:!0})}}},[M,B,te]),x.useEffect(()=>{const K=()=>B(!1);return window.addEventListener("blur",K),window.addEventListener("resize",K),()=>{window.removeEventListener("blur",K),window.removeEventListener("resize",K)}},[B]);const[X,N]=cC(K=>{const J=z().filter(me=>!me.disabled),ie=J.find(me=>me.ref.current===document.activeElement),ue=uC(J,K,ie);ue&&setTimeout(()=>ue.ref.current.focus())}),Z=x.useCallback((K,J,ie)=>{const ue=!q.current&&!ie;(R.value!==void 0&&R.value===J||ue)&&(ee(K),ue&&(q.current=!0))},[R.value]),ne=x.useCallback(()=>M?.focus(),[M]),I=x.useCallback((K,J,ie)=>{const ue=!q.current&&!ie;(R.value!==void 0&&R.value===J||ue)&&G(K)},[R.value]),O=r==="popper"?qm:$1,Y=O===qm?{side:h,sideOffset:f,align:d,alignOffset:p,arrowPadding:v,collisionBoundary:_,collisionPadding:y,sticky:b,hideWhenDetached:S,avoidCollisions:E}:{};return C.jsx(q1,{scope:s,content:M,viewport:j,onViewportChange:F,itemRefCallback:Z,selectedItem:V,onItemLeave:ne,itemTextRefCallback:I,focusSelectedItem:H,selectedItemText:U,position:r,isPositioned:L,searchRef:X,children:C.jsx(qx,{as:DO,allowPinchZoom:!0,children:C.jsx(jx,{asChild:!0,trapped:R.open,onMountAutoFocus:K=>{K.preventDefault()},onUnmountAutoFocus:Me(o,K=>{R.trigger?.focus({preventScroll:!0}),K.preventDefault()}),children:C.jsx(cg,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:K=>K.preventDefault(),onDismiss:()=>R.onOpenChange(!1),children:C.jsx(O,{role:"listbox",id:R.contentId,"data-state":R.open?"open":"closed",dir:R.dir,onContextMenu:K=>K.preventDefault(),...A,...Y,onPlaced:()=>P(!0),ref:W,style:{display:"flex",flexDirection:"column",outline:"none",...A.style},onKeyDown:Me(A.onKeyDown,K=>{const J=K.ctrlKey||K.altKey||K.metaKey;if(K.key==="Tab"&&K.preventDefault(),!J&&K.key.length===1&&N(K.key),["ArrowUp","ArrowDown","Home","End"].includes(K.key)){let ue=z().filter(me=>!me.disabled).map(me=>me.ref.current);if(["ArrowUp","End"].includes(K.key)&&(ue=ue.slice().reverse()),["ArrowUp","ArrowDown"].includes(K.key)){const me=K.target,_e=ue.indexOf(me);ue=ue.slice(_e+1)}setTimeout(()=>T(ue)),K.preventDefault()}})})})})})})});G1.displayName=MO;var OO="SelectItemAlignedPosition",$1=x.forwardRef((e,t)=>{const{__scopeSelect:s,onPlaced:r,...o}=e,l=zn(wr,s),c=jn(wr,s),[h,f]=x.useState(null),[d,p]=x.useState(null),v=Je(t,W=>p(W)),_=gh(s),y=x.useRef(!1),b=x.useRef(!0),{viewport:S,selectedItem:E,selectedItemText:A,focusSelectedItem:R}=c,M=x.useCallback(()=>{if(l.trigger&&l.valueNode&&h&&d&&S&&E&&A){const W=l.trigger.getBoundingClientRect(),V=d.getBoundingClientRect(),ee=l.valueNode.getBoundingClientRect(),U=A.getBoundingClientRect();if(l.dir!=="rtl"){const me=U.left-V.left,_e=ee.left-me,xe=W.left-_e,ke=W.width+xe,qe=Math.max(ke,V.width),Xt=window.innerWidth-Zi,Ri=Km(_e,[Zi,Math.max(Zi,Xt-qe)]);h.style.minWidth=ke+"px",h.style.left=Ri+"px"}else{const me=V.right-U.right,_e=window.innerWidth-ee.right-me,xe=window.innerWidth-W.right-_e,ke=W.width+xe,qe=Math.max(ke,V.width),Xt=window.innerWidth-Zi,Ri=Km(_e,[Zi,Math.max(Zi,Xt-qe)]);h.style.minWidth=ke+"px",h.style.right=Ri+"px"}const G=_(),z=window.innerHeight-Zi*2,L=S.scrollHeight,P=window.getComputedStyle(d),q=parseInt(P.borderTopWidth,10),T=parseInt(P.paddingTop,10),H=parseInt(P.borderBottomWidth,10),B=parseInt(P.paddingBottom,10),te=q+T+L+B+H,X=Math.min(E.offsetHeight*5,te),N=window.getComputedStyle(S),Z=parseInt(N.paddingTop,10),ne=parseInt(N.paddingBottom,10),I=W.top+W.height/2-Zi,O=z-I,Y=E.offsetHeight/2,K=E.offsetTop+Y,J=q+T+K,ie=te-J;if(J<=I){const me=G.length>0&&E===G[G.length-1].ref.current;h.style.bottom="0px";const _e=d.clientHeight-S.offsetTop-S.offsetHeight,xe=Math.max(O,Y+(me?ne:0)+_e+H),ke=J+xe;h.style.height=ke+"px"}else{const me=G.length>0&&E===G[0].ref.current;h.style.top="0px";const xe=Math.max(I,q+S.offsetTop+(me?Z:0)+Y)+ie;h.style.height=xe+"px",S.scrollTop=J-I+S.offsetTop}h.style.margin=`${Zi}px 0`,h.style.minHeight=X+"px",h.style.maxHeight=z+"px",r?.(),requestAnimationFrame(()=>y.current=!0)}},[_,l.trigger,l.valueNode,h,d,S,E,A,l.dir,r]);Yt(()=>M(),[M]);const[k,j]=x.useState();Yt(()=>{d&&j(window.getComputedStyle(d).zIndex)},[d]);const F=x.useCallback(W=>{W&&b.current===!0&&(M(),R?.(),b.current=!1)},[M,R]);return C.jsx(LO,{scope:s,contentWrapper:h,shouldExpandOnScrollRef:y,onScrollButtonChange:F,children:C.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:C.jsx(Ie.div,{...o,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});$1.displayName=OO;var NO="SelectPopperPosition",qm=x.forwardRef((e,t)=>{const{__scopeSelect:s,align:r="start",collisionPadding:o=Zi,...l}=e,c=vh(s);return C.jsx(_1,{...c,...l,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});qm.displayName=NO;var[LO,wg]=jo(wr,{}),Gm="SelectViewport",X1=x.forwardRef((e,t)=>{const{__scopeSelect:s,nonce:r,...o}=e,l=jn(Gm,s),c=wg(Gm,s),h=Je(t,l.onViewportChange),f=x.useRef(0);return C.jsxs(C.Fragment,{children:[C.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),C.jsx(ph.Slot,{scope:s,children:C.jsx(Ie.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:h,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Me(o.onScroll,d=>{const p=d.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:_}=c;if(_?.current&&v){const y=Math.abs(f.current-p.scrollTop);if(y>0){const b=window.innerHeight-Zi*2,S=parseFloat(v.style.minHeight),E=parseFloat(v.style.height),A=Math.max(S,E);if(A<b){const R=A+y,M=Math.min(b,R),k=R-M;v.style.height=M+"px",v.style.bottom==="0px"&&(p.scrollTop=k>0?k:0,v.style.justifyContent="flex-end")}}}f.current=p.scrollTop})})})]})});X1.displayName=Gm;var Z1="SelectGroup",[BO,PO]=jo(Z1),zO=x.forwardRef((e,t)=>{const{__scopeSelect:s,...r}=e,o=Bo();return C.jsx(BO,{scope:s,id:o,children:C.jsx(Ie.div,{role:"group","aria-labelledby":o,...r,ref:t})})});zO.displayName=Z1;var Q1="SelectLabel",jO=x.forwardRef((e,t)=>{const{__scopeSelect:s,...r}=e,o=PO(Q1,s);return C.jsx(Ie.div,{id:o.id,...r,ref:t})});jO.displayName=Q1;var Uu="SelectItem",[HO,J1]=jo(Uu),eC=x.forwardRef((e,t)=>{const{__scopeSelect:s,value:r,disabled:o=!1,textValue:l,...c}=e,h=zn(Uu,s),f=jn(Uu,s),d=h.value===r,[p,v]=x.useState(l??""),[_,y]=x.useState(!1),b=Je(t,R=>f.itemRefCallback?.(R,r,o)),S=Bo(),E=x.useRef("touch"),A=()=>{o||(h.onValueChange(r),h.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return C.jsx(HO,{scope:s,value:r,disabled:o,textId:S,isSelected:d,onItemTextChange:x.useCallback(R=>{v(M=>M||(R?.textContent??"").trim())},[]),children:C.jsx(ph.ItemSlot,{scope:s,value:r,disabled:o,textValue:p,children:C.jsx(Ie.div,{role:"option","aria-labelledby":S,"data-highlighted":_?"":void 0,"aria-selected":d&&_,"data-state":d?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...c,ref:b,onFocus:Me(c.onFocus,()=>y(!0)),onBlur:Me(c.onBlur,()=>y(!1)),onClick:Me(c.onClick,()=>{E.current!=="mouse"&&A()}),onPointerUp:Me(c.onPointerUp,()=>{E.current==="mouse"&&A()}),onPointerDown:Me(c.onPointerDown,R=>{E.current=R.pointerType}),onPointerMove:Me(c.onPointerMove,R=>{E.current=R.pointerType,o?f.onItemLeave?.():E.current==="mouse"&&R.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Me(c.onPointerLeave,R=>{R.currentTarget===document.activeElement&&f.onItemLeave?.()}),onKeyDown:Me(c.onKeyDown,R=>{f.searchRef?.current!==""&&R.key===" "||(xO.includes(R.key)&&A(),R.key===" "&&R.preventDefault())})})})})});eC.displayName=Uu;var qa="SelectItemText",tC=x.forwardRef((e,t)=>{const{__scopeSelect:s,className:r,style:o,...l}=e,c=zn(qa,s),h=jn(qa,s),f=J1(qa,s),d=kO(qa,s),[p,v]=x.useState(null),_=Je(t,A=>v(A),f.onItemTextChange,A=>h.itemTextRefCallback?.(A,f.value,f.disabled)),y=p?.textContent,b=x.useMemo(()=>C.jsx("option",{value:f.value,disabled:f.disabled,children:y},f.value),[f.disabled,f.value,y]),{onNativeOptionAdd:S,onNativeOptionRemove:E}=d;return Yt(()=>(S(b),()=>E(b)),[S,E,b]),C.jsxs(C.Fragment,{children:[C.jsx(Ie.span,{id:f.textId,...l,ref:_}),f.isSelected&&c.valueNode&&!c.valueNodeHasChildren?yl.createPortal(l.children,c.valueNode):null]})});tC.displayName=qa;var iC="SelectItemIndicator",sC=x.forwardRef((e,t)=>{const{__scopeSelect:s,...r}=e;return J1(iC,s).isSelected?C.jsx(Ie.span,{"aria-hidden":!0,...r,ref:t}):null});sC.displayName=iC;var $m="SelectScrollUpButton",nC=x.forwardRef((e,t)=>{const s=jn($m,e.__scopeSelect),r=wg($m,e.__scopeSelect),[o,l]=x.useState(!1),c=Je(t,r.onScrollButtonChange);return Yt(()=>{if(s.viewport&&s.isPositioned){let h=function(){const d=f.scrollTop>0;l(d)};const f=s.viewport;return h(),f.addEventListener("scroll",h),()=>f.removeEventListener("scroll",h)}},[s.viewport,s.isPositioned]),o?C.jsx(oC,{...e,ref:c,onAutoScroll:()=>{const{viewport:h,selectedItem:f}=s;h&&f&&(h.scrollTop=h.scrollTop-f.offsetHeight)}}):null});nC.displayName=$m;var Xm="SelectScrollDownButton",rC=x.forwardRef((e,t)=>{const s=jn(Xm,e.__scopeSelect),r=wg(Xm,e.__scopeSelect),[o,l]=x.useState(!1),c=Je(t,r.onScrollButtonChange);return Yt(()=>{if(s.viewport&&s.isPositioned){let h=function(){const d=f.scrollHeight-f.clientHeight,p=Math.ceil(f.scrollTop)<d;l(p)};const f=s.viewport;return h(),f.addEventListener("scroll",h),()=>f.removeEventListener("scroll",h)}},[s.viewport,s.isPositioned]),o?C.jsx(oC,{...e,ref:c,onAutoScroll:()=>{const{viewport:h,selectedItem:f}=s;h&&f&&(h.scrollTop=h.scrollTop+f.offsetHeight)}}):null});rC.displayName=Xm;var oC=x.forwardRef((e,t)=>{const{__scopeSelect:s,onAutoScroll:r,...o}=e,l=jn("SelectScrollButton",s),c=x.useRef(null),h=gh(s),f=x.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return x.useEffect(()=>()=>f(),[f]),Yt(()=>{h().find(p=>p.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[h]),C.jsx(Ie.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:Me(o.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(r,50))}),onPointerMove:Me(o.onPointerMove,()=>{l.onItemLeave?.(),c.current===null&&(c.current=window.setInterval(r,50))}),onPointerLeave:Me(o.onPointerLeave,()=>{f()})})}),IO="SelectSeparator",VO=x.forwardRef((e,t)=>{const{__scopeSelect:s,...r}=e;return C.jsx(Ie.div,{"aria-hidden":!0,...r,ref:t})});VO.displayName=IO;var Zm="SelectArrow",UO=x.forwardRef((e,t)=>{const{__scopeSelect:s,...r}=e,o=vh(s),l=zn(Zm,s),c=jn(Zm,s);return l.open&&c.position==="popper"?C.jsx(y1,{...o,...r,ref:t}):null});UO.displayName=Zm;var FO="SelectBubbleInput",aC=x.forwardRef(({__scopeSelect:e,value:t,...s},r)=>{const o=x.useRef(null),l=Je(r,o),c=PM(t);return x.useEffect(()=>{const h=o.current;if(!h)return;const f=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(f,"value").set;if(c!==t&&p){const v=new Event("change",{bubbles:!0});p.call(h,t),h.dispatchEvent(v)}},[c,t]),C.jsx(Ie.select,{...s,style:{...Nx,...s.style},ref:l,defaultValue:t})});aC.displayName=FO;function lC(e){return e===""||e===void 0}function cC(e){const t=Jt(e),s=x.useRef(""),r=x.useRef(0),o=x.useCallback(c=>{const h=s.current+c;t(h),(function f(d){s.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>f(""),1e3))})(h)},[t]),l=x.useCallback(()=>{s.current="",window.clearTimeout(r.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(r.current),[]),[s,o,l]}function uC(e,t,s){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,l=s?e.indexOf(s):-1;let c=WO(e,Math.max(l,0));o.length===1&&(c=c.filter(d=>d!==s));const f=c.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return f!==s?f:void 0}function WO(e,t){return e.map((s,r)=>e[(t+r)%e.length])}var YO=H1,KO=V1,qO=F1,GO=W1,$O=Y1,XO=K1,ZO=X1,QO=eC,JO=tC,eN=sC,tN=nC,iN=rC,sN="Separator",Xb="horizontal",nN=["horizontal","vertical"],hC=x.forwardRef((e,t)=>{const{decorative:s,orientation:r=Xb,...o}=e,l=rN(r)?r:Xb,h=s?{role:"none"}:{"aria-orientation":l==="vertical"?l:void 0,role:"separator"};return C.jsx(Ie.div,{"data-orientation":l,...h,...o,ref:t})});hC.displayName=sN;function rN(e){return nN.includes(e)}var oN=hC,_h="Tabs",[aN]=Er(_h,[S1]),dC=S1(),[lN,xg]=aN(_h),fC=x.forwardRef((e,t)=>{const{__scopeTabs:s,value:r,onValueChange:o,defaultValue:l,orientation:c="horizontal",dir:h,activationMode:f="automatic",...d}=e,p=oh(h),[v,_]=ll({prop:r,onChange:o,defaultProp:l??"",caller:_h});return C.jsx(lN,{scope:s,baseId:Bo(),value:v,onValueChange:_,orientation:c,dir:p,activationMode:f,children:C.jsx(Ie.div,{dir:p,"data-orientation":c,...d,ref:t})})});fC.displayName=_h;var mC="TabsList",pC=x.forwardRef((e,t)=>{const{__scopeTabs:s,loop:r=!0,...o}=e,l=xg(mC,s),c=dC(s);return C.jsx(oO,{asChild:!0,...c,orientation:l.orientation,dir:l.dir,loop:r,children:C.jsx(Ie.div,{role:"tablist","aria-orientation":l.orientation,...o,ref:t})})});pC.displayName=mC;var gC="TabsTrigger",vC=x.forwardRef((e,t)=>{const{__scopeTabs:s,value:r,disabled:o=!1,...l}=e,c=xg(gC,s),h=dC(s),f=bC(c.baseId,r),d=SC(c.baseId,r),p=r===c.value;return C.jsx(aO,{asChild:!0,...h,focusable:!o,active:p,children:C.jsx(Ie.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":d,"data-state":p?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:f,...l,ref:t,onMouseDown:Me(e.onMouseDown,v=>{!o&&v.button===0&&v.ctrlKey===!1?c.onValueChange(r):v.preventDefault()}),onKeyDown:Me(e.onKeyDown,v=>{[" ","Enter"].includes(v.key)&&c.onValueChange(r)}),onFocus:Me(e.onFocus,()=>{const v=c.activationMode!=="manual";!p&&!o&&v&&c.onValueChange(r)})})})});vC.displayName=gC;var _C="TabsContent",yC=x.forwardRef((e,t)=>{const{__scopeTabs:s,value:r,forceMount:o,children:l,...c}=e,h=xg(_C,s),f=bC(h.baseId,r),d=SC(h.baseId,r),p=r===h.value,v=x.useRef(p);return x.useEffect(()=>{const _=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(_)},[]),C.jsx(Pn,{present:o||p,children:({present:_})=>C.jsx(Ie.div,{"data-state":p?"active":"inactive","data-orientation":h.orientation,role:"tabpanel","aria-labelledby":f,hidden:!_,id:d,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:v.current?"0s":void 0},children:_&&l})})});yC.displayName=_C;function bC(e,t){return`${e}-trigger-${t}`}function SC(e,t){return`${e}-content-${t}`}var cN=fC,uN=pC,hN=vC,dN=yC,[yh]=Er("Tooltip",[dh]),bh=dh(),wC="TooltipProvider",fN=700,Qm="tooltip.open",[mN,Cg]=yh(wC),xC=e=>{const{__scopeTooltip:t,delayDuration:s=fN,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:l}=e,c=x.useRef(!0),h=x.useRef(!1),f=x.useRef(0);return x.useEffect(()=>{const d=f.current;return()=>window.clearTimeout(d)},[]),C.jsx(mN,{scope:t,isOpenDelayedRef:c,delayDuration:s,onOpen:x.useCallback(()=>{window.clearTimeout(f.current),c.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>c.current=!0,r)},[r]),isPointerInTransitRef:h,onPointerInTransitChange:x.useCallback(d=>{h.current=d},[]),disableHoverableContent:o,children:l})};xC.displayName=wC;var ul="Tooltip",[pN,wl]=yh(ul),CC=e=>{const{__scopeTooltip:t,children:s,open:r,defaultOpen:o,onOpenChange:l,disableHoverableContent:c,delayDuration:h}=e,f=Cg(ul,e.__scopeTooltip),d=bh(t),[p,v]=x.useState(null),_=Bo(),y=x.useRef(0),b=c??f.disableHoverableContent,S=h??f.delayDuration,E=x.useRef(!1),[A,R]=ll({prop:r,defaultProp:o??!1,onChange:W=>{W?(f.onOpen(),document.dispatchEvent(new CustomEvent(Qm))):f.onClose(),l?.(W)},caller:ul}),M=x.useMemo(()=>A?E.current?"delayed-open":"instant-open":"closed",[A]),k=x.useCallback(()=>{window.clearTimeout(y.current),y.current=0,E.current=!1,R(!0)},[R]),j=x.useCallback(()=>{window.clearTimeout(y.current),y.current=0,R(!1)},[R]),F=x.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{E.current=!0,R(!0),y.current=0},S)},[S,R]);return x.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),C.jsx(g1,{...d,children:C.jsx(pN,{scope:t,contentId:_,open:A,stateAttribute:M,trigger:p,onTriggerChange:v,onTriggerEnter:x.useCallback(()=>{f.isOpenDelayedRef.current?F():k()},[f.isOpenDelayedRef,F,k]),onTriggerLeave:x.useCallback(()=>{b?j():(window.clearTimeout(y.current),y.current=0)},[j,b]),onOpen:k,onClose:j,disableHoverableContent:b,children:s})})};CC.displayName=ul;var Jm="TooltipTrigger",EC=x.forwardRef((e,t)=>{const{__scopeTooltip:s,...r}=e,o=wl(Jm,s),l=Cg(Jm,s),c=bh(s),h=x.useRef(null),f=Je(t,h,o.onTriggerChange),d=x.useRef(!1),p=x.useRef(!1),v=x.useCallback(()=>d.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),C.jsx(v1,{asChild:!0,...c,children:C.jsx(Ie.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:f,onPointerMove:Me(e.onPointerMove,_=>{_.pointerType!=="touch"&&!p.current&&!l.isPointerInTransitRef.current&&(o.onTriggerEnter(),p.current=!0)}),onPointerLeave:Me(e.onPointerLeave,()=>{o.onTriggerLeave(),p.current=!1}),onPointerDown:Me(e.onPointerDown,()=>{o.open&&o.onClose(),d.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:Me(e.onFocus,()=>{d.current||o.onOpen()}),onBlur:Me(e.onBlur,o.onClose),onClick:Me(e.onClick,o.onClose)})})});EC.displayName=Jm;var Eg="TooltipPortal",[gN,vN]=yh(Eg,{forceMount:void 0}),TC=e=>{const{__scopeTooltip:t,forceMount:s,children:r,container:o}=e,l=wl(Eg,t);return C.jsx(gN,{scope:t,forceMount:s,children:C.jsx(Pn,{present:s||l.open,children:C.jsx(ug,{asChild:!0,container:o,children:r})})})};TC.displayName=Eg;var Do="TooltipContent",kC=x.forwardRef((e,t)=>{const s=vN(Do,e.__scopeTooltip),{forceMount:r=s.forceMount,side:o="top",...l}=e,c=wl(Do,e.__scopeTooltip);return C.jsx(Pn,{present:r||c.open,children:c.disableHoverableContent?C.jsx(AC,{side:o,...l,ref:t}):C.jsx(_N,{side:o,...l,ref:t})})}),_N=x.forwardRef((e,t)=>{const s=wl(Do,e.__scopeTooltip),r=Cg(Do,e.__scopeTooltip),o=x.useRef(null),l=Je(t,o),[c,h]=x.useState(null),{trigger:f,onClose:d}=s,p=o.current,{onPointerInTransitChange:v}=r,_=x.useCallback(()=>{h(null),v(!1)},[v]),y=x.useCallback((b,S)=>{const E=b.currentTarget,A={x:b.clientX,y:b.clientY},R=wN(A,E.getBoundingClientRect()),M=xN(A,R),k=CN(S.getBoundingClientRect()),j=TN([...M,...k]);h(j),v(!0)},[v]);return x.useEffect(()=>()=>_(),[_]),x.useEffect(()=>{if(f&&p){const b=E=>y(E,p),S=E=>y(E,f);return f.addEventListener("pointerleave",b),p.addEventListener("pointerleave",S),()=>{f.removeEventListener("pointerleave",b),p.removeEventListener("pointerleave",S)}}},[f,p,y,_]),x.useEffect(()=>{if(c){const b=S=>{const E=S.target,A={x:S.clientX,y:S.clientY},R=f?.contains(E)||p?.contains(E),M=!EN(A,c);R?_():M&&(_(),d())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[f,p,c,d,_]),C.jsx(AC,{...e,ref:l})}),[yN,bN]=yh(ul,{isInside:!1}),SN=pR("TooltipContent"),AC=x.forwardRef((e,t)=>{const{__scopeTooltip:s,children:r,"aria-label":o,onEscapeKeyDown:l,onPointerDownOutside:c,...h}=e,f=wl(Do,s),d=bh(s),{onClose:p}=f;return x.useEffect(()=>(document.addEventListener(Qm,p),()=>document.removeEventListener(Qm,p)),[p]),x.useEffect(()=>{if(f.trigger){const v=_=>{_.target?.contains(f.trigger)&&p()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[f.trigger,p]),C.jsx(cg,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:v=>v.preventDefault(),onDismiss:p,children:C.jsxs(_1,{"data-state":f.stateAttribute,...d,...h,ref:t,style:{...h.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:[C.jsx(SN,{children:r}),C.jsx(yN,{scope:s,isInside:!0,children:C.jsx(wR,{id:f.contentId,role:"tooltip",children:o||r})})]})})});kC.displayName=Do;var RC="TooltipArrow",MC=x.forwardRef((e,t)=>{const{__scopeTooltip:s,...r}=e,o=bh(s);return bN(RC,s).isInside?null:C.jsx(y1,{...o,...r,ref:t})});MC.displayName=RC;function wN(e,t){const s=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),l=Math.abs(t.left-e.x);switch(Math.min(s,r,o,l)){case l:return"left";case o:return"right";case s:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function xN(e,t,s=5){const r=[];switch(t){case"top":r.push({x:e.x-s,y:e.y+s},{x:e.x+s,y:e.y+s});break;case"bottom":r.push({x:e.x-s,y:e.y-s},{x:e.x+s,y:e.y-s});break;case"left":r.push({x:e.x+s,y:e.y-s},{x:e.x+s,y:e.y+s});break;case"right":r.push({x:e.x-s,y:e.y-s},{x:e.x-s,y:e.y+s});break}return r}function CN(e){const{top:t,right:s,bottom:r,left:o}=e;return[{x:o,y:t},{x:s,y:t},{x:s,y:r},{x:o,y:r}]}function EN(e,t){const{x:s,y:r}=e;let o=!1;for(let l=0,c=t.length-1;l<t.length;c=l++){const h=t[l],f=t[c],d=h.x,p=h.y,v=f.x,_=f.y;p>r!=_>r&&s<(v-d)*(r-p)/(_-p)+d&&(o=!o)}return o}function TN(e){const t=e.slice();return t.sort((s,r)=>s.x<r.x?-1:s.x>r.x?1:s.y<r.y?-1:s.y>r.y?1:0),kN(t)}function kN(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const l=t[t.length-1],c=t[t.length-2];if((l.x-c.x)*(o.y-c.y)>=(l.y-c.y)*(o.x-c.x))t.pop();else break}t.push(o)}t.pop();const s=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;s.length>=2;){const l=s[s.length-1],c=s[s.length-2];if((l.x-c.x)*(o.y-c.y)>=(l.y-c.y)*(o.x-c.x))s.pop();else break}s.push(o)}return s.pop(),t.length===1&&s.length===1&&t[0].x===s[0].x&&t[0].y===s[0].y?t:t.concat(s)}var AN=xC,RN=CC,MN=EC,DN=TC,ON=kC,NN=MC;function DC(e){var t,s,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(s=DC(e[t]))&&(r&&(r+=" "),r+=s)}else for(s in e)e[s]&&(r&&(r+=" "),r+=s);return r}function OC(){for(var e,t,s=0,r="",o=arguments.length;s<o;s++)(e=arguments[s])&&(t=DC(e))&&(r&&(r+=" "),r+=t);return r}const LN=(e,t)=>{const s=new Array(e.length+t.length);for(let r=0;r<e.length;r++)s[r]=e[r];for(let r=0;r<t.length;r++)s[e.length+r]=t[r];return s},BN=(e,t)=>({classGroupId:e,validator:t}),NC=(e=new Map,t=null,s)=>({nextPart:e,validators:t,classGroupId:s}),Fu="-",Zb=[],PN="arbitrary..",zN=e=>{const t=HN(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return jN(c);const h=c.split(Fu),f=h[0]===""&&h.length>1?1:0;return LC(h,f,t)},getConflictingClassGroupIds:(c,h)=>{if(h){const f=r[c],d=s[c];return f?d?LN(d,f):f:d||Zb}return s[c]||Zb}}},LC=(e,t,s)=>{if(e.length-t===0)return s.classGroupId;const o=e[t],l=s.nextPart.get(o);if(l){const d=LC(e,t+1,l);if(d)return d}const c=s.validators;if(c===null)return;const h=t===0?e.join(Fu):e.slice(t).join(Fu),f=c.length;for(let d=0;d<f;d++){const p=c[d];if(p.validator(h))return p.classGroupId}},jN=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),s=t.indexOf(":"),r=t.slice(0,s);return r?PN+r:void 0})(),HN=e=>{const{theme:t,classGroups:s}=e;return IN(s,t)},IN=(e,t)=>{const s=NC();for(const r in e){const o=e[r];Tg(o,s,r,t)}return s},Tg=(e,t,s,r)=>{const o=e.length;for(let l=0;l<o;l++){const c=e[l];VN(c,t,s,r)}},VN=(e,t,s,r)=>{if(typeof e=="string"){UN(e,t,s);return}if(typeof e=="function"){FN(e,t,s,r);return}WN(e,t,s,r)},UN=(e,t,s)=>{const r=e===""?t:BC(t,e);r.classGroupId=s},FN=(e,t,s,r)=>{if(YN(e)){Tg(e(r),t,s,r);return}t.validators===null&&(t.validators=[]),t.validators.push(BN(s,e))},WN=(e,t,s,r)=>{const o=Object.entries(e),l=o.length;for(let c=0;c<l;c++){const[h,f]=o[c];Tg(f,BC(t,h),s,r)}},BC=(e,t)=>{let s=e;const r=t.split(Fu),o=r.length;for(let l=0;l<o;l++){const c=r[l];let h=s.nextPart.get(c);h||(h=NC(),s.nextPart.set(c,h)),s=h}return s},YN=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,KN=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,s=Object.create(null),r=Object.create(null);const o=(l,c)=>{s[l]=c,t++,t>e&&(t=0,r=s,s=Object.create(null))};return{get(l){let c=s[l];if(c!==void 0)return c;if((c=r[l])!==void 0)return o(l,c),c},set(l,c){l in s?s[l]=c:o(l,c)}}},ep="!",Qb=":",qN=[],Jb=(e,t,s,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:s,maybePostfixModifierPosition:r,isExternal:o}),GN=e=>{const{prefix:t,experimentalParseClassName:s}=e;let r=o=>{const l=[];let c=0,h=0,f=0,d;const p=o.length;for(let S=0;S<p;S++){const E=o[S];if(c===0&&h===0){if(E===Qb){l.push(o.slice(f,S)),f=S+1;continue}if(E==="/"){d=S;continue}}E==="["?c++:E==="]"?c--:E==="("?h++:E===")"&&h--}const v=l.length===0?o:o.slice(f);let _=v,y=!1;v.endsWith(ep)?(_=v.slice(0,-1),y=!0):v.startsWith(ep)&&(_=v.slice(1),y=!0);const b=d&&d>f?d-f:void 0;return Jb(l,y,_,b)};if(t){const o=t+Qb,l=r;r=c=>c.startsWith(o)?l(c.slice(o.length)):Jb(qN,!1,c,void 0,!0)}if(s){const o=r;r=l=>s({className:l,parseClassName:o})}return r},$N=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((s,r)=>{t.set(s,1e6+r)}),s=>{const r=[];let o=[];for(let l=0;l<s.length;l++){const c=s[l],h=c[0]==="[",f=t.has(c);h||f?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(c)):o.push(c)}return o.length>0&&(o.sort(),r.push(...o)),r}},XN=e=>({cache:KN(e.cacheSize),parseClassName:GN(e),sortModifiers:$N(e),...zN(e)}),ZN=/\s+/,QN=(e,t)=>{const{parseClassName:s,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:l}=t,c=[],h=e.trim().split(ZN);let f="";for(let d=h.length-1;d>=0;d-=1){const p=h[d],{isExternal:v,modifiers:_,hasImportantModifier:y,baseClassName:b,maybePostfixModifierPosition:S}=s(p);if(v){f=p+(f.length>0?" "+f:f);continue}let E=!!S,A=r(E?b.substring(0,S):b);if(!A){if(!E){f=p+(f.length>0?" "+f:f);continue}if(A=r(b),!A){f=p+(f.length>0?" "+f:f);continue}E=!1}const R=_.length===0?"":_.length===1?_[0]:l(_).join(":"),M=y?R+ep:R,k=M+A;if(c.indexOf(k)>-1)continue;c.push(k);const j=o(A,E);for(let F=0;F<j.length;++F){const W=j[F];c.push(M+W)}f=p+(f.length>0?" "+f:f)}return f},JN=(...e)=>{let t=0,s,r,o="";for(;t<e.length;)(s=e[t++])&&(r=PC(s))&&(o&&(o+=" "),o+=r);return o},PC=e=>{if(typeof e=="string")return e;let t,s="";for(let r=0;r<e.length;r++)e[r]&&(t=PC(e[r]))&&(s&&(s+=" "),s+=t);return s},e5=(e,...t)=>{let s,r,o,l;const c=f=>{const d=t.reduce((p,v)=>v(p),e());return s=XN(d),r=s.cache.get,o=s.cache.set,l=h,h(f)},h=f=>{const d=r(f);if(d)return d;const p=QN(f,s);return o(f,p),p};return l=c,(...f)=>l(JN(...f))},t5=[],Tt=e=>{const t=s=>s[e]||t5;return t.isThemeGetter=!0,t},zC=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,jC=/^\((?:(\w[\w-]*):)?(.+)\)$/i,i5=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,s5=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,n5=/\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$/,r5=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,o5=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,a5=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Sn=e=>i5.test(e),Ne=e=>!!e&&!Number.isNaN(Number(e)),wn=e=>!!e&&Number.isInteger(Number(e)),lm=e=>e.endsWith("%")&&Ne(e.slice(0,-1)),Hs=e=>s5.test(e),HC=()=>!0,l5=e=>n5.test(e)&&!r5.test(e),kg=()=>!1,c5=e=>o5.test(e),u5=e=>a5.test(e),h5=e=>!ye(e)&&!Se(e),d5=e=>Hn(e,UC,kg),ye=e=>zC.test(e),lr=e=>Hn(e,FC,l5),eS=e=>Hn(e,b5,Ne),f5=e=>Hn(e,YC,HC),m5=e=>Hn(e,WC,kg),tS=e=>Hn(e,IC,kg),p5=e=>Hn(e,VC,u5),eu=e=>Hn(e,KC,c5),Se=e=>jC.test(e),Ha=e=>Tr(e,FC),g5=e=>Tr(e,WC),iS=e=>Tr(e,IC),v5=e=>Tr(e,UC),_5=e=>Tr(e,VC),tu=e=>Tr(e,KC,!0),y5=e=>Tr(e,YC,!0),Hn=(e,t,s)=>{const r=zC.exec(e);return r?r[1]?t(r[1]):s(r[2]):!1},Tr=(e,t,s=!1)=>{const r=jC.exec(e);return r?r[1]?t(r[1]):s:!1},IC=e=>e==="position"||e==="percentage",VC=e=>e==="image"||e==="url",UC=e=>e==="length"||e==="size"||e==="bg-size",FC=e=>e==="length",b5=e=>e==="number",WC=e=>e==="family-name",YC=e=>e==="number"||e==="weight",KC=e=>e==="shadow",S5=()=>{const e=Tt("color"),t=Tt("font"),s=Tt("text"),r=Tt("font-weight"),o=Tt("tracking"),l=Tt("leading"),c=Tt("breakpoint"),h=Tt("container"),f=Tt("spacing"),d=Tt("radius"),p=Tt("shadow"),v=Tt("inset-shadow"),_=Tt("text-shadow"),y=Tt("drop-shadow"),b=Tt("blur"),S=Tt("perspective"),E=Tt("aspect"),A=Tt("ease"),R=Tt("animate"),M=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],j=()=>[...k(),Se,ye],F=()=>["auto","hidden","clip","visible","scroll"],W=()=>["auto","contain","none"],V=()=>[Se,ye,f],ee=()=>[Sn,"full","auto",...V()],U=()=>[wn,"none","subgrid",Se,ye],G=()=>["auto",{span:["full",wn,Se,ye]},wn,Se,ye],z=()=>[wn,"auto",Se,ye],L=()=>["auto","min","max","fr",Se,ye],P=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],T=()=>["auto",...V()],H=()=>[Sn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...V()],B=()=>[Sn,"screen","full","dvw","lvw","svw","min","max","fit",...V()],te=()=>[Sn,"screen","full","lh","dvh","lvh","svh","min","max","fit",...V()],X=()=>[e,Se,ye],N=()=>[...k(),iS,tS,{position:[Se,ye]}],Z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],ne=()=>["auto","cover","contain",v5,d5,{size:[Se,ye]}],I=()=>[lm,Ha,lr],O=()=>["","none","full",d,Se,ye],Y=()=>["",Ne,Ha,lr],K=()=>["solid","dashed","dotted","double"],J=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ie=()=>[Ne,lm,iS,tS],ue=()=>["","none",b,Se,ye],me=()=>["none",Ne,Se,ye],_e=()=>["none",Ne,Se,ye],xe=()=>[Ne,Se,ye],ke=()=>[Sn,"full",...V()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Hs],breakpoint:[Hs],color:[HC],container:[Hs],"drop-shadow":[Hs],ease:["in","out","in-out"],font:[h5],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Hs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Hs],shadow:[Hs],spacing:["px",Ne],text:[Hs],"text-shadow":[Hs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Sn,ye,Se,E]}],container:["container"],columns:[{columns:[Ne,ye,Se,h]}],"break-after":[{"break-after":M()}],"break-before":[{"break-before":M()}],"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:j()}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:W()}],"overscroll-x":[{"overscroll-x":W()}],"overscroll-y":[{"overscroll-y":W()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:ee()}],"inset-x":[{"inset-x":ee()}],"inset-y":[{"inset-y":ee()}],start:[{"inset-s":ee(),start:ee()}],end:[{"inset-e":ee(),end:ee()}],"inset-bs":[{"inset-bs":ee()}],"inset-be":[{"inset-be":ee()}],top:[{top:ee()}],right:[{right:ee()}],bottom:[{bottom:ee()}],left:[{left:ee()}],visibility:["visible","invisible","collapse"],z:[{z:[wn,"auto",Se,ye]}],basis:[{basis:[Sn,"full","auto",h,...V()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ne,Sn,"auto","initial","none",ye]}],grow:[{grow:["",Ne,Se,ye]}],shrink:[{shrink:["",Ne,Se,ye]}],order:[{order:[wn,"first","last","none",Se,ye]}],"grid-cols":[{"grid-cols":U()}],"col-start-end":[{col:G()}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":U()}],"row-start-end":[{row:G()}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":L()}],"auto-rows":[{"auto-rows":L()}],gap:[{gap:V()}],"gap-x":[{"gap-x":V()}],"gap-y":[{"gap-y":V()}],"justify-content":[{justify:[...P(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...P()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":P()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:V()}],px:[{px:V()}],py:[{py:V()}],ps:[{ps:V()}],pe:[{pe:V()}],pbs:[{pbs:V()}],pbe:[{pbe:V()}],pt:[{pt:V()}],pr:[{pr:V()}],pb:[{pb:V()}],pl:[{pl:V()}],m:[{m:T()}],mx:[{mx:T()}],my:[{my:T()}],ms:[{ms:T()}],me:[{me:T()}],mbs:[{mbs:T()}],mbe:[{mbe:T()}],mt:[{mt:T()}],mr:[{mr:T()}],mb:[{mb:T()}],ml:[{ml:T()}],"space-x":[{"space-x":V()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":V()}],"space-y-reverse":["space-y-reverse"],size:[{size:H()}],"inline-size":[{inline:["auto",...B()]}],"min-inline-size":[{"min-inline":["auto",...B()]}],"max-inline-size":[{"max-inline":["none",...B()]}],"block-size":[{block:["auto",...te()]}],"min-block-size":[{"min-block":["auto",...te()]}],"max-block-size":[{"max-block":["none",...te()]}],w:[{w:[h,"screen",...H()]}],"min-w":[{"min-w":[h,"screen","none",...H()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[c]},...H()]}],h:[{h:["screen","lh",...H()]}],"min-h":[{"min-h":["screen","lh","none",...H()]}],"max-h":[{"max-h":["screen","lh",...H()]}],"font-size":[{text:["base",s,Ha,lr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,y5,f5]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",lm,ye]}],"font-family":[{font:[g5,m5,t]}],"font-features":[{"font-features":[ye]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,Se,ye]}],"line-clamp":[{"line-clamp":[Ne,"none",Se,eS]}],leading:[{leading:[l,...V()]}],"list-image":[{"list-image":["none",Se,ye]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Se,ye]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:X()}],"text-color":[{text:X()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...K(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ne,"from-font","auto",Se,lr]}],"text-decoration-color":[{decoration:X()}],"underline-offset":[{"underline-offset":[Ne,"auto",Se,ye]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:V()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Se,ye]}],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,ye]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:N()}],"bg-repeat":[{bg:Z()}],"bg-size":[{bg:ne()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},wn,Se,ye],radial:["",Se,ye],conic:[wn,Se,ye]},_5,p5]}],"bg-color":[{bg:X()}],"gradient-from-pos":[{from:I()}],"gradient-via-pos":[{via:I()}],"gradient-to-pos":[{to:I()}],"gradient-from":[{from:X()}],"gradient-via":[{via:X()}],"gradient-to":[{to:X()}],rounded:[{rounded:O()}],"rounded-s":[{"rounded-s":O()}],"rounded-e":[{"rounded-e":O()}],"rounded-t":[{"rounded-t":O()}],"rounded-r":[{"rounded-r":O()}],"rounded-b":[{"rounded-b":O()}],"rounded-l":[{"rounded-l":O()}],"rounded-ss":[{"rounded-ss":O()}],"rounded-se":[{"rounded-se":O()}],"rounded-ee":[{"rounded-ee":O()}],"rounded-es":[{"rounded-es":O()}],"rounded-tl":[{"rounded-tl":O()}],"rounded-tr":[{"rounded-tr":O()}],"rounded-br":[{"rounded-br":O()}],"rounded-bl":[{"rounded-bl":O()}],"border-w":[{border:Y()}],"border-w-x":[{"border-x":Y()}],"border-w-y":[{"border-y":Y()}],"border-w-s":[{"border-s":Y()}],"border-w-e":[{"border-e":Y()}],"border-w-bs":[{"border-bs":Y()}],"border-w-be":[{"border-be":Y()}],"border-w-t":[{"border-t":Y()}],"border-w-r":[{"border-r":Y()}],"border-w-b":[{"border-b":Y()}],"border-w-l":[{"border-l":Y()}],"divide-x":[{"divide-x":Y()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Y()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...K(),"hidden","none"]}],"divide-style":[{divide:[...K(),"hidden","none"]}],"border-color":[{border:X()}],"border-color-x":[{"border-x":X()}],"border-color-y":[{"border-y":X()}],"border-color-s":[{"border-s":X()}],"border-color-e":[{"border-e":X()}],"border-color-bs":[{"border-bs":X()}],"border-color-be":[{"border-be":X()}],"border-color-t":[{"border-t":X()}],"border-color-r":[{"border-r":X()}],"border-color-b":[{"border-b":X()}],"border-color-l":[{"border-l":X()}],"divide-color":[{divide:X()}],"outline-style":[{outline:[...K(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ne,Se,ye]}],"outline-w":[{outline:["",Ne,Ha,lr]}],"outline-color":[{outline:X()}],shadow:[{shadow:["","none",p,tu,eu]}],"shadow-color":[{shadow:X()}],"inset-shadow":[{"inset-shadow":["none",v,tu,eu]}],"inset-shadow-color":[{"inset-shadow":X()}],"ring-w":[{ring:Y()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:X()}],"ring-offset-w":[{"ring-offset":[Ne,lr]}],"ring-offset-color":[{"ring-offset":X()}],"inset-ring-w":[{"inset-ring":Y()}],"inset-ring-color":[{"inset-ring":X()}],"text-shadow":[{"text-shadow":["none",_,tu,eu]}],"text-shadow-color":[{"text-shadow":X()}],opacity:[{opacity:[Ne,Se,ye]}],"mix-blend":[{"mix-blend":[...J(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":J()}],"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":[Ne]}],"mask-image-linear-from-pos":[{"mask-linear-from":ie()}],"mask-image-linear-to-pos":[{"mask-linear-to":ie()}],"mask-image-linear-from-color":[{"mask-linear-from":X()}],"mask-image-linear-to-color":[{"mask-linear-to":X()}],"mask-image-t-from-pos":[{"mask-t-from":ie()}],"mask-image-t-to-pos":[{"mask-t-to":ie()}],"mask-image-t-from-color":[{"mask-t-from":X()}],"mask-image-t-to-color":[{"mask-t-to":X()}],"mask-image-r-from-pos":[{"mask-r-from":ie()}],"mask-image-r-to-pos":[{"mask-r-to":ie()}],"mask-image-r-from-color":[{"mask-r-from":X()}],"mask-image-r-to-color":[{"mask-r-to":X()}],"mask-image-b-from-pos":[{"mask-b-from":ie()}],"mask-image-b-to-pos":[{"mask-b-to":ie()}],"mask-image-b-from-color":[{"mask-b-from":X()}],"mask-image-b-to-color":[{"mask-b-to":X()}],"mask-image-l-from-pos":[{"mask-l-from":ie()}],"mask-image-l-to-pos":[{"mask-l-to":ie()}],"mask-image-l-from-color":[{"mask-l-from":X()}],"mask-image-l-to-color":[{"mask-l-to":X()}],"mask-image-x-from-pos":[{"mask-x-from":ie()}],"mask-image-x-to-pos":[{"mask-x-to":ie()}],"mask-image-x-from-color":[{"mask-x-from":X()}],"mask-image-x-to-color":[{"mask-x-to":X()}],"mask-image-y-from-pos":[{"mask-y-from":ie()}],"mask-image-y-to-pos":[{"mask-y-to":ie()}],"mask-image-y-from-color":[{"mask-y-from":X()}],"mask-image-y-to-color":[{"mask-y-to":X()}],"mask-image-radial":[{"mask-radial":[Se,ye]}],"mask-image-radial-from-pos":[{"mask-radial-from":ie()}],"mask-image-radial-to-pos":[{"mask-radial-to":ie()}],"mask-image-radial-from-color":[{"mask-radial-from":X()}],"mask-image-radial-to-color":[{"mask-radial-to":X()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":k()}],"mask-image-conic-pos":[{"mask-conic":[Ne]}],"mask-image-conic-from-pos":[{"mask-conic-from":ie()}],"mask-image-conic-to-pos":[{"mask-conic-to":ie()}],"mask-image-conic-from-color":[{"mask-conic-from":X()}],"mask-image-conic-to-color":[{"mask-conic-to":X()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:N()}],"mask-repeat":[{mask:Z()}],"mask-size":[{mask:ne()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Se,ye]}],filter:[{filter:["","none",Se,ye]}],blur:[{blur:ue()}],brightness:[{brightness:[Ne,Se,ye]}],contrast:[{contrast:[Ne,Se,ye]}],"drop-shadow":[{"drop-shadow":["","none",y,tu,eu]}],"drop-shadow-color":[{"drop-shadow":X()}],grayscale:[{grayscale:["",Ne,Se,ye]}],"hue-rotate":[{"hue-rotate":[Ne,Se,ye]}],invert:[{invert:["",Ne,Se,ye]}],saturate:[{saturate:[Ne,Se,ye]}],sepia:[{sepia:["",Ne,Se,ye]}],"backdrop-filter":[{"backdrop-filter":["","none",Se,ye]}],"backdrop-blur":[{"backdrop-blur":ue()}],"backdrop-brightness":[{"backdrop-brightness":[Ne,Se,ye]}],"backdrop-contrast":[{"backdrop-contrast":[Ne,Se,ye]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ne,Se,ye]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ne,Se,ye]}],"backdrop-invert":[{"backdrop-invert":["",Ne,Se,ye]}],"backdrop-opacity":[{"backdrop-opacity":[Ne,Se,ye]}],"backdrop-saturate":[{"backdrop-saturate":[Ne,Se,ye]}],"backdrop-sepia":[{"backdrop-sepia":["",Ne,Se,ye]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":V()}],"border-spacing-x":[{"border-spacing-x":V()}],"border-spacing-y":[{"border-spacing-y":V()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Se,ye]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ne,"initial",Se,ye]}],ease:[{ease:["linear","initial",A,Se,ye]}],delay:[{delay:[Ne,Se,ye]}],animate:[{animate:["none",R,Se,ye]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Se,ye]}],"perspective-origin":[{"perspective-origin":j()}],rotate:[{rotate:me()}],"rotate-x":[{"rotate-x":me()}],"rotate-y":[{"rotate-y":me()}],"rotate-z":[{"rotate-z":me()}],scale:[{scale:_e()}],"scale-x":[{"scale-x":_e()}],"scale-y":[{"scale-y":_e()}],"scale-z":[{"scale-z":_e()}],"scale-3d":["scale-3d"],skew:[{skew:xe()}],"skew-x":[{"skew-x":xe()}],"skew-y":[{"skew-y":xe()}],transform:[{transform:[Se,ye,"","none","gpu","cpu"]}],"transform-origin":[{origin:j()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ke()}],"translate-x":[{"translate-x":ke()}],"translate-y":[{"translate-y":ke()}],"translate-z":[{"translate-z":ke()}],"translate-none":["translate-none"],accent:[{accent:X()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:X()}],"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,ye]}],"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":V()}],"scroll-mx":[{"scroll-mx":V()}],"scroll-my":[{"scroll-my":V()}],"scroll-ms":[{"scroll-ms":V()}],"scroll-me":[{"scroll-me":V()}],"scroll-mbs":[{"scroll-mbs":V()}],"scroll-mbe":[{"scroll-mbe":V()}],"scroll-mt":[{"scroll-mt":V()}],"scroll-mr":[{"scroll-mr":V()}],"scroll-mb":[{"scroll-mb":V()}],"scroll-ml":[{"scroll-ml":V()}],"scroll-p":[{"scroll-p":V()}],"scroll-px":[{"scroll-px":V()}],"scroll-py":[{"scroll-py":V()}],"scroll-ps":[{"scroll-ps":V()}],"scroll-pe":[{"scroll-pe":V()}],"scroll-pbs":[{"scroll-pbs":V()}],"scroll-pbe":[{"scroll-pbe":V()}],"scroll-pt":[{"scroll-pt":V()}],"scroll-pr":[{"scroll-pr":V()}],"scroll-pb":[{"scroll-pb":V()}],"scroll-pl":[{"scroll-pl":V()}],"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,ye]}],fill:[{fill:["none",...X()]}],"stroke-w":[{stroke:[Ne,Ha,lr,eS]}],stroke:[{stroke:["none",...X()]}],"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"]}},w5=e5(S5);function Kt(...e){return w5(OC(e))}function hl({className:e,children:t,...s}){return C.jsxs(yO,{"data-slot":"scroll-area",type:"hover",scrollHideDelay:300,className:Kt("relative",e),...s,children:[C.jsx(bO,{"data-slot":"scroll-area-viewport",className:"size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1",children:t}),C.jsx(x5,{}),C.jsx(SO,{})]})}function x5({className:e,orientation:t="vertical",...s}){return C.jsx(M1,{"data-slot":"scroll-area-scrollbar",orientation:t,className:Kt("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-3 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...s,children:C.jsx(L1,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}const qC=(...e)=>e.filter((t,s,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===s).join(" ").trim();const C5=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const E5=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,s,r)=>r?r.toUpperCase():s.toLowerCase());const sS=e=>{const t=E5(e);return t.charAt(0).toUpperCase()+t.slice(1)};var T5={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"};const k5=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const A5=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:r,className:o="",children:l,iconNode:c,...h},f)=>x.createElement("svg",{ref:f,...T5,width:t,height:t,stroke:e,strokeWidth:r?Number(s)*24/Number(t):s,className:qC("lucide",o),...!l&&!k5(h)&&{"aria-hidden":"true"},...h},[...c.map(([d,p])=>x.createElement(d,p)),...Array.isArray(l)?l:[l]]));const Ai=(e,t)=>{const s=x.forwardRef(({className:r,...o},l)=>x.createElement(A5,{ref:l,iconNode:t,className:qC(`lucide-${C5(sS(e))}`,`lucide-${e}`,r),...o}));return s.displayName=sS(e),s};const R5=[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"m21 8-4-4-4 4",key:"1c9v7m"}],["path",{d:"M17 4v16",key:"7dpous"}]],M5=Ai("arrow-down-up",R5);const D5=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],GC=Ai("arrow-left",D5);const O5=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],N5=Ai("check",O5);const L5=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],$C=Ai("chevron-down",L5);const B5=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],P5=Ai("chevron-up",B5);const z5=[["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:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]],j5=Ai("file-diff",z5);const H5=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],I5=Ai("git-commit-horizontal",H5);const V5=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],U5=Ai("network",V5);const F5=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]],W5=Ai("panel-right-close",F5);const Y5=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]],K5=Ai("panel-right-open",Y5);const q5=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],G5=Ai("square-terminal",q5);const $5=[["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"}]],X5=Ai("trash-2",$5);const Z5=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],XC=Ai("x",Z5);function tl({className:e,...t}){return C.jsx("div",{"data-slot":"skeleton",className:Kt("animate-pulse rounded-md bg-accent",e),...t})}function Q5({className:e,...t}){return C.jsx("div",{"data-slot":"card",className:Kt("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",e),...t})}const nS=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,rS=OC,ZC=(e,t)=>s=>{var r;if(t?.variants==null)return rS(e,s?.class,s?.className);const{variants:o,defaultVariants:l}=t,c=Object.keys(o).map(d=>{const p=s?.[d],v=l?.[d];if(p===null)return null;const _=nS(p)||nS(v);return o[d][_]}),h=s&&Object.entries(s).reduce((d,p)=>{let[v,_]=p;return _===void 0||(d[v]=_),d},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,p)=>{let{class:v,className:_,...y}=p;return Object.entries(y).every(b=>{let[S,E]=b;return Array.isArray(E)?E.includes({...l,...h}[S]):{...l,...h}[S]===E})?[...d,v,_]:d},[]);return rS(e,c,f,s?.class,s?.className)},J5=ZC("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-sm border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function Wu({className:e,variant:t="default",asChild:s=!1,...r}){const o=s?fR:"span";return C.jsx(o,{"data-slot":"badge","data-variant":t,className:Kt(J5({variant:t}),e),...r})}function QC({delayDuration:e=0,...t}){return C.jsx(AN,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function JC({...e}){return C.jsx(RN,{"data-slot":"tooltip",...e})}function eE({...e}){return C.jsx(MN,{"data-slot":"tooltip-trigger",...e})}function tE({className:e,sideOffset:t=0,children:s,...r}){return C.jsx(DN,{children:C.jsxs(ON,{"data-slot":"tooltip-content",sideOffset:t,className:Kt("z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md border border-border bg-popover px-3 py-1.5 text-xs text-balance text-popover-foreground shadow-md fade-in-0 zoom-in-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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",e),...r,children:[s,C.jsx(NN,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-popover fill-popover"})]})})}function eL(){const[e,t]=x.useState(!0);return x.useEffect(()=>{const s=setTimeout(()=>t(!1),1800);return()=>clearTimeout(s)},[]),e?C.jsxs("div",{className:"celebration-overlay","aria-hidden":"true",children:[C.jsx("div",{className:"sparkle sparkle-1"}),C.jsx("div",{className:"sparkle sparkle-2"}),C.jsx("div",{className:"sparkle sparkle-3"}),C.jsx("div",{className:"sparkle sparkle-4"}),C.jsx("div",{className:"sparkle sparkle-5"}),C.jsx("div",{className:"sparkle sparkle-6"}),C.jsx("div",{className:"kawaii-star",children:C.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",style:{imageRendering:"pixelated"},children:[C.jsx("rect",{x:"10",y:"0",width:"4",height:"2",fill:"#FFD700"}),C.jsx("rect",{x:"8",y:"2",width:"8",height:"2",fill:"#FFD700"}),C.jsx("rect",{x:"0",y:"4",width:"24",height:"2",fill:"#FFD700"}),C.jsx("rect",{x:"2",y:"6",width:"20",height:"2",fill:"#FFD700"}),C.jsx("rect",{x:"4",y:"8",width:"16",height:"2",fill:"#FFD700"}),C.jsx("rect",{x:"2",y:"10",width:"20",height:"2",fill:"#FFD700"}),C.jsx("rect",{x:"0",y:"12",width:"24",height:"2",fill:"#FFD700"}),C.jsx("rect",{x:"8",y:"14",width:"8",height:"2",fill:"#FFD700"}),C.jsx("rect",{x:"10",y:"16",width:"4",height:"2",fill:"#FFD700"}),C.jsx("rect",{x:"8",y:"6",width:"2",height:"2",fill:"#1a1a2e"}),C.jsx("rect",{x:"14",y:"6",width:"2",height:"2",fill:"#1a1a2e"}),C.jsx("rect",{x:"10",y:"10",width:"4",height:"2",fill:"#ff6b9d"}),C.jsx("rect",{x:"6",y:"8",width:"2",height:"2",fill:"#ff6b9d",opacity:"0.5"}),C.jsx("rect",{x:"16",y:"8",width:"2",height:"2",fill:"#ff6b9d",opacity:"0.5"})]})})]}):null}const oS={0:"text-[#f85149]",1:"text-[#e3b341]",2:"text-[#58a6ff]",3:"text-[#7d8590]",4:"text-muted-foreground"},tL={bug:"bg-[#da3633]/15 text-[#f85149] border-[#da3633]/30",feature:"bg-[#8957e5]/15 text-[#bc8cff] border-[#8957e5]/30",task:"bg-[#2dd4bf]/15 text-[#5eead4] border-[#2dd4bf]/30",epic:"bg-[#d29922]/15 text-[#e3b341] border-[#d29922]/30",chore:"bg-[#7d8590]/15 text-[#7d8590] border-[#7d8590]/30"};function iL({issue:e,onClick:t,celebrating:s}){const r=e.dependencies?.length||0,o=x.useRef(null),l=()=>{if(!t)return;const c=o.current;if(c){const h=c.getBoundingClientRect();t(e.id,{top:h.top,left:h.left,width:h.width,height:h.height})}else t(e.id)};return C.jsxs("div",{className:s?"celebration-card-wrapper":void 0,children:[s&&C.jsx(eL,{}),C.jsxs(Q5,{ref:o,"data-bead-id":e.id,className:"mb-2 p-2.5 gap-1 border-border animate-bead-enter cursor-pointer hover:border-primary/50 transition-colors",onClick:l,children:[C.jsxs("div",{className:"flex items-center justify-between gap-2",children:[C.jsx("code",{className:"text-xs text-muted-foreground",children:e.id}),C.jsxs("span",{className:`text-xs font-semibold ${oS[e.priority]||oS[4]}`,children:["P",e.priority]})]}),C.jsx(QC,{children:C.jsxs(JC,{children:[C.jsx(eE,{asChild:!0,children:C.jsx("p",{className:"text-sm font-medium leading-tight line-clamp-2",children:e.title})}),C.jsx(tE,{children:C.jsx("p",{children:e.title})})]})}),C.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap mt-1",children:[e.type&&C.jsx(Wu,{variant:"outline",className:tL[e.type]||"",children:e.type}),r>0&&C.jsxs("span",{className:"text-xs text-muted-foreground",children:[r," dep",r>1?"s":""]}),e.assignee&&C.jsx("span",{className:"text-xs text-muted-foreground ml-auto",children:e.assignee})]})]})]})}function sL(e,t){return[...e].sort((s,r)=>{if(t==="priority"){const o=(s.priority??4)-(r.priority??4);return o!==0?o:(r.updated_at??"").localeCompare(s.updated_at??"")}return(r.updated_at??"").localeCompare(s.updated_at??"")})}function iu({title:e,issues:t,accentColor:s,loading:r,sortable:o,onIssueClick:l,celebratingIds:c}){const[h,f]=x.useState("recent"),d=x.useMemo(()=>o?sL(t,h):t,[t,h,o]),p=()=>f(v=>v==="recent"?"priority":"recent");return C.jsxs("div",{className:"min-w-0 flex-1",children:[C.jsxs("div",{className:`flex items-center gap-2 px-3 py-2 border-b-2 sticky top-0 z-10 bg-background ${s}`,children:[C.jsx("h2",{className:"text-sm font-semibold",children:e}),C.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",t.length,")"]}),o&&C.jsxs("button",{onClick:p,title:h==="recent"?"Sorted by recent — click for priority":"Sorted by priority — click for recent",className:"ml-auto flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[C.jsx(M5,{className:"h-3 w-3"}),C.jsx("span",{children:h==="recent"?"Recent":"Priority"})]})]}),C.jsx("div",{className:"p-2",children:r?Array.from({length:3}).map((v,_)=>C.jsx(tl,{className:"h-24 mb-2 rounded-lg"},_)):d.length===0?C.jsx("p",{className:"text-xs text-muted-foreground text-center py-4",children:"No issues"}):d.map(v=>C.jsx(iL,{issue:v,onClick:l,celebrating:c?.has(v.id)},v.id))})]})}function nL(e){const t=x.useMemo(()=>e.map(c=>c.id).sort(),[e]),s=t.join(","),r=x.useRef(null),[o,l]=x.useState(new Set);return x.useEffect(()=>{const c=new Set(t);if(r.current===null||r.current.size===0){r.current=c;return}const h=new Set;for(const f of c)r.current.has(f)||h.add(f);if(r.current=c,h.size>0){l(h);const f=setTimeout(()=>l(new Set),2e3);return()=>clearTimeout(f)}},[s]),o}function rL({issues:e,ready:t,blocked:s,loading:r,onIssueClick:o}){const l=new Set(t.map(p=>p.id)),c=e.filter(p=>p.status==="in_progress"),h=e.filter(p=>p.status==="closed"),f=nL(h),d=e.filter(p=>p.status!=="in_progress"&&p.status!=="closed"&&!l.has(p.id));return C.jsx(hl,{className:"h-full",children:C.jsxs("div",{className:"flex gap-3",children:[C.jsx(iu,{title:"Backlog",issues:d,accentColor:"border-[#7d8590]",loading:r,onIssueClick:o}),C.jsx(iu,{title:"Ready",issues:t,accentColor:"border-[#238636]",loading:r,onIssueClick:o}),C.jsx(iu,{title:"In Progress",issues:c,accentColor:"border-[#1f6feb]",loading:r,onIssueClick:o}),C.jsx(iu,{title:"Done",issues:h,accentColor:"border-[#484f58]",loading:r,sortable:!0,onIssueClick:o,celebratingIds:f})]})})}function oL({className:e,orientation:t="horizontal",...s}){return C.jsx(cN,{"data-slot":"tabs","data-orientation":t,orientation:t,className:Kt("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...s})}const aL=ZC("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function lL({className:e,variant:t="default",...s}){return C.jsx(uN,{"data-slot":"tabs-list","data-variant":t,className:Kt(aL({variant:t}),e),...s})}function aS({className:e,...t}){return C.jsx(hN,{"data-slot":"tabs-trigger",className:Kt("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",e),...t})}function lS({className:e,...t}){return C.jsx(dN,{"data-slot":"tabs-content",className:Kt("flex-1 outline-none",e),...t})}function _u({...e}){return C.jsx(YO,{"data-slot":"select",...e})}function yu({...e}){return C.jsx(qO,{"data-slot":"select-value",...e})}function bu({className:e,size:t="default",children:s,...r}){return C.jsxs(KO,{"data-slot":"select-trigger","data-size":t,className:Kt("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",e),...r,children:[s,C.jsx(GO,{asChild:!0,children:C.jsx($C,{className:"size-4 opacity-50"})})]})}function Su({className:e,children:t,position:s="item-aligned",align:r="center",...o}){return C.jsx($O,{children:C.jsxs(XO,{"data-slot":"select-content",className:Kt("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",s==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:s,align:r,...o,children:[C.jsx(cL,{}),C.jsx(ZO,{className:Kt("p-1",s==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),C.jsx(uL,{})]})})}function Ga({className:e,children:t,...s}){return C.jsxs(QO,{"data-slot":"select-item",className:Kt("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...s,children:[C.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:C.jsx(eN,{children:C.jsx(N5,{className:"size-4"})})}),C.jsx(JO,{children:t})]})}function cL({className:e,...t}){return C.jsx(tN,{"data-slot":"select-scroll-up-button",className:Kt("flex cursor-default items-center justify-center py-1",e),...t,children:C.jsx(P5,{className:"size-4"})})}function uL({className:e,...t}){return C.jsx(iN,{"data-slot":"select-scroll-down-button",className:Kt("flex cursor-default items-center justify-center py-1",e),...t,children:C.jsx($C,{className:"size-4"})})}function hL({branches:e,current:t,onSelect:s}){return C.jsxs(_u,{value:t,onValueChange:s,children:[C.jsx(bu,{className:"w-full",children:C.jsx(yu,{placeholder:"Select branch"})}),C.jsx(Su,{children:e.map(r=>C.jsx(Ga,{value:r,children:r},r))})]})}const tp=/\b([\w]+-[\w]+-[a-z0-9]{2,8})\b/;function dL(e){const t=new Date(e),r=new Date().getTime()-t.getTime(),o=Math.floor(r/6e4);if(o<1)return"just now";if(o<60)return`${o}m ago`;const l=Math.floor(o/60);return l<24?`${l}h ago`:`${Math.floor(l/24)}d ago`}function cS(e,t){return e.split(new RegExp(tp.source,"g")).map((r,o)=>tp.test(r)?C.jsx(Wu,{variant:"outline",className:t?"mx-0.5 text-xs cursor-pointer hover:underline hover:bg-accent/50 transition-colors":"mx-0.5 text-xs",onClick:t?l=>{l.stopPropagation(),t(r)}:void 0,children:r},o):C.jsx("span",{children:r},o))}function fL(e){const t=[];let s;const r=new RegExp(tp.source,"g");for(;(s=r.exec(e))!==null;)t.push(s[1]);return t}function mL({commit:e,onBeadClick:t,highlightedBeadId:s}){const r=fL(e.message),o=s?r.includes(s):!1;return C.jsxs("div",{className:`flex flex-col gap-0.5 py-2 px-3 border-b border-border last:border-0 animate-bead-enter min-w-0 transition-colors ${o?"animate-commit-highlight bg-primary/10":""}`,...r.length>0?{"data-commit-beads":r.join(" ")}:{},children:[C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("code",{className:"text-xs text-muted-foreground shrink-0",children:e.hash}),C.jsx("span",{className:"text-xs text-muted-foreground ml-auto shrink-0",children:dL(e.date)})]}),e.body?C.jsx(QC,{children:C.jsxs(JC,{children:[C.jsx(eE,{asChild:!0,children:C.jsx("p",{className:"text-sm leading-tight break-words cursor-help",children:cS(e.message,t)})}),C.jsxs(tE,{side:"bottom",className:"max-w-sm whitespace-pre-wrap text-xs",children:[C.jsx("p",{className:"font-semibold mb-1",children:e.message}),C.jsx("p",{children:e.body})]})]})}):C.jsx("p",{className:"text-sm leading-tight break-words",children:cS(e.message,t)}),C.jsx("span",{className:"text-xs text-muted-foreground",children:e.author})]})}function In(e,t=5e3){const[s,r]=x.useState(null),[o,l]=x.useState(null),[c,h]=x.useState(!0),[f,d]=x.useState(null),p=x.useRef(null),v=x.useCallback(async()=>{try{const _=await e();r(_),l(null),d(new Date)}catch(_){l(_ instanceof Error?_.message:"Unknown error")}finally{h(!1)}},[e]);return x.useEffect(()=>(v(),p.current=setInterval(v,t),()=>{p.current&&clearInterval(p.current)}),[v,t]),{data:s,error:o,loading:c,lastUpdated:f}}const pL="";async function Vn(e){const t=await fetch(`${pL}${e}`);if(!t.ok)throw new Error(`API error: ${t.status}`);return t.json()}function gL(){const e=x.useCallback(()=>Vn("/api/issues"),[]);return In(e)}function vL(){const e=x.useCallback(()=>Vn("/api/ready"),[]);return In(e)}function _L(){const e=x.useCallback(()=>Vn("/api/blocked"),[]);return In(e)}function yL(e,t=50){const s=x.useCallback(()=>Vn(`/api/git-log?branch=${encodeURIComponent(e)}&limit=${t}`),[e,t]);return In(s)}function bL(){const e=x.useCallback(()=>Vn("/api/branches"),[]);return In(e,3e4)}function SL(e){const t=x.useCallback(()=>e?Vn(`/api/git-diff?file=${encodeURIComponent(e)}`):Promise.resolve(null),[e]);return In(t,1e4)}function wL(){const e=x.useCallback(()=>Vn("/api/git-status"),[]);return In(e)}function xL(){const e=x.useCallback(()=>Vn("/api/project"),[]);return In(e,6e4)}function CL(e){const t=e.split(`
|
|
50
|
+
`),s=[];for(const r of t)r.startsWith("@@")?s.push({type:"hunk",content:r}):r.startsWith("---")||r.startsWith("+++")?s.push({type:"header",content:r}):r.startsWith("+")?s.push({type:"add",content:r.substring(1)}):r.startsWith("-")?s.push({type:"remove",content:r.substring(1)}):r===""?s.push({type:"empty",content:""}):s.push({type:"context",content:r.startsWith(" ")?r.substring(1):r});return s}const EL={header:"bg-muted/50 text-muted-foreground font-bold",hunk:"bg-blue-500/10 text-blue-400",add:"bg-green-500/15 text-green-300",remove:"bg-red-500/15 text-red-300",context:"text-foreground/80",empty:"text-foreground/80"},TL={header:"",hunk:"",add:"+",remove:"-",context:" ",empty:" "};function kL({file:e,onBack:t}){const{data:s,loading:r}=SL(e),o=s?.diff?CL(s.diff):[],l=e.split("/").pop()||e;return C.jsxs("div",{className:"flex flex-col h-full",children:[C.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border shrink-0",children:[C.jsx("button",{onClick:t,className:"p-1 rounded-md hover:bg-accent text-muted-foreground hover:text-foreground transition-colors",title:"Back to file list",children:C.jsx(GC,{className:"h-4 w-4"})}),C.jsx("span",{className:"text-xs font-mono text-foreground truncate",title:e,children:l})]}),C.jsx(hl,{className:"flex-1 min-h-0",children:r&&!s?Array.from({length:8}).map((c,h)=>C.jsx(tl,{className:"h-5 mx-3 mb-1 rounded"},h)):o.length>0?C.jsx("div",{className:"text-xs font-mono leading-5",children:o.map((c,h)=>C.jsxs("div",{className:`px-3 ${EL[c.type]}`,children:[C.jsx("span",{className:"inline-block w-4 text-muted-foreground/50 select-none mr-2 text-right",children:TL[c.type]}),C.jsx("span",{className:"whitespace-pre-wrap break-all",children:(c.type==="hunk",c.content)})]},h))}):C.jsx("p",{className:"text-xs text-muted-foreground text-center py-4",children:"No diff available"})})]})}const AL={M:{label:"Modified",color:"text-yellow-400"},A:{label:"Added",color:"text-green-400"},D:{label:"Deleted",color:"text-red-400"},R:{label:"Renamed",color:"text-blue-400"},C:{label:"Copied",color:"text-blue-400"},"??":{label:"Untracked",color:"text-muted-foreground"},MM:{label:"Modified",color:"text-yellow-400"},AM:{label:"Added",color:"text-green-400"}};function RL(e){return AL[e]||{label:e,color:"text-muted-foreground"}}function ML({onCollapse:e,onBeadClick:t,highlightedBeadId:s}){const{data:r,loading:o}=bL(),[l,c]=x.useState(""),[h,f]=x.useState(()=>localStorage.getItem("beads-board-git-tab")||"log"),[d,p]=x.useState(null),v=l||r?.current||"",{data:_,loading:y}=yL(v),{data:b,loading:S}=wL();return C.jsx("div",{className:"flex flex-col h-full border-l border-border",children:d?C.jsx(kL,{file:d,onBack:()=>p(null)}):C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:"p-3 border-b border-border shrink-0",children:[C.jsxs("div",{className:"flex items-center justify-between mb-2",children:[C.jsx("h2",{className:"text-sm font-semibold",children:"Git"}),e&&C.jsx("button",{onClick:e,className:"p-1 rounded-md hover:bg-accent text-muted-foreground hover:text-foreground transition-colors",title:"Collapse git log",children:C.jsx(W5,{className:"h-4 w-4"})})]}),o?C.jsx(tl,{className:"h-9 w-full"}):r?C.jsx(hL,{branches:r.branches,current:v,onSelect:c}):null]}),C.jsxs(oL,{value:h,onValueChange:E=>{f(E),localStorage.setItem("beads-board-git-tab",E)},className:"flex flex-col flex-1 min-h-0",children:[C.jsxs(lL,{className:"mx-3 mt-2 shrink-0",children:[C.jsxs(aS,{value:"log",className:"gap-1.5",children:[C.jsx(I5,{className:"h-3.5 w-3.5"}),"Log"]}),C.jsxs(aS,{value:"diff",className:"gap-1.5",children:[C.jsx(j5,{className:"h-3.5 w-3.5"}),"Diff",b&&b.length>0&&C.jsx("span",{className:"ml-1 text-xs bg-primary/20 text-primary rounded-full px-1.5",children:b.length})]})]}),C.jsx(lS,{value:"log",className:"flex-1 min-h-0 mt-0",children:C.jsx(hl,{className:"h-full",children:y?Array.from({length:5}).map((E,A)=>C.jsx(tl,{className:"h-16 mx-3 mb-2 rounded"},A)):_?.length?_.map(E=>C.jsx(mL,{commit:E,onBeadClick:t,highlightedBeadId:s},E.hash)):C.jsx("p",{className:"text-xs text-muted-foreground text-center py-4",children:"No commits"})})}),C.jsx(lS,{value:"diff",className:"flex-1 min-h-0 mt-0",children:C.jsx(hl,{className:"h-full",children:S?Array.from({length:3}).map((E,A)=>C.jsx(tl,{className:"h-8 mx-3 mb-2 rounded"},A)):b?.length?C.jsx("div",{className:"px-3 py-2 space-y-1",children:b.map((E,A)=>{const R=RL(E.status);return C.jsxs("div",{className:"flex items-center gap-2 py-1.5 px-2 rounded-md hover:bg-accent/50 text-xs font-mono cursor-pointer",onClick:()=>p(E.path),children:[C.jsx("span",{className:"text-foreground truncate flex-1",title:E.path,children:E.path}),C.jsx("span",{className:`shrink-0 w-20 text-right ${R.color}`,children:R.label})]},A)})}):C.jsx("p",{className:"text-xs text-muted-foreground text-center py-4",children:"Working tree clean"})})})]})]})})}function DL(){const[e,t]=x.useState(()=>typeof window>"u"?"dark":localStorage.getItem("beads-board-theme")||"dark");return x.useEffect(()=>{const r=document.documentElement;r.classList.remove("light","dark"),r.classList.add(e),localStorage.setItem("beads-board-theme",e)},[e]),{theme:e,toggle:()=>t(r=>r==="dark"?"light":"dark")}}function OL(){const{theme:e,toggle:t}=DL();return C.jsx("button",{onClick:t,className:"rounded-md p-2 hover:bg-muted transition-colors","aria-label":"Toggle theme",children:e==="dark"?"☀️":"🌙"})}const Ag=x.createContext({});function Rg(e){const t=x.useRef(null);return t.current===null&&(t.current=e()),t.current}const NL=typeof window<"u",iE=NL?x.useLayoutEffect:x.useEffect,Sh=x.createContext(null);function Mg(e,t){e.indexOf(t)===-1&&e.push(t)}function Yu(e,t){const s=e.indexOf(t);s>-1&&e.splice(s,1)}const vs=(e,t,s)=>s>t?t:s<e?e:s;let Dg=()=>{};const Ys={},sE=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function nE(e){return typeof e=="object"&&e!==null}const rE=e=>/^0[^.\s]+$/u.test(e);function oE(e){let t;return()=>(t===void 0&&(t=e()),t)}const Wi=e=>e,LL=(e,t)=>s=>t(e(s)),xl=(...e)=>e.reduce(LL),dl=(e,t,s)=>{const r=t-e;return r===0?1:(s-e)/r};class Og{constructor(){this.subscriptions=[]}add(t){return Mg(this.subscriptions,t),()=>Yu(this.subscriptions,t)}notify(t,s,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,s,r);else for(let l=0;l<o;l++){const c=this.subscriptions[l];c&&c(t,s,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const ki=e=>e*1e3,Fi=e=>e/1e3;function aE(e,t){return t?e*(1e3/t):0}const lE=(e,t,s)=>(((1-3*s+3*t)*e+(3*s-6*t))*e+3*t)*e,BL=1e-7,PL=12;function zL(e,t,s,r,o){let l,c,h=0;do c=t+(s-t)/2,l=lE(c,r,o)-e,l>0?s=c:t=c;while(Math.abs(l)>BL&&++h<PL);return c}function Cl(e,t,s,r){if(e===t&&s===r)return Wi;const o=l=>zL(l,0,1,e,s);return l=>l===0||l===1?l:lE(o(l),t,r)}const cE=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,uE=e=>t=>1-e(1-t),hE=Cl(.33,1.53,.69,.99),Ng=uE(hE),dE=cE(Ng),fE=e=>(e*=2)<1?.5*Ng(e):.5*(2-Math.pow(2,-10*(e-1))),Lg=e=>1-Math.sin(Math.acos(e)),mE=uE(Lg),pE=cE(Lg),jL=Cl(.42,0,1,1),HL=Cl(0,0,.58,1),gE=Cl(.42,0,.58,1),IL=e=>Array.isArray(e)&&typeof e[0]!="number",vE=e=>Array.isArray(e)&&typeof e[0]=="number",VL={linear:Wi,easeIn:jL,easeInOut:gE,easeOut:HL,circIn:Lg,circInOut:pE,circOut:mE,backIn:Ng,backInOut:dE,backOut:hE,anticipate:fE},UL=e=>typeof e=="string",uS=e=>{if(vE(e)){Dg(e.length===4);const[t,s,r,o]=e;return Cl(t,s,r,o)}else if(UL(e))return VL[e];return e},su=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function FL(e,t){let s=new Set,r=new Set,o=!1,l=!1;const c=new WeakSet;let h={delta:0,timestamp:0,isProcessing:!1};function f(p){c.has(p)&&(d.schedule(p),e()),p(h)}const d={schedule:(p,v=!1,_=!1)=>{const b=_&&o?s:r;return v&&c.add(p),b.has(p)||b.add(p),p},cancel:p=>{r.delete(p),c.delete(p)},process:p=>{if(h=p,o){l=!0;return}o=!0,[s,r]=[r,s],s.forEach(f),s.clear(),o=!1,l&&(l=!1,d.process(p))}};return d}const WL=40;function _E(e,t){let s=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},l=()=>s=!0,c=su.reduce((M,k)=>(M[k]=FL(l),M),{}),{setup:h,read:f,resolveKeyframes:d,preUpdate:p,update:v,preRender:_,render:y,postRender:b}=c,S=()=>{const M=Ys.useManualTiming?o.timestamp:performance.now();s=!1,Ys.useManualTiming||(o.delta=r?1e3/60:Math.max(Math.min(M-o.timestamp,WL),1)),o.timestamp=M,o.isProcessing=!0,h.process(o),f.process(o),d.process(o),p.process(o),v.process(o),_.process(o),y.process(o),b.process(o),o.isProcessing=!1,s&&t&&(r=!1,e(S))},E=()=>{s=!0,r=!0,o.isProcessing||e(S)};return{schedule:su.reduce((M,k)=>{const j=c[k];return M[k]=(F,W=!1,V=!1)=>(s||E(),j.schedule(F,W,V)),M},{}),cancel:M=>{for(let k=0;k<su.length;k++)c[su[k]].cancel(M)},state:o,steps:c}}const{schedule:et,cancel:Bn,state:Ft,steps:cm}=_E(typeof requestAnimationFrame<"u"?requestAnimationFrame:Wi,!0);let wu;function YL(){wu=void 0}const ei={now:()=>(wu===void 0&&ei.set(Ft.isProcessing||Ys.useManualTiming?Ft.timestamp:performance.now()),wu),set:e=>{wu=e,queueMicrotask(YL)}},yE=e=>t=>typeof t=="string"&&t.startsWith(e),bE=yE("--"),KL=yE("var(--"),Bg=e=>KL(e)?qL.test(e.split("/*")[0].trim()):!1,qL=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function hS(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Ho={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},fl={...Ho,transform:e=>vs(0,1,e)},nu={...Ho,default:1},il=e=>Math.round(e*1e5)/1e5,Pg=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function GL(e){return e==null}const $L=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,zg=(e,t)=>s=>!!(typeof s=="string"&&$L.test(s)&&s.startsWith(e)||t&&!GL(s)&&Object.prototype.hasOwnProperty.call(s,t)),SE=(e,t,s)=>r=>{if(typeof r!="string")return r;const[o,l,c,h]=r.match(Pg);return{[e]:parseFloat(o),[t]:parseFloat(l),[s]:parseFloat(c),alpha:h!==void 0?parseFloat(h):1}},XL=e=>vs(0,255,e),um={...Ho,transform:e=>Math.round(XL(e))},pr={test:zg("rgb","red"),parse:SE("red","green","blue"),transform:({red:e,green:t,blue:s,alpha:r=1})=>"rgba("+um.transform(e)+", "+um.transform(t)+", "+um.transform(s)+", "+il(fl.transform(r))+")"};function ZL(e){let t="",s="",r="",o="";return e.length>5?(t=e.substring(1,3),s=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),s=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,s+=s,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(s,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const ip={test:zg("#"),parse:ZL,transform:pr.transform},El=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),An=El("deg"),ps=El("%"),be=El("px"),QL=El("vh"),JL=El("vw"),dS={...ps,parse:e=>ps.parse(e)/100,transform:e=>ps.transform(e*100)},bo={test:zg("hsl","hue"),parse:SE("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:s,alpha:r=1})=>"hsla("+Math.round(e)+", "+ps.transform(il(t))+", "+ps.transform(il(s))+", "+il(fl.transform(r))+")"},wt={test:e=>pr.test(e)||ip.test(e)||bo.test(e),parse:e=>pr.test(e)?pr.parse(e):bo.test(e)?bo.parse(e):ip.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?pr.transform(e):bo.transform(e),getAnimatableNone:e=>{const t=wt.parse(e);return t.alpha=0,wt.transform(t)}},e3=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function t3(e){return isNaN(e)&&typeof e=="string"&&(e.match(Pg)?.length||0)+(e.match(e3)?.length||0)>0}const wE="number",xE="color",i3="var",s3="var(",fS="${}",n3=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Oo(e){const t=e.toString(),s=[],r={color:[],number:[],var:[]},o=[];let l=0;const h=t.replace(n3,f=>(wt.test(f)?(r.color.push(l),o.push(xE),s.push(wt.parse(f))):f.startsWith(s3)?(r.var.push(l),o.push(i3),s.push(f)):(r.number.push(l),o.push(wE),s.push(parseFloat(f))),++l,fS)).split(fS);return{values:s,split:h,indexes:r,types:o}}function r3(e){return Oo(e).values}function CE({split:e,types:t}){const s=e.length;return r=>{let o="";for(let l=0;l<s;l++)if(o+=e[l],r[l]!==void 0){const c=t[l];c===wE?o+=il(r[l]):c===xE?o+=wt.transform(r[l]):o+=r[l]}return o}}function o3(e){return CE(Oo(e))}const a3=e=>typeof e=="number"?0:wt.test(e)?wt.getAnimatableNone(e):e,l3=(e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:a3(e);function c3(e){const t=Oo(e);return CE(t)(t.values.map((r,o)=>l3(r,t.split[o])))}const Ji={test:t3,parse:r3,createTransformer:o3,getAnimatableNone:c3};function hm(e,t,s){return s<0&&(s+=1),s>1&&(s-=1),s<1/6?e+(t-e)*6*s:s<1/2?t:s<2/3?e+(t-e)*(2/3-s)*6:e}function u3({hue:e,saturation:t,lightness:s,alpha:r}){e/=360,t/=100,s/=100;let o=0,l=0,c=0;if(!t)o=l=c=s;else{const h=s<.5?s*(1+t):s+t-s*t,f=2*s-h;o=hm(f,h,e+1/3),l=hm(f,h,e),c=hm(f,h,e-1/3)}return{red:Math.round(o*255),green:Math.round(l*255),blue:Math.round(c*255),alpha:r}}function Ku(e,t){return s=>s>0?t:e}const lt=(e,t,s)=>e+(t-e)*s,dm=(e,t,s)=>{const r=e*e,o=s*(t*t-r)+r;return o<0?0:Math.sqrt(o)},h3=[ip,pr,bo],d3=e=>h3.find(t=>t.test(e));function mS(e){const t=d3(e);if(!t)return!1;let s=t.parse(e);return t===bo&&(s=u3(s)),s}const pS=(e,t)=>{const s=mS(e),r=mS(t);if(!s||!r)return Ku(e,t);const o={...s};return l=>(o.red=dm(s.red,r.red,l),o.green=dm(s.green,r.green,l),o.blue=dm(s.blue,r.blue,l),o.alpha=lt(s.alpha,r.alpha,l),pr.transform(o))},sp=new Set(["none","hidden"]);function f3(e,t){return sp.has(e)?s=>s<=0?e:t:s=>s>=1?t:e}function m3(e,t){return s=>lt(e,t,s)}function jg(e){return typeof e=="number"?m3:typeof e=="string"?Bg(e)?Ku:wt.test(e)?pS:v3:Array.isArray(e)?EE:typeof e=="object"?wt.test(e)?pS:p3:Ku}function EE(e,t){const s=[...e],r=s.length,o=e.map((l,c)=>jg(l)(l,t[c]));return l=>{for(let c=0;c<r;c++)s[c]=o[c](l);return s}}function p3(e,t){const s={...e,...t},r={};for(const o in s)e[o]!==void 0&&t[o]!==void 0&&(r[o]=jg(e[o])(e[o],t[o]));return o=>{for(const l in r)s[l]=r[l](o);return s}}function g3(e,t){const s=[],r={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const l=t.types[o],c=e.indexes[l][r[l]],h=e.values[c]??0;s[o]=h,r[l]++}return s}const v3=(e,t)=>{const s=Ji.createTransformer(t),r=Oo(e),o=Oo(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?sp.has(e)&&!o.values.length||sp.has(t)&&!r.values.length?f3(e,t):xl(EE(g3(r,o),o.values),s):Ku(e,t)};function TE(e,t,s){return typeof e=="number"&&typeof t=="number"&&typeof s=="number"?lt(e,t,s):jg(e)(e,t)}const _3=e=>{const t=({timestamp:s})=>e(s);return{start:(s=!0)=>et.update(t,s),stop:()=>Bn(t),now:()=>Ft.isProcessing?Ft.timestamp:ei.now()}},kE=(e,t,s=10)=>{let r="";const o=Math.max(Math.round(t/s),2);for(let l=0;l<o;l++)r+=Math.round(e(l/(o-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},qu=2e4;function Hg(e){let t=0;const s=50;let r=e.next(t);for(;!r.done&&t<qu;)t+=s,r=e.next(t);return t>=qu?1/0:t}function y3(e,t=100,s){const r=s({...e,keyframes:[0,t]}),o=Math.min(Hg(r),qu);return{type:"keyframes",ease:l=>r.next(o*l).value/t,duration:Fi(o)}}const ht={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function np(e,t){return e*Math.sqrt(1-t*t)}const b3=12;function S3(e,t,s){let r=s;for(let o=1;o<b3;o++)r=r-e(r)/t(r);return r}const fm=.001;function w3({duration:e=ht.duration,bounce:t=ht.bounce,velocity:s=ht.velocity,mass:r=ht.mass}){let o,l,c=1-t;c=vs(ht.minDamping,ht.maxDamping,c),e=vs(ht.minDuration,ht.maxDuration,Fi(e)),c<1?(o=d=>{const p=d*c,v=p*e,_=p-s,y=np(d,c),b=Math.exp(-v);return fm-_/y*b},l=d=>{const v=d*c*e,_=v*s+s,y=Math.pow(c,2)*Math.pow(d,2)*e,b=Math.exp(-v),S=np(Math.pow(d,2),c);return(-o(d)+fm>0?-1:1)*((_-y)*b)/S}):(o=d=>{const p=Math.exp(-d*e),v=(d-s)*e+1;return-fm+p*v},l=d=>{const p=Math.exp(-d*e),v=(s-d)*(e*e);return p*v});const h=5/e,f=S3(o,l,h);if(e=ki(e),isNaN(f))return{stiffness:ht.stiffness,damping:ht.damping,duration:e};{const d=Math.pow(f,2)*r;return{stiffness:d,damping:c*2*Math.sqrt(r*d),duration:e}}}const x3=["duration","bounce"],C3=["stiffness","damping","mass"];function gS(e,t){return t.some(s=>e[s]!==void 0)}function E3(e){let t={velocity:ht.velocity,stiffness:ht.stiffness,damping:ht.damping,mass:ht.mass,isResolvedFromDuration:!1,...e};if(!gS(e,C3)&&gS(e,x3))if(t.velocity=0,e.visualDuration){const s=e.visualDuration,r=2*Math.PI/(s*1.2),o=r*r,l=2*vs(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:ht.mass,stiffness:o,damping:l}}else{const s=w3({...e,velocity:0});t={...t,...s,mass:ht.mass},t.isResolvedFromDuration=!0}return t}function Gu(e=ht.visualDuration,t=ht.bounce){const s=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=s;const l=s.keyframes[0],c=s.keyframes[s.keyframes.length-1],h={done:!1,value:l},{stiffness:f,damping:d,mass:p,duration:v,velocity:_,isResolvedFromDuration:y}=E3({...s,velocity:-Fi(s.velocity||0)}),b=_||0,S=d/(2*Math.sqrt(f*p)),E=c-l,A=Fi(Math.sqrt(f/p)),R=Math.abs(E)<5;r||(r=R?ht.restSpeed.granular:ht.restSpeed.default),o||(o=R?ht.restDelta.granular:ht.restDelta.default);let M,k,j,F,W,V;if(S<1)j=np(A,S),F=(b+S*A*E)/j,M=U=>{const G=Math.exp(-S*A*U);return c-G*(F*Math.sin(j*U)+E*Math.cos(j*U))},W=S*A*F+E*j,V=S*A*E-F*j,k=U=>Math.exp(-S*A*U)*(W*Math.sin(j*U)+V*Math.cos(j*U));else if(S===1){M=G=>c-Math.exp(-A*G)*(E+(b+A*E)*G);const U=b+A*E;k=G=>Math.exp(-A*G)*(A*U*G-b)}else{const U=A*Math.sqrt(S*S-1);M=P=>{const q=Math.exp(-S*A*P),T=Math.min(U*P,300);return c-q*((b+S*A*E)*Math.sinh(T)+U*E*Math.cosh(T))/U};const G=(b+S*A*E)/U,z=S*A*G-E*U,L=S*A*E-G*U;k=P=>{const q=Math.exp(-S*A*P),T=Math.min(U*P,300);return q*(z*Math.sinh(T)+L*Math.cosh(T))}}const ee={calculatedDuration:y&&v||null,velocity:U=>ki(k(U)),next:U=>{if(!y&&S<1){const z=Math.exp(-S*A*U),L=Math.sin(j*U),P=Math.cos(j*U),q=c-z*(F*L+E*P),T=ki(z*(W*L+V*P));return h.done=Math.abs(T)<=r&&Math.abs(c-q)<=o,h.value=h.done?c:q,h}const G=M(U);if(y)h.done=U>=v;else{const z=ki(k(U));h.done=Math.abs(z)<=r&&Math.abs(c-G)<=o}return h.value=h.done?c:G,h},toString:()=>{const U=Math.min(Hg(ee),qu),G=kE(z=>ee.next(U*z).value,U,30);return U+"ms "+G},toTransition:()=>{}};return ee}Gu.applyToOptions=e=>{const t=y3(e,100,Gu);return e.ease=t.ease,e.duration=ki(t.duration),e.type="keyframes",e};const T3=5;function AE(e,t,s){const r=Math.max(t-T3,0);return aE(s-e(r),t-r)}function rp({keyframes:e,velocity:t=0,power:s=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:l=500,modifyTarget:c,min:h,max:f,restDelta:d=.5,restSpeed:p}){const v=e[0],_={done:!1,value:v},y=V=>h!==void 0&&V<h||f!==void 0&&V>f,b=V=>h===void 0?f:f===void 0||Math.abs(h-V)<Math.abs(f-V)?h:f;let S=s*t;const E=v+S,A=c===void 0?E:c(E);A!==E&&(S=A-v);const R=V=>-S*Math.exp(-V/r),M=V=>A+R(V),k=V=>{const ee=R(V),U=M(V);_.done=Math.abs(ee)<=d,_.value=_.done?A:U};let j,F;const W=V=>{y(_.value)&&(j=V,F=Gu({keyframes:[_.value,b(_.value)],velocity:AE(M,V,_.value),damping:o,stiffness:l,restDelta:d,restSpeed:p}))};return W(0),{calculatedDuration:null,next:V=>{let ee=!1;return!F&&j===void 0&&(ee=!0,k(V),W(V)),j!==void 0&&V>=j?F.next(V-j):(!ee&&k(V),_)}}}function k3(e,t,s){const r=[],o=s||Ys.mix||TE,l=e.length-1;for(let c=0;c<l;c++){let h=o(e[c],e[c+1]);if(t){const f=Array.isArray(t)?t[c]||Wi:t;h=xl(f,h)}r.push(h)}return r}function A3(e,t,{clamp:s=!0,ease:r,mixer:o}={}){const l=e.length;if(Dg(l===t.length),l===1)return()=>t[0];if(l===2&&t[0]===t[1])return()=>t[1];const c=e[0]===e[1];e[0]>e[l-1]&&(e=[...e].reverse(),t=[...t].reverse());const h=k3(t,r,o),f=h.length,d=p=>{if(c&&p<e[0])return t[0];let v=0;if(f>1)for(;v<e.length-2&&!(p<e[v+1]);v++);const _=dl(e[v],e[v+1],p);return h[v](_)};return s?p=>d(vs(e[0],e[l-1],p)):d}function R3(e,t){const s=e[e.length-1];for(let r=1;r<=t;r++){const o=dl(0,t,r);e.push(lt(s,1,o))}}function M3(e){const t=[0];return R3(t,e.length-1),t}function D3(e,t){return e.map(s=>s*t)}function O3(e,t){return e.map(()=>t||gE).splice(0,e.length-1)}function sl({duration:e=300,keyframes:t,times:s,ease:r="easeInOut"}){const o=IL(r)?r.map(uS):uS(r),l={done:!1,value:t[0]},c=D3(s&&s.length===t.length?s:M3(t),e),h=A3(c,t,{ease:Array.isArray(o)?o:O3(t,o)});return{calculatedDuration:e,next:f=>(l.value=h(f),l.done=f>=e,l)}}const N3=e=>e!==null;function Ig(e,{repeat:t,repeatType:s="loop"},r,o=1){const l=e.filter(N3),h=o<0||t&&s!=="loop"&&t%2===1?0:l.length-1;return!h||r===void 0?l[h]:r}const L3={decay:rp,inertia:rp,tween:sl,keyframes:sl,spring:Gu};function RE(e){typeof e.type=="string"&&(e.type=L3[e.type])}class Vg{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,s){return this.finished.then(t,s)}}const B3=e=>e/100;class Ug extends Vg{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:s}=this.options;s&&s.updatedAt!==ei.now()&&this.tick(ei.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;RE(t);const{type:s=sl,repeat:r=0,repeatDelay:o=0,repeatType:l,velocity:c=0}=t;let{keyframes:h}=t;const f=s||sl;f!==sl&&typeof h[0]!="number"&&(this.mixKeyframes=xl(B3,TE(h[0],h[1])),h=[0,100]);const d=f({...t,keyframes:h});l==="mirror"&&(this.mirroredGenerator=f({...t,keyframes:[...h].reverse(),velocity:-c})),d.calculatedDuration===null&&(d.calculatedDuration=Hg(d));const{calculatedDuration:p}=d;this.calculatedDuration=p,this.resolvedDuration=p+o,this.totalDuration=this.resolvedDuration*(r+1)-o,this.generator=d}updateTime(t){const s=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=s}tick(t,s=!1){const{generator:r,totalDuration:o,mixKeyframes:l,mirroredGenerator:c,resolvedDuration:h,calculatedDuration:f}=this;if(this.startTime===null)return r.next(0);const{delay:d=0,keyframes:p,repeat:v,repeatType:_,repeatDelay:y,type:b,onUpdate:S,finalKeyframe:E}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),s?this.currentTime=t:this.updateTime(t);const A=this.currentTime-d*(this.playbackSpeed>=0?1:-1),R=this.playbackSpeed>=0?A<0:A>o;this.currentTime=Math.max(A,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let M=this.currentTime,k=r;if(v){const V=Math.min(this.currentTime,o)/h;let ee=Math.floor(V),U=V%1;!U&&V>=1&&(U=1),U===1&&ee--,ee=Math.min(ee,v+1),ee%2&&(_==="reverse"?(U=1-U,y&&(U-=y/h)):_==="mirror"&&(k=c)),M=vs(0,1,U)*h}const j=R?{done:!1,value:p[0]}:k.next(M);l&&!R&&(j.value=l(j.value));let{done:F}=j;!R&&f!==null&&(F=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const W=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&F);return W&&b!==rp&&(j.value=Ig(p,this.options,E,this.speed)),S&&S(j.value),W&&this.finish(),j}then(t,s){return this.finished.then(t,s)}get duration(){return Fi(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Fi(t)}get time(){return Fi(this.currentTime)}set time(t){t=ki(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const s=this.generator.next(t).value;return AE(r=>this.generator.next(r).value,t,s)}get speed(){return this.playbackSpeed}set speed(t){const s=this.playbackSpeed!==t;s&&this.driver&&this.updateTime(ei.now()),this.playbackSpeed=t,s&&this.driver&&(this.time=Fi(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=_3,startTime:s}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=s??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(ei.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function P3(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const gr=e=>e*180/Math.PI,op=e=>{const t=gr(Math.atan2(e[1],e[0]));return ap(t)},z3={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:op,rotateZ:op,skewX:e=>gr(Math.atan(e[1])),skewY:e=>gr(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},ap=e=>(e=e%360,e<0&&(e+=360),e),vS=op,_S=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),yS=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),j3={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:_S,scaleY:yS,scale:e=>(_S(e)+yS(e))/2,rotateX:e=>ap(gr(Math.atan2(e[6],e[5]))),rotateY:e=>ap(gr(Math.atan2(-e[2],e[0]))),rotateZ:vS,rotate:vS,skewX:e=>gr(Math.atan(e[4])),skewY:e=>gr(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function lp(e){return e.includes("scale")?1:0}function cp(e,t){if(!e||e==="none")return lp(t);const s=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(s)r=j3,o=s;else{const h=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=z3,o=h}if(!o)return lp(t);const l=r[t],c=o[1].split(",").map(I3);return typeof l=="function"?l(c):c[l]}const H3=(e,t)=>{const{transform:s="none"}=getComputedStyle(e);return cp(s,t)};function I3(e){return parseFloat(e.trim())}const Io=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Vo=new Set(Io),bS=e=>e===Ho||e===be,V3=new Set(["x","y","z"]),U3=Io.filter(e=>!V3.has(e));function F3(e){const t=[];return U3.forEach(s=>{const r=e.getValue(s);r!==void 0&&(t.push([s,r.get()]),r.set(s.startsWith("scale")?1:0))}),t}const Mn={width:({x:e},{paddingLeft:t="0",paddingRight:s="0"})=>e.max-e.min-parseFloat(t)-parseFloat(s),height:({y:e},{paddingTop:t="0",paddingBottom:s="0"})=>e.max-e.min-parseFloat(t)-parseFloat(s),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>cp(t,"x"),y:(e,{transform:t})=>cp(t,"y")};Mn.translateX=Mn.x;Mn.translateY=Mn.y;const _r=new Set;let up=!1,hp=!1,dp=!1;function ME(){if(hp){const e=Array.from(_r).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),s=new Map;t.forEach(r=>{const o=F3(r);o.length&&(s.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const o=s.get(r);o&&o.forEach(([l,c])=>{r.getValue(l)?.set(c)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}hp=!1,up=!1,_r.forEach(e=>e.complete(dp)),_r.clear()}function DE(){_r.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(hp=!0)})}function W3(){dp=!0,DE(),ME(),dp=!1}class Fg{constructor(t,s,r,o,l,c=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=s,this.name=r,this.motionValue=o,this.element=l,this.isAsync=c}scheduleResolve(){this.state="scheduled",this.isAsync?(_r.add(this),up||(up=!0,et.read(DE),et.resolveKeyframes(ME))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:s,element:r,motionValue:o}=this;if(t[0]===null){const l=o?.get(),c=t[t.length-1];if(l!==void 0)t[0]=l;else if(r&&s){const h=r.readValue(s,c);h!=null&&(t[0]=h)}t[0]===void 0&&(t[0]=c),o&&l===void 0&&o.set(t[0])}P3(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),_r.delete(this)}cancel(){this.state==="scheduled"&&(_r.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Y3=e=>e.startsWith("--");function OE(e,t,s){Y3(t)?e.style.setProperty(t,s):e.style[t]=s}const K3={};function NE(e,t){const s=oE(e);return()=>K3[t]??s()}const q3=NE(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),LE=NE(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),$a=([e,t,s,r])=>`cubic-bezier(${e}, ${t}, ${s}, ${r})`,SS={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:$a([0,.65,.55,1]),circOut:$a([.55,0,1,.45]),backIn:$a([.31,.01,.66,-.59]),backOut:$a([.33,1.53,.69,.99])};function BE(e,t){if(e)return typeof e=="function"?LE()?kE(e,t):"ease-out":vE(e)?$a(e):Array.isArray(e)?e.map(s=>BE(s,t)||SS.easeOut):SS[e]}function G3(e,t,s,{delay:r=0,duration:o=300,repeat:l=0,repeatType:c="loop",ease:h="easeOut",times:f}={},d=void 0){const p={[t]:s};f&&(p.offset=f);const v=BE(h,o);Array.isArray(v)&&(p.easing=v);const _={delay:r,duration:o,easing:Array.isArray(v)?"linear":v,fill:"both",iterations:l+1,direction:c==="reverse"?"alternate":"normal"};return d&&(_.pseudoElement=d),e.animate(p,_)}function PE(e){return typeof e=="function"&&"applyToOptions"in e}function $3({type:e,...t}){return PE(e)&&LE()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class zE extends Vg{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:s,name:r,keyframes:o,pseudoElement:l,allowFlatten:c=!1,finalKeyframe:h,onComplete:f}=t;this.isPseudoElement=!!l,this.allowFlatten=c,this.options=t,Dg(typeof t.type!="string");const d=$3(t);this.animation=G3(s,r,o,d,l),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!l){const p=Ig(o,this.options,h,this.speed);this.updateMotionValue&&this.updateMotionValue(p),OE(s,r,p),this.animation.cancel()}f?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return Fi(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Fi(t)}get time(){return Fi(Number(this.animation.currentTime)||0)}set time(t){const s=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ki(t),s&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:s,rangeEnd:r,observe:o}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&q3()?(this.animation.timeline=t,s&&(this.animation.rangeStart=s),r&&(this.animation.rangeEnd=r),Wi):o(this)}}const jE={anticipate:fE,backInOut:dE,circInOut:pE};function X3(e){return e in jE}function Z3(e){typeof e.ease=="string"&&X3(e.ease)&&(e.ease=jE[e.ease])}const mm=10;class Q3 extends zE{constructor(t){Z3(t),RE(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:s,onUpdate:r,onComplete:o,element:l,...c}=this.options;if(!s)return;if(t!==void 0){s.set(t);return}const h=new Ug({...c,autoplay:!1}),f=Math.max(mm,ei.now()-this.startTime),d=vs(0,mm,f-mm),p=h.sample(f).value,{name:v}=this.options;l&&v&&OE(l,v,p),s.setWithVelocity(h.sample(Math.max(0,f-d)).value,p,d),h.stop()}}const wS=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ji.test(e)||e==="0")&&!e.startsWith("url("));function J3(e){const t=e[0];if(e.length===1)return!0;for(let s=0;s<e.length;s++)if(e[s]!==t)return!0}function eB(e,t,s,r){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const l=e[e.length-1],c=wS(o,t),h=wS(l,t);return!c||!h?!1:J3(e)||(s==="spring"||PE(s))&&r}function fp(e){e.duration=0,e.type="keyframes"}const tB=new Set(["opacity","clipPath","filter","transform"]),iB=oE(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function sB(e){const{motionValue:t,name:s,repeatDelay:r,repeatType:o,damping:l,type:c}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:f,transformTemplate:d}=t.owner.getProps();return iB()&&s&&tB.has(s)&&(s!=="transform"||!d)&&!f&&!r&&o!=="mirror"&&l!==0&&c!=="inertia"}const nB=40;class rB extends Vg{constructor({autoplay:t=!0,delay:s=0,type:r="keyframes",repeat:o=0,repeatDelay:l=0,repeatType:c="loop",keyframes:h,name:f,motionValue:d,element:p,...v}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=ei.now();const _={autoplay:t,delay:s,type:r,repeat:o,repeatDelay:l,repeatType:c,name:f,motionValue:d,element:p,...v},y=p?.KeyframeResolver||Fg;this.keyframeResolver=new y(h,(b,S,E)=>this.onKeyframesResolved(b,S,_,!E),f,d,p),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,s,r,o){this.keyframeResolver=void 0;const{name:l,type:c,velocity:h,delay:f,isHandoff:d,onUpdate:p}=r;this.resolvedAt=ei.now(),eB(t,l,c,h)||((Ys.instantAnimations||!f)&&p?.(Ig(t,r,s)),t[0]=t[t.length-1],fp(r),r.repeat=0);const _={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>nB?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:s,...r,keyframes:t},y=!d&&sB(_),b=_.motionValue?.owner?.current,S=y?new Q3({..._,element:b}):new Ug(_);S.finished.then(()=>{this.notifyFinished()}).catch(Wi),this.pendingTimeline&&(this.stopTimeline=S.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=S}get finished(){return this._animation?this.animation.finished:this._finished}then(t,s){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),W3()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function HE(e,t,s,r=0,o=1){const l=Array.from(e).sort((d,p)=>d.sortNodePosition(p)).indexOf(t),c=e.size,h=(c-1)*r;return typeof s=="function"?s(l,c):o===1?l*r:h-l*r}const oB=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function aB(e){const t=oB.exec(e);if(!t)return[,];const[,s,r,o]=t;return[`--${s??r}`,o]}function IE(e,t,s=1){const[r,o]=aB(e);if(!r)return;const l=window.getComputedStyle(t).getPropertyValue(r);if(l){const c=l.trim();return sE(c)?parseFloat(c):c}return Bg(o)?IE(o,t,s+1):o}const lB={type:"spring",stiffness:500,damping:25,restSpeed:10},cB=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),uB={type:"keyframes",duration:.8},hB={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},dB=(e,{keyframes:t})=>t.length>2?uB:Vo.has(e)?e.startsWith("scale")?cB(t[1]):lB:hB,fB=e=>e!==null;function mB(e,{repeat:t,repeatType:s="loop"},r){const o=e.filter(fB),l=t&&s!=="loop"&&t%2===1?0:o.length-1;return o[l]}function VE(e,t){if(e?.inherit&&t){const{inherit:s,...r}=e;return{...t,...r}}return e}function Wg(e,t){const s=e?.[t]??e?.default??e;return s!==e?VE(s,e):s}function pB({when:e,delay:t,delayChildren:s,staggerChildren:r,staggerDirection:o,repeat:l,repeatType:c,repeatDelay:h,from:f,elapsed:d,...p}){return!!Object.keys(p).length}const Yg=(e,t,s,r={},o,l)=>c=>{const h=Wg(r,e)||{},f=h.delay||r.delay||0;let{elapsed:d=0}=r;d=d-ki(f);const p={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:t.getVelocity(),...h,delay:-d,onUpdate:_=>{t.set(_),h.onUpdate&&h.onUpdate(_)},onComplete:()=>{c(),h.onComplete&&h.onComplete()},name:e,motionValue:t,element:l?void 0:o};pB(h)||Object.assign(p,dB(e,p)),p.duration&&(p.duration=ki(p.duration)),p.repeatDelay&&(p.repeatDelay=ki(p.repeatDelay)),p.from!==void 0&&(p.keyframes[0]=p.from);let v=!1;if((p.type===!1||p.duration===0&&!p.repeatDelay)&&(fp(p),p.delay===0&&(v=!0)),(Ys.instantAnimations||Ys.skipAnimations||o?.shouldSkipAnimations)&&(v=!0,fp(p),p.delay=0),p.allowFlatten=!h.type&&!h.ease,v&&!l&&t.get()!==void 0){const _=mB(p.keyframes,h);if(_!==void 0){et.update(()=>{p.onUpdate(_),p.onComplete()});return}}return h.isSync?new Ug(p):new rB(p)};function xS(e){const t=[{},{}];return e?.values.forEach((s,r)=>{t[0][r]=s.get(),t[1][r]=s.getVelocity()}),t}function Kg(e,t,s,r){if(typeof t=="function"){const[o,l]=xS(r);t=t(s!==void 0?s:e.custom,o,l)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,l]=xS(r);t=t(s!==void 0?s:e.custom,o,l)}return t}function Ao(e,t,s){const r=e.getProps();return Kg(r,t,s!==void 0?s:r.custom,e)}const UE=new Set(["width","height","top","left","right","bottom",...Io]),CS=30,gB=e=>!isNaN(parseFloat(e));class vB{constructor(t,s={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const o=ei.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const l of this.dependents)l.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=s.owner}setCurrent(t){this.current=t,this.updatedAt=ei.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=gB(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,s){this.events[t]||(this.events[t]=new Og);const r=this.events[t].add(s);return t==="change"?()=>{r(),et.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,s){this.passiveEffect=t,this.stopPassiveEffect=s}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,s,r){this.set(s),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,s=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,s&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=ei.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>CS)return 0;const s=Math.min(this.updatedAt-this.prevUpdatedAt,CS);return aE(parseFloat(this.current)-parseFloat(this.prevFrameValue),s)}start(t){return this.stop(),new Promise(s=>{this.hasAnimated=!0,this.animation=t(s),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function No(e,t){return new vB(e,t)}const mp=e=>Array.isArray(e);function _B(e,t,s){e.hasValue(t)?e.getValue(t).set(s):e.addValue(t,No(s))}function yB(e){return mp(e)?e[e.length-1]||0:e}function bB(e,t){const s=Ao(e,t);let{transitionEnd:r={},transition:o={},...l}=s||{};l={...l,...r};for(const c in l){const h=yB(l[c]);_B(e,c,h)}}const $t=e=>!!(e&&e.getVelocity);function SB(e){return!!($t(e)&&e.add)}function pp(e,t){const s=e.getValue("willChange");if(SB(s))return s.add(t);if(!s&&Ys.WillChange){const r=new Ys.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function qg(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const wB="framerAppearId",FE="data-"+qg(wB);function WE(e){return e.props[FE]}function xB({protectedKeys:e,needsAnimating:t},s){const r=e.hasOwnProperty(s)&&t[s]!==!0;return t[s]=!1,r}function YE(e,t,{delay:s=0,transitionOverride:r,type:o}={}){let{transition:l,transitionEnd:c,...h}=t;const f=e.getDefaultTransition();l=l?VE(l,f):f;const d=l?.reduceMotion;r&&(l=r);const p=[],v=o&&e.animationState&&e.animationState.getState()[o];for(const _ in h){const y=e.getValue(_,e.latestValues[_]??null),b=h[_];if(b===void 0||v&&xB(v,_))continue;const S={delay:s,...Wg(l||{},_)},E=y.get();if(E!==void 0&&!y.isAnimating&&!Array.isArray(b)&&b===E&&!S.velocity)continue;let A=!1;if(window.MotionHandoffAnimation){const k=WE(e);if(k){const j=window.MotionHandoffAnimation(k,_,et);j!==null&&(S.startTime=j,A=!0)}}pp(e,_);const R=d??e.shouldReduceMotion;y.start(Yg(_,y,b,R&&UE.has(_)?{type:!1}:S,e,A));const M=y.animation;M&&p.push(M)}if(c){const _=()=>et.update(()=>{c&&bB(e,c)});p.length?Promise.all(p).then(_):_()}return p}function gp(e,t,s={}){const r=Ao(e,t,s.type==="exit"?e.presenceContext?.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};s.transitionOverride&&(o=s.transitionOverride);const l=r?()=>Promise.all(YE(e,r,s)):()=>Promise.resolve(),c=e.variantChildren&&e.variantChildren.size?(f=0)=>{const{delayChildren:d=0,staggerChildren:p,staggerDirection:v}=o;return CB(e,t,f,d,p,v,s)}:()=>Promise.resolve(),{when:h}=o;if(h){const[f,d]=h==="beforeChildren"?[l,c]:[c,l];return f().then(()=>d())}else return Promise.all([l(),c(s.delay)])}function CB(e,t,s=0,r=0,o=0,l=1,c){const h=[];for(const f of e.variantChildren)f.notify("AnimationStart",t),h.push(gp(f,t,{...c,delay:s+(typeof r=="function"?0:r)+HE(e.variantChildren,f,r,o,l)}).then(()=>f.notify("AnimationComplete",t)));return Promise.all(h)}function EB(e,t,s={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(l=>gp(e,l,s));r=Promise.all(o)}else if(typeof t=="string")r=gp(e,t,s);else{const o=typeof t=="function"?Ao(e,t,s.custom):t;r=Promise.all(YE(e,o,s))}return r.then(()=>{e.notify("AnimationComplete",t)})}const TB={test:e=>e==="auto",parse:e=>e},KE=e=>t=>t.test(e),qE=[Ho,be,ps,An,JL,QL,TB],ES=e=>qE.find(KE(e));function kB(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||rE(e):!0}const AB=new Set(["brightness","contrast","saturate","opacity"]);function RB(e){const[t,s]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=s.match(Pg)||[];if(!r)return e;const o=s.replace(r,"");let l=AB.has(t)?1:0;return r!==s&&(l*=100),t+"("+l+o+")"}const MB=/\b([a-z-]*)\(.*?\)/gu,vp={...Ji,getAnimatableNone:e=>{const t=e.match(MB);return t?t.map(RB).join(" "):e}},_p={...Ji,getAnimatableNone:e=>{const t=Ji.parse(e);return Ji.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},TS={...Ho,transform:Math.round},DB={rotate:An,rotateX:An,rotateY:An,rotateZ:An,scale:nu,scaleX:nu,scaleY:nu,scaleZ:nu,skew:An,skewX:An,skewY:An,distance:be,translateX:be,translateY:be,translateZ:be,x:be,y:be,z:be,perspective:be,transformPerspective:be,opacity:fl,originX:dS,originY:dS,originZ:be},Gg={borderWidth:be,borderTopWidth:be,borderRightWidth:be,borderBottomWidth:be,borderLeftWidth:be,borderRadius:be,borderTopLeftRadius:be,borderTopRightRadius:be,borderBottomRightRadius:be,borderBottomLeftRadius:be,width:be,maxWidth:be,height:be,maxHeight:be,top:be,right:be,bottom:be,left:be,inset:be,insetBlock:be,insetBlockStart:be,insetBlockEnd:be,insetInline:be,insetInlineStart:be,insetInlineEnd:be,padding:be,paddingTop:be,paddingRight:be,paddingBottom:be,paddingLeft:be,paddingBlock:be,paddingBlockStart:be,paddingBlockEnd:be,paddingInline:be,paddingInlineStart:be,paddingInlineEnd:be,margin:be,marginTop:be,marginRight:be,marginBottom:be,marginLeft:be,marginBlock:be,marginBlockStart:be,marginBlockEnd:be,marginInline:be,marginInlineStart:be,marginInlineEnd:be,fontSize:be,backgroundPositionX:be,backgroundPositionY:be,...DB,zIndex:TS,fillOpacity:fl,strokeOpacity:fl,numOctaves:TS},OB={...Gg,color:wt,backgroundColor:wt,outlineColor:wt,fill:wt,stroke:wt,borderColor:wt,borderTopColor:wt,borderRightColor:wt,borderBottomColor:wt,borderLeftColor:wt,filter:vp,WebkitFilter:vp,mask:_p,WebkitMask:_p},GE=e=>OB[e],NB=new Set([vp,_p]);function $E(e,t){let s=GE(e);return NB.has(s)||(s=Ji),s.getAnimatableNone?s.getAnimatableNone(t):void 0}const LB=new Set(["auto","none","0"]);function BB(e,t,s){let r=0,o;for(;r<e.length&&!o;){const l=e[r];typeof l=="string"&&!LB.has(l)&&Oo(l).values.length&&(o=e[r]),r++}if(o&&s)for(const l of t)e[l]=$E(s,o)}class PB extends Fg{constructor(t,s,r,o,l){super(t,s,r,o,l,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:s,name:r}=this;if(!s||!s.current)return;super.readKeyframes();for(let p=0;p<t.length;p++){let v=t[p];if(typeof v=="string"&&(v=v.trim(),Bg(v))){const _=IE(v,s.current);_!==void 0&&(t[p]=_),p===t.length-1&&(this.finalKeyframe=v)}}if(this.resolveNoneKeyframes(),!UE.has(r)||t.length!==2)return;const[o,l]=t,c=ES(o),h=ES(l),f=hS(o),d=hS(l);if(f!==d&&Mn[r]){this.needsMeasurement=!0;return}if(c!==h)if(bS(c)&&bS(h))for(let p=0;p<t.length;p++){const v=t[p];typeof v=="string"&&(t[p]=parseFloat(v))}else Mn[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:s}=this,r=[];for(let o=0;o<t.length;o++)(t[o]===null||kB(t[o]))&&r.push(o);r.length&&BB(t,r,s)}measureInitialState(){const{element:t,unresolvedKeyframes:s,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Mn[r](t.measureViewportBox(),window.getComputedStyle(t.current)),s[0]=this.measuredOrigin;const o=s[s.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){const{element:t,name:s,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const o=t.getValue(s);o&&o.jump(this.measuredOrigin,!1);const l=r.length-1,c=r[l];r[l]=Mn[s](t.measureViewportBox(),window.getComputedStyle(t.current)),c!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=c),this.removedTransforms?.length&&this.removedTransforms.forEach(([h,f])=>{t.getValue(h).set(f)}),this.resolveNoneKeyframes()}}const zB=new Set(["opacity","clipPath","filter","transform"]);function XE(e,t,s){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const o=s?.[e]??r.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e).filter(r=>r!=null)}const ZE=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function xu(e){return nE(e)&&"offsetHeight"in e}const{schedule:$g}=_E(queueMicrotask,!1),Qi={x:!1,y:!1};function QE(){return Qi.x||Qi.y}function jB(e){return e==="x"||e==="y"?Qi[e]?null:(Qi[e]=!0,()=>{Qi[e]=!1}):Qi.x||Qi.y?null:(Qi.x=Qi.y=!0,()=>{Qi.x=Qi.y=!1})}function JE(e,t){const s=XE(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[s,o,()=>r.abort()]}function HB(e){return!(e.pointerType==="touch"||QE())}function IB(e,t,s={}){const[r,o,l]=JE(e,s);return r.forEach(c=>{let h=!1,f=!1,d;const p=()=>{c.removeEventListener("pointerleave",b)},v=E=>{d&&(d(E),d=void 0),p()},_=E=>{h=!1,window.removeEventListener("pointerup",_),window.removeEventListener("pointercancel",_),f&&(f=!1,v(E))},y=()=>{h=!0,window.addEventListener("pointerup",_,o),window.addEventListener("pointercancel",_,o)},b=E=>{if(E.pointerType!=="touch"){if(h){f=!0;return}v(E)}},S=E=>{if(!HB(E))return;f=!1;const A=t(c,E);typeof A=="function"&&(d=A,c.addEventListener("pointerleave",b,o))};c.addEventListener("pointerenter",S,o),c.addEventListener("pointerdown",y,o)}),l}const e2=(e,t)=>t?e===t?!0:e2(e,t.parentElement):!1,Xg=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,VB=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function UB(e){return VB.has(e.tagName)||e.isContentEditable===!0}const FB=new Set(["INPUT","SELECT","TEXTAREA"]);function WB(e){return FB.has(e.tagName)||e.isContentEditable===!0}const Cu=new WeakSet;function kS(e){return t=>{t.key==="Enter"&&e(t)}}function pm(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const YB=(e,t)=>{const s=e.currentTarget;if(!s)return;const r=kS(()=>{if(Cu.has(s))return;pm(s,"down");const o=kS(()=>{pm(s,"up")}),l=()=>pm(s,"cancel");s.addEventListener("keyup",o,t),s.addEventListener("blur",l,t)});s.addEventListener("keydown",r,t),s.addEventListener("blur",()=>s.removeEventListener("keydown",r),t)};function AS(e){return Xg(e)&&!QE()}const RS=new WeakSet;function KB(e,t,s={}){const[r,o,l]=JE(e,s),c=h=>{const f=h.currentTarget;if(!AS(h)||RS.has(h))return;Cu.add(f),s.stopPropagation&&RS.add(h);const d=t(f,h),p=(y,b)=>{window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",_),Cu.has(f)&&Cu.delete(f),AS(y)&&typeof d=="function"&&d(y,{success:b})},v=y=>{p(y,f===window||f===document||s.useGlobalTarget||e2(f,y.target))},_=y=>{p(y,!1)};window.addEventListener("pointerup",v,o),window.addEventListener("pointercancel",_,o)};return r.forEach(h=>{(s.useGlobalTarget?window:h).addEventListener("pointerdown",c,o),xu(h)&&(h.addEventListener("focus",d=>YB(d,o)),!UB(h)&&!h.hasAttribute("tabindex")&&(h.tabIndex=0))}),l}function Zg(e){return nE(e)&&"ownerSVGElement"in e}const Eu=new WeakMap;let Tu;const t2=(e,t,s)=>(r,o)=>o&&o[0]?o[0][e+"Size"]:Zg(r)&&"getBBox"in r?r.getBBox()[t]:r[s],qB=t2("inline","width","offsetWidth"),GB=t2("block","height","offsetHeight");function $B({target:e,borderBoxSize:t}){Eu.get(e)?.forEach(s=>{s(e,{get width(){return qB(e,t)},get height(){return GB(e,t)}})})}function XB(e){e.forEach($B)}function ZB(){typeof ResizeObserver>"u"||(Tu=new ResizeObserver(XB))}function QB(e,t){Tu||ZB();const s=XE(e);return s.forEach(r=>{let o=Eu.get(r);o||(o=new Set,Eu.set(r,o)),o.add(t),Tu?.observe(r)}),()=>{s.forEach(r=>{const o=Eu.get(r);o?.delete(t),o?.size||Tu?.unobserve(r)})}}const ku=new Set;let So;function JB(){So=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};ku.forEach(t=>t(e))},window.addEventListener("resize",So)}function e4(e){return ku.add(e),So||JB(),()=>{ku.delete(e),!ku.size&&typeof So=="function"&&(window.removeEventListener("resize",So),So=void 0)}}function MS(e,t){return typeof e=="function"?e4(e):QB(e,t)}function t4(e){return Zg(e)&&e.tagName==="svg"}const i4=[...qE,wt,Ji],s4=e=>i4.find(KE(e)),DS=()=>({translate:0,scale:1,origin:0,originPoint:0}),wo=()=>({x:DS(),y:DS()}),OS=()=>({min:0,max:0}),Rt=()=>({x:OS(),y:OS()}),n4=new WeakMap;function wh(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function ml(e){return typeof e=="string"||Array.isArray(e)}const Qg=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Jg=["initial",...Qg];function xh(e){return wh(e.animate)||Jg.some(t=>ml(e[t]))}function i2(e){return!!(xh(e)||e.variants)}function r4(e,t,s){for(const r in t){const o=t[r],l=s[r];if($t(o))e.addValue(r,o);else if($t(l))e.addValue(r,No(o,{owner:e}));else if(l!==o)if(e.hasValue(r)){const c=e.getValue(r);c.liveStyle===!0?c.jump(o):c.hasAnimated||c.set(o)}else{const c=e.getStaticValue(r);e.addValue(r,No(c!==void 0?c:o,{owner:e}))}}for(const r in s)t[r]===void 0&&e.removeValue(r);return t}const yp={current:null},s2={current:!1},o4=typeof window<"u";function a4(){if(s2.current=!0,!!o4)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>yp.current=e.matches;e.addEventListener("change",t),t()}else yp.current=!1}const NS=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let $u={};function n2(e){$u=e}function l4(){return $u}class c4{scrapeMotionValuesFromProps(t,s,r){return{}}constructor({parent:t,props:s,presenceContext:r,reducedMotionConfig:o,skipAnimations:l,blockInitialAnimation:c,visualState:h},f={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Fg,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const y=ei.now();this.renderScheduledAt<y&&(this.renderScheduledAt=y,et.render(this.render,!1,!0))};const{latestValues:d,renderState:p}=h;this.latestValues=d,this.baseTarget={...d},this.initialValues=s.initial?{...d}:{},this.renderState=p,this.parent=t,this.props=s,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.skipAnimationsConfig=l,this.options=f,this.blockInitialAnimation=!!c,this.isControllingVariants=xh(s),this.isVariantNode=i2(s),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:v,..._}=this.scrapeMotionValuesFromProps(s,{},this);for(const y in _){const b=_[y];d[y]!==void 0&&$t(b)&&b.set(d[y])}}mount(t){if(this.hasBeenMounted)for(const s in this.initialValues)this.values.get(s)?.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=t,n4.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,r)=>this.bindToMotionValue(r,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(s2.current||a4(),this.shouldReduceMotion=yp.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Bn(this.notifyUpdate),Bn(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const s=this.features[t];s&&(s.unmount(),s.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,s){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),s.accelerate&&zB.has(t)&&this.current instanceof HTMLElement){const{factory:c,keyframes:h,times:f,ease:d,duration:p}=s.accelerate,v=new zE({element:this.current,name:t,keyframes:h,times:f,ease:d,duration:ki(p)}),_=c(v);this.valueSubscriptions.set(t,()=>{_(),v.cancel()});return}const r=Vo.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=s.on("change",c=>{this.latestValues[t]=c,this.props.onUpdate&&et.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let l;typeof window<"u"&&window.MotionCheckAppearSync&&(l=window.MotionCheckAppearSync(this,t,s)),this.valueSubscriptions.set(t,()=>{o(),l&&l(),s.owner&&s.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in $u){const s=$u[t];if(!s)continue;const{isEnabled:r,Feature:o}=s;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const l=this.features[t];l.isMounted?l.update():(l.mount(),l.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Rt()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,s){this.latestValues[t]=s}update(t,s){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=s;for(let r=0;r<NS.length;r++){const o=NS[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const l="on"+o,c=t[l];c&&(this.propEventSubscriptions[o]=this.on(o,c))}this.prevMotionValues=r4(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const s=this.getClosestVariantNode();if(s)return s.variantChildren&&s.variantChildren.add(t),()=>s.variantChildren.delete(t)}addValue(t,s){const r=this.values.get(t);s!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,s),this.values.set(t,s),this.latestValues[t]=s.get())}removeValue(t){this.values.delete(t);const s=this.valueSubscriptions.get(t);s&&(s(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,s){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&s!==void 0&&(r=No(s===null?void 0:s,{owner:this}),this.addValue(t,r)),r}readValue(t,s){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(sE(r)||rE(r))?r=parseFloat(r):!s4(r)&&Ji.test(s)&&(r=$E(t,s)),this.setBaseTarget(t,$t(r)?r.get():r)),$t(r)?r.get():r}setBaseTarget(t,s){this.baseTarget[t]=s}getBaseTarget(t){const{initial:s}=this.props;let r;if(typeof s=="string"||typeof s=="object"){const l=Kg(this.props,s,this.presenceContext?.custom);l&&(r=l[t])}if(s&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!$t(o)?o:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,s){return this.events[t]||(this.events[t]=new Og),this.events[t].add(s)}notify(t,...s){this.events[t]&&this.events[t].notify(...s)}scheduleRenderMicrotask(){$g.render(this.render)}}class r2 extends c4{constructor(){super(...arguments),this.KeyframeResolver=PB}sortInstanceNodePosition(t,s){return t.compareDocumentPosition(s)&2?1:-1}getBaseTargetFromProps(t,s){const r=t.style;return r?r[s]:void 0}removeValueFromRenderState(t,{vars:s,style:r}){delete s[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;$t(t)&&(this.childSubscription=t.on("change",s=>{this.current&&(this.current.textContent=`${s}`)}))}}class Un{constructor(t){this.isMounted=!1,this.node=t}update(){}}function o2({top:e,left:t,right:s,bottom:r}){return{x:{min:t,max:s},y:{min:e,max:r}}}function u4({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function h4(e,t){if(!t)return e;const s=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:s.y,left:s.x,bottom:r.y,right:r.x}}function gm(e){return e===void 0||e===1}function bp({scale:e,scaleX:t,scaleY:s}){return!gm(e)||!gm(t)||!gm(s)}function hr(e){return bp(e)||a2(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function a2(e){return LS(e.x)||LS(e.y)}function LS(e){return e&&e!=="0%"}function Xu(e,t,s){const r=e-s,o=t*r;return s+o}function BS(e,t,s,r,o){return o!==void 0&&(e=Xu(e,o,r)),Xu(e,s,r)+t}function Sp(e,t=0,s=1,r,o){e.min=BS(e.min,t,s,r,o),e.max=BS(e.max,t,s,r,o)}function l2(e,{x:t,y:s}){Sp(e.x,t.translate,t.scale,t.originPoint),Sp(e.y,s.translate,s.scale,s.originPoint)}const PS=.999999999999,zS=1.0000000000001;function d4(e,t,s,r=!1){const o=s.length;if(!o)return;t.x=t.y=1;let l,c;for(let h=0;h<o;h++){l=s[h],c=l.projectionDelta;const{visualElement:f}=l.options;f&&f.props.style&&f.props.style.display==="contents"||(r&&l.options.layoutScroll&&l.scroll&&l!==l.root&&Co(e,{x:-l.scroll.offset.x,y:-l.scroll.offset.y}),c&&(t.x*=c.x.scale,t.y*=c.y.scale,l2(e,c)),r&&hr(l.latestValues)&&Co(e,l.latestValues,l.layout?.layoutBox))}t.x<zS&&t.x>PS&&(t.x=1),t.y<zS&&t.y>PS&&(t.y=1)}function xo(e,t){e.min=e.min+t,e.max=e.max+t}function jS(e,t,s,r,o=.5){const l=lt(e.min,e.max,o);Sp(e,t,s,l,r)}function HS(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Co(e,t,s){const r=s??e;jS(e.x,HS(t.x,r.x),t.scaleX,t.scale,t.originX),jS(e.y,HS(t.y,r.y),t.scaleY,t.scale,t.originY)}function c2(e,t){return o2(h4(e.getBoundingClientRect(),t))}function f4(e,t,s){const r=c2(e,s),{scroll:o}=t;return o&&(xo(r.x,o.offset.x),xo(r.y,o.offset.y)),r}const m4={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},p4=Io.length;function g4(e,t,s){let r="",o=!0;for(let l=0;l<p4;l++){const c=Io[l],h=e[c];if(h===void 0)continue;let f=!0;if(typeof h=="number")f=h===(c.startsWith("scale")?1:0);else{const d=parseFloat(h);f=c.startsWith("scale")?d===1:d===0}if(!f||s){const d=ZE(h,Gg[c]);if(!f){o=!1;const p=m4[c]||c;r+=`${p}(${d}) `}s&&(t[c]=d)}}return r=r.trim(),s?r=s(t,o?"":r):o&&(r="none"),r}function ev(e,t,s){const{style:r,vars:o,transformOrigin:l}=e;let c=!1,h=!1;for(const f in t){const d=t[f];if(Vo.has(f)){c=!0;continue}else if(bE(f)){o[f]=d;continue}else{const p=ZE(d,Gg[f]);f.startsWith("origin")?(h=!0,l[f]=p):r[f]=p}}if(t.transform||(c||s?r.transform=g4(t,e.transform,s):r.transform&&(r.transform="none")),h){const{originX:f="50%",originY:d="50%",originZ:p=0}=l;r.transformOrigin=`${f} ${d} ${p}`}}function u2(e,{style:t,vars:s},r,o){const l=e.style;let c;for(c in t)l[c]=t[c];o?.applyProjectionStyles(l,r);for(c in s)l.setProperty(c,s[c])}function IS(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Ia={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(be.test(e))e=parseFloat(e);else return e;const s=IS(e,t.target.x),r=IS(e,t.target.y);return`${s}% ${r}%`}},v4={correct:(e,{treeScale:t,projectionDelta:s})=>{const r=e,o=Ji.parse(e);if(o.length>5)return r;const l=Ji.createTransformer(e),c=typeof o[0]!="number"?1:0,h=s.x.scale*t.x,f=s.y.scale*t.y;o[0+c]/=h,o[1+c]/=f;const d=lt(h,f,.5);return typeof o[2+c]=="number"&&(o[2+c]/=d),typeof o[3+c]=="number"&&(o[3+c]/=d),l(o)}},wp={borderRadius:{...Ia,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ia,borderTopRightRadius:Ia,borderBottomLeftRadius:Ia,borderBottomRightRadius:Ia,boxShadow:v4};function h2(e,{layout:t,layoutId:s}){return Vo.has(e)||e.startsWith("origin")||(t||s!==void 0)&&(!!wp[e]||e==="opacity")}function tv(e,t,s){const r=e.style,o=t?.style,l={};if(!r)return l;for(const c in r)($t(r[c])||o&&$t(o[c])||h2(c,e)||s?.getValue(c)?.liveStyle!==void 0)&&(l[c]=r[c]);return l}function _4(e){return window.getComputedStyle(e)}class y4 extends r2{constructor(){super(...arguments),this.type="html",this.renderInstance=u2}readValueFromInstance(t,s){if(Vo.has(s))return this.projection?.isProjecting?lp(s):H3(t,s);{const r=_4(t),o=(bE(s)?r.getPropertyValue(s):r[s])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:s}){return c2(t,s)}build(t,s,r){ev(t,s,r.transformTemplate)}scrapeMotionValuesFromProps(t,s,r){return tv(t,s,r)}}const b4={offset:"stroke-dashoffset",array:"stroke-dasharray"},S4={offset:"strokeDashoffset",array:"strokeDasharray"};function w4(e,t,s=1,r=0,o=!0){e.pathLength=1;const l=o?b4:S4;e[l.offset]=`${-r}`,e[l.array]=`${t} ${s}`}const x4=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function d2(e,{attrX:t,attrY:s,attrScale:r,pathLength:o,pathSpacing:l=1,pathOffset:c=0,...h},f,d,p){if(ev(e,h,d),f){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:v,style:_}=e;v.transform&&(_.transform=v.transform,delete v.transform),(_.transform||v.transformOrigin)&&(_.transformOrigin=v.transformOrigin??"50% 50%",delete v.transformOrigin),_.transform&&(_.transformBox=p?.transformBox??"fill-box",delete v.transformBox);for(const y of x4)v[y]!==void 0&&(_[y]=v[y],delete v[y]);t!==void 0&&(v.x=t),s!==void 0&&(v.y=s),r!==void 0&&(v.scale=r),o!==void 0&&w4(v,o,l,c,!1)}const f2=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),m2=e=>typeof e=="string"&&e.toLowerCase()==="svg";function C4(e,t,s,r){u2(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(f2.has(o)?o:qg(o),t.attrs[o])}function p2(e,t,s){const r=tv(e,t,s);for(const o in e)if($t(e[o])||$t(t[o])){const l=Io.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[l]=e[o]}return r}class E4 extends r2{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Rt}getBaseTargetFromProps(t,s){return t[s]}readValueFromInstance(t,s){if(Vo.has(s)){const r=GE(s);return r&&r.default||0}return s=f2.has(s)?s:qg(s),t.getAttribute(s)}scrapeMotionValuesFromProps(t,s,r){return p2(t,s,r)}build(t,s,r){d2(t,s,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,s,r,o){C4(t,s,r,o)}mount(t){this.isSVGTag=m2(t.tagName),super.mount(t)}}const T4=Jg.length;function g2(e){if(!e)return;if(!e.isControllingVariants){const s=e.parent?g2(e.parent)||{}:{};return e.props.initial!==void 0&&(s.initial=e.props.initial),s}const t={};for(let s=0;s<T4;s++){const r=Jg[s],o=e.props[r];(ml(o)||o===!1)&&(t[r]=o)}return t}function v2(e,t){if(!Array.isArray(t))return!1;const s=t.length;if(s!==e.length)return!1;for(let r=0;r<s;r++)if(t[r]!==e[r])return!1;return!0}const k4=[...Qg].reverse(),A4=Qg.length;function R4(e){return t=>Promise.all(t.map(({animation:s,options:r})=>EB(e,s,r)))}function M4(e){let t=R4(e),s=VS(),r=!0,o=!1;const l=d=>(p,v)=>{const _=Ao(e,v,d==="exit"?e.presenceContext?.custom:void 0);if(_){const{transition:y,transitionEnd:b,...S}=_;p={...p,...S,...b}}return p};function c(d){t=d(e)}function h(d){const{props:p}=e,v=g2(e.parent)||{},_=[],y=new Set;let b={},S=1/0;for(let A=0;A<A4;A++){const R=k4[A],M=s[R],k=p[R]!==void 0?p[R]:v[R],j=ml(k),F=R===d?M.isActive:null;F===!1&&(S=A);let W=k===v[R]&&k!==p[R]&&j;if(W&&(r||o)&&e.manuallyAnimateOnMount&&(W=!1),M.protectedKeys={...b},!M.isActive&&F===null||!k&&!M.prevProp||wh(k)||typeof k=="boolean")continue;if(R==="exit"&&M.isActive&&F!==!0){M.prevResolvedValues&&(b={...b,...M.prevResolvedValues});continue}const V=D4(M.prevProp,k);let ee=V||R===d&&M.isActive&&!W&&j||A>S&&j,U=!1;const G=Array.isArray(k)?k:[k];let z=G.reduce(l(R),{});F===!1&&(z={});const{prevResolvedValues:L={}}=M,P={...L,...z},q=B=>{ee=!0,y.has(B)&&(U=!0,y.delete(B)),M.needsAnimating[B]=!0;const te=e.getValue(B);te&&(te.liveStyle=!1)};for(const B in P){const te=z[B],X=L[B];if(b.hasOwnProperty(B))continue;let N=!1;mp(te)&&mp(X)?N=!v2(te,X):N=te!==X,N?te!=null?q(B):y.add(B):te!==void 0&&y.has(B)?q(B):M.protectedKeys[B]=!0}M.prevProp=k,M.prevResolvedValues=z,M.isActive&&(b={...b,...z}),(r||o)&&e.blockInitialAnimation&&(ee=!1);const T=W&&V;ee&&(!T||U)&&_.push(...G.map(B=>{const te={type:R};if(typeof B=="string"&&(r||o)&&!T&&e.manuallyAnimateOnMount&&e.parent){const{parent:X}=e,N=Ao(X,B);if(X.enteringChildren&&N){const{delayChildren:Z}=N.transition||{};te.delay=HE(X.enteringChildren,e,Z)}}return{animation:B,options:te}}))}if(y.size){const A={};if(typeof p.initial!="boolean"){const R=Ao(e,Array.isArray(p.initial)?p.initial[0]:p.initial);R&&R.transition&&(A.transition=R.transition)}y.forEach(R=>{const M=e.getBaseTarget(R),k=e.getValue(R);k&&(k.liveStyle=!0),A[R]=M??null}),_.push({animation:A})}let E=!!_.length;return r&&(p.initial===!1||p.initial===p.animate)&&!e.manuallyAnimateOnMount&&(E=!1),r=!1,o=!1,E?t(_):Promise.resolve()}function f(d,p){if(s[d].isActive===p)return Promise.resolve();e.variantChildren?.forEach(_=>_.animationState?.setActive(d,p)),s[d].isActive=p;const v=h(d);for(const _ in s)s[_].protectedKeys={};return v}return{animateChanges:h,setActive:f,setAnimateFunction:c,getState:()=>s,reset:()=>{s=VS(),o=!0}}}function D4(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!v2(t,e):!1}function cr(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function VS(){return{animate:cr(!0),whileInView:cr(),whileHover:cr(),whileTap:cr(),whileDrag:cr(),whileFocus:cr(),exit:cr()}}function US(e,t){e.min=t.min,e.max=t.max}function Xi(e,t){US(e.x,t.x),US(e.y,t.y)}function FS(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const _2=1e-4,O4=1-_2,N4=1+_2,y2=.01,L4=0-y2,B4=0+y2;function ti(e){return e.max-e.min}function P4(e,t,s){return Math.abs(e-t)<=s}function WS(e,t,s,r=.5){e.origin=r,e.originPoint=lt(t.min,t.max,e.origin),e.scale=ti(s)/ti(t),e.translate=lt(s.min,s.max,e.origin)-e.originPoint,(e.scale>=O4&&e.scale<=N4||isNaN(e.scale))&&(e.scale=1),(e.translate>=L4&&e.translate<=B4||isNaN(e.translate))&&(e.translate=0)}function nl(e,t,s,r){WS(e.x,t.x,s.x,r?r.originX:void 0),WS(e.y,t.y,s.y,r?r.originY:void 0)}function YS(e,t,s){e.min=s.min+t.min,e.max=e.min+ti(t)}function z4(e,t,s){YS(e.x,t.x,s.x),YS(e.y,t.y,s.y)}function KS(e,t,s){e.min=t.min-s.min,e.max=e.min+ti(t)}function Zu(e,t,s){KS(e.x,t.x,s.x),KS(e.y,t.y,s.y)}function qS(e,t,s,r,o){return e-=t,e=Xu(e,1/s,r),o!==void 0&&(e=Xu(e,1/o,r)),e}function j4(e,t=0,s=1,r=.5,o,l=e,c=e){if(ps.test(t)&&(t=parseFloat(t),t=lt(c.min,c.max,t/100)-c.min),typeof t!="number")return;let h=lt(l.min,l.max,r);e===l&&(h-=t),e.min=qS(e.min,t,s,h,o),e.max=qS(e.max,t,s,h,o)}function GS(e,t,[s,r,o],l,c){j4(e,t[s],t[r],t[o],t.scale,l,c)}const H4=["x","scaleX","originX"],I4=["y","scaleY","originY"];function $S(e,t,s,r){GS(e.x,t,H4,s?s.x:void 0,r?r.x:void 0),GS(e.y,t,I4,s?s.y:void 0,r?r.y:void 0)}function XS(e){return e.translate===0&&e.scale===1}function b2(e){return XS(e.x)&&XS(e.y)}function ZS(e,t){return e.min===t.min&&e.max===t.max}function V4(e,t){return ZS(e.x,t.x)&&ZS(e.y,t.y)}function QS(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function S2(e,t){return QS(e.x,t.x)&&QS(e.y,t.y)}function JS(e){return ti(e.x)/ti(e.y)}function ew(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function us(e){return[e("x"),e("y")]}function U4(e,t,s){let r="";const o=e.x.translate/t.x,l=e.y.translate/t.y,c=s?.z||0;if((o||l||c)&&(r=`translate3d(${o}px, ${l}px, ${c}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),s){const{transformPerspective:d,rotate:p,rotateX:v,rotateY:_,skewX:y,skewY:b}=s;d&&(r=`perspective(${d}px) ${r}`),p&&(r+=`rotate(${p}deg) `),v&&(r+=`rotateX(${v}deg) `),_&&(r+=`rotateY(${_}deg) `),y&&(r+=`skewX(${y}deg) `),b&&(r+=`skewY(${b}deg) `)}const h=e.x.scale*t.x,f=e.y.scale*t.y;return(h!==1||f!==1)&&(r+=`scale(${h}, ${f})`),r||"none"}const w2=["TopLeft","TopRight","BottomLeft","BottomRight"],F4=w2.length,tw=e=>typeof e=="string"?parseFloat(e):e,iw=e=>typeof e=="number"||be.test(e);function W4(e,t,s,r,o,l){o?(e.opacity=lt(0,s.opacity??1,Y4(r)),e.opacityExit=lt(t.opacity??1,0,K4(r))):l&&(e.opacity=lt(t.opacity??1,s.opacity??1,r));for(let c=0;c<F4;c++){const h=`border${w2[c]}Radius`;let f=sw(t,h),d=sw(s,h);if(f===void 0&&d===void 0)continue;f||(f=0),d||(d=0),f===0||d===0||iw(f)===iw(d)?(e[h]=Math.max(lt(tw(f),tw(d),r),0),(ps.test(d)||ps.test(f))&&(e[h]+="%")):e[h]=d}(t.rotate||s.rotate)&&(e.rotate=lt(t.rotate||0,s.rotate||0,r))}function sw(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const Y4=x2(0,.5,mE),K4=x2(.5,.95,Wi);function x2(e,t,s){return r=>r<e?0:r>t?1:s(dl(e,t,r))}function q4(e,t,s){const r=$t(e)?e:No(e);return r.start(Yg("",r,t,s)),r.animation}function pl(e,t,s,r={passive:!0}){return e.addEventListener(t,s,r),()=>e.removeEventListener(t,s)}const G4=(e,t)=>e.depth-t.depth;class $4{constructor(){this.children=[],this.isDirty=!1}add(t){Mg(this.children,t),this.isDirty=!0}remove(t){Yu(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(G4),this.isDirty=!1,this.children.forEach(t)}}function X4(e,t){const s=ei.now(),r=({timestamp:o})=>{const l=o-s;l>=t&&(Bn(r),e(l-t))};return et.setup(r,!0),()=>Bn(r)}function Au(e){return $t(e)?e.get():e}class Z4{constructor(){this.members=[]}add(t){Mg(this.members,t);for(let s=this.members.length-1;s>=0;s--){const r=this.members[s];if(r===t||r===this.lead||r===this.prevLead)continue;const o=r.instance;(!o||o.isConnected===!1)&&!r.snapshot&&(Yu(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(Yu(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const s=this.members[this.members.length-1];s&&this.promote(s)}}relegate(t){for(let s=this.members.indexOf(t)-1;s>=0;s--){const r=this.members[s];if(r.isPresent!==!1&&r.instance?.isConnected!==!1)return this.promote(r),!0}return!1}promote(t,s){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.updateSnapshot(),t.scheduleRender();const{layoutDependency:o}=r.options,{layoutDependency:l}=t.options;(o===void 0||o!==l)&&(t.resumeFrom=r,s&&(r.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const Ru={hasAnimatedSinceResize:!0,hasEverUpdated:!1},vm=["","X","Y","Z"],Q4=1e3;let J4=0;function _m(e,t,s,r){const{latestValues:o}=t;o[e]&&(s[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function C2(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const s=WE(t);if(window.MotionHasOptimisedAnimation(s,"transform")){const{layout:o,layoutId:l}=e.options;window.MotionCancelOptimisedAnimation(s,"transform",et,!(o||l))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&C2(r)}function E2({attachResizeListener:e,defaultParent:t,measureScroll:s,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(c={},h=t?.()){this.id=J4++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(iP),this.nodes.forEach(oP),this.nodes.forEach(aP),this.nodes.forEach(sP)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=c,this.root=h?h.root||h:this,this.path=h?[...h.path,h]:[],this.parent=h,this.depth=h?h.depth+1:0;for(let f=0;f<this.path.length;f++)this.path[f].shouldResetTransform=!0;this.root===this&&(this.nodes=new $4)}addEventListener(c,h){return this.eventHandlers.has(c)||this.eventHandlers.set(c,new Og),this.eventHandlers.get(c).add(h)}notifyListeners(c,...h){const f=this.eventHandlers.get(c);f&&f.notify(...h)}hasListeners(c){return this.eventHandlers.has(c)}mount(c){if(this.instance)return;this.isSVG=Zg(c)&&!t4(c),this.instance=c;const{layoutId:h,layout:f,visualElement:d}=this.options;if(d&&!d.current&&d.mount(c),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(f||h)&&(this.isLayoutDirty=!0),e){let p,v=0;const _=()=>this.root.updateBlockedByResize=!1;et.read(()=>{v=window.innerWidth}),e(c,()=>{const y=window.innerWidth;y!==v&&(v=y,this.root.updateBlockedByResize=!0,p&&p(),p=X4(_,250),Ru.hasAnimatedSinceResize&&(Ru.hasAnimatedSinceResize=!1,this.nodes.forEach(ow)))})}h&&this.root.registerSharedNode(h,this),this.options.animate!==!1&&d&&(h||f)&&this.addEventListener("didUpdate",({delta:p,hasLayoutChanged:v,hasRelativeLayoutChanged:_,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||d.getDefaultTransition()||dP,{onLayoutAnimationStart:S,onLayoutAnimationComplete:E}=d.getProps(),A=!this.targetLayout||!S2(this.targetLayout,y),R=!v&&_;if(this.options.layoutRoot||this.resumeFrom||R||v&&(A||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const M={...Wg(b,"layout"),onPlay:S,onComplete:E};(d.shouldReduceMotion||this.options.layoutRoot)&&(M.delay=0,M.type=!1),this.startAnimation(M),this.setAnimationOrigin(p,R)}else v||ow(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const c=this.getStack();c&&c.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Bn(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(lP),this.animationId++)}getTransformTemplate(){const{visualElement:c}=this.options;return c&&c.getProps().transformTemplate}willUpdate(c=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&C2(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let p=0;p<this.path.length;p++){const v=this.path[p];v.shouldResetTransform=!0,(typeof v.latestValues.x=="string"||typeof v.latestValues.y=="string")&&(v.isLayoutDirty=!0),v.updateScroll("snapshot"),v.options.layoutRoot&&v.willUpdate(!1)}const{layoutId:h,layout:f}=this.options;if(h===void 0&&!f)return;const d=this.getTransformTemplate();this.prevTransformTemplateValue=d?d(this.latestValues,""):void 0,this.updateSnapshot(),c&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(nw);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(rw);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(rP),this.nodes.forEach(eP),this.nodes.forEach(tP)):this.nodes.forEach(rw),this.clearAllSnapshots();const h=ei.now();Ft.delta=vs(0,1e3/60,h-Ft.timestamp),Ft.timestamp=h,Ft.isProcessing=!0,cm.update.process(Ft),cm.preRender.process(Ft),cm.render.process(Ft),Ft.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,$g.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(nP),this.sharedNodes.forEach(cP)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,et.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){et.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ti(this.snapshot.measuredBox.x)&&!ti(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let f=0;f<this.path.length;f++)this.path[f].updateScroll();const c=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=Rt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:h}=this.options;h&&h.notify("LayoutMeasure",this.layout.layoutBox,c?c.layoutBox:void 0)}updateScroll(c="measure"){let h=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===c&&(h=!1),h&&this.instance){const f=r(this.instance);this.scroll={animationId:this.root.animationId,phase:c,isRoot:f,offset:s(this.instance),wasRoot:this.scroll?this.scroll.isRoot:f}}}resetTransform(){if(!o)return;const c=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,h=this.projectionDelta&&!b2(this.projectionDelta),f=this.getTransformTemplate(),d=f?f(this.latestValues,""):void 0,p=d!==this.prevTransformTemplateValue;c&&this.instance&&(h||hr(this.latestValues)||p)&&(o(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(c=!0){const h=this.measurePageBox();let f=this.removeElementScroll(h);return c&&(f=this.removeTransform(f)),fP(f),{animationId:this.root.animationId,measuredBox:h,layoutBox:f,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:c}=this.options;if(!c)return Rt();const h=c.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(mP))){const{scroll:d}=this.root;d&&(xo(h.x,d.offset.x),xo(h.y,d.offset.y))}return h}removeElementScroll(c){const h=Rt();if(Xi(h,c),this.scroll?.wasRoot)return h;for(let f=0;f<this.path.length;f++){const d=this.path[f],{scroll:p,options:v}=d;d!==this.root&&p&&v.layoutScroll&&(p.wasRoot&&Xi(h,c),xo(h.x,p.offset.x),xo(h.y,p.offset.y))}return h}applyTransform(c,h=!1){const f=Rt();Xi(f,c);for(let d=0;d<this.path.length;d++){const p=this.path[d];!h&&p.options.layoutScroll&&p.scroll&&p!==p.root&&Co(f,{x:-p.scroll.offset.x,y:-p.scroll.offset.y}),hr(p.latestValues)&&Co(f,p.latestValues,p.layout?.layoutBox)}return hr(this.latestValues)&&Co(f,this.latestValues,this.layout?.layoutBox),f}removeTransform(c){const h=Rt();Xi(h,c);for(let f=0;f<this.path.length;f++){const d=this.path[f];if(!hr(d.latestValues))continue;let p;d.instance&&(bp(d.latestValues)&&d.updateSnapshot(),p=Rt(),Xi(p,d.measurePageBox())),$S(h,d.latestValues,d.snapshot?.layoutBox,p)}return hr(this.latestValues)&&$S(h,this.latestValues),h}setTargetDelta(c){this.targetDelta=c,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(c){this.options={...this.options,...c,crossfade:c.crossfade!==void 0?c.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ft.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(c=!1){const h=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=h.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=h.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=h.isSharedProjectionDirty);const f=!!this.resumingFrom||this!==h;if(!(c||f&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:p,layoutId:v}=this.options;if(!this.layout||!(p||v))return;this.resolvedRelativeTargetAt=Ft.timestamp;const _=this.getClosestProjectingParent();_&&this.linkedParentVersion!==_.layoutVersion&&!_.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(_&&_.layout?this.createRelativeTarget(_,this.layout.layoutBox,_.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Rt(),this.targetWithTransforms=Rt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),z4(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Xi(this.target,this.layout.layoutBox),l2(this.target,this.targetDelta)):Xi(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,_&&!!_.resumingFrom==!!this.resumingFrom&&!_.options.layoutScroll&&_.target&&this.animationProgress!==1?this.createRelativeTarget(_,this.target,_.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||bp(this.parent.latestValues)||a2(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(c,h,f){this.relativeParent=c,this.linkedParentVersion=c.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Rt(),this.relativeTargetOrigin=Rt(),Zu(this.relativeTargetOrigin,h,f),Xi(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const c=this.getLead(),h=!!this.resumingFrom||this!==c;let f=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(f=!1),h&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(f=!1),this.resolvedRelativeTargetAt===Ft.timestamp&&(f=!1),f)return;const{layout:d,layoutId:p}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||p))return;Xi(this.layoutCorrected,this.layout.layoutBox);const v=this.treeScale.x,_=this.treeScale.y;d4(this.layoutCorrected,this.treeScale,this.path,h),c.layout&&!c.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(c.target=c.layout.layoutBox,c.targetWithTransforms=Rt());const{target:y}=c;if(!y){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(FS(this.prevProjectionDelta.x,this.projectionDelta.x),FS(this.prevProjectionDelta.y,this.projectionDelta.y)),nl(this.projectionDelta,this.layoutCorrected,y,this.latestValues),(this.treeScale.x!==v||this.treeScale.y!==_||!ew(this.projectionDelta.x,this.prevProjectionDelta.x)||!ew(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",y))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(c=!0){if(this.options.visualElement?.scheduleRender(),c){const h=this.getStack();h&&h.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=wo(),this.projectionDelta=wo(),this.projectionDeltaWithTransform=wo()}setAnimationOrigin(c,h=!1){const f=this.snapshot,d=f?f.latestValues:{},p={...this.latestValues},v=wo();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!h;const _=Rt(),y=f?f.source:void 0,b=this.layout?this.layout.source:void 0,S=y!==b,E=this.getStack(),A=!E||E.members.length<=1,R=!!(S&&!A&&this.options.crossfade===!0&&!this.path.some(hP));this.animationProgress=0;let M;this.mixTargetDelta=k=>{const j=k/1e3;aw(v.x,c.x,j),aw(v.y,c.y,j),this.setTargetDelta(v),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Zu(_,this.layout.layoutBox,this.relativeParent.layout.layoutBox),uP(this.relativeTarget,this.relativeTargetOrigin,_,j),M&&V4(this.relativeTarget,M)&&(this.isProjectionDirty=!1),M||(M=Rt()),Xi(M,this.relativeTarget)),S&&(this.animationValues=p,W4(p,d,this.latestValues,j,R,A)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=j},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(c){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Bn(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=et.update(()=>{Ru.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=No(0)),this.motionValue.jump(0,!1),this.currentAnimation=q4(this.motionValue,[0,1e3],{...c,velocity:0,isSync:!0,onUpdate:h=>{this.mixTargetDelta(h),c.onUpdate&&c.onUpdate(h)},onStop:()=>{},onComplete:()=>{c.onComplete&&c.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const c=this.getStack();c&&c.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Q4),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const c=this.getLead();let{targetWithTransforms:h,target:f,layout:d,latestValues:p}=c;if(!(!h||!f||!d)){if(this!==c&&this.layout&&d&&T2(this.options.animationType,this.layout.layoutBox,d.layoutBox)){f=this.target||Rt();const v=ti(this.layout.layoutBox.x);f.x.min=c.target.x.min,f.x.max=f.x.min+v;const _=ti(this.layout.layoutBox.y);f.y.min=c.target.y.min,f.y.max=f.y.min+_}Xi(h,f),Co(h,p),nl(this.projectionDeltaWithTransform,this.layoutCorrected,h,p)}}registerSharedNode(c,h){this.sharedNodes.has(c)||this.sharedNodes.set(c,new Z4),this.sharedNodes.get(c).add(h);const d=h.options.initialPromotionConfig;h.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.shouldPreserveFollowOpacity(h):void 0})}isLead(){const c=this.getStack();return c?c.lead===this:!0}getLead(){const{layoutId:c}=this.options;return c?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:c}=this.options;return c?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:c}=this.options;if(c)return this.root.sharedNodes.get(c)}promote({needsReset:c,transition:h,preserveFollowOpacity:f}={}){const d=this.getStack();d&&d.promote(this,f),c&&(this.projectionDelta=void 0,this.needsReset=!0),h&&this.setOptions({transition:h})}relegate(){const c=this.getStack();return c?c.relegate(this):!1}resetSkewAndRotation(){const{visualElement:c}=this.options;if(!c)return;let h=!1;const{latestValues:f}=c;if((f.z||f.rotate||f.rotateX||f.rotateY||f.rotateZ||f.skewX||f.skewY)&&(h=!0),!h)return;const d={};f.z&&_m("z",c,d,this.animationValues);for(let p=0;p<vm.length;p++)_m(`rotate${vm[p]}`,c,d,this.animationValues),_m(`skew${vm[p]}`,c,d,this.animationValues);c.render();for(const p in d)c.setStaticValue(p,d[p]),this.animationValues&&(this.animationValues[p]=d[p]);c.scheduleRender()}applyProjectionStyles(c,h){if(!this.instance||this.isSVG)return;if(!this.isVisible){c.visibility="hidden";return}const f=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,c.visibility="",c.opacity="",c.pointerEvents=Au(h?.pointerEvents)||"",c.transform=f?f(this.latestValues,""):"none";return}const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){this.options.layoutId&&(c.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,c.pointerEvents=Au(h?.pointerEvents)||""),this.hasProjected&&!hr(this.latestValues)&&(c.transform=f?f({},""):"none",this.hasProjected=!1);return}c.visibility="";const p=d.animationValues||d.latestValues;this.applyTransformsToTarget();let v=U4(this.projectionDeltaWithTransform,this.treeScale,p);f&&(v=f(p,v)),c.transform=v;const{x:_,y}=this.projectionDelta;c.transformOrigin=`${_.origin*100}% ${y.origin*100}% 0`,d.animationValues?c.opacity=d===this?p.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:p.opacityExit:c.opacity=d===this?p.opacity!==void 0?p.opacity:"":p.opacityExit!==void 0?p.opacityExit:0;for(const b in wp){if(p[b]===void 0)continue;const{correct:S,applyTo:E,isCSSVariable:A}=wp[b],R=v==="none"?p[b]:S(p[b],d);if(E){const M=E.length;for(let k=0;k<M;k++)c[E[k]]=R}else A?this.options.visualElement.renderState.vars[b]=R:c[b]=R}this.options.layoutId&&(c.pointerEvents=d===this?Au(h?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(c=>c.currentAnimation?.stop()),this.root.nodes.forEach(nw),this.root.sharedNodes.clear()}}}function eP(e){e.updateLayout()}function tP(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:r}=e.layout,{animationType:o}=e.options,l=t.source!==e.layout.source;o==="size"?us(p=>{const v=l?t.measuredBox[p]:t.layoutBox[p],_=ti(v);v.min=s[p].min,v.max=v.min+_}):T2(o,t.layoutBox,s)&&us(p=>{const v=l?t.measuredBox[p]:t.layoutBox[p],_=ti(s[p]);v.max=v.min+_,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[p].max=e.relativeTarget[p].min+_)});const c=wo();nl(c,s,t.layoutBox);const h=wo();l?nl(h,e.applyTransform(r,!0),t.measuredBox):nl(h,s,t.layoutBox);const f=!b2(c);let d=!1;if(!e.resumeFrom){const p=e.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:v,layout:_}=p;if(v&&_){const y=Rt();Zu(y,t.layoutBox,v.layoutBox);const b=Rt();Zu(b,s,_.layoutBox),S2(y,b)||(d=!0),p.options.layoutRoot&&(e.relativeTarget=b,e.relativeTargetOrigin=y,e.relativeParent=p)}}}e.notifyListeners("didUpdate",{layout:s,snapshot:t,delta:h,layoutDelta:c,hasLayoutChanged:f,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:s}=e.options;s&&s()}e.options.transition=void 0}function iP(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function sP(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function nP(e){e.clearSnapshot()}function nw(e){e.clearMeasurements()}function rw(e){e.isLayoutDirty=!1}function rP(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function ow(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function oP(e){e.resolveTargetDelta()}function aP(e){e.calcProjection()}function lP(e){e.resetSkewAndRotation()}function cP(e){e.removeLeadSnapshot()}function aw(e,t,s){e.translate=lt(t.translate,0,s),e.scale=lt(t.scale,1,s),e.origin=t.origin,e.originPoint=t.originPoint}function lw(e,t,s,r){e.min=lt(t.min,s.min,r),e.max=lt(t.max,s.max,r)}function uP(e,t,s,r){lw(e.x,t.x,s.x,r),lw(e.y,t.y,s.y,r)}function hP(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const dP={duration:.45,ease:[.4,0,.1,1]},cw=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),uw=cw("applewebkit/")&&!cw("chrome/")?Math.round:Wi;function hw(e){e.min=uw(e.min),e.max=uw(e.max)}function fP(e){hw(e.x),hw(e.y)}function T2(e,t,s){return e==="position"||e==="preserve-aspect"&&!P4(JS(t),JS(s),.2)}function mP(e){return e!==e.root&&e.scroll?.wasRoot}const pP=E2({attachResizeListener:(e,t)=>pl(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),ym={current:void 0},k2=E2({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!ym.current){const e=new pP({});e.mount(window),e.setOptions({layoutScroll:!0}),ym.current=e}return ym.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),iv=x.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function dw(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function gP(...e){return t=>{let s=!1;const r=e.map(o=>{const l=dw(o,t);return!s&&typeof l=="function"&&(s=!0),l});if(s)return()=>{for(let o=0;o<r.length;o++){const l=r[o];typeof l=="function"?l():dw(e[o],null)}}}}function vP(...e){return x.useCallback(gP(...e),e)}class _P extends x.Component{getSnapshotBeforeUpdate(t){const s=this.props.childRef.current;if(xu(s)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=s.offsetParent,o=xu(r)&&r.offsetWidth||0,l=xu(r)&&r.offsetHeight||0,c=getComputedStyle(s),h=this.props.sizeRef.current;h.height=parseFloat(c.height),h.width=parseFloat(c.width),h.top=s.offsetTop,h.left=s.offsetLeft,h.right=o-h.width-h.left,h.bottom=l-h.height-h.top}return null}componentDidUpdate(){}render(){return this.props.children}}function yP({children:e,isPresent:t,anchorX:s,anchorY:r,root:o,pop:l}){const c=x.useId(),h=x.useRef(null),f=x.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:d}=x.useContext(iv),p=e.props?.ref??e?.ref,v=vP(h,p);return x.useInsertionEffect(()=>{const{width:_,height:y,top:b,left:S,right:E,bottom:A}=f.current;if(t||l===!1||!h.current||!_||!y)return;const R=s==="left"?`left: ${S}`:`right: ${E}`,M=r==="bottom"?`bottom: ${A}`:`top: ${b}`;h.current.dataset.motionPopId=c;const k=document.createElement("style");d&&(k.nonce=d);const j=o??document.head;return j.appendChild(k),k.sheet&&k.sheet.insertRule(`
|
|
51
|
+
[data-motion-pop-id="${c}"] {
|
|
52
|
+
position: absolute !important;
|
|
53
|
+
width: ${_}px !important;
|
|
54
|
+
height: ${y}px !important;
|
|
55
|
+
${R}px !important;
|
|
56
|
+
${M}px !important;
|
|
57
|
+
}
|
|
58
|
+
`),()=>{j.contains(k)&&j.removeChild(k)}},[t]),C.jsx(_P,{isPresent:t,childRef:h,sizeRef:f,pop:l,children:l===!1?e:x.cloneElement(e,{ref:v})})}const bP=({children:e,initial:t,isPresent:s,onExitComplete:r,custom:o,presenceAffectsLayout:l,mode:c,anchorX:h,anchorY:f,root:d})=>{const p=Rg(SP),v=x.useId();let _=!0,y=x.useMemo(()=>(_=!1,{id:v,initial:t,isPresent:s,custom:o,onExitComplete:b=>{p.set(b,!0);for(const S of p.values())if(!S)return;r&&r()},register:b=>(p.set(b,!1),()=>p.delete(b))}),[s,p,r]);return l&&_&&(y={...y}),x.useMemo(()=>{p.forEach((b,S)=>p.set(S,!1))},[s]),x.useEffect(()=>{!s&&!p.size&&r&&r()},[s]),e=C.jsx(yP,{pop:c==="popLayout",isPresent:s,anchorX:h,anchorY:f,root:d,children:e}),C.jsx(Sh.Provider,{value:y,children:e})};function SP(){return new Map}function A2(e=!0){const t=x.useContext(Sh);if(t===null)return[!0,null];const{isPresent:s,onExitComplete:r,register:o}=t,l=x.useId();x.useEffect(()=>{if(e)return o(l)},[e]);const c=x.useCallback(()=>e&&r&&r(l),[l,r,e]);return!s&&r?[!1,c]:[!0]}const ru=e=>e.key||"";function fw(e){const t=[];return x.Children.forEach(e,s=>{x.isValidElement(s)&&t.push(s)}),t}const wP=({children:e,custom:t,initial:s=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:l="sync",propagate:c=!1,anchorX:h="left",anchorY:f="top",root:d})=>{const[p,v]=A2(c),_=x.useMemo(()=>fw(e),[e]),y=c&&!p?[]:_.map(ru),b=x.useRef(!0),S=x.useRef(_),E=Rg(()=>new Map),A=x.useRef(new Set),[R,M]=x.useState(_),[k,j]=x.useState(_);iE(()=>{b.current=!1,S.current=_;for(let V=0;V<k.length;V++){const ee=ru(k[V]);y.includes(ee)?(E.delete(ee),A.current.delete(ee)):E.get(ee)!==!0&&E.set(ee,!1)}},[k,y.length,y.join("-")]);const F=[];if(_!==R){let V=[..._];for(let ee=0;ee<k.length;ee++){const U=k[ee],G=ru(U);y.includes(G)||(V.splice(ee,0,U),F.push(U))}return l==="wait"&&F.length&&(V=F),j(fw(V)),M(_),null}const{forceRender:W}=x.useContext(Ag);return C.jsx(C.Fragment,{children:k.map(V=>{const ee=ru(V),U=c&&!p?!1:_===k||y.includes(ee),G=()=>{if(A.current.has(ee))return;if(A.current.add(ee),E.has(ee))E.set(ee,!0);else return;let z=!0;E.forEach(L=>{L||(z=!1)}),z&&(W?.(),j(S.current),c&&v?.(),r&&r())};return C.jsx(bP,{isPresent:U,initial:!b.current||s?void 0:!1,custom:t,presenceAffectsLayout:o,mode:l,root:d,onExitComplete:U?void 0:G,anchorX:h,anchorY:f,children:V},ee)})})},R2=x.createContext({strict:!1}),mw={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let pw=!1;function xP(){if(pw)return;const e={};for(const t in mw)e[t]={isEnabled:s=>mw[t].some(r=>!!s[r])};n2(e),pw=!0}function M2(){return xP(),l4()}function CP(e){const t=M2();for(const s in e)t[s]={...t[s],...e[s]};n2(t)}const EP=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Qu(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||EP.has(e)}let D2=e=>!Qu(e);function TP(e){typeof e=="function"&&(D2=t=>t.startsWith("on")?!Qu(t):e(t))}try{TP(require("@emotion/is-prop-valid").default)}catch{}function kP(e,t,s){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(D2(o)||s===!0&&Qu(o)||!t&&!Qu(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}const Ch=x.createContext({});function AP(e,t){if(xh(e)){const{initial:s,animate:r}=e;return{initial:s===!1||ml(s)?s:void 0,animate:ml(r)?r:void 0}}return e.inherit!==!1?t:{}}function RP(e){const{initial:t,animate:s}=AP(e,x.useContext(Ch));return x.useMemo(()=>({initial:t,animate:s}),[gw(t),gw(s)])}function gw(e){return Array.isArray(e)?e.join(" "):e}const sv=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function O2(e,t,s){for(const r in t)!$t(t[r])&&!h2(r,s)&&(e[r]=t[r])}function MP({transformTemplate:e},t){return x.useMemo(()=>{const s=sv();return ev(s,t,e),Object.assign({},s.vars,s.style)},[t])}function DP(e,t){const s=e.style||{},r={};return O2(r,s,e),Object.assign(r,MP(e,t)),r}function OP(e,t){const s={},r=DP(e,t);return e.drag&&e.dragListener!==!1&&(s.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(s.tabIndex=0),s.style=r,s}const N2=()=>({...sv(),attrs:{}});function NP(e,t,s,r){const o=x.useMemo(()=>{const l=N2();return d2(l,t,m2(r),e.transformTemplate,e.style),{...l.attrs,style:{...l.style}}},[t]);if(e.style){const l={};O2(l,e.style,e),o.style={...l,...o.style}}return o}const LP=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function nv(e){return typeof e!="string"||e.includes("-")?!1:!!(LP.indexOf(e)>-1||/[A-Z]/u.test(e))}function BP(e,t,s,{latestValues:r},o,l=!1,c){const f=(c??nv(e)?NP:OP)(t,r,o,e),d=kP(t,typeof e=="string",l),p=e!==x.Fragment?{...d,...f,ref:s}:{},{children:v}=t,_=x.useMemo(()=>$t(v)?v.get():v,[v]);return x.createElement(e,{...p,children:_})}function PP({scrapeMotionValuesFromProps:e,createRenderState:t},s,r,o){return{latestValues:zP(s,r,o,e),renderState:t()}}function zP(e,t,s,r){const o={},l=r(e,{});for(const _ in l)o[_]=Au(l[_]);let{initial:c,animate:h}=e;const f=xh(e),d=i2(e);t&&d&&!f&&e.inherit!==!1&&(c===void 0&&(c=t.initial),h===void 0&&(h=t.animate));let p=s?s.initial===!1:!1;p=p||c===!1;const v=p?h:c;if(v&&typeof v!="boolean"&&!wh(v)){const _=Array.isArray(v)?v:[v];for(let y=0;y<_.length;y++){const b=Kg(e,_[y]);if(b){const{transitionEnd:S,transition:E,...A}=b;for(const R in A){let M=A[R];if(Array.isArray(M)){const k=p?M.length-1:0;M=M[k]}M!==null&&(o[R]=M)}for(const R in S)o[R]=S[R]}}}return o}const L2=e=>(t,s)=>{const r=x.useContext(Ch),o=x.useContext(Sh),l=()=>PP(e,t,r,o);return s?l():Rg(l)},jP=L2({scrapeMotionValuesFromProps:tv,createRenderState:sv}),HP=L2({scrapeMotionValuesFromProps:p2,createRenderState:N2}),IP=Symbol.for("motionComponentSymbol");function VP(e,t,s){const r=x.useRef(s);x.useInsertionEffect(()=>{r.current=s});const o=x.useRef(null);return x.useCallback(l=>{l&&e.onMount?.(l);const c=r.current;if(typeof c=="function")if(l){const h=c(l);typeof h=="function"&&(o.current=h)}else o.current?(o.current(),o.current=null):c(l);else c&&(c.current=l);t&&(l?t.mount(l):t.unmount())},[t])}const B2=x.createContext({});function _o(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function UP(e,t,s,r,o,l){const{visualElement:c}=x.useContext(Ch),h=x.useContext(R2),f=x.useContext(Sh),d=x.useContext(iv),p=d.reducedMotion,v=d.skipAnimations,_=x.useRef(null),y=x.useRef(!1);r=r||h.renderer,!_.current&&r&&(_.current=r(e,{visualState:t,parent:c,props:s,presenceContext:f,blockInitialAnimation:f?f.initial===!1:!1,reducedMotionConfig:p,skipAnimations:v,isSVG:l}),y.current&&_.current&&(_.current.manuallyAnimateOnMount=!0));const b=_.current,S=x.useContext(B2);b&&!b.projection&&o&&(b.type==="html"||b.type==="svg")&&FP(_.current,s,o,S);const E=x.useRef(!1);x.useInsertionEffect(()=>{b&&E.current&&b.update(s,f)});const A=s[FE],R=x.useRef(!!A&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(A)&&window.MotionHasOptimisedAnimation?.(A));return iE(()=>{y.current=!0,b&&(E.current=!0,window.MotionIsMounted=!0,b.updateFeatures(),b.scheduleRenderMicrotask(),R.current&&b.animationState&&b.animationState.animateChanges())}),x.useEffect(()=>{b&&(!R.current&&b.animationState&&b.animationState.animateChanges(),R.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(A)}),R.current=!1),b.enteringChildren=void 0)}),b}function FP(e,t,s,r){const{layoutId:o,layout:l,drag:c,dragConstraints:h,layoutScroll:f,layoutRoot:d,layoutCrossfade:p}=t;e.projection=new s(e.latestValues,t["data-framer-portal-id"]?void 0:P2(e.parent)),e.projection.setOptions({layoutId:o,layout:l,alwaysMeasureLayout:!!c||h&&_o(h),visualElement:e,animationType:typeof l=="string"?l:"both",initialPromotionConfig:r,crossfade:p,layoutScroll:f,layoutRoot:d})}function P2(e){if(e)return e.options.allowProjection!==!1?e.projection:P2(e.parent)}function bm(e,{forwardMotionProps:t=!1,type:s}={},r,o){r&&CP(r);const l=s?s==="svg":nv(e),c=l?HP:jP;function h(d,p){let v;const _={...x.useContext(iv),...d,layoutId:WP(d)},{isStatic:y}=_,b=RP(d),S=c(d,y);if(!y&&typeof window<"u"){YP();const E=KP(_);v=E.MeasureLayout,b.visualElement=UP(e,S,_,o,E.ProjectionNode,l)}return C.jsxs(Ch.Provider,{value:b,children:[v&&b.visualElement?C.jsx(v,{visualElement:b.visualElement,..._}):null,BP(e,d,VP(S,b.visualElement,p),S,y,t,l)]})}h.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const f=x.forwardRef(h);return f[IP]=e,f}function WP({layoutId:e}){const t=x.useContext(Ag).id;return t&&e!==void 0?t+"-"+e:e}function YP(e,t){x.useContext(R2).strict}function KP(e){const t=M2(),{drag:s,layout:r}=t;if(!s&&!r)return{};const o={...s,...r};return{MeasureLayout:s?.isEnabled(e)||r?.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function qP(e,t){if(typeof Proxy>"u")return bm;const s=new Map,r=(l,c)=>bm(l,c,e,t),o=(l,c)=>r(l,c);return new Proxy(o,{get:(l,c)=>c==="create"?r:(s.has(c)||s.set(c,bm(c,void 0,e,t)),s.get(c))})}const GP=(e,t)=>t.isSVG??nv(e)?new E4(t):new y4(t,{allowProjection:e!==x.Fragment});class $P extends Un{constructor(t){super(t),t.animationState||(t.animationState=M4(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();wh(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:s}=this.node.prevProps||{};t!==s&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let XP=0;class ZP extends Un{constructor(){super(...arguments),this.id=XP++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:s}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const o=this.node.animationState.setActive("exit",!t);s&&!t&&o.then(()=>{s(this.id)})}mount(){const{register:t,onExitComplete:s}=this.node.presenceContext||{};s&&s(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const QP={animation:{Feature:$P},exit:{Feature:ZP}};function Tl(e){return{point:{x:e.pageX,y:e.pageY}}}const JP=e=>t=>Xg(t)&&e(t,Tl(t));function rl(e,t,s,r){return pl(e,t,JP(s),r)}const z2=({current:e})=>e?e.ownerDocument.defaultView:null,vw=(e,t)=>Math.abs(e-t);function e6(e,t){const s=vw(e.x,t.x),r=vw(e.y,t.y);return Math.sqrt(s**2+r**2)}const _w=new Set(["auto","scroll"]);class j2{constructor(t,s,{transformPagePoint:r,contextWindow:o=window,dragSnapToOrigin:l=!1,distanceThreshold:c=3,element:h}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=y=>{this.handleScroll(y.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=ou(this.lastRawMoveEventInfo,this.transformPagePoint));const y=Sm(this.lastMoveEventInfo,this.history),b=this.startEvent!==null,S=e6(y.offset,{x:0,y:0})>=this.distanceThreshold;if(!b&&!S)return;const{point:E}=y,{timestamp:A}=Ft;this.history.push({...E,timestamp:A});const{onStart:R,onMove:M}=this.handlers;b||(R&&R(this.lastMoveEvent,y),this.startEvent=this.lastMoveEvent),M&&M(this.lastMoveEvent,y)},this.handlePointerMove=(y,b)=>{this.lastMoveEvent=y,this.lastRawMoveEventInfo=b,this.lastMoveEventInfo=ou(b,this.transformPagePoint),et.update(this.updatePoint,!0)},this.handlePointerUp=(y,b)=>{this.end();const{onEnd:S,onSessionEnd:E,resumeAnimation:A}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&A&&A(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const R=Sm(y.type==="pointercancel"?this.lastMoveEventInfo:ou(b,this.transformPagePoint),this.history);this.startEvent&&S&&S(y,R),E&&E(y,R)},!Xg(t))return;this.dragSnapToOrigin=l,this.handlers=s,this.transformPagePoint=r,this.distanceThreshold=c,this.contextWindow=o||window;const f=Tl(t),d=ou(f,this.transformPagePoint),{point:p}=d,{timestamp:v}=Ft;this.history=[{...p,timestamp:v}];const{onSessionStart:_}=s;_&&_(t,Sm(d,this.history)),this.removeListeners=xl(rl(this.contextWindow,"pointermove",this.handlePointerMove),rl(this.contextWindow,"pointerup",this.handlePointerUp),rl(this.contextWindow,"pointercancel",this.handlePointerUp)),h&&this.startScrollTracking(h)}startScrollTracking(t){let s=t.parentElement;for(;s;){const r=getComputedStyle(s);(_w.has(r.overflowX)||_w.has(r.overflowY))&&this.scrollPositions.set(s,{x:s.scrollLeft,y:s.scrollTop}),s=s.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const s=this.scrollPositions.get(t);if(!s)return;const r=t===window,o=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},l={x:o.x-s.x,y:o.y-s.y};l.x===0&&l.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=l.x,this.lastMoveEventInfo.point.y+=l.y):this.history.length>0&&(this.history[0].x-=l.x,this.history[0].y-=l.y),this.scrollPositions.set(t,o),et.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Bn(this.updatePoint)}}function ou(e,t){return t?{point:t(e.point)}:e}function yw(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Sm({point:e},t){return{point:e,delta:yw(e,H2(t)),offset:yw(e,t6(t)),velocity:i6(t,.1)}}function t6(e){return e[0]}function H2(e){return e[e.length-1]}function i6(e,t){if(e.length<2)return{x:0,y:0};let s=e.length-1,r=null;const o=H2(e);for(;s>=0&&(r=e[s],!(o.timestamp-r.timestamp>ki(t)));)s--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&o.timestamp-r.timestamp>ki(t)*2&&(r=e[1]);const l=Fi(o.timestamp-r.timestamp);if(l===0)return{x:0,y:0};const c={x:(o.x-r.x)/l,y:(o.y-r.y)/l};return c.x===1/0&&(c.x=0),c.y===1/0&&(c.y=0),c}function s6(e,{min:t,max:s},r){return t!==void 0&&e<t?e=r?lt(t,e,r.min):Math.max(e,t):s!==void 0&&e>s&&(e=r?lt(s,e,r.max):Math.min(e,s)),e}function bw(e,t,s){return{min:t!==void 0?e.min+t:void 0,max:s!==void 0?e.max+s-(e.max-e.min):void 0}}function n6(e,{top:t,left:s,bottom:r,right:o}){return{x:bw(e.x,s,o),y:bw(e.y,t,r)}}function Sw(e,t){let s=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([s,r]=[r,s]),{min:s,max:r}}function r6(e,t){return{x:Sw(e.x,t.x),y:Sw(e.y,t.y)}}function o6(e,t){let s=.5;const r=ti(e),o=ti(t);return o>r?s=dl(t.min,t.max-r,e.min):r>o&&(s=dl(e.min,e.max-o,t.min)),vs(0,1,s)}function a6(e,t){const s={};return t.min!==void 0&&(s.min=t.min-e.min),t.max!==void 0&&(s.max=t.max-e.min),s}const xp=.35;function l6(e=xp){return e===!1?e=0:e===!0&&(e=xp),{x:ww(e,"left","right"),y:ww(e,"top","bottom")}}function ww(e,t,s){return{min:xw(e,t),max:xw(e,s)}}function xw(e,t){return typeof e=="number"?e:e[t]||0}const c6=new WeakMap;class u6{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Rt(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:s=!1,distanceThreshold:r}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const l=v=>{s&&this.snapToCursor(Tl(v).point),this.stopAnimation()},c=(v,_)=>{const{drag:y,dragPropagation:b,onDragStart:S}=this.getProps();if(y&&!b&&(this.openDragLock&&this.openDragLock(),this.openDragLock=jB(y),!this.openDragLock))return;this.latestPointerEvent=v,this.latestPanInfo=_,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),us(A=>{let R=this.getAxisMotionValue(A).get()||0;if(ps.test(R)){const{projection:M}=this.visualElement;if(M&&M.layout){const k=M.layout.layoutBox[A];k&&(R=ti(k)*(parseFloat(R)/100))}}this.originPoint[A]=R}),S&&et.update(()=>S(v,_),!1,!0),pp(this.visualElement,"transform");const{animationState:E}=this.visualElement;E&&E.setActive("whileDrag",!0)},h=(v,_)=>{this.latestPointerEvent=v,this.latestPanInfo=_;const{dragPropagation:y,dragDirectionLock:b,onDirectionLock:S,onDrag:E}=this.getProps();if(!y&&!this.openDragLock)return;const{offset:A}=_;if(b&&this.currentDirection===null){this.currentDirection=d6(A),this.currentDirection!==null&&S&&S(this.currentDirection);return}this.updateAxis("x",_.point,A),this.updateAxis("y",_.point,A),this.visualElement.render(),E&&et.update(()=>E(v,_),!1,!0)},f=(v,_)=>{this.latestPointerEvent=v,this.latestPanInfo=_,this.stop(v,_),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>{const{dragSnapToOrigin:v}=this.getProps();(v||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:p}=this.getProps();this.panSession=new j2(t,{onSessionStart:l,onStart:c,onMove:h,onSessionEnd:f,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:p,distanceThreshold:r,contextWindow:z2(this.visualElement),element:this.visualElement.current})}stop(t,s){const r=t||this.latestPointerEvent,o=s||this.latestPanInfo,l=this.isDragging;if(this.cancel(),!l||!o||!r)return;const{velocity:c}=o;this.startAnimation(c);const{onDragEnd:h}=this.getProps();h&&et.postRender(()=>h(r,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:s}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),s&&s.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,s,r){const{drag:o}=this.getProps();if(!r||!au(t,o,this.currentDirection))return;const l=this.getAxisMotionValue(t);let c=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(c=s6(c,this.constraints[t],this.elastic[t])),l.set(c)}resolveConstraints(){const{dragConstraints:t,dragElastic:s}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,o=this.constraints;t&&_o(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=n6(r.layoutBox,t):this.constraints=!1,this.elastic=l6(s),o!==this.constraints&&!_o(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&us(l=>{this.constraints!==!1&&this.getAxisMotionValue(l)&&(this.constraints[l]=a6(r.layoutBox[l],this.constraints[l]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:s}=this.getProps();if(!t||!_o(t))return!1;const r=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const l=f4(r,o.root,this.visualElement.getTransformPagePoint());let c=r6(o.layout.layoutBox,l);if(s){const h=s(u4(c));this.hasMutatedConstraints=!!h,h&&(c=o2(h))}return c}startAnimation(t){const{drag:s,dragMomentum:r,dragElastic:o,dragTransition:l,dragSnapToOrigin:c,onDragTransitionEnd:h}=this.getProps(),f=this.constraints||{},d=us(p=>{if(!au(p,s,this.currentDirection))return;let v=f&&f[p]||{};c&&(v={min:0,max:0});const _=o?200:1e6,y=o?40:1e7,b={type:"inertia",velocity:r?t[p]:0,bounceStiffness:_,bounceDamping:y,timeConstant:750,restDelta:1,restSpeed:10,...l,...v};return this.startAxisValueAnimation(p,b)});return Promise.all(d).then(h)}startAxisValueAnimation(t,s){const r=this.getAxisMotionValue(t);return pp(this.visualElement,t),r.start(Yg(t,r,0,s,this.visualElement,!1))}stopAnimation(){us(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const s=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[s];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){us(s=>{const{drag:r}=this.getProps();if(!au(s,r,this.currentDirection))return;const{projection:o}=this.visualElement,l=this.getAxisMotionValue(s);if(o&&o.layout){const{min:c,max:h}=o.layout.layoutBox[s],f=l.get()||0;l.set(t[s]-lt(c,h,.5)+f)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:s}=this.getProps(),{projection:r}=this.visualElement;if(!_o(s)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};us(c=>{const h=this.getAxisMotionValue(c);if(h&&this.constraints!==!1){const f=h.get();o[c]=o6({min:f,max:f},this.constraints[c])}});const{transformTemplate:l}=this.visualElement.getProps();this.visualElement.current.style.transform=l?l({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),us(c=>{if(!au(c,t,null))return;const h=this.getAxisMotionValue(c),{min:f,max:d}=this.constraints[c];h.set(lt(f,d,o[c]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;c6.set(this.visualElement,this);const t=this.visualElement.current,s=rl(t,"pointerdown",d=>{const{drag:p,dragListener:v=!0}=this.getProps(),_=d.target,y=_!==t&&WB(_);p&&v&&!y&&this.start(d)});let r;const o=()=>{const{dragConstraints:d}=this.getProps();_o(d)&&d.current&&(this.constraints=this.resolveRefConstraints(),r||(r=h6(t,d.current,()=>this.scalePositionWithinConstraints())))},{projection:l}=this.visualElement,c=l.addEventListener("measure",o);l&&!l.layout&&(l.root&&l.root.updateScroll(),l.updateLayout()),et.read(o);const h=pl(window,"resize",()=>this.scalePositionWithinConstraints()),f=l.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:p})=>{this.isDragging&&p&&(us(v=>{const _=this.getAxisMotionValue(v);_&&(this.originPoint[v]+=d[v].translate,_.set(_.get()+d[v].translate))}),this.visualElement.render())}));return()=>{h(),s(),c(),f&&f(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:s=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:l=!1,dragElastic:c=xp,dragMomentum:h=!0}=t;return{...t,drag:s,dragDirectionLock:r,dragPropagation:o,dragConstraints:l,dragElastic:c,dragMomentum:h}}}function Cw(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function h6(e,t,s){const r=MS(e,Cw(s)),o=MS(t,Cw(s));return()=>{r(),o()}}function au(e,t,s){return(t===!0||t===e)&&(s===null||s===e)}function d6(e,t=10){let s=null;return Math.abs(e.y)>t?s="y":Math.abs(e.x)>t&&(s="x"),s}class f6 extends Un{constructor(t){super(t),this.removeGroupControls=Wi,this.removeListeners=Wi,this.controls=new u6(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Wi}update(){const{dragControls:t}=this.node.getProps(),{dragControls:s}=this.node.prevProps||{};t!==s&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const wm=e=>(t,s)=>{e&&et.update(()=>e(t,s),!1,!0)};class m6 extends Un{constructor(){super(...arguments),this.removePointerDownListener=Wi}onPointerDown(t){this.session=new j2(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:z2(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:s,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:wm(t),onStart:wm(s),onMove:wm(r),onEnd:(l,c)=>{delete this.session,o&&et.postRender(()=>o(l,c))}}}mount(){this.removePointerDownListener=rl(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let xm=!1;class p6 extends x.Component{componentDidMount(){const{visualElement:t,layoutGroup:s,switchLayoutGroup:r,layoutId:o}=this.props,{projection:l}=t;l&&(s.group&&s.group.add(l),r&&r.register&&o&&r.register(l),xm&&l.root.didUpdate(),l.addEventListener("animationComplete",()=>{this.safeToRemove()}),l.setOptions({...l.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Ru.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:s,visualElement:r,drag:o,isPresent:l}=this.props,{projection:c}=r;return c&&(c.isPresent=l,t.layoutDependency!==s&&c.setOptions({...c.options,layoutDependency:s}),xm=!0,o||t.layoutDependency!==s||s===void 0||t.isPresent!==l?c.willUpdate():this.safeToRemove(),t.isPresent!==l&&(l?c.promote():c.relegate()||et.postRender(()=>{const h=c.getStack();(!h||!h.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),$g.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:s,switchLayoutGroup:r}=this.props,{projection:o}=t;xm=!0,o&&(o.scheduleCheckAfterUnmount(),s&&s.group&&s.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function I2(e){const[t,s]=A2(),r=x.useContext(Ag);return C.jsx(p6,{...e,layoutGroup:r,switchLayoutGroup:x.useContext(B2),isPresent:t,safeToRemove:s})}const g6={pan:{Feature:m6},drag:{Feature:f6,ProjectionNode:k2,MeasureLayout:I2}};function Ew(e,t,s){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",s==="Start");const o="onHover"+s,l=r[o];l&&et.postRender(()=>l(t,Tl(t)))}class v6 extends Un{mount(){const{current:t}=this.node;t&&(this.unmount=IB(t,(s,r)=>(Ew(this.node,r,"Start"),o=>Ew(this.node,o,"End"))))}unmount(){}}class _6 extends Un{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=xl(pl(this.node.current,"focus",()=>this.onFocus()),pl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Tw(e,t,s){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",s==="Start");const o="onTap"+(s==="End"?"":s),l=r[o];l&&et.postRender(()=>l(t,Tl(t)))}class y6 extends Un{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:s,propagate:r}=this.node.props;this.unmount=KB(t,(o,l)=>(Tw(this.node,l,"Start"),(c,{success:h})=>Tw(this.node,c,h?"End":"Cancel")),{useGlobalTarget:s,stopPropagation:r?.tap===!1})}unmount(){}}const Cp=new WeakMap,Cm=new WeakMap,b6=e=>{const t=Cp.get(e.target);t&&t(e)},S6=e=>{e.forEach(b6)};function w6({root:e,...t}){const s=e||document;Cm.has(s)||Cm.set(s,{});const r=Cm.get(s),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(S6,{root:e,...t})),r[o]}function x6(e,t,s){const r=w6(t);return Cp.set(e,s),r.observe(e),()=>{Cp.delete(e),r.unobserve(e)}}const C6={some:0,all:1};class E6 extends Un{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:s,margin:r,amount:o="some",once:l}=t,c={root:s?s.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:C6[o]},h=f=>{const{isIntersecting:d}=f;if(this.isInView===d||(this.isInView=d,l&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:p,onViewportLeave:v}=this.node.getProps(),_=d?p:v;_&&_(f)};return x6(this.node.current,c,h)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:s}=this.node;["amount","margin","root"].some(T6(t,s))&&this.startObserver()}unmount(){}}function T6({viewport:e={}},{viewport:t={}}={}){return s=>e[s]!==t[s]}const k6={inView:{Feature:E6},tap:{Feature:y6},focus:{Feature:_6},hover:{Feature:v6}},A6={layout:{ProjectionNode:k2,MeasureLayout:I2}},R6={...QP,...k6,...g6,...A6},kw=qP(R6,GP);function Aw({className:e,orientation:t="horizontal",decorative:s=!0,...r}){return C.jsx(oN,{"data-slot":"separator",decorative:s,orientation:t,className:Kt("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}const Rw={0:"text-[#f85149]",1:"text-[#e3b341]",2:"text-[#58a6ff]",3:"text-[#7d8590]",4:"text-muted-foreground"},M6={bug:"bg-[#da3633]/15 text-[#f85149] border-[#da3633]/30",feature:"bg-[#8957e5]/15 text-[#bc8cff] border-[#8957e5]/30",task:"bg-[#2dd4bf]/15 text-[#5eead4] border-[#2dd4bf]/30",epic:"bg-[#d29922]/15 text-[#e3b341] border-[#d29922]/30",chore:"bg-[#7d8590]/15 text-[#7d8590] border-[#7d8590]/30"},D6={open:"bg-[#238636]/20 text-[#3fb950] border border-[#238636]/40",in_progress:"bg-[#1f6feb]/20 text-[#58a6ff] border border-[#1f6feb]/40",closed:"bg-[#7d8590]/20 text-[#7d8590] border border-[#7d8590]/40",blocked:"bg-[#da3633]/20 text-[#f85149] border border-[#da3633]/40"};function Em(e){return e?new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"}):null}function Mw({dep:e,onNavigate:t}){const s=e.status==="closed"?"✓":e.status==="in_progress"?"◐":"○";return C.jsxs("div",{className:"flex items-start gap-2 py-1",children:[C.jsx("span",{className:"text-xs leading-4 text-foreground",children:s}),C.jsxs("div",{className:"min-w-0",children:[C.jsxs("div",{className:"flex items-center gap-1",children:[C.jsx("code",{className:"text-xs leading-4 text-muted-foreground cursor-pointer hover:underline hover:text-foreground transition-colors",onClick:()=>t?.(e.id),children:e.id}),e.dependency_type&&C.jsxs("span",{className:"text-xs leading-4 text-muted-foreground",children:["(",e.dependency_type,")"]})]}),C.jsx("p",{className:"text-sm leading-tight text-foreground",children:e.title})]})]})}function O6(e){if(!e)return{opacity:0,scale:.92,y:8};const t=Math.min(560,window.innerWidth-32),s=Math.min(window.innerHeight*.85,640),r=window.innerWidth/2,o=window.innerHeight/2,l=e.left+e.width/2,c=e.top+e.height/2;return{opacity:0,scale:Math.max(e.width/t,e.height/s),x:l-r,y:c-o}}const N6={type:"spring",damping:28,stiffness:380,mass:.8},L6={duration:.2,ease:[.4,0,.2,1]};function B6({issueId:e,open:t,onClose:s,sourceRect:r}){const[o,l]=x.useState(null),[c,h]=x.useState(!1),[f,d]=x.useState([]),[p,v]=x.useState(e);x.useEffect(()=>{v(e),d([])},[e]),x.useEffect(()=>{t||d([])},[t]);const _=x.useCallback(E=>{p&&d(A=>[...A,p]),v(E)},[p]),y=x.useCallback(()=>{d(E=>{const A=[...E],R=A.pop();return R&&v(R),A})},[]);x.useEffect(()=>{!p||!t||(h(!0),fetch(`/api/issue/${p}`).then(E=>{if(!E.ok)throw new Error(`HTTP ${E.status}`);return E.json()}).then(E=>{const A=Array.isArray(E)?E[0]:E;l(A||null)}).catch(()=>l(null)).finally(()=>h(!1)))},[p,t]);const b=x.useCallback(E=>{E.key==="Escape"&&s()},[s]);x.useEffect(()=>{if(t)return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[t,b]);const S=O6(r||null);return C.jsx(wP,{children:t&&C.jsxs(C.Fragment,{children:[C.jsx(kw.div,{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-[2px]",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:L6,onClick:s},"overlay"),C.jsxs(kw.div,{role:"dialog","aria-modal":"true","aria-labelledby":"issue-detail-title",className:"fixed z-50 w-full sm:max-w-[560px] max-w-[calc(100%-2rem)] max-h-[85vh] rounded-xl border bg-card text-card-foreground border-border shadow-2xl p-0 outline-none overflow-hidden",style:{top:"50%",left:"50%",translateX:"-50%",translateY:"-50%"},initial:S,animate:{opacity:1,scale:1,x:0,y:0},exit:{opacity:0,scale:.95,y:6,transition:{duration:.15,ease:[.4,0,1,1]}},transition:N6,children:[f.length>0&&C.jsxs("button",{onClick:y,className:"absolute top-4 left-4 z-10 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden",children:[C.jsx(GC,{className:"size-4"}),C.jsx("span",{className:"sr-only",children:"Back"})]}),C.jsxs("button",{onClick:s,className:"absolute top-4 right-4 z-10 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden",children:[C.jsx(XC,{className:"size-4"}),C.jsx("span",{className:"sr-only",children:"Close"})]}),c?C.jsx("div",{className:"flex items-center justify-center py-12",children:C.jsx("span",{className:"text-sm text-muted-foreground animate-pulse",children:"Loading..."})}):o?C.jsxs(hl,{className:"max-h-[80vh]",children:[C.jsxs("div",{className:"p-5 pb-3",children:[C.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-2",children:[C.jsxs("span",{className:`text-xs font-semibold ${Rw[o.priority]||Rw[4]}`,children:["P",o.priority]}),C.jsx("code",{className:"text-xs text-muted-foreground",children:o.id}),o.issue_type&&C.jsx(Wu,{variant:"outline",className:M6[o.issue_type]||"",children:o.issue_type}),C.jsx(Wu,{className:D6[o.status]||"",children:o.status.replace("_"," ")})]}),C.jsx("h2",{id:"issue-detail-title",className:"text-base leading-tight font-semibold text-foreground",children:o.title}),o.owner&&C.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:o.owner})]}),C.jsx(Aw,{}),C.jsxs("div",{className:"p-5 space-y-4",children:[o.description&&C.jsxs("div",{children:[C.jsx("h3",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:"Description"}),C.jsx("p",{className:"text-sm whitespace-pre-wrap text-foreground leading-relaxed",children:o.description})]}),o.close_reason&&C.jsxs("div",{children:[C.jsx("h3",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:"Close Reason"}),C.jsx("p",{className:"text-sm text-foreground",children:o.close_reason})]}),o.parent&&C.jsxs("div",{children:[C.jsx("h3",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:"Parent"}),C.jsx("code",{className:"text-xs text-muted-foreground cursor-pointer hover:underline hover:text-foreground transition-colors",onClick:()=>_(o.parent),children:o.parent})]}),o.dependencies&&o.dependencies.length>0&&C.jsxs("div",{children:[C.jsx("h3",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:"Dependencies"}),o.dependencies.map(E=>C.jsx(Mw,{dep:E,onNavigate:_},E.id))]}),o.dependents&&o.dependents.length>0&&C.jsxs("div",{children:[C.jsx("h3",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:"Blocks"}),o.dependents.map(E=>C.jsx(Mw,{dep:E,onNavigate:_},E.id))]}),C.jsx(Aw,{}),C.jsxs("div",{className:"grid grid-cols-2 gap-3 text-xs text-muted-foreground",children:[o.created_at&&C.jsxs("div",{children:[C.jsx("span",{className:"font-semibold",children:"Created"}),C.jsx("p",{children:Em(o.created_at)})]}),o.updated_at&&C.jsxs("div",{children:[C.jsx("span",{className:"font-semibold",children:"Updated"}),C.jsx("p",{children:Em(o.updated_at)})]}),o.closed_at&&C.jsxs("div",{children:[C.jsx("span",{className:"font-semibold",children:"Closed"}),C.jsx("p",{children:Em(o.closed_at)})]})]})]})]}):C.jsx("div",{className:"flex items-center justify-center py-12",children:C.jsx("span",{className:"text-sm text-muted-foreground",children:"Issue not found"})})]},"modal")]})})}var Ke=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),is=Ke((e,t)=>{var s=Object.defineProperty,r=(L,P,q)=>P in L?s(L,P,{enumerable:!0,configurable:!0,writable:!0,value:q}):L[P]=q,o=(L,P)=>()=>(P||L((P={exports:{}}).exports,P),P.exports),l=(L,P,q)=>r(L,typeof P!="symbol"?P+"":P,q),c=o((L,P)=>{var q="\0",T="\0",H="",B=class{constructor(I){l(this,"_isDirected",!0),l(this,"_isMultigraph",!1),l(this,"_isCompound",!1),l(this,"_label"),l(this,"_defaultNodeLabelFn",()=>{}),l(this,"_defaultEdgeLabelFn",()=>{}),l(this,"_nodes",{}),l(this,"_in",{}),l(this,"_preds",{}),l(this,"_out",{}),l(this,"_sucs",{}),l(this,"_edgeObjs",{}),l(this,"_edgeLabels",{}),l(this,"_nodeCount",0),l(this,"_edgeCount",0),l(this,"_parent"),l(this,"_children"),I&&(this._isDirected=Object.hasOwn(I,"directed")?I.directed:!0,this._isMultigraph=Object.hasOwn(I,"multigraph")?I.multigraph:!1,this._isCompound=Object.hasOwn(I,"compound")?I.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[T]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(I){return this._label=I,this}graph(){return this._label}setDefaultNodeLabel(I){return this._defaultNodeLabelFn=I,typeof I!="function"&&(this._defaultNodeLabelFn=()=>I),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var I=this;return this.nodes().filter(O=>Object.keys(I._in[O]).length===0)}sinks(){var I=this;return this.nodes().filter(O=>Object.keys(I._out[O]).length===0)}setNodes(I,O){var Y=arguments,K=this;return I.forEach(function(J){Y.length>1?K.setNode(J,O):K.setNode(J)}),this}setNode(I,O){return Object.hasOwn(this._nodes,I)?(arguments.length>1&&(this._nodes[I]=O),this):(this._nodes[I]=arguments.length>1?O:this._defaultNodeLabelFn(I),this._isCompound&&(this._parent[I]=T,this._children[I]={},this._children[T][I]=!0),this._in[I]={},this._preds[I]={},this._out[I]={},this._sucs[I]={},++this._nodeCount,this)}node(I){return this._nodes[I]}hasNode(I){return Object.hasOwn(this._nodes,I)}removeNode(I){var O=this;if(Object.hasOwn(this._nodes,I)){var Y=K=>O.removeEdge(O._edgeObjs[K]);delete this._nodes[I],this._isCompound&&(this._removeFromParentsChildList(I),delete this._parent[I],this.children(I).forEach(function(K){O.setParent(K)}),delete this._children[I]),Object.keys(this._in[I]).forEach(Y),delete this._in[I],delete this._preds[I],Object.keys(this._out[I]).forEach(Y),delete this._out[I],delete this._sucs[I],--this._nodeCount}return this}setParent(I,O){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(O===void 0)O=T;else{O+="";for(var Y=O;Y!==void 0;Y=this.parent(Y))if(Y===I)throw new Error("Setting "+O+" as parent of "+I+" would create a cycle");this.setNode(O)}return this.setNode(I),this._removeFromParentsChildList(I),this._parent[I]=O,this._children[O][I]=!0,this}_removeFromParentsChildList(I){delete this._children[this._parent[I]][I]}parent(I){if(this._isCompound){var O=this._parent[I];if(O!==T)return O}}children(I=T){if(this._isCompound){var O=this._children[I];if(O)return Object.keys(O)}else{if(I===T)return this.nodes();if(this.hasNode(I))return[]}}predecessors(I){var O=this._preds[I];if(O)return Object.keys(O)}successors(I){var O=this._sucs[I];if(O)return Object.keys(O)}neighbors(I){var O=this.predecessors(I);if(O){let K=new Set(O);for(var Y of this.successors(I))K.add(Y);return Array.from(K.values())}}isLeaf(I){var O;return this.isDirected()?O=this.successors(I):O=this.neighbors(I),O.length===0}filterNodes(I){var O=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});O.setGraph(this.graph());var Y=this;Object.entries(this._nodes).forEach(function([ie,ue]){I(ie)&&O.setNode(ie,ue)}),Object.values(this._edgeObjs).forEach(function(ie){O.hasNode(ie.v)&&O.hasNode(ie.w)&&O.setEdge(ie,Y.edge(ie))});var K={};function J(ie){var ue=Y.parent(ie);return ue===void 0||O.hasNode(ue)?(K[ie]=ue,ue):ue in K?K[ue]:J(ue)}return this._isCompound&&O.nodes().forEach(ie=>O.setParent(ie,J(ie))),O}setDefaultEdgeLabel(I){return this._defaultEdgeLabelFn=I,typeof I!="function"&&(this._defaultEdgeLabelFn=()=>I),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(I,O){var Y=this,K=arguments;return I.reduce(function(J,ie){return K.length>1?Y.setEdge(J,ie,O):Y.setEdge(J,ie),ie}),this}setEdge(){var I,O,Y,K,J=!1,ie=arguments[0];typeof ie=="object"&&ie!==null&&"v"in ie?(I=ie.v,O=ie.w,Y=ie.name,arguments.length===2&&(K=arguments[1],J=!0)):(I=ie,O=arguments[1],Y=arguments[3],arguments.length>2&&(K=arguments[2],J=!0)),I=""+I,O=""+O,Y!==void 0&&(Y=""+Y);var ue=N(this._isDirected,I,O,Y);if(Object.hasOwn(this._edgeLabels,ue))return J&&(this._edgeLabels[ue]=K),this;if(Y!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(I),this.setNode(O),this._edgeLabels[ue]=J?K:this._defaultEdgeLabelFn(I,O,Y);var me=Z(this._isDirected,I,O,Y);return I=me.v,O=me.w,Object.freeze(me),this._edgeObjs[ue]=me,te(this._preds[O],I),te(this._sucs[I],O),this._in[O][ue]=me,this._out[I][ue]=me,this._edgeCount++,this}edge(I,O,Y){var K=arguments.length===1?ne(this._isDirected,arguments[0]):N(this._isDirected,I,O,Y);return this._edgeLabels[K]}edgeAsObj(){let I=this.edge(...arguments);return typeof I!="object"?{label:I}:I}hasEdge(I,O,Y){var K=arguments.length===1?ne(this._isDirected,arguments[0]):N(this._isDirected,I,O,Y);return Object.hasOwn(this._edgeLabels,K)}removeEdge(I,O,Y){var K=arguments.length===1?ne(this._isDirected,arguments[0]):N(this._isDirected,I,O,Y),J=this._edgeObjs[K];return J&&(I=J.v,O=J.w,delete this._edgeLabels[K],delete this._edgeObjs[K],X(this._preds[O],I),X(this._sucs[I],O),delete this._in[O][K],delete this._out[I][K],this._edgeCount--),this}inEdges(I,O){return this.isDirected()?this.filterEdges(this._in[I],I,O):this.nodeEdges(I,O)}outEdges(I,O){return this.isDirected()?this.filterEdges(this._out[I],I,O):this.nodeEdges(I,O)}nodeEdges(I,O){if(I in this._nodes)return this.filterEdges({...this._in[I],...this._out[I]},I,O)}filterEdges(I,O,Y){if(I){var K=Object.values(I);return Y?K.filter(function(J){return J.v===O&&J.w===Y||J.v===Y&&J.w===O}):K}}};function te(I,O){I[O]?I[O]++:I[O]=1}function X(I,O){--I[O]||delete I[O]}function N(I,O,Y,K){var J=""+O,ie=""+Y;if(!I&&J>ie){var ue=J;J=ie,ie=ue}return J+H+ie+H+(K===void 0?q:K)}function Z(I,O,Y,K){var J=""+O,ie=""+Y;if(!I&&J>ie){var ue=J;J=ie,ie=ue}var me={v:J,w:ie};return K&&(me.name=K),me}function ne(I,O){return N(I,O.v,O.w,O.name)}P.exports=B}),h=o((L,P)=>{P.exports="3.0.2"}),f=o((L,P)=>{P.exports={Graph:c(),version:h()}}),d=o((L,P)=>{var q=c();P.exports={write:T,read:te};function T(X){var N={options:{directed:X.isDirected(),multigraph:X.isMultigraph(),compound:X.isCompound()},nodes:H(X),edges:B(X)};return X.graph()!==void 0&&(N.value=structuredClone(X.graph())),N}function H(X){return X.nodes().map(function(N){var Z=X.node(N),ne=X.parent(N),I={v:N};return Z!==void 0&&(I.value=Z),ne!==void 0&&(I.parent=ne),I})}function B(X){return X.edges().map(function(N){var Z=X.edge(N),ne={v:N.v,w:N.w};return N.name!==void 0&&(ne.name=N.name),Z!==void 0&&(ne.value=Z),ne})}function te(X){var N=new q(X.options).setGraph(X.value);return X.nodes.forEach(function(Z){N.setNode(Z.v,Z.value),Z.parent&&N.setParent(Z.v,Z.parent)}),X.edges.forEach(function(Z){N.setEdge({v:Z.v,w:Z.w,name:Z.name},Z.value)}),N}}),p=o((L,P)=>{P.exports=T;var q=()=>1;function T(B,te,X,N){return H(B,String(te),X||q,N||function(Z){return B.outEdges(Z)})}function H(B,te,X,N){var Z={},ne=!0,I=0,O=B.nodes(),Y=function(ue){var me=X(ue);Z[ue.v].distance+me<Z[ue.w].distance&&(Z[ue.w]={distance:Z[ue.v].distance+me,predecessor:ue.v},ne=!0)},K=function(){O.forEach(function(ue){N(ue).forEach(function(me){var _e=me.v===ue?me.v:me.w,xe=_e===me.v?me.w:me.v;Y({v:_e,w:xe})})})};O.forEach(function(ue){var me=ue===te?0:Number.POSITIVE_INFINITY;Z[ue]={distance:me}});for(var J=O.length,ie=1;ie<J&&(ne=!1,I++,K(),!!ne);ie++);if(I===J-1&&(ne=!1,K(),ne))throw new Error("The graph contains a negative weight cycle");return Z}}),v=o((L,P)=>{P.exports=q;function q(T){var H={},B=[],te;function X(N){Object.hasOwn(H,N)||(H[N]=!0,te.push(N),T.successors(N).forEach(X),T.predecessors(N).forEach(X))}return T.nodes().forEach(function(N){te=[],X(N),te.length&&B.push(te)}),B}}),_=o((L,P)=>{var q=class{constructor(){l(this,"_arr",[]),l(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(T){return T.key})}has(T){return Object.hasOwn(this._keyIndices,T)}priority(T){var H=this._keyIndices[T];if(H!==void 0)return this._arr[H].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(T,H){var B=this._keyIndices;if(T=String(T),!Object.hasOwn(B,T)){var te=this._arr,X=te.length;return B[T]=X,te.push({key:T,priority:H}),this._decrease(X),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var T=this._arr.pop();return delete this._keyIndices[T.key],this._heapify(0),T.key}decrease(T,H){var B=this._keyIndices[T];if(H>this._arr[B].priority)throw new Error("New priority is greater than current priority. Key: "+T+" Old: "+this._arr[B].priority+" New: "+H);this._arr[B].priority=H,this._decrease(B)}_heapify(T){var H=this._arr,B=2*T,te=B+1,X=T;B<H.length&&(X=H[B].priority<H[X].priority?B:X,te<H.length&&(X=H[te].priority<H[X].priority?te:X),X!==T&&(this._swap(T,X),this._heapify(X)))}_decrease(T){for(var H=this._arr,B=H[T].priority,te;T!==0&&(te=T>>1,!(H[te].priority<B));)this._swap(T,te),T=te}_swap(T,H){var B=this._arr,te=this._keyIndices,X=B[T],N=B[H];B[T]=N,B[H]=X,te[N.key]=T,te[X.key]=H}};P.exports=q}),y=o((L,P)=>{var q=_();P.exports=H;var T=()=>1;function H(te,X,N,Z){var ne=function(I){return te.outEdges(I)};return B(te,String(X),N||T,Z||ne)}function B(te,X,N,Z){var ne={},I=new q,O,Y,K=function(J){var ie=J.v!==O?J.v:J.w,ue=ne[ie],me=N(J),_e=Y.distance+me;if(me<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+J+" Weight: "+me);_e<ue.distance&&(ue.distance=_e,ue.predecessor=O,I.decrease(ie,_e))};for(te.nodes().forEach(function(J){var ie=J===X?0:Number.POSITIVE_INFINITY;ne[J]={distance:ie},I.add(J,ie)});I.size()>0&&(O=I.removeMin(),Y=ne[O],Y.distance!==Number.POSITIVE_INFINITY);)Z(O).forEach(K);return ne}}),b=o((L,P)=>{var q=y();P.exports=T;function T(H,B,te){return H.nodes().reduce(function(X,N){return X[N]=q(H,N,B,te),X},{})}}),S=o((L,P)=>{P.exports=q;function q(H,B,te){if(H[B].predecessor!==void 0)throw new Error("Invalid source vertex");if(H[te].predecessor===void 0&&te!==B)throw new Error("Invalid destination vertex");return{weight:H[te].distance,path:T(H,B,te)}}function T(H,B,te){for(var X=[],N=te;N!==B;)X.push(N),N=H[N].predecessor;return X.push(B),X.reverse()}}),E=o((L,P)=>{P.exports=q;function q(T){var H=0,B=[],te={},X=[];function N(Z){var ne=te[Z]={onStack:!0,lowlink:H,index:H++};if(B.push(Z),T.successors(Z).forEach(function(Y){Object.hasOwn(te,Y)?te[Y].onStack&&(ne.lowlink=Math.min(ne.lowlink,te[Y].index)):(N(Y),ne.lowlink=Math.min(ne.lowlink,te[Y].lowlink))}),ne.lowlink===ne.index){var I=[],O;do O=B.pop(),te[O].onStack=!1,I.push(O);while(Z!==O);X.push(I)}}return T.nodes().forEach(function(Z){Object.hasOwn(te,Z)||N(Z)}),X}}),A=o((L,P)=>{var q=E();P.exports=T;function T(H){return q(H).filter(function(B){return B.length>1||B.length===1&&H.hasEdge(B[0],B[0])})}}),R=o((L,P)=>{P.exports=T;var q=()=>1;function T(B,te,X){return H(B,te||q,X||function(N){return B.outEdges(N)})}function H(B,te,X){var N={},Z=B.nodes();return Z.forEach(function(ne){N[ne]={},N[ne][ne]={distance:0},Z.forEach(function(I){ne!==I&&(N[ne][I]={distance:Number.POSITIVE_INFINITY})}),X(ne).forEach(function(I){var O=I.v===ne?I.w:I.v,Y=te(I);N[ne][O]={distance:Y,predecessor:ne}})}),Z.forEach(function(ne){var I=N[ne];Z.forEach(function(O){var Y=N[O];Z.forEach(function(K){var J=Y[ne],ie=I[K],ue=Y[K],me=J.distance+ie.distance;me<ue.distance&&(ue.distance=me,ue.predecessor=ie.predecessor)})})}),N}}),M=o((L,P)=>{function q(H){var B={},te={},X=[];function N(Z){if(Object.hasOwn(te,Z))throw new T;Object.hasOwn(B,Z)||(te[Z]=!0,B[Z]=!0,H.predecessors(Z).forEach(N),delete te[Z],X.push(Z))}if(H.sinks().forEach(N),Object.keys(B).length!==H.nodeCount())throw new T;return X}var T=class extends Error{constructor(){super(...arguments)}};P.exports=q,q.CycleException=T}),k=o((L,P)=>{var q=M();P.exports=T;function T(H){try{q(H)}catch(B){if(B instanceof q.CycleException)return!1;throw B}return!0}}),j=o((L,P)=>{P.exports=q;function q(H,B,te,X,N){Array.isArray(B)||(B=[B]);var Z=(H.isDirected()?H.successors:H.neighbors).bind(H),ne={};return B.forEach(function(I){if(!H.hasNode(I))throw new Error("Graph does not have node: "+I);N=T(H,I,te==="post",ne,Z,X,N)}),N}function T(H,B,te,X,N,Z,ne){return Object.hasOwn(X,B)||(X[B]=!0,te||(ne=Z(ne,B)),N(B).forEach(function(I){ne=T(H,I,te,X,N,Z,ne)}),te&&(ne=Z(ne,B))),ne}}),F=o((L,P)=>{var q=j();P.exports=T;function T(H,B,te){return q(H,B,te,function(X,N){return X.push(N),X},[])}}),W=o((L,P)=>{var q=F();P.exports=T;function T(H,B){return q(H,B,"post")}}),V=o((L,P)=>{var q=F();P.exports=T;function T(H,B){return q(H,B,"pre")}}),ee=o((L,P)=>{var q=c(),T=_();P.exports=H;function H(B,te){var X=new q,N={},Z=new T,ne;function I(Y){var K=Y.v===ne?Y.w:Y.v,J=Z.priority(K);if(J!==void 0){var ie=te(Y);ie<J&&(N[K]=ne,Z.decrease(K,ie))}}if(B.nodeCount()===0)return X;B.nodes().forEach(function(Y){Z.add(Y,Number.POSITIVE_INFINITY),X.setNode(Y)}),Z.decrease(B.nodes()[0],0);for(var O=!1;Z.size()>0;){if(ne=Z.removeMin(),Object.hasOwn(N,ne))X.setEdge(ne,N[ne]);else{if(O)throw new Error("Input graph is not connected: "+B);O=!0}B.nodeEdges(ne).forEach(I)}return X}}),U=o((L,P)=>{var q=y(),T=p();P.exports=H;function H(te,X,N,Z){return B(te,X,N,Z||function(ne){return te.outEdges(ne)})}function B(te,X,N,Z){if(N===void 0)return q(te,X,N,Z);for(var ne=!1,I=te.nodes(),O=0;O<I.length;O++){for(var Y=Z(I[O]),K=0;K<Y.length;K++){var J=Y[K],ie=J.v===I[O]?J.v:J.w,ue=ie===J.v?J.w:J.v;N({v:ie,w:ue})<0&&(ne=!0)}if(ne)return T(te,X,N,Z)}return q(te,X,N,Z)}}),G=o((L,P)=>{P.exports={bellmanFord:p(),components:v(),dijkstra:y(),dijkstraAll:b(),extractPath:S(),findCycles:A(),floydWarshall:R(),isAcyclic:k(),postorder:W(),preorder:V(),prim:ee(),shortestPaths:U(),reduce:j(),tarjan:E(),topsort:M()}}),z=f();t.exports={Graph:z.Graph,json:d(),alg:G(),version:z.version}}),P6=Ke((e,t)=>{var s=class{constructor(){let l={};l._next=l._prev=l,this._sentinel=l}dequeue(){let l=this._sentinel,c=l._prev;if(c!==l)return r(c),c}enqueue(l){let c=this._sentinel;l._prev&&l._next&&r(l),l._next=c._next,c._next._prev=l,c._next=l,l._prev=c}toString(){let l=[],c=this._sentinel,h=c._prev;for(;h!==c;)l.push(JSON.stringify(h,o)),h=h._prev;return"["+l.join(", ")+"]"}};function r(l){l._prev._next=l._next,l._next._prev=l._prev,delete l._next,delete l._prev}function o(l,c){if(l!=="_next"&&l!=="_prev")return c}t.exports=s}),z6=Ke((e,t)=>{var s=is().Graph,r=P6();t.exports=l;var o=()=>1;function l(v,_){if(v.nodeCount()<=1)return[];let y=f(v,_||o);return c(y.graph,y.buckets,y.zeroIdx).flatMap(b=>v.outEdges(b.v,b.w))}function c(v,_,y){let b=[],S=_[_.length-1],E=_[0],A;for(;v.nodeCount();){for(;A=E.dequeue();)h(v,_,y,A);for(;A=S.dequeue();)h(v,_,y,A);if(v.nodeCount()){for(let R=_.length-2;R>0;--R)if(A=_[R].dequeue(),A){b=b.concat(h(v,_,y,A,!0));break}}}return b}function h(v,_,y,b,S){let E=S?[]:void 0;return v.inEdges(b.v).forEach(A=>{let R=v.edge(A),M=v.node(A.v);S&&E.push({v:A.v,w:A.w}),M.out-=R,d(_,y,M)}),v.outEdges(b.v).forEach(A=>{let R=v.edge(A),M=A.w,k=v.node(M);k.in-=R,d(_,y,k)}),v.removeNode(b.v),E}function f(v,_){let y=new s,b=0,S=0;v.nodes().forEach(R=>{y.setNode(R,{v:R,in:0,out:0})}),v.edges().forEach(R=>{let M=y.edge(R.v,R.w)||0,k=_(R),j=M+k;y.setEdge(R.v,R.w,j),S=Math.max(S,y.node(R.v).out+=k),b=Math.max(b,y.node(R.w).in+=k)});let E=p(S+b+3).map(()=>new r),A=b+1;return y.nodes().forEach(R=>{d(E,A,y.node(R))}),{graph:y,buckets:E,zeroIdx:A}}function d(v,_,y){y.out?y.in?v[y.out-y.in+_].enqueue(y):v[v.length-1].enqueue(y):v[0].enqueue(y)}function p(v){let _=[];for(let y=0;y<v;y++)_.push(y);return _}}),Ct=Ke((e,t)=>{var s=is().Graph;t.exports={addBorderNode:_,addDummyNode:r,applyWithChunking:S,asNonCompoundGraph:l,buildLayerMatrix:d,intersectRect:f,mapValues:V,maxRank:E,normalizeRanks:p,notime:M,partition:A,pick:W,predecessorWeights:h,range:F,removeEmptyRanks:v,simplify:o,successorWeights:c,time:R,uniqueId:j,zipObject:ee};function r(U,G,z,L){for(var P=L;U.hasNode(P);)P=j(L);return z.dummy=G,U.setNode(P,z),P}function o(U){let G=new s().setGraph(U.graph());return U.nodes().forEach(z=>G.setNode(z,U.node(z))),U.edges().forEach(z=>{let L=G.edge(z.v,z.w)||{weight:0,minlen:1},P=U.edge(z);G.setEdge(z.v,z.w,{weight:L.weight+P.weight,minlen:Math.max(L.minlen,P.minlen)})}),G}function l(U){let G=new s({multigraph:U.isMultigraph()}).setGraph(U.graph());return U.nodes().forEach(z=>{U.children(z).length||G.setNode(z,U.node(z))}),U.edges().forEach(z=>{G.setEdge(z,U.edge(z))}),G}function c(U){let G=U.nodes().map(z=>{let L={};return U.outEdges(z).forEach(P=>{L[P.w]=(L[P.w]||0)+U.edge(P).weight}),L});return ee(U.nodes(),G)}function h(U){let G=U.nodes().map(z=>{let L={};return U.inEdges(z).forEach(P=>{L[P.v]=(L[P.v]||0)+U.edge(P).weight}),L});return ee(U.nodes(),G)}function f(U,G){let z=U.x,L=U.y,P=G.x-z,q=G.y-L,T=U.width/2,H=U.height/2;if(!P&&!q)throw new Error("Not possible to find intersection inside of the rectangle");let B,te;return Math.abs(q)*T>Math.abs(P)*H?(q<0&&(H=-H),B=H*P/q,te=H):(P<0&&(T=-T),B=T,te=T*q/P),{x:z+B,y:L+te}}function d(U){let G=F(E(U)+1).map(()=>[]);return U.nodes().forEach(z=>{let L=U.node(z),P=L.rank;P!==void 0&&(G[P][L.order]=z)}),G}function p(U){let G=U.nodes().map(L=>{let P=U.node(L).rank;return P===void 0?Number.MAX_VALUE:P}),z=S(Math.min,G);U.nodes().forEach(L=>{let P=U.node(L);Object.hasOwn(P,"rank")&&(P.rank-=z)})}function v(U){let G=U.nodes().map(T=>U.node(T).rank).filter(T=>T!==void 0),z=S(Math.min,G),L=[];U.nodes().forEach(T=>{let H=U.node(T).rank-z;L[H]||(L[H]=[]),L[H].push(T)});let P=0,q=U.graph().nodeRankFactor;Array.from(L).forEach((T,H)=>{T===void 0&&H%q!==0?--P:T!==void 0&&P&&T.forEach(B=>U.node(B).rank+=P)})}function _(U,G,z,L){let P={width:0,height:0};return arguments.length>=4&&(P.rank=z,P.order=L),r(U,"border",P,G)}function y(U,G=b){let z=[];for(let L=0;L<U.length;L+=G){let P=U.slice(L,L+G);z.push(P)}return z}var b=65535;function S(U,G){if(G.length>b){let z=y(G);return U.apply(null,z.map(L=>U.apply(null,L)))}else return U.apply(null,G)}function E(U){let G=U.nodes().map(z=>{let L=U.node(z).rank;return L===void 0?Number.MIN_VALUE:L});return S(Math.max,G)}function A(U,G){let z={lhs:[],rhs:[]};return U.forEach(L=>{G(L)?z.lhs.push(L):z.rhs.push(L)}),z}function R(U,G){let z=Date.now();try{return G()}finally{console.log(U+" time: "+(Date.now()-z)+"ms")}}function M(U,G){return G()}var k=0;function j(U){var G=++k;return U+(""+G)}function F(U,G,z=1){G==null&&(G=U,U=0);let L=q=>q<G;z<0&&(L=q=>G<q);let P=[];for(let q=U;L(q);q+=z)P.push(q);return P}function W(U,G){let z={};for(let L of G)U[L]!==void 0&&(z[L]=U[L]);return z}function V(U,G){let z=G;return typeof G=="string"&&(z=L=>L[G]),Object.entries(U).reduce((L,[P,q])=>(L[P]=z(q,P),L),{})}function ee(U,G){return U.reduce((z,L,P)=>(z[L]=G[P],z),{})}}),j6=Ke((e,t)=>{var s=z6(),r=Ct().uniqueId;t.exports={run:o,undo:c};function o(h){(h.graph().acyclicer==="greedy"?s(h,f(h)):l(h)).forEach(d=>{let p=h.edge(d);h.removeEdge(d),p.forwardName=d.name,p.reversed=!0,h.setEdge(d.w,d.v,p,r("rev"))});function f(d){return p=>d.edge(p).weight}}function l(h){let f=[],d={},p={};function v(_){Object.hasOwn(p,_)||(p[_]=!0,d[_]=!0,h.outEdges(_).forEach(y=>{Object.hasOwn(d,y.w)?f.push(y):v(y.w)}),delete d[_])}return h.nodes().forEach(v),f}function c(h){h.edges().forEach(f=>{let d=h.edge(f);if(d.reversed){h.removeEdge(f);let p=d.forwardName;delete d.reversed,delete d.forwardName,h.setEdge(f.w,f.v,d,p)}})}}),H6=Ke((e,t)=>{var s=Ct();t.exports={run:r,undo:l};function r(c){c.graph().dummyChains=[],c.edges().forEach(h=>o(c,h))}function o(c,h){let f=h.v,d=c.node(f).rank,p=h.w,v=c.node(p).rank,_=h.name,y=c.edge(h),b=y.labelRank;if(v===d+1)return;c.removeEdge(h);let S,E,A;for(A=0,++d;d<v;++A,++d)y.points=[],E={width:0,height:0,edgeLabel:y,edgeObj:h,rank:d},S=s.addDummyNode(c,"edge",E,"_d"),d===b&&(E.width=y.width,E.height=y.height,E.dummy="edge-label",E.labelpos=y.labelpos),c.setEdge(f,S,{weight:y.weight},_),A===0&&c.graph().dummyChains.push(S),f=S;c.setEdge(f,p,{weight:y.weight},_)}function l(c){c.graph().dummyChains.forEach(h=>{let f=c.node(h),d=f.edgeLabel,p;for(c.setEdge(f.edgeObj,d);f.dummy;)p=c.successors(h)[0],c.removeNode(h),d.points.push({x:f.x,y:f.y}),f.dummy==="edge-label"&&(d.x=f.x,d.y=f.y,d.width=f.width,d.height=f.height),h=p,f=c.node(h)})}}),Ju=Ke((e,t)=>{var{applyWithChunking:s}=Ct();t.exports={longestPath:r,slack:o};function r(l){var c={};function h(f){var d=l.node(f);if(Object.hasOwn(c,f))return d.rank;c[f]=!0;let p=l.outEdges(f).map(_=>_==null?Number.POSITIVE_INFINITY:h(_.w)-l.edge(_).minlen);var v=s(Math.min,p);return v===Number.POSITIVE_INFINITY&&(v=0),d.rank=v}l.sources().forEach(h)}function o(l,c){return l.node(c.w).rank-l.node(c.v).rank-l.edge(c).minlen}}),V2=Ke((e,t)=>{var s=is().Graph,r=Ju().slack;t.exports=o;function o(f){var d=new s({directed:!1}),p=f.nodes()[0],v=f.nodeCount();d.setNode(p,{});for(var _,y;l(d,f)<v;)_=c(d,f),y=d.hasNode(_.v)?r(f,_):-r(f,_),h(d,f,y);return d}function l(f,d){function p(v){d.nodeEdges(v).forEach(_=>{var y=_.v,b=v===y?_.w:y;!f.hasNode(b)&&!r(d,_)&&(f.setNode(b,{}),f.setEdge(v,b,{}),p(b))})}return f.nodes().forEach(p),f.nodeCount()}function c(f,d){return d.edges().reduce((p,v)=>{let _=Number.POSITIVE_INFINITY;return f.hasNode(v.v)!==f.hasNode(v.w)&&(_=r(d,v)),_<p[0]?[_,v]:p},[Number.POSITIVE_INFINITY,null])[1]}function h(f,d,p){f.nodes().forEach(v=>d.node(v).rank+=p)}}),I6=Ke((e,t)=>{var s=V2(),r=Ju().slack,o=Ju().longestPath,l=is().alg.preorder,c=is().alg.postorder,h=Ct().simplify;t.exports=f,f.initLowLimValues=_,f.initCutValues=d,f.calcCutValue=v,f.leaveEdge=b,f.enterEdge=S,f.exchangeEdges=E;function f(k){k=h(k),o(k);var j=s(k);_(j),d(j,k);for(var F,W;F=b(j);)W=S(j,k,F),E(j,k,F,W)}function d(k,j){var F=c(k,k.nodes());F=F.slice(0,F.length-1),F.forEach(W=>p(k,j,W))}function p(k,j,F){var W=k.node(F),V=W.parent;k.edge(F,V).cutvalue=v(k,j,F)}function v(k,j,F){var W=k.node(F),V=W.parent,ee=!0,U=j.edge(F,V),G=0;return U||(ee=!1,U=j.edge(V,F)),G=U.weight,j.nodeEdges(F).forEach(z=>{var L=z.v===F,P=L?z.w:z.v;if(P!==V){var q=L===ee,T=j.edge(z).weight;if(G+=q?T:-T,R(k,F,P)){var H=k.edge(F,P).cutvalue;G+=q?-H:H}}}),G}function _(k,j){arguments.length<2&&(j=k.nodes()[0]),y(k,{},1,j)}function y(k,j,F,W,V){var ee=F,U=k.node(W);return j[W]=!0,k.neighbors(W).forEach(G=>{Object.hasOwn(j,G)||(F=y(k,j,F,G,W))}),U.low=ee,U.lim=F++,V?U.parent=V:delete U.parent,F}function b(k){return k.edges().find(j=>k.edge(j).cutvalue<0)}function S(k,j,F){var W=F.v,V=F.w;j.hasEdge(W,V)||(W=F.w,V=F.v);var ee=k.node(W),U=k.node(V),G=ee,z=!1;ee.lim>U.lim&&(G=U,z=!0);var L=j.edges().filter(P=>z===M(k,k.node(P.v),G)&&z!==M(k,k.node(P.w),G));return L.reduce((P,q)=>r(j,q)<r(j,P)?q:P)}function E(k,j,F,W){var V=F.v,ee=F.w;k.removeEdge(V,ee),k.setEdge(W.v,W.w,{}),_(k),d(k,j),A(k,j)}function A(k,j){var F=k.nodes().find(V=>!j.node(V).parent),W=l(k,F);W=W.slice(1),W.forEach(V=>{var ee=k.node(V).parent,U=j.edge(V,ee),G=!1;U||(U=j.edge(ee,V),G=!0),j.node(V).rank=j.node(ee).rank+(G?U.minlen:-U.minlen)})}function R(k,j,F){return k.hasEdge(j,F)}function M(k,j,F){return F.low<=j.lim&&j.lim<=F.lim}}),V6=Ke((e,t)=>{var s=Ju(),r=s.longestPath,o=V2(),l=I6();t.exports=c;function c(p){var v=p.graph().ranker;if(v instanceof Function)return v(p);switch(p.graph().ranker){case"network-simplex":d(p);break;case"tight-tree":f(p);break;case"longest-path":h(p);break;case"none":break;default:d(p)}}var h=r;function f(p){r(p),o(p)}function d(p){l(p)}}),U6=Ke((e,t)=>{t.exports=s;function s(l){let c=o(l);l.graph().dummyChains.forEach(h=>{let f=l.node(h),d=f.edgeObj,p=r(l,c,d.v,d.w),v=p.path,_=p.lca,y=0,b=v[y],S=!0;for(;h!==d.w;){if(f=l.node(h),S){for(;(b=v[y])!==_&&l.node(b).maxRank<f.rank;)y++;b===_&&(S=!1)}if(!S){for(;y<v.length-1&&l.node(b=v[y+1]).minRank<=f.rank;)y++;b=v[y]}l.setParent(h,b),h=l.successors(h)[0]}})}function r(l,c,h,f){let d=[],p=[],v=Math.min(c[h].low,c[f].low),_=Math.max(c[h].lim,c[f].lim),y,b;y=h;do y=l.parent(y),d.push(y);while(y&&(c[y].low>v||_>c[y].lim));for(b=y,y=f;(y=l.parent(y))!==b;)p.push(y);return{path:d.concat(p.reverse()),lca:b}}function o(l){let c={},h=0;function f(d){let p=h;l.children(d).forEach(f),c[d]={low:p,lim:h++}}return l.children().forEach(f),c}}),F6=Ke((e,t)=>{var s=Ct();t.exports={run:r,cleanup:h};function r(f){let d=s.addDummyNode(f,"root",{},"_root"),p=l(f),v=Object.values(p),_=s.applyWithChunking(Math.max,v)-1,y=2*_+1;f.graph().nestingRoot=d,f.edges().forEach(S=>f.edge(S).minlen*=y);let b=c(f)+1;f.children().forEach(S=>o(f,d,y,b,_,p,S)),f.graph().nodeRankFactor=y}function o(f,d,p,v,_,y,b){let S=f.children(b);if(!S.length){b!==d&&f.setEdge(d,b,{weight:0,minlen:p});return}let E=s.addBorderNode(f,"_bt"),A=s.addBorderNode(f,"_bb"),R=f.node(b);f.setParent(E,b),R.borderTop=E,f.setParent(A,b),R.borderBottom=A,S.forEach(M=>{o(f,d,p,v,_,y,M);let k=f.node(M),j=k.borderTop?k.borderTop:M,F=k.borderBottom?k.borderBottom:M,W=k.borderTop?v:2*v,V=j!==F?1:_-y[b]+1;f.setEdge(E,j,{weight:W,minlen:V,nestingEdge:!0}),f.setEdge(F,A,{weight:W,minlen:V,nestingEdge:!0})}),f.parent(b)||f.setEdge(d,E,{weight:0,minlen:_+y[b]})}function l(f){var d={};function p(v,_){var y=f.children(v);y&&y.length&&y.forEach(b=>p(b,_+1)),d[v]=_}return f.children().forEach(v=>p(v,1)),d}function c(f){return f.edges().reduce((d,p)=>d+f.edge(p).weight,0)}function h(f){var d=f.graph();f.removeNode(d.nestingRoot),delete d.nestingRoot,f.edges().forEach(p=>{var v=f.edge(p);v.nestingEdge&&f.removeEdge(p)})}}),W6=Ke((e,t)=>{var s=Ct();t.exports=r;function r(l){function c(h){let f=l.children(h),d=l.node(h);if(f.length&&f.forEach(c),Object.hasOwn(d,"minRank")){d.borderLeft=[],d.borderRight=[];for(let p=d.minRank,v=d.maxRank+1;p<v;++p)o(l,"borderLeft","_bl",h,d,p),o(l,"borderRight","_br",h,d,p)}}l.children().forEach(c)}function o(l,c,h,f,d,p){let v={width:0,height:0,rank:p,borderType:c},_=d[c][p-1],y=s.addDummyNode(l,"border",v,h);d[c][p]=y,l.setParent(y,f),_&&l.setEdge(_,y,{weight:1})}}),Y6=Ke((e,t)=>{t.exports={adjust:s,undo:r};function s(p){let v=p.graph().rankdir.toLowerCase();(v==="lr"||v==="rl")&&o(p)}function r(p){let v=p.graph().rankdir.toLowerCase();(v==="bt"||v==="rl")&&c(p),(v==="lr"||v==="rl")&&(f(p),o(p))}function o(p){p.nodes().forEach(v=>l(p.node(v))),p.edges().forEach(v=>l(p.edge(v)))}function l(p){let v=p.width;p.width=p.height,p.height=v}function c(p){p.nodes().forEach(v=>h(p.node(v))),p.edges().forEach(v=>{let _=p.edge(v);_.points.forEach(h),Object.hasOwn(_,"y")&&h(_)})}function h(p){p.y=-p.y}function f(p){p.nodes().forEach(v=>d(p.node(v))),p.edges().forEach(v=>{let _=p.edge(v);_.points.forEach(d),Object.hasOwn(_,"x")&&d(_)})}function d(p){let v=p.x;p.x=p.y,p.y=v}}),K6=Ke((e,t)=>{var s=Ct();t.exports=r;function r(o){let l={},c=o.nodes().filter(v=>!o.children(v).length),h=c.map(v=>o.node(v).rank),f=s.applyWithChunking(Math.max,h),d=s.range(f+1).map(()=>[]);function p(v){if(l[v])return;l[v]=!0;let _=o.node(v);d[_.rank].push(v),o.successors(v).forEach(p)}return c.sort((v,_)=>o.node(v).rank-o.node(_).rank).forEach(p),d}}),q6=Ke((e,t)=>{var s=Ct().zipObject;t.exports=r;function r(l,c){let h=0;for(let f=1;f<c.length;++f)h+=o(l,c[f-1],c[f]);return h}function o(l,c,h){let f=s(h,h.map((b,S)=>S)),d=c.flatMap(b=>l.outEdges(b).map(S=>({pos:f[S.w],weight:l.edge(S).weight})).sort((S,E)=>S.pos-E.pos)),p=1;for(;p<h.length;)p<<=1;let v=2*p-1;p-=1;let _=new Array(v).fill(0),y=0;return d.forEach(b=>{let S=b.pos+p;_[S]+=b.weight;let E=0;for(;S>0;)S%2&&(E+=_[S+1]),S=S-1>>1,_[S]+=b.weight;y+=b.weight*E}),y}}),G6=Ke((e,t)=>{t.exports=s;function s(r,o=[]){return o.map(l=>{let c=r.inEdges(l);if(c.length){let h=c.reduce((f,d)=>{let p=r.edge(d),v=r.node(d.v);return{sum:f.sum+p.weight*v.order,weight:f.weight+p.weight}},{sum:0,weight:0});return{v:l,barycenter:h.sum/h.weight,weight:h.weight}}else return{v:l}})}}),$6=Ke((e,t)=>{var s=Ct();t.exports=r;function r(c,h){let f={};c.forEach((p,v)=>{let _=f[p.v]={indegree:0,in:[],out:[],vs:[p.v],i:v};p.barycenter!==void 0&&(_.barycenter=p.barycenter,_.weight=p.weight)}),h.edges().forEach(p=>{let v=f[p.v],_=f[p.w];v!==void 0&&_!==void 0&&(_.indegree++,v.out.push(f[p.w]))});let d=Object.values(f).filter(p=>!p.indegree);return o(d)}function o(c){let h=[];function f(p){return v=>{v.merged||(v.barycenter===void 0||p.barycenter===void 0||v.barycenter>=p.barycenter)&&l(p,v)}}function d(p){return v=>{v.in.push(p),--v.indegree===0&&c.push(v)}}for(;c.length;){let p=c.pop();h.push(p),p.in.reverse().forEach(f(p)),p.out.forEach(d(p))}return h.filter(p=>!p.merged).map(p=>s.pick(p,["vs","i","barycenter","weight"]))}function l(c,h){let f=0,d=0;c.weight&&(f+=c.barycenter*c.weight,d+=c.weight),h.weight&&(f+=h.barycenter*h.weight,d+=h.weight),c.vs=h.vs.concat(c.vs),c.barycenter=f/d,c.weight=d,c.i=Math.min(h.i,c.i),h.merged=!0}}),X6=Ke((e,t)=>{var s=Ct();t.exports=r;function r(c,h){let f=s.partition(c,E=>Object.hasOwn(E,"barycenter")),d=f.lhs,p=f.rhs.sort((E,A)=>A.i-E.i),v=[],_=0,y=0,b=0;d.sort(l(!!h)),b=o(v,p,b),d.forEach(E=>{b+=E.vs.length,v.push(E.vs),_+=E.barycenter*E.weight,y+=E.weight,b=o(v,p,b)});let S={vs:v.flat(!0)};return y&&(S.barycenter=_/y,S.weight=y),S}function o(c,h,f){let d;for(;h.length&&(d=h[h.length-1]).i<=f;)h.pop(),c.push(d.vs),f++;return f}function l(c){return(h,f)=>h.barycenter<f.barycenter?-1:h.barycenter>f.barycenter?1:c?f.i-h.i:h.i-f.i}}),Z6=Ke((e,t)=>{var s=G6(),r=$6(),o=X6();t.exports=l;function l(f,d,p,v){let _=f.children(d),y=f.node(d),b=y?y.borderLeft:void 0,S=y?y.borderRight:void 0,E={};b&&(_=_.filter(k=>k!==b&&k!==S));let A=s(f,_);A.forEach(k=>{if(f.children(k.v).length){let j=l(f,k.v,p,v);E[k.v]=j,Object.hasOwn(j,"barycenter")&&h(k,j)}});let R=r(A,p);c(R,E);let M=o(R,v);if(b&&(M.vs=[b,M.vs,S].flat(!0),f.predecessors(b).length)){let k=f.node(f.predecessors(b)[0]),j=f.node(f.predecessors(S)[0]);Object.hasOwn(M,"barycenter")||(M.barycenter=0,M.weight=0),M.barycenter=(M.barycenter*M.weight+k.order+j.order)/(M.weight+2),M.weight+=2}return M}function c(f,d){f.forEach(p=>{p.vs=p.vs.flatMap(v=>d[v]?d[v].vs:v)})}function h(f,d){f.barycenter!==void 0?(f.barycenter=(f.barycenter*f.weight+d.barycenter*d.weight)/(f.weight+d.weight),f.weight+=d.weight):(f.barycenter=d.barycenter,f.weight=d.weight)}}),Q6=Ke((e,t)=>{var s=is().Graph,r=Ct();t.exports=o;function o(c,h,f,d){d||(d=c.nodes());let p=l(c),v=new s({compound:!0}).setGraph({root:p}).setDefaultNodeLabel(_=>c.node(_));return d.forEach(_=>{let y=c.node(_),b=c.parent(_);(y.rank===h||y.minRank<=h&&h<=y.maxRank)&&(v.setNode(_),v.setParent(_,b||p),c[f](_).forEach(S=>{let E=S.v===_?S.w:S.v,A=v.edge(E,_),R=A!==void 0?A.weight:0;v.setEdge(E,_,{weight:c.edge(S).weight+R})}),Object.hasOwn(y,"minRank")&&v.setNode(_,{borderLeft:y.borderLeft[h],borderRight:y.borderRight[h]}))}),v}function l(c){for(var h;c.hasNode(h=r.uniqueId("_root")););return h}}),J6=Ke((e,t)=>{t.exports=s;function s(r,o,l){let c={},h;l.forEach(f=>{let d=r.parent(f),p,v;for(;d;){if(p=r.parent(d),p?(v=c[p],c[p]=d):(v=h,h=d),v&&v!==d){o.setEdge(v,d);return}d=p}})}}),ez=Ke((e,t)=>{var s=K6(),r=q6(),o=Z6(),l=Q6(),c=J6(),h=is().Graph,f=Ct();t.exports=d;function d(y,b={}){if(typeof b.customOrder=="function"){b.customOrder(y,d);return}let S=f.maxRank(y),E=p(y,f.range(1,S+1),"inEdges"),A=p(y,f.range(S-1,-1,-1),"outEdges"),R=s(y);if(_(y,R),b.disableOptimalOrderHeuristic)return;let M=Number.POSITIVE_INFINITY,k,j=b.constraints||[];for(let F=0,W=0;W<4;++F,++W){v(F%2?E:A,F%4>=2,j),R=f.buildLayerMatrix(y);let V=r(y,R);V<M?(W=0,k=Object.assign({},R),M=V):V===M&&(k=structuredClone(R))}_(y,k)}function p(y,b,S){let E=new Map,A=(R,M)=>{E.has(R)||E.set(R,[]),E.get(R).push(M)};for(let R of y.nodes()){let M=y.node(R);if(typeof M.rank=="number"&&A(M.rank,R),typeof M.minRank=="number"&&typeof M.maxRank=="number")for(let k=M.minRank;k<=M.maxRank;k++)k!==M.rank&&A(k,R)}return b.map(function(R){return l(y,R,S,E.get(R)||[])})}function v(y,b,S){let E=new h;y.forEach(function(A){S.forEach(k=>E.setEdge(k.left,k.right));let R=A.graph().root,M=o(A,R,E,b);M.vs.forEach((k,j)=>A.node(k).order=j),c(A,E,M.vs)})}function _(y,b){Object.values(b).forEach(S=>S.forEach((E,A)=>y.node(E).order=A))}}),tz=Ke((e,t)=>{var s=is().Graph,r=Ct();t.exports={positionX:S,findType1Conflicts:o,findType2Conflicts:l,addConflict:h,hasConflict:f,verticalAlignment:d,horizontalCompaction:p,alignCoordinates:y,findSmallestWidthAlignment:_,balance:b};function o(R,M){let k={};function j(F,W){let V=0,ee=0,U=F.length,G=W[W.length-1];return W.forEach((z,L)=>{let P=c(R,z),q=P?R.node(P).order:U;(P||z===G)&&(W.slice(ee,L+1).forEach(T=>{R.predecessors(T).forEach(H=>{let B=R.node(H),te=B.order;(te<V||q<te)&&!(B.dummy&&R.node(T).dummy)&&h(k,H,T)})}),ee=L+1,V=q)}),W}return M.length&&M.reduce(j),k}function l(R,M){let k={};function j(W,V,ee,U,G){let z;r.range(V,ee).forEach(L=>{z=W[L],R.node(z).dummy&&R.predecessors(z).forEach(P=>{let q=R.node(P);q.dummy&&(q.order<U||q.order>G)&&h(k,P,z)})})}function F(W,V){let ee=-1,U,G=0;return V.forEach((z,L)=>{if(R.node(z).dummy==="border"){let P=R.predecessors(z);P.length&&(U=R.node(P[0]).order,j(V,G,L,ee,U),G=L,ee=U)}j(V,G,V.length,U,W.length)}),V}return M.length&&M.reduce(F),k}function c(R,M){if(R.node(M).dummy)return R.predecessors(M).find(k=>R.node(k).dummy)}function h(R,M,k){if(M>k){let F=M;M=k,k=F}let j=R[M];j||(R[M]=j={}),j[k]=!0}function f(R,M,k){if(M>k){let j=M;M=k,k=j}return!!R[M]&&Object.hasOwn(R[M],k)}function d(R,M,k,j){let F={},W={},V={};return M.forEach(ee=>{ee.forEach((U,G)=>{F[U]=U,W[U]=U,V[U]=G})}),M.forEach(ee=>{let U=-1;ee.forEach(G=>{let z=j(G);if(z.length){z=z.sort((P,q)=>V[P]-V[q]);let L=(z.length-1)/2;for(let P=Math.floor(L),q=Math.ceil(L);P<=q;++P){let T=z[P];W[G]===G&&U<V[T]&&!f(k,G,T)&&(W[T]=G,W[G]=F[G]=F[T],U=V[T])}}})}),{root:F,align:W}}function p(R,M,k,j,F){let W={},V=v(R,M,k,F),ee=F?"borderLeft":"borderRight";function U(L,P){let q=V.nodes().slice(),T={},H=q.pop();for(;H;){if(T[H])L(H);else{T[H]=!0,q.push(H);for(let B of P(H))q.push(B)}H=q.pop()}}function G(L){W[L]=V.inEdges(L).reduce((P,q)=>Math.max(P,W[q.v]+V.edge(q)),0)}function z(L){let P=V.outEdges(L).reduce((T,H)=>Math.min(T,W[H.w]-V.edge(H)),Number.POSITIVE_INFINITY),q=R.node(L);P!==Number.POSITIVE_INFINITY&&q.borderType!==ee&&(W[L]=Math.max(W[L],P))}return U(G,V.predecessors.bind(V)),U(z,V.successors.bind(V)),Object.keys(j).forEach(L=>W[L]=W[k[L]]),W}function v(R,M,k,j){let F=new s,W=R.graph(),V=E(W.nodesep,W.edgesep,j);return M.forEach(ee=>{let U;ee.forEach(G=>{let z=k[G];if(F.setNode(z),U){var L=k[U],P=F.edge(L,z);F.setEdge(L,z,Math.max(V(R,G,U),P||0))}U=G})}),F}function _(R,M){return Object.values(M).reduce((k,j)=>{let F=Number.NEGATIVE_INFINITY,W=Number.POSITIVE_INFINITY;Object.entries(j).forEach(([ee,U])=>{let G=A(R,ee)/2;F=Math.max(U+G,F),W=Math.min(U-G,W)});let V=F-W;return V<k[0]&&(k=[V,j]),k},[Number.POSITIVE_INFINITY,null])[1]}function y(R,M){let k=Object.values(M),j=r.applyWithChunking(Math.min,k),F=r.applyWithChunking(Math.max,k);["u","d"].forEach(W=>{["l","r"].forEach(V=>{let ee=W+V,U=R[ee];if(U===M)return;let G=Object.values(U),z=j-r.applyWithChunking(Math.min,G);V!=="l"&&(z=F-r.applyWithChunking(Math.max,G)),z&&(R[ee]=r.mapValues(U,L=>L+z))})})}function b(R,M){return r.mapValues(R.ul,(k,j)=>{if(M)return R[M.toLowerCase()][j];{let F=Object.values(R).map(W=>W[j]).sort((W,V)=>W-V);return(F[1]+F[2])/2}})}function S(R){let M=r.buildLayerMatrix(R),k=Object.assign(o(R,M),l(R,M)),j={},F;["u","d"].forEach(V=>{F=V==="u"?M:Object.values(M).reverse(),["l","r"].forEach(ee=>{ee==="r"&&(F=F.map(L=>Object.values(L).reverse()));let U=(V==="u"?R.predecessors:R.successors).bind(R),G=d(R,F,k,U),z=p(R,F,G.root,G.align,ee==="r");ee==="r"&&(z=r.mapValues(z,L=>-L)),j[V+ee]=z})});let W=_(R,j);return y(j,W),b(j,R.graph().align)}function E(R,M,k){return(j,F,W)=>{let V=j.node(F),ee=j.node(W),U=0,G;if(U+=V.width/2,Object.hasOwn(V,"labelpos"))switch(V.labelpos.toLowerCase()){case"l":G=-V.width/2;break;case"r":G=V.width/2;break}if(G&&(U+=k?G:-G),G=0,U+=(V.dummy?M:R)/2,U+=(ee.dummy?M:R)/2,U+=ee.width/2,Object.hasOwn(ee,"labelpos"))switch(ee.labelpos.toLowerCase()){case"l":G=ee.width/2;break;case"r":G=-ee.width/2;break}return G&&(U+=k?G:-G),G=0,U}}function A(R,M){return R.node(M).width}}),iz=Ke((e,t)=>{var s=Ct(),r=tz().positionX;t.exports=o;function o(c){c=s.asNonCompoundGraph(c),l(c),Object.entries(r(c)).forEach(([h,f])=>c.node(h).x=f)}function l(c){let h=s.buildLayerMatrix(c),f=c.graph().ranksep,d=c.graph().rankalign,p=0;h.forEach(v=>{let _=v.reduce((y,b)=>{let S=c.node(b).height;return y>S?y:S},0);v.forEach(y=>{let b=c.node(y);d==="top"?b.y=p+b.height/2:d==="bottom"?b.y=p+_-b.height/2:b.y=p+_/2}),p+=_+f})}}),sz=Ke((e,t)=>{var s=j6(),r=H6(),o=V6(),l=Ct().normalizeRanks,c=U6(),h=Ct().removeEmptyRanks,f=F6(),d=W6(),p=Y6(),v=ez(),_=iz(),y=Ct(),b=is().Graph;t.exports=S;function S(O,Y={}){let K=Y.debugTiming?y.time:y.notime;return K("layout",()=>{let J=K(" buildLayoutGraph",()=>U(O));return K(" runLayout",()=>E(J,K,Y)),K(" updateInputGraph",()=>A(O,J)),J})}function E(O,Y,K){Y(" makeSpaceForEdgeLabels",()=>G(O)),Y(" removeSelfEdges",()=>X(O)),Y(" acyclic",()=>s.run(O)),Y(" nestingGraph.run",()=>f.run(O)),Y(" rank",()=>o(y.asNonCompoundGraph(O))),Y(" injectEdgeLabelProxies",()=>z(O)),Y(" removeEmptyRanks",()=>h(O)),Y(" nestingGraph.cleanup",()=>f.cleanup(O)),Y(" normalizeRanks",()=>l(O)),Y(" assignRankMinMax",()=>L(O)),Y(" removeEdgeLabelProxies",()=>P(O)),Y(" normalize.run",()=>r.run(O)),Y(" parentDummyChains",()=>c(O)),Y(" addBorderSegments",()=>d(O)),Y(" order",()=>v(O,K)),Y(" insertSelfEdges",()=>N(O)),Y(" adjustCoordinateSystem",()=>p.adjust(O)),Y(" position",()=>_(O)),Y(" positionSelfEdges",()=>Z(O)),Y(" removeBorderNodes",()=>te(O)),Y(" normalize.undo",()=>r.undo(O)),Y(" fixupEdgeLabelCoords",()=>H(O)),Y(" undoCoordinateSystem",()=>p.undo(O)),Y(" translateGraph",()=>q(O)),Y(" assignNodeIntersects",()=>T(O)),Y(" reversePoints",()=>B(O)),Y(" acyclic.undo",()=>s.undo(O))}function A(O,Y){O.nodes().forEach(K=>{let J=O.node(K),ie=Y.node(K);J&&(J.x=ie.x,J.y=ie.y,J.order=ie.order,J.rank=ie.rank,Y.children(K).length&&(J.width=ie.width,J.height=ie.height))}),O.edges().forEach(K=>{let J=O.edge(K),ie=Y.edge(K);J.points=ie.points,Object.hasOwn(ie,"x")&&(J.x=ie.x,J.y=ie.y)}),O.graph().width=Y.graph().width,O.graph().height=Y.graph().height}var R=["nodesep","edgesep","ranksep","marginx","marginy"],M={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb",rankalign:"center"},k=["acyclicer","ranker","rankdir","align","rankalign"],j=["width","height","rank"],F={width:0,height:0},W=["minlen","weight","width","height","labeloffset"],V={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},ee=["labelpos"];function U(O){let Y=new b({multigraph:!0,compound:!0}),K=I(O.graph());return Y.setGraph(Object.assign({},M,ne(K,R),y.pick(K,k))),O.nodes().forEach(J=>{let ie=I(O.node(J)),ue=ne(ie,j);Object.keys(F).forEach(me=>{ue[me]===void 0&&(ue[me]=F[me])}),Y.setNode(J,ue),Y.setParent(J,O.parent(J))}),O.edges().forEach(J=>{let ie=I(O.edge(J));Y.setEdge(J,Object.assign({},V,ne(ie,W),y.pick(ie,ee)))}),Y}function G(O){let Y=O.graph();Y.ranksep/=2,O.edges().forEach(K=>{let J=O.edge(K);J.minlen*=2,J.labelpos.toLowerCase()!=="c"&&(Y.rankdir==="TB"||Y.rankdir==="BT"?J.width+=J.labeloffset:J.height+=J.labeloffset)})}function z(O){O.edges().forEach(Y=>{let K=O.edge(Y);if(K.width&&K.height){let J=O.node(Y.v),ie={rank:(O.node(Y.w).rank-J.rank)/2+J.rank,e:Y};y.addDummyNode(O,"edge-proxy",ie,"_ep")}})}function L(O){let Y=0;O.nodes().forEach(K=>{let J=O.node(K);J.borderTop&&(J.minRank=O.node(J.borderTop).rank,J.maxRank=O.node(J.borderBottom).rank,Y=Math.max(Y,J.maxRank))}),O.graph().maxRank=Y}function P(O){O.nodes().forEach(Y=>{let K=O.node(Y);K.dummy==="edge-proxy"&&(O.edge(K.e).labelRank=K.rank,O.removeNode(Y))})}function q(O){let Y=Number.POSITIVE_INFINITY,K=0,J=Number.POSITIVE_INFINITY,ie=0,ue=O.graph(),me=ue.marginx||0,_e=ue.marginy||0;function xe(ke){let qe=ke.x,Xt=ke.y,Ri=ke.width,Wo=ke.height;Y=Math.min(Y,qe-Ri/2),K=Math.max(K,qe+Ri/2),J=Math.min(J,Xt-Wo/2),ie=Math.max(ie,Xt+Wo/2)}O.nodes().forEach(ke=>xe(O.node(ke))),O.edges().forEach(ke=>{let qe=O.edge(ke);Object.hasOwn(qe,"x")&&xe(qe)}),Y-=me,J-=_e,O.nodes().forEach(ke=>{let qe=O.node(ke);qe.x-=Y,qe.y-=J}),O.edges().forEach(ke=>{let qe=O.edge(ke);qe.points.forEach(Xt=>{Xt.x-=Y,Xt.y-=J}),Object.hasOwn(qe,"x")&&(qe.x-=Y),Object.hasOwn(qe,"y")&&(qe.y-=J)}),ue.width=K-Y+me,ue.height=ie-J+_e}function T(O){O.edges().forEach(Y=>{let K=O.edge(Y),J=O.node(Y.v),ie=O.node(Y.w),ue,me;K.points?(ue=K.points[0],me=K.points[K.points.length-1]):(K.points=[],ue=ie,me=J),K.points.unshift(y.intersectRect(J,ue)),K.points.push(y.intersectRect(ie,me))})}function H(O){O.edges().forEach(Y=>{let K=O.edge(Y);if(Object.hasOwn(K,"x"))switch((K.labelpos==="l"||K.labelpos==="r")&&(K.width-=K.labeloffset),K.labelpos){case"l":K.x-=K.width/2+K.labeloffset;break;case"r":K.x+=K.width/2+K.labeloffset;break}})}function B(O){O.edges().forEach(Y=>{let K=O.edge(Y);K.reversed&&K.points.reverse()})}function te(O){O.nodes().forEach(Y=>{if(O.children(Y).length){let K=O.node(Y),J=O.node(K.borderTop),ie=O.node(K.borderBottom),ue=O.node(K.borderLeft[K.borderLeft.length-1]),me=O.node(K.borderRight[K.borderRight.length-1]);K.width=Math.abs(me.x-ue.x),K.height=Math.abs(ie.y-J.y),K.x=ue.x+K.width/2,K.y=J.y+K.height/2}}),O.nodes().forEach(Y=>{O.node(Y).dummy==="border"&&O.removeNode(Y)})}function X(O){O.edges().forEach(Y=>{if(Y.v===Y.w){var K=O.node(Y.v);K.selfEdges||(K.selfEdges=[]),K.selfEdges.push({e:Y,label:O.edge(Y)}),O.removeEdge(Y)}})}function N(O){var Y=y.buildLayerMatrix(O);Y.forEach(K=>{var J=0;K.forEach((ie,ue)=>{var me=O.node(ie);me.order=ue+J,(me.selfEdges||[]).forEach(_e=>{y.addDummyNode(O,"selfedge",{width:_e.label.width,height:_e.label.height,rank:me.rank,order:ue+ ++J,e:_e.e,label:_e.label},"_se")}),delete me.selfEdges})})}function Z(O){O.nodes().forEach(Y=>{var K=O.node(Y);if(K.dummy==="selfedge"){var J=O.node(K.e.v),ie=J.x+J.width/2,ue=J.y,me=K.x-ie,_e=J.height/2;O.setEdge(K.e,K.label),O.removeNode(Y),K.label.points=[{x:ie+2*me/3,y:ue-_e},{x:ie+5*me/6,y:ue-_e},{x:ie+me,y:ue},{x:ie+5*me/6,y:ue+_e},{x:ie+2*me/3,y:ue+_e}],K.label.x=K.x,K.label.y=K.y}})}function ne(O,Y){return y.mapValues(y.pick(O,Y),Number)}function I(O){var Y={};return O&&Object.entries(O).forEach(([K,J])=>{typeof K=="string"&&(K=K.toLowerCase()),Y[K]=J}),Y}}),nz=Ke((e,t)=>{var s=Ct(),r=is().Graph;t.exports={debugOrdering:o};function o(l){let c=s.buildLayerMatrix(l),h=new r({compound:!0,multigraph:!0}).setGraph({});return l.nodes().forEach(f=>{h.setNode(f,{label:f}),h.setParent(f,"layer"+l.node(f).rank)}),l.edges().forEach(f=>h.setEdge(f.v,f.w,{},f.name)),c.forEach((f,d)=>{let p="layer"+d;h.setNode(p,{rank:"same"}),f.reduce((v,_)=>(h.setEdge(v,_,{style:"invis"}),_))}),h}}),rz=Ke((e,t)=>{t.exports="2.0.4"}),oz=Ke((e,t)=>{t.exports={graphlib:is(),layout:sz(),debug:nz(),util:{time:Ct().time,notime:Ct().notime},version:rz()}});const Dw=oz();const az={open:{bg:"#1a2e1a",border:"#238636",text:"#7ee787"},in_progress:{bg:"#152238",border:"#1f6feb",text:"#79c0ff"},closed:{bg:"#1c1c1c",border:"#484f58",text:"#8b949e"},blocked:{bg:"#3b1a1a",border:"#da3633",text:"#ff7b72"},deferred:{bg:"#2a2017",border:"#9e6a03",text:"#e3b341"}},lz={open:{bg:"#dafbe1",border:"#238636",text:"#116329"},in_progress:{bg:"#ddf4ff",border:"#1f6feb",text:"#0550ae"},closed:{bg:"#f0f0f0",border:"#8b949e",text:"#57606a"},blocked:{bg:"#ffebe9",border:"#da3633",text:"#cf222e"},deferred:{bg:"#fff8c5",border:"#9e6a03",text:"#6f4e00"}},Ow={0:"#f85149",1:"#e3b341",2:"#58a6ff",3:"#7d8590",4:"#484f58"},cz={bg:"#1c1c1c",border:"#484f58",text:"#8b949e"},uz={bg:"#f6f8fa",border:"#d0d7de",text:"#57606a"},dr=200,yo=62,lu=40;function rv(e){return typeof e=="string"?{depends_on_id:e,type:"blocks"}:{depends_on_id:e.depends_on_id,type:e.type||"blocks"}}function hz(e){const t=new Dw.graphlib.Graph;t.setGraph({rankdir:"TB",nodesep:40,ranksep:60,marginx:lu,marginy:lu}),t.setDefaultEdgeLabel(()=>({}));const s=new Map(e.map(d=>[d.id,d]));for(const d of e)t.setNode(d.id,{width:dr,height:yo});const r=new Map;for(const d of e)if(d.dependencies)for(const p of d.dependencies){const v=rv(p);if(s.has(v.depends_on_id)){const _=`${d.id}|${v.depends_on_id}`;r.set(_,v.type),t.setEdge(d.id,v.depends_on_id)}}for(const d of e)if(d.parent&&s.has(d.parent)){const p=`${d.parent}|${d.id}`;r.has(p)||(r.set(p,"parent-child"),t.setEdge(d.parent,d.id))}Dw.layout(t);const o=[],l=[];for(const d of t.nodes()){const p=t.node(d),v=s.get(d);p&&v&&o.push({id:d,x:p.x,y:p.y,issue:v})}for(const d of t.edges()){const p=t.edge(d);if(p&&p.points){const v=`${d.v}|${d.w}`;l.push({from:d.v,to:d.w,type:r.get(v)||"blocks",points:p.points})}}const c=t.graph(),h=(c?.width||800)+lu*2,f=(c?.height||600)+lu*2;return{nodes:o,edges:l,width:h,height:f}}function U2(e,t,s=new Set){if(s.has(e))return s;s.add(e);const r=t.get(e);if(r?.dependencies)for(const o of r.dependencies){const l=rv(o);t.has(l.depends_on_id)&&U2(l.depends_on_id,t,s)}return s}function F2(e,t,s=new Set){if(s.has(e))return s;s.add(e);const r=t.get(e)||[];for(const o of r)F2(o,t,s);return s}function dz(e){if(e.length<2)return"";if(e.length===2)return`M ${e[0].x} ${e[0].y} L ${e[1].x} ${e[1].y}`;let t=`M ${e[0].x} ${e[0].y}`;for(let r=1;r<e.length-1;r++){const o=e[r],l=e[r+1],c=(o.x+l.x)/2,h=(o.y+l.y)/2;r===1?t+=` Q ${o.x} ${o.y} ${c} ${h}`:t+=` T ${c} ${h}`}const s=e[e.length-1];return t+=` L ${s.x} ${s.y}`,t}function fz(e,t){return e.length<=t?e:e.slice(0,t-1)+"…"}function mz({issues:e,onNodeClick:t}){const s=x.useRef(null),[r,o]=x.useState(null),[l,c]=x.useState({x:0,y:0,scale:1}),[h,f]=x.useState(!1),d=x.useRef({x:0,y:0,tx:0,ty:0}),[p,v]=x.useState(!0);x.useEffect(()=>{const z=()=>v(document.documentElement.classList.contains("dark"));z();const L=new MutationObserver(z);return L.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>L.disconnect()},[]);const _=p?az:lz,y=p?cz:uz,b=x.useMemo(()=>new Map(e.map(z=>[z.id,z])),[e]),S=x.useMemo(()=>{const z=new Map;for(const L of e){if(L.dependencies)for(const P of L.dependencies){const q=rv(P),T=z.get(q.depends_on_id)||[];T.push(L.id),z.set(q.depends_on_id,T)}if(L.parent){const P=z.get(L.parent)||[];P.push(L.id),z.set(L.parent,P)}}return z},[e]),E=x.useMemo(()=>hz(e),[e]),A=x.useMemo(()=>{if(!r)return null;const z=U2(r,b),L=F2(r,S);return new Set([...z,...L])},[r,b,S]);x.useEffect(()=>{if(!s.current)return;const{width:z,height:L}=E,P=s.current.clientWidth,q=s.current.clientHeight;if(z===0||L===0)return;const T=Math.min(P/z,q/L,1)*.9,H=(P-z*T)/2,B=(q-L*T)/2;c({x:H,y:B,scale:T})},[E]);const R=x.useCallback(z=>{z.preventDefault();const L=z.deltaY>0?.9:1.1;c(P=>{const q=Math.min(3,Math.max(.1,P.scale*L)),T=s.current?.getBoundingClientRect();if(!T)return{...P,scale:q};const H=z.clientX-T.left,B=z.clientY-T.top;return{scale:q,x:H-(H-P.x)*(q/P.scale),y:B-(B-P.y)*(q/P.scale)}})},[]),M=x.useCallback(z=>{z.button===0&&(z.target.closest(".dag-node")||(f(!0),d.current={x:z.clientX,y:z.clientY,tx:l.x,ty:l.y}))},[l]),k=x.useCallback(z=>{h&&c({...l,x:d.current.tx+(z.clientX-d.current.x),y:d.current.ty+(z.clientY-d.current.y)})},[h,l]),j=x.useCallback(()=>{f(!1)},[]),F=x.useCallback(z=>{o(L=>L===z?null:z),t?.(z)},[t]),W=p?"#0d1117":"#ffffff",V=p?"rgba(255,255,255,0.03)":"rgba(0,0,0,0.04)",ee=p?"rgba(139,148,158,0.3)":"rgba(87,96,106,0.25)",U=p?"rgba(136,192,255,0.7)":"rgba(31,111,235,0.6)",G=p?"rgba(139,148,158,0.08)":"rgba(87,96,106,0.08)";return e.length===0?C.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:"No issues to display"}):C.jsxs("div",{ref:s,className:"w-full h-full relative overflow-hidden",style:{background:W,cursor:h?"grabbing":"grab"},onWheel:R,onMouseDown:M,onMouseMove:k,onMouseUp:j,onMouseLeave:j,children:[C.jsxs("svg",{width:"100%",height:"100%",style:{position:"absolute",top:0,left:0},children:[C.jsxs("defs",{children:[C.jsx("pattern",{id:"dag-grid",width:"20",height:"20",patternUnits:"userSpaceOnUse",patternTransform:`translate(${l.x},${l.y}) scale(${l.scale})`,children:C.jsx("circle",{cx:"10",cy:"10",r:"0.5",fill:V})}),C.jsx("marker",{id:"dag-arrow",viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto-start-reverse",children:C.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:ee})}),C.jsx("marker",{id:"dag-arrow-highlight",viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto-start-reverse",children:C.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:U})}),C.jsx("marker",{id:"dag-arrow-dim",viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto-start-reverse",children:C.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:G})}),C.jsxs("filter",{id:"dag-glow",children:[C.jsx("feGaussianBlur",{stdDeviation:"3",result:"coloredBlur"}),C.jsxs("feMerge",{children:[C.jsx("feMergeNode",{in:"coloredBlur"}),C.jsx("feMergeNode",{in:"SourceGraphic"})]})]})]}),C.jsx("rect",{width:"100%",height:"100%",fill:"url(#dag-grid)"}),C.jsxs("g",{transform:`translate(${l.x},${l.y}) scale(${l.scale})`,children:[E.edges.map((z,L)=>{const P=A?A.has(z.from)&&A.has(z.to):!1,q=A!==null&&!P,T=q?G:P?U:ee,H=q?"dag-arrow-dim":P?"dag-arrow-highlight":"dag-arrow",B=z.type==="parent-child";return C.jsx("path",{d:dz(z.points),fill:"none",stroke:T,strokeWidth:P?2:1.5,strokeDasharray:B?"6 3":void 0,markerEnd:`url(#${H})`,style:{transition:"stroke 0.3s, stroke-width 0.3s, opacity 0.3s"}},`edge-${L}`)}),E.nodes.map(z=>{const L=z.issue.status||"open",P=_[L]||y,q=r===z.id,T=A?A.has(z.id):!1,B=A!==null&&!T?.2:1,te=Ow[z.issue.priority]||Ow[3];return C.jsxs("g",{className:"dag-node",transform:`translate(${z.x-dr/2},${z.y-yo/2})`,onClick:()=>F(z.id),style:{cursor:"pointer",opacity:B,transition:"opacity 0.3s"},children:[C.jsx("rect",{width:dr,height:yo,rx:8,ry:8,fill:P.bg,stroke:q?P.text:P.border,strokeWidth:q?2.5:1.5,filter:q?"url(#dag-glow)":void 0,style:{transition:"stroke 0.2s, stroke-width 0.2s"}}),C.jsx("rect",{x:0,y:0,width:4,height:yo,rx:2,fill:P.border}),C.jsx("circle",{cx:dr-12,cy:yo/2,r:4,fill:te,opacity:.8}),C.jsx("text",{x:dr-12,y:yo/2+3.5,fill:p?"#0d1117":"#ffffff",fontSize:7,fontFamily:"system-ui, sans-serif",fontWeight:700,textAnchor:"middle",children:z.issue.priority}),C.jsx("text",{x:14,y:20,fill:P.text,fontSize:11,fontFamily:"ui-monospace, SFMono-Regular, monospace",fontWeight:600,children:z.issue.id}),C.jsx("text",{x:14,y:40,fill:p?"#c9d1d9":"#1f2328",fontSize:11,fontFamily:"system-ui, -apple-system, sans-serif",children:fz(z.issue.title,24)}),C.jsx("rect",{x:dr-80,y:6,width:56,height:18,rx:9,fill:P.border,opacity:.3}),C.jsx("text",{x:dr-52,y:18,fill:P.text,fontSize:9,fontFamily:"system-ui, sans-serif",textAnchor:"middle",children:L.replace("_"," ")})]},z.id)})]})]}),C.jsxs("div",{className:"absolute bottom-4 left-4 rounded-lg border p-3 text-xs space-y-1.5",style:{background:p?"rgba(13,17,23,0.9)":"rgba(255,255,255,0.9)",borderColor:p?"rgba(48,54,61,0.8)":"rgba(208,215,222,0.8)",backdropFilter:"blur(8px)"},children:[C.jsx("div",{className:"font-semibold text-foreground mb-1",children:"Status"}),Object.entries(_).map(([z,L])=>C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("span",{className:"inline-block w-3 h-3 rounded-sm",style:{background:L.border}}),C.jsx("span",{style:{color:L.text},children:z.replace("_"," ")})]},z)),C.jsxs("div",{className:"border-t pt-1.5 mt-1.5",style:{borderColor:p?"rgba(48,54,61,0.6)":"rgba(208,215,222,0.6)"},children:[C.jsx("div",{className:"font-semibold text-foreground mb-1",children:"Edges"}),C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("svg",{width:"24",height:"8",children:C.jsx("line",{x1:"0",y1:"4",x2:"24",y2:"4",stroke:ee,strokeWidth:"1.5"})}),C.jsx("span",{className:"text-muted-foreground",children:"blocks"})]}),C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("svg",{width:"24",height:"8",children:C.jsx("line",{x1:"0",y1:"4",x2:"24",y2:"4",stroke:ee,strokeWidth:"1.5",strokeDasharray:"4 2"})}),C.jsx("span",{className:"text-muted-foreground",children:"parent-child"})]})]}),C.jsx("div",{className:"border-t pt-1.5 mt-1.5",style:{borderColor:p?"rgba(48,54,61,0.6)":"rgba(208,215,222,0.6)"},children:C.jsx("span",{className:"text-muted-foreground",children:"Click node to highlight deps"})})]}),C.jsx("div",{className:"absolute bottom-4 right-4 rounded-lg border px-3 py-2 text-xs text-muted-foreground",style:{background:p?"rgba(13,17,23,0.9)":"rgba(255,255,255,0.9)",borderColor:p?"rgba(48,54,61,0.8)":"rgba(208,215,222,0.8)",backdropFilter:"blur(8px)"},children:"Scroll to zoom · Drag to pan"})]})}const pz=[{value:"all",label:"All Priorities"},{value:"0",label:"P0"},{value:"1",label:"P1"},{value:"2",label:"P2"},{value:"3",label:"P3"},{value:"4",label:"P4"}],gz=[{value:"all",label:"All Types"},{value:"task",label:"Task"},{value:"bug",label:"Bug"},{value:"feature",label:"Feature"},{value:"epic",label:"Epic"},{value:"chore",label:"Chore"}];function vz({filters:e,onFiltersChange:t,issues:s}){const r=x.useMemo(()=>{const l=new Set;for(const c of s)c.assignee&&l.add(c.assignee);return Array.from(l).sort()},[s]),o=e.priority!=="all"||e.type!=="all"||e.assignee!=="all";return C.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-b border-border shrink-0",children:[C.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Filters"}),C.jsxs(_u,{value:e.priority,onValueChange:l=>t({...e,priority:l}),children:[C.jsx(bu,{size:"sm",className:"w-[130px]",children:C.jsx(yu,{})}),C.jsx(Su,{children:pz.map(l=>C.jsx(Ga,{value:l.value,children:l.label},l.value))})]}),C.jsxs(_u,{value:e.type,onValueChange:l=>t({...e,type:l}),children:[C.jsx(bu,{size:"sm",className:"w-[130px]",children:C.jsx(yu,{})}),C.jsx(Su,{children:gz.map(l=>C.jsx(Ga,{value:l.value,children:l.label},l.value))})]}),C.jsxs(_u,{value:e.assignee,onValueChange:l=>t({...e,assignee:l}),children:[C.jsx(bu,{size:"sm",className:"w-[150px]",children:C.jsx(yu,{})}),C.jsxs(Su,{children:[C.jsx(Ga,{value:"all",children:"All Assignees"}),r.map(l=>C.jsx(Ga,{value:l,children:l},l))]})]}),o&&C.jsx("button",{onClick:()=>t({priority:"all",type:"all",assignee:"all"}),className:"text-xs text-muted-foreground hover:text-foreground transition-colors underline underline-offset-2",children:"Clear"})]})}function Tm(e,t){return e.filter(s=>!(t.priority!=="all"&&String(s.priority)!==t.priority||t.type!=="all"&&s.type!==t.type||t.assignee!=="all"&&s.assignee!==t.assignee))}var W2=Object.defineProperty,_z=Object.getOwnPropertyDescriptor,yz=(e,t)=>{for(var s in t)W2(e,s,{get:t[s],enumerable:!0})},ft=(e,t,s,r)=>{for(var o=r>1?void 0:r?_z(t,s):t,l=e.length-1,c;l>=0;l--)(c=e[l])&&(o=(r?c(t,s,o):c(o))||o);return r&&o&&W2(t,s,o),o},ge=(e,t)=>(s,r)=>t(s,r,e),Nw="Terminal input",Ep={get:()=>Nw,set:e=>Nw=e},Lw="Too much output to announce, navigate to rows manually to read",Tp={get:()=>Lw,set:e=>Lw=e};function bz(e){return e.replace(/\r?\n/g,"\r")}function Sz(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function wz(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function xz(e,t,s,r){if(e.stopPropagation(),e.clipboardData){let o=e.clipboardData.getData("text/plain");Y2(o,t,s,r)}}function Y2(e,t,s,r){e=bz(e),e=Sz(e,s.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),s.triggerDataEvent(e,!0),t.value=""}function K2(e,t,s){let r=s.getBoundingClientRect(),o=e.clientX-r.left-10,l=e.clientY-r.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${o}px`,t.style.top=`${l}px`,t.style.zIndex="1000",t.focus()}function Bw(e,t,s,r,o){K2(e,t,s),o&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function Rn(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function Eh(e,t=0,s=e.length){let r="";for(let o=t;o<s;++o){let l=e[o];l>65535?(l-=65536,r+=String.fromCharCode((l>>10)+55296)+String.fromCharCode(l%1024+56320)):r+=String.fromCharCode(l)}return r}var Cz=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let s=e.length;if(!s)return 0;let r=0,o=0;if(this._interim){let l=e.charCodeAt(o++);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=o;l<s;++l){let c=e.charCodeAt(l);if(55296<=c&&c<=56319){if(++l>=s)return this._interim=c,r;let h=e.charCodeAt(l);56320<=h&&h<=57343?t[r++]=(c-55296)*1024+h-56320+65536:(t[r++]=c,t[r++]=h);continue}c!==65279&&(t[r++]=c)}return r}},Ez=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let s=e.length;if(!s)return 0;let r=0,o,l,c,h,f=0,d=0;if(this.interim[0]){let _=!1,y=this.interim[0];y&=(y&224)===192?31:(y&240)===224?15:7;let b=0,S;for(;(S=this.interim[++b]&63)&&b<4;)y<<=6,y|=S;let E=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,A=E-b;for(;d<A;){if(d>=s)return 0;if(S=e[d++],(S&192)!==128){d--,_=!0;break}else this.interim[b++]=S,y<<=6,y|=S&63}_||(E===2?y<128?d--:t[r++]=y:E===3?y<2048||y>=55296&&y<=57343||y===65279||(t[r++]=y):y<65536||y>1114111||(t[r++]=y)),this.interim.fill(0)}let p=s-4,v=d;for(;v<s;){for(;v<p&&!((o=e[v])&128)&&!((l=e[v+1])&128)&&!((c=e[v+2])&128)&&!((h=e[v+3])&128);)t[r++]=o,t[r++]=l,t[r++]=c,t[r++]=h,v+=4;if(o=e[v++],o<128)t[r++]=o;else if((o&224)===192){if(v>=s)return this.interim[0]=o,r;if(l=e[v++],(l&192)!==128){v--;continue}if(f=(o&31)<<6|l&63,f<128){v--;continue}t[r++]=f}else if((o&240)===224){if(v>=s)return this.interim[0]=o,r;if(l=e[v++],(l&192)!==128){v--;continue}if(v>=s)return this.interim[0]=o,this.interim[1]=l,r;if(c=e[v++],(c&192)!==128){v--;continue}if(f=(o&15)<<12|(l&63)<<6|c&63,f<2048||f>=55296&&f<=57343||f===65279)continue;t[r++]=f}else if((o&248)===240){if(v>=s)return this.interim[0]=o,r;if(l=e[v++],(l&192)!==128){v--;continue}if(v>=s)return this.interim[0]=o,this.interim[1]=l,r;if(c=e[v++],(c&192)!==128){v--;continue}if(v>=s)return this.interim[0]=o,this.interim[1]=l,this.interim[2]=c,r;if(h=e[v++],(h&192)!==128){v--;continue}if(f=(o&7)<<18|(l&63)<<12|(c&63)<<6|h&63,f<65536||f>1114111)continue;t[r++]=f}}return r}},q2="",Dn=" ",kl=class G2{constructor(){this.fg=0,this.bg=0,this.extended=new eh}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 G2;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}},eh=class $2{constructor(t=0,s=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=s}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 $2(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Yi=class X2 extends kl{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new eh,this.combinedData=""}static fromCharData(t){let s=new X2;return s.setFromCharData(t),s}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Rn(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 s=!1;if(t[1].length>2)s=!0;else if(t[1].length===2){let r=t[1].charCodeAt(0);if(55296<=r&&r<=56319){let o=t[1].charCodeAt(1);56320<=o&&o<=57343?this.content=(r-55296)*1024+o-56320+65536|t[2]<<22:s=!0}else s=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;s&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Pw="di$target",kp="di$dependencies",km=new Map;function Tz(e){return e[kp]||[]}function zt(e){if(km.has(e))return km.get(e);let t=function(s,r,o){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");kz(t,s,o)};return t._id=e,km.set(e,t),t}function kz(e,t,s){t[Pw]===t?t[kp].push({id:e,index:s}):(t[kp]=[{id:e,index:s}],t[Pw]=t)}var ii=zt("BufferService"),Z2=zt("CoreMouseService"),kr=zt("CoreService"),Az=zt("CharsetService"),ov=zt("InstantiationService"),Q2=zt("LogService"),si=zt("OptionsService"),J2=zt("OscLinkService"),Rz=zt("UnicodeService"),Al=zt("DecorationService"),Ap=class{constructor(e,t,s){this._bufferService=e,this._optionsService=t,this._oscLinkService=s}provideLinks(e,t){let s=this._bufferService.buffer.lines.get(e-1);if(!s){t(void 0);return}let r=[],o=this._optionsService.rawOptions.linkHandler,l=new Yi,c=s.getTrimmedLength(),h=-1,f=-1,d=!1;for(let p=0;p<c;p++)if(!(f===-1&&!s.hasContent(p))){if(s.loadCell(p,l),l.hasExtendedAttrs()&&l.extended.urlId)if(f===-1){f=p,h=l.extended.urlId;continue}else d=l.extended.urlId!==h;else f!==-1&&(d=!0);if(d||f!==-1&&p===c-1){let v=this._oscLinkService.getLinkData(h)?.uri;if(v){let _={start:{x:f+1,y:e},end:{x:p+(!d&&p===c-1?1:0),y:e}},y=!1;if(!o?.allowNonHttpProtocols)try{let b=new URL(v);["http:","https:"].includes(b.protocol)||(y=!0)}catch{y=!0}y||r.push({text:v,range:_,activate:(b,S)=>o?o.activate(b,S,_):Mz(b,S),hover:(b,S)=>o?.hover?.(b,S,_),leave:(b,S)=>o?.leave?.(b,S,_)})}d=!1,l.hasExtendedAttrs()&&l.extended.urlId?(f=p,h=l.extended.urlId):(f=-1,h=-1)}}t(r)}};Ap=ft([ge(0,ii),ge(1,si),ge(2,J2)],Ap);function Mz(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
59
|
+
|
|
60
|
+
WARNING: This link could potentially be dangerous`)){let s=window.open();if(s){try{s.opener=null}catch{}s.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var Th=zt("CharSizeService"),qs=zt("CoreBrowserService"),av=zt("MouseService"),Gs=zt("RenderService"),Dz=zt("SelectionService"),eT=zt("CharacterJoinerService"),Uo=zt("ThemeService"),tT=zt("LinkProviderService"),Oz=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?zw.isErrorNoTelemetry(e)?new zw(e.message+`
|
|
61
|
+
|
|
62
|
+
`+e.stack):new Error(e.message+`
|
|
63
|
+
|
|
64
|
+
`+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)}},Nz=new Oz;function Mu(e){Lz(e)||Nz.onUnexpectedError(e)}var Rp="Canceled";function Lz(e){return e instanceof Bz?!0:e instanceof Error&&e.name===Rp&&e.message===Rp}var Bz=class extends Error{constructor(){super(Rp),this.name=this.message}};function Pz(e){return new Error(`Illegal argument: ${e}`)}var zw=class Mp extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof Mp)return t;let s=new Mp;return s.message=t.message,s.stack=t.stack,s}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},Dp=class iT extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,iT.prototype)}};function wi(e,t=0){return e[e.length-(1+t)]}var zz;(e=>{function t(l){return l<0}e.isLessThan=t;function s(l){return l<=0}e.isLessThanOrEqual=s;function r(l){return l>0}e.isGreaterThan=r;function o(l){return l===0}e.isNeitherLessOrGreaterThan=o,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(zz||={});function jz(e,t){let s=this,r=!1,o;return function(){return r||(r=!0,t||(o=e.apply(s,arguments))),o}}var sT;(e=>{function t(k){return k&&typeof k=="object"&&typeof k[Symbol.iterator]=="function"}e.is=t;let s=Object.freeze([]);function r(){return s}e.empty=r;function*o(k){yield k}e.single=o;function l(k){return t(k)?k:o(k)}e.wrap=l;function c(k){return k||s}e.from=c;function*h(k){for(let j=k.length-1;j>=0;j--)yield k[j]}e.reverse=h;function f(k){return!k||k[Symbol.iterator]().next().done===!0}e.isEmpty=f;function d(k){return k[Symbol.iterator]().next().value}e.first=d;function p(k,j){let F=0;for(let W of k)if(j(W,F++))return!0;return!1}e.some=p;function v(k,j){for(let F of k)if(j(F))return F}e.find=v;function*_(k,j){for(let F of k)j(F)&&(yield F)}e.filter=_;function*y(k,j){let F=0;for(let W of k)yield j(W,F++)}e.map=y;function*b(k,j){let F=0;for(let W of k)yield*j(W,F++)}e.flatMap=b;function*S(...k){for(let j of k)yield*j}e.concat=S;function E(k,j,F){let W=F;for(let V of k)W=j(W,V);return W}e.reduce=E;function*A(k,j,F=k.length){for(j<0&&(j+=k.length),F<0?F+=k.length:F>k.length&&(F=k.length);j<F;j++)yield k[j]}e.slice=A;function R(k,j=Number.POSITIVE_INFINITY){let F=[];if(j===0)return[F,k];let W=k[Symbol.iterator]();for(let V=0;V<j;V++){let ee=W.next();if(ee.done)return[F,e.empty()];F.push(ee.value)}return[F,{[Symbol.iterator](){return W}}]}e.consume=R;async function M(k){let j=[];for await(let F of k)j.push(F);return Promise.resolve(j)}e.asyncToArray=M})(sT||={});function xr(e){if(sT.is(e)){let t=[];for(let s of e)if(s)try{s.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 Hz(...e){return rt(()=>xr(e))}function rt(e){return{dispose:jz(()=>{e()})}}var nT=class rT{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{xr(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?rT.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)}};nT.DISABLE_DISPOSED_WARNING=!1;var On=nT,Le=class{constructor(){this._store=new On,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)}};Le.None=Object.freeze({dispose(){}});var Lo=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},Us=typeof window=="object"?window:globalThis,Op=class Np{constructor(t){this.element=t,this.next=Np.Undefined,this.prev=Np.Undefined}};Op.Undefined=new Op(void 0);var ot=Op,jw=class{constructor(){this._first=ot.Undefined,this._last=ot.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ot.Undefined}clear(){let e=this._first;for(;e!==ot.Undefined;){let t=e.next;e.prev=ot.Undefined,e.next=ot.Undefined,e=t}this._first=ot.Undefined,this._last=ot.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let s=new ot(e);if(this._first===ot.Undefined)this._first=s,this._last=s;else if(t){let o=this._last;this._last=s,s.prev=o,o.next=s}else{let o=this._first;this._first=s,s.next=o,o.prev=s}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(s))}}shift(){if(this._first!==ot.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==ot.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==ot.Undefined&&e.next!==ot.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===ot.Undefined&&e.next===ot.Undefined?(this._first=ot.Undefined,this._last=ot.Undefined):e.next===ot.Undefined?(this._last=this._last.prev,this._last.next=ot.Undefined):e.prev===ot.Undefined&&(this._first=this._first.next,this._first.prev=ot.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==ot.Undefined;)yield e.element,e=e.next}},Iz=globalThis.performance&&typeof globalThis.performance.now=="function",Vz=class oT{static create(t){return new oT(t)}constructor(t){this._now=Iz&&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}},Wt;(e=>{e.None=()=>Le.None;function t(z,L){return v(z,()=>{},0,void 0,!0,void 0,L)}e.defer=t;function s(z){return(L,P=null,q)=>{let T=!1,H;return H=z(B=>{if(!T)return H?H.dispose():T=!0,L.call(P,B)},null,q),T&&H.dispose(),H}}e.once=s;function r(z,L,P){return d((q,T=null,H)=>z(B=>q.call(T,L(B)),null,H),P)}e.map=r;function o(z,L,P){return d((q,T=null,H)=>z(B=>{L(B),q.call(T,B)},null,H),P)}e.forEach=o;function l(z,L,P){return d((q,T=null,H)=>z(B=>L(B)&&q.call(T,B),null,H),P)}e.filter=l;function c(z){return z}e.signal=c;function h(...z){return(L,P=null,q)=>{let T=Hz(...z.map(H=>H(B=>L.call(P,B))));return p(T,q)}}e.any=h;function f(z,L,P,q){let T=P;return r(z,H=>(T=L(T,H),T),q)}e.reduce=f;function d(z,L){let P,q={onWillAddFirstListener(){P=z(T.fire,T)},onDidRemoveLastListener(){P?.dispose()}},T=new pe(q);return L?.add(T),T.event}function p(z,L){return L instanceof Array?L.push(z):L&&L.add(z),z}function v(z,L,P=100,q=!1,T=!1,H,B){let te,X,N,Z=0,ne,I={leakWarningThreshold:H,onWillAddFirstListener(){te=z(Y=>{Z++,X=L(X,Y),q&&!N&&(O.fire(X),X=void 0),ne=()=>{let K=X;X=void 0,N=void 0,(!q||Z>1)&&O.fire(K),Z=0},typeof P=="number"?(clearTimeout(N),N=setTimeout(ne,P)):N===void 0&&(N=0,queueMicrotask(ne))})},onWillRemoveListener(){T&&Z>0&&ne?.()},onDidRemoveLastListener(){ne=void 0,te.dispose()}},O=new pe(I);return B?.add(O),O.event}e.debounce=v;function _(z,L=0,P){return e.debounce(z,(q,T)=>q?(q.push(T),q):[T],L,void 0,!0,void 0,P)}e.accumulate=_;function y(z,L=(q,T)=>q===T,P){let q=!0,T;return l(z,H=>{let B=q||!L(H,T);return q=!1,T=H,B},P)}e.latch=y;function b(z,L,P){return[e.filter(z,L,P),e.filter(z,q=>!L(q),P)]}e.split=b;function S(z,L=!1,P=[],q){let T=P.slice(),H=z(X=>{T?T.push(X):te.fire(X)});q&&q.add(H);let B=()=>{T?.forEach(X=>te.fire(X)),T=null},te=new pe({onWillAddFirstListener(){H||(H=z(X=>te.fire(X)),q&&q.add(H))},onDidAddFirstListener(){T&&(L?setTimeout(B):B())},onDidRemoveLastListener(){H&&H.dispose(),H=null}});return q&&q.add(te),te.event}e.buffer=S;function E(z,L){return(P,q,T)=>{let H=L(new R);return z(function(B){let te=H.evaluate(B);te!==A&&P.call(q,te)},void 0,T)}}e.chain=E;let A=Symbol("HaltChainable");class R{constructor(){this.steps=[]}map(L){return this.steps.push(L),this}forEach(L){return this.steps.push(P=>(L(P),P)),this}filter(L){return this.steps.push(P=>L(P)?P:A),this}reduce(L,P){let q=P;return this.steps.push(T=>(q=L(q,T),q)),this}latch(L=(P,q)=>P===q){let P=!0,q;return this.steps.push(T=>{let H=P||!L(T,q);return P=!1,q=T,H?T:A}),this}evaluate(L){for(let P of this.steps)if(L=P(L),L===A)break;return L}}function M(z,L,P=q=>q){let q=(...te)=>B.fire(P(...te)),T=()=>z.on(L,q),H=()=>z.removeListener(L,q),B=new pe({onWillAddFirstListener:T,onDidRemoveLastListener:H});return B.event}e.fromNodeEventEmitter=M;function k(z,L,P=q=>q){let q=(...te)=>B.fire(P(...te)),T=()=>z.addEventListener(L,q),H=()=>z.removeEventListener(L,q),B=new pe({onWillAddFirstListener:T,onDidRemoveLastListener:H});return B.event}e.fromDOMEventEmitter=k;function j(z){return new Promise(L=>s(z)(L))}e.toPromise=j;function F(z){let L=new pe;return z.then(P=>{L.fire(P)},()=>{L.fire(void 0)}).finally(()=>{L.dispose()}),L.event}e.fromPromise=F;function W(z,L){return z(P=>L.fire(P))}e.forward=W;function V(z,L,P){return L(P),z(q=>L(q))}e.runAndSubscribe=V;class ee{constructor(L,P){this._observable=L,this._counter=0,this._hasChanged=!1;let q={onWillAddFirstListener:()=>{L.addObserver(this)},onDidRemoveLastListener:()=>{L.removeObserver(this)}};this.emitter=new pe(q),P&&P.add(this.emitter)}beginUpdate(L){this._counter++}handlePossibleChange(L){}handleChange(L,P){this._hasChanged=!0}endUpdate(L){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function U(z,L){return new ee(z,L).emitter.event}e.fromObservable=U;function G(z){return(L,P,q)=>{let T=0,H=!1,B={beginUpdate(){T++},endUpdate(){T--,T===0&&(z.reportChanges(),H&&(H=!1,L.call(P)))},handlePossibleChange(){},handleChange(){H=!0}};z.addObserver(B),z.reportChanges();let te={dispose(){z.removeObserver(B)}};return q instanceof On?q.add(te):Array.isArray(q)&&q.push(te),te}}e.fromObservableLight=G})(Wt||={});var Lp=class Bp{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${Bp._idPool++}`,Bp.all.add(this)}start(t){this._stopWatch=new Vz,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}}};Lp.all=new Set,Lp._idPool=0;var Uz=Lp,Fz=-1,aT=class lT{constructor(t,s,r=(lT._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=s,this.name=r,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(t,s){let r=this.threshold;if(r<=0||s<r)return;this._stacks||(this._stacks=new Map);let o=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,o+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=r*.5;let[l,c]=this.getMostFrequentStack(),h=`[${this.name}] potential listener LEAK detected, having ${s} listeners already. MOST frequent listener (${c}):`;console.warn(h),console.warn(l);let f=new Kz(h,l);this._errorHandler(f)}return()=>{let l=this._stacks.get(t.value)||0;this._stacks.set(t.value,l-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,s=0;for(let[r,o]of this._stacks)(!t||s<o)&&(t=[r,o],s=o);return t}};aT._idPool=1;var Wz=aT,Yz=class cT{constructor(t){this.value=t}static create(){let t=new Error;return new cT(t.stack??"")}print(){console.warn(this.value.split(`
|
|
65
|
+
`).slice(2).join(`
|
|
66
|
+
`))}},Kz=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},qz=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},Gz=0,Am=class{constructor(e){this.value=e,this.id=Gz++}},$z=2,Xz,pe=class{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new Wz(e?.onListenerError??Mu,this._options?.leakWarningThreshold??Fz):void 0,this._perfMon=this._options?._profName?new Uz(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,t,s)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let c=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(c);let h=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],f=new qz(`${c}. HINT: Stack shows most frequent listener (${h[1]}-times)`,h[0]);return(this._options?.onListenerError||Mu)(f),Le.None}if(this._disposed)return Le.None;t&&(e=e.bind(t));let r=new Am(e),o;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=Yz.create(),o=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof Am?(this._deliveryQueue??=new Zz,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let l=rt(()=>{o?.(),this._removeListener(r)});return s instanceof On?s.add(l):Array.isArray(s)&&s.push(l),l},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,s=t.indexOf(e);if(s===-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[s]=void 0;let r=this._deliveryQueue.current===this;if(this._size*$z<=t.length){let o=0;for(let l=0;l<t.length;l++)t[l]?t[o++]=t[l]:r&&(this._deliveryQueue.end--,o<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=o}}_deliver(e,t){if(!e)return;let s=this._options?.onListenerError||Mu;if(!s){e.value(t);return}try{e.value(t)}catch(r){s(r)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof Am)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}this._perfMon?.stop()}hasListeners(){return this._size>0}},Zz=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,s){this.i=0,this.end=s,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Pp=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new pe,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new pe,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,s){if(this.getZoomLevel(s)===t)return;let r=this.getWindowId(s);this.mapWindowIdToZoomLevel.set(r,t),this._onDidChangeZoomLevel.fire(r)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,s){this.mapWindowIdToZoomFactor.set(this.getWindowId(s),t)}setFullscreen(t,s){if(this.isFullscreen(s)===t)return;let r=this.getWindowId(s);this.mapWindowIdToFullScreen.set(r,t),this._onDidChangeFullscreen.fire(r)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};Pp.INSTANCE=new Pp;var lv=Pp;function Qz(e,t,s){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",s)}lv.INSTANCE.onDidChangeZoomLevel;function Jz(e){return lv.INSTANCE.getZoomFactor(e)}lv.INSTANCE.onDidChangeFullscreen;var Fo=typeof navigator=="object"?navigator.userAgent:"",zp=Fo.indexOf("Firefox")>=0,ej=Fo.indexOf("AppleWebKit")>=0,cv=Fo.indexOf("Chrome")>=0,tj=!cv&&Fo.indexOf("Safari")>=0;Fo.indexOf("Electron/")>=0;Fo.indexOf("Android")>=0;var Rm=!1;if(typeof Us.matchMedia=="function"){let e=Us.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=Us.matchMedia("(display-mode: fullscreen)");Rm=e.matches,Qz(Us,e,({matches:s})=>{Rm&&t.matches||(Rm=s)})}var Eo="en",jp=!1,Hp=!1,Du=!1,uT=!1,cu,Ou=Eo,Hw=Eo,ij,Vs,yr=globalThis,Ci;typeof yr.vscode<"u"&&typeof yr.vscode.process<"u"?Ci=yr.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(Ci=process);var sj=typeof Ci?.versions?.electron=="string",nj=sj&&Ci?.type==="renderer";if(typeof Ci=="object"){jp=Ci.platform==="win32",Hp=Ci.platform==="darwin",Du=Ci.platform==="linux",Du&&Ci.env.SNAP&&Ci.env.SNAP_REVISION,Ci.env.CI||Ci.env.BUILD_ARTIFACTSTAGINGDIRECTORY,cu=Eo,Ou=Eo;let e=Ci.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);cu=t.userLocale,Hw=t.osLocale,Ou=t.resolvedLanguage||Eo,ij=t.languagePack?.translationsConfigFile}catch{}uT=!0}else typeof navigator=="object"&&!nj?(Vs=navigator.userAgent,jp=Vs.indexOf("Windows")>=0,Hp=Vs.indexOf("Macintosh")>=0,(Vs.indexOf("Macintosh")>=0||Vs.indexOf("iPad")>=0||Vs.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Du=Vs.indexOf("Linux")>=0,Vs?.indexOf("Mobi")>=0,Ou=globalThis._VSCODE_NLS_LANGUAGE||Eo,cu=navigator.language.toLowerCase(),Hw=cu):console.error("Unable to resolve platform.");var hT=jp,gs=Hp,rj=Du,Iw=uT,_s=Vs,xn=Ou,oj;(e=>{function t(){return xn}e.value=t;function s(){return xn.length===2?xn==="en":xn.length>=3?xn[0]==="e"&&xn[1]==="n"&&xn[2]==="-":!1}e.isDefaultVariant=s;function r(){return xn==="en"}e.isDefault=r})(oj||={});var aj=typeof yr.postMessage=="function"&&!yr.importScripts;(()=>{if(aj){let e=[];yr.addEventListener("message",s=>{if(s.data&&s.data.vscodeScheduleAsyncWork)for(let r=0,o=e.length;r<o;r++){let l=e[r];if(l.id===s.data.vscodeScheduleAsyncWork){e.splice(r,1),l.callback();return}}});let t=0;return s=>{let r=++t;e.push({id:r,callback:s}),yr.postMessage({vscodeScheduleAsyncWork:r},"*")}}return e=>setTimeout(e)})();var lj=!!(_s&&_s.indexOf("Chrome")>=0);_s&&_s.indexOf("Firefox")>=0;!lj&&_s&&_s.indexOf("Safari")>=0;_s&&_s.indexOf("Edg/")>=0;_s&&_s.indexOf("Android")>=0;var go=typeof navigator=="object"?navigator:{};Iw||document.queryCommandSupported&&document.queryCommandSupported("copy")||go&&go.clipboard&&go.clipboard.writeText,Iw||go&&go.clipboard&&go.clipboard.readText;var uv=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}},Mm=new uv,Vw=new uv,Uw=new uv,cj=new Array(230),dT;(e=>{function t(h){return Mm.keyCodeToStr(h)}e.toString=t;function s(h){return Mm.strToKeyCode(h)}e.fromString=s;function r(h){return Vw.keyCodeToStr(h)}e.toUserSettingsUS=r;function o(h){return Uw.keyCodeToStr(h)}e.toUserSettingsGeneral=o;function l(h){return Vw.strToKeyCode(h)||Uw.strToKeyCode(h)}e.fromUserSettings=l;function c(h){if(h>=98&&h<=113)return null;switch(h){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Mm.keyCodeToStr(h)}e.toElectronAccelerator=c})(dT||={});var uj=class fT{constructor(t,s,r,o,l){this.ctrlKey=t,this.shiftKey=s,this.altKey=r,this.metaKey=o,this.keyCode=l}equals(t){return t instanceof fT&&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",s=this.shiftKey?"1":"0",r=this.altKey?"1":"0",o=this.metaKey?"1":"0";return`K${t}${s}${r}${o}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new hj([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},hj=class{constructor(e){if(e.length===0)throw Pz("chords");this.chords=e}getHashCode(){let e="";for(let t=0,s=this.chords.length;t<s;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 dj(e){if(e.charCode){let s=String.fromCharCode(e.charCode).toUpperCase();return dT.fromString(s)}let t=e.keyCode;if(t===3)return 7;if(zp)switch(t){case 59:return 85;case 60:if(rj)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(gs)return 57;break}else if(ej&&(gs&&t===93||!gs&&t===92))return 57;return cj[t]||0}var fj=gs?256:2048,mj=512,pj=1024,gj=gs?2048:256,Fw=class{constructor(e){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=t.getModifierState?.("AltGraph"),this.keyCode=dj(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|=fj),this.altKey&&(t|=mj),this.shiftKey&&(t|=pj),this.metaKey&&(t|=gj),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new uj(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},Ww=new WeakMap;function vj(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,s=e.parent.location;if(t.origin!=="null"&&s.origin!=="null"&&t.origin!==s.origin)return null}catch{return null}return e.parent}var _j=class{static getSameOriginWindowChain(e){let t=Ww.get(e);if(!t){t=[],Ww.set(e,t);let s=e,r;do r=vj(s),r?t.push({window:new WeakRef(s),iframeElement:s.frameElement||null}):t.push({window:new WeakRef(s),iframeElement:null}),s=r;while(s)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let s=0,r=0,o=this.getSameOriginWindowChain(e);for(let l of o){let c=l.window.deref();if(s+=c?.scrollY??0,r+=c?.scrollX??0,c===t||!l.iframeElement)break;let h=l.iframeElement.getBoundingClientRect();s+=h.top,r+=h.left}return{top:s,left:r}}},uu=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 s=_j.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=s.left,this.posy-=s.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},Yw=class{constructor(e,t=0,s=0){this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=s,this.deltaX=t;let r=!1;if(cv){let o=navigator.userAgent.match(/Chrome\/(\d+)/);r=(o?parseInt(o[1]):123)<=122}if(e){let o=e,l=e,c=e.view?.devicePixelRatio||1;if(typeof o.wheelDeltaY<"u")r?this.deltaY=o.wheelDeltaY/(120*c):this.deltaY=o.wheelDeltaY/120;else if(typeof l.VERTICAL_AXIS<"u"&&l.axis===l.VERTICAL_AXIS)this.deltaY=-l.detail/3;else if(e.type==="wheel"){let h=e;h.deltaMode===h.DOM_DELTA_LINE?zp&&!gs?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof o.wheelDeltaX<"u")tj&&hT?this.deltaX=-(o.wheelDeltaX/120):r?this.deltaX=o.wheelDeltaX/(120*c):this.deltaX=o.wheelDeltaX/120;else if(typeof l.HORIZONTAL_AXIS<"u"&&l.axis===l.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let h=e;h.deltaMode===h.DOM_DELTA_LINE?zp&&!gs?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*c):this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}},mT=Object.freeze(function(e,t){let s=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(s)}}}),yj;(e=>{function t(s){return s===e.None||s===e.Cancelled||s instanceof bj?!0:!s||typeof s!="object"?!1:typeof s.isCancellationRequested=="boolean"&&typeof s.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Wt.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:mT})})(yj||={});var bj=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?mT:(this._emitter||(this._emitter=new pe),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},hv=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 Dp("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new Dp("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},Sj=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,s=globalThis){if(this.isDisposed)throw new Dp("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let r=s.setInterval(()=>{e()},t);this.disposable=rt(()=>{s.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},wj;(e=>{async function t(r){let o,l=await Promise.all(r.map(c=>c.then(h=>h,h=>{o||(o=h)})));if(typeof o<"u")throw o;return l}e.settled=t;function s(r){return new Promise(async(o,l)=>{try{await r(o,l)}catch(c){l(c)}})}e.withAsyncBody=s})(wj||={});var Kw=class Vi{static fromArray(t){return new Vi(s=>{s.emitMany(t)})}static fromPromise(t){return new Vi(async s=>{s.emitMany(await t)})}static fromPromises(t){return new Vi(async s=>{await Promise.all(t.map(async r=>s.emitOne(await r)))})}static merge(t){return new Vi(async s=>{await Promise.all(t.map(async r=>{for await(let o of r)s.emitOne(o)}))})}constructor(t,s){this._state=0,this._results=[],this._error=null,this._onReturn=s,this._onStateChanged=new pe,queueMicrotask(async()=>{let r={emitOne:o=>this.emitOne(o),emitMany:o=>this.emitMany(o),reject:o=>this.reject(o)};try{await Promise.resolve(t(r)),this.resolve()}catch(o){this.reject(o)}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 Wt.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,s){return new Vi(async r=>{for await(let o of t)r.emitOne(s(o))})}map(t){return Vi.map(this,t)}static filter(t,s){return new Vi(async r=>{for await(let o of t)s(o)&&r.emitOne(o)})}filter(t){return Vi.filter(this,t)}static coalesce(t){return Vi.filter(t,s=>!!s)}coalesce(){return Vi.coalesce(this)}static async toPromise(t){let s=[];for await(let r of t)s.push(r);return s}toPromise(){return Vi.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())}};Kw.EMPTY=Kw.fromArray([]);var{getWindow:fs,getWindowId:xj,onDidRegisterWindow:Cj}=(function(){let e=new Map,t={window:Us,disposables:new On};e.set(Us.vscodeWindowId,t);let s=new pe,r=new pe,o=new pe;function l(c,h){return(typeof c=="number"?e.get(c):void 0)??(h?t:void 0)}return{onDidRegisterWindow:s.event,onWillUnregisterWindow:o.event,onDidUnregisterWindow:r.event,registerWindow(c){if(e.has(c.vscodeWindowId))return Le.None;let h=new On,f={window:c,disposables:h.add(new On)};return e.set(c.vscodeWindowId,f),h.add(rt(()=>{e.delete(c.vscodeWindowId),r.fire(c)})),h.add(Te(c,Nt.BEFORE_UNLOAD,()=>{o.fire(c)})),s.fire(f),h},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(c){return c.vscodeWindowId},hasWindow(c){return e.has(c)},getWindowById:l,getWindow(c){let h=c;if(h?.ownerDocument?.defaultView)return h.ownerDocument.defaultView.window;let f=c;return f?.view?f.view.window:Us},getDocument(c){return fs(c).document}}})(),Ej=class{constructor(e,t,s,r){this._node=e,this._type=t,this._handler=s,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 Te(e,t,s,r){return new Ej(e,t,s,r)}var qw=function(e,t,s,r){return Te(e,t,s,r)},dv,Tj=class extends Sj{constructor(e){super(),this.defaultTarget=e&&fs(e)}cancelAndSet(e,t,s){return super.cancelAndSet(e,t,s??this.defaultTarget)}},Gw=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){Mu(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,s=new Map,r=new Map,o=l=>{s.set(l,!1);let c=e.get(l)??[];for(t.set(l,c),e.set(l,[]),r.set(l,!0);c.length>0;)c.sort(Gw.sort),c.shift().execute();r.set(l,!1)};dv=(l,c,h=0)=>{let f=xj(l),d=new Gw(c,h),p=e.get(f);return p||(p=[],e.set(f,p)),p.push(d),s.get(f)||(s.set(f,!0),l.requestAnimationFrame(()=>o(f))),d}})();function kj(e){let t=e.getBoundingClientRect(),s=fs(e);return{left:t.left+s.scrollX,top:t.top+s.scrollY,width:t.width,height:t.height}}var Nt={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"},Aj=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=hi(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=hi(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=hi(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=hi(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=hi(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=hi(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=hi(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=hi(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=hi(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=hi(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=hi(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=hi(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=hi(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=hi(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 hi(e){return typeof e=="number"?`${e}px`:e}function ol(e){return new Aj(e)}var pT=class{constructor(){this._hooks=new On,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 s=this._onStopCallback;this._onStopCallback=null,e&&s&&s(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,s,r,o){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=o;let l=e;try{e.setPointerCapture(t),this._hooks.add(rt(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{l=fs(e)}this._hooks.add(Te(l,Nt.POINTER_MOVE,c=>{if(c.buttons!==s){this.stopMonitoring(!0);return}c.preventDefault(),this._pointerMoveCallback(c)})),this._hooks.add(Te(l,Nt.POINTER_UP,c=>this.stopMonitoring(!0)))}};function Rj(e,t,s){let r=null,o=null;if(typeof s.value=="function"?(r="value",o=s.value,o.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof s.get=="function"&&(r="get",o=s.get),!o)throw new Error("not supported");let l=`$memoize$${t}`;s[r]=function(...c){return this.hasOwnProperty(l)||Object.defineProperty(this,l,{configurable:!1,enumerable:!1,writable:!1,value:o.apply(this,c)}),this[l]}}var cs;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(cs||={});var Xa=class Gt extends Le{constructor(){super(),this.dispatched=!1,this.targets=new jw,this.ignoreTargets=new jw,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Wt.runAndSubscribe(Cj,({window:t,disposables:s})=>{s.add(Te(t.document,"touchstart",r=>this.onTouchStart(r),{passive:!1})),s.add(Te(t.document,"touchend",r=>this.onTouchEnd(t,r))),s.add(Te(t.document,"touchmove",r=>this.onTouchMove(r),{passive:!1}))},{window:Us,disposables:this._store}))}static addTarget(t){if(!Gt.isTouchDevice())return Le.None;Gt.INSTANCE||(Gt.INSTANCE=new Gt);let s=Gt.INSTANCE.targets.push(t);return rt(s)}static ignoreTarget(t){if(!Gt.isTouchDevice())return Le.None;Gt.INSTANCE||(Gt.INSTANCE=new Gt);let s=Gt.INSTANCE.ignoreTargets.push(t);return rt(s)}static isTouchDevice(){return"ontouchstart"in Us||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let s=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let r=0,o=t.targetTouches.length;r<o;r++){let l=t.targetTouches.item(r);this.activeTouches[l.identifier]={id:l.identifier,initialTarget:l.target,initialTimeStamp:s,initialPageX:l.pageX,initialPageY:l.pageY,rollingTimestamps:[s],rollingPageX:[l.pageX],rollingPageY:[l.pageY]};let c=this.newGestureEvent(cs.Start,l.target);c.pageX=l.pageX,c.pageY=l.pageY,this.dispatchEvent(c)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,s){let r=Date.now(),o=Object.keys(this.activeTouches).length;for(let l=0,c=s.changedTouches.length;l<c;l++){let h=s.changedTouches.item(l);if(!this.activeTouches.hasOwnProperty(String(h.identifier))){console.warn("move of an UNKNOWN touch",h);continue}let f=this.activeTouches[h.identifier],d=Date.now()-f.initialTimeStamp;if(d<Gt.HOLD_DELAY&&Math.abs(f.initialPageX-wi(f.rollingPageX))<30&&Math.abs(f.initialPageY-wi(f.rollingPageY))<30){let p=this.newGestureEvent(cs.Tap,f.initialTarget);p.pageX=wi(f.rollingPageX),p.pageY=wi(f.rollingPageY),this.dispatchEvent(p)}else if(d>=Gt.HOLD_DELAY&&Math.abs(f.initialPageX-wi(f.rollingPageX))<30&&Math.abs(f.initialPageY-wi(f.rollingPageY))<30){let p=this.newGestureEvent(cs.Contextmenu,f.initialTarget);p.pageX=wi(f.rollingPageX),p.pageY=wi(f.rollingPageY),this.dispatchEvent(p)}else if(o===1){let p=wi(f.rollingPageX),v=wi(f.rollingPageY),_=wi(f.rollingTimestamps)-f.rollingTimestamps[0],y=p-f.rollingPageX[0],b=v-f.rollingPageY[0],S=[...this.targets].filter(E=>f.initialTarget instanceof Node&&E.contains(f.initialTarget));this.inertia(t,S,r,Math.abs(y)/_,y>0?1:-1,p,Math.abs(b)/_,b>0?1:-1,v)}this.dispatchEvent(this.newGestureEvent(cs.End,f.initialTarget)),delete this.activeTouches[h.identifier]}this.dispatched&&(s.preventDefault(),s.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,s){let r=document.createEvent("CustomEvent");return r.initEvent(t,!1,!0),r.initialTarget=s,r.tapCount=0,r}dispatchEvent(t){if(t.type===cs.Tap){let s=new Date().getTime(),r=0;s-this._lastSetTapCountTime>Gt.CLEAR_TAP_COUNT_TIME?r=1:r=2,this._lastSetTapCountTime=s,t.tapCount=r}else(t.type===cs.Change||t.type===cs.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let r of this.ignoreTargets)if(r.contains(t.initialTarget))return;let s=[];for(let r of this.targets)if(r.contains(t.initialTarget)){let o=0,l=t.initialTarget;for(;l&&l!==r;)o++,l=l.parentElement;s.push([o,r])}s.sort((r,o)=>r[0]-o[0]);for(let[r,o]of s)o.dispatchEvent(t),this.dispatched=!0}}inertia(t,s,r,o,l,c,h,f,d){this.handle=dv(t,()=>{let p=Date.now(),v=p-r,_=0,y=0,b=!0;o+=Gt.SCROLL_FRICTION*v,h+=Gt.SCROLL_FRICTION*v,o>0&&(b=!1,_=l*o*v),h>0&&(b=!1,y=f*h*v);let S=this.newGestureEvent(cs.Change);S.translationX=_,S.translationY=y,s.forEach(E=>E.dispatchEvent(S)),b||this.inertia(t,s,p,o,l,c+_,h,f,d+y)})}onTouchMove(t){let s=Date.now();for(let r=0,o=t.changedTouches.length;r<o;r++){let l=t.changedTouches.item(r);if(!this.activeTouches.hasOwnProperty(String(l.identifier))){console.warn("end of an UNKNOWN touch",l);continue}let c=this.activeTouches[l.identifier],h=this.newGestureEvent(cs.Change,c.initialTarget);h.translationX=l.pageX-wi(c.rollingPageX),h.translationY=l.pageY-wi(c.rollingPageY),h.pageX=l.pageX,h.pageY=l.pageY,this.dispatchEvent(h),c.rollingPageX.length>3&&(c.rollingPageX.shift(),c.rollingPageY.shift(),c.rollingTimestamps.shift()),c.rollingPageX.push(l.pageX),c.rollingPageY.push(l.pageY),c.rollingTimestamps.push(s)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};Xa.SCROLL_FRICTION=-.005,Xa.HOLD_DELAY=700,Xa.CLEAR_TAP_COUNT_TIME=400,ft([Rj],Xa,"isTouchDevice",1);var Mj=Xa,fv=class extends Le{onclick(e,t){this._register(Te(e,Nt.CLICK,s=>t(new uu(fs(e),s))))}onmousedown(e,t){this._register(Te(e,Nt.MOUSE_DOWN,s=>t(new uu(fs(e),s))))}onmouseover(e,t){this._register(Te(e,Nt.MOUSE_OVER,s=>t(new uu(fs(e),s))))}onmouseleave(e,t){this._register(Te(e,Nt.MOUSE_LEAVE,s=>t(new uu(fs(e),s))))}onkeydown(e,t){this._register(Te(e,Nt.KEY_DOWN,s=>t(new Fw(s))))}onkeyup(e,t){this._register(Te(e,Nt.KEY_UP,s=>t(new Fw(s))))}oninput(e,t){this._register(Te(e,Nt.INPUT,t))}onblur(e,t){this._register(Te(e,Nt.BLUR,t))}onfocus(e,t){this._register(Te(e,Nt.FOCUS,t))}onchange(e,t){this._register(Te(e,Nt.CHANGE,t))}ignoreGesture(e){return Mj.ignoreTarget(e)}},$w=11,Dj=class extends fv{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=$w+"px",this.domNode.style.height=$w+"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 pT),this._register(qw(this.bgDomNode,Nt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(qw(this.domNode,Nt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new Tj),this._pointerdownScheduleRepeatTimer=this._register(new hv)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,fs(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,s=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},Oj=class Ip{constructor(t,s,r,o,l,c,h){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(s=s|0,r=r|0,o=o|0,l=l|0,c=c|0,h=h|0),this.rawScrollLeft=o,this.rawScrollTop=h,s<0&&(s=0),o+s>r&&(o=r-s),o<0&&(o=0),l<0&&(l=0),h+l>c&&(h=c-l),h<0&&(h=0),this.width=s,this.scrollWidth=r,this.scrollLeft=o,this.height=l,this.scrollHeight=c,this.scrollTop=h}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,s){return new Ip(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,s?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,s?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new Ip(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,s){let r=this.width!==t.width,o=this.scrollWidth!==t.scrollWidth,l=this.scrollLeft!==t.scrollLeft,c=this.height!==t.height,h=this.scrollHeight!==t.scrollHeight,f=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:s,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:o,scrollLeftChanged:l,heightChanged:c,scrollHeightChanged:h,scrollTopChanged:f}}},Nj=class extends Le{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new pe),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new Oj(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){let s=this._state.withScrollDimensions(e,t);this._setState(s,!!this._smoothScrolling),this._smoothScrolling?.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 s=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===s.scrollLeft&&this._smoothScrolling.to.scrollTop===s.scrollTop)return;let r;t?r=new Zw(this._smoothScrolling.from,s,this._smoothScrolling.startTime,this._smoothScrolling.duration):r=this._smoothScrolling.combine(this._state,s,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=r}else{let s=this._state.withScrollPosition(e);this._smoothScrolling=Zw.start(this._state,s,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 s=this._state;s.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(s,t)))}},Xw=class{constructor(e,t,s){this.scrollLeft=e,this.scrollTop=t,this.isDone=s}};function Dm(e,t){let s=t-e;return function(r){return e+s*Pj(r)}}function Lj(e,t,s){return function(r){return r<s?e(r/s):t((r-s)/(1-s))}}var Zw=class Vp{constructor(t,s,r,o){this.from=t,this.to=s,this.duration=o,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,s,r){if(Math.abs(t-s)>2.5*r){let o,l;return t<s?(o=t+.75*r,l=s-.75*r):(o=t-.75*r,l=s+.75*r),Lj(Dm(t,o),Dm(l,s),.33)}return Dm(t,s)}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 s=(t-this.startTime)/this.duration;if(s<1){let r=this.scrollLeft(s),o=this.scrollTop(s);return new Xw(r,o,!1)}return new Xw(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,s,r){return Vp.start(t,s,r)}static start(t,s,r){r=r+10;let o=Date.now()-10;return new Vp(t,s,o,r)}};function Bj(e){return Math.pow(e,3)}function Pj(e){return 1-Bj(1-e)}var zj=class extends Le{constructor(e,t,s){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=s,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new hv)}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(()=>{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?" fade":"")))}},jj=140,gT=class extends fv{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 zj(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new pT),this._shouldRender=!0,this.domNode=ol(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(Te(this.domNode.domNode,Nt.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new Dj(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,s,r){this.slider=ol(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof s=="number"&&this.slider.setWidth(s),typeof r=="number"&&this.slider.setHeight(r),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Te(this.slider.domNode,Nt.POINTER_DOWN,o=>{o.button===0&&(o.preventDefault(),this._sliderPointerDown(o))})),this.onclick(this.slider.domNode,o=>{o.leftButton&&o.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,s=t+this._scrollbarState.getSliderPosition(),r=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderPointerPosition(e);s<=o&&o<=r?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,s;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,s=e.offsetY;else{let o=kj(this.domNode.domNode);t=e.pageX-o.left,s=e.pageY-o.top}let r=this._pointerDownRelativePosition(t,s);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),s=this._sliderOrthogonalPointerPosition(e),r=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>{let l=this._sliderOrthogonalPointerPosition(o),c=Math.abs(l-s);if(hT&&c>jj){this._setDesiredScrollPositionNow(r.getScrollPosition());return}let h=this._sliderPointerPosition(o)-t;this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(h))},()=>{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()}},vT=class Up{constructor(t,s,r,o,l,c){this._scrollbarSize=Math.round(s),this._oppositeScrollbarSize=Math.round(r),this._arrowSize=Math.round(t),this._visibleSize=o,this._scrollSize=l,this._scrollPosition=c,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new Up(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let s=Math.round(t);return this._visibleSize!==s?(this._visibleSize=s,this._refreshComputedValues(),!0):!1}setScrollSize(t){let s=Math.round(t);return this._scrollSize!==s?(this._scrollSize=s,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let s=Math.round(t);return this._scrollPosition!==s?(this._scrollPosition=s,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,s,r,o,l){let c=Math.max(0,r-t),h=Math.max(0,c-2*s),f=o>0&&o>r;if(!f)return{computedAvailableSize:Math.round(c),computedIsNeeded:f,computedSliderSize:Math.round(h),computedSliderRatio:0,computedSliderPosition:0};let d=Math.round(Math.max(20,Math.floor(r*h/o))),p=(h-d)/(o-r),v=l*p;return{computedAvailableSize:Math.round(c),computedIsNeeded:f,computedSliderSize:Math.round(d),computedSliderRatio:p,computedSliderPosition:Math.round(v)}}_refreshComputedValues(){let t=Up._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 s=t-this._arrowSize-this._computedSliderSize/2;return Math.round(s/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let s=t-this._arrowSize,r=this._scrollPosition;return s<this._computedSliderPosition?r-=this._visibleSize:r+=this._visibleSize,r}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let s=this._computedSliderPosition+t;return Math.round(s/this._computedSliderRatio)}},Hj=class extends gT{constructor(e,t,s){let r=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:s,scrollbarState:new vT(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,r.width,r.scrollWidth,o.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}},Ij=class extends gT{constructor(e,t,s){let r=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:s,scrollbarState:new vT(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,r.height,r.scrollHeight,o.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}},Vj=500,Qw=50,Uj=class{constructor(e,t,s){this.timestamp=e,this.deltaX=t,this.deltaY=s,this.score=0}},Fp=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,s=0,r=1,o=this._rear;do{let l=o===this._front?t:Math.pow(2,-r);if(t-=l,s+=this._memory[o].score*l,o===this._front)break;o=(this._capacity+o-1)%this._capacity,r++}while(!0);return s<=.5}acceptStandardWheelEvent(t){if(cv){let s=fs(t.browserEvent),r=Jz(s);this.accept(Date.now(),t.deltaX*r,t.deltaY*r)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,s,r){let o=null,l=new Uj(t,s,r);this._front===-1&&this._rear===-1?(this._memory[0]=l,this._front=0,this._rear=0):(o=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,o)}_computeScore(t,s){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),s){let o=Math.abs(t.deltaX),l=Math.abs(t.deltaY),c=Math.abs(s.deltaX),h=Math.abs(s.deltaY),f=Math.max(Math.min(o,c),1),d=Math.max(Math.min(l,h),1),p=Math.max(o,c),v=Math.max(l,h);p%f===0&&v%d===0&&(r-=.5)}return Math.min(Math.max(r,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};Fp.INSTANCE=new Fp;var Fj=Fp,Wj=class extends fv{constructor(e,t,s){super(),this._onScroll=this._register(new pe),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new pe),this.onWillScroll=this._onWillScroll.event,this._options=Kj(t),this._scrollable=s,this._register(this._scrollable.onScroll(o=>{this._onWillScroll.fire(o),this._onDidScroll(o),this._onScroll.fire(o)}));let r={onMouseWheel:o=>this._onMouseWheel(o),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new Ij(this._scrollable,this._options,r)),this._horizontalScrollbar=this._register(new Hj(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=ol(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=ol(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=ol(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,o=>this._onMouseOver(o)),this.onmouseleave(this._listenOnDomNode,o=>this._onMouseLeave(o)),this._hideTimeout=this._register(new hv),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=xr(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,gs&&(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 Yw(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=xr(this._mouseWheelToDispose),e)){let t=s=>{this._onMouseWheel(new Yw(s))};this._mouseWheelToDispose.push(Te(this._listenOnDomNode,Nt.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=Fj.INSTANCE;t.acceptStandardWheelEvent(e);let s=!1;if(e.deltaY||e.deltaX){let o=e.deltaY*this._options.mouseWheelScrollSensitivity,l=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&l+o===0?l=o=0:Math.abs(o)>=Math.abs(l)?l=0:o=0),this._options.flipAxes&&([o,l]=[l,o]);let c=!gs&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||c)&&!l&&(l=o,o=0),e.browserEvent&&e.browserEvent.altKey&&(l=l*this._options.fastScrollSensitivity,o=o*this._options.fastScrollSensitivity);let h=this._scrollable.getFutureScrollPosition(),f={};if(o){let d=Qw*o,p=h.scrollTop-(d<0?Math.floor(d):Math.ceil(d));this._verticalScrollbar.writeScrollPosition(f,p)}if(l){let d=Qw*l,p=h.scrollLeft-(d<0?Math.floor(d):Math.ceil(d));this._horizontalScrollbar.writeScrollPosition(f,p)}f=this._scrollable.validateScrollPosition(f),(h.scrollLeft!==f.scrollLeft||h.scrollTop!==f.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(f):this._scrollable.setScrollPositionNow(f),s=!0)}let r=s;!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,s=e.scrollLeft>0,r=s?" left":"",o=t?" top":"",l=s||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${r}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${l}${o}${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(),Vj)}},Yj=class extends Wj{constructor(e,t,s){super(e,t,s)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function Kj(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,gs&&(t.className+=" mac"),t}var Wp=class extends Le{constructor(e,t,s,r,o,l,c,h){super(),this._bufferService=s,this._optionsService=c,this._renderService=h,this._onRequestScrollLines=this._register(new pe),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let f=this._register(new Nj({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:d=>dv(r.window,d)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{f.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new Yj(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},f)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(o.onProtocolChange(d=>{this._scrollableElement.updateOptions({handleMouseWheel:!(d&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(Wt.runAndSubscribe(l.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=l.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(rt(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=r.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(rt(()=>this._styleElement.remove())),this._register(Wt.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(`
|
|
67
|
+
`)})),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(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.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),s=t-this._bufferService.buffer.ydisp;s!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(s)),this._isHandlingScroll=!1}};Wp=ft([ge(2,ii),ge(3,qs),ge(4,Z2),ge(5,Uo),ge(6,si),ge(7,Gs)],Wp);var Yp=class extends Le{constructor(e,t,s,r,o){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=s,this._decorationService=r,this._renderService=o,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(rt(()=>{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){let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",e?.options?.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 s=e.options.x??0;return s&&s>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 s=this._decorationElements.get(e);s||(s=this._createElement(e),e.element=s,this._decorationElements.set(e,s),this._container.appendChild(s),e.onDispose(()=>{this._decorationElements.delete(e),s.remove()})),s.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(s.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,s.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,s.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,s.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(s)}}_refreshXPosition(e,t=e.element){if(!t)return;let s=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=s?`${s*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=s?`${s*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};Yp=ft([ge(1,ii),ge(2,qs),ge(3,Al),ge(4,Gs)],Yp);var qj=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,s){return t>=e.startBufferLine-this._linePadding[s||"full"]&&t<=e.endBufferLine+this._linePadding[s||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},as={full:0,left:0,center:0,right:0},Cn={full:0,left:0,center:0,right:0},Va={full:0,left:0,center:0,right:0},th=class extends Le{constructor(e,t,s,r,o,l,c,h){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=s,this._decorationService=r,this._renderService=o,this._optionsService=l,this._themeService=c,this._coreBrowserService=h,this._colorZoneStore=new qj,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(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement),this._register(rt(()=>this._canvas?.remove()));let f=this._canvas.getContext("2d");if(f)this._ctx=f;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(){return this._optionsService.options.overviewRuler?.width||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);Cn.full=this._canvas.width,Cn.left=e,Cn.center=t,Cn.right=e,this._refreshDrawHeightConstants(),Va.full=1,Va.left=1,Va.center=1+Cn.left,Va.right=1+Cn.left+Cn.center}_refreshDrawHeightConstants(){as.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);as.left=t,as.center=t,as.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*as.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*as.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*as.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*as.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(Va[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-as[e.position||"full"]/2),Cn[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+as[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}))}};th=ft([ge(2,ii),ge(3,Al),ge(4,Gs),ge(5,si),ge(6,Uo),ge(7,qs)],th);var fe;(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=`
|
|
68
|
+
`,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=""))(fe||={});var Nu;(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=""))(Nu||={});var _T;(e=>e.ST=`${fe.ESC}\\`)(_T||={});var Kp=class{constructor(e,t,s,r,o,l){this._textarea=e,this._compositionView=t,this._bufferService=s,this._optionsService=r,this._coreService=o,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 s;t.start+=this._dataAlreadySent.length,this._isComposing?s=this._textarea.value.substring(t.start,this._compositionPosition.start):s=this._textarea.value.substring(t.start),s.length>0&&this._coreService.triggerDataEvent(s,!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,s=t.replace(e,"");this._dataAlreadySent=s,t.length>e.length?this._coreService.triggerDataEvent(s,!0):t.length<e.length?this._coreService.triggerDataEvent(`${fe.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),s=this._renderService.dimensions.css.cell.height,r=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,o=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=o+"px",this._compositionView.style.top=r+"px",this._compositionView.style.height=s+"px",this._compositionView.style.lineHeight=s+"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=o+"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)}}};Kp=ft([ge(2,ii),ge(3,si),ge(4,kr),ge(5,Gs)],Kp);var Lt=0,Bt=0,Pt=0,dt=0,Jw={css:"#00000000",rgba:0},xt;(e=>{function t(o,l,c,h){return h!==void 0?`#${ur(o)}${ur(l)}${ur(c)}${ur(h)}`:`#${ur(o)}${ur(l)}${ur(c)}`}e.toCss=t;function s(o,l,c,h=255){return(o<<24|l<<16|c<<8|h)>>>0}e.toRgba=s;function r(o,l,c,h){return{css:e.toCss(o,l,c,h),rgba:e.toRgba(o,l,c,h)}}e.toColor=r})(xt||={});var st;(e=>{function t(f,d){if(dt=(d.rgba&255)/255,dt===1)return{css:d.css,rgba:d.rgba};let p=d.rgba>>24&255,v=d.rgba>>16&255,_=d.rgba>>8&255,y=f.rgba>>24&255,b=f.rgba>>16&255,S=f.rgba>>8&255;Lt=y+Math.round((p-y)*dt),Bt=b+Math.round((v-b)*dt),Pt=S+Math.round((_-S)*dt);let E=xt.toCss(Lt,Bt,Pt),A=xt.toRgba(Lt,Bt,Pt);return{css:E,rgba:A}}e.blend=t;function s(f){return(f.rgba&255)===255}e.isOpaque=s;function r(f,d,p){let v=Lu.ensureContrastRatio(f.rgba,d.rgba,p);if(v)return xt.toColor(v>>24&255,v>>16&255,v>>8&255)}e.ensureContrastRatio=r;function o(f){let d=(f.rgba|255)>>>0;return[Lt,Bt,Pt]=Lu.toChannels(d),{css:xt.toCss(Lt,Bt,Pt),rgba:d}}e.opaque=o;function l(f,d){return dt=Math.round(d*255),[Lt,Bt,Pt]=Lu.toChannels(f.rgba),{css:xt.toCss(Lt,Bt,Pt,dt),rgba:xt.toRgba(Lt,Bt,Pt,dt)}}e.opacity=l;function c(f,d){return dt=f.rgba&255,l(f,dt*d/255)}e.multiplyOpacity=c;function h(f){return[f.rgba>>24&255,f.rgba>>16&255,f.rgba>>8&255]}e.toColorRGB=h})(st||={});var at;(e=>{let t,s;try{let o=document.createElement("canvas");o.width=1,o.height=1;let l=o.getContext("2d",{willReadFrequently:!0});l&&(t=l,t.globalCompositeOperation="copy",s=t.createLinearGradient(0,0,1,1))}catch{}function r(o){if(o.match(/#[\da-f]{3,8}/i))switch(o.length){case 4:return Lt=parseInt(o.slice(1,2).repeat(2),16),Bt=parseInt(o.slice(2,3).repeat(2),16),Pt=parseInt(o.slice(3,4).repeat(2),16),xt.toColor(Lt,Bt,Pt);case 5:return Lt=parseInt(o.slice(1,2).repeat(2),16),Bt=parseInt(o.slice(2,3).repeat(2),16),Pt=parseInt(o.slice(3,4).repeat(2),16),dt=parseInt(o.slice(4,5).repeat(2),16),xt.toColor(Lt,Bt,Pt,dt);case 7:return{css:o,rgba:(parseInt(o.slice(1),16)<<8|255)>>>0};case 9:return{css:o,rgba:parseInt(o.slice(1),16)>>>0}}let l=o.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 Lt=parseInt(l[1]),Bt=parseInt(l[2]),Pt=parseInt(l[3]),dt=Math.round((l[5]===void 0?1:parseFloat(l[5]))*255),xt.toColor(Lt,Bt,Pt,dt);if(!t||!s)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=s,t.fillStyle=o,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[Lt,Bt,Pt,dt]=t.getImageData(0,0,1,1).data,dt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:xt.toRgba(Lt,Bt,Pt,dt),css:o}}e.toColor=r})(at||={});var Qt;(e=>{function t(r){return s(r>>16&255,r>>8&255,r&255)}e.relativeLuminance=t;function s(r,o,l){let c=r/255,h=o/255,f=l/255,d=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4),p=h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4),v=f<=.03928?f/12.92:Math.pow((f+.055)/1.055,2.4);return d*.2126+p*.7152+v*.0722}e.relativeLuminance2=s})(Qt||={});var Lu;(e=>{function t(c,h){if(dt=(h&255)/255,dt===1)return h;let f=h>>24&255,d=h>>16&255,p=h>>8&255,v=c>>24&255,_=c>>16&255,y=c>>8&255;return Lt=v+Math.round((f-v)*dt),Bt=_+Math.round((d-_)*dt),Pt=y+Math.round((p-y)*dt),xt.toRgba(Lt,Bt,Pt)}e.blend=t;function s(c,h,f){let d=Qt.relativeLuminance(c>>8),p=Qt.relativeLuminance(h>>8);if(Is(d,p)<f){if(p<d){let y=r(c,h,f),b=Is(d,Qt.relativeLuminance(y>>8));if(b<f){let S=o(c,h,f),E=Is(d,Qt.relativeLuminance(S>>8));return b>E?y:S}return y}let v=o(c,h,f),_=Is(d,Qt.relativeLuminance(v>>8));if(_<f){let y=r(c,h,f),b=Is(d,Qt.relativeLuminance(y>>8));return _>b?v:y}return v}}e.ensureContrastRatio=s;function r(c,h,f){let d=c>>24&255,p=c>>16&255,v=c>>8&255,_=h>>24&255,y=h>>16&255,b=h>>8&255,S=Is(Qt.relativeLuminance2(_,y,b),Qt.relativeLuminance2(d,p,v));for(;S<f&&(_>0||y>0||b>0);)_-=Math.max(0,Math.ceil(_*.1)),y-=Math.max(0,Math.ceil(y*.1)),b-=Math.max(0,Math.ceil(b*.1)),S=Is(Qt.relativeLuminance2(_,y,b),Qt.relativeLuminance2(d,p,v));return(_<<24|y<<16|b<<8|255)>>>0}e.reduceLuminance=r;function o(c,h,f){let d=c>>24&255,p=c>>16&255,v=c>>8&255,_=h>>24&255,y=h>>16&255,b=h>>8&255,S=Is(Qt.relativeLuminance2(_,y,b),Qt.relativeLuminance2(d,p,v));for(;S<f&&(_<255||y<255||b<255);)_=Math.min(255,_+Math.ceil((255-_)*.1)),y=Math.min(255,y+Math.ceil((255-y)*.1)),b=Math.min(255,b+Math.ceil((255-b)*.1)),S=Is(Qt.relativeLuminance2(_,y,b),Qt.relativeLuminance2(d,p,v));return(_<<24|y<<16|b<<8|255)>>>0}e.increaseLuminance=o;function l(c){return[c>>24&255,c>>16&255,c>>8&255,c&255]}e.toChannels=l})(Lu||={});function ur(e){let t=e.toString(16);return t.length<2?"0"+t:t}function Is(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var Gj=class extends kl{constructor(e,t,s){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=s}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()]}},ih=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new Yi}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 s=[],r=t.translateToString(!0),o=0,l=0,c=0,h=t.getFg(0),f=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!==h||this._workCell.bg!==f){if(d-o>1){let p=this._getJoinedRanges(r,c,l,t,o);for(let v=0;v<p.length;v++)s.push(p[v])}o=d,c=l,h=this._workCell.fg,f=this._workCell.bg}l+=this._workCell.getChars().length||Dn.length}if(this._bufferService.cols-o>1){let d=this._getJoinedRanges(r,c,l,t,o);for(let p=0;p<d.length;p++)s.push(d[p])}return s}_getJoinedRanges(e,t,s,r,o){let l=e.substring(t,s),c=[];try{c=this._characterJoiners[0].handler(l)}catch(h){console.error(h)}for(let h=1;h<this._characterJoiners.length;h++)try{let f=this._characterJoiners[h].handler(l);for(let d=0;d<f.length;d++)ih._mergeRanges(c,f[d])}catch(f){console.error(f)}return this._stringRangesToCellRanges(c,r,o),c}_stringRangesToCellRanges(e,t,s){let r=0,o=!1,l=0,c=e[r];if(c){for(let h=s;h<this._bufferService.cols;h++){let f=t.getWidth(h),d=t.getString(h).length||Dn.length;if(f!==0){if(!o&&c[0]<=l&&(c[0]=h,o=!0),c[1]<=l){if(c[1]=h,c=e[++r],!c)break;c[0]<=l?(c[0]=h,o=!0):o=!1}l+=d}}c&&(c[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let s=!1;for(let r=0;r<e.length;r++){let o=e[r];if(s){if(t[1]<=o[0])return e[r-1][1]=t[1],e;if(t[1]<=o[1])return e[r-1][1]=Math.max(t[1],o[1]),e.splice(r,1),e;e.splice(r,1),r--}else{if(t[1]<=o[0])return e.splice(r,0,t),e;if(t[1]<=o[1])return o[0]=Math.min(t[0],o[0]),e;t[0]<o[1]&&(o[0]=Math.min(t[0],o[0]),s=!0);continue}}return s?e[e.length-1][1]=t[1]:e.push(t),e}};ih=ft([ge(0,ii)],ih);function $j(e){return 57508<=e&&e<=57558}function Xj(e){return 9472<=e&&e<=9631}function Zj(e){return $j(e)||Xj(e)}function Qj(){return{css:{canvas:hu(),cell:hu()},device:{canvas:hu(),cell:hu(),char:{width:0,height:0,left:0,top:0}}}}function hu(){return{width:0,height:0}}var qp=class{constructor(e,t,s,r,o,l,c){this._document=e,this._characterJoinerService=t,this._optionsService=s,this._coreBrowserService=r,this._coreService=o,this._decorationService=l,this._themeService=c,this._workCell=new Yi,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,s){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=s}createRow(e,t,s,r,o,l,c,h,f,d,p){let v=[],_=this._characterJoinerService.getJoinedCharacters(t),y=this._themeService.colors,b=e.getNoBgTrimmedLength();s&&b<l+1&&(b=l+1);let S,E=0,A="",R=0,M=0,k=0,j=0,F=!1,W=0,V=!1,ee=0,U=0,G=[],z=d!==-1&&p!==-1;for(let L=0;L<b;L++){e.loadCell(L,this._workCell);let P=this._workCell.getWidth();if(P===0)continue;let q=!1,T=L>=U,H=L,B=this._workCell;if(_.length>0&&L===_[0][0]&&T){let xe=_.shift(),ke=this._isCellInSelection(xe[0],t);for(R=xe[0]+1;R<xe[1];R++)T&&=ke===this._isCellInSelection(R,t);T&&=!s||l<xe[0]||l>=xe[1],T?(q=!0,B=new Gj(this._workCell,e.translateToString(!0,xe[0],xe[1]),xe[1]-xe[0]),H=xe[1]-1,P=B.getWidth()):U=xe[1]}let te=this._isCellInSelection(L,t),X=s&&L===l,N=z&&L>=d&&L<=p,Z=!1;this._decorationService.forEachDecorationAtCell(L,t,void 0,xe=>{Z=!0});let ne=B.getChars()||Dn;if(ne===" "&&(B.isUnderline()||B.isOverline())&&(ne=" "),ee=P*h-f.get(ne,B.isBold(),B.isItalic()),!S)S=this._document.createElement("span");else if(E&&(te&&V||!te&&!V&&B.bg===M)&&(te&&V&&y.selectionForeground||B.fg===k)&&B.extended.ext===j&&N===F&&ee===W&&!X&&!q&&!Z&&T){B.isInvisible()?A+=Dn:A+=ne,E++;continue}else E&&(S.textContent=A),S=this._document.createElement("span"),E=0,A="";if(M=B.bg,k=B.fg,j=B.extended.ext,F=N,W=ee,V=te,q&&l>=L&&l<=H&&(l=L),!this._coreService.isCursorHidden&&X&&this._coreService.isCursorInitialized){if(G.push("xterm-cursor"),this._coreBrowserService.isFocused)c&&G.push("xterm-cursor-blink"),G.push(r==="bar"?"xterm-cursor-bar":r==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(o)switch(o){case"outline":G.push("xterm-cursor-outline");break;case"block":G.push("xterm-cursor-block");break;case"bar":G.push("xterm-cursor-bar");break;case"underline":G.push("xterm-cursor-underline");break}}if(B.isBold()&&G.push("xterm-bold"),B.isItalic()&&G.push("xterm-italic"),B.isDim()&&G.push("xterm-dim"),B.isInvisible()?A=Dn:A=B.getChars()||Dn,B.isUnderline()&&(G.push(`xterm-underline-${B.extended.underlineStyle}`),A===" "&&(A=" "),!B.isUnderlineColorDefault()))if(B.isUnderlineColorRGB())S.style.textDecorationColor=`rgb(${kl.toColorRGB(B.getUnderlineColor()).join(",")})`;else{let xe=B.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&B.isBold()&&xe<8&&(xe+=8),S.style.textDecorationColor=y.ansi[xe].css}B.isOverline()&&(G.push("xterm-overline"),A===" "&&(A=" ")),B.isStrikethrough()&&G.push("xterm-strikethrough"),N&&(S.style.textDecoration="underline");let I=B.getFgColor(),O=B.getFgColorMode(),Y=B.getBgColor(),K=B.getBgColorMode(),J=!!B.isInverse();if(J){let xe=I;I=Y,Y=xe;let ke=O;O=K,K=ke}let ie,ue,me=!1;this._decorationService.forEachDecorationAtCell(L,t,void 0,xe=>{xe.options.layer!=="top"&&me||(xe.backgroundColorRGB&&(K=50331648,Y=xe.backgroundColorRGB.rgba>>8&16777215,ie=xe.backgroundColorRGB),xe.foregroundColorRGB&&(O=50331648,I=xe.foregroundColorRGB.rgba>>8&16777215,ue=xe.foregroundColorRGB),me=xe.options.layer==="top")}),!me&&te&&(ie=this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque,Y=ie.rgba>>8&16777215,K=50331648,me=!0,y.selectionForeground&&(O=50331648,I=y.selectionForeground.rgba>>8&16777215,ue=y.selectionForeground)),me&&G.push("xterm-decoration-top");let _e;switch(K){case 16777216:case 33554432:_e=y.ansi[Y],G.push(`xterm-bg-${Y}`);break;case 50331648:_e=xt.toColor(Y>>16,Y>>8&255,Y&255),this._addStyle(S,`background-color:#${ex((Y>>>0).toString(16),"0",6)}`);break;default:J?(_e=y.foreground,G.push("xterm-bg-257")):_e=y.background}switch(ie||B.isDim()&&(ie=st.multiplyOpacity(_e,.5)),O){case 16777216:case 33554432:B.isBold()&&I<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(I+=8),this._applyMinimumContrast(S,_e,y.ansi[I],B,ie,void 0)||G.push(`xterm-fg-${I}`);break;case 50331648:let xe=xt.toColor(I>>16&255,I>>8&255,I&255);this._applyMinimumContrast(S,_e,xe,B,ie,ue)||this._addStyle(S,`color:#${ex(I.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(S,_e,y.foreground,B,ie,ue)||J&&G.push("xterm-fg-257")}G.length&&(S.className=G.join(" "),G.length=0),!X&&!q&&!Z&&T?E++:S.textContent=A,ee!==this.defaultSpacing&&(S.style.letterSpacing=`${ee}px`),v.push(S),L=H}return S&&E&&(S.textContent=A),v}_applyMinimumContrast(e,t,s,r,o,l){if(this._optionsService.rawOptions.minimumContrastRatio===1||Zj(r.getCode()))return!1;let c=this._getContrastCache(r),h;if(!o&&!l&&(h=c.getColor(t.rgba,s.rgba)),h===void 0){let f=this._optionsService.rawOptions.minimumContrastRatio/(r.isDim()?2:1);h=st.ensureContrastRatio(o||t,l||s,f),c.setColor((o||t).rgba,(l||s).rgba,h??null)}return h?(this._addStyle(e,`color:${h.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 s=this._selectionStart,r=this._selectionEnd;return!s||!r?!1:this._columnSelectMode?s[0]<=r[0]?e>=s[0]&&t>=s[1]&&e<r[0]&&t<=r[1]:e<s[0]&&t>=s[1]&&e>=r[0]&&t<=r[1]:t>s[1]&&t<r[1]||s[1]===r[1]&&t===s[1]&&e>=s[0]&&e<r[0]||s[1]<r[1]&&t===r[1]&&e<r[0]||s[1]<r[1]&&t===s[1]&&e>=s[0]}};qp=ft([ge(1,eT),ge(2,si),ge(3,qs),ge(4,kr),ge(5,Al),ge(6,Uo)],qp);function ex(e,t,s){for(;e.length<s;)e=t+e;return e}var Jj=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 s=e.createElement("span");s.classList.add("xterm-char-measure-element");let r=e.createElement("span");r.classList.add("xterm-char-measure-element"),r.style.fontWeight="bold";let o=e.createElement("span");o.classList.add("xterm-char-measure-element"),o.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=[s,r,o,l],this._container.appendChild(s),this._container.appendChild(r),this._container.appendChild(o),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,s,r){e===this._font&&t===this._fontSize&&s===this._weight&&r===this._weightBold||(this._font=e,this._fontSize=t,this._weight=s,this._weightBold=r,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${s}`,this._measureElements[1].style.fontWeight=`${r}`,this._measureElements[2].style.fontWeight=`${s}`,this._measureElements[3].style.fontWeight=`${r}`,this.clear())}get(e,t,s){let r=0;if(!t&&!s&&e.length===1&&(r=e.charCodeAt(0))<256){if(this._flat[r]!==-9999)return this._flat[r];let c=this._measure(e,0);return c>0&&(this._flat[r]=c),c}let o=e;t&&(o+="B"),s&&(o+="I");let l=this._holey.get(o);if(l===void 0){let c=0;t&&(c|=1),s&&(c|=2),l=this._measure(e,c),l>0&&this._holey.set(o,l)}return l}_measure(e,t){let s=this._measureElements[t];return s.textContent=e.repeat(32),s.offsetWidth/32}},e8=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,s,r=!1){if(this.selectionStart=t,this.selectionEnd=s,!t||!s||t[0]===s[0]&&t[1]===s[1]){this.clear();return}let o=e.buffers.active.ydisp,l=t[1]-o,c=s[1]-o,h=Math.max(l,0),f=Math.min(c,e.rows-1);if(h>=e.rows||f<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=r,this.viewportStartRow=l,this.viewportEndRow=c,this.viewportCappedStartRow=h,this.viewportCappedEndRow=f,this.startCol=t[0],this.endCol=s[0]}isCellSelected(e,t,s){return this.hasSelection?(s-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&s>=this.viewportCappedStartRow&&t<this.endCol&&s<=this.viewportCappedEndRow:t<this.startCol&&s>=this.viewportCappedStartRow&&t>=this.endCol&&s<=this.viewportCappedEndRow:s>this.viewportStartRow&&s<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&s===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&s===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&s===this.viewportStartRow&&t>=this.startCol):!1}};function t8(){return new e8}var Om="xterm-dom-renderer-owner-",Ii="xterm-rows",du="xterm-fg-",tx="xterm-bg-",Ua="xterm-focus",fu="xterm-selection",i8=1,Gp=class extends Le{constructor(e,t,s,r,o,l,c,h,f,d,p,v,_,y){super(),this._terminal=e,this._document=t,this._element=s,this._screenElement=r,this._viewportElement=o,this._helperContainer=l,this._linkifier2=c,this._charSizeService=f,this._optionsService=d,this._bufferService=p,this._coreService=v,this._coreBrowserService=_,this._themeService=y,this._terminalClass=i8++,this._rowElements=[],this._selectionRenderModel=t8(),this.onRequestRedraw=this._register(new pe).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(Ii),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(fu),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=Qj(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(b=>this._injectCss(b))),this._injectCss(this._themeService.colors),this._rowFactory=h.createInstance(qp,document),this._element.classList.add(Om+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(b=>this._handleLinkHover(b))),this._register(this._linkifier2.onHideLinkUnderline(b=>this._handleLinkLeave(b))),this._register(rt(()=>{this._element.classList.remove(Om+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new Jj(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 s of this._rowElements)s.style.width=`${this.dimensions.css.canvas.width}px`,s.style.height=`${this.dimensions.css.cell.height}px`,s.style.lineHeight=`${this.dimensions.css.cell.height}px`,s.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${Ii} 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} .${Ii} { 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} .${Ii} .xterm-dim { color: ${st.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 s=`blink_underline_${this._terminalClass}`,r=`blink_bar_${this._terminalClass}`,o=`blink_block_${this._terminalClass}`;t+=`@keyframes ${s} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${r} { 50% { box-shadow: none; }}`,t+=`@keyframes ${o} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${Ii}.${Ua} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${Ii}.${Ua} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${Ii}.${Ua} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${o} 1s step-end infinite;}${this._terminalSelector} .${Ii} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${Ii} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${Ii} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${Ii} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${Ii} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${fu} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${fu} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${fu} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[l,c]of e.ansi.entries())t+=`${this._terminalSelector} .${du}${l} { color: ${c.css}; }${this._terminalSelector} .${du}${l}.xterm-dim { color: ${st.multiplyOpacity(c,.5).css}; }${this._terminalSelector} .${tx}${l} { background-color: ${c.css}; }`;t+=`${this._terminalSelector} .${du}257 { color: ${st.opaque(e.background).css}; }${this._terminalSelector} .${du}257.xterm-dim { color: ${st.multiplyOpacity(st.opaque(e.background),.5).css}; }${this._terminalSelector} .${tx}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 s=this._rowElements.length;s<=t;s++){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(Ua),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(Ua),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,s){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,s),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,s),!this._selectionRenderModel.hasSelection))return;let r=this._selectionRenderModel.viewportStartRow,o=this._selectionRenderModel.viewportEndRow,l=this._selectionRenderModel.viewportCappedStartRow,c=this._selectionRenderModel.viewportCappedEndRow,h=this._document.createDocumentFragment();if(s){let f=e[0]>t[0];h.appendChild(this._createSelectionElement(l,f?t[0]:e[0],f?e[0]:t[0],c-l+1))}else{let f=r===l?e[0]:0,d=l===o?t[0]:this._bufferService.cols;h.appendChild(this._createSelectionElement(l,f,d));let p=c-l-1;if(h.appendChild(this._createSelectionElement(l+1,0,this._bufferService.cols,p)),l!==c){let v=o===c?t[0]:this._bufferService.cols;h.appendChild(this._createSelectionElement(c,0,v))}}this._selectionContainer.appendChild(h)}_createSelectionElement(e,t,s,r=1){let o=this._document.createElement("div"),l=t*this.dimensions.css.cell.width,c=this.dimensions.css.cell.width*(s-t);return l+c>this.dimensions.css.canvas.width&&(c=this.dimensions.css.canvas.width-l),o.style.height=`${r*this.dimensions.css.cell.height}px`,o.style.top=`${e*this.dimensions.css.cell.height}px`,o.style.left=`${l}px`,o.style.width=`${c}px`,o}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 s=this._bufferService.buffer,r=s.ybase+s.y,o=Math.min(s.x,this._bufferService.cols-1),l=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,c=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,h=this._optionsService.rawOptions.cursorInactiveStyle;for(let f=e;f<=t;f++){let d=f+s.ydisp,p=this._rowElements[f],v=s.lines.get(d);if(!p||!v)break;p.replaceChildren(...this._rowFactory.createRow(v,d,d===r,c,h,o,l,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Om}${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,s,r,o,l){s<0&&(e=0),r<0&&(t=0);let c=this._bufferService.rows-1;s=Math.max(Math.min(s,c),0),r=Math.max(Math.min(r,c),0),o=Math.min(o,this._bufferService.cols);let h=this._bufferService.buffer,f=h.ybase+h.y,d=Math.min(h.x,o-1),p=this._optionsService.rawOptions.cursorBlink,v=this._optionsService.rawOptions.cursorStyle,_=this._optionsService.rawOptions.cursorInactiveStyle;for(let y=s;y<=r;++y){let b=y+h.ydisp,S=this._rowElements[y],E=h.lines.get(b);if(!S||!E)break;S.replaceChildren(...this._rowFactory.createRow(E,b,b===f,v,_,d,p,this.dimensions.css.cell.width,this._widthCache,l?y===s?e:0:-1,l?(y===r?t:o)-1:-1))}}};Gp=ft([ge(7,ov),ge(8,Th),ge(9,si),ge(10,ii),ge(11,kr),ge(12,qs),ge(13,Uo)],Gp);var $p=class extends Le{constructor(e,t,s){super(),this._optionsService=s,this.width=0,this.height=0,this._onCharSizeChange=this._register(new pe),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new n8(this._optionsService))}catch{this._measureStrategy=this._register(new s8(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())}};$p=ft([ge(2,si)],$p);var yT=class extends Le{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)}},s8=class extends yT{constructor(e,t,s){super(),this._document=e,this._parentElement=t,this._optionsService=s,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}},n8=class extends yT{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}},r8=class extends Le{constructor(e,t,s){super(),this._textarea=e,this._window=t,this.mainDocument=s,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new o8(this._window)),this._onDprChange=this._register(new pe),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new pe),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(r=>this._screenDprMonitor.setWindow(r))),this._register(Wt.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Te(this._textarea,"focus",()=>this._isFocused=!0)),this._register(Te(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}},o8=class extends Le{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new Lo),this._onDprChange=this._register(new pe),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(rt(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Te(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.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)}},a8=class extends Le{constructor(){super(),this.linkProviders=[],this._register(rt(()=>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 mv(e,t,s){let r=s.getBoundingClientRect(),o=e.getComputedStyle(s),l=parseInt(o.getPropertyValue("padding-left")),c=parseInt(o.getPropertyValue("padding-top"));return[t.clientX-r.left-l,t.clientY-r.top-c]}function l8(e,t,s,r,o,l,c,h,f){if(!l)return;let d=mv(e,t,s);if(d)return d[0]=Math.ceil((d[0]+(f?c/2:0))/c),d[1]=Math.ceil(d[1]/h),d[0]=Math.min(Math.max(d[0],1),r+(f?1:0)),d[1]=Math.min(Math.max(d[1],1),o),d}var Xp=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,s,r,o){return l8(window,e,t,s,r,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,o)}getMouseReportCoords(e,t){let s=mv(window,e,t);if(this._charSizeService.hasValidSize)return s[0]=Math.min(Math.max(s[0],0),this._renderService.dimensions.css.canvas.width-1),s[1]=Math.min(Math.max(s[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(s[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(s[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(s[0]),y:Math.floor(s[1])}}};Xp=ft([ge(0,Gs),ge(1,Th)],Xp);var c8=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,s){this._rowCount=s,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=[]}},bT={};yz(bT,{getSafariVersion:()=>h8,isChromeOS:()=>CT,isFirefox:()=>ST,isIpad:()=>d8,isIphone:()=>f8,isLegacyEdge:()=>u8,isLinux:()=>pv,isMac:()=>sh,isNode:()=>kh,isSafari:()=>wT,isWindows:()=>xT});var kh=typeof process<"u"&&"title"in process,Rl=kh?"node":navigator.userAgent,Ml=kh?"node":navigator.platform,ST=Rl.includes("Firefox"),u8=Rl.includes("Edge"),wT=/^((?!chrome|android).)*safari/i.test(Rl);function h8(){if(!wT)return 0;let e=Rl.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var sh=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(Ml),d8=Ml==="iPad",f8=Ml==="iPhone",xT=["Windows","Win16","Win32","WinCE"].includes(Ml),pv=Ml.indexOf("Linux")>=0,CT=/\bCrOS\b/.test(Rl),ET=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,s=0,r=e.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),s=Math.max(t,s),o=e.timeRemaining(),s*1.5>o){r-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-t))}ms`),this._start();return}r=o}this.clear()}},m8=class extends ET{_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())}}},p8=class extends ET{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},nh=!kh&&"requestIdleCallback"in window?p8:m8,g8=class{constructor(){this._queue=new nh}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},Zp=class extends Le{constructor(e,t,s,r,o,l,c,h,f){super(),this._rowCount=e,this._optionsService=s,this._charSizeService=r,this._coreService=o,this._coreBrowserService=h,this._renderer=this._register(new Lo),this._pausedResizeTask=new g8,this._observerDisposable=this._register(new Lo),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 pe),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new pe),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new pe),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new pe),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new c8((d,p)=>this._renderRows(d,p),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new v8(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(rt(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(c.onResize(()=>this._fullRefresh())),this._register(c.buffers.onBufferActivate(()=>this._renderer.value?.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(c.cols,c.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(c.buffer.y,c.buffer.y,!0))),this._register(f.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 s=new e.IntersectionObserver(r=>this._handleIntersectionChange(r[r.length-1]),{threshold:0});s.observe(t),this._observerDisposable.value=rt(()=>s.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,s=!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)),s||(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(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),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(()=>this._renderer.value?.handleResize(e,t)):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,t,s){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=s,this._renderer.value?.handleSelectionChanged(e,t,s)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};Zp=ft([ge(2,si),ge(3,Th),ge(4,kr),ge(5,Al),ge(6,ii),ge(7,qs),ge(8,Uo)],Zp);var v8=class{constructor(e,t,s){this._coreBrowserService=e,this._coreService=t,this._onTimeout=s,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 _8(e,t,s,r){let o=s.buffer.x,l=s.buffer.y;if(!s.buffer.hasScrollback)return S8(o,l,e,t,s,r)+Ah(l,t,s,r)+w8(o,l,e,t,s,r);let c;if(l===t)return c=o>e?"D":"C",vl(Math.abs(o-e),gl(c,r));c=l>t?"D":"C";let h=Math.abs(l-t),f=b8(l>t?e:o,s)+(h-1)*s.cols+1+y8(l>t?o:e);return vl(f,gl(c,r))}function y8(e,t){return e-1}function b8(e,t){return t.cols-e}function S8(e,t,s,r,o,l){return Ah(t,r,o,l).length===0?"":vl(kT(e,t,e,t-Cr(t,o),!1,o).length,gl("D",l))}function Ah(e,t,s,r){let o=e-Cr(e,s),l=t-Cr(t,s),c=Math.abs(o-l)-x8(e,t,s);return vl(c,gl(TT(e,t),r))}function w8(e,t,s,r,o,l){let c;Ah(t,r,o,l).length>0?c=r-Cr(r,o):c=t;let h=r,f=C8(e,t,s,r,o,l);return vl(kT(e,c,s,h,f==="C",o).length,gl(f,l))}function x8(e,t,s){let r=0,o=e-Cr(e,s),l=t-Cr(t,s);for(let c=0;c<Math.abs(o-l);c++){let h=TT(e,t)==="A"?-1:1;s.buffer.lines.get(o+h*c)?.isWrapped&&r++}return r}function Cr(e,t){let s=0,r=t.buffer.lines.get(e),o=r?.isWrapped;for(;o&&e>=0&&e<t.rows;)s++,r=t.buffer.lines.get(--e),o=r?.isWrapped;return s}function C8(e,t,s,r,o,l){let c;return Ah(s,r,o,l).length>0?c=r-Cr(r,o):c=t,e<s&&c<=r||e>=s&&c<r?"C":"D"}function TT(e,t){return e>t?"A":"B"}function kT(e,t,s,r,o,l){let c=e,h=t,f="";for(;(c!==s||h!==r)&&h>=0&&h<l.buffer.lines.length;)c+=o?1:-1,o&&c>l.cols-1?(f+=l.buffer.translateBufferLineToString(h,!1,e,c),c=0,e=0,h++):!o&&c<0&&(f+=l.buffer.translateBufferLineToString(h,!1,0,e+1),c=l.cols-1,e=c,h--);return f+l.buffer.translateBufferLineToString(h,!1,e,c)}function gl(e,t){let s=t?"O":"[";return fe.ESC+s+e}function vl(e,t){e=Math.floor(e);let s="";for(let r=0;r<e;r++)s+=t;return s}var E8=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 ix(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 Nm=50,T8=15,k8=50,A8=500,R8=" ",M8=new RegExp(R8,"g"),Qp=class extends Le{constructor(e,t,s,r,o,l,c,h,f){super(),this._element=e,this._screenElement=t,this._linkifier=s,this._bufferService=r,this._coreService=o,this._mouseService=l,this._optionsService=c,this._renderService=h,this._coreBrowserService=f,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Yi,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new pe),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new pe),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new pe),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new pe),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 E8(this._bufferService),this._activeSelectionMode=0,this._register(rt(()=>{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 s=this._bufferService.buffer,r=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let o=e[0]<t[0]?e[0]:t[0],l=e[0]<t[0]?t[0]:e[0];for(let c=e[1];c<=t[1];c++){let h=s.translateBufferLineToString(c,!0,o,l);r.push(h)}}else{let o=e[1]===t[1]?t[0]:void 0;r.push(s.translateBufferLineToString(e[1],!0,e[0],o));for(let l=e[1]+1;l<=t[1]-1;l++){let c=s.lines.get(l),h=s.translateBufferLineToString(l,!0);c?.isWrapped?r[r.length-1]+=h:r.push(h)}if(e[1]!==t[1]){let l=s.lines.get(t[1]),c=s.translateBufferLineToString(t[1],!0,0,t[0]);l&&l.isWrapped?r[r.length-1]+=c:r.push(c)}}return r.map(o=>o.replace(M8," ")).join(xT?`\r
|
|
69
|
+
`:`
|
|
70
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),pv&&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),s=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!s||!r||!t?!1:this._areCoordsInSelection(t,s,r)}isCellInSelection(e,t){let s=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!s||!r?!1:this._areCoordsInSelection([e,t],s,r)}_areCoordsInSelection(e,t,s){return e[1]>t[1]&&e[1]<s[1]||t[1]===s[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<s[0]||t[1]<s[1]&&e[1]===s[1]&&e[0]<s[0]||t[1]<s[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){let s=this._linkifier.currentLink?.link?.range;if(s)return this._model.selectionStart=[s.start.x-1,s.start.y-1],this._model.selectionStartLength=ix(s,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=mv(this._coreBrowserService.window,e,this._screenElement)[1],s=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=s?0:(t>s&&(t-=s),t=Math.min(Math.max(t,-Nm),Nm),t/=Nm,t/Math.abs(t)+Math.round(t*(T8-1)))}shouldForceSelection(e){return sh?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(),k8)}_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&&!(sh&&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 s=this._bufferService.buffer;if(this._model.selectionEnd[1]<s.lines.length){let r=s.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<A8&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let s=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(s&&s[0]!==void 0&&s[1]!==void 0){let r=_8(s[0]-1,s[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,s=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!s){this._oldHasSelection&&this._fireOnSelectionChange(e,t,s);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,s)}_fireOnSelectionChange(e,t,s){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=s,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let s=t;for(let r=0;t>=r;r++){let o=e.loadCell(r,this._workCell).getChars().length;this._workCell.getWidth()===0?s--:o>1&&t!==r&&(s+=o-1)}return s}setSelection(e,t,s){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=s,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,s=!0,r=!0){if(e[0]>=this._bufferService.cols)return;let o=this._bufferService.buffer,l=o.lines.get(e[1]);if(!l)return;let c=o.translateBufferLineToString(e[1],!1),h=this._convertViewportColToCharacterIndex(l,e[0]),f=h,d=e[0]-h,p=0,v=0,_=0,y=0;if(c.charAt(h)===" "){for(;h>0&&c.charAt(h-1)===" ";)h--;for(;f<c.length&&c.charAt(f+1)===" ";)f++}else{let E=e[0],A=e[0];l.getWidth(E)===0&&(p++,E--),l.getWidth(A)===2&&(v++,A++);let R=l.getString(A).length;for(R>1&&(y+=R-1,f+=R-1);E>0&&h>0&&!this._isCharWordSeparator(l.loadCell(E-1,this._workCell));){l.loadCell(E-1,this._workCell);let M=this._workCell.getChars().length;this._workCell.getWidth()===0?(p++,E--):M>1&&(_+=M-1,h-=M-1),h--,E--}for(;A<l.length&&f+1<c.length&&!this._isCharWordSeparator(l.loadCell(A+1,this._workCell));){l.loadCell(A+1,this._workCell);let M=this._workCell.getChars().length;this._workCell.getWidth()===2?(v++,A++):M>1&&(y+=M-1,f+=M-1),f++,A++}}f++;let b=h+d-p+_,S=Math.min(this._bufferService.cols,f-h+p+v-_-y);if(!(!t&&c.slice(h,f).trim()==="")){if(s&&b===0&&l.getCodePoint(0)!==32){let E=o.lines.get(e[1]-1);if(E&&l.isWrapped&&E.getCodePoint(this._bufferService.cols-1)!==32){let A=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(A){let R=this._bufferService.cols-A.start;b-=R,S+=R}}}if(r&&b+S===this._bufferService.cols&&l.getCodePoint(this._bufferService.cols-1)!==32){let E=o.lines.get(e[1]+1);if(E?.isWrapped&&E.getCodePoint(0)!==32){let A=this._getWordAt([0,e[1]+1],!1,!1,!0);A&&(S+=A.length)}}return{start:b,length:S}}}_selectWordAt(e,t){let s=this._getWordAt(e,t);if(s){for(;s.start<0;)s.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[s.start,e[1]],this._model.selectionStartLength=s.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let s=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,s--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,s++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,s]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),s={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=ix(s,this._bufferService.cols)}};Qp=ft([ge(3,ii),ge(4,kr),ge(5,av),ge(6,si),ge(7,Gs),ge(8,qs)],Qp);var sx=class{constructor(){this._data={}}set(e,t,s){this._data[e]||(this._data[e]={}),this._data[e][t]=s}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},nx=class{constructor(){this._color=new sx,this._css=new sx}setCss(e,t,s){this._css.set(e,t,s)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,s){this._color.set(e,t,s)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},kt=Object.freeze((()=>{let e=[at.toColor("#2e3436"),at.toColor("#cc0000"),at.toColor("#4e9a06"),at.toColor("#c4a000"),at.toColor("#3465a4"),at.toColor("#75507b"),at.toColor("#06989a"),at.toColor("#d3d7cf"),at.toColor("#555753"),at.toColor("#ef2929"),at.toColor("#8ae234"),at.toColor("#fce94f"),at.toColor("#729fcf"),at.toColor("#ad7fa8"),at.toColor("#34e2e2"),at.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let s=0;s<216;s++){let r=t[s/36%6|0],o=t[s/6%6|0],l=t[s%6];e.push({css:xt.toCss(r,o,l),rgba:xt.toRgba(r,o,l)})}for(let s=0;s<24;s++){let r=8+s*10;e.push({css:xt.toCss(r,r,r),rgba:xt.toRgba(r,r,r)})}return e})()),fr=at.toColor("#ffffff"),Za=at.toColor("#000000"),rx=at.toColor("#ffffff"),ox=Za,Fa={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},D8=fr,Jp=class extends Le{constructor(e){super(),this._optionsService=e,this._contrastCache=new nx,this._halfContrastCache=new nx,this._onChangeColors=this._register(new pe),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:fr,background:Za,cursor:rx,cursorAccent:ox,selectionForeground:void 0,selectionBackgroundTransparent:Fa,selectionBackgroundOpaque:st.blend(Za,Fa),selectionInactiveBackgroundTransparent:Fa,selectionInactiveBackgroundOpaque:st.blend(Za,Fa),scrollbarSliderBackground:st.opacity(fr,.2),scrollbarSliderHoverBackground:st.opacity(fr,.4),scrollbarSliderActiveBackground:st.opacity(fr,.5),overviewRulerBorder:fr,ansi:kt.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=Ze(e.foreground,fr),t.background=Ze(e.background,Za),t.cursor=st.blend(t.background,Ze(e.cursor,rx)),t.cursorAccent=st.blend(t.background,Ze(e.cursorAccent,ox)),t.selectionBackgroundTransparent=Ze(e.selectionBackground,Fa),t.selectionBackgroundOpaque=st.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=Ze(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=st.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?Ze(e.selectionForeground,Jw):void 0,t.selectionForeground===Jw&&(t.selectionForeground=void 0),st.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=st.opacity(t.selectionBackgroundTransparent,.3)),st.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=st.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=Ze(e.scrollbarSliderBackground,st.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=Ze(e.scrollbarSliderHoverBackground,st.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=Ze(e.scrollbarSliderActiveBackground,st.opacity(t.foreground,.5)),t.overviewRulerBorder=Ze(e.overviewRulerBorder,D8),t.ansi=kt.slice(),t.ansi[0]=Ze(e.black,kt[0]),t.ansi[1]=Ze(e.red,kt[1]),t.ansi[2]=Ze(e.green,kt[2]),t.ansi[3]=Ze(e.yellow,kt[3]),t.ansi[4]=Ze(e.blue,kt[4]),t.ansi[5]=Ze(e.magenta,kt[5]),t.ansi[6]=Ze(e.cyan,kt[6]),t.ansi[7]=Ze(e.white,kt[7]),t.ansi[8]=Ze(e.brightBlack,kt[8]),t.ansi[9]=Ze(e.brightRed,kt[9]),t.ansi[10]=Ze(e.brightGreen,kt[10]),t.ansi[11]=Ze(e.brightYellow,kt[11]),t.ansi[12]=Ze(e.brightBlue,kt[12]),t.ansi[13]=Ze(e.brightMagenta,kt[13]),t.ansi[14]=Ze(e.brightCyan,kt[14]),t.ansi[15]=Ze(e.brightWhite,kt[15]),e.extendedAnsi){let s=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let r=0;r<s;r++)t.ansi[r+16]=Ze(e.extendedAnsi[r],kt[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()}}};Jp=ft([ge(0,si)],Jp);function Ze(e,t){if(e!==void 0)try{return at.toColor(e)}catch{}return t}var O8=class{constructor(...e){this._entries=new Map;for(let[t,s]of e)this.set(t,s)}set(e,t){let s=this._entries.get(e);return this._entries.set(e,t),s}forEach(e){for(let[t,s]of this._entries.entries())e(t,s)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},N8=class{constructor(){this._services=new O8,this._services.set(ov,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let s=Tz(e).sort((l,c)=>l.index-c.index),r=[];for(let l of s){let c=this._services.get(l.id);if(!c)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${l.id._id}.`);r.push(c)}let o=s.length>0?s[0].index:t.length;if(t.length!==o)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${o+1} conflicts with ${t.length} static arguments`);return new e(...t,...r)}},L8={trace:0,debug:1,info:2,warn:3,error:4,off:5},B8="xterm.js: ",eg=class extends Le{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=L8[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,s){this._evalLazyOptionalParams(s),e.call(console,(this._optionsService.options.logger?"":B8)+t,...s)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};eg=ft([ge(0,si)],eg);var ax=class extends Le{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new pe),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new pe),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new pe),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 s=0;s<Math.min(e,this.length);s++)t[s]=this._array[this._getCyclicIndex(s)];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,...s){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+s.length)]=this._array[this._getCyclicIndex(r)];for(let r=0;r<s.length;r++)this._array[this._getCyclicIndex(e+r)]=s[r];if(s.length&&this.onInsertEmitter.fire({index:e,amount:s.length}),this._length+s.length>this._maxLength){let r=this._length+s.length-this._maxLength;this._startIndex+=r,this._length=this._maxLength,this.onTrimEmitter.fire(r)}else this._length+=s.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,s){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+s<0)throw new Error("Cannot shift elements in list beyond index 0");if(s>0){for(let o=t-1;o>=0;o--)this.set(e+o+s,this.get(e+o));let r=e+t+s-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+s,this.get(e+r))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},Oe=3,St=Object.freeze(new kl),mu=0,Lm=2,Qa=class AT{constructor(t,s,r=!1){this.isWrapped=r,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*Oe);let o=s||Yi.fromCharData([0,q2,1,0]);for(let l=0;l<t;++l)this.setCell(l,o);this.length=t}get(t){let s=this._data[t*Oe+0],r=s&2097151;return[this._data[t*Oe+1],s&2097152?this._combined[t]:r?Rn(r):"",s>>22,s&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):r]}set(t,s){this._data[t*Oe+1]=s[0],s[1].length>1?(this._combined[t]=s[1],this._data[t*Oe+0]=t|2097152|s[2]<<22):this._data[t*Oe+0]=s[1].charCodeAt(0)|s[2]<<22}getWidth(t){return this._data[t*Oe+0]>>22}hasWidth(t){return this._data[t*Oe+0]&12582912}getFg(t){return this._data[t*Oe+1]}getBg(t){return this._data[t*Oe+2]}hasContent(t){return this._data[t*Oe+0]&4194303}getCodePoint(t){let s=this._data[t*Oe+0];return s&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):s&2097151}isCombined(t){return this._data[t*Oe+0]&2097152}getString(t){let s=this._data[t*Oe+0];return s&2097152?this._combined[t]:s&2097151?Rn(s&2097151):""}isProtected(t){return this._data[t*Oe+2]&536870912}loadCell(t,s){return mu=t*Oe,s.content=this._data[mu+0],s.fg=this._data[mu+1],s.bg=this._data[mu+2],s.content&2097152&&(s.combinedData=this._combined[t]),s.bg&268435456&&(s.extended=this._extendedAttrs[t]),s}setCell(t,s){s.content&2097152&&(this._combined[t]=s.combinedData),s.bg&268435456&&(this._extendedAttrs[t]=s.extended),this._data[t*Oe+0]=s.content,this._data[t*Oe+1]=s.fg,this._data[t*Oe+2]=s.bg}setCellFromCodepoint(t,s,r,o){o.bg&268435456&&(this._extendedAttrs[t]=o.extended),this._data[t*Oe+0]=s|r<<22,this._data[t*Oe+1]=o.fg,this._data[t*Oe+2]=o.bg}addCodepointToCell(t,s,r){let o=this._data[t*Oe+0];o&2097152?this._combined[t]+=Rn(s):o&2097151?(this._combined[t]=Rn(o&2097151)+Rn(s),o&=-2097152,o|=2097152):o=s|1<<22,r&&(o&=-12582913,o|=r<<22),this._data[t*Oe+0]=o}insertCells(t,s,r){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,r),s<this.length-t){let o=new Yi;for(let l=this.length-t-s-1;l>=0;--l)this.setCell(t+s+l,this.loadCell(t+l,o));for(let l=0;l<s;++l)this.setCell(t+l,r)}else for(let o=t;o<this.length;++o)this.setCell(o,r);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,r)}deleteCells(t,s,r){if(t%=this.length,s<this.length-t){let o=new Yi;for(let l=0;l<this.length-t-s;++l)this.setCell(t+l,this.loadCell(t+s+l,o));for(let l=this.length-s;l<this.length;++l)this.setCell(l,r)}else for(let o=t;o<this.length;++o)this.setCell(o,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,s,r,o=!1){if(o){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,r),s<this.length&&this.getWidth(s-1)===2&&!this.isProtected(s)&&this.setCellFromCodepoint(s,0,1,r);t<s&&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),s<this.length&&this.getWidth(s-1)===2&&this.setCellFromCodepoint(s,0,1,r);t<s&&t<this.length;)this.setCell(t++,r)}resize(t,s){if(t===this.length)return this._data.length*4*Lm<this._data.buffer.byteLength;let r=t*Oe;if(t>this.length){if(this._data.buffer.byteLength>=r*4)this._data=new Uint32Array(this._data.buffer,0,r);else{let o=new Uint32Array(r);o.set(this._data),this._data=o}for(let o=this.length;o<t;++o)this.setCell(o,s)}else{this._data=this._data.subarray(0,r);let o=Object.keys(this._combined);for(let c=0;c<o.length;c++){let h=parseInt(o[c],10);h>=t&&delete this._combined[h]}let l=Object.keys(this._extendedAttrs);for(let c=0;c<l.length;c++){let h=parseInt(l[c],10);h>=t&&delete this._extendedAttrs[h]}}return this.length=t,r*4*Lm<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*Lm<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,s=!1){if(s){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 s in t._combined)this._combined[s]=t._combined[s];this._extendedAttrs={};for(let s in t._extendedAttrs)this._extendedAttrs[s]=t._extendedAttrs[s];this.isWrapped=t.isWrapped}clone(){let t=new AT(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let s in this._combined)t._combined[s]=this._combined[s];for(let s in this._extendedAttrs)t._extendedAttrs[s]=this._extendedAttrs[s];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Oe+0]&4194303)return t+(this._data[t*Oe+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Oe+0]&4194303||this._data[t*Oe+2]&50331648)return t+(this._data[t*Oe+0]>>22);return 0}copyCellsFrom(t,s,r,o,l){let c=t._data;if(l)for(let f=o-1;f>=0;f--){for(let d=0;d<Oe;d++)this._data[(r+f)*Oe+d]=c[(s+f)*Oe+d];c[(s+f)*Oe+2]&268435456&&(this._extendedAttrs[r+f]=t._extendedAttrs[s+f])}else for(let f=0;f<o;f++){for(let d=0;d<Oe;d++)this._data[(r+f)*Oe+d]=c[(s+f)*Oe+d];c[(s+f)*Oe+2]&268435456&&(this._extendedAttrs[r+f]=t._extendedAttrs[s+f])}let h=Object.keys(t._combined);for(let f=0;f<h.length;f++){let d=parseInt(h[f],10);d>=s&&(this._combined[d-s+r]=t._combined[d])}}translateToString(t,s,r,o){s=s??0,r=r??this.length,t&&(r=Math.min(r,this.getTrimmedLength())),o&&(o.length=0);let l="";for(;s<r;){let c=this._data[s*Oe+0],h=c&2097151,f=c&2097152?this._combined[s]:h?Rn(h):Dn;if(l+=f,o)for(let d=0;d<f.length;++d)o.push(s);s+=c>>22||1}return o&&o.push(s),l}};function P8(e,t,s,r,o,l){let c=[];for(let h=0;h<e.length-1;h++){let f=h,d=e.get(++f);if(!d.isWrapped)continue;let p=[e.get(h)];for(;f<e.length&&d.isWrapped;)p.push(d),d=e.get(++f);if(!l&&r>=h&&r<f){h+=p.length-1;continue}let v=0,_=_l(p,v,t),y=1,b=0;for(;y<p.length;){let E=_l(p,y,t),A=E-b,R=s-_,M=Math.min(A,R);p[v].copyCellsFrom(p[y],b,_,M,!1),_+=M,_===s&&(v++,_=0),b+=M,b===E&&(y++,b=0),_===0&&v!==0&&p[v-1].getWidth(s-1)===2&&(p[v].copyCellsFrom(p[v-1],s-1,_++,1,!1),p[v-1].setCell(s-1,o))}p[v].replaceCells(_,s,o);let S=0;for(let E=p.length-1;E>0&&(E>v||p[E].getTrimmedLength()===0);E--)S++;S>0&&(c.push(h+p.length-S),c.push(S)),h+=p.length-1}return c}function z8(e,t){let s=[],r=0,o=t[r],l=0;for(let c=0;c<e.length;c++)if(o===c){let h=t[++r];e.onDeleteEmitter.fire({index:c-l,amount:h}),c+=h-1,l+=h,o=t[++r]}else s.push(c);return{layout:s,countRemoved:l}}function j8(e,t){let s=[];for(let r=0;r<t.length;r++)s.push(e.get(t[r]));for(let r=0;r<s.length;r++)e.set(r,s[r]);e.length=t.length}function H8(e,t,s){let r=[],o=e.map((f,d)=>_l(e,d,t)).reduce((f,d)=>f+d),l=0,c=0,h=0;for(;h<o;){if(o-h<s){r.push(o-h);break}l+=s;let f=_l(e,c,t);l>f&&(l-=f,c++);let d=e[c].getWidth(l-1)===2;d&&l--;let p=d?s-1:s;r.push(p),h+=p}return r}function _l(e,t,s){if(t===e.length-1)return e[t].getTrimmedLength();let r=!e[t].hasContent(s-1)&&e[t].getWidth(s-1)===1,o=e[t+1].getWidth(0)===2;return r&&o?s-1:s}var RT=class MT{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=MT._nextId++,this._onDispose=this.register(new pe),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),xr(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};RT._nextId=1;var I8=RT,Mt={},mr=Mt.B;Mt[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:"≥","{":"π","|":"≠","}":"£","~":"·"};Mt.A={"#":"£"};Mt.B=void 0;Mt[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};Mt.C=Mt[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Mt.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};Mt.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};Mt.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};Mt.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};Mt.E=Mt[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};Mt.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};Mt.H=Mt[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Mt["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var lx=4294967295,cx=class{constructor(e,t,s){this._hasScrollback=e,this._optionsService=t,this._bufferService=s,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=St.clone(),this.savedCharset=mr,this.markers=[],this._nullCell=Yi.fromCharData([0,q2,1,0]),this._whitespaceCell=Yi.fromCharData([0,Dn,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new nh,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new ax(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 eh),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 eh),this._whitespaceCell}getBlankLine(e,t){return new Qa(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>lx?lx:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=St);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 ax(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let s=this.getNullCell(St),r=0,o=this._getCorrectBufferLength(t);if(o>this.lines.maxLength&&(this.lines.maxLength=o),this.lines.length>0){if(this._cols<e)for(let c=0;c<this.lines.length;c++)r+=+this.lines.get(c).resize(e,s);let l=0;if(this._rows<t)for(let c=this._rows;c<t;c++)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 Qa(e,s)):this.ybase>0&&this.lines.length<=this.ybase+this.y+l+1?(this.ybase--,l++,this.ydisp>0&&this.ydisp--):this.lines.push(new Qa(e,s)));else for(let c=this._rows;c>t;c--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(o<this.lines.maxLength){let c=this.lines.length-o;c>0&&(this.lines.trimStart(c),this.ybase=Math.max(this.ybase-c,0),this.ydisp=Math.max(this.ydisp-c,0),this.savedY=Math.max(this.savedY-c,0)),this.lines.maxLength=o}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,s);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 s=this._optionsService.rawOptions.reflowCursorLine,r=P8(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(St),s);if(r.length>0){let o=z8(this.lines,r);j8(this.lines,o.layout),this._reflowLargerAdjustViewport(e,t,o.countRemoved)}}_reflowLargerAdjustViewport(e,t,s){let r=this.getNullCell(St),o=s;for(;o-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new Qa(e,r))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-s,0)}_reflowSmaller(e,t){let s=this._optionsService.rawOptions.reflowCursorLine,r=this.getNullCell(St),o=[],l=0;for(let c=this.lines.length-1;c>=0;c--){let h=this.lines.get(c);if(!h||!h.isWrapped&&h.getTrimmedLength()<=e)continue;let f=[h];for(;h.isWrapped&&c>0;)h=this.lines.get(--c),f.unshift(h);if(!s){let M=this.ybase+this.y;if(M>=c&&M<c+f.length)continue}let d=f[f.length-1].getTrimmedLength(),p=H8(f,this._cols,e),v=p.length-f.length,_;this.ybase===0&&this.y!==this.lines.length-1?_=Math.max(0,this.y-this.lines.maxLength+v):_=Math.max(0,this.lines.length-this.lines.maxLength+v);let y=[];for(let M=0;M<v;M++){let k=this.getBlankLine(St,!0);y.push(k)}y.length>0&&(o.push({start:c+f.length+l,newLines:y}),l+=y.length),f.push(...y);let b=p.length-1,S=p[b];S===0&&(b--,S=p[b]);let E=f.length-v-1,A=d;for(;E>=0;){let M=Math.min(A,S);if(f[b]===void 0)break;if(f[b].copyCellsFrom(f[E],A-M,S-M,M,!0),S-=M,S===0&&(b--,S=p[b]),A-=M,A===0){E--;let k=Math.max(E,0);A=_l(f,k,this._cols)}}for(let M=0;M<f.length;M++)p[M]<e&&f[M].setCell(p[M],r);let R=v-_;for(;R-- >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+v,this.ybase+t-1)}if(o.length>0){let c=[],h=[];for(let S=0;S<this.lines.length;S++)h.push(this.lines.get(S));let f=this.lines.length,d=f-1,p=0,v=o[p];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+l);let _=0;for(let S=Math.min(this.lines.maxLength-1,f+l-1);S>=0;S--)if(v&&v.start>d+_){for(let E=v.newLines.length-1;E>=0;E--)this.lines.set(S--,v.newLines[E]);S++,c.push({index:d+1,amount:v.newLines.length}),_+=v.newLines.length,v=o[++p]}else this.lines.set(S,h[d--]);let y=0;for(let S=c.length-1;S>=0;S--)c[S].index+=y,this.lines.onInsertEmitter.fire(c[S]),y+=c[S].amount;let b=Math.max(0,f+l-this.lines.maxLength);b>0&&this.lines.onTrimEmitter.fire(b)}}translateBufferLineToString(e,t,s=0,r){let o=this.lines.get(e);return o?o.translateToString(t,s,r):""}getWrappedRangeForLine(e){let t=e,s=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;s+1<this.lines.length&&this.lines.get(s+1).isWrapped;)s++;return{first:t,last:s}}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 I8(e);return this.markers.push(t),t.register(this.lines.onTrim(s=>{t.line-=s,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(s=>{t.line>=s.index&&(t.line+=s.amount)})),t.register(this.lines.onDelete(s=>{t.line>=s.index&&t.line<s.index+s.amount&&t.dispose(),t.line>s.index&&(t.line-=s.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},V8=class extends Le{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new pe),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 cx(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new cx(!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)}},DT=2,OT=1,tg=class extends Le{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new pe),this.onResize=this._onResize.event,this._onScroll=this._register(new pe),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,DT),this.rows=Math.max(e.rawOptions.rows||0,OT),this.buffers=this._register(new V8(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let s=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:s,rowsChanged:r})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let s=this.buffer,r;r=this._cachedBlankLine,(!r||r.length!==this.cols||r.getFg(0)!==e.fg||r.getBg(0)!==e.bg)&&(r=s.getBlankLine(e,t),this._cachedBlankLine=r),r.isWrapped=t;let o=s.ybase+s.scrollTop,l=s.ybase+s.scrollBottom;if(s.scrollTop===0){let c=s.lines.isFull;l===s.lines.length-1?c?s.lines.recycle().copyFrom(r):s.lines.push(r.clone()):s.lines.splice(l+1,0,r.clone()),c?this.isUserScrolling&&(s.ydisp=Math.max(s.ydisp-1,0)):(s.ybase++,this.isUserScrolling||s.ydisp++)}else{let c=l-o+1;s.lines.shiftElements(o+1,c-1,-1),s.lines.set(l,r.clone())}this.isUserScrolling||(s.ydisp=s.ybase),this._onScroll.fire(s.ydisp)}scrollLines(e,t){let s=this.buffer;if(e<0){if(s.ydisp===0)return;this.isUserScrolling=!0}else e+s.ydisp>=s.ybase&&(this.isUserScrolling=!1);let r=s.ydisp;s.ydisp=Math.max(Math.min(s.ydisp+e,s.ybase),0),r!==s.ydisp&&(t||this._onScroll.fire(s.ydisp))}};tg=ft([ge(0,si)],tg);var vo={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:sh,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},U8=["normal","bold","100","200","300","400","500","600","700","800","900"],F8=class extends Le{constructor(e){super(),this._onOptionChange=this._register(new pe),this.onOptionChange=this._onOptionChange.event;let t={...vo};for(let s in e)if(s in t)try{let r=e[s];t[s]=this._sanitizeAndValidateOption(s,r)}catch(r){console.error(r)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(rt(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(s=>{s===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(s=>{e.indexOf(s)!==-1&&t()})}_setupOptions(){let e=s=>{if(!(s in vo))throw new Error(`No option with key "${s}"`);return this.rawOptions[s]},t=(s,r)=>{if(!(s in vo))throw new Error(`No option with key "${s}"`);r=this._sanitizeAndValidateOption(s,r),this.rawOptions[s]!==r&&(this.rawOptions[s]=r,this._onOptionChange.fire(s))};for(let s in this.rawOptions){let r={get:e.bind(this,s),set:t.bind(this,s)};Object.defineProperty(this.options,s,r)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=vo[e]),!W8(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=vo[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=U8.includes(t)?t:vo[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 W8(e){return e==="block"||e==="underline"||e==="bar"}function Ja(e,t=5){if(typeof e!="object")return e;let s=Array.isArray(e)?[]:{};for(let r in e)s[r]=t<=1?e[r]:e[r]&&Ja(e[r],t-1);return s}var ux=Object.freeze({insertMode:!1}),hx=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),ig=class extends Le{constructor(e,t,s){super(),this._bufferService=e,this._logService=t,this._optionsService=s,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new pe),this.onData=this._onData.event,this._onUserInput=this._register(new pe),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new pe),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new pe),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=Ja(ux),this.decPrivateModes=Ja(hx)}reset(){this.modes=Ja(ux),this.decPrivateModes=Ja(hx)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let s=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&s.ybase!==s.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))}};ig=ft([ge(0,ii),ge(1,Q2),ge(2,si)],ig);var dx={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 Bm(e,t){let s=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(s|=64,s|=e.action):(s|=e.button&3,e.button&4&&(s|=64),e.button&8&&(s|=128),e.action===32?s|=32:e.action===0&&!t&&(s|=3)),s}var Pm=String.fromCharCode,fx={DEFAULT:e=>{let t=[Bm(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${Pm(t[0])}${Pm(t[1])}${Pm(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Bm(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Bm(e,!0)};${e.x};${e.y}${t}`}},sg=class extends Le{constructor(e,t,s){super(),this._bufferService=e,this._coreService=t,this._optionsService=s,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new pe),this.onProtocolChange=this._onProtocolChange.event;for(let r of Object.keys(dx))this.addProtocol(r,dx[r]);for(let r of Object.keys(fx))this.addEncoding(r,fx[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,s){if(e.deltaY===0||e.shiftKey||t===void 0||s===void 0)return 0;let r=t/s,o=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(o/=r+0,Math.abs(e.deltaY)<50&&(o*=.3),this._wheelPartialScroll+=o,o=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(o*=this._bufferService.rows),o}_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,s){if(s){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)}};sg=ft([ge(0,ii),ge(1,kr),ge(2,si)],sg);var zm=[[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]],Y8=[[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]],At;function K8(e,t){let s=0,r=t.length-1,o;if(e<t[0][0]||e>t[r][1])return!1;for(;r>=s;)if(o=s+r>>1,e>t[o][1])s=o+1;else if(e<t[o][0])r=o-1;else return!0;return!1}var q8=class{constructor(){if(this.version="6",!At){At=new Uint8Array(65536),At.fill(1),At[0]=0,At.fill(0,1,32),At.fill(0,127,160),At.fill(2,4352,4448),At[9001]=2,At[9002]=2,At.fill(2,11904,42192),At[12351]=1,At.fill(2,44032,55204),At.fill(2,63744,64256),At.fill(2,65040,65050),At.fill(2,65072,65136),At.fill(2,65280,65377),At.fill(2,65504,65511);for(let e=0;e<zm.length;++e)At.fill(0,zm[e][0],zm[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?At[e]:K8(e,Y8)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let s=this.wcwidth(e),r=s===0&&t!==0;if(r){let o=vr.extractWidth(t);o===0?r=!1:o>s&&(s=o)}return vr.createPropertyValue(0,s,r)}},vr=class Bu{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new pe,this.onChange=this._onChange.event;let t=new q8;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,s,r=!1){return(t&16777215)<<3|(s&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 s=0,r=0,o=t.length;for(let l=0;l<o;++l){let c=t.charCodeAt(l);if(55296<=c&&c<=56319){if(++l>=o)return s+this.wcwidth(c);let d=t.charCodeAt(l);56320<=d&&d<=57343?c=(c-55296)*1024+d-56320+65536:s+=this.wcwidth(d)}let h=this.charProperties(c,r),f=Bu.extractWidth(h);Bu.extractShouldJoin(h)&&(f-=Bu.extractWidth(r)),s+=f,r=h}return s}charProperties(t,s){return this._activeProvider.charProperties(t,s)}},G8=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 mx(e){let t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.get(e.cols-1),s=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);s&&t&&(s.isWrapped=t[3]!==0&&t[3]!==32)}var Wa=2147483647,$8=256,NT=class ng{constructor(t=32,s=32){if(this.maxLength=t,this.maxSubParamsLength=s,s>$8)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(s),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let s=new ng;if(!t.length)return s;for(let r=Array.isArray(t[0])?1:0;r<t.length;++r){let o=t[r];if(Array.isArray(o))for(let l=0;l<o.length;++l)s.addSubParam(o[l]);else s.addParam(o)}return s}clone(){let t=new ng(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 s=0;s<this.length;++s){t.push(this.params[s]);let r=this._subParamsIdx[s]>>8,o=this._subParamsIdx[s]&255;o-r>0&&t.push(Array.prototype.slice.call(this._subParams,r,o))}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>Wa?Wa: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>Wa?Wa:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let s=this._subParamsIdx[t]>>8,r=this._subParamsIdx[t]&255;return r-s>0?this._subParams.subarray(s,r):null}getSubParamsAll(){let t={};for(let s=0;s<this.length;++s){let r=this._subParamsIdx[s]>>8,o=this._subParamsIdx[s]&255;o-r>0&&(t[s]=this._subParams.slice(r,o))}return t}addDigit(t){let s;if(this._rejectDigits||!(s=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let r=this._digitIsSub?this._subParams:this.params,o=r[s-1];r[s-1]=~o?Math.min(o*10+t,Wa):t}},Ya=[],X8=class{constructor(){this._state=0,this._active=Ya,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 s=this._handlers[e];return s.push(t),{dispose:()=>{let r=s.indexOf(t);r!==-1&&s.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=Ya}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=Ya,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||Ya,!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,s){if(!this._active.length)this._handlerFb(this._id,"PUT",Eh(e,t,s));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,s)}start(){this.reset(),this._state=1}put(e,t,s){if(this._state!==3){if(this._state===1)for(;t<s;){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&&s-t>0&&this._put(e,t,s)}}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 s=!1,r=this._active.length-1,o=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,s=t,o=this._stack.fallThrough,this._stack.paused=!1),!o&&s===!1){for(;r>=0&&(s=this._active[r].end(e),s!==!0);r--)if(s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,s;r--}for(;r>=0;r--)if(s=this._active[r].end(!1),s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,s}this._active=Ya,this._id=-1,this._state=0}}},xi=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,s){this._hitLimit||(this._data+=Eh(e,t,s),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(s=>(this._data="",this._hitLimit=!1,s));return this._data="",this._hitLimit=!1,t}},Ka=[],Z8=class{constructor(){this._handlers=Object.create(null),this._active=Ka,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Ka}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let s=this._handlers[e];return s.push(t),{dispose:()=>{let r=s.indexOf(t);r!==-1&&s.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=Ka,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||Ka,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let s=this._active.length-1;s>=0;s--)this._active[s].hook(t)}put(e,t,s){if(!this._active.length)this._handlerFb(this._ident,"PUT",Eh(e,t,s));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,s)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let s=!1,r=this._active.length-1,o=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,s=t,o=this._stack.fallThrough,this._stack.paused=!1),!o&&s===!1){for(;r>=0&&(s=this._active[r].unhook(e),s!==!0);r--)if(s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,s;r--}for(;r>=0;r--)if(s=this._active[r].unhook(!1),s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,s}this._active=Ka,this._ident=0}},el=new NT;el.addParam(0);var px=class{constructor(e){this._handler=e,this._data="",this._params=el,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():el,this._data="",this._hitLimit=!1}put(e,t,s){this._hitLimit||(this._data+=Eh(e,t,s),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(s=>(this._params=el,this._data="",this._hitLimit=!1,s));return this._params=el,this._data="",this._hitLimit=!1,t}},Q8=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,s,r){this.table[t<<8|e]=s<<4|r}addMany(e,t,s,r){for(let o=0;o<e.length;o++)this.table[t<<8|e[o]]=s<<4|r}},Ui=160,J8=(function(){let e=new Q8(4095),t=Array.apply(null,Array(256)).map((h,f)=>f),s=(h,f)=>t.slice(h,f),r=s(32,127),o=s(0,24);o.push(25),o.push.apply(o,s(28,32));let l=s(0,14),c;e.setDefault(1,0),e.addMany(r,0,2,0);for(c in l)e.addMany([24,26,153,154],c,3,0),e.addMany(s(128,144),c,3,0),e.addMany(s(144,152),c,3,0),e.add(156,c,0,0),e.add(27,c,11,1),e.add(157,c,4,8),e.addMany([152,158,159],c,0,7),e.add(155,c,11,3),e.add(144,c,11,9);return e.addMany(o,0,3,0),e.addMany(o,1,3,1),e.add(127,1,0,1),e.addMany(o,8,0,8),e.addMany(o,3,3,3),e.add(127,3,0,3),e.addMany(o,4,3,4),e.add(127,4,0,4),e.addMany(o,6,3,6),e.addMany(o,5,3,5),e.add(127,5,0,5),e.addMany(o,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(s(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(r,7,0,7),e.addMany(o,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(s(64,127),3,7,0),e.addMany(s(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(s(48,60),4,8,4),e.addMany(s(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(s(32,64),6,0,6),e.add(127,6,0,6),e.addMany(s(64,127),6,0,0),e.addMany(s(32,48),3,9,5),e.addMany(s(32,48),5,9,5),e.addMany(s(48,64),5,0,6),e.addMany(s(64,127),5,7,0),e.addMany(s(32,48),4,9,5),e.addMany(s(32,48),1,9,2),e.addMany(s(32,48),2,9,2),e.addMany(s(48,127),2,10,0),e.addMany(s(48,80),1,10,0),e.addMany(s(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(s(96,127),1,10,0),e.add(80,1,11,9),e.addMany(o,9,0,9),e.add(127,9,0,9),e.addMany(s(28,32),9,0,9),e.addMany(s(32,48),9,9,12),e.addMany(s(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(o,11,0,11),e.addMany(s(32,128),11,0,11),e.addMany(s(28,32),11,0,11),e.addMany(o,10,0,10),e.add(127,10,0,10),e.addMany(s(28,32),10,0,10),e.addMany(s(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(s(32,48),10,9,12),e.addMany(o,12,0,12),e.add(127,12,0,12),e.addMany(s(28,32),12,0,12),e.addMany(s(32,48),12,9,12),e.addMany(s(48,64),12,0,11),e.addMany(s(64,127),12,12,13),e.addMany(s(64,127),10,12,13),e.addMany(s(64,127),9,12,13),e.addMany(o,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(Ui,0,2,0),e.add(Ui,8,5,8),e.add(Ui,6,0,6),e.add(Ui,11,0,11),e.add(Ui,13,13,13),e})(),eH=class extends Le{constructor(e=J8){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 NT,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,s,r)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,s)=>{},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(rt(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new X8),this._dcsParser=this._register(new Z8),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let s=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(s=e.prefix.charCodeAt(0),s&&60>s||s>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 o=0;o<e.intermediates.length;++o){let l=e.intermediates.charCodeAt(o);if(32>l||l>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");s<<=8,s|=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 s<<=8,s|=r,s}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 s=this._identifier(e,[48,126]);this._escHandlers[s]===void 0&&(this._escHandlers[s]=[]);let r=this._escHandlers[s];return r.push(t),{dispose:()=>{let o=r.indexOf(t);o!==-1&&r.splice(o,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 s=this._identifier(e);this._csiHandlers[s]===void 0&&(this._csiHandlers[s]=[]);let r=this._csiHandlers[s];return r.push(t),{dispose:()=>{let o=r.indexOf(t);o!==-1&&r.splice(o,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,s,r,o){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=s,this._parseStack.transition=r,this._parseStack.chunkPos=o}parse(e,t,s){let r=0,o=0,l=0,c;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,l=this._parseStack.chunkPos+1;else{if(s===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let h=this._parseStack.handlers,f=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(s===!1&&f>-1){for(;f>=0&&(c=h[f](this._params),c!==!0);f--)if(c instanceof Promise)return this._parseStack.handlerPos=f,c}this._parseStack.handlers=[];break;case 4:if(s===!1&&f>-1){for(;f>=0&&(c=h[f](),c!==!0);f--)if(c instanceof Promise)return this._parseStack.handlerPos=f,c}this._parseStack.handlers=[];break;case 6:if(r=e[this._parseStack.chunkPos],c=this._dcsParser.unhook(r!==24&&r!==26,s),c)return c;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],c=this._oscParser.end(r!==24&&r!==26,s),c)return c;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 h=l;h<t;++h){switch(r=e[h],o=this._transitions.table[this.currentState<<8|(r<160?r:Ui)],o>>4){case 2:for(let _=h+1;;++_){if(_>=t||(r=e[_])<32||r>126&&r<Ui){this._printHandler(e,h,_),h=_-1;break}if(++_>=t||(r=e[_])<32||r>126&&r<Ui){this._printHandler(e,h,_),h=_-1;break}if(++_>=t||(r=e[_])<32||r>126&&r<Ui){this._printHandler(e,h,_),h=_-1;break}if(++_>=t||(r=e[_])<32||r>126&&r<Ui){this._printHandler(e,h,_),h=_-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:h,code:r,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let f=this._csiHandlers[this._collect<<8|r],d=f?f.length-1:-1;for(;d>=0&&(c=f[d](this._params),c!==!0);d--)if(c instanceof Promise)return this._preserveStack(3,f,d,o,h),c;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(++h<t&&(r=e[h])>47&&r<60);h--;break;case 9:this._collect<<=8,this._collect|=r;break;case 10:let p=this._escHandlers[this._collect<<8|r],v=p?p.length-1:-1;for(;v>=0&&(c=p[v](),c!==!0);v--)if(c instanceof Promise)return this._preserveStack(4,p,v,o,h),c;v<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 _=h+1;;++_)if(_>=t||(r=e[_])===24||r===26||r===27||r>127&&r<Ui){this._dcsParser.put(e,h,_),h=_-1;break}break;case 14:if(c=this._dcsParser.unhook(r!==24&&r!==26),c)return this._preserveStack(6,[],0,o,h),c;r===27&&(o|=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 _=h+1;;_++)if(_>=t||(r=e[_])<32||r>127&&r<Ui){this._oscParser.put(e,h,_),h=_-1;break}break;case 6:if(c=this._oscParser.end(r!==24&&r!==26),c)return this._preserveStack(5,[],0,o,h),c;r===27&&(o|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=o&15}}},tH=/^([\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})$/,iH=/^[\da-f]+$/;function gx(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let s=tH.exec(t);if(s){let r=s[1]?15:s[4]?255:s[7]?4095:65535;return[Math.round(parseInt(s[1]||s[4]||s[7]||s[10],16)/r*255),Math.round(parseInt(s[2]||s[5]||s[8]||s[11],16)/r*255),Math.round(parseInt(s[3]||s[6]||s[9]||s[12],16)/r*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),iH.exec(t)&&[3,6,9,12].includes(t.length))){let s=t.length/3,r=[0,0,0];for(let o=0;o<3;++o){let l=parseInt(t.slice(s*o,s*o+s),16);r[o]=s===1?l<<4:s===2?l:s===3?l>>4:l>>8}return r}}function jm(e,t){let s=e.toString(16),r=s.length<2?"0"+s:s;switch(t){case 4:return s[0];case 8:return r;case 12:return(r+r).slice(0,3);default:return r+r}}function sH(e,t=16){let[s,r,o]=e;return`rgb:${jm(s,t)}/${jm(r,t)}/${jm(o,t)}`}var nH={"(":0,")":1,"*":2,"+":3,"-":1,".":2},En=131072,vx=10;function _x(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 yx=5e3,bx=0,rH=class extends Le{constructor(e,t,s,r,o,l,c,h,f=new eH){super(),this._bufferService=e,this._charsetService=t,this._coreService=s,this._logService=r,this._optionsService=o,this._oscLinkService=l,this._coreMouseService=c,this._unicodeService=h,this._parser=f,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new Cz,this._utf8Decoder=new Ez,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=St.clone(),this._eraseAttrDataInternal=St.clone(),this._onRequestBell=this._register(new pe),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new pe),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new pe),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new pe),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new pe),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new pe),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new pe),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new pe),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new pe),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new pe),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new pe),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new pe),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new pe),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 rg(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(d=>this._activeBuffer=d.activeBuffer)),this._parser.setCsiHandlerFallback((d,p)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(d),params:p.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,p,v)=>{this._logService.debug("Unknown OSC code: ",{identifier:d,action:p,data:v})}),this._parser.setDcsHandlerFallback((d,p,v)=>{p==="HOOK"&&(v=v.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(d),action:p,payload:v})}),this._parser.setPrintHandler((d,p,v)=>this.print(d,p,v)),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(fe.BEL,()=>this.bell()),this._parser.setExecuteHandler(fe.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(fe.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(fe.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(fe.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(fe.BS,()=>this.backspace()),this._parser.setExecuteHandler(fe.HT,()=>this.tab()),this._parser.setExecuteHandler(fe.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(fe.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(Nu.IND,()=>this.index()),this._parser.setExecuteHandler(Nu.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(Nu.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new xi(d=>(this.setTitle(d),this.setIconName(d),!0))),this._parser.registerOscHandler(1,new xi(d=>this.setIconName(d))),this._parser.registerOscHandler(2,new xi(d=>this.setTitle(d))),this._parser.registerOscHandler(4,new xi(d=>this.setOrReportIndexedColor(d))),this._parser.registerOscHandler(8,new xi(d=>this.setHyperlink(d))),this._parser.registerOscHandler(10,new xi(d=>this.setOrReportFgColor(d))),this._parser.registerOscHandler(11,new xi(d=>this.setOrReportBgColor(d))),this._parser.registerOscHandler(12,new xi(d=>this.setOrReportCursorColor(d))),this._parser.registerOscHandler(104,new xi(d=>this.restoreIndexedColor(d))),this._parser.registerOscHandler(110,new xi(d=>this.restoreFgColor(d))),this._parser.registerOscHandler(111,new xi(d=>this.restoreBgColor(d))),this._parser.registerOscHandler(112,new xi(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 Mt)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 px((d,p)=>this.requestStatusString(d,p)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,s,r){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=s,this._parseStack.position=r}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,s)=>setTimeout(()=>s("#SLOW_TIMEOUT"),yx))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${yx} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let s,r=this._activeBuffer.x,o=this._activeBuffer.y,l=0,c=this._parseStack.paused;if(c){if(s=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(s),s;r=this._parseStack.cursorStartX,o=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>En&&(l=this._parseStack.position+En)}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<En&&(this._parseBuffer=new Uint32Array(Math.min(e.length,En))),c||this._dirtyRowTracker.clearRange(),e.length>En)for(let d=l;d<e.length;d+=En){let p=d+En<e.length?d+En:e.length,v=typeof e=="string"?this._stringDecoder.decode(e.substring(d,p),this._parseBuffer):this._utf8Decoder.decode(e.subarray(d,p),this._parseBuffer);if(s=this._parser.parse(this._parseBuffer,v))return this._preserveStack(r,o,v,d),this._logSlowResolvingAsync(s),s}else if(!c){let d=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(s=this._parser.parse(this._parseBuffer,d))return this._preserveStack(r,o,d,0),this._logSlowResolvingAsync(s),s}(this._activeBuffer.x!==r||this._activeBuffer.y!==o)&&this._onCursorMove.fire();let h=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),f=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);f<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(f,this._bufferService.rows-1),end:Math.min(h,this._bufferService.rows-1)})}print(e,t,s){let r,o,l=this._charsetService.charset,c=this._optionsService.rawOptions.screenReaderMode,h=this._bufferService.cols,f=this._coreService.decPrivateModes.wraparound,d=this._coreService.modes.insertMode,p=this._curAttrData,v=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&s-t>0&&v.getWidth(this._activeBuffer.x-1)===2&&v.setCellFromCodepoint(this._activeBuffer.x-1,0,1,p);let _=this._parser.precedingJoinState;for(let y=t;y<s;++y){if(r=e[y],r<127&&l){let A=l[String.fromCharCode(r)];A&&(r=A.charCodeAt(0))}let b=this._unicodeService.charProperties(r,_);o=vr.extractWidth(b);let S=vr.extractShouldJoin(b),E=S?vr.extractWidth(_):0;if(_=b,c&&this._onA11yChar.fire(Rn(r)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+o-E>h){if(f){let A=v,R=this._activeBuffer.x-E;for(this._activeBuffer.x=E,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),v=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),E>0&&v instanceof Qa&&v.copyCellsFrom(A,R,0,E,!1);R<h;)A.setCellFromCodepoint(R++,0,1,p)}else if(this._activeBuffer.x=h-1,o===2)continue}if(S&&this._activeBuffer.x){let A=v.getWidth(this._activeBuffer.x-1)?1:2;v.addCodepointToCell(this._activeBuffer.x-A,r,o);for(let R=o-E;--R>=0;)v.setCellFromCodepoint(this._activeBuffer.x++,0,0,p);continue}if(d&&(v.insertCells(this._activeBuffer.x,o-E,this._activeBuffer.getNullCell(p)),v.getWidth(h-1)===2&&v.setCellFromCodepoint(h-1,0,1,p)),v.setCellFromCodepoint(this._activeBuffer.x++,r,o,p),o>0)for(;--o;)v.setCellFromCodepoint(this._activeBuffer.x++,0,0,p)}this._parser.precedingJoinState=_,this._activeBuffer.x<h&&s-t>0&&v.getWidth(this._activeBuffer.x)===0&&!v.hasContent(this._activeBuffer.x)&&v.setCellFromCodepoint(this._activeBuffer.x,0,1,p),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,s=>_x(s.params[0],this._optionsService.rawOptions.windowOptions)?t(s):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new px(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new xi(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(){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&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.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,s,r=!1,o=!1){let l=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);l.replaceCells(t,s,this._activeBuffer.getNullCell(this._eraseAttrData()),o),r&&(l.isWrapped=!1)}_resetBufferLine(e,t=!1){let s=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);s&&(s.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),s.isWrapped=!1)}eraseInDisplay(e,t=!1){this._restrictCursor(this._bufferService.cols);let s;switch(e.params[0]){case 0:for(s=this._activeBuffer.y,this._dirtyRowTracker.markDirty(s),this._eraseInBufferLine(s++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);s<this._bufferService.rows;s++)this._resetBufferLine(s,t);this._dirtyRowTracker.markDirty(s);break;case 1:for(s=this._activeBuffer.y,this._dirtyRowTracker.markDirty(s),this._eraseInBufferLine(s,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(s+1).isWrapped=!1);s--;)this._resetBufferLine(s,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(s=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,s-1);s--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+s)?.getTrimmedLength(););for(;s>=0;s--)this._bufferService.scroll(this._eraseAttrData())}else{for(s=this._bufferService.rows,this._dirtyRowTracker.markDirty(s-1);s--;)this._resetBufferLine(s,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let r=this._activeBuffer.lines.length-this._bufferService.rows;r>0&&(this._activeBuffer.lines.trimStart(r),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-r,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-r,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 s=this._activeBuffer.ybase+this._activeBuffer.y,r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,o=this._bufferService.rows-1+this._activeBuffer.ybase-r+1;for(;t--;)this._activeBuffer.lines.splice(o-1,1),this._activeBuffer.lines.splice(s,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 s=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(s,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(St));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 s=this._activeBuffer.scrollTop;s<=this._activeBuffer.scrollBottom;++s){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+s);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 s=this._activeBuffer.scrollTop;s<=this._activeBuffer.scrollBottom;++s){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+s);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 s=this._activeBuffer.scrollTop;s<=this._activeBuffer.scrollBottom;++s){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+s);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 s=this._activeBuffer.scrollTop;s<=this._activeBuffer.scrollBottom;++s){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+s);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 s=e.params[0]||1,r=vr.extractWidth(t),o=this._activeBuffer.x-r,l=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(o),c=new Uint32Array(l.length*s),h=0;for(let d=0;d<l.length;){let p=l.codePointAt(d)||0;c[h++]=p,d+=p>65535?2:1}let f=h;for(let d=1;d<s;++d)c.copyWithin(f,0,h),f+=h;return this.print(c,0,f),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(fe.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(fe.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(fe.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(fe.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(fe.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,mr),this._charsetService.setgCharset(1,mr),this._charsetService.setgCharset(2,mr),this._charsetService.setgCharset(3,mr);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){let s;(S=>(S[S.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",S[S.SET=1]="SET",S[S.RESET=2]="RESET",S[S.PERMANENTLY_SET=3]="PERMANENTLY_SET",S[S.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(s||={});let r=this._coreService.decPrivateModes,{activeProtocol:o,activeEncoding:l}=this._coreMouseService,c=this._coreService,{buffers:h,cols:f}=this._bufferService,{active:d,alt:p}=h,v=this._optionsService.rawOptions,_=(S,E)=>(c.triggerDataEvent(`${fe.ESC}[${t?"":"?"}${S};${E}$y`),!0),y=S=>S?1:2,b=e.params[0];return t?b===2?_(b,4):b===4?_(b,y(c.modes.insertMode)):b===12?_(b,3):b===20?_(b,y(v.convertEol)):_(b,0):b===1?_(b,y(r.applicationCursorKeys)):b===3?_(b,v.windowOptions.setWinLines?f===80?2:f===132?1:0:0):b===6?_(b,y(r.origin)):b===7?_(b,y(r.wraparound)):b===8?_(b,3):b===9?_(b,y(o==="X10")):b===12?_(b,y(v.cursorBlink)):b===25?_(b,y(!c.isCursorHidden)):b===45?_(b,y(r.reverseWraparound)):b===66?_(b,y(r.applicationKeypad)):b===67?_(b,4):b===1e3?_(b,y(o==="VT200")):b===1002?_(b,y(o==="DRAG")):b===1003?_(b,y(o==="ANY")):b===1004?_(b,y(r.sendFocus)):b===1005?_(b,4):b===1006?_(b,y(l==="SGR")):b===1015?_(b,4):b===1016?_(b,y(l==="SGR_PIXELS")):b===1048?_(b,1):b===47||b===1047||b===1049?_(b,y(d===p)):b===2004?_(b,y(r.bracketedPasteMode)):b===2026?_(b,y(r.synchronizedOutput)):_(b,0)}_updateAttrColor(e,t,s,r,o){return t===2?(e|=50331648,e&=-16777216,e|=kl.fromColorRGB([s,r,o])):t===5&&(e&=-50331904,e|=33554432|s&255),e}_extractColor(e,t,s){let r=[0,0,-1,0,0,0],o=0,l=0;do{if(r[l+o]=e.params[t+l],e.hasSubParams(t+l)){let c=e.getSubParams(t+l),h=0;do r[1]===5&&(o=1),r[l+h+1+o]=c[h];while(++h<c.length&&h+l+1+o<r.length);break}if(r[1]===5&&l+o>=2||r[1]===2&&l+o>=5)break;r[1]&&(o=1)}while(++l+t<e.length&&l+o<r.length);for(let c=2;c<r.length;++c)r[c]===-1&&(r[c]=0);switch(r[0]){case 38:s.fg=this._updateAttrColor(s.fg,r[1],r[3],r[4],r[5]);break;case 48:s.bg=this._updateAttrColor(s.bg,r[1],r[3],r[4],r[5]);break;case 58:s.extended=s.extended.clone(),s.extended.underlineColor=this._updateAttrColor(s.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=St.fg,e.bg=St.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,s,r=this._curAttrData;for(let o=0;o<t;o++)s=e.params[o],s>=30&&s<=37?(r.fg&=-50331904,r.fg|=16777216|s-30):s>=40&&s<=47?(r.bg&=-50331904,r.bg|=16777216|s-40):s>=90&&s<=97?(r.fg&=-50331904,r.fg|=16777216|s-90|8):s>=100&&s<=107?(r.bg&=-50331904,r.bg|=16777216|s-100|8):s===0?this._processSGR0(r):s===1?r.fg|=134217728:s===3?r.bg|=67108864:s===4?(r.fg|=268435456,this._processUnderline(e.hasSubParams(o)?e.getSubParams(o)[0]:1,r)):s===5?r.fg|=536870912:s===7?r.fg|=67108864:s===8?r.fg|=1073741824:s===9?r.fg|=2147483648:s===2?r.bg|=134217728:s===21?this._processUnderline(2,r):s===22?(r.fg&=-134217729,r.bg&=-134217729):s===23?r.bg&=-67108865:s===24?(r.fg&=-268435457,this._processUnderline(0,r)):s===25?r.fg&=-536870913:s===27?r.fg&=-67108865:s===28?r.fg&=-1073741825:s===29?r.fg&=2147483647:s===39?(r.fg&=-67108864,r.fg|=St.fg&16777215):s===49?(r.bg&=-67108864,r.bg|=St.bg&16777215):s===38||s===48||s===58?o+=this._extractColor(e,o,r):s===53?r.bg|=1073741824:s===55?r.bg&=-1073741825:s===59?(r.extended=r.extended.clone(),r.extended.underlineColor=-1,r.updateExtended()):s===100?(r.fg&=-67108864,r.fg|=St.fg&16777215,r.bg&=-67108864,r.bg|=St.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",s);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${fe.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,s=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${fe.ESC}[${t};${s}R`);break}return!0}deviceStatusPrivate(e){if(e.params[0]===6){let t=this._activeBuffer.y+1,s=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${fe.ESC}[?${t};${s}R`)}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=St.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 s=t%2===1;this._coreService.decPrivateModes.cursorBlink=s}return!0}setScrollRegion(e){let t=e.params[0]||1,s;return(e.length<2||(s=e.params[1])>this._bufferService.rows||s===0)&&(s=this._bufferService.rows),s>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=s-1,this._setCursor(0,0)),!0}windowOptions(e){if(!_x(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(`${fe.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>vx&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>vx&&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=[],s=e.split(";");for(;s.length>1;){let r=s.shift(),o=s.shift();if(/^\d+$/.exec(r)){let l=parseInt(r);if(Sx(l))if(o==="?")t.push({type:0,index:l});else{let c=gx(o);c&&t.push({type:1,index:l,color:c})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let s=e.slice(0,t).trim(),r=e.slice(t+1);return r?this._createHyperlink(s,r):s.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let s=e.split(":"),r,o=s.findIndex(l=>l.startsWith("id="));return o!==-1&&(r=s[o].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 s=e.split(";");for(let r=0;r<s.length&&!(t>=this._specialColors.length);++r,++t)if(s[r]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let o=gx(s[r]);o&&this._onColor.fire([{type:1,index:this._specialColors[t],color:o}])}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=[],s=e.split(";");for(let r=0;r<s.length;++r)if(/^\d+$/.exec(s[r])){let o=parseInt(s[r]);Sx(o)&&t.push({type:2,index:o})}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,mr),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(nH[e[0]],Mt[e[1]]||mr),!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=St.clone(),this._eraseAttrDataInternal=St.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 Yi;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 s=this._activeBuffer.ybase+this._activeBuffer.y+t,r=this._activeBuffer.lines.get(s);r&&(r.fill(e),r.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let s=c=>(this._coreService.triggerDataEvent(`${fe.ESC}${c}${fe.ESC}\\`),!0),r=this._bufferService.buffer,o=this._optionsService.rawOptions;return s(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}[o.cursorStyle]-(o.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},rg=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&&(bx=e,e=t,t=bx),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};rg=ft([ge(0,ii)],rg);function Sx(e){return 0<=e&&e<256}var oH=5e7,wx=12,aH=50,lH=class extends Le{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 pe),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 s;for(;s=this._writeBuffer.shift();){this._action(s);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>oH)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 s=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let r=this._writeBuffer[this._bufferOffset],o=this._action(r,t);if(o){let c=h=>performance.now()-s>=wx?setTimeout(()=>this._innerWrite(0,h)):this._innerWrite(s,h);o.catch(h=>(queueMicrotask(()=>{throw h}),Promise.resolve(!1))).then(c);return}let l=this._callbacks[this._bufferOffset];if(l&&l(),this._bufferOffset++,this._pendingData-=r.length,performance.now()-s>=wx)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>aH&&(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()}},og=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 h=t.addMarker(t.ybase+t.y),f={data:e,id:this._nextId++,lines:[h]};return h.onDispose(()=>this._removeMarkerFromLink(f,h)),this._dataByLinkId.set(f.id,f),f.id}let s=e,r=this._getEntryIdKey(s),o=this._entriesWithId.get(r);if(o)return this.addLineToLink(o.id,t.ybase+t.y),o.id;let l=t.addMarker(t.ybase+t.y),c={id:this._nextId++,key:this._getEntryIdKey(s),data:s,lines:[l]};return l.onDispose(()=>this._removeMarkerFromLink(c,l)),this._entriesWithId.set(c.key,c),this._dataByLinkId.set(c.id,c),c.id}addLineToLink(e,t){let s=this._dataByLinkId.get(e);if(s&&s.lines.every(r=>r.line!==t)){let r=this._bufferService.buffer.addMarker(t);s.lines.push(r),r.onDispose(()=>this._removeMarkerFromLink(s,r))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let s=e.lines.indexOf(t);s!==-1&&(e.lines.splice(s,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};og=ft([ge(0,ii)],og);var xx=!1,cH=class extends Le{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new Lo),this._onBinary=this._register(new pe),this.onBinary=this._onBinary.event,this._onData=this._register(new pe),this.onData=this._onData.event,this._onLineFeed=this._register(new pe),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new pe),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new pe),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new pe),this._instantiationService=new N8,this.optionsService=this._register(new F8(e)),this._instantiationService.setService(si,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(tg)),this._instantiationService.setService(ii,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(eg)),this._instantiationService.setService(Q2,this._logService),this.coreService=this._register(this._instantiationService.createInstance(ig)),this._instantiationService.setService(kr,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(sg)),this._instantiationService.setService(Z2,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(vr)),this._instantiationService.setService(Rz,this.unicodeService),this._charsetService=this._instantiationService.createInstance(G8),this._instantiationService.setService(Az,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(og),this._instantiationService.setService(J2,this._oscLinkService),this._inputHandler=this._register(new rH(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(Wt.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(Wt.forward(this._bufferService.onResize,this._onResize)),this._register(Wt.forward(this.coreService.onData,this._onData)),this._register(Wt.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 lH((t,s)=>this._inputHandler.parse(t,s))),this._register(Wt.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new pe),this._onScroll.event(e=>{this._onScrollApi?.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&&!xx&&(this._logService.warn("writeSync is unreliable and will be removed soon."),xx=!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,DT),t=Math.max(t,OT),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(mx.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(mx(this._bufferService),!1))),this._windowsWrappingHeuristics.value=rt(()=>{for(let t of e)t.dispose()})}}},uH={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 hH(e,t,s,r){let o={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?o.key=fe.ESC+"OA":o.key=fe.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?o.key=fe.ESC+"OD":o.key=fe.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?o.key=fe.ESC+"OC":o.key=fe.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?o.key=fe.ESC+"OB":o.key=fe.ESC+"[B");break;case 8:o.key=e.ctrlKey?"\b":fe.DEL,e.altKey&&(o.key=fe.ESC+o.key);break;case 9:if(e.shiftKey){o.key=fe.ESC+"[Z";break}o.key=fe.HT,o.cancel=!0;break;case 13:o.key=e.altKey?fe.ESC+fe.CR:fe.CR,o.cancel=!0;break;case 27:o.key=fe.ESC,e.altKey&&(o.key=fe.ESC+fe.ESC),o.cancel=!0;break;case 37:if(e.metaKey)break;l?o.key=fe.ESC+"[1;"+(l+1)+"D":t?o.key=fe.ESC+"OD":o.key=fe.ESC+"[D";break;case 39:if(e.metaKey)break;l?o.key=fe.ESC+"[1;"+(l+1)+"C":t?o.key=fe.ESC+"OC":o.key=fe.ESC+"[C";break;case 38:if(e.metaKey)break;l?o.key=fe.ESC+"[1;"+(l+1)+"A":t?o.key=fe.ESC+"OA":o.key=fe.ESC+"[A";break;case 40:if(e.metaKey)break;l?o.key=fe.ESC+"[1;"+(l+1)+"B":t?o.key=fe.ESC+"OB":o.key=fe.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(o.key=fe.ESC+"[2~");break;case 46:l?o.key=fe.ESC+"[3;"+(l+1)+"~":o.key=fe.ESC+"[3~";break;case 36:l?o.key=fe.ESC+"[1;"+(l+1)+"H":t?o.key=fe.ESC+"OH":o.key=fe.ESC+"[H";break;case 35:l?o.key=fe.ESC+"[1;"+(l+1)+"F":t?o.key=fe.ESC+"OF":o.key=fe.ESC+"[F";break;case 33:e.shiftKey?o.type=2:e.ctrlKey?o.key=fe.ESC+"[5;"+(l+1)+"~":o.key=fe.ESC+"[5~";break;case 34:e.shiftKey?o.type=3:e.ctrlKey?o.key=fe.ESC+"[6;"+(l+1)+"~":o.key=fe.ESC+"[6~";break;case 112:l?o.key=fe.ESC+"[1;"+(l+1)+"P":o.key=fe.ESC+"OP";break;case 113:l?o.key=fe.ESC+"[1;"+(l+1)+"Q":o.key=fe.ESC+"OQ";break;case 114:l?o.key=fe.ESC+"[1;"+(l+1)+"R":o.key=fe.ESC+"OR";break;case 115:l?o.key=fe.ESC+"[1;"+(l+1)+"S":o.key=fe.ESC+"OS";break;case 116:l?o.key=fe.ESC+"[15;"+(l+1)+"~":o.key=fe.ESC+"[15~";break;case 117:l?o.key=fe.ESC+"[17;"+(l+1)+"~":o.key=fe.ESC+"[17~";break;case 118:l?o.key=fe.ESC+"[18;"+(l+1)+"~":o.key=fe.ESC+"[18~";break;case 119:l?o.key=fe.ESC+"[19;"+(l+1)+"~":o.key=fe.ESC+"[19~";break;case 120:l?o.key=fe.ESC+"[20;"+(l+1)+"~":o.key=fe.ESC+"[20~";break;case 121:l?o.key=fe.ESC+"[21;"+(l+1)+"~":o.key=fe.ESC+"[21~";break;case 122:l?o.key=fe.ESC+"[23;"+(l+1)+"~":o.key=fe.ESC+"[23~";break;case 123:l?o.key=fe.ESC+"[24;"+(l+1)+"~":o.key=fe.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?o.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?o.key=fe.NUL:e.keyCode>=51&&e.keyCode<=55?o.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?o.key=fe.DEL:e.keyCode===219?o.key=fe.ESC:e.keyCode===220?o.key=fe.FS:e.keyCode===221&&(o.key=fe.GS);else if((!s||r)&&e.altKey&&!e.metaKey){let c=uH[e.keyCode]?.[e.shiftKey?1:0];if(c)o.key=fe.ESC+c;else if(e.keyCode>=65&&e.keyCode<=90){let h=e.ctrlKey?e.keyCode-64:e.keyCode+32,f=String.fromCharCode(h);e.shiftKey&&(f=f.toUpperCase()),o.key=fe.ESC+f}else if(e.keyCode===32)o.key=fe.ESC+(e.ctrlKey?fe.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let h=e.code.slice(3,4);e.shiftKey||(h=h.toLowerCase()),o.key=fe.ESC+h,o.cancel=!0}}else s&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(o.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?o.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(o.key=fe.US),e.key==="@"&&(o.key=fe.NUL));break}return o}var gt=0,dH=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new nh,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new nh,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((o,l)=>this._getKey(o)-this._getKey(l)),t=0,s=0,r=new Array(this._array.length+this._insertedValues.length);for(let o=0;o<r.length;o++)s>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[s])?(r[o]=e[t],t++):r[o]=this._array[s++];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||(gt=this._search(t),gt===-1)||this._getKey(this._array[gt])!==t)return!1;do if(this._array[gt]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(gt),!0;while(++gt<this._array.length&&this._getKey(this._array[gt])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((o,l)=>o-l),t=0,s=new Array(this._array.length-e.length),r=0;for(let o=0;o<this._array.length;o++)e[t]===o?t++:s[r++]=this._array[o];this._array=s,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&&(gt=this._search(e),!(gt<0||gt>=this._array.length)&&this._getKey(this._array[gt])===e))do yield this._array[gt];while(++gt<this._array.length&&this._getKey(this._array[gt])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(gt=this._search(e),!(gt<0||gt>=this._array.length)&&this._getKey(this._array[gt])===e))do t(this._array[gt]);while(++gt<this._array.length&&this._getKey(this._array[gt])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,s=this._array.length-1;for(;s>=t;){let r=t+s>>1,o=this._getKey(this._array[r]);if(o>e)s=r-1;else if(o<e)t=r+1;else{for(;r>0&&this._getKey(this._array[r-1])===e;)r--;return r}}return t}},Hm=0,Cx=0,fH=class extends Le{constructor(){super(),this._decorations=new dH(e=>e?.marker.line),this._onDecorationRegistered=this._register(new pe),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new pe),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(rt(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new mH(e);if(t){let s=t.marker.onDispose(()=>t.dispose()),r=t.onDispose(()=>{r.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),s.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,s){let r=0,o=0;for(let l of this._decorations.getKeyIterator(t))r=l.options.x??0,o=r+(l.options.width??1),e>=r&&e<o&&(!s||(l.options.layer??"bottom")===s)&&(yield l)}forEachDecorationAtCell(e,t,s,r){this._decorations.forEachByKey(t,o=>{Hm=o.options.x??0,Cx=Hm+(o.options.width??1),e>=Hm&&e<Cx&&(!s||(o.options.layer??"bottom")===s)&&r(o)})}},mH=class extends On{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new pe),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new pe),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=at.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=at.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},pH=1e3,gH=class{constructor(e,t=pH){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,s){this._rowCount=s,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 o=r-this._lastRefreshMs,l=this._debounceThresholdMS-o;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)}},Ex=20,rh=class extends Le{constructor(e,t,s,r){super(),this._terminal=e,this._coreBrowserService=s,this._renderService=r,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let o=this._coreBrowserService.mainDocument;this._accessibilityContainer=o.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=o.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=o.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new gH(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(`
|
|
71
|
+
`))),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(Te(o,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(rt(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<Ex+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
72
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===Ex+1&&(this._liveRegion.textContent+=Tp.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 s=this._terminal.buffer,r=s.lines.length.toString();for(let o=e;o<=t;o++){let l=s.lines.get(s.ydisp+o),c=[],h=l?.translateToString(!0,void 0,void 0,c)||"",f=(s.ydisp+o+1).toString(),d=this._rowElements[o];d&&(h.length===0?(d.textContent=" ",this._rowColumns.set(d,[0,1])):(d.textContent=h,this._rowColumns.set(d,c)),d.setAttribute("aria-posinset",f),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 s=e.target,r=this._rowElements[t===0?1:this._rowElements.length-2],o=s.getAttribute("aria-posinset"),l=t===0?"1":`${this._terminal.buffer.lines.length}`;if(o===l||e.relatedTarget!==r)return;let c,h;if(t===0?(c=s,h=this._rowElements.pop(),this._rowContainer.removeChild(h)):(c=this._rowElements.shift(),h=s,this._rowContainer.removeChild(c)),c.removeEventListener("focus",this._topBoundaryFocusListener),h.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let f=this._createAccessibilityTreeNode();this._rowElements.unshift(f),this._rowContainer.insertAdjacentElement("afterbegin",f)}else{let f=this._createAccessibilityTreeNode();this._rowElements.push(f),this._rowContainer.appendChild(f)}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(){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},s={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(s.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===s.node&&t.offset>s.offset)&&([t,s]=[s,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(s.node.compareDocumentPosition(r)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(s={node:r,offset:r.textContent?.length??0}),!this._rowContainer.contains(s.node))return;let o=({node:h,offset:f})=>{let d=h instanceof Text?h.parentNode:h,p=parseInt(d?.getAttribute("aria-posinset"),10)-1;if(isNaN(p))return console.warn("row is invalid. Race condition?"),null;let v=this._rowColumns.get(d);if(!v)return console.warn("columns is null. Race condition?"),null;let _=f<v.length?v[f]:v.slice(-1)[0]+1;return _>=this._terminal.cols&&(++p,_=0),{row:p,column:_}},l=o(t),c=o(s);if(!(!l||!c)){if(l.row>c.row||l.row===c.row&&l.column>=c.column)throw new Error("invalid range");this._terminal.select(l.column,l.row,(c.row-l.row)*this._terminal.cols-l.column+c.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){e.style.transform="";let t=e.getBoundingClientRect().width,s=this._rowColumns.get(e)?.slice(-1)?.[0];if(!s)return;let r=s*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${r/t})`}};rh=ft([ge(1,ov),ge(2,qs),ge(3,Gs)],rh);var ag=class extends Le{constructor(e,t,s,r,o){super(),this._element=e,this._mouseService=t,this._renderService=s,this._bufferService=r,this._linkProviderService=o,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new pe),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new pe),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(rt(()=>{xr(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(Te(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Te(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(Te(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(Te(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 s=e.composedPath();for(let r=0;r<s.length;r++){let o=s[r];if(o.classList.contains("xterm"))break;if(o.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){(!this._activeProviderReplies||!t)&&(this._activeProviderReplies?.forEach(r=>{r?.forEach(o=>{o.link.dispose&&o.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let s=!1;for(let[r,o]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(r)&&(s=this._checkLinkProviderResult(r,e,s)):o.provideLinks(e.y,l=>{if(this._isMouseOut)return;let c=l?.map(h=>({link:h}));this._activeProviderReplies?.set(r,c),s=this._checkLinkProviderResult(r,e,s),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let s=new Set;for(let r=0;r<t.size;r++){let o=t.get(r);if(o)for(let l=0;l<o.length;l++){let c=o[l],h=c.link.range.start.y<e?0:c.link.range.start.x,f=c.link.range.end.y>e?this._bufferService.cols:c.link.range.end.x;for(let d=h;d<=f;d++){if(s.has(d)){o.splice(l--,1);break}s.add(d)}}}}_checkLinkProviderResult(e,t,s){if(!this._activeProviderReplies)return s;let r=this._activeProviderReplies.get(e),o=!1;for(let l=0;l<e;l++)(!this._activeProviderReplies.has(l)||this._activeProviderReplies.get(l))&&(o=!0);if(!o&&r){let l=r.find(c=>this._linkAtPosition(c.link,t));l&&(s=!0,this._handleNewLink(l))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!s)for(let l=0;l<this._activeProviderReplies.size;l++){let c=this._activeProviderReplies.get(l)?.find(h=>this._linkAtPosition(h.link,t));if(c){s=!0,this._handleNewLink(c);break}}return s}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&vH(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,xr(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:()=>this._currentLink?.state?.decorations.pointerCursor,set:s=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==s&&(this._currentLink.state.decorations.pointerCursor=s,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",s))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:s=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==s&&(this._currentLink.state.decorations.underline=s,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,s))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(s=>{if(!this._currentLink)return;let r=s.start===0?0:s.start+1+this._bufferService.buffer.ydisp,o=this._bufferService.buffer.ydisp+1+s.end;if(this._currentLink.link.range.start.y>=r&&this._currentLink.link.range.end.y<=o&&(this._clearCurrentLink(r,o),this._lastMouseEvent)){let l=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);l&&this._askForLink(l,!1)}})))}_linkHover(e,t,s){this._currentLink?.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(s,t.text)}_fireUnderlineEvent(e,t){let s=e.range,r=this._bufferService.buffer.ydisp,o=this._createLinkUnderlineEvent(s.start.x-1,s.start.y-r-1,s.end.x,s.end.y-r-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(o)}_linkLeave(e,t,s){this._currentLink?.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(s,t.text)}_linkAtPosition(e,t){let s=e.range.start.y*this._bufferService.cols+e.range.start.x,r=e.range.end.y*this._bufferService.cols+e.range.end.x,o=t.y*this._bufferService.cols+t.x;return s<=o&&o<=r}_positionFromMouseEvent(e,t,s){let r=s.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,s,r,o){return{x1:e,y1:t,x2:s,y2:r,cols:this._bufferService.cols,fg:o}}};ag=ft([ge(1,av),ge(2,Gs),ge(3,ii),ge(4,tT)],ag);function vH(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 _H=class extends cH{constructor(e={}){super(e),this._linkifier=this._register(new Lo),this.browser=bT,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new Lo),this._onCursorMove=this._register(new pe),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new pe),this.onKey=this._onKey.event,this._onRender=this._register(new pe),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new pe),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new pe),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new pe),this.onBell=this._onBell.event,this._onFocus=this._register(new pe),this._onBlur=this._register(new pe),this._onA11yCharEmitter=this._register(new pe),this._onA11yTabEmitter=this._register(new pe),this._onWillOpen=this._register(new pe),this._setup(),this._decorationService=this._instantiationService.createInstance(fH),this._instantiationService.setService(Al,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(a8),this._instantiationService.setService(tT,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(Ap)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh(t?.start??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(Wt.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(Wt.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(Wt.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(Wt.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(rt(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.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 s,r="";switch(t.index){case 256:s="foreground",r="10";break;case 257:s="background",r="11";break;case 258:s="cursor",r="12";break;default:s="ansi",r="4;"+t.index}switch(t.type){case 0:let o=st.toColorRGB(s==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[s]);this.coreService.triggerDataEvent(`${fe.ESC}]${r};${sH(o)}${_T.ST}`);break;case 1:if(s==="ansi")this._themeService.modifyColors(l=>l.ansi[t.index]=xt.toColor(...t.color));else{let l=s;this._themeService.modifyColors(c=>c[l]=xt.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(rh,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(fe.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(fe.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 s=Math.min(this.buffer.x,this.cols-1),r=this._renderService.dimensions.css.cell.height,o=t.getWidth(s),l=this._renderService.dimensions.css.cell.width*o,c=this.buffer.y*this._renderService.dimensions.css.cell.height,h=s*this._renderService.dimensions.css.cell.width;this.textarea.style.left=h+"px",this.textarea.style.top=c+"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(Te(this.element,"copy",t=>{this.hasSelection()&&wz(t,this._selectionService)}));let e=t=>xz(t,this.textarea,this.coreService,this.optionsService);this._register(Te(this.textarea,"paste",e)),this._register(Te(this.element,"paste",e)),ST?this._register(Te(this.element,"mousedown",t=>{t.button===2&&Bw(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Te(this.element,"contextmenu",t=>{Bw(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),pv&&this._register(Te(this.element,"auxclick",t=>{t.button===1&&K2(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Te(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(Te(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(Te(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(Te(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(Te(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(Te(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(Te(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){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"),this.element?.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(Te(this.screenElement,"mousemove",o=>this.updateCursorStyle(o))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let s=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",Ep.get()),CT||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",()=>s.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(r8,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(qs,this._coreBrowserService),this._register(Te(this.textarea,"focus",o=>this._handleTextAreaFocus(o))),this._register(Te(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance($p,this._document,this._helperContainer),this._instantiationService.setService(Th,this._charSizeService),this._themeService=this._instantiationService.createInstance(Jp),this._instantiationService.setService(Uo,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(ih),this._instantiationService.setService(eT,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(Zp,this.rows,this.screenElement)),this._instantiationService.setService(Gs,this._renderService),this._register(this._renderService.onRenderedViewportChange(o=>this._onRender.fire(o))),this.onResize(o=>this._renderService.resize(o.cols,o.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(Kp,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(Xp),this._instantiationService.setService(av,this._mouseService);let r=this._linkifier.value=this._register(this._instantiationService.createInstance(ag,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(Wp,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(o=>{super.scrollLines(o,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(Qp,this.element,this.screenElement,r)),this._instantiationService.setService(Dz,this._selectionService),this._register(this._selectionService.onRequestScrollLines(o=>this.scrollLines(o.amount,o.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(o=>this._renderService.handleSelectionChanged(o.start,o.end,o.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(o=>{this.textarea.value=o,this.textarea.focus(),this.textarea.select()})),this._register(Wt.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(Yp,this.screenElement)),this._register(Te(this.element,"mousedown",o=>this._selectionService.handleMouseDown(o))),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(rh,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",o=>this._handleScreenReaderModeOptionChange(o))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(th,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",o=>{!this._overviewRulerRenderer&&o&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(th,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(Gp,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function s(l){let c=e._mouseService.getMouseReportCoords(l,e.screenElement);if(!c)return!1;let h,f;switch(l.overrideType||l.type){case"mousemove":f=32,l.buttons===void 0?(h=3,l.button!==void 0&&(h=l.button<3?l.button:3)):h=l.buttons&1?0:l.buttons&4?1:l.buttons&2?2:3;break;case"mouseup":f=0,h=l.button<3?l.button:3;break;case"mousedown":f=1,h=l.button<3?l.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(l)===!1)return!1;let d=l.deltaY;if(d===0||e.coreMouseService.consumeWheelEvent(l,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;f=d<0?0:1,h=4;break;default:return!1}return f===void 0||h===void 0||h>4?!1:e.coreMouseService.triggerMouseEvent({col:c.col,row:c.row,x:c.x,y:c.y,button:h,action:f,ctrl:l.ctrlKey,alt:l.altKey,shift:l.shiftKey})}let r={mouseup:null,wheel:null,mousedrag:null,mousemove:null},o={mouseup:l=>(s(l),l.buttons||(this._document.removeEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.removeEventListener("mousemove",r.mousedrag)),this.cancel(l)),wheel:l=>(s(l),this.cancel(l,!0)),mousedrag:l=>{l.buttons&&s(l)},mousemove:l=>{l.buttons||s(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",o.mousemove),r.mousemove=o.mousemove):(t.removeEventListener("mousemove",r.mousemove),r.mousemove=null),l&16?r.wheel||(t.addEventListener("wheel",o.wheel,{passive:!1}),r.wheel=o.wheel):(t.removeEventListener("wheel",r.wheel),r.wheel=null),l&2?r.mouseup||(r.mouseup=o.mouseup):(this._document.removeEventListener("mouseup",r.mouseup),r.mouseup=null),l&4?r.mousedrag||(r.mousedrag=o.mousedrag):(this._document.removeEventListener("mousemove",r.mousedrag),r.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Te(t,"mousedown",l=>{if(l.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(l)))return s(l),r.mouseup&&this._document.addEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.addEventListener("mousemove",r.mousedrag),this.cancel(l)})),this._register(Te(t,"wheel",l=>{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,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(l,!0);let c=fe.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(l.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(c,!0),this.cancel(l,!0)}}},{passive:!1}))}refresh(e,t){this._renderService?.refreshRows(e,t)}updateCursorStyle(e){this._selectionService?.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){Y2(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,s){this._selectionService.setSelection(e,t,s)}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(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,t){this._selectionService?.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 s=hH(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),s.type===3||s.type===2){let r=this.rows-1;return this.scrollLines(s.type===2?-r:r),this.cancel(e,!0)}if(s.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(s.cancel&&this.cancel(e,!0),!s.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((s.key===fe.ETX||s.key===fe.CR)&&(this.textarea.value=""),this._onKey.fire({key:s.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(s.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let s=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"?s:s&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(yH(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){this._charSizeService?.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(St));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(fe.ESC+"[I"):this.coreService.triggerDataEvent(fe.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),s=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${fe.ESC}[4;${s};${t}t`);break;case 1:let r=this._renderService.dimensions.css.cell.width.toFixed(0),o=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${fe.ESC}[6;${o};${r}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function yH(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var bH=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let s={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(s),t.dispose=()=>this._wrappedAddonDispose(s),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let s=0;s<this._addons.length;s++)if(this._addons[s]===e){t=s;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)}},SH=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 Yi)}translateToString(e,t,s){return this._line.translateToString(e,t,s)}},Tx=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 SH(t)}getNullCell(){return new Yi}},wH=class extends Le{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new pe),this.onBufferChange=this._onBufferChange.event,this._normal=new Tx(this._core.buffers.normal,"normal"),this._alternate=new Tx(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)}},xH=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,s=>t(s.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(s,r)=>t(s,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)}},CH=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}},EH=["cols","rows"],ls=0,TH=class extends Le{constructor(e){super(),this._core=this._register(new _H(e)),this._addonManager=this._register(new bH),this._publicOptions={...this._core.options};let t=r=>this._core.options[r],s=(r,o)=>{this._checkReadonlyOptions(r),this._core.options[r]=o};for(let r in this._core.options){let o={get:t.bind(this,r),set:s.bind(this,r)};Object.defineProperty(this._publicOptions,r,o)}}_checkReadonlyOptions(e){if(EH.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 xH(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new CH(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 wH(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,s){this._verifyIntegers(e,t,s),this._core.select(e,t,s)}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
|
|
73
|
+
`,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 Ep.get()},set promptLabel(e){Ep.set(e)},get tooMuchOutput(){return Tp.get()},set tooMuchOutput(e){Tp.set(e)}}}_verifyIntegers(...e){for(ls of e)if(ls===1/0||isNaN(ls)||ls%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(ls of e)if(ls&&(ls===1/0||isNaN(ls)||ls%1!==0||ls<0))throw new Error("This API only accepts positive integers")}};var kH=2,AH=1,RH=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(){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:this._terminal.options.overviewRuler?.width||14,s=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(s.getPropertyValue("height")),o=Math.max(0,parseInt(s.getPropertyValue("width"))),l=window.getComputedStyle(this._terminal.element),c={top:parseInt(l.getPropertyValue("padding-top")),bottom:parseInt(l.getPropertyValue("padding-bottom")),right:parseInt(l.getPropertyValue("padding-right")),left:parseInt(l.getPropertyValue("padding-left"))},h=c.top+c.bottom,f=c.right+c.left,d=r-h,p=o-f-t;return{cols:Math.max(kH,Math.floor(p/e.css.cell.width)),rows:Math.max(AH,Math.floor(d/e.css.cell.height))}}};const MH=x.forwardRef(function({visible:t},s){const r=x.useRef(null),o=x.useRef(null),l=x.useRef(null),c=x.useRef(null),h=x.useRef(!1),f=x.useRef(!1),d=x.useCallback(()=>{const v=window.location.protocol==="https:"?"wss:":"ws:",_=new WebSocket(`${v}//${window.location.host}/ws/terminal`);c.current=_,f.current=!1,_.onopen=()=>{const y=o.current,b=l.current;y&&b&&(b.fit(),_.send(JSON.stringify({type:"resize",cols:y.cols,rows:y.rows})))},_.onmessage=y=>{const b=y.data;try{const S=JSON.parse(b);if(S.type==="exit"){f.current=!0,o.current?.writeln(`\r
|
|
74
|
+
\x1B[90mProcess exited (code ${S.code}). Press any key to restart.\x1B[0m`);return}}catch{}o.current?.write(b)},_.onclose=()=>{f.current||(o.current?.writeln(`\r
|
|
75
|
+
\x1B[90mDisconnected. Reconnecting...\x1B[0m`),setTimeout(d,2e3))},_.onerror=()=>{_.close()}},[]),p=x.useCallback(()=>{f.current=!0,c.current?.close(),c.current=null;const v=o.current;v&&(v.clear(),v.reset()),setTimeout(()=>d(),0)},[d]);return x.useImperativeHandle(s,()=>({resetSession:p}),[p]),x.useEffect(()=>{if(h.current||!r.current)return;h.current=!0;const v=new TH({cursorBlink:!0,fontSize:13,fontFamily:'Menlo, Monaco, "Courier New", monospace',theme:{background:"#0d1117",foreground:"#e6edf3",cursor:"#e6edf3",selectionBackground:"#264f78",black:"#484f58",red:"#ff7b72",green:"#3fb950",yellow:"#d29922",blue:"#58a6ff",magenta:"#bc8cff",cyan:"#39d353",white:"#b1bac4",brightBlack:"#6e7681",brightRed:"#ffa198",brightGreen:"#56d364",brightYellow:"#e3b341",brightBlue:"#79c0ff",brightMagenta:"#d2a8ff",brightCyan:"#56d364",brightWhite:"#f0f6fc"}}),_=new RH;return v.loadAddon(_),v.open(r.current),_.fit(),o.current=v,l.current=_,v.onData(y=>{if(f.current){f.current=!1,v.clear(),c.current?.close(),d();return}const b=c.current;b&&b.readyState===WebSocket.OPEN&&b.send(y)}),d(),()=>{c.current?.close(),v.dispose()}},[d]),x.useEffect(()=>{if(!t||!r.current)return;const v=l.current;if(!v)return;const _=setTimeout(()=>{v.fit();const b=o.current,S=c.current;b&&S&&S.readyState===WebSocket.OPEN&&S.send(JSON.stringify({type:"resize",cols:b.cols,rows:b.rows}))},50),y=new ResizeObserver(()=>{v.fit();const b=o.current,S=c.current;b&&S&&S.readyState===WebSocket.OPEN&&S.send(JSON.stringify({type:"resize",cols:b.cols,rows:b.rows}))});return y.observe(r.current),()=>{clearTimeout(_),y.disconnect()}},[t]),C.jsx("div",{ref:r,className:"h-full w-full",style:{display:t?"block":"none"}})}),kx=40;function DH(){const{data:e,loading:t,lastUpdated:s,error:r}=gL(),{data:o,loading:l}=vL(),{data:c,loading:h}=_L(),{data:f}=xL(),d=f?.name||"beads-board",p=t||l||h,v=!p&&r?r:null,[_,y]=x.useState(null),[b,S]=x.useState(null),[E,A]=x.useState(!1),[R,M]=x.useState({priority:"all",type:"all",assignee:"all"}),[k,j]=x.useState(null),F=x.useRef(null),W=x.useRef(null),[V,ee]=x.useState(()=>localStorage.getItem("beads-board-terminal-open")==="true"),[U,G]=x.useState(()=>{const J=localStorage.getItem("beads-board-terminal-height");return J?Number(J):300}),z=Tm(e||[],R),L=Tm(o||[],R),P=Tm(c||[],R),q=x.useCallback((J,ie)=>{S(ie||null),y(J),j(J),F.current&&clearTimeout(F.current),F.current=setTimeout(()=>j(null),4e3),requestAnimationFrame(()=>{const ue=document.querySelector(`[data-commit-beads~="${J}"]`);ue&&ue.scrollIntoView({behavior:"smooth",block:"center"})})},[]),T=x.useCallback(J=>{j(null),F.current&&clearTimeout(F.current);const ie=document.querySelector(`[data-bead-id="${J}"]`);ie&&(ie.scrollIntoView({behavior:"smooth",block:"center"}),ie.classList.remove("animate-bead-highlight"),ie.offsetWidth,ie.classList.add("animate-bead-highlight"),setTimeout(()=>ie.classList.remove("animate-bead-highlight"),1200)),S(null),y(J)},[]),H=x.useRef(null),[B,te]=x.useState(()=>{const J=localStorage.getItem("beads-board-split");return J?Number(J):65}),[X,N]=x.useState(()=>localStorage.getItem("beads-board-git-collapsed")==="true"),Z=x.useRef(null),ne=x.useRef(null),I=x.useRef(0),O=x.useCallback(()=>{N(J=>{const ie=!J;return localStorage.setItem("beads-board-git-collapsed",String(ie)),ie})},[]),Y=x.useCallback(J=>{J.preventDefault();const ie=H.current,ue=Z.current,me=ne.current;if(!ie||!ue||!me)return;X&&(N(!1),localStorage.setItem("beads-board-git-collapsed","false")),ue.style.transition="none",me.style.transition="none";const _e=ke=>{cancelAnimationFrame(I.current),I.current=requestAnimationFrame(()=>{const qe=ie.getBoundingClientRect(),Xt=(ke.clientX-qe.left)/qe.width*100,Ri=Math.min(85,Math.max(30,Xt));ue.style.width=`${Ri}%`,me.style.width=`${100-Ri}%`,K.current=Ri})},xe=()=>{cancelAnimationFrame(I.current),document.removeEventListener("mousemove",_e),document.removeEventListener("mouseup",xe),ue.style.transition="",me.style.transition="",document.body.style.cursor="",document.body.style.userSelect="";const ke=K.current;te(ke),localStorage.setItem("beads-board-split",String(ke))};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",_e),document.addEventListener("mouseup",xe)},[X]),K=x.useRef(B);return K.current=B,x.useEffect(()=>{document.title=d},[d]),x.useEffect(()=>{const J=ie=>{ie.key==="`"&&(ie.ctrlKey||ie.metaKey)&&(ie.preventDefault(),ee(ue=>{const me=!ue;return localStorage.setItem("beads-board-terminal-open",String(me)),me}))};return window.addEventListener("keydown",J),()=>window.removeEventListener("keydown",J)},[]),C.jsxs("div",{className:"h-screen flex flex-col bg-background text-foreground overflow-hidden",children:[C.jsxs("header",{className:"flex items-center justify-between px-4 py-2 border-b border-border shrink-0",children:[C.jsx("h1",{className:"text-lg font-bold tracking-tight",children:d}),C.jsxs("div",{className:"flex items-center gap-3",children:[s&&C.jsxs("span",{className:"text-xs text-muted-foreground",children:["Updated ",s.toLocaleTimeString()]}),p&&C.jsx("span",{className:"text-xs text-muted-foreground animate-pulse",children:"refreshing..."}),C.jsx("button",{onClick:()=>A(J=>!J),className:`rounded-md p-2 transition-colors ${E?"bg-primary/15 text-primary hover:bg-primary/25":"hover:bg-muted text-muted-foreground hover:text-foreground"}`,title:E?"Show kanban board":"Show dependency graph",children:C.jsx(U5,{className:"h-4 w-4"})}),C.jsx("button",{onClick:()=>ee(J=>{const ie=!J;return localStorage.setItem("beads-board-terminal-open",String(ie)),ie}),className:`rounded-md p-2 transition-colors ${V?"bg-primary/15 text-primary hover:bg-primary/25":"hover:bg-muted text-muted-foreground hover:text-foreground"}`,title:V?"Hide terminal (Ctrl+`)":"Show terminal (Ctrl+`)",children:C.jsx(G5,{className:"h-4 w-4"})}),C.jsx(OL,{})]})]}),v&&C.jsxs("div",{className:"bg-destructive/10 text-destructive px-4 py-2 text-sm border-b border-destructive/20",children:[v," — showing last known data"]}),!E&&C.jsx(vz,{filters:R,onFiltersChange:M,issues:e||[]}),E?C.jsx("main",{className:"flex-1 min-h-0",children:C.jsx(mz,{issues:e||[],onNodeClick:J=>{S(null),y(J)}})}):C.jsxs("main",{ref:H,className:"flex flex-1 min-h-0",children:[C.jsxs("div",{ref:Z,style:X?{width:`calc(100% - ${kx}px - 4px)`}:{width:`${B}%`},className:"flex flex-col overflow-hidden transition-[width] duration-200",children:[C.jsx("div",{className:"flex-1 min-h-0 pl-3 pt-3 pb-3 pr-0 overflow-hidden",children:C.jsx(rL,{issues:z,ready:L,blocked:P,loading:p,onIssueClick:q})}),V&&C.jsx("div",{className:"h-1 cursor-row-resize hover:bg-border active:bg-primary/50 shrink-0 transition-colors border-t border-border",onMouseDown:J=>{J.preventDefault();const ie=J.clientY,ue=U,me=xe=>{const ke=ie-xe.clientY,qe=Math.max(100,Math.min(ue+ke,window.innerHeight*.7));G(qe),localStorage.setItem("beads-board-terminal-height",String(qe))},_e=()=>{document.removeEventListener("mousemove",me),document.removeEventListener("mouseup",_e),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="row-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",me),document.addEventListener("mouseup",_e)}}),C.jsxs("div",{style:{height:V?`${U}px`:"0px"},className:"shrink-0 overflow-hidden flex flex-col",children:[V&&C.jsxs("div",{className:"flex items-center justify-end gap-1 px-2 py-0.5 bg-[#0d1117] border-b border-border/30 shrink-0",children:[C.jsx("button",{onClick:()=>W.current?.resetSession(),className:"rounded p-1 text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",title:"Clear session",children:C.jsx(X5,{className:"h-3.5 w-3.5"})}),C.jsx("button",{onClick:()=>{ee(!1),localStorage.setItem("beads-board-terminal-open","false")},className:"rounded p-1 text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",title:"Hide terminal (Ctrl+`)",children:C.jsx(XC,{className:"h-3.5 w-3.5"})})]}),C.jsx(MH,{ref:W,visible:V})]})]}),C.jsx("div",{className:"w-1 cursor-col-resize hover:bg-border active:bg-primary/50 shrink-0 transition-colors",onMouseDown:Y}),X?C.jsx("div",{style:{width:`${kx}px`},className:"flex flex-col items-center border-l border-border shrink-0 transition-[width] duration-200",children:C.jsx("button",{onClick:O,className:"mt-3 p-1.5 rounded-md hover:bg-accent text-muted-foreground hover:text-foreground transition-colors",title:"Expand git log",children:C.jsx(K5,{className:"h-4 w-4"})})}):C.jsx("div",{ref:ne,style:{width:`${100-B}%`},className:"overflow-hidden transition-[width] duration-200",children:C.jsx(ML,{onCollapse:O,onBeadClick:T,highlightedBeadId:k})})]}),C.jsx(B6,{issueId:_,open:_!==null,onClose:()=>y(null),sourceRect:b})]})}hR.createRoot(document.getElementById("root")).render(C.jsx(x.StrictMode,{children:C.jsx(DH,{})}));
|