@citadel-labs/beads-ui 2.0.7 → 2.3.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/README.md +2 -1
- package/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/clover.xml +153 -0
- package/coverage/coverage-final.json +2 -0
- package/coverage/favicon.png +0 -0
- package/coverage/handlers.js.html +892 -0
- package/coverage/index.html +116 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +210 -0
- package/package.json +43 -30
- package/server/__tests__/api.test.js +122 -0
- package/server/dist/assets/index-B2S7vHJ3.js +79 -0
- package/server/dist/assets/index-K-eN8vD6.css +1 -0
- package/server/dist/favicon.svg +103 -0
- package/server/dist/index.html +5 -5
- package/server/handlers.js +269 -0
- package/server/index.js +10 -203
- package/server/terminal.js +103 -0
- package/vitest.config.mjs +8 -0
- package/server/dist/assets/index-BzxBsA4M.css +0 -1
- package/server/dist/assets/index-CKSk2-yh.js +0 -57
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
function OA(e,t){for(var s=0;s<t.length;s++){const n=t[s];if(typeof n!="string"&&!Array.isArray(n)){for(const o in n)if(o!=="default"&&!(o in e)){const l=Object.getOwnPropertyDescriptor(n,o);l&&Object.defineProperty(e,o,l.get?l:{enumerable:!0,get:()=>n[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"]'))n(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"&&n(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 n(o){if(o.ep)return;o.ep=!0;const l=s(o);fetch(o.href,l)}})();function Wx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Jf={exports:{}},Ka={};var A0;function NA(){if(A0)return Ka;A0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function s(n,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:n,key:c,ref:o!==void 0?o:null,props:l}}return Ka.Fragment=t,Ka.jsx=s,Ka.jsxs=s,Ka}var M0;function LA(){return M0||(M0=1,Jf.exports=NA()),Jf.exports}var w=LA(),em={exports:{}},Me={};var D0;function BA(){if(D0)return Me;D0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),n=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 R(N,Z,se){this.props=N,this.context=Z,this.refs=E,this.updater=se||b}R.prototype.isReactComponent={},R.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")},R.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function A(){}A.prototype=R.prototype;function M(N,Z,se){this.props=N,this.context=Z,this.refs=E,this.updater=se||b}var k=M.prototype=new A;k.constructor=M,S(k,R.prototype),k.isPureReactComponent=!0;var j=Array.isArray;function F(){}var U={H:null,A:null,T:null,S:null},H=Object.prototype.hasOwnProperty;function J(N,Z,se){var V=se.ref;return{$$typeof:e,type:N,key:Z,ref:V!==void 0?V:null,props:se}}function W(N,Z){return J(N.type,Z,N.props)}function $(N){return typeof N=="object"&&N!==null&&N.$$typeof===e}function z(N){var Z={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(se){return Z[se]})}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,se,V,O){var K=typeof N;(K==="undefined"||K==="boolean")&&(N=null);var Y=!1;if(N===null)Y=!0;else switch(K){case"bigint":case"string":case"number":Y=!0;break;case"object":switch(N.$$typeof){case e:case t:Y=!0;break;case p:return Y=N._init,T(Y(N._payload),Z,se,V,O)}}if(Y)return O=O(N),Y=V===""?"."+P(N,0):V,j(O)?(se="",Y!=null&&(se=Y.replace(L,"$&/")+"/"),T(O,Z,se,"",function(fe){return fe})):O!=null&&($(O)&&(O=W(O,se+(O.key==null||N&&N.key===O.key?"":(""+O.key).replace(L,"$&/")+"/")+Y)),Z.push(O)),1;Y=0;var ie=V===""?".":V+":";if(j(N))for(var ne=0;ne<N.length;ne++)V=N[ne],K=ie+P(V,ne),Y+=T(V,Z,se,K,O);else if(ne=y(N),typeof ne=="function")for(N=ne.call(N),ne=0;!(V=N.next()).done;)V=V.value,K=ie+P(V,ne++),Y+=T(V,Z,se,K,O);else if(K==="object"){if(typeof N.then=="function")return T(q(N),Z,se,V,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 Y}function I(N,Z,se){if(N==null)return N;var V=[],O=0;return T(N,V,"","",function(K){return Z.call(se,K,O++)}),V}function B(N){if(N._status===-1){var Z=N._result;Z=Z(),Z.then(function(se){(N._status===0||N._status===-1)&&(N._status=1,N._result=se)},function(se){(N._status===0||N._status===-1)&&(N._status=2,N._result=se)}),N._status===-1&&(N._status=0,N._result=Z)}if(N._status===1)return N._result.default;throw N._result}var ee=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:I,forEach:function(N,Z,se){I(N,function(){Z.apply(this,arguments)},se)},count:function(N){var Z=0;return I(N,function(){Z++}),Z},toArray:function(N){return I(N,function(Z){return Z})||[]},only:function(N){if(!$(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return Me.Activity=v,Me.Children=X,Me.Component=R,Me.Fragment=s,Me.Profiler=o,Me.PureComponent=M,Me.StrictMode=n,Me.Suspense=f,Me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=U,Me.__COMPILER_RUNTIME={__proto__:null,c:function(N){return U.H.useMemoCache(N)}},Me.cache=function(N){return function(){return N.apply(null,arguments)}},Me.cacheSignal=function(){return null},Me.cloneElement=function(N,Z,se){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var V=S({},N.props),O=N.key;if(Z!=null)for(K in Z.key!==void 0&&(O=""+Z.key),Z)!H.call(Z,K)||K==="key"||K==="__self"||K==="__source"||K==="ref"&&Z.ref===void 0||(V[K]=Z[K]);var K=arguments.length-2;if(K===1)V.children=se;else if(1<K){for(var Y=Array(K),ie=0;ie<K;ie++)Y[ie]=arguments[ie+2];V.children=Y}return J(N.type,O,V)},Me.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},Me.createElement=function(N,Z,se){var V,O={},K=null;if(Z!=null)for(V in Z.key!==void 0&&(K=""+Z.key),Z)H.call(Z,V)&&V!=="key"&&V!=="__self"&&V!=="__source"&&(O[V]=Z[V]);var Y=arguments.length-2;if(Y===1)O.children=se;else if(1<Y){for(var ie=Array(Y),ne=0;ne<Y;ne++)ie[ne]=arguments[ne+2];O.children=ie}if(N&&N.defaultProps)for(V in Y=N.defaultProps,Y)O[V]===void 0&&(O[V]=Y[V]);return J(N,K,O)},Me.createRef=function(){return{current:null}},Me.forwardRef=function(N){return{$$typeof:h,render:N}},Me.isValidElement=$,Me.lazy=function(N){return{$$typeof:p,_payload:{_status:-1,_result:N},_init:B}},Me.memo=function(N,Z){return{$$typeof:d,type:N,compare:Z===void 0?null:Z}},Me.startTransition=function(N){var Z=U.T,se={};U.T=se;try{var V=N(),O=U.S;O!==null&&O(se,V),typeof V=="object"&&V!==null&&typeof V.then=="function"&&V.then(F,ee)}catch(K){ee(K)}finally{Z!==null&&se.types!==null&&(Z.types=se.types),U.T=Z}},Me.unstable_useCacheRefresh=function(){return U.H.useCacheRefresh()},Me.use=function(N){return U.H.use(N)},Me.useActionState=function(N,Z,se){return U.H.useActionState(N,Z,se)},Me.useCallback=function(N,Z){return U.H.useCallback(N,Z)},Me.useContext=function(N){return U.H.useContext(N)},Me.useDebugValue=function(){},Me.useDeferredValue=function(N,Z){return U.H.useDeferredValue(N,Z)},Me.useEffect=function(N,Z){return U.H.useEffect(N,Z)},Me.useEffectEvent=function(N){return U.H.useEffectEvent(N)},Me.useId=function(){return U.H.useId()},Me.useImperativeHandle=function(N,Z,se){return U.H.useImperativeHandle(N,Z,se)},Me.useInsertionEffect=function(N,Z){return U.H.useInsertionEffect(N,Z)},Me.useLayoutEffect=function(N,Z){return U.H.useLayoutEffect(N,Z)},Me.useMemo=function(N,Z){return U.H.useMemo(N,Z)},Me.useOptimistic=function(N,Z){return U.H.useOptimistic(N,Z)},Me.useReducer=function(N,Z,se){return U.H.useReducer(N,Z,se)},Me.useRef=function(N){return U.H.useRef(N)},Me.useState=function(N){return U.H.useState(N)},Me.useSyncExternalStore=function(N,Z,se){return U.H.useSyncExternalStore(N,Z,se)},Me.useTransition=function(){return U.H.useTransition()},Me.version="19.2.4",Me}var O0;function vg(){return O0||(O0=1,em.exports=BA()),em.exports}var x=vg();const Nn=Wx(x),Kx=OA({__proto__:null,default:Nn},[x]);var tm={exports:{}},Ya={},im={exports:{}},sm={};var N0;function PA(){return N0||(N0=1,(function(e){function t(T,I){var B=T.length;T.push(I);e:for(;0<B;){var ee=B-1>>>1,X=T[ee];if(0<o(X,I))T[ee]=I,T[B]=X,B=ee;else break e}}function s(T){return T.length===0?null:T[0]}function n(T){if(T.length===0)return null;var I=T[0],B=T.pop();if(B!==I){T[0]=B;e:for(var ee=0,X=T.length,N=X>>>1;ee<N;){var Z=2*(ee+1)-1,se=T[Z],V=Z+1,O=T[V];if(0>o(se,B))V<X&&0>o(O,se)?(T[ee]=O,T[V]=B,ee=V):(T[ee]=se,T[Z]=B,ee=Z);else if(V<X&&0>o(O,B))T[ee]=O,T[V]=B,ee=V;else break e}}return I}function o(T,I){var B=T.sortIndex-I.sortIndex;return B!==0?B:T.id-I.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,R=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function k(T){for(var I=s(d);I!==null;){if(I.callback===null)n(d);else if(I.startTime<=T)n(d),I.sortIndex=I.expirationTime,t(f,I);else break;I=s(d)}}function j(T){if(S=!1,k(T),!b)if(s(f)!==null)b=!0,F||(F=!0,z());else{var I=s(d);I!==null&&q(j,I.startTime-T)}}var F=!1,U=-1,H=5,J=-1;function W(){return E?!0:!(e.unstable_now()-J<H)}function $(){if(E=!1,F){var T=e.unstable_now();J=T;var I=!0;try{e:{b=!1,S&&(S=!1,A(U),U=-1),y=!0;var B=_;try{t:{for(k(T),v=s(f);v!==null&&!(v.expirationTime>T&&W());){var ee=v.callback;if(typeof ee=="function"){v.callback=null,_=v.priorityLevel;var X=ee(v.expirationTime<=T);if(T=e.unstable_now(),typeof X=="function"){v.callback=X,k(T),I=!0;break t}v===s(f)&&n(f),k(T)}else n(f);v=s(f)}if(v!==null)I=!0;else{var N=s(d);N!==null&&q(j,N.startTime-T),I=!1}}break e}finally{v=null,_=B,y=!1}I=void 0}}finally{I?z():F=!1}}}var z;if(typeof M=="function")z=function(){M($)};else if(typeof MessageChannel<"u"){var L=new MessageChannel,P=L.port2;L.port1.onmessage=$,z=function(){P.postMessage(null)}}else z=function(){R($,0)};function q(T,I){U=R(function(){T(e.unstable_now())},I)}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"):H=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 I=3;break;default:I=_}var B=_;_=I;try{return T()}finally{_=B}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(T,I){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var B=_;_=T;try{return I()}finally{_=B}},e.unstable_scheduleCallback=function(T,I,B){var ee=e.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?ee+B:ee):B=ee,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:I,priorityLevel:T,startTime:B,expirationTime:X,sortIndex:-1},B>ee?(T.sortIndex=B,t(d,T),s(f)===null&&T===s(d)&&(S?(A(U),U=-1):S=!0,q(j,B-ee))):(T.sortIndex=X,t(f,T),b||y||(b=!0,F||(F=!0,z()))),T},e.unstable_shouldYield=W,e.unstable_wrapCallback=function(T){var I=_;return function(){var B=_;_=I;try{return T.apply(this,arguments)}finally{_=B}}}})(sm)),sm}var L0;function zA(){return L0||(L0=1,im.exports=PA()),im.exports}var nm={exports:{}},Zt={};var B0;function jA(){if(B0)return Zt;B0=1;var e=vg();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 n={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 Zt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,Zt.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)},Zt.flushSync=function(f){var d=c.T,p=n.p;try{if(c.T=null,n.p=2,f)return f()}finally{c.T=d,n.p=p,n.d.f()}},Zt.preconnect=function(f,d){typeof f=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,n.d.C(f,d))},Zt.prefetchDNS=function(f){typeof f=="string"&&n.d.D(f)},Zt.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"?n.d.S(f,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:v,integrity:_,fetchPriority:y}):p==="script"&&n.d.X(f,{crossOrigin:v,integrity:_,fetchPriority:y,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Zt.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);n.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&&n.d.M(f)},Zt.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);n.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})}},Zt.preloadModule=function(f,d){if(typeof f=="string")if(d){var p=h(d.as,d.crossOrigin);n.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 n.d.m(f)},Zt.requestFormReset=function(f){n.d.r(f)},Zt.unstable_batchedUpdates=function(f,d){return f(d)},Zt.useFormState=function(f,d,p){return c.H.useFormState(f,d,p)},Zt.useFormStatus=function(){return c.H.useHostTransitionStatus()},Zt.version="19.2.4",Zt}var P0;function Yx(){if(P0)return nm.exports;P0=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(),nm.exports=jA(),nm.exports}var z0;function HA(){if(z0)return Ya;z0=1;var e=zA(),t=vg(),s=Yx();function n(i){var r="https://react.dev/errors/"+i;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)r+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+i+"; visit "+r+" 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 r=i,a=i;if(i.alternate)for(;r.return;)r=r.return;else{i=r;do r=i,(r.flags&4098)!==0&&(a=r.return),i=r.return;while(i)}return r.tag===3?a:null}function c(i){if(i.tag===13){var r=i.memoizedState;if(r===null&&(i=i.alternate,i!==null&&(r=i.memoizedState)),r!==null)return r.dehydrated}return null}function h(i){if(i.tag===31){var r=i.memoizedState;if(r===null&&(i=i.alternate,i!==null&&(r=i.memoizedState)),r!==null)return r.dehydrated}return null}function f(i){if(l(i)!==i)throw Error(n(188))}function d(i){var r=i.alternate;if(!r){if(r=l(i),r===null)throw Error(n(188));return r!==i?null:i}for(var a=i,u=r;;){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),r;g=g.sibling}throw Error(n(188))}if(a.return!==u.return)a=m,u=g;else{for(var C=!1,D=m.child;D;){if(D===a){C=!0,a=m,u=g;break}if(D===u){C=!0,u=m,a=g;break}D=D.sibling}if(!C){for(D=g.child;D;){if(D===a){C=!0,a=g,u=m;break}if(D===u){C=!0,u=g,a=m;break}D=D.sibling}if(!C)throw Error(n(189))}}if(a.alternate!==u)throw Error(n(190))}if(a.tag!==3)throw Error(n(188));return a.stateNode.current===a?i:r}function p(i){var r=i.tag;if(r===5||r===26||r===27||r===6)return i;for(i=i.child;i!==null;){if(r=p(i),r!==null)return r;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"),R=Symbol.for("react.profiler"),A=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"),U=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),J=Symbol.for("react.activity"),W=Symbol.for("react.memo_cache_sentinel"),$=Symbol.iterator;function z(i){return i===null||typeof i!="object"?null:(i=$&&i[$]||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 R:return"Profiler";case E:return"StrictMode";case j:return"Suspense";case F:return"SuspenseList";case J:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case b:return"Portal";case M:return i.displayName||"Context";case A:return(i._context.displayName||"Context")+".Consumer";case k:var r=i.render;return i=i.displayName,i||(i=r.displayName||r.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case U:return r=i.displayName||null,r!==null?r:P(i.type)||"Memo";case H:r=i._payload,i=i._init;try{return P(i(r))}catch{}}return null}var q=Array.isArray,T=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B={pending:!1,data:null,method:null,action:null},ee=[],X=-1;function N(i){return{current:i}}function Z(i){0>X||(i.current=ee[X],ee[X]=null,X--)}function se(i,r){X++,ee[X]=i.current,i.current=r}var V=N(null),O=N(null),K=N(null),Y=N(null);function ie(i,r){switch(se(K,r),se(O,i),se(V,null),r.nodeType){case 9:case 11:i=(i=r.documentElement)&&(i=i.namespaceURI)?Qb(i):0;break;default:if(i=r.tagName,r=r.namespaceURI)r=Qb(r),i=Jb(r,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}Z(V),se(V,i)}function ne(){Z(V),Z(O),Z(K)}function fe(i){i.memoizedState!==null&&se(Y,i);var r=V.current,a=Jb(r,i.type);r!==a&&(se(O,i),se(V,a))}function me(i){O.current===i&&(Z(V),Z(O)),Y.current===i&&(Z(Y),Va._currentValue=B)}var we,Ce;function Oe(i){if(we===void 0)try{throw Error()}catch(a){var r=a.stack.trim().match(/\n( *(at )?)/);we=r&&r[1]||"",Ce=-1<a.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+we+i+Ce}var xe=!1;function Ae(i,r){if(!i||xe)return"";xe=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(r){var he=function(){throw Error()};if(Object.defineProperty(he.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(he,[])}catch(le){var ae=le}Reflect.construct(i,[],he)}else{try{he.call()}catch(le){ae=le}i.call(he.prototype)}}else{try{throw Error()}catch(le){ae=le}(he=i())&&typeof he.catch=="function"&&he.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(),C=g[0],D=g[1];if(C&&D){var G=C.split(`
|
|
4
|
+
`),oe=D.split(`
|
|
5
|
+
`);for(m=u=0;u<G.length&&!G[u].includes("DetermineComponentFrameRoot");)u++;for(;m<oe.length&&!oe[m].includes("DetermineComponentFrameRoot");)m++;if(u===G.length||m===oe.length)for(u=G.length-1,m=oe.length-1;1<=u&&0<=m&&G[u]!==oe[m];)m--;for(;1<=u&&0<=m;u--,m--)if(G[u]!==oe[m]){if(u!==1||m!==1)do if(u--,m--,0>m||G[u]!==oe[m]){var ce=`
|
|
6
|
+
`+G[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{xe=!1,Error.prepareStackTrace=a}return(a=i?i.displayName||i.name:"")?Oe(a):""}function ht(i,r){switch(i.tag){case 26:case 27:case 5:return Oe(i.type);case 16:return Oe("Lazy");case 13:return i.child!==r&&r!==null?Oe("Suspense Fallback"):Oe("Suspense");case 19:return Oe("SuspenseList");case 0:case 15:return Ae(i.type,!1);case 11:return Ae(i.type.render,!1);case 1:return Ae(i.type,!0);case 31:return Oe("Activity");default:return""}}function Xt(i){try{var r="",a=null;do r+=ht(i,a),a=i,i=i.return;while(i);return r}catch(u){return`
|
|
7
|
+
Error generating stack: `+u.message+`
|
|
8
|
+
`+u.stack}}var Es=Object.prototype.hasOwnProperty,tn=e.unstable_scheduleCallback,os=e.unstable_cancelCallback,Xn=e.unstable_shouldYield,Hh=e.unstable_requestPaint,Vt=e.unstable_now,dk=e.unstable_getCurrentPriorityLevel,Mv=e.unstable_ImmediatePriority,Dv=e.unstable_UserBlockingPriority,zl=e.unstable_NormalPriority,fk=e.unstable_LowPriority,Ov=e.unstable_IdlePriority,mk=e.log,pk=e.unstable_setDisableYieldValue,Jo=null,gi=null;function sn(i){if(typeof mk=="function"&&pk(i),gi&&typeof gi.setStrictMode=="function")try{gi.setStrictMode(Jo,i)}catch{}}var vi=Math.clz32?Math.clz32:_k,gk=Math.log,vk=Math.LN2;function _k(i){return i>>>=0,i===0?32:31-(gk(i)/vk|0)|0}var jl=256,Hl=262144,Il=4194304;function Zn(i){var r=i&42;if(r!==0)return r;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 Vl(i,r,a){var u=i.pendingLanes;if(u===0)return 0;var m=0,g=i.suspendedLanes,C=i.pingedLanes;i=i.warmLanes;var D=u&134217727;return D!==0?(u=D&~g,u!==0?m=Zn(u):(C&=D,C!==0?m=Zn(C):a||(a=D&~i,a!==0&&(m=Zn(a))))):(D=u&~g,D!==0?m=Zn(D):C!==0?m=Zn(C):a||(a=u&~i,a!==0&&(m=Zn(a)))),m===0?0:r!==0&&r!==m&&(r&g)===0&&(g=m&-m,a=r&-r,g>=a||g===32&&(a&4194048)!==0)?r:m}function ea(i,r){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&r)===0}function yk(i,r){switch(i){case 1:case 2:case 4:case 8:case 64:return r+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 r+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 Nv(){var i=Il;return Il<<=1,(Il&62914560)===0&&(Il=4194304),i}function Ih(i){for(var r=[],a=0;31>a;a++)r.push(i);return r}function ta(i,r){i.pendingLanes|=r,r!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function bk(i,r,a,u,m,g){var C=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,G=i.expirationTimes,oe=i.hiddenUpdates;for(a=C&~a;0<a;){var ce=31-vi(a),he=1<<ce;D[ce]=0,G[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&=~he}u!==0&&Lv(i,u,0),g!==0&&m===0&&i.tag!==0&&(i.suspendedLanes|=g&~(C&~r))}function Lv(i,r,a){i.pendingLanes|=r,i.suspendedLanes&=~r;var u=31-vi(r);i.entangledLanes|=r,i.entanglements[u]=i.entanglements[u]|1073741824|a&261930}function Bv(i,r){var a=i.entangledLanes|=r;for(i=i.entanglements;a;){var u=31-vi(a),m=1<<u;m&r|i[u]&r&&(i[u]|=r),a&=~m}}function Pv(i,r){var a=r&-r;return a=(a&42)!==0?1:Vh(a),(a&(i.suspendedLanes|r))!==0?0:a}function Vh(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 Uh(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function zv(){var i=I.p;return i!==0?i:(i=window.event,i===void 0?32:w0(i.type))}function jv(i,r){var a=I.p;try{return I.p=i,r()}finally{I.p=a}}var nn=Math.random().toString(36).slice(2),Ut="__reactFiber$"+nn,li="__reactProps$"+nn,Pr="__reactContainer$"+nn,Fh="__reactEvents$"+nn,Sk="__reactListeners$"+nn,wk="__reactHandles$"+nn,Hv="__reactResources$"+nn,ia="__reactMarker$"+nn;function Wh(i){delete i[Ut],delete i[li],delete i[Fh],delete i[Sk],delete i[wk]}function zr(i){var r=i[Ut];if(r)return r;for(var a=i.parentNode;a;){if(r=a[Pr]||a[Ut]){if(a=r.alternate,r.child!==null||a!==null&&a.child!==null)for(i=o0(i);i!==null;){if(a=i[Ut])return a;i=o0(i)}return r}i=a,a=i.parentNode}return null}function jr(i){if(i=i[Ut]||i[Pr]){var r=i.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return i}return null}function sa(i){var r=i.tag;if(r===5||r===26||r===27||r===6)return i.stateNode;throw Error(n(33))}function Hr(i){var r=i[Hv];return r||(r=i[Hv]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Lt(i){i[ia]=!0}var Iv=new Set,Vv={};function Qn(i,r){Ir(i,r),Ir(i+"Capture",r)}function Ir(i,r){for(Vv[i]=r,i=0;i<r.length;i++)Iv.add(r[i])}var xk=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]*$"),Uv={},Fv={};function Ck(i){return Es.call(Fv,i)?!0:Es.call(Uv,i)?!1:xk.test(i)?Fv[i]=!0:(Uv[i]=!0,!1)}function Ul(i,r,a){if(Ck(r))if(a===null)i.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":i.removeAttribute(r);return;case"boolean":var u=r.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){i.removeAttribute(r);return}}i.setAttribute(r,""+a)}}function Fl(i,r,a){if(a===null)i.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(r);return}i.setAttribute(r,""+a)}}function Ts(i,r,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(r,a,""+u)}}function Di(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Wv(i){var r=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Ek(i,r,a){var u=Object.getOwnPropertyDescriptor(i.constructor.prototype,r);if(!i.hasOwnProperty(r)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var m=u.get,g=u.set;return Object.defineProperty(i,r,{configurable:!0,get:function(){return m.call(this)},set:function(C){a=""+C,g.call(this,C)}}),Object.defineProperty(i,r,{enumerable:u.enumerable}),{getValue:function(){return a},setValue:function(C){a=""+C},stopTracking:function(){i._valueTracker=null,delete i[r]}}}}function Kh(i){if(!i._valueTracker){var r=Wv(i)?"checked":"value";i._valueTracker=Ek(i,r,""+i[r])}}function Kv(i){if(!i)return!1;var r=i._valueTracker;if(!r)return!0;var a=r.getValue(),u="";return i&&(u=Wv(i)?i.checked?"true":"false":i.value),i=u,i!==a?(r.setValue(i),!0):!1}function Wl(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 Tk=/[\n"\\]/g;function Oi(i){return i.replace(Tk,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Yh(i,r,a,u,m,g,C,D){i.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?i.type=C:i.removeAttribute("type"),r!=null?C==="number"?(r===0&&i.value===""||i.value!=r)&&(i.value=""+Di(r)):i.value!==""+Di(r)&&(i.value=""+Di(r)):C!=="submit"&&C!=="reset"||i.removeAttribute("value"),r!=null?qh(i,C,Di(r)):a!=null?qh(i,C,Di(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=""+Di(D):i.removeAttribute("name")}function Yv(i,r,a,u,m,g,C,D){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(i.type=g),r!=null||a!=null){if(!(g!=="submit"&&g!=="reset"||r!=null)){Kh(i);return}a=a!=null?""+Di(a):"",r=r!=null?""+Di(r):a,D||r===i.value||(i.value=r),i.defaultValue=r}u=u??m,u=typeof u!="function"&&typeof u!="symbol"&&!!u,i.checked=D?i.checked:!!u,i.defaultChecked=!!u,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(i.name=C),Kh(i)}function qh(i,r,a){r==="number"&&Wl(i.ownerDocument)===i||i.defaultValue===""+a||(i.defaultValue=""+a)}function Vr(i,r,a,u){if(i=i.options,r){r={};for(var m=0;m<a.length;m++)r["$"+a[m]]=!0;for(a=0;a<i.length;a++)m=r.hasOwnProperty("$"+i[a].value),i[a].selected!==m&&(i[a].selected=m),m&&u&&(i[a].defaultSelected=!0)}else{for(a=""+Di(a),r=null,m=0;m<i.length;m++){if(i[m].value===a){i[m].selected=!0,u&&(i[m].defaultSelected=!0);return}r!==null||i[m].disabled||(r=i[m])}r!==null&&(r.selected=!0)}}function qv(i,r,a){if(r!=null&&(r=""+Di(r),r!==i.value&&(i.value=r),a==null)){i.defaultValue!==r&&(i.defaultValue=r);return}i.defaultValue=a!=null?""+Di(a):""}function $v(i,r,a,u){if(r==null){if(u!=null){if(a!=null)throw Error(n(92));if(q(u)){if(1<u.length)throw Error(n(93));u=u[0]}a=u}a==null&&(a=""),r=a}a=Di(r),i.defaultValue=a,u=i.textContent,u===a&&u!==""&&u!==null&&(i.value=u),Kh(i)}function Ur(i,r){if(r){var a=i.firstChild;if(a&&a===i.lastChild&&a.nodeType===3){a.nodeValue=r;return}}i.textContent=r}var kk=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 Gv(i,r,a){var u=r.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?u?i.setProperty(r,""):r==="float"?i.cssFloat="":i[r]="":u?i.setProperty(r,a):typeof a!="number"||a===0||kk.has(r)?r==="float"?i.cssFloat=a:i[r]=(""+a).trim():i[r]=a+"px"}function Xv(i,r,a){if(r!=null&&typeof r!="object")throw Error(n(62));if(i=i.style,a!=null){for(var u in a)!a.hasOwnProperty(u)||r!=null&&r.hasOwnProperty(u)||(u.indexOf("--")===0?i.setProperty(u,""):u==="float"?i.cssFloat="":i[u]="");for(var m in r)u=r[m],r.hasOwnProperty(m)&&a[m]!==u&&Gv(i,m,u)}else for(var g in r)r.hasOwnProperty(g)&&Gv(i,g,r[g])}function $h(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 Rk=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"]]),Ak=/^[\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 Kl(i){return Ak.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function ks(){}var Gh=null;function Xh(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Fr=null,Wr=null;function Zv(i){var r=jr(i);if(r&&(i=r.stateNode)){var a=i[li]||null;e:switch(i=r.stateNode,r.type){case"input":if(Yh(i,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),r=a.name,a.type==="radio"&&r!=null){for(a=i;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Oi(""+r)+'"][type="radio"]'),r=0;r<a.length;r++){var u=a[r];if(u!==i&&u.form===i.form){var m=u[li]||null;if(!m)throw Error(n(90));Yh(u,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(r=0;r<a.length;r++)u=a[r],u.form===i.form&&Kv(u)}break e;case"textarea":qv(i,a.value,a.defaultValue);break e;case"select":r=a.value,r!=null&&Vr(i,!!a.multiple,r,!1)}}}var Zh=!1;function Qv(i,r,a){if(Zh)return i(r,a);Zh=!0;try{var u=i(r);return u}finally{if(Zh=!1,(Fr!==null||Wr!==null)&&(Oc(),Fr&&(r=Fr,i=Wr,Wr=Fr=null,Zv(r),i)))for(r=0;r<i.length;r++)Zv(i[r])}}function na(i,r){var a=i.stateNode;if(a===null)return null;var u=a[li]||null;if(u===null)return null;a=u[r];e:switch(r){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(n(231,r,typeof a));return a}var Rs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Qh=!1;if(Rs)try{var ra={};Object.defineProperty(ra,"passive",{get:function(){Qh=!0}}),window.addEventListener("test",ra,ra),window.removeEventListener("test",ra,ra)}catch{Qh=!1}var rn=null,Jh=null,Yl=null;function Jv(){if(Yl)return Yl;var i,r=Jh,a=r.length,u,m="value"in rn?rn.value:rn.textContent,g=m.length;for(i=0;i<a&&r[i]===m[i];i++);var C=a-i;for(u=1;u<=C&&r[a-u]===m[g-u];u++);return Yl=m.slice(i,1<u?1-u:void 0)}function ql(i){var r=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&r===13&&(i=13)):i=r,i===10&&(i=13),32<=i||i===13?i:0}function $l(){return!0}function e_(){return!1}function ci(i){function r(a,u,m,g,C){this._reactName=a,this._targetInst=m,this.type=u,this.nativeEvent=g,this.target=C,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)?$l:e_,this.isPropagationStopped=e_,this}return v(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=$l)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=$l)},persist:function(){},isPersistent:$l}),r}var Jn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Gl=ci(Jn),oa=v({},Jn,{view:0,detail:0}),Mk=ci(oa),ed,td,aa,Xl=v({},oa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:sd,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!==aa&&(aa&&i.type==="mousemove"?(ed=i.screenX-aa.screenX,td=i.screenY-aa.screenY):td=ed=0,aa=i),ed)},movementY:function(i){return"movementY"in i?i.movementY:td}}),t_=ci(Xl),Dk=v({},Xl,{dataTransfer:0}),Ok=ci(Dk),Nk=v({},oa,{relatedTarget:0}),id=ci(Nk),Lk=v({},Jn,{animationName:0,elapsedTime:0,pseudoElement:0}),Bk=ci(Lk),Pk=v({},Jn,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),zk=ci(Pk),jk=v({},Jn,{data:0}),i_=ci(jk),Hk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ik={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"},Vk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Uk(i){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(i):(i=Vk[i])?!!r[i]:!1}function sd(){return Uk}var Fk=v({},oa,{key:function(i){if(i.key){var r=Hk[i.key]||i.key;if(r!=="Unidentified")return r}return i.type==="keypress"?(i=ql(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?Ik[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:sd,charCode:function(i){return i.type==="keypress"?ql(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?ql(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),Wk=ci(Fk),Kk=v({},Xl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),s_=ci(Kk),Yk=v({},oa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:sd}),qk=ci(Yk),$k=v({},Jn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Gk=ci($k),Xk=v({},Xl,{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}),Zk=ci(Xk),Qk=v({},Jn,{newState:0,oldState:0}),Jk=ci(Qk),eR=[9,13,27,32],nd=Rs&&"CompositionEvent"in window,la=null;Rs&&"documentMode"in document&&(la=document.documentMode);var tR=Rs&&"TextEvent"in window&&!la,n_=Rs&&(!nd||la&&8<la&&11>=la),r_=" ",o_=!1;function a_(i,r){switch(i){case"keyup":return eR.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function l_(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Kr=!1;function iR(i,r){switch(i){case"compositionend":return l_(r);case"keypress":return r.which!==32?null:(o_=!0,r_);case"textInput":return i=r.data,i===r_&&o_?null:i;default:return null}}function sR(i,r){if(Kr)return i==="compositionend"||!nd&&a_(i,r)?(i=Jv(),Yl=Jh=rn=null,Kr=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return n_&&r.locale!=="ko"?null:r.data;default:return null}}var nR={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 c_(i){var r=i&&i.nodeName&&i.nodeName.toLowerCase();return r==="input"?!!nR[i.type]:r==="textarea"}function u_(i,r,a,u){Fr?Wr?Wr.push(u):Wr=[u]:Fr=u,r=Hc(r,"onChange"),0<r.length&&(a=new Gl("onChange","change",null,a,u),i.push({event:a,listeners:r}))}var ca=null,ua=null;function rR(i){Yb(i,0)}function Zl(i){var r=sa(i);if(Kv(r))return i}function h_(i,r){if(i==="change")return r}var d_=!1;if(Rs){var rd;if(Rs){var od="oninput"in document;if(!od){var f_=document.createElement("div");f_.setAttribute("oninput","return;"),od=typeof f_.oninput=="function"}rd=od}else rd=!1;d_=rd&&(!document.documentMode||9<document.documentMode)}function m_(){ca&&(ca.detachEvent("onpropertychange",p_),ua=ca=null)}function p_(i){if(i.propertyName==="value"&&Zl(ua)){var r=[];u_(r,ua,i,Xh(i)),Qv(rR,r)}}function oR(i,r,a){i==="focusin"?(m_(),ca=r,ua=a,ca.attachEvent("onpropertychange",p_)):i==="focusout"&&m_()}function aR(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Zl(ua)}function lR(i,r){if(i==="click")return Zl(r)}function cR(i,r){if(i==="input"||i==="change")return Zl(r)}function uR(i,r){return i===r&&(i!==0||1/i===1/r)||i!==i&&r!==r}var _i=typeof Object.is=="function"?Object.is:uR;function ha(i,r){if(_i(i,r))return!0;if(typeof i!="object"||i===null||typeof r!="object"||r===null)return!1;var a=Object.keys(i),u=Object.keys(r);if(a.length!==u.length)return!1;for(u=0;u<a.length;u++){var m=a[u];if(!Es.call(r,m)||!_i(i[m],r[m]))return!1}return!0}function g_(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function v_(i,r){var a=g_(i);i=0;for(var u;a;){if(a.nodeType===3){if(u=i+a.textContent.length,i<=r&&u>=r)return{node:a,offset:r-i};i=u}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=g_(a)}}function __(i,r){return i&&r?i===r?!0:i&&i.nodeType===3?!1:r&&r.nodeType===3?__(i,r.parentNode):"contains"in i?i.contains(r):i.compareDocumentPosition?!!(i.compareDocumentPosition(r)&16):!1:!1}function y_(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var r=Wl(i.document);r instanceof i.HTMLIFrameElement;){try{var a=typeof r.contentWindow.location.href=="string"}catch{a=!1}if(a)i=r.contentWindow;else break;r=Wl(i.document)}return r}function ad(i){var r=i&&i.nodeName&&i.nodeName.toLowerCase();return r&&(r==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||r==="textarea"||i.contentEditable==="true")}var hR=Rs&&"documentMode"in document&&11>=document.documentMode,Yr=null,ld=null,da=null,cd=!1;function b_(i,r,a){var u=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;cd||Yr==null||Yr!==Wl(u)||(u=Yr,"selectionStart"in u&&ad(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}),da&&ha(da,u)||(da=u,u=Hc(ld,"onSelect"),0<u.length&&(r=new Gl("onSelect","select",null,r,a),i.push({event:r,listeners:u}),r.target=Yr)))}function er(i,r){var a={};return a[i.toLowerCase()]=r.toLowerCase(),a["Webkit"+i]="webkit"+r,a["Moz"+i]="moz"+r,a}var qr={animationend:er("Animation","AnimationEnd"),animationiteration:er("Animation","AnimationIteration"),animationstart:er("Animation","AnimationStart"),transitionrun:er("Transition","TransitionRun"),transitionstart:er("Transition","TransitionStart"),transitioncancel:er("Transition","TransitionCancel"),transitionend:er("Transition","TransitionEnd")},ud={},S_={};Rs&&(S_=document.createElement("div").style,"AnimationEvent"in window||(delete qr.animationend.animation,delete qr.animationiteration.animation,delete qr.animationstart.animation),"TransitionEvent"in window||delete qr.transitionend.transition);function tr(i){if(ud[i])return ud[i];if(!qr[i])return i;var r=qr[i],a;for(a in r)if(r.hasOwnProperty(a)&&a in S_)return ud[i]=r[a];return i}var w_=tr("animationend"),x_=tr("animationiteration"),C_=tr("animationstart"),dR=tr("transitionrun"),fR=tr("transitionstart"),mR=tr("transitioncancel"),E_=tr("transitionend"),T_=new Map,hd="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(" ");hd.push("scrollEnd");function $i(i,r){T_.set(i,r),Qn(r,[i])}var Ql=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=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(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},Ni=[],$r=0,dd=0;function Jl(){for(var i=$r,r=dd=$r=0;r<i;){var a=Ni[r];Ni[r++]=null;var u=Ni[r];Ni[r++]=null;var m=Ni[r];Ni[r++]=null;var g=Ni[r];if(Ni[r++]=null,u!==null&&m!==null){var C=u.pending;C===null?m.next=m:(m.next=C.next,C.next=m),u.pending=m}g!==0&&k_(a,m,g)}}function ec(i,r,a,u){Ni[$r++]=i,Ni[$r++]=r,Ni[$r++]=a,Ni[$r++]=u,dd|=u,i.lanes|=u,i=i.alternate,i!==null&&(i.lanes|=u)}function fd(i,r,a,u){return ec(i,r,a,u),tc(i)}function ir(i,r){return ec(i,null,null,r),tc(i)}function k_(i,r,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&&r!==null&&(m=31-vi(a),i=g.hiddenUpdates,u=i[m],u===null?i[m]=[r]:u.push(r),r.lane=a|536870912),g):null}function tc(i){if(50<La)throw La=0,xf=null,Error(n(185));for(var r=i.return;r!==null;)i=r,r=i.return;return i.tag===3?i.stateNode:null}var Gr={};function pR(i,r,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=r,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 yi(i,r,a,u){return new pR(i,r,a,u)}function md(i){return i=i.prototype,!(!i||!i.isReactComponent)}function As(i,r){var a=i.alternate;return a===null?(a=yi(i.tag,r,i.key,i.mode),a.elementType=i.elementType,a.type=i.type,a.stateNode=i.stateNode,a.alternate=i,i.alternate=a):(a.pendingProps=r,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,r=i.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},a.sibling=i.sibling,a.index=i.index,a.ref=i.ref,a.refCleanup=i.refCleanup,a}function R_(i,r){i.flags&=65011714;var a=i.alternate;return a===null?(i.childLanes=0,i.lanes=r,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,r=a.dependencies,i.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),i}function ic(i,r,a,u,m,g){var C=0;if(u=i,typeof i=="function")md(i)&&(C=1);else if(typeof i=="string")C=bA(i,a,V.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case J:return i=yi(31,a,r,m),i.elementType=J,i.lanes=g,i;case S:return sr(a.children,m,g,r);case E:C=8,m|=24;break;case R:return i=yi(12,a,r,m|2),i.elementType=R,i.lanes=g,i;case j:return i=yi(13,a,r,m),i.elementType=j,i.lanes=g,i;case F:return i=yi(19,a,r,m),i.elementType=F,i.lanes=g,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case M:C=10;break e;case A:C=9;break e;case k:C=11;break e;case U:C=14;break e;case H:C=16,u=null;break e}C=29,a=Error(n(130,i===null?"null":typeof i,"")),u=null}return r=yi(C,a,r,m),r.elementType=i,r.type=u,r.lanes=g,r}function sr(i,r,a,u){return i=yi(7,i,u,r),i.lanes=a,i}function pd(i,r,a){return i=yi(6,i,null,r),i.lanes=a,i}function A_(i){var r=yi(18,null,null,0);return r.stateNode=i,r}function gd(i,r,a){return r=yi(4,i.children!==null?i.children:[],i.key,r),r.lanes=a,r.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},r}var M_=new WeakMap;function Li(i,r){if(typeof i=="object"&&i!==null){var a=M_.get(i);return a!==void 0?a:(r={value:i,source:r,stack:Xt(r)},M_.set(i,r),r)}return{value:i,source:r,stack:Xt(r)}}var Xr=[],Zr=0,sc=null,fa=0,Bi=[],Pi=0,on=null,as=1,ls="";function Ms(i,r){Xr[Zr++]=fa,Xr[Zr++]=sc,sc=i,fa=r}function D_(i,r,a){Bi[Pi++]=as,Bi[Pi++]=ls,Bi[Pi++]=on,on=i;var u=as;i=ls;var m=32-vi(u)-1;u&=~(1<<m),a+=1;var g=32-vi(r)+m;if(30<g){var C=m-m%5;g=(u&(1<<C)-1).toString(32),u>>=C,m-=C,as=1<<32-vi(r)+m|a<<m|u,ls=g+i}else as=1<<g|a<<m|u,ls=i}function vd(i){i.return!==null&&(Ms(i,1),D_(i,1,0))}function _d(i){for(;i===sc;)sc=Xr[--Zr],Xr[Zr]=null,fa=Xr[--Zr],Xr[Zr]=null;for(;i===on;)on=Bi[--Pi],Bi[Pi]=null,ls=Bi[--Pi],Bi[Pi]=null,as=Bi[--Pi],Bi[Pi]=null}function O_(i,r){Bi[Pi++]=as,Bi[Pi++]=ls,Bi[Pi++]=on,as=r.id,ls=r.overflow,on=i}var Ft=null,st=null,Ue=!1,an=null,zi=!1,yd=Error(n(519));function ln(i){var r=Error(n(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ma(Li(r,i)),yd}function N_(i){var r=i.stateNode,a=i.type,u=i.memoizedProps;switch(r[Ut]=i,r[li]=u,a){case"dialog":He("cancel",r),He("close",r);break;case"iframe":case"object":case"embed":He("load",r);break;case"video":case"audio":for(a=0;a<Pa.length;a++)He(Pa[a],r);break;case"source":He("error",r);break;case"img":case"image":case"link":He("error",r),He("load",r);break;case"details":He("toggle",r);break;case"input":He("invalid",r),Yv(r,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":He("invalid",r);break;case"textarea":He("invalid",r),$v(r,u.value,u.defaultValue,u.children)}a=u.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||r.textContent===""+a||u.suppressHydrationWarning===!0||Xb(r.textContent,a)?(u.popover!=null&&(He("beforetoggle",r),He("toggle",r)),u.onScroll!=null&&He("scroll",r),u.onScrollEnd!=null&&He("scrollend",r),u.onClick!=null&&(r.onclick=ks),r=!0):r=!1,r||ln(i,!0)}function L_(i){for(Ft=i.return;Ft;)switch(Ft.tag){case 5:case 31:case 13:zi=!1;return;case 27:case 3:zi=!0;return;default:Ft=Ft.return}}function Qr(i){if(i!==Ft)return!1;if(!Ue)return L_(i),Ue=!0,!1;var r=i.tag,a;if((a=r!==3&&r!==27)&&((a=r===5)&&(a=i.type,a=!(a!=="form"&&a!=="button")||jf(i.type,i.memoizedProps)),a=!a),a&&st&&ln(i),L_(i),r===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(317));st=r0(i)}else if(r===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(317));st=r0(i)}else r===27?(r=st,wn(i.type)?(i=Ff,Ff=null,st=i):st=r):st=Ft?Hi(i.stateNode.nextSibling):null;return!0}function nr(){st=Ft=null,Ue=!1}function bd(){var i=an;return i!==null&&(fi===null?fi=i:fi.push.apply(fi,i),an=null),i}function ma(i){an===null?an=[i]:an.push(i)}var Sd=N(null),rr=null,Ds=null;function cn(i,r,a){se(Sd,r._currentValue),r._currentValue=a}function Os(i){i._currentValue=Sd.current,Z(Sd)}function wd(i,r,a){for(;i!==null;){var u=i.alternate;if((i.childLanes&r)!==r?(i.childLanes|=r,u!==null&&(u.childLanes|=r)):u!==null&&(u.childLanes&r)!==r&&(u.childLanes|=r),i===a)break;i=i.return}}function xd(i,r,a,u){var m=i.child;for(m!==null&&(m.return=i);m!==null;){var g=m.dependencies;if(g!==null){var C=m.child;g=g.firstContext;e:for(;g!==null;){var D=g;g=m;for(var G=0;G<r.length;G++)if(D.context===r[G]){g.lanes|=a,D=g.alternate,D!==null&&(D.lanes|=a),wd(g.return,a,i),u||(C=null);break e}g=D.next}}else if(m.tag===18){if(C=m.return,C===null)throw Error(n(341));C.lanes|=a,g=C.alternate,g!==null&&(g.lanes|=a),wd(C,a,i),C=null}else C=m.child;if(C!==null)C.return=m;else for(C=m;C!==null;){if(C===i){C=null;break}if(m=C.sibling,m!==null){m.return=C.return,C=m;break}C=C.return}m=C}}function Jr(i,r,a,u){i=null;for(var m=r,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 C=m.alternate;if(C===null)throw Error(n(387));if(C=C.memoizedProps,C!==null){var D=m.type;_i(m.pendingProps.value,C.value)||(i!==null?i.push(D):i=[D])}}else if(m===Y.current){if(C=m.alternate,C===null)throw Error(n(387));C.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(i!==null?i.push(Va):i=[Va])}m=m.return}i!==null&&xd(r,i,a,u),r.flags|=262144}function nc(i){for(i=i.firstContext;i!==null;){if(!_i(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function or(i){rr=i,Ds=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Wt(i){return B_(rr,i)}function rc(i,r){return rr===null&&or(i),B_(i,r)}function B_(i,r){var a=r._currentValue;if(r={context:r,memoizedValue:a,next:null},Ds===null){if(i===null)throw Error(n(308));Ds=r,i.dependencies={lanes:0,firstContext:r},i.flags|=524288}else Ds=Ds.next=r;return a}var gR=typeof AbortController<"u"?AbortController:function(){var i=[],r=this.signal={aborted:!1,addEventListener:function(a,u){i.push(u)}};this.abort=function(){r.aborted=!0,i.forEach(function(a){return a()})}},vR=e.unstable_scheduleCallback,_R=e.unstable_NormalPriority,bt={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Cd(){return{controller:new gR,data:new Map,refCount:0}}function pa(i){i.refCount--,i.refCount===0&&vR(_R,function(){i.controller.abort()})}var ga=null,Ed=0,eo=0,to=null;function yR(i,r){if(ga===null){var a=ga=[];Ed=0,eo=Af(),to={status:"pending",value:void 0,then:function(u){a.push(u)}}}return Ed++,r.then(P_,P_),r}function P_(){if(--Ed===0&&ga!==null){to!==null&&(to.status="fulfilled");var i=ga;ga=null,eo=0,to=null;for(var r=0;r<i.length;r++)(0,i[r])()}}function bR(i,r){var a=[],u={status:"pending",value:null,reason:null,then:function(m){a.push(m)}};return i.then(function(){u.status="fulfilled",u.value=r;for(var m=0;m<a.length;m++)(0,a[m])(r)},function(m){for(u.status="rejected",u.reason=m,m=0;m<a.length;m++)(0,a[m])(void 0)}),u}var z_=T.S;T.S=function(i,r){bb=Vt(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&yR(i,r),z_!==null&&z_(i,r)};var ar=N(null);function Td(){var i=ar.current;return i!==null?i:et.pooledCache}function oc(i,r){r===null?se(ar,ar.current):se(ar,r.pool)}function j_(){var i=Td();return i===null?null:{parent:bt._currentValue,pool:i}}var io=Error(n(460)),kd=Error(n(474)),ac=Error(n(542)),lc={then:function(){}};function H_(i){return i=i.status,i==="fulfilled"||i==="rejected"}function I_(i,r,a){switch(a=i[a],a===void 0?i.push(r):a!==r&&(r.then(ks,ks),r=a),r.status){case"fulfilled":return r.value;case"rejected":throw i=r.reason,U_(i),i;default:if(typeof r.status=="string")r.then(ks,ks);else{if(i=et,i!==null&&100<i.shellSuspendCounter)throw Error(n(482));i=r,i.status="pending",i.then(function(u){if(r.status==="pending"){var m=r;m.status="fulfilled",m.value=u}},function(u){if(r.status==="pending"){var m=r;m.status="rejected",m.reason=u}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw i=r.reason,U_(i),i}throw cr=r,io}}function lr(i){try{var r=i._init;return r(i._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(cr=a,io):a}}var cr=null;function V_(){if(cr===null)throw Error(n(459));var i=cr;return cr=null,i}function U_(i){if(i===io||i===ac)throw Error(n(483))}var so=null,va=0;function cc(i){var r=va;return va+=1,so===null&&(so=[]),I_(so,i,r)}function _a(i,r){r=r.props.ref,i.ref=r!==void 0?r:null}function uc(i,r){throw r.$$typeof===_?Error(n(525)):(i=Object.prototype.toString.call(r),Error(n(31,i==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":i)))}function F_(i){function r(te,Q){if(i){var re=te.deletions;re===null?(te.deletions=[Q],te.flags|=16):re.push(Q)}}function a(te,Q){if(!i)return null;for(;Q!==null;)r(te,Q),Q=Q.sibling;return null}function u(te){for(var Q=new Map;te!==null;)te.key!==null?Q.set(te.key,te):Q.set(te.index,te),te=te.sibling;return Q}function m(te,Q){return te=As(te,Q),te.index=0,te.sibling=null,te}function g(te,Q,re){return te.index=re,i?(re=te.alternate,re!==null?(re=re.index,re<Q?(te.flags|=67108866,Q):re):(te.flags|=67108866,Q)):(te.flags|=1048576,Q)}function C(te){return i&&te.alternate===null&&(te.flags|=67108866),te}function D(te,Q,re,ue){return Q===null||Q.tag!==6?(Q=pd(re,te.mode,ue),Q.return=te,Q):(Q=m(Q,re),Q.return=te,Q)}function G(te,Q,re,ue){var Ee=re.type;return Ee===S?ce(te,Q,re.props.children,ue,re.key):Q!==null&&(Q.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===H&&lr(Ee)===Q.type)?(Q=m(Q,re.props),_a(Q,re),Q.return=te,Q):(Q=ic(re.type,re.key,re.props,null,te.mode,ue),_a(Q,re),Q.return=te,Q)}function oe(te,Q,re,ue){return Q===null||Q.tag!==4||Q.stateNode.containerInfo!==re.containerInfo||Q.stateNode.implementation!==re.implementation?(Q=gd(re,te.mode,ue),Q.return=te,Q):(Q=m(Q,re.children||[]),Q.return=te,Q)}function ce(te,Q,re,ue,Ee){return Q===null||Q.tag!==7?(Q=sr(re,te.mode,ue,Ee),Q.return=te,Q):(Q=m(Q,re),Q.return=te,Q)}function he(te,Q,re){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Q=pd(""+Q,te.mode,re),Q.return=te,Q;if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case y:return re=ic(Q.type,Q.key,Q.props,null,te.mode,re),_a(re,Q),re.return=te,re;case b:return Q=gd(Q,te.mode,re),Q.return=te,Q;case H:return Q=lr(Q),he(te,Q,re)}if(q(Q)||z(Q))return Q=sr(Q,te.mode,re,null),Q.return=te,Q;if(typeof Q.then=="function")return he(te,cc(Q),re);if(Q.$$typeof===M)return he(te,rc(te,Q),re);uc(te,Q)}return null}function ae(te,Q,re,ue){var Ee=Q!==null?Q.key:null;if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return Ee!==null?null:D(te,Q,""+re,ue);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case y:return re.key===Ee?G(te,Q,re,ue):null;case b:return re.key===Ee?oe(te,Q,re,ue):null;case H:return re=lr(re),ae(te,Q,re,ue)}if(q(re)||z(re))return Ee!==null?null:ce(te,Q,re,ue,null);if(typeof re.then=="function")return ae(te,Q,cc(re),ue);if(re.$$typeof===M)return ae(te,Q,rc(te,re),ue);uc(te,re)}return null}function le(te,Q,re,ue,Ee){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return te=te.get(re)||null,D(Q,te,""+ue,Ee);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case y:return te=te.get(ue.key===null?re:ue.key)||null,G(Q,te,ue,Ee);case b:return te=te.get(ue.key===null?re:ue.key)||null,oe(Q,te,ue,Ee);case H:return ue=lr(ue),le(te,Q,re,ue,Ee)}if(q(ue)||z(ue))return te=te.get(re)||null,ce(Q,te,ue,Ee,null);if(typeof ue.then=="function")return le(te,Q,re,cc(ue),Ee);if(ue.$$typeof===M)return le(te,Q,re,rc(Q,ue),Ee);uc(Q,ue)}return null}function ve(te,Q,re,ue){for(var Ee=null,Fe=null,Se=Q,Ne=Q=0,Ve=null;Se!==null&&Ne<re.length;Ne++){Se.index>Ne?(Ve=Se,Se=null):Ve=Se.sibling;var We=ae(te,Se,re[Ne],ue);if(We===null){Se===null&&(Se=Ve);break}i&&Se&&We.alternate===null&&r(te,Se),Q=g(We,Q,Ne),Fe===null?Ee=We:Fe.sibling=We,Fe=We,Se=Ve}if(Ne===re.length)return a(te,Se),Ue&&Ms(te,Ne),Ee;if(Se===null){for(;Ne<re.length;Ne++)Se=he(te,re[Ne],ue),Se!==null&&(Q=g(Se,Q,Ne),Fe===null?Ee=Se:Fe.sibling=Se,Fe=Se);return Ue&&Ms(te,Ne),Ee}for(Se=u(Se);Ne<re.length;Ne++)Ve=le(Se,te,Ne,re[Ne],ue),Ve!==null&&(i&&Ve.alternate!==null&&Se.delete(Ve.key===null?Ne:Ve.key),Q=g(Ve,Q,Ne),Fe===null?Ee=Ve:Fe.sibling=Ve,Fe=Ve);return i&&Se.forEach(function(kn){return r(te,kn)}),Ue&&Ms(te,Ne),Ee}function Te(te,Q,re,ue){if(re==null)throw Error(n(151));for(var Ee=null,Fe=null,Se=Q,Ne=Q=0,Ve=null,We=re.next();Se!==null&&!We.done;Ne++,We=re.next()){Se.index>Ne?(Ve=Se,Se=null):Ve=Se.sibling;var kn=ae(te,Se,We.value,ue);if(kn===null){Se===null&&(Se=Ve);break}i&&Se&&kn.alternate===null&&r(te,Se),Q=g(kn,Q,Ne),Fe===null?Ee=kn:Fe.sibling=kn,Fe=kn,Se=Ve}if(We.done)return a(te,Se),Ue&&Ms(te,Ne),Ee;if(Se===null){for(;!We.done;Ne++,We=re.next())We=he(te,We.value,ue),We!==null&&(Q=g(We,Q,Ne),Fe===null?Ee=We:Fe.sibling=We,Fe=We);return Ue&&Ms(te,Ne),Ee}for(Se=u(Se);!We.done;Ne++,We=re.next())We=le(Se,te,Ne,We.value,ue),We!==null&&(i&&We.alternate!==null&&Se.delete(We.key===null?Ne:We.key),Q=g(We,Q,Ne),Fe===null?Ee=We:Fe.sibling=We,Fe=We);return i&&Se.forEach(function(DA){return r(te,DA)}),Ue&&Ms(te,Ne),Ee}function Qe(te,Q,re,ue){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 Ee=re.key;Q!==null;){if(Q.key===Ee){if(Ee=re.type,Ee===S){if(Q.tag===7){a(te,Q.sibling),ue=m(Q,re.props.children),ue.return=te,te=ue;break e}}else if(Q.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===H&&lr(Ee)===Q.type){a(te,Q.sibling),ue=m(Q,re.props),_a(ue,re),ue.return=te,te=ue;break e}a(te,Q);break}else r(te,Q);Q=Q.sibling}re.type===S?(ue=sr(re.props.children,te.mode,ue,re.key),ue.return=te,te=ue):(ue=ic(re.type,re.key,re.props,null,te.mode,ue),_a(ue,re),ue.return=te,te=ue)}return C(te);case b:e:{for(Ee=re.key;Q!==null;){if(Q.key===Ee)if(Q.tag===4&&Q.stateNode.containerInfo===re.containerInfo&&Q.stateNode.implementation===re.implementation){a(te,Q.sibling),ue=m(Q,re.children||[]),ue.return=te,te=ue;break e}else{a(te,Q);break}else r(te,Q);Q=Q.sibling}ue=gd(re,te.mode,ue),ue.return=te,te=ue}return C(te);case H:return re=lr(re),Qe(te,Q,re,ue)}if(q(re))return ve(te,Q,re,ue);if(z(re)){if(Ee=z(re),typeof Ee!="function")throw Error(n(150));return re=Ee.call(re),Te(te,Q,re,ue)}if(typeof re.then=="function")return Qe(te,Q,cc(re),ue);if(re.$$typeof===M)return Qe(te,Q,rc(te,re),ue);uc(te,re)}return typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint"?(re=""+re,Q!==null&&Q.tag===6?(a(te,Q.sibling),ue=m(Q,re),ue.return=te,te=ue):(a(te,Q),ue=pd(re,te.mode,ue),ue.return=te,te=ue),C(te)):a(te,Q)}return function(te,Q,re,ue){try{va=0;var Ee=Qe(te,Q,re,ue);return so=null,Ee}catch(Se){if(Se===io||Se===ac)throw Se;var Fe=yi(29,Se,null,te.mode);return Fe.lanes=ue,Fe.return=te,Fe}}}var ur=F_(!0),W_=F_(!1),un=!1;function Rd(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ad(i,r){i=i.updateQueue,r.updateQueue===i&&(r.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function hn(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function dn(i,r,a){var u=i.updateQueue;if(u===null)return null;if(u=u.shared,(Ke&2)!==0){var m=u.pending;return m===null?r.next=r:(r.next=m.next,m.next=r),u.pending=r,r=tc(i),k_(i,null,a),r}return ec(i,u,r,a),tc(i)}function ya(i,r,a){if(r=r.updateQueue,r!==null&&(r=r.shared,(a&4194048)!==0)){var u=r.lanes;u&=i.pendingLanes,a|=u,r.lanes=a,Bv(i,a)}}function Md(i,r){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 C={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};g===null?m=g=C:g=g.next=C,a=a.next}while(a!==null);g===null?m=g=r:g=g.next=r}else m=g=r;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=r:i.next=r,a.lastBaseUpdate=r}var Dd=!1;function ba(){if(Dd){var i=to;if(i!==null)throw i}}function Sa(i,r,a,u){Dd=!1;var m=i.updateQueue;un=!1;var g=m.firstBaseUpdate,C=m.lastBaseUpdate,D=m.shared.pending;if(D!==null){m.shared.pending=null;var G=D,oe=G.next;G.next=null,C===null?g=oe:C.next=oe,C=G;var ce=i.alternate;ce!==null&&(ce=ce.updateQueue,D=ce.lastBaseUpdate,D!==C&&(D===null?ce.firstBaseUpdate=oe:D.next=oe,ce.lastBaseUpdate=G))}if(g!==null){var he=m.baseState;C=0,ce=oe=G=null,D=g;do{var ae=D.lane&-536870913,le=ae!==D.lane;if(le?(Ie&ae)===ae:(u&ae)===ae){ae!==0&&ae===eo&&(Dd=!0),ce!==null&&(ce=ce.next={lane:0,tag:D.tag,payload:D.payload,callback:null,next:null});e:{var ve=i,Te=D;ae=r;var Qe=a;switch(Te.tag){case 1:if(ve=Te.payload,typeof ve=="function"){he=ve.call(Qe,he,ae);break e}he=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=Te.payload,ae=typeof ve=="function"?ve.call(Qe,he,ae):ve,ae==null)break e;he=v({},he,ae);break e;case 2:un=!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,G=he):ce=ce.next=le,C|=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&&(G=he),m.baseState=G,m.firstBaseUpdate=oe,m.lastBaseUpdate=ce,g===null&&(m.shared.lanes=0),vn|=C,i.lanes=C,i.memoizedState=he}}function K_(i,r){if(typeof i!="function")throw Error(n(191,i));i.call(r)}function Y_(i,r){var a=i.callbacks;if(a!==null)for(i.callbacks=null,i=0;i<a.length;i++)K_(a[i],r)}var no=N(null),hc=N(0);function q_(i,r){i=Vs,se(hc,i),se(no,r),Vs=i|r.baseLanes}function Od(){se(hc,Vs),se(no,no.current)}function Nd(){Vs=hc.current,Z(no),Z(hc)}var bi=N(null),ji=null;function fn(i){var r=i.alternate;se(vt,vt.current&1),se(bi,i),ji===null&&(r===null||no.current!==null||r.memoizedState!==null)&&(ji=i)}function Ld(i){se(vt,vt.current),se(bi,i),ji===null&&(ji=i)}function $_(i){i.tag===22?(se(vt,vt.current),se(bi,i),ji===null&&(ji=i)):mn()}function mn(){se(vt,vt.current),se(bi,bi.current)}function Si(i){Z(bi),ji===i&&(ji=null),Z(vt)}var vt=N(0);function dc(i){for(var r=i;r!==null;){if(r.tag===13){var a=r.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Vf(a)||Uf(a)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break;for(;r.sibling===null;){if(r.return===null||r.return===i)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var Ns=0,De=null,Xe=null,St=null,fc=!1,ro=!1,hr=!1,mc=0,wa=0,oo=null,SR=0;function dt(){throw Error(n(321))}function Bd(i,r){if(r===null)return!1;for(var a=0;a<r.length&&a<i.length;a++)if(!_i(i[a],r[a]))return!1;return!0}function Pd(i,r,a,u,m,g){return Ns=g,De=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,T.H=i===null||i.memoizedState===null?Dy:Zd,hr=!1,g=a(u,m),hr=!1,ro&&(g=X_(r,a,u,m)),G_(i),g}function G_(i){T.H=Ea;var r=Xe!==null&&Xe.next!==null;if(Ns=0,St=Xe=De=null,fc=!1,wa=0,oo=null,r)throw Error(n(300));i===null||wt||(i=i.dependencies,i!==null&&nc(i)&&(wt=!0))}function X_(i,r,a,u){De=i;var m=0;do{if(ro&&(oo=null),wa=0,ro=!1,25<=m)throw Error(n(301));if(m+=1,St=Xe=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=Oy,g=r(a,u)}while(ro);return g}function wR(){var i=T.H,r=i.useState()[0];return r=typeof r.then=="function"?xa(r):r,i=i.useState()[0],(Xe!==null?Xe.memoizedState:null)!==i&&(De.flags|=1024),r}function zd(){var i=mc!==0;return mc=0,i}function jd(i,r,a){r.updateQueue=i.updateQueue,r.flags&=-2053,i.lanes&=~a}function Hd(i){if(fc){for(i=i.memoizedState;i!==null;){var r=i.queue;r!==null&&(r.pending=null),i=i.next}fc=!1}Ns=0,St=Xe=De=null,ro=!1,wa=mc=0,oo=null}function ei(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return St===null?De.memoizedState=St=i:St=St.next=i,St}function _t(){if(Xe===null){var i=De.alternate;i=i!==null?i.memoizedState:null}else i=Xe.next;var r=St===null?De.memoizedState:St.next;if(r!==null)St=r,Xe=i;else{if(i===null)throw De.alternate===null?Error(n(467)):Error(n(310));Xe=i,i={memoizedState:Xe.memoizedState,baseState:Xe.baseState,baseQueue:Xe.baseQueue,queue:Xe.queue,next:null},St===null?De.memoizedState=St=i:St=St.next=i}return St}function pc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function xa(i){var r=wa;return wa+=1,oo===null&&(oo=[]),i=I_(oo,i,r),r=De,(St===null?r.memoizedState:St.next)===null&&(r=r.alternate,T.H=r===null||r.memoizedState===null?Dy:Zd),i}function gc(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return xa(i);if(i.$$typeof===M)return Wt(i)}throw Error(n(438,String(i)))}function Id(i){var r=null,a=De.updateQueue;if(a!==null&&(r=a.memoCache),r==null){var u=De.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(r={data:u.data.map(function(m){return m.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),a===null&&(a=pc(),De.updateQueue=a),a.memoCache=r,a=r.data[r.index],a===void 0)for(a=r.data[r.index]=Array(i),u=0;u<i;u++)a[u]=W;return r.index++,a}function Ls(i,r){return typeof r=="function"?r(i):r}function vc(i){var r=_t();return Vd(r,Xe,i)}function Vd(i,r,a){var u=i.queue;if(u===null)throw Error(n(311));u.lastRenderedReducer=a;var m=i.baseQueue,g=u.pending;if(g!==null){if(m!==null){var C=m.next;m.next=g.next,g.next=C}r.baseQueue=m=g,u.pending=null}if(g=i.baseState,m===null)i.memoizedState=g;else{r=m.next;var D=C=null,G=null,oe=r,ce=!1;do{var he=oe.lane&-536870913;if(he!==oe.lane?(Ie&he)===he:(Ns&he)===he){var ae=oe.revertLane;if(ae===0)G!==null&&(G=G.next={lane:0,revertLane:0,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),he===eo&&(ce=!0);else if((Ns&ae)===ae){oe=oe.next,ae===eo&&(ce=!0);continue}else he={lane:0,revertLane:oe.revertLane,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},G===null?(D=G=he,C=g):G=G.next=he,De.lanes|=ae,vn|=ae;he=oe.action,hr&&a(g,he),g=oe.hasEagerState?oe.eagerState:a(g,he)}else ae={lane:he,revertLane:oe.revertLane,gesture:oe.gesture,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},G===null?(D=G=ae,C=g):G=G.next=ae,De.lanes|=he,vn|=he;oe=oe.next}while(oe!==null&&oe!==r);if(G===null?C=g:G.next=D,!_i(g,i.memoizedState)&&(wt=!0,ce&&(a=to,a!==null)))throw a;i.memoizedState=g,i.baseState=C,i.baseQueue=G,u.lastRenderedState=g}return m===null&&(u.lanes=0),[i.memoizedState,u.dispatch]}function Ud(i){var r=_t(),a=r.queue;if(a===null)throw Error(n(311));a.lastRenderedReducer=i;var u=a.dispatch,m=a.pending,g=r.memoizedState;if(m!==null){a.pending=null;var C=m=m.next;do g=i(g,C.action),C=C.next;while(C!==m);_i(g,r.memoizedState)||(wt=!0),r.memoizedState=g,r.baseQueue===null&&(r.baseState=g),a.lastRenderedState=g}return[g,u]}function Z_(i,r,a){var u=De,m=_t(),g=Ue;if(g){if(a===void 0)throw Error(n(407));a=a()}else a=r();var C=!_i((Xe||m).memoizedState,a);if(C&&(m.memoizedState=a,wt=!0),m=m.queue,Kd(ey.bind(null,u,m,i),[i]),m.getSnapshot!==r||C||St!==null&&St.memoizedState.tag&1){if(u.flags|=2048,ao(9,{destroy:void 0},J_.bind(null,u,m,a,r),null),et===null)throw Error(n(349));g||(Ns&127)!==0||Q_(u,r,a)}return a}function Q_(i,r,a){i.flags|=16384,i={getSnapshot:r,value:a},r=De.updateQueue,r===null?(r=pc(),De.updateQueue=r,r.stores=[i]):(a=r.stores,a===null?r.stores=[i]:a.push(i))}function J_(i,r,a,u){r.value=a,r.getSnapshot=u,ty(r)&&iy(i)}function ey(i,r,a){return a(function(){ty(r)&&iy(i)})}function ty(i){var r=i.getSnapshot;i=i.value;try{var a=r();return!_i(i,a)}catch{return!0}}function iy(i){var r=ir(i,2);r!==null&&mi(r,i,2)}function Fd(i){var r=ei();if(typeof i=="function"){var a=i;if(i=a(),hr){sn(!0);try{a()}finally{sn(!1)}}}return r.memoizedState=r.baseState=i,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ls,lastRenderedState:i},r}function sy(i,r,a,u){return i.baseState=a,Vd(i,Xe,typeof u=="function"?u:Ls)}function xR(i,r,a,u,m){if(bc(i))throw Error(n(485));if(i=r.action,i!==null){var g={payload:m,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(C){g.listeners.push(C)}};T.T!==null?a(!0):g.isTransition=!1,u(g),a=r.pending,a===null?(g.next=r.pending=g,ny(r,g)):(g.next=a.next,r.pending=a.next=g)}}function ny(i,r){var a=r.action,u=r.payload,m=i.state;if(r.isTransition){var g=T.T,C={};T.T=C;try{var D=a(m,u),G=T.S;G!==null&&G(C,D),ry(i,r,D)}catch(oe){Wd(i,r,oe)}finally{g!==null&&C.types!==null&&(g.types=C.types),T.T=g}}else try{g=a(m,u),ry(i,r,g)}catch(oe){Wd(i,r,oe)}}function ry(i,r,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(u){oy(i,r,u)},function(u){return Wd(i,r,u)}):oy(i,r,a)}function oy(i,r,a){r.status="fulfilled",r.value=a,ay(r),i.state=a,r=i.pending,r!==null&&(a=r.next,a===r?i.pending=null:(a=a.next,r.next=a,ny(i,a)))}function Wd(i,r,a){var u=i.pending;if(i.pending=null,u!==null){u=u.next;do r.status="rejected",r.reason=a,ay(r),r=r.next;while(r!==u)}i.action=null}function ay(i){i=i.listeners;for(var r=0;r<i.length;r++)(0,i[r])()}function ly(i,r){return r}function cy(i,r){if(Ue){var a=et.formState;if(a!==null){e:{var u=De;if(Ue){if(st){t:{for(var m=st,g=zi;m.nodeType!==8;){if(!g){m=null;break t}if(m=Hi(m.nextSibling),m===null){m=null;break t}}g=m.data,m=g==="F!"||g==="F"?m:null}if(m){st=Hi(m.nextSibling),u=m.data==="F!";break e}}ln(u)}u=!1}u&&(r=a[0])}}return a=ei(),a.memoizedState=a.baseState=r,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ly,lastRenderedState:r},a.queue=u,a=Ry.bind(null,De,u),u.dispatch=a,u=Fd(!1),g=Xd.bind(null,De,!1,u.queue),u=ei(),m={state:r,dispatch:null,action:i,pending:null},u.queue=m,a=xR.bind(null,De,m,g,a),m.dispatch=a,u.memoizedState=i,[r,a,!1]}function uy(i){var r=_t();return hy(r,Xe,i)}function hy(i,r,a){if(r=Vd(i,r,ly)[0],i=vc(Ls)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var u=xa(r)}catch(C){throw C===io?ac:C}else u=r;r=_t();var m=r.queue,g=m.dispatch;return a!==r.memoizedState&&(De.flags|=2048,ao(9,{destroy:void 0},CR.bind(null,m,a),null)),[u,g,i]}function CR(i,r){i.action=r}function dy(i){var r=_t(),a=Xe;if(a!==null)return hy(r,a,i);_t(),r=r.memoizedState,a=_t();var u=a.queue.dispatch;return a.memoizedState=i,[r,u,!1]}function ao(i,r,a,u){return i={tag:i,create:a,deps:u,inst:r,next:null},r=De.updateQueue,r===null&&(r=pc(),De.updateQueue=r),a=r.lastEffect,a===null?r.lastEffect=i.next=i:(u=a.next,a.next=i,i.next=u,r.lastEffect=i),i}function fy(){return _t().memoizedState}function _c(i,r,a,u){var m=ei();De.flags|=i,m.memoizedState=ao(1|r,{destroy:void 0},a,u===void 0?null:u)}function yc(i,r,a,u){var m=_t();u=u===void 0?null:u;var g=m.memoizedState.inst;Xe!==null&&u!==null&&Bd(u,Xe.memoizedState.deps)?m.memoizedState=ao(r,g,a,u):(De.flags|=i,m.memoizedState=ao(1|r,g,a,u))}function my(i,r){_c(8390656,8,i,r)}function Kd(i,r){yc(2048,8,i,r)}function ER(i){De.flags|=4;var r=De.updateQueue;if(r===null)r=pc(),De.updateQueue=r,r.events=[i];else{var a=r.events;a===null?r.events=[i]:a.push(i)}}function py(i){var r=_t().memoizedState;return ER({ref:r,nextImpl:i}),function(){if((Ke&2)!==0)throw Error(n(440));return r.impl.apply(void 0,arguments)}}function gy(i,r){return yc(4,2,i,r)}function vy(i,r){return yc(4,4,i,r)}function _y(i,r){if(typeof r=="function"){i=i();var a=r(i);return function(){typeof a=="function"?a():r(null)}}if(r!=null)return i=i(),r.current=i,function(){r.current=null}}function yy(i,r,a){a=a!=null?a.concat([i]):null,yc(4,4,_y.bind(null,r,i),a)}function Yd(){}function by(i,r){var a=_t();r=r===void 0?null:r;var u=a.memoizedState;return r!==null&&Bd(r,u[1])?u[0]:(a.memoizedState=[i,r],i)}function Sy(i,r){var a=_t();r=r===void 0?null:r;var u=a.memoizedState;if(r!==null&&Bd(r,u[1]))return u[0];if(u=i(),hr){sn(!0);try{i()}finally{sn(!1)}}return a.memoizedState=[u,r],u}function qd(i,r,a){return a===void 0||(Ns&1073741824)!==0&&(Ie&261930)===0?i.memoizedState=r:(i.memoizedState=a,i=wb(),De.lanes|=i,vn|=i,a)}function wy(i,r,a,u){return _i(a,r)?a:no.current!==null?(i=qd(i,a,u),_i(i,r)||(wt=!0),i):(Ns&42)===0||(Ns&1073741824)!==0&&(Ie&261930)===0?(wt=!0,i.memoizedState=a):(i=wb(),De.lanes|=i,vn|=i,r)}function xy(i,r,a,u,m){var g=I.p;I.p=g!==0&&8>g?g:8;var C=T.T,D={};T.T=D,Xd(i,!1,r,a);try{var G=m(),oe=T.S;if(oe!==null&&oe(D,G),G!==null&&typeof G=="object"&&typeof G.then=="function"){var ce=bR(G,u);Ca(i,r,ce,Ci(i))}else Ca(i,r,u,Ci(i))}catch(he){Ca(i,r,{then:function(){},status:"rejected",reason:he},Ci())}finally{I.p=g,C!==null&&D.types!==null&&(C.types=D.types),T.T=C}}function TR(){}function $d(i,r,a,u){if(i.tag!==5)throw Error(n(476));var m=Cy(i).queue;xy(i,m,r,B,a===null?TR:function(){return Ey(i),a(u)})}function Cy(i){var r=i.memoizedState;if(r!==null)return r;r={memoizedState:B,baseState:B,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ls,lastRenderedState:B},next:null};var a={};return r.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ls,lastRenderedState:a},next:null},i.memoizedState=r,i=i.alternate,i!==null&&(i.memoizedState=r),r}function Ey(i){var r=Cy(i);r.next===null&&(r=i.alternate.memoizedState),Ca(i,r.next.queue,{},Ci())}function Gd(){return Wt(Va)}function Ty(){return _t().memoizedState}function ky(){return _t().memoizedState}function kR(i){for(var r=i.return;r!==null;){switch(r.tag){case 24:case 3:var a=Ci();i=hn(a);var u=dn(r,i,a);u!==null&&(mi(u,r,a),ya(u,r,a)),r={cache:Cd()},i.payload=r;return}r=r.return}}function RR(i,r,a){var u=Ci();a={lane:u,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},bc(i)?Ay(r,a):(a=fd(i,r,a,u),a!==null&&(mi(a,i,u),My(a,r,u)))}function Ry(i,r,a){var u=Ci();Ca(i,r,a,u)}function Ca(i,r,a,u){var m={lane:u,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(bc(i))Ay(r,m);else{var g=i.alternate;if(i.lanes===0&&(g===null||g.lanes===0)&&(g=r.lastRenderedReducer,g!==null))try{var C=r.lastRenderedState,D=g(C,a);if(m.hasEagerState=!0,m.eagerState=D,_i(D,C))return ec(i,r,m,0),et===null&&Jl(),!1}catch{}if(a=fd(i,r,m,u),a!==null)return mi(a,i,u),My(a,r,u),!0}return!1}function Xd(i,r,a,u){if(u={lane:2,revertLane:Af(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},bc(i)){if(r)throw Error(n(479))}else r=fd(i,a,u,2),r!==null&&mi(r,i,2)}function bc(i){var r=i.alternate;return i===De||r!==null&&r===De}function Ay(i,r){ro=fc=!0;var a=i.pending;a===null?r.next=r:(r.next=a.next,a.next=r),i.pending=r}function My(i,r,a){if((a&4194048)!==0){var u=r.lanes;u&=i.pendingLanes,a|=u,r.lanes=a,Bv(i,a)}}var Ea={readContext:Wt,use:gc,useCallback:dt,useContext:dt,useEffect:dt,useImperativeHandle:dt,useLayoutEffect:dt,useInsertionEffect:dt,useMemo:dt,useReducer:dt,useRef:dt,useState:dt,useDebugValue:dt,useDeferredValue:dt,useTransition:dt,useSyncExternalStore:dt,useId:dt,useHostTransitionStatus:dt,useFormState:dt,useActionState:dt,useOptimistic:dt,useMemoCache:dt,useCacheRefresh:dt};Ea.useEffectEvent=dt;var Dy={readContext:Wt,use:gc,useCallback:function(i,r){return ei().memoizedState=[i,r===void 0?null:r],i},useContext:Wt,useEffect:my,useImperativeHandle:function(i,r,a){a=a!=null?a.concat([i]):null,_c(4194308,4,_y.bind(null,r,i),a)},useLayoutEffect:function(i,r){return _c(4194308,4,i,r)},useInsertionEffect:function(i,r){_c(4,2,i,r)},useMemo:function(i,r){var a=ei();r=r===void 0?null:r;var u=i();if(hr){sn(!0);try{i()}finally{sn(!1)}}return a.memoizedState=[u,r],u},useReducer:function(i,r,a){var u=ei();if(a!==void 0){var m=a(r);if(hr){sn(!0);try{a(r)}finally{sn(!1)}}}else m=r;return u.memoizedState=u.baseState=m,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:m},u.queue=i,i=i.dispatch=RR.bind(null,De,i),[u.memoizedState,i]},useRef:function(i){var r=ei();return i={current:i},r.memoizedState=i},useState:function(i){i=Fd(i);var r=i.queue,a=Ry.bind(null,De,r);return r.dispatch=a,[i.memoizedState,a]},useDebugValue:Yd,useDeferredValue:function(i,r){var a=ei();return qd(a,i,r)},useTransition:function(){var i=Fd(!1);return i=xy.bind(null,De,i.queue,!0,!1),ei().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,r,a){var u=De,m=ei();if(Ue){if(a===void 0)throw Error(n(407));a=a()}else{if(a=r(),et===null)throw Error(n(349));(Ie&127)!==0||Q_(u,r,a)}m.memoizedState=a;var g={value:a,getSnapshot:r};return m.queue=g,my(ey.bind(null,u,g,i),[i]),u.flags|=2048,ao(9,{destroy:void 0},J_.bind(null,u,g,a,r),null),a},useId:function(){var i=ei(),r=et.identifierPrefix;if(Ue){var a=ls,u=as;a=(u&~(1<<32-vi(u)-1)).toString(32)+a,r="_"+r+"R_"+a,a=mc++,0<a&&(r+="H"+a.toString(32)),r+="_"}else a=SR++,r="_"+r+"r_"+a.toString(32)+"_";return i.memoizedState=r},useHostTransitionStatus:Gd,useFormState:cy,useActionState:cy,useOptimistic:function(i){var r=ei();r.memoizedState=r.baseState=i;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=a,r=Xd.bind(null,De,!0,a),a.dispatch=r,[i,r]},useMemoCache:Id,useCacheRefresh:function(){return ei().memoizedState=kR.bind(null,De)},useEffectEvent:function(i){var r=ei(),a={impl:i};return r.memoizedState=a,function(){if((Ke&2)!==0)throw Error(n(440));return a.impl.apply(void 0,arguments)}}},Zd={readContext:Wt,use:gc,useCallback:by,useContext:Wt,useEffect:Kd,useImperativeHandle:yy,useInsertionEffect:gy,useLayoutEffect:vy,useMemo:Sy,useReducer:vc,useRef:fy,useState:function(){return vc(Ls)},useDebugValue:Yd,useDeferredValue:function(i,r){var a=_t();return wy(a,Xe.memoizedState,i,r)},useTransition:function(){var i=vc(Ls)[0],r=_t().memoizedState;return[typeof i=="boolean"?i:xa(i),r]},useSyncExternalStore:Z_,useId:Ty,useHostTransitionStatus:Gd,useFormState:uy,useActionState:uy,useOptimistic:function(i,r){var a=_t();return sy(a,Xe,i,r)},useMemoCache:Id,useCacheRefresh:ky};Zd.useEffectEvent=py;var Oy={readContext:Wt,use:gc,useCallback:by,useContext:Wt,useEffect:Kd,useImperativeHandle:yy,useInsertionEffect:gy,useLayoutEffect:vy,useMemo:Sy,useReducer:Ud,useRef:fy,useState:function(){return Ud(Ls)},useDebugValue:Yd,useDeferredValue:function(i,r){var a=_t();return Xe===null?qd(a,i,r):wy(a,Xe.memoizedState,i,r)},useTransition:function(){var i=Ud(Ls)[0],r=_t().memoizedState;return[typeof i=="boolean"?i:xa(i),r]},useSyncExternalStore:Z_,useId:Ty,useHostTransitionStatus:Gd,useFormState:dy,useActionState:dy,useOptimistic:function(i,r){var a=_t();return Xe!==null?sy(a,Xe,i,r):(a.baseState=i,[i,a.queue.dispatch])},useMemoCache:Id,useCacheRefresh:ky};Oy.useEffectEvent=py;function Qd(i,r,a,u){r=i.memoizedState,a=a(u,r),a=a==null?r:v({},r,a),i.memoizedState=a,i.lanes===0&&(i.updateQueue.baseState=a)}var Jd={enqueueSetState:function(i,r,a){i=i._reactInternals;var u=Ci(),m=hn(u);m.payload=r,a!=null&&(m.callback=a),r=dn(i,m,u),r!==null&&(mi(r,i,u),ya(r,i,u))},enqueueReplaceState:function(i,r,a){i=i._reactInternals;var u=Ci(),m=hn(u);m.tag=1,m.payload=r,a!=null&&(m.callback=a),r=dn(i,m,u),r!==null&&(mi(r,i,u),ya(r,i,u))},enqueueForceUpdate:function(i,r){i=i._reactInternals;var a=Ci(),u=hn(a);u.tag=2,r!=null&&(u.callback=r),r=dn(i,u,a),r!==null&&(mi(r,i,a),ya(r,i,a))}};function Ny(i,r,a,u,m,g,C){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(u,g,C):r.prototype&&r.prototype.isPureReactComponent?!ha(a,u)||!ha(m,g):!0}function Ly(i,r,a,u){i=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(a,u),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(a,u),r.state!==i&&Jd.enqueueReplaceState(r,r.state,null)}function dr(i,r){var a=r;if("ref"in r){a={};for(var u in r)u!=="ref"&&(a[u]=r[u])}if(i=i.defaultProps){a===r&&(a=v({},a));for(var m in i)a[m]===void 0&&(a[m]=i[m])}return a}function By(i){Ql(i)}function Py(i){console.error(i)}function zy(i){Ql(i)}function Sc(i,r){try{var a=i.onUncaughtError;a(r.value,{componentStack:r.stack})}catch(u){setTimeout(function(){throw u})}}function jy(i,r,a){try{var u=i.onCaughtError;u(a.value,{componentStack:a.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function ef(i,r,a){return a=hn(a),a.tag=3,a.payload={element:null},a.callback=function(){Sc(i,r)},a}function Hy(i){return i=hn(i),i.tag=3,i}function Iy(i,r,a,u){var m=a.type.getDerivedStateFromError;if(typeof m=="function"){var g=u.value;i.payload=function(){return m(g)},i.callback=function(){jy(r,a,u)}}var C=a.stateNode;C!==null&&typeof C.componentDidCatch=="function"&&(i.callback=function(){jy(r,a,u),typeof m!="function"&&(_n===null?_n=new Set([this]):_n.add(this));var D=u.stack;this.componentDidCatch(u.value,{componentStack:D!==null?D:""})})}function AR(i,r,a,u,m){if(a.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(r=a.alternate,r!==null&&Jr(r,a,m,!0),a=bi.current,a!==null){switch(a.tag){case 31:case 13:return ji===null?Nc():a.alternate===null&&ft===0&&(ft=3),a.flags&=-257,a.flags|=65536,a.lanes=m,u===lc?a.flags|=16384:(r=a.updateQueue,r===null?a.updateQueue=new Set([u]):r.add(u),Tf(i,u,m)),!1;case 22:return a.flags|=65536,u===lc?a.flags|=16384:(r=a.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([u])},a.updateQueue=r):(a=r.retryQueue,a===null?r.retryQueue=new Set([u]):a.add(u)),Tf(i,u,m)),!1}throw Error(n(435,a.tag))}return Tf(i,u,m),Nc(),!1}if(Ue)return r=bi.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=m,u!==yd&&(i=Error(n(422),{cause:u}),ma(Li(i,a)))):(u!==yd&&(r=Error(n(423),{cause:u}),ma(Li(r,a))),i=i.current.alternate,i.flags|=65536,m&=-m,i.lanes|=m,u=Li(u,a),m=ef(i.stateNode,u,m),Md(i,m),ft!==4&&(ft=2)),!1;var g=Error(n(520),{cause:u});if(g=Li(g,a),Na===null?Na=[g]:Na.push(g),ft!==4&&(ft=2),r===null)return!0;u=Li(u,a),a=r;do{switch(a.tag){case 3:return a.flags|=65536,i=m&-m,a.lanes|=i,i=ef(a.stateNode,u,i),Md(a,i),!1;case 1:if(r=a.type,g=a.stateNode,(a.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(_n===null||!_n.has(g))))return a.flags|=65536,m&=-m,a.lanes|=m,m=Hy(m),Iy(m,i,a,u),Md(a,m),!1}a=a.return}while(a!==null);return!1}var tf=Error(n(461)),wt=!1;function Kt(i,r,a,u){r.child=i===null?W_(r,null,a,u):ur(r,i.child,a,u)}function Vy(i,r,a,u,m){a=a.render;var g=r.ref;if("ref"in u){var C={};for(var D in u)D!=="ref"&&(C[D]=u[D])}else C=u;return or(r),u=Pd(i,r,a,C,g,m),D=zd(),i!==null&&!wt?(jd(i,r,m),Bs(i,r,m)):(Ue&&D&&vd(r),r.flags|=1,Kt(i,r,u,m),r.child)}function Uy(i,r,a,u,m){if(i===null){var g=a.type;return typeof g=="function"&&!md(g)&&g.defaultProps===void 0&&a.compare===null?(r.tag=15,r.type=g,Fy(i,r,g,u,m)):(i=ic(a.type,null,u,r,r.mode,m),i.ref=r.ref,i.return=r,r.child=i)}if(g=i.child,!uf(i,m)){var C=g.memoizedProps;if(a=a.compare,a=a!==null?a:ha,a(C,u)&&i.ref===r.ref)return Bs(i,r,m)}return r.flags|=1,i=As(g,u),i.ref=r.ref,i.return=r,r.child=i}function Fy(i,r,a,u,m){if(i!==null){var g=i.memoizedProps;if(ha(g,u)&&i.ref===r.ref)if(wt=!1,r.pendingProps=u=g,uf(i,m))(i.flags&131072)!==0&&(wt=!0);else return r.lanes=i.lanes,Bs(i,r,m)}return sf(i,r,a,u,m)}function Wy(i,r,a,u){var m=u.children,g=i!==null?i.memoizedState:null;if(i===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((r.flags&128)!==0){if(g=g!==null?g.baseLanes|a:a,i!==null){for(u=r.child=i.child,m=0;u!==null;)m=m|u.lanes|u.childLanes,u=u.sibling;u=m&~g}else u=0,r.child=null;return Ky(i,r,g,a,u)}if((a&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},i!==null&&oc(r,g!==null?g.cachePool:null),g!==null?q_(r,g):Od(),$_(r);else return u=r.lanes=536870912,Ky(i,r,g!==null?g.baseLanes|a:a,a,u)}else g!==null?(oc(r,g.cachePool),q_(r,g),mn(),r.memoizedState=null):(i!==null&&oc(r,null),Od(),mn());return Kt(i,r,m,a),r.child}function Ta(i,r){return i!==null&&i.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function Ky(i,r,a,u,m){var g=Td();return g=g===null?null:{parent:bt._currentValue,pool:g},r.memoizedState={baseLanes:a,cachePool:g},i!==null&&oc(r,null),Od(),$_(r),i!==null&&Jr(i,r,u,!0),r.childLanes=m,null}function wc(i,r){return r=Cc({mode:r.mode,children:r.children},i.mode),r.ref=i.ref,i.child=r,r.return=i,r}function Yy(i,r,a){return ur(r,i.child,null,a),i=wc(r,r.pendingProps),i.flags|=2,Si(r),r.memoizedState=null,i}function MR(i,r,a){var u=r.pendingProps,m=(r.flags&128)!==0;if(r.flags&=-129,i===null){if(Ue){if(u.mode==="hidden")return i=wc(r,u),r.lanes=536870912,Ta(null,i);if(Ld(r),(i=st)?(i=n0(i,zi),i=i!==null&&i.data==="&"?i:null,i!==null&&(r.memoizedState={dehydrated:i,treeContext:on!==null?{id:as,overflow:ls}:null,retryLane:536870912,hydrationErrors:null},a=A_(i),a.return=r,r.child=a,Ft=r,st=null)):i=null,i===null)throw ln(r);return r.lanes=536870912,null}return wc(r,u)}var g=i.memoizedState;if(g!==null){var C=g.dehydrated;if(Ld(r),m)if(r.flags&256)r.flags&=-257,r=Yy(i,r,a);else if(r.memoizedState!==null)r.child=i.child,r.flags|=128,r=null;else throw Error(n(558));else if(wt||Jr(i,r,a,!1),m=(a&i.childLanes)!==0,wt||m){if(u=et,u!==null&&(C=Pv(u,a),C!==0&&C!==g.retryLane))throw g.retryLane=C,ir(i,C),mi(u,i,C),tf;Nc(),r=Yy(i,r,a)}else i=g.treeContext,st=Hi(C.nextSibling),Ft=r,Ue=!0,an=null,zi=!1,i!==null&&O_(r,i),r=wc(r,u),r.flags|=4096;return r}return i=As(i.child,{mode:u.mode,children:u.children}),i.ref=r.ref,r.child=i,i.return=r,i}function xc(i,r){var a=r.ref;if(a===null)i!==null&&i.ref!==null&&(r.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(n(284));(i===null||i.ref!==a)&&(r.flags|=4194816)}}function sf(i,r,a,u,m){return or(r),a=Pd(i,r,a,u,void 0,m),u=zd(),i!==null&&!wt?(jd(i,r,m),Bs(i,r,m)):(Ue&&u&&vd(r),r.flags|=1,Kt(i,r,a,m),r.child)}function qy(i,r,a,u,m,g){return or(r),r.updateQueue=null,a=X_(r,u,a,m),G_(i),u=zd(),i!==null&&!wt?(jd(i,r,g),Bs(i,r,g)):(Ue&&u&&vd(r),r.flags|=1,Kt(i,r,a,g),r.child)}function $y(i,r,a,u,m){if(or(r),r.stateNode===null){var g=Gr,C=a.contextType;typeof C=="object"&&C!==null&&(g=Wt(C)),g=new a(u,g),r.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=Jd,r.stateNode=g,g._reactInternals=r,g=r.stateNode,g.props=u,g.state=r.memoizedState,g.refs={},Rd(r),C=a.contextType,g.context=typeof C=="object"&&C!==null?Wt(C):Gr,g.state=r.memoizedState,C=a.getDerivedStateFromProps,typeof C=="function"&&(Qd(r,a,C,u),g.state=r.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(C=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),C!==g.state&&Jd.enqueueReplaceState(g,g.state,null),Sa(r,u,g,m),ba(),g.state=r.memoizedState),typeof g.componentDidMount=="function"&&(r.flags|=4194308),u=!0}else if(i===null){g=r.stateNode;var D=r.memoizedProps,G=dr(a,D);g.props=G;var oe=g.context,ce=a.contextType;C=Gr,typeof ce=="object"&&ce!==null&&(C=Wt(ce));var he=a.getDerivedStateFromProps;ce=typeof he=="function"||typeof g.getSnapshotBeforeUpdate=="function",D=r.pendingProps!==D,ce||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(D||oe!==C)&&Ly(r,g,u,C),un=!1;var ae=r.memoizedState;g.state=ae,Sa(r,u,g,m),ba(),oe=r.memoizedState,D||ae!==oe||un?(typeof he=="function"&&(Qd(r,a,he,u),oe=r.memoizedState),(G=un||Ny(r,a,G,u,ae,oe,C))?(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"&&(r.flags|=4194308)):(typeof g.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=u,r.memoizedState=oe),g.props=u,g.state=oe,g.context=C,u=G):(typeof g.componentDidMount=="function"&&(r.flags|=4194308),u=!1)}else{g=r.stateNode,Ad(i,r),C=r.memoizedProps,ce=dr(a,C),g.props=ce,he=r.pendingProps,ae=g.context,oe=a.contextType,G=Gr,typeof oe=="object"&&oe!==null&&(G=Wt(oe)),D=a.getDerivedStateFromProps,(oe=typeof D=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(C!==he||ae!==G)&&Ly(r,g,u,G),un=!1,ae=r.memoizedState,g.state=ae,Sa(r,u,g,m),ba();var le=r.memoizedState;C!==he||ae!==le||un||i!==null&&i.dependencies!==null&&nc(i.dependencies)?(typeof D=="function"&&(Qd(r,a,D,u),le=r.memoizedState),(ce=un||Ny(r,a,ce,u,ae,le,G)||i!==null&&i.dependencies!==null&&nc(i.dependencies))?(oe||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(u,le,G),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(u,le,G)),typeof g.componentDidUpdate=="function"&&(r.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof g.componentDidUpdate!="function"||C===i.memoizedProps&&ae===i.memoizedState||(r.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||C===i.memoizedProps&&ae===i.memoizedState||(r.flags|=1024),r.memoizedProps=u,r.memoizedState=le),g.props=u,g.state=le,g.context=G,u=ce):(typeof g.componentDidUpdate!="function"||C===i.memoizedProps&&ae===i.memoizedState||(r.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||C===i.memoizedProps&&ae===i.memoizedState||(r.flags|=1024),u=!1)}return g=u,xc(i,r),u=(r.flags&128)!==0,g||u?(g=r.stateNode,a=u&&typeof a.getDerivedStateFromError!="function"?null:g.render(),r.flags|=1,i!==null&&u?(r.child=ur(r,i.child,null,m),r.child=ur(r,null,a,m)):Kt(i,r,a,m),r.memoizedState=g.state,i=r.child):i=Bs(i,r,m),i}function Gy(i,r,a,u){return nr(),r.flags|=256,Kt(i,r,a,u),r.child}var nf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function rf(i){return{baseLanes:i,cachePool:j_()}}function of(i,r,a){return i=i!==null?i.childLanes&~a:0,r&&(i|=xi),i}function Xy(i,r,a){var u=r.pendingProps,m=!1,g=(r.flags&128)!==0,C;if((C=g)||(C=i!==null&&i.memoizedState===null?!1:(vt.current&2)!==0),C&&(m=!0,r.flags&=-129),C=(r.flags&32)!==0,r.flags&=-33,i===null){if(Ue){if(m?fn(r):mn(),(i=st)?(i=n0(i,zi),i=i!==null&&i.data!=="&"?i:null,i!==null&&(r.memoizedState={dehydrated:i,treeContext:on!==null?{id:as,overflow:ls}:null,retryLane:536870912,hydrationErrors:null},a=A_(i),a.return=r,r.child=a,Ft=r,st=null)):i=null,i===null)throw ln(r);return Uf(i)?r.lanes=32:r.lanes=536870912,null}var D=u.children;return u=u.fallback,m?(mn(),m=r.mode,D=Cc({mode:"hidden",children:D},m),u=sr(u,m,a,null),D.return=r,u.return=r,D.sibling=u,r.child=D,u=r.child,u.memoizedState=rf(a),u.childLanes=of(i,C,a),r.memoizedState=nf,Ta(null,u)):(fn(r),af(r,D))}var G=i.memoizedState;if(G!==null&&(D=G.dehydrated,D!==null)){if(g)r.flags&256?(fn(r),r.flags&=-257,r=lf(i,r,a)):r.memoizedState!==null?(mn(),r.child=i.child,r.flags|=128,r=null):(mn(),D=u.fallback,m=r.mode,u=Cc({mode:"visible",children:u.children},m),D=sr(D,m,a,null),D.flags|=2,u.return=r,D.return=r,u.sibling=D,r.child=u,ur(r,i.child,null,a),u=r.child,u.memoizedState=rf(a),u.childLanes=of(i,C,a),r.memoizedState=nf,r=Ta(null,u));else if(fn(r),Uf(D)){if(C=D.nextSibling&&D.nextSibling.dataset,C)var oe=C.dgst;C=oe,u=Error(n(419)),u.stack="",u.digest=C,ma({value:u,source:null,stack:null}),r=lf(i,r,a)}else if(wt||Jr(i,r,a,!1),C=(a&i.childLanes)!==0,wt||C){if(C=et,C!==null&&(u=Pv(C,a),u!==0&&u!==G.retryLane))throw G.retryLane=u,ir(i,u),mi(C,i,u),tf;Vf(D)||Nc(),r=lf(i,r,a)}else Vf(D)?(r.flags|=192,r.child=i.child,r=null):(i=G.treeContext,st=Hi(D.nextSibling),Ft=r,Ue=!0,an=null,zi=!1,i!==null&&O_(r,i),r=af(r,u.children),r.flags|=4096);return r}return m?(mn(),D=u.fallback,m=r.mode,G=i.child,oe=G.sibling,u=As(G,{mode:"hidden",children:u.children}),u.subtreeFlags=G.subtreeFlags&65011712,oe!==null?D=As(oe,D):(D=sr(D,m,a,null),D.flags|=2),D.return=r,u.return=r,u.sibling=D,r.child=u,Ta(null,u),u=r.child,D=i.child.memoizedState,D===null?D=rf(a):(m=D.cachePool,m!==null?(G=bt._currentValue,m=m.parent!==G?{parent:G,pool:G}:m):m=j_(),D={baseLanes:D.baseLanes|a,cachePool:m}),u.memoizedState=D,u.childLanes=of(i,C,a),r.memoizedState=nf,Ta(i.child,u)):(fn(r),a=i.child,i=a.sibling,a=As(a,{mode:"visible",children:u.children}),a.return=r,a.sibling=null,i!==null&&(C=r.deletions,C===null?(r.deletions=[i],r.flags|=16):C.push(i)),r.child=a,r.memoizedState=null,a)}function af(i,r){return r=Cc({mode:"visible",children:r},i.mode),r.return=i,i.child=r}function Cc(i,r){return i=yi(22,i,null,r),i.lanes=0,i}function lf(i,r,a){return ur(r,i.child,null,a),i=af(r,r.pendingProps.children),i.flags|=2,r.memoizedState=null,i}function Zy(i,r,a){i.lanes|=r;var u=i.alternate;u!==null&&(u.lanes|=r),wd(i.return,r,a)}function cf(i,r,a,u,m,g){var C=i.memoizedState;C===null?i.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:u,tail:a,tailMode:m,treeForkCount:g}:(C.isBackwards=r,C.rendering=null,C.renderingStartTime=0,C.last=u,C.tail=a,C.tailMode=m,C.treeForkCount=g)}function Qy(i,r,a){var u=r.pendingProps,m=u.revealOrder,g=u.tail;u=u.children;var C=vt.current,D=(C&2)!==0;if(D?(C=C&1|2,r.flags|=128):C&=1,se(vt,C),Kt(i,r,u,a),u=Ue?fa:0,!D&&i!==null&&(i.flags&128)!==0)e:for(i=r.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Zy(i,a,r);else if(i.tag===19)Zy(i,a,r);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(m){case"forwards":for(a=r.child,m=null;a!==null;)i=a.alternate,i!==null&&dc(i)===null&&(m=a),a=a.sibling;a=m,a===null?(m=r.child,r.child=null):(m=a.sibling,a.sibling=null),cf(r,!1,m,a,g,u);break;case"backwards":case"unstable_legacy-backwards":for(a=null,m=r.child,r.child=null;m!==null;){if(i=m.alternate,i!==null&&dc(i)===null){r.child=m;break}i=m.sibling,m.sibling=a,a=m,m=i}cf(r,!0,a,null,g,u);break;case"together":cf(r,!1,null,null,void 0,u);break;default:r.memoizedState=null}return r.child}function Bs(i,r,a){if(i!==null&&(r.dependencies=i.dependencies),vn|=r.lanes,(a&r.childLanes)===0)if(i!==null){if(Jr(i,r,a,!1),(a&r.childLanes)===0)return null}else return null;if(i!==null&&r.child!==i.child)throw Error(n(153));if(r.child!==null){for(i=r.child,a=As(i,i.pendingProps),r.child=a,a.return=r;i.sibling!==null;)i=i.sibling,a=a.sibling=As(i,i.pendingProps),a.return=r;a.sibling=null}return r.child}function uf(i,r){return(i.lanes&r)!==0?!0:(i=i.dependencies,!!(i!==null&&nc(i)))}function DR(i,r,a){switch(r.tag){case 3:ie(r,r.stateNode.containerInfo),cn(r,bt,i.memoizedState.cache),nr();break;case 27:case 5:fe(r);break;case 4:ie(r,r.stateNode.containerInfo);break;case 10:cn(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Ld(r),null;break;case 13:var u=r.memoizedState;if(u!==null)return u.dehydrated!==null?(fn(r),r.flags|=128,null):(a&r.child.childLanes)!==0?Xy(i,r,a):(fn(r),i=Bs(i,r,a),i!==null?i.sibling:null);fn(r);break;case 19:var m=(i.flags&128)!==0;if(u=(a&r.childLanes)!==0,u||(Jr(i,r,a,!1),u=(a&r.childLanes)!==0),m){if(u)return Qy(i,r,a);r.flags|=128}if(m=r.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),se(vt,vt.current),u)break;return null;case 22:return r.lanes=0,Wy(i,r,a,r.pendingProps);case 24:cn(r,bt,i.memoizedState.cache)}return Bs(i,r,a)}function Jy(i,r,a){if(i!==null)if(i.memoizedProps!==r.pendingProps)wt=!0;else{if(!uf(i,a)&&(r.flags&128)===0)return wt=!1,DR(i,r,a);wt=(i.flags&131072)!==0}else wt=!1,Ue&&(r.flags&1048576)!==0&&D_(r,fa,r.index);switch(r.lanes=0,r.tag){case 16:e:{var u=r.pendingProps;if(i=lr(r.elementType),r.type=i,typeof i=="function")md(i)?(u=dr(i,u),r.tag=1,r=$y(null,r,i,u,a)):(r.tag=0,r=sf(null,r,i,u,a));else{if(i!=null){var m=i.$$typeof;if(m===k){r.tag=11,r=Vy(null,r,i,u,a);break e}else if(m===U){r.tag=14,r=Uy(null,r,i,u,a);break e}}throw r=P(i)||i,Error(n(306,r,""))}}return r;case 0:return sf(i,r,r.type,r.pendingProps,a);case 1:return u=r.type,m=dr(u,r.pendingProps),$y(i,r,u,m,a);case 3:e:{if(ie(r,r.stateNode.containerInfo),i===null)throw Error(n(387));u=r.pendingProps;var g=r.memoizedState;m=g.element,Ad(i,r),Sa(r,u,null,a);var C=r.memoizedState;if(u=C.cache,cn(r,bt,u),u!==g.cache&&xd(r,[bt],a,!0),ba(),u=C.element,g.isDehydrated)if(g={element:u,isDehydrated:!1,cache:C.cache},r.updateQueue.baseState=g,r.memoizedState=g,r.flags&256){r=Gy(i,r,u,a);break e}else if(u!==m){m=Li(Error(n(424)),r),ma(m),r=Gy(i,r,u,a);break e}else for(i=r.stateNode.containerInfo,i.nodeType===9?i=i.body:i=i.nodeName==="HTML"?i.ownerDocument.body:i,st=Hi(i.firstChild),Ft=r,Ue=!0,an=null,zi=!0,a=W_(r,null,u,a),r.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(nr(),u===m){r=Bs(i,r,a);break e}Kt(i,r,u,a)}r=r.child}return r;case 26:return xc(i,r),i===null?(a=u0(r.type,null,r.pendingProps,null))?r.memoizedState=a:Ue||(a=r.type,i=r.pendingProps,u=Ic(K.current).createElement(a),u[Ut]=r,u[li]=i,Yt(u,a,i),Lt(u),r.stateNode=u):r.memoizedState=u0(r.type,i.memoizedProps,r.pendingProps,i.memoizedState),null;case 27:return fe(r),i===null&&Ue&&(u=r.stateNode=a0(r.type,r.pendingProps,K.current),Ft=r,zi=!0,m=st,wn(r.type)?(Ff=m,st=Hi(u.firstChild)):st=m),Kt(i,r,r.pendingProps.children,a),xc(i,r),i===null&&(r.flags|=4194304),r.child;case 5:return i===null&&Ue&&((m=u=st)&&(u=aA(u,r.type,r.pendingProps,zi),u!==null?(r.stateNode=u,Ft=r,st=Hi(u.firstChild),zi=!1,m=!0):m=!1),m||ln(r)),fe(r),m=r.type,g=r.pendingProps,C=i!==null?i.memoizedProps:null,u=g.children,jf(m,g)?u=null:C!==null&&jf(m,C)&&(r.flags|=32),r.memoizedState!==null&&(m=Pd(i,r,wR,null,null,a),Va._currentValue=m),xc(i,r),Kt(i,r,u,a),r.child;case 6:return i===null&&Ue&&((i=a=st)&&(a=lA(a,r.pendingProps,zi),a!==null?(r.stateNode=a,Ft=r,st=null,i=!0):i=!1),i||ln(r)),null;case 13:return Xy(i,r,a);case 4:return ie(r,r.stateNode.containerInfo),u=r.pendingProps,i===null?r.child=ur(r,null,u,a):Kt(i,r,u,a),r.child;case 11:return Vy(i,r,r.type,r.pendingProps,a);case 7:return Kt(i,r,r.pendingProps,a),r.child;case 8:return Kt(i,r,r.pendingProps.children,a),r.child;case 12:return Kt(i,r,r.pendingProps.children,a),r.child;case 10:return u=r.pendingProps,cn(r,r.type,u.value),Kt(i,r,u.children,a),r.child;case 9:return m=r.type._context,u=r.pendingProps.children,or(r),m=Wt(m),u=u(m),r.flags|=1,Kt(i,r,u,a),r.child;case 14:return Uy(i,r,r.type,r.pendingProps,a);case 15:return Fy(i,r,r.type,r.pendingProps,a);case 19:return Qy(i,r,a);case 31:return MR(i,r,a);case 22:return Wy(i,r,a,r.pendingProps);case 24:return or(r),u=Wt(bt),i===null?(m=Td(),m===null&&(m=et,g=Cd(),m.pooledCache=g,g.refCount++,g!==null&&(m.pooledCacheLanes|=a),m=g),r.memoizedState={parent:u,cache:m},Rd(r),cn(r,bt,m)):((i.lanes&a)!==0&&(Ad(i,r),Sa(r,null,null,a),ba()),m=i.memoizedState,g=r.memoizedState,m.parent!==u?(m={parent:u,cache:u},r.memoizedState=m,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=m),cn(r,bt,u)):(u=g.cache,cn(r,bt,u),u!==m.cache&&xd(r,[bt],a,!0))),Kt(i,r,r.pendingProps.children,a),r.child;case 29:throw r.pendingProps}throw Error(n(156,r.tag))}function Ps(i){i.flags|=4}function hf(i,r,a,u,m){if((r=(i.mode&32)!==0)&&(r=!1),r){if(i.flags|=16777216,(m&335544128)===m)if(i.stateNode.complete)i.flags|=8192;else if(Tb())i.flags|=8192;else throw cr=lc,kd}else i.flags&=-16777217}function eb(i,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!p0(r))if(Tb())i.flags|=8192;else throw cr=lc,kd}function Ec(i,r){r!==null&&(i.flags|=4),i.flags&16384&&(r=i.tag!==22?Nv():536870912,i.lanes|=r,ho|=r)}function ka(i,r){if(!Ue)switch(i.tailMode){case"hidden":r=i.tail;for(var a=null;r!==null;)r.alternate!==null&&(a=r),r=r.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?r||i.tail===null?i.tail=null:i.tail.sibling=null:u.sibling=null}}function nt(i){var r=i.alternate!==null&&i.alternate.child===i.child,a=0,u=0;if(r)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,r}function OR(i,r,a){var u=r.pendingProps;switch(_d(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return nt(r),null;case 1:return nt(r),null;case 3:return a=r.stateNode,u=null,i!==null&&(u=i.memoizedState.cache),r.memoizedState.cache!==u&&(r.flags|=2048),Os(bt),ne(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(i===null||i.child===null)&&(Qr(r)?Ps(r):i===null||i.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,bd())),nt(r),null;case 26:var m=r.type,g=r.memoizedState;return i===null?(Ps(r),g!==null?(nt(r),eb(r,g)):(nt(r),hf(r,m,null,u,a))):g?g!==i.memoizedState?(Ps(r),nt(r),eb(r,g)):(nt(r),r.flags&=-16777217):(i=i.memoizedProps,i!==u&&Ps(r),nt(r),hf(r,m,i,u,a)),null;case 27:if(me(r),a=K.current,m=r.type,i!==null&&r.stateNode!=null)i.memoizedProps!==u&&Ps(r);else{if(!u){if(r.stateNode===null)throw Error(n(166));return nt(r),null}i=V.current,Qr(r)?N_(r):(i=a0(m,u,a),r.stateNode=i,Ps(r))}return nt(r),null;case 5:if(me(r),m=r.type,i!==null&&r.stateNode!=null)i.memoizedProps!==u&&Ps(r);else{if(!u){if(r.stateNode===null)throw Error(n(166));return nt(r),null}if(g=V.current,Qr(r))N_(r);else{var C=Ic(K.current);switch(g){case 1:g=C.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:g=C.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":g=C.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":g=C.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":g=C.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof u.is=="string"?C.createElement("select",{is:u.is}):C.createElement("select"),u.multiple?g.multiple=!0:u.size&&(g.size=u.size);break;default:g=typeof u.is=="string"?C.createElement(m,{is:u.is}):C.createElement(m)}}g[Ut]=r,g[li]=u;e:for(C=r.child;C!==null;){if(C.tag===5||C.tag===6)g.appendChild(C.stateNode);else if(C.tag!==4&&C.tag!==27&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===r)break e;for(;C.sibling===null;){if(C.return===null||C.return===r)break e;C=C.return}C.sibling.return=C.return,C=C.sibling}r.stateNode=g;e:switch(Yt(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&&Ps(r)}}return nt(r),hf(r,r.type,i===null?null:i.memoizedProps,r.pendingProps,a),null;case 6:if(i&&r.stateNode!=null)i.memoizedProps!==u&&Ps(r);else{if(typeof u!="string"&&r.stateNode===null)throw Error(n(166));if(i=K.current,Qr(r)){if(i=r.stateNode,a=r.memoizedProps,u=null,m=Ft,m!==null)switch(m.tag){case 27:case 5:u=m.memoizedProps}i[Ut]=r,i=!!(i.nodeValue===a||u!==null&&u.suppressHydrationWarning===!0||Xb(i.nodeValue,a)),i||ln(r,!0)}else i=Ic(i).createTextNode(u),i[Ut]=r,r.stateNode=i}return nt(r),null;case 31:if(a=r.memoizedState,i===null||i.memoizedState!==null){if(u=Qr(r),a!==null){if(i===null){if(!u)throw Error(n(318));if(i=r.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(557));i[Ut]=r}else nr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;nt(r),i=!1}else a=bd(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=a),i=!0;if(!i)return r.flags&256?(Si(r),r):(Si(r),null);if((r.flags&128)!==0)throw Error(n(558))}return nt(r),null;case 13:if(u=r.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(m=Qr(r),u!==null&&u.dehydrated!==null){if(i===null){if(!m)throw Error(n(318));if(m=r.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(n(317));m[Ut]=r}else nr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;nt(r),m=!1}else m=bd(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=m),m=!0;if(!m)return r.flags&256?(Si(r),r):(Si(r),null)}return Si(r),(r.flags&128)!==0?(r.lanes=a,r):(a=u!==null,i=i!==null&&i.memoizedState!==null,a&&(u=r.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&&(r.child.flags|=8192),Ec(r,r.updateQueue),nt(r),null);case 4:return ne(),i===null&&Nf(r.stateNode.containerInfo),nt(r),null;case 10:return Os(r.type),nt(r),null;case 19:if(Z(vt),u=r.memoizedState,u===null)return nt(r),null;if(m=(r.flags&128)!==0,g=u.rendering,g===null)if(m)ka(u,!1);else{if(ft!==0||i!==null&&(i.flags&128)!==0)for(i=r.child;i!==null;){if(g=dc(i),g!==null){for(r.flags|=128,ka(u,!1),i=g.updateQueue,r.updateQueue=i,Ec(r,i),r.subtreeFlags=0,i=a,a=r.child;a!==null;)R_(a,i),a=a.sibling;return se(vt,vt.current&1|2),Ue&&Ms(r,u.treeForkCount),r.child}i=i.sibling}u.tail!==null&&Vt()>Mc&&(r.flags|=128,m=!0,ka(u,!1),r.lanes=4194304)}else{if(!m)if(i=dc(g),i!==null){if(r.flags|=128,m=!0,i=i.updateQueue,r.updateQueue=i,Ec(r,i),ka(u,!0),u.tail===null&&u.tailMode==="hidden"&&!g.alternate&&!Ue)return nt(r),null}else 2*Vt()-u.renderingStartTime>Mc&&a!==536870912&&(r.flags|=128,m=!0,ka(u,!1),r.lanes=4194304);u.isBackwards?(g.sibling=r.child,r.child=g):(i=u.last,i!==null?i.sibling=g:r.child=g,u.last=g)}return u.tail!==null?(i=u.tail,u.rendering=i,u.tail=i.sibling,u.renderingStartTime=Vt(),i.sibling=null,a=vt.current,se(vt,m?a&1|2:a&1),Ue&&Ms(r,u.treeForkCount),i):(nt(r),null);case 22:case 23:return Si(r),Nd(),u=r.memoizedState!==null,i!==null?i.memoizedState!==null!==u&&(r.flags|=8192):u&&(r.flags|=8192),u?(a&536870912)!==0&&(r.flags&128)===0&&(nt(r),r.subtreeFlags&6&&(r.flags|=8192)):nt(r),a=r.updateQueue,a!==null&&Ec(r,a.retryQueue),a=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),u=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(u=r.memoizedState.cachePool.pool),u!==a&&(r.flags|=2048),i!==null&&Z(ar),null;case 24:return a=null,i!==null&&(a=i.memoizedState.cache),r.memoizedState.cache!==a&&(r.flags|=2048),Os(bt),nt(r),null;case 25:return null;case 30:return null}throw Error(n(156,r.tag))}function NR(i,r){switch(_d(r),r.tag){case 1:return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 3:return Os(bt),ne(),i=r.flags,(i&65536)!==0&&(i&128)===0?(r.flags=i&-65537|128,r):null;case 26:case 27:case 5:return me(r),null;case 31:if(r.memoizedState!==null){if(Si(r),r.alternate===null)throw Error(n(340));nr()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 13:if(Si(r),i=r.memoizedState,i!==null&&i.dehydrated!==null){if(r.alternate===null)throw Error(n(340));nr()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 19:return Z(vt),null;case 4:return ne(),null;case 10:return Os(r.type),null;case 22:case 23:return Si(r),Nd(),i!==null&&Z(ar),i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 24:return Os(bt),null;case 25:return null;default:return null}}function tb(i,r){switch(_d(r),r.tag){case 3:Os(bt),ne();break;case 26:case 27:case 5:me(r);break;case 4:ne();break;case 31:r.memoizedState!==null&&Si(r);break;case 13:Si(r);break;case 19:Z(vt);break;case 10:Os(r.type);break;case 22:case 23:Si(r),Nd(),i!==null&&Z(ar);break;case 24:Os(bt)}}function Ra(i,r){try{var a=r.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,C=a.inst;u=g(),C.destroy=u}a=a.next}while(a!==m)}}catch(D){$e(r,r.return,D)}}function pn(i,r,a){try{var u=r.updateQueue,m=u!==null?u.lastEffect:null;if(m!==null){var g=m.next;u=g;do{if((u.tag&i)===i){var C=u.inst,D=C.destroy;if(D!==void 0){C.destroy=void 0,m=r;var G=a,oe=D;try{oe()}catch(ce){$e(m,G,ce)}}}u=u.next}while(u!==g)}}catch(ce){$e(r,r.return,ce)}}function ib(i){var r=i.updateQueue;if(r!==null){var a=i.stateNode;try{Y_(r,a)}catch(u){$e(i,i.return,u)}}}function sb(i,r,a){a.props=dr(i.type,i.memoizedProps),a.state=i.memoizedState;try{a.componentWillUnmount()}catch(u){$e(i,r,u)}}function Aa(i,r){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){$e(i,r,m)}}function cs(i,r){var a=i.ref,u=i.refCleanup;if(a!==null)if(typeof u=="function")try{u()}catch(m){$e(i,r,m)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(m){$e(i,r,m)}else a.current=null}function nb(i){var r=i.type,a=i.memoizedProps,u=i.stateNode;try{e:switch(r){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){$e(i,i.return,m)}}function df(i,r,a){try{var u=i.stateNode;tA(u,i.type,a,r),u[li]=r}catch(m){$e(i,i.return,m)}}function rb(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&wn(i.type)||i.tag===4}function ff(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||rb(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&&wn(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 mf(i,r,a){var u=i.tag;if(u===5||u===6)i=i.stateNode,r?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(i,r):(r=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,r.appendChild(i),a=a._reactRootContainer,a!=null||r.onclick!==null||(r.onclick=ks));else if(u!==4&&(u===27&&wn(i.type)&&(a=i.stateNode,r=null),i=i.child,i!==null))for(mf(i,r,a),i=i.sibling;i!==null;)mf(i,r,a),i=i.sibling}function Tc(i,r,a){var u=i.tag;if(u===5||u===6)i=i.stateNode,r?a.insertBefore(i,r):a.appendChild(i);else if(u!==4&&(u===27&&wn(i.type)&&(a=i.stateNode),i=i.child,i!==null))for(Tc(i,r,a),i=i.sibling;i!==null;)Tc(i,r,a),i=i.sibling}function ob(i){var r=i.stateNode,a=i.memoizedProps;try{for(var u=i.type,m=r.attributes;m.length;)r.removeAttributeNode(m[0]);Yt(r,u,a),r[Ut]=i,r[li]=a}catch(g){$e(i,i.return,g)}}var zs=!1,xt=!1,pf=!1,ab=typeof WeakSet=="function"?WeakSet:Set,Bt=null;function LR(i,r){if(i=i.containerInfo,Pf=qc,i=y_(i),ad(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 C=0,D=-1,G=-1,oe=0,ce=0,he=i,ae=null;t:for(;;){for(var le;he!==a||m!==0&&he.nodeType!==3||(D=C+m),he!==g||u!==0&&he.nodeType!==3||(G=C+u),he.nodeType===3&&(C+=he.nodeValue.length),(le=he.firstChild)!==null;)ae=he,he=le;for(;;){if(he===i)break t;if(ae===a&&++oe===m&&(D=C),ae===g&&++ce===u&&(G=C),(le=he.nextSibling)!==null)break;he=ae,ae=he.parentNode}he=le}a=D===-1||G===-1?null:{start:D,end:G}}else a=null}a=a||{start:0,end:0}}else a=null;for(zf={focusedElem:i,selectionRange:a},qc=!1,Bt=r;Bt!==null;)if(r=Bt,i=r.child,(r.subtreeFlags&1028)!==0&&i!==null)i.return=r,Bt=i;else for(;Bt!==null;){switch(r=Bt,g=r.alternate,i=r.flags,r.tag){case 0:if((i&4)!==0&&(i=r.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=r,m=g.memoizedProps,g=g.memoizedState,u=a.stateNode;try{var ve=dr(a.type,m);i=u.getSnapshotBeforeUpdate(ve,g),u.__reactInternalSnapshotBeforeUpdate=i}catch(Te){$e(a,a.return,Te)}}break;case 3:if((i&1024)!==0){if(i=r.stateNode.containerInfo,a=i.nodeType,a===9)If(i);else if(a===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":If(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(n(163))}if(i=r.sibling,i!==null){i.return=r.return,Bt=i;break}Bt=r.return}}function lb(i,r,a){var u=a.flags;switch(a.tag){case 0:case 11:case 15:Hs(i,a),u&4&&Ra(5,a);break;case 1:if(Hs(i,a),u&4)if(i=a.stateNode,r===null)try{i.componentDidMount()}catch(C){$e(a,a.return,C)}else{var m=dr(a.type,r.memoizedProps);r=r.memoizedState;try{i.componentDidUpdate(m,r,i.__reactInternalSnapshotBeforeUpdate)}catch(C){$e(a,a.return,C)}}u&64&&ib(a),u&512&&Aa(a,a.return);break;case 3:if(Hs(i,a),u&64&&(i=a.updateQueue,i!==null)){if(r=null,a.child!==null)switch(a.child.tag){case 27:case 5:r=a.child.stateNode;break;case 1:r=a.child.stateNode}try{Y_(i,r)}catch(C){$e(a,a.return,C)}}break;case 27:r===null&&u&4&&ob(a);case 26:case 5:Hs(i,a),r===null&&u&4&&nb(a),u&512&&Aa(a,a.return);break;case 12:Hs(i,a);break;case 31:Hs(i,a),u&4&&hb(i,a);break;case 13:Hs(i,a),u&4&&db(i,a),u&64&&(i=a.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(a=FR.bind(null,a),cA(i,a))));break;case 22:if(u=a.memoizedState!==null||zs,!u){r=r!==null&&r.memoizedState!==null||xt,m=zs;var g=xt;zs=u,(xt=r)&&!g?Is(i,a,(a.subtreeFlags&8772)!==0):Hs(i,a),zs=m,xt=g}break;case 30:break;default:Hs(i,a)}}function cb(i){var r=i.alternate;r!==null&&(i.alternate=null,cb(r)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(r=i.stateNode,r!==null&&Wh(r)),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 ot=null,ui=!1;function js(i,r,a){for(a=a.child;a!==null;)ub(i,r,a),a=a.sibling}function ub(i,r,a){if(gi&&typeof gi.onCommitFiberUnmount=="function")try{gi.onCommitFiberUnmount(Jo,a)}catch{}switch(a.tag){case 26:xt||cs(a,r),js(i,r,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:xt||cs(a,r);var u=ot,m=ui;wn(a.type)&&(ot=a.stateNode,ui=!1),js(i,r,a),ja(a.stateNode),ot=u,ui=m;break;case 5:xt||cs(a,r);case 6:if(u=ot,m=ui,ot=null,js(i,r,a),ot=u,ui=m,ot!==null)if(ui)try{(ot.nodeType===9?ot.body:ot.nodeName==="HTML"?ot.ownerDocument.body:ot).removeChild(a.stateNode)}catch(g){$e(a,r,g)}else try{ot.removeChild(a.stateNode)}catch(g){$e(a,r,g)}break;case 18:ot!==null&&(ui?(i=ot,i0(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,a.stateNode),bo(i)):i0(ot,a.stateNode));break;case 4:u=ot,m=ui,ot=a.stateNode.containerInfo,ui=!0,js(i,r,a),ot=u,ui=m;break;case 0:case 11:case 14:case 15:pn(2,a,r),xt||pn(4,a,r),js(i,r,a);break;case 1:xt||(cs(a,r),u=a.stateNode,typeof u.componentWillUnmount=="function"&&sb(a,r,u)),js(i,r,a);break;case 21:js(i,r,a);break;case 22:xt=(u=xt)||a.memoizedState!==null,js(i,r,a),xt=u;break;default:js(i,r,a)}}function hb(i,r){if(r.memoizedState===null&&(i=r.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{bo(i)}catch(a){$e(r,r.return,a)}}}function db(i,r){if(r.memoizedState===null&&(i=r.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{bo(i)}catch(a){$e(r,r.return,a)}}function BR(i){switch(i.tag){case 31:case 13:case 19:var r=i.stateNode;return r===null&&(r=i.stateNode=new ab),r;case 22:return i=i.stateNode,r=i._retryCache,r===null&&(r=i._retryCache=new ab),r;default:throw Error(n(435,i.tag))}}function kc(i,r){var a=BR(i);r.forEach(function(u){if(!a.has(u)){a.add(u);var m=WR.bind(null,i,u);u.then(m,m)}})}function hi(i,r){var a=r.deletions;if(a!==null)for(var u=0;u<a.length;u++){var m=a[u],g=i,C=r,D=C;e:for(;D!==null;){switch(D.tag){case 27:if(wn(D.type)){ot=D.stateNode,ui=!1;break e}break;case 5:ot=D.stateNode,ui=!1;break e;case 3:case 4:ot=D.stateNode.containerInfo,ui=!0;break e}D=D.return}if(ot===null)throw Error(n(160));ub(g,C,m),ot=null,ui=!1,g=m.alternate,g!==null&&(g.return=null),m.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)fb(r,i),r=r.sibling}var Gi=null;function fb(i,r){var a=i.alternate,u=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:hi(r,i),di(i),u&4&&(pn(3,i,i.return),Ra(3,i),pn(5,i,i.return));break;case 1:hi(r,i),di(i),u&512&&(xt||a===null||cs(a,a.return)),u&64&&zs&&(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(hi(r,i),di(i),u&512&&(xt||a===null||cs(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[ia]||g[Ut]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=m.createElement(u),m.head.insertBefore(g,m.querySelector("head > title"))),Yt(g,u,a),g[Ut]=i,Lt(g),u=g;break e;case"link":var C=f0("link","href",m).get(u+(a.href||""));if(C){for(var D=0;D<C.length;D++)if(g=C[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)){C.splice(D,1);break t}}g=m.createElement(u),Yt(g,u,a),m.head.appendChild(g);break;case"meta":if(C=f0("meta","content",m).get(u+(a.content||""))){for(D=0;D<C.length;D++)if(g=C[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)){C.splice(D,1);break t}}g=m.createElement(u),Yt(g,u,a),m.head.appendChild(g);break;default:throw Error(n(468,u))}g[Ut]=i,Lt(g),u=g}i.stateNode=u}else m0(m,i.type,i.stateNode);else i.stateNode=d0(m,u,i.memoizedProps);else g!==u?(g===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):g.count--,u===null?m0(m,i.type,i.stateNode):d0(m,u,i.memoizedProps)):u===null&&i.stateNode!==null&&df(i,i.memoizedProps,a.memoizedProps)}break;case 27:hi(r,i),di(i),u&512&&(xt||a===null||cs(a,a.return)),a!==null&&u&4&&df(i,i.memoizedProps,a.memoizedProps);break;case 5:if(hi(r,i),di(i),u&512&&(xt||a===null||cs(a,a.return)),i.flags&32){m=i.stateNode;try{Ur(m,"")}catch(ve){$e(i,i.return,ve)}}u&4&&i.stateNode!=null&&(m=i.memoizedProps,df(i,m,a!==null?a.memoizedProps:m)),u&1024&&(pf=!0);break;case 6:if(hi(r,i),di(i),u&4){if(i.stateNode===null)throw Error(n(162));u=i.memoizedProps,a=i.stateNode;try{a.nodeValue=u}catch(ve){$e(i,i.return,ve)}}break;case 3:if(Fc=null,m=Gi,Gi=Vc(r.containerInfo),hi(r,i),Gi=m,di(i),u&4&&a!==null&&a.memoizedState.isDehydrated)try{bo(r.containerInfo)}catch(ve){$e(i,i.return,ve)}pf&&(pf=!1,mb(i));break;case 4:u=Gi,Gi=Vc(i.stateNode.containerInfo),hi(r,i),di(i),Gi=u;break;case 12:hi(r,i),di(i);break;case 31:hi(r,i),di(i),u&4&&(u=i.updateQueue,u!==null&&(i.updateQueue=null,kc(i,u)));break;case 13:hi(r,i),di(i),i.child.flags&8192&&i.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Ac=Vt()),u&4&&(u=i.updateQueue,u!==null&&(i.updateQueue=null,kc(i,u)));break;case 22:m=i.memoizedState!==null;var G=a!==null&&a.memoizedState!==null,oe=zs,ce=xt;if(zs=oe||m,xt=ce||G,hi(r,i),xt=ce,zs=oe,di(i),u&8192)e:for(r=i.stateNode,r._visibility=m?r._visibility&-2:r._visibility|1,m&&(a===null||G||zs||xt||fr(i)),a=null,r=i;;){if(r.tag===5||r.tag===26){if(a===null){G=a=r;try{if(g=G.stateNode,m)C=g.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none";else{D=G.stateNode;var he=G.memoizedProps.style,ae=he!=null&&he.hasOwnProperty("display")?he.display:null;D.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(ve){$e(G,G.return,ve)}}}else if(r.tag===6){if(a===null){G=r;try{G.stateNode.nodeValue=m?"":G.memoizedProps}catch(ve){$e(G,G.return,ve)}}}else if(r.tag===18){if(a===null){G=r;try{var le=G.stateNode;m?s0(le,!0):s0(G.stateNode,!1)}catch(ve){$e(G,G.return,ve)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===i)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break e;for(;r.sibling===null;){if(r.return===null||r.return===i)break e;a===r&&(a=null),r=r.return}a===r&&(a=null),r.sibling.return=r.return,r=r.sibling}u&4&&(u=i.updateQueue,u!==null&&(a=u.retryQueue,a!==null&&(u.retryQueue=null,kc(i,a))));break;case 19:hi(r,i),di(i),u&4&&(u=i.updateQueue,u!==null&&(i.updateQueue=null,kc(i,u)));break;case 30:break;case 21:break;default:hi(r,i),di(i)}}function di(i){var r=i.flags;if(r&2){try{for(var a,u=i.return;u!==null;){if(rb(u)){a=u;break}u=u.return}if(a==null)throw Error(n(160));switch(a.tag){case 27:var m=a.stateNode,g=ff(i);Tc(i,g,m);break;case 5:var C=a.stateNode;a.flags&32&&(Ur(C,""),a.flags&=-33);var D=ff(i);Tc(i,D,C);break;case 3:case 4:var G=a.stateNode.containerInfo,oe=ff(i);mf(i,oe,G);break;default:throw Error(n(161))}}catch(ce){$e(i,i.return,ce)}i.flags&=-3}r&4096&&(i.flags&=-4097)}function mb(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var r=i;mb(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),i=i.sibling}}function Hs(i,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)lb(i,r.alternate,r),r=r.sibling}function fr(i){for(i=i.child;i!==null;){var r=i;switch(r.tag){case 0:case 11:case 14:case 15:pn(4,r,r.return),fr(r);break;case 1:cs(r,r.return);var a=r.stateNode;typeof a.componentWillUnmount=="function"&&sb(r,r.return,a),fr(r);break;case 27:ja(r.stateNode);case 26:case 5:cs(r,r.return),fr(r);break;case 22:r.memoizedState===null&&fr(r);break;case 30:fr(r);break;default:fr(r)}i=i.sibling}}function Is(i,r,a){for(a=a&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var u=r.alternate,m=i,g=r,C=g.flags;switch(g.tag){case 0:case 11:case 15:Is(m,g,a),Ra(4,g);break;case 1:if(Is(m,g,a),u=g,m=u.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(oe){$e(u,u.return,oe)}if(u=g,m=u.updateQueue,m!==null){var D=u.stateNode;try{var G=m.shared.hiddenCallbacks;if(G!==null)for(m.shared.hiddenCallbacks=null,m=0;m<G.length;m++)K_(G[m],D)}catch(oe){$e(u,u.return,oe)}}a&&C&64&&ib(g),Aa(g,g.return);break;case 27:ob(g);case 26:case 5:Is(m,g,a),a&&u===null&&C&4&&nb(g),Aa(g,g.return);break;case 12:Is(m,g,a);break;case 31:Is(m,g,a),a&&C&4&&hb(m,g);break;case 13:Is(m,g,a),a&&C&4&&db(m,g);break;case 22:g.memoizedState===null&&Is(m,g,a),Aa(g,g.return);break;case 30:break;default:Is(m,g,a)}r=r.sibling}}function gf(i,r){var a=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),i=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(i=r.memoizedState.cachePool.pool),i!==a&&(i!=null&&i.refCount++,a!=null&&pa(a))}function vf(i,r){i=null,r.alternate!==null&&(i=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==i&&(r.refCount++,i!=null&&pa(i))}function Xi(i,r,a,u){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)pb(i,r,a,u),r=r.sibling}function pb(i,r,a,u){var m=r.flags;switch(r.tag){case 0:case 11:case 15:Xi(i,r,a,u),m&2048&&Ra(9,r);break;case 1:Xi(i,r,a,u);break;case 3:Xi(i,r,a,u),m&2048&&(i=null,r.alternate!==null&&(i=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==i&&(r.refCount++,i!=null&&pa(i)));break;case 12:if(m&2048){Xi(i,r,a,u),i=r.stateNode;try{var g=r.memoizedProps,C=g.id,D=g.onPostCommit;typeof D=="function"&&D(C,r.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(G){$e(r,r.return,G)}}else Xi(i,r,a,u);break;case 31:Xi(i,r,a,u);break;case 13:Xi(i,r,a,u);break;case 23:break;case 22:g=r.stateNode,C=r.alternate,r.memoizedState!==null?g._visibility&2?Xi(i,r,a,u):Ma(i,r):g._visibility&2?Xi(i,r,a,u):(g._visibility|=2,lo(i,r,a,u,(r.subtreeFlags&10256)!==0||!1)),m&2048&&gf(C,r);break;case 24:Xi(i,r,a,u),m&2048&&vf(r.alternate,r);break;default:Xi(i,r,a,u)}}function lo(i,r,a,u,m){for(m=m&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var g=i,C=r,D=a,G=u,oe=C.flags;switch(C.tag){case 0:case 11:case 15:lo(g,C,D,G,m),Ra(8,C);break;case 23:break;case 22:var ce=C.stateNode;C.memoizedState!==null?ce._visibility&2?lo(g,C,D,G,m):Ma(g,C):(ce._visibility|=2,lo(g,C,D,G,m)),m&&oe&2048&&gf(C.alternate,C);break;case 24:lo(g,C,D,G,m),m&&oe&2048&&vf(C.alternate,C);break;default:lo(g,C,D,G,m)}r=r.sibling}}function Ma(i,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var a=i,u=r,m=u.flags;switch(u.tag){case 22:Ma(a,u),m&2048&&gf(u.alternate,u);break;case 24:Ma(a,u),m&2048&&vf(u.alternate,u);break;default:Ma(a,u)}r=r.sibling}}var Da=8192;function co(i,r,a){if(i.subtreeFlags&Da)for(i=i.child;i!==null;)gb(i,r,a),i=i.sibling}function gb(i,r,a){switch(i.tag){case 26:co(i,r,a),i.flags&Da&&i.memoizedState!==null&&SA(a,Gi,i.memoizedState,i.memoizedProps);break;case 5:co(i,r,a);break;case 3:case 4:var u=Gi;Gi=Vc(i.stateNode.containerInfo),co(i,r,a),Gi=u;break;case 22:i.memoizedState===null&&(u=i.alternate,u!==null&&u.memoizedState!==null?(u=Da,Da=16777216,co(i,r,a),Da=u):co(i,r,a));break;default:co(i,r,a)}}function vb(i){var r=i.alternate;if(r!==null&&(i=r.child,i!==null)){r.child=null;do r=i.sibling,i.sibling=null,i=r;while(i!==null)}}function Oa(i){var r=i.deletions;if((i.flags&16)!==0){if(r!==null)for(var a=0;a<r.length;a++){var u=r[a];Bt=u,yb(u,i)}vb(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)_b(i),i=i.sibling}function _b(i){switch(i.tag){case 0:case 11:case 15:Oa(i),i.flags&2048&&pn(9,i,i.return);break;case 3:Oa(i);break;case 12:Oa(i);break;case 22:var r=i.stateNode;i.memoizedState!==null&&r._visibility&2&&(i.return===null||i.return.tag!==13)?(r._visibility&=-3,Rc(i)):Oa(i);break;default:Oa(i)}}function Rc(i){var r=i.deletions;if((i.flags&16)!==0){if(r!==null)for(var a=0;a<r.length;a++){var u=r[a];Bt=u,yb(u,i)}vb(i)}for(i=i.child;i!==null;){switch(r=i,r.tag){case 0:case 11:case 15:pn(8,r,r.return),Rc(r);break;case 22:a=r.stateNode,a._visibility&2&&(a._visibility&=-3,Rc(r));break;default:Rc(r)}i=i.sibling}}function yb(i,r){for(;Bt!==null;){var a=Bt;switch(a.tag){case 0:case 11:case 15:pn(8,a,r);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:pa(a.memoizedState.cache)}if(u=a.child,u!==null)u.return=a,Bt=u;else e:for(a=i;Bt!==null;){u=Bt;var m=u.sibling,g=u.return;if(cb(u),u===a){Bt=null;break e}if(m!==null){m.return=g,Bt=m;break e}Bt=g}}}var PR={getCacheForType:function(i){var r=Wt(bt),a=r.data.get(i);return a===void 0&&(a=i(),r.data.set(i,a)),a},cacheSignal:function(){return Wt(bt).controller.signal}},zR=typeof WeakMap=="function"?WeakMap:Map,Ke=0,et=null,je=null,Ie=0,qe=0,wi=null,gn=!1,uo=!1,_f=!1,Vs=0,ft=0,vn=0,mr=0,yf=0,xi=0,ho=0,Na=null,fi=null,bf=!1,Ac=0,bb=0,Mc=1/0,Dc=null,_n=null,Rt=0,yn=null,fo=null,Us=0,Sf=0,wf=null,Sb=null,La=0,xf=null;function Ci(){return(Ke&2)!==0&&Ie!==0?Ie&-Ie:T.T!==null?Af():zv()}function wb(){if(xi===0)if((Ie&536870912)===0||Ue){var i=Hl;Hl<<=1,(Hl&3932160)===0&&(Hl=262144),xi=i}else xi=536870912;return i=bi.current,i!==null&&(i.flags|=32),xi}function mi(i,r,a){(i===et&&(qe===2||qe===9)||i.cancelPendingCommit!==null)&&(mo(i,0),bn(i,Ie,xi,!1)),ta(i,a),((Ke&2)===0||i!==et)&&(i===et&&((Ke&2)===0&&(mr|=a),ft===4&&bn(i,Ie,xi,!1)),us(i))}function xb(i,r,a){if((Ke&6)!==0)throw Error(n(327));var u=!a&&(r&127)===0&&(r&i.expiredLanes)===0||ea(i,r),m=u?IR(i,r):Ef(i,r,!0),g=u;do{if(m===0){uo&&!u&&bn(i,r,0,!1);break}else{if(a=i.current.alternate,g&&!jR(a)){m=Ef(i,r,!1),g=!1;continue}if(m===2){if(g=r,i.errorRecoveryDisabledLanes&g)var C=0;else C=i.pendingLanes&-536870913,C=C!==0?C:C&536870912?536870912:0;if(C!==0){r=C;e:{var D=i;m=Na;var G=D.current.memoizedState.isDehydrated;if(G&&(mo(D,C).flags|=256),C=Ef(D,C,!1),C!==2){if(_f&&!G){D.errorRecoveryDisabledLanes|=g,mr|=g,m=4;break e}g=fi,fi=m,g!==null&&(fi===null?fi=g:fi.push.apply(fi,g))}m=C}if(g=!1,m!==2)continue}}if(m===1){mo(i,0),bn(i,r,0,!0);break}e:{switch(u=i,g=m,g){case 0:case 1:throw Error(n(345));case 4:if((r&4194048)!==r)break;case 6:bn(u,r,xi,!gn);break e;case 2:fi=null;break;case 3:case 5:break;default:throw Error(n(329))}if((r&62914560)===r&&(m=Ac+300-Vt(),10<m)){if(bn(u,r,xi,!gn),Vl(u,0,!0)!==0)break e;Us=r,u.timeoutHandle=e0(Cb.bind(null,u,a,fi,Dc,bf,r,xi,mr,ho,gn,g,"Throttled",-0,0),m);break e}Cb(u,a,fi,Dc,bf,r,xi,mr,ho,gn,g,null,-0,0)}}break}while(!0);us(i)}function Cb(i,r,a,u,m,g,C,D,G,oe,ce,he,ae,le){if(i.timeoutHandle=-1,he=r.subtreeFlags,he&8192||(he&16785408)===16785408){he={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ks},gb(r,g,he);var ve=(g&62914560)===g?Ac-Vt():(g&4194048)===g?bb-Vt():0;if(ve=wA(he,ve),ve!==null){Us=g,i.cancelPendingCommit=ve(Ob.bind(null,i,r,g,a,u,m,C,D,G,ce,he,null,ae,le)),bn(i,g,C,!oe);return}}Ob(i,r,g,a,u,m,C,D,G)}function jR(i){for(var r=i;;){var a=r.tag;if((a===0||a===11||a===15)&&r.flags&16384&&(a=r.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(!_i(g(),m))return!1}catch{return!1}}if(a=r.child,r.subtreeFlags&16384&&a!==null)a.return=r,r=a;else{if(r===i)break;for(;r.sibling===null;){if(r.return===null||r.return===i)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function bn(i,r,a,u){r&=~yf,r&=~mr,i.suspendedLanes|=r,i.pingedLanes&=~r,u&&(i.warmLanes|=r),u=i.expirationTimes;for(var m=r;0<m;){var g=31-vi(m),C=1<<g;u[g]=-1,m&=~C}a!==0&&Lv(i,a,r)}function Oc(){return(Ke&6)===0?(Ba(0),!1):!0}function Cf(){if(je!==null){if(qe===0)var i=je.return;else i=je,Ds=rr=null,Hd(i),so=null,va=0,i=je;for(;i!==null;)tb(i.alternate,i),i=i.return;je=null}}function mo(i,r){var a=i.timeoutHandle;a!==-1&&(i.timeoutHandle=-1,nA(a)),a=i.cancelPendingCommit,a!==null&&(i.cancelPendingCommit=null,a()),Us=0,Cf(),et=i,je=a=As(i.current,null),Ie=r,qe=0,wi=null,gn=!1,uo=ea(i,r),_f=!1,ho=xi=yf=mr=vn=ft=0,fi=Na=null,bf=!1,(r&8)!==0&&(r|=r&32);var u=i.entangledLanes;if(u!==0)for(i=i.entanglements,u&=r;0<u;){var m=31-vi(u),g=1<<m;r|=i[m],u&=~g}return Vs=r,Jl(),a}function Eb(i,r){De=null,T.H=Ea,r===io||r===ac?(r=V_(),qe=3):r===kd?(r=V_(),qe=4):qe=r===tf?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,wi=r,je===null&&(ft=1,Sc(i,Li(r,i.current)))}function Tb(){var i=bi.current;return i===null?!0:(Ie&4194048)===Ie?ji===null:(Ie&62914560)===Ie||(Ie&536870912)!==0?i===ji:!1}function kb(){var i=T.H;return T.H=Ea,i===null?Ea:i}function Rb(){var i=T.A;return T.A=PR,i}function Nc(){ft=4,gn||(Ie&4194048)!==Ie&&bi.current!==null||(uo=!0),(vn&134217727)===0&&(mr&134217727)===0||et===null||bn(et,Ie,xi,!1)}function Ef(i,r,a){var u=Ke;Ke|=2;var m=kb(),g=Rb();(et!==i||Ie!==r)&&(Dc=null,mo(i,r)),r=!1;var C=ft;e:do try{if(qe!==0&&je!==null){var D=je,G=wi;switch(qe){case 8:Cf(),C=6;break e;case 3:case 2:case 9:case 6:bi.current===null&&(r=!0);var oe=qe;if(qe=0,wi=null,po(i,D,G,oe),a&&uo){C=0;break e}break;default:oe=qe,qe=0,wi=null,po(i,D,G,oe)}}HR(),C=ft;break}catch(ce){Eb(i,ce)}while(!0);return r&&i.shellSuspendCounter++,Ds=rr=null,Ke=u,T.H=m,T.A=g,je===null&&(et=null,Ie=0,Jl()),C}function HR(){for(;je!==null;)Ab(je)}function IR(i,r){var a=Ke;Ke|=2;var u=kb(),m=Rb();et!==i||Ie!==r?(Dc=null,Mc=Vt()+500,mo(i,r)):uo=ea(i,r);e:do try{if(qe!==0&&je!==null){r=je;var g=wi;t:switch(qe){case 1:qe=0,wi=null,po(i,r,g,1);break;case 2:case 9:if(H_(g)){qe=0,wi=null,Mb(r);break}r=function(){qe!==2&&qe!==9||et!==i||(qe=7),us(i)},g.then(r,r);break e;case 3:qe=7;break e;case 4:qe=5;break e;case 7:H_(g)?(qe=0,wi=null,Mb(r)):(qe=0,wi=null,po(i,r,g,7));break;case 5:var C=null;switch(je.tag){case 26:C=je.memoizedState;case 5:case 27:var D=je;if(C?p0(C):D.stateNode.complete){qe=0,wi=null;var G=D.sibling;if(G!==null)je=G;else{var oe=D.return;oe!==null?(je=oe,Lc(oe)):je=null}break t}}qe=0,wi=null,po(i,r,g,5);break;case 6:qe=0,wi=null,po(i,r,g,6);break;case 8:Cf(),ft=6;break e;default:throw Error(n(462))}}VR();break}catch(ce){Eb(i,ce)}while(!0);return Ds=rr=null,T.H=u,T.A=m,Ke=a,je!==null?0:(et=null,Ie=0,Jl(),ft)}function VR(){for(;je!==null&&!Xn();)Ab(je)}function Ab(i){var r=Jy(i.alternate,i,Vs);i.memoizedProps=i.pendingProps,r===null?Lc(i):je=r}function Mb(i){var r=i,a=r.alternate;switch(r.tag){case 15:case 0:r=qy(a,r,r.pendingProps,r.type,void 0,Ie);break;case 11:r=qy(a,r,r.pendingProps,r.type.render,r.ref,Ie);break;case 5:Hd(r);default:tb(a,r),r=je=R_(r,Vs),r=Jy(a,r,Vs)}i.memoizedProps=i.pendingProps,r===null?Lc(i):je=r}function po(i,r,a,u){Ds=rr=null,Hd(r),so=null,va=0;var m=r.return;try{if(AR(i,m,r,a,Ie)){ft=1,Sc(i,Li(a,i.current)),je=null;return}}catch(g){if(m!==null)throw je=m,g;ft=1,Sc(i,Li(a,i.current)),je=null;return}r.flags&32768?(Ue||u===1?i=!0:uo||(Ie&536870912)!==0?i=!1:(gn=i=!0,(u===2||u===9||u===3||u===6)&&(u=bi.current,u!==null&&u.tag===13&&(u.flags|=16384))),Db(r,i)):Lc(r)}function Lc(i){var r=i;do{if((r.flags&32768)!==0){Db(r,gn);return}i=r.return;var a=OR(r.alternate,r,Vs);if(a!==null){je=a;return}if(r=r.sibling,r!==null){je=r;return}je=r=i}while(r!==null);ft===0&&(ft=5)}function Db(i,r){do{var a=NR(i.alternate,i);if(a!==null){a.flags&=32767,je=a;return}if(a=i.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!r&&(i=i.sibling,i!==null)){je=i;return}je=i=a}while(i!==null);ft=6,je=null}function Ob(i,r,a,u,m,g,C,D,G){i.cancelPendingCommit=null;do Bc();while(Rt!==0);if((Ke&6)!==0)throw Error(n(327));if(r!==null){if(r===i.current)throw Error(n(177));if(g=r.lanes|r.childLanes,g|=dd,bk(i,a,g,C,D,G),i===et&&(je=et=null,Ie=0),fo=r,yn=i,Us=a,Sf=g,wf=m,Sb=u,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,KR(zl,function(){return zb(),null})):(i.callbackNode=null,i.callbackPriority=0),u=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||u){u=T.T,T.T=null,m=I.p,I.p=2,C=Ke,Ke|=4;try{LR(i,r,a)}finally{Ke=C,I.p=m,T.T=u}}Rt=1,Nb(),Lb(),Bb()}}function Nb(){if(Rt===1){Rt=0;var i=yn,r=fo,a=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||a){a=T.T,T.T=null;var u=I.p;I.p=2;var m=Ke;Ke|=4;try{fb(r,i);var g=zf,C=y_(i.containerInfo),D=g.focusedElem,G=g.selectionRange;if(C!==D&&D&&D.ownerDocument&&__(D.ownerDocument.documentElement,D)){if(G!==null&&ad(D)){var oe=G.start,ce=G.end;if(ce===void 0&&(ce=oe),"selectionStart"in D)D.selectionStart=oe,D.selectionEnd=Math.min(ce,D.value.length);else{var he=D.ownerDocument||document,ae=he&&he.defaultView||window;if(ae.getSelection){var le=ae.getSelection(),ve=D.textContent.length,Te=Math.min(G.start,ve),Qe=G.end===void 0?Te:Math.min(G.end,ve);!le.extend&&Te>Qe&&(C=Qe,Qe=Te,Te=C);var te=v_(D,Te),Q=v_(D,Qe);if(te&&Q&&(le.rangeCount!==1||le.anchorNode!==te.node||le.anchorOffset!==te.offset||le.focusNode!==Q.node||le.focusOffset!==Q.offset)){var re=he.createRange();re.setStart(te.node,te.offset),le.removeAllRanges(),Te>Qe?(le.addRange(re),le.extend(Q.node,Q.offset)):(re.setEnd(Q.node,Q.offset),le.addRange(re))}}}}for(he=[],le=D;le=le.parentNode;)le.nodeType===1&&he.push({element:le,left:le.scrollLeft,top:le.scrollTop});for(typeof D.focus=="function"&&D.focus(),D=0;D<he.length;D++){var ue=he[D];ue.element.scrollLeft=ue.left,ue.element.scrollTop=ue.top}}qc=!!Pf,zf=Pf=null}finally{Ke=m,I.p=u,T.T=a}}i.current=r,Rt=2}}function Lb(){if(Rt===2){Rt=0;var i=yn,r=fo,a=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||a){a=T.T,T.T=null;var u=I.p;I.p=2;var m=Ke;Ke|=4;try{lb(i,r.alternate,r)}finally{Ke=m,I.p=u,T.T=a}}Rt=3}}function Bb(){if(Rt===4||Rt===3){Rt=0,Hh();var i=yn,r=fo,a=Us,u=Sb;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?Rt=5:(Rt=0,fo=yn=null,Pb(i,i.pendingLanes));var m=i.pendingLanes;if(m===0&&(_n=null),Uh(a),r=r.stateNode,gi&&typeof gi.onCommitFiberRoot=="function")try{gi.onCommitFiberRoot(Jo,r,void 0,(r.current.flags&128)===128)}catch{}if(u!==null){r=T.T,m=I.p,I.p=2,T.T=null;try{for(var g=i.onRecoverableError,C=0;C<u.length;C++){var D=u[C];g(D.value,{componentStack:D.stack})}}finally{T.T=r,I.p=m}}(Us&3)!==0&&Bc(),us(i),m=i.pendingLanes,(a&261930)!==0&&(m&42)!==0?i===xf?La++:(La=0,xf=i):La=0,Ba(0)}}function Pb(i,r){(i.pooledCacheLanes&=r)===0&&(r=i.pooledCache,r!=null&&(i.pooledCache=null,pa(r)))}function Bc(){return Nb(),Lb(),Bb(),zb()}function zb(){if(Rt!==5)return!1;var i=yn,r=Sf;Sf=0;var a=Uh(Us),u=T.T,m=I.p;try{I.p=32>a?32:a,T.T=null,a=wf,wf=null;var g=yn,C=Us;if(Rt=0,fo=yn=null,Us=0,(Ke&6)!==0)throw Error(n(331));var D=Ke;if(Ke|=4,_b(g.current),pb(g,g.current,C,a),Ke=D,Ba(0,!1),gi&&typeof gi.onPostCommitFiberRoot=="function")try{gi.onPostCommitFiberRoot(Jo,g)}catch{}return!0}finally{I.p=m,T.T=u,Pb(i,r)}}function jb(i,r,a){r=Li(a,r),r=ef(i.stateNode,r,2),i=dn(i,r,2),i!==null&&(ta(i,2),us(i))}function $e(i,r,a){if(i.tag===3)jb(i,i,a);else for(;r!==null;){if(r.tag===3){jb(r,i,a);break}else if(r.tag===1){var u=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(_n===null||!_n.has(u))){i=Li(a,i),a=Hy(2),u=dn(r,a,2),u!==null&&(Iy(a,u,r,i),ta(u,2),us(u));break}}r=r.return}}function Tf(i,r,a){var u=i.pingCache;if(u===null){u=i.pingCache=new zR;var m=new Set;u.set(r,m)}else m=u.get(r),m===void 0&&(m=new Set,u.set(r,m));m.has(a)||(_f=!0,m.add(a),i=UR.bind(null,i,r,a),r.then(i,i))}function UR(i,r,a){var u=i.pingCache;u!==null&&u.delete(r),i.pingedLanes|=i.suspendedLanes&a,i.warmLanes&=~a,et===i&&(Ie&a)===a&&(ft===4||ft===3&&(Ie&62914560)===Ie&&300>Vt()-Ac?(Ke&2)===0&&mo(i,0):yf|=a,ho===Ie&&(ho=0)),us(i)}function Hb(i,r){r===0&&(r=Nv()),i=ir(i,r),i!==null&&(ta(i,r),us(i))}function FR(i){var r=i.memoizedState,a=0;r!==null&&(a=r.retryLane),Hb(i,a)}function WR(i,r){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(n(314))}u!==null&&u.delete(r),Hb(i,a)}function KR(i,r){return tn(i,r)}var Pc=null,go=null,kf=!1,zc=!1,Rf=!1,Sn=0;function us(i){i!==go&&i.next===null&&(go===null?Pc=go=i:go=go.next=i),zc=!0,kf||(kf=!0,qR())}function Ba(i,r){if(!Rf&&zc){Rf=!0;do for(var a=!1,u=Pc;u!==null;){if(i!==0){var m=u.pendingLanes;if(m===0)var g=0;else{var C=u.suspendedLanes,D=u.pingedLanes;g=(1<<31-vi(42|i)+1)-1,g&=m&~(C&~D),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(a=!0,Fb(u,g))}else g=Ie,g=Vl(u,u===et?g:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(g&3)===0||ea(u,g)||(a=!0,Fb(u,g));u=u.next}while(a);Rf=!1}}function YR(){Ib()}function Ib(){zc=kf=!1;var i=0;Sn!==0&&sA()&&(i=Sn);for(var r=Vt(),a=null,u=Pc;u!==null;){var m=u.next,g=Vb(u,r);g===0?(u.next=null,a===null?Pc=m:a.next=m,m===null&&(go=a)):(a=u,(i!==0||(g&3)!==0)&&(zc=!0)),u=m}Rt!==0&&Rt!==5||Ba(i),Sn!==0&&(Sn=0)}function Vb(i,r){for(var a=i.suspendedLanes,u=i.pingedLanes,m=i.expirationTimes,g=i.pendingLanes&-62914561;0<g;){var C=31-vi(g),D=1<<C,G=m[C];G===-1?((D&a)===0||(D&u)!==0)&&(m[C]=yk(D,r)):G<=r&&(i.expiredLanes|=D),g&=~D}if(r=et,a=Ie,a=Vl(i,i===r?a:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),u=i.callbackNode,a===0||i===r&&(qe===2||qe===9)||i.cancelPendingCommit!==null)return u!==null&&u!==null&&os(u),i.callbackNode=null,i.callbackPriority=0;if((a&3)===0||ea(i,a)){if(r=a&-a,r===i.callbackPriority)return r;switch(u!==null&&os(u),Uh(a)){case 2:case 8:a=Dv;break;case 32:a=zl;break;case 268435456:a=Ov;break;default:a=zl}return u=Ub.bind(null,i),a=tn(a,u),i.callbackPriority=r,i.callbackNode=a,r}return u!==null&&u!==null&&os(u),i.callbackPriority=2,i.callbackNode=null,2}function Ub(i,r){if(Rt!==0&&Rt!==5)return i.callbackNode=null,i.callbackPriority=0,null;var a=i.callbackNode;if(Bc()&&i.callbackNode!==a)return null;var u=Ie;return u=Vl(i,i===et?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),u===0?null:(xb(i,u,r),Vb(i,Vt()),i.callbackNode!=null&&i.callbackNode===a?Ub.bind(null,i):null)}function Fb(i,r){if(Bc())return null;xb(i,r,!0)}function qR(){rA(function(){(Ke&6)!==0?tn(Mv,YR):Ib()})}function Af(){if(Sn===0){var i=eo;i===0&&(i=jl,jl<<=1,(jl&261888)===0&&(jl=256)),Sn=i}return Sn}function Wb(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Kl(""+i)}function Kb(i,r){var a=r.ownerDocument.createElement("input");return a.name=r.name,a.value=r.value,i.id&&a.setAttribute("form",i.id),r.parentNode.insertBefore(a,r),i=new FormData(i),a.parentNode.removeChild(a),i}function $R(i,r,a,u,m){if(r==="submit"&&a&&a.stateNode===m){var g=Wb((m[li]||null).action),C=u.submitter;C&&(r=(r=C[li]||null)?Wb(r.formAction):C.getAttribute("formAction"),r!==null&&(g=r,C=null));var D=new Gl("action","action",null,u,m);i.push({event:D,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(Sn!==0){var G=C?Kb(m,C):new FormData(m);$d(a,{pending:!0,data:G,method:m.method,action:g},null,G)}}else typeof g=="function"&&(D.preventDefault(),G=C?Kb(m,C):new FormData(m),$d(a,{pending:!0,data:G,method:m.method,action:g},g,G))},currentTarget:m}]})}}for(var Mf=0;Mf<hd.length;Mf++){var Df=hd[Mf],GR=Df.toLowerCase(),XR=Df[0].toUpperCase()+Df.slice(1);$i(GR,"on"+XR)}$i(w_,"onAnimationEnd"),$i(x_,"onAnimationIteration"),$i(C_,"onAnimationStart"),$i("dblclick","onDoubleClick"),$i("focusin","onFocus"),$i("focusout","onBlur"),$i(dR,"onTransitionRun"),$i(fR,"onTransitionStart"),$i(mR,"onTransitionCancel"),$i(E_,"onTransitionEnd"),Ir("onMouseEnter",["mouseout","mouseover"]),Ir("onMouseLeave",["mouseout","mouseover"]),Ir("onPointerEnter",["pointerout","pointerover"]),Ir("onPointerLeave",["pointerout","pointerover"]),Qn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Qn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Qn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Qn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Qn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Qn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Pa="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(" "),ZR=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Pa));function Yb(i,r){r=(r&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(r)for(var C=u.length-1;0<=C;C--){var D=u[C],G=D.instance,oe=D.currentTarget;if(D=D.listener,G!==g&&m.isPropagationStopped())break e;g=D,m.currentTarget=oe;try{g(m)}catch(ce){Ql(ce)}m.currentTarget=null,g=G}else for(C=0;C<u.length;C++){if(D=u[C],G=D.instance,oe=D.currentTarget,D=D.listener,G!==g&&m.isPropagationStopped())break e;g=D,m.currentTarget=oe;try{g(m)}catch(ce){Ql(ce)}m.currentTarget=null,g=G}}}}function He(i,r){var a=r[Fh];a===void 0&&(a=r[Fh]=new Set);var u=i+"__bubble";a.has(u)||(qb(r,i,2,!1),a.add(u))}function Of(i,r,a){var u=0;r&&(u|=4),qb(a,i,u,r)}var jc="_reactListening"+Math.random().toString(36).slice(2);function Nf(i){if(!i[jc]){i[jc]=!0,Iv.forEach(function(a){a!=="selectionchange"&&(ZR.has(a)||Of(a,!1,i),Of(a,!0,i))});var r=i.nodeType===9?i:i.ownerDocument;r===null||r[jc]||(r[jc]=!0,Of("selectionchange",!1,r))}}function qb(i,r,a,u){switch(w0(r)){case 2:var m=EA;break;case 8:m=TA;break;default:m=$f}a=m.bind(null,r,a,i),m=void 0,!Qh||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(m=!0),u?m!==void 0?i.addEventListener(r,a,{capture:!0,passive:m}):i.addEventListener(r,a,!0):m!==void 0?i.addEventListener(r,a,{passive:m}):i.addEventListener(r,a,!1)}function Lf(i,r,a,u,m){var g=u;if((r&1)===0&&(r&2)===0&&u!==null)e:for(;;){if(u===null)return;var C=u.tag;if(C===3||C===4){var D=u.stateNode.containerInfo;if(D===m)break;if(C===4)for(C=u.return;C!==null;){var G=C.tag;if((G===3||G===4)&&C.stateNode.containerInfo===m)return;C=C.return}for(;D!==null;){if(C=zr(D),C===null)return;if(G=C.tag,G===5||G===6||G===26||G===27){u=g=C;continue e}D=D.parentNode}}u=u.return}Qv(function(){var oe=g,ce=Xh(a),he=[];e:{var ae=T_.get(i);if(ae!==void 0){var le=Gl,ve=i;switch(i){case"keypress":if(ql(a)===0)break e;case"keydown":case"keyup":le=Wk;break;case"focusin":ve="focus",le=id;break;case"focusout":ve="blur",le=id;break;case"beforeblur":case"afterblur":le=id;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=t_;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":le=Ok;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":le=qk;break;case w_:case x_:case C_:le=Bk;break;case E_:le=Gk;break;case"scroll":case"scrollend":le=Mk;break;case"wheel":le=Zk;break;case"copy":case"cut":case"paste":le=zk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":le=s_;break;case"toggle":case"beforetoggle":le=Jk}var Te=(r&4)!==0,Qe=!Te&&(i==="scroll"||i==="scrollend"),te=Te?ae!==null?ae+"Capture":null:ae;Te=[];for(var Q=oe,re;Q!==null;){var ue=Q;if(re=ue.stateNode,ue=ue.tag,ue!==5&&ue!==26&&ue!==27||re===null||te===null||(ue=na(Q,te),ue!=null&&Te.push(za(Q,ue,re))),Qe)break;Q=Q.return}0<Te.length&&(ae=new le(ae,ve,null,a,ce),he.push({event:ae,listeners:Te}))}}if((r&7)===0){e:{if(ae=i==="mouseover"||i==="pointerover",le=i==="mouseout"||i==="pointerout",ae&&a!==Gh&&(ve=a.relatedTarget||a.fromElement)&&(zr(ve)||ve[Pr]))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?zr(ve):null,ve!==null&&(Qe=l(ve),Te=ve.tag,ve!==Qe||Te!==5&&Te!==27&&Te!==6)&&(ve=null)):(le=null,ve=oe),le!==ve)){if(Te=t_,ue="onMouseLeave",te="onMouseEnter",Q="mouse",(i==="pointerout"||i==="pointerover")&&(Te=s_,ue="onPointerLeave",te="onPointerEnter",Q="pointer"),Qe=le==null?ae:sa(le),re=ve==null?ae:sa(ve),ae=new Te(ue,Q+"leave",le,a,ce),ae.target=Qe,ae.relatedTarget=re,ue=null,zr(ce)===oe&&(Te=new Te(te,Q+"enter",ve,a,ce),Te.target=re,Te.relatedTarget=Qe,ue=Te),Qe=ue,le&&ve)t:{for(Te=QR,te=le,Q=ve,re=0,ue=te;ue;ue=Te(ue))re++;ue=0;for(var Ee=Q;Ee;Ee=Te(Ee))ue++;for(;0<re-ue;)te=Te(te),re--;for(;0<ue-re;)Q=Te(Q),ue--;for(;re--;){if(te===Q||Q!==null&&te===Q.alternate){Te=te;break t}te=Te(te),Q=Te(Q)}Te=null}else Te=null;le!==null&&$b(he,ae,le,Te,!1),ve!==null&&Qe!==null&&$b(he,Qe,ve,Te,!0)}}e:{if(ae=oe?sa(oe):window,le=ae.nodeName&&ae.nodeName.toLowerCase(),le==="select"||le==="input"&&ae.type==="file")var Fe=h_;else if(c_(ae))if(d_)Fe=cR;else{Fe=aR;var Se=oR}else le=ae.nodeName,!le||le.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?oe&&$h(oe.elementType)&&(Fe=h_):Fe=lR;if(Fe&&(Fe=Fe(i,oe))){u_(he,Fe,a,ce);break e}Se&&Se(i,ae,oe),i==="focusout"&&oe&&ae.type==="number"&&oe.memoizedProps.value!=null&&qh(ae,"number",ae.value)}switch(Se=oe?sa(oe):window,i){case"focusin":(c_(Se)||Se.contentEditable==="true")&&(Yr=Se,ld=oe,da=null);break;case"focusout":da=ld=Yr=null;break;case"mousedown":cd=!0;break;case"contextmenu":case"mouseup":case"dragend":cd=!1,b_(he,a,ce);break;case"selectionchange":if(hR)break;case"keydown":case"keyup":b_(he,a,ce)}var Ne;if(nd)e:{switch(i){case"compositionstart":var Ve="onCompositionStart";break e;case"compositionend":Ve="onCompositionEnd";break e;case"compositionupdate":Ve="onCompositionUpdate";break e}Ve=void 0}else Kr?a_(i,a)&&(Ve="onCompositionEnd"):i==="keydown"&&a.keyCode===229&&(Ve="onCompositionStart");Ve&&(n_&&a.locale!=="ko"&&(Kr||Ve!=="onCompositionStart"?Ve==="onCompositionEnd"&&Kr&&(Ne=Jv()):(rn=ce,Jh="value"in rn?rn.value:rn.textContent,Kr=!0)),Se=Hc(oe,Ve),0<Se.length&&(Ve=new i_(Ve,i,null,a,ce),he.push({event:Ve,listeners:Se}),Ne?Ve.data=Ne:(Ne=l_(a),Ne!==null&&(Ve.data=Ne)))),(Ne=tR?iR(i,a):sR(i,a))&&(Ve=Hc(oe,"onBeforeInput"),0<Ve.length&&(Se=new i_("onBeforeInput","beforeinput",null,a,ce),he.push({event:Se,listeners:Ve}),Se.data=Ne)),$R(he,i,oe,a,ce)}Yb(he,r)})}function za(i,r,a){return{instance:i,listener:r,currentTarget:a}}function Hc(i,r){for(var a=r+"Capture",u=[];i!==null;){var m=i,g=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||g===null||(m=na(i,a),m!=null&&u.unshift(za(i,m,g)),m=na(i,r),m!=null&&u.push(za(i,m,g))),i.tag===3)return u;i=i.return}return[]}function QR(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function $b(i,r,a,u,m){for(var g=r._reactName,C=[];a!==null&&a!==u;){var D=a,G=D.alternate,oe=D.stateNode;if(D=D.tag,G!==null&&G===u)break;D!==5&&D!==26&&D!==27||oe===null||(G=oe,m?(oe=na(a,g),oe!=null&&C.unshift(za(a,oe,G))):m||(oe=na(a,g),oe!=null&&C.push(za(a,oe,G)))),a=a.return}C.length!==0&&i.push({event:r,listeners:C})}var JR=/\r\n?/g,eA=/\u0000|\uFFFD/g;function Gb(i){return(typeof i=="string"?i:""+i).replace(JR,`
|
|
9
|
+
`).replace(eA,"")}function Xb(i,r){return r=Gb(r),Gb(i)===r}function Ze(i,r,a,u,m,g){switch(a){case"children":typeof u=="string"?r==="body"||r==="textarea"&&u===""||Ur(i,u):(typeof u=="number"||typeof u=="bigint")&&r!=="body"&&Ur(i,""+u);break;case"className":Fl(i,"class",u);break;case"tabIndex":Fl(i,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":Fl(i,a,u);break;case"style":Xv(i,u,g);break;case"data":if(r!=="object"){Fl(i,"data",u);break}case"src":case"href":if(u===""&&(r!=="a"||a!=="href")){i.removeAttribute(a);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){i.removeAttribute(a);break}u=Kl(""+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"?(r!=="input"&&Ze(i,r,"name",m.name,m,null),Ze(i,r,"formEncType",m.formEncType,m,null),Ze(i,r,"formMethod",m.formMethod,m,null),Ze(i,r,"formTarget",m.formTarget,m,null)):(Ze(i,r,"encType",m.encType,m,null),Ze(i,r,"method",m.method,m,null),Ze(i,r,"target",m.target,m,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){i.removeAttribute(a);break}u=Kl(""+u),i.setAttribute(a,u);break;case"onClick":u!=null&&(i.onclick=ks);break;case"onScroll":u!=null&&He("scroll",i);break;case"onScrollEnd":u!=null&&He("scrollend",i);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(n(61));if(a=u.__html,a!=null){if(m.children!=null)throw Error(n(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=Kl(""+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":He("beforetoggle",i),He("toggle",i),Ul(i,"popover",u);break;case"xlinkActuate":Ts(i,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Ts(i,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Ts(i,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Ts(i,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Ts(i,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Ts(i,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Ts(i,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Ts(i,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Ts(i,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":Ul(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=Rk.get(a)||a,Ul(i,a,u))}}function Bf(i,r,a,u,m,g){switch(a){case"style":Xv(i,u,g);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(n(61));if(a=u.__html,a!=null){if(m.children!=null)throw Error(n(60));i.innerHTML=a}}break;case"children":typeof u=="string"?Ur(i,u):(typeof u=="number"||typeof u=="bigint")&&Ur(i,""+u);break;case"onScroll":u!=null&&He("scroll",i);break;case"onScrollEnd":u!=null&&He("scrollend",i);break;case"onClick":u!=null&&(i.onclick=ks);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Vv.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(m=a.endsWith("Capture"),r=a.slice(2,m?a.length-7:void 0),g=i[li]||null,g=g!=null?g[a]:null,typeof g=="function"&&i.removeEventListener(r,g,m),typeof u=="function")){typeof g!="function"&&g!==null&&(a in i?i[a]=null:i.hasAttribute(a)&&i.removeAttribute(a)),i.addEventListener(r,u,m);break e}a in i?i[a]=u:u===!0?i.setAttribute(a,""):Ul(i,a,u)}}}function Yt(i,r,a){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":He("error",i),He("load",i);var u=!1,m=!1,g;for(g in a)if(a.hasOwnProperty(g)){var C=a[g];if(C!=null)switch(g){case"src":u=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(n(137,r));default:Ze(i,r,g,C,a,null)}}m&&Ze(i,r,"srcSet",a.srcSet,a,null),u&&Ze(i,r,"src",a.src,a,null);return;case"input":He("invalid",i);var D=g=C=m=null,G=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":C=ce;break;case"checked":G=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(n(137,r));break;default:Ze(i,r,u,ce,a,null)}}Yv(i,g,D,G,oe,C,m,!1);return;case"select":He("invalid",i),u=C=g=null;for(m in a)if(a.hasOwnProperty(m)&&(D=a[m],D!=null))switch(m){case"value":g=D;break;case"defaultValue":C=D;break;case"multiple":u=D;default:Ze(i,r,m,D,a,null)}r=g,a=C,i.multiple=!!u,r!=null?Vr(i,!!u,r,!1):a!=null&&Vr(i,!!u,a,!0);return;case"textarea":He("invalid",i),g=m=u=null;for(C in a)if(a.hasOwnProperty(C)&&(D=a[C],D!=null))switch(C){case"value":u=D;break;case"defaultValue":m=D;break;case"children":g=D;break;case"dangerouslySetInnerHTML":if(D!=null)throw Error(n(91));break;default:Ze(i,r,C,D,a,null)}$v(i,u,m,g);return;case"option":for(G in a)a.hasOwnProperty(G)&&(u=a[G],u!=null)&&(G==="selected"?i.selected=u&&typeof u!="function"&&typeof u!="symbol":Ze(i,r,G,u,a,null));return;case"dialog":He("beforetoggle",i),He("toggle",i),He("cancel",i),He("close",i);break;case"iframe":case"object":He("load",i);break;case"video":case"audio":for(u=0;u<Pa.length;u++)He(Pa[u],i);break;case"image":He("error",i),He("load",i);break;case"details":He("toggle",i);break;case"embed":case"source":case"link":He("error",i),He("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(n(137,r));default:Ze(i,r,oe,u,a,null)}return;default:if($h(r)){for(ce in a)a.hasOwnProperty(ce)&&(u=a[ce],u!==void 0&&Bf(i,r,ce,u,a,void 0));return}}for(D in a)a.hasOwnProperty(D)&&(u=a[D],u!=null&&Ze(i,r,D,u,a,null))}function tA(i,r,a,u){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,g=null,C=null,D=null,G=null,oe=null,ce=null;for(le in a){var he=a[le];if(a.hasOwnProperty(le)&&he!=null)switch(le){case"checked":break;case"value":break;case"defaultValue":G=he;default:u.hasOwnProperty(le)||Ze(i,r,le,null,u,he)}}for(var ae in u){var le=u[ae];if(he=a[ae],u.hasOwnProperty(ae)&&(le!=null||he!=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":C=le;break;case"defaultValue":D=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(n(137,r));break;default:le!==he&&Ze(i,r,ae,le,u,he)}}Yh(i,C,D,G,oe,ce,g,m);return;case"select":le=C=D=ae=null;for(g in a)if(G=a[g],a.hasOwnProperty(g)&&G!=null)switch(g){case"value":break;case"multiple":le=G;default:u.hasOwnProperty(g)||Ze(i,r,g,null,u,G)}for(m in u)if(g=u[m],G=a[m],u.hasOwnProperty(m)&&(g!=null||G!=null))switch(m){case"value":ae=g;break;case"defaultValue":D=g;break;case"multiple":C=g;default:g!==G&&Ze(i,r,m,g,u,G)}r=D,a=C,u=le,ae!=null?Vr(i,!!a,ae,!1):!!u!=!!a&&(r!=null?Vr(i,!!a,r,!0):Vr(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:Ze(i,r,D,null,u,m)}for(C in u)if(m=u[C],g=a[C],u.hasOwnProperty(C)&&(m!=null||g!=null))switch(C){case"value":ae=m;break;case"defaultValue":le=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(n(91));break;default:m!==g&&Ze(i,r,C,m,u,g)}qv(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:Ze(i,r,ve,null,u,ae));for(G in u)ae=u[G],le=a[G],u.hasOwnProperty(G)&&ae!==le&&(ae!=null||le!=null)&&(G==="selected"?i.selected=ae&&typeof ae!="function"&&typeof ae!="symbol":Ze(i,r,G,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 Te in a)ae=a[Te],a.hasOwnProperty(Te)&&ae!=null&&!u.hasOwnProperty(Te)&&Ze(i,r,Te,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(n(137,r));break;default:Ze(i,r,oe,ae,u,le)}return;default:if($h(r)){for(var Qe in a)ae=a[Qe],a.hasOwnProperty(Qe)&&ae!==void 0&&!u.hasOwnProperty(Qe)&&Bf(i,r,Qe,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||Bf(i,r,ce,ae,u,le);return}}for(var te in a)ae=a[te],a.hasOwnProperty(te)&&ae!=null&&!u.hasOwnProperty(te)&&Ze(i,r,te,null,u,ae);for(he in u)ae=u[he],le=a[he],!u.hasOwnProperty(he)||ae===le||ae==null&&le==null||Ze(i,r,he,ae,u,le)}function Zb(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function iA(){if(typeof performance.getEntriesByType=="function"){for(var i=0,r=0,a=performance.getEntriesByType("resource"),u=0;u<a.length;u++){var m=a[u],g=m.transferSize,C=m.initiatorType,D=m.duration;if(g&&D&&Zb(C)){for(C=0,D=m.responseEnd,u+=1;u<a.length;u++){var G=a[u],oe=G.startTime;if(oe>D)break;var ce=G.transferSize,he=G.initiatorType;ce&&Zb(he)&&(G=G.responseEnd,C+=ce*(G<D?1:(D-oe)/(G-oe)))}if(--u,r+=8*(g+C)/(m.duration/1e3),i++,10<i)break}}if(0<i)return r/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var Pf=null,zf=null;function Ic(i){return i.nodeType===9?i:i.ownerDocument}function Qb(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 Jb(i,r){if(i===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&r==="foreignObject"?0:i}function jf(i,r){return i==="textarea"||i==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Hf=null;function sA(){var i=window.event;return i&&i.type==="popstate"?i===Hf?!1:(Hf=i,!0):(Hf=null,!1)}var e0=typeof setTimeout=="function"?setTimeout:void 0,nA=typeof clearTimeout=="function"?clearTimeout:void 0,t0=typeof Promise=="function"?Promise:void 0,rA=typeof queueMicrotask=="function"?queueMicrotask:typeof t0<"u"?function(i){return t0.resolve(null).then(i).catch(oA)}:e0;function oA(i){setTimeout(function(){throw i})}function wn(i){return i==="head"}function i0(i,r){var a=r,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),bo(r);return}u--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")u++;else if(a==="html")ja(i.ownerDocument.documentElement);else if(a==="head"){a=i.ownerDocument.head,ja(a);for(var g=a.firstChild;g;){var C=g.nextSibling,D=g.nodeName;g[ia]||D==="SCRIPT"||D==="STYLE"||D==="LINK"&&g.rel.toLowerCase()==="stylesheet"||a.removeChild(g),g=C}}else a==="body"&&ja(i.ownerDocument.body);a=m}while(a);bo(r)}function s0(i,r){var a=i;i=0;do{var u=a.nextSibling;if(a.nodeType===1?r?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(r?(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 If(i){var r=i.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var a=r;switch(r=r.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":If(a),Wh(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}i.removeChild(a)}}function aA(i,r,a,u){for(;i.nodeType===1;){var m=a;if(i.nodeName.toLowerCase()!==r.toLowerCase()){if(!u&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(u){if(!i[ia])switch(r){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(r==="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=Hi(i.nextSibling),i===null)break}return null}function lA(i,r,a){if(r==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!a||(i=Hi(i.nextSibling),i===null))return null;return i}function n0(i,r){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!r||(i=Hi(i.nextSibling),i===null))return null;return i}function Vf(i){return i.data==="$?"||i.data==="$~"}function Uf(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function cA(i,r){var a=i.ownerDocument;if(i.data==="$~")i._reactRetry=r;else if(i.data!=="$?"||a.readyState!=="loading")r();else{var u=function(){r(),a.removeEventListener("DOMContentLoaded",u)};a.addEventListener("DOMContentLoaded",u),i._reactRetry=u}}function Hi(i){for(;i!=null;i=i.nextSibling){var r=i.nodeType;if(r===1||r===3)break;if(r===8){if(r=i.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return i}var Ff=null;function r0(i){i=i.nextSibling;for(var r=0;i;){if(i.nodeType===8){var a=i.data;if(a==="/$"||a==="/&"){if(r===0)return Hi(i.nextSibling);r--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||r++}i=i.nextSibling}return null}function o0(i){i=i.previousSibling;for(var r=0;i;){if(i.nodeType===8){var a=i.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(r===0)return i;r--}else a!=="/$"&&a!=="/&"||r++}i=i.previousSibling}return null}function a0(i,r,a){switch(r=Ic(a),i){case"html":if(i=r.documentElement,!i)throw Error(n(452));return i;case"head":if(i=r.head,!i)throw Error(n(453));return i;case"body":if(i=r.body,!i)throw Error(n(454));return i;default:throw Error(n(451))}}function ja(i){for(var r=i.attributes;r.length;)i.removeAttributeNode(r[0]);Wh(i)}var Ii=new Map,l0=new Set;function Vc(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Fs=I.d;I.d={f:uA,r:hA,D:dA,C:fA,L:mA,m:pA,X:vA,S:gA,M:_A};function uA(){var i=Fs.f(),r=Oc();return i||r}function hA(i){var r=jr(i);r!==null&&r.tag===5&&r.type==="form"?Ey(r):Fs.r(i)}var vo=typeof document>"u"?null:document;function c0(i,r,a){var u=vo;if(u&&typeof r=="string"&&r){var m=Oi(r);m='link[rel="'+i+'"][href="'+m+'"]',typeof a=="string"&&(m+='[crossorigin="'+a+'"]'),l0.has(m)||(l0.add(m),i={rel:i,crossOrigin:a,href:r},u.querySelector(m)===null&&(r=u.createElement("link"),Yt(r,"link",i),Lt(r),u.head.appendChild(r)))}}function dA(i){Fs.D(i),c0("dns-prefetch",i,null)}function fA(i,r){Fs.C(i,r),c0("preconnect",i,r)}function mA(i,r,a){Fs.L(i,r,a);var u=vo;if(u&&i&&r){var m='link[rel="preload"][as="'+Oi(r)+'"]';r==="image"&&a&&a.imageSrcSet?(m+='[imagesrcset="'+Oi(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(m+='[imagesizes="'+Oi(a.imageSizes)+'"]')):m+='[href="'+Oi(i)+'"]';var g=m;switch(r){case"style":g=_o(i);break;case"script":g=yo(i)}Ii.has(g)||(i=v({rel:"preload",href:r==="image"&&a&&a.imageSrcSet?void 0:i,as:r},a),Ii.set(g,i),u.querySelector(m)!==null||r==="style"&&u.querySelector(Ha(g))||r==="script"&&u.querySelector(Ia(g))||(r=u.createElement("link"),Yt(r,"link",i),Lt(r),u.head.appendChild(r)))}}function pA(i,r){Fs.m(i,r);var a=vo;if(a&&i){var u=r&&typeof r.as=="string"?r.as:"script",m='link[rel="modulepreload"][as="'+Oi(u)+'"][href="'+Oi(i)+'"]',g=m;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=yo(i)}if(!Ii.has(g)&&(i=v({rel:"modulepreload",href:i},r),Ii.set(g,i),a.querySelector(m)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Ia(g)))return}u=a.createElement("link"),Yt(u,"link",i),Lt(u),a.head.appendChild(u)}}}function gA(i,r,a){Fs.S(i,r,a);var u=vo;if(u&&i){var m=Hr(u).hoistableStyles,g=_o(i);r=r||"default";var C=m.get(g);if(!C){var D={loading:0,preload:null};if(C=u.querySelector(Ha(g)))D.loading=5;else{i=v({rel:"stylesheet",href:i,"data-precedence":r},a),(a=Ii.get(g))&&Wf(i,a);var G=C=u.createElement("link");Lt(G),Yt(G,"link",i),G._p=new Promise(function(oe,ce){G.onload=oe,G.onerror=ce}),G.addEventListener("load",function(){D.loading|=1}),G.addEventListener("error",function(){D.loading|=2}),D.loading|=4,Uc(C,r,u)}C={type:"stylesheet",instance:C,count:1,state:D},m.set(g,C)}}}function vA(i,r){Fs.X(i,r);var a=vo;if(a&&i){var u=Hr(a).hoistableScripts,m=yo(i),g=u.get(m);g||(g=a.querySelector(Ia(m)),g||(i=v({src:i,async:!0},r),(r=Ii.get(m))&&Kf(i,r),g=a.createElement("script"),Lt(g),Yt(g,"link",i),a.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},u.set(m,g))}}function _A(i,r){Fs.M(i,r);var a=vo;if(a&&i){var u=Hr(a).hoistableScripts,m=yo(i),g=u.get(m);g||(g=a.querySelector(Ia(m)),g||(i=v({src:i,async:!0,type:"module"},r),(r=Ii.get(m))&&Kf(i,r),g=a.createElement("script"),Lt(g),Yt(g,"link",i),a.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},u.set(m,g))}}function u0(i,r,a,u){var m=(m=K.current)?Vc(m):null;if(!m)throw Error(n(446));switch(i){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(r=_o(a.href),a=Hr(m).hoistableStyles,u=a.get(r),u||(u={type:"style",instance:null,count:0,state:null},a.set(r,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=_o(a.href);var g=Hr(m).hoistableStyles,C=g.get(i);if(C||(m=m.ownerDocument||m,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(i,C),(g=m.querySelector(Ha(i)))&&!g._p&&(C.instance=g,C.state.loading=5),Ii.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},Ii.set(i,a),g||yA(m,i,a,C.state))),r&&u===null)throw Error(n(528,""));return C}if(r&&u!==null)throw Error(n(529,""));return null;case"script":return r=a.async,a=a.src,typeof a=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=yo(a),a=Hr(m).hoistableScripts,u=a.get(r),u||(u={type:"script",instance:null,count:0,state:null},a.set(r,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(n(444,i))}}function _o(i){return'href="'+Oi(i)+'"'}function Ha(i){return'link[rel="stylesheet"]['+i+"]"}function h0(i){return v({},i,{"data-precedence":i.precedence,precedence:null})}function yA(i,r,a,u){i.querySelector('link[rel="preload"][as="style"]['+r+"]")?u.loading=1:(r=i.createElement("link"),u.preload=r,r.addEventListener("load",function(){return u.loading|=1}),r.addEventListener("error",function(){return u.loading|=2}),Yt(r,"link",a),Lt(r),i.head.appendChild(r))}function yo(i){return'[src="'+Oi(i)+'"]'}function Ia(i){return"script[async]"+i}function d0(i,r,a){if(r.count++,r.instance===null)switch(r.type){case"style":var u=i.querySelector('style[data-href~="'+Oi(a.href)+'"]');if(u)return r.instance=u,Lt(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"),Lt(u),Yt(u,"style",m),Uc(u,a.precedence,i),r.instance=u;case"stylesheet":m=_o(a.href);var g=i.querySelector(Ha(m));if(g)return r.state.loading|=4,r.instance=g,Lt(g),g;u=h0(a),(m=Ii.get(m))&&Wf(u,m),g=(i.ownerDocument||i).createElement("link"),Lt(g);var C=g;return C._p=new Promise(function(D,G){C.onload=D,C.onerror=G}),Yt(g,"link",u),r.state.loading|=4,Uc(g,a.precedence,i),r.instance=g;case"script":return g=yo(a.src),(m=i.querySelector(Ia(g)))?(r.instance=m,Lt(m),m):(u=a,(m=Ii.get(g))&&(u=v({},a),Kf(u,m)),i=i.ownerDocument||i,m=i.createElement("script"),Lt(m),Yt(m,"link",u),i.head.appendChild(m),r.instance=m);case"void":return null;default:throw Error(n(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(u=r.instance,r.state.loading|=4,Uc(u,a.precedence,i));return r.instance}function Uc(i,r,a){for(var u=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=u.length?u[u.length-1]:null,g=m,C=0;C<u.length;C++){var D=u[C];if(D.dataset.precedence===r)g=D;else if(g!==m)break}g?g.parentNode.insertBefore(i,g.nextSibling):(r=a.nodeType===9?a.head:a,r.insertBefore(i,r.firstChild))}function Wf(i,r){i.crossOrigin==null&&(i.crossOrigin=r.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=r.referrerPolicy),i.title==null&&(i.title=r.title)}function Kf(i,r){i.crossOrigin==null&&(i.crossOrigin=r.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=r.referrerPolicy),i.integrity==null&&(i.integrity=r.integrity)}var Fc=null;function f0(i,r,a){if(Fc===null){var u=new Map,m=Fc=new Map;m.set(a,u)}else m=Fc,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[ia]||g[Ut]||i==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var C=g.getAttribute(r)||"";C=i+C;var D=u.get(C);D?D.push(g):u.set(C,[g])}}return u}function m0(i,r,a){i=i.ownerDocument||i,i.head.insertBefore(a,r==="title"?i.querySelector("head > title"):null)}function bA(i,r,a){if(a===1||r.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;return r.rel==="stylesheet"?(i=r.disabled,typeof r.precedence=="string"&&i==null):!0;case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function p0(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function SA(i,r,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=_o(u.href),g=r.querySelector(Ha(m));if(g){r=g._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(i.count++,i=Wc.bind(i),r.then(i,i)),a.state.loading|=4,a.instance=g,Lt(g);return}g=r.ownerDocument||r,u=h0(u),(m=Ii.get(m))&&Wf(u,m),g=g.createElement("link"),Lt(g);var C=g;C._p=new Promise(function(D,G){C.onload=D,C.onerror=G}),Yt(g,"link",u),a.instance=g}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(a,r),(r=a.state.preload)&&(a.state.loading&3)===0&&(i.count++,a=Wc.bind(i),r.addEventListener("load",a),r.addEventListener("error",a))}}var Yf=0;function wA(i,r){return i.stylesheets&&i.count===0&&Yc(i,i.stylesheets),0<i.count||0<i.imgCount?function(a){var u=setTimeout(function(){if(i.stylesheets&&Yc(i,i.stylesheets),i.unsuspend){var g=i.unsuspend;i.unsuspend=null,g()}},6e4+r);0<i.imgBytes&&Yf===0&&(Yf=62500*iA());var m=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Yc(i,i.stylesheets),i.unsuspend)){var g=i.unsuspend;i.unsuspend=null,g()}},(i.imgBytes>Yf?50:800)+r);return i.unsuspend=a,function(){i.unsuspend=null,clearTimeout(u),clearTimeout(m)}}:null}function Wc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Yc(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Kc=null;function Yc(i,r){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Kc=new Map,r.forEach(xA,i),Kc=null,Wc.call(i))}function xA(i,r){if(!(r.state.loading&4)){var a=Kc.get(i);if(a)var u=a.get(null);else{a=new Map,Kc.set(i,a);for(var m=i.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<m.length;g++){var C=m[g];(C.nodeName==="LINK"||C.getAttribute("media")!=="not all")&&(a.set(C.dataset.precedence,C),u=C)}u&&a.set(null,u)}m=r.instance,C=m.getAttribute("data-precedence"),g=a.get(C)||u,g===u&&a.set(null,m),a.set(C,m),this.count++,u=Wc.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)),r.state.loading|=4}}var Va={$$typeof:M,Provider:null,Consumer:null,_currentValue:B,_currentValue2:B,_threadCount:0};function CA(i,r,a,u,m,g,C,D,G){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=Ih(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ih(0),this.hiddenUpdates=Ih(null),this.identifierPrefix=u,this.onUncaughtError=m,this.onCaughtError=g,this.onRecoverableError=C,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=G,this.incompleteTransitions=new Map}function g0(i,r,a,u,m,g,C,D,G,oe,ce,he){return i=new CA(i,r,a,C,G,oe,ce,he,D),r=1,g===!0&&(r|=24),g=yi(3,null,null,r),i.current=g,g.stateNode=i,r=Cd(),r.refCount++,i.pooledCache=r,r.refCount++,g.memoizedState={element:u,isDehydrated:a,cache:r},Rd(g),i}function v0(i){return i?(i=Gr,i):Gr}function _0(i,r,a,u,m,g){m=v0(m),u.context===null?u.context=m:u.pendingContext=m,u=hn(r),u.payload={element:a},g=g===void 0?null:g,g!==null&&(u.callback=g),a=dn(i,u,r),a!==null&&(mi(a,i,r),ya(a,i,r))}function y0(i,r){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var a=i.retryLane;i.retryLane=a!==0&&a<r?a:r}}function qf(i,r){y0(i,r),(i=i.alternate)&&y0(i,r)}function b0(i){if(i.tag===13||i.tag===31){var r=ir(i,67108864);r!==null&&mi(r,i,67108864),qf(i,67108864)}}function S0(i){if(i.tag===13||i.tag===31){var r=Ci();r=Vh(r);var a=ir(i,r);a!==null&&mi(a,i,r),qf(i,r)}}var qc=!0;function EA(i,r,a,u){var m=T.T;T.T=null;var g=I.p;try{I.p=2,$f(i,r,a,u)}finally{I.p=g,T.T=m}}function TA(i,r,a,u){var m=T.T;T.T=null;var g=I.p;try{I.p=8,$f(i,r,a,u)}finally{I.p=g,T.T=m}}function $f(i,r,a,u){if(qc){var m=Gf(u);if(m===null)Lf(i,r,u,$c,a),x0(i,u);else if(RA(m,i,r,a,u))u.stopPropagation();else if(x0(i,u),r&4&&-1<kA.indexOf(i)){for(;m!==null;){var g=jr(m);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var C=Zn(g.pendingLanes);if(C!==0){var D=g;for(D.pendingLanes|=2,D.entangledLanes|=2;C;){var G=1<<31-vi(C);D.entanglements[1]|=G,C&=~G}us(g),(Ke&6)===0&&(Mc=Vt()+500,Ba(0))}}break;case 31:case 13:D=ir(g,2),D!==null&&mi(D,g,2),Oc(),qf(g,2)}if(g=Gf(u),g===null&&Lf(i,r,u,$c,a),g===m)break;m=g}m!==null&&u.stopPropagation()}else Lf(i,r,u,null,a)}}function Gf(i){return i=Xh(i),Xf(i)}var $c=null;function Xf(i){if($c=null,i=zr(i),i!==null){var r=l(i);if(r===null)i=null;else{var a=r.tag;if(a===13){if(i=c(r),i!==null)return i;i=null}else if(a===31){if(i=h(r),i!==null)return i;i=null}else if(a===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;i=null}else r!==i&&(i=null)}}return $c=i,null}function w0(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(dk()){case Mv:return 2;case Dv:return 8;case zl:case fk:return 32;case Ov:return 268435456;default:return 32}default:return 32}}var Zf=!1,xn=null,Cn=null,En=null,Ua=new Map,Fa=new Map,Tn=[],kA="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 x0(i,r){switch(i){case"focusin":case"focusout":xn=null;break;case"dragenter":case"dragleave":Cn=null;break;case"mouseover":case"mouseout":En=null;break;case"pointerover":case"pointerout":Ua.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Fa.delete(r.pointerId)}}function Wa(i,r,a,u,m,g){return i===null||i.nativeEvent!==g?(i={blockedOn:r,domEventName:a,eventSystemFlags:u,nativeEvent:g,targetContainers:[m]},r!==null&&(r=jr(r),r!==null&&b0(r)),i):(i.eventSystemFlags|=u,r=i.targetContainers,m!==null&&r.indexOf(m)===-1&&r.push(m),i)}function RA(i,r,a,u,m){switch(r){case"focusin":return xn=Wa(xn,i,r,a,u,m),!0;case"dragenter":return Cn=Wa(Cn,i,r,a,u,m),!0;case"mouseover":return En=Wa(En,i,r,a,u,m),!0;case"pointerover":var g=m.pointerId;return Ua.set(g,Wa(Ua.get(g)||null,i,r,a,u,m)),!0;case"gotpointercapture":return g=m.pointerId,Fa.set(g,Wa(Fa.get(g)||null,i,r,a,u,m)),!0}return!1}function C0(i){var r=zr(i.target);if(r!==null){var a=l(r);if(a!==null){if(r=a.tag,r===13){if(r=c(a),r!==null){i.blockedOn=r,jv(i.priority,function(){S0(a)});return}}else if(r===31){if(r=h(a),r!==null){i.blockedOn=r,jv(i.priority,function(){S0(a)});return}}else if(r===3&&a.stateNode.current.memoizedState.isDehydrated){i.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Gc(i){if(i.blockedOn!==null)return!1;for(var r=i.targetContainers;0<r.length;){var a=Gf(i.nativeEvent);if(a===null){a=i.nativeEvent;var u=new a.constructor(a.type,a);Gh=u,a.target.dispatchEvent(u),Gh=null}else return r=jr(a),r!==null&&b0(r),i.blockedOn=a,!1;r.shift()}return!0}function E0(i,r,a){Gc(i)&&a.delete(r)}function AA(){Zf=!1,xn!==null&&Gc(xn)&&(xn=null),Cn!==null&&Gc(Cn)&&(Cn=null),En!==null&&Gc(En)&&(En=null),Ua.forEach(E0),Fa.forEach(E0)}function Xc(i,r){i.blockedOn===r&&(i.blockedOn=null,Zf||(Zf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,AA)))}var Zc=null;function T0(i){Zc!==i&&(Zc=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Zc===i&&(Zc=null);for(var r=0;r<i.length;r+=3){var a=i[r],u=i[r+1],m=i[r+2];if(typeof u!="function"){if(Xf(u||a)===null)continue;break}var g=jr(a);g!==null&&(i.splice(r,3),r-=3,$d(g,{pending:!0,data:m,method:a.method,action:u},u,m))}}))}function bo(i){function r(G){return Xc(G,i)}xn!==null&&Xc(xn,i),Cn!==null&&Xc(Cn,i),En!==null&&Xc(En,i),Ua.forEach(r),Fa.forEach(r);for(var a=0;a<Tn.length;a++){var u=Tn[a];u.blockedOn===i&&(u.blockedOn=null)}for(;0<Tn.length&&(a=Tn[0],a.blockedOn===null);)C0(a),a.blockedOn===null&&Tn.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],C=m[li]||null;if(typeof g=="function")C||T0(a);else if(C){var D=null;if(g&&g.hasAttribute("formAction")){if(m=g,C=g[li]||null)D=C.formAction;else if(Xf(m)!==null)continue}else D=C.action;typeof D=="function"?a[u+1]=D:(a.splice(u,3),u-=3),T0(a)}}}function k0(){function i(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(C){return m=C})},focusReset:"manual",scroll:"manual"})}function r(){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",r),navigation.addEventListener("navigateerror",r),setTimeout(a,100),function(){u=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),m!==null&&(m(),m=null)}}}function Qf(i){this._internalRoot=i}Qc.prototype.render=Qf.prototype.render=function(i){var r=this._internalRoot;if(r===null)throw Error(n(409));var a=r.current,u=Ci();_0(a,u,i,r,null,null)},Qc.prototype.unmount=Qf.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var r=i.containerInfo;_0(i.current,2,null,i,null,null),Oc(),r[Pr]=null}};function Qc(i){this._internalRoot=i}Qc.prototype.unstable_scheduleHydration=function(i){if(i){var r=zv();i={blockedOn:null,target:i,priority:r};for(var a=0;a<Tn.length&&r!==0&&r<Tn[a].priority;a++);Tn.splice(a,0,i),a===0&&C0(i)}};var R0=t.version;if(R0!=="19.2.4")throw Error(n(527,R0,"19.2.4"));I.findDOMNode=function(i){var r=i._reactInternals;if(r===void 0)throw typeof i.render=="function"?Error(n(188)):(i=Object.keys(i).join(","),Error(n(268,i)));return i=d(r),i=i!==null?p(i):null,i=i===null?null:i.stateNode,i};var MA={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:T,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Jc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jc.isDisabled&&Jc.supportsFiber)try{Jo=Jc.inject(MA),gi=Jc}catch{}}return Ya.createRoot=function(i,r){if(!o(i))throw Error(n(299));var a=!1,u="",m=By,g=Py,C=zy;return r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(u=r.identifierPrefix),r.onUncaughtError!==void 0&&(m=r.onUncaughtError),r.onCaughtError!==void 0&&(g=r.onCaughtError),r.onRecoverableError!==void 0&&(C=r.onRecoverableError)),r=g0(i,1,!1,null,null,a,u,null,m,g,C,k0),i[Pr]=r.current,Nf(i),new Qf(r)},Ya.hydrateRoot=function(i,r,a){if(!o(i))throw Error(n(299));var u=!1,m="",g=By,C=Py,D=zy,G=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&&(C=a.onCaughtError),a.onRecoverableError!==void 0&&(D=a.onRecoverableError),a.formState!==void 0&&(G=a.formState)),r=g0(i,1,!0,r,a??null,u,m,G,g,C,D,k0),r.context=v0(null),a=r.current,u=Ci(),u=Vh(u),m=hn(u),m.callback=null,dn(a,m,u),a=u,r.current.lanes=a,ta(r,a),us(r),i[Pr]=r.current,Nf(i),new Qc(r)},Ya.version="19.2.4",Ya}var j0;function IA(){if(j0)return tm.exports;j0=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(),tm.exports=HA(),tm.exports}var VA=IA(),El=Yx();const UA=Wx(El);function H0(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function qx(...e){return t=>{let s=!1;const n=e.map(o=>{const l=H0(o,t);return!s&&typeof l=="function"&&(s=!0),l});if(s)return()=>{for(let o=0;o<n.length;o++){const l=n[o];typeof l=="function"?l():H0(e[o],null)}}}}function Ye(...e){return x.useCallback(qx(...e),e)}function zo(e){const t=FA(e),s=x.forwardRef((n,o)=>{const{children:l,...c}=n,h=x.Children.toArray(l),f=h.find(KA);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 w.jsx(t,{...c,ref:o,children:x.isValidElement(d)?x.cloneElement(d,void 0,p):null})}return w.jsx(t,{...c,ref:o,children:l})});return s.displayName=`${e}.Slot`,s}var $x=zo("Slot");function FA(e){const t=x.forwardRef((s,n)=>{const{children:o,...l}=s;if(x.isValidElement(o)){const c=qA(o),h=YA(l,o.props);return o.type!==x.Fragment&&(h.ref=n?qx(n,c):c),x.cloneElement(o,h)}return x.Children.count(o)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Gx=Symbol("radix.slottable");function WA(e){const t=({children:s})=>w.jsx(w.Fragment,{children:s});return t.displayName=`${e}.Slottable`,t.__radixId=Gx,t}function KA(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Gx}function YA(e,t){const s={...t};for(const n in t){const o=e[n],l=t[n];/^on[A-Z]/.test(n)?o&&l?s[n]=(...h)=>{const f=l(...h);return o(...h),f}:o&&(s[n]=o):n==="style"?s[n]={...o,...l}:n==="className"&&(s[n]=[o,l].filter(Boolean).join(" "))}return{...e,...s}}function qA(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 $A=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Le=$A.reduce((e,t)=>{const s=zo(`Primitive.${t}`),n=x.forwardRef((o,l)=>{const{asChild:c,...h}=o,f=c?s:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(f,{...h,ref:l})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function GA(e,t){e&&El.flushSync(()=>e.dispatchEvent(t))}var Xx=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"}),XA="VisuallyHidden",Zx=x.forwardRef((e,t)=>w.jsx(Le.span,{...e,ref:t,style:{...Xx,...e.style}}));Zx.displayName=XA;var ZA=Zx;function QA(e,t){const s=x.createContext(t),n=l=>{const{children:c,...h}=l,f=x.useMemo(()=>h,Object.values(h));return w.jsx(s.Provider,{value:f,children:c})};n.displayName=e+"Provider";function o(l){const c=x.useContext(s);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${l}\` must be used within \`${e}\``)}return[n,o]}function Fn(e,t=[]){let s=[];function n(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 w.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,[n,JA(o,...t)]}function JA(...e){const t=e[0];if(e.length===1)return t;const s=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(l){const c=n.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 Qx(e){const t=e+"CollectionProvider",[s,n]=Fn(t),[o,l]=s(t,{collectionRef:{current:null},itemMap:new Map}),c=S=>{const{scope:E,children:R}=S,A=Nn.useRef(null),M=Nn.useRef(new Map).current;return w.jsx(o,{scope:E,itemMap:M,collectionRef:A,children:R})};c.displayName=t;const h=e+"CollectionSlot",f=zo(h),d=Nn.forwardRef((S,E)=>{const{scope:R,children:A}=S,M=l(h,R),k=Ye(E,M.collectionRef);return w.jsx(f,{ref:k,children:A})});d.displayName=h;const p=e+"CollectionItemSlot",v="data-radix-collection-item",_=zo(p),y=Nn.forwardRef((S,E)=>{const{scope:R,children:A,...M}=S,k=Nn.useRef(null),j=Ye(E,k),F=l(p,R);return Nn.useEffect(()=>(F.itemMap.set(k,{ref:k,...M}),()=>{F.itemMap.delete(k)})),w.jsx(_,{[v]:"",ref:j,children:A})});y.displayName=p;function b(S){const E=l(e+"CollectionConsumer",S);return Nn.useCallback(()=>{const A=E.collectionRef.current;if(!A)return[];const M=Array.from(A.querySelectorAll(`[${v}]`));return Array.from(E.itemMap.values()).sort((F,U)=>M.indexOf(F.ref.current)-M.indexOf(U.ref.current))},[E.collectionRef,E.itemMap])}return[{Provider:c,Slot:d,ItemSlot:y},b,n]}function Re(e,t,{checkForDefaultPrevented:s=!0}={}){return function(o){if(e?.(o),s===!1||!o.defaultPrevented)return t?.(o)}}var Gt=globalThis?.document?x.useLayoutEffect:()=>{},eM=Kx[" useInsertionEffect ".trim().toString()]||Gt;function jo({prop:e,defaultProp:t,onChange:s=()=>{},caller:n}){const[o,l,c]=tM({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(`${n} 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,n])}const d=x.useCallback(p=>{if(h){const v=iM(p)?p(e):p;v!==e&&c.current?.(v)}else l(p)},[h,e,l,c]);return[f,d]}function tM({defaultProp:e,onChange:t}){const[s,n]=x.useState(e),o=x.useRef(s),l=x.useRef(t);return eM(()=>{l.current=t},[t]),x.useEffect(()=>{o.current!==s&&(l.current?.(s),o.current=s)},[s,o]),[s,n,l]}function iM(e){return typeof e=="function"}function sM(e,t){return x.useReducer((s,n)=>t[s][n]??s,e)}var ns=e=>{const{present:t,children:s}=e,n=nM(t),o=typeof s=="function"?s({present:n.isPresent}):x.Children.only(s),l=Ye(n.ref,rM(o));return typeof s=="function"||n.isPresent?x.cloneElement(o,{ref:l}):null};ns.displayName="Presence";function nM(e){const[t,s]=x.useState(),n=x.useRef(null),o=x.useRef(e),l=x.useRef("none"),c=e?"mounted":"unmounted",[h,f]=sM(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const d=eu(n.current);l.current=h==="mounted"?d:"none"},[h]),Gt(()=>{const d=n.current,p=o.current;if(p!==e){const _=l.current,y=eu(d);e?f("MOUNT"):y==="none"||d?.display==="none"?f("UNMOUNT"):f(p&&_!==y?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,f]),Gt(()=>{if(t){let d;const p=t.ownerDocument.defaultView??window,v=y=>{const S=eu(n.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=eu(n.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=>{n.current=d?getComputedStyle(d):null,s(d)},[])}}function eu(e){return e?.animationName||"none"}function rM(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 oM=Kx[" useId ".trim().toString()]||(()=>{}),aM=0;function $s(e){const[t,s]=x.useState(oM());return Gt(()=>{s(n=>n??String(aM++))},[e]),e||(t?`radix-${t}`:"")}var lM=x.createContext(void 0);function fh(e){const t=x.useContext(lM);return e||t||"ltr"}function ii(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...s)=>t.current?.(...s),[])}function cM(e,t=globalThis?.document){const s=ii(e);x.useEffect(()=>{const n=o=>{o.key==="Escape"&&s(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[s,t])}var uM="DismissableLayer",Gm="dismissableLayer.update",hM="dismissableLayer.pointerDownOutside",dM="dismissableLayer.focusOutside",I0,Jx=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),mh=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:s=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:c,onDismiss:h,...f}=e,d=x.useContext(Jx),[p,v]=x.useState(null),_=p?.ownerDocument??globalThis?.document,[,y]=x.useState({}),b=Ye(t,U=>v(U)),S=Array.from(d.layers),[E]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),R=S.indexOf(E),A=p?S.indexOf(p):-1,M=d.layersWithOutsidePointerEventsDisabled.size>0,k=A>=R,j=pM(U=>{const H=U.target,J=[...d.branches].some(W=>W.contains(H));!k||J||(o?.(U),c?.(U),U.defaultPrevented||h?.())},_),F=gM(U=>{const H=U.target;[...d.branches].some(W=>W.contains(H))||(l?.(U),c?.(U),U.defaultPrevented||h?.())},_);return cM(U=>{A===d.layers.size-1&&(n?.(U),!U.defaultPrevented&&h&&(U.preventDefault(),h()))},_),x.useEffect(()=>{if(p)return s&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(I0=_.body.style.pointerEvents,_.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),V0(),()=>{s&&d.layersWithOutsidePointerEventsDisabled.size===1&&(_.body.style.pointerEvents=I0)}},[p,_,s,d]),x.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),V0())},[p,d]),x.useEffect(()=>{const U=()=>y({});return document.addEventListener(Gm,U),()=>document.removeEventListener(Gm,U)},[]),w.jsx(Le.div,{...f,ref:b,style:{pointerEvents:M?k?"auto":"none":void 0,...e.style},onFocusCapture:Re(e.onFocusCapture,F.onFocusCapture),onBlurCapture:Re(e.onBlurCapture,F.onBlurCapture),onPointerDownCapture:Re(e.onPointerDownCapture,j.onPointerDownCapture)})});mh.displayName=uM;var fM="DismissableLayerBranch",mM=x.forwardRef((e,t)=>{const s=x.useContext(Jx),n=x.useRef(null),o=Ye(t,n);return x.useEffect(()=>{const l=n.current;if(l)return s.branches.add(l),()=>{s.branches.delete(l)}},[s.branches]),w.jsx(Le.div,{...e,ref:o})});mM.displayName=fM;function pM(e,t=globalThis?.document){const s=ii(e),n=x.useRef(!1),o=x.useRef(()=>{});return x.useEffect(()=>{const l=h=>{if(h.target&&!n.current){let f=function(){e1(hM,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);n.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:()=>n.current=!0}}function gM(e,t=globalThis?.document){const s=ii(e),n=x.useRef(!1);return x.useEffect(()=>{const o=l=>{l.target&&!n.current&&e1(dM,s,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,s]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function V0(){const e=new CustomEvent(Gm);document.dispatchEvent(e)}function e1(e,t,s,{discrete:n}){const o=s.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:s});t&&o.addEventListener(e,t,{once:!0}),n?GA(o,l):o.dispatchEvent(l)}var rm="focusScope.autoFocusOnMount",om="focusScope.autoFocusOnUnmount",U0={bubbles:!1,cancelable:!0},vM="FocusScope",_g=x.forwardRef((e,t)=>{const{loop:s=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:l,...c}=e,[h,f]=x.useState(null),d=ii(o),p=ii(l),v=x.useRef(null),_=Ye(t,S=>f(S)),y=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(n){let S=function(M){if(y.paused||!h)return;const k=M.target;h.contains(k)?v.current=k:Ln(v.current,{select:!0})},E=function(M){if(y.paused||!h)return;const k=M.relatedTarget;k!==null&&(h.contains(k)||Ln(v.current,{select:!0}))},R=function(M){if(document.activeElement===document.body)for(const j of M)j.removedNodes.length>0&&Ln(h)};document.addEventListener("focusin",S),document.addEventListener("focusout",E);const A=new MutationObserver(R);return h&&A.observe(h,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",E),A.disconnect()}}},[n,h,y.paused]),x.useEffect(()=>{if(h){W0.add(y);const S=document.activeElement;if(!h.contains(S)){const R=new CustomEvent(rm,U0);h.addEventListener(rm,d),h.dispatchEvent(R),R.defaultPrevented||(_M(xM(t1(h)),{select:!0}),document.activeElement===S&&Ln(h))}return()=>{h.removeEventListener(rm,d),setTimeout(()=>{const R=new CustomEvent(om,U0);h.addEventListener(om,p),h.dispatchEvent(R),R.defaultPrevented||Ln(S??document.body,{select:!0}),h.removeEventListener(om,p),W0.remove(y)},0)}}},[h,d,p,y]);const b=x.useCallback(S=>{if(!s&&!n||y.paused)return;const E=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,R=document.activeElement;if(E&&R){const A=S.currentTarget,[M,k]=yM(A);M&&k?!S.shiftKey&&R===k?(S.preventDefault(),s&&Ln(M,{select:!0})):S.shiftKey&&R===M&&(S.preventDefault(),s&&Ln(k,{select:!0})):R===A&&S.preventDefault()}},[s,n,y.paused]);return w.jsx(Le.div,{tabIndex:-1,...c,ref:_,onKeyDown:b})});_g.displayName=vM;function _M(e,{select:t=!1}={}){const s=document.activeElement;for(const n of e)if(Ln(n,{select:t}),document.activeElement!==s)return}function yM(e){const t=t1(e),s=F0(t,e),n=F0(t.reverse(),e);return[s,n]}function t1(e){const t=[],s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;s.nextNode();)t.push(s.currentNode);return t}function F0(e,t){for(const s of e)if(!bM(s,{upTo:t}))return s}function bM(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 SM(e){return e instanceof HTMLInputElement&&"select"in e}function Ln(e,{select:t=!1}={}){if(e&&e.focus){const s=document.activeElement;e.focus({preventScroll:!0}),e!==s&&SM(e)&&t&&e.select()}}var W0=wM();function wM(){let e=[];return{add(t){const s=e[0];t!==s&&s?.pause(),e=K0(e,t),e.unshift(t)},remove(t){e=K0(e,t),e[0]?.resume()}}}function K0(e,t){const s=[...e],n=s.indexOf(t);return n!==-1&&s.splice(n,1),s}function xM(e){return e.filter(t=>t.tagName!=="A")}var CM="Portal",ph=x.forwardRef((e,t)=>{const{container:s,...n}=e,[o,l]=x.useState(!1);Gt(()=>l(!0),[]);const c=s||o&&globalThis?.document?.body;return c?UA.createPortal(w.jsx(Le.div,{...n,ref:t}),c):null});ph.displayName=CM;var am=0;function i1(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Y0()),document.body.insertAdjacentElement("beforeend",e[1]??Y0()),am++,()=>{am===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),am--}},[])}function Y0(){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 ps=function(){return ps=Object.assign||function(t){for(var s,n=1,o=arguments.length;n<o;n++){s=arguments[n];for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&(t[l]=s[l])}return t},ps.apply(this,arguments)};function s1(e,t){var s={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(s[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(s[n[o]]=e[n[o]]);return s}function EM(e,t,s){if(s||arguments.length===2)for(var n=0,o=t.length,l;n<o;n++)(l||!(n in t))&&(l||(l=Array.prototype.slice.call(t,0,n)),l[n]=t[n]);return e.concat(l||Array.prototype.slice.call(t))}var Su="right-scroll-bar-position",wu="width-before-scroll-bar",TM="with-scroll-bars-hidden",kM="--removed-body-scroll-bar-size";function lm(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function RM(e,t){var s=x.useState(function(){return{value:e,callback:t,facade:{get current(){return s.value},set current(n){var o=s.value;o!==n&&(s.value=n,s.callback(n,o))}}}})[0];return s.callback=t,s.facade}var AM=typeof window<"u"?x.useLayoutEffect:x.useEffect,q0=new WeakMap;function MM(e,t){var s=RM(null,function(n){return e.forEach(function(o){return lm(o,n)})});return AM(function(){var n=q0.get(s);if(n){var o=new Set(n),l=new Set(e),c=s.current;o.forEach(function(h){l.has(h)||lm(h,null)}),l.forEach(function(h){o.has(h)||lm(h,c)})}q0.set(s,e)},[e]),s}function DM(e){return e}function OM(e,t){t===void 0&&(t=DM);var s=[],n=!1,o={read:function(){if(n)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,n);return s.push(c),function(){s=s.filter(function(h){return h!==c})}},assignSyncMedium:function(l){for(n=!0;s.length;){var c=s;s=[],c.forEach(l)}s={push:function(h){return l(h)},filter:function(){return s}}},assignMedium:function(l){n=!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=OM(null);return t.options=ps({async:!0,ssr:!1},e),t}var n1=function(e){var t=e.sideCar,s=s1(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return x.createElement(n,ps({},s))};n1.isSideCarExport=!0;function LM(e,t){return e.useMedium(t),n1}var r1=NM(),cm=function(){},gh=x.forwardRef(function(e,t){var s=x.useRef(null),n=x.useState({onScrollCapture:cm,onWheelCapture:cm,onTouchMoveCapture:cm}),o=n[0],l=n[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,R=e.as,A=R===void 0?"div":R,M=e.gapMode,k=s1(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),j=_,F=MM([s,t]),U=ps(ps({},k),o);return x.createElement(x.Fragment,null,p&&x.createElement(j,{sideCar:r1,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),ps(ps({},U),{ref:F})):x.createElement(A,ps({},U,{className:f,ref:F}),h))});gh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};gh.classNames={fullWidth:wu,zeroRight:Su};var BM=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function PM(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=BM();return t&&e.setAttribute("nonce",t),e}function zM(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function jM(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var HM=function(){var e=0,t=null;return{add:function(s){e==0&&(t=PM())&&(zM(t,s),jM(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},IM=function(){var e=HM();return function(t,s){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&s])}},o1=function(){var e=IM(),t=function(s){var n=s.styles,o=s.dynamic;return e(n,o),null};return t},VM={left:0,top:0,right:0,gap:0},um=function(e){return parseInt(e||"",10)||0},UM=function(e){var t=window.getComputedStyle(document.body),s=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[um(s),um(n),um(o)]},FM=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return VM;var t=UM(e),s=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-s+t[2]-t[0])}},WM=o1(),Lo="data-scroll-locked",KM=function(e,t,s,n){var o=e.left,l=e.top,c=e.right,h=e.gap;return s===void 0&&(s="margin"),`
|
|
10
|
+
.`.concat(TM,` {
|
|
11
|
+
overflow: hidden `).concat(n,`;
|
|
12
|
+
padding-right: `).concat(h,"px ").concat(n,`;
|
|
13
|
+
}
|
|
14
|
+
body[`).concat(Lo,`] {
|
|
15
|
+
overflow: hidden `).concat(n,`;
|
|
16
|
+
overscroll-behavior: contain;
|
|
17
|
+
`).concat([t&&"position: relative ".concat(n,";"),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(n,`;
|
|
24
|
+
`),s==="padding"&&"padding-right: ".concat(h,"px ").concat(n,";")].filter(Boolean).join(""),`
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.`).concat(Su,` {
|
|
28
|
+
right: `).concat(h,"px ").concat(n,`;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.`).concat(wu,` {
|
|
32
|
+
margin-right: `).concat(h,"px ").concat(n,`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.`).concat(Su," .").concat(Su,` {
|
|
36
|
+
right: 0 `).concat(n,`;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.`).concat(wu," .").concat(wu,` {
|
|
40
|
+
margin-right: 0 `).concat(n,`;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
body[`).concat(Lo,`] {
|
|
44
|
+
`).concat(kM,": ").concat(h,`px;
|
|
45
|
+
}
|
|
46
|
+
`)},$0=function(){var e=parseInt(document.body.getAttribute(Lo)||"0",10);return isFinite(e)?e:0},YM=function(){x.useEffect(function(){return document.body.setAttribute(Lo,($0()+1).toString()),function(){var e=$0()-1;e<=0?document.body.removeAttribute(Lo):document.body.setAttribute(Lo,e.toString())}},[])},qM=function(e){var t=e.noRelative,s=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n;YM();var l=x.useMemo(function(){return FM(o)},[o]);return x.createElement(WM,{styles:KM(l,!t,o,s?"":"!important")})},Xm=!1;if(typeof window<"u")try{var tu=Object.defineProperty({},"passive",{get:function(){return Xm=!0,!0}});window.addEventListener("test",tu,tu),window.removeEventListener("test",tu,tu)}catch{Xm=!1}var So=Xm?{passive:!1}:!1,$M=function(e){return e.tagName==="TEXTAREA"},a1=function(e,t){if(!(e instanceof Element))return!1;var s=window.getComputedStyle(e);return s[t]!=="hidden"&&!(s.overflowY===s.overflowX&&!$M(e)&&s[t]==="visible")},GM=function(e){return a1(e,"overflowY")},XM=function(e){return a1(e,"overflowX")},G0=function(e,t){var s=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=l1(e,n);if(o){var l=c1(e,n),c=l[1],h=l[2];if(c>h)return!0}n=n.parentNode}while(n&&n!==s.body);return!1},ZM=function(e){var t=e.scrollTop,s=e.scrollHeight,n=e.clientHeight;return[t,s,n]},QM=function(e){var t=e.scrollLeft,s=e.scrollWidth,n=e.clientWidth;return[t,s,n]},l1=function(e,t){return e==="v"?GM(t):XM(t)},c1=function(e,t){return e==="v"?ZM(t):QM(t)},JM=function(e,t){return e==="h"&&t==="rtl"?-1:1},eD=function(e,t,s,n,o){var l=JM(e,window.getComputedStyle(t).direction),c=l*n,h=s.target,f=t.contains(h),d=!1,p=c>0,v=0,_=0;do{if(!h)break;var y=c1(e,h),b=y[0],S=y[1],E=y[2],R=S-E-l*b;(b||R)&&l1(e,h)&&(v+=R,_+=b);var A=h.parentNode;h=A&&A.nodeType===Node.DOCUMENT_FRAGMENT_NODE?A.host:A}while(!f&&h!==document.body||f&&(t.contains(h)||t===h));return(p&&Math.abs(v)<1||!p&&Math.abs(_)<1)&&(d=!0),d},iu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},X0=function(e){return[e.deltaX,e.deltaY]},Z0=function(e){return e&&"current"in e?e.current:e},tD=function(e,t){return e[0]===t[0]&&e[1]===t[1]},iD=function(e){return`
|
|
47
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
48
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
49
|
+
`)},sD=0,wo=[];function nD(e){var t=x.useRef([]),s=x.useRef([0,0]),n=x.useRef(),o=x.useState(sD++)[0],l=x.useState(o1)[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=EM([e.lockRef.current],(e.shards||[]).map(Z0),!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 R=iu(S),A=s.current,M="deltaX"in S?S.deltaX:A[0]-R[0],k="deltaY"in S?S.deltaY:A[1]-R[1],j,F=S.target,U=Math.abs(M)>Math.abs(k)?"h":"v";if("touches"in S&&U==="h"&&F.type==="range")return!1;var H=window.getSelection(),J=H&&H.anchorNode,W=J?J===F||J.contains(F):!1;if(W)return!1;var $=G0(U,F);if(!$)return!0;if($?j=U:(j=U==="v"?"h":"v",$=G0(U,F)),!$)return!1;if(!n.current&&"changedTouches"in S&&(M||k)&&(n.current=j),!j)return!0;var z=n.current||j;return eD(z,E,S,z==="h"?M:k)},[]),f=x.useCallback(function(S){var E=S;if(!(!wo.length||wo[wo.length-1]!==l)){var R="deltaY"in E?X0(E):iu(E),A=t.current.filter(function(j){return j.name===E.type&&(j.target===E.target||E.target===j.shadowParent)&&tD(j.delta,R)})[0];if(A&&A.should){E.cancelable&&E.preventDefault();return}if(!A){var M=(c.current.shards||[]).map(Z0).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,R,A){var M={name:S,delta:E,target:R,should:A,shadowParent:rD(R)};t.current.push(M),setTimeout(function(){t.current=t.current.filter(function(k){return k!==M})},1)},[]),p=x.useCallback(function(S){s.current=iu(S),n.current=void 0},[]),v=x.useCallback(function(S){d(S.type,X0(S),S.target,h(S,e.lockRef.current))},[]),_=x.useCallback(function(S){d(S.type,iu(S),S.target,h(S,e.lockRef.current))},[]);x.useEffect(function(){return wo.push(l),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:_}),document.addEventListener("wheel",f,So),document.addEventListener("touchmove",f,So),document.addEventListener("touchstart",p,So),function(){wo=wo.filter(function(S){return S!==l}),document.removeEventListener("wheel",f,So),document.removeEventListener("touchmove",f,So),document.removeEventListener("touchstart",p,So)}},[]);var y=e.removeScrollBar,b=e.inert;return x.createElement(x.Fragment,null,b?x.createElement(l,{styles:iD(o)}):null,y?x.createElement(qM,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function rD(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const oD=LM(r1,nD);var yg=x.forwardRef(function(e,t){return x.createElement(gh,ps({},e,{ref:t,sideCar:oD}))});yg.classNames=gh.classNames;var aD=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},xo=new WeakMap,su=new WeakMap,nu={},hm=0,u1=function(e){return e&&(e.host||u1(e.parentNode))},lD=function(e,t){return t.map(function(s){if(e.contains(s))return s;var n=u1(s);return n&&e.contains(n)?n:(console.error("aria-hidden",s,"in not contained inside",e,". Doing nothing"),null)}).filter(function(s){return!!s})},cD=function(e,t,s,n){var o=lD(t,Array.isArray(e)?e:[e]);nu[s]||(nu[s]=new WeakMap);var l=nu[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(n),b=y!==null&&y!=="false",S=(xo.get(_)||0)+1,E=(l.get(_)||0)+1;xo.set(_,S),l.set(_,E),c.push(_),S===1&&b&&su.set(_,!0),E===1&&_.setAttribute(s,"true"),b||_.setAttribute(n,"true")}catch(R){console.error("aria-hidden: cannot operate on ",_,R)}})};return p(t),h.clear(),hm++,function(){c.forEach(function(v){var _=xo.get(v)-1,y=l.get(v)-1;xo.set(v,_),l.set(v,y),_||(su.has(v)||v.removeAttribute(n),su.delete(v)),y||v.removeAttribute(s)}),hm--,hm||(xo=new WeakMap,xo=new WeakMap,su=new WeakMap,nu={})}},h1=function(e,t,s){s===void 0&&(s="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=aD(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),cD(n,o,s,"aria-hidden")):function(){return null}},vh="Dialog",[d1]=Fn(vh),[uD,rs]=d1(vh),f1=e=>{const{__scopeDialog:t,children:s,open:n,defaultOpen:o,onOpenChange:l,modal:c=!0}=e,h=x.useRef(null),f=x.useRef(null),[d,p]=jo({prop:n,defaultProp:o??!1,onChange:l,caller:vh});return w.jsx(uD,{scope:t,triggerRef:h,contentRef:f,contentId:$s(),titleId:$s(),descriptionId:$s(),open:d,onOpenChange:p,onOpenToggle:x.useCallback(()=>p(v=>!v),[p]),modal:c,children:s})};f1.displayName=vh;var m1="DialogTrigger",hD=x.forwardRef((e,t)=>{const{__scopeDialog:s,...n}=e,o=rs(m1,s),l=Ye(t,o.triggerRef);return w.jsx(Le.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":wg(o.open),...n,ref:l,onClick:Re(e.onClick,o.onOpenToggle)})});hD.displayName=m1;var bg="DialogPortal",[dD,p1]=d1(bg,{forceMount:void 0}),g1=e=>{const{__scopeDialog:t,forceMount:s,children:n,container:o}=e,l=rs(bg,t);return w.jsx(dD,{scope:t,forceMount:s,children:x.Children.map(n,c=>w.jsx(ns,{present:s||l.open,children:w.jsx(ph,{asChild:!0,container:o,children:c})}))})};g1.displayName=bg;var Uu="DialogOverlay",v1=x.forwardRef((e,t)=>{const s=p1(Uu,e.__scopeDialog),{forceMount:n=s.forceMount,...o}=e,l=rs(Uu,e.__scopeDialog);return l.modal?w.jsx(ns,{present:n||l.open,children:w.jsx(mD,{...o,ref:t})}):null});v1.displayName=Uu;var fD=zo("DialogOverlay.RemoveScroll"),mD=x.forwardRef((e,t)=>{const{__scopeDialog:s,...n}=e,o=rs(Uu,s);return w.jsx(yg,{as:fD,allowPinchZoom:!0,shards:[o.contentRef],children:w.jsx(Le.div,{"data-state":wg(o.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),Rr="DialogContent",_1=x.forwardRef((e,t)=>{const s=p1(Rr,e.__scopeDialog),{forceMount:n=s.forceMount,...o}=e,l=rs(Rr,e.__scopeDialog);return w.jsx(ns,{present:n||l.open,children:l.modal?w.jsx(pD,{...o,ref:t}):w.jsx(gD,{...o,ref:t})})});_1.displayName=Rr;var pD=x.forwardRef((e,t)=>{const s=rs(Rr,e.__scopeDialog),n=x.useRef(null),o=Ye(t,s.contentRef,n);return x.useEffect(()=>{const l=n.current;if(l)return h1(l)},[]),w.jsx(y1,{...e,ref:o,trapFocus:s.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Re(e.onCloseAutoFocus,l=>{l.preventDefault(),s.triggerRef.current?.focus()}),onPointerDownOutside:Re(e.onPointerDownOutside,l=>{const c=l.detail.originalEvent,h=c.button===0&&c.ctrlKey===!0;(c.button===2||h)&&l.preventDefault()}),onFocusOutside:Re(e.onFocusOutside,l=>l.preventDefault())})}),gD=x.forwardRef((e,t)=>{const s=rs(Rr,e.__scopeDialog),n=x.useRef(!1),o=x.useRef(!1);return w.jsx(y1,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{e.onCloseAutoFocus?.(l),l.defaultPrevented||(n.current||s.triggerRef.current?.focus(),l.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:l=>{e.onInteractOutside?.(l),l.defaultPrevented||(n.current=!0,l.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const c=l.target;s.triggerRef.current?.contains(c)&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&o.current&&l.preventDefault()}})}),y1=x.forwardRef((e,t)=>{const{__scopeDialog:s,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:l,...c}=e,h=rs(Rr,s),f=x.useRef(null),d=Ye(t,f);return i1(),w.jsxs(w.Fragment,{children:[w.jsx(_g,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:l,children:w.jsx(mh,{role:"dialog",id:h.contentId,"aria-describedby":h.descriptionId,"aria-labelledby":h.titleId,"data-state":wg(h.open),...c,ref:d,onDismiss:()=>h.onOpenChange(!1)})}),w.jsxs(w.Fragment,{children:[w.jsx(vD,{titleId:h.titleId}),w.jsx(yD,{contentRef:f,descriptionId:h.descriptionId})]})]})}),Sg="DialogTitle",b1=x.forwardRef((e,t)=>{const{__scopeDialog:s,...n}=e,o=rs(Sg,s);return w.jsx(Le.h2,{id:o.titleId,...n,ref:t})});b1.displayName=Sg;var S1="DialogDescription",w1=x.forwardRef((e,t)=>{const{__scopeDialog:s,...n}=e,o=rs(S1,s);return w.jsx(Le.p,{id:o.descriptionId,...n,ref:t})});w1.displayName=S1;var x1="DialogClose",C1=x.forwardRef((e,t)=>{const{__scopeDialog:s,...n}=e,o=rs(x1,s);return w.jsx(Le.button,{type:"button",...n,ref:t,onClick:Re(e.onClick,()=>o.onOpenChange(!1))})});C1.displayName=x1;function wg(e){return e?"open":"closed"}var E1="DialogTitleWarning",[VI,T1]=QA(E1,{contentName:Rr,titleName:Sg,docsSlug:"dialog"}),vD=({titleId:e})=>{const t=T1(E1),s=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
50
|
+
|
|
51
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
52
|
+
|
|
53
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(s))},[s,e]),null},_D="DialogDescriptionWarning",yD=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${T1(_D).contentName}}.`;return x.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},bD=f1,SD=g1,wD=v1,xD=_1,CD=b1,ED=w1,k1=C1;function TD(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 kD(e){const[t,s]=x.useState(void 0);return Gt(()=>{if(e){s({width:e.offsetWidth,height:e.offsetHeight});const n=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 n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else s(void 0)},[e]),t}const RD=["top","right","bottom","left"],In=Math.min,Ri=Math.max,Fu=Math.round,ru=Math.floor,_s=e=>({x:e,y:e}),AD={left:"right",right:"left",bottom:"top",top:"bottom"};function Zm(e,t,s){return Ri(e,In(t,s))}function Gs(e,t){return typeof e=="function"?e(t):e}function Xs(e){return e.split("-")[0]}function Ko(e){return e.split("-")[1]}function xg(e){return e==="x"?"y":"x"}function Cg(e){return e==="y"?"height":"width"}function gs(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Eg(e){return xg(gs(e))}function MD(e,t,s){s===void 0&&(s=!1);const n=Ko(e),o=Eg(e),l=Cg(o);let c=o==="x"?n===(s?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(c=Wu(c)),[c,Wu(c)]}function DD(e){const t=Wu(e);return[Qm(e),t,Qm(t)]}function Qm(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Q0=["left","right"],J0=["right","left"],OD=["top","bottom"],ND=["bottom","top"];function LD(e,t,s){switch(e){case"top":case"bottom":return s?t?J0:Q0:t?Q0:J0;case"left":case"right":return t?OD:ND;default:return[]}}function BD(e,t,s,n){const o=Ko(e);let l=LD(Xs(e),s==="start",n);return o&&(l=l.map(c=>c+"-"+o),t&&(l=l.concat(l.map(Qm)))),l}function Wu(e){const t=Xs(e);return AD[t]+e.slice(t.length)}function PD(e){return{top:0,right:0,bottom:0,left:0,...e}}function R1(e){return typeof e!="number"?PD(e):{top:e,right:e,bottom:e,left:e}}function Ku(e){const{x:t,y:s,width:n,height:o}=e;return{width:n,height:o,top:s,left:t,right:t+n,bottom:s+o,x:t,y:s}}function eS(e,t,s){let{reference:n,floating:o}=e;const l=gs(t),c=Eg(t),h=Cg(c),f=Xs(t),d=l==="y",p=n.x+n.width/2-o.width/2,v=n.y+n.height/2-o.height/2,_=n[h]/2-o[h]/2;let y;switch(f){case"top":y={x:p,y:n.y-o.height};break;case"bottom":y={x:p,y:n.y+n.height};break;case"right":y={x:n.x+n.width,y:v};break;case"left":y={x:n.x-o.width,y:v};break;default:y={x:n.x,y:n.y}}switch(Ko(t)){case"start":y[c]-=_*(s&&d?-1:1);break;case"end":y[c]+=_*(s&&d?-1:1);break}return y}async function zD(e,t){var s;t===void 0&&(t={});const{x:n,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}=Gs(t,e),b=R1(y),E=h[_?v==="floating"?"reference":"floating":v],R=Ku(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})),A=v==="floating"?{x:n,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=Ku(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:A,offsetParent:M,strategy:f}):A);return{top:(R.top-j.top+b.top)/k.y,bottom:(j.bottom-R.bottom+b.bottom)/k.y,left:(R.left-j.left+b.left)/k.x,right:(j.right-R.right+b.right)/k.x}}const jD=50,HD=async(e,t,s)=>{const{placement:n="bottom",strategy:o="absolute",middleware:l=[],platform:c}=s,h=c.detectOverflow?c:{...c,detectOverflow:zD},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}=eS(d,n,f),_=n,y=0;const b={};for(let S=0;S<l.length;S++){const E=l[S];if(!E)continue;const{name:R,fn:A}=E,{x:M,y:k,data:j,reset:F}=await A({x:p,y:v,initialPlacement:n,placement:_,strategy:o,middlewareData:b,rects:d,platform:h,elements:{reference:e,floating:t}});p=M??p,v=k??v,b[R]={...b[R],...j},F&&y<jD&&(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}=eS(d,_,f)),S=-1)}return{x:p,y:v,placement:_,strategy:o,middlewareData:b}},ID=e=>({name:"arrow",options:e,async fn(t){const{x:s,y:n,placement:o,rects:l,platform:c,elements:h,middlewareData:f}=t,{element:d,padding:p=0}=Gs(e,t)||{};if(d==null)return{};const v=R1(p),_={x:s,y:n},y=Eg(o),b=Cg(y),S=await c.getDimensions(d),E=y==="y",R=E?"top":"left",A=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 U=F?F[M]:0;(!U||!await(c.isElement==null?void 0:c.isElement(F)))&&(U=h.floating[M]||l.floating[b]);const H=k/2-j/2,J=U/2-S[b]/2-1,W=In(v[R],J),$=In(v[A],J),z=W,L=U-S[b]-$,P=U/2-S[b]/2+H,q=Zm(z,P,L),T=!f.arrow&&Ko(o)!=null&&P!==q&&l.reference[b]/2-(P<z?W:$)-S[b]/2<0,I=T?P<z?P-z:P-L:0;return{[y]:_[y]+I,data:{[y]:q,centerOffset:P-q-I,...T&&{alignmentOffset:I}},reset:T}}}),VD=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var s,n;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}=Gs(e,t);if((s=l.arrow)!=null&&s.alignmentOffset)return{};const R=Xs(o),A=gs(h),M=Xs(h)===h,k=await(f.isRTL==null?void 0:f.isRTL(d.floating)),j=_||(M||!S?[Wu(h)]:DD(h)),F=b!=="none";!_&&F&&j.push(...BD(h,S,b,k));const U=[h,...j],H=await f.detectOverflow(t,E),J=[];let W=((n=l.flip)==null?void 0:n.overflows)||[];if(p&&J.push(H[R]),v){const P=MD(o,c,k);J.push(H[P[0]],H[P[1]])}if(W=[...W,{placement:o,overflows:J}],!J.every(P=>P<=0)){var $,z;const P=((($=l.flip)==null?void 0:$.index)||0)+1,q=U[P];if(q&&(!(v==="alignment"?A!==gs(q):!1)||W.every(B=>gs(B.placement)===A?B.overflows[0]>0:!0)))return{data:{index:P,overflows:W},reset:{placement:q}};let T=(z=W.filter(I=>I.overflows[0]<=0).sort((I,B)=>I.overflows[1]-B.overflows[1])[0])==null?void 0:z.placement;if(!T)switch(y){case"bestFit":{var L;const I=(L=W.filter(B=>{if(F){const ee=gs(B.placement);return ee===A||ee==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(ee=>ee>0).reduce((ee,X)=>ee+X,0)]).sort((B,ee)=>B[1]-ee[1])[0])==null?void 0:L[0];I&&(T=I);break}case"initialPlacement":T=h;break}if(o!==T)return{reset:{placement:T}}}return{}}}};function tS(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function iS(e){return RD.some(t=>e[t]>=0)}const UD=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:s,platform:n}=t,{strategy:o="referenceHidden",...l}=Gs(e,t);switch(o){case"referenceHidden":{const c=await n.detectOverflow(t,{...l,elementContext:"reference"}),h=tS(c,s.reference);return{data:{referenceHiddenOffsets:h,referenceHidden:iS(h)}}}case"escaped":{const c=await n.detectOverflow(t,{...l,altBoundary:!0}),h=tS(c,s.floating);return{data:{escapedOffsets:h,escaped:iS(h)}}}default:return{}}}}},A1=new Set(["left","top"]);async function FD(e,t){const{placement:s,platform:n,elements:o}=e,l=await(n.isRTL==null?void 0:n.isRTL(o.floating)),c=Xs(s),h=Ko(s),f=gs(s)==="y",d=A1.has(c)?-1:1,p=l&&f?-1:1,v=Gs(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 WD=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var s,n;const{x:o,y:l,placement:c,middlewareData:h}=t,f=await FD(t,e);return c===((s=h.offset)==null?void 0:s.placement)&&(n=h.arrow)!=null&&n.alignmentOffset?{}:{x:o+f.x,y:l+f.y,data:{...f,placement:c}}}}},KD=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:s,y:n,placement:o,platform:l}=t,{mainAxis:c=!0,crossAxis:h=!1,limiter:f={fn:R=>{let{x:A,y:M}=R;return{x:A,y:M}}},...d}=Gs(e,t),p={x:s,y:n},v=await l.detectOverflow(t,d),_=gs(Xs(o)),y=xg(_);let b=p[y],S=p[_];if(c){const R=y==="y"?"top":"left",A=y==="y"?"bottom":"right",M=b+v[R],k=b-v[A];b=Zm(M,b,k)}if(h){const R=_==="y"?"top":"left",A=_==="y"?"bottom":"right",M=S+v[R],k=S-v[A];S=Zm(M,S,k)}const E=f.fn({...t,[y]:b,[_]:S});return{...E,data:{x:E.x-s,y:E.y-n,enabled:{[y]:c,[_]:h}}}}}},YD=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:s,y:n,placement:o,rects:l,middlewareData:c}=t,{offset:h=0,mainAxis:f=!0,crossAxis:d=!0}=Gs(e,t),p={x:s,y:n},v=gs(o),_=xg(v);let y=p[_],b=p[v];const S=Gs(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 R,A;const M=_==="y"?"width":"height",k=A1.has(Xs(o)),j=l.reference[v]-l.floating[M]+(k&&((R=c.offset)==null?void 0:R[v])||0)+(k?0:E.crossAxis),F=l.reference[v]+l.reference[M]+(k?0:((A=c.offset)==null?void 0:A[v])||0)-(k?E.crossAxis:0);b<j?b=j:b>F&&(b=F)}return{[_]:y,[v]:b}}}},qD=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var s,n;const{placement:o,rects:l,platform:c,elements:h}=t,{apply:f=()=>{},...d}=Gs(e,t),p=await c.detectOverflow(t,d),v=Xs(o),_=Ko(o),y=gs(o)==="y",{width:b,height:S}=l.floating;let E,R;v==="top"||v==="bottom"?(E=v,R=_===(await(c.isRTL==null?void 0:c.isRTL(h.floating))?"start":"end")?"left":"right"):(R=v,E=_==="end"?"top":"bottom");const A=S-p.top-p.bottom,M=b-p.left-p.right,k=In(S-p[E],A),j=In(b-p[R],M),F=!t.middlewareData.shift;let U=k,H=j;if((s=t.middlewareData.shift)!=null&&s.enabled.x&&(H=M),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(U=A),F&&!_){const W=Ri(p.left,0),$=Ri(p.right,0),z=Ri(p.top,0),L=Ri(p.bottom,0);y?H=b-2*(W!==0||$!==0?W+$:Ri(p.left,p.right)):U=S-2*(z!==0||L!==0?z+L:Ri(p.top,p.bottom))}await f({...t,availableWidth:H,availableHeight:U});const J=await c.getDimensions(h.floating);return b!==J.width||S!==J.height?{reset:{rects:!0}}:{}}}};function _h(){return typeof window<"u"}function Yo(e){return M1(e)?(e.nodeName||"").toLowerCase():"#document"}function Ai(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function xs(e){var t;return(t=(M1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function M1(e){return _h()?e instanceof Node||e instanceof Ai(e).Node:!1}function ts(e){return _h()?e instanceof Element||e instanceof Ai(e).Element:!1}function Qs(e){return _h()?e instanceof HTMLElement||e instanceof Ai(e).HTMLElement:!1}function sS(e){return!_h()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ai(e).ShadowRoot}function Tl(e){const{overflow:t,overflowX:s,overflowY:n,display:o}=is(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+s)&&o!=="inline"&&o!=="contents"}function $D(e){return/^(table|td|th)$/.test(Yo(e))}function yh(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const GD=/transform|translate|scale|rotate|perspective|filter/,XD=/paint|layout|strict|content/,pr=e=>!!e&&e!=="none";let dm;function Tg(e){const t=ts(e)?is(e):e;return pr(t.transform)||pr(t.translate)||pr(t.scale)||pr(t.rotate)||pr(t.perspective)||!kg()&&(pr(t.backdropFilter)||pr(t.filter))||GD.test(t.willChange||"")||XD.test(t.contain||"")}function ZD(e){let t=Vn(e);for(;Qs(t)&&!Ho(t);){if(Tg(t))return t;if(yh(t))return null;t=Vn(t)}return null}function kg(){return dm==null&&(dm=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),dm}function Ho(e){return/^(html|body|#document)$/.test(Yo(e))}function is(e){return Ai(e).getComputedStyle(e)}function bh(e){return ts(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Vn(e){if(Yo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||sS(e)&&e.host||xs(e);return sS(t)?t.host:t}function D1(e){const t=Vn(e);return Ho(t)?e.ownerDocument?e.ownerDocument.body:e.body:Qs(t)&&Tl(t)?t:D1(t)}function pl(e,t,s){var n;t===void 0&&(t=[]),s===void 0&&(s=!0);const o=D1(e),l=o===((n=e.ownerDocument)==null?void 0:n.body),c=Ai(o);if(l){const h=Jm(c);return t.concat(c,c.visualViewport||[],Tl(o)?o:[],h&&s?pl(h):[])}else return t.concat(o,pl(o,[],s))}function Jm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function O1(e){const t=is(e);let s=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Qs(e),l=o?e.offsetWidth:s,c=o?e.offsetHeight:n,h=Fu(s)!==l||Fu(n)!==c;return h&&(s=l,n=c),{width:s,height:n,$:h}}function Rg(e){return ts(e)?e:e.contextElement}function Bo(e){const t=Rg(e);if(!Qs(t))return _s(1);const s=t.getBoundingClientRect(),{width:n,height:o,$:l}=O1(t);let c=(l?Fu(s.width):s.width)/n,h=(l?Fu(s.height):s.height)/o;return(!c||!Number.isFinite(c))&&(c=1),(!h||!Number.isFinite(h))&&(h=1),{x:c,y:h}}const QD=_s(0);function N1(e){const t=Ai(e);return!kg()||!t.visualViewport?QD:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function JD(e,t,s){return t===void 0&&(t=!1),!s||t&&s!==Ai(e)?!1:t}function Ar(e,t,s,n){t===void 0&&(t=!1),s===void 0&&(s=!1);const o=e.getBoundingClientRect(),l=Rg(e);let c=_s(1);t&&(n?ts(n)&&(c=Bo(n)):c=Bo(e));const h=JD(l,s,n)?N1(l):_s(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 _=Ai(l),y=n&&ts(n)?Ai(n):n;let b=_,S=Jm(b);for(;S&&n&&y!==b;){const E=Bo(S),R=S.getBoundingClientRect(),A=is(S),M=R.left+(S.clientLeft+parseFloat(A.paddingLeft))*E.x,k=R.top+(S.clientTop+parseFloat(A.paddingTop))*E.y;f*=E.x,d*=E.y,p*=E.x,v*=E.y,f+=M,d+=k,b=Ai(S),S=Jm(b)}}return Ku({width:p,height:v,x:f,y:d})}function Sh(e,t){const s=bh(e).scrollLeft;return t?t.left+s:Ar(xs(e)).left+s}function L1(e,t){const s=e.getBoundingClientRect(),n=s.left+t.scrollLeft-Sh(e,s),o=s.top+t.scrollTop;return{x:n,y:o}}function eO(e){let{elements:t,rect:s,offsetParent:n,strategy:o}=e;const l=o==="fixed",c=xs(n),h=t?yh(t.floating):!1;if(n===c||h&&l)return s;let f={scrollLeft:0,scrollTop:0},d=_s(1);const p=_s(0),v=Qs(n);if((v||!v&&!l)&&((Yo(n)!=="body"||Tl(c))&&(f=bh(n)),v)){const y=Ar(n);d=Bo(n),p.x=y.x+n.clientLeft,p.y=y.y+n.clientTop}const _=c&&!v&&!l?L1(c,f):_s(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 tO(e){return Array.from(e.getClientRects())}function iO(e){const t=xs(e),s=bh(e),n=e.ownerDocument.body,o=Ri(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),l=Ri(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let c=-s.scrollLeft+Sh(e);const h=-s.scrollTop;return is(n).direction==="rtl"&&(c+=Ri(t.clientWidth,n.clientWidth)-o),{width:o,height:l,x:c,y:h}}const nS=25;function sO(e,t){const s=Ai(e),n=xs(e),o=s.visualViewport;let l=n.clientWidth,c=n.clientHeight,h=0,f=0;if(o){l=o.width,c=o.height;const p=kg();(!p||p&&t==="fixed")&&(h=o.offsetLeft,f=o.offsetTop)}const d=Sh(n);if(d<=0){const p=n.ownerDocument,v=p.body,_=getComputedStyle(v),y=p.compatMode==="CSS1Compat"&&parseFloat(_.marginLeft)+parseFloat(_.marginRight)||0,b=Math.abs(n.clientWidth-v.clientWidth-y);b<=nS&&(l-=b)}else d<=nS&&(l+=d);return{width:l,height:c,x:h,y:f}}function nO(e,t){const s=Ar(e,!0,t==="fixed"),n=s.top+e.clientTop,o=s.left+e.clientLeft,l=Qs(e)?Bo(e):_s(1),c=e.clientWidth*l.x,h=e.clientHeight*l.y,f=o*l.x,d=n*l.y;return{width:c,height:h,x:f,y:d}}function rS(e,t,s){let n;if(t==="viewport")n=sO(e,s);else if(t==="document")n=iO(xs(e));else if(ts(t))n=nO(t,s);else{const o=N1(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Ku(n)}function B1(e,t){const s=Vn(e);return s===t||!ts(s)||Ho(s)?!1:is(s).position==="fixed"||B1(s,t)}function rO(e,t){const s=t.get(e);if(s)return s;let n=pl(e,[],!1).filter(h=>ts(h)&&Yo(h)!=="body"),o=null;const l=is(e).position==="fixed";let c=l?Vn(e):e;for(;ts(c)&&!Ho(c);){const h=is(c),f=Tg(c);!f&&h.position==="fixed"&&(o=null),(l?!f&&!o:!f&&h.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Tl(c)&&!f&&B1(e,c))?n=n.filter(p=>p!==c):o=h,c=Vn(c)}return t.set(e,n),n}function oO(e){let{element:t,boundary:s,rootBoundary:n,strategy:o}=e;const c=[...s==="clippingAncestors"?yh(t)?[]:rO(t,this._c):[].concat(s),n],h=rS(t,c[0],o);let f=h.top,d=h.right,p=h.bottom,v=h.left;for(let _=1;_<c.length;_++){const y=rS(t,c[_],o);f=Ri(y.top,f),d=In(y.right,d),p=In(y.bottom,p),v=Ri(y.left,v)}return{width:d-v,height:p-f,x:v,y:f}}function aO(e){const{width:t,height:s}=O1(e);return{width:t,height:s}}function lO(e,t,s){const n=Qs(t),o=xs(t),l=s==="fixed",c=Ar(e,!0,l,t);let h={scrollLeft:0,scrollTop:0};const f=_s(0);function d(){f.x=Sh(o)}if(n||!n&&!l)if((Yo(t)!=="body"||Tl(o))&&(h=bh(t)),n){const y=Ar(t,!0,l,t);f.x=y.x+t.clientLeft,f.y=y.y+t.clientTop}else o&&d();l&&!n&&o&&d();const p=o&&!n&&!l?L1(o,h):_s(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 fm(e){return is(e).position==="static"}function oS(e,t){if(!Qs(e)||is(e).position==="fixed")return null;if(t)return t(e);let s=e.offsetParent;return xs(e)===s&&(s=s.ownerDocument.body),s}function P1(e,t){const s=Ai(e);if(yh(e))return s;if(!Qs(e)){let o=Vn(e);for(;o&&!Ho(o);){if(ts(o)&&!fm(o))return o;o=Vn(o)}return s}let n=oS(e,t);for(;n&&$D(n)&&fm(n);)n=oS(n,t);return n&&Ho(n)&&fm(n)&&!Tg(n)?s:n||ZD(e)||s}const cO=async function(e){const t=this.getOffsetParent||P1,s=this.getDimensions,n=await s(e.floating);return{reference:lO(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function uO(e){return is(e).direction==="rtl"}const hO={convertOffsetParentRelativeRectToViewportRelativeRect:eO,getDocumentElement:xs,getClippingRect:oO,getOffsetParent:P1,getElementRects:cO,getClientRects:tO,getDimensions:aO,getScale:Bo,isElement:ts,isRTL:uO};function z1(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function dO(e,t){let s=null,n;const o=xs(e);function l(){var h;clearTimeout(n),(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=ru(v),S=ru(o.clientWidth-(p+_)),E=ru(o.clientHeight-(v+y)),R=ru(p),M={rootMargin:-b+"px "+-S+"px "+-E+"px "+-R+"px",threshold:Ri(0,In(1,f))||1};let k=!0;function j(F){const U=F[0].intersectionRatio;if(U!==f){if(!k)return c();U?c(!1,U):n=setTimeout(()=>{c(!1,1e-7)},1e3)}U===1&&!z1(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 fO(e,t,s,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:h=typeof IntersectionObserver=="function",animationFrame:f=!1}=n,d=Rg(e),p=o||l?[...d?pl(d):[],...t?pl(t):[]]:[];p.forEach(R=>{o&&R.addEventListener("scroll",s,{passive:!0}),l&&R.addEventListener("resize",s)});const v=d&&h?dO(d,s):null;let _=-1,y=null;c&&(y=new ResizeObserver(R=>{let[A]=R;A&&A.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?Ar(e):null;f&&E();function E(){const R=Ar(e);S&&!z1(S,R)&&s(),S=R,b=requestAnimationFrame(E)}return s(),()=>{var R;p.forEach(A=>{o&&A.removeEventListener("scroll",s),l&&A.removeEventListener("resize",s)}),v?.(),(R=y)==null||R.disconnect(),y=null,f&&cancelAnimationFrame(b)}}const mO=WD,pO=KD,gO=VD,vO=qD,_O=UD,aS=ID,yO=YD,bO=(e,t,s)=>{const n=new Map,o={platform:hO,...s},l={...o.platform,_c:n};return HD(e,t,{...o,platform:l})};var SO=typeof document<"u",wO=function(){},xu=SO?x.useLayoutEffect:wO;function Yu(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,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(s=e.length,s!==t.length)return!1;for(n=s;n--!==0;)if(!Yu(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),s=o.length,s!==Object.keys(t).length)return!1;for(n=s;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=s;n--!==0;){const l=o[n];if(!(l==="_owner"&&e.$$typeof)&&!Yu(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function j1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function lS(e,t){const s=j1(e);return Math.round(t*s)/s}function mm(e){const t=x.useRef(e);return xu(()=>{t.current=e}),t}function xO(e){e===void 0&&(e={});const{placement:t="bottom",strategy:s="absolute",middleware:n=[],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(n);Yu(_,n)||y(n);const[b,S]=x.useState(null),[E,R]=x.useState(null),A=x.useCallback(B=>{B!==F.current&&(F.current=B,S(B))},[]),M=x.useCallback(B=>{B!==U.current&&(U.current=B,R(B))},[]),k=l||b,j=c||E,F=x.useRef(null),U=x.useRef(null),H=x.useRef(p),J=f!=null,W=mm(f),$=mm(o),z=mm(d),L=x.useCallback(()=>{if(!F.current||!U.current)return;const B={placement:t,strategy:s,middleware:_};$.current&&(B.platform=$.current),bO(F.current,U.current,B).then(ee=>{const X={...ee,isPositioned:z.current!==!1};P.current&&!Yu(H.current,X)&&(H.current=X,El.flushSync(()=>{v(X)}))})},[_,t,s,$,z]);xu(()=>{d===!1&&H.current.isPositioned&&(H.current.isPositioned=!1,v(B=>({...B,isPositioned:!1})))},[d]);const P=x.useRef(!1);xu(()=>(P.current=!0,()=>{P.current=!1}),[]),xu(()=>{if(k&&(F.current=k),j&&(U.current=j),k&&j){if(W.current)return W.current(k,j,L);L()}},[k,j,L,W,J]);const q=x.useMemo(()=>({reference:F,floating:U,setReference:A,setFloating:M}),[A,M]),T=x.useMemo(()=>({reference:k,floating:j}),[k,j]),I=x.useMemo(()=>{const B={position:s,left:0,top:0};if(!T.floating)return B;const ee=lS(T.floating,p.x),X=lS(T.floating,p.y);return h?{...B,transform:"translate("+ee+"px, "+X+"px)",...j1(T.floating)>=1.5&&{willChange:"transform"}}:{position:s,left:ee,top:X}},[s,h,T.floating,p.x,p.y]);return x.useMemo(()=>({...p,update:L,refs:q,elements:T,floatingStyles:I}),[p,L,q,T,I])}const CO=e=>{function t(s){return{}.hasOwnProperty.call(s,"current")}return{name:"arrow",options:e,fn(s){const{element:n,padding:o}=typeof e=="function"?e(s):e;return n&&t(n)?n.current!=null?aS({element:n.current,padding:o}).fn(s):{}:n?aS({element:n,padding:o}).fn(s):{}}}},EO=(e,t)=>{const s=mO(e);return{name:s.name,fn:s.fn,options:[e,t]}},TO=(e,t)=>{const s=pO(e);return{name:s.name,fn:s.fn,options:[e,t]}},kO=(e,t)=>({fn:yO(e).fn,options:[e,t]}),RO=(e,t)=>{const s=gO(e);return{name:s.name,fn:s.fn,options:[e,t]}},AO=(e,t)=>{const s=vO(e);return{name:s.name,fn:s.fn,options:[e,t]}},MO=(e,t)=>{const s=_O(e);return{name:s.name,fn:s.fn,options:[e,t]}},DO=(e,t)=>{const s=CO(e);return{name:s.name,fn:s.fn,options:[e,t]}};var OO="Arrow",H1=x.forwardRef((e,t)=>{const{children:s,width:n=10,height:o=5,...l}=e;return w.jsx(Le.svg,{...l,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?s:w.jsx("polygon",{points:"0,0 30,0 15,10"})})});H1.displayName=OO;var NO=H1,Ag="Popper",[I1,wh]=Fn(Ag),[LO,V1]=I1(Ag),U1=e=>{const{__scopePopper:t,children:s}=e,[n,o]=x.useState(null);return w.jsx(LO,{scope:t,anchor:n,onAnchorChange:o,children:s})};U1.displayName=Ag;var F1="PopperAnchor",W1=x.forwardRef((e,t)=>{const{__scopePopper:s,virtualRef:n,...o}=e,l=V1(F1,s),c=x.useRef(null),h=Ye(t,c),f=x.useRef(null);return x.useEffect(()=>{const d=f.current;f.current=n?.current||c.current,d!==f.current&&l.onAnchorChange(f.current)}),n?null:w.jsx(Le.div,{...o,ref:h})});W1.displayName=F1;var Mg="PopperContent",[BO,PO]=I1(Mg),K1=x.forwardRef((e,t)=>{const{__scopePopper:s,side:n="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=V1(Mg,s),[R,A]=x.useState(null),M=Ye(t,Y=>A(Y)),[k,j]=x.useState(null),F=kD(k),U=F?.width??0,H=F?.height??0,J=n+(l!=="center"?"-"+l:""),W=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},$=Array.isArray(d)?d:[d],z=$.length>0,L={padding:W,boundary:$.filter(jO),altBoundary:z},{refs:P,floatingStyles:q,placement:T,isPositioned:I,middlewareData:B}=xO({strategy:"fixed",placement:J,whileElementsMounted:(...Y)=>fO(...Y,{animationFrame:y==="always"}),elements:{reference:E.anchor},middleware:[EO({mainAxis:o+H,alignmentAxis:c}),f&&TO({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?kO():void 0,...L}),f&&RO({...L}),AO({...L,apply:({elements:Y,rects:ie,availableWidth:ne,availableHeight:fe})=>{const{width:me,height:we}=ie.reference,Ce=Y.floating.style;Ce.setProperty("--radix-popper-available-width",`${ne}px`),Ce.setProperty("--radix-popper-available-height",`${fe}px`),Ce.setProperty("--radix-popper-anchor-width",`${me}px`),Ce.setProperty("--radix-popper-anchor-height",`${we}px`)}}),k&&DO({element:k,padding:h}),HO({arrowWidth:U,arrowHeight:H}),_&&MO({strategy:"referenceHidden",...L})]}),[ee,X]=$1(T),N=ii(b);Gt(()=>{I&&N?.()},[I,N]);const Z=B.arrow?.x,se=B.arrow?.y,V=B.arrow?.centerOffset!==0,[O,K]=x.useState();return Gt(()=>{R&&K(window.getComputedStyle(R).zIndex)},[R]),w.jsx("div",{ref:P.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:I?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:w.jsx(BO,{scope:s,placedSide:ee,onArrowChange:j,arrowX:Z,arrowY:se,shouldHideArrow:V,children:w.jsx(Le.div,{"data-side":ee,"data-align":X,...S,ref:M,style:{...S.style,animation:I?void 0:"none"}})})})});K1.displayName=Mg;var Y1="PopperArrow",zO={top:"bottom",right:"left",bottom:"top",left:"right"},q1=x.forwardRef(function(t,s){const{__scopePopper:n,...o}=t,l=PO(Y1,n),c=zO[l.placedSide];return w.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:w.jsx(NO,{...o,ref:s,style:{...o.style,display:"block"}})})});q1.displayName=Y1;function jO(e){return e!==null}var HO=e=>({name:"transformOrigin",options:e,fn(t){const{placement:s,rects:n,middlewareData:o}=t,c=o.arrow?.centerOffset!==0,h=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[d,p]=$1(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=`${n.floating.height+f}px`):d==="right"?(b=`${-f}px`,S=c?v:`${y}px`):d==="left"&&(b=`${n.floating.width+f}px`,S=c?v:`${y}px`),{data:{x:b,y:S}}}});function $1(e){const[t,s="center"]=e.split("-");return[t,s]}var G1=U1,X1=W1,Z1=K1,Q1=q1,pm="rovingFocusGroup.onEntryFocus",IO={bubbles:!1,cancelable:!0},kl="RovingFocusGroup",[ep,J1,VO]=Qx(kl),[UO,eC]=Fn(kl,[VO]),[FO,WO]=UO(kl),tC=x.forwardRef((e,t)=>w.jsx(ep.Provider,{scope:e.__scopeRovingFocusGroup,children:w.jsx(ep.Slot,{scope:e.__scopeRovingFocusGroup,children:w.jsx(KO,{...e,ref:t})})}));tC.displayName=kl;var KO=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:s,orientation:n,loop:o=!1,dir:l,currentTabStopId:c,defaultCurrentTabStopId:h,onCurrentTabStopIdChange:f,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...v}=e,_=x.useRef(null),y=Ye(t,_),b=fh(l),[S,E]=jo({prop:c,defaultProp:h??null,onChange:f,caller:kl}),[R,A]=x.useState(!1),M=ii(d),k=J1(s),j=x.useRef(!1),[F,U]=x.useState(0);return x.useEffect(()=>{const H=_.current;if(H)return H.addEventListener(pm,M),()=>H.removeEventListener(pm,M)},[M]),w.jsx(FO,{scope:s,orientation:n,dir:b,loop:o,currentTabStopId:S,onItemFocus:x.useCallback(H=>E(H),[E]),onItemShiftTab:x.useCallback(()=>A(!0),[]),onFocusableItemAdd:x.useCallback(()=>U(H=>H+1),[]),onFocusableItemRemove:x.useCallback(()=>U(H=>H-1),[]),children:w.jsx(Le.div,{tabIndex:R||F===0?-1:0,"data-orientation":n,...v,ref:y,style:{outline:"none",...e.style},onMouseDown:Re(e.onMouseDown,()=>{j.current=!0}),onFocus:Re(e.onFocus,H=>{const J=!j.current;if(H.target===H.currentTarget&&J&&!R){const W=new CustomEvent(pm,IO);if(H.currentTarget.dispatchEvent(W),!W.defaultPrevented){const $=k().filter(T=>T.focusable),z=$.find(T=>T.active),L=$.find(T=>T.id===S),q=[z,L,...$].filter(Boolean).map(T=>T.ref.current);nC(q,p)}}j.current=!1}),onBlur:Re(e.onBlur,()=>A(!1))})})}),iC="RovingFocusGroupItem",sC=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:s,focusable:n=!0,active:o=!1,tabStopId:l,children:c,...h}=e,f=$s(),d=l||f,p=WO(iC,s),v=p.currentTabStopId===d,_=J1(s),{onFocusableItemAdd:y,onFocusableItemRemove:b,currentTabStopId:S}=p;return x.useEffect(()=>{if(n)return y(),()=>b()},[n,y,b]),w.jsx(ep.ItemSlot,{scope:s,id:d,focusable:n,active:o,children:w.jsx(Le.span,{tabIndex:v?0:-1,"data-orientation":p.orientation,...h,ref:t,onMouseDown:Re(e.onMouseDown,E=>{n?p.onItemFocus(d):E.preventDefault()}),onFocus:Re(e.onFocus,()=>p.onItemFocus(d)),onKeyDown:Re(e.onKeyDown,E=>{if(E.key==="Tab"&&E.shiftKey){p.onItemShiftTab();return}if(E.target!==E.currentTarget)return;const R=$O(E,p.orientation,p.dir);if(R!==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(R==="last")M.reverse();else if(R==="prev"||R==="next"){R==="prev"&&M.reverse();const k=M.indexOf(E.currentTarget);M=p.loop?GO(M,k+1):M.slice(k+1)}setTimeout(()=>nC(M))}}),children:typeof c=="function"?c({isCurrentTabStop:v,hasTabStop:S!=null}):c})})});sC.displayName=iC;var YO={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function qO(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function $O(e,t,s){const n=qO(e.key,s);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return YO[n]}function nC(e,t=!1){const s=document.activeElement;for(const n of e)if(n===s||(n.focus({preventScroll:t}),document.activeElement!==s))return}function GO(e,t){return e.map((s,n)=>e[(t+n)%e.length])}var XO=tC,ZO=sC,QO="Label",rC=x.forwardRef((e,t)=>w.jsx(Le.label,{...e,ref:t,onMouseDown:s=>{s.target.closest("button, input, select, textarea")||(e.onMouseDown?.(s),!s.defaultPrevented&&s.detail>1&&s.preventDefault())}}));rC.displayName=QO;var JO=rC;function tp(e,[t,s]){return Math.min(s,Math.max(t,e))}function eN(e,t){return x.useReducer((s,n)=>t[s][n]??s,e)}var Dg="ScrollArea",[oC]=Fn(Dg),[tN,qi]=oC(Dg),aC=x.forwardRef((e,t)=>{const{__scopeScrollArea:s,type:n="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),[R,A]=x.useState(0),[M,k]=x.useState(0),[j,F]=x.useState(!1),[U,H]=x.useState(!1),J=Ye(t,$=>f($)),W=fh(o);return w.jsx(tN,{scope:s,type:n,dir:W,scrollHideDelay:l,scrollArea:h,viewport:d,onViewportChange:p,content:v,onContentChange:_,scrollbarX:y,onScrollbarXChange:b,scrollbarXEnabled:j,onScrollbarXEnabledChange:F,scrollbarY:S,onScrollbarYChange:E,scrollbarYEnabled:U,onScrollbarYEnabledChange:H,onCornerWidthChange:A,onCornerHeightChange:k,children:w.jsx(Le.div,{dir:W,...c,ref:J,style:{position:"relative","--radix-scroll-area-corner-width":R+"px","--radix-scroll-area-corner-height":M+"px",...e.style}})})});aC.displayName=Dg;var lC="ScrollAreaViewport",cC=x.forwardRef((e,t)=>{const{__scopeScrollArea:s,children:n,nonce:o,...l}=e,c=qi(lC,s),h=x.useRef(null),f=Ye(t,h,c.onViewportChange);return w.jsxs(w.Fragment,{children:[w.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}),w.jsx(Le.div,{"data-radix-scroll-area-viewport":"",...l,ref:f,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...e.style},children:w.jsx("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});cC.displayName=lC;var Cs="ScrollAreaScrollbar",uC=x.forwardRef((e,t)=>{const{forceMount:s,...n}=e,o=qi(Cs,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"?w.jsx(iN,{...n,ref:t,forceMount:s}):o.type==="scroll"?w.jsx(sN,{...n,ref:t,forceMount:s}):o.type==="auto"?w.jsx(hC,{...n,ref:t,forceMount:s}):o.type==="always"?w.jsx(Og,{...n,ref:t}):null});uC.displayName=Cs;var iN=x.forwardRef((e,t)=>{const{forceMount:s,...n}=e,o=qi(Cs,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]),w.jsx(ns,{present:s||l,children:w.jsx(hC,{"data-state":l?"visible":"hidden",...n,ref:t})})}),sN=x.forwardRef((e,t)=>{const{forceMount:s,...n}=e,o=qi(Cs,e.__scopeScrollArea),l=e.orientation==="horizontal",c=Ch(()=>f("SCROLL_END"),100),[h,f]=eN("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]),w.jsx(ns,{present:s||h!=="hidden",children:w.jsx(Og,{"data-state":h==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:Re(e.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:Re(e.onPointerLeave,()=>f("POINTER_LEAVE"))})})}),hC=x.forwardRef((e,t)=>{const s=qi(Cs,e.__scopeScrollArea),{forceMount:n,...o}=e,[l,c]=x.useState(!1),h=e.orientation==="horizontal",f=Ch(()=>{if(s.viewport){const d=s.viewport.offsetWidth<s.viewport.scrollWidth,p=s.viewport.offsetHeight<s.viewport.scrollHeight;c(h?d:p)}},10);return Io(s.viewport,f),Io(s.content,f),w.jsx(ns,{present:n||l,children:w.jsx(Og,{"data-state":l?"visible":"hidden",...o,ref:t})})}),Og=x.forwardRef((e,t)=>{const{orientation:s="vertical",...n}=e,o=qi(Cs,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=gC(h.viewport,h.content),p={...n,sizes:h,onSizesChange:f,hasThumb:d>0&&d<1,onThumbChange:_=>l.current=_,onThumbPointerUp:()=>c.current=0,onThumbPointerDown:_=>c.current=_};function v(_,y){return cN(_,c.current,h,y)}return s==="horizontal"?w.jsx(nN,{...p,ref:t,onThumbPositionChange:()=>{if(o.viewport&&l.current){const _=o.viewport.scrollLeft,y=cS(_,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"?w.jsx(rN,{...p,ref:t,onThumbPositionChange:()=>{if(o.viewport&&l.current){const _=o.viewport.scrollTop,y=cS(_,h);l.current.style.transform=`translate3d(0, ${y}px, 0)`}},onWheelScroll:_=>{o.viewport&&(o.viewport.scrollTop=_)},onDragScroll:_=>{o.viewport&&(o.viewport.scrollTop=v(_))}}):null}),nN=x.forwardRef((e,t)=>{const{sizes:s,onSizesChange:n,...o}=e,l=qi(Cs,e.__scopeScrollArea),[c,h]=x.useState(),f=x.useRef(null),d=Ye(t,f,l.onScrollbarXChange);return x.useEffect(()=>{f.current&&h(getComputedStyle(f.current))},[f]),w.jsx(fC,{"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":xh(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(_),_C(_,v)&&p.preventDefault()}},onResize:()=>{f.current&&l.viewport&&c&&n({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:$u(c.paddingLeft),paddingEnd:$u(c.paddingRight)}})}})}),rN=x.forwardRef((e,t)=>{const{sizes:s,onSizesChange:n,...o}=e,l=qi(Cs,e.__scopeScrollArea),[c,h]=x.useState(),f=x.useRef(null),d=Ye(t,f,l.onScrollbarYChange);return x.useEffect(()=>{f.current&&h(getComputedStyle(f.current))},[f]),w.jsx(fC,{"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":xh(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(_),_C(_,v)&&p.preventDefault()}},onResize:()=>{f.current&&l.viewport&&c&&n({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:$u(c.paddingTop),paddingEnd:$u(c.paddingBottom)}})}})}),[oN,dC]=oC(Cs),fC=x.forwardRef((e,t)=>{const{__scopeScrollArea:s,sizes:n,hasThumb:o,onThumbChange:l,onThumbPointerUp:c,onThumbPointerDown:h,onThumbPositionChange:f,onDragScroll:d,onWheelScroll:p,onResize:v,..._}=e,y=qi(Cs,s),[b,S]=x.useState(null),E=Ye(t,J=>S(J)),R=x.useRef(null),A=x.useRef(""),M=y.viewport,k=n.content-n.viewport,j=ii(p),F=ii(f),U=Ch(v,10);function H(J){if(R.current){const W=J.clientX-R.current.left,$=J.clientY-R.current.top;d({x:W,y:$})}}return x.useEffect(()=>{const J=W=>{const $=W.target;b?.contains($)&&j(W,k)};return document.addEventListener("wheel",J,{passive:!1}),()=>document.removeEventListener("wheel",J,{passive:!1})},[M,b,k,j]),x.useEffect(F,[n,F]),Io(b,U),Io(y.content,U),w.jsx(oN,{scope:s,scrollbar:b,hasThumb:o,onThumbChange:ii(l),onThumbPointerUp:ii(c),onThumbPositionChange:F,onThumbPointerDown:ii(h),children:w.jsx(Le.div,{..._,ref:E,style:{position:"absolute",..._.style},onPointerDown:Re(e.onPointerDown,J=>{J.button===0&&(J.target.setPointerCapture(J.pointerId),R.current=b.getBoundingClientRect(),A.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",y.viewport&&(y.viewport.style.scrollBehavior="auto"),H(J))}),onPointerMove:Re(e.onPointerMove,H),onPointerUp:Re(e.onPointerUp,J=>{const W=J.target;W.hasPointerCapture(J.pointerId)&&W.releasePointerCapture(J.pointerId),document.body.style.webkitUserSelect=A.current,y.viewport&&(y.viewport.style.scrollBehavior=""),R.current=null})})})}),qu="ScrollAreaThumb",mC=x.forwardRef((e,t)=>{const{forceMount:s,...n}=e,o=dC(qu,e.__scopeScrollArea);return w.jsx(ns,{present:s||o.hasThumb,children:w.jsx(aN,{ref:t,...n})})}),aN=x.forwardRef((e,t)=>{const{__scopeScrollArea:s,style:n,...o}=e,l=qi(qu,s),c=dC(qu,s),{onThumbPositionChange:h}=c,f=Ye(t,v=>c.onThumbChange(v)),d=x.useRef(void 0),p=Ch(()=>{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=uN(v,h);d.current=y,h()}};return h(),v.addEventListener("scroll",_),()=>v.removeEventListener("scroll",_)}},[l.viewport,p,h]),w.jsx(Le.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)",...n},onPointerDownCapture:Re(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:Re(e.onPointerUp,c.onThumbPointerUp)})});mC.displayName=qu;var Ng="ScrollAreaCorner",pC=x.forwardRef((e,t)=>{const s=qi(Ng,e.__scopeScrollArea),n=!!(s.scrollbarX&&s.scrollbarY);return s.type!=="scroll"&&n?w.jsx(lN,{...e,ref:t}):null});pC.displayName=Ng;var lN=x.forwardRef((e,t)=>{const{__scopeScrollArea:s,...n}=e,o=qi(Ng,s),[l,c]=x.useState(0),[h,f]=x.useState(0),d=!!(l&&h);return Io(o.scrollbarX,()=>{const p=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(p),f(p)}),Io(o.scrollbarY,()=>{const p=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(p),c(p)}),d?w.jsx(Le.div,{...n,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 $u(e){return e?parseInt(e,10):0}function gC(e,t){const s=e/t;return isNaN(s)?0:s}function xh(e){const t=gC(e.viewport,e.content),s=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-s)*t;return Math.max(n,18)}function cN(e,t,s,n="ltr"){const o=xh(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=n==="ltr"?[0,p]:[p*-1,0];return vC([f,d],v)(e)}function cS(e,t,s="ltr"){const n=xh(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,l=t.scrollbar.size-o,c=t.content-t.viewport,h=l-n,f=s==="ltr"?[0,c]:[c*-1,0],d=tp(e,f);return vC([0,c],[0,h])(d)}function vC(e,t){return s=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(s-e[0])}}function _C(e,t){return e>0&&e<t}var uN=(e,t=()=>{})=>{let s={left:e.scrollLeft,top:e.scrollTop},n=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,n=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(n)};function Ch(e,t){const s=ii(e),n=x.useRef(0);return x.useEffect(()=>()=>window.clearTimeout(n.current),[]),x.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(s,t)},[s,t])}function Io(e,t){const s=ii(t);Gt(()=>{let n=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(s)});return o.observe(e),()=>{window.cancelAnimationFrame(n),o.unobserve(e)}}},[e,s])}var hN=aC,dN=cC,fN=pC,mN=[" ","Enter","ArrowUp","ArrowDown"],pN=[" ","Enter"],Mr="Select",[Eh,Th,gN]=Qx(Mr),[qo]=Fn(Mr,[gN,wh]),kh=wh(),[vN,Wn]=qo(Mr),[_N,yN]=qo(Mr),yC=e=>{const{__scopeSelect:t,children:s,open:n,defaultOpen:o,onOpenChange:l,value:c,defaultValue:h,onValueChange:f,dir:d,name:p,autoComplete:v,disabled:_,required:y,form:b}=e,S=kh(t),[E,R]=x.useState(null),[A,M]=x.useState(null),[k,j]=x.useState(!1),F=fh(d),[U,H]=jo({prop:n,defaultProp:o??!1,onChange:l,caller:Mr}),[J,W]=jo({prop:c,defaultProp:h,onChange:f,caller:Mr}),$=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 w.jsx(G1,{...S,children:w.jsxs(vN,{required:y,scope:t,trigger:E,onTriggerChange:R,valueNode:A,onValueNodeChange:M,valueNodeHasChildren:k,onValueNodeHasChildrenChange:j,contentId:$s(),value:J,onValueChange:W,open:U,onOpenChange:H,dir:F,triggerPointerDownPosRef:$,disabled:_,children:[w.jsx(Eh.Provider,{scope:t,children:w.jsx(_N,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(T=>{P(I=>new Set(I).add(T))},[]),onNativeOptionRemove:x.useCallback(T=>{P(I=>{const B=new Set(I);return B.delete(T),B})},[]),children:s})}),z?w.jsxs(VC,{"aria-hidden":!0,required:y,tabIndex:-1,name:p,autoComplete:v,value:J,onChange:T=>W(T.target.value),disabled:_,form:b,children:[J===void 0?w.jsx("option",{value:""}):null,Array.from(L)]},q):null]})})};yC.displayName=Mr;var bC="SelectTrigger",SC=x.forwardRef((e,t)=>{const{__scopeSelect:s,disabled:n=!1,...o}=e,l=kh(s),c=Wn(bC,s),h=c.disabled||n,f=Ye(t,c.onTriggerChange),d=Th(s),p=x.useRef("touch"),[v,_,y]=FC(S=>{const E=d().filter(M=>!M.disabled),R=E.find(M=>M.value===c.value),A=WC(E,S,R);A!==void 0&&c.onValueChange(A.value)}),b=S=>{h||(c.onOpenChange(!0),y()),S&&(c.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return w.jsx(X1,{asChild:!0,...l,children:w.jsx(Le.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":UC(c.value)?"":void 0,...o,ref:f,onClick:Re(o.onClick,S=>{S.currentTarget.focus(),p.current!=="mouse"&&b(S)}),onPointerDown:Re(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:Re(o.onKeyDown,S=>{const E=v.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&_(S.key),!(E&&S.key===" ")&&mN.includes(S.key)&&(b(),S.preventDefault())})})})});SC.displayName=bC;var wC="SelectValue",xC=x.forwardRef((e,t)=>{const{__scopeSelect:s,className:n,style:o,children:l,placeholder:c="",...h}=e,f=Wn(wC,s),{onValueNodeHasChildrenChange:d}=f,p=l!==void 0,v=Ye(t,f.onValueNodeChange);return Gt(()=>{d(p)},[d,p]),w.jsx(Le.span,{...h,ref:v,style:{pointerEvents:"none"},children:UC(f.value)?w.jsx(w.Fragment,{children:c}):l})});xC.displayName=wC;var bN="SelectIcon",CC=x.forwardRef((e,t)=>{const{__scopeSelect:s,children:n,...o}=e;return w.jsx(Le.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});CC.displayName=bN;var SN="SelectPortal",EC=e=>w.jsx(ph,{asChild:!0,...e});EC.displayName=SN;var Dr="SelectContent",TC=x.forwardRef((e,t)=>{const s=Wn(Dr,e.__scopeSelect),[n,o]=x.useState();if(Gt(()=>{o(new DocumentFragment)},[]),!s.open){const l=n;return l?El.createPortal(w.jsx(kC,{scope:e.__scopeSelect,children:w.jsx(Eh.Slot,{scope:e.__scopeSelect,children:w.jsx("div",{children:e.children})})}),l):null}return w.jsx(RC,{...e,ref:t})});TC.displayName=Dr;var Qi=10,[kC,Kn]=qo(Dr),wN="SelectContentImpl",xN=zo("SelectContent.RemoveScroll"),RC=x.forwardRef((e,t)=>{const{__scopeSelect:s,position:n="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,...R}=e,A=Wn(Dr,s),[M,k]=x.useState(null),[j,F]=x.useState(null),U=Ye(t,Y=>k(Y)),[H,J]=x.useState(null),[W,$]=x.useState(null),z=Th(s),[L,P]=x.useState(!1),q=x.useRef(!1);x.useEffect(()=>{if(M)return h1(M)},[M]),i1();const T=x.useCallback(Y=>{const[ie,...ne]=z().map(we=>we.ref.current),[fe]=ne.slice(-1),me=document.activeElement;for(const we of Y)if(we===me||(we?.scrollIntoView({block:"nearest"}),we===ie&&j&&(j.scrollTop=0),we===fe&&j&&(j.scrollTop=j.scrollHeight),we?.focus(),document.activeElement!==me))return},[z,j]),I=x.useCallback(()=>T([H,M]),[T,H,M]);x.useEffect(()=>{L&&I()},[L,I]);const{onOpenChange:B,triggerPointerDownPosRef:ee}=A;x.useEffect(()=>{if(M){let Y={x:0,y:0};const ie=fe=>{Y={x:Math.abs(Math.round(fe.pageX)-(ee.current?.x??0)),y:Math.abs(Math.round(fe.pageY)-(ee.current?.y??0))}},ne=fe=>{Y.x<=10&&Y.y<=10?fe.preventDefault():M.contains(fe.target)||B(!1),document.removeEventListener("pointermove",ie),ee.current=null};return ee.current!==null&&(document.addEventListener("pointermove",ie),document.addEventListener("pointerup",ne,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ie),document.removeEventListener("pointerup",ne,{capture:!0})}}},[M,B,ee]),x.useEffect(()=>{const Y=()=>B(!1);return window.addEventListener("blur",Y),window.addEventListener("resize",Y),()=>{window.removeEventListener("blur",Y),window.removeEventListener("resize",Y)}},[B]);const[X,N]=FC(Y=>{const ie=z().filter(me=>!me.disabled),ne=ie.find(me=>me.ref.current===document.activeElement),fe=WC(ie,Y,ne);fe&&setTimeout(()=>fe.ref.current.focus())}),Z=x.useCallback((Y,ie,ne)=>{const fe=!q.current&&!ne;(A.value!==void 0&&A.value===ie||fe)&&(J(Y),fe&&(q.current=!0))},[A.value]),se=x.useCallback(()=>M?.focus(),[M]),V=x.useCallback((Y,ie,ne)=>{const fe=!q.current&&!ne;(A.value!==void 0&&A.value===ie||fe)&&$(Y)},[A.value]),O=n==="popper"?ip:AC,K=O===ip?{side:h,sideOffset:f,align:d,alignOffset:p,arrowPadding:v,collisionBoundary:_,collisionPadding:y,sticky:b,hideWhenDetached:S,avoidCollisions:E}:{};return w.jsx(kC,{scope:s,content:M,viewport:j,onViewportChange:F,itemRefCallback:Z,selectedItem:H,onItemLeave:se,itemTextRefCallback:V,focusSelectedItem:I,selectedItemText:W,position:n,isPositioned:L,searchRef:X,children:w.jsx(yg,{as:xN,allowPinchZoom:!0,children:w.jsx(_g,{asChild:!0,trapped:A.open,onMountAutoFocus:Y=>{Y.preventDefault()},onUnmountAutoFocus:Re(o,Y=>{A.trigger?.focus({preventScroll:!0}),Y.preventDefault()}),children:w.jsx(mh,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:Y=>Y.preventDefault(),onDismiss:()=>A.onOpenChange(!1),children:w.jsx(O,{role:"listbox",id:A.contentId,"data-state":A.open?"open":"closed",dir:A.dir,onContextMenu:Y=>Y.preventDefault(),...R,...K,onPlaced:()=>P(!0),ref:U,style:{display:"flex",flexDirection:"column",outline:"none",...R.style},onKeyDown:Re(R.onKeyDown,Y=>{const ie=Y.ctrlKey||Y.altKey||Y.metaKey;if(Y.key==="Tab"&&Y.preventDefault(),!ie&&Y.key.length===1&&N(Y.key),["ArrowUp","ArrowDown","Home","End"].includes(Y.key)){let fe=z().filter(me=>!me.disabled).map(me=>me.ref.current);if(["ArrowUp","End"].includes(Y.key)&&(fe=fe.slice().reverse()),["ArrowUp","ArrowDown"].includes(Y.key)){const me=Y.target,we=fe.indexOf(me);fe=fe.slice(we+1)}setTimeout(()=>T(fe)),Y.preventDefault()}})})})})})})});RC.displayName=wN;var CN="SelectItemAlignedPosition",AC=x.forwardRef((e,t)=>{const{__scopeSelect:s,onPlaced:n,...o}=e,l=Wn(Dr,s),c=Kn(Dr,s),[h,f]=x.useState(null),[d,p]=x.useState(null),v=Ye(t,U=>p(U)),_=Th(s),y=x.useRef(!1),b=x.useRef(!0),{viewport:S,selectedItem:E,selectedItemText:R,focusSelectedItem:A}=c,M=x.useCallback(()=>{if(l.trigger&&l.valueNode&&h&&d&&S&&E&&R){const U=l.trigger.getBoundingClientRect(),H=d.getBoundingClientRect(),J=l.valueNode.getBoundingClientRect(),W=R.getBoundingClientRect();if(l.dir!=="rtl"){const me=W.left-H.left,we=J.left-me,Ce=U.left-we,Oe=U.width+Ce,xe=Math.max(Oe,H.width),Ae=window.innerWidth-Qi,ht=tp(we,[Qi,Math.max(Qi,Ae-xe)]);h.style.minWidth=Oe+"px",h.style.left=ht+"px"}else{const me=H.right-W.right,we=window.innerWidth-J.right-me,Ce=window.innerWidth-U.right-we,Oe=U.width+Ce,xe=Math.max(Oe,H.width),Ae=window.innerWidth-Qi,ht=tp(we,[Qi,Math.max(Qi,Ae-xe)]);h.style.minWidth=Oe+"px",h.style.right=ht+"px"}const $=_(),z=window.innerHeight-Qi*2,L=S.scrollHeight,P=window.getComputedStyle(d),q=parseInt(P.borderTopWidth,10),T=parseInt(P.paddingTop,10),I=parseInt(P.borderBottomWidth,10),B=parseInt(P.paddingBottom,10),ee=q+T+L+B+I,X=Math.min(E.offsetHeight*5,ee),N=window.getComputedStyle(S),Z=parseInt(N.paddingTop,10),se=parseInt(N.paddingBottom,10),V=U.top+U.height/2-Qi,O=z-V,K=E.offsetHeight/2,Y=E.offsetTop+K,ie=q+T+Y,ne=ee-ie;if(ie<=V){const me=$.length>0&&E===$[$.length-1].ref.current;h.style.bottom="0px";const we=d.clientHeight-S.offsetTop-S.offsetHeight,Ce=Math.max(O,K+(me?se:0)+we+I),Oe=ie+Ce;h.style.height=Oe+"px"}else{const me=$.length>0&&E===$[0].ref.current;h.style.top="0px";const Ce=Math.max(V,q+S.offsetTop+(me?Z:0)+K)+ne;h.style.height=Ce+"px",S.scrollTop=ie-V+S.offsetTop}h.style.margin=`${Qi}px 0`,h.style.minHeight=X+"px",h.style.maxHeight=z+"px",n?.(),requestAnimationFrame(()=>y.current=!0)}},[_,l.trigger,l.valueNode,h,d,S,E,R,l.dir,n]);Gt(()=>M(),[M]);const[k,j]=x.useState();Gt(()=>{d&&j(window.getComputedStyle(d).zIndex)},[d]);const F=x.useCallback(U=>{U&&b.current===!0&&(M(),A?.(),b.current=!1)},[M,A]);return w.jsx(TN,{scope:s,contentWrapper:h,shouldExpandOnScrollRef:y,onScrollButtonChange:F,children:w.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:w.jsx(Le.div,{...o,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});AC.displayName=CN;var EN="SelectPopperPosition",ip=x.forwardRef((e,t)=>{const{__scopeSelect:s,align:n="start",collisionPadding:o=Qi,...l}=e,c=kh(s);return w.jsx(Z1,{...c,...l,ref:t,align:n,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)"}})});ip.displayName=EN;var[TN,Lg]=qo(Dr,{}),sp="SelectViewport",MC=x.forwardRef((e,t)=>{const{__scopeSelect:s,nonce:n,...o}=e,l=Kn(sp,s),c=Lg(sp,s),h=Ye(t,l.onViewportChange),f=x.useRef(0);return w.jsxs(w.Fragment,{children:[w.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:n}),w.jsx(Eh.Slot,{scope:s,children:w.jsx(Le.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:h,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Re(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-Qi*2,S=parseFloat(v.style.minHeight),E=parseFloat(v.style.height),R=Math.max(S,E);if(R<b){const A=R+y,M=Math.min(b,A),k=A-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})})})]})});MC.displayName=sp;var DC="SelectGroup",[kN,RN]=qo(DC),AN=x.forwardRef((e,t)=>{const{__scopeSelect:s,...n}=e,o=$s();return w.jsx(kN,{scope:s,id:o,children:w.jsx(Le.div,{role:"group","aria-labelledby":o,...n,ref:t})})});AN.displayName=DC;var OC="SelectLabel",MN=x.forwardRef((e,t)=>{const{__scopeSelect:s,...n}=e,o=RN(OC,s);return w.jsx(Le.div,{id:o.id,...n,ref:t})});MN.displayName=OC;var Gu="SelectItem",[DN,NC]=qo(Gu),LC=x.forwardRef((e,t)=>{const{__scopeSelect:s,value:n,disabled:o=!1,textValue:l,...c}=e,h=Wn(Gu,s),f=Kn(Gu,s),d=h.value===n,[p,v]=x.useState(l??""),[_,y]=x.useState(!1),b=Ye(t,A=>f.itemRefCallback?.(A,n,o)),S=$s(),E=x.useRef("touch"),R=()=>{o||(h.onValueChange(n),h.onOpenChange(!1))};if(n==="")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 w.jsx(DN,{scope:s,value:n,disabled:o,textId:S,isSelected:d,onItemTextChange:x.useCallback(A=>{v(M=>M||(A?.textContent??"").trim())},[]),children:w.jsx(Eh.ItemSlot,{scope:s,value:n,disabled:o,textValue:p,children:w.jsx(Le.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:Re(c.onFocus,()=>y(!0)),onBlur:Re(c.onBlur,()=>y(!1)),onClick:Re(c.onClick,()=>{E.current!=="mouse"&&R()}),onPointerUp:Re(c.onPointerUp,()=>{E.current==="mouse"&&R()}),onPointerDown:Re(c.onPointerDown,A=>{E.current=A.pointerType}),onPointerMove:Re(c.onPointerMove,A=>{E.current=A.pointerType,o?f.onItemLeave?.():E.current==="mouse"&&A.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Re(c.onPointerLeave,A=>{A.currentTarget===document.activeElement&&f.onItemLeave?.()}),onKeyDown:Re(c.onKeyDown,A=>{f.searchRef?.current!==""&&A.key===" "||(pN.includes(A.key)&&R(),A.key===" "&&A.preventDefault())})})})})});LC.displayName=Gu;var tl="SelectItemText",BC=x.forwardRef((e,t)=>{const{__scopeSelect:s,className:n,style:o,...l}=e,c=Wn(tl,s),h=Kn(tl,s),f=NC(tl,s),d=yN(tl,s),[p,v]=x.useState(null),_=Ye(t,R=>v(R),f.onItemTextChange,R=>h.itemTextRefCallback?.(R,f.value,f.disabled)),y=p?.textContent,b=x.useMemo(()=>w.jsx("option",{value:f.value,disabled:f.disabled,children:y},f.value),[f.disabled,f.value,y]),{onNativeOptionAdd:S,onNativeOptionRemove:E}=d;return Gt(()=>(S(b),()=>E(b)),[S,E,b]),w.jsxs(w.Fragment,{children:[w.jsx(Le.span,{id:f.textId,...l,ref:_}),f.isSelected&&c.valueNode&&!c.valueNodeHasChildren?El.createPortal(l.children,c.valueNode):null]})});BC.displayName=tl;var PC="SelectItemIndicator",zC=x.forwardRef((e,t)=>{const{__scopeSelect:s,...n}=e;return NC(PC,s).isSelected?w.jsx(Le.span,{"aria-hidden":!0,...n,ref:t}):null});zC.displayName=PC;var np="SelectScrollUpButton",jC=x.forwardRef((e,t)=>{const s=Kn(np,e.__scopeSelect),n=Lg(np,e.__scopeSelect),[o,l]=x.useState(!1),c=Ye(t,n.onScrollButtonChange);return Gt(()=>{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?w.jsx(IC,{...e,ref:c,onAutoScroll:()=>{const{viewport:h,selectedItem:f}=s;h&&f&&(h.scrollTop=h.scrollTop-f.offsetHeight)}}):null});jC.displayName=np;var rp="SelectScrollDownButton",HC=x.forwardRef((e,t)=>{const s=Kn(rp,e.__scopeSelect),n=Lg(rp,e.__scopeSelect),[o,l]=x.useState(!1),c=Ye(t,n.onScrollButtonChange);return Gt(()=>{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?w.jsx(IC,{...e,ref:c,onAutoScroll:()=>{const{viewport:h,selectedItem:f}=s;h&&f&&(h.scrollTop=h.scrollTop+f.offsetHeight)}}):null});HC.displayName=rp;var IC=x.forwardRef((e,t)=>{const{__scopeSelect:s,onAutoScroll:n,...o}=e,l=Kn("SelectScrollButton",s),c=x.useRef(null),h=Th(s),f=x.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return x.useEffect(()=>()=>f(),[f]),Gt(()=>{h().find(p=>p.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[h]),w.jsx(Le.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:Re(o.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(n,50))}),onPointerMove:Re(o.onPointerMove,()=>{l.onItemLeave?.(),c.current===null&&(c.current=window.setInterval(n,50))}),onPointerLeave:Re(o.onPointerLeave,()=>{f()})})}),ON="SelectSeparator",NN=x.forwardRef((e,t)=>{const{__scopeSelect:s,...n}=e;return w.jsx(Le.div,{"aria-hidden":!0,...n,ref:t})});NN.displayName=ON;var op="SelectArrow",LN=x.forwardRef((e,t)=>{const{__scopeSelect:s,...n}=e,o=kh(s),l=Wn(op,s),c=Kn(op,s);return l.open&&c.position==="popper"?w.jsx(Q1,{...o,...n,ref:t}):null});LN.displayName=op;var BN="SelectBubbleInput",VC=x.forwardRef(({__scopeSelect:e,value:t,...s},n)=>{const o=x.useRef(null),l=Ye(n,o),c=TD(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]),w.jsx(Le.select,{...s,style:{...Xx,...s.style},ref:l,defaultValue:t})});VC.displayName=BN;function UC(e){return e===""||e===void 0}function FC(e){const t=ii(e),s=x.useRef(""),n=x.useRef(0),o=x.useCallback(c=>{const h=s.current+c;t(h),(function f(d){s.current=d,window.clearTimeout(n.current),d!==""&&(n.current=window.setTimeout(()=>f(""),1e3))})(h)},[t]),l=x.useCallback(()=>{s.current="",window.clearTimeout(n.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(n.current),[]),[s,o,l]}function WC(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=PN(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 PN(e,t){return e.map((s,n)=>e[(t+n)%e.length])}var zN=yC,jN=SC,HN=xC,IN=CC,VN=EC,UN=TC,FN=MC,WN=LC,KN=BC,YN=zC,qN=jC,$N=HC,GN="Separator",uS="horizontal",XN=["horizontal","vertical"],KC=x.forwardRef((e,t)=>{const{decorative:s,orientation:n=uS,...o}=e,l=ZN(n)?n:uS,h=s?{role:"none"}:{"aria-orientation":l==="vertical"?l:void 0,role:"separator"};return w.jsx(Le.div,{"data-orientation":l,...h,...o,ref:t})});KC.displayName=GN;function ZN(e){return XN.includes(e)}var QN=KC,Rh="Tabs",[JN]=Fn(Rh,[eC]),YC=eC(),[e3,Bg]=JN(Rh),qC=x.forwardRef((e,t)=>{const{__scopeTabs:s,value:n,onValueChange:o,defaultValue:l,orientation:c="horizontal",dir:h,activationMode:f="automatic",...d}=e,p=fh(h),[v,_]=jo({prop:n,onChange:o,defaultProp:l??"",caller:Rh});return w.jsx(e3,{scope:s,baseId:$s(),value:v,onValueChange:_,orientation:c,dir:p,activationMode:f,children:w.jsx(Le.div,{dir:p,"data-orientation":c,...d,ref:t})})});qC.displayName=Rh;var $C="TabsList",GC=x.forwardRef((e,t)=>{const{__scopeTabs:s,loop:n=!0,...o}=e,l=Bg($C,s),c=YC(s);return w.jsx(XO,{asChild:!0,...c,orientation:l.orientation,dir:l.dir,loop:n,children:w.jsx(Le.div,{role:"tablist","aria-orientation":l.orientation,...o,ref:t})})});GC.displayName=$C;var XC="TabsTrigger",ZC=x.forwardRef((e,t)=>{const{__scopeTabs:s,value:n,disabled:o=!1,...l}=e,c=Bg(XC,s),h=YC(s),f=eE(c.baseId,n),d=tE(c.baseId,n),p=n===c.value;return w.jsx(ZO,{asChild:!0,...h,focusable:!o,active:p,children:w.jsx(Le.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:Re(e.onMouseDown,v=>{!o&&v.button===0&&v.ctrlKey===!1?c.onValueChange(n):v.preventDefault()}),onKeyDown:Re(e.onKeyDown,v=>{[" ","Enter"].includes(v.key)&&c.onValueChange(n)}),onFocus:Re(e.onFocus,()=>{const v=c.activationMode!=="manual";!p&&!o&&v&&c.onValueChange(n)})})})});ZC.displayName=XC;var QC="TabsContent",JC=x.forwardRef((e,t)=>{const{__scopeTabs:s,value:n,forceMount:o,children:l,...c}=e,h=Bg(QC,s),f=eE(h.baseId,n),d=tE(h.baseId,n),p=n===h.value,v=x.useRef(p);return x.useEffect(()=>{const _=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(_)},[]),w.jsx(ns,{present:o||p,children:({present:_})=>w.jsx(Le.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})})});JC.displayName=QC;function eE(e,t){return`${e}-trigger-${t}`}function tE(e,t){return`${e}-content-${t}`}var t3=qC,i3=GC,s3=ZC,n3=JC,[Ah]=Fn("Tooltip",[wh]),Mh=wh(),iE="TooltipProvider",r3=700,ap="tooltip.open",[o3,Pg]=Ah(iE),sE=e=>{const{__scopeTooltip:t,delayDuration:s=r3,skipDelayDuration:n=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)},[]),w.jsx(o3,{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,n)},[n]),isPointerInTransitRef:h,onPointerInTransitChange:x.useCallback(d=>{h.current=d},[]),disableHoverableContent:o,children:l})};sE.displayName=iE;var gl="Tooltip",[a3,Rl]=Ah(gl),nE=e=>{const{__scopeTooltip:t,children:s,open:n,defaultOpen:o,onOpenChange:l,disableHoverableContent:c,delayDuration:h}=e,f=Pg(gl,e.__scopeTooltip),d=Mh(t),[p,v]=x.useState(null),_=$s(),y=x.useRef(0),b=c??f.disableHoverableContent,S=h??f.delayDuration,E=x.useRef(!1),[R,A]=jo({prop:n,defaultProp:o??!1,onChange:U=>{U?(f.onOpen(),document.dispatchEvent(new CustomEvent(ap))):f.onClose(),l?.(U)},caller:gl}),M=x.useMemo(()=>R?E.current?"delayed-open":"instant-open":"closed",[R]),k=x.useCallback(()=>{window.clearTimeout(y.current),y.current=0,E.current=!1,A(!0)},[A]),j=x.useCallback(()=>{window.clearTimeout(y.current),y.current=0,A(!1)},[A]),F=x.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{E.current=!0,A(!0),y.current=0},S)},[S,A]);return x.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),w.jsx(G1,{...d,children:w.jsx(a3,{scope:t,contentId:_,open:R,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})})};nE.displayName=gl;var lp="TooltipTrigger",rE=x.forwardRef((e,t)=>{const{__scopeTooltip:s,...n}=e,o=Rl(lp,s),l=Pg(lp,s),c=Mh(s),h=x.useRef(null),f=Ye(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]),w.jsx(X1,{asChild:!0,...c,children:w.jsx(Le.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:f,onPointerMove:Re(e.onPointerMove,_=>{_.pointerType!=="touch"&&!p.current&&!l.isPointerInTransitRef.current&&(o.onTriggerEnter(),p.current=!0)}),onPointerLeave:Re(e.onPointerLeave,()=>{o.onTriggerLeave(),p.current=!1}),onPointerDown:Re(e.onPointerDown,()=>{o.open&&o.onClose(),d.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:Re(e.onFocus,()=>{d.current||o.onOpen()}),onBlur:Re(e.onBlur,o.onClose),onClick:Re(e.onClick,o.onClose)})})});rE.displayName=lp;var zg="TooltipPortal",[l3,c3]=Ah(zg,{forceMount:void 0}),oE=e=>{const{__scopeTooltip:t,forceMount:s,children:n,container:o}=e,l=Rl(zg,t);return w.jsx(l3,{scope:t,forceMount:s,children:w.jsx(ns,{present:s||l.open,children:w.jsx(ph,{asChild:!0,container:o,children:n})})})};oE.displayName=zg;var Vo="TooltipContent",aE=x.forwardRef((e,t)=>{const s=c3(Vo,e.__scopeTooltip),{forceMount:n=s.forceMount,side:o="top",...l}=e,c=Rl(Vo,e.__scopeTooltip);return w.jsx(ns,{present:n||c.open,children:c.disableHoverableContent?w.jsx(lE,{side:o,...l,ref:t}):w.jsx(u3,{side:o,...l,ref:t})})}),u3=x.forwardRef((e,t)=>{const s=Rl(Vo,e.__scopeTooltip),n=Pg(Vo,e.__scopeTooltip),o=x.useRef(null),l=Ye(t,o),[c,h]=x.useState(null),{trigger:f,onClose:d}=s,p=o.current,{onPointerInTransitChange:v}=n,_=x.useCallback(()=>{h(null),v(!1)},[v]),y=x.useCallback((b,S)=>{const E=b.currentTarget,R={x:b.clientX,y:b.clientY},A=m3(R,E.getBoundingClientRect()),M=p3(R,A),k=g3(S.getBoundingClientRect()),j=_3([...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,R={x:S.clientX,y:S.clientY},A=f?.contains(E)||p?.contains(E),M=!v3(R,c);A?_():M&&(_(),d())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[f,p,c,d,_]),w.jsx(lE,{...e,ref:l})}),[h3,d3]=Ah(gl,{isInside:!1}),f3=WA("TooltipContent"),lE=x.forwardRef((e,t)=>{const{__scopeTooltip:s,children:n,"aria-label":o,onEscapeKeyDown:l,onPointerDownOutside:c,...h}=e,f=Rl(Vo,s),d=Mh(s),{onClose:p}=f;return x.useEffect(()=>(document.addEventListener(ap,p),()=>document.removeEventListener(ap,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]),w.jsx(mh,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:v=>v.preventDefault(),onDismiss:p,children:w.jsxs(Z1,{"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:[w.jsx(f3,{children:n}),w.jsx(h3,{scope:s,isInside:!0,children:w.jsx(ZA,{id:f.contentId,role:"tooltip",children:o||n})})]})})});aE.displayName=Vo;var cE="TooltipArrow",uE=x.forwardRef((e,t)=>{const{__scopeTooltip:s,...n}=e,o=Mh(s);return d3(cE,s).isInside?null:w.jsx(Q1,{...o,...n,ref:t})});uE.displayName=cE;function m3(e,t){const s=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),l=Math.abs(t.left-e.x);switch(Math.min(s,n,o,l)){case l:return"left";case o:return"right";case s:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function p3(e,t,s=5){const n=[];switch(t){case"top":n.push({x:e.x-s,y:e.y+s},{x:e.x+s,y:e.y+s});break;case"bottom":n.push({x:e.x-s,y:e.y-s},{x:e.x+s,y:e.y-s});break;case"left":n.push({x:e.x+s,y:e.y-s},{x:e.x+s,y:e.y+s});break;case"right":n.push({x:e.x-s,y:e.y-s},{x:e.x-s,y:e.y+s});break}return n}function g3(e){const{top:t,right:s,bottom:n,left:o}=e;return[{x:o,y:t},{x:s,y:t},{x:s,y:n},{x:o,y:n}]}function v3(e,t){const{x:s,y:n}=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>n!=_>n&&s<(v-d)*(n-p)/(_-p)+d&&(o=!o)}return o}function _3(e){const t=e.slice();return t.sort((s,n)=>s.x<n.x?-1:s.x>n.x?1:s.y<n.y?-1:s.y>n.y?1:0),y3(t)}function y3(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];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 n=e.length-1;n>=0;n--){const o=e[n];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 b3=sE,S3=nE,w3=rE,x3=oE,C3=aE,E3=uE;function hE(e){var t,s,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(s=hE(e[t]))&&(n&&(n+=" "),n+=s)}else for(s in e)e[s]&&(n&&(n+=" "),n+=s);return n}function dE(){for(var e,t,s=0,n="",o=arguments.length;s<o;s++)(e=arguments[s])&&(t=hE(e))&&(n&&(n+=" "),n+=t);return n}const T3=(e,t)=>{const s=new Array(e.length+t.length);for(let n=0;n<e.length;n++)s[n]=e[n];for(let n=0;n<t.length;n++)s[e.length+n]=t[n];return s},k3=(e,t)=>({classGroupId:e,validator:t}),fE=(e=new Map,t=null,s)=>({nextPart:e,validators:t,classGroupId:s}),Xu="-",hS=[],R3="arbitrary..",A3=e=>{const t=D3(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return M3(c);const h=c.split(Xu),f=h[0]===""&&h.length>1?1:0;return mE(h,f,t)},getConflictingClassGroupIds:(c,h)=>{if(h){const f=n[c],d=s[c];return f?d?T3(d,f):f:d||hS}return s[c]||hS}}},mE=(e,t,s)=>{if(e.length-t===0)return s.classGroupId;const o=e[t],l=s.nextPart.get(o);if(l){const d=mE(e,t+1,l);if(d)return d}const c=s.validators;if(c===null)return;const h=t===0?e.join(Xu):e.slice(t).join(Xu),f=c.length;for(let d=0;d<f;d++){const p=c[d];if(p.validator(h))return p.classGroupId}},M3=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),s=t.indexOf(":"),n=t.slice(0,s);return n?R3+n:void 0})(),D3=e=>{const{theme:t,classGroups:s}=e;return O3(s,t)},O3=(e,t)=>{const s=fE();for(const n in e){const o=e[n];jg(o,s,n,t)}return s},jg=(e,t,s,n)=>{const o=e.length;for(let l=0;l<o;l++){const c=e[l];N3(c,t,s,n)}},N3=(e,t,s,n)=>{if(typeof e=="string"){L3(e,t,s);return}if(typeof e=="function"){B3(e,t,s,n);return}P3(e,t,s,n)},L3=(e,t,s)=>{const n=e===""?t:pE(t,e);n.classGroupId=s},B3=(e,t,s,n)=>{if(z3(e)){jg(e(n),t,s,n);return}t.validators===null&&(t.validators=[]),t.validators.push(k3(s,e))},P3=(e,t,s,n)=>{const o=Object.entries(e),l=o.length;for(let c=0;c<l;c++){const[h,f]=o[c];jg(f,pE(t,h),s,n)}},pE=(e,t)=>{let s=e;const n=t.split(Xu),o=n.length;for(let l=0;l<o;l++){const c=n[l];let h=s.nextPart.get(c);h||(h=fE(),s.nextPart.set(c,h)),s=h}return s},z3=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,j3=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,s=Object.create(null),n=Object.create(null);const o=(l,c)=>{s[l]=c,t++,t>e&&(t=0,n=s,s=Object.create(null))};return{get(l){let c=s[l];if(c!==void 0)return c;if((c=n[l])!==void 0)return o(l,c),c},set(l,c){l in s?s[l]=c:o(l,c)}}},cp="!",dS=":",H3=[],fS=(e,t,s,n,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:s,maybePostfixModifierPosition:n,isExternal:o}),I3=e=>{const{prefix:t,experimentalParseClassName:s}=e;let n=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===dS){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(cp)?(_=v.slice(0,-1),y=!0):v.startsWith(cp)&&(_=v.slice(1),y=!0);const b=d&&d>f?d-f:void 0;return fS(l,y,_,b)};if(t){const o=t+dS,l=n;n=c=>c.startsWith(o)?l(c.slice(o.length)):fS(H3,!1,c,void 0,!0)}if(s){const o=n;n=l=>s({className:l,parseClassName:o})}return n},V3=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((s,n)=>{t.set(s,1e6+n)}),s=>{const n=[];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(),n.push(...o),o=[]),n.push(c)):o.push(c)}return o.length>0&&(o.sort(),n.push(...o)),n}},U3=e=>({cache:j3(e.cacheSize),parseClassName:I3(e),sortModifiers:V3(e),...A3(e)}),F3=/\s+/,W3=(e,t)=>{const{parseClassName:s,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:l}=t,c=[],h=e.trim().split(F3);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,R=n(E?b.substring(0,S):b);if(!R){if(!E){f=p+(f.length>0?" "+f:f);continue}if(R=n(b),!R){f=p+(f.length>0?" "+f:f);continue}E=!1}const A=_.length===0?"":_.length===1?_[0]:l(_).join(":"),M=y?A+cp:A,k=M+R;if(c.indexOf(k)>-1)continue;c.push(k);const j=o(R,E);for(let F=0;F<j.length;++F){const U=j[F];c.push(M+U)}f=p+(f.length>0?" "+f:f)}return f},K3=(...e)=>{let t=0,s,n,o="";for(;t<e.length;)(s=e[t++])&&(n=gE(s))&&(o&&(o+=" "),o+=n);return o},gE=e=>{if(typeof e=="string")return e;let t,s="";for(let n=0;n<e.length;n++)e[n]&&(t=gE(e[n]))&&(s&&(s+=" "),s+=t);return s},Y3=(e,...t)=>{let s,n,o,l;const c=f=>{const d=t.reduce((p,v)=>v(p),e());return s=U3(d),n=s.cache.get,o=s.cache.set,l=h,h(f)},h=f=>{const d=n(f);if(d)return d;const p=W3(f,s);return o(f,p),p};return l=c,(...f)=>l(K3(...f))},q3=[],At=e=>{const t=s=>s[e]||q3;return t.isThemeGetter=!0,t},vE=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,_E=/^\((?:(\w[\w-]*):)?(.+)\)$/i,$3=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,G3=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,X3=/\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$/,Z3=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Q3=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,J3=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Rn=e=>$3.test(e),Pe=e=>!!e&&!Number.isNaN(Number(e)),An=e=>!!e&&Number.isInteger(Number(e)),gm=e=>e.endsWith("%")&&Pe(e.slice(0,-1)),Ws=e=>G3.test(e),yE=()=>!0,e5=e=>X3.test(e)&&!Z3.test(e),Hg=()=>!1,t5=e=>Q3.test(e),i5=e=>J3.test(e),s5=e=>!_e(e)&&!be(e),n5=e=>Yn(e,wE,Hg),_e=e=>vE.test(e),gr=e=>Yn(e,xE,e5),mS=e=>Yn(e,d5,Pe),r5=e=>Yn(e,EE,yE),o5=e=>Yn(e,CE,Hg),pS=e=>Yn(e,bE,Hg),a5=e=>Yn(e,SE,i5),ou=e=>Yn(e,TE,t5),be=e=>_E.test(e),qa=e=>Lr(e,xE),l5=e=>Lr(e,CE),gS=e=>Lr(e,bE),c5=e=>Lr(e,wE),u5=e=>Lr(e,SE),au=e=>Lr(e,TE,!0),h5=e=>Lr(e,EE,!0),Yn=(e,t,s)=>{const n=vE.exec(e);return n?n[1]?t(n[1]):s(n[2]):!1},Lr=(e,t,s=!1)=>{const n=_E.exec(e);return n?n[1]?t(n[1]):s:!1},bE=e=>e==="position"||e==="percentage",SE=e=>e==="image"||e==="url",wE=e=>e==="length"||e==="size"||e==="bg-size",xE=e=>e==="length",d5=e=>e==="number",CE=e=>e==="family-name",EE=e=>e==="number"||e==="weight",TE=e=>e==="shadow",f5=()=>{const e=At("color"),t=At("font"),s=At("text"),n=At("font-weight"),o=At("tracking"),l=At("leading"),c=At("breakpoint"),h=At("container"),f=At("spacing"),d=At("radius"),p=At("shadow"),v=At("inset-shadow"),_=At("text-shadow"),y=At("drop-shadow"),b=At("blur"),S=At("perspective"),E=At("aspect"),R=At("ease"),A=At("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(),be,_e],F=()=>["auto","hidden","clip","visible","scroll"],U=()=>["auto","contain","none"],H=()=>[be,_e,f],J=()=>[Rn,"full","auto",...H()],W=()=>[An,"none","subgrid",be,_e],$=()=>["auto",{span:["full",An,be,_e]},An,be,_e],z=()=>[An,"auto",be,_e],L=()=>["auto","min","max","fr",be,_e],P=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],T=()=>["auto",...H()],I=()=>[Rn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...H()],B=()=>[Rn,"screen","full","dvw","lvw","svw","min","max","fit",...H()],ee=()=>[Rn,"screen","full","lh","dvh","lvh","svh","min","max","fit",...H()],X=()=>[e,be,_e],N=()=>[...k(),gS,pS,{position:[be,_e]}],Z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],se=()=>["auto","cover","contain",c5,n5,{size:[be,_e]}],V=()=>[gm,qa,gr],O=()=>["","none","full",d,be,_e],K=()=>["",Pe,qa,gr],Y=()=>["solid","dashed","dotted","double"],ie=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ne=()=>[Pe,gm,gS,pS],fe=()=>["","none",b,be,_e],me=()=>["none",Pe,be,_e],we=()=>["none",Pe,be,_e],Ce=()=>[Pe,be,_e],Oe=()=>[Rn,"full",...H()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ws],breakpoint:[Ws],color:[yE],container:[Ws],"drop-shadow":[Ws],ease:["in","out","in-out"],font:[s5],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ws],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ws],shadow:[Ws],spacing:["px",Pe],text:[Ws],"text-shadow":[Ws],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Rn,_e,be,E]}],container:["container"],columns:[{columns:[Pe,_e,be,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:U()}],"overscroll-x":[{"overscroll-x":U()}],"overscroll-y":[{"overscroll-y":U()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:J()}],"inset-x":[{"inset-x":J()}],"inset-y":[{"inset-y":J()}],start:[{"inset-s":J(),start:J()}],end:[{"inset-e":J(),end:J()}],"inset-bs":[{"inset-bs":J()}],"inset-be":[{"inset-be":J()}],top:[{top:J()}],right:[{right:J()}],bottom:[{bottom:J()}],left:[{left:J()}],visibility:["visible","invisible","collapse"],z:[{z:[An,"auto",be,_e]}],basis:[{basis:[Rn,"full","auto",h,...H()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Pe,Rn,"auto","initial","none",_e]}],grow:[{grow:["",Pe,be,_e]}],shrink:[{shrink:["",Pe,be,_e]}],order:[{order:[An,"first","last","none",be,_e]}],"grid-cols":[{"grid-cols":W()}],"col-start-end":[{col:$()}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":W()}],"row-start-end":[{row:$()}],"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:H()}],"gap-x":[{"gap-x":H()}],"gap-y":[{"gap-y":H()}],"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:H()}],px:[{px:H()}],py:[{py:H()}],ps:[{ps:H()}],pe:[{pe:H()}],pbs:[{pbs:H()}],pbe:[{pbe:H()}],pt:[{pt:H()}],pr:[{pr:H()}],pb:[{pb:H()}],pl:[{pl:H()}],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":H()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":H()}],"space-y-reverse":["space-y-reverse"],size:[{size:I()}],"inline-size":[{inline:["auto",...B()]}],"min-inline-size":[{"min-inline":["auto",...B()]}],"max-inline-size":[{"max-inline":["none",...B()]}],"block-size":[{block:["auto",...ee()]}],"min-block-size":[{"min-block":["auto",...ee()]}],"max-block-size":[{"max-block":["none",...ee()]}],w:[{w:[h,"screen",...I()]}],"min-w":[{"min-w":[h,"screen","none",...I()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[c]},...I()]}],h:[{h:["screen","lh",...I()]}],"min-h":[{"min-h":["screen","lh","none",...I()]}],"max-h":[{"max-h":["screen","lh",...I()]}],"font-size":[{text:["base",s,qa,gr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,h5,r5]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",gm,_e]}],"font-family":[{font:[l5,o5,t]}],"font-features":[{"font-features":[_e]}],"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,be,_e]}],"line-clamp":[{"line-clamp":[Pe,"none",be,mS]}],leading:[{leading:[l,...H()]}],"list-image":[{"list-image":["none",be,_e]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",be,_e]}],"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:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:[Pe,"from-font","auto",be,gr]}],"text-decoration-color":[{decoration:X()}],"underline-offset":[{"underline-offset":[Pe,"auto",be,_e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:H()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",be,_e]}],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",be,_e]}],"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:se()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},An,be,_e],radial:["",be,_e],conic:[An,be,_e]},u5,a5]}],"bg-color":[{bg:X()}],"gradient-from-pos":[{from:V()}],"gradient-via-pos":[{via:V()}],"gradient-to-pos":[{to:V()}],"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:K()}],"border-w-x":[{"border-x":K()}],"border-w-y":[{"border-y":K()}],"border-w-s":[{"border-s":K()}],"border-w-e":[{"border-e":K()}],"border-w-bs":[{"border-bs":K()}],"border-w-be":[{"border-be":K()}],"border-w-t":[{"border-t":K()}],"border-w-r":[{"border-r":K()}],"border-w-b":[{"border-b":K()}],"border-w-l":[{"border-l":K()}],"divide-x":[{"divide-x":K()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":K()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Y(),"hidden","none"]}],"divide-style":[{divide:[...Y(),"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:[...Y(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Pe,be,_e]}],"outline-w":[{outline:["",Pe,qa,gr]}],"outline-color":[{outline:X()}],shadow:[{shadow:["","none",p,au,ou]}],"shadow-color":[{shadow:X()}],"inset-shadow":[{"inset-shadow":["none",v,au,ou]}],"inset-shadow-color":[{"inset-shadow":X()}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:X()}],"ring-offset-w":[{"ring-offset":[Pe,gr]}],"ring-offset-color":[{"ring-offset":X()}],"inset-ring-w":[{"inset-ring":K()}],"inset-ring-color":[{"inset-ring":X()}],"text-shadow":[{"text-shadow":["none",_,au,ou]}],"text-shadow-color":[{"text-shadow":X()}],opacity:[{opacity:[Pe,be,_e]}],"mix-blend":[{"mix-blend":[...ie(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ie()}],"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":[Pe]}],"mask-image-linear-from-pos":[{"mask-linear-from":ne()}],"mask-image-linear-to-pos":[{"mask-linear-to":ne()}],"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":ne()}],"mask-image-t-to-pos":[{"mask-t-to":ne()}],"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":ne()}],"mask-image-r-to-pos":[{"mask-r-to":ne()}],"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":ne()}],"mask-image-b-to-pos":[{"mask-b-to":ne()}],"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":ne()}],"mask-image-l-to-pos":[{"mask-l-to":ne()}],"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":ne()}],"mask-image-x-to-pos":[{"mask-x-to":ne()}],"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":ne()}],"mask-image-y-to-pos":[{"mask-y-to":ne()}],"mask-image-y-from-color":[{"mask-y-from":X()}],"mask-image-y-to-color":[{"mask-y-to":X()}],"mask-image-radial":[{"mask-radial":[be,_e]}],"mask-image-radial-from-pos":[{"mask-radial-from":ne()}],"mask-image-radial-to-pos":[{"mask-radial-to":ne()}],"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":[Pe]}],"mask-image-conic-from-pos":[{"mask-conic-from":ne()}],"mask-image-conic-to-pos":[{"mask-conic-to":ne()}],"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:se()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",be,_e]}],filter:[{filter:["","none",be,_e]}],blur:[{blur:fe()}],brightness:[{brightness:[Pe,be,_e]}],contrast:[{contrast:[Pe,be,_e]}],"drop-shadow":[{"drop-shadow":["","none",y,au,ou]}],"drop-shadow-color":[{"drop-shadow":X()}],grayscale:[{grayscale:["",Pe,be,_e]}],"hue-rotate":[{"hue-rotate":[Pe,be,_e]}],invert:[{invert:["",Pe,be,_e]}],saturate:[{saturate:[Pe,be,_e]}],sepia:[{sepia:["",Pe,be,_e]}],"backdrop-filter":[{"backdrop-filter":["","none",be,_e]}],"backdrop-blur":[{"backdrop-blur":fe()}],"backdrop-brightness":[{"backdrop-brightness":[Pe,be,_e]}],"backdrop-contrast":[{"backdrop-contrast":[Pe,be,_e]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Pe,be,_e]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Pe,be,_e]}],"backdrop-invert":[{"backdrop-invert":["",Pe,be,_e]}],"backdrop-opacity":[{"backdrop-opacity":[Pe,be,_e]}],"backdrop-saturate":[{"backdrop-saturate":[Pe,be,_e]}],"backdrop-sepia":[{"backdrop-sepia":["",Pe,be,_e]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":H()}],"border-spacing-x":[{"border-spacing-x":H()}],"border-spacing-y":[{"border-spacing-y":H()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",be,_e]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Pe,"initial",be,_e]}],ease:[{ease:["linear","initial",R,be,_e]}],delay:[{delay:[Pe,be,_e]}],animate:[{animate:["none",A,be,_e]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,be,_e]}],"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:we()}],"scale-x":[{"scale-x":we()}],"scale-y":[{"scale-y":we()}],"scale-z":[{"scale-z":we()}],"scale-3d":["scale-3d"],skew:[{skew:Ce()}],"skew-x":[{"skew-x":Ce()}],"skew-y":[{"skew-y":Ce()}],transform:[{transform:[be,_e,"","none","gpu","cpu"]}],"transform-origin":[{origin:j()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Oe()}],"translate-x":[{"translate-x":Oe()}],"translate-y":[{"translate-y":Oe()}],"translate-z":[{"translate-z":Oe()}],"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",be,_e]}],"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":H()}],"scroll-mx":[{"scroll-mx":H()}],"scroll-my":[{"scroll-my":H()}],"scroll-ms":[{"scroll-ms":H()}],"scroll-me":[{"scroll-me":H()}],"scroll-mbs":[{"scroll-mbs":H()}],"scroll-mbe":[{"scroll-mbe":H()}],"scroll-mt":[{"scroll-mt":H()}],"scroll-mr":[{"scroll-mr":H()}],"scroll-mb":[{"scroll-mb":H()}],"scroll-ml":[{"scroll-ml":H()}],"scroll-p":[{"scroll-p":H()}],"scroll-px":[{"scroll-px":H()}],"scroll-py":[{"scroll-py":H()}],"scroll-ps":[{"scroll-ps":H()}],"scroll-pe":[{"scroll-pe":H()}],"scroll-pbs":[{"scroll-pbs":H()}],"scroll-pbe":[{"scroll-pbe":H()}],"scroll-pt":[{"scroll-pt":H()}],"scroll-pr":[{"scroll-pr":H()}],"scroll-pb":[{"scroll-pb":H()}],"scroll-pl":[{"scroll-pl":H()}],"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",be,_e]}],fill:[{fill:["none",...X()]}],"stroke-w":[{stroke:[Pe,qa,gr,mS]}],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"]}},m5=Y3(f5);function it(...e){return m5(dE(e))}function vl({className:e,children:t,...s}){return w.jsxs(hN,{"data-slot":"scroll-area",type:"hover",scrollHideDelay:300,className:it("relative",e),...s,children:[w.jsx(dN,{"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}),w.jsx(p5,{}),w.jsx(fN,{})]})}function p5({className:e,orientation:t="vertical",...s}){return w.jsx(uC,{"data-slot":"scroll-area-scrollbar",orientation:t,className:it("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:w.jsx(mC,{"data-slot":"scroll-area-thumb",className:"relative flex-1 rounded-full bg-border"})})}const kE=(...e)=>e.filter((t,s,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===s).join(" ").trim();const g5=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const v5=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,s,n)=>n?n.toUpperCase():s.toLowerCase());const vS=e=>{const t=v5(e);return t.charAt(0).toUpperCase()+t.slice(1)};var _5={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 y5=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const b5=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:n,className:o="",children:l,iconNode:c,...h},f)=>x.createElement("svg",{ref:f,..._5,width:t,height:t,stroke:e,strokeWidth:n?Number(s)*24/Number(t):s,className:kE("lucide",o),...!l&&!y5(h)&&{"aria-hidden":"true"},...h},[...c.map(([d,p])=>x.createElement(d,p)),...Array.isArray(l)?l:[l]]));const ri=(e,t)=>{const s=x.forwardRef(({className:n,...o},l)=>x.createElement(b5,{ref:l,iconNode:t,className:kE(`lucide-${g5(vS(e))}`,`lucide-${e}`,n),...o}));return s.displayName=vS(e),s};const S5=[["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"}]],w5=ri("arrow-down-up",S5);const x5=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],RE=ri("arrow-left",x5);const C5=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],E5=ri("check",C5);const T5=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],AE=ri("chevron-down",T5);const k5=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],R5=ri("chevron-up",k5);const A5=[["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"}]],M5=ri("file-diff",A5);const D5=[["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"}]],O5=ri("git-commit-horizontal",D5);const N5=[["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"}]],L5=ri("network",N5);const B5=[["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"}]],P5=ri("panel-right-close",B5);const z5=[["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"}]],j5=ri("panel-right-open",z5);const H5=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],I5=ri("search",H5);const V5=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],U5=ri("settings",V5);const F5=[["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"}]],W5=ri("square-terminal",F5);const K5=[["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"}]],Y5=ri("trash-2",K5);const q5=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ig=ri("x",q5);function cl({className:e,...t}){return w.jsx("div",{"data-slot":"skeleton",className:it("animate-pulse rounded-md bg-accent",e),...t})}function $5({className:e,...t}){return w.jsx("div",{"data-slot":"card",className:it("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",e),...t})}const _S=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,yS=dE,Vg=(e,t)=>s=>{var n;if(t?.variants==null)return yS(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 _=_S(p)||_S(v);return o[d][_]}),h=s&&Object.entries(s).reduce((d,p)=>{let[v,_]=p;return _===void 0||(d[v]=_),d},{}),f=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.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 yS(e,c,f,s?.class,s?.className)},G5=Vg("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 Zu({className:e,variant:t="default",asChild:s=!1,...n}){const o=s?$x:"span";return w.jsx(o,{"data-slot":"badge","data-variant":t,className:it(G5({variant:t}),e),...n})}function ME({delayDuration:e=0,...t}){return w.jsx(b3,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function DE({...e}){return w.jsx(S3,{"data-slot":"tooltip",...e})}function OE({...e}){return w.jsx(w3,{"data-slot":"tooltip-trigger",...e})}function NE({className:e,sideOffset:t=0,children:s,...n}){return w.jsx(x3,{children:w.jsxs(C3,{"data-slot":"tooltip-content",sideOffset:t,className:it("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),...n,children:[s,w.jsx(E3,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-popover fill-popover"})]})})}function X5(){const[e,t]=x.useState(!0);return x.useEffect(()=>{const s=setTimeout(()=>t(!1),1800);return()=>clearTimeout(s)},[]),e?w.jsxs("div",{className:"celebration-overlay","aria-hidden":"true",children:[w.jsx("div",{className:"sparkle sparkle-1"}),w.jsx("div",{className:"sparkle sparkle-2"}),w.jsx("div",{className:"sparkle sparkle-3"}),w.jsx("div",{className:"sparkle sparkle-4"}),w.jsx("div",{className:"sparkle sparkle-5"}),w.jsx("div",{className:"sparkle sparkle-6"}),w.jsx("div",{className:"kawaii-star",children:w.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",style:{imageRendering:"pixelated"},children:[w.jsx("rect",{x:"10",y:"0",width:"4",height:"2",fill:"#FFD700"}),w.jsx("rect",{x:"8",y:"2",width:"8",height:"2",fill:"#FFD700"}),w.jsx("rect",{x:"0",y:"4",width:"24",height:"2",fill:"#FFD700"}),w.jsx("rect",{x:"2",y:"6",width:"20",height:"2",fill:"#FFD700"}),w.jsx("rect",{x:"4",y:"8",width:"16",height:"2",fill:"#FFD700"}),w.jsx("rect",{x:"2",y:"10",width:"20",height:"2",fill:"#FFD700"}),w.jsx("rect",{x:"0",y:"12",width:"24",height:"2",fill:"#FFD700"}),w.jsx("rect",{x:"8",y:"14",width:"8",height:"2",fill:"#FFD700"}),w.jsx("rect",{x:"10",y:"16",width:"4",height:"2",fill:"#FFD700"}),w.jsx("rect",{x:"8",y:"6",width:"2",height:"2",fill:"#1a1a2e"}),w.jsx("rect",{x:"14",y:"6",width:"2",height:"2",fill:"#1a1a2e"}),w.jsx("rect",{x:"10",y:"10",width:"4",height:"2",fill:"#ff6b9d"}),w.jsx("rect",{x:"6",y:"8",width:"2",height:"2",fill:"#ff6b9d",opacity:"0.5"}),w.jsx("rect",{x:"16",y:"8",width:"2",height:"2",fill:"#ff6b9d",opacity:"0.5"})]})})]}):null}const bS={0:"text-[#f85149]",1:"text-[#e3b341]",2:"text-[#58a6ff]",3:"text-[#7d8590]",4:"text-muted-foreground"},Z5={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 Q5({issue:e,onClick:t,celebrating:s}){const n=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 w.jsxs("div",{className:s?"celebration-card-wrapper":void 0,children:[s&&w.jsx(X5,{}),w.jsxs($5,{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:[w.jsxs("div",{className:"flex items-center justify-between gap-2",children:[w.jsx("code",{className:"text-xs text-muted-foreground",children:e.id}),w.jsxs("span",{className:`text-xs font-semibold ${bS[e.priority]||bS[4]}`,children:["P",e.priority]})]}),w.jsx(ME,{children:w.jsxs(DE,{children:[w.jsx(OE,{asChild:!0,children:w.jsx("p",{className:"text-sm font-medium leading-tight line-clamp-2",children:e.title})}),w.jsx(NE,{children:w.jsx("p",{children:e.title})})]})}),w.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap mt-1",children:[e.type&&w.jsx(Zu,{variant:"outline",className:Z5[e.type]||"",children:e.type}),n>0&&w.jsxs("span",{className:"text-xs text-muted-foreground",children:[n," dep",n>1?"s":""]}),e.assignee&&w.jsx("span",{className:"text-xs text-muted-foreground ml-auto",children:e.assignee})]})]})]})}function J5(e,t){return[...e].sort((s,n)=>{if(t==="priority"){const o=(s.priority??4)-(n.priority??4);return o!==0?o:(n.updated_at??"").localeCompare(s.updated_at??"")}return(n.updated_at??"").localeCompare(s.updated_at??"")})}function lu({title:e,issues:t,accentColor:s,loading:n,sortable:o,onIssueClick:l,celebratingIds:c}){const[h,f]=x.useState("recent"),d=x.useMemo(()=>o?J5(t,h):t,[t,h,o]),p=()=>f(v=>v==="recent"?"priority":"recent");return w.jsxs("div",{className:"min-w-0 flex-1",children:[w.jsxs("div",{className:`flex items-center gap-2 px-3 py-2 border-b-2 sticky top-0 z-10 bg-background ${s}`,children:[w.jsx("h2",{className:"text-sm font-semibold",children:e}),w.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",t.length,")"]}),o&&w.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:[w.jsx(w5,{className:"h-3 w-3"}),w.jsx("span",{children:h==="recent"?"Recent":"Priority"})]})]}),w.jsx("div",{className:"p-2",children:n?Array.from({length:3}).map((v,_)=>w.jsx(cl,{className:"h-24 mb-2 rounded-lg"},_)):d.length===0?w.jsx("p",{className:"text-xs text-muted-foreground text-center py-4",children:"No issues"}):d.map(v=>w.jsx(Q5,{issue:v,onClick:l,celebrating:c?.has(v.id)},v.id))})]})}function eL(e){const t=x.useMemo(()=>e.map(c=>c.id).sort(),[e]),s=t.join(","),n=x.useRef(null),[o,l]=x.useState(new Set);return x.useEffect(()=>{const c=new Set(t);if(n.current===null||n.current.size===0){n.current=c;return}const h=new Set;for(const f of c)n.current.has(f)||h.add(f);if(n.current=c,h.size>0){l(h);const f=setTimeout(()=>l(new Set),2e3);return()=>clearTimeout(f)}},[s]),o}function tL({issues:e,allIssues:t,ready:s,blocked:n,loading:o,onIssueClick:l}){const c=new Set(s.map(_=>_.id)),h=e.filter(_=>_.status==="in_progress"),f=e.filter(_=>_.status==="closed"),d=x.useMemo(()=>(t||e).filter(_=>_.status==="closed"),[t,e]),p=eL(d),v=e.filter(_=>_.status!=="in_progress"&&_.status!=="closed"&&!c.has(_.id));return w.jsx(vl,{className:"h-full",children:w.jsxs("div",{className:"flex gap-3",children:[w.jsx(lu,{title:"Backlog",issues:v,accentColor:"border-[#7d8590]",loading:o,onIssueClick:l}),w.jsx(lu,{title:"Ready",issues:s,accentColor:"border-[#238636]",loading:o,onIssueClick:l}),w.jsx(lu,{title:"In Progress",issues:h,accentColor:"border-[#1f6feb]",loading:o,onIssueClick:l}),w.jsx(lu,{title:"Done",issues:f,accentColor:"border-[#484f58]",loading:o,sortable:!0,onIssueClick:l,celebratingIds:p})]})})}function iL({className:e,orientation:t="horizontal",...s}){return w.jsx(t3,{"data-slot":"tabs","data-orientation":t,orientation:t,className:it("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",e),...s})}const sL=Vg("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 nL({className:e,variant:t="default",...s}){return w.jsx(i3,{"data-slot":"tabs-list","data-variant":t,className:it(sL({variant:t}),e),...s})}function SS({className:e,...t}){return w.jsx(s3,{"data-slot":"tabs-trigger",className:it("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 wS({className:e,...t}){return w.jsx(n3,{"data-slot":"tabs-content",className:it("flex-1 outline-none",e),...t})}function Cu({...e}){return w.jsx(zN,{"data-slot":"select",...e})}function Eu({...e}){return w.jsx(HN,{"data-slot":"select-value",...e})}function Tu({className:e,size:t="default",children:s,...n}){return w.jsxs(jN,{"data-slot":"select-trigger","data-size":t,className:it("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),...n,children:[s,w.jsx(IN,{asChild:!0,children:w.jsx(AE,{className:"size-4 opacity-50"})})]})}function ku({className:e,children:t,position:s="item-aligned",align:n="center",...o}){return w.jsx(VN,{children:w.jsxs(UN,{"data-slot":"select-content",className:it("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:n,...o,children:[w.jsx(rL,{}),w.jsx(FN,{className:it("p-1",s==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),w.jsx(oL,{})]})})}function il({className:e,children:t,...s}){return w.jsxs(WN,{"data-slot":"select-item",className:it("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:[w.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:w.jsx(YN,{children:w.jsx(E5,{className:"size-4"})})}),w.jsx(KN,{children:t})]})}function rL({className:e,...t}){return w.jsx(qN,{"data-slot":"select-scroll-up-button",className:it("flex cursor-default items-center justify-center py-1",e),...t,children:w.jsx(R5,{className:"size-4"})})}function oL({className:e,...t}){return w.jsx($N,{"data-slot":"select-scroll-down-button",className:it("flex cursor-default items-center justify-center py-1",e),...t,children:w.jsx(AE,{className:"size-4"})})}function aL({branches:e,current:t,onSelect:s}){return w.jsxs(Cu,{value:t,onValueChange:s,children:[w.jsx(Tu,{className:"w-full",children:w.jsx(Eu,{placeholder:"Select branch"})}),w.jsx(ku,{children:e.map(n=>w.jsx(il,{value:n,children:n},n))})]})}const up=/\b([\w]+-[\w]+-[a-z0-9]{2,8})\b/;function lL(e){const t=new Date(e),n=new Date().getTime()-t.getTime(),o=Math.floor(n/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 xS(e,t){return e.split(new RegExp(up.source,"g")).map((n,o)=>up.test(n)?w.jsx(Zu,{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(n)}:void 0,children:n},o):w.jsx("span",{children:n},o))}function cL(e){const t=[];let s;const n=new RegExp(up.source,"g");for(;(s=n.exec(e))!==null;)t.push(s[1]);return t}function uL({commit:e,onBeadClick:t,highlightedBeadId:s}){const n=cL(e.message),o=s?n.includes(s):!1;return w.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":""}`,...n.length>0?{"data-commit-beads":n.join(" ")}:{},children:[w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("code",{className:"text-xs text-muted-foreground shrink-0",children:e.hash}),w.jsx("span",{className:"text-xs text-muted-foreground ml-auto shrink-0",children:lL(e.date)})]}),e.body?w.jsx(ME,{children:w.jsxs(DE,{children:[w.jsx(OE,{asChild:!0,children:w.jsx("p",{className:"text-sm leading-tight break-words cursor-help",children:xS(e.message,t)})}),w.jsxs(NE,{side:"bottom",className:"max-w-sm whitespace-pre-wrap text-xs",children:[w.jsx("p",{className:"font-semibold mb-1",children:e.message}),w.jsx("p",{children:e.body})]})]})}):w.jsx("p",{className:"text-sm leading-tight break-words",children:xS(e.message,t)}),w.jsx("span",{className:"text-xs text-muted-foreground",children:e.author})]})}function qn(e,t=5e3){const[s,n]=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();n(_),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 hL="";async function $n(e){const t=await fetch(`${hL}${e}`);if(!t.ok)throw new Error(`API error: ${t.status}`);return t.json()}function dL(){const e=x.useCallback(()=>$n("/api/issues"),[]);return qn(e)}function fL(){const e=x.useCallback(()=>$n("/api/ready"),[]);return qn(e)}function mL(){const e=x.useCallback(()=>$n("/api/blocked"),[]);return qn(e)}function pL(e,t=50){const s=x.useCallback(()=>$n(`/api/git-log?branch=${encodeURIComponent(e)}&limit=${t}`),[e,t]);return qn(s)}function gL(){const e=x.useCallback(()=>$n("/api/branches"),[]);return qn(e,3e4)}function vL(e){const t=x.useCallback(()=>e?$n(`/api/git-diff?file=${encodeURIComponent(e)}`):Promise.resolve(null),[e]);return qn(t,1e4)}function _L(){const e=x.useCallback(()=>$n("/api/git-status"),[]);return qn(e)}function yL(){const e=x.useCallback(()=>$n("/api/project"),[]);return qn(e,6e4)}function bL(e){const t=e.split(`
|
|
54
|
+
`),s=[];for(const n of t)n.startsWith("@@")?s.push({type:"hunk",content:n}):n.startsWith("---")||n.startsWith("+++")?s.push({type:"header",content:n}):n.startsWith("+")?s.push({type:"add",content:n.substring(1)}):n.startsWith("-")?s.push({type:"remove",content:n.substring(1)}):n===""?s.push({type:"empty",content:""}):s.push({type:"context",content:n.startsWith(" ")?n.substring(1):n});return s}const SL={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"},wL={header:"",hunk:"",add:"+",remove:"-",context:" ",empty:" "};function xL({file:e,onBack:t}){const{data:s,loading:n}=vL(e),o=s?.diff?bL(s.diff):[],l=e.split("/").pop()||e;return w.jsxs("div",{className:"flex flex-col h-full",children:[w.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border shrink-0",children:[w.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:w.jsx(RE,{className:"h-4 w-4"})}),w.jsx("span",{className:"text-xs font-mono text-foreground truncate",title:e,children:l})]}),w.jsx(vl,{className:"flex-1 min-h-0",children:n&&!s?Array.from({length:8}).map((c,h)=>w.jsx(cl,{className:"h-5 mx-3 mb-1 rounded"},h)):o.length>0?w.jsx("div",{className:"text-xs font-mono leading-5",children:o.map((c,h)=>w.jsxs("div",{className:`px-3 ${SL[c.type]}`,children:[w.jsx("span",{className:"inline-block w-4 text-muted-foreground/50 select-none mr-2 text-right",children:wL[c.type]}),w.jsx("span",{className:"whitespace-pre-wrap break-all",children:(c.type==="hunk",c.content)})]},h))}):w.jsx("p",{className:"text-xs text-muted-foreground text-center py-4",children:"No diff available"})})]})}const CL={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 EL(e){return CL[e]||{label:e,color:"text-muted-foreground"}}function TL({onCollapse:e,onBeadClick:t,highlightedBeadId:s}){const{data:n,loading:o}=gL(),[l,c]=x.useState(""),[h,f]=x.useState(()=>localStorage.getItem("beads-board-git-tab")||"log"),[d,p]=x.useState(null),v=l||n?.current||"",{data:_,loading:y}=pL(v),{data:b,loading:S}=_L();return w.jsx("div",{className:"flex flex-col h-full border-l border-border",children:d?w.jsx(xL,{file:d,onBack:()=>p(null)}):w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"p-3 border-b border-border shrink-0",children:[w.jsxs("div",{className:"flex items-center justify-between mb-2",children:[w.jsx("h2",{className:"text-sm font-semibold",children:"Git"}),e&&w.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:w.jsx(P5,{className:"h-4 w-4"})})]}),o?w.jsx(cl,{className:"h-9 w-full"}):n?w.jsx(aL,{branches:n.branches,current:v,onSelect:c}):null]}),w.jsxs(iL,{value:h,onValueChange:E=>{f(E),localStorage.setItem("beads-board-git-tab",E)},className:"flex flex-col flex-1 min-h-0",children:[w.jsxs(nL,{className:"mx-3 mt-2 shrink-0",children:[w.jsxs(SS,{value:"log",className:"gap-1.5",children:[w.jsx(O5,{className:"h-3.5 w-3.5"}),"Log"]}),w.jsxs(SS,{value:"diff",className:"gap-1.5",children:[w.jsx(M5,{className:"h-3.5 w-3.5"}),"Diff",b&&b.length>0&&w.jsx("span",{className:"ml-1 text-xs bg-primary/20 text-primary rounded-full px-1.5",children:b.length})]})]}),w.jsx(wS,{value:"log",className:"flex-1 min-h-0 mt-0",children:w.jsx(vl,{className:"h-full",children:y?Array.from({length:5}).map((E,R)=>w.jsx(cl,{className:"h-16 mx-3 mb-2 rounded"},R)):_?.length?_.map(E=>w.jsx(uL,{commit:E,onBeadClick:t,highlightedBeadId:s},E.hash)):w.jsx("p",{className:"text-xs text-muted-foreground text-center py-4",children:"No commits"})})}),w.jsx(wS,{value:"diff",className:"flex-1 min-h-0 mt-0",children:w.jsx(vl,{className:"h-full",children:S?Array.from({length:3}).map((E,R)=>w.jsx(cl,{className:"h-8 mx-3 mb-2 rounded"},R)):b?.length?w.jsx("div",{className:"px-3 py-2 space-y-1",children:b.map((E,R)=>{const A=EL(E.status);return w.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:[w.jsx("span",{className:"text-foreground truncate flex-1",title:E.path,children:E.path}),w.jsx("span",{className:`shrink-0 w-20 text-right ${A.color}`,children:A.label})]},R)})}):w.jsx("p",{className:"text-xs text-muted-foreground text-center py-4",children:"Working tree clean"})})})]})]})})}function kL(){const[e,t]=x.useState(()=>typeof window>"u"?"dark":localStorage.getItem("beads-board-theme")||"dark");return x.useEffect(()=>{const n=document.documentElement;n.classList.remove("light","dark"),n.classList.add(e),localStorage.setItem("beads-board-theme",e)},[e]),{theme:e,toggle:()=>t(n=>n==="dark"?"light":"dark")}}function RL(){const{theme:e,toggle:t}=kL();return w.jsx("button",{onClick:t,className:"rounded-md p-2 hover:bg-muted transition-colors","aria-label":"Toggle theme",children:e==="dark"?"☀️":"🌙"})}const Ug=x.createContext({});function Fg(e){const t=x.useRef(null);return t.current===null&&(t.current=e()),t.current}const AL=typeof window<"u",LE=AL?x.useLayoutEffect:x.useEffect,Dh=x.createContext(null);function Wg(e,t){e.indexOf(t)===-1&&e.push(t)}function Qu(e,t){const s=e.indexOf(t);s>-1&&e.splice(s,1)}const Ss=(e,t,s)=>s>t?t:s<e?e:s;let Kg=()=>{};const Zs={},BE=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function PE(e){return typeof e=="object"&&e!==null}const zE=e=>/^0[^.\s]+$/u.test(e);function jE(e){let t;return()=>(t===void 0&&(t=e()),t)}const Ki=e=>e,ML=(e,t)=>s=>t(e(s)),Al=(...e)=>e.reduce(ML),_l=(e,t,s)=>{const n=t-e;return n===0?1:(s-e)/n};class Yg{constructor(){this.subscriptions=[]}add(t){return Wg(this.subscriptions,t),()=>Qu(this.subscriptions,t)}notify(t,s,n){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,s,n);else for(let l=0;l<o;l++){const c=this.subscriptions[l];c&&c(t,s,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Mi=e=>e*1e3,Wi=e=>e/1e3;function HE(e,t){return t?e*(1e3/t):0}const IE=(e,t,s)=>(((1-3*s+3*t)*e+(3*s-6*t))*e+3*t)*e,DL=1e-7,OL=12;function NL(e,t,s,n,o){let l,c,h=0;do c=t+(s-t)/2,l=IE(c,n,o)-e,l>0?s=c:t=c;while(Math.abs(l)>DL&&++h<OL);return c}function Ml(e,t,s,n){if(e===t&&s===n)return Ki;const o=l=>NL(l,0,1,e,s);return l=>l===0||l===1?l:IE(o(l),t,n)}const VE=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,UE=e=>t=>1-e(1-t),FE=Ml(.33,1.53,.69,.99),qg=UE(FE),WE=VE(qg),KE=e=>(e*=2)<1?.5*qg(e):.5*(2-Math.pow(2,-10*(e-1))),$g=e=>1-Math.sin(Math.acos(e)),YE=UE($g),qE=VE($g),LL=Ml(.42,0,1,1),BL=Ml(0,0,.58,1),$E=Ml(.42,0,.58,1),PL=e=>Array.isArray(e)&&typeof e[0]!="number",GE=e=>Array.isArray(e)&&typeof e[0]=="number",zL={linear:Ki,easeIn:LL,easeInOut:$E,easeOut:BL,circIn:$g,circInOut:qE,circOut:YE,backIn:qg,backInOut:WE,backOut:FE,anticipate:KE},jL=e=>typeof e=="string",CS=e=>{if(GE(e)){Kg(e.length===4);const[t,s,n,o]=e;return Ml(t,s,n,o)}else if(jL(e))return zL[e];return e},cu=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function HL(e,t){let s=new Set,n=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:n;return v&&c.add(p),b.has(p)||b.add(p),p},cancel:p=>{n.delete(p),c.delete(p)},process:p=>{if(h=p,o){l=!0;return}o=!0,[s,n]=[n,s],s.forEach(f),s.clear(),o=!1,l&&(l=!1,d.process(p))}};return d}const IL=40;function XE(e,t){let s=!1,n=!0;const o={delta:0,timestamp:0,isProcessing:!1},l=()=>s=!0,c=cu.reduce((M,k)=>(M[k]=HL(l),M),{}),{setup:h,read:f,resolveKeyframes:d,preUpdate:p,update:v,preRender:_,render:y,postRender:b}=c,S=()=>{const M=Zs.useManualTiming?o.timestamp:performance.now();s=!1,Zs.useManualTiming||(o.delta=n?1e3/60:Math.max(Math.min(M-o.timestamp,IL),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&&(n=!1,e(S))},E=()=>{s=!0,n=!0,o.isProcessing||e(S)};return{schedule:cu.reduce((M,k)=>{const j=c[k];return M[k]=(F,U=!1,H=!1)=>(s||E(),j.schedule(F,U,H)),M},{}),cancel:M=>{for(let k=0;k<cu.length;k++)c[cu[k]].cancel(M)},state:o,steps:c}}const{schedule:tt,cancel:Un,state:qt,steps:vm}=XE(typeof requestAnimationFrame<"u"?requestAnimationFrame:Ki,!0);let Ru;function VL(){Ru=void 0}const si={now:()=>(Ru===void 0&&si.set(qt.isProcessing||Zs.useManualTiming?qt.timestamp:performance.now()),Ru),set:e=>{Ru=e,queueMicrotask(VL)}},ZE=e=>t=>typeof t=="string"&&t.startsWith(e),QE=ZE("--"),UL=ZE("var(--"),Gg=e=>UL(e)?FL.test(e.split("/*")[0].trim()):!1,FL=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function ES(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const $o={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},yl={...$o,transform:e=>Ss(0,1,e)},uu={...$o,default:1},ul=e=>Math.round(e*1e5)/1e5,Xg=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function WL(e){return e==null}const KL=/^(?:#[\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"&&KL.test(s)&&s.startsWith(e)||t&&!WL(s)&&Object.prototype.hasOwnProperty.call(s,t)),JE=(e,t,s)=>n=>{if(typeof n!="string")return n;const[o,l,c,h]=n.match(Xg);return{[e]:parseFloat(o),[t]:parseFloat(l),[s]:parseFloat(c),alpha:h!==void 0?parseFloat(h):1}},YL=e=>Ss(0,255,e),_m={...$o,transform:e=>Math.round(YL(e))},xr={test:Zg("rgb","red"),parse:JE("red","green","blue"),transform:({red:e,green:t,blue:s,alpha:n=1})=>"rgba("+_m.transform(e)+", "+_m.transform(t)+", "+_m.transform(s)+", "+ul(yl.transform(n))+")"};function qL(e){let t="",s="",n="",o="";return e.length>5?(t=e.substring(1,3),s=e.substring(3,5),n=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),s=e.substring(2,3),n=e.substring(3,4),o=e.substring(4,5),t+=t,s+=s,n+=n,o+=o),{red:parseInt(t,16),green:parseInt(s,16),blue:parseInt(n,16),alpha:o?parseInt(o,16)/255:1}}const hp={test:Zg("#"),parse:qL,transform:xr.transform},Dl=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Bn=Dl("deg"),ys=Dl("%"),ye=Dl("px"),$L=Dl("vh"),GL=Dl("vw"),TS={...ys,parse:e=>ys.parse(e)/100,transform:e=>ys.transform(e*100)},Ro={test:Zg("hsl","hue"),parse:JE("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:s,alpha:n=1})=>"hsla("+Math.round(e)+", "+ys.transform(ul(t))+", "+ys.transform(ul(s))+", "+ul(yl.transform(n))+")"},Et={test:e=>xr.test(e)||hp.test(e)||Ro.test(e),parse:e=>xr.test(e)?xr.parse(e):Ro.test(e)?Ro.parse(e):hp.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?xr.transform(e):Ro.transform(e),getAnimatableNone:e=>{const t=Et.parse(e);return t.alpha=0,Et.transform(t)}},XL=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function ZL(e){return isNaN(e)&&typeof e=="string"&&(e.match(Xg)?.length||0)+(e.match(XL)?.length||0)>0}const e2="number",t2="color",QL="var",JL="var(",kS="${}",eB=/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 Uo(e){const t=e.toString(),s=[],n={color:[],number:[],var:[]},o=[];let l=0;const h=t.replace(eB,f=>(Et.test(f)?(n.color.push(l),o.push(t2),s.push(Et.parse(f))):f.startsWith(JL)?(n.var.push(l),o.push(QL),s.push(f)):(n.number.push(l),o.push(e2),s.push(parseFloat(f))),++l,kS)).split(kS);return{values:s,split:h,indexes:n,types:o}}function tB(e){return Uo(e).values}function i2({split:e,types:t}){const s=e.length;return n=>{let o="";for(let l=0;l<s;l++)if(o+=e[l],n[l]!==void 0){const c=t[l];c===e2?o+=ul(n[l]):c===t2?o+=Et.transform(n[l]):o+=n[l]}return o}}function iB(e){return i2(Uo(e))}const sB=e=>typeof e=="number"?0:Et.test(e)?Et.getAnimatableNone(e):e,nB=(e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:sB(e);function rB(e){const t=Uo(e);return i2(t)(t.values.map((n,o)=>nB(n,t.split[o])))}const es={test:ZL,parse:tB,createTransformer:iB,getAnimatableNone:rB};function ym(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 oB({hue:e,saturation:t,lightness:s,alpha:n}){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=ym(f,h,e+1/3),l=ym(f,h,e),c=ym(f,h,e-1/3)}return{red:Math.round(o*255),green:Math.round(l*255),blue:Math.round(c*255),alpha:n}}function Ju(e,t){return s=>s>0?t:e}const ut=(e,t,s)=>e+(t-e)*s,bm=(e,t,s)=>{const n=e*e,o=s*(t*t-n)+n;return o<0?0:Math.sqrt(o)},aB=[hp,xr,Ro],lB=e=>aB.find(t=>t.test(e));function RS(e){const t=lB(e);if(!t)return!1;let s=t.parse(e);return t===Ro&&(s=oB(s)),s}const AS=(e,t)=>{const s=RS(e),n=RS(t);if(!s||!n)return Ju(e,t);const o={...s};return l=>(o.red=bm(s.red,n.red,l),o.green=bm(s.green,n.green,l),o.blue=bm(s.blue,n.blue,l),o.alpha=ut(s.alpha,n.alpha,l),xr.transform(o))},dp=new Set(["none","hidden"]);function cB(e,t){return dp.has(e)?s=>s<=0?e:t:s=>s>=1?t:e}function uB(e,t){return s=>ut(e,t,s)}function Qg(e){return typeof e=="number"?uB:typeof e=="string"?Gg(e)?Ju:Et.test(e)?AS:fB:Array.isArray(e)?s2:typeof e=="object"?Et.test(e)?AS:hB:Ju}function s2(e,t){const s=[...e],n=s.length,o=e.map((l,c)=>Qg(l)(l,t[c]));return l=>{for(let c=0;c<n;c++)s[c]=o[c](l);return s}}function hB(e,t){const s={...e,...t},n={};for(const o in s)e[o]!==void 0&&t[o]!==void 0&&(n[o]=Qg(e[o])(e[o],t[o]));return o=>{for(const l in n)s[l]=n[l](o);return s}}function dB(e,t){const s=[],n={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const l=t.types[o],c=e.indexes[l][n[l]],h=e.values[c]??0;s[o]=h,n[l]++}return s}const fB=(e,t)=>{const s=es.createTransformer(t),n=Uo(e),o=Uo(t);return n.indexes.var.length===o.indexes.var.length&&n.indexes.color.length===o.indexes.color.length&&n.indexes.number.length>=o.indexes.number.length?dp.has(e)&&!o.values.length||dp.has(t)&&!n.values.length?cB(e,t):Al(s2(dB(n,o),o.values),s):Ju(e,t)};function n2(e,t,s){return typeof e=="number"&&typeof t=="number"&&typeof s=="number"?ut(e,t,s):Qg(e)(e,t)}const mB=e=>{const t=({timestamp:s})=>e(s);return{start:(s=!0)=>tt.update(t,s),stop:()=>Un(t),now:()=>qt.isProcessing?qt.timestamp:si.now()}},r2=(e,t,s=10)=>{let n="";const o=Math.max(Math.round(t/s),2);for(let l=0;l<o;l++)n+=Math.round(e(l/(o-1))*1e4)/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},eh=2e4;function Jg(e){let t=0;const s=50;let n=e.next(t);for(;!n.done&&t<eh;)t+=s,n=e.next(t);return t>=eh?1/0:t}function pB(e,t=100,s){const n=s({...e,keyframes:[0,t]}),o=Math.min(Jg(n),eh);return{type:"keyframes",ease:l=>n.next(o*l).value/t,duration:Wi(o)}}const mt={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 fp(e,t){return e*Math.sqrt(1-t*t)}const gB=12;function vB(e,t,s){let n=s;for(let o=1;o<gB;o++)n=n-e(n)/t(n);return n}const Sm=.001;function _B({duration:e=mt.duration,bounce:t=mt.bounce,velocity:s=mt.velocity,mass:n=mt.mass}){let o,l,c=1-t;c=Ss(mt.minDamping,mt.maxDamping,c),e=Ss(mt.minDuration,mt.maxDuration,Wi(e)),c<1?(o=d=>{const p=d*c,v=p*e,_=p-s,y=fp(d,c),b=Math.exp(-v);return Sm-_/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=fp(Math.pow(d,2),c);return(-o(d)+Sm>0?-1:1)*((_-y)*b)/S}):(o=d=>{const p=Math.exp(-d*e),v=(d-s)*e+1;return-Sm+p*v},l=d=>{const p=Math.exp(-d*e),v=(s-d)*(e*e);return p*v});const h=5/e,f=vB(o,l,h);if(e=Mi(e),isNaN(f))return{stiffness:mt.stiffness,damping:mt.damping,duration:e};{const d=Math.pow(f,2)*n;return{stiffness:d,damping:c*2*Math.sqrt(n*d),duration:e}}}const yB=["duration","bounce"],bB=["stiffness","damping","mass"];function MS(e,t){return t.some(s=>e[s]!==void 0)}function SB(e){let t={velocity:mt.velocity,stiffness:mt.stiffness,damping:mt.damping,mass:mt.mass,isResolvedFromDuration:!1,...e};if(!MS(e,bB)&&MS(e,yB))if(t.velocity=0,e.visualDuration){const s=e.visualDuration,n=2*Math.PI/(s*1.2),o=n*n,l=2*Ss(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:mt.mass,stiffness:o,damping:l}}else{const s=_B({...e,velocity:0});t={...t,...s,mass:mt.mass},t.isResolvedFromDuration=!0}return t}function th(e=mt.visualDuration,t=mt.bounce){const s=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:n,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}=SB({...s,velocity:-Wi(s.velocity||0)}),b=_||0,S=d/(2*Math.sqrt(f*p)),E=c-l,R=Wi(Math.sqrt(f/p)),A=Math.abs(E)<5;n||(n=A?mt.restSpeed.granular:mt.restSpeed.default),o||(o=A?mt.restDelta.granular:mt.restDelta.default);let M,k,j,F,U,H;if(S<1)j=fp(R,S),F=(b+S*R*E)/j,M=W=>{const $=Math.exp(-S*R*W);return c-$*(F*Math.sin(j*W)+E*Math.cos(j*W))},U=S*R*F+E*j,H=S*R*E-F*j,k=W=>Math.exp(-S*R*W)*(U*Math.sin(j*W)+H*Math.cos(j*W));else if(S===1){M=$=>c-Math.exp(-R*$)*(E+(b+R*E)*$);const W=b+R*E;k=$=>Math.exp(-R*$)*(R*W*$-b)}else{const W=R*Math.sqrt(S*S-1);M=P=>{const q=Math.exp(-S*R*P),T=Math.min(W*P,300);return c-q*((b+S*R*E)*Math.sinh(T)+W*E*Math.cosh(T))/W};const $=(b+S*R*E)/W,z=S*R*$-E*W,L=S*R*E-$*W;k=P=>{const q=Math.exp(-S*R*P),T=Math.min(W*P,300);return q*(z*Math.sinh(T)+L*Math.cosh(T))}}const J={calculatedDuration:y&&v||null,velocity:W=>Mi(k(W)),next:W=>{if(!y&&S<1){const z=Math.exp(-S*R*W),L=Math.sin(j*W),P=Math.cos(j*W),q=c-z*(F*L+E*P),T=Mi(z*(U*L+H*P));return h.done=Math.abs(T)<=n&&Math.abs(c-q)<=o,h.value=h.done?c:q,h}const $=M(W);if(y)h.done=W>=v;else{const z=Mi(k(W));h.done=Math.abs(z)<=n&&Math.abs(c-$)<=o}return h.value=h.done?c:$,h},toString:()=>{const W=Math.min(Jg(J),eh),$=r2(z=>J.next(W*z).value,W,30);return W+"ms "+$},toTransition:()=>{}};return J}th.applyToOptions=e=>{const t=pB(e,100,th);return e.ease=t.ease,e.duration=Mi(t.duration),e.type="keyframes",e};const wB=5;function o2(e,t,s){const n=Math.max(t-wB,0);return HE(s-e(n),t-n)}function mp({keyframes:e,velocity:t=0,power:s=.8,timeConstant:n=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=H=>h!==void 0&&H<h||f!==void 0&&H>f,b=H=>h===void 0?f:f===void 0||Math.abs(h-H)<Math.abs(f-H)?h:f;let S=s*t;const E=v+S,R=c===void 0?E:c(E);R!==E&&(S=R-v);const A=H=>-S*Math.exp(-H/n),M=H=>R+A(H),k=H=>{const J=A(H),W=M(H);_.done=Math.abs(J)<=d,_.value=_.done?R:W};let j,F;const U=H=>{y(_.value)&&(j=H,F=th({keyframes:[_.value,b(_.value)],velocity:o2(M,H,_.value),damping:o,stiffness:l,restDelta:d,restSpeed:p}))};return U(0),{calculatedDuration:null,next:H=>{let J=!1;return!F&&j===void 0&&(J=!0,k(H),U(H)),j!==void 0&&H>=j?F.next(H-j):(!J&&k(H),_)}}}function xB(e,t,s){const n=[],o=s||Zs.mix||n2,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]||Ki:t;h=Al(f,h)}n.push(h)}return n}function CB(e,t,{clamp:s=!0,ease:n,mixer:o}={}){const l=e.length;if(Kg(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=xB(t,n,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 _=_l(e[v],e[v+1],p);return h[v](_)};return s?p=>d(Ss(e[0],e[l-1],p)):d}function EB(e,t){const s=e[e.length-1];for(let n=1;n<=t;n++){const o=_l(0,t,n);e.push(ut(s,1,o))}}function TB(e){const t=[0];return EB(t,e.length-1),t}function kB(e,t){return e.map(s=>s*t)}function RB(e,t){return e.map(()=>t||$E).splice(0,e.length-1)}function hl({duration:e=300,keyframes:t,times:s,ease:n="easeInOut"}){const o=PL(n)?n.map(CS):CS(n),l={done:!1,value:t[0]},c=kB(s&&s.length===t.length?s:TB(t),e),h=CB(c,t,{ease:Array.isArray(o)?o:RB(t,o)});return{calculatedDuration:e,next:f=>(l.value=h(f),l.done=f>=e,l)}}const AB=e=>e!==null;function ev(e,{repeat:t,repeatType:s="loop"},n,o=1){const l=e.filter(AB),h=o<0||t&&s!=="loop"&&t%2===1?0:l.length-1;return!h||n===void 0?l[h]:n}const MB={decay:mp,inertia:mp,tween:hl,keyframes:hl,spring:th};function a2(e){typeof e.type=="string"&&(e.type=MB[e.type])}class tv{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 DB=e=>e/100;class iv extends tv{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!==si.now()&&this.tick(si.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;a2(t);const{type:s=hl,repeat:n=0,repeatDelay:o=0,repeatType:l,velocity:c=0}=t;let{keyframes:h}=t;const f=s||hl;f!==hl&&typeof h[0]!="number"&&(this.mixKeyframes=Al(DB,n2(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=Jg(d));const{calculatedDuration:p}=d;this.calculatedDuration=p,this.resolvedDuration=p+o,this.totalDuration=this.resolvedDuration*(n+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:n,totalDuration:o,mixKeyframes:l,mirroredGenerator:c,resolvedDuration:h,calculatedDuration:f}=this;if(this.startTime===null)return n.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 R=this.currentTime-d*(this.playbackSpeed>=0?1:-1),A=this.playbackSpeed>=0?R<0:R>o;this.currentTime=Math.max(R,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let M=this.currentTime,k=n;if(v){const H=Math.min(this.currentTime,o)/h;let J=Math.floor(H),W=H%1;!W&&H>=1&&(W=1),W===1&&J--,J=Math.min(J,v+1),J%2&&(_==="reverse"?(W=1-W,y&&(W-=y/h)):_==="mirror"&&(k=c)),M=Ss(0,1,W)*h}const j=A?{done:!1,value:p[0]}:k.next(M);l&&!A&&(j.value=l(j.value));let{done:F}=j;!A&&f!==null&&(F=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const U=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&F);return U&&b!==mp&&(j.value=ev(p,this.options,E,this.speed)),S&&S(j.value),U&&this.finish(),j}then(t,s){return this.finished.then(t,s)}get duration(){return Wi(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Wi(t)}get time(){return Wi(this.currentTime)}set time(t){t=Mi(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 o2(n=>this.generator.next(n).value,t,s)}get speed(){return this.playbackSpeed}set speed(t){const s=this.playbackSpeed!==t;s&&this.driver&&this.updateTime(si.now()),this.playbackSpeed=t,s&&this.driver&&(this.time=Wi(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=mB,startTime:s}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),this.options.onPlay?.();const n=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=n):this.holdTime!==null?this.startTime=n-this.holdTime:this.startTime||(this.startTime=s??n),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(si.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 OB(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Cr=e=>e*180/Math.PI,pp=e=>{const t=Cr(Math.atan2(e[1],e[0]));return gp(t)},NB={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:pp,rotateZ:pp,skewX:e=>Cr(Math.atan(e[1])),skewY:e=>Cr(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},gp=e=>(e=e%360,e<0&&(e+=360),e),DS=pp,OS=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),NS=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),LB={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:OS,scaleY:NS,scale:e=>(OS(e)+NS(e))/2,rotateX:e=>gp(Cr(Math.atan2(e[6],e[5]))),rotateY:e=>gp(Cr(Math.atan2(-e[2],e[0]))),rotateZ:DS,rotate:DS,skewX:e=>Cr(Math.atan(e[4])),skewY:e=>Cr(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function vp(e){return e.includes("scale")?1:0}function _p(e,t){if(!e||e==="none")return vp(t);const s=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,o;if(s)n=LB,o=s;else{const h=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=NB,o=h}if(!o)return vp(t);const l=n[t],c=o[1].split(",").map(PB);return typeof l=="function"?l(c):c[l]}const BB=(e,t)=>{const{transform:s="none"}=getComputedStyle(e);return _p(s,t)};function PB(e){return parseFloat(e.trim())}const Go=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Xo=new Set(Go),LS=e=>e===$o||e===ye,zB=new Set(["x","y","z"]),jB=Go.filter(e=>!zB.has(e));function HB(e){const t=[];return jB.forEach(s=>{const n=e.getValue(s);n!==void 0&&(t.push([s,n.get()]),n.set(s.startsWith("scale")?1:0))}),t}const zn={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})=>_p(t,"x"),y:(e,{transform:t})=>_p(t,"y")};zn.translateX=zn.x;zn.translateY=zn.y;const Tr=new Set;let yp=!1,bp=!1,Sp=!1;function l2(){if(bp){const e=Array.from(Tr).filter(n=>n.needsMeasurement),t=new Set(e.map(n=>n.element)),s=new Map;t.forEach(n=>{const o=HB(n);o.length&&(s.set(n,o),n.render())}),e.forEach(n=>n.measureInitialState()),t.forEach(n=>{n.render();const o=s.get(n);o&&o.forEach(([l,c])=>{n.getValue(l)?.set(c)})}),e.forEach(n=>n.measureEndState()),e.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}bp=!1,yp=!1,Tr.forEach(e=>e.complete(Sp)),Tr.clear()}function c2(){Tr.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(bp=!0)})}function IB(){Sp=!0,c2(),l2(),Sp=!1}class sv{constructor(t,s,n,o,l,c=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=s,this.name=n,this.motionValue=o,this.element=l,this.isAsync=c}scheduleResolve(){this.state="scheduled",this.isAsync?(Tr.add(this),yp||(yp=!0,tt.read(c2),tt.resolveKeyframes(l2))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:s,element:n,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(n&&s){const h=n.readValue(s,c);h!=null&&(t[0]=h)}t[0]===void 0&&(t[0]=c),o&&l===void 0&&o.set(t[0])}OB(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),Tr.delete(this)}cancel(){this.state==="scheduled"&&(Tr.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const VB=e=>e.startsWith("--");function u2(e,t,s){VB(t)?e.style.setProperty(t,s):e.style[t]=s}const UB={};function h2(e,t){const s=jE(e);return()=>UB[t]??s()}const FB=h2(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),d2=h2(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),sl=([e,t,s,n])=>`cubic-bezier(${e}, ${t}, ${s}, ${n})`,BS={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:sl([0,.65,.55,1]),circOut:sl([.55,0,1,.45]),backIn:sl([.31,.01,.66,-.59]),backOut:sl([.33,1.53,.69,.99])};function f2(e,t){if(e)return typeof e=="function"?d2()?r2(e,t):"ease-out":GE(e)?sl(e):Array.isArray(e)?e.map(s=>f2(s,t)||BS.easeOut):BS[e]}function WB(e,t,s,{delay:n=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=f2(h,o);Array.isArray(v)&&(p.easing=v);const _={delay:n,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 m2(e){return typeof e=="function"&&"applyToOptions"in e}function KB({type:e,...t}){return m2(e)&&d2()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class p2 extends tv{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:s,name:n,keyframes:o,pseudoElement:l,allowFlatten:c=!1,finalKeyframe:h,onComplete:f}=t;this.isPseudoElement=!!l,this.allowFlatten=c,this.options=t,Kg(typeof t.type!="string");const d=KB(t);this.animation=WB(s,n,o,d,l),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!l){const p=ev(o,this.options,h,this.speed);this.updateMotionValue&&this.updateMotionValue(p),u2(s,n,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 Wi(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Wi(t)}get time(){return Wi(Number(this.animation.currentTime)||0)}set time(t){const s=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Mi(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:n,observe:o}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&FB()?(this.animation.timeline=t,s&&(this.animation.rangeStart=s),n&&(this.animation.rangeEnd=n),Ki):o(this)}}const g2={anticipate:KE,backInOut:WE,circInOut:qE};function YB(e){return e in g2}function qB(e){typeof e.ease=="string"&&YB(e.ease)&&(e.ease=g2[e.ease])}const wm=10;class $B extends p2{constructor(t){qB(t),a2(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:s,onUpdate:n,onComplete:o,element:l,...c}=this.options;if(!s)return;if(t!==void 0){s.set(t);return}const h=new iv({...c,autoplay:!1}),f=Math.max(wm,si.now()-this.startTime),d=Ss(0,wm,f-wm),p=h.sample(f).value,{name:v}=this.options;l&&v&&u2(l,v,p),s.setWithVelocity(h.sample(Math.max(0,f-d)).value,p,d),h.stop()}}const PS=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(es.test(e)||e==="0")&&!e.startsWith("url("));function GB(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 XB(e,t,s,n){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const l=e[e.length-1],c=PS(o,t),h=PS(l,t);return!c||!h?!1:GB(e)||(s==="spring"||m2(s))&&n}function wp(e){e.duration=0,e.type="keyframes"}const ZB=new Set(["opacity","clipPath","filter","transform"]),QB=jE(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function JB(e){const{motionValue:t,name:s,repeatDelay:n,repeatType:o,damping:l,type:c}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:f,transformTemplate:d}=t.owner.getProps();return QB()&&s&&ZB.has(s)&&(s!=="transform"||!d)&&!f&&!n&&o!=="mirror"&&l!==0&&c!=="inertia"}const e4=40;class t4 extends tv{constructor({autoplay:t=!0,delay:s=0,type:n="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=si.now();const _={autoplay:t,delay:s,type:n,repeat:o,repeatDelay:l,repeatType:c,name:f,motionValue:d,element:p,...v},y=p?.KeyframeResolver||sv;this.keyframeResolver=new y(h,(b,S,E)=>this.onKeyframesResolved(b,S,_,!E),f,d,p),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,s,n,o){this.keyframeResolver=void 0;const{name:l,type:c,velocity:h,delay:f,isHandoff:d,onUpdate:p}=n;this.resolvedAt=si.now(),XB(t,l,c,h)||((Zs.instantAnimations||!f)&&p?.(ev(t,n,s)),t[0]=t[t.length-1],wp(n),n.repeat=0);const _={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>e4?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:s,...n,keyframes:t},y=!d&&JB(_),b=_.motionValue?.owner?.current,S=y?new $B({..._,element:b}):new iv(_);S.finished.then(()=>{this.notifyFinished()}).catch(Ki),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(),IB()),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 v2(e,t,s,n=0,o=1){const l=Array.from(e).sort((d,p)=>d.sortNodePosition(p)).indexOf(t),c=e.size,h=(c-1)*n;return typeof s=="function"?s(l,c):o===1?l*n:h-l*n}const i4=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function s4(e){const t=i4.exec(e);if(!t)return[,];const[,s,n,o]=t;return[`--${s??n}`,o]}function _2(e,t,s=1){const[n,o]=s4(e);if(!n)return;const l=window.getComputedStyle(t).getPropertyValue(n);if(l){const c=l.trim();return BE(c)?parseFloat(c):c}return Gg(o)?_2(o,t,s+1):o}const n4={type:"spring",stiffness:500,damping:25,restSpeed:10},r4=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),o4={type:"keyframes",duration:.8},a4={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},l4=(e,{keyframes:t})=>t.length>2?o4:Xo.has(e)?e.startsWith("scale")?r4(t[1]):n4:a4,c4=e=>e!==null;function u4(e,{repeat:t,repeatType:s="loop"},n){const o=e.filter(c4),l=t&&s!=="loop"&&t%2===1?0:o.length-1;return o[l]}function y2(e,t){if(e?.inherit&&t){const{inherit:s,...n}=e;return{...t,...n}}return e}function nv(e,t){const s=e?.[t]??e?.default??e;return s!==e?y2(s,e):s}function h4({when:e,delay:t,delayChildren:s,staggerChildren:n,staggerDirection:o,repeat:l,repeatType:c,repeatDelay:h,from:f,elapsed:d,...p}){return!!Object.keys(p).length}const rv=(e,t,s,n={},o,l)=>c=>{const h=nv(n,e)||{},f=h.delay||n.delay||0;let{elapsed:d=0}=n;d=d-Mi(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};h4(h)||Object.assign(p,l4(e,p)),p.duration&&(p.duration=Mi(p.duration)),p.repeatDelay&&(p.repeatDelay=Mi(p.repeatDelay)),p.from!==void 0&&(p.keyframes[0]=p.from);let v=!1;if((p.type===!1||p.duration===0&&!p.repeatDelay)&&(wp(p),p.delay===0&&(v=!0)),(Zs.instantAnimations||Zs.skipAnimations||o?.shouldSkipAnimations)&&(v=!0,wp(p),p.delay=0),p.allowFlatten=!h.type&&!h.ease,v&&!l&&t.get()!==void 0){const _=u4(p.keyframes,h);if(_!==void 0){tt.update(()=>{p.onUpdate(_),p.onComplete()});return}}return h.isSync?new iv(p):new t4(p)};function zS(e){const t=[{},{}];return e?.values.forEach((s,n)=>{t[0][n]=s.get(),t[1][n]=s.getVelocity()}),t}function ov(e,t,s,n){if(typeof t=="function"){const[o,l]=zS(n);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]=zS(n);t=t(s!==void 0?s:e.custom,o,l)}return t}function Po(e,t,s){const n=e.getProps();return ov(n,t,s!==void 0?s:n.custom,e)}const b2=new Set(["width","height","top","left","right","bottom",...Go]),jS=30,d4=e=>!isNaN(parseFloat(e));class f4{constructor(t,s={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=n=>{const o=si.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),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=si.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=d4(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 Yg);const n=this.events[t].add(s);return t==="change"?()=>{n(),tt.read(()=>{this.events.change.getSize()||this.stop()})}:n}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,n){this.set(s),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}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=si.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>jS)return 0;const s=Math.min(this.updatedAt-this.prevUpdatedAt,jS);return HE(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 Fo(e,t){return new f4(e,t)}const xp=e=>Array.isArray(e);function m4(e,t,s){e.hasValue(t)?e.getValue(t).set(s):e.addValue(t,Fo(s))}function p4(e){return xp(e)?e[e.length-1]||0:e}function g4(e,t){const s=Po(e,t);let{transitionEnd:n={},transition:o={},...l}=s||{};l={...l,...n};for(const c in l){const h=p4(l[c]);m4(e,c,h)}}const Jt=e=>!!(e&&e.getVelocity);function v4(e){return!!(Jt(e)&&e.add)}function Cp(e,t){const s=e.getValue("willChange");if(v4(s))return s.add(t);if(!s&&Zs.WillChange){const n=new Zs.WillChange("auto");e.addValue("willChange",n),n.add(t)}}function av(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const _4="framerAppearId",S2="data-"+av(_4);function w2(e){return e.props[S2]}function y4({protectedKeys:e,needsAnimating:t},s){const n=e.hasOwnProperty(s)&&t[s]!==!0;return t[s]=!1,n}function x2(e,t,{delay:s=0,transitionOverride:n,type:o}={}){let{transition:l,transitionEnd:c,...h}=t;const f=e.getDefaultTransition();l=l?y2(l,f):f;const d=l?.reduceMotion;n&&(l=n);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&&y4(v,_))continue;const S={delay:s,...nv(l||{},_)},E=y.get();if(E!==void 0&&!y.isAnimating&&!Array.isArray(b)&&b===E&&!S.velocity)continue;let R=!1;if(window.MotionHandoffAnimation){const k=w2(e);if(k){const j=window.MotionHandoffAnimation(k,_,tt);j!==null&&(S.startTime=j,R=!0)}}Cp(e,_);const A=d??e.shouldReduceMotion;y.start(rv(_,y,b,A&&b2.has(_)?{type:!1}:S,e,R));const M=y.animation;M&&p.push(M)}if(c){const _=()=>tt.update(()=>{c&&g4(e,c)});p.length?Promise.all(p).then(_):_()}return p}function Ep(e,t,s={}){const n=Po(e,t,s.type==="exit"?e.presenceContext?.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=n||{};s.transitionOverride&&(o=s.transitionOverride);const l=n?()=>Promise.all(x2(e,n,s)):()=>Promise.resolve(),c=e.variantChildren&&e.variantChildren.size?(f=0)=>{const{delayChildren:d=0,staggerChildren:p,staggerDirection:v}=o;return b4(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 b4(e,t,s=0,n=0,o=0,l=1,c){const h=[];for(const f of e.variantChildren)f.notify("AnimationStart",t),h.push(Ep(f,t,{...c,delay:s+(typeof n=="function"?0:n)+v2(e.variantChildren,f,n,o,l)}).then(()=>f.notify("AnimationComplete",t)));return Promise.all(h)}function S4(e,t,s={}){e.notify("AnimationStart",t);let n;if(Array.isArray(t)){const o=t.map(l=>Ep(e,l,s));n=Promise.all(o)}else if(typeof t=="string")n=Ep(e,t,s);else{const o=typeof t=="function"?Po(e,t,s.custom):t;n=Promise.all(x2(e,o,s))}return n.then(()=>{e.notify("AnimationComplete",t)})}const w4={test:e=>e==="auto",parse:e=>e},C2=e=>t=>t.test(e),E2=[$o,ye,ys,Bn,GL,$L,w4],HS=e=>E2.find(C2(e));function x4(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||zE(e):!0}const C4=new Set(["brightness","contrast","saturate","opacity"]);function E4(e){const[t,s]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[n]=s.match(Xg)||[];if(!n)return e;const o=s.replace(n,"");let l=C4.has(t)?1:0;return n!==s&&(l*=100),t+"("+l+o+")"}const T4=/\b([a-z-]*)\(.*?\)/gu,Tp={...es,getAnimatableNone:e=>{const t=e.match(T4);return t?t.map(E4).join(" "):e}},kp={...es,getAnimatableNone:e=>{const t=es.parse(e);return es.createTransformer(e)(t.map(n=>typeof n=="number"?0:typeof n=="object"?{...n,alpha:1}:n))}},IS={...$o,transform:Math.round},k4={rotate:Bn,rotateX:Bn,rotateY:Bn,rotateZ:Bn,scale:uu,scaleX:uu,scaleY:uu,scaleZ:uu,skew:Bn,skewX:Bn,skewY:Bn,distance:ye,translateX:ye,translateY:ye,translateZ:ye,x:ye,y:ye,z:ye,perspective:ye,transformPerspective:ye,opacity:yl,originX:TS,originY:TS,originZ:ye},lv={borderWidth:ye,borderTopWidth:ye,borderRightWidth:ye,borderBottomWidth:ye,borderLeftWidth:ye,borderRadius:ye,borderTopLeftRadius:ye,borderTopRightRadius:ye,borderBottomRightRadius:ye,borderBottomLeftRadius:ye,width:ye,maxWidth:ye,height:ye,maxHeight:ye,top:ye,right:ye,bottom:ye,left:ye,inset:ye,insetBlock:ye,insetBlockStart:ye,insetBlockEnd:ye,insetInline:ye,insetInlineStart:ye,insetInlineEnd:ye,padding:ye,paddingTop:ye,paddingRight:ye,paddingBottom:ye,paddingLeft:ye,paddingBlock:ye,paddingBlockStart:ye,paddingBlockEnd:ye,paddingInline:ye,paddingInlineStart:ye,paddingInlineEnd:ye,margin:ye,marginTop:ye,marginRight:ye,marginBottom:ye,marginLeft:ye,marginBlock:ye,marginBlockStart:ye,marginBlockEnd:ye,marginInline:ye,marginInlineStart:ye,marginInlineEnd:ye,fontSize:ye,backgroundPositionX:ye,backgroundPositionY:ye,...k4,zIndex:IS,fillOpacity:yl,strokeOpacity:yl,numOctaves:IS},R4={...lv,color:Et,backgroundColor:Et,outlineColor:Et,fill:Et,stroke:Et,borderColor:Et,borderTopColor:Et,borderRightColor:Et,borderBottomColor:Et,borderLeftColor:Et,filter:Tp,WebkitFilter:Tp,mask:kp,WebkitMask:kp},T2=e=>R4[e],A4=new Set([Tp,kp]);function k2(e,t){let s=T2(e);return A4.has(s)||(s=es),s.getAnimatableNone?s.getAnimatableNone(t):void 0}const M4=new Set(["auto","none","0"]);function D4(e,t,s){let n=0,o;for(;n<e.length&&!o;){const l=e[n];typeof l=="string"&&!M4.has(l)&&Uo(l).values.length&&(o=e[n]),n++}if(o&&s)for(const l of t)e[l]=k2(s,o)}class O4 extends sv{constructor(t,s,n,o,l){super(t,s,n,o,l,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:s,name:n}=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(),Gg(v))){const _=_2(v,s.current);_!==void 0&&(t[p]=_),p===t.length-1&&(this.finalKeyframe=v)}}if(this.resolveNoneKeyframes(),!b2.has(n)||t.length!==2)return;const[o,l]=t,c=HS(o),h=HS(l),f=ES(o),d=ES(l);if(f!==d&&zn[n]){this.needsMeasurement=!0;return}if(c!==h)if(LS(c)&&LS(h))for(let p=0;p<t.length;p++){const v=t[p];typeof v=="string"&&(t[p]=parseFloat(v))}else zn[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:s}=this,n=[];for(let o=0;o<t.length;o++)(t[o]===null||x4(t[o]))&&n.push(o);n.length&&D4(t,n,s)}measureInitialState(){const{element:t,unresolvedKeyframes:s,name:n}=this;if(!t||!t.current)return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=zn[n](t.measureViewportBox(),window.getComputedStyle(t.current)),s[0]=this.measuredOrigin;const o=s[s.length-1];o!==void 0&&t.getValue(n,o).jump(o,!1)}measureEndState(){const{element:t,name:s,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const o=t.getValue(s);o&&o.jump(this.measuredOrigin,!1);const l=n.length-1,c=n[l];n[l]=zn[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 N4=new Set(["opacity","clipPath","filter","transform"]);function R2(e,t,s){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let n=document;const o=s?.[e]??n.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e).filter(n=>n!=null)}const A2=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Au(e){return PE(e)&&"offsetHeight"in e}const{schedule:cv}=XE(queueMicrotask,!1),Ji={x:!1,y:!1};function M2(){return Ji.x||Ji.y}function L4(e){return e==="x"||e==="y"?Ji[e]?null:(Ji[e]=!0,()=>{Ji[e]=!1}):Ji.x||Ji.y?null:(Ji.x=Ji.y=!0,()=>{Ji.x=Ji.y=!1})}function D2(e,t){const s=R2(e),n=new AbortController,o={passive:!0,...t,signal:n.signal};return[s,o,()=>n.abort()]}function B4(e){return!(e.pointerType==="touch"||M2())}function P4(e,t,s={}){const[n,o,l]=D2(e,s);return n.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(!B4(E))return;f=!1;const R=t(c,E);typeof R=="function"&&(d=R,c.addEventListener("pointerleave",b,o))};c.addEventListener("pointerenter",S,o),c.addEventListener("pointerdown",y,o)}),l}const O2=(e,t)=>t?e===t?!0:O2(e,t.parentElement):!1,uv=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,z4=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function j4(e){return z4.has(e.tagName)||e.isContentEditable===!0}const H4=new Set(["INPUT","SELECT","TEXTAREA"]);function I4(e){return H4.has(e.tagName)||e.isContentEditable===!0}const Mu=new WeakSet;function VS(e){return t=>{t.key==="Enter"&&e(t)}}function xm(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const V4=(e,t)=>{const s=e.currentTarget;if(!s)return;const n=VS(()=>{if(Mu.has(s))return;xm(s,"down");const o=VS(()=>{xm(s,"up")}),l=()=>xm(s,"cancel");s.addEventListener("keyup",o,t),s.addEventListener("blur",l,t)});s.addEventListener("keydown",n,t),s.addEventListener("blur",()=>s.removeEventListener("keydown",n),t)};function US(e){return uv(e)&&!M2()}const FS=new WeakSet;function U4(e,t,s={}){const[n,o,l]=D2(e,s),c=h=>{const f=h.currentTarget;if(!US(h)||FS.has(h))return;Mu.add(f),s.stopPropagation&&FS.add(h);const d=t(f,h),p=(y,b)=>{window.removeEventListener("pointerup",v),window.removeEventListener("pointercancel",_),Mu.has(f)&&Mu.delete(f),US(y)&&typeof d=="function"&&d(y,{success:b})},v=y=>{p(y,f===window||f===document||s.useGlobalTarget||O2(f,y.target))},_=y=>{p(y,!1)};window.addEventListener("pointerup",v,o),window.addEventListener("pointercancel",_,o)};return n.forEach(h=>{(s.useGlobalTarget?window:h).addEventListener("pointerdown",c,o),Au(h)&&(h.addEventListener("focus",d=>V4(d,o)),!j4(h)&&!h.hasAttribute("tabindex")&&(h.tabIndex=0))}),l}function hv(e){return PE(e)&&"ownerSVGElement"in e}const Du=new WeakMap;let Ou;const N2=(e,t,s)=>(n,o)=>o&&o[0]?o[0][e+"Size"]:hv(n)&&"getBBox"in n?n.getBBox()[t]:n[s],F4=N2("inline","width","offsetWidth"),W4=N2("block","height","offsetHeight");function K4({target:e,borderBoxSize:t}){Du.get(e)?.forEach(s=>{s(e,{get width(){return F4(e,t)},get height(){return W4(e,t)}})})}function Y4(e){e.forEach(K4)}function q4(){typeof ResizeObserver>"u"||(Ou=new ResizeObserver(Y4))}function $4(e,t){Ou||q4();const s=R2(e);return s.forEach(n=>{let o=Du.get(n);o||(o=new Set,Du.set(n,o)),o.add(t),Ou?.observe(n)}),()=>{s.forEach(n=>{const o=Du.get(n);o?.delete(t),o?.size||Ou?.unobserve(n)})}}const Nu=new Set;let Ao;function G4(){Ao=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Nu.forEach(t=>t(e))},window.addEventListener("resize",Ao)}function X4(e){return Nu.add(e),Ao||G4(),()=>{Nu.delete(e),!Nu.size&&typeof Ao=="function"&&(window.removeEventListener("resize",Ao),Ao=void 0)}}function WS(e,t){return typeof e=="function"?X4(e):$4(e,t)}function Z4(e){return hv(e)&&e.tagName==="svg"}const Q4=[...E2,Et,es],J4=e=>Q4.find(C2(e)),KS=()=>({translate:0,scale:1,origin:0,originPoint:0}),Mo=()=>({x:KS(),y:KS()}),YS=()=>({min:0,max:0}),Ot=()=>({x:YS(),y:YS()}),eP=new WeakMap;function Oh(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function bl(e){return typeof e=="string"||Array.isArray(e)}const dv=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],fv=["initial",...dv];function Nh(e){return Oh(e.animate)||fv.some(t=>bl(e[t]))}function L2(e){return!!(Nh(e)||e.variants)}function tP(e,t,s){for(const n in t){const o=t[n],l=s[n];if(Jt(o))e.addValue(n,o);else if(Jt(l))e.addValue(n,Fo(o,{owner:e}));else if(l!==o)if(e.hasValue(n)){const c=e.getValue(n);c.liveStyle===!0?c.jump(o):c.hasAnimated||c.set(o)}else{const c=e.getStaticValue(n);e.addValue(n,Fo(c!==void 0?c:o,{owner:e}))}}for(const n in s)t[n]===void 0&&e.removeValue(n);return t}const Rp={current:null},B2={current:!1},iP=typeof window<"u";function sP(){if(B2.current=!0,!!iP)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Rp.current=e.matches;e.addEventListener("change",t),t()}else Rp.current=!1}const qS=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let ih={};function P2(e){ih=e}function nP(){return ih}class rP{scrapeMotionValuesFromProps(t,s,n){return{}}constructor({parent:t,props:s,presenceContext:n,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=sv,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=si.now();this.renderScheduledAt<y&&(this.renderScheduledAt=y,tt.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=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.skipAnimationsConfig=l,this.options=f,this.blockInitialAnimation=!!c,this.isControllingVariants=Nh(s),this.isVariantNode=L2(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&&Jt(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,eP.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,n)=>this.bindToMotionValue(n,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(B2.current||sP(),this.shouldReduceMotion=Rp.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(),Un(this.notifyUpdate),Un(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&&N4.has(t)&&this.current instanceof HTMLElement){const{factory:c,keyframes:h,times:f,ease:d,duration:p}=s.accelerate,v=new p2({element:this.current,name:t,keyframes:h,times:f,ease:d,duration:Mi(p)}),_=c(v);this.valueSubscriptions.set(t,()=>{_(),v.cancel()});return}const n=Xo.has(t);n&&this.onBindTransform&&this.onBindTransform();const o=s.on("change",c=>{this.latestValues[t]=c,this.props.onUpdate&&tt.preRender(this.notifyUpdate),n&&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 ih){const s=ih[t];if(!s)continue;const{isEnabled:n,Feature:o}=s;if(!this.features[t]&&o&&n(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):Ot()}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 n=0;n<qS.length;n++){const o=qS[n];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=tP(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 n=this.values.get(t);s!==n&&(n&&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 n=this.values.get(t);return n===void 0&&s!==void 0&&(n=Fo(s===null?void 0:s,{owner:this}),this.addValue(t,n)),n}readValue(t,s){let n=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return n!=null&&(typeof n=="string"&&(BE(n)||zE(n))?n=parseFloat(n):!J4(n)&&es.test(s)&&(n=k2(t,s)),this.setBaseTarget(t,Jt(n)?n.get():n)),Jt(n)?n.get():n}setBaseTarget(t,s){this.baseTarget[t]=s}getBaseTarget(t){const{initial:s}=this.props;let n;if(typeof s=="string"||typeof s=="object"){const l=ov(this.props,s,this.presenceContext?.custom);l&&(n=l[t])}if(s&&n!==void 0)return n;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!Jt(o)?o:this.initialValues[t]!==void 0&&n===void 0?void 0:this.baseTarget[t]}on(t,s){return this.events[t]||(this.events[t]=new Yg),this.events[t].add(s)}notify(t,...s){this.events[t]&&this.events[t].notify(...s)}scheduleRenderMicrotask(){cv.render(this.render)}}class z2 extends rP{constructor(){super(...arguments),this.KeyframeResolver=O4}sortInstanceNodePosition(t,s){return t.compareDocumentPosition(s)&2?1:-1}getBaseTargetFromProps(t,s){const n=t.style;return n?n[s]:void 0}removeValueFromRenderState(t,{vars:s,style:n}){delete s[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Jt(t)&&(this.childSubscription=t.on("change",s=>{this.current&&(this.current.textContent=`${s}`)}))}}class Gn{constructor(t){this.isMounted=!1,this.node=t}update(){}}function j2({top:e,left:t,right:s,bottom:n}){return{x:{min:t,max:s},y:{min:e,max:n}}}function oP({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function aP(e,t){if(!t)return e;const s=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:s.y,left:s.x,bottom:n.y,right:n.x}}function Cm(e){return e===void 0||e===1}function Ap({scale:e,scaleX:t,scaleY:s}){return!Cm(e)||!Cm(t)||!Cm(s)}function yr(e){return Ap(e)||H2(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function H2(e){return $S(e.x)||$S(e.y)}function $S(e){return e&&e!=="0%"}function sh(e,t,s){const n=e-s,o=t*n;return s+o}function GS(e,t,s,n,o){return o!==void 0&&(e=sh(e,o,n)),sh(e,s,n)+t}function Mp(e,t=0,s=1,n,o){e.min=GS(e.min,t,s,n,o),e.max=GS(e.max,t,s,n,o)}function I2(e,{x:t,y:s}){Mp(e.x,t.translate,t.scale,t.originPoint),Mp(e.y,s.translate,s.scale,s.originPoint)}const XS=.999999999999,ZS=1.0000000000001;function lP(e,t,s,n=!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"||(n&&l.options.layoutScroll&&l.scroll&&l!==l.root&&Oo(e,{x:-l.scroll.offset.x,y:-l.scroll.offset.y}),c&&(t.x*=c.x.scale,t.y*=c.y.scale,I2(e,c)),n&&yr(l.latestValues)&&Oo(e,l.latestValues,l.layout?.layoutBox))}t.x<ZS&&t.x>XS&&(t.x=1),t.y<ZS&&t.y>XS&&(t.y=1)}function Do(e,t){e.min=e.min+t,e.max=e.max+t}function QS(e,t,s,n,o=.5){const l=ut(e.min,e.max,o);Mp(e,t,s,l,n)}function JS(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Oo(e,t,s){const n=s??e;QS(e.x,JS(t.x,n.x),t.scaleX,t.scale,t.originX),QS(e.y,JS(t.y,n.y),t.scaleY,t.scale,t.originY)}function V2(e,t){return j2(aP(e.getBoundingClientRect(),t))}function cP(e,t,s){const n=V2(e,s),{scroll:o}=t;return o&&(Do(n.x,o.offset.x),Do(n.y,o.offset.y)),n}const uP={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},hP=Go.length;function dP(e,t,s){let n="",o=!0;for(let l=0;l<hP;l++){const c=Go[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=A2(h,lv[c]);if(!f){o=!1;const p=uP[c]||c;n+=`${p}(${d}) `}s&&(t[c]=d)}}return n=n.trim(),s?n=s(t,o?"":n):o&&(n="none"),n}function mv(e,t,s){const{style:n,vars:o,transformOrigin:l}=e;let c=!1,h=!1;for(const f in t){const d=t[f];if(Xo.has(f)){c=!0;continue}else if(QE(f)){o[f]=d;continue}else{const p=A2(d,lv[f]);f.startsWith("origin")?(h=!0,l[f]=p):n[f]=p}}if(t.transform||(c||s?n.transform=dP(t,e.transform,s):n.transform&&(n.transform="none")),h){const{originX:f="50%",originY:d="50%",originZ:p=0}=l;n.transformOrigin=`${f} ${d} ${p}`}}function U2(e,{style:t,vars:s},n,o){const l=e.style;let c;for(c in t)l[c]=t[c];o?.applyProjectionStyles(l,n);for(c in s)l.setProperty(c,s[c])}function ew(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const $a={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ye.test(e))e=parseFloat(e);else return e;const s=ew(e,t.target.x),n=ew(e,t.target.y);return`${s}% ${n}%`}},fP={correct:(e,{treeScale:t,projectionDelta:s})=>{const n=e,o=es.parse(e);if(o.length>5)return n;const l=es.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=ut(h,f,.5);return typeof o[2+c]=="number"&&(o[2+c]/=d),typeof o[3+c]=="number"&&(o[3+c]/=d),l(o)}},Dp={borderRadius:{...$a,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:$a,borderTopRightRadius:$a,borderBottomLeftRadius:$a,borderBottomRightRadius:$a,boxShadow:fP};function F2(e,{layout:t,layoutId:s}){return Xo.has(e)||e.startsWith("origin")||(t||s!==void 0)&&(!!Dp[e]||e==="opacity")}function pv(e,t,s){const n=e.style,o=t?.style,l={};if(!n)return l;for(const c in n)(Jt(n[c])||o&&Jt(o[c])||F2(c,e)||s?.getValue(c)?.liveStyle!==void 0)&&(l[c]=n[c]);return l}function mP(e){return window.getComputedStyle(e)}class pP extends z2{constructor(){super(...arguments),this.type="html",this.renderInstance=U2}readValueFromInstance(t,s){if(Xo.has(s))return this.projection?.isProjecting?vp(s):BB(t,s);{const n=mP(t),o=(QE(s)?n.getPropertyValue(s):n[s])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:s}){return V2(t,s)}build(t,s,n){mv(t,s,n.transformTemplate)}scrapeMotionValuesFromProps(t,s,n){return pv(t,s,n)}}const gP={offset:"stroke-dashoffset",array:"stroke-dasharray"},vP={offset:"strokeDashoffset",array:"strokeDasharray"};function _P(e,t,s=1,n=0,o=!0){e.pathLength=1;const l=o?gP:vP;e[l.offset]=`${-n}`,e[l.array]=`${t} ${s}`}const yP=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function W2(e,{attrX:t,attrY:s,attrScale:n,pathLength:o,pathSpacing:l=1,pathOffset:c=0,...h},f,d,p){if(mv(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 yP)v[y]!==void 0&&(_[y]=v[y],delete v[y]);t!==void 0&&(v.x=t),s!==void 0&&(v.y=s),n!==void 0&&(v.scale=n),o!==void 0&&_P(v,o,l,c,!1)}const K2=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"]),Y2=e=>typeof e=="string"&&e.toLowerCase()==="svg";function bP(e,t,s,n){U2(e,t,void 0,n);for(const o in t.attrs)e.setAttribute(K2.has(o)?o:av(o),t.attrs[o])}function q2(e,t,s){const n=pv(e,t,s);for(const o in e)if(Jt(e[o])||Jt(t[o])){const l=Go.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;n[l]=e[o]}return n}class SP extends z2{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ot}getBaseTargetFromProps(t,s){return t[s]}readValueFromInstance(t,s){if(Xo.has(s)){const n=T2(s);return n&&n.default||0}return s=K2.has(s)?s:av(s),t.getAttribute(s)}scrapeMotionValuesFromProps(t,s,n){return q2(t,s,n)}build(t,s,n){W2(t,s,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,s,n,o){bP(t,s,n,o)}mount(t){this.isSVGTag=Y2(t.tagName),super.mount(t)}}const wP=fv.length;function $2(e){if(!e)return;if(!e.isControllingVariants){const s=e.parent?$2(e.parent)||{}:{};return e.props.initial!==void 0&&(s.initial=e.props.initial),s}const t={};for(let s=0;s<wP;s++){const n=fv[s],o=e.props[n];(bl(o)||o===!1)&&(t[n]=o)}return t}function G2(e,t){if(!Array.isArray(t))return!1;const s=t.length;if(s!==e.length)return!1;for(let n=0;n<s;n++)if(t[n]!==e[n])return!1;return!0}const xP=[...dv].reverse(),CP=dv.length;function EP(e){return t=>Promise.all(t.map(({animation:s,options:n})=>S4(e,s,n)))}function TP(e){let t=EP(e),s=tw(),n=!0,o=!1;const l=d=>(p,v)=>{const _=Po(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=$2(e.parent)||{},_=[],y=new Set;let b={},S=1/0;for(let R=0;R<CP;R++){const A=xP[R],M=s[A],k=p[A]!==void 0?p[A]:v[A],j=bl(k),F=A===d?M.isActive:null;F===!1&&(S=R);let U=k===v[A]&&k!==p[A]&&j;if(U&&(n||o)&&e.manuallyAnimateOnMount&&(U=!1),M.protectedKeys={...b},!M.isActive&&F===null||!k&&!M.prevProp||Oh(k)||typeof k=="boolean")continue;if(A==="exit"&&M.isActive&&F!==!0){M.prevResolvedValues&&(b={...b,...M.prevResolvedValues});continue}const H=kP(M.prevProp,k);let J=H||A===d&&M.isActive&&!U&&j||R>S&&j,W=!1;const $=Array.isArray(k)?k:[k];let z=$.reduce(l(A),{});F===!1&&(z={});const{prevResolvedValues:L={}}=M,P={...L,...z},q=B=>{J=!0,y.has(B)&&(W=!0,y.delete(B)),M.needsAnimating[B]=!0;const ee=e.getValue(B);ee&&(ee.liveStyle=!1)};for(const B in P){const ee=z[B],X=L[B];if(b.hasOwnProperty(B))continue;let N=!1;xp(ee)&&xp(X)?N=!G2(ee,X):N=ee!==X,N?ee!=null?q(B):y.add(B):ee!==void 0&&y.has(B)?q(B):M.protectedKeys[B]=!0}M.prevProp=k,M.prevResolvedValues=z,M.isActive&&(b={...b,...z}),(n||o)&&e.blockInitialAnimation&&(J=!1);const T=U&&H;J&&(!T||W)&&_.push(...$.map(B=>{const ee={type:A};if(typeof B=="string"&&(n||o)&&!T&&e.manuallyAnimateOnMount&&e.parent){const{parent:X}=e,N=Po(X,B);if(X.enteringChildren&&N){const{delayChildren:Z}=N.transition||{};ee.delay=v2(X.enteringChildren,e,Z)}}return{animation:B,options:ee}}))}if(y.size){const R={};if(typeof p.initial!="boolean"){const A=Po(e,Array.isArray(p.initial)?p.initial[0]:p.initial);A&&A.transition&&(R.transition=A.transition)}y.forEach(A=>{const M=e.getBaseTarget(A),k=e.getValue(A);k&&(k.liveStyle=!0),R[A]=M??null}),_.push({animation:R})}let E=!!_.length;return n&&(p.initial===!1||p.initial===p.animate)&&!e.manuallyAnimateOnMount&&(E=!1),n=!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=tw(),o=!0}}}function kP(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!G2(t,e):!1}function vr(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function tw(){return{animate:vr(!0),whileInView:vr(),whileHover:vr(),whileTap:vr(),whileDrag:vr(),whileFocus:vr(),exit:vr()}}function iw(e,t){e.min=t.min,e.max=t.max}function Zi(e,t){iw(e.x,t.x),iw(e.y,t.y)}function sw(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const X2=1e-4,RP=1-X2,AP=1+X2,Z2=.01,MP=0-Z2,DP=0+Z2;function ni(e){return e.max-e.min}function OP(e,t,s){return Math.abs(e-t)<=s}function nw(e,t,s,n=.5){e.origin=n,e.originPoint=ut(t.min,t.max,e.origin),e.scale=ni(s)/ni(t),e.translate=ut(s.min,s.max,e.origin)-e.originPoint,(e.scale>=RP&&e.scale<=AP||isNaN(e.scale))&&(e.scale=1),(e.translate>=MP&&e.translate<=DP||isNaN(e.translate))&&(e.translate=0)}function dl(e,t,s,n){nw(e.x,t.x,s.x,n?n.originX:void 0),nw(e.y,t.y,s.y,n?n.originY:void 0)}function rw(e,t,s){e.min=s.min+t.min,e.max=e.min+ni(t)}function NP(e,t,s){rw(e.x,t.x,s.x),rw(e.y,t.y,s.y)}function ow(e,t,s){e.min=t.min-s.min,e.max=e.min+ni(t)}function nh(e,t,s){ow(e.x,t.x,s.x),ow(e.y,t.y,s.y)}function aw(e,t,s,n,o){return e-=t,e=sh(e,1/s,n),o!==void 0&&(e=sh(e,1/o,n)),e}function LP(e,t=0,s=1,n=.5,o,l=e,c=e){if(ys.test(t)&&(t=parseFloat(t),t=ut(c.min,c.max,t/100)-c.min),typeof t!="number")return;let h=ut(l.min,l.max,n);e===l&&(h-=t),e.min=aw(e.min,t,s,h,o),e.max=aw(e.max,t,s,h,o)}function lw(e,t,[s,n,o],l,c){LP(e,t[s],t[n],t[o],t.scale,l,c)}const BP=["x","scaleX","originX"],PP=["y","scaleY","originY"];function cw(e,t,s,n){lw(e.x,t,BP,s?s.x:void 0,n?n.x:void 0),lw(e.y,t,PP,s?s.y:void 0,n?n.y:void 0)}function uw(e){return e.translate===0&&e.scale===1}function Q2(e){return uw(e.x)&&uw(e.y)}function hw(e,t){return e.min===t.min&&e.max===t.max}function zP(e,t){return hw(e.x,t.x)&&hw(e.y,t.y)}function dw(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function J2(e,t){return dw(e.x,t.x)&&dw(e.y,t.y)}function fw(e){return ni(e.x)/ni(e.y)}function mw(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function ms(e){return[e("x"),e("y")]}function jP(e,t,s){let n="";const o=e.x.translate/t.x,l=e.y.translate/t.y,c=s?.z||0;if((o||l||c)&&(n=`translate3d(${o}px, ${l}px, ${c}px) `),(t.x!==1||t.y!==1)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),s){const{transformPerspective:d,rotate:p,rotateX:v,rotateY:_,skewX:y,skewY:b}=s;d&&(n=`perspective(${d}px) ${n}`),p&&(n+=`rotate(${p}deg) `),v&&(n+=`rotateX(${v}deg) `),_&&(n+=`rotateY(${_}deg) `),y&&(n+=`skewX(${y}deg) `),b&&(n+=`skewY(${b}deg) `)}const h=e.x.scale*t.x,f=e.y.scale*t.y;return(h!==1||f!==1)&&(n+=`scale(${h}, ${f})`),n||"none"}const eT=["TopLeft","TopRight","BottomLeft","BottomRight"],HP=eT.length,pw=e=>typeof e=="string"?parseFloat(e):e,gw=e=>typeof e=="number"||ye.test(e);function IP(e,t,s,n,o,l){o?(e.opacity=ut(0,s.opacity??1,VP(n)),e.opacityExit=ut(t.opacity??1,0,UP(n))):l&&(e.opacity=ut(t.opacity??1,s.opacity??1,n));for(let c=0;c<HP;c++){const h=`border${eT[c]}Radius`;let f=vw(t,h),d=vw(s,h);if(f===void 0&&d===void 0)continue;f||(f=0),d||(d=0),f===0||d===0||gw(f)===gw(d)?(e[h]=Math.max(ut(pw(f),pw(d),n),0),(ys.test(d)||ys.test(f))&&(e[h]+="%")):e[h]=d}(t.rotate||s.rotate)&&(e.rotate=ut(t.rotate||0,s.rotate||0,n))}function vw(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const VP=tT(0,.5,YE),UP=tT(.5,.95,Ki);function tT(e,t,s){return n=>n<e?0:n>t?1:s(_l(e,t,n))}function FP(e,t,s){const n=Jt(e)?e:Fo(e);return n.start(rv("",n,t,s)),n.animation}function Sl(e,t,s,n={passive:!0}){return e.addEventListener(t,s,n),()=>e.removeEventListener(t,s)}const WP=(e,t)=>e.depth-t.depth;class KP{constructor(){this.children=[],this.isDirty=!1}add(t){Wg(this.children,t),this.isDirty=!0}remove(t){Qu(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(WP),this.isDirty=!1,this.children.forEach(t)}}function YP(e,t){const s=si.now(),n=({timestamp:o})=>{const l=o-s;l>=t&&(Un(n),e(l-t))};return tt.setup(n,!0),()=>Un(n)}function Lu(e){return Jt(e)?e.get():e}class qP{constructor(){this.members=[]}add(t){Wg(this.members,t);for(let s=this.members.length-1;s>=0;s--){const n=this.members[s];if(n===t||n===this.lead||n===this.prevLead)continue;const o=n.instance;(!o||o.isConnected===!1)&&!n.snapshot&&(Qu(this.members,n),n.unmount())}t.scheduleRender()}remove(t){if(Qu(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 n=this.members[s];if(n.isPresent!==!1&&n.instance?.isConnected!==!1)return this.promote(n),!0}return!1}promote(t,s){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.updateSnapshot(),t.scheduleRender();const{layoutDependency:o}=n.options,{layoutDependency:l}=t.options;(o===void 0||o!==l)&&(t.resumeFrom=n,s&&(n.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&n.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 Bu={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Em=["","X","Y","Z"],$P=1e3;let GP=0;function Tm(e,t,s,n){const{latestValues:o}=t;o[e]&&(s[e]=o[e],t.setStaticValue(e,0),n&&(n[e]=0))}function iT(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const s=w2(t);if(window.MotionHasOptimisedAnimation(s,"transform")){const{layout:o,layoutId:l}=e.options;window.MotionCancelOptimisedAnimation(s,"transform",tt,!(o||l))}const{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&iT(n)}function sT({attachResizeListener:e,defaultParent:t,measureScroll:s,checkIsScrollRoot:n,resetTransform:o}){return class{constructor(c={},h=t?.()){this.id=GP++,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(QP),this.nodes.forEach(i6),this.nodes.forEach(s6),this.nodes.forEach(JP)},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 KP)}addEventListener(c,h){return this.eventHandlers.has(c)||this.eventHandlers.set(c,new Yg),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=hv(c)&&!Z4(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;tt.read(()=>{v=window.innerWidth}),e(c,()=>{const y=window.innerWidth;y!==v&&(v=y,this.root.updateBlockedByResize=!0,p&&p(),p=YP(_,250),Bu.hasAnimatedSinceResize&&(Bu.hasAnimatedSinceResize=!1,this.nodes.forEach(bw)))})}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()||l6,{onLayoutAnimationStart:S,onLayoutAnimationComplete:E}=d.getProps(),R=!this.targetLayout||!J2(this.targetLayout,y),A=!v&&_;if(this.options.layoutRoot||this.resumeFrom||A||v&&(R||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const M={...nv(b,"layout"),onPlay:S,onComplete:E};(d.shouldReduceMotion||this.options.layoutRoot)&&(M.delay=0,M.type=!1),this.startAnimation(M),this.setAnimationOrigin(p,A)}else v||bw(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(),Un(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(n6),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&&iT(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(_w);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(yw);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(t6),this.nodes.forEach(XP),this.nodes.forEach(ZP)):this.nodes.forEach(yw),this.clearAllSnapshots();const h=si.now();qt.delta=Ss(0,1e3/60,h-qt.timestamp),qt.timestamp=h,qt.isProcessing=!0,vm.update.process(qt),vm.preRender.process(qt),vm.render.process(qt),qt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,cv.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(e6),this.sharedNodes.forEach(r6)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,tt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){tt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!ni(this.snapshot.measuredBox.x)&&!ni(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=Ot(),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=n(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&&!Q2(this.projectionDelta),f=this.getTransformTemplate(),d=f?f(this.latestValues,""):void 0,p=d!==this.prevTransformTemplateValue;c&&this.instance&&(h||yr(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)),c6(f),{animationId:this.root.animationId,measuredBox:h,layoutBox:f,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:c}=this.options;if(!c)return Ot();const h=c.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(u6))){const{scroll:d}=this.root;d&&(Do(h.x,d.offset.x),Do(h.y,d.offset.y))}return h}removeElementScroll(c){const h=Ot();if(Zi(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&&Zi(h,c),Do(h.x,p.offset.x),Do(h.y,p.offset.y))}return h}applyTransform(c,h=!1){const f=Ot();Zi(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&&Oo(f,{x:-p.scroll.offset.x,y:-p.scroll.offset.y}),yr(p.latestValues)&&Oo(f,p.latestValues,p.layout?.layoutBox)}return yr(this.latestValues)&&Oo(f,this.latestValues,this.layout?.layoutBox),f}removeTransform(c){const h=Ot();Zi(h,c);for(let f=0;f<this.path.length;f++){const d=this.path[f];if(!yr(d.latestValues))continue;let p;d.instance&&(Ap(d.latestValues)&&d.updateSnapshot(),p=Ot(),Zi(p,d.measurePageBox())),cw(h,d.latestValues,d.snapshot?.layoutBox,p)}return yr(this.latestValues)&&cw(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!==qt.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=qt.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=Ot(),this.targetWithTransforms=Ot()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),NP(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Zi(this.target,this.layout.layoutBox),I2(this.target,this.targetDelta)):Zi(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||Ap(this.parent.latestValues)||H2(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=Ot(),this.relativeTargetOrigin=Ot(),nh(this.relativeTargetOrigin,h,f),Zi(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===qt.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;Zi(this.layoutCorrected,this.layout.layoutBox);const v=this.treeScale.x,_=this.treeScale.y;lP(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=Ot());const{target:y}=c;if(!y){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(sw(this.prevProjectionDelta.x,this.projectionDelta.x),sw(this.prevProjectionDelta.y,this.projectionDelta.y)),dl(this.projectionDelta,this.layoutCorrected,y,this.latestValues),(this.treeScale.x!==v||this.treeScale.y!==_||!mw(this.projectionDelta.x,this.prevProjectionDelta.x)||!mw(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=Mo(),this.projectionDelta=Mo(),this.projectionDeltaWithTransform=Mo()}setAnimationOrigin(c,h=!1){const f=this.snapshot,d=f?f.latestValues:{},p={...this.latestValues},v=Mo();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!h;const _=Ot(),y=f?f.source:void 0,b=this.layout?this.layout.source:void 0,S=y!==b,E=this.getStack(),R=!E||E.members.length<=1,A=!!(S&&!R&&this.options.crossfade===!0&&!this.path.some(a6));this.animationProgress=0;let M;this.mixTargetDelta=k=>{const j=k/1e3;Sw(v.x,c.x,j),Sw(v.y,c.y,j),this.setTargetDelta(v),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(nh(_,this.layout.layoutBox,this.relativeParent.layout.layoutBox),o6(this.relativeTarget,this.relativeTargetOrigin,_,j),M&&zP(this.relativeTarget,M)&&(this.isProjectionDirty=!1),M||(M=Ot()),Zi(M,this.relativeTarget)),S&&(this.animationValues=p,IP(p,d,this.latestValues,j,A,R)),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&&(Un(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=tt.update(()=>{Bu.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Fo(0)),this.motionValue.jump(0,!1),this.currentAnimation=FP(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($P),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&&nT(this.options.animationType,this.layout.layoutBox,d.layoutBox)){f=this.target||Ot();const v=ni(this.layout.layoutBox.x);f.x.min=c.target.x.min,f.x.max=f.x.min+v;const _=ni(this.layout.layoutBox.y);f.y.min=c.target.y.min,f.y.max=f.y.min+_}Zi(h,f),Oo(h,p),dl(this.projectionDeltaWithTransform,this.layoutCorrected,h,p)}}registerSharedNode(c,h){this.sharedNodes.has(c)||this.sharedNodes.set(c,new qP),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&&Tm("z",c,d,this.animationValues);for(let p=0;p<Em.length;p++)Tm(`rotate${Em[p]}`,c,d,this.animationValues),Tm(`skew${Em[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=Lu(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=Lu(h?.pointerEvents)||""),this.hasProjected&&!yr(this.latestValues)&&(c.transform=f?f({},""):"none",this.hasProjected=!1);return}c.visibility="";const p=d.animationValues||d.latestValues;this.applyTransformsToTarget();let v=jP(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 Dp){if(p[b]===void 0)continue;const{correct:S,applyTo:E,isCSSVariable:R}=Dp[b],A=v==="none"?p[b]:S(p[b],d);if(E){const M=E.length;for(let k=0;k<M;k++)c[E[k]]=A}else R?this.options.visualElement.renderState.vars[b]=A:c[b]=A}this.options.layoutId&&(c.pointerEvents=d===this?Lu(h?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(c=>c.currentAnimation?.stop()),this.root.nodes.forEach(_w),this.root.sharedNodes.clear()}}}function XP(e){e.updateLayout()}function ZP(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:n}=e.layout,{animationType:o}=e.options,l=t.source!==e.layout.source;o==="size"?ms(p=>{const v=l?t.measuredBox[p]:t.layoutBox[p],_=ni(v);v.min=s[p].min,v.max=v.min+_}):nT(o,t.layoutBox,s)&&ms(p=>{const v=l?t.measuredBox[p]:t.layoutBox[p],_=ni(s[p]);v.max=v.min+_,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[p].max=e.relativeTarget[p].min+_)});const c=Mo();dl(c,s,t.layoutBox);const h=Mo();l?dl(h,e.applyTransform(n,!0),t.measuredBox):dl(h,s,t.layoutBox);const f=!Q2(c);let d=!1;if(!e.resumeFrom){const p=e.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:v,layout:_}=p;if(v&&_){const y=Ot();nh(y,t.layoutBox,v.layoutBox);const b=Ot();nh(b,s,_.layoutBox),J2(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 QP(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 JP(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function e6(e){e.clearSnapshot()}function _w(e){e.clearMeasurements()}function yw(e){e.isLayoutDirty=!1}function t6(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function bw(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function i6(e){e.resolveTargetDelta()}function s6(e){e.calcProjection()}function n6(e){e.resetSkewAndRotation()}function r6(e){e.removeLeadSnapshot()}function Sw(e,t,s){e.translate=ut(t.translate,0,s),e.scale=ut(t.scale,1,s),e.origin=t.origin,e.originPoint=t.originPoint}function ww(e,t,s,n){e.min=ut(t.min,s.min,n),e.max=ut(t.max,s.max,n)}function o6(e,t,s,n){ww(e.x,t.x,s.x,n),ww(e.y,t.y,s.y,n)}function a6(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const l6={duration:.45,ease:[.4,0,.1,1]},xw=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Cw=xw("applewebkit/")&&!xw("chrome/")?Math.round:Ki;function Ew(e){e.min=Cw(e.min),e.max=Cw(e.max)}function c6(e){Ew(e.x),Ew(e.y)}function nT(e,t,s){return e==="position"||e==="preserve-aspect"&&!OP(fw(t),fw(s),.2)}function u6(e){return e!==e.root&&e.scroll?.wasRoot}const h6=sT({attachResizeListener:(e,t)=>Sl(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),km={current:void 0},rT=sT({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!km.current){const e=new h6({});e.mount(window),e.setOptions({layoutScroll:!0}),km.current=e}return km.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),gv=x.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Tw(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function d6(...e){return t=>{let s=!1;const n=e.map(o=>{const l=Tw(o,t);return!s&&typeof l=="function"&&(s=!0),l});if(s)return()=>{for(let o=0;o<n.length;o++){const l=n[o];typeof l=="function"?l():Tw(e[o],null)}}}}function f6(...e){return x.useCallback(d6(...e),e)}class m6 extends x.Component{getSnapshotBeforeUpdate(t){const s=this.props.childRef.current;if(Au(s)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const n=s.offsetParent,o=Au(n)&&n.offsetWidth||0,l=Au(n)&&n.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 p6({children:e,isPresent:t,anchorX:s,anchorY:n,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(gv),p=e.props?.ref??e?.ref,v=f6(h,p);return x.useInsertionEffect(()=>{const{width:_,height:y,top:b,left:S,right:E,bottom:R}=f.current;if(t||l===!1||!h.current||!_||!y)return;const A=s==="left"?`left: ${S}`:`right: ${E}`,M=n==="bottom"?`bottom: ${R}`:`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(`
|
|
55
|
+
[data-motion-pop-id="${c}"] {
|
|
56
|
+
position: absolute !important;
|
|
57
|
+
width: ${_}px !important;
|
|
58
|
+
height: ${y}px !important;
|
|
59
|
+
${A}px !important;
|
|
60
|
+
${M}px !important;
|
|
61
|
+
}
|
|
62
|
+
`),()=>{j.contains(k)&&j.removeChild(k)}},[t]),w.jsx(m6,{isPresent:t,childRef:h,sizeRef:f,pop:l,children:l===!1?e:x.cloneElement(e,{ref:v})})}const g6=({children:e,initial:t,isPresent:s,onExitComplete:n,custom:o,presenceAffectsLayout:l,mode:c,anchorX:h,anchorY:f,root:d})=>{const p=Fg(v6),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;n&&n()},register:b=>(p.set(b,!1),()=>p.delete(b))}),[s,p,n]);return l&&_&&(y={...y}),x.useMemo(()=>{p.forEach((b,S)=>p.set(S,!1))},[s]),x.useEffect(()=>{!s&&!p.size&&n&&n()},[s]),e=w.jsx(p6,{pop:c==="popLayout",isPresent:s,anchorX:h,anchorY:f,root:d,children:e}),w.jsx(Dh.Provider,{value:y,children:e})};function v6(){return new Map}function oT(e=!0){const t=x.useContext(Dh);if(t===null)return[!0,null];const{isPresent:s,onExitComplete:n,register:o}=t,l=x.useId();x.useEffect(()=>{if(e)return o(l)},[e]);const c=x.useCallback(()=>e&&n&&n(l),[l,n,e]);return!s&&n?[!1,c]:[!0]}const hu=e=>e.key||"";function kw(e){const t=[];return x.Children.forEach(e,s=>{x.isValidElement(s)&&t.push(s)}),t}const _6=({children:e,custom:t,initial:s=!0,onExitComplete:n,presenceAffectsLayout:o=!0,mode:l="sync",propagate:c=!1,anchorX:h="left",anchorY:f="top",root:d})=>{const[p,v]=oT(c),_=x.useMemo(()=>kw(e),[e]),y=c&&!p?[]:_.map(hu),b=x.useRef(!0),S=x.useRef(_),E=Fg(()=>new Map),R=x.useRef(new Set),[A,M]=x.useState(_),[k,j]=x.useState(_);LE(()=>{b.current=!1,S.current=_;for(let H=0;H<k.length;H++){const J=hu(k[H]);y.includes(J)?(E.delete(J),R.current.delete(J)):E.get(J)!==!0&&E.set(J,!1)}},[k,y.length,y.join("-")]);const F=[];if(_!==A){let H=[..._];for(let J=0;J<k.length;J++){const W=k[J],$=hu(W);y.includes($)||(H.splice(J,0,W),F.push(W))}return l==="wait"&&F.length&&(H=F),j(kw(H)),M(_),null}const{forceRender:U}=x.useContext(Ug);return w.jsx(w.Fragment,{children:k.map(H=>{const J=hu(H),W=c&&!p?!1:_===k||y.includes(J),$=()=>{if(R.current.has(J))return;if(R.current.add(J),E.has(J))E.set(J,!0);else return;let z=!0;E.forEach(L=>{L||(z=!1)}),z&&(U?.(),j(S.current),c&&v?.(),n&&n())};return w.jsx(g6,{isPresent:W,initial:!b.current||s?void 0:!1,custom:t,presenceAffectsLayout:o,mode:l,root:d,onExitComplete:W?void 0:$,anchorX:h,anchorY:f,children:H},J)})})},aT=x.createContext({strict:!1}),Rw={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 Aw=!1;function y6(){if(Aw)return;const e={};for(const t in Rw)e[t]={isEnabled:s=>Rw[t].some(n=>!!s[n])};P2(e),Aw=!0}function lT(){return y6(),nP()}function b6(e){const t=lT();for(const s in e)t[s]={...t[s],...e[s]};P2(t)}const S6=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 rh(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||S6.has(e)}let cT=e=>!rh(e);function w6(e){typeof e=="function"&&(cT=t=>t.startsWith("on")?!rh(t):e(t))}try{w6(require("@emotion/is-prop-valid").default)}catch{}function x6(e,t,s){const n={};for(const o in e)o==="values"&&typeof e.values=="object"||(cT(o)||s===!0&&rh(o)||!t&&!rh(o)||e.draggable&&o.startsWith("onDrag"))&&(n[o]=e[o]);return n}const Lh=x.createContext({});function C6(e,t){if(Nh(e)){const{initial:s,animate:n}=e;return{initial:s===!1||bl(s)?s:void 0,animate:bl(n)?n:void 0}}return e.inherit!==!1?t:{}}function E6(e){const{initial:t,animate:s}=C6(e,x.useContext(Lh));return x.useMemo(()=>({initial:t,animate:s}),[Mw(t),Mw(s)])}function Mw(e){return Array.isArray(e)?e.join(" "):e}const vv=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function uT(e,t,s){for(const n in t)!Jt(t[n])&&!F2(n,s)&&(e[n]=t[n])}function T6({transformTemplate:e},t){return x.useMemo(()=>{const s=vv();return mv(s,t,e),Object.assign({},s.vars,s.style)},[t])}function k6(e,t){const s=e.style||{},n={};return uT(n,s,e),Object.assign(n,T6(e,t)),n}function R6(e,t){const s={},n=k6(e,t);return e.drag&&e.dragListener!==!1&&(s.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.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=n,s}const hT=()=>({...vv(),attrs:{}});function A6(e,t,s,n){const o=x.useMemo(()=>{const l=hT();return W2(l,t,Y2(n),e.transformTemplate,e.style),{...l.attrs,style:{...l.style}}},[t]);if(e.style){const l={};uT(l,e.style,e),o.style={...l,...o.style}}return o}const M6=["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 _v(e){return typeof e!="string"||e.includes("-")?!1:!!(M6.indexOf(e)>-1||/[A-Z]/u.test(e))}function D6(e,t,s,{latestValues:n},o,l=!1,c){const f=(c??_v(e)?A6:R6)(t,n,o,e),d=x6(t,typeof e=="string",l),p=e!==x.Fragment?{...d,...f,ref:s}:{},{children:v}=t,_=x.useMemo(()=>Jt(v)?v.get():v,[v]);return x.createElement(e,{...p,children:_})}function O6({scrapeMotionValuesFromProps:e,createRenderState:t},s,n,o){return{latestValues:N6(s,n,o,e),renderState:t()}}function N6(e,t,s,n){const o={},l=n(e,{});for(const _ in l)o[_]=Lu(l[_]);let{initial:c,animate:h}=e;const f=Nh(e),d=L2(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"&&!Oh(v)){const _=Array.isArray(v)?v:[v];for(let y=0;y<_.length;y++){const b=ov(e,_[y]);if(b){const{transitionEnd:S,transition:E,...R}=b;for(const A in R){let M=R[A];if(Array.isArray(M)){const k=p?M.length-1:0;M=M[k]}M!==null&&(o[A]=M)}for(const A in S)o[A]=S[A]}}}return o}const dT=e=>(t,s)=>{const n=x.useContext(Lh),o=x.useContext(Dh),l=()=>O6(e,t,n,o);return s?l():Fg(l)},L6=dT({scrapeMotionValuesFromProps:pv,createRenderState:vv}),B6=dT({scrapeMotionValuesFromProps:q2,createRenderState:hT}),P6=Symbol.for("motionComponentSymbol");function z6(e,t,s){const n=x.useRef(s);x.useInsertionEffect(()=>{n.current=s});const o=x.useRef(null);return x.useCallback(l=>{l&&e.onMount?.(l);const c=n.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 fT=x.createContext({});function To(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function j6(e,t,s,n,o,l){const{visualElement:c}=x.useContext(Lh),h=x.useContext(aT),f=x.useContext(Dh),d=x.useContext(gv),p=d.reducedMotion,v=d.skipAnimations,_=x.useRef(null),y=x.useRef(!1);n=n||h.renderer,!_.current&&n&&(_.current=n(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(fT);b&&!b.projection&&o&&(b.type==="html"||b.type==="svg")&&H6(_.current,s,o,S);const E=x.useRef(!1);x.useInsertionEffect(()=>{b&&E.current&&b.update(s,f)});const R=s[S2],A=x.useRef(!!R&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(R)&&window.MotionHasOptimisedAnimation?.(R));return LE(()=>{y.current=!0,b&&(E.current=!0,window.MotionIsMounted=!0,b.updateFeatures(),b.scheduleRenderMicrotask(),A.current&&b.animationState&&b.animationState.animateChanges())}),x.useEffect(()=>{b&&(!A.current&&b.animationState&&b.animationState.animateChanges(),A.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(R)}),A.current=!1),b.enteringChildren=void 0)}),b}function H6(e,t,s,n){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:mT(e.parent)),e.projection.setOptions({layoutId:o,layout:l,alwaysMeasureLayout:!!c||h&&To(h),visualElement:e,animationType:typeof l=="string"?l:"both",initialPromotionConfig:n,crossfade:p,layoutScroll:f,layoutRoot:d})}function mT(e){if(e)return e.options.allowProjection!==!1?e.projection:mT(e.parent)}function Rm(e,{forwardMotionProps:t=!1,type:s}={},n,o){n&&b6(n);const l=s?s==="svg":_v(e),c=l?B6:L6;function h(d,p){let v;const _={...x.useContext(gv),...d,layoutId:I6(d)},{isStatic:y}=_,b=E6(d),S=c(d,y);if(!y&&typeof window<"u"){V6();const E=U6(_);v=E.MeasureLayout,b.visualElement=j6(e,S,_,o,E.ProjectionNode,l)}return w.jsxs(Lh.Provider,{value:b,children:[v&&b.visualElement?w.jsx(v,{visualElement:b.visualElement,..._}):null,D6(e,d,z6(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[P6]=e,f}function I6({layoutId:e}){const t=x.useContext(Ug).id;return t&&e!==void 0?t+"-"+e:e}function V6(e,t){x.useContext(aT).strict}function U6(e){const t=lT(),{drag:s,layout:n}=t;if(!s&&!n)return{};const o={...s,...n};return{MeasureLayout:s?.isEnabled(e)||n?.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function F6(e,t){if(typeof Proxy>"u")return Rm;const s=new Map,n=(l,c)=>Rm(l,c,e,t),o=(l,c)=>n(l,c);return new Proxy(o,{get:(l,c)=>c==="create"?n:(s.has(c)||s.set(c,Rm(c,void 0,e,t)),s.get(c))})}const W6=(e,t)=>t.isSVG??_v(e)?new SP(t):new pP(t,{allowProjection:e!==x.Fragment});class K6 extends Gn{constructor(t){super(t),t.animationState||(t.animationState=TP(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Oh(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 Y6=0;class q6 extends Gn{constructor(){super(...arguments),this.id=Y6++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:s}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)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 $6={animation:{Feature:K6},exit:{Feature:q6}};function Ol(e){return{point:{x:e.pageX,y:e.pageY}}}const G6=e=>t=>uv(t)&&e(t,Ol(t));function fl(e,t,s,n){return Sl(e,t,G6(s),n)}const pT=({current:e})=>e?e.ownerDocument.defaultView:null,Dw=(e,t)=>Math.abs(e-t);function X6(e,t){const s=Dw(e.x,t.x),n=Dw(e.y,t.y);return Math.sqrt(s**2+n**2)}const Ow=new Set(["auto","scroll"]);class gT{constructor(t,s,{transformPagePoint:n,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=du(this.lastRawMoveEventInfo,this.transformPagePoint));const y=Am(this.lastMoveEventInfo,this.history),b=this.startEvent!==null,S=X6(y.offset,{x:0,y:0})>=this.distanceThreshold;if(!b&&!S)return;const{point:E}=y,{timestamp:R}=qt;this.history.push({...E,timestamp:R});const{onStart:A,onMove:M}=this.handlers;b||(A&&A(this.lastMoveEvent,y),this.startEvent=this.lastMoveEvent),M&&M(this.lastMoveEvent,y)},this.handlePointerMove=(y,b)=>{this.lastMoveEvent=y,this.lastRawMoveEventInfo=b,this.lastMoveEventInfo=du(b,this.transformPagePoint),tt.update(this.updatePoint,!0)},this.handlePointerUp=(y,b)=>{this.end();const{onEnd:S,onSessionEnd:E,resumeAnimation:R}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&R&&R(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const A=Am(y.type==="pointercancel"?this.lastMoveEventInfo:du(b,this.transformPagePoint),this.history);this.startEvent&&S&&S(y,A),E&&E(y,A)},!uv(t))return;this.dragSnapToOrigin=l,this.handlers=s,this.transformPagePoint=n,this.distanceThreshold=c,this.contextWindow=o||window;const f=Ol(t),d=du(f,this.transformPagePoint),{point:p}=d,{timestamp:v}=qt;this.history=[{...p,timestamp:v}];const{onSessionStart:_}=s;_&&_(t,Am(d,this.history)),this.removeListeners=Al(fl(this.contextWindow,"pointermove",this.handlePointerMove),fl(this.contextWindow,"pointerup",this.handlePointerUp),fl(this.contextWindow,"pointercancel",this.handlePointerUp)),h&&this.startScrollTracking(h)}startScrollTracking(t){let s=t.parentElement;for(;s;){const n=getComputedStyle(s);(Ow.has(n.overflowX)||Ow.has(n.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 n=t===window,o=n?{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||(n?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),tt.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Un(this.updatePoint)}}function du(e,t){return t?{point:t(e.point)}:e}function Nw(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Am({point:e},t){return{point:e,delta:Nw(e,vT(t)),offset:Nw(e,Z6(t)),velocity:Q6(t,.1)}}function Z6(e){return e[0]}function vT(e){return e[e.length-1]}function Q6(e,t){if(e.length<2)return{x:0,y:0};let s=e.length-1,n=null;const o=vT(e);for(;s>=0&&(n=e[s],!(o.timestamp-n.timestamp>Mi(t)));)s--;if(!n)return{x:0,y:0};n===e[0]&&e.length>2&&o.timestamp-n.timestamp>Mi(t)*2&&(n=e[1]);const l=Wi(o.timestamp-n.timestamp);if(l===0)return{x:0,y:0};const c={x:(o.x-n.x)/l,y:(o.y-n.y)/l};return c.x===1/0&&(c.x=0),c.y===1/0&&(c.y=0),c}function J6(e,{min:t,max:s},n){return t!==void 0&&e<t?e=n?ut(t,e,n.min):Math.max(e,t):s!==void 0&&e>s&&(e=n?ut(s,e,n.max):Math.min(e,s)),e}function Lw(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 ez(e,{top:t,left:s,bottom:n,right:o}){return{x:Lw(e.x,s,o),y:Lw(e.y,t,n)}}function Bw(e,t){let s=t.min-e.min,n=t.max-e.max;return t.max-t.min<e.max-e.min&&([s,n]=[n,s]),{min:s,max:n}}function tz(e,t){return{x:Bw(e.x,t.x),y:Bw(e.y,t.y)}}function iz(e,t){let s=.5;const n=ni(e),o=ni(t);return o>n?s=_l(t.min,t.max-n,e.min):n>o&&(s=_l(e.min,e.max-o,t.min)),Ss(0,1,s)}function sz(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 Op=.35;function nz(e=Op){return e===!1?e=0:e===!0&&(e=Op),{x:Pw(e,"left","right"),y:Pw(e,"top","bottom")}}function Pw(e,t,s){return{min:zw(e,t),max:zw(e,s)}}function zw(e,t){return typeof e=="number"?e:e[t]||0}const rz=new WeakMap;class oz{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=Ot(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:s=!1,distanceThreshold:n}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const l=v=>{s&&this.snapToCursor(Ol(v).point),this.stopAnimation()},c=(v,_)=>{const{drag:y,dragPropagation:b,onDragStart:S}=this.getProps();if(y&&!b&&(this.openDragLock&&this.openDragLock(),this.openDragLock=L4(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),ms(R=>{let A=this.getAxisMotionValue(R).get()||0;if(ys.test(A)){const{projection:M}=this.visualElement;if(M&&M.layout){const k=M.layout.layoutBox[R];k&&(A=ni(k)*(parseFloat(A)/100))}}this.originPoint[R]=A}),S&&tt.update(()=>S(v,_),!1,!0),Cp(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:R}=_;if(b&&this.currentDirection===null){this.currentDirection=lz(R),this.currentDirection!==null&&S&&S(this.currentDirection);return}this.updateAxis("x",_.point,R),this.updateAxis("y",_.point,R),this.visualElement.render(),E&&tt.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 gT(t,{onSessionStart:l,onStart:c,onMove:h,onSessionEnd:f,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:p,distanceThreshold:n,contextWindow:pT(this.visualElement),element:this.visualElement.current})}stop(t,s){const n=t||this.latestPointerEvent,o=s||this.latestPanInfo,l=this.isDragging;if(this.cancel(),!l||!o||!n)return;const{velocity:c}=o;this.startAnimation(c);const{onDragEnd:h}=this.getProps();h&&tt.postRender(()=>h(n,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:s}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:n}=this.getProps();!n&&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,n){const{drag:o}=this.getProps();if(!n||!fu(t,o,this.currentDirection))return;const l=this.getAxisMotionValue(t);let c=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(c=J6(c,this.constraints[t],this.elastic[t])),l.set(c)}resolveConstraints(){const{dragConstraints:t,dragElastic:s}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,o=this.constraints;t&&To(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&n?this.constraints=ez(n.layoutBox,t):this.constraints=!1,this.elastic=nz(s),o!==this.constraints&&!To(t)&&n&&this.constraints&&!this.hasMutatedConstraints&&ms(l=>{this.constraints!==!1&&this.getAxisMotionValue(l)&&(this.constraints[l]=sz(n.layoutBox[l],this.constraints[l]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:s}=this.getProps();if(!t||!To(t))return!1;const n=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const l=cP(n,o.root,this.visualElement.getTransformPagePoint());let c=tz(o.layout.layoutBox,l);if(s){const h=s(oP(c));this.hasMutatedConstraints=!!h,h&&(c=j2(h))}return c}startAnimation(t){const{drag:s,dragMomentum:n,dragElastic:o,dragTransition:l,dragSnapToOrigin:c,onDragTransitionEnd:h}=this.getProps(),f=this.constraints||{},d=ms(p=>{if(!fu(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:n?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 n=this.getAxisMotionValue(t);return Cp(this.visualElement,t),n.start(rv(t,n,0,s,this.visualElement,!1))}stopAnimation(){ms(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const s=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps(),o=n[s];return o||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){ms(s=>{const{drag:n}=this.getProps();if(!fu(s,n,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]-ut(c,h,.5)+f)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:s}=this.getProps(),{projection:n}=this.visualElement;if(!To(s)||!n||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};ms(c=>{const h=this.getAxisMotionValue(c);if(h&&this.constraints!==!1){const f=h.get();o[c]=iz({min:f,max:f},this.constraints[c])}});const{transformTemplate:l}=this.visualElement.getProps();this.visualElement.current.style.transform=l?l({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),ms(c=>{if(!fu(c,t,null))return;const h=this.getAxisMotionValue(c),{min:f,max:d}=this.constraints[c];h.set(ut(f,d,o[c]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;rz.set(this.visualElement,this);const t=this.visualElement.current,s=fl(t,"pointerdown",d=>{const{drag:p,dragListener:v=!0}=this.getProps(),_=d.target,y=_!==t&&I4(_);p&&v&&!y&&this.start(d)});let n;const o=()=>{const{dragConstraints:d}=this.getProps();To(d)&&d.current&&(this.constraints=this.resolveRefConstraints(),n||(n=az(t,d.current,()=>this.scalePositionWithinConstraints())))},{projection:l}=this.visualElement,c=l.addEventListener("measure",o);l&&!l.layout&&(l.root&&l.root.updateScroll(),l.updateLayout()),tt.read(o);const h=Sl(window,"resize",()=>this.scalePositionWithinConstraints()),f=l.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:p})=>{this.isDragging&&p&&(ms(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(),n&&n()}}getProps(){const t=this.visualElement.getProps(),{drag:s=!1,dragDirectionLock:n=!1,dragPropagation:o=!1,dragConstraints:l=!1,dragElastic:c=Op,dragMomentum:h=!0}=t;return{...t,drag:s,dragDirectionLock:n,dragPropagation:o,dragConstraints:l,dragElastic:c,dragMomentum:h}}}function jw(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function az(e,t,s){const n=WS(e,jw(s)),o=WS(t,jw(s));return()=>{n(),o()}}function fu(e,t,s){return(t===!0||t===e)&&(s===null||s===e)}function lz(e,t=10){let s=null;return Math.abs(e.y)>t?s="y":Math.abs(e.x)>t&&(s="x"),s}class cz extends Gn{constructor(t){super(t),this.removeGroupControls=Ki,this.removeListeners=Ki,this.controls=new oz(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ki}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 Mm=e=>(t,s)=>{e&&tt.update(()=>e(t,s),!1,!0)};class uz extends Gn{constructor(){super(...arguments),this.removePointerDownListener=Ki}onPointerDown(t){this.session=new gT(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:pT(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:s,onPan:n,onPanEnd:o}=this.node.getProps();return{onSessionStart:Mm(t),onStart:Mm(s),onMove:Mm(n),onEnd:(l,c)=>{delete this.session,o&&tt.postRender(()=>o(l,c))}}}mount(){this.removePointerDownListener=fl(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 Dm=!1;class hz extends x.Component{componentDidMount(){const{visualElement:t,layoutGroup:s,switchLayoutGroup:n,layoutId:o}=this.props,{projection:l}=t;l&&(s.group&&s.group.add(l),n&&n.register&&o&&n.register(l),Dm&&l.root.didUpdate(),l.addEventListener("animationComplete",()=>{this.safeToRemove()}),l.setOptions({...l.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Bu.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:s,visualElement:n,drag:o,isPresent:l}=this.props,{projection:c}=n;return c&&(c.isPresent=l,t.layoutDependency!==s&&c.setOptions({...c.options,layoutDependency:s}),Dm=!0,o||t.layoutDependency!==s||s===void 0||t.isPresent!==l?c.willUpdate():this.safeToRemove(),t.isPresent!==l&&(l?c.promote():c.relegate()||tt.postRender(()=>{const h=c.getStack();(!h||!h.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),cv.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:s,switchLayoutGroup:n}=this.props,{projection:o}=t;Dm=!0,o&&(o.scheduleCheckAfterUnmount(),s&&s.group&&s.group.remove(o),n&&n.deregister&&n.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function _T(e){const[t,s]=oT(),n=x.useContext(Ug);return w.jsx(hz,{...e,layoutGroup:n,switchLayoutGroup:x.useContext(fT),isPresent:t,safeToRemove:s})}const dz={pan:{Feature:uz},drag:{Feature:cz,ProjectionNode:rT,MeasureLayout:_T}};function Hw(e,t,s){const{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover",s==="Start");const o="onHover"+s,l=n[o];l&&tt.postRender(()=>l(t,Ol(t)))}class fz extends Gn{mount(){const{current:t}=this.node;t&&(this.unmount=P4(t,(s,n)=>(Hw(this.node,n,"Start"),o=>Hw(this.node,o,"End"))))}unmount(){}}class mz extends Gn{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=Al(Sl(this.node.current,"focus",()=>this.onFocus()),Sl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Iw(e,t,s){const{props:n}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap",s==="Start");const o="onTap"+(s==="End"?"":s),l=n[o];l&&tt.postRender(()=>l(t,Ol(t)))}class pz extends Gn{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:s,propagate:n}=this.node.props;this.unmount=U4(t,(o,l)=>(Iw(this.node,l,"Start"),(c,{success:h})=>Iw(this.node,c,h?"End":"Cancel")),{useGlobalTarget:s,stopPropagation:n?.tap===!1})}unmount(){}}const Np=new WeakMap,Om=new WeakMap,gz=e=>{const t=Np.get(e.target);t&&t(e)},vz=e=>{e.forEach(gz)};function _z({root:e,...t}){const s=e||document;Om.has(s)||Om.set(s,{});const n=Om.get(s),o=JSON.stringify(t);return n[o]||(n[o]=new IntersectionObserver(vz,{root:e,...t})),n[o]}function yz(e,t,s){const n=_z(t);return Np.set(e,s),n.observe(e),()=>{Np.delete(e),n.unobserve(e)}}const bz={some:0,all:1};class Sz extends Gn{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:s,margin:n,amount:o="some",once:l}=t,c={root:s?s.current:void 0,rootMargin:n,threshold:typeof o=="number"?o:bz[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 yz(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(wz(t,s))&&this.startObserver()}unmount(){}}function wz({viewport:e={}},{viewport:t={}}={}){return s=>e[s]!==t[s]}const xz={inView:{Feature:Sz},tap:{Feature:pz},focus:{Feature:mz},hover:{Feature:fz}},Cz={layout:{ProjectionNode:rT,MeasureLayout:_T}},Ez={...$6,...xz,...dz,...Cz},Vw=F6(Ez,W6);function Nm({className:e,orientation:t="horizontal",decorative:s=!0,...n}){return w.jsx(QN,{"data-slot":"separator",decorative:s,orientation:t,className:it("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),...n})}const Uw={0:"text-[#f85149]",1:"text-[#e3b341]",2:"text-[#58a6ff]",3:"text-[#7d8590]",4:"text-muted-foreground"},Tz={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"},kz={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 Lm(e){return e?new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"}):null}function Fw({dep:e,onNavigate:t}){const s=e.status==="closed"?"✓":e.status==="in_progress"?"◐":"○";return w.jsxs("div",{className:"flex items-start gap-2 py-1",children:[w.jsx("span",{className:"text-xs leading-4 text-foreground",children:s}),w.jsxs("div",{className:"min-w-0",children:[w.jsxs("div",{className:"flex items-center gap-1",children:[w.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&&w.jsxs("span",{className:"text-xs leading-4 text-muted-foreground",children:["(",e.dependency_type,")"]})]}),w.jsx("p",{className:"text-sm leading-tight text-foreground",children:e.title})]})]})}function Rz(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),n=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-n,y:c-o}}const Az={type:"spring",damping:28,stiffness:380,mass:.8},Mz={duration:.2,ease:[.4,0,.2,1]},Ww=new Map;function Dz({issueId:e,open:t,onClose:s,sourceRect:n,issues:o}){const[l,c]=x.useState(null),[h,f]=x.useState(!1),[d,p]=x.useState([]),[v,_]=x.useState(e),[y,b]=x.useState(!1),S=x.useRef(null);x.useEffect(()=>{_(e),p([]),b(!1),S.current=null},[e]),x.useEffect(()=>{t||(p([]),b(!1),S.current=null)},[t]);const E=x.useCallback(F=>{v&&p(U=>[...U,v]),_(F),b(!1),S.current=null},[v]),R=x.useCallback(()=>{p(F=>{const U=[...F],H=U.pop();return H&&_(H),b(!1),S.current=null,U})},[]),[A,M]=x.useState(!1);x.useEffect(()=>{if(!v||!t)return;const F=Ww.get(v);if(F)S.current=F,c(F),b(!0);else if(o){const U=o.find(H=>H.id===v);if(U){const H={id:U.id,title:U.title,status:U.status,priority:U.priority,issue_type:U.issue_type||U.type,description:U.description,created_at:U.created_at,updated_at:U.updated_at,parent:U.parent};S.current=H,c(H),b(!0)}}f(!F&&!o?.find(U=>U.id===v)),fetch(`/api/issue/${v}`).then(U=>{if(!U.ok)throw new Error(`HTTP ${U.status}`);return U.json()}).then(U=>{const H=Array.isArray(U)?U[0]:U;H&&Ww.set(v,H),S.current=H||null,A&&(c(H||null),b(!0))}).catch(()=>{F||(S.current=null,A&&(c(null),b(!0)))}).finally(()=>f(!1))},[v,t]),x.useEffect(()=>{A&&!h&&S.current!==void 0&&(c(S.current),b(!0))},[A,h]);const k=x.useCallback(F=>{F.key==="Escape"&&s()},[s]);x.useEffect(()=>{if(t)return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[t,k]);const j=Rz(n||null);return x.useEffect(()=>{t||M(!1)},[t]),w.jsx(_6,{children:t&&w.jsxs(w.Fragment,{children:[w.jsx(Vw.div,{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-[2px]",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:Mz,onClick:s},"overlay"),w.jsxs(Vw.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:j,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:Az,onAnimationComplete:()=>M(!0),children:[d.length>0&&w.jsxs("button",{onClick:R,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:[w.jsx(RE,{className:"size-4"}),w.jsx("span",{className:"sr-only",children:"Back"})]}),w.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:[w.jsx(Ig,{className:"size-4"}),w.jsx("span",{className:"sr-only",children:"Close"})]}),y?l?w.jsxs(vl,{className:"max-h-[80vh]",children:[w.jsxs("div",{className:"p-5 pb-3",children:[w.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-2",children:[w.jsxs("span",{className:`text-xs font-semibold ${Uw[l.priority]||Uw[4]}`,children:["P",l.priority]}),w.jsx("code",{className:"text-xs text-muted-foreground",children:l.id}),l.issue_type&&w.jsx(Zu,{variant:"outline",className:Tz[l.issue_type]||"",children:l.issue_type}),w.jsx(Zu,{className:kz[l.status]||"",children:l.status.replace("_"," ")})]}),w.jsx("h2",{id:"issue-detail-title",className:"text-base leading-tight font-semibold text-foreground",children:l.title}),l.owner&&w.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:l.owner})]}),w.jsx(Nm,{}),w.jsxs("div",{className:"p-5 space-y-4",children:[l.description&&w.jsxs("div",{children:[w.jsx("h3",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:"Description"}),w.jsx("p",{className:"text-sm whitespace-pre-wrap text-foreground leading-relaxed",children:l.description})]}),l.close_reason&&w.jsxs("div",{children:[w.jsx("h3",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:"Close Reason"}),w.jsx("p",{className:"text-sm text-foreground",children:l.close_reason})]}),l.parent&&w.jsxs("div",{children:[w.jsx("h3",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:"Parent"}),w.jsx("code",{className:"text-xs text-muted-foreground cursor-pointer hover:underline hover:text-foreground transition-colors",onClick:()=>E(l.parent),children:l.parent})]}),l.dependencies&&l.dependencies.length>0&&w.jsxs("div",{children:[w.jsx("h3",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:"Dependencies"}),l.dependencies.map(F=>w.jsx(Fw,{dep:F,onNavigate:E},F.id))]}),l.dependents&&l.dependents.length>0&&w.jsxs("div",{children:[w.jsx("h3",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide mb-1.5",children:"Blocks"}),l.dependents.map(F=>w.jsx(Fw,{dep:F,onNavigate:E},F.id))]}),w.jsx(Nm,{}),w.jsxs("div",{className:"grid grid-cols-2 gap-3 text-xs text-muted-foreground",children:[l.created_at&&w.jsxs("div",{children:[w.jsx("span",{className:"font-semibold",children:"Created"}),w.jsx("p",{children:Lm(l.created_at)})]}),l.updated_at&&w.jsxs("div",{children:[w.jsx("span",{className:"font-semibold",children:"Updated"}),w.jsx("p",{children:Lm(l.updated_at)})]}),l.closed_at&&w.jsxs("div",{children:[w.jsx("span",{className:"font-semibold",children:"Closed"}),w.jsx("p",{children:Lm(l.closed_at)})]})]})]})]}):w.jsx("div",{className:"flex items-center justify-center py-12",children:w.jsx("span",{className:"text-sm text-muted-foreground",children:"Issue not found"})}):w.jsxs("div",{className:"p-5 pb-3 space-y-4 animate-pulse",children:[w.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[w.jsx("div",{className:"h-4 w-6 rounded bg-muted"}),w.jsx("div",{className:"h-4 w-24 rounded bg-muted"}),w.jsx("div",{className:"h-5 w-12 rounded-full bg-muted"}),w.jsx("div",{className:"h-5 w-16 rounded-full bg-muted"})]}),w.jsx("div",{className:"h-5 w-3/4 rounded bg-muted"}),w.jsx("div",{className:"h-4 w-1/3 rounded bg-muted"}),w.jsx(Nm,{}),w.jsxs("div",{className:"space-y-2 pt-2",children:[w.jsx("div",{className:"h-3 w-20 rounded bg-muted"}),w.jsx("div",{className:"h-4 w-full rounded bg-muted"}),w.jsx("div",{className:"h-4 w-full rounded bg-muted"}),w.jsx("div",{className:"h-4 w-2/3 rounded bg-muted"})]})]})]},"modal")]})})}var Ge=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ss=Ge((e,t)=>{var s=Object.defineProperty,n=(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)=>n(L,typeof P!="symbol"?P+"":P,q),c=o((L,P)=>{var q="\0",T="\0",I="",B=class{constructor(V){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"),V&&(this._isDirected=Object.hasOwn(V,"directed")?V.directed:!0,this._isMultigraph=Object.hasOwn(V,"multigraph")?V.multigraph:!1,this._isCompound=Object.hasOwn(V,"compound")?V.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[T]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(V){return this._label=V,this}graph(){return this._label}setDefaultNodeLabel(V){return this._defaultNodeLabelFn=V,typeof V!="function"&&(this._defaultNodeLabelFn=()=>V),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var V=this;return this.nodes().filter(O=>Object.keys(V._in[O]).length===0)}sinks(){var V=this;return this.nodes().filter(O=>Object.keys(V._out[O]).length===0)}setNodes(V,O){var K=arguments,Y=this;return V.forEach(function(ie){K.length>1?Y.setNode(ie,O):Y.setNode(ie)}),this}setNode(V,O){return Object.hasOwn(this._nodes,V)?(arguments.length>1&&(this._nodes[V]=O),this):(this._nodes[V]=arguments.length>1?O:this._defaultNodeLabelFn(V),this._isCompound&&(this._parent[V]=T,this._children[V]={},this._children[T][V]=!0),this._in[V]={},this._preds[V]={},this._out[V]={},this._sucs[V]={},++this._nodeCount,this)}node(V){return this._nodes[V]}hasNode(V){return Object.hasOwn(this._nodes,V)}removeNode(V){var O=this;if(Object.hasOwn(this._nodes,V)){var K=Y=>O.removeEdge(O._edgeObjs[Y]);delete this._nodes[V],this._isCompound&&(this._removeFromParentsChildList(V),delete this._parent[V],this.children(V).forEach(function(Y){O.setParent(Y)}),delete this._children[V]),Object.keys(this._in[V]).forEach(K),delete this._in[V],delete this._preds[V],Object.keys(this._out[V]).forEach(K),delete this._out[V],delete this._sucs[V],--this._nodeCount}return this}setParent(V,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 K=O;K!==void 0;K=this.parent(K))if(K===V)throw new Error("Setting "+O+" as parent of "+V+" would create a cycle");this.setNode(O)}return this.setNode(V),this._removeFromParentsChildList(V),this._parent[V]=O,this._children[O][V]=!0,this}_removeFromParentsChildList(V){delete this._children[this._parent[V]][V]}parent(V){if(this._isCompound){var O=this._parent[V];if(O!==T)return O}}children(V=T){if(this._isCompound){var O=this._children[V];if(O)return Object.keys(O)}else{if(V===T)return this.nodes();if(this.hasNode(V))return[]}}predecessors(V){var O=this._preds[V];if(O)return Object.keys(O)}successors(V){var O=this._sucs[V];if(O)return Object.keys(O)}neighbors(V){var O=this.predecessors(V);if(O){let Y=new Set(O);for(var K of this.successors(V))Y.add(K);return Array.from(Y.values())}}isLeaf(V){var O;return this.isDirected()?O=this.successors(V):O=this.neighbors(V),O.length===0}filterNodes(V){var O=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});O.setGraph(this.graph());var K=this;Object.entries(this._nodes).forEach(function([ne,fe]){V(ne)&&O.setNode(ne,fe)}),Object.values(this._edgeObjs).forEach(function(ne){O.hasNode(ne.v)&&O.hasNode(ne.w)&&O.setEdge(ne,K.edge(ne))});var Y={};function ie(ne){var fe=K.parent(ne);return fe===void 0||O.hasNode(fe)?(Y[ne]=fe,fe):fe in Y?Y[fe]:ie(fe)}return this._isCompound&&O.nodes().forEach(ne=>O.setParent(ne,ie(ne))),O}setDefaultEdgeLabel(V){return this._defaultEdgeLabelFn=V,typeof V!="function"&&(this._defaultEdgeLabelFn=()=>V),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(V,O){var K=this,Y=arguments;return V.reduce(function(ie,ne){return Y.length>1?K.setEdge(ie,ne,O):K.setEdge(ie,ne),ne}),this}setEdge(){var V,O,K,Y,ie=!1,ne=arguments[0];typeof ne=="object"&&ne!==null&&"v"in ne?(V=ne.v,O=ne.w,K=ne.name,arguments.length===2&&(Y=arguments[1],ie=!0)):(V=ne,O=arguments[1],K=arguments[3],arguments.length>2&&(Y=arguments[2],ie=!0)),V=""+V,O=""+O,K!==void 0&&(K=""+K);var fe=N(this._isDirected,V,O,K);if(Object.hasOwn(this._edgeLabels,fe))return ie&&(this._edgeLabels[fe]=Y),this;if(K!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(V),this.setNode(O),this._edgeLabels[fe]=ie?Y:this._defaultEdgeLabelFn(V,O,K);var me=Z(this._isDirected,V,O,K);return V=me.v,O=me.w,Object.freeze(me),this._edgeObjs[fe]=me,ee(this._preds[O],V),ee(this._sucs[V],O),this._in[O][fe]=me,this._out[V][fe]=me,this._edgeCount++,this}edge(V,O,K){var Y=arguments.length===1?se(this._isDirected,arguments[0]):N(this._isDirected,V,O,K);return this._edgeLabels[Y]}edgeAsObj(){let V=this.edge(...arguments);return typeof V!="object"?{label:V}:V}hasEdge(V,O,K){var Y=arguments.length===1?se(this._isDirected,arguments[0]):N(this._isDirected,V,O,K);return Object.hasOwn(this._edgeLabels,Y)}removeEdge(V,O,K){var Y=arguments.length===1?se(this._isDirected,arguments[0]):N(this._isDirected,V,O,K),ie=this._edgeObjs[Y];return ie&&(V=ie.v,O=ie.w,delete this._edgeLabels[Y],delete this._edgeObjs[Y],X(this._preds[O],V),X(this._sucs[V],O),delete this._in[O][Y],delete this._out[V][Y],this._edgeCount--),this}inEdges(V,O){return this.isDirected()?this.filterEdges(this._in[V],V,O):this.nodeEdges(V,O)}outEdges(V,O){return this.isDirected()?this.filterEdges(this._out[V],V,O):this.nodeEdges(V,O)}nodeEdges(V,O){if(V in this._nodes)return this.filterEdges({...this._in[V],...this._out[V]},V,O)}filterEdges(V,O,K){if(V){var Y=Object.values(V);return K?Y.filter(function(ie){return ie.v===O&&ie.w===K||ie.v===K&&ie.w===O}):Y}}};function ee(V,O){V[O]?V[O]++:V[O]=1}function X(V,O){--V[O]||delete V[O]}function N(V,O,K,Y){var ie=""+O,ne=""+K;if(!V&&ie>ne){var fe=ie;ie=ne,ne=fe}return ie+I+ne+I+(Y===void 0?q:Y)}function Z(V,O,K,Y){var ie=""+O,ne=""+K;if(!V&&ie>ne){var fe=ie;ie=ne,ne=fe}var me={v:ie,w:ne};return Y&&(me.name=Y),me}function se(V,O){return N(V,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:ee};function T(X){var N={options:{directed:X.isDirected(),multigraph:X.isMultigraph(),compound:X.isCompound()},nodes:I(X),edges:B(X)};return X.graph()!==void 0&&(N.value=structuredClone(X.graph())),N}function I(X){return X.nodes().map(function(N){var Z=X.node(N),se=X.parent(N),V={v:N};return Z!==void 0&&(V.value=Z),se!==void 0&&(V.parent=se),V})}function B(X){return X.edges().map(function(N){var Z=X.edge(N),se={v:N.v,w:N.w};return N.name!==void 0&&(se.name=N.name),Z!==void 0&&(se.value=Z),se})}function ee(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,ee,X,N){return I(B,String(ee),X||q,N||function(Z){return B.outEdges(Z)})}function I(B,ee,X,N){var Z={},se=!0,V=0,O=B.nodes(),K=function(fe){var me=X(fe);Z[fe.v].distance+me<Z[fe.w].distance&&(Z[fe.w]={distance:Z[fe.v].distance+me,predecessor:fe.v},se=!0)},Y=function(){O.forEach(function(fe){N(fe).forEach(function(me){var we=me.v===fe?me.v:me.w,Ce=we===me.v?me.w:me.v;K({v:we,w:Ce})})})};O.forEach(function(fe){var me=fe===ee?0:Number.POSITIVE_INFINITY;Z[fe]={distance:me}});for(var ie=O.length,ne=1;ne<ie&&(se=!1,V++,Y(),!!se);ne++);if(V===ie-1&&(se=!1,Y(),se))throw new Error("The graph contains a negative weight cycle");return Z}}),v=o((L,P)=>{P.exports=q;function q(T){var I={},B=[],ee;function X(N){Object.hasOwn(I,N)||(I[N]=!0,ee.push(N),T.successors(N).forEach(X),T.predecessors(N).forEach(X))}return T.nodes().forEach(function(N){ee=[],X(N),ee.length&&B.push(ee)}),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 I=this._keyIndices[T];if(I!==void 0)return this._arr[I].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(T,I){var B=this._keyIndices;if(T=String(T),!Object.hasOwn(B,T)){var ee=this._arr,X=ee.length;return B[T]=X,ee.push({key:T,priority:I}),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,I){var B=this._keyIndices[T];if(I>this._arr[B].priority)throw new Error("New priority is greater than current priority. Key: "+T+" Old: "+this._arr[B].priority+" New: "+I);this._arr[B].priority=I,this._decrease(B)}_heapify(T){var I=this._arr,B=2*T,ee=B+1,X=T;B<I.length&&(X=I[B].priority<I[X].priority?B:X,ee<I.length&&(X=I[ee].priority<I[X].priority?ee:X),X!==T&&(this._swap(T,X),this._heapify(X)))}_decrease(T){for(var I=this._arr,B=I[T].priority,ee;T!==0&&(ee=T>>1,!(I[ee].priority<B));)this._swap(T,ee),T=ee}_swap(T,I){var B=this._arr,ee=this._keyIndices,X=B[T],N=B[I];B[T]=N,B[I]=X,ee[N.key]=T,ee[X.key]=I}};P.exports=q}),y=o((L,P)=>{var q=_();P.exports=I;var T=()=>1;function I(ee,X,N,Z){var se=function(V){return ee.outEdges(V)};return B(ee,String(X),N||T,Z||se)}function B(ee,X,N,Z){var se={},V=new q,O,K,Y=function(ie){var ne=ie.v!==O?ie.v:ie.w,fe=se[ne],me=N(ie),we=K.distance+me;if(me<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+ie+" Weight: "+me);we<fe.distance&&(fe.distance=we,fe.predecessor=O,V.decrease(ne,we))};for(ee.nodes().forEach(function(ie){var ne=ie===X?0:Number.POSITIVE_INFINITY;se[ie]={distance:ne},V.add(ie,ne)});V.size()>0&&(O=V.removeMin(),K=se[O],K.distance!==Number.POSITIVE_INFINITY);)Z(O).forEach(Y);return se}}),b=o((L,P)=>{var q=y();P.exports=T;function T(I,B,ee){return I.nodes().reduce(function(X,N){return X[N]=q(I,N,B,ee),X},{})}}),S=o((L,P)=>{P.exports=q;function q(I,B,ee){if(I[B].predecessor!==void 0)throw new Error("Invalid source vertex");if(I[ee].predecessor===void 0&&ee!==B)throw new Error("Invalid destination vertex");return{weight:I[ee].distance,path:T(I,B,ee)}}function T(I,B,ee){for(var X=[],N=ee;N!==B;)X.push(N),N=I[N].predecessor;return X.push(B),X.reverse()}}),E=o((L,P)=>{P.exports=q;function q(T){var I=0,B=[],ee={},X=[];function N(Z){var se=ee[Z]={onStack:!0,lowlink:I,index:I++};if(B.push(Z),T.successors(Z).forEach(function(K){Object.hasOwn(ee,K)?ee[K].onStack&&(se.lowlink=Math.min(se.lowlink,ee[K].index)):(N(K),se.lowlink=Math.min(se.lowlink,ee[K].lowlink))}),se.lowlink===se.index){var V=[],O;do O=B.pop(),ee[O].onStack=!1,V.push(O);while(Z!==O);X.push(V)}}return T.nodes().forEach(function(Z){Object.hasOwn(ee,Z)||N(Z)}),X}}),R=o((L,P)=>{var q=E();P.exports=T;function T(I){return q(I).filter(function(B){return B.length>1||B.length===1&&I.hasEdge(B[0],B[0])})}}),A=o((L,P)=>{P.exports=T;var q=()=>1;function T(B,ee,X){return I(B,ee||q,X||function(N){return B.outEdges(N)})}function I(B,ee,X){var N={},Z=B.nodes();return Z.forEach(function(se){N[se]={},N[se][se]={distance:0},Z.forEach(function(V){se!==V&&(N[se][V]={distance:Number.POSITIVE_INFINITY})}),X(se).forEach(function(V){var O=V.v===se?V.w:V.v,K=ee(V);N[se][O]={distance:K,predecessor:se}})}),Z.forEach(function(se){var V=N[se];Z.forEach(function(O){var K=N[O];Z.forEach(function(Y){var ie=K[se],ne=V[Y],fe=K[Y],me=ie.distance+ne.distance;me<fe.distance&&(fe.distance=me,fe.predecessor=ne.predecessor)})})}),N}}),M=o((L,P)=>{function q(I){var B={},ee={},X=[];function N(Z){if(Object.hasOwn(ee,Z))throw new T;Object.hasOwn(B,Z)||(ee[Z]=!0,B[Z]=!0,I.predecessors(Z).forEach(N),delete ee[Z],X.push(Z))}if(I.sinks().forEach(N),Object.keys(B).length!==I.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(I){try{q(I)}catch(B){if(B instanceof q.CycleException)return!1;throw B}return!0}}),j=o((L,P)=>{P.exports=q;function q(I,B,ee,X,N){Array.isArray(B)||(B=[B]);var Z=(I.isDirected()?I.successors:I.neighbors).bind(I),se={};return B.forEach(function(V){if(!I.hasNode(V))throw new Error("Graph does not have node: "+V);N=T(I,V,ee==="post",se,Z,X,N)}),N}function T(I,B,ee,X,N,Z,se){return Object.hasOwn(X,B)||(X[B]=!0,ee||(se=Z(se,B)),N(B).forEach(function(V){se=T(I,V,ee,X,N,Z,se)}),ee&&(se=Z(se,B))),se}}),F=o((L,P)=>{var q=j();P.exports=T;function T(I,B,ee){return q(I,B,ee,function(X,N){return X.push(N),X},[])}}),U=o((L,P)=>{var q=F();P.exports=T;function T(I,B){return q(I,B,"post")}}),H=o((L,P)=>{var q=F();P.exports=T;function T(I,B){return q(I,B,"pre")}}),J=o((L,P)=>{var q=c(),T=_();P.exports=I;function I(B,ee){var X=new q,N={},Z=new T,se;function V(K){var Y=K.v===se?K.w:K.v,ie=Z.priority(Y);if(ie!==void 0){var ne=ee(K);ne<ie&&(N[Y]=se,Z.decrease(Y,ne))}}if(B.nodeCount()===0)return X;B.nodes().forEach(function(K){Z.add(K,Number.POSITIVE_INFINITY),X.setNode(K)}),Z.decrease(B.nodes()[0],0);for(var O=!1;Z.size()>0;){if(se=Z.removeMin(),Object.hasOwn(N,se))X.setEdge(se,N[se]);else{if(O)throw new Error("Input graph is not connected: "+B);O=!0}B.nodeEdges(se).forEach(V)}return X}}),W=o((L,P)=>{var q=y(),T=p();P.exports=I;function I(ee,X,N,Z){return B(ee,X,N,Z||function(se){return ee.outEdges(se)})}function B(ee,X,N,Z){if(N===void 0)return q(ee,X,N,Z);for(var se=!1,V=ee.nodes(),O=0;O<V.length;O++){for(var K=Z(V[O]),Y=0;Y<K.length;Y++){var ie=K[Y],ne=ie.v===V[O]?ie.v:ie.w,fe=ne===ie.v?ie.w:ie.v;N({v:ne,w:fe})<0&&(se=!0)}if(se)return T(ee,X,N,Z)}return q(ee,X,N,Z)}}),$=o((L,P)=>{P.exports={bellmanFord:p(),components:v(),dijkstra:y(),dijkstraAll:b(),extractPath:S(),findCycles:R(),floydWarshall:A(),isAcyclic:k(),postorder:U(),preorder:H(),prim:J(),shortestPaths:W(),reduce:j(),tarjan:E(),topsort:M()}}),z=f();t.exports={Graph:z.Graph,json:d(),alg:$(),version:z.version}}),Oz=Ge((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 n(c),c}enqueue(l){let c=this._sentinel;l._prev&&l._next&&n(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 n(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}),Nz=Ge((e,t)=>{var s=ss().Graph,n=Oz();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],R;for(;v.nodeCount();){for(;R=E.dequeue();)h(v,_,y,R);for(;R=S.dequeue();)h(v,_,y,R);if(v.nodeCount()){for(let A=_.length-2;A>0;--A)if(R=_[A].dequeue(),R){b=b.concat(h(v,_,y,R,!0));break}}}return b}function h(v,_,y,b,S){let E=S?[]:void 0;return v.inEdges(b.v).forEach(R=>{let A=v.edge(R),M=v.node(R.v);S&&E.push({v:R.v,w:R.w}),M.out-=A,d(_,y,M)}),v.outEdges(b.v).forEach(R=>{let A=v.edge(R),M=R.w,k=v.node(M);k.in-=A,d(_,y,k)}),v.removeNode(b.v),E}function f(v,_){let y=new s,b=0,S=0;v.nodes().forEach(A=>{y.setNode(A,{v:A,in:0,out:0})}),v.edges().forEach(A=>{let M=y.edge(A.v,A.w)||0,k=_(A),j=M+k;y.setEdge(A.v,A.w,j),S=Math.max(S,y.node(A.v).out+=k),b=Math.max(b,y.node(A.w).in+=k)});let E=p(S+b+3).map(()=>new n),R=b+1;return y.nodes().forEach(A=>{d(E,R,y.node(A))}),{graph:y,buckets:E,zeroIdx:R}}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 _}}),kt=Ge((e,t)=>{var s=ss().Graph;t.exports={addBorderNode:_,addDummyNode:n,applyWithChunking:S,asNonCompoundGraph:l,buildLayerMatrix:d,intersectRect:f,mapValues:H,maxRank:E,normalizeRanks:p,notime:M,partition:R,pick:U,predecessorWeights:h,range:F,removeEmptyRanks:v,simplify:o,successorWeights:c,time:A,uniqueId:j,zipObject:J};function n(W,$,z,L){for(var P=L;W.hasNode(P);)P=j(L);return z.dummy=$,W.setNode(P,z),P}function o(W){let $=new s().setGraph(W.graph());return W.nodes().forEach(z=>$.setNode(z,W.node(z))),W.edges().forEach(z=>{let L=$.edge(z.v,z.w)||{weight:0,minlen:1},P=W.edge(z);$.setEdge(z.v,z.w,{weight:L.weight+P.weight,minlen:Math.max(L.minlen,P.minlen)})}),$}function l(W){let $=new s({multigraph:W.isMultigraph()}).setGraph(W.graph());return W.nodes().forEach(z=>{W.children(z).length||$.setNode(z,W.node(z))}),W.edges().forEach(z=>{$.setEdge(z,W.edge(z))}),$}function c(W){let $=W.nodes().map(z=>{let L={};return W.outEdges(z).forEach(P=>{L[P.w]=(L[P.w]||0)+W.edge(P).weight}),L});return J(W.nodes(),$)}function h(W){let $=W.nodes().map(z=>{let L={};return W.inEdges(z).forEach(P=>{L[P.v]=(L[P.v]||0)+W.edge(P).weight}),L});return J(W.nodes(),$)}function f(W,$){let z=W.x,L=W.y,P=$.x-z,q=$.y-L,T=W.width/2,I=W.height/2;if(!P&&!q)throw new Error("Not possible to find intersection inside of the rectangle");let B,ee;return Math.abs(q)*T>Math.abs(P)*I?(q<0&&(I=-I),B=I*P/q,ee=I):(P<0&&(T=-T),B=T,ee=T*q/P),{x:z+B,y:L+ee}}function d(W){let $=F(E(W)+1).map(()=>[]);return W.nodes().forEach(z=>{let L=W.node(z),P=L.rank;P!==void 0&&($[P][L.order]=z)}),$}function p(W){let $=W.nodes().map(L=>{let P=W.node(L).rank;return P===void 0?Number.MAX_VALUE:P}),z=S(Math.min,$);W.nodes().forEach(L=>{let P=W.node(L);Object.hasOwn(P,"rank")&&(P.rank-=z)})}function v(W){let $=W.nodes().map(T=>W.node(T).rank).filter(T=>T!==void 0),z=S(Math.min,$),L=[];W.nodes().forEach(T=>{let I=W.node(T).rank-z;L[I]||(L[I]=[]),L[I].push(T)});let P=0,q=W.graph().nodeRankFactor;Array.from(L).forEach((T,I)=>{T===void 0&&I%q!==0?--P:T!==void 0&&P&&T.forEach(B=>W.node(B).rank+=P)})}function _(W,$,z,L){let P={width:0,height:0};return arguments.length>=4&&(P.rank=z,P.order=L),n(W,"border",P,$)}function y(W,$=b){let z=[];for(let L=0;L<W.length;L+=$){let P=W.slice(L,L+$);z.push(P)}return z}var b=65535;function S(W,$){if($.length>b){let z=y($);return W.apply(null,z.map(L=>W.apply(null,L)))}else return W.apply(null,$)}function E(W){let $=W.nodes().map(z=>{let L=W.node(z).rank;return L===void 0?Number.MIN_VALUE:L});return S(Math.max,$)}function R(W,$){let z={lhs:[],rhs:[]};return W.forEach(L=>{$(L)?z.lhs.push(L):z.rhs.push(L)}),z}function A(W,$){let z=Date.now();try{return $()}finally{console.log(W+" time: "+(Date.now()-z)+"ms")}}function M(W,$){return $()}var k=0;function j(W){var $=++k;return W+(""+$)}function F(W,$,z=1){$==null&&($=W,W=0);let L=q=>q<$;z<0&&(L=q=>$<q);let P=[];for(let q=W;L(q);q+=z)P.push(q);return P}function U(W,$){let z={};for(let L of $)W[L]!==void 0&&(z[L]=W[L]);return z}function H(W,$){let z=$;return typeof $=="string"&&(z=L=>L[$]),Object.entries(W).reduce((L,[P,q])=>(L[P]=z(q,P),L),{})}function J(W,$){return W.reduce((z,L,P)=>(z[L]=$[P],z),{})}}),Lz=Ge((e,t)=>{var s=Nz(),n=kt().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,n("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)}})}}),Bz=Ge((e,t)=>{var s=kt();t.exports={run:n,undo:l};function n(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,R;for(R=0,++d;d<v;++R,++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},_),R===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)})}}),oh=Ge((e,t)=>{var{applyWithChunking:s}=kt();t.exports={longestPath:n,slack:o};function n(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}}),yT=Ge((e,t)=>{var s=ss().Graph,n=oh().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)?n(f,_):-n(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)&&!n(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)&&(_=n(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)}}),Pz=Ge((e,t)=>{var s=yT(),n=oh().slack,o=oh().longestPath,l=ss().alg.preorder,c=ss().alg.postorder,h=kt().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,U;F=b(j);)U=S(j,k,F),E(j,k,F,U)}function d(k,j){var F=c(k,k.nodes());F=F.slice(0,F.length-1),F.forEach(U=>p(k,j,U))}function p(k,j,F){var U=k.node(F),H=U.parent;k.edge(F,H).cutvalue=v(k,j,F)}function v(k,j,F){var U=k.node(F),H=U.parent,J=!0,W=j.edge(F,H),$=0;return W||(J=!1,W=j.edge(H,F)),$=W.weight,j.nodeEdges(F).forEach(z=>{var L=z.v===F,P=L?z.w:z.v;if(P!==H){var q=L===J,T=j.edge(z).weight;if($+=q?T:-T,A(k,F,P)){var I=k.edge(F,P).cutvalue;$+=q?-I:I}}}),$}function _(k,j){arguments.length<2&&(j=k.nodes()[0]),y(k,{},1,j)}function y(k,j,F,U,H){var J=F,W=k.node(U);return j[U]=!0,k.neighbors(U).forEach($=>{Object.hasOwn(j,$)||(F=y(k,j,F,$,U))}),W.low=J,W.lim=F++,H?W.parent=H:delete W.parent,F}function b(k){return k.edges().find(j=>k.edge(j).cutvalue<0)}function S(k,j,F){var U=F.v,H=F.w;j.hasEdge(U,H)||(U=F.w,H=F.v);var J=k.node(U),W=k.node(H),$=J,z=!1;J.lim>W.lim&&($=W,z=!0);var L=j.edges().filter(P=>z===M(k,k.node(P.v),$)&&z!==M(k,k.node(P.w),$));return L.reduce((P,q)=>n(j,q)<n(j,P)?q:P)}function E(k,j,F,U){var H=F.v,J=F.w;k.removeEdge(H,J),k.setEdge(U.v,U.w,{}),_(k),d(k,j),R(k,j)}function R(k,j){var F=k.nodes().find(H=>!j.node(H).parent),U=l(k,F);U=U.slice(1),U.forEach(H=>{var J=k.node(H).parent,W=j.edge(H,J),$=!1;W||(W=j.edge(J,H),$=!0),j.node(H).rank=j.node(J).rank+($?W.minlen:-W.minlen)})}function A(k,j,F){return k.hasEdge(j,F)}function M(k,j,F){return F.low<=j.lim&&j.lim<=F.lim}}),zz=Ge((e,t)=>{var s=oh(),n=s.longestPath,o=yT(),l=Pz();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=n;function f(p){n(p),o(p)}function d(p){l(p)}}),jz=Ge((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=n(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 n(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}}),Hz=Ge((e,t)=>{var s=kt();t.exports={run:n,cleanup:h};function n(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"),R=s.addBorderNode(f,"_bb"),A=f.node(b);f.setParent(E,b),A.borderTop=E,f.setParent(R,b),A.borderBottom=R,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,U=k.borderTop?v:2*v,H=j!==F?1:_-y[b]+1;f.setEdge(E,j,{weight:U,minlen:H,nestingEdge:!0}),f.setEdge(F,R,{weight:U,minlen:H,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)})}}),Iz=Ge((e,t)=>{var s=kt();t.exports=n;function n(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})}}),Vz=Ge((e,t)=>{t.exports={adjust:s,undo:n};function s(p){let v=p.graph().rankdir.toLowerCase();(v==="lr"||v==="rl")&&o(p)}function n(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}}),Uz=Ge((e,t)=>{var s=kt();t.exports=n;function n(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}}),Fz=Ge((e,t)=>{var s=kt().zipObject;t.exports=n;function n(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}}),Wz=Ge((e,t)=>{t.exports=s;function s(n,o=[]){return o.map(l=>{let c=n.inEdges(l);if(c.length){let h=c.reduce((f,d)=>{let p=n.edge(d),v=n.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}})}}),Kz=Ge((e,t)=>{var s=kt();t.exports=n;function n(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}}),Yz=Ge((e,t)=>{var s=kt();t.exports=n;function n(c,h){let f=s.partition(c,E=>Object.hasOwn(E,"barycenter")),d=f.lhs,p=f.rhs.sort((E,R)=>R.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}}),qz=Ge((e,t)=>{var s=Wz(),n=Kz(),o=Yz();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 R=s(f,_);R.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 A=n(R,p);c(A,E);let M=o(A,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)}}),$z=Ge((e,t)=>{var s=ss().Graph,n=kt();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,R=v.edge(E,_),A=R!==void 0?R.weight:0;v.setEdge(E,_,{weight:c.edge(S).weight+A})}),Object.hasOwn(y,"minRank")&&v.setNode(_,{borderLeft:y.borderLeft[h],borderRight:y.borderRight[h]}))}),v}function l(c){for(var h;c.hasNode(h=n.uniqueId("_root")););return h}}),Gz=Ge((e,t)=>{t.exports=s;function s(n,o,l){let c={},h;l.forEach(f=>{let d=n.parent(f),p,v;for(;d;){if(p=n.parent(d),p?(v=c[p],c[p]=d):(v=h,h=d),v&&v!==d){o.setEdge(v,d);return}d=p}})}}),Xz=Ge((e,t)=>{var s=Uz(),n=Fz(),o=qz(),l=$z(),c=Gz(),h=ss().Graph,f=kt();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"),R=p(y,f.range(S-1,-1,-1),"outEdges"),A=s(y);if(_(y,A),b.disableOptimalOrderHeuristic)return;let M=Number.POSITIVE_INFINITY,k,j=b.constraints||[];for(let F=0,U=0;U<4;++F,++U){v(F%2?E:R,F%4>=2,j),A=f.buildLayerMatrix(y);let H=n(y,A);H<M?(U=0,k=Object.assign({},A),M=H):H===M&&(k=structuredClone(A))}_(y,k)}function p(y,b,S){let E=new Map,R=(A,M)=>{E.has(A)||E.set(A,[]),E.get(A).push(M)};for(let A of y.nodes()){let M=y.node(A);if(typeof M.rank=="number"&&R(M.rank,A),typeof M.minRank=="number"&&typeof M.maxRank=="number")for(let k=M.minRank;k<=M.maxRank;k++)k!==M.rank&&R(k,A)}return b.map(function(A){return l(y,A,S,E.get(A)||[])})}function v(y,b,S){let E=new h;y.forEach(function(R){S.forEach(k=>E.setEdge(k.left,k.right));let A=R.graph().root,M=o(R,A,E,b);M.vs.forEach((k,j)=>R.node(k).order=j),c(R,E,M.vs)})}function _(y,b){Object.values(b).forEach(S=>S.forEach((E,R)=>y.node(E).order=R))}}),Zz=Ge((e,t)=>{var s=ss().Graph,n=kt();t.exports={positionX:S,findType1Conflicts:o,findType2Conflicts:l,addConflict:h,hasConflict:f,verticalAlignment:d,horizontalCompaction:p,alignCoordinates:y,findSmallestWidthAlignment:_,balance:b};function o(A,M){let k={};function j(F,U){let H=0,J=0,W=F.length,$=U[U.length-1];return U.forEach((z,L)=>{let P=c(A,z),q=P?A.node(P).order:W;(P||z===$)&&(U.slice(J,L+1).forEach(T=>{A.predecessors(T).forEach(I=>{let B=A.node(I),ee=B.order;(ee<H||q<ee)&&!(B.dummy&&A.node(T).dummy)&&h(k,I,T)})}),J=L+1,H=q)}),U}return M.length&&M.reduce(j),k}function l(A,M){let k={};function j(U,H,J,W,$){let z;n.range(H,J).forEach(L=>{z=U[L],A.node(z).dummy&&A.predecessors(z).forEach(P=>{let q=A.node(P);q.dummy&&(q.order<W||q.order>$)&&h(k,P,z)})})}function F(U,H){let J=-1,W,$=0;return H.forEach((z,L)=>{if(A.node(z).dummy==="border"){let P=A.predecessors(z);P.length&&(W=A.node(P[0]).order,j(H,$,L,J,W),$=L,J=W)}j(H,$,H.length,W,U.length)}),H}return M.length&&M.reduce(F),k}function c(A,M){if(A.node(M).dummy)return A.predecessors(M).find(k=>A.node(k).dummy)}function h(A,M,k){if(M>k){let F=M;M=k,k=F}let j=A[M];j||(A[M]=j={}),j[k]=!0}function f(A,M,k){if(M>k){let j=M;M=k,k=j}return!!A[M]&&Object.hasOwn(A[M],k)}function d(A,M,k,j){let F={},U={},H={};return M.forEach(J=>{J.forEach((W,$)=>{F[W]=W,U[W]=W,H[W]=$})}),M.forEach(J=>{let W=-1;J.forEach($=>{let z=j($);if(z.length){z=z.sort((P,q)=>H[P]-H[q]);let L=(z.length-1)/2;for(let P=Math.floor(L),q=Math.ceil(L);P<=q;++P){let T=z[P];U[$]===$&&W<H[T]&&!f(k,$,T)&&(U[T]=$,U[$]=F[$]=F[T],W=H[T])}}})}),{root:F,align:U}}function p(A,M,k,j,F){let U={},H=v(A,M,k,F),J=F?"borderLeft":"borderRight";function W(L,P){let q=H.nodes().slice(),T={},I=q.pop();for(;I;){if(T[I])L(I);else{T[I]=!0,q.push(I);for(let B of P(I))q.push(B)}I=q.pop()}}function $(L){U[L]=H.inEdges(L).reduce((P,q)=>Math.max(P,U[q.v]+H.edge(q)),0)}function z(L){let P=H.outEdges(L).reduce((T,I)=>Math.min(T,U[I.w]-H.edge(I)),Number.POSITIVE_INFINITY),q=A.node(L);P!==Number.POSITIVE_INFINITY&&q.borderType!==J&&(U[L]=Math.max(U[L],P))}return W($,H.predecessors.bind(H)),W(z,H.successors.bind(H)),Object.keys(j).forEach(L=>U[L]=U[k[L]]),U}function v(A,M,k,j){let F=new s,U=A.graph(),H=E(U.nodesep,U.edgesep,j);return M.forEach(J=>{let W;J.forEach($=>{let z=k[$];if(F.setNode(z),W){var L=k[W],P=F.edge(L,z);F.setEdge(L,z,Math.max(H(A,$,W),P||0))}W=$})}),F}function _(A,M){return Object.values(M).reduce((k,j)=>{let F=Number.NEGATIVE_INFINITY,U=Number.POSITIVE_INFINITY;Object.entries(j).forEach(([J,W])=>{let $=R(A,J)/2;F=Math.max(W+$,F),U=Math.min(W-$,U)});let H=F-U;return H<k[0]&&(k=[H,j]),k},[Number.POSITIVE_INFINITY,null])[1]}function y(A,M){let k=Object.values(M),j=n.applyWithChunking(Math.min,k),F=n.applyWithChunking(Math.max,k);["u","d"].forEach(U=>{["l","r"].forEach(H=>{let J=U+H,W=A[J];if(W===M)return;let $=Object.values(W),z=j-n.applyWithChunking(Math.min,$);H!=="l"&&(z=F-n.applyWithChunking(Math.max,$)),z&&(A[J]=n.mapValues(W,L=>L+z))})})}function b(A,M){return n.mapValues(A.ul,(k,j)=>{if(M)return A[M.toLowerCase()][j];{let F=Object.values(A).map(U=>U[j]).sort((U,H)=>U-H);return(F[1]+F[2])/2}})}function S(A){let M=n.buildLayerMatrix(A),k=Object.assign(o(A,M),l(A,M)),j={},F;["u","d"].forEach(H=>{F=H==="u"?M:Object.values(M).reverse(),["l","r"].forEach(J=>{J==="r"&&(F=F.map(L=>Object.values(L).reverse()));let W=(H==="u"?A.predecessors:A.successors).bind(A),$=d(A,F,k,W),z=p(A,F,$.root,$.align,J==="r");J==="r"&&(z=n.mapValues(z,L=>-L)),j[H+J]=z})});let U=_(A,j);return y(j,U),b(j,A.graph().align)}function E(A,M,k){return(j,F,U)=>{let H=j.node(F),J=j.node(U),W=0,$;if(W+=H.width/2,Object.hasOwn(H,"labelpos"))switch(H.labelpos.toLowerCase()){case"l":$=-H.width/2;break;case"r":$=H.width/2;break}if($&&(W+=k?$:-$),$=0,W+=(H.dummy?M:A)/2,W+=(J.dummy?M:A)/2,W+=J.width/2,Object.hasOwn(J,"labelpos"))switch(J.labelpos.toLowerCase()){case"l":$=J.width/2;break;case"r":$=-J.width/2;break}return $&&(W+=k?$:-$),$=0,W}}function R(A,M){return A.node(M).width}}),Qz=Ge((e,t)=>{var s=kt(),n=Zz().positionX;t.exports=o;function o(c){c=s.asNonCompoundGraph(c),l(c),Object.entries(n(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})}}),Jz=Ge((e,t)=>{var s=Lz(),n=Bz(),o=zz(),l=kt().normalizeRanks,c=jz(),h=kt().removeEmptyRanks,f=Hz(),d=Iz(),p=Vz(),v=Xz(),_=Qz(),y=kt(),b=ss().Graph;t.exports=S;function S(O,K={}){let Y=K.debugTiming?y.time:y.notime;return Y("layout",()=>{let ie=Y(" buildLayoutGraph",()=>W(O));return Y(" runLayout",()=>E(ie,Y,K)),Y(" updateInputGraph",()=>R(O,ie)),ie})}function E(O,K,Y){K(" makeSpaceForEdgeLabels",()=>$(O)),K(" removeSelfEdges",()=>X(O)),K(" acyclic",()=>s.run(O)),K(" nestingGraph.run",()=>f.run(O)),K(" rank",()=>o(y.asNonCompoundGraph(O))),K(" injectEdgeLabelProxies",()=>z(O)),K(" removeEmptyRanks",()=>h(O)),K(" nestingGraph.cleanup",()=>f.cleanup(O)),K(" normalizeRanks",()=>l(O)),K(" assignRankMinMax",()=>L(O)),K(" removeEdgeLabelProxies",()=>P(O)),K(" normalize.run",()=>n.run(O)),K(" parentDummyChains",()=>c(O)),K(" addBorderSegments",()=>d(O)),K(" order",()=>v(O,Y)),K(" insertSelfEdges",()=>N(O)),K(" adjustCoordinateSystem",()=>p.adjust(O)),K(" position",()=>_(O)),K(" positionSelfEdges",()=>Z(O)),K(" removeBorderNodes",()=>ee(O)),K(" normalize.undo",()=>n.undo(O)),K(" fixupEdgeLabelCoords",()=>I(O)),K(" undoCoordinateSystem",()=>p.undo(O)),K(" translateGraph",()=>q(O)),K(" assignNodeIntersects",()=>T(O)),K(" reversePoints",()=>B(O)),K(" acyclic.undo",()=>s.undo(O))}function R(O,K){O.nodes().forEach(Y=>{let ie=O.node(Y),ne=K.node(Y);ie&&(ie.x=ne.x,ie.y=ne.y,ie.order=ne.order,ie.rank=ne.rank,K.children(Y).length&&(ie.width=ne.width,ie.height=ne.height))}),O.edges().forEach(Y=>{let ie=O.edge(Y),ne=K.edge(Y);ie.points=ne.points,Object.hasOwn(ne,"x")&&(ie.x=ne.x,ie.y=ne.y)}),O.graph().width=K.graph().width,O.graph().height=K.graph().height}var A=["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},U=["minlen","weight","width","height","labeloffset"],H={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},J=["labelpos"];function W(O){let K=new b({multigraph:!0,compound:!0}),Y=V(O.graph());return K.setGraph(Object.assign({},M,se(Y,A),y.pick(Y,k))),O.nodes().forEach(ie=>{let ne=V(O.node(ie)),fe=se(ne,j);Object.keys(F).forEach(me=>{fe[me]===void 0&&(fe[me]=F[me])}),K.setNode(ie,fe),K.setParent(ie,O.parent(ie))}),O.edges().forEach(ie=>{let ne=V(O.edge(ie));K.setEdge(ie,Object.assign({},H,se(ne,U),y.pick(ne,J)))}),K}function $(O){let K=O.graph();K.ranksep/=2,O.edges().forEach(Y=>{let ie=O.edge(Y);ie.minlen*=2,ie.labelpos.toLowerCase()!=="c"&&(K.rankdir==="TB"||K.rankdir==="BT"?ie.width+=ie.labeloffset:ie.height+=ie.labeloffset)})}function z(O){O.edges().forEach(K=>{let Y=O.edge(K);if(Y.width&&Y.height){let ie=O.node(K.v),ne={rank:(O.node(K.w).rank-ie.rank)/2+ie.rank,e:K};y.addDummyNode(O,"edge-proxy",ne,"_ep")}})}function L(O){let K=0;O.nodes().forEach(Y=>{let ie=O.node(Y);ie.borderTop&&(ie.minRank=O.node(ie.borderTop).rank,ie.maxRank=O.node(ie.borderBottom).rank,K=Math.max(K,ie.maxRank))}),O.graph().maxRank=K}function P(O){O.nodes().forEach(K=>{let Y=O.node(K);Y.dummy==="edge-proxy"&&(O.edge(Y.e).labelRank=Y.rank,O.removeNode(K))})}function q(O){let K=Number.POSITIVE_INFINITY,Y=0,ie=Number.POSITIVE_INFINITY,ne=0,fe=O.graph(),me=fe.marginx||0,we=fe.marginy||0;function Ce(Oe){let xe=Oe.x,Ae=Oe.y,ht=Oe.width,Xt=Oe.height;K=Math.min(K,xe-ht/2),Y=Math.max(Y,xe+ht/2),ie=Math.min(ie,Ae-Xt/2),ne=Math.max(ne,Ae+Xt/2)}O.nodes().forEach(Oe=>Ce(O.node(Oe))),O.edges().forEach(Oe=>{let xe=O.edge(Oe);Object.hasOwn(xe,"x")&&Ce(xe)}),K-=me,ie-=we,O.nodes().forEach(Oe=>{let xe=O.node(Oe);xe.x-=K,xe.y-=ie}),O.edges().forEach(Oe=>{let xe=O.edge(Oe);xe.points.forEach(Ae=>{Ae.x-=K,Ae.y-=ie}),Object.hasOwn(xe,"x")&&(xe.x-=K),Object.hasOwn(xe,"y")&&(xe.y-=ie)}),fe.width=Y-K+me,fe.height=ne-ie+we}function T(O){O.edges().forEach(K=>{let Y=O.edge(K),ie=O.node(K.v),ne=O.node(K.w),fe,me;Y.points?(fe=Y.points[0],me=Y.points[Y.points.length-1]):(Y.points=[],fe=ne,me=ie),Y.points.unshift(y.intersectRect(ie,fe)),Y.points.push(y.intersectRect(ne,me))})}function I(O){O.edges().forEach(K=>{let Y=O.edge(K);if(Object.hasOwn(Y,"x"))switch((Y.labelpos==="l"||Y.labelpos==="r")&&(Y.width-=Y.labeloffset),Y.labelpos){case"l":Y.x-=Y.width/2+Y.labeloffset;break;case"r":Y.x+=Y.width/2+Y.labeloffset;break}})}function B(O){O.edges().forEach(K=>{let Y=O.edge(K);Y.reversed&&Y.points.reverse()})}function ee(O){O.nodes().forEach(K=>{if(O.children(K).length){let Y=O.node(K),ie=O.node(Y.borderTop),ne=O.node(Y.borderBottom),fe=O.node(Y.borderLeft[Y.borderLeft.length-1]),me=O.node(Y.borderRight[Y.borderRight.length-1]);Y.width=Math.abs(me.x-fe.x),Y.height=Math.abs(ne.y-ie.y),Y.x=fe.x+Y.width/2,Y.y=ie.y+Y.height/2}}),O.nodes().forEach(K=>{O.node(K).dummy==="border"&&O.removeNode(K)})}function X(O){O.edges().forEach(K=>{if(K.v===K.w){var Y=O.node(K.v);Y.selfEdges||(Y.selfEdges=[]),Y.selfEdges.push({e:K,label:O.edge(K)}),O.removeEdge(K)}})}function N(O){var K=y.buildLayerMatrix(O);K.forEach(Y=>{var ie=0;Y.forEach((ne,fe)=>{var me=O.node(ne);me.order=fe+ie,(me.selfEdges||[]).forEach(we=>{y.addDummyNode(O,"selfedge",{width:we.label.width,height:we.label.height,rank:me.rank,order:fe+ ++ie,e:we.e,label:we.label},"_se")}),delete me.selfEdges})})}function Z(O){O.nodes().forEach(K=>{var Y=O.node(K);if(Y.dummy==="selfedge"){var ie=O.node(Y.e.v),ne=ie.x+ie.width/2,fe=ie.y,me=Y.x-ne,we=ie.height/2;O.setEdge(Y.e,Y.label),O.removeNode(K),Y.label.points=[{x:ne+2*me/3,y:fe-we},{x:ne+5*me/6,y:fe-we},{x:ne+me,y:fe},{x:ne+5*me/6,y:fe+we},{x:ne+2*me/3,y:fe+we}],Y.label.x=Y.x,Y.label.y=Y.y}})}function se(O,K){return y.mapValues(y.pick(O,K),Number)}function V(O){var K={};return O&&Object.entries(O).forEach(([Y,ie])=>{typeof Y=="string"&&(Y=Y.toLowerCase()),K[Y]=ie}),K}}),ej=Ge((e,t)=>{var s=kt(),n=ss().Graph;t.exports={debugOrdering:o};function o(l){let c=s.buildLayerMatrix(l),h=new n({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}}),tj=Ge((e,t)=>{t.exports="2.0.4"}),ij=Ge((e,t)=>{t.exports={graphlib:ss(),layout:Jz(),debug:ej(),util:{time:kt().time,notime:kt().notime},version:tj()}});const Kw=ij();const sj={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"}},nj={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"}},Yw={0:"#f85149",1:"#e3b341",2:"#58a6ff",3:"#7d8590",4:"#484f58"},rj={bg:"#1c1c1c",border:"#484f58",text:"#8b949e"},oj={bg:"#f6f8fa",border:"#d0d7de",text:"#57606a"},br=200,ko=62,mu=40;function yv(e){return typeof e=="string"?{depends_on_id:e,type:"blocks"}:{depends_on_id:e.depends_on_id,type:e.type||"blocks"}}function aj(e){const t=new Kw.graphlib.Graph;t.setGraph({rankdir:"TB",nodesep:40,ranksep:60,marginx:mu,marginy:mu}),t.setDefaultEdgeLabel(()=>({}));const s=new Map(e.map(d=>[d.id,d]));for(const d of e)t.setNode(d.id,{width:br,height:ko});const n=new Map;for(const d of e)if(d.dependencies)for(const p of d.dependencies){const v=yv(p);if(s.has(v.depends_on_id)){const _=`${d.id}|${v.depends_on_id}`;n.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}`;n.has(p)||(n.set(p,"parent-child"),t.setEdge(d.parent,d.id))}Kw.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:n.get(v)||"blocks",points:p.points})}}const c=t.graph(),h=(c?.width||800)+mu*2,f=(c?.height||600)+mu*2;return{nodes:o,edges:l,width:h,height:f}}function bT(e,t,s=new Set){if(s.has(e))return s;s.add(e);const n=t.get(e);if(n?.dependencies)for(const o of n.dependencies){const l=yv(o);t.has(l.depends_on_id)&&bT(l.depends_on_id,t,s)}return s}function ST(e,t,s=new Set){if(s.has(e))return s;s.add(e);const n=t.get(e)||[];for(const o of n)ST(o,t,s);return s}function lj(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 n=1;n<e.length-1;n++){const o=e[n],l=e[n+1],c=(o.x+l.x)/2,h=(o.y+l.y)/2;n===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 cj(e,t){return e.length<=t?e:e.slice(0,t-1)+"…"}function uj({issues:e,onNodeClick:t}){const s=x.useRef(null),[n,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?sj:nj,y=p?rj:oj,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=yv(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(()=>aj(e),[e]),R=x.useMemo(()=>{if(!n)return null;const z=bT(n,b),L=ST(n,S);return new Set([...z,...L])},[n,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,I=(P-z*T)/2,B=(q-L*T)/2;c({x:I,y:B,scale:T})},[E]);const A=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 I=z.clientX-T.left,B=z.clientY-T.top;return{scale:q,x:I-(I-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]),U=p?"#0d1117":"#ffffff",H=p?"rgba(255,255,255,0.03)":"rgba(0,0,0,0.04)",J=p?"rgba(139,148,158,0.3)":"rgba(87,96,106,0.25)",W=p?"rgba(136,192,255,0.7)":"rgba(31,111,235,0.6)",$=p?"rgba(139,148,158,0.08)":"rgba(87,96,106,0.08)";return e.length===0?w.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:"No issues to display"}):w.jsxs("div",{ref:s,className:"w-full h-full relative overflow-hidden",style:{background:U,cursor:h?"grabbing":"grab"},onWheel:A,onMouseDown:M,onMouseMove:k,onMouseUp:j,onMouseLeave:j,children:[w.jsxs("svg",{width:"100%",height:"100%",style:{position:"absolute",top:0,left:0},children:[w.jsxs("defs",{children:[w.jsx("pattern",{id:"dag-grid",width:"20",height:"20",patternUnits:"userSpaceOnUse",patternTransform:`translate(${l.x},${l.y}) scale(${l.scale})`,children:w.jsx("circle",{cx:"10",cy:"10",r:"0.5",fill:H})}),w.jsx("marker",{id:"dag-arrow",viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto-start-reverse",children:w.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:J})}),w.jsx("marker",{id:"dag-arrow-highlight",viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto-start-reverse",children:w.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:W})}),w.jsx("marker",{id:"dag-arrow-dim",viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto-start-reverse",children:w.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:$})}),w.jsxs("filter",{id:"dag-glow",children:[w.jsx("feGaussianBlur",{stdDeviation:"3",result:"coloredBlur"}),w.jsxs("feMerge",{children:[w.jsx("feMergeNode",{in:"coloredBlur"}),w.jsx("feMergeNode",{in:"SourceGraphic"})]})]})]}),w.jsx("rect",{width:"100%",height:"100%",fill:"url(#dag-grid)"}),w.jsxs("g",{transform:`translate(${l.x},${l.y}) scale(${l.scale})`,children:[E.edges.map((z,L)=>{const P=R?R.has(z.from)&&R.has(z.to):!1,q=R!==null&&!P,T=q?$:P?W:J,I=q?"dag-arrow-dim":P?"dag-arrow-highlight":"dag-arrow",B=z.type==="parent-child";return w.jsx("path",{d:lj(z.points),fill:"none",stroke:T,strokeWidth:P?2:1.5,strokeDasharray:B?"6 3":void 0,markerEnd:`url(#${I})`,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=n===z.id,T=R?R.has(z.id):!1,B=R!==null&&!T?.2:1,ee=Yw[z.issue.priority]||Yw[3];return w.jsxs("g",{className:"dag-node",transform:`translate(${z.x-br/2},${z.y-ko/2})`,onClick:()=>F(z.id),style:{cursor:"pointer",opacity:B,transition:"opacity 0.3s"},children:[w.jsx("rect",{width:br,height:ko,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"}}),w.jsx("rect",{x:0,y:0,width:4,height:ko,rx:2,fill:P.border}),w.jsx("circle",{cx:br-12,cy:ko/2,r:4,fill:ee,opacity:.8}),w.jsx("text",{x:br-12,y:ko/2+3.5,fill:p?"#0d1117":"#ffffff",fontSize:7,fontFamily:"system-ui, sans-serif",fontWeight:700,textAnchor:"middle",children:z.issue.priority}),w.jsx("text",{x:14,y:20,fill:P.text,fontSize:11,fontFamily:"ui-monospace, SFMono-Regular, monospace",fontWeight:600,children:z.issue.id}),w.jsx("text",{x:14,y:40,fill:p?"#c9d1d9":"#1f2328",fontSize:11,fontFamily:"system-ui, -apple-system, sans-serif",children:cj(z.issue.title,24)}),w.jsx("rect",{x:br-80,y:6,width:56,height:18,rx:9,fill:P.border,opacity:.3}),w.jsx("text",{x:br-52,y:18,fill:P.text,fontSize:9,fontFamily:"system-ui, sans-serif",textAnchor:"middle",children:L.replace("_"," ")})]},z.id)})]})]}),w.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:[w.jsx("div",{className:"font-semibold text-foreground mb-1",children:"Status"}),Object.entries(_).map(([z,L])=>w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("span",{className:"inline-block w-3 h-3 rounded-sm",style:{background:L.border}}),w.jsx("span",{style:{color:L.text},children:z.replace("_"," ")})]},z)),w.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:[w.jsx("div",{className:"font-semibold text-foreground mb-1",children:"Edges"}),w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("svg",{width:"24",height:"8",children:w.jsx("line",{x1:"0",y1:"4",x2:"24",y2:"4",stroke:J,strokeWidth:"1.5"})}),w.jsx("span",{className:"text-muted-foreground",children:"blocks"})]}),w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("svg",{width:"24",height:"8",children:w.jsx("line",{x1:"0",y1:"4",x2:"24",y2:"4",stroke:J,strokeWidth:"1.5",strokeDasharray:"4 2"})}),w.jsx("span",{className:"text-muted-foreground",children:"parent-child"})]})]}),w.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:w.jsx("span",{className:"text-muted-foreground",children:"Click node to highlight deps"})})]}),w.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 hj=[{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"}],dj=[{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 fj({filters:e,onFiltersChange:t,issues:s,searchInput:n,onSearchChange:o}){const l=x.useMemo(()=>{const h=new Set;for(const f of s)f.assignee&&h.add(f.assignee);return Array.from(h).sort()},[s]),c=e.priority!=="all"||e.type!=="all"||e.assignee!=="all"||e.search?.length>0;return w.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-b border-border shrink-0",children:[w.jsxs("div",{className:"relative",children:[w.jsx(I5,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground pointer-events-none"}),w.jsx("input",{type:"text",value:n,onChange:h=>o(h.target.value),placeholder:"Search beads...",className:"h-8 w-48 rounded-md border border-border bg-muted/50 pl-8 pr-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring focus:border-ring transition-colors"})]}),w.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Filters"}),w.jsxs(Cu,{value:e.priority,onValueChange:h=>t({...e,priority:h}),children:[w.jsx(Tu,{size:"sm",className:"w-[130px]",children:w.jsx(Eu,{})}),w.jsx(ku,{children:hj.map(h=>w.jsx(il,{value:h.value,children:h.label},h.value))})]}),w.jsxs(Cu,{value:e.type,onValueChange:h=>t({...e,type:h}),children:[w.jsx(Tu,{size:"sm",className:"w-[130px]",children:w.jsx(Eu,{})}),w.jsx(ku,{children:dj.map(h=>w.jsx(il,{value:h.value,children:h.label},h.value))})]}),w.jsxs(Cu,{value:e.assignee,onValueChange:h=>t({...e,assignee:h}),children:[w.jsx(Tu,{size:"sm",className:"w-[150px]",children:w.jsx(Eu,{})}),w.jsxs(ku,{children:[w.jsx(il,{value:"all",children:"All Assignees"}),l.map(h=>w.jsx(il,{value:h,children:h},h))]})]}),c&&w.jsx("button",{onClick:()=>t({priority:"all",type:"all",assignee:"all",search:""}),className:"text-xs text-muted-foreground hover:text-foreground transition-colors underline underline-offset-2",children:"Clear"})]})}function Bm(e,t){const s=t.search?.toLowerCase().trim()||"";return e.filter(n=>!(t.priority!=="all"&&String(n.priority)!==t.priority||t.type!=="all"&&n.type!==t.type||t.assignee!=="all"&&n.assignee!==t.assignee||s&&!`${n.id} ${n.title} ${n.description||""}`.toLowerCase().includes(s)))}var wT=Object.defineProperty,mj=Object.getOwnPropertyDescriptor,pj=(e,t)=>{for(var s in t)wT(e,s,{get:t[s],enumerable:!0})},gt=(e,t,s,n)=>{for(var o=n>1?void 0:n?mj(t,s):t,l=e.length-1,c;l>=0;l--)(c=e[l])&&(o=(n?c(t,s,o):c(o))||o);return n&&o&&wT(t,s,o),o},ge=(e,t)=>(s,n)=>t(s,n,e),qw="Terminal input",Lp={get:()=>qw,set:e=>qw=e},$w="Too much output to announce, navigate to rows manually to read",Bp={get:()=>$w,set:e=>$w=e};function gj(e){return e.replace(/\r?\n/g,"\r")}function vj(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function _j(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function yj(e,t,s,n){if(e.stopPropagation(),e.clipboardData){let o=e.clipboardData.getData("text/plain");xT(o,t,s,n)}}function xT(e,t,s,n){e=gj(e),e=vj(e,s.decPrivateModes.bracketedPasteMode&&n.rawOptions.ignoreBracketedPasteMode!==!0),s.triggerDataEvent(e,!0),t.value=""}function CT(e,t,s){let n=s.getBoundingClientRect(),o=e.clientX-n.left-10,l=e.clientY-n.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 Gw(e,t,s,n,o){CT(e,t,s),o&&n.rightClickSelect(e),t.value=n.selectionText,t.select()}function Pn(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function Bh(e,t=0,s=e.length){let n="";for(let o=t;o<s;++o){let l=e[o];l>65535?(l-=65536,n+=String.fromCharCode((l>>10)+55296)+String.fromCharCode(l%1024+56320)):n+=String.fromCharCode(l)}return n}var bj=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let s=e.length;if(!s)return 0;let n=0,o=0;if(this._interim){let l=e.charCodeAt(o++);56320<=l&&l<=57343?t[n++]=(this._interim-55296)*1024+l-56320+65536:(t[n++]=this._interim,t[n++]=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,n;let h=e.charCodeAt(l);56320<=h&&h<=57343?t[n++]=(c-55296)*1024+h-56320+65536:(t[n++]=c,t[n++]=h);continue}c!==65279&&(t[n++]=c)}return n}},Sj=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let s=e.length;if(!s)return 0;let n=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,R=E-b;for(;d<R;){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[n++]=y:E===3?y<2048||y>=55296&&y<=57343||y===65279||(t[n++]=y):y<65536||y>1114111||(t[n++]=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[n++]=o,t[n++]=l,t[n++]=c,t[n++]=h,v+=4;if(o=e[v++],o<128)t[n++]=o;else if((o&224)===192){if(v>=s)return this.interim[0]=o,n;if(l=e[v++],(l&192)!==128){v--;continue}if(f=(o&31)<<6|l&63,f<128){v--;continue}t[n++]=f}else if((o&240)===224){if(v>=s)return this.interim[0]=o,n;if(l=e[v++],(l&192)!==128){v--;continue}if(v>=s)return this.interim[0]=o,this.interim[1]=l,n;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[n++]=f}else if((o&248)===240){if(v>=s)return this.interim[0]=o,n;if(l=e[v++],(l&192)!==128){v--;continue}if(v>=s)return this.interim[0]=o,this.interim[1]=l,n;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,n;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[n++]=f}}return n}},ET="",jn=" ",Nl=class TT{constructor(){this.fg=0,this.bg=0,this.extended=new ah}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 TT;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}},ah=class kT{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 kT(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Yi=class RT extends Nl{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new ah,this.combinedData=""}static fromCharData(t){let s=new RT;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?Pn(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 n=t[1].charCodeAt(0);if(55296<=n&&n<=56319){let o=t[1].charCodeAt(1);56320<=o&&o<=57343?this.content=(n-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()]}},Xw="di$target",Pp="di$dependencies",Pm=new Map;function wj(e){return e[Pp]||[]}function It(e){if(Pm.has(e))return Pm.get(e);let t=function(s,n,o){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");xj(t,s,o)};return t._id=e,Pm.set(e,t),t}function xj(e,t,s){t[Xw]===t?t[Pp].push({id:e,index:s}):(t[Pp]=[{id:e,index:s}],t[Xw]=t)}var oi=It("BufferService"),AT=It("CoreMouseService"),Br=It("CoreService"),Cj=It("CharsetService"),bv=It("InstantiationService"),MT=It("LogService"),ai=It("OptionsService"),DT=It("OscLinkService"),Ej=It("UnicodeService"),Ll=It("DecorationService"),zp=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 n=[],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||n.push({text:v,range:_,activate:(b,S)=>o?o.activate(b,S,_):Tj(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(n)}};zp=gt([ge(0,oi),ge(1,ai),ge(2,DT)],zp);function Tj(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
63
|
+
|
|
64
|
+
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 Ph=It("CharSizeService"),Js=It("CoreBrowserService"),Sv=It("MouseService"),en=It("RenderService"),kj=It("SelectionService"),OT=It("CharacterJoinerService"),Zo=It("ThemeService"),NT=It("LinkProviderService"),Rj=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Zw.isErrorNoTelemetry(e)?new Zw(e.message+`
|
|
65
|
+
|
|
66
|
+
`+e.stack):new Error(e.message+`
|
|
67
|
+
|
|
68
|
+
`+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)}},Aj=new Rj;function Pu(e){Mj(e)||Aj.onUnexpectedError(e)}var jp="Canceled";function Mj(e){return e instanceof Dj?!0:e instanceof Error&&e.name===jp&&e.message===jp}var Dj=class extends Error{constructor(){super(jp),this.name=this.message}};function Oj(e){return new Error(`Illegal argument: ${e}`)}var Zw=class Hp extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof Hp)return t;let s=new Hp;return s.message=t.message,s.stack=t.stack,s}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},Ip=class LT extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,LT.prototype)}};function Ei(e,t=0){return e[e.length-(1+t)]}var Nj;(e=>{function t(l){return l<0}e.isLessThan=t;function s(l){return l<=0}e.isLessThanOrEqual=s;function n(l){return l>0}e.isGreaterThan=n;function o(l){return l===0}e.isNeitherLessOrGreaterThan=o,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(Nj||={});function Lj(e,t){let s=this,n=!1,o;return function(){return n||(n=!0,t||(o=e.apply(s,arguments))),o}}var BT;(e=>{function t(k){return k&&typeof k=="object"&&typeof k[Symbol.iterator]=="function"}e.is=t;let s=Object.freeze([]);function n(){return s}e.empty=n;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 U of k)if(j(U,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 U of k)yield j(U,F++)}e.map=y;function*b(k,j){let F=0;for(let U of k)yield*j(U,F++)}e.flatMap=b;function*S(...k){for(let j of k)yield*j}e.concat=S;function E(k,j,F){let U=F;for(let H of k)U=j(U,H);return U}e.reduce=E;function*R(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=R;function A(k,j=Number.POSITIVE_INFINITY){let F=[];if(j===0)return[F,k];let U=k[Symbol.iterator]();for(let H=0;H<j;H++){let J=U.next();if(J.done)return[F,e.empty()];F.push(J.value)}return[F,{[Symbol.iterator](){return U}}]}e.consume=A;async function M(k){let j=[];for await(let F of k)j.push(F);return Promise.resolve(j)}e.asyncToArray=M})(BT||={});function Or(e){if(BT.is(e)){let t=[];for(let s of e)if(s)try{s.dispose()}catch(n){t.push(n)}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 Bj(...e){return at(()=>Or(e))}function at(e){return{dispose:Lj(()=>{e()})}}var PT=class zT{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{Or(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?zT.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)}};PT.DISABLE_DISPOSED_WARNING=!1;var Hn=PT,ze=class{constructor(){this._store=new Hn,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)}};ze.None=Object.freeze({dispose(){}});var Wo=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}},qs=typeof window=="object"?window:globalThis,Vp=class Up{constructor(t){this.element=t,this.next=Up.Undefined,this.prev=Up.Undefined}};Vp.Undefined=new Vp(void 0);var lt=Vp,Qw=class{constructor(){this._first=lt.Undefined,this._last=lt.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===lt.Undefined}clear(){let e=this._first;for(;e!==lt.Undefined;){let t=e.next;e.prev=lt.Undefined,e.next=lt.Undefined,e=t}this._first=lt.Undefined,this._last=lt.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let s=new lt(e);if(this._first===lt.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 n=!1;return()=>{n||(n=!0,this._remove(s))}}shift(){if(this._first!==lt.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==lt.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==lt.Undefined&&e.next!==lt.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===lt.Undefined&&e.next===lt.Undefined?(this._first=lt.Undefined,this._last=lt.Undefined):e.next===lt.Undefined?(this._last=this._last.prev,this._last.next=lt.Undefined):e.prev===lt.Undefined&&(this._first=this._first.next,this._first.prev=lt.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==lt.Undefined;)yield e.element,e=e.next}},Pj=globalThis.performance&&typeof globalThis.performance.now=="function",zj=class jT{static create(t){return new jT(t)}constructor(t){this._now=Pj&&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}},$t;(e=>{e.None=()=>ze.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,I;return I=z(B=>{if(!T)return I?I.dispose():T=!0,L.call(P,B)},null,q),T&&I.dispose(),I}}e.once=s;function n(z,L,P){return d((q,T=null,I)=>z(B=>q.call(T,L(B)),null,I),P)}e.map=n;function o(z,L,P){return d((q,T=null,I)=>z(B=>{L(B),q.call(T,B)},null,I),P)}e.forEach=o;function l(z,L,P){return d((q,T=null,I)=>z(B=>L(B)&&q.call(T,B),null,I),P)}e.filter=l;function c(z){return z}e.signal=c;function h(...z){return(L,P=null,q)=>{let T=Bj(...z.map(I=>I(B=>L.call(P,B))));return p(T,q)}}e.any=h;function f(z,L,P,q){let T=P;return n(z,I=>(T=L(T,I),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,I,B){let ee,X,N,Z=0,se,V={leakWarningThreshold:I,onWillAddFirstListener(){ee=z(K=>{Z++,X=L(X,K),q&&!N&&(O.fire(X),X=void 0),se=()=>{let Y=X;X=void 0,N=void 0,(!q||Z>1)&&O.fire(Y),Z=0},typeof P=="number"?(clearTimeout(N),N=setTimeout(se,P)):N===void 0&&(N=0,queueMicrotask(se))})},onWillRemoveListener(){T&&Z>0&&se?.()},onDidRemoveLastListener(){se=void 0,ee.dispose()}},O=new pe(V);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,I=>{let B=q||!L(I,T);return q=!1,T=I,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(),I=z(X=>{T?T.push(X):ee.fire(X)});q&&q.add(I);let B=()=>{T?.forEach(X=>ee.fire(X)),T=null},ee=new pe({onWillAddFirstListener(){I||(I=z(X=>ee.fire(X)),q&&q.add(I))},onDidAddFirstListener(){T&&(L?setTimeout(B):B())},onDidRemoveLastListener(){I&&I.dispose(),I=null}});return q&&q.add(ee),ee.event}e.buffer=S;function E(z,L){return(P,q,T)=>{let I=L(new A);return z(function(B){let ee=I.evaluate(B);ee!==R&&P.call(q,ee)},void 0,T)}}e.chain=E;let R=Symbol("HaltChainable");class A{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:R),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 I=P||!L(T,q);return P=!1,q=T,I?T:R}),this}evaluate(L){for(let P of this.steps)if(L=P(L),L===R)break;return L}}function M(z,L,P=q=>q){let q=(...ee)=>B.fire(P(...ee)),T=()=>z.on(L,q),I=()=>z.removeListener(L,q),B=new pe({onWillAddFirstListener:T,onDidRemoveLastListener:I});return B.event}e.fromNodeEventEmitter=M;function k(z,L,P=q=>q){let q=(...ee)=>B.fire(P(...ee)),T=()=>z.addEventListener(L,q),I=()=>z.removeEventListener(L,q),B=new pe({onWillAddFirstListener:T,onDidRemoveLastListener:I});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 U(z,L){return z(P=>L.fire(P))}e.forward=U;function H(z,L,P){return L(P),z(q=>L(q))}e.runAndSubscribe=H;class J{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 W(z,L){return new J(z,L).emitter.event}e.fromObservable=W;function $(z){return(L,P,q)=>{let T=0,I=!1,B={beginUpdate(){T++},endUpdate(){T--,T===0&&(z.reportChanges(),I&&(I=!1,L.call(P)))},handlePossibleChange(){},handleChange(){I=!0}};z.addObserver(B),z.reportChanges();let ee={dispose(){z.removeObserver(B)}};return q instanceof Hn?q.add(ee):Array.isArray(q)&&q.push(ee),ee}}e.fromObservableLight=$})($t||={});var Fp=class Wp{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${Wp._idPool++}`,Wp.all.add(this)}start(t){this._stopWatch=new zj,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}}};Fp.all=new Set,Fp._idPool=0;var jj=Fp,Hj=-1,HT=class IT{constructor(t,s,n=(IT._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=s,this.name=n,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(t,s){let n=this.threshold;if(n<=0||s<n)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=n*.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 Uj(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[n,o]of this._stacks)(!t||s<o)&&(t=[n,o],s=o);return t}};HT._idPool=1;var Ij=HT,Vj=class VT{constructor(t){this.value=t}static create(){let t=new Error;return new VT(t.stack??"")}print(){console.warn(this.value.split(`
|
|
69
|
+
`).slice(2).join(`
|
|
70
|
+
`))}},Uj=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},Fj=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},Wj=0,zm=class{constructor(e){this.value=e,this.id=Wj++}},Kj=2,Yj,pe=class{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new Ij(e?.onListenerError??Pu,this._options?.leakWarningThreshold??Hj):void 0,this._perfMon=this._options?._profName?new jj(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 Fj(`${c}. HINT: Stack shows most frequent listener (${h[1]}-times)`,h[0]);return(this._options?.onListenerError||Pu)(f),ze.None}if(this._disposed)return ze.None;t&&(e=e.bind(t));let n=new zm(e),o;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(n.stack=Vj.create(),o=this._leakageMon.check(n.stack,this._size+1)),this._listeners?this._listeners instanceof zm?(this._deliveryQueue??=new qj,this._listeners=[this._listeners,n]):this._listeners.push(n):(this._options?.onWillAddFirstListener?.(this),this._listeners=n,this._options?.onDidAddFirstListener?.(this)),this._size++;let l=at(()=>{o?.(),this._removeListener(n)});return s instanceof Hn?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 n=this._deliveryQueue.current===this;if(this._size*Kj<=t.length){let o=0;for(let l=0;l<t.length;l++)t[l]?t[o++]=t[l]:n&&(this._deliveryQueue.end--,o<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=o}}_deliver(e,t){if(!e)return;let s=this._options?.onListenerError||Pu;if(!s){e.value(t);return}try{e.value(t)}catch(n){s(n)}}_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 zm)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}},qj=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}},Kp=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 n=this.getWindowId(s);this.mapWindowIdToZoomLevel.set(n,t),this._onDidChangeZoomLevel.fire(n)}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 n=this.getWindowId(s);this.mapWindowIdToFullScreen.set(n,t),this._onDidChangeFullscreen.fire(n)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};Kp.INSTANCE=new Kp;var wv=Kp;function $j(e,t,s){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",s)}wv.INSTANCE.onDidChangeZoomLevel;function Gj(e){return wv.INSTANCE.getZoomFactor(e)}wv.INSTANCE.onDidChangeFullscreen;var Qo=typeof navigator=="object"?navigator.userAgent:"",Yp=Qo.indexOf("Firefox")>=0,Xj=Qo.indexOf("AppleWebKit")>=0,xv=Qo.indexOf("Chrome")>=0,Zj=!xv&&Qo.indexOf("Safari")>=0;Qo.indexOf("Electron/")>=0;Qo.indexOf("Android")>=0;var jm=!1;if(typeof qs.matchMedia=="function"){let e=qs.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=qs.matchMedia("(display-mode: fullscreen)");jm=e.matches,$j(qs,e,({matches:s})=>{jm&&t.matches||(jm=s)})}var No="en",qp=!1,$p=!1,zu=!1,UT=!1,pu,ju=No,Jw=No,Qj,Ys,kr=globalThis,ki;typeof kr.vscode<"u"&&typeof kr.vscode.process<"u"?ki=kr.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(ki=process);var Jj=typeof ki?.versions?.electron=="string",e8=Jj&&ki?.type==="renderer";if(typeof ki=="object"){qp=ki.platform==="win32",$p=ki.platform==="darwin",zu=ki.platform==="linux",zu&&ki.env.SNAP&&ki.env.SNAP_REVISION,ki.env.CI||ki.env.BUILD_ARTIFACTSTAGINGDIRECTORY,pu=No,ju=No;let e=ki.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);pu=t.userLocale,Jw=t.osLocale,ju=t.resolvedLanguage||No,Qj=t.languagePack?.translationsConfigFile}catch{}UT=!0}else typeof navigator=="object"&&!e8?(Ys=navigator.userAgent,qp=Ys.indexOf("Windows")>=0,$p=Ys.indexOf("Macintosh")>=0,(Ys.indexOf("Macintosh")>=0||Ys.indexOf("iPad")>=0||Ys.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,zu=Ys.indexOf("Linux")>=0,Ys?.indexOf("Mobi")>=0,ju=globalThis._VSCODE_NLS_LANGUAGE||No,pu=navigator.language.toLowerCase(),Jw=pu):console.error("Unable to resolve platform.");var FT=qp,bs=$p,t8=zu,ex=UT,ws=Ys,Mn=ju,i8;(e=>{function t(){return Mn}e.value=t;function s(){return Mn.length===2?Mn==="en":Mn.length>=3?Mn[0]==="e"&&Mn[1]==="n"&&Mn[2]==="-":!1}e.isDefaultVariant=s;function n(){return Mn==="en"}e.isDefault=n})(i8||={});var s8=typeof kr.postMessage=="function"&&!kr.importScripts;(()=>{if(s8){let e=[];kr.addEventListener("message",s=>{if(s.data&&s.data.vscodeScheduleAsyncWork)for(let n=0,o=e.length;n<o;n++){let l=e[n];if(l.id===s.data.vscodeScheduleAsyncWork){e.splice(n,1),l.callback();return}}});let t=0;return s=>{let n=++t;e.push({id:n,callback:s}),kr.postMessage({vscodeScheduleAsyncWork:n},"*")}}return e=>setTimeout(e)})();var n8=!!(ws&&ws.indexOf("Chrome")>=0);ws&&ws.indexOf("Firefox")>=0;!n8&&ws&&ws.indexOf("Safari")>=0;ws&&ws.indexOf("Edg/")>=0;ws&&ws.indexOf("Android")>=0;var Co=typeof navigator=="object"?navigator:{};ex||document.queryCommandSupported&&document.queryCommandSupported("copy")||Co&&Co.clipboard&&Co.clipboard.writeText,ex||Co&&Co.clipboard&&Co.clipboard.readText;var Cv=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}},Hm=new Cv,tx=new Cv,ix=new Cv,r8=new Array(230),WT;(e=>{function t(h){return Hm.keyCodeToStr(h)}e.toString=t;function s(h){return Hm.strToKeyCode(h)}e.fromString=s;function n(h){return tx.keyCodeToStr(h)}e.toUserSettingsUS=n;function o(h){return ix.keyCodeToStr(h)}e.toUserSettingsGeneral=o;function l(h){return tx.strToKeyCode(h)||ix.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 Hm.keyCodeToStr(h)}e.toElectronAccelerator=c})(WT||={});var o8=class KT{constructor(t,s,n,o,l){this.ctrlKey=t,this.shiftKey=s,this.altKey=n,this.metaKey=o,this.keyCode=l}equals(t){return t instanceof KT&&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",n=this.altKey?"1":"0",o=this.metaKey?"1":"0";return`K${t}${s}${n}${o}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new a8([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},a8=class{constructor(e){if(e.length===0)throw Oj("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 l8(e){if(e.charCode){let s=String.fromCharCode(e.charCode).toUpperCase();return WT.fromString(s)}let t=e.keyCode;if(t===3)return 7;if(Yp)switch(t){case 59:return 85;case 60:if(t8)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(bs)return 57;break}else if(Xj&&(bs&&t===93||!bs&&t===92))return 57;return r8[t]||0}var c8=bs?256:2048,u8=512,h8=1024,d8=bs?2048:256,sx=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=l8(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|=c8),this.altKey&&(t|=u8),this.shiftKey&&(t|=h8),this.metaKey&&(t|=d8),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new o8(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},nx=new WeakMap;function f8(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 m8=class{static getSameOriginWindowChain(e){let t=nx.get(e);if(!t){t=[],nx.set(e,t);let s=e,n;do n=f8(s),n?t.push({window:new WeakRef(s),iframeElement:s.frameElement||null}):t.push({window:new WeakRef(s),iframeElement:null}),s=n;while(s)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let s=0,n=0,o=this.getSameOriginWindowChain(e);for(let l of o){let c=l.window.deref();if(s+=c?.scrollY??0,n+=c?.scrollX??0,c===t||!l.iframeElement)break;let h=l.iframeElement.getBoundingClientRect();s+=h.top,n+=h.left}return{top:s,left:n}}},gu=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=m8.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=s.left,this.posy-=s.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},rx=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 n=!1;if(xv){let o=navigator.userAgent.match(/Chrome\/(\d+)/);n=(o?parseInt(o[1]):123)<=122}if(e){let o=e,l=e,c=e.view?.devicePixelRatio||1;if(typeof o.wheelDeltaY<"u")n?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?Yp&&!bs?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof o.wheelDeltaX<"u")Zj&&FT?this.deltaX=-(o.wheelDeltaX/120):n?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?Yp&&!bs?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(n?this.deltaY=e.wheelDelta/(120*c):this.deltaY=e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}},YT=Object.freeze(function(e,t){let s=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(s)}}}),p8;(e=>{function t(s){return s===e.None||s===e.Cancelled||s instanceof g8?!0:!s||typeof s!="object"?!1:typeof s.isCancellationRequested=="boolean"&&typeof s.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:$t.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:YT})})(p8||={});var g8=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?YT:(this._emitter||(this._emitter=new pe),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},Ev=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 Ip("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new Ip("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},v8=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 Ip("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let n=s.setInterval(()=>{e()},t);this.disposable=at(()=>{s.clearInterval(n),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},_8;(e=>{async function t(n){let o,l=await Promise.all(n.map(c=>c.then(h=>h,h=>{o||(o=h)})));if(typeof o<"u")throw o;return l}e.settled=t;function s(n){return new Promise(async(o,l)=>{try{await n(o,l)}catch(c){l(c)}})}e.withAsyncBody=s})(_8||={});var ox=class Ui{static fromArray(t){return new Ui(s=>{s.emitMany(t)})}static fromPromise(t){return new Ui(async s=>{s.emitMany(await t)})}static fromPromises(t){return new Ui(async s=>{await Promise.all(t.map(async n=>s.emitOne(await n)))})}static merge(t){return new Ui(async s=>{await Promise.all(t.map(async n=>{for await(let o of n)s.emitOne(o)}))})}constructor(t,s){this._state=0,this._results=[],this._error=null,this._onReturn=s,this._onStateChanged=new pe,queueMicrotask(async()=>{let n={emitOne:o=>this.emitOne(o),emitMany:o=>this.emitMany(o),reject:o=>this.reject(o)};try{await Promise.resolve(t(n)),this.resolve()}catch(o){this.reject(o)}finally{n.emitOne=void 0,n.emitMany=void 0,n.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 $t.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,s){return new Ui(async n=>{for await(let o of t)n.emitOne(s(o))})}map(t){return Ui.map(this,t)}static filter(t,s){return new Ui(async n=>{for await(let o of t)s(o)&&n.emitOne(o)})}filter(t){return Ui.filter(this,t)}static coalesce(t){return Ui.filter(t,s=>!!s)}coalesce(){return Ui.coalesce(this)}static async toPromise(t){let s=[];for await(let n of t)s.push(n);return s}toPromise(){return Ui.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())}};ox.EMPTY=ox.fromArray([]);var{getWindow:vs,getWindowId:y8,onDidRegisterWindow:b8}=(function(){let e=new Map,t={window:qs,disposables:new Hn};e.set(qs.vscodeWindowId,t);let s=new pe,n=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:n.event,registerWindow(c){if(e.has(c.vscodeWindowId))return ze.None;let h=new Hn,f={window:c,disposables:h.add(new Hn)};return e.set(c.vscodeWindowId,f),h.add(at(()=>{e.delete(c.vscodeWindowId),n.fire(c)})),h.add(ke(c,Pt.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:qs},getDocument(c){return vs(c).document}}})(),S8=class{constructor(e,t,s,n){this._node=e,this._type=t,this._handler=s,this._options=n||!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 ke(e,t,s,n){return new S8(e,t,s,n)}var ax=function(e,t,s,n){return ke(e,t,s,n)},Tv,w8=class extends v8{constructor(e){super(),this.defaultTarget=e&&vs(e)}cancelAndSet(e,t,s){return super.cancelAndSet(e,t,s??this.defaultTarget)}},lx=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){Pu(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,s=new Map,n=new Map,o=l=>{s.set(l,!1);let c=e.get(l)??[];for(t.set(l,c),e.set(l,[]),n.set(l,!0);c.length>0;)c.sort(lx.sort),c.shift().execute();n.set(l,!1)};Tv=(l,c,h=0)=>{let f=y8(l),d=new lx(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 x8(e){let t=e.getBoundingClientRect(),s=vs(e);return{left:t.left+s.scrollX,top:t.top+s.scrollY,width:t.width,height:t.height}}var Pt={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"},C8=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=pi(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=pi(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=pi(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=pi(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=pi(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=pi(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=pi(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=pi(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=pi(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=pi(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=pi(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=pi(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=pi(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=pi(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 pi(e){return typeof e=="number"?`${e}px`:e}function ml(e){return new C8(e)}var qT=class{constructor(){this._hooks=new Hn,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,n,o){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=n,this._onStopCallback=o;let l=e;try{e.setPointerCapture(t),this._hooks.add(at(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{l=vs(e)}this._hooks.add(ke(l,Pt.POINTER_MOVE,c=>{if(c.buttons!==s){this.stopMonitoring(!0);return}c.preventDefault(),this._pointerMoveCallback(c)})),this._hooks.add(ke(l,Pt.POINTER_UP,c=>this.stopMonitoring(!0)))}};function E8(e,t,s){let n=null,o=null;if(typeof s.value=="function"?(n="value",o=s.value,o.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof s.get=="function"&&(n="get",o=s.get),!o)throw new Error("not supported");let l=`$memoize$${t}`;s[n]=function(...c){return this.hasOwnProperty(l)||Object.defineProperty(this,l,{configurable:!1,enumerable:!1,writable:!1,value:o.apply(this,c)}),this[l]}}var fs;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(fs||={});var nl=class Qt extends ze{constructor(){super(),this.dispatched=!1,this.targets=new Qw,this.ignoreTargets=new Qw,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register($t.runAndSubscribe(b8,({window:t,disposables:s})=>{s.add(ke(t.document,"touchstart",n=>this.onTouchStart(n),{passive:!1})),s.add(ke(t.document,"touchend",n=>this.onTouchEnd(t,n))),s.add(ke(t.document,"touchmove",n=>this.onTouchMove(n),{passive:!1}))},{window:qs,disposables:this._store}))}static addTarget(t){if(!Qt.isTouchDevice())return ze.None;Qt.INSTANCE||(Qt.INSTANCE=new Qt);let s=Qt.INSTANCE.targets.push(t);return at(s)}static ignoreTarget(t){if(!Qt.isTouchDevice())return ze.None;Qt.INSTANCE||(Qt.INSTANCE=new Qt);let s=Qt.INSTANCE.ignoreTargets.push(t);return at(s)}static isTouchDevice(){return"ontouchstart"in qs||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 n=0,o=t.targetTouches.length;n<o;n++){let l=t.targetTouches.item(n);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(fs.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 n=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<Qt.HOLD_DELAY&&Math.abs(f.initialPageX-Ei(f.rollingPageX))<30&&Math.abs(f.initialPageY-Ei(f.rollingPageY))<30){let p=this.newGestureEvent(fs.Tap,f.initialTarget);p.pageX=Ei(f.rollingPageX),p.pageY=Ei(f.rollingPageY),this.dispatchEvent(p)}else if(d>=Qt.HOLD_DELAY&&Math.abs(f.initialPageX-Ei(f.rollingPageX))<30&&Math.abs(f.initialPageY-Ei(f.rollingPageY))<30){let p=this.newGestureEvent(fs.Contextmenu,f.initialTarget);p.pageX=Ei(f.rollingPageX),p.pageY=Ei(f.rollingPageY),this.dispatchEvent(p)}else if(o===1){let p=Ei(f.rollingPageX),v=Ei(f.rollingPageY),_=Ei(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,n,Math.abs(y)/_,y>0?1:-1,p,Math.abs(b)/_,b>0?1:-1,v)}this.dispatchEvent(this.newGestureEvent(fs.End,f.initialTarget)),delete this.activeTouches[h.identifier]}this.dispatched&&(s.preventDefault(),s.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,s){let n=document.createEvent("CustomEvent");return n.initEvent(t,!1,!0),n.initialTarget=s,n.tapCount=0,n}dispatchEvent(t){if(t.type===fs.Tap){let s=new Date().getTime(),n=0;s-this._lastSetTapCountTime>Qt.CLEAR_TAP_COUNT_TIME?n=1:n=2,this._lastSetTapCountTime=s,t.tapCount=n}else(t.type===fs.Change||t.type===fs.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let n of this.ignoreTargets)if(n.contains(t.initialTarget))return;let s=[];for(let n of this.targets)if(n.contains(t.initialTarget)){let o=0,l=t.initialTarget;for(;l&&l!==n;)o++,l=l.parentElement;s.push([o,n])}s.sort((n,o)=>n[0]-o[0]);for(let[n,o]of s)o.dispatchEvent(t),this.dispatched=!0}}inertia(t,s,n,o,l,c,h,f,d){this.handle=Tv(t,()=>{let p=Date.now(),v=p-n,_=0,y=0,b=!0;o+=Qt.SCROLL_FRICTION*v,h+=Qt.SCROLL_FRICTION*v,o>0&&(b=!1,_=l*o*v),h>0&&(b=!1,y=f*h*v);let S=this.newGestureEvent(fs.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 n=0,o=t.changedTouches.length;n<o;n++){let l=t.changedTouches.item(n);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(fs.Change,c.initialTarget);h.translationX=l.pageX-Ei(c.rollingPageX),h.translationY=l.pageY-Ei(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)}};nl.SCROLL_FRICTION=-.005,nl.HOLD_DELAY=700,nl.CLEAR_TAP_COUNT_TIME=400,gt([E8],nl,"isTouchDevice",1);var T8=nl,kv=class extends ze{onclick(e,t){this._register(ke(e,Pt.CLICK,s=>t(new gu(vs(e),s))))}onmousedown(e,t){this._register(ke(e,Pt.MOUSE_DOWN,s=>t(new gu(vs(e),s))))}onmouseover(e,t){this._register(ke(e,Pt.MOUSE_OVER,s=>t(new gu(vs(e),s))))}onmouseleave(e,t){this._register(ke(e,Pt.MOUSE_LEAVE,s=>t(new gu(vs(e),s))))}onkeydown(e,t){this._register(ke(e,Pt.KEY_DOWN,s=>t(new sx(s))))}onkeyup(e,t){this._register(ke(e,Pt.KEY_UP,s=>t(new sx(s))))}oninput(e,t){this._register(ke(e,Pt.INPUT,t))}onblur(e,t){this._register(ke(e,Pt.BLUR,t))}onfocus(e,t){this._register(ke(e,Pt.FOCUS,t))}onchange(e,t){this._register(ke(e,Pt.CHANGE,t))}ignoreGesture(e){return T8.ignoreTarget(e)}},cx=11,k8=class extends kv{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=cx+"px",this.domNode.style.height=cx+"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 qT),this._register(ax(this.bgDomNode,Pt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(ax(this.domNode,Pt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new w8),this._pointerdownScheduleRepeatTimer=this._register(new Ev)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,vs(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()}},R8=class Gp{constructor(t,s,n,o,l,c,h){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(s=s|0,n=n|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>n&&(o=n-s),o<0&&(o=0),l<0&&(l=0),h+l>c&&(h=c-l),h<0&&(h=0),this.width=s,this.scrollWidth=n,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 Gp(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 Gp(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 n=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:n,scrollWidthChanged:o,scrollLeftChanged:l,heightChanged:c,scrollHeightChanged:h,scrollTopChanged:f}}},A8=class extends ze{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 R8(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 n;t?n=new hx(this._smoothScrolling.from,s,this._smoothScrolling.startTime,this._smoothScrolling.duration):n=this._smoothScrolling.combine(this._state,s,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=n}else{let s=this._state.withScrollPosition(e);this._smoothScrolling=hx.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)))}},ux=class{constructor(e,t,s){this.scrollLeft=e,this.scrollTop=t,this.isDone=s}};function Im(e,t){let s=t-e;return function(n){return e+s*O8(n)}}function M8(e,t,s){return function(n){return n<s?e(n/s):t((n-s)/(1-s))}}var hx=class Xp{constructor(t,s,n,o){this.from=t,this.to=s,this.duration=o,this.startTime=n,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,n){if(Math.abs(t-s)>2.5*n){let o,l;return t<s?(o=t+.75*n,l=s-.75*n):(o=t-.75*n,l=s+.75*n),M8(Im(t,o),Im(l,s),.33)}return Im(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 n=this.scrollLeft(s),o=this.scrollTop(s);return new ux(n,o,!1)}return new ux(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,s,n){return Xp.start(t,s,n)}static start(t,s,n){n=n+10;let o=Date.now()-10;return new Xp(t,s,o,n)}};function D8(e){return Math.pow(e,3)}function O8(e){return 1-D8(1-e)}var N8=class extends ze{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 Ev)}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":"")))}},L8=140,$T=class extends kv{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 N8(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new qT),this._shouldRender=!0,this.domNode=ml(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(ke(this.domNode.domNode,Pt.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new k8(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,s,n){this.slider=ml(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 n=="number"&&this.slider.setHeight(n),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(ke(this.slider.domNode,Pt.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(),n=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderPointerPosition(e);s<=o&&o<=n?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=x8(this.domNode.domNode);t=e.pageX-o.left,s=e.pageY-o.top}let n=this._pointerDownRelativePosition(t,s);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(n):this._scrollbarState.getDesiredScrollPositionFromOffset(n)),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),n=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(FT&&c>L8){this._setDesiredScrollPositionNow(n.getScrollPosition());return}let h=this._sliderPointerPosition(o)-t;this._setDesiredScrollPositionNow(n.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()}},GT=class Zp{constructor(t,s,n,o,l,c){this._scrollbarSize=Math.round(s),this._oppositeScrollbarSize=Math.round(n),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 Zp(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,n,o,l){let c=Math.max(0,n-t),h=Math.max(0,c-2*s),f=o>0&&o>n;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(n*h/o))),p=(h-d)/(o-n),v=l*p;return{computedAvailableSize:Math.round(c),computedIsNeeded:f,computedSliderSize:Math.round(d),computedSliderRatio:p,computedSliderPosition:Math.round(v)}}_refreshComputedValues(){let t=Zp._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,n=this._scrollPosition;return s<this._computedSliderPosition?n-=this._visibleSize:n+=this._visibleSize,n}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let s=this._computedSliderPosition+t;return Math.round(s/this._computedSliderRatio)}},B8=class extends $T{constructor(e,t,s){let n=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:s,scrollbarState:new GT(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,n.width,n.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}},P8=class extends $T{constructor(e,t,s){let n=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:s,scrollbarState:new GT(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,n.height,n.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}},z8=500,dx=50,j8=class{constructor(e,t,s){this.timestamp=e,this.deltaX=t,this.deltaY=s,this.score=0}},Qp=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,n=1,o=this._rear;do{let l=o===this._front?t:Math.pow(2,-n);if(t-=l,s+=this._memory[o].score*l,o===this._front)break;o=(this._capacity+o-1)%this._capacity,n++}while(!0);return s<=.5}acceptStandardWheelEvent(t){if(xv){let s=vs(t.browserEvent),n=Gj(s);this.accept(Date.now(),t.deltaX*n,t.deltaY*n)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,s,n){let o=null,l=new j8(t,s,n);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 n=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(n+=.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&&(n-=.5)}return Math.min(Math.max(n,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};Qp.INSTANCE=new Qp;var H8=Qp,I8=class extends kv{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=U8(t),this._scrollable=s,this._register(this._scrollable.onScroll(o=>{this._onWillScroll.fire(o),this._onDidScroll(o),this._onScroll.fire(o)}));let n={onMouseWheel:o=>this._onMouseWheel(o),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new P8(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new B8(this._scrollable,this._options,n)),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=ml(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=ml(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=ml(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 Ev),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=Or(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,bs&&(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 rx(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Or(this._mouseWheelToDispose),e)){let t=s=>{this._onMouseWheel(new rx(s))};this._mouseWheelToDispose.push(ke(this._listenOnDomNode,Pt.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=H8.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=!bs&&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=dx*o,p=h.scrollTop-(d<0?Math.floor(d):Math.ceil(d));this._verticalScrollbar.writeScrollPosition(f,p)}if(l){let d=dx*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 n=s;!n&&this._options.alwaysConsumeMouseWheel&&(n=!0),!n&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(n=!0),n&&(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,n=s?" left":"",o=t?" top":"",l=s||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${l}${o}${n}`)}}_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(),z8)}},V8=class extends I8{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 U8(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,bs&&(t.className+=" mac"),t}var Jp=class extends ze{constructor(e,t,s,n,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 A8({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:d=>Tv(n.window,d)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{f.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new V8(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($t.runAndSubscribe(l.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=l.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(at(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=n.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(at(()=>this._styleElement.remove())),this._register($t.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(`
|
|
71
|
+
`)})),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}};Jp=gt([ge(2,oi),ge(3,Js),ge(4,AT),ge(5,Zo),ge(6,ai),ge(7,en)],Jp);var eg=class extends ze{constructor(e,t,s,n,o){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=s,this._decorationService=n,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(at(()=>{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()}};eg=gt([ge(1,oi),ge(2,Js),ge(3,Ll),ge(4,en)],eg);var F8=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)}},hs={full:0,left:0,center:0,right:0},Dn={full:0,left:0,center:0,right:0},Ga={full:0,left:0,center:0,right:0},lh=class extends ze{constructor(e,t,s,n,o,l,c,h){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=s,this._decorationService=n,this._renderService=o,this._optionsService=l,this._themeService=c,this._coreBrowserService=h,this._colorZoneStore=new F8,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(at(()=>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);Dn.full=this._canvas.width,Dn.left=e,Dn.center=t,Dn.right=e,this._refreshDrawHeightConstants(),Ga.full=1,Ga.left=1,Ga.center=1+Dn.left,Ga.right=1+Dn.left+Dn.center}_refreshDrawHeightConstants(){hs.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);hs.left=t,hs.center=t,hs.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*hs.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*hs.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*hs.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*hs.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(Ga[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-hs[e.position||"full"]/2),Dn[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+hs[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}))}};lh=gt([ge(2,oi),ge(3,Ll),ge(4,en),ge(5,ai),ge(6,Zo),ge(7,Js)],lh);var de;(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=`
|
|
72
|
+
`,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=""))(de||={});var Hu;(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=""))(Hu||={});var XT;(e=>e.ST=`${de.ESC}\\`)(XT||={});var tg=class{constructor(e,t,s,n,o,l){this._textarea=e,this._compositionView=t,this._bufferService=s,this._optionsService=n,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(`${de.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,n=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=n+"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=n+"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)}}};tg=gt([ge(2,oi),ge(3,ai),ge(4,Br),ge(5,en)],tg);var zt=0,jt=0,Ht=0,pt=0,fx={css:"#00000000",rgba:0},Tt;(e=>{function t(o,l,c,h){return h!==void 0?`#${_r(o)}${_r(l)}${_r(c)}${_r(h)}`:`#${_r(o)}${_r(l)}${_r(c)}`}e.toCss=t;function s(o,l,c,h=255){return(o<<24|l<<16|c<<8|h)>>>0}e.toRgba=s;function n(o,l,c,h){return{css:e.toCss(o,l,c,h),rgba:e.toRgba(o,l,c,h)}}e.toColor=n})(Tt||={});var rt;(e=>{function t(f,d){if(pt=(d.rgba&255)/255,pt===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;zt=y+Math.round((p-y)*pt),jt=b+Math.round((v-b)*pt),Ht=S+Math.round((_-S)*pt);let E=Tt.toCss(zt,jt,Ht),R=Tt.toRgba(zt,jt,Ht);return{css:E,rgba:R}}e.blend=t;function s(f){return(f.rgba&255)===255}e.isOpaque=s;function n(f,d,p){let v=Iu.ensureContrastRatio(f.rgba,d.rgba,p);if(v)return Tt.toColor(v>>24&255,v>>16&255,v>>8&255)}e.ensureContrastRatio=n;function o(f){let d=(f.rgba|255)>>>0;return[zt,jt,Ht]=Iu.toChannels(d),{css:Tt.toCss(zt,jt,Ht),rgba:d}}e.opaque=o;function l(f,d){return pt=Math.round(d*255),[zt,jt,Ht]=Iu.toChannels(f.rgba),{css:Tt.toCss(zt,jt,Ht,pt),rgba:Tt.toRgba(zt,jt,Ht,pt)}}e.opacity=l;function c(f,d){return pt=f.rgba&255,l(f,pt*d/255)}e.multiplyOpacity=c;function h(f){return[f.rgba>>24&255,f.rgba>>16&255,f.rgba>>8&255]}e.toColorRGB=h})(rt||={});var ct;(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 n(o){if(o.match(/#[\da-f]{3,8}/i))switch(o.length){case 4:return zt=parseInt(o.slice(1,2).repeat(2),16),jt=parseInt(o.slice(2,3).repeat(2),16),Ht=parseInt(o.slice(3,4).repeat(2),16),Tt.toColor(zt,jt,Ht);case 5:return zt=parseInt(o.slice(1,2).repeat(2),16),jt=parseInt(o.slice(2,3).repeat(2),16),Ht=parseInt(o.slice(3,4).repeat(2),16),pt=parseInt(o.slice(4,5).repeat(2),16),Tt.toColor(zt,jt,Ht,pt);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 zt=parseInt(l[1]),jt=parseInt(l[2]),Ht=parseInt(l[3]),pt=Math.round((l[5]===void 0?1:parseFloat(l[5]))*255),Tt.toColor(zt,jt,Ht,pt);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),[zt,jt,Ht,pt]=t.getImageData(0,0,1,1).data,pt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Tt.toRgba(zt,jt,Ht,pt),css:o}}e.toColor=n})(ct||={});var ti;(e=>{function t(n){return s(n>>16&255,n>>8&255,n&255)}e.relativeLuminance=t;function s(n,o,l){let c=n/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})(ti||={});var Iu;(e=>{function t(c,h){if(pt=(h&255)/255,pt===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 zt=v+Math.round((f-v)*pt),jt=_+Math.round((d-_)*pt),Ht=y+Math.round((p-y)*pt),Tt.toRgba(zt,jt,Ht)}e.blend=t;function s(c,h,f){let d=ti.relativeLuminance(c>>8),p=ti.relativeLuminance(h>>8);if(Ks(d,p)<f){if(p<d){let y=n(c,h,f),b=Ks(d,ti.relativeLuminance(y>>8));if(b<f){let S=o(c,h,f),E=Ks(d,ti.relativeLuminance(S>>8));return b>E?y:S}return y}let v=o(c,h,f),_=Ks(d,ti.relativeLuminance(v>>8));if(_<f){let y=n(c,h,f),b=Ks(d,ti.relativeLuminance(y>>8));return _>b?v:y}return v}}e.ensureContrastRatio=s;function n(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=Ks(ti.relativeLuminance2(_,y,b),ti.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=Ks(ti.relativeLuminance2(_,y,b),ti.relativeLuminance2(d,p,v));return(_<<24|y<<16|b<<8|255)>>>0}e.reduceLuminance=n;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=Ks(ti.relativeLuminance2(_,y,b),ti.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=Ks(ti.relativeLuminance2(_,y,b),ti.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})(Iu||={});function _r(e){let t=e.toString(16);return t.length<2?"0"+t:t}function Ks(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var W8=class extends Nl{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()]}},ch=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=[],n=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(n,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||jn.length}if(this._bufferService.cols-o>1){let d=this._getJoinedRanges(n,c,l,t,o);for(let p=0;p<d.length;p++)s.push(d[p])}return s}_getJoinedRanges(e,t,s,n,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++)ch._mergeRanges(c,f[d])}catch(f){console.error(f)}return this._stringRangesToCellRanges(c,n,o),c}_stringRangesToCellRanges(e,t,s){let n=0,o=!1,l=0,c=e[n];if(c){for(let h=s;h<this._bufferService.cols;h++){let f=t.getWidth(h),d=t.getString(h).length||jn.length;if(f!==0){if(!o&&c[0]<=l&&(c[0]=h,o=!0),c[1]<=l){if(c[1]=h,c=e[++n],!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 n=0;n<e.length;n++){let o=e[n];if(s){if(t[1]<=o[0])return e[n-1][1]=t[1],e;if(t[1]<=o[1])return e[n-1][1]=Math.max(t[1],o[1]),e.splice(n,1),e;e.splice(n,1),n--}else{if(t[1]<=o[0])return e.splice(n,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}};ch=gt([ge(0,oi)],ch);function K8(e){return 57508<=e&&e<=57558}function Y8(e){return 9472<=e&&e<=9631}function q8(e){return K8(e)||Y8(e)}function $8(){return{css:{canvas:vu(),cell:vu()},device:{canvas:vu(),cell:vu(),char:{width:0,height:0,left:0,top:0}}}}function vu(){return{width:0,height:0}}var ig=class{constructor(e,t,s,n,o,l,c){this._document=e,this._characterJoinerService=t,this._optionsService=s,this._coreBrowserService=n,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,n,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,R="",A=0,M=0,k=0,j=0,F=!1,U=0,H=!1,J=0,W=0,$=[],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>=W,I=L,B=this._workCell;if(_.length>0&&L===_[0][0]&&T){let Ce=_.shift(),Oe=this._isCellInSelection(Ce[0],t);for(A=Ce[0]+1;A<Ce[1];A++)T&&=Oe===this._isCellInSelection(A,t);T&&=!s||l<Ce[0]||l>=Ce[1],T?(q=!0,B=new W8(this._workCell,e.translateToString(!0,Ce[0],Ce[1]),Ce[1]-Ce[0]),I=Ce[1]-1,P=B.getWidth()):W=Ce[1]}let ee=this._isCellInSelection(L,t),X=s&&L===l,N=z&&L>=d&&L<=p,Z=!1;this._decorationService.forEachDecorationAtCell(L,t,void 0,Ce=>{Z=!0});let se=B.getChars()||jn;if(se===" "&&(B.isUnderline()||B.isOverline())&&(se=" "),J=P*h-f.get(se,B.isBold(),B.isItalic()),!S)S=this._document.createElement("span");else if(E&&(ee&&H||!ee&&!H&&B.bg===M)&&(ee&&H&&y.selectionForeground||B.fg===k)&&B.extended.ext===j&&N===F&&J===U&&!X&&!q&&!Z&&T){B.isInvisible()?R+=jn:R+=se,E++;continue}else E&&(S.textContent=R),S=this._document.createElement("span"),E=0,R="";if(M=B.bg,k=B.fg,j=B.extended.ext,F=N,U=J,H=ee,q&&l>=L&&l<=I&&(l=L),!this._coreService.isCursorHidden&&X&&this._coreService.isCursorInitialized){if($.push("xterm-cursor"),this._coreBrowserService.isFocused)c&&$.push("xterm-cursor-blink"),$.push(n==="bar"?"xterm-cursor-bar":n==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(o)switch(o){case"outline":$.push("xterm-cursor-outline");break;case"block":$.push("xterm-cursor-block");break;case"bar":$.push("xterm-cursor-bar");break;case"underline":$.push("xterm-cursor-underline");break}}if(B.isBold()&&$.push("xterm-bold"),B.isItalic()&&$.push("xterm-italic"),B.isDim()&&$.push("xterm-dim"),B.isInvisible()?R=jn:R=B.getChars()||jn,B.isUnderline()&&($.push(`xterm-underline-${B.extended.underlineStyle}`),R===" "&&(R=" "),!B.isUnderlineColorDefault()))if(B.isUnderlineColorRGB())S.style.textDecorationColor=`rgb(${Nl.toColorRGB(B.getUnderlineColor()).join(",")})`;else{let Ce=B.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&B.isBold()&&Ce<8&&(Ce+=8),S.style.textDecorationColor=y.ansi[Ce].css}B.isOverline()&&($.push("xterm-overline"),R===" "&&(R=" ")),B.isStrikethrough()&&$.push("xterm-strikethrough"),N&&(S.style.textDecoration="underline");let V=B.getFgColor(),O=B.getFgColorMode(),K=B.getBgColor(),Y=B.getBgColorMode(),ie=!!B.isInverse();if(ie){let Ce=V;V=K,K=Ce;let Oe=O;O=Y,Y=Oe}let ne,fe,me=!1;this._decorationService.forEachDecorationAtCell(L,t,void 0,Ce=>{Ce.options.layer!=="top"&&me||(Ce.backgroundColorRGB&&(Y=50331648,K=Ce.backgroundColorRGB.rgba>>8&16777215,ne=Ce.backgroundColorRGB),Ce.foregroundColorRGB&&(O=50331648,V=Ce.foregroundColorRGB.rgba>>8&16777215,fe=Ce.foregroundColorRGB),me=Ce.options.layer==="top")}),!me&&ee&&(ne=this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque,K=ne.rgba>>8&16777215,Y=50331648,me=!0,y.selectionForeground&&(O=50331648,V=y.selectionForeground.rgba>>8&16777215,fe=y.selectionForeground)),me&&$.push("xterm-decoration-top");let we;switch(Y){case 16777216:case 33554432:we=y.ansi[K],$.push(`xterm-bg-${K}`);break;case 50331648:we=Tt.toColor(K>>16,K>>8&255,K&255),this._addStyle(S,`background-color:#${mx((K>>>0).toString(16),"0",6)}`);break;default:ie?(we=y.foreground,$.push("xterm-bg-257")):we=y.background}switch(ne||B.isDim()&&(ne=rt.multiplyOpacity(we,.5)),O){case 16777216:case 33554432:B.isBold()&&V<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(V+=8),this._applyMinimumContrast(S,we,y.ansi[V],B,ne,void 0)||$.push(`xterm-fg-${V}`);break;case 50331648:let Ce=Tt.toColor(V>>16&255,V>>8&255,V&255);this._applyMinimumContrast(S,we,Ce,B,ne,fe)||this._addStyle(S,`color:#${mx(V.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(S,we,y.foreground,B,ne,fe)||ie&&$.push("xterm-fg-257")}$.length&&(S.className=$.join(" "),$.length=0),!X&&!q&&!Z&&T?E++:S.textContent=R,J!==this.defaultSpacing&&(S.style.letterSpacing=`${J}px`),v.push(S),L=I}return S&&E&&(S.textContent=R),v}_applyMinimumContrast(e,t,s,n,o,l){if(this._optionsService.rawOptions.minimumContrastRatio===1||q8(n.getCode()))return!1;let c=this._getContrastCache(n),h;if(!o&&!l&&(h=c.getColor(t.rgba,s.rgba)),h===void 0){let f=this._optionsService.rawOptions.minimumContrastRatio/(n.isDim()?2:1);h=rt.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,n=this._selectionEnd;return!s||!n?!1:this._columnSelectMode?s[0]<=n[0]?e>=s[0]&&t>=s[1]&&e<n[0]&&t<=n[1]:e<s[0]&&t>=s[1]&&e>=n[0]&&t<=n[1]:t>s[1]&&t<n[1]||s[1]===n[1]&&t===s[1]&&e>=s[0]&&e<n[0]||s[1]<n[1]&&t===n[1]&&e<n[0]||s[1]<n[1]&&t===s[1]&&e>=s[0]}};ig=gt([ge(1,OT),ge(2,ai),ge(3,Js),ge(4,Br),ge(5,Ll),ge(6,Zo)],ig);function mx(e,t,s){for(;e.length<s;)e=t+e;return e}var G8=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 n=e.createElement("span");n.classList.add("xterm-char-measure-element"),n.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,n,o,l],this._container.appendChild(s),this._container.appendChild(n),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,n){e===this._font&&t===this._fontSize&&s===this._weight&&n===this._weightBold||(this._font=e,this._fontSize=t,this._weight=s,this._weightBold=n,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${s}`,this._measureElements[1].style.fontWeight=`${n}`,this._measureElements[2].style.fontWeight=`${s}`,this._measureElements[3].style.fontWeight=`${n}`,this.clear())}get(e,t,s){let n=0;if(!t&&!s&&e.length===1&&(n=e.charCodeAt(0))<256){if(this._flat[n]!==-9999)return this._flat[n];let c=this._measure(e,0);return c>0&&(this._flat[n]=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}},X8=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,n=!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=n,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 Z8(){return new X8}var Vm="xterm-dom-renderer-owner-",Vi="xterm-rows",_u="xterm-fg-",px="xterm-bg-",Xa="xterm-focus",yu="xterm-selection",Q8=1,sg=class extends ze{constructor(e,t,s,n,o,l,c,h,f,d,p,v,_,y){super(),this._terminal=e,this._document=t,this._element=s,this._screenElement=n,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=Q8++,this._rowElements=[],this._selectionRenderModel=Z8(),this.onRequestRedraw=this._register(new pe).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(Vi),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(yu),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=$8(),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(ig,document),this._element.classList.add(Vm+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(at(()=>{this._element.classList.remove(Vm+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new G8(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} .${Vi} 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} .${Vi} { 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} .${Vi} .xterm-dim { color: ${rt.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}`,n=`blink_bar_${this._terminalClass}`,o=`blink_block_${this._terminalClass}`;t+=`@keyframes ${s} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${n} { 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} .${Vi}.${Xa} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${Vi}.${Xa} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${Vi}.${Xa} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${o} 1s step-end infinite;}${this._terminalSelector} .${Vi} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${Vi} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${Vi} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${Vi} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${Vi} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${yu} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${yu} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${yu} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[l,c]of e.ansi.entries())t+=`${this._terminalSelector} .${_u}${l} { color: ${c.css}; }${this._terminalSelector} .${_u}${l}.xterm-dim { color: ${rt.multiplyOpacity(c,.5).css}; }${this._terminalSelector} .${px}${l} { background-color: ${c.css}; }`;t+=`${this._terminalSelector} .${_u}257 { color: ${rt.opaque(e.background).css}; }${this._terminalSelector} .${_u}257.xterm-dim { color: ${rt.multiplyOpacity(rt.opaque(e.background),.5).css}; }${this._terminalSelector} .${px}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 n=this._document.createElement("div");this._rowContainer.appendChild(n),this._rowElements.push(n)}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(Xa),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(Xa),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 n=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=n===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,n=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=`${n*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,n=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===n,c,h,o,l,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Vm}${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,n,o,l){s<0&&(e=0),n<0&&(t=0);let c=this._bufferService.rows-1;s=Math.max(Math.min(s,c),0),n=Math.max(Math.min(n,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<=n;++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===n?t:o)-1:-1))}}};sg=gt([ge(7,bv),ge(8,Ph),ge(9,ai),ge(10,oi),ge(11,Br),ge(12,Js),ge(13,Zo)],sg);var ng=class extends ze{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 eH(this._optionsService))}catch{this._measureStrategy=this._register(new J8(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())}};ng=gt([ge(2,ai)],ng);var ZT=class extends ze{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)}},J8=class extends ZT{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}},eH=class extends ZT{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}},tH=class extends ze{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 iH(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(n=>this._screenDprMonitor.setWindow(n))),this._register($t.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(ke(this._textarea,"focus",()=>this._isFocused=!0)),this._register(ke(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}},iH=class extends ze{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new Wo),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(at(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=ke(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)}},sH=class extends ze{constructor(){super(),this.linkProviders=[],this._register(at(()=>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 Rv(e,t,s){let n=s.getBoundingClientRect(),o=e.getComputedStyle(s),l=parseInt(o.getPropertyValue("padding-left")),c=parseInt(o.getPropertyValue("padding-top"));return[t.clientX-n.left-l,t.clientY-n.top-c]}function nH(e,t,s,n,o,l,c,h,f){if(!l)return;let d=Rv(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),n+(f?1:0)),d[1]=Math.min(Math.max(d[1],1),o),d}var rg=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,s,n,o){return nH(window,e,t,s,n,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,o)}getMouseReportCoords(e,t){let s=Rv(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])}}};rg=gt([ge(0,en),ge(1,Ph)],rg);var rH=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=[]}},QT={};pj(QT,{getSafariVersion:()=>aH,isChromeOS:()=>ik,isFirefox:()=>JT,isIpad:()=>lH,isIphone:()=>cH,isLegacyEdge:()=>oH,isLinux:()=>Av,isMac:()=>uh,isNode:()=>zh,isSafari:()=>ek,isWindows:()=>tk});var zh=typeof process<"u"&&"title"in process,Bl=zh?"node":navigator.userAgent,Pl=zh?"node":navigator.platform,JT=Bl.includes("Firefox"),oH=Bl.includes("Edge"),ek=/^((?!chrome|android).)*safari/i.test(Bl);function aH(){if(!ek)return 0;let e=Bl.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var uh=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(Pl),lH=Pl==="iPad",cH=Pl==="iPhone",tk=["Windows","Win16","Win32","WinCE"].includes(Pl),Av=Pl.indexOf("Linux")>=0,ik=/\bCrOS\b/.test(Bl),sk=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,n=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){n-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-t))}ms`),this._start();return}n=o}this.clear()}},uH=class extends sk{_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())}}},hH=class extends sk{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},hh=!zh&&"requestIdleCallback"in window?hH:uH,dH=class{constructor(){this._queue=new hh}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},og=class extends ze{constructor(e,t,s,n,o,l,c,h,f){super(),this._rowCount=e,this._optionsService=s,this._charSizeService=n,this._coreService=o,this._coreBrowserService=h,this._renderer=this._register(new Wo),this._pausedResizeTask=new dH,this._observerDisposable=this._register(new Wo),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 rH((d,p)=>this._renderRows(d,p),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new fH(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(at(()=>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(n=>this._handleIntersectionChange(n[n.length-1]),{threshold:0});s.observe(t),this._observerDisposable.value=at(()=>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 n=this._syncOutputHandler.flush();n&&(e=Math.min(e,n.start),t=Math.max(t,n.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()}};og=gt([ge(2,ai),ge(3,Ph),ge(4,Br),ge(5,Ll),ge(6,oi),ge(7,Js),ge(8,Zo)],og);var fH=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 mH(e,t,s,n){let o=s.buffer.x,l=s.buffer.y;if(!s.buffer.hasScrollback)return vH(o,l,e,t,s,n)+jh(l,t,s,n)+_H(o,l,e,t,s,n);let c;if(l===t)return c=o>e?"D":"C",xl(Math.abs(o-e),wl(c,n));c=l>t?"D":"C";let h=Math.abs(l-t),f=gH(l>t?e:o,s)+(h-1)*s.cols+1+pH(l>t?o:e);return xl(f,wl(c,n))}function pH(e,t){return e-1}function gH(e,t){return t.cols-e}function vH(e,t,s,n,o,l){return jh(t,n,o,l).length===0?"":xl(rk(e,t,e,t-Nr(t,o),!1,o).length,wl("D",l))}function jh(e,t,s,n){let o=e-Nr(e,s),l=t-Nr(t,s),c=Math.abs(o-l)-yH(e,t,s);return xl(c,wl(nk(e,t),n))}function _H(e,t,s,n,o,l){let c;jh(t,n,o,l).length>0?c=n-Nr(n,o):c=t;let h=n,f=bH(e,t,s,n,o,l);return xl(rk(e,c,s,h,f==="C",o).length,wl(f,l))}function yH(e,t,s){let n=0,o=e-Nr(e,s),l=t-Nr(t,s);for(let c=0;c<Math.abs(o-l);c++){let h=nk(e,t)==="A"?-1:1;s.buffer.lines.get(o+h*c)?.isWrapped&&n++}return n}function Nr(e,t){let s=0,n=t.buffer.lines.get(e),o=n?.isWrapped;for(;o&&e>=0&&e<t.rows;)s++,n=t.buffer.lines.get(--e),o=n?.isWrapped;return s}function bH(e,t,s,n,o,l){let c;return jh(s,n,o,l).length>0?c=n-Nr(n,o):c=t,e<s&&c<=n||e>=s&&c<n?"C":"D"}function nk(e,t){return e>t?"A":"B"}function rk(e,t,s,n,o,l){let c=e,h=t,f="";for(;(c!==s||h!==n)&&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 wl(e,t){let s=t?"O":"[";return de.ESC+s+e}function xl(e,t){e=Math.floor(e);let s="";for(let n=0;n<e;n++)s+=t;return s}var SH=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 gx(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 Um=50,wH=15,xH=50,CH=500,EH=" ",TH=new RegExp(EH,"g"),ag=class extends ze{constructor(e,t,s,n,o,l,c,h,f){super(),this._element=e,this._screenElement=t,this._linkifier=s,this._bufferService=n,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 SH(this._bufferService),this._activeSelectionMode=0,this._register(at(()=>{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,n=[];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);n.push(h)}}else{let o=e[1]===t[1]?t[0]:void 0;n.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?n[n.length-1]+=h:n.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?n[n.length-1]+=c:n.push(c)}}return n.map(o=>o.replace(TH," ")).join(tk?`\r
|
|
73
|
+
`:`
|
|
74
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),Av&&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,n=this._model.finalSelectionEnd;return!s||!n||!t?!1:this._areCoordsInSelection(t,s,n)}isCellInSelection(e,t){let s=this._model.finalSelectionStart,n=this._model.finalSelectionEnd;return!s||!n?!1:this._areCoordsInSelection([e,t],s,n)}_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=gx(s,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let n=this._getMouseBufferCoords(e);return n?(this._selectWordAt(n,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=Rv(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,-Um),Um),t/=Um,t/Math.abs(t)+Math.round(t*(wH-1)))}shouldForceSelection(e){return uh?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(),xH)}_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&&!(uh&&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 n=s.lines.get(this._model.selectionEnd[1]);n&&n.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<CH&&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 n=mH(s[0]-1,s[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(n,!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 n=0;t>=n;n++){let o=e.loadCell(n,this._workCell).getChars().length;this._workCell.getWidth()===0?s--:o>1&&t!==n&&(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,n=!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],R=e[0];l.getWidth(E)===0&&(p++,E--),l.getWidth(R)===2&&(v++,R++);let A=l.getString(R).length;for(A>1&&(y+=A-1,f+=A-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(;R<l.length&&f+1<c.length&&!this._isCharWordSeparator(l.loadCell(R+1,this._workCell));){l.loadCell(R+1,this._workCell);let M=this._workCell.getChars().length;this._workCell.getWidth()===2?(v++,R++):M>1&&(y+=M-1,f+=M-1),f++,R++}}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 R=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(R){let A=this._bufferService.cols-R.start;b-=A,S+=A}}}if(n&&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 R=this._getWordAt([0,e[1]+1],!1,!1,!0);R&&(S+=R.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=gx(s,this._bufferService.cols)}};ag=gt([ge(3,oi),ge(4,Br),ge(5,Sv),ge(6,ai),ge(7,en),ge(8,Js)],ag);var vx=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={}}},_x=class{constructor(){this._color=new vx,this._css=new vx}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()}},Mt=Object.freeze((()=>{let e=[ct.toColor("#2e3436"),ct.toColor("#cc0000"),ct.toColor("#4e9a06"),ct.toColor("#c4a000"),ct.toColor("#3465a4"),ct.toColor("#75507b"),ct.toColor("#06989a"),ct.toColor("#d3d7cf"),ct.toColor("#555753"),ct.toColor("#ef2929"),ct.toColor("#8ae234"),ct.toColor("#fce94f"),ct.toColor("#729fcf"),ct.toColor("#ad7fa8"),ct.toColor("#34e2e2"),ct.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let s=0;s<216;s++){let n=t[s/36%6|0],o=t[s/6%6|0],l=t[s%6];e.push({css:Tt.toCss(n,o,l),rgba:Tt.toRgba(n,o,l)})}for(let s=0;s<24;s++){let n=8+s*10;e.push({css:Tt.toCss(n,n,n),rgba:Tt.toRgba(n,n,n)})}return e})()),Sr=ct.toColor("#ffffff"),rl=ct.toColor("#000000"),yx=ct.toColor("#ffffff"),bx=rl,Za={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},kH=Sr,lg=class extends ze{constructor(e){super(),this._optionsService=e,this._contrastCache=new _x,this._halfContrastCache=new _x,this._onChangeColors=this._register(new pe),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:Sr,background:rl,cursor:yx,cursorAccent:bx,selectionForeground:void 0,selectionBackgroundTransparent:Za,selectionBackgroundOpaque:rt.blend(rl,Za),selectionInactiveBackgroundTransparent:Za,selectionInactiveBackgroundOpaque:rt.blend(rl,Za),scrollbarSliderBackground:rt.opacity(Sr,.2),scrollbarSliderHoverBackground:rt.opacity(Sr,.4),scrollbarSliderActiveBackground:rt.opacity(Sr,.5),overviewRulerBorder:Sr,ansi:Mt.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=Je(e.foreground,Sr),t.background=Je(e.background,rl),t.cursor=rt.blend(t.background,Je(e.cursor,yx)),t.cursorAccent=rt.blend(t.background,Je(e.cursorAccent,bx)),t.selectionBackgroundTransparent=Je(e.selectionBackground,Za),t.selectionBackgroundOpaque=rt.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=Je(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=rt.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?Je(e.selectionForeground,fx):void 0,t.selectionForeground===fx&&(t.selectionForeground=void 0),rt.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=rt.opacity(t.selectionBackgroundTransparent,.3)),rt.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=rt.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=Je(e.scrollbarSliderBackground,rt.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=Je(e.scrollbarSliderHoverBackground,rt.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=Je(e.scrollbarSliderActiveBackground,rt.opacity(t.foreground,.5)),t.overviewRulerBorder=Je(e.overviewRulerBorder,kH),t.ansi=Mt.slice(),t.ansi[0]=Je(e.black,Mt[0]),t.ansi[1]=Je(e.red,Mt[1]),t.ansi[2]=Je(e.green,Mt[2]),t.ansi[3]=Je(e.yellow,Mt[3]),t.ansi[4]=Je(e.blue,Mt[4]),t.ansi[5]=Je(e.magenta,Mt[5]),t.ansi[6]=Je(e.cyan,Mt[6]),t.ansi[7]=Je(e.white,Mt[7]),t.ansi[8]=Je(e.brightBlack,Mt[8]),t.ansi[9]=Je(e.brightRed,Mt[9]),t.ansi[10]=Je(e.brightGreen,Mt[10]),t.ansi[11]=Je(e.brightYellow,Mt[11]),t.ansi[12]=Je(e.brightBlue,Mt[12]),t.ansi[13]=Je(e.brightMagenta,Mt[13]),t.ansi[14]=Je(e.brightCyan,Mt[14]),t.ansi[15]=Je(e.brightWhite,Mt[15]),e.extendedAnsi){let s=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let n=0;n<s;n++)t.ansi[n+16]=Je(e.extendedAnsi[n],Mt[n+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()}}};lg=gt([ge(0,ai)],lg);function Je(e,t){if(e!==void 0)try{return ct.toColor(e)}catch{}return t}var RH=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)}},AH=class{constructor(){this._services=new RH,this._services.set(bv,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let s=wj(e).sort((l,c)=>l.index-c.index),n=[];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}.`);n.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,...n)}},MH={trace:0,debug:1,info:2,warn:3,error:4,off:5},DH="xterm.js: ",cg=class extends ze{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=MH[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?"":DH)+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)}};cg=gt([ge(0,ai)],cg);var Sx=class extends ze{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 n=e;n<this._length-t;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let n=this._length-1;n>=e;n--)this._array[this._getCyclicIndex(n+s.length)]=this._array[this._getCyclicIndex(n)];for(let n=0;n<s.length;n++)this._array[this._getCyclicIndex(e+n)]=s[n];if(s.length&&this.onInsertEmitter.fire({index:e,amount:s.length}),this._length+s.length>this._maxLength){let n=this._length+s.length-this._maxLength;this._startIndex+=n,this._length=this._maxLength,this.onTrimEmitter.fire(n)}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 n=e+t+s-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let n=0;n<t;n++)this.set(e+n+s,this.get(e+n))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},Be=3,Ct=Object.freeze(new Nl),bu=0,Fm=2,ol=class ok{constructor(t,s,n=!1){this.isWrapped=n,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*Be);let o=s||Yi.fromCharData([0,ET,1,0]);for(let l=0;l<t;++l)this.setCell(l,o);this.length=t}get(t){let s=this._data[t*Be+0],n=s&2097151;return[this._data[t*Be+1],s&2097152?this._combined[t]:n?Pn(n):"",s>>22,s&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):n]}set(t,s){this._data[t*Be+1]=s[0],s[1].length>1?(this._combined[t]=s[1],this._data[t*Be+0]=t|2097152|s[2]<<22):this._data[t*Be+0]=s[1].charCodeAt(0)|s[2]<<22}getWidth(t){return this._data[t*Be+0]>>22}hasWidth(t){return this._data[t*Be+0]&12582912}getFg(t){return this._data[t*Be+1]}getBg(t){return this._data[t*Be+2]}hasContent(t){return this._data[t*Be+0]&4194303}getCodePoint(t){let s=this._data[t*Be+0];return s&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):s&2097151}isCombined(t){return this._data[t*Be+0]&2097152}getString(t){let s=this._data[t*Be+0];return s&2097152?this._combined[t]:s&2097151?Pn(s&2097151):""}isProtected(t){return this._data[t*Be+2]&536870912}loadCell(t,s){return bu=t*Be,s.content=this._data[bu+0],s.fg=this._data[bu+1],s.bg=this._data[bu+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*Be+0]=s.content,this._data[t*Be+1]=s.fg,this._data[t*Be+2]=s.bg}setCellFromCodepoint(t,s,n,o){o.bg&268435456&&(this._extendedAttrs[t]=o.extended),this._data[t*Be+0]=s|n<<22,this._data[t*Be+1]=o.fg,this._data[t*Be+2]=o.bg}addCodepointToCell(t,s,n){let o=this._data[t*Be+0];o&2097152?this._combined[t]+=Pn(s):o&2097151?(this._combined[t]=Pn(o&2097151)+Pn(s),o&=-2097152,o|=2097152):o=s|1<<22,n&&(o&=-12582913,o|=n<<22),this._data[t*Be+0]=o}insertCells(t,s,n){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,n),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,n)}else for(let o=t;o<this.length;++o)this.setCell(o,n);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,n)}deleteCells(t,s,n){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,n)}else for(let o=t;o<this.length;++o)this.setCell(o,n);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,n),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,n)}replaceCells(t,s,n,o=!1){if(o){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,n),s<this.length&&this.getWidth(s-1)===2&&!this.isProtected(s)&&this.setCellFromCodepoint(s,0,1,n);t<s&&t<this.length;)this.isProtected(t)||this.setCell(t,n),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,n),s<this.length&&this.getWidth(s-1)===2&&this.setCellFromCodepoint(s,0,1,n);t<s&&t<this.length;)this.setCell(t++,n)}resize(t,s){if(t===this.length)return this._data.length*4*Fm<this._data.buffer.byteLength;let n=t*Be;if(t>this.length){if(this._data.buffer.byteLength>=n*4)this._data=new Uint32Array(this._data.buffer,0,n);else{let o=new Uint32Array(n);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,n);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,n*4*Fm<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*Fm<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 n=0;n<this.length;++n)this.isProtected(n)||this.setCell(n,t);return}this._combined={},this._extendedAttrs={};for(let n=0;n<this.length;++n)this.setCell(n,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 ok(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*Be+0]&4194303)return t+(this._data[t*Be+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Be+0]&4194303||this._data[t*Be+2]&50331648)return t+(this._data[t*Be+0]>>22);return 0}copyCellsFrom(t,s,n,o,l){let c=t._data;if(l)for(let f=o-1;f>=0;f--){for(let d=0;d<Be;d++)this._data[(n+f)*Be+d]=c[(s+f)*Be+d];c[(s+f)*Be+2]&268435456&&(this._extendedAttrs[n+f]=t._extendedAttrs[s+f])}else for(let f=0;f<o;f++){for(let d=0;d<Be;d++)this._data[(n+f)*Be+d]=c[(s+f)*Be+d];c[(s+f)*Be+2]&268435456&&(this._extendedAttrs[n+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+n]=t._combined[d])}}translateToString(t,s,n,o){s=s??0,n=n??this.length,t&&(n=Math.min(n,this.getTrimmedLength())),o&&(o.length=0);let l="";for(;s<n;){let c=this._data[s*Be+0],h=c&2097151,f=c&2097152?this._combined[s]:h?Pn(h):jn;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 OH(e,t,s,n,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&&n>=h&&n<f){h+=p.length-1;continue}let v=0,_=Cl(p,v,t),y=1,b=0;for(;y<p.length;){let E=Cl(p,y,t),R=E-b,A=s-_,M=Math.min(R,A);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 NH(e,t){let s=[],n=0,o=t[n],l=0;for(let c=0;c<e.length;c++)if(o===c){let h=t[++n];e.onDeleteEmitter.fire({index:c-l,amount:h}),c+=h-1,l+=h,o=t[++n]}else s.push(c);return{layout:s,countRemoved:l}}function LH(e,t){let s=[];for(let n=0;n<t.length;n++)s.push(e.get(t[n]));for(let n=0;n<s.length;n++)e.set(n,s[n]);e.length=t.length}function BH(e,t,s){let n=[],o=e.map((f,d)=>Cl(e,d,t)).reduce((f,d)=>f+d),l=0,c=0,h=0;for(;h<o;){if(o-h<s){n.push(o-h);break}l+=s;let f=Cl(e,c,t);l>f&&(l-=f,c++);let d=e[c].getWidth(l-1)===2;d&&l--;let p=d?s-1:s;n.push(p),h+=p}return n}function Cl(e,t,s){if(t===e.length-1)return e[t].getTrimmedLength();let n=!e[t].hasContent(s-1)&&e[t].getWidth(s-1)===1,o=e[t+1].getWidth(0)===2;return n&&o?s-1:s}var ak=class lk{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=lk._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(),Or(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};ak._nextId=1;var PH=ak,Nt={},wr=Nt.B;Nt[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:"≥","{":"π","|":"≠","}":"£","~":"·"};Nt.A={"#":"£"};Nt.B=void 0;Nt[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};Nt.C=Nt[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Nt.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};Nt.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};Nt.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};Nt.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};Nt.E=Nt[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};Nt.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};Nt.H=Nt[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Nt["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var wx=4294967295,xx=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=Ct.clone(),this.savedCharset=wr,this.markers=[],this._nullCell=Yi.fromCharData([0,ET,1,0]),this._whitespaceCell=Yi.fromCharData([0,jn,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new hh,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new Sx(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 ah),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 ah),this._whitespaceCell}getBlankLine(e,t){return new ol(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>wx?wx:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=Ct);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 Sx(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let s=this.getNullCell(Ct),n=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++)n+=+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 ol(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 ol(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++)n+=+this.lines.get(l).resize(e,s);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),n>.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,n=OH(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(Ct),s);if(n.length>0){let o=NH(this.lines,n);LH(this.lines,o.layout),this._reflowLargerAdjustViewport(e,t,o.countRemoved)}}_reflowLargerAdjustViewport(e,t,s){let n=this.getNullCell(Ct),o=s;for(;o-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new ol(e,n))):(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,n=this.getNullCell(Ct),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=BH(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(Ct,!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,R=d;for(;E>=0;){let M=Math.min(R,S);if(f[b]===void 0)break;if(f[b].copyCellsFrom(f[E],R-M,S-M,M,!0),S-=M,S===0&&(b--,S=p[b]),R-=M,R===0){E--;let k=Math.max(E,0);R=Cl(f,k,this._cols)}}for(let M=0;M<f.length;M++)p[M]<e&&f[M].setCell(p[M],n);let A=v-_;for(;A-- >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,n){let o=this.lines.get(e);return o?o.translateToString(t,s,n):""}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 PH(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)}},zH=class extends ze{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 xx(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new xx(!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)}},ck=2,uk=1,ug=class extends ze{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,ck),this.rows=Math.max(e.rawOptions.rows||0,uk),this.buffers=this._register(new zH(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,n=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:s,rowsChanged:n})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let s=this.buffer,n;n=this._cachedBlankLine,(!n||n.length!==this.cols||n.getFg(0)!==e.fg||n.getBg(0)!==e.bg)&&(n=s.getBlankLine(e,t),this._cachedBlankLine=n),n.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(n):s.lines.push(n.clone()):s.lines.splice(l+1,0,n.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,n.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 n=s.ydisp;s.ydisp=Math.max(Math.min(s.ydisp+e,s.ybase),0),n!==s.ydisp&&(t||this._onScroll.fire(s.ydisp))}};ug=gt([ge(0,ai)],ug);var Eo={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:uh,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},jH=["normal","bold","100","200","300","400","500","600","700","800","900"],HH=class extends ze{constructor(e){super(),this._onOptionChange=this._register(new pe),this.onOptionChange=this._onOptionChange.event;let t={...Eo};for(let s in e)if(s in t)try{let n=e[s];t[s]=this._sanitizeAndValidateOption(s,n)}catch(n){console.error(n)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(at(()=>{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 Eo))throw new Error(`No option with key "${s}"`);return this.rawOptions[s]},t=(s,n)=>{if(!(s in Eo))throw new Error(`No option with key "${s}"`);n=this._sanitizeAndValidateOption(s,n),this.rawOptions[s]!==n&&(this.rawOptions[s]=n,this._onOptionChange.fire(s))};for(let s in this.rawOptions){let n={get:e.bind(this,s),set:t.bind(this,s)};Object.defineProperty(this.options,s,n)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=Eo[e]),!IH(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=Eo[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=jH.includes(t)?t:Eo[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 IH(e){return e==="block"||e==="underline"||e==="bar"}function al(e,t=5){if(typeof e!="object")return e;let s=Array.isArray(e)?[]:{};for(let n in e)s[n]=t<=1?e[n]:e[n]&&al(e[n],t-1);return s}var Cx=Object.freeze({insertMode:!1}),Ex=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),hg=class extends ze{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=al(Cx),this.decPrivateModes=al(Ex)}reset(){this.modes=al(Cx),this.decPrivateModes=al(Ex)}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(n=>n.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))}};hg=gt([ge(0,oi),ge(1,MT),ge(2,ai)],hg);var Tx={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 Wm(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 Km=String.fromCharCode,kx={DEFAULT:e=>{let t=[Wm(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${Km(t[0])}${Km(t[1])}${Km(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Wm(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Wm(e,!0)};${e.x};${e.y}${t}`}},dg=class extends ze{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 n of Object.keys(Tx))this.addProtocol(n,Tx[n]);for(let n of Object.keys(kx))this.addEncoding(n,kx[n]);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 n=t/s,o=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(o/=n+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)}};dg=gt([ge(0,oi),ge(1,Br),ge(2,ai)],dg);var Ym=[[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]],VH=[[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]],Dt;function UH(e,t){let s=0,n=t.length-1,o;if(e<t[0][0]||e>t[n][1])return!1;for(;n>=s;)if(o=s+n>>1,e>t[o][1])s=o+1;else if(e<t[o][0])n=o-1;else return!0;return!1}var FH=class{constructor(){if(this.version="6",!Dt){Dt=new Uint8Array(65536),Dt.fill(1),Dt[0]=0,Dt.fill(0,1,32),Dt.fill(0,127,160),Dt.fill(2,4352,4448),Dt[9001]=2,Dt[9002]=2,Dt.fill(2,11904,42192),Dt[12351]=1,Dt.fill(2,44032,55204),Dt.fill(2,63744,64256),Dt.fill(2,65040,65050),Dt.fill(2,65072,65136),Dt.fill(2,65280,65377),Dt.fill(2,65504,65511);for(let e=0;e<Ym.length;++e)Dt.fill(0,Ym[e][0],Ym[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?Dt[e]:UH(e,VH)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let s=this.wcwidth(e),n=s===0&&t!==0;if(n){let o=Er.extractWidth(t);o===0?n=!1:o>s&&(s=o)}return Er.createPropertyValue(0,s,n)}},Er=class Vu{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new pe,this.onChange=this._onChange.event;let t=new FH;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,n=!1){return(t&16777215)<<3|(s&3)<<1|(n?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,n=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,n),f=Vu.extractWidth(h);Vu.extractShouldJoin(h)&&(f-=Vu.extractWidth(n)),s+=f,n=h}return s}charProperties(t,s){return this._activeProvider.charProperties(t,s)}},WH=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 Rx(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 Qa=2147483647,KH=256,hk=class fg{constructor(t=32,s=32){if(this.maxLength=t,this.maxSubParamsLength=s,s>KH)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 fg;if(!t.length)return s;for(let n=Array.isArray(t[0])?1:0;n<t.length;++n){let o=t[n];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 fg(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 n=this._subParamsIdx[s]>>8,o=this._subParamsIdx[s]&255;o-n>0&&t.push(Array.prototype.slice.call(this._subParams,n,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>Qa?Qa: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>Qa?Qa: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,n=this._subParamsIdx[t]&255;return n-s>0?this._subParams.subarray(s,n):null}getSubParamsAll(){let t={};for(let s=0;s<this.length;++s){let n=this._subParamsIdx[s]>>8,o=this._subParamsIdx[s]&255;o-n>0&&(t[s]=this._subParams.slice(n,o))}return t}addDigit(t){let s;if(this._rejectDigits||!(s=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let n=this._digitIsSub?this._subParams:this.params,o=n[s-1];n[s-1]=~o?Math.min(o*10+t,Qa):t}},Ja=[],YH=class{constructor(){this._state=0,this._active=Ja,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 n=s.indexOf(t);n!==-1&&s.splice(n,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=Ja}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=Ja,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||Ja,!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",Bh(e,t,s));else for(let n=this._active.length-1;n>=0;n--)this._active[n].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 n=e[t++];if(n===59){this._state=2,this._start();break}if(n<48||57<n){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+n-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,n=this._active.length-1,o=!1;if(this._stack.paused&&(n=this._stack.loopPosition-1,s=t,o=this._stack.fallThrough,this._stack.paused=!1),!o&&s===!1){for(;n>=0&&(s=this._active[n].end(e),s!==!0);n--)if(s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!1,s;n--}for(;n>=0;n--)if(s=this._active[n].end(!1),s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!0,s}this._active=Ja,this._id=-1,this._state=0}}},Ti=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+=Bh(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}},el=[],qH=class{constructor(){this._handlers=Object.create(null),this._active=el,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=el}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let s=this._handlers[e];return s.push(t),{dispose:()=>{let n=s.indexOf(t);n!==-1&&s.splice(n,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=el,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||el,!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",Bh(e,t,s));else for(let n=this._active.length-1;n>=0;n--)this._active[n].put(e,t,s)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let s=!1,n=this._active.length-1,o=!1;if(this._stack.paused&&(n=this._stack.loopPosition-1,s=t,o=this._stack.fallThrough,this._stack.paused=!1),!o&&s===!1){for(;n>=0&&(s=this._active[n].unhook(e),s!==!0);n--)if(s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!1,s;n--}for(;n>=0;n--)if(s=this._active[n].unhook(!1),s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!0,s}this._active=el,this._ident=0}},ll=new hk;ll.addParam(0);var Ax=class{constructor(e){this._handler=e,this._data="",this._params=ll,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():ll,this._data="",this._hitLimit=!1}put(e,t,s){this._hitLimit||(this._data+=Bh(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=ll,this._data="",this._hitLimit=!1,s));return this._params=ll,this._data="",this._hitLimit=!1,t}},$H=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,s,n){this.table[t<<8|e]=s<<4|n}addMany(e,t,s,n){for(let o=0;o<e.length;o++)this.table[t<<8|e[o]]=s<<4|n}},Fi=160,GH=(function(){let e=new $H(4095),t=Array.apply(null,Array(256)).map((h,f)=>f),s=(h,f)=>t.slice(h,f),n=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(n,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(n,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(n,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(n,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(Fi,0,2,0),e.add(Fi,8,5,8),e.add(Fi,6,0,6),e.add(Fi,11,0,11),e.add(Fi,13,13,13),e})(),XH=class extends ze{constructor(e=GH){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 hk,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,s,n)=>{},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(at(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new YH),this._dcsParser=this._register(new qH),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 n=e.final.charCodeAt(0);if(t[0]>n||n>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return s<<=8,s|=n,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 n=this._escHandlers[s];return n.push(t),{dispose:()=>{let o=n.indexOf(t);o!==-1&&n.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 n=this._csiHandlers[s];return n.push(t),{dispose:()=>{let o=n.indexOf(t);o!==-1&&n.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,n,o){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=s,this._parseStack.transition=n,this._parseStack.chunkPos=o}parse(e,t,s){let n=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(n=e[this._parseStack.chunkPos],c=this._dcsParser.unhook(n!==24&&n!==26,s),c)return c;n===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(n=e[this._parseStack.chunkPos],c=this._oscParser.end(n!==24&&n!==26,s),c)return c;n===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(n=e[h],o=this._transitions.table[this.currentState<<8|(n<160?n:Fi)],o>>4){case 2:for(let _=h+1;;++_){if(_>=t||(n=e[_])<32||n>126&&n<Fi){this._printHandler(e,h,_),h=_-1;break}if(++_>=t||(n=e[_])<32||n>126&&n<Fi){this._printHandler(e,h,_),h=_-1;break}if(++_>=t||(n=e[_])<32||n>126&&n<Fi){this._printHandler(e,h,_),h=_-1;break}if(++_>=t||(n=e[_])<32||n>126&&n<Fi){this._printHandler(e,h,_),h=_-1;break}}break;case 3:this._executeHandlers[n]?this._executeHandlers[n]():this._executeHandlerFb(n),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:h,code:n,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let f=this._csiHandlers[this._collect<<8|n],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|n,this._params),this.precedingJoinState=0;break;case 8:do switch(n){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(n-48)}while(++h<t&&(n=e[h])>47&&n<60);h--;break;case 9:this._collect<<=8,this._collect|=n;break;case 10:let p=this._escHandlers[this._collect<<8|n],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|n),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|n,this._params);break;case 13:for(let _=h+1;;++_)if(_>=t||(n=e[_])===24||n===26||n===27||n>127&&n<Fi){this._dcsParser.put(e,h,_),h=_-1;break}break;case 14:if(c=this._dcsParser.unhook(n!==24&&n!==26),c)return this._preserveStack(6,[],0,o,h),c;n===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||(n=e[_])<32||n>127&&n<Fi){this._oscParser.put(e,h,_),h=_-1;break}break;case 6:if(c=this._oscParser.end(n!==24&&n!==26),c)return this._preserveStack(5,[],0,o,h),c;n===27&&(o|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=o&15}}},ZH=/^([\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})$/,QH=/^[\da-f]+$/;function Mx(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let s=ZH.exec(t);if(s){let n=s[1]?15:s[4]?255:s[7]?4095:65535;return[Math.round(parseInt(s[1]||s[4]||s[7]||s[10],16)/n*255),Math.round(parseInt(s[2]||s[5]||s[8]||s[11],16)/n*255),Math.round(parseInt(s[3]||s[6]||s[9]||s[12],16)/n*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),QH.exec(t)&&[3,6,9,12].includes(t.length))){let s=t.length/3,n=[0,0,0];for(let o=0;o<3;++o){let l=parseInt(t.slice(s*o,s*o+s),16);n[o]=s===1?l<<4:s===2?l:s===3?l>>4:l>>8}return n}}function qm(e,t){let s=e.toString(16),n=s.length<2?"0"+s:s;switch(t){case 4:return s[0];case 8:return n;case 12:return(n+n).slice(0,3);default:return n+n}}function JH(e,t=16){let[s,n,o]=e;return`rgb:${qm(s,t)}/${qm(n,t)}/${qm(o,t)}`}var eI={"(":0,")":1,"*":2,"+":3,"-":1,".":2},On=131072,Dx=10;function Ox(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 Nx=5e3,Lx=0,tI=class extends ze{constructor(e,t,s,n,o,l,c,h,f=new XH){super(),this._bufferService=e,this._charsetService=t,this._coreService=s,this._logService=n,this._optionsService=o,this._oscLinkService=l,this._coreMouseService=c,this._unicodeService=h,this._parser=f,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new bj,this._utf8Decoder=new Sj,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=Ct.clone(),this._eraseAttrDataInternal=Ct.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 mg(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(de.BEL,()=>this.bell()),this._parser.setExecuteHandler(de.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(de.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(de.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(de.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(de.BS,()=>this.backspace()),this._parser.setExecuteHandler(de.HT,()=>this.tab()),this._parser.setExecuteHandler(de.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(de.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(Hu.IND,()=>this.index()),this._parser.setExecuteHandler(Hu.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(Hu.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new Ti(d=>(this.setTitle(d),this.setIconName(d),!0))),this._parser.registerOscHandler(1,new Ti(d=>this.setIconName(d))),this._parser.registerOscHandler(2,new Ti(d=>this.setTitle(d))),this._parser.registerOscHandler(4,new Ti(d=>this.setOrReportIndexedColor(d))),this._parser.registerOscHandler(8,new Ti(d=>this.setHyperlink(d))),this._parser.registerOscHandler(10,new Ti(d=>this.setOrReportFgColor(d))),this._parser.registerOscHandler(11,new Ti(d=>this.setOrReportBgColor(d))),this._parser.registerOscHandler(12,new Ti(d=>this.setOrReportCursorColor(d))),this._parser.registerOscHandler(104,new Ti(d=>this.restoreIndexedColor(d))),this._parser.registerOscHandler(110,new Ti(d=>this.restoreFgColor(d))),this._parser.registerOscHandler(111,new Ti(d=>this.restoreBgColor(d))),this._parser.registerOscHandler(112,new Ti(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 Nt)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 Ax((d,p)=>this.requestStatusString(d,p)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,s,n){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=s,this._parseStack.position=n}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,s)=>setTimeout(()=>s("#SLOW_TIMEOUT"),Nx))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${Nx} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let s,n=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;n=this._parseStack.cursorStartX,o=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>On&&(l=this._parseStack.position+On)}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<On&&(this._parseBuffer=new Uint32Array(Math.min(e.length,On))),c||this._dirtyRowTracker.clearRange(),e.length>On)for(let d=l;d<e.length;d+=On){let p=d+On<e.length?d+On: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(n,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(n,o,d,0),this._logSlowResolvingAsync(s),s}(this._activeBuffer.x!==n||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 n,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(n=e[y],n<127&&l){let R=l[String.fromCharCode(n)];R&&(n=R.charCodeAt(0))}let b=this._unicodeService.charProperties(n,_);o=Er.extractWidth(b);let S=Er.extractShouldJoin(b),E=S?Er.extractWidth(_):0;if(_=b,c&&this._onA11yChar.fire(Pn(n)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+o-E>h){if(f){let R=v,A=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 ol&&v.copyCellsFrom(R,A,0,E,!1);A<h;)R.setCellFromCodepoint(A++,0,1,p)}else if(this._activeBuffer.x=h-1,o===2)continue}if(S&&this._activeBuffer.x){let R=v.getWidth(this._activeBuffer.x-1)?1:2;v.addCodepointToCell(this._activeBuffer.x-R,n,o);for(let A=o-E;--A>=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++,n,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=>Ox(s.params[0],this._optionsService.rawOptions.windowOptions)?t(s):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new Ax(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new Ti(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,n=!1,o=!1){let l=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);l.replaceCells(t,s,this._activeBuffer.getNullCell(this._eraseAttrData()),o),n&&(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 n=this._activeBuffer.lines.length-this._bufferService.rows;n>0&&(this._activeBuffer.lines.trimStart(n),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-n,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-n,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,n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,o=this._bufferService.rows-1+this._activeBuffer.ybase-n+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,n;for(n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,n=this._bufferService.rows-1+this._activeBuffer.ybase-n;t--;)this._activeBuffer.lines.splice(s,1),this._activeBuffer.lines.splice(n,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}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(Ct));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 n=this._activeBuffer.lines.get(this._activeBuffer.ybase+s);n.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.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 n=this._activeBuffer.lines.get(this._activeBuffer.ybase+s);n.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.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 n=this._activeBuffer.lines.get(this._activeBuffer.ybase+s);n.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.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 n=this._activeBuffer.lines.get(this._activeBuffer.ybase+s);n.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.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,n=Er.extractWidth(t),o=this._activeBuffer.x-n,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(de.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(de.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(de.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(de.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(de.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,wr),this._charsetService.setgCharset(1,wr),this._charsetService.setgCharset(2,wr),this._charsetService.setgCharset(3,wr);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 n=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(`${de.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(n.applicationCursorKeys)):b===3?_(b,v.windowOptions.setWinLines?f===80?2:f===132?1:0:0):b===6?_(b,y(n.origin)):b===7?_(b,y(n.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(n.reverseWraparound)):b===66?_(b,y(n.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(n.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(n.bracketedPasteMode)):b===2026?_(b,y(n.synchronizedOutput)):_(b,0)}_updateAttrColor(e,t,s,n,o){return t===2?(e|=50331648,e&=-16777216,e|=Nl.fromColorRGB([s,n,o])):t===5&&(e&=-50331904,e|=33554432|s&255),e}_extractColor(e,t,s){let n=[0,0,-1,0,0,0],o=0,l=0;do{if(n[l+o]=e.params[t+l],e.hasSubParams(t+l)){let c=e.getSubParams(t+l),h=0;do n[1]===5&&(o=1),n[l+h+1+o]=c[h];while(++h<c.length&&h+l+1+o<n.length);break}if(n[1]===5&&l+o>=2||n[1]===2&&l+o>=5)break;n[1]&&(o=1)}while(++l+t<e.length&&l+o<n.length);for(let c=2;c<n.length;++c)n[c]===-1&&(n[c]=0);switch(n[0]){case 38:s.fg=this._updateAttrColor(s.fg,n[1],n[3],n[4],n[5]);break;case 48:s.bg=this._updateAttrColor(s.bg,n[1],n[3],n[4],n[5]);break;case 58:s.extended=s.extended.clone(),s.extended.underlineColor=this._updateAttrColor(s.extended.underlineColor,n[1],n[3],n[4],n[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=Ct.fg,e.bg=Ct.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,n=this._curAttrData;for(let o=0;o<t;o++)s=e.params[o],s>=30&&s<=37?(n.fg&=-50331904,n.fg|=16777216|s-30):s>=40&&s<=47?(n.bg&=-50331904,n.bg|=16777216|s-40):s>=90&&s<=97?(n.fg&=-50331904,n.fg|=16777216|s-90|8):s>=100&&s<=107?(n.bg&=-50331904,n.bg|=16777216|s-100|8):s===0?this._processSGR0(n):s===1?n.fg|=134217728:s===3?n.bg|=67108864:s===4?(n.fg|=268435456,this._processUnderline(e.hasSubParams(o)?e.getSubParams(o)[0]:1,n)):s===5?n.fg|=536870912:s===7?n.fg|=67108864:s===8?n.fg|=1073741824:s===9?n.fg|=2147483648:s===2?n.bg|=134217728:s===21?this._processUnderline(2,n):s===22?(n.fg&=-134217729,n.bg&=-134217729):s===23?n.bg&=-67108865:s===24?(n.fg&=-268435457,this._processUnderline(0,n)):s===25?n.fg&=-536870913:s===27?n.fg&=-67108865:s===28?n.fg&=-1073741825:s===29?n.fg&=2147483647:s===39?(n.fg&=-67108864,n.fg|=Ct.fg&16777215):s===49?(n.bg&=-67108864,n.bg|=Ct.bg&16777215):s===38||s===48||s===58?o+=this._extractColor(e,o,n):s===53?n.bg|=1073741824:s===55?n.bg&=-1073741825:s===59?(n.extended=n.extended.clone(),n.extended.underlineColor=-1,n.updateExtended()):s===100?(n.fg&=-67108864,n.fg|=Ct.fg&16777215,n.bg&=-67108864,n.bg|=Ct.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",s);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${de.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,s=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${de.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(`${de.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=Ct.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(!Ox(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(`${de.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>Dx&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>Dx&&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 n=s.shift(),o=s.shift();if(/^\d+$/.exec(n)){let l=parseInt(n);if(Bx(l))if(o==="?")t.push({type:0,index:l});else{let c=Mx(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(),n=e.slice(t+1);return n?this._createHyperlink(s,n):s.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let s=e.split(":"),n,o=s.findIndex(l=>l.startsWith("id="));return o!==-1&&(n=s[o].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:n,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 n=0;n<s.length&&!(t>=this._specialColors.length);++n,++t)if(s[n]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let o=Mx(s[n]);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 n=0;n<s.length;++n)if(/^\d+$/.exec(s[n])){let o=parseInt(s[n]);Bx(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,wr),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(eI[e[0]],Nt[e[1]]||wr),!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=Ct.clone(),this._eraseAttrDataInternal=Ct.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,n=this._activeBuffer.lines.get(s);n&&(n.fill(e),n.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let s=c=>(this._coreService.triggerDataEvent(`${de.ESC}${c}${de.ESC}\\`),!0),n=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${n.scrollTop+1};${n.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)}},mg=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&&(Lx=e,e=t,t=Lx),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};mg=gt([ge(0,oi)],mg);function Bx(e){return 0<=e&&e<256}var iI=5e7,Px=12,sI=50,nI=class extends ze{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 n=this._callbacks.shift();n&&n()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>iI)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 n=this._writeBuffer[this._bufferOffset],o=this._action(n,t);if(o){let c=h=>performance.now()-s>=Px?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-=n.length,performance.now()-s>=Px)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>sI&&(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()}},pg=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,n=this._getEntryIdKey(s),o=this._entriesWithId.get(n);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(n=>n.line!==t)){let n=this._bufferService.buffer.addMarker(t);s.lines.push(n),n.onDispose(()=>this._removeMarkerFromLink(s,n))}}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)))}};pg=gt([ge(0,oi)],pg);var zx=!1,rI=class extends ze{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new Wo),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 AH,this.optionsService=this._register(new HH(e)),this._instantiationService.setService(ai,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(ug)),this._instantiationService.setService(oi,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(cg)),this._instantiationService.setService(MT,this._logService),this.coreService=this._register(this._instantiationService.createInstance(hg)),this._instantiationService.setService(Br,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(dg)),this._instantiationService.setService(AT,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Er)),this._instantiationService.setService(Ej,this.unicodeService),this._charsetService=this._instantiationService.createInstance(WH),this._instantiationService.setService(Cj,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(pg),this._instantiationService.setService(DT,this._oscLinkService),this._inputHandler=this._register(new tI(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register($t.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register($t.forward(this._bufferService.onResize,this._onResize)),this._register($t.forward(this.coreService.onData,this._onData)),this._register($t.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 nI((t,s)=>this._inputHandler.parse(t,s))),this._register($t.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&&!zx&&(this._logService.warn("writeSync is unreliable and will be removed soon."),zx=!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,ck),t=Math.max(t,uk),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(Rx.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(Rx(this._bufferService),!1))),this._windowsWrappingHeuristics.value=at(()=>{for(let t of e)t.dispose()})}}},oI={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 aI(e,t,s,n){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=de.ESC+"OA":o.key=de.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?o.key=de.ESC+"OD":o.key=de.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?o.key=de.ESC+"OC":o.key=de.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?o.key=de.ESC+"OB":o.key=de.ESC+"[B");break;case 8:o.key=e.ctrlKey?"\b":de.DEL,e.altKey&&(o.key=de.ESC+o.key);break;case 9:if(e.shiftKey){o.key=de.ESC+"[Z";break}o.key=de.HT,o.cancel=!0;break;case 13:o.key=e.altKey?de.ESC+de.CR:de.CR,o.cancel=!0;break;case 27:o.key=de.ESC,e.altKey&&(o.key=de.ESC+de.ESC),o.cancel=!0;break;case 37:if(e.metaKey)break;l?o.key=de.ESC+"[1;"+(l+1)+"D":t?o.key=de.ESC+"OD":o.key=de.ESC+"[D";break;case 39:if(e.metaKey)break;l?o.key=de.ESC+"[1;"+(l+1)+"C":t?o.key=de.ESC+"OC":o.key=de.ESC+"[C";break;case 38:if(e.metaKey)break;l?o.key=de.ESC+"[1;"+(l+1)+"A":t?o.key=de.ESC+"OA":o.key=de.ESC+"[A";break;case 40:if(e.metaKey)break;l?o.key=de.ESC+"[1;"+(l+1)+"B":t?o.key=de.ESC+"OB":o.key=de.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(o.key=de.ESC+"[2~");break;case 46:l?o.key=de.ESC+"[3;"+(l+1)+"~":o.key=de.ESC+"[3~";break;case 36:l?o.key=de.ESC+"[1;"+(l+1)+"H":t?o.key=de.ESC+"OH":o.key=de.ESC+"[H";break;case 35:l?o.key=de.ESC+"[1;"+(l+1)+"F":t?o.key=de.ESC+"OF":o.key=de.ESC+"[F";break;case 33:e.shiftKey?o.type=2:e.ctrlKey?o.key=de.ESC+"[5;"+(l+1)+"~":o.key=de.ESC+"[5~";break;case 34:e.shiftKey?o.type=3:e.ctrlKey?o.key=de.ESC+"[6;"+(l+1)+"~":o.key=de.ESC+"[6~";break;case 112:l?o.key=de.ESC+"[1;"+(l+1)+"P":o.key=de.ESC+"OP";break;case 113:l?o.key=de.ESC+"[1;"+(l+1)+"Q":o.key=de.ESC+"OQ";break;case 114:l?o.key=de.ESC+"[1;"+(l+1)+"R":o.key=de.ESC+"OR";break;case 115:l?o.key=de.ESC+"[1;"+(l+1)+"S":o.key=de.ESC+"OS";break;case 116:l?o.key=de.ESC+"[15;"+(l+1)+"~":o.key=de.ESC+"[15~";break;case 117:l?o.key=de.ESC+"[17;"+(l+1)+"~":o.key=de.ESC+"[17~";break;case 118:l?o.key=de.ESC+"[18;"+(l+1)+"~":o.key=de.ESC+"[18~";break;case 119:l?o.key=de.ESC+"[19;"+(l+1)+"~":o.key=de.ESC+"[19~";break;case 120:l?o.key=de.ESC+"[20;"+(l+1)+"~":o.key=de.ESC+"[20~";break;case 121:l?o.key=de.ESC+"[21;"+(l+1)+"~":o.key=de.ESC+"[21~";break;case 122:l?o.key=de.ESC+"[23;"+(l+1)+"~":o.key=de.ESC+"[23~";break;case 123:l?o.key=de.ESC+"[24;"+(l+1)+"~":o.key=de.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=de.NUL:e.keyCode>=51&&e.keyCode<=55?o.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?o.key=de.DEL:e.keyCode===219?o.key=de.ESC:e.keyCode===220?o.key=de.FS:e.keyCode===221&&(o.key=de.GS);else if((!s||n)&&e.altKey&&!e.metaKey){let c=oI[e.keyCode]?.[e.shiftKey?1:0];if(c)o.key=de.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=de.ESC+f}else if(e.keyCode===32)o.key=de.ESC+(e.ctrlKey?de.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let h=e.code.slice(3,4);e.shiftKey||(h=h.toLowerCase()),o.key=de.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=de.US),e.key==="@"&&(o.key=de.NUL));break}return o}var yt=0,lI=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new hh,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new hh,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,n=new Array(this._array.length+this._insertedValues.length);for(let o=0;o<n.length;o++)s>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[s])?(n[o]=e[t],t++):n[o]=this._array[s++];this._array=n,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||(yt=this._search(t),yt===-1)||this._getKey(this._array[yt])!==t)return!1;do if(this._array[yt]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(yt),!0;while(++yt<this._array.length&&this._getKey(this._array[yt])===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),n=0;for(let o=0;o<this._array.length;o++)e[t]===o?t++:s[n++]=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&&(yt=this._search(e),!(yt<0||yt>=this._array.length)&&this._getKey(this._array[yt])===e))do yield this._array[yt];while(++yt<this._array.length&&this._getKey(this._array[yt])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(yt=this._search(e),!(yt<0||yt>=this._array.length)&&this._getKey(this._array[yt])===e))do t(this._array[yt]);while(++yt<this._array.length&&this._getKey(this._array[yt])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,s=this._array.length-1;for(;s>=t;){let n=t+s>>1,o=this._getKey(this._array[n]);if(o>e)s=n-1;else if(o<e)t=n+1;else{for(;n>0&&this._getKey(this._array[n-1])===e;)n--;return n}}return t}},$m=0,jx=0,cI=class extends ze{constructor(){super(),this._decorations=new lI(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(at(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new uI(e);if(t){let s=t.marker.onDispose(()=>t.dispose()),n=t.onDispose(()=>{n.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 n=0,o=0;for(let l of this._decorations.getKeyIterator(t))n=l.options.x??0,o=n+(l.options.width??1),e>=n&&e<o&&(!s||(l.options.layer??"bottom")===s)&&(yield l)}forEachDecorationAtCell(e,t,s,n){this._decorations.forEachByKey(t,o=>{$m=o.options.x??0,jx=$m+(o.options.width??1),e>=$m&&e<jx&&(!s||(o.options.layer??"bottom")===s)&&n(o)})}},uI=class extends Hn{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=ct.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=ct.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},hI=1e3,dI=class{constructor(e,t=hI){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 n=performance.now();if(n-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=n,this._innerRefresh();else if(!this._additionalRefreshRequested){let o=n-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)}},Hx=20,dh=class extends ze{constructor(e,t,s,n){super(),this._terminal=e,this._coreBrowserService=s,this._renderService=n,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 dI(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(`
|
|
75
|
+
`))),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(ke(o,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(at(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<Hx+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
76
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===Hx+1&&(this._liveRegion.textContent+=Bp.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,n=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",n),this._alignRowWidth(d))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let s=e.target,n=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!==n)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 n=this._rowElements.slice(-1)[0];if(s.node.compareDocumentPosition(n)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(s={node:n,offset:n.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 n=s*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${n/t})`}};dh=gt([ge(1,bv),ge(2,Js),ge(3,en)],dh);var gg=class extends ze{constructor(e,t,s,n,o){super(),this._element=e,this._mouseService=t,this._renderService=s,this._bufferService=n,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(at(()=>{Or(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(ke(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(ke(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(ke(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(ke(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 n=0;n<s.length;n++){let o=s[n];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(n=>{n?.forEach(o=>{o.link.dispose&&o.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let s=!1;for(let[n,o]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(n)&&(s=this._checkLinkProviderResult(n,e,s)):o.provideLinks(e.y,l=>{if(this._isMouseOut)return;let c=l?.map(h=>({link:h}));this._activeProviderReplies?.set(n,c),s=this._checkLinkProviderResult(n,e,s),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let s=new Set;for(let n=0;n<t.size;n++){let o=t.get(n);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 n=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&&n){let l=n.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&&fI(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,Or(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 n=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>=n&&this._currentLink.link.range.end.y<=o&&(this._clearCurrentLink(n,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,n=this._bufferService.buffer.ydisp,o=this._createLinkUnderlineEvent(s.start.x-1,s.start.y-n-1,s.end.x,s.end.y-n-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,n=e.range.end.y*this._bufferService.cols+e.range.end.x,o=t.y*this._bufferService.cols+t.x;return s<=o&&o<=n}_positionFromMouseEvent(e,t,s){let n=s.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(n)return{x:n[0],y:n[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,s,n,o){return{x1:e,y1:t,x2:s,y2:n,cols:this._bufferService.cols,fg:o}}};gg=gt([ge(1,Sv),ge(2,en),ge(3,oi),ge(4,NT)],gg);function fI(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 mI=class extends rI{constructor(e={}){super(e),this._linkifier=this._register(new Wo),this.browser=QT,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new Wo),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(cI),this._instantiationService.setService(Ll,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(sH),this._instantiationService.setService(NT,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(zp)),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($t.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register($t.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register($t.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register($t.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(at(()=>{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,n="";switch(t.index){case 256:s="foreground",n="10";break;case 257:s="background",n="11";break;case 258:s="cursor",n="12";break;default:s="ansi",n="4;"+t.index}switch(t.type){case 0:let o=rt.toColorRGB(s==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[s]);this.coreService.triggerDataEvent(`${de.ESC}]${n};${JH(o)}${XT.ST}`);break;case 1:if(s==="ansi")this._themeService.modifyColors(l=>l.ansi[t.index]=Tt.toColor(...t.color));else{let l=s;this._themeService.modifyColors(c=>c[l]=Tt.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(dh,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(de.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(de.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),n=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=n+"px",this.textarea.style.lineHeight=n+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(ke(this.element,"copy",t=>{this.hasSelection()&&_j(t,this._selectionService)}));let e=t=>yj(t,this.textarea,this.coreService,this.optionsService);this._register(ke(this.textarea,"paste",e)),this._register(ke(this.element,"paste",e)),JT?this._register(ke(this.element,"mousedown",t=>{t.button===2&&Gw(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(ke(this.element,"contextmenu",t=>{Gw(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),Av&&this._register(ke(this.element,"auxclick",t=>{t.button===1&&CT(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(ke(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(ke(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(ke(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(ke(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(ke(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(ke(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(ke(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(ke(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",Lp.get()),ik||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(tH,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(Js,this._coreBrowserService),this._register(ke(this.textarea,"focus",o=>this._handleTextAreaFocus(o))),this._register(ke(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(ng,this._document,this._helperContainer),this._instantiationService.setService(Ph,this._charSizeService),this._themeService=this._instantiationService.createInstance(lg),this._instantiationService.setService(Zo,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(ch),this._instantiationService.setService(OT,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(og,this.rows,this.screenElement)),this._instantiationService.setService(en,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(tg,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(rg),this._instantiationService.setService(Sv,this._mouseService);let n=this._linkifier.value=this._register(this._instantiationService.createInstance(gg,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(Jp,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(ag,this.element,this.screenElement,n)),this._instantiationService.setService(kj,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($t.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(eg,this.screenElement)),this._register(ke(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(dh,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",o=>this._handleScreenReaderModeOptionChange(o))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(lh,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",o=>{!this._overviewRulerRenderer&&o&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(lh,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(sg,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 n={mouseup:null,wheel:null,mousedrag:null,mousemove:null},o={mouseup:l=>(s(l),l.buttons||(this._document.removeEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.removeEventListener("mousemove",n.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?n.mousemove||(t.addEventListener("mousemove",o.mousemove),n.mousemove=o.mousemove):(t.removeEventListener("mousemove",n.mousemove),n.mousemove=null),l&16?n.wheel||(t.addEventListener("wheel",o.wheel,{passive:!1}),n.wheel=o.wheel):(t.removeEventListener("wheel",n.wheel),n.wheel=null),l&2?n.mouseup||(n.mouseup=o.mouseup):(this._document.removeEventListener("mouseup",n.mouseup),n.mouseup=null),l&4?n.mousedrag||(n.mousedrag=o.mousedrag):(this._document.removeEventListener("mousemove",n.mousedrag),n.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(ke(t,"mousedown",l=>{if(l.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(l)))return s(l),n.mouseup&&this._document.addEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.addEventListener("mousemove",n.mousedrag),this.cancel(l)})),this._register(ke(t,"wheel",l=>{if(!n.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=de.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){xT(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=aI(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),s.type===3||s.type===2){let n=this.rows-1;return this.scrollLines(s.type===2?-n:n),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===de.ETX||s.key===de.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)&&(pI(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(Ct));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(de.ESC+"[I"):this.coreService.triggerDataEvent(de.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(`${de.ESC}[4;${s};${t}t`);break;case 1:let n=this._renderService.dimensions.css.cell.width.toFixed(0),o=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${de.ESC}[6;${o};${n}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function pI(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var gI=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)}},vI=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)}},Ix=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 vI(t)}getNullCell(){return new Yi}},_I=class extends ze{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new pe),this.onBufferChange=this._onBufferChange.event,this._normal=new Ix(this._core.buffers.normal,"normal"),this._alternate=new Ix(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)}},yI=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,n)=>t(s,n.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)}},bI=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}},SI=["cols","rows"],ds=0,wI=class extends ze{constructor(e){super(),this._core=this._register(new mI(e)),this._addonManager=this._register(new gI),this._publicOptions={...this._core.options};let t=n=>this._core.options[n],s=(n,o)=>{this._checkReadonlyOptions(n),this._core.options[n]=o};for(let n in this._core.options){let o={get:t.bind(this,n),set:s.bind(this,n)};Object.defineProperty(this._publicOptions,n,o)}}_checkReadonlyOptions(e){if(SI.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 yI(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new bI(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 _I(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
|
|
77
|
+
`,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 Lp.get()},set promptLabel(e){Lp.set(e)},get tooMuchOutput(){return Bp.get()},set tooMuchOutput(e){Bp.set(e)}}}_verifyIntegers(...e){for(ds of e)if(ds===1/0||isNaN(ds)||ds%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(ds of e)if(ds&&(ds===1/0||isNaN(ds)||ds%1!==0||ds<0))throw new Error("This API only accepts positive integers")}};var xI=2,CI=1,EI=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),n=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=n-h,p=o-f-t;return{cols:Math.max(xI,Math.floor(p/e.css.cell.width)),rows:Math.max(CI,Math.floor(d/e.css.cell.height))}}};const TI=x.forwardRef(function({visible:t},s){const n=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 _=window.location.protocol==="https:"?"wss:":"ws:",y=new WebSocket(`${_}//${window.location.host}/ws/terminal`);c.current=y,f.current=!1,y.onopen=()=>{const b=o.current,S=l.current;b&&S&&(S.fit(),y.send(JSON.stringify({type:"resize",cols:b.cols,rows:b.rows})))},y.onmessage=b=>{const S=b.data;try{const E=JSON.parse(S);if(E.type==="exit"){f.current=!0,o.current?.writeln(`\r
|
|
78
|
+
\x1B[90mProcess exited (code ${E.code}). Press any key to restart.\x1B[0m`);return}}catch{}o.current?.write(S)},y.onclose=()=>{f.current||(o.current?.writeln(`\r
|
|
79
|
+
\x1B[90mDisconnected. Reconnecting...\x1B[0m`),setTimeout(d,2e3))},y.onerror=()=>{y.close()}},[]),p=x.useCallback(()=>{f.current=!0,c.current?.close(),c.current=null;const _=o.current;_&&(_.clear(),_.reset()),setTimeout(()=>d(),0)},[d]),v=x.useCallback(_=>{const y=o.current,b=l.current;y&&(y.options.fontFamily=_||'Menlo, Monaco, "Courier New", monospace',b&&b.fit())},[]);return x.useImperativeHandle(s,()=>({resetSession:p,setFontFamily:v}),[p,v]),x.useEffect(()=>{if(h.current||!n.current)return;h.current=!0;const _=localStorage.getItem("beads-board-terminal-font-family"),y=new wI({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"}}),b=new EI;return y.loadAddon(b),y.open(n.current),b.fit(),o.current=y,l.current=b,y.onData(S=>{if(f.current){f.current=!1,y.clear(),c.current?.close(),d();return}const E=c.current;E&&E.readyState===WebSocket.OPEN&&E.send(S)}),d(),()=>{c.current?.close(),y.dispose()}},[d]),x.useEffect(()=>{if(!t||!n.current)return;const _=l.current;if(!_)return;const y=setTimeout(()=>{_.fit();const S=o.current,E=c.current;S&&E&&E.readyState===WebSocket.OPEN&&E.send(JSON.stringify({type:"resize",cols:S.cols,rows:S.rows}))},50),b=new ResizeObserver(()=>{_.fit();const S=o.current,E=c.current;S&&E&&E.readyState===WebSocket.OPEN&&E.send(JSON.stringify({type:"resize",cols:S.cols,rows:S.rows}))});return b.observe(n.current),()=>{clearTimeout(y),b.disconnect()}},[t]),w.jsx("div",{ref:n,className:"h-full w-full",style:{display:t?"block":"none"}})});function kI({...e}){return w.jsx(bD,{"data-slot":"dialog",...e})}function RI({...e}){return w.jsx(SD,{"data-slot":"dialog-portal",...e})}function AI({className:e,...t}){return w.jsx(wD,{"data-slot":"dialog-overlay",className:it("fixed inset-0 z-50 bg-black/60 backdrop-blur-[2px] data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e),...t})}function MI({className:e,children:t,showCloseButton:s=!0,...n}){return w.jsxs(RI,{"data-slot":"dialog-portal",children:[w.jsx(AI,{}),w.jsxs(xD,{"data-slot":"dialog-content",className:it("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border border-border bg-card text-card-foreground p-6 shadow-2xl duration-200 outline-none 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 sm:max-w-lg",e),...n,children:[t,s&&w.jsxs(k1,{"data-slot":"dialog-close",className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[w.jsx(Ig,{}),w.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function DI({className:e,...t}){return w.jsx("div",{"data-slot":"dialog-header",className:it("flex flex-col gap-2 text-center sm:text-left",e),...t})}function OI({className:e,showCloseButton:t=!1,children:s,...n}){return w.jsxs("div",{"data-slot":"dialog-footer",className:it("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...n,children:[s,t&&w.jsx(k1,{asChild:!0,children:w.jsx("button",{className:"inline-flex items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground",children:"Close"})})]})}function NI({className:e,...t}){return w.jsx(CD,{"data-slot":"dialog-title",className:it("text-lg leading-none font-semibold",e),...t})}function LI({className:e,...t}){return w.jsx(ED,{"data-slot":"dialog-description",className:it("text-sm text-muted-foreground",e),...t})}const BI=Vg("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function Vx({className:e,variant:t="default",size:s="default",asChild:n=!1,...o}){const l=n?$x:"button";return w.jsx(l,{"data-slot":"button","data-variant":t,"data-size":s,className:it(BI({variant:t,size:s,className:e})),...o})}function PI({className:e,type:t,...s}){return w.jsx("input",{type:t,"data-slot":"input",className:it("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","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",e),...s})}function zI({className:e,...t}){return w.jsx(JO,{"data-slot":"label",className:it("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}const Ux="beads-board-terminal-font-family",jI='Menlo, Monaco, "Courier New", monospace';function HI({open:e,onClose:t,onSave:s}){const[n,o]=x.useState("");x.useEffect(()=>{e&&o(localStorage.getItem(Ux)||"")},[e]);const l=()=>{localStorage.setItem(Ux,n),s({fontFamily:n}),t()},c=()=>{t()};return w.jsx(kI,{open:e,onOpenChange:h=>{h||t()},children:w.jsxs(MI,{className:"sm:max-w-[480px]",children:[w.jsxs(DI,{children:[w.jsx(NI,{children:"Settings"}),w.jsx(LI,{className:"sr-only",children:"Configure application settings"})]}),w.jsx("div",{className:"space-y-4 py-2",children:w.jsxs("div",{children:[w.jsx("h3",{className:"text-sm font-semibold text-muted-foreground uppercase tracking-wide mb-3",children:"Terminal"}),w.jsxs("div",{className:"space-y-2",children:[w.jsx(zI,{htmlFor:"font-family",children:"Font Family"}),w.jsx(PI,{id:"font-family",value:n,onChange:h=>o(h.target.value),placeholder:jI})]})]})}),w.jsxs(OI,{children:[w.jsx(Vx,{variant:"outline",onClick:c,children:"Cancel"}),w.jsx(Vx,{className:"bg-primary/80 text-primary-foreground hover:bg-primary",onClick:l,children:"Save"})]})]})})}const Fx=40;function II(){const{data:e,loading:t,lastUpdated:s,error:n}=dL(),{data:o,loading:l}=fL(),{data:c,loading:h}=mL(),{data:f}=yL(),d=f?.name||"beads-board",p=t||l||h,v=!p&&n?n:null,[_,y]=x.useState(null),[b,S]=x.useState(null),[E,R]=x.useState(!1),[A,M]=x.useState({priority:"all",type:"all",assignee:"all",search:""}),[k,j]=x.useState(null),F=x.useRef(null),U=x.useRef(null),[H,J]=x.useState(()=>localStorage.getItem("beads-board-terminal-open")==="true"),[W,$]=x.useState(()=>{const xe=localStorage.getItem("beads-board-terminal-height");return xe?Number(xe):300}),[z,L]=x.useState(!1),[P,q]=x.useState(""),T=x.useRef(null),I=Bm(e||[],A),B=Bm(o||[],A),ee=Bm(c||[],A),X=x.useCallback((xe,Ae)=>{S(Ae||null),y(xe),j(xe),F.current&&clearTimeout(F.current),F.current=setTimeout(()=>j(null),4e3),requestAnimationFrame(()=>{const ht=document.querySelector(`[data-commit-beads~="${xe}"]`);ht&&ht.scrollIntoView({behavior:"smooth",block:"center"})})},[]),N=x.useCallback(xe=>{j(null),F.current&&clearTimeout(F.current);const Ae=document.querySelector(`[data-bead-id="${xe}"]`);Ae&&(Ae.scrollIntoView({behavior:"smooth",block:"center"}),Ae.classList.remove("animate-bead-highlight"),Ae.offsetWidth,Ae.classList.add("animate-bead-highlight"),setTimeout(()=>Ae.classList.remove("animate-bead-highlight"),1200)),S(null),y(xe)},[]),Z=x.useRef(null),[se,V]=x.useState(()=>{const xe=localStorage.getItem("beads-board-split");return xe?Number(xe):65}),[O,K]=x.useState(()=>localStorage.getItem("beads-board-git-collapsed")==="true"),Y=x.useRef(null),ie=x.useRef(null),ne=x.useRef(0),fe=x.useCallback(()=>{K(xe=>{const Ae=!xe;return localStorage.setItem("beads-board-git-collapsed",String(Ae)),Ae})},[]),me=x.useCallback(xe=>{xe.preventDefault();const Ae=Z.current,ht=Y.current,Xt=ie.current;if(!Ae||!ht||!Xt)return;O&&(K(!1),localStorage.setItem("beads-board-git-collapsed","false")),ht.style.transition="none",Xt.style.transition="none";const Es=os=>{cancelAnimationFrame(ne.current),ne.current=requestAnimationFrame(()=>{const Xn=Ae.getBoundingClientRect(),Hh=(os.clientX-Xn.left)/Xn.width*100,Vt=Math.min(85,Math.max(30,Hh));ht.style.width=`${Vt}%`,Xt.style.width=`${100-Vt}%`,Oe.current=Vt})},tn=()=>{cancelAnimationFrame(ne.current),document.removeEventListener("mousemove",Es),document.removeEventListener("mouseup",tn),ht.style.transition="",Xt.style.transition="",document.body.style.cursor="",document.body.style.userSelect="";const os=Oe.current;V(os),localStorage.setItem("beads-board-split",String(os))};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",Es),document.addEventListener("mouseup",tn)},[O]),we=x.useCallback(xe=>{q(xe),T.current&&clearTimeout(T.current),T.current=setTimeout(()=>{M(Ae=>({...Ae,search:xe}))},200)},[]),Ce=x.useCallback(xe=>{U.current?.setFontFamily(xe.fontFamily)},[]),Oe=x.useRef(se);return Oe.current=se,x.useEffect(()=>{document.title=d},[d]),x.useEffect(()=>{const xe=Ae=>{Ae.key==="`"&&(Ae.ctrlKey||Ae.metaKey)&&(Ae.preventDefault(),J(ht=>{const Xt=!ht;return localStorage.setItem("beads-board-terminal-open",String(Xt)),Xt})),Ae.key===","&&(Ae.ctrlKey||Ae.metaKey)&&(Ae.preventDefault(),L(ht=>!ht))};return window.addEventListener("keydown",xe),()=>window.removeEventListener("keydown",xe)},[]),w.jsxs("div",{className:"h-screen flex flex-col bg-background text-foreground overflow-hidden",children:[w.jsxs("header",{className:"flex items-center justify-between px-4 py-2 border-b border-border shrink-0",children:[w.jsx("h1",{className:"text-lg font-bold tracking-tight",children:d}),w.jsxs("div",{className:"flex items-center gap-3",children:[s&&w.jsxs("span",{className:"text-xs text-muted-foreground",children:["Updated ",s.toLocaleTimeString()]}),p&&w.jsx("span",{className:"text-xs text-muted-foreground animate-pulse",children:"refreshing..."}),w.jsx("button",{onClick:()=>R(xe=>!xe),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:w.jsx(L5,{className:"h-4 w-4"})}),w.jsx("button",{onClick:()=>J(xe=>{const Ae=!xe;return localStorage.setItem("beads-board-terminal-open",String(Ae)),Ae}),className:`rounded-md p-2 transition-colors ${H?"bg-primary/15 text-primary hover:bg-primary/25":"hover:bg-muted text-muted-foreground hover:text-foreground"}`,title:H?"Hide terminal (Ctrl+`)":"Show terminal (Ctrl+`)",children:w.jsx(W5,{className:"h-4 w-4"})}),w.jsx("button",{onClick:()=>L(!0),className:`rounded-md p-2 transition-colors ${z?"bg-primary/15 text-primary hover:bg-primary/25":"hover:bg-muted text-muted-foreground hover:text-foreground"}`,title:"Settings (Ctrl+,)",children:w.jsx(U5,{className:"h-4 w-4"})}),w.jsx(RL,{})]})]}),v&&w.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&&w.jsx(fj,{filters:A,onFiltersChange:xe=>{M(xe),q(xe.search)},issues:e||[],searchInput:P,onSearchChange:we}),E?w.jsx("main",{className:"flex-1 min-h-0",children:w.jsx(uj,{issues:e||[],onNodeClick:xe=>{S(null),y(xe)}})}):w.jsxs("main",{ref:Z,className:"flex flex-1 min-h-0",children:[w.jsxs("div",{ref:Y,style:O?{width:`calc(100% - ${Fx}px - 4px)`}:{width:`${se}%`},className:"flex flex-col overflow-hidden transition-[width] duration-200",children:[w.jsx("div",{className:"flex-1 min-h-0 pl-3 pt-3 pb-3 pr-0 overflow-hidden",children:w.jsx(tL,{issues:I,allIssues:e||[],ready:B,blocked:ee,loading:p,onIssueClick:X})}),H&&w.jsx("div",{className:"h-1 cursor-row-resize hover:bg-border active:bg-primary/50 shrink-0 transition-colors border-t border-border",onMouseDown:xe=>{xe.preventDefault();const Ae=xe.clientY,ht=W,Xt=tn=>{const os=Ae-tn.clientY,Xn=Math.max(100,Math.min(ht+os,window.innerHeight*.7));$(Xn),localStorage.setItem("beads-board-terminal-height",String(Xn))},Es=()=>{document.removeEventListener("mousemove",Xt),document.removeEventListener("mouseup",Es),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="row-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",Xt),document.addEventListener("mouseup",Es)}}),w.jsxs("div",{style:{height:H?`${W}px`:"0px"},className:"shrink-0 overflow-hidden flex flex-col",children:[H&&w.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:[w.jsx("button",{onClick:()=>U.current?.resetSession(),className:"rounded p-1 text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",title:"Clear session",children:w.jsx(Y5,{className:"h-3.5 w-3.5"})}),w.jsx("button",{onClick:()=>{J(!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:w.jsx(Ig,{className:"h-3.5 w-3.5"})})]}),w.jsx(TI,{ref:U,visible:H})]})]}),w.jsx("div",{className:"w-1 cursor-col-resize hover:bg-border active:bg-primary/50 shrink-0 transition-colors",onMouseDown:me}),O?w.jsx("div",{style:{width:`${Fx}px`},className:"flex flex-col items-center border-l border-border shrink-0 transition-[width] duration-200",children:w.jsx("button",{onClick:fe,className:"mt-3 p-1.5 rounded-md hover:bg-accent text-muted-foreground hover:text-foreground transition-colors",title:"Expand git log",children:w.jsx(j5,{className:"h-4 w-4"})})}):w.jsx("div",{ref:ie,style:{width:`${100-se}%`},className:"overflow-hidden transition-[width] duration-200",children:w.jsx(TL,{onCollapse:fe,onBeadClick:N,highlightedBeadId:k})})]}),w.jsx(Dz,{issueId:_,open:_!==null,onClose:()=>y(null),sourceRect:b,issues:e??void 0}),w.jsx(HI,{open:z,onClose:()=>L(!1),onSave:Ce})]})}VA.createRoot(document.getElementById("root")).render(w.jsx(x.StrictMode,{children:w.jsx(II,{})}));
|